agent-afk 5.30.4 → 5.30.6
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/hooks.d.ts +1 -0
- 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.mjs +421 -423
- package/dist/index.mjs +155 -157
- package/dist/telegram.mjs +204 -206
- package/package.json +1 -1
package/dist/agent/hooks.d.ts
CHANGED
|
@@ -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>;
|