@llm4ts/shell 4.2.0 → 4.4.0
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/dist/Cli.d.ts +1 -1
- package/dist/Cli.d.ts.map +1 -1
- package/dist/Cli.js +11 -2
- package/dist/Cli.js.map +1 -1
- package/dist/Watch.d.ts +8 -0
- package/dist/Watch.d.ts.map +1 -1
- package/dist/Watch.js +6 -4
- package/dist/Watch.js.map +1 -1
- package/dist/WebFrame.d.ts +320 -0
- package/dist/WebFrame.d.ts.map +1 -0
- package/dist/WebFrame.js +136 -0
- package/dist/WebFrame.js.map +1 -0
- package/dist/WebWatch.d.ts +63 -0
- package/dist/WebWatch.d.ts.map +1 -0
- package/dist/WebWatch.js +226 -0
- package/dist/WebWatch.js.map +1 -0
- package/dist/WebWatchView.d.ts +51 -0
- package/dist/WebWatchView.d.ts.map +1 -0
- package/dist/WebWatchView.js +234 -0
- package/dist/WebWatchView.js.map +1 -0
- package/package.json +5 -4
- package/src/Cli.ts +18 -4
- package/src/Watch.ts +8 -4
- package/src/WebFrame.ts +159 -0
- package/src/WebWatch.ts +398 -0
- package/src/WebWatchView.ts +330 -0
- package/web/app.js +29 -0
- package/web/fonts/Geist-Variable.woff2 +0 -0
- package/web/fonts/GeistMono-Variable.woff2 +0 -0
- package/web/fonts/OFL.txt +92 -0
- package/web/index.html +181 -0
- package/web/style.css +1341 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
/**
|
|
3
|
+
* What travels between `llm4ts watch --web` and its page (ADR 0051): the run
|
|
4
|
+
* the page first asks for, and the frames it draws. The server encodes
|
|
5
|
+
* through these schemas and the page decodes every response and every
|
|
6
|
+
* streamed frame through them. Browser-safe: this module imports only
|
|
7
|
+
* `effect/Schema`, so the page's bundle carries it.
|
|
8
|
+
*/
|
|
9
|
+
/** How a timeline item is coloured: the tree's styles, and the node states. */
|
|
10
|
+
export declare const WebTone: Schema.Literals<readonly ["orchestrator", "judgment", "judge", "running", "log", "tool", "done", "failed", "issue"]>;
|
|
11
|
+
export type WebTone = typeof WebTone.Type;
|
|
12
|
+
export declare const WebChipStatus: Schema.Literals<readonly ["planned", "running", "waiting", "done", "failed"]>;
|
|
13
|
+
export type WebChipStatus = typeof WebChipStatus.Type;
|
|
14
|
+
export declare const WebTimelineItem: Schema.Struct<{
|
|
15
|
+
readonly seq: Schema.Number;
|
|
16
|
+
readonly at: Schema.Number;
|
|
17
|
+
readonly who: Schema.String;
|
|
18
|
+
readonly what: Schema.String;
|
|
19
|
+
readonly tone: Schema.Literals<readonly ["orchestrator", "judgment", "judge", "running", "log", "tool", "done", "failed", "issue"]>;
|
|
20
|
+
}>;
|
|
21
|
+
export type WebTimelineItem = typeof WebTimelineItem.Type;
|
|
22
|
+
/** A judge's verdict on a lane, with the trace seq that carried it. */
|
|
23
|
+
export declare const WebVerdict: Schema.Struct<{
|
|
24
|
+
readonly lane: Schema.String;
|
|
25
|
+
readonly round: Schema.Number;
|
|
26
|
+
readonly cleared: Schema.Boolean;
|
|
27
|
+
readonly issues: Schema.Number;
|
|
28
|
+
readonly dimensions: Schema.$Array<Schema.Struct<{
|
|
29
|
+
readonly id: Schema.String;
|
|
30
|
+
readonly score: Schema.Number;
|
|
31
|
+
readonly max: Schema.Number;
|
|
32
|
+
}>>;
|
|
33
|
+
readonly seq: Schema.Number;
|
|
34
|
+
}>;
|
|
35
|
+
export type WebVerdict = typeof WebVerdict.Type;
|
|
36
|
+
/** A task of a story's plan, in the story board's column (AgentTree `taskColumnOf`). */
|
|
37
|
+
export declare const WebTask: Schema.Struct<{
|
|
38
|
+
readonly index: Schema.Number;
|
|
39
|
+
readonly title: Schema.String;
|
|
40
|
+
readonly column: Schema.Literals<readonly ["todo", "doing", "done"]>;
|
|
41
|
+
}>;
|
|
42
|
+
export type WebTask = typeof WebTask.Type;
|
|
43
|
+
export declare const WebStory: Schema.Struct<{
|
|
44
|
+
readonly id: Schema.String;
|
|
45
|
+
readonly status: Schema.Literals<readonly ["planned", "running", "waiting", "done", "failed"]>;
|
|
46
|
+
readonly executor: Schema.optional<Schema.String>;
|
|
47
|
+
/** Who codes it, `codex#2`, once it has a lane. */
|
|
48
|
+
readonly clone: Schema.optional<Schema.String>;
|
|
49
|
+
readonly stage: Schema.optional<Schema.String>;
|
|
50
|
+
readonly startedAt: Schema.optional<Schema.Number>;
|
|
51
|
+
readonly endedAt: Schema.optional<Schema.Number>;
|
|
52
|
+
readonly tokens: Schema.Number;
|
|
53
|
+
readonly prompt: Schema.Number;
|
|
54
|
+
readonly completion: Schema.Number;
|
|
55
|
+
readonly model: Schema.optional<Schema.String>;
|
|
56
|
+
readonly merged: Schema.Boolean;
|
|
57
|
+
readonly failStage: Schema.optional<Schema.String>;
|
|
58
|
+
readonly failMessage: Schema.optional<Schema.String>;
|
|
59
|
+
readonly tools: Schema.$Array<Schema.String>;
|
|
60
|
+
readonly activity: Schema.optional<Schema.Struct<{
|
|
61
|
+
readonly text: Schema.String;
|
|
62
|
+
readonly since: Schema.Number;
|
|
63
|
+
}>>;
|
|
64
|
+
readonly note: Schema.optional<Schema.String>;
|
|
65
|
+
readonly tasks: Schema.$Array<Schema.Struct<{
|
|
66
|
+
readonly index: Schema.Number;
|
|
67
|
+
readonly title: Schema.String;
|
|
68
|
+
readonly column: Schema.Literals<readonly ["todo", "doing", "done"]>;
|
|
69
|
+
}>>;
|
|
70
|
+
}>;
|
|
71
|
+
export type WebStory = typeof WebStory.Type;
|
|
72
|
+
export declare const WebExecutor: Schema.Struct<{
|
|
73
|
+
readonly name: Schema.String;
|
|
74
|
+
readonly state: Schema.Literals<readonly ["busy", "idle", "out"]>;
|
|
75
|
+
readonly text: Schema.String;
|
|
76
|
+
/** Everything it holds now, as AgentTree `heldBy` lists it. */
|
|
77
|
+
readonly leases: Schema.$Array<Schema.String>;
|
|
78
|
+
/** Why the roster left it out of the round, when it is out. */
|
|
79
|
+
readonly reason: Schema.optional<Schema.String>;
|
|
80
|
+
}>;
|
|
81
|
+
export type WebExecutor = typeof WebExecutor.Type;
|
|
82
|
+
export declare const WebFrame: Schema.Struct<{
|
|
83
|
+
/** Steps folded, of `steps`; a live frame has folded them all. */
|
|
84
|
+
readonly count: Schema.Number;
|
|
85
|
+
readonly steps: Schema.Number;
|
|
86
|
+
readonly seq: Schema.optional<Schema.Number>;
|
|
87
|
+
readonly lastSeq: Schema.optional<Schema.Number>;
|
|
88
|
+
readonly startedAt: Schema.optional<Schema.Number>;
|
|
89
|
+
readonly now: Schema.optional<Schema.Number>;
|
|
90
|
+
readonly ended: Schema.optional<Schema.String>;
|
|
91
|
+
readonly title: Schema.String;
|
|
92
|
+
readonly action: Schema.optional<Schema.String>;
|
|
93
|
+
readonly stage: Schema.String;
|
|
94
|
+
readonly agents: Schema.String;
|
|
95
|
+
readonly counts: Schema.Struct<{
|
|
96
|
+
readonly planned: Schema.Number;
|
|
97
|
+
readonly running: Schema.Number;
|
|
98
|
+
readonly waiting: Schema.Number;
|
|
99
|
+
readonly done: Schema.Number;
|
|
100
|
+
readonly failed: Schema.Number;
|
|
101
|
+
readonly total: Schema.Number;
|
|
102
|
+
}>;
|
|
103
|
+
readonly tokens: Schema.Number;
|
|
104
|
+
readonly costUsd: Schema.Number;
|
|
105
|
+
readonly stories: Schema.$Array<Schema.Struct<{
|
|
106
|
+
readonly id: Schema.String;
|
|
107
|
+
readonly status: Schema.Literals<readonly ["planned", "running", "waiting", "done", "failed"]>;
|
|
108
|
+
readonly executor: Schema.optional<Schema.String>;
|
|
109
|
+
/** Who codes it, `codex#2`, once it has a lane. */
|
|
110
|
+
readonly clone: Schema.optional<Schema.String>;
|
|
111
|
+
readonly stage: Schema.optional<Schema.String>;
|
|
112
|
+
readonly startedAt: Schema.optional<Schema.Number>;
|
|
113
|
+
readonly endedAt: Schema.optional<Schema.Number>;
|
|
114
|
+
readonly tokens: Schema.Number;
|
|
115
|
+
readonly prompt: Schema.Number;
|
|
116
|
+
readonly completion: Schema.Number;
|
|
117
|
+
readonly model: Schema.optional<Schema.String>;
|
|
118
|
+
readonly merged: Schema.Boolean;
|
|
119
|
+
readonly failStage: Schema.optional<Schema.String>;
|
|
120
|
+
readonly failMessage: Schema.optional<Schema.String>;
|
|
121
|
+
readonly tools: Schema.$Array<Schema.String>;
|
|
122
|
+
readonly activity: Schema.optional<Schema.Struct<{
|
|
123
|
+
readonly text: Schema.String;
|
|
124
|
+
readonly since: Schema.Number;
|
|
125
|
+
}>>;
|
|
126
|
+
readonly note: Schema.optional<Schema.String>;
|
|
127
|
+
readonly tasks: Schema.$Array<Schema.Struct<{
|
|
128
|
+
readonly index: Schema.Number;
|
|
129
|
+
readonly title: Schema.String;
|
|
130
|
+
readonly column: Schema.Literals<readonly ["todo", "doing", "done"]>;
|
|
131
|
+
}>>;
|
|
132
|
+
}>>;
|
|
133
|
+
/** The story the detail card follows until the reader picks one. */
|
|
134
|
+
readonly focus: Schema.optional<Schema.String>;
|
|
135
|
+
readonly judge: Schema.Struct<{
|
|
136
|
+
readonly executor: Schema.optional<Schema.String>;
|
|
137
|
+
readonly state: Schema.Literals<readonly ["idle", "waiting", "running"]>;
|
|
138
|
+
readonly reviews: Schema.Number;
|
|
139
|
+
readonly verdicts: Schema.Number;
|
|
140
|
+
readonly borrowed: Schema.Number;
|
|
141
|
+
}>;
|
|
142
|
+
readonly verdicts: Schema.$Array<Schema.Struct<{
|
|
143
|
+
readonly lane: Schema.String;
|
|
144
|
+
readonly round: Schema.Number;
|
|
145
|
+
readonly cleared: Schema.Boolean;
|
|
146
|
+
readonly issues: Schema.Number;
|
|
147
|
+
readonly dimensions: Schema.$Array<Schema.Struct<{
|
|
148
|
+
readonly id: Schema.String;
|
|
149
|
+
readonly score: Schema.Number;
|
|
150
|
+
readonly max: Schema.Number;
|
|
151
|
+
}>>;
|
|
152
|
+
readonly seq: Schema.Number;
|
|
153
|
+
}>>;
|
|
154
|
+
readonly merged: Schema.Number;
|
|
155
|
+
readonly roster: Schema.$Array<Schema.Struct<{
|
|
156
|
+
readonly name: Schema.String;
|
|
157
|
+
readonly state: Schema.Literals<readonly ["busy", "idle", "out"]>;
|
|
158
|
+
readonly text: Schema.String;
|
|
159
|
+
/** Everything it holds now, as AgentTree `heldBy` lists it. */
|
|
160
|
+
readonly leases: Schema.$Array<Schema.String>;
|
|
161
|
+
/** Why the roster left it out of the round, when it is out. */
|
|
162
|
+
readonly reason: Schema.optional<Schema.String>;
|
|
163
|
+
}>>;
|
|
164
|
+
/** The latest items; `timelineCount` says how many there are in all. */
|
|
165
|
+
readonly timeline: Schema.$Array<Schema.Struct<{
|
|
166
|
+
readonly seq: Schema.Number;
|
|
167
|
+
readonly at: Schema.Number;
|
|
168
|
+
readonly who: Schema.String;
|
|
169
|
+
readonly what: Schema.String;
|
|
170
|
+
readonly tone: Schema.Literals<readonly ["orchestrator", "judgment", "judge", "running", "log", "tool", "done", "failed", "issue"]>;
|
|
171
|
+
}>>;
|
|
172
|
+
readonly timelineCount: Schema.Number;
|
|
173
|
+
/** The replay's wait before this frame, so the playhead moves as long. */
|
|
174
|
+
readonly gapMs: Schema.Number;
|
|
175
|
+
}>;
|
|
176
|
+
export type WebFrame = typeof WebFrame.Type;
|
|
177
|
+
/** A step of the trace, as the scrubber places it. */
|
|
178
|
+
export declare const WebRunStep: Schema.Struct<{
|
|
179
|
+
readonly seq: Schema.Number;
|
|
180
|
+
readonly at: Schema.Number;
|
|
181
|
+
}>;
|
|
182
|
+
export type WebRunStep = typeof WebRunStep.Type;
|
|
183
|
+
/** The run as the page first sees it: its mode, its steps, its whole timeline for the scrubber. */
|
|
184
|
+
export declare const WebRun: Schema.Struct<{
|
|
185
|
+
readonly mode: Schema.Literals<readonly ["live", "replay"]>;
|
|
186
|
+
readonly runId: Schema.optional<Schema.String>;
|
|
187
|
+
readonly trace: Schema.String;
|
|
188
|
+
readonly speed: Schema.Number;
|
|
189
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
190
|
+
readonly seq: Schema.Number;
|
|
191
|
+
readonly at: Schema.Number;
|
|
192
|
+
}>>;
|
|
193
|
+
readonly lastSeq: Schema.optional<Schema.Number>;
|
|
194
|
+
readonly timeline: Schema.$Array<Schema.Struct<{
|
|
195
|
+
readonly seq: Schema.Number;
|
|
196
|
+
readonly at: Schema.Number;
|
|
197
|
+
readonly who: Schema.String;
|
|
198
|
+
readonly what: Schema.String;
|
|
199
|
+
readonly tone: Schema.Literals<readonly ["orchestrator", "judgment", "judge", "running", "log", "tool", "done", "failed", "issue"]>;
|
|
200
|
+
}>>;
|
|
201
|
+
}>;
|
|
202
|
+
export type WebRun = typeof WebRun.Type;
|
|
203
|
+
/**
|
|
204
|
+
* The bodies on the wire: JSON text, an absent value written as `null`. The
|
|
205
|
+
* server's `schemaJson` responses and its server-sent frames use this
|
|
206
|
+
* codec, and the page decodes with it.
|
|
207
|
+
*/
|
|
208
|
+
export declare const WebFrameJson: Schema.fromJsonString<Schema.toCodecJson<Schema.Struct<{
|
|
209
|
+
/** Steps folded, of `steps`; a live frame has folded them all. */
|
|
210
|
+
readonly count: Schema.Number;
|
|
211
|
+
readonly steps: Schema.Number;
|
|
212
|
+
readonly seq: Schema.optional<Schema.Number>;
|
|
213
|
+
readonly lastSeq: Schema.optional<Schema.Number>;
|
|
214
|
+
readonly startedAt: Schema.optional<Schema.Number>;
|
|
215
|
+
readonly now: Schema.optional<Schema.Number>;
|
|
216
|
+
readonly ended: Schema.optional<Schema.String>;
|
|
217
|
+
readonly title: Schema.String;
|
|
218
|
+
readonly action: Schema.optional<Schema.String>;
|
|
219
|
+
readonly stage: Schema.String;
|
|
220
|
+
readonly agents: Schema.String;
|
|
221
|
+
readonly counts: Schema.Struct<{
|
|
222
|
+
readonly planned: Schema.Number;
|
|
223
|
+
readonly running: Schema.Number;
|
|
224
|
+
readonly waiting: Schema.Number;
|
|
225
|
+
readonly done: Schema.Number;
|
|
226
|
+
readonly failed: Schema.Number;
|
|
227
|
+
readonly total: Schema.Number;
|
|
228
|
+
}>;
|
|
229
|
+
readonly tokens: Schema.Number;
|
|
230
|
+
readonly costUsd: Schema.Number;
|
|
231
|
+
readonly stories: Schema.$Array<Schema.Struct<{
|
|
232
|
+
readonly id: Schema.String;
|
|
233
|
+
readonly status: Schema.Literals<readonly ["planned", "running", "waiting", "done", "failed"]>;
|
|
234
|
+
readonly executor: Schema.optional<Schema.String>;
|
|
235
|
+
/** Who codes it, `codex#2`, once it has a lane. */
|
|
236
|
+
readonly clone: Schema.optional<Schema.String>;
|
|
237
|
+
readonly stage: Schema.optional<Schema.String>;
|
|
238
|
+
readonly startedAt: Schema.optional<Schema.Number>;
|
|
239
|
+
readonly endedAt: Schema.optional<Schema.Number>;
|
|
240
|
+
readonly tokens: Schema.Number;
|
|
241
|
+
readonly prompt: Schema.Number;
|
|
242
|
+
readonly completion: Schema.Number;
|
|
243
|
+
readonly model: Schema.optional<Schema.String>;
|
|
244
|
+
readonly merged: Schema.Boolean;
|
|
245
|
+
readonly failStage: Schema.optional<Schema.String>;
|
|
246
|
+
readonly failMessage: Schema.optional<Schema.String>;
|
|
247
|
+
readonly tools: Schema.$Array<Schema.String>;
|
|
248
|
+
readonly activity: Schema.optional<Schema.Struct<{
|
|
249
|
+
readonly text: Schema.String;
|
|
250
|
+
readonly since: Schema.Number;
|
|
251
|
+
}>>;
|
|
252
|
+
readonly note: Schema.optional<Schema.String>;
|
|
253
|
+
readonly tasks: Schema.$Array<Schema.Struct<{
|
|
254
|
+
readonly index: Schema.Number;
|
|
255
|
+
readonly title: Schema.String;
|
|
256
|
+
readonly column: Schema.Literals<readonly ["todo", "doing", "done"]>;
|
|
257
|
+
}>>;
|
|
258
|
+
}>>;
|
|
259
|
+
/** The story the detail card follows until the reader picks one. */
|
|
260
|
+
readonly focus: Schema.optional<Schema.String>;
|
|
261
|
+
readonly judge: Schema.Struct<{
|
|
262
|
+
readonly executor: Schema.optional<Schema.String>;
|
|
263
|
+
readonly state: Schema.Literals<readonly ["idle", "waiting", "running"]>;
|
|
264
|
+
readonly reviews: Schema.Number;
|
|
265
|
+
readonly verdicts: Schema.Number;
|
|
266
|
+
readonly borrowed: Schema.Number;
|
|
267
|
+
}>;
|
|
268
|
+
readonly verdicts: Schema.$Array<Schema.Struct<{
|
|
269
|
+
readonly lane: Schema.String;
|
|
270
|
+
readonly round: Schema.Number;
|
|
271
|
+
readonly cleared: Schema.Boolean;
|
|
272
|
+
readonly issues: Schema.Number;
|
|
273
|
+
readonly dimensions: Schema.$Array<Schema.Struct<{
|
|
274
|
+
readonly id: Schema.String;
|
|
275
|
+
readonly score: Schema.Number;
|
|
276
|
+
readonly max: Schema.Number;
|
|
277
|
+
}>>;
|
|
278
|
+
readonly seq: Schema.Number;
|
|
279
|
+
}>>;
|
|
280
|
+
readonly merged: Schema.Number;
|
|
281
|
+
readonly roster: Schema.$Array<Schema.Struct<{
|
|
282
|
+
readonly name: Schema.String;
|
|
283
|
+
readonly state: Schema.Literals<readonly ["busy", "idle", "out"]>;
|
|
284
|
+
readonly text: Schema.String;
|
|
285
|
+
/** Everything it holds now, as AgentTree `heldBy` lists it. */
|
|
286
|
+
readonly leases: Schema.$Array<Schema.String>;
|
|
287
|
+
/** Why the roster left it out of the round, when it is out. */
|
|
288
|
+
readonly reason: Schema.optional<Schema.String>;
|
|
289
|
+
}>>;
|
|
290
|
+
/** The latest items; `timelineCount` says how many there are in all. */
|
|
291
|
+
readonly timeline: Schema.$Array<Schema.Struct<{
|
|
292
|
+
readonly seq: Schema.Number;
|
|
293
|
+
readonly at: Schema.Number;
|
|
294
|
+
readonly who: Schema.String;
|
|
295
|
+
readonly what: Schema.String;
|
|
296
|
+
readonly tone: Schema.Literals<readonly ["orchestrator", "judgment", "judge", "running", "log", "tool", "done", "failed", "issue"]>;
|
|
297
|
+
}>>;
|
|
298
|
+
readonly timelineCount: Schema.Number;
|
|
299
|
+
/** The replay's wait before this frame, so the playhead moves as long. */
|
|
300
|
+
readonly gapMs: Schema.Number;
|
|
301
|
+
}>>>;
|
|
302
|
+
export declare const WebRunJson: Schema.fromJsonString<Schema.toCodecJson<Schema.Struct<{
|
|
303
|
+
readonly mode: Schema.Literals<readonly ["live", "replay"]>;
|
|
304
|
+
readonly runId: Schema.optional<Schema.String>;
|
|
305
|
+
readonly trace: Schema.String;
|
|
306
|
+
readonly speed: Schema.Number;
|
|
307
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
308
|
+
readonly seq: Schema.Number;
|
|
309
|
+
readonly at: Schema.Number;
|
|
310
|
+
}>>;
|
|
311
|
+
readonly lastSeq: Schema.optional<Schema.Number>;
|
|
312
|
+
readonly timeline: Schema.$Array<Schema.Struct<{
|
|
313
|
+
readonly seq: Schema.Number;
|
|
314
|
+
readonly at: Schema.Number;
|
|
315
|
+
readonly who: Schema.String;
|
|
316
|
+
readonly what: Schema.String;
|
|
317
|
+
readonly tone: Schema.Literals<readonly ["orchestrator", "judgment", "judge", "running", "log", "tool", "done", "failed", "issue"]>;
|
|
318
|
+
}>>;
|
|
319
|
+
}>>>;
|
|
320
|
+
//# sourceMappingURL=WebFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebFrame.d.ts","sourceRoot":"","sources":["../src/WebFrame.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC;;;;;;GAMG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,OAAO,sHAUlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,eAAO,MAAM,aAAa,+EAAuE,CAAA;AACjG,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAA;AAErD,eAAO,MAAM,eAAe;;;;;;EAM1B,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAEzD,uEAAuE;AACvE,eAAO,MAAM,UAAU;;;;;;;;;;;EASrB,CAAA;AACF,MAAM,MAAM,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;;;;;;;;IAGxE,0EAA0E;;IA0BG,CAAA;AAC/E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;IAAoD,CAAA"}
|
package/dist/WebFrame.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// @internal: the wire format of `llm4ts watch --web`, shared by its server and its page
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
/**
|
|
4
|
+
* What travels between `llm4ts watch --web` and its page (ADR 0051): the run
|
|
5
|
+
* the page first asks for, and the frames it draws. The server encodes
|
|
6
|
+
* through these schemas and the page decodes every response and every
|
|
7
|
+
* streamed frame through them. Browser-safe: this module imports only
|
|
8
|
+
* `effect/Schema`, so the page's bundle carries it.
|
|
9
|
+
*/
|
|
10
|
+
/** How a timeline item is coloured: the tree's styles, and the node states. */
|
|
11
|
+
export const WebTone = Schema.Literals([
|
|
12
|
+
"orchestrator",
|
|
13
|
+
"judgment",
|
|
14
|
+
"judge",
|
|
15
|
+
"running",
|
|
16
|
+
"log",
|
|
17
|
+
"tool",
|
|
18
|
+
"done",
|
|
19
|
+
"failed",
|
|
20
|
+
"issue"
|
|
21
|
+
]);
|
|
22
|
+
export const WebChipStatus = Schema.Literals(["planned", "running", "waiting", "done", "failed"]);
|
|
23
|
+
export const WebTimelineItem = Schema.Struct({
|
|
24
|
+
seq: Schema.Number,
|
|
25
|
+
at: Schema.Number,
|
|
26
|
+
who: Schema.String,
|
|
27
|
+
what: Schema.String,
|
|
28
|
+
tone: WebTone
|
|
29
|
+
});
|
|
30
|
+
/** A judge's verdict on a lane, with the trace seq that carried it. */
|
|
31
|
+
export const WebVerdict = Schema.Struct({
|
|
32
|
+
lane: Schema.String,
|
|
33
|
+
round: Schema.Number,
|
|
34
|
+
cleared: Schema.Boolean,
|
|
35
|
+
issues: Schema.Number,
|
|
36
|
+
dimensions: Schema.Array(Schema.Struct({ id: Schema.String, score: Schema.Number, max: Schema.Number })),
|
|
37
|
+
seq: Schema.Number
|
|
38
|
+
});
|
|
39
|
+
/** A task of a story's plan, in the story board's column (AgentTree `taskColumnOf`). */
|
|
40
|
+
export const WebTask = Schema.Struct({
|
|
41
|
+
index: Schema.Number,
|
|
42
|
+
title: Schema.String,
|
|
43
|
+
column: Schema.Literals(["todo", "doing", "done"])
|
|
44
|
+
});
|
|
45
|
+
export const WebStory = Schema.Struct({
|
|
46
|
+
id: Schema.String,
|
|
47
|
+
status: WebChipStatus,
|
|
48
|
+
executor: Schema.optional(Schema.String),
|
|
49
|
+
/** Who codes it, `codex#2`, once it has a lane. */
|
|
50
|
+
clone: Schema.optional(Schema.String),
|
|
51
|
+
stage: Schema.optional(Schema.String),
|
|
52
|
+
startedAt: Schema.optional(Schema.Number),
|
|
53
|
+
endedAt: Schema.optional(Schema.Number),
|
|
54
|
+
tokens: Schema.Number,
|
|
55
|
+
prompt: Schema.Number,
|
|
56
|
+
completion: Schema.Number,
|
|
57
|
+
model: Schema.optional(Schema.String),
|
|
58
|
+
merged: Schema.Boolean,
|
|
59
|
+
failStage: Schema.optional(Schema.String),
|
|
60
|
+
failMessage: Schema.optional(Schema.String),
|
|
61
|
+
tools: Schema.Array(Schema.String),
|
|
62
|
+
activity: Schema.optional(Schema.Struct({ text: Schema.String, since: Schema.Number })),
|
|
63
|
+
note: Schema.optional(Schema.String),
|
|
64
|
+
tasks: Schema.Array(WebTask)
|
|
65
|
+
});
|
|
66
|
+
export const WebExecutor = Schema.Struct({
|
|
67
|
+
name: Schema.String,
|
|
68
|
+
state: Schema.Literals(["busy", "idle", "out"]),
|
|
69
|
+
text: Schema.String,
|
|
70
|
+
/** Everything it holds now, as AgentTree `heldBy` lists it. */
|
|
71
|
+
leases: Schema.Array(Schema.String),
|
|
72
|
+
/** Why the roster left it out of the round, when it is out. */
|
|
73
|
+
reason: Schema.optional(Schema.String)
|
|
74
|
+
});
|
|
75
|
+
export const WebFrame = Schema.Struct({
|
|
76
|
+
/** Steps folded, of `steps`; a live frame has folded them all. */
|
|
77
|
+
count: Schema.Number,
|
|
78
|
+
steps: Schema.Number,
|
|
79
|
+
seq: Schema.optional(Schema.Number),
|
|
80
|
+
lastSeq: Schema.optional(Schema.Number),
|
|
81
|
+
startedAt: Schema.optional(Schema.Number),
|
|
82
|
+
now: Schema.optional(Schema.Number),
|
|
83
|
+
ended: Schema.optional(Schema.String),
|
|
84
|
+
title: Schema.String,
|
|
85
|
+
action: Schema.optional(Schema.String),
|
|
86
|
+
stage: Schema.String,
|
|
87
|
+
agents: Schema.String,
|
|
88
|
+
counts: Schema.Struct({
|
|
89
|
+
planned: Schema.Number,
|
|
90
|
+
running: Schema.Number,
|
|
91
|
+
waiting: Schema.Number,
|
|
92
|
+
done: Schema.Number,
|
|
93
|
+
failed: Schema.Number,
|
|
94
|
+
total: Schema.Number
|
|
95
|
+
}),
|
|
96
|
+
tokens: Schema.Number,
|
|
97
|
+
costUsd: Schema.Number,
|
|
98
|
+
stories: Schema.Array(WebStory),
|
|
99
|
+
/** The story the detail card follows until the reader picks one. */
|
|
100
|
+
focus: Schema.optional(Schema.String),
|
|
101
|
+
judge: Schema.Struct({
|
|
102
|
+
executor: Schema.optional(Schema.String),
|
|
103
|
+
state: Schema.Literals(["idle", "waiting", "running"]),
|
|
104
|
+
reviews: Schema.Number,
|
|
105
|
+
verdicts: Schema.Number,
|
|
106
|
+
borrowed: Schema.Number
|
|
107
|
+
}),
|
|
108
|
+
verdicts: Schema.Array(WebVerdict),
|
|
109
|
+
merged: Schema.Number,
|
|
110
|
+
roster: Schema.Array(WebExecutor),
|
|
111
|
+
/** The latest items; `timelineCount` says how many there are in all. */
|
|
112
|
+
timeline: Schema.Array(WebTimelineItem),
|
|
113
|
+
timelineCount: Schema.Number,
|
|
114
|
+
/** The replay's wait before this frame, so the playhead moves as long. */
|
|
115
|
+
gapMs: Schema.Number
|
|
116
|
+
});
|
|
117
|
+
/** A step of the trace, as the scrubber places it. */
|
|
118
|
+
export const WebRunStep = Schema.Struct({ seq: Schema.Number, at: Schema.Number });
|
|
119
|
+
/** The run as the page first sees it: its mode, its steps, its whole timeline for the scrubber. */
|
|
120
|
+
export const WebRun = Schema.Struct({
|
|
121
|
+
mode: Schema.Literals(["live", "replay"]),
|
|
122
|
+
runId: Schema.optional(Schema.String),
|
|
123
|
+
trace: Schema.String,
|
|
124
|
+
speed: Schema.Number,
|
|
125
|
+
steps: Schema.Array(WebRunStep),
|
|
126
|
+
lastSeq: Schema.optional(Schema.Number),
|
|
127
|
+
timeline: Schema.Array(WebTimelineItem)
|
|
128
|
+
});
|
|
129
|
+
/**
|
|
130
|
+
* The bodies on the wire: JSON text, an absent value written as `null`. The
|
|
131
|
+
* server's `schemaJson` responses and its server-sent frames use this
|
|
132
|
+
* codec, and the page decodes with it.
|
|
133
|
+
*/
|
|
134
|
+
export const WebFrameJson = Schema.fromJsonString(Schema.toCodecJson(WebFrame));
|
|
135
|
+
export const WebRunJson = Schema.fromJsonString(Schema.toCodecJson(WebRun));
|
|
136
|
+
//# sourceMappingURL=WebFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebFrame.js","sourceRoot":"","sources":["../src/WebFrame.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC;;;;;;GAMG;AAEH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC;IACrC,cAAc;IACd,UAAU;IACV,OAAO;IACP,SAAS;IACT,KAAK;IACL,MAAM;IACN,MAAM;IACN,QAAQ;IACR,OAAO;CACR,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAA;AAGjG,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,GAAG,EAAE,MAAM,CAAC,MAAM;IAClB,EAAE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AC,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAA;AAC/E,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
import * as HttpRouter from "effect/http/HttpRouter";
|
|
4
|
+
import * as HttpServer from "effect/http/HttpServer";
|
|
5
|
+
import type { ServeError } from "effect/http/HttpServerError";
|
|
6
|
+
import { type TraceSources, type WatchOptions, type WatchTargetMissing } from "./Watch.ts";
|
|
7
|
+
/**
|
|
8
|
+
* `llm4ts watch --web` (ADR 0051): the agent tree in a browser. The same
|
|
9
|
+
* trace `watch` reads, folded by the same `reduceTree`, served on loopback
|
|
10
|
+
* as a page and a stream of frames (server-sent events). A live run is
|
|
11
|
+
* re-read every `pollInterval`; a replay steps on `replayGap`, sped up as
|
|
12
|
+
* the page asks. The terminal `watch` is untouched: this runs only with
|
|
13
|
+
* `--web`.
|
|
14
|
+
*/
|
|
15
|
+
export type WebWatchOptions = Pick<WatchOptions, "repo" | "trace" | "epic" | "replay" | "speed" | "idleAfterMs"> & {
|
|
16
|
+
/** Loopback by default; the page shows the run to whoever can reach it. */
|
|
17
|
+
readonly host?: string;
|
|
18
|
+
/** A free port when omitted. */
|
|
19
|
+
readonly port?: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The page's files, under `packages/shell/web/`. `pnpm build` writes
|
|
23
|
+
* `app.js` (bundled from `web-src/`) and copies the Geist fonts and their
|
|
24
|
+
* licence into `fonts/` (scripts/build-web.mjs).
|
|
25
|
+
*/
|
|
26
|
+
export declare const webAssets: ReadonlyArray<{
|
|
27
|
+
readonly path: HttpRouter.PathInput;
|
|
28
|
+
readonly file: string;
|
|
29
|
+
readonly type: string;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* Everything the page loads comes from this server: its script, its
|
|
33
|
+
* stylesheet, its fonts, its frames. Nothing inline, nothing remote.
|
|
34
|
+
*/
|
|
35
|
+
export declare const contentSecurityPolicy = "default-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; object-src 'none'";
|
|
36
|
+
export interface WebWatchDependencies extends TraceSources {
|
|
37
|
+
readonly write: (text: string) => Effect.Effect<void>;
|
|
38
|
+
/** A page file's bytes. */
|
|
39
|
+
readonly asset: (file: string) => Uint8Array | undefined;
|
|
40
|
+
/** Completes when the reader detaches (Ctrl-C). */
|
|
41
|
+
readonly detach: Effect.Effect<void>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The `Host` values a request may carry: the loopback names of the port the
|
|
45
|
+
* server listens on. Anything else is refused, so a page on another origin
|
|
46
|
+
* cannot read the run by rebinding its own name to 127.0.0.1.
|
|
47
|
+
*/
|
|
48
|
+
export declare const allowedHosts: (port: number) => ReadonlySet<string>;
|
|
49
|
+
/**
|
|
50
|
+
* The routes: the page, `/api/run`, `/api/frame?count=` (a replay's scrub),
|
|
51
|
+
* and `/api/stream?count=&speed=` (a replay playing, or a live run followed),
|
|
52
|
+
* behind the `Host` guard. Needs the `HttpServer` it is served on, for the
|
|
53
|
+
* port the guard allows.
|
|
54
|
+
*/
|
|
55
|
+
export declare const webWatchApp: (options: WebWatchOptions, dependencies: WebWatchDependencies) => Effect.Effect<Layer.Layer<never, never, HttpServer.HttpServer | HttpRouter.HttpRouter>, import("@llm4ts/flow/FlowError").PersistenceError | import("@llm4ts/flow/FlowError").PlanParseError | import("@llm4ts/flow/FlowError").UnsupportedSchemaVersion | import("@llm4ts/flow/FlowError").WorkspacePathError | import("@llm4ts/flow/FlowError").WorkspaceLimitError | import("@llm4ts/flow/FlowError").WorkspaceIoError | import("@llm4ts/flow/FlowError").FlowAborted | import("@llm4ts/flow/FlowError").ProcessError | import("@llm4ts/flow/FlowError").FlowLlmError | import("@llm4ts/flow/FlowError").FlowCapabilityDenied | import("@llm4ts/flow/FlowError").ColumnNotFound | import("@llm4ts/flow/FlowError").BudgetExceeded | import("@llm4ts/flow/FlowError").StoryPlanInvalid | import("@llm4ts/flow/FlowError").PerimeterViolation | import("@llm4ts/flow/FlowError").MissingDependency | import("@llm4ts/flow/FlowError").MergeConflict | import("@llm4ts/flow/FlowError").EpicCheckoutDirty | import("@llm4ts/flow/FlowError").RosterInvalid | import("@llm4ts/flow/FlowError").EpicIncomplete | import("@llm4ts/flow/FlowError").LandingFailed | import("@llm4ts/flow/FlowError").RefineRefused | import("@llm4ts/flow/FlowError").RosterExhausted | import("@llm4ts/flow/FlowError").Stalled | import("@llm4ts/flow/FlowError").StoryFailed | import("@llm4ts/flow/FlowError").DecisionsInvalid | import("@llm4ts/flow/FlowError").OpenPointsPending | import("@llm4ts/flow/FlowError").ExtractPackMissing | import("@llm4ts/flow/FlowError").EpicBriefInvalid | import("@llm4ts/flow/FlowError").EpicBriefNotApproved | import("@llm4ts/flow/FlowError").ContractConflict | import("@llm4ts/flow/FlowError").PersonaInvalid | import("@llm4ts/flow/FlowError").MeetingInvalid | import("@llm4ts/flow/FlowError").TurnsInvalid | import("@llm4ts/flow/FlowError").AgendaPending | import("@llm4ts/flow/FlowError").PlanInvalid | import("@llm4ts/flow/FlowError").ReportInvalid | import("@llm4ts/flow/FlowError").PlanPending | WatchTargetMissing, never>;
|
|
56
|
+
/** Serves the page until the reader detaches; prints where to open it. */
|
|
57
|
+
export declare const runWebWatch: (options: WebWatchOptions, dependencies: WebWatchDependencies) => Effect.Effect<void, import("@llm4ts/flow/FlowError").PersistenceError | import("@llm4ts/flow/FlowError").PlanParseError | import("@llm4ts/flow/FlowError").UnsupportedSchemaVersion | import("@llm4ts/flow/FlowError").WorkspacePathError | import("@llm4ts/flow/FlowError").WorkspaceLimitError | import("@llm4ts/flow/FlowError").WorkspaceIoError | import("@llm4ts/flow/FlowError").FlowAborted | import("@llm4ts/flow/FlowError").ProcessError | import("@llm4ts/flow/FlowError").FlowLlmError | import("@llm4ts/flow/FlowError").FlowCapabilityDenied | import("@llm4ts/flow/FlowError").ColumnNotFound | import("@llm4ts/flow/FlowError").BudgetExceeded | import("@llm4ts/flow/FlowError").StoryPlanInvalid | import("@llm4ts/flow/FlowError").PerimeterViolation | import("@llm4ts/flow/FlowError").MissingDependency | import("@llm4ts/flow/FlowError").MergeConflict | import("@llm4ts/flow/FlowError").EpicCheckoutDirty | import("@llm4ts/flow/FlowError").RosterInvalid | import("@llm4ts/flow/FlowError").EpicIncomplete | import("@llm4ts/flow/FlowError").LandingFailed | import("@llm4ts/flow/FlowError").RefineRefused | import("@llm4ts/flow/FlowError").RosterExhausted | import("@llm4ts/flow/FlowError").Stalled | import("@llm4ts/flow/FlowError").StoryFailed | import("@llm4ts/flow/FlowError").DecisionsInvalid | import("@llm4ts/flow/FlowError").OpenPointsPending | import("@llm4ts/flow/FlowError").ExtractPackMissing | import("@llm4ts/flow/FlowError").EpicBriefInvalid | import("@llm4ts/flow/FlowError").EpicBriefNotApproved | import("@llm4ts/flow/FlowError").ContractConflict | import("@llm4ts/flow/FlowError").PersonaInvalid | import("@llm4ts/flow/FlowError").MeetingInvalid | import("@llm4ts/flow/FlowError").TurnsInvalid | import("@llm4ts/flow/FlowError").AgendaPending | import("@llm4ts/flow/FlowError").PlanInvalid | import("@llm4ts/flow/FlowError").ReportInvalid | import("@llm4ts/flow/FlowError").PlanPending | WatchTargetMissing | ServeError, never>;
|
|
58
|
+
/** A page file from `packages/shell/web/`, next to `src/` and `dist/` alike. */
|
|
59
|
+
export declare const nodeWebAsset: (file: string) => Uint8Array | undefined;
|
|
60
|
+
/** Ctrl-C (or a SIGTERM): the server stops instead of the process dying under it. */
|
|
61
|
+
export declare const nodeDetach: Effect.Effect<void>;
|
|
62
|
+
export declare const nodeWebWatchDependencies: (sources: TraceSources) => WebWatchDependencies;
|
|
63
|
+
//#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