forked from 1b-agent/opencadstudio-upstream
docs(automation): document the native entry points and their limits
Refs #1349. The automation README describes `--mcp` and never mentions `--serve`, even though every native build accepts it and it is the only channel that works without a display. It also leaves out the two startup dialogs, the `document_id` routing, and what `waiting_input` actually means. `docs/automation/native.md` covers, all measured on a Linux headless machine with `OpenCADStudio 2026.37+165`: - choosing between `--mcp` and `--serve`, and what each needs (display, no-display, `--export` for one-shot conversion); - the writable `HOME`/`XDG_CONFIG_HOME` requirement, without which `ocs_sessions` answers `No user configuration directory`; - the startup dialogs: `AssocPrompt` then `DonationPrompt`, `new` answering `ok` with no document until `close_modal` clears them, and that the donation prompt appears once per application version per profile; - targeting a document: reads and writes follow the active tab, so `document_id` has to be passed explicitly after `new`; - feeding a whole line: `waiting_input` means more input is required (not that nothing happened), `cancel` closes a command, and the `unconsumed` / `blocked_by` fields added in #1392; - the interactive `start`/`input` shapes, including that a typed value goes through `kind: "text"` while a keyword uses `kind: "token"` with its payload in a field named `text`, and that the `TEXT` content step belongs to the in-place editor (`text_input` / `text_commit`); - what only native builds have: `measure`, `ocs_capture` (inline base64, or a PNG path), and `set_properties` with `collection` and colours as `{"Index": n}` / `"ByLayer"`; - the remaining gap: `MTEXT`, `HATCH` and `POLYGON` report `completed` with `added: 0` on the `--serve` path (#1390). The README gains one line pointing to the page, placed after the tool list rather than at the end, so it does not overlap #1394. Docs only; no code changes.
This commit is contained in:
1 parent
70d7e9a31f
commit
747245a75f
2 files changed
+111
No files matched your search
@@ -17,6 +17,10 @@ The server provides four tools:
|
||||
- `ocs_execute` performs one operation, an atomic record update, or a sequential batch against the real editor.
|
||||
- `ocs_capture` returns a bounded PNG of the drawing viewport or complete window.
|
||||
|
||||
Native builds also accept a second, headless entry point (`OpenCADStudio --serve`, one
|
||||
JSON request per line) for scripts and CI; the two native channels, their startup dialogs
|
||||
and their limits are described in [native.md](native.md).
|
||||
|
||||
The normal flow is to call `ocs_sessions`, pass its returned `session_id` as `ocs_session_id` to the other tools, read the chosen session with `ocs_read`, then pass the returned document state into `ocs_execute`. For example, an undo request has this shape:
|
||||
|
||||
```json
|
||||
|
||||
Reference in new issue
Block a user