@kodax-ai/kodax 0.7.63 → 0.7.67

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 (84) hide show
  1. package/CHANGELOG.md +2390 -2189
  2. package/README.md +118 -16
  3. package/README_CN.md +78 -12
  4. package/dist/chunks/{agent-SL444XLN.js → agent-E4V5SLX6.js} +1 -1
  5. package/dist/chunks/argument-completer-N6RT5KYT.js +2 -0
  6. package/dist/chunks/{chunk-ARUWXX25.js → chunk-35P7QL2Q.js} +1 -1
  7. package/dist/chunks/chunk-AKMXJSGM.js +56 -0
  8. package/dist/chunks/{chunk-L3MF5V64.js → chunk-CW32NQFO.js} +1 -1
  9. package/dist/chunks/{chunk-KCFVGXVK.js → chunk-DEICMTHO.js} +9 -9
  10. package/dist/chunks/{chunk-7MPU7TP6.js → chunk-EN3O2C43.js} +270 -270
  11. package/dist/chunks/chunk-KBBGDRER.js +22 -0
  12. package/dist/chunks/chunk-NVDK375I.js +729 -0
  13. package/dist/chunks/{chunk-S4GVQO3W.js → chunk-O7N22GJ3.js} +1 -1
  14. package/dist/chunks/chunk-ONUPGMER.js +2 -0
  15. package/dist/chunks/{chunk-ZL5CEANW.js → chunk-PZTG2C33.js} +1 -1
  16. package/dist/chunks/chunk-QI6SQ2UQ.js +306 -0
  17. package/dist/chunks/{chunk-6OZ5KWG3.js → chunk-QJJKMNZF.js} +1 -1
  18. package/dist/chunks/chunk-RS2GAABJ.js +328 -0
  19. package/dist/chunks/chunk-W2XMNYLK.js +15 -0
  20. package/dist/chunks/chunk-WCSSXBHR.js +419 -0
  21. package/dist/chunks/chunk-YH5BTUQO.js +343 -0
  22. package/dist/chunks/{chunk-UA744TZM.js → chunk-YRBNXFHY.js} +1 -1
  23. package/dist/chunks/compaction-config-56NO42ZI.js +2 -0
  24. package/dist/chunks/{construction-bootstrap-EFZBONTK.js → construction-bootstrap-GLEHQ2KB.js} +1 -1
  25. package/dist/chunks/{devtools-4CRULTR2.js → devtools-CD6KSIHE.js} +1 -1
  26. package/dist/chunks/{devtools-YINBSZC7.js → devtools-XR5F2C6T.js} +1 -1
  27. package/dist/chunks/{dist-73L4OYPD.js → dist-4PXB7U22.js} +1 -1
  28. package/dist/chunks/dist-4UIRSSFS.js +2 -0
  29. package/dist/chunks/host-DMREFNSO.js +2 -0
  30. package/dist/chunks/{paste-FDYM7SZX.js → paste-C33GZQV5.js} +1 -1
  31. package/dist/chunks/run-manager-P5XMSGZ7.js +2 -0
  32. package/dist/chunks/utils-JENPFKAE.js +2 -0
  33. package/dist/constructed-handler-worker.js +2 -0
  34. package/dist/index.d.ts +25 -11
  35. package/dist/index.js +6 -6
  36. package/dist/kodax_cli.js +1282 -1232
  37. package/dist/runtime-worker.js +2872 -0
  38. package/dist/sdk-agent.d.ts +46 -10
  39. package/dist/sdk-agent.js +1 -1
  40. package/dist/sdk-coding.d.ts +337 -1020
  41. package/dist/sdk-coding.js +1 -1
  42. package/dist/sdk-llm.js +1 -1
  43. package/dist/sdk-mcp.d.ts +2 -1
  44. package/dist/sdk-mcp.js +1 -1
  45. package/dist/sdk-media.js +1 -1
  46. package/dist/sdk-repl.d.ts +208 -185
  47. package/dist/sdk-repl.js +2 -2
  48. package/dist/sdk-runtime.d.ts +1070 -0
  49. package/dist/sdk-runtime.js +2 -0
  50. package/dist/sdk-session.d.ts +4 -4
  51. package/dist/sdk-session.js +1 -1
  52. package/dist/sdk-skills.js +1 -1
  53. package/dist/semantic-worker.js +191 -10
  54. package/dist/types-chunks/{bash-prefix-extractor.d-CZW9fRoa.d.ts → bash-prefix-extractor.d-D57Gt6n8.d.ts} +186 -12
  55. package/dist/types-chunks/{run-manager.d-CYTnWhZY.d.ts → capsule.d-BZmqu_HL.d.ts} +5 -92
  56. package/dist/types-chunks/commands.d-Cg26ud-Y.d.ts +213 -0
  57. package/dist/types-chunks/{types.d-1CnTg7Sd.d.ts → guardrail.d-Ds7JHxR1.d.ts} +3 -128
  58. package/dist/types-chunks/{guardrail.d-MR6LwMB2.d.ts → guardrail.d-vSaBe64I.d.ts} +3 -3
  59. package/dist/types-chunks/{manager.d-DBD7SOTT.d.ts → manager.d-Zum9cGHU.d.ts} +3 -173
  60. package/dist/types-chunks/oauth-login.d-Bgb4rdLN.d.ts +174 -0
  61. package/dist/types-chunks/public-api.d-CPBMPDiU.d.ts +602 -0
  62. package/dist/types-chunks/run-manager.d-lnwnfyNC.d.ts +91 -0
  63. package/dist/types-chunks/{sdk-session-RBSBBKol.d.ts → sdk-session-ByoMLoUS.d.ts} +8 -306
  64. package/dist/types-chunks/{process.d-CY2g03Mb.d.ts → types.d-DG9B4SMm.d.ts} +369 -4
  65. package/dist/types-chunks/types.d-DU9lLkmE.d.ts +128 -0
  66. package/dist/types-chunks/types.d-DYv3a1ka.d.ts +975 -0
  67. package/dist/types-chunks/{utils.d-C14jZ9ZM.d.ts → utils.d-DMI-9GTR.d.ts} +88 -72
  68. package/docs/SDK_EMBEDDER_GUIDE.md +3079 -0
  69. package/package.json +8 -1
  70. package/dist/chunks/argument-completer-EN63ZVJK.js +0 -2
  71. package/dist/chunks/chunk-4MIHVNB7.js +0 -405
  72. package/dist/chunks/chunk-HP4FXMEM.js +0 -18
  73. package/dist/chunks/chunk-KHICMJIR.js +0 -310
  74. package/dist/chunks/chunk-LGR7ACBQ.js +0 -326
  75. package/dist/chunks/chunk-RR7W7UF6.js +0 -341
  76. package/dist/chunks/chunk-UGTK2JIJ.js +0 -731
  77. package/dist/chunks/chunk-V4WSBIXB.js +0 -2
  78. package/dist/chunks/chunk-VSWROENP.js +0 -52
  79. package/dist/chunks/compaction-config-4VIONMFB.js +0 -2
  80. package/dist/chunks/dist-EDF2YUF6.js +0 -2
  81. package/dist/chunks/host-J4HPDLFC.js +0 -2
  82. package/dist/chunks/run-manager-ZVSW2OWM.js +0 -2
  83. package/dist/chunks/utils-5HDLYTZJ.js +0 -2
  84. package/dist/types-chunks/storage.d-C6kkAEch.d.ts +0 -280
@@ -1,2 +0,0 @@
1
- // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(b,a)=>e(b,"name",{value:a,configurable:!0});var n=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var l=(b,a,c,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!k.call(b,d)&&d!==c&&e(b,d,{get:()=>a[d],enumerable:!(f=h(a,d))||f.enumerable});return b};var o=(b,a,c)=>(c=b!=null?g(j(b)):{},l(a||!b||!b.__esModule?e(c,"default",{value:b,enumerable:!0}):c,b));export{m as a,n as b,o as c};
@@ -1,52 +0,0 @@
1
- // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{w as U,y as $}from"./chunk-LGR7ACBQ.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-UGTK2JIJ.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.63";if(e)return p=e,p;let t=f.join(f.dirname(oe(import.meta.url)),"../../package.json");if(l.existsSync(t))try{return p=JSON.parse(l.readFileSync(t,"utf-8")).version??"0.0.0",p??"0.0.0"}catch{}return p="0.0.0",p}r(pe,"getVersion");var He=pe();function me(e){return M(e)}r(me,"getProviderModel");function R(e,t){let n=new Set(e.map(i=>i.toLowerCase())),o=[...e];for(let i of t)n.has(i.toLowerCase())||o.push(i);return o}r(R,"mergeModels");function ge(e,t){t||(t=b().providerModels);let n=t?.[e];if(n&&n.length>0){try{let o=S(e);if(o.length>0)return R(n,o)}catch{}try{let o=g(e);if(o)return R(n,o.getAvailableModels())}catch{}return n}try{let o=S(e);if(o.length>0)return o}catch{}try{let o=g(e);if(o)return o.getAvailableModels()}catch{}return[]}r(ge,"getProviderAvailableModels");function ve(e,t){let n=D(e,t);if(n!=="unknown")return n;try{let o=g(e);if(o)return o.getReasoningCapability(t)}catch{}return"unknown"}r(ve,"getProviderReasoningCapability");function ye(e){let t=T(e);if(t)return t;try{return P().find(o=>o.name===e)?.capabilityProfile??null}catch{return null}}r(ye,"getProviderCapabilityProfile");function q(e,t){let n=ye(e),o=ve(e,t);if(n)return{capabilityProfile:n,reasoningCapability:o};try{let i=X(e);return{capabilityProfile:i.getCapabilityProfile(),reasoningCapability:i.getReasoningCapability(t)}}catch{return null}}r(q,"getProviderCapabilityMetadata");function ze(e,t){let n=q(e,t);return n?U({providerName:e,model:t,capabilityProfile:n.capabilityProfile,reasoningCapability:n.reasoningCapability==="unknown"?void 0:n.reasoningCapability}):null}r(ze,"getProviderCapabilitySnapshot");function he(e,t,n,o){let i=q(e,t);return i?$({providerName:e,model:t,capabilityProfile:i.capabilityProfile,reasoningCapability:i.reasoningCapability==="unknown"?void 0:i.reasoningCapability,reasoningMode:n,hints:o}):null}r(he,"getProviderPolicyDecision");function qe(e){let t=e.transport==="cli-bridge"?"CLI bridge":"Native API",n=e.conversationSemantics==="last-user-message"?"forwards only the latest user message":"preserves full conversation history",o=e.mcpSupport==="native"?"MCP available":"MCP unavailable";return`${t}; ${n}; ${o}`}r(qe,"describeProviderCapabilitySummary");function Je(e){switch(e){case"native-budget":return"B";case"native-effort":return"E";case"native-toggle":return"T";case"native-adaptive":return"A";default:return"-"}}r(Je,"formatReasoningCapabilityShort");function m(e){if(e)return e==="none"?"off":e}r(m,"formatReasoningEffortForDisplay");function y(e,t){let n=m(t);n&&!e.includes(n)&&e.push(n)}r(y,"pushUniqueEffortDisplay");function Ye(e,t){let n=["auto"],i=E(e,t)?.supportedEfforts?.filter(s=>s.isUserVisible!==!1);if(!i||i.length===0){for(let s of["off","low","medium","high"])y(n,s);return n}for(let s of i)y(n,s.value);return n}r(Ye,"getProviderReasoningEffortOptions");function Qe(e,t){let n=E(e,t),o=new Set(n?.disabledEfforts??[]),i=n?.supportedEfforts?.filter(c=>c.isUserVisible!==!1),s=[],a=n?.supportsDisabledThinking===!0;if(!i||i.length===0){for(let c of["low","medium","high"])y(s,c);a=!0}else for(let c of i){if(c.value==="none"){a=!0;continue}if(o.has(c.value)){a=!0;continue}y(s,c.value)}let u=[];return a&&u.push("off"),u.push(...s),u.push("auto"),u}r(Qe,"getProviderReasoningEffortCycle");function Ee(e,t){if(t===!1)return"off";switch(e){case"off":return"off";case"quick":return"low";case"balanced":return"medium";case"deep":return"high";default:return"auto"}}r(Ee,"legacyReasoningModeToEffortDisplay");function E(e,t){let n=t??me(e);if(!n)return;let o=F(e,n)?.reasoningProfile;if(o)return k(o,j(e,n))}r(E,"resolveReasoningProfileForDisplay");function Ze(e){let t=m(e.effort)??Ee(e.reasoningMode,e.thinking),n=E(e.provider,e.model);if(!n)return t;try{let o=x({capability:n,explicitEffort:e.effortOverride?e.effort:void 0,sessionEffort:e.effortOverride?void 0:e.effort,legacyReasoningMode:e.reasoningMode,thinking:e.thinking}),i=m(o.configuredEffort)??t,a=o.configuredEffort!==void 0&&n.disabledEfforts?.includes(o.configuredEffort)===!0?"off":m(o.effectiveEffort);return a&&a!==i?`${i}->${a}`:i}catch{if(e.effort)try{let o=O({currentEffort:e.effort,capability:n}),i=m(e.effort)??t,s=m(o.effectiveEffort);return s&&s!==i?`${i}->${s}`:i}catch{return t}return t}}r(Ze,"formatReasoningEffortStatusLabel");function et(e){let t=ke(e);if(!t)return{preserved:!0};let n=E(e.provider,e.model);if(!n)return{configuredEffort:t,runtimeEffort:t,preserved:!0};let o=O({currentEffort:t,capability:n});return{configuredEffort:t,runtimeEffort:o.effectiveEffort,preserved:o.preserved,diagnostic:o.diagnostic}}r(et,"resolveProviderReasoningRuntimeEffort");function be(e){switch(e){case"native-budget":return"budget";case"native-effort":return"effort";case"native-toggle":return"toggle";case"native-adaptive":return"adaptive";default:return"none"}}r(be,"describeReasoningCapabilityControl");function tt(e,t){if(e==="off")return"Reasoning disabled";switch(t){case"native-budget":return"Uses native thinking budget control";case"native-effort":return"Uses native reasoning effort control";case"native-toggle":return"Uses provider-native thinking toggle only";case"native-adaptive":return"Model adaptively decides thinking depth (Opus 4.7+)";case"none":return"Runs without native reasoning parameters";case"prompt-only":return"Uses prompt overlays only; no native reasoning parameter";default:return"Runs without native reasoning parameters"}}r(tt,"describeReasoningExecution");function nt(e){let t=[];e||(e=b().providerModels);for(let n of N())t.push({name:n.name,model:n.model,models:ge(n.name,e),configured:n.capabilityProfile.transport==="cli-bridge"?!0:n.configured,reasoningCapability:n.reasoningCapability,capabilityProfile:n.capabilityProfile});try{let n=P().map(o=>({...o,models:(()=>{let i=e?.[o.name];return i&&i.length>0?R(i,o.models):o.models})()}));t.push(...n)}catch{}return t}r(nt,"getProviderList");function ot(e){if(I(e))return!0;try{return g(e)?.isConfigured()??!1}catch{return!1}}r(ot,"isProviderConfigured");function b(){try{if(l.existsSync(d)){let e=JSON.parse(l.readFileSync(d,"utf-8")),t=e.reasoningCeiling??e.reasoningMode;return de(fe({...e,reasoningMode:t,extensions:z(e.extensions)}))}}catch{}return{}}r(b,"loadConfig");var w=f.join(h,"config.example.jsonc"),_e=`// KodaX example configuration \u2014 copy what you need into config.json (in this same
3
- // folder). config.json must be STRICT JSON: no comments, no trailing commas. Most
4
- // settings also have a KODAX_* env var that overrides the file. Delete anything you
5
- // don't use; everything here is optional.
6
- {
7
- // Default provider + model. Override live with /provider and /model.
8
- // "provider": "deepseek",
9
- // "model": "deepseek-v4",
10
-
11
- // Reasoning effort for normal turns: off | auto | low | medium | high | xhigh | max.
12
- // "effort": "high",
13
-
14
- // Permission mode: "accept-edits" | "plan" | "auto".
15
- // "permissionMode": "accept-edits",
16
-
17
- // Custom providers \u2014 point KodaX at an OpenAI/Anthropic-compatible endpoint.
18
- // "customProviders": [
19
- // {
20
- // "name": "my-relay", // unique; do NOT reuse a built-in provider name
21
- // "protocol": "openai", // "openai" or "anthropic" = the wire format the endpoint speaks
22
- // "baseUrl": "https://api.example.com/v1",
23
- // "apiKeyEnv": "MY_RELAY_API_KEY", // env var that holds the key (never put the key here)
24
- // "model": "deepseek/deepseek-v4",
25
- // "models": ["deepseek/deepseek-v4"],
26
- //
27
- // // --- Thinking / reasoning (optional) ---
28
- // // For most NON-Claude models this single line is all you need:
29
- // "supportsThinking": true
30
- // // openai-compat : KodaX sends no thinking toggle and just shows whatever
31
- // // reasoning the model emits (deepseek/qwen/etc. via relays).
32
- // // anthropic-compat: KodaX sends thinking:{type:"enabled"} \u2014 what the Anthropic
33
- // // endpoints of zhipu / kimi / minimax / deepseek expect.
34
- // //
35
- // // openai-compat MULTI-TURN: some models (notably DeepSeek V4) reject later turns
36
- // // whose history drops the previous reasoning_content. If thinking shows on turn 1
37
- // // but turn 2 errors, also set: "replayReasoningContent": true
38
- // //
39
- // // To expose a TUNABLE effort level, use "reasoning" instead. Include "off" to
40
- // // allow disabling thinking:
41
- // // "reasoning": { "efforts": ["off", "low", "high"], "default": "high" }
42
- // //
43
- // // Pointing anthropic-compat at REAL Claude (4.6+)? Claude needs ADAPTIVE
44
- // // thinking, not the enable toggle \u2014 set instead:
45
- // // "reasoningCapability": "native-adaptive"
46
- // }
47
- // ],
48
-
49
- // MCP servers (stdio or remote). See the /mcp command and manual topic "mcp".
50
- // "mcpServers": {}
51
- }
52
- `;function rt(){try{return l.existsSync(d)||l.existsSync(w)?void 0:(l.mkdirSync(h,{recursive:!0}),l.writeFileSync(w,_e,"utf-8"),w)}catch{return}}r(rt,"ensureExampleConfigFile");function Oe(e){e.streamIdleTimeoutMs&&!process.env.KODAX_STREAM_IDLE_TIMEOUT_MS&&(process.env.KODAX_STREAM_IDLE_TIMEOUT_MS=String(e.streamIdleTimeoutMs))}r(Oe,"applyResilienceRuntimeEnv");function Se(e){e.repoIntelligenceMode&&!process.env.KODAX_REPO_INTELLIGENCE&&(process.env.KODAX_REPO_INTELLIGENCE=e.repoIntelligenceMode),e.repoIntelligenceTrace===!0&&!process.env.KODAX_REPO_INTELLIGENCE_TRACE&&(process.env.KODAX_REPO_INTELLIGENCE_TRACE="1")}r(Se,"applyRepoIntelligenceRuntimeEnv");function Pe(e){e.verifierLog===!0&&!process.env.KODAX_VERIFIER_LOG&&(process.env.KODAX_VERIFIER_LOG="1")}r(Pe,"applyVerifierRuntimeEnv");function Ce(e){e.stallLog===!0&&!process.env.KODAX_STALL_LOG&&(process.env.KODAX_STALL_LOG="1")}r(Ce,"applyStallSidecarRuntimeEnv");function we(e){let t=e.fallbackProviders?.filter(n=>n.trim().length>0)??[];t.length>0&&!process.env.KODAX_FALLBACK_PROVIDERS&&(process.env.KODAX_FALLBACK_PROVIDERS=t.join(","))}r(we,"applyFallbackRuntimeEnv");function Le(e){let t=r((n,o)=>{n&&n.trim().length>0&&!process.env[o]&&(process.env[o]=n.trim())},"bridge");t(e.fastProvider,"KODAX_FAST_PROVIDER"),t(e.fastModel,"KODAX_FAST_MODEL"),t(e.deepProvider,"KODAX_DEEP_PROVIDER"),t(e.deepModel,"KODAX_DEEP_MODEL")}r(Le,"applyModelTierRuntimeEnv");var Re=[{env:"KODAX_MAX_OUTPUT_TOKENS",value:r(e=>typeof e.maxOutputTokens=="number"?String(e.maxOutputTokens):void 0,"value")},{env:"KODAX_DISABLE_PROMPT_CACHE",value:r(e=>e.disablePromptCache===!0?"1":void 0,"value")},{env:"KODAX_LSP",value:r(e=>e.lsp===!1?"0":e.lsp===!0?"1":void 0,"value")},{env:"KODAX_LSP_DOWNLOAD",value:r(e=>e.lspAutoDownload===!0?"1":void 0,"value")},{env:"KODAX_ACP_LOG",value:r(e=>e.acpLogLevel&&e.acpLogLevel.trim().length>0?e.acpLogLevel.trim():void 0,"value")},{env:"KODAX_REPO_INTELLIGENCE_TOOL_WAIT_MS",value:r(e=>typeof e.repoIntelligence?.toolWaitMs=="number"?String(e.repoIntelligence.toolWaitMs):void 0,"value")},{env:"KODAX_REPO_INTELLIGENCE_WORKER_TIMEOUT_MS",value:r(e=>typeof e.repoIntelligence?.workerTimeoutMs=="number"?String(e.repoIntelligence.workerTimeoutMs):void 0,"value")},{env:"KODAX_REPO_INTELLIGENCE_WORKER_OLD_SPACE_MB",value:r(e=>typeof e.repoIntelligence?.workerOldSpaceMb=="number"?String(e.repoIntelligence.workerOldSpaceMb):void 0,"value")},{env:"KODAX_REPO_INTELLIGENCE_STORAGE_DIR",value:r(e=>e.repoIntelligence?.storageDir?.trim()||void 0,"value")},{env:"KODAX_WORKFLOW_MAX_CONCURRENCY",value:r(e=>typeof e.workflow?.maxConcurrency=="number"?String(e.workflow.maxConcurrency):void 0,"value")}];function Ae(e){for(let t of Re){let n=t.value(e);n!==void 0&&!process.env[t.env]&&(process.env[t.env]=n)}}r(Ae,"applyConfigSurfaceBridges");function it(){ce();let e=b();return Oe(e),Se(e),Pe(e),Ce(e),we(e),Le(e),Ae(e),ue(e),B(e.locale),e}r(it,"prepareRuntimeConfig");function st(e){let n={...b(),...e},o=z(n.extensions);o!==void 0&&(n.extensions=o);for(let i of Object.keys(e))e[i]===void 0&&delete n[i];l.mkdirSync(f.dirname(d),{recursive:!0}),l.writeFileSync(d,JSON.stringify(n,null,2))}r(st,"saveConfig");function at(e,t){return e.effort!==void 0||t.effort!==void 0}r(at,"resolveInitialEffortOverride");function ke(e){return e.permissionMode==="plan"&&e.effortOverride!==!0&&e.planModeEffort!==void 0?e.planModeEffort:e.effort}r(ke,"resolvePermissionModeEffort");async function lt(e){try{let{stdout:t}=await re("git rev-parse --show-toplevel",{cwd:e});return t.trim()}catch{return null}}r(lt,"getGitRoot");function xe(e){switch(e){case"builtin":return"Built-in";case"runtime":return"Runtime extension";case"custom":return"Custom config";default:return"Unknown"}}r(xe,"formatProviderSourceKind");function ct(e){let t=e.transport==="cli-bridge"?"CLI bridge":"Native API",n=e.conversationSemantics==="last-user-message"?"latest-user-message only":"full conversation history";return[`Source: ${xe(e.sourceKind)}`,`Transport: ${t}`,`Conversation semantics: ${n}`,`Context fidelity: ${e.contextFidelity}`,`Tool calling: ${e.toolCallingFidelity}`,`Session behavior: ${e.sessionSupport}`,`Long-running support: ${e.longRunningSupport}`,`Evidence-heavy flows: ${e.evidenceSupport}`,`Multimodal support: ${e.multimodalSupport}`,`MCP support: ${e.mcpSupport}`,`Reasoning control: ${be(e.reasoningCapability)}`]}r(ct,"formatProviderCapabilityDetailLines");function ut(e,t,n){return[{label:"General coding",hints:{}},{label:"Evidence-heavy review",hints:{evidenceHeavy:!0}},{label:"Long-running task",hints:{longRunning:!0}}].map(i=>({label:i.label,decision:he(e,t,n,i.hints)})).filter(i=>i.decision!==null)}r(ut,"getProviderCommonPolicyScenarios");var W=.5,H=0,v={locked:!1,queue:[]};async function ft(e){for(;v.locked;)await new Promise(t=>v.queue.push(t));v.locked=!0;try{let t=(Date.now()-H)/1e3;t<W&&await new Promise(o=>setTimeout(o,(W-t)*1e3));let n=await e();return H=Date.now(),n}finally{v.locked=!1;let t=v.queue.shift();t&&t()}}r(ft,"rateLimitedCall");export{Ie as a,h as b,Ve as c,d,Be as e,le as f,We as g,ue as h,pe as i,He as j,me as k,ge as l,ve as m,ye as n,ze as o,he as p,qe as q,Je as r,m as s,Ye as t,Qe as u,Ze as v,et as w,be as x,tt as y,nt as z,ot as A,b as B,w as C,rt as D,it as E,st as F,at as G,ke as H,lt as I,xe as J,ct as K,ut as L,ft as M};
@@ -1,2 +0,0 @@
1
- // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{a}from"./chunk-L3MF5V64.js";import"./chunk-UGTK2JIJ.js";import"./chunk-ZL5CEANW.js";import"./chunk-V4WSBIXB.js";export{a as loadCompactionConfig};
@@ -1,2 +0,0 @@
1
- // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{$ as jh,A as Kg,Aa as Kh,B as Lg,Ba as Lh,C as Mg,Ca as Mh,D as Ng,Da as Nh,E as Og,Ea as Oh,F as Pg,Fa as Ph,G as Qg,Ga as Qh,H as Rg,Ha as Rh,I as Sg,Ia as Sh,J as Tg,K as Ug,L as Vg,M as Wg,N as Xg,O as Yg,P as Zg,Q as _g,R as $g,S as ah,T as bh,U as ch,V as dh,W as eh,X as fh,Y as gh,Z as hh,_ as ih,a as $,aa as kh,b as aa,ba as lh,c as ba,ca as mh,d as ng,da as nh,e as og,ea as oh,f as pg,fa as ph,g as qg,ga as qh,h as rg,ha as rh,i as sg,ia as sh,j as tg,ja as th,k as ug,ka as uh,l as vg,la as vh,m as wg,ma as wh,n as xg,na as xh,o as yg,oa as yh,p as zg,pa as zh,q as Ag,qa as Ah,r as Bg,ra as Bh,s as Cg,sa as Ch,t as Dg,ta as Dh,u as Eg,ua as Eh,v as Fg,va as Fh,w as Gg,wa as Gh,x as Hg,xa as Hh,y as Ig,ya as Ih,z as Jg,za as Jh}from"./chunk-4MIHVNB7.js";import{a as Md,b as Nd,c as Od,d as Pd,e as Qd,f as Rd,g as Sd,h as Td,i as Ud,j as te}from"./chunk-KCFVGXVK.js";import{a as Vd,b as Wd,c as Xd,d as Yd,e as Zd,f as _d,g as $d,h as ae,i as be,j as ce,k as de,l as ee,m as fe,n as ge,o as he,p as ie,q as je,r as ke,s as le,t as me,u as ne,v as oe,w as pe,x as qe,y as re,z as se}from"./chunk-HP4FXMEM.js";import{A as zd,E as Ad,F as Bd,G as Cd,H as Dd,K as Ed,M as ue,N as ve,O as we,P as xe,Q as ye,R as ze,S as Ae,T as Be,V as Ce,W as De,X as Ee,a as ya,b as za,e as kd,ea as Gf,f as ld,fa as Hf,g as md,h as nd,i as od,j as pd,k as qd,ma as If,na as Jf,p as rd,q as sd,ra as Kf,t as td,u as ud,w as vd,x as wd,y as xd,z as yd}from"./chunk-LGR7ACBQ.js";import"./chunk-D6QVXQNI.js";import{a as Ld}from"./chunk-UA744TZM.js";import{$b as af,A as cc,Aa as _c,Ac as Cf,B as dc,Ba as $c,Bc as Df,C as ec,Ca as ad,Cc as Ef,D as fc,Dc as Ff,E as gc,Eb as Fe,F as hc,Fb as Ge,G as ic,Ga as bd,Gb as He,H as jc,Ha as cd,Hb as Ie,I as kc,Ia as dd,Ib as Je,J as lc,Ja as ed,Jb as Ke,Ka as fd,Kb as Le,L as mc,La as gd,Lb as Me,M as nc,Ma as hd,Mb as Ne,N as oc,Nb as Oe,O as pc,Oa as id,Ob as Pe,Oc as Lf,P as qc,Pa as jd,Pb as Qe,Pc as Mf,Q as rc,Qb as Re,Qc as Nf,R as sc,Rb as Se,Rc as Of,S as tc,Sb as Te,Sc as Pf,T as uc,Tb as Ue,Tc as Qf,U as vc,Ub as Ve,Uc as Rf,V as wc,Vb as We,Vc as Sf,W as xc,Wb as Xe,Wc as Tf,X as yc,Xb as Ye,Xc as Uf,Y as zc,Yb as Ze,Yc as Vf,Z as Ac,Zb as _e,_ as Bc,_b as $e,ac as bf,ba as Cc,bc as cf,ca as Dc,cc as df,cd as Wf,d as Lb,da as Ec,dc as ef,dd as Xf,e as Mb,ea as Fc,ec as ff,ed as Yf,fa as Gc,fc as gf,fd as Zf,ga as Hc,gc as hf,gd as _f,ha as Ic,hc as jf,hd as $f,i as Nb,ic as kf,id as ag,j as Ob,ja as Jc,jc as lf,jd as bg,k as Pb,ka as Kc,kc as mf,kd as cg,l as Qb,la as Lc,lc as nf,ld as dg,m as Rb,ma as Mc,mc as of,md as eg,n as Sb,na as Nc,nc as pf,nd as fg,o as Tb,oa as Oc,oc as qf,od as gg,p as Ub,pa as Pc,pc as rf,pd as hg,q as Vb,qa as Qc,qc as sf,qd as ig,r as Wb,ra as Rc,rc as tf,rd as jg,s as Xb,sa as Sc,sc as uf,sd as kg,t as Yb,ta as Tc,tc as vf,td as lg,u as Zb,ua as Uc,ub as Fd,uc as wf,v as _b,va as Vc,vb as Gd,vc as xf,w as $b,wa as Wc,wb as Hd,wc as yf,x as ac,xa as Xc,xb as Id,xc as zf,xd as mg,y as bc,ya as Yc,yb as Jd,yc as Af,za as Zc,zb as Kd,zc as Bf}from"./chunk-RR7W7UF6.js";import{$ as o,A as i,Aa as L,B as j,Ba as M,C as k,Ca as N,D as l,Da as O,E as m,Ea as P,Fa as Q,Ga as R,Ha as S,Ia as T,Ja as U,Ka as V,La as W,Ma as X,Na as Y,Oa as Z,R as n,Ra as _,a,aa as p,b,c,fa as q,ga as r,ha as s,ia as t,j as d,ja as u,k as e,ka as v,la as w,ma as x,na as y,oa as z,pa as A,qa as B,ra as C,s as f,sa as D,t as g,ta as E,ua as F,va as G,wa as H,xa as I,ya as J,z as h,za as K}from"./chunk-S4GVQO3W.js";import{Fc as Xa,Fd as Jb,Gc as Ya,Gd as Kb,Hc as Za,Ic as _a,Jc as $a,Kc as ab,Lc as bb,Mc as cb,Nc as db,Oc as eb,Pc as fb,Qc as gb,Rc as hb,Sc as ib,Tc as jb,Uc as kb,Vc as lb,Wc as mb,Xc as nb,Yc as ob,Zc as pb,_c as qb,a as Aa,ad as rb,b as Ba,bd as sb,c as Ca,cd as tb,d as Da,dd as ub,e as Ea,ed as vb,f as Fa,h as Ga,i as Ha,j as Ia,k as Ja,ka as Pa,l as Ka,ld as wb,m as La,md as xb,n as Ma,na as Qa,nd as yb,o as Na,ob as Va,od as zb,p as Oa,pb as Wa,pd as Ab,qd as Bb,rd as Cb,td as Db,ua as Ra,ud as Eb,va as Sa,vd as Fb,wa as Ta,wd as Gb,xa as Ua,xd as Hb,yd as Ib}from"./chunk-UGTK2JIJ.js";import{H as xa,a as ca,b as da,c as ea,d as fa,e as ga,f as ha,g as ia,h as ja,i as ka,j as la,k as ma,l as na,m as oa,n as pa,o as qa,p as ra,v as sa,w as ta,x as ua,y as va,z as wa}from"./chunk-ZL5CEANW.js";import"./chunk-V4WSBIXB.js";export{jh as AUTO_MODE_DENIAL_CONSECUTIVE_THRESHOLD,kh as AUTO_MODE_DENIAL_CUMULATIVE_THRESHOLD,Eh as BASH_POLICY_SPEC,Ag as BLOCKER_REQUIRED_CONSECUTIVE_TURNS,ph as BREAKER_ERROR_THRESHOLD,qh as BREAKER_WINDOW_MS,Xd as BUILTIN_WORKFLOWS,Mb as CANCELLED_TOOL_RESULT_MESSAGE,Lb as CANCELLED_TOOL_RESULT_PREFIX,$g as CODING_AGENT_MARKER,tg as CODING_INVARIANTS,Gf as CODING_SUMMARY_PROMPT,Hf as CODING_UPDATE_SUMMARY_PROMPT,Re as CapabilityDeniedError,vg as Client,Bf as CombinedExtensionRuntime,Se as ConstructionManifestError,If as DEFAULT_CODING_AGENT_NAME,Qg as DEFAULT_DANGEROUS_PATTERNS,Pe as DEFAULT_HANDLER_TIMEOUT_MS,kd as DEFAULT_RESILIENCE_CONFIG,Pg as DEFAULT_SAFE_PATTERNS,af as DEFAULT_SELF_MODIFY_BUDGET,Ah as DEFAULT_SPECULATIVE_WINDOW_MS,Ob as DEFAULT_TOOL_OUTPUT_MAX_BYTES,Nb as DEFAULT_TOOL_OUTPUT_MAX_LINES,Nd as DEFAULT_WORKFLOW_GENERATION_TIMEOUT_MS,Oa as DefaultSummaryCompaction,Yg as EMIT_VERDICT_TOOL_NAME,ya as ErrorCategory,dd as GENERATOR_AGENT_NAME,da as ImageResizeError,Ha as KODAX_API_MIN_INTERVAL,s as KODAX_DEFAULT_PROVIDER,Ba as KODAX_DEFAULT_TIMEOUT,ua as KODAX_FILE_MEDIA_TYPES,Ca as KODAX_HARD_TIMEOUT,sa as KODAX_IMAGE_MEDIA_TYPES,Fa as KODAX_MAX_INCOMPLETE_RETRIES,Da as KODAX_MAX_RETRIES,Aa as KODAX_MAX_TOKENS,r as KODAX_PROVIDERS,q as KODAX_PROVIDER_SNAPSHOTS,f as KODAX_REASONING_MODE_SEQUENCE,Ea as KODAX_RETRY_BASE_DELAY,g as KODAX_STABLE_EFFORT_INTENTS,Ga as KODAX_STAGGER_DELAY,Wf as KODAX_TOOLS,Zb as KODAX_UNDERLYING_CAPABILITY_TOPICS,ta as KODAX_VIDEO_MEDIA_TYPES,o as KodaXAnthropicCompatProvider,n as KodaXBaseProvider,vg as KodaXClient,a as KodaXError,Af as KodaXExtensionRuntime,ca as KodaXMediaError,p as KodaXOpenAICompatProvider,b as KodaXProviderError,c as KodaXRateLimitError,aa as KodaXSessionError,ba as KodaXTerminalError,$ as KodaXToolError,rb as LINEAGE_ENTRY_TYPES,Hd as LSP_SERVERS,tb as LineageCompaction,sb as LineageExtension,Id as LspService,_b as MANUAL_REGISTRY,Yb as MANUAL_TOPIC_IDS,ja as MAX_DIMENSION,cb as McpAuthRequiredError,ob as McpCapabilityProvider,bb as McpExpiredSessionError,pb as McpManager,nb as McpServerRuntime,oa as PASTE_TMP_DIR_ENV,pa as PASTE_TMP_TTL_MS,cd as PLANNER_AGENT_NAME,Ia as PROMISE_PATTERN,ve as PROMPT_SECTION_REGISTRY,_g as PROTOCOL_EMITTER_TOOLS,qd as ProviderRecoveryCoordinator,Pb as READ_DEFAULT_LIMIT,Rb as READ_MAX_LINE_CHARS,Qb as READ_PREFLIGHT_SIZE_BYTES,wf as REPO_EXPLORER_AGENT_NAME,xf as REPO_EXPLORER_TOOL_NAMES,Qa as Runner,bd as SCOUT_AGENT_NAME,Qh as SCOUT_THEN_AUTHOR_PROMPT_LINES,Be as SELF_KNOWLEDGE_ROUTING_RULE,ue as SYSTEM_PROMPT,le as SYSTEM_WORKFLOW_LIMITS,od as StableBoundaryTracker,ka as TARGET_RAW_SIZE_BYTES,gd as TASK_ENGINE_ROLE_AGENTS,wg as TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME,Hh as TRACING_ENV,ed as WORKER_AGENT_NAME,Md as WORKFLOW_GENERATION_SYSTEM_PROMPT,hf as _resetRuntimeForTesting,lf as activate,qc as analyzeChangedScope,_e as appendAuditEntry,Bb as appendSessionLineageLabel,Qf as applyAccountingDelta,Cb as applySessionCompaction,Pc as applyToolResultGuardrail,Ib as archiveOldIslands,Sh as authorWorkflowViaWorker,oh as autoModeDenialShouldFallback,xh as bashSignalCollector,Ih as bootstrapTracing,pg as boundedRevise,th as breakerShouldFallback,qg as budgetCeiling,me as buildApprovalSummary,Tf as buildBlockedGoal,Ce as buildCapabilityContextSections,ah as buildClassifierPrompt,Uf as buildCompleteGoal,Pf as buildCreatedGoal,Bd as buildFallbackRoutingDecision,Eg as buildGoalRuntimeBinding,mb as buildInitializeCapabilities,Xe as buildLlmReviewPrompt,ac as buildManualToolDescription,Ig as buildMcpReverseCapabilities,Rf as buildPausedGoal,rd as buildPromptMessageContent,ze as buildPromptSnapshot,vd as buildProviderCapabilitySnapshot,Cd as buildProviderPolicyHintsForDecision,wd as buildProviderPolicyPromptNotes,pc as buildRepoIntelligenceContext,Cc as buildRepoIntelligenceIndex,mc as buildRepoOverview,Sf as buildResumedGoal,Rh as buildScoutThenAuthorPrompt,Ae as buildSelfKnowledgeRoutingRule,Gb as buildSessionTree,Ee as buildSystemPrompt,De as buildSystemPromptSnapshot,Rd as buildWorkflowGenerationSkillContext,Qd as buildWorkflowGenerationUserPrompt,wh as checkAbsoluteDeny,sd as checkIncompleteToolCalls,Ed as checkPromiseSignal,ne as clampWorkflowLimits,ch as classify,Sg as classifyBashCommand,za as classifyError,md as classifyResilienceError,Wa as cleanupIncompleteToolCalls,T as clearRuntimeModelProviders,zh as collectAllSignals,Cf as combineExtensionRuntimes,Ug as computeInputSignature,dh as computeRulesFingerprint,gf as configureRuntime,Tc as convertCapabilityReadResult,Sc as convertProviderSearchResults,Hb as countActiveLineageMessages,Ka as countTokens,La as createAgent,lh as createAutoModeDenialTracker,Dh as createAutoModeToolGuardrail,Rg as createBashClassifierConfig,Gh as createBashPrefixExtractor,cg as createBuiltinToolDefinition,rh as createCircuitBreaker,Vd as createCodingWorkflowBackend,Te as createCtxProxy,F as createCustomProvider,Jf as createDefaultCodingAgent,Tg as createDenialTracker,Df as createExtensionRuntime,ha as createFileArtifactFromPath,Ma as createHandoff,ga as createImageArtifactFromPath,Na as createInMemorySession,Lg as createKodaXTaskRunner,Ya as createMcpCapabilityId,qb as createMcpManager,db as createMcpTransport,we as createPromptSection,Dd as createReasoningPlan,ke as createRunGraphWriter,ng as createSessionControl,wb as createSessionLineage,xg as createToolResultTruncationGuardrail,ia as createVideoArtifactFromPath,Kh as createWorkflowLifecycleController,Nh as createWorkflowPatternTemplateModule,re as createWorkflowRunManager,Oh as decideWorkflowInvocation,Ke as dedupeExtensionPathsByEntrypoint,Xa as defaultMcpCacheDir,Qe as defaultPolicy,ee as deleteSavedWorkflow,ff as disableSelfModify,hb as discoverAuthorizationServerMetadata,Oe as discoverDefaultExtensions,Ne as discoverExtensionsInDirectory,Me as discoverExtensionsInDirectoryDetailed,vf as discoverMarkdownAgents,ib as discoverOAuthEndpoints,gb as discoverProtectedResourceMetadata,_d as discoverSavedWorkflows,jd as drainPendingSwaps,j as effortToLegacyReasoningMode,Zg as emitVerdict,pe as emitWorkflowAgentDigest,xa as enqueueWithArtifacts,yf as ensureBuiltinRepoExplorerAgent,Ja as estimateTokens,xd as evaluateProviderPolicy,Le as excludeExtensionPathsByEntrypoint,Fe as exec,mg as executeTool,Jb as extractArtifactLedger,Fh as extractCommandPrefix,ud as extractComparableUserMessageText,Rc as extractHtmlTitle,fb as extractInsufficientScope,td as extractPromptComparableText,eb as extractResourceMetadataUrl,vb as extractTitleFromMessages,yh as fileSignalCollector,Vc as finalizeRetrievalResult,rf as findByVersion,Db as findPreviousUserEntryId,Fb as forkSessionLineage,ad as formatAgentsForPrompt,Ng as formatParallelDispatchResult,Sb as formatSize,ub as generateSessionId,Td as generateWorkflow,Ud as generateWorkflowFromOptions,Ff as getActiveExtensionRuntime,Sa as getAgentConfigHome,Ta as getAgentConfigPath,eg as getAllRegisteredTools,Ua as getAppDataDir,W as getAvailableProviderNames,bg as getBuiltinRegisteredToolDefinition,ag as getBuiltinToolDefinition,Yd as getBuiltinWorkflow,N as getCustomModelCapabilities,H as getCustomProvider,K as getCustomProviderList,M as getCustomProviderModelDescriptors,L as getCustomProviderModels,J as getCustomProviderNames,Ie as getDefaultExtensionDirectory,Jd as getDefaultLspService,se as getDefaultWorkflowRunManager,Xg as getDenialContext,Hc as getImpactEstimate,_c as getKodaxGlobalDir,ab as getMcpCachePaths,C as getModelCapabilities,va as getModelInputCapabilities,Ec as getModuleContext,Gc as getProcessContext,t as getProvider,x as getProviderConfiguredCapabilityProfile,w as getProviderConfiguredReasoningCapability,y as getProviderList,v as getProviderModel,B as getProviderModelDescriptors,z as getProviderModels,_f as getRegisteredToolDefinition,Dc as getRepoIntelligenceIndex,nc as getRepoOverview,Ic as getRepoRoutingSignals,jg as getRequiredToolParams,Q as getRuntimeModelProvider,S as getRuntimeModelProviderNames,xb as getSessionLineagePath,yb as getSessionMessagesFromLineage,Fc as getSymbolContext,Yf as getTool,Zf as getToolDefinition,$f as getToolRegistrations,Oc as getToolResultPolicy,Mh as getWorkflowPatternTemplate,Mf as goalTokenDelta,id as hasPendingSwap,ea as inferImageMediaType,Ad as inferTaskType,fa as inferVideoMediaType,fc as inspectEditFailure,Bc as inspectRepoIntelligenceRuntime,I as isCustomProviderName,Wg as isDeniedRecently,V as isKnownProvider,Mg as isParallelDispatchDirective,u as isProviderConfigured,A as isProviderName,R as isRuntimeModelProviderName,nd as isSessionRecoveryCandidateError,He as isSupportedExtensionModulePath,gg as isToolFileMutation,ig as isToolMutation,hg as isToolNetworkRead,fg as isToolPlanModeAllowed,Vf as isValidTokenBudget,Fd as languageIdForPath,sf as listAll,Z as listAllModelCapabilities,of as listArtifacts,D as listBuiltinModelCapabilities,dg as listBuiltinToolDefinitions,Zd as listBuiltinWorkflows,qf as listConstructed,O as listCustomProviderModelCapabilities,lg as listToolDefinitions,kg as listTools,Lh as listWorkflowPatternTemplates,$c as loadAgentsFiles,tf as loadAgentsFromMarkdown,hh as loadAutoRules,ge as loadGeneratedWorkflowFromRun,Ue as loadHandler,uf as loadMarkdownAgentScope,be as loadSavedWorkflow,ae as loadSavedWorkflowCapsule,lb as loadValidToken,Lf as makeDisabledGoalToolsContext,i as mapLegacyReasoningModeToEffortIntent,Hg as mcpRootsFromWorkspace,Kb as mergeArtifactLedger,Za as normalizeMcpCapabilityId,la as normalizePastedImage,h as normalizeReasoningEffortValue,$d as normalizeWorkflowModule,xe as orderPromptSections,Wd as parallelInvestigation,gh as parseAutoRules,bh as parseClassifierOutput,ec as parseEditToolError,Ye as parseLlmReviewVerdict,_a as parseMcpCapabilityId,uh as parseModelSpec,k as parseReasoningEffortEnv,e as parseTimeoutSecEnvMs,Sd as parseWorkflowGeneration,kb as performOAuthLogin,qa as persistImageAsBlock,Wb as persistToolOutput,ie as preflightWorkflowCapsule,Jc as prewarmRepoIntelligenceCaches,Ld as providerResilienceConfigFromTimeouts,ra as prunePasteTmpDir,na as readAndNormalizeClipboardImage,pf as readArtifact,$e as readAuditEntries,bf as readBudget,ma as readClipboardImage,ef as readDisableState,Bh as readSpeculativeWindowFromEnv,eh as readTrustState,zd as reasoningModeToDepth,pd as reconstructMessagesWithToolGuard,nh as recordAutoModeAllow,mh as recordAutoModeBlock,yg as recordBlockerAttempt,sh as recordBreakerError,Vg as recordDenial,ug as registerCodingInvariants,Gg as registerConfiguredMcpCapabilityProvider,G as registerCustomProviders,P as registerModelProvider,jb as registerOAuthClient,Jg as registerOfficialSandboxExtension,Pa as registerPresetDispatcher,Xf as registerTool,mf as rehydrateActiveArtifacts,cf as remainingSelfModifyBudget,de as renameSavedWorkflow,rc as renderChangedScope,yc as renderImpactEstimate,vc as renderModuleContext,xc as renderProcessContext,ye as renderPromptSections,oc as renderRepoOverview,Uc as renderRetrievalResult,wc as renderSymbolContext,fe as replaceSavedWorkflow,Gd as reportLspDiagnostics,zg as resetBlockerCounter,df as resetBudget,vh as resolveClassifierModel,hd as resolveConstructedAgent,Je as resolveExtensionEntrypoint,$b as resolveKodaXManual,Y as resolveModelCapabilities,U as resolveProvider,X as resolveProviderModelDescriptors,l as resolveReasoningEffort,m as resolveReasoningEffortForModelSwitch,yd as resolveReasoningMode,Ac as resolveRepoIntelligenceMode,zc as resolveRepoIntelligenceRuntimeConfig,ld as resolveResilienceConfig,zb as resolveSessionLineageTarget,rg as resolveToolCapability,_ as resolveWireEffort,Od as resolveWorkflowGenerationTimeoutMs,Jh as resolveWorkflowIdentity,nf as revoke,Eb as rewindSessionLineage,zf as rollbackSelfModify,Ve as runAstRules,Kf as runKodaX,Ze as runLlmReview,Fg as runManagedTask,Kg as runOrchestration,qe as runWorkflowFromOptions,oe as runWorkflowModule,je as safeWorkflowArtifactName,ce as saveGeneratedWorkflow,he as saveGeneratedWorkflowFromRun,$a as searchMcpCatalog,Ef as setActiveExtensionRuntime,Ra as setAgentConfigHome,Ab as setSessionLineageActiveEntry,Of as shouldFlipBudgetLimited,Kd as shutdownDefaultLspService,Ch as speculativeRace,jf as stage,og as startKodaX,te as startManagedWorkflow,ih as stripAssistantText,Qc as stripHtmlToText,kf as testArtifact,d as timeoutSecToMs,lc as toolAskUserQuestion,hc as toolBash,uc as toolChangedDiff,tc as toolChangedScope,Yc as toolCodeSearch,dc as toolEdit,ic as toolGlob,jc as toolGrep,Nc as toolImpactEstimate,gc as toolInsertAfterAnchor,Kc as toolModuleContext,sg as toolPermission,Mc as toolProcessContext,Xb as toolRead,sc as toolRepoOverview,Zc as toolSemanticLookup,Lc as toolSymbolContext,kc as toolUndo,Xc as toolWebFetch,Wc as toolWebSearch,cc as toolWrite,Tb as truncateHead,Vb as truncateLine,Ub as truncateTail,fh as trustProjectRules,Nf as turnWallTimeDelta,Va as validateAndFixToolHistory,E as validateCustomProviderConfig,Pd as validateGeneratedWorkflowSource,wa as validateInputArtifactsForModel,Og as validateSubtaskIndependence,We as validateToolSchemaForProvider,Dg as verifyGoalCompletion,Ge as webhook,Bg as withGoalBeforeNextTurn,Cg as withGoalStopHook,bc as withManualToolBranding,fd as workerAgent,Ph as workflowStartOutcomeConsumesTurn};
@@ -1,2 +0,0 @@
1
- // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{j as a}from"./chunk-KCFVGXVK.js";import"./chunk-HP4FXMEM.js";import"./chunk-UA744TZM.js";import"./chunk-RR7W7UF6.js";import"./chunk-S4GVQO3W.js";import"./chunk-UGTK2JIJ.js";import"./chunk-ZL5CEANW.js";import"./chunk-V4WSBIXB.js";export{a as startManagedWorkflow};
@@ -1,2 +0,0 @@
1
- // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{y as a,z as b}from"./chunk-HP4FXMEM.js";import"./chunk-RR7W7UF6.js";import"./chunk-S4GVQO3W.js";import"./chunk-UGTK2JIJ.js";import"./chunk-ZL5CEANW.js";import"./chunk-V4WSBIXB.js";export{a as createWorkflowRunManager,b as getDefaultWorkflowRunManager};
@@ -1,2 +0,0 @@
1
- // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w,y as x,z as y}from"./chunk-VSWROENP.js";import"./chunk-4MIHVNB7.js";import"./chunk-KCFVGXVK.js";import"./chunk-HP4FXMEM.js";import"./chunk-LGR7ACBQ.js";import"./chunk-D6QVXQNI.js";import"./chunk-UA744TZM.js";import"./chunk-RR7W7UF6.js";import"./chunk-S4GVQO3W.js";import"./chunk-UGTK2JIJ.js";import"./chunk-ZL5CEANW.js";import"./chunk-V4WSBIXB.js";export{c as KODAX_CONFIG_FILE,a as KODAX_DIR,B as KODAX_EXAMPLE_CONFIG_FILE,b as KODAX_SESSIONS_DIR,i as KODAX_VERSION,d as PREVIEW_MAX_LENGTH,p as describeProviderCapabilitySummary,w as describeReasoningCapabilityControl,x as describeReasoningExecution,C as ensureExampleConfigFile,J as formatProviderCapabilityDetailLines,I as formatProviderSourceKind,q as formatReasoningCapabilityShort,r as formatReasoningEffortForDisplay,u as formatReasoningEffortStatusLabel,H as getGitRoot,k as getProviderAvailableModels,m as getProviderCapabilityProfile,n as getProviderCapabilitySnapshot,K as getProviderCommonPolicyScenarios,y as getProviderList,j as getProviderModel,o as getProviderPolicyDecision,l as getProviderReasoningCapability,t as getProviderReasoningEffortCycle,s as getProviderReasoningEffortOptions,h as getVersion,e as hydrateProcessEnvFromShell,z as isProviderConfigured,A as loadConfig,D as prepareRuntimeConfig,L as rateLimitedCall,g as registerConfiguredCustomProviders,f as resetShellEnvironmentHydrationForTesting,F as resolveInitialEffortOverride,G as resolvePermissionModeEffort,v as resolveProviderReasoningRuntimeEffort,E as saveConfig};
@@ -1,280 +0,0 @@
1
- import { a as BashPrefixExtractor } from './bash-prefix-extractor.d-CZW9fRoa.js';
2
- import { aa as KodaXSessionData, af as KodaXSessionLineage, ai as KodaXSessionNavigationOptions, ak as KodaXSessionRuntimeInfo, am as KodaXSessionStorage } from './process.d-CY2g03Mb.js';
3
-
4
- /**
5
- * Permission Types
6
- */
7
-
8
- /**
9
- * Permission mode
10
- * - plan: Read-only planning, all modifications blocked unless explicitly whitelisted
11
- * - accept-edits: File edits auto-approved, shell commands require confirmation
12
- * - auto: All tools auto-approved (with optional LLM classifier review when
13
- * auto-mode engine === 'llm'; FEATURE_092 v0.7.33). When engine === 'rules',
14
- * falls back to the legacy "all tools approved within project, outside
15
- * requires confirmation" behavior — i.e., the v0.7.32 `auto-in-project`
16
- * shape. The `auto-in-project` name is preserved as a deprecated alias
17
- * for 5 minor versions (removed in v0.7.38).
18
- */
19
- type PermissionMode = "plan" | "accept-edits" | "auto" | "auto-in-project";
20
- declare const PERMISSION_MODES: PermissionMode[];
21
- /**
22
- * Status-bar display name for a permission mode. Title-Case short labels
23
- * (mirrors Claude Code's `shortTitle` convention in
24
- * `src/utils/permissions/PermissionMode.ts`):
25
- * - `plan` → `Plan`
26
- * - `accept-edits` → `Edits`
27
- * - `auto` → `Auto`
28
- * - `auto-in-project` → `Auto` (deprecated alias folds into the canonical
29
- * display name; the deprecation notice
30
- * surfaces once per session at startup)
31
- *
32
- * Single source of truth — both the readline status-bar
33
- * (`packages/repl/src/interactive/status-bar.ts`) and the Ink view-model
34
- * (`packages/repl/src/ui/view-models/status-bar.ts`) consume this so the two
35
- * surfaces never drift on capitalization or short-form choice.
36
- */
37
- declare function permissionModeDisplayName(mode: PermissionMode): string;
38
- interface ConfirmResult {
39
- confirmed: boolean;
40
- always?: boolean;
41
- }
42
- interface PermissionContext {
43
- permissionMode: PermissionMode;
44
- confirmTools: Set<string>;
45
- gitRoot?: string;
46
- alwaysAllowTools: string[];
47
- onConfirm?: (tool: string, input: Record<string, unknown>) => Promise<ConfirmResult>;
48
- saveAlwaysAllowTool?: (tool: string, input: Record<string, unknown>, allowAll?: boolean) => void;
49
- switchPermissionMode?: (mode: PermissionMode) => void;
50
- beforeToolExecute?: (tool: string, input: Record<string, unknown>) => Promise<boolean | string>;
51
- /**
52
- * FEATURE_153 (v0.7.38) — Optional LLM-backed bash command prefix extractor.
53
- * When supplied, `isToolCallAllowed` uses it to extract the SAFE PREFIX of
54
- * a bash command before matching against allowlist patterns like
55
- * `Bash(git commit:*)`. This eliminates the pre-FEATURE_153 vulnerability
56
- * where `git commit -m "x" $(curl evil)` matched the allowlist via naive
57
- * `command.startsWith` semantics.
58
- *
59
- * KodaX REPL bootstrap creates this via `createBashPrefixExtractor` from
60
- * `@kodax-ai/coding` and threads it here. SDK consumers / tests without
61
- * LLM access can omit it; legacy startsWith semantics apply (documented
62
- * as insecure in `matchesBashPatternLegacy`).
63
- */
64
- bashPrefixExtractor?: BashPrefixExtractor;
65
- }
66
- /**
67
- * Compute the base confirmation set for each permission mode.
68
- *
69
- * Note: `plan` still lists the standard mutating tools here even though most of
70
- * them are blocked earlier in the permission pipeline via `getPlanModeBlockReason`.
71
- * This helper only describes the remaining confirmation step for calls that are
72
- * not hard-blocked.
73
- */
74
- declare function computeConfirmTools(mode: PermissionMode): Set<string>;
75
- declare function isPermissionMode(value: string | undefined): value is PermissionMode;
76
- declare function normalizePermissionMode(value: string | undefined, fallback?: PermissionMode): PermissionMode | undefined;
77
-
78
- /**
79
- * Session Storage - Session storage abstraction layer
80
- *
81
- * Provides a shared persistence interface across memory and filesystem storage.
82
- */
83
-
84
- /**
85
- * Session data structure.
86
- */
87
- type SessionData = KodaXSessionData;
88
- /**
89
- * Session storage interface.
90
- */
91
- interface SessionStorage {
92
- save(id: string, data: SessionData): Promise<void>;
93
- load(id: string): Promise<SessionData | null>;
94
- getLineage?(id: string): Promise<KodaXSessionLineage | null>;
95
- setActiveEntry?(id: string, selector: string, options?: KodaXSessionNavigationOptions): Promise<SessionData | null>;
96
- setLabel?(id: string, selector: string, label?: string): Promise<SessionData | null>;
97
- rewind?(id: string, selector?: string): Promise<SessionData | null>;
98
- fork?(id: string, selector?: string, options?: {
99
- sessionId?: string;
100
- title?: string;
101
- }): Promise<{
102
- sessionId: string;
103
- data: SessionData;
104
- } | null>;
105
- list(gitRoot?: string): Promise<Array<{
106
- id: string;
107
- title: string;
108
- msgCount: number;
109
- tag?: string;
110
- runtimeInfo?: KodaXSessionRuntimeInfo;
111
- }>>;
112
- delete?(id: string): Promise<void>;
113
- deleteAll?(gitRoot?: string): Promise<void>;
114
- }
115
- /**
116
- * In-memory session storage implementation.
117
- */
118
- declare class MemorySessionStorage implements SessionStorage {
119
- private sessions;
120
- save(id: string, data: SessionData): Promise<void>;
121
- load(id: string): Promise<SessionData | null>;
122
- getLineage(id: string): Promise<KodaXSessionLineage | null>;
123
- setActiveEntry(id: string, selector: string, options?: KodaXSessionNavigationOptions): Promise<SessionData | null>;
124
- setLabel(id: string, selector: string, label?: string): Promise<SessionData | null>;
125
- fork(id: string, selector?: string, options?: {
126
- sessionId?: string;
127
- title?: string;
128
- }): Promise<{
129
- sessionId: string;
130
- data: SessionData;
131
- } | null>;
132
- rewind(id: string, selector?: string): Promise<SessionData | null>;
133
- list(_gitRoot?: string): Promise<Array<{
134
- id: string;
135
- title: string;
136
- msgCount: number;
137
- tag?: string;
138
- }>>;
139
- delete(id: string): Promise<void>;
140
- deleteAll(_gitRoot?: string): Promise<void>;
141
- }
142
- declare function createMemorySessionStorage(): SessionStorage;
143
-
144
- /**
145
- * KodaX session storage - filesystem implementation.
146
- */
147
-
148
- declare class FileSessionStorage implements KodaXSessionStorage {
149
- private readonly sessionsDir;
150
- /**
151
- * v0.7.46 — optional explicit project cwd for in-process embedders
152
- * (KodaX Space) serving multiple projects from a single runtime.
153
- * Threaded through `getGitRoot(this.hostCwd)` and `inspectWorkspaceRuntime({cwd: this.hostCwd})`
154
- * so the workspace-mismatch check in `load()` compares against the
155
- * project the embedder opened, NOT the embedder's startup directory.
156
- * Unset → all paths behave identically to the pre-v0.7.46 form.
157
- */
158
- private readonly hostCwd?;
159
- /**
160
- * v0.7.46 F7 — explicit opt-in for the CLI-style "[Warning] Session
161
- * project mismatch" stderr notice emitted from `load()`. Pre-v0.7.46
162
- * the gate was `!this.hostCwd` which fired whenever the embedder
163
- * hadn't supplied a cwd — but that ALSO matched SDK consumers who
164
- * don't set cwd (e.g. KodaX Space), bleeding the yellow warning into
165
- * their stdout/stderr UI channels on every cross-project load. The
166
- * v0.7.46 default is `false` — silent. CLI surfaces that want the
167
- * old behavior (warn when user resumes a session from outside its
168
- * original project) can pass `emitMismatchWarnings: true`.
169
- */
170
- private readonly emitMismatchWarnings;
171
- constructor(opts?: {
172
- sessionsDir?: string;
173
- cwd?: string;
174
- emitMismatchWarnings?: boolean;
175
- });
176
- private writeQueues;
177
- private serializedWrite;
178
- private appendState;
179
- private sessionDirCache;
180
- private projectJsonWritten;
181
- private migrationPromise?;
182
- private ensureMigrated;
183
- /** Update watermarks. Only overwrites fields the caller actually provided. */
184
- private syncAppendState;
185
- private legacyFlatPath;
186
- private legacyFlatArchivePath;
187
- private projectDir;
188
- /** Resolve (and cache) the project directory a write for `id` should land in. */
189
- private resolveWriteDir;
190
- private writeFilePath;
191
- /**
192
- * id-only locator (ADR-038 §7). Resolution order:
193
- * 1. cached project dir for this id
194
- * 2. bounded scan of project dirs: <key>/<id>.jsonl
195
- * 3. bounded scan of archived: <key>/archived/<id>.jsonl
196
- * 4. legacy flat: <sessionsDir>/<id>.jsonl
197
- * On multiple matches (only possible for pre-FEATURE_219 same-second
198
- * duplicate ids) it prefers the current process's project dir, else
199
- * returns null with a warning rather than guessing.
200
- */
201
- private resolveSessionLocation;
202
- private readSession;
203
- /** Write `<dir>/project.json` once per process per directory (best-effort). */
204
- private ensureProjectJson;
205
- private writeSessionInternal;
206
- private mergeAndWriteInternal;
207
- appendSessionDelta(id: string, data: SessionData): Promise<void>;
208
- private shouldRunMaintenance;
209
- private runMaintenance;
210
- save(id: string, data: SessionData): Promise<void>;
211
- load(id: string): Promise<SessionData | null>;
212
- getLineage(id: string): Promise<KodaXSessionLineage | null>;
213
- setActiveEntry(id: string, selector: string, options?: {
214
- summarizeCurrentBranch?: boolean;
215
- }): Promise<SessionData | null>;
216
- rewind(id: string, selector?: string): Promise<SessionData | null>;
217
- setLabel(id: string, selector: string, label?: string): Promise<SessionData | null>;
218
- fork(id: string, selector?: string, options?: {
219
- sessionId?: string;
220
- title?: string;
221
- }): Promise<{
222
- sessionId: string;
223
- data: SessionData;
224
- } | null>;
225
- /**
226
- * v0.7.46 — `opts.limit` added so SDK consumers can request more than
227
- * the legacy 10-entry cap. Default stays at 10 to preserve the
228
- * interactive REPL picker's behavior. The `public-api.ts` fast path
229
- * forwards the caller's `limit`; `deleteAll()` passes a large value
230
- * so it can enumerate ALL sessions for the gitRoot.
231
- *
232
- * v0.7.46 — return now carries `createdAt` so the fast path in
233
- * `public-api.ts` no longer silently strips it. Pre-v0.7.46 callers
234
- * that only destructured `{id, title, msgCount, runtimeInfo}` are
235
- * unaffected (extra fields are ignored).
236
- */
237
- list(gitRoot?: string, opts?: {
238
- limit?: number;
239
- includeArchived?: boolean;
240
- }): Promise<Array<{
241
- id: string;
242
- title: string;
243
- msgCount: number;
244
- tag?: string;
245
- runtimeInfo?: KodaXSessionRuntimeInfo;
246
- archived?: boolean;
247
- createdAt?: string;
248
- }>>;
249
- /**
250
- * FEATURE_219 Phase 4 — whole-session archive (ADR-038 §4). Moves the session
251
- * file together with its island sidecar into `<projectKey>/archived/`. Paired
252
- * (never orphans the sidecar). No-op + returns false for a missing session.
253
- */
254
- archive(id: string): Promise<boolean>;
255
- /** Restore an archived session back into its project directory. */
256
- unarchive(id: string): Promise<boolean>;
257
- /**
258
- * Move a session + its island sidecar between two directories. Propagates a
259
- * non-ENOENT rename error (e.g. Windows file-in-use) so a partial move is
260
- * surfaced as a failure instead of silently splitting main + sidecar.
261
- */
262
- private movePair;
263
- delete(id: string): Promise<void>;
264
- deleteAll(gitRoot?: string): Promise<void>;
265
- /**
266
- * Auto-retention: delete session files (`.jsonl` + `.archive.jsonl`) whose
267
- * mtime is older than `retentionDays`. Modeled on claudecode's
268
- * `cleanup.ts` (`unlinkIfOld`). Bounds the sessions directory so it never
269
- * accumulates unboundedly — which is what keeps `list()`'s head-read pass
270
- * fast (its cost scales with file COUNT, not size). A non-positive /
271
- * non-finite `retentionDays` disables cleanup (no-op). Best-effort: per-file
272
- * errors are swallowed so a single locked/racing file never aborts the
273
- * sweep. Returns the number of files removed. mtime-based, so the session
274
- * currently being written/resumed (fresh mtime) is never eligible.
275
- */
276
- cleanupOldSessions(retentionDays: number): Promise<number>;
277
- }
278
-
279
- export { FileSessionStorage as F, MemorySessionStorage as M, PERMISSION_MODES as P, computeConfirmTools as d, createMemorySessionStorage as e, isPermissionMode as i, normalizePermissionMode as n, permissionModeDisplayName as p };
280
- export type { ConfirmResult as C, SessionData as S, PermissionContext as a, PermissionMode as b, SessionStorage as c };