nx_genui_sota_fetch.nx source
↩ module page · 76 lines · 5264 B
1// nx_genui_sota_fetch.nx -- GEN-AI PRODUCT-UI SOTA (operator 2026-07-05: creativefabrica 3d-print-generator +
2// myimg.ai + cling-ai.com/image "and others" -- research the RIVAL product UIs so we gain those UI capabilities
3// AND surface them as APIs for the synthetic-human (Elara) workstream). Banks the REAL product pages: the named
4// rivals, the 3D-gen product bar (Meshy/Tripo/Rodin/Luma), the image-suite bar (Krea/Leonardo/Ideogram), and the
5// capabilities-as-APIs bar (Replicate/fal). Same sovereign stack as nx_gen3d_sota_fetch. Saves
6// knowledge/fetched/gui_*.raw. Blocked hosts (Cloudflare walls) print FETCH-FAIL honestly -- a 403 is a fact.
7// expect_exit: 0 license_tier: ORIGINAL
8import "nx_syscalls.nx"
9import "nx_x509_trust_store.nx"
10import "nx_trust_store_load_from_certdata.nx"
11import "nx_https_fetch_follow.nx"
12const K_MAGIC_4194304: i64 = 4194304
13const K_MAGIC_8388608: i64 = 8388608
14
15func gu_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
16func gu_putn(v: i64) -> i64 {
17 if v == 0 { sys_write(1, "0" as *u8, 1); return 0 }
18 var m: i64 = v
19 if m < 0 { sys_write(1, "-" as *u8, 1); m = 0 - m }
20 let d: *u8 = sys_mmap(24); var k: i64 = 0
21 while m > 0 { d[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 }
22 var j: i64 = k - 1
23 while j >= 0 { sys_write(1, ((d as i64)+j) as *u8, 1); j = j - 1 }
24 return 0
25}
26func gu_have(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
27func gu_fetch(url: *u8, opath: *u8, store: *TrustStore, out: *u8, cap: i64) -> i64 {
28 if gu_have(opath) == 1 { gu_puts(opath); gu_puts(" [have-skip]\n"); return 1 }
29 let status: *i64 = sys_mmap(8) as *i64
30 let n: i64 = nx_https_fetch_follow(url, store, out, cap, 6, status)
31 gu_puts(url); gu_puts(" status="); gu_putn(status[0]); gu_puts(" bytes="); gu_putn(n)
32 if n <= 0 { gu_puts(" FETCH-FAIL\n"); return 0 }
33 var gz: i64 = 0
34 if n >= 2 { if out[0] == 0x1f as u8 { if out[1] == 0x8b as u8 { gz = 1 } } }
35 if gz == 1 { gu_puts(" [GZIP-skip]\n"); return 0 }
36 let fd: i64 = sys_openat_wr(opath, 0x1a4)
37 if fd < 0 { gu_puts(" SAVE-FAIL\n"); return 0 }
38 sys_write(fd, out, n); sys_close(fd)
39 gu_puts(" SAVED\n")
40 return 1
41}
42
43func main() -> i64 {
44 let r: i64 = nx_trust_store_load_from_certdata("data/mozilla_certdata.txt" as *u8, 512, K_MAGIC_4194304)
45 if r <= 0 { gu_puts("GENUI: certdata load failed\n"); return 1 }
46 let store: *TrustStore = r as *TrustStore
47 gu_puts("CA roots="); gu_putn(trust_store_count(store)); gu_puts("\n")
48 let cap: i64 = K_MAGIC_8388608
49 let out: *u8 = sys_mmap(cap)
50 var ok: i64 = 0
51
52 gu_puts("== NAMED RIVALS (operator: gain these UI capabilities) ==\n")
53 ok = ok + gu_fetch("https://studio.creativefabrica.com/3d-print-generator" as *u8, "knowledge/fetched/gui_cf_3dprint.raw" as *u8, store, out, cap) // text->3D-print product UI
54 ok = ok + gu_fetch("https://www.myimg.ai/" as *u8, "knowledge/fetched/gui_myimg.raw" as *u8, store, out, cap) // all-in-one image suite
55 ok = ok + gu_fetch("https://cling-ai.com/image" as *u8, "knowledge/fetched/gui_cling_image.raw" as *u8, store, out, cap) // image gen suite
56
57 gu_puts("== 3D-GEN PRODUCT UIs (the t23d/i23d product bar) ==\n")
58 ok = ok + gu_fetch("https://www.meshy.ai/" as *u8, "knowledge/fetched/gui_meshy.raw" as *u8, store, out, cap) // Meshy: t23d/i23d + texture + rig
59 ok = ok + gu_fetch("https://www.tripo3d.ai/" as *u8, "knowledge/fetched/gui_tripo.raw" as *u8, store, out, cap) // Tripo (TripoSR productized)
60 ok = ok + gu_fetch("https://hyper3d.ai/" as *u8, "knowledge/fetched/gui_rodin.raw" as *u8, store, out, cap) // Rodin (hyper3d)
61 ok = ok + gu_fetch("https://lumalabs.ai/genie" as *u8, "knowledge/fetched/gui_luma_genie.raw" as *u8, store, out, cap) // Luma Genie
62
63 gu_puts("== IMAGE-SUITE PRODUCT UIs (the t2i/edit bar) ==\n")
64 ok = ok + gu_fetch("https://www.krea.ai/" as *u8, "knowledge/fetched/gui_krea.raw" as *u8, store, out, cap) // Krea: realtime + enhance
65 ok = ok + gu_fetch("https://leonardo.ai/" as *u8, "knowledge/fetched/gui_leonardo.raw" as *u8, store, out, cap) // Leonardo: suite + canvas
66 ok = ok + gu_fetch("https://ideogram.ai/" as *u8, "knowledge/fetched/gui_ideogram.raw" as *u8, store, out, cap) // Ideogram: text-in-image
67
68 gu_puts("== CAPABILITIES-AS-APIS (the Elara/agency bar: every capability = a callable endpoint) ==\n")
69 ok = ok + gu_fetch("https://replicate.com/docs" as *u8, "knowledge/fetched/gui_replicate.raw" as *u8, store, out, cap) // models-as-APIs docs
70 ok = ok + gu_fetch("https://fal.ai/models" as *u8, "knowledge/fetched/gui_fal.raw" as *u8, store, out, cap) // hosted model endpoints
71
72 gu_puts("genUI SOTA: fetched/have="); gu_putn(ok); gu_puts(" / 12\n")
73 if ok >= 7 { gu_puts("verdict=GREEN (real rival product pages on disk; grep knowledge/fetched/gui_*.raw; blocked hosts noted above)\n"); sys_exit(0); return 0 }
74 gu_puts("verdict=PARTIAL (re-run to resume; JS-walled hosts print FETCH-FAIL -- note which)\n")
75 sys_exit(1); return 1
76}