mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 22:14:30 +00:00
merge-fwe: FW16 E7: docs for agents in the open window (craft-automation README, craft-framework.md)
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
# craft-automation
|
||||
|
||||
Drive a running Craft app from tests, agents and the CLI, and record and play actions. The control channel, its transport, screenshots, the profiler and the trace are desktop only; `actions` and `ui::actions` build on every target, the browser included.
|
||||
Drive a running Craft app from tests, agents and the CLI, and record and play actions. The control channel, its transport, screenshots, the profiler and the trace are desktop only; `actions`, `ui::actions` and the agent settings build on every target, the browser included.
|
||||
|
||||
Features: `ui` (the egui parts), `agents` (agents in the open window: the launcher's switch, the connection file, the link host and the Agents page; desktop), `screen-testing` (stories and the integration binary; turns on both).
|
||||
|
||||
| Module | What it gives the app |
|
||||
| --- | --- |
|
||||
| `actions` | Recorded actions (every target): `ActionList` of `Action`s and `ActionStep`s, `ActionsFile`, playback with `ActionPlayer` and `ActionRunner` under a `PlaybackBudget`, and `Recording`. The app keeps the command table. |
|
||||
| `ui::actions` | `ActionsPanel` (every target): sets, actions and steps as a tree, include and dialog cells, rename (`start_rename`), drag to move, Button Mode, the footer and the menus (`ActionsPanelCommands`, `ActionsMenuFacts` and `panel_rows`, which leaves out the rows the host has no command for). It runs nothing; it reports `ActionsEvent`s. `ActionsPanelState` holds its view state. `ActionsWords` holds its words. |
|
||||
| `agents` | AI agents in the open window. Every target: `AgentSettings` (Control Port, the folders agents may open from and save to, `WhenAppClosed`, Allow Agent Control) and `agents_allowed`. Desktop, feature `agents`: `AgentSwitch`, the ArtCraft Launcher's switch for the app behind the suite's `AI-MCP` flag, watched on a thread; the connection file (`Connection`, `write_connection`, `read_connection`, `remove_stale_connection`, `probe`) that the app's `<id>-cli mcp` finds the open window by. With `ui`: `AgentLink`, the link host that starts, moves, stops and retries the agents' control server to match the settings and publishes the connection file. |
|
||||
| `ui::agents` | `AgentsPage` (desktop, features `agents` and `ui`): the Agents page of Preferences, a custom page over the agent settings in the Preferences draft, with the link's status; the folder rows are `PathSetting`s. `AgentsWords` holds its words. |
|
||||
| `args` | `ControlOptions`: the `--control <PORT>`, `--control-token`, `--control-token-file` values and their `<APP>_CONTROL_*` environment fallbacks, checked the way the apps' command lines report them (usage errors exit 2). |
|
||||
| `security` | Tokens (`generate_token`, `validate_token`, `server_token`, `client_token`), the authentication handshake (`ServerHandshake`: the challenge handshake, which never sends the token, or the one-frame `auth {token}`), bounded line reads, connection and request limits. |
|
||||
| `protocol` | The JSON-lines wire format: one `{"id", "method", "params"}` request per line, one `{"id", "ok", "result" | "error"}` reply per line; `Params` validators that name the bad parameter. |
|
||||
|
||||
@@ -1121,8 +1121,9 @@ Control channel, screenshot queue, profiler and recorded actions for tests and s
|
||||
| `control` | Automation control channel | exists |
|
||||
| `args` | Command-line values and environment fallbacks of the control channel | exists |
|
||||
| `protocol` | JSON-lines wire format and parameter validators | exists |
|
||||
| `security` | Tokens, the `auth` handshake and transport limits | exists |
|
||||
| `server` | Loopback JSON-lines TCP transport (native) | exists |
|
||||
| `security` | Tokens, the authentication handshake (challenge or one-frame token) and transport limits | exists |
|
||||
| `server` | Loopback JSON-lines TCP transport (native): `listen`, `serve`, stopped by dropping its `Listening` | exists |
|
||||
| `agents`, `ui::agents` | AI agents in the open window: the agent settings, the ArtCraft Launcher's switch, the connection file, the link host and the Agents page of Preferences | exists |
|
||||
| `client` | JSON-lines client for tests and command-line tools (native) | exists |
|
||||
| `synthetic` | Synthetic pointer and keyboard input: `ui.click`, `ui.move`, `ui.key`, `ui.type` | exists |
|
||||
| `dialogs` | `ui.dialog.set`, `ui.dialog.confirm` and `ui.dialog.cancel` over a `DialogHost` | exists |
|
||||
@@ -1130,6 +1131,8 @@ Control channel, screenshot queue, profiler and recorded actions for tests and s
|
||||
| `screenshot` | Screenshot request queue | exists |
|
||||
| `trace` | Frame timing trace | exists |
|
||||
|
||||
Agents in the open window. The ArtCraft Launcher's *Settings › AI agents › Let AI agents use Craft apps* is the one switch for every Craft app: with the suite's `AI-MCP` flag on, an app lets agents in when the launcher's app list (`craft-ai-agents`) names it, which `AgentSwitch` watches on a thread; without the flag, the app's own earlier consent decides. While agents may connect, the app's `AgentLink` runs a control server on loopback with the settings' port and the token kept in the settings folder, and publishes `agent-connection.json` there (port, process id, token file, app version). The app's `<id>-cli mcp` reads that file on every tool call and authenticates with the challenge handshake, so an MCP client's configuration holds no port and no token. The handshake's proof labels are `photocraft-control-v1 server` and `photocraft-control-v1 client`, the wire label of version 1 of the protocol. The Agents page of Preferences (`AgentsPage`) is a custom page over the same settings; it has no switch of its own.
|
||||
|
||||
#### craft-behavior
|
||||
|
||||
The behaviour cores of the UI library (layer 1), with no egui and no `Context`: press lifecycle, `ValueDrag`, navigation, item layouts, edit events, overlay placement, fitting and the dock model ([ui-docking.md](ui-docking.md)). Public modules, with the main types at the crate root: `anchor`, `arrangement`, `canvas`, `codec`, `columns`, `command`, `cursor`, `divider`, `doc_key`, `dock`, `edit_history`, `editor`, `eviction`, `fit`, `flow`, `focus`, `geometry`, `grid`, `hit`, `input`, `intent`, `item_layout`, `item_marquee`, `item_source`, `keys`, `label_column`, `layout_memory`, `monitor`, `motion`, `nav`, `one_press`, `overlay`, `part`, `pixel_size`, `placement`, `press`, `quantity`, `role_rule`, `scroll`, `selection`, `sense`, `sizing`, `typing`, `value`, `value_drag`, `wheel`. Every public item is listed in [contract-api.md](contract-api.md).
|
||||
|
||||
Reference in New Issue
Block a user