@coloopx/colocad 0.1.0-alpha.6 → 0.1.0-alpha.7
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 +44 -0
- package/README.md +9 -3
- package/README.zh-CN.md +8 -3
- package/bin/colocad.mjs +17 -9
- package/docs/README.md +7 -2
- package/docs/README.zh-CN.md +9 -2
- package/docs/agent-modeling-handbook.md +1 -1
- package/docs/agent-modeling-handbook.zh-CN.md +2 -2
- package/docs/api.md +9 -6
- package/docs/engineering-queries.md +122 -0
- package/docs/engineering-queries.zh-CN.md +74 -0
- package/docs/getting-started.md +1 -1
- package/docs/integrations/claude-code.md +1 -1
- package/docs/integrations/codex.md +1 -1
- package/docs/integrations/pi.md +17 -4
- package/docs/integrations/verification.md +7 -1
- package/examples/integrations/README.md +11 -2
- package/examples/integrations/compact-tools.mjs +1 -1
- package/kernel/dist/client.d.ts +5 -2
- package/kernel/dist/client.js +35 -7
- package/kernel/dist/generated.d.ts +297 -4
- package/kernel/dist/process.d.ts +1 -1
- package/kernel/dist/process.js +3 -3
- package/kernel/dist/query-generated.d.ts +181 -0
- package/kernel/dist/query-generated.js +1 -0
- package/kernel/dist/tools.d.ts +35 -0
- package/kernel/dist/tools.js +11 -2
- package/kernel/dist/types.d.ts +9 -0
- package/kernel/native/darwin-arm64/agent-cad +2 -2
- package/kernel/native/darwin-arm64/manifest.json +2 -2
- package/kernel/native/linux-arm64/agent-cad +2 -2
- package/kernel/native/linux-arm64/manifest.json +2 -2
- package/kernel/native/linux-x64/agent-cad +2 -2
- package/kernel/native/linux-x64/manifest.json +2 -2
- package/kernel/release.json +4 -4
- package/kernel/schemas/model.schema.json +1752 -135
- package/kernel/schemas/query.schema.json +1150 -0
- package/package.json +5 -2
- package/skills/colocad/references/tool-contracts.md +14 -2
- package/src/build.mjs +3 -2
- package/src/index.d.mts +2 -1
- package/src/session.d.mts +5 -3
- package/src/session.mjs +26 -10
- package/viewer/dist/index.js +179 -179
- package/viewer/dist/standalone.js +179 -179
- package/viewer/index.d.ts +2 -1
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
export type Arithmetic = "add" | "sub" | "mul" | "div";
|
|
2
2
|
export type AssemblyCheck = ({
|
|
3
|
+
"a": Attachment2;
|
|
4
|
+
"b": Attachment2;
|
|
5
|
+
"correspondence": Correspondence;
|
|
6
|
+
"kind": "interface_compatibility";
|
|
7
|
+
"plane_relation": PlaneRelation;
|
|
8
|
+
"requirements": InterfaceFitRequirements;
|
|
9
|
+
"tolerance": Tolerance;
|
|
10
|
+
}) | ({
|
|
11
|
+
"a": RelationshipTarget;
|
|
12
|
+
"allowed_contacts"?: Array<ContactPair>;
|
|
13
|
+
"b": RelationshipTarget;
|
|
14
|
+
"kind": "geometric_relationship";
|
|
15
|
+
"max_overlap_mm3": Scalar;
|
|
16
|
+
"min_clearance_mm"?: (Scalar) | (null);
|
|
17
|
+
"pose_samples"?: Array<PoseSample>;
|
|
18
|
+
"tolerance": Tolerance;
|
|
19
|
+
}) | ({
|
|
3
20
|
"allowed_pairs"?: Array<[string, string]>;
|
|
4
21
|
"kind": "collision";
|
|
5
22
|
"max_overlap_mm3": Scalar;
|
|
@@ -17,10 +34,22 @@ export type AssemblyCheck = ({
|
|
|
17
34
|
"targets": Array<string>;
|
|
18
35
|
});
|
|
19
36
|
export type Attachment = {
|
|
20
|
-
"
|
|
37
|
+
"datum"?: string | null;
|
|
38
|
+
"frame"?: (Frame) | (null);
|
|
21
39
|
"instance": string;
|
|
40
|
+
"interface"?: string | null;
|
|
41
|
+
"orientation"?: (AttachmentOrientation) | (null);
|
|
22
42
|
};
|
|
43
|
+
export type Attachment2 = {
|
|
44
|
+
"instance": string;
|
|
45
|
+
"interface": string;
|
|
46
|
+
};
|
|
47
|
+
export type AttachmentOrientation = ({
|
|
48
|
+
"kind": "datum";
|
|
49
|
+
"name": string;
|
|
50
|
+
});
|
|
23
51
|
export type Axis = "x" | "y" | "z";
|
|
52
|
+
export type AxisAlignment = "aligned" | "opposed" | "unoriented";
|
|
24
53
|
export type Boundary = ({
|
|
25
54
|
"kind": "polygon";
|
|
26
55
|
"points": Array<string>;
|
|
@@ -33,6 +62,10 @@ export type Boundary = ({
|
|
|
33
62
|
"kind": "circle";
|
|
34
63
|
});
|
|
35
64
|
export type BoxFace = "pos_x" | "neg_x" | "pos_y" | "neg_y" | "pos_z" | "neg_z";
|
|
65
|
+
export type Cardinality = {
|
|
66
|
+
"max": number;
|
|
67
|
+
"min": number;
|
|
68
|
+
};
|
|
36
69
|
export type Circle = {
|
|
37
70
|
"center": string;
|
|
38
71
|
"radius": Scalar;
|
|
@@ -139,15 +172,64 @@ export type Constraint = ({
|
|
|
139
172
|
"id": string;
|
|
140
173
|
"kind": "symmetric";
|
|
141
174
|
});
|
|
175
|
+
export type ContactPair = {
|
|
176
|
+
"a": FaceSelector2;
|
|
177
|
+
"b": FaceSelector2;
|
|
178
|
+
};
|
|
142
179
|
export type ControlEdit = {
|
|
143
180
|
"point": [Scalar, Scalar, Scalar];
|
|
144
181
|
"u": number;
|
|
145
182
|
"v": number;
|
|
146
183
|
};
|
|
184
|
+
export type Correspondence = ({
|
|
185
|
+
"kind": "pattern";
|
|
186
|
+
"require_all": boolean;
|
|
187
|
+
"symmetry": Symmetry;
|
|
188
|
+
});
|
|
147
189
|
export type Counterbore = {
|
|
148
190
|
"depth": Scalar;
|
|
149
191
|
"radius": Scalar;
|
|
150
192
|
};
|
|
193
|
+
export type CurveClass = "line" | "circle" | "ellipse" | "nurbs" | "other";
|
|
194
|
+
export type DatumInput = {
|
|
195
|
+
"datum": string;
|
|
196
|
+
};
|
|
197
|
+
export type DatumRules = {
|
|
198
|
+
"normal": string;
|
|
199
|
+
"origin": Origin;
|
|
200
|
+
"x_axis"?: (OrientationName) | (null);
|
|
201
|
+
};
|
|
202
|
+
export type Declaration = {
|
|
203
|
+
"definition": string;
|
|
204
|
+
"derive": Recipe;
|
|
205
|
+
"id": string;
|
|
206
|
+
"tolerance": Tolerance;
|
|
207
|
+
};
|
|
208
|
+
export type Declaration2 = {
|
|
209
|
+
"datum": DatumRules;
|
|
210
|
+
"definition": string;
|
|
211
|
+
"id": string;
|
|
212
|
+
"orientation_datums"?: Array<OrientationDatum>;
|
|
213
|
+
"profile": string;
|
|
214
|
+
"requirements": Requirements;
|
|
215
|
+
"selectors": Selectors;
|
|
216
|
+
};
|
|
217
|
+
export type Derive = ({
|
|
218
|
+
"kind": "point";
|
|
219
|
+
}) | ({
|
|
220
|
+
"kind": "plane";
|
|
221
|
+
}) | ({
|
|
222
|
+
"kind": "axis";
|
|
223
|
+
}) | ({
|
|
224
|
+
"kind": "direction";
|
|
225
|
+
});
|
|
226
|
+
export type Directed = {
|
|
227
|
+
"datum": string;
|
|
228
|
+
"sense": Sense;
|
|
229
|
+
};
|
|
230
|
+
export type DirectionInput = ([number, number, number]) | ({
|
|
231
|
+
"datum": string;
|
|
232
|
+
});
|
|
151
233
|
export type EdgeSelector = ({
|
|
152
234
|
"expected_count": number;
|
|
153
235
|
"kind": "named";
|
|
@@ -179,7 +261,11 @@ export type Expression = {
|
|
|
179
261
|
"b": Scalar;
|
|
180
262
|
"op": Arithmetic;
|
|
181
263
|
};
|
|
182
|
-
export type FaceSelector =
|
|
264
|
+
export type FaceSelector = {
|
|
265
|
+
"cardinality": Cardinality;
|
|
266
|
+
"where": Filter;
|
|
267
|
+
};
|
|
268
|
+
export type FaceSelector2 = ({
|
|
183
269
|
"expected_count": number;
|
|
184
270
|
"name": string;
|
|
185
271
|
}) | ({
|
|
@@ -200,7 +286,7 @@ export type Feature = ({
|
|
|
200
286
|
[key: string]: EdgeSelector;
|
|
201
287
|
};
|
|
202
288
|
"faces"?: {
|
|
203
|
-
[key: string]:
|
|
289
|
+
[key: string]: FaceSelector2;
|
|
204
290
|
};
|
|
205
291
|
"id": string;
|
|
206
292
|
"input": string;
|
|
@@ -404,7 +490,7 @@ export type Feature = ({
|
|
|
404
490
|
"id": string;
|
|
405
491
|
"input": string;
|
|
406
492
|
"op": "shell";
|
|
407
|
-
"open_faces"?: Array<
|
|
493
|
+
"open_faces"?: Array<FaceSelector2>;
|
|
408
494
|
"thickness": Scalar;
|
|
409
495
|
}) | ({
|
|
410
496
|
"height": Scalar;
|
|
@@ -490,16 +576,48 @@ export type Feature = ({
|
|
|
490
576
|
"radius": Scalar;
|
|
491
577
|
"spacing": [Scalar, Scalar];
|
|
492
578
|
});
|
|
579
|
+
export type Filter = {
|
|
580
|
+
"all"?: Array<Filter>;
|
|
581
|
+
"any"?: Array<Filter>;
|
|
582
|
+
"area_mm2"?: (Range) | (null);
|
|
583
|
+
"curve_type"?: (CurveClass) | (null);
|
|
584
|
+
"length_mm"?: (Range) | (null);
|
|
585
|
+
"loop_role"?: (LoopRole) | (null);
|
|
586
|
+
"name"?: string | null;
|
|
587
|
+
"not"?: (Filter) | (null);
|
|
588
|
+
"planar_coplanar_with"?: (DatumInput) | (null);
|
|
589
|
+
"planar_normal_aligned_with"?: (DirectionInput) | (null);
|
|
590
|
+
"planar_normal_parallel_to"?: (DirectionInput) | (null);
|
|
591
|
+
"radius_mm"?: (Range) | (null);
|
|
592
|
+
"surface_type"?: (SurfaceClass) | (null);
|
|
593
|
+
};
|
|
493
594
|
export type Frame = {
|
|
494
595
|
"origin": [Scalar, Scalar, Scalar];
|
|
495
596
|
"x_axis": [Scalar, Scalar, Scalar];
|
|
496
597
|
"y_axis": [Scalar, Scalar, Scalar];
|
|
497
598
|
};
|
|
599
|
+
export type FrameAlignment = "aligned" | "opposed";
|
|
498
600
|
export type Group = {
|
|
499
601
|
"id": string;
|
|
500
602
|
"parent"?: string | null;
|
|
501
603
|
"pose"?: Pose;
|
|
502
604
|
};
|
|
605
|
+
export type GroupSelector = {
|
|
606
|
+
"cardinality": Cardinality;
|
|
607
|
+
"opening_on": string;
|
|
608
|
+
"where": HoleGroupFilter;
|
|
609
|
+
};
|
|
610
|
+
export type HoleGroupFilter = {
|
|
611
|
+
"equal_diameter"?: boolean;
|
|
612
|
+
"member_count"?: number | null;
|
|
613
|
+
"pattern"?: (HolePattern) | (null);
|
|
614
|
+
};
|
|
615
|
+
export type HolePattern = "linear" | "rectangular" | "circular" | "unstructured";
|
|
616
|
+
export type HoleSize = ({
|
|
617
|
+
"a_diameter_mm": Range;
|
|
618
|
+
"b_diameter_mm": Range;
|
|
619
|
+
"kind": "independent_ranges";
|
|
620
|
+
});
|
|
503
621
|
export type Instance = {
|
|
504
622
|
"export"?: boolean;
|
|
505
623
|
"id": string;
|
|
@@ -514,15 +632,41 @@ export type Instance = {
|
|
|
514
632
|
"rotation_order"?: RotationOrder;
|
|
515
633
|
"translation"?: [Scalar, Scalar, Scalar];
|
|
516
634
|
};
|
|
635
|
+
export type InterfaceFitRequirements = {
|
|
636
|
+
"hole_size": HoleSize;
|
|
637
|
+
"max_hole_axis_offset_mm": Scalar;
|
|
638
|
+
"max_plane_gap_mm": Scalar;
|
|
639
|
+
"register"?: (RegisterFit) | (null);
|
|
640
|
+
};
|
|
641
|
+
export type InterfacePatternRequirement = ({
|
|
642
|
+
"count": [Scalar, Scalar];
|
|
643
|
+
"kind": "rectangular";
|
|
644
|
+
"pitch_mm": [Scalar, Scalar];
|
|
645
|
+
}) | ({
|
|
646
|
+
"count": Scalar;
|
|
647
|
+
"kind": "circular";
|
|
648
|
+
"pcd_mm": Scalar;
|
|
649
|
+
}) | ({
|
|
650
|
+
"count": Scalar;
|
|
651
|
+
"kind": "linear";
|
|
652
|
+
"pitch_mm": Scalar;
|
|
653
|
+
}) | ({
|
|
654
|
+
"count": Scalar;
|
|
655
|
+
"kind": "unstructured";
|
|
656
|
+
});
|
|
657
|
+
export type Kind = "face" | "edge" | "vertex" | "loop";
|
|
517
658
|
export type LoftSection = {
|
|
518
659
|
"center": [Scalar, Scalar, Scalar];
|
|
519
660
|
"radii": [Scalar, Scalar];
|
|
520
661
|
};
|
|
662
|
+
export type LoopRole = "outer" | "inner" | "unknown";
|
|
521
663
|
export type Mate = ({
|
|
522
664
|
"a": Attachment;
|
|
665
|
+
"alignment"?: FrameAlignment;
|
|
523
666
|
"b": Attachment;
|
|
524
667
|
"id": string;
|
|
525
668
|
"kind": "fixed";
|
|
669
|
+
"twist_deg"?: Scalar;
|
|
526
670
|
}) | ({
|
|
527
671
|
"a": Attachment;
|
|
528
672
|
"b": Attachment;
|
|
@@ -530,19 +674,23 @@ export type Mate = ({
|
|
|
530
674
|
"kind": "coincident";
|
|
531
675
|
}) | ({
|
|
532
676
|
"a": Attachment;
|
|
677
|
+
"alignment"?: AxisAlignment;
|
|
533
678
|
"b": Attachment;
|
|
534
679
|
"id": string;
|
|
535
680
|
"kind": "concentric";
|
|
536
681
|
}) | ({
|
|
537
682
|
"a": Attachment;
|
|
683
|
+
"alignment"?: AxisAlignment;
|
|
538
684
|
"b": Attachment;
|
|
539
685
|
"id": string;
|
|
540
686
|
"kind": "revolute";
|
|
541
687
|
}) | ({
|
|
542
688
|
"a": Attachment;
|
|
689
|
+
"alignment"?: FrameAlignment;
|
|
543
690
|
"b": Attachment;
|
|
544
691
|
"id": string;
|
|
545
692
|
"kind": "prismatic";
|
|
693
|
+
"twist_deg"?: Scalar;
|
|
546
694
|
}) | ({
|
|
547
695
|
"a": Attachment;
|
|
548
696
|
"b": Attachment;
|
|
@@ -562,6 +710,7 @@ export type MateSystem = {
|
|
|
562
710
|
"constraints": Array<Mate>;
|
|
563
711
|
"expected_degrees_of_freedom"?: number;
|
|
564
712
|
};
|
|
713
|
+
export type MaterialSide = "internal" | "external";
|
|
565
714
|
export type OnFailure = ({
|
|
566
715
|
"kind": "raise";
|
|
567
716
|
}) | ({
|
|
@@ -571,6 +720,28 @@ export type OnFailure = ({
|
|
|
571
720
|
"reason": string;
|
|
572
721
|
});
|
|
573
722
|
export type OpenFace = "top" | "bottom";
|
|
723
|
+
export type OrientationDatum = ({
|
|
724
|
+
"kind": "direction";
|
|
725
|
+
"name": string;
|
|
726
|
+
"vector": [Scalar, Scalar, Scalar];
|
|
727
|
+
}) | ({
|
|
728
|
+
"datum": string;
|
|
729
|
+
"kind": "geometric_datum";
|
|
730
|
+
"name": string;
|
|
731
|
+
});
|
|
732
|
+
export type OrientationName = ({
|
|
733
|
+
"kind": "orientation_datum";
|
|
734
|
+
"name": string;
|
|
735
|
+
});
|
|
736
|
+
export type Origin = ({
|
|
737
|
+
"kind": "hole_group_center";
|
|
738
|
+
}) | ({
|
|
739
|
+
"axis_slot": string;
|
|
740
|
+
"kind": "axis_plane_intersection";
|
|
741
|
+
}) | ({
|
|
742
|
+
"kind": "declared_point";
|
|
743
|
+
"point": [Scalar, Scalar, Scalar];
|
|
744
|
+
});
|
|
574
745
|
export type OuterEdges = "vertical" | "top" | "bottom";
|
|
575
746
|
export type OutputKind = "solid" | "surface";
|
|
576
747
|
export type ParamRef = {
|
|
@@ -589,6 +760,7 @@ export type PathCurve = ({
|
|
|
589
760
|
"control_points": Array<[Scalar, Scalar, Scalar]>;
|
|
590
761
|
"kind": "bezier";
|
|
591
762
|
});
|
|
763
|
+
export type PlaneRelation = "aligned" | "opposed";
|
|
592
764
|
export type Pose = {
|
|
593
765
|
"frame"?: (Frame) | (null);
|
|
594
766
|
"rotation_deg"?: [Scalar, Scalar, Scalar];
|
|
@@ -597,6 +769,11 @@ export type Pose = {
|
|
|
597
769
|
"visible"?: boolean;
|
|
598
770
|
};
|
|
599
771
|
export type PoseMode = "normal" | "internal" | "exploded";
|
|
772
|
+
export type PoseSample = {
|
|
773
|
+
"a"?: Pose;
|
|
774
|
+
"b"?: Pose;
|
|
775
|
+
"id": string;
|
|
776
|
+
};
|
|
600
777
|
export type Poses = {
|
|
601
778
|
"exploded": Pose;
|
|
602
779
|
"internal": Pose;
|
|
@@ -636,7 +813,49 @@ export type ProfileSection = {
|
|
|
636
813
|
"frame"?: Frame;
|
|
637
814
|
"profile": Profile;
|
|
638
815
|
};
|
|
816
|
+
export type Range = {
|
|
817
|
+
"max"?: number | null;
|
|
818
|
+
"min"?: number | null;
|
|
819
|
+
};
|
|
820
|
+
export type RankBy = ({
|
|
821
|
+
"property": "area_mm2";
|
|
822
|
+
}) | ({
|
|
823
|
+
"property": "length_mm";
|
|
824
|
+
}) | ({
|
|
825
|
+
"direction": DirectionInput;
|
|
826
|
+
"property": "center_projection";
|
|
827
|
+
});
|
|
828
|
+
export type Recipe = ({
|
|
829
|
+
"derive": Derive;
|
|
830
|
+
"kind": "selected";
|
|
831
|
+
"selection": Selection;
|
|
832
|
+
}) | ({
|
|
833
|
+
"kind": "design_point";
|
|
834
|
+
"point": [Scalar, Scalar, Scalar];
|
|
835
|
+
}) | ({
|
|
836
|
+
"from": string;
|
|
837
|
+
"kind": "point_difference";
|
|
838
|
+
"to": string;
|
|
839
|
+
}) | ({
|
|
840
|
+
"kind": "frame";
|
|
841
|
+
"origin": string;
|
|
842
|
+
"x": Directed;
|
|
843
|
+
"z": Directed;
|
|
844
|
+
});
|
|
639
845
|
export type RegionKind = "outer" | "cavity" | "opening";
|
|
846
|
+
export type RegisterFit = {
|
|
847
|
+
"max_axis_offset_mm": Scalar;
|
|
848
|
+
"radial_clearance_mm": Range;
|
|
849
|
+
};
|
|
850
|
+
export type RegisterSelector = {
|
|
851
|
+
"cardinality": Cardinality;
|
|
852
|
+
"material_side": MaterialSide;
|
|
853
|
+
"where": Filter;
|
|
854
|
+
};
|
|
855
|
+
export type RelationshipTarget = {
|
|
856
|
+
"instance": string;
|
|
857
|
+
"region"?: (FaceSelector2) | (null);
|
|
858
|
+
};
|
|
640
859
|
export type Representation = ({
|
|
641
860
|
"kind": "exact";
|
|
642
861
|
}) | ({
|
|
@@ -648,6 +867,12 @@ export type Representation = ({
|
|
|
648
867
|
"omitted": Array<string>;
|
|
649
868
|
"reason": string;
|
|
650
869
|
});
|
|
870
|
+
export type Requirements = {
|
|
871
|
+
"bore_diameter_mm": Scalar;
|
|
872
|
+
"pattern": InterfacePatternRequirement;
|
|
873
|
+
"termination": Termination;
|
|
874
|
+
"verification_tolerance": Tolerance;
|
|
875
|
+
};
|
|
651
876
|
export type RotationOrder = "xyz" | "zyx";
|
|
652
877
|
export type Scalar = (number) | (ParamRef) | (Expression);
|
|
653
878
|
export type SectionPlane = {
|
|
@@ -662,6 +887,57 @@ export type Segment = ({
|
|
|
662
887
|
"to": [Scalar, Scalar];
|
|
663
888
|
"via": [Scalar, Scalar];
|
|
664
889
|
});
|
|
890
|
+
export type Selection = ({
|
|
891
|
+
"entity": Kind;
|
|
892
|
+
"kind": "entities";
|
|
893
|
+
}) | ({
|
|
894
|
+
"kind": "refs";
|
|
895
|
+
"refs": Array<TopologyRef>;
|
|
896
|
+
}) | ({
|
|
897
|
+
"input": Selection;
|
|
898
|
+
"kind": "filter";
|
|
899
|
+
"where": Filter;
|
|
900
|
+
}) | ({
|
|
901
|
+
"entity": Kind;
|
|
902
|
+
"input": Selection;
|
|
903
|
+
"kind": "children";
|
|
904
|
+
}) | ({
|
|
905
|
+
"entity": Kind;
|
|
906
|
+
"input": Selection;
|
|
907
|
+
"kind": "ancestors";
|
|
908
|
+
}) | ({
|
|
909
|
+
"entity": Kind;
|
|
910
|
+
"input": Selection;
|
|
911
|
+
"kind": "siblings";
|
|
912
|
+
"via": Kind;
|
|
913
|
+
}) | ({
|
|
914
|
+
"inputs": Array<Selection>;
|
|
915
|
+
"kind": "union";
|
|
916
|
+
}) | ({
|
|
917
|
+
"inputs": Array<Selection>;
|
|
918
|
+
"kind": "intersection";
|
|
919
|
+
}) | ({
|
|
920
|
+
"kind": "difference";
|
|
921
|
+
"left": Selection;
|
|
922
|
+
"right": Selection;
|
|
923
|
+
}) | ({
|
|
924
|
+
"by": RankBy;
|
|
925
|
+
"descending"?: boolean;
|
|
926
|
+
"input": Selection;
|
|
927
|
+
"kind": "rank";
|
|
928
|
+
"rank": number;
|
|
929
|
+
"tie_tolerance": number;
|
|
930
|
+
}) | ({
|
|
931
|
+
"count": number;
|
|
932
|
+
"input": Selection;
|
|
933
|
+
"kind": "expect";
|
|
934
|
+
});
|
|
935
|
+
export type Selectors = {
|
|
936
|
+
"hole_group": GroupSelector;
|
|
937
|
+
"plane": FaceSelector;
|
|
938
|
+
"register"?: (RegisterSelector) | (null);
|
|
939
|
+
};
|
|
940
|
+
export type Sense = "positive" | "negative";
|
|
665
941
|
export type Sketch = {
|
|
666
942
|
"allow_underconstrained"?: boolean;
|
|
667
943
|
"boundary": Boundary;
|
|
@@ -686,6 +962,21 @@ export type StepAsset = {
|
|
|
686
962
|
"step": string;
|
|
687
963
|
};
|
|
688
964
|
export type Strategy = "offset" | "scaled" | "offset_then_scaled";
|
|
965
|
+
export type SurfaceClass = "plane" | "cylinder" | "cone" | "sphere" | "torus" | "nurbs" | "other";
|
|
966
|
+
export type Symmetry = "require_unique" | "allow_equivalent";
|
|
967
|
+
export type Termination = "through" | "blind" | "unknown";
|
|
968
|
+
export type Tolerance = {
|
|
969
|
+
"angular_rad": number;
|
|
970
|
+
"linear_mm": number;
|
|
971
|
+
};
|
|
972
|
+
export type TopologyRef = {
|
|
973
|
+
"definition_id": string;
|
|
974
|
+
"definition_sha256": string;
|
|
975
|
+
"instance_path"?: Array<string> | null;
|
|
976
|
+
"kind": Kind;
|
|
977
|
+
"query_revision_id": string;
|
|
978
|
+
"topology_id": string;
|
|
979
|
+
};
|
|
689
980
|
export type View = "iso" | "front" | "back" | "left" | "right" | "top" | "bottom";
|
|
690
981
|
export type Model = {
|
|
691
982
|
"assembly"?: Array<Instance>;
|
|
@@ -693,8 +984,10 @@ export type Model = {
|
|
|
693
984
|
[key: string]: StepAsset;
|
|
694
985
|
};
|
|
695
986
|
"checks"?: Array<AssemblyCheck>;
|
|
987
|
+
"datums"?: Array<Declaration>;
|
|
696
988
|
"features": Array<Feature>;
|
|
697
989
|
"groups"?: Array<Group>;
|
|
990
|
+
"interfaces"?: Array<Declaration2>;
|
|
698
991
|
"mates"?: (MateSystem) | (null);
|
|
699
992
|
"output"?: string;
|
|
700
993
|
"output_kind"?: OutputKind;
|
package/kernel/dist/process.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export interface ProcessResult {
|
|
|
8
8
|
overflow: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare function error(code: string, message: string): Receipt;
|
|
11
|
-
export declare function execute(file: string, args: string[], input?: CadInput, wallMs?: number): Promise<ProcessResult>;
|
|
11
|
+
export declare function execute(file: string, args: string[], input?: CadInput, wallMs?: number, maxOutputBytes?: number): Promise<ProcessResult>;
|
|
12
12
|
export declare function receipt(result: ProcessResult): Receipt;
|
package/kernel/dist/process.js
CHANGED
|
@@ -3,7 +3,7 @@ export function error(code, message) {
|
|
|
3
3
|
return { ok: false, error: { code, message } };
|
|
4
4
|
}
|
|
5
5
|
// Command arguments and input are separate; agent data never enters a shell string.
|
|
6
|
-
export function execute(file, args, input = '', wallMs = 30_000) {
|
|
6
|
+
export function execute(file, args, input = '', wallMs = 30_000, maxOutputBytes = 2_097_152) {
|
|
7
7
|
return new Promise((done, reject) => {
|
|
8
8
|
const child = spawn(file, args, { stdio: ['pipe', 'pipe', 'pipe'] });
|
|
9
9
|
let stdout = '', stderr = '', timedOut = false, overflow = false;
|
|
@@ -11,7 +11,7 @@ export function execute(file, args, input = '', wallMs = 30_000) {
|
|
|
11
11
|
child.on('error', e => { clearTimeout(timer); reject(e); });
|
|
12
12
|
child.stdout.on('data', b => {
|
|
13
13
|
stdout += b;
|
|
14
|
-
if (Buffer.byteLength(stdout) >
|
|
14
|
+
if (Buffer.byteLength(stdout) > maxOutputBytes) {
|
|
15
15
|
overflow = true;
|
|
16
16
|
child.kill('SIGKILL');
|
|
17
17
|
}
|
|
@@ -26,7 +26,7 @@ export function receipt(result) {
|
|
|
26
26
|
if (result.timedOut)
|
|
27
27
|
return error('TIMEOUT', 'CAD command exceeded wall-clock budget');
|
|
28
28
|
if (result.overflow)
|
|
29
|
-
return error('OUTPUT_LIMIT', 'CAD response exceeded
|
|
29
|
+
return error('OUTPUT_LIMIT', 'CAD response exceeded the command output budget');
|
|
30
30
|
try {
|
|
31
31
|
const value = JSON.parse(result.stdout);
|
|
32
32
|
if (typeof value?.ok !== 'boolean'
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export type CurveClass = "line" | "circle" | "ellipse" | "nurbs" | "other";
|
|
2
|
+
export type DatumInput = {
|
|
3
|
+
"datum": string;
|
|
4
|
+
};
|
|
5
|
+
export type Derive = ({
|
|
6
|
+
"kind": "point";
|
|
7
|
+
}) | ({
|
|
8
|
+
"kind": "plane";
|
|
9
|
+
}) | ({
|
|
10
|
+
"kind": "axis";
|
|
11
|
+
}) | ({
|
|
12
|
+
"kind": "direction";
|
|
13
|
+
});
|
|
14
|
+
export type DirectionInput = ([number, number, number]) | ({
|
|
15
|
+
"datum": string;
|
|
16
|
+
});
|
|
17
|
+
export type Filter = {
|
|
18
|
+
"all"?: Array<Filter>;
|
|
19
|
+
"any"?: Array<Filter>;
|
|
20
|
+
"area_mm2"?: (Range) | (null);
|
|
21
|
+
"curve_type"?: (CurveClass) | (null);
|
|
22
|
+
"length_mm"?: (Range) | (null);
|
|
23
|
+
"loop_role"?: (LoopRole) | (null);
|
|
24
|
+
"name"?: string | null;
|
|
25
|
+
"not"?: (Filter) | (null);
|
|
26
|
+
"planar_coplanar_with"?: (DatumInput) | (null);
|
|
27
|
+
"planar_normal_aligned_with"?: (DirectionInput) | (null);
|
|
28
|
+
"planar_normal_parallel_to"?: (DirectionInput) | (null);
|
|
29
|
+
"radius_mm"?: (Range) | (null);
|
|
30
|
+
"surface_type"?: (SurfaceClass) | (null);
|
|
31
|
+
};
|
|
32
|
+
export type HoleFilter = {
|
|
33
|
+
"axis_parallel_to"?: (DirectionInput) | (null);
|
|
34
|
+
"diameter_mm"?: (Range) | (null);
|
|
35
|
+
"opening_on"?: Array<TopologyRef>;
|
|
36
|
+
"termination"?: (Termination) | (null);
|
|
37
|
+
};
|
|
38
|
+
export type HoleGroupFilter = {
|
|
39
|
+
"equal_diameter"?: boolean;
|
|
40
|
+
"member_count"?: number | null;
|
|
41
|
+
"pattern"?: (HolePattern) | (null);
|
|
42
|
+
};
|
|
43
|
+
export type HolePattern = "linear" | "rectangular" | "circular" | "unstructured";
|
|
44
|
+
export type Kind = "face" | "edge" | "vertex" | "loop";
|
|
45
|
+
export type LoopRole = "outer" | "inner" | "unknown";
|
|
46
|
+
export type Query = ({
|
|
47
|
+
"cursor"?: string | null;
|
|
48
|
+
"id": string;
|
|
49
|
+
"limit"?: number;
|
|
50
|
+
}) & (({
|
|
51
|
+
"a": Target;
|
|
52
|
+
"b": Target;
|
|
53
|
+
"op": "measure";
|
|
54
|
+
}) | ({
|
|
55
|
+
"op": "faces";
|
|
56
|
+
"where"?: Filter;
|
|
57
|
+
}) | ({
|
|
58
|
+
"op": "edges";
|
|
59
|
+
"where"?: Filter;
|
|
60
|
+
}) | ({
|
|
61
|
+
"op": "vertices";
|
|
62
|
+
"where"?: Filter;
|
|
63
|
+
}) | ({
|
|
64
|
+
"op": "loops";
|
|
65
|
+
"where"?: Filter;
|
|
66
|
+
}) | ({
|
|
67
|
+
"op": "select";
|
|
68
|
+
"selection": Selection;
|
|
69
|
+
}) | ({
|
|
70
|
+
"op": "describe";
|
|
71
|
+
"refs": Array<TopologyRef>;
|
|
72
|
+
}) | ({
|
|
73
|
+
"derive": Derive;
|
|
74
|
+
"op": "datums";
|
|
75
|
+
"selection": Selection;
|
|
76
|
+
}) | ({
|
|
77
|
+
"ids"?: Array<string> | null;
|
|
78
|
+
"op": "interfaces";
|
|
79
|
+
"profile"?: string | null;
|
|
80
|
+
"support_faces"?: Array<TopologyRef>;
|
|
81
|
+
"where"?: HoleGroupFilter;
|
|
82
|
+
}) | ({
|
|
83
|
+
"op": "hole_groups";
|
|
84
|
+
"support_faces"?: Array<TopologyRef>;
|
|
85
|
+
"where"?: HoleGroupFilter;
|
|
86
|
+
}) | ({
|
|
87
|
+
"op": "holes";
|
|
88
|
+
"where"?: HoleFilter;
|
|
89
|
+
}) | ({
|
|
90
|
+
"ids": Array<string>;
|
|
91
|
+
"op": "named_datums";
|
|
92
|
+
}) | ({
|
|
93
|
+
"op": "evaluate_face";
|
|
94
|
+
"ref": TopologyRef;
|
|
95
|
+
"uv": [number, number];
|
|
96
|
+
}));
|
|
97
|
+
export type Range = {
|
|
98
|
+
"max"?: number | null;
|
|
99
|
+
"min"?: number | null;
|
|
100
|
+
};
|
|
101
|
+
export type RankBy = ({
|
|
102
|
+
"property": "area_mm2";
|
|
103
|
+
}) | ({
|
|
104
|
+
"property": "length_mm";
|
|
105
|
+
}) | ({
|
|
106
|
+
"direction": DirectionInput;
|
|
107
|
+
"property": "center_projection";
|
|
108
|
+
});
|
|
109
|
+
export type Selection = ({
|
|
110
|
+
"entity": Kind;
|
|
111
|
+
"kind": "entities";
|
|
112
|
+
}) | ({
|
|
113
|
+
"kind": "refs";
|
|
114
|
+
"refs": Array<TopologyRef>;
|
|
115
|
+
}) | ({
|
|
116
|
+
"input": Selection;
|
|
117
|
+
"kind": "filter";
|
|
118
|
+
"where": Filter;
|
|
119
|
+
}) | ({
|
|
120
|
+
"entity": Kind;
|
|
121
|
+
"input": Selection;
|
|
122
|
+
"kind": "children";
|
|
123
|
+
}) | ({
|
|
124
|
+
"entity": Kind;
|
|
125
|
+
"input": Selection;
|
|
126
|
+
"kind": "ancestors";
|
|
127
|
+
}) | ({
|
|
128
|
+
"entity": Kind;
|
|
129
|
+
"input": Selection;
|
|
130
|
+
"kind": "siblings";
|
|
131
|
+
"via": Kind;
|
|
132
|
+
}) | ({
|
|
133
|
+
"inputs": Array<Selection>;
|
|
134
|
+
"kind": "union";
|
|
135
|
+
}) | ({
|
|
136
|
+
"inputs": Array<Selection>;
|
|
137
|
+
"kind": "intersection";
|
|
138
|
+
}) | ({
|
|
139
|
+
"kind": "difference";
|
|
140
|
+
"left": Selection;
|
|
141
|
+
"right": Selection;
|
|
142
|
+
}) | ({
|
|
143
|
+
"by": RankBy;
|
|
144
|
+
"descending"?: boolean;
|
|
145
|
+
"input": Selection;
|
|
146
|
+
"kind": "rank";
|
|
147
|
+
"rank": number;
|
|
148
|
+
"tie_tolerance": number;
|
|
149
|
+
}) | ({
|
|
150
|
+
"count": number;
|
|
151
|
+
"input": Selection;
|
|
152
|
+
"kind": "expect";
|
|
153
|
+
});
|
|
154
|
+
export type Space = "definition" | "assembly";
|
|
155
|
+
export type SurfaceClass = "plane" | "cylinder" | "cone" | "sphere" | "torus" | "nurbs" | "other";
|
|
156
|
+
export type Target = ({
|
|
157
|
+
"definition_id": string;
|
|
158
|
+
}) | ({
|
|
159
|
+
"instance_path": Array<string>;
|
|
160
|
+
});
|
|
161
|
+
export type Termination = "through" | "blind" | "unknown";
|
|
162
|
+
export type Tolerance = {
|
|
163
|
+
"angular_rad": number;
|
|
164
|
+
"linear_mm": number;
|
|
165
|
+
};
|
|
166
|
+
export type TopologyRef = {
|
|
167
|
+
"definition_id": string;
|
|
168
|
+
"definition_sha256": string;
|
|
169
|
+
"instance_path"?: Array<string> | null;
|
|
170
|
+
"kind": Kind;
|
|
171
|
+
"query_revision_id": string;
|
|
172
|
+
"topology_id": string;
|
|
173
|
+
};
|
|
174
|
+
export type Request = {
|
|
175
|
+
"queries": Array<Query>;
|
|
176
|
+
"query_revision_id": string;
|
|
177
|
+
"schema": string;
|
|
178
|
+
"space": Space;
|
|
179
|
+
"target": Target;
|
|
180
|
+
"tolerance": Tolerance;
|
|
181
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|