agent-afk 5.100.2 → 5.100.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.
@@ -2,4 +2,4 @@ import type { ProviderEvent } from '../../../provider.js';
2
2
  import type { RunTurnInput, TurnResult } from '../types.js';
3
3
  import type { TurnAccumulator } from './turn-accumulator.js';
4
4
  export type ToolRoundOutcome = 'continue' | 'terminated';
5
- export declare function runToolRound(turnResult: TurnResult, input: RunTurnInput, turn: TurnAccumulator, maxIterations: number): AsyncGenerator<ProviderEvent, ToolRoundOutcome, void>;
5
+ export declare function runToolRound(turnResult: TurnResult, input: RunTurnInput, turn: TurnAccumulator, maxIterations: number, softDeadlineMs: number): AsyncGenerator<ProviderEvent, ToolRoundOutcome, void>;
@@ -1,9 +1,12 @@
1
1
  import type { ProviderUsage } from '../../../provider.js';
2
+ import type { SOFT_DEADLINE_WIND_DOWN } from '../../shared/soft-deadline.js';
3
+ import type { TOOL_USE_LOOP_CAPPED } from '../../shared/tool-loop-cap.js';
4
+ export type WindDownReason = typeof TOOL_USE_LOOP_CAPPED | typeof SOFT_DEADLINE_WIND_DOWN;
2
5
  export declare class TurnAccumulator {
3
6
  usage: ProviderUsage;
4
7
  iterations: number;
5
8
  toolCallCount: number;
6
- capReached: boolean;
9
+ windDownReason: WindDownReason | null;
7
10
  readonly taskId: string;
8
11
  readonly startedAt: number;
9
12
  elapsedMs(): number;
@@ -18,6 +18,7 @@ export interface TurnRequestInput {
18
18
  thinking?: RunTurnInput['thinking'];
19
19
  effort?: RunTurnInput['effort'];
20
20
  maxToolUseIterations?: number;
21
+ softDeadlineMs?: number;
21
22
  traceWriter?: RunTurnInput['traceWriter'];
22
23
  subagentId?: string;
23
24
  throttleQueue?: RunTurnInput['throttleQueue'];
@@ -23,6 +23,7 @@ export interface AnthropicDirectQueryOptions {
23
23
  effort?: import('../../types/sdk-types.js').EffortLevel;
24
24
  baseUrl?: string;
25
25
  maxToolUseIterations?: number;
26
+ softDeadlineMs?: number;
26
27
  traceWriter?: import('../../trace/index.js').TraceWriter;
27
28
  subagentId?: string;
28
29
  autoResumeOnUsageLimit?: boolean;
@@ -11,6 +11,7 @@ export declare class AnthropicDirectQuery implements ProviderQuery {
11
11
  private readonly effort?;
12
12
  private readonly baseUrl?;
13
13
  private readonly maxToolUseIterations?;
14
+ private readonly softDeadlineMs?;
14
15
  private readonly traceWriter?;
15
16
  private readonly subagentId?;
16
17
  private readonly state;
@@ -17,6 +17,7 @@ export interface TurnDriverContext {
17
17
  readonly effort: import('../../types/sdk-types.js').EffortLevel | undefined;
18
18
  readonly baseUrl: string | undefined;
19
19
  readonly maxToolUseIterations: number | undefined;
20
+ readonly softDeadlineMs: number | undefined;
20
21
  readonly traceWriter: import('../../trace/index.js').TraceWriter | undefined;
21
22
  readonly subagentId: string | undefined;
22
23
  readonly mcpManager: import('../../mcp/index.js').McpManager | undefined;
@@ -13,6 +13,7 @@ export interface RunTurnInput {
13
13
  signal: AbortSignal;
14
14
  ctx: TranslateCtx;
15
15
  maxToolUseIterations?: number;
16
+ softDeadlineMs?: number;
16
17
  thinking?: ThinkingConfigParam;
17
18
  effort?: import('../../types/sdk-types.js').EffortLevel;
18
19
  fastMode?: boolean;
@@ -0,0 +1,8 @@
1
+ export declare const SOFT_DEADLINE_WIND_DOWN = "soft_deadline_wind_down";
2
+ export declare const SOFT_DEADLINE_NOTE: string;
3
+ export declare const SOFT_DEADLINE_RESERVE_FRACTION = 0.15;
4
+ export declare const SOFT_DEADLINE_MIN_RESERVE_MS = 30000;
5
+ export declare const SOFT_DEADLINE_MAX_RESERVE_MS: number;
6
+ export declare const SOFT_DEADLINE_MIN_BUDGET_MS = 120000;
7
+ export declare function resolveSoftDeadlineMs(hardTimeoutMs: number | undefined): number;
8
+ export declare function softDeadlineExpired(startedAt: number, softDeadlineMs: number, now?: number): boolean;
@@ -28,6 +28,7 @@ export interface AgentConfig {
28
28
  forceChatgptOAuth?: boolean;
29
29
  maxTurns?: number;
30
30
  maxToolUseIterations?: number;
31
+ softDeadlineMs?: number;
31
32
  thinking?: ThinkingConfig;
32
33
  effort?: EffortLevel;
33
34
  tools?: ToolConfig;