agent-afk 5.224.6 → 5.225.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,4 +1,5 @@
1
1
  import type { ZodType } from 'zod';
2
+ import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
2
3
  import type { AgentModelInput, CanUseTool, IAgentSession } from './types.js';
3
4
  import type { ModelProvider } from './provider.js';
4
5
  import type { SubagentManager } from './subagent.js';
@@ -16,10 +17,13 @@ export interface SubagentDAGNode {
16
17
  parentId?: string;
17
18
  cwd?: string;
18
19
  readRoots?: string[];
20
+ extraReadRoots?: string[];
19
21
  writeRoots?: string[];
20
22
  apiKey?: string;
21
23
  maxToolUseIterations?: number;
24
+ maxTurns?: number;
22
25
  provider?: ModelProvider;
26
+ buildPromptAsync?: (inputs: Record<string, unknown>) => Promise<string | ContentBlockParam[]>;
23
27
  }
24
28
  export interface SubagentDAGOptions {
25
29
  manager: SubagentManager;
@@ -1,6 +1,6 @@
1
1
  import type { RawMessageStreamEvent } from '@anthropic-ai/sdk/resources';
2
2
  import type { ProviderEvent } from '../../provider.js';
3
- import type { AnthropicClientLike, ToolDispatcherLike, ToolCall, ToolResult, TranslateCtx } from './types.js';
3
+ import type { AnthropicClientLike, ToolDispatcher, ToolCall, ToolResult, TranslateCtx } from './types.js';
4
4
  export declare function fromArray<T>(arr: T[]): AsyncIterable<T>;
5
5
  export declare function collect(gen: AsyncGenerator<ProviderEvent>): Promise<ProviderEvent[]>;
6
6
  export declare const SESSION_ID = "sess_loop_test";
@@ -19,5 +19,5 @@ export declare function makeMultiToolUseStream(tools: Array<{
19
19
  input: string;
20
20
  }>): RawMessageStreamEvent[];
21
21
  export declare function makeClient(streamFactory: () => AsyncIterable<RawMessageStreamEvent>): AnthropicClientLike;
22
- export declare function makeDispatcher(executeFn: (call: ToolCall) => Promise<ToolResult>): ToolDispatcherLike;
23
- export declare function makeBatchDispatcher(executeBatchFn: (calls: ToolCall[]) => Promise<ToolResult[]>): ToolDispatcherLike;
22
+ export declare function makeDispatcher(executeFn: (call: ToolCall) => Promise<ToolResult>): ToolDispatcher;
23
+ export declare function makeBatchDispatcher(executeBatchFn: (calls: ToolCall[]) => Promise<ToolResult[]>): ToolDispatcher;
@@ -1,12 +1,12 @@
1
1
  import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
2
2
  import type { FastModeController, FastTurnDecision } from '../../../fast-mode.js';
3
- import type { AnthropicClientLike, AnthropicToolDef, RunTurnInput, ToolDispatcherLike } from '../types.js';
3
+ import type { AnthropicClientLike, AnthropicToolDef, RunTurnInput, ToolDispatcher } from '../types.js';
4
4
  export interface TurnRequestInput {
5
5
  client: AnthropicClientLike;
6
6
  messages: RunTurnInput['messages'];
7
7
  system: ContentBlockParam[] | string | null;
8
8
  tools: AnthropicToolDef[] | null;
9
- toolDispatcher: ToolDispatcherLike;
9
+ toolDispatcher: ToolDispatcher;
10
10
  model: string;
11
11
  maxTokens: number;
12
12
  signal: AbortSignal;
@@ -1,12 +1,12 @@
1
1
  import type { ContentBlockParam, MessageParam, RawMessageStreamEvent, ThinkingConfigParam } from '@anthropic-ai/sdk/resources';
2
2
  import type { ProviderUsage } from '../../provider.js';
3
- import type { AnthropicToolDef, ToolDispatcherLike, TranslateCtx } from './types.js';
3
+ import type { AnthropicToolDef, ToolDispatcher, TranslateCtx } from './types.js';
4
4
  export interface RunTurnInput {
5
5
  client: AnthropicClientLike;
6
6
  messages: MessageParam[];
7
7
  system: ContentBlockParam[] | string | null;
8
8
  tools: AnthropicToolDef[] | null;
9
- toolDispatcher: ToolDispatcherLike;
9
+ toolDispatcher: ToolDispatcher;
10
10
  model: string;
11
11
  maxTokens: number;
12
12
  headers: Record<string, string>;
@@ -1,7 +1,5 @@
1
- import type { ToolCall, ToolResult, ToolDispatcherLike } from './types.js';
2
- export interface ToolDispatcher extends ToolDispatcherLike {
3
- }
1
+ import type { ToolCall, ToolResult, ToolDispatcher } from './types.js';
4
2
  export declare class RejectAllToolDispatcher implements ToolDispatcher {
5
3
  execute(call: ToolCall): Promise<ToolResult>;
6
4
  }
7
- export type { ToolCall, ToolResult } from './types.js';
5
+ export type { ToolDispatcher, ToolCall, ToolResult } from './types.js';
@@ -44,7 +44,7 @@ export interface AnthropicToolDef {
44
44
  concurrencySafe?: boolean;
45
45
  riskClass?: 'safe' | 'caution' | 'destructive';
46
46
  }
47
- export interface ToolDispatcherLike {
47
+ export interface ToolDispatcher {
48
48
  execute(call: ToolCall): Promise<ToolResult>;
49
49
  executeBatch?(calls: ToolCall[], onActivity?: (activeIds: readonly string[]) => void): Promise<ToolResult[]>;
50
50
  setResolveBase?(cwd: string): void;
@@ -4,6 +4,7 @@ import type { Surface } from '../awareness/types.js';
4
4
  import type { WorkspaceStore } from '../workspace/index.js';
5
5
  import type { TraceSink } from '../trace/index.js';
6
6
  import type { ToolCall, ToolResult } from './types.js';
7
+ import type { InboundAttachmentReader } from '../content/attachment-registry.js';
7
8
  export interface ComposeExecutorContext {
8
9
  parentSession: Pick<IAgentSession, 'sessionId' | 'abortSignal'>;
9
10
  defaultModel?: AgentModelInput;
@@ -21,6 +22,7 @@ export interface ComposeExecutorContext {
21
22
  getReadScopeInputs?: () => ReadScopeInputs;
22
23
  workspaceStore?: WorkspaceStore;
23
24
  delegationBudget?: import('./delegation-budget.js').DelegationBudget;
25
+ inboundAttachmentRegistry?: InboundAttachmentReader;
24
26
  onSubagentSucceeded?: (usage: import('../subagent/result.js').SubagentTrace['usage'], costUsd: number | undefined) => void;
25
27
  }
26
28
  export interface TruncationEvent {
@@ -0,0 +1,23 @@
1
+ import type { DAGEdge } from '../dag.js';
2
+ export interface ComposeNodeInput {
3
+ id: string;
4
+ prompt: string;
5
+ model?: string;
6
+ cwd?: string;
7
+ readRoots?: string[];
8
+ writeRoots?: string[];
9
+ max_tool_rounds?: number;
10
+ max_turns?: number;
11
+ }
12
+ export interface ComposeInput {
13
+ nodes: ComposeNodeInput[];
14
+ edges?: DAGEdge[];
15
+ fail_fast?: boolean;
16
+ node_timeout_ms?: number;
17
+ max_tool_rounds_per_node?: number;
18
+ }
19
+ export interface ParseResult {
20
+ parsed: ComposeInput;
21
+ warnings: string[];
22
+ }
23
+ export declare function parseComposeInput(input: unknown): ParseResult;