agent-afk 5.303.8 → 5.303.10

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.
package/README.md CHANGED
@@ -22,7 +22,7 @@ Open source. Runs locally. Works with any model provider, including local models
22
22
  ## Quick Start
23
23
 
24
24
  ```bash
25
- npm install -g agent-afk # Node ≥ 22.13 required
25
+ npm install -g agent-afk # Node 22.22.2+, 24.15+, or 26+
26
26
  afk login # authenticate (auto-detects Claude Code / Codex creds)
27
27
  afk doctor # verify everything works
28
28
  afk chat "hello" # first real conversation
@@ -1,4 +1,5 @@
1
1
  export type PeerInboundMode = 'accept' | 'hold' | 'off';
2
+ export declare const RAW_VALUE_CAP = 20;
2
3
  export interface PeerInboundModeConfig {
3
4
  mode: PeerInboundMode;
4
5
  invalid: boolean;
@@ -0,0 +1 @@
1
+ export declare function escapeXml(text: string): string;
@@ -30,7 +30,7 @@ export interface TurnResult {
30
30
  usage: Usage | null;
31
31
  text: string;
32
32
  }
33
- export type ToolCategory = 'read' | 'write' | 'shell' | 'subagent' | 'skill' | 'dag' | 'mcp' | 'web' | 'browser' | 'planning' | 'schedule' | 'other';
33
+ export type ToolCategory = 'read' | 'write' | 'shell' | 'subagent' | 'peer' | 'skill' | 'dag' | 'mcp' | 'web' | 'browser' | 'planning' | 'schedule' | 'other';
34
34
  export interface AnthropicToolDef {
35
35
  name: string;
36
36
  description?: string;
@@ -3,3 +3,4 @@ import type { OpenAIMessage } from './messages.js';
3
3
  export declare const OPENAI_COMPATIBLE_ORIGIN = "openai-compatible";
4
4
  export declare const INTERRUPTED_TOOL_RESULT: string;
5
5
  export declare const openAIJournalAdapter: JournalAdapter<OpenAIMessage>;
6
+ export declare function openAIJournalAdapterForEndpoint(baseURL?: string): JournalAdapter<OpenAIMessage>;
@@ -5,7 +5,8 @@ import type { JournalMessage } from '../../../journal/index.js';
5
5
  export declare class OpenAIJournalWiring {
6
6
  private readonly config;
7
7
  private readonly journalSync;
8
- constructor(config: AgentConfig);
8
+ private readonly adapter;
9
+ constructor(config: AgentConfig, baseURL?: string);
9
10
  initialTurns(): OpenAIMessage[];
10
11
  resumedUsage(): ProviderUsage | null;
11
12
  legacyResumeHistory(): {
@@ -1,6 +1,7 @@
1
1
  import type { ToolCategory } from './providers/anthropic-direct/types.js';
2
2
  export type { ToolCategory };
3
3
  export declare const SUBAGENT_TOOLS: Set<string>;
4
+ export declare const PEER_TOOLS: Set<string>;
4
5
  export declare const SKILL_TOOLS: Set<string>;
5
6
  export declare const DAG_TOOLS: Set<string>;
6
7
  export declare const NESTING_TOOLS: Set<string>;
@@ -93,6 +93,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
93
93
  setAllowAll(allow: boolean): void;
94
94
  setResolveBase(newCwd: string): void;
95
95
  get toolDefs(): readonly AnthropicToolDef[];
96
+ private readonly preToolContext;
96
97
  private gateDeps;
97
98
  private coreExecDeps;
98
99
  private runPreDispatchGates;
@@ -31,6 +31,7 @@ export interface PreDispatchGateDeps {
31
31
  resolveBase: string | undefined;
32
32
  traceWriter: TraceSink | undefined;
33
33
  isRegisteredTool: (toolName: string) => boolean;
34
+ capturePreToolContext?: (call: ToolCall, context: string) => void;
34
35
  denialReason: (toolName: string, permissionReason: string | undefined) => string;
35
36
  }
36
37
  export declare function emitPreToolUseBlock(blockedTool: string, reason: string, deps: PreDispatchGateDeps): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import type { ChildProcess } from 'node:child_process';
2
+ import { killProcessGroup } from '../../../utils/kill-process-group.js';
3
+ export declare const BASH_KILL_PIPE_GRACE_MS = 5000;
4
+ export declare function killBashProcess(proc: ChildProcess, platform?: NodeJS.Platform, kill?: typeof killProcessGroup): void;
@@ -0,0 +1,7 @@
1
+ import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js';
2
+ import type { TraceSink } from '../trace/index.js';
3
+ export declare class PreToolContext {
4
+ private readonly pending;
5
+ capture(call: ToolCall, context: string): void;
6
+ deliver(call: ToolCall, result: ToolResult, writer?: TraceSink): Promise<ToolResult>;
7
+ }
@@ -1,3 +1 @@
1
- import type { ToolResult } from './types.js';
2
1
  export declare function collectPostRunWarnings(model: string, hasAttachments: boolean, agentName: string | undefined, prompt: string, childWriteCapable: boolean, supportsVisionFn: (m: string) => boolean): string;
3
- export declare function applyPostRunNotices(result: ToolResult, model: string, hasAttachments: boolean, agentName: string | undefined, prompt: string, childWriteCapable: boolean, usageNotice: string | undefined): void;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export { BackgroundAgentCancelledPayloadSchema, BackgroundAgentCompletedPayloadSchema, BackgroundAgentDeliveredPayloadSchema, BackgroundAgentFailedPayloadSchema, BackgroundAgentJoinedPayloadSchema, BackgroundAgentStartedPayloadSchema, } from './background-agent-schema.js';
3
- export { SubagentStartedPayloadSchema, SubagentSucceededPayloadSchema, SubagentFailedPayloadSchema, SubagentCancelledPayloadSchema, SubagentLifecyclePayloadSchema, } from './events.subagent-lifecycle.js';
3
+ export { ToolFailureClassSchema, SubagentStartedPayloadSchema, SubagentSucceededPayloadSchema, SubagentFailedPayloadSchema, SubagentCancelledPayloadSchema, SubagentLifecyclePayloadSchema, } from './events.subagent-lifecycle.js';
4
4
  export { BrowserEventToolSchema, BrowserActActionSchema, BrowserEventTargetSchema, BrowserEventPayloadSchema, } from './events.browser.js';
5
5
  export { CompactionTriggerSchema, CompactionSidecarRefSchema, CompactionPayloadInputSchema, CompactionPayloadPersistedSchema, } from './events.compaction.js';
6
6
  export { SessionPhaseNameSchema, SessionPhasePayloadSchema } from './events.session-phase.js';
@@ -13,18 +13,6 @@ export declare const ToolCallStartedPayloadSchema: z.ZodObject<{
13
13
  resourceFingerprint: z.ZodOptional<z.ZodString>;
14
14
  subagentId: z.ZodOptional<z.ZodString>;
15
15
  }, z.core.$strip>;
16
- export declare const ToolFailureClassSchema: z.ZodEnum<{
17
- budget: "budget";
18
- abort: "abort";
19
- "policy-refusal": "policy-refusal";
20
- timeout: "timeout";
21
- "permission-denied": "permission-denied";
22
- "hook-block": "hook-block";
23
- "elicitation-declined": "elicitation-declined";
24
- "denial-breaker": "denial-breaker";
25
- "repeat-failure": "repeat-failure";
26
- "no-such-target": "no-such-target";
27
- }>;
28
16
  export declare const ToolCallCompletedPayloadSchema: z.ZodObject<{
29
17
  phase: z.ZodLiteral<"completed">;
30
18
  toolUseId: z.ZodString;
@@ -1,13 +1,11 @@
1
1
  import type { ScheduledTask } from '../../agent/daemon/triggers.js';
2
2
  import type { CliConfig } from '../config/types.js';
3
+ import type { EnvObject } from '../../config/env.js';
3
4
  export declare function buildWorktreePruneTask(cron: string): ScheduledTask;
4
5
  export declare function buildToolHealthTask(cron: string): ScheduledTask;
5
6
  export declare function appendBuiltinTasks(tasks: ScheduledTask[], config: {
6
7
  daemon?: CliConfig['daemon'];
7
- }, env: {
8
- AFK_WORKTREE_PRUNE_DISABLE?: string;
9
- AFK_TOOL_HEALTH_DISABLE?: string;
10
- }): {
8
+ }, env: Pick<EnvObject, 'AFK_WORKTREE_PRUNE_DISABLE' | 'AFK_TOOL_HEALTH_DISABLE'>): {
11
9
  worktreePruneCron: string;
12
10
  toolHealthCron: string;
13
11
  worktreePruneEnabled: boolean;
@@ -1,6 +1,6 @@
1
1
  import { type ChalkInstance } from 'chalk';
2
- import { categorizeTool, dispatchTagForCategory, SUBAGENT_TOOLS, SKILL_TOOLS, DAG_TOOLS, NESTING_TOOLS, type ToolCategory } from '../agent/tool-category.js';
3
- export { categorizeTool, dispatchTagForCategory, SUBAGENT_TOOLS, SKILL_TOOLS, DAG_TOOLS, NESTING_TOOLS, type ToolCategory, };
2
+ import { categorizeTool, dispatchTagForCategory, SUBAGENT_TOOLS, PEER_TOOLS, SKILL_TOOLS, DAG_TOOLS, NESTING_TOOLS, type ToolCategory } from '../agent/tool-category.js';
3
+ export { categorizeTool, dispatchTagForCategory, SUBAGENT_TOOLS, PEER_TOOLS, SKILL_TOOLS, DAG_TOOLS, NESTING_TOOLS, type ToolCategory, };
4
4
  export declare const CATEGORY_HUMAN_VERB: Record<ToolCategory, string>;
5
5
  export declare const TOOL_VERB_OVERRIDES: Partial<Record<string, string>>;
6
6
  export declare function humanVerbForTool(toolName: string): string;