agent-afk 5.321.7 → 5.321.9
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/daemon/handoff-maintenance.d.ts +1 -1
- package/dist/agent/providers/openai-compatible/query/dispatch-append.parse-errors.d.ts +1 -0
- package/dist/agent/subagent/fork-types.d.ts +1 -0
- package/dist/agent/subagent/handle.billing.d.ts +1 -1
- package/dist/agent/subagent/handle.d.ts +1 -0
- package/dist/agent/subagent.d.ts +2 -0
- package/dist/agent/tools/compose-agent-resolve.d.ts +1 -0
- package/dist/agent/tools/nesting.d.ts +1 -1
- package/dist/agent/tools/skill-executor/types.d.ts +1 -0
- package/dist/agent/tools/subagent/child-config.d.ts +1 -0
- package/dist/agent/tools/subagent/child-config.helpers.d.ts +1 -1
- package/dist/agent/tools/subagent/write-capability.d.ts +1 -0
- package/dist/agent/tools/subagent-executor.dispatch-intent.d.ts +11 -0
- package/dist/agent/tools/subagent-executor.execute-once.helpers.d.ts +0 -1
- package/dist/agent/tools/subagent-executor.write-intent.d.ts +0 -1
- package/dist/agent/trace/events.d.ts +6 -0
- package/dist/agent/trace/events.subagent-lifecycle.d.ts +3 -0
- package/dist/agent/trace/types.d.ts +1 -1
- package/dist/cli.mjs +386 -386
- package/dist/index.mjs +193 -193
- package/dist/telegram.mjs +206 -206
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ export interface HandoffMaintenanceOpts {
|
|
|
13
13
|
intervalMs?: number;
|
|
14
14
|
}
|
|
15
15
|
export interface HandoffMaintenanceHandle {
|
|
16
|
-
stop(): void
|
|
16
|
+
stop(): Promise<void>;
|
|
17
17
|
}
|
|
18
18
|
export declare function runStartupRecovery(opts: HandoffMaintenanceOpts, resumeDir: string): Promise<void>;
|
|
19
19
|
export declare function consumeAndResume(opts: HandoffMaintenanceOpts, resumeDir: string): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ToolCall, ToolResult } from '../../anthropic-direct/types.js';
|
|
2
2
|
import type { AccumulatedToolCall } from '../translate.js';
|
|
3
|
+
export declare const LOST_ARGS_FAILURE_CLASS: "lost-args";
|
|
3
4
|
export declare function parseErrorResult(name: string, diagnostic: string, argumentsLost: boolean): ToolResult;
|
|
4
5
|
export declare function dispatchableCalls(calls: readonly ToolCall[], parseErrors: ReadonlyMap<string, string>): ToolCall[];
|
|
5
6
|
export declare function mergeUndispatchedResults(calls: readonly ToolCall[], accumulated: readonly AccumulatedToolCall[], parseErrors: ReadonlyMap<string, string>, dispatchedResults: readonly ToolResult[]): ToolResult[];
|
|
@@ -54,6 +54,7 @@ export interface SubagentManagerOptions {
|
|
|
54
54
|
sessionLabel?: string;
|
|
55
55
|
outputEventSink?: (event: OutputEvent) => void;
|
|
56
56
|
delegationBudget?: import('../tools/delegation-budget.js').DelegationBudget;
|
|
57
|
+
parentBillingStreams?: Set<Promise<void>>;
|
|
57
58
|
}
|
|
58
59
|
export declare function resolveParentCredential(options: SubagentManagerOptions): {
|
|
59
60
|
effectiveKey: string | (() => string | undefined) | undefined;
|
|
@@ -10,4 +10,4 @@ export interface RunBillingContext {
|
|
|
10
10
|
export declare function unreportedBillingDelta(context: RunBillingContext): BillingUsage | undefined;
|
|
11
11
|
export declare function takeUnreportedBilling(context: RunBillingContext): BillingUsage | undefined;
|
|
12
12
|
export declare function settleUnreportedBilling<T>(handle: SubagentHandleImpl<T>, outcome: SubagentUnsuccessfulOutcome, context?: RunBillingContext): ReturnType<typeof billingLifecycleFields>;
|
|
13
|
-
export declare function trackBillingStream<T>(pending: Set<Promise<void>>, stream: Promise<T
|
|
13
|
+
export declare function trackBillingStream<T>(pending: Set<Promise<void>>, stream: Promise<T>, sink?: Set<Promise<void>>): Promise<T>;
|
|
@@ -59,6 +59,7 @@ export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
|
|
|
59
59
|
_lastStopReason: string | undefined;
|
|
60
60
|
_billingContext: RunBillingContext;
|
|
61
61
|
readonly _pendingBillingStreams: Set<Promise<void>>;
|
|
62
|
+
_billingStreamSink?: Set<Promise<void>>;
|
|
62
63
|
get pendingBillingStreams(): Promise<void>[];
|
|
63
64
|
get _runBilling(): BillingUsage | undefined;
|
|
64
65
|
set _runBilling(value: BillingUsage | undefined);
|
package/dist/agent/subagent.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export type { ForkParent, ForkSubagentOptions, SubagentManagerOptions };
|
|
|
14
14
|
export declare class SubagentManager {
|
|
15
15
|
private readonly active;
|
|
16
16
|
private readonly pendingChildBillingStreams;
|
|
17
|
+
private readonly parentBillingStreams;
|
|
17
18
|
readonly completed: CompletedCache;
|
|
18
19
|
private readonly parentCanUseTool;
|
|
19
20
|
private readonly hookRegistry;
|
|
@@ -56,6 +57,7 @@ export declare class SubagentManager {
|
|
|
56
57
|
kill(id: string): Promise<boolean>;
|
|
57
58
|
killAll(): Promise<void>;
|
|
58
59
|
getPendingChildTerminalWrites(): readonly Promise<void>[];
|
|
60
|
+
get billingStreamRegistry(): Set<Promise<void>>;
|
|
59
61
|
getPendingChildBillingStreams(): readonly Promise<void>[];
|
|
60
62
|
private retainChildBillingStreams;
|
|
61
63
|
abortAllAndDrain(reason?: unknown, origin?: AbortOrigin, timeoutMs?: number, rearm?: boolean): Promise<{
|
|
@@ -11,6 +11,7 @@ export interface ResolvedComposeAgent {
|
|
|
11
11
|
canUseTool?: CanUseTool;
|
|
12
12
|
namedAgentAllowedTools?: string[];
|
|
13
13
|
readOnlyBash?: true;
|
|
14
|
+
readOnly?: true;
|
|
14
15
|
}
|
|
15
16
|
export declare function buildAllowlistCanUseTool(allowed: string[]): CanUseTool;
|
|
16
17
|
export declare function resolveComposeNodeAgent(agentType: string | undefined, agentRegistry: AgentRegistry | undefined): ResolvedComposeAgent;
|
|
@@ -43,7 +43,7 @@ export interface BuildComposeNodeProviderOpts {
|
|
|
43
43
|
namedAgentAllowedTools?: string[];
|
|
44
44
|
}
|
|
45
45
|
export declare function buildComposeNodeProvider(model: AgentModelInput | undefined, workspaceStore: WorkspaceStore | undefined, opts?: BuildComposeNodeProviderOpts): ModelProvider;
|
|
46
|
-
export declare function createChildSkillExecutorFactory(defaultModel: AgentModelInput, apiKey: string | undefined, childProviderFactory: (args: ChildProviderFactoryArgs) => ModelProvider, baseUrl?: string, traceWriter?: TraceSink, backgroundRegistry?: BackgroundAgentRegistry, cwd?: string, resolveApiKeyForModel?: (model: string) => string | undefined, surface?: Surface, defaultSubagentModel?: AgentModelInput, agentRegistry?: AgentRegistry, openaiBaseUrl?: string, xaiBaseUrl?: string, workspaceStore?: WorkspaceStore, delegationBudget?: import('./delegation-budget.js').DelegationBudget, pluginConfigs?: SdkPluginConfig[], skillAllowlist?: readonly string[], hookRegistry?: HookRegistry, onSubagentSucceeded?: import('../subagent/fork-types.js').SubagentManagerOptions['onSubagentSucceeded']): (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string, inheritedReadScope?: ReadScopeInputs, skillDispatchName?: string, journalParent?: JournalParent, rootSessionId?: string) => SkillExecutor;
|
|
46
|
+
export declare function createChildSkillExecutorFactory(defaultModel: AgentModelInput, apiKey: string | undefined, childProviderFactory: (args: ChildProviderFactoryArgs) => ModelProvider, baseUrl?: string, traceWriter?: TraceSink, backgroundRegistry?: BackgroundAgentRegistry, cwd?: string, resolveApiKeyForModel?: (model: string) => string | undefined, surface?: Surface, defaultSubagentModel?: AgentModelInput, agentRegistry?: AgentRegistry, openaiBaseUrl?: string, xaiBaseUrl?: string, workspaceStore?: WorkspaceStore, delegationBudget?: import('./delegation-budget.js').DelegationBudget, pluginConfigs?: SdkPluginConfig[], skillAllowlist?: readonly string[], hookRegistry?: HookRegistry, onSubagentSucceeded?: import('../subagent/fork-types.js').SubagentManagerOptions['onSubagentSucceeded'], parentBillingStreams?: Set<Promise<void>>): (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string, inheritedReadScope?: ReadScopeInputs, skillDispatchName?: string, journalParent?: JournalParent, rootSessionId?: string) => SkillExecutor;
|
|
47
47
|
export type PhaseRole = 'read-only' | 'read-write';
|
|
48
48
|
export declare function buildSkillRestrictedProvider(allowedTools: string[], model: AgentModelInput | undefined, readOnlyBash?: boolean, openaiBaseUrl?: string, workspaceStore?: WorkspaceStore): ModelProvider;
|
|
49
49
|
export declare function buildPhaseRestrictedProvider(_role: 'read-only', model: AgentModelInput | undefined): ModelProvider;
|
|
@@ -23,6 +23,7 @@ export interface SkillExecutorContext {
|
|
|
23
23
|
skillAllowlist?: readonly string[];
|
|
24
24
|
hookRegistry?: HookRegistry;
|
|
25
25
|
onSubagentSucceeded?: import('../../subagent/fork-types.js').SubagentManagerOptions['onSubagentSucceeded'];
|
|
26
|
+
parentBillingStreams?: Set<Promise<void>>;
|
|
26
27
|
depth?: number;
|
|
27
28
|
maxDepth?: number;
|
|
28
29
|
childProviderFactory?: (args: ChildProviderFactoryArgs) => ModelProvider;
|
|
@@ -42,6 +42,7 @@ export interface BuildChildConfigArgs {
|
|
|
42
42
|
delegationBudget?: import('../../tools/delegation-budget.js').DelegationBudget;
|
|
43
43
|
hookRegistry?: import('../../hooks.js').HookRegistry;
|
|
44
44
|
parentRootSessionId?: string;
|
|
45
|
+
parentBillingStreams?: Set<Promise<void>>;
|
|
45
46
|
createChildExecutor: (ctx: SubagentExecutorContext) => SubagentExecutor;
|
|
46
47
|
}
|
|
47
48
|
export interface BuildChildConfigResult {
|
|
@@ -43,6 +43,6 @@ interface WireChildNestingArgs {
|
|
|
43
43
|
createChildExecutor: (ctx: SubagentExecutorContext) => SubagentExecutor;
|
|
44
44
|
}
|
|
45
45
|
export declare function wireChildNesting(w: WireChildNestingArgs): WireChildNestingResult;
|
|
46
|
-
export declare function buildNestedChildManager(args: Pick<BuildChildConfigArgs, 'childInheritedReadRoots' | 'traceWriter' | 'surface' | 'workspaceStore' | 'parentRootSessionId' | 'hookRegistry' | 'onSubagentSucceeded'>, signal: AbortSignal, currentCwd: string | undefined): SubagentManager;
|
|
46
|
+
export declare function buildNestedChildManager(args: Pick<BuildChildConfigArgs, 'childInheritedReadRoots' | 'traceWriter' | 'surface' | 'workspaceStore' | 'parentRootSessionId' | 'hookRegistry' | 'onSubagentSucceeded' | 'parentBillingStreams'>, signal: AbortSignal, currentCwd: string | undefined): SubagentManager;
|
|
47
47
|
export declare function nestedExecutorInherits(args: Pick<BuildChildConfigArgs, 'traceWriter' | 'workspaceStore' | 'hookRegistry'>): Pick<SubagentExecutorContext, 'traceWriter' | 'workspaceStore' | 'hookRegistry'>;
|
|
48
48
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isChildWriteCapable(effectiveAllowedTools: readonly string[] | undefined, effectiveReadOnlyBash: boolean): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RegisteredAgent } from '../agents/index.js';
|
|
2
|
+
import type { ToolResult } from './types.js';
|
|
3
|
+
export declare function classifyDispatchIntent(prompt: string): string | undefined;
|
|
4
|
+
export declare function checkReadOnlyDispatchIntent(childWriteCapable: boolean, namedAgent: RegisteredAgent | undefined, prompt: string, classifyFn: (p: string) => string | undefined): ToolResult | undefined;
|
|
5
|
+
export declare function checkComposeReadOnlyDispatchIntent(nodes: ReadonlyArray<{
|
|
6
|
+
id: string;
|
|
7
|
+
prompt: string;
|
|
8
|
+
agent_type?: string;
|
|
9
|
+
}>, resolvedAgents: ReadonlyArray<{
|
|
10
|
+
readOnly?: true;
|
|
11
|
+
}>, classifyFn?: (p: string) => string | undefined): ToolResult | undefined;
|
|
@@ -103,4 +103,3 @@ export interface RunBackgroundDispatchArgs {
|
|
|
103
103
|
}
|
|
104
104
|
export declare function runBackgroundDispatch(args: RunBackgroundDispatchArgs): Promise<ToolResult>;
|
|
105
105
|
export declare function checkNestedScope(nestedScope: readonly string[], requestedType: string | undefined): ToolResult | undefined;
|
|
106
|
-
export declare function checkReadOnlyDispatchIntent(childWriteCapable: boolean, namedAgent: RegisteredAgent | undefined, prompt: string, classifyFn: (p: string) => boolean): ToolResult | undefined;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export declare function classifyDispatchIntent(prompt: string): boolean;
|
|
2
1
|
export declare function collectPostRunWarnings(model: string, hasAttachments: boolean, agentName: string | undefined, prompt: string, childWriteCapable: boolean, supportsVisionFn: (m: string) => boolean): string;
|
|
@@ -36,6 +36,7 @@ export declare const ToolCallCompletedPayloadSchema: z.ZodObject<{
|
|
|
36
36
|
"repeat-failure": "repeat-failure";
|
|
37
37
|
"no-such-target": "no-such-target";
|
|
38
38
|
"hook-block-repeat": "hook-block-repeat";
|
|
39
|
+
"lost-args": "lost-args";
|
|
39
40
|
}>>;
|
|
40
41
|
batchIndex: z.ZodOptional<z.ZodNumber>;
|
|
41
42
|
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -73,6 +74,7 @@ export declare const ToolCallPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
73
74
|
"repeat-failure": "repeat-failure";
|
|
74
75
|
"no-such-target": "no-such-target";
|
|
75
76
|
"hook-block-repeat": "hook-block-repeat";
|
|
77
|
+
"lost-args": "lost-args";
|
|
76
78
|
}>>;
|
|
77
79
|
batchIndex: z.ZodOptional<z.ZodNumber>;
|
|
78
80
|
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -339,6 +341,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
339
341
|
"repeat-failure": "repeat-failure";
|
|
340
342
|
"no-such-target": "no-such-target";
|
|
341
343
|
"hook-block-repeat": "hook-block-repeat";
|
|
344
|
+
"lost-args": "lost-args";
|
|
342
345
|
}>>;
|
|
343
346
|
batchIndex: z.ZodOptional<z.ZodNumber>;
|
|
344
347
|
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -436,6 +439,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
436
439
|
"repeat-failure": "repeat-failure";
|
|
437
440
|
"no-such-target": "no-such-target";
|
|
438
441
|
"hook-block-repeat": "hook-block-repeat";
|
|
442
|
+
"lost-args": "lost-args";
|
|
439
443
|
}>>;
|
|
440
444
|
}, z.core.$strip>, z.ZodObject<{
|
|
441
445
|
provider: z.ZodOptional<z.ZodString>;
|
|
@@ -766,6 +770,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
766
770
|
"repeat-failure": "repeat-failure";
|
|
767
771
|
"no-such-target": "no-such-target";
|
|
768
772
|
"hook-block-repeat": "hook-block-repeat";
|
|
773
|
+
"lost-args": "lost-args";
|
|
769
774
|
}>>;
|
|
770
775
|
batchIndex: z.ZodOptional<z.ZodNumber>;
|
|
771
776
|
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -869,6 +874,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
869
874
|
"repeat-failure": "repeat-failure";
|
|
870
875
|
"no-such-target": "no-such-target";
|
|
871
876
|
"hook-block-repeat": "hook-block-repeat";
|
|
877
|
+
"lost-args": "lost-args";
|
|
872
878
|
}>>;
|
|
873
879
|
}, z.core.$strip>, z.ZodObject<{
|
|
874
880
|
provider: z.ZodOptional<z.ZodString>;
|
|
@@ -11,6 +11,7 @@ export declare const ToolFailureClassSchema: z.ZodEnum<{
|
|
|
11
11
|
"repeat-failure": "repeat-failure";
|
|
12
12
|
"no-such-target": "no-such-target";
|
|
13
13
|
"hook-block-repeat": "hook-block-repeat";
|
|
14
|
+
"lost-args": "lost-args";
|
|
14
15
|
}>;
|
|
15
16
|
export declare const SubagentStartedPayloadSchema: z.ZodObject<{
|
|
16
17
|
transition: z.ZodLiteral<"started">;
|
|
@@ -65,6 +66,7 @@ export declare const SubagentFailedPayloadSchema: z.ZodObject<{
|
|
|
65
66
|
"repeat-failure": "repeat-failure";
|
|
66
67
|
"no-such-target": "no-such-target";
|
|
67
68
|
"hook-block-repeat": "hook-block-repeat";
|
|
69
|
+
"lost-args": "lost-args";
|
|
68
70
|
}>>;
|
|
69
71
|
}, z.core.$strip>;
|
|
70
72
|
export declare const SubagentCancelledPayloadSchema: z.ZodObject<{
|
|
@@ -134,6 +136,7 @@ export declare const SubagentLifecyclePayloadSchema: z.ZodDiscriminatedUnion<[z.
|
|
|
134
136
|
"repeat-failure": "repeat-failure";
|
|
135
137
|
"no-such-target": "no-such-target";
|
|
136
138
|
"hook-block-repeat": "hook-block-repeat";
|
|
139
|
+
"lost-args": "lost-args";
|
|
137
140
|
}>>;
|
|
138
141
|
}, z.core.$strip>, z.ZodObject<{
|
|
139
142
|
provider: z.ZodOptional<z.ZodString>;
|
|
@@ -8,7 +8,7 @@ export interface ToolCallStartedPayload {
|
|
|
8
8
|
resourceFingerprint?: string;
|
|
9
9
|
subagentId?: string;
|
|
10
10
|
}
|
|
11
|
-
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", "hook-block-repeat"];
|
|
11
|
+
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", "hook-block-repeat", "lost-args"];
|
|
12
12
|
export type ToolFailureClass = (typeof TOOL_FAILURE_CLASSES)[number];
|
|
13
13
|
export declare const BENIGN_FAILURE_CLASSES: ReadonlySet<ToolFailureClass>;
|
|
14
14
|
export interface ToolCallCompletedPayload {
|