agent-afk 5.277.0 → 5.278.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/plugins/tool-injector.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/auth.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/query/build-query.d.ts +19 -0
- package/dist/agent/providers/openai-compatible/query/live-updates.d.ts +5 -0
- package/dist/agent/providers/openai-compatible/query/query-options.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/query/rewind-conversation.d.ts +5 -0
- package/dist/agent/providers/openai-compatible/query/turn-driver.d.ts +3 -0
- package/dist/agent/providers/openai-compatible/query.d.ts +12 -16
- package/dist/agent/tools/skill-bridge.d.ts +1 -0
- package/dist/cli/config/types.d.ts +6 -0
- package/dist/cli/slash/commands/afk-md/reload.d.ts +1 -0
- package/dist/cli.mjs +307 -305
- package/dist/config/mutate.d.ts +1 -1
- package/dist/config/settable-keys.d.ts +2 -2
- package/dist/index.mjs +128 -126
- package/dist/skills/skill-types.d.ts +1 -0
- package/dist/telegram.mjs +148 -146
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ export interface PluginSkillMetadata {
|
|
|
10
10
|
model?: string;
|
|
11
11
|
body?: string;
|
|
12
12
|
audience?: 'public' | 'internal';
|
|
13
|
+
disableModelInvocation?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare function normalizeToolToken(token: string, knownToolNames: ReadonlySet<string>): string | undefined;
|
|
15
16
|
export declare function parseToolsField(inlineValue: string, remainingLines: string[]): string[];
|
|
@@ -13,6 +13,7 @@ export declare function buildClientOptions(token: string, mode: AuthMode, baseUr
|
|
|
13
13
|
}) & {
|
|
14
14
|
baseURL?: string;
|
|
15
15
|
fetch?: typeof fetch;
|
|
16
|
+
maxRetries: 0;
|
|
16
17
|
};
|
|
17
18
|
export declare function buildRequestHeaders(mode: AuthMode, sessionId: string, requestId: string, withEffort?: boolean, extendedCacheTtl?: boolean, withFast?: boolean): Record<string, string>;
|
|
18
19
|
export declare function buildSystemPrefix(mode: AuthMode): ContentBlockParam[] | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AgentConfig } from '../../../types/config-types.js';
|
|
2
|
+
import type { ProviderUserTurn } from '../../../provider.js';
|
|
3
|
+
import { type AuthResolverDeps } from '../auth.js';
|
|
4
|
+
import type { ToolDispatcher } from '../../anthropic-direct/tool-dispatcher.js';
|
|
5
|
+
import { OpenAICompatibleQuery } from '../query.js';
|
|
6
|
+
import type { FastTierOptions } from './fast-tier-session.js';
|
|
7
|
+
export declare function buildQueryFromConfig(config: AgentConfig, promptStream: AsyncIterable<ProviderUserTurn>, options?: {
|
|
8
|
+
baseURL?: string;
|
|
9
|
+
defaultHeaders?: Record<string, string>;
|
|
10
|
+
toolDispatcher?: ToolDispatcher;
|
|
11
|
+
onPermissionMode?: (mode: string) => void;
|
|
12
|
+
onCwdChange?: (cwd: string) => void;
|
|
13
|
+
systemPromptRebuildFactory?: (basePrompt: string | undefined) => string;
|
|
14
|
+
mcpManager?: import('../../../mcp/index.js').McpManager;
|
|
15
|
+
useResponsesApi?: boolean;
|
|
16
|
+
authDeps?: AuthResolverDeps;
|
|
17
|
+
sessionIdOverride?: string;
|
|
18
|
+
fastTier?: FastTierOptions;
|
|
19
|
+
}): OpenAICompatibleQuery;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AgentConfig } from '../../../types/config-types.js';
|
|
2
|
+
export declare function applySetSystemPrompt(config: AgentConfig, basePrompt: string | undefined, systemPromptRebuildFactory?: (basePrompt: string | undefined) => string, currentBasePromptRef?: {
|
|
3
|
+
current: string | undefined;
|
|
4
|
+
}): boolean;
|
|
5
|
+
export type BeforeNextRoundCallback = (() => string | undefined) | undefined;
|
|
@@ -15,6 +15,7 @@ export interface OpenAICompatibleQueryOptions {
|
|
|
15
15
|
toolDispatcher?: ToolDispatcher;
|
|
16
16
|
onPermissionMode?: (mode: string) => void;
|
|
17
17
|
onCwdChange?: (cwd: string) => void;
|
|
18
|
+
systemPromptRebuildFactory?: (basePrompt: string | undefined) => string;
|
|
18
19
|
mcpManager?: import('../../../mcp/index.js').McpManager;
|
|
19
20
|
useResponsesApi?: boolean;
|
|
20
21
|
traceWriter?: TraceSink;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ProviderRewindConversationResult, RewindTarget } from '../../../provider.js';
|
|
2
|
+
import type { OpenAIMessage } from '../messages.js';
|
|
3
|
+
import type { AbortCoordinator } from '../../shared/abort-coordinator.js';
|
|
4
|
+
export declare function listOpenAIUserTurns(priorTurns: readonly OpenAIMessage[]): RewindTarget[];
|
|
5
|
+
export declare function rewindOpenAIConversation(priorTurns: OpenAIMessage[], abort: AbortCoordinator, closed: boolean, turnIndex: number): ProviderRewindConversationResult;
|
|
@@ -21,5 +21,8 @@ export interface TurnDriverContext extends IterationContext, FinishTurnContext {
|
|
|
21
21
|
readonly currentModel: string;
|
|
22
22
|
readonly currentPermissionMode: string;
|
|
23
23
|
readonly closed: boolean;
|
|
24
|
+
readonly beforeNextRound: (() => string | undefined) | undefined;
|
|
24
25
|
}
|
|
26
|
+
export declare function applyBeforeNextRound(priorTurns: OpenAIMessage[], steeringText: string | undefined, traceWriter: TraceSink | undefined, subagentId: string | undefined): void;
|
|
27
|
+
export declare function applyAndSyncSteering(ctx: TurnDriverContext): void;
|
|
25
28
|
export declare function runTurnInner(ctx: TurnDriverContext, content: ProviderUserTurn['content'], controller: AbortController, turnStartTime: number, taskId: string): AsyncGenerator<ProviderEvent>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import OpenAI from 'openai';
|
|
2
|
-
import type { AgentConfig } from '../../types/config-types.js';
|
|
3
2
|
import type { TraceSink } from '../../trace/index.js';
|
|
4
|
-
import type { ProviderQuery, ProviderEvent,
|
|
5
|
-
import { type AuthResolverDeps } from './auth.js';
|
|
3
|
+
import type { ProviderQuery, ProviderEvent, ProviderContextUsage, ProviderRewindResult, ProviderModelInfo, ProviderCommandInfo, ProviderAgentInfo, ProviderMcpServerStatus, ProviderAccountInfo, ProviderUsage, ProviderCompactResult } from '../../provider.js';
|
|
6
4
|
import { type OpenAIMessage } from './messages.js';
|
|
7
5
|
import { type OpenAIFunctionTool } from './loop.js';
|
|
8
6
|
import { type WireMode } from './responses-config.js';
|
|
@@ -10,11 +8,13 @@ import type { ToolDispatcher } from '../anthropic-direct/tool-dispatcher.js';
|
|
|
10
8
|
import { AbortCoordinator } from '../shared/abort-coordinator.js';
|
|
11
9
|
import { OpenAIJournalWiring } from './query/journal-wiring.js';
|
|
12
10
|
import { resolveReasoningEffort } from './query/model-params.js';
|
|
13
|
-
import { FastTierSession
|
|
11
|
+
import { FastTierSession } from './query/fast-tier-session.js';
|
|
14
12
|
import { type TurnDriverContext } from './query/turn-driver.js';
|
|
15
13
|
import { type CompactHandlerContext } from './query/compact-handler.js';
|
|
16
14
|
import type { OpenAICompatibleQueryOptions } from './query/query-options.js';
|
|
17
15
|
export type { OpenAICompatibleQueryOptions } from './query/query-options.js';
|
|
16
|
+
import { type BeforeNextRoundCallback } from './query/live-updates.js';
|
|
17
|
+
export { buildQueryFromConfig } from './query/build-query.js';
|
|
18
18
|
export { __setRetryBaseDelay } from './query/retry.js';
|
|
19
19
|
export { __setOpenAIClientFactory } from './query/client.js';
|
|
20
20
|
export type { OpenAIClientFactory } from './query/client.js';
|
|
@@ -27,6 +27,10 @@ export declare class OpenAICompatibleQuery implements ProviderQuery, TurnDriverC
|
|
|
27
27
|
readonly toolDispatcher: ToolDispatcher | undefined;
|
|
28
28
|
private readonly onPermissionMode?;
|
|
29
29
|
private readonly onCwdChange?;
|
|
30
|
+
private readonly systemPromptRebuildFactory?;
|
|
31
|
+
private readonly _currentBasePromptRef;
|
|
32
|
+
private _beforeNextRound;
|
|
33
|
+
get beforeNextRound(): BeforeNextRoundCallback;
|
|
30
34
|
private readonly openAITools;
|
|
31
35
|
readonly wireMode: WireMode;
|
|
32
36
|
readonly useOpenAIPricing: boolean;
|
|
@@ -56,6 +60,10 @@ export declare class OpenAICompatibleQuery implements ProviderQuery, TurnDriverC
|
|
|
56
60
|
setModel(model?: string): Promise<void>;
|
|
57
61
|
setPermissionMode(mode: string): Promise<void>;
|
|
58
62
|
setCwd(cwd: string): void;
|
|
63
|
+
setSystemPrompt(basePrompt: string | undefined): boolean;
|
|
64
|
+
setBeforeNextRound(cb: BeforeNextRoundCallback): void;
|
|
65
|
+
listRewindTargets(): import('../../provider.js').RewindTarget[];
|
|
66
|
+
rewindConversation(turnIndex: number): Promise<import('../../provider.js').ProviderRewindConversationResult>;
|
|
59
67
|
supportedCommands(): Promise<ProviderCommandInfo[]>;
|
|
60
68
|
supportedModels(): Promise<ProviderModelInfo[]>;
|
|
61
69
|
supportedAgents(): Promise<ProviderAgentInfo[]>;
|
|
@@ -68,15 +76,3 @@ export declare class OpenAICompatibleQuery implements ProviderQuery, TurnDriverC
|
|
|
68
76
|
journalSnapshot(): ReturnType<OpenAIJournalWiring['snapshot']>;
|
|
69
77
|
close(): void;
|
|
70
78
|
}
|
|
71
|
-
export declare function buildQueryFromConfig(config: AgentConfig, promptStream: AsyncIterable<ProviderUserTurn>, options?: {
|
|
72
|
-
baseURL?: string;
|
|
73
|
-
defaultHeaders?: Record<string, string>;
|
|
74
|
-
toolDispatcher?: ToolDispatcher;
|
|
75
|
-
onPermissionMode?: (mode: string) => void;
|
|
76
|
-
onCwdChange?: (cwd: string) => void;
|
|
77
|
-
mcpManager?: import('../../mcp/index.js').McpManager;
|
|
78
|
-
useResponsesApi?: boolean;
|
|
79
|
-
authDeps?: AuthResolverDeps;
|
|
80
|
-
sessionIdOverride?: string;
|
|
81
|
-
fastTier?: FastTierOptions;
|
|
82
|
-
}): OpenAICompatibleQuery;
|
|
@@ -7,6 +7,7 @@ export interface SkillManifestEntry {
|
|
|
7
7
|
source: 'builtin' | 'user' | 'project' | 'plugin' | 'imported' | 'command';
|
|
8
8
|
argumentHint?: string;
|
|
9
9
|
whenToUse?: string;
|
|
10
|
+
disableModelInvocation?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export declare function buildSkillManifest(pluginConfigs?: SdkPluginConfig[], opts?: BuildSkillManifestOptions): string;
|
|
12
13
|
export interface CollectSkillEntriesOptions {
|
|
@@ -62,6 +62,9 @@ export interface CliConfig {
|
|
|
62
62
|
enableShellHooks?: boolean;
|
|
63
63
|
enablePluginHooks?: boolean;
|
|
64
64
|
importFrom?: ImportFromConfig;
|
|
65
|
+
skills?: {
|
|
66
|
+
hidden?: string[];
|
|
67
|
+
};
|
|
65
68
|
}
|
|
66
69
|
export interface ModelSlotConfigEntry {
|
|
67
70
|
id?: string;
|
|
@@ -131,6 +134,9 @@ export interface ConfigFileSchema {
|
|
|
131
134
|
skills?: boolean;
|
|
132
135
|
mcp?: boolean;
|
|
133
136
|
}>>;
|
|
137
|
+
skills?: {
|
|
138
|
+
hidden?: unknown[];
|
|
139
|
+
};
|
|
134
140
|
}
|
|
135
141
|
export declare const DEFAULT_CONFIG: Omit<CliConfig, 'apiKey'>;
|
|
136
142
|
export declare const DEFAULT_CLI_PERMISSION_MODE: PermissionMode;
|
|
@@ -5,6 +5,7 @@ export interface ReloadOutcome {
|
|
|
5
5
|
delta: number;
|
|
6
6
|
source: string;
|
|
7
7
|
shadowed: boolean;
|
|
8
|
+
frameworkPromptError?: string;
|
|
8
9
|
}
|
|
9
10
|
export declare function currentOverlayTokens(cwd?: string): number;
|
|
10
11
|
export declare function applyReload(ctx: SlashContext, baselineTokens: number): ReloadOutcome;
|