@metamesh/generator-sdk 0.10.0 → 0.12.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 +26 -0
- package/README.md +34 -25
- package/dist/authoring.d.ts +1 -52
- package/dist/authoring.d.ts.map +1 -1
- package/dist/authoring.js +0 -24
- package/dist/authoring.js.map +1 -1
- package/dist/contracts.d.ts +15 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/execute-generator.d.ts +14 -23
- package/dist/execute-generator.d.ts.map +1 -1
- package/dist/execute-generator.js +33 -32
- package/dist/execute-generator.js.map +1 -1
- package/dist/generated-parts.d.ts +16 -0
- package/dist/generated-parts.d.ts.map +1 -1
- package/dist/generated-parts.js +155 -67
- package/dist/generated-parts.js.map +1 -1
- package/dist/generator-module.d.ts +20 -17
- package/dist/generator-module.d.ts.map +1 -1
- package/dist/generator-module.js +3 -4
- package/dist/generator-module.js.map +1 -1
- package/dist/generator-package/constants.d.ts +2 -2
- package/dist/generator-package/constants.js +2 -2
- package/dist/generator-package/schemas/manifest.schema.d.ts +1 -1
- package/dist/generator-package/validate-manifest.js +2 -2
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/parameters/preparation.d.ts +8 -6
- package/dist/parameters/preparation.d.ts.map +1 -1
- package/dist/parameters/preparation.js +21 -10
- package/dist/parameters/preparation.js.map +1 -1
- package/dist/parameters.d.ts +1 -1
- package/dist/parameters.d.ts.map +1 -1
- package/dist/parameters.js +1 -1
- package/dist/parameters.js.map +1 -1
- package/dist/parse-generator-module.d.ts +5 -27
- package/dist/parse-generator-module.d.ts.map +1 -1
- package/dist/parse-generator-module.js +29 -96
- package/dist/parse-generator-module.js.map +1 -1
- package/dist/runtime.d.ts +6 -6
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/runtime.js.map +1 -1
- package/dist/worker-contracts.d.ts +2 -2
- package/dist/worker-contracts.d.ts.map +1 -1
- package/dist/worker-contracts.js.map +1 -1
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @metamesh/generator-sdk
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
No changes in this release.
|
|
6
|
+
|
|
7
|
+
## 0.11.0
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- b5da778: Replace prepare/build with typed generation programs, optional computed values and authoritative
|
|
12
|
+
part placement. Add isolated session caches and deferred geometry with explicit snapshot ownership.
|
|
13
|
+
Expose immutable fluent Solid and Section methods for transforms, subtraction, finishing, and
|
|
14
|
+
Section-to-Solid construction, replacing the corresponding standalone operations and public
|
|
15
|
+
context facade. Generator packages require format 4 and runtime 4; previous executable contracts are unsupported.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- d69836c: Update the Generator SDK's runtime validation dependency to Zod 4.6.7.
|
|
20
|
+
- bfb7a63: Keep computed dependencies correct after conditional removal and re-registration, and prevent
|
|
21
|
+
caught evaluation failures from returning earlier cached values. Reduce immutable data copying,
|
|
22
|
+
centralize geometry finalization, and validate newly delivered resources once while preserving
|
|
23
|
+
per-revision part and aggregate resource checks.
|
|
24
|
+
|
|
25
|
+
Replace transparent cached typed arrays with explicit immutableBuffer and immutableMesh capture
|
|
26
|
+
helpers. Cached numeric data exposes length, at(), and copy(); uncaptured typed arrays in computed
|
|
27
|
+
results or bindings now reject. Snapshot and Worker output buffers remain ordinary typed arrays.
|
|
28
|
+
|
|
3
29
|
## 0.10.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ pnpm add @metamesh/generator-sdk
|
|
|
12
12
|
|
|
13
13
|
| Import | Use it for |
|
|
14
14
|
| ------------- | ---------------------------------------------------------- |
|
|
15
|
-
| Package root | Definitions, presets, and
|
|
15
|
+
| Package root | Definitions, presets, and module authoring |
|
|
16
16
|
| `/parameters` | Defaults, recovering saved values, and strict codecs |
|
|
17
17
|
| `/runtime` | Module execution, generated mesh data, and Worker messages |
|
|
18
18
|
| `/packages` | Package, catalog, and installation parsing |
|
|
@@ -55,36 +55,45 @@ Generator and package parsing uses the same rules. The package also ships
|
|
|
55
55
|
`@metamesh/generator-sdk/parameters.schema.json` for offline editor completion and structural
|
|
56
56
|
validation; the SDK additionally checks references, defaults, and cross-field invariants.
|
|
57
57
|
|
|
58
|
-
##
|
|
58
|
+
## Generate a model
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
installed, validate related dimensions and pass the prepared result into construction:
|
|
60
|
+
A Generator exports one format-4 default envelope containing its definition-bound program:
|
|
62
61
|
|
|
63
62
|
```ts
|
|
64
|
-
import { defineGeneratorModule,
|
|
65
|
-
import { tube } from "@metamesh/modeling";
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
import { defineGeneratorModule, type GeneratorParams } from "@metamesh/generator-sdk";
|
|
64
|
+
import { generate, tube } from "@metamesh/modeling";
|
|
65
|
+
|
|
66
|
+
const model = generate<GeneratorParams<typeof definition>>(({ params, assert, part }) => {
|
|
67
|
+
assert(
|
|
68
|
+
params.boreDiameter < params.outerDiameter,
|
|
69
|
+
"The bore must be smaller than the outside diameter.",
|
|
70
|
+
{ parameterId: "boreDiameter" }
|
|
71
|
+
);
|
|
72
|
+
return [
|
|
73
|
+
part(
|
|
74
|
+
"body",
|
|
75
|
+
tube({
|
|
76
|
+
outerRadius: params.outerDiameter / 2,
|
|
77
|
+
innerRadius: params.boreDiameter / 2,
|
|
78
|
+
height: 20,
|
|
79
|
+
})
|
|
80
|
+
),
|
|
81
|
+
];
|
|
74
82
|
});
|
|
75
|
-
|
|
76
|
-
definition,
|
|
77
|
-
prepare: prepareSleeve,
|
|
78
|
-
build: (dimensions) => tube({ ...dimensions, height: 20 }),
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
export const { formatVersion, generatorId, version, prepare, build } = runtime;
|
|
83
|
+
export default defineGeneratorModule({ definition, generate: model });
|
|
82
84
|
```
|
|
83
85
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
The host normalizes parameters and resolves assets before synchronous generation. Modeling owns
|
|
87
|
+
optional computed caches, deferred recipes, sessions and immutable snapshots; the SDK stays
|
|
88
|
+
renderer-neutral and imports no engine. The [generation contract](https://github.com/JasonKoolman/metamesh/blob/main/docs/model-generation.md)
|
|
89
|
+
owns dependencies, assertions, placement and lifecycle. `/runtime` strictly checks the new default
|
|
90
|
+
envelope and maps engine diagnostics to definition-owned issues. Unsupported package formats are
|
|
91
|
+
rejected before executable bytes are evaluated.
|
|
92
|
+
|
|
93
|
+
For incremental Worker deliveries, `/runtime` provides `GeneratedPartsDecoder`. It validates new
|
|
94
|
+
geometry buffers once and hydrates later resource references, while checking part metadata and
|
|
95
|
+
aggregate limits on every delivery. The receiving host keeps admitted buffers immutable and
|
|
96
|
+
attached, and calls `clear()` when replacing the delivery source.
|
|
88
97
|
|
|
89
98
|
## Documentation
|
|
90
99
|
|
package/dist/authoring.d.ts
CHANGED
|
@@ -1,57 +1,6 @@
|
|
|
1
|
-
import type { GeneratorDefinition,
|
|
2
|
-
import type { Preparation } from "./generator-module.js";
|
|
3
|
-
import { type GeneratorServices } from "./generator-services.js";
|
|
1
|
+
import type { GeneratorDefinition, GeneratorPreset } from "./contracts.js";
|
|
4
2
|
/** Captures literal IDs and options; the host validates serializable metadata. */
|
|
5
3
|
export declare function defineGenerator<const D extends GeneratorDefinition>(definition: D): D;
|
|
6
4
|
/** Contextually types complete presets from the same definition as the controls. */
|
|
7
5
|
export declare function definePresets<const D extends GeneratorDefinition, const Presets extends readonly GeneratorPreset<NoInfer<D>>[]>(_definition: D, presets: Presets): Presets;
|
|
8
|
-
/** Successful worker-local preparation. The value is never cloned or inspected. */
|
|
9
|
-
export declare function prepared<P>(value: P): {
|
|
10
|
-
readonly ok: true;
|
|
11
|
-
readonly value: P;
|
|
12
|
-
readonly issues: readonly [];
|
|
13
|
-
};
|
|
14
|
-
/** Failed preparation attributed to a literal parameter ID or an existing error issue. */
|
|
15
|
-
export declare function invalid<const Id extends string>(parameterId: Id, message: string): {
|
|
16
|
-
readonly ok: false;
|
|
17
|
-
readonly issues: readonly [
|
|
18
|
-
{
|
|
19
|
-
readonly severity: "error";
|
|
20
|
-
readonly parameterId: Id;
|
|
21
|
-
readonly message: string;
|
|
22
|
-
}
|
|
23
|
-
];
|
|
24
|
-
};
|
|
25
|
-
export declare function invalid<const Issue extends ParameterIssue & {
|
|
26
|
-
readonly severity: "error";
|
|
27
|
-
}>(issue: Issue): {
|
|
28
|
-
readonly ok: false;
|
|
29
|
-
readonly issues: readonly [Issue];
|
|
30
|
-
};
|
|
31
|
-
/** Definition-bound error reporting plus the host's unchanged text service. */
|
|
32
|
-
export interface PreparationServices<D extends GeneratorDefinition> extends GeneratorServices {
|
|
33
|
-
/** Reports one error using a declared parameter ID or an existing definition-bound issue. */
|
|
34
|
-
readonly invalid: {
|
|
35
|
-
<const Id extends D["parameters"][number]["id"]>(parameterId: Id, message: string): {
|
|
36
|
-
readonly ok: false;
|
|
37
|
-
readonly issues: readonly [
|
|
38
|
-
{
|
|
39
|
-
readonly severity: "error";
|
|
40
|
-
readonly parameterId: Id;
|
|
41
|
-
readonly message: string;
|
|
42
|
-
}
|
|
43
|
-
];
|
|
44
|
-
};
|
|
45
|
-
<const Issue extends GeneratorIssue<D> & {
|
|
46
|
-
readonly severity: "error";
|
|
47
|
-
}>(issue: Issue): {
|
|
48
|
-
readonly ok: false;
|
|
49
|
-
readonly issues: readonly [Issue];
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
/** Wraps preparation with definition-bound services while preserving its exact result and value. */
|
|
54
|
-
export declare function definePreparation<const D extends GeneratorDefinition, Result extends Preparation<NoInfer<D>, unknown>>(_definition: D, callback: (parameters: GeneratorParams<NoInfer<D>>, services: PreparationServices<NoInfer<D>>) => Result): (parameters: GeneratorParams<D>, services?: GeneratorServices) => Result;
|
|
55
|
-
/** Parameter-only preparation is useful for models with no derived dimensions. */
|
|
56
|
-
export declare function prepareIdentity<const D extends GeneratorDefinition>(_definition: D): (parameters: GeneratorParams<D>) => ReturnType<typeof prepared<GeneratorParams<D>>>;
|
|
57
6
|
//# sourceMappingURL=authoring.d.ts.map
|
package/dist/authoring.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE3E,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,KAAK,CAAC,CAAC,SAAS,mBAAmB,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAErF;AAED,oFAAoF;AACpF,wBAAgB,aAAa,CAC3B,KAAK,CAAC,CAAC,SAAS,mBAAmB,EACnC,KAAK,CAAC,OAAO,SAAS,SAAS,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAC5D,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAE3C"}
|
package/dist/authoring.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { UNPREPARED_GENERATOR_SERVICES } from "./generator-services.js";
|
|
2
1
|
/** Captures literal IDs and options; the host validates serializable metadata. */
|
|
3
2
|
export function defineGenerator(definition) {
|
|
4
3
|
return definition;
|
|
@@ -7,27 +6,4 @@ export function defineGenerator(definition) {
|
|
|
7
6
|
export function definePresets(_definition, presets) {
|
|
8
7
|
return presets;
|
|
9
8
|
}
|
|
10
|
-
/** Successful worker-local preparation. The value is never cloned or inspected. */
|
|
11
|
-
export function prepared(value) {
|
|
12
|
-
return { ok: true, value, issues: [] };
|
|
13
|
-
}
|
|
14
|
-
export function invalid(issueOrId, message) {
|
|
15
|
-
if (typeof issueOrId === "string") {
|
|
16
|
-
if (typeof message !== "string")
|
|
17
|
-
throw new TypeError("Invalid preparation needs an error message.");
|
|
18
|
-
return { ok: false, issues: [{ severity: "error", parameterId: issueOrId, message }] };
|
|
19
|
-
}
|
|
20
|
-
if (issueOrId === null || typeof issueOrId !== "object" || issueOrId.severity !== "error")
|
|
21
|
-
throw new TypeError("Invalid preparation requires an error issue.");
|
|
22
|
-
return { ok: false, issues: [issueOrId] };
|
|
23
|
-
}
|
|
24
|
-
/** Wraps preparation with definition-bound services while preserving its exact result and value. */
|
|
25
|
-
export function definePreparation(_definition, callback) {
|
|
26
|
-
return (parameters, services = UNPREPARED_GENERATOR_SERVICES) => callback(parameters, { ...services, invalid });
|
|
27
|
-
}
|
|
28
|
-
/** Parameter-only preparation is useful for models with no derived dimensions. */
|
|
29
|
-
export function prepareIdentity(_definition) {
|
|
30
|
-
void _definition;
|
|
31
|
-
return prepared;
|
|
32
|
-
}
|
|
33
9
|
//# sourceMappingURL=authoring.js.map
|
package/dist/authoring.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring.js","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authoring.js","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAAsC,UAAa;IAChF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,aAAa,CAG3B,WAAc,EAAE,OAAgB;IAChC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/contracts.d.ts
CHANGED
|
@@ -100,6 +100,12 @@ export interface ModelTimings {
|
|
|
100
100
|
/** Selects whether Studio preserves or locally improves final planar triangle connectivity. */
|
|
101
101
|
export type MeshTopologyMode = "original" | "optimized";
|
|
102
102
|
export interface GeneratedPart {
|
|
103
|
+
/** Session-scoped immutable local mesh resource identity. */
|
|
104
|
+
readonly geometryId: string;
|
|
105
|
+
readonly geometryRevision: number;
|
|
106
|
+
/** Authoritative translation in mm and fixed global X, Y, Z rotations in degrees. */
|
|
107
|
+
readonly position: Vec3;
|
|
108
|
+
readonly rotation: Vec3;
|
|
103
109
|
readonly id: string;
|
|
104
110
|
readonly positions: Float32Array;
|
|
105
111
|
readonly indices: Uint32Array;
|
|
@@ -114,4 +120,13 @@ export interface GeneratedModel {
|
|
|
114
120
|
readonly stats?: ModelStats | undefined;
|
|
115
121
|
readonly warnings: readonly ParameterIssue[];
|
|
116
122
|
}
|
|
123
|
+
/** A subsequent delivery may reference a mesh already owned by the receiving session. */
|
|
124
|
+
export type GeneratedPartDelivery = GeneratedPart | (Omit<GeneratedPart, "positions" | "indices"> & {
|
|
125
|
+
readonly positions?: never;
|
|
126
|
+
readonly indices?: never;
|
|
127
|
+
});
|
|
128
|
+
/** Worker delivery; receiving hosts hydrate references before strict full-model parsing. */
|
|
129
|
+
export type GeneratedModelDelivery = Omit<GeneratedModel, "parts"> & {
|
|
130
|
+
readonly parts: readonly GeneratedPartDelivery[];
|
|
131
|
+
};
|
|
117
132
|
//# sourceMappingURL=contracts.d.ts.map
|
package/dist/contracts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBA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AAE,SAAS,aAAa,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;CAC9C;AAED,yFAAyF;AACzF,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG;IAC9C,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;CAC1B,CAAC,CAAC;AAEP,4FAA4F;AAC5F,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG;IACnE,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAClD,CAAC"}
|
|
@@ -1,40 +1,31 @@
|
|
|
1
|
-
import type { GeneratorDefinition, GeneratorParams, ParameterValidationResult } from "./contracts.js";
|
|
2
|
-
import type { GeneratorModule } from "./generator-module.js";
|
|
1
|
+
import type { GeneratorDefinition, GeneratorIssue, GeneratorParams, ParameterValidationResult } from "./contracts.js";
|
|
2
|
+
import type { GeneratorModule, GeneratorProgram } from "./generator-module.js";
|
|
3
3
|
import type { GeneratorServices } from "./generator-services.js";
|
|
4
4
|
import type { PreparedParameters } from "./parameters.js";
|
|
5
|
-
|
|
6
|
-
export interface PrepareGeneratorOptions<D extends GeneratorDefinition, P, Context, Output> {
|
|
5
|
+
export interface ExecuteGeneratorOptions<D extends GeneratorDefinition, Program extends GeneratorProgram, Output> {
|
|
7
6
|
readonly definition: D;
|
|
8
7
|
readonly parameters: Readonly<Record<string, unknown>>;
|
|
9
|
-
/**
|
|
8
|
+
/** Reuses host normalization performed before asynchronous asset preparation. */
|
|
10
9
|
readonly parameterState?: PreparedParameters<D>;
|
|
11
|
-
readonly module:
|
|
10
|
+
readonly module: GeneratorModule<D, Program>;
|
|
12
11
|
readonly services: GeneratorServices;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readonly context: Context;
|
|
12
|
+
/** The owning host runs its session; the SDK never initializes Modeling. */
|
|
13
|
+
readonly execute: (program: Program, parameters: GeneratorParams<D>, services: GeneratorServices) => Output;
|
|
16
14
|
}
|
|
17
15
|
export interface GeneratorExecutionInvalid<D extends GeneratorDefinition = GeneratorDefinition> {
|
|
18
16
|
readonly type: "invalid";
|
|
19
17
|
readonly parameters: GeneratorParams<D>;
|
|
20
18
|
readonly validation: ParameterValidationResult;
|
|
21
19
|
}
|
|
22
|
-
export interface
|
|
23
|
-
readonly type: "
|
|
24
|
-
readonly parameters: GeneratorParams<D>;
|
|
25
|
-
readonly validation: ParameterValidationResult;
|
|
26
|
-
readonly build: (context: Context) => Output;
|
|
27
|
-
}
|
|
28
|
-
export interface GeneratorExecutionBuilt<D extends GeneratorDefinition, Output> {
|
|
29
|
-
readonly type: "built";
|
|
20
|
+
export interface GeneratorExecutionGenerated<D extends GeneratorDefinition, Output> {
|
|
21
|
+
readonly type: "generated";
|
|
30
22
|
readonly parameters: GeneratorParams<D>;
|
|
31
23
|
readonly validation: ParameterValidationResult;
|
|
32
24
|
readonly output: Output;
|
|
33
25
|
}
|
|
34
|
-
export type
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export declare function executeGenerator<const D extends GeneratorDefinition, P, Context, Output>(options: ExecuteGeneratorOptions<D, P, Context, Output>): GeneratorExecutionResult<D, Output>;
|
|
26
|
+
export type GeneratorExecutionResult<D extends GeneratorDefinition, Output> = GeneratorExecutionInvalid<D> | GeneratorExecutionGenerated<D, Output>;
|
|
27
|
+
/** Converts engine diagnostics at the SDK boundary, checking severity and parameter ownership. */
|
|
28
|
+
export declare function generationIssues<D extends GeneratorDefinition>(definition: D, value: unknown): readonly GeneratorIssue<D>[] | undefined;
|
|
29
|
+
/** Normalizes once and executes the host's synchronous session, preserving structured diagnostics. */
|
|
30
|
+
export declare function executeGenerator<const D extends GeneratorDefinition, Program extends GeneratorProgram, Output>(options: ExecuteGeneratorOptions<D, Program, Output>): GeneratorExecutionResult<D, Output>;
|
|
40
31
|
//# sourceMappingURL=execute-generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-generator.d.ts","sourceRoot":"","sources":["../src/execute-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"execute-generator.d.ts","sourceRoot":"","sources":["../src/execute-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,yBAAyB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,WAAW,uBAAuB,CACtC,CAAC,SAAS,mBAAmB,EAC7B,OAAO,SAAS,gBAAgB,EAChC,MAAM;IAEN,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACvD,iFAAiF;IACjF,QAAQ,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAChD,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7C,QAAQ,CAAC,QAAQ,EA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
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { aggregateParameterIssues, prepareParameters } from "./parameters.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
if (
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
: module.prepare(parameters.parameters, services);
|
|
13
|
-
const validation = aggregateParameterIssues(parameters.validation.issues, prepared.issues);
|
|
14
|
-
if (!prepared.ok || !validation.isValid) {
|
|
15
|
-
return Object.freeze({ type: "invalid", parameters: parameters.parameters, validation });
|
|
16
|
-
}
|
|
17
|
-
return Object.freeze({
|
|
18
|
-
type: "prepared",
|
|
19
|
-
parameters: parameters.parameters,
|
|
20
|
-
validation,
|
|
21
|
-
build: prepared.build,
|
|
22
|
-
});
|
|
1
|
+
import { aggregateParameterIssues, parseParameterIssues, prepareParameters } from "./parameters.js";
|
|
2
|
+
/** Converts engine diagnostics at the SDK boundary, checking severity and parameter ownership. */
|
|
3
|
+
export function generationIssues(definition, value) {
|
|
4
|
+
if (typeof value !== "object" || value === null)
|
|
5
|
+
return undefined;
|
|
6
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, "diagnostics");
|
|
7
|
+
if (descriptor === undefined)
|
|
8
|
+
return undefined;
|
|
9
|
+
if (!("value" in descriptor))
|
|
10
|
+
throw new TypeError("Generation diagnostics must be an own data field.");
|
|
11
|
+
return parseParameterIssues(definition, descriptor.value);
|
|
23
12
|
}
|
|
24
|
-
/**
|
|
13
|
+
/** Normalizes once and executes the host's synchronous session, preserving structured diagnostics. */
|
|
25
14
|
export function executeGenerator(options) {
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
validation
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
const state = options.parameterState ?? prepareParameters(options.definition, options.parameters);
|
|
16
|
+
if (!state.validation.isValid)
|
|
17
|
+
return Object.freeze({ type: "invalid", ...state });
|
|
18
|
+
try {
|
|
19
|
+
const output = options.execute(options.module.generate, state.parameters, options.services);
|
|
20
|
+
const issues = generationIssues(options.definition, output) ?? [];
|
|
21
|
+
const validation = aggregateParameterIssues(state.validation.issues, issues);
|
|
22
|
+
if (!validation.isValid)
|
|
23
|
+
return Object.freeze({ type: "invalid", parameters: state.parameters, validation });
|
|
24
|
+
return Object.freeze({ type: "generated", parameters: state.parameters, validation, output });
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
const issues = generationIssues(options.definition, error);
|
|
28
|
+
if (issues === undefined || !issues.some(({ severity }) => severity === "error"))
|
|
29
|
+
throw error;
|
|
30
|
+
return Object.freeze({
|
|
31
|
+
type: "invalid",
|
|
32
|
+
parameters: state.parameters,
|
|
33
|
+
validation: aggregateParameterIssues(state.validation.issues, issues),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
35
36
|
}
|
|
36
37
|
//# sourceMappingURL=execute-generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-generator.js","sourceRoot":"","sources":["../src/execute-generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execute-generator.js","sourceRoot":"","sources":["../src/execute-generator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAsCpG,kGAAkG;AAClG,MAAM,UAAU,gBAAgB,CAC9B,UAAa,EACb,KAAc;IAEd,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAClE,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACzE,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC/C,IAAI,CAAC,CAAC,OAAO,IAAI,UAAU,CAAC;QAC1B,MAAM,IA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S,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,KAAK,OAAO,CAAC;YAAE,MAAM,KAAK,CAAC;QAC9F,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,UAAU,EAAE,wBAAwB,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;SACtE,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -13,4 +13,20 @@ export interface GeneratedPartsLimits {
|
|
|
13
13
|
* validity, such as non-degenerate or closed topology, remains a Geometry concern.
|
|
14
14
|
*/
|
|
15
15
|
export declare function parseGeneratedParts(value: unknown, limitOverrides: GeneratedPartsLimits): readonly GeneratedPart[];
|
|
16
|
+
/**
|
|
17
|
+
* Admits each delivered geometry resource once and hydrates later references without rescanning it.
|
|
18
|
+
*
|
|
19
|
+
* The receiving host owns admitted buffers and must keep them immutable and attached. Every
|
|
20
|
+
* delivery still validates part metadata and aggregate limits. Only a successful delivery replaces
|
|
21
|
+
* the bounded resource map; captured parts retain their own buffers after clear or later deliveries.
|
|
22
|
+
*/
|
|
23
|
+
export declare class GeneratedPartsDecoder {
|
|
24
|
+
#private;
|
|
25
|
+
/** Fixes the receiving host's aggregate resource limits for this decoder's lifetime. */
|
|
26
|
+
constructor(limits: GeneratedPartsLimits);
|
|
27
|
+
/** Validates a complete delivery and commits resource ownership only after every part succeeds. */
|
|
28
|
+
decode(value: unknown): readonly GeneratedPart[];
|
|
29
|
+
/** Forgets admitted resources; previously returned parts remain valid and retain their buffers. */
|
|
30
|
+
clear(): void;
|
|
31
|
+
}
|
|
16
32
|
//# sourceMappingURL=generated-parts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated-parts.d.ts","sourceRoot":"","sources":["../src/generated-parts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"generated-parts.d.ts","sourceRoot":"","sources":["../src/generated-parts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAgBpD,wFAAwF;AACxF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAqQD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,oBAAoB,GACnC,SAAS,aAAa,EAAE,CAE1B;AAED;;;;;;GAMG;AACH,qBAAa,qBAAqB;;IAIhC,wFAAwF;gBAC5E,MAAM,EAAE,oBAAoB;IAIxC,mGAAmG;IACnG,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,aAAa,EAAE;IAMhD,mGAAmG;IACnG,KAAK,IAAI,IAAI;CAGd"}
|