@kodax-ai/kodax 0.7.62 → 0.7.66
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/CHANGELOG.md +2300 -2145
- package/README.md +81 -9
- package/README_CN.md +54 -5
- package/dist/chunks/{agent-4ZMCIEGD.js → agent-KER4WDNO.js} +1 -1
- package/dist/chunks/argument-completer-HK3MHA3K.js +2 -0
- package/dist/chunks/{chunk-ARUWXX25.js → chunk-35P7QL2Q.js} +1 -1
- package/dist/chunks/chunk-3HKBBY74.js +339 -0
- package/dist/chunks/chunk-AKBH2EEE.js +8 -0
- package/dist/chunks/{chunk-OGRJQGKO.js → chunk-ALS32RNZ.js} +1 -1
- package/dist/chunks/chunk-MHRN2LQV.js +328 -0
- package/dist/chunks/{chunk-JILSZHCQ.js → chunk-NBQW7PNZ.js} +2 -2
- package/dist/chunks/{chunk-S4GVQO3W.js → chunk-O7N22GJ3.js} +1 -1
- package/dist/chunks/chunk-ONUPGMER.js +2 -0
- package/dist/chunks/{chunk-ZL5CEANW.js → chunk-PZTG2C33.js} +1 -1
- package/dist/chunks/{chunk-AY3BLB4Q.js → chunk-QAQ2HNXD.js} +112 -112
- package/dist/chunks/{chunk-6OZ5KWG3.js → chunk-QJJKMNZF.js} +1 -1
- package/dist/chunks/chunk-QJVZZSEO.js +56 -0
- package/dist/chunks/chunk-TLJGOKBT.js +729 -0
- package/dist/chunks/{chunk-6HTR3GHZ.js → chunk-VS4CDDEF.js} +245 -245
- package/dist/chunks/chunk-WBBEJIAY.js +306 -0
- package/dist/chunks/{chunk-HO6P6CPU.js → chunk-WMIZCY2J.js} +1 -1
- package/dist/chunks/{chunk-UA744TZM.js → chunk-YRBNXFHY.js} +1 -1
- package/dist/chunks/compaction-config-7GMUFNPB.js +2 -0
- package/dist/chunks/{construction-bootstrap-4ZNFZFX2.js → construction-bootstrap-3XDS2D5K.js} +1 -1
- package/dist/chunks/{devtools-4CRULTR2.js → devtools-CD6KSIHE.js} +1 -1
- package/dist/chunks/{devtools-YINBSZC7.js → devtools-XR5F2C6T.js} +1 -1
- package/dist/chunks/{dist-73L4OYPD.js → dist-4PXB7U22.js} +1 -1
- package/dist/chunks/dist-4YAYT2TO.js +2 -0
- package/dist/chunks/host-KG3456QP.js +2 -0
- package/dist/chunks/{paste-FDYM7SZX.js → paste-C33GZQV5.js} +1 -1
- package/dist/chunks/run-manager-6CAH3KTA.js +2 -0
- package/dist/chunks/utils-OT5ENFUL.js +2 -0
- package/dist/constructed-handler-worker.js +2 -0
- package/dist/index.d.ts +22 -11
- package/dist/index.js +6 -6
- package/dist/kodax_cli.js +1117 -1090
- package/dist/runtime-worker.js +2843 -0
- package/dist/sdk-agent.d.ts +29 -10
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +108 -1091
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.d.ts +2 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +198 -184
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +982 -0
- package/dist/sdk-runtime.js +2 -0
- package/dist/sdk-session.d.ts +4 -4
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +191 -10
- package/dist/types-chunks/{bash-prefix-extractor.d-Do_TCAmA.d.ts → bash-prefix-extractor.d-BjkITAva.d.ts} +266 -4
- package/dist/types-chunks/{run-manager.d-CYY3pZeJ.d.ts → capsule.d-hVhPNkHd.d.ts} +9 -107
- package/dist/types-chunks/commands.d-C3B1TdGM.d.ts +213 -0
- package/dist/types-chunks/{types.d-DFf4Sfys.d.ts → guardrail.d-C_Siraua.d.ts} +3 -128
- package/dist/types-chunks/{guardrail.d-DRp0Lqvx.d.ts → guardrail.d-wk-s0psS.d.ts} +3 -3
- package/dist/types-chunks/{manager.d-DBD7SOTT.d.ts → manager.d-Zum9cGHU.d.ts} +3 -173
- package/dist/types-chunks/oauth-login.d-Bgb4rdLN.d.ts +174 -0
- package/dist/types-chunks/{process.d-DXkRD7hj.d.ts → process.d-CY2g03Mb.d.ts} +11 -4
- package/dist/types-chunks/public-api.d-jtREVfEq.d.ts +596 -0
- package/dist/types-chunks/run-manager.d-CFknOfo1.d.ts +91 -0
- package/dist/types-chunks/{sdk-session-BGGOC0cT.d.ts → sdk-session-CLqyfAmf.d.ts} +8 -304
- package/dist/types-chunks/types.d-BMLxKV69.d.ts +128 -0
- package/dist/types-chunks/types.d-CUN_bZU7.d.ts +975 -0
- package/dist/types-chunks/{utils.d-ChOEH3NF.d.ts → utils.d-C1rpoeDh.d.ts} +84 -72
- package/package.json +7 -1
- package/dist/chunks/argument-completer-5PWSKFKI.js +0 -2
- package/dist/chunks/chunk-2F4R7WM7.js +0 -52
- package/dist/chunks/chunk-3KD26NCI.js +0 -310
- package/dist/chunks/chunk-E2Q4RIOD.js +0 -731
- package/dist/chunks/chunk-S4ISEA6F.js +0 -341
- package/dist/chunks/chunk-V4WSBIXB.js +0 -2
- package/dist/chunks/chunk-WFE6FBQ2.js +0 -326
- package/dist/chunks/compaction-config-SP3REMFR.js +0 -2
- package/dist/chunks/dist-IKWRJW6J.js +0 -2
- package/dist/chunks/host-XL5CH7QP.js +0 -2
- package/dist/chunks/run-manager-UXIPDVVF.js +0 -2
- package/dist/chunks/utils-XKWEVPE3.js +0 -2
- package/dist/types-chunks/storage.d-C3umBC4g.d.ts +0 -280
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { A as AgentsFile, f as AutoModeStats, l as KodaXMcpServersConfig } from './guardrail.d-DRp0Lqvx.js';
|
|
1
|
+
import { j as KodaXMessage, E as KodaXReasoningMode, d as KodaXCustomProviderConfig, o as KodaXProviderCapabilityProfile } from './types.d-Bp4Lm1jv.js';
|
|
2
|
+
import { I as KodaXContextTokenSnapshot, ad as KodaXSkillDynamicContextPolicy, r as KodaXAgentMode, a0 as KodaXRepoIntelligenceMode, X as KodaXOptions, ae as KodaXSkillInvocationContext } from './bash-prefix-extractor.d-BjkITAva.js';
|
|
3
|
+
import { ao as KodaXSessionUiHistoryItem, af as KodaXSessionLineage, a6 as KodaXSessionArtifactLedgerEntry, V as KodaXExtensionSessionState, U as KodaXExtensionSessionRecord, ak as KodaXSessionRuntimeInfo, co as WorkflowProcessSource } from './process.d-CY2g03Mb.js';
|
|
4
|
+
import { A as AgentsFile, f as AutoModeStats, l as KodaXMcpServersConfig } from './guardrail.d-wk-s0psS.js';
|
|
6
5
|
import * as readline from 'readline';
|
|
6
|
+
import { f as PermissionMode } from './public-api.d-jtREVfEq.js';
|
|
7
7
|
import { SpawnSyncReturns } from 'child_process';
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* InkREPL - Ink-based REPL Adapter
|
|
11
|
-
*
|
|
12
|
-
* Bridges Ink UI components with existing KodaX command processing logic.
|
|
13
|
-
* Replaces the Node.js readline-based input with Ink's React components.
|
|
14
|
-
*
|
|
15
|
-
* Architecture based on Gemini CLI:
|
|
16
|
-
* - Uses UIStateContext for global state
|
|
17
|
-
* - Uses KeypressContext for priority-based keyboard handling
|
|
18
|
-
* - Uses StreamingContext for streaming response management
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
interface InkREPLOptions extends KodaXOptions {
|
|
22
|
-
storage?: SessionStorage$1;
|
|
23
|
-
hardExitOnClose?: boolean;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Run Ink-based interactive mode
|
|
27
|
-
*/
|
|
28
|
-
declare function runInkInteractiveMode(options: InkREPLOptions): Promise<void>;
|
|
29
|
-
|
|
30
9
|
/**
|
|
31
10
|
* KodaX Interactive Context Management - 交互式上下文管理
|
|
32
11
|
*/
|
|
@@ -63,21 +42,6 @@ declare function createInteractiveContext(options: {
|
|
|
63
42
|
}): Promise<InteractiveContext>;
|
|
64
43
|
declare function touchContext(context: InteractiveContext): void;
|
|
65
44
|
|
|
66
|
-
interface SessionStorage extends KodaXSessionStorage {
|
|
67
|
-
list(gitRoot?: string): Promise<Array<{
|
|
68
|
-
id: string;
|
|
69
|
-
title: string;
|
|
70
|
-
msgCount: number;
|
|
71
|
-
tag?: string;
|
|
72
|
-
runtimeInfo?: KodaXSessionData['runtimeInfo'];
|
|
73
|
-
}>>;
|
|
74
|
-
}
|
|
75
|
-
interface RepLOptions extends KodaXOptions {
|
|
76
|
-
storage?: SessionStorage;
|
|
77
|
-
}
|
|
78
|
-
declare function runInteractiveMode(options: RepLOptions): Promise<void>;
|
|
79
|
-
declare function processSpecialSyntax(input: string): Promise<string>;
|
|
80
|
-
|
|
81
45
|
/**
|
|
82
46
|
* UI Context Interface - UI 交互上下文接口
|
|
83
47
|
*
|
|
@@ -168,6 +132,21 @@ interface CurrentConfig {
|
|
|
168
132
|
/** FEATURE_102 Phase 3 — cross-provider child fallback chain. */
|
|
169
133
|
fallbackProviders?: string[];
|
|
170
134
|
}
|
|
135
|
+
type RuntimeSurfaceMode = 'embedded' | 'daemon';
|
|
136
|
+
interface RuntimeSurfaceStatus {
|
|
137
|
+
readonly mode: RuntimeSurfaceMode;
|
|
138
|
+
readonly runtimeId: string;
|
|
139
|
+
readonly profile: string;
|
|
140
|
+
readonly startedAt?: string;
|
|
141
|
+
readonly endpoint?: string;
|
|
142
|
+
readonly health?: string;
|
|
143
|
+
readonly sessions?: number;
|
|
144
|
+
readonly runs?: number;
|
|
145
|
+
readonly activeRuns?: number;
|
|
146
|
+
readonly queuedRuns?: number;
|
|
147
|
+
readonly pendingPermissions?: number;
|
|
148
|
+
readonly workflows?: number;
|
|
149
|
+
}
|
|
171
150
|
type SessionLoadStatus = 'loaded' | 'missing' | 'blocked';
|
|
172
151
|
type SessionBranchSwitchStatus = 'switched' | 'missing' | 'blocked';
|
|
173
152
|
type SessionForkStatus = 'forked' | 'failed' | 'blocked';
|
|
@@ -247,6 +226,7 @@ interface CommandCallbacks {
|
|
|
247
226
|
recoverSession?: (prompt?: string) => Promise<SessionRecoverStatus>;
|
|
248
227
|
rewindSession?: (selector?: string) => Promise<SessionRewindStatus>;
|
|
249
228
|
getCostReport?: () => string | null;
|
|
229
|
+
getRuntimeStatus?: () => Promise<RuntimeSurfaceStatus | undefined>;
|
|
250
230
|
/**
|
|
251
231
|
* FEATURE_092 phase 2b.8: read-only stats accessor for the auto-mode
|
|
252
232
|
* classifier guardrail. Returns undefined when the guardrail hasn't been
|
|
@@ -293,12 +273,50 @@ interface CommandWorkflowInvocationRequest {
|
|
|
293
273
|
displayName: string;
|
|
294
274
|
processSource?: WorkflowProcessSource;
|
|
295
275
|
}
|
|
296
|
-
type CommandResult
|
|
297
|
-
type CommandHandler = (args: string[], context: InteractiveContext, callbacks: CommandCallbacks, currentConfig: CurrentConfig) => Promise<CommandResult
|
|
276
|
+
type CommandResult = boolean | CommandResultData;
|
|
277
|
+
type CommandHandler = (args: string[], context: InteractiveContext, callbacks: CommandCallbacks, currentConfig: CurrentConfig) => Promise<CommandResult | void>;
|
|
278
|
+
interface CommandDefinition {
|
|
279
|
+
name: string;
|
|
280
|
+
aliases?: string[];
|
|
281
|
+
description: string;
|
|
282
|
+
usage?: string;
|
|
283
|
+
detailedHelp?: () => void;
|
|
284
|
+
handler: CommandHandler;
|
|
285
|
+
source?: CommandSource;
|
|
286
|
+
priority?: CommandPriority;
|
|
287
|
+
location?: 'user' | 'project' | 'path';
|
|
288
|
+
path?: string;
|
|
289
|
+
userInvocable?: boolean;
|
|
290
|
+
disableModelInvocation?: boolean;
|
|
291
|
+
allowedTools?: string;
|
|
292
|
+
context?: 'fork';
|
|
293
|
+
agent?: string;
|
|
294
|
+
argumentHint?: string;
|
|
295
|
+
model?: string;
|
|
296
|
+
hooks?: CommandHooks;
|
|
297
|
+
frontmatter?: Record<string, unknown>;
|
|
298
|
+
}
|
|
299
|
+
interface CommandInfo {
|
|
300
|
+
name: string;
|
|
301
|
+
aliases?: string[];
|
|
302
|
+
description: string;
|
|
303
|
+
source: CommandSource;
|
|
304
|
+
usage?: string;
|
|
305
|
+
priority?: CommandPriority;
|
|
306
|
+
location?: 'user' | 'project' | 'path';
|
|
307
|
+
path?: string;
|
|
308
|
+
userInvocable?: boolean;
|
|
309
|
+
disableModelInvocation?: boolean;
|
|
310
|
+
allowedTools?: string;
|
|
311
|
+
context?: 'fork';
|
|
312
|
+
agent?: string;
|
|
313
|
+
argumentHint?: string;
|
|
314
|
+
model?: string;
|
|
315
|
+
}
|
|
298
316
|
/**
|
|
299
317
|
* Legacy command shape used by the existing REPL command table.
|
|
300
318
|
*/
|
|
301
|
-
interface Command
|
|
319
|
+
interface Command {
|
|
302
320
|
name: string;
|
|
303
321
|
aliases?: string[];
|
|
304
322
|
description: string;
|
|
@@ -320,32 +338,6 @@ interface Command$1 {
|
|
|
320
338
|
frontmatter?: Record<string, unknown>;
|
|
321
339
|
}
|
|
322
340
|
|
|
323
|
-
/**
|
|
324
|
-
* KodaX Interactive Command System
|
|
325
|
-
*/
|
|
326
|
-
|
|
327
|
-
type Command = Command$1;
|
|
328
|
-
declare const BUILTIN_COMMANDS: Command[];
|
|
329
|
-
declare function parseCommand(input: string): {
|
|
330
|
-
command: string;
|
|
331
|
-
args: string[];
|
|
332
|
-
skillInvocation?: {
|
|
333
|
-
name: string;
|
|
334
|
-
};
|
|
335
|
-
} | null;
|
|
336
|
-
type CommandResult = boolean | {
|
|
337
|
-
skillContent?: string;
|
|
338
|
-
invocation?: CommandInvocationRequest;
|
|
339
|
-
workflow?: CommandWorkflowInvocationRequest;
|
|
340
|
-
};
|
|
341
|
-
declare function executeCommand(parsed: {
|
|
342
|
-
command: string;
|
|
343
|
-
args: string[];
|
|
344
|
-
skillInvocation?: {
|
|
345
|
-
name: string;
|
|
346
|
-
};
|
|
347
|
-
}, context: InteractiveContext, callbacks: CommandCallbacks, currentConfig: CurrentConfig): Promise<CommandResult>;
|
|
348
|
-
|
|
349
341
|
/**
|
|
350
342
|
* KodaX CLI Utilities
|
|
351
343
|
* CLI 灞傚伐鍏峰嚱鏁?
|
|
@@ -420,6 +412,7 @@ declare function isProviderConfigured(name: string): boolean;
|
|
|
420
412
|
declare function loadConfig(): {
|
|
421
413
|
provider?: string;
|
|
422
414
|
model?: string;
|
|
415
|
+
runtimeMode?: 'embedded' | 'daemon';
|
|
423
416
|
effort?: string;
|
|
424
417
|
planModeEffort?: string;
|
|
425
418
|
thinking?: boolean;
|
|
@@ -520,6 +513,7 @@ declare function prepareRuntimeConfig(): ReturnType<typeof loadConfig>;
|
|
|
520
513
|
declare function saveConfig(config: {
|
|
521
514
|
provider?: string;
|
|
522
515
|
model?: string;
|
|
516
|
+
runtimeMode?: 'embedded' | 'daemon';
|
|
523
517
|
effort?: string;
|
|
524
518
|
planModeEffort?: string;
|
|
525
519
|
thinking?: boolean;
|
|
@@ -561,6 +555,24 @@ declare function saveConfig(config: {
|
|
|
561
555
|
maxConcurrency?: number;
|
|
562
556
|
};
|
|
563
557
|
}): void;
|
|
558
|
+
declare function resolveRuntimeProviderSelection(input: {
|
|
559
|
+
explicitProvider?: string;
|
|
560
|
+
environmentProvider?: string;
|
|
561
|
+
configuredProvider?: string;
|
|
562
|
+
defaultProvider: string;
|
|
563
|
+
}): string;
|
|
564
|
+
declare function resolveRuntimeModelSelection(input: {
|
|
565
|
+
explicitProvider?: string;
|
|
566
|
+
environmentProvider?: string;
|
|
567
|
+
explicitModel?: string;
|
|
568
|
+
configuredProvider?: string;
|
|
569
|
+
configuredModel?: string;
|
|
570
|
+
}): string | undefined;
|
|
571
|
+
declare function resolveRuntimeEffortSelection(input: {
|
|
572
|
+
explicitEffort?: string;
|
|
573
|
+
environmentEffort?: string;
|
|
574
|
+
configuredEffort?: string;
|
|
575
|
+
}): string | undefined;
|
|
564
576
|
/**
|
|
565
577
|
* Get git root directory.
|
|
566
578
|
*
|
|
@@ -578,5 +590,5 @@ declare function saveConfig(config: {
|
|
|
578
590
|
declare function getGitRoot(cwd?: string): Promise<string | null>;
|
|
579
591
|
declare function rateLimitedCall<T>(fn: () => Promise<T>): Promise<T>;
|
|
580
592
|
|
|
581
|
-
export {
|
|
582
|
-
export type { Command as C,
|
|
593
|
+
export { resolveRuntimeModelSelection as A, resolveRuntimeProviderSelection as B, saveConfig as D, touchContext as E, KODAX_CONFIG_FILE as K, PREVIEW_MAX_LENGTH as P, KODAX_DIR as i, KODAX_EXAMPLE_CONFIG_FILE as j, KODAX_SESSIONS_DIR as k, KODAX_VERSION as l, createInteractiveContext as n, ensureExampleConfigFile as o, getGitRoot as p, getProviderList as q, getProviderModel as r, getVersion as s, hydrateProcessEnvFromShell as t, isProviderConfigured as u, loadConfig as v, prepareRuntimeConfig as w, rateLimitedCall as x, registerConfiguredCustomProviders as y, resolveRuntimeEffortSelection as z };
|
|
594
|
+
export type { Command as C, InteractiveContext as I, RuntimeSurfaceMode as R, CommandCallbacks as a, CommandDefinition as b, CommandInfo as c, CommandInvocationRequest as d, CommandSource as e, CommandWorkflowInvocationRequest as f, CurrentConfig as g, InteractiveMode as h, RuntimeSurfaceStatus as m };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kodax-ai/kodax",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.66",
|
|
4
4
|
"description": "KodaX lightweight coding agent - TypeScript implementation with 15 built-in LLM provider aliases, published as a Node-free single-file CLI and SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -52,6 +52,10 @@
|
|
|
52
52
|
"types": "./dist/sdk-session.d.ts",
|
|
53
53
|
"import": "./dist/sdk-session.js"
|
|
54
54
|
},
|
|
55
|
+
"./runtime": {
|
|
56
|
+
"types": "./dist/sdk-runtime.d.ts",
|
|
57
|
+
"import": "./dist/sdk-runtime.js"
|
|
58
|
+
},
|
|
55
59
|
"./package.json": "./package.json"
|
|
56
60
|
},
|
|
57
61
|
"scripts": {
|
|
@@ -157,6 +161,8 @@
|
|
|
157
161
|
"dist/chunks",
|
|
158
162
|
"dist/provider-capabilities.json",
|
|
159
163
|
"dist/semantic-worker.js",
|
|
164
|
+
"dist/runtime-worker.js",
|
|
165
|
+
"dist/constructed-handler-worker.js",
|
|
160
166
|
"dist/types-chunks",
|
|
161
167
|
"scripts/kodax-bin.cjs",
|
|
162
168
|
"scripts/production-env.cjs",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{Aa as b,za as a}from"./chunk-6HTR3GHZ.js";import"./chunk-HO6P6CPU.js";import"./chunk-2F4R7WM7.js";import"./chunk-AY3BLB4Q.js";import"./chunk-OGRJQGKO.js";import"./chunk-JILSZHCQ.js";import"./chunk-WFE6FBQ2.js";import"./chunk-D6QVXQNI.js";import"./chunk-UA744TZM.js";import"./chunk-S4ISEA6F.js";import"./chunk-S4GVQO3W.js";import"./chunk-E2Q4RIOD.js";import"./chunk-ZL5CEANW.js";import"./chunk-V4WSBIXB.js";export{a as ArgumentCompleter,b as createArgumentCompleter};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{w as U,y as $}from"./chunk-WFE6FBQ2.js";import{D as x,E as O,Ja as X,Na as F,ja as I,ka as M,la as D,ma as T,n as k,na as N,oa as S,va as K,wa as g,za as P}from"./chunk-S4GVQO3W.js";import{Ba as j,va as G}from"./chunk-E2Q4RIOD.js";import{a as r}from"./chunk-V4WSBIXB.js";import l from"fs";import f from"path";import{exec as ee,spawnSync as te}from"child_process";import{promisify as ne}from"util";import{fileURLToPath as oe}from"url";var C="en";function Z(){return(process.env.LC_ALL||process.env.LC_MESSAGES||process.env.LANG||"").toLowerCase().startsWith("zh")?"zh":"en"}r(Z,"detectSystemLocale");function B(e){if(!e||e==="auto"){C=Z();return}C=e.toLowerCase().replace(/[-_].*/,"")==="zh"?"zh":"en"}r(B,"setLocale");var V={en:{"dialog.confirm":"[Confirm]","dialog.select":"[Select]","dialog.input":"[Input]","confirm.instruction.basic":"Press (y) yes, (n) no","confirm.instruction.always":"Press (y) yes, (a) always yes for this tool, (n) no","confirm.instruction.protected":"Press (y) to confirm, (n) to cancel (protected path)","confirm.result.approved":"Approved","confirm.result.approved_always":"Approved (always)","confirm.result.denied":"Denied","tool.bash.title":"Execute bash command?","tool.shell.title":"Execute shell command?","tool.write.title":"Write to file?","tool.edit.title":"Edit file?","tool.generic.title":"Execute {tool}?","field.reason":"Reason","field.intent":"Intent","field.target":"Target","field.scope":"Scope","field.risk":"Risk","field.summary":"Summary","intent.read":"Read project files","intent.delete":"Delete files","intent.deps":"Modify dependencies or environment","intent.modify":"Modify files","intent.execute":"Execute command","intent.write_file":"Write file","intent.edit_file":"Edit file","intent.use_tool":"Use {tool}","risk.destructive":"Destructive change","risk.deps":"May change dependencies or local tools","risk.modify":"May modify files","risk.unknown":"Command effects depend on its arguments","risk.network":"May access network","scope.outside":"Outside project","scope.protected":"Protected path","waiting.confirm":"Waiting: approval required","waiting.select":"Waiting: choose an option","waiting.input":"Waiting: answer the prompt","placeholder.confirm":"Respond to the approval prompt above...","placeholder.select":"Choose an option above...","placeholder.input":"Answer the prompt above...","placeholder.busy":"Agent is busy...","placeholder.queue":"Queue a follow-up for the next round...","placeholder.idle":"Type a message...","select.choice":"Choice:","select.type_number":"(type a number)","select.more":"{count} more choices...","select.more_above":"\u2191 {count} more above","select.more_below":"\u2193 {count} more below","select.confirm_hint":"Press Enter to confirm, Esc to cancel","select.navigate_hint":"Use \u2191\u2193 to navigate, Enter to confirm, Esc to cancel","select.multiselect_hint":"Use \u2191\u2193 to navigate, Space to toggle, Enter to confirm, Esc to cancel","select.multiselect_empty":"Select at least one option with Space before confirming.","select.multiselect_min":"Select at least {min} option(s) with Space before confirming.","select.multiselect_max":"Select at most {max} option(s) with Space before confirming.","select.back_prev":"\u2190 Back to previous question","input.default":"Default:","input.value":"Value:","input.type_response":"(type your response)","managed.completed":"Task completed","managed.completed.blocked":"Task blocked","managed.completed.continuation":"Task needs continuation",cancelled:"[Cancelled] Operation cancelled by user"},zh:{"dialog.confirm":"[\u786E\u8BA4]","dialog.select":"[\u9009\u62E9]","dialog.input":"[\u8F93\u5165]","confirm.instruction.basic":"\u6309 (y) \u786E\u8BA4, (n) \u62D2\u7EDD","confirm.instruction.always":"\u6309 (y) \u786E\u8BA4, (a) \u59CB\u7EC8\u5141\u8BB8\u6B64\u5DE5\u5177, (n) \u62D2\u7EDD","confirm.instruction.protected":"\u6309 (y) \u786E\u8BA4, (n) \u53D6\u6D88 (\u53D7\u4FDD\u62A4\u8DEF\u5F84)","confirm.result.approved":"\u5DF2\u6279\u51C6","confirm.result.approved_always":"\u5DF2\u6279\u51C6 (\u59CB\u7EC8\u5141\u8BB8)","confirm.result.denied":"\u5DF2\u62D2\u7EDD","tool.bash.title":"\u6267\u884C bash \u547D\u4EE4\uFF1F","tool.shell.title":"\u6267\u884C shell \u547D\u4EE4\uFF1F","tool.write.title":"\u5199\u5165\u6587\u4EF6\uFF1F","tool.edit.title":"\u7F16\u8F91\u6587\u4EF6\uFF1F","tool.generic.title":"\u6267\u884C {tool}\uFF1F","field.reason":"\u539F\u56E0","field.intent":"\u610F\u56FE","field.target":"\u76EE\u6807","field.scope":"\u8303\u56F4","field.risk":"\u98CE\u9669","field.summary":"\u6458\u8981","intent.read":"\u8BFB\u53D6\u9879\u76EE\u6587\u4EF6","intent.delete":"\u5220\u9664\u6587\u4EF6","intent.deps":"\u4FEE\u6539\u4F9D\u8D56\u6216\u73AF\u5883","intent.modify":"\u4FEE\u6539\u6587\u4EF6","intent.execute":"\u6267\u884C\u547D\u4EE4","intent.write_file":"\u5199\u5165\u6587\u4EF6","intent.edit_file":"\u7F16\u8F91\u6587\u4EF6","intent.use_tool":"\u4F7F\u7528 {tool}","risk.destructive":"\u7834\u574F\u6027\u53D8\u66F4","risk.deps":"\u53EF\u80FD\u4FEE\u6539\u4F9D\u8D56\u6216\u672C\u5730\u5DE5\u5177","risk.modify":"\u53EF\u80FD\u4FEE\u6539\u6587\u4EF6","risk.unknown":"\u547D\u4EE4\u6548\u679C\u53D6\u51B3\u4E8E\u53C2\u6570","risk.network":"\u53EF\u80FD\u8BBF\u95EE\u7F51\u7EDC","scope.outside":"\u9879\u76EE\u5916\u90E8","scope.protected":"\u53D7\u4FDD\u62A4\u8DEF\u5F84","waiting.confirm":"\u7B49\u5F85\u4E2D\uFF1A\u9700\u8981\u5BA1\u6279","waiting.select":"\u7B49\u5F85\u4E2D\uFF1A\u8BF7\u9009\u62E9","waiting.input":"\u7B49\u5F85\u4E2D\uFF1A\u8BF7\u56DE\u7B54","placeholder.confirm":"\u8BF7\u56DE\u5E94\u4E0A\u65B9\u7684\u5BA1\u6279\u63D0\u793A...","placeholder.select":"\u8BF7\u5728\u4E0A\u65B9\u9009\u62E9\u4E00\u4E2A\u9009\u9879...","placeholder.input":"\u8BF7\u56DE\u7B54\u4E0A\u65B9\u7684\u63D0\u793A...","placeholder.busy":"\u667A\u80FD\u4F53\u6B63\u5728\u5DE5\u4F5C\u4E2D...","placeholder.queue":"\u6392\u961F\u7B49\u5F85\u4E0B\u4E00\u8F6E\u8DDF\u8FDB...","placeholder.idle":"\u8F93\u5165\u6D88\u606F...","select.choice":"\u9009\u9879\uFF1A","select.type_number":"(\u8F93\u5165\u7F16\u53F7)","select.more":"\u8FD8\u6709 {count} \u4E2A\u9009\u9879...","select.more_above":"\u2191 \u4E0A\u65B9\u8FD8\u6709 {count} \u4E2A","select.more_below":"\u2193 \u4E0B\u65B9\u8FD8\u6709 {count} \u4E2A","select.confirm_hint":"\u6309 Enter \u786E\u8BA4\uFF0CEsc \u53D6\u6D88","select.navigate_hint":"\u4F7F\u7528 \u2191\u2193 \u5BFC\u822A\uFF0CEnter \u786E\u8BA4\uFF0CEsc \u53D6\u6D88","select.multiselect_hint":"\u4F7F\u7528 \u2191\u2193 \u5BFC\u822A\uFF0C\u7A7A\u683C \u5207\u6362\u9009\u4E2D\uFF0CEnter \u786E\u8BA4\uFF0CEsc \u53D6\u6D88","select.multiselect_empty":"\u8BF7\u5148\u4F7F\u7528\u7A7A\u683C\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u9009\u9879\u3002","select.multiselect_min":"\u8BF7\u5148\u4F7F\u7528\u7A7A\u683C\u81F3\u5C11\u9009\u62E9 {min} \u4E2A\u9009\u9879\u3002","select.multiselect_max":"\u6700\u591A\u53EA\u80FD\u9009\u62E9 {max} \u4E2A\u9009\u9879\u3002","select.back_prev":"\u2190 \u8FD4\u56DE\u4E0A\u4E00\u9898","input.default":"\u9ED8\u8BA4\u503C\uFF1A","input.value":"\u503C\uFF1A","input.type_response":"(\u8F93\u5165\u4F60\u7684\u56DE\u7B54)","managed.completed":"\u4EFB\u52A1\u5B8C\u6210","managed.completed.blocked":"\u4EFB\u52A1\u53D7\u963B","managed.completed.continuation":"\u4EFB\u52A1\u9700\u8981\u7EE7\u7EED",cancelled:"[\u5DF2\u53D6\u6D88] \u64CD\u4F5C\u5DF2\u88AB\u7528\u6237\u53D6\u6D88"}};function Ie(e,t){let o=V[C][e]??V.en[e]??e;if(t)for(let[i,s]of Object.entries(t))o=o.replace(`{${i}}`,String(s));return o}r(Ie,"t");var re=ne(ee),h=G(),Ve=f.join(h,"sessions"),d=f.join(h,"config.json"),Be=60,p=null,L=!1,ie="dumb";function se(e){let t=f.basename(e).toLowerCase(),n="__KODAX_SHELL_ENV_START__",o=`printf '%s\\0' '${n}'; env -0`;return t==="fish"?{args:["-i","-c",o],sentinel:n}:{args:t==="bash"||t==="zsh"?["-ic",o]:["-lc",o],sentinel:n}}r(se,"buildShellEnvCommand");function ae(e,t){let n=`${t}\0`,o=e.lastIndexOf(n);if(o===-1)return{};let i=e.slice(o+n.length),s={};for(let a of i.split("\0")){if(!a)continue;let u=a.indexOf("=");u<=0||(s[a.slice(0,u)]=a.slice(u+1))}return s}r(ae,"parseNullDelimitedShellEnv");function le(e={}){let t=e.env??process.env;if((e.platform??process.platform)==="win32"||t.KODAX_DISABLE_SHELL_ENV_HYDRATION==="1")return!1;let o=e.shell??t.SHELL;if(!o||!f.isAbsolute(o))return!1;let{args:i,sentinel:s}=se(o),a=e.run??te,u={...t,TERM:ie},c=a(o,i,{encoding:"utf8",env:u,maxBuffer:1024*1024,timeout:5e3,windowsHide:!0,detached:!0,stdio:["ignore","pipe","pipe"]});if(c.status!==0||!c.stdout)return!1;let J=typeof c.stdout=="string"?c.stdout:c.stdout.toString("utf8"),Y=ae(J,s),A=!1;for(let[_,Q]of Object.entries(Y))_!=="TERM"&&t[_]===void 0&&(t[_]=Q,A=!0);return A}r(le,"hydrateProcessEnvFromShell");function ce(){if(!L){L=!0;try{le()}catch{}}}r(ce,"ensureShellEnvironmentHydrated");function We(){L=!1}r(We,"resetShellEnvironmentHydrationForTesting");function ue(e){K(e.customProviders??[])}r(ue,"registerConfiguredCustomProviders");function z(e){if(!Array.isArray(e))return;let t=e.filter(n=>typeof n=="string").map(n=>n.trim()).filter(n=>n.length>0);return t.length>0?t:[]}r(z,"normalizeConfiguredExtensions");function fe(e){if(e.permissionMode!=="default")return e;let t={...e,permissionMode:"accept-edits"};try{l.mkdirSync(f.dirname(d),{recursive:!0}),l.writeFileSync(d,JSON.stringify(t,null,2))}catch{}return t}r(fe,"migrateLegacyPermissionModeInConfig");function de(e){if(e.permissionMode!=="auto-in-project")return e;try{let t=l.readFileSync(d,"utf-8"),n=t.replace(/("permissionMode"\s*:\s*)"auto-in-project"/,'$1"auto"');n!==t&&l.writeFileSync(d,n)}catch{}return{...e,permissionMode:"auto"}}r(de,"migrateAutoInProjectAliasInConfig");function pe(){if(p)return p;let e="0.7.62";if(e)return p=e,p;let t=f.join(f.dirname(oe(import.meta.url)),"../../package.json");if(l.existsSync(t))try{return p=JSON.parse(l.readFileSync(t,"utf-8")).version??"0.0.0",p??"0.0.0"}catch{}return p="0.0.0",p}r(pe,"getVersion");var He=pe();function me(e){return M(e)}r(me,"getProviderModel");function R(e,t){let n=new Set(e.map(i=>i.toLowerCase())),o=[...e];for(let i of t)n.has(i.toLowerCase())||o.push(i);return o}r(R,"mergeModels");function ge(e,t){t||(t=b().providerModels);let n=t?.[e];if(n&&n.length>0){try{let o=S(e);if(o.length>0)return R(n,o)}catch{}try{let o=g(e);if(o)return R(n,o.getAvailableModels())}catch{}return n}try{let o=S(e);if(o.length>0)return o}catch{}try{let o=g(e);if(o)return o.getAvailableModels()}catch{}return[]}r(ge,"getProviderAvailableModels");function ve(e,t){let n=D(e,t);if(n!=="unknown")return n;try{let o=g(e);if(o)return o.getReasoningCapability(t)}catch{}return"unknown"}r(ve,"getProviderReasoningCapability");function ye(e){let t=T(e);if(t)return t;try{return P().find(o=>o.name===e)?.capabilityProfile??null}catch{return null}}r(ye,"getProviderCapabilityProfile");function q(e,t){let n=ye(e),o=ve(e,t);if(n)return{capabilityProfile:n,reasoningCapability:o};try{let i=X(e);return{capabilityProfile:i.getCapabilityProfile(),reasoningCapability:i.getReasoningCapability(t)}}catch{return null}}r(q,"getProviderCapabilityMetadata");function ze(e,t){let n=q(e,t);return n?U({providerName:e,model:t,capabilityProfile:n.capabilityProfile,reasoningCapability:n.reasoningCapability==="unknown"?void 0:n.reasoningCapability}):null}r(ze,"getProviderCapabilitySnapshot");function he(e,t,n,o){let i=q(e,t);return i?$({providerName:e,model:t,capabilityProfile:i.capabilityProfile,reasoningCapability:i.reasoningCapability==="unknown"?void 0:i.reasoningCapability,reasoningMode:n,hints:o}):null}r(he,"getProviderPolicyDecision");function qe(e){let t=e.transport==="cli-bridge"?"CLI bridge":"Native API",n=e.conversationSemantics==="last-user-message"?"forwards only the latest user message":"preserves full conversation history",o=e.mcpSupport==="native"?"MCP available":"MCP unavailable";return`${t}; ${n}; ${o}`}r(qe,"describeProviderCapabilitySummary");function Je(e){switch(e){case"native-budget":return"B";case"native-effort":return"E";case"native-toggle":return"T";case"native-adaptive":return"A";default:return"-"}}r(Je,"formatReasoningCapabilityShort");function m(e){if(e)return e==="none"?"off":e}r(m,"formatReasoningEffortForDisplay");function y(e,t){let n=m(t);n&&!e.includes(n)&&e.push(n)}r(y,"pushUniqueEffortDisplay");function Ye(e,t){let n=["auto"],i=E(e,t)?.supportedEfforts?.filter(s=>s.isUserVisible!==!1);if(!i||i.length===0){for(let s of["off","low","medium","high"])y(n,s);return n}for(let s of i)y(n,s.value);return n}r(Ye,"getProviderReasoningEffortOptions");function Qe(e,t){let n=E(e,t),o=new Set(n?.disabledEfforts??[]),i=n?.supportedEfforts?.filter(c=>c.isUserVisible!==!1),s=[],a=n?.supportsDisabledThinking===!0;if(!i||i.length===0){for(let c of["low","medium","high"])y(s,c);a=!0}else for(let c of i){if(c.value==="none"){a=!0;continue}if(o.has(c.value)){a=!0;continue}y(s,c.value)}let u=[];return a&&u.push("off"),u.push(...s),u.push("auto"),u}r(Qe,"getProviderReasoningEffortCycle");function Ee(e,t){if(t===!1)return"off";switch(e){case"off":return"off";case"quick":return"low";case"balanced":return"medium";case"deep":return"high";default:return"auto"}}r(Ee,"legacyReasoningModeToEffortDisplay");function E(e,t){let n=t??me(e);if(!n)return;let o=F(e,n)?.reasoningProfile;if(o)return k(o,j(e,n))}r(E,"resolveReasoningProfileForDisplay");function Ze(e){let t=m(e.effort)??Ee(e.reasoningMode,e.thinking),n=E(e.provider,e.model);if(!n)return t;try{let o=x({capability:n,explicitEffort:e.effortOverride?e.effort:void 0,sessionEffort:e.effortOverride?void 0:e.effort,legacyReasoningMode:e.reasoningMode,thinking:e.thinking}),i=m(o.configuredEffort)??t,a=o.configuredEffort!==void 0&&n.disabledEfforts?.includes(o.configuredEffort)===!0?"off":m(o.effectiveEffort);return a&&a!==i?`${i}->${a}`:i}catch{if(e.effort)try{let o=O({currentEffort:e.effort,capability:n}),i=m(e.effort)??t,s=m(o.effectiveEffort);return s&&s!==i?`${i}->${s}`:i}catch{return t}return t}}r(Ze,"formatReasoningEffortStatusLabel");function et(e){let t=ke(e);if(!t)return{preserved:!0};let n=E(e.provider,e.model);if(!n)return{configuredEffort:t,runtimeEffort:t,preserved:!0};let o=O({currentEffort:t,capability:n});return{configuredEffort:t,runtimeEffort:o.effectiveEffort,preserved:o.preserved,diagnostic:o.diagnostic}}r(et,"resolveProviderReasoningRuntimeEffort");function be(e){switch(e){case"native-budget":return"budget";case"native-effort":return"effort";case"native-toggle":return"toggle";case"native-adaptive":return"adaptive";default:return"none"}}r(be,"describeReasoningCapabilityControl");function tt(e,t){if(e==="off")return"Reasoning disabled";switch(t){case"native-budget":return"Uses native thinking budget control";case"native-effort":return"Uses native reasoning effort control";case"native-toggle":return"Uses provider-native thinking toggle only";case"native-adaptive":return"Model adaptively decides thinking depth (Opus 4.7+)";case"none":return"Runs without native reasoning parameters";case"prompt-only":return"Uses prompt overlays only; no native reasoning parameter";default:return"Runs without native reasoning parameters"}}r(tt,"describeReasoningExecution");function nt(e){let t=[];e||(e=b().providerModels);for(let n of N())t.push({name:n.name,model:n.model,models:ge(n.name,e),configured:n.capabilityProfile.transport==="cli-bridge"?!0:n.configured,reasoningCapability:n.reasoningCapability,capabilityProfile:n.capabilityProfile});try{let n=P().map(o=>({...o,models:(()=>{let i=e?.[o.name];return i&&i.length>0?R(i,o.models):o.models})()}));t.push(...n)}catch{}return t}r(nt,"getProviderList");function ot(e){if(I(e))return!0;try{return g(e)?.isConfigured()??!1}catch{return!1}}r(ot,"isProviderConfigured");function b(){try{if(l.existsSync(d)){let e=JSON.parse(l.readFileSync(d,"utf-8")),t=e.reasoningCeiling??e.reasoningMode;return de(fe({...e,reasoningMode:t,extensions:z(e.extensions)}))}}catch{}return{}}r(b,"loadConfig");var w=f.join(h,"config.example.jsonc"),_e=`// KodaX example configuration \u2014 copy what you need into config.json (in this same
|
|
3
|
-
// folder). config.json must be STRICT JSON: no comments, no trailing commas. Most
|
|
4
|
-
// settings also have a KODAX_* env var that overrides the file. Delete anything you
|
|
5
|
-
// don't use; everything here is optional.
|
|
6
|
-
{
|
|
7
|
-
// Default provider + model. Override live with /provider and /model.
|
|
8
|
-
// "provider": "deepseek",
|
|
9
|
-
// "model": "deepseek-v4",
|
|
10
|
-
|
|
11
|
-
// Reasoning effort for normal turns: off | auto | low | medium | high | xhigh | max.
|
|
12
|
-
// "effort": "high",
|
|
13
|
-
|
|
14
|
-
// Permission mode: "accept-edits" | "plan" | "auto".
|
|
15
|
-
// "permissionMode": "accept-edits",
|
|
16
|
-
|
|
17
|
-
// Custom providers \u2014 point KodaX at an OpenAI/Anthropic-compatible endpoint.
|
|
18
|
-
// "customProviders": [
|
|
19
|
-
// {
|
|
20
|
-
// "name": "my-relay", // unique; do NOT reuse a built-in provider name
|
|
21
|
-
// "protocol": "openai", // "openai" or "anthropic" = the wire format the endpoint speaks
|
|
22
|
-
// "baseUrl": "https://api.example.com/v1",
|
|
23
|
-
// "apiKeyEnv": "MY_RELAY_API_KEY", // env var that holds the key (never put the key here)
|
|
24
|
-
// "model": "deepseek/deepseek-v4",
|
|
25
|
-
// "models": ["deepseek/deepseek-v4"],
|
|
26
|
-
//
|
|
27
|
-
// // --- Thinking / reasoning (optional) ---
|
|
28
|
-
// // For most NON-Claude models this single line is all you need:
|
|
29
|
-
// "supportsThinking": true
|
|
30
|
-
// // openai-compat : KodaX sends no thinking toggle and just shows whatever
|
|
31
|
-
// // reasoning the model emits (deepseek/qwen/etc. via relays).
|
|
32
|
-
// // anthropic-compat: KodaX sends thinking:{type:"enabled"} \u2014 what the Anthropic
|
|
33
|
-
// // endpoints of zhipu / kimi / minimax / deepseek expect.
|
|
34
|
-
// //
|
|
35
|
-
// // openai-compat MULTI-TURN: some models (notably DeepSeek V4) reject later turns
|
|
36
|
-
// // whose history drops the previous reasoning_content. If thinking shows on turn 1
|
|
37
|
-
// // but turn 2 errors, also set: "replayReasoningContent": true
|
|
38
|
-
// //
|
|
39
|
-
// // To expose a TUNABLE effort level, use "reasoning" instead. Include "off" to
|
|
40
|
-
// // allow disabling thinking:
|
|
41
|
-
// // "reasoning": { "efforts": ["off", "low", "high"], "default": "high" }
|
|
42
|
-
// //
|
|
43
|
-
// // Pointing anthropic-compat at REAL Claude (4.6+)? Claude needs ADAPTIVE
|
|
44
|
-
// // thinking, not the enable toggle \u2014 set instead:
|
|
45
|
-
// // "reasoningCapability": "native-adaptive"
|
|
46
|
-
// }
|
|
47
|
-
// ],
|
|
48
|
-
|
|
49
|
-
// MCP servers (stdio or remote). See the /mcp command and manual topic "mcp".
|
|
50
|
-
// "mcpServers": {}
|
|
51
|
-
}
|
|
52
|
-
`;function rt(){try{return l.existsSync(d)||l.existsSync(w)?void 0:(l.mkdirSync(h,{recursive:!0}),l.writeFileSync(w,_e,"utf-8"),w)}catch{return}}r(rt,"ensureExampleConfigFile");function Oe(e){e.streamIdleTimeoutMs&&!process.env.KODAX_STREAM_IDLE_TIMEOUT_MS&&(process.env.KODAX_STREAM_IDLE_TIMEOUT_MS=String(e.streamIdleTimeoutMs))}r(Oe,"applyResilienceRuntimeEnv");function Se(e){e.repoIntelligenceMode&&!process.env.KODAX_REPO_INTELLIGENCE&&(process.env.KODAX_REPO_INTELLIGENCE=e.repoIntelligenceMode),e.repoIntelligenceTrace===!0&&!process.env.KODAX_REPO_INTELLIGENCE_TRACE&&(process.env.KODAX_REPO_INTELLIGENCE_TRACE="1")}r(Se,"applyRepoIntelligenceRuntimeEnv");function Pe(e){e.verifierLog===!0&&!process.env.KODAX_VERIFIER_LOG&&(process.env.KODAX_VERIFIER_LOG="1")}r(Pe,"applyVerifierRuntimeEnv");function Ce(e){e.stallLog===!0&&!process.env.KODAX_STALL_LOG&&(process.env.KODAX_STALL_LOG="1")}r(Ce,"applyStallSidecarRuntimeEnv");function we(e){let t=e.fallbackProviders?.filter(n=>n.trim().length>0)??[];t.length>0&&!process.env.KODAX_FALLBACK_PROVIDERS&&(process.env.KODAX_FALLBACK_PROVIDERS=t.join(","))}r(we,"applyFallbackRuntimeEnv");function Le(e){let t=r((n,o)=>{n&&n.trim().length>0&&!process.env[o]&&(process.env[o]=n.trim())},"bridge");t(e.fastProvider,"KODAX_FAST_PROVIDER"),t(e.fastModel,"KODAX_FAST_MODEL"),t(e.deepProvider,"KODAX_DEEP_PROVIDER"),t(e.deepModel,"KODAX_DEEP_MODEL")}r(Le,"applyModelTierRuntimeEnv");var Re=[{env:"KODAX_MAX_OUTPUT_TOKENS",value:r(e=>typeof e.maxOutputTokens=="number"?String(e.maxOutputTokens):void 0,"value")},{env:"KODAX_DISABLE_PROMPT_CACHE",value:r(e=>e.disablePromptCache===!0?"1":void 0,"value")},{env:"KODAX_LSP",value:r(e=>e.lsp===!1?"0":e.lsp===!0?"1":void 0,"value")},{env:"KODAX_LSP_DOWNLOAD",value:r(e=>e.lspAutoDownload===!0?"1":void 0,"value")},{env:"KODAX_ACP_LOG",value:r(e=>e.acpLogLevel&&e.acpLogLevel.trim().length>0?e.acpLogLevel.trim():void 0,"value")},{env:"KODAX_REPO_INTELLIGENCE_TOOL_WAIT_MS",value:r(e=>typeof e.repoIntelligence?.toolWaitMs=="number"?String(e.repoIntelligence.toolWaitMs):void 0,"value")},{env:"KODAX_REPO_INTELLIGENCE_WORKER_TIMEOUT_MS",value:r(e=>typeof e.repoIntelligence?.workerTimeoutMs=="number"?String(e.repoIntelligence.workerTimeoutMs):void 0,"value")},{env:"KODAX_REPO_INTELLIGENCE_WORKER_OLD_SPACE_MB",value:r(e=>typeof e.repoIntelligence?.workerOldSpaceMb=="number"?String(e.repoIntelligence.workerOldSpaceMb):void 0,"value")},{env:"KODAX_REPO_INTELLIGENCE_STORAGE_DIR",value:r(e=>e.repoIntelligence?.storageDir?.trim()||void 0,"value")},{env:"KODAX_WORKFLOW_MAX_CONCURRENCY",value:r(e=>typeof e.workflow?.maxConcurrency=="number"?String(e.workflow.maxConcurrency):void 0,"value")}];function Ae(e){for(let t of Re){let n=t.value(e);n!==void 0&&!process.env[t.env]&&(process.env[t.env]=n)}}r(Ae,"applyConfigSurfaceBridges");function it(){ce();let e=b();return Oe(e),Se(e),Pe(e),Ce(e),we(e),Le(e),Ae(e),ue(e),B(e.locale),e}r(it,"prepareRuntimeConfig");function st(e){let n={...b(),...e},o=z(n.extensions);o!==void 0&&(n.extensions=o);for(let i of Object.keys(e))e[i]===void 0&&delete n[i];l.mkdirSync(f.dirname(d),{recursive:!0}),l.writeFileSync(d,JSON.stringify(n,null,2))}r(st,"saveConfig");function at(e,t){return e.effort!==void 0||t.effort!==void 0}r(at,"resolveInitialEffortOverride");function ke(e){return e.permissionMode==="plan"&&e.effortOverride!==!0&&e.planModeEffort!==void 0?e.planModeEffort:e.effort}r(ke,"resolvePermissionModeEffort");async function lt(e){try{let{stdout:t}=await re("git rev-parse --show-toplevel",{cwd:e});return t.trim()}catch{return null}}r(lt,"getGitRoot");function xe(e){switch(e){case"builtin":return"Built-in";case"runtime":return"Runtime extension";case"custom":return"Custom config";default:return"Unknown"}}r(xe,"formatProviderSourceKind");function ct(e){let t=e.transport==="cli-bridge"?"CLI bridge":"Native API",n=e.conversationSemantics==="last-user-message"?"latest-user-message only":"full conversation history";return[`Source: ${xe(e.sourceKind)}`,`Transport: ${t}`,`Conversation semantics: ${n}`,`Context fidelity: ${e.contextFidelity}`,`Tool calling: ${e.toolCallingFidelity}`,`Session behavior: ${e.sessionSupport}`,`Long-running support: ${e.longRunningSupport}`,`Evidence-heavy flows: ${e.evidenceSupport}`,`Multimodal support: ${e.multimodalSupport}`,`MCP support: ${e.mcpSupport}`,`Reasoning control: ${be(e.reasoningCapability)}`]}r(ct,"formatProviderCapabilityDetailLines");function ut(e,t,n){return[{label:"General coding",hints:{}},{label:"Evidence-heavy review",hints:{evidenceHeavy:!0}},{label:"Long-running task",hints:{longRunning:!0}}].map(i=>({label:i.label,decision:he(e,t,n,i.hints)})).filter(i=>i.decision!==null)}r(ut,"getProviderCommonPolicyScenarios");var W=.5,H=0,v={locked:!1,queue:[]};async function ft(e){for(;v.locked;)await new Promise(t=>v.queue.push(t));v.locked=!0;try{let t=(Date.now()-H)/1e3;t<W&&await new Promise(o=>setTimeout(o,(W-t)*1e3));let n=await e();return H=Date.now(),n}finally{v.locked=!1;let t=v.queue.shift();t&&t()}}r(ft,"rateLimitedCall");export{Ie as a,h as b,Ve as c,d,Be as e,le as f,We as g,ue as h,pe as i,He as j,me as k,ge as l,ve as m,ye as n,ze as o,he as p,qe as q,Je as r,m as s,Ye as t,Qe as u,Ze as v,et as w,be as x,tt as y,nt as z,ot as A,b as B,w as C,rt as D,it as E,st as F,at as G,ke as H,lt as I,xe as J,ct as K,ut as L,ft as M};
|