@vostride/agent-qa-dashboard 0.2.2 → 0.2.4
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/README.md +78 -0
- package/dist/{index-Ds4Lv4mT.d.cts → index-Cxygerok.d.cts} +16 -627
- package/dist/{index-Ds4Lv4mT.d.ts → index-Cxygerok.d.ts} +16 -627
- package/dist/index.cjs +337 -740
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -201
- package/dist/index.d.ts +7 -201
- package/dist/index.js +347 -743
- package/dist/index.js.map +1 -1
- package/dist/server/index.cjs +311 -573
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +321 -577
- package/dist/server/index.js.map +1 -1
- package/package.json +13 -13
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DashboardDatabase, E as ExecutionBackend, a as ExecuteOptions,
|
|
2
|
-
export {
|
|
1
|
+
import { D as DashboardDatabase, E as ExecutionBackend, a as ExecuteOptions, A as AgentHost, P as PostProcessingRelay, L as LiveEditorAttachment } from './index-Cxygerok.cjs';
|
|
2
|
+
export { b as AgentRegistryHandle, c as AppiumManager, C as ConfigFileInvalidError, d as ConfigManager, e as LIVE_EDITOR_SUPERSEDED_CLOSE_CODE, f as LIVE_EDITOR_UNKNOWN_SESSION_CLOSE_CODE, g as LiveEditorSubjects, M as MintLiveUrlInput, h as PostProcessingListener, R as RUN_SERVICE_ANALYSIS_TEMPLATE, i as RUN_SERVICE_ARTIFACT_TEMPLATE, j as RUN_SERVICE_DETAIL_TEMPLATE, k as RUN_SERVICE_EVENTS_TEMPLATE, l as RUN_SERVICE_EVIDENCE_TEMPLATE, m as RUN_SERVICE_LIVE_URL_TEMPLATE, n as RUN_SERVICE_MARKS_TEMPLATE, o as RUN_SERVICE_MARK_PREVIEW_TEMPLATE, p as RUN_SERVICE_OK_ROUTE, q as RUN_SERVICE_ROUTE_TABLE, r as RUN_SERVICE_START_ROUTE, s as ReplaceDocumentOutcome, t as ResumePoint, u as RunOwner, v as RunOwnerProbe, w as RunOwnerState, x as RunOwnership, y as RunOwnershipInput, z as RunRow, B as RunServicePorts, F as RunServiceRouteHandlerName, G as RunServiceRouteMatch, H as RunServiceRouteRow, I as RunServiceRouter, J as RunServiceStartInput, K as RunSettledDetails, N as RunSettledStatus, O as RunsDatabaseVersionRefusedError, T as TestFileInfo, Q as TestFileManager, S as TestValidationError, U as TestValidationResult, V as backstopServerError, W as classifyRunOwner, X as completeRunOwnership, Y as createLiveEditorSubjects, Z as createPostProcessingRelay, _ as createRouter, $ as createRunServiceRoutes, a0 as defaultRunOwnership, a1 as matchRunServiceRoute, a2 as orphanSummary, a3 as ownedElsewhere, a4 as ownsRunServicePath, a5 as readConfigValues, a6 as readJsonBody, a7 as refuseUnparseableRequest, a8 as serializeConfigWrite, a9 as startServer, aa as tryParseRequestUrl } from './index-Cxygerok.cjs';
|
|
3
3
|
import { RunAttributes } from '@vostride/agent-qa-core';
|
|
4
4
|
import { RunEventEnvelope, RunArtifactConfigSnapshot, ArtifactRecord, RunArtifactTestSourceSnapshot, RunArtifactSuiteSourceSnapshot, RunArtifactTestsSourceSnapshot, RunSession, PostProcessingStatus, PostProcessingDisposition, RunId, RunDetailRows, RunsArtifactResult, RunDetailProjection, RunsArtifactInput, LiveViewSubjectRef, LiveUrlVerdict, LiveUrlRefusalReason, LiveStreamDeclaration, LiveStreamKind, RunsMarkOutcome } from '@vostride/agent-qa-schema';
|
|
5
5
|
import { EventEmitter } from 'node:events';
|
|
@@ -45,53 +45,8 @@ interface RunRowIdentity {
|
|
|
45
45
|
declare function formatRunTitle(names: readonly string[]): string;
|
|
46
46
|
declare function runRowIdentity(members: readonly RunIdentityMember[]): RunRowIdentity;
|
|
47
47
|
|
|
48
|
-
/**
|
|
49
|
-
* `createDashboardRunIngest` — the dashboard's DB ingestion (RESEARCH Pitfall 1's
|
|
50
|
-
* "unnamed fifth consumer") rewired from the deleted `DashboardReporter` into a bus
|
|
51
|
-
* subscriber (Open Q-1 resolved as option (a): one envelope vocabulary, D-16 precedent).
|
|
52
|
-
*
|
|
53
|
-
* The bus deliberately does not carry the resolved config/source snapshots or the run's
|
|
54
|
-
* own id; those ride construction. Envelopes drive lifecycle/status.
|
|
55
|
-
* The `runs` + `run_artifacts` rows this writes stay shape-compatible with what
|
|
56
|
-
* `GET /api/runs/:id/artifact` and the queue read today — the spawn must survive
|
|
57
|
-
* until M5 (Pitfall 1's hard requirement). This module implements no Reporter
|
|
58
|
-
* interface — pure envelope consumption.
|
|
59
|
-
*
|
|
60
|
-
* NOTE: Plan 06 (363-06) relocated the `RunArtifact*` payload family from core to
|
|
61
|
-
* @vostride/agent-qa-schema (D-08); these imports now point at their canonical home.
|
|
62
|
-
*
|
|
63
|
-
* 2026-08-27 (Phase 405 plan 01, D-01/D-17/D-18): THE PROJECTION IS REBUILT ON THE BUS'S OWN
|
|
64
|
-
* SHAPE. Until this date every step landed in the v1 wide `steps` row through `insertStep`, which
|
|
65
|
-
* kept five of `StepFinalizedPayload`'s fields and dropped the rest — because the local `*Like`
|
|
66
|
-
* interfaces this module declared only named five. There was no `subActionRecorded` arm at all, so
|
|
67
|
-
* the sub-action timeline, the screenshots and the screen-state hashes reached no reader.
|
|
68
|
-
*
|
|
69
|
-
* What replaced them: the real schema payload types (so a field added to a payload is a compile
|
|
70
|
-
* error here rather than a silent drop), `run_members` per handle from `testStarted`/`testFinished`
|
|
71
|
-
* (D-18: a thin member whose stream begins with a terminal event still gets a row), `run_steps`
|
|
72
|
-
* carrying the WHOLE `stepFinalized` payload with `status` stored as the payload's own word, and
|
|
73
|
-
* `run_sub_actions` carrying the whole `subActionRecorded` payload with its nested objects
|
|
74
|
-
* stringified verbatim (no field is re-interpreted on the way in). The run row stores the verdict's
|
|
75
|
-
* own word too.
|
|
76
|
-
*
|
|
77
|
-
* `testRetryScheduled` now drops only THAT HANDLE's rows (D-17). It used to call the v1
|
|
78
|
-
* whole-run step delete, which wiped every step of the RUN — so in a suite, one member's
|
|
79
|
-
* abandoned attempt deleted the completed history of every member before it.
|
|
80
|
-
*
|
|
81
|
-
* THE NON-DARKENING `try {} catch {}` AROUND EVERY PROJECTION INSERT IS UNCHANGED and is
|
|
82
|
-
* load-bearing: a projection row that fails to write must never darken the `runs` row. A dropped
|
|
83
|
-
* step is visible as an absent step; a darkened run is a wrong verdict.
|
|
84
|
-
*
|
|
85
|
-
* 2026-08-28 (Phase 405 plan 13, D-21): phase 405 removed tables, columns, routes and fields from
|
|
86
|
-
* around this module and deliberately kept others. Check the repository history before restoring
|
|
87
|
-
* anything that looks missing here.
|
|
88
|
-
*/
|
|
89
48
|
type SourceSnapshot = RunArtifactTestSourceSnapshot | RunArtifactSuiteSourceSnapshot | RunArtifactTestsSourceSnapshot | ArtifactRecord;
|
|
90
49
|
type ConfigSnapshot = RunArtifactConfigSnapshot | ArtifactRecord;
|
|
91
|
-
/**
|
|
92
|
-
* A run's loaded test/suite and config snapshot, handed over by the producer that resolved them
|
|
93
|
-
* (433-29, G-433-5). It arrives out-of-band, like `finalize()`'s runtime: the bus carries no snapshots.
|
|
94
|
-
*/
|
|
95
50
|
interface DashboardRunIngestSnapshots {
|
|
96
51
|
config?: ConfigSnapshot;
|
|
97
52
|
source?: SourceSnapshot;
|
|
@@ -114,26 +69,12 @@ interface DashboardRunIngestDeps {
|
|
|
114
69
|
/**
|
|
115
70
|
* The post-run section the CLI closure supplies to `finalize()` — data the bus never carries,
|
|
116
71
|
* so it arrives out-of-band at flush.
|
|
117
|
-
*
|
|
118
|
-
* The v1 `memory` member is DELETED (407-05 · D-02). It was the last writer feeding the dead
|
|
119
|
-
* artifact-drawer memory tab, no producer in `packages/cli` or `packages/runner-local` has passed
|
|
120
|
-
* it since v1, and a field only a test could supply is a contract claiming a producer that does
|
|
121
|
-
* not exist. `runs.memory_log` has NO remaining production writer either (407-16 corrects 407-05's
|
|
122
|
-
* claim of a second writer): its insights reader is historical-only, reporting zeroes on every
|
|
123
|
-
* install created since, and its retirement belongs to the insights v1 sweep.
|
|
124
72
|
*/
|
|
125
73
|
interface DashboardRunIngestFinalizeExtra {
|
|
126
74
|
runtime?: ArtifactRecord;
|
|
127
75
|
}
|
|
128
76
|
interface DashboardRunIngest {
|
|
129
77
|
handler(envelope: RunEventEnvelope): void;
|
|
130
|
-
/**
|
|
131
|
-
* Stage a loaded snapshot onto this run's own artifact (433-29, F-433-15). A section is written
|
|
132
|
-
* only where it is absent or still the queue's `loadStatus: 'queued'` placeholder, so the first
|
|
133
|
-
* snapshot wins and a finalized artifact is never touched. A call before `runStarted` is held.
|
|
134
|
-
* A run of several members outside one suite instead files each snapshot under its member
|
|
135
|
-
* (444-03, D-07).
|
|
136
|
-
*/
|
|
137
78
|
stageSnapshots(input: DashboardRunIngestSnapshots): void;
|
|
138
79
|
finalize(extra?: DashboardRunIngestFinalizeExtra): Promise<void>;
|
|
139
80
|
}
|
|
@@ -149,58 +90,25 @@ interface InProcessRunStartInput {
|
|
|
149
90
|
* A run that is DENIED never calls this, and that asymmetry is load-bearing: it is the only way
|
|
150
91
|
* the backend can tell a policy refusal apart from a run that started and then failed.
|
|
151
92
|
*
|
|
152
|
-
* (Phrased without a quoted clause after the word `from`:
|
|
93
|
+
* (Phrased without a quoted clause after the word `from`: the arch lint's dependency scanner
|
|
153
94
|
* reads that shape as an import specifier and reported this comment as an undeclared external
|
|
154
95
|
* dependency of `packages/dashboard-server`.)
|
|
155
96
|
*/
|
|
156
97
|
readonly onSession: (session: RunSession) => void;
|
|
157
98
|
}
|
|
158
|
-
/**
|
|
159
|
-
* Start one run and resolve when it is over.
|
|
160
|
-
*
|
|
161
|
-
* REJECTION IS NOT "the run failed" — a failing run resolves. A rejection is a denial, a refused
|
|
162
|
-
* request field, an input error or a crash, and its message is what the dashboard shows as the
|
|
163
|
-
* failure summary. That is the whole user-visible win of the retirement: on the retiring wire a
|
|
164
|
-
* policy denial and a run that never started were the same nothing.
|
|
165
|
-
*/
|
|
166
99
|
type InProcessRunStarter = (input: InProcessRunStartInput) => Promise<void>;
|
|
167
100
|
interface InProcessExecutionBackendOptions {
|
|
168
|
-
/**
|
|
169
|
-
* How this backend actually starts a run.
|
|
170
|
-
*
|
|
171
|
-
* NAMED `invokeRun` AND NOT `startRun`, which is not a stylistic choice. `startRun` is the RUN
|
|
172
|
-
* SHELL's entry point in `@vostride/agent-qa-runner`, and `run-door-invocation-census.test.ts`
|
|
173
|
-
* makes a complete-set claim over the whole CLI package that no file acquires it — the one legal
|
|
174
|
-
* call site is inside the invocation core, one line below the one `evaluate()`. A second thing
|
|
175
|
-
* called `startRun`, in the CLI file that composes this option, REDS that census; and the census
|
|
176
|
-
* is right to red, because a second spelling of somebody else's symbol is exactly what it exists
|
|
177
|
-
* to refuse. `invokeRun` also says what this one does: it invokes the `runs.start` OP (D-10).
|
|
178
|
-
*/
|
|
179
101
|
readonly invokeRun: InProcessRunStarter;
|
|
180
|
-
/**
|
|
181
|
-
* The host's pre-enqueue check, forwarded as `preflight` (433-34, G-433-10). It runs the run
|
|
182
|
-
* core's production rule over the request; a rejection carrying `neutralReason` is a denial.
|
|
183
|
-
*/
|
|
184
|
-
readonly preflightRun?: (opts: PreflightOptions) => Promise<void>;
|
|
185
102
|
/** Applied when an `ExecuteOptions` carries no `timeout` of its own. */
|
|
186
103
|
readonly defaultTimeout?: number;
|
|
187
104
|
/** How long a settled run's handle survives before it is dropped. */
|
|
188
105
|
readonly retentionMs?: number;
|
|
189
106
|
}
|
|
190
|
-
/**
|
|
191
|
-
* The dashboard's in-process `ExecutionBackend`.
|
|
192
|
-
*
|
|
193
|
-
* A CLASS, matching the shape the interface already declared (`extends EventEmitter`), with a
|
|
194
|
-
* factory beside it so a composing host names a function rather than a constructor — nothing here
|
|
195
|
-
* is meant to be subclassed, and nothing needs the `resolveCliBin`-style static the retiring class
|
|
196
|
-
* carried for its binary.
|
|
197
|
-
*/
|
|
198
107
|
declare class InProcessExecutionBackend extends EventEmitter implements ExecutionBackend {
|
|
199
108
|
private readonly options;
|
|
200
109
|
private readonly handles;
|
|
201
110
|
private readonly retentionMs;
|
|
202
111
|
constructor(options: InProcessExecutionBackendOptions);
|
|
203
|
-
preflight(opts: PreflightOptions): Promise<void>;
|
|
204
112
|
execute(opts: ExecuteOptions): void;
|
|
205
113
|
kill(runId: string): boolean;
|
|
206
114
|
killAll(): void;
|
|
@@ -215,12 +123,6 @@ declare class InProcessExecutionBackend extends EventEmitter implements Executio
|
|
|
215
123
|
}
|
|
216
124
|
declare function createInProcessExecutionBackend(options: InProcessExecutionBackendOptions): InProcessExecutionBackend;
|
|
217
125
|
|
|
218
|
-
/**
|
|
219
|
-
* The comment-frame keepalive interval, matching every other SSE this package serves.
|
|
220
|
-
*
|
|
221
|
-
* EXPORTED so a cell can name the number rather than sleep past it, and so the client (404-07)
|
|
222
|
-
* can size its own liveness expectation off the server's constant instead of a second guess.
|
|
223
|
-
*/
|
|
224
126
|
declare const POST_PROCESSING_STREAM_HEARTBEAT_MS = 15000;
|
|
225
127
|
/** The last failure the record holds for one stage — the emitter's masked, bounded text, forwarded. */
|
|
226
128
|
interface PostProcessingStageFailure {
|
|
@@ -279,7 +181,7 @@ interface PostProcessingReadDeps {
|
|
|
279
181
|
/** The injected host. Its absence is the ROUTER'S 503, not this function's. */
|
|
280
182
|
readonly host: AgentHost;
|
|
281
183
|
}
|
|
282
|
-
/** `GET /api/runs/:id/post-processing` — what the page polls
|
|
184
|
+
/** `GET /api/runs/:id/post-processing` — what the page polls. */
|
|
283
185
|
declare function servePostProcessingRead(_req: IncomingMessage, res: ServerResponse, deps: PostProcessingReadDeps): void;
|
|
284
186
|
interface PostProcessingStreamDeps extends PostProcessingReadDeps {
|
|
285
187
|
/** The in-process chip sink this browser's frames come from. */
|
|
@@ -290,30 +192,6 @@ interface PostProcessingStreamDeps extends PostProcessingReadDeps {
|
|
|
290
192
|
delete(teardown: () => void): void;
|
|
291
193
|
};
|
|
292
194
|
}
|
|
293
|
-
/**
|
|
294
|
-
* `GET /api/runs/:id/post-processing/stream` — the DEDICATED live channel (D-16).
|
|
295
|
-
*
|
|
296
|
-
* THE ORDER IS THE CONTRACT, on `serveRunEventStream`'s own law: every refusal happens before
|
|
297
|
-
* `writeHead`, because a response that has already written `200 text/event-stream` cannot be told
|
|
298
|
-
* it failed. So the joined read runs FIRST — it is the snapshot's content and the open-time
|
|
299
|
-
* decision both — and only then does a head go out.
|
|
300
|
-
*
|
|
301
|
-
* THE 204 IS THE SSE SPEC'S NO-RECONNECT CLOSE, and it is the whole answer to Pitfall 6. An
|
|
302
|
-
* `EventSource` reconnects after ANY close except a 204, so a door that answered `200` with an
|
|
303
|
-
* immediate end to a run whose chain is over would be answering the same request every few seconds
|
|
304
|
-
* for as long as the tab is open. Three states get it:
|
|
305
|
-
*
|
|
306
|
-
* - the chain is already terminal — there is nothing left to relay, ever;
|
|
307
|
-
* - the run says `handedOff` — a lease-holder in ANOTHER process is draining it, and this
|
|
308
|
-
* process's emitter will therefore never publish a single envelope for it;
|
|
309
|
-
* - the run says `detached` — nothing is draining it in-process either.
|
|
310
|
-
*
|
|
311
|
-
* The last two are D-16's "closes immediately on hand-off / detach" and they are one decision with
|
|
312
|
-
* two words, because the fact that matters is identical: this relay cannot ever fire for that run,
|
|
313
|
-
* so the honest channel is the page's poll and holding a socket open would be a promise this
|
|
314
|
-
* process cannot keep. A snapshot with NO disposition at all is the opposite case — the run has not
|
|
315
|
-
* reached `runFinished` yet, which is exactly when a live channel is worth having — and it opens.
|
|
316
|
-
*/
|
|
317
195
|
declare function servePostProcessingStream(req: IncomingMessage, res: ServerResponse, deps: PostProcessingStreamDeps): void;
|
|
318
196
|
|
|
319
197
|
/**
|
|
@@ -329,17 +207,6 @@ interface DashboardRunDetailReader {
|
|
|
329
207
|
status: string;
|
|
330
208
|
} | undefined>;
|
|
331
209
|
}
|
|
332
|
-
/**
|
|
333
|
-
* Bind a reader to THIS server's one database handle.
|
|
334
|
-
*
|
|
335
|
-
* The read is synchronous underneath (better-sqlite3) and the method is `async` anyway, because
|
|
336
|
-
* the port's contract is a promise and a composition root that had to know which implementations
|
|
337
|
-
* were synchronous would be a composition root that knows too much.
|
|
338
|
-
*
|
|
339
|
-
* THE ID IS NEVER JOINED ONTO A PATH. It is a bound parameter of a prepared statement, resolved
|
|
340
|
-
* against rows the database already holds — the T-405-01 mitigation, and the same law
|
|
341
|
-
* `RunsReaderPort.get` states for the handoff store.
|
|
342
|
-
*/
|
|
343
210
|
declare function createDashboardRunDetailReader(db: DashboardDatabase): DashboardRunDetailReader;
|
|
344
211
|
|
|
345
212
|
/** A refusal, already carrying its status and its single-key body. */
|
|
@@ -352,28 +219,14 @@ type RunDetailReadOutcome = {
|
|
|
352
219
|
readonly kind: 'ok';
|
|
353
220
|
readonly body: RunDetailProjection;
|
|
354
221
|
} | RunDetailRefusal;
|
|
355
|
-
/**
|
|
356
|
-
* THE READ. Exported so a cell can measure the outcome without a socket, and so any second door
|
|
357
|
-
* (405-05's authed remote row) answers with byte-identical bytes by CALLING this rather than by a
|
|
358
|
-
* second spelling that agrees today.
|
|
359
|
-
*/
|
|
360
222
|
declare function readRunDetail(host: AgentHost, runId: string): Promise<RunDetailReadOutcome>;
|
|
361
223
|
interface RunDetailReadDeps {
|
|
362
224
|
/** The DECODED run id. Decoding can throw, and that throw is the caller's refusal to answer. */
|
|
363
225
|
readonly runId: string;
|
|
364
226
|
/** The injected host. Its absence is the ROUTER'S 503, not this function's. */
|
|
365
227
|
readonly host: AgentHost;
|
|
366
|
-
/**
|
|
367
|
-
* WHO IS ON THE OTHER END OF THIS SOCKET (405-10, D-09). Both doors serve the same body, masked
|
|
368
|
-
* at write, and nothing restores it (441 D-07); `'human'` only turns on the same-site guard.
|
|
369
|
-
*
|
|
370
|
-
* `'human'` IS PASSED BY THE LOCAL door's arms in `routes.ts`. The authed REMOTE door's
|
|
371
|
-
* `GET /run/:runId/detail` (`run-service-routes.ts`, 405-05) passes nothing, because it is
|
|
372
|
-
* legitimately reached at a non-loopback Host.
|
|
373
|
-
*/
|
|
374
|
-
readonly boundary?: 'human' | 'machine';
|
|
375
228
|
}
|
|
376
|
-
/** `GET /api/runs/:id/detail` — what the rebuilt run-detail page reads
|
|
229
|
+
/** `GET /api/runs/:id/detail` — what the rebuilt run-detail page reads. */
|
|
377
230
|
declare function serveRunDetailRead(req: IncomingMessage, res: ServerResponse, deps: RunDetailReadDeps): void;
|
|
378
231
|
type RunArtifactReadOutcome = {
|
|
379
232
|
readonly kind: 'ok';
|
|
@@ -400,28 +253,12 @@ interface RunArtifactReadDeps {
|
|
|
400
253
|
/** The injected host. Its absence is the ROUTER'S 503, not this function's. */
|
|
401
254
|
readonly host: AgentHost;
|
|
402
255
|
}
|
|
403
|
-
/**
|
|
404
|
-
* `GET /api/runs/:runId/artifacts/:sha` — a ref, resolved (D-12).
|
|
405
|
-
*
|
|
406
|
-
* THE HEADERS ARE THE FEATURE AS MUCH AS THE BYTES.
|
|
407
|
-
* - `ETag: "<sha>"` — the content address IS the validator; there is nothing else it could be, and
|
|
408
|
-
* nothing that could make it stale, because bytes cannot change under a hash of themselves.
|
|
409
|
-
* - `Cache-Control: public, max-age=31536000, immutable` — for the same reason. A revalidation of
|
|
410
|
-
* an immutable resource is a round trip that can only ever answer "yes, still".
|
|
411
|
-
* - `X-Content-Type-Options: nosniff` — the second half of the T-405-15 mitigation. The op refuses
|
|
412
|
-
* to NAME a type a browser executes; this refuses to let the browser guess one anyway.
|
|
413
|
-
* - `Content-Length` — from the op's own declared `byteLength` by way of the decoded buffer.
|
|
414
|
-
*
|
|
415
|
-
* `If-None-Match` IS HONOURED because it is three lines against a header set that promises a year
|
|
416
|
-
* of caching, and a client that revalidates anyway should not be made to re-download a screenshot.
|
|
417
|
-
*/
|
|
418
256
|
declare function serveRunArtifact(req: IncomingMessage, res: ServerResponse, deps: RunArtifactReadDeps): void;
|
|
419
257
|
|
|
420
258
|
/** Every value `[data-embed-state]` can take. */
|
|
421
259
|
type LiveEmbedState = 'connecting' | 'live' | 'no-stream' | 'expired' | 'refused' | 'stream-ended' | 'session-ended' | 'ended' | 'lost';
|
|
422
|
-
/** Every value `[data-embed-state]` can take. The 403-02 DOM cells range this list. */
|
|
423
260
|
declare const LIVE_EMBED_STATES: readonly ["connecting", "live", "no-stream", "expired", "refused", "stream-ended", "session-ended", "ended", "lost"];
|
|
424
|
-
/** Every fact the page reports to its host
|
|
261
|
+
/** Every fact the page reports to its host. */
|
|
425
262
|
type LiveEmbedReportEvent = 'ready' | 'frame' | 'ended' | 'refused' | 'lost';
|
|
426
263
|
declare const LIVE_EMBED_REPORT_EVENTS: readonly ["ready", "frame", "ended", "refused", "lost"];
|
|
427
264
|
/**
|
|
@@ -431,23 +268,8 @@ declare const LIVE_EMBED_REPORT_EVENTS: readonly ["ready", "frame", "ended", "re
|
|
|
431
268
|
declare const LIVE_EMBED_HOST_PARAM = "host";
|
|
432
269
|
/** At most one `frame` report per this many milliseconds; the report carries the newest frame. */
|
|
433
270
|
declare const LIVE_EMBED_REPORT_INTERVAL_MS = 500;
|
|
434
|
-
/**
|
|
435
|
-
* What an EXPIRED link says, exactly (D-02).
|
|
436
|
-
*
|
|
437
|
-
* Exported so the tracer cell and 403-02's DOM cells assert the SAME string the page renders — a
|
|
438
|
-
* literal spelled twice is a literal that can drift, and this one is the difference between a
|
|
439
|
-
* person seeing "your link timed out" and a person seeing nothing at all.
|
|
440
|
-
*/
|
|
441
271
|
declare const LIVE_EMBED_EXPIRED_MESSAGE = "link expired";
|
|
442
|
-
/**
|
|
443
|
-
* What a target that declared NO live stream says, exactly (D-08).
|
|
444
|
-
*
|
|
445
|
-
* This document owns no step list, and its host — the dashboard iframe today, the 408 MCP App
|
|
446
|
-
* later — is invisible to it, so the sentence claims nothing about where or whether steps are
|
|
447
|
-
* shown. Exported so the served bytes are pinned against the constant (frame-proxy cell 25).
|
|
448
|
-
*/
|
|
449
272
|
declare const LIVE_EMBED_NO_STREAM_MESSAGE = "no live preview for this target";
|
|
450
|
-
/** What an ended editor session says, exactly (428 D-07/D-09; frame-proxy cell 34). */
|
|
451
273
|
declare const LIVE_EMBED_SESSION_ENDED_MESSAGE = "session ended";
|
|
452
274
|
/**
|
|
453
275
|
* Render the page for one run.
|
|
@@ -466,13 +288,11 @@ interface FrameProxyDeps {
|
|
|
466
288
|
now: number;
|
|
467
289
|
}): LiveUrlVerdict;
|
|
468
290
|
attach(runId: string): RunSession | undefined;
|
|
469
|
-
/** 428 D-07: the editor-subject lookup. Absent means no editor subject is served on this socket. */
|
|
470
291
|
attachEditor?(sessionId: string): LiveEditorAttachment | undefined;
|
|
471
292
|
now?: () => number;
|
|
472
293
|
}
|
|
473
294
|
declare function createFrameProxy(deps: FrameProxyDeps): (ws: WebSocket, runId: string) => void;
|
|
474
295
|
|
|
475
|
-
/** The frame socket. A query carries the run id ONLY — never the token (D-04). */
|
|
476
296
|
declare const LIVE_VIEW_WS_PATH = "/api/live-view/ws";
|
|
477
297
|
/** The served embed page's prefix. Bare, so a host's `/api/` allowlist is not involved. */
|
|
478
298
|
declare const LIVE_EMBED_PATH_PREFIX = "/live/";
|
|
@@ -484,21 +304,8 @@ declare const LIVE_VIEW_SLOW_VIEWER_BYTES: number;
|
|
|
484
304
|
declare const LIVE_VIEW_PING_MS = 15000;
|
|
485
305
|
/** The close code every refusal uses. In the 4000-4999 application range. */
|
|
486
306
|
declare const LIVE_VIEW_REFUSAL_CLOSE_CODE = 4400;
|
|
487
|
-
/**
|
|
488
|
-
* Every reason this socket can refuse a viewer, BY NAME.
|
|
489
|
-
*
|
|
490
|
-
* The four token verdicts plus the three this layer alone can answer: a run this process never
|
|
491
|
-
* started, a handle that run does not have, and an editor session this process does not hold
|
|
492
|
-
* (428 D-07). Extending the token's list rather than restating it is what stops the two
|
|
493
|
-
* vocabularies from drifting.
|
|
494
|
-
*/
|
|
495
307
|
type LiveViewRefusalReason = LiveUrlRefusalReason | 'unknown_run' | 'unknown_handle' | 'unknown_session';
|
|
496
308
|
declare const LIVE_VIEW_REFUSAL_REASONS: readonly ["malformed", "bad_signature", "expired", "scope_mismatch", "unknown_run", "unknown_handle", "unknown_session"];
|
|
497
|
-
/**
|
|
498
|
-
* Every reason an `ended` message can carry, each naming a different fact (403 CR-03, 428 D-07/D-09).
|
|
499
|
-
* `runFinished`: the run is over. `handleFinished`: this member's stream is over while its run
|
|
500
|
-
* continues. `sessionEnded`: an editor session is over.
|
|
501
|
-
*/
|
|
502
309
|
type LiveViewEndReason = 'runFinished' | 'handleFinished' | 'sessionEnded';
|
|
503
310
|
declare const LIVE_VIEW_END_REASONS: readonly ["runFinished", "handleFinished", "sessionEnded"];
|
|
504
311
|
/** What the PAGE sends. `hello` must be first; `ack` and `renew` are valid only after `ready`. */
|
|
@@ -553,11 +360,10 @@ type RunMarkOutcome = {
|
|
|
553
360
|
* before anything is dispatched.
|
|
554
361
|
*/
|
|
555
362
|
declare function markRun(host: AgentHost, runId: string, body: unknown): Promise<RunMarkOutcome>;
|
|
556
|
-
/** POST /api/runs/:id/mark. Both doors answer the op's outcome as it is
|
|
363
|
+
/** POST /api/runs/:id/mark. Both doors answer the op's outcome as it is. */
|
|
557
364
|
declare function registerRunMarkRoute(req: IncomingMessage, res: ServerResponse, deps: {
|
|
558
365
|
readonly host: AgentHost;
|
|
559
366
|
readonly runId: string;
|
|
560
|
-
readonly boundary?: 'human' | 'machine';
|
|
561
367
|
}): void;
|
|
562
368
|
|
|
563
369
|
export { AgentHost, DashboardDatabase, type DashboardRunDetailReader, type DashboardRunIngest, type DashboardRunIngestDeps, type DashboardRunIngestFinalizeExtra, ExecuteOptions, ExecutionBackend, InProcessExecutionBackend, type InProcessExecutionBackendOptions, type InProcessRunStartInput, type InProcessRunStarter, type InProcessRunStatus, LIVE_EMBED_EXPIRED_MESSAGE, LIVE_EMBED_HOST_PARAM, LIVE_EMBED_NO_STREAM_MESSAGE, LIVE_EMBED_PATH_PREFIX, LIVE_EMBED_REPORT_EVENTS, LIVE_EMBED_REPORT_INTERVAL_MS, LIVE_EMBED_SESSION_ENDED_MESSAGE, LIVE_EMBED_STATES, LIVE_VIEW_END_REASONS, LIVE_VIEW_HELLO_MAX_BYTES, LIVE_VIEW_PING_MS, LIVE_VIEW_REFUSAL_CLOSE_CODE, LIVE_VIEW_REFUSAL_REASONS, LIVE_VIEW_SLOW_VIEWER_BYTES, LIVE_VIEW_WS_PATH, LiveEditorAttachment, type LiveEmbedReportEvent, type LiveEmbedState, type LiveViewClientMessage, type LiveViewRefusalReason, type LiveViewServerMessage, MIGRATIONS, POST_PROCESSING_STREAM_HEARTBEAT_MS, type PostProcessingReadBody, PostProcessingRelay, type PostProcessingStageFailure, type ResolveDashboardDbPathOptions, type RunArtifactReadOutcome, type RunDetailReadOutcome, type RunIdentityMember, type RunMarkOutcome, type RunRowIdentity, SCHEMA_VERSION, createDashboardRunDetailReader, createDashboardRunIngest, createFrameProxy, createInProcessExecutionBackend, createRunOwnerHostResolver, formatRunTitle, isPostProcessingTerminal, markRun, readPostProcessing, readRunArtifact, readRunDetail, registerRunMarkRoute, renderLiveEmbedPage, resolveDashboardDbPath, resolveRunOwnerHost, runRowIdentity, servePostProcessingRead, servePostProcessingStream, serveRunArtifact, serveRunDetailRead };
|