You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ship Goal/task controls over leased Code UI routes and A0-07 skill
discovery validation until W3-01 exposes skill HTTP.
Signed-off-by: Eli Ma <eli@patch.sh>
Copy file name to clipboardExpand all lines: docs/commands/code.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ Selecting `loopback` is rejected when `--host` is not a loopback address, and th
111
111
-`POST /api/code/controller/attach` — loopback. `kind: "automation"` requests additionally require `X-Libra-Control-Token`. The handler **issues** the lease's `controllerToken` (it does not expect the caller to send one).
-`POST /api/code/control/cancel` — loopback + `X-Code-Controller-Token`. `Automation` leases also require `X-Libra-Control-Token`; this is the only difference from the TUI `Esc` cancel path.
-`POST /api/code/task/dispatch` — loopback + `X-Code-Controller-Token`; user-initiated sub-agent dispatch requires an active controller write lease (browser or automation). Automation leases additionally require `X-Libra-Control-Token`.
115
115
-`POST /api/code/goal/start`, `POST /api/code/goal/cancel` — loopback + `X-Code-Controller-Token`; goal mutation requires the active controller lease.
116
116
117
117
Browser write requests share the same 256 KiB body limit and audit-sink wiring as automation control. The browser persists the lease only in memory; reloading the page drops the lease and the next write reattaches.
Copy file name to clipboardExpand all lines: web/README.md
+24-12Lines changed: 24 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,17 +15,21 @@ pnpm test # vitest unit tests for the browser foundation
15
15
pnpm build # static export → web/out/
16
16
```
17
17
18
-
## Current UI status (W2-07 + W2-08)
18
+
## Current UI status (W2-07 + W2-08 + W2-09)
19
19
20
20
The shipped page mounts the shared session/SSE store and browser-controller
21
-
lease provider, shows the current session title and phase, and renders the
21
+
lease provider, shows the current session title and phase, renders the
22
22
pending approval / `request_user_input` panel when the snapshot has one
23
-
(`SessionInteractions` → `InteractionsHost`). It does not yet ship a
24
-
three-pane workspace, composer, thread sidebar, terminal, or workflow tabs.
23
+
(`SessionInteractions` → `InteractionsHost`), and mounts goal/task/skill
24
+
controls (`SessionGoalTaskSkill`). It does not yet ship a three-pane
25
+
workspace, composer, thread sidebar, terminal, or workflow tabs.
25
26
26
27
W2-07 owns the shared wire foundation under `web/src/lib/code-ui/`. W2-08 owns
27
28
approval and structured user-input under `web/src/lib/code-ui/interactions/`
28
-
and `web/src/components/workspace/interactions/`. Later domain panels remain
29
+
and `web/src/components/workspace/interactions/`. W2-09 owns goal/task/skill
30
+
under `web/src/lib/code-ui/goal-task-skill/` and
31
+
`web/src/components/workspace/goal-task-skill/` (skills use the A0-07 curated
32
+
registry until W3-01 exposes Code UI skill HTTP). Later domain panels remain
29
33
with later W2 cards (usage W2-13, workflow review W2-16, etc.).
30
34
31
35
## Live API contract
@@ -46,6 +50,10 @@ The browser only talks to its same-origin server. The Rust side enforces loopbac
46
50
|`/api/code/messages`| POST | Submit a user message (header `X-Code-Controller-Token`, body ≤256 KiB). |
47
51
|`/api/code/interactions/{id}`| POST | Resolve a pending `CodeUiInteractionRequest`. |
48
52
|`/api/code/control/cancel`| POST | Cancel the active turn. Browser leases need only the controller token; automation leases additionally require `X-Libra-Control-Token`. |
53
+
|`/api/code/goal/start`| POST | Start a Goal (`{ objective }`, header `X-Code-Controller-Token`) → `{ accepted, status }`. |
54
+
|`/api/code/goal/status`| GET | Observe the active Goal status text (`{ status }`). No controller token; empty sessions return a no-active-Goal error treated as empty UI state. |
55
+
|`/api/code/goal/cancel`| POST | Cancel the active Goal (`{ reason }`, header `X-Code-Controller-Token`) → `{ accepted, status }`. |
56
+
|`/api/code/task/dispatch`| POST | Dispatch a user-initiated sub-agent task (`{ agent, prompt }`, header `X-Code-Controller-Token`) → `{ accepted, result }`. |
49
57
50
58
The wire types are pinned in two places — keep them in lock-step:
51
59
@@ -56,22 +64,26 @@ The wire types are pinned in two places — keep them in lock-step:
└── goal-task-skill/ # Goal/task API + A0-07 skill helpers (W2-09)
65
75
```
66
76
67
-
`web/src/lib/code-ui/store.tsx` owns the `CodeUiSessionSnapshot` and the SSE reconnect loop. `web/src/lib/code-ui/controller.tsx` owns the browser controller lease. `app/page.tsx` mounts both providers once and renders `SessionInteractions` so pending approval/user-input prompts resolve through the leased controller.
77
+
`web/src/lib/code-ui/store.tsx` owns the `CodeUiSessionSnapshot` and the SSE reconnect loop. `web/src/lib/code-ui/controller.tsx` owns the browser controller lease. `app/page.tsx` mounts both providers once and renders `SessionInteractions`plus `SessionGoalTaskSkill`so pending prompts and goal/task/skill controls resolve through the leased controller.
68
78
69
79
## Browser write surface
70
80
71
81
Composer and other domain writers will continue to land in later W2 cards.
72
-
Approval and `request_user_input` already flow through `useBrowserController()`
73
-
via `SessionInteractions`: `respond` posts to `/api/code/interactions/{id}` and
74
-
`cancel` posts to `/api/code/control/cancel`. On the first write the hook calls
82
+
Approval, `request_user_input`, Goal start/cancel, and task dispatch already flow
83
+
through `useBrowserController()` via `SessionInteractions` /
84
+
`SessionGoalTaskSkill`: writes post with `X-Code-Controller-Token` after
85
+
`withLease` recovery. Skill buttons only validate the A0-07 curated registry
86
+
until W3-01 exposes skill HTTP. On the first write the hook calls
0 commit comments