agent-afk 5.184.0 → 5.185.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/background-registry.d.ts +1 -0
- package/dist/agent/background-registry.types.d.ts +1 -0
- package/dist/agent/provider.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/loop/inter-round.d.ts +2 -0
- package/dist/agent/providers/anthropic-direct/query/turn-request.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query-options.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query-runtime.d.ts +2 -0
- package/dist/agent/providers/anthropic-direct/query-turn-driver.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/request-types.d.ts +1 -0
- package/dist/agent/session/agent-session.d.ts +1 -0
- package/dist/agent/subagent/handle.d.ts +4 -0
- package/dist/agent/tools/schemas.background-steer.d.ts +2 -0
- package/dist/agent/tools/schemas.orchestration.d.ts +1 -0
- package/dist/agent/tools/subagent/send-message.d.ts +3 -0
- package/dist/agent/tools/subagent-executor.d.ts +1 -0
- package/dist/agent/types/session-types.d.ts +1 -0
- package/dist/cli.mjs +583 -583
- package/dist/index.mjs +221 -221
- package/dist/telegram.mjs +290 -290
- package/package.json +1 -1
|
@@ -43,6 +43,7 @@ export declare class BackgroundAgentRegistry extends EventEmitter<BackgroundRegi
|
|
|
43
43
|
cancelAll(): Promise<void>;
|
|
44
44
|
appendTranscript(jobId: string, chunk: string): void;
|
|
45
45
|
getTranscript(jobId: string): string | undefined;
|
|
46
|
+
getHandle(jobId: string): SubagentHandle | undefined;
|
|
46
47
|
private nextJobId;
|
|
47
48
|
private markTerminal;
|
|
48
49
|
private statusFromResult;
|
package/dist/agent/provider.d.ts
CHANGED
|
@@ -171,6 +171,7 @@ export interface ProviderQuery extends AsyncIterable<ProviderEvent> {
|
|
|
171
171
|
rewindConversation?(turnIndex: number): Promise<ProviderRewindConversationResult>;
|
|
172
172
|
setCwd?(cwd: string): void;
|
|
173
173
|
setSystemPrompt?(basePrompt: string | undefined): boolean;
|
|
174
|
+
setBeforeNextRound?(cb: (() => string | undefined) | undefined): void;
|
|
174
175
|
reauth?(): Promise<{
|
|
175
176
|
accountId: string;
|
|
176
177
|
swapped: boolean;
|
|
@@ -24,6 +24,7 @@ export interface TurnRequestInput {
|
|
|
24
24
|
subagentId?: string;
|
|
25
25
|
throttleQueue?: RunTurnInput['throttleQueue'];
|
|
26
26
|
onUsageProgress?: RunTurnInput['onUsageProgress'];
|
|
27
|
+
beforeNextRound?: RunTurnInput['beforeNextRound'];
|
|
27
28
|
}
|
|
28
29
|
export declare function prepareTurnRequest(input: TurnRequestInput): {
|
|
29
30
|
decision: FastTurnDecision | undefined;
|
|
@@ -41,5 +41,6 @@ export interface AnthropicDirectQueryOptions {
|
|
|
41
41
|
hookRegistry?: HookRegistry;
|
|
42
42
|
throttleQueue?: import('./throttle-queue.js').ThrottleQueue;
|
|
43
43
|
fastModeController?: import('../../fast-mode.js').FastModeController;
|
|
44
|
+
beforeNextRound?: () => string | undefined;
|
|
44
45
|
}
|
|
45
46
|
export declare function starterModels(): ProviderModelInfo[];
|
|
@@ -25,8 +25,10 @@ export declare class AnthropicDirectQuery implements ProviderQuery {
|
|
|
25
25
|
private readonly hookRegistry?;
|
|
26
26
|
private readonly throttleQueue?;
|
|
27
27
|
private readonly fastModeController?;
|
|
28
|
+
private beforeNextRound?;
|
|
28
29
|
constructor(opts: AnthropicDirectQueryOptions);
|
|
29
30
|
private turnDriverContext;
|
|
31
|
+
setBeforeNextRound(cb: (() => string | undefined) | undefined): void;
|
|
30
32
|
[Symbol.asyncIterator](): AsyncIterator<ProviderEvent>;
|
|
31
33
|
private composeSystem;
|
|
32
34
|
interrupt(reason?: import('../../abort-reason.js').ProviderAbortReason): Promise<void>;
|
|
@@ -25,6 +25,7 @@ export interface TurnDriverContext {
|
|
|
25
25
|
readonly hookRegistry: HookRegistry | undefined;
|
|
26
26
|
readonly throttleQueue: import('./throttle-queue.js').ThrottleQueue | undefined;
|
|
27
27
|
readonly fastModeController: import('../../fast-mode.js').FastModeController | undefined;
|
|
28
|
+
readonly beforeNextRound: (() => string | undefined) | undefined;
|
|
28
29
|
composeSystem(): ContentBlockParam[] | null;
|
|
29
30
|
makeInterruptedTurnEvent(): ProviderEvent;
|
|
30
31
|
compact(): Promise<ProviderCompactResult>;
|
|
@@ -23,6 +23,7 @@ export interface RunTurnInput {
|
|
|
23
23
|
subagentId?: string;
|
|
24
24
|
onUsageProgress?: (usage: ProviderUsage) => void;
|
|
25
25
|
throttleQueue?: import('./throttle-queue.js').ThrottleQueue;
|
|
26
|
+
beforeNextRound?: () => string | undefined;
|
|
26
27
|
}
|
|
27
28
|
export interface AnthropicClientLike {
|
|
28
29
|
messages: {
|
|
@@ -55,6 +55,7 @@ export declare class AgentSession implements IAgentSession {
|
|
|
55
55
|
recordLedgerElicitation(reqId: string, request: ElicitationRequest): void;
|
|
56
56
|
private summarizeContentBlocks;
|
|
57
57
|
interrupt(): Promise<void>;
|
|
58
|
+
setBeforeNextRound(cb: (() => string | undefined) | undefined): void;
|
|
58
59
|
reset(): Promise<void>;
|
|
59
60
|
private onAbort;
|
|
60
61
|
setModel(model?: AgentModelInput): Promise<void>;
|
|
@@ -22,6 +22,7 @@ export interface SubagentHandle<T = unknown> {
|
|
|
22
22
|
getLastStopInjectContext(): string | undefined;
|
|
23
23
|
readonly durationMs: number | undefined;
|
|
24
24
|
sendMessage(text: string): void;
|
|
25
|
+
steer(text: string): void;
|
|
25
26
|
}
|
|
26
27
|
export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
|
|
27
28
|
readonly id: string;
|
|
@@ -69,4 +70,7 @@ export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
|
|
|
69
70
|
readonly _pendingUserMessages: string[];
|
|
70
71
|
private _drainingMessages;
|
|
71
72
|
sendMessage(text: string): void;
|
|
73
|
+
readonly _steeringMessages: string[];
|
|
74
|
+
steer(text: string): void;
|
|
75
|
+
get _beforeNextRound(): () => string | undefined;
|
|
72
76
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BackgroundAgentRegistry } from '../../background-registry.js';
|
|
2
|
+
import type { ToolCall, ToolResult } from '../types.js';
|
|
3
|
+
export declare function sendMessageToAgent(registry: BackgroundAgentRegistry | undefined, call: ToolCall, callerSessionId?: string): Promise<ToolResult>;
|
|
@@ -65,6 +65,7 @@ export declare class SubagentExecutor implements SubagentControl {
|
|
|
65
65
|
supportsBackgroundJobs(): boolean;
|
|
66
66
|
hasPromotableForeground(): boolean;
|
|
67
67
|
cancelBackgroundJob(call: ToolCall): Promise<ToolResult>;
|
|
68
|
+
sendMessageToAgent(call: ToolCall): Promise<ToolResult>;
|
|
68
69
|
hasActiveForeground(): boolean;
|
|
69
70
|
private cancelGeneration;
|
|
70
71
|
cancelActiveForeground(): Promise<number>;
|
|
@@ -118,6 +118,7 @@ export interface IAgentSession {
|
|
|
118
118
|
sendMessageStream(content: string | ContentBlockParam[]): AsyncIterable<OutputEvent>;
|
|
119
119
|
sendMessageStructured?<T>(content: string, schema: ZodType<T>, options?: StructuredMessageOptions): Promise<T>;
|
|
120
120
|
interrupt(): Promise<void>;
|
|
121
|
+
setBeforeNextRound?(cb: (() => string | undefined) | undefined): void;
|
|
121
122
|
reset(): Promise<void>;
|
|
122
123
|
readonly abortSignal: AbortSignal;
|
|
123
124
|
abort(reason: string): void;
|