@mylasertools/kerfscript 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +167 -1
  2. package/LANGUAGE.md +160 -30
  3. package/README.md +8 -2
  4. package/THIRD-PARTY-NOTICES.md +113 -0
  5. package/dist/analysis.d.cts +20 -0
  6. package/dist/analysis.d.ts +20 -0
  7. package/dist/assembly.d.cts +28 -1
  8. package/dist/assembly.d.ts +28 -1
  9. package/dist/ast.d.cts +9 -0
  10. package/dist/ast.d.ts +9 -0
  11. package/dist/cli.js +10165 -4669
  12. package/dist/diff.d.cts +18 -0
  13. package/dist/diff.d.ts +18 -0
  14. package/dist/evaluator.d.cts +34 -0
  15. package/dist/evaluator.d.ts +34 -0
  16. package/dist/functions.d.cts +1 -0
  17. package/dist/functions.d.ts +1 -0
  18. package/dist/geometry.d.cts +17 -0
  19. package/dist/geometry.d.ts +17 -0
  20. package/dist/hardware.d.cts +13 -0
  21. package/dist/hardware.d.ts +13 -0
  22. package/dist/highlight.cjs +2 -2
  23. package/dist/highlight.js +2 -2
  24. package/dist/index.cjs +1941 -52
  25. package/dist/index.d.cts +11 -2
  26. package/dist/index.d.ts +11 -2
  27. package/dist/index.js +1941 -52
  28. package/dist/instructions.d.cts +3 -0
  29. package/dist/instructions.d.ts +3 -0
  30. package/dist/language.cjs +1899 -51
  31. package/dist/language.js +1899 -51
  32. package/dist/libraries.cjs +1874 -26
  33. package/dist/libraries.d.cts +3 -0
  34. package/dist/libraries.d.ts +3 -0
  35. package/dist/libraries.js +1874 -26
  36. package/dist/png.d.cts +9 -0
  37. package/dist/png.d.ts +9 -0
  38. package/dist/render.d.cts +22 -1
  39. package/dist/render.d.ts +22 -1
  40. package/dist/signatures.cjs +244 -11
  41. package/dist/signatures.js +244 -11
  42. package/dist/slots.d.cts +8 -0
  43. package/dist/slots.d.ts +8 -0
  44. package/dist/values.d.cts +6 -1
  45. package/dist/values.d.ts +6 -1
  46. package/dist/verify/command.d.cts +1 -0
  47. package/dist/verify/command.d.ts +1 -0
  48. package/dist/verify/geometry.d.cts +25 -0
  49. package/dist/verify/geometry.d.ts +25 -0
  50. package/dist/verify/index.d.cts +10 -0
  51. package/dist/verify/index.d.ts +10 -0
  52. package/dist/verify/joints.d.cts +7 -0
  53. package/dist/verify/joints.d.ts +7 -0
  54. package/dist/verify/mechanics.d.cts +11 -0
  55. package/dist/verify/mechanics.d.ts +11 -0
  56. package/dist/verify/motion.d.cts +8 -0
  57. package/dist/verify/motion.d.ts +8 -0
  58. package/dist/verify/pose.d.cts +5 -0
  59. package/dist/verify/pose.d.ts +5 -0
  60. package/dist/verify/relations.d.cts +8 -0
  61. package/dist/verify/relations.d.ts +8 -0
  62. package/dist/verify/snapshot.d.cts +11 -0
  63. package/dist/verify/snapshot.d.ts +11 -0
  64. package/dist/verify/solids.d.cts +39 -0
  65. package/dist/verify/solids.d.ts +39 -0
  66. package/dist/verify/spec.d.cts +9 -0
  67. package/dist/verify/spec.d.ts +9 -0
  68. package/dist/verify/summary.d.cts +17 -0
  69. package/dist/verify/summary.d.ts +17 -0
  70. package/dist/verify/types.d.cts +299 -0
  71. package/dist/verify/types.d.ts +299 -0
  72. package/docs/cli.md +87 -15
  73. package/docs/javascript.md +57 -25
  74. package/docs/layers.md +42 -2
  75. package/docs/library.md +299 -3
  76. package/docs/parts-and-sheets.md +186 -1
  77. package/docs/shared-libraries.md +8 -1
  78. package/docs/specification.md +78 -23
  79. package/docs/verification.md +363 -0
  80. package/docs/versions.md +2 -2
  81. package/package.json +2 -1
  82. package/dist/import/dbg.d.cts +0 -1
  83. package/dist/import/dbg.d.ts +0 -1
@@ -0,0 +1,39 @@
1
+ import { type Vec3 } from '../assembly.js';
2
+ import type { BodyRef, Trajectory, VerificationSnapshot } from './types.js';
3
+ export declare class WorkBudget {
4
+ remaining: number;
5
+ constructor(remaining?: number);
6
+ tick(n?: number): void;
7
+ }
8
+ export declare const key: (r: BodyRef) => string;
9
+ export declare const cross: (a: Vec3, b: Vec3) => Vec3;
10
+ export declare const scale: (v: Vec3, s: number) => Vec3;
11
+ export declare const add: (a: Vec3, b: Vec3) => Vec3;
12
+ export declare const unit: (v: Vec3) => Vec3;
13
+ export declare const identity: () => number[];
14
+ export declare function sameTrajectory(a: Trajectory, b: Trajectory): boolean;
15
+ export interface Cell {
16
+ vertices: Vec3[];
17
+ faces: number[][];
18
+ edges: [number, number][];
19
+ }
20
+ export interface Solid {
21
+ ref: BodyRef;
22
+ outer: Cell[];
23
+ inner: Cell[];
24
+ }
25
+ export declare function allBodies(s: VerificationSnapshot): BodyRef[];
26
+ export declare function bodyMatrix(s: VerificationSnapshot, r: BodyRef): number[];
27
+ export declare function makeSolid(s: VerificationSnapshot, ref: BodyRef, budget: WorkBudget): Solid;
28
+ export declare function transformSolid(s: Solid, m: number[]): Solid;
29
+ export declare function trajectoryMatrix(t: Trajectory, u: number): number[];
30
+ export declare function speedBound(s: Solid, t: Trajectory): number;
31
+ export declare function distanceBounds(a: Solid, b: Solid, budget: WorkBudget, threshold: number): {
32
+ lower: number;
33
+ upper: number;
34
+ penetration: boolean;
35
+ touchSafe: boolean;
36
+ };
37
+ /** For pure translations, every projection interval is affine. A single
38
+ * separating axis valid at both endpoints certifies the whole interval. */
39
+ export declare function linearSeparated(a0: Solid, a1: Solid, b0: Solid, b1: Solid, gap: number, budget: WorkBudget): boolean;
@@ -0,0 +1,9 @@
1
+ import type { VerificationIssue, VerificationSnapshot, VerificationSpec } from './types.cjs';
2
+ export declare function validateSpec(input: unknown): VerificationIssue[];
3
+ export declare function validateSnapshots(inputs: unknown): VerificationIssue[];
4
+ export declare function refs(spec: VerificationSpec): {
5
+ claim: string;
6
+ ref: import('./types.cjs').BodyRef;
7
+ }[];
8
+ export declare const findPart: (s: VerificationSnapshot, r: import("./types.js").PartRef) => import("./types.js").SnapshotPart;
9
+ export declare const findHardware: (s: VerificationSnapshot, r: import("./types.js").HardwareRef) => import("./types.js").SnapshotHardware;
@@ -0,0 +1,9 @@
1
+ import type { VerificationIssue, VerificationSnapshot, VerificationSpec } from './types.js';
2
+ export declare function validateSpec(input: unknown): VerificationIssue[];
3
+ export declare function validateSnapshots(inputs: unknown): VerificationIssue[];
4
+ export declare function refs(spec: VerificationSpec): {
5
+ claim: string;
6
+ ref: import('./types.js').BodyRef;
7
+ }[];
8
+ export declare const findPart: (s: VerificationSnapshot, r: import("./types.js").PartRef) => import("./types.js").SnapshotPart;
9
+ export declare const findHardware: (s: VerificationSnapshot, r: import("./types.js").HardwareRef) => import("./types.js").SnapshotHardware;
@@ -0,0 +1,17 @@
1
+ import type { ClaimResult, VerificationResult } from './types.cjs';
2
+ export interface TriageGroup {
3
+ status: string;
4
+ code: string;
5
+ message: string;
6
+ claims: {
7
+ id: string;
8
+ configurations: string[];
9
+ bodies: string[];
10
+ measurements: ClaimResult['measurements'];
11
+ }[];
12
+ }
13
+ /** Every claim that did not pass, grouped by status and code: failures
14
+ * first, then unverified. */
15
+ export declare function triage(result: VerificationResult): TriageGroup[];
16
+ /** The triage as lines of text */
17
+ export declare function triageText(result: VerificationResult): string;
@@ -0,0 +1,17 @@
1
+ import type { ClaimResult, VerificationResult } from './types.js';
2
+ export interface TriageGroup {
3
+ status: string;
4
+ code: string;
5
+ message: string;
6
+ claims: {
7
+ id: string;
8
+ configurations: string[];
9
+ bodies: string[];
10
+ measurements: ClaimResult['measurements'];
11
+ }[];
12
+ }
13
+ /** Every claim that did not pass, grouped by status and code: failures
14
+ * first, then unverified. */
15
+ export declare function triage(result: VerificationResult): TriageGroup[];
16
+ /** The triage as lines of text */
17
+ export declare function triageText(result: VerificationResult): string;
@@ -0,0 +1,299 @@
1
+ import type { Vec3 } from '../assembly.cjs';
2
+ import type { Bend, Poly } from '../geometry.cjs';
3
+ import type { Value } from '../values.cjs';
4
+ export type VerificationStatus = 'pass' | 'fail' | 'unverified';
5
+ export interface PartRef {
6
+ part: string;
7
+ copy?: number;
8
+ }
9
+ export interface HardwareRef {
10
+ hardware: string;
11
+ }
12
+ export type BodyRef = PartRef | HardwareRef;
13
+ export type Interval = [number, number];
14
+ /** Actual finished dimensions of one stock lot. They do not regenerate the cuts. */
15
+ export interface MaterialProfile {
16
+ thickness: Interval;
17
+ kerf: Interval;
18
+ edgeError?: number;
19
+ lot?: string;
20
+ }
21
+ export interface VerificationProvenance {
22
+ sourceHash: string;
23
+ engineHash: string;
24
+ dependencies: Record<string, string>;
25
+ fonts: Record<string, string>;
26
+ }
27
+ export interface SnapshotPart {
28
+ name: string;
29
+ copy: number;
30
+ thickness: number;
31
+ material: string;
32
+ kerf: number | null;
33
+ matrix: number[];
34
+ placed: boolean;
35
+ regions: Poly[];
36
+ /** null means unavailable; [] means known to have no open cutting lines. */
37
+ cutLines: Poly[] | null;
38
+ bends: Bend[];
39
+ stack?: number;
40
+ glue?: PartRef;
41
+ glueFace?: 'top' | 'bottom';
42
+ on?: string;
43
+ }
44
+ export interface SnapshotHardware {
45
+ label: string | null;
46
+ kind: string;
47
+ from: Vec3;
48
+ to: Vec3;
49
+ size: number | [number, number];
50
+ up: Vec3;
51
+ }
52
+ export interface VerificationSnapshot {
53
+ schemaVersion: 1;
54
+ configuration: string;
55
+ params: Record<string, Value>;
56
+ renderSettings: Record<string, Value>;
57
+ provenance: VerificationProvenance | null;
58
+ parts: SnapshotPart[];
59
+ hardware: SnapshotHardware[];
60
+ warnings: string[];
61
+ legacyHardware: boolean;
62
+ relationsKnown: boolean;
63
+ error?: string;
64
+ }
65
+ interface ClaimBase {
66
+ id: string;
67
+ required?: boolean;
68
+ configurations?: string[];
69
+ }
70
+ export interface GlueContactClaim extends ClaimBase {
71
+ kind: 'glue-contact';
72
+ a: PartRef;
73
+ b: PartRef;
74
+ faceA: 'top' | 'bottom';
75
+ faceB: 'top' | 'bottom';
76
+ minimumArea: number;
77
+ }
78
+ export interface TabSlotClaim extends ClaimBase {
79
+ kind: 'tab-slot';
80
+ tab: PartRef;
81
+ receiver: PartRef;
82
+ /** Rectangle in the tab's local coordinates selecting its tongue. */
83
+ region: [number, number, number, number];
84
+ clearance: Interval;
85
+ /** Require through engagement, allowing this much shortfall. */
86
+ flushTolerance: number;
87
+ minimumLigament: number;
88
+ }
89
+ export interface ShaftStop {
90
+ body: HardwareRef;
91
+ attachment: {
92
+ kind: 'integral';
93
+ } | {
94
+ kind: 'threaded';
95
+ thread: HardwareRef;
96
+ minimumEngagement: number;
97
+ secured: boolean;
98
+ } | {
99
+ kind: 'unknown';
100
+ };
101
+ }
102
+ export interface CapturedShaftClaim extends ClaimBase {
103
+ kind: 'captured-shaft';
104
+ shaft: HardwareRef;
105
+ bearings: [PartRef, PartRef];
106
+ /** Parts between the two bearing faces, including spacers and rotors. */
107
+ stack: PartRef[];
108
+ stops: [ShaftStop, ShaftStop];
109
+ clearance: Interval;
110
+ endplay: Interval;
111
+ minimumOverlap: number;
112
+ maximumStopGap: number;
113
+ }
114
+ export interface InvariantClaim extends ClaimBase {
115
+ kind: 'cut-invariant';
116
+ }
117
+ export interface MaterialClaim extends ClaimBase {
118
+ kind: 'material-assignment';
119
+ }
120
+ export type Trajectory = {
121
+ kind: 'translate';
122
+ by: Vec3;
123
+ } | {
124
+ kind: 'rotate';
125
+ origin: Vec3;
126
+ axis: Vec3;
127
+ angle: number;
128
+ };
129
+ export interface MotionClaim extends ClaimBase {
130
+ kind: 'motion-clearance';
131
+ from: string;
132
+ to: string;
133
+ moving: {
134
+ body: BodyRef;
135
+ trajectory: Trajectory;
136
+ }[];
137
+ minimumGap: number;
138
+ maxIntervals?: number;
139
+ constraints?: string;
140
+ }
141
+ export interface ClearanceClaim extends ClaimBase {
142
+ kind: 'rigid-clearance';
143
+ minimumGap: number;
144
+ /** Defaults to all physical inventory. No whole-pair collision exemptions. */
145
+ bodies?: BodyRef[];
146
+ }
147
+ export interface AssemblyClaim extends ClaimBase {
148
+ kind: 'assembly-access';
149
+ initial: BodyRef[];
150
+ scope?: BodyRef[];
151
+ steps: {
152
+ id: string;
153
+ part: BodyRef;
154
+ /** Starting displacement from the final installed pose. */
155
+ from: Vec3;
156
+ held: boolean;
157
+ fasten?: string[];
158
+ tool?: {
159
+ from: Vec3;
160
+ to: Vec3;
161
+ diameter: number;
162
+ travel: Vec3;
163
+ };
164
+ }[];
165
+ minimumGap: number;
166
+ maxIntervals?: number;
167
+ }
168
+ export interface RetentionClaim extends ClaimBase {
169
+ kind: 'retention';
170
+ roots: BodyRef[];
171
+ /** Each link references a measured geometric contract, with its fastening assumption. */
172
+ links: {
173
+ claim: string;
174
+ fastening: 'glued' | 'locked' | 'captured';
175
+ installed: boolean;
176
+ }[];
177
+ removable?: BodyRef[];
178
+ }
179
+ export type JointRelation = {
180
+ kind: 'fixed';
181
+ a: BodyRef;
182
+ b: BodyRef;
183
+ } | {
184
+ kind: 'revolute';
185
+ a: BodyRef;
186
+ b: BodyRef;
187
+ anchorA: Vec3;
188
+ anchorB: Vec3;
189
+ axisA: Vec3;
190
+ axisB: Vec3;
191
+ range?: Interval;
192
+ } | {
193
+ kind: 'prismatic';
194
+ a: BodyRef;
195
+ b: BodyRef;
196
+ axisA: Vec3;
197
+ travel: Interval;
198
+ } | {
199
+ kind: 'gear';
200
+ a: BodyRef;
201
+ b: BodyRef;
202
+ axisA: Vec3;
203
+ axisB: Vec3;
204
+ ratio: number;
205
+ };
206
+ export interface JointClaim extends ClaimBase {
207
+ kind: 'joint-constraints';
208
+ bodies: BodyRef[];
209
+ roots: BodyRef[];
210
+ joints: JointRelation[];
211
+ expectedDof: number;
212
+ }
213
+ export interface StabilityClaim extends ClaimBase {
214
+ kind: 'stability';
215
+ supports: BodyRef[];
216
+ loads: {
217
+ body: BodyRef;
218
+ mass: number;
219
+ center?: Vec3;
220
+ }[];
221
+ ground: number;
222
+ gravity: Vec3;
223
+ minimumMargin: number;
224
+ retention?: string;
225
+ }
226
+ export interface AssemblySupportClaim extends ClaimBase {
227
+ kind: 'assembly-support';
228
+ plan: string;
229
+ retention: string;
230
+ holds?: {
231
+ step: string;
232
+ bodies: BodyRef[];
233
+ }[];
234
+ }
235
+ export interface UnsupportedClaim extends ClaimBase {
236
+ kind: 'strength';
237
+ }
238
+ export type VerificationClaim = GlueContactClaim | TabSlotClaim | CapturedShaftClaim | InvariantClaim | MaterialClaim | MotionClaim | ClearanceClaim | AssemblyClaim | RetentionClaim | JointClaim | StabilityClaim | AssemblySupportClaim | UnsupportedClaim;
239
+ export interface VerificationSpec {
240
+ schemaVersion: 1;
241
+ model: string;
242
+ configurations: {
243
+ id: string;
244
+ params?: Record<string, Value>;
245
+ materials?: Record<string, MaterialProfile>;
246
+ }[];
247
+ materials?: Record<string, MaterialProfile>;
248
+ claims: VerificationClaim[];
249
+ }
250
+ export interface VerificationIssue {
251
+ code: string;
252
+ message: string;
253
+ path?: string;
254
+ }
255
+ export interface ClaimResult {
256
+ id: string;
257
+ kind: string;
258
+ required: boolean;
259
+ status: VerificationStatus;
260
+ configurations: string[];
261
+ assemblyStep?: string;
262
+ code: string;
263
+ message: string;
264
+ entities: BodyRef[];
265
+ measurements: Record<string, number | Interval>;
266
+ assumptions: string[];
267
+ coverage: 'nominal' | 'bounded-fit' | 'discrete' | 'continuous-nominal' | 'none';
268
+ }
269
+ export interface VerificationReport {
270
+ schemaVersion: 1;
271
+ model: string;
272
+ status: VerificationStatus;
273
+ algorithm: 'kerf-rigid-v1';
274
+ /** Linear predicates within this band are unresolved rather than rounded to pass. */
275
+ numericalTolerance: number;
276
+ specification: VerificationSpec;
277
+ claims: ClaimResult[];
278
+ inputs: {
279
+ configuration: string;
280
+ params: Record<string, Value>;
281
+ renderSettings: Record<string, Value>;
282
+ provenance: VerificationProvenance | null;
283
+ }[];
284
+ uncovered: string[];
285
+ }
286
+ export type VerificationResult = {
287
+ kind: 'invalid-spec' | 'invalid-snapshot';
288
+ issues: VerificationIssue[];
289
+ } | {
290
+ kind: 'report';
291
+ report: VerificationReport;
292
+ };
293
+ export interface VerifyLimits {
294
+ maxPoints?: number;
295
+ maxClaims?: number;
296
+ maxConfigurations?: number;
297
+ maxOperations?: number;
298
+ }
299
+ export {};
@@ -0,0 +1,299 @@
1
+ import type { Vec3 } from '../assembly.js';
2
+ import type { Bend, Poly } from '../geometry.js';
3
+ import type { Value } from '../values.js';
4
+ export type VerificationStatus = 'pass' | 'fail' | 'unverified';
5
+ export interface PartRef {
6
+ part: string;
7
+ copy?: number;
8
+ }
9
+ export interface HardwareRef {
10
+ hardware: string;
11
+ }
12
+ export type BodyRef = PartRef | HardwareRef;
13
+ export type Interval = [number, number];
14
+ /** Actual finished dimensions of one stock lot. They do not regenerate the cuts. */
15
+ export interface MaterialProfile {
16
+ thickness: Interval;
17
+ kerf: Interval;
18
+ edgeError?: number;
19
+ lot?: string;
20
+ }
21
+ export interface VerificationProvenance {
22
+ sourceHash: string;
23
+ engineHash: string;
24
+ dependencies: Record<string, string>;
25
+ fonts: Record<string, string>;
26
+ }
27
+ export interface SnapshotPart {
28
+ name: string;
29
+ copy: number;
30
+ thickness: number;
31
+ material: string;
32
+ kerf: number | null;
33
+ matrix: number[];
34
+ placed: boolean;
35
+ regions: Poly[];
36
+ /** null means unavailable; [] means known to have no open cutting lines. */
37
+ cutLines: Poly[] | null;
38
+ bends: Bend[];
39
+ stack?: number;
40
+ glue?: PartRef;
41
+ glueFace?: 'top' | 'bottom';
42
+ on?: string;
43
+ }
44
+ export interface SnapshotHardware {
45
+ label: string | null;
46
+ kind: string;
47
+ from: Vec3;
48
+ to: Vec3;
49
+ size: number | [number, number];
50
+ up: Vec3;
51
+ }
52
+ export interface VerificationSnapshot {
53
+ schemaVersion: 1;
54
+ configuration: string;
55
+ params: Record<string, Value>;
56
+ renderSettings: Record<string, Value>;
57
+ provenance: VerificationProvenance | null;
58
+ parts: SnapshotPart[];
59
+ hardware: SnapshotHardware[];
60
+ warnings: string[];
61
+ legacyHardware: boolean;
62
+ relationsKnown: boolean;
63
+ error?: string;
64
+ }
65
+ interface ClaimBase {
66
+ id: string;
67
+ required?: boolean;
68
+ configurations?: string[];
69
+ }
70
+ export interface GlueContactClaim extends ClaimBase {
71
+ kind: 'glue-contact';
72
+ a: PartRef;
73
+ b: PartRef;
74
+ faceA: 'top' | 'bottom';
75
+ faceB: 'top' | 'bottom';
76
+ minimumArea: number;
77
+ }
78
+ export interface TabSlotClaim extends ClaimBase {
79
+ kind: 'tab-slot';
80
+ tab: PartRef;
81
+ receiver: PartRef;
82
+ /** Rectangle in the tab's local coordinates selecting its tongue. */
83
+ region: [number, number, number, number];
84
+ clearance: Interval;
85
+ /** Require through engagement, allowing this much shortfall. */
86
+ flushTolerance: number;
87
+ minimumLigament: number;
88
+ }
89
+ export interface ShaftStop {
90
+ body: HardwareRef;
91
+ attachment: {
92
+ kind: 'integral';
93
+ } | {
94
+ kind: 'threaded';
95
+ thread: HardwareRef;
96
+ minimumEngagement: number;
97
+ secured: boolean;
98
+ } | {
99
+ kind: 'unknown';
100
+ };
101
+ }
102
+ export interface CapturedShaftClaim extends ClaimBase {
103
+ kind: 'captured-shaft';
104
+ shaft: HardwareRef;
105
+ bearings: [PartRef, PartRef];
106
+ /** Parts between the two bearing faces, including spacers and rotors. */
107
+ stack: PartRef[];
108
+ stops: [ShaftStop, ShaftStop];
109
+ clearance: Interval;
110
+ endplay: Interval;
111
+ minimumOverlap: number;
112
+ maximumStopGap: number;
113
+ }
114
+ export interface InvariantClaim extends ClaimBase {
115
+ kind: 'cut-invariant';
116
+ }
117
+ export interface MaterialClaim extends ClaimBase {
118
+ kind: 'material-assignment';
119
+ }
120
+ export type Trajectory = {
121
+ kind: 'translate';
122
+ by: Vec3;
123
+ } | {
124
+ kind: 'rotate';
125
+ origin: Vec3;
126
+ axis: Vec3;
127
+ angle: number;
128
+ };
129
+ export interface MotionClaim extends ClaimBase {
130
+ kind: 'motion-clearance';
131
+ from: string;
132
+ to: string;
133
+ moving: {
134
+ body: BodyRef;
135
+ trajectory: Trajectory;
136
+ }[];
137
+ minimumGap: number;
138
+ maxIntervals?: number;
139
+ constraints?: string;
140
+ }
141
+ export interface ClearanceClaim extends ClaimBase {
142
+ kind: 'rigid-clearance';
143
+ minimumGap: number;
144
+ /** Defaults to all physical inventory. No whole-pair collision exemptions. */
145
+ bodies?: BodyRef[];
146
+ }
147
+ export interface AssemblyClaim extends ClaimBase {
148
+ kind: 'assembly-access';
149
+ initial: BodyRef[];
150
+ scope?: BodyRef[];
151
+ steps: {
152
+ id: string;
153
+ part: BodyRef;
154
+ /** Starting displacement from the final installed pose. */
155
+ from: Vec3;
156
+ held: boolean;
157
+ fasten?: string[];
158
+ tool?: {
159
+ from: Vec3;
160
+ to: Vec3;
161
+ diameter: number;
162
+ travel: Vec3;
163
+ };
164
+ }[];
165
+ minimumGap: number;
166
+ maxIntervals?: number;
167
+ }
168
+ export interface RetentionClaim extends ClaimBase {
169
+ kind: 'retention';
170
+ roots: BodyRef[];
171
+ /** Each link references a measured geometric contract, with its fastening assumption. */
172
+ links: {
173
+ claim: string;
174
+ fastening: 'glued' | 'locked' | 'captured';
175
+ installed: boolean;
176
+ }[];
177
+ removable?: BodyRef[];
178
+ }
179
+ export type JointRelation = {
180
+ kind: 'fixed';
181
+ a: BodyRef;
182
+ b: BodyRef;
183
+ } | {
184
+ kind: 'revolute';
185
+ a: BodyRef;
186
+ b: BodyRef;
187
+ anchorA: Vec3;
188
+ anchorB: Vec3;
189
+ axisA: Vec3;
190
+ axisB: Vec3;
191
+ range?: Interval;
192
+ } | {
193
+ kind: 'prismatic';
194
+ a: BodyRef;
195
+ b: BodyRef;
196
+ axisA: Vec3;
197
+ travel: Interval;
198
+ } | {
199
+ kind: 'gear';
200
+ a: BodyRef;
201
+ b: BodyRef;
202
+ axisA: Vec3;
203
+ axisB: Vec3;
204
+ ratio: number;
205
+ };
206
+ export interface JointClaim extends ClaimBase {
207
+ kind: 'joint-constraints';
208
+ bodies: BodyRef[];
209
+ roots: BodyRef[];
210
+ joints: JointRelation[];
211
+ expectedDof: number;
212
+ }
213
+ export interface StabilityClaim extends ClaimBase {
214
+ kind: 'stability';
215
+ supports: BodyRef[];
216
+ loads: {
217
+ body: BodyRef;
218
+ mass: number;
219
+ center?: Vec3;
220
+ }[];
221
+ ground: number;
222
+ gravity: Vec3;
223
+ minimumMargin: number;
224
+ retention?: string;
225
+ }
226
+ export interface AssemblySupportClaim extends ClaimBase {
227
+ kind: 'assembly-support';
228
+ plan: string;
229
+ retention: string;
230
+ holds?: {
231
+ step: string;
232
+ bodies: BodyRef[];
233
+ }[];
234
+ }
235
+ export interface UnsupportedClaim extends ClaimBase {
236
+ kind: 'strength';
237
+ }
238
+ export type VerificationClaim = GlueContactClaim | TabSlotClaim | CapturedShaftClaim | InvariantClaim | MaterialClaim | MotionClaim | ClearanceClaim | AssemblyClaim | RetentionClaim | JointClaim | StabilityClaim | AssemblySupportClaim | UnsupportedClaim;
239
+ export interface VerificationSpec {
240
+ schemaVersion: 1;
241
+ model: string;
242
+ configurations: {
243
+ id: string;
244
+ params?: Record<string, Value>;
245
+ materials?: Record<string, MaterialProfile>;
246
+ }[];
247
+ materials?: Record<string, MaterialProfile>;
248
+ claims: VerificationClaim[];
249
+ }
250
+ export interface VerificationIssue {
251
+ code: string;
252
+ message: string;
253
+ path?: string;
254
+ }
255
+ export interface ClaimResult {
256
+ id: string;
257
+ kind: string;
258
+ required: boolean;
259
+ status: VerificationStatus;
260
+ configurations: string[];
261
+ assemblyStep?: string;
262
+ code: string;
263
+ message: string;
264
+ entities: BodyRef[];
265
+ measurements: Record<string, number | Interval>;
266
+ assumptions: string[];
267
+ coverage: 'nominal' | 'bounded-fit' | 'discrete' | 'continuous-nominal' | 'none';
268
+ }
269
+ export interface VerificationReport {
270
+ schemaVersion: 1;
271
+ model: string;
272
+ status: VerificationStatus;
273
+ algorithm: 'kerf-rigid-v1';
274
+ /** Linear predicates within this band are unresolved rather than rounded to pass. */
275
+ numericalTolerance: number;
276
+ specification: VerificationSpec;
277
+ claims: ClaimResult[];
278
+ inputs: {
279
+ configuration: string;
280
+ params: Record<string, Value>;
281
+ renderSettings: Record<string, Value>;
282
+ provenance: VerificationProvenance | null;
283
+ }[];
284
+ uncovered: string[];
285
+ }
286
+ export type VerificationResult = {
287
+ kind: 'invalid-spec' | 'invalid-snapshot';
288
+ issues: VerificationIssue[];
289
+ } | {
290
+ kind: 'report';
291
+ report: VerificationReport;
292
+ };
293
+ export interface VerifyLimits {
294
+ maxPoints?: number;
295
+ maxClaims?: number;
296
+ maxConfigurations?: number;
297
+ maxOperations?: number;
298
+ }
299
+ export {};