antechamber 1.0.23 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/background-results.d.ts +3 -3
- package/dist/background-results.js +39 -7
- package/dist/lifecycle.js +2 -0
- package/dist/monitor-sessions.d.ts +7 -0
- package/dist/monitor-sessions.js +15 -1
- package/dist/omo-shells.d.ts +80 -0
- package/dist/omo-shells.js +333 -0
- package/dist/pi-event-translation.d.ts +2 -0
- package/dist/pi-event-translation.js +24 -2
- package/dist/routes-v2.js +56 -4
- package/dist/session-history.js +13 -6
- package/dist/sessions.d.ts +6 -0
- package/dist/sessions.js +16 -0
- package/dist/tool-map.d.ts +2 -0
- package/dist/tool-map.js +3 -0
- package/dist/types.d.ts +30 -0
- package/dist/v2.js +47 -1
- package/dist/work-status.d.ts +2 -0
- package/dist/work-status.js +4 -0
- package/extensions/omo-compat/package.json +1 -1
- package/extensions/omo-dag/package.json +1 -1
- package/extensions/omo-work/README.md +8 -15
- package/extensions/omo-work/docs/DESIGN.md +24 -28
- package/extensions/omo-work/package.json +1 -1
- package/extensions/omo-work/service/main.js +0 -10
- package/extensions/omo-work/status/main.js +92 -93
- package/package.json +1 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# OmO Work: design
|
|
2
2
|
|
|
3
|
-
OmO Work is an OpenChamber 2.x Work Status section for the
|
|
4
|
-
|
|
3
|
+
OmO Work is an OpenChamber 2.x Work Status section for the open session's work
|
|
4
|
+
that OpenChamber has no surface for: the todo list, the goal continuation timer
|
|
5
|
+
and other wake sources. Monitors, eval cells and background terminal sessions
|
|
6
|
+
are OpenChamber's own background commands, reported by antechamber as OpenCode
|
|
7
|
+
shells ([docs/architecture.md](../../../docs/architecture.md#omo-background-work-as-opencode-shells)),
|
|
8
|
+
so the section does not list them. This document covers its parts, its data, its security
|
|
5
9
|
boundary and its limits. Where each field comes from in OmO is documented in
|
|
6
10
|
[docs/architecture.md](../../../docs/architecture.md#omo-work-status-section).
|
|
7
11
|
|
|
@@ -10,7 +14,7 @@ boundary and its limits. Where each field comes from in OmO is documented in
|
|
|
10
14
|
```
|
|
11
15
|
OpenChamber Work Status panel
|
|
12
16
|
└─ section frame (status/index.html + status/main.js, sandboxed iframe)
|
|
13
|
-
│ host.serviceRequest GET /status,
|
|
17
|
+
│ host.serviceRequest GET /status, POST /goal/fire
|
|
14
18
|
▼
|
|
15
19
|
OpenChamber host ── loopback + OPENCHAMBER_SERVICE_TOKEN ──▶ service/main.js (Node, on the host)
|
|
16
20
|
│ reads <state dir>/run/<pid>.json
|
|
@@ -18,7 +22,7 @@ OpenChamber host ── loopback + OPENCHAMBER_SERVICE_TOKEN ──▶ service/m
|
|
|
18
22
|
▼
|
|
19
23
|
antechamber /antechamber/work-status/<session>[...]
|
|
20
24
|
│ snapshot from its bridges,
|
|
21
|
-
▼
|
|
25
|
+
▼ goal RPC to OmO
|
|
22
26
|
omo --mode rpc
|
|
23
27
|
```
|
|
24
28
|
|
|
@@ -42,7 +46,7 @@ OpenChamber host ── loopback + OPENCHAMBER_SERVICE_TOKEN ──▶ service/m
|
|
|
42
46
|
|
|
43
47
|
| Field | Content |
|
|
44
48
|
|---|---|
|
|
45
|
-
| `live` | the session's agent process is running;
|
|
49
|
+
| `live` | the session's agent process is running; Fire now needs it |
|
|
46
50
|
| `todo` | todo phases in OmO's order, each `{name, tasks: [{content, status}]}`, status `pending`, `in_progress`, `completed` or `cancelled` |
|
|
47
51
|
| `monitors` | live watches (newest first), then the five most recently ended, each with its last 20 matched lines and, once ended, a readable reason |
|
|
48
52
|
| `evalCells` | detached eval cells from `eval_cells.list`, or from the codemode wake source when the list is unavailable (`evalCellsListed: false`) |
|
|
@@ -50,27 +54,27 @@ OpenChamber host ── loopback + OPENCHAMBER_SERVICE_TOKEN ──▶ service/m
|
|
|
50
54
|
| `goal` | the goal continuation timer (`armed`, `kind`, `dueAtMs`) and the wake-source counts it waits on, or `null` |
|
|
51
55
|
| `wakeSources` | other active wake sources without a dedicated view |
|
|
52
56
|
|
|
53
|
-
The frame
|
|
54
|
-
|
|
57
|
+
The frame shows `todo`, `goal` and `wakeSources`. `monitors`, `evalCells` and
|
|
58
|
+
`background` stay in the snapshot, and the adapter keeps its
|
|
59
|
+
`/antechamber/work-status/<session>/eval/<cell>[/stop]` routes, for section
|
|
60
|
+
versions installed before these moved to OpenChamber's background commands
|
|
61
|
+
(ZIP installs never update). The frame checks the envelope (`src/model.ts`) and
|
|
62
|
+
imports these types from the adapter, so a shape change on either side fails
|
|
63
|
+
the typecheck.
|
|
55
64
|
|
|
56
65
|
## Refresh
|
|
57
66
|
|
|
58
67
|
The frame polls `/status` one request at a time:
|
|
59
68
|
|
|
60
|
-
- every 1.5 s while anything can change on its own (
|
|
61
|
-
|
|
69
|
+
- every 1.5 s while anything it shows can change on its own (an armed timer,
|
|
70
|
+
another wake source, a task in progress);
|
|
62
71
|
- every 5 s otherwise, and while the page is hidden;
|
|
63
72
|
- every 10 s after an error, keeping the last snapshot on screen with the
|
|
64
73
|
error above it.
|
|
65
74
|
|
|
66
75
|
A session switch bumps a generation counter, so a late answer for the previous
|
|
67
76
|
session is dropped. Elapsed times and countdowns tick every second from the
|
|
68
|
-
snapshot without refetching.
|
|
69
|
-
poll while the cell runs, and once more when its state changes, so a finished
|
|
70
|
-
cell shows its last lines.
|
|
71
|
-
|
|
72
|
-
The adapter caches `eval_cells.list` for one second per session, so several
|
|
73
|
-
open sections cost one RPC.
|
|
77
|
+
snapshot without refetching.
|
|
74
78
|
|
|
75
79
|
## Choosing the server
|
|
76
80
|
|
|
@@ -97,21 +101,13 @@ loopback.
|
|
|
97
101
|
- **Frame**: the sandboxed iframe holds no token. It reaches the service only
|
|
98
102
|
through the host, which adds its own per-service token. All text from OmO is
|
|
99
103
|
inserted with `textContent`, never as HTML.
|
|
100
|
-
- **Inputs**: session IDs must match `ses_[0-9A-Za-z]
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
(`eval_cells.stop`, `goal_continuation_fire_now`). The extension kills no
|
|
105
|
-
process itself.
|
|
104
|
+
- **Inputs**: session IDs must match `ses_[0-9A-Za-z]+`, in both the service
|
|
105
|
+
and the adapter.
|
|
106
|
+
- **Actions**: Fire now maps to OmO's own RPC request
|
|
107
|
+
(`goal_continuation_fire_now`). The extension kills no process itself.
|
|
106
108
|
|
|
107
109
|
## Limits
|
|
108
110
|
|
|
109
|
-
- No
|
|
110
|
-
holds: OmO exposes neither over RPC.
|
|
111
|
-
- Eval cells need OmO's codemode. Without it, or while the agent process is
|
|
112
|
-
stopped, the section shows the cells OmO last reported, without output or
|
|
113
|
-
Stop.
|
|
114
|
-
- Background sessions come from OmO's terminal manifest, which OmO writes on
|
|
115
|
-
start and exit; their command is shown but not their output.
|
|
111
|
+
- No continuation holds: OmO does not publish them over RPC.
|
|
116
112
|
- The service must run on the machine that runs antechamber, since it reads
|
|
117
113
|
the run records.
|
|
@@ -52,7 +52,6 @@ function discoverServers(stateDirs, isAlive = alive) {
|
|
|
52
52
|
|
|
53
53
|
// extensions/omo-work/src/service.ts
|
|
54
54
|
var SESSION_ID = /^ses_[0-9A-Za-z]+$/;
|
|
55
|
-
var CELL_ID = /^[\w.:-]{1,128}$/;
|
|
56
55
|
var STATUS_TIMEOUT_MS = 5e3;
|
|
57
56
|
var ACTION_TIMEOUT_MS = 15e3;
|
|
58
57
|
async function call(server, method, path, timeoutMs) {
|
|
@@ -131,20 +130,11 @@ function createServer(options) {
|
|
|
131
130
|
if (!SESSION_ID.test(session)) return fail(res, 400, "session query must be an OpenChamber session id");
|
|
132
131
|
const custom = url.searchParams.get("stateDir")?.trim();
|
|
133
132
|
const stateDirs = custom ? [resolve(expandHome(custom))] : defaultDirs();
|
|
134
|
-
const cell = url.searchParams.get("cell") ?? "";
|
|
135
133
|
const method = req.method ?? "GET";
|
|
136
134
|
req.resume();
|
|
137
135
|
if (url.pathname === "/status" && method === "GET") return void relayStatus(res, session, stateDirs);
|
|
138
136
|
if (url.pathname === "/goal/fire" && method === "POST")
|
|
139
137
|
return void relayAction(res, session, stateDirs, "POST", "goal/fire");
|
|
140
|
-
if (url.pathname.startsWith("/eval")) {
|
|
141
|
-
if (!CELL_ID.test(cell)) return fail(res, 400, "cell query must be an eval cell id");
|
|
142
|
-
const tail = Number(url.searchParams.get("tailBytes") ?? 8192);
|
|
143
|
-
if (url.pathname === "/eval" && method === "GET")
|
|
144
|
-
return void relayAction(res, session, stateDirs, "GET", `eval/${encodeURIComponent(cell)}?tailBytes=${tail}`);
|
|
145
|
-
if (url.pathname === "/eval/stop" && method === "POST")
|
|
146
|
-
return void relayAction(res, session, stateDirs, "POST", `eval/${encodeURIComponent(cell)}/stop`);
|
|
147
|
-
}
|
|
148
138
|
return fail(res, 404, "not-found");
|
|
149
139
|
});
|
|
150
140
|
}
|