agent-afk 5.19.4 → 5.20.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.
@@ -0,0 +1,2 @@
1
+ import type { RegisteredAgent } from './types.js';
2
+ export declare function builtinAgents(): Map<string, RegisteredAgent>;
@@ -0,0 +1,6 @@
1
+ export type { AgentRegistry, AgentSource, RegisteredAgent, ResolvedAgentToolAccess, } from './types.js';
2
+ export { parseAgentMarkdown, type ParsedAgentFile } from './parser.js';
3
+ export { resolveAgentToolAccess } from './resolve.js';
4
+ export { builtinAgents } from './builtins.js';
5
+ export { loadAgentRegistry, type LoadAgentRegistryOptions } from './registry.js';
6
+ export { buildAgentToolDef } from './tool-def.js';
@@ -0,0 +1,8 @@
1
+ import type { AgentDefinition } from '../types/sdk-types.js';
2
+ export interface ParsedAgentFile {
3
+ name: string;
4
+ definition: AgentDefinition;
5
+ bashReadOnly?: boolean;
6
+ ignoredKeys?: string[];
7
+ }
8
+ export declare function parseAgentMarkdown(content: string, warn?: (message: string) => void): ParsedAgentFile | undefined;
@@ -0,0 +1,8 @@
1
+ import type { AgentDefinition } from '../types/sdk-types.js';
2
+ import type { AgentRegistry } from './types.js';
3
+ export interface LoadAgentRegistryOptions {
4
+ cwd?: string;
5
+ configAgents?: Record<string, AgentDefinition>;
6
+ warn?: (message: string) => void;
7
+ }
8
+ export declare function loadAgentRegistry(options?: LoadAgentRegistryOptions): AgentRegistry;
@@ -0,0 +1,2 @@
1
+ import type { RegisteredAgent, ResolvedAgentToolAccess } from './types.js';
2
+ export declare function resolveAgentToolAccess(agent: RegisteredAgent, inheritPool: readonly string[]): ResolvedAgentToolAccess;
@@ -0,0 +1,3 @@
1
+ import type { AnthropicToolDef } from '../tools/types.js';
2
+ import type { AgentRegistry } from './types.js';
3
+ export declare function buildAgentToolDef(registry: AgentRegistry | undefined): AnthropicToolDef;
@@ -0,0 +1,16 @@
1
+ import type { AgentDefinition } from '../types/sdk-types.js';
2
+ export type AgentSource = 'builtin' | 'user' | 'project' | 'config' | `plugin:${string}`;
3
+ export interface RegisteredAgent {
4
+ name: string;
5
+ definition: AgentDefinition;
6
+ source: AgentSource;
7
+ filePath?: string;
8
+ bashReadOnly?: boolean;
9
+ ignoredKeys?: string[];
10
+ }
11
+ export type AgentRegistry = ReadonlyMap<string, RegisteredAgent>;
12
+ export interface ResolvedAgentToolAccess {
13
+ allowedTools: string[] | undefined;
14
+ bashReadOnly: boolean;
15
+ droppedTokens: string[];
16
+ }
@@ -6,6 +6,7 @@ import { SkillExecutor } from './skill-executor.js';
6
6
  import type { SubagentExecutor } from './subagent-executor.js';
7
7
  import type { TraceWriter } from '../trace/index.js';
8
8
  import type { BackgroundAgentRegistry } from '../background-registry.js';
9
+ import type { AgentRegistry } from '../agents/types.js';
9
10
  export declare const DEFAULT_MAX_NESTING_DEPTH = 3;
10
11
  export interface ChildProviderFactoryArgs {
11
12
  childExecutor: SubagentExecutor;
@@ -18,12 +19,13 @@ export declare function createStubParentSession(signal: AbortSignal): Pick<IAgen
18
19
  export declare const CHILD_ALLOWED_TOOLS: string[];
19
20
  export declare const RECON_ALLOWED_TOOLS: readonly string[];
20
21
  export declare const DEFAULT_READ_ONLY_SKILLS: ReadonlySet<string>;
22
+ export declare const DEFAULT_FORK_SKILLS: ReadonlySet<string>;
21
23
  export interface CreateChildProviderFactoryOptions {
22
24
  openaiBaseUrl?: string;
23
25
  }
24
26
  export declare function createChildProviderFactory(opts?: CreateChildProviderFactoryOptions): (args: ChildProviderFactoryArgs) => ModelProvider;
25
27
  export declare function buildReadOnlyReconProvider(model: AgentModelInput | undefined): ModelProvider;
26
- export declare function createChildSkillExecutorFactory(defaultModel: AgentModelInput, apiKey: string | undefined, childProviderFactory: (args: ChildProviderFactoryArgs) => ModelProvider, baseUrl?: string, traceWriter?: TraceWriter, backgroundRegistry?: BackgroundAgentRegistry, cwd?: string, resolveApiKeyForModel?: (model: string) => string | undefined, surface?: Surface, defaultSubagentModel?: AgentModelInput): (depth: number, maxDepth: number, signal: AbortSignal) => SkillExecutor;
28
+ export declare function createChildSkillExecutorFactory(defaultModel: AgentModelInput, apiKey: string | undefined, childProviderFactory: (args: ChildProviderFactoryArgs) => ModelProvider, baseUrl?: string, traceWriter?: TraceWriter, backgroundRegistry?: BackgroundAgentRegistry, cwd?: string, resolveApiKeyForModel?: (model: string) => string | undefined, surface?: Surface, defaultSubagentModel?: AgentModelInput, agentRegistry?: AgentRegistry): (depth: number, maxDepth: number, signal: AbortSignal) => SkillExecutor;
27
29
  export type PhaseRole = 'read-only' | 'read-write';
28
- export declare function buildSkillRestrictedProvider(allowedTools: string[], model: AgentModelInput | undefined): ModelProvider;
30
+ export declare function buildSkillRestrictedProvider(allowedTools: string[], model: AgentModelInput | undefined, readOnlyBash?: boolean): ModelProvider;
29
31
  export declare function buildPhaseRestrictedProvider(_role: 'read-only', model: AgentModelInput | undefined): ModelProvider;
@@ -22,6 +22,7 @@ export interface SkillExecutorContext {
22
22
  traceWriter?: TraceWriter;
23
23
  backgroundRegistry?: BackgroundAgentRegistry;
24
24
  cwd?: string;
25
+ agentRegistry?: import('../agents/index.js').AgentRegistry;
25
26
  }
26
27
  export declare class SkillExecutor {
27
28
  private readonly ctx;
@@ -3,8 +3,9 @@ import { BackgroundAgentRegistry } from '../background-registry.js';
3
3
  import type { ModelProvider } from '../provider.js';
4
4
  import type { AgentModelInput, IAgentSession } from '../types.js';
5
5
  import type { AgentConfig } from '../types/config-types.js';
6
- import type { ToolCall, ToolResult } from './types.js';
6
+ import type { AnthropicToolDef, ToolCall, ToolResult } from './types.js';
7
7
  import { type ChildProviderFactoryArgs } from './nesting.js';
8
+ import type { AgentRegistry } from '../agents/index.js';
8
9
  import type { SkillExecutor } from './skill-executor.js';
9
10
  import type { Surface } from '../awareness/types.js';
10
11
  export { DEFAULT_MAX_NESTING_DEPTH, type ChildProviderFactoryArgs } from './nesting.js';
@@ -23,6 +24,8 @@ export interface SubagentExecutorContext {
23
24
  cwd?: string;
24
25
  allowedTools?: string[];
25
26
  readOnlyBash?: boolean;
27
+ agentRegistry?: AgentRegistry;
28
+ parentModel?: AgentModelInput;
26
29
  }
27
30
  export type AgentExecutionMode = 'foreground' | 'background';
28
31
  export interface PromotedSubagentInfo {
@@ -40,6 +43,7 @@ export declare class SubagentExecutor implements SubagentControl {
40
43
  private currentCwd;
41
44
  constructor(ctx: SubagentExecutorContext);
42
45
  setCwd(cwd: string): void;
46
+ describeAgentTool(): AnthropicToolDef;
43
47
  private readonly promotionTriggers;
44
48
  private readonly activeForegroundHandles;
45
49
  hasPromotableForeground(): boolean;