@metamesh/cli 0.16.0 → 0.18.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.
- package/CHANGELOG.md +173 -0
- package/README.md +75 -52
- package/dist/authoring/artifacts.d.ts +2 -2
- package/dist/authoring/artifacts.d.ts.map +1 -1
- package/dist/authoring/artifacts.js +50 -32
- package/dist/authoring/artifacts.js.map +1 -1
- package/dist/authoring/check.d.ts.map +1 -1
- package/dist/authoring/check.js +9 -3
- package/dist/authoring/check.js.map +1 -1
- package/dist/authoring/documentation-manifest.d.ts +3 -0
- package/dist/authoring/documentation-manifest.d.ts.map +1 -0
- package/dist/authoring/documentation-manifest.js +23 -0
- package/dist/authoring/documentation-manifest.js.map +1 -0
- package/dist/authoring/documentation.d.ts +20 -0
- package/dist/authoring/documentation.d.ts.map +1 -0
- package/dist/authoring/documentation.js +94 -0
- package/dist/authoring/documentation.js.map +1 -0
- package/dist/authoring/environment.d.ts +1 -19
- package/dist/authoring/environment.d.ts.map +1 -1
- package/dist/authoring/environment.js +2 -110
- package/dist/authoring/environment.js.map +1 -1
- package/dist/authoring/{worker.d.ts → execution-process.d.ts} +2 -2
- package/dist/authoring/execution-process.d.ts.map +1 -0
- package/dist/authoring/{worker.js → execution-process.js} +17 -19
- package/dist/authoring/execution-process.js.map +1 -0
- package/dist/authoring/{capture/render-client.js → render/client-bundle.js} +196 -196
- package/dist/authoring/{capture/render-client.js.map → render/client-bundle.js.map} +4 -4
- package/dist/authoring/{render-client.d.ts → render/client.d.ts} +2 -2
- package/dist/authoring/render/client.d.ts.map +1 -0
- package/dist/authoring/{render-client.js → render/client.js} +2 -2
- package/dist/authoring/render/client.js.map +1 -0
- package/dist/authoring/{render.d.ts → render/render-capture.d.ts} +2 -2
- package/dist/authoring/render/render-capture.d.ts.map +1 -0
- package/dist/authoring/{render.js → render/render-capture.js} +4 -4
- package/dist/authoring/render/render-capture.js.map +1 -0
- package/dist/authoring/{render-scene.d.ts → render/scene.d.ts} +2 -2
- package/dist/authoring/render/scene.d.ts.map +1 -0
- package/dist/authoring/{render-scene.js → render/scene.js} +6 -10
- package/dist/authoring/render/scene.js.map +1 -0
- package/dist/authoring/{render-types.d.ts → render/types.d.ts} +3 -3
- package/dist/authoring/render/types.d.ts.map +1 -0
- package/dist/authoring/render/types.js +2 -0
- package/dist/authoring/render/types.js.map +1 -0
- package/dist/authoring/run.d.ts.map +1 -1
- package/dist/authoring/run.js +7 -3
- package/dist/authoring/run.js.map +1 -1
- package/dist/authoring/types.d.ts +20 -14
- package/dist/authoring/types.d.ts.map +1 -1
- package/dist/authoring/types.js.map +1 -1
- package/dist/authoring.d.ts +5 -4
- package/dist/authoring.d.ts.map +1 -1
- package/dist/authoring.js +3 -2
- package/dist/authoring.js.map +1 -1
- package/dist/docs/guides/agent-authoring.md +79 -57
- package/dist/docs/guides/package.md +75 -52
- package/dist/docs/manifest.json +1 -1
- package/dist/docs/reference/authoring/AUTHORING_PROTOCOL_VERSION.md +1 -1
- package/dist/docs/reference/authoring/AuthoringDiagnostic.md +1 -1
- package/dist/docs/reference/authoring/AuthoringEnvironment.md +1 -1
- package/dist/docs/reference/authoring/AuthoringError.md +1 -1
- package/dist/docs/reference/authoring/AuthoringFailure-type.md +1 -1
- package/dist/docs/reference/authoring/AuthoringKind.md +1 -1
- package/dist/docs/reference/authoring/AuthoringPhase.md +1 -1
- package/dist/docs/reference/authoring/CapturedBuffer.md +1 -1
- package/dist/docs/reference/authoring/CapturedGeometry.md +1 -1
- package/dist/docs/reference/authoring/CapturedPart.md +4 -6
- package/dist/docs/reference/authoring/CapturedResource.md +2 -2
- package/dist/docs/reference/authoring/CapturedRun.md +1 -1
- package/dist/docs/reference/authoring/CapturedRunManifest.md +3 -3
- package/dist/docs/reference/authoring/CheckOptions.md +1 -1
- package/dist/docs/reference/authoring/CheckSuccess.md +1 -1
- package/dist/docs/reference/authoring/DocumentationEntry.md +1 -1
- package/dist/docs/reference/authoring/DocumentationManifest.md +1 -1
- package/dist/docs/reference/authoring/DocumentationSearchResult.md +1 -1
- package/dist/docs/reference/authoring/InstalledAuthoringPackage.md +1 -1
- package/dist/docs/reference/authoring/RenderCamera.md +1 -1
- package/dist/docs/reference/authoring/RenderFormat.md +1 -1
- package/dist/docs/reference/authoring/RenderOptions.md +1 -1
- package/dist/docs/reference/authoring/RenderResult.md +1 -1
- package/dist/docs/reference/authoring/RenderView.md +1 -1
- package/dist/docs/reference/authoring/RenderedImage.md +1 -1
- package/dist/docs/reference/authoring/RunOptions.md +13 -5
- package/dist/docs/reference/authoring/RunSuccess.md +1 -1
- package/dist/docs/reference/authoring/authoringFailure-value.md +1 -1
- package/dist/docs/reference/authoring/checkAuthoringSource.md +1 -1
- package/dist/docs/reference/authoring/discoverAuthoringEnvironment.md +1 -1
- package/dist/docs/reference/authoring/inspectCapturedRun.md +1 -1
- package/dist/docs/reference/authoring/installAuthoringBrowser.md +1 -1
- package/dist/docs/reference/authoring/readCapturedRun.md +1 -1
- package/dist/docs/reference/authoring/renderCapturedRun.md +1 -1
- package/dist/docs/reference/authoring/runAuthoringSource.md +1 -1
- package/dist/docs/reference/authoring/searchAuthoringDocumentation.md +1 -1
- package/dist/docs/reference/authoring/showAuthoringDocumentation.md +1 -1
- package/dist/metamesh.js +22 -10
- package/dist/metamesh.js.map +1 -1
- package/package.json +9 -6
- package/dist/authoring/render-client.d.ts.map +0 -1
- package/dist/authoring/render-client.js.map +0 -1
- package/dist/authoring/render-scene.d.ts.map +0 -1
- package/dist/authoring/render-scene.js.map +0 -1
- package/dist/authoring/render-types.d.ts.map +0 -1
- package/dist/authoring/render-types.js +0 -2
- package/dist/authoring/render-types.js.map +0 -1
- package/dist/authoring/render.d.ts.map +0 -1
- package/dist/authoring/render.js.map +0 -1
- package/dist/authoring/worker.d.ts.map +0 -1
- package/dist/authoring/worker.js.map +0 -1
- /package/dist/authoring/{capture/render-client.js.LEGAL.txt → render/client-bundle.js.LEGAL.txt} +0 -0
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Use the CLI to find installed docs, check TypeScript, capture a model, and inspect measurements and rendered views.
|
|
4
4
|
|
|
5
|
-
Use the `metamesh` CLI to
|
|
6
|
-
the
|
|
7
|
-
|
|
5
|
+
Use the `metamesh` CLI to build a model and check what it actually produced. You or your agent can
|
|
6
|
+
look up the installed API, check TypeScript, run the model, and inspect measurements and views of
|
|
7
|
+
the captured result. The CLI runs trusted local source with your ordinary Node permissions. Its
|
|
8
|
+
disposable child process isn't a security sandbox.
|
|
8
9
|
|
|
9
10
|
## Install and discover the environment
|
|
10
11
|
|
|
12
|
+
Use Node.js 24 or newer. The package APIs publish ES modules only. TypeScript API consumers
|
|
13
|
+
use TypeScript 6.0 or newer with `strict` checking and `NodeNext` or `Bundler` resolution;
|
|
14
|
+
the CLI includes its source-checking compiler.
|
|
15
|
+
|
|
11
16
|
Install Modeling for your model code and the CLI for the local authoring workflow:
|
|
12
17
|
|
|
13
18
|
```bash
|
|
@@ -19,13 +24,12 @@ pnpm exec metamesh setup
|
|
|
19
24
|
|
|
20
25
|
`environment` reports project-resolved versions, documentation locations, available capabilities,
|
|
21
26
|
and `authoringProtocolVersion: 1`. An agent integration should check that protocol value before
|
|
22
|
-
using the commands.
|
|
23
|
-
|
|
27
|
+
using the commands. Fix missing packages, mismatched releases, or an unsupported protocol before
|
|
28
|
+
authoring.
|
|
24
29
|
|
|
25
30
|
Add the Generator SDK as a direct dependency when defining Generators, and Testkit when writing
|
|
26
|
-
automated tests.
|
|
27
|
-
|
|
28
|
-
packages on matching releases.
|
|
31
|
+
automated tests. Ordinary models need only Modeling and the CLI as direct dependencies. Keep
|
|
32
|
+
installed MetaMesh packages on matching releases.
|
|
29
33
|
|
|
30
34
|
| Component | Responsibility |
|
|
31
35
|
| ------------------------- | --------------------------------------------------------------------------------------------- |
|
|
@@ -44,10 +48,10 @@ pnpm exec metamesh docs search "cylinder"
|
|
|
44
48
|
pnpm exec metamesh docs show modeling/reference/model/cylinder
|
|
45
49
|
```
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
words in titles, headings, keywords, and summaries. Exact titles, IDs, and imports take priority;
|
|
51
|
+
Start with the [standalone model example](https://metamesh.studio/docs/develop/standalone-model), or use the
|
|
52
|
+
[construction map](https://metamesh.studio/docs/develop/geometry-package#choose-a-modeling-path) to choose an approach
|
|
53
|
+
for your shape. You can also search for a shape or symbol and read its recipe or reference.
|
|
54
|
+
Search matches distinct words in titles, headings, keywords, and summaries. Exact titles, IDs, and imports take priority;
|
|
51
55
|
equally complete intent matches favor guides.
|
|
52
56
|
|
|
53
57
|
Documentation is resolved from the selected project through package exports. No global installation
|
|
@@ -63,7 +67,7 @@ covers authoring and verification; `metamesh-docs` covers documentation. Both ar
|
|
|
63
67
|
Use a reviewed skill snapshot provided by your project or installed through your agent's skill
|
|
64
68
|
tooling. The printed GitHub installation source must be published before that command can work;
|
|
65
69
|
a skill is optional for the CLI workflow below. Skills teach the process. The installed npm
|
|
66
|
-
documentation
|
|
70
|
+
documentation supplies exact signatures, import paths, units, execution rules, and availability.
|
|
67
71
|
|
|
68
72
|
Project instructions should require environment discovery, relevant documentation lookup, source
|
|
69
73
|
checking and execution, then measurement inspection and useful rendered views from that same run.
|
|
@@ -72,8 +76,8 @@ targeting another directory so every step resolves the same installation.
|
|
|
72
76
|
|
|
73
77
|
## Model entries
|
|
74
78
|
|
|
75
|
-
A model entry default-exports
|
|
76
|
-
virtual `@metamesh/project` module
|
|
79
|
+
A model entry default-exports a `ModelProgram` and imports the installed package directly.
|
|
80
|
+
Studio's virtual `@metamesh/project` module isn't available in local Node projects.
|
|
77
81
|
|
|
78
82
|
|
|
79
83
|
|
|
@@ -83,7 +87,7 @@ import { box, cylinder, generate } from "@metamesh/modeling";
|
|
|
83
87
|
export default generate<Record<never, never>>(({ part }) => {
|
|
84
88
|
const body = box({ size: [30, 20, 6] });
|
|
85
89
|
const bore = cylinder({ height: 8, radius: 3, sizing: "face" });
|
|
86
|
-
return part("plate", body.subtract(
|
|
90
|
+
return part("plate", body.subtract(bore));
|
|
87
91
|
});
|
|
88
92
|
```
|
|
89
93
|
|
|
@@ -92,27 +96,27 @@ export default generate<Record<never, never>>(({ part }) => {
|
|
|
92
96
|
Save this as `model.ts`, then check and run it:
|
|
93
97
|
|
|
94
98
|
```bash
|
|
95
|
-
pnpm exec metamesh
|
|
99
|
+
pnpm exec metamesh typecheck model.ts --kind model
|
|
96
100
|
pnpm exec metamesh run model.ts --kind model --export-3mf
|
|
97
101
|
```
|
|
98
102
|
|
|
99
|
-
Both commands
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
Both commands check TypeScript types using the nearest project TypeScript configuration, or an
|
|
104
|
+
explicit `--tsconfig`, with strict checking enforced. You can use ordinary local imports and
|
|
105
|
+
installed dependencies. `typecheck` doesn't evaluate your source.
|
|
102
106
|
|
|
103
107
|
Use `--params values.json` for a model's JSON parameter map; the default is `{}`. Models do not
|
|
104
108
|
receive injected Generator services. A standalone module can prepare licensed local fonts before
|
|
105
109
|
constructing its synchronous generation program.
|
|
106
110
|
|
|
107
|
-
|
|
111
|
+
To record which local fonts you used, also pass `--font-fixtures fonts.json`. The CLI verifies those
|
|
108
112
|
bytes and records their declared font selections and immutable revisions in the capture; the model
|
|
109
113
|
still prepares its own fonts and receives no injected services. Arbitrary filesystem or network
|
|
110
|
-
reads
|
|
114
|
+
reads aren't intercepted, so the CLI can't infer their asset identities. The source fingerprint
|
|
111
115
|
covers bundled source, while fixture descriptors provide explicit asset provenance.
|
|
112
116
|
|
|
113
117
|
## Generator entries
|
|
114
118
|
|
|
115
|
-
Install the Generator
|
|
119
|
+
Install the Generator SDK alongside Modeling and the CLI to define controls and package metadata:
|
|
116
120
|
|
|
117
121
|
```bash
|
|
118
122
|
pnpm add @metamesh/generator-sdk
|
|
@@ -123,12 +127,9 @@ A Generator entry named-exports `definition` and default-exports its module enve
|
|
|
123
127
|
|
|
124
128
|
|
|
125
129
|
```ts
|
|
126
|
-
import {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
type GeneratorParams,
|
|
130
|
-
} from "@metamesh/generator-sdk";
|
|
131
|
-
import { box, generate } from "@metamesh/modeling";
|
|
130
|
+
import { defineGenerator } from "@metamesh/generator-sdk";
|
|
131
|
+
import { defineGeneratorModel } from "@metamesh/generator-sdk/modeling";
|
|
132
|
+
import { box } from "@metamesh/modeling";
|
|
132
133
|
|
|
133
134
|
export const definition = defineGenerator({
|
|
134
135
|
id: "plate",
|
|
@@ -138,18 +139,20 @@ export const definition = defineGenerator({
|
|
|
138
139
|
parameters: [{ id: "width", label: "Width", type: "number", default: 30, min: 1 }],
|
|
139
140
|
});
|
|
140
141
|
|
|
141
|
-
|
|
142
|
+
export default defineGeneratorModel(definition, ({ params, part }) =>
|
|
142
143
|
part("plate", box({ size: [params.width, 20, 6] }))
|
|
143
144
|
);
|
|
144
|
-
|
|
145
|
-
export default defineGeneratorModule({ definition, generate: model });
|
|
146
145
|
```
|
|
147
146
|
|
|
148
147
|
|
|
149
148
|
|
|
149
|
+
`defineGeneratorModel` from the optional SDK `/modeling` adapter infers controls, prepared services,
|
|
150
|
+
and assertion parameter IDs. It declares the ordinary Modeling program and package identity;
|
|
151
|
+
the host still owns normalization, asset preparation, execution, and cleanup.
|
|
152
|
+
|
|
150
153
|
```bash
|
|
151
|
-
pnpm exec metamesh
|
|
152
|
-
pnpm exec metamesh run generator.ts --kind generator --
|
|
154
|
+
pnpm exec metamesh typecheck generator.ts --kind generator
|
|
155
|
+
pnpm exec metamesh run generator.ts --kind generator --overrides values.json
|
|
153
156
|
```
|
|
154
157
|
|
|
155
158
|
Generator runs merge declared defaults with explicit overrides, then validate strictly. Unknown
|
|
@@ -173,10 +176,11 @@ pnpm exec metamesh render RUN_DIRECTORY
|
|
|
173
176
|
pnpm exec metamesh render RUN_DIRECTORY --views top --format webp --transparent
|
|
174
177
|
```
|
|
175
178
|
|
|
176
|
-
Inspection reads
|
|
177
|
-
provenance. Rendering uses the same captured buffers without rerunning the model
|
|
179
|
+
Inspection reads the completed model's part IDs, placements, colors, measurements, diagnostics,
|
|
180
|
+
and execution provenance. Rendering uses the same captured buffers without rerunning the model,
|
|
181
|
+
so the dimensions you inspect and the views you render belong to the same result. Captures remain
|
|
178
182
|
usable after the engine session is disposed or the directory moves. Corrupt or incomplete
|
|
179
|
-
artifacts
|
|
183
|
+
artifacts are rejected.
|
|
180
184
|
|
|
181
185
|
Rendering requires the separately installed pinned Chromium. It is never downloaded implicitly;
|
|
182
186
|
checking, generation, and inspection work without it. Standard orthographic views are isometric,
|
|
@@ -184,7 +188,7 @@ front, top, and right. The default is an isometric 1024 × 1024 PNG on a neutral
|
|
|
184
188
|
lossless; PNG and WebP both support explicit transparent output. Images record their run, camera,
|
|
185
189
|
renderer, and browser versions. Compare pixels only within the pinned capture environment.
|
|
186
190
|
|
|
187
|
-
`--export-3mf` exports that run
|
|
191
|
+
`--export-3mf` exports the completed model from that run. A failed attempt never exposes an older
|
|
188
192
|
successful result as its output. Match the captured parameters and source fingerprint to the
|
|
189
193
|
revision you intended to verify.
|
|
190
194
|
|
|
@@ -196,32 +200,50 @@ Install Testkit separately when you want assertions and fixtures for your existi
|
|
|
196
200
|
pnpm add -D @metamesh/testkit
|
|
197
201
|
```
|
|
198
202
|
|
|
203
|
+
Use `await runModel(({ part }) => part("body", box({ size: 2 })))` for a one-off model, or
|
|
204
|
+
pass an existing program directly with `await runModel(program, parameters)`. Use
|
|
205
|
+
`await runModel({ definition, runtime }, parameters)` for a Generator. The returned result remains
|
|
206
|
+
usable after the helper releases its temporary session; no cleanup is required.
|
|
207
|
+
For cached Generators, exercise representative edits through
|
|
208
|
+
`createGeneratorTestRunner(definition, runtime, { verifyCache: true })` and its `run` method.
|
|
209
|
+
One-shot tests and declaration checks do not verify reuse across edits. Use `cache: false` for
|
|
210
|
+
an uncached output baseline; keep prepared services stable when testing reuse in the same session.
|
|
211
|
+
Callbacks run synchronously and return a part or an array of parts. Declare typed inline inputs
|
|
212
|
+
with `runModel<Parameters, Services>(callback, parameters, options)`, or reuse a
|
|
213
|
+
`GenerateCallback<Parameters, Services>`. Parameterless callbacks and Generator defaults can omit parameters. Options stay in the third
|
|
214
|
+
argument: use `undefined` for omitted parameters when supplying a test-owned engine, generation
|
|
215
|
+
policy, prepared model services, or a Generator's asynchronous `prepareServices` adapter.
|
|
216
|
+
|
|
217
|
+
For Generator integration tests, import the definition and default runtime from the real entry
|
|
218
|
+
point instead of repeating its input resolution and builder calls. Use direct callbacks to isolate
|
|
219
|
+
construction, reconstruct a mesh, or deliberately bypass schema validation.
|
|
220
|
+
|
|
199
221
|
Use `createGeneratorTestRunner(definition, runtime)` for a Generator's persistent generation
|
|
200
|
-
session.
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
222
|
+
session. `runner.run(parameters)` normalizes inputs, prepares assets, and returns a discriminated
|
|
223
|
+
result. Handle `type: "invalid"`
|
|
224
|
+
before reading a generated `model`. Successful results remain usable after later runs and runner
|
|
225
|
+
disposal. Dispose the runner to release its session and caches. Use `engine.createSession(program, options)`
|
|
226
|
+
for repeated plain-model edits or cache tests and dispose the session in `finally`; its returned
|
|
227
|
+
results also remain usable. Unexpected execution or malformed-output errors reject.
|
|
206
228
|
|
|
207
229
|
The runner normalizes saved values. To probe deliberately invalid typed inputs without that
|
|
208
|
-
recovery, call `runner.
|
|
230
|
+
recovery, call `runner.check(parameters, { validateInput: false })`. Validation checks declarations
|
|
209
231
|
and reached assertions without finalizing output; execute representative valid combinations too.
|
|
210
232
|
The CLI's strict overrides serve a different purpose: they reject invalid or unknown values
|
|
211
233
|
before execution instead of recovering saved state.
|
|
212
234
|
|
|
213
|
-
| Helper
|
|
214
|
-
|
|
|
215
|
-
| `
|
|
216
|
-
| `
|
|
217
|
-
| `
|
|
218
|
-
| `
|
|
219
|
-
| `
|
|
220
|
-
|
|
221
|
-
Compare physical measurements with explicit absolute tolerances
|
|
222
|
-
square millimetres, and volume cubic millimetres. Component counts are exact.
|
|
223
|
-
|
|
224
|
-
wall thickness.
|
|
235
|
+
| Helper | What to check |
|
|
236
|
+
| ------------------------ | ------------------------------------------------------------------ |
|
|
237
|
+
| `assertValidDefinition` | Strict definition parsing and a canonical JSON round trip |
|
|
238
|
+
| `assertValidDefaults` | Strict parameter decoding and agreement with defaults |
|
|
239
|
+
| `assertValidPresets` | Serializable preset metadata; execute presets for domain rules |
|
|
240
|
+
| `assertValidParts` | Part metadata, closed oriented topology, and native reconstruction |
|
|
241
|
+
| `assertMeshMeasurements` | Bounds, area, signed volume, and connected-component count |
|
|
242
|
+
|
|
243
|
+
Compare physical measurements with explicit absolute tolerances: bounds use millimetres, area
|
|
244
|
+
square millimetres, and volume cubic millimetres. Component counts are exact. Use rendered views
|
|
245
|
+
alongside those assertions to check the shape. A valid solid alone doesn't prove a suitable fit or
|
|
246
|
+
manufacturable wall thickness.
|
|
225
247
|
|
|
226
248
|
For Font controls, supply the runner's `prepareServices` option using checked-in licensed bytes.
|
|
227
249
|
`prepareFontTestServices` from `@metamesh/testkit/fonts` verifies immutable font revisions and
|
|
@@ -1,71 +1,91 @@
|
|
|
1
1
|
# `@metamesh/cli`
|
|
2
2
|
|
|
3
|
-
Check,
|
|
4
|
-
|
|
3
|
+
Check, run, inspect, and render local MetaMesh models. The `metamesh` executable brings
|
|
4
|
+
version-matched documentation, TypeScript checks, and captured geometry into one authoring workflow.
|
|
5
|
+
The same tools are available through a Node API.
|
|
5
6
|
|
|
6
7
|
> **Preview:** `0.x` minor releases may break compatibility. Patches remain compatible within the
|
|
7
8
|
> same minor line.
|
|
8
9
|
|
|
9
10
|
## Installation
|
|
10
11
|
|
|
11
|
-
Install
|
|
12
|
+
Install matching Modeling and CLI releases in your authoring project:
|
|
12
13
|
|
|
13
14
|
```bash
|
|
14
15
|
pnpm add @metamesh/modeling
|
|
15
16
|
pnpm add -D @metamesh/cli
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
The executable and Node API require Node.js 24 or newer. The API publishes ES modules only.
|
|
20
|
+
TypeScript source and API consumers need TypeScript 6.0 or newer with `strict` checking and
|
|
21
|
+
`NodeNext` or `Bundler` module resolution. The CLI includes its source-checking compiler.
|
|
22
|
+
|
|
23
|
+
Add Generator SDK for Generator source and Testkit when importing testing helpers directly.
|
|
24
|
+
Standalone model authoring needs neither as a direct dependency. Chromium setup is separate;
|
|
25
|
+
checking, generation, and inspection work without a browser.
|
|
23
26
|
|
|
24
27
|
## Local workflow
|
|
25
28
|
|
|
29
|
+
Save a model entry as `model.ts`, default-exporting a `ModelProgram` from Modeling. Then discover
|
|
30
|
+
the installed environment, look up the API, and build a captured result:
|
|
31
|
+
|
|
26
32
|
```bash
|
|
27
33
|
pnpm exec metamesh environment --json
|
|
34
|
+
pnpm exec metamesh docs search "sweep"
|
|
28
35
|
pnpm exec metamesh docs show modeling/guide/concepts
|
|
29
|
-
pnpm exec metamesh
|
|
30
|
-
pnpm exec metamesh
|
|
31
|
-
pnpm exec metamesh check model.ts --kind model
|
|
32
|
-
pnpm exec metamesh run model.ts --kind model
|
|
36
|
+
pnpm exec metamesh typecheck model.ts --kind model
|
|
37
|
+
pnpm exec metamesh run model.ts --kind model --export-3mf
|
|
33
38
|
pnpm exec metamesh inspect RUN_DIRECTORY
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Replace `RUN_DIRECTORY` with the path reported by `run`. Commands resolve packages and paths
|
|
42
|
+
from the current project; use `--project PATH` to select another. `environment` reports the
|
|
43
|
+
supported authoring protocol, package versions, and local documentation. Version mismatches fail
|
|
44
|
+
before generation.
|
|
45
|
+
|
|
46
|
+
For Generators, use `--kind generator` with a named `definition` export and a default Generator
|
|
47
|
+
module. Pass `--overrides parameters.json` for input values. Generator overrides merge with defaults
|
|
48
|
+
and undergo strict validation; standalone model parameters pass through directly. Studio's virtual
|
|
49
|
+
`@metamesh/project` import is unavailable in local entries.
|
|
50
|
+
|
|
51
|
+
## Authoring tools
|
|
52
|
+
|
|
53
|
+
| Command | Purpose |
|
|
54
|
+
| --------------------------- | -------------------------------------------------------------------------------------- |
|
|
55
|
+
| `environment` | Discover project-local packages, capabilities, and documentation. |
|
|
56
|
+
| `docs search` / `docs show` | Find and read exact-version guides and API references offline. |
|
|
57
|
+
| `typecheck` | Check TypeScript and entry-point export types without executing the model. |
|
|
58
|
+
| `run` | Check and execute source, capture geometry and diagnostics, and optionally export 3MF. |
|
|
59
|
+
| `inspect` | Read captured parts, bounds, measurements, and diagnostics. |
|
|
60
|
+
| `render` | Create standard views from a capture. |
|
|
61
|
+
| `setup` | Print skill installation and project-instruction guidance. |
|
|
62
|
+
|
|
63
|
+
`run` uses a disposable child process with a 30-second default deadline and saves attempts under
|
|
64
|
+
`.metamesh/runs`. Captures retain source identity, effective parameters, and hashed geometry.
|
|
65
|
+
`inspect` and `render` validate those saved buffers without rerunning the source.
|
|
66
|
+
|
|
67
|
+
Source executes with your account's permissions; this is trusted local execution, not a security
|
|
68
|
+
sandbox. Use `--json` for structured stdout; bounded author logs go to stderr. Exit codes are
|
|
69
|
+
0 for success, 1 for source or generation failure, and 2 for invocation, environment, artifact,
|
|
70
|
+
or tooling failure. Each command's `--help` lists its options and limits.
|
|
71
|
+
|
|
72
|
+
Use `--params values.json` for a standalone model's complete input map. For a Generator,
|
|
73
|
+
use `--overrides values.json`; those values merge with definition defaults before strict
|
|
74
|
+
validation. The Node API uses the matching `params` and `overrides` fields, discriminated by `kind`.
|
|
75
|
+
|
|
76
|
+
## Render a capture
|
|
77
|
+
|
|
78
|
+
Install the pinned Chromium explicitly, then choose views of the captured model:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
34
81
|
pnpm exec metamesh browser install
|
|
35
82
|
pnpm exec metamesh render RUN_DIRECTORY --views isometric,front,top,right
|
|
36
83
|
```
|
|
37
84
|
|
|
38
|
-
|
|
39
|
-
and
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
`RUN_DIRECTORY` comes from a successful run.
|
|
43
|
-
|
|
44
|
-
The concepts guide starts with a compact construction map. Search matches distinct words in
|
|
45
|
-
titles, guide headings, keywords, and summaries. Exact titles, topic IDs, and import paths take
|
|
46
|
-
priority; equally complete intent matches favor guides over reference entries.
|
|
47
|
-
|
|
48
|
-
`run` includes semantic TypeScript checking and executes in a disposable child process with a
|
|
49
|
-
30-second default deadline. It saves each attempt beneath `.metamesh/runs` with source identity,
|
|
50
|
-
parameters, diagnostics, measurements, and hashed geometry buffers. `inspect` and `render` validate
|
|
51
|
-
those captured buffers without importing the original source. Use `--json` for one structured stdout
|
|
52
|
-
result; bounded author logs go to stderr. Exit codes are 0 for success, 1 for source or generation
|
|
53
|
-
failure, and 2 for invocation, environment, artifact, or tooling failure. This executes trusted local
|
|
54
|
-
code and is not a security sandbox.
|
|
55
|
-
|
|
56
|
-
For Generators, use `--kind generator`. Entries named-export `definition` and default-export the
|
|
57
|
-
Generator module envelope. Defaults merge with `--params parameters.json`, then strict validation
|
|
58
|
-
rejects unknown or invalid overrides. Standalone model entries default-export a `ModelProgram` and
|
|
59
|
-
receive no injected services. Both support normal local imports and installed dependencies; Studio's
|
|
60
|
-
virtual `@metamesh/project` module is unavailable.
|
|
61
|
-
|
|
62
|
-
Use `--help` on each command for parameters, fonts, resource limits, export, and image options.
|
|
63
|
-
`metamesh setup` prints installation guidance for `metamesh-developer` from the canonical
|
|
64
|
-
`metamesh-studio/metamesh-skills` repository and a project-instruction suggestion without modifying
|
|
65
|
-
files. Its printed GitHub installation command becomes usable when that repository is published;
|
|
66
|
-
the skill supplies the workflow, while installed package documentation supplies exact API facts.
|
|
67
|
-
|
|
68
|
-
## Programmatic API and documentation
|
|
85
|
+
Rendering supports PNG and lossless WebP, transparent backgrounds, and standard orthographic views.
|
|
86
|
+
Checking and generation never download a browser.
|
|
87
|
+
|
|
88
|
+
## Node API and agent workflows
|
|
69
89
|
|
|
70
90
|
```ts
|
|
71
91
|
import { inspectCapturedRun, runAuthoringSource } from "@metamesh/cli/authoring";
|
|
@@ -76,16 +96,19 @@ if (result.success) {
|
|
|
76
96
|
}
|
|
77
97
|
```
|
|
78
98
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
99
|
+
`@metamesh/cli/authoring` also exposes environment discovery, documentation lookup, source checking,
|
|
100
|
+
and rendering. `metamesh setup` prints guidance without changing project files. The portable
|
|
101
|
+
`metamesh-developer` skill supplies the workflow; installed package documentation supplies API facts.
|
|
102
|
+
Install a reviewed skill snapshot from the canonical `metamesh-studio/metamesh-skills` repository
|
|
103
|
+
or its local checkout when public installation is unavailable.
|
|
104
|
+
|
|
105
|
+
## Documentation
|
|
85
106
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
107
|
+
Resolve `@metamesh/cli/docs/manifest.json` for exact-version Markdown guidance and API references,
|
|
108
|
+
or run `pnpm exec metamesh docs show cli/guide/agent-authoring`. The
|
|
109
|
+
[authoring guide](https://github.com/JasonKoolman/metamesh/blob/main/apps/web/content/docs/develop/agent-authoring.mdx)
|
|
110
|
+
covers entry contracts, parameters, fonts, captures, and rendering. See
|
|
111
|
+
[Contributing](https://github.com/JasonKoolman/metamesh/blob/main/CONTRIBUTING.md) for package development.
|
|
89
112
|
|
|
90
113
|
## License
|
|
91
114
|
|
package/dist/docs/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Version of the CLI authoring protocol, independent of package SemVer and engine compatibility.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
AUTHORING_PROTOCOL_VERSION = 1
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A structured issue with optional source location, parameter association, and geometry context.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** A structured issue with optional source location, parameter association, and geometry context. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The selected project's supported protocol, matching package releases, and available workflows.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** The selected project's supported protocol, matching package releases, and available workflows. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A classified authoring exception retaining its workflow phase, stable code, and exit status.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** A classified authoring exception retaining its workflow phase, stable code, and exit status. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
An unsuccessful command outcome; a failure directory does not establish a complete capture.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** An unsuccessful command outcome; a failure directory does not establish a complete capture. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Selects a standalone ModelProgram entry or an SDK Generator module with a definition.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Selects a standalone ModelProgram entry or an SDK Generator module with a definition. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The workflow stage that rejected an invocation, source, asset, or captured artifact.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** The workflow stage that rejected an invocation, source, asset, or captured artifact. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A captured file's relative path, byte length, and SHA-256 integrity digest.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** A captured file's relative path, byte length, and SHA-256 integrity digest. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Validated local-space mesh buffers loaded from a completed captured resource.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Validated local-space mesh buffers loaded from a completed captured resource. */
|
|
@@ -2,18 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Semantic part identity and appearance referencing a shared mesh with separate placement.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Semantic part identity and appearance referencing a shared mesh with separate placement. */
|
|
9
9
|
export interface CapturedPart {
|
|
10
10
|
readonly id: string;
|
|
11
11
|
readonly resourceId: string;
|
|
12
|
-
/**
|
|
13
|
-
readonly
|
|
14
|
-
/** Global XYZ rotation in degrees, applied once to local geometry. */
|
|
15
|
-
readonly rotation: Vector3Data;
|
|
12
|
+
/** Rigid row-major local-to-world matrix, with translation in millimetres. */
|
|
13
|
+
readonly transform: Transform3Data;
|
|
16
14
|
readonly color?: string;
|
|
17
|
-
readonly measurements:
|
|
15
|
+
readonly measurements: ModelPart["measurements"];
|
|
18
16
|
}
|
|
19
17
|
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A shared local-space mesh resource and its measurements, before per-part placement.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** A shared local-space mesh resource and its measurements, before per-part placement. */
|
|
@@ -10,6 +10,6 @@ export interface CapturedResource {
|
|
|
10
10
|
readonly id: string;
|
|
11
11
|
readonly positions: CapturedBuffer;
|
|
12
12
|
readonly indices: CapturedBuffer;
|
|
13
|
-
readonly measurements:
|
|
13
|
+
readonly measurements: ModelPart["measurements"];
|
|
14
14
|
}
|
|
15
15
|
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A validated successful capture with its manifest and shared local geometry buffers.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** A validated successful capture with its manifest and shared local geometry buffers. */
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
A completed attempt's provenance, effective inputs, diagnostics, and captured geometry.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** A completed attempt's provenance, effective inputs, diagnostics, and captured geometry. */
|
|
9
9
|
export interface CapturedRunManifest {
|
|
10
|
-
readonly formatVersion:
|
|
10
|
+
readonly formatVersion: 2;
|
|
11
11
|
readonly status: "complete";
|
|
12
12
|
readonly runId: string;
|
|
13
13
|
readonly createdAt: string;
|
|
@@ -31,7 +31,7 @@ export interface CapturedRunManifest {
|
|
|
31
31
|
};
|
|
32
32
|
readonly diagnostics: readonly GenerationDiagnostic[];
|
|
33
33
|
readonly bounds: Bounds3Data;
|
|
34
|
-
readonly stats:
|
|
34
|
+
readonly stats: ModelResult["stats"];
|
|
35
35
|
readonly dependencies: ModelDependencies;
|
|
36
36
|
readonly resources: readonly CapturedResource[];
|
|
37
37
|
readonly parts: readonly CapturedPart[];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Source entry contract and project-local resolution settings for semantic checking.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Source entry contract and project-local resolution settings for semantic checking. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A successful semantic check; source has not been evaluated and no geometry is captured.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** A successful semantic check; source has not been evaluated and no geometry is captured. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Metadata for one installed Markdown guide or public API symbol.
|
|
4
4
|
|
|
5
|
-
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.
|
|
5
|
+
Import from `@metamesh/cli/authoring` (@metamesh/cli@0.18.0).
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
/** Metadata for one installed Markdown guide or public API symbol. */
|