@kodax-ai/kodax 0.7.86 → 0.7.87
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 +32 -0
- package/README.md +16 -4
- package/README_CN.md +6 -4
- package/dist/chunks/{agent-IO6TXNCV.js → agent-Z64QF7KG.js} +1 -1
- package/dist/chunks/argument-completer-HIJBXRUT.js +2 -0
- package/dist/chunks/{chunk-Q6UAGROD.js → chunk-3PGNESV3.js} +2 -2
- package/dist/chunks/{chunk-B36G256E.js → chunk-4OLXWSCQ.js} +2 -2
- package/dist/chunks/{chunk-2RAXDUC7.js → chunk-7XTUXMAI.js} +2 -2
- package/dist/chunks/{chunk-AAFFS6RU.js → chunk-ASFCAPIG.js} +3 -3
- package/dist/chunks/{chunk-XA4ENCAH.js → chunk-BCYJIACJ.js} +2 -2
- package/dist/chunks/{chunk-U6HNMLNN.js → chunk-DB4O33RR.js} +5 -5
- package/dist/chunks/{chunk-GVGLYVG4.js → chunk-GRJ7NKWP.js} +1 -1
- package/dist/chunks/{chunk-G5FGIRDJ.js → chunk-ITP7J5HX.js} +1 -1
- package/dist/chunks/{chunk-HTVLCHWH.js → chunk-JS4RSF4B.js} +1 -1
- package/dist/chunks/chunk-SKELDH3G.js +123 -0
- package/dist/chunks/{chunk-A5VQGXH2.js → chunk-U44C5STU.js} +1 -1
- package/dist/chunks/{chunk-R4EHASEN.js → chunk-UWKM3HNY.js} +4 -4
- package/dist/chunks/chunk-XH7UM4GO.js +92 -0
- package/dist/chunks/{chunk-UKCDCVMD.js → chunk-XKLVC7F6.js} +1 -1
- package/dist/chunks/{chunk-MFCPQZ7E.js → chunk-YB7YVAPL.js} +1 -1
- package/dist/chunks/{chunk-XUKLF26Q.js → chunk-ZQNOEKOB.js} +2 -2
- package/dist/chunks/compaction-config-E4TFBCDJ.js +2 -0
- package/dist/chunks/{construction-bootstrap-4DGAYOWH.js → construction-bootstrap-YTFOT4M2.js} +1 -1
- package/dist/chunks/{dist-DFW7MXT7.js → dist-M3JV4PNA.js} +1 -1
- package/dist/chunks/{dist-WWL2DNIJ.js → dist-X55TWIK4.js} +1 -1
- package/dist/chunks/host-SJHHJBPB.js +2 -0
- package/dist/chunks/run-manager-T5QGWNON.js +2 -0
- package/dist/chunks/{utils-LV7FHKYN.js → utils-2FHVIO6X.js} +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.js +1 -1
- package/dist/kodax_bootstrap.js +1 -1
- package/dist/kodax_cli.js +762 -762
- package/dist/kodax_resume.js +1 -1
- package/dist/provider-capabilities.json +239 -133
- package/dist/runtime-worker.js +716 -716
- package/dist/sandbox-workspace-session.js +4 -4
- package/dist/sdk-a2a.d.ts +12 -12
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-agent.d.ts +17 -17
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +21 -21
- 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 +7 -7
- 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 +16 -16
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-runtime.d.ts +13 -13
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-sandbox.js +1 -1
- package/dist/sdk-session.d.ts +7 -7
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +1 -1
- package/dist/types-chunks/{base.d-DxG0m09Z.d.ts → base.d-vopO1rml.d.ts} +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-QqKtuLZm.d.ts → bash-prefix-extractor.d-B36OQwNA.d.ts} +4 -4
- package/dist/types-chunks/{capability-learning.d-iPSiAmc_.d.ts → capability-learning.d-CE1tm29C.d.ts} +1 -1
- package/dist/types-chunks/{capsule.d-CN_iMqAS.d.ts → capsule.d-DEncDNzD.d.ts} +3 -3
- package/dist/types-chunks/{controller.d-A73Kf6tH.d.ts → controller.d-C1YdP_pQ.d.ts} +1 -1
- package/dist/types-chunks/{controller.d-Dzxz22X-.d.ts → controller.d-Dif9pbC9.d.ts} +2 -2
- package/dist/types-chunks/{guardrail.d-Y_AIh8-I.d.ts → guardrail.d-DhpnJv4Y.d.ts} +5 -5
- package/dist/types-chunks/{history-retrieval.d-Debbzn1z.d.ts → history-retrieval.d-YJQpQt7h.d.ts} +2 -2
- package/dist/types-chunks/{public-api.d-Cg-4GTbK.d.ts → public-api.d-D4q3WxKq.d.ts} +4 -4
- package/dist/types-chunks/{repl.d-Bhrbueab.d.ts → repl.d-D4ye29Kk.d.ts} +5 -5
- package/dist/types-chunks/{resolver.d-C9IW4fmU.d.ts → resolver.d-RyPo99tB.d.ts} +2 -2
- package/dist/types-chunks/{review-inbox.d-DuZqFX-z.d.ts → review-inbox.d-C1_xZ-yg.d.ts} +1 -1
- package/dist/types-chunks/{run-manager.d-BS4lJfL3.d.ts → run-manager.d-D30IvnwV.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-fQ_KENev.d.ts → sdk-session-DIU6sHa2.d.ts} +3 -3
- package/dist/types-chunks/{shell-command-sets.d-DRGjd_7Q.d.ts → shell-command-sets.d-rIHkZ_VR.d.ts} +1 -1
- package/dist/types-chunks/{side-query.d-CP1LiRiH.d.ts → side-query.d-iH0P9ASy.d.ts} +2 -2
- package/dist/types-chunks/{types.d-BRrJU4pb.d.ts → types.d-Bz5Y-PD9.d.ts} +4 -4
- package/dist/types-chunks/{types.d-CgrXrFrq.d.ts → types.d-CK9A9rpP.d.ts} +1 -1
- package/dist/types-chunks/{types.d-Bo4fyMLu.d.ts → types.d-COhAF5Xo.d.ts} +2 -2
- package/dist/types-chunks/{types.d-DlLBRqZ9.d.ts → types.d-sW-OqiFt.d.ts} +1 -1
- package/dist/types-chunks/{utils.d-BIhh_BqE.d.ts → utils.d-B65ozSTV.d.ts} +6 -6
- package/package.json +1 -1
- package/dist/chunks/argument-completer-JMICSGL6.js +0 -2
- package/dist/chunks/chunk-TRNAWSXP.js +0 -123
- package/dist/chunks/chunk-UH5WNJXF.js +0 -92
- package/dist/chunks/compaction-config-5RMG22CY.js +0 -2
- package/dist/chunks/host-6MMHYTI5.js +0 -2
- package/dist/chunks/run-manager-ISQSWCAM.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{A as Ke,C as gi,D as wi,E as hi,F as et,I as Qo,K as yi,O as vi,Q as en,Y as xe,ba as ki,c as ci,d as di,da as bi,ea as $i,f as ui,fa as Si,h as Zn,i as Qn,m as fi,n as mi,y as pi}from"./chunk-AAFFS6RU.js";import{a as xi}from"./chunk-A5VQGXH2.js";import{ea as ii,fa as si,ja as ai,la as li}from"./chunk-XA4ENCAH.js";import{Ab as Yn,Cb as wo,Gb as ho,Hb as Jn,Ua as ti,Va as ri,_ as Jr,hb as He,i as Gn,n as Br,xb as Zo,yb as Se}from"./chunk-Q6UAGROD.js";import{i as Xo}from"./chunk-UKCDCVMD.js";import{A as ni,D as $e,J as Fe,m as Vo,n as Yo,o as Ue,q as po,r as Jo,s as Zr,t as Qr,v as ei,w as Vn,x as oi,y as go}from"./chunk-XUKLF26Q.js";import{Rb as Gr,Tb as zr,Ub as Xr,Xb as zn,Ya as Go,ba as qr,cd as Yr,ed as re,kc as Xn,lc as zo,oc as Vr}from"./chunk-U6HNMLNN.js";import{C as Rr,Pa as fo,Qa as Oe,Ra as Ne,ka as uo,ma as Hn,ya as Kn}from"./chunk-TRNAWSXP.js";import{Bc as Ho,Cg as Kr,Dc as Ko,Ec as Wr,Fd as be,Gc as Or,Gd as De,Ia as me,Ja as W,Ka as te,La as Cr,Ld as Nr,Pd as Dr,Qa as Er,Qd as Bo,Ra as Ir,Sa as Bn,Td as jr,Wb as Pr,Yb as Tr,Yf as je,Zf as Hr,ac as mo,bg as qn,je as Ur,k as Fo,lg as qo,mc as Mr,nc as _r,oc as Lr,of as Fr,t as q}from"./chunk-G5FGIRDJ.js";import{a}from"./chunk-ONUPGMER.js";import*as On from"fs";import*as Do from"path";import*as Mn from"fs";import Tn from"path";import i from"chalk";var on=["plan","accept-edits","auto","auto-in-project"];function Ga(e){return e==="auto"||e==="auto-in-project"}a(Ga,"isAutoMode");function km(e,o){return Ga(e)&&o==="llm"}a(km,"isAutoLlmMode");function za(e){switch(e){case"plan":return"Plan";case"accept-edits":return"Edits";case"auto":case"auto-in-project":return"Auto"}}a(za,"permissionModeDisplayName");var Xa='[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 bm(e=o=>{q({source:"repl:permission",level:"warn",message:o})}){let o=!1;return()=>{o||(o=!0,e(Xa))}}a(bm,"createAutoInProjectDeprecationEmitter");function nn(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(nn,"computeConfirmTools");function Ri(e){return e!==void 0&&on.includes(e)}a(Ri,"isPermissionMode");function yo(e,o){return Ri(e)?e:o}a(yo,"normalizePermissionMode");import{createHash as Va,randomUUID as Ya}from"node:crypto";import Be from"node:fs";import Ci from"node:path";var ko=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"}},qe=class extends Error{static{a(this,"ProviderSetupInvalidConfigError")}constructor(o,n){super(`KodaX configuration cannot be safely updated: ${o}. ${n}`),this.name="ProviderSetupInvalidConfigError"}},_i=/^[A-Za-z_][A-Za-z0-9_]*$/,Ja=new Set(["accesskey","apikey","accesstoken","auth","authorization","bearertoken","clientsecret","credential","key","password","privatekey","refreshtoken","secret","sig","signature","token","xapikey"]);function Ge(){return Object.entries(uo).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===Hn?-1:o.name===Hn?1:e.name.localeCompare(o.name))}a(Ge,"getProviderSetupCatalog");function Li(e={}){let o=e.configPath??W("config.json"),n=e.catalog??Ge(),t=e.environment??process.env,r=ot(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=Ni(r.config);if(s)return{status:"invalid-config",configPath:o,configRevision:r.revision,reason:s};let l=Pi(e.explicitProvider);if(l){let d=Mi(r.config,l,n);return d&&(!d.requiresCredential||Ti(t,d.apiKeyEnv))?Ei(o,r.revision,l):Ii(o,r.revision,l,d?.apiKeyEnv)}if(!r.exists)return{status:"needs-provider",configPath:o,configRevision:r.revision};let c=Pi(r.config.provider);if(c){let d=Mi(r.config,c,n);return d?!d.requiresCredential||Ti(t,d.apiKeyEnv)?Ei(o,r.revision,c):Ii(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(Li,"inspectProviderSetupReadiness");function Wi(e){let o=e.configPath??W("config.json"),n=e.catalog??Ge();try{return ui(o,()=>{let t=ot(o);if(!t.config)throw new qe(o,t.error??"config.json is invalid JSON.");if(t.revision!==e.expectedRevision)throw new ko(o);Za(t.config,o);let r=el(e.choice,n,t.config),s={...t.config,provider:r.provider,model:r.model,...r.customProviders?{customProviders:r.customProviders}:{}};if(ot(o).revision!==e.expectedRevision)throw new ko(o);return ol(o,s),{provider:r.provider,model:r.model,apiKeyEnv:r.apiKeyEnv,configPath:o}})}catch(t){throw t instanceof di?new ko(o):t}}a(Wi,"persistProviderSetupChoice");function Oi(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(Oi,"providerSetupRestartInstructions");function Ei(e,o,n){return{status:"ready",configPath:e,configRevision:o,...n?{provider:n}:{}}}a(Ei,"ready");function Ii(e,o,n,t){return{status:"needs-credential",configPath:e,configRevision:o,provider:n,...t?{apiKeyEnv:t}:{}}}a(Ii,"needsCredential");function Pi(e){return typeof e=="string"&&e.trim()?e.trim():void 0}a(Pi,"normalizedString");function Ti(e,o){return o!==void 0&&!!e[o]?.trim()}a(Ti,"hasEnvironmentValue");function Mi(e,o,n){let t=n.find(l=>l.name===o);if(t)return{apiKeyEnv:t.apiKeyEnv,requiresCredential:!0};if(Object.entries(uo).find(([l])=>l===o)?.[1]?.capabilityProfile.transport==="cli-bridge")return{requiresCredential:!1};let s=Qa(e,o);return s?{apiKeyEnv:s.apiKeyEnv,requiresCredential:!0}:void 0}a(Mi,"resolveConfiguredProvider");function Za(e,o){let n=Ni(e);if(n)throw new qe(o,n)}a(Za,"assertCustomProvidersPreservable");function Ni(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=nt(t);if(!r)return"Existing customProviders contains an invalid entry; repair it before running setup.";let s=Di(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(Ni,"existingCustomProvidersError");function Qa(e,o){let n=e.customProviders;if(Array.isArray(n))for(let t of n){let r=nt(t);if(r?.name===o)return r}}a(Qa,"findValidCustomProvider");function nt(e){if(!ji(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 Kn(l),_i.test(l.apiKeyEnv)?l:void 0}catch{return}}a(nt,"toValidCustomProvider");function el(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=tt(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=nt(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(el,"normalizeProviderSetupChoice");function tt(e){let o={name:e.name.trim(),protocol:e.protocol,baseUrl:e.baseUrl.trim(),apiKeyEnv:e.apiKeyEnv.trim(),model:e.model.trim()},n=Di(o.baseUrl);if(n)throw new Error(n);if(Kn(o),!_i.test(o.apiKeyEnv))throw new Error("Custom provider API key environment variable name is invalid.");return o}a(tt,"validateProviderSetupCustomMetadata");function Di(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=>Ja.has(t.toLowerCase().replace(/[-_.]/g,"")));return n===void 0?void 0:`Custom provider Base URL must not contain credential query parameter "${n}".`}a(Di,"customProviderEndpointError");function ot(e){if(!Be.existsSync(e))return{configPath:e,revision:vo(void 0),exists:!1,config:{}};let o;try{o=Be.readFileSync(e,"utf8")}catch(n){return{configPath:e,revision:vo(void 0),exists:!0,error:n instanceof Error?n.message:"config.json cannot be read."}}try{let n=JSON.parse(o);return ji(n)?{configPath:e,revision:vo(o),exists:!0,config:n}:{configPath:e,revision:vo(o),exists:!0,error:"config.json must contain a JSON object."}}catch(n){return{configPath:e,revision:vo(o),exists:!0,error:n instanceof Error?n.message:"config.json is invalid JSON."}}}a(ot,"readConfig");function vo(e){return Va("sha256").update(e??"<missing>","utf8").digest("hex")}a(vo,"revisionFor");function ji(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(ji,"isRecord");function ol(e,o){let n=Ci.dirname(e);Be.mkdirSync(n,{recursive:!0});let t=Ci.join(n,`.config.${process.pid}.${Ya()}.tmp`);try{Be.writeFileSync(t,`${JSON.stringify(o,null,2)}
|
|
2
|
+
import{A as Ke,C as gi,D as wi,E as hi,F as et,I as Qo,K as yi,O as vi,Q as en,Y as xe,ba as ki,c as ci,d as di,da as bi,ea as $i,f as ui,fa as Si,h as Zn,i as Qn,m as fi,n as mi,y as pi}from"./chunk-ASFCAPIG.js";import{a as xi}from"./chunk-U44C5STU.js";import{ea as ii,fa as si,ja as ai,la as li}from"./chunk-BCYJIACJ.js";import{Ab as Yn,Cb as wo,Gb as ho,Hb as Jn,Ua as ti,Va as ri,_ as Jr,hb as He,i as Gn,n as Br,xb as Zo,yb as Se}from"./chunk-3PGNESV3.js";import{i as Xo}from"./chunk-XKLVC7F6.js";import{A as ni,D as $e,J as Fe,m as Vo,n as Yo,o as Ue,q as po,r as Jo,s as Zr,t as Qr,v as ei,w as Vn,x as oi,y as go}from"./chunk-ZQNOEKOB.js";import{Rb as Gr,Tb as zr,Ub as Xr,Xb as zn,Ya as Go,ba as qr,cd as Yr,ed as re,kc as Xn,lc as zo,oc as Vr}from"./chunk-DB4O33RR.js";import{C as Rr,Pa as fo,Qa as Oe,Ra as Ne,ka as uo,ma as Hn,ya as Kn}from"./chunk-SKELDH3G.js";import{Bc as Ho,Cg as Kr,Dc as Ko,Ec as Wr,Fd as be,Gc as Or,Gd as De,Ia as me,Ja as W,Ka as te,La as Cr,Ld as Nr,Pd as Dr,Qa as Er,Qd as Bo,Ra as Ir,Sa as Bn,Td as jr,Wb as Pr,Yb as Tr,Yf as je,Zf as Hr,ac as mo,bg as qn,je as Ur,k as Fo,lg as qo,mc as Mr,nc as _r,oc as Lr,of as Fr,t as q}from"./chunk-ITP7J5HX.js";import{a}from"./chunk-ONUPGMER.js";import*as On from"fs";import*as Do from"path";import*as Mn from"fs";import Tn from"path";import i from"chalk";var on=["plan","accept-edits","auto","auto-in-project"];function Ga(e){return e==="auto"||e==="auto-in-project"}a(Ga,"isAutoMode");function km(e,o){return Ga(e)&&o==="llm"}a(km,"isAutoLlmMode");function za(e){switch(e){case"plan":return"Plan";case"accept-edits":return"Edits";case"auto":case"auto-in-project":return"Auto"}}a(za,"permissionModeDisplayName");var Xa='[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 bm(e=o=>{q({source:"repl:permission",level:"warn",message:o})}){let o=!1;return()=>{o||(o=!0,e(Xa))}}a(bm,"createAutoInProjectDeprecationEmitter");function nn(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(nn,"computeConfirmTools");function Ri(e){return e!==void 0&&on.includes(e)}a(Ri,"isPermissionMode");function yo(e,o){return Ri(e)?e:o}a(yo,"normalizePermissionMode");import{createHash as Va,randomUUID as Ya}from"node:crypto";import Be from"node:fs";import Ci from"node:path";var ko=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"}},qe=class extends Error{static{a(this,"ProviderSetupInvalidConfigError")}constructor(o,n){super(`KodaX configuration cannot be safely updated: ${o}. ${n}`),this.name="ProviderSetupInvalidConfigError"}},_i=/^[A-Za-z_][A-Za-z0-9_]*$/,Ja=new Set(["accesskey","apikey","accesstoken","auth","authorization","bearertoken","clientsecret","credential","key","password","privatekey","refreshtoken","secret","sig","signature","token","xapikey"]);function Ge(){return Object.entries(uo).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===Hn?-1:o.name===Hn?1:e.name.localeCompare(o.name))}a(Ge,"getProviderSetupCatalog");function Li(e={}){let o=e.configPath??W("config.json"),n=e.catalog??Ge(),t=e.environment??process.env,r=ot(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=Ni(r.config);if(s)return{status:"invalid-config",configPath:o,configRevision:r.revision,reason:s};let l=Pi(e.explicitProvider);if(l){let d=Mi(r.config,l,n);return d&&(!d.requiresCredential||Ti(t,d.apiKeyEnv))?Ei(o,r.revision,l):Ii(o,r.revision,l,d?.apiKeyEnv)}if(!r.exists)return{status:"needs-provider",configPath:o,configRevision:r.revision};let c=Pi(r.config.provider);if(c){let d=Mi(r.config,c,n);return d?!d.requiresCredential||Ti(t,d.apiKeyEnv)?Ei(o,r.revision,c):Ii(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(Li,"inspectProviderSetupReadiness");function Wi(e){let o=e.configPath??W("config.json"),n=e.catalog??Ge();try{return ui(o,()=>{let t=ot(o);if(!t.config)throw new qe(o,t.error??"config.json is invalid JSON.");if(t.revision!==e.expectedRevision)throw new ko(o);Za(t.config,o);let r=el(e.choice,n,t.config),s={...t.config,provider:r.provider,model:r.model,...r.customProviders?{customProviders:r.customProviders}:{}};if(ot(o).revision!==e.expectedRevision)throw new ko(o);return ol(o,s),{provider:r.provider,model:r.model,apiKeyEnv:r.apiKeyEnv,configPath:o}})}catch(t){throw t instanceof di?new ko(o):t}}a(Wi,"persistProviderSetupChoice");function Oi(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(Oi,"providerSetupRestartInstructions");function Ei(e,o,n){return{status:"ready",configPath:e,configRevision:o,...n?{provider:n}:{}}}a(Ei,"ready");function Ii(e,o,n,t){return{status:"needs-credential",configPath:e,configRevision:o,provider:n,...t?{apiKeyEnv:t}:{}}}a(Ii,"needsCredential");function Pi(e){return typeof e=="string"&&e.trim()?e.trim():void 0}a(Pi,"normalizedString");function Ti(e,o){return o!==void 0&&!!e[o]?.trim()}a(Ti,"hasEnvironmentValue");function Mi(e,o,n){let t=n.find(l=>l.name===o);if(t)return{apiKeyEnv:t.apiKeyEnv,requiresCredential:!0};if(Object.entries(uo).find(([l])=>l===o)?.[1]?.capabilityProfile.transport==="cli-bridge")return{requiresCredential:!1};let s=Qa(e,o);return s?{apiKeyEnv:s.apiKeyEnv,requiresCredential:!0}:void 0}a(Mi,"resolveConfiguredProvider");function Za(e,o){let n=Ni(e);if(n)throw new qe(o,n)}a(Za,"assertCustomProvidersPreservable");function Ni(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=nt(t);if(!r)return"Existing customProviders contains an invalid entry; repair it before running setup.";let s=Di(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(Ni,"existingCustomProvidersError");function Qa(e,o){let n=e.customProviders;if(Array.isArray(n))for(let t of n){let r=nt(t);if(r?.name===o)return r}}a(Qa,"findValidCustomProvider");function nt(e){if(!ji(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 Kn(l),_i.test(l.apiKeyEnv)?l:void 0}catch{return}}a(nt,"toValidCustomProvider");function el(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=tt(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=nt(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(el,"normalizeProviderSetupChoice");function tt(e){let o={name:e.name.trim(),protocol:e.protocol,baseUrl:e.baseUrl.trim(),apiKeyEnv:e.apiKeyEnv.trim(),model:e.model.trim()},n=Di(o.baseUrl);if(n)throw new Error(n);if(Kn(o),!_i.test(o.apiKeyEnv))throw new Error("Custom provider API key environment variable name is invalid.");return o}a(tt,"validateProviderSetupCustomMetadata");function Di(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=>Ja.has(t.toLowerCase().replace(/[-_.]/g,"")));return n===void 0?void 0:`Custom provider Base URL must not contain credential query parameter "${n}".`}a(Di,"customProviderEndpointError");function ot(e){if(!Be.existsSync(e))return{configPath:e,revision:vo(void 0),exists:!1,config:{}};let o;try{o=Be.readFileSync(e,"utf8")}catch(n){return{configPath:e,revision:vo(void 0),exists:!0,error:n instanceof Error?n.message:"config.json cannot be read."}}try{let n=JSON.parse(o);return ji(n)?{configPath:e,revision:vo(o),exists:!0,config:n}:{configPath:e,revision:vo(o),exists:!0,error:"config.json must contain a JSON object."}}catch(n){return{configPath:e,revision:vo(o),exists:!0,error:n instanceof Error?n.message:"config.json is invalid JSON."}}}a(ot,"readConfig");function vo(e){return Va("sha256").update(e??"<missing>","utf8").digest("hex")}a(vo,"revisionFor");function ji(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(ji,"isRecord");function ol(e,o){let n=Ci.dirname(e);Be.mkdirSync(n,{recursive:!0});let t=Ci.join(n,`.config.${process.pid}.${Ya()}.tmp`);try{Be.writeFileSync(t,`${JSON.stringify(o,null,2)}
|
|
3
3
|
`,{encoding:"utf8",mode:384}),Be.renameSync(t,e)}catch(r){throw Be.rmSync(t,{force:!0}),r}}a(ol,"writeConfigAtomically");import{existsSync as Ui,mkdirSync as nl,readFileSync as Fi,writeFileSync as tl}from"node:fs";import ze from"node:path";var rl={core:{},mcp:{version:1,servers:{}},extensions:{version:1,paths:[]},a2a:{version:2,agents:{}}},il=["core","mcp","extensions","a2a"];function rt(e,o){return o==="core"?ze.join(e,"config.json"):ze.join(e,"integrations",`${o}.json`)}a(rt,"activePath");function sl(e,o){return o==="core"?ze.join(e,"config.example.jsonc"):ze.join(e,"integrations",`${o}.example.jsonc`)}a(sl,"templatePath");function al(e){let o=e.replaceAll("\\","/");return il.flatMap(n=>[{domain:n,kind:"active",path:rt(e,n),content:`${JSON.stringify(rl[n],null,2)}
|
|
4
4
|
`},{domain:n,kind:"template",path:sl(e,n),content:ci(n).replaceAll("~/.kodax",o)}])}a(al,"configFiles");function bo(e,o){if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`${o} must contain a JSON object.`);return e}a(bo,"requireRecord");function ll(e,o){let n=bo(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=bo(n.agents,"A2A config agents");if(n.server!==void 0&&bo(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(ll,"validateA2ADocument");function cl(e,o){let n=Fi(e.path,"utf8"),t;try{t=JSON.parse(n)}catch{throw new Error(`${e.domain} config is invalid JSON.`)}e.domain==="core"?bo(t,"Core config"):e.domain==="mcp"?Zn(t):e.domain==="extensions"?Qn(t):ll(t,o)}a(cl,"validateActiveFile");function Hi(e,o){if(!Ui(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 cl(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(Hi,"existingFileResult");function dl(e){return e instanceof Error&&"code"in e&&e.code==="EEXIST"}a(dl,"isAlreadyExists");function ul(e,o){nl(ze.dirname(e.path),{recursive:!0,mode:448});try{return tl(e.path,e.content,{encoding:"utf8",flag:"wx",mode:384}),{domain:e.domain,kind:e.kind,path:e.path,status:"created"}}catch(n){if(dl(n))return Hi(e,o);throw n}}a(ul,"createIfMissing");function fl(e){let o=rt(e,"core");if(Ui(o))try{let n=bo(JSON.parse(Fi(o,"utf8")),"Core config"),t=fi(e);t.mcp.action==="create"&&Zn({version:1,servers:n.mcpServers}),t.extensions.action==="create"&&Qn({version:1,paths:n.extensions})}catch(n){return`Legacy integration configuration is invalid: ${n instanceof Error?n.message:"Legacy integration config is invalid."}`}}a(fl,"legacyIntegrationDiagnostic");function Ki(e={}){let o=ze.resolve(e.configHome??me()),n=al(o),t=n.map(s=>Hi(s,e.validateA2A));if(t.some(s=>s.status==="invalid"))return{configHome:o,files:t};let r=fl(o);if(r){let s=rt(o,"core");return t=t.map(l=>l.path===s?{...l,status:"invalid",diagnostic:r}:l),{configHome:o,files:t}}return mi({configHome:o}),{configHome:o,files:n.map(s=>ul(s,e.validateA2A))}}a(Ki,"initializeSetupConfiguration");import Ae from"node:path";var Bi=[{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 ml(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(ml,"formatBinding");function it(e){let n=Bi.find(t=>t.id===e)?.defaultBindings[0];return n?ml(n):"<unavailable>"}a(it,"shortcut");function pl(){return Object.entries(uo).filter(([,e])=>e.capabilityProfile.transport==="cli-bridge").map(([e])=>e).sort()}a(pl,"defaultCliBridges");function st(e={}){let o=Ae.resolve(e.configHome??me()),n=e.catalog??Ge(),t=e.cliBridges??pl(),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: ${Ae.join(o,"config.json")}`,` Annotated template: ${Ae.join(o,"config.example.jsonc")}`,` MCP: ${Ae.join(o,"integrations","mcp.json")}`,` Extensions: ${Ae.join(o,"integrations","extensions.json")}`,` A2A: ${Ae.join(o,"integrations","a2a.json")}`,` Integration templates: ${Ae.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:",` ${it("toggleThinking")} Cycle reasoning effort`,` ${it("togglePermissionMode")} Cycle permission mode`,` ${it("toggleAgentMode")} Cycle AMA/SA`," Tab Accept completion"," Esc Cancel or clear input"].join(`
|
|
5
5
|
`)}a(st,"renderSetupGuide");import*as qi from"node:readline";import at from"chalk";async function Gi(e={}){let o=e.catalog??Ge(),n=Li({...e.configPath?{configPath:e.configPath}:{},catalog:o});if(n.status==="invalid-config")throw new qe(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??yl({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 wl(r):await gl(r,o,s.slice(8));if(!l)return{status:"cancelled"};let c=hl(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:Wi({configPath:n.configPath,expectedRevision:n.configRevision,catalog:o,choice:l})}:{status:"cancelled"}}finally{t&&r.close?.()}}a(Gi,"runProviderSetupWizard");async function gl(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(gl,"collectBuiltinChoice");async function wl(e){let o=await tn(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 tn(e,"API Base URL from the provider documentation, for example https://example.com/v1");if(!t)return;let r=await tn(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 tn(e,"Model identifier from the provider documentation, for example provider/model-name");if(s)return{kind:"custom",provider:tt({name:o,protocol:n,baseUrl:t,apiKeyEnv:r,model:s})}}a(wl,"collectCustomChoice");async function tn(e,o){let t=(await e.text(o))?.trim();return t||void 0}a(tn,"requiredText");function hl(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(hl,"summarizeChoice");function yl(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(`
|
|
@@ -676,4 +676,4 @@ Available Skills:
|
|
|
676
676
|
[Skill "${t}" is not user-invocable]`)),!1;console.log(i.cyan(`
|
|
677
677
|
[Invoking skill: ${t}]`)),s.argumentHint&&console.log(i.dim(`Arguments: ${r||"(none)"}`)),console.log();let l=await n.loadFull(t),c={workingDirectory:process.cwd(),projectRoot:o.gitRoot??void 0,sessionId:o.sessionId,environment:{},executeDynamicContext:o.skillDynamicContext?.execute,disableDynamicContext:o.skillDynamicContext?.disable},d=await Nr(l,r,c);return console.log(i.green(`Skill activated: ${t}`)),console.log(i.dim("The skill context has been prepared for the AI.")),console.log(),{invocation:{prompt:d.content,source:"skill",displayName:t,path:l.skillFilePath,disableModelInvocation:d.disableModelInvocation,userInvocable:l.userInvocable,allowedTools:l.allowedTools,context:l.context,agent:l.agent,argumentHint:l.argumentHint,model:l.model,hooks:l.hooks,skillInvocation:{name:t,path:l.skillFilePath,description:l.description,arguments:r||void 0,allowedTools:l.allowedTools,context:l.context,agent:l.agent,argumentHint:l.argumentHint,model:l.model,hookEvents:l.hooks?Object.entries(l.hooks).filter(([,u])=>Array.isArray(u)&&u.length>0).map(([u])=>u):void 0,expandedContent:d.content}}}}catch(s){return console.log(i.red(`
|
|
678
678
|
[Error invoking skill: ${s instanceof Error?s.message:String(s)}]`)),!1}}a(fr,"executeSkillCommand");var Wn=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=be(this.gitRoot);return o.size===0&&await De(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 If}from"node:child_process";import*as ro from"node:path";import{promisify as Pf}from"node:util";var Oa=Pf(If);function Tf(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(Tf,"pathFromPorcelainLine");async function Na(e,o=10){try{let[{stdout:n},{stdout:t}]=await Promise.all([Oa("git rev-parse --show-toplevel",{cwd:e,windowsHide:!0}),Oa("git status --porcelain=v1 -uall",{cwd:e,windowsHide:!0})]),r=n.trim(),s=[],l=new Set;for(let c of t.split(`
|
|
679
|
-
`)){if(!c.trim())continue;let d=Tf(c);if(!d)continue;let u=ro.resolve(r,d),f=ro.relative(e,u).split(ro.sep).join("/");if(!(!f||f.startsWith("..")||l.has(f))&&(l.add(f),s.push(f),s.length>=o))break}return s}catch{return[]}}a(Na,"getRecentWorkingSetFiles");function io(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(io,"findCommandSlashIndex");var gr=class{static{a(this,"FileCompleter")}cwdSource;cache=new Map;cacheTimeout=5e3;recentCache=new Map;recentFilesProvider;constructor(o,n=Na){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:Do.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=Do.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&&!Do.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=>{On.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=>{On.stat(o,(t,r)=>{n(!t&&r.isDirectory())})})}},wr=class{static{a(this,"CommandCompleter")}commands;constructor(){this.commands=new Map,this.loadCommands()}loadCommands(){for(let n of No().getAll())n.userInvocable!==!1&&this.commands.set(n.name,{description:n.description,aliases:n.aliases??[]});let o=re();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=io(t);return r===-1?!1:!t.slice(r).includes(" ")}async getCompletions(o,n){let t=o.slice(0,n),r=io(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 Rv(e){let o=new gr(e),n=new Wn,t=new wr;return async r=>{let s=r.includes("@"),l=r.includes("/");if(!s&&!l)return[[],r];let c=[];if(l){let u=await Mf(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=>_f(r,u)),r]}}a(Rv,"createCompleter");async function Mf(e,o){let{ArgumentCompleter:n}=await import("./argument-completer-JMICSGL6.js"),t=new n;return t.canComplete(e,o)?t.getCompletions(e,o):[]}a(Mf,"getArgumentCompletions");function _f(e,o){if(o.type!=="argument")return o.text;let n=io(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(_f,"formatReadlineCompletion");import{existsSync as Nn,readdirSync as Fa,readFileSync as Ha}from"node:fs";import{join as Dn}from"node:path";var Lf=[{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"}],so=[{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 Wf(e){if(e&&e.includes("/")){let o=e.indexOf("/"),n=e.slice(0,o),t=e.slice(o+1);if(Oe(n))try{return Ke(n).filter(s=>!t||s.toLowerCase().includes(t.toLowerCase())).map(s=>({name:`${n}/${s}`,description:s,type:"enum"}))}catch{}return[]}return Ne().map(o=>({name:o,description:`Switch to ${o} provider`,type:"enum"}))}a(Wf,"getModelArgs");var hr=[{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"}],yr=[{name:"all",description:"Delete ALL sessions",type:"enum"}],Of=[{name:"status",description:"Show MCP server status",type:"enum"},{name:"refresh",description:"Refresh MCP server catalogs",type:"enum"}],Nf=[{name:"status",description:"Show child-task fallback order",type:"enum"},{name:"off",description:"Disable child-task fallback providers",type:"enum"}],Df=[{name:"llm",description:"Use LLM classifier for auto mode",type:"enum"},{name:"rules",description:"Use rules-only auto mode",type:"enum"}],Da=[{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"}],ja=[{name:"on",description:"Enable logging",type:"enum"},{name:"off",description:"Disable logging",type:"enum"}],jf=[{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"}],Uf=[{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 Ff(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;return t<=1?Uf: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(Ff,"getLearnArgs");var Hf=[{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"}],Kf=[{name:"show",description:"Show a captured paste by id",type:"enum"},{name:"list",description:"List captured pastes",type:"enum"}],Bf=[{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"}],qf=[{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"}],Gf=[{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"}],zf=[{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"}],Xf=[{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"}],Vf=[{name:"status",description:"Deprecated alias for /repo-intel status",type:"enum"}],Yf=[{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"}],Jf=new Set(["show","pause","resume","stop","delete","rerun","save","rename","revise"]),Zf=new Set(["show","delete","rerun","save","rename","revise"]),Qf=[{name:"--all",description:"Show all persisted workflow runs",type:"enum"},{name:"--limit",description:"Show at most N persisted workflow runs",type:"enum"}],em=[{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"}],om=[{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"}],nm=[".workflow.json",".ts",".mjs",".js"];function tm(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(tm,"workflowRunMatchesSubcommand");function jn(e){return/^[a-zA-Z0-9._-]{1,120}$/.test(e)&&!e.startsWith(".")&&!e.includes("..")}a(jn,"isWorkflowRunEntryName");function rm(e,o){let n=Dn(e,"workflow-metadata.json");if(Nn(n))try{let r=JSON.parse(Ha(n,"utf8"));if(typeof r=="object"&&r!==null){let s=r.displayName;if(typeof s=="string"&&jn(s.trim()))return s.trim()}}catch{}let t=o.displayName;return typeof t=="string"&&jn(t.trim())?t.trim():void 0}a(rm,"readWorkflowRunDisplayName");function im(){let e=Ce(process.cwd()).key,o=W("workflow-runs",e);if(!Nn(o))return[];let n=[];for(let t of Fa(o)){if(!jn(t))continue;let r=Dn(o,t,"run.json");if(Nn(r))try{let s=JSON.parse(Ha(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=rm(Dn(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(im,"getPersistedWorkflowRunIdArgs");function Un(e){let o=Fe().list().filter(r=>tm(e,r.status)).map(r=>({name:r.runId,description:`${r.workflow} - ${r.status}`,type:"string"})),n=Zf.has(e)?im():[],t=new Set;return[...o,...n].filter(r=>t.has(r.name)?!1:(t.add(r.name),!0))}a(Un,"getWorkflowRunIdArgs");function sm(e){for(let o of nm)if(e.endsWith(o)){let n=e.slice(0,-o.length);return jn(n)?n:void 0}}a(sm,"savedWorkflowNameFromFile");function jo(e={}){let o=[{path:W("workflows"),source:"personal"},{path:Dn(process.cwd(),".kodax","workflows"),source:"project"}],n=new Map;for(let t of o)if(Nn(t.path))try{for(let r of Fa(t.path)){if(e.generatedOnly===!0&&!r.endsWith(".workflow.json"))continue;let s=sm(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(jo,"getSavedWorkflowNameArgs");function am(){let e=new Map;for(let o of Un("rerun"))e.set(o.name,{...o,description:`recent run: ${o.description}`,type:"string"});for(let o of jo()){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(am,"getWorkflowRerunArgs");function vr(e){let o=new Map;for(let n of Un(e))o.set(n.name,{...n,description:`workflow run: ${n.description}`,type:"string"});for(let n of jo({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(vr,"getWorkflowRunOrSavedNameArgs");function Ua(e){let o=new Set(e.slice(1).filter(n=>n.startsWith("--")));return o.has("--saved")?jo({generatedOnly:!0}):o.has("--run")?Un("delete"):vr("delete")}a(Ua,"getWorkflowDeleteTargetArgs");function lm(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;if(t<=1)return[...Yf,...Yo().map(r=>({name:r.name,description:r.description,type:"enum"})),...jo()];if(n==="rerun"&&t<=2)return am();if(n==="rename"&&t<=2)return vr("rename");if(n==="delete"&&t<=2)return[...om,...Ua(e)];if(n==="delete"&&t<=3&&e.slice(1).some(r=>r.startsWith("--")))return Ua(e);if(n==="revise"){if(t<=2)return[{name:"--replace",description:"Replace a saved workflow after confirmation",type:"enum"},...vr("revise")];if(e[1]==="--replace"&&t<=3)return jo()}return Jf.has(n)&&t<=2?Un(n):n==="runs"&&t<=2?Qf:n==="prune"&&t<=2?em:[]}a(lm,"getWorkflowArgs");function cm(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;return t<=1?Gf:t>2?[]:n==="mode"?zf:n==="trace"?Xf:[]}a(cm,"getRepoIntelArgs");var dm=new Map([["mode",Lf],["thinking",so],["think",so],["t",so],["reasoning",so],["reason",so],["effort",so],["status",hr],["info",hr],["ctx",hr],["mcp",Of],["fallback",Nf],["auto-engine",Df],["agent-mode",Da],["am",Da],["verifier-log",ja],["stall-log",ja],["memory",jf],["goal",Hf],["paste",Kf],["review",Bf],["agents",qf],["delete",yr],["rm",yr],["del",yr]]),um=new Set(["model","m","provider"]),fm=new Set(["repo-intel"]),mm=new Set(["repointel","ri"]),pm=new Set(["workflow"]),gm=new Set(["learn"]);function kr(e,o,n=[]){let t=e.toLowerCase();return um.has(t)?Wf(o):fm.has(t)?cm(n):mm.has(t)?n.length<=1?Vf:[]:pm.has(t)?lm(n):gm.has(t)?Ff(n):dm.get(t)??[]}a(kr,"getCommandArguments");var br=class{static{a(this,"ArgumentCompleter")}canComplete(o,n){let t=o.slice(0,n),r=io(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 kr(c).length>0}async getCompletions(o,n){let t=o.slice(0,n),r=io(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=kr(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 jv(){return new br}a(jv,"createArgumentCompleter");export{wt as a,B as b,ag as c,us as d,lg as e,on as f,Ga as g,km as h,za as i,bm as j,nn as k,Ri as l,yo as m,ko as n,qe as o,Ge as p,Li as q,Wi as r,Oi as s,Ki as t,Bi as u,st as v,Gi as w,Cl as x,Pl as y,Ip as z,Bp as A,Tl as B,ft as C,qp as D,Gp as E,is as F,Qp as G,ds as H,ie as I,ps as J,gs as K,pg as L,zl as M,ac as N,gg as O,cn as P,yt as Q,wg as R,As as S,hg as T,yg as U,vg as V,Gg as W,zg as X,Xg as Y,Us as Z,At as _,Fs as $,Ce as aa,ew as ba,Co as ca,Tt as da,Pe as ea,Fd as fa,Hd as ga,sa as ha,Rw as ia,Cw as ja,ou as ka,Sh as la,xh as ma,Ah as na,Bh as oa,qh as pa,Gh as qa,zh as ra,Xh as sa,va as ta,ey as ua,oy as va,ba as wa,ny as xa,by as ya,$a as za,No as Aa,uv as Ba,fv as Ca,Wn as Da,br as Ea,jv as Fa,io as Ga,gr as Ha,wr as Ia,Rv as Ja};
|
|
679
|
+
`)){if(!c.trim())continue;let d=Tf(c);if(!d)continue;let u=ro.resolve(r,d),f=ro.relative(e,u).split(ro.sep).join("/");if(!(!f||f.startsWith("..")||l.has(f))&&(l.add(f),s.push(f),s.length>=o))break}return s}catch{return[]}}a(Na,"getRecentWorkingSetFiles");function io(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(io,"findCommandSlashIndex");var gr=class{static{a(this,"FileCompleter")}cwdSource;cache=new Map;cacheTimeout=5e3;recentCache=new Map;recentFilesProvider;constructor(o,n=Na){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:Do.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=Do.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&&!Do.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=>{On.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=>{On.stat(o,(t,r)=>{n(!t&&r.isDirectory())})})}},wr=class{static{a(this,"CommandCompleter")}commands;constructor(){this.commands=new Map,this.loadCommands()}loadCommands(){for(let n of No().getAll())n.userInvocable!==!1&&this.commands.set(n.name,{description:n.description,aliases:n.aliases??[]});let o=re();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=io(t);return r===-1?!1:!t.slice(r).includes(" ")}async getCompletions(o,n){let t=o.slice(0,n),r=io(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 Rv(e){let o=new gr(e),n=new Wn,t=new wr;return async r=>{let s=r.includes("@"),l=r.includes("/");if(!s&&!l)return[[],r];let c=[];if(l){let u=await Mf(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=>_f(r,u)),r]}}a(Rv,"createCompleter");async function Mf(e,o){let{ArgumentCompleter:n}=await import("./argument-completer-HIJBXRUT.js"),t=new n;return t.canComplete(e,o)?t.getCompletions(e,o):[]}a(Mf,"getArgumentCompletions");function _f(e,o){if(o.type!=="argument")return o.text;let n=io(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(_f,"formatReadlineCompletion");import{existsSync as Nn,readdirSync as Fa,readFileSync as Ha}from"node:fs";import{join as Dn}from"node:path";var Lf=[{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"}],so=[{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 Wf(e){if(e&&e.includes("/")){let o=e.indexOf("/"),n=e.slice(0,o),t=e.slice(o+1);if(Oe(n))try{return Ke(n).filter(s=>!t||s.toLowerCase().includes(t.toLowerCase())).map(s=>({name:`${n}/${s}`,description:s,type:"enum"}))}catch{}return[]}return Ne().map(o=>({name:o,description:`Switch to ${o} provider`,type:"enum"}))}a(Wf,"getModelArgs");var hr=[{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"}],yr=[{name:"all",description:"Delete ALL sessions",type:"enum"}],Of=[{name:"status",description:"Show MCP server status",type:"enum"},{name:"refresh",description:"Refresh MCP server catalogs",type:"enum"}],Nf=[{name:"status",description:"Show child-task fallback order",type:"enum"},{name:"off",description:"Disable child-task fallback providers",type:"enum"}],Df=[{name:"llm",description:"Use LLM classifier for auto mode",type:"enum"},{name:"rules",description:"Use rules-only auto mode",type:"enum"}],Da=[{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"}],ja=[{name:"on",description:"Enable logging",type:"enum"},{name:"off",description:"Disable logging",type:"enum"}],jf=[{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"}],Uf=[{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 Ff(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;return t<=1?Uf: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(Ff,"getLearnArgs");var Hf=[{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"}],Kf=[{name:"show",description:"Show a captured paste by id",type:"enum"},{name:"list",description:"List captured pastes",type:"enum"}],Bf=[{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"}],qf=[{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"}],Gf=[{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"}],zf=[{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"}],Xf=[{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"}],Vf=[{name:"status",description:"Deprecated alias for /repo-intel status",type:"enum"}],Yf=[{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"}],Jf=new Set(["show","pause","resume","stop","delete","rerun","save","rename","revise"]),Zf=new Set(["show","delete","rerun","save","rename","revise"]),Qf=[{name:"--all",description:"Show all persisted workflow runs",type:"enum"},{name:"--limit",description:"Show at most N persisted workflow runs",type:"enum"}],em=[{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"}],om=[{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"}],nm=[".workflow.json",".ts",".mjs",".js"];function tm(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(tm,"workflowRunMatchesSubcommand");function jn(e){return/^[a-zA-Z0-9._-]{1,120}$/.test(e)&&!e.startsWith(".")&&!e.includes("..")}a(jn,"isWorkflowRunEntryName");function rm(e,o){let n=Dn(e,"workflow-metadata.json");if(Nn(n))try{let r=JSON.parse(Ha(n,"utf8"));if(typeof r=="object"&&r!==null){let s=r.displayName;if(typeof s=="string"&&jn(s.trim()))return s.trim()}}catch{}let t=o.displayName;return typeof t=="string"&&jn(t.trim())?t.trim():void 0}a(rm,"readWorkflowRunDisplayName");function im(){let e=Ce(process.cwd()).key,o=W("workflow-runs",e);if(!Nn(o))return[];let n=[];for(let t of Fa(o)){if(!jn(t))continue;let r=Dn(o,t,"run.json");if(Nn(r))try{let s=JSON.parse(Ha(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=rm(Dn(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(im,"getPersistedWorkflowRunIdArgs");function Un(e){let o=Fe().list().filter(r=>tm(e,r.status)).map(r=>({name:r.runId,description:`${r.workflow} - ${r.status}`,type:"string"})),n=Zf.has(e)?im():[],t=new Set;return[...o,...n].filter(r=>t.has(r.name)?!1:(t.add(r.name),!0))}a(Un,"getWorkflowRunIdArgs");function sm(e){for(let o of nm)if(e.endsWith(o)){let n=e.slice(0,-o.length);return jn(n)?n:void 0}}a(sm,"savedWorkflowNameFromFile");function jo(e={}){let o=[{path:W("workflows"),source:"personal"},{path:Dn(process.cwd(),".kodax","workflows"),source:"project"}],n=new Map;for(let t of o)if(Nn(t.path))try{for(let r of Fa(t.path)){if(e.generatedOnly===!0&&!r.endsWith(".workflow.json"))continue;let s=sm(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(jo,"getSavedWorkflowNameArgs");function am(){let e=new Map;for(let o of Un("rerun"))e.set(o.name,{...o,description:`recent run: ${o.description}`,type:"string"});for(let o of jo()){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(am,"getWorkflowRerunArgs");function vr(e){let o=new Map;for(let n of Un(e))o.set(n.name,{...n,description:`workflow run: ${n.description}`,type:"string"});for(let n of jo({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(vr,"getWorkflowRunOrSavedNameArgs");function Ua(e){let o=new Set(e.slice(1).filter(n=>n.startsWith("--")));return o.has("--saved")?jo({generatedOnly:!0}):o.has("--run")?Un("delete"):vr("delete")}a(Ua,"getWorkflowDeleteTargetArgs");function lm(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;if(t<=1)return[...Yf,...Yo().map(r=>({name:r.name,description:r.description,type:"enum"})),...jo()];if(n==="rerun"&&t<=2)return am();if(n==="rename"&&t<=2)return vr("rename");if(n==="delete"&&t<=2)return[...om,...Ua(e)];if(n==="delete"&&t<=3&&e.slice(1).some(r=>r.startsWith("--")))return Ua(e);if(n==="revise"){if(t<=2)return[{name:"--replace",description:"Replace a saved workflow after confirmation",type:"enum"},...vr("revise")];if(e[1]==="--replace"&&t<=3)return jo()}return Jf.has(n)&&t<=2?Un(n):n==="runs"&&t<=2?Qf:n==="prune"&&t<=2?em:[]}a(lm,"getWorkflowArgs");function cm(e){let[o=""]=e,n=o.toLowerCase(),t=e.length===1&&e[0]===""?0:e.length;return t<=1?Gf:t>2?[]:n==="mode"?zf:n==="trace"?Xf:[]}a(cm,"getRepoIntelArgs");var dm=new Map([["mode",Lf],["thinking",so],["think",so],["t",so],["reasoning",so],["reason",so],["effort",so],["status",hr],["info",hr],["ctx",hr],["mcp",Of],["fallback",Nf],["auto-engine",Df],["agent-mode",Da],["am",Da],["verifier-log",ja],["stall-log",ja],["memory",jf],["goal",Hf],["paste",Kf],["review",Bf],["agents",qf],["delete",yr],["rm",yr],["del",yr]]),um=new Set(["model","m","provider"]),fm=new Set(["repo-intel"]),mm=new Set(["repointel","ri"]),pm=new Set(["workflow"]),gm=new Set(["learn"]);function kr(e,o,n=[]){let t=e.toLowerCase();return um.has(t)?Wf(o):fm.has(t)?cm(n):mm.has(t)?n.length<=1?Vf:[]:pm.has(t)?lm(n):gm.has(t)?Ff(n):dm.get(t)??[]}a(kr,"getCommandArguments");var br=class{static{a(this,"ArgumentCompleter")}canComplete(o,n){let t=o.slice(0,n),r=io(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 kr(c).length>0}async getCompletions(o,n){let t=o.slice(0,n),r=io(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=kr(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 jv(){return new br}a(jv,"createArgumentCompleter");export{wt as a,B as b,ag as c,us as d,lg as e,on as f,Ga as g,km as h,za as i,bm as j,nn as k,Ri as l,yo as m,ko as n,qe as o,Ge as p,Li as q,Wi as r,Oi as s,Ki as t,Bi as u,st as v,Gi as w,Cl as x,Pl as y,Ip as z,Bp as A,Tl as B,ft as C,qp as D,Gp as E,is as F,Qp as G,ds as H,ie as I,ps as J,gs as K,pg as L,zl as M,ac as N,gg as O,cn as P,yt as Q,wg as R,As as S,hg as T,yg as U,vg as V,Gg as W,zg as X,Xg as Y,Us as Z,At as _,Fs as $,Ce as aa,ew as ba,Co as ca,Tt as da,Pe as ea,Fd as fa,Hd as ga,sa as ha,Rw as ia,Cw as ja,ou as ka,Sh as la,xh as ma,Ah as na,Bh as oa,qh as pa,Gh as qa,zh as ra,Xh as sa,va as ta,ey as ua,oy as va,ba as wa,ny as xa,by as ya,$a as za,No as Aa,uv as Ba,fv as Ca,Wn as Da,br as Ea,jv as Fa,io as Ga,gr as Ha,wr as Ia,Rv as Ja};
|