@llm4ts/shell 4.1.0 → 4.3.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.
@@ -0,0 +1,283 @@
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
+ export declare const WebStory: Schema.Struct<{
37
+ readonly id: Schema.String;
38
+ readonly status: Schema.Literals<readonly ["planned", "running", "waiting", "done", "failed"]>;
39
+ readonly executor: Schema.optional<Schema.String>;
40
+ readonly stage: Schema.optional<Schema.String>;
41
+ readonly startedAt: Schema.optional<Schema.Number>;
42
+ readonly endedAt: Schema.optional<Schema.Number>;
43
+ readonly tokens: Schema.Number;
44
+ readonly prompt: Schema.Number;
45
+ readonly completion: Schema.Number;
46
+ readonly model: Schema.optional<Schema.String>;
47
+ readonly merged: Schema.Boolean;
48
+ readonly failStage: Schema.optional<Schema.String>;
49
+ readonly failMessage: Schema.optional<Schema.String>;
50
+ readonly tools: Schema.$Array<Schema.String>;
51
+ readonly activity: Schema.optional<Schema.Struct<{
52
+ readonly text: Schema.String;
53
+ readonly since: Schema.Number;
54
+ }>>;
55
+ readonly note: Schema.optional<Schema.String>;
56
+ readonly tasks: Schema.Number;
57
+ }>;
58
+ export type WebStory = typeof WebStory.Type;
59
+ export declare const WebExecutor: Schema.Struct<{
60
+ readonly name: Schema.String;
61
+ readonly state: Schema.Literals<readonly ["busy", "idle", "out"]>;
62
+ readonly text: Schema.String;
63
+ }>;
64
+ export type WebExecutor = typeof WebExecutor.Type;
65
+ export declare const WebFrame: Schema.Struct<{
66
+ /** Steps folded, of `steps`; a live frame has folded them all. */
67
+ readonly count: Schema.Number;
68
+ readonly steps: Schema.Number;
69
+ readonly seq: Schema.optional<Schema.Number>;
70
+ readonly lastSeq: Schema.optional<Schema.Number>;
71
+ readonly startedAt: Schema.optional<Schema.Number>;
72
+ readonly now: Schema.optional<Schema.Number>;
73
+ readonly ended: Schema.optional<Schema.String>;
74
+ readonly title: Schema.String;
75
+ readonly action: Schema.optional<Schema.String>;
76
+ readonly stage: Schema.String;
77
+ readonly agents: Schema.String;
78
+ readonly counts: Schema.Struct<{
79
+ readonly planned: Schema.Number;
80
+ readonly running: Schema.Number;
81
+ readonly waiting: Schema.Number;
82
+ readonly done: Schema.Number;
83
+ readonly failed: Schema.Number;
84
+ readonly total: Schema.Number;
85
+ }>;
86
+ readonly tokens: Schema.Number;
87
+ readonly costUsd: Schema.Number;
88
+ readonly stories: Schema.$Array<Schema.Struct<{
89
+ readonly id: Schema.String;
90
+ readonly status: Schema.Literals<readonly ["planned", "running", "waiting", "done", "failed"]>;
91
+ readonly executor: Schema.optional<Schema.String>;
92
+ readonly stage: Schema.optional<Schema.String>;
93
+ readonly startedAt: Schema.optional<Schema.Number>;
94
+ readonly endedAt: Schema.optional<Schema.Number>;
95
+ readonly tokens: Schema.Number;
96
+ readonly prompt: Schema.Number;
97
+ readonly completion: Schema.Number;
98
+ readonly model: Schema.optional<Schema.String>;
99
+ readonly merged: Schema.Boolean;
100
+ readonly failStage: Schema.optional<Schema.String>;
101
+ readonly failMessage: Schema.optional<Schema.String>;
102
+ readonly tools: Schema.$Array<Schema.String>;
103
+ readonly activity: Schema.optional<Schema.Struct<{
104
+ readonly text: Schema.String;
105
+ readonly since: Schema.Number;
106
+ }>>;
107
+ readonly note: Schema.optional<Schema.String>;
108
+ readonly tasks: Schema.Number;
109
+ }>>;
110
+ /** The story the detail card follows until the reader picks one. */
111
+ readonly focus: Schema.optional<Schema.String>;
112
+ readonly judge: Schema.Struct<{
113
+ readonly executor: Schema.optional<Schema.String>;
114
+ readonly state: Schema.Literals<readonly ["idle", "waiting", "running"]>;
115
+ readonly reviews: Schema.Number;
116
+ readonly verdicts: Schema.Number;
117
+ readonly borrowed: Schema.Number;
118
+ }>;
119
+ readonly verdicts: Schema.$Array<Schema.Struct<{
120
+ readonly lane: Schema.String;
121
+ readonly round: Schema.Number;
122
+ readonly cleared: Schema.Boolean;
123
+ readonly issues: Schema.Number;
124
+ readonly dimensions: Schema.$Array<Schema.Struct<{
125
+ readonly id: Schema.String;
126
+ readonly score: Schema.Number;
127
+ readonly max: Schema.Number;
128
+ }>>;
129
+ readonly seq: Schema.Number;
130
+ }>>;
131
+ readonly merged: Schema.Number;
132
+ readonly roster: Schema.$Array<Schema.Struct<{
133
+ readonly name: Schema.String;
134
+ readonly state: Schema.Literals<readonly ["busy", "idle", "out"]>;
135
+ readonly text: Schema.String;
136
+ }>>;
137
+ /** The latest items; `timelineCount` says how many there are in all. */
138
+ readonly timeline: Schema.$Array<Schema.Struct<{
139
+ readonly seq: Schema.Number;
140
+ readonly at: Schema.Number;
141
+ readonly who: Schema.String;
142
+ readonly what: Schema.String;
143
+ readonly tone: Schema.Literals<readonly ["orchestrator", "judgment", "judge", "running", "log", "tool", "done", "failed", "issue"]>;
144
+ }>>;
145
+ readonly timelineCount: Schema.Number;
146
+ /** The replay's wait before this frame, so the playhead moves as long. */
147
+ readonly gapMs: Schema.Number;
148
+ }>;
149
+ export type WebFrame = typeof WebFrame.Type;
150
+ /** A step of the trace, as the scrubber places it. */
151
+ export declare const WebRunStep: Schema.Struct<{
152
+ readonly seq: Schema.Number;
153
+ readonly at: Schema.Number;
154
+ }>;
155
+ export type WebRunStep = typeof WebRunStep.Type;
156
+ /** The run as the page first sees it: its mode, its steps, its whole timeline for the scrubber. */
157
+ export declare const WebRun: Schema.Struct<{
158
+ readonly mode: Schema.Literals<readonly ["live", "replay"]>;
159
+ readonly runId: Schema.optional<Schema.String>;
160
+ readonly trace: Schema.String;
161
+ readonly speed: Schema.Number;
162
+ readonly steps: Schema.$Array<Schema.Struct<{
163
+ readonly seq: Schema.Number;
164
+ readonly at: Schema.Number;
165
+ }>>;
166
+ readonly lastSeq: Schema.optional<Schema.Number>;
167
+ readonly timeline: Schema.$Array<Schema.Struct<{
168
+ readonly seq: Schema.Number;
169
+ readonly at: Schema.Number;
170
+ readonly who: Schema.String;
171
+ readonly what: Schema.String;
172
+ readonly tone: Schema.Literals<readonly ["orchestrator", "judgment", "judge", "running", "log", "tool", "done", "failed", "issue"]>;
173
+ }>>;
174
+ }>;
175
+ export type WebRun = typeof WebRun.Type;
176
+ /**
177
+ * The bodies on the wire: JSON text, an absent value written as `null`. The
178
+ * server's `schemaJson` responses and its server-sent frames use this
179
+ * codec, and the page decodes with it.
180
+ */
181
+ export declare const WebFrameJson: Schema.fromJsonString<Schema.toCodecJson<Schema.Struct<{
182
+ /** Steps folded, of `steps`; a live frame has folded them all. */
183
+ readonly count: Schema.Number;
184
+ readonly steps: Schema.Number;
185
+ readonly seq: Schema.optional<Schema.Number>;
186
+ readonly lastSeq: Schema.optional<Schema.Number>;
187
+ readonly startedAt: Schema.optional<Schema.Number>;
188
+ readonly now: Schema.optional<Schema.Number>;
189
+ readonly ended: Schema.optional<Schema.String>;
190
+ readonly title: Schema.String;
191
+ readonly action: Schema.optional<Schema.String>;
192
+ readonly stage: Schema.String;
193
+ readonly agents: Schema.String;
194
+ readonly counts: Schema.Struct<{
195
+ readonly planned: Schema.Number;
196
+ readonly running: Schema.Number;
197
+ readonly waiting: Schema.Number;
198
+ readonly done: Schema.Number;
199
+ readonly failed: Schema.Number;
200
+ readonly total: Schema.Number;
201
+ }>;
202
+ readonly tokens: Schema.Number;
203
+ readonly costUsd: Schema.Number;
204
+ readonly stories: Schema.$Array<Schema.Struct<{
205
+ readonly id: Schema.String;
206
+ readonly status: Schema.Literals<readonly ["planned", "running", "waiting", "done", "failed"]>;
207
+ readonly executor: Schema.optional<Schema.String>;
208
+ readonly stage: Schema.optional<Schema.String>;
209
+ readonly startedAt: Schema.optional<Schema.Number>;
210
+ readonly endedAt: Schema.optional<Schema.Number>;
211
+ readonly tokens: Schema.Number;
212
+ readonly prompt: Schema.Number;
213
+ readonly completion: Schema.Number;
214
+ readonly model: Schema.optional<Schema.String>;
215
+ readonly merged: Schema.Boolean;
216
+ readonly failStage: Schema.optional<Schema.String>;
217
+ readonly failMessage: Schema.optional<Schema.String>;
218
+ readonly tools: Schema.$Array<Schema.String>;
219
+ readonly activity: Schema.optional<Schema.Struct<{
220
+ readonly text: Schema.String;
221
+ readonly since: Schema.Number;
222
+ }>>;
223
+ readonly note: Schema.optional<Schema.String>;
224
+ readonly tasks: Schema.Number;
225
+ }>>;
226
+ /** The story the detail card follows until the reader picks one. */
227
+ readonly focus: Schema.optional<Schema.String>;
228
+ readonly judge: Schema.Struct<{
229
+ readonly executor: Schema.optional<Schema.String>;
230
+ readonly state: Schema.Literals<readonly ["idle", "waiting", "running"]>;
231
+ readonly reviews: Schema.Number;
232
+ readonly verdicts: Schema.Number;
233
+ readonly borrowed: Schema.Number;
234
+ }>;
235
+ readonly verdicts: Schema.$Array<Schema.Struct<{
236
+ readonly lane: Schema.String;
237
+ readonly round: Schema.Number;
238
+ readonly cleared: Schema.Boolean;
239
+ readonly issues: Schema.Number;
240
+ readonly dimensions: Schema.$Array<Schema.Struct<{
241
+ readonly id: Schema.String;
242
+ readonly score: Schema.Number;
243
+ readonly max: Schema.Number;
244
+ }>>;
245
+ readonly seq: Schema.Number;
246
+ }>>;
247
+ readonly merged: Schema.Number;
248
+ readonly roster: Schema.$Array<Schema.Struct<{
249
+ readonly name: Schema.String;
250
+ readonly state: Schema.Literals<readonly ["busy", "idle", "out"]>;
251
+ readonly text: Schema.String;
252
+ }>>;
253
+ /** The latest items; `timelineCount` says how many there are in all. */
254
+ readonly timeline: Schema.$Array<Schema.Struct<{
255
+ readonly seq: Schema.Number;
256
+ readonly at: Schema.Number;
257
+ readonly who: Schema.String;
258
+ readonly what: Schema.String;
259
+ readonly tone: Schema.Literals<readonly ["orchestrator", "judgment", "judge", "running", "log", "tool", "done", "failed", "issue"]>;
260
+ }>>;
261
+ readonly timelineCount: Schema.Number;
262
+ /** The replay's wait before this frame, so the playhead moves as long. */
263
+ readonly gapMs: Schema.Number;
264
+ }>>>;
265
+ export declare const WebRunJson: Schema.fromJsonString<Schema.toCodecJson<Schema.Struct<{
266
+ readonly mode: Schema.Literals<readonly ["live", "replay"]>;
267
+ readonly runId: Schema.optional<Schema.String>;
268
+ readonly trace: Schema.String;
269
+ readonly speed: Schema.Number;
270
+ readonly steps: Schema.$Array<Schema.Struct<{
271
+ readonly seq: Schema.Number;
272
+ readonly at: Schema.Number;
273
+ }>>;
274
+ readonly lastSeq: Schema.optional<Schema.Number>;
275
+ readonly timeline: Schema.$Array<Schema.Struct<{
276
+ readonly seq: Schema.Number;
277
+ readonly at: Schema.Number;
278
+ readonly who: Schema.String;
279
+ readonly what: Schema.String;
280
+ readonly tone: Schema.Literals<readonly ["orchestrator", "judgment", "judge", "running", "log", "tool", "done", "failed", "issue"]>;
281
+ }>>;
282
+ }>>>;
283
+ //# 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,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAE/C,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;EAkBnB,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAE3C,eAAO,MAAM,WAAW;;;;EAItB,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEjD,eAAO,MAAM,QAAQ;IACnB,kEAAkE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuBlE,oEAAoE;;;;;;;;;;;;;;;;;;;;;;;;;;;IAYpE,wEAAwE;;;;;;;;;IAGxE,0EAA0E;;EAE1E,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAE3C,sDAAsD;AACtD,eAAO,MAAM,UAAU;;;EAA2D,CAAA;AAClF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAE/C,mGAAmG;AACnG,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;EAQjB,CAAA;AACF,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC;;;;GAIG;AACH,eAAO,MAAM,YAAY;IAhEvB,kEAAkE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuBlE,oEAAoE;;;;;;;;;;;;;;;;;;;;;;;;;;;IAYpE,wEAAwE;;;;;;;;;IAGxE,0EAA0E;;IA0BG,CAAA;AAC/E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;IAAoD,CAAA"}
@@ -0,0 +1,124 @@
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
+ export const WebStory = Schema.Struct({
40
+ id: Schema.String,
41
+ status: WebChipStatus,
42
+ executor: Schema.optional(Schema.String),
43
+ stage: Schema.optional(Schema.String),
44
+ startedAt: Schema.optional(Schema.Number),
45
+ endedAt: Schema.optional(Schema.Number),
46
+ tokens: Schema.Number,
47
+ prompt: Schema.Number,
48
+ completion: Schema.Number,
49
+ model: Schema.optional(Schema.String),
50
+ merged: Schema.Boolean,
51
+ failStage: Schema.optional(Schema.String),
52
+ failMessage: Schema.optional(Schema.String),
53
+ tools: Schema.Array(Schema.String),
54
+ activity: Schema.optional(Schema.Struct({ text: Schema.String, since: Schema.Number })),
55
+ note: Schema.optional(Schema.String),
56
+ tasks: Schema.Number
57
+ });
58
+ export const WebExecutor = Schema.Struct({
59
+ name: Schema.String,
60
+ state: Schema.Literals(["busy", "idle", "out"]),
61
+ text: Schema.String
62
+ });
63
+ export const WebFrame = Schema.Struct({
64
+ /** Steps folded, of `steps`; a live frame has folded them all. */
65
+ count: Schema.Number,
66
+ steps: Schema.Number,
67
+ seq: Schema.optional(Schema.Number),
68
+ lastSeq: Schema.optional(Schema.Number),
69
+ startedAt: Schema.optional(Schema.Number),
70
+ now: Schema.optional(Schema.Number),
71
+ ended: Schema.optional(Schema.String),
72
+ title: Schema.String,
73
+ action: Schema.optional(Schema.String),
74
+ stage: Schema.String,
75
+ agents: Schema.String,
76
+ counts: Schema.Struct({
77
+ planned: Schema.Number,
78
+ running: Schema.Number,
79
+ waiting: Schema.Number,
80
+ done: Schema.Number,
81
+ failed: Schema.Number,
82
+ total: Schema.Number
83
+ }),
84
+ tokens: Schema.Number,
85
+ costUsd: Schema.Number,
86
+ stories: Schema.Array(WebStory),
87
+ /** The story the detail card follows until the reader picks one. */
88
+ focus: Schema.optional(Schema.String),
89
+ judge: Schema.Struct({
90
+ executor: Schema.optional(Schema.String),
91
+ state: Schema.Literals(["idle", "waiting", "running"]),
92
+ reviews: Schema.Number,
93
+ verdicts: Schema.Number,
94
+ borrowed: Schema.Number
95
+ }),
96
+ verdicts: Schema.Array(WebVerdict),
97
+ merged: Schema.Number,
98
+ roster: Schema.Array(WebExecutor),
99
+ /** The latest items; `timelineCount` says how many there are in all. */
100
+ timeline: Schema.Array(WebTimelineItem),
101
+ timelineCount: Schema.Number,
102
+ /** The replay's wait before this frame, so the playhead moves as long. */
103
+ gapMs: Schema.Number
104
+ });
105
+ /** A step of the trace, as the scrubber places it. */
106
+ export const WebRunStep = Schema.Struct({ seq: Schema.Number, at: Schema.Number });
107
+ /** The run as the page first sees it: its mode, its steps, its whole timeline for the scrubber. */
108
+ export const WebRun = Schema.Struct({
109
+ mode: Schema.Literals(["live", "replay"]),
110
+ runId: Schema.optional(Schema.String),
111
+ trace: Schema.String,
112
+ speed: Schema.Number,
113
+ steps: Schema.Array(WebRunStep),
114
+ lastSeq: Schema.optional(Schema.Number),
115
+ timeline: Schema.Array(WebTimelineItem)
116
+ });
117
+ /**
118
+ * The bodies on the wire: JSON text, an absent value written as `null`. The
119
+ * server's `schemaJson` responses and its server-sent frames use this
120
+ * codec, and the page decodes with it.
121
+ */
122
+ export const WebFrameJson = Schema.fromJsonString(Schema.toCodecJson(WebFrame));
123
+ export const WebRunJson = Schema.fromJsonString(Schema.toCodecJson(WebRun));
124
+ //# 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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"}
@@ -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
+ //# sourceMappingURL=WebWatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebWatch.d.ts","sourceRoot":"","sources":["../src/WebWatch.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAIrC,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAO7D,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,YAAY,EAEjB,KAAK,kBAAkB,EACxB,MAAM,YAAY,CAAA;AAWnB;;;;;;;GAOG;AAEH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,YAAY,EACZ,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CAC/D,GAAG;IACF,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,gC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