agent-afk 5.27.0 → 5.27.2
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/index.d.ts +1 -1
- package/dist/agent/providers/openai-compatible/index.d.ts +1 -1
- package/dist/agent/tools/dispatcher.d.ts +3 -7
- package/dist/agent/tools/grant-manager.d.ts +25 -0
- package/dist/agent/tools/skill-executor/fork-child-config.d.ts +7 -0
- package/dist/agent/tools/skill-executor/fork-dispatch.d.ts +22 -0
- package/dist/agent/tools/skill-executor/load-mode.d.ts +11 -0
- package/dist/agent/tools/skill-executor/telemetry.d.ts +10 -0
- package/dist/agent/tools/skill-executor/types.d.ts +35 -0
- package/dist/agent/tools/skill-executor.d.ts +3 -36
- package/dist/cli/config/afk-md-tier.d.ts +5 -0
- package/dist/cli/config/env-tier.d.ts +6 -0
- package/dist/cli/config/json-tier.d.ts +8 -0
- package/dist/cli/config/types.d.ts +121 -0
- package/dist/cli/config.d.ts +5 -60
- package/dist/cli.mjs +441 -443
- package/dist/index.mjs +138 -140
- package/dist/telegram.mjs +229 -231
- package/package.json +1 -1
|
@@ -64,6 +64,7 @@ export declare class AnthropicDirectProvider implements ModelProvider {
|
|
|
64
64
|
close(): void;
|
|
65
65
|
complete(args: ProviderCompleteArgs): Promise<string>;
|
|
66
66
|
private ensureSharedRoots;
|
|
67
|
+
private readonly grantManager;
|
|
67
68
|
addReadRoot(absPath: string, source?: 'slash' | 'tool', sessionId?: string): void;
|
|
68
69
|
addWriteRoot(absPath: string, source?: 'slash' | 'tool', sessionId?: string): void;
|
|
69
70
|
revokeRoot(absPath: string, source?: 'slash' | 'tool', sessionId?: string): void;
|
|
@@ -73,7 +74,6 @@ export declare class AnthropicDirectProvider implements ModelProvider {
|
|
|
73
74
|
writeRoots: string[];
|
|
74
75
|
allowAll: boolean;
|
|
75
76
|
};
|
|
76
|
-
private appendProviderAuditLog;
|
|
77
77
|
query(args: ProviderQueryArgs): ProviderQuery;
|
|
78
78
|
}
|
|
79
79
|
export declare const anthropicDirectProvider: ModelProvider;
|
|
@@ -37,6 +37,7 @@ export declare class OpenAICompatibleProvider implements ModelProvider {
|
|
|
37
37
|
query(args: ProviderQueryArgs): ProviderQuery;
|
|
38
38
|
private buildDispatcher;
|
|
39
39
|
private ensureSharedRoots;
|
|
40
|
+
private readonly grantManager;
|
|
40
41
|
addReadRoot(absPath: string, source?: 'slash' | 'tool', sessionId?: string): void;
|
|
41
42
|
addWriteRoot(absPath: string, source?: 'slash' | 'tool', sessionId?: string): void;
|
|
42
43
|
revokeRoot(absPath: string, source?: 'slash' | 'tool', sessionId?: string): void;
|
|
@@ -46,7 +47,6 @@ export declare class OpenAICompatibleProvider implements ModelProvider {
|
|
|
46
47
|
writeRoots: string[];
|
|
47
48
|
allowAll: boolean;
|
|
48
49
|
};
|
|
49
|
-
private appendProviderAuditLog;
|
|
50
50
|
close(): void;
|
|
51
51
|
complete(args: ProviderCompleteArgs): Promise<string>;
|
|
52
52
|
}
|
|
@@ -8,6 +8,7 @@ import type { ComposeExecutor } from './compose-executor.js';
|
|
|
8
8
|
import type { ToolHandler, ConcurrencyClassifier } from './types.js';
|
|
9
9
|
import { type ToolPermissionConfig } from './permissions.js';
|
|
10
10
|
import type { CanUseTool } from '../types/sdk-types.js';
|
|
11
|
+
import { type GrantSnapshot } from './grant-manager.js';
|
|
11
12
|
import type { TraceWriter } from '../trace/index.js';
|
|
12
13
|
export declare function defaultConcurrencyClassifier(toolName: string): boolean;
|
|
13
14
|
export declare const REPEAT_CIRCUIT_BREAKER_THRESHOLD = 8;
|
|
@@ -54,21 +55,16 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
|
|
|
54
55
|
private readonly traceWriter;
|
|
55
56
|
private readonly readOnlyBash;
|
|
56
57
|
private repeatBreaker;
|
|
58
|
+
private readonly grantManager;
|
|
57
59
|
constructor(opts: SessionToolDispatcherOptions);
|
|
58
60
|
private get handlerContext();
|
|
59
61
|
private callHandlerContext;
|
|
60
62
|
addReadRoot(absPath: string, source?: 'slash' | 'tool'): void;
|
|
61
63
|
addWriteRoot(absPath: string, source?: 'slash' | 'tool'): void;
|
|
62
64
|
revokeRoot(absPath: string, source?: 'slash' | 'tool'): void;
|
|
63
|
-
getGrants():
|
|
64
|
-
resolveBase: string | undefined;
|
|
65
|
-
readRoots: string[];
|
|
66
|
-
writeRoots: string[];
|
|
67
|
-
allowAll: boolean;
|
|
68
|
-
};
|
|
65
|
+
getGrants(): GrantSnapshot;
|
|
69
66
|
setAllowAll(allow: boolean): void;
|
|
70
67
|
setResolveBase(newCwd: string): void;
|
|
71
|
-
private appendAuditLog;
|
|
72
68
|
get toolDefs(): readonly AnthropicToolDef[];
|
|
73
69
|
private checkReadOnlyBash;
|
|
74
70
|
private checkRepeatCircuitBreaker;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type GrantAuditAction = 'grant-read' | 'grant-write' | 'revoke';
|
|
2
|
+
export type GrantSource = 'slash' | 'tool';
|
|
3
|
+
export interface GrantSnapshot {
|
|
4
|
+
resolveBase: string | undefined;
|
|
5
|
+
readRoots: string[];
|
|
6
|
+
writeRoots: string[];
|
|
7
|
+
allowAll: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PathGrantManagerHooks {
|
|
10
|
+
getReadRoots(): string[] | undefined;
|
|
11
|
+
getWriteRoots(): string[] | undefined;
|
|
12
|
+
ensureInitialized?(): void;
|
|
13
|
+
getProtectedRoot(): string | undefined;
|
|
14
|
+
getAllowAll(): boolean;
|
|
15
|
+
getDefaultSessionId?(): string | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare class PathGrantManager {
|
|
18
|
+
private readonly hooks;
|
|
19
|
+
constructor(hooks: PathGrantManagerHooks);
|
|
20
|
+
addReadRoot(absPath: string, source?: GrantSource, sessionId?: string): void;
|
|
21
|
+
addWriteRoot(absPath: string, source?: GrantSource, sessionId?: string): void;
|
|
22
|
+
revokeRoot(absPath: string, source?: GrantSource, sessionId?: string): void;
|
|
23
|
+
getGrants(): GrantSnapshot;
|
|
24
|
+
private appendAuditLog;
|
|
25
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SubagentManager } from '../../subagent.js';
|
|
2
|
+
import type { AgentConfig } from '../../types/config-types.js';
|
|
3
|
+
import type { SkillExecutorInternals } from './types.js';
|
|
4
|
+
export declare function buildForkedChildConfig(internals: SkillExecutorInternals, baseConfig: AgentConfig, signal: AbortSignal, readOnly?: boolean, allowedTools?: string[]): {
|
|
5
|
+
childConfig: AgentConfig;
|
|
6
|
+
childManager: SubagentManager | undefined;
|
|
7
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SubagentManager } from '../../subagent.js';
|
|
2
|
+
import type { ToolCall, ToolResult } from '../types.js';
|
|
3
|
+
import type { AgentConfig } from '../../types/config-types.js';
|
|
4
|
+
import type { SkillExecutorInternals } from './types.js';
|
|
5
|
+
export declare function executeForkedRegistrySkill(internals: SkillExecutorInternals, skill: {
|
|
6
|
+
name: string;
|
|
7
|
+
context?: 'inline' | 'fork' | 'load';
|
|
8
|
+
model?: string;
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
}, args: string | undefined, call: ToolCall): Promise<ToolResult>;
|
|
11
|
+
export declare function executePluginSkill(internals: SkillExecutorInternals, skillName: string, body: string, pluginPath: string, args: string | undefined, call: ToolCall, readOnly?: boolean, allowedTools?: string[]): Promise<ToolResult>;
|
|
12
|
+
export declare function runForkedSkillToResult(internals: SkillExecutorInternals, params: {
|
|
13
|
+
manager: SubagentManager;
|
|
14
|
+
childManager: SubagentManager | undefined;
|
|
15
|
+
childConfig: AgentConfig;
|
|
16
|
+
label: string;
|
|
17
|
+
idPrefix: string;
|
|
18
|
+
parentId: string;
|
|
19
|
+
args: string | undefined;
|
|
20
|
+
noOutputError: string;
|
|
21
|
+
errorPrefix: string;
|
|
22
|
+
}): Promise<ToolResult>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ToolCall, ToolResult } from '../types.js';
|
|
2
|
+
import type { SkillExecutorInternals } from './types.js';
|
|
3
|
+
export declare function formatLoadedSkillResult(name: string, body: string, args: string | undefined): ToolResult;
|
|
4
|
+
export declare function emitLoadTelemetry(internals: SkillExecutorInternals, name: string, contentChars: number, durationMs: number, model: string | undefined): void;
|
|
5
|
+
export declare function executeLoadedRegistrySkill(internals: SkillExecutorInternals, skill: {
|
|
6
|
+
name: string;
|
|
7
|
+
model?: string;
|
|
8
|
+
loadBody?: string;
|
|
9
|
+
}, args: string | undefined, call: ToolCall): ToolResult;
|
|
10
|
+
export declare function executeLoadedPluginSkill(internals: SkillExecutorInternals, skillName: string, body: string, args: string | undefined, call: ToolCall): ToolResult;
|
|
11
|
+
export declare function substituteSkillArgs(body: string, args: string | undefined): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TraceOrigin, type TraceActor } from '../../session/session-identity.js';
|
|
2
|
+
import type { SkillExecutorContext } from './types.js';
|
|
3
|
+
export declare const GATE_SKILLS: Set<string>;
|
|
4
|
+
export declare function isGateSkill(name: string): boolean;
|
|
5
|
+
export declare const MAX_TELEMETRY_ERROR_CHARS = 240;
|
|
6
|
+
export declare function truncateTelemetryString(s: string, max?: number): string;
|
|
7
|
+
export declare function sessionIdentity(ctx: SkillExecutorContext): {
|
|
8
|
+
origin?: TraceOrigin;
|
|
9
|
+
actor?: TraceActor;
|
|
10
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AgentModelInput, IAgentSession } from '../../types.js';
|
|
2
|
+
import type { ModelProvider } from '../../provider.js';
|
|
3
|
+
import type { TraceWriter } from '../../trace/index.js';
|
|
4
|
+
import type { BackgroundAgentRegistry } from '../../background-registry.js';
|
|
5
|
+
import type { SdkPluginConfig } from '../../types/sdk-types.js';
|
|
6
|
+
import type { ChildProviderFactoryArgs } from '../nesting.js';
|
|
7
|
+
import type { Surface } from '../../awareness/types.js';
|
|
8
|
+
import type { SkillExecutor } from '../skill-executor.js';
|
|
9
|
+
export interface SkillExecutorContext {
|
|
10
|
+
parentSession: Pick<IAgentSession, 'sessionId' | 'getInputStreamRef' | 'abortSignal'> & Partial<Pick<IAgentSession, 'hookRegistry'>>;
|
|
11
|
+
defaultModel?: string;
|
|
12
|
+
surface?: Surface;
|
|
13
|
+
defaultSubagentModel?: AgentModelInput;
|
|
14
|
+
apiKey?: string;
|
|
15
|
+
resolveApiKeyForModel?: (model: string) => string | undefined;
|
|
16
|
+
baseUrl?: string;
|
|
17
|
+
openaiBaseUrl?: string;
|
|
18
|
+
pluginConfigs?: SdkPluginConfig[];
|
|
19
|
+
depth?: number;
|
|
20
|
+
maxDepth?: number;
|
|
21
|
+
childProviderFactory?: (args: ChildProviderFactoryArgs) => ModelProvider;
|
|
22
|
+
childSkillExecutorFactory?: (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string) => SkillExecutor;
|
|
23
|
+
traceWriter?: TraceWriter;
|
|
24
|
+
backgroundRegistry?: BackgroundAgentRegistry;
|
|
25
|
+
cwd?: string;
|
|
26
|
+
agentRegistry?: import('../../agents/index.js').AgentRegistry;
|
|
27
|
+
}
|
|
28
|
+
export interface SkillInput {
|
|
29
|
+
name: string;
|
|
30
|
+
arguments?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface SkillExecutorInternals {
|
|
33
|
+
readonly ctx: SkillExecutorContext;
|
|
34
|
+
readonly currentCwd: string | undefined;
|
|
35
|
+
}
|
|
@@ -1,48 +1,15 @@
|
|
|
1
|
-
import type { AgentModelInput, IAgentSession } from '../types.js';
|
|
2
|
-
import type { ModelProvider } from '../provider.js';
|
|
3
1
|
import type { ToolCall, ToolResult } from './types.js';
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
import type { SdkPluginConfig } from '../types/sdk-types.js';
|
|
7
|
-
import { type ChildProviderFactoryArgs } from './nesting.js';
|
|
8
|
-
import type { Surface } from '../awareness/types.js';
|
|
9
|
-
export interface SkillExecutorContext {
|
|
10
|
-
parentSession: Pick<IAgentSession, 'sessionId' | 'getInputStreamRef' | 'abortSignal'> & Partial<Pick<IAgentSession, 'hookRegistry'>>;
|
|
11
|
-
defaultModel?: string;
|
|
12
|
-
surface?: Surface;
|
|
13
|
-
defaultSubagentModel?: AgentModelInput;
|
|
14
|
-
apiKey?: string;
|
|
15
|
-
resolveApiKeyForModel?: (model: string) => string | undefined;
|
|
16
|
-
baseUrl?: string;
|
|
17
|
-
openaiBaseUrl?: string;
|
|
18
|
-
pluginConfigs?: SdkPluginConfig[];
|
|
19
|
-
depth?: number;
|
|
20
|
-
maxDepth?: number;
|
|
21
|
-
childProviderFactory?: (args: ChildProviderFactoryArgs) => ModelProvider;
|
|
22
|
-
childSkillExecutorFactory?: (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string) => SkillExecutor;
|
|
23
|
-
traceWriter?: TraceWriter;
|
|
24
|
-
backgroundRegistry?: BackgroundAgentRegistry;
|
|
25
|
-
cwd?: string;
|
|
26
|
-
agentRegistry?: import('../agents/index.js').AgentRegistry;
|
|
27
|
-
}
|
|
2
|
+
import type { SkillExecutorContext } from './skill-executor/types.js';
|
|
3
|
+
export type { SkillExecutorContext } from './skill-executor/types.js';
|
|
28
4
|
export declare class SkillExecutor {
|
|
29
5
|
private readonly ctx;
|
|
30
6
|
private pluginBodies;
|
|
31
7
|
private currentCwd;
|
|
32
8
|
constructor(ctx: SkillExecutorContext);
|
|
33
9
|
setCwd(cwd: string): void;
|
|
34
|
-
private
|
|
10
|
+
private internals;
|
|
35
11
|
execute(call: ToolCall): Promise<ToolResult>;
|
|
36
12
|
private executeRegistrySkill;
|
|
37
|
-
private buildForkedChildConfig;
|
|
38
|
-
private executeForkedRegistrySkill;
|
|
39
|
-
private formatLoadedSkillResult;
|
|
40
|
-
private emitLoadTelemetry;
|
|
41
|
-
private executeLoadedRegistrySkill;
|
|
42
|
-
private executeLoadedPluginSkill;
|
|
43
|
-
private substituteSkillArgs;
|
|
44
|
-
private executePluginSkill;
|
|
45
|
-
private runForkedSkillToResult;
|
|
46
13
|
private getPluginSkillBody;
|
|
47
14
|
private createDispatchSkillCallback;
|
|
48
15
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CliConfig } from './types.js';
|
|
2
|
+
export declare function loadCredential(): string | undefined;
|
|
3
|
+
export declare function normalizeOpenAIBaseUrl(raw: string): string;
|
|
4
|
+
export declare function _resetOpenAIBaseUrlWarnCache(): void;
|
|
5
|
+
export declare function loadEnvConfig(): Partial<CliConfig>;
|
|
6
|
+
export declare function resetEnvConfigCache(): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ModelSlotBinding, type SlotName } from '../../agent/session/model-slots.js';
|
|
2
|
+
import type { CliConfig } from './types.js';
|
|
3
|
+
export declare function resetJsonConfigCache(): void;
|
|
4
|
+
export declare function loadJsonConfig(): {
|
|
5
|
+
config: Partial<CliConfig>;
|
|
6
|
+
sourcePath: string | undefined;
|
|
7
|
+
modelsPartial: Partial<Record<SlotName, ModelSlotBinding>>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { ModelSlots } from '../../agent/session/model-slots.js';
|
|
2
|
+
import type { AgentModelInput } from '../../agent/types.js';
|
|
3
|
+
import type { PermissionMode } from '../../agent/types/sdk-types.js';
|
|
4
|
+
import type { RawHooksConfig } from '../../agent/hooks/config-loader.js';
|
|
5
|
+
import type { ImportFromConfig, ImportSourceBinary } from '../../config/import-sources.js';
|
|
6
|
+
export interface AutoRoutingConfig {
|
|
7
|
+
interactive?: boolean;
|
|
8
|
+
chat?: boolean;
|
|
9
|
+
telegram?: boolean;
|
|
10
|
+
daemon?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface CliConfig {
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
baseUrl?: string;
|
|
15
|
+
model: AgentModelInput;
|
|
16
|
+
models?: ModelSlots;
|
|
17
|
+
maxTokens: number;
|
|
18
|
+
temperature: number;
|
|
19
|
+
openaiBaseUrl?: string;
|
|
20
|
+
systemPrompt?: string;
|
|
21
|
+
systemPromptSource?: string;
|
|
22
|
+
permissionMode?: PermissionMode;
|
|
23
|
+
autoRouting?: AutoRoutingConfig;
|
|
24
|
+
daemon?: {
|
|
25
|
+
task?: string;
|
|
26
|
+
taskId?: string;
|
|
27
|
+
worktreePrune?: {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
cron: string;
|
|
30
|
+
maxAgeDaysClean: number;
|
|
31
|
+
maxAgeDaysDirty: number;
|
|
32
|
+
scope: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
telegram?: {
|
|
36
|
+
notify?: {
|
|
37
|
+
mode?: 'primary' | 'broadcast' | 'custom';
|
|
38
|
+
primaryChatId?: number;
|
|
39
|
+
targets?: number[];
|
|
40
|
+
};
|
|
41
|
+
verifyDone?: boolean;
|
|
42
|
+
};
|
|
43
|
+
interactive?: {
|
|
44
|
+
worktreeAutoname?: boolean;
|
|
45
|
+
worktreeBranchPrefix?: string;
|
|
46
|
+
worktreeBase?: string;
|
|
47
|
+
suggestGhost?: boolean;
|
|
48
|
+
thinkingUi?: 'summary' | 'live' | 'digest' | 'off';
|
|
49
|
+
};
|
|
50
|
+
updatePolicy: 'notify' | 'auto' | 'off';
|
|
51
|
+
autoResumeOnUsageLimit?: boolean;
|
|
52
|
+
bgSummaries?: boolean;
|
|
53
|
+
maxSummaryCallsPerSession?: number;
|
|
54
|
+
hooks?: RawHooksConfig;
|
|
55
|
+
enableShellHooks?: boolean;
|
|
56
|
+
importFrom?: ImportFromConfig;
|
|
57
|
+
}
|
|
58
|
+
export interface ModelSlotConfigEntry {
|
|
59
|
+
id?: string;
|
|
60
|
+
name?: string;
|
|
61
|
+
provider?: string;
|
|
62
|
+
baseUrl?: string;
|
|
63
|
+
apiKey?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface ConfigFileSchema {
|
|
66
|
+
model?: string;
|
|
67
|
+
models?: {
|
|
68
|
+
small?: string | ModelSlotConfigEntry;
|
|
69
|
+
medium?: string | ModelSlotConfigEntry;
|
|
70
|
+
large?: string | ModelSlotConfigEntry;
|
|
71
|
+
};
|
|
72
|
+
maxTokens?: number;
|
|
73
|
+
temperature?: number;
|
|
74
|
+
systemPrompt?: string;
|
|
75
|
+
permissionMode?: string;
|
|
76
|
+
autoRouting?: {
|
|
77
|
+
interactive?: boolean;
|
|
78
|
+
chat?: boolean;
|
|
79
|
+
telegram?: boolean;
|
|
80
|
+
daemon?: boolean;
|
|
81
|
+
};
|
|
82
|
+
daemon?: {
|
|
83
|
+
task?: string;
|
|
84
|
+
taskId?: string;
|
|
85
|
+
worktreePrune?: {
|
|
86
|
+
enabled?: boolean;
|
|
87
|
+
cron?: string;
|
|
88
|
+
maxAgeDaysClean?: number;
|
|
89
|
+
maxAgeDaysDirty?: number;
|
|
90
|
+
scope?: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
telegram?: {
|
|
94
|
+
notify?: {
|
|
95
|
+
mode?: 'primary' | 'broadcast' | 'custom';
|
|
96
|
+
primaryChatId?: number;
|
|
97
|
+
targets?: number[];
|
|
98
|
+
};
|
|
99
|
+
verifyDone?: boolean;
|
|
100
|
+
};
|
|
101
|
+
interactive?: {
|
|
102
|
+
worktreeAutoname?: boolean;
|
|
103
|
+
worktreeBranchPrefix?: string;
|
|
104
|
+
worktreeBase?: string;
|
|
105
|
+
suggestGhost?: boolean;
|
|
106
|
+
thinkingUi?: 'summary' | 'live' | 'digest' | 'off';
|
|
107
|
+
};
|
|
108
|
+
updatePolicy?: 'notify' | 'auto' | 'off';
|
|
109
|
+
autoResumeOnUsageLimit?: boolean;
|
|
110
|
+
bgSummaries?: boolean;
|
|
111
|
+
maxSummaryCallsPerSession?: number;
|
|
112
|
+
hooks?: RawHooksConfig;
|
|
113
|
+
enableShellHooks?: boolean;
|
|
114
|
+
importFrom?: Partial<Record<ImportSourceBinary, boolean | {
|
|
115
|
+
plugins?: boolean;
|
|
116
|
+
skills?: boolean;
|
|
117
|
+
mcp?: boolean;
|
|
118
|
+
}>>;
|
|
119
|
+
}
|
|
120
|
+
export declare const DEFAULT_CONFIG: Omit<CliConfig, 'apiKey'>;
|
|
121
|
+
export declare const DEFAULT_CLI_PERMISSION_MODE: PermissionMode;
|
package/dist/cli/config.d.ts
CHANGED
|
@@ -1,68 +1,13 @@
|
|
|
1
1
|
import { getModelId, isValidModel } from '../agent/session/model-resolution.js';
|
|
2
|
-
import { type ModelSlots } from '../agent/session/model-slots.js';
|
|
3
2
|
import { type BundledProviderName } from '../agent/providers/index.js';
|
|
4
|
-
import type { AgentModelInput } from '../agent/types.js';
|
|
5
3
|
import type { PermissionMode } from '../agent/types/sdk-types.js';
|
|
6
|
-
import type {
|
|
7
|
-
import { type
|
|
4
|
+
import type { ImportFromConfig, ImportSourceBinary } from '../config/import-sources.js';
|
|
5
|
+
import { type CliConfig } from './config/types.js';
|
|
8
6
|
export type { ImportFromConfig, ImportSourceBinary };
|
|
9
7
|
export { getModelId, isValidModel };
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
telegram?: boolean;
|
|
14
|
-
daemon?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface CliConfig {
|
|
17
|
-
apiKey?: string;
|
|
18
|
-
baseUrl?: string;
|
|
19
|
-
model: AgentModelInput;
|
|
20
|
-
models?: ModelSlots;
|
|
21
|
-
maxTokens: number;
|
|
22
|
-
temperature: number;
|
|
23
|
-
openaiBaseUrl?: string;
|
|
24
|
-
systemPrompt?: string;
|
|
25
|
-
systemPromptSource?: string;
|
|
26
|
-
permissionMode?: PermissionMode;
|
|
27
|
-
autoRouting?: AutoRoutingConfig;
|
|
28
|
-
daemon?: {
|
|
29
|
-
task?: string;
|
|
30
|
-
taskId?: string;
|
|
31
|
-
worktreePrune?: {
|
|
32
|
-
enabled: boolean;
|
|
33
|
-
cron: string;
|
|
34
|
-
maxAgeDaysClean: number;
|
|
35
|
-
maxAgeDaysDirty: number;
|
|
36
|
-
scope: string;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
telegram?: {
|
|
40
|
-
notify?: {
|
|
41
|
-
mode?: 'primary' | 'broadcast' | 'custom';
|
|
42
|
-
primaryChatId?: number;
|
|
43
|
-
targets?: number[];
|
|
44
|
-
};
|
|
45
|
-
verifyDone?: boolean;
|
|
46
|
-
};
|
|
47
|
-
interactive?: {
|
|
48
|
-
worktreeAutoname?: boolean;
|
|
49
|
-
worktreeBranchPrefix?: string;
|
|
50
|
-
worktreeBase?: string;
|
|
51
|
-
suggestGhost?: boolean;
|
|
52
|
-
thinkingUi?: 'summary' | 'live' | 'digest' | 'off';
|
|
53
|
-
};
|
|
54
|
-
updatePolicy: 'notify' | 'auto' | 'off';
|
|
55
|
-
autoResumeOnUsageLimit?: boolean;
|
|
56
|
-
bgSummaries?: boolean;
|
|
57
|
-
maxSummaryCallsPerSession?: number;
|
|
58
|
-
hooks?: RawHooksConfig;
|
|
59
|
-
enableShellHooks?: boolean;
|
|
60
|
-
importFrom?: ImportFromConfig;
|
|
61
|
-
}
|
|
62
|
-
export declare const DEFAULT_CLI_PERMISSION_MODE: PermissionMode;
|
|
63
|
-
export declare function loadCredential(): string | undefined;
|
|
64
|
-
export declare function normalizeOpenAIBaseUrl(raw: string): string;
|
|
65
|
-
export declare function _resetOpenAIBaseUrlWarnCache(): void;
|
|
8
|
+
export type { AutoRoutingConfig, CliConfig } from './config/types.js';
|
|
9
|
+
export { DEFAULT_CLI_PERMISSION_MODE } from './config/types.js';
|
|
10
|
+
export { loadCredential, normalizeOpenAIBaseUrl, _resetOpenAIBaseUrlWarnCache, } from './config/env-tier.js';
|
|
66
11
|
export declare function _resetConfigCache(): void;
|
|
67
12
|
export declare function loadTelegramConfig(): NonNullable<CliConfig['telegram']>;
|
|
68
13
|
export declare function resolveCliPermissionMode(): PermissionMode;
|