@kodax-ai/kodax 0.7.95 → 0.7.96-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +178 -1
- package/LICENSE +158 -158
- package/README.md +149 -24
- package/README_CN.md +117 -24
- package/config-templates/config.example.jsonc +2 -1
- package/config-templates/integrations/a2a.example.jsonc +91 -91
- package/config-templates/integrations/extensions.example.jsonc +7 -7
- package/config-templates/integrations/mcp.example.jsonc +16 -16
- package/dist/builtin/code-review/SKILL.md +82 -82
- package/dist/builtin/git-workflow/SKILL.md +84 -84
- package/dist/builtin/skill-creator/SKILL.md +127 -127
- package/dist/builtin/skill-creator/agents/analyzer.md +12 -12
- package/dist/builtin/skill-creator/agents/comparator.md +13 -13
- package/dist/builtin/skill-creator/agents/grader.md +13 -13
- package/dist/builtin/skill-creator/references/schemas.md +227 -227
- package/dist/builtin/skill-creator/scripts/aggregate-benchmark.d.ts +46 -46
- package/dist/builtin/skill-creator/scripts/aggregate-benchmark.js +208 -208
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.d.ts +46 -46
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.js +286 -286
- package/dist/builtin/skill-creator/scripts/compare-runs.d.ts +62 -62
- package/dist/builtin/skill-creator/scripts/compare-runs.js +330 -330
- package/dist/builtin/skill-creator/scripts/generate-review.d.ts +33 -33
- package/dist/builtin/skill-creator/scripts/generate-review.js +414 -414
- package/dist/builtin/skill-creator/scripts/grade-evals.d.ts +73 -73
- package/dist/builtin/skill-creator/scripts/grade-evals.js +402 -402
- package/dist/builtin/skill-creator/scripts/improve-description.d.ts +23 -23
- package/dist/builtin/skill-creator/scripts/improve-description.js +160 -160
- package/dist/builtin/skill-creator/scripts/init-skill.d.ts +14 -14
- package/dist/builtin/skill-creator/scripts/init-skill.js +155 -155
- package/dist/builtin/skill-creator/scripts/install-skill.d.ts +29 -29
- package/dist/builtin/skill-creator/scripts/install-skill.js +173 -173
- package/dist/builtin/skill-creator/scripts/package-skill.d.ts +38 -38
- package/dist/builtin/skill-creator/scripts/package-skill.js +121 -121
- package/dist/builtin/skill-creator/scripts/quick-validate.d.ts +8 -8
- package/dist/builtin/skill-creator/scripts/quick-validate.js +163 -163
- package/dist/builtin/skill-creator/scripts/run-eval.d.ts +66 -66
- package/dist/builtin/skill-creator/scripts/run-eval.js +353 -353
- package/dist/builtin/skill-creator/scripts/run-loop.d.ts +49 -49
- package/dist/builtin/skill-creator/scripts/run-loop.js +242 -242
- package/dist/builtin/skill-creator/scripts/run-trigger-eval.d.ts +58 -58
- package/dist/builtin/skill-creator/scripts/run-trigger-eval.js +224 -224
- package/dist/builtin/tdd/SKILL.md +56 -56
- package/dist/chunks/agent-4FABF6WK.js +2 -0
- package/dist/chunks/argument-completer-72VHB2VL.js +2 -0
- package/dist/chunks/{chunk-7JXA3533.js → chunk-4OIQZWA5.js} +223 -226
- package/dist/chunks/{chunk-BNVSKIAB.js → chunk-6BVF3HZ7.js} +136 -136
- package/dist/chunks/chunk-7JZZIFZH.js +501 -0
- package/dist/chunks/chunk-AC7Z2OIY.js +2 -0
- package/dist/chunks/{chunk-JS452J2F.js → chunk-C4KYZAFU.js} +2 -2
- package/dist/chunks/chunk-CHUPIWIF.js +251 -0
- package/dist/chunks/{chunk-C4DTUKTR.js → chunk-GYUU7XLH.js} +5 -4
- package/dist/chunks/{chunk-OK4AXDC5.js → chunk-HAX55GOQ.js} +1 -1
- package/dist/chunks/chunk-JKTJCGO2.js +418 -0
- package/dist/chunks/{chunk-O743AJ5V.js → chunk-LQYETRFK.js} +171 -175
- package/dist/chunks/{chunk-2PEDBGKN.js → chunk-LTUZTQ6W.js} +1 -1
- package/dist/chunks/chunk-LYWDUSKO.js +2 -0
- package/dist/chunks/chunk-NGH6T4FD.js +92 -0
- package/dist/chunks/{chunk-SRIJX5ZP.js → chunk-NVRWCSA5.js} +1 -1
- package/dist/chunks/chunk-O4DS7RIQ.js +384 -0
- package/dist/chunks/chunk-ORXU6OWZ.js +2 -0
- package/dist/chunks/chunk-POTW3O65.js +124 -0
- package/dist/chunks/{chunk-2TM3W3GK.js → chunk-RIQSS56Y.js} +1 -1
- package/dist/chunks/chunk-U27XKEN5.js +407 -0
- package/dist/chunks/{chunk-6ABQJUK6.js → chunk-XUX6OUCA.js} +2 -2
- package/dist/chunks/{client-JDOS3YJR.js → client-4C456K4O.js} +1 -1
- package/dist/chunks/compaction-config-3VQRDFF4.js +2 -0
- package/dist/chunks/{construction-bootstrap-YCWHHUYO.js → construction-bootstrap-AHN7EDGG.js} +1 -1
- package/dist/chunks/dist-BCBQXAGI.js +2 -0
- package/dist/chunks/dist-QK2YDWU6.js +2 -0
- package/dist/chunks/host-VIHV7ADG.js +2 -0
- package/dist/chunks/run-manager-NBVMU3KV.js +2 -0
- package/dist/chunks/utils-MEJZ2IGI.js +2 -0
- package/dist/index.d.ts +22 -21
- package/dist/index.js +7 -7
- package/dist/kodax_bootstrap.js +26 -26
- package/dist/kodax_cli.js +1905 -1882
- package/dist/native/darwin-arm64/LICENSE-APACHE.txt +13 -0
- package/dist/native/darwin-arm64/kodax-text-transaction.node +0 -0
- package/dist/native/darwin-arm64/manifest.json +16 -0
- package/dist/native/darwin-x64/LICENSE-APACHE.txt +13 -0
- package/dist/native/darwin-x64/kodax-text-transaction.node +0 -0
- package/dist/native/darwin-x64/manifest.json +16 -0
- package/dist/native/linux-arm64/LICENSE-APACHE.txt +13 -0
- package/dist/native/linux-arm64/kodax-text-transaction.node +0 -0
- package/dist/native/linux-arm64/manifest.json +16 -0
- package/dist/native/linux-x64/LICENSE-APACHE.txt +13 -0
- package/dist/native/linux-x64/kodax-text-transaction.node +0 -0
- package/dist/native/linux-x64/manifest.json +16 -0
- package/dist/native/win32-x64/LICENSE-APACHE.txt +13 -0
- package/dist/native/win32-x64/NOTICE-windows-sandbox.txt +8 -0
- package/dist/native/win32-x64/kodax-windows-sandbox.exe +0 -0
- package/dist/native/win32-x64/kodax-windows-text-transaction.node +0 -0
- package/dist/native/win32-x64/manifest.json +30 -0
- package/dist/provider-capabilities.json +108 -2
- package/dist/runtime-worker.js +1745 -1727
- package/dist/sandbox-network-broker.js +1715 -0
- package/dist/sdk-a2a.d.ts +13 -12
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-agent.d.ts +27 -18
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +107 -58
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.d.ts +4 -4
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-llm.d.ts +9 -10
- package/dist/sdk-llm.js +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 +25 -17
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-runtime.d.ts +41 -17
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-sandbox.d.ts +17 -3
- package/dist/sdk-sandbox.js +1 -1
- package/dist/sdk-session.d.ts +8 -7
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +61 -61
- package/dist/types-chunks/{base.d-vopO1rml.d.ts → base.d-COo8E2dk.d.ts} +18 -27
- package/dist/types-chunks/{bash-prefix-extractor.d-B2rxNI4L.d.ts → bash-prefix-extractor.d-DQOlA8cy.d.ts} +72 -52
- package/dist/types-chunks/{capability-learning.d-CE1tm29C.d.ts → capability-learning.d-lRPgA3Or.d.ts} +1 -1
- package/dist/types-chunks/{capsule.d-Y7QRS4J2.d.ts → capsule.d-0zxsgXg_.d.ts} +3 -3
- package/dist/types-chunks/{controller.d-BR-UVeUR.d.ts → controller.d-BTtyIIC1.d.ts} +1 -1
- package/dist/types-chunks/{controller.d-C5noq5-w.d.ts → controller.d-C7tXUcXo.d.ts} +2 -2
- package/dist/types-chunks/{guardrail.d-DqHD-61O.d.ts → guardrail.d-DKTyEHJa.d.ts} +5 -5
- package/dist/types-chunks/{history-retrieval.d-CKU8zmt_.d.ts → history-retrieval.d-CHnL99S7.d.ts} +2 -2
- package/dist/types-chunks/{public-api.d-D7fXaWW8.d.ts → public-api.d-Dx3L3W4Z.d.ts} +7 -4
- package/dist/types-chunks/{repl.d-BYDb14s6.d.ts → repl.d-mO01olIa.d.ts} +5 -5
- package/dist/types-chunks/{resolver.d-CwHUwbdE.d.ts → resolver.d-DlXPjeyx.d.ts} +38 -6
- package/dist/types-chunks/{review-inbox.d-BSgFewyj.d.ts → review-inbox.d-WDSe1nze.d.ts} +1 -1
- package/dist/types-chunks/{run-manager.d-BVJSntpS.d.ts → run-manager.d-DENbbzgR.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-CqEG84oP.d.ts → sdk-session-DYHGXXH4.d.ts} +3 -3
- package/dist/types-chunks/{shell-command-sets.d-DqaaBwhU.d.ts → shell-command-sets.d-CjFqS4dp.d.ts} +1 -1
- package/dist/types-chunks/{side-query.d-iH0P9ASy.d.ts → side-query.d-j8A3sFv_.d.ts} +2 -2
- package/dist/types-chunks/{types.d-rUOjXych.d.ts → types.d-BbZjR0Wr.d.ts} +1 -1
- package/dist/types-chunks/{types.d-CaTXAW_Q.d.ts → types.d-BkTIKdH6.d.ts} +2 -2
- package/dist/types-chunks/{types.d-C5xQEFcj.d.ts → types.d-DncLrpu_.d.ts} +4 -4
- package/dist/types-chunks/{types.d-CK9A9rpP.d.ts → types.d-Xy0f3x4i.d.ts} +9 -0
- package/dist/types-chunks/{utils.d-CWUyLiXo.d.ts → utils.d-CnxefMos.d.ts} +6 -6
- package/package.json +10 -3
- package/public_docs/README.md +130 -0
- package/public_docs/configuration/sandbox.md +289 -0
- package/public_docs/sdk/embedder-guide.md +6674 -0
- package/scripts/kodax-bin.cjs +28 -28
- package/scripts/production-env.cjs +25 -25
- package/dist/chunks/agent-XXZMXKKA.js +0 -2
- package/dist/chunks/argument-completer-KCYDGTQW.js +0 -2
- package/dist/chunks/chunk-77PNP27P.js +0 -92
- package/dist/chunks/chunk-7QBWHCIZ.js +0 -2
- package/dist/chunks/chunk-BHE66SP3.js +0 -123
- package/dist/chunks/chunk-BR2OSB2I.js +0 -722
- package/dist/chunks/chunk-DSMONSVB.js +0 -407
- package/dist/chunks/chunk-Q5VRWSKG.js +0 -418
- package/dist/chunks/chunk-XWRPOGJN.js +0 -4
- package/dist/chunks/chunk-Y5VIQBT6.js +0 -383
- package/dist/chunks/compaction-config-EGS4577X.js +0 -2
- package/dist/chunks/dist-ITTXQHRJ.js +0 -2
- package/dist/chunks/dist-KFYN3OKD.js +0 -2
- package/dist/chunks/host-VAYADIPW.js +0 -2
- package/dist/chunks/run-manager-52IJZMZJ.js +0 -2
- package/dist/chunks/utils-P7PBSL3R.js +0 -2
- package/dist/sandbox-workspace-session.js +0 -1705
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{A as Be,C as $i,D as Si,E as xi,F as rt,I as nn,K as Ai,O as Ri,Q as tn,Y as Ce,ba as Ci,c as wi,d as hi,da as Ei,ea as Ii,f as yi,fa as Ti,h as nt,i as tt,m as vi,n as ki,y as bi}from"./chunk-C4DTUKTR.js";import{a as Pi}from"./chunk-OK4AXDC5.js";import{ha as fi,ia as mi,ma as pi,oa as gi}from"./chunk-DSMONSVB.js";import{i as Jo}from"./chunk-2TM3W3GK.js";import{$ as ri,Bb as et,Db as vo,Hb as ko,Ib as ot,Va as di,Wa as ui,i as Yn,ib as Ke,n as Vr,yb as on,zb as Re}from"./chunk-Q5VRWSKG.js";import{A as ci,D as Ae,J as He,m as Qo,n as Zo,o as Fe,q as ho,r as en,s as ii,t as si,v as ai,w as Zn,x as li,y as yo}from"./chunk-JS452J2F.js";import{Lb as Zr,Nb as ei,Ob as oi,Rb as Jn,Sa as Vo,X as Qr,bd as ti,c as Yr,d as Jr,dd as le,jc as Qn,kc as Yo,nc as ni}from"./chunk-7JXA3533.js";import{C as Pr,Pa as go,Qa as De,Ra as je,ka as po,ma as Gn,ya as zn}from"./chunk-BHE66SP3.js";import{$b as Or,Gc as qo,Ia as he,Ic as Go,Ig as Xr,Ja as W,Jc as Ur,Ka as ae,La as Mr,Lc as Fr,Ld as V,Md as oe,Qa as _r,Ra as Lr,Rd as Hr,Sa as Xn,Vd as Kr,Wd as zo,Zb as Wr,Zd as Br,cg as Ue,dc as wo,dg as zr,hg as Vn,k as Bo,pc as Nr,pe as qr,qc as Dr,rc as jr,rg as Xo,t as G,uf as Gr}from"./chunk-BNVSKIAB.js";import{a}from"./chunk-ONUPGMER.js";import*as Un from"fs";import*as Fo from"path";import*as Nn from"fs";import On from"path";import i from"chalk";var rn=["plan","accept-edits","auto","auto-in-project"];function el(e){return e==="auto"||e==="auto-in-project"}a(el,"isAutoMode");function _m(e,o){return el(e)&&o==="llm"}a(_m,"isAutoLlmMode");function ol(e){switch(e){case"plan":return"Plan";case"accept-edits":return"Edits";case"auto":case"auto-in-project":return"Auto"}}a(ol,"permissionModeDisplayName");var nl='[deprecated] permissionMode "auto-in-project" is now an alias for "auto" (FEATURE_092, v0.7.33). The alias will be removed in v0.7.38 \u2014 please update ~/.kodax/config.json to use "auto".';function Lm(e=o=>{G({source:"repl:permission",level:"warn",message:o})}){let o=!1;return()=>{o||(o=!0,e(nl))}}a(Lm,"createAutoInProjectDeprecationEmitter");function sn(e){switch(e){case"plan":return new Set(["bash","write","edit","undo"]);case"accept-edits":return new Set(["bash"]);case"auto":case"auto-in-project":return new Set}}a(sn,"computeConfirmTools");function _i(e){return e!==void 0&&rn.includes(e)}a(_i,"isPermissionMode");function bo(e,o){return _i(e)?e:o}a(bo,"normalizePermissionMode");import{createHash as tl,randomUUID as rl}from"node:crypto";import qe from"node:fs";import Li from"node:path";var So=class extends Error{static{a(this,"ProviderSetupConfigConflictError")}constructor(o){super(`KodaX configuration changed while setup was open: ${o}. Re-run \`kodax setup\`.`),this.name="ProviderSetupConfigConflictError"}},Ge=class extends Error{static{a(this,"ProviderSetupInvalidConfigError")}constructor(o,n){super(`KodaX configuration cannot be safely updated: ${o}. ${n}`),this.name="ProviderSetupInvalidConfigError"}},Ui=/^[A-Za-z_][A-Za-z0-9_]*$/,il=new Set(["accesskey","apikey","accesstoken","auth","authorization","bearertoken","clientsecret","credential","key","password","privatekey","refreshtoken","secret","sig","signature","token","xapikey"]);function ze(){return Object.entries(po).filter(([,e])=>e.capabilityProfile.transport!=="cli-bridge").map(([e,o])=>({name:e,apiKeyEnv:o.apiKeyEnv,defaultModel:o.model,models:[...new Set(o.models?[o.model,...o.models.map(n=>n.id)]:[o.model])]})).sort((e,o)=>e.name===Gn?-1:o.name===Gn?1:e.name.localeCompare(o.name))}a(ze,"getProviderSetupCatalog");function Fi(e={}){let o=e.configPath??W("config.json"),n=e.catalog??ze(),t=e.environment??process.env,r=it(o);if(!r.config)return{status:"invalid-config",configPath:o,configRevision:r.revision,reason:r.error??"config.json is not a JSON object."};let s=Bi(r.config);if(s)return{status:"invalid-config",configPath:o,configRevision:r.revision,reason:s};let l=Ni(e.explicitProvider);if(l){let d=ji(r.config,l,n);return d&&(!d.requiresCredential||Di(t,d.apiKeyEnv))?Wi(o,r.revision,l):Oi(o,r.revision,l,d?.apiKeyEnv)}if(!r.exists)return{status:"needs-provider",configPath:o,configRevision:r.revision};let c=Ni(r.config.provider);if(c){let d=ji(r.config,c,n);return d?!d.requiresCredential||Di(t,d.apiKeyEnv)?Wi(o,r.revision,c):Oi(o,r.revision,c,d.apiKeyEnv):{status:"invalid-config",configPath:o,configRevision:r.revision,reason:`provider "${c}" is not a valid built-in or custom provider.`}}return{status:"needs-provider",configPath:o,configRevision:r.revision}}a(Fi,"inspectProviderSetupReadiness");function Hi(e){let o=e.configPath??W("config.json"),n=e.catalog??ze();try{return yi(o,()=>{let t=it(o);if(!t.config)throw new Ge(o,t.error??"config.json is invalid JSON.");if(t.revision!==e.expectedRevision)throw new So(o);sl(t.config,o);let r=ll(e.choice,n,t.config),s={...t.config,provider:r.provider,model:r.model,...r.customProviders?{customProviders:r.customProviders}:{}};if(it(o).revision!==e.expectedRevision)throw new So(o);return cl(o,s),{provider:r.provider,model:r.model,apiKeyEnv:r.apiKeyEnv,configPath:o}})}catch(t){throw t instanceof hi?new So(o):t}}a(Hi,"persistProviderSetupChoice");function Ki(e){let n=(e.platform??process.platform)==="win32"?`Required next step: use this provider's API key as the value of the user environment variable "${e.apiKeyEnv}" in Windows Environment Variables.`:`Required next step: use this provider's API key as the value of the environment variable "${e.apiKeyEnv}" in your shell profile.`;return[`config.json stores the environment-variable name only: "${e.apiKeyEnv}"; it never stores the API key.`,n,"KodaX cannot set this environment variable for you.","Close and restart this terminal so the environment is refreshed.","Then run `kodax` again.","Optional: run `kodax doctor` to verify local configuration without an LLM request."]}a(Ki,"providerSetupRestartInstructions");function Wi(e,o,n){return{status:"ready",configPath:e,configRevision:o,...n?{provider:n}:{}}}a(Wi,"ready");function Oi(e,o,n,t){return{status:"needs-credential",configPath:e,configRevision:o,provider:n,...t?{apiKeyEnv:t}:{}}}a(Oi,"needsCredential");function Ni(e){return typeof e=="string"&&e.trim()?e.trim():void 0}a(Ni,"normalizedString");function Di(e,o){return o!==void 0&&!!e[o]?.trim()}a(Di,"hasEnvironmentValue");function ji(e,o,n){let t=n.find(l=>l.name===o);if(t)return{apiKeyEnv:t.apiKeyEnv,requiresCredential:!0};if(Object.entries(po).find(([l])=>l===o)?.[1]?.capabilityProfile.transport==="cli-bridge")return{requiresCredential:!1};let s=al(e,o);return s?{apiKeyEnv:s.apiKeyEnv,requiresCredential:!0}:void 0}a(ji,"resolveConfiguredProvider");function sl(e,o){let n=Bi(e);if(n)throw new Ge(o,n)}a(sl,"assertCustomProvidersPreservable");function Bi(e){let o=e.customProviders;if(o===void 0)return;if(!Array.isArray(o))return"Existing customProviders must be an array; repair it before running setup.";let n=new Set;for(let t of o){let r=st(t);if(!r)return"Existing customProviders contains an invalid entry; repair it before running setup.";let s=qi(r.baseUrl);if(s)return`Existing customProviders entry "${r.name}" is unsafe: ${s}`;if(n.has(r.name))return`Existing customProviders contains duplicate name "${r.name}"; repair it before running setup.`;n.add(r.name)}}a(Bi,"existingCustomProvidersError");function al(e,o){let n=e.customProviders;if(Array.isArray(n))for(let t of n){let r=st(t);if(r?.name===o)return r}}a(al,"findValidCustomProvider");function st(e){if(!Gi(e))return;let{name:o,protocol:n,baseUrl:t,apiKeyEnv:r,model:s}=e;if(typeof o!="string"||n!=="openai"&&n!=="anthropic"||typeof t!="string"||typeof r!="string"||typeof s!="string")return;let l={...e,name:o,protocol:n,baseUrl:t,apiKeyEnv:r,model:s};try{return zn(l),Ui.test(l.apiKeyEnv)?l:void 0}catch{return}}a(st,"toValidCustomProvider");function ll(e,o,n){if(e.kind==="builtin"){let d=o.find(u=>u.name===e.provider);if(!d||!d.models.includes(e.model))throw new Error("Choose a supported built-in provider and model.");return{provider:d.name,model:e.model,apiKeyEnv:d.apiKeyEnv}}let t=at(e.provider);if(o.some(d=>d.name===t.name))throw new Error(`Custom provider name "${t.name}" conflicts with a built-in provider.`);let r=n.customProviders,s=Array.isArray(r)?r.flatMap(d=>{let u=st(d);return u?[u]:[]}):[],c=s.find(d=>d.name===t.name)?s.map(d=>d.name===t.name?t:d):[...s,t];return{provider:t.name,model:t.model,apiKeyEnv:t.apiKeyEnv,customProviders:c}}a(ll,"normalizeProviderSetupChoice");function at(e){let o={name:e.name.trim(),protocol:e.protocol,baseUrl:e.baseUrl.trim(),apiKeyEnv:e.apiKeyEnv.trim(),model:e.model.trim()},n=qi(o.baseUrl);if(n)throw new Error(n);if(zn(o),!Ui.test(o.apiKeyEnv))throw new Error("Custom provider API key environment variable name is invalid.");return o}a(at,"validateProviderSetupCustomMetadata");function qi(e){let o;try{o=new URL(e)}catch{return"Custom provider Base URL must be a valid absolute URL."}if(o.protocol!=="https:"&&o.protocol!=="http:")return"Custom provider Base URL must use http or https.";if(o.username||o.password)return"Custom provider Base URL must not contain credentials.";let n=[...o.searchParams.keys()].find(t=>il.has(t.toLowerCase().replace(/[-_.]/g,"")));return n===void 0?void 0:`Custom provider Base URL must not contain credential query parameter "${n}".`}a(qi,"customProviderEndpointError");function it(e){if(!qe.existsSync(e))return{configPath:e,revision:$o(void 0),exists:!1,config:{}};let o;try{o=qe.readFileSync(e,"utf8")}catch(n){return{configPath:e,revision:$o(void 0),exists:!0,error:n instanceof Error?n.message:"config.json cannot be read."}}try{let n=JSON.parse(o);return Gi(n)?{configPath:e,revision:$o(o),exists:!0,config:n}:{configPath:e,revision:$o(o),exists:!0,error:"config.json must contain a JSON object."}}catch(n){return{configPath:e,revision:$o(o),exists:!0,error:n instanceof Error?n.message:"config.json is invalid JSON."}}}a(it,"readConfig");function $o(e){return tl("sha256").update(e??"<missing>","utf8").digest("hex")}a($o,"revisionFor");function Gi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(Gi,"isRecord");function cl(e,o){let n=Li.dirname(e);qe.mkdirSync(n,{recursive:!0});let t=Li.join(n,`.config.${process.pid}.${rl()}.tmp`);try{qe.writeFileSync(t,`${JSON.stringify(o,null,2)}
|
|
2
|
+
import{A as Be,C as $i,D as Si,E as xi,F as rt,I as nn,K as Ai,O as Ri,Q as tn,Y as Ce,ba as Ci,c as wi,d as hi,da as Ei,ea as Ii,f as yi,fa as Ti,h as nt,i as tt,m as vi,n as ki,y as bi}from"./chunk-GYUU7XLH.js";import{a as Pi}from"./chunk-HAX55GOQ.js";import{ha as fi,ia as mi,ma as pi,oa as gi}from"./chunk-U27XKEN5.js";import{i as Jo}from"./chunk-RIQSS56Y.js";import{$ as ri,$a as ui,Db as on,Eb as Re,Gb as et,Ib as vo,Mb as ko,Nb as ot,_a as di,i as Yn,n as Vr,nb as Ke}from"./chunk-JKTJCGO2.js";import{A as ci,D as Ae,J as He,m as Qo,n as Zo,o as Fe,q as ho,r as en,s as ii,t as si,v as ai,w as Zn,x as li,y as yo}from"./chunk-C4KYZAFU.js";import{$b as Zr,Ac as Yo,Dc as ni,bc as ei,cc as oi,fc as Jn,gb as Vo,ka as Qr,p as Yr,q as Jr,rd as ti,td as le,zc as Qn}from"./chunk-4OIQZWA5.js";import{D as Pr,Ra as go,Sa as De,Ta as je,la as po,na as Gn,za as zn}from"./chunk-POTW3O65.js";import{$b as Wr,$d as Br,Ic as qo,Ka as he,Kc as Go,Kg as Xr,La as W,Lc as Ur,Ma as ae,Na as Mr,Nc as Fr,Nd as V,Od as oe,Sa as _r,Ta as Lr,Td as Hr,Ua as Xn,Xd as Kr,Yd as zo,bc as Or,eg as Ue,fc as wo,fg as zr,jg as Vn,k as Bo,rc as Nr,re as qr,sc as Dr,tc as jr,tg as Xo,v as G,wf as Gr}from"./chunk-6BVF3HZ7.js";import{a}from"./chunk-ONUPGMER.js";import*as Un from"fs";import*as Fo from"path";import*as Nn from"fs";import On from"path";import i from"chalk";var rn=["plan","accept-edits","auto","auto-in-project"];function el(e){return e==="auto"||e==="auto-in-project"}a(el,"isAutoMode");function _m(e,o){return el(e)&&o==="llm"}a(_m,"isAutoLlmMode");function ol(e){switch(e){case"plan":return"Plan";case"accept-edits":return"Edits";case"auto":case"auto-in-project":return"Auto"}}a(ol,"permissionModeDisplayName");var nl='[deprecated] permissionMode "auto-in-project" is now an alias for "auto" (FEATURE_092, v0.7.33). The alias will be removed in v0.7.38 \u2014 please update ~/.kodax/config.json to use "auto".';function Lm(e=o=>{G({source:"repl:permission",level:"warn",message:o})}){let o=!1;return()=>{o||(o=!0,e(nl))}}a(Lm,"createAutoInProjectDeprecationEmitter");function sn(e){switch(e){case"plan":return new Set(["bash","write","edit","undo"]);case"accept-edits":return new Set(["bash"]);case"auto":case"auto-in-project":return new Set}}a(sn,"computeConfirmTools");function _i(e){return e!==void 0&&rn.includes(e)}a(_i,"isPermissionMode");function bo(e,o){return _i(e)?e:o}a(bo,"normalizePermissionMode");import{createHash as tl,randomUUID as rl}from"node:crypto";import qe from"node:fs";import Li from"node:path";var So=class extends Error{static{a(this,"ProviderSetupConfigConflictError")}constructor(o){super(`KodaX configuration changed while setup was open: ${o}. Re-run \`kodax setup\`.`),this.name="ProviderSetupConfigConflictError"}},Ge=class extends Error{static{a(this,"ProviderSetupInvalidConfigError")}constructor(o,n){super(`KodaX configuration cannot be safely updated: ${o}. ${n}`),this.name="ProviderSetupInvalidConfigError"}},Ui=/^[A-Za-z_][A-Za-z0-9_]*$/,il=new Set(["accesskey","apikey","accesstoken","auth","authorization","bearertoken","clientsecret","credential","key","password","privatekey","refreshtoken","secret","sig","signature","token","xapikey"]);function ze(){return Object.entries(po).filter(([,e])=>e.capabilityProfile.transport!=="cli-bridge").map(([e,o])=>({name:e,apiKeyEnv:o.apiKeyEnv,defaultModel:o.model,models:[...new Set(o.models?[o.model,...o.models.map(n=>n.id)]:[o.model])]})).sort((e,o)=>e.name===Gn?-1:o.name===Gn?1:e.name.localeCompare(o.name))}a(ze,"getProviderSetupCatalog");function Fi(e={}){let o=e.configPath??W("config.json"),n=e.catalog??ze(),t=e.environment??process.env,r=it(o);if(!r.config)return{status:"invalid-config",configPath:o,configRevision:r.revision,reason:r.error??"config.json is not a JSON object."};let s=Bi(r.config);if(s)return{status:"invalid-config",configPath:o,configRevision:r.revision,reason:s};let l=Ni(e.explicitProvider);if(l){let d=ji(r.config,l,n);return d&&(!d.requiresCredential||Di(t,d.apiKeyEnv))?Wi(o,r.revision,l):Oi(o,r.revision,l,d?.apiKeyEnv)}if(!r.exists)return{status:"needs-provider",configPath:o,configRevision:r.revision};let c=Ni(r.config.provider);if(c){let d=ji(r.config,c,n);return d?!d.requiresCredential||Di(t,d.apiKeyEnv)?Wi(o,r.revision,c):Oi(o,r.revision,c,d.apiKeyEnv):{status:"invalid-config",configPath:o,configRevision:r.revision,reason:`provider "${c}" is not a valid built-in or custom provider.`}}return{status:"needs-provider",configPath:o,configRevision:r.revision}}a(Fi,"inspectProviderSetupReadiness");function Hi(e){let o=e.configPath??W("config.json"),n=e.catalog??ze();try{return yi(o,()=>{let t=it(o);if(!t.config)throw new Ge(o,t.error??"config.json is invalid JSON.");if(t.revision!==e.expectedRevision)throw new So(o);sl(t.config,o);let r=ll(e.choice,n,t.config),s={...t.config,provider:r.provider,model:r.model,...r.customProviders?{customProviders:r.customProviders}:{}};if(it(o).revision!==e.expectedRevision)throw new So(o);return cl(o,s),{provider:r.provider,model:r.model,apiKeyEnv:r.apiKeyEnv,configPath:o}})}catch(t){throw t instanceof hi?new So(o):t}}a(Hi,"persistProviderSetupChoice");function Ki(e){let n=(e.platform??process.platform)==="win32"?`Required next step: use this provider's API key as the value of the user environment variable "${e.apiKeyEnv}" in Windows Environment Variables.`:`Required next step: use this provider's API key as the value of the environment variable "${e.apiKeyEnv}" in your shell profile.`;return[`config.json stores the environment-variable name only: "${e.apiKeyEnv}"; it never stores the API key.`,n,"KodaX cannot set this environment variable for you.","Close and restart this terminal so the environment is refreshed.","Then run `kodax` again.","Optional: run `kodax doctor` to verify local configuration without an LLM request."]}a(Ki,"providerSetupRestartInstructions");function Wi(e,o,n){return{status:"ready",configPath:e,configRevision:o,...n?{provider:n}:{}}}a(Wi,"ready");function Oi(e,o,n,t){return{status:"needs-credential",configPath:e,configRevision:o,provider:n,...t?{apiKeyEnv:t}:{}}}a(Oi,"needsCredential");function Ni(e){return typeof e=="string"&&e.trim()?e.trim():void 0}a(Ni,"normalizedString");function Di(e,o){return o!==void 0&&!!e[o]?.trim()}a(Di,"hasEnvironmentValue");function ji(e,o,n){let t=n.find(l=>l.name===o);if(t)return{apiKeyEnv:t.apiKeyEnv,requiresCredential:!0};if(Object.entries(po).find(([l])=>l===o)?.[1]?.capabilityProfile.transport==="cli-bridge")return{requiresCredential:!1};let s=al(e,o);return s?{apiKeyEnv:s.apiKeyEnv,requiresCredential:!0}:void 0}a(ji,"resolveConfiguredProvider");function sl(e,o){let n=Bi(e);if(n)throw new Ge(o,n)}a(sl,"assertCustomProvidersPreservable");function Bi(e){let o=e.customProviders;if(o===void 0)return;if(!Array.isArray(o))return"Existing customProviders must be an array; repair it before running setup.";let n=new Set;for(let t of o){let r=st(t);if(!r)return"Existing customProviders contains an invalid entry; repair it before running setup.";let s=qi(r.baseUrl);if(s)return`Existing customProviders entry "${r.name}" is unsafe: ${s}`;if(n.has(r.name))return`Existing customProviders contains duplicate name "${r.name}"; repair it before running setup.`;n.add(r.name)}}a(Bi,"existingCustomProvidersError");function al(e,o){let n=e.customProviders;if(Array.isArray(n))for(let t of n){let r=st(t);if(r?.name===o)return r}}a(al,"findValidCustomProvider");function st(e){if(!Gi(e))return;let{name:o,protocol:n,baseUrl:t,apiKeyEnv:r,model:s}=e;if(typeof o!="string"||n!=="openai"&&n!=="anthropic"||typeof t!="string"||typeof r!="string"||typeof s!="string")return;let l={...e,name:o,protocol:n,baseUrl:t,apiKeyEnv:r,model:s};try{return zn(l),Ui.test(l.apiKeyEnv)?l:void 0}catch{return}}a(st,"toValidCustomProvider");function ll(e,o,n){if(e.kind==="builtin"){let d=o.find(u=>u.name===e.provider);if(!d||!d.models.includes(e.model))throw new Error("Choose a supported built-in provider and model.");return{provider:d.name,model:e.model,apiKeyEnv:d.apiKeyEnv}}let t=at(e.provider);if(o.some(d=>d.name===t.name))throw new Error(`Custom provider name "${t.name}" conflicts with a built-in provider.`);let r=n.customProviders,s=Array.isArray(r)?r.flatMap(d=>{let u=st(d);return u?[u]:[]}):[],c=s.find(d=>d.name===t.name)?s.map(d=>d.name===t.name?t:d):[...s,t];return{provider:t.name,model:t.model,apiKeyEnv:t.apiKeyEnv,customProviders:c}}a(ll,"normalizeProviderSetupChoice");function at(e){let o={name:e.name.trim(),protocol:e.protocol,baseUrl:e.baseUrl.trim(),apiKeyEnv:e.apiKeyEnv.trim(),model:e.model.trim()},n=qi(o.baseUrl);if(n)throw new Error(n);if(zn(o),!Ui.test(o.apiKeyEnv))throw new Error("Custom provider API key environment variable name is invalid.");return o}a(at,"validateProviderSetupCustomMetadata");function qi(e){let o;try{o=new URL(e)}catch{return"Custom provider Base URL must be a valid absolute URL."}if(o.protocol!=="https:"&&o.protocol!=="http:")return"Custom provider Base URL must use http or https.";if(o.username||o.password)return"Custom provider Base URL must not contain credentials.";let n=[...o.searchParams.keys()].find(t=>il.has(t.toLowerCase().replace(/[-_.]/g,"")));return n===void 0?void 0:`Custom provider Base URL must not contain credential query parameter "${n}".`}a(qi,"customProviderEndpointError");function it(e){if(!qe.existsSync(e))return{configPath:e,revision:$o(void 0),exists:!1,config:{}};let o;try{o=qe.readFileSync(e,"utf8")}catch(n){return{configPath:e,revision:$o(void 0),exists:!0,error:n instanceof Error?n.message:"config.json cannot be read."}}try{let n=JSON.parse(o);return Gi(n)?{configPath:e,revision:$o(o),exists:!0,config:n}:{configPath:e,revision:$o(o),exists:!0,error:"config.json must contain a JSON object."}}catch(n){return{configPath:e,revision:$o(o),exists:!0,error:n instanceof Error?n.message:"config.json is invalid JSON."}}}a(it,"readConfig");function $o(e){return tl("sha256").update(e??"<missing>","utf8").digest("hex")}a($o,"revisionFor");function Gi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(Gi,"isRecord");function cl(e,o){let n=Li.dirname(e);qe.mkdirSync(n,{recursive:!0});let t=Li.join(n,`.config.${process.pid}.${rl()}.tmp`);try{qe.writeFileSync(t,`${JSON.stringify(o,null,2)}
|
|
3
3
|
`,{encoding:"utf8",mode:384}),qe.renameSync(t,e)}catch(r){throw qe.rmSync(t,{force:!0}),r}}a(cl,"writeConfigAtomically");import{existsSync as zi,mkdirSync as dl,readFileSync as Xi,writeFileSync as ul}from"node:fs";import Xe from"node:path";var fl={core:{},mcp:{version:1,servers:{}},extensions:{version:1,paths:[]},a2a:{version:2,agents:{}}},ml=["core","mcp","extensions","a2a"];function lt(e,o){return o==="core"?Xe.join(e,"config.json"):Xe.join(e,"integrations",`${o}.json`)}a(lt,"activePath");function pl(e,o){return o==="core"?Xe.join(e,"config.example.jsonc"):Xe.join(e,"integrations",`${o}.example.jsonc`)}a(pl,"templatePath");function gl(e){let o=e.replaceAll("\\","/");return ml.flatMap(n=>[{domain:n,kind:"active",path:lt(e,n),content:`${JSON.stringify(fl[n],null,2)}
|
|
4
4
|
`},{domain:n,kind:"template",path:pl(e,n),content:wi(n).replaceAll("~/.kodax",o)}])}a(gl,"configFiles");function xo(e,o){if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`${o} must contain a JSON object.`);return e}a(xo,"requireRecord");function wl(e,o){let n=xo(e,"A2A config"),t=Object.keys(n).find(s=>!["version","agents","server"].includes(s));if(t)throw new Error(`A2A config contains unknown field "${t}".`);if(n.version!==1&&n.version!==2)throw new Error("A2A config version must be 1 or 2.");let r=xo(n.agents,"A2A config agents");if(n.server!==void 0&&xo(n.server,"A2A config server"),o)o(e);else if(Object.keys(r).length>0||n.server!==void 0)throw new Error("A2A config contains active declarations that require the KodaX host validator.")}a(wl,"validateA2ADocument");function hl(e,o){let n=Xi(e.path,"utf8"),t;try{t=JSON.parse(n)}catch{throw new Error(`${e.domain} config is invalid JSON.`)}e.domain==="core"?xo(t,"Core config"):e.domain==="mcp"?nt(t):e.domain==="extensions"?tt(t):wl(t,o)}a(hl,"validateActiveFile");function Vi(e,o){if(!zi(e.path))return{domain:e.domain,kind:e.kind,path:e.path,status:"missing"};if(e.kind==="template")return{domain:e.domain,kind:e.kind,path:e.path,status:"existing"};try{return hl(e,o),{domain:e.domain,kind:e.kind,path:e.path,status:"existing"}}catch(n){return{domain:e.domain,kind:e.kind,path:e.path,status:"invalid",diagnostic:n instanceof Error?n.message:`${e.domain} config is invalid.`}}}a(Vi,"existingFileResult");function yl(e){return e instanceof Error&&"code"in e&&e.code==="EEXIST"}a(yl,"isAlreadyExists");function vl(e,o){dl(Xe.dirname(e.path),{recursive:!0,mode:448});try{return ul(e.path,e.content,{encoding:"utf8",flag:"wx",mode:384}),{domain:e.domain,kind:e.kind,path:e.path,status:"created"}}catch(n){if(yl(n))return Vi(e,o);throw n}}a(vl,"createIfMissing");function kl(e){let o=lt(e,"core");if(zi(o))try{let n=xo(JSON.parse(Xi(o,"utf8")),"Core config"),t=vi(e);t.mcp.action==="create"&&nt({version:1,servers:n.mcpServers}),t.extensions.action==="create"&&tt({version:1,paths:n.extensions})}catch(n){return`Legacy integration configuration is invalid: ${n instanceof Error?n.message:"Legacy integration config is invalid."}`}}a(kl,"legacyIntegrationDiagnostic");function Yi(e={}){let o=Xe.resolve(e.configHome??he()),n=gl(o),t=n.map(s=>Vi(s,e.validateA2A));if(t.some(s=>s.status==="invalid"))return{configHome:o,files:t};let r=kl(o);if(r){let s=lt(o,"core");return t=t.map(l=>l.path===s?{...l,status:"invalid",diagnostic:r}:l),{configHome:o,files:t}}return ki({configHome:o}),{configHome:o,files:n.map(s=>vl(s,e.validateA2A))}}a(Yi,"initializeSetupConfiguration");import Ee from"node:path";var Ji=[{id:"interrupt",name:"Interrupt",description:"Interrupt the current streaming response",defaultBindings:[{key:"c",ctrl:!0}],context:"global",priority:200,category:"global",configurable:!1},{id:"showHelp",name:"Toggle Help",description:"Show or hide shortcut help when the input is empty",defaultBindings:[{key:"?"}],context:"global",priority:150,category:"global",configurable:!0},{id:"toggleThinking",name:"Cycle Reasoning Effort",description:"Cycle reasoning effort for the active model: off, low \u2026 max, auto",defaultBindings:[{key:"t",ctrl:!0}],context:"global",priority:150,category:"mode",configurable:!0},{id:"toggleTranscriptMode",name:"Toggle Transcript Mode",description:"Toggle transcript mode on or off",defaultBindings:[{key:"o",ctrl:!0}],context:"global",priority:150,category:"mode",configurable:!0},{id:"openTranscriptSearch",name:"Search Transcript",description:"Open transcript search",defaultBindings:[{key:"f",ctrl:!0}],context:"global",priority:150,category:"navigation",configurable:!0},{id:"togglePermissionMode",name:"Cycle Permissions",description:"Cycle permission mode: plan, accept-edits, auto-in-project",defaultBindings:[{key:"tab",shift:!0}],context:"global",priority:150,category:"mode",configurable:!0},{id:"toggleAgentMode",name:"Cycle Agent Mode",description:"Cycle agent mode: AMA, SA",defaultBindings:[{key:"m",meta:!0}],context:"global",priority:150,category:"mode",configurable:!0},{id:"submitInput",name:"Submit Input",description:"Submit the current input",defaultBindings:[{key:"enter"}],context:"input",priority:50,category:"global",configurable:!1},{id:"acceptCompletion",name:"Accept Completion",description:"Accept the current autocomplete suggestion",defaultBindings:[{key:"tab"}],context:"input",priority:60,category:"editing",configurable:!0},{id:"cancelInput",name:"Cancel Input",description:"Cancel or clear the current input",defaultBindings:[{key:"escape"}],context:"input",priority:70,category:"editing",configurable:!0},{id:"newline",name:"Insert Newline",description:"Insert a newline in the current input",defaultBindings:[{key:"enter",shift:!0},{key:"j",ctrl:!0}],context:"input",priority:40,category:"editing",configurable:!0},{id:"historyUp",name:"History Up",description:"Browse previous input history",defaultBindings:[{key:"up"}],context:"input",priority:30,category:"navigation",configurable:!0},{id:"historyDown",name:"History Down",description:"Browse next input history",defaultBindings:[{key:"down"}],context:"input",priority:30,category:"navigation",configurable:!0},{id:"moveLeft",name:"Move Left",description:"Move the cursor left",defaultBindings:[{key:"left"}],context:"input",priority:20,category:"navigation",configurable:!1},{id:"moveRight",name:"Move Right",description:"Move the cursor right",defaultBindings:[{key:"right"}],context:"input",priority:20,category:"navigation",configurable:!1},{id:"moveToStart",name:"Move To Start",description:"Move the cursor to the start of the line",defaultBindings:[{key:"a",ctrl:!0}],context:"input",priority:25,category:"navigation",configurable:!0},{id:"moveToEnd",name:"Move To End",description:"Move the cursor to the end of the line",defaultBindings:[{key:"e",ctrl:!0}],context:"input",priority:25,category:"navigation",configurable:!0},{id:"killLineRight",name:"Delete To End",description:"Delete from the cursor to the end of the current line",defaultBindings:[{key:"k",ctrl:!0}],context:"input",priority:25,category:"editing",configurable:!0},{id:"killLineLeft",name:"Delete To Start",description:"Delete from the start of the line to the cursor",defaultBindings:[{key:"u",ctrl:!0}],context:"input",priority:25,category:"editing",configurable:!0},{id:"deleteWordLeft",name:"Delete Word Left",description:"Delete the word before the cursor",defaultBindings:[{key:"w",ctrl:!0},{key:"backspace",meta:!0}],context:"input",priority:25,category:"editing",configurable:!0},{id:"moveLineUp",name:"Move Line Up",description:"Move to the previous visual line in multiline input",defaultBindings:[{key:"up",ctrl:!0}],context:"input",priority:20,category:"navigation",configurable:!0},{id:"moveLineDown",name:"Move Line Down",description:"Move to the next visual line in multiline input",defaultBindings:[{key:"down",ctrl:!0}],context:"input",priority:20,category:"navigation",configurable:!0},{id:"backspace",name:"Backspace",description:"Delete the previous character",defaultBindings:[{key:"backspace"}],context:"input",priority:10,category:"editing",configurable:!1},{id:"delete",name:"Delete",description:"Delete the next character",defaultBindings:[{key:"delete"}],context:"input",priority:10,category:"editing",configurable:!1}];function bl(e){let o=[];e.ctrl&&o.push("Ctrl"),e.meta&&o.push("Alt"),e.shift&&o.push("Shift");let n={tab:"Tab",escape:"Esc",enter:"Enter",backspace:"Backspace"};return o.push(n[e.key]??(e.key.length===1?e.key.toUpperCase():e.key)),o.join("+")}a(bl,"formatBinding");function ct(e){let n=Ji.find(t=>t.id===e)?.defaultBindings[0];return n?bl(n):"<unavailable>"}a(ct,"shortcut");function $l(){return Object.entries(po).filter(([,e])=>e.capabilityProfile.transport==="cli-bridge").map(([e])=>e).sort()}a($l,"defaultCliBridges");function dt(e={}){let o=Ee.resolve(e.configHome??he()),n=e.catalog??ze(),t=e.cliBridges??$l(),r=n.map(s=>` ${s.name.padEnd(18)} ${s.apiKeyEnv} (default model: ${s.defaultModel})`);return["KodaX setup guide","","Configuration files (existing files are never overwritten by setup):",` Core: ${Ee.join(o,"config.json")}`,` Annotated template: ${Ee.join(o,"config.example.jsonc")}`,` MCP: ${Ee.join(o,"integrations","mcp.json")}`,` Extensions: ${Ee.join(o,"integrations","extensions.json")}`,` A2A: ${Ee.join(o,"integrations","a2a.json")}`,` Integration templates: ${Ee.join(o,"integrations","*.example.jsonc")}`," Existing active files are validated first. If one is invalid, setup reports"," it and stops without creating or overwriting any configuration file."," The annotated core template includes `sandbox.envPass` for exact command-target"," environment passthrough; setup never stores an environment-variable value.","","Built-in API providers and credential environment variables:",...r,...t.length>0?[` CLI bridges: ${t.join(", ")} (authenticate with the provider CLI; no KodaX API-key variable)`]:[],"","Set the variable named for your provider; keep the credential out of config.json:"," Custom providers: `apiKeyEnv` is the environment-variable name stored in config.json,"," never the API key value."," Put the provider's actual API key in the value of that exact environment variable."," KodaX does not set this environment variable for you."," Windows PowerShell (persistent user variable):",' [Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "<your-key>", "User")'," macOS/Linux shell profile:",' export OPENAI_API_KEY="<your-key>"'," Obtain the key from the provider console, then close and restart the terminal."," Run `kodax doctor` to verify local configuration without sending an LLM request.","","Setup commands:"," kodax setup Initialize missing files and choose a built-in or custom provider"," kodax setup --custom Configure only a custom OpenAI/Anthropic-compatible provider"," kodax setup --help Show this guide without changing files","","Sandbox containment (optional; permission decisions still work when it is unavailable):"," `kodax setup`, first-run setup, and `/setup` check sandbox readiness once."," Windows: setup can launch the one-time UAC provisioning flow; the terminal itself"," does not need to run as Administrator. Declining UAC is non-fatal."," macOS: ASRT uses Seatbelt/sandbox-exec; install ripgrep with `brew install ripgrep`."," Linux: ASRT uses bubblewrap; install bubblewrap, socat, and ripgrep with apt,"," dnf, or pacman. KodaX never invokes sudo or a package manager automatically."," Ordinary startup and tool calls do not repeat setup reminders or trigger UAC."," Inspect/activate explicitly: `kodax sandbox doctor` / `kodax sandbox setup`."," Model-issued commands filter credential-shaped variables by default. Add exact names"," such as GH_TOKEN to user-level `sandbox.envPass` only when command access is intended."," The default list is empty; NODE_OPTIONS and BASH_ENV remain blocked."," Restart KodaX (and any persistent daemon) after changing the list or host variables."," SDK: `@kodax-ai/kodax/sandbox` exposes doctor, activation, capability metadata,"," and policy-controlled command execution independent of Auto[LLM].","","CLI basics:"," kodax Enter the interactive REPL",' kodax -p "task" Run one task and exit'," kodax -r Search and resume a saved session"," kodax -c Continue the most recent non-empty session","","Inside the REPL:"," /model [provider[/model]] List or switch provider/model"," /mode [plan|accept-edits|auto] Switch permission mode"," /effort [off|auto|low|medium|high|xhigh|max] Set reasoning depth"," /agent-mode [ama|sa|toggle] Switch AMA/SA execution"," /setup --help Show this guide","","Default shortcuts:",` ${ct("toggleThinking")} Cycle reasoning effort`,` ${ct("togglePermissionMode")} Cycle permission mode`,` ${ct("toggleAgentMode")} Cycle AMA/SA`," Tab Accept completion"," Esc Cancel or clear input"].join(`
|
|
5
5
|
`)}a(dt,"renderSetupGuide");import*as Qi from"node:readline";import ut from"chalk";async function Zi(e={}){let o=e.catalog??ze(),n=Fi({...e.configPath?{configPath:e.configPath}:{},catalog:o});if(n.status==="invalid-config")throw new Ge(n.configPath,n.reason);if(o.length===0)throw new Error("No built-in API providers are available for setup.");let t=e.interaction===void 0,r=e.interaction??Rl({input:e.input??process.stdin,output:e.output??process.stdout});try{let s=e.customOnly?"custom":await r.choose("Choose a provider. KodaX will save metadata only and will never ask for an API key.",[...o.map(u=>({value:`builtin:${u.name}`,label:`${u.name} \u2014 ${u.defaultModel} (set ${u.apiKeyEnv})`})),{value:"custom",label:"Custom OpenAI/Anthropic-compatible provider"},{value:"cancel",label:"Cancel"}]);if(!s||s==="cancel")return{status:"cancelled"};let l=s==="custom"?await xl(r):await Sl(r,o,s.slice(8));if(!l)return{status:"cancelled"};let c=Al(l,o);return await r.confirm(`Save ${c}? config.json will store the environment-variable name only. You must set that variable to the provider's API key after setup. No credential value will be written.`)?{status:"configured",selection:Hi({configPath:n.configPath,expectedRevision:n.configRevision,catalog:o,choice:l})}:{status:"cancelled"}}finally{t&&r.close?.()}}a(Zi,"runProviderSetupWizard");async function Sl(e,o,n){let t=o.find(l=>l.name===n);if(!t)throw new Error(`Unknown setup provider: ${n}`);let r=[...new Set(t.models)],s=await e.choose(`Choose a model for ${t.name}.`,r.map(l=>({value:l,label:l===t.defaultModel?`${l} (default)`:l})));return s?{kind:"builtin",provider:t.name,model:s}:void 0}a(Sl,"collectBuiltinChoice");async function xl(e){let o=await an(e,"Custom provider name (a unique local alias used by /model and config.json)");if(!o)return;let n=await e.choose("Protocol family (check the provider API documentation for OpenAI or Anthropic compatibility)",[{value:"openai",label:"OpenAI-compatible"},{value:"anthropic",label:"Anthropic-compatible"}]);if(n!=="openai"&&n!=="anthropic")return;let t=await an(e,"API Base URL from the provider documentation, for example https://example.com/v1");if(!t)return;let r=await an(e,["Environment-variable name only (for example MY_PROVIDER_API_KEY).","Do not paste an API key here.","config.json stores this name only.","After setup, set this environment variable's value to this provider's API key."].join(" "));if(!r)return;let s=await an(e,"Model identifier from the provider documentation, for example provider/model-name");if(s)return{kind:"custom",provider:at({name:o,protocol:n,baseUrl:t,apiKeyEnv:r,model:s})}}a(xl,"collectCustomChoice");async function an(e,o){let t=(await e.text(o))?.trim();return t||void 0}a(an,"requiredText");function Al(e,o){if(e.kind==="custom"){let t=e.provider;return`provider=${t.name}, protocol=${t.protocol}, baseUrl=${t.baseUrl}, model=${t.model}, apiKeyEnv=${t.apiKeyEnv}`}let n=o.find(t=>t.name===e.provider);return`provider=${e.provider}, model=${e.model}, apiKeyEnv=${n?.apiKeyEnv??"<unknown>"}`}a(Al,"summarizeChoice");function Rl(e){let o=Qi.createInterface({input:e.input,output:e.output}),n=!1;o.on("close",()=>{n=!0}),o.on("SIGINT",()=>o.close());let t=a(r=>new Promise((s,l)=>{let c=!1,d=a(f=>{c||(c=!0,o.removeListener("close",u),s(f))},"finish"),u=a(()=>d(void 0),"onClose");if(n){d(void 0);return}o.once("close",u);try{o.question(r,f=>d(f))}catch(f){o.removeListener("close",u),n?d(void 0):l(f)}}),"question");return{async choose(r,s){for(e.output.write(`
|
|
@@ -677,4 +677,4 @@ ${f.message}
|
|
|
677
677
|
[Skill not found: ${t}]`)),!1;console.log(i.cyan(`
|
|
678
678
|
[Invoking skill: ${t}]`)),s.argumentHint&&console.log(i.dim(`Arguments: ${r||"(none)"}`)),console.log();let l=await yt(t,r,{workingDirectory:o.runtimeInfo?.executionCwd??process.cwd(),projectRoot:o.gitRoot??void 0,sessionId:o.sessionId,environment:{},executeDynamicContext:o.skillDynamicContext?.execute,disableDynamicContext:o.skillDynamicContext?.disable});return l?(console.log(i.green(`Skill activated: ${t}`)),console.log(i.dim("The skill context has been prepared for the AI.")),console.log(),{invocation:l}):!1}catch(s){return console.log(i.red(`
|
|
679
679
|
[Error invoking skill: ${s instanceof Error?s.message:String(s)}]`)),!1}}a(hr,"executeSkillCommand");var jn=class{static{a(this,"SkillCompleter")}gitRoot;constructor(o){this.gitRoot=o}canComplete(o,n){return this.parseTrigger(o.slice(0,n))!==void 0}async getCompletions(o,n){let t=this.parseTrigger(o.slice(0,n));if(!t)return[];let r=t.partial.toLowerCase();return(await this.getSkills()).filter(l=>{let c=l.name.toLowerCase();return c.includes(r)||this.fuzzyIncludes(r,c)}).map(l=>({text:`${t.invocationPrefix}${l.name}`,display:l.name,description:this.truncateDescription(l.description),type:"skill"})).sort((l,c)=>{let d=l.display.toLowerCase().startsWith(r),u=c.display.toLowerCase().startsWith(r);return d&&!u?-1:!d&&u?1:l.display.length-c.display.length})}setGitRoot(o){this.gitRoot!==o&&(this.gitRoot=o)}parseTrigger(o){let n=o.match(/(^|\s)\/skill:([^\s]*)$/);if(n)return{partial:n[2]??"",invocationPrefix:"/skill:"};let t=o.match(/(^|\s)\/([^\s]*)$/);if(t)return{partial:t[2]??"",invocationPrefix:"/"}}async getSkills(){try{let o=V(this.gitRoot);return o.size===0&&await oe(this.gitRoot),o.listUserInvocable()}catch{return[]}}fuzzyIncludes(o,n){let t=0;for(let r=0;r<n.length&&t<o.length;r+=1)n[r]===o[t]&&(t+=1);return t===o.length}truncateDescription(o,n=50){return o.length<=n?o:o.slice(0,n-3)+"..."}};import{exec as Hf}from"node:child_process";import*as ao from"node:path";import{promisify as Kf}from"node:util";var Ba=Kf(Hf);function Bf(e){let o=e.slice(3);if(!o)return;let n=o.indexOf(" -> ");return(n===-1?o:o.slice(n+4)).replace(/^"(.*)"$/,"$1").trim()||void 0}a(Bf,"pathFromPorcelainLine");async function qa(e,o=10){try{let[{stdout:n},{stdout:t}]=await Promise.all([Ba("git rev-parse --show-toplevel",{cwd:e,windowsHide:!0}),Ba("git status --porcelain=v1 -uall",{cwd:e,windowsHide:!0})]),r=n.trim(),s=[],l=new Set;for(let c of t.split(`
|
|
680
|
-
`)){if(!c.trim())continue;let d=Bf(c);if(!d)continue;let u=ao.resolve(r,d),f=ao.relative(e,u).split(ao.sep).join("/");if(!(!f||f.startsWith("..")||l.has(f))&&(l.add(f),s.push(f),s.length>=o))break}return s}catch{return[]}}a(qa,"getRecentWorkingSetFiles");function lo(e){let o=e.lastIndexOf("/");if(o===-1)return-1;for(;o>0&&!/\s/.test(e[o-1]??"");)if(o=e.lastIndexOf("/",o-1),o===-1)return-1;return o}a(lo,"findCommandSlashIndex");var kr=class{static{a(this,"FileCompleter")}cwdSource;cache=new Map;cacheTimeout=5e3;recentCache=new Map;recentFilesProvider;constructor(o,n=qa){this.cwdSource=o,this.recentFilesProvider=n}canComplete(o,n){let t=o.slice(0,n),r=t.lastIndexOf("@");return!(r===-1||r>0&&!/\s/.test(t[r-1]??"")||t.slice(r+1).includes(" "))}async getCompletions(o,n){let t=o.slice(0,n),r=t.lastIndexOf("@");if(r===-1)return[];let s=t.slice(r+1),l=[],c=this.resolveCwd(),d=s.lastIndexOf("/"),u=d===-1?c:Fo.join(c,s.slice(0,d)),f=d===-1?s:s.slice(d+1);try{let k=(await this.readdir(u)).filter(b=>b.toLowerCase().startsWith(f.toLowerCase()));for(let b of k){let A=Fo.join(u,b),R=await this.isDirectory(A),v=d===-1?b:s.slice(0,d+1)+b;l.push({text:"@"+v+(R?"/":""),display:b+(R?"/":""),description:R?"directory":"file",type:"file"})}}catch{}if(d===-1){let p=await this.getRecentFiles(c),k=new Set(l.map(R=>R.text)),b=f.toLowerCase(),A=[];for(let R of p){if(f&&!Fo.basename(R).toLowerCase().startsWith(b))continue;let v="@"+R;k.has(v)||(k.add(v),A.push({text:v,display:R,description:"recent",type:"file"}))}l.unshift(...A)}return l}async getRecentFiles(o){let n=Date.now(),t=this.recentCache.get(o);if(t&&t.expiresAt>n)return t.files;let r=await this.recentFilesProvider(o);return this.recentCache.set(o,{files:r,expiresAt:Date.now()+this.cacheTimeout}),r}resolveCwd(){return typeof this.cwdSource=="function"?this.cwdSource():this.cwdSource??process.cwd()}async readdir(o){let n=Date.now(),t=this.cache.get(o);return t&&t.expiresAt>n?t.entries:(t&&this.cache.delete(o),new Promise(r=>{Un.readdir(o,(s,l)=>{s?r([]):(this.cache.set(o,{entries:l,expiresAt:Date.now()+this.cacheTimeout}),r(l))})}))}async isDirectory(o){return new Promise(n=>{Un.stat(o,(t,r)=>{n(!t&&r.isDirectory())})})}},br=class{static{a(this,"CommandCompleter")}commands;constructor(){this.commands=new Map,this.loadCommands()}loadCommands(){for(let n of so().getAll())n.userInvocable!==!1&&this.commands.set(n.name,{description:n.description,aliases:n.aliases??[]});let o=le();for(let n of o?.listCommands()??[])n.metadata?.userInvocable!==!1&&this.commands.set(n.name,{description:n.description,aliases:n.aliases??[]})}canComplete(o,n){let t=o.slice(0,n),r=lo(t);return r===-1?!1:!t.slice(r).includes(" ")}async getCompletions(o,n){let t=o.slice(0,n),r=lo(t);if(r===-1)return[];this.commands.clear(),this.loadCommands();let s=t.slice(r+1).toLowerCase(),l=[];for(let[c,d]of this.commands){this.fuzzyMatch(s,c)&&l.push({text:"/"+c,display:"/"+c,description:d.description,type:"command"});for(let u of d.aliases)u!==c&&this.fuzzyMatch(s,u)&&l.push({text:"/"+u,display:"/"+u,description:`Alias for /${c}: ${d.description}`,type:"command"})}return l}fuzzyMatch(o,n){if(!o)return!0;let t=o.toLowerCase(),r=n.toLowerCase(),s=0;for(let l=0;l<r.length&&s<t.length;l++)r[l]===t[s]&&s++;return s===t.length}};function Yv(e){let o=new kr(e),n=new jn,t=new br;return async r=>{let s=r.includes("@"),l=r.includes("/");if(!s&&!l)return[[],r];let c=[];if(l){let u=await qf(r,r.length);c.push(...u)}if(l&&n.canComplete(r,r.length)){let u=await n.getCompletions(r,r.length);c.push(...u)}if(l&&t.canComplete(r,r.length)){let u=await t.getCompletions(r,r.length);c.push(...u)}if(s&&o.canComplete(r,r.length)){let u=await o.getCompletions(r,r.length);c.push(...u)}return[c.map(u=>Gf(r,u)),r]}}a(Yv,"createCompleter");async function qf(e,o){let{ArgumentCompleter:n}=await import("./argument-completer-KCYDGTQW.js"),t=new n;return t.canComplete(e,o)?t.getCompletions(e,o):[]}a(qf,"getArgumentCompletions");function Gf(e,o){if(o.type!=="argument")return o.text;let n=lo(e);if(n!==-1&&!/\s/.test(e.slice(n)))return`${e} ${o.text}`;let r=e.match(/\S+$/)?.[0]??"";return`${r?e.slice(0,e.length-r.length):e}${o.text}`}a(Gf,"formatReadlineCompletion");import{existsSync as Fn,readdirSync as Va,readFileSync as Ya}from"node:fs";import{join as Hn}from"node:path";var zf=[{name:"plan",description:"Read-only planning mode - blocks all modifications",type:"enum"},{name:"accept-edits",description:"File edits auto-approved, bash requires confirmation",type:"enum"},{name:"auto",description:"Use auto-mode classifier for tool permissions",type:"enum"}],co=[{name:"none",description:"Disable reasoning when the model supports it",type:"enum"},{name:"auto",description:"Clear the explicit effort override",type:"enum"},{name:"low",description:"Use low reasoning effort",type:"enum"},{name:"medium",description:"Use medium reasoning effort",type:"enum"},{name:"high",description:"Use high reasoning effort",type:"enum"},{name:"xhigh",description:"Use extra-high reasoning effort",type:"enum"},{name:"max",description:"Use maximum reasoning effort",type:"enum"}];function Xf(e){if(e&&e.includes("/")){let o=e.indexOf("/"),n=e.slice(0,o),t=e.slice(o+1);if(De(n))try{return Be(n).filter(s=>!t||s.toLowerCase().includes(t.toLowerCase())).map(s=>({name:`${n}/${s}`,description:s,type:"enum"}))}catch{}return[]}return je().map(o=>({name:o,description:`Switch to ${o} provider`,type:"enum"}))}a(Xf,"getModelArgs");var $r=[{name:"workspace",description:"Inspect current workspace/runtime truth in more detail",type:"enum"},{name:"runtime",description:"Alias for workspace runtime inspection",type:"enum"},{name:"worktree",description:"Alias for workspace runtime inspection",type:"enum"}],Sr=[{name:"all",description:"Delete ALL sessions",type:"enum"}],Vf=[{name:"status",description:"Show MCP server status",type:"enum"},{name:"refresh",description:"Refresh MCP server catalogs",type:"enum"}],Yf=[{name:"status",description:"Show child-task fallback order",type:"enum"},{name:"off",description:"Disable child-task fallback providers",type:"enum"}],Jf=[{name:"llm",description:"Use LLM classifier for auto mode",type:"enum"},{name:"rules",description:"Use rules-only auto mode",type:"enum"}],Ga=[{name:"ama",description:"Use AMA agent mode",type:"enum"},{name:"sa",description:"Use single-agent mode",type:"enum"},{name:"toggle",description:"Cycle to the next agent mode",type:"enum"}],za=[{name:"on",description:"Enable logging",type:"enum"},{name:"off",description:"Disable logging",type:"enum"}],Qf=[{name:"list",description:"Summarize accepted Memory",type:"enum"},{name:"remember",description:"Remember one explicit keyed claim now",type:"enum"},{name:"forget",description:"Forget one exact accepted Memory",type:"enum"},{name:"decisions",description:"List exceptional changes that need you",type:"enum"},{name:"show",description:"Show one accepted Memory or decision",type:"enum"},{name:"approve",description:"Approve one reviewed decision",type:"enum"},{name:"reject",description:"Reject one reviewed decision",type:"enum"},{name:"doctor",description:"Diagnose the Memory pipeline",type:"enum"},{name:"open",description:"Open Memory in an external editor",type:"enum"},{name:"help",description:"Show memory help",type:"enum"}],Zf=[{name:"list",description:"List learned capabilities",type:"enum"},{name:"ready",description:"List capabilities ready for review/control",type:"enum"},{name:"pending",description:"Compatibility alias for ready capabilities",type:"enum"},{name:"show",description:"Inspect one exact learned capability",type:"enum"},{name:"review",description:"Start or restart bounded canary review",type:"enum"},{name:"trust",description:"Explicitly trust a reviewed revision",type:"enum"},{name:"reject",description:"Reject a learned capability",type:"enum"},{name:"disable",description:"Disable an active learned capability",type:"enum"},{name:"rollback",description:"Restore the previous good revision",type:"enum"},{name:"promote",description:"Promote an exact revision to the user Skill catalog",type:"enum"},{name:"help",description:"Show Learning Center help",type:"enum"}];function em(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;return t<=1?Zf:n==="help"&&t<=2?[{name:"promote",description:"Show dedicated promotion help",type:"enum"}]:n!=="promote"?[]:t<=2?[{name:"--help",description:"Show dedicated promotion help",type:"enum"}]:t<=3?[{name:"--scope",description:"Choose the formal user Skill scope",type:"enum"}]:e[2]?.toLowerCase()==="--scope"&&t<=4?[{name:"user",description:"Promote to the formal user Skill catalog",type:"enum"}]:[]}a(em,"getLearnArgs");var om=[{name:"status",description:"Show current persistent goal",type:"enum"},{name:"pause",description:"Pause the active goal",type:"enum"},{name:"resume",description:"Resume a paused goal",type:"enum"},{name:"clear",description:"Clear the current goal",type:"enum"},{name:"help",description:"Show goal help",type:"enum"},{name:"--tokens",description:"Set an optional goal token budget",type:"enum"}],nm=[{name:"show",description:"Show a captured paste by id",type:"enum"},{name:"list",description:"List captured pastes",type:"enum"}],tm=[{name:"--lean",description:"Add a minimal-diff/YAGNI review pass",type:"enum"},{name:"--workflow",description:"Review through a dynamic workflow",type:"enum"},{name:"base",description:"Review changes against the detected base branch",type:"enum"},{name:"sha",description:"Review a specific commit",type:"enum"},{name:"help",description:"Show review help",type:"enum"}],rm=[{name:"init",description:"Create AGENTS.md in the target project if absent",type:"enum"},{name:"lean",description:"Initialize or LLM-review AGENTS.md for Lean Mode guidance",type:"enum"},{name:"help",description:"Show agents help",type:"enum"}],im=[{name:"status",description:"Inspect the current repo-intelligence runtime state",type:"enum"},{name:"mode",description:"Switch repo-intelligence runtime mode",type:"enum"},{name:"trace",description:"Toggle repo-intelligence trace output",type:"enum"}],sm=[{name:"auto",description:"Let KodaX pick the best repo-intelligence engine",type:"enum"},{name:"full",description:"Prefer the full repo-intelligence engine",type:"enum"},{name:"light",description:"Use the light repo-intelligence engine",type:"enum"},{name:"off",description:"Disable repo-intelligence injection",type:"enum"}],am=[{name:"on",description:"Enable repo-intelligence trace output",type:"enum"},{name:"off",description:"Disable repo-intelligence trace output",type:"enum"},{name:"toggle",description:"Toggle repo-intelligence trace output",type:"enum"}],lm=[{name:"status",description:"Deprecated alias for /repo-intel status",type:"enum"}],cm=[{name:"list",description:"List built-in and saved workflows",type:"enum"},{name:"create",description:"Generate and run a workflow from a request",type:"enum"},{name:"runs",description:"List active and recent workflow runs",type:"enum"},{name:"show",description:"Show latest run or a specific workflow run",type:"enum"},{name:"pause",description:"Pause future child launches for a run",type:"enum"},{name:"resume",description:"Resume a paused run",type:"enum"},{name:"stop",description:"Stop an active workflow run",type:"enum"},{name:"delete",description:"Delete one persisted workflow run or generated saved capsule",type:"enum"},{name:"prune",description:"Preview or delete old terminal workflow runs",type:"enum"},{name:"rerun",description:"Rerun a run id or saved workflow name",type:"enum"},{name:"save",description:"Save a generated run as a workflow capsule",type:"enum"},{name:"rename",description:"Rename a run display name or saved workflow capsule",type:"enum"},{name:"revise",description:"Generate a revised workflow capsule",type:"enum"},{name:"help",description:"Show workflow help",type:"enum"}],dm=new Set(["show","pause","resume","stop","delete","rerun","save","rename","revise"]),um=new Set(["show","delete","rerun","save","rename","revise"]),fm=[{name:"--all",description:"Show all persisted workflow runs",type:"enum"},{name:"--limit",description:"Show at most N persisted workflow runs",type:"enum"}],mm=[{name:"--dry-run",description:"Preview cleanup without deleting runs",type:"enum"},{name:"--keep",description:"Keep the newest N terminal runs",type:"enum"},{name:"--older-than",description:"Delete terminal runs older than Nd or Nh",type:"enum"}],pm=[{name:"--force",description:"Delete stale non-terminal run records",type:"enum"},{name:"--run",description:"Treat the target as a workflow run record",type:"enum"},{name:"--saved",description:"Treat the target as a generated saved workflow capsule",type:"enum"}],gm=[".workflow.json",".ts",".mjs",".js"];function wm(e,o){switch(e){case"pause":return o==="running";case"resume":return o==="paused";case"stop":return o==="running"||o==="paused";case"delete":return o!=="running"&&o!=="paused";default:return!0}}a(wm,"workflowRunMatchesSubcommand");function Kn(e){return/^[a-zA-Z0-9._-]{1,120}$/.test(e)&&!e.startsWith(".")&&!e.includes("..")}a(Kn,"isWorkflowRunEntryName");function hm(e,o){let n=Hn(e,"workflow-metadata.json");if(Fn(n))try{let r=JSON.parse(Ya(n,"utf8"));if(typeof r=="object"&&r!==null){let s=r.displayName;if(typeof s=="string"&&Kn(s.trim()))return s.trim()}}catch{}let t=o.displayName;return typeof t=="string"&&Kn(t.trim())?t.trim():void 0}a(hm,"readWorkflowRunDisplayName");function ym(){let e=ke(process.cwd()).key,o=W("workflow-runs",e);if(!Fn(o))return[];let n=[];for(let t of Va(o)){if(!Kn(t))continue;let r=Hn(o,t,"run.json");if(Fn(r))try{let s=JSON.parse(Ya(r,"utf8")),l=typeof s.workflow=="string"?s.workflow:"?",c=typeof s.status=="string"?s.status:"?",d=typeof s.endedAt=="number"?s.endedAt:0;n.push({arg:{name:t,description:`${l} - ${c}`,type:"string"},endedAt:d});let u=hm(Hn(o,t),s);u&&u!==t&&n.push({arg:{name:u,description:`${l} alias for ${t} - ${c}`,type:"string"},endedAt:d})}catch{}}return n.sort((t,r)=>r.endedAt-t.endedAt).map(t=>t.arg)}a(ym,"getPersistedWorkflowRunIdArgs");function Bn(e){let o=He().list().filter(r=>wm(e,r.status)).map(r=>({name:r.runId,description:`${r.workflow} - ${r.status}`,type:"string"})),n=um.has(e)?ym():[],t=new Set;return[...o,...n].filter(r=>t.has(r.name)?!1:(t.add(r.name),!0))}a(Bn,"getWorkflowRunIdArgs");function vm(e){for(let o of gm)if(e.endsWith(o)){let n=e.slice(0,-o.length);return Kn(n)?n:void 0}}a(vm,"savedWorkflowNameFromFile");function Ho(e={}){let o=[{path:W("workflows"),source:"personal"},{path:Hn(process.cwd(),".kodax","workflows"),source:"project"}],n=new Map;for(let t of o)if(Fn(t.path))try{for(let r of Va(t.path)){if(e.generatedOnly===!0&&!r.endsWith(".workflow.json"))continue;let s=vm(r);s&&n.set(s,{name:s,description:`${t.source} saved workflow`,type:"enum"})}}catch{}return[...n.values()].sort((t,r)=>t.name.localeCompare(r.name))}a(Ho,"getSavedWorkflowNameArgs");function km(){let e=new Map;for(let o of Bn("rerun"))e.set(o.name,{...o,description:`recent run: ${o.description}`,type:"string"});for(let o of Ho()){let n=e.get(o.name);if(n){e.set(o.name,{...n,description:`${n.description}; also ${o.description}`});continue}e.set(o.name,{...o,description:o.description,type:"string"})}return[...e.values()]}a(km,"getWorkflowRerunArgs");function xr(e){let o=new Map;for(let n of Bn(e))o.set(n.name,{...n,description:`workflow run: ${n.description}`,type:"string"});for(let n of Ho({generatedOnly:e==="delete"})){let t=o.get(n.name);if(t){o.set(n.name,{...t,description:`${t.description}; also ${n.description}`});continue}o.set(n.name,{...n,description:n.description,type:"string"})}return[...o.values()]}a(xr,"getWorkflowRunOrSavedNameArgs");function Xa(e){let o=new Set(e.slice(1).filter(n=>n.startsWith("--")));return o.has("--saved")?Ho({generatedOnly:!0}):o.has("--run")?Bn("delete"):xr("delete")}a(Xa,"getWorkflowDeleteTargetArgs");function bm(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;if(t<=1)return[...cm,...Zo().map(r=>({name:r.name,description:r.description,type:"enum"})),...Ho()];if(n==="rerun"&&t<=2)return km();if(n==="rename"&&t<=2)return xr("rename");if(n==="delete"&&t<=2)return[...pm,...Xa(e)];if(n==="delete"&&t<=3&&e.slice(1).some(r=>r.startsWith("--")))return Xa(e);if(n==="revise"){if(t<=2)return[{name:"--replace",description:"Replace a saved workflow after confirmation",type:"enum"},...xr("revise")];if(e[1]==="--replace"&&t<=3)return Ho()}return dm.has(n)&&t<=2?Bn(n):n==="runs"&&t<=2?fm:n==="prune"&&t<=2?mm:[]}a(bm,"getWorkflowArgs");function $m(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;return t<=1?im:t>2?[]:n==="mode"?sm:n==="trace"?am:[]}a($m,"getRepoIntelArgs");var Sm=new Map([["mode",zf],["thinking",co],["think",co],["t",co],["reasoning",co],["reason",co],["effort",co],["status",$r],["info",$r],["ctx",$r],["mcp",Vf],["fallback",Yf],["auto-engine",Jf],["agent-mode",Ga],["am",Ga],["verifier-log",za],["stall-log",za],["memory",Qf],["goal",om],["paste",nm],["review",tm],["agents",rm],["delete",Sr],["rm",Sr],["del",Sr]]),xm=new Set(["model","m","provider"]),Am=new Set(["repo-intel"]),Rm=new Set(["repointel","ri"]),Cm=new Set(["workflow"]),Em=new Set(["learn"]);function Ar(e,o,n=[]){let t=e.toLowerCase();return xm.has(t)?Xf(o):Am.has(t)?$m(n):Rm.has(t)?n.length<=1?lm:[]:Cm.has(t)?bm(n):Em.has(t)?em(n):Sm.get(t)??[]}a(Ar,"getCommandArguments");var Rr=class{static{a(this,"ArgumentCompleter")}canComplete(o,n){let t=o.slice(0,n),r=lo(t);if(r===-1)return!1;let s=t.slice(r),l=s.split(/\s+/);if(l.length>=2&&l[0]!=="")return!0;let c=s.slice(1).toLowerCase();return Ar(c).length>0}async getCompletions(o,n){let t=o.slice(0,n),r=lo(t);if(r===-1)return[];let s=t.slice(r),l=s.indexOf(" "),c=(l===-1?s.slice(1):s.slice(1,l)).toLowerCase(),d=l===-1?"":s.slice(l+1),u=d?d.split(/\s+/):[""],f=u.length-1,p=u[f]??"",k=p.toLowerCase(),b=Ar(c,p,u);if(!b||b.length===0)return[];let A=new Set(u.slice(0,-1).map(v=>v.toLowerCase()));return b.filter(v=>!A.has(v.name.toLowerCase())).filter(v=>!k||v.name.includes("/")?!0:v.name.toLowerCase().includes(k)).map(v=>({text:v.name,display:v.name,description:v.description,type:"argument"})).sort((v,$)=>{if(!k)return 0;let I=v.display.toLowerCase().startsWith(k),M=$.display.toLowerCase().startsWith(k);return I&&!M?-1:!I&&M?1:v.display.length-$.display.length})}};function ck(){return new Rr}a(ck,"createArgumentCompleter");export{bt as a,B as b,Eg as c,vs as d,Ig as e,rn as f,el as g,_m as h,ol as i,Lm as j,sn as k,_i as l,bo as m,So as n,Ge as o,ze as p,Fi as q,Hi as r,Ki as s,Yi as t,Ji as u,dt as v,Zi as w,Wl as x,Dl as y,Hp as z,tg as A,jl as B,wt as C,rg as D,ig as E,fs as F,Ro as G,fg as H,yt as I,mg as J,pg as K,vg as L,kg as M,ys as N,ce as O,$s as P,Ss as Q,Wg as R,rc as S,yc as T,Og as U,mn as V,St as W,Ng as X,_s as Y,Dg as Z,jg as _,Ug as $,mw as aa,pw as ba,gw as ca,ww as da,Xs as ea,Tt as fa,Vs as ga,ke as ha,xd as ia,$w as ja,To as ka,Ot as la,Me as ma,eu as na,ou as oa,pa,Xw as qa,Vw as ra,pu as sa,qh as ta,Gh as ua,zh as va,fy as wa,my as xa,py as ya,gy as za,wy as Aa,Ca as Ba,$y as Ca,Sy as Da,Ia as Ea,xy as Fa,Ky as Ga,Ta as Ha,so as Ia,Lv as Ja,Wv as Ka,Ov as La,jn as Ma,Rr as Na,ck as Oa,lo as Pa,kr as Qa,br as Ra,Yv as Sa};
|
|
680
|
+
`)){if(!c.trim())continue;let d=Bf(c);if(!d)continue;let u=ao.resolve(r,d),f=ao.relative(e,u).split(ao.sep).join("/");if(!(!f||f.startsWith("..")||l.has(f))&&(l.add(f),s.push(f),s.length>=o))break}return s}catch{return[]}}a(qa,"getRecentWorkingSetFiles");function lo(e){let o=e.lastIndexOf("/");if(o===-1)return-1;for(;o>0&&!/\s/.test(e[o-1]??"");)if(o=e.lastIndexOf("/",o-1),o===-1)return-1;return o}a(lo,"findCommandSlashIndex");var kr=class{static{a(this,"FileCompleter")}cwdSource;cache=new Map;cacheTimeout=5e3;recentCache=new Map;recentFilesProvider;constructor(o,n=qa){this.cwdSource=o,this.recentFilesProvider=n}canComplete(o,n){let t=o.slice(0,n),r=t.lastIndexOf("@");return!(r===-1||r>0&&!/\s/.test(t[r-1]??"")||t.slice(r+1).includes(" "))}async getCompletions(o,n){let t=o.slice(0,n),r=t.lastIndexOf("@");if(r===-1)return[];let s=t.slice(r+1),l=[],c=this.resolveCwd(),d=s.lastIndexOf("/"),u=d===-1?c:Fo.join(c,s.slice(0,d)),f=d===-1?s:s.slice(d+1);try{let k=(await this.readdir(u)).filter(b=>b.toLowerCase().startsWith(f.toLowerCase()));for(let b of k){let A=Fo.join(u,b),R=await this.isDirectory(A),v=d===-1?b:s.slice(0,d+1)+b;l.push({text:"@"+v+(R?"/":""),display:b+(R?"/":""),description:R?"directory":"file",type:"file"})}}catch{}if(d===-1){let p=await this.getRecentFiles(c),k=new Set(l.map(R=>R.text)),b=f.toLowerCase(),A=[];for(let R of p){if(f&&!Fo.basename(R).toLowerCase().startsWith(b))continue;let v="@"+R;k.has(v)||(k.add(v),A.push({text:v,display:R,description:"recent",type:"file"}))}l.unshift(...A)}return l}async getRecentFiles(o){let n=Date.now(),t=this.recentCache.get(o);if(t&&t.expiresAt>n)return t.files;let r=await this.recentFilesProvider(o);return this.recentCache.set(o,{files:r,expiresAt:Date.now()+this.cacheTimeout}),r}resolveCwd(){return typeof this.cwdSource=="function"?this.cwdSource():this.cwdSource??process.cwd()}async readdir(o){let n=Date.now(),t=this.cache.get(o);return t&&t.expiresAt>n?t.entries:(t&&this.cache.delete(o),new Promise(r=>{Un.readdir(o,(s,l)=>{s?r([]):(this.cache.set(o,{entries:l,expiresAt:Date.now()+this.cacheTimeout}),r(l))})}))}async isDirectory(o){return new Promise(n=>{Un.stat(o,(t,r)=>{n(!t&&r.isDirectory())})})}},br=class{static{a(this,"CommandCompleter")}commands;constructor(){this.commands=new Map,this.loadCommands()}loadCommands(){for(let n of so().getAll())n.userInvocable!==!1&&this.commands.set(n.name,{description:n.description,aliases:n.aliases??[]});let o=le();for(let n of o?.listCommands()??[])n.metadata?.userInvocable!==!1&&this.commands.set(n.name,{description:n.description,aliases:n.aliases??[]})}canComplete(o,n){let t=o.slice(0,n),r=lo(t);return r===-1?!1:!t.slice(r).includes(" ")}async getCompletions(o,n){let t=o.slice(0,n),r=lo(t);if(r===-1)return[];this.commands.clear(),this.loadCommands();let s=t.slice(r+1).toLowerCase(),l=[];for(let[c,d]of this.commands){this.fuzzyMatch(s,c)&&l.push({text:"/"+c,display:"/"+c,description:d.description,type:"command"});for(let u of d.aliases)u!==c&&this.fuzzyMatch(s,u)&&l.push({text:"/"+u,display:"/"+u,description:`Alias for /${c}: ${d.description}`,type:"command"})}return l}fuzzyMatch(o,n){if(!o)return!0;let t=o.toLowerCase(),r=n.toLowerCase(),s=0;for(let l=0;l<r.length&&s<t.length;l++)r[l]===t[s]&&s++;return s===t.length}};function Yv(e){let o=new kr(e),n=new jn,t=new br;return async r=>{let s=r.includes("@"),l=r.includes("/");if(!s&&!l)return[[],r];let c=[];if(l){let u=await qf(r,r.length);c.push(...u)}if(l&&n.canComplete(r,r.length)){let u=await n.getCompletions(r,r.length);c.push(...u)}if(l&&t.canComplete(r,r.length)){let u=await t.getCompletions(r,r.length);c.push(...u)}if(s&&o.canComplete(r,r.length)){let u=await o.getCompletions(r,r.length);c.push(...u)}return[c.map(u=>Gf(r,u)),r]}}a(Yv,"createCompleter");async function qf(e,o){let{ArgumentCompleter:n}=await import("./argument-completer-72VHB2VL.js"),t=new n;return t.canComplete(e,o)?t.getCompletions(e,o):[]}a(qf,"getArgumentCompletions");function Gf(e,o){if(o.type!=="argument")return o.text;let n=lo(e);if(n!==-1&&!/\s/.test(e.slice(n)))return`${e} ${o.text}`;let r=e.match(/\S+$/)?.[0]??"";return`${r?e.slice(0,e.length-r.length):e}${o.text}`}a(Gf,"formatReadlineCompletion");import{existsSync as Fn,readdirSync as Va,readFileSync as Ya}from"node:fs";import{join as Hn}from"node:path";var zf=[{name:"plan",description:"Read-only planning mode - blocks all modifications",type:"enum"},{name:"accept-edits",description:"File edits auto-approved, bash requires confirmation",type:"enum"},{name:"auto",description:"Use auto-mode classifier for tool permissions",type:"enum"}],co=[{name:"none",description:"Disable reasoning when the model supports it",type:"enum"},{name:"auto",description:"Clear the explicit effort override",type:"enum"},{name:"low",description:"Use low reasoning effort",type:"enum"},{name:"medium",description:"Use medium reasoning effort",type:"enum"},{name:"high",description:"Use high reasoning effort",type:"enum"},{name:"xhigh",description:"Use extra-high reasoning effort",type:"enum"},{name:"max",description:"Use maximum reasoning effort",type:"enum"}];function Xf(e){if(e&&e.includes("/")){let o=e.indexOf("/"),n=e.slice(0,o),t=e.slice(o+1);if(De(n))try{return Be(n).filter(s=>!t||s.toLowerCase().includes(t.toLowerCase())).map(s=>({name:`${n}/${s}`,description:s,type:"enum"}))}catch{}return[]}return je().map(o=>({name:o,description:`Switch to ${o} provider`,type:"enum"}))}a(Xf,"getModelArgs");var $r=[{name:"workspace",description:"Inspect current workspace/runtime truth in more detail",type:"enum"},{name:"runtime",description:"Alias for workspace runtime inspection",type:"enum"},{name:"worktree",description:"Alias for workspace runtime inspection",type:"enum"}],Sr=[{name:"all",description:"Delete ALL sessions",type:"enum"}],Vf=[{name:"status",description:"Show MCP server status",type:"enum"},{name:"refresh",description:"Refresh MCP server catalogs",type:"enum"}],Yf=[{name:"status",description:"Show child-task fallback order",type:"enum"},{name:"off",description:"Disable child-task fallback providers",type:"enum"}],Jf=[{name:"llm",description:"Use LLM classifier for auto mode",type:"enum"},{name:"rules",description:"Use rules-only auto mode",type:"enum"}],Ga=[{name:"ama",description:"Use AMA agent mode",type:"enum"},{name:"sa",description:"Use single-agent mode",type:"enum"},{name:"toggle",description:"Cycle to the next agent mode",type:"enum"}],za=[{name:"on",description:"Enable logging",type:"enum"},{name:"off",description:"Disable logging",type:"enum"}],Qf=[{name:"list",description:"Summarize accepted Memory",type:"enum"},{name:"remember",description:"Remember one explicit keyed claim now",type:"enum"},{name:"forget",description:"Forget one exact accepted Memory",type:"enum"},{name:"decisions",description:"List exceptional changes that need you",type:"enum"},{name:"show",description:"Show one accepted Memory or decision",type:"enum"},{name:"approve",description:"Approve one reviewed decision",type:"enum"},{name:"reject",description:"Reject one reviewed decision",type:"enum"},{name:"doctor",description:"Diagnose the Memory pipeline",type:"enum"},{name:"open",description:"Open Memory in an external editor",type:"enum"},{name:"help",description:"Show memory help",type:"enum"}],Zf=[{name:"list",description:"List learned capabilities",type:"enum"},{name:"ready",description:"List capabilities ready for review/control",type:"enum"},{name:"pending",description:"Compatibility alias for ready capabilities",type:"enum"},{name:"show",description:"Inspect one exact learned capability",type:"enum"},{name:"review",description:"Start or restart bounded canary review",type:"enum"},{name:"trust",description:"Explicitly trust a reviewed revision",type:"enum"},{name:"reject",description:"Reject a learned capability",type:"enum"},{name:"disable",description:"Disable an active learned capability",type:"enum"},{name:"rollback",description:"Restore the previous good revision",type:"enum"},{name:"promote",description:"Promote an exact revision to the user Skill catalog",type:"enum"},{name:"help",description:"Show Learning Center help",type:"enum"}];function em(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;return t<=1?Zf:n==="help"&&t<=2?[{name:"promote",description:"Show dedicated promotion help",type:"enum"}]:n!=="promote"?[]:t<=2?[{name:"--help",description:"Show dedicated promotion help",type:"enum"}]:t<=3?[{name:"--scope",description:"Choose the formal user Skill scope",type:"enum"}]:e[2]?.toLowerCase()==="--scope"&&t<=4?[{name:"user",description:"Promote to the formal user Skill catalog",type:"enum"}]:[]}a(em,"getLearnArgs");var om=[{name:"status",description:"Show current persistent goal",type:"enum"},{name:"pause",description:"Pause the active goal",type:"enum"},{name:"resume",description:"Resume a paused goal",type:"enum"},{name:"clear",description:"Clear the current goal",type:"enum"},{name:"help",description:"Show goal help",type:"enum"},{name:"--tokens",description:"Set an optional goal token budget",type:"enum"}],nm=[{name:"show",description:"Show a captured paste by id",type:"enum"},{name:"list",description:"List captured pastes",type:"enum"}],tm=[{name:"--lean",description:"Add a minimal-diff/YAGNI review pass",type:"enum"},{name:"--workflow",description:"Review through a dynamic workflow",type:"enum"},{name:"base",description:"Review changes against the detected base branch",type:"enum"},{name:"sha",description:"Review a specific commit",type:"enum"},{name:"help",description:"Show review help",type:"enum"}],rm=[{name:"init",description:"Create AGENTS.md in the target project if absent",type:"enum"},{name:"lean",description:"Initialize or LLM-review AGENTS.md for Lean Mode guidance",type:"enum"},{name:"help",description:"Show agents help",type:"enum"}],im=[{name:"status",description:"Inspect the current repo-intelligence runtime state",type:"enum"},{name:"mode",description:"Switch repo-intelligence runtime mode",type:"enum"},{name:"trace",description:"Toggle repo-intelligence trace output",type:"enum"}],sm=[{name:"auto",description:"Let KodaX pick the best repo-intelligence engine",type:"enum"},{name:"full",description:"Prefer the full repo-intelligence engine",type:"enum"},{name:"light",description:"Use the light repo-intelligence engine",type:"enum"},{name:"off",description:"Disable repo-intelligence injection",type:"enum"}],am=[{name:"on",description:"Enable repo-intelligence trace output",type:"enum"},{name:"off",description:"Disable repo-intelligence trace output",type:"enum"},{name:"toggle",description:"Toggle repo-intelligence trace output",type:"enum"}],lm=[{name:"status",description:"Deprecated alias for /repo-intel status",type:"enum"}],cm=[{name:"list",description:"List built-in and saved workflows",type:"enum"},{name:"create",description:"Generate and run a workflow from a request",type:"enum"},{name:"runs",description:"List active and recent workflow runs",type:"enum"},{name:"show",description:"Show latest run or a specific workflow run",type:"enum"},{name:"pause",description:"Pause future child launches for a run",type:"enum"},{name:"resume",description:"Resume a paused run",type:"enum"},{name:"stop",description:"Stop an active workflow run",type:"enum"},{name:"delete",description:"Delete one persisted workflow run or generated saved capsule",type:"enum"},{name:"prune",description:"Preview or delete old terminal workflow runs",type:"enum"},{name:"rerun",description:"Rerun a run id or saved workflow name",type:"enum"},{name:"save",description:"Save a generated run as a workflow capsule",type:"enum"},{name:"rename",description:"Rename a run display name or saved workflow capsule",type:"enum"},{name:"revise",description:"Generate a revised workflow capsule",type:"enum"},{name:"help",description:"Show workflow help",type:"enum"}],dm=new Set(["show","pause","resume","stop","delete","rerun","save","rename","revise"]),um=new Set(["show","delete","rerun","save","rename","revise"]),fm=[{name:"--all",description:"Show all persisted workflow runs",type:"enum"},{name:"--limit",description:"Show at most N persisted workflow runs",type:"enum"}],mm=[{name:"--dry-run",description:"Preview cleanup without deleting runs",type:"enum"},{name:"--keep",description:"Keep the newest N terminal runs",type:"enum"},{name:"--older-than",description:"Delete terminal runs older than Nd or Nh",type:"enum"}],pm=[{name:"--force",description:"Delete stale non-terminal run records",type:"enum"},{name:"--run",description:"Treat the target as a workflow run record",type:"enum"},{name:"--saved",description:"Treat the target as a generated saved workflow capsule",type:"enum"}],gm=[".workflow.json",".ts",".mjs",".js"];function wm(e,o){switch(e){case"pause":return o==="running";case"resume":return o==="paused";case"stop":return o==="running"||o==="paused";case"delete":return o!=="running"&&o!=="paused";default:return!0}}a(wm,"workflowRunMatchesSubcommand");function Kn(e){return/^[a-zA-Z0-9._-]{1,120}$/.test(e)&&!e.startsWith(".")&&!e.includes("..")}a(Kn,"isWorkflowRunEntryName");function hm(e,o){let n=Hn(e,"workflow-metadata.json");if(Fn(n))try{let r=JSON.parse(Ya(n,"utf8"));if(typeof r=="object"&&r!==null){let s=r.displayName;if(typeof s=="string"&&Kn(s.trim()))return s.trim()}}catch{}let t=o.displayName;return typeof t=="string"&&Kn(t.trim())?t.trim():void 0}a(hm,"readWorkflowRunDisplayName");function ym(){let e=ke(process.cwd()).key,o=W("workflow-runs",e);if(!Fn(o))return[];let n=[];for(let t of Va(o)){if(!Kn(t))continue;let r=Hn(o,t,"run.json");if(Fn(r))try{let s=JSON.parse(Ya(r,"utf8")),l=typeof s.workflow=="string"?s.workflow:"?",c=typeof s.status=="string"?s.status:"?",d=typeof s.endedAt=="number"?s.endedAt:0;n.push({arg:{name:t,description:`${l} - ${c}`,type:"string"},endedAt:d});let u=hm(Hn(o,t),s);u&&u!==t&&n.push({arg:{name:u,description:`${l} alias for ${t} - ${c}`,type:"string"},endedAt:d})}catch{}}return n.sort((t,r)=>r.endedAt-t.endedAt).map(t=>t.arg)}a(ym,"getPersistedWorkflowRunIdArgs");function Bn(e){let o=He().list().filter(r=>wm(e,r.status)).map(r=>({name:r.runId,description:`${r.workflow} - ${r.status}`,type:"string"})),n=um.has(e)?ym():[],t=new Set;return[...o,...n].filter(r=>t.has(r.name)?!1:(t.add(r.name),!0))}a(Bn,"getWorkflowRunIdArgs");function vm(e){for(let o of gm)if(e.endsWith(o)){let n=e.slice(0,-o.length);return Kn(n)?n:void 0}}a(vm,"savedWorkflowNameFromFile");function Ho(e={}){let o=[{path:W("workflows"),source:"personal"},{path:Hn(process.cwd(),".kodax","workflows"),source:"project"}],n=new Map;for(let t of o)if(Fn(t.path))try{for(let r of Va(t.path)){if(e.generatedOnly===!0&&!r.endsWith(".workflow.json"))continue;let s=vm(r);s&&n.set(s,{name:s,description:`${t.source} saved workflow`,type:"enum"})}}catch{}return[...n.values()].sort((t,r)=>t.name.localeCompare(r.name))}a(Ho,"getSavedWorkflowNameArgs");function km(){let e=new Map;for(let o of Bn("rerun"))e.set(o.name,{...o,description:`recent run: ${o.description}`,type:"string"});for(let o of Ho()){let n=e.get(o.name);if(n){e.set(o.name,{...n,description:`${n.description}; also ${o.description}`});continue}e.set(o.name,{...o,description:o.description,type:"string"})}return[...e.values()]}a(km,"getWorkflowRerunArgs");function xr(e){let o=new Map;for(let n of Bn(e))o.set(n.name,{...n,description:`workflow run: ${n.description}`,type:"string"});for(let n of Ho({generatedOnly:e==="delete"})){let t=o.get(n.name);if(t){o.set(n.name,{...t,description:`${t.description}; also ${n.description}`});continue}o.set(n.name,{...n,description:n.description,type:"string"})}return[...o.values()]}a(xr,"getWorkflowRunOrSavedNameArgs");function Xa(e){let o=new Set(e.slice(1).filter(n=>n.startsWith("--")));return o.has("--saved")?Ho({generatedOnly:!0}):o.has("--run")?Bn("delete"):xr("delete")}a(Xa,"getWorkflowDeleteTargetArgs");function bm(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;if(t<=1)return[...cm,...Zo().map(r=>({name:r.name,description:r.description,type:"enum"})),...Ho()];if(n==="rerun"&&t<=2)return km();if(n==="rename"&&t<=2)return xr("rename");if(n==="delete"&&t<=2)return[...pm,...Xa(e)];if(n==="delete"&&t<=3&&e.slice(1).some(r=>r.startsWith("--")))return Xa(e);if(n==="revise"){if(t<=2)return[{name:"--replace",description:"Replace a saved workflow after confirmation",type:"enum"},...xr("revise")];if(e[1]==="--replace"&&t<=3)return Ho()}return dm.has(n)&&t<=2?Bn(n):n==="runs"&&t<=2?fm:n==="prune"&&t<=2?mm:[]}a(bm,"getWorkflowArgs");function $m(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;return t<=1?im:t>2?[]:n==="mode"?sm:n==="trace"?am:[]}a($m,"getRepoIntelArgs");var Sm=new Map([["mode",zf],["thinking",co],["think",co],["t",co],["reasoning",co],["reason",co],["effort",co],["status",$r],["info",$r],["ctx",$r],["mcp",Vf],["fallback",Yf],["auto-engine",Jf],["agent-mode",Ga],["am",Ga],["verifier-log",za],["stall-log",za],["memory",Qf],["goal",om],["paste",nm],["review",tm],["agents",rm],["delete",Sr],["rm",Sr],["del",Sr]]),xm=new Set(["model","m","provider"]),Am=new Set(["repo-intel"]),Rm=new Set(["repointel","ri"]),Cm=new Set(["workflow"]),Em=new Set(["learn"]);function Ar(e,o,n=[]){let t=e.toLowerCase();return xm.has(t)?Xf(o):Am.has(t)?$m(n):Rm.has(t)?n.length<=1?lm:[]:Cm.has(t)?bm(n):Em.has(t)?em(n):Sm.get(t)??[]}a(Ar,"getCommandArguments");var Rr=class{static{a(this,"ArgumentCompleter")}canComplete(o,n){let t=o.slice(0,n),r=lo(t);if(r===-1)return!1;let s=t.slice(r),l=s.split(/\s+/);if(l.length>=2&&l[0]!=="")return!0;let c=s.slice(1).toLowerCase();return Ar(c).length>0}async getCompletions(o,n){let t=o.slice(0,n),r=lo(t);if(r===-1)return[];let s=t.slice(r),l=s.indexOf(" "),c=(l===-1?s.slice(1):s.slice(1,l)).toLowerCase(),d=l===-1?"":s.slice(l+1),u=d?d.split(/\s+/):[""],f=u.length-1,p=u[f]??"",k=p.toLowerCase(),b=Ar(c,p,u);if(!b||b.length===0)return[];let A=new Set(u.slice(0,-1).map(v=>v.toLowerCase()));return b.filter(v=>!A.has(v.name.toLowerCase())).filter(v=>!k||v.name.includes("/")?!0:v.name.toLowerCase().includes(k)).map(v=>({text:v.name,display:v.name,description:v.description,type:"argument"})).sort((v,$)=>{if(!k)return 0;let I=v.display.toLowerCase().startsWith(k),M=$.display.toLowerCase().startsWith(k);return I&&!M?-1:!I&&M?1:v.display.length-$.display.length})}};function ck(){return new Rr}a(ck,"createArgumentCompleter");export{bt as a,B as b,Eg as c,vs as d,Ig as e,rn as f,el as g,_m as h,ol as i,Lm as j,sn as k,_i as l,bo as m,So as n,Ge as o,ze as p,Fi as q,Hi as r,Ki as s,Yi as t,Ji as u,dt as v,Zi as w,Wl as x,Dl as y,Hp as z,tg as A,jl as B,wt as C,rg as D,ig as E,fs as F,Ro as G,fg as H,yt as I,mg as J,pg as K,vg as L,kg as M,ys as N,ce as O,$s as P,Ss as Q,Wg as R,rc as S,yc as T,Og as U,mn as V,St as W,Ng as X,_s as Y,Dg as Z,jg as _,Ug as $,mw as aa,pw as ba,gw as ca,ww as da,Xs as ea,Tt as fa,Vs as ga,ke as ha,xd as ia,$w as ja,To as ka,Ot as la,Me as ma,eu as na,ou as oa,pa,Xw as qa,Vw as ra,pu as sa,qh as ta,Gh as ua,zh as va,fy as wa,my as xa,py as ya,gy as za,wy as Aa,Ca as Ba,$y as Ca,Sy as Da,Ia as Ea,xy as Fa,Ky as Ga,Ta as Ha,so as Ia,Lv as Ja,Wv as Ka,Ov as La,jn as Ma,Rr as Na,ck as Oa,lo as Pa,kr as Qa,br as Ra,Yv as Sa};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{a as A,b as S,c as H}from"./chunk-
|
|
2
|
+
import{a as A,b as S,c as H}from"./chunk-LTUZTQ6W.js";import{kb as N,lb as z,mb as F}from"./chunk-6BVF3HZ7.js";import"./chunk-NGH6T4FD.js";import{a as n}from"./chunk-ONUPGMER.js";import{readFile as De}from"fs/promises";import{pathToFileURL as f,fileURLToPath as Se}from"url";var ke=150,qe=1e4,Pe=3e4,xe=1500,W=500;function O(r,a,o){return r.catch(()=>{}),new Promise((c,h)=>{let w=setTimeout(()=>h(new Error(o)),a);r.then(m=>{clearTimeout(w),c(m)},m=>{clearTimeout(w),h(m)})})}n(O,"withTimeout");function Ie(r){return r.targetUri!==void 0}n(Ie,"isLocationLink");function $(r){return r?(Array.isArray(r)?r:[r]).map(o=>Ie(o)?{uri:o.targetUri,range:o.targetSelectionRange}:o):[]}n($,"normalizeLocations");function Me(r,a){if(!r)return{};if(!a)return r;let o=r;for(let c of a.split("."))if(o&&typeof o=="object"&&c in o)o=o[c];else return null;return o}n(Me,"configurationValue");function _e(r,a){let o=f(r).href;return{processId:process.pid,rootUri:o,workspaceFolders:[{name:"workspace",uri:o}],capabilities:{workspace:{configuration:!0,workspaceFolders:!0,symbol:{dynamicRegistration:!0},didChangeConfiguration:{dynamicRegistration:!0},didChangeWatchedFiles:{dynamicRegistration:!0}},textDocument:{synchronization:{dynamicRegistration:!0,didSave:!0},publishDiagnostics:{relatedInformation:!0},definition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0},hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},references:{dynamicRegistration:!0},documentSymbol:{dynamicRegistration:!0,hierarchicalDocumentSymbolSupport:!0},callHierarchy:{dynamicRegistration:!0}},window:{workDoneProgress:!0}},initializationOptions:a}}n(_e,"buildInitializeParams");async function Ee({proc:r,isClosed:a,killProcess:o,unregisterManagedChild:c,exitGraceMs:h=xe,killReapGraceMs:w=W}){return new Promise(m=>{let y=!1,R,C,k=n(()=>{R&&clearTimeout(R),C&&clearTimeout(C)},"clearTimers"),T=n(()=>{y||(y=!0,k(),r.off("close",T),c(),m(!0))},"finishClosed"),P=n(()=>{y||(y=!0,k(),r.off("close",T),m(!1))},"finishUnreaped");if(r.once("close",T),a?.()){T();return}R=setTimeout(()=>{o().catch(()=>{}).finally(()=>{y||(C=setTimeout(P,w),C.unref?.())})},h),R.unref?.()})}n(Ee,"waitForLspProcessExitOrGiveUp");async function ze(r){let{serverId:a,root:o,launch:c,debug:h}=r,w=r.initializeTimeoutMs??Pe,[m,y]=await Promise.all([import("vscode-languageserver-protocol/node"),import("vscode-languageserver-protocol")]),{createProtocolConnection:R,StreamMessageReader:C,StreamMessageWriter:k}=m,{InitializeRequest:T,InitializedNotification:P,DidChangeConfigurationNotification:G,DidOpenTextDocumentNotification:V,DidChangeTextDocumentNotification:B,PublishDiagnosticsNotification:K,DefinitionRequest:Q,HoverRequest:X,ReferencesRequest:Z,DocumentSymbolRequest:J,WorkspaceSymbolRequest:Y,ImplementationRequest:j,CallHierarchyPrepareRequest:ee,CallHierarchyIncomingCallsRequest:te,CallHierarchyOutgoingCallsRequest:ne,ShutdownRequest:ie,ExitNotification:oe}=y,u=H(c.command,c.args,{cwd:o,stdio:["pipe","pipe","pipe"],env:process.env,detached:process.platform!=="win32"},c.kind),re=F(u,{kind:`lsp:${a}`,command:c.command,args:c.args,cwd:o},{manualUnregister:!0}),v=!0,x=n(()=>{v&&(v=!1,re())},"unregisterManagedChildOnce"),U=!1;u.once("close",()=>{U=!0,x()}),u.stderr.on("data",e=>h?.(`[${a}] stderr: ${e.toString().trim()}`));let i=R(new C(u.stdout),new k(u.stdin)),I=new Map,M=new Set;i.onNotification(K.type,e=>{let t;try{t=S(Se(e.uri))}catch{return}I.set(t,e.diagnostics??[]);let s=Date.now();for(let l of M)l(t,s)}),i.onRequest("workspace/configuration",e=>(e.items??[]).map(t=>Me(c.initializationOptions,t.section))),i.onRequest("workspace/workspaceFolders",()=>[{name:"workspace",uri:f(o).href}]),i.onRequest("window/workDoneProgress/create",()=>null),i.onRequest("client/registerCapability",()=>null),i.onRequest("client/unregisterCapability",()=>null),i.listen();let L=new Promise((e,t)=>{u.once("error",s=>t(new Error(`spawn failed: ${s.message}`))),u.once("exit",s=>t(new Error(`server exited early (code ${s??"null"})`)))});try{await Promise.race([O(i.sendRequest(T.type,_e(o,c.initializationOptions)),w,`LSP initialize timed out for ${a}`),L])}catch(e){try{i.dispose()}catch{}throw await N(u),x(),e}finally{L.catch(()=>{})}i.sendNotification(P.type,{}),i.sendNotification(G.type,{settings:c.initializationOptions??{}});let _=new Map,E=new Set;async function se(e){let t=S(e),s=await De(e,"utf8"),l=A(e)??"plaintext",D=f(e).href,p=_.get(t);if(p===void 0){_.set(t,1),I.delete(t);let b=Date.now();return i.sendNotification(V.type,{textDocument:{uri:D,languageId:l,version:1,text:s}}),b}let g=p+1;_.set(t,g);let q=Date.now();return i.sendNotification(B.type,{textDocument:{uri:D,version:g},contentChanges:[{text:s}]}),q}n(se,"notifyOpenOrChange");function ae(e,t){let s=S(e);return new Promise(l=>{let D=!1,p,g=n(()=>{D||(D=!0,clearTimeout(b),p&&clearTimeout(p),M.delete(q),E.delete(g),l())},"finish"),q=n((Ce,Te)=>{Ce!==s||Te<t.afterMs||(p&&clearTimeout(p),p=setTimeout(g,ke))},"listener");M.add(q),E.add(g);let b=setTimeout(g,t.timeoutMs)})}n(ae,"waitForDiagnostics");function ce(e){return I.get(S(e))??[]}n(ce,"diagnostics");function d(e,t){return O(e,qe,`${a} ${t} timed out`)}n(d,"navTimeout");async function ue(e,t){let s={uri:f(e).href},l=await d(i.sendRequest(Q.type,{textDocument:s,position:t}),"definition");return $(l)}n(ue,"definition");async function le(e,t){let s={uri:f(e).href};return d(i.sendRequest(X.type,{textDocument:s,position:t}),"hover")}n(le,"hover");async function de(e,t){let s={uri:f(e).href};return await d(i.sendRequest(Z.type,{textDocument:s,position:t,context:{includeDeclaration:!0}}),"references")??[]}n(de,"references");async function fe(e){let t={uri:f(e).href};return await d(i.sendRequest(J.type,{textDocument:t}),"documentSymbol")??[]}n(fe,"documentSymbols");async function me(e){return await d(i.sendRequest(Y.type,{query:e}),"workspaceSymbol")??[]}n(me,"workspaceSymbols");async function pe(e,t){let s={uri:f(e).href},l=await d(i.sendRequest(j.type,{textDocument:s,position:t}),"implementation");return $(l)}n(pe,"implementation");async function ye(e,t){let s={uri:f(e).href};return await d(i.sendRequest(ee.type,{textDocument:s,position:t}),"prepareCallHierarchy")??[]}n(ye,"prepareCallHierarchy");async function ge(e){return await d(i.sendRequest(te.type,{item:e}),"incomingCalls")??[]}n(ge,"incomingCalls");async function he(e){return await d(i.sendRequest(ne.type,{item:e}),"outgoingCalls")??[]}n(he,"outgoingCalls");function we(){z(u)}n(we,"killSync");async function Re(){for(let e of[...E])e();try{await O(i.sendRequest(ie.type),2e3,"shutdown timeout"),i.sendNotification(oe.type)}catch{}try{i.dispose()}catch{}await Ee({proc:u,isClosed:n(()=>U,"isClosed"),killProcess:n(async()=>{await N(u,{forceMs:W,taskkillMs:2e3})},"killProcess"),unregisterManagedChild:x})}return n(Re,"shutdown"),{serverId:a,root:o,notifyOpenOrChange:se,waitForDiagnostics:ae,diagnostics:ce,definition:ue,hover:le,references:de,documentSymbols:fe,workspaceSymbols:me,implementation:pe,prepareCallHierarchy:ye,incomingCalls:ge,outgoingCalls:he,shutdown:Re,killSync:we}}n(ze,"createLspClient");export{ze as createLspClient,Ee as waitForLspProcessExitOrGiveUp};
|
package/dist/chunks/{construction-bootstrap-YCWHHUYO.js → construction-bootstrap-AHN7EDGG.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-U27XKEN5.js";import"./chunk-RIQSS56Y.js";import"./chunk-JKTJCGO2.js";import"./chunk-AC7Z2OIY.js";import"./chunk-C4KYZAFU.js";import{Xc as a,ad as i,hd as l,md as c}from"./chunk-4OIQZWA5.js";import"./chunk-NVRWCSA5.js";import"./chunk-LTUZTQ6W.js";import"./chunk-POTW3O65.js";import"./chunk-6BVF3HZ7.js";import"./chunk-NGH6T4FD.js";import{a as n}from"./chunk-ONUPGMER.js";var r=null;function y(e){r=e}n(y,"bindAskUserForConstruction");function p(e){return e.content?.capabilities?.tools??[]}n(p,"readDeclaredTools");var m=n(async e=>{if(!r)return"reject";let t=p(e),o=t.length>0?t.join(", "):"<none>";return await r({question:`Activate constructed tool ${e.name}@${e.version}?
|
|
3
3
|
It declares capabilities.tools = [${o}].`,allowCustomInput:!1,options:[{label:"Approve \u2014 register and make callable",description:"The tool will be added to the active tool registry and the LLM can invoke it on the next turn.",value:"approve"},{label:"Reject \u2014 do not register",description:"The artifact stays staged on disk; rerun activate_tool to retry.",value:"reject"}]})==="approve"?"approve":"reject"},"replConstructionPolicy"),v=n(async e=>{if(!r)return"reject";let t=e.llmSummary.flaggedConcerns.length>0?e.llmSummary.flaggedConcerns.map(u=>` \u2022 ${u}`).join(`
|
|
4
4
|
`):" \u2022 <none>",o=e.prevContent.instructions??"<no instructions>",s=e.nextContent.instructions??"<no instructions>",d=[`Self-modify activation: ${e.agentName}@${e.fromVersion} \u2192 ${e.toVersion}`,"",`LLM diff summary (severity=${e.llmSummary.severity}):`,` ${e.llmSummary.summary}`,"","Flagged concerns:",t,"",`Budget remaining (after approve): ${e.budgetRemaining-1}/${e.budgetLimit}`,"","\u2500\u2500 Previous instructions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",o,"\u2500\u2500 Proposed instructions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",s,"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","","The LLM summary is advisory \u2014 read the proposed instructions above before approving."].join(`
|
|
5
5
|
`);return await r({question:d,allowCustomInput:!1,options:[{label:"Approve \u2014 activate the new version on the next run",description:"Resolver swap is deferred to the next Runner.run boundary so the in-flight conversation keeps the prior reference.",value:"approve"},{label:"Reject \u2014 stay on the previous version",description:"Budget is not consumed on rejection; the staged version is left on disk for diff inspection.",value:"reject"}]})==="approve"?"approve":"reject"},"replSelfModifyAskUser");async function h(e){a({cwd:e,policy:m,selfModifyAskUser:v});let t=await i();await c();let o=await l({cwd:e});return{loaded:t.loaded,failed:t.failed,tampered:t.tampered,markdownLoaded:o.loaded,markdownFailures:o.failed}}n(h,"bootstrapConstructionRuntime");export{y as bindAskUserForConstruction,h as bootstrapConstructionRuntime};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{$,$a,A,Aa,B,Ba,C,Ca,D,Da,E,Ea,F,Fa,G,Ga,H,Ha,I,Ia,J,Ja,K,Ka,L,La,M,Ma,N,Na,O,Oa,P,Pa,Q,Qa,R,Ra,S,Sa,T,Ta,U,Ua,V,Va,W,Wa,X,Xa,Y,Ya,Z,Za,_,_a,a,aa,ab,b,ba,bb,c,ca,cb,d,da,db,e,ea,eb,f,fa,fb,g,ga,gb,h,ha,hb,i,ia,ib,j,ja,k,ka,l,la,m,ma,n,na,o,oa,p,pa,q,qa,r,ra,s,sa,t,ta,u,ua,v,va,w,wa,x,xa,y,ya,z,za}from"./chunk-POTW3O65.js";import"./chunk-ONUPGMER.js";export{$a as DEFAULT_COST_RATES,m as KODAX_API_MIN_INTERVAL,k as KODAX_CAPPED_MAX_OUTPUT_TOKENS,na as KODAX_DEFAULT_PROVIDER,y as KODAX_DEFAULT_THINKING_BUDGETS,l as KODAX_ESCALATED_MAX_OUTPUT_TOKENS,j as KODAX_MAX_TOKENS,ma as KODAX_PROVIDERS,la as KODAX_PROVIDER_SNAPSHOTS,w as KODAX_REASONING_MODE_SEQUENCE,z as KODAX_REASONING_SAFETY_RESERVE,x as KODAX_STABLE_EFFORT_INTENTS,ga as KodaXAcpProvider,ea as KodaXAnthropicCompatProvider,W as KodaXBaseProvider,d as KodaXError,g as KodaXNetworkError,fa as KodaXOpenAICompatProvider,e as KodaXProviderError,f as KodaXRateLimitError,h as KodaXReasoningEffortRejectedError,i as KodaXToolCallIdError,Q as WORKFLOW_MAX_CONCURRENCY_ABSOLUTE,P as WORKFLOW_MAX_CONCURRENCY_DEFAULT,t as addRejectedEffort,bb as calculateCost,q as capabilityCacheKey,L as clampThinkingBudget,Y as classifyStopReason,$ as classifyVerifyError,Qa as clearRuntimeModelProviders,cb as createCostTracker,Aa as createCustomProvider,F as effortToLegacyReasoningMode,O as extractHeadersFromError,gb as formatCost,hb as formatCostReport,Ta as getAvailableProviderNames,ha as getCodexCliDefaultModel,ja as getCodexCliKnownModels,ab as getCostRate,Ja as getCustomModelCapabilities,Ca as getCustomProvider,Da as getCustomProviderCapabilityProfile,Ga as getCustomProviderList,Ia as getCustomProviderModelDescriptors,Ha as getCustomProviderModels,Fa as getCustomProviderNames,J as getDefaultThinkingDepthForMode,ia as getGeminiCliDefaultModel,ka as getGeminiCliKnownModels,xa as getModelCapabilities,oa as getProvider,sa as getProviderConfiguredCapabilityProfile,ra as getProviderConfiguredReasoningCapability,Ua as getProviderCredentialEnvironmentNames,ta as getProviderList,qa as getProviderModel,wa as getProviderModelDescriptors,ua as getProviderModels,A as getReasoningCapability,s as getRejectedEfforts,T as getRunScopedConfig,Ma as getRuntimeModelProvider,Pa as getRuntimeModelProviderCredentialEnvironmentNames,Oa as getRuntimeModelProviderNames,b as getScopedProviderCredential,fb as getSummary,aa as insertCacheBoundary,ba as isCacheBoundary,Z as isCleanStop,Ea as isCustomProviderName,Sa as isKnownProvider,pa as isProviderConfigured,va as isProviderName,B as isReasoningEnabled,Na as isRuntimeModelProviderName,Xa as listAllModelCapabilities,ya as listBuiltinModelCapabilities,Ka as listCustomProviderModelCapabilities,Za as listProviderModels,ca as lowerCacheBoundaries,M as mapDepthToOpenAIReasoningEffort,E as mapLegacyReasoningModeToEffortIntent,r as narrowReasoningProfile,V as normalizeCapabilityProfile,D as normalizeReasoningEffortValue,C as normalizeReasoningRequest,G as parseReasoningEffortEnv,N as parseRetryAfter,o as parseTimeoutSecEnvMs,X as parseToolInputWithSalvage,db as recordRetry,eb as recordUsage,c as redactScopedProviderCredential,Ba as registerCustomProviders,La as registerModelProvider,u as removeCacheEntry,p as resolveLlmTimeoutConfig,Wa as resolveModelCapabilities,U as resolvePromptCacheDisabled,Ra as resolveProvider,Va as resolveProviderModelDescriptors,H as resolveReasoningEffort,I as resolveReasoningEffortForModelSwitch,K as resolveThinkingBudget,_a as resolveWireEffort,R as resolveWorkflowMaxConcurrency,_ as runVerifyCredential,a as runWithProviderCredential,S as runWithScopedConfig,v as sanitizeCapabilityCache,ib as sideQuery,da as stripCacheBoundaries,n as timeoutSecToMs,za as validateCustomProviderConfig,Ya as verifyProviderCredential};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{$ as Yj,A as xj,B as yj,C as zj,D as Aj,E as Bj,F as Cj,G as Dj,H as Ej,I as Fj,J as Gj,K as Hj,L as Ij,M as Jj,N as Kj,O as Lj,P as Mj,Q as Nj,R as Oj,S as Pj,T as Qj,U as Rj,V as Sj,W as Tj,X as Uj,Y as Vj,Z as Wj,_ as Xj,a as $,aa as Zj,b as aa,ba as _j,c as ba,ca as $j,d as oc,da as ak,e as pc,ea as bk,f as qc,fa as ck,g as dj,ga as dk,h as ej,ha as ek,i as fj,ia as fk,j as gj,ja as gk,k as hj,ka as hk,l as ij,la as ik,m as jj,ma as jk,n as kj,na as kk,o as lj,oa as lk,p as mj,q as nj,r as oj,s as pj,t as qj,u as rj,v as sj,w as tj,x as uj,y as vj,z as wj}from"./chunk-U27XKEN5.js";import{a as Og,b as Pg,c as Qg,d as Rg,e as Sg,f as Tg,g as Ug,h as Vg,i as Wg,j as Fh}from"./chunk-RIQSS56Y.js";import{$ as qg,$a as Hh,$b as Ai,A as _f,Aa as Dg,Ab as $h,Ac as $i,B as $f,Bb as ai,Bc as aj,C as ag,Cb as bi,Cc as bj,D as bg,Db as ci,E as cg,Eb as di,Fb as ei,Gb as fi,Gc as cj,Hb as gi,Ib as hi,J as dg,Jb as ii,K as eg,Kb as ji,Lb as ki,Mb as li,Nb as mi,O as fg,Ob as ni,P as gg,Pb as oi,Q as hg,Qb as pi,R as ig,Rb as qi,S as jg,Sb as ri,T as kg,Tb as si,U as lg,Ub as ti,V as mg,Vb as ui,Wb as vi,Xb as wi,Y as ng,Yb as xi,Z as og,Zb as yi,_ as pg,_a as Gh,_b as zi,aa as rg,ac as Bi,b as Kb,ba as sg,bc as Ci,c as Lb,ca as tg,cc as Di,d as Mb,dc as Ei,e as Nb,ec as Fi,f as Ob,fc as Gi,g as Pb,gc as Hi,ha as ug,hb as Ih,hc as Ii,i as Qb,ia as vg,ib as Jh,ic as Ji,j as Rb,ja as wg,jb as Kh,jc as Ki,ka as xg,kb as Lh,kc as Li,l as Sb,la as yg,lb as Mh,lc as Mi,m as Tb,mb as Nh,mc as Ni,n as Ub,nb as Oh,nc as Oi,o as fc,ob as Ph,oc as Pi,p as rc,pa as zg,pb as Qh,pc as Qi,q as sc,qa as Ag,qb as Rh,qc as Ri,r as Pf,ra as Bg,rb as Sh,rc as Si,s as Qf,sa as Cg,sb as Th,sc as Ti,t as Rf,tb as Uh,tc as Ui,u as Sf,ub as Vh,uc as Vi,v as Tf,vb as Wh,vc as Wi,w as Uf,wb as Xh,wc as Xi,xb as Yh,xc as Yi,y as Yf,yb as Zh,yc as Zi,z as Zf,zb as _h,zc as _i}from"./chunk-JKTJCGO2.js";import{a as Ng}from"./chunk-AC7Z2OIY.js";import{A as vh,B as wh,C as xh,D as yh,E as zh,F as Ah,G as Bh,H as Ch,I as Dh,J as Eh,a as Xg,b as Yg,c as Zg,d as _g,e as $g,f as ah,g as bh,h as ch,i as dh,j as eh,k as fh,l as gh,m as hh,n as ih,o as jh,p as kh,q as lh,r as mh,s as nh,t as oh,u as ph,v as qh,w as rh,x as sh,y as th,z as uh}from"./chunk-C4KYZAFU.js";import{$a as hd,$b as _d,$c as Ve,$d as Wf,Aa as Pc,Ab as Fd,Ac as ue,Ad as qf,Ba as Qc,Bb as Gd,Bc as ve,Bd as rf,Ca as Rc,Cb as Hd,Cc as we,Cd as sf,Db as Id,Dc as xe,Dd as tf,Eb as Jd,Ec as ye,Ed as uf,F as tc,Fb as Kd,Fc as ze,Fd as vf,G as uc,Gb as Ld,Gc as Ae,Gd as wf,Ha as Sc,Hb as Md,Hc as Be,Hd as xf,Ib as Nd,Ic as Ce,Id as yf,Ja as Tc,Jb as Od,Jc as De,Jd as zf,Ka as Uc,Kb as Pd,Kc as Ee,Kd as Af,Lb as Qd,Lc as Fe,Ld as Bf,Ma as Vc,Mb as Rd,Mc as Ge,Md as Cf,N as vc,Na as Wc,Nc as He,Nd as Df,O as wc,Oa as Xc,Oc as Ie,Od as Ef,P as xc,Pa as Yc,Pc as Je,Pd as Ff,Q as yc,Qa as Zc,Qb as Sd,Qc as Ke,Qd as Gf,R as zc,Rb as Td,Rc as Le,S as Ac,Sa as _c,Sb as Ud,Sc as Me,Sd as Hf,T as Bc,Ta as $c,Tb as Vd,Tc as Ne,Td as If,U as Cc,Ua as ad,Uc as Oe,Ud as Jf,V as Dc,Va as bd,Vc as Pe,Vd as Kf,W as Ec,Wa as cd,Wc as Qe,Wd as Lf,X as Fc,Xa as dd,Xb as Wd,Xc as Re,Xd as Mf,Y as Gc,Ya as ed,Yb as Xd,Yc as Se,Yd as Nf,Za as fd,Zb as Yd,Zc as Te,Zd as Of,_a as gd,_b as Zd,_c as Ue,_d as Vf,ab as id,ac as $d,ad as We,ae as Xf,bb as jd,bc as ae,bd as Xe,c as Vb,cb as kd,cc as be,cd as Ye,d as Wb,db as ld,dc as ce,dd as Ze,e as Xb,eb as md,ec as de,ed as _e,f as Yb,fb as nd,fc as ee,fd as $e,g as Zb,gb as od,gd as af,h as _b,ha as Hc,hd as bf,i as $b,ia as Ic,ic as fe,id as cf,j as ac,ja as Jc,jb as pd,jc as ge,jd as df,k as bc,ka as Kc,kb as qd,kc as he,kd as ef,l as cc,la as Lc,lb as rd,lc as ie,ld as ff,m as dc,ma as Mc,mb as sd,mc as je,md as gf,n as ec,nb as td,nc as ke,nd as hf,ne as Fg,ob as ud,od as jf,oe as Gg,p as gc,pb as vd,pd as kf,pe as Hg,q as hc,qd as lf,qe as Ig,r as ic,rb as wd,rc as le,rd as mf,re as Jg,s as jc,sb as xd,sc as me,sd as nf,t as kc,tb as yd,tc as ne,td as of,u as lc,ub as zd,uc as oe,vb as Ad,vc as pe,w as mc,wb as Bd,wc as qe,xb as Cd,xc as re,xe as Kg,y as nc,ya as Nc,yb as Dd,yc as se,ye as Lg,za as Oc,zb as Ed,zc as te,zd as pf,ze as Mg}from"./chunk-4OIQZWA5.js";import"./chunk-NVRWCSA5.js";import{a as Eg}from"./chunk-LTUZTQ6W.js";import{Aa as F,Ba as G,Ca as H,D as h,E as i,Ea as I,F as j,Fa as J,G as k,Ga as K,H as l,Ha as L,I as m,Ia as M,Ja as N,Ka as O,La as P,Ma as Q,Na as R,Oa as S,Qa as T,Ra as U,Sa as V,Ta as W,Va as X,W as n,Wa as Y,Xa as Z,_a as _,d as a,e as b,ea as o,f as c,fa as p,la as q,ma as r,n as d,na as s,o as e,oa as t,pa as u,qa as v,ra as w,sa as x,ta as y,ua as z,va as A,w as f,wa as B,x as g,xa as C,ya as D,za as E}from"./chunk-POTW3O65.js";import{$e as tb,A as qa,Ae as Ya,Be as Za,Ca as sa,Ce as _a,De as $a,Ee as ab,Ef as vb,Fe as bb,Ff as wb,Gf as xb,He as cb,Hf as yb,Ie as db,If as zb,Ja as ta,Je as eb,Jf as Ab,Ka as ua,Ke as fb,Kf as Bb,La as va,Le as gb,Me as hb,Ne as ib,Nf as Cb,Oa as wa,Ob as Ua,Oe as jb,Of as Db,Pb as Va,Pe as kb,Pf as Eb,Qe as lb,Qf as Fb,Re as mb,Rf as Gb,Se as nb,Sf as Hb,Te as ob,Ue as pb,We as qb,Xe as rb,Ye as sb,Yf as Ib,Zf as Jb,a as ca,af as ub,b as da,c as ea,d as fa,e as ga,f as ha,h as ia,i as ja,j as ka,k as la,l as ma,x as na,y as oa,ye as Wa,z as pa,za as ra,ze as Xa}from"./chunk-6BVF3HZ7.js";import{A as Ha,B as Ia,C as Ja,D as Ka,E as La,F as Ma,G as Na,H as Oa,I as Pa,J as Qa,K as Ra,L as Sa,M as Ta,j as xa,r as ya,s as za,t as Aa,u as Ba,v as Ca,w as Da,x as Ea,y as Fa,z as Ga}from"./chunk-NGH6T4FD.js";import"./chunk-ONUPGMER.js";export{hg as ALWAYS_RESIDENT_TOOL_NAMES,Pi as AUTO_MODE_DENIAL_CONSECUTIVE_THRESHOLD,Qi as AUTO_MODE_DENIAL_CUMULATIVE_THRESHOLD,_j as BASH_POLICY_SPEC,Rh as BASH_SAFE_READ_COMMANDS,Qh as BASH_WRITE_COMMANDS,rj as BLOCKER_REQUIRED_CONSECUTIVE_TURNS,Ki as BREAKER_ERROR_THRESHOLD,Li as BREAKER_WINDOW_MS,gh as BUILTIN_WORKFLOWS,uc as CANCELLED_TOOL_RESULT_MESSAGE,tc as CANCELLED_TOOL_RESULT_PREFIX,Ii as CLASSIFIER_MAX_OUTPUT_TOKENS,Sj as CODING_AGENT_MARKER,jj as CODING_INVARIANTS,Gh as CODING_SUMMARY_PROMPT,Hh as CODING_UPDATE_SUMMARY_PROMPT,Ae as CapabilityDeniedError,lj as Client,Kg as CodingActorSession,kf as CombinedExtensionRuntime,Be as ConstructionManifestError,Hi as DEFAULT_CLASSIFIER_RETRY_TIMEOUT_MS,Gi as DEFAULT_CLASSIFIER_TIMEOUT_MS,Ih as DEFAULT_CODING_AGENT_NAME,zi as DEFAULT_DANGEROUS_PATTERNS,ye as DEFAULT_HANDLER_TIMEOUT_MS,ng as DEFAULT_RESILIENCE_CONFIG,yi as DEFAULT_SAFE_PATTERNS,Le as DEFAULT_SELF_MODIFY_BUDGET,Zi as DEFAULT_SPECULATIVE_WINDOW_MS,wc as DEFAULT_TOOL_OUTPUT_MAX_BYTES,vc as DEFAULT_TOOL_OUTPUT_MAX_LINES,Pg as DEFAULT_WORKFLOW_GENERATION_TIMEOUT_MS,qa as DefaultSummaryCompaction,Pj as EMIT_VERDICT_TOOL_NAME,rc as ErrorCategory,Oh as FILE_MODIFICATION_TOOLS,_g as FINDING_VERIFICATION_OUTPUT_SCHEMA,Nd as GENERATOR_AGENT_NAME,za as ImageResizeError,ja as KODAX_API_MIN_INTERVAL,s as KODAX_DEFAULT_PROVIDER,da as KODAX_DEFAULT_TIMEOUT,Qa as KODAX_FILE_MEDIA_TYPES,ea as KODAX_HARD_TIMEOUT,Oa as KODAX_IMAGE_MEDIA_TYPES,ha as KODAX_MAX_INCOMPLETE_RETRIES,fa as KODAX_MAX_RETRIES,ca as KODAX_MAX_TOKENS,r as KODAX_PROVIDERS,q as KODAX_PROVIDER_SNAPSHOTS,f as KODAX_REASONING_MODE_SEQUENCE,ga as KODAX_RETRY_BASE_DELAY,g as KODAX_STABLE_EFFORT_INTENTS,ia as KODAX_STAGGER_DELAY,pf as KODAX_TOOLS,Ic as KODAX_UNDERLYING_CAPABILITY_TOPICS,Pa as KODAX_VIDEO_MEDIA_TYPES,o as KodaXAnthropicCompatProvider,n as KodaXBaseProvider,lj as KodaXClient,a as KodaXError,jf as KodaXExtensionRuntime,ya as KodaXMediaError,p as KodaXOpenAICompatProvider,b as KodaXProviderError,c as KodaXRateLimitError,pc as KodaXSessionError,qc as KodaXTerminalError,oc as KodaXToolError,bc as KodaXTrustedTextMutationError,Mb as LEARNING_REVIEW_PROMPT_SHA256,Nb as LEARNING_REVIEW_SCHEMA_SHA256,Kb as LEARNING_REVIEW_SYSTEM_PROMPT,Lb as LEARNING_REVIEW_TOOL,qb as LINEAGE_ENTRY_TYPES,Gg as LSP_SERVERS,sb as LineageCompaction,rb as LineageExtension,Hg as LspService,Jc as MANUAL_REGISTRY,Hc as MANUAL_TOPIC_IDS,Fa as MAX_DIMENSION,Hj as MEMORY_INTERVENTION_SELECTOR_PROMPT,Ij as MEMORY_INTERVENTION_SELECTOR_SHA256,Ph as MODIFICATION_TOOLS,bb as McpAuthRequiredError,nb as McpCapabilityProvider,ab as McpExpiredSessionError,ob as McpManager,mb as McpServerRuntime,Ka as PASTE_TMP_DIR_ENV,La as PASTE_TMP_TTL_MS,Md as PLANNER_AGENT_NAME,ka as PROMISE_PATTERN,Qf as PROMPT_SECTION_REGISTRY,Rj as PROTOCOL_EMITTER_TOOLS,tg as ProviderRecoveryCoordinator,xc as READ_DEFAULT_LIMIT,zc as READ_MAX_LINE_CHARS,yc as READ_PREFLIGHT_SIZE_BYTES,ef as REPO_EXPLORER_AGENT_NAME,ff as REPO_EXPLORER_TOOL_NAMES,sa as Runner,Zg as SCOPED_REVIEW_OUTPUT_SCHEMA,Ld as SCOUT_AGENT_NAME,ik as SCOUT_THEN_AUTHOR_PROMPT_LINES,Zf as SELF_KNOWLEDGE_ROUTING_RULE,Pf as SYSTEM_PROMPT,xh as SYSTEM_WORKFLOW_LIMITS,rg as StableBoundaryTracker,Ga as TARGET_RAW_SIZE_BYTES,Qd as TASK_ENGINE_ROLE_AGENTS,Tj as TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME,bk as TRACING_ENV,Tc as ToolResultBatchCapacityError,Od as WORKER_AGENT_NAME,Og as WORKFLOW_GENERATION_SYSTEM_PROMPT,Se as _resetRuntimeForTesting,ec as acquireExclusiveFileSystemEffectLease,dc as acquireFileSystemMutationLease,Ve as activate,xa as actorQueueId,vi as analyzeAutoModeCall,dd as analyzeChangedScope,Th as analyzePowerShellMutation,Je as appendAuditEntry,Ab as appendSessionLineageLabel,$d as applyAccountingDelta,bh as applyFindingVerification,Bb as applySessionCompaction,Uc as applyToolResultGuardrail,Hb as archiveOldIslands,cc as assertTrustedTextMutationPolicy,ui as assessAutoModeCall,kk as authorWorkflowViaWorker,Ui as autoModeDenialShouldFallback,Tb as awaitLatestCodingMemoryReviewDrain,Ci as bashSignalCollector,ck as bootstrapTracing,fj as boundedRevise,Oi as breakerShouldFallback,gj as budgetCeiling,yh as buildApprovalSummary,ce as buildBlockedGoal,_f as buildCapabilityContextSections,Di as buildClassifierPrompt,de as buildCompleteGoal,_d as buildCreatedGoal,Ag as buildFallbackRoutingDecision,vj as buildGoalRuntimeBinding,lb as buildInitializeCapabilities,Ge as buildLlmReviewPrompt,Lc as buildManualToolDescription,Aj as buildMcpReverseCapabilities,ae as buildPausedGoal,cg as buildPromptMessageContent,Uf as buildPromptSnapshot,ug as buildProviderCapabilitySnapshot,Bg as buildProviderPolicyHintsForDecision,vg as buildProviderPolicyPromptNotes,cd as buildRepoIntelligenceContext,pd as buildRepoIntelligenceIndex,$c as buildRepoOverview,be as buildResumedGoal,eh as buildScopedReviewFinalPrompt,ch as buildScopedReviewPrimaryPrompt,dh as buildScopedReviewVerificationPrompt,jk as buildScoutThenAuthorPrompt,Yf as buildSelfKnowledgeRoutingRule,Fb as buildSessionTree,ag as buildSystemPrompt,$f as buildSystemPromptSnapshot,Mf as buildToolResultBudget,Nf as buildToolResultBudgetFromUsage,le as buildToolSearchIndex,uh as buildWorkflowCostReport,Tg as buildWorkflowGenerationSkillContext,Sg as buildWorkflowGenerationUserPrompt,Rb as canonicalMemoryProjectId,Vb as canonicalizeAgentHomePolicyPath,qi as canonicalizeAutoModePath,xi as checkAbsoluteDeny,bg as checkIncompleteToolCalls,Dg as checkPromiseSignal,Of as clampToolResultPolicyToBudget,zh as clampWorkflowLimits,Ji as classify,Bi as classifyBashCommand,sc as classifyError,_c as classifyFileCategory,pg as classifyResilienceError,If as cleanupExpiredToolOutputs,Va as cleanupIncompleteToolCalls,Jf as cleanupUnreferencedToolOutputs,T as clearRuntimeModelProviders,nc as clearShellExecutionEnvironmentCache,Yi as collectAllSignals,li as collectBashWriteTargets,mi as collectDeterministicBashWriteTargets,lf as combineExtensionRuntimes,Lj as computeInputSignature,Vj as computeRulesFingerprint,Re as configureRuntime,lg as consumeCompactionCooldown,Ed as convertCapabilityReadResult,Dd as convertProviderSearchResults,Gb as countActiveLineageMessages,ma as countTokens,na as createAgent,aj as createAgentHomeShellBoundaryGuardrail,Ri as createAutoModeDenialTracker,bj as createAutoModeToolGuardrail,Ai as createBashClassifierConfig,ak as createBashPrefixExtractor,xf as createBuiltinToolDefinition,Mi as createCircuitBreaker,Jj as createCodingMemoryInterventionRunner,Xg as createCodingWorkflowBackend,jg as createCompactionAntiThrashState,Ce as createCtxProxy,F as createCustomProvider,Jh as createDefaultCodingAgent,Kj as createDenialTracker,mf as createExtensionRuntime,Mg as createExternalActorTurnExecutor,Da as createFileArtifactFromPath,oa as createHandoff,Ca as createImageArtifactFromPath,pa as createInMemorySession,Dj as createKodaXTaskRunner,Lg as createLocalCodingActorControl,Xa as createMcpCapabilityId,pb as createMcpManager,cb as createMcpTransport,$ as createOutputSegmentProjection,Pb as createProductionLearningReviewer,Rf as createPromptSection,Cg as createReasoningPlan,wh as createRunGraphWriter,gg as createRuntimeContextBudgetSnapshot,dj as createSessionControl,vb as createSessionLineage,Uj as createToolResultTruncationGuardrail,Ea as createVideoArtifactFromPath,ek as createWorkflowLifecycleController,hk as createWorkflowPatternTemplateModule,Dh as createWorkflowRunManager,nj as decideWorkflowInvocation,te as dedupeExtensionPathsByEntrypoint,Wa as defaultMcpCacheDir,ze as defaultPolicy,ph as deleteSavedWorkflow,Qb as deriveCodingMemoryIdentity,Ub as deriveCodingMemoryReviewIdentities,Qe as disableSelfModify,gb as discoverAuthorizationServerMetadata,xe as discoverDefaultExtensions,we as discoverExtensionsInDirectory,ve as discoverExtensionsInDirectoryDetailed,df as discoverMarkdownAgents,hb as discoverOAuthEndpoints,fb as discoverProtectedResourceMetadata,jh as discoverSavedWorkflows,Sb as drainCodingMemoryReviewInbox,Td as drainPendingSwaps,ba as effectiveOutputSegmentText,j as effortToLegacyReasoningMode,Qj as emitVerdict,Bh as emitWorkflowAgentDigest,Ta as enqueueWithArtifacts,gf as ensureBuiltinRepoExplorerAgent,la as estimateTokens,fg as estimateToolSchemaTokens,wi as evaluateAutoRulesCall,wg as evaluateProviderPolicy,ue as excludeExtensionPathsByEntrypoint,oe as exec,ke as executeRunScopedTool,Hf as executeTool,tb as extractArtifactLedger,$j as extractCommandPrefix,eg as extractComparableUserMessageText,Cd as extractHtmlTitle,eb as extractInsufficientScope,fi as extractPathsFromCommand,dg as extractPromptComparableText,db as extractResourceMetadataUrl,Jb as extractTitleFromMessages,Vi as fileSignalCollector,Gd as finalizeRetrievalResult,$e as findByVersion,Uh as findGitSubcommandIndex,Cb as findPreviousUserEntryId,Mh as flattenArgv,Nh as flattenRedirections,Eb as forkSessionLineage,Xf as formatAgentsForPrompt,Fj as formatParallelDispatchResult,Ac as formatSize,ci as generateSavePattern,Ib as generateSessionId,Vg as generateWorkflow,Wg as generateWorkflowFromOptions,of as getActiveExtensionRuntime,ua as getAgentConfigHome,va as getAgentConfigPath,zf as getAllRegisteredTools,wa as getAppDataDir,W as getAvailableProviderNames,ni as getBashOutsideProjectWriteRisk,wf as getBuiltinRegisteredToolDefinition,vf as getBuiltinToolDefinition,hh as getBuiltinWorkflow,N as getCustomModelCapabilities,H as getCustomProvider,K as getCustomProviderList,M as getCustomProviderModelDescriptors,L as getCustomProviderModels,J as getCustomProviderNames,re as getDefaultExtensionDirectory,Ig as getDefaultLspService,Eh as getDefaultWorkflowRunManager,Oj as getDenialContext,_h as getDirectShellBypassBlockReason,ud as getImpactEstimate,Vf as getKodaxGlobalDir,$a as getMcpCachePaths,C as getModelCapabilities,Ra as getModelInputCapabilities,rd as getModuleContext,ji as getPlanModeAllowedWritablePaths,oi as getPlanModeBlockReason,td as getProcessContext,t as getProvider,x as getProviderConfiguredCapabilityProfile,w as getProviderConfiguredReasoningCapability,y as getProviderList,v as getProviderModel,B as getProviderModelDescriptors,z as getProviderModels,tf as getRegisteredToolDefinition,qd as getRepoIntelligenceIndex,ad as getRepoOverview,vd as getRepoRoutingSignals,Ef as getRequiredToolParams,Q as getRuntimeModelProvider,S as getRuntimeModelProviderNames,wb as getSessionLineagePath,xb as getSessionMessagesFromLineage,sd as getSymbolContext,rf as getTool,sf as getToolDefinition,uf as getToolRegistrations,Sc as getToolResultPolicy,gk as getWorkflowPatternTemplate,Vh as gitSignatureInspectionMayExecute,Xd as goalTokenDelta,mj as hasExplicitNaturalLanguageWorkflowIntent,Sd as hasPendingSwap,Aa as inferImageMediaType,pi as inferPermissionMode,zg as inferTaskType,Ba as inferVideoMediaType,Qc as inspectEditFailure,od as inspectRepoIntelligenceRuntime,Ob as installProductionLearningReviewer,_b as isAgentHomeHardMutationTarget,$b as isAgentHomeHardRemovalTarget,di as isAlwaysConfirmPath,Xb as isAutoReadableAgentHomePath,si as isAutoReadableKodaxPath,Wb as isAutoWritableAgentHomePath,ti as isAutoWritableKodaxPath,Zh as isBashReadCommand,hi as isBashReadCommandAutoAllowed,$h as isBashWriteCommand,gi as isCommandOnProtectedPath,ri as isCredentialBearingKodaxPath,I as isCustomProviderName,Nj as isDeniedRecently,Yh as isHelpCommand,V as isKnownProvider,Kh as isNullDevice,Ej as isParallelDispatchDirective,ii as isPathInsideProject,ki as isPlanModeAllowedPath,Sh as isPowerShellMutationCommand,Zb as isProtectedAgentHomeMutationTarget,Yb as isProtectedAgentHomeReadTarget,ac as isProtectedAgentHomeRemovalTarget,u as isProviderConfigured,A as isProviderName,R as isRuntimeModelProviderName,qg as isSessionRecoveryCandidateError,Xh as isShellReadOnlyArgv,qe as isSupportedExtensionModulePath,bi as isToolCallAllowed,Bf as isToolFileMutation,Df as isToolMutation,Cf as isToolNetworkRead,Af as isToolPlanModeAllowed,ee as isValidTokenBudget,Eg as languageIdForPath,af as listAll,Z as listAllModelCapabilities,Ye as listArtifacts,D as listBuiltinModelCapabilities,yf as listBuiltinToolDefinitions,ih as listBuiltinWorkflows,Ud as listCodingDispatchableAgents,_e as listConstructed,O as listCustomProviderModelCapabilities,ge as listRunScopedTools,Gf as listToolDefinitions,Ff as listTools,fk as listWorkflowPatternTemplates,Wf as loadAgentsFiles,bf as loadAgentsFromMarkdown,Zj as loadAutoRules,rh as loadGeneratedWorkflowFromRun,De as loadHandler,cf as loadMarkdownAgentScope,mh as loadSavedWorkflow,lh as loadSavedWorkflowCapsule,kb as loadValidToken,ie as lookupRunScopedTool,Wd as makeDisabledGoalToolsContext,i as mapLegacyReasoningModeToEffortIntent,Lf as maybeRunReferenceAwareToolOutputGc,Kf as maybeRunToolOutputGc,zj as mcpRootsFromWorkspace,ub as mergeArtifactLedger,ah as mergeScopedReviewResults,fc as normalizeKodaXAgentMode,Ya as normalizeMcpCapabilityId,Ha as normalizePastedImage,h as normalizeReasoningEffortValue,$g as normalizeScopedReviewResult,kc as normalizeShellExecutionContract,kh as normalizeWorkflowModule,Sf as orderPromptSections,Yg as parallelInvestigation,ai as parseAllowedToolPattern,Yj as parseAutoRules,hc as parseBareInlineSlashReferences,Lh as parseBashCommand,Ei as parseClassifierOutput,Pc as parseEditToolError,Wh as parseGitGrepShortOption,gc as parseInlineSkillReferences,He as parseLlmReviewVerdict,Za as parseMcpCapabilityId,Wi as parseModelSpec,k as parseReasoningEffortEnv,mc as parseSandboxEnvironmentPass,e as parseTimeoutSecEnvMs,ne as parseToolSearchQuery,Ug as parseWorkflowGeneration,jb as performOAuthLogin,Ma as persistImageAsBlock,Fc as persistToolOutput,ig as planToolExposure,th as preflightWorkflowCapsule,wd as prewarmRepoIntelligenceCaches,Ng as providerResilienceConfigFromTimeouts,Na as prunePasteTmpDir,Ja as readAndNormalizeClipboardImage,Ze as readArtifact,Ke as readAuditEntries,Me as readBudget,Ia as readClipboardImage,Pe as readDisableState,_i as readSpeculativeWindowFromEnv,Wj as readTrustState,yg as reasoningModeToDepth,sg as reconstructMessagesWithToolGuard,Ti as recordAutoModeAllow,Si as recordAutoModeBlock,pj as recordBlockerAttempt,Ni as recordBreakerError,mg as recordCompactionSavings,Mj as recordDenial,aa as reduceOutputSegmentProjection,kj as registerCodingInvariants,xj as registerConfiguredMcpCapabilityProvider,G as registerCustomProviders,P as registerModelProvider,ib as registerOAuthClient,Bj as registerOfficialSandboxExtension,ra as registerPresetDispatcher,qf as registerTool,We as rehydrateActiveArtifacts,Ne as remainingSelfModifyBudget,oh as renameSavedWorkflow,ed as renderChangedScope,ld as renderImpactEstimate,id as renderModuleContext,kd as renderProcessContext,Tf as renderPromptSections,bd as renderRepoOverview,Fd as renderRetrievalResult,jd as renderSymbolContext,yj as replaceConfiguredMcpCapabilityProvider,qh as replaceSavedWorkflow,Fg as reportLspDiagnostics,qj as resetBlockerCounter,Oe as resetBudget,Xi as resolveClassifierModel,Vd as resolveCodingDispatchableAgent,Rd as resolveConstructedAgent,se as resolveExtensionEntrypoint,Kc as resolveKodaXManual,Y as resolveModelCapabilities,U as resolveProvider,X as resolveProviderModelDescriptors,l as resolveReasoningEffort,m as resolveReasoningEffortForModelSwitch,xg as resolveReasoningMode,nd as resolveRepoIntelligenceMode,md as resolveRepoIntelligenceRuntimeConfig,og as resolveResilienceConfig,yb as resolveSessionLineageTarget,fe as resolveToolBridgeTarget,hj as resolveToolCapability,Ec as resolveToolOutputDir,_ as resolveWireEffort,Qg as resolveWorkflowGenerationTimeoutMs,dk as resolveWorkflowIdentity,Xe as revoke,Db as rewindSessionLineage,hf as rollbackSelfModify,Ee as runAstRules,cj as runKodaX,Ie as runLlmReview,wj as runManagedTask,Cj as runOrchestration,he as runScopedToolMap,Ch as runWorkflowFromOptions,Ah as runWorkflowModule,vh as safeWorkflowArtifactName,nh as saveGeneratedWorkflow,sh as saveGeneratedWorkflowFromRun,fh as scopedReview,_a as searchMcpCatalog,me as searchToolIndex,nf as setActiveExtensionRuntime,ta as setAgentConfigHome,zb as setSessionLineageActiveEntry,lc as shellExecutionContractFingerprint,Zd as shouldFlipBudgetLimited,kg as shouldSkipLlmCompaction,Jg as shutdownDefaultLspService,$i as speculativeRace,Te as stage,ej as startKodaX,Fh as startManagedWorkflow,Fi as stripAssistantText,Bd as stripHtmlToText,Ue as testArtifact,d as timeoutSecToMs,je as toModelToolDefinition,ei as tokenizeRawCommandStages,Zc as toolAskUserQuestion,Vc as toolBash,hd as toolChangedDiff,gd as toolChangedScope,Jd as toolCodeSearch,Oc as toolEdit,Wc as toolGlob,Xc as toolGrep,Ad as toolImpactEstimate,Rc as toolInsertAfterAnchor,xd as toolModuleContext,ij as toolPermission,zd as toolProcessContext,Gc as toolRead,fd as toolRepoOverview,Kd as toolSemanticLookup,yd as toolSymbolContext,Yc as toolUndo,Id as toolWebFetch,Hd as toolWebSearch,Nc as toolWrite,Bc as truncateHead,Dc as truncateLine,Cc as truncateTail,Xj as trustProjectRules,Yd as turnWallTimeDelta,jc as uniqueBareInlineSlashNames,ic as uniqueInlineSkillNames,Ua as validateAndFixToolHistory,E as validateCustomProviderConfig,Rg as validateGeneratedWorkflowSource,Sa as validateInputArtifactsForModel,Gj as validateSubtaskIndependence,Fe as validateToolSchemaForProvider,uj as verifyGoalCompletion,pe as webhook,sj as withGoalBeforeNextTurn,tj as withGoalStopHook,Mc as withManualToolBranding,Pd as workerAgent,oj as workflowStartOutcomeConsumesTurn,lk as writeReviewPackets};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{j as a}from"./chunk-RIQSS56Y.js";import"./chunk-AC7Z2OIY.js";import"./chunk-C4KYZAFU.js";import"./chunk-4OIQZWA5.js";import"./chunk-NVRWCSA5.js";import"./chunk-LTUZTQ6W.js";import"./chunk-POTW3O65.js";import"./chunk-6BVF3HZ7.js";import"./chunk-NGH6T4FD.js";import"./chunk-ONUPGMER.js";export{a as startManagedWorkflow};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{I as a,J as b}from"./chunk-C4KYZAFU.js";import"./chunk-4OIQZWA5.js";import"./chunk-NVRWCSA5.js";import"./chunk-LTUZTQ6W.js";import"./chunk-POTW3O65.js";import"./chunk-6BVF3HZ7.js";import"./chunk-NGH6T4FD.js";import"./chunk-ONUPGMER.js";export{a as createWorkflowRunManager,b as getDefaultWorkflowRunManager};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{$ as N,A as m,B as n,C as o,D as p,E as q,F as r,G as s,H as t,I as u,J as v,K as w,L as x,M as y,N as z,O as A,P as B,Q as C,R as D,S as E,T as F,U as G,V as H,W as I,X as J,Y as K,Z as L,_ as M,aa as O,b as a,ba as P,c as b,ca as Q,da as R,ea as S,fa as T,ga as U,q as c,r as d,s as e,t as f,u as g,v as h,w as i,x as j,y as k,z as l}from"./chunk-GYUU7XLH.js";import"./chunk-U27XKEN5.js";import"./chunk-RIQSS56Y.js";import"./chunk-JKTJCGO2.js";import"./chunk-AC7Z2OIY.js";import"./chunk-C4KYZAFU.js";import"./chunk-4OIQZWA5.js";import"./chunk-NVRWCSA5.js";import"./chunk-LTUZTQ6W.js";import"./chunk-POTW3O65.js";import"./chunk-6BVF3HZ7.js";import"./chunk-NGH6T4FD.js";import"./chunk-ONUPGMER.js";export{a as CONFIG_TEMPLATES,H as KODAX_CONFIG_ENV_BINDINGS,e as KODAX_CONFIG_FILE,c as KODAX_DIR,D as KODAX_EXAMPLE_CONFIG_FILE,E as KODAX_INTEGRATION_EXAMPLE_FILES,d as KODAX_SESSIONS_DIR,k as KODAX_VERSION,f as PREVIEW_MAX_LENGTH,I as applyConfigEnvironment,r as describeProviderCapabilitySummary,y as describeReasoningCapabilityControl,z as describeReasoningExecution,G as ensureExampleConfigFile,F as ensureExampleConfigFiles,S as formatProviderCapabilityDetailLines,R as formatProviderSourceKind,s as formatReasoningCapabilityShort,t as formatReasoningEffortForDisplay,w as formatReasoningEffortStatusLabel,b as getConfigTemplate,Q as getGitRoot,m as getProviderAvailableModels,o as getProviderCapabilityProfile,p as getProviderCapabilitySnapshot,T as getProviderCommonPolicyScenarios,A as getProviderList,l as getProviderModel,q as getProviderPolicyDecision,n as getProviderReasoningCapability,v as getProviderReasoningEffortCycle,u as getProviderReasoningEffortOptions,j as getVersion,g as hydrateProcessEnvFromShell,B as isProviderConfigured,C as loadConfig,J as prepareRuntimeConfig,U as rateLimitedCall,i as registerConfiguredCustomProviders,h as resetShellEnvironmentHydrationForTesting,L as resolveInitialEffortOverride,P as resolvePermissionModeEffort,x as resolveProviderReasoningRuntimeEffort,O as resolveRuntimeEffortSelection,N as resolveRuntimeModelSelection,M as resolveRuntimeProviderSelection,K as saveConfig};
|