ext-apps/examples
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Olivier Chafik 4b3f6252a4
pdf-server: add save_as interact action (#580)
* pdf-server: add save_as interact action

Adds a model-callable save_as action to the interact tool that writes the
viewer's current annotated state (annotations + form values) to a new file.

Reuses the get_pages request/reply pattern: model's interact call blocks
while the viewer builds bytes via getAnnotatedPdfBytes() and posts them
back through a new submit_save_data app-only tool.

Validation runs synchronously before bothering the viewer:
- path must be absolute or file://
- isWritablePath gate (same as save_pdf)
- existence check; fails with a descriptive error unless overwrite: true

The viewer can report build errors back via submit_save_data({error}),
so the model gets a real message instead of the 45s timeout.

* pdf-server: warn model off app-only tools in descriptions

Hosts that don't filter visibility:["app"] tools from the model's tool
list will still surface these. The save_pdf one in particular is a
near-miss for the new save_as interact action — point the model at the
right one.

* pdf-server: save_as without path overwrites original

When path is omitted, save_as falls back to the displayed PDF's local
path (tracked per-viewUUID by display_pdf). Same writability gate as
the viewer's save button: isWritablePath + OS-level W_OK probe, so it
refuses on read-only mounts before the viewer roundtrip.

Requires explicit overwrite: true since the original always exists —
the model can't accidentally clobber it.

Remote PDFs have no source path stored; the error tells the model to
pass an explicit path.
2026-04-01 22:45:00 +01:00
..
basic-host chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-preact chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-react chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-solid chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-svelte chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-vanillajs chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
basic-server-vue chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
budget-allocator-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
cohort-heatmap-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
customer-segmentation-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
debug-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
integration-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
map-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
pdf-server pdf-server: add save_as interact action (#580) 2026-04-01 22:45:00 +01:00
qr-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
quickstart chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
say-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
scenario-modeler-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
shadertoy-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
sheet-music-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
system-monitor-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
threejs-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
transcript-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
video-resource-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
wiki-explorer-server chore: bump ext-apps to 1.3.2 (#569) 2026-03-27 17:45:09 +00:00
run-all.ts add EXAMPLE=folder-name support for tests & basic-host (#292) 2026-01-19 20:16:37 +00:00