agent-afk 5.92.0 → 5.93.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.
@@ -1,9 +1,10 @@
1
- import type { TraceWriter } from '../../../trace/index.js';
1
+ import type { TraceWriter } from '../../trace/index.js';
2
2
  export declare class TurnTrace {
3
3
  private readonly signal;
4
4
  private readonly traceWriter;
5
+ private readonly provider;
5
6
  private interruptedAt;
6
- constructor(signal: AbortSignal, traceWriter: TraceWriter | undefined);
7
+ constructor(signal: AbortSignal, traceWriter: TraceWriter | undefined, provider: 'anthropic-direct' | 'openai-compatible');
7
8
  private readonly onInterrupt;
8
9
  finish(turnElapsedMs: number): void;
9
10
  }
@@ -84,6 +84,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
84
84
  private recordForkReadDenial;
85
85
  private resetDenialBreaker;
86
86
  private runCanUseTool;
87
+ private runPreDispatchGates;
87
88
  execute(call: ToolCall): Promise<ToolResult>;
88
89
  executeBatch(calls: ToolCall[]): Promise<ToolResult[]>;
89
90
  private executeCore;
@@ -3,6 +3,7 @@ export declare function detectBell(env?: NodeJS.ProcessEnv): boolean;
3
3
  export declare function detectReducedMotion(env?: NodeJS.ProcessEnv): boolean;
4
4
  export declare function detectCaretBlink(env?: NodeJS.ProcessEnv): boolean;
5
5
  export declare function detectGoblinSpinner(env?: NodeJS.ProcessEnv): boolean;
6
+ export declare function detectGoblinMascot(env?: NodeJS.ProcessEnv): boolean;
6
7
  export declare function ringBellIfEnabled(stream: {
7
8
  write(s: string): unknown;
8
9
  isTTY?: boolean;
@@ -22,7 +22,7 @@ export interface StreamRendererOptions {
22
22
  captureMode?: boolean;
23
23
  reducedMotion?: boolean;
24
24
  compositor?: TerminalCompositor;
25
- onStageChange?: (stage: import('../commands/interactive/loop-stage.js').LoopStage) => void;
25
+ onStageChange?: (stage: import('../commands/interactive/loop-stage.js').LoopStage, signals?: import('../commands/interactive/loop-stage.js').StageSignals) => void;
26
26
  }
27
27
  export declare class StreamRenderer {
28
28
  private readonly out;
@@ -3,6 +3,8 @@ import { createContextPane } from './context-pane.js';
3
3
  import { createVerdictLedger } from './verdict-ledger.js';
4
4
  import { BackgroundStatusBar } from '../../background-status-bar.js';
5
5
  import { LoopStageBar } from './loop-stage.js';
6
+ import { LiveMascot } from './mascot-live.js';
7
+ import { MascotBand } from './mascot-band.js';
6
8
  import { ShellPassthrough } from './shell-passthrough.js';
7
9
  import { BgResultNotifier } from './bg-result-notifier.js';
8
10
  import type { TurnState } from './repl-loop-shared.js';
@@ -10,6 +12,8 @@ export interface FooterSubsystems {
10
12
  contextPane: ReturnType<typeof createContextPane>;
11
13
  bgStatusBar: BackgroundStatusBar;
12
14
  loopStageBar: LoopStageBar;
15
+ liveMascot: LiveMascot;
16
+ mascotBand: MascotBand;
13
17
  verdictLedger: ReturnType<typeof createVerdictLedger>;
14
18
  shellPassthrough: ShellPassthrough;
15
19
  bgResultNotifier: BgResultNotifier;
@@ -1,5 +1,8 @@
1
1
  import type { OutputEvent } from '../../../agent/types.js';
2
2
  export type LoopStage = 'observing' | 'modeling' | 'choosing' | 'acting' | 'updating';
3
+ export interface StageSignals {
4
+ toolErrored?: boolean;
5
+ }
3
6
  export declare const LOOP_STAGES: readonly LoopStage[];
4
7
  export declare const STAGE_LABEL: Record<LoopStage, string>;
5
8
  export interface StageTrackerState {
@@ -0,0 +1,26 @@
1
+ export declare const MASCOT_BAND_ROWS = 3;
2
+ export declare const MASCOT_BAND_MIN_CONTENT_ROWS = 8;
3
+ export declare class MascotBand {
4
+ private readonly stream;
5
+ private readonly getLines;
6
+ private readonly getAdjacentRows;
7
+ private started;
8
+ private rowCount;
9
+ private lastStartRow;
10
+ private lastRowCount;
11
+ private resizeUnsub;
12
+ private onRowCountChange?;
13
+ constructor(opts: {
14
+ getLines: () => readonly string[];
15
+ getAdjacentRows: () => number;
16
+ stream?: NodeJS.WriteStream;
17
+ });
18
+ setRowCountChangeHandler(handler: (rows: number) => void): void;
19
+ stop(): void;
20
+ start(): void;
21
+ redraw(): void;
22
+ getRowCount(): number;
23
+ private clearBand;
24
+ private repaint;
25
+ private visibleRows;
26
+ }
@@ -0,0 +1,28 @@
1
+ import { type MascotState } from '../../mascot.js';
2
+ import type { LoopStage } from './loop-stage.js';
3
+ export type MascotFrame = readonly string[];
4
+ export declare class LiveMascot {
5
+ private readonly requestRepaint;
6
+ private readonly frameMs;
7
+ private started;
8
+ private state;
9
+ private frame;
10
+ private timer;
11
+ private stageState;
12
+ private alertTimer;
13
+ constructor(opts: {
14
+ requestRepaint: () => void;
15
+ frameMs?: number;
16
+ });
17
+ stop(): void;
18
+ start(): void;
19
+ lines(): MascotFrame;
20
+ setState(state: MascotState): void;
21
+ onStage(stage: LoopStage, signals?: {
22
+ toolErrored?: boolean;
23
+ }): void;
24
+ private clearAlertTimer;
25
+ private flashAlert;
26
+ private stopTimer;
27
+ private startTimer;
28
+ }
@@ -103,7 +103,7 @@ export interface TurnHandles {
103
103
  setPausedState?(paused: boolean): void;
104
104
  setPauseInterruptHandler?(handler: (() => void) | null): void;
105
105
  onContextProgress?(): void | Promise<void>;
106
- onStageChange?(stage: import('./loop-stage.js').LoopStage): void;
106
+ onStageChange?(stage: import('./loop-stage.js').LoopStage, signals?: import('./loop-stage.js').StageSignals): void;
107
107
  }
108
108
  export declare const REPL_SPINNER_OPTIONS: {
109
109
  readonly stream: NodeJS.WriteStream & {
@@ -2,9 +2,11 @@ import type { InputSurface } from '../../input/input-surface.js';
2
2
  import type { InteractiveCtx } from './shared.js';
3
3
  import type { TranscriptHandle } from './transcript.js';
4
4
  import type { LoopStageBar } from './loop-stage.js';
5
+ import type { LiveMascot } from './mascot-live.js';
5
6
  import { type TurnState } from './repl-loop-shared.js';
6
7
  export interface SurfaceSetupDeps {
7
8
  getLoopStageBar: () => LoopStageBar | undefined;
9
+ getLiveMascot: () => LiveMascot | undefined;
8
10
  }
9
11
  export interface SurfaceSetupResult {
10
12
  installSoftStop: (handler: (() => void) | null) => void;
@@ -0,0 +1,6 @@
1
+ import { type MascotState } from './mascot.js';
2
+ export declare const MINI_MASCOT_WIDTH = 13;
3
+ export declare const MINI_MASCOT_HEIGHT = 3;
4
+ export declare function miniMascotFrameCount(state: MascotState): number;
5
+ export declare function renderMiniMascotLines(state?: MascotState, frame?: number): string[];
6
+ export declare const __MINI_MASCOT_FRAMES_FOR_TESTS: Record<MascotState, readonly (readonly string[])[]>;
@@ -1,6 +1,12 @@
1
1
  export type MascotState = 'idle' | 'working' | 'alert';
2
2
  export declare const MASCOT_WIDTH = 27;
3
3
  export declare const MASCOT_HEIGHT = 13;
4
+ export type GlyphOverlay = Readonly<Record<string, {
5
+ char: string;
6
+ fg: string;
7
+ bg: string;
8
+ }>>;
9
+ export declare function renderHalfBlockGrid(grid: readonly string[], overlays?: GlyphOverlay): string[];
4
10
  export declare function renderMascotLines(state?: MascotState): string[];
5
11
  export declare function mascotSuppressed(): boolean;
6
12
  export declare const __GOBLIN_GRID_FOR_TESTS: readonly string[];
@@ -78,7 +78,7 @@ export interface SlashContext {
78
78
  mcpManager?: import('../../agent/mcp/index.js').McpManager;
79
79
  getCompositor?: () => import('../terminal-compositor.js').TerminalCompositor | null;
80
80
  setSoftStopHandler?: (handler: (() => void) | null) => void;
81
- onStageChange?: (stage: import('../commands/interactive/loop-stage.js').LoopStage) => void;
81
+ onStageChange?: (stage: import('../commands/interactive/loop-stage.js').LoopStage, signals?: import('../commands/interactive/loop-stage.js').StageSignals) => void;
82
82
  onContextProgress?: () => void | Promise<void>;
83
83
  transcript?: {
84
84
  appendTurn(userInput: string, assistantText: string): Promise<void>;