diff --git a/.agents/skills/formblocks-driving/SKILL.md b/.agents/skills/formblocks-driving/SKILL.md index 10c3e7a..906173e 100644 --- a/.agents/skills/formblocks-driving/SKILL.md +++ b/.agents/skills/formblocks-driving/SKILL.md @@ -1,10 +1,10 @@ --- name: formblocks-driving -description: "Use when asked to build, stack, change, check, picture or save a brick model in FormBlocks through its MCP tools or ./formblocks cli: a wall, a tower, a house, a table, any LDraw model. Finds parts and colours in the LDraw parts library, places and seats bricks on placements or the ground, builds walls in overlapping courses with plates, tiles and slopes, moves, drags, turns, duplicates and recolours parts, uses the selection and submodels, splits a model into building steps and walks them, counts parts and saves the parts list as CSV, saves PNG pictures and reads them back to check a build, checks overlaps and floating parts, and opens, saves and exports .fblk, .ldr and .mpd files. Covers Claude Code, Codex, Cursor and Antigravity in the agent dock or outside it, and the person's approval, which an agent never gives itself. Includes worked examples, coordinates, error codes and scripts. Not for changing FormBlocks' source code, installing or building it (formblocks-harness)." +description: "Use when asked to build, stack, change, check, picture or save a brick model in FormBlocks through its MCP tools or ./formblocks cli: a wall, a tower, a house, a table, any LDraw model. Finds parts and colours in the LDraw parts library, places and seats bricks, clips and hinge halves on placements or the ground, builds walls in overlapping courses with plates, tiles and slopes, moves, turns, duplicates and recolours parts, uses the selection and submodels, splits a model into steps and walks them, counts parts and saves the parts list as CSV, saves PNG pictures and reads them back to check a build, checks overlaps, and opens, saves and exports .fblk, .ldr and .mpd files. Covers Claude Code, Codex, Cursor and Antigravity in the agent dock or outside it, and the person's approval, which an agent never gives itself. Includes worked examples, coordinates, error codes and scripts. Not for changing FormBlocks' source code or installing it (formblocks-harness)." license: Apache-2.0 metadata: product: FormBlocks - pack-version: "0.4.0" + pack-version: "0.5.0" audience: operating agent --- @@ -20,14 +20,17 @@ FormBlocks keeps one open model in its engine: submodels holding placements of L | Search words, categories, part numbers, moved parts, parts of other systems | `sub-skills/finding-parts/SUB-SKILL.md` | | Colour codes, colour names, finishes, colour 16 inside submodels, recolouring | `sub-skills/colours/SUB-SKILL.md` | | Studs and anti-studs, seating on a part or the ground, part.place, part.fit, on, seated, refused placements | `sub-skills/placing-and-snapping/SUB-SKILL.md` | +| Clips on bars, hinge halves, hinge plates and bricks, swivel plates, sliding a clip, folding a hinge, part.connectors kinds | `sub-skills/clips-and-hinges/SUB-SKILL.md` | | Planning a build, walls in overlapping courses, corners, openings, plates and tiles, roofs of slopes | `sub-skills/building-in-order/SUB-SKILL.md` | | Moving, turning, duplicating, recolouring, hiding, showing and deleting placements, undo and redo | `sub-skills/changing-parts/SUB-SKILL.md` | +| Turning parts by any angle, about a point, an axis or a hinge's axis, part.pivot, the angle step, a turn lifted or refused | `sub-skills/turning-parts/SUB-SKILL.md` | | Moving or copying parts along a pointer ray as the window drags them, part.pick, the scene's axes, resting across a gap, what the person's drags and Ctrl+D do | `sub-skills/moving-parts/SUB-SKILL.md` | | Reading and setting the selection, selecting by colour or part, showing the person which parts | `sub-skills/selection/SUB-SKILL.md` | | Packing repeated units into submodels, placing uses, editing inside one, unpacking, renaming, deleting | `sub-skills/submodels/SUB-SKILL.md` | | Building steps: what a sensible step is, adding, naming, moving and deleting steps, the step shown | `sub-skills/steps/SUB-SKILL.md` | | Walking the steps: step.goto by number or first, previous, next, last, what each step adds, dimmed earlier steps, leaving the step shown right | `sub-skills/step-walking/SUB-SKILL.md` | | New, open, save, save as, LDraw export, inserting a model, what `.fblk`, `.ldr`, `.mpd` and `.dat` keep | `sub-skills/files/SUB-SKILL.md` | +| What a model is: its name, description, author, licence, counts, size, file facts, missing parts, and setting them (the Info tab) | `sub-skills/model-information/SUB-SKILL.md` | | Checking a build: the overlap check, floating parts, reading the model back, counting parts | `sub-skills/checking-a-model/SUB-SKILL.md` | | The parts list: counts per part and colour, scopes, missing and moved parts, selecting a row's parts, saving it as CSV | `sub-skills/parts-list/SUB-SKILL.md` | | A picture of the model or of every step, and looking at your own build by saving a PNG and reading it back | `sub-skills/pictures/SUB-SKILL.md` | diff --git a/.agents/skills/formblocks-driving/evals/evals.json b/.agents/skills/formblocks-driving/evals/evals.json index 8a56786..5df2ecb 100644 --- a/.agents/skills/formblocks-driving/evals/evals.json +++ b/.agents/skills/formblocks-driving/evals/evals.json @@ -92,6 +92,36 @@ "Refuses to answer the window's question or change the standing choice, and says the person can choose Always allow or set it in the Outside agents dialog", "Refuses to fetch the library or type the consent words, and names the library card or the command the person runs" ] + }, + { + "id": 9, + "name": "turn-by-45", + "prompt": "Turn the red brick p1 45 degrees about its up axis in FormBlocks and tell me if anything is wrong afterwards.", + "files": [], + "expected_behavior": [ + "Sends part.rotate with ids [p1], axis y and angle 45, not quarter_turns, and passes ids rather than relying on the selection", + "Reads the answer's lifted value, runs overlap.check afterwards, and says a turn that is not a quarter turn seats nothing" + ] + }, + { + "id": 10, + "name": "open-a-hinge", + "prompt": "Put a 44301a hinge half beside the 44302a at the top of my model and open the hinge 90 degrees.", + "files": [], + "expected_behavior": [ + "Turns the half a half turn about y before placing it near its partner, because snapping never turns a part, and reads seated and joined", + "Reads part.pivot for the hinge's point and axis and sends part.rotate with axis_vector, about and angle 90 for that half only" + ] + }, + { + "id": 11, + "name": "who-made-this-model", + "prompt": "How big is the open model, how many different parts and colours does it use, and which parts is the library missing? Put my name as the author.", + "files": [], + "expected_behavior": [ + "Reads model.info with table false and answers from counts, size and missingParts", + "Sets the author with model.set_info and says it is one undo step; does not touch the licence line" + ] } ], "trigger_evals": [ @@ -105,6 +135,9 @@ { "query": "register the formblocks MCP server with my agent", "should_trigger": true }, { "query": "how many bricks does this model need, save the parts list as csv", "should_trigger": true }, { "query": "save a picture of each building step of my brick model", "should_trigger": true }, + { "query": "tilt this brick 22.5 degrees and tell me if it lifted off the ground in FormBlocks", "should_trigger": true }, + { "query": "clip the plate onto the bar and slide it along in my brick model", "should_trigger": true }, + { "query": "what licence and author does my open brick model carry and how many studs across is it", "should_trigger": true }, { "query": "add a new MCP tool to the FormBlocks engine source", "should_trigger": false }, { "query": "fix the typecheck error in the FormBlocks window code", "should_trigger": false }, { "query": "write a parser for LDraw files in Rust", "should_trigger": false }, diff --git a/.agents/skills/formblocks-driving/references/command-catalogue.md b/.agents/skills/formblocks-driving/references/command-catalogue.md index 3e76eb4..9c9f875 100644 --- a/.agents/skills/formblocks-driving/references/command-catalogue.md +++ b/.agents/skills/formblocks-driving/references/command-catalogue.md @@ -4,8 +4,8 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never ## Contents -- MCP tools: the 69 tools an agent sees, each with whether it only reads. -- Commands: the 63 catalogue commands with their titles, parameters and summaries, in name order. +- MCP tools: the 72 tools an agent sees, each with whether it only reads. +- Commands: the 66 catalogue commands with their titles, parameters and summaries, in name order. ## MCP tools @@ -17,12 +17,13 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | `formblocks_redo` | no | Redo changes that formblocks_undo took back, one step each. A new change after an undo empties what can be redone. Returns {revision, labels, label}. | | `formblocks_status` | yes | Read what this FormBlocks is: its version, the model's revision, placement count, file and unsaved mark, how many commands there are, its data folder, whether the window's engine is running, and the person's standing choice for outside agents (ask, allowed or blocked). Call it first. | | `formblocks_undo` | no | Undo the last changes, one step per command. Returns {revision, labels, label}: the new revision and the titles of the commands taken back, newest first. Nothing to undo answers an empty labels list. | +| `cmd_angle_step` | yes | Choose the angle step a turn with the pointer moves in and Alt with R, T or Y turns by: 90, 45, 22.5, 15, 5 or 1 degrees. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | | `cmd_colours_current` | yes | Choose the colour the next placed part gets, and put it at the front of the recent colours. Kept as the person's setting; it recolours nothing. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | | `cmd_colours_list` | yes | List the library's colours with code, name, value, edge and finish, or the swatches of one group, hue family or name words. Only reads. | | `cmd_colours_used` | yes | List the colours used in the open model, most used first: each colour's number, name, value, how many parts of the whole model are in it, and whether the library defines it. Only reads. | | `cmd_grid_step` | yes | Choose the grid step: stud (20 LDU across, 8 up), plate (10 across, 8 up) or fine (1 and 1). Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | | `cmd_library_status` | yes | Read whether a parts library is in use, where it was found, its update, whether its index is ready, the fetch in progress if any, and the consent and attribution the library card shows. Reading never fetches; only the person can consent to a fetch. Only reads. | -| `cmd_model_info` | yes | Read the model's name, author, file and library update, its counts (parts through every use, different parts, part and colour pairs, submodels, steps), its size in LDU, studs, bricks and millimetres, and its parts list. Only reads. | +| `cmd_model_info` | yes | Read the model's name, description (its title line), author, file, format and the library update it was saved with and the one in use; its counts (placements, parts through every use, different parts, colours, part and colour pairs, submodels, steps, missing parts, and overlapping pairs as overlap.check counts them); the parts the library lacks by number; its size in LDU, studs, bricks and millimetres; the licences model.set_info accepts; and its parts list unless table is false. Only reads. | | `cmd_model_insert` | no | Bring another .ldr, .mpd or .fblk file into the open model as new submodels and place one use of its main model. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_model_new` | no | Start a new model named Untitled with one empty step, and a new history. Opens, starts or writes a model file; not an undo step. An outside agent waits for the person to allow it in the window. | | `cmd_model_open` | no | Open a .fblk, .ldr, .mpd or .dat file by its full path; a library part file opens as a new model holding one placement of the part. Opens, starts or writes a model file; not an undo step. An outside agent waits for the person to allow it in the window. | @@ -32,9 +33,10 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | `cmd_model_save_as` | no | Write the model to a new path: .fblk saves the project file and makes it the model's file; .ldr or .mpd exports LDraw without FormBlocks' own state. Opens, starts or writes a model file; not an undo step. An outside agent waits for the person to allow it in the window. | | `cmd_model_set_info` | no | Change the main model's title, author or licence, as written in its header: the licence is empty or one of the Creative Commons licences listed in its parameter. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_model_tree` | yes | Read one submodel's steps and placements, each with its id, part, colour, position, rotation, step and hidden mark, and the submodels with their uses. Only reads. | -| `cmd_overlap_check` | yes | List each pair of overlapping placements with the depth of the overlap in LDU, for the given placements or the whole model; parts joined through seated connectors never count. Only reads. | -| `cmd_overlap_set` | yes | Turn the coarse overlap check on or off: with it on, placing and moving never put a part where its box would overlap another's. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | -| `cmd_part_connectors` | yes | List a library part's connectors as the connection model derives them: kind, position, axis and where each came from, with the counts, the body box and the footprint. Only reads. | +| `cmd_overlap_check` | yes | List each pair of overlapping placements, for the given placements or the whole model: two parts whose real shapes cut more than 1 LDU into each other, with the depth in LDU and the shared volume in cubic LDU. Parts joined through seated connectors never count. Nested pairs, one part sitting in another's hollow by design, are counted apart in nested_count and listed under nested when asked. Only reads. | +| `cmd_overlap_nested` | yes | Choose what the overlap check reports: false reports only real overlaps (the proposed default), true reports nested pairs too, parts that sit in another's hollow by design, such as a rim in its tyre or a pin in its hole. Nested pairs never block placing or moving either way. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | +| `cmd_overlap_set` | yes | Turn the overlap check on or off: with it on, placing and moving never put a part where its real shape would cut more than 1 LDU into another's. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | +| `cmd_part_connectors` | yes | List a library part's connectors as the connection model derives them: kind, position, axis, ref, length, index and where each came from, with the counts, the body box and the footprint; kind keeps only connectors of one kind. Only reads. | | `cmd_part_delete` | no | Remove placements from the model; deleting the last use of a submodel keeps the submodel. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_duplicate` | no | Copy placements, keeping colours and relative places, offset by delta; the copies go into the step shown and become the selection. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_duplicate_at_ray` | no | Drop copies of a selection where a pointer ray in the window's scene axes takes the copy of the grabbed placement, seated, on the grid or refused as the drag preview with copy answers; the copies keep their colours and places relative to one another, go into the step shown and become the selection. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | @@ -44,10 +46,11 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | `cmd_part_move` | no | Move placements by an offset in LDU, exactly, with no snapping. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_move_at_ray` | no | Put down a dragged selection where a pointer ray in the window's scene axes takes the grabbed placement, seated, on the grid or refused exactly as the drag preview answers, resting on what lies under its footprint when the place under the pointer would cut into another part; the others keep their places relative to it. Give held as the drag preview answered it so the part lands as previewed. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_pick` | yes | Name the placement of the submodel being edited that a pointer ray in the window's scene axes meets first on its real triangles, with the point and the face's normal, or the ground; hidden parts are passed through. Only reads. | +| `cmd_part_pivot` | yes | Say what placements turn about when the pivot dial turns them: the centre of the box around their shapes with the X, Y and Z axes, or, for one part joined by a hinge, the hinge's point and axis alone; with a pointer ray, the point where it meets a part of the submodel being edited (or the connector within 8 LDU of it), with X, Y and Z, and as without a ray when it meets none. Each point and axis in LDraw's axes and in the window's scene axes, with how far the box reaches from the point. Only reads. | | `cmd_part_place` | no | Place a part, or a use of a submodel, in a colour: at a position, seated on its connectors when snapping is on, or seated on another placement with on; it goes into the step shown and becomes the selection. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_place_at_ray` | no | Place a library part where a pointer ray in the window's scene axes puts it, seated, on the grid or refused exactly as the placement preview answers, resting on what lies under its whole footprint when the place under the pointer would cut into another part; it goes into the step shown of the submodel being edited and becomes the selection. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_recolour` | no | Give placements a colour; a use of a submodel in colour 16 passes it to its parts in colour 16. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | -| `cmd_part_rotate` | no | Turn placements by quarter turns about the X, Y or Z axis through a point, by default the centre of their origins. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | +| `cmd_part_rotate` | no | Turn placements about an axis through a point: by whole quarter turns, or by an angle in degrees, about X, Y, Z or any direction in LDraw axes, about the centre of their box when no point is given. What turned is lifted straight up when it would end below the ground, and with the overlap check on a turn into a part that does not turn is refused. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_set_transform` | no | Put one placement at an exact position, rotation or both, as the details panel does. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_show` | no | Show hidden placements again; every hidden placement in the model when no ids are given (Show all). Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_parts_list` | yes | Read the parts a model needs, one row per part and colour with its description, colour name, count and the placements of the submodel being edited that hold it; a submodel's parts counted once for each use unless submodels is row, a moved part counted under the number it moved to, parts missing from the library first and marked. With text true the answer also holds the list as tab separated text. Only reads. | @@ -85,12 +88,13 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | Command | Title | Reads only | Parameters | What it does | | --- | --- | --- | --- | --- | +| `angle.step` | Angle Step | yes | `step` (number) | Choose the angle step a turn with the pointer moves in and Alt with R, T or Y turns by: 90, 45, 22.5, 15, 5 or 1 degrees. Kept as the person's setting. | | `colours.current` | Current Colour | yes | `colour` (integer) | Choose the colour the next placed part gets, and put it at the front of the recent colours. Kept as the person's setting; it recolours nothing. | | `colours.list` | Colours | yes | `text` (string, optional), `group` (string, optional), `hue` (string, optional) | List the library's colours with code, name, value, edge and finish, or the swatches of one group, hue family or name words. | | `colours.used` | Colours Used | yes | none | List the colours used in the open model, most used first: each colour's number, name, value, how many parts of the whole model are in it, and whether the library defines it. | | `grid.step` | Grid Step | yes | `step` (string) | Choose the grid step: stud (20 LDU across, 8 up), plate (10 across, 8 up) or fine (1 and 1). Kept as the person's setting. | | `library.status` | Library Status | yes | none | Read whether a parts library is in use, where it was found, its update, whether its index is ready, the fetch in progress if any, and the consent and attribution the library card shows. Reading never fetches; only the person can consent to a fetch. | -| `model.info` | Model Information | yes | none | Read the model's name, author, file and library update, its counts (parts through every use, different parts, part and colour pairs, submodels, steps), its size in LDU, studs, bricks and millimetres, and its parts list. | +| `model.info` | Model Information | yes | `table` (boolean, optional) | Read the model's name, description (its title line), author, file, format and the library update it was saved with and the one in use; its counts (placements, parts through every use, different parts, colours, part and colour pairs, submodels, steps, missing parts, and overlapping pairs as overlap.check counts them); the parts the library lacks by number; its size in LDU, studs, bricks and millimetres; the licences model.set_info accepts; and its parts list unless table is false. | | `model.insert` | Insert LDraw Model | no | `path` (string), `position` (array, optional), `submodel` (string, optional) | Bring another .ldr, .mpd or .fblk file into the open model as new submodels and place one use of its main model. | | `model.new` | New Model | no | `discard` (boolean, optional) | Start a new model named Untitled with one empty step, and a new history. | | `model.open` | Open | no | `path` (string), `discard` (boolean, optional) | Open a .fblk, .ldr, .mpd or .dat file by its full path; a library part file opens as a new model holding one placement of the part. | @@ -100,9 +104,10 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | `model.save_as` | Save As | no | `path` (string) | Write the model to a new path: .fblk saves the project file and makes it the model's file; .ldr or .mpd exports LDraw without FormBlocks' own state. | | `model.set_info` | Set Model Information | no | `title` (string, optional), `author` (string, optional), `licence` (string, optional) | Change the main model's title, author or licence, as written in its header: the licence is empty or one of the Creative Commons licences listed in its parameter. | | `model.tree` | Model Tree | yes | `submodel` (string, optional) | Read one submodel's steps and placements, each with its id, part, colour, position, rotation, step and hidden mark, and the submodels with their uses. | -| `overlap.check` | Check Overlaps | yes | `ids` (array, optional) | List each pair of overlapping placements with the depth of the overlap in LDU, for the given placements or the whole model; parts joined through seated connectors never count. | -| `overlap.set` | Overlap Check | yes | `on` (boolean) | Turn the coarse overlap check on or off: with it on, placing and moving never put a part where its box would overlap another's. Kept as the person's setting. | -| `part.connectors` | Part Connectors | yes | `part` (string) | List a library part's connectors as the connection model derives them: kind, position, axis and where each came from, with the counts, the body box and the footprint. | +| `overlap.check` | Check Overlaps | yes | `ids` (array, optional), `nested` (boolean, optional) | List each pair of overlapping placements, for the given placements or the whole model: two parts whose real shapes cut more than 1 LDU into each other, with the depth in LDU and the shared volume in cubic LDU. Parts joined through seated connectors never count. Nested pairs, one part sitting in another's hollow by design, are counted apart in nested_count and listed under nested when asked. | +| `overlap.nested` | Nested Pairs | yes | `on` (boolean) | Choose what the overlap check reports: false reports only real overlaps (the proposed default), true reports nested pairs too, parts that sit in another's hollow by design, such as a rim in its tyre or a pin in its hole. Nested pairs never block placing or moving either way. Kept as the person's setting. | +| `overlap.set` | Overlap Check | yes | `on` (boolean) | Turn the overlap check on or off: with it on, placing and moving never put a part where its real shape would cut more than 1 LDU into another's. Kept as the person's setting. | +| `part.connectors` | Part Connectors | yes | `part` (string), `kind` (string, optional) | List a library part's connectors as the connection model derives them: kind, position, axis, ref, length, index and where each came from, with the counts, the body box and the footprint; kind keeps only connectors of one kind. | | `part.delete` | Delete | no | `ids` (array, optional) | Remove placements from the model; deleting the last use of a submodel keeps the submodel. | | `part.duplicate` | Duplicate | no | `ids` (array, optional), `delta` (array, optional) | Copy placements, keeping colours and relative places, offset by delta; the copies go into the step shown and become the selection. | | `part.duplicate_at_ray` | Duplicate at Pointer | no | `grab` (string), `origin` (array), `direction` (array), `rotation` (array, optional), `held` (integer, optional), `ids` (array, optional), `snap` (boolean, optional) | Drop copies of a selection where a pointer ray in the window's scene axes takes the copy of the grabbed placement, seated, on the grid or refused as the drag preview with copy answers; the copies keep their colours and places relative to one another, go into the step shown and become the selection. One undo step. | @@ -112,10 +117,11 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | `part.move` | Move | no | `ids` (array, optional), `delta` (array) | Move placements by an offset in LDU, exactly, with no snapping. | | `part.move_at_ray` | Move Selection at Pointer | no | `grab` (string), `origin` (array), `direction` (array), `rotation` (array, optional), `held` (integer, optional), `ids` (array, optional), `snap` (boolean, optional) | Put down a dragged selection where a pointer ray in the window's scene axes takes the grabbed placement, seated, on the grid or refused exactly as the drag preview answers, resting on what lies under its footprint when the place under the pointer would cut into another part; the others keep their places relative to it. Give held as the drag preview answered it so the part lands as previewed. One undo step. | | `part.pick` | Pick at Pointer | yes | `origin` (array), `direction` (array), `ground` (boolean, optional) | Name the placement of the submodel being edited that a pointer ray in the window's scene axes meets first on its real triangles, with the point and the face's normal, or the ground; hidden parts are passed through. | +| `part.pivot` | Pivot | yes | `ids` (array, optional), `origin` (array, optional), `direction` (array, optional) | Say what placements turn about when the pivot dial turns them: the centre of the box around their shapes with the X, Y and Z axes, or, for one part joined by a hinge, the hinge's point and axis alone; with a pointer ray, the point where it meets a part of the submodel being edited (or the connector within 8 LDU of it), with X, Y and Z, and as without a ray when it meets none. Each point and axis in LDraw's axes and in the window's scene axes, with how far the box reaches from the point. | | `part.place` | Place Part | no | `part` (string), `colour` (integer), `position` (array, optional), `rotation` (array, optional), `submodel` (string, optional), `step` (integer, optional), `on` (string, optional), `snap` (boolean, optional) | Place a part, or a use of a submodel, in a colour: at a position, seated on its connectors when snapping is on, or seated on another placement with on; it goes into the step shown and becomes the selection. | | `part.place_at_ray` | Place Part at Pointer | no | `part` (string), `colour` (integer), `origin` (array), `direction` (array), `rotation` (array, optional), `held` (integer, optional), `step` (integer, optional), `snap` (boolean, optional) | Place a library part where a pointer ray in the window's scene axes puts it, seated, on the grid or refused exactly as the placement preview answers, resting on what lies under its whole footprint when the place under the pointer would cut into another part; it goes into the step shown of the submodel being edited and becomes the selection. | | `part.recolour` | Recolour | no | `ids` (array, optional), `colour` (integer) | Give placements a colour; a use of a submodel in colour 16 passes it to its parts in colour 16. | -| `part.rotate` | Rotate | no | `ids` (array, optional), `axis` (string), `quarter_turns` (integer), `about` (array, optional) | Turn placements by quarter turns about the X, Y or Z axis through a point, by default the centre of their origins. | +| `part.rotate` | Rotate | no | `ids` (array, optional), `axis` (string, optional), `quarter_turns` (integer, optional), `angle` (number, optional), `axis_vector` (array, optional), `about` (array, optional) | Turn placements about an axis through a point: by whole quarter turns, or by an angle in degrees, about X, Y, Z or any direction in LDraw axes, about the centre of their box when no point is given. What turned is lifted straight up when it would end below the ground, and with the overlap check on a turn into a part that does not turn is refused. One undo step. | | `part.set_transform` | Set Position and Rotation | no | `id` (string), `position` (array, optional), `rotation` (array, optional) | Put one placement at an exact position, rotation or both, as the details panel does. | | `part.show` | Show | no | `ids` (array, optional) | Show hidden placements again; every hidden placement in the model when no ids are given (Show all). | | `parts.list` | Parts List | yes | `scope` (string, optional), `group` (string, optional), `submodels` (string, optional), `text` (boolean, optional) | Read the parts a model needs, one row per part and colour with its description, colour name, count and the placements of the submodel being edited that hold it; a submodel's parts counted once for each use unless submodels is row, a moved part counted under the number it moved to, parts missing from the library first and marked. With text true the answer also holds the list as tab separated text. | diff --git a/.agents/skills/formblocks-driving/references/error-codes.md b/.agents/skills/formblocks-driving/references/error-codes.md index 59f5912..be3d89c 100644 --- a/.agents/skills/formblocks-driving/references/error-codes.md +++ b/.agents/skills/formblocks-driving/references/error-codes.md @@ -53,7 +53,7 @@ A command's sentence starts with the parameter it is about (`part:`, `on:`, `ids | "part: ... is not in the LDraw parts library in use" | Search with `parts.search` and place the number it answers. A number with letters (`3068b`) is a different part from the bare number. | | "No LDraw parts library is installed" | Nothing can be placed. Tell the person; only they can find or fetch the library (`sub-skills/parts-library/SUB-SKILL.md`). | | "position: give a position, a placement to seat on (on), or a pointer ray" | `part.place` needs `position` or `on`. | -| "position: the part would overlap ... with the overlap check on" | The person's overlap check is on and the place is taken. Pick another place; the check is coarse inside arches and hollows, so tell the person if a part is refused where it should fit. | +| "position: the part would overlap ... by ... LDU with the overlap check on, so it was not placed." | The person's overlap check is on and the place is taken by more than 1 LDU of real shape. Pick another place; a part whose surface is not closed can be refused where it should fit, so tell the person if that happens. | | "... must stay within 1000000 LDU of the origin" | A position or offset is out of range: check signs and units. | | "on: ... has no free connector that ... can seat on" | Every stud of that placement is taken. Seat on another placement, or give a position. | | "on: ... is hidden" | Hidden parts offer no connectors. Show it with `part.show` first, or use a position. | @@ -87,6 +87,6 @@ A command's sentence starts with the parameter it is about (`part:`, `on:`, `ids - `part.place` answering `"seated": false`: the part did not join anything. With the overlap check off (its first setting) it was put on the grid step instead and may float in the air or sit inside another part. Undo it and fix the position, unless a loose part is what you meant. - `part.place` with `on` seating on a different part of the target than you wanted: `on` takes the first free studs nearest the target's middle. Give a position for an exact place. -- `overlap.check` answering a `count` above 0: two parts share space. Undo the newer one or move it. +- `overlap.check` answering a `count` above 0: two parts share space. Undo the newer one or move it. A `nested_count` above 0 is not a fault: those parts sit in each other's hollows by design, and are listed only with `nested: true`. - `model.open` answering an `issueCount` above 0: some lines could not be read; `model.report` lists them. The rest of the file opened. - A JSON-RPC timeout on a `change` sent from outside: the person may still have the question open. Read the model before sending again. diff --git a/.agents/skills/formblocks-driving/sub-skills/building-in-order/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/building-in-order/SUB-SKILL.md index e359a5c..22c5308 100644 --- a/.agents/skills/formblocks-driving/sub-skills/building-in-order/SUB-SKILL.md +++ b/.agents/skills/formblocks-driving/sub-skills/building-in-order/SUB-SKILL.md @@ -47,7 +47,7 @@ Where two walls meet, let one wall run through the corner cell in one course and - A half turn about Y, `rotation` `[-1,0,0, 0,1,0, 0,0,-1]`, makes it face the back. - Lay a flat layer of plates on the walls first, so every slope has studs under its whole footprint. - A gable roof: a row of slopes facing front along the front edge and a row facing back along the back edge. Each further row steps in by one stud and up by one brick, standing on the studs of the row below and on filler bricks behind it. Close the ridge with plates or tiles over the last studs. -- The overlap check follows a slope's face in slabs 4 LDU thick, so a part held clear above the face is not refused, but one cutting into the face is. The slabs step by half a plate, so a part within a few LDU of the face can still be reported; tell the person why when it is. +- The overlap check compares real shapes, so a part held clear above a slope's face is not refused and one cutting more than 1 LDU into the face is. Where it still reports a part that fits, such as one tucked under a roof whose surface is not closed, tell the person why. ## After each course diff --git a/.agents/skills/formblocks-driving/sub-skills/changing-parts/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/changing-parts/SUB-SKILL.md index 6b42af5..4704707 100644 --- a/.agents/skills/formblocks-driving/sub-skills/changing-parts/SUB-SKILL.md +++ b/.agents/skills/formblocks-driving/sub-skills/changing-parts/SUB-SKILL.md @@ -17,7 +17,7 @@ Each command takes `ids`, a list of placement ids such as `["p3", "p4"]`. Left o | --- | --- | --- | | `part.move` | `ids`, `delta` | Moves by an exact offset in LDU, `[dx, dy, dz]`. No snapping: the parts go exactly where sent. Up is a negative `dy`. | | `part.set_transform` | `id`, `position`, `rotation` | Puts one placement at an exact position, an exact rotation, or both. | -| `part.rotate` | `ids`, `axis`, `quarter_turns`, `about` | Turns by quarter turns about `x`, `y` or `z`, right-handed about the positive axis; negative turns go the other way. It turns about `about` when given, otherwise about the centre of the placements' origins, and works out the new positions and matrices. | +| `part.rotate` | `ids`, `axis` or `axis_vector`, `quarter_turns` or `angle`, `about` | Turns by whole quarter turns or by an angle in degrees, right-handed about the positive axis; negative turns go the other way. It turns about `about` when given, otherwise about the centre of the box round the placements' shapes. Lifts a turn off the ground and, with the overlap check on, refuses one into a part that stays; `sub-skills/turning-parts/SUB-SKILL.md` has the rest. | | `part.duplicate` | `ids`, `delta` | Copies the placements with their colours and relative places, offset by `delta`. The copies go into the step shown and become the selection; the answer lists their new ids. | | `part.recolour` | `ids`, `colour` | Gives a colour code. Parts already in it are left as they are. | | `part.delete` | `ids` | Removes placements. Deleting the last use of a submodel keeps the submodel itself. | @@ -32,8 +32,9 @@ Each command takes `ids`, a list of placement ids such as `["p3", "p4"]`. Left o ## Turning in place - A quarter turn about Y of one 2 x 4 brick about its own origin turns it crosswise on the same spot; it may then overlap its neighbours. -- To turn a whole group as one, give all their ids: they turn about the centre of their origins and keep their places relative to one another. +- To turn a whole group as one, give all their ids: they turn about the centre of their box and keep their places relative to one another. - To turn about a stud, give `about` as that stud's position. +- Any other angle than a quarter turn is the same command with `angle` (`sub-skills/turning-parts/SUB-SKILL.md`). ## Repeating a row diff --git a/.agents/skills/formblocks-driving/sub-skills/checking-a-model/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/checking-a-model/SUB-SKILL.md index a022c85..a811ab9 100644 --- a/.agents/skills/formblocks-driving/sub-skills/checking-a-model/SUB-SKILL.md +++ b/.agents/skills/formblocks-driving/sub-skills/checking-a-model/SUB-SKILL.md @@ -9,16 +9,18 @@ Never report a build as done from memory of the commands you sent. Read the mode ## The overlap check -`overlap.check` (`cmd_overlap_check`) lists every pair of placements whose bodies overlap, with the depth of the overlap in LDU. Give `ids` to check only those placements against the rest; leave it out for the whole model. It works whatever the person's overlap switch says. +`overlap.check` (`cmd_overlap_check`) lists every pair of placements whose real shapes cut into each other, with the depth in LDU and the shared volume in cubic LDU. Give `ids` to check only those placements against their neighbours; leave it out for the whole model. It works whatever the person's overlap switch says. ```json -{"checked": 28, "overlaps": [], "count": 0} -{"checked": 5, "overlaps": [{"submodel": "untitled.ldr", "a": "p1", "b": "p5", "depth": 23.0}], "count": 1} +{"checked": 28, "overlaps": [], "count": 0, "nested_count": 0, "nested_listed": false} +{"checked": 2, "overlaps": [{"submodel": "untitled.ldr", "a": "p1", "b": "p2", "depth": 24.0, "kind": "overlap", "volume": 16952.0, "parts": ["3001.dat", "3001.dat"]}], "count": 1, "nested_count": 0, "nested_listed": false} ``` - `count` 0 is the goal. -- Parts seated on each other never count, and parts that only touch face to face never count. -- The check is coarse: each part is stood in for by a box round its body, without its studs, shrunk by half an LDU, and a part whose outline changes with height (a slope, a windscreen, a round part) by a stack of slabs 4 LDU thick, so the open wedge over a slope's face is free. The space inside an arch, under a hinge or inside a hollow still counts as solid, so a part tucked there is reported although it fits. Say so to the person rather than moving a part that is right. +- Parts seated on each other never count, and parts that only touch, or cut into each other by 1 LDU or less, never count. +- Since 0.5.0 each part is its real solid, studs included, filled into cells of 1 LDU, so a part tucked into a hollow, an arch or under a hinge without cutting into the walls is not an overlap. A part with a surface that is not closed, or a part the library lacks, can still be reported wrongly; say so to the person rather than moving a part that is right. +- A pair whose outlines meet but whose solids do not, and which no seated connector joins, such as a rim in its tyre or a pin in a hole, is a nested pair. Two hinge halves or a clip on a bar, seated, are fitted and not listed at all. It is counted in `nested_count` and listed only when you pass `nested: true` or the person's setting "Report nested pairs" is on (`nested_listed` says which). Nested pairs are never refused when placing, moving or turning. On the library's sample car the answer is 0 overlaps and 19 nested pairs. +- `overlap.nested` (`on`) is that setting, the person's, like the overlap switch: ask before you change it, and prefer `nested: true` on one call. - A depth near a whole brick (24) or plate (8) usually means a part was placed on top of another at the same height: undo it or move it. ## Seated, or floating @@ -41,7 +43,7 @@ Check the counts against the plan: the number of placements, the number in each ## Counting parts - `parts.list` counts what the model needs, one row per part and colour, a submodel's parts once per use, missing parts first; `parts.list_save` writes it as CSV. `sub-skills/parts-list/SUB-SKILL.md` gives the scopes and the answer. -- `model.info` (read) answers the model's name, author, file and library update, `counts` (`parts`, `differentParts`, `pairs`, `missing`, `submodels`, `steps`, `placements`), its `size` in LDU, studs, bricks and millimetres, and the parts list with it. +- `model.info` (read) answers the model's name, author, file and library update, `counts` (`parts`, `differentParts`, `pairs`, `colours`, `overlaps`, `missing`, `submodels`, `steps`, `placements`), `missingParts` by number, its `size` in LDU, studs, bricks and millimetres, and the parts list with it unless `table` is false (`sub-skills/model-information/SUB-SKILL.md`). - `colours.used` (read) lists each colour of the model with its number, name and how many parts are in it, most used first; `known` false marks a colour the library does not define. Check the counts against the plan: parts in each colour, kinds of part, the number of steps. diff --git a/.agents/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md new file mode 100644 index 0000000..a54221b --- /dev/null +++ b/.agents/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md @@ -0,0 +1,66 @@ +--- +name: clips-and-hinges +description: Seats and turns clips on bars and hinge halves on each other in FormBlocks with part.place, part.fit, part.connectors and part.rotate about a hinge axis. Use when asked to build with clips, bars, handles, hinges, hinge plates, hinge bricks or swivel plates, to fold or open a hinge, to slide a clip along a bar, when a clip or hinge half will not seat, or to read which clip, bar or hinge kinds a part has. +--- + +# Clips, bars and hinges + +Besides studs and anti-studs, the engine finds three more kinds of join from a part's own shape and snaps them with the same rule: `part.place`, `part.fit` and the window's drags all use it. Read the kinds of any part with `part.connectors` (`cmd_part_connectors`, read; pass `kind` to list only one kind, such as `clip`, `bar` or `hinge_click_1`). A part with none of them seats as before. + +## The kinds + +| Kind | Pairs with | What it is | +| --- | --- | --- | +| `clip` | `bar` | Jaws that close round a rod 8 LDU across, from the library's clip pieces, such as the one on `4085c`, a Plate 1 x 1 with Clip. | +| `bar` | `clip` | Any free rod of radius 4 with room round it for jaws: the handle of a plate with a handle, `87994` Bar 3L (free length 60 LDU), the rods of many accessories. Found from the shape, so a rod never meant to be gripped can count too. | +| `hinge_click_1`, `hinge_click_2` | each other | Single-finger and dual-finger click hinge halves, such as `44301a` and `44302a`. | +| `hinge_plate_2`, `hinge_plate_3` | each other | Two-finger and three-finger plate hinge halves, `4276b` and `4275b`. | +| `hinge_arm_2`, `hinge_arm_3` | each other | The hinge arm with discs. | +| `hinge_brick_base`, `hinge_brick_top` | each other | The 1 x 2 hinge brick, `3937` and `3938`. | +| `hinge_swivel_base`, `hinge_swivel_top` | each other | The 1 x 4 swivel hinge plates, `2429` and `2430`. | + +A half pairs only with the other half of its own family. A clip does not take a stud, and a bar does not go into an anti-stud. + +## Seating a clip on a bar + +The clip's centre is put on the bar's line, and it slides along the bar in grid steps measured from the bar's middle: at the Stud step the middle and 20 LDU either side of it, at Plate every 10, at Fine anywhere along the free length. One bar holds several clips side by side; a second clip over a taken stretch is not seated. + +```bash +./formblocks cli run part.place part=87994 colour=7 'position=[0,-80,0]' +./formblocks cli run part.set_transform id=p1 'position=[0,-80,0]' +./formblocks cli run part.place part=4085c colour=4 on=p1 +./formblocks cli run part.place part=4085c colour=4 'position=[2,-45,21]' +``` + +A floating bar is put exactly with `part.set_transform`, because `part.place` rounds an unseated part to the grid (the first line answered position `[4, -76, 4]` and `seated` false). With `on`, the clip took the first free stretch of the bar, its centre at y = -70. With a position, a clip whose centre was at y = -41 seated at -50, the nearest place at the Stud step. The clip of `4085c` is at `[0, 4, -20]` in the part's own axes (`part.connectors part=4085c`), so its origin ends up 4 above the clip's centre and 20 behind the bar's line. Always read `seated`, `joined` and `marks` in the answer. + +## Seating hinge halves + +Snapping never turns a part. Turn the half first so its pivot line runs the way its partner's does, then place it near: it moves so the two lines meet. + +```bash +./formblocks cli run part.place part=44302a colour=4 'position=[0,-100,0]' +./formblocks cli run part.set_transform id=p1 'position=[0,-100,0]' +./formblocks cli run part.place part=44301a colour=1 'position=[63,-102,2]' 'rotation=[-1,0,0,0,1,0,0,0,-1]' +``` + +The last answered `seated` true at `[60, -100, 0]`, one joined pair and a mark at `[30, -98, 0]`. With `part.fit`, the same half unturned at `[2, -101, 1]` answered `seated` false, a three-finger plate hinge half held against another `4275b` answered false, and a `4276b` held against a `4275b` turned a half turn answered true at `[60, -100, 0]`; unturned it answered false. `3938` seated on `3937` at `[0, -100, 0]`. + +## Opening and closing a hinge + +`part.pivot` (read) on a seated half answers `kind` `hinge`, the hinge's point as `about` and its axis in `axes` (LDraw and scene axes); a clip seated on a bar answers the same, since it turns on the bar. Give that point and axis to `part.rotate`: + +```bash +./formblocks cli run part.pivot 'ids=["p2"]' +./formblocks cli run part.rotate 'ids=["p2"]' 'axis_vector=[0,0,-1]' 'about=[30,-98,0]' angle=90 +``` + +The half turned 90 degrees, from `[60, -100, 0]` to `[28, -128, 0]`. `part.rotate` turns only the placements in `ids`: when other parts are attached to the half, give their ids too. A hinge turns all the way round; with the person's overlap check on, a turn into a part that does not turn is refused (`sub-skills/turning-parts/SUB-SKILL.md`). In the window the person turns the same half with the one ring of the pivot dial, in angle steps. + +## What overlap.check says + +Two halves joined by a seated hinge answered `count` 0. A clip seated on a bar, anywhere along it, answered `count` 0 and `nested_count` 0: a pair joined by a seated connector is fitted, never an overlap and never nested. + +## Not found, not built + +A hinge or clip drawn without the library's own pieces is found only where the engine's list of corrections names it (the 1 x 2 hinge brick, the swivel plates, the 1 x 1 tile with a clip); other parts do not snap, so place them by position and say so. Pins, axles, ball joints, a bar into a hole, hinge turning limits, click positions and flexible parts are not built: do not promise them. diff --git a/.agents/skills/formblocks-driving/sub-skills/files/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/files/SUB-SKILL.md index 0d46b5d..2b050bd 100644 --- a/.agents/skills/formblocks-driving/sub-skills/files/SUB-SKILL.md +++ b/.agents/skills/formblocks-driving/sub-skills/files/SUB-SKILL.md @@ -27,7 +27,7 @@ A saved file holds references to parts (`3001.dat`), never a part's own lines. F | `model.insert` | change | `path`, `position`, `submodel` | Brings another `.ldr`, `.mpd` or `.fblk` in as new submodels and places one use of its main model (at `position`, or the origin). | | `model.recent` | read | none | The last ten files opened or saved, newest first, each with whether it still exists. | | `model.report` | read | none | What opening reported: lines that could not be read, with their numbers, and the text encoding. | -| `model.info` | read | none | The model's title, author, licence, file, library update, counts and size. | +| `model.info` | read | `table` | The model's name, title, author, licence, file, library update, counts, size and missing parts, with its parts list unless `table` is false (`sub-skills/model-information/SUB-SKILL.md`). | | `model.set_info` | change | `title`, `author`, `licence` | Changes the main model's header: the title (its file's first line), the author, and the licence, empty or one of the Creative Commons licences the parameter lists. | Two other commands write files of their own and wait for the person like a save: `parts.list_save` (a CSV, `sub-skills/parts-list/SUB-SKILL.md`) and `picture.save` with `picture.steps` (PNG pictures, `sub-skills/pictures/SUB-SKILL.md`). diff --git a/.agents/skills/formblocks-driving/sub-skills/model-information/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/model-information/SUB-SKILL.md new file mode 100644 index 0000000..b9e46d0 --- /dev/null +++ b/.agents/skills/formblocks-driving/sub-skills/model-information/SUB-SKILL.md @@ -0,0 +1,40 @@ +--- +name: model-information +description: Reads and changes a FormBlocks model's own information, its name, description, author, licence, counts, size, file facts and missing parts, with model.info, model.set_info and submodel.rename, the facts the window shows in its Info tab. Use when asked what a model is, how big it is, how many parts, colours or steps it has, which parts the library lacks, who made it, what licence line it carries, or to set its title, author, licence or name. +--- + +# Model information + +The window's Info tab (the fourth tab of the right column) shows these facts and lets the person edit four of them. The engine counts every value; an agent reads and writes the same ones. + +## Reading: model.info + +`model.info` (`cmd_model_info`, read) answers: + +| Key | What it holds | +| --- | --- | +| `name`, `title`, `author`, `licence` | The main model's `Name:` line, its description (the title line an LDraw file starts with), its author, and the licence line, empty when none. | +| `path`, `kind`, `builtWith`, `library` | The file it came from or was saved to, its kind (`fblk`, `ldr`, `mpd`), the library update it was last saved with (`null` for an LDraw file that did not come from FormBlocks), and the update in use. | +| `counts` | `placements`, `parts` (through every use of a submodel), `differentParts`, `colours`, `pairs` (part and colour rows), `submodels`, `steps` of the main model, `missing` (parts the library lacks) and `overlaps` (as `overlap.check` counts them, nested pairs left out). | +| `size` | `ldu`, `studs`, `bricks`, `plates`, `mm` and the `box`; an LDU is 0.4 mm. | +| `missingParts` | Each part the library lacks: `part`, `file` and `count`. | +| `licences` | The licence lines `model.set_info` accepts. | +| `partsList`, `csv` | The parts list rows and its CSV text. Pass `table` false to leave them out; the answer is large on a big model. | + +On the library's sample car, `model.info` with `table` false answered 61 placements, 26 different parts, 7 colours, 32 rows, 8 steps, 0 overlaps and a size of 4.5 by 10.8 studs and 5.17 bricks high, which a hand count of the file matched. + +## Changing it + +| Command | Parameters | What it changes | +| --- | --- | --- | +| `model.set_info` | `title`, `author`, `licence` | The description, the author and the licence line. Any of them may be left out. `licence` is empty or one of the lines in `licences`; another is refused with the list. | +| `submodel.rename` | `name`, `new_name` | The main model's name when `name` is it, and every use of it. `.ldr` is added when `new_name` has no extension. | + +Each is a change command: one undo step labelled "Change model information" or "Rename ...", approved by the person when it comes from outside the window. A model that was never saved keeps its changes only in memory until `model.save_as`. + +## Habits + +- Read `counts` and `missingParts` before telling the person a build is complete; a part in `missingParts` is drawn as a marked box and counted in the parts list as "Not in this library". +- `overlaps` here is the same as `count` in `overlap.check`; for the pairs themselves call `overlap.check`. +- Set the licence line only when the person says which; it describes the model, never the parts, which keep their own licences. +- The window shows a changed value in place at once, because the tab is rewritten from the engine's answer. diff --git a/.agents/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md index d673fcd..43eb734 100644 --- a/.agents/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md +++ b/.agents/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md @@ -78,7 +78,7 @@ The full list is `references/error-codes.md`. ## The overlap check -The overlap check is the person's switch, off at the first start. With it on, `part.place` refuses a place where the part's body box would overlap another part's; with it off, parts may share space without a word. Either way `overlap.check` reports overlaps on demand (`sub-skills/checking-a-model/SUB-SKILL.md`). The switch, like snapping and the grid step, is the person's setting: ask before you change it, and prefer `overlap.check` after placing, which changes nothing. +The overlap check is the person's switch, off at the first start. With it on, `part.place` refuses a place where the part's real shape would cut more than 1 LDU into another part's (a part resting in a hollow it fits is not refused, and a nested pair never is); with it off, parts may share space without a word. Either way `overlap.check` reports overlaps on demand (`sub-skills/checking-a-model/SUB-SKILL.md`). The switch, like snapping and the grid step, is the person's setting: ask before you change it, and prefer `overlap.check` after placing, which changes nothing. ## Habits that save undo steps diff --git a/.agents/skills/formblocks-driving/sub-skills/turning-parts/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/turning-parts/SUB-SKILL.md new file mode 100644 index 0000000..a52a37b --- /dev/null +++ b/.agents/skills/formblocks-driving/sub-skills/turning-parts/SUB-SKILL.md @@ -0,0 +1,52 @@ +--- +name: turning-parts +description: Turns placed parts in FormBlocks by any angle with part.rotate (angle in degrees or quarter turns, about x, y or z or any axis_vector, about a point), reads what a turn would turn about with part.pivot, and explains the angle step, the pivot dial and J that the person uses in the window. Use when asked to turn, tilt, tip, roll, angle or swivel parts, to turn by 45 or 22.5 degrees, to turn about a stud, a corner or a hinge, when a turn lifts a part or is refused, or when the person talks about the pivot dial or the angle step. +--- + +# Turning parts + +A turn is one `part.rotate` and one undo step, whoever asks for it: the person's key, a drag on the pivot dial, or an agent. + +## What part.rotate takes + +| Parameter | Meaning | +| --- | --- | +| `ids` | Placement ids such as `["p1","p2"]`; the selection when left out, which may be the person's, so pass `ids`. | +| `axis` | `x`, `y` or `z`, LDraw's axes, `y` being up and down. Give this or `axis_vector`. | +| `axis_vector` | Any direction as `[x, y, z]` in LDraw axes, such as a hinge's axis, in place of `axis`. | +| `quarter_turns` | Whole quarter turns, right-handed about the positive axis; negative goes the other way. Give this or `angle`. | +| `angle` | Degrees, right-handed about the axis; negative goes the other way. | +| `about` | The point to turn about, in LDU. Left out, the centre of the box round the placements' real shapes. | + +Giving both `quarter_turns` and `angle`, or neither, or neither axis, is refused with a sentence that names the parameter. A quarter turn leaves a part where its studs can seat again; any other angle does not seat anything, and a turn never seats a part. Four quarter turns give back the same numbers exactly; other angles are settled to six places. + +```bash +./formblocks cli run part.rotate 'ids=["p1"]' axis=y angle=45 +./formblocks cli run part.rotate 'ids=["p1","p2"]' axis=y quarter_turns=1 'about=[0,0,0]' +``` + +The answer lists each turned placement with its new `position`, `rotation` and `matrix`, the `about` point, the `angle` and `axis` used, and `lifted`, how far the turned parts were raised. + +## Two rules the engine keeps + +- A turn never leaves a part below the ground. When the turned parts would end lower than the ground, the whole turned group is lifted straight up until it rests on it, and `lifted` says how far. A 2 x 4 brick standing on the ground, turned 45 degrees about y and then 90 about x, answered `lifted` 28.426 on the second turn. +- With the person's overlap check on, a turn that would push a turned part into a part that does not turn is refused and nothing turns: "ids: the turn would overlap p1 with p2 by 3.0 LDU with the overlap check on, so nothing was turned." With the check off the turn happens and `overlap.check` reports it afterwards. + +A turn of a whole number of full circles changes nothing and adds no undo step. + +## part.pivot + +`part.pivot` (read) says what the person's pivot dial turns about: for `ids` or the selection, `kind` `centre` with the centre of the box and the three axes in LDraw's axes (`about`, `axes`) and in the window's scene axes (`scene`), and `reach`, how far the box extends from the point. For one part joined by a hinge it answers the hinge's own point and axis alone. With a pointer ray (`origin`, `direction`, scene axes) it answers the point the ray meets on a part, or the connector within 8 LDU of it. Use it to find the axis for an `axis_vector` turn; it changes nothing. + +## The angle step, the person's setting + +`angle.step` (`step`: 90, 45, 22.5, 15, 5 or 1) sets the step the dial and Alt with R, T or Y turn by; it is the person's setting like the grid step, so ask before changing it. `part.rotate` does not use it: give the angle you want. + +## What the person sees + +Selected parts show a green pivot ring lying flat about the up axis; pressing on it and dragging turns them in angle steps, Shift for whole degrees, Esc to put them back. J shows three rings and a click on a part sets the pivot on its nearest connector. A key turn is Alt with R, T or Y; A goes to the next angle step. An agent's turn shows in the window at once. Typing an angle on the dial is not built; send `part.rotate` instead. + +## Traps + +- `part.rotate`'s `axis` is LDraw's, with -Y up. A pointer ray's axes are the scene's (`sub-skills/moving-parts/SUB-SKILL.md`). +- After a turn other than a quarter turn nothing is seated: check with `overlap.check`, and turn the part back or move it if the person wants it joined. diff --git a/.agents/skills/formblocks-harness/SKILL.md b/.agents/skills/formblocks-harness/SKILL.md index 00b4f7a..a0cc957 100644 --- a/.agents/skills/formblocks-harness/SKILL.md +++ b/.agents/skills/formblocks-harness/SKILL.md @@ -1,10 +1,10 @@ --- name: formblocks-harness -description: "Use when asked to install, boot, verify, debug, extend or release the FormBlocks repository itself: its engine code (the LDraw reader, parts library, meshes, connections, command catalogue), its window, its setup scripts, its agent dock wiring or its skill packs. Works on the checkout as a developer agent: the ./formblocks launcher, boot and ports, doctor, selfcheck, contract and agents checks, looking at the window headless under throttling with layout shift recorded, the CLAUDE.md laws (hand-made single-region edits, zero DOM flash or flicker, tokens, no emoji, HASHOUT logs, one commit identity), the clean room with spec/ as the authority, where code lives, what packages may import, and adding a command, a connector kind, a router, a pane, or an agent program to the dock. Also the picture round trip, the parts list's rows, the parts library's scratch copy, freezing the engine and the release. Not for building models in a running FormBlocks through its MCP tools or command line; that is formblocks-driving." +description: "Use when asked to install, boot, verify, debug, extend or release the FormBlocks repository itself: its engine code (the LDraw reader, parts library, meshes, connections, command catalogue), its window, its setup scripts, its agent dock wiring or its skill packs. Works on the checkout as a developer agent: the ./formblocks launcher, boot and ports, doctor, selfcheck, contract and agents checks, the window looked at headless under throttling with layout shift recorded, the CLAUDE.md laws (hand-made single-region edits, zero DOM flash, tokens, no emoji, HASHOUT logs, one commit identity), the clean room with spec/ as the authority, where code lives, and adding a command, a connector kind, a router, a pane, or an agent program to the dock. Also the picture round trip, the parts list's rows, the library's scratch copy, freezing the engine and the release. Not for building models in a running FormBlocks through its MCP tools or command line; that is formblocks-driving." license: Apache-2.0 metadata: product: FormBlocks - pack-version: "0.4.0" + pack-version: "0.5.0" audience: developer agent --- diff --git a/.agents/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md b/.agents/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md index a2075b1..1559257 100644 --- a/.agents/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md +++ b/.agents/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md @@ -1,6 +1,6 @@ --- name: add-connector-kind -description: Adds a connector kind to FormBlocks' connection model as a module that registers itself in backend/app/connect/kinds/, with its data beside it as JSON. Use when adding pins, axles, clips, bars, hinges or any joint beyond studs and anti-studs, when correcting the primitive list of an existing kind, or when a part's connectors come out wrong. +description: Adds a connector kind to FormBlocks' connection model as a module that registers itself in backend/app/connect/kinds/, with its data beside it as JSON. Use when adding a joint beyond studs, anti-studs, clips, bars and the hinge families, such as pins or axles, when correcting the primitive list of an existing kind, or when a part's connectors come out wrong. --- # Add a connector kind @@ -36,6 +36,11 @@ A subclass of `Kind` from `backend/app/connect/kinds/__init__.py`: | `from_mesh(mesh, connectors)` | Optional: connectors found from the whole flattened part. | | `mate(a, b)` | `None`, or a `Mate`: the correction that brings `a` onto `b`, the residual, and the `Freedom` left (`Freedom.spin`, `slide`, `hinge` or `fixed`). `axial_mate` covers round connectors on a shared axis. | | `blocks(connector, other)` | Optional: a blocked test of the kind's own, as the stud's blocked-stud test is. | +| `line` | True when the connector is a line, not a facing: its axis has no sign, the mate compares lines (clips, bars and hinge halves). | +| `takes_step` | True when the seat moves in grid steps: `mate(a, b, step)` is then also given the grid step's across value, and gets 0 when pairs are only being counted. | +| `spans` | True when a connector is a segment from `position` along `axis` for `length` (a bar): reach and mating distance are measured to the segment, the spatial hash keeps it by every cell it passes, and it is taken stretch by stretch. A `Mate` then says where along the partner it sits (`at`) and half the stretch it takes (`span`). | + +`kinds/clip.py` (clip and bar) and `kinds/hinge.py` (the five hinge families, three read from primitives and two from overrides only) are the worked examples; each has its numbers in `clip.json` or `hinge.json`. `mates_with` is declared once per kind and the registry makes it symmetric, so a half pairs only with the other half of its own family. Connectors already carry `ref` (for kinds whose turn about the axis matters) and `length` (for kinds that slide), so the connector shape does not change. @@ -48,5 +53,6 @@ Connectors already carry `ref` (for kinds whose turn about the axis matters) and 1. Selfcheck: `backend/venv/bin/python backend/formblocks_engine.py --selfcheck` imports the kinds. 2. With a library in reach, `./formblocks cli run part.connectors part=[number]` for each part you worked by hand: the counts, positions, axes and `source` must match your numbers. Run it with a throwaway data folder (`--settings-dir ''`) so no old cache answers. 3. Place two parts that should mate with `part.fit` and `part.place` and read `seated` and `joined`; run `overlap.check`. -4. Check the stud kind still answers as before: `part.connectors` for `3001` gives 8 studs and 11 anti-studs, as `spec/CONNECTIONS.md` Example 1 works out. -5. Log the kind, its sources and the parts you checked in `backend/app/connect/HASHOUT_LOG.md`, in the same commit as the module. +4. Check the stud kind still answers as before: `part.connectors` for `3001` gives 8 studs and 11 anti-studs, as `spec/CONNECTIONS.md` Example 1 works out. `part.connectors` takes `kind` to list one kind, and its counts always cover every kind. +5. A mate that is a line needs the half turned first: snapping never turns a part. Check a pair with `part.fit` once turned and once not, as `spec/CONNECTIONS.md`, "Worked snaps: a clip along a bar, and hinge halves", does, and read `seated`. +6. Log the kind, its sources and the parts you checked in `backend/app/connect/HASHOUT_LOG.md`, in the same commit as the module. diff --git a/.agents/skills/formblocks-harness/sub-skills/add-dock-program/SUB-SKILL.md b/.agents/skills/formblocks-harness/sub-skills/add-dock-program/SUB-SKILL.md index fd877a7..406f3d8 100644 --- a/.agents/skills/formblocks-harness/sub-skills/add-dock-program/SUB-SKILL.md +++ b/.agents/skills/formblocks-harness/sub-skills/add-dock-program/SUB-SKILL.md @@ -41,4 +41,5 @@ The Outside agents tab is the model: kind `agent`, read only, made by the engine ## Checking -Only Claude Code may be real on a check machine, and nothing may sign in or start a paid turn. Codex may be installed from the npm registry into a scratch prefix under `/tmp` to check its version call and that it takes the arguments. Every other program is checked with a stand-in: a script under `/tmp` named as the program, put on the path through `FORMBLOCKS_[PROGRAM]_BIN`, which records its arguments, folder, environment names and the MCP entry it finds, then calls the MCP address with the token it was given. Open its tab in the window headless (`sub-skills/verify/SUB-SKILL.md`), then check: `formblocks_status` with the tab's token answers 200, `/api/terminal` with it 403, the token absent from the arguments, 401 after the tab closes, the shell tab's environment without either variable, `./formblocks [program] --print-config`, `./formblocks agents status`, and layout shift 0 opening and closing the tab. Say which programs were real and which were stand-ins. +Nothing may sign in or start a paid turn. On 27 November 2026 all four programs were real on a check machine: Claude Code from the machine, Codex from the npm registry into a scratch prefix, and Cursor's agent and Antigravity from their own installers into a scratch home folder given to the engine as `HOME`, so the finder found them in their known folders. +When an installer cannot be reached, or for a program being added, use a stand-in: a script under `/tmp` named as the program, put on the path through `FORMBLOCKS_[PROGRAM]_BIN`, which records its arguments, folder, environment names and the MCP entry it finds, then calls the MCP address with the token it was given. Open its tab in the window headless (`sub-skills/verify/SUB-SKILL.md`), then check: `formblocks_status` with the tab's token answers 200, `/api/terminal` with it 403, the token absent from the arguments, 401 after the tab closes, the shell tab's environment without either variable, `./formblocks [program] --print-config`, `./formblocks agents status`, and layout shift 0 opening and closing the tab. Say which programs were real and which were stand-ins. diff --git a/.agents/skills/formblocks-harness/sub-skills/add-pane/SUB-SKILL.md b/.agents/skills/formblocks-harness/sub-skills/add-pane/SUB-SKILL.md index d53f42e..65942d2 100644 --- a/.agents/skills/formblocks-harness/sub-skills/add-pane/SUB-SKILL.md +++ b/.agents/skills/formblocks-harness/sub-skills/add-pane/SUB-SKILL.md @@ -24,5 +24,6 @@ Load `sub-skills/laws-and-logs/SUB-SKILL.md` first. The window renders what the 4. Style it in `frontend/src/styles/[name].css`, linked once in `frontend/index.html` beside the others. Every colour, space, size and layer is a `var(--...)` from `styles/tokens.css`; add a token there when none fits. No raw colour, no numeric `z-index`. Interface text goes in `ui/strings.ts`. 5. Icons: add a hand-written inline `currentColor` SVG to `ui/icons.ts` and use `icon('[name]')`. No icon library, no copied icon art, never a three-star sparkle. 6. A window command (a button, a menu item, a key) is added through `commands` in `ui/commands.ts`, so the palette, the menu and the keys all find it. A command that changes the document calls `runCommand` with an engine command; it never changes the view directly. -7. A new region of the shell is a change to `SHELL` and `ShellHosts` in `ui/shell.ts` and to the grid in `styles/shell.css`. Make it only when no existing host fits, and log why in `frontend/HASHOUT_LOG.md`. The right column's tabs (Model, Steps, Parts) come from the one list in `ui/tabs.ts`; a pane there takes its host with `tabHost(name, fn)` and hears `onTabShown`. A list that can grow long uses `RowScroller` from `ui/parts-list-scroller.ts` and its rules (`sub-skills/parts-list-rows/SUB-SKILL.md`). A panel over the view, like Save Picture, is built once hidden and shown at its final size. +7. A new region of the shell is a change to `SHELL` and `ShellHosts` in `ui/shell.ts` and to the grid in `styles/shell.css`. Make it only when no existing host fits, and log why in `frontend/HASHOUT_LOG.md`. The right column's tabs (Model, Steps, Parts, Info) come from the one list in `ui/tabs.ts`; a pane there takes its host with `tabHost(name, fn)` and hears `onTabShown`. The column is three sections, the colour palette, the tabs and the details panel, laid out and folded by `ui/splits.ts` with their least, default and greatest heights and the header height from `styles/tokens.css`; the tab section takes the room the other two leave, the heights and folds are kept in the engine's `right_column` setting and read before the first paint, and Reset Right Column is a window command. + A new tab never changes those heights: give it a place in the one list and fill its host in place, as the Info tab does (`ui/model-info.ts`, every value's place present before it arrives). A list that can grow long uses `RowScroller` from `ui/parts-list-scroller.ts` and its rules (`sub-skills/parts-list-rows/SUB-SKILL.md`). A panel over the view, like Save Picture, is built once hidden and shown at its final size. 8. Verify: `npm run typecheck` and `npm run build` in `frontend/`, then look at the window headless (`sub-skills/verify/SUB-SKILL.md`, "Looking at the window"): a screenshot of the pane, and a hard reload under 4x CPU and network throttling with a layout shift score of 0. Say what you looked at, or that it was not run. Log the decision in `frontend/HASHOUT_LOG.md` in the same commit. diff --git a/.agents/skills/formblocks-harness/sub-skills/freeze-and-ship/SUB-SKILL.md b/.agents/skills/formblocks-harness/sub-skills/freeze-and-ship/SUB-SKILL.md index 6a13d0c..288fc67 100644 --- a/.agents/skills/formblocks-harness/sub-skills/freeze-and-ship/SUB-SKILL.md +++ b/.agents/skills/formblocks-harness/sub-skills/freeze-and-ship/SUB-SKILL.md @@ -19,7 +19,7 @@ Nothing in this repository pushes, signs (beyond the frozen engine on macOS) or | `./build_app` | a desktop build for a person, start to finish | Logs to `build_app.log`; `--no-install`, `--install`, `--open`, `--clean`, `--config FILE`. | | `./formblocks clean`, `clean --all` | removes build output; `--all` also the venv and `node_modules` | Ask before `--all`: other agents may be using them. | -Windows has a `.bat` twin of every script. A desktop build needs WebKitGTK (`libwebkit2gtk-4.1-dev`) on Linux; where it is missing, as on the check machines here, no Tauri build runs: say so, never claim one passed. +Windows has a `.bat` twin of every script. A desktop build needs WebKitGTK (`libwebkit2gtk-4.1-dev`) on Linux; where it is missing no Tauri build runs: say so, never claim one passed. One Linux build (deb and AppImage, unsigned) has run; its report is in `src-tauri/HASHOUT_LOG.md`. Its self-check imports numpy and every module, and the freeze must carry the connector data files (clip and hinge kinds included). macOS, Windows, signing and rpm are not run. ## Data files the freeze must carry diff --git a/.agents/skills/formblocks-harness/sub-skills/verify/SUB-SKILL.md b/.agents/skills/formblocks-harness/sub-skills/verify/SUB-SKILL.md index bb6ae9b..0bb322c 100644 --- a/.agents/skills/formblocks-harness/sub-skills/verify/SUB-SKILL.md +++ b/.agents/skills/formblocks-harness/sub-skills/verify/SUB-SKILL.md @@ -44,7 +44,7 @@ This is the method the 0.4.0 lanes used, several at once in one tree. Then do each interaction you built and add up `window.__shifts` entries without `input`. A score above 0 on load or on any of them is a defect to fix. Vite's development server sends hundreds of modules, so under this network a load takes over a minute: give it the time rather than lifting the throttle. 6. The outside agent path: run `./formblocks mcp` as a child process speaking JSON-RPC on its standard input and output, call the tool in one thread, and answer the window's question from Playwright in the other. The question is a dialog; the dock's Chat holds a hidden button of the same name, so pick the visible one (`page.get_by_role("button", name="Allow once", exact=True).locator("visible=true")`). The answer from a test is yours as the person in a scratch data folder, never an agent's on a real one. -7. Agent programs: only Claude Code may be real here, never signed in; the others are stand-ins (`sub-skills/add-dock-program/SUB-SKILL.md`). Say which were which. +7. Agent programs: never sign in. Use the real programs where they install (all four did on 27 November 2026) and a stand-in where one cannot (`sub-skills/add-dock-program/SUB-SKILL.md`). Say which were which. 8. Scripts, screenshots and data stay under `/tmp`, never in the repository. Stop the engine, Vite and the browser when the check is done, each by the process id you started; never by name, since other lanes' engines carry the same name. ## What CI runs diff --git a/.claude/skills/formblocks-driving/SKILL.md b/.claude/skills/formblocks-driving/SKILL.md index 10c3e7a..906173e 100644 --- a/.claude/skills/formblocks-driving/SKILL.md +++ b/.claude/skills/formblocks-driving/SKILL.md @@ -1,10 +1,10 @@ --- name: formblocks-driving -description: "Use when asked to build, stack, change, check, picture or save a brick model in FormBlocks through its MCP tools or ./formblocks cli: a wall, a tower, a house, a table, any LDraw model. Finds parts and colours in the LDraw parts library, places and seats bricks on placements or the ground, builds walls in overlapping courses with plates, tiles and slopes, moves, drags, turns, duplicates and recolours parts, uses the selection and submodels, splits a model into building steps and walks them, counts parts and saves the parts list as CSV, saves PNG pictures and reads them back to check a build, checks overlaps and floating parts, and opens, saves and exports .fblk, .ldr and .mpd files. Covers Claude Code, Codex, Cursor and Antigravity in the agent dock or outside it, and the person's approval, which an agent never gives itself. Includes worked examples, coordinates, error codes and scripts. Not for changing FormBlocks' source code, installing or building it (formblocks-harness)." +description: "Use when asked to build, stack, change, check, picture or save a brick model in FormBlocks through its MCP tools or ./formblocks cli: a wall, a tower, a house, a table, any LDraw model. Finds parts and colours in the LDraw parts library, places and seats bricks, clips and hinge halves on placements or the ground, builds walls in overlapping courses with plates, tiles and slopes, moves, turns, duplicates and recolours parts, uses the selection and submodels, splits a model into steps and walks them, counts parts and saves the parts list as CSV, saves PNG pictures and reads them back to check a build, checks overlaps, and opens, saves and exports .fblk, .ldr and .mpd files. Covers Claude Code, Codex, Cursor and Antigravity in the agent dock or outside it, and the person's approval, which an agent never gives itself. Includes worked examples, coordinates, error codes and scripts. Not for changing FormBlocks' source code or installing it (formblocks-harness)." license: Apache-2.0 metadata: product: FormBlocks - pack-version: "0.4.0" + pack-version: "0.5.0" audience: operating agent --- @@ -20,14 +20,17 @@ FormBlocks keeps one open model in its engine: submodels holding placements of L | Search words, categories, part numbers, moved parts, parts of other systems | `sub-skills/finding-parts/SUB-SKILL.md` | | Colour codes, colour names, finishes, colour 16 inside submodels, recolouring | `sub-skills/colours/SUB-SKILL.md` | | Studs and anti-studs, seating on a part or the ground, part.place, part.fit, on, seated, refused placements | `sub-skills/placing-and-snapping/SUB-SKILL.md` | +| Clips on bars, hinge halves, hinge plates and bricks, swivel plates, sliding a clip, folding a hinge, part.connectors kinds | `sub-skills/clips-and-hinges/SUB-SKILL.md` | | Planning a build, walls in overlapping courses, corners, openings, plates and tiles, roofs of slopes | `sub-skills/building-in-order/SUB-SKILL.md` | | Moving, turning, duplicating, recolouring, hiding, showing and deleting placements, undo and redo | `sub-skills/changing-parts/SUB-SKILL.md` | +| Turning parts by any angle, about a point, an axis or a hinge's axis, part.pivot, the angle step, a turn lifted or refused | `sub-skills/turning-parts/SUB-SKILL.md` | | Moving or copying parts along a pointer ray as the window drags them, part.pick, the scene's axes, resting across a gap, what the person's drags and Ctrl+D do | `sub-skills/moving-parts/SUB-SKILL.md` | | Reading and setting the selection, selecting by colour or part, showing the person which parts | `sub-skills/selection/SUB-SKILL.md` | | Packing repeated units into submodels, placing uses, editing inside one, unpacking, renaming, deleting | `sub-skills/submodels/SUB-SKILL.md` | | Building steps: what a sensible step is, adding, naming, moving and deleting steps, the step shown | `sub-skills/steps/SUB-SKILL.md` | | Walking the steps: step.goto by number or first, previous, next, last, what each step adds, dimmed earlier steps, leaving the step shown right | `sub-skills/step-walking/SUB-SKILL.md` | | New, open, save, save as, LDraw export, inserting a model, what `.fblk`, `.ldr`, `.mpd` and `.dat` keep | `sub-skills/files/SUB-SKILL.md` | +| What a model is: its name, description, author, licence, counts, size, file facts, missing parts, and setting them (the Info tab) | `sub-skills/model-information/SUB-SKILL.md` | | Checking a build: the overlap check, floating parts, reading the model back, counting parts | `sub-skills/checking-a-model/SUB-SKILL.md` | | The parts list: counts per part and colour, scopes, missing and moved parts, selecting a row's parts, saving it as CSV | `sub-skills/parts-list/SUB-SKILL.md` | | A picture of the model or of every step, and looking at your own build by saving a PNG and reading it back | `sub-skills/pictures/SUB-SKILL.md` | diff --git a/.claude/skills/formblocks-driving/evals/evals.json b/.claude/skills/formblocks-driving/evals/evals.json index 8a56786..5df2ecb 100644 --- a/.claude/skills/formblocks-driving/evals/evals.json +++ b/.claude/skills/formblocks-driving/evals/evals.json @@ -92,6 +92,36 @@ "Refuses to answer the window's question or change the standing choice, and says the person can choose Always allow or set it in the Outside agents dialog", "Refuses to fetch the library or type the consent words, and names the library card or the command the person runs" ] + }, + { + "id": 9, + "name": "turn-by-45", + "prompt": "Turn the red brick p1 45 degrees about its up axis in FormBlocks and tell me if anything is wrong afterwards.", + "files": [], + "expected_behavior": [ + "Sends part.rotate with ids [p1], axis y and angle 45, not quarter_turns, and passes ids rather than relying on the selection", + "Reads the answer's lifted value, runs overlap.check afterwards, and says a turn that is not a quarter turn seats nothing" + ] + }, + { + "id": 10, + "name": "open-a-hinge", + "prompt": "Put a 44301a hinge half beside the 44302a at the top of my model and open the hinge 90 degrees.", + "files": [], + "expected_behavior": [ + "Turns the half a half turn about y before placing it near its partner, because snapping never turns a part, and reads seated and joined", + "Reads part.pivot for the hinge's point and axis and sends part.rotate with axis_vector, about and angle 90 for that half only" + ] + }, + { + "id": 11, + "name": "who-made-this-model", + "prompt": "How big is the open model, how many different parts and colours does it use, and which parts is the library missing? Put my name as the author.", + "files": [], + "expected_behavior": [ + "Reads model.info with table false and answers from counts, size and missingParts", + "Sets the author with model.set_info and says it is one undo step; does not touch the licence line" + ] } ], "trigger_evals": [ @@ -105,6 +135,9 @@ { "query": "register the formblocks MCP server with my agent", "should_trigger": true }, { "query": "how many bricks does this model need, save the parts list as csv", "should_trigger": true }, { "query": "save a picture of each building step of my brick model", "should_trigger": true }, + { "query": "tilt this brick 22.5 degrees and tell me if it lifted off the ground in FormBlocks", "should_trigger": true }, + { "query": "clip the plate onto the bar and slide it along in my brick model", "should_trigger": true }, + { "query": "what licence and author does my open brick model carry and how many studs across is it", "should_trigger": true }, { "query": "add a new MCP tool to the FormBlocks engine source", "should_trigger": false }, { "query": "fix the typecheck error in the FormBlocks window code", "should_trigger": false }, { "query": "write a parser for LDraw files in Rust", "should_trigger": false }, diff --git a/.claude/skills/formblocks-driving/references/command-catalogue.md b/.claude/skills/formblocks-driving/references/command-catalogue.md index 3e76eb4..9c9f875 100644 --- a/.claude/skills/formblocks-driving/references/command-catalogue.md +++ b/.claude/skills/formblocks-driving/references/command-catalogue.md @@ -4,8 +4,8 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never ## Contents -- MCP tools: the 69 tools an agent sees, each with whether it only reads. -- Commands: the 63 catalogue commands with their titles, parameters and summaries, in name order. +- MCP tools: the 72 tools an agent sees, each with whether it only reads. +- Commands: the 66 catalogue commands with their titles, parameters and summaries, in name order. ## MCP tools @@ -17,12 +17,13 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | `formblocks_redo` | no | Redo changes that formblocks_undo took back, one step each. A new change after an undo empties what can be redone. Returns {revision, labels, label}. | | `formblocks_status` | yes | Read what this FormBlocks is: its version, the model's revision, placement count, file and unsaved mark, how many commands there are, its data folder, whether the window's engine is running, and the person's standing choice for outside agents (ask, allowed or blocked). Call it first. | | `formblocks_undo` | no | Undo the last changes, one step per command. Returns {revision, labels, label}: the new revision and the titles of the commands taken back, newest first. Nothing to undo answers an empty labels list. | +| `cmd_angle_step` | yes | Choose the angle step a turn with the pointer moves in and Alt with R, T or Y turns by: 90, 45, 22.5, 15, 5 or 1 degrees. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | | `cmd_colours_current` | yes | Choose the colour the next placed part gets, and put it at the front of the recent colours. Kept as the person's setting; it recolours nothing. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | | `cmd_colours_list` | yes | List the library's colours with code, name, value, edge and finish, or the swatches of one group, hue family or name words. Only reads. | | `cmd_colours_used` | yes | List the colours used in the open model, most used first: each colour's number, name, value, how many parts of the whole model are in it, and whether the library defines it. Only reads. | | `cmd_grid_step` | yes | Choose the grid step: stud (20 LDU across, 8 up), plate (10 across, 8 up) or fine (1 and 1). Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | | `cmd_library_status` | yes | Read whether a parts library is in use, where it was found, its update, whether its index is ready, the fetch in progress if any, and the consent and attribution the library card shows. Reading never fetches; only the person can consent to a fetch. Only reads. | -| `cmd_model_info` | yes | Read the model's name, author, file and library update, its counts (parts through every use, different parts, part and colour pairs, submodels, steps), its size in LDU, studs, bricks and millimetres, and its parts list. Only reads. | +| `cmd_model_info` | yes | Read the model's name, description (its title line), author, file, format and the library update it was saved with and the one in use; its counts (placements, parts through every use, different parts, colours, part and colour pairs, submodels, steps, missing parts, and overlapping pairs as overlap.check counts them); the parts the library lacks by number; its size in LDU, studs, bricks and millimetres; the licences model.set_info accepts; and its parts list unless table is false. Only reads. | | `cmd_model_insert` | no | Bring another .ldr, .mpd or .fblk file into the open model as new submodels and place one use of its main model. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_model_new` | no | Start a new model named Untitled with one empty step, and a new history. Opens, starts or writes a model file; not an undo step. An outside agent waits for the person to allow it in the window. | | `cmd_model_open` | no | Open a .fblk, .ldr, .mpd or .dat file by its full path; a library part file opens as a new model holding one placement of the part. Opens, starts or writes a model file; not an undo step. An outside agent waits for the person to allow it in the window. | @@ -32,9 +33,10 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | `cmd_model_save_as` | no | Write the model to a new path: .fblk saves the project file and makes it the model's file; .ldr or .mpd exports LDraw without FormBlocks' own state. Opens, starts or writes a model file; not an undo step. An outside agent waits for the person to allow it in the window. | | `cmd_model_set_info` | no | Change the main model's title, author or licence, as written in its header: the licence is empty or one of the Creative Commons licences listed in its parameter. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_model_tree` | yes | Read one submodel's steps and placements, each with its id, part, colour, position, rotation, step and hidden mark, and the submodels with their uses. Only reads. | -| `cmd_overlap_check` | yes | List each pair of overlapping placements with the depth of the overlap in LDU, for the given placements or the whole model; parts joined through seated connectors never count. Only reads. | -| `cmd_overlap_set` | yes | Turn the coarse overlap check on or off: with it on, placing and moving never put a part where its box would overlap another's. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | -| `cmd_part_connectors` | yes | List a library part's connectors as the connection model derives them: kind, position, axis and where each came from, with the counts, the body box and the footprint. Only reads. | +| `cmd_overlap_check` | yes | List each pair of overlapping placements, for the given placements or the whole model: two parts whose real shapes cut more than 1 LDU into each other, with the depth in LDU and the shared volume in cubic LDU. Parts joined through seated connectors never count. Nested pairs, one part sitting in another's hollow by design, are counted apart in nested_count and listed under nested when asked. Only reads. | +| `cmd_overlap_nested` | yes | Choose what the overlap check reports: false reports only real overlaps (the proposed default), true reports nested pairs too, parts that sit in another's hollow by design, such as a rim in its tyre or a pin in its hole. Nested pairs never block placing or moving either way. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | +| `cmd_overlap_set` | yes | Turn the overlap check on or off: with it on, placing and moving never put a part where its real shape would cut more than 1 LDU into another's. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. | +| `cmd_part_connectors` | yes | List a library part's connectors as the connection model derives them: kind, position, axis, ref, length, index and where each came from, with the counts, the body box and the footprint; kind keeps only connectors of one kind. Only reads. | | `cmd_part_delete` | no | Remove placements from the model; deleting the last use of a submodel keeps the submodel. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_duplicate` | no | Copy placements, keeping colours and relative places, offset by delta; the copies go into the step shown and become the selection. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_duplicate_at_ray` | no | Drop copies of a selection where a pointer ray in the window's scene axes takes the copy of the grabbed placement, seated, on the grid or refused as the drag preview with copy answers; the copies keep their colours and places relative to one another, go into the step shown and become the selection. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | @@ -44,10 +46,11 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | `cmd_part_move` | no | Move placements by an offset in LDU, exactly, with no snapping. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_move_at_ray` | no | Put down a dragged selection where a pointer ray in the window's scene axes takes the grabbed placement, seated, on the grid or refused exactly as the drag preview answers, resting on what lies under its footprint when the place under the pointer would cut into another part; the others keep their places relative to it. Give held as the drag preview answered it so the part lands as previewed. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_pick` | yes | Name the placement of the submodel being edited that a pointer ray in the window's scene axes meets first on its real triangles, with the point and the face's normal, or the ground; hidden parts are passed through. Only reads. | +| `cmd_part_pivot` | yes | Say what placements turn about when the pivot dial turns them: the centre of the box around their shapes with the X, Y and Z axes, or, for one part joined by a hinge, the hinge's point and axis alone; with a pointer ray, the point where it meets a part of the submodel being edited (or the connector within 8 LDU of it), with X, Y and Z, and as without a ray when it meets none. Each point and axis in LDraw's axes and in the window's scene axes, with how far the box reaches from the point. Only reads. | | `cmd_part_place` | no | Place a part, or a use of a submodel, in a colour: at a position, seated on its connectors when snapping is on, or seated on another placement with on; it goes into the step shown and becomes the selection. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_place_at_ray` | no | Place a library part where a pointer ray in the window's scene axes puts it, seated, on the grid or refused exactly as the placement preview answers, resting on what lies under its whole footprint when the place under the pointer would cut into another part; it goes into the step shown of the submodel being edited and becomes the selection. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_recolour` | no | Give placements a colour; a use of a submodel in colour 16 passes it to its parts in colour 16. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | -| `cmd_part_rotate` | no | Turn placements by quarter turns about the X, Y or Z axis through a point, by default the centre of their origins. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | +| `cmd_part_rotate` | no | Turn placements about an axis through a point: by whole quarter turns, or by an angle in degrees, about X, Y, Z or any direction in LDraw axes, about the centre of their box when no point is given. What turned is lifted straight up when it would end below the ground, and with the overlap check on a turn into a part that does not turn is refused. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_set_transform` | no | Put one placement at an exact position, rotation or both, as the details panel does. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_part_show` | no | Show hidden placements again; every hidden placement in the model when no ids are given (Show all). Changes the model; one undo step. An outside agent waits for the person to allow it in the window. | | `cmd_parts_list` | yes | Read the parts a model needs, one row per part and colour with its description, colour name, count and the placements of the submodel being edited that hold it; a submodel's parts counted once for each use unless submodels is row, a moved part counted under the number it moved to, parts missing from the library first and marked. With text true the answer also holds the list as tab separated text. Only reads. | @@ -85,12 +88,13 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | Command | Title | Reads only | Parameters | What it does | | --- | --- | --- | --- | --- | +| `angle.step` | Angle Step | yes | `step` (number) | Choose the angle step a turn with the pointer moves in and Alt with R, T or Y turns by: 90, 45, 22.5, 15, 5 or 1 degrees. Kept as the person's setting. | | `colours.current` | Current Colour | yes | `colour` (integer) | Choose the colour the next placed part gets, and put it at the front of the recent colours. Kept as the person's setting; it recolours nothing. | | `colours.list` | Colours | yes | `text` (string, optional), `group` (string, optional), `hue` (string, optional) | List the library's colours with code, name, value, edge and finish, or the swatches of one group, hue family or name words. | | `colours.used` | Colours Used | yes | none | List the colours used in the open model, most used first: each colour's number, name, value, how many parts of the whole model are in it, and whether the library defines it. | | `grid.step` | Grid Step | yes | `step` (string) | Choose the grid step: stud (20 LDU across, 8 up), plate (10 across, 8 up) or fine (1 and 1). Kept as the person's setting. | | `library.status` | Library Status | yes | none | Read whether a parts library is in use, where it was found, its update, whether its index is ready, the fetch in progress if any, and the consent and attribution the library card shows. Reading never fetches; only the person can consent to a fetch. | -| `model.info` | Model Information | yes | none | Read the model's name, author, file and library update, its counts (parts through every use, different parts, part and colour pairs, submodels, steps), its size in LDU, studs, bricks and millimetres, and its parts list. | +| `model.info` | Model Information | yes | `table` (boolean, optional) | Read the model's name, description (its title line), author, file, format and the library update it was saved with and the one in use; its counts (placements, parts through every use, different parts, colours, part and colour pairs, submodels, steps, missing parts, and overlapping pairs as overlap.check counts them); the parts the library lacks by number; its size in LDU, studs, bricks and millimetres; the licences model.set_info accepts; and its parts list unless table is false. | | `model.insert` | Insert LDraw Model | no | `path` (string), `position` (array, optional), `submodel` (string, optional) | Bring another .ldr, .mpd or .fblk file into the open model as new submodels and place one use of its main model. | | `model.new` | New Model | no | `discard` (boolean, optional) | Start a new model named Untitled with one empty step, and a new history. | | `model.open` | Open | no | `path` (string), `discard` (boolean, optional) | Open a .fblk, .ldr, .mpd or .dat file by its full path; a library part file opens as a new model holding one placement of the part. | @@ -100,9 +104,10 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | `model.save_as` | Save As | no | `path` (string) | Write the model to a new path: .fblk saves the project file and makes it the model's file; .ldr or .mpd exports LDraw without FormBlocks' own state. | | `model.set_info` | Set Model Information | no | `title` (string, optional), `author` (string, optional), `licence` (string, optional) | Change the main model's title, author or licence, as written in its header: the licence is empty or one of the Creative Commons licences listed in its parameter. | | `model.tree` | Model Tree | yes | `submodel` (string, optional) | Read one submodel's steps and placements, each with its id, part, colour, position, rotation, step and hidden mark, and the submodels with their uses. | -| `overlap.check` | Check Overlaps | yes | `ids` (array, optional) | List each pair of overlapping placements with the depth of the overlap in LDU, for the given placements or the whole model; parts joined through seated connectors never count. | -| `overlap.set` | Overlap Check | yes | `on` (boolean) | Turn the coarse overlap check on or off: with it on, placing and moving never put a part where its box would overlap another's. Kept as the person's setting. | -| `part.connectors` | Part Connectors | yes | `part` (string) | List a library part's connectors as the connection model derives them: kind, position, axis and where each came from, with the counts, the body box and the footprint. | +| `overlap.check` | Check Overlaps | yes | `ids` (array, optional), `nested` (boolean, optional) | List each pair of overlapping placements, for the given placements or the whole model: two parts whose real shapes cut more than 1 LDU into each other, with the depth in LDU and the shared volume in cubic LDU. Parts joined through seated connectors never count. Nested pairs, one part sitting in another's hollow by design, are counted apart in nested_count and listed under nested when asked. | +| `overlap.nested` | Nested Pairs | yes | `on` (boolean) | Choose what the overlap check reports: false reports only real overlaps (the proposed default), true reports nested pairs too, parts that sit in another's hollow by design, such as a rim in its tyre or a pin in its hole. Nested pairs never block placing or moving either way. Kept as the person's setting. | +| `overlap.set` | Overlap Check | yes | `on` (boolean) | Turn the overlap check on or off: with it on, placing and moving never put a part where its real shape would cut more than 1 LDU into another's. Kept as the person's setting. | +| `part.connectors` | Part Connectors | yes | `part` (string), `kind` (string, optional) | List a library part's connectors as the connection model derives them: kind, position, axis, ref, length, index and where each came from, with the counts, the body box and the footprint; kind keeps only connectors of one kind. | | `part.delete` | Delete | no | `ids` (array, optional) | Remove placements from the model; deleting the last use of a submodel keeps the submodel. | | `part.duplicate` | Duplicate | no | `ids` (array, optional), `delta` (array, optional) | Copy placements, keeping colours and relative places, offset by delta; the copies go into the step shown and become the selection. | | `part.duplicate_at_ray` | Duplicate at Pointer | no | `grab` (string), `origin` (array), `direction` (array), `rotation` (array, optional), `held` (integer, optional), `ids` (array, optional), `snap` (boolean, optional) | Drop copies of a selection where a pointer ray in the window's scene axes takes the copy of the grabbed placement, seated, on the grid or refused as the drag preview with copy answers; the copies keep their colours and places relative to one another, go into the step shown and become the selection. One undo step. | @@ -112,10 +117,11 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never | `part.move` | Move | no | `ids` (array, optional), `delta` (array) | Move placements by an offset in LDU, exactly, with no snapping. | | `part.move_at_ray` | Move Selection at Pointer | no | `grab` (string), `origin` (array), `direction` (array), `rotation` (array, optional), `held` (integer, optional), `ids` (array, optional), `snap` (boolean, optional) | Put down a dragged selection where a pointer ray in the window's scene axes takes the grabbed placement, seated, on the grid or refused exactly as the drag preview answers, resting on what lies under its footprint when the place under the pointer would cut into another part; the others keep their places relative to it. Give held as the drag preview answered it so the part lands as previewed. One undo step. | | `part.pick` | Pick at Pointer | yes | `origin` (array), `direction` (array), `ground` (boolean, optional) | Name the placement of the submodel being edited that a pointer ray in the window's scene axes meets first on its real triangles, with the point and the face's normal, or the ground; hidden parts are passed through. | +| `part.pivot` | Pivot | yes | `ids` (array, optional), `origin` (array, optional), `direction` (array, optional) | Say what placements turn about when the pivot dial turns them: the centre of the box around their shapes with the X, Y and Z axes, or, for one part joined by a hinge, the hinge's point and axis alone; with a pointer ray, the point where it meets a part of the submodel being edited (or the connector within 8 LDU of it), with X, Y and Z, and as without a ray when it meets none. Each point and axis in LDraw's axes and in the window's scene axes, with how far the box reaches from the point. | | `part.place` | Place Part | no | `part` (string), `colour` (integer), `position` (array, optional), `rotation` (array, optional), `submodel` (string, optional), `step` (integer, optional), `on` (string, optional), `snap` (boolean, optional) | Place a part, or a use of a submodel, in a colour: at a position, seated on its connectors when snapping is on, or seated on another placement with on; it goes into the step shown and becomes the selection. | | `part.place_at_ray` | Place Part at Pointer | no | `part` (string), `colour` (integer), `origin` (array), `direction` (array), `rotation` (array, optional), `held` (integer, optional), `step` (integer, optional), `snap` (boolean, optional) | Place a library part where a pointer ray in the window's scene axes puts it, seated, on the grid or refused exactly as the placement preview answers, resting on what lies under its whole footprint when the place under the pointer would cut into another part; it goes into the step shown of the submodel being edited and becomes the selection. | | `part.recolour` | Recolour | no | `ids` (array, optional), `colour` (integer) | Give placements a colour; a use of a submodel in colour 16 passes it to its parts in colour 16. | -| `part.rotate` | Rotate | no | `ids` (array, optional), `axis` (string), `quarter_turns` (integer), `about` (array, optional) | Turn placements by quarter turns about the X, Y or Z axis through a point, by default the centre of their origins. | +| `part.rotate` | Rotate | no | `ids` (array, optional), `axis` (string, optional), `quarter_turns` (integer, optional), `angle` (number, optional), `axis_vector` (array, optional), `about` (array, optional) | Turn placements about an axis through a point: by whole quarter turns, or by an angle in degrees, about X, Y, Z or any direction in LDraw axes, about the centre of their box when no point is given. What turned is lifted straight up when it would end below the ground, and with the overlap check on a turn into a part that does not turn is refused. One undo step. | | `part.set_transform` | Set Position and Rotation | no | `id` (string), `position` (array, optional), `rotation` (array, optional) | Put one placement at an exact position, rotation or both, as the details panel does. | | `part.show` | Show | no | `ids` (array, optional) | Show hidden placements again; every hidden placement in the model when no ids are given (Show all). | | `parts.list` | Parts List | yes | `scope` (string, optional), `group` (string, optional), `submodels` (string, optional), `text` (boolean, optional) | Read the parts a model needs, one row per part and colour with its description, colour name, count and the placements of the submodel being edited that hold it; a submodel's parts counted once for each use unless submodels is row, a moved part counted under the number it moved to, parts missing from the library first and marked. With text true the answer also holds the list as tab separated text. | diff --git a/.claude/skills/formblocks-driving/references/error-codes.md b/.claude/skills/formblocks-driving/references/error-codes.md index 59f5912..be3d89c 100644 --- a/.claude/skills/formblocks-driving/references/error-codes.md +++ b/.claude/skills/formblocks-driving/references/error-codes.md @@ -53,7 +53,7 @@ A command's sentence starts with the parameter it is about (`part:`, `on:`, `ids | "part: ... is not in the LDraw parts library in use" | Search with `parts.search` and place the number it answers. A number with letters (`3068b`) is a different part from the bare number. | | "No LDraw parts library is installed" | Nothing can be placed. Tell the person; only they can find or fetch the library (`sub-skills/parts-library/SUB-SKILL.md`). | | "position: give a position, a placement to seat on (on), or a pointer ray" | `part.place` needs `position` or `on`. | -| "position: the part would overlap ... with the overlap check on" | The person's overlap check is on and the place is taken. Pick another place; the check is coarse inside arches and hollows, so tell the person if a part is refused where it should fit. | +| "position: the part would overlap ... by ... LDU with the overlap check on, so it was not placed." | The person's overlap check is on and the place is taken by more than 1 LDU of real shape. Pick another place; a part whose surface is not closed can be refused where it should fit, so tell the person if that happens. | | "... must stay within 1000000 LDU of the origin" | A position or offset is out of range: check signs and units. | | "on: ... has no free connector that ... can seat on" | Every stud of that placement is taken. Seat on another placement, or give a position. | | "on: ... is hidden" | Hidden parts offer no connectors. Show it with `part.show` first, or use a position. | @@ -87,6 +87,6 @@ A command's sentence starts with the parameter it is about (`part:`, `on:`, `ids - `part.place` answering `"seated": false`: the part did not join anything. With the overlap check off (its first setting) it was put on the grid step instead and may float in the air or sit inside another part. Undo it and fix the position, unless a loose part is what you meant. - `part.place` with `on` seating on a different part of the target than you wanted: `on` takes the first free studs nearest the target's middle. Give a position for an exact place. -- `overlap.check` answering a `count` above 0: two parts share space. Undo the newer one or move it. +- `overlap.check` answering a `count` above 0: two parts share space. Undo the newer one or move it. A `nested_count` above 0 is not a fault: those parts sit in each other's hollows by design, and are listed only with `nested: true`. - `model.open` answering an `issueCount` above 0: some lines could not be read; `model.report` lists them. The rest of the file opened. - A JSON-RPC timeout on a `change` sent from outside: the person may still have the question open. Read the model before sending again. diff --git a/.claude/skills/formblocks-driving/sub-skills/building-in-order/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/building-in-order/SUB-SKILL.md index e359a5c..22c5308 100644 --- a/.claude/skills/formblocks-driving/sub-skills/building-in-order/SUB-SKILL.md +++ b/.claude/skills/formblocks-driving/sub-skills/building-in-order/SUB-SKILL.md @@ -47,7 +47,7 @@ Where two walls meet, let one wall run through the corner cell in one course and - A half turn about Y, `rotation` `[-1,0,0, 0,1,0, 0,0,-1]`, makes it face the back. - Lay a flat layer of plates on the walls first, so every slope has studs under its whole footprint. - A gable roof: a row of slopes facing front along the front edge and a row facing back along the back edge. Each further row steps in by one stud and up by one brick, standing on the studs of the row below and on filler bricks behind it. Close the ridge with plates or tiles over the last studs. -- The overlap check follows a slope's face in slabs 4 LDU thick, so a part held clear above the face is not refused, but one cutting into the face is. The slabs step by half a plate, so a part within a few LDU of the face can still be reported; tell the person why when it is. +- The overlap check compares real shapes, so a part held clear above a slope's face is not refused and one cutting more than 1 LDU into the face is. Where it still reports a part that fits, such as one tucked under a roof whose surface is not closed, tell the person why. ## After each course diff --git a/.claude/skills/formblocks-driving/sub-skills/changing-parts/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/changing-parts/SUB-SKILL.md index 6b42af5..4704707 100644 --- a/.claude/skills/formblocks-driving/sub-skills/changing-parts/SUB-SKILL.md +++ b/.claude/skills/formblocks-driving/sub-skills/changing-parts/SUB-SKILL.md @@ -17,7 +17,7 @@ Each command takes `ids`, a list of placement ids such as `["p3", "p4"]`. Left o | --- | --- | --- | | `part.move` | `ids`, `delta` | Moves by an exact offset in LDU, `[dx, dy, dz]`. No snapping: the parts go exactly where sent. Up is a negative `dy`. | | `part.set_transform` | `id`, `position`, `rotation` | Puts one placement at an exact position, an exact rotation, or both. | -| `part.rotate` | `ids`, `axis`, `quarter_turns`, `about` | Turns by quarter turns about `x`, `y` or `z`, right-handed about the positive axis; negative turns go the other way. It turns about `about` when given, otherwise about the centre of the placements' origins, and works out the new positions and matrices. | +| `part.rotate` | `ids`, `axis` or `axis_vector`, `quarter_turns` or `angle`, `about` | Turns by whole quarter turns or by an angle in degrees, right-handed about the positive axis; negative turns go the other way. It turns about `about` when given, otherwise about the centre of the box round the placements' shapes. Lifts a turn off the ground and, with the overlap check on, refuses one into a part that stays; `sub-skills/turning-parts/SUB-SKILL.md` has the rest. | | `part.duplicate` | `ids`, `delta` | Copies the placements with their colours and relative places, offset by `delta`. The copies go into the step shown and become the selection; the answer lists their new ids. | | `part.recolour` | `ids`, `colour` | Gives a colour code. Parts already in it are left as they are. | | `part.delete` | `ids` | Removes placements. Deleting the last use of a submodel keeps the submodel itself. | @@ -32,8 +32,9 @@ Each command takes `ids`, a list of placement ids such as `["p3", "p4"]`. Left o ## Turning in place - A quarter turn about Y of one 2 x 4 brick about its own origin turns it crosswise on the same spot; it may then overlap its neighbours. -- To turn a whole group as one, give all their ids: they turn about the centre of their origins and keep their places relative to one another. +- To turn a whole group as one, give all their ids: they turn about the centre of their box and keep their places relative to one another. - To turn about a stud, give `about` as that stud's position. +- Any other angle than a quarter turn is the same command with `angle` (`sub-skills/turning-parts/SUB-SKILL.md`). ## Repeating a row diff --git a/.claude/skills/formblocks-driving/sub-skills/checking-a-model/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/checking-a-model/SUB-SKILL.md index a022c85..a811ab9 100644 --- a/.claude/skills/formblocks-driving/sub-skills/checking-a-model/SUB-SKILL.md +++ b/.claude/skills/formblocks-driving/sub-skills/checking-a-model/SUB-SKILL.md @@ -9,16 +9,18 @@ Never report a build as done from memory of the commands you sent. Read the mode ## The overlap check -`overlap.check` (`cmd_overlap_check`) lists every pair of placements whose bodies overlap, with the depth of the overlap in LDU. Give `ids` to check only those placements against the rest; leave it out for the whole model. It works whatever the person's overlap switch says. +`overlap.check` (`cmd_overlap_check`) lists every pair of placements whose real shapes cut into each other, with the depth in LDU and the shared volume in cubic LDU. Give `ids` to check only those placements against their neighbours; leave it out for the whole model. It works whatever the person's overlap switch says. ```json -{"checked": 28, "overlaps": [], "count": 0} -{"checked": 5, "overlaps": [{"submodel": "untitled.ldr", "a": "p1", "b": "p5", "depth": 23.0}], "count": 1} +{"checked": 28, "overlaps": [], "count": 0, "nested_count": 0, "nested_listed": false} +{"checked": 2, "overlaps": [{"submodel": "untitled.ldr", "a": "p1", "b": "p2", "depth": 24.0, "kind": "overlap", "volume": 16952.0, "parts": ["3001.dat", "3001.dat"]}], "count": 1, "nested_count": 0, "nested_listed": false} ``` - `count` 0 is the goal. -- Parts seated on each other never count, and parts that only touch face to face never count. -- The check is coarse: each part is stood in for by a box round its body, without its studs, shrunk by half an LDU, and a part whose outline changes with height (a slope, a windscreen, a round part) by a stack of slabs 4 LDU thick, so the open wedge over a slope's face is free. The space inside an arch, under a hinge or inside a hollow still counts as solid, so a part tucked there is reported although it fits. Say so to the person rather than moving a part that is right. +- Parts seated on each other never count, and parts that only touch, or cut into each other by 1 LDU or less, never count. +- Since 0.5.0 each part is its real solid, studs included, filled into cells of 1 LDU, so a part tucked into a hollow, an arch or under a hinge without cutting into the walls is not an overlap. A part with a surface that is not closed, or a part the library lacks, can still be reported wrongly; say so to the person rather than moving a part that is right. +- A pair whose outlines meet but whose solids do not, and which no seated connector joins, such as a rim in its tyre or a pin in a hole, is a nested pair. Two hinge halves or a clip on a bar, seated, are fitted and not listed at all. It is counted in `nested_count` and listed only when you pass `nested: true` or the person's setting "Report nested pairs" is on (`nested_listed` says which). Nested pairs are never refused when placing, moving or turning. On the library's sample car the answer is 0 overlaps and 19 nested pairs. +- `overlap.nested` (`on`) is that setting, the person's, like the overlap switch: ask before you change it, and prefer `nested: true` on one call. - A depth near a whole brick (24) or plate (8) usually means a part was placed on top of another at the same height: undo it or move it. ## Seated, or floating @@ -41,7 +43,7 @@ Check the counts against the plan: the number of placements, the number in each ## Counting parts - `parts.list` counts what the model needs, one row per part and colour, a submodel's parts once per use, missing parts first; `parts.list_save` writes it as CSV. `sub-skills/parts-list/SUB-SKILL.md` gives the scopes and the answer. -- `model.info` (read) answers the model's name, author, file and library update, `counts` (`parts`, `differentParts`, `pairs`, `missing`, `submodels`, `steps`, `placements`), its `size` in LDU, studs, bricks and millimetres, and the parts list with it. +- `model.info` (read) answers the model's name, author, file and library update, `counts` (`parts`, `differentParts`, `pairs`, `colours`, `overlaps`, `missing`, `submodels`, `steps`, `placements`), `missingParts` by number, its `size` in LDU, studs, bricks and millimetres, and the parts list with it unless `table` is false (`sub-skills/model-information/SUB-SKILL.md`). - `colours.used` (read) lists each colour of the model with its number, name and how many parts are in it, most used first; `known` false marks a colour the library does not define. Check the counts against the plan: parts in each colour, kinds of part, the number of steps. diff --git a/.claude/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md new file mode 100644 index 0000000..a54221b --- /dev/null +++ b/.claude/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md @@ -0,0 +1,66 @@ +--- +name: clips-and-hinges +description: Seats and turns clips on bars and hinge halves on each other in FormBlocks with part.place, part.fit, part.connectors and part.rotate about a hinge axis. Use when asked to build with clips, bars, handles, hinges, hinge plates, hinge bricks or swivel plates, to fold or open a hinge, to slide a clip along a bar, when a clip or hinge half will not seat, or to read which clip, bar or hinge kinds a part has. +--- + +# Clips, bars and hinges + +Besides studs and anti-studs, the engine finds three more kinds of join from a part's own shape and snaps them with the same rule: `part.place`, `part.fit` and the window's drags all use it. Read the kinds of any part with `part.connectors` (`cmd_part_connectors`, read; pass `kind` to list only one kind, such as `clip`, `bar` or `hinge_click_1`). A part with none of them seats as before. + +## The kinds + +| Kind | Pairs with | What it is | +| --- | --- | --- | +| `clip` | `bar` | Jaws that close round a rod 8 LDU across, from the library's clip pieces, such as the one on `4085c`, a Plate 1 x 1 with Clip. | +| `bar` | `clip` | Any free rod of radius 4 with room round it for jaws: the handle of a plate with a handle, `87994` Bar 3L (free length 60 LDU), the rods of many accessories. Found from the shape, so a rod never meant to be gripped can count too. | +| `hinge_click_1`, `hinge_click_2` | each other | Single-finger and dual-finger click hinge halves, such as `44301a` and `44302a`. | +| `hinge_plate_2`, `hinge_plate_3` | each other | Two-finger and three-finger plate hinge halves, `4276b` and `4275b`. | +| `hinge_arm_2`, `hinge_arm_3` | each other | The hinge arm with discs. | +| `hinge_brick_base`, `hinge_brick_top` | each other | The 1 x 2 hinge brick, `3937` and `3938`. | +| `hinge_swivel_base`, `hinge_swivel_top` | each other | The 1 x 4 swivel hinge plates, `2429` and `2430`. | + +A half pairs only with the other half of its own family. A clip does not take a stud, and a bar does not go into an anti-stud. + +## Seating a clip on a bar + +The clip's centre is put on the bar's line, and it slides along the bar in grid steps measured from the bar's middle: at the Stud step the middle and 20 LDU either side of it, at Plate every 10, at Fine anywhere along the free length. One bar holds several clips side by side; a second clip over a taken stretch is not seated. + +```bash +./formblocks cli run part.place part=87994 colour=7 'position=[0,-80,0]' +./formblocks cli run part.set_transform id=p1 'position=[0,-80,0]' +./formblocks cli run part.place part=4085c colour=4 on=p1 +./formblocks cli run part.place part=4085c colour=4 'position=[2,-45,21]' +``` + +A floating bar is put exactly with `part.set_transform`, because `part.place` rounds an unseated part to the grid (the first line answered position `[4, -76, 4]` and `seated` false). With `on`, the clip took the first free stretch of the bar, its centre at y = -70. With a position, a clip whose centre was at y = -41 seated at -50, the nearest place at the Stud step. The clip of `4085c` is at `[0, 4, -20]` in the part's own axes (`part.connectors part=4085c`), so its origin ends up 4 above the clip's centre and 20 behind the bar's line. Always read `seated`, `joined` and `marks` in the answer. + +## Seating hinge halves + +Snapping never turns a part. Turn the half first so its pivot line runs the way its partner's does, then place it near: it moves so the two lines meet. + +```bash +./formblocks cli run part.place part=44302a colour=4 'position=[0,-100,0]' +./formblocks cli run part.set_transform id=p1 'position=[0,-100,0]' +./formblocks cli run part.place part=44301a colour=1 'position=[63,-102,2]' 'rotation=[-1,0,0,0,1,0,0,0,-1]' +``` + +The last answered `seated` true at `[60, -100, 0]`, one joined pair and a mark at `[30, -98, 0]`. With `part.fit`, the same half unturned at `[2, -101, 1]` answered `seated` false, a three-finger plate hinge half held against another `4275b` answered false, and a `4276b` held against a `4275b` turned a half turn answered true at `[60, -100, 0]`; unturned it answered false. `3938` seated on `3937` at `[0, -100, 0]`. + +## Opening and closing a hinge + +`part.pivot` (read) on a seated half answers `kind` `hinge`, the hinge's point as `about` and its axis in `axes` (LDraw and scene axes); a clip seated on a bar answers the same, since it turns on the bar. Give that point and axis to `part.rotate`: + +```bash +./formblocks cli run part.pivot 'ids=["p2"]' +./formblocks cli run part.rotate 'ids=["p2"]' 'axis_vector=[0,0,-1]' 'about=[30,-98,0]' angle=90 +``` + +The half turned 90 degrees, from `[60, -100, 0]` to `[28, -128, 0]`. `part.rotate` turns only the placements in `ids`: when other parts are attached to the half, give their ids too. A hinge turns all the way round; with the person's overlap check on, a turn into a part that does not turn is refused (`sub-skills/turning-parts/SUB-SKILL.md`). In the window the person turns the same half with the one ring of the pivot dial, in angle steps. + +## What overlap.check says + +Two halves joined by a seated hinge answered `count` 0. A clip seated on a bar, anywhere along it, answered `count` 0 and `nested_count` 0: a pair joined by a seated connector is fitted, never an overlap and never nested. + +## Not found, not built + +A hinge or clip drawn without the library's own pieces is found only where the engine's list of corrections names it (the 1 x 2 hinge brick, the swivel plates, the 1 x 1 tile with a clip); other parts do not snap, so place them by position and say so. Pins, axles, ball joints, a bar into a hole, hinge turning limits, click positions and flexible parts are not built: do not promise them. diff --git a/.claude/skills/formblocks-driving/sub-skills/files/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/files/SUB-SKILL.md index 0d46b5d..2b050bd 100644 --- a/.claude/skills/formblocks-driving/sub-skills/files/SUB-SKILL.md +++ b/.claude/skills/formblocks-driving/sub-skills/files/SUB-SKILL.md @@ -27,7 +27,7 @@ A saved file holds references to parts (`3001.dat`), never a part's own lines. F | `model.insert` | change | `path`, `position`, `submodel` | Brings another `.ldr`, `.mpd` or `.fblk` in as new submodels and places one use of its main model (at `position`, or the origin). | | `model.recent` | read | none | The last ten files opened or saved, newest first, each with whether it still exists. | | `model.report` | read | none | What opening reported: lines that could not be read, with their numbers, and the text encoding. | -| `model.info` | read | none | The model's title, author, licence, file, library update, counts and size. | +| `model.info` | read | `table` | The model's name, title, author, licence, file, library update, counts, size and missing parts, with its parts list unless `table` is false (`sub-skills/model-information/SUB-SKILL.md`). | | `model.set_info` | change | `title`, `author`, `licence` | Changes the main model's header: the title (its file's first line), the author, and the licence, empty or one of the Creative Commons licences the parameter lists. | Two other commands write files of their own and wait for the person like a save: `parts.list_save` (a CSV, `sub-skills/parts-list/SUB-SKILL.md`) and `picture.save` with `picture.steps` (PNG pictures, `sub-skills/pictures/SUB-SKILL.md`). diff --git a/.claude/skills/formblocks-driving/sub-skills/model-information/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/model-information/SUB-SKILL.md new file mode 100644 index 0000000..b9e46d0 --- /dev/null +++ b/.claude/skills/formblocks-driving/sub-skills/model-information/SUB-SKILL.md @@ -0,0 +1,40 @@ +--- +name: model-information +description: Reads and changes a FormBlocks model's own information, its name, description, author, licence, counts, size, file facts and missing parts, with model.info, model.set_info and submodel.rename, the facts the window shows in its Info tab. Use when asked what a model is, how big it is, how many parts, colours or steps it has, which parts the library lacks, who made it, what licence line it carries, or to set its title, author, licence or name. +--- + +# Model information + +The window's Info tab (the fourth tab of the right column) shows these facts and lets the person edit four of them. The engine counts every value; an agent reads and writes the same ones. + +## Reading: model.info + +`model.info` (`cmd_model_info`, read) answers: + +| Key | What it holds | +| --- | --- | +| `name`, `title`, `author`, `licence` | The main model's `Name:` line, its description (the title line an LDraw file starts with), its author, and the licence line, empty when none. | +| `path`, `kind`, `builtWith`, `library` | The file it came from or was saved to, its kind (`fblk`, `ldr`, `mpd`), the library update it was last saved with (`null` for an LDraw file that did not come from FormBlocks), and the update in use. | +| `counts` | `placements`, `parts` (through every use of a submodel), `differentParts`, `colours`, `pairs` (part and colour rows), `submodels`, `steps` of the main model, `missing` (parts the library lacks) and `overlaps` (as `overlap.check` counts them, nested pairs left out). | +| `size` | `ldu`, `studs`, `bricks`, `plates`, `mm` and the `box`; an LDU is 0.4 mm. | +| `missingParts` | Each part the library lacks: `part`, `file` and `count`. | +| `licences` | The licence lines `model.set_info` accepts. | +| `partsList`, `csv` | The parts list rows and its CSV text. Pass `table` false to leave them out; the answer is large on a big model. | + +On the library's sample car, `model.info` with `table` false answered 61 placements, 26 different parts, 7 colours, 32 rows, 8 steps, 0 overlaps and a size of 4.5 by 10.8 studs and 5.17 bricks high, which a hand count of the file matched. + +## Changing it + +| Command | Parameters | What it changes | +| --- | --- | --- | +| `model.set_info` | `title`, `author`, `licence` | The description, the author and the licence line. Any of them may be left out. `licence` is empty or one of the lines in `licences`; another is refused with the list. | +| `submodel.rename` | `name`, `new_name` | The main model's name when `name` is it, and every use of it. `.ldr` is added when `new_name` has no extension. | + +Each is a change command: one undo step labelled "Change model information" or "Rename ...", approved by the person when it comes from outside the window. A model that was never saved keeps its changes only in memory until `model.save_as`. + +## Habits + +- Read `counts` and `missingParts` before telling the person a build is complete; a part in `missingParts` is drawn as a marked box and counted in the parts list as "Not in this library". +- `overlaps` here is the same as `count` in `overlap.check`; for the pairs themselves call `overlap.check`. +- Set the licence line only when the person says which; it describes the model, never the parts, which keep their own licences. +- The window shows a changed value in place at once, because the tab is rewritten from the engine's answer. diff --git a/.claude/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md index d673fcd..43eb734 100644 --- a/.claude/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md +++ b/.claude/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md @@ -78,7 +78,7 @@ The full list is `references/error-codes.md`. ## The overlap check -The overlap check is the person's switch, off at the first start. With it on, `part.place` refuses a place where the part's body box would overlap another part's; with it off, parts may share space without a word. Either way `overlap.check` reports overlaps on demand (`sub-skills/checking-a-model/SUB-SKILL.md`). The switch, like snapping and the grid step, is the person's setting: ask before you change it, and prefer `overlap.check` after placing, which changes nothing. +The overlap check is the person's switch, off at the first start. With it on, `part.place` refuses a place where the part's real shape would cut more than 1 LDU into another part's (a part resting in a hollow it fits is not refused, and a nested pair never is); with it off, parts may share space without a word. Either way `overlap.check` reports overlaps on demand (`sub-skills/checking-a-model/SUB-SKILL.md`). The switch, like snapping and the grid step, is the person's setting: ask before you change it, and prefer `overlap.check` after placing, which changes nothing. ## Habits that save undo steps diff --git a/.claude/skills/formblocks-driving/sub-skills/turning-parts/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/turning-parts/SUB-SKILL.md new file mode 100644 index 0000000..a52a37b --- /dev/null +++ b/.claude/skills/formblocks-driving/sub-skills/turning-parts/SUB-SKILL.md @@ -0,0 +1,52 @@ +--- +name: turning-parts +description: Turns placed parts in FormBlocks by any angle with part.rotate (angle in degrees or quarter turns, about x, y or z or any axis_vector, about a point), reads what a turn would turn about with part.pivot, and explains the angle step, the pivot dial and J that the person uses in the window. Use when asked to turn, tilt, tip, roll, angle or swivel parts, to turn by 45 or 22.5 degrees, to turn about a stud, a corner or a hinge, when a turn lifts a part or is refused, or when the person talks about the pivot dial or the angle step. +--- + +# Turning parts + +A turn is one `part.rotate` and one undo step, whoever asks for it: the person's key, a drag on the pivot dial, or an agent. + +## What part.rotate takes + +| Parameter | Meaning | +| --- | --- | +| `ids` | Placement ids such as `["p1","p2"]`; the selection when left out, which may be the person's, so pass `ids`. | +| `axis` | `x`, `y` or `z`, LDraw's axes, `y` being up and down. Give this or `axis_vector`. | +| `axis_vector` | Any direction as `[x, y, z]` in LDraw axes, such as a hinge's axis, in place of `axis`. | +| `quarter_turns` | Whole quarter turns, right-handed about the positive axis; negative goes the other way. Give this or `angle`. | +| `angle` | Degrees, right-handed about the axis; negative goes the other way. | +| `about` | The point to turn about, in LDU. Left out, the centre of the box round the placements' real shapes. | + +Giving both `quarter_turns` and `angle`, or neither, or neither axis, is refused with a sentence that names the parameter. A quarter turn leaves a part where its studs can seat again; any other angle does not seat anything, and a turn never seats a part. Four quarter turns give back the same numbers exactly; other angles are settled to six places. + +```bash +./formblocks cli run part.rotate 'ids=["p1"]' axis=y angle=45 +./formblocks cli run part.rotate 'ids=["p1","p2"]' axis=y quarter_turns=1 'about=[0,0,0]' +``` + +The answer lists each turned placement with its new `position`, `rotation` and `matrix`, the `about` point, the `angle` and `axis` used, and `lifted`, how far the turned parts were raised. + +## Two rules the engine keeps + +- A turn never leaves a part below the ground. When the turned parts would end lower than the ground, the whole turned group is lifted straight up until it rests on it, and `lifted` says how far. A 2 x 4 brick standing on the ground, turned 45 degrees about y and then 90 about x, answered `lifted` 28.426 on the second turn. +- With the person's overlap check on, a turn that would push a turned part into a part that does not turn is refused and nothing turns: "ids: the turn would overlap p1 with p2 by 3.0 LDU with the overlap check on, so nothing was turned." With the check off the turn happens and `overlap.check` reports it afterwards. + +A turn of a whole number of full circles changes nothing and adds no undo step. + +## part.pivot + +`part.pivot` (read) says what the person's pivot dial turns about: for `ids` or the selection, `kind` `centre` with the centre of the box and the three axes in LDraw's axes (`about`, `axes`) and in the window's scene axes (`scene`), and `reach`, how far the box extends from the point. For one part joined by a hinge it answers the hinge's own point and axis alone. With a pointer ray (`origin`, `direction`, scene axes) it answers the point the ray meets on a part, or the connector within 8 LDU of it. Use it to find the axis for an `axis_vector` turn; it changes nothing. + +## The angle step, the person's setting + +`angle.step` (`step`: 90, 45, 22.5, 15, 5 or 1) sets the step the dial and Alt with R, T or Y turn by; it is the person's setting like the grid step, so ask before changing it. `part.rotate` does not use it: give the angle you want. + +## What the person sees + +Selected parts show a green pivot ring lying flat about the up axis; pressing on it and dragging turns them in angle steps, Shift for whole degrees, Esc to put them back. J shows three rings and a click on a part sets the pivot on its nearest connector. A key turn is Alt with R, T or Y; A goes to the next angle step. An agent's turn shows in the window at once. Typing an angle on the dial is not built; send `part.rotate` instead. + +## Traps + +- `part.rotate`'s `axis` is LDraw's, with -Y up. A pointer ray's axes are the scene's (`sub-skills/moving-parts/SUB-SKILL.md`). +- After a turn other than a quarter turn nothing is seated: check with `overlap.check`, and turn the part back or move it if the person wants it joined. diff --git a/.claude/skills/formblocks-harness/SKILL.md b/.claude/skills/formblocks-harness/SKILL.md index 00b4f7a..a0cc957 100644 --- a/.claude/skills/formblocks-harness/SKILL.md +++ b/.claude/skills/formblocks-harness/SKILL.md @@ -1,10 +1,10 @@ --- name: formblocks-harness -description: "Use when asked to install, boot, verify, debug, extend or release the FormBlocks repository itself: its engine code (the LDraw reader, parts library, meshes, connections, command catalogue), its window, its setup scripts, its agent dock wiring or its skill packs. Works on the checkout as a developer agent: the ./formblocks launcher, boot and ports, doctor, selfcheck, contract and agents checks, looking at the window headless under throttling with layout shift recorded, the CLAUDE.md laws (hand-made single-region edits, zero DOM flash or flicker, tokens, no emoji, HASHOUT logs, one commit identity), the clean room with spec/ as the authority, where code lives, what packages may import, and adding a command, a connector kind, a router, a pane, or an agent program to the dock. Also the picture round trip, the parts list's rows, the parts library's scratch copy, freezing the engine and the release. Not for building models in a running FormBlocks through its MCP tools or command line; that is formblocks-driving." +description: "Use when asked to install, boot, verify, debug, extend or release the FormBlocks repository itself: its engine code (the LDraw reader, parts library, meshes, connections, command catalogue), its window, its setup scripts, its agent dock wiring or its skill packs. Works on the checkout as a developer agent: the ./formblocks launcher, boot and ports, doctor, selfcheck, contract and agents checks, the window looked at headless under throttling with layout shift recorded, the CLAUDE.md laws (hand-made single-region edits, zero DOM flash, tokens, no emoji, HASHOUT logs, one commit identity), the clean room with spec/ as the authority, where code lives, and adding a command, a connector kind, a router, a pane, or an agent program to the dock. Also the picture round trip, the parts list's rows, the library's scratch copy, freezing the engine and the release. Not for building models in a running FormBlocks through its MCP tools or command line; that is formblocks-driving." license: Apache-2.0 metadata: product: FormBlocks - pack-version: "0.4.0" + pack-version: "0.5.0" audience: developer agent --- diff --git a/.claude/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md b/.claude/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md index a2075b1..1559257 100644 --- a/.claude/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md +++ b/.claude/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md @@ -1,6 +1,6 @@ --- name: add-connector-kind -description: Adds a connector kind to FormBlocks' connection model as a module that registers itself in backend/app/connect/kinds/, with its data beside it as JSON. Use when adding pins, axles, clips, bars, hinges or any joint beyond studs and anti-studs, when correcting the primitive list of an existing kind, or when a part's connectors come out wrong. +description: Adds a connector kind to FormBlocks' connection model as a module that registers itself in backend/app/connect/kinds/, with its data beside it as JSON. Use when adding a joint beyond studs, anti-studs, clips, bars and the hinge families, such as pins or axles, when correcting the primitive list of an existing kind, or when a part's connectors come out wrong. --- # Add a connector kind @@ -36,6 +36,11 @@ A subclass of `Kind` from `backend/app/connect/kinds/__init__.py`: | `from_mesh(mesh, connectors)` | Optional: connectors found from the whole flattened part. | | `mate(a, b)` | `None`, or a `Mate`: the correction that brings `a` onto `b`, the residual, and the `Freedom` left (`Freedom.spin`, `slide`, `hinge` or `fixed`). `axial_mate` covers round connectors on a shared axis. | | `blocks(connector, other)` | Optional: a blocked test of the kind's own, as the stud's blocked-stud test is. | +| `line` | True when the connector is a line, not a facing: its axis has no sign, the mate compares lines (clips, bars and hinge halves). | +| `takes_step` | True when the seat moves in grid steps: `mate(a, b, step)` is then also given the grid step's across value, and gets 0 when pairs are only being counted. | +| `spans` | True when a connector is a segment from `position` along `axis` for `length` (a bar): reach and mating distance are measured to the segment, the spatial hash keeps it by every cell it passes, and it is taken stretch by stretch. A `Mate` then says where along the partner it sits (`at`) and half the stretch it takes (`span`). | + +`kinds/clip.py` (clip and bar) and `kinds/hinge.py` (the five hinge families, three read from primitives and two from overrides only) are the worked examples; each has its numbers in `clip.json` or `hinge.json`. `mates_with` is declared once per kind and the registry makes it symmetric, so a half pairs only with the other half of its own family. Connectors already carry `ref` (for kinds whose turn about the axis matters) and `length` (for kinds that slide), so the connector shape does not change. @@ -48,5 +53,6 @@ Connectors already carry `ref` (for kinds whose turn about the axis matters) and 1. Selfcheck: `backend/venv/bin/python backend/formblocks_engine.py --selfcheck` imports the kinds. 2. With a library in reach, `./formblocks cli run part.connectors part=[number]` for each part you worked by hand: the counts, positions, axes and `source` must match your numbers. Run it with a throwaway data folder (`--settings-dir ''`) so no old cache answers. 3. Place two parts that should mate with `part.fit` and `part.place` and read `seated` and `joined`; run `overlap.check`. -4. Check the stud kind still answers as before: `part.connectors` for `3001` gives 8 studs and 11 anti-studs, as `spec/CONNECTIONS.md` Example 1 works out. -5. Log the kind, its sources and the parts you checked in `backend/app/connect/HASHOUT_LOG.md`, in the same commit as the module. +4. Check the stud kind still answers as before: `part.connectors` for `3001` gives 8 studs and 11 anti-studs, as `spec/CONNECTIONS.md` Example 1 works out. `part.connectors` takes `kind` to list one kind, and its counts always cover every kind. +5. A mate that is a line needs the half turned first: snapping never turns a part. Check a pair with `part.fit` once turned and once not, as `spec/CONNECTIONS.md`, "Worked snaps: a clip along a bar, and hinge halves", does, and read `seated`. +6. Log the kind, its sources and the parts you checked in `backend/app/connect/HASHOUT_LOG.md`, in the same commit as the module. diff --git a/.claude/skills/formblocks-harness/sub-skills/add-dock-program/SUB-SKILL.md b/.claude/skills/formblocks-harness/sub-skills/add-dock-program/SUB-SKILL.md index fd877a7..406f3d8 100644 --- a/.claude/skills/formblocks-harness/sub-skills/add-dock-program/SUB-SKILL.md +++ b/.claude/skills/formblocks-harness/sub-skills/add-dock-program/SUB-SKILL.md @@ -41,4 +41,5 @@ The Outside agents tab is the model: kind `agent`, read only, made by the engine ## Checking -Only Claude Code may be real on a check machine, and nothing may sign in or start a paid turn. Codex may be installed from the npm registry into a scratch prefix under `/tmp` to check its version call and that it takes the arguments. Every other program is checked with a stand-in: a script under `/tmp` named as the program, put on the path through `FORMBLOCKS_[PROGRAM]_BIN`, which records its arguments, folder, environment names and the MCP entry it finds, then calls the MCP address with the token it was given. Open its tab in the window headless (`sub-skills/verify/SUB-SKILL.md`), then check: `formblocks_status` with the tab's token answers 200, `/api/terminal` with it 403, the token absent from the arguments, 401 after the tab closes, the shell tab's environment without either variable, `./formblocks [program] --print-config`, `./formblocks agents status`, and layout shift 0 opening and closing the tab. Say which programs were real and which were stand-ins. +Nothing may sign in or start a paid turn. On 27 November 2026 all four programs were real on a check machine: Claude Code from the machine, Codex from the npm registry into a scratch prefix, and Cursor's agent and Antigravity from their own installers into a scratch home folder given to the engine as `HOME`, so the finder found them in their known folders. +When an installer cannot be reached, or for a program being added, use a stand-in: a script under `/tmp` named as the program, put on the path through `FORMBLOCKS_[PROGRAM]_BIN`, which records its arguments, folder, environment names and the MCP entry it finds, then calls the MCP address with the token it was given. Open its tab in the window headless (`sub-skills/verify/SUB-SKILL.md`), then check: `formblocks_status` with the tab's token answers 200, `/api/terminal` with it 403, the token absent from the arguments, 401 after the tab closes, the shell tab's environment without either variable, `./formblocks [program] --print-config`, `./formblocks agents status`, and layout shift 0 opening and closing the tab. Say which programs were real and which were stand-ins. diff --git a/.claude/skills/formblocks-harness/sub-skills/add-pane/SUB-SKILL.md b/.claude/skills/formblocks-harness/sub-skills/add-pane/SUB-SKILL.md index d53f42e..65942d2 100644 --- a/.claude/skills/formblocks-harness/sub-skills/add-pane/SUB-SKILL.md +++ b/.claude/skills/formblocks-harness/sub-skills/add-pane/SUB-SKILL.md @@ -24,5 +24,6 @@ Load `sub-skills/laws-and-logs/SUB-SKILL.md` first. The window renders what the 4. Style it in `frontend/src/styles/[name].css`, linked once in `frontend/index.html` beside the others. Every colour, space, size and layer is a `var(--...)` from `styles/tokens.css`; add a token there when none fits. No raw colour, no numeric `z-index`. Interface text goes in `ui/strings.ts`. 5. Icons: add a hand-written inline `currentColor` SVG to `ui/icons.ts` and use `icon('[name]')`. No icon library, no copied icon art, never a three-star sparkle. 6. A window command (a button, a menu item, a key) is added through `commands` in `ui/commands.ts`, so the palette, the menu and the keys all find it. A command that changes the document calls `runCommand` with an engine command; it never changes the view directly. -7. A new region of the shell is a change to `SHELL` and `ShellHosts` in `ui/shell.ts` and to the grid in `styles/shell.css`. Make it only when no existing host fits, and log why in `frontend/HASHOUT_LOG.md`. The right column's tabs (Model, Steps, Parts) come from the one list in `ui/tabs.ts`; a pane there takes its host with `tabHost(name, fn)` and hears `onTabShown`. A list that can grow long uses `RowScroller` from `ui/parts-list-scroller.ts` and its rules (`sub-skills/parts-list-rows/SUB-SKILL.md`). A panel over the view, like Save Picture, is built once hidden and shown at its final size. +7. A new region of the shell is a change to `SHELL` and `ShellHosts` in `ui/shell.ts` and to the grid in `styles/shell.css`. Make it only when no existing host fits, and log why in `frontend/HASHOUT_LOG.md`. The right column's tabs (Model, Steps, Parts, Info) come from the one list in `ui/tabs.ts`; a pane there takes its host with `tabHost(name, fn)` and hears `onTabShown`. The column is three sections, the colour palette, the tabs and the details panel, laid out and folded by `ui/splits.ts` with their least, default and greatest heights and the header height from `styles/tokens.css`; the tab section takes the room the other two leave, the heights and folds are kept in the engine's `right_column` setting and read before the first paint, and Reset Right Column is a window command. + A new tab never changes those heights: give it a place in the one list and fill its host in place, as the Info tab does (`ui/model-info.ts`, every value's place present before it arrives). A list that can grow long uses `RowScroller` from `ui/parts-list-scroller.ts` and its rules (`sub-skills/parts-list-rows/SUB-SKILL.md`). A panel over the view, like Save Picture, is built once hidden and shown at its final size. 8. Verify: `npm run typecheck` and `npm run build` in `frontend/`, then look at the window headless (`sub-skills/verify/SUB-SKILL.md`, "Looking at the window"): a screenshot of the pane, and a hard reload under 4x CPU and network throttling with a layout shift score of 0. Say what you looked at, or that it was not run. Log the decision in `frontend/HASHOUT_LOG.md` in the same commit. diff --git a/.claude/skills/formblocks-harness/sub-skills/freeze-and-ship/SUB-SKILL.md b/.claude/skills/formblocks-harness/sub-skills/freeze-and-ship/SUB-SKILL.md index 6a13d0c..288fc67 100644 --- a/.claude/skills/formblocks-harness/sub-skills/freeze-and-ship/SUB-SKILL.md +++ b/.claude/skills/formblocks-harness/sub-skills/freeze-and-ship/SUB-SKILL.md @@ -19,7 +19,7 @@ Nothing in this repository pushes, signs (beyond the frozen engine on macOS) or | `./build_app` | a desktop build for a person, start to finish | Logs to `build_app.log`; `--no-install`, `--install`, `--open`, `--clean`, `--config FILE`. | | `./formblocks clean`, `clean --all` | removes build output; `--all` also the venv and `node_modules` | Ask before `--all`: other agents may be using them. | -Windows has a `.bat` twin of every script. A desktop build needs WebKitGTK (`libwebkit2gtk-4.1-dev`) on Linux; where it is missing, as on the check machines here, no Tauri build runs: say so, never claim one passed. +Windows has a `.bat` twin of every script. A desktop build needs WebKitGTK (`libwebkit2gtk-4.1-dev`) on Linux; where it is missing no Tauri build runs: say so, never claim one passed. One Linux build (deb and AppImage, unsigned) has run; its report is in `src-tauri/HASHOUT_LOG.md`. Its self-check imports numpy and every module, and the freeze must carry the connector data files (clip and hinge kinds included). macOS, Windows, signing and rpm are not run. ## Data files the freeze must carry diff --git a/.claude/skills/formblocks-harness/sub-skills/verify/SUB-SKILL.md b/.claude/skills/formblocks-harness/sub-skills/verify/SUB-SKILL.md index bb6ae9b..0bb322c 100644 --- a/.claude/skills/formblocks-harness/sub-skills/verify/SUB-SKILL.md +++ b/.claude/skills/formblocks-harness/sub-skills/verify/SUB-SKILL.md @@ -44,7 +44,7 @@ This is the method the 0.4.0 lanes used, several at once in one tree. Then do each interaction you built and add up `window.__shifts` entries without `input`. A score above 0 on load or on any of them is a defect to fix. Vite's development server sends hundreds of modules, so under this network a load takes over a minute: give it the time rather than lifting the throttle. 6. The outside agent path: run `./formblocks mcp` as a child process speaking JSON-RPC on its standard input and output, call the tool in one thread, and answer the window's question from Playwright in the other. The question is a dialog; the dock's Chat holds a hidden button of the same name, so pick the visible one (`page.get_by_role("button", name="Allow once", exact=True).locator("visible=true")`). The answer from a test is yours as the person in a scratch data folder, never an agent's on a real one. -7. Agent programs: only Claude Code may be real here, never signed in; the others are stand-ins (`sub-skills/add-dock-program/SUB-SKILL.md`). Say which were which. +7. Agent programs: never sign in. Use the real programs where they install (all four did on 27 November 2026) and a stand-in where one cannot (`sub-skills/add-dock-program/SUB-SKILL.md`). Say which were which. 8. Scripts, screenshots and data stay under `/tmp`, never in the repository. Stop the engine, Vite and the browser when the check is done, each by the process id you started; never by name, since other lanes' engines carry the same name. ## What CI runs diff --git a/.docs/wiki/Agents.md b/.docs/wiki/Agents.md index d135e44..a77d505 100644 --- a/.docs/wiki/Agents.md +++ b/.docs/wiki/Agents.md @@ -31,7 +31,7 @@ It cannot agree to the parts library download: the engine refuses a fetch asked ## What was run -Claude Code was the real program, not signed in; Codex was the real package from the npm registry in a scratch folder, not signed in; Cursor and Antigravity were stand-in scripts named as the programs that record what they are given. No signed-in conversation has been run with any of the four. +All four were real programs, none signed in: Claude Code 2.1.332, Codex 0.172.0 from the npm registry, Cursor's agent 2026.11.22 and Antigravity 1.5.18, the last two from their own installers into a scratch home folder. Each was found, started from a dock tab and from the launcher, and given a token that opened `/mcp`, was refused on `/api` and died with its tab. No signed-in conversation has been run with any of the four, and no `.bat` file or Windows machine was used. ## Skills diff --git a/.docs/wiki/Building.md b/.docs/wiki/Building.md index de707c9..21f1e89 100644 --- a/.docs/wiki/Building.md +++ b/.docs/wiki/Building.md @@ -55,6 +55,6 @@ CI also boots the engine and probes `/api/health`, runs `bash -n` over the shell ## The desktop app and releases -`./formblocks install-desktop` checks the toolchain, `./formblocks desktop dev` runs the shell and `./build_app` builds and installs it. The bundle takes its icons from `src-tauri/icons`, made from the owner's art in `assets/`. No desktop build has been run on the machines this was written on. +`./formblocks install-desktop` checks the toolchain, `./formblocks desktop dev` runs the shell and `./build_app` builds and installs it. The bundle takes its icons from `src-tauri/icons`, made from the owner's art in `assets/`. One desktop build has been run, on Linux x64 (a deb and an AppImage, unsigned, made as formcompiler makes them). Its frozen engine started, the window drew under a virtual display with software WebGL and opened the sample car, and closing it ended every process. The macOS and Windows builds, signing, the updater and the rpm have not been run. Nothing in this repository pushes, signs or publishes a release. The family's compiler, formcompiler, builds each release from `apps/formblocks.json` after `ci.yml` has passed on a `compile_vX.Y.Z` branch, and an owner publishes it. `docs/RELEASE.md` lists the version sites a release bumps by hand and says what formcompiler runs. diff --git a/.docs/wiki/Home.md b/.docs/wiki/Home.md index a51550b..d127ed2 100644 --- a/.docs/wiki/Home.md +++ b/.docs/wiki/Home.md @@ -2,11 +2,12 @@ FormBlocks is an Apache-2.0 brick building app for macOS, Linux and Windows. You find parts in the open LDraw parts library, place and snap them in a 3D view, colour them, build in steps, count what the model needs, save LDraw files and pictures, and an agent program can do the same through the engine's command line and MCP server. -Version: 0.4.0 (in active development, functional). +Version: 0.5.0 (in active development, functional). ## Start here - [[Building]] · install, boot, the commands, the desktop app, the release +- [[Window]] · the window's regions, turning parts, clips and hinges, overlaps and the Info tab in short - [[Parts-Library]] · what is fetched, from where, under which licence, and who agrees to it - [[Agents]] · the agent dock, the four programs, outside agents and what asks you first diff --git a/.docs/wiki/Window.md b/.docs/wiki/Window.md new file mode 100644 index 0000000..6f1191a --- /dev/null +++ b/.docs/wiki/Window.md @@ -0,0 +1,25 @@ +# The window in short + +The full walk through is `docs/MANUAL.md` in the repository. This page is the map: what the window has, where to find it, and the keys that matter most. Everything here was seen working in the running window. + +## Where things are + +- **Left:** the parts palette. Type to search; `brick 2 x 4` puts 3001 first. +- **Middle:** the 3D view, the step strip under it, and the status bar at the bottom with the switches **Snap**, the grid step, the **angle step**, **Overlap** and **Nested**. +- **Right:** three sections that fold to their headers. **Colours** at the top; the tabs **Model**, **Steps**, **Parts** and **Info** in the middle, which take whatever height the others leave; **Details** at the bottom. Drag a divider to change a height, double-click it to put it back, click a header to fold a section, and use Reset Right Column in Search Commands (Ctrl+K) to go back to the first layout. Heights and folds are kept from one start to the next. + +## Turning parts + +Select parts and a pivot dial shows: one ring about the up axis. Drag along it to turn in angle steps, Shift for whole degrees, Esc to put the parts back. Press **A** for the next angle step (90, 45, 22.5, 15, 5 or 1 degrees), **J** for the pivot tool with three rings and a click to set the pivot, and hold Alt with **R**, **T** or **Y** to turn by the angle step. A turn never leaves a part under the ground. A hinge half turns about its hinge. + +## Clips and hinges + +A clip seats on a bar and slides along it in grid steps; two hinge halves of one family seat on one pivot line once the half is turned the right way round. The manual's "Clips, bars and hinges" lists the five hinge families and what is not built yet (pins, axles, ball joints, hinge limits). + +## Overlaps and nested pairs + +The overlap check compares the parts' real shapes: parts overlap when they cut more than 1 LDU into each other. A part resting in a hollow it fits, such as a rim in its tyre, is a nested pair: never a block, counted apart, and listed only when **Nested** is on. **Show Overlaps** in the Model menu selects the parts of every overlap and says the count in the status bar. + +## The Info tab + +The model's name, description, author and licence (editable, each change one undo step), its counts and size, its file, and the parts the library lacks. diff --git a/.docs/wiki/_Sidebar.md b/.docs/wiki/_Sidebar.md index 99cab84..6ae62c9 100644 --- a/.docs/wiki/_Sidebar.md +++ b/.docs/wiki/_Sidebar.md @@ -2,5 +2,6 @@ - [[Home]] - [[Building]] +- [[Window]] - [[Parts-Library]] - [[Agents]] diff --git a/CHANGELOG.md b/CHANGELOG.md index 45b3162..1c45d44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## v0.5.0 · 2026-11-27 + +The fifth version turns parts with the pointer, adds clips, bars and hinges as joins, makes the overlap check quiet on real models, gives the right column room and a model information tab, and was built and started as a desktop app for the first time, on Linux. The repository is private until 13 December 2026. + +- Turning with the pointer: press J for the pivot tool and three rings appear about the selection; drag a ring to turn it, in steps of the angle setting, or hold Shift for whole degrees. The turn is previewed in place, sent on release, and is one undo step; Esc puts everything back. The angle step is 90, 45, 22.5, 15, 5 or 1 degree, shown in the status bar beside the grid step, and A moves to the next. Alt+R, Alt+T and Alt+Y turn by the step, with Shift the other way. A turn that would end below the ground is lifted onto it, and with the overlap check on a turn into another part is refused. With the pivot tool on, a click on a part sets the pivot there. Four quarter turns leave a saved file byte for byte as it was. +- Clips, bars and hinges: a clip grips a bar and can sit anywhere along its free length in grid steps, and two hinge halves seat when their axes meet. Both are found from each part's own shape; 1,795 parts of the official library gain such a join. A part joined by a hinge turns about the hinge when you turn it. Snapping still never turns a part, so a hinge half must be the right way up before it seats. +- The overlap check judges real shapes: two parts overlap when their solids share a region thicker than 1 LDU, studs included, so the library's sample car now reports 0 overlaps where 0.4.0 reported 20. A part that sits in another's hollow without cutting into it is counted apart as nested and listed only when asked, with a Nested switch in the status bar and a row in Preferences; a pair joined by a clip or a hinge counts as fitted unless the shapes really cut into each other. Overlapping parts are drawn in the warning colour while the check is on. This rule is a proposed default: what counts as an overlap is the owner's decision. +- The right column: the colour palette, the tabs and Details are three sections with dividers you can drag, each folding to its header, and the sizes are remembered. The tab you work in takes the room left over; at 1440 by 900 the Parts tab shows about six rows where it showed three. Reset Right Column in the command palette puts the sizes back. +- An Info tab, the fourth tab of the right column: the model's name, description, author and licence, each editable and one undo step, and counts of placements, different parts, colours, submodels and steps, the model's size, the file and the library update it was saved with, parts the library lacks, and overlaps. `model.info` returns the same. +- T, Y and the arrow keys follow the screen's axes, as the specification says. After choosing a part from the search field with Enter, R, T, Y and Esc reach the held part. Save As to `.fblk` shows the library update it was saved with at once. +- Windows: a first message to Claude Code, Codex, Cursor or Antigravity, from the launcher or a dock tab, no longer passes through the command interpreter, and the server an agent program starts is the engine's own Python instead of the `.bat` launcher. None of this could be run here: this version was built on Linux and no `.bat` script was run. +- The desktop build ran for the first time, on Linux: `./formblocks desktop build` made a deb and an AppImage, unsigned; the app started with its engine, drew the viewport and the sample car, and stopped with nothing left running. What the first build turned up is fixed: the engine's self-check imports every module and names its data files, the frozen engine carries the clip and hinge data, the Linux package no longer carries numpy's libraries twice, the package has its own description and category, the Tauri packages match the crates (`@tauri-apps/api` and `@tauri-apps/cli` 2.12.5), and `./formblocks doctor` lists what a Linux desktop build needs. +- Agents: `part.rotate` takes an angle and an axis, `part.pivot` and `angle.step` are new, `part.connectors` filters by kind, `overlap.check` lists nested pairs when asked and `overlap.nested` sets the default. Three new sub-skills in the driving pack: turning parts, clips and hinges, model information. The manual, the wiki, the README and both packs are brought up to this version through the skill creator's gates, and `assets/screenshot.png` is a new picture of this version's window. +- Run for this version: `./formblocks doctor`, the type check, the window build, the engine's self-check from source and frozen, `./formblocks agents check`, the Form App Contract checker (0 MUST, 0 SHOULD, 83 clauses checked) and the registry's eight checks, all passing; the Linux desktop build and a start of the built app under a virtual display; headless Chrome walks with real pointer events (a brick turned by each step about each axis, a clip plate seated on a bar, a hinge half folded with the pivot dial, a brick turned 45 degrees into another and reported, the right column dragged and folded, the Info tab edited, saved and reopened) with layout shift 0 on a hard reload and without recent input under a 4x slower processor and a slow network. Claude Code 2.1.332, Codex 0.172.0, Cursor 2026.11.22 and Antigravity 1.5.18 were all real programs this time, none signed in; stand-in scripts were used only to record exactly what a program was given. +- Not run for this version: a signed-in agent turn in any program, any `.bat` script, Windows, macOS, an rpm, a desktop build after the last change to the Tauri packages, the workflow on GitHub, and a frame time on a real graphics card. +- Known: a plate that carries a clip, a handle or a hinge finger does not seat on studs from above, because its side piece widens its footprint; with the overlap check off a clip plate can seat on a bar with its plate inside another part; a new model saved under a file name keeps `untitled.ldr` as its model name until you change it on the Info tab; at 1280 by 720 the palette's solid colours sit below the fold until scrolled; typing an angle on the pivot dial is not built; a picture still cannot be drawn with no window open. + ## v0.4.0 · 2026-11-26 The fourth version makes the mouse enough to build with, adds the parts list and pictures, and proves the agent dock for Claude Code, Codex, Cursor and Antigravity. The repository is private until 13 December 2026. diff --git a/CLAUDE.md b/CLAUDE.md index 2d46893..4c2d224 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -51,7 +51,7 @@ FormBlocks is a Form family desktop app for building with bricks on the open LDr - `frontend/src/dock/` is the family's shared agent dock, copied unchanged and checked against its `MANIFEST.json`; reach it through `frontend/src/dock-adapter.ts`. - `apps/formblocks.json` and `apps/products-row.json` are the proposed registry entry and portal row: kind `bricks`, project file `.fblk`, state `prelaunch`. - The data folder (`FORMBLOCKS_DATA_DIR`, else the system's application data folder) holds `settings.json`, `session.token`, the fetched library under `library/` with its `manifest.json` and saved index, and the mesh cache. `FORMBLOCKS_LDRAW_DIR` names a library folder when the settings name none; it is how a check runs against a library unpacked by hand, and nothing from such a folder is ever committed. -- The engine's library routes are `/api/library` (`status`, `fetch`, `cancel`, `use`, `check_update`), `/api/parts` (`categories`, `search`, `{name}`, `{name}/mesh`), `/api/colours` and `/api/settings`; `./formblocks cli parts`, `part-mesh`, `library` and `colours` print the same JSON. +- The engine's library routes are `/api/library` (`status`, `fetch`, `cancel`, `use`, `check_update`), `/api/parts` (`categories`, `search`, `{name}`, `{name}/mesh`), `/api/colours` and `/api/settings`; `./formblocks cli parts`, `part-mesh`, `library` and `colours` print the same JSON. The routes under `/api/place` (`preview`, `drag`, `pick` and, since 0.5.0, `turn`) answer what a placement, a drag or a turn would do; they read, need the window key and never change the model. - The engine has no renderer: a picture is drawn by the window and written by the engine (`/api/picture`), so `picture.save` and `picture.steps` need the window open. The parts list is counted by the engine (`backend/app/doc/partslist.py`, `parts.list`) and the window's Parts tab patches its rows in place by each row's key. - `README.md` follows the Form family layout; keep it honest about what the current version does. diff --git a/NOTICE.md b/NOTICE.md index c80fe06..0e99a4a 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -25,11 +25,11 @@ FormBlocks was made from FormAnything's app template, which is FormCAD's skeleto | Work | Licence | Where | | --- | --- | --- | | @fontsource/inter 5.3.0, @fontsource/jetbrains-mono 5.3.0 | OFL-1.1 (fonts), MIT (package) | `frontend/package.json` | -| @tauri-apps/api 2.12.4 | Apache-2.0 OR MIT | `frontend/package.json` | +| @tauri-apps/api 2.12.5 | Apache-2.0 OR MIT | `frontend/package.json` | | @xterm/xterm 6.0.0, @xterm/addon-fit 0.11.0 | MIT, Copyright (c) 2017-2019 The xterm.js authors and others; the agent dock's terminal, loaded only when a tab opens | `frontend/package.json` | | three 0.186.1 | MIT, Copyright 2010-2026 three.js authors; the 3D viewport and the part thumbnails | `frontend/package.json`, `frontend/src/view/` | | @types/three 0.186.0 | MIT, from the DefinitelyTyped project; type declarations for three, development only and erased by the build | `frontend/package.json` (development) | -| @tauri-apps/cli 2.11.4, typescript 7.0.2, vite 8.3.5 | Apache-2.0 OR MIT, Apache-2.0, MIT | build tools, not shipped | +| @tauri-apps/cli 2.12.5, typescript 7.0.2, vite 8.3.5 | Apache-2.0 OR MIT, Apache-2.0, MIT | build tools, not shipped | ### Engine (backend) diff --git a/README.md b/README.md index c191f26..2c5c0e8 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@
-
+
@@ -42,7 +42,11 @@ FormBlocks is an open brick building app. Its parts are the LDraw Parts Library,
> [!IMPORTANT]
-> **Status:** in active development, functional. In the window you can choose or fetch the parts library, find parts in the palette, place them with the pointer in the 3D view where they seat on studs (including across a gap, resting on the tops of what is under them), drag placed parts and copies of them, select with the pointer or a box, turn and colour parts, nudge, hide, pack parts into submodels, add and walk building steps with the earlier steps dimmed, read the model tree and the details of a part, count what a model needs in the Parts tab and save it as CSV, save a picture of the view (and one picture per step), and save and open `.fblk`, `.ldr` and `.mpd` files. The agent dock runs Claude Code, Codex, Cursor and Antigravity beside the model. Not yet in the window: the stamp, pivot, brush and sampler tools, move handles, turns finer than a quarter turn and a panel for the model's own information. [docs/MANUAL.md](docs/MANUAL.md) walks through all of it and ends with what does not work yet.
+> **Status:** in active development, functional. In the window you can choose or fetch the parts library, find parts in the palette, place them with the pointer in the 3D view where they seat on studs (including across a gap, resting on the tops of what is under them) and, with the clip and hinge parts, on bars and on each other's hinge halves, drag placed parts and copies of them, select with the pointer or a box, turn parts by the pointer on a pivot dial in angle steps from 90 degrees down to 1 (a hinge half turns about its hinge), colour parts, nudge, hide, pack parts into submodels, add and walk building steps with the earlier steps dimmed, read the model tree and the details of a part.
+>
+> You can also count what a model needs in the Parts tab and save it as CSV, read and edit the model's name, description, author and licence beside its counts and size in the Info tab, fold and resize the right column's three sections, tell real overlaps from parts that nest by design, save a picture of the view (and one picture per step), and save and open `.fblk`, `.ldr` and `.mpd` files.
+>
+> The agent dock runs Claude Code, Codex, Cursor and Antigravity beside the model. Not yet in the window: the stamp, brush and sampler tools, move handles, a typed angle on the pivot dial, pins, axles and ball joints, and a limit on how far a hinge opens. [docs/MANUAL.md](docs/MANUAL.md) walks through all of it and ends with what does not work yet.
## Quick start
@@ -95,7 +99,9 @@ The fetch runs only with your consent, given on the library card in the window o
A checkout already names the server for Claude Code ([`.mcp.json`](.mcp.json)), Cursor ([`.cursor/mcp.json`](.cursor/mcp.json)), Codex ([`.codex/config.toml`](.codex/config.toml)) and Antigravity ([`.agents/mcp_config.json`](.agents/mcp_config.json)). Two skill packs live in [`skills/`](skills): `formblocks-harness`, for changing this code, and `formblocks-driving`, for using the running app; its `references/command-catalogue.md` lists every tool and command and is written by `agents sync`.
-The agent dock in the window (Ctrl+J) holds Chat for Claude Code, a terminal tab for each of Claude Code, Codex, Cursor and Antigravity, and a plain shell; each tab is connected to this engine with a token of its own that is revoked when the tab closes. A program that is not installed shows the line that installs it and nothing is run for you. An agent program started outside the window with `./formblocks claude` (or `codex`, `cursor`, `antigravity`) reads the model freely, and the window asks you before it changes anything: **Deny**, **Allow once** or **Always allow**, with a read-only Outside agents tab logging each call. [docs/AGENT_DOCK.md](docs/AGENT_DOCK.md) says what each program gets and what was run; Claude Code and Codex were real programs there, Cursor and Antigravity were stand-ins. Every `cli` subcommand prints JSON, so an agent can read the library's status, search parts and read a part's mesh counts; fetching the library is the one thing it is refused, because only you can agree to that download.
+The agent dock in the window (Ctrl+J) holds Chat for Claude Code, a terminal tab for each of Claude Code, Codex, Cursor and Antigravity, and a plain shell; each tab is connected to this engine with a token of its own that is revoked when the tab closes. A program that is not installed shows the line that installs it and nothing is run for you. An agent program started outside the window with `./formblocks claude` (or `codex`, `cursor`, `antigravity`) reads the model freely, and the window asks you before it changes anything: **Deny**, **Allow once** or **Always allow**, with a read-only Outside agents tab logging each call.
+
+[docs/AGENT_DOCK.md](docs/AGENT_DOCK.md) says what each program gets and what was run; all four programs were real there (none signed in, so no turn with a model was run). Every `cli` subcommand prints JSON, so an agent can read the library's status, search parts and read a part's mesh counts; fetching the library is the one thing it is refused, because only you can agree to that download.
## What FormBlocks sends over the network
@@ -145,7 +151,8 @@ Agents: [`CLAUDE.md`](CLAUDE.md), [`AGENTS.md`](AGENTS.md) · Contributing: [`CO
## Status
-In active development, functional. It is made to run from source on macOS, Linux and Windows, and has been run from source on Linux only; desktop builds come from formcompiler; the app has its icons, and no desktop build has been run yet. The engine and the window have been run against the full official library of release 2026-10, the window in a headless browser with software rendering, so how fast it draws on a real graphics card is not measured. Of the four agent programs, Claude Code and Codex were run for real (neither signed in) and Cursor and Antigravity through stand-in programs. Releases are made by the family's compiler from [`apps/formblocks.json`](apps/formblocks.json), never by this repository.
+In active development, functional. It is made to run from source on macOS, Linux and Windows, and has been run from source on Linux only; desktop builds come from formcompiler; the app has its icons.
+One desktop build has been made, on Linux x64 only (a deb of 50 MB and an AppImage of 121 MB, unsigned): its frozen engine started, the window drew and showed the sample car under a virtual display, and closing it ended every process; no macOS or Windows build has been run. The engine and the window have been run against the full official library of release 2026-10, the window in a headless browser with software rendering, so how fast it draws on a real graphics card is not measured. All four agent programs were run for real, none signed in: Claude Code 2.1.332, Codex 0.172.0, Cursor's agent and Antigravity 1.5.18, each found, started from a dock tab and from the launcher, and given a token that opened the engine's `/mcp` and nothing else, and stopped working when the tab closed. Releases are made by the family's compiler from [`apps/formblocks.json`](apps/formblocks.json), never by this repository.
## Licensing
diff --git a/SECURITY.md b/SECURITY.md
index eb2c567..1058e27 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -6,7 +6,7 @@ Security fixes go into the newest release. Please update before reporting, and c
| Version | Supported |
| --- | --- |
-| 0.1.x (latest release) | Yes |
+| The latest release | Yes |
| Anything older | No |
## Reporting a vulnerability
@@ -29,4 +29,4 @@ Bugs that need someone to already control your computer, or to run a modified bu
## What FormBlocks sends over the network
-Nothing. FormBlocks has no account, no telemetry and no update check. When an agent program in the dock is missing, the dock shows the line that installs it; FormBlocks never runs that line. A program you start in a tab talks to its own service as it does anywhere. A request from FormBlocks itself to any address but 127.0.0.1 is a vulnerability.
+Nothing, unless you ask. FormBlocks has no account, no telemetry and no update check of its own. The one server it reaches is `library.ldraw.org`, only to fetch the parts library after your consent, to show the archive's size on the library card, or when you choose Check for an update. When an agent program in the dock is missing, the dock shows the line that installs it; FormBlocks never runs that line. A program you start in a tab talks to its own service as it does anywhere. A request from FormBlocks itself to any address but 127.0.0.1 and `library.ldraw.org`, or to that server without your asking, is a vulnerability.
diff --git a/agents/manifest.json b/agents/manifest.json
index 5e8c8d8..b54fb86 100644
--- a/agents/manifest.json
+++ b/agents/manifest.json
@@ -10,6 +10,7 @@
"formblocks_redo",
"formblocks_status",
"formblocks_undo",
+ "cmd_angle_step",
"cmd_colours_current",
"cmd_colours_list",
"cmd_colours_used",
@@ -26,6 +27,7 @@
"cmd_model_set_info",
"cmd_model_tree",
"cmd_overlap_check",
+ "cmd_overlap_nested",
"cmd_overlap_set",
"cmd_part_connectors",
"cmd_part_delete",
@@ -37,6 +39,7 @@
"cmd_part_move",
"cmd_part_move_at_ray",
"cmd_part_pick",
+ "cmd_part_pivot",
"cmd_part_place",
"cmd_part_place_at_ray",
"cmd_part_recolour",
@@ -78,6 +81,7 @@
"formblocks_get_doc",
"formblocks_list_commands",
"formblocks_status",
+ "cmd_angle_step",
"cmd_colours_current",
"cmd_colours_list",
"cmd_colours_used",
@@ -88,10 +92,12 @@
"cmd_model_report",
"cmd_model_tree",
"cmd_overlap_check",
+ "cmd_overlap_nested",
"cmd_overlap_set",
"cmd_part_connectors",
"cmd_part_fit",
"cmd_part_pick",
+ "cmd_part_pivot",
"cmd_parts_list",
"cmd_parts_search",
"cmd_parts_show",
@@ -160,10 +166,12 @@
"building-in-order",
"changing-parts",
"checking-a-model",
+ "clips-and-hinges",
"colours",
"connect-and-status",
"files",
"finding-parts",
+ "model-information",
"moving-parts",
"parts-library",
"parts-list",
@@ -173,6 +181,7 @@
"step-walking",
"steps",
"submodels",
+ "turning-parts",
"working-with-the-person"
]
},
diff --git a/assets/screenshot.png b/assets/screenshot.png
index 1400978..a4e9546 100644
Binary files a/assets/screenshot.png and b/assets/screenshot.png differ
diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md
index 4a752e3..c865299 100644
--- a/backend/HASHOUT_LOG.md
+++ b/backend/HASHOUT_LOG.md
@@ -2,6 +2,87 @@
Living record of decisions and removed context for the engine, newest first. Read before editing.
+## The self-check names every data file the engine reads · 0.5.0 (formblocks_engine.py)
+
+`--selfcheck` listed the stud kind's data, the overrides and the categories under `data_files`; the clip and hinge kinds' `clip.json` and `hinge.json`, added in 0.5.0, were caught only indirectly, as a module that fails to import. They are now named with the others, so a freeze that drops one says which file is missing. These five are every file the engine's package reads beside its code (the rest of `app/` that is not Python is hashout logs and `FORMAT.md`). Checked: `./formblocks freeze` then `src-tauri/engine/formblocks-engine --selfcheck` answers `data_files` ok and `modules` ok, and the frozen `_internal/app` holds all five.
+
+## "Saved with" follows a save to a project file · 0.5.0 (app/cmd/commands/model.py, app/services/model_info.py)
+
+`model.info`'s `builtWith` was read from the project lines the model was opened with, so after Save As to a `.fblk` the Info tab kept the value of the file it came from (none, for an LDraw file) until the new file was opened again. Writing a project file now keeps the library update it wrote in the document's file report (`savedWith`), which a later open or `model.new` replaces; `builtWith` prefers it. The model itself is not touched, so a save adds no undo step and an undo never brings an old value back. An export to `.ldr` or `.mpd` writes no library line and leaves it alone. Checked on an engine on 9270: the sample car opened as `car.ldr` said none, after Save As `.fblk` 2026-10, after a further Save As `.ldr` still 2026-10, after reopening the `.fblk` 2026-10, after `model.new` none.
+
+## On Windows a program is started without the command interpreter whenever it can be · 0.5.0 (app/services/windows_start.py, agent_programs.py, chat.py)
+
+The first fix for Windows (below, "a tab's first message is typed") kept every `.cmd` program behind `cmd.exe` and only kept the message off its line. FormAnything's agent lane, working on the same fault, described a stronger rule, and this is FormBlocks' own version of it: most `.cmd` programs are not batch programs at all but npm's or pnpm's small shim, whose one real line runs `node` on a script in the package (Claude Code and Codex from npm) or runs an `.exe` the package carries. `windows_start.py` reads the shim, finds the last quoted path that starts with the shim's own folder (`%dp0%` or `%~dp0`) on the line that passes `%*`, and, when that file exists and is a script or a program, starts it directly: the `.exe` itself, or `node.exe` beside the shim (else the `node` on the child's PATH) with the script. No interpreter is involved, so a message, a folder or a JSON setting reaches the program exactly, and the message stays an argument after `--` even on Windows. Any other batch file must go through the interpreter, and then only as `cmd.exe /d /v:off /c call
${I.model}
`,
+ FIELDS.map(field).join(''),
+ ``,
+ '${I.counts}
${COUNTS.map(([k, l]) => fact(k, l)).join('')}
${I.size}
${SIZES.map(([k, l]) => fact(k, l)).join('')}
${I.file}
${FACTS.map(([k, l]) => fact(k, l)).join('')}
${I.missing}
',
+ `',
+ '
',
+].join('');
const SHELL = `