@instruktlabs/kiln 1.0.0 → 1.2.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 (92) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/CHANGELOG.md +60 -3
  5. package/CONTRIBUTING.md +16 -7
  6. package/README.md +95 -381
  7. package/dist/agent-run.mjs +220 -150
  8. package/dist/build.json +40 -28
  9. package/dist/cli.mjs +242 -163
  10. package/dist/mcp-engine.mjs +412 -154
  11. package/dist/mcp-server.mjs +1 -1
  12. package/docs/architecture.md +6 -3
  13. package/docs/chatgpt.md +20 -5
  14. package/docs/examples.md +40 -170
  15. package/docs/install.md +100 -35
  16. package/docs/migration.md +20 -0
  17. package/docs/sdk.md +49 -5
  18. package/docs/tools-operations.md +1529 -0
  19. package/lib/asset-widget-uri.d.ts +9 -0
  20. package/lib/asset-widget-uri.js +9 -0
  21. package/lib/cli-render-mode.js +10 -3
  22. package/lib/discovery/index.d.ts +1 -1
  23. package/lib/discovery/index.js +2 -2
  24. package/lib/discovery/portable.d.ts +9 -0
  25. package/lib/discovery/portable.js +6 -0
  26. package/lib/discovery/service.d.ts +3 -1
  27. package/lib/discovery/service.js +4 -2
  28. package/lib/engine-identity.d.ts +1 -1
  29. package/lib/engine-identity.js +1 -1
  30. package/lib/evaluator/isolation.js +19 -5
  31. package/lib/evaluator/probe-invariants.d.ts +11 -0
  32. package/lib/evaluator/probe-invariants.js +36 -0
  33. package/lib/evaluator/probe-worker.js +16 -4
  34. package/lib/loopback.d.ts +6 -0
  35. package/lib/loopback.js +6 -0
  36. package/lib/mcp-core.d.ts +210 -0
  37. package/lib/mcp-core.js +279 -0
  38. package/lib/mcp-engine.d.ts +59 -0
  39. package/lib/mcp-engine.js +289 -0
  40. package/lib/mcp-manifest.d.ts +15 -0
  41. package/lib/mcp-manifest.js +65 -0
  42. package/lib/mcp.d.ts +5 -0
  43. package/lib/mcp.js +2 -0
  44. package/lib/render-service-host.js +1 -1
  45. package/lib/tools/discovery.d.ts +1 -1
  46. package/lib/tools/discovery.js +11 -9
  47. package/lib/tools/materials.d.ts +1 -1
  48. package/lib/tools/materials.js +44 -14
  49. package/lib/tools/operation-contract.d.ts +8 -0
  50. package/lib/tools/operation-contract.js +37 -0
  51. package/lib/tools/operations.d.ts +3 -0
  52. package/lib/tools/operations.js +154 -0
  53. package/lib/tools/registry.d.ts +6 -2
  54. package/lib/tools/registry.js +71 -23
  55. package/package.json +23 -1
  56. package/plugin.json +1 -1
  57. package/plugins/kiln-engine/.claude-plugin/icon.png +0 -0
  58. package/plugins/kiln-engine/.claude-plugin/plugin.json +9 -3
  59. package/plugins/kiln-engine/PRIVACY.md +100 -0
  60. package/plugins/kiln-engine/README.md +103 -18
  61. package/plugins/kiln-engine/{scripts/setup-workspace.mjs → bin/kiln-setup-workspace.mjs} +37 -9
  62. package/plugins/kiln-engine/package-provenance.json +15 -8
  63. package/plugins/kiln-engine/plugin.json +10 -4
  64. package/plugins/kiln-engine/runtime.json +10 -1
  65. package/plugins/kiln-engine/skills/kiln-setup-workspace/SKILL.md +17 -18
  66. package/plugins/kiln-engine/skills/kiln-setup-workspace/references/plugin-install.md +28 -8
  67. package/plugins/kiln-engine/skills/kiln-setup-workspace/references/renderer-setup.md +11 -0
  68. package/scripts/create-workspace.mjs +71 -13
  69. package/scripts/workspace-config.mjs +239 -0
  70. package/scripts/workspace-project.mjs +384 -0
  71. package/scripts/workspace-transaction.mjs +504 -0
  72. package/skills/kiln-setup-workspace/SKILL.md +17 -18
  73. package/skills/kiln-setup-workspace/references/plugin-install.md +28 -8
  74. package/skills/kiln-setup-workspace/references/renderer-setup.md +11 -0
  75. package/src/cli-render-mode.ts +9 -9
  76. package/src/cli.ts +3 -3
  77. package/src/discovery/index.ts +2 -0
  78. package/src/discovery/portable.ts +9 -0
  79. package/src/discovery/service.ts +3 -1
  80. package/src/engine-identity.ts +1 -1
  81. package/src/evaluator/isolation.ts +27 -6
  82. package/src/evaluator/probe-invariants.ts +50 -0
  83. package/src/evaluator/probe-worker.ts +22 -4
  84. package/src/mcp-core.ts +3 -0
  85. package/src/mcp-engine.ts +11 -1
  86. package/src/mcp.ts +5 -0
  87. package/src/render-service-host.ts +1 -1
  88. package/src/tools/discovery.ts +20 -10
  89. package/src/tools/materials.ts +59 -15
  90. package/src/tools/operation-contract.ts +51 -0
  91. package/src/tools/operations.ts +177 -0
  92. package/src/tools/registry.ts +100 -20
package/docs/sdk.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This describes the v1 package contract. Examples use `@instruktlabs/kiln`; install
4
4
  a published version or a qualified local archive as described in the
5
- [installation guide](install.md). Registry publication is a separate release gate.
5
+ [installation guide](install.md). Use documentation matching the installed version.
6
6
 
7
7
  ## Imports
8
8
 
@@ -22,7 +22,8 @@ const result = await renderGLB(code);
22
22
  ```
23
23
 
24
24
  The complete authoring and host APIs remain available through documented subpaths.
25
- The existing 55 export paths are retained. The root exposes rendering, validation,
25
+ The original 55 export paths are retained; version 1.1 adds four
26
+ host entrypoints below. The root exposes rendering, validation,
26
27
  Discovery and engine identity; it does not re-export every name from every module.
27
28
  CommonJS is not part of this release's contract.
28
29
 
@@ -37,8 +38,8 @@ Use the existing material payload and asset-bundle encoders for portable deliver
37
38
  | Root library | `@instruktlabs/kiln` |
38
39
  | Authoring | `primitives`, `geometry`, `deform`, `sweep`, `architecture`, `assembly`, `character`, `vehicle`, `palette` |
39
40
  | Materials | `material-library`, `material-library/node`, `material-presets`, `material-recipes`, `material-resources`, `material-recipe-runtime`, `material-recipe-prompt`, `material-metrics`, `texture-resolver` |
40
- | Rendering and inspection | `render`, `views`, `validation`, `metrics`, `inspect`, `qa`, `asset-export`, `kit` |
41
- | Host contracts | `tools`, `evaluator`, `discovery`, `requirements`, `requirements/migration`, `contracts`, `prompt-api`, `profile` |
41
+ | Rendering and inspection | `render`, `views`, `views/port`, `validation`, `metrics`, `inspect`, `qa`, `asset-export`, `kit` |
42
+ | Host contracts | `tools`, `tools/input`, `mcp`, `evaluator`, `discovery`, `discovery/portable`, `requirements`, `requirements/migration`, `contracts`, `prompt-api`, `profile` |
42
43
  | Records and storage | `assets`, `projects`, `project-bundle`, `workspace`, `live-review`, `programs`, `cache`, and each corresponding `/node` adapter |
43
44
  | Composition | `composer`, `world-runtime` |
44
45
  | Ranking math | `arena` |
@@ -52,7 +53,7 @@ entrypoint list. Files inside `lib/`, including declaration dependencies under
52
53
 
53
54
  ## Stability in 1.x
54
55
 
55
- The table classifies all 55 public entrypoints. The root and every listed subpath
56
+ The table classifies all 59 public entrypoints in version 1.1. The root and every listed subpath
56
57
  except `implicit` are stable entrypoints for v1: their declared public signatures,
57
58
  record shapes and documented behavior receive normal semantic-versioning
58
59
  compatibility. Optional dependencies do not make the two agent APIs experimental.
@@ -86,6 +87,26 @@ the remaining names do not by themselves promise browser compatibility. Portable
86
87
  record modules retain their existing boundaries. Browser use must follow a
87
88
  documented, qualified entrypoint rather than importing the entire Node host.
88
89
 
90
+ ### Embedding interfaces added in 1.1
91
+
92
+ - `mcp` exports `createKilnMcpServer`, `createKilnToolHost` and `kilnMcpToolDefs`
93
+ for Node hosts, using the shared tool registry and injected `KilnToolContext`.
94
+ It is an in-process embedding API. The `kiln-mcp` executable keeps its separate
95
+ lazy engine loading; importing `mcp` loads the Node engine.
96
+ - `discovery/portable` provides catalog/request validation, lexical indexing,
97
+ `createDiscoveryService` and retired-helper guidance. Supply a catalog generated
98
+ from the matching engine version. This browser-qualified entrypoint does not
99
+ import Node's built-in catalog construction or execute authored programs.
100
+ - `tools/input` exposes the shared action requirements and input-error formatting
101
+ helpers without importing the engine registry or Node runtime.
102
+ - `views/port` exposes the existing renderer-port helpers and types, including
103
+ `captureViewPngsViaPort`. Reuse their deadline, cancellation and PNG-validation
104
+ policy rather than implementing a second renderer adapter. It does not provide
105
+ a renderer or authorize trusted execution of untrusted source.
106
+
107
+ These entries require 1.1 or later; 1.0.0 does not expose them.
108
+ They contain no cloud-provider, account, tenant or hosted-service policy.
109
+
89
110
  `renderGLB` defaults to trusted in-process execution. A hosted service accepting
90
111
  untrusted programs must inject or select the qualified isolated evaluator described
91
112
  in the runtime contract. A subprocess provides a worker boundary; it does not alone
@@ -115,6 +136,29 @@ the stability of the helpers it uses. Exact details retain the same structured
115
136
  `stability` field. Implicit modeling remains available without a new opt-in switch;
116
137
  the community exporter retains its explicit selection.
117
138
 
139
+ ## Named operation presentation
140
+
141
+ In package version 1.2.0 and later, embeddings can select
142
+ `createKilnMcpServer(context, { toolPresentation: 'operations' })`, or obtain the
143
+ same definitions through `createKilnOperationToolRegistry(context)` from `tools`.
144
+ The default MCP and native interfaces retain their existing grouped tools.
145
+
146
+ With asset and material storage, and without project/review or renderer-control
147
+ callbacks, the named presentation exposes 21 tools. Asset browsing becomes
148
+ `kiln_assets_search` with an optional collection; material browsing becomes
149
+ `kiln_material_search` with `scope: 'all' | 'presets' | 'saved'`. Material creation
150
+ uses `kiln_material_create` with a required `definition` discriminated by
151
+ `kind: 'preset' | 'procedural'`. Saving, importing, retrieval and source restoration
152
+ remain explicit operations. Renderer controls appear only when their callbacks
153
+ exist. Connected `tools/list` remains authoritative.
154
+
155
+ Action requirements and field constraints come from the shared engine registry.
156
+ Generation rejects unclassified action/field additions and missing required
157
+ fields. Hosts select supported operations and add their actual execution and
158
+ persistence policy; do not copy domain schemas or assume a local read hint
159
+ describes a quota-admitted cloud job. This API change does not publish a package
160
+ or deploy a hosted service. Actual client acceptance is still required.
161
+
118
162
  ## Maintainer qualification
119
163
 
120
164
  `node scripts/build-runtime.mjs all` builds both executable bundles and the ESM SDK.