agent-afk 5.27.1 → 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/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 +414 -414
- package/dist/index.mjs +135 -135
- package/dist/telegram.mjs +185 -185
- package/package.json +1 -1
|
@@ -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;
|