agent-afk 5.224.5 → 5.224.7

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.
@@ -19,6 +19,7 @@ export interface SubagentDAGNode {
19
19
  writeRoots?: string[];
20
20
  apiKey?: string;
21
21
  maxToolUseIterations?: number;
22
+ maxTurns?: number;
22
23
  provider?: ModelProvider;
23
24
  }
24
25
  export interface SubagentDAGOptions {
@@ -1,6 +1,6 @@
1
1
  export { createHookRegistry } from './hook-registry.js';
2
2
  import type { SubagentTrace } from './subagent/result.js';
3
- import type { GrantManager } from '../cli/slash/commands/allow-dir.js';
3
+ import type { GrantManager } from './tools/grant-manager.js';
4
4
  export type HarnessHookEvent = 'SessionStart' | 'SessionEnd' | 'SubagentStart' | 'SubagentStop' | 'PreToolUse' | 'PostToolUse' | 'PreCompact' | 'PostToolUseFailure' | 'Stop' | 'UserPromptSubmit';
5
5
  export interface HookDecision {
6
6
  continue?: boolean;
@@ -10,7 +10,7 @@ import type { ComposeExecutor } from '../../tools/compose-executor.js';
10
10
  import type { TraceSink } from '../../trace/index.js';
11
11
  import type { AnthropicToolDef, ToolHandler } from '../../tools/types.js';
12
12
  import type { CustomToolDef } from '../../tools/custom-tool.js';
13
- import type { GrantManager } from '../../../cli/slash/commands/allow-dir.js';
13
+ import type { GrantManager } from '../../tools/grant-manager.js';
14
14
  import type { RuntimeStateSource } from '../../awareness/index.js';
15
15
  import type { SpawnedPidRegistry } from '../../tools/handlers/pid-registry.js';
16
16
  import { SessionToolDispatcher } from '../../tools/dispatcher.js';
@@ -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;
@@ -0,0 +1,20 @@
1
+ import type { DAGEdge } from '../dag.js';
2
+ export interface ComposeNodeInput {
3
+ id: string;
4
+ prompt: string;
5
+ model?: string;
6
+ max_tool_rounds?: number;
7
+ max_turns?: number;
8
+ }
9
+ export interface ComposeInput {
10
+ nodes: ComposeNodeInput[];
11
+ edges?: DAGEdge[];
12
+ fail_fast?: boolean;
13
+ node_timeout_ms?: number;
14
+ max_tool_rounds_per_node?: number;
15
+ }
16
+ export interface ParseResult {
17
+ parsed: ComposeInput;
18
+ warnings: string[];
19
+ }
20
+ export declare function parseComposeInput(input: unknown): ParseResult;
@@ -6,7 +6,7 @@ import type { SkillExecutor } from './skill-executor.js';
6
6
  import type { ComposeExecutor } from './compose-executor.js';
7
7
  import type { ToolHandler, ToolHandlerContext } from './types.js';
8
8
  import type { TraceSink } from '../trace/index.js';
9
- import type { GrantManager } from '../../cli/slash/commands/allow-dir.js';
9
+ import type { GrantManager } from './grant-manager.js';
10
10
  import type { PreDispatchGateDeps } from './dispatcher.pre-dispatch-gates.js';
11
11
  export interface CoreExecDeps {
12
12
  handlers: Map<string, ToolHandler>;
@@ -11,8 +11,7 @@ import type { ToolActivityReporter } from '../providers/shared/tool-activity.js'
11
11
  import type { SpawnedPidRegistry } from './handlers/pid-registry.js';
12
12
  import type { ToolPermissionConfig } from './permissions.js';
13
13
  import type { CanUseTool } from '../types/sdk-types.js';
14
- import { type GrantSnapshot } from './grant-manager.js';
15
- import type { GrantManager } from '../../cli/slash/commands/allow-dir.js';
14
+ import { type GrantSnapshot, type GrantManager } from './grant-manager.js';
16
15
  import type { TraceSink } from '../trace/index.js';
17
16
  export { defaultConcurrencyClassifier } from './dispatch-batching.js';
18
17
  export declare const REPEAT_CIRCUIT_BREAKER_THRESHOLD = 8;
@@ -5,7 +5,7 @@ import type { HookRegistry } from '../hooks.js';
5
5
  import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js';
6
6
  import type { CanUseTool } from '../types/sdk-types.js';
7
7
  import type { TraceSink } from '../trace/index.js';
8
- import type { GrantManager } from '../../cli/slash/commands/allow-dir.js';
8
+ import type { GrantManager } from './grant-manager.js';
9
9
  export interface PreDispatchGateMutableState {
10
10
  repeatBreaker: {
11
11
  fingerprint: string;
@@ -1,3 +1,14 @@
1
+ export interface GrantManager {
2
+ addReadRoot(absPath: string, source: 'slash' | 'tool', sessionId?: string): void;
3
+ addWriteRoot(absPath: string, source: 'slash' | 'tool', sessionId?: string): void;
4
+ revokeRoot(absPath: string, source: 'slash' | 'tool', sessionId?: string): void;
5
+ getGrants(): {
6
+ resolveBase: string | undefined;
7
+ readRoots: string[];
8
+ writeRoots: string[];
9
+ allowAll?: boolean;
10
+ };
11
+ }
1
12
  export type GrantAuditAction = 'grant-read' | 'grant-write' | 'revoke';
2
13
  export type GrantSource = 'slash' | 'tool';
3
14
  export interface GrantSnapshot {
@@ -1,7 +1,7 @@
1
1
  import type { HookContext, HookDecision } from '../../hooks.js';
2
2
  export declare const SENSITIVE_PATH_SIGNAL: RegExp;
3
3
  export interface BashRestrictionHookOptions {
4
- getGrantManager?: () => (import('../../../cli/slash/commands/allow-dir.js').GrantManager | undefined);
4
+ getGrantManager?: () => (import('../grant-manager.js').GrantManager | undefined);
5
5
  disableInterpreterGuard?: boolean;
6
6
  forceInterpreterGuard?: boolean;
7
7
  }
@@ -1,4 +1,4 @@
1
- import type { GrantManager } from '../../../cli/slash/commands/allow-dir.js';
1
+ import type { GrantManager } from '../grant-manager.js';
2
2
  import type { HookHandler } from '../../hooks.js';
3
3
  export type PathApprovalSurface = 'repl' | 'telegram' | 'web' | 'unknown';
4
4
  export interface PathApprovalHookOptions {
@@ -1,14 +1,5 @@
1
1
  import type { SlashCommand } from '../types.js';
2
- export interface GrantManager {
3
- addReadRoot(absPath: string, source: 'slash' | 'tool', sessionId?: string): void;
4
- addWriteRoot(absPath: string, source: 'slash' | 'tool', sessionId?: string): void;
5
- revokeRoot(absPath: string, source: 'slash' | 'tool', sessionId?: string): void;
6
- getGrants(): {
7
- resolveBase: string | undefined;
8
- readRoots: string[];
9
- writeRoots: string[];
10
- allowAll?: boolean;
11
- };
12
- }
2
+ import type { GrantManager } from '../../../agent/tools/grant-manager.js';
3
+ export type { GrantManager };
13
4
  export declare function setAllowDirDispatcher(manager: GrantManager): void;
14
5
  export declare const allowDirCmd: SlashCommand;