@instruktlabs/kiln 0.0.0-stage → 1.0.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 (947) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +19 -0
  3. package/.claude-plugin/plugin.json +30 -0
  4. package/.codex-plugin/plugin.json +37 -0
  5. package/.mcp.json +10 -0
  6. package/CHANGELOG.md +2579 -0
  7. package/CONTRIBUTING.md +130 -0
  8. package/LICENSE +21 -0
  9. package/README.md +443 -2
  10. package/THIRD_PARTY_NOTICES.md +62 -0
  11. package/dist/agent-providers.mjs +310 -0
  12. package/dist/agent-run.mjs +40433 -0
  13. package/dist/build.json +215 -0
  14. package/dist/cli.mjs +48027 -0
  15. package/dist/evaluator-worker.mjs +27572 -0
  16. package/dist/mcp-engine.mjs +43537 -0
  17. package/dist/mcp-server.mjs +2388 -0
  18. package/dist/viewer/app.js +4281 -0
  19. package/dist/viewer/chat.html +4409 -0
  20. package/dist/viewer/index.html +51 -0
  21. package/dist/viewer/style.css +51 -0
  22. package/docs/architecture.md +77 -0
  23. package/docs/cameras.md +181 -0
  24. package/docs/chatgpt.md +48 -0
  25. package/docs/collections.md +195 -0
  26. package/docs/community-exporter.md +95 -0
  27. package/docs/engine-handoff.md +221 -0
  28. package/docs/examples.md +171 -0
  29. package/docs/export-profiles.md +223 -0
  30. package/docs/extending.md +43 -0
  31. package/docs/geometry.md +505 -0
  32. package/docs/google.md +121 -0
  33. package/docs/harnesses.md +372 -0
  34. package/docs/install.md +542 -0
  35. package/docs/material-library.md +133 -0
  36. package/docs/migration.md +809 -0
  37. package/docs/programs.md +123 -0
  38. package/docs/projects-and-live-review.md +94 -0
  39. package/docs/rendering.md +250 -0
  40. package/docs/runtime.md +223 -0
  41. package/docs/sdk.md +137 -0
  42. package/docs/tools.md +1874 -0
  43. package/lib/_types/render-service/src/build-identity.d.mts +24 -0
  44. package/lib/_types/render-service/src/instance.d.mts +47 -0
  45. package/lib/agent/call-budget.d.ts +55 -0
  46. package/lib/agent/call-budget.js +52 -0
  47. package/lib/agent/compaction.d.ts +83 -0
  48. package/lib/agent/compaction.js +124 -0
  49. package/lib/agent/concurrency.d.ts +8 -0
  50. package/lib/agent/concurrency.js +24 -0
  51. package/lib/agent/diff.d.ts +23 -0
  52. package/lib/agent/diff.js +124 -0
  53. package/lib/agent/generate.d.ts +192 -0
  54. package/lib/agent/generate.js +240 -0
  55. package/lib/agent/hooks.d.ts +91 -0
  56. package/lib/agent/hooks.js +158 -0
  57. package/lib/agent/index.d.ts +42 -0
  58. package/lib/agent/index.js +30 -0
  59. package/lib/agent/native-prompt.d.ts +15 -0
  60. package/lib/agent/native-prompt.js +29 -0
  61. package/lib/agent/native-workflow.d.ts +4 -0
  62. package/lib/agent/native-workflow.js +30 -0
  63. package/lib/agent/providers.d.ts +188 -0
  64. package/lib/agent/providers.js +392 -0
  65. package/lib/agent/run.d.ts +72 -0
  66. package/lib/agent/run.js +245 -0
  67. package/lib/agent/skill-resources.d.ts +9 -0
  68. package/lib/agent/skill-resources.js +178 -0
  69. package/lib/agent/split-tool-result-images.d.ts +33 -0
  70. package/lib/agent/split-tool-result-images.js +47 -0
  71. package/lib/agent/stream-start.d.ts +30 -0
  72. package/lib/agent/stream-start.js +32 -0
  73. package/lib/agent/tools.d.ts +12 -0
  74. package/lib/agent/tools.js +77 -0
  75. package/lib/agent/view-render-timeout.d.ts +40 -0
  76. package/lib/agent/view-render-timeout.js +71 -0
  77. package/lib/animation-cubic.d.ts +12 -0
  78. package/lib/animation-cubic.js +44 -0
  79. package/lib/animation-spline.d.ts +50 -0
  80. package/lib/animation-spline.js +168 -0
  81. package/lib/architecture.d.ts +146 -0
  82. package/lib/architecture.js +498 -0
  83. package/lib/arena/adaptive.d.ts +38 -0
  84. package/lib/arena/adaptive.js +87 -0
  85. package/lib/arena/bradley-terry.d.ts +63 -0
  86. package/lib/arena/bradley-terry.js +165 -0
  87. package/lib/arena/index.d.ts +15 -0
  88. package/lib/arena/index.js +13 -0
  89. package/lib/assembly-transform.d.ts +7 -0
  90. package/lib/assembly-transform.js +21 -0
  91. package/lib/assembly.d.ts +105 -0
  92. package/lib/assembly.js +587 -0
  93. package/lib/asset-catalog.d.ts +13 -0
  94. package/lib/asset-catalog.js +21 -0
  95. package/lib/asset-export.d.ts +41 -0
  96. package/lib/asset-export.js +106 -0
  97. package/lib/asset-materials-node.d.ts +5 -0
  98. package/lib/asset-materials-node.js +56 -0
  99. package/lib/asset-widget.d.ts +10 -0
  100. package/lib/asset-widget.js +23 -0
  101. package/lib/assets-node.d.ts +33 -0
  102. package/lib/assets-node.js +348 -0
  103. package/lib/assets-resources.d.ts +33 -0
  104. package/lib/assets-resources.js +109 -0
  105. package/lib/assets.d.ts +91 -0
  106. package/lib/assets.js +205 -0
  107. package/lib/atomic-directory.d.ts +9 -0
  108. package/lib/atomic-directory.js +31 -0
  109. package/lib/authoring-style.d.ts +3 -0
  110. package/lib/authoring-style.js +42 -0
  111. package/lib/build-cache-node.d.ts +12 -0
  112. package/lib/build-cache-node.js +87 -0
  113. package/lib/build-cache.d.ts +24 -0
  114. package/lib/build-cache.js +229 -0
  115. package/lib/character.d.ts +132 -0
  116. package/lib/character.js +612 -0
  117. package/lib/cli-render-mode.d.ts +31 -0
  118. package/lib/cli-render-mode.js +204 -0
  119. package/lib/community-exporter.d.ts +13 -0
  120. package/lib/community-exporter.js +237 -0
  121. package/lib/composer/agent/compaction.d.ts +72 -0
  122. package/lib/composer/agent/compaction.js +103 -0
  123. package/lib/composer/agent/index.d.ts +25 -0
  124. package/lib/composer/agent/index.js +19 -0
  125. package/lib/composer/agent/prompt.d.ts +25 -0
  126. package/lib/composer/agent/prompt.js +100 -0
  127. package/lib/composer/agent/run.d.ts +91 -0
  128. package/lib/composer/agent/run.js +212 -0
  129. package/lib/composer/agent/tools.d.ts +75 -0
  130. package/lib/composer/agent/tools.js +643 -0
  131. package/lib/composer/agent/world-run.d.ts +50 -0
  132. package/lib/composer/agent/world-run.js +295 -0
  133. package/lib/composer/agent/world-tools.d.ts +20 -0
  134. package/lib/composer/agent/world-tools.js +311 -0
  135. package/lib/composer/collision.d.ts +109 -0
  136. package/lib/composer/collision.js +339 -0
  137. package/lib/composer/contract-utils.d.ts +6 -0
  138. package/lib/composer/contract-utils.js +48 -0
  139. package/lib/composer/dsl.d.ts +52 -0
  140. package/lib/composer/dsl.js +147 -0
  141. package/lib/composer/ground.d.ts +22 -0
  142. package/lib/composer/ground.js +9 -0
  143. package/lib/composer/index.d.ts +19 -0
  144. package/lib/composer/index.js +19 -0
  145. package/lib/composer/layout.d.ts +106 -0
  146. package/lib/composer/layout.js +216 -0
  147. package/lib/composer/model.d.ts +298 -0
  148. package/lib/composer/model.js +441 -0
  149. package/lib/composer/overlap.d.ts +89 -0
  150. package/lib/composer/overlap.js +139 -0
  151. package/lib/composer/presentation.d.ts +123 -0
  152. package/lib/composer/presentation.js +256 -0
  153. package/lib/composer/reachability.d.ts +78 -0
  154. package/lib/composer/reachability.js +303 -0
  155. package/lib/composer/render-port.d.ts +293 -0
  156. package/lib/composer/render-port.js +172 -0
  157. package/lib/composer/terrain-runtime.d.ts +73 -0
  158. package/lib/composer/terrain-runtime.js +328 -0
  159. package/lib/composer/terrain.d.ts +43 -0
  160. package/lib/composer/terrain.js +49 -0
  161. package/lib/composer/world-document.d.ts +722 -0
  162. package/lib/composer/world-document.js +857 -0
  163. package/lib/composer/world-integration.d.ts +78 -0
  164. package/lib/composer/world-integration.js +452 -0
  165. package/lib/composer/world-package.d.ts +312 -0
  166. package/lib/composer/world-package.js +209 -0
  167. package/lib/contracts/asset.d.ts +270 -0
  168. package/lib/contracts/asset.js +1616 -0
  169. package/lib/contracts/breadth.d.ts +197 -0
  170. package/lib/contracts/breadth.js +631 -0
  171. package/lib/contracts/environment.d.ts +13 -0
  172. package/lib/contracts/environment.js +67 -0
  173. package/lib/contracts/index.d.ts +5 -0
  174. package/lib/contracts/index.js +5 -0
  175. package/lib/contracts/integration.d.ts +94 -0
  176. package/lib/contracts/integration.js +10 -0
  177. package/lib/contracts/requirements-migration.d.ts +61 -0
  178. package/lib/contracts/requirements-migration.js +401 -0
  179. package/lib/contracts/requirements.d.ts +815 -0
  180. package/lib/contracts/requirements.js +266 -0
  181. package/lib/contracts/semantic.d.ts +124 -0
  182. package/lib/contracts/semantic.js +421 -0
  183. package/lib/deform.d.ts +31 -0
  184. package/lib/deform.js +137 -0
  185. package/lib/deformation-normals.d.ts +3 -0
  186. package/lib/deformation-normals.js +72 -0
  187. package/lib/discovery/articulation-recipes.d.ts +6 -0
  188. package/lib/discovery/articulation-recipes.js +184 -0
  189. package/lib/discovery/catalog-schema.d.ts +175 -0
  190. package/lib/discovery/catalog-schema.js +118 -0
  191. package/lib/discovery/catalog.d.ts +25 -0
  192. package/lib/discovery/catalog.js +84 -0
  193. package/lib/discovery/construction-recipes.d.ts +7 -0
  194. package/lib/discovery/construction-recipes.js +236 -0
  195. package/lib/discovery/helper-contracts.d.ts +19 -0
  196. package/lib/discovery/helper-contracts.js +1940 -0
  197. package/lib/discovery/helper-specs.d.ts +40 -0
  198. package/lib/discovery/helper-specs.js +800 -0
  199. package/lib/discovery/index.d.ts +9 -0
  200. package/lib/discovery/index.js +20 -0
  201. package/lib/discovery/intents.d.ts +3 -0
  202. package/lib/discovery/intents.js +117 -0
  203. package/lib/discovery/lexical-index.d.ts +5 -0
  204. package/lib/discovery/lexical-index.js +67 -0
  205. package/lib/discovery/query-schema.d.ts +35 -0
  206. package/lib/discovery/query-schema.js +66 -0
  207. package/lib/discovery/recipes.d.ts +6 -0
  208. package/lib/discovery/recipes.js +191 -0
  209. package/lib/discovery/service.d.ts +57 -0
  210. package/lib/discovery/service.js +234 -0
  211. package/lib/discovery/shapes.d.ts +6 -0
  212. package/lib/discovery/shapes.js +65 -0
  213. package/lib/discovery/structural-recipes.d.ts +6 -0
  214. package/lib/discovery/structural-recipes.js +193 -0
  215. package/lib/discovery/surface-recipes.d.ts +7 -0
  216. package/lib/discovery/surface-recipes.js +124 -0
  217. package/lib/draw-diagnostics.d.ts +57 -0
  218. package/lib/draw-diagnostics.js +239 -0
  219. package/lib/edit-buffer.d.ts +86 -0
  220. package/lib/edit-buffer.js +99 -0
  221. package/lib/engine-identity.d.ts +44 -0
  222. package/lib/engine-identity.js +41 -0
  223. package/lib/evaluator/authoring-diagnostic.d.ts +38 -0
  224. package/lib/evaluator/authoring-diagnostic.js +128 -0
  225. package/lib/evaluator/handler.d.ts +14 -0
  226. package/lib/evaluator/handler.js +86 -0
  227. package/lib/evaluator/index.d.ts +4 -0
  228. package/lib/evaluator/index.js +4 -0
  229. package/lib/evaluator/isolation.d.ts +45 -0
  230. package/lib/evaluator/isolation.js +362 -0
  231. package/lib/evaluator/probe-invariants.d.ts +2 -0
  232. package/lib/evaluator/probe-invariants.js +7 -0
  233. package/lib/evaluator/probe-worker.d.ts +1 -0
  234. package/lib/evaluator/probe-worker.js +134 -0
  235. package/lib/evaluator/protocol.d.ts +105 -0
  236. package/lib/evaluator/protocol.js +512 -0
  237. package/lib/evaluator/source-check.d.ts +7 -0
  238. package/lib/evaluator/source-check.js +57 -0
  239. package/lib/evaluator/subprocess.d.ts +26 -0
  240. package/lib/evaluator/subprocess.js +212 -0
  241. package/lib/evaluator/transport-worker.d.mts +1 -0
  242. package/lib/evaluator/transport-worker.mjs +3 -0
  243. package/lib/evaluator/worker-urls.d.ts +6 -0
  244. package/lib/evaluator/worker-urls.js +12 -0
  245. package/lib/evaluator/worker.d.ts +1 -0
  246. package/lib/evaluator/worker.js +26 -0
  247. package/lib/exporter-node.d.ts +16 -0
  248. package/lib/exporter-node.js +58 -0
  249. package/lib/gears.d.ts +68 -0
  250. package/lib/gears.js +259 -0
  251. package/lib/geometry-budget.d.ts +15 -0
  252. package/lib/geometry-budget.js +36 -0
  253. package/lib/geometry-catalog.d.ts +5 -0
  254. package/lib/geometry-catalog.js +161 -0
  255. package/lib/geometry-export.d.ts +11 -0
  256. package/lib/geometry-export.js +160 -0
  257. package/lib/geometry.d.ts +46 -0
  258. package/lib/geometry.js +311 -0
  259. package/lib/gltf-io.d.ts +38 -0
  260. package/lib/gltf-io.js +95 -0
  261. package/lib/implicit.d.ts +20 -0
  262. package/lib/implicit.js +58 -0
  263. package/lib/index-policy.d.ts +13 -0
  264. package/lib/index-policy.js +41 -0
  265. package/lib/index.d.ts +5 -0
  266. package/lib/index.js +5 -0
  267. package/lib/inspect.d.ts +76 -0
  268. package/lib/inspect.js +206 -0
  269. package/lib/kit.d.ts +90 -0
  270. package/lib/kit.js +459 -0
  271. package/lib/live-review-node.d.ts +70 -0
  272. package/lib/live-review-node.js +961 -0
  273. package/lib/live-review.d.ts +65 -0
  274. package/lib/live-review.js +1 -0
  275. package/lib/local-runtime.d.ts +25 -0
  276. package/lib/local-runtime.js +272 -0
  277. package/lib/lod-export.d.ts +39 -0
  278. package/lib/lod-export.js +102 -0
  279. package/lib/lod.d.ts +56 -0
  280. package/lib/lod.js +138 -0
  281. package/lib/material-library-node.d.ts +56 -0
  282. package/lib/material-library-node.js +402 -0
  283. package/lib/material-library.d.ts +731 -0
  284. package/lib/material-library.js +425 -0
  285. package/lib/material-metrics.d.ts +72 -0
  286. package/lib/material-metrics.js +276 -0
  287. package/lib/material-presets.d.ts +29 -0
  288. package/lib/material-presets.js +181 -0
  289. package/lib/material-recipe-prompt.d.ts +23 -0
  290. package/lib/material-recipe-prompt.js +72 -0
  291. package/lib/material-recipe-runtime.d.ts +31 -0
  292. package/lib/material-recipe-runtime.js +91 -0
  293. package/lib/material-recipes.d.ts +131 -0
  294. package/lib/material-recipes.js +543 -0
  295. package/lib/material-resources.d.ts +181 -0
  296. package/lib/material-resources.js +416 -0
  297. package/lib/material-texture-library.generated.d.ts +1311 -0
  298. package/lib/material-texture-library.generated.js +11308 -0
  299. package/lib/metrics.d.ts +98 -0
  300. package/lib/metrics.js +210 -0
  301. package/lib/node-visibility.d.ts +31 -0
  302. package/lib/node-visibility.js +105 -0
  303. package/lib/open-shell.d.ts +21 -0
  304. package/lib/open-shell.js +83 -0
  305. package/lib/ops.d.ts +197 -0
  306. package/lib/ops.js +630 -0
  307. package/lib/palette-snap.d.ts +74 -0
  308. package/lib/palette-snap.js +151 -0
  309. package/lib/palette.d.ts +75 -0
  310. package/lib/palette.js +273 -0
  311. package/lib/portable-material-runtime.d.ts +14 -0
  312. package/lib/portable-material-runtime.js +81 -0
  313. package/lib/primitives.d.ts +483 -0
  314. package/lib/primitives.js +1553 -0
  315. package/lib/procedural-material-v2.d.ts +189 -0
  316. package/lib/procedural-material-v2.js +452 -0
  317. package/lib/procedural-texture.d.ts +90 -0
  318. package/lib/procedural-texture.js +306 -0
  319. package/lib/profile.d.ts +190 -0
  320. package/lib/profile.js +366 -0
  321. package/lib/program-store-node.d.ts +14 -0
  322. package/lib/program-store-node.js +137 -0
  323. package/lib/program-store.d.ts +43 -0
  324. package/lib/program-store.js +89 -0
  325. package/lib/project-bundle-node.d.ts +15 -0
  326. package/lib/project-bundle-node.js +175 -0
  327. package/lib/project-bundle.d.ts +65 -0
  328. package/lib/project-bundle.js +322 -0
  329. package/lib/projects-node.d.ts +17 -0
  330. package/lib/projects-node.js +227 -0
  331. package/lib/projects.d.ts +312 -0
  332. package/lib/projects.js +216 -0
  333. package/lib/prompt-api.d.ts +32 -0
  334. package/lib/prompt-api.js +223 -0
  335. package/lib/qa/architecture-corpus.d.ts +31 -0
  336. package/lib/qa/architecture-corpus.js +438 -0
  337. package/lib/qa/architecture-repairs.d.ts +17 -0
  338. package/lib/qa/architecture-repairs.js +73 -0
  339. package/lib/qa/architecture.d.ts +56 -0
  340. package/lib/qa/architecture.js +985 -0
  341. package/lib/qa/benchmark-fixtures.d.ts +42 -0
  342. package/lib/qa/benchmark-fixtures.js +191 -0
  343. package/lib/qa/breadth-corpus.d.ts +17 -0
  344. package/lib/qa/breadth-corpus.js +125 -0
  345. package/lib/qa/breadth-evidence.d.ts +18 -0
  346. package/lib/qa/breadth-evidence.js +514 -0
  347. package/lib/qa/breadth-final.d.ts +46 -0
  348. package/lib/qa/breadth-final.js +359 -0
  349. package/lib/qa/breadth.d.ts +66 -0
  350. package/lib/qa/breadth.js +539 -0
  351. package/lib/qa/character-advisory.d.ts +7 -0
  352. package/lib/qa/character-advisory.js +488 -0
  353. package/lib/qa/character-repairs.d.ts +11 -0
  354. package/lib/qa/character-repairs.js +68 -0
  355. package/lib/qa/character-vehicle-corpus.d.ts +32 -0
  356. package/lib/qa/character-vehicle-corpus.js +525 -0
  357. package/lib/qa/character.d.ts +66 -0
  358. package/lib/qa/character.js +712 -0
  359. package/lib/qa/corpus.d.ts +185 -0
  360. package/lib/qa/corpus.js +396 -0
  361. package/lib/qa/environment.d.ts +44 -0
  362. package/lib/qa/environment.js +725 -0
  363. package/lib/qa/geometry-relations.d.ts +94 -0
  364. package/lib/qa/geometry-relations.js +552 -0
  365. package/lib/qa/gltf.d.ts +29 -0
  366. package/lib/qa/gltf.js +66 -0
  367. package/lib/qa/index.d.ts +32 -0
  368. package/lib/qa/index.js +34 -0
  369. package/lib/qa/lod.d.ts +14 -0
  370. package/lib/qa/lod.js +25 -0
  371. package/lib/qa/material.d.ts +5 -0
  372. package/lib/qa/material.js +223 -0
  373. package/lib/qa/part-connectivity.d.ts +73 -0
  374. package/lib/qa/part-connectivity.js +216 -0
  375. package/lib/qa/prop-environment-prompt.d.ts +6 -0
  376. package/lib/qa/prop-environment-prompt.js +43 -0
  377. package/lib/qa/prop-helper-policy.d.ts +37 -0
  378. package/lib/qa/prop-helper-policy.js +65 -0
  379. package/lib/qa/prop.d.ts +44 -0
  380. package/lib/qa/prop.js +702 -0
  381. package/lib/qa/reference-comparison.d.ts +183 -0
  382. package/lib/qa/reference-comparison.js +420 -0
  383. package/lib/qa/registry.d.ts +159 -0
  384. package/lib/qa/registry.js +406 -0
  385. package/lib/qa/requirements-applicability.d.ts +33 -0
  386. package/lib/qa/requirements-applicability.js +189 -0
  387. package/lib/qa/requirements-report.d.ts +38 -0
  388. package/lib/qa/requirements-report.js +202 -0
  389. package/lib/qa/requirements-run.d.ts +20 -0
  390. package/lib/qa/requirements-run.js +370 -0
  391. package/lib/qa/run.d.ts +54 -0
  392. package/lib/qa/run.js +240 -0
  393. package/lib/qa/self-intersection.d.ts +157 -0
  394. package/lib/qa/self-intersection.js +633 -0
  395. package/lib/qa/sweep.d.ts +4 -0
  396. package/lib/qa/sweep.js +65 -0
  397. package/lib/qa/types.d.ts +90 -0
  398. package/lib/qa/types.js +81 -0
  399. package/lib/qa/universal.d.ts +14 -0
  400. package/lib/qa/universal.js +398 -0
  401. package/lib/qa/vegetation-corpus.d.ts +18 -0
  402. package/lib/qa/vegetation-corpus.js +304 -0
  403. package/lib/qa/vegetation.d.ts +133 -0
  404. package/lib/qa/vegetation.js +933 -0
  405. package/lib/qa/vehicle-advisory.d.ts +8 -0
  406. package/lib/qa/vehicle-advisory.js +395 -0
  407. package/lib/qa/vehicle.d.ts +19 -0
  408. package/lib/qa/vehicle.js +594 -0
  409. package/lib/rebuild-options.d.ts +31 -0
  410. package/lib/rebuild-options.js +13 -0
  411. package/lib/render-capabilities.d.ts +25 -0
  412. package/lib/render-capabilities.js +100 -0
  413. package/lib/render-service-client.d.ts +59 -0
  414. package/lib/render-service-client.js +194 -0
  415. package/lib/render-service-host.d.ts +44 -0
  416. package/lib/render-service-host.js +236 -0
  417. package/lib/render-service-windows.d.ts +12 -0
  418. package/lib/render-service-windows.js +72 -0
  419. package/lib/render.d.ts +565 -0
  420. package/lib/render.js +1978 -0
  421. package/lib/requirements-assets.d.ts +6 -0
  422. package/lib/requirements-assets.js +33 -0
  423. package/lib/requirements-context.d.ts +1658 -0
  424. package/lib/requirements-context.js +126 -0
  425. package/lib/requirements-identity.d.ts +3 -0
  426. package/lib/requirements-identity.js +38 -0
  427. package/lib/requirements-json.d.ts +12 -0
  428. package/lib/requirements-json.js +58 -0
  429. package/lib/requirements-store.d.ts +42 -0
  430. package/lib/requirements-store.js +86 -0
  431. package/lib/requirements.d.ts +4 -0
  432. package/lib/requirements.js +4 -0
  433. package/lib/revision-comparison.d.ts +85 -0
  434. package/lib/revision-comparison.js +334 -0
  435. package/lib/rig-export.d.ts +5 -0
  436. package/lib/rig-export.js +19 -0
  437. package/lib/rigid-merge.d.ts +90 -0
  438. package/lib/rigid-merge.js +585 -0
  439. package/lib/runtime-identity.d.ts +20 -0
  440. package/lib/runtime-identity.js +193 -0
  441. package/lib/solids.d.ts +29 -0
  442. package/lib/solids.js +523 -0
  443. package/lib/source-bindings.d.ts +6 -0
  444. package/lib/source-bindings.js +96 -0
  445. package/lib/source-runtime-checks.d.ts +14 -0
  446. package/lib/source-runtime-checks.js +169 -0
  447. package/lib/sweep-analysis.d.ts +22 -0
  448. package/lib/sweep-analysis.js +109 -0
  449. package/lib/sweep.d.ts +34 -0
  450. package/lib/sweep.js +347 -0
  451. package/lib/texture-bake.d.ts +125 -0
  452. package/lib/texture-bake.js +395 -0
  453. package/lib/texture-contract.d.ts +3 -0
  454. package/lib/texture-contract.js +10 -0
  455. package/lib/texture-resolver.d.ts +22 -0
  456. package/lib/texture-resolver.js +28 -0
  457. package/lib/textures.d.ts +90 -0
  458. package/lib/textures.js +240 -0
  459. package/lib/tools/actions.d.ts +35 -0
  460. package/lib/tools/actions.js +69 -0
  461. package/lib/tools/capture-input.d.ts +373 -0
  462. package/lib/tools/capture-input.js +193 -0
  463. package/lib/tools/discovery.d.ts +3 -0
  464. package/lib/tools/discovery.js +177 -0
  465. package/lib/tools/materials.d.ts +29 -0
  466. package/lib/tools/materials.js +168 -0
  467. package/lib/tools/preview-fidelity.d.ts +6 -0
  468. package/lib/tools/preview-fidelity.js +23 -0
  469. package/lib/tools/program-artifacts.d.ts +30 -0
  470. package/lib/tools/program-artifacts.js +76 -0
  471. package/lib/tools/programs.d.ts +9 -0
  472. package/lib/tools/programs.js +151 -0
  473. package/lib/tools/projects.d.ts +27 -0
  474. package/lib/tools/projects.js +98 -0
  475. package/lib/tools/registry.d.ts +792 -0
  476. package/lib/tools/registry.js +2123 -0
  477. package/lib/tools/review-detail.d.ts +106 -0
  478. package/lib/tools/review-detail.js +740 -0
  479. package/lib/tools/review.d.ts +40 -0
  480. package/lib/tools/review.js +230 -0
  481. package/lib/tools/skill-resource.d.ts +8 -0
  482. package/lib/tools/skill-resource.js +1 -0
  483. package/lib/tools/workspace.d.ts +8 -0
  484. package/lib/tools/workspace.js +87 -0
  485. package/lib/user-data-extras.d.ts +40 -0
  486. package/lib/user-data-extras.js +158 -0
  487. package/lib/user-data-validation.d.ts +18 -0
  488. package/lib/user-data-validation.js +201 -0
  489. package/lib/uv-project.d.ts +14 -0
  490. package/lib/uv-project.js +145 -0
  491. package/lib/uv-shapes.d.ts +11 -0
  492. package/lib/uv-shapes.js +48 -0
  493. package/lib/uv.d.ts +39 -0
  494. package/lib/uv.js +216 -0
  495. package/lib/validation.d.ts +90 -0
  496. package/lib/validation.js +1099 -0
  497. package/lib/vehicle.d.ts +128 -0
  498. package/lib/vehicle.js +487 -0
  499. package/lib/views/annotate.d.ts +41 -0
  500. package/lib/views/annotate.js +131 -0
  501. package/lib/views/architecture.d.ts +22 -0
  502. package/lib/views/architecture.js +55 -0
  503. package/lib/views/background.d.ts +54 -0
  504. package/lib/views/background.js +65 -0
  505. package/lib/views/camera-capture.d.ts +15 -0
  506. package/lib/views/camera-capture.js +101 -0
  507. package/lib/views/camera.d.ts +106 -0
  508. package/lib/views/camera.js +488 -0
  509. package/lib/views/capture-cache.d.ts +48 -0
  510. package/lib/views/capture-cache.js +239 -0
  511. package/lib/views/capture-limits.d.ts +19 -0
  512. package/lib/views/capture-limits.js +61 -0
  513. package/lib/views/capture.d.ts +124 -0
  514. package/lib/views/capture.js +210 -0
  515. package/lib/views/character-capture.d.ts +20 -0
  516. package/lib/views/character-capture.js +180 -0
  517. package/lib/views/character.d.ts +64 -0
  518. package/lib/views/character.js +176 -0
  519. package/lib/views/diagnostic.d.ts +90 -0
  520. package/lib/views/diagnostic.js +627 -0
  521. package/lib/views/evidence-history.d.ts +13 -0
  522. package/lib/views/evidence-history.js +131 -0
  523. package/lib/views/glb.d.ts +36 -0
  524. package/lib/views/glb.js +524 -0
  525. package/lib/views/grid.d.ts +46 -0
  526. package/lib/views/grid.js +81 -0
  527. package/lib/views/index.d.ts +257 -0
  528. package/lib/views/index.js +624 -0
  529. package/lib/views/inspect.d.ts +110 -0
  530. package/lib/views/inspect.js +195 -0
  531. package/lib/views/lod.d.ts +30 -0
  532. package/lib/views/lod.js +79 -0
  533. package/lib/views/measurement.d.ts +47 -0
  534. package/lib/views/measurement.js +60 -0
  535. package/lib/views/part-placement.d.ts +25 -0
  536. package/lib/views/part-placement.js +26 -0
  537. package/lib/views/png.d.ts +23 -0
  538. package/lib/views/png.js +162 -0
  539. package/lib/views/port.d.ts +74 -0
  540. package/lib/views/port.js +250 -0
  541. package/lib/views/pose.d.ts +113 -0
  542. package/lib/views/pose.js +433 -0
  543. package/lib/views/raster.d.ts +164 -0
  544. package/lib/views/raster.js +508 -0
  545. package/lib/views/renderer-id.d.ts +11 -0
  546. package/lib/views/renderer-id.js +29 -0
  547. package/lib/views/scene-raster.d.ts +41 -0
  548. package/lib/views/scene-raster.js +84 -0
  549. package/lib/views/surface-distance.d.ts +51 -0
  550. package/lib/views/surface-distance.js +343 -0
  551. package/lib/views/vehicle.d.ts +57 -0
  552. package/lib/views/vehicle.js +288 -0
  553. package/lib/wall-panels.d.ts +38 -0
  554. package/lib/wall-panels.js +99 -0
  555. package/lib/widget-transfer.d.ts +12 -0
  556. package/lib/widget-transfer.js +117 -0
  557. package/lib/workspace-location.d.ts +6 -0
  558. package/lib/workspace-location.js +16 -0
  559. package/lib/workspace-node.d.ts +15 -0
  560. package/lib/workspace-node.js +74 -0
  561. package/lib/workspace.d.ts +26 -0
  562. package/lib/workspace.js +22 -0
  563. package/lib/written-nodes.d.ts +10 -0
  564. package/lib/written-nodes.js +32 -0
  565. package/package.json +385 -4
  566. package/plugin.json +16 -0
  567. package/plugins/kiln-engine/.claude-plugin/plugin.json +18 -0
  568. package/plugins/kiln-engine/LICENSE +21 -0
  569. package/plugins/kiln-engine/README.md +25 -0
  570. package/plugins/kiln-engine/package-provenance.json +15 -0
  571. package/plugins/kiln-engine/plugin.json +38 -0
  572. package/plugins/kiln-engine/runtime.json +4 -0
  573. package/plugins/kiln-engine/scripts/setup-workspace.mjs +337 -0
  574. package/plugins/kiln-engine/skills/kiln-setup-workspace/SKILL.md +108 -0
  575. package/plugins/kiln-engine/skills/kiln-setup-workspace/references/plugin-install.md +66 -0
  576. package/render-service/README.md +139 -0
  577. package/render-service/package-lock.json +72 -0
  578. package/render-service/package.json +22 -0
  579. package/render-service/src/backdrops.mjs +26 -0
  580. package/render-service/src/bind-policy.mjs +80 -0
  581. package/render-service/src/build-identity.mjs +83 -0
  582. package/render-service/src/cache-identity.mjs +65 -0
  583. package/render-service/src/contract.mjs +494 -0
  584. package/render-service/src/display-output.mjs +18 -0
  585. package/render-service/src/display-transform.mjs +192 -0
  586. package/render-service/src/framing.mjs +114 -0
  587. package/render-service/src/glb-input.mjs +259 -0
  588. package/render-service/src/gpu.mjs +101 -0
  589. package/render-service/src/health-contract.mjs +40 -0
  590. package/render-service/src/instance.mjs +146 -0
  591. package/render-service/src/node-visibility.mjs +49 -0
  592. package/render-service/src/png-input.mjs +77 -0
  593. package/render-service/src/presentation-presets.mjs +216 -0
  594. package/render-service/src/readback.mjs +16 -0
  595. package/render-service/src/register-hooks.mjs +2 -0
  596. package/render-service/src/render-queue.mjs +144 -0
  597. package/render-service/src/renderer.mjs +473 -0
  598. package/render-service/src/request-limits.mjs +72 -0
  599. package/render-service/src/review-tone-mapping.mjs +55 -0
  600. package/render-service/src/server.mjs +387 -0
  601. package/render-service/src/three-alias-hooks.mjs +6 -0
  602. package/scripts/create-workspace.mjs +808 -0
  603. package/scripts/package-plugin.mjs +67 -0
  604. package/skills/kiln-author-asset/SKILL.md +104 -0
  605. package/skills/kiln-author-asset/references/camera-cli.md +33 -0
  606. package/skills/kiln-author-asset/references/camera-recipes.md +73 -0
  607. package/skills/kiln-author-asset/references/export-profiles.md +216 -0
  608. package/skills/kiln-author-asset/references/geometry-recipes.md +329 -0
  609. package/skills/kiln-author-asset/references/program-contract.md +44 -0
  610. package/skills/kiln-author-asset/references/projects-and-materials.md +158 -0
  611. package/skills/kiln-author-asset/references/reusable-frame.kiln.js +32 -0
  612. package/skills/kiln-batch-dispatch/SKILL.md +22 -0
  613. package/skills/kiln-batch-dispatch/references/clean-room-evaluation.md +35 -0
  614. package/skills/kiln-compose-scene/SKILL.md +38 -0
  615. package/skills/kiln-compose-scene/references/composition-api.md +29 -0
  616. package/skills/kiln-compose-scene/references/runtime-scenes.md +363 -0
  617. package/skills/kiln-qa-asset/SKILL.md +99 -0
  618. package/skills/kiln-qa-asset/references/engine-handoff.md +246 -0
  619. package/skills/kiln-qa-asset/references/integration-checks.md +96 -0
  620. package/skills/kiln-refine-asset/SKILL.md +136 -0
  621. package/skills/kiln-refine-asset/references/revision-and-views.md +205 -0
  622. package/skills/kiln-refine-asset/references/revision-cli.md +39 -0
  623. package/skills/kiln-setup-workspace/SKILL.md +108 -0
  624. package/skills/kiln-setup-workspace/references/plugin-install.md +66 -0
  625. package/src/agent/call-budget.ts +106 -0
  626. package/src/agent/compaction.ts +197 -0
  627. package/src/agent/concurrency.ts +30 -0
  628. package/src/agent/diff.ts +141 -0
  629. package/src/agent/generate.ts +448 -0
  630. package/src/agent/hooks.ts +204 -0
  631. package/src/agent/index.ts +114 -0
  632. package/src/agent/native-prompt.ts +51 -0
  633. package/src/agent/native-workflow.ts +33 -0
  634. package/src/agent/providers.ts +529 -0
  635. package/src/agent/run.ts +356 -0
  636. package/src/agent/skill-resources.ts +198 -0
  637. package/src/agent/split-tool-result-images.ts +80 -0
  638. package/src/agent/stream-start.ts +61 -0
  639. package/src/agent/tools.ts +113 -0
  640. package/src/agent/view-render-timeout.ts +110 -0
  641. package/src/animation-cli.ts +251 -0
  642. package/src/animation-cubic.ts +57 -0
  643. package/src/animation-spline.ts +183 -0
  644. package/src/architecture.ts +871 -0
  645. package/src/arena/adaptive.ts +119 -0
  646. package/src/arena/bradley-terry.ts +221 -0
  647. package/src/arena/index.ts +21 -0
  648. package/src/assembly-transform.ts +34 -0
  649. package/src/assembly.ts +762 -0
  650. package/src/asset-catalog.ts +30 -0
  651. package/src/asset-cli.ts +505 -0
  652. package/src/asset-export.ts +141 -0
  653. package/src/asset-materials-node.ts +78 -0
  654. package/src/asset-viewer.ts +160 -0
  655. package/src/asset-widget-uri.ts +9 -0
  656. package/src/asset-widget.ts +38 -0
  657. package/src/assets-node.ts +412 -0
  658. package/src/assets-resources.ts +137 -0
  659. package/src/assets.ts +252 -0
  660. package/src/atomic-directory.ts +45 -0
  661. package/src/authoring-style.ts +49 -0
  662. package/src/breadth-prompt.ts +79 -0
  663. package/src/build-cache-node.ts +99 -0
  664. package/src/build-cache.ts +253 -0
  665. package/src/character.ts +776 -0
  666. package/src/cli-json.ts +29 -0
  667. package/src/cli-output.ts +135 -0
  668. package/src/cli-render-mode.ts +270 -0
  669. package/src/cli.ts +809 -0
  670. package/src/community-exporter.ts +268 -0
  671. package/src/composer/agent/compaction.ts +146 -0
  672. package/src/composer/agent/index.ts +41 -0
  673. package/src/composer/agent/prompt.ts +126 -0
  674. package/src/composer/agent/run.ts +317 -0
  675. package/src/composer/agent/tools.ts +847 -0
  676. package/src/composer/agent/world-run.ts +421 -0
  677. package/src/composer/agent/world-tools.ts +411 -0
  678. package/src/composer/collision.ts +448 -0
  679. package/src/composer/contract-utils.ts +52 -0
  680. package/src/composer/dsl.ts +196 -0
  681. package/src/composer/ground.ts +27 -0
  682. package/src/composer/index.ts +19 -0
  683. package/src/composer/layout.ts +357 -0
  684. package/src/composer/model.ts +688 -0
  685. package/src/composer/overlap.ts +220 -0
  686. package/src/composer/presentation.ts +309 -0
  687. package/src/composer/reachability.ts +407 -0
  688. package/src/composer/render-port.ts +516 -0
  689. package/src/composer/terrain-runtime.ts +415 -0
  690. package/src/composer/terrain.ts +53 -0
  691. package/src/composer/world-document.ts +1019 -0
  692. package/src/composer/world-integration.ts +589 -0
  693. package/src/composer/world-package.ts +255 -0
  694. package/src/contracts/asset.ts +2030 -0
  695. package/src/contracts/breadth.ts +888 -0
  696. package/src/contracts/environment.ts +81 -0
  697. package/src/contracts/index.ts +5 -0
  698. package/src/contracts/integration.ts +100 -0
  699. package/src/contracts/requirements-migration.ts +536 -0
  700. package/src/contracts/requirements.ts +357 -0
  701. package/src/contracts/semantic.ts +544 -0
  702. package/src/deform.ts +215 -0
  703. package/src/deformation-normals.ts +84 -0
  704. package/src/direct-entry.ts +28 -0
  705. package/src/discovery/articulation-recipes.ts +190 -0
  706. package/src/discovery/catalog-schema.ts +125 -0
  707. package/src/discovery/catalog.ts +88 -0
  708. package/src/discovery/construction-recipes.ts +243 -0
  709. package/src/discovery/helper-contracts.ts +2388 -0
  710. package/src/discovery/helper-specs.ts +1046 -0
  711. package/src/discovery/index.ts +36 -0
  712. package/src/discovery/intents.ts +120 -0
  713. package/src/discovery/lexical-index.ts +72 -0
  714. package/src/discovery/query-schema.ts +71 -0
  715. package/src/discovery/recipes.ts +215 -0
  716. package/src/discovery/service.ts +329 -0
  717. package/src/discovery/shapes.ts +120 -0
  718. package/src/discovery/structural-recipes.ts +199 -0
  719. package/src/discovery/surface-recipes.ts +130 -0
  720. package/src/discovery-cli.ts +106 -0
  721. package/src/draw-diagnostics.ts +313 -0
  722. package/src/edit-buffer.ts +134 -0
  723. package/src/edit-cli.ts +125 -0
  724. package/src/engine-identity.ts +50 -0
  725. package/src/evaluator/authoring-diagnostic.ts +168 -0
  726. package/src/evaluator/handler.ts +114 -0
  727. package/src/evaluator/index.ts +50 -0
  728. package/src/evaluator/isolation.ts +454 -0
  729. package/src/evaluator/probe-invariants.ts +9 -0
  730. package/src/evaluator/probe-worker.ts +158 -0
  731. package/src/evaluator/protocol.ts +701 -0
  732. package/src/evaluator/source-check.ts +64 -0
  733. package/src/evaluator/subprocess.ts +294 -0
  734. package/src/evaluator/transport-worker.mjs +8 -0
  735. package/src/evaluator/worker-urls.ts +16 -0
  736. package/src/evaluator/worker.ts +26 -0
  737. package/src/experiments/geometry-acceptance.ts +278 -0
  738. package/src/experiments/geometry-frontier.ts +181 -0
  739. package/src/experiments/program-aliases.ts +96 -0
  740. package/src/experiments/run-w6-material-vegetation.ts +7 -0
  741. package/src/experiments/run-w7-vegetation-lod.ts +6 -0
  742. package/src/experiments/w6-material-vegetation.ts +772 -0
  743. package/src/experiments/w7-vegetation-lod.ts +335 -0
  744. package/src/exporter-node.ts +68 -0
  745. package/src/gears.ts +334 -0
  746. package/src/generated/mcp-manifest.json +2050 -0
  747. package/src/geometry-budget.ts +50 -0
  748. package/src/geometry-catalog.ts +215 -0
  749. package/src/geometry-export.ts +193 -0
  750. package/src/geometry.ts +379 -0
  751. package/src/gltf-io.ts +129 -0
  752. package/src/gltf-validator-shims.d.ts +12 -0
  753. package/src/implicit.ts +106 -0
  754. package/src/index-policy.ts +52 -0
  755. package/src/index.ts +5 -0
  756. package/src/inspect-cli.ts +198 -0
  757. package/src/inspect.ts +290 -0
  758. package/src/kit.ts +547 -0
  759. package/src/live-review-node.ts +1011 -0
  760. package/src/live-review.ts +55 -0
  761. package/src/local-runtime.ts +336 -0
  762. package/src/lod-export.ts +120 -0
  763. package/src/lod.ts +192 -0
  764. package/src/loopback.ts +6 -0
  765. package/src/material-library-node.ts +488 -0
  766. package/src/material-library.ts +481 -0
  767. package/src/material-metrics.ts +392 -0
  768. package/src/material-presets.ts +207 -0
  769. package/src/material-recipe-prompt.ts +99 -0
  770. package/src/material-recipe-runtime.ts +162 -0
  771. package/src/material-recipes.ts +748 -0
  772. package/src/material-resources.ts +640 -0
  773. package/src/material-texture-library.generated.ts +11408 -0
  774. package/src/mcp-core.ts +437 -0
  775. package/src/mcp-engine.ts +383 -0
  776. package/src/mcp-manifest.ts +104 -0
  777. package/src/mcp-server.ts +118 -0
  778. package/src/metrics.ts +277 -0
  779. package/src/migration-cli.ts +105 -0
  780. package/src/migration-rebuild.ts +265 -0
  781. package/src/node-visibility.ts +116 -0
  782. package/src/open-shell.ts +104 -0
  783. package/src/ops.ts +751 -0
  784. package/src/palette-snap.ts +209 -0
  785. package/src/palette.ts +307 -0
  786. package/src/portable-material-runtime.ts +109 -0
  787. package/src/primitives.ts +2299 -0
  788. package/src/procedural-material-v2.ts +720 -0
  789. package/src/procedural-texture.ts +427 -0
  790. package/src/profile.ts +485 -0
  791. package/src/program-store-node.ts +138 -0
  792. package/src/program-store.ts +116 -0
  793. package/src/project-bundle-node.ts +220 -0
  794. package/src/project-bundle.ts +392 -0
  795. package/src/project-cli.ts +248 -0
  796. package/src/projects-node.ts +270 -0
  797. package/src/projects.ts +274 -0
  798. package/src/prompt-api.ts +231 -0
  799. package/src/qa/architecture-corpus.ts +828 -0
  800. package/src/qa/architecture-repairs.ts +92 -0
  801. package/src/qa/architecture.ts +1358 -0
  802. package/src/qa/benchmark-fixtures.ts +441 -0
  803. package/src/qa/breadth-corpus.ts +168 -0
  804. package/src/qa/breadth-evidence.ts +595 -0
  805. package/src/qa/breadth-final.ts +453 -0
  806. package/src/qa/breadth.ts +690 -0
  807. package/src/qa/character-advisory.ts +596 -0
  808. package/src/qa/character-repairs.ts +185 -0
  809. package/src/qa/character-vehicle-corpus.ts +802 -0
  810. package/src/qa/character.ts +998 -0
  811. package/src/qa/corpus.ts +499 -0
  812. package/src/qa/environment.ts +903 -0
  813. package/src/qa/geometry-relations.ts +843 -0
  814. package/src/qa/gltf.ts +103 -0
  815. package/src/qa/index.ts +34 -0
  816. package/src/qa/lod.ts +28 -0
  817. package/src/qa/material.ts +302 -0
  818. package/src/qa/part-connectivity.ts +252 -0
  819. package/src/qa/prop-environment-prompt.ts +58 -0
  820. package/src/qa/prop-helper-policy.ts +118 -0
  821. package/src/qa/prop.ts +828 -0
  822. package/src/qa/reference-comparison.ts +495 -0
  823. package/src/qa/registry.ts +604 -0
  824. package/src/qa/requirements-applicability.ts +241 -0
  825. package/src/qa/requirements-report.ts +280 -0
  826. package/src/qa/requirements-run.ts +470 -0
  827. package/src/qa/run.ts +329 -0
  828. package/src/qa/self-intersection.ts +741 -0
  829. package/src/qa/sweep.ts +68 -0
  830. package/src/qa/types.ts +187 -0
  831. package/src/qa/universal.ts +506 -0
  832. package/src/qa/vegetation-corpus.ts +404 -0
  833. package/src/qa/vegetation.ts +1174 -0
  834. package/src/qa/vehicle-advisory.ts +468 -0
  835. package/src/qa/vehicle.ts +756 -0
  836. package/src/rebuild-options.ts +16 -0
  837. package/src/render-capabilities.ts +140 -0
  838. package/src/render-service-client.ts +297 -0
  839. package/src/render-service-host.ts +278 -0
  840. package/src/render-service-windows.ts +80 -0
  841. package/src/render.ts +2748 -0
  842. package/src/requirements-assets.ts +53 -0
  843. package/src/requirements-context.ts +170 -0
  844. package/src/requirements-file.ts +10 -0
  845. package/src/requirements-identity.ts +43 -0
  846. package/src/requirements-json.ts +65 -0
  847. package/src/requirements-store.ts +150 -0
  848. package/src/requirements.ts +4 -0
  849. package/src/review-cli.ts +81 -0
  850. package/src/revision-comparison.ts +425 -0
  851. package/src/rig-export.ts +29 -0
  852. package/src/rigid-merge.ts +691 -0
  853. package/src/runtime-identity.ts +207 -0
  854. package/src/runtime-support.mjs +20 -0
  855. package/src/service-cli.ts +210 -0
  856. package/src/solids.ts +650 -0
  857. package/src/source-bindings.ts +90 -0
  858. package/src/source-runtime-checks.ts +189 -0
  859. package/src/sweep-analysis.ts +168 -0
  860. package/src/sweep.ts +482 -0
  861. package/src/texture-bake.ts +526 -0
  862. package/src/texture-contract.ts +12 -0
  863. package/src/texture-resolver.ts +61 -0
  864. package/src/textures.ts +345 -0
  865. package/src/tools/actions.ts +124 -0
  866. package/src/tools/capture-input.ts +233 -0
  867. package/src/tools/discovery.ts +194 -0
  868. package/src/tools/materials.ts +206 -0
  869. package/src/tools/preview-fidelity.ts +31 -0
  870. package/src/tools/program-artifacts.ts +107 -0
  871. package/src/tools/programs.ts +190 -0
  872. package/src/tools/projects.ts +141 -0
  873. package/src/tools/registry.ts +3111 -0
  874. package/src/tools/review-detail.ts +788 -0
  875. package/src/tools/review.ts +269 -0
  876. package/src/tools/skill-resource.ts +9 -0
  877. package/src/tools/workspace.ts +112 -0
  878. package/src/user-data-extras.ts +181 -0
  879. package/src/user-data-validation.ts +211 -0
  880. package/src/uv-project.ts +185 -0
  881. package/src/uv-shapes.ts +63 -0
  882. package/src/uv.ts +301 -0
  883. package/src/validation.ts +1257 -0
  884. package/src/vegetation-prompt.ts +109 -0
  885. package/src/vehicle.ts +742 -0
  886. package/src/viewer/app.ts +666 -0
  887. package/src/viewer/attribution.ts +17 -0
  888. package/src/viewer/camera-state.ts +45 -0
  889. package/src/viewer/chat-app.ts +221 -0
  890. package/src/viewer/chat-download.ts +53 -0
  891. package/src/viewer/dashboard.ts +59 -0
  892. package/src/viewer/deep-link.ts +34 -0
  893. package/src/viewer/dom.ts +63 -0
  894. package/src/viewer/framing.ts +55 -0
  895. package/src/viewer/library-state.ts +34 -0
  896. package/src/viewer/live-panel.ts +742 -0
  897. package/src/viewer/live-state.ts +99 -0
  898. package/src/viewer/load-guard.ts +10 -0
  899. package/src/viewer/lod-control.ts +98 -0
  900. package/src/viewer/lod.ts +172 -0
  901. package/src/viewer/material-preset-form.ts +34 -0
  902. package/src/viewer/materials-panel.ts +335 -0
  903. package/src/viewer/membership-panel.ts +122 -0
  904. package/src/viewer/navigation.ts +9 -0
  905. package/src/viewer/performance-control.ts +75 -0
  906. package/src/viewer/performance.ts +61 -0
  907. package/src/viewer/project-editor.ts +37 -0
  908. package/src/viewer/project-membership.ts +20 -0
  909. package/src/viewer/projects-panel.ts +374 -0
  910. package/src/viewer/scene.ts +426 -0
  911. package/src/viewer/visibility.ts +73 -0
  912. package/src/views/annotate.ts +138 -0
  913. package/src/views/architecture.ts +77 -0
  914. package/src/views/background.ts +87 -0
  915. package/src/views/camera-capture.ts +143 -0
  916. package/src/views/camera.ts +622 -0
  917. package/src/views/capture-cache.ts +272 -0
  918. package/src/views/capture-limits.ts +73 -0
  919. package/src/views/capture.ts +300 -0
  920. package/src/views/character-capture.ts +279 -0
  921. package/src/views/character.ts +267 -0
  922. package/src/views/diagnostic.ts +853 -0
  923. package/src/views/evidence-history.ts +166 -0
  924. package/src/views/glb.ts +747 -0
  925. package/src/views/grid.ts +118 -0
  926. package/src/views/index.ts +1071 -0
  927. package/src/views/inspect.ts +296 -0
  928. package/src/views/lod.ts +117 -0
  929. package/src/views/measurement.ts +69 -0
  930. package/src/views/part-placement.ts +50 -0
  931. package/src/views/png.ts +175 -0
  932. package/src/views/port.ts +335 -0
  933. package/src/views/pose.ts +541 -0
  934. package/src/views/raster.ts +627 -0
  935. package/src/views/renderer-id.ts +31 -0
  936. package/src/views/scene-raster.ts +139 -0
  937. package/src/views/surface-distance.ts +403 -0
  938. package/src/views/vehicle.ts +431 -0
  939. package/src/wall-panels.ts +127 -0
  940. package/src/widget-transfer.ts +115 -0
  941. package/src/workspace-cli.ts +41 -0
  942. package/src/workspace-http.ts +219 -0
  943. package/src/workspace-location.ts +20 -0
  944. package/src/workspace-node.ts +91 -0
  945. package/src/workspace.ts +43 -0
  946. package/src/written-nodes.ts +39 -0
  947. package/src/xatlasjs-shims.d.ts +16 -0
@@ -0,0 +1,370 @@
1
+ import { Object3D } from 'three';
2
+ import { analyzeVfxArtifactEvidenceV1, analyzeAssetScopeObservationV1 } from "./breadth-evidence.js";
3
+ import { inspectEffectsExact, inspectEffectsAdvisory, VFX_EXACT_QA_RULE, VFX_ADVISORY_QA_RULE, inspectAssetScope, ASSET_SCOPE_QA_RULE, } from "./breadth.js";
4
+ import { analyzeFinalVfxGlbBytesV1, inspectFinalEffects, finalEffectsMetrics, } from "./breadth-final.js";
5
+ import { QaRegistry } from "./registry.js";
6
+ import { UNIVERSAL_QA_KERNELS, UNIVERSAL_QA_RULES } from "./universal.js";
7
+ import { MATERIAL_QA_RULE, inspectPortableSceneMaterials } from "./material.js";
8
+ import { inspectPlacement, inspectArticulation, inspectContainerOpening, PROP_EXACT_QA_RULE, PROP_ADVISORY_QA_RULE, } from "./prop.js";
9
+ import { inspectPartConnectivity, PART_CONNECTIVITY_QA_RULE } from "./part-connectivity.js";
10
+ import { inspectSweepGeometry, SWEEP_QA_RULE } from "./sweep.js";
11
+ import { analyzePartPenetration, inspectPartPenetration, SELF_INTERSECTION_QA_RULE, } from "./self-intersection.js";
12
+ import { inspectMobility, VEHICLE_QA_RULES } from "./vehicle.js";
13
+ import { inspectMobilityAdvisory } from "./vehicle-advisory.js";
14
+ import { inspectFoliageContact, inspectFoliageAdvisory, VEGETATION_QA_RULES } from "./vegetation.js";
15
+ import { inspectRig, CHARACTER_QA_RULE } from "./character.js";
16
+ import { inspectRigAdvisory, CHARACTER_ADVISORY_QA_RULE } from "./character-advisory.js";
17
+ import { inspectStructure, ARCHITECTURE_QA_RULES } from "./architecture.js";
18
+ import { inspectPlacementSockets, inspectTileEdges, inspectNavigationClearance, inspectSpatialSupport, ENVIRONMENT_QA_RULES, } from "./environment.js";
19
+ import { resolveRequirementsApplicability } from "./requirements-applicability.js";
20
+ import { createRequirementsQaReport, } from "./requirements-report.js";
21
+ import { gltfReportFindings } from "./run.js";
22
+ const registry = new QaRegistry([
23
+ ...UNIVERSAL_QA_RULES,
24
+ MATERIAL_QA_RULE,
25
+ PROP_EXACT_QA_RULE,
26
+ PROP_ADVISORY_QA_RULE,
27
+ PART_CONNECTIVITY_QA_RULE,
28
+ SELF_INTERSECTION_QA_RULE,
29
+ SWEEP_QA_RULE,
30
+ ...VEHICLE_QA_RULES,
31
+ ...ARCHITECTURE_QA_RULES,
32
+ ...ENVIRONMENT_QA_RULES,
33
+ ...VEGETATION_QA_RULES,
34
+ CHARACTER_QA_RULE,
35
+ CHARACTER_ADVISORY_QA_RULE,
36
+ VFX_EXACT_QA_RULE,
37
+ VFX_ADVISORY_QA_RULE,
38
+ ASSET_SCOPE_QA_RULE,
39
+ ]);
40
+ function sceneDecisions(context, policy) {
41
+ const applicable = new Set(resolveRequirementsApplicability(context.requirements)
42
+ .rules.filter((rule) => rule.status === 'evaluate')
43
+ .map((rule) => rule.id));
44
+ return new QaRegistry(registry.list().filter((rule) => applicable.has(rule.id))).describePolicy(policy);
45
+ }
46
+ /** Async engine measurements; no authored declarations, images or category policy are read. */
47
+ export async function collectRequirementsSceneEvidence(context, scene, policy = {}) {
48
+ if (!(scene instanceof Object3D) ||
49
+ !sceneDecisions(context, policy).some((d) => d.ruleId === SELF_INTERSECTION_QA_RULE.id && d.mode !== 'off'))
50
+ return {};
51
+ try {
52
+ return { partPenetration: await analyzePartPenetration(scene) };
53
+ }
54
+ catch {
55
+ // An optional observation can be unavailable; it cannot become a clean measurement.
56
+ return { partPenetrationFailed: true };
57
+ }
58
+ }
59
+ export function runRequirementsSceneQa(context, scene, clips, policy = {}, evidence = {}) {
60
+ const needs = context.requirements.requirements;
61
+ const parts = needs.parts?.state === 'requested' ? needs.parts.value.required : [];
62
+ const animation = needs.animation?.state === 'requested' ? needs.animation.value : undefined;
63
+ const rig = needs.rig?.state === 'requested' ? needs.rig.value : undefined;
64
+ const requiredClips = [
65
+ ...new Set([...(animation?.clips ?? []), ...(rig?.clips?.map((clip) => clip.name) ?? [])]),
66
+ ];
67
+ const tangents = needs.representation?.state === 'requested' &&
68
+ needs.representation.value.precomputedTangents === true;
69
+ const findings = [];
70
+ const decisions = sceneDecisions(context, policy);
71
+ const geometryMetrics = {};
72
+ const mobilityInput = {
73
+ scene,
74
+ mobility: needs.mobility?.state === 'requested' ? needs.mobility.value : undefined,
75
+ groundPlaneY: needs.grounding?.state === 'requested' ? needs.grounding.value.planeY : undefined,
76
+ };
77
+ // One measurement pass feeds the exact and advisory modes without re-deriving policy.
78
+ const mobilityFindings = mobilityInput.mobility &&
79
+ decisions.some((d) => (d.ruleId === 'VEHICLE_PROFILE' || d.ruleId === 'VEHICLE_ADVISORY_PROFILE') &&
80
+ d.mode !== 'off')
81
+ ? inspectMobility(mobilityInput)
82
+ : [];
83
+ const executedRules = [];
84
+ const rigInput = {
85
+ scene,
86
+ clips,
87
+ rig,
88
+ groundPlaneY: needs.grounding?.state === 'requested' ? needs.grounding.value.planeY : undefined,
89
+ };
90
+ const foliageInput = {
91
+ scene,
92
+ foliage: needs.foliage?.state === 'requested' ? needs.foliage.value : undefined,
93
+ materialMode: needs.material?.state === 'requested' ? needs.material.value.mode : undefined,
94
+ groundPlaneY: needs.grounding?.state === 'requested' ? needs.grounding.value.planeY : undefined,
95
+ };
96
+ const effects = needs.effects?.state === 'requested' ? needs.effects.value : undefined;
97
+ const scope = context.requirements.scope;
98
+ const scopeObservation = scope?.state === 'requested' &&
99
+ scene instanceof Object3D &&
100
+ decisions.some((d) => d.ruleId === ASSET_SCOPE_QA_RULE.id && d.mode !== 'off')
101
+ ? analyzeAssetScopeObservationV1(scene)
102
+ : undefined;
103
+ const effectsInput = {
104
+ effects,
105
+ derivedEvidence: {
106
+ source: 'engine-scene-analysis',
107
+ ...(effects &&
108
+ scene instanceof Object3D &&
109
+ decisions.some((d) => d.ruleId.startsWith('VFX_') && d.mode !== 'off')
110
+ ? { vfxArtifact: analyzeVfxArtifactEvidenceV1(effects, scene, clips) }
111
+ : {}),
112
+ },
113
+ };
114
+ const spatialInput = {
115
+ scene,
116
+ tileable: needs.tiling?.state === 'requested' ||
117
+ (needs.spatialLayout?.state === 'requested' && needs.spatialLayout.value.tileable === true),
118
+ navigable: needs.navigation?.state === 'requested' ||
119
+ (needs.spatialLayout?.state === 'requested' && needs.spatialLayout.value.navigable === true),
120
+ navigation: needs.navigation?.state === 'requested' ? needs.navigation.value : undefined,
121
+ groundPlaneY: needs.grounding?.state === 'requested' ? (needs.grounding.value.planeY ?? 0) : undefined,
122
+ };
123
+ const spatialFindings = decisions.some((d) => d.ruleId.startsWith('ENVIRONMENT_') && d.mode !== 'off')
124
+ ? [
125
+ ...inspectPlacementSockets(spatialInput),
126
+ ...inspectTileEdges(spatialInput),
127
+ ...inspectNavigationClearance(spatialInput),
128
+ ...inspectSpatialSupport(spatialInput),
129
+ ]
130
+ : [];
131
+ const structureFindings = needs.structure?.state === 'requested' &&
132
+ decisions.some((d) => d.ruleId.startsWith('ARCHITECTURE_') && d.mode !== 'off')
133
+ ? inspectStructure({
134
+ scene,
135
+ structure: needs.structure.value,
136
+ opening: needs.opening?.state === 'requested',
137
+ })
138
+ : [];
139
+ for (const decision of decisions) {
140
+ if (decision.mode === 'off')
141
+ continue;
142
+ if (decision.ruleId === SELF_INTERSECTION_QA_RULE.id) {
143
+ const volume = evidence.partPenetration;
144
+ if (volume) {
145
+ const acknowledged = volume.acknowledged?.length ?? 0;
146
+ // An acknowledged open shell leaves its pairs unmeasured as surely as a skipped part.
147
+ const partial = volume.truncated || volume.skipped.length > 0 || acknowledged > 0;
148
+ if (!partial)
149
+ executedRules.push(decision.ruleId);
150
+ findings.push(...inspectPartPenetration(volume));
151
+ Object.assign(geometryMetrics, {
152
+ partVolumeCoverage: partial ? 'partial' : 'complete-static-pairs',
153
+ partVolumeScope: 'Visible static closed mesh pairs, except alternates on different LOD levels; excludes intra-mesh intersections, motion, open surfaces and usable passage space. Positive overlap may be intentional.',
154
+ partVolumeEligibleParts: volume.partsAnalyzed,
155
+ partVolumeCandidatePairs: volume.candidatePairs,
156
+ partVolumeCandidatesLowerBound: volume.broadPhaseTruncated === true,
157
+ partVolumePairsTested: volume.pairsTested,
158
+ partVolumeUnmeasurablePairs: volume.pairsUnmeasurable,
159
+ partVolumePairsNotReached: volume.pairsNotReached,
160
+ partVolumeLodAlternatePairs: volume.pairsLodAlternates,
161
+ partVolumeSkipped: volume.skipped.length,
162
+ ...(acknowledged > 0
163
+ ? {
164
+ partVolumeAcknowledgedParts: acknowledged,
165
+ partVolumeAcknowledgedPairs: volume.pairsUnmeasurableAcknowledged ?? 0,
166
+ }
167
+ : {}),
168
+ });
169
+ }
170
+ else if (evidence.partPenetrationFailed) {
171
+ findings.push({
172
+ code: 'GEO_PART_SELF_INTERSECTION_UNMEASURED',
173
+ disposition: 'observe',
174
+ dimension: 'visualQuality',
175
+ profile: 'geometry.selfIntersection',
176
+ message: 'Part-volume analysis could not complete. Overlap and clearance remain unmeasured.',
177
+ });
178
+ geometryMetrics.partVolumeCoverage = 'unavailable';
179
+ }
180
+ continue;
181
+ }
182
+ if (decision.ruleId === ASSET_SCOPE_QA_RULE.id && !scopeObservation)
183
+ continue;
184
+ if (decision.ruleId === PART_CONNECTIVITY_QA_RULE.id && !(scene instanceof Object3D))
185
+ continue;
186
+ executedRules.push(decision.ruleId);
187
+ if (decision.ruleId === PROP_EXACT_QA_RULE.id) {
188
+ const measured = [
189
+ ...(needs.articulation?.state === 'requested' ? inspectArticulation({ scene }) : []),
190
+ ...(needs.opening?.state === 'requested' ? inspectContainerOpening({ scene }) : []),
191
+ ];
192
+ for (const finding of measured)
193
+ findings.push(decision.mode === 'observe' || decision.mode === 'warn'
194
+ ? { ...finding, disposition: decision.mode }
195
+ : finding);
196
+ continue;
197
+ }
198
+ const measured = decision.ruleId === SWEEP_QA_RULE.id
199
+ ? inspectSweepGeometry(scene)
200
+ : decision.ruleId === PART_CONNECTIVITY_QA_RULE.id
201
+ ? inspectPartConnectivity(scene)
202
+ : decision.ruleId === ASSET_SCOPE_QA_RULE.id && scope?.state === 'requested'
203
+ ? inspectAssetScope({
204
+ profile: 'asset.requirements.v1',
205
+ scope: { schemaVersion: 1, scope: scope.value, explicit: true },
206
+ derivedEvidence: { source: 'engine-scene-analysis', assetScope: scopeObservation },
207
+ })
208
+ : decision.ruleId === 'CHARACTER_PROFILE'
209
+ ? inspectRig(rigInput)
210
+ : decision.ruleId === 'CHARACTER_ADVISORY_PROFILE'
211
+ ? inspectRigAdvisory(rigInput)
212
+ : decision.ruleId === 'VEGETATION_CONTACT_PROFILE'
213
+ ? inspectFoliageContact(foliageInput)
214
+ : decision.ruleId === 'VEGETATION_ADVISORY_PROFILE'
215
+ ? inspectFoliageAdvisory(foliageInput)
216
+ : decision.ruleId === MATERIAL_QA_RULE.id
217
+ ? inspectPortableSceneMaterials(scene, tangents)
218
+ : decision.ruleId === 'VFX_EXACT_PROFILE'
219
+ ? inspectEffectsExact(effectsInput)
220
+ : decision.ruleId === 'VFX_ADVISORY_PROFILE'
221
+ ? inspectEffectsAdvisory(effectsInput)
222
+ : decision.ruleId === 'ARCHITECTURE_PROFILE'
223
+ ? structureFindings.filter((f) => f.disposition === 'block')
224
+ : decision.ruleId === 'ARCHITECTURE_ADVISORY_PROFILE'
225
+ ? structureFindings.filter((f) => f.disposition !== 'block')
226
+ : decision.ruleId === 'ENVIRONMENT_EXACT_PROFILE'
227
+ ? spatialFindings.filter((f) => f.disposition === 'block')
228
+ : decision.ruleId === 'ENVIRONMENT_ADVISORY_PROFILE'
229
+ ? spatialFindings.filter((f) => f.disposition !== 'block')
230
+ : decision.ruleId === 'VEHICLE_PROFILE'
231
+ ? mobilityFindings.filter((f) => f.disposition === 'block')
232
+ : decision.ruleId === 'VEHICLE_ADVISORY_PROFILE'
233
+ ? mobilityFindings.filter((f) => f.disposition !== 'block')
234
+ : decision.ruleId === 'VEHICLE_W6_ADVISORY_PROFILE'
235
+ ? inspectMobilityAdvisory(mobilityInput)
236
+ : decision.ruleId === PROP_ADVISORY_QA_RULE.id
237
+ ? inspectPlacement({
238
+ scene,
239
+ bounds: needs.bounds?.state === 'requested'
240
+ ? needs.bounds.value
241
+ : undefined,
242
+ groundPlaneY: needs.grounding?.state === 'requested'
243
+ ? (needs.grounding.value.planeY ?? 0)
244
+ : undefined,
245
+ })
246
+ : UNIVERSAL_QA_KERNELS[decision.ruleId]({
247
+ scene,
248
+ clips,
249
+ requiredParts: parts,
250
+ animation: { clips: requiredClips },
251
+ });
252
+ for (const finding of measured)
253
+ findings.push(decision.mode === 'observe' || decision.mode === 'warn'
254
+ ? { ...finding, disposition: decision.mode }
255
+ : finding);
256
+ }
257
+ return createRequirementsQaReport(context, {
258
+ findings,
259
+ executedRules,
260
+ modes: Object.fromEntries(decisions.map((x) => [x.ruleId, x.mode])),
261
+ metrics: {
262
+ ...(Object.keys(geometryMetrics).length ? { visualQuality: geometryMetrics } : {}),
263
+ ...(scopeObservation
264
+ ? {
265
+ promptAlignment: {
266
+ scopeTopLevelAssetRoots: scopeObservation.topLevelAssetRoots,
267
+ scopeReusableMemberCount: scopeObservation.reusableMemberCount,
268
+ scopeDressingSignalCount: scopeObservation.sceneDressingRoles.length,
269
+ },
270
+ }
271
+ : {}),
272
+ },
273
+ ...(scopeObservation
274
+ ? {
275
+ evaluatedDimensions: ['exportIntegrity', 'requirementReadiness', 'promptAlignment'],
276
+ }
277
+ : {}),
278
+ });
279
+ }
280
+ /** Rebuild the same report without losing applicability, modes or unmet obligations. */
281
+ export function appendRequirementsQa(context, report, findings, metrics = {}) {
282
+ const priorMetrics = Object.fromEntries(Object.entries(report.dimensions).flatMap(([dimension, value]) => value.metrics ? [[dimension, value.metrics]] : []));
283
+ const merged = { ...priorMetrics };
284
+ for (const [dimension, value] of Object.entries(metrics ?? {}))
285
+ merged[dimension] = { ...priorMetrics[dimension], ...value };
286
+ return createRequirementsQaReport(context, {
287
+ findings: [...Object.values(report.dimensions).flatMap((x) => x.findings), ...findings],
288
+ executedRules: report.rules.filter((x) => x.status === 'evaluated').map((x) => x.id),
289
+ modes: Object.fromEntries(report.rules.map((x) => [x.id, x.mode])),
290
+ evaluatedDimensions: [
291
+ ...new Set([
292
+ ...Object.entries(report.dimensions)
293
+ .filter(([, value]) => value.status !== 'notEvaluated')
294
+ .map(([key]) => key),
295
+ ...Object.keys(metrics ?? {}),
296
+ ]),
297
+ ],
298
+ metrics: merged,
299
+ });
300
+ }
301
+ /** Final-byte and runtime measurements remain separate from acceptance obligations. */
302
+ export async function appendRequirementsFinalQa(context, report, gltf, bytes, instanceability, metricsError, material, warnings = []) {
303
+ const gltfFindings = gltfReportFindings(gltf, report.qaProfile);
304
+ const findings = [
305
+ ...gltfFindings,
306
+ ...warnings.map((w) => ({
307
+ code: w.code,
308
+ disposition: 'warn',
309
+ dimension: 'runtimeCost',
310
+ profile: `${w.profile}.${w.tier}`,
311
+ message: `${w.message} ${w.advice}`,
312
+ measurement: w.measurement,
313
+ })),
314
+ ];
315
+ if (metricsError)
316
+ findings.push({
317
+ code: 'RUNTIME_COST_METRICS_FAILED',
318
+ disposition: 'warn',
319
+ dimension: 'runtimeCost',
320
+ profile: report.qaProfile,
321
+ message: `Runtime-cost metrics could not be computed: ${metricsError}`,
322
+ });
323
+ const cost = {};
324
+ if (instanceability)
325
+ Object.assign(cost, {
326
+ instanceabilityGrade: instanceability.grade,
327
+ instanceabilitySummary: instanceability.summary,
328
+ ...instanceability.metrics,
329
+ });
330
+ if (material)
331
+ Object.assign(cost, {
332
+ materialCount: material.materialCount,
333
+ opaqueMaterials: material.opaqueMaterials,
334
+ maskedMaterials: material.maskedMaterials,
335
+ blendedMaterials: material.blendedMaterials,
336
+ singleSidedMaterials: material.singleSidedMaterials,
337
+ doubleSidedMaterials: material.doubleSidedMaterials,
338
+ texturedMaterials: material.texturedMaterials,
339
+ materialExtensionCount: material.materialExtensionCount,
340
+ materialExtensionsUsed: material.materialExtensionsUsed.join(','),
341
+ imageCount: material.imageCount,
342
+ maxImageDimension: material.maxImageDimension,
343
+ decodedImageBytesRgba8: material.decodedImageBytesRgba8,
344
+ estimatedGpuBytesWithMipmaps: material.estimatedGpuBytesWithMipmaps,
345
+ blendedSurfaceAreaRatio: material.blendedSurfaceAreaRatio,
346
+ });
347
+ let result = appendRequirementsQa(context, report, findings, {
348
+ exportIntegrity: {
349
+ gltfErrors: gltf.issues.numErrors,
350
+ gltfWarnings: gltfFindings.filter((x) => x.disposition === 'warn').length,
351
+ },
352
+ runtimeCost: cost,
353
+ });
354
+ const effects = context.requirements.requirements.effects;
355
+ const rule = report.rules.find((r) => r.id === 'VFX_EXACT_PROFILE');
356
+ if (effects?.state === 'requested' && rule?.status === 'evaluated' && rule.mode !== 'off') {
357
+ const evidence = await analyzeFinalVfxGlbBytesV1(bytes);
358
+ const measured = inspectFinalEffects(effects.value, evidence);
359
+ const findings = rule.mode === 'enforce'
360
+ ? measured
361
+ : measured.map((f) => ({
362
+ ...f,
363
+ disposition: rule.mode,
364
+ }));
365
+ result = appendRequirementsQa(context, result, findings, {
366
+ exportIntegrity: finalEffectsMetrics(evidence),
367
+ });
368
+ }
369
+ return result;
370
+ }
@@ -0,0 +1,54 @@
1
+ import type { AssetIntentV1 } from "../contracts/index.js";
2
+ import type { InstanceabilityReport } from "../metrics.js";
3
+ import { type ReferenceComparisonEvidenceV1 } from "./reference-comparison.js";
4
+ import { QaRegistry, type QaRulePolicy } from "./registry.js";
5
+ import { type AssetQaReportV1, type AssetQaReport, type QaContext, type QaFinding } from "./types.js";
6
+ import type { KhronosGltfValidationReport } from "./gltf.js";
7
+ import type { MaterialBudgetWarningV1, MaterialMetricsV1 } from "../material-metrics.js";
8
+ export declare const DETERMINISTIC_QA_REGISTRY: QaRegistry;
9
+ export declare function runDeterministicSceneQa(context: QaContext, policy?: QaRulePolicy): AssetQaReportV1;
10
+ export declare function gltfReportFindings(report: KhronosGltfValidationReport, profile: string): QaFinding[];
11
+ export declare function appendFinalGltfQa(intent: AssetIntentV1, sceneReport: AssetQaReportV1, gltfReport: KhronosGltfValidationReport): AssetQaReportV1;
12
+ /**
13
+ * Attach the existing A–F instanceability result only to the runtime-cost
14
+ * dimension. It is deliberately not promoted to a composite quality grade.
15
+ */
16
+ export declare function appendRuntimeCostQa(intent: AssetIntentV1, report: AssetQaReportV1, instanceability?: InstanceabilityReport, metricsError?: string): AssetQaReportV1;
17
+ /** Attach portable material metrics and advisory budget findings to runtimeCost
18
+ * without collapsing them into the independent instanceability grade. */
19
+ export declare function appendMaterialMetricsQa(intent: AssetIntentV1, report: AssetQaReportV1, materialMetrics: MaterialMetricsV1, budgetWarnings?: readonly MaterialBudgetWarningV1[]): AssetQaReportV1;
20
+ /**
21
+ * Attach reference-image agreement to promptAlignment.
22
+ *
23
+ * A separate appender rather than evidence on the pre-export context, because
24
+ * the rendered views this compares against do not exist until after the GLB is
25
+ * written — the scene QA pass runs strictly earlier. The findings come from
26
+ * {@link referenceComparisonFindings}, the same code the registered rule uses,
27
+ * so the two paths cannot drift into different opinions about disagreement.
28
+ *
29
+ * Observe-only, so this can never turn a passing asset into a blocked one; the
30
+ * dimension status it produces is at worst unchanged.
31
+ */
32
+ export declare function appendReferenceComparisonQa(intent: AssetIntentV1, report: AssetQaReportV1, evidence: ReferenceComparisonEvidenceV1): AssetQaReportV1;
33
+ /**
34
+ * Ops kill switch (H-40): `KILN_QA_MODE=observe|off` overrides every rule's
35
+ * default mode, feeding the registry's otherwise-unfed {@link QaRulePolicy}.
36
+ * DOWNGRADE-ONLY by design: 'observe'/'off' are always authorized, while
37
+ * 'warn'/'enforce' would throw mid-render on rules whose promotion evidence
38
+ * doesn't authorize them — promotion stays a code change, not an env flip.
39
+ * Unset or an unrecognized value = ship defaults (exact rules at enforce).
40
+ */
41
+ export declare function qaPolicyFromEnv(env?: Record<string, string | undefined>): QaRulePolicy;
42
+ /**
43
+ * Whether a `disposition: 'block'` QA report may abort a render. False under
44
+ * `KILN_QA_MODE=observe|off` — the emergency downgrade for a misfiring rule in
45
+ * prod: reports still record block dispositions (telemetry stays honest), but
46
+ * the render completes with a warning instead of throwing.
47
+ */
48
+ export declare function qaBlockingEnabled(env?: Record<string, string | undefined>): boolean;
49
+ export declare class AssetQaBlockedError extends Error {
50
+ readonly report: AssetQaReport;
51
+ readonly stage: 'scene' | 'final-glb';
52
+ readonly gltfValidation?: KhronosGltfValidationReport;
53
+ constructor(report: AssetQaReport, stage: 'scene' | 'final-glb', gltfValidation?: KhronosGltfValidationReport);
54
+ }
package/lib/qa/run.js ADDED
@@ -0,0 +1,240 @@
1
+ import { MATERIAL_QA_RULE } from "./material.js";
2
+ import { ARCHITECTURE_QA_RULES } from "./architecture.js";
3
+ import { CHARACTER_QA_RULE } from "./character.js";
4
+ import { CHARACTER_ADVISORY_QA_RULE } from "./character-advisory.js";
5
+ import { VEHICLE_QA_RULES } from "./vehicle.js";
6
+ import { VEGETATION_QA_RULES } from "./vegetation.js";
7
+ import { PROP_QA_RULES } from "./prop.js";
8
+ import { PART_CONNECTIVITY_QA_RULE } from "./part-connectivity.js";
9
+ import { REFERENCE_COMPARISON_QA_RULE, referenceComparisonFindings, } from "./reference-comparison.js";
10
+ import { SELF_INTERSECTION_QA_RULE } from "./self-intersection.js";
11
+ import { SWEEP_QA_RULE } from "./sweep.js";
12
+ import { ENVIRONMENT_QA_RULES } from "./environment.js";
13
+ import { W7_BREADTH_QA_RULES } from "./breadth.js";
14
+ import { withDerivedW7BreadthEvidence } from "./breadth-evidence.js";
15
+ import { QaRegistry } from "./registry.js";
16
+ import { createAssetQaReportV1, } from "./types.js";
17
+ import { UNIVERSAL_QA_RULES } from "./universal.js";
18
+ export const DETERMINISTIC_QA_REGISTRY = new QaRegistry([
19
+ ...UNIVERSAL_QA_RULES,
20
+ MATERIAL_QA_RULE,
21
+ ...ARCHITECTURE_QA_RULES,
22
+ CHARACTER_QA_RULE,
23
+ CHARACTER_ADVISORY_QA_RULE,
24
+ ...VEHICLE_QA_RULES,
25
+ ...VEGETATION_QA_RULES,
26
+ ...PROP_QA_RULES,
27
+ ...ENVIRONMENT_QA_RULES,
28
+ ...W7_BREADTH_QA_RULES,
29
+ SELF_INTERSECTION_QA_RULE,
30
+ SWEEP_QA_RULE,
31
+ PART_CONNECTIVITY_QA_RULE,
32
+ REFERENCE_COMPARISON_QA_RULE,
33
+ ]);
34
+ export function runDeterministicSceneQa(context, policy = {}) {
35
+ const result = DETERMINISTIC_QA_REGISTRY.run(withDerivedW7BreadthEvidence(context), policy);
36
+ return createAssetQaReportV1(context.intent, {
37
+ findings: result.findings,
38
+ evaluatedDimensions: ['exportIntegrity', 'categoryReadiness'],
39
+ });
40
+ }
41
+ export function gltfReportFindings(report, profile) {
42
+ return report.issues.messages
43
+ .filter((issue) => issue.severity === 0 || issue.severity === 1)
44
+ .filter((issue) => !isExpectedKtx2ValidatorLimitation(report, issue))
45
+ .map((issue) => ({
46
+ code: `GLTF_${issue.code}`.replace(/[^A-Z0-9_]/g, '_'),
47
+ disposition: issue.severity === 0 ? 'block' : 'warn',
48
+ dimension: 'exportIntegrity',
49
+ profile,
50
+ message: issue.message,
51
+ ...(issue.pointer ? { affected: { nodePath: issue.pointer } } : {}),
52
+ }));
53
+ }
54
+ /** gltf-validator 2.0.0-dev.3.10 does not understand the image/ktx2 MIME used by
55
+ * KHR_texture_basisu. Ignore only its exact, pointer-bound false warnings when
56
+ * the artifact explicitly requires that extension; every other warning remains. */
57
+ function isExpectedKtx2ValidatorLimitation(report, issue) {
58
+ const required = report.info?.['extensionsRequired'];
59
+ if (!Array.isArray(required) || !required.includes('KHR_texture_basisu'))
60
+ return false;
61
+ if (issue.code === 'VALUE_NOT_IN_LIST') {
62
+ return (/^\/images\/\d+\/mimeType$/.test(issue.pointer ?? '') &&
63
+ issue.message === "Invalid value 'image/ktx2'. Valid values are ('image/jpeg', 'image/png').");
64
+ }
65
+ return (issue.code === 'IMAGE_UNRECOGNIZED_FORMAT' &&
66
+ /^\/images\/\d+$/.test(issue.pointer ?? '') &&
67
+ issue.message === 'Image format not recognized.');
68
+ }
69
+ export function appendFinalGltfQa(intent, sceneReport, gltfReport) {
70
+ const findings = Object.values(sceneReport.dimensions).flatMap((dimension) => dimension.findings);
71
+ const gltfFindings = gltfReportFindings(gltfReport, intent.qaProfile);
72
+ findings.push(...gltfFindings);
73
+ return createAssetQaReportV1(intent, {
74
+ findings,
75
+ evaluatedDimensions: ['exportIntegrity', 'categoryReadiness'],
76
+ metrics: {
77
+ exportIntegrity: {
78
+ gltfErrors: gltfReport.issues.numErrors,
79
+ gltfWarnings: gltfFindings.filter((finding) => finding.disposition === 'warn').length,
80
+ },
81
+ },
82
+ });
83
+ }
84
+ /**
85
+ * Attach the existing A–F instanceability result only to the runtime-cost
86
+ * dimension. It is deliberately not promoted to a composite quality grade.
87
+ */
88
+ export function appendRuntimeCostQa(intent, report, instanceability, metricsError) {
89
+ const findings = Object.values(report.dimensions).flatMap((dimension) => dimension.findings);
90
+ if (metricsError) {
91
+ findings.push({
92
+ code: 'RUNTIME_COST_METRICS_FAILED',
93
+ disposition: 'warn',
94
+ dimension: 'runtimeCost',
95
+ profile: intent.qaProfile,
96
+ message: `Runtime-cost metrics could not be computed: ${metricsError}`,
97
+ });
98
+ }
99
+ const evaluatedDimensions = Object.entries(report.dimensions)
100
+ .filter(([, dimension]) => dimension.status !== 'notEvaluated')
101
+ .map(([dimension]) => dimension);
102
+ evaluatedDimensions.push('runtimeCost');
103
+ const metrics = Object.fromEntries(Object.entries(report.dimensions).flatMap(([dimension, result]) => result.metrics ? [[dimension, result.metrics]] : []));
104
+ if (instanceability) {
105
+ metrics.runtimeCost = {
106
+ instanceabilityGrade: instanceability.grade,
107
+ instanceabilitySummary: instanceability.summary,
108
+ uniqueGeometries: instanceability.metrics.uniqueGeometries,
109
+ uniqueMaterials: instanceability.metrics.uniqueMaterials,
110
+ drawCalls: instanceability.metrics.drawCalls,
111
+ textureCount: instanceability.metrics.textureCount,
112
+ transparentMaterials: instanceability.metrics.transparentMaterials,
113
+ triangles: instanceability.metrics.triangles,
114
+ skinned: instanceability.metrics.skinned,
115
+ };
116
+ }
117
+ return createAssetQaReportV1(intent, {
118
+ findings,
119
+ evaluatedDimensions,
120
+ ...(Object.keys(metrics).length > 0 ? { metrics } : {}),
121
+ });
122
+ }
123
+ /** Attach portable material metrics and advisory budget findings to runtimeCost
124
+ * without collapsing them into the independent instanceability grade. */
125
+ export function appendMaterialMetricsQa(intent, report, materialMetrics, budgetWarnings = []) {
126
+ const findings = Object.values(report.dimensions).flatMap((dimension) => dimension.findings);
127
+ findings.push(...budgetWarnings.map((warning) => ({
128
+ code: warning.code,
129
+ disposition: 'warn',
130
+ dimension: 'runtimeCost',
131
+ profile: `${warning.profile}.${warning.tier}`,
132
+ message: `${warning.message} ${warning.advice}`,
133
+ measurement: warning.measurement,
134
+ })));
135
+ const evaluatedDimensions = Object.entries(report.dimensions)
136
+ .filter(([, dimension]) => dimension.status !== 'notEvaluated')
137
+ .map(([dimension]) => dimension);
138
+ if (!evaluatedDimensions.includes('runtimeCost'))
139
+ evaluatedDimensions.push('runtimeCost');
140
+ const metrics = Object.fromEntries(Object.entries(report.dimensions).flatMap(([dimension, result]) => result.metrics ? [[dimension, result.metrics]] : []));
141
+ metrics.runtimeCost = {
142
+ ...(metrics.runtimeCost ?? {}),
143
+ materialCount: materialMetrics.materialCount,
144
+ opaqueMaterials: materialMetrics.opaqueMaterials,
145
+ maskedMaterials: materialMetrics.maskedMaterials,
146
+ blendedMaterials: materialMetrics.blendedMaterials,
147
+ singleSidedMaterials: materialMetrics.singleSidedMaterials,
148
+ doubleSidedMaterials: materialMetrics.doubleSidedMaterials,
149
+ texturedMaterials: materialMetrics.texturedMaterials,
150
+ materialExtensionCount: materialMetrics.materialExtensionCount,
151
+ materialExtensionsUsed: materialMetrics.materialExtensionsUsed.join(','),
152
+ imageCount: materialMetrics.imageCount,
153
+ maxImageDimension: materialMetrics.maxImageDimension,
154
+ decodedImageBytesRgba8: materialMetrics.decodedImageBytesRgba8,
155
+ estimatedGpuBytesWithMipmaps: materialMetrics.estimatedGpuBytesWithMipmaps,
156
+ blendedSurfaceAreaRatio: materialMetrics.blendedSurfaceAreaRatio,
157
+ };
158
+ return createAssetQaReportV1(intent, { findings, evaluatedDimensions, metrics });
159
+ }
160
+ /**
161
+ * Attach reference-image agreement to promptAlignment.
162
+ *
163
+ * A separate appender rather than evidence on the pre-export context, because
164
+ * the rendered views this compares against do not exist until after the GLB is
165
+ * written — the scene QA pass runs strictly earlier. The findings come from
166
+ * {@link referenceComparisonFindings}, the same code the registered rule uses,
167
+ * so the two paths cannot drift into different opinions about disagreement.
168
+ *
169
+ * Observe-only, so this can never turn a passing asset into a blocked one; the
170
+ * dimension status it produces is at worst unchanged.
171
+ */
172
+ export function appendReferenceComparisonQa(intent, report, evidence) {
173
+ const findings = Object.values(report.dimensions).flatMap((dimension) => dimension.findings);
174
+ findings.push(...referenceComparisonFindings(evidence, 'reference.comparison'));
175
+ const evaluatedDimensions = Object.entries(report.dimensions)
176
+ .filter(([, dimension]) => dimension.status !== 'notEvaluated')
177
+ .map(([dimension]) => dimension);
178
+ if (!evaluatedDimensions.includes('promptAlignment'))
179
+ evaluatedDimensions.push('promptAlignment');
180
+ const metrics = Object.fromEntries(Object.entries(report.dimensions).flatMap(([dimension, result]) => result.metrics ? [[dimension, result.metrics]] : []));
181
+ metrics.promptAlignment = {
182
+ ...(metrics.promptAlignment ?? {}),
183
+ referenceSilhouetteIoU: evidence.silhouetteIoU,
184
+ referenceColorAgreement: evidence.colorAgreement,
185
+ referenceCoverageRatio: evidence.coverageRatio,
186
+ // Surfaced because a reference with no rejected shadow pixels is either a
187
+ // cutout or flat-lit, and the coverage numbers mean something different then.
188
+ referenceShadowPixels: evidence.reference.shadowPixels,
189
+ };
190
+ return createAssetQaReportV1(intent, { findings, evaluatedDimensions, metrics });
191
+ }
192
+ /**
193
+ * Ops kill switch (H-40): `KILN_QA_MODE=observe|off` overrides every rule's
194
+ * default mode, feeding the registry's otherwise-unfed {@link QaRulePolicy}.
195
+ * DOWNGRADE-ONLY by design: 'observe'/'off' are always authorized, while
196
+ * 'warn'/'enforce' would throw mid-render on rules whose promotion evidence
197
+ * doesn't authorize them — promotion stays a code change, not an env flip.
198
+ * Unset or an unrecognized value = ship defaults (exact rules at enforce).
199
+ */
200
+ export function qaPolicyFromEnv(env = process.env) {
201
+ const mode = env['KILN_QA_MODE'];
202
+ return mode === 'observe' || mode === 'off' ? { defaultMode: mode } : {};
203
+ }
204
+ /**
205
+ * Whether a `disposition: 'block'` QA report may abort a render. False under
206
+ * `KILN_QA_MODE=observe|off` — the emergency downgrade for a misfiring rule in
207
+ * prod: reports still record block dispositions (telemetry stays honest), but
208
+ * the render completes with a warning instead of throwing.
209
+ */
210
+ export function qaBlockingEnabled(env = process.env) {
211
+ const mode = env['KILN_QA_MODE'];
212
+ return mode !== 'observe' && mode !== 'off';
213
+ }
214
+ /** Blockers spelled out in full per message; the rest collapse to a count. */
215
+ const MAX_DETAILED_BLOCKERS = 6;
216
+ export class AssetQaBlockedError extends Error {
217
+ report;
218
+ stage;
219
+ gltfValidation;
220
+ constructor(report, stage, gltfValidation) {
221
+ const blockers = Object.values(report.dimensions)
222
+ .flatMap((dimension) => dimension.findings)
223
+ .filter((finding) => finding.disposition === 'block');
224
+ // H-40(3): this message IS what the agent reads when a mid-loop render is
225
+ // QA-blocked (kiln_render catches and returns { ok:false, error: message }),
226
+ // Include the measured target as quoted data as well as repair advice.
227
+ // Some messages (for example missing UVs) contain no part identity of their own.
228
+ const detailed = blockers
229
+ .slice(0, MAX_DETAILED_BLOCKERS)
230
+ .map((finding) => `${finding.code}: ${finding.message}${finding.affected ? ` AFFECTED: ${JSON.stringify(finding.affected)}` : ''}${finding.repairText ? ` FIX: ${finding.repairText}` : ''}`);
231
+ const overflow = blockers.length > MAX_DETAILED_BLOCKERS
232
+ ? ` (+${blockers.length - MAX_DETAILED_BLOCKERS} more blockers)`
233
+ : '';
234
+ super(`Asset QA blocked at ${stage}: ${detailed.join(' | ') || 'unknown blocker'}${overflow}`);
235
+ this.name = 'AssetQaBlockedError';
236
+ this.report = report;
237
+ this.stage = stage;
238
+ this.gltfValidation = gltfValidation;
239
+ }
240
+ }