agent-afk 5.6.1 → 5.7.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.
@@ -1,4 +1,5 @@
1
1
  import Anthropic from '@anthropic-ai/sdk';
2
+ import type { CanUseTool } from '../../types/sdk-types.js';
2
3
  import type { ModelProvider, ProviderQuery, ProviderQueryArgs, ProviderCompleteArgs } from '../../provider.js';
3
4
  export { resolveEffort, resolveMaxTokens, resolveThinkingParam } from './resolve-params.js';
4
5
  import type { ToolDispatcher } from './tool-dispatcher.js';
@@ -20,6 +21,7 @@ export interface AnthropicDirectProviderOptions {
20
21
  tools?: ToolDispatcher;
21
22
  hookRegistry?: HookRegistry;
22
23
  permissions?: ToolPermissionConfig;
24
+ canUseTool?: CanUseTool;
23
25
  clientFactory?: AnthropicClientFactory;
24
26
  subagentExecutor?: SubagentExecutor;
25
27
  skillExecutor?: SkillExecutor;
@@ -40,6 +42,7 @@ export declare class AnthropicDirectProvider implements ModelProvider {
40
42
  private readonly schemas;
41
43
  private readonly hookRegistry;
42
44
  private readonly permissions;
45
+ private readonly canUseTool;
43
46
  private readonly subagentExecutor;
44
47
  private readonly composeExecutor;
45
48
  private readonly surface;
@@ -10,6 +10,7 @@ export interface ProviderRouteHints {
10
10
  export declare function providerForModel(model: string | undefined, hints?: ProviderRouteHints): BundledProviderName;
11
11
  export declare function resolveProvider(model: string | undefined, hints?: ProviderRouteHints, opts?: {
12
12
  customTools?: import('../tools/custom-tool.js').CustomToolDef[];
13
+ canUseTool?: import('../types/sdk-types.js').CanUseTool;
13
14
  }): ModelProvider;
14
15
  export { anthropicDirectProvider };
15
16
  export { AnthropicDirectProvider } from './anthropic-direct/index.js';
@@ -4,12 +4,14 @@ import type { SubagentExecutor } from '../../tools/subagent-executor.js';
4
4
  import type { SkillExecutor } from '../../tools/skill-executor.js';
5
5
  import type { ComposeExecutor } from '../../tools/compose-executor.js';
6
6
  import { type ToolPermissionConfig } from '../../tools/permissions.js';
7
+ import type { CanUseTool } from '../../types/sdk-types.js';
7
8
  import type { ToolDispatcher } from '../anthropic-direct/tool-dispatcher.js';
8
9
  import { MemoryStore } from '../../memory/index.js';
9
10
  export interface OpenAICompatibleProviderOptions {
10
11
  baseURL?: string;
11
12
  hookRegistry?: HookRegistry;
12
13
  permissions?: ToolPermissionConfig;
14
+ canUseTool?: CanUseTool;
13
15
  subagentExecutor?: SubagentExecutor;
14
16
  skillExecutor?: SkillExecutor;
15
17
  composeExecutor?: ComposeExecutor;
@@ -7,6 +7,7 @@ import type { SkillExecutor } from './skill-executor.js';
7
7
  import type { ComposeExecutor } from './compose-executor.js';
8
8
  import type { ToolHandler, ConcurrencyClassifier } from './types.js';
9
9
  import { type ToolPermissionConfig } from './permissions.js';
10
+ import type { CanUseTool } from '../types/sdk-types.js';
10
11
  import type { TraceWriter } from '../trace/index.js';
11
12
  export declare function defaultConcurrencyClassifier(toolName: string): boolean;
12
13
  export declare const REPEAT_CIRCUIT_BREAKER_THRESHOLD = 8;
@@ -15,6 +16,7 @@ export interface SessionToolDispatcherOptions {
15
16
  schemas: AnthropicToolDef[];
16
17
  hookRegistry: HookRegistry | undefined;
17
18
  permissions?: ToolPermissionConfig;
19
+ canUseTool?: CanUseTool;
18
20
  subagentExecutor?: SubagentExecutor;
19
21
  skillExecutor?: SkillExecutor;
20
22
  composeExecutor?: ComposeExecutor;
@@ -34,6 +36,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
34
36
  private readonly schemas;
35
37
  private readonly hookRegistry;
36
38
  private readonly permissions;
39
+ private readonly canUseTool;
37
40
  private readonly subagentExecutor;
38
41
  private readonly skillExecutor;
39
42
  private readonly composeExecutor;
@@ -66,6 +69,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
66
69
  get toolDefs(): readonly AnthropicToolDef[];
67
70
  private checkReadOnlyBash;
68
71
  private checkRepeatCircuitBreaker;
72
+ private runCanUseTool;
69
73
  execute(call: ToolCall): Promise<ToolResult>;
70
74
  executeBatch(calls: ToolCall[]): Promise<ToolResult[]>;
71
75
  private executeCore;