@itookit/dsht 0.5.1 → 0.6.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/README.i18n.yaml +2 -2
- package/README.md +10 -4
- package/README.zh.md +12 -6
- package/dist/catalog/controller.d.ts +26 -6
- package/dist/catalog/controller.js +73 -45
- package/dist/catalog/index.d.ts +1 -0
- package/dist/cli/dsht.js +22 -2
- package/dist/cli/startup.js +30 -11
- package/dist/cli/verifier.d.ts +4 -0
- package/dist/cli/verifier.js +28 -5
- package/dist/contracts.d.ts +42 -5
- package/dist/controller/connection-streams.d.ts +22 -0
- package/dist/controller/connection-streams.js +105 -0
- package/dist/controller/connection.d.ts +14 -3
- package/dist/controller/connection.js +40 -69
- package/dist/controller/controller.d.ts +20 -234
- package/dist/controller/controller.js +113 -811
- package/dist/controller/foreground.d.ts +44 -0
- package/dist/controller/foreground.js +79 -0
- package/dist/controller/loop-coordinator.d.ts +48 -0
- package/dist/controller/loop-coordinator.js +647 -0
- package/dist/controller/loop-prompts-schema.d.ts +16 -2
- package/dist/controller/loop-prompts-schema.js +106 -27
- package/dist/controller/loop-prompts.d.ts +17 -2
- package/dist/controller/loop-prompts.generated.js +2 -1
- package/dist/controller/loop-prompts.js +35 -9
- package/dist/controller/loop-protocols.d.ts +3 -1
- package/dist/controller/loop-protocols.js +8 -3
- package/dist/controller/loop-source.d.ts +74 -0
- package/dist/controller/loop-source.js +224 -0
- package/dist/controller/verifier.d.ts +4 -0
- package/dist/cost/controller.d.ts +3 -1
- package/dist/cost/controller.js +26 -7
- package/dist/cost/index.d.ts +1 -1
- package/dist/cost/index.js +1 -1
- package/dist/cost/ledger-files.d.ts +20 -0
- package/dist/cost/ledger-files.js +115 -15
- package/dist/cost/ledger.d.ts +31 -6
- package/dist/cost/ledger.js +74 -22
- package/dist/cost/pricing.d.ts +39 -0
- package/dist/cost/pricing.js +46 -0
- package/dist/cost/scanner.js +1 -0
- package/dist/cost/types.d.ts +9 -3
- package/dist/session/controller.d.ts +23 -35
- package/dist/session/controller.js +113 -363
- package/dist/session/history-reader.d.ts +32 -0
- package/dist/session/history-reader.js +170 -0
- package/dist/session/index.d.ts +1 -1
- package/dist/session/info.d.ts +3 -38
- package/dist/session/info.js +14 -1
- package/dist/session/interactions.d.ts +26 -0
- package/dist/session/interactions.js +75 -0
- package/dist/session/navigator.d.ts +47 -0
- package/dist/session/navigator.js +158 -0
- package/dist/session/prompt-backfill.d.ts +23 -0
- package/dist/session/prompt-backfill.js +88 -0
- package/dist/session/state.d.ts +20 -0
- package/dist/session/state.js +1 -0
- package/dist/session/telemetry.d.ts +15 -6
- package/dist/session/telemetry.js +44 -7
- package/dist/session/transcript.d.ts +5 -1
- package/dist/slash/index.d.ts +1 -1
- package/dist/slash/parse.d.ts +2 -126
- package/dist/slash/registry.d.ts +1 -1
- package/dist/slash/types.d.ts +126 -0
- package/dist/slash/types.js +1 -0
- package/dist/state.d.ts +5 -17
- package/dist/state.js +1 -1
- package/dist/storage/files.d.ts +8 -0
- package/dist/storage/files.js +18 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.js +1 -1
- package/dist/transport/client.d.ts +4 -3
- package/dist/transport/client.js +71 -25
- package/dist/ui/app.js +88 -301
- package/dist/ui/chat/shell-view.d.ts +2 -0
- package/dist/ui/chat/shell-view.js +8 -0
- package/dist/ui/chat/use-history-view.d.ts +69 -0
- package/dist/ui/chat/use-history-view.js +123 -0
- package/dist/ui/dialogs/cost.d.ts +6 -0
- package/dist/ui/dialogs/cost.js +5 -1
- package/dist/ui/dialogs/loop.d.ts +5 -4
- package/dist/ui/dialogs/loop.js +14 -6
- package/dist/ui/dialogs/use-panels.d.ts +53 -0
- package/dist/ui/dialogs/use-panels.js +51 -0
- package/dist/ui/input/use-composer.d.ts +35 -0
- package/dist/ui/input/use-composer.js +109 -0
- package/dist/ui/input/use-deferred-lines.d.ts +16 -0
- package/dist/ui/input/use-deferred-lines.js +54 -0
- package/dist/ui/input/use-history-recall.d.ts +20 -0
- package/dist/ui/input/use-history-recall.js +47 -0
- package/loop.yaml +230 -0
- package/package.json +5 -4
|
@@ -5,7 +5,7 @@ import { type HistoryLimits } from '../session/memory.ts';
|
|
|
5
5
|
import { type SessionRender } from '../session/history.ts';
|
|
6
6
|
import { SessionController } from '../session/controller.ts';
|
|
7
7
|
import { CatalogController } from '../catalog/controller.ts';
|
|
8
|
-
import type {
|
|
8
|
+
import type { TelemetryReader } from '../session/telemetry.ts';
|
|
9
9
|
import type { Transcript } from '../session/transcript.ts';
|
|
10
10
|
import type { CostLedger } from '../cost/ledger.ts';
|
|
11
11
|
import { CostController } from '../cost/controller.ts';
|
|
@@ -14,8 +14,8 @@ import { MemoryLog } from './memory-log.ts';
|
|
|
14
14
|
import { TraceLog } from './trace-log.ts';
|
|
15
15
|
import { PromptStore } from './prompts.ts';
|
|
16
16
|
import { type LoopLimits, type LoopProtocol } from './loop.ts';
|
|
17
|
-
import {
|
|
18
|
-
import type { ClientActivity, ForegroundKind, ForegroundSnapshot, LoopProgress, LoopRecord, OutputSource, PeekSnapshot } from '../contracts.ts';
|
|
17
|
+
import type { VerifierPort } from './verifier.ts';
|
|
18
|
+
import type { ClientActivity, ForegroundKind, ForegroundSnapshot, LoopProgress, LoopRecord, LoopSourceInfo, OutputSource, PeekSnapshot } from '../contracts.ts';
|
|
19
19
|
import { SessionPeek } from '../session/peek.ts';
|
|
20
20
|
import { type ControllerStore, type State } from '../state.ts';
|
|
21
21
|
import { ShellController } from '../shell/index.ts';
|
|
@@ -24,13 +24,13 @@ import type { SavedPrompt } from '../contracts.ts';
|
|
|
24
24
|
import type { FileReference } from '../session/references.ts';
|
|
25
25
|
import type { InteractionState, OptionState } from '../session/info.ts';
|
|
26
26
|
import type { Reasoning } from '../session/history.ts';
|
|
27
|
-
/** Mutating operations
|
|
27
|
+
/** Mutating operations: foreground work, local edits, and control cancellation with its own admission. */
|
|
28
28
|
export interface Actions {
|
|
29
29
|
/** Claim the single foreground slot for work the front end orchestrates itself (paging, loading).
|
|
30
30
|
*
|
|
31
31
|
* The controller owns the slot, the abort controller and the identity; the front end only supplies
|
|
32
32
|
* the work and renders `queries.foreground`. Returns undefined when the client is busy with another
|
|
33
|
-
* operation or
|
|
33
|
+
* operation or the client has stopped. Admitted work keeps its result/error on cancellation.
|
|
34
34
|
*/
|
|
35
35
|
foreground<T>(kind: ForegroundKind, label: string, work: (signal: AbortSignal) => Promise<T>, wait?: boolean): Promise<T | undefined>;
|
|
36
36
|
/** Cancel the operation that owns the slot; false when none is running. */
|
|
@@ -80,6 +80,7 @@ export interface Actions {
|
|
|
80
80
|
/** Repeated keys share one cancellation; it reports exit eligibility itself. */
|
|
81
81
|
interrupt(force?: boolean): Promise<boolean>;
|
|
82
82
|
older(signal?: AbortSignal, transcript?: Transcript): Promise<boolean>;
|
|
83
|
+
openHistory(target: number, signal: AbortSignal): Promise<boolean>;
|
|
83
84
|
historyThrough(target: number | 'first', signal: AbortSignal): Promise<boolean>;
|
|
84
85
|
removeQueued(itemId: string): Promise<boolean>;
|
|
85
86
|
/** Local shortcut prompts: no connection and no busy envelope, since they never reach the host. */
|
|
@@ -100,7 +101,7 @@ export interface Actions {
|
|
|
100
101
|
pickWorkspace(workspaceId?: string): void;
|
|
101
102
|
/** Leave a picker and return to the selected conversation; false when none is selected. */
|
|
102
103
|
showChat(): boolean;
|
|
103
|
-
|
|
104
|
+
showLatest(): void;
|
|
104
105
|
pinHistory(pinned: boolean): void;
|
|
105
106
|
setAnswers(answers: Record<string, AnswerValue['answers']>): void;
|
|
106
107
|
setOption(option?: OptionState): void;
|
|
@@ -128,7 +129,7 @@ export interface Queries {
|
|
|
128
129
|
readonly record: Transcript;
|
|
129
130
|
readonly window: Transcript | undefined;
|
|
130
131
|
readonly interaction: InteractionState;
|
|
131
|
-
readonly telemetry:
|
|
132
|
+
readonly telemetry: TelemetryReader;
|
|
132
133
|
readonly recallAtOldest: boolean;
|
|
133
134
|
readonly recallLength: number;
|
|
134
135
|
readonly recallHasOlder: boolean;
|
|
@@ -146,12 +147,13 @@ export interface Queries {
|
|
|
146
147
|
readonly peek: PeekSnapshot | undefined;
|
|
147
148
|
/** Every `loop.yaml` record, so the picker can offer names and their defaults without a lookup. */
|
|
148
149
|
readonly loopRecords: readonly LoopRecord[];
|
|
150
|
+
/** Where those records came from, so the picker can say which file supplied or replaced them. */
|
|
151
|
+
readonly loopSource: LoopSourceInfo;
|
|
149
152
|
/** Why the saved prompts could not be read, when the file was malformed. */
|
|
150
153
|
readonly promptsError: string | undefined;
|
|
151
154
|
pendingCounts(): ReadonlyMap<string, number>;
|
|
152
155
|
recall(direction: -1 | 1, current: string): string;
|
|
153
156
|
references(query: string, signal: AbortSignal): Promise<FileReference[]>;
|
|
154
|
-
historyAt(target: number, signal: AbortSignal): Promise<Transcript>;
|
|
155
157
|
/** Plain rows and offsets for one laid-out record. */
|
|
156
158
|
render(input: {
|
|
157
159
|
transcript: Transcript;
|
|
@@ -221,50 +223,12 @@ export declare class Controller implements ControllerStore, ConnectionListener {
|
|
|
221
223
|
readonly trace: TraceLog | undefined;
|
|
222
224
|
/** Shortcut prompts the operator saved; in memory for this run when no path was supplied. */
|
|
223
225
|
readonly promptStore: PromptStore;
|
|
224
|
-
/** Running agent loop, if any; the loop lives here, not in the UI. */
|
|
225
|
-
private loop?;
|
|
226
|
-
/** Prompt the loop still has to send, when it could not be sent immediately. */
|
|
227
|
-
private loopPrompt?;
|
|
228
226
|
/** Finished turns of the selected session, so a waiter never has to sample a cached flag. */
|
|
229
227
|
private completedTurns;
|
|
230
228
|
/** Sessions the host reported busy, so a lone idle frame cannot claim a finished turn. */
|
|
231
229
|
private readonly busySessions;
|
|
232
|
-
/**
|
|
233
|
-
private
|
|
234
|
-
/** Timer that settles an attempt whose reply never commits its result block. */
|
|
235
|
-
private loopSettleTimer?;
|
|
236
|
-
/** Whether an attempt is currently being judged by an independent verifier. */
|
|
237
|
-
private loopVerifying;
|
|
238
|
-
/** A verdict is being consumed right now.
|
|
239
|
-
*
|
|
240
|
-
* Consuming one reads the artifact, so it is asynchronous; without this gate a replayed idle edge
|
|
241
|
-
* could start a second verification of an attempt whose verdict is already being applied.
|
|
242
|
-
*/
|
|
243
|
-
private loopSettling;
|
|
244
|
-
/** Cancels that verification when the loop is stopped or replaced. */
|
|
245
|
-
private loopVerifyAbort?;
|
|
246
|
-
/** Verdict of the previous attempt on the current step, for the retry and the next verifier. */
|
|
247
|
-
private loopPrevious?;
|
|
248
|
-
/** Identity of the run in flight, so its verdicts are isolated from every other run's. */
|
|
249
|
-
private loopRunId?;
|
|
250
|
-
/** Whether the run in flight already wrote its `loop end`; one end per begin (I9). */
|
|
251
|
-
private loopEndTraced;
|
|
252
|
-
/** Sequence of the verification task in flight, so a retry never reuses the old task's identity. */
|
|
253
|
-
private loopVerifySeq;
|
|
254
|
-
/** Identity of the verification task whose result may still decide the attempt in flight. */
|
|
255
|
-
private loopVerifyIdentity?;
|
|
256
|
-
/** Timer that stops the whole run when its budget expires. */
|
|
257
|
-
private loopDeadlineTimer?;
|
|
258
|
-
/** Whole-run budget, when the operator set one. */
|
|
259
|
-
private readonly deadlineMs?;
|
|
260
|
-
/** Consecutive verifier outages in this attempt, so a broken verifier is retried then reported. */
|
|
261
|
-
private loopVerifierMisses;
|
|
262
|
-
/** What the operator answered when a verifier abstained; consumed by the next judgment. */
|
|
263
|
-
private loopAnswer?;
|
|
264
|
-
/** Whether a reply block may stand in for a missing verdict; off unless asked for. */
|
|
265
|
-
private readonly allowSelfFallback;
|
|
266
|
-
/** Client-side directory verdict files are written under. */
|
|
267
|
-
private readonly verdictRoot;
|
|
230
|
+
/** Loop execution owns all verifier, settling and deadline state. */
|
|
231
|
+
private readonly loops;
|
|
268
232
|
/** Local `!` commands, run on this machine and shown inline in the transcript. */
|
|
269
233
|
readonly shell: ShellController;
|
|
270
234
|
/** Mutating surface the UI drives. */
|
|
@@ -281,26 +245,17 @@ export declare class Controller implements ControllerStore, ConnectionListener {
|
|
|
281
245
|
readonly memoryLogPath: string | undefined;
|
|
282
246
|
/** Directory this client runs in. */
|
|
283
247
|
readonly localDirectory: string;
|
|
284
|
-
/** Independent verifier for scored rounds, when one was supplied. */
|
|
285
|
-
private readonly verifier;
|
|
286
248
|
/** Session opened at startup, when one was named. */
|
|
287
249
|
private readonly initialSession;
|
|
288
250
|
private readonly observers;
|
|
289
251
|
private selector;
|
|
290
252
|
private connectionSettled;
|
|
253
|
+
/** Startup defaults apply once; subsequent generations restore the operator's selection. */
|
|
254
|
+
private initialized;
|
|
291
255
|
/** Counter behind `commandId`, so every executed line has one identifier in begin and end. */
|
|
292
256
|
private commandSeq;
|
|
293
|
-
/**
|
|
294
|
-
private
|
|
295
|
-
/** Callers waiting for the slot, oldest first; woken one at a time so nobody barges in. */
|
|
296
|
-
private readonly foregroundWaiters;
|
|
297
|
-
/** True while a waiter has been promised the slot but has not taken it yet. */
|
|
298
|
-
private foregroundGranted;
|
|
299
|
-
/** Set when the client stops, so a waiter never starts work on a closed connection. */
|
|
300
|
-
private foregroundClosed;
|
|
301
|
-
private foregroundSeq;
|
|
302
|
-
/** Which operation the current async continuation belongs to, so a nested call never re-claims. */
|
|
303
|
-
private readonly foregroundOwner;
|
|
257
|
+
/** Scheduling and cancellation are owned independently of domain operations. */
|
|
258
|
+
private readonly foregroundSlot;
|
|
304
259
|
/** Read-only follower for the full-screen view; it borrows the connection and never selects. */
|
|
305
260
|
readonly peek: SessionPeek;
|
|
306
261
|
/** Sources this client created, keyed by session id; the host cannot record that lineage itself. */
|
|
@@ -384,39 +339,11 @@ export declare class Controller implements ControllerStore, ConnectionListener {
|
|
|
384
339
|
private runAction;
|
|
385
340
|
/** Same slot, for an operation that produces a value the caller needs. */
|
|
386
341
|
private runActionValue;
|
|
387
|
-
/**
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
* calling an action) belongs to that operation: refusing it for being busy would deadlock the very
|
|
391
|
-
* work that owns the slot. An async-local owner answers that exactly, where a plain flag could not
|
|
392
|
-
* tell a nested call from a second, unrelated one.
|
|
393
|
-
* @returns True when this call runs inside the operation that owns the slot.
|
|
394
|
-
*/
|
|
395
|
-
private ownsForeground;
|
|
396
|
-
/** Run one operation in the foreground slot, claiming it when the caller does not already own it.
|
|
397
|
-
*
|
|
398
|
-
* The slot serializes what the operator is doing — one thing at a time — which is a different
|
|
399
|
-
* question from the session write order (§6.3): a read takes this slot too. The controller owns the
|
|
400
|
-
* slot, the abort controller and the identity, so the front end only renders `queries.foreground`
|
|
401
|
-
* and cancels it in one call.
|
|
402
|
-
* @param kind - What the operation is.
|
|
403
|
-
* @param label - Human label shown while it runs.
|
|
404
|
-
* @param work - The work, handed the signal that `cancelForeground` aborts.
|
|
405
|
-
* @returns What the work returned, or undefined when the slot was taken or the work was cancelled.
|
|
342
|
+
/** Run outside the foreground slot, with the same application failure reporting.
|
|
343
|
+
* Local prompt edits need no connection; verifier cancellation uses the session control lane and
|
|
344
|
+
* must reach the host even while the foreground is busy or closed for shutdown.
|
|
406
345
|
*/
|
|
407
|
-
private
|
|
408
|
-
/** Cancel the operation that owns the foreground slot; false when none is running.
|
|
409
|
-
* @returns Whether an operation was there to cancel.
|
|
410
|
-
*/
|
|
411
|
-
private cancelForeground;
|
|
412
|
-
/** Run one local operation that needs no connection, reporting failure the way `runAction` does.
|
|
413
|
-
*
|
|
414
|
-
* Shortcut prompts are the operator's own file, so they must keep working while the host is
|
|
415
|
-
* disconnected; only the failure line is shared with the remote operations.
|
|
416
|
-
* @param operation - Operation to run against local storage.
|
|
417
|
-
* @returns Whether it ran to completion.
|
|
418
|
-
*/
|
|
419
|
-
private runLocalAction;
|
|
346
|
+
private runImmediateAction;
|
|
420
347
|
/** Read the counters one memory sample records; content never leaves as text.
|
|
421
348
|
*
|
|
422
349
|
* The retained transcript and the ledger are small in practice, so a sample also reads the two
|
|
@@ -494,14 +421,6 @@ export declare class Controller implements ControllerStore, ConnectionListener {
|
|
|
494
421
|
private pendingCounts;
|
|
495
422
|
/** Load the optional preset roster once per connection. */
|
|
496
423
|
private loadPresetNames;
|
|
497
|
-
/** @returns Host model routes and adapter-owned reasoning choices. */
|
|
498
|
-
private modelCatalog;
|
|
499
|
-
/** Select the next request's model.
|
|
500
|
-
* @param provider - Host provider route ID.
|
|
501
|
-
* @param model - Exact model ID.
|
|
502
|
-
* @param reasoningEffort - Optional adapter-owned effort ID.
|
|
503
|
-
*/
|
|
504
|
-
private selectModel;
|
|
505
424
|
/** Stop the selected turn, or allow exit only while idle.
|
|
506
425
|
* @param force - Send an explicit cancellation even when the cached running flag is idle.
|
|
507
426
|
* @returns True when the caller may exit.
|
|
@@ -517,7 +436,6 @@ export declare class Controller implements ControllerStore, ConnectionListener {
|
|
|
517
436
|
/** Show a detached history window, releasing the one it replaces.
|
|
518
437
|
* @param window - Record to display, or undefined to return to the live transcript.
|
|
519
438
|
*/
|
|
520
|
-
private setViewWindow;
|
|
521
439
|
/** Recall one step through the selected session's prompt index; never touches the network.
|
|
522
440
|
* @param direction - Negative for older input, positive for newer input.
|
|
523
441
|
* @param current - Composer content before recall began, restored at the newest position.
|
|
@@ -660,132 +578,6 @@ export declare class Controller implements ControllerStore, ConnectionListener {
|
|
|
660
578
|
* agent and starts an idle one, exactly like submitted text.
|
|
661
579
|
*/
|
|
662
580
|
private handoff;
|
|
663
|
-
/** Start a scored loop and send its opening step.
|
|
664
|
-
* @param protocol - Prompt text and step count the loop follows.
|
|
665
|
-
* @param limits - Resolved `--from/--to/--score/--tries`.
|
|
666
|
-
*/
|
|
667
|
-
private startLoop;
|
|
668
|
-
/** End a run whose next prompt could not be sent, keeping the reason visible.
|
|
669
|
-
*
|
|
670
|
-
* A rejected send is not a verdict and not an operator cancellation, so the phase is `needs-human`
|
|
671
|
-
* and `terminalReason` says why — this is what keeps `phase=cancelled` meaning "a person stopped it".
|
|
672
|
-
* @param loop - Run that could not send.
|
|
673
|
-
* @param error - What the host or the session layer rejected with.
|
|
674
|
-
*/
|
|
675
|
-
private rejectLoopSend;
|
|
676
|
-
/** Record the end of one run once, with the phase it stopped in and why.
|
|
677
|
-
*
|
|
678
|
-
* I9 needs every `begin` to be paired inside the trace window; this is the only writer of `loop end`.
|
|
679
|
-
* @param loop - Run whose terminal phase was just published.
|
|
680
|
-
*/
|
|
681
|
-
private traceLoopEnd;
|
|
682
|
-
/** Whether a step begins with verification rather than with a work prompt.
|
|
683
|
-
*
|
|
684
|
-
* Needs all three: the record asks for it, the record has a verifier prompt, and this client was
|
|
685
|
-
* given a verifier. Otherwise there is nobody to verify first, and the step asks for work.
|
|
686
|
-
* @param loop - Loop about to start a step.
|
|
687
|
-
* @returns True when the step starts by verifying.
|
|
688
|
-
*/
|
|
689
|
-
private startsByVerifying;
|
|
690
|
-
/** Verify the step in flight without a work turn before it.
|
|
691
|
-
*
|
|
692
|
-
* The activity is set inside `verifyRound`, so the first verification, a work-turn verdict and a
|
|
693
|
-
* retry all publish the same state without this caller having to remember it.
|
|
694
|
-
* @param loop - Loop whose step and attempt are already set.
|
|
695
|
-
*/
|
|
696
|
-
private verifyStep;
|
|
697
|
-
/** Check the round's own section before spending a verifier on it, then verify or ask for work.
|
|
698
|
-
*
|
|
699
|
-
* Verify-first exists so a round that already passes costs no work turn. When the section is not in
|
|
700
|
-
* the artifact at all the round *cannot* pass, and this client can read that itself — the same check
|
|
701
|
-
* it applies to a verdict before accepting one. Sending a verifier to discover "the file is missing"
|
|
702
|
-
* costs a session and, because a failed attempt consumes one, also the round's first attempt: a run
|
|
703
|
-
* over a document with no review yet would start working at attempt 2/10. An artifact this client
|
|
704
|
-
* cannot read stays a boundary: the verification runs and its verdict decides, as before.
|
|
705
|
-
* @param loop - Loop whose step and attempt are already set.
|
|
706
|
-
*/
|
|
707
|
-
private verifySection;
|
|
708
|
-
/** Whether the directory this client runs in is readable here at all.
|
|
709
|
-
*
|
|
710
|
-
* `readText` answers undefined for a missing file and for a file inside a directory this machine does
|
|
711
|
-
* not have, and the two mean opposite things: the first is a producer that wrote nothing, the second
|
|
712
|
-
* is a workspace whose verdict cannot be checked from here.
|
|
713
|
-
* @returns True when the directory can be listed.
|
|
714
|
-
*/
|
|
715
|
-
private workspaceVisible;
|
|
716
|
-
/** Arm the whole-run budget, when the operator set one. */
|
|
717
|
-
private armLoopDeadline;
|
|
718
|
-
/** Answer a paused run, so the current artifact is judged again with what the operator supplied.
|
|
719
|
-
*
|
|
720
|
-
* The answer is not a work order: it only adds a condition to the judgment, so nothing is sent to the
|
|
721
|
-
* agent and no attempt is consumed. The verification that follows is a new task with a new identity,
|
|
722
|
-
* which is what keeps a late verdict from the paused one from deciding the attempt.
|
|
723
|
-
* @param text - What the operator added; never written to the trace.
|
|
724
|
-
*/
|
|
725
|
-
private answerLoop;
|
|
726
|
-
/** Stop a running review; the terminal progress stays visible for the reader.
|
|
727
|
-
* @param reason - Why it stopped; the default is an operator action.
|
|
728
|
-
*/
|
|
729
|
-
private stopLoop;
|
|
730
|
-
/** Drop a finished run's progress line, keeping an active one.
|
|
731
|
-
*
|
|
732
|
-
* D3 keeps a terminal result on screen because it is what the reader most needs to see — but it is a
|
|
733
|
-
* result, not a status: the next line the operator runs means they have read it. An active run is
|
|
734
|
-
* left alone, so `/loop answer` and `/loop stop` keep the target they were typed for.
|
|
735
|
-
*/
|
|
736
|
-
private clearLoopResult;
|
|
737
|
-
/** Drop the loop entirely, without publishing a cancelled phase.
|
|
738
|
-
* @param reason - Why it was dropped, recorded when it never reached a terminal phase itself.
|
|
739
|
-
*/
|
|
740
|
-
private forgetLoop;
|
|
741
|
-
/** Note that an attempt's turn ended; its block may still be arriving.
|
|
742
|
-
* @param sessionId - Session the host reported idle.
|
|
743
|
-
*/
|
|
744
|
-
private settleLoop;
|
|
745
|
-
/** Consume the attempt once its result block is committed, or the grace period expires.
|
|
746
|
-
*
|
|
747
|
-
* The final assistant message can land a moment after the idle event, so an empty parse is not yet
|
|
748
|
-
* a failed attempt: the next publish retries, and one timer covers a transcript that never grows.
|
|
749
|
-
*/
|
|
750
|
-
private trySettleLoop;
|
|
751
|
-
/** Score one finished round out of band, in a process of its own.
|
|
752
|
-
*
|
|
753
|
-
* The child writes its verdict to a file, so a slow or failed verifier delays the attempt instead
|
|
754
|
-
* of corrupting it: with no verdict the reply block decides, and with neither the attempt fails.
|
|
755
|
-
* @param loop - The run whose attempt just finished.
|
|
756
|
-
*/
|
|
757
|
-
private verifyRound;
|
|
758
|
-
/** Apply a protocol's own artifact requirement, then settle the attempt.
|
|
759
|
-
*
|
|
760
|
-
* The score is the verifier's judgement; whether the round's conclusion actually reached the
|
|
761
|
-
* artifact is a fact this client checks itself. A hard condition may not be overridden by a score:
|
|
762
|
-
* a round whose section is missing fails even at 10/10, and the missing line is fed back to the
|
|
763
|
-
* next attempt like any other finding. An artifact this client cannot read cannot be checked, so
|
|
764
|
-
* the verdict stands rather than being failed on a boundary.
|
|
765
|
-
* @param loop - The run whose attempt just finished.
|
|
766
|
-
* @param result - Verdict to consume.
|
|
767
|
-
* @param note - Note to show instead, when the check accepted the verdict unchanged.
|
|
768
|
-
*/
|
|
769
|
-
private settleChecked;
|
|
770
|
-
/** Apply one attempt's verdict, and continue the run when it has a next step.
|
|
771
|
-
* @param loop - The run being settled.
|
|
772
|
-
* @param result - Verdict to consume, or undefined when the attempt produced none.
|
|
773
|
-
*/
|
|
774
|
-
private settleWith;
|
|
775
|
-
/** Stop an in-flight verification, if any; its result can no longer decide anything. */
|
|
776
|
-
private abortVerification;
|
|
777
|
-
/** Stop the run because the whole-run budget expired; a budget stop, not a verdict.
|
|
778
|
-
*
|
|
779
|
-
* Any verification in flight is cancelled (bounded, as everywhere else) and its late result can
|
|
780
|
-
* no longer decide anything, because the loop is no longer active.
|
|
781
|
-
*/
|
|
782
|
-
private expireLoopDeadline;
|
|
783
|
-
/** Drop the run deadline, if one is armed. */
|
|
784
|
-
private clearLoopDeadline;
|
|
785
|
-
/** Drop a pending settle timer, if any. */
|
|
786
|
-
private forgetSettleTimer;
|
|
787
|
-
/** Send the prompt the loop is holding, once the client can actually send it. */
|
|
788
|
-
private flushLoop;
|
|
789
581
|
/** Cancel the active turn; pending queue items remain host-owned. */
|
|
790
582
|
private cancelTurn;
|
|
791
583
|
/** Add a page before the retained window.
|
|
@@ -799,12 +591,6 @@ export declare class Controller implements ControllerStore, ConnectionListener {
|
|
|
799
591
|
* @returns Newest-first bounded summaries and an explicit truncation flag.
|
|
800
592
|
*/
|
|
801
593
|
private searchHistory;
|
|
802
|
-
/** Load a separate small window ending at a search target.
|
|
803
|
-
* @param target - Durable message sequence to display.
|
|
804
|
-
* @param signal - Cancels the target-page request.
|
|
805
|
-
* @returns A caller-owned historical window that must be disposed when closed.
|
|
806
|
-
*/
|
|
807
|
-
private historyAt;
|
|
808
594
|
/** Plain rows and offsets for one laid-out record; the projection stays in the session domain. */
|
|
809
595
|
private render;
|
|
810
596
|
/** Load the prefix required for an explicit history jump.
|