@kodax-ai/kodax 0.7.60 → 0.7.62

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +82 -2
  2. package/README.md +2 -0
  3. package/README_CN.md +2 -0
  4. package/dist/chunks/{agent-L5FC3YOY.js → agent-4ZMCIEGD.js} +1 -1
  5. package/dist/chunks/argument-completer-5PWSKFKI.js +2 -0
  6. package/dist/chunks/{chunk-5TRQBMPR.js → chunk-2F4R7WM7.js} +1 -1
  7. package/dist/chunks/chunk-3KD26NCI.js +310 -0
  8. package/dist/chunks/chunk-6HTR3GHZ.js +624 -0
  9. package/dist/chunks/{chunk-XULI4U7I.js → chunk-AY3BLB4Q.js} +96 -96
  10. package/dist/chunks/chunk-E2Q4RIOD.js +731 -0
  11. package/dist/chunks/{chunk-SGNM3UP6.js → chunk-HO6P6CPU.js} +1 -1
  12. package/dist/chunks/{chunk-2RLIKZOZ.js → chunk-JILSZHCQ.js} +2 -2
  13. package/dist/chunks/chunk-OGRJQGKO.js +19 -0
  14. package/dist/chunks/{chunk-QFCF3GNT.js → chunk-S4ISEA6F.js} +171 -156
  15. package/dist/chunks/chunk-WFE6FBQ2.js +326 -0
  16. package/dist/chunks/{compaction-config-E4LN3M53.js → compaction-config-SP3REMFR.js} +1 -1
  17. package/dist/chunks/{construction-bootstrap-GIFDM4L5.js → construction-bootstrap-4ZNFZFX2.js} +3 -3
  18. package/dist/chunks/{dist-7PXDYX2R.js → dist-IKWRJW6J.js} +1 -1
  19. package/dist/chunks/host-XL5CH7QP.js +2 -0
  20. package/dist/chunks/{run-manager-IU5COC6X.js → run-manager-UXIPDVVF.js} +1 -1
  21. package/dist/chunks/{utils-NP42DKL3.js → utils-XKWEVPE3.js} +1 -1
  22. package/dist/index.d.ts +7 -7
  23. package/dist/index.js +1 -1
  24. package/dist/kodax_cli.js +1021 -970
  25. package/dist/sdk-agent.d.ts +67 -8
  26. package/dist/sdk-agent.js +1 -1
  27. package/dist/sdk-coding.d.ts +15 -13
  28. package/dist/sdk-coding.js +1 -1
  29. package/dist/sdk-mcp.js +1 -1
  30. package/dist/sdk-repl.d.ts +9 -9
  31. package/dist/sdk-repl.js +1 -1
  32. package/dist/sdk-session.d.ts +4 -4
  33. package/dist/sdk-session.js +1 -1
  34. package/dist/sdk-skills.js +1 -1
  35. package/dist/types-chunks/{bash-prefix-extractor.d-Ds1THKeH.d.ts → bash-prefix-extractor.d-Do_TCAmA.d.ts} +19 -9
  36. package/dist/types-chunks/{guardrail.d-CdqJwwN7.d.ts → guardrail.d-DRp0Lqvx.d.ts} +2 -2
  37. package/dist/types-chunks/{process.d-C93UMgPK.d.ts → process.d-DXkRD7hj.d.ts} +265 -13
  38. package/dist/types-chunks/{run-manager.d-DLK3ed-T.d.ts → run-manager.d-CYY3pZeJ.d.ts} +18 -4
  39. package/dist/types-chunks/{sdk-session-CtwN7iBO.d.ts → sdk-session-BGGOC0cT.d.ts} +3 -3
  40. package/dist/types-chunks/{storage.d-DlZS0g8w.d.ts → storage.d-C3umBC4g.d.ts} +2 -2
  41. package/dist/types-chunks/{types.d-CSZAMmU-.d.ts → types.d-DFf4Sfys.d.ts} +1 -1
  42. package/dist/types-chunks/{utils.d-Boz9k2HB.d.ts → utils.d-ChOEH3NF.d.ts} +4 -4
  43. package/package.json +1 -1
  44. package/dist/chunks/argument-completer-BQDAYT7W.js +0 -2
  45. package/dist/chunks/chunk-4K5BDO7S.js +0 -721
  46. package/dist/chunks/chunk-6DWXUZMO.js +0 -600
  47. package/dist/chunks/chunk-IJN6ZJVI.js +0 -310
  48. package/dist/chunks/chunk-U6BNMGSK.js +0 -17
  49. package/dist/chunks/chunk-ZPD7IUKW.js +0 -322
  50. package/dist/chunks/host-FLG7FJZT.js +0 -2
package/CHANGELOG.md CHANGED
@@ -6,7 +6,87 @@ All notable changes to this project will be documented in this file.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- ## [0.7.60] - 2026-07-04
9
+ ## [0.7.62] - 2026-07-06
10
+
11
+ > Scope note: a memory-governance release plus interaction polish. **FEATURE_228**
12
+ > upgrades FEATURE_224's memory handoff lane into a governed memory control plane:
13
+ > one proposal store, typed memory refs, preview/fingerprint-guarded writes,
14
+ > deterministic task-aware memory hints, curator reports, and thin `/memory`
15
+ > commands. The release also completes the `ask_user_question` interaction gap
16
+ > tracked as issue 112 by adding free-text input, multi-select bounds, and
17
+ > host-side custom-input answers. No vector database, embeddings service, or
18
+ > second memory store is introduced.
19
+
20
+ ### Added
21
+
22
+ - **Unified Memory Control Plane + Memory Governance (FEATURE_228).** Added the
23
+ agent-layer `MemoryControlPlane` and typed memory contracts for refs,
24
+ snapshots, action proposals, approvals, apply results, governance findings,
25
+ memory packs, and review plans. F224 `memdir_handoff` / `reasoning_handoff`
26
+ proposals are projected through the memory controller instead of copied into a
27
+ second store, keeping `/learn` and `/memory` on one proposal lifecycle.
28
+ - **Memory command surface and deterministic prompt hints.** `/memory inbox`,
29
+ `/memory pending`, `/memory show`, `/memory approve`, `/memory reject`, and
30
+ `/memory curate` are thin REPL adapters over the agent-layer controller.
31
+ Coding prompt assembly now injects only a bounded memory index preview plus
32
+ small governed memory hints; topic bodies remain on-demand reads, and selected
33
+ memory refs are surfaced as trace metadata instead of prompt body noise.
34
+ - **Governance and feedback review hooks.** Memory governance can report duplicate,
35
+ conflict, stale, quarantined, orphaned, and no-op findings without mutating
36
+ memory. Automatic curator runs are maintenance-window based, write bounded JSON
37
+ audit reports, retain only the newest 200 reports, and never rewrite memory
38
+ files. Feedback-triggered review accepts bounded candidate refs and requires
39
+ the normal approval path before mutation.
40
+
41
+ ### Changed
42
+
43
+ - **`ask_user_question` now supports open-ended answers.** The tool schema and
44
+ host contracts accept `kind: "input"`, `multi_select`, selection bounds, and
45
+ default-on custom input options (`allow_custom_input: false` opts out). REPL
46
+ select dialogs use focus navigation, space toggles multi-select entries, Enter
47
+ submits focused/selected values, and custom answers are returned as normalized
48
+ `choice` / `choices` plus `custom_inputs` metadata.
49
+ - **Memory approval requires preview fingerprints.** `approveProposal` now
50
+ requires fingerprints from a shown preview and fails closed on stale target or
51
+ `MEMORY.md` changes. Already-applied target/index writes complete idempotently
52
+ with warnings instead of rewriting identical content.
53
+
54
+ ### Fixed
55
+
56
+ - **Resolved issue 112: `ask_user_question` interaction incompleteness.** The
57
+ model can now request free-text input, multi-select choices, and custom "Other"
58
+ answers without forcing fragile pre-combined option sets.
59
+ - **User-scroll residual-cell repaint guard.** Alt-screen scroll repaint now
60
+ erases and repaints the affected visible rows before the normal diff pass, so
61
+ stale wide-char or skipped-cell residue cannot remain after user-driven
62
+ transcript scrolling.
63
+
64
+ ## [0.7.61] - 2026-07-06
65
+
66
+ > Scope note: a token-efficiency + workflow-reliability release. **FEATURE_251** adds command-aware
67
+ > in-tool output compression (an rtk-style Token Killer port) inside KodaX's own `bash` tool layer,
68
+ > so a noisy `git diff` / test run / package-install / docker-build no longer spends thousands of
69
+ > context tokens — the compressed body is what context accounting actually counts, and every lossy
70
+ > summary keeps a raw-recovery path. **FEATURE_252** lands the deterministic half of workflow-quality
71
+ > preflight: a pre-start AST/dataflow lint that hard-fails weak-model authoring contract bugs before
72
+ > a workflow can run. Both are deterministic (no prompt change, no LLM eval). The release also fixes a
73
+ > workflow-start crash: `typescript` is now a runtime dependency of `@kodax-ai/agent` because the
74
+ > quality lint uses the TypeScript compiler API on the workflow hot path. No public runtime type is removed.
75
+
76
+ ### Added
77
+
78
+ - **Tool-output semantic compression — command-aware in-tool Token Killer (FEATURE_251, ADR-050).** A new `packages/coding/src/tools/output-filters/` module compresses bash `stdout`/`stderr` **body** after decode, before the `Command:` / `Exit:` header is assembled, at the single `bash.ts` close-handler integration point (so both the SA and AMA dispatch paths are covered by one change). It ships a lossless generic layer (ANSI strip), compiled stateful filters (`git-diff`, `git-log`, `git-status`, `test-runner` failure-focus, `lint` diagnostic grouping, `json-output` / NDJSON structural summary), and a built-in declarative long-tail table (package-manager / docker / infra CLI progress). Hard constraints: the `Command:` / `Exit:` header is preserved verbatim (FEATURE_185 hits-ledger depends on it); the generic layer is lossless-by-construction with `never_worse` as a size-only backstop; content-signature detection is preferred over command-name matching (robust to compound commands and pipes); and every lossy filter (`lossiness: tail | whole`) first persists the raw decoded body via `persistToolOutput` and appends a recovery hint, falling back to the raw body + existing tail-truncation if the persist fails. `background` / `timeout` / `abort` paths do not reach the completion assembly and are naturally excluded. Isolated Layer-1 measurements (`context-savings.test.ts`) show ~66–99% body-token reduction on high-noise commands (e.g. a 120-file `git diff` 9,960 → 1,344 tokens; a `terraform apply` progress stream 10,617 → 59). Deterministic code — no prompt change, no FEATURE_104 eval. Human test guide: `docs/test-guides/FEATURE_251_v0.7.61_TEST_GUIDE.md`.
79
+ - **Deterministic workflow-quality preflight lint (FEATURE_252).** A new `packages/agent/src/workflow/quality-lint.ts` (`lintRestrictedWorkflowSource` / `assertRestrictedWorkflowQuality`, exported from the workflow package) runs inside restricted workflow module materialization (`script-runner.ts` `createRestrictedWorkflowModule`) and in the coding workflow host with host-policy `maxAgents`, so structural contract violations fail before a run can start — matching the existing inline-smoke hard-fail feedback loop. It hard-fails three deterministic contract classes only: (1) an unawaited workflow-command variable (`wf.runAgent` / `wf.spawnAgent` / `wf.wait` / `wf.synthesize` / `wf.workflow` / `wf.artifact`) used in a boolean position (`if (x)`, `!x`, ternary test, `x && …`, `x || …`, loop test) — a case a runtime Proxy cannot catch because object truthiness has no Proxy trap; (2) top-level structured-output field access (`result.findings`, `result.summary`, …) when the fields belong under `result.structured`; and (3) a literal `[...]`/`[...].map(...)` agent fanout whose static upper bound exceeds `manifest.maxAgents` or a known host cap. Review/verifier/generic quality heuristics are intentionally **not** emitted as model-visible warnings (a lightweight AST pass cannot distinguish a weak workflow from a valid optimized one, and surfacing them causes needless rewrite churn). Human test guide: `docs/test-guides/FEATURE_252_v0.7.61_TEST_GUIDE.md`.
80
+
81
+ ### Changed
82
+
83
+ - **Review/audit workflow templates make adversarial verification explicit (FEATURE_252 Layer 2).** The default generator/authoring fixtures for `adversarial-verification` shapes now use explicit verifier stages and `task_id:` evidence refs, so the desired shape — finders → adversarial verifiers → synthesis of confirmed findings — is stated in the template rather than left to a weak authoring model to infer. This reduces reliance on lint and is robust to capability-limited authors.
84
+
85
+ ### Fixed
86
+
87
+ - **Workflow-start crash: `typescript` promoted to a runtime dependency of `@kodax-ai/agent`.** The FEATURE_252 quality lint imports the TypeScript compiler API (`ts.createSourceFile`, …) and runs on every workflow start via `assertRestrictedWorkflowQuality`. With `typescript` only in `devDependencies`, a bundled/published build resolved no `typescript` module at that call site, throwing an uncaught error that crashed the process before the workflow ran (leaving the terminal in a corrupted mouse/alt-screen state). Moving `typescript` to `dependencies` fixes the workflow-front crash.
88
+
89
+ ## [0.7.60] - 2026-07-05
10
90
 
11
91
  > Scope note: an F250 refactor + Space SDK rollup. **FEATURE_250** brings the deferred-tool
12
92
  > progressive-disclosure mechanism — previously SA-path-only — to the AMA/AMAW **managed** tool
@@ -1126,7 +1206,7 @@ Two features close out v0.7.32 and the Plan B roadmap. **FEATURE_090** is the ro
1126
1206
  ### Documentation
1127
1207
 
1128
1208
  - **EVAL_GUIDELINES rewrite** — `benchmark/EVAL_GUIDELINES.md` now documents the **single-turn probe methodology** as the official KodaX eval pattern and removes end-to-end loop comparisons from the recommended set. Loops conflate prompt quality with tool-availability artefacts (model tries to verify with `read`/`grep`/`bash`, harness can't provide tools, benchmark scores the format-fail). Single-turn probes test the prompt-only contract.
1129
- - **FEATURE_108 design** (`docs/features/v0.7.47.md`) — Session-Driven Reflective Prompt Patcher spec landed for v0.7.47 design preview.(注:版本重排后 FEATURE_108 先于 2026-06-05 迁至 v0.7.54,再于 2026-06-11 顺延至 [`docs/features/v0.7.72.md`](docs/features/v0.7.72.md);`v0.7.47.md` 现为 FEATURE_218 + FEATURE_132)
1209
+ - **FEATURE_108 design** (`docs/features/v0.7.47.md`) — Session-Driven Reflective Prompt Patcher spec landed for v0.7.47 design preview.(注:版本重排后 FEATURE_108 先于 2026-06-05 迁至 v0.7.54,再经后续节奏重排顺延至 [`docs/features/v0.7.95.md`](docs/features/v0.7.95.md);`v0.7.47.md` 现为 FEATURE_218 + FEATURE_132)
1130
1210
  - **FEATURE_109 design** (`docs/features/v0.7.48.md`) — Harness Observability Substrate (long-term memory + prediction contract + cross-family prose guard) spec landed for v0.7.48 design preview.
1131
1211
  - **`docs/features/v0.7.29.md` 1496-line expansion** — folds back the historical capability-inventory artifact (`v0.7.29-capability-inventory.md` deleted) and adds deeper FEATURE_103/104/107-related context to the v0.7.29 retrospective.
1132
1212
  - **`docs/CODING_AGENT_PROMPTS.md`** — cross-project prompt-system reference (4 open-source coding agents) for KodaX prompt design comparison. Research artefact, not a project doc.
package/README.md CHANGED
@@ -412,6 +412,8 @@ KodaX has two layers that consumers should understand separately:
412
412
 
413
413
  **Progressive Disclosure on the Managed Tool Path (FEATURE_250, v0.7.60)**: the deferred-tool progressive-disclosure mechanism — previously SA-path-only — now applies to the AMA/AMAW **managed** path too. Cache-cold managed turns carry one-line search hints instead of full descriptions for the 13 non-mcp deferred tools (repo-intelligence + web/code + goal); each tool's `input_schema` is unchanged, so it stays directly callable and the full description is fetched on demand via `tool_search`. `mcp_*` stay resident and `run_workflow` is untouched. Transparent to users; validated by two 5-alias eval panels (DEFER_SAFE 5/5, 0% read/grep fallback). See [docs/features/v0.7.60.md](docs/features/v0.7.60.md).
414
414
 
415
+ **Tool-Output Compression + Workflow Quality Preflight (FEATURE_251 + FEATURE_252, v0.7.61)**: KodaX's own `bash` tool now compresses noisy command output **inside the tool**, so a big `git diff`, test run, package install, or `docker build` no longer spends thousands of context tokens — command-aware filters (git/test/lint/JSON + a declarative package/docker/infra long-tail) summarize the stdout/stderr body while the `Command:`/`Exit:` header stays verbatim and every lossy summary keeps a raw-recovery path; isolated measurements show ~66–99% body-token reduction. Alongside it, inline `run_workflow` gains a deterministic pre-start quality lint that hard-fails weak-model authoring contract bugs (unawaited workflow-command used as a boolean, top-level access of `result.structured` fields, literal agent fanout above manifest/host caps) before a run starts. Both are deterministic (no prompt change). See [docs/features/v0.7.61.md](docs/features/v0.7.61.md) and [docs/ADR.md ADR-050](docs/ADR.md).
416
+
415
417
  ---
416
418
 
417
419
  ## Features
package/README_CN.md CHANGED
@@ -514,6 +514,8 @@ KodaX 有两层结构,SDK 用户需要分开理解:
514
514
 
515
515
  **managed 工具路径的渐进披露(FEATURE_250,v0.7.60)**:deferred-tool 渐进披露机制——此前仅 SA path 拥有——现在也应用于 AMA/AMAW 的 **managed** path。缓存冷启的 managed 轮次对 13 个 non-mcp 延迟工具(repo-intelligence + web/code + goal)携带一行 search hint 而非完整描述;每个工具的 `input_schema` 不变,因此仍可直接调用,完整描述按需通过 `tool_search` 拉取。`mcp_*` 保持常驻,`run_workflow` 不动。对用户透明;由两个 5-alias eval panel 验证(DEFER_SAFE 5/5,0% read/grep 回退)。详见 [docs/features/v0.7.60.md](docs/features/v0.7.60.md)。
516
516
 
517
+ **工具输出压缩 + Workflow 质量预检(FEATURE_251 + FEATURE_252,v0.7.61)**:KodaX 自有的 `bash` 工具现在**在工具内**压缩高噪声命令输出,一次大 `git diff`、测试、包安装或 `docker build` 不再吞掉数千 context token——命令感知过滤器(git/test/lint/JSON + 声明式 package/docker/infra 长尾)摘要 stdout/stderr 正文,`Command:`/`Exit:` 头部逐字保留,所有有损摘要都保留 raw 恢复路径;隔离测量显示正文 token 降幅约 66–99%。同时,inline `run_workflow` 新增确定性启动前质量 lint,在运行前硬失败弱模型的编写合约 bug(未 await 的 workflow-command 用作布尔、顶层访问本应位于 `result.structured` 的字段、字面 agent fanout 超 manifest/host 上限)。二者均为确定性(无 prompt 改动)。详见 [docs/features/v0.7.61.md](docs/features/v0.7.61.md) 与 [docs/ADR.md ADR-050](docs/ADR.md)。
518
+
517
519
  ```
518
520
  KodaX/ # 4 workspace packages(FEATURE_194 v0.7.43)
519
521
  ├── packages/
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{I as c,J as d,K as e,L as f,Z as g,_ as h,ia as i,oa as j}from"./chunk-ZPD7IUKW.js";import"./chunk-D6QVXQNI.js";import"./chunk-UA744TZM.js";import"./chunk-QFCF3GNT.js";import"./chunk-S4GVQO3W.js";import{mb as a,nb as b}from"./chunk-4K5BDO7S.js";import"./chunk-ZL5CEANW.js";import"./chunk-V4WSBIXB.js";export{d as bucketProviderPayloadSize,g as buildAutoRepoIntelligenceContext,e as checkPromiseSignal,b as cleanupIncompleteToolCalls,h as describeTransientProviderRetry,f as emitResilienceDebug,c as estimateProviderPayloadBytes,j as runKodaX,i as saveSessionSnapshot,a as validateAndFixToolHistory};
2
+ import{I as c,J as d,K as e,L as f,Z as g,_ as h,ia as i,qa as j}from"./chunk-WFE6FBQ2.js";import"./chunk-D6QVXQNI.js";import"./chunk-UA744TZM.js";import"./chunk-S4ISEA6F.js";import"./chunk-S4GVQO3W.js";import{ob as a,pb as b}from"./chunk-E2Q4RIOD.js";import"./chunk-ZL5CEANW.js";import"./chunk-V4WSBIXB.js";export{d as bucketProviderPayloadSize,g as buildAutoRepoIntelligenceContext,e as checkPromiseSignal,b as cleanupIncompleteToolCalls,h as describeTransientProviderRetry,f as emitResilienceDebug,c as estimateProviderPayloadBytes,j as runKodaX,i as saveSessionSnapshot,a as validateAndFixToolHistory};
@@ -0,0 +1,2 @@
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,5 +1,5 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{w as U,y as $}from"./chunk-ZPD7IUKW.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-4K5BDO7S.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.60";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
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
3
  // folder). config.json must be STRICT JSON: no comments, no trailing commas. Most
4
4
  // settings also have a KODAX_* env var that overrides the file. Delete anything you
5
5
  // don't use; everything here is optional.