surfcad-mcp 0.2.1 → 0.2.2

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.
@@ -2,7 +2,7 @@
2
2
  "version": 1,
3
3
  "bridgeVersion": 1,
4
4
  "generatedBy": "npm run export:agent",
5
- "count": 181,
5
+ "count": 188,
6
6
  "$defs": {
7
7
  "status": {
8
8
  "type": "object",
@@ -192,14 +192,19 @@
192
192
  },
193
193
  {
194
194
  "name": "set_script",
195
- "description": "Write the editor, run the script, and record one undo step when the text changes. Preserves or re-injects the active part `// @surf-id` header when the part has a surf id.",
195
+ "description": "Freehand fallback after insert_* feature tools. part_id is required and must be the active part's opaque surf id (a vault path or display name is unknown_part; another id is part_mismatch). Writes that part, runs it, and records one undo step when the text changes. Working copy only: nothing reaches git without an explicit git_save. Preserves or re-injects `// @surf-id`. Do not declare a reserved SurfCAD helper name with const, let, class, or function — the runtime passes these as function parameters: addDraft, align, array3D, booleanBodies, boundaryEdges, cboreHole, center, chamferEdges, clearanceHole, concaveEdges, convexEdges, cskHole, cut, deleteFace, draftFaces, edge, edgesBetween, edgesByOrientation, externalBody, facesByNormal, fastenerClearanceDia, fastenerMajorDia, fastenerTapDrillDia, filletAlongPath, filletEdges, getDimensions, getScaleRatio, hexPrism, hole, holePattern, holeSpan, holesOnContour, hollow, listFastenerSizes, loft, makeCrossSection, makeExtrude, makeLoft, makeRevolve, makeSweepPath, mirror, move, moveFace, offsetPlaneFrame, placeInFrame, placeOnFace, planarFaceAt, polarArray, profileCircle, profilePolygon, profileRectangle, rectTube, resolveFastenerSize, rotateContour, roundedBox, sheetMetalSolid, shell, signedFeatureEdges, solveContour, sumSqDist, sweep, sweepPoints, tapDrillHole, transformByFrame, tube, vecAdd, vecCross, vecDot, vecMul, vecNorm, vecNormalize, vecSub, workplaneFromFace. A redeclaration fails; rename your variable (for example `const cut`).",
196
196
  "args": {
197
197
  "type": "object",
198
198
  "additionalProperties": false,
199
199
  "required": [
200
+ "part_id",
200
201
  "source"
201
202
  ],
202
203
  "properties": {
204
+ "part_id": {
205
+ "type": "string",
206
+ "description": "Part id to write. Must match the active part. Not a vault path."
207
+ },
203
208
  "source": {
204
209
  "type": "string",
205
210
  "description": "Script text written into the editor and run."
@@ -293,6 +298,9 @@
293
298
  },
294
299
  "errors": [
295
300
  "bad_args",
301
+ "unknown_part",
302
+ "part_mismatch",
303
+ "no_assembly",
296
304
  "internal"
297
305
  ],
298
306
  "mutates": true,
@@ -301,12 +309,13 @@
301
309
  "immediate": false,
302
310
  "uiEntry": null,
303
311
  "example": {
312
+ "part_id": "2026-10-07-20-56-31-0423-a3f9",
304
313
  "source": "let part = Manifold.cube([20, 20, 20], true);\nreturn part;\n"
305
314
  }
306
315
  },
307
316
  {
308
317
  "name": "run",
309
- "description": "Run the current editor buffer; one undo step when it is not already the stack head.",
318
+ "description": "Run the current editor buffer; one undo step when it is not already the stack head. Do not declare a reserved SurfCAD helper name with const, let, class, or function — the runtime passes these as function parameters: addDraft, align, array3D, booleanBodies, boundaryEdges, cboreHole, center, chamferEdges, clearanceHole, concaveEdges, convexEdges, cskHole, cut, deleteFace, draftFaces, edge, edgesBetween, edgesByOrientation, externalBody, facesByNormal, fastenerClearanceDia, fastenerMajorDia, fastenerTapDrillDia, filletAlongPath, filletEdges, getDimensions, getScaleRatio, hexPrism, hole, holePattern, holeSpan, holesOnContour, hollow, listFastenerSizes, loft, makeCrossSection, makeExtrude, makeLoft, makeRevolve, makeSweepPath, mirror, move, moveFace, offsetPlaneFrame, placeInFrame, placeOnFace, planarFaceAt, polarArray, profileCircle, profilePolygon, profileRectangle, rectTube, resolveFastenerSize, rotateContour, roundedBox, sheetMetalSolid, shell, signedFeatureEdges, solveContour, sumSqDist, sweep, sweepPoints, tapDrillHole, transformByFrame, tube, vecAdd, vecCross, vecDot, vecMul, vecNorm, vecNormalize, vecSub, workplaneFromFace. A redeclaration fails; rename your variable (for example `const cut`).",
310
319
  "args": {
311
320
  "type": "object",
312
321
  "additionalProperties": false,
@@ -409,7 +418,7 @@
409
418
  },
410
419
  {
411
420
  "name": "status",
412
- "description": "Status for the active part: id, name, editor script, runState (not_run_yet | ok | failed), and the last run volume/bbox/bodyCount when available. Updates when the active part changes without requiring another run.",
421
+ "description": "Status for the active part: id, name, editor script, runState (not_run_yet | ok | failed), and the last run volume/bbox/bodyCount when available. Updates when the active part changes without requiring another run. featureCount counts insert_* feature blocks, so a freehand set_script is one feature. bodyCount is null until the first run; a finished run that produced no bodies reports 0.",
413
422
  "args": {
414
423
  "type": "object",
415
424
  "additionalProperties": false,
@@ -494,7 +503,7 @@
494
503
  },
495
504
  {
496
505
  "name": "errors",
497
- "description": "Structured errors from the last finished geometry run.",
506
+ "description": "Structured errors from the last finished geometry run. message is the same text the viewport shows. featureType, featureLabel, and featureIndex identify the failed feature when known. detail is the exception name, a Manifold status, or the kernel message when that text is not already in message. Stack frames and URLs are omitted, and detail is absent when there is nothing further. Cleared on the next successful run. Feature and kernel failures use code feature_failed.",
498
507
  "args": {
499
508
  "type": "object",
500
509
  "additionalProperties": false,
@@ -518,6 +527,18 @@
518
527
  },
519
528
  "featureIndex": {
520
529
  "type": "integer"
530
+ },
531
+ "featureId": {
532
+ "type": "string"
533
+ },
534
+ "featureType": {
535
+ "type": "string"
536
+ },
537
+ "featureLabel": {
538
+ "type": "string"
539
+ },
540
+ "detail": {
541
+ "type": "string"
521
542
  }
522
543
  }
523
544
  }
@@ -536,7 +557,7 @@
536
557
  },
537
558
  {
538
559
  "name": "screenshot",
539
- "description": "Capture the viewport as a PNG data URL.",
560
+ "description": "Capture the viewport. The default is a full-size PNG data URL. Optional max_width and scale downscale in the browser before encoding. format is png or jpeg; quality (0 to 1) applies to jpeg only.",
540
561
  "args": {
541
562
  "type": "object",
542
563
  "additionalProperties": false,
@@ -544,9 +565,27 @@
544
565
  "format": {
545
566
  "type": "string",
546
567
  "enum": [
547
- "png"
568
+ "png",
569
+ "jpeg"
548
570
  ],
549
- "description": "Image format. Omit to use png."
571
+ "description": "Image format. Omit for png, the historical default. jpeg is smaller."
572
+ },
573
+ "quality": {
574
+ "type": "number",
575
+ "minimum": 0,
576
+ "maximum": 1,
577
+ "description": "jpeg quality from 0 to 1. Ignored for png. Default 0.8."
578
+ },
579
+ "max_width": {
580
+ "type": "integer",
581
+ "minimum": 1,
582
+ "description": "Downscale in the browser so the width is at most this many pixels. Does not upscale."
583
+ },
584
+ "scale": {
585
+ "type": "number",
586
+ "exclusiveMinimum": 0,
587
+ "maximum": 1,
588
+ "description": "Multiply width and height by this factor (0 exclusive to 1). Applied before max_width. Does not upscale."
550
589
  }
551
590
  }
552
591
  },
@@ -556,10 +595,24 @@
556
595
  "properties": {
557
596
  "dataUrl": {
558
597
  "type": "string"
598
+ },
599
+ "width": {
600
+ "type": "integer"
601
+ },
602
+ "height": {
603
+ "type": "integer"
604
+ },
605
+ "format": {
606
+ "type": "string",
607
+ "enum": [
608
+ "png",
609
+ "jpeg"
610
+ ]
559
611
  }
560
612
  }
561
613
  },
562
614
  "errors": [
615
+ "bad_args",
563
616
  "unsupported_format",
564
617
  "screenshot_failed",
565
618
  "internal"
@@ -882,7 +935,7 @@
882
935
  },
883
936
  {
884
937
  "name": "list_commands",
885
- "description": "List every bridge command with args schema and example.",
938
+ "description": "List every bridge command with args schema and example. Same names as GET /tools and the MCP bridge tools.",
886
939
  "args": {
887
940
  "type": "object",
888
941
  "additionalProperties": false,
@@ -1045,7 +1098,7 @@
1045
1098
  },
1046
1099
  {
1047
1100
  "name": "dirty",
1048
- "description": "Workspace and per-part dirty flags.",
1101
+ "description": "Working-copy dirty flags. unsaved is true when the WC differs from the last AssemblyCommit (survives reload; covers rename, hide, and remove). pendingSave is an offline planned write waiting for a second Save. Changing activeId does not set assemblyDirty.",
1049
1102
  "args": {
1050
1103
  "type": "object",
1051
1104
  "additionalProperties": false,
@@ -1089,7 +1142,7 @@
1089
1142
  },
1090
1143
  {
1091
1144
  "name": "parts",
1092
- "description": "Assembly parts list and active editor part.",
1145
+ "description": "Open assembly: assemblyId, assemblyName, vaultLayout, activeId, and parts [{ id, name, visible, missing?, group? }]. Part and assembly ids are opaque surf ids, never a path or display name. No path field. featureCount and bodyCount are on status, not here. featureCount counts insert_* feature blocks, so a freehand set_script is one feature. bodyCount is null until the first run; a finished run that produced no bodies reports 0.",
1093
1146
  "args": {
1094
1147
  "type": "object",
1095
1148
  "additionalProperties": false,
@@ -1133,7 +1186,7 @@
1133
1186
  },
1134
1187
  {
1135
1188
  "name": "list_faces",
1136
- "description": "Every pickable face on the active or named part mesh (one row per face a viewport click selects, all bodies): id (f0, f1, …), type (planar, cylindrical, curved), center, normal, axis and radius for cylinders, area, and key. The id is the patch index on this mesh and is only valid until the next remesh; a rerun of the same script keeps every id. Pass the key with the id to joint_pick so a stale id cannot silently pick another face.",
1189
+ "description": "Every pickable face on the active part, or on part_id when set (an opaque surf id, never a path or display name). One row per face a viewport click selects, all bodies: id (f0, f1, …), type (planar, cylindrical, curved), center, normal, axis and radius for cylinders, area, and key. The id is the patch index on this mesh and is only valid until the next remesh; a rerun of the same script keeps every id. Pass the key with the id to joint_pick so a stale id cannot silently pick another face.",
1137
1190
  "args": {
1138
1191
  "type": "object",
1139
1192
  "additionalProperties": false,
@@ -1227,7 +1280,7 @@
1227
1280
  },
1228
1281
  {
1229
1282
  "name": "invoke_helper",
1230
- "description": "Insert a helper palette item through the same compose path as the UI.",
1283
+ "description": "Prefer this or insert_* over freehand set_script. Insert a helper palette item on the active part, the same compose path as the UI. Working copy only; git_save commits.",
1231
1284
  "args": {
1232
1285
  "type": "object",
1233
1286
  "additionalProperties": false,
@@ -1353,7 +1406,7 @@
1353
1406
  },
1354
1407
  {
1355
1408
  "name": "insert_cube",
1356
- "description": "Insert this helper through composeHelperInsert and mutate.",
1409
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
1357
1410
  "args": {
1358
1411
  "type": "object",
1359
1412
  "additionalProperties": false,
@@ -1527,7 +1580,7 @@
1527
1580
  },
1528
1581
  {
1529
1582
  "name": "insert_rounded_box",
1530
- "description": "Insert this helper through composeHelperInsert and mutate.",
1583
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
1531
1584
  "args": {
1532
1585
  "type": "object",
1533
1586
  "additionalProperties": false,
@@ -1707,7 +1760,7 @@
1707
1760
  },
1708
1761
  {
1709
1762
  "name": "insert_cylinder",
1710
- "description": "Insert this helper through composeHelperInsert and mutate.",
1763
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
1711
1764
  "args": {
1712
1765
  "type": "object",
1713
1766
  "additionalProperties": false,
@@ -1877,7 +1930,7 @@
1877
1930
  },
1878
1931
  {
1879
1932
  "name": "insert_sphere",
1880
- "description": "Insert this helper through composeHelperInsert and mutate.",
1933
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
1881
1934
  "args": {
1882
1935
  "type": "object",
1883
1936
  "additionalProperties": false,
@@ -2043,7 +2096,7 @@
2043
2096
  },
2044
2097
  {
2045
2098
  "name": "insert_tube",
2046
- "description": "Insert this helper through composeHelperInsert and mutate.",
2099
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
2047
2100
  "args": {
2048
2101
  "type": "object",
2049
2102
  "additionalProperties": false,
@@ -2247,7 +2300,7 @@
2247
2300
  },
2248
2301
  {
2249
2302
  "name": "insert_hex_prism",
2250
- "description": "Insert this helper through composeHelperInsert and mutate.",
2303
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
2251
2304
  "args": {
2252
2305
  "type": "object",
2253
2306
  "additionalProperties": false,
@@ -2412,7 +2465,7 @@
2412
2465
  },
2413
2466
  {
2414
2467
  "name": "insert_fillet_edges",
2415
- "description": "Insert this helper through composeHelperInsert and mutate.",
2468
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
2416
2469
  "args": {
2417
2470
  "type": "object",
2418
2471
  "additionalProperties": false,
@@ -2554,7 +2607,7 @@
2554
2607
  },
2555
2608
  {
2556
2609
  "name": "insert_chamfer_edges",
2557
- "description": "Insert this helper through composeHelperInsert and mutate.",
2610
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
2558
2611
  "args": {
2559
2612
  "type": "object",
2560
2613
  "additionalProperties": false,
@@ -2671,7 +2724,7 @@
2671
2724
  },
2672
2725
  {
2673
2726
  "name": "insert_cross_section",
2674
- "description": "Insert this helper through composeHelperInsert and mutate.",
2727
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
2675
2728
  "args": {
2676
2729
  "type": "object",
2677
2730
  "additionalProperties": false,
@@ -2830,7 +2883,7 @@
2830
2883
  },
2831
2884
  {
2832
2885
  "name": "insert_sweep_path",
2833
- "description": "Insert this helper through composeHelperInsert and mutate.",
2886
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
2834
2887
  "args": {
2835
2888
  "type": "object",
2836
2889
  "additionalProperties": false,
@@ -2946,7 +2999,7 @@
2946
2999
  },
2947
3000
  {
2948
3001
  "name": "insert_hole",
2949
- "description": "Insert this helper through composeHelperInsert and mutate.",
3002
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
2950
3003
  "args": {
2951
3004
  "type": "object",
2952
3005
  "additionalProperties": false,
@@ -3179,7 +3232,7 @@
3179
3232
  },
3180
3233
  {
3181
3234
  "name": "insert_hole_pattern",
3182
- "description": "Insert this helper through composeHelperInsert and mutate.",
3235
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
3183
3236
  "args": {
3184
3237
  "type": "object",
3185
3238
  "additionalProperties": false,
@@ -3316,7 +3369,7 @@
3316
3369
  },
3317
3370
  {
3318
3371
  "name": "insert_clearance_hole",
3319
- "description": "Insert this helper through composeHelperInsert and mutate.",
3372
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
3320
3373
  "args": {
3321
3374
  "type": "object",
3322
3375
  "additionalProperties": false,
@@ -3459,7 +3512,7 @@
3459
3512
  },
3460
3513
  {
3461
3514
  "name": "insert_tap_drill_hole",
3462
- "description": "Insert this helper through composeHelperInsert and mutate.",
3515
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
3463
3516
  "args": {
3464
3517
  "type": "object",
3465
3518
  "additionalProperties": false,
@@ -3593,7 +3646,7 @@
3593
3646
  },
3594
3647
  {
3595
3648
  "name": "insert_cbore_hole",
3596
- "description": "Insert this helper through composeHelperInsert and mutate.",
3649
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
3597
3650
  "args": {
3598
3651
  "type": "object",
3599
3652
  "additionalProperties": false,
@@ -3728,7 +3781,7 @@
3728
3781
  },
3729
3782
  {
3730
3783
  "name": "insert_csk_hole",
3731
- "description": "Insert this helper through composeHelperInsert and mutate.",
3784
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
3732
3785
  "args": {
3733
3786
  "type": "object",
3734
3787
  "additionalProperties": false,
@@ -3863,7 +3916,7 @@
3863
3916
  },
3864
3917
  {
3865
3918
  "name": "insert_shell",
3866
- "description": "Insert this helper through composeHelperInsert and mutate.",
3919
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
3867
3920
  "args": {
3868
3921
  "type": "object",
3869
3922
  "additionalProperties": false,
@@ -3993,7 +4046,7 @@
3993
4046
  },
3994
4047
  {
3995
4048
  "name": "insert_cut",
3996
- "description": "Insert this helper through composeHelperInsert and mutate.",
4049
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
3997
4050
  "args": {
3998
4051
  "type": "object",
3999
4052
  "additionalProperties": false,
@@ -4108,7 +4161,7 @@
4108
4161
  },
4109
4162
  {
4110
4163
  "name": "insert_boolean",
4111
- "description": "Insert this helper through composeHelperInsert and mutate.",
4164
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
4112
4165
  "args": {
4113
4166
  "type": "object",
4114
4167
  "additionalProperties": false,
@@ -4232,7 +4285,7 @@
4232
4285
  },
4233
4286
  {
4234
4287
  "name": "insert_move",
4235
- "description": "Insert this helper through composeHelperInsert and mutate.",
4288
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
4236
4289
  "args": {
4237
4290
  "type": "object",
4238
4291
  "additionalProperties": false,
@@ -4365,7 +4418,7 @@
4365
4418
  },
4366
4419
  {
4367
4420
  "name": "insert_center",
4368
- "description": "Insert this helper through composeHelperInsert and mutate.",
4421
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
4369
4422
  "args": {
4370
4423
  "type": "object",
4371
4424
  "additionalProperties": false,
@@ -4489,7 +4542,7 @@
4489
4542
  },
4490
4543
  {
4491
4544
  "name": "insert_align",
4492
- "description": "Insert this helper through composeHelperInsert and mutate.",
4545
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
4493
4546
  "args": {
4494
4547
  "type": "object",
4495
4548
  "additionalProperties": false,
@@ -4601,7 +4654,7 @@
4601
4654
  },
4602
4655
  {
4603
4656
  "name": "insert_mirror",
4604
- "description": "Insert this helper through composeHelperInsert and mutate.",
4657
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
4605
4658
  "args": {
4606
4659
  "type": "object",
4607
4660
  "additionalProperties": false,
@@ -4726,7 +4779,7 @@
4726
4779
  },
4727
4780
  {
4728
4781
  "name": "insert_array3_d",
4729
- "description": "Insert this helper through composeHelperInsert and mutate.",
4782
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
4730
4783
  "args": {
4731
4784
  "type": "object",
4732
4785
  "additionalProperties": false,
@@ -4902,7 +4955,7 @@
4902
4955
  },
4903
4956
  {
4904
4957
  "name": "insert_polar_array",
4905
- "description": "Insert this helper through composeHelperInsert and mutate.",
4958
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
4906
4959
  "args": {
4907
4960
  "type": "object",
4908
4961
  "additionalProperties": false,
@@ -5043,7 +5096,7 @@
5043
5096
  },
5044
5097
  {
5045
5098
  "name": "insert_add_draft",
5046
- "description": "Insert this helper through composeHelperInsert and mutate.",
5099
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
5047
5100
  "args": {
5048
5101
  "type": "object",
5049
5102
  "additionalProperties": false,
@@ -5189,7 +5242,7 @@
5189
5242
  },
5190
5243
  {
5191
5244
  "name": "insert_workplane",
5192
- "description": "Insert this helper through composeHelperInsert and mutate.",
5245
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
5193
5246
  "args": {
5194
5247
  "type": "object",
5195
5248
  "additionalProperties": false,
@@ -5294,7 +5347,7 @@
5294
5347
  },
5295
5348
  {
5296
5349
  "name": "insert_make_extrude",
5297
- "description": "Insert this helper through composeHelperInsert and mutate.",
5350
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
5298
5351
  "args": {
5299
5352
  "type": "object",
5300
5353
  "additionalProperties": false,
@@ -5418,7 +5471,7 @@
5418
5471
  },
5419
5472
  {
5420
5473
  "name": "insert_make_revolve",
5421
- "description": "Insert this helper through composeHelperInsert and mutate.",
5474
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
5422
5475
  "args": {
5423
5476
  "type": "object",
5424
5477
  "additionalProperties": false,
@@ -5542,7 +5595,7 @@
5542
5595
  },
5543
5596
  {
5544
5597
  "name": "insert_make_sweep",
5545
- "description": "Insert this helper through composeHelperInsert and mutate.",
5598
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
5546
5599
  "args": {
5547
5600
  "type": "object",
5548
5601
  "additionalProperties": false,
@@ -5657,7 +5710,7 @@
5657
5710
  },
5658
5711
  {
5659
5712
  "name": "insert_make_loft",
5660
- "description": "Insert this helper through composeHelperInsert and mutate.",
5713
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
5661
5714
  "args": {
5662
5715
  "type": "object",
5663
5716
  "additionalProperties": false,
@@ -5781,7 +5834,7 @@
5781
5834
  },
5782
5835
  {
5783
5836
  "name": "insert_move_face",
5784
- "description": "Insert this helper through composeHelperInsert and mutate.",
5837
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
5785
5838
  "args": {
5786
5839
  "type": "object",
5787
5840
  "additionalProperties": false,
@@ -5901,7 +5954,7 @@
5901
5954
  },
5902
5955
  {
5903
5956
  "name": "insert_delete_face",
5904
- "description": "Insert this helper through composeHelperInsert and mutate.",
5957
+ "description": "Prefer this over freehand set_script. Insert this helper on the active part (set_active_part first) and run it. Working copy only; git_save commits.",
5905
5958
  "args": {
5906
5959
  "type": "object",
5907
5960
  "additionalProperties": false,
@@ -7095,7 +7148,7 @@
7095
7148
  },
7096
7149
  {
7097
7150
  "name": "set_active_part",
7098
- "description": "Switch the editor and mesh to a part row.",
7151
+ "description": "Switch the editor and mesh to a part row. part_id is an opaque surf id from parts, never a path or name.",
7099
7152
  "args": {
7100
7153
  "type": "object",
7101
7154
  "additionalProperties": false,
@@ -7104,7 +7157,8 @@
7104
7157
  ],
7105
7158
  "properties": {
7106
7159
  "part_id": {
7107
- "type": "string"
7160
+ "type": "string",
7161
+ "description": "Part id from parts. Not a vault path."
7108
7162
  }
7109
7163
  }
7110
7164
  },
@@ -7128,7 +7182,56 @@
7128
7182
  "immediate": true,
7129
7183
  "uiEntry": null,
7130
7184
  "example": {
7131
- "part_id": "local:part1"
7185
+ "part_id": "2026-10-07-20-56-31-0423-a3f9"
7186
+ }
7187
+ },
7188
+ {
7189
+ "name": "set_part_visible",
7190
+ "description": "Hide or show one part, the same working-copy change as the Parts list visibility toggle. part_id is an opaque id: this does not accept a vault path and does not fall back to the active part. This is not agent_set_visible, which toggles operator-visible cues (the synthetic cursor, highlights, and pacing). Working copy only: it does not write git or the vault.",
7191
+ "args": {
7192
+ "type": "object",
7193
+ "additionalProperties": false,
7194
+ "required": [
7195
+ "part_id",
7196
+ "visible"
7197
+ ],
7198
+ "properties": {
7199
+ "part_id": {
7200
+ "type": "string",
7201
+ "description": "Opaque part id from parts. Not a vault path. Does not fall back to the active part."
7202
+ },
7203
+ "visible": {
7204
+ "type": "boolean",
7205
+ "description": "true shows the part, false hides it."
7206
+ }
7207
+ }
7208
+ },
7209
+ "result": {
7210
+ "type": "object",
7211
+ "additionalProperties": false,
7212
+ "properties": {
7213
+ "partId": {
7214
+ "type": "string"
7215
+ },
7216
+ "visible": {
7217
+ "type": "boolean"
7218
+ }
7219
+ }
7220
+ },
7221
+ "errors": [
7222
+ "bad_args",
7223
+ "unknown_part",
7224
+ "no_assembly",
7225
+ "internal"
7226
+ ],
7227
+ "mutates": true,
7228
+ "destructive": false,
7229
+ "confirm": false,
7230
+ "immediate": false,
7231
+ "uiEntry": null,
7232
+ "example": {
7233
+ "part_id": "local:part1",
7234
+ "visible": false
7132
7235
  }
7133
7236
  },
7134
7237
  {
@@ -11151,11 +11254,16 @@
11151
11254
  },
11152
11255
  {
11153
11256
  "name": "create_assembly",
11154
- "description": "Seed a blank assembly document.",
11257
+ "description": "Seed a blank local assembly. Single-flight per tab: overlapping calls return the same assemblyId. Optional name is a non-unique label. No git write. Returns { assemblyId, assemblyName, activeId, partCount }.",
11155
11258
  "args": {
11156
11259
  "type": "object",
11157
11260
  "additionalProperties": false,
11158
- "properties": {}
11261
+ "properties": {
11262
+ "name": {
11263
+ "type": "string",
11264
+ "description": "Optional display label. Names are not unique and are not used as keys."
11265
+ }
11266
+ }
11159
11267
  },
11160
11268
  "result": {
11161
11269
  "type": "object",
@@ -11165,15 +11273,17 @@
11165
11273
  "internal"
11166
11274
  ],
11167
11275
  "mutates": true,
11168
- "destructive": true,
11169
- "confirm": true,
11276
+ "destructive": false,
11277
+ "confirm": false,
11170
11278
  "immediate": false,
11171
11279
  "uiEntry": "data-part-add-kind-assembly",
11172
- "example": {}
11280
+ "example": {
11281
+ "name": "Gearbox"
11282
+ }
11173
11283
  },
11174
11284
  {
11175
11285
  "name": "create_part",
11176
- "description": "Add a part row to the assembly. Agent calls default to the assembly origin (identity placement); pass position [x,y,z] mm to place explicitly. The UI still staggers new parts +40 mm on X so bodies do not overlap. In a git assembly the part has no vault path until git_save.",
11286
+ "description": "Add a part and make it the active part before returning. The result partId is a new opaque surf id, not the previously active part. When script is set, that script runs before the call returns (ok, errors, failures, status); a failed script still leaves the part. Agent calls default to the assembly origin; pass position [x,y,z] mm to place it. Working copy only: nothing reaches git without git_save.",
11177
11287
  "args": {
11178
11288
  "type": "object",
11179
11289
  "additionalProperties": false,
@@ -11201,6 +11311,7 @@
11201
11311
  },
11202
11312
  "errors": [
11203
11313
  "bad_args",
11314
+ "no_assembly",
11204
11315
  "internal"
11205
11316
  ],
11206
11317
  "mutates": true,
@@ -11214,7 +11325,7 @@
11214
11325
  },
11215
11326
  {
11216
11327
  "name": "rename_part",
11217
- "description": "Rename a part. A vault part moves its committed .js in the same folder (-2, -3 on collision) and updates that part path/name in .surf.json in one rename commit. Pending script, placement, and other edits stay for the next Save. Path-less parts rename locally with no commit. That write needs git consent like git_save.",
11328
+ "description": "Rename a part display name on the working copy. part_id is an opaque surf id; a path or name is unknown_part. Response { partId, name, moved: false }. No git write; the committed header updates on the next git_save.",
11218
11329
  "args": {
11219
11330
  "type": "object",
11220
11331
  "additionalProperties": false,
@@ -11225,11 +11336,11 @@
11225
11336
  "properties": {
11226
11337
  "part_id": {
11227
11338
  "type": "string",
11228
- "description": "Part row id from parts"
11339
+ "description": "Part id from parts. Not a vault path."
11229
11340
  },
11230
11341
  "name": {
11231
11342
  "type": "string",
11232
- "description": "New display name; a vault part moves the committed <name>.js (-2, -3 on collision). Pending edits stay for Save."
11343
+ "description": "New display name. Working copy only; Save writes the same f(id) file."
11233
11344
  }
11234
11345
  }
11235
11346
  },
@@ -11240,10 +11351,7 @@
11240
11351
  "errors": [
11241
11352
  "bad_args",
11242
11353
  "unknown_part",
11243
- "name_taken",
11244
- "consent_pending",
11245
- "real_repo_blocked",
11246
- "git_error",
11354
+ "no_assembly",
11247
11355
  "internal"
11248
11356
  ],
11249
11357
  "mutates": true,
@@ -11252,23 +11360,64 @@
11252
11360
  "immediate": false,
11253
11361
  "uiEntry": "data-part-name-input",
11254
11362
  "example": {
11255
- "part_id": "parts/Bracket.js",
11363
+ "part_id": "2026-10-07-20-56-31-0423-a3f9",
11256
11364
  "name": "Mount"
11257
11365
  }
11258
11366
  },
11367
+ {
11368
+ "name": "rename_assembly",
11369
+ "description": "Rename the open assembly display name. assembly_id is an opaque surf id, not the current name. Names may collide. Working copy only; moved is false. git_save writes the same assemblies/<id>.surf.json.",
11370
+ "args": {
11371
+ "type": "object",
11372
+ "additionalProperties": false,
11373
+ "required": [
11374
+ "assembly_id",
11375
+ "name"
11376
+ ],
11377
+ "properties": {
11378
+ "assembly_id": {
11379
+ "type": "string",
11380
+ "description": "Assembly surf-id from parts / list_assemblies."
11381
+ },
11382
+ "name": {
11383
+ "type": "string",
11384
+ "description": "New display label. Working copy only; not unique."
11385
+ }
11386
+ }
11387
+ },
11388
+ "result": {
11389
+ "type": "object",
11390
+ "additionalProperties": true
11391
+ },
11392
+ "errors": [
11393
+ "bad_args",
11394
+ "unknown_assembly",
11395
+ "no_assembly",
11396
+ "internal"
11397
+ ],
11398
+ "mutates": true,
11399
+ "destructive": false,
11400
+ "confirm": false,
11401
+ "immediate": false,
11402
+ "uiEntry": "data-assembly-rename-menu",
11403
+ "example": {
11404
+ "assembly_id": "2026-10-18-02-50-00-0001-aa01",
11405
+ "name": "Gearbox"
11406
+ }
11407
+ },
11259
11408
  {
11260
11409
  "name": "part_get_transform",
11261
- "description": "Read a part rigid placement: position [x,y,z] mm and rotation as intrinsic XYZ Euler degrees (three.js Euler XYZ order).",
11410
+ "description": "Read rigid placement by opaque part_id: position [x,y,z] mm and intrinsic XYZ Euler degrees. A vault path or display name is unknown_part. Does not fall back to the active part.",
11262
11411
  "args": {
11263
11412
  "type": "object",
11264
11413
  "additionalProperties": false,
11265
11414
  "required": [
11266
- "part"
11415
+ "part_id"
11267
11416
  ],
11268
11417
  "properties": {
11269
- "part": {
11418
+ "part_id": {
11270
11419
  "type": "string",
11271
- "description": "Stable part id or vault path."
11420
+ "description": "Part id from parts. Not a vault path."
11272
11421
  }
11273
11422
  }
11274
11423
  },
@@ -11279,6 +11428,9 @@
11279
11428
  "part": {
11280
11429
  "type": "string"
11281
11430
  },
11431
+ "partId": {
11432
+ "type": "string"
11433
+ },
11282
11434
  "position": {
11283
11435
  "type": "array",
11284
11436
  "items": {
@@ -11312,22 +11464,22 @@
11312
11464
  "immediate": true,
11313
11465
  "uiEntry": null,
11314
11466
  "example": {
11315
- "part": "local:part1"
11467
+ "part_id": "2026-10-07-20-56-31-0423-a3f9"
11316
11468
  }
11317
11469
  },
11318
11470
  {
11319
11471
  "name": "part_set_transform",
11320
- "description": "Set a part rigid placement (translation mm, intrinsic XYZ Euler degrees). Records one assembly undo step like a UI move.",
11472
+ "description": "Set rigid placement by opaque part_id (translation mm, intrinsic XYZ Euler degrees). One assembly undo step. A vault path or display name is unknown_part. Working copy only.",
11321
11473
  "args": {
11322
11474
  "type": "object",
11323
11475
  "additionalProperties": false,
11324
11476
  "required": [
11325
- "part"
11477
+ "part_id"
11326
11478
  ],
11327
11479
  "properties": {
11328
- "part": {
11480
+ "part_id": {
11329
11481
  "type": "string",
11330
- "description": "Stable part id or vault path to move."
11482
+ "description": "Part id from parts. Not a vault path."
11331
11483
  },
11332
11484
  "position": {
11333
11485
  "type": "array",
@@ -11356,6 +11508,9 @@
11356
11508
  "part": {
11357
11509
  "type": "string"
11358
11510
  },
11511
+ "partId": {
11512
+ "type": "string"
11513
+ },
11359
11514
  "position": {
11360
11515
  "type": "array",
11361
11516
  "items": {
@@ -11390,7 +11545,7 @@
11390
11545
  "immediate": false,
11391
11546
  "uiEntry": null,
11392
11547
  "example": {
11393
- "part": "local:part1",
11548
+ "part_id": "2026-10-07-20-56-31-0423-a3f9",
11394
11549
  "position": [
11395
11550
  10,
11396
11551
  0,
@@ -11400,17 +11555,17 @@
11400
11555
  },
11401
11556
  {
11402
11557
  "name": "open_assembly",
11403
- "description": "Open a vault assembly (git mode).",
11558
+ "description": "Open a vault assembly by opaque assembly_id only. A name or path is unknown_assembly. Does not write git.",
11404
11559
  "args": {
11405
11560
  "type": "object",
11406
11561
  "additionalProperties": false,
11407
11562
  "required": [
11408
- "name"
11563
+ "assembly_id"
11409
11564
  ],
11410
11565
  "properties": {
11411
- "name": {
11566
+ "assembly_id": {
11412
11567
  "type": "string",
11413
- "description": "Vault assembly name"
11568
+ "description": "Assembly surf-id from list_assemblies. Not a name or path."
11414
11569
  }
11415
11570
  }
11416
11571
  },
@@ -11420,33 +11575,37 @@
11420
11575
  },
11421
11576
  "errors": [
11422
11577
  "bad_args",
11578
+ "unknown_assembly",
11579
+ "git_only",
11580
+ "git_blocked",
11423
11581
  "internal"
11424
11582
  ],
11425
11583
  "mutates": true,
11426
- "destructive": true,
11427
- "confirm": true,
11584
+ "destructive": false,
11585
+ "confirm": false,
11428
11586
  "immediate": false,
11429
11587
  "uiEntry": [
11430
11588
  "data-part-open-action-assembly",
11431
11589
  "data-git-open-replace"
11432
11590
  ],
11433
11591
  "example": {
11434
- "name": "my-assembly"
11592
+ "assembly_id": "2026-10-18-02-50-00-0001-aa01"
11435
11593
  }
11436
11594
  },
11437
11595
  {
11438
11596
  "name": "open_part",
11439
- "description": "Open or link a vault part into the assembly.",
11597
+ "description": "Open a vault part by opaque part_id and/or assembly_id into the current assembly (reference). No path or name lookup. Does not write git.",
11440
11598
  "args": {
11441
11599
  "type": "object",
11442
11600
  "additionalProperties": false,
11443
- "required": [
11444
- "path"
11445
- ],
11446
11601
  "properties": {
11447
- "path": {
11602
+ "part_id": {
11448
11603
  "type": "string",
11449
- "description": "Vault part path"
11604
+ "description": "Part surf-id to open by reference into the current assembly."
11605
+ },
11606
+ "assembly_id": {
11607
+ "type": "string",
11608
+ "description": "Assembly surf-id whose parts are opened by reference."
11450
11609
  }
11451
11610
  }
11452
11611
  },
@@ -11456,6 +11615,9 @@
11456
11615
  },
11457
11616
  "errors": [
11458
11617
  "bad_args",
11618
+ "unknown_part",
11619
+ "unknown_assembly",
11620
+ "git_only",
11459
11621
  "internal"
11460
11622
  ],
11461
11623
  "mutates": true,
@@ -11464,19 +11626,27 @@
11464
11626
  "immediate": false,
11465
11627
  "uiEntry": "data-part-open-action-part",
11466
11628
  "example": {
11467
- "path": "parts/Bracket.js"
11629
+ "part_id": "2026-10-07-20-56-31-0423-a3f9"
11468
11630
  }
11469
11631
  },
11470
11632
  {
11471
11633
  "name": "insert_part",
11472
- "description": "Insert another assembly or add a new local part row.",
11634
+ "description": "Insert-as-reference by opaque part_id, or every part of assembly_id (same ids). copy:true mints a new part id and sets copiedFrom. A path or name is unknown_part / unknown_assembly. Does not write git.",
11473
11635
  "args": {
11474
11636
  "type": "object",
11475
11637
  "additionalProperties": false,
11476
11638
  "properties": {
11477
- "source_assembly": {
11639
+ "part_id": {
11478
11640
  "type": "string",
11479
- "description": "Git vault assembly to insert from"
11641
+ "description": "Part surf-id to insert as a reference (same id)."
11642
+ },
11643
+ "assembly_id": {
11644
+ "type": "string",
11645
+ "description": "Insert every part of this assembly as references."
11646
+ },
11647
+ "copy": {
11648
+ "type": "boolean",
11649
+ "description": "Mint a new part id and set copiedFrom (independent file)."
11480
11650
  },
11481
11651
  "name": {
11482
11652
  "type": "string",
@@ -11493,6 +11663,9 @@
11493
11663
  },
11494
11664
  "errors": [
11495
11665
  "bad_args",
11666
+ "unknown_part",
11667
+ "unknown_assembly",
11668
+ "git_only",
11496
11669
  "internal"
11497
11670
  ],
11498
11671
  "mutates": true,
@@ -11501,7 +11674,128 @@
11501
11674
  "immediate": false,
11502
11675
  "uiEntry": "data-git-open-insert",
11503
11676
  "example": {
11504
- "name": "Pin"
11677
+ "part_id": "2026-10-07-20-56-31-0423-a3f9"
11678
+ }
11679
+ },
11680
+ {
11681
+ "name": "list_assemblies",
11682
+ "description": "List vault assemblies as [{ id, name }]. id is an opaque surf id; name is a label, not a key. No path field. Git-only.",
11683
+ "args": {
11684
+ "type": "object",
11685
+ "additionalProperties": false,
11686
+ "properties": {}
11687
+ },
11688
+ "result": {
11689
+ "type": "object",
11690
+ "additionalProperties": true
11691
+ },
11692
+ "errors": [
11693
+ "git_only",
11694
+ "git_blocked",
11695
+ "internal"
11696
+ ],
11697
+ "mutates": false,
11698
+ "destructive": false,
11699
+ "confirm": false,
11700
+ "immediate": true,
11701
+ "uiEntry": null,
11702
+ "example": {}
11703
+ },
11704
+ {
11705
+ "name": "delete_part",
11706
+ "description": "Drop a part by opaque part_id (a path or name is unknown_part). scope assembly removes the row. scope repo also plans a file delete on the next Save and requires confirm: true. Neither scope commits. part_still_referenced if another assembly lists the id.",
11707
+ "args": {
11708
+ "type": "object",
11709
+ "additionalProperties": false,
11710
+ "required": [
11711
+ "part_id",
11712
+ "scope"
11713
+ ],
11714
+ "properties": {
11715
+ "part_id": {
11716
+ "type": "string",
11717
+ "description": "Part id from parts. Not a vault path."
11718
+ },
11719
+ "scope": {
11720
+ "type": "string",
11721
+ "enum": [
11722
+ "assembly",
11723
+ "repo"
11724
+ ],
11725
+ "description": "assembly drops the row; repo also plans a file delete on the next Save."
11726
+ },
11727
+ "confirm": {
11728
+ "type": "boolean",
11729
+ "description": "Required true when scope is repo."
11730
+ }
11731
+ }
11732
+ },
11733
+ "result": {
11734
+ "type": "object",
11735
+ "additionalProperties": true
11736
+ },
11737
+ "errors": [
11738
+ "bad_args",
11739
+ "unknown_part",
11740
+ "confirm_required",
11741
+ "part_still_referenced",
11742
+ "no_assembly",
11743
+ "internal"
11744
+ ],
11745
+ "mutates": true,
11746
+ "destructive": true,
11747
+ "confirm": true,
11748
+ "immediate": false,
11749
+ "uiEntry": null,
11750
+ "example": {
11751
+ "part_id": "2026-10-07-20-56-31-0423-a3f9",
11752
+ "scope": "assembly"
11753
+ }
11754
+ },
11755
+ {
11756
+ "name": "delete_assembly",
11757
+ "description": "Delete the open assembly by opaque assembly_id. Requires confirm: true. delete_parts plans unreferenced part-file deletes on the next Save. No git write until git_save.",
11758
+ "args": {
11759
+ "type": "object",
11760
+ "additionalProperties": false,
11761
+ "required": [
11762
+ "assembly_id"
11763
+ ],
11764
+ "properties": {
11765
+ "assembly_id": {
11766
+ "type": "string",
11767
+ "description": "Assembly surf-id. Not a name or path."
11768
+ },
11769
+ "confirm": {
11770
+ "type": "boolean",
11771
+ "description": "Must be true."
11772
+ },
11773
+ "delete_parts": {
11774
+ "type": "boolean",
11775
+ "description": "When true, plan part-file deletes on the next Save if unreferenced."
11776
+ }
11777
+ }
11778
+ },
11779
+ "result": {
11780
+ "type": "object",
11781
+ "additionalProperties": true
11782
+ },
11783
+ "errors": [
11784
+ "bad_args",
11785
+ "unknown_assembly",
11786
+ "confirm_required",
11787
+ "upgrade_required",
11788
+ "no_assembly",
11789
+ "internal"
11790
+ ],
11791
+ "mutates": true,
11792
+ "destructive": true,
11793
+ "confirm": true,
11794
+ "immediate": false,
11795
+ "uiEntry": null,
11796
+ "example": {
11797
+ "assembly_id": "2026-10-18-02-50-00-0001-aa01",
11798
+ "confirm": true
11505
11799
  }
11506
11800
  },
11507
11801
  {
@@ -13875,6 +14169,68 @@
13875
14169
  "id": "l0"
13876
14170
  }
13877
14171
  },
14172
+ {
14173
+ "name": "agent_prompt",
14174
+ "description": "Send a prompt from the floating in-viewer field, or stop, dismiss, or attach a viewer screenshot. Does not edit a part and does not write git.",
14175
+ "args": {
14176
+ "type": "object",
14177
+ "additionalProperties": false,
14178
+ "properties": {
14179
+ "text": {
14180
+ "type": "string",
14181
+ "maxLength": 8000,
14182
+ "description": "Prompt text to send to the paired agent"
14183
+ },
14184
+ "action": {
14185
+ "type": "string",
14186
+ "enum": [
14187
+ "send",
14188
+ "stop",
14189
+ "dismiss",
14190
+ "screenshot"
14191
+ ],
14192
+ "description": "send is the default when text is present"
14193
+ }
14194
+ }
14195
+ },
14196
+ "result": {
14197
+ "type": "object",
14198
+ "additionalProperties": false,
14199
+ "properties": {
14200
+ "ok": {
14201
+ "type": "boolean"
14202
+ },
14203
+ "id": {
14204
+ "type": "string"
14205
+ },
14206
+ "attached": {
14207
+ "type": "boolean"
14208
+ },
14209
+ "reason": {
14210
+ "type": "string"
14211
+ }
14212
+ }
14213
+ },
14214
+ "errors": [
14215
+ "bad_args",
14216
+ "unavailable",
14217
+ "internal"
14218
+ ],
14219
+ "mutates": false,
14220
+ "destructive": false,
14221
+ "confirm": false,
14222
+ "immediate": true,
14223
+ "uiEntry": [
14224
+ "data-agent-prompt-send",
14225
+ "data-agent-prompt-stop",
14226
+ "data-agent-prompt-dismiss",
14227
+ "data-agent-prompt-screenshot"
14228
+ ],
14229
+ "example": {
14230
+ "text": "Add a 2 mm fillet on the cut-out corners",
14231
+ "action": "send"
14232
+ }
14233
+ },
13878
14234
  {
13879
14235
  "name": "fea_open",
13880
14236
  "description": "Bridge command fea_open.",
@@ -15158,7 +15514,7 @@
15158
15514
  },
15159
15515
  {
15160
15516
  "name": "git_save",
15161
- "description": "Save like the Parts Save button: give every path-less part a vault path, then commit those parts, dirty parts, and the .surf.json in one commit on the current branch. A real repo returns consent_pending at once until the user clicks Allow; retry after.",
15517
+ "description": "The only vault content write, same planSave path as the Save button. message required. Working-copy tools do not commit. consent_pending: Allow dialog is up; retry the same call after the user clicks Allow. pending_save: an offline plan is waiting; Save again when online. upgrade_required: legacy vault; call git_upgrade_vault { confirm: true } after the user agrees. conflict or repo-moved: a remote edit overlaps this Save; git_force_overwrite, or git_behind_resolve { action: \"reload\" | \"branch\", confirm: true }, or stop. Results omit path fields.",
15162
15518
  "args": {
15163
15519
  "type": "object",
15164
15520
  "additionalProperties": false,
@@ -15178,6 +15534,10 @@
15178
15534
  },
15179
15535
  "errors": [
15180
15536
  "bad_args",
15537
+ "upgrade_required",
15538
+ "conflict",
15539
+ "repo-moved",
15540
+ "pending_save",
15181
15541
  "git_blocked",
15182
15542
  "consent_pending",
15183
15543
  "real_repo_blocked",
@@ -15195,19 +15555,124 @@
15195
15555
  "message": "Update bracket"
15196
15556
  }
15197
15557
  },
15558
+ {
15559
+ "name": "git_upgrade_vault",
15560
+ "description": "Upgrade a legacy (v1 folder-layout) vault to v2 in one commit of remote tip bytes, then Save a dirty working copy as a second commit under the same confirmation. Requires confirm: true. Never runs on load. Off by default in this build (upgrade_unavailable) until v2 open/save land; tests and the Vite dev server can opt in. On v2 returns already_upgraded. Success is a summary: status, commit SHAs, assemblyIds, counts, leftoverFiles paths, and warnings — not the full plan, file contents, meshes, partBindings paths, or rekey.scripts.",
15561
+ "args": {
15562
+ "type": "object",
15563
+ "additionalProperties": false,
15564
+ "properties": {
15565
+ "confirm": {
15566
+ "type": "boolean",
15567
+ "description": "Must be true"
15568
+ }
15569
+ }
15570
+ },
15571
+ "result": {
15572
+ "type": "object",
15573
+ "additionalProperties": false,
15574
+ "properties": {
15575
+ "status": {
15576
+ "type": "string"
15577
+ },
15578
+ "sha": {
15579
+ "type": "string"
15580
+ },
15581
+ "upgradeSha": {
15582
+ "type": "string"
15583
+ },
15584
+ "branch": {
15585
+ "type": "string"
15586
+ },
15587
+ "commits": {
15588
+ "type": "integer"
15589
+ },
15590
+ "layout": {
15591
+ "type": "string"
15592
+ },
15593
+ "assemblyIds": {
15594
+ "type": "array",
15595
+ "items": {
15596
+ "type": "string"
15597
+ }
15598
+ },
15599
+ "counts": {
15600
+ "type": "object",
15601
+ "additionalProperties": false,
15602
+ "properties": {
15603
+ "commits": {
15604
+ "type": "integer"
15605
+ },
15606
+ "assemblies": {
15607
+ "type": "integer"
15608
+ },
15609
+ "partsKept": {
15610
+ "type": "integer"
15611
+ },
15612
+ "partsMinted": {
15613
+ "type": "integer"
15614
+ },
15615
+ "files": {
15616
+ "type": "integer"
15617
+ },
15618
+ "leftoverFiles": {
15619
+ "type": "integer"
15620
+ }
15621
+ }
15622
+ },
15623
+ "leftoverFiles": {
15624
+ "type": "array",
15625
+ "items": {
15626
+ "type": "string"
15627
+ }
15628
+ },
15629
+ "warnings": {
15630
+ "type": "array",
15631
+ "items": {
15632
+ "type": "string"
15633
+ }
15634
+ },
15635
+ "error": {
15636
+ "type": "string"
15637
+ }
15638
+ }
15639
+ },
15640
+ "errors": [
15641
+ "confirm_required",
15642
+ "upgrade_unavailable",
15643
+ "conflict",
15644
+ "git_blocked",
15645
+ "consent_pending",
15646
+ "real_repo_blocked",
15647
+ "git_error",
15648
+ "working_copy_unpersisted",
15649
+ "internal"
15650
+ ],
15651
+ "mutates": true,
15652
+ "destructive": true,
15653
+ "confirm": true,
15654
+ "immediate": false,
15655
+ "uiEntry": [
15656
+ "data-git-upgrade-confirm",
15657
+ "data-git-upgrade-vault"
15658
+ ],
15659
+ "example": {
15660
+ "confirm": true
15661
+ }
15662
+ },
15198
15663
  {
15199
15664
  "name": "git_add_to_repo",
15200
- "description": "Add a part row into the vault tree and commit. Other path-less parts are pathed and committed with it so the .surf.json stays valid.",
15665
+ "description": "Alias of git_save. Prefer git_save. Same planSave / writeVaultCommit path. Message required. Results omit path fields.",
15201
15666
  "args": {
15202
15667
  "type": "object",
15203
15668
  "additionalProperties": false,
15204
15669
  "required": [
15205
- "part_id"
15670
+ "message"
15206
15671
  ],
15207
15672
  "properties": {
15208
- "part_id": {
15673
+ "message": {
15209
15674
  "type": "string",
15210
- "description": "Part row id to add under the vault layout"
15675
+ "description": "Commit message. Alias of git_save; prefer git_save."
15211
15676
  }
15212
15677
  }
15213
15678
  },
@@ -15217,6 +15682,10 @@
15217
15682
  },
15218
15683
  "errors": [
15219
15684
  "bad_args",
15685
+ "upgrade_required",
15686
+ "conflict",
15687
+ "repo-moved",
15688
+ "pending_save",
15220
15689
  "git_blocked",
15221
15690
  "consent_pending",
15222
15691
  "real_repo_blocked",
@@ -15231,12 +15700,12 @@
15231
15700
  "data-part-add-to-repo"
15232
15701
  ],
15233
15702
  "example": {
15234
- "part_id": "parts/Bracket.js"
15703
+ "message": "Add to repo"
15235
15704
  }
15236
15705
  },
15237
15706
  {
15238
15707
  "name": "git_behind_resolve",
15239
- "description": "Resolve behind-remote: keep mine, reload, or branch.",
15708
+ "description": "Conflict / main-moved choice. action reload = Get latest (not a git write). action branch = Save mine to a new branch. Both require confirm: true. action keep is removed (Dismiss is not a tool). No path argument.",
15240
15709
  "args": {
15241
15710
  "type": "object",
15242
15711
  "additionalProperties": false,
@@ -15247,23 +15716,14 @@
15247
15716
  "action": {
15248
15717
  "type": "string",
15249
15718
  "enum": [
15250
- "keep",
15251
15719
  "reload",
15252
15720
  "branch"
15253
15721
  ],
15254
- "description": "Get latest choice: keep mine, reload remote, or park mine on a branch"
15722
+ "description": "reload = Get latest (no git write). branch = Save mine to a new branch. keep is removed."
15255
15723
  },
15256
- "path": {
15257
- "type": "string",
15258
- "description": "Vault path (assembly or part file)"
15259
- },
15260
- "kind": {
15261
- "type": "string",
15262
- "enum": [
15263
- "part",
15264
- "assembly"
15265
- ],
15266
- "description": "Defaults from path when omitted"
15724
+ "confirm": {
15725
+ "type": "boolean",
15726
+ "description": "Must be true."
15267
15727
  }
15268
15728
  }
15269
15729
  },
@@ -15274,6 +15734,8 @@
15274
15734
  "errors": [
15275
15735
  "bad_args",
15276
15736
  "confirm_required",
15737
+ "conflict",
15738
+ "repo-moved",
15277
15739
  "git_blocked",
15278
15740
  "consent_pending",
15279
15741
  "real_repo_blocked",
@@ -15284,14 +15746,12 @@
15284
15746
  "confirm": true,
15285
15747
  "immediate": false,
15286
15748
  "uiEntry": [
15287
- "data-git-behind-keep",
15288
15749
  "data-git-behind-reload",
15289
15750
  "data-git-behind-branch"
15290
15751
  ],
15291
15752
  "example": {
15292
- "action": "keep",
15293
- "path": "assemblies/demo.surf.json",
15294
- "kind": "assembly"
15753
+ "action": "reload",
15754
+ "confirm": true
15295
15755
  }
15296
15756
  },
15297
15757
  {
@@ -15436,6 +15896,8 @@
15436
15896
  },
15437
15897
  "errors": [
15438
15898
  "confirm_required",
15899
+ "conflict",
15900
+ "repo-moved",
15439
15901
  "git_blocked",
15440
15902
  "consent_pending",
15441
15903
  "real_repo_blocked",
@@ -15477,7 +15939,7 @@
15477
15939
  },
15478
15940
  {
15479
15941
  "name": "export_part",
15480
- "description": "Export the active (or named) part mesh as STL, 3MF, or STEP bytes, or trigger a browser download.",
15942
+ "description": "Export the active part mesh, or part_id when set (an opaque surf id, never a path or display name), as STL, 3MF, or STEP bytes, or trigger a browser download.",
15481
15943
  "args": {
15482
15944
  "type": "object",
15483
15945
  "additionalProperties": false,