agent-afk 5.127.4 → 5.128.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/_lib/stream-renderer-lifecycle.d.ts +4 -3
- package/dist/cli/_lib/stream-renderer-options.d.ts +1 -0
- package/dist/cli/_lib/stream-renderer-ttfb.d.ts +15 -0
- package/dist/cli/_lib/stream-renderer.d.ts +4 -0
- package/dist/cli/commands/interactive/footer-subsystems.d.ts +2 -0
- package/dist/cli/commands/interactive/interrupt-picker.d.ts +17 -0
- package/dist/cli/commands/interactive/repl-loop-shared.d.ts +1 -0
- package/dist/cli/commands/interactive/turn-handler.d.ts +2 -10
- package/dist/cli/commands/interactive/turn-handler.footer.d.ts +11 -0
- package/dist/cli/commands/interactive/turn-handler.ttfb.d.ts +12 -0
- package/dist/cli/health-rail.d.ts +25 -0
- package/dist/cli/health-rail.format.d.ts +8 -0
- package/dist/cli/render/picker.d.ts +1 -0
- package/dist/cli.mjs +534 -534
- package/dist/index.mjs +1 -1
- package/dist/telegram.mjs +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,8 @@ import type { ThinkingLane } from '../commands/interactive/thinking-lane.js';
|
|
|
8
8
|
import type { StreamingMarkdownRenderer } from '../markdown-stream.js';
|
|
9
9
|
import type { Writer } from '../slash/types.js';
|
|
10
10
|
import type { ProgressEvent } from '../../agent/types.js';
|
|
11
|
-
|
|
11
|
+
import { type TtfbTickCtx } from './stream-renderer-ttfb.js';
|
|
12
|
+
export interface LifecycleContext extends TtfbTickCtx {
|
|
12
13
|
compositor: TerminalCompositor | null;
|
|
13
14
|
overlayComposer: OverlayComposer | null;
|
|
14
15
|
stageTracker: ReturnType<typeof createStageTracker>;
|
|
@@ -20,9 +21,7 @@ export interface LifecycleContext {
|
|
|
20
21
|
lastProgressByTask: Map<string, ProgressEvent>;
|
|
21
22
|
thinkingMode: 'off' | 'summary' | 'live' | 'digest';
|
|
22
23
|
out: Writer;
|
|
23
|
-
isTTY: boolean;
|
|
24
24
|
sources: Map<string, SourceState>;
|
|
25
|
-
disposed: boolean;
|
|
26
25
|
pauseTickInterval: ReturnType<typeof setInterval> | null;
|
|
27
26
|
resizeUnsub: (() => void) | null;
|
|
28
27
|
}
|
|
@@ -31,6 +30,8 @@ export declare function registerOverlaySlots(overlayComposer: OverlayComposer, c
|
|
|
31
30
|
childActivity?: ChildActivityTracker;
|
|
32
31
|
getInterrupting: () => boolean;
|
|
33
32
|
getSoftStopping: () => boolean;
|
|
33
|
+
getTtfbStartedAt?: () => number | undefined;
|
|
34
|
+
isTtfbDone?: () => boolean;
|
|
34
35
|
}): void;
|
|
35
36
|
export declare function formatInterruptAffordance(interrupting: boolean): string;
|
|
36
37
|
export declare function subscribeToResize(overlayComposer: OverlayComposer, disposed: boolean): () => void;
|
|
@@ -21,4 +21,5 @@ export interface StreamRendererOptions {
|
|
|
21
21
|
reducedMotion?: boolean;
|
|
22
22
|
compositor?: TerminalCompositor;
|
|
23
23
|
onStageChange?: (stage: import('../commands/interactive/loop-stage.js').LoopStage, signals?: import('../commands/interactive/loop-stage.js').StageSignals) => void;
|
|
24
|
+
turnStartedAt?: number;
|
|
24
25
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { OverlayComposer } from './overlay-composer.js';
|
|
2
|
+
export declare const TTFB_GRACE_MS = 2000;
|
|
3
|
+
export interface TtfbTickCtx {
|
|
4
|
+
ttfbStartedAt: number | undefined;
|
|
5
|
+
ttfbDone: boolean;
|
|
6
|
+
lastTtfbAnnotation: string;
|
|
7
|
+
isTTY: boolean;
|
|
8
|
+
disposed: boolean;
|
|
9
|
+
overlayComposer: OverlayComposer | null;
|
|
10
|
+
}
|
|
11
|
+
export declare function checkTtfbAnnotation(ctx: TtfbTickCtx, now: number): boolean;
|
|
12
|
+
export declare function applyFirstContent(isDone: boolean, setDone: () => void, overlayComposer: OverlayComposer | null): boolean;
|
|
13
|
+
export declare function renderTtfbWaitingLine(getTtfbStartedAt: (() => number | undefined) | undefined, isTtfbDone: (() => boolean) | undefined, palette: {
|
|
14
|
+
dim: (s: string) => string;
|
|
15
|
+
}): string;
|
|
@@ -37,12 +37,16 @@ export declare class StreamRenderer {
|
|
|
37
37
|
private disposed;
|
|
38
38
|
private pauseTickInterval;
|
|
39
39
|
private resizeUnsub;
|
|
40
|
+
private readonly ttfbStartedAt;
|
|
41
|
+
private ttfbDone;
|
|
42
|
+
private lastTtfbAnnotation;
|
|
40
43
|
readonly sink: (event: OutputEvent, meta?: SubagentProgressMeta) => void;
|
|
41
44
|
constructor(opts: StreamRendererOptions);
|
|
42
45
|
arm(): Promise<void>;
|
|
43
46
|
getCompositor(): TerminalCompositor | null;
|
|
44
47
|
setInterrupting(active: boolean): void;
|
|
45
48
|
setSoftStopping(active: boolean): void;
|
|
49
|
+
notifyFirstContent(): void;
|
|
46
50
|
private buildOrchestratorCtx;
|
|
47
51
|
process(event: OutputEvent, meta?: SubagentProgressMeta): void;
|
|
48
52
|
dispose(): Promise<void>;
|
|
@@ -4,6 +4,7 @@ import { createVerdictLedger } from './verdict-ledger.js';
|
|
|
4
4
|
import { BackgroundStatusBar } from '../../background-status-bar.js';
|
|
5
5
|
import { LoopStageBar } from './loop-stage.js';
|
|
6
6
|
import { MascotBar } from './mascot-bar.js';
|
|
7
|
+
import { HealthRail } from '../../health-rail.js';
|
|
7
8
|
import { ShellPassthrough } from './shell-passthrough.js';
|
|
8
9
|
import { BgResultNotifier } from './bg-result-notifier.js';
|
|
9
10
|
import type { TurnState } from './repl-loop-shared.js';
|
|
@@ -12,6 +13,7 @@ export interface FooterSubsystems {
|
|
|
12
13
|
bgStatusBar: BackgroundStatusBar;
|
|
13
14
|
loopStageBar: LoopStageBar;
|
|
14
15
|
mascotBar: MascotBar;
|
|
16
|
+
healthRail: HealthRail;
|
|
15
17
|
verdictLedger: ReturnType<typeof createVerdictLedger>;
|
|
16
18
|
shellPassthrough: ShellPassthrough;
|
|
17
19
|
bgResultNotifier: BgResultNotifier;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TerminalCompositor } from '../../terminal-compositor.js';
|
|
2
|
+
import type { TurnState } from './repl-loop-shared.js';
|
|
3
|
+
export type InterruptChoice = 'stop' | 'cancel' | 'dismissed';
|
|
4
|
+
export interface InterruptPickerOptions {
|
|
5
|
+
compositor: TerminalCompositor;
|
|
6
|
+
signal: AbortSignal;
|
|
7
|
+
onStop: () => void;
|
|
8
|
+
onCancel: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function showInterruptPicker(opts: InterruptPickerOptions): Promise<InterruptChoice>;
|
|
11
|
+
export interface LaunchInterruptPickerOptions {
|
|
12
|
+
compositor: TerminalCompositor;
|
|
13
|
+
turnState: TurnState;
|
|
14
|
+
onStop: () => void;
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function launchInterruptPicker(opts: LaunchInterruptPickerOptions): void;
|
|
@@ -6,5 +6,6 @@ export interface TurnState {
|
|
|
6
6
|
tryAbortShellForeground?: (() => boolean) | null;
|
|
7
7
|
notifyInterrupting?: ((active: boolean) => void) | null;
|
|
8
8
|
requestSoftStop?: (() => void) | null;
|
|
9
|
+
interruptPickerAbort?: AbortController | null;
|
|
9
10
|
}
|
|
10
11
|
export declare function buildPrompt(mode: PermissionMode): string;
|
|
@@ -9,13 +9,5 @@ export declare function runTurn(input: {
|
|
|
9
9
|
text: string;
|
|
10
10
|
attachments: ImageAttachment[];
|
|
11
11
|
}, session: AgentSession, stats: SessionStats, h: TurnHandles, thinkingUi?: ThinkingUiMode, completionWriter?: CompletionWriter, inputSurface?: InputSurfaceRefs): Promise<void>;
|
|
12
|
-
export type ContextTier
|
|
13
|
-
export
|
|
14
|
-
tier: ContextTier;
|
|
15
|
-
text: string | null;
|
|
16
|
-
};
|
|
17
|
-
export declare function printTurnFooter(meta: {
|
|
18
|
-
durationMs?: number;
|
|
19
|
-
totalCostUsd?: number;
|
|
20
|
-
usage?: Record<string, unknown>;
|
|
21
|
-
} | undefined, stats: SessionStats, write?: (line: string) => void): void;
|
|
12
|
+
export type { ContextTier } from './turn-handler.footer.js';
|
|
13
|
+
export { formatContextUsage, printTurnFooter } from './turn-handler.footer.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SessionStats } from '../../slash/types.js';
|
|
2
|
+
export type ContextTier = 'quiet' | 'normal' | 'caution' | 'near' | 'over';
|
|
3
|
+
export declare function formatContextUsage(contextPct: number, contextLimit: number): {
|
|
4
|
+
tier: ContextTier;
|
|
5
|
+
text: string | null;
|
|
6
|
+
};
|
|
7
|
+
export declare function printTurnFooter(meta: {
|
|
8
|
+
durationMs?: number;
|
|
9
|
+
totalCostUsd?: number;
|
|
10
|
+
usage?: Record<string, unknown>;
|
|
11
|
+
} | undefined, stats: SessionStats, write?: (line: string) => void): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OutputEvent } from '../../../agent/types.js';
|
|
2
|
+
import type { CompletionWriter } from './shared.js';
|
|
3
|
+
export interface TurnTtfbState {
|
|
4
|
+
readonly startedAt: number;
|
|
5
|
+
received: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function createTurnTtfbState(startedAt: number): TurnTtfbState;
|
|
8
|
+
export declare function ttfbRendererOptions(state: TurnTtfbState): {
|
|
9
|
+
turnStartedAt?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function observeFirstContent(state: TurnTtfbState, event: OutputEvent, streamingStarted: boolean): boolean;
|
|
12
|
+
export declare function emitPlainTtfbWaiting(completionWriter: CompletionWriter | undefined): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BackgroundAgentRegistry } from '../agent/background-registry.js';
|
|
2
|
+
import type { SessionStats } from './slash/types.js';
|
|
3
|
+
export interface HealthRailOptions {
|
|
4
|
+
stream?: NodeJS.WriteStream;
|
|
5
|
+
backgroundRegistry?: BackgroundAgentRegistry;
|
|
6
|
+
getExtraRows: () => number;
|
|
7
|
+
}
|
|
8
|
+
export declare class HealthRail {
|
|
9
|
+
private readonly stream;
|
|
10
|
+
private readonly registry;
|
|
11
|
+
private readonly getExtraRows;
|
|
12
|
+
private started;
|
|
13
|
+
private snapshot;
|
|
14
|
+
private onRowCountChange?;
|
|
15
|
+
private resizeUnsub;
|
|
16
|
+
private tickInterval;
|
|
17
|
+
constructor(opts: HealthRailOptions);
|
|
18
|
+
setRowCountChangeHandler(handler: (rows: number) => void): void;
|
|
19
|
+
start(): void;
|
|
20
|
+
stop(): void;
|
|
21
|
+
update(stats: SessionStats, contextRatioOverride?: number): void;
|
|
22
|
+
redraw(): void;
|
|
23
|
+
private repaint;
|
|
24
|
+
private clearRow;
|
|
25
|
+
}
|
|
@@ -11,5 +11,6 @@ export interface RunPickerOptions {
|
|
|
11
11
|
signal?: AbortSignal;
|
|
12
12
|
initialIndex?: number;
|
|
13
13
|
initialSelected?: ReadonlySet<number>;
|
|
14
|
+
onCtrlC?: () => void;
|
|
14
15
|
}
|
|
15
16
|
export declare function runPicker(host: PickerHost, opts: RunPickerOptions): Promise<readonly string[] | null>;
|