Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .agents/skills/formpath-harness/references/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ Opens a file at an absolute path: a formpath project (.fpth), SVG, PDF or a PDF-

## save_project

Saves the document as a formpath project (.fpth) at an absolute path; everything stays editable.
Saves the document as a formpath project (.fpth) at an absolute path; everything stays editable. A path that already exists is refused unless replace is true.

- `path`: string; required
- `replace`: boolean; default false; true replaces a file already at path. Without it a path that already exists is refused and nothing is written: choose a new path, or pass true only when the person wants that file replaced.

## export_file

Exports the art to an absolute path; the extension chooses the format: .svg, .pdf (every artboard a page), .ai (PDF-compatible Illustrator file, every artboard a page, reopens fully editable in formpath), .eps (Level 3 PostScript; all_artboards gives a zip of one EPS per artboard), .dxf (AutoCAD 2000 or R12, layers kept), .dwg (AutoCAD 2000 binary drawing, layers kept, written natively), .png (with colors it writes an indexed PNG-8), .jpg, .webp, .gif (2 to 256 colors, transparency with a matte, optional interlace), .bmp (24-bit or 32-bit with alpha), .psd (flattened composite plus layers, RGB or CMYK: with psd_edit, layers and groups become Photoshop groups, point and area type become editable type layers and filled paths become shape layers; otherwise one pixel layer per top-level layer) or .tiff. Every raster format takes ppi (any resolution) and anti_aliasing.
Exports the art to an absolute path; the extension chooses the format: .svg, .pdf (every artboard a page), .ai (PDF-compatible Illustrator file, every artboard a page, reopens fully editable in formpath), .eps (Level 3 PostScript; all_artboards gives a zip of one EPS per artboard), .dxf (AutoCAD 2000 or R12, layers kept), .dwg (AutoCAD 2000 binary drawing, layers kept, written natively), .png (with colors it writes an indexed PNG-8), .jpg, .webp, .gif (2 to 256 colors, transparency with a matte, optional interlace), .bmp (24-bit or 32-bit with alpha), .psd (flattened composite plus layers, RGB or CMYK: with psd_edit, layers and groups become Photoshop groups, point and area type become editable type layers and filled paths become shape layers; otherwise one pixel layer per top-level layer) or .tiff. Every raster format takes ppi (any resolution) and anti_aliasing. A path that already exists is refused unless replace is true.

- `path`: string; required
- `scope`: string (artboard | document | selection | all_artboards); default "artboard"
Expand Down Expand Up @@ -126,6 +127,7 @@ Exports the art to an absolute path; the extension chooses the format: .svg, .pd
- `bmp_bits`: integer (24 | 32); default 24; BMP only: 24 writes RGB, 32 writes RGBA (alpha when transparent is true).
- `psd_layers`: boolean; default true; PSD only: write one pixel layer per top-level layer (name, visibility and opacity kept) under the flattened composite; false writes the composite only. The color parameter (rgb or cmyk) chooses 8-bit RGB or CMYK.
- `psd_edit`: boolean; default true; PSD only, with psd_layers: maximum editability. Sublayers and groups become Photoshop layer groups, point and area type become editable type layers, filled paths become shape layers (solid or gradient fill, vector mask, vector stroke); anything Photoshop cannot hold that way (effects, type on a path, patterns, images) stays a pixel layer. false writes one pixel layer per top-level layer.
- `replace`: boolean; default false; true replaces a file already at path. Without it a path that already exists is refused and nothing is written: choose a new path, or pass true only when the person wants that file replaced.

## switch_document

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Paths are absolute, and the folder exists. When the person names a folder like D
2. **Place**: `place_image` with x, y and width to put a PNG, JPEG, WebP, GIF, or SVG, EPS or DXF art into the open document. A PDF or .ai takes `page` and `crop` (bounding, art, crop, trim, bleed, media) and arrives as editable art, or with `link` true as a linked picture of the page; a PSD takes `psd_import` (objects or flatten); a TIFF takes `page`.
3. **Save editable**: `save_project` to a .fpth path; everything stays editable. Do this before outlining type or expanding.
4. **Export**: `export_file`; the extension picks the format.
- A path that already exists is refused and nothing is written. Choose a new name, or pass `replace` true only when the person asked for that file to be replaced.
- Every `save_project`, `export_file`, `actions` batch, `variables` export, `links` unembed and `run_command` or `run_commands` with `save`, `download-project` or `link-unembed` asks the person in the formpath window, even after they chose Always allow; tell them a question is waiting.
- .svg: scope artboard, document or selection; outline_text true when fonts may be missing where it goes.
- .pdf: every artboard a page with scope all_artboards; vectors, gradients and transparency kept; formpath reopens it editable.
- .eps: Level 3 PostScript of an artboard (all_artboards writes a zip with one EPS per artboard); `color` rgb or cmyk; transparency is flattened against what lies below; formpath reopens it editable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ None: load directly for any failure.
## Procedure

1. **No formpath tools listed**: the MCP server is not connected. Ask the person to run `./formpath mcp` setup (`./formpath agents install`) or check the client's MCP settings, then restart the client.
2. **A call waits, then fails with a consent message**: the formpath window is asking whether to allow the agent, naming it and what it asked for. Tell the person to answer in the formpath window (Allow once covers that one call, Always allow covers every outside agent, Deny refuses; the Preferences > Plugins choice "Outside agents (MCP)" keeps Ask each time, Allowed or Blocked, and only the window can change it), then retry once.
2. **A call waits, then fails with a consent message**: the formpath window is asking whether to allow the agent, naming it and what it asked for. Tell the person to answer in the formpath window (Allow once covers that one call, Always allow covers every outside agent except for writing files, Deny refuses; `save_project`, `export_file`, an `actions` batch, a `variables` export, a `links` unembed and the `save`, `download-project` and `link-unembed` commands ask each time and offer only Deny and Allow once; the Preferences > Plugins choice "Outside agents (MCP)" keeps Ask each time, Allowed or Blocked, and only the window can change it), then retry once.
3. **The engine is not answering**: formpath is not running. `./formpath mcp` starts it; otherwise ask the person to run `./formpath boot` and open http://localhost:5230.
4. **No window open**: tools run in the open formpath window; ask the person to open formpath in a browser or the desktop app.
5. **No object has the id**: ids changed (Pathfinder, expand, outlines, undo, or the person edited). Call `get_document`, match by name or bounds, retry.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ client -> setup/mcp_stdio.py (stdio) -> POST /mcp (backend/app/routers/mcp.py)

The window bridge is private to the formpath window: it gets a secret from `POST /api/mcp/bridge/session` (issued only to formpath's own Origin) and sends it in `X-Formpath-Bridge` on every bridge call through `io/api.ts`. Never add a bridge endpoint that skips `_bridge_refusal`, and never make one a GET.

The first call queues `__consent__`; the window asks the person once and remembers the answer in Preferences. File tools (`open_file`, `save_project`, `export_file`, `place_image`) run in the backend, which calls the window's `__open`, `__place`, `__project` and `__export` and writes or reads the absolute path itself.
The first call queues `__consent__`; the window asks the person once and remembers the answer in Preferences. Calls that write files (`save_project`, `export_file`, `actions` batch, `variables` export, `links` unembed, and `run_command` or `run_commands` with an id in `_WRITING_COMMANDS`; `_writes_files`, also checked in `_call` so the `/api/commands` route is covered) queue a `__consent__` with `each: true` and answers `deny`, `once` every time, and the window shows it even when Allowed (`asksEachTime`, `consentOffers` in `io/api.ts`); a yes runs that call only. `save_project` and `export_file` refuse an existing path unless `replace` is true, and write a new file with `files.write_exclusive`. File tools (`open_file`, `save_project`, `export_file`, `place_image`) run in the backend, which calls the window's `__open`, `__place`, `__project` and `__export` and writes or reads the absolute path itself.

## Adding a tool

Expand Down
6 changes: 4 additions & 2 deletions .claude/skills/formpath-harness/references/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ Opens a file at an absolute path: a formpath project (.fpth), SVG, PDF or a PDF-

## save_project

Saves the document as a formpath project (.fpth) at an absolute path; everything stays editable.
Saves the document as a formpath project (.fpth) at an absolute path; everything stays editable. A path that already exists is refused unless replace is true.

- `path`: string; required
- `replace`: boolean; default false; true replaces a file already at path. Without it a path that already exists is refused and nothing is written: choose a new path, or pass true only when the person wants that file replaced.

## export_file

Exports the art to an absolute path; the extension chooses the format: .svg, .pdf (every artboard a page), .ai (PDF-compatible Illustrator file, every artboard a page, reopens fully editable in formpath), .eps (Level 3 PostScript; all_artboards gives a zip of one EPS per artboard), .dxf (AutoCAD 2000 or R12, layers kept), .dwg (AutoCAD 2000 binary drawing, layers kept, written natively), .png (with colors it writes an indexed PNG-8), .jpg, .webp, .gif (2 to 256 colors, transparency with a matte, optional interlace), .bmp (24-bit or 32-bit with alpha), .psd (flattened composite plus layers, RGB or CMYK: with psd_edit, layers and groups become Photoshop groups, point and area type become editable type layers and filled paths become shape layers; otherwise one pixel layer per top-level layer) or .tiff. Every raster format takes ppi (any resolution) and anti_aliasing.
Exports the art to an absolute path; the extension chooses the format: .svg, .pdf (every artboard a page), .ai (PDF-compatible Illustrator file, every artboard a page, reopens fully editable in formpath), .eps (Level 3 PostScript; all_artboards gives a zip of one EPS per artboard), .dxf (AutoCAD 2000 or R12, layers kept), .dwg (AutoCAD 2000 binary drawing, layers kept, written natively), .png (with colors it writes an indexed PNG-8), .jpg, .webp, .gif (2 to 256 colors, transparency with a matte, optional interlace), .bmp (24-bit or 32-bit with alpha), .psd (flattened composite plus layers, RGB or CMYK: with psd_edit, layers and groups become Photoshop groups, point and area type become editable type layers and filled paths become shape layers; otherwise one pixel layer per top-level layer) or .tiff. Every raster format takes ppi (any resolution) and anti_aliasing. A path that already exists is refused unless replace is true.

- `path`: string; required
- `scope`: string (artboard | document | selection | all_artboards); default "artboard"
Expand Down Expand Up @@ -126,6 +127,7 @@ Exports the art to an absolute path; the extension chooses the format: .svg, .pd
- `bmp_bits`: integer (24 | 32); default 24; BMP only: 24 writes RGB, 32 writes RGBA (alpha when transparent is true).
- `psd_layers`: boolean; default true; PSD only: write one pixel layer per top-level layer (name, visibility and opacity kept) under the flattened composite; false writes the composite only. The color parameter (rgb or cmyk) chooses 8-bit RGB or CMYK.
- `psd_edit`: boolean; default true; PSD only, with psd_layers: maximum editability. Sublayers and groups become Photoshop layer groups, point and area type become editable type layers, filled paths become shape layers (solid or gradient fill, vector mask, vector stroke); anything Photoshop cannot hold that way (effects, type on a path, patterns, images) stays a pixel layer. false writes one pixel layer per top-level layer.
- `replace`: boolean; default false; true replaces a file already at path. Without it a path that already exists is refused and nothing is written: choose a new path, or pass true only when the person wants that file replaced.

## switch_document

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Paths are absolute, and the folder exists. When the person names a folder like D
2. **Place**: `place_image` with x, y and width to put a PNG, JPEG, WebP, GIF, or SVG, EPS or DXF art into the open document. A PDF or .ai takes `page` and `crop` (bounding, art, crop, trim, bleed, media) and arrives as editable art, or with `link` true as a linked picture of the page; a PSD takes `psd_import` (objects or flatten); a TIFF takes `page`.
3. **Save editable**: `save_project` to a .fpth path; everything stays editable. Do this before outlining type or expanding.
4. **Export**: `export_file`; the extension picks the format.
- A path that already exists is refused and nothing is written. Choose a new name, or pass `replace` true only when the person asked for that file to be replaced.
- Every `save_project`, `export_file`, `actions` batch, `variables` export, `links` unembed and `run_command` or `run_commands` with `save`, `download-project` or `link-unembed` asks the person in the formpath window, even after they chose Always allow; tell them a question is waiting.
- .svg: scope artboard, document or selection; outline_text true when fonts may be missing where it goes.
- .pdf: every artboard a page with scope all_artboards; vectors, gradients and transparency kept; formpath reopens it editable.
- .eps: Level 3 PostScript of an artboard (all_artboards writes a zip with one EPS per artboard); `color` rgb or cmyk; transparency is flattened against what lies below; formpath reopens it editable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ None: load directly for any failure.
## Procedure

1. **No formpath tools listed**: the MCP server is not connected. Ask the person to run `./formpath mcp` setup (`./formpath agents install`) or check the client's MCP settings, then restart the client.
2. **A call waits, then fails with a consent message**: the formpath window is asking whether to allow the agent, naming it and what it asked for. Tell the person to answer in the formpath window (Allow once covers that one call, Always allow covers every outside agent, Deny refuses; the Preferences > Plugins choice "Outside agents (MCP)" keeps Ask each time, Allowed or Blocked, and only the window can change it), then retry once.
2. **A call waits, then fails with a consent message**: the formpath window is asking whether to allow the agent, naming it and what it asked for. Tell the person to answer in the formpath window (Allow once covers that one call, Always allow covers every outside agent except for writing files, Deny refuses; `save_project`, `export_file`, an `actions` batch, a `variables` export, a `links` unembed and the `save`, `download-project` and `link-unembed` commands ask each time and offer only Deny and Allow once; the Preferences > Plugins choice "Outside agents (MCP)" keeps Ask each time, Allowed or Blocked, and only the window can change it), then retry once.
3. **The engine is not answering**: formpath is not running. `./formpath mcp` starts it; otherwise ask the person to run `./formpath boot` and open http://localhost:5230.
4. **No window open**: tools run in the open formpath window; ask the person to open formpath in a browser or the desktop app.
5. **No object has the id**: ids changed (Pathfinder, expand, outlines, undo, or the person edited). Call `get_document`, match by name or bounds, retry.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ client -> setup/mcp_stdio.py (stdio) -> POST /mcp (backend/app/routers/mcp.py)

The window bridge is private to the formpath window: it gets a secret from `POST /api/mcp/bridge/session` (issued only to formpath's own Origin) and sends it in `X-Formpath-Bridge` on every bridge call through `io/api.ts`. Never add a bridge endpoint that skips `_bridge_refusal`, and never make one a GET.

The first call queues `__consent__`; the window asks the person once and remembers the answer in Preferences. File tools (`open_file`, `save_project`, `export_file`, `place_image`) run in the backend, which calls the window's `__open`, `__place`, `__project` and `__export` and writes or reads the absolute path itself.
The first call queues `__consent__`; the window asks the person once and remembers the answer in Preferences. Calls that write files (`save_project`, `export_file`, `actions` batch, `variables` export, `links` unembed, and `run_command` or `run_commands` with an id in `_WRITING_COMMANDS`; `_writes_files`, also checked in `_call` so the `/api/commands` route is covered) queue a `__consent__` with `each: true` and answers `deny`, `once` every time, and the window shows it even when Allowed (`asksEachTime`, `consentOffers` in `io/api.ts`); a yes runs that call only. `save_project` and `export_file` refuse an existing path unless `replace` is true, and write a new file with `files.write_exclusive`. File tools (`open_file`, `save_project`, `export_file`, `place_image`) run in the backend, which calls the window's `__open`, `__place`, `__project` and `__export` and writes or reads the absolute path itself.

## Adding a tool

Expand Down
Loading
Loading