agent-afk 5.156.0 → 5.157.1
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/query/session-state.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query-options.d.ts +1 -0
- package/dist/agent/session/wire-executors.d.ts +1 -0
- package/dist/agent/subagent/completed-cache.d.ts +19 -0
- package/dist/agent/subagent/fork-types.d.ts +1 -0
- package/dist/agent/subagent/handle.d.ts +28 -24
- package/dist/agent/subagent/handle.streaming.d.ts +11 -0
- package/dist/agent/subagent/log.d.ts +24 -0
- package/dist/agent/subagent.d.ts +3 -0
- package/dist/agent/types/config-types.d.ts +1 -0
- package/dist/agent/types/session-types.d.ts +1 -0
- package/dist/cli/output-event-format.d.ts +3 -0
- package/dist/cli/slash/commands/tasks.d.ts +8 -0
- package/dist/cli/slash/plugin-skills/flags.d.ts +5 -0
- package/dist/cli/slash/plugin-skills/state.d.ts +1 -0
- package/dist/cli/slash/plugin-skills.d.ts +1 -1
- package/dist/cli.mjs +617 -612
- package/dist/config/env.d.ts +1 -0
- package/dist/index.mjs +218 -217
- package/dist/paths.d.ts +3 -0
- package/dist/skills/index.d.ts +4 -0
- package/dist/telegram.mjs +286 -284
- package/package.json +1 -1
|
@@ -27,6 +27,7 @@ export interface WireExecutorsOptions {
|
|
|
27
27
|
backgroundRegistry?: BackgroundAgentRegistry;
|
|
28
28
|
agentRegistryWarn?: (message: string) => void;
|
|
29
29
|
workspaceStore?: WorkspaceStore;
|
|
30
|
+
sessionLabel?: string;
|
|
30
31
|
}
|
|
31
32
|
export interface WiredExecutors {
|
|
32
33
|
rootManager: SubagentManager;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SubagentHandle } from './handle.js';
|
|
2
|
+
import type { SubagentResult } from './result.js';
|
|
3
|
+
export interface CompletedEntry<T = unknown> {
|
|
4
|
+
readonly handle: SubagentHandle<T>;
|
|
5
|
+
readonly result: Pick<SubagentResult, 'id' | 'status'>;
|
|
6
|
+
readonly completedAt: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class CompletedCache {
|
|
9
|
+
private readonly entries;
|
|
10
|
+
private readonly capacity;
|
|
11
|
+
constructor(capacity?: number);
|
|
12
|
+
add(id: string, handle: SubagentHandle, result: Pick<SubagentResult, 'id' | 'status'>): void;
|
|
13
|
+
get(id: string): CompletedEntry | undefined;
|
|
14
|
+
list(): readonly CompletedEntry[];
|
|
15
|
+
get size(): number;
|
|
16
|
+
delete(id: string): boolean;
|
|
17
|
+
clear(): void;
|
|
18
|
+
private evictIfNeeded;
|
|
19
|
+
}
|
|
@@ -3,9 +3,11 @@ import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
|
|
|
3
3
|
import { AbortGraph } from '../abort-graph.js';
|
|
4
4
|
import type { HookRegistry } from '../hooks.js';
|
|
5
5
|
import type { IAgentSession, Message } from '../types.js';
|
|
6
|
-
import type { OutputEvent, SubagentProgressSink } from '../types/session-types.js';
|
|
6
|
+
import type { OutputEvent, SubagentProgressSink, SubagentProgressMeta } from '../types/session-types.js';
|
|
7
7
|
import type { TraceSink } from '../trace/index.js';
|
|
8
|
+
import { PauseAwareCeiling } from './pause-ceiling.js';
|
|
8
9
|
import { type SubagentResult, type SubagentStatus, type SubagentTrace } from './result.js';
|
|
10
|
+
export type { SubagentProgressMeta };
|
|
9
11
|
export interface SubagentHandle<T = unknown> {
|
|
10
12
|
readonly id: string;
|
|
11
13
|
readonly status: SubagentStatus;
|
|
@@ -22,35 +24,38 @@ export interface SubagentHandle<T = unknown> {
|
|
|
22
24
|
export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
|
|
23
25
|
readonly id: string;
|
|
24
26
|
readonly session: IAgentSession;
|
|
25
|
-
|
|
27
|
+
readonly _controller: AbortController;
|
|
26
28
|
private readonly abortGraph;
|
|
27
|
-
|
|
29
|
+
readonly _outputSchema: ZodType<T> | undefined;
|
|
28
30
|
private readonly timeoutMs;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
readonly _hookRegistry: HookRegistry | undefined;
|
|
32
|
+
readonly _onTerminal: () => void;
|
|
33
|
+
readonly _parentInputStreamRef?: ReturnType<IAgentSession["getInputStreamRef"]> | undefined;
|
|
34
|
+
readonly _parentAbortSignal?: AbortSignal | undefined;
|
|
35
|
+
readonly _agentType?: string | undefined;
|
|
36
|
+
readonly _traceWriter?: TraceSink | undefined;
|
|
35
37
|
private readonly onSubagentSucceeded?;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
readonly _idleTimeoutMs: number;
|
|
39
|
+
_currentStatus: SubagentStatus;
|
|
38
40
|
private inFlight;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
_lastMessage: string | undefined;
|
|
42
|
+
_lastDurationMs: number | undefined;
|
|
41
43
|
private latestTerminalStatus;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
_stopDispatched: boolean;
|
|
45
|
+
_lastStopInjectContext: string | undefined;
|
|
46
|
+
readonly _progressSink: SubagentProgressSink | undefined;
|
|
47
|
+
_parentId: string | undefined;
|
|
48
|
+
_currentTrace: SubagentTrace;
|
|
49
|
+
_lastStreamedContent: string;
|
|
50
|
+
_pauseCeiling: PauseAwareCeiling | undefined;
|
|
51
|
+
_lastStopReason: string | undefined;
|
|
52
|
+
_logWriter?: {
|
|
53
|
+
write(event: OutputEvent): void;
|
|
54
|
+
close(): Promise<void>;
|
|
55
|
+
};
|
|
56
|
+
constructor(id: string, session: IAgentSession, _controller: AbortController, abortGraph: AbortGraph, _outputSchema: ZodType<T> | undefined, timeoutMs: number, _hookRegistry: HookRegistry | undefined, _onTerminal: () => void, _parentInputStreamRef?: ReturnType<IAgentSession["getInputStreamRef"]> | undefined, _parentAbortSignal?: AbortSignal | undefined, _agentType?: string | undefined, progressSink?: SubagentProgressSink, parentId?: string, _traceWriter?: TraceSink | undefined, onSubagentSucceeded?: ((usage: SubagentTrace["usage"], costUsd: number | undefined) => void) | undefined, _idleTimeoutMs?: number);
|
|
51
57
|
get status(): SubagentStatus;
|
|
52
58
|
run(prompt: string | ContentBlockParam[], sinkOverride?: SubagentProgressSink): Promise<Message>;
|
|
53
|
-
private streamToFinalMessage;
|
|
54
59
|
runToResult(prompt: string | ContentBlockParam[], sinkOverride?: SubagentProgressSink): Promise<SubagentResult<T>>;
|
|
55
60
|
runInBackground(prompt: string, onResult?: (result: SubagentResult<T>) => void, onProgress?: (event: OutputEvent) => void): void;
|
|
56
61
|
cancel(): Promise<void>;
|
|
@@ -58,5 +63,4 @@ export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
|
|
|
58
63
|
deferInjectContextToCaller?: boolean;
|
|
59
64
|
}): Promise<void>;
|
|
60
65
|
getLastStopInjectContext(): string | undefined;
|
|
61
|
-
private dispatchStopAndRelease;
|
|
62
66
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
|
|
2
|
+
import type { OutputEvent, SubagentProgressSink } from '../types/session-types.js';
|
|
3
|
+
import type { Message } from '../types.js';
|
|
4
|
+
import { type SubagentResult, type SubagentStatus } from './result.js';
|
|
5
|
+
import type { SubagentHandleImpl } from './handle.js';
|
|
6
|
+
export declare function streamToFinalMessage<T>(handle: SubagentHandleImpl<T>, prompt: string | ContentBlockParam[], sinkOverride?: SubagentProgressSink): Promise<Message>;
|
|
7
|
+
export declare function runToResult<T>(handle: SubagentHandleImpl<T>, prompt: string | ContentBlockParam[], sinkOverride?: SubagentProgressSink): Promise<SubagentResult<T>>;
|
|
8
|
+
export declare function runInBackground<T>(handle: SubagentHandleImpl<T>, prompt: string, onResult?: (result: SubagentResult<T>) => void, onProgress?: (event: OutputEvent) => void): void;
|
|
9
|
+
export declare function dispatchStopAndRelease<T>(handle: SubagentHandleImpl<T>, reportedStatus: SubagentStatus, options?: {
|
|
10
|
+
deferInjectContextToCaller?: boolean;
|
|
11
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { OutputEvent } from '../types/session-types.js';
|
|
2
|
+
export declare class SubagentLogWriter {
|
|
3
|
+
readonly sessionLabel: string;
|
|
4
|
+
readonly subagentId: string;
|
|
5
|
+
readonly logPath: string;
|
|
6
|
+
private stream;
|
|
7
|
+
private errored;
|
|
8
|
+
private closed;
|
|
9
|
+
private streamReady;
|
|
10
|
+
private pendingLines;
|
|
11
|
+
private readyPromise;
|
|
12
|
+
private readyResolve;
|
|
13
|
+
private bytesWritten;
|
|
14
|
+
constructor(sessionLabel: string, subagentId: string);
|
|
15
|
+
static isEnabled(): boolean;
|
|
16
|
+
write(event: OutputEvent): void;
|
|
17
|
+
close(): Promise<void>;
|
|
18
|
+
private openStream;
|
|
19
|
+
private writeLine;
|
|
20
|
+
}
|
|
21
|
+
export declare class SubagentLogReader {
|
|
22
|
+
static readEvents(sessionLabel: string, subagentId: string): AsyncGenerator<OutputEvent>;
|
|
23
|
+
static list(sessionLabel: string): Promise<string[]>;
|
|
24
|
+
}
|
package/dist/agent/subagent.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { AbortOrigin, TraceSink } from './trace/index.js';
|
|
|
3
3
|
import { type ReadScopeInputs } from './subagent-read-scope.js';
|
|
4
4
|
import { type SubagentHandle } from './subagent/handle.js';
|
|
5
5
|
import type { SubagentStatus, SubagentResult, SubagentTrace } from './subagent/result.js';
|
|
6
|
+
import { CompletedCache } from './subagent/completed-cache.js';
|
|
6
7
|
export type { SubagentStatus, SubagentResult, SubagentTrace, SubagentHandle };
|
|
7
8
|
import { DENY_ELICITATION, SUBAGENT_DEFAULT_MAX_TOOL_USE_ITERATIONS, SUBAGENT_DEFAULT_TIMEOUT_MS, SUBAGENT_DEFAULT_IDLE_TIMEOUT_MS, SUBAGENT_BACKGROUND_TIMEOUT_MS, SUBAGENT_DRAIN_TIMEOUT_MS, resolveSubagentTimeoutMs, resolveSubagentIdleTimeoutMs } from './subagent/constants.js';
|
|
8
9
|
import type { ForkParent, ForkSubagentOptions, SubagentManagerOptions } from './subagent/fork-types.js';
|
|
@@ -10,6 +11,7 @@ export { DENY_ELICITATION, SUBAGENT_DEFAULT_MAX_TOOL_USE_ITERATIONS, SUBAGENT_DE
|
|
|
10
11
|
export type { ForkParent, ForkSubagentOptions, SubagentManagerOptions };
|
|
11
12
|
export declare class SubagentManager {
|
|
12
13
|
private readonly active;
|
|
14
|
+
readonly completed: CompletedCache;
|
|
13
15
|
private readonly parentCanUseTool;
|
|
14
16
|
private readonly hookRegistry;
|
|
15
17
|
private readonly progressSink;
|
|
@@ -24,6 +26,7 @@ export declare class SubagentManager {
|
|
|
24
26
|
private readonly parentSurface;
|
|
25
27
|
private readonly parentAbortSignal;
|
|
26
28
|
private readonly workspaceStore;
|
|
29
|
+
private readonly sessionLabel;
|
|
27
30
|
private readonly abortGraph;
|
|
28
31
|
private readonly rootId;
|
|
29
32
|
private rootController;
|
|
@@ -129,6 +129,7 @@ export interface IAgentSession {
|
|
|
129
129
|
getQuery(): ProviderQuery;
|
|
130
130
|
getLastResponseMetadata(): ResponseMetadata | null;
|
|
131
131
|
getOutputStream(): AsyncIterable<OutputEvent>;
|
|
132
|
+
getHistory?(): readonly Message[];
|
|
132
133
|
getInputStreamRef(): Pick<InputStreamRef, 'pushUserMessage' | 'queueFrameworkContext'>;
|
|
133
134
|
supportedCommands(): Promise<SlashCommand[]>;
|
|
134
135
|
supportedModels(): Promise<ModelInfo[]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SlashCommand } from '../types.js';
|
|
2
|
+
import type { SubagentManager } from '../../../agent/subagent.js';
|
|
3
|
+
export declare function setTasksRegistry(manager: SubagentManager, sessionLabel: string): void;
|
|
4
|
+
export declare function resetTasksRegistry(): void;
|
|
5
|
+
export declare const tasksCmd: SlashCommand;
|
|
6
|
+
export declare const tasksViewCmd: SlashCommand;
|
|
7
|
+
export declare const tasksCancelCmd: SlashCommand;
|
|
8
|
+
export declare const tasksCommands: readonly SlashCommand[];
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export interface PluginSkillHarvest {
|
|
2
|
+
flags: Map<string, string[]>;
|
|
3
|
+
categories: Map<string, string>;
|
|
4
|
+
}
|
|
1
5
|
export declare function harvestPluginSkillFlags(cacheRoot?: string): Map<string, string[]>;
|
|
6
|
+
export declare function harvestPluginSkillMetadata(cacheRoot?: string): PluginSkillHarvest;
|
|
2
7
|
export declare function harvestAllPluginSkillFlags(): Map<string, string[]>;
|
|
3
8
|
export declare function extractHintFromDescription(description: string): string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { harvestPluginSkillFlags, extractHintFromDescription, } from './plugin-skills/flags.js';
|
|
1
|
+
export { harvestPluginSkillFlags, harvestPluginSkillMetadata, extractHintFromDescription, type PluginSkillHarvest, } from './plugin-skills/flags.js';
|
|
2
2
|
export { initialSkillsCmd } from './plugin-skills/listing.js';
|
|
3
3
|
export { makeForwardHandler, registerPluginSkills, getPluginShadowingNoticeLines, autoRegisterPluginPassthroughs, } from './plugin-skills/dispatch.js';
|
|
4
4
|
export { buildSourceBreakdown, computeSkillDelta, formatSkillDelta, buildPluginRows, reloadPluginsCmd, } from './plugin-skills/reload.js';
|