agent-afk 5.97.3 → 5.97.4
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/cli.mjs +2 -2
- package/dist/index.mjs +1 -1
- package/dist/telegram/create-session.d.ts +12 -0
- package/dist/telegram/credentials.d.ts +27 -0
- package/dist/telegram/daemon-version.d.ts +3 -0
- package/dist/telegram/entry.d.ts +1 -0
- package/dist/telegram/env-file-overrides.d.ts +4 -0
- package/dist/telegram/session-anthropic.d.ts +3 -0
- package/dist/telegram/session-context.d.ts +21 -0
- package/dist/telegram/session-openai.d.ts +3 -0
- package/dist/telegram/stats-ticker.d.ts +21 -0
- package/dist/telegram.mjs +298 -298
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type AnthropicAuthEnvVar = 'CLAUDE_CODE_OAUTH_TOKEN' | 'ANTHROPIC_API_KEY';
|
|
2
|
+
export type TelegramCredentialPlan = {
|
|
3
|
+
kind: 'openai';
|
|
4
|
+
notices: string[];
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'anthropic';
|
|
7
|
+
credential: string;
|
|
8
|
+
envVar: AnthropicAuthEnvVar;
|
|
9
|
+
notices: string[];
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'missing';
|
|
12
|
+
errors: string[];
|
|
13
|
+
};
|
|
14
|
+
export interface TelegramCredentialDeps {
|
|
15
|
+
openaiApiKey?: string | undefined;
|
|
16
|
+
codexApiKey?: string | undefined;
|
|
17
|
+
loadAnthropicCredential?: () => string | undefined;
|
|
18
|
+
detectMode?: (token: string) => 'oauth' | 'api-key';
|
|
19
|
+
}
|
|
20
|
+
export declare function isOpenAiRoutedProvider(providerName: string): boolean;
|
|
21
|
+
export declare function planTelegramCredential(providerName: string, deps?: TelegramCredentialDeps): TelegramCredentialPlan;
|
|
22
|
+
export declare function applyTelegramCredentialPlan(plan: TelegramCredentialPlan, config: {
|
|
23
|
+
apiKey?: string | undefined;
|
|
24
|
+
}, io?: {
|
|
25
|
+
log?: (message: string) => void;
|
|
26
|
+
error?: (message: string) => void;
|
|
27
|
+
}): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function main(): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const TELEGRAM_FILE_AUTHORITATIVE_KEYS: string[];
|
|
2
|
+
export declare function parseEnvFile(filePath: string): Map<string, string>;
|
|
3
|
+
export declare function maskOverrideValue(key: string, raw: string): string;
|
|
4
|
+
export declare function applyTelegramFileOverrides(filePath: string, log?: (message: string) => void): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AgentSession } from '../agent/session.js';
|
|
2
|
+
import type { AgentConfig } from '../agent/types.js';
|
|
3
|
+
import type { MemoryStore } from '../agent/memory/index.js';
|
|
4
|
+
import type { loadConfig } from '../cli/config.js';
|
|
5
|
+
import type { createTelegramTraceWriter } from './construct-session.js';
|
|
6
|
+
import type { loadTelegramMcpManager } from './mcp-session.js';
|
|
7
|
+
export type TelegramBotConfig = ReturnType<typeof loadConfig>;
|
|
8
|
+
export type TelegramTraceWriter = ReturnType<typeof createTelegramTraceWriter>;
|
|
9
|
+
export type TelegramMcpManager = Awaited<ReturnType<typeof loadTelegramMcpManager>>;
|
|
10
|
+
export interface TelegramSessionBuildContext {
|
|
11
|
+
sessionConfig: AgentConfig;
|
|
12
|
+
config: TelegramBotConfig;
|
|
13
|
+
layeredBasePrompt: string | undefined;
|
|
14
|
+
sessionCwd: string | undefined;
|
|
15
|
+
maxOutputTokens: number | undefined;
|
|
16
|
+
maxToolUseIterations: number | undefined;
|
|
17
|
+
traceWriter: TelegramTraceWriter;
|
|
18
|
+
mcpManager: TelegramMcpManager;
|
|
19
|
+
memoryStore: MemoryStore;
|
|
20
|
+
reportSession: (session: AgentSession) => void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const STATS_TICK_MS = 300000;
|
|
2
|
+
export interface StatsTickerBot {
|
|
3
|
+
getStats(): {
|
|
4
|
+
activeSessions: number;
|
|
5
|
+
totalChats: number;
|
|
6
|
+
};
|
|
7
|
+
getBusySessionCount(): number;
|
|
8
|
+
}
|
|
9
|
+
export interface StatsTickerOptions {
|
|
10
|
+
bot: StatsTickerBot;
|
|
11
|
+
spawnedVersion: string;
|
|
12
|
+
intervalMs?: number;
|
|
13
|
+
log?: (message: string) => void;
|
|
14
|
+
warn?: (message: string) => void;
|
|
15
|
+
exit?: (code: number) => void;
|
|
16
|
+
readVersion?: () => string;
|
|
17
|
+
}
|
|
18
|
+
export declare function runStatsTick(options: StatsTickerOptions & {
|
|
19
|
+
deferrals: number;
|
|
20
|
+
}): number;
|
|
21
|
+
export declare function startStatsTicker(options: StatsTickerOptions): NodeJS.Timeout;
|