@maslowcnc/abundance-bridge 0.1.6 → 0.1.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/dist/index.js +81 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -138,7 +138,7 @@ var TOOLS = [
|
|
|
138
138
|
{
|
|
139
139
|
name: "get_atom",
|
|
140
140
|
permission: "read",
|
|
141
|
-
description: "Everything about one atom: status and error, inputs and what feeds them, what its output feeds, its editable parameters (the same fields the user sees in the properties panel, used with set_param), code and console output for Code atoms, and a summary of its computed value (geometry type, bounding box, part count, tags, and the reference files it carries: images, PDF pages, and 3D models, each with its bounding box in project units). geometry_warnings lists parts with broken geometry: invalid shapes, faces that fail to mesh (they render see-through), and sliver faces; it checks for a few seconds, and check_geometry covers the rest. For a GitHub molecule made in other units than the project, units gives the units its number inputs take, the scale applied to geometry wired into it, and the scale applied to its output to convert it to the project's units. With part, it also describes that one part." + UNTRUSTED_NOTE,
|
|
141
|
+
description: "Everything about one atom: status and error, inputs and what feeds them (an input that acts on picked edges, faces, or parts says so in selects, with its picks), what its output feeds, its editable parameters (the same fields the user sees in the properties panel, used with set_param), code and console output for Code atoms, and a summary of its computed value (geometry type, bounding box, part count, tags, and the reference files it carries: images, PDF pages, and 3D models, each with its bounding box in project units). geometry_warnings lists parts with broken geometry: invalid shapes, faces that fail to mesh (they render see-through), and sliver faces; it checks for a few seconds, and check_geometry covers the rest. For a GitHub molecule made in other units than the project, units gives the units its number inputs take, the scale applied to geometry wired into it, and the scale applied to its output to convert it to the project's units. With part, it also describes that one part." + UNTRUSTED_NOTE,
|
|
142
142
|
inputSchema: {
|
|
143
143
|
type: "object",
|
|
144
144
|
properties: { atom: ATOM_REF, part: PART_INDEX },
|
|
@@ -598,13 +598,13 @@ var TOOLS = [
|
|
|
598
598
|
{
|
|
599
599
|
name: "export_geometry",
|
|
600
600
|
permission: "read",
|
|
601
|
-
description: "Export an atom's output to STL, STEP, or SVG. The bridge writes the file to disk and returns its path.",
|
|
601
|
+
description: "Export an atom's output to STL, STEP, GLB, or SVG. GLB keeps each part as its own colored mesh, in meters. The bridge writes the file to disk and returns its path.",
|
|
602
602
|
output: "file",
|
|
603
603
|
inputSchema: {
|
|
604
604
|
type: "object",
|
|
605
605
|
properties: {
|
|
606
606
|
atom: OPTIONAL_ATOM_REF,
|
|
607
|
-
format: { type: "string", enum: ["STL", "STEP", "SVG"] },
|
|
607
|
+
format: { type: "string", enum: ["STL", "STEP", "GLB", "SVG"] },
|
|
608
608
|
output_path: {
|
|
609
609
|
type: "string",
|
|
610
610
|
description: "Where to write the file. Defaults to the bridge output directory."
|
|
@@ -661,7 +661,7 @@ var TOOLS = [
|
|
|
661
661
|
{
|
|
662
662
|
name: "set_param",
|
|
663
663
|
permission: "edit",
|
|
664
|
-
description: "Change one editable parameter of an atom, exactly as if the user typed it in the properties panel. Use the param label from get_atom. Numbers may be given as equations that reference other inputs by name.",
|
|
664
|
+
description: "Change one editable parameter of an atom, exactly as if the user typed it in the properties panel. Use the param label from get_atom. Numbers may be given as equations that reference other inputs by name. Array params, such as an array Input's Default Values or a molecule's array input, take a list.",
|
|
665
665
|
inputSchema: {
|
|
666
666
|
type: "object",
|
|
667
667
|
properties: {
|
|
@@ -671,12 +671,82 @@ var TOOLS = [
|
|
|
671
671
|
description: "Parameter label from get_atom's params list."
|
|
672
672
|
},
|
|
673
673
|
value: {
|
|
674
|
-
description: "New value: number, string, boolean,
|
|
674
|
+
description: "New value: number, string, boolean, [x, y, z] for points, or a list such as [10, 20, 35] for array params."
|
|
675
675
|
}
|
|
676
676
|
},
|
|
677
677
|
required: ["atom", "param", "value"]
|
|
678
678
|
}
|
|
679
679
|
},
|
|
680
|
+
{
|
|
681
|
+
name: "set_input_selection",
|
|
682
|
+
permission: "edit",
|
|
683
|
+
description: "Pick the edges, faces, or parts that a molecule's edge-select, face-select, or part-select input acts on, as the user does with its Select Edges, Select Faces, or Select Parts button. Molecules such as fillets of chosen edges or a wire between two round edges take their picks this way; get_atom marks these inputs with selects and lists their picks. Connect the shape to the input first: connecting a new shape clears its picks. This waits for the shape to compute. Each pick is the edge, face, or part passing nearest point; or the one whose center is nearest center (a circle's or arc's center, a straight edge's midpoint, a face's center), best for a hole or a pin end given with type circle; or part and index from an earlier result. The picks replace the input's current ones unless add is true; an empty list clears them. Returns each pick's type, position, and size (a circle's center, radius, and axis) and the next nearest candidates with their distances, to check it picked what you meant. Circles are often drawn as two half-circle arcs: as_near counts others just as near, and all_nearest picks them too, such as a whole hole rim to fillet. Picks are stored by number, so pick again after changing the shape wired in.",
|
|
684
|
+
inputSchema: {
|
|
685
|
+
type: "object",
|
|
686
|
+
properties: {
|
|
687
|
+
atom: {
|
|
688
|
+
...ATOM_REF,
|
|
689
|
+
description: ATOM_REF.description + " The molecule (or imported GitHub molecule) whose input to set."
|
|
690
|
+
},
|
|
691
|
+
input: {
|
|
692
|
+
type: "string",
|
|
693
|
+
description: "The input's name, as get_atom lists it."
|
|
694
|
+
},
|
|
695
|
+
picks: {
|
|
696
|
+
type: "array",
|
|
697
|
+
description: "What to pick, in project coordinates and units. Each is { point } or { center }, optionally with type and part, or { part, index }. A part-select input takes { part } or { point }.",
|
|
698
|
+
items: {
|
|
699
|
+
type: "object",
|
|
700
|
+
properties: {
|
|
701
|
+
point: {
|
|
702
|
+
...POINT3,
|
|
703
|
+
description: "Pick what passes nearest this point, such as a point on the edge or face."
|
|
704
|
+
},
|
|
705
|
+
center: {
|
|
706
|
+
...POINT3,
|
|
707
|
+
description: "Pick what has its center nearest this point, such as the center of a hole's rim."
|
|
708
|
+
},
|
|
709
|
+
type: {
|
|
710
|
+
type: "string",
|
|
711
|
+
enum: [
|
|
712
|
+
"line",
|
|
713
|
+
"circle",
|
|
714
|
+
"ellipse",
|
|
715
|
+
"curve",
|
|
716
|
+
"plane",
|
|
717
|
+
"cylinder",
|
|
718
|
+
"cone",
|
|
719
|
+
"sphere",
|
|
720
|
+
"torus",
|
|
721
|
+
"curved"
|
|
722
|
+
],
|
|
723
|
+
description: "Only edges (line, circle, ellipse, curve) or faces (plane, cylinder, cone, sphere, torus, curved) of this type."
|
|
724
|
+
},
|
|
725
|
+
part: {
|
|
726
|
+
type: "integer",
|
|
727
|
+
minimum: 0,
|
|
728
|
+
description: "Only this part of the shape wired in, numbered from 0 as other tools number parts."
|
|
729
|
+
},
|
|
730
|
+
index: {
|
|
731
|
+
type: "integer",
|
|
732
|
+
minimum: 0,
|
|
733
|
+
description: "With part: this edge or face, numbered as an earlier result gave it."
|
|
734
|
+
},
|
|
735
|
+
all_nearest: {
|
|
736
|
+
type: "boolean",
|
|
737
|
+
description: "Also pick everything just as near, such as the other arc of a circle drawn as two half circles."
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
add: {
|
|
743
|
+
type: "boolean",
|
|
744
|
+
description: "Keep the input's current picks and add these."
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
required: ["atom", "input", "picks"]
|
|
748
|
+
}
|
|
749
|
+
},
|
|
680
750
|
{
|
|
681
751
|
name: "set_code",
|
|
682
752
|
permission: "edit",
|
|
@@ -748,7 +818,7 @@ var TOOLS = [
|
|
|
748
818
|
{
|
|
749
819
|
name: "import_file",
|
|
750
820
|
permission: "edit",
|
|
751
|
-
description: "Add an Import atom that loads a file, like the editor's Load File button. STEP, STL, and SVG files become geometry. PNG, JPG, PDF, GLB, and glTF files become references to model against: an image
|
|
821
|
+
description: "Add an Import atom that loads a file, like the editor's Load File button. STEP, STL, and SVG files become geometry. PNG, JPG, PDF, GLB, and glTF files become references to model against: an image lies flat on the XY plane, centered on the origin, and a PDF's pages lie in a row along +X with page 1 centered on the origin (set Page to show one page); a 3D model (such as a scan) keeps its position in the file, converted from meters (glTF's unit; set File Units if it's in others). References show and move with geometry, but they aren't shapes: operations that need shapes, such as Difference or an Assembly with Make Disjoint on, reject them. Give a url to link a file in a public GitHub repository (nothing is uploaded), or the path of a file on this computer to upload it into the project's repository, so it opens with the project from then on. Imported geometry keeps the position and orientation it has in the file: place it with Move and Rotate atoms. Returns the atom's ID and path; call wait_for_settle, then get_atom or render_image to see what loaded.",
|
|
752
822
|
inputSchema: {
|
|
753
823
|
type: "object",
|
|
754
824
|
properties: {
|
|
@@ -874,7 +944,7 @@ var TOOLS = [
|
|
|
874
944
|
{
|
|
875
945
|
name: "apply_edits",
|
|
876
946
|
permission: "edit",
|
|
877
|
-
description: "Run several edit tools (set_param, set_code, add_atom, add_github_molecule, import_file, connect, disconnect, delete_atoms, group_atoms) as one change that the user can undo in a single step. Later edits may refer to atoms added earlier in the batch by their ref (or name).",
|
|
947
|
+
description: "Run several edit tools (set_param, set_input_selection, set_code, add_atom, add_github_molecule, import_file, connect, disconnect, delete_atoms, group_atoms) as one change that the user can undo in a single step. Later edits may refer to atoms added earlier in the batch by their ref (or name).",
|
|
878
948
|
inputSchema: {
|
|
879
949
|
type: "object",
|
|
880
950
|
properties: {
|
|
@@ -1103,7 +1173,7 @@ var MODELING_GUIDE = `Understand before changing:
|
|
|
1103
1173
|
Model against reference files: images, PDFs, and 3D models.
|
|
1104
1174
|
- import_file loads PNG, JPG, PDF, GLB, and glTF files as references, from a GitHub url or from a file on this computer (uploaded into the project's repository, so it stays with the project for later sessions). Use them for what you model against: a photo or drawing of the part, a floor plan, a datasheet, a 3D scan of the space or object a part must fit.
|
|
1105
1175
|
- A reference is a part of geometry type image (PNG or JPG), pdf, or gltf (GLB or glTF). It shows in the 3D view and in render_image wherever its value goes, and Move, Rotate, and unit conversion place it like geometry. It isn't a shape, so operations that need shapes reject it with an error: Difference, Intersection, Fusion, Extrude, Fillet, Chamfer, Loft, and an Assembly with Make Disjoint on. To see a plan or scan with the parts you model, assemble them with Make Disjoint turned off. Tag and Extract Tag select references by tag, and the bill of materials reads their BOM tags like any part's; Cut Layout, Cut Orient, G-code, and exports leave them out.
|
|
1106
|
-
- An image or PDF page lies flat on the XY plane, centered on the origin and read from above; set its Width on the Import atom to its real size (a PDF defaults to its printed page size). A 3D model keeps its position in the file, converted from meters (set File Units if it's in other units) and turned from glTF's Y-up to Z-up.
|
|
1176
|
+
- An image or PDF page lies flat on the XY plane, centered on the origin and read from above; set its Width on the Import atom to its real size (a PDF defaults to its printed page size). A PDF shows all its pages in a row along +X, page 1 centered on the origin and Width setting each page's scale; set the Import atom's Page to one page number to show just that page, centered on the origin. A 3D model keeps its position in the file, converted from meters (set File Units if it's in other units) and turned from glTF's Y-up to Z-up.
|
|
1107
1177
|
- A scan arrives wherever the scanner left it: usually tilted a little, turned at some angle to X and Y, and with its floor off Z = 0. Align it before modeling against it: measure_scan gives the Rotate and Move that level it and square its walls to X and Y; wire the Import atom through them, model against the Move's output, and run measure_scan on that output to confirm. Parts modeled in aligned coordinates are square boxes with round-number positions instead of angled ones.
|
|
1108
1178
|
- Measure a scan with measure_scan (its floor, ceiling, and the large flat surfaces facing each way, with offsets and extents) and section_view (a plan or vertical section through the scan, drawn on a grid in project units), not by exporting it and writing your own analysis. Scans are noisy, warp slightly over a room, and miss glass and dark surfaces, so cut several sections and check the photos where they disagree. get_atom gives a reference's bounding box.
|
|
1109
1179
|
- Check parts against the scan with section_view on an Assembly of both: the parts' cut (red) should run along the scan's (dark gray). Look with render_image from several views too.
|
|
@@ -1130,6 +1200,7 @@ Inside each part's molecule, build with what Abundance already has, in this orde
|
|
|
1130
1200
|
1. Built-in atoms (list_atom_types shows each one's inputs): shapes (Rectangle, Circle, RegularPolygon, Text), actions (Extrude, Move, Rotate), interactions (Difference, Intersection, Assembly, Fusion, Loft, ShrinkWrap), Equation and Constant for math, Tag for cut lists and Add-BOM-Tag for purchased parts.
|
|
1131
1201
|
2. Library molecules: list_library_molecules lists the most-used shared molecules (patterns such as RotatePattern and Linear-Pattern, rounded rectangles, 2D offsets, fillets on selected edges, cross sections, measurements). Import them with add_github_molecule, then wire and set their inputs like any atom.
|
|
1132
1202
|
search_molecules searches every public project for more. Shared tools do jobs that are hard to build yourself, such as unrolling a curved surface flat for cutting, visualizing curvature, and specialty joints and hardware. Before a Code atom or a long chain of built-ins, search with a few plain words for the job and their synonyms (flatten, unroll, develop), and prefer results tagged abundance-tool or used widely. add_github_molecule returns a molecule's inputs; get_readme on it explains how to use it.
|
|
1203
|
+
Some molecules act on edges, faces, or parts picked on the shape wired in, such as a fillet of chosen edges or a wire between two round edges; get_atom marks those inputs with selects and lists their picks. Connect the shape first, since connecting a new one clears the picks, then pick with set_input_selection: a point on the edge or face, or the center of a hole or pin end with type circle. Circles are often two half-circle arcs, so add all_nearest to pick a whole rim. Check the type, center, and radius it returns and render_image the result. Picks are stored by number, so pick again after changing the shape wired in.
|
|
1133
1204
|
3. A Code atom only for what no combination of the above can do, such as a custom curve or geometry computed from a reference image's pixels, kept small and focused on that one job. A Code atom is never a shortcut for a long chain of built-ins: when a part has many features (holes, pockets, slots, channels, clearance around other hardware), give each feature a molecule of a few built-in atoms and cut them from the part with Difference, or with an Assembly and keepout geometry. The bridge enforces this: add_atom refuses a Code atom until list_atom_types and list_library_molecules (or search_molecules) have been called in this chat, and set_code refuses code made only of shapes and operations that built-in atoms already do.
|
|
1134
1205
|
Solid features from built-ins, every one a few atoms (add_atom takes params and inputs, so each atom is one call):
|
|
1135
1206
|
- A box: Rectangle (x length, y length) \u2192 Extrude (height) \u2192 Move. A rounded box: a rounded rectangle library molecule in place of Rectangle.
|
|
@@ -1174,7 +1245,7 @@ Keep the project description up to date:
|
|
|
1174
1245
|
|
|
1175
1246
|
Edit:
|
|
1176
1247
|
- Edit tools only work after the user ticks "Allow edits" in the AI agent chip at the top of the Abundance window. If edits are refused, ask them to, and don't retry until they have.
|
|
1177
|
-
- set_param uses the labels from get_atom's params. Number fields accept numbers or equations that reference inputs.
|
|
1248
|
+
- set_param uses the labels from get_atom's params. Number fields accept numbers or equations that reference inputs. Array fields take a list: set an array Input's defaults with its Default Values param, such as [40, 80, 120].
|
|
1178
1249
|
- Each edit is one undo step. Group related edits in apply_edits so the user can undo them together; if any edit in it fails, the whole batch rolls back.
|
|
1179
1250
|
- Edits recompute asynchronously: afterwards call wait_for_settle, check its errors, and confirm the result with render_image or get_atom bounding boxes before reporting success.
|
|
1180
1251
|
- add_atom takes params (labels from list_atom_types or get_atom, with their values) and inputs (input name to the atom that feeds it), so one call adds, sets up, and wires an atom.
|
|
@@ -1274,6 +1345,7 @@ function timeoutFor(name, args) {
|
|
|
1274
1345
|
case "locate_photo":
|
|
1275
1346
|
case "section_view":
|
|
1276
1347
|
case "import_file":
|
|
1348
|
+
case "set_input_selection":
|
|
1277
1349
|
case "check_geometry":
|
|
1278
1350
|
case "check_interference":
|
|
1279
1351
|
case "export_geometry":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maslowcnc/abundance-bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "MCP server that lets AI agents such as Claude inspect and edit the Abundance® CAD project open in your browser.",
|
|
5
5
|
"homepage": "https://abundance.maslowcnc.com",
|
|
6
6
|
"repository": {
|