@kodax-ai/kodax 0.7.78 → 0.7.80
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 +3556 -3197
- package/README.md +371 -277
- package/README_CN.md +295 -215
- package/config-templates/config.example.jsonc +24 -2
- package/config-templates/integrations/a2a.example.jsonc +23 -7
- package/dist/builtin/skill-creator/scripts/aggregate-benchmark.js +2 -1
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.js +4 -3
- package/dist/builtin/skill-creator/scripts/compare-runs.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/compare-runs.js +4 -3
- package/dist/builtin/skill-creator/scripts/generate-review.js +2 -1
- package/dist/builtin/skill-creator/scripts/grade-evals.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/grade-evals.js +4 -3
- package/dist/builtin/skill-creator/scripts/improve-description.js +2 -1
- package/dist/builtin/skill-creator/scripts/init-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/init-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/install-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/install-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/package-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/package-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/quick-validate.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/quick-validate.js +4 -3
- package/dist/builtin/skill-creator/scripts/run-eval.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/run-eval.js +4 -3
- package/dist/builtin/skill-creator/scripts/run-loop.js +2 -1
- package/dist/builtin/skill-creator/scripts/run-trigger-eval.js +2 -1
- package/dist/builtin/skill-creator/scripts/utils.d.ts +3 -0
- package/dist/builtin/skill-creator/scripts/utils.js +5 -1
- package/dist/chunks/agent-5PHGNFW3.js +2 -0
- package/dist/chunks/argument-completer-FXRZFMTC.js +2 -0
- package/dist/chunks/chunk-6UENDY33.js +89 -0
- package/dist/chunks/{chunk-6FOJVETH.js → chunk-BWX4YZX3.js} +7 -7
- package/dist/chunks/chunk-CDCCTM5I.js +278 -0
- package/dist/chunks/chunk-CEB5FDND.js +810 -0
- package/dist/chunks/{chunk-2CFHBKRE.js → chunk-E7C4DRD2.js} +2 -2
- package/dist/chunks/chunk-EVXIJPZ6.js +218 -0
- package/dist/chunks/chunk-FQ7NVMSU.js +319 -0
- package/dist/chunks/chunk-GC4JBMBS.js +385 -0
- package/dist/chunks/{chunk-Z3KFRTSB.js → chunk-HTVLCHWH.js} +1 -1
- package/dist/chunks/chunk-IHPH3444.js +655 -0
- package/dist/chunks/{chunk-YAZQTC2L.js → chunk-KHEFUT6O.js} +1 -1
- package/dist/chunks/{chunk-7OEBJGHK.js → chunk-PMKAG4SZ.js} +1 -1
- package/dist/chunks/chunk-RPF5RGWZ.js +479 -0
- package/dist/chunks/{chunk-UID7BLAB.js → chunk-RXXKDR6Y.js} +1 -1
- package/dist/chunks/chunk-T5U4OP2N.js +292 -0
- package/dist/chunks/chunk-TRNAWSXP.js +123 -0
- package/dist/chunks/chunk-UZSHBQER.js +30 -0
- package/dist/chunks/{chunk-TQDBTTIM.js → chunk-VECRQTSD.js} +44 -44
- package/dist/chunks/compaction-config-6J6XCBJS.js +2 -0
- package/dist/chunks/{construction-bootstrap-VQLQGWPY.js → construction-bootstrap-KPCAE3VN.js} +1 -1
- package/dist/chunks/dist-RWEVZOFK.js +2 -0
- package/dist/chunks/{dist-BFT5YIGU.js → dist-WWL2DNIJ.js} +1 -1
- package/dist/chunks/host-OGS2R5J4.js +2 -0
- package/dist/chunks/run-manager-2YMM3BOT.js +2 -0
- package/dist/chunks/{utils-SID4HW2Q.js → utils-2YHRUZYC.js} +1 -1
- package/dist/index.d.ts +21 -20
- package/dist/index.js +4 -4
- package/dist/kodax_bootstrap.js +2 -1
- package/dist/kodax_cli.js +1850 -1476
- package/dist/kodax_resume.js +570 -34
- package/dist/provider-capabilities.json +85 -50
- package/dist/runtime-worker.js +1737 -1369
- package/dist/sandbox-workspace-session.js +285 -19
- package/dist/sdk-a2a.d.ts +19 -13
- package/dist/sdk-a2a.js +8 -8
- package/dist/sdk-agent.d.ts +80 -150
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +186 -66
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.d.ts +3 -3
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-llm.d.ts +7 -7
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.d.ts +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +1 -1
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +31 -213
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +230 -31
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-sandbox.js +1 -1
- package/dist/sdk-session.d.ts +8 -8
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +283 -18
- package/dist/types-chunks/{base.d-4e74xDdy.d.ts → base.d-DxG0m09Z.d.ts} +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-uAe2Oqda.d.ts → bash-prefix-extractor.d-DStqKIlu.d.ts} +31 -8
- package/dist/types-chunks/{capability-learning.d-CVsdHw4j.d.ts → capability-learning.d-iPSiAmc_.d.ts} +1 -1
- package/dist/types-chunks/{capsule.d-BlSv9l3V.d.ts → capsule.d-BuFJaYxA.d.ts} +14 -21
- package/dist/types-chunks/{types.d-BA-Jwpfs.d.ts → controller.d-C2aHqzHj.d.ts} +344 -11
- package/dist/types-chunks/{guardrail.d-CXDYRgZ3.d.ts → guardrail.d-DM-OK0m3.d.ts} +187 -116
- package/dist/types-chunks/{history-retrieval.d-DtCy7x64.d.ts → history-retrieval.d-DImTKgO6.d.ts} +16 -3
- package/dist/types-chunks/{oauth-login.d-Bgb4rdLN.d.ts → oauth-login.d-6i-vidxv.d.ts} +6 -2
- package/dist/types-chunks/{public-api.d-B3AohsxN.d.ts → public-api.d-CewTvUKV.d.ts} +335 -38
- package/dist/types-chunks/{repl.d-Ie_ZXb_U.d.ts → repl.d-DvXQtgr7.d.ts} +5 -5
- package/dist/types-chunks/{resolver.d-iAQ9ocLB.d.ts → resolver.d-C9IW4fmU.d.ts} +5 -2
- package/dist/types-chunks/{run-manager.d-D1twIhF9.d.ts → run-manager.d-C6ahvZqK.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-DB9KksIx.d.ts → sdk-session-C59RUrri.d.ts} +3 -3
- package/dist/types-chunks/shell-command-sets.d-Dp4UvPLL.d.ts +297 -0
- package/dist/types-chunks/{side-query.d-DTuLPcC5.d.ts → side-query.d-CP1LiRiH.d.ts} +8 -2
- package/dist/types-chunks/{types-D3g6XUQr.d.ts → types-Bf3Y3mW-.d.ts} +1 -1
- package/dist/types-chunks/{types.d-BH0ZkTGf.d.ts → types.d-BzpPDBPV.d.ts} +2 -2
- package/dist/types-chunks/{types.d-DIpZJKUl.d.ts → types.d-CgrXrFrq.d.ts} +16 -2
- package/dist/types-chunks/{types.d-DVDTIfB_.d.ts → types.d-yuJzE82x.d.ts} +4 -4
- package/dist/types-chunks/{utils.d-CVp6bFl9.d.ts → utils.d-BpACJmzt.d.ts} +24 -6
- package/docs/SDK_EMBEDDER_GUIDE.md +1148 -598
- package/package.json +6 -3
- package/dist/chunks/agent-ASP4MS3X.js +0 -2
- package/dist/chunks/argument-completer-JYQ7FX3W.js +0 -2
- package/dist/chunks/chunk-35PPHOQ2.js +0 -292
- package/dist/chunks/chunk-43QNNDHR.js +0 -29
- package/dist/chunks/chunk-5GO6FH7L.js +0 -458
- package/dist/chunks/chunk-5NDCSFOP.js +0 -78
- package/dist/chunks/chunk-6XM4B6K2.js +0 -48
- package/dist/chunks/chunk-6YZUE6NC.js +0 -240
- package/dist/chunks/chunk-KQLQYHWU.js +0 -386
- package/dist/chunks/chunk-NXO6GWSY.js +0 -46
- package/dist/chunks/chunk-T2XZTLYE.js +0 -316
- package/dist/chunks/chunk-VAT2QYXM.js +0 -765
- package/dist/chunks/chunk-YVRYHC4C.js +0 -655
- package/dist/chunks/compaction-config-BQSSIWK5.js +0 -2
- package/dist/chunks/dist-PCFE24YP.js +0 -2
- package/dist/chunks/host-UTFXCYYM.js +0 -2
- package/dist/chunks/run-manager-PJU3WIFJ.js +0 -2
- package/dist/types-chunks/guardrail.d-BRE_ErEj.d.ts +0 -156
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{fa as ke,ha as Ce}from"./chunk-TQDBTTIM.js";import{Aa as Ee,Ba as R,C as B,Ea as Q,F as H,G as me,H as J,Pa as xe,Ua as be,oa as he,pa as ge,q as pe,qa as ve,ra as ye,sa as we,ta as Y}from"./chunk-5NDCSFOP.js";import{Da as Se}from"./chunk-VAT2QYXM.js";import{g as Pe}from"./chunk-6XM4B6K2.js";import{a as r}from"./chunk-ONUPGMER.js";import m from"fs";import h from"path";import{exec as vt,spawnSync as yt}from"child_process";import{promisify as wt}from"util";import{fileURLToPath as Et}from"url";var Z="en";function He(){return(process.env.LC_ALL||process.env.LC_MESSAGES||process.env.LANG||"").toLowerCase().startsWith("zh")?"zh":"en"}r(He,"detectSystemLocale");function _e(e){if(!e||e==="auto"){Z=He();return}Z=e.toLowerCase().replace(/[-_].*/,"")==="zh"?"zh":"en"}r(_e,"setLocale");var Me={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.runtime_session":"Press (y) allow once, (s) allow this Runtime scope for the session, (n) no","confirm.instruction.runtime_persistent":"Press (y) allow once, (s) allow this Runtime scope for the session, (a) always allow this Runtime scope, (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.approved_session":"Approved (this session)","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.runtime_session":"\u6309 (y) \u4EC5\u5141\u8BB8\u4E00\u6B21, (s) \u672C\u4F1A\u8BDD\u59CB\u7EC8\u5141\u8BB8\u8FD9\u9879\u7CBE\u786E\u64CD\u4F5C, (n) \u62D2\u7EDD","confirm.instruction.runtime_persistent":"\u6309 (y) \u4EC5\u5141\u8BB8\u4E00\u6B21, (s) \u672C\u4F1A\u8BDD\u59CB\u7EC8\u5141\u8BB8\u8FD9\u9879\u7CBE\u786E\u64CD\u4F5C, (a) \u59CB\u7EC8\u5141\u8BB8\u8FD9\u9879\u7CBE\u786E\u64CD\u4F5C, (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.approved_session":"\u5DF2\u6279\u51C6 (\u672C\u4F1A\u8BDD)","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 Bt(e,t){let o=Me[Z][e]??Me.en[e]??e;if(t)for(let[i,s]of Object.entries(t))o=o.replace(`{${i}}`,String(s));return o}r(Bt,"t");var Ae={core:`// Split configs: ~/.kodax/integrations/mcp.json, extensions.json, and a2a.json.
|
|
3
|
-
// KodaX core configuration template.
|
|
4
|
-
// Copy only the fields you need to ~/.kodax/config.json (strict JSON).
|
|
5
|
-
// MCP, A2A, and Extensions live in ~/.kodax/integrations/*.json; use
|
|
6
|
-
// \`kodax integrations migrate\` to preview legacy declarations.
|
|
7
|
-
{
|
|
8
|
-
// Active provider alias and optional model override. Run \`kodax setup\` or
|
|
9
|
-
// \`/model\` instead of editing these manually when possible.
|
|
10
|
-
// "provider": "deepseek",
|
|
11
|
-
// "model": "deepseek-v4-flash",
|
|
12
|
-
// Add or reorder model ids shown by \`/model\` for a provider.
|
|
13
|
-
// "providerModels": {
|
|
14
|
-
// "deepseek": ["deepseek-v4-flash", "deepseek-v4-pro"]
|
|
15
|
-
// },
|
|
16
|
-
|
|
17
|
-
// Interactive Runtime hosting: "embedded" (this process) or "daemon".
|
|
18
|
-
// "runtimeMode": "embedded",
|
|
19
|
-
|
|
20
|
-
// Native model reasoning. \`effort\` is the preferred explicit depth;
|
|
21
|
-
// \`reasoningCeiling\` is the session ceiling. \`reasoningMode\` and \`thinking\`
|
|
22
|
-
// remain accepted for backward compatibility.
|
|
23
|
-
// "effort": "high",
|
|
24
|
-
// "planModeEffort": "high",
|
|
25
|
-
// "reasoningCeiling": "auto",
|
|
26
|
-
// "reasoningMode": "auto",
|
|
27
|
-
// "thinking": true,
|
|
28
|
-
|
|
29
|
-
// Agent harness: "ama" enables adaptive multi-agent use; "sa" forces one
|
|
30
|
-
// agent. Permission mode is "plan", "accept-edits", or classifier-backed
|
|
31
|
-
// "auto".
|
|
32
|
-
// "agentMode": "ama",
|
|
33
|
-
// "permissionMode": "accept-edits",
|
|
34
|
-
// User-level Bash allow patterns. Project additions belong in
|
|
35
|
-
// <project>/.kodax/config.local.json. Broad Bash(*) is rejected.
|
|
36
|
-
// "alwaysAllowTools": ["Bash(npm test)", "Bash(git status:*)"],
|
|
37
|
-
// "autoMode": {
|
|
38
|
-
// "engine": "llm",
|
|
39
|
-
// "classifierModel": "provider:model",
|
|
40
|
-
// "timeoutMs": 20000,
|
|
41
|
-
// "speculativeWindowMs": 500
|
|
42
|
-
// },
|
|
43
|
-
|
|
44
|
-
// UI/manual locale.
|
|
45
|
-
// "locale": "zh",
|
|
46
|
-
|
|
47
|
-
// Custom providers store public connection metadata only. Put the actual
|
|
48
|
-
// credential in the named environment variable, never in this file. Use
|
|
49
|
-
// \`kodax setup --custom\` for the guided writer.
|
|
50
|
-
// "customProviders": [
|
|
51
|
-
// {
|
|
52
|
-
// "name": "my-relay",
|
|
53
|
-
// "protocol": "openai",
|
|
54
|
-
// "baseUrl": "https://api.example.com/v1",
|
|
55
|
-
// "apiKeyEnv": "MY_RELAY_API_KEY",
|
|
56
|
-
// "model": "provider/model",
|
|
57
|
-
// "models": ["provider/model", "provider/fast-model"],
|
|
58
|
-
// "reasoning": { "efforts": ["off", "low", "high"], "default": "high" },
|
|
59
|
-
// "userAgentMode": "compat",
|
|
60
|
-
// "contextWindow": 128000,
|
|
61
|
-
// "maxOutputTokens": 8192,
|
|
62
|
-
// "thinkingBudgetCap": 32000,
|
|
63
|
-
// "promptCacheAffinity": false,
|
|
64
|
-
// "replayReasoningContent": false,
|
|
65
|
-
// "strictThinkingSignature": false,
|
|
66
|
-
// "streamMaxDurationMs": 300000,
|
|
67
|
-
// "verifyStrategy": "models-list"
|
|
68
|
-
// }
|
|
69
|
-
// ],
|
|
70
|
-
|
|
71
|
-
// Repository intelligence. Mode: "auto", "full", "light", or "off".
|
|
72
|
-
// "repoIntelligenceMode": "auto",
|
|
73
|
-
// "repoIntelligenceTrace": false,
|
|
74
|
-
// "repoIntelligence": {
|
|
75
|
-
// "toolWaitMs": 250,
|
|
76
|
-
// "workerTimeoutMs": 30000,
|
|
77
|
-
// "workerOldSpaceMb": 1024,
|
|
78
|
-
// "storageDir": "~/.kodax/repo-intelligence"
|
|
79
|
-
// },
|
|
80
|
-
|
|
81
|
-
// Runtime/provider diagnostics and timeouts.
|
|
82
|
-
// "streamIdleTimeoutMs": 120000,
|
|
83
|
-
// "verifierLog": false,
|
|
84
|
-
// "stallLog": false,
|
|
85
|
-
|
|
86
|
-
// Ordered provider fallback for child tasks and optional model tiers used by
|
|
87
|
-
// workflow/dispatch model hints.
|
|
88
|
-
// "fallbackProviders": ["ark-coding", "kimi-code"],
|
|
89
|
-
// "fastProvider": "openai",
|
|
90
|
-
// "fastModel": "gpt-5-mini",
|
|
91
|
-
// "deepProvider": "anthropic",
|
|
92
|
-
// "deepModel": "claude-opus-4-6",
|
|
93
|
-
|
|
94
|
-
// Provider/LSP/ACP process settings.
|
|
95
|
-
// "maxOutputTokens": 8192,
|
|
96
|
-
// "disablePromptCache": false,
|
|
97
|
-
// "lsp": true,
|
|
98
|
-
// "lspAutoDownload": false,
|
|
99
|
-
// "acpLogLevel": "info",
|
|
100
|
-
|
|
101
|
-
// Automatic large compaction is always enabled. Percentage defaults to 75
|
|
102
|
-
// and is clamped to 15..90. A missing/zero absolute threshold is inactive;
|
|
103
|
-
// otherwise the smaller percentage, absolute, and physical limit wins.
|
|
104
|
-
// "compaction": {
|
|
105
|
-
// "enabled": true,
|
|
106
|
-
// "contextWindow": 128000,
|
|
107
|
-
// "triggerPercent": 75,
|
|
108
|
-
// "triggerTokens": 0
|
|
109
|
-
// },
|
|
110
|
-
|
|
111
|
-
// 0 disables automatic session pruning.
|
|
112
|
-
// "sessionRetentionDays": 0,
|
|
113
|
-
|
|
114
|
-
// Workflow host concurrency. The Runtime still applies its system cap.
|
|
115
|
-
// "workflow": { "maxConcurrency": 8 }
|
|
116
|
-
}
|
|
117
|
-
`,mcp:`// User MCP declarations: ~/.kodax/integrations/mcp.json (strict JSON).
|
|
118
|
-
// The whole file hot-reloads; healthy entries remain active if one new entry
|
|
119
|
-
// fails to prepare. Keep credentials in \${env:NAME} references.
|
|
120
|
-
{
|
|
121
|
-
"version": 1,
|
|
122
|
-
"servers": {}
|
|
123
|
-
// Example:
|
|
124
|
-
// "servers": {
|
|
125
|
-
// "reporting": {
|
|
126
|
-
// "type": "streamable-http",
|
|
127
|
-
// "url": "https://mcp.example.com",
|
|
128
|
-
// "headers": { "Authorization": "Bearer \${env:REPORTING_MCP_TOKEN}" },
|
|
129
|
-
// "connect": "lazy"
|
|
130
|
-
// }
|
|
131
|
-
// }
|
|
132
|
-
}
|
|
133
|
-
`,a2a:`// Bidirectional A2A configuration: ~/.kodax/integrations/a2a.json.
|
|
134
|
-
// \`agents\` calls many third-party Agents. The optional singleton \`server\`
|
|
135
|
-
// exposes exactly one KodaX general task Agent; ACP remains the coding/editor
|
|
136
|
-
// protocol. Uncomment only the entries you need; no token value belongs here.
|
|
137
|
-
// Legacy version 1 files remain readable. Non-empty files require an explicit
|
|
138
|
-
// stopped-daemon migration; new/empty files and every later write use version 2.
|
|
139
|
-
{
|
|
140
|
-
"version": 2,
|
|
141
|
-
|
|
142
|
-
// Create this inbound block with \`kodax a2a expose\`; config never starts a
|
|
143
|
-
// listener by itself. Do not copy private Agent instructions, Runtime Skills,
|
|
144
|
-
// model names, or local paths into the public \`published.skills\` list.
|
|
145
|
-
// Managed workspaces default below
|
|
146
|
-
// ~/kodax_a2a_server_workspace/<runtime-profile>/contexts/<context-key>/.
|
|
147
|
-
// Native read/grep/glob remains available according to workspace access.
|
|
148
|
-
// Arbitrary shell is never exposed. Skill instructions/assets need no
|
|
149
|
-
// process authority. An exact checked-in scripts/... entry requires
|
|
150
|
-
// process="isolated", skillScripts admission, and \`kodax sandbox doctor\`.
|
|
151
|
-
// ASRT receives no KodaX credentials or ambient ~/.srt-settings.json and its
|
|
152
|
-
// script quota is observed; hostile tenants also require an outer container/VM.
|
|
153
|
-
//
|
|
154
|
-
// "server": {
|
|
155
|
-
// "execution": {
|
|
156
|
-
// "kind": "local-agent",
|
|
157
|
-
// "agentRef": { "source": "markdown:user", "name": "report-agent" },
|
|
158
|
-
// "workspace": { "mode": "managed" },
|
|
159
|
-
// "toolPolicy": {
|
|
160
|
-
// "workspace": "write",
|
|
161
|
-
// "process": "deny",
|
|
162
|
-
// "network": { "mode": "deny" },
|
|
163
|
-
// "tools": [],
|
|
164
|
-
// "mcp": {},
|
|
165
|
-
// "skillScripts": {},
|
|
166
|
-
// "subagents": "deny"
|
|
167
|
-
// }
|
|
168
|
-
// },
|
|
169
|
-
// "published": {
|
|
170
|
-
// "name": "KodaX Agent",
|
|
171
|
-
// "description": "Completes approved general tasks.",
|
|
172
|
-
// "version": "0.7.71",
|
|
173
|
-
// "skills": [{ "id": "general", "name": "General", "description": "Complete general tasks.", "tags": [] }],
|
|
174
|
-
// "inputModes": ["text/plain"],
|
|
175
|
-
// "outputModes": ["text/plain"]
|
|
176
|
-
// },
|
|
177
|
-
// "authentication": { "type": "bearer-env", "tokenEnv": "KODAX_A2A_TOKEN", "principalId": "configured-client" },
|
|
178
|
-
// "dataDir": "~/.kodax/a2a/tasks"
|
|
179
|
-
// },
|
|
180
|
-
|
|
181
|
-
// Production OAuth2 resource-server alternative for the server above. The
|
|
182
|
-
// external Authorization Server issues access tokens and, for JWT tokens,
|
|
183
|
-
// signs them. KodaX holds no issuer signing key; it validates RFC 9068 tokens
|
|
184
|
-
// against the issuer's rotating JWKS, audience, expiry, subject, and scopes.
|
|
185
|
-
// Replace the server.authentication value above with:
|
|
186
|
-
// {
|
|
187
|
-
// "type": "oauth2-jwt",
|
|
188
|
-
// "scheme": "enterprise-oauth",
|
|
189
|
-
// "issuer": "https://identity.example.com",
|
|
190
|
-
// "audience": "https://agent.example.com/a2a",
|
|
191
|
-
// "jwksUrl": "https://identity.example.com/.well-known/jwks.json",
|
|
192
|
-
// "tokenUrl": "https://identity.example.com/oauth/token",
|
|
193
|
-
// "metadataUrl": "https://identity.example.com/.well-known/oauth-authorization-server",
|
|
194
|
-
// "requiredScopes": ["a2a.invoke"]
|
|
195
|
-
// }
|
|
196
|
-
|
|
197
|
-
"agents": {
|
|
198
|
-
// Fixed Bearer compatibility example. \`enabled\` is hot desired state:
|
|
199
|
-
// disabled Agents remain configured but are not candidates for new
|
|
200
|
-
// orchestration, while already admitted remote tasks may finish.
|
|
201
|
-
// "reporting": {
|
|
202
|
-
// "cardUrl": "https://agents.example.com/.well-known/agent-card.json",
|
|
203
|
-
// "enabled": true,
|
|
204
|
-
// "credentialEnv": "REPORTING_A2A_TOKEN",
|
|
205
|
-
// "effect": "read"
|
|
206
|
-
// },
|
|
207
|
-
|
|
208
|
-
// Standards-based machine-to-machine OAuth2 example. The external
|
|
209
|
-
// Authorization Server issues access tokens; KodaX obtains and caches them
|
|
210
|
-
// only in process memory. \`tokenUrl\` must exactly match the selected Card
|
|
211
|
-
// OAuth2 clientCredentials flow. Use \`kodax a2a enable|disable <name>\` to
|
|
212
|
-
// mutate \`enabled\` atomically; the owning Runtime applies it asynchronously.
|
|
213
|
-
// "reviewer": {
|
|
214
|
-
// "cardUrl": "https://reviewer.example.com/.well-known/agent-card.json",
|
|
215
|
-
// "enabled": false,
|
|
216
|
-
// "effect": "read",
|
|
217
|
-
// "authentication": {
|
|
218
|
-
// "type": "oauth2-client-credentials",
|
|
219
|
-
// "scheme": "enterprise-oauth",
|
|
220
|
-
// "issuer": "https://identity.example.com",
|
|
221
|
-
// "tokenUrl": "https://identity.example.com/oauth/token",
|
|
222
|
-
// "clientId": "kodax-reviewer",
|
|
223
|
-
// "clientSecretEnv": "REVIEWER_CLIENT_SECRET",
|
|
224
|
-
// "scopes": ["a2a.invoke"],
|
|
225
|
-
// "resource": "https://reviewer.example.com/",
|
|
226
|
-
// "clientAuthentication": "client-secret-basic"
|
|
227
|
-
// }
|
|
228
|
-
// }
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
`,extensions:`// Trusted user Extension paths: ~/.kodax/integrations/extensions.json.
|
|
232
|
-
// Extensions are host code. Reload is whole-domain atomic; use MCP for
|
|
233
|
-
// capabilities that should remain outside the KodaX process.
|
|
234
|
-
{
|
|
235
|
-
"version": 1,
|
|
236
|
-
"paths": []
|
|
237
|
-
}
|
|
238
|
-
`};function Oe(e){return Ae[e]}r(Oe,"getConfigTemplate");import{closeSync as ne,existsSync as u,fsyncSync as Te,linkSync as ot,mkdirSync as re,openSync as ie,readFileSync as Ne,renameSync as $e,statSync as rt,unlinkSync as j,watch as it,writeFileSync as je}from"node:fs";import{createHash as st}from"node:crypto";import f from"node:path";import{closeSync as Je,mkdirSync as Ye,openSync as Qe,rmSync as Ze}from"node:fs";import et from"node:path";var ee=class extends Error{static{r(this,"CoreConfigWriteConflictError")}constructor(t){super(`Core configuration is being changed by another KodaX writer: ${t}`),this.name="CoreConfigWriteConflictError"}};function tt(e){return`${e}.write.lock`}r(tt,"coreConfigWriteLockPath");function nt(e){if(!(!(e instanceof Error)||!("code"in e)))return typeof e.code=="string"?e.code:void 0}r(nt,"errorCode");function E(e,t){Ye(et.dirname(e),{recursive:!0,mode:448});let n=tt(e),o;try{o=Qe(n,"wx",384)}catch(i){throw nt(i)==="EEXIST"?new ee(e):new Error(`Failed to acquire the core configuration write lock: ${e}`,{cause:i})}try{return t()}finally{Je(o),Ze(n,{force:!0})}}r(E,"withCoreConfigWriteLock");var S=class extends Error{static{r(this,"IntegrationConfigConflictError")}constructor(t,n,o){super(`Integration configuration revision changed for ${f.basename(t)} (expected ${n??"missing"}, actual ${o??"missing"}).`),this.name="IntegrationConfigConflictError"}},at={mcp:"mcp.json",a2a:"a2a.json",extensions:"extensions.json"},ct=new Set(["type","command","args","cwd","env","url","headers","connect","startupTimeoutMs","requestTimeoutMs","auth"]);function P(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}r(P,"isRecord");function x(e,t){if(!P(e))throw new Error(`${t} must be an object.`);return e}r(x,"requireRecord");function K(e,t,n){let o=Object.keys(e).find(i=>!t.has(i));if(o!==void 0)throw new Error(`${n} has unknown field "${o}".`)}r(K,"assertNoUnknownKeys");function Ke(e,t){if(e.version!==1)throw new Error(`${t} version must be 1.`)}r(Ke,"requireVersionOne");function Ie(e,t){let n=x(e,t);for(let[o,i]of Object.entries(n))if(o.trim().length===0||typeof i!="string")throw new Error(`${t} must contain non-empty string keys and string values.`);return structuredClone(n)}r(Ie,"requireStringMap");function oe(e,t){if(!Array.isArray(e)||!e.every(n=>typeof n=="string"&&n.trim().length>0))throw new Error(`${t} must be an array of non-empty strings.`);return e.map(n=>n.trim())}r(oe,"requireStringArray");function te(e,t){if(e!==void 0&&(!Number.isFinite(e)||Number(e)<=0))throw new Error(`${t} must be a positive number.`)}r(te,"validatePositiveNumber");function lt(e,t){if(e.trim().length===0)throw new Error("MCP server names must not be empty.");let n=x(t,`MCP server "${e}"`);K(n,ct,`MCP server "${e}"`);let o=n.type??"stdio";if(!["stdio","sse","streamable-http","http"].includes(String(o)))throw new Error(`MCP server "${e}" has an unsupported transport type.`);if(o==="stdio"){if(typeof n.command!="string"||n.command.trim().length===0)throw new Error(`MCP server "${e}" stdio transport requires command.`)}else if(typeof n.url!="string"||n.url.trim().length===0)throw new Error(`MCP server "${e}" ${String(o)} transport requires url.`);if(n.args!==void 0&&oe(n.args,`MCP server "${e}" args`),n.cwd!==void 0&&typeof n.cwd!="string")throw new Error(`MCP server "${e}" cwd must be a string.`);if(n.env!==void 0&&Ie(n.env,`MCP server "${e}" env`),n.headers!==void 0&&Ie(n.headers,`MCP server "${e}" headers`),n.connect!==void 0&&!["lazy","prewarm","disabled"].includes(String(n.connect)))throw new Error(`MCP server "${e}" has an unsupported connect mode.`);if(te(n.startupTimeoutMs,`MCP server "${e}" startupTimeoutMs`),te(n.requestTimeoutMs,`MCP server "${e}" requestTimeoutMs`),n.auth!==void 0){let i=x(n.auth,`MCP server "${e}" auth`);if(K(i,new Set(["type","clientId","authorizationUrl","tokenUrl","scopes","redirectPort"]),`MCP server "${e}" auth`),i.type!=="oauth2")throw new Error(`MCP server "${e}" auth type must be oauth2.`);for(let a of["clientId","authorizationUrl","tokenUrl"])if(i[a]!==void 0&&typeof i[a]!="string")throw new Error(`MCP server "${e}" auth.${a} must be a string.`);i.scopes!==void 0&&oe(i.scopes,`MCP server "${e}" auth.scopes`),te(i.redirectPort,`MCP server "${e}" auth.redirectPort`)}return structuredClone(n)}r(lt,"parseMcpServer");function k(e){let t=x(e,"MCP integration config");K(t,new Set(["version","servers"]),"MCP integration config"),Ke(t,"MCP integration config");let n=x(t.servers,"MCP integration config servers"),o={};for(let[i,s]of Object.entries(n))o[i]=lt(i,s);return{version:1,servers:o}}r(k,"parseMcpIntegrationDocument");function C(e){let t=x(e,"Extensions integration config");K(t,new Set(["version","paths"]),"Extensions integration config"),Ke(t,"Extensions integration config");let n=oe(t.paths,"Extensions integration config paths");if(new Set(n).size!==n.length)throw new Error("Extensions integration config paths must not contain duplicates.");return{version:1,paths:n}}r(C,"parseExtensionsIntegrationDocument");function M(e,t){return f.join(f.resolve(t),"integrations",at[e])}r(M,"resolveIntegrationConfigPath");function A(e){return f.join(f.resolve(e),"config.json")}r(A,"coreConfigPath");function Xe(e){return st("sha256").update(e).digest("hex")}r(Xe,"hashText");function se(e){let t=Ne(e,"utf8");try{return{raw:t,value:JSON.parse(t)}}catch(n){let o=n instanceof Error?n.message:String(n);throw new Error(`Invalid JSON: ${o}`)}}r(se,"readJsonFile");function _(e){return{domain:e.domain,source:e.source,path:e.path,revision:Xe(e.raw),document:structuredClone(e.document),loadedAt:new Date().toISOString()}}r(_,"snapshot");function X(e){let t=A(e);return u(t)?x(se(t).value,"Core config"):{}}r(X,"readCoreConfig");function F(e){let t=M("mcp",e);if(u(t)){let s=se(t);return _({domain:"mcp",source:"user",path:t,raw:s.raw,document:k(s.value)})}let n=A(e),o=X(e).mcpServers,i=k({version:1,servers:o===void 0?{}:o});return _({domain:"mcp",source:o===void 0?"default":"legacy-user",path:o===void 0?t:n,raw:JSON.stringify(i),document:i})}r(F,"readMcpIntegration");function U(e){let t=M("extensions",e);if(u(t)){let s=se(t);return _({domain:"extensions",source:"user",path:t,raw:s.raw,document:C(s.value)})}let n=A(e),o=X(e).extensions,i=C({version:1,paths:o===void 0?[]:o});return _({domain:"extensions",source:o===void 0?"default":"legacy-user",path:o===void 0?t:n,raw:JSON.stringify(i),document:i})}r(U,"readExtensionsIntegration");function ut(e){if(!P(e))return[];let t=[],n=/(token|secret|password|api[_-]?key|authorization)/i;for(let[o,i]of Object.entries(e))if(P(i))for(let s of["env","headers"]){let a=i[s];if(P(a))for(let[c,l]of Object.entries(a))n.test(c)&&typeof l=="string"&&!l.startsWith("${env:")&&t.push(`MCP server "${o}" ${s}.${c} may contain a literal secret.`)}return t}r(ut,"likelySecretWarnings");function dt(e){let t=X(e),n=M("mcp",e),o=M("extensions",e),i=t.mcpServers,s=t.extensions,a=P(i)?Object.keys(i).length:0,c=Array.isArray(s)?s.length:0,l=r((g,T,N)=>u(g)?{action:"none",entries:T,destination:g,reason:"destination-exists"}:N?{action:"create",entries:T,destination:g}:{action:"none",entries:0,destination:g,reason:"legacy-absent"},"domainPlan");return{mcp:l(n,a,i!==void 0),extensions:l(o,c,s!==void 0),warnings:ut(i)}}r(dt,"planLegacyIntegrationMigration");function ft(e,t){let n=A(e);re(f.dirname(n),{recursive:!0,mode:448});let o=`${n}.${process.pid}.${Date.now()}.tmp`,i=ie(o,"wx",384);try{je(i,`${JSON.stringify(t,null,2)}
|
|
239
|
-
`,"utf8"),Te(i)}finally{ne(i)}try{$e(o,n)}catch(s){throw u(o)&&j(o),new Error("Failed to atomically clean legacy integration fields.",{cause:s})}}r(ft,"writeCoreConfigAtomically");function cn(e){return E(A(e.configHome),()=>pt(e))}r(cn,"migrateLegacyIntegrationConfig");function pt(e){let t=dt(e.configHome),n=X(e.configHome),o=t.mcp.action==="create"?k({version:1,servers:P(n.mcpServers)?n.mcpServers:{}}):void 0,i=t.extensions.action==="create"?C({version:1,paths:Array.isArray(n.extensions)?n.extensions:[]}):void 0,s=[];if(o)try{D({domain:"mcp",configHome:e.configHome,expectedRevision:null,document:o,validate:k}),s.push("mcp")}catch(c){if(!(c instanceof S))throw c}if(i)try{D({domain:"extensions",configHome:e.configHome,expectedRevision:null,document:i,validate:C}),s.push("extensions")}catch(c){if(!(c instanceof S))throw c}let a=!1;if(e.cleanupLegacy&&u(A(e.configHome))){let c={...n};u(t.mcp.destination)&&delete c.mcpServers,u(t.extensions.destination)&&delete c.extensions,mt(n,c)||(ft(e.configHome,c),a=!0)}return{...t,applied:s,cleanedLegacy:a}}r(pt,"migrateLegacyIntegrationConfigUnlocked");function mt(e,t){return JSON.stringify(e)===JSON.stringify(t)}r(mt,"isDeepStrictEqualForConfig");function Re(e){return u(e)?Xe(Ne(e,"utf8")):void 0}r(Re,"currentUserRevision");function ht(e){let t=`${e}.lock`;try{return{fd:ie(t,"wx",384),path:t}}catch(n){throw new Error(`Integration configuration is busy: ${f.basename(e)}`,{cause:n})}}r(ht,"acquireWriteLock");function D(e){let t=M(e.domain,e.configHome),n=e.validate(e.document);re(f.dirname(t),{recursive:!0,mode:448});let o=ht(t);try{let i=Re(t),s=e.expectedRevision===null?void 0:e.expectedRevision;if(e.expectedRevision!==void 0&&i!==s)throw new S(t,s,i);let a=`${JSON.stringify(n,null,2)}
|
|
240
|
-
`,c=`${t}.${process.pid}.${Date.now()}.tmp`,l=ie(c,"wx",384);try{je(l,a,"utf8"),Te(l)}finally{ne(l)}try{e.expectedRevision===null?(ot(c,t),j(c)):$e(c,t)}catch(g){throw u(c)&&j(c),e.expectedRevision===null&&u(t)?new S(t,void 0,Re(t)):new Error(`Failed to atomically replace ${f.basename(t)}.`,{cause:g})}return _({domain:e.domain,source:"user",path:t,raw:a,document:n})}finally{ne(o.fd),u(o.path)&&j(o.path)}}r(D,"writeIntegrationDocument");function gt(e){if(!u(e))return"missing";let t=rt(e);return`${t.dev}:${t.ino}:${t.size}:${t.mtimeMs}`}r(gt,"metadataSignature");function De(e){return e.map(t=>`${t}:${gt(t)}`).join("|")}r(De,"observationSignature");function $(e,t){return{code:e,message:t,time:new Date().toISOString()}}r($,"safeDiagnostic");var Le=class{static{r(this,"IntegrationConfigController")}#d;#n;#r;#a;#m;#f;#p;#e;#t;#c;#l;#h="";#s=[];#o;#i;#g=Promise.resolve();#u=new Set;constructor(t){this.#d=t.domain,this.#n=M(t.domain,t.configHome),this.#r=t.fallbackPath===void 0?void 0:f.resolve(t.fallbackPath),this.#a=this.#r===void 0?[this.#n]:[this.#n,this.#r],this.#f=t.validate,this.#m=t.read,this.#p=t.coldStartDefault===void 0?void 0:structuredClone(this.#f(t.coldStartDefault))}async initialize(){let t=await this.reload();if(!t.ok&&!this.#e&&this.#p!==void 0){let n=structuredClone(this.#p);this.#e=_({domain:this.#d,source:"default",path:this.#n,raw:JSON.stringify(n),document:n})}if(!this.#e)throw new Error(t.ok?"Integration configuration did not produce a snapshot.":t.error);return structuredClone(this.#e)}snapshot(){return this.#e?structuredClone(this.#e):void 0}status(){let t=this.#t?this.#c:void 0,n=this.#t?this.#l:void 0;return{domain:this.#d,path:t??this.#e?.path??this.#n,...this.#e?{revision:this.#e.revision,lastReloadAt:this.#e.loadedAt}:{},...n??this.#e?.source?{source:n??this.#e?.source}:{},...this.#t?{diagnostic:this.#t}:{},watching:this.#s.length>0}}subscribe(t){return this.#u.add(t),()=>{this.#u.delete(t)}}reload(){let t=this.#g.then(()=>this.#v());return this.#g=t.then(()=>{},()=>{}),t}async#v(){this.#h=De(this.#a);let t;try{t=this.#m(),this.#f(t.document)}catch{let o=this.#y();return this.#c=o.path,this.#l=o.source,this.#t=$("invalid-config","Integration configuration is invalid; check the file against its versioned schema."),{ok:!1,error:this.#t.message}}let n=this.#e?structuredClone(this.#e):void 0;try{for(let o of this.#u)await o(structuredClone(t),n)}catch{return this.#c=t.path,this.#l=t.source,this.#t=$("activation-failed","Integration configuration could not be activated; the previous configuration remains active."),{ok:!1,error:this.#t.message}}return this.#e=t,this.#t=void 0,this.#c=void 0,this.#l=void 0,{ok:!0,snapshot:structuredClone(t)}}async ensureCurrent(){return De(this.#a)===this.#h&&this.#e?{ok:!0,snapshot:structuredClone(this.#e)}:this.reload()}startWatching(t=100,n=2e3){if(this.#s.length>0||this.#i)return;re(f.dirname(this.#n),{recursive:!0,mode:448});let o=new Map;for(let i of this.#a){let s=f.dirname(i),a=o.get(s)??new Set;a.add(f.basename(i)),o.set(s,a)}for(let[i,s]of o)try{let a=it(i,(c,l)=>{l!==null&&!s.has(l.toString())||(this.#o&&clearTimeout(this.#o),this.#o=setTimeout(()=>{this.#o=void 0,this.reload()},t),this.#o.unref?.())});a.unref(),a.on("error",()=>{this.#t=$("watcher-degraded","Integration watcher is degraded; metadata polling remains active.")}),this.#s.push(a)}catch{this.#t=$("watcher-degraded","Integration watcher is degraded; metadata polling remains active.")}this.#i=setInterval(()=>{this.ensureCurrent()},n),this.#i.unref?.()}close(){this.#o&&clearTimeout(this.#o),this.#o=void 0,this.#i&&clearInterval(this.#i),this.#i=void 0;for(let t of this.#s)t.close();this.#s.length=0,this.#u.clear()}#y(){return u(this.#n)?{path:this.#n,source:"user"}:this.#r&&u(this.#r)?{path:this.#r,source:"legacy-user"}:{path:this.#n,source:"default"}}};var xt=wt(vt),Fe=2,Ue=!1,d=Pe(),Pn=h.join(d,"sessions"),p=h.join(d,"config.json"),Sn=60,v=null,ce=!1,bt="dumb";function Pt(e){let t=h.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(Pt,"buildShellEnvCommand");function St(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 c=a.indexOf("=");c<=0||(s[a.slice(0,c)]=a.slice(c+1))}return s}r(St,"parseNullDelimitedShellEnv");function kt(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||!h.isAbsolute(o))return!1;let{args:i,sentinel:s}=Pt(o),a=e.run??yt,c={...t,TERM:bt},l=a(o,i,{encoding:"utf8",env:c,maxBuffer:1024*1024,timeout:5e3,windowsHide:!0,detached:!0,stdio:["ignore","pipe","pipe"]});if(l.status!==0||!l.stdout)return!1;let g=typeof l.stdout=="string"?l.stdout:l.stdout.toString("utf8"),T=St(g,s),N=!1;for(let[q,Be]of Object.entries(T))q!=="TERM"&&t[q]===void 0&&(t[q]=Be,N=!0);return N}r(kt,"hydrateProcessEnvFromShell");function Ct(){if(!ce){ce=!0;try{kt()}catch{}}}r(Ct,"ensureShellEnvironmentHydrated");function kn(){ce=!1}r(kn,"resetShellEnvironmentHydrationForTesting");function Mt(e){Ee(e.customProviders??[])}r(Mt,"registerConfiguredCustomProviders");function le(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(le,"normalizeConfiguredExtensions");function de(){let e=m.readFileSync(p,"utf8"),t=JSON.parse(e);if(!(t===null||typeof t!="object"||Array.isArray(t)))return{raw:e,value:t}}r(de,"readPersistedCoreConfig");function Ve(e){m.writeFileSync(p,JSON.stringify(e,null,2))}r(Ve,"writePersistedCoreConfig");function _t(e){if(e.permissionMode!=="default")return e;let t={...e,permissionMode:"accept-edits"};try{E(p,()=>{let n=de();n?.value.permissionMode==="default"&&Ve({...n.value,permissionMode:"accept-edits"})})}catch{}return t}r(_t,"migrateLegacyPermissionModeInConfig");function At(e){if(e.permissionMode!=="auto-in-project")return e;try{E(p,()=>{let t=de();if(t?.value.permissionMode!=="auto-in-project")return;let n=t.raw.replace(/("permissionMode"\s*:\s*)"auto-in-project"/,'$1"auto"');n!==t.raw&&m.writeFileSync(p,n)})}catch{}return{...e,permissionMode:"auto"}}r(At,"migrateAutoInProjectAliasInConfig");function Ot(){if(v)return v;let e="0.7.78";if(e)return v=e,v;let t=h.join(h.dirname(Et(import.meta.url)),"../../package.json");if(m.existsSync(t))try{return v=JSON.parse(m.readFileSync(t,"utf-8")).version??"0.0.0",v??"0.0.0"}catch{}return v="0.0.0",v}r(Ot,"getVersion");var Cn=Ot();function It(e){return ge(e)}r(It,"getProviderModel");function ue(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(ue,"mergeModels");function Rt(e,t){t||(t=fe().providerModels);let n=t?.[e];if(n&&n.length>0){try{let o=Y(e);if(o.length>0)return ue(n,o)}catch{}try{let o=R(e);if(o)return ue(n,o.getAvailableModels())}catch{}return n}try{let o=Y(e);if(o.length>0)return o}catch{}try{let o=R(e);if(o)return o.getAvailableModels()}catch{}return[]}r(Rt,"getProviderAvailableModels");function Dt(e,t){let n=ve(e,t);if(n!=="unknown")return n;try{let o=R(e);if(o)return o.getReasoningCapability(t)}catch{}return"unknown"}r(Dt,"getProviderReasoningCapability");function Lt(e){let t=ye(e);if(t)return t;try{return Q().find(o=>o.name===e)?.capabilityProfile??null}catch{return null}}r(Lt,"getProviderCapabilityProfile");function ze(e,t){let n=Lt(e),o=Dt(e,t);if(n)return{capabilityProfile:n,reasoningCapability:o};try{let i=xe(e);return{capabilityProfile:i.getCapabilityProfile(),reasoningCapability:i.getReasoningCapability(t)}}catch{return null}}r(ze,"getProviderCapabilityMetadata");function Mn(e,t){let n=ze(e,t);return n?ke({providerName:e,model:t,capabilityProfile:n.capabilityProfile,reasoningCapability:n.reasoningCapability==="unknown"?void 0:n.reasoningCapability}):null}r(Mn,"getProviderCapabilitySnapshot");function Tt(e,t,n,o){let i=ze(e,t);return i?Ce({providerName:e,model:t,capabilityProfile:i.capabilityProfile,reasoningCapability:i.reasoningCapability==="unknown"?void 0:i.reasoningCapability,reasoningMode:n,hints:o}):null}r(Tt,"getProviderPolicyDecision");function _n(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(_n,"describeProviderCapabilitySummary");function An(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(An,"formatReasoningCapabilityShort");function I(e){if(e)return e==="none"?"off":e}r(I,"formatReasoningEffortForDisplay");function G(e,t){let n=I(t);n&&!e.includes(n)&&e.push(n)}r(G,"pushUniqueEffortDisplay");function On(e,t){let n=["auto"],i=z(e,t)?.supportedEfforts?.filter(s=>s.isUserVisible!==!1);if(!i||i.length===0){for(let s of["off","low","medium","high"])G(n,s);return n}for(let s of i)G(n,s.value);return n}r(On,"getProviderReasoningEffortOptions");function In(e,t){let n=z(e,t),o=new Set(n?.disabledEfforts??[]),i=n?.supportedEfforts?.filter(l=>l.isUserVisible!==!1),s=[],a=n?.supportsDisabledThinking===!0;if(!i||i.length===0){for(let l of["low","medium","high"])G(s,l);a=!0}else for(let l of i){if(l.value==="none"){a=!0;continue}if(o.has(l.value)){a=!0;continue}G(s,l.value)}let c=[];return a&&c.push("off"),c.push(...s),c.push("auto"),c}r(In,"getProviderReasoningEffortCycle");function Nt(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(Nt,"legacyReasoningModeToEffortDisplay");function z(e,t){let n=t??It(e);if(!n)return;let o=be(e,n)?.reasoningProfile;if(o)return pe(o,Se(e,n))}r(z,"resolveReasoningProfileForDisplay");function Rn(e){let t=I(e.effort)??Nt(e.reasoningMode,e.thinking),n=z(e.provider,e.model);if(!n)return t;try{let o=me({capability:n,explicitEffort:e.effortOverride?e.effort:void 0,sessionEffort:e.effortOverride?void 0:e.effort,legacyReasoningMode:e.reasoningMode,thinking:e.thinking}),i=I(o.configuredEffort)??t,a=o.configuredEffort!==void 0&&n.disabledEfforts?.includes(o.configuredEffort)===!0?"off":I(o.effectiveEffort);return a&&a!==i?`${i}->${a}`:i}catch{if(e.effort)try{let o=J({currentEffort:e.effort,capability:n}),i=I(e.effort)??t,s=I(o.effectiveEffort);return s&&s!==i?`${i}->${s}`:i}catch{return t}return t}}r(Rn,"formatReasoningEffortStatusLabel");function Dn(e){let t=zt(e);if(!t)return{preserved:!0};let n=z(e.provider,e.model);if(!n)return{configuredEffort:t,runtimeEffort:t,preserved:!0};let o=J({currentEffort:t,capability:n});return{configuredEffort:t,runtimeEffort:o.effectiveEffort,preserved:o.preserved,diagnostic:o.diagnostic}}r(Dn,"resolveProviderReasoningRuntimeEffort");function $t(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($t,"describeReasoningCapabilityControl");function Ln(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(Ln,"describeReasoningExecution");function Tn(e){let t=[];e||(e=fe().providerModels);for(let n of we())t.push({name:n.name,model:n.model,models:Rt(n.name,e),configured:n.capabilityProfile.transport==="cli-bridge"?!0:n.configured,reasoningCapability:n.reasoningCapability,capabilityProfile:n.capabilityProfile});try{let n=Q().map(o=>({...o,models:(()=>{let i=e?.[o.name];return i&&i.length>0?ue(i,o.models):o.models})()}));t.push(...n)}catch{}return t}r(Tn,"getProviderList");function Nn(e){if(he(e))return!0;try{return R(e)?.isConfigured()??!1}catch{return!1}}r(Nn,"isProviderConfigured");var V=class extends Error{static{r(this,"InvalidAgentModeConfigError")}};function jt(e){let t=e.agentMode;if(t===void 0||t==="ama"||t==="sa")return e;if(t!=="amaw"&&t!=="ama-workflow")throw new V(`Invalid agentMode "${t}" in ${p}. Expected "ama" or "sa".`);let n={...e,agentMode:"ama",schemaVersion:Math.max(e.schemaVersion??0,Fe)};try{E(p,()=>{let o=de();if(!o)return;let i=o.value.agentMode;i!=="amaw"&&i!=="ama-workflow"||Ve({...o.value,agentMode:"ama",schemaVersion:Math.max(typeof o.value.schemaVersion=="number"?o.value.schemaVersion:0,Fe)})})}catch{}return Ue||(process.emitWarning(`Migrated persisted agentMode "${t}" to "ama". Workflow use is now explicit intent.`,{code:"KODAX_AGENT_MODE_MIGRATED"}),Ue=!0),n}r(jt,"migrateLegacyAgentModeConfig");function fe(){try{if(m.existsSync(p)){let n=JSON.parse(m.readFileSync(p,"utf-8")),o=jt(n),i=o.reasoningCeiling??o.reasoningMode,s=[],a={};try{s=[...U(d).document.paths]}catch{}try{a=F(d).document.servers}catch{}return At(_t({...o,reasoningMode:i,extensions:le(s),mcpServers:a}))}}catch(n){if(n instanceof V)throw n}let e,t;try{let n=U(d);n.source!=="default"&&(e=le([...n.document.paths]))}catch{}try{let n=F(d);n.source!=="default"&&(t=n.document.servers)}catch{}return{...e===void 0?{}:{extensions:e},...t===void 0?{}:{mcpServers:t}}}r(fe,"loadConfig");var Kt=h.join(d,"config.example.jsonc"),ae={mcp:h.join(d,"integrations","mcp.example.jsonc"),a2a:h.join(d,"integrations","a2a.example.jsonc"),extensions:h.join(d,"integrations","extensions.example.jsonc")},Xt=[{name:"core",path:Kt},{name:"mcp",path:ae.mcp},{name:"a2a",path:ae.a2a},{name:"extensions",path:ae.extensions}];function Ft(){let e=[];for(let t of Xt)try{if(m.existsSync(t.path))continue;m.mkdirSync(h.dirname(t.path),{recursive:!0}),m.writeFileSync(t.path,Oe(t.name),"utf8"),e.push(t.path)}catch{}return e}r(Ft,"ensureExampleConfigFiles");function $n(){return Ft()[0]}r($n,"ensureExampleConfigFile");var W=new Map;function Ut(e,t){let n=process.env[e],o=W.get(e),i=o!==void 0&&n===o;if(n!==void 0&&!i){W.delete(e);return}if(t===void 0){i&&delete process.env[e],W.delete(e);return}process.env[e]=t,W.set(e,t)}r(Ut,"projectConfigEnvironment");var qe=[{configPath:"streamIdleTimeoutMs",env:"KODAX_STREAM_IDLE_TIMEOUT_MS",value:r(e=>b(e.streamIdleTimeoutMs),"value")},{configPath:"repoIntelligenceMode",env:"KODAX_REPO_INTELLIGENCE",value:r(e=>e.repoIntelligenceMode,"value")},{configPath:"repoIntelligenceTrace",env:"KODAX_REPO_INTELLIGENCE_TRACE",value:r(e=>O(e.repoIntelligenceTrace),"value")},{configPath:"verifierLog",env:"KODAX_VERIFIER_LOG",value:r(e=>O(e.verifierLog),"value")},{configPath:"stallLog",env:"KODAX_STALL_LOG",value:r(e=>O(e.stallLog),"value")},{configPath:"fallbackProviders",env:"KODAX_FALLBACK_PROVIDERS",value:r(e=>Gt(e.fallbackProviders),"value")},{configPath:"fastProvider",env:"KODAX_FAST_PROVIDER",value:r(e=>y(e.fastProvider),"value")},{configPath:"fastModel",env:"KODAX_FAST_MODEL",value:r(e=>y(e.fastModel),"value")},{configPath:"deepProvider",env:"KODAX_DEEP_PROVIDER",value:r(e=>y(e.deepProvider),"value")},{configPath:"deepModel",env:"KODAX_DEEP_MODEL",value:r(e=>y(e.deepModel),"value")},{configPath:"provider",env:"KODAX_PROVIDER",value:r(e=>y(e.provider),"value")},{configPath:"effort",env:"KODAX_EFFORT",value:r(e=>y(e.effort),"value")},{configPath:"runtimeMode",env:"KODAX_RUNTIME_MODE",value:r(e=>e.runtimeMode,"value")},{configPath:"sessionRetentionDays",env:"KODAX_SESSION_RETENTION_DAYS",value:r(e=>b(e.sessionRetentionDays),"value")},{configPath:"maxOutputTokens",env:"KODAX_MAX_OUTPUT_TOKENS",value:r(e=>b(e.maxOutputTokens),"value")},{configPath:"disablePromptCache",env:"KODAX_DISABLE_PROMPT_CACHE",value:r(e=>O(e.disablePromptCache),"value")},{configPath:"lsp",env:"KODAX_LSP",value:r(e=>O(e.lsp),"value")},{configPath:"lspAutoDownload",env:"KODAX_LSP_DOWNLOAD",value:r(e=>O(e.lspAutoDownload),"value")},{configPath:"acpLogLevel",env:"KODAX_ACP_LOG",value:r(e=>y(e.acpLogLevel),"value")},{configPath:"repoIntelligence.toolWaitMs",env:"KODAX_REPO_INTELLIGENCE_TOOL_WAIT_MS",value:r(e=>b(e.repoIntelligence?.toolWaitMs),"value")},{configPath:"repoIntelligence.workerTimeoutMs",env:"KODAX_REPO_INTELLIGENCE_WORKER_TIMEOUT_MS",value:r(e=>b(e.repoIntelligence?.workerTimeoutMs),"value")},{configPath:"repoIntelligence.workerOldSpaceMb",env:"KODAX_REPO_INTELLIGENCE_WORKER_OLD_SPACE_MB",value:r(e=>b(e.repoIntelligence?.workerOldSpaceMb),"value")},{configPath:"repoIntelligence.storageDir",env:"KODAX_REPO_INTELLIGENCE_STORAGE_DIR",value:r(e=>y(e.repoIntelligence?.storageDir),"value")},{configPath:"workflow.maxConcurrency",env:"KODAX_WORKFLOW_MAX_CONCURRENCY",value:r(e=>b(e.workflow?.maxConcurrency),"value")}];function Wt(e){for(let t of qe)Ut(t.env,t.value(e))}r(Wt,"applyConfigSurfaceBridges");function y(e){return e?.trim()||void 0}r(y,"normalizedConfigString");function b(e){return typeof e=="number"&&Number.isFinite(e)?String(e):void 0}r(b,"configNumberString");function O(e){return e===void 0?void 0:e?"1":"0"}r(O,"configBooleanString");function Gt(e){return e?.filter(t=>t.trim().length>0).join(",")}r(Gt,"configStringList");var jn=[...qe.map(({configPath:e,env:t})=>({configPath:e,env:t}))];function Vt(e){Wt(e)}r(Vt,"applyConfigEnvironment");function Kn(){Ct();let e=fe();return Vt(e),Mt(e),_e(e.locale),e}r(Kn,"prepareRuntimeConfig");function Xn(e){let{extensions:t,mcpServers:n,...o}=e;if(E(p,()=>{let i={};if(m.existsSync(p))try{let a=JSON.parse(m.readFileSync(p,"utf8"));a&&typeof a=="object"&&!Array.isArray(a)&&(i=a)}catch{}let s={...i,...o};for(let a of Object.keys(o))o[a]===void 0&&delete s[a];m.writeFileSync(p,JSON.stringify(s,null,2))}),t!==void 0){let i=U(d);D({domain:"extensions",configHome:d,...i.source==="user"?{expectedRevision:i.revision}:{},document:{version:1,paths:le(t)??[]},validate:C})}if(n!==void 0){let i=F(d);D({domain:"mcp",configHome:d,...i.source==="user"?{expectedRevision:i.revision}:{},document:{version:1,servers:n},validate:k})}}r(Xn,"saveConfig");function Fn(e,t,n){return e.effort!==void 0||H(n).kind==="value"||t.effort!==void 0}r(Fn,"resolveInitialEffortOverride");function w(e){return e?.trim()?e:void 0}r(w,"nonEmptySelection");function Un(e){return w(e.explicitProvider)??w(e.environmentProvider)??w(e.configuredProvider)??e.defaultProvider}r(Un,"resolveRuntimeProviderSelection");function Wn(e){let t=w(e.explicitModel);if(t)return t;let n=w(e.configuredModel);if(!n)return;let o=w(e.explicitProvider)??w(e.environmentProvider);return o?w(e.configuredProvider)===o?n:void 0:n}r(Wn,"resolveRuntimeModelSelection");function Gn(e){if(e.explicitEffort!==void 0)return B(e.explicitEffort);let t=H(e.environmentEffort);return t.kind==="value"?t.value:e.configuredEffort===void 0?void 0:B(e.configuredEffort)}r(Gn,"resolveRuntimeEffortSelection");function zt(e){return e.permissionMode==="plan"&&e.effortOverride!==!0&&e.planModeEffort!==void 0?e.planModeEffort:e.effort}r(zt,"resolvePermissionModeEffort");async function Vn(e){try{let{stdout:t}=await xt("git rev-parse --show-toplevel",{cwd:e,windowsHide:!0});return t.trim()}catch{return null}}r(Vn,"getGitRoot");function qt(e){switch(e){case"builtin":return"Built-in";case"runtime":return"Runtime extension";case"custom":return"Custom config";default:return"Unknown"}}r(qt,"formatProviderSourceKind");function zn(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: ${qt(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: ${$t(e.reasoningCapability)}`]}r(zn,"formatProviderCapabilityDetailLines");function qn(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:Tt(e,t,n,i.hints)})).filter(i=>i.decision!==null)}r(qn,"getProviderCommonPolicyScenarios");var We=.5,Ge=0,L={locked:!1,queue:[]};async function Bn(e){for(;L.locked;)await new Promise(t=>L.queue.push(t));L.locked=!0;try{let t=(Date.now()-Ge)/1e3;t<We&&await new Promise(o=>setTimeout(o,(We-t)*1e3));let n=await e();return Ge=Date.now(),n}finally{L.locked=!1;let t=L.queue.shift();t&&t()}}r(Bn,"rateLimitedCall");export{Bt as a,Ae as b,Oe as c,ee as d,tt as e,E as f,S as g,k as h,C as i,M as j,F as k,U as l,dt as m,cn as n,D as o,Le as p,d as q,Pn as r,p as s,Sn as t,kt as u,kn as v,Mt as w,Ot as x,Cn as y,It as z,Rt as A,Dt as B,Lt as C,Mn as D,Tt as E,_n as F,An as G,I as H,On as I,In as J,Rn as K,Dn as L,$t as M,Ln as N,Tn as O,Nn as P,fe as Q,Kt as R,ae as S,Ft as T,$n as U,jn as V,Vt as W,Kn as X,Xn as Y,Fn as Z,Un as _,Wn as $,Gn as aa,zt as ba,Vn as ca,qt as da,zn as ea,qn as fa,Bn as ga};
|