@hatiolab/figure-model 0.1.30 → 0.1.32

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 (143) hide show
  1. package/README.md +2 -0
  2. package/dist/index.d.ts +12 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +11 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/release-contract.d.ts +2 -2
  7. package/dist/release-contract.d.ts.map +1 -1
  8. package/dist/release-contract.js +45 -3
  9. package/dist/release-contract.js.map +1 -1
  10. package/dist/types.d.ts +15 -4
  11. package/dist/types.d.ts.map +1 -1
  12. package/dist/types.js +15 -4
  13. package/dist/types.js.map +1 -1
  14. package/dist/v3-asset-types.d.ts +116 -0
  15. package/dist/v3-asset-types.d.ts.map +1 -0
  16. package/dist/v3-asset-types.js +2 -0
  17. package/dist/v3-asset-types.js.map +1 -0
  18. package/dist/v3-asset.d.ts +8 -0
  19. package/dist/v3-asset.d.ts.map +1 -0
  20. package/dist/v3-asset.js +135 -0
  21. package/dist/v3-asset.js.map +1 -0
  22. package/dist/v3-authoring-session.d.ts +119 -0
  23. package/dist/v3-authoring-session.d.ts.map +1 -0
  24. package/dist/v3-authoring-session.js +132 -0
  25. package/dist/v3-authoring-session.js.map +1 -0
  26. package/dist/v3-capabilities.d.ts +3 -0
  27. package/dist/v3-capabilities.d.ts.map +1 -0
  28. package/dist/v3-capabilities.js +221 -0
  29. package/dist/v3-capabilities.js.map +1 -0
  30. package/dist/v3-contract.d.ts +7 -0
  31. package/dist/v3-contract.d.ts.map +1 -0
  32. package/dist/v3-contract.js +12 -0
  33. package/dist/v3-contract.js.map +1 -0
  34. package/dist/v3-create.d.ts +61 -0
  35. package/dist/v3-create.d.ts.map +1 -0
  36. package/dist/v3-create.js +151 -0
  37. package/dist/v3-create.js.map +1 -0
  38. package/dist/v3-document.d.ts +5 -0
  39. package/dist/v3-document.d.ts.map +1 -0
  40. package/dist/v3-document.js +31 -0
  41. package/dist/v3-document.js.map +1 -0
  42. package/dist/v3-editor-workspace.d.ts +367 -0
  43. package/dist/v3-editor-workspace.d.ts.map +1 -0
  44. package/dist/v3-editor-workspace.js +179 -0
  45. package/dist/v3-editor-workspace.js.map +1 -0
  46. package/dist/v3-graph-types.d.ts +91 -0
  47. package/dist/v3-graph-types.d.ts.map +1 -0
  48. package/dist/v3-graph-types.js +2 -0
  49. package/dist/v3-graph-types.js.map +1 -0
  50. package/dist/v3-graph.d.ts +5 -0
  51. package/dist/v3-graph.d.ts.map +1 -0
  52. package/dist/v3-graph.js +631 -0
  53. package/dist/v3-graph.js.map +1 -0
  54. package/dist/v3-json.d.ts +13 -0
  55. package/dist/v3-json.d.ts.map +1 -0
  56. package/dist/v3-json.js +94 -0
  57. package/dist/v3-json.js.map +1 -0
  58. package/dist/v3-part-edit.d.ts +12 -0
  59. package/dist/v3-part-edit.d.ts.map +1 -0
  60. package/dist/v3-part-edit.js +61 -0
  61. package/dist/v3-part-edit.js.map +1 -0
  62. package/docs/assembly-constraints-v3.md +141 -0
  63. package/docs/prototypes/README.md +73 -0
  64. package/docs/prototypes/render-dryroom.py +60 -0
  65. package/docs/prototypes/render-full-dryroom.mjs +86 -0
  66. package/docs/prototypes/shapeassembly-probe-results.json +325 -0
  67. package/docs/prototypes/shapeassembly-probe.py +84 -0
  68. package/docs/prototypes/v3-asset-samples.mjs +15 -0
  69. package/docs/prototypes/v3-asset-store.mjs +52 -0
  70. package/docs/prototypes/v3-asset-store.test.mjs +59 -0
  71. package/docs/prototypes/v3-asset.mjs +1 -0
  72. package/docs/prototypes/v3-asset.schema.json +44 -0
  73. package/docs/prototypes/v3-asset.test.mjs +68 -0
  74. package/docs/prototypes/v3-authoring-session.mjs +1 -0
  75. package/docs/prototypes/v3-authoring-session.test.mjs +65 -0
  76. package/docs/prototypes/v3-capability-plan.mjs +1 -0
  77. package/docs/prototypes/v3-capability-plan.test.mjs +56 -0
  78. package/docs/prototypes/v3-capability-samples.mjs +23 -0
  79. package/docs/prototypes/v3-document.mjs +2 -0
  80. package/docs/prototypes/v3-document.schema.json +66 -0
  81. package/docs/prototypes/v3-document.test.mjs +55 -0
  82. package/docs/prototypes/v3-dryroom-mesh.mjs +60 -0
  83. package/docs/prototypes/v3-dryroom-mesh.test.mjs +30 -0
  84. package/docs/prototypes/v3-editor-browser.mjs +97 -0
  85. package/docs/prototypes/v3-editor-workspace.mjs +1 -0
  86. package/docs/prototypes/v3-editor-workspace.test.mjs +35 -0
  87. package/docs/prototypes/v3-feature-pattern.test.mjs +131 -0
  88. package/docs/prototypes/v3-full-conveyor.mjs +60 -0
  89. package/docs/prototypes/v3-full-conveyor.test.mjs +61 -0
  90. package/docs/prototypes/v3-full-dryroom.mjs +67 -0
  91. package/docs/prototypes/v3-full-dryroom.test.mjs +54 -0
  92. package/docs/prototypes/v3-full-forklift.mjs +40 -0
  93. package/docs/prototypes/v3-full-forklift.test.mjs +37 -0
  94. package/docs/prototypes/v3-full-robot.mjs +35 -0
  95. package/docs/prototypes/v3-full-robot.test.mjs +68 -0
  96. package/docs/prototypes/v3-kernel.mjs +147 -0
  97. package/docs/prototypes/v3-kernel.test.mjs +144 -0
  98. package/docs/prototypes/v3-layout.test.mjs +281 -0
  99. package/docs/prototypes/v3-linear-comparison.py +183 -0
  100. package/docs/prototypes/v3-more-samples.test.mjs +182 -0
  101. package/docs/prototypes/v3-payload-collision.mjs +54 -0
  102. package/docs/prototypes/v3-payload-collision.test.mjs +68 -0
  103. package/docs/prototypes/v3-payload-fit.mjs +58 -0
  104. package/docs/prototypes/v3-payload-fit.test.mjs +59 -0
  105. package/docs/prototypes/v3-repeated-binding.mjs +13 -0
  106. package/docs/prototypes/v3-repeated-binding.test.mjs +46 -0
  107. package/docs/prototypes/v3-runtime-browser.mjs +76 -0
  108. package/docs/prototypes/v3-samples.test.mjs +144 -0
  109. package/docs/prototypes/v3-semantics.test.mjs +55 -0
  110. package/docs/prototypes/v3-spatial-plan.test.mjs +102 -0
  111. package/docs/prototypes/v3-typed-plan.mjs +3 -0
  112. package/docs/prototypes/v3-typed-plan.test.mjs +70 -0
  113. package/docs/prototypes/v3-typed-repeat.test.mjs +96 -0
  114. package/docs/v3-asset-persistence.md +66 -0
  115. package/docs/v3-authoring-transactions.md +57 -0
  116. package/docs/v3-capability-bindings.md +109 -0
  117. package/docs/v3-common-kernel-experiment.md +116 -0
  118. package/docs/v3-core-semantics.md +303 -0
  119. package/docs/v3-cutover.md +27 -0
  120. package/docs/v3-design.md +388 -0
  121. package/docs/v3-document-contract.md +55 -0
  122. package/docs/v3-dryroom-profile-validation.md +87 -0
  123. package/docs/v3-editor-integration.md +59 -0
  124. package/docs/v3-full-conveyor-validation.md +69 -0
  125. package/docs/v3-full-dryroom-validation.md +55 -0
  126. package/docs/v3-full-forklift-validation.md +41 -0
  127. package/docs/v3-full-robot-validation.md +64 -0
  128. package/docs/v3-layout-system.md +318 -0
  129. package/docs/v3-minimal-model.md +255 -0
  130. package/docs/v3-operator-contracts.md +148 -0
  131. package/docs/v3-payload-collision-validation.md +42 -0
  132. package/docs/v3-payload-contact-validation.md +56 -0
  133. package/docs/v3-repeated-binding-validation.md +42 -0
  134. package/docs/v3-research-review.md +160 -0
  135. package/docs/v3-runtime-extraction.md +107 -0
  136. package/docs/v3-sample-validation-expanded.md +106 -0
  137. package/docs/v3-sample-validation.md +97 -0
  138. package/docs/v3-shapeassembly-reproduction.md +99 -0
  139. package/docs/v3-spatial-contracts.md +84 -0
  140. package/docs/v3-status.md +41 -0
  141. package/docs/v3-storage-integration.md +58 -0
  142. package/docs/v3-typed-repeat-contracts.md +79 -0
  143. package/package.json +1 -1
@@ -0,0 +1,151 @@
1
+ import { compileV3Asset } from "./v3-asset.js";
2
+ import { V3ContractError } from "./v3-contract.js";
3
+ /** New assets start empty. A box is created only by an explicit authoring action. */
4
+ export function createV3Asset(name) {
5
+ const asset = {
6
+ version: 'figure-v3-asset-experiment-1',
7
+ name,
8
+ document: {
9
+ version: 'figure-v3-prototype-1',
10
+ model: { version: 'r3-spatial-1', inputs: [], constants: [], nodes: [] },
11
+ capabilities: { version: 'r3-capability-3', assetFrame: 'asset', bindings: [] }
12
+ },
13
+ designInputs: {},
14
+ stateDefaults: {},
15
+ palette: { 'palette.primary': '#477b9e' },
16
+ appearance: []
17
+ };
18
+ compileV3Asset(asset);
19
+ return asset;
20
+ }
21
+ /** Authoring recipes use existing providers; they introduce no extra evaluation rules. */
22
+ export function addV3Primitive(source, part) {
23
+ const recipes = {
24
+ box: { op: 'box-shape@1', keys: ['width', 'height', 'depth'] },
25
+ cylinder: { op: 'cylinder-shape@1', keys: ['radius', 'length'] },
26
+ 'rounded-box': { op: 'rounded-box@1', keys: ['width', 'height', 'depth', 'round'] },
27
+ portal: {
28
+ op: 'portal-profile@1',
29
+ keys: ['left', 'right', 'bottom', 'top', 'openingLeft', 'openingRight', 'openingTop', 'depth']
30
+ }
31
+ };
32
+ if (!part || !Object.hasOwn(recipes, part.kind))
33
+ throw new V3ContractError('PROVIDER', 'part', 'unknown primitive');
34
+ const recipe = recipes[part.kind];
35
+ if (!part.dimensions ||
36
+ Object.keys(part.dimensions).length !== recipe.keys.length ||
37
+ recipe.keys.some(k => !Object.hasOwn(part.dimensions, k)))
38
+ throw new V3ContractError('SCHEMA', part.id, 'provider dimensions must match declared fields');
39
+ const asset = addV3Box(source, {
40
+ id: part.id,
41
+ size: { x: 1, y: 1, z: 1 },
42
+ position: part.position,
43
+ ...(part.rotation ? { rotation: part.rotation } : {}),
44
+ ...(part.material ? { material: part.material } : {})
45
+ });
46
+ const model = asset.document.model, removed = new Set(['x', 'y', 'z'].map(a => part.id + '.size.' + a));
47
+ model.inputs = model.inputs.filter(i => !removed.has(i.id));
48
+ for (const id of removed)
49
+ delete asset.designInputs[id];
50
+ const shape = model.nodes.find(n => n.id === part.id + '.shape');
51
+ shape.op = recipe.op;
52
+ shape.args = [];
53
+ const existing = new Set([
54
+ ...model.inputs.map(i => i.id),
55
+ ...model.constants.map(c => c.id),
56
+ ...model.nodes.flatMap(n => [n.id, ...Object.values(n.outputs)])
57
+ ]);
58
+ for (const key of recipe.keys) {
59
+ const id = part.id + '.dimension.' + key, value = part.dimensions[key];
60
+ if (existing.has(id))
61
+ throw new V3ContractError('DUPLICATE_WRITER', id, 'input already exists');
62
+ if (!Number.isFinite(value))
63
+ throw new V3ContractError('NON_FINITE', id, 'finite dimension required');
64
+ model.inputs.push({ id, unit: 'mm', min: -Number.MAX_VALUE, max: Number.MAX_VALUE, role: 'design' });
65
+ asset.designInputs[id] = value;
66
+ shape.args.push(id);
67
+ }
68
+ if (part.kind === 'cylinder')
69
+ asset.appearance.find(a => a.target === part.id).segments = 12;
70
+ compileV3Asset(asset);
71
+ return asset;
72
+ }
73
+ /** Pure authoring operation. Expands to standard graph operators, not a second runtime geometry model. */
74
+ export function addV3Box(source, box) {
75
+ compileV3Asset(source);
76
+ if (!box || typeof box.id !== 'string' || !/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(box.id)) {
77
+ throw new V3ContractError('ID', 'box', 'letter-led part ID required');
78
+ }
79
+ const asset = structuredClone(source), model = asset.document.model, prefix = box.id;
80
+ const keys = [
81
+ 'size.x',
82
+ 'size.y',
83
+ 'size.z',
84
+ 'position.x',
85
+ 'position.y',
86
+ 'position.z',
87
+ 'rotation.x',
88
+ 'rotation.y',
89
+ 'rotation.z'
90
+ ];
91
+ const reserved = new Set([
92
+ prefix,
93
+ `${prefix}.shape`,
94
+ `${prefix}.shapeValue`,
95
+ `${prefix}.pose`,
96
+ `${prefix}.poseValue`,
97
+ `${prefix}.placed`,
98
+ ...keys.map(k => `${prefix}.${k}`)
99
+ ]);
100
+ const existing = [
101
+ ...model.inputs.map(i => i.id),
102
+ ...model.constants.map(c => c.id),
103
+ ...model.nodes.flatMap(n => [n.id, ...Object.values(n.outputs)])
104
+ ];
105
+ if (existing.some(id => reserved.has(id)))
106
+ throw new V3ContractError('DUPLICATE_PART', prefix, 'part IDs overlap existing graph identifiers');
107
+ const rotation = box.rotation ?? { x: 0, y: 0, z: 0 };
108
+ for (const group of ['size', 'position', 'rotation']) {
109
+ const values = group === 'rotation' ? rotation : box[group];
110
+ if (!values || Object.keys(values).length !== 3)
111
+ throw new V3ContractError('SCHEMA', prefix, `${group} requires x, y, z`);
112
+ for (const axis of ['x', 'y', 'z']) {
113
+ const value = values[axis];
114
+ if (!Number.isFinite(value) || (group === 'size' && value <= 0))
115
+ throw new V3ContractError('GEOMETRY_DOMAIN', `${prefix}.${group}.${axis}`, 'finite value and positive size required');
116
+ const id = `${prefix}.${group}.${axis}`;
117
+ // These are broad authoring limits, not a rendering safety/performance guarantee.
118
+ model.inputs.push({
119
+ id,
120
+ unit: group === 'rotation' ? 'deg' : 'mm',
121
+ min: group === 'size' ? Number.MIN_VALUE : -Number.MAX_VALUE,
122
+ max: Number.MAX_VALUE,
123
+ role: 'design'
124
+ });
125
+ asset.designInputs[id] = value;
126
+ }
127
+ }
128
+ const local = `${prefix}.local`;
129
+ model.nodes.push({
130
+ id: `${prefix}.shape`,
131
+ op: 'box-shape@1',
132
+ args: keys.slice(0, 3).map(k => `${prefix}.${k}`),
133
+ outputs: { shape: `${prefix}.shapeValue` },
134
+ params: { frame: local }
135
+ }, {
136
+ id: `${prefix}.pose`,
137
+ op: 'rigid@1',
138
+ args: keys.slice(3).map(k => `${prefix}.${k}`),
139
+ outputs: { pose: `${prefix}.poseValue` },
140
+ params: { from: local, to: asset.document.capabilities.assetFrame }
141
+ }, {
142
+ id: prefix,
143
+ op: 'place@1',
144
+ args: [`${prefix}.shapeValue`, `${prefix}.poseValue`],
145
+ outputs: { placed: `${prefix}.placed` }
146
+ });
147
+ asset.appearance.push({ target: prefix, material: structuredClone(box.material ?? { token: 'palette.primary' }) });
148
+ compileV3Asset(asset);
149
+ return asset;
150
+ }
151
+ //# sourceMappingURL=v3-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3-create.js","sourceRoot":"","sources":["../src/v3-create.ts"],"names":[],"mappings":"AAA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Ac,CAAC,KAAK,CAAC,CAAA;IACrB,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { V3Document, V3CompiledCapabilities } from './v3-asset-types.ts';
2
+ export declare function compileV3Document(source: unknown): V3CompiledCapabilities;
3
+ export declare function serializeV3Document(doc: unknown): string;
4
+ export declare function parseV3Document(text: string): V3Document;
5
+ //# sourceMappingURL=v3-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3-document.d.ts","sourceRoot":"","sources":["../src/v3-document.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAE7E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,sBAAsB,CAmBzE;AACD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAGxD;AACD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAIxD"}
@@ -0,0 +1,31 @@
1
+ import { compileV3Capabilities } from "./v3-capabilities.js";
2
+ import { V3ContractError } from "./v3-contract.js";
3
+ import { assertV3Json, parseV3Json, V3_JSON_MAX_BYTES, v3Utf8ByteLength } from "./v3-json.js";
4
+ export function compileV3Document(source) {
5
+ assertV3Json(source);
6
+ if (!source ||
7
+ Array.isArray(source) ||
8
+ typeof source !== 'object' ||
9
+ Object.keys(source).length !== 3 ||
10
+ !['version', 'model', 'capabilities'].every(k => Object.hasOwn(source, k))) {
11
+ throw new V3ContractError('SCHEMA', 'document', 'expected version, model, capabilities only');
12
+ }
13
+ if (source.version !== 'figure-v3-prototype-1')
14
+ throw new V3ContractError('VERSION', 'document', 'unsupported document version');
15
+ if (v3Utf8ByteLength(JSON.stringify(source)) > V3_JSON_MAX_BYTES)
16
+ throw new V3ContractError('DOCUMENT_LIMIT', 'document', 'over 1 MiB');
17
+ const doc = source;
18
+ if (!Array.isArray(doc.model?.nodes) || doc.model.nodes.length > 512)
19
+ throw new V3ContractError('DOCUMENT_LIMIT', 'document', 'maximum 512 nodes');
20
+ return compileV3Capabilities(doc.model, doc.capabilities);
21
+ }
22
+ export function serializeV3Document(doc) {
23
+ compileV3Document(doc);
24
+ return JSON.stringify(doc);
25
+ }
26
+ export function parseV3Document(text) {
27
+ const doc = parseV3Json(text);
28
+ compileV3Document(doc);
29
+ return doc;
30
+ }
31
+ //# sourceMappingURL=v3-document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3-document.js","sourceRoot":"","sources":["../src/v3-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAG7F,MAAM,UAAU,iBAAiB,CAAC,MAAe;IAC/C,YAAY,CAAC,MAAM,CAAC,CAAA;IACpB,IACE,CAAC,MAAM;QACP,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QACrB,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;QAChC,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAC1E,CAAC;QACD,MAAM,IAAI,eAAe,CAAC,QAAQ,EAAE,UAAU,EAAE,4CAA4C,CAAC,CAAA;IAC/F,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,KAAK,uBAAuB;QAC5C,MAAM,IAAI,eAAe,CAAC,SAAS,EAAE,UAAU,EAAE,8BAA8B,CAAC,CAAA;IAClF,IAAI,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,iBAAiB;QAC9D,MAAM,IAAI,eAAe,CAAC,gBAAgB,EAAE,UAAU,EAAE,YAAY,CAAC,CAAA;IACvE,MAAM,GAAG,GAAG,MAA+B,CAAA;IAC3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG;QAClE,MAAM,IAAI,eAAe,CAAC,gBAAgB,EAAE,UAAU,EAAE,mBAAmB,CAAC,CAAA;IAC9E,OAAO,qBAAqB,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,YAAY,CAAC,CAAA;AAC3D,CAAC;AACD,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,iBAAiB,CAAC,GAAG,CAAC,CAAA;IACtB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;AAC5B,CAAC;AACD,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;IAC7B,iBAAiB,CAAC,GAAG,CAAC,CAAA;IACtB,OAAO,GAA4B,CAAA;AACrC,CAAC"}
@@ -0,0 +1,367 @@
1
+ import type { V3EditRequest, V3EditControl } from './v3-authoring-session.ts';
2
+ import type { V3BoxCreation, V3PrimitiveCreation } from './v3-create.ts';
3
+ import type { V3PartEdit } from './v3-part-edit.ts';
4
+ export interface V3WorkspaceExport {
5
+ context: string;
6
+ revision: number;
7
+ text: string;
8
+ }
9
+ export interface V3LeaveOptions {
10
+ discardDesignChanges?: boolean;
11
+ }
12
+ /** One history for structural and input edits. No persistence or authentication is implied. */
13
+ export declare function createV3EditorWorkspace(): {
14
+ read: () => {
15
+ context: null;
16
+ name: null;
17
+ fields: never[];
18
+ geometry: never[];
19
+ bindings: never[];
20
+ dirty: boolean;
21
+ revision: null;
22
+ canUndo?: undefined;
23
+ canRedo?: undefined;
24
+ palette?: undefined;
25
+ } | {
26
+ context: string;
27
+ name: string;
28
+ revision: number;
29
+ dirty: boolean;
30
+ canUndo: boolean;
31
+ canRedo: boolean;
32
+ fields: {
33
+ value: number;
34
+ id: string;
35
+ unit: import("./v3-graph-types.ts").V3Unit;
36
+ min: number;
37
+ max: number;
38
+ role?: "design" | "state";
39
+ }[];
40
+ geometry: import("./v3-asset-types.ts").V3AssetGeometry[];
41
+ bindings: import("./v3-asset-types.ts").V3EvaluatedBinding[];
42
+ palette: Record<string, string>;
43
+ };
44
+ open(text: string, { discardDesignChanges }?: V3LeaveOptions): {
45
+ context: null;
46
+ name: null;
47
+ fields: never[];
48
+ geometry: never[];
49
+ bindings: never[];
50
+ dirty: boolean;
51
+ revision: null;
52
+ canUndo?: undefined;
53
+ canRedo?: undefined;
54
+ palette?: undefined;
55
+ } | {
56
+ context: string;
57
+ name: string;
58
+ revision: number;
59
+ dirty: boolean;
60
+ canUndo: boolean;
61
+ canRedo: boolean;
62
+ fields: {
63
+ value: number;
64
+ id: string;
65
+ unit: import("./v3-graph-types.ts").V3Unit;
66
+ min: number;
67
+ max: number;
68
+ role?: "design" | "state";
69
+ }[];
70
+ geometry: import("./v3-asset-types.ts").V3AssetGeometry[];
71
+ bindings: import("./v3-asset-types.ts").V3EvaluatedBinding[];
72
+ palette: Record<string, string>;
73
+ };
74
+ close({ discardDesignChanges }?: V3LeaveOptions): {
75
+ context: null;
76
+ name: null;
77
+ fields: never[];
78
+ geometry: never[];
79
+ bindings: never[];
80
+ dirty: boolean;
81
+ revision: null;
82
+ canUndo?: undefined;
83
+ canRedo?: undefined;
84
+ palette?: undefined;
85
+ } | {
86
+ context: string;
87
+ name: string;
88
+ revision: number;
89
+ dirty: boolean;
90
+ canUndo: boolean;
91
+ canRedo: boolean;
92
+ fields: {
93
+ value: number;
94
+ id: string;
95
+ unit: import("./v3-graph-types.ts").V3Unit;
96
+ min: number;
97
+ max: number;
98
+ role?: "design" | "state";
99
+ }[];
100
+ geometry: import("./v3-asset-types.ts").V3AssetGeometry[];
101
+ bindings: import("./v3-asset-types.ts").V3EvaluatedBinding[];
102
+ palette: Record<string, string>;
103
+ };
104
+ preview({ context, ...q }: V3EditRequest & {
105
+ context: string;
106
+ }): {
107
+ candidate: {
108
+ inputs: Record<string, number>;
109
+ evaluation: import("./v3-asset-types.ts").V3CapabilityEvaluation;
110
+ };
111
+ baseRevision: number;
112
+ origin: "ui" | "ai";
113
+ changes: {
114
+ before: number | undefined;
115
+ kind: "set-design" | "set-state";
116
+ input: string;
117
+ unit: import("./v3-graph-types.ts").V3Unit;
118
+ value: number;
119
+ }[];
120
+ effects: {
121
+ geometry: {
122
+ added: string[];
123
+ removed: string[];
124
+ changed: string[];
125
+ };
126
+ bindingsChanged: string[];
127
+ };
128
+ validation: {
129
+ status: string;
130
+ spatial: string;
131
+ collision: string;
132
+ safety: string;
133
+ };
134
+ };
135
+ apply({ context, ...q }: V3EditRequest & {
136
+ context: string;
137
+ }): {
138
+ context: null;
139
+ name: null;
140
+ fields: never[];
141
+ geometry: never[];
142
+ bindings: never[];
143
+ dirty: boolean;
144
+ revision: null;
145
+ canUndo?: undefined;
146
+ canRedo?: undefined;
147
+ palette?: undefined;
148
+ } | {
149
+ context: string;
150
+ name: string;
151
+ revision: number;
152
+ dirty: boolean;
153
+ canUndo: boolean;
154
+ canRedo: boolean;
155
+ fields: {
156
+ value: number;
157
+ id: string;
158
+ unit: import("./v3-graph-types.ts").V3Unit;
159
+ min: number;
160
+ max: number;
161
+ role?: "design" | "state";
162
+ }[];
163
+ geometry: import("./v3-asset-types.ts").V3AssetGeometry[];
164
+ bindings: import("./v3-asset-types.ts").V3EvaluatedBinding[];
165
+ palette: Record<string, string>;
166
+ };
167
+ addBox({ context, box, ...q }: V3EditControl & {
168
+ context: string;
169
+ box: V3BoxCreation;
170
+ }): {
171
+ context: null;
172
+ name: null;
173
+ fields: never[];
174
+ geometry: never[];
175
+ bindings: never[];
176
+ dirty: boolean;
177
+ revision: null;
178
+ canUndo?: undefined;
179
+ canRedo?: undefined;
180
+ palette?: undefined;
181
+ } | {
182
+ context: string;
183
+ name: string;
184
+ revision: number;
185
+ dirty: boolean;
186
+ canUndo: boolean;
187
+ canRedo: boolean;
188
+ fields: {
189
+ value: number;
190
+ id: string;
191
+ unit: import("./v3-graph-types.ts").V3Unit;
192
+ min: number;
193
+ max: number;
194
+ role?: "design" | "state";
195
+ }[];
196
+ geometry: import("./v3-asset-types.ts").V3AssetGeometry[];
197
+ bindings: import("./v3-asset-types.ts").V3EvaluatedBinding[];
198
+ palette: Record<string, string>;
199
+ };
200
+ addPrimitive({ context, part, ...q }: V3EditControl & {
201
+ context: string;
202
+ part: V3PrimitiveCreation;
203
+ }): {
204
+ context: null;
205
+ name: null;
206
+ fields: never[];
207
+ geometry: never[];
208
+ bindings: never[];
209
+ dirty: boolean;
210
+ revision: null;
211
+ canUndo?: undefined;
212
+ canRedo?: undefined;
213
+ palette?: undefined;
214
+ } | {
215
+ context: string;
216
+ name: string;
217
+ revision: number;
218
+ dirty: boolean;
219
+ canUndo: boolean;
220
+ canRedo: boolean;
221
+ fields: {
222
+ value: number;
223
+ id: string;
224
+ unit: import("./v3-graph-types.ts").V3Unit;
225
+ min: number;
226
+ max: number;
227
+ role?: "design" | "state";
228
+ }[];
229
+ geometry: import("./v3-asset-types.ts").V3AssetGeometry[];
230
+ bindings: import("./v3-asset-types.ts").V3EvaluatedBinding[];
231
+ palette: Record<string, string>;
232
+ };
233
+ editPart({ context, edit, ...q }: V3EditControl & {
234
+ context: string;
235
+ edit: V3PartEdit;
236
+ }): {
237
+ context: null;
238
+ name: null;
239
+ fields: never[];
240
+ geometry: never[];
241
+ bindings: never[];
242
+ dirty: boolean;
243
+ revision: null;
244
+ canUndo?: undefined;
245
+ canRedo?: undefined;
246
+ palette?: undefined;
247
+ } | {
248
+ context: string;
249
+ name: string;
250
+ revision: number;
251
+ dirty: boolean;
252
+ canUndo: boolean;
253
+ canRedo: boolean;
254
+ fields: {
255
+ value: number;
256
+ id: string;
257
+ unit: import("./v3-graph-types.ts").V3Unit;
258
+ min: number;
259
+ max: number;
260
+ role?: "design" | "state";
261
+ }[];
262
+ geometry: import("./v3-asset-types.ts").V3AssetGeometry[];
263
+ bindings: import("./v3-asset-types.ts").V3EvaluatedBinding[];
264
+ palette: Record<string, string>;
265
+ };
266
+ undo({ context, ...q }: V3EditControl & {
267
+ context: string;
268
+ }): {
269
+ context: null;
270
+ name: null;
271
+ fields: never[];
272
+ geometry: never[];
273
+ bindings: never[];
274
+ dirty: boolean;
275
+ revision: null;
276
+ canUndo?: undefined;
277
+ canRedo?: undefined;
278
+ palette?: undefined;
279
+ } | {
280
+ context: string;
281
+ name: string;
282
+ revision: number;
283
+ dirty: boolean;
284
+ canUndo: boolean;
285
+ canRedo: boolean;
286
+ fields: {
287
+ value: number;
288
+ id: string;
289
+ unit: import("./v3-graph-types.ts").V3Unit;
290
+ min: number;
291
+ max: number;
292
+ role?: "design" | "state";
293
+ }[];
294
+ geometry: import("./v3-asset-types.ts").V3AssetGeometry[];
295
+ bindings: import("./v3-asset-types.ts").V3EvaluatedBinding[];
296
+ palette: Record<string, string>;
297
+ };
298
+ redo({ context, ...q }: V3EditControl & {
299
+ context: string;
300
+ }): {
301
+ context: null;
302
+ name: null;
303
+ fields: never[];
304
+ geometry: never[];
305
+ bindings: never[];
306
+ dirty: boolean;
307
+ revision: null;
308
+ canUndo?: undefined;
309
+ canRedo?: undefined;
310
+ palette?: undefined;
311
+ } | {
312
+ context: string;
313
+ name: string;
314
+ revision: number;
315
+ dirty: boolean;
316
+ canUndo: boolean;
317
+ canRedo: boolean;
318
+ fields: {
319
+ value: number;
320
+ id: string;
321
+ unit: import("./v3-graph-types.ts").V3Unit;
322
+ min: number;
323
+ max: number;
324
+ role?: "design" | "state";
325
+ }[];
326
+ geometry: import("./v3-asset-types.ts").V3AssetGeometry[];
327
+ bindings: import("./v3-asset-types.ts").V3EvaluatedBinding[];
328
+ palette: Record<string, string>;
329
+ };
330
+ export({ context, captureStateDefaults }: {
331
+ context: string;
332
+ captureStateDefaults?: boolean;
333
+ }): V3WorkspaceExport;
334
+ acknowledgeSaved({ context, revision, text }: V3WorkspaceExport): {
335
+ context: null;
336
+ name: null;
337
+ fields: never[];
338
+ geometry: never[];
339
+ bindings: never[];
340
+ dirty: boolean;
341
+ revision: null;
342
+ canUndo?: undefined;
343
+ canRedo?: undefined;
344
+ palette?: undefined;
345
+ } | {
346
+ context: string;
347
+ name: string;
348
+ revision: number;
349
+ dirty: boolean;
350
+ canUndo: boolean;
351
+ canRedo: boolean;
352
+ fields: {
353
+ value: number;
354
+ id: string;
355
+ unit: import("./v3-graph-types.ts").V3Unit;
356
+ min: number;
357
+ max: number;
358
+ role?: "design" | "state";
359
+ }[];
360
+ geometry: import("./v3-asset-types.ts").V3AssetGeometry[];
361
+ bindings: import("./v3-asset-types.ts").V3EvaluatedBinding[];
362
+ palette: Record<string, string>;
363
+ };
364
+ };
365
+ export type V3EditorWorkspace = ReturnType<typeof createV3EditorWorkspace>;
366
+ export type V3WorkspaceView = ReturnType<V3EditorWorkspace['read']>;
367
+ //# sourceMappingURL=v3-editor-workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3-editor-workspace.d.ts","sourceRoot":"","sources":["../src/v3-editor-workspace.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE7E,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAExE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb;AACD,MAAM,WAAW,cAAc;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAeD,+FAA+F;A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