agent-afk 5.197.1 → 5.198.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.
- package/dist/agent/providers/anthropic-direct/build-dispatcher.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/provider-options.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/provider-runtime.d.ts +2 -0
- package/dist/agent/subagent/handle.d.ts +5 -0
- package/dist/agent/subagent/workspace-subscription-wiring.d.ts +11 -0
- package/dist/agent/tools/nesting.d.ts +1 -0
- package/dist/agent/trace/types.d.ts +1 -1
- package/dist/agent/workspace/index.d.ts +4 -1
- package/dist/agent/workspace/workspace-store.d.ts +4 -0
- package/dist/agent/workspace/workspace-subscription-constants.d.ts +2 -0
- package/dist/agent/workspace/workspace-subscription.d.ts +12 -0
- package/dist/agent/workspace/workspace-tools.d.ts +2 -1
- package/dist/cli.mjs +665 -659
- package/dist/index.mjs +243 -237
- package/dist/telegram.mjs +319 -313
- package/package.json +1 -1
|
@@ -51,5 +51,6 @@ export interface BuildDispatcherDeps {
|
|
|
51
51
|
setMcpToolsCache: (value: AnthropicToolDef[] | null) => void;
|
|
52
52
|
getMcpHandlersCache: () => Map<string, ToolHandler> | null;
|
|
53
53
|
setMcpHandlersCache: (value: Map<string, ToolHandler> | null) => void;
|
|
54
|
+
subscribeHandler?: ToolHandler;
|
|
54
55
|
}
|
|
55
56
|
export declare function buildDispatcher(deps: BuildDispatcherDeps, permissionMode: string, opts?: BuildDispatcherOptions): SessionToolDispatcher;
|
|
@@ -32,6 +32,7 @@ export interface AnthropicDirectProviderOptions {
|
|
|
32
32
|
composeExecutor?: ComposeExecutor;
|
|
33
33
|
memoryStore?: MemoryStore;
|
|
34
34
|
workspaceStore?: WorkspaceStore;
|
|
35
|
+
subscribeHandler?: import('../../tools/types.js').ToolHandler;
|
|
35
36
|
stateStore?: StateStore;
|
|
36
37
|
surface?: string;
|
|
37
38
|
readOnlyMemory?: boolean;
|
|
@@ -9,6 +9,7 @@ export declare class AnthropicDirectProvider implements ModelProvider {
|
|
|
9
9
|
private readonly externalTools;
|
|
10
10
|
private readonly memoryStore;
|
|
11
11
|
private readonly workspaceStore;
|
|
12
|
+
private subscribeHandler;
|
|
12
13
|
private readonly stateStore;
|
|
13
14
|
private readonly providerFactory?;
|
|
14
15
|
private readonly skillExecutor?;
|
|
@@ -33,6 +34,7 @@ export declare class AnthropicDirectProvider implements ModelProvider {
|
|
|
33
34
|
private readonly _spawnedPidRegistry;
|
|
34
35
|
constructor(opts?: AnthropicDirectProviderOptions);
|
|
35
36
|
private buildDispatcher;
|
|
37
|
+
setSubscribeHandler(handler: import('../../tools/types.js').ToolHandler): void;
|
|
36
38
|
close(): void;
|
|
37
39
|
complete(args: ProviderCompleteArgs): Promise<string>;
|
|
38
40
|
addReadRoot(absPath: string, source?: 'slash' | 'tool', sessionId?: string): void;
|
|
@@ -6,6 +6,7 @@ import type { IAgentSession, Message } from '../types.js';
|
|
|
6
6
|
import type { OutputEvent, SubagentProgressSink, SubagentProgressMeta } from '../types/session-types.js';
|
|
7
7
|
import type { TraceSink } from '../trace/index.js';
|
|
8
8
|
import { PauseAwareCeiling } from './pause-ceiling.js';
|
|
9
|
+
import type { WorkspaceEntry, WorkspaceStore } from '../workspace/workspace-store.js';
|
|
9
10
|
import { type SubagentResult, type SubagentStatus, type SubagentTrace } from './result.js';
|
|
10
11
|
export type { SubagentProgressMeta };
|
|
11
12
|
export interface SubagentHandle<T = unknown> {
|
|
@@ -72,7 +73,11 @@ export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
|
|
|
72
73
|
sendMessage(text: string): void;
|
|
73
74
|
readonly _steeringMessages: string[];
|
|
74
75
|
readonly _progressEvents: import('../tools/subagent/emit-progress.js').ProgressEventPayload[];
|
|
76
|
+
readonly _pendingWorkspaceEntries: WorkspaceEntry[];
|
|
77
|
+
_workspaceDroppedSinceDrain: number;
|
|
78
|
+
_workspaceStore: WorkspaceStore | undefined;
|
|
75
79
|
steer(text: string): void;
|
|
76
80
|
emitProgress(payload: import('../tools/subagent/emit-progress.js').ProgressEventPayload): void;
|
|
81
|
+
private _drainWorkspaceDeliveries;
|
|
77
82
|
get _beforeNextRound(): () => string | undefined;
|
|
78
83
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ToolHandler } from '../tools/types.js';
|
|
2
|
+
import type { WorkspaceStore } from '../workspace/workspace-store.js';
|
|
3
|
+
import type { TraceSink } from '../trace/index.js';
|
|
4
|
+
import type { SubagentHandleImpl } from './handle.js';
|
|
5
|
+
export interface WorkspaceSubscriptionWiring {
|
|
6
|
+
subscribeHandler: ToolHandler;
|
|
7
|
+
bindHandle: (handle: SubagentHandleImpl<unknown>) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function wireWorkspaceSubscriptions(store: WorkspaceStore | undefined, agentId: string, traceWriter: TraceSink | undefined, provider?: {
|
|
10
|
+
setSubscribeHandler?: (h: ToolHandler) => void;
|
|
11
|
+
}): WorkspaceSubscriptionWiring;
|
|
@@ -19,6 +19,7 @@ export interface ChildProviderFactoryArgs {
|
|
|
19
19
|
allowedTools?: string[];
|
|
20
20
|
readOnlyBash?: boolean;
|
|
21
21
|
customTools?: import('../tools/custom-tool.js').CustomToolDef[];
|
|
22
|
+
subscribeHandler?: import('../tools/types.js').ToolHandler;
|
|
22
23
|
}
|
|
23
24
|
export declare function createStubParentSession(signal: AbortSignal): Pick<IAgentSession, 'sessionId' | 'getInputStreamRef' | 'abortSignal'>;
|
|
24
25
|
export declare const CHILD_ALLOWED_TOOLS: string[];
|
|
@@ -176,7 +176,7 @@ export interface BrowserEventPayload {
|
|
|
176
176
|
};
|
|
177
177
|
durationMs: number;
|
|
178
178
|
}
|
|
179
|
-
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning';
|
|
179
|
+
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery';
|
|
180
180
|
export interface SessionPhasePayload {
|
|
181
181
|
phase: SessionPhaseName;
|
|
182
182
|
durationMs?: number;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { WorkspaceStore, } from './workspace-store.js';
|
|
2
2
|
export type { WorkspaceEntryType, WorkspaceEntry, WorkspacePublishInput, WorkspaceRelationType, } from './workspace-store.js';
|
|
3
|
-
export { workspacePublishTool, workspaceQueryTool, workspaceToolSchemas, createWorkspaceHandlers, WORKSPACE_TOOL_NAMES, } from './workspace-tools.js';
|
|
3
|
+
export { workspacePublishTool, workspaceQueryTool, workspaceSubscribeTool, workspaceToolSchemas, createWorkspaceHandlers, WORKSPACE_TOOL_NAMES, } from './workspace-tools.js';
|
|
4
|
+
export { WORKSPACE_DELIVERY_RING_CAPACITY, WORKSPACE_DELIVERY_MAX_BYTES, } from './workspace-subscription-constants.js';
|
|
5
|
+
export type { WorkspaceSubscription } from './workspace-subscription.js';
|
|
6
|
+
export { notifySubscribers, formatWorkspaceDeliveryEnvelope, generateSubscriptionId, } from './workspace-subscription.js';
|
|
4
7
|
export { renderWorkspacePreamble, injectWorkspacePreamble, } from './workspace-preamble.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WorkspaceSubscription } from './workspace-subscription.js';
|
|
1
2
|
export type WorkspaceEntryType = 'finding' | 'evidence' | 'hypothesis' | 'decision' | 'artifact' | 'status';
|
|
2
3
|
export type WorkspaceRelationType = 'supports' | 'contradicts' | 'depends_on' | 'supersedes';
|
|
3
4
|
export interface WorkspaceEntry {
|
|
@@ -27,9 +28,12 @@ export interface WorkspacePublishInput {
|
|
|
27
28
|
}
|
|
28
29
|
export declare class WorkspaceStore {
|
|
29
30
|
private readonly db;
|
|
31
|
+
private readonly _subscriptions;
|
|
30
32
|
constructor(dbPath?: string);
|
|
31
33
|
private enableWalMode;
|
|
32
34
|
publish(entry: WorkspacePublishInput): number;
|
|
35
|
+
subscribe(subscription: WorkspaceSubscription): void;
|
|
36
|
+
unsubscribeAll(agentId: string): void;
|
|
33
37
|
queryRelevant(sessionId: string | null, taskPrompt: string, limit?: number): WorkspaceEntry[];
|
|
34
38
|
queryAll(sessionId: string): WorkspaceEntry[];
|
|
35
39
|
close(): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkspaceEntry, WorkspaceEntryType } from './workspace-store.js';
|
|
2
|
+
export interface WorkspaceSubscription {
|
|
3
|
+
id: string;
|
|
4
|
+
agentId: string;
|
|
5
|
+
subject: string | undefined;
|
|
6
|
+
type: WorkspaceEntryType | undefined;
|
|
7
|
+
lastDeliveredSeq: number;
|
|
8
|
+
deliveryFn: (entry: WorkspaceEntry) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function notifySubscribers(subscriptions: Map<string, WorkspaceSubscription>, entry: WorkspaceEntry): void;
|
|
11
|
+
export declare function formatWorkspaceDeliveryEnvelope(entries: WorkspaceEntry[], droppedCount?: number): string | undefined;
|
|
12
|
+
export declare function generateSubscriptionId(): string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AnthropicToolDef, ToolHandler } from '../tools/types.js';
|
|
2
2
|
import { WorkspaceStore } from './workspace-store.js';
|
|
3
|
-
export declare const WORKSPACE_TOOL_NAMES: readonly ["workspace_publish", "workspace_query"];
|
|
3
|
+
export declare const WORKSPACE_TOOL_NAMES: readonly ["workspace_publish", "workspace_query", "workspace_subscribe"];
|
|
4
4
|
export declare const workspacePublishTool: AnthropicToolDef;
|
|
5
5
|
export declare const workspaceQueryTool: AnthropicToolDef;
|
|
6
|
+
export declare const workspaceSubscribeTool: AnthropicToolDef;
|
|
6
7
|
export declare const workspaceToolSchemas: AnthropicToolDef[];
|
|
7
8
|
export declare function createWorkspaceHandlers(store: WorkspaceStore, sessionId: string, agentId?: string): Map<string, ToolHandler>;
|