agent-afk 5.174.0 → 5.175.1

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.
@@ -10,6 +10,7 @@ export interface QueuedTask {
10
10
  maxAttempts?: number;
11
11
  backoffStrategy?: 'fixed' | 'exponential';
12
12
  backoffBaseMs?: number;
13
+ eligibleAfter?: number;
13
14
  }
14
15
  export interface EnqueueOptions {
15
16
  notifyOn?: 'failure' | 'always' | 'never';
@@ -11,6 +11,7 @@ import type { AnthropicToolDef, ToolHandler } from '../../tools/types.js';
11
11
  import type { CustomToolDef } from '../../tools/custom-tool.js';
12
12
  import type { GrantManager } from '../../../cli/slash/commands/allow-dir.js';
13
13
  import type { RuntimeStateSource } from '../../awareness/index.js';
14
+ import type { SpawnedPidRegistry } from '../../tools/handlers/pid-registry.js';
14
15
  import { SessionToolDispatcher } from '../../tools/dispatcher.js';
15
16
  import { type ToolPermissionConfig } from '../../tools/permissions.js';
16
17
  export interface BuildDispatcherOptions {
@@ -26,6 +27,7 @@ export interface BuildDispatcherOptions {
26
27
  runtimeStateSource?: RuntimeStateSource;
27
28
  hookRegistry?: HookRegistry;
28
29
  planExitControls?: PlanExitControls;
30
+ spawnedPidRegistry?: SpawnedPidRegistry;
29
31
  }
30
32
  export interface BuildDispatcherDeps {
31
33
  memoryStore: MemoryStore;
@@ -29,6 +29,7 @@ export declare class AnthropicDirectProvider implements ModelProvider {
29
29
  private _mcpHandlersCache;
30
30
  private _presenceSessionId;
31
31
  private _mintedSessionId;
32
+ private readonly _spawnedPidRegistry;
32
33
  constructor(opts?: AnthropicDirectProviderOptions);
33
34
  private buildDispatcher;
34
35
  close(): void;
@@ -39,6 +39,7 @@ export declare class OpenAICompatibleProvider implements ModelProvider {
39
39
  private _sharedCurrentCwd;
40
40
  private _presenceSessionId;
41
41
  private _mintedSessionId;
42
+ private readonly _spawnedPidRegistry;
42
43
  constructor(opts?: OpenAICompatibleProviderOptions);
43
44
  setEndpointDefaults(defaults: {
44
45
  baseURL?: string;
@@ -7,6 +7,7 @@ import type { SubagentExecutor } from './subagent-executor.js';
7
7
  import type { SkillExecutor } from './skill-executor.js';
8
8
  import type { ComposeExecutor } from './compose-executor.js';
9
9
  import type { ToolHandler, ConcurrencyClassifier } from './types.js';
10
+ import type { SpawnedPidRegistry } from './handlers/pid-registry.js';
10
11
  import { type ToolPermissionConfig } from './permissions.js';
11
12
  import type { CanUseTool } from '../types/sdk-types.js';
12
13
  import { type GrantSnapshot } from './grant-manager.js';
@@ -38,6 +39,7 @@ export interface SessionToolDispatcherOptions {
38
39
  traceWriter?: TraceSink;
39
40
  readOnlyBash?: boolean;
40
41
  maxOutputBytes?: number;
42
+ spawnedPidRegistry?: SpawnedPidRegistry;
41
43
  }
42
44
  export declare class SessionToolDispatcher implements ToolDispatcher {
43
45
  private readonly handlers;
@@ -62,6 +64,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
62
64
  private readonly traceWriter;
63
65
  private readonly readOnlyBash;
64
66
  private readonly maxOutputBytes;
67
+ private readonly spawnedPidRegistry;
65
68
  private repeatBreaker;
66
69
  private readonly repeatFailureGuard;
67
70
  private denialBreaker;
@@ -0,0 +1,7 @@
1
+ export declare class SpawnedPidRegistry {
2
+ private readonly _pids;
3
+ register(pid: number): void;
4
+ has(pid: number): boolean;
5
+ clear(): void;
6
+ get size(): number;
7
+ }
@@ -1,3 +1,4 @@
1
+ import type { SpawnedPidRegistry } from './pid-registry.js';
1
2
  export type WaitCondition = UrlCondition | FileCondition | ProcessCondition | CommandCondition;
2
3
  export interface UrlCondition {
3
4
  type: 'url';
@@ -28,5 +29,5 @@ export interface WaitResult {
28
29
  }
29
30
  export declare function evaluateUrl(cond: UrlCondition, signal: AbortSignal): Promise<WaitResult>;
30
31
  export declare function evaluateFile(cond: FileCondition, signal?: AbortSignal): Promise<WaitResult>;
31
- export declare function evaluateProcess(cond: ProcessCondition): WaitResult;
32
+ export declare function evaluateProcess(cond: ProcessCondition, registry?: SpawnedPidRegistry): WaitResult;
32
33
  export declare function evaluateCommand(cond: CommandCondition): WaitResult;
@@ -4,6 +4,7 @@ export type { AnthropicToolDef } from '../providers/anthropic-direct/types.js';
4
4
  export type { ToolDispatcher } from '../providers/anthropic-direct/tool-dispatcher.js';
5
5
  import type { ToolResult } from '../providers/shared/tool-result.js';
6
6
  import type { TraceSink } from '../trace/index.js';
7
+ import type { SpawnedPidRegistry } from './handlers/pid-registry.js';
7
8
  export interface ToolHandlerContext {
8
9
  cwd?: string;
9
10
  resolveBase?: string;
@@ -14,6 +15,7 @@ export interface ToolHandlerContext {
14
15
  traceWriter?: TraceSink;
15
16
  toolUseId?: string;
16
17
  sessionId?: string;
18
+ spawnedPidRegistry?: SpawnedPidRegistry;
17
19
  }
18
20
  export type ToolHandler = (input: unknown, signal: AbortSignal, context?: ToolHandlerContext) => Promise<ToolResult>;
19
21
  export type ConcurrencyClassifier = (toolName: string, input?: unknown) => boolean;
@@ -33,6 +33,7 @@ export declare function registerOverlaySlots(overlayComposer: OverlayComposer, c
33
33
  getSoftStopping: () => boolean;
34
34
  getTtfbStartedAt?: () => number | undefined;
35
35
  isTtfbDone?: () => boolean;
36
+ getTtfbSpinnerFrame?: () => number;
36
37
  getActiveSubagents?: () => ReadonlyMap<string, SubagentStatusBarSpec>;
37
38
  }): void;
38
39
  export declare function formatInterruptAffordance(interrupting: boolean): string;
@@ -4,12 +4,11 @@ export interface TtfbTickCtx {
4
4
  ttfbStartedAt: number | undefined;
5
5
  ttfbDone: boolean;
6
6
  lastTtfbAnnotation: string;
7
+ ttfbSpinnerFrame: number;
7
8
  isTTY: boolean;
8
9
  disposed: boolean;
9
10
  overlayComposer: OverlayComposer | null;
10
11
  }
11
12
  export declare function checkTtfbAnnotation(ctx: TtfbTickCtx, now: number): boolean;
12
13
  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;
14
+ export declare function renderTtfbWaitingProgress(getTtfbStartedAt: (() => number | undefined) | undefined, isTtfbDone: (() => boolean) | undefined, getSpinnerFrame: (() => number) | undefined): string;
@@ -44,6 +44,7 @@ export declare class StreamRenderer {
44
44
  private readonly ttfbStartedAt;
45
45
  private ttfbDone;
46
46
  private lastTtfbAnnotation;
47
+ private ttfbSpinnerFrame;
47
48
  private readonly addPreviewDiffRef;
48
49
  readonly sink: (event: OutputEvent, meta?: SubagentProgressMeta) => void;
49
50
  constructor(opts: StreamRendererOptions);
@@ -4,7 +4,6 @@ export * from './help-table.js';
4
4
  export * from './usage-limit-box.js';
5
5
  export * from './card.js';
6
6
  export * from './divider.js';
7
- export * from './progress-bar.js';
8
7
  export * from './box.js';
9
8
  export * from './subagent-status-bar.js';
10
9
  export * from './stream-progress.js';