@meshy-ai/cli 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/.env.example +8 -2
  2. package/README.md +342 -108
  3. package/dist/client/endpoints/animation-catalog.d.ts +37 -0
  4. package/dist/client/endpoints/animation-catalog.d.ts.map +1 -0
  5. package/dist/client/endpoints/animation-catalog.js +55 -0
  6. package/dist/client/endpoints/animation-catalog.js.map +1 -0
  7. package/dist/client/endpoints/balance.d.ts +5 -0
  8. package/dist/client/endpoints/balance.d.ts.map +1 -1
  9. package/dist/client/endpoints/balance.js +5 -1
  10. package/dist/client/endpoints/balance.js.map +1 -1
  11. package/dist/client/endpoints/base.d.ts +41 -7
  12. package/dist/client/endpoints/base.d.ts.map +1 -1
  13. package/dist/client/endpoints/base.js +61 -40
  14. package/dist/client/endpoints/base.js.map +1 -1
  15. package/dist/client/endpoints/showcases.d.ts +31 -0
  16. package/dist/client/endpoints/showcases.d.ts.map +1 -0
  17. package/dist/client/endpoints/showcases.js +49 -0
  18. package/dist/client/endpoints/showcases.js.map +1 -0
  19. package/dist/client/errors.d.ts +1 -0
  20. package/dist/client/errors.d.ts.map +1 -1
  21. package/dist/client/errors.js +1 -1
  22. package/dist/client/errors.js.map +1 -1
  23. package/dist/client/index.d.ts +47 -38
  24. package/dist/client/index.d.ts.map +1 -1
  25. package/dist/client/index.js +89 -120
  26. package/dist/client/index.js.map +1 -1
  27. package/dist/client/resource-registry.d.ts +97 -0
  28. package/dist/client/resource-registry.d.ts.map +1 -0
  29. package/dist/client/resource-registry.js +157 -0
  30. package/dist/client/resource-registry.js.map +1 -0
  31. package/dist/client/transport.d.ts +99 -0
  32. package/dist/client/transport.d.ts.map +1 -0
  33. package/dist/client/transport.js +320 -0
  34. package/dist/client/transport.js.map +1 -0
  35. package/dist/client/types.d.ts +17 -6
  36. package/dist/client/types.d.ts.map +1 -1
  37. package/dist/client/types.js +28 -6
  38. package/dist/client/types.js.map +1 -1
  39. package/dist/cmd/animation-catalog.d.ts +26 -0
  40. package/dist/cmd/animation-catalog.d.ts.map +1 -0
  41. package/dist/cmd/animation-catalog.js +80 -0
  42. package/dist/cmd/animation-catalog.js.map +1 -0
  43. package/dist/cmd/api.d.ts +3 -2
  44. package/dist/cmd/api.d.ts.map +1 -1
  45. package/dist/cmd/api.js +22 -8
  46. package/dist/cmd/api.js.map +1 -1
  47. package/dist/cmd/auth.d.ts.map +1 -1
  48. package/dist/cmd/auth.js +5 -0
  49. package/dist/cmd/auth.js.map +1 -1
  50. package/dist/cmd/balance.d.ts.map +1 -1
  51. package/dist/cmd/balance.js +10 -6
  52. package/dist/cmd/balance.js.map +1 -1
  53. package/dist/cmd/creative-lab.d.ts +26 -0
  54. package/dist/cmd/creative-lab.d.ts.map +1 -0
  55. package/dist/cmd/creative-lab.js +256 -0
  56. package/dist/cmd/creative-lab.js.map +1 -0
  57. package/dist/cmd/delete.d.ts.map +1 -1
  58. package/dist/cmd/delete.js +6 -7
  59. package/dist/cmd/delete.js.map +1 -1
  60. package/dist/cmd/doctor.d.ts +23 -0
  61. package/dist/cmd/doctor.d.ts.map +1 -0
  62. package/dist/cmd/doctor.js +61 -0
  63. package/dist/cmd/doctor.js.map +1 -0
  64. package/dist/cmd/download.d.ts +17 -0
  65. package/dist/cmd/download.d.ts.map +1 -0
  66. package/dist/cmd/download.js +436 -0
  67. package/dist/cmd/download.js.map +1 -0
  68. package/dist/cmd/inspect.d.ts +63 -0
  69. package/dist/cmd/inspect.d.ts.map +1 -0
  70. package/dist/cmd/inspect.js +179 -0
  71. package/dist/cmd/inspect.js.map +1 -0
  72. package/dist/cmd/make.d.ts +13 -3
  73. package/dist/cmd/make.d.ts.map +1 -1
  74. package/dist/cmd/make.js +240 -36
  75. package/dist/cmd/make.js.map +1 -1
  76. package/dist/cmd/mesh.d.ts +13 -0
  77. package/dist/cmd/mesh.d.ts.map +1 -0
  78. package/dist/cmd/mesh.js +67 -0
  79. package/dist/cmd/mesh.js.map +1 -0
  80. package/dist/cmd/project.d.ts +16 -0
  81. package/dist/cmd/project.d.ts.map +1 -0
  82. package/dist/cmd/project.js +136 -0
  83. package/dist/cmd/project.js.map +1 -0
  84. package/dist/cmd/resources.d.ts +5 -0
  85. package/dist/cmd/resources.d.ts.map +1 -1
  86. package/dist/cmd/resources.js +38 -10
  87. package/dist/cmd/resources.js.map +1 -1
  88. package/dist/cmd/showcases.d.ts +10 -0
  89. package/dist/cmd/showcases.d.ts.map +1 -0
  90. package/dist/cmd/showcases.js +63 -0
  91. package/dist/cmd/showcases.js.map +1 -0
  92. package/dist/cmd/slicer.d.ts +12 -0
  93. package/dist/cmd/slicer.d.ts.map +1 -0
  94. package/dist/cmd/slicer.js +46 -0
  95. package/dist/cmd/slicer.js.map +1 -0
  96. package/dist/cmd/uv-unwrap.d.ts +16 -0
  97. package/dist/cmd/uv-unwrap.d.ts.map +1 -0
  98. package/dist/cmd/uv-unwrap.js +52 -0
  99. package/dist/cmd/uv-unwrap.js.map +1 -0
  100. package/dist/index.d.ts +13 -1
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +141 -8
  103. package/dist/index.js.map +1 -1
  104. package/dist/internal/artifacts.d.ts +97 -0
  105. package/dist/internal/artifacts.d.ts.map +1 -0
  106. package/dist/internal/artifacts.js +280 -0
  107. package/dist/internal/artifacts.js.map +1 -0
  108. package/dist/internal/atomic-file.d.ts +39 -0
  109. package/dist/internal/atomic-file.d.ts.map +1 -0
  110. package/dist/internal/atomic-file.js +160 -0
  111. package/dist/internal/atomic-file.js.map +1 -0
  112. package/dist/internal/command-helpers.d.ts +46 -0
  113. package/dist/internal/command-helpers.d.ts.map +1 -0
  114. package/dist/internal/command-helpers.js +61 -0
  115. package/dist/internal/command-helpers.js.map +1 -0
  116. package/dist/internal/config.d.ts +48 -5
  117. package/dist/internal/config.d.ts.map +1 -1
  118. package/dist/internal/config.js +95 -6
  119. package/dist/internal/config.js.map +1 -1
  120. package/dist/internal/context.d.ts +25 -0
  121. package/dist/internal/context.d.ts.map +1 -0
  122. package/dist/internal/context.js +37 -0
  123. package/dist/internal/context.js.map +1 -0
  124. package/dist/internal/credentials.d.ts +11 -0
  125. package/dist/internal/credentials.d.ts.map +1 -1
  126. package/dist/internal/credentials.js +2 -0
  127. package/dist/internal/credentials.js.map +1 -1
  128. package/dist/internal/doctor.d.ts +94 -0
  129. package/dist/internal/doctor.d.ts.map +1 -0
  130. package/dist/internal/doctor.js +280 -0
  131. package/dist/internal/doctor.js.map +1 -0
  132. package/dist/internal/download.d.ts +147 -13
  133. package/dist/internal/download.d.ts.map +1 -1
  134. package/dist/internal/download.js +735 -142
  135. package/dist/internal/download.js.map +1 -1
  136. package/dist/internal/env-file.d.ts +29 -0
  137. package/dist/internal/env-file.d.ts.map +1 -0
  138. package/dist/internal/env-file.js +95 -0
  139. package/dist/internal/env-file.js.map +1 -0
  140. package/dist/internal/errors.d.ts +74 -1
  141. package/dist/internal/errors.d.ts.map +1 -1
  142. package/dist/internal/errors.js +173 -1
  143. package/dist/internal/errors.js.map +1 -1
  144. package/dist/internal/file-input.d.ts +52 -12
  145. package/dist/internal/file-input.d.ts.map +1 -1
  146. package/dist/internal/file-input.js +162 -33
  147. package/dist/internal/file-input.js.map +1 -1
  148. package/dist/internal/global-options.d.ts +6 -4
  149. package/dist/internal/global-options.d.ts.map +1 -1
  150. package/dist/internal/global-options.js +19 -4
  151. package/dist/internal/global-options.js.map +1 -1
  152. package/dist/internal/inspect.d.ts +67 -0
  153. package/dist/internal/inspect.d.ts.map +1 -0
  154. package/dist/internal/inspect.js +111 -0
  155. package/dist/internal/inspect.js.map +1 -0
  156. package/dist/internal/lock.d.ts +19 -0
  157. package/dist/internal/lock.d.ts.map +1 -0
  158. package/dist/internal/lock.js +66 -0
  159. package/dist/internal/lock.js.map +1 -0
  160. package/dist/internal/material-links.d.ts +115 -0
  161. package/dist/internal/material-links.d.ts.map +1 -0
  162. package/dist/internal/material-links.js +577 -0
  163. package/dist/internal/material-links.js.map +1 -0
  164. package/dist/internal/obj-transform.d.ts +115 -0
  165. package/dist/internal/obj-transform.d.ts.map +1 -0
  166. package/dist/internal/obj-transform.js +649 -0
  167. package/dist/internal/obj-transform.js.map +1 -0
  168. package/dist/internal/operation-store.d.ts +123 -0
  169. package/dist/internal/operation-store.d.ts.map +1 -0
  170. package/dist/internal/operation-store.js +229 -0
  171. package/dist/internal/operation-store.js.map +1 -0
  172. package/dist/internal/output.d.ts +20 -2
  173. package/dist/internal/output.d.ts.map +1 -1
  174. package/dist/internal/output.js +32 -4
  175. package/dist/internal/output.js.map +1 -1
  176. package/dist/internal/paths.d.ts +89 -0
  177. package/dist/internal/paths.d.ts.map +1 -0
  178. package/dist/internal/paths.js +168 -0
  179. package/dist/internal/paths.js.map +1 -0
  180. package/dist/internal/payload.d.ts +15 -0
  181. package/dist/internal/payload.d.ts.map +1 -1
  182. package/dist/internal/payload.js +50 -3
  183. package/dist/internal/payload.js.map +1 -1
  184. package/dist/internal/poll.d.ts +30 -4
  185. package/dist/internal/poll.d.ts.map +1 -1
  186. package/dist/internal/poll.js +99 -16
  187. package/dist/internal/poll.js.map +1 -1
  188. package/dist/internal/project-store.d.ts +197 -0
  189. package/dist/internal/project-store.d.ts.map +1 -0
  190. package/dist/internal/project-store.js +467 -0
  191. package/dist/internal/project-store.js.map +1 -0
  192. package/dist/internal/result.d.ts +50 -0
  193. package/dist/internal/result.d.ts.map +1 -0
  194. package/dist/internal/result.js +41 -0
  195. package/dist/internal/result.js.map +1 -0
  196. package/dist/internal/runtime.d.ts +35 -5
  197. package/dist/internal/runtime.d.ts.map +1 -1
  198. package/dist/internal/runtime.js +68 -18
  199. package/dist/internal/runtime.js.map +1 -1
  200. package/dist/internal/slicers.d.ts +117 -0
  201. package/dist/internal/slicers.d.ts.map +1 -0
  202. package/dist/internal/slicers.js +314 -0
  203. package/dist/internal/slicers.js.map +1 -0
  204. package/dist/internal/stream.d.ts +58 -0
  205. package/dist/internal/stream.d.ts.map +1 -0
  206. package/dist/internal/stream.js +280 -0
  207. package/dist/internal/stream.js.map +1 -0
  208. package/dist/internal/task-command.d.ts +128 -11
  209. package/dist/internal/task-command.d.ts.map +1 -1
  210. package/dist/internal/task-command.js +991 -111
  211. package/dist/internal/task-command.js.map +1 -1
  212. package/dist/internal/task-view.d.ts +56 -0
  213. package/dist/internal/task-view.d.ts.map +1 -0
  214. package/dist/internal/task-view.js +95 -0
  215. package/dist/internal/task-view.js.map +1 -0
  216. package/dist/internal/update-notifier.d.ts +5 -1
  217. package/dist/internal/update-notifier.d.ts.map +1 -1
  218. package/dist/internal/update-notifier.js +7 -3
  219. package/dist/internal/update-notifier.js.map +1 -1
  220. package/dist/root.d.ts +10 -0
  221. package/dist/root.d.ts.map +1 -1
  222. package/dist/root.js +75 -10
  223. package/dist/root.js.map +1 -1
  224. package/package.json +3 -2
  225. package/skills/meshy-cli/SKILL.md +140 -59
  226. package/dist/client/endpoints/analyze-printability.d.ts +0 -5
  227. package/dist/client/endpoints/analyze-printability.d.ts.map +0 -1
  228. package/dist/client/endpoints/analyze-printability.js +0 -7
  229. package/dist/client/endpoints/analyze-printability.js.map +0 -1
  230. package/dist/client/endpoints/animate.d.ts +0 -6
  231. package/dist/client/endpoints/animate.d.ts.map +0 -1
  232. package/dist/client/endpoints/animate.js +0 -8
  233. package/dist/client/endpoints/animate.js.map +0 -1
  234. package/dist/client/endpoints/convert.d.ts +0 -5
  235. package/dist/client/endpoints/convert.d.ts.map +0 -1
  236. package/dist/client/endpoints/convert.js +0 -7
  237. package/dist/client/endpoints/convert.js.map +0 -1
  238. package/dist/client/endpoints/image-to-3d.d.ts +0 -5
  239. package/dist/client/endpoints/image-to-3d.d.ts.map +0 -1
  240. package/dist/client/endpoints/image-to-3d.js +0 -7
  241. package/dist/client/endpoints/image-to-3d.js.map +0 -1
  242. package/dist/client/endpoints/image-to-image.d.ts +0 -5
  243. package/dist/client/endpoints/image-to-image.d.ts.map +0 -1
  244. package/dist/client/endpoints/image-to-image.js +0 -7
  245. package/dist/client/endpoints/image-to-image.js.map +0 -1
  246. package/dist/client/endpoints/multi-color-print.d.ts +0 -5
  247. package/dist/client/endpoints/multi-color-print.d.ts.map +0 -1
  248. package/dist/client/endpoints/multi-color-print.js +0 -7
  249. package/dist/client/endpoints/multi-color-print.js.map +0 -1
  250. package/dist/client/endpoints/multi-image-to-3d.d.ts +0 -5
  251. package/dist/client/endpoints/multi-image-to-3d.d.ts.map +0 -1
  252. package/dist/client/endpoints/multi-image-to-3d.js +0 -7
  253. package/dist/client/endpoints/multi-image-to-3d.js.map +0 -1
  254. package/dist/client/endpoints/remesh.d.ts +0 -5
  255. package/dist/client/endpoints/remesh.d.ts.map +0 -1
  256. package/dist/client/endpoints/remesh.js +0 -7
  257. package/dist/client/endpoints/remesh.js.map +0 -1
  258. package/dist/client/endpoints/repair-printability.d.ts +0 -5
  259. package/dist/client/endpoints/repair-printability.d.ts.map +0 -1
  260. package/dist/client/endpoints/repair-printability.js +0 -7
  261. package/dist/client/endpoints/repair-printability.js.map +0 -1
  262. package/dist/client/endpoints/resize.d.ts +0 -5
  263. package/dist/client/endpoints/resize.d.ts.map +0 -1
  264. package/dist/client/endpoints/resize.js +0 -7
  265. package/dist/client/endpoints/resize.js.map +0 -1
  266. package/dist/client/endpoints/retexture.d.ts +0 -5
  267. package/dist/client/endpoints/retexture.d.ts.map +0 -1
  268. package/dist/client/endpoints/retexture.js +0 -7
  269. package/dist/client/endpoints/retexture.js.map +0 -1
  270. package/dist/client/endpoints/rigging.d.ts +0 -6
  271. package/dist/client/endpoints/rigging.d.ts.map +0 -1
  272. package/dist/client/endpoints/rigging.js +0 -8
  273. package/dist/client/endpoints/rigging.js.map +0 -1
  274. package/dist/client/endpoints/text-to-3d.d.ts +0 -6
  275. package/dist/client/endpoints/text-to-3d.d.ts.map +0 -1
  276. package/dist/client/endpoints/text-to-3d.js +0 -8
  277. package/dist/client/endpoints/text-to-3d.js.map +0 -1
  278. package/dist/client/endpoints/text-to-image.d.ts +0 -5
  279. package/dist/client/endpoints/text-to-image.d.ts.map +0 -1
  280. package/dist/client/endpoints/text-to-image.js +0 -7
  281. package/dist/client/endpoints/text-to-image.js.map +0 -1
  282. package/dist/client/endpoints/text-to-motion.d.ts +0 -6
  283. package/dist/client/endpoints/text-to-motion.d.ts.map +0 -1
  284. package/dist/client/endpoints/text-to-motion.js +0 -8
  285. package/dist/client/endpoints/text-to-motion.js.map +0 -1
@@ -0,0 +1,577 @@
1
+ /**
2
+ * Material relinking for downloaded OBJ sets.
3
+ *
4
+ * Meshy serves an OBJ, its MTL and the textures as separate URLs and the CLI
5
+ * saves them under stable names (model.obj, model.mtl, texture_0_base_color.png
6
+ * …). The OBJ, however, names its MTL the way the server knew it (`mtllib
7
+ * box.mtl`) and the MTL names its textures the same way, so a faithfully
8
+ * downloaded set can still be unloadable. Once every file of a set has landed,
9
+ * this module rewrites those references to the names actually on disk and
10
+ * reports every link it resolved — and every one it could not. Only the two
11
+ * text files the CLI itself just wrote are touched; nothing is renamed, the
12
+ * rewritten paths are listed, and their digests are re-taken by the caller.
13
+ *
14
+ * A texture reference is resolved only when exactly one downloaded texture
15
+ * matches, in this order: the name the server served a texture under (the
16
+ * URL's last segment — `body.png` for `…/body.png`), which is the only evidence
17
+ * of *which* image the MTL meant; a saved file of that name, but only when it
18
+ * is not known to come from a different source (the CLI's generated names
19
+ * `texture_<n>_<channel>` can collide with a server-side name of another
20
+ * texture — that is an ambiguity, not a match); the same name ignoring
21
+ * extension and directories; a channel word inside the referenced name
22
+ * (…_normal.png); the channel implied by the MTL key (map_Kd → base color);
23
+ * finally "the only texture there is" when the MTL has exactly one distinct
24
+ * reference. Several candidates for the same rule is an *ambiguity*: the
25
+ * reference stays as written, the candidates are listed and the report is
26
+ * `incomplete` — the CLI never picks the first of several material groups'
27
+ * textures.
28
+ *
29
+ * The first three rules are *identity* evidence; the channel and only-texture
30
+ * rules are *heuristics*. Resolution therefore runs in two passes over the
31
+ * whole MTL: every distinct reference is resolved on its own first, then the
32
+ * heuristic results are checked against each other — a texture that several
33
+ * different references would fall back to (whichever channel rule each one
34
+ * took to get there, in whichever order they appear) serves none of them, and a
35
+ * reference that different keys would send to different textures is not
36
+ * rewritten either. Two material groups collapsing onto one image without
37
+ * evidence that they name the same file is exactly the guess this module must
38
+ * not make; a reference with identity evidence keeps its texture regardless.
39
+ * Unresolved references are reported the same way. The whole pass is
40
+ * cooperative: an abort signal stops it before the next read, write or
41
+ * publication, leaving no temp file behind.
42
+ */
43
+ import { createHash } from "node:crypto";
44
+ import { closeSync, createReadStream, createWriteStream, openSync, readFileSync, readSync, statSync, unlinkSync } from "node:fs";
45
+ import { once } from "node:events";
46
+ import { basename } from "node:path";
47
+ import { finished } from "node:stream/promises";
48
+ import { StringDecoder } from "node:string_decoder";
49
+ import { publishTempFile, tempPathFor } from "./atomic-file.js";
50
+ import { CliError } from "./errors.js";
51
+ import { warning } from "./result.js";
52
+ const WS = /\s+/;
53
+ const TEXTURE_KEY_RE = /^(?:map_[A-Za-z0-9_]+|bump|disp|decal|refl|norm)$/i;
54
+ /** MTL files larger than this are not what Meshy produces; leave them alone. */
55
+ const MAX_MTL_BYTES = 16 * 1024 * 1024;
56
+ const CHANNEL_SYNONYMS = {
57
+ basecolor: "basecolor",
58
+ albedo: "basecolor",
59
+ diffuse: "basecolor",
60
+ color: "basecolor",
61
+ colour: "basecolor",
62
+ metallic: "metallic",
63
+ metalness: "metallic",
64
+ metal: "metallic",
65
+ roughness: "roughness",
66
+ rough: "roughness",
67
+ normal: "normal",
68
+ normals: "normal",
69
+ nrm: "normal",
70
+ bump: "normal",
71
+ emissive: "emissive",
72
+ emission: "emissive",
73
+ emit: "emissive",
74
+ occlusion: "occlusion",
75
+ ao: "occlusion",
76
+ ambientocclusion: "occlusion",
77
+ opacity: "opacity",
78
+ alpha: "opacity",
79
+ transparency: "opacity",
80
+ displacement: "displacement",
81
+ height: "displacement",
82
+ disp: "displacement",
83
+ specular: "specular",
84
+ spec: "specular",
85
+ };
86
+ const MAP_KEY_CHANNEL = {
87
+ map_kd: "basecolor",
88
+ map_ka: "basecolor",
89
+ map_pm: "metallic",
90
+ map_pr: "roughness",
91
+ norm: "normal",
92
+ map_bump: "normal",
93
+ bump: "normal",
94
+ map_kn: "normal",
95
+ map_ke: "emissive",
96
+ map_d: "opacity",
97
+ disp: "displacement",
98
+ map_ks: "specular",
99
+ map_ao: "occlusion",
100
+ };
101
+ function canonicalChannel(raw) {
102
+ const compact = raw.toLowerCase().replace(/[^a-z0-9]/g, "");
103
+ return CHANNEL_SYNONYMS[compact] ?? null;
104
+ }
105
+ /** Set index and channel encoded in an asset key: `texture.0.base_color` / `texture_0_base_color`. */
106
+ export function describeTextureKey(key) {
107
+ const m = /^texture[._](\d+)[._](.+)$/.exec(key);
108
+ if (!m)
109
+ return { set: null, channel: null };
110
+ return { set: Number(m[1]), channel: canonicalChannel(m[2]) };
111
+ }
112
+ /** @deprecated kept for callers of the round-1 API. */
113
+ export function channelOfTextureKey(key) {
114
+ return describeTextureKey(key).channel;
115
+ }
116
+ /** Channel word inside a referenced file name (`texture_normal.png`, `Body_BaseColor.jpg`). */
117
+ export function channelInFileName(name) {
118
+ const stem = basename(name).replace(/\.[A-Za-z0-9]+$/, "");
119
+ const tokens = stem.split(/[^A-Za-z0-9]+|(?<=[a-z])(?=[A-Z])/).filter(Boolean);
120
+ for (let i = 0; i < tokens.length; i++) {
121
+ const pair = i + 1 < tokens.length ? canonicalChannel(`${tokens[i]}${tokens[i + 1]}`) : null;
122
+ if (pair)
123
+ return pair;
124
+ const single = canonicalChannel(tokens[i]);
125
+ if (single)
126
+ return single;
127
+ }
128
+ const compact = stem.toLowerCase().replace(/[^a-z0-9]/g, "");
129
+ for (const word of Object.keys(CHANNEL_SYNONYMS).sort((a, b) => b.length - a.length)) {
130
+ if (word.length >= 5 && compact.includes(word))
131
+ return CHANNEL_SYNONYMS[word];
132
+ }
133
+ return null;
134
+ }
135
+ function keywordOf(t) {
136
+ const m = WS.exec(t);
137
+ return m ? t.slice(0, m.index) : t;
138
+ }
139
+ function stemOf(name) {
140
+ return name.replace(/\.[A-Za-z0-9]+$/, "").toLowerCase();
141
+ }
142
+ function looksBinary(path) {
143
+ const fd = openSync(path, "r");
144
+ try {
145
+ const buf = Buffer.alloc(512);
146
+ const n = readSync(fd, buf, 0, 512, 0);
147
+ const head = buf.subarray(0, n);
148
+ if (n >= 2 && head[0] === 0x50 && head[1] === 0x4b)
149
+ return true; // PK: a ZIP bundle, not a text OBJ
150
+ return head.includes(0);
151
+ }
152
+ finally {
153
+ closeSync(fd);
154
+ }
155
+ }
156
+ /** sha256 + size of a file, for manifests that must describe what is actually on disk. */
157
+ export function fileDigest(path) {
158
+ const data = readFileSync(path);
159
+ return { bytes: data.length, sha256: createHash("sha256").update(data).digest("hex") };
160
+ }
161
+ /**
162
+ * Rewrite `path` line by line through a temp file in the same directory. The
163
+ * callback returns the replacement line (without its terminator) or null to
164
+ * keep the line. Returns true when the file was actually replaced.
165
+ */
166
+ async function rewriteLines(path, transform, signal) {
167
+ if (signal?.aborted)
168
+ throw new CliError({ code: "interrupted", message: `interrupted before ${basename(path)} was rewritten` });
169
+ const tmp = tempPathFor(path);
170
+ const out = createWriteStream(tmp, { flags: "wx" });
171
+ let writeError = null;
172
+ out.on("error", (err) => {
173
+ writeError = err;
174
+ });
175
+ let changed = false;
176
+ let buf = "";
177
+ const flush = async () => {
178
+ if (writeError)
179
+ throw writeError;
180
+ if (buf.length === 0)
181
+ return;
182
+ const chunk = buf;
183
+ buf = "";
184
+ if (!out.write(chunk))
185
+ await once(out, "drain");
186
+ if (writeError)
187
+ throw writeError;
188
+ };
189
+ const decoder = new StringDecoder("utf8");
190
+ let carry = "";
191
+ let lineNo = 0;
192
+ const emitLine = (text, eol) => {
193
+ lineNo += 1;
194
+ const next = transform(text, lineNo);
195
+ if (next !== null && next !== text) {
196
+ changed = true;
197
+ buf += next + eol;
198
+ }
199
+ else {
200
+ buf += text + eol;
201
+ }
202
+ };
203
+ try {
204
+ const stream = createReadStream(path, { highWaterMark: 256 * 1024 });
205
+ for await (const chunk of stream) {
206
+ if (signal?.aborted) {
207
+ stream.destroy();
208
+ throw new CliError({ code: "interrupted", message: `interrupted while rewriting ${basename(path)}` });
209
+ }
210
+ carry += decoder.write(chunk);
211
+ let start = 0;
212
+ let nl;
213
+ while ((nl = carry.indexOf("\n", start)) !== -1) {
214
+ let end = nl;
215
+ let eol = "\n";
216
+ if (end > start && carry.charCodeAt(end - 1) === 13) {
217
+ end -= 1;
218
+ eol = "\r\n";
219
+ }
220
+ emitLine(carry.slice(start, end), eol);
221
+ start = nl + 1;
222
+ }
223
+ carry = start > 0 ? carry.slice(start) : carry;
224
+ await flush();
225
+ }
226
+ carry += decoder.end();
227
+ if (carry.length > 0)
228
+ emitLine(carry, "");
229
+ await flush();
230
+ out.end();
231
+ await finished(out);
232
+ }
233
+ catch (err) {
234
+ out.destroy();
235
+ try {
236
+ unlinkSync(tmp);
237
+ }
238
+ catch {
239
+ /* gone */
240
+ }
241
+ if (err instanceof CliError)
242
+ throw err;
243
+ throw new CliError({ code: "local_io", message: `failed to rewrite ${path}: ${err instanceof Error ? err.message : String(err)}`, cause: err });
244
+ }
245
+ if (!changed || signal?.aborted) {
246
+ try {
247
+ unlinkSync(tmp);
248
+ }
249
+ catch {
250
+ /* gone */
251
+ }
252
+ if (signal?.aborted)
253
+ throw new CliError({ code: "interrupted", message: `interrupted before the rewritten ${basename(path)} was published; the original is untouched` });
254
+ return false;
255
+ }
256
+ publishTempFile(tmp, path, { overwrite: true });
257
+ return true;
258
+ }
259
+ function isObjKey(key) {
260
+ return key === "model.obj" || key === "model_obj";
261
+ }
262
+ function isMtlKey(key) {
263
+ return key === "model.mtl" || key === "model_mtl";
264
+ }
265
+ function isTextureKey(key) {
266
+ return /^texture[._]\d+[._]/.test(key);
267
+ }
268
+ /** Split an MTL map line into indentation, key, options and the referenced file. */
269
+ function parseMapLine(line) {
270
+ const indent = /^\s*/.exec(line)?.[0] ?? "";
271
+ const t = line.trim();
272
+ if (!t || t.startsWith("#"))
273
+ return null;
274
+ const key = keywordOf(t);
275
+ if (!TEXTURE_KEY_RE.test(key))
276
+ return null;
277
+ const rest = t.slice(key.length).trim();
278
+ if (!rest)
279
+ return null;
280
+ if (rest.startsWith("-")) {
281
+ const tokens = rest.split(WS);
282
+ return { indent, key, options: tokens.slice(0, -1).join(" "), ref: tokens.at(-1) };
283
+ }
284
+ return { indent, key, options: "", ref: rest };
285
+ }
286
+ /** Apply one rule: exactly one candidate resolves, several are an ambiguity, none falls through. */
287
+ function pick(candidates, method, identity) {
288
+ if (candidates.length === 1)
289
+ return { kind: "hit", name: candidates[0].name, method, identity };
290
+ if (candidates.length > 1)
291
+ return { kind: "ambiguous", method, candidates: candidates.map((c) => c.name) };
292
+ return null;
293
+ }
294
+ /** Channel rule: one texture of that channel is a (heuristic) hit, several are an ambiguity, none falls through. */
295
+ function pickByChannel(channel, textures, method) {
296
+ const candidates = textures.filter((t) => t.channel === channel);
297
+ if (candidates.length === 0)
298
+ return null;
299
+ if (candidates.length > 1)
300
+ return { kind: "ambiguous", method: "ambiguous", candidates: candidates.map((c) => c.name) };
301
+ return { kind: "hit", name: candidates[0].name, method, identity: false };
302
+ }
303
+ /** First pass: resolve one (key, reference) pair on its own evidence; competition between references is decided afterwards. */
304
+ function resolveTextureReference(key, ref, textures, distinctRefs) {
305
+ const refBase = basename(ref.replaceAll("\\", "/"));
306
+ const lower = refBase.toLowerCase();
307
+ // 1. The name the server served a texture under is the only evidence of which image the MTL meant.
308
+ const bySource = pick(textures.filter((t) => t.source_name !== null && t.source_name.toLowerCase() === lower), "source_name", true);
309
+ if (bySource)
310
+ return bySource;
311
+ // 2. A saved file of that name — unless it is known to come from a different
312
+ // source: the CLI's generated names can collide with another texture's
313
+ // server-side name, and "the file exists" says nothing about its identity.
314
+ const named = textures.filter((t) => t.name.toLowerCase() === lower);
315
+ if (named.length === 1) {
316
+ const t = named[0];
317
+ if (t.source_name === null || t.source_name.toLowerCase() === lower) {
318
+ return { kind: "hit", name: t.name, method: t.name === ref ? "unchanged" : "exact", identity: true };
319
+ }
320
+ return {
321
+ kind: "ambiguous",
322
+ method: "ambiguous",
323
+ candidates: [t.name],
324
+ note: `'${refBase}' is the CLI's name for a texture the server served as '${t.source_name}', so it cannot be the file this reference meant`,
325
+ };
326
+ }
327
+ if (named.length > 1)
328
+ return { kind: "ambiguous", method: "ambiguous", candidates: named.map((t) => t.name) };
329
+ const stem = stemOf(refBase);
330
+ const byStem = pick(textures.filter((t) => t.source_name !== null && stemOf(t.source_name) === stem), "source_stem", true);
331
+ if (byStem)
332
+ return byStem;
333
+ // 3. Heuristics: a channel word in the referenced name, then the channel the
334
+ // MTL key implies. Whichever one lands is what the second pass compares.
335
+ const inName = channelInFileName(refBase);
336
+ if (inName) {
337
+ const r = pickByChannel(inName, textures, "channel_in_name");
338
+ if (r)
339
+ return r;
340
+ }
341
+ const ofKey = MAP_KEY_CHANNEL[key.toLowerCase()];
342
+ if (ofKey) {
343
+ const r = pickByChannel(ofKey, textures, "channel_of_key");
344
+ if (r)
345
+ return r;
346
+ }
347
+ if (textures.length === 1 && distinctRefs === 1)
348
+ return { kind: "hit", name: textures[0].name, method: "only_texture", identity: false };
349
+ return { kind: "none" };
350
+ }
351
+ function pairId(key, ref) {
352
+ return `${key.toLowerCase()}\u0000${ref}`;
353
+ }
354
+ /**
355
+ * Second pass, two steps.
356
+ *
357
+ * Step 1 — one reference is one file. Every line that names the same file is
358
+ * reconciled across its keys: with identity evidence the keys agree by
359
+ * construction; otherwise each key's channel rule yields a candidate set (a hit
360
+ * is a set of one, an ambiguity its candidates, a key whose channel has no
361
+ * texture contributes nothing) and all of them must be the same single texture.
362
+ * When they are not — one key would make the file the base color while another
363
+ * could only make it one of two normal maps — no single texture fits every use,
364
+ * so every line of that reference stays as written and says why.
365
+ *
366
+ * Step 2 — one texture is one file too. A heuristic hit is vetoed when any
367
+ * *other* distinct reference contends for the same texture, by a hit of either
368
+ * kind or as an ambiguity it could not decide: nothing shows those references
369
+ * name the same image. Identity hits are never vetoed.
370
+ */
371
+ function arbitrate(pairs) {
372
+ const decided = new Map();
373
+ // --- step 1: reconcile every reference across its keys
374
+ const byRef = new Map();
375
+ for (const p of pairs) {
376
+ const group = byRef.get(p.ref) ?? [];
377
+ group.push(p);
378
+ byRef.set(p.ref, group);
379
+ }
380
+ const candidatesOf = (res) => (res.kind === "hit" ? [res.name] : res.kind === "ambiguous" ? res.candidates : null);
381
+ const sameSet = (a, b) => a.length === b.length && a.every((x) => b.includes(x));
382
+ for (const [ref, group] of byRef) {
383
+ const evidence = group.filter((p) => candidatesOf(p.res) !== null);
384
+ const identity = group.some((p) => p.res.kind === "hit" && p.res.identity);
385
+ const first = evidence[0] ? candidatesOf(evidence[0].res) : null;
386
+ const consistent = identity || evidence.length <= 1 || evidence.every((p) => sameSet(candidatesOf(p.res), first));
387
+ if (consistent) {
388
+ for (const p of group)
389
+ decided.set(pairId(p.key, p.ref), p.res);
390
+ continue;
391
+ }
392
+ const uses = evidence
393
+ .map((p) => (p.res.kind === "hit" ? `${p.key} would make it ${p.res.name} (${p.res.method})` : `${p.key} could only make it ${p.res.candidates.join(" or ")}`))
394
+ .join(" while ");
395
+ const note = `'${ref}' is used by ${evidence.map((p) => p.key).join(" and ")} but resolves differently per key: ${uses}; one reference names one file, so none of its lines is rewritten`;
396
+ for (const p of group) {
397
+ const own = candidatesOf(p.res);
398
+ decided.set(pairId(p.key, p.ref), own ? { kind: "ambiguous", method: "ambiguous", candidates: own, note } : p.res);
399
+ }
400
+ }
401
+ // --- step 2: heuristic hits compete on the texture they actually reached
402
+ const contenders = new Map();
403
+ const contend = (name, ref, method, identity) => {
404
+ const byRefName = contenders.get(name) ?? new Map();
405
+ if (!byRefName.has(ref) || identity)
406
+ byRefName.set(ref, method);
407
+ contenders.set(name, byRefName);
408
+ };
409
+ for (const { key, ref } of pairs) {
410
+ const res = decided.get(pairId(key, ref));
411
+ if (res.kind === "hit")
412
+ contend(res.name, ref, res.method, res.identity);
413
+ else if (res.kind === "ambiguous")
414
+ for (const c of res.candidates)
415
+ contend(c, ref, "ambiguous", false);
416
+ }
417
+ for (const { key, ref } of pairs) {
418
+ const id = pairId(key, ref);
419
+ const res = decided.get(id);
420
+ if (res.kind !== "hit" || res.identity)
421
+ continue;
422
+ const rivals = [...(contenders.get(res.name) ?? new Map())].filter(([r]) => r !== ref);
423
+ if (rivals.length === 0)
424
+ continue;
425
+ // The note is the same for every member of the group, so the caller's
426
+ // warning can say it once.
427
+ const note = `${[[ref, res.method], ...rivals]
428
+ .sort((a, b) => a[0].localeCompare(b[0]))
429
+ .map(([r, m]) => `'${r}' (${m})`)
430
+ .join(" and ")} compete for ${res.name}; different references cannot share one texture without evidence that they name the same image`;
431
+ decided.set(id, { kind: "ambiguous", method: "ambiguous", candidates: [res.name], note });
432
+ }
433
+ return decided;
434
+ }
435
+ /**
436
+ * Relink the OBJ/MTL/texture files of one download. Returns null when the set
437
+ * has no text OBJ (nothing to relink). Never throws for unresolved or
438
+ * ambiguous references; those become warnings, `resolved_to: null` entries
439
+ * and `status: "incomplete"`.
440
+ */
441
+ export async function relinkMaterials(files, opts = {}) {
442
+ const signal = opts.signal;
443
+ const obj = files.find((f) => isObjKey(f.key) && /\.obj$/i.test(f.path));
444
+ if (!obj)
445
+ return null;
446
+ if (signal?.aborted)
447
+ throw new CliError({ code: "interrupted", message: "interrupted before the material references were relinked" });
448
+ if (looksBinary(obj.path))
449
+ return null;
450
+ const mtl = files.find((f) => isMtlKey(f.key)) ?? null;
451
+ const textures = files
452
+ .filter((f) => isTextureKey(f.key))
453
+ .map((f) => {
454
+ const d = describeTextureKey(f.key);
455
+ return { key: f.key, name: basename(f.path), source_name: f.sourceName ?? null, set: d.set, channel: d.channel };
456
+ });
457
+ const report = {
458
+ obj: obj.path,
459
+ mtl: mtl?.path ?? null,
460
+ textures,
461
+ mtllib: [],
462
+ texture_maps: [],
463
+ rewritten: [],
464
+ status: "complete",
465
+ warnings: [],
466
+ };
467
+ // --- OBJ: every mtllib points at the MTL that was actually saved.
468
+ const mtlName = mtl ? basename(mtl.path) : null;
469
+ const objChanged = await rewriteLines(obj.path, (line, lineNo) => {
470
+ const t = line.trim();
471
+ if (!t || keywordOf(t) !== "mtllib")
472
+ return null;
473
+ const ref = t.slice("mtllib".length).trim();
474
+ if (!ref)
475
+ return null;
476
+ if (!mtlName) {
477
+ report.mtllib.push({ line: lineNo, material: null, reference: ref, resolved_to: null, method: "unresolved" });
478
+ return null;
479
+ }
480
+ if (ref === mtlName) {
481
+ report.mtllib.push({ line: lineNo, material: null, reference: ref, resolved_to: mtlName, method: "unchanged" });
482
+ return null;
483
+ }
484
+ report.mtllib.push({ line: lineNo, material: null, reference: ref, resolved_to: mtlName, method: "downloaded_mtl" });
485
+ const indent = /^\s*/.exec(line)?.[0] ?? "";
486
+ return `${indent}mtllib ${mtlName}`;
487
+ }, signal);
488
+ if (objChanged)
489
+ report.rewritten.push(obj.path);
490
+ if (!mtlName && report.mtllib.length > 0) {
491
+ report.status = "incomplete";
492
+ report.warnings.push(warning("material_reference_unresolved", `${basename(obj.path)} references ${report.mtllib.map((l) => `'${l.reference}'`).join(", ")} but no MTL was downloaded with it; the geometry loads without materials`));
493
+ }
494
+ // --- MTL: every map_* points at a texture that was actually saved, and only when the match is unambiguous.
495
+ if (mtl) {
496
+ if (signal?.aborted)
497
+ throw new CliError({ code: "interrupted", message: `interrupted before ${basename(mtl.path)} was relinked` });
498
+ let size = 0;
499
+ try {
500
+ size = statSync(mtl.path).size;
501
+ }
502
+ catch {
503
+ size = 0;
504
+ }
505
+ if (size > MAX_MTL_BYTES) {
506
+ report.status = "incomplete";
507
+ report.warnings.push(warning("material_reference_unresolved", `${basename(mtl.path)} is ${size} bytes; too large for an MTL, texture references were not checked`));
508
+ return report;
509
+ }
510
+ // Pass 1: every distinct (key, reference) pair on its own evidence.
511
+ const parsedLines = readFileSync(mtl.path, "utf8")
512
+ .split(/\r?\n/)
513
+ .map(parseMapLine)
514
+ .filter((p) => p !== null);
515
+ const distinctRefs = new Set(parsedLines.map((p) => p.ref));
516
+ const pairs = [];
517
+ const seenPairs = new Set();
518
+ for (const p of parsedLines) {
519
+ const id = pairId(p.key, p.ref);
520
+ if (seenPairs.has(id))
521
+ continue;
522
+ seenPairs.add(id);
523
+ pairs.push({ key: p.key, ref: p.ref, res: resolveTextureReference(p.key, p.ref, textures, distinctRefs.size) });
524
+ }
525
+ // Pass 2: heuristic hits compete on the texture they actually reached.
526
+ const decided = arbitrate(pairs);
527
+ let material = null;
528
+ const mtlChanged = await rewriteLines(mtl.path, (line, lineNo) => {
529
+ const t = line.trim();
530
+ if (keywordOf(t) === "newmtl") {
531
+ material = t.slice("newmtl".length).trim() || null;
532
+ return null;
533
+ }
534
+ const parsed = parseMapLine(line);
535
+ if (!parsed)
536
+ return null;
537
+ const res = decided.get(pairId(parsed.key, parsed.ref)) ?? { kind: "none" };
538
+ if (res.kind === "none") {
539
+ report.texture_maps.push({ line: lineNo, material, reference: parsed.ref, resolved_to: null, method: "unresolved" });
540
+ return null;
541
+ }
542
+ if (res.kind === "ambiguous") {
543
+ report.texture_maps.push({ line: lineNo, material, reference: parsed.ref, resolved_to: null, method: "ambiguous", candidates: res.candidates, ...(res.note ? { note: res.note } : {}) });
544
+ return null;
545
+ }
546
+ report.texture_maps.push({ line: lineNo, material, reference: parsed.ref, resolved_to: res.name, method: res.method });
547
+ if (res.name === parsed.ref)
548
+ return null;
549
+ return `${parsed.indent}${parsed.key}${parsed.options ? ` ${parsed.options}` : ""} ${res.name}`;
550
+ }, signal);
551
+ if (mtlChanged)
552
+ report.rewritten.push(mtl.path);
553
+ const ambiguous = report.texture_maps.filter((l) => l.method === "ambiguous");
554
+ const unresolved = report.texture_maps.filter((l) => l.method === "unresolved");
555
+ if (ambiguous.length > 0) {
556
+ report.status = "incomplete";
557
+ // One sentence per distinct reason; a note shared by a group of
558
+ // references (they compete for one texture) is said once, naming the
559
+ // material groups involved.
560
+ const reasons = new Map();
561
+ for (const l of ambiguous) {
562
+ const text = l.note ?? `'${l.reference}' could be ${l.candidates.join(" or ")}`;
563
+ const materials = reasons.get(text) ?? [];
564
+ if (l.material && !materials.includes(l.material))
565
+ materials.push(l.material);
566
+ reasons.set(text, materials);
567
+ }
568
+ report.warnings.push(warning("material_reference_ambiguous", `${basename(mtl.path)}: ${[...reasons].map(([text, materials]) => `${text}${materials.length ? ` (${materials.join(", ")})` : ""}`).join("; ")}; the references stay as written — the CLI does not guess between material groups or sources`));
569
+ }
570
+ if (unresolved.length > 0) {
571
+ report.status = "incomplete";
572
+ report.warnings.push(warning("material_reference_unresolved", `${basename(mtl.path)} references ${[...new Set(unresolved.map((l) => `'${l.reference}'`))].join(", ")} which ${textures.length === 0 ? "were not downloaded" : "match none of the downloaded textures"}; those maps stay as written`));
573
+ }
574
+ }
575
+ return report;
576
+ }
577
+ //# sourceMappingURL=material-links.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"material-links.js","sourceRoot":"","sources":["../../src/internal/material-links.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjI,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,QAAQ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