agent-afk 5.30.5 → 5.31.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/query/cwd-dependents.d.ts +1 -1
- package/dist/agent/providers/anthropic-direct/query/system-prompt.d.ts +16 -0
- package/dist/agent/providers/openai-compatible/query/request-body.d.ts +14 -0
- package/dist/agent/providers/openai-compatible/query/stream-drive.d.ts +22 -0
- package/dist/cli/commands/interactive/bg-result-notifier.d.ts +1 -0
- package/dist/cli/input/input-surface.d.ts +4 -0
- package/dist/cli.mjs +421 -423
- package/dist/index.mjs +155 -157
- package/dist/telegram.mjs +204 -206
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import type { SubagentExecutor } from '../../../tools/subagent-executor.js';
|
|
|
3
3
|
import type { SkillExecutor } from '../../../tools/skill-executor.js';
|
|
4
4
|
import type { ComposeExecutor } from '../../../tools/compose-executor.js';
|
|
5
5
|
import type { ToolDispatcher } from '../tool-dispatcher.js';
|
|
6
|
-
import {
|
|
6
|
+
import type { RuntimeStateSource } from '../../../awareness/index.js';
|
|
7
7
|
export type CwdDependentsFactory = (newCwd: string) => {
|
|
8
8
|
userSystem: string;
|
|
9
9
|
dispatcher: ToolDispatcher;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type RuntimeStateSource } from '../../../awareness/index.js';
|
|
2
|
+
export interface StableSystemPromptInputs {
|
|
3
|
+
toolBase: string;
|
|
4
|
+
memoryPrompt: string;
|
|
5
|
+
manifest: string;
|
|
6
|
+
userSystem: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function buildStableSystemPrefix(i: StableSystemPromptInputs): string[];
|
|
9
|
+
export interface EnvironmentIdentity {
|
|
10
|
+
surface: string;
|
|
11
|
+
sessionId: string | undefined;
|
|
12
|
+
depth: number | undefined;
|
|
13
|
+
maxDepth: number | undefined;
|
|
14
|
+
workspace: ReturnType<RuntimeStateSource['getWorkspace']>;
|
|
15
|
+
}
|
|
16
|
+
export declare function assembleSystemPrompt(stableSystemPrefix: string[], cwd: string, identity: EnvironmentIdentity): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { EffortLevel } from '../../../types/sdk-types.js';
|
|
2
|
+
import type { OpenAIMessage } from '../messages.js';
|
|
3
|
+
import type { OpenAIFunctionTool } from '../loop.js';
|
|
4
|
+
export interface RequestBodyInputs {
|
|
5
|
+
model: string;
|
|
6
|
+
messages: OpenAIMessage[];
|
|
7
|
+
activeTools: OpenAIFunctionTool[] | undefined;
|
|
8
|
+
maxOutputTokens: number | undefined;
|
|
9
|
+
effort: EffortLevel | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare function buildResponsesRequestBody(args: RequestBodyInputs & {
|
|
12
|
+
isChatGptBackend: boolean;
|
|
13
|
+
}): Record<string, unknown>;
|
|
14
|
+
export declare function buildChatCompletionsRequestBody(args: RequestBodyInputs): Record<string, unknown>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ProviderEvent } from '../../../provider.js';
|
|
2
|
+
import type { TraceWriter } from '../../../trace/index.js';
|
|
3
|
+
import { type StreamState } from '../translate.js';
|
|
4
|
+
export interface IterationResult {
|
|
5
|
+
state: StreamState;
|
|
6
|
+
events: ProviderEvent[];
|
|
7
|
+
text: string;
|
|
8
|
+
needsToolDispatch: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface StreamDriveStrategy<TEvent> {
|
|
11
|
+
createStream: (signal: AbortSignal) => Promise<AsyncIterable<TEvent>>;
|
|
12
|
+
translate: (event: TEvent, state: StreamState) => Iterable<ProviderEvent>;
|
|
13
|
+
clarifyError: (err: unknown) => Error;
|
|
14
|
+
}
|
|
15
|
+
export interface StreamDriveContext {
|
|
16
|
+
controller: AbortController;
|
|
17
|
+
traceWriter: TraceWriter | undefined;
|
|
18
|
+
initSessionId: string;
|
|
19
|
+
currentModel: string;
|
|
20
|
+
isClosed: () => boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function driveStream<TEvent>(ctx: StreamDriveContext, strategy: StreamDriveStrategy<TEvent>): AsyncGenerator<ProviderEvent, IterationResult | null>;
|
|
@@ -9,6 +9,7 @@ export declare class BgResultNotifier {
|
|
|
9
9
|
private readonly registry;
|
|
10
10
|
private pendingInjections;
|
|
11
11
|
private pendingNotifications;
|
|
12
|
+
onInjectable: (() => void) | null;
|
|
12
13
|
private readonly onSettled;
|
|
13
14
|
constructor(registry: BackgroundAgentRegistry);
|
|
14
15
|
drainInjections(): string;
|
|
@@ -47,6 +47,7 @@ export declare class InputSurface {
|
|
|
47
47
|
private softStopHandler;
|
|
48
48
|
private pauseInterruptHandler;
|
|
49
49
|
private pendingReadReject;
|
|
50
|
+
private pendingReadResolve;
|
|
50
51
|
private readonly slashRegistryView;
|
|
51
52
|
constructor(opts: InputSurfaceOptions);
|
|
52
53
|
armCompositor(opts: InputSurfaceArmOpts): Promise<void>;
|
|
@@ -59,5 +60,8 @@ export declare class InputSurface {
|
|
|
59
60
|
suspendForElicitation(): void;
|
|
60
61
|
resumeAfterElicitation(): void;
|
|
61
62
|
readLine(opts: InputSurfaceReadOpts): Promise<ReadWithAutocompleteResult>;
|
|
63
|
+
isAwaitingInput(): boolean;
|
|
64
|
+
bufferIsEmpty(): boolean;
|
|
65
|
+
abortPendingRead(): void;
|
|
62
66
|
toRunTurnRefs(promptText: string): InputSurfaceRefs;
|
|
63
67
|
}
|