agent-afk 5.133.0 → 5.135.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.
@@ -2,6 +2,7 @@ import type { CanUseTool } from '../../types/sdk-types.js';
2
2
  import type { PlanExitControls } from '../../types/config-types.js';
3
3
  import type { HookRegistry } from '../../hooks.js';
4
4
  import type { MemoryStore } from '../../memory/index.js';
5
+ import type { WorkspaceStore } from '../../workspace/workspace-store.js';
5
6
  import type { SubagentExecutor } from '../../tools/subagent-executor.js';
6
7
  import type { SkillExecutor } from '../../tools/skill-executor.js';
7
8
  import type { ComposeExecutor } from '../../tools/compose-executor.js';
@@ -28,6 +29,7 @@ export interface BuildDispatcherOptions {
28
29
  }
29
30
  export interface BuildDispatcherDeps {
30
31
  memoryStore: MemoryStore;
32
+ workspaceStore: WorkspaceStore;
31
33
  surface: string;
32
34
  readOnlyMemory: boolean;
33
35
  readOnlyBash: boolean;
@@ -2,6 +2,7 @@ import type Anthropic from '@anthropic-ai/sdk';
2
2
  import type { CanUseTool } from '../../types/sdk-types.js';
3
3
  import type { HookRegistry } from '../../hooks.js';
4
4
  import type { MemoryStore } from '../../memory/index.js';
5
+ import type { WorkspaceStore } from '../../workspace/workspace-store.js';
5
6
  import type { SubagentExecutor } from '../../tools/subagent-executor.js';
6
7
  import type { SkillExecutor } from '../../tools/skill-executor.js';
7
8
  import type { ComposeExecutor } from '../../tools/compose-executor.js';
@@ -29,6 +30,7 @@ export interface AnthropicDirectProviderOptions {
29
30
  skillExecutor?: SkillExecutor;
30
31
  composeExecutor?: ComposeExecutor;
31
32
  memoryStore?: MemoryStore;
33
+ workspaceStore?: WorkspaceStore;
32
34
  surface?: string;
33
35
  readOnlyMemory?: boolean;
34
36
  readOnlyBash?: boolean;
@@ -8,6 +8,7 @@ export declare class AnthropicDirectProvider implements ModelProvider {
8
8
  readonly name = "anthropic-direct";
9
9
  private readonly externalTools;
10
10
  private readonly memoryStore;
11
+ private readonly workspaceStore;
11
12
  private readonly providerFactory?;
12
13
  private readonly skillExecutor?;
13
14
  private readonly schemas;
@@ -7,6 +7,7 @@ import { type ToolPermissionConfig } from '../../tools/permissions.js';
7
7
  import type { CanUseTool } from '../../types/sdk-types.js';
8
8
  import type { ToolDispatcher } from '../anthropic-direct/tool-dispatcher.js';
9
9
  import { MemoryStore } from '../../memory/index.js';
10
+ import { WorkspaceStore } from '../../workspace/index.js';
10
11
  export interface OpenAICompatibleProviderOptions {
11
12
  baseURL?: string;
12
13
  defaultHeaders?: Record<string, string>;
@@ -17,6 +18,7 @@ export interface OpenAICompatibleProviderOptions {
17
18
  skillExecutor?: SkillExecutor;
18
19
  composeExecutor?: ComposeExecutor;
19
20
  memoryStore?: MemoryStore;
21
+ workspaceStore?: WorkspaceStore;
20
22
  surface?: string;
21
23
  readOnlyMemory?: boolean;
22
24
  readOnlyBash?: boolean;
@@ -28,6 +30,7 @@ export declare class OpenAICompatibleProvider implements ModelProvider {
28
30
  readonly name = "openai-compatible";
29
31
  private readonly providerOpts;
30
32
  private readonly memoryStore;
33
+ private readonly workspaceStore;
31
34
  private readonly schemas;
32
35
  private _defaultHeaders;
33
36
  private _sharedReadRoots;
@@ -5,6 +5,7 @@ import type { TraceSink } from '../trace/index.js';
5
5
  import type { Surface } from '../awareness/types.js';
6
6
  import type { HookRegistry } from '../hooks.js';
7
7
  import type { ForkSubagentOptions } from './fork-types.js';
8
+ import type { WorkspaceStore } from '../workspace/workspace-store.js';
8
9
  export interface AssembleChildConfigArgs<T> {
9
10
  options: ForkSubagentOptions<T>;
10
11
  id: string;
@@ -15,6 +16,7 @@ export interface AssembleChildConfigArgs<T> {
15
16
  inheritedReadRoots: string[] | undefined;
16
17
  composedWriteRoots: string[] | undefined;
17
18
  childController: AbortController;
19
+ workspaceStore?: WorkspaceStore;
18
20
  parentCwd: string | undefined;
19
21
  parentApiKey: string | undefined;
20
22
  parentBaseUrl: string | undefined;
@@ -1,5 +1,6 @@
1
1
  import type { ZodType } from 'zod';
2
2
  import type { CanUseTool } from '../types/sdk-types.js';
3
+ import type { WorkspaceStore } from '../workspace/workspace-store.js';
3
4
  import type { HookRegistry } from '../hooks.js';
4
5
  import type { AgentConfig, IAgentSession } from '../types.js';
5
6
  import type { SubagentProgressSink } from '../types/session-types.js';
@@ -35,4 +36,5 @@ export interface SubagentManagerOptions {
35
36
  traceWriter?: TraceSink;
36
37
  surface?: Surface;
37
38
  onSubagentSucceeded?: (usage: import('./result.js').SubagentTrace['usage'], costUsd: number | undefined) => void;
39
+ workspaceStore?: WorkspaceStore;
38
40
  }
@@ -23,6 +23,7 @@ export declare class SubagentManager {
23
23
  private parentTraceWriter;
24
24
  private readonly parentSurface;
25
25
  private readonly parentAbortSignal;
26
+ private readonly workspaceStore;
26
27
  private readonly abortGraph;
27
28
  private readonly rootId;
28
29
  private rootController;
@@ -3,6 +3,7 @@ import type { ModelProvider } from '../provider.js';
3
3
  import type { AgentModelInput } from '../types.js';
4
4
  import type { Surface } from '../awareness/types.js';
5
5
  import type { ReadScopeInputs } from '../subagent-read-scope.js';
6
+ import type { WorkspaceStore } from '../workspace/workspace-store.js';
6
7
  import { SkillExecutor } from './skill-executor.js';
7
8
  import type { SubagentExecutor } from './subagent-executor.js';
8
9
  import type { TraceSink } from '../trace/index.js';
@@ -24,6 +25,7 @@ export declare const RECON_ALLOWED_TOOLS: readonly string[];
24
25
  export declare const DEFAULT_READ_ONLY_SKILLS: ReadonlySet<string>;
25
26
  export interface CreateChildProviderFactoryOptions {
26
27
  openaiBaseUrl?: string;
28
+ workspaceStore?: WorkspaceStore;
27
29
  }
28
30
  export declare function createChildProviderFactory(opts?: CreateChildProviderFactoryOptions): (args: ChildProviderFactoryArgs) => ModelProvider;
29
31
  export declare function buildReadOnlyReconProvider(model: AgentModelInput | undefined, openaiBaseUrl?: string, allowedTools?: readonly string[]): ModelProvider;
@@ -4,6 +4,7 @@ export declare const ToolCallStartedPayloadSchema: z.ZodObject<{
4
4
  toolUseId: z.ZodString;
5
5
  name: z.ZodString;
6
6
  inputBytes: z.ZodNumber;
7
+ argsFingerprint: z.ZodOptional<z.ZodString>;
7
8
  subagentId: z.ZodOptional<z.ZodString>;
8
9
  }, z.core.$strip>;
9
10
  export declare const ToolFailureClassSchema: z.ZodEnum<{
@@ -50,6 +51,7 @@ export declare const ToolCallPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject
50
51
  toolUseId: z.ZodString;
51
52
  name: z.ZodString;
52
53
  inputBytes: z.ZodNumber;
54
+ argsFingerprint: z.ZodOptional<z.ZodString>;
53
55
  subagentId: z.ZodOptional<z.ZodString>;
54
56
  }, z.core.$strip>, z.ZodObject<{
55
57
  phase: z.ZodLiteral<"completed">;
@@ -589,6 +591,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
589
591
  toolUseId: z.ZodString;
590
592
  name: z.ZodString;
591
593
  inputBytes: z.ZodNumber;
594
+ argsFingerprint: z.ZodOptional<z.ZodString>;
592
595
  subagentId: z.ZodOptional<z.ZodString>;
593
596
  }, z.core.$strip>, z.ZodObject<{
594
597
  phase: z.ZodLiteral<"completed">;
@@ -924,6 +927,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
924
927
  toolUseId: z.ZodString;
925
928
  name: z.ZodString;
926
929
  inputBytes: z.ZodNumber;
930
+ argsFingerprint: z.ZodOptional<z.ZodString>;
927
931
  subagentId: z.ZodOptional<z.ZodString>;
928
932
  }, z.core.$strip>, z.ZodObject<{
929
933
  phase: z.ZodLiteral<"completed">;
@@ -4,6 +4,7 @@ export interface ToolCallStartedPayload {
4
4
  toolUseId: string;
5
5
  name: string;
6
6
  inputBytes: number;
7
+ argsFingerprint?: string;
7
8
  subagentId?: string;
8
9
  }
9
10
  export declare const TOOL_FAILURE_CLASSES: readonly ["policy-refusal", "timeout", "budget", "permission-denied", "hook-block", "abort", "elicitation-declined", "denial-breaker", "repeat-failure", "no-such-target"];
@@ -0,0 +1,4 @@
1
+ export { WorkspaceStore, } from './workspace-store.js';
2
+ export type { WorkspaceEntryType, WorkspaceEntry, WorkspacePublishInput, WorkspaceRelationType, } from './workspace-store.js';
3
+ export { workspacePublishTool, workspaceToolSchemas, createWorkspaceHandlers, } from './workspace-tools.js';
4
+ export { renderWorkspacePreamble, injectWorkspacePreamble, } from './workspace-preamble.js';
@@ -0,0 +1,4 @@
1
+ import type { AgentConfig } from '../types/config-types.js';
2
+ import type { WorkspaceEntry } from './workspace-store.js';
3
+ export declare function renderWorkspacePreamble(entries: WorkspaceEntry[]): string;
4
+ export declare function injectWorkspacePreamble(config: AgentConfig, entries: WorkspaceEntry[]): AgentConfig;
@@ -0,0 +1,37 @@
1
+ export type WorkspaceEntryType = 'finding' | 'evidence' | 'hypothesis' | 'decision' | 'artifact' | 'status';
2
+ export type WorkspaceRelationType = 'supports' | 'contradicts' | 'depends_on' | 'supersedes';
3
+ export interface WorkspaceEntry {
4
+ id: number;
5
+ session_id: string;
6
+ type: WorkspaceEntryType;
7
+ subject: string | null;
8
+ content: string;
9
+ evidence: string | null;
10
+ confidence: number;
11
+ agent_id: string | null;
12
+ relates_to: string | null;
13
+ relation_type: WorkspaceRelationType | null;
14
+ created_at: string;
15
+ seq: number;
16
+ }
17
+ export interface WorkspacePublishInput {
18
+ session_id: string;
19
+ type: WorkspaceEntryType;
20
+ subject?: string;
21
+ content: string;
22
+ evidence?: string[];
23
+ confidence?: number;
24
+ agent_id?: string;
25
+ relates_to?: number[];
26
+ relation_type?: WorkspaceRelationType;
27
+ }
28
+ export declare class WorkspaceStore {
29
+ private readonly db;
30
+ constructor(dbPath?: string);
31
+ private enableWalMode;
32
+ publish(entry: WorkspacePublishInput): number;
33
+ queryRelevant(sessionId: string | null, taskPrompt: string, limit?: number): WorkspaceEntry[];
34
+ queryAll(sessionId: string): WorkspaceEntry[];
35
+ close(): void;
36
+ private nextSeq;
37
+ }
@@ -0,0 +1,5 @@
1
+ import type { AnthropicToolDef, ToolHandler } from '../tools/types.js';
2
+ import { WorkspaceStore } from './workspace-store.js';
3
+ export declare const workspacePublishTool: AnthropicToolDef;
4
+ export declare const workspaceToolSchemas: AnthropicToolDef[];
5
+ export declare function createWorkspaceHandlers(store: WorkspaceStore, sessionId: string, agentId?: string): Map<string, ToolHandler>;
@@ -1,5 +1,6 @@
1
1
  import type { ModelProvider } from '../../../agent/provider.js';
2
2
  import type { MemoryStore } from '../../../agent/memory/index.js';
3
+ import type { WorkspaceStore } from '../../../agent/workspace/workspace-store.js';
3
4
  import type { SubagentExecutor } from '../../../agent/tools/subagent-executor.js';
4
5
  import type { SkillExecutor } from '../../../agent/tools/skill-executor.js';
5
6
  import type { ComposeExecutor } from '../../../agent/tools/compose-executor.js';
@@ -15,6 +16,7 @@ export declare function createReplProviders(a: {
15
16
  skillExecutor: SkillExecutor;
16
17
  composeExecutor: ComposeExecutor;
17
18
  memoryStore: MemoryStore;
19
+ workspaceStore?: WorkspaceStore;
18
20
  mcpManager: McpManager | undefined;
19
21
  fastModeController: FastModeController;
20
22
  }): {
@@ -4,6 +4,7 @@ export type ParseProviderOptions = {
4
4
  skillExecutor?: import('../agent/tools/skill-executor.js').SkillExecutor;
5
5
  composeExecutor?: import('../agent/tools/compose-executor.js').ComposeExecutor;
6
6
  memoryStore?: import('../agent/memory/index.js').MemoryStore;
7
+ workspaceStore?: import('../agent/workspace/workspace-store.js').WorkspaceStore;
7
8
  mcpManager?: import('../agent/mcp/index.js').McpManager;
8
9
  model?: string;
9
10
  openaiBaseUrl?: string;