@kodax-ai/kodax 0.7.97-beta.1 → 0.7.97-beta.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 +61 -0
- package/README.md +28 -2
- package/README_CN.md +18 -1
- package/dist/chunks/agent-DS7M57WD.js +2 -0
- package/dist/chunks/agent-adapter-TLWGGK3V.js +2 -0
- package/dist/chunks/argument-completer-OGCXKTRQ.js +2 -0
- package/dist/chunks/{cell-ABNYMGXV.js → cell-LV7MNPNQ.js} +1 -1
- package/dist/chunks/{chunk-KQ3XVHKK.js → chunk-2HH5AS7E.js} +55 -55
- package/dist/chunks/{chunk-6VHO36HK.js → chunk-3CP7AUWY.js} +1 -1
- package/dist/chunks/{chunk-ADIWJDFS.js → chunk-53CJDQS2.js} +1 -1
- package/dist/chunks/{chunk-3ZEJRVNA.js → chunk-5MUVRFMU.js} +1 -1
- package/dist/chunks/{chunk-KJBS6L7Q.js → chunk-6TITQQAI.js} +155 -155
- package/dist/chunks/{chunk-HA4IKFUK.js → chunk-BBZWF2EA.js} +1 -1
- package/dist/chunks/{chunk-W6MHQ7ED.js → chunk-C6JGLEYD.js} +1 -1
- package/dist/chunks/{chunk-NM3AINLH.js → chunk-D36OIMV7.js} +29 -29
- package/dist/chunks/{chunk-LWOGHKTL.js → chunk-D425EZGC.js} +1 -1
- package/dist/chunks/{chunk-7SX7CHYP.js → chunk-DCE7XQUG.js} +1 -1
- package/dist/chunks/{chunk-N2B6A3CX.js → chunk-DV5YPYLW.js} +1 -1
- package/dist/chunks/{chunk-5MDNQCAV.js → chunk-EISRVOBJ.js} +2 -2
- package/dist/chunks/chunk-EPK6EWRI.js +12 -0
- package/dist/chunks/{chunk-G2IMBA3R.js → chunk-F6GJXQNA.js} +5 -5
- package/dist/chunks/chunk-GJXOTOZB.js +465 -0
- package/dist/chunks/{chunk-F7H6CDJN.js → chunk-I325ER7D.js} +1 -1
- package/dist/chunks/{chunk-E2Z754K5.js → chunk-J2L2NK6E.js} +57 -57
- package/dist/chunks/chunk-JAF2YLZO.js +14 -0
- package/dist/chunks/{chunk-A3SLNYBB.js → chunk-KDSO7V4O.js} +1 -1
- package/dist/chunks/{chunk-654JOM24.js → chunk-MCDZNQWD.js} +4 -4
- package/dist/chunks/{chunk-KDRYQKT7.js → chunk-NSR4RW2F.js} +1 -1
- package/dist/chunks/chunk-OGTRDK4Q.js +359 -0
- package/dist/chunks/{chunk-GYNAAIZP.js → chunk-P55RJIOG.js} +1 -1
- package/dist/chunks/chunk-QSZCR5GC.js +190 -0
- package/dist/chunks/chunk-R2HTPDI7.js +2 -0
- package/dist/chunks/chunk-R42S4BLA.js +2 -0
- package/dist/chunks/chunk-RYBUYHDL.js +5 -0
- package/dist/chunks/{chunk-XGUGEVCK.js → chunk-SDPZFH6M.js} +1 -1
- package/dist/chunks/chunk-SK3RRGHJ.js +142 -0
- package/dist/chunks/chunk-TQ475LOI.js +2 -0
- package/dist/chunks/{chunk-ZT2LR3KD.js → chunk-UL6YIT4M.js} +1 -1
- package/dist/chunks/{chunk-7U2BL7CM.js → chunk-V2XJSFFE.js} +1 -1
- package/dist/chunks/{chunk-TXI6SHDO.js → chunk-W2CWO4PQ.js} +1 -1
- package/dist/chunks/{chunk-SCGXZ2QT.js → chunk-WWPVEK6B.js} +1 -1
- package/dist/chunks/{chunk-FMZN5F3Q.js → chunk-X5M7TLJV.js} +1 -1
- package/dist/chunks/{chunk-FZZMHNDB.js → chunk-XDMNJW6J.js} +5 -5
- package/dist/chunks/{chunk-VT35IZEZ.js → chunk-XZSFUGPN.js} +1 -1
- package/dist/chunks/{client-3JEK33QQ.js → client-LTIFNED5.js} +1 -1
- package/dist/chunks/compaction-config-ECMOFP5H.js +2 -0
- package/dist/chunks/{construction-bootstrap-HCRLORKG.js → construction-bootstrap-OAZKGI5Y.js} +1 -1
- package/dist/chunks/dist-5J53DGAO.js +2 -0
- package/dist/chunks/{google-native-45I4S26I.js → google-native-WLL27OV7.js} +1 -1
- package/dist/chunks/host-65E5NM5P.js +2 -0
- package/dist/chunks/model-DZF6URW3.js +2 -0
- package/dist/chunks/{permission-MTSFSB74.js → permission-YVVMLQ5I.js} +1 -1
- package/dist/chunks/readline-helpers-UZXWBRXQ.js +2 -0
- package/dist/chunks/run-manager-ZFACIZM2.js +2 -0
- package/dist/chunks/running-session-Q5Y6A2QV.js +2 -0
- package/dist/chunks/{skills-V7T55I4F.js → skills-TJP6BLZJ.js} +1 -1
- package/dist/chunks/{tool-dispatch-ZVIDGKB4.js → tool-dispatch-MLM3QTSU.js} +1 -1
- package/dist/chunks/{utils-WGRFGT7S.js → utils-2QNMYRGA.js} +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +2 -2
- package/dist/kodax_bootstrap.js +1 -1
- package/dist/kodax_cli.js +1534 -1532
- package/dist/kodax_doctor.js +1 -1
- package/dist/manual-topics.json +17 -2
- 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 +2 -2
- package/dist/one-shot-task.js +1 -1
- package/dist/provider-auth-cli.js +1 -1
- package/dist/runtime-daemon-schema.json +1 -1
- package/dist/sandbox-network-broker.js +77 -77
- package/dist/script-cell.js +1 -1
- package/dist/script-worker.cjs +30 -7
- package/dist/sdk-a2a.d.ts +11 -11
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-agent.d.ts +13 -9
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-client.d.ts +5 -5
- package/dist/sdk-client.js +1 -1
- package/dist/sdk-coding.d.ts +57 -16
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +11 -11
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +15 -15
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-runtime.d.ts +14 -14
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-sandbox.js +1 -1
- package/dist/sdk-session.d.ts +6 -6
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +70 -70
- package/dist/static-text.json +50 -2
- package/dist/storage-repair-cli.js +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-RblzA9kO.d.ts → bash-prefix-extractor.d-CJliu5-D.d.ts} +43 -2
- package/dist/types-chunks/{capsule.d-C-saon3X.d.ts → capsule.d-EMwSALqK.d.ts} +3 -3
- package/dist/types-chunks/{client-contract-D8HXN_iu.d.ts → client-contract-B7q69yMA.d.ts} +19 -3
- package/dist/types-chunks/{controller.d-pXik2EIy.d.ts → controller.d-D-hPLKaA.d.ts} +1 -1
- package/dist/types-chunks/{manifest.d-r74es7yq.d.ts → manifest.d-YE3-AIeO.d.ts} +1 -1
- package/dist/types-chunks/{public-api.d-CvDSMmN2.d.ts → public-api.d-BhDU643p.d.ts} +3 -3
- package/dist/types-chunks/{review-packet.d-C0NYHPdq.d.ts → review-packet.d-ChOfJaNI.d.ts} +1 -1
- package/dist/types-chunks/{run-manager.d-COrEJ-hn.d.ts → run-manager.d-ChzguipG.d.ts} +12 -6
- package/dist/types-chunks/{runtime-client-info-DJ9srk4O.d.ts → runtime-client-info-P_mRDG7j.d.ts} +6 -1
- package/dist/types-chunks/{runtime-event-B24TGIxk.d.ts → runtime-event-BW5Pla7a.d.ts} +1 -1
- package/dist/types-chunks/{sdk-runtime-CBPScTNR.d.ts → sdk-runtime-cDe7qmN3.d.ts} +18 -10
- package/dist/types-chunks/{sdk-session-D_bf_sN2.d.ts → sdk-session-D3pcSbnA.d.ts} +1 -1
- package/dist/types-chunks/{skill-invocation-error.d-FJ6ZujRz.d.ts → skill-invocation-error.d-gsNNDnnt.d.ts} +2 -2
- package/dist/types-chunks/{trusted-repl-entry-9i4hUuj-.d.ts → trusted-repl-entry-Bbkd2HlO.d.ts} +6 -6
- package/dist/types-chunks/{types.d-CTo0NiAM.d.ts → types.d-BlXTogOo.d.ts} +2 -0
- package/dist/types-chunks/{utils.d-BhoGV3yv.d.ts → utils.d-CxHyBvO6.d.ts} +5 -5
- package/docs/SDK_MIGRATION.md +264 -1
- package/docs/SPACE_SDK_SEAMS.md +1 -1
- package/package.json +1 -1
- package/public_docs/README.md +8 -3
- package/public_docs/sdk/embedder-guide.md +1 -1
- package/dist/chunks/agent-OY4U4WOU.js +0 -2
- package/dist/chunks/agent-adapter-NDH3DMPG.js +0 -2
- package/dist/chunks/argument-completer-Q6GMPJ74.js +0 -2
- package/dist/chunks/chunk-4KR4VUZK.js +0 -142
- package/dist/chunks/chunk-5WZ5FUUD.js +0 -14
- package/dist/chunks/chunk-7OTOH4PT.js +0 -465
- package/dist/chunks/chunk-BZF7WPRK.js +0 -357
- package/dist/chunks/chunk-ED7D73C3.js +0 -2
- package/dist/chunks/chunk-LPHKXPF7.js +0 -190
- package/dist/chunks/chunk-MJ4IGUD4.js +0 -5
- package/dist/chunks/chunk-NQ4XK3B2.js +0 -2
- package/dist/chunks/chunk-PRH5G5J7.js +0 -12
- package/dist/chunks/chunk-YB24NTBC.js +0 -2
- package/dist/chunks/compaction-config-NKDAUZNH.js +0 -2
- package/dist/chunks/dist-NTS7CJG3.js +0 -2
- package/dist/chunks/host-RHJ3VGYE.js +0 -2
- package/dist/chunks/model-WCSO7VEC.js +0 -2
- package/dist/chunks/readline-helpers-KZQCE3NH.js +0 -2
- package/dist/chunks/run-manager-MWEV42C5.js +0 -2
- package/dist/chunks/running-session-3BYAXGLK.js +0 -2
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{a as v}from"./chunk-GZUWQZJD.js";import{a as M}from"./chunk-ED7D73C3.js";import{a as g}from"./chunk-65652LR4.js";import{a as u}from"./chunk-V4WSBIXB.js";import{isDeepStrictEqual as S}from"node:util";var _="script_exec",f={timeoutMs:6e4,memoryBytes:32*1024*1024,maxCalls:64,maxTransferBytes:1024*1024},x=new WeakMap;function O(e){return g("t12.agent-runtime/script/model.0")+`Use native bash for background commands. Limits: ${f.timeoutMs/1e3}s cell deadline (admitted host calls drain before return), ${f.maxCalls} attempted calls, ${f.memoryBytes/1024/1024}MiB VM memory, ${f.maxTransferBytes/1024/1024}MiB per transfer.
|
|
3
|
-
Callable contracts (JSON Schema):
|
|
4
|
-
`+e.map(n=>JSON.stringify(n)).join(`
|
|
5
|
-
`)}u(O,"buildScriptModelDescription");function E(e,n){let r=x.get(e);return r&&n.some(s=>s.name===_&&s.description===r.entry.description&&S(s.input_schema,r.entry.input_schema))?r:void 0}u(E,"getScriptModelContracts");function C(e){let n=e.receipts.map(({id:a,name:t,result:m})=>({id:a,name:t,result:m})),r=JSON.stringify({...e,receipts:n}),s=u(a=>{for(let t of e.receipts){if(S(a,t.result))return{id:t.id,field:"result"};if(S(a,t.result.content))return{id:t.id,field:"content"}}},"findReference"),c=s(e.value),p;if(c){let{value:a,...t}=e;p={...t,receipts:n,value_from_receipt:c}}else if(e.value&&typeof e.value=="object"&&!Array.isArray(e.value)){let a=Object.entries(e.value),t=a.flatMap(([o,h])=>{let d=s(h);return d?[[o,d]]:[]});if(!t.length)return r;let m=new Set(t.map(([o])=>o));p={...e,receipts:n,value:Object.fromEntries(a.filter(([o])=>!m.has(o))),value_fields_from_receipts:Object.fromEntries(t)}}else return r;let l=JSON.stringify({...p,value_reference_note:g("t12.agent-runtime/script/model.1")});return l.length<r.length?l:r}u(C,"serializeModelReceipt");function N(e,n,r,s){if(e.tools?.some(t=>t.name===_))throw new Error("Script entry conflicts with a host tool.");let c=Object.freeze(r.map(t=>({...t,input_schema:structuredClone(t.input_schema)}))),p=!1,l={name:_,description:O(c),input_schema:{type:"object",properties:{code:{type:"string",description:"Async function body; return a JSON value."}},required:["code"]},requiresSerialExecution:u(()=>!0,"requiresSerialExecution"),execute:u(async(t,m)=>{if(p)return{content:"[Tool Error] Script closed after a host failure. Inspect durable receipts before starting a new Run; do not replay effects.",isError:!0};if(typeof t.code!="string")return{content:"[Tool Error] code must be a string.",isError:!0};try{M(t.code,f)}catch(i){return{content:`[Tool Error] ${String(i)}`,isError:!0}}let o;try{o=await s(t.code,m)}catch(i){throw p=!0,i}let h=o.receipts.flatMap(i=>typeof i.result.content=="string"?[]:i.result.content.filter(y=>y.type==="image")),d=C(o);return{content:h.length?[{type:"text",text:d},...h]:d,isError:o.status!=="completed"||o.hadToolErrors,metadata:{scriptCellStatus:o.status,scriptReadPaths:o.receipts.flatMap(i=>{let y=i.result.metadata?.toolCall,T=y?.name??i.name,b=(y?.input??i.input).path;return T==="read"&&!i.result.isError&&typeof b=="string"?[b]:[]}),...o.status==="cancelled"?{cancelled:!0}:{}}}},"execute")},a=v(Object.freeze({...e,tools:[...e.tools??[],l]}),n);return x.set(a,{entry:{name:l.name,description:l.description,input_schema:structuredClone(l.input_schema)},leaves:c}),a}u(N,"withScriptModelTool");function A(e,n){let r=E(e,n),s=r&&new Set(r.leaves.map(c=>c.name));return s?n.filter(c=>c.name==="bash"||!s.has(c.name)):n}u(A,"projectScriptModelTools");function I(e,n){return n.some(r=>r.name==="read")||E(e,n)?.leaves.some(r=>r.name==="read")===!0}u(I,"canReadWithModelTools");export{_ as a,f as b,O as c,E as d,N as e,A as f,I as g};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{i as F,k as A,o as p}from"./chunk-XGUGEVCK.js";import{c as j}from"./chunk-E2Z754K5.js";import{B as k,Da as h,E,Ea as U,Fa as K,Ka as $,La as D,Q as R,R as x,Ua as m}from"./chunk-4KR4VUZK.js";import{a as l}from"./chunk-V4WSBIXB.js";import{createHash as T,randomUUID as O}from"node:crypto";import{mkdir as M,readFile as X,open as N,rename as b,unlink as B,rm as L,lstat as V}from"node:fs/promises";import w from"node:path";import{spawn as Z}from"node:child_process";import{setTimeout as G}from"node:timers/promises";function v(e){return!!e&&typeof e=="object"&&"code"in e&&e.code==="ENOENT"}l(v,"missing");function u(e){let i=new h("storage_failed");return e&&(i.message+=` Retained lock: ${e}. Inspect with kodax doctor before offline repair.`),i}l(u,"storageError");async function S(e){let i=await V(e);if(i.isSymbolicLink())throw u(e);return i.isDirectory()?w.join(e,"owner.json"):e}l(S,"lockOwnerFile");async function Q(e){let i=Date.now()+3e4;for(;;)try{let t=O();if(A({rootDir:w.dirname(e),lockFile:e},{runtimeId:t,pid:process.pid,createdAt:new Date().toISOString()}))return async()=>{if(p(await S(e))?.runtimeId!==t)throw u(e);let r=`${e}.released.${t}`;await b(e,r),await L(r,{recursive:!0,force:!0,maxRetries:3,retryDelay:20})};let a=await S(e),c=p(a);if(c&&F(c)==="gone"){let r=T("sha256").update(JSON.stringify(c)).digest("hex"),n=`${e}.reclaim.${r}`;if(A({rootDir:w.dirname(e),lockFile:n},{runtimeId:O(),pid:process.pid,createdAt:new Date().toISOString()})){if(JSON.stringify(p(await S(e)))!==JSON.stringify(c))throw u(e);let o=`${e}.abandoned.${r}`;await b(e,o),await L(o,{recursive:!0,force:!0,maxRetries:3,retryDelay:20});continue}}if(Date.now()>=i)throw u(e);await G(20)}catch(t){if(v(t))continue;throw t instanceof h?t:u(e)}}l(Q,"lock");function _(e,i){if(!e||typeof e!="object"||!("id"in e)||e.id!==i||!("clientId"in e)||typeof e.clientId!="string"||!e.clientId.trim()||!("accountId"in e)||typeof e.accountId!="string"||!e.accountId.trim()||!("service"in e)||typeof e.service!="string")throw u();return e}l(_,"registration");async function Y(e,i,t){let s;try{s=await X(e)}catch(a){if(v(a))return;throw u()}try{if(s.length>1024*1024)throw u();let a=await t.unseal(s);try{return _(JSON.parse(Buffer.from(a).toString("utf8")),i)}finally{a.fill(0)}}catch{throw u()}}l(Y,"readRecord");async function ee(e,i,t){if(!i){try{await B(e)}catch(c){if(!v(c))throw u()}return}let s=`${e}.${O()}.tmp`,a=Buffer.from(JSON.stringify(i));try{let c=await t.seal(a),r=await N(s,"wx",384);try{await r.writeFile(c),await r.sync()}finally{await r.close()}if(await b(s,e),process.platform!=="win32"){let n=await N(w.dirname(e),"r");try{await n.sync()}finally{await n.close()}}}catch{throw u()}finally{a.fill(0);try{await B(s)}catch(c){if(!v(c))throw u()}}}l(ee,"commit");function re(e,i){if(!w.isAbsolute(e))throw new Error("OAuth store requires an absolute trusted directory.");return{async transact(t,s){if(!t.trim()||t.length>512)throw u();await M(e,{recursive:!0,mode:448});let a=w.join(e,`${T("sha256").update(t).digest("hex")}.sealed`),c=await Q(`${a}.lock`);try{let r=await Y(a,t,i),n=await s(r?structuredClone(r):void 0);if(n.record&&(_(n.record,t),r&&(r.service!==n.record.service||r.clientId!==n.record.clientId||r.accountId!==n.record.accountId||r.issuer!==n.record.issuer||r.identityKind!==n.record.identityKind||r.profile!==n.record.profile)))throw u();return await ee(a,n.record,i),n.result}finally{await c()}}}}l(re,"createEncryptedOAuthSessionStore");function z(e,i){let t=process.env.SystemRoot;if(!t||!w.isAbsolute(t))return Promise.reject(u());let a=`Add-Type -AssemblyName System.Security; $data = [Convert]::FromBase64String([Console]::In.ReadToEnd()); $result = [Security.Cryptography.ProtectedData]::${i?"Protect":"Unprotect"}($data, $null, [Security.Cryptography.DataProtectionScope]::CurrentUser); [Console]::Out.Write([Convert]::ToBase64String($result))`;return new Promise((c,r)=>{let n=Z(w.join(t,"System32","WindowsPowerShell","v1.0","powershell.exe"),["-NoLogo","-NoProfile","-NonInteractive","-EncodedCommand",Buffer.from(a,"utf16le").toString("base64")],{windowsHide:!0,stdio:["pipe","pipe","pipe"],timeout:15e3}),o=[],d=0;n.stdout.on("data",f=>{d+=f.length,d>2*1024*1024?n.kill():o.push(f)}),n.stderr.resume(),n.on("error",()=>r(u())),n.stdin.on("error",()=>r(u())),n.on("close",f=>{let g=Buffer.concat(o).toString().trim();f!==0||!g||d>2*1024*1024||!/^[A-Za-z0-9+/]+={0,2}$/.test(g)?r(u()):c(Buffer.from(g,"base64"))}),n.stdin.end(Buffer.from(e).toString("base64"))})}l(z,"dpapi");function q(e){if(process.platform!=="win32")throw new Error("Windows DPAPI is unavailable. Supply the trusted Main OS secure-store adapter.");return re(e,{seal:l(i=>z(i,!0),"seal"),unseal:l(i=>z(i,!1),"unseal")})}l(q,"createWindowsOAuthSessionStore");import{createHash as ie}from"node:crypto";import{lstat as te}from"node:fs/promises";import y from"node:path";function ne(e){return m(y.join(y.dirname(e),"auth.json")).oauth}l(ne,"providerOAuthStore");function Oe(e,i){if(e.service!==i.service)throw new Error("OAuth source and session must match.");if(e.profile!==void 0&&(i.profile??"default")!==e.profile)throw new Error("OAuth registration belongs to another profile.");if(e.service==="radius"){if(e.issuer===void 0)throw new Error("Radius requires an approved OAuth issuer.");let t=l(s=>{try{return new URL(s??"").href.replace(/\/$/,"")}catch{throw new Error("Invalid OAuth issuer metadata.")}},"normalize");if(t(e.issuer)!==t(i.issuer))throw new Error("OAuth registration issuer does not match the approved connection.")}}l(Oe,"assertProviderOAuthSessionScope");async function be(e){let i=ne(e.configPath),t=e.registrationId;if(await i.transact(t,async a=>({record:a,result:a!==void 0})))return"current";let s=e.legacyStore;if(!s){let a=y.join(y.dirname(e.configPath),"provider-oauth"),c=y.join(a,`${ie("sha256").update(t).digest("hex")}.sealed`);try{let r=await te(c);if(!r.isFile()||r.isSymbolicLink())throw new Error("Invalid legacy OAuth registration file.")}catch(r){if(r&&typeof r=="object"&&"code"in r&&r.code==="ENOENT")return"absent";throw r}s=q(a)}return s.transact(t,async a=>{if(!a)return{record:a,result:"absent"};let c=await i.transact(t,async r=>r?{record:r,result:!1}:{record:a,result:!0});return{record:a,result:c?"migrated":"current"}})}l(be,"migrateProviderOAuthRegistration");import{randomUUID as J}from"node:crypto";async function Ee(e){if(!e.clientId?.trim()||!!e.browser==!!e.device)throw new h("invalid_session");if(e.profile!==void 0&&(typeof e.profile!="string"||!e.profile.trim()))throw new h("invalid_session");let i,t,s={service:e.service,clientId:e.clientId,scopes:[...e.scopes],issuer:e.issuer,fetch:e.fetch,signal:e.signal};if(e.browser){if(!e.redirectUri)throw new h("invalid_session");let d=await $({...s,redirectUri:e.redirectUri});t=d.nonce;try{i=await d.exchange(await e.browser({authorizationUrl:d.authorizationUrl,signal:e.signal}),e.signal)}finally{d.close()}}else{let d=await D(s);try{await e.device({verificationUri:d.verificationUriComplete??d.verificationUri,userCode:d.userCode,expiresAt:d.expiresAt}),i=await d.poll(e.signal)}finally{d.close()}}e.signal?.throwIfAborted();let a=e.clientId.trim(),c=e.verifyIdentity?await e.verifyIdentity(i,{service:e.service,clientId:a,nonce:t,signal:e.signal}):`grant:${J()}`;if(typeof c!="string"||!c.trim()||c.length>1024)throw new h("invalid_session");let r={id:J(),service:e.service,clientId:a,accountId:c,identityKind:e.verifyIdentity?"account":"grant",credentials:i.tokens,...e.issuer?{issuer:e.issuer}:{},...e.profile?{profile:e.profile}:{}};e.signal?.throwIfAborted(),await e.store.transact(r.id,async d=>{if(d)throw new h("invalid_session");return e.signal?.throwIfAborted(),{record:r,result:void 0}});let n=l(()=>U({id:r.id,store:e.store,driver:K(r.service,{fetch:e.fetch})}),"open"),o;try{return e.signal?.throwIfAborted(),o=await n(),e.signal?.throwIfAborted(),{registrationId:r.id,accountId:r.accountId,identityKind:r.identityKind,session:o}}catch(d){throw e.signal?.aborted&&(o??=await n(),await o.revoke()),d}}l(Ee,"loginProviderOAuth");import{createHash as oe}from"node:crypto";import{readFile as se}from"node:fs/promises";import P from"node:path";async function H(e){let i="";try{i=await se(e,"utf8")}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ENOENT")throw new Error("Cannot read provider configuration.")}let t;try{t=i?JSON.parse(i):{}}catch{throw new Error("Invalid provider configuration.")}if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Invalid provider configuration.");return{config:t,revision:oe("sha256").update(i).digest("hex")}}l(H,"readConfig");function ae(e,i){let t=Object.entries(k).find(([r])=>r===i)?.[1];if(t)return{provider:E(i),apiKeyEnv:t.apiKeyEnv,kind:t.capabilityProfile.transport==="cli-bridge"?"external":"key"};let s=e.customProviders;if(!Array.isArray(s))throw new Error("Unknown configured provider.");let a=s.filter(r=>r&&typeof r=="object"&&"name"in r&&r.name===i);if(a.length!==1)throw new Error("Unknown or duplicate configured provider.");let c=a[0];return R(c),{provider:x(c),apiKeyEnv:c.apiKeyEnv,kind:c.oauth?"oauth":c.cloud?"cloud":"key"}}l(ae,"configuredTarget");function Fe(e={}){let i=e.configPath??j("config.json"),t=e.profile??"default";if(!P.isAbsolute(i)||!t.trim())throw new Error("Credential manager requires a trusted config path and profile.");let s=m(P.join(P.dirname(i),"auth.json")),a=l(async n=>{let o=await H(i),d=ae(o.config,n);return{...d,configRevision:o.revision,binding:{profile:t,provider:n,connectionFingerprint:d.provider.getCredentialConnectionFingerprint()}}},"target"),c=l(async n=>{let o=await a(n),d=await s.describeApiKey(o.binding),f=(e.environment?.()??process.env)[o.apiKeyEnv]?.trim(),g=o.kind==="oauth"||o.kind==="external"?o.kind:d.configured?"file":f?"environment":o.kind==="cloud"?"cloud":"missing";return{binding:o.binding,configRevision:o.configRevision,revision:d.revision??null,apiKeyEnv:o.apiKeyEnv,stored:d.configured,configured:g==="file"||g==="environment",source:g}},"describe"),r=l(async(n,o,d)=>{if(!o||o.revision!==null&&(typeof o.revision!="string"||!o.revision.trim()))throw new Error("Credential update requires an expected revision. Refresh its state before retrying.");let f=await a(n);if(f.kind==="oauth"||f.kind==="external")throw new Error(`Use the provider's ${f.kind==="oauth"?"OAuth":"external"} authentication flow.`);if(o.configRevision!==f.configRevision||o.binding.profile!==f.binding.profile||o.binding.provider!==f.binding.provider||o.binding.connectionFingerprint!==f.binding.connectionFingerprint)throw new Error("Provider configuration or connection changed. Refresh its state before retrying.");let g=await s.readApiKey(f.binding),I=d===void 0?await s.removeApiKey(f.binding,o.revision):await s.setApiKey(f.binding,d.key,o.revision);try{if((await H(i)).revision!==f.configRevision)throw new Error("Provider configuration changed while saving credentials.");return await c(n)}catch(C){try{g?await s.setApiKey(f.binding,g.key,I.revision):await s.removeApiKey(f.binding,I.revision)}catch(W){throw new AggregateError([C,W],"Credential update failed and rollback conflicted. Refresh its state before retrying.")}throw C}},"mutate");return{filePath:s.filePath,describe:c,setApiKey:l((n,o,d)=>r(n,d,{key:o}),"setApiKey"),removeApiKey:l((n,o)=>r(n,o),"removeApiKey")}}l(Fe,"createProviderCredentialManager");export{re as a,q as b,ne as c,Oe as d,be as e,Ee as f,Fe as g};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{f as he}from"./chunk-ISLK6R2P.js";import{Aa as ce,Ba as ue,Cc as K,Dc as pe,Ec as xe,Fa as P,Ga as le,Gd as G,Hd as ge,Kb as me,Ma as E,Rd as C,Sa as fe,Sd as H,a as F,b as ae,ie as q,p as de,q as k,tc as B,uc as Te,vc as j,xa as D,ya as I,za as W}from"./chunk-BZF7WPRK.js";import{c as ne}from"./chunk-GZUWQZJD.js";import{a as oe}from"./chunk-65652LR4.js";import{r as y,wa as re,xa as ie}from"./chunk-KQ3XVHKK.js";import{h as L}from"./chunk-E2Z754K5.js";import{b as se}from"./chunk-A3SLNYBB.js";import{a as i}from"./chunk-V4WSBIXB.js";import X from"node:path";function S(e){let t=E(e);return/^\[(?:Tool Error|Cancelled|Blocked|Error)\]/.test(t)||ye(t)!==void 0}i(S,"isToolResultErrorContent");function V(e){return E(e).startsWith(de)}i(V,"isCancelledToolResultContent");function Ee(e){let t=E(e).trim();return/^\[Tool Error\]\s+[^:]+:\s+([A-Z_]+):/.exec(t)?.[1]??ye(t)}i(Ee,"extractStructuredToolErrorCode");function ye(e){if(!e.trimStart().startsWith("{"))return;let t;try{t=JSON.parse(e)}catch{return}if(!(t===null||typeof t!="object")){if("ok"in t&&t.ok===!1&&"reason"in t&&typeof t.reason=="string"&&"code"in t&&typeof t.code=="string"&&["todo_invalid_input","todo_unavailable","todo_hook_veto","todo_state_conflict"].includes(t.code))return t.code;if(!(!("retryable"in t)||t.retryable!==!1||!("denialSource"in t)||!("code"in t))&&["explicit_rule","builtin_fallback","policy_configuration"].includes(String(t.denialSource)))return typeof t.code=="string"&&["exec_policy_forbidden","exec_policy_prompt_unavailable","exec_policy_invalid"].includes(t.code)?t.code:void 0}}i(ye,"structuredJsonErrorCode");function We(e,t,o){if(!Array.isArray(e.outputs))return[];let s=new Set(e.outputs.flatMap(r=>!r||typeof r!="object"||!("target"in r)||typeof r.target!="string"?[]:r.target.trim()?[X.resolve(o,r.target.trim())]:[])),n;try{n=JSON.parse(E(t))}catch{return[]}return!n||typeof n!="object"||!("outputs"in n)||!Array.isArray(n.outputs)?[]:n.outputs.flatMap(r=>{if(typeof r!="string"||!r.trim())return[];let a=X.resolve(o,r);return s.has(a)?[a]:[]})}i(We,"skillOutputPaths");function z(e,t,o,s){if(!e||!t.input||S(o))return;let n=t.name;if(n==="run_skill_script"){for(let a of We(t.input,o,s))e.set(a,{path:a,sourceTool:n});return}if(n!=="write"&&n!=="edit"&&n!=="multi_edit"&&n!=="insert_after_anchor"||typeof t.input.path!="string"||!t.input.path.trim())return;let r=X.resolve(s,t.input.path);e.get(r)?.sourceTool!=="run_skill_script"&&e.set(r,{path:r,sourceTool:n})}i(z,"recordWrittenFile");import{randomUUID as O}from"node:crypto";import{randomUUID as be}from"node:crypto";function pt(e,t,o,s){let n=Math.min(o,t.capacity.contextWindow??o),r=t.capacity.inputTokens,a=Math.max(0,t.requestInputReliefTokens);return{currentTokens:t.capacity.inputTokensKind==="exact"&&r!==void 0?r+a:Math.max(n+a,(r??0)+a,Re(e,s)),baselineEstimatedTokens:y(e),source:"estimate",capacityWindow:n}}i(pt,"createOverflowContextTokenSnapshot");function v(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}i(v,"isFiniteNonNegative");function ke(e){return!(!e||!v(e.inputTokens)||!v(e.outputTokens)||!v(e.totalTokens)||e.totalTokens<e.inputTokens||e.totalTokens<e.outputTokens||e.cachedReadTokens!==void 0&&!v(e.cachedReadTokens)||e.cachedWriteTokens!==void 0&&!v(e.cachedWriteTokens)||e.thoughtTokens!==void 0&&!v(e.thoughtTokens))}i(ke,"hasValidTokenUsage");function Se(e){let t=y(e);return{currentTokens:t,baselineEstimatedTokens:t,source:"estimate"}}i(Se,"createEstimatedContextTokenSnapshot");function je(e,t){let o=y(e);return{currentTokens:t.inputTokens,baselineEstimatedTokens:o,source:"api",usage:t}}i(je,"createApiContextTokenSnapshot");function xt(e,t){return ke(t)?{currentTokens:t.totalTokens,baselineEstimatedTokens:y(e),source:"api",usage:t}:Se(e)}i(xt,"createCompletedTurnTokenSnapshot");function gt(e,t){return ke(t)?je(e,t):Se(e)}i(gt,"createContextTokenSnapshot");function Re(e,t){let o=y(e);if(!t||!v(t.currentTokens)||!v(t.baselineEstimatedTokens))return o;let s=t.currentTokens+(o-t.baselineEstimatedTokens);return!Number.isFinite(s)||s<0?o:Math.round(s)}i(Re,"resolveContextTokenCount");function ve(e,t){return{currentTokens:Re(e,t),baselineEstimatedTokens:y(e),source:t?.source??"estimate",usage:t?.usage}}i(ve,"rebaseContextTokenSnapshot");function ht(e,t){let o=y(e);return{currentTokens:o,baselineEstimatedTokens:o,source:t?.source??"estimate"}}i(ht,"recomputeContextTokenSnapshot");var Ce=Symbol("KodaXLiveTurnAttributed"),Ie=Symbol("KodaXLiveTurnBaseEvents"),_e=16,we=new Map,b=new Map;function bt(e){let t=e.turnId??`turn_${be().replace(/-/g,"").slice(0,_e)}`,o=e.deliveryId??`delivery_${be().replace(/-/g,"").slice(0,_e)}`,s=e.contextId??e.sessionId,n=e.contextKind??"root";return b.has(s)||b.set(s,0),{sessionId:e.sessionId,turnId:t,contextId:s,contextKind:n,parentContextId:e.parentContextId,agentId:e.agentId,deliveryId:o,deliveryKind:e.deliveryKind??"initial",promptId:e.promptId,ownsContextRevision:e.ownsContextRevision??!0,nextMeta(){let r=(we.get(e.sessionId)??0)+1;return we.set(e.sessionId,r),{sessionId:e.sessionId,seq:r,turnId:t,deliveryId:o,contextId:s,contextKind:n,...e.parentContextId!==void 0?{parentContextId:e.parentContextId}:{},...e.agentId!==void 0?{agentId:e.agentId}:{},contextRevision:b.get(s)??0,timestamp:new Date().toISOString()}},advanceContextRevision(){if(e.ownsContextRevision===!1)return b.get(s)??0;let r=(b.get(s)??0)+1;return b.set(s,r),r}}}i(bt,"createLiveTurnScope");function Ge(e){return e[Ce]===!0}i(Ge,"isAttributedEvents");function J(e){return"current"in e?e.current:e}i(J,"resolveLiveTurnScope");function f(e,t){let o=t?.contextId===void 0||t.contextKind===void 0||t.contextRevision===void 0?{}:{contextId:t.contextId,contextKind:t.contextKind,parentContextId:t.parentContextId,agentId:t.agentId,contextRevision:t.contextRevision,...t.contextKind==="child"&&t.turnId!==void 0?{turnId:t.turnId,deliveryId:t.deliveryId}:{}};return{...t??{},...J(e).nextMeta(),...o}}i(f,"withActivityMeta");function x(e,t){let o=t,s=o.contextId===void 0||o.contextKind===void 0||o.contextRevision===void 0?{}:{contextId:o.contextId,contextKind:o.contextKind,parentContextId:o.parentContextId,agentId:o.agentId,contextRevision:o.contextRevision,...o.contextKind==="child"&&o.turnId!==void 0?{turnId:o.turnId,deliveryId:o.deliveryId}:{}};return{...t,...J(e).nextMeta(),...s}}i(x,"withLiveMeta");function It(e,t){let o=Ge(e)?e[Ie]:e,s={...o,onSessionStart:i(n=>{o.onSessionStart?.(x(t,n))},"onSessionStart"),onOutputSegmentStart:i((n,r)=>{o.onOutputSegmentStart?.(n,f(t,r))},"onOutputSegmentStart"),onTextDelta:i((n,r)=>{o.onTextDelta?.(n,f(t,r))},"onTextDelta"),onOutputNotice:i((n,r)=>{o.onOutputNotice?.(n,f(t,r))},"onOutputNotice"),onThinkingDelta:i((n,r)=>{o.onThinkingDelta?.(n,f(t,r))},"onThinkingDelta"),onThinkingEnd:i((n,r)=>{o.onThinkingEnd?.(n,f(t,r))},"onThinkingEnd"),onToolUseStart:i((n,r)=>{o.onToolUseStart?.(n,f(t,r))},"onToolUseStart"),onToolInputDelta:i((n,r,a)=>{o.onToolInputDelta?.(n,r,f(t,a))},"onToolInputDelta"),onToolProgress:i((n,r)=>{o.onToolProgress?.(n,f(t,r))},"onToolProgress"),onToolSandboxObservation:i((n,r)=>{o.onToolSandboxObservation?.(n,f(t,r))},"onToolSandboxObservation"),onToolResult:i((n,r)=>{o.onToolResult?.(n,f(t,r))},"onToolResult"),onToolExecutionStart:i((n,r)=>{o.onToolExecutionStart?.(n,f(t,r))},"onToolExecutionStart"),onToolExecutionEnd:i((n,r)=>{o.onToolExecutionEnd?.(n,f(t,r))},"onToolExecutionEnd"),onChildActivityEnd:i(n=>{o.onChildActivityEnd?.(f(t,n))},"onChildActivityEnd"),onStreamEnd:i(n=>{o.onStreamEnd?.(f(t,n))},"onStreamEnd"),onIterationStart:i((n,r,a)=>{o.onIterationStart?.(n,r,f(t,a))},"onIterationStart"),onIterationEnd:i(n=>{o.onIterationEnd?.(x(t,n))},"onIterationEnd"),onCompactStart:i(n=>{o.onCompactStart?.(f(t,n))},"onCompactStart"),onCompact:i((n,r)=>{o.onCompact?.(n,f(t,r))},"onCompact"),onCompactStats:i(n=>{o.onCompactStats?.(x(t,n))},"onCompactStats"),onCompactedMessages:i(async(n,r,a)=>{let c=J(t),u=c.advanceContextRevision();try{await o.onCompactedMessages?.(n,r,f(t,a))}catch(m){throw c.ownsContextRevision&&b.get(c.contextId)===u&&b.set(c.contextId,u-1),m}},"onCompactedMessages"),onContextCompactionFinished:i(n=>{o.onContextCompactionFinished?.(x(t,n))},"onContextCompactionFinished"),onCompactEnd:i((n,r)=>{o.onCompactEnd?.(f(t,n),r)},"onCompactEnd"),onMidTurnUserMessages:i((n,r)=>{o.onMidTurnUserMessages?.(n,f(t,r))},"onMidTurnUserMessages"),onRetry:i((n,r,a,c)=>{o.onRetry?.(n,r,a,f(t,c))},"onRetry"),onProviderRateLimit:i((n,r,a,c)=>{o.onProviderRateLimit?.(n,r,a,f(t,c))},"onProviderRateLimit"),onRetryAfter:i((n,r)=>{o.onRetryAfter?.(n,f(t,r))},"onRetryAfter"),onProviderRecovery:i((n,r)=>{o.onProviderRecovery?.(n,f(t,r))},"onProviderRecovery"),onReasoningEffortRejected:i(n=>{o.onReasoningEffortRejected?.(x(t,n))},"onReasoningEffortRejected"),onReasoningResolved:i(n=>{o.onReasoningResolved?.(x(t,n))},"onReasoningResolved"),onRepoIntelligenceTrace:i(n=>{o.onRepoIntelligenceTrace?.(x(t,n))},"onRepoIntelligenceTrace"),onContextBudgetSnapshot:i(n=>{o.onContextBudgetSnapshot?.(x(t,n))},"onContextBudgetSnapshot"),onPromptCacheDiagnostics:i(n=>{o.onPromptCacheDiagnostics?.(x(t,n))},"onPromptCacheDiagnostics"),onToolExposurePlanned:i(n=>{o.onToolExposurePlanned?.(x(t,n))},"onToolExposurePlanned"),onContextCompactionSkipped:i(n=>{o.onContextCompactionSkipped?.(x(t,n))},"onContextCompactionSkipped"),onTodoUpdate:i((n,r)=>{o.onTodoUpdate?.(n,f(t,r))},"onTodoUpdate"),onTodoDriftWarning:i(n=>{o.onTodoDriftWarning?.(x(t,n))},"onTodoDriftWarning"),onManagedTaskStatus:i(n=>{o.onManagedTaskStatus?.(x(t,n))},"onManagedTaskStatus"),onEffectiveConfig:i(n=>{o.onEffectiveConfig?.(x(t,n))},"onEffectiveConfig"),onWorkflowProcessEvent:i(n=>{o.onWorkflowProcessEvent?.(x(t,n))},"onWorkflowProcessEvent"),onWorkflowAgentDigest:i(n=>{o.onWorkflowAgentDigest?.(x(t,n))},"onWorkflowAgentDigest"),onScoutSuspiciousCompletion:i(n=>{o.onScoutSuspiciousCompletion?.(x(t,n))},"onScoutSuspiciousCompletion"),onComplete:i(n=>{o.onComplete?.(f(t,n))},"onComplete"),onError:i((n,r)=>{o.onError?.(n,f(t,r))},"onError")};return Object.defineProperty(s,Ce,{value:!0,enumerable:!1}),Object.defineProperty(s,Ie,{value:o,enumerable:!1}),s}i(It,"withLiveTurnAttribution");function _t(e,t){let o={...t.nextMeta(),deliveryKind:t.deliveryKind,...t.promptId!==void 0?{promptId:t.promptId}:{}};e.onTurnStarted?.(o)}i(_t,"emitTurnStarted");function wt(e,t,o){e.onTurnCompleted?.({...t.nextMeta(),status:o})}i(wt,"emitTurnCompleted");function Ct(e,t,o){let s={...t.nextMeta(),error:{name:o.name,message:o.message,...o.stack!==void 0?{stack:o.stack}:{}}};e.onTurnFailed?.(s)}i(Ct,"emitTurnFailed");var He=new Set(["todo_update","todo_list","todo_create","todo_get"]);function M(e){return!he(e)&&!He.has(e)}i(M,"isVisibleToolName");function Mt(e,t){return e.hasPendingInputs?.()===!0?!0:se().has({agentId:t,maxPriority:"user",mode:"prompt"})}i(Mt,"hasQueuedFollowUp");function At(e,t){e.onSessionStart?.(t)}i(At,"emitSessionStart");function Ot(e,t){t===void 0?e.onStreamEnd?.():e.onStreamEnd?.(t)}i(Ot,"emitStreamEnd");function Lt(e){e.onComplete?.()}i(Lt,"emitComplete");function Dt(e,t){e.onError?.(t)}i(Dt,"emitError");function Pt(e,t,o,s,n){if(n!==void 0){e.onProviderRateLimit?.(t,o,s,n);return}e.onProviderRateLimit?.(t,o,s)}i(Pt,"emitProviderRateLimit");function Bt(e,t,o){e.onIterationStart?.(t+1,o)}i(Bt,"emitIterationStart");function Kt(e,t){let o=ve(t.messages,t.snapshotOverride??t.currentSnapshot);return e.onIterationEnd?.({iter:t.iter,maxIter:t.maxIter,tokenCount:o.currentTokens,tokenSource:o.source,usage:o.usage,contextTokenSnapshot:o}),o}i(Kt,"emitIterationEnd");async function Q(e,t,o,s,n,r,a){if(e.beforeToolExecute){let u=await e.beforeToolExecute(t,o,{toolId:s});if(u===!1)return a?.denyRead(t,o),k;if(typeof u=="string")return a?.denyRead(t,o),u}let c=await ge("tool:before",{name:t,input:o,toolId:s,executionCwd:n,gitRoot:r});return c===!1?(a?.denyRead(t,o),k):(typeof c=="string"&&a?.denyRead(t,o),typeof c=="string"?c:void 0)}i(Q,"getToolExecutionOverride");import Ve from"fs";function qe(){return process.env.KODAX_DEBUG_STREAM==="1"||process.env.KODAX_DEBUG_RESILIENCE==="1"}i(qe,"shouldDebugResilience");function U(e,t){qe()&&L({source:"coding:resilience",level:"debug",message:e,detail:t})}i(U,"emitResilienceDebug");function $(e,t){let o=e.input?.path;if(!(typeof o!="string"||o.trim().length===0))return ae(o,t)}i($,"resolveToolTargetPath");function Y(e,t){t&&(e.editRecoveryAttempts.delete(t),e.blockedEditWrites.delete(t))}i(Y,"clearEditRecoveryStateForPath");function Z(e,t,o){if(e.name!=="write")return;let s=$(e,t);if(!(!s||!o.blockedEditWrites.has(s))){if(!Ve.existsSync(s)){o.blockedEditWrites.delete(s);return}return`[Tool Error] write: BLOCKED_AFTER_EDIT_FAILURE: Refusing to rewrite existing file ${s} while edit anchor recovery is in progress. Retry with edit using unique existing text; use an edits array for multiple replacements.`}}i(Z,"maybeBlockExistingFileWrite");async function Me(e,t,o,s){let n=P(t);if(!n)return;let r=typeof e.input?.path=="string"?e.input.path:void 0,a=$(e,s);if(!r||!a)return;o.blockedEditWrites.add(a);let c=(o.editRecoveryAttempts.get(a)??0)+1;if(o.editRecoveryAttempts.set(a,c),o.lastToolErrorCode=n,n==="EDIT_TOO_LARGE")return U("[edit:recovery]",{code:n,path:a,attempt:c,action:"split-edit"}),[`The previous edit for ${a} failed with ${n}.`,"Do not use write to replace the existing file.","Split the change into smaller replacements in the edits array of one edit call; later anchors must match the result of earlier edits."].join(`
|
|
3
|
-
`);if(c>2)return U("[edit:recovery]",{code:n,path:a,attempt:c,action:"stop-auto-recovery"}),[`The previous edit for ${a} failed with ${n}, and automatic anchor recovery is exhausted.`,"Do not escalate to a whole-file write.","Choose a unique old_string from current file content and retry with edit; preserve the full anchor text when appending."].join(`
|
|
4
|
-
`);let u=c===1?120:400,m=e.input?.edits,d=Array.isArray(m)&&m.length===1?m[0]:void 0,l=e.input?.old_string??(d&&typeof d=="object"&&"old_string"in d?d.old_string:""),p=await le(r,String(l??""),s,u),g=p.candidates[0],R=p.candidates.slice(1,3);U("[edit:recovery]",{code:n,path:a,attempt:c,windowLines:u,candidateCount:p.candidates.length});let h=[`The previous edit for ${a} failed with ${n}.`,"Do not use write to rewrite the existing file.","Retry with edit using a smaller unique old_string.","For a section append, replace the complete unique heading line with that line plus the new content, preserving line breaks."];if(g&&(h.push(""),h.push(`Best nearby anchor window (${g.startLine}-${g.endLine}):`),h.push("```text"),h.push(g.excerpt),h.push("```")),R.length>0){h.push(""),h.push("Other nearby candidate anchors:");for(let N of R)h.push(`- lines ${N.startLine}-${N.endLine}: ${N.preview}`)}return h.join(`
|
|
5
|
-
`)}i(Me,"buildEditRecoveryUserMessage");var Xe=new Set(["edit","write","multi_edit","apply_patch","delete","remove","rename"]),ze=3,Je=100;function Ae(e){return Xe.has(e.toLowerCase())}i(Ae,"isMutationTool");function Oe(e){return e.files.size>=ze?!0:[...e.files.values()].reduce((o,s)=>o+s,0)>=Je}i(Oe,"isMutationScopeSignificant");function Qe(e){let t=[...e.files.values()].reduce((s,n)=>s+n,0),o=[...e.files.entries()].map(([s,n])=>` - ${s} (~${n} lines)`).join(`
|
|
6
|
-
`);return["",`[Scope: ${e.files.size} files modified, ~${t} lines]`,o].join(`
|
|
7
|
-
`)}i(Qe,"buildMutationScopeReflectionHeader");function Le(e){return[Qe(e),oe("t12i.agent-runtime/middleware/mutation-reflection.block.0")].join(`
|
|
8
|
-
`)}i(Le,"buildMutationScopeReflection");function De(e,t,o,s){let n=$(e,s);if(o.lastToolResultBytes=Buffer.byteLength(E(t),"utf8"),o.lastToolErrorCode=Ee(t),e.name==="edit"){P(E(t))||Y(o,n);return}e.name==="insert_after_anchor"&&!S(t)&&Y(o,n)}i(De,"updateToolOutcomeTracking");function Ye(e,t,o){return{type:"tool_result",tool_use_id:e,content:t,...S(t)?{is_error:!0}:{},...o||V(t)?{metadata:{...o,...V(t)?{cancelled:!0}:{}}}:{}}}i(Ye,"createToolResultBlock");async function te(e,t,o,s,n,r,a=!0){if(r?.aborted)return k;let c=M(t.name),u=w(e,t.id,T(t).id);c&&(await G("tool:start",{name:t.name,id:t.id,input:t.input}),e.onToolUseStart?.({name:t.name,id:t.id,input:t.input},u));let m=t.name===I||t.name===D;if(!K(t.name,o))return`[Tool Error] ${t.name}: Tool is not active in the current runtime.`;if(!m){let R=await Q(e,t.name,t.input??{},t.id,o.executionCwd,o.gitRoot,o.toolResultRecovery);if(R!==void 0)return R;if(r?.aborted)return k}if(n&&!n.includes(t.name))return`[Tool Error] ${t.name}: Tool is not active in the current runtime.`;if(t.name===D)return Ze(t.input??{},n,o);if(t.name===I)return tt({events:e,bridgeCall:t,ctx:o,runtimeSessionState:s,activeToolNames:n,abortSignal:r,allowMcpFallback:a});let d=Z(t,o,s);if(d)return d;let l=C(t.name)===void 0?B(o.extensionRuntime,t.name):void 0;if(l===void 0&&C(t.name)===void 0&&n?.includes(t.name))return`[Tool Error] ${t.name}: Host tool lease was revoked or the tool is no longer bound to this run.`;let p=Ue(e,t,o);p.discoveryToolNames=n??o.discoveryToolNames,p.invokeCheckedTool=o.invokeCheckedTool??((R,h)=>te(e,{id:O(),name:R,input:h},o,s,n,r,a)),e.onToolExecutionStart?.({id:t.id,name:t.name},u);let g;try{if(g=await Ke(t,p,r,e,i(()=>l===void 0?q(t.name,t.input??{},p):j(p,l,t.input??{}),"execute")),z(o.writtenFiles,t,g,F(o)),a&&E(g).startsWith("[Tool Error]")&&o.extensionRuntime){let h=await $e(t.name,t.input??{},o);h!==void 0&&(g=h)}}finally{e.onToolExecutionEnd?.({id:t.id,name:t.name},u)}return g}i(te,"executeToolCall");function Ke(e,t,o,s,n){if(!t.sessionId||!t.runtimeRunId||!t.invokeCheckedTool)return n();let r={version:1,sessionId:t.sessionId,runId:t.runtimeRunId,invocationId:e.id,extensionId:H(e.name)?.source.id??`tool:${e.name}`};return xe({...r,signal:o??t.abortSignal??new AbortController().signal,actors:t.actorControl,invokeTool:t.invokeCheckedTool,reportProgress:i(a=>{s.onToolProgress?s.onToolProgress({id:e.id,message:a.message,extension:{...r,extensionId:pe()?.extensionId??r.extensionId,data:a.data}},w(s,e.id,T(e).id)):t.reportToolProgress?.(a.message)},"reportProgress")},a=>(t.extensionExecution=a,n()))}i(Ke,"executeInExtensionScope");function w(e,t,o){return{toolId:t,...o===void 0?{}:{executionId:o},...e.workflowCorrelation!==void 0?{workflowCorrelation:e.workflowCorrelation}:{}}}i(w,"createToolEventMeta");function Ue(e,t,o){let s=w(e,t.id,T(t).id);return e.onToolProgress||e.onToolSandboxObservation||e.askUser||e.askUserMulti||e.askUserInput?{...o,toolCallId:t.id,...o.recordToolResultArtifact?{recordToolResultArtifact:i((n,r)=>o.recordToolResultArtifact(n===t.id?T(t).resultKey:n,r),"recordToolResultArtifact")}:{},...e.onToolProgress?{reportToolProgress:i(n=>{e.onToolProgress?.({id:t.id,message:n},s)},"reportToolProgress")}:{},...e.onToolSandboxObservation?{reportToolSandboxObservation:i(n=>{e.onToolSandboxObservation?.({id:t.id,observation:n},s)},"reportToolSandboxObservation")}:{},...e.askUser?{askUser:i(n=>e.askUser(n,s),"askUser")}:{},...e.askUserMulti?{askUserMulti:i(n=>e.askUserMulti(n,s),"askUserMulti")}:{},...e.askUserInput?{askUserInput:i(n=>e.askUserInput(n,s),"askUserInput")}:{}}:{...o,toolCallId:t.id,...o.recordToolResultArtifact?{recordToolResultArtifact:i((n,r)=>o.recordToolResultArtifact(n===t.id?T(t).resultKey:n,r),"recordToolResultArtifact")}:{}}}i(Ue,"createContextForToolCall");function Ze(e,t,o){let s=et(e);if(s.length===0)return"[Tool Error] tool_describe: `name` or `names` is required.";let n=t?new Set(t):void 0,r=[];for(let a of s){if(n&&!n.has(a)||!K(a,o)){r.push(`<!-- ${a}: not active in the current runtime -->`);continue}let c=C(a);if(c===void 0){let u=B(o.extensionRuntime,a);u!==void 0&&(c=Te(u))}if(!c){r.push(`<!-- ${a}: not registered -->`);continue}c=ne(c,H(c.name)?.source),r.push(`<function>${JSON.stringify({name:c.name,description:c.description,parameters:c.input_schema})}</function>`)}return r.join(`
|
|
9
|
-
`)}i(Ze,"describeBridgeTools");function et(e){let t=[],o=i(s=>{typeof s=="string"&&s.trim().length>0&&t.push(s.trim())},"append");o(e.name),o(e.tool_name);for(let s of["names","tools"]){let n=e[s];if(Array.isArray(n))for(let r of n)o(r)}return[...new Set(t)]}i(et,"readBridgeToolNames");async function tt(e){let t=W(e.bridgeCall);if(!t?.ok)return`[Tool Error] ${I}: ${t?.error??"invalid bridge call."}`;let o=t.call,s=o.name,n=o.input;if(s===I||s===D)return`[Tool Error] ${I}: bridge meta-tools cannot be called through ${I}.`;if(e.abortSignal?.aborted)return k;if(!K(s,e.ctx))return`[Tool Error] ${s}: Tool is not active in the current runtime.`;let r=await Q(e.events,s,n,o.id,e.ctx.executionCwd,e.ctx.gitRoot,e.ctx.toolResultRecovery);if(r!==void 0)return r;if(e.abortSignal?.aborted)return k;if(e.activeToolNames&&!e.activeToolNames.includes(s))return`[Tool Error] ${s}: Tool is not active in the current runtime.`;let a=Z(o,e.ctx,e.runtimeSessionState);if(a)return a;let c=Ue(e.events,o,e.ctx);c.discoveryToolNames=e.activeToolNames??e.ctx.discoveryToolNames,c.invokeCheckedTool=e.ctx.invokeCheckedTool??((p,g)=>te(e.events,{id:O(),name:p,input:g},e.ctx,e.runtimeSessionState,e.activeToolNames?[...e.activeToolNames]:void 0,e.abortSignal,e.allowMcpFallback));let u=c.recordToolResultArtifact;u!==void 0&&(c.recordToolResultArtifact=(p,g)=>{u(p,g),u(T(e.bridgeCall).resultKey,g)});let m=w(e.events,o.id,T(o).id),d=C(s)===void 0?B(e.ctx.extensionRuntime,s):void 0;e.events.onToolExecutionStart?.({id:o.id,name:s},m);let l;try{if(l=await Ke(o,c,e.abortSignal,e.events,()=>d===void 0?q(s,n,c):j(c,d,n)),z(e.ctx.writtenFiles,o,l,F(e.ctx)),e.allowMcpFallback&&E(l).startsWith("[Tool Error]")&&e.ctx.extensionRuntime){let p=await $e(s,n,e.ctx);p!==void 0&&(l=p)}}finally{e.events.onToolExecutionEnd?.({id:o.id,name:s},m)}return l}i(tt,"executeBridgeToolCall");var ot=new Set(["web_search","web_fetch","glob","grep","read","code_search","semantic_lookup"]);async function $e(e,t,o){if(ot.has(e))try{let s=await o.extensionRuntime.searchCapabilities("mcp",e,{kind:"tool",limit:1});if(s.length===0)return;let n=s[0];if(!n?.id||n.name!==e&&!n.id.endsWith(`:${e}`))return;let r=await o.extensionRuntime.executeCapability("mcp",n.id,t),a=r.content===void 0&&r.structuredContent===void 0?JSON.stringify(r,null,2):"",c=r.structuredContent==null||typeof r.structuredContent=="string"?r.structuredContent:JSON.stringify(r.structuredContent,null,2);return me({...r,structuredContent:c},u=>`[MCP Fallback via ${n.id}]
|
|
10
|
-
${u??a}`)}catch(s){process.env.KODAX_DEBUG_TOOL_HISTORY&&L({source:"coding:tool-dispatch",level:"debug",message:`MCP fallback failed for ${e}.`,detail:s});return}}i($e,"tryMcpFallback");var A=new WeakMap;function T(e){let t=A.get(e);return t||(t={id:`execution_${O()}`,resultKey:e.id},A.set(e,t)),t}i(T,"toolExecution");async function nt(e){let t=new Map,o=new Map,s=e.toolBlocks.map((d,l)=>({block:d,index:l})).filter(({block:d})=>!_(d)),n=await Promise.all(s.map(({block:d,index:l})=>Pe(e,d,l)));for(let d of n)o.set(d.index,d);for(let d=0;d<e.toolBlocks.length;d+=1){let l=e.toolBlocks[d];_(l)&&o.set(d,await Pe(e,l,d))}let r=e.toolBlocks.map((d,l)=>{let p=o.get(l);if(!p)throw new Error(`Tool call at index ${l} was not prepared.`);return p});e.onToolCallsPrepared?.(r.map(d=>Ne(d.call)));for(let d of r)d.blockedContent!==void 0&&(await Be(e.events,d.call),t.set(T(d.call).resultKey,d.blockedContent));let a=r.filter(d=>ce(d.call));for(let d of a){let l=d.blockedContent??await ee(e,d.call);t.set(T(d.call).resultKey,l)}if(a.length>0){for(let d of r){let l=T(d.call).resultKey;t.has(l)||(await Be(e.events,d.call),t.set(l,e.abortSignal?.aborted?k:ue))}return t}let c=r.filter(d=>d.blockedContent===void 0&&!_(e.toolBlocks[d.index])&&!_(d.call)),u=await Promise.all(c.map(async d=>({id:T(d.call).resultKey,content:await ee(e,d.call)})));for(let d of u)t.set(d.id,d.content);let m=r.filter(d=>d.blockedContent===void 0&&(_(e.toolBlocks[d.index])||_(d.call)));for(let d of m){if(e.abortSignal?.aborted){t.set(T(d.call).resultKey,k);continue}t.set(T(d.call).resultKey,await ee(e,d.call))}return t}i(nt,"runToolDispatch");function _(e){if(e.name==="bash")return!0;let t=W(e);return t?.ok===!0&&t.call.name==="bash"}i(_,"requiresSerialToolExecution");async function Pe(e,t,o){let s={id:t.id,name:t.name,input:t.input},n={index:o,call:s};if(!e.abortSignal?.aborted&&e.toolGuardrails?.length){if(!e.guardrailContext)throw new Error("Tool guardrails require a GuardrailContext.");let c=await re(s,e.toolGuardrails,e.guardrailContext,null);n=c.kind==="block"?{index:o,call:c.call,blockedContent:Fe(c.result.content,!0)}:{index:o,call:c.call}}let r=`execution_${O()}`,a={id:r,resultKey:e.toolBlocks.filter(c=>c.id===t.id).length>1?r:t.id};return A.set(n.call,a),A.set(t,a),e.finalToolBlocks?.set(t.id,Ne(n.call)),n}i(Pe,"prepareToolBlock");async function ee(e,t){let o=e.ctx.authorizeShellHostExecution,s={...e.ctx,...o!==void 0&&e.guardrailContext!==void 0?{authorizeShellHostExecution:i(r=>o(r,e.guardrailContext),"authorizeShellHostExecution")}:{},invokeCheckedTool:i(async(r,a)=>{let c=O();return(await nt({...e,toolBlocks:[{type:"tool_use",id:c,name:r,input:a}],finalToolBlocks:void 0,onToolCallsPrepared:void 0})).get(c)??"[Tool Error] Nested tool did not return a result."},"invokeCheckedTool")},n=await te(e.events,t,s,e.runtimeSessionState,e.activeToolNames,e.abortSignal,e.allowMcpFallback);if(e.toolGuardrails?.length&&e.guardrailContext){let r=await ie(t,{content:n,isError:S(n)},e.toolGuardrails,e.getAfterGuardrailContext?.()??e.guardrailContext,null);n=Fe(r.content,r.isError===!0)}return n}i(ee,"executePreparedToolCall");function Ne(e){let t={id:e.id,name:e.name,type:"tool_use",input:e.input};return A.set(t,T(e)),t}i(Ne,"runnerCallToToolBlock");function Fe(e,t){return!t||S(e)?e:typeof e=="string"?`[Blocked] ${e}`:[{type:"text",text:"[Blocked]"},...e]}i(Fe,"normalizeGuardrailResult");async function Be(e,t){M(t.name)&&(await G("tool:start",{name:t.name,id:t.id,input:t.input}),e.onToolUseStart?.({name:t.name,id:t.id,input:t.input},w(e,t.id,T(t).id)))}i(Be,"emitToolCallStart");async function Ao(e){let t=[],o=[];for(let n of e.toolBlocks){let r=e.resultMap.get(T(n).resultKey)??"[Error] No result";if(e.mutationScopeReflection!==!1&&e.ctx.mutationTracker&&!e.ctx.mutationTracker.reflectionInjected&&!S(r)&&Ae(n.name)&&Oe(e.ctx.mutationTracker)){let a=Le(e.ctx.mutationTracker);r=typeof r=="string"?r+a:[...r,{type:"text",text:a}],e.ctx.mutationTracker.reflectionInjected=!0}if(De(n,r,e.runtimeSessionState,e.ctx),n.name==="edit"&&S(r)){let a=await Me(n,E(r),e.runtimeSessionState,e.ctx);a&&o.push(a)}if(M(n.name)){let a=e.toolResultArtifactPaths?.get(T(n).resultKey);t.push(Ye(n.id,r,a?{truncated:!0,capacityFallback:!0,outputPath:a}:void 0))}}return{toolResults:await rt(e,t,o),editRecoveryMessages:o}}i(Ao,"applyPostToolProcessing");async function rt(e,t,o){let s=e.toolBlocks.filter(u=>M(u.name));t.forEach((u,m)=>{e.ctx.toolResultRecovery?.observeResult(s[m],u.is_error===!0)});let n=o.length>0?y([{role:"user",content:o.join(`
|
|
11
|
-
|
|
12
|
-
`),_synthetic:!0}]):0,r=await fe(t.map((u,m)=>({id:T(s[m]).resultKey,toolName:s[m].name,content:u.content,...typeof u.metadata?.outputPath=="string"&&u.metadata.outputPath.length>0?{outputPath:u.metadata.outputPath}:{}})),{...e.ctx,canReadPagedContent:e.runtimeSessionState.activeTools.includes("read")},e.toolResultBudget,n),a=new Map(r.entries.map(u=>[u.id,u])),c=t.map((u,m)=>{let d={...u,is_error:u.is_error===!0},l=a.get(T(s[m]).resultKey);return!l||l.content===d.content?r.capacityDebt?{...d,metadata:{...d.metadata??{},capacityDebt:!0}}:d:{...d,content:l.content,metadata:{...d.metadata??{},truncated:!0,capacityFallback:!0,...r.capacityDebt?{capacityDebt:!0}:{},...l.outputPath?{outputPath:l.outputPath}:{}}}});for(let[u,m]of c.entries()){let d=s[u];if(!d)continue;let l=E(m.content);await e.emitActiveExtensionEvent("tool:result",{id:d.id,name:d.name,content:l}),e.events.onToolResult?.({id:d.id,name:d.name,content:l,toolResult:m},w(e.events,d.id,T(d).id))}return c}i(rt,"admitAndEmitVisibleToolResults");export{U as a,S as b,V as c,z as d,pt as e,Se as f,xt as g,gt as h,Re as i,ve as j,ht as k,bt as l,It as m,_t as n,wt as o,Ct as p,M as q,Mt as r,At as s,Ot as t,Lt as u,Dt as v,Pt as w,Bt as x,Kt as y,Q as z,Ye as A,te as B,Ke as C,w as D,Ue as E,ot as F,$e as G,T as H,nt as I,Ao as J};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{B as ee,C as D,b as E,c as _,d as Z,l as Q,m as Y}from"./chunk-7OTOH4PT.js";import{a as U,o as J}from"./chunk-XGUGEVCK.js";import{v as $}from"./chunk-5MDNQCAV.js";import{Zb as H}from"./chunk-KQ3XVHKK.js";import{h as O}from"./chunk-E2Z754K5.js";import{a as o}from"./chunk-V4WSBIXB.js";import{setTimeout as ge}from"node:timers/promises";import{randomBytes as we,randomUUID as he}from"node:crypto";function k(t,c){let f=o(()=>{if(t.capabilities?.sessionPromotion?.version!==1)throw Object.assign(new Error("Session promotion requires an upgraded Host."),{code:"daemon_upgrade_required"})},"requirePromotionContract"),a=o(async e=>{let n=structuredClone(e.input);for(let i of["authorization","credential","hostTools","providerCredential","providerCredentialAccess","origin","trustedRunId","workflowHostPolicy","profile","agentProfile","workModePolicy","toolVisibilityPolicy","tools","binding","businessBinding","defaultSkill"])delete n[i];let s=await c?.({...e,input:n},Z(t,"sessionId"in n?n.sessionId:void 0));if((s?.profile!==void 0||s?.tools!==void 0)&&t.capabilities?.productExecutionProfile?.version!==2)throw Object.assign(new Error("Execution profiles require an upgraded Host."),{code:"daemon_upgrade_required"});if((s?.profile?.defaultSkill!==void 0||s?.binding!==void 0||s?.businessBinding!==void 0)&&t.capabilities?.productExecutionBinding?.version!==1)throw Object.assign(new Error("Default Skills require an upgraded Host."),{code:"daemon_upgrade_required"});return{...n,...s===void 0?{}:{authorization:structuredClone(s)}}},"authorize");return{statistics:t.statistics??{read:o(async()=>{throw new Error("Execution facts require a compatible Host.")},"read"),readRequests:o(async()=>{throw new Error("Execution facts require a compatible Host.")},"readRequests"),readTools:o(async()=>{throw new Error("Execution facts require a compatible Host.")},"readTools")},lifecycle:t.lifecycle??{requestExit:o(async()=>{throw new Error("Client exit control requires a compatible daemon Host.")},"requestExit"),readExit:o(async()=>{throw new Error("Client exit control requires a compatible daemon Host.")},"readExit"),listPendingExits:o(async()=>{throw new Error("Client exit control requires a compatible daemon Host.")},"listPendingExits")},commands:{execute:o(async e=>t.invocations.executeCommand(await a({kind:"command",input:e})),"execute"),readPrompt:o(e=>t.invocations.readCommandPrompt(e),"readPrompt")},review:{start:o(async e=>t.invocations.startReview(await a({kind:"review",input:e})),"start")},host:{shutdown:o(async()=>{if(t.daemon===void 0)throw new Error("Host shutdown requires a shared Host connection.");return t.daemon.shutdown()},"shutdown")},sessions:{cancel:o(e=>t.sessions.cancel(e),"cancel"),create:o(e=>t.sessions.create(e),"create"),promote:o(async e=>(f(),t.sessions.promote(e)),"promote"),readPromotion:o(async(e,n)=>(f(),t.sessions.readPromotion(e,n)),"readPromotion"),list:o(e=>t.sessions.list(e),"list"),read:o(e=>t.sessions.load(e),"read"),delete:o(e=>t.sessions.delete(e),"delete"),archive:o(e=>t.sessions.archive(e),"archive"),unarchive:o(e=>t.sessions.unarchive(e),"unarchive"),getAutoModeStats:o(async e=>await t.sessions.getAutoModeStats(e)??void 0,"getAutoModeStats"),getSettings:o(async e=>E(await t.sessions.getSettings(e)),"getSettings"),getSettingsVersioned:o(async e=>{let n=await t.sessions.getSettingsVersioned(e);return{revision:n.revision,value:E(n.value)}},"getSettingsVersioned"),updateSettingsVersioned:o(async(e,n,s)=>{let i=await t.sessions.updateSettingsVersioned(e,n,s);return{revision:i.revision,value:E(i.value)}},"updateSettingsVersioned"),updateSettings:o(async(e,n)=>E(await t.sessions.updateSettings(e,n)),"updateSettings"),observe:o((e,n,s)=>t.sessions.observeView(e,n,s),"observe"),readItem:o((e,n,s)=>t.sessions.readViewItem(e,n,s),"readItem"),readHistory:o((e,n)=>t.sessions.readHistory(e,n),"readHistory"),readHistoryEntry:o((e,n,s)=>t.sessions.readHistoryEntry(e,n,s),"readHistoryEntry"),searchHistory:o((e,n)=>t.sessions.searchHistory(e,n),"searchHistory"),readGoal:o(e=>t.sessions.readGoal(e),"readGoal"),createGoal:o((e,n)=>t.sessions.createGoal({sessionId:e,...n}),"createGoal"),pauseGoal:o(e=>t.sessions.pauseGoal(e),"pauseGoal"),resumeGoal:o(e=>t.sessions.resumeGoal(e),"resumeGoal"),clearGoal:o(e=>t.sessions.clearGoal(e),"clearGoal"),appendNotice:o(async(e,n)=>{if(!await t.sessions.appendNotice({sessionId:e,...n}))throw new Error("Host did not save the Session notice.")},"appendNotice"),readLineage:o(e=>t.sessions.readLineage(e),"readLineage"),labelEntry:o((e,n)=>t.sessions.labelEntry({sessionId:e,...n}),"labelEntry"),selectBranch:o((e,n,s)=>t.sessions.setActiveEntry({sessionId:e,entryId:n,...s}).then(i=>{if(i===null)throw Object.assign(new Error("No lineage entry matches the selector."),{code:"conflict"});return i}),"selectBranch"),rewindSession:o((e,n)=>t.sessions.rewind({sessionId:e,...n}).then(s=>{if(s===null)throw Object.assign(new Error("Rewind target no longer resolves."),{code:"conflict"});return s}),"rewindSession"),forkSession:o((e,n)=>t.sessions.fork({sessionId:e,...n??{}}).then(s=>{if(s===null)throw Object.assign(new Error("Fork boundary no longer resolves."),{code:"conflict"});return s}),"forkSession"),recoverSession:o((e,n)=>t.sessions.recover({sessionId:e,...n??{}}),"recoverSession"),compact:o(async(e,n)=>{let s=await a({kind:"compaction",input:{...n,sessionId:e}}),i=await t.sessions.compact({sessionId:s.sessionId,customInstructions:s.customInstructions,...s.authorization?.credential!==void 0?{credential:s.authorization.credential}:{}});return{compacted:i.compacted,messages:i.messages,tokensBefore:i.tokensBefore,tokensAfter:i.tokensAfter,...i.report!==void 0?{report:i.report}:{},...i.reason!==void 0?{reason:i.reason}:{}}},"compact")},learning:{list:o(e=>t.learning.list(e),"list"),get:o(e=>t.learning.get(e),"get"),getSnapshot:o(()=>t.learning.getSnapshot(),"getSnapshot"),events:o(e=>t.learning.events(e),"events"),subscribe:o(e=>t.learning.subscribe(e),"subscribe"),acknowledge:o(e=>t.learning.acknowledge(e),"acknowledge"),snooze:o((e,n)=>t.learning.snooze(e,n),"snooze"),reject:o(e=>t.learning.reject(e),"reject"),disable:o(e=>t.learning.disable(e),"disable"),rollback:o(e=>t.learning.rollback(e),"rollback"),promote:o((e,n)=>t.learning.promote(e,n),"promote"),review:o(e=>t.learning.review(e),"review"),trust:o(e=>t.learning.trust(e),"trust")},memory:{async forProject(e){let n=await t.memory.forProject(e);return{memoryRoot:n.memoryRoot,entrypointPath:n.entrypointPath,listReviews:o(()=>n.listReviews(),"listReviews"),reviewerProviderConfigured:o(()=>n.reviewerProviderConfigured(),"reviewerProviderConfigured"),rebuild:o(()=>n.rebuild(),"rebuild"),ensureOpenTarget:o(s=>n.ensureOpenTarget(s),"ensureOpenTarget"),controller:{listRefs:o(s=>n.controller.listRefs(s),"listRefs"),readRef:o(s=>n.controller.readRef(s),"readRef"),remember:o(s=>n.controller.remember(s),"remember"),forgetRef:o((s,i)=>n.controller.forgetRef(s,i),"forgetRef"),approveProposal:o((s,i,r)=>n.controller.approveProposal(s,i,r),"approveProposal"),rejectProposal:o((s,i,r)=>n.controller.rejectProposal(s,i,r),"rejectProposal"),listInbox:o(async()=>(await n.controller.listInbox()).map(s=>({...s,revision:H(s)})),"listInbox"),showProposal:o(async s=>{let i=await n.controller.showProposal(s);return i===void 0?void 0:{...i,revision:H(i)}},"showProposal")}}}},inputs:{submit:o(async e=>t.runs.acceptInput(await a({kind:"input",input:e})),"submit"),read:o((e,n)=>t.runs.getInput(e,n),"read"),withdraw:o((e,n)=>t.runs.withdrawInput(e,n),"withdraw")},runs:{recover:o(async({sessionId:e,runId:n})=>{if((await t.runs.get(n)).sessionId!==e)throw new Error("Recovery Run belongs to a different Session.");let s=await a({kind:"recovery",input:{sessionId:e,runId:n}}),i=await t.sessions.getSettings(e),r=await t.runs.recover({runId:n,options:{provider:i.provider,model:i.model,reasoningMode:i.reasoningMode},...s.authorization===void 0?{}:{authorization:s.authorization}});return{runId:r.runId,sessionId:r.sessionId}},"recover"),startTool:o(async e=>{let n=await a({kind:"tool",input:e}),s=await t.runs.start({sessionId:n.sessionId,inputId:n.inputId,prompt:n.rawInput,options:{toolInvocation:{name:n.name,input:n.input}},...n.authorization!==void 0?{authorization:n.authorization}:{}});return{runId:s.runId,sessionId:s.sessionId}},"startTool"),read:o(e=>t.runs.get(e),"read"),stop:o(e=>t.runs.abort(e),"stop"),await:o(async e=>{let n=await t.runs.await(e);return{runId:n.runId,sessionId:n.sessionId,phase:n.phase,...n.failureDetail!==void 0?{failureDetail:n.failureDetail}:{},...n.result!==void 0?{result:n.result}:{},...n.error!==void 0?{error:n.error.message}:{},...n.terminal!==void 0?{terminal:n.terminal}:{},...n.stop!==void 0?{stop:n.stop}:{}}},"await")},interactions:{list:o(e=>t.interactions.list(e),"list"),respond:o((e,n)=>t.interactions.respond(e,n),"respond")},permissions:{listGrants:o(async()=>{let e=await t.permissions.listGrants();return{revision:e.revision,grants:e.value.map(n=>({id:n.id,...n.scope.sessionId!==void 0?{sessionId:n.scope.sessionId}:{},...n.label!==void 0?{label:n.label}:{},...n.persistence!==void 0?{persistence:n.persistence}:{}}))}},"listGrants"),revokeGrant:o((e,n)=>t.permissions.revokeGrant(e,n),"revokeGrant")},registrations:{list:o(()=>t.admin.agentRegistrations.list(),"list"),upsert:o((e,n)=>t.admin.agentRegistrations.upsert(e,n),"upsert"),setEnabled:o((e,n,s)=>t.admin.agentRegistrations.setEnabled(e,n,s),"setEnabled"),remove:o((e,n)=>t.admin.agentRegistrations.remove(e,n),"remove")},agents:{reviewLean:o(async e=>t.invocations.startAgentsLean(await a({kind:"agents_lean",input:e})),"reviewLean"),tree:o(e=>t.agents.tree(e),"tree"),detail:o((e,n)=>t.agents.detail(e,n),"detail"),spawn:o(async(e,n)=>{let s=await a({kind:"agent_spawn",input:{sessionId:e,agent:n}});return s.authorization===void 0?t.agents.spawn(e,s.agent):t.agents.spawn(e,s.agent,{authorization:s.authorization})},"spawn"),send:o((e,n,s,i)=>t.agents.send(e,n,s,i),"send"),followup:o(async(e,n,s,i)=>{let r=await a({kind:"agent_followup",input:{sessionId:e,actorPath:n,objective:s,...i?.resumeCheckpoint===void 0?{}:{resumeCheckpoint:i.resumeCheckpoint},...i?.expectedRevision===void 0?{}:{expectedRevision:i.expectedRevision}}});return t.agents.followup(e,n,s,{expectedRevision:r.expectedRevision,...r.resumeCheckpoint===void 0?{}:{resumeCheckpoint:r.resumeCheckpoint},...r.authorization===void 0?{}:{authorization:r.authorization}})},"followup"),interrupt:o((e,n,s)=>t.agents.interrupt(e,n,s),"interrupt"),output:o((e,n,s)=>t.agents.output(e,n,s),"output"),wait:o((e,n,s,i)=>t.agents.wait(e,n,s,i?.signal===void 0?void 0:{signal:i.signal}),"wait")},config:{read:o(async()=>_(await t.config.read()),"read"),readEffective:o(async()=>{let{entries:e,application:n}=await t.config.readEffective(),s=o((r,g)=>({value:g,source:e[r]?.source??"unset",applied:e[r]?.applied===!0||e[r]?.present!==!0}),"project"),i=e.fallbackProviders?.value;return{...n===void 0?{}:{application:n,maxOutputTokens:s("maxOutputTokens",e.maxOutputTokens?.value===void 0?void 0:Number(e.maxOutputTokens.value)),disablePromptCache:s("disablePromptCache",e.disablePromptCache?.value===void 0?void 0:e.disablePromptCache.value===!0||e.disablePromptCache.value==="1"),lsp:s("lsp",e.lsp?.value===void 0?void 0:e.lsp.value===!0||e.lsp.value==="1")},stallLog:s("stallLog",e.stallLog?.value==="1"||e.stallLog?.value===!0),fallbackProviders:s("fallbackProviders",typeof i=="string"?i.split(",").map(r=>r.trim()).filter(Boolean):Array.isArray(i)?i.filter(r=>typeof r=="string"):[])}},"readEffective"),patch:o(async e=>_(await t.config.patch(e)),"patch"),reload:o(async()=>({ok:!0,config:_((await t.config.reload()).config)}),"reload")},mcp:{status:o(()=>t.mcp.status(),"status"),listServers:o(()=>t.mcp.listServers(),"listServers"),getServer:o(e=>t.mcp.getServer(e),"getServer"),validateServer:o((e,n)=>t.mcp.validateServer(e,n),"validateServer"),upsertServer:o((e,n)=>t.mcp.upsertServer(e,n),"upsertServer"),deleteServer:o(e=>t.mcp.deleteServer(e),"deleteServer"),reloadServers:o(()=>t.mcp.reloadServers(),"reloadServers"),listTools:o(e=>t.mcp.listTools(e),"listTools")},workflows:{start:o(async e=>t.workflows.start({...await a({kind:"workflow",input:e}),settingsDefaults:"product"}),"start"),list:o(async e=>{let n=[];for(let s of await t.workflows.list(e??{})){let i=s.updatedAt===void 0?await t.workflows.get(s.runId):s;if(i?.updatedAt===void 0)throw new Error(`Workflow process is unavailable: ${s.runId}`);n.push({runId:s.runId,workflowName:s.workflow,status:s.status,totalSpawned:s.totalSpawned,eventCount:s.eventCount,runDir:s.runDir,...s.endedAt!==void 0?{endedAt:new Date(s.endedAt).toISOString()}:{},startedAt:new Date(s.startedAt).toISOString(),updatedAt:i.updatedAt,...i.displayName!==void 0?{displayName:i.displayName}:{},...s.resultText!==void 0?{resultSummary:s.resultText}:{},...s.error!==void 0?{error:s.error}:{}})}return n},"list"),get:o(e=>t.workflows.get(e),"get"),subscribe:o((e,n,s)=>{let i=t.workflows.subscribe(e,n,s);return{ready:i.ready??Promise.resolve(),close:o(()=>i.close(),"close")}},"subscribe"),pause:o(e=>t.workflows.pause(e),"pause"),resume:o(e=>t.workflows.resume(e),"resume"),stop:o((e,n)=>t.workflows.stop(e,n),"stop")},catalog:{extensions:o(async()=>{let e=await t.catalog.extensions(),n=o(({path:r,label:g,loadSource:h})=>({path:r,label:g,loadSource:h}),"loaded"),s=o(({kind:r,id:g,label:h})=>({kind:r,id:g,label:h}),"source"),i=e.diagnostics;return{active:e.active,extensions:e.extensions.map(n),diagnostics:i&&{loadedExtensions:i.loadedExtensions.map(n),capabilityProviders:i.capabilityProviders.map(({id:r,kinds:g,metadata:h})=>({id:r,kinds:g,metadata:h})),commands:i.commands.map(({name:r,aliases:g,description:h})=>({name:r,aliases:g,description:h})),tools:i.tools.map(r=>({name:r.name,source:s(r.source),shadowedSources:r.shadowedSources.map(s)})),hooks:i.hooks.map(r=>({hook:r.hook,order:r.order,source:s(r.source)})),failures:i.failures.map(r=>({stage:r.stage,target:r.target,message:r.message,source:s(r.source)})),defaults:{activeTools:i.defaults.activeTools,modelSelection:{...i.defaults.modelSelection},thinkingLevel:i.defaults.thinkingLevel}}}},"extensions"),providers:o(()=>t.catalog.providers(),"providers"),models:o(async e=>(await t.catalog.providers()).filter(n=>e?.provider===void 0||n.name===e.provider).map(n=>({provider:n.name,models:n.models})),"models"),reasoningEfforts:o(e=>t.catalog.reasoningEfforts(e),"reasoningEfforts"),probeReasoningEfforts:o(async e=>{let n=await a({kind:"provider_probe",input:e});return t.catalog.probeReasoningEfforts({provider:n.provider,model:n.model,efforts:n.efforts,...n.authorization?.credential?{credential:n.authorization.credential}:{}})},"probeReasoningEfforts"),forgetCapabilities:o(e=>t.catalog.forgetCapabilities(e),"forgetCapabilities"),commands:o(async e=>(await t.catalog.commands(e)).map(n=>({name:n.name,...n.aliases!==void 0?{aliases:n.aliases}:{},description:n.description,source:String(n.source),...n.userInvocable!==void 0?{userInvocable:n.userInvocable}:{}})),"commands"),skills:o(async e=>(await t.catalog.skills(e)).map(n=>({name:n.name,description:n.description,userInvocable:n.userInvocable,path:n.path,source:String(n.source)})),"skills")},disconnect:o(()=>t.close(),"disconnect")}}o(k,"toKodaXProductClient");async function te(t={},c){let f={name:"kodax-client",...t.clientInfo,instanceId:t.clientInfo?.instanceId??he(),instanceSecret:t.clientInfo?.instanceSecret??we(32).toString("hex")},a=await D({...t,clientInfo:f});return ve(a,e=>D({...t,clientInfo:f,daemonStartupSignal:AbortSignal.any([e,...t.daemonStartupSignal?[t.daemonStartupSignal]:[]])}),c)}o(te,"ensureRecoveringKodaXRuntime");function q(t){let c=t&&typeof t=="object"&&"code"in t?t.code:void 0;return typeof c=="string"&&["protocol_closed","transport_error","ECONNREFUSED","ECONNRESET","ENOENT","ETIMEDOUT"].includes(c)}o(q,"transientConnectionFailure");function ve(t,c,f){let a=t,e=!1,n=!1,s=new AbortController,i,r,g=0,h,x=t.connection?.current(),z=new Set,I=new Set,K=new Map,P=new Set,S=new Set,N=o(l=>{x=l;for(let d of z)try{d(l)}catch(p){C("Connection observer failed.",p)}},"report"),C=o((l,d)=>O({source:"runtime.client-recovery",level:"warn",message:l,detail:d}),"diagnose"),M=o(()=>{if(e||n)return Promise.reject(new Error("Runtime client is closing."));if(i)return i;let l=a;h?.close();let d=(async()=>{await l.close();let p=0;for(;;){s.signal.throwIfAborted();try{if(a=await c(s.signal),e||n){await a.close(),s.signal.throwIfAborted();return}K.clear(),r=void 0;let m=g;B();for(let u of I)await u();if(g!==m)throw Object.assign(new Error("Host disconnected during subscription setup."),{code:"protocol_closed"});break}catch(m){if(!q(m))throw m;C("Host connection is unavailable; waiting to reconnect.",m),h?.close(),await a.close(),await ge(Math.min(3e4,1e3*2**Math.min(p++,5)),void 0,{signal:s.signal})}}for(let m of S)m()})();return i=d,d.then(()=>{i===d&&(i=void 0)},p=>{i===d&&(i=void 0),r=p,e||(C("Host reconnection could not complete.",p),x&&N({...x,state:"disconnected",reconnectable:!1,reason:String(p)}));for(let m of S)m()}),d},"reconnect"),B=o(()=>{let l=a;h=a.connection?.subscribe(d=>{l===a&&(N(d),!e&&!n&&d.state==="disconnected"&&d.reconnectable&&q(d)&&(g+=1,M().catch(()=>{})))})},"bindLifecycle"),F=o(async l=>{if(e||n||P.has(l)||a.identity.runtimeId===t.identity.runtimeId)return;let d=K.get(l);if(d)return d;let p=a,m=(async()=>{let u=await p.runs.get(l);e||P.has(l)||u.stop||u.phase!=="recovering"||!u.contextRecovery?.checkpoint||await k(p,f).runs.recover({sessionId:u.sessionId,runId:l})})();return K.set(l,m),m},"recoverRun"),ce=o(async l=>{for(;;){if(i&&await i,s.signal.throwIfAborted(),r)throw r;let d=a;try{await F(l);let p=await d.runs.await(l);if(p.phase!=="recovering")return p;d===a&&!i&&await new Promise((m,u)=>{let y=o(()=>{S.delete(y),s.signal.removeEventListener("abort",R),m()},"wake"),R=o(()=>{y(),u(s.signal.reason)},"abort");S.add(y),s.signal.addEventListener("abort",R,{once:!0})})}catch(p){if(!q(p))throw p;d===a&&await M()}}},"awaitRun"),de=o(async(l,...d)=>(P.add(l),i&&await i,a.runs.abort(l,...d)),"abort"),le=o(async l=>(P.add(l.expectedRunId),i&&await i,a.sessions.cancel(l)),"cancel"),ue=o(async(l,d,p)=>{let m=!1,u=0,y,R=o(async()=>{if(m||e)return;let w=++u;y?.close();let j=a,G=await j.sessions.observeView(l,A=>{if(!(m||w!==u||j!==a)){d(A);for(let V of A.runs)V.phase==="recovering"&&F(V.runId).catch(W=>{C("Checkpoint continuation requires attention.",W),!m&&w===u&&p?.onStatus?.({state:"interrupted",message:String(W)})})}},{...p,onStatus:o(A=>{!m&&w===u&&j===a&&p?.onStatus?.(A)},"onStatus")});m||e||w!==u?G.close():y=G},"resume"),b=o(async()=>{try{await R()}catch(w){if(q(w))throw w;C("Session observation could not reconnect.",w),p?.onStatus?.({state:"closed",reason:"unavailable",message:String(w)})}},"reopen");return i&&await i,await R(),I.add(b),{close(){m||(m=!0,u+=1,I.delete(b),y?.close())}}},"observeView"),pe=o((l,d)=>{let p,m=!1,u=o(()=>{p?.close();let R=a;p=R.events.subscribe(l,b=>{!m&&R===a&&d(b)})},"resume");u();let y=o(async()=>{m||u()},"reopen");return I.add(y),{close(){m||(m=!0,I.delete(y),p?.close())}}},"subscribeEvents"),fe=o(async()=>{e=!0,s.abort(new Error("Runtime client closed.")),h?.close();for(let l of S)l();await i?.catch(()=>{}),await a.close()},"close"),X=new Map,me=new Proxy(t,{get(l,d){if(d==="close")return fe;let p=Reflect.get(a,d);return!p||typeof p!="object"||["identity","capabilities","grantedScopes"].includes(String(d))?p:(X.has(d)||X.set(d,new Proxy({},{get(m,u){if(d==="runs"&&u==="await")return ce;if(d==="runs"&&u==="abort")return de;if(d==="sessions"&&u==="cancel")return le;if(d==="sessions"&&u==="observeView")return ue;if(d==="events"&&u==="subscribe")return pe;if(d==="daemon"&&u==="shutdown"||d==="lifecycle"&&u==="requestExit")return async(...b)=>{n=!0,i&&(s.abort(new Error("Client exited while Host was unavailable; exit could not be acknowledged.")),await i);let w=Reflect.get(a,d);return Reflect.apply(Reflect.get(w,u),w,b)};if(d==="connection"&&u==="current")return()=>x;if(d==="connection"&&u==="subscribe")return b=>(z.add(b),x&&b(x),{close:o(()=>{z.delete(b)},"close")});let y=Reflect.get(a,d),R=Reflect.get(y,u);return typeof R=="function"?(...b)=>{let w=Reflect.get(a,d);return Reflect.apply(Reflect.get(w,u),w,b)}:R}})),X.get(d))}});return B(),me}o(ve,"createRecoveringRuntimeClient");import Re from"node:path";import{createHash as se,randomUUID as He}from"node:crypto";import T from"node:fs";import ie from"node:path";function re(t,c){return`client_${se("sha256").update(JSON.stringify([t,c])).digest("hex")}`}o(re,"runtimeClientPrincipal");var ye=o(t=>se("sha256").update(t).digest("hex"),"digest"),be=o((t,c)=>ie.join(t.rootDir,"client-exits",ye(c)),"directory");function L(t,c){let f=be(t,c);return T.existsSync(f)?T.readdirSync(f).filter(a=>a.endsWith(".json")).map(a=>{let e=JSON.parse(T.readFileSync(ie.join(f,a),"utf8"));if(e.clientId!==c||e.accepted!==!0||!e.requestId||!e.host?.owner||!e.cleanup||!Array.isArray(e.cleanup.runIds))throw new Error("Invalid persisted client exit receipt.");return e}):[]}o(L,"readExitReceipts");async function ae(t,c){let f=c.host.owner,a=J(t.lockFile),e=Q(f.pid,f.processStartIdentity),n=e?c:ne(c);if(c.runtimeId!==f.runtimeId)return v(n,"blocked","owner_identity_mismatch","inspect_failure");if(e)return c.cleanup.state==="failed"||c.host.cleanup==="failed"?v(n,"blocked","cleanup_failed","inspect_failure"):a===void 0||!oe(a,f)?v(n,"blocked","daemon_active","retry_verification"):!c.host.requested&&c.cleanup.state==="succeeded"?v(n,"ready","client_cleanup_verified","start_or_connect"):c.host.state==="protected"?v(n,"blocked","host_protected","retry_exit"):c.cleanup.state!=="succeeded"?v(n,c.cleanup.state==="pending"?"pending":"blocked",c.cleanup.state==="pending"?"client_cleanup_pending":"client_cleanup_unknown","retry_exit"):v(n,"pending","daemon_active","retry_verification");let s=await Y({configHome:t.configHome,profile:t.profile,owner:f,timeoutMs:1,pollIntervalMs:1}),i=L(t,c.clientId).find(h=>h.requestId===c.requestId);if(i&&(i.runtimeId!==c.runtimeId||i.host.requested!==c.host.requested||!oe(i.host.owner,f)))return v(n,"blocked","owner_identity_mismatch","inspect_failure");let r=i?ne(i):n;if(r.host.cleanup==="failed")return v(r,"blocked","cleanup_failed","inspect_failure");if(s.status==="succeeded"||s.status==="replacement_running")return!f.processStartIdentity||f.processContainment==="windows-job"&&!f.supervisorProcessStartIdentity?v(r,"blocked","owner_identity_unverified","inspect_failure"):v({...r,host:{...r.host,state:"succeeded",cleanup:"succeeded",...s.status==="replacement_running"?{replacementRunning:!0}:{}}},"ready","host_shutdown_verified","start_or_connect");if(s.status==="failed")return v({...r,host:{...r.host,state:"failed",cleanup:"failed",message:s.outcome.error}},"blocked","cleanup_failed","inspect_failure");let g=s.status==="unverified"?s.reason:"outcome_missing";return v({...r,host:{...r.host,state:c.host.requested?"unknown":"not_requested",message:g}},"blocked",g,g==="containment_unavailable"?"inspect_failure":"retry_verification")}o(ae,"verifyExitReceipt");function v(t,c,f,a){return{...t,recovery:{state:c,reason:f,nextAction:a,checkedAt:new Date().toISOString()}}}o(v,"withRecovery");function ne(t){return t.cleanup.state==="pending"?{...t,cleanup:{...t.cleanup,state:"unknown",issues:[...t.cleanup.issues,"Original Host stopped before client cleanup was confirmed."]}}:t}o(ne,"afterOwnerLoss");function oe(t,c){return t.runtimeId===c.runtimeId&&t.pid===c.pid&&t.kind===c.kind&&t.processStartIdentity===c.processStartIdentity&&t.processContainment===c.processContainment&&t.supervisorPid===c.supervisorPid&&t.supervisorProcessStartIdentity===c.supervisorProcessStartIdentity}o(oe,"sameExitOwner");async function tt(t){let{instanceId:c,instanceSecret:f}=t.clientInfo;if(!c||!/^[A-Za-z0-9_.:-]{4,160}$/.test(c)||!f||f.length<32||f.length>512)throw new Error("Exit recovery requires the original stable client identity and secret.");let a=U(t.homeDir===void 0?$:Re.resolve(t.homeDir,".kodax"),t.profile);return Promise.all(L(a,re(c,f)).map(e=>ae(a,e)))}o(tt,"readKodaXClientExits");async function nt(t={}){return k(await te({...t,requirements:{productClient:1,productHistoryBoundaries:1,productExitControl:1,productExecutionFacts:1,...t.authorizeExecution?{productExecutionAuthorization:2,productActorAuthorization:1,providerProbeAuthorization:1}:{}}},t.authorizeExecution),t.authorizeExecution)}o(nt,"ensureKodaXClient");async function ot(t={}){let c=await ee({homeDir:t.homeDir,profile:t.profile,endpoint:t.endpoint,daemonToken:t.token,autoStart:!1,onStartupProgress:t.onStartupProgress,clientInfo:t.clientInfo,requirements:{productClient:1,productHistoryBoundaries:1,productExitControl:1,productExecutionFacts:1,...t.authorizeExecution?{productExecutionAuthorization:2,productActorAuthorization:1,providerProbeAuthorization:1}:{}}});return k(c,t.authorizeExecution)}o(ot,"connectKodaXClient");export{k as a,tt as b,nt as c,ot as d};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{a}from"./chunk-7SX7CHYP.js";import"./chunk-KQ3XVHKK.js";import"./chunk-E2Z754K5.js";import"./chunk-A3SLNYBB.js";import"./chunk-4KR4VUZK.js";import"./chunk-52EN2777.js";import"./chunk-WMMESRP3.js";import"./chunk-UF3GZ5PO.js";import"./chunk-QP47JIWP.js";import"./chunk-KE2NBMAP.js";import"./chunk-V5RCDBKU.js";import"./chunk-KDLOPBFZ.js";import"./chunk-V4WSBIXB.js";export{a as loadCompactionConfig};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{$ as zj,A as _i,Aa as _j,B as $i,Ba as $j,C as aj,Ca as ak,D as bj,Da as bk,E as cj,Ea as ck,F as dj,Fa as dk,G as ej,Ga as ek,H as fj,Ha as fk,I as gj,Ia as gk,J as hj,Ja as hk,K as ij,Ka as ik,L as jj,La as jk,M as kj,Ma as kk,N as lj,Na as lk,O as mj,Oa as mk,P as nj,Pa as nk,Q as oj,Qa as ok,R as pj,Ra as pk,S as qj,Sa as qk,T as rj,Ta as rk,U as sj,Ua as sk,V as tj,Va as tk,W as uj,Wa as uk,X as vj,Xa as vk,Y as wj,Ya as wk,Z as xj,_ as yj,a,aa as Aj,b as da,ba as Bj,c as ea,ca as Cj,d as fa,da as Dj,e as lc,ea as Ej,f as mc,fa as Fj,g as nc,ga as Gj,h as Hi,ha as Hj,i as Ii,ia as Ij,j as Ji,ja as Jj,k as Ki,ka as Kj,l as Li,la as Lj,m as Mi,ma as Mj,n as Ni,na as Nj,o as Oi,oa as Oj,p as Pi,pa as Pj,q as Qi,qa as Qj,r as Ri,ra as Rj,s as Si,sa as Sj,t as Ti,ta as Tj,u as Ui,ua as Uj,v as Vi,va as Vj,w as Wi,wa as Wj,x as Xi,xa as Xj,y as Yi,ya as Yj,z as Zi,za as Zj}from"./chunk-LPHKXPF7.js";import{a as Qh,b as Rh,c as Sh,d as Th,e as Uh,f as Vh,g as Wh,h as Xh,i as Yh,j as Gi}from"./chunk-7U2BL7CM.js";import{A as xi,B as yi,C as zi,D as Ai,E as Bi,F as Ci,G as Di,H as Ei,I as Fi,a as Zh,b as _h,c as $h,d as ai,e as bi,f as ci,g as di,h as ei,i as fi,j as gi,k as hi,l as ii,m as ji,n as ki,o as li,p as mi,q as ni,r as oi,s as pi,t as qi,u as ri,v as si,w as ti,x as ui,y as vi,z as wi}from"./chunk-5WZ5FUUD.js";import{a as Lh,b as Mh}from"./chunk-N2B6A3CX.js";import{A as Fd,B as Gd,C as Hd,D as Id,E as Jd,a as bd,b as cd,c as dd,d as ed,e as jd,f as kd,g as ld,h as md,i as nd,j as od,k as pd,l as qd,m as rd,n as sd,o as td,p as ud,q as vd,r as wd,s as xd,t as yd,u as zd,v as Ad,w as Bd,x as Cd,y as Dd,z as Ed}from"./chunk-FMZN5F3Q.js";import{a as Jh,b as Kh}from"./chunk-W6MHQ7ED.js";import{Cb as Gh,Da as gh,Db as Hh,Ea as hh,Fa as ih,Fb as Ih,Na as jh,Oa as kh,Pa as lh,Qa as mh,Ra as nh,Sa as oh,T as Qg,U as Rg,Ua as ph,V as Sg,Va as qh,W as Tg,Wa as rh,X as Ug,Xa as sh,Ya as th,aa as Vg,b as Ob,ba as Wg,c as Pb,cb as vh,d as Qb,db as wh,e as Rb,ea as Xg,f as Sb,fa as Yg,g as Tb,i as Ub,j as Vb,ja as Zg,k as Wb,ka as _g,kb as xh,la as $g,ma as ah,mb as yh,n as Xb,na as bh,nb as zh,o as Yb,ob as Ah,p as Zb,pb as Bh,q as ac,qa as ch,r as oc,ra as dh,s as pc,sa as eh,sb as Ch,ta as fh,tb as Dh,ub as Eh,vb as Fh}from"./chunk-NM3AINLH.js";import{a as uh}from"./chunk-HA4IKFUK.js";import{a as b,b as c,d as Gg,e as Hg,f as Ig,g as Jg,h as Kg,o as Nh,p as Oh,q as Ph}from"./chunk-G2IMBA3R.js";import{a as bc,b as cc,c as ec,d as fc,e as gc,f as hc,h as Lg,i as Mg,k as Ng,l as Og,m as Pg}from"./chunk-FZZMHNDB.js";import{a as fd,b as gd,c as hd,d as id}from"./chunk-4Y6U7AH4.js";import"./chunk-PRH5G5J7.js";import"./chunk-ISLK6R2P.js";import{$a as Rd,$b as Ie,$c as zf,$d as rg,Ab as ne,Ac as af,Ad as _f,B as tc,Bb as oe,Bc as bf,Bd as $f,C as uc,Cb as pe,Cd as ag,D as vc,Da as Vc,Db as qe,Dd as bg,E as wc,Ea as Wc,Eb as re,Ed as cg,F as xc,Fa as Xc,Fb as se,Fc as cf,G as yc,Ga as Yc,Gb as te,Gc as df,H as zc,Ha as Zc,Hb as ue,Hc as ef,I as Ac,Ib as ve,Ic as ff,Id as dg,J as Bc,Jb as we,Jc as gf,Kc as hf,L as Cc,Lb as xe,Lc as jf,M as Dc,Mb as ye,Mc as kf,N as Ec,Na as _c,Nb as ze,Nc as lf,O as Fc,Oc as mf,Od as eg,P as Gc,Pc as nf,Pd as fg,Q as Hc,Qa as $c,Qb as Ae,Qc as of,Qd as gg,R as Ic,Ra as ad,Rb as Be,Rc as pf,Rd as hg,S as Jc,Sb as Ce,Sc as qf,Sd as ig,T as Kc,Ta as Kd,Tb as De,Tc as rf,Td as jg,U as Lc,Ua as Ld,Ub as Ee,Uc as sf,Ud as kg,V as Mc,Va as Md,Vb as Fe,Vc as tf,Vd as lg,W as Nc,Wa as Nd,Wb as Ge,Wc as uf,Wd as mg,Xa as Od,Xc as vf,Xd as ng,Yc as wf,Yd as og,Za as Pd,Zc as xf,Zd as pg,_a as Qd,_b as He,_c as yf,_d as qg,ab as Sd,ac as Je,ad as Af,ae as sg,bb as Td,bc as Ke,bd as Bf,be as tg,c as _b,cb as Ud,cd as Cf,d as $b,db as Vd,dd as Df,de as ug,eb as Wd,ed as Ef,ee as vg,f as dc,fb as Xd,fd as Ff,g as ic,ga as Oc,gb as Yd,gc as Le,gd as Gf,h as jc,ha as Pc,hb as Zd,hc as Me,hd as Hf,i as kc,ia as Qc,ib as _d,ic as Ne,id as If,ie as wg,ja as Rc,jb as $d,jc as Oe,jd as Jf,je as xg,ka as Sc,kb as ae,kc as Pe,kd as Kf,ke as yg,la as Tc,lb as be,lc as Qe,ld as Lf,le as zg,mb as ce,mc as Re,md as Mf,me as Ag,nb as de,nc as Se,nd as Nf,ne as Bg,oc as Te,od as Of,oe as Cg,p as qc,pc as Ue,pd as Pf,pe as Dg,q as rc,qb as ee,qc as Ve,qd as Qf,qe as Eg,r as sc,rb as fe,rc as We,rd as Rf,sb as ge,sc as Xe,sd as Sf,tb as he,tc as Ye,td as Tf,ub as ie,uc as Ze,ud as Uf,vb as je,vc as _e,vd as Vf,wb as ke,wd as Wf,xd as Xf,yb as le,yd as Yf,za as Uc,zb as me,zc as $e,zd as Zf}from"./chunk-BZF7WPRK.js";import{a as Fg}from"./chunk-TXI6SHDO.js";import"./chunk-MJ4IGUD4.js";import"./chunk-GZUWQZJD.js";import"./chunk-ED7D73C3.js";import"./chunk-65652LR4.js";import"./chunk-3ZEJRVNA.js";import{$c as vb,Ac as _a,Bc as $a,Cc as ab,D as va,Dc as bb,E as wa,Ec as cb,F as xa,Fa as za,Fc as db,G as ya,Ia as Aa,Ic as eb,Jc as fb,Lb as Ya,Lc as gb,Ld as zb,Mb as Za,Mc as hb,Md as Ab,Nc as ib,Nd as Bb,Oc as jb,Od as Cb,Pc as kb,Pd as Db,Qc as lb,Qd as Eb,Rc as mb,Rd as Fb,Sc as nb,Tc as ob,Uc as pb,Ud as Gb,Vc as qb,Vd as Hb,Wc as rb,Wd as Ib,Xc as sb,Xd as Jb,Yc as tb,Yd as Kb,Zd as Lb,_c as ub,bd as wb,de as Mb,ed as xb,ee as Nb,fd as yb,h as ka,i as la,j as ma,k as na,l as oa,m as pa,o as qa,p as ra,q as sa,r as ta,s as ua}from"./chunk-KQ3XVHKK.js";import{a as ga,b as ha,c as ia,f as ja}from"./chunk-E2Z754K5.js";import{A as Ra,B as Sa,C as Ta,D as Ua,E as Va,F as Wa,G as Xa,d as Ba,l as Ca,m as Da,n as Ea,o as Fa,p as Ga,q as Ha,r as Ia,s as Ja,t as Ka,u as La,v as Ma,w as Na,x as Oa,y as Pa,z as Qa}from"./chunk-A3SLNYBB.js";import{$ as S,B as u,C as v,D as w,E as x,F as y,G as z,H as A,I as B,J as C,K as D,L as E,M as F,N as G,O as H,Q as I,R as J,S as K,T as L,V as M,W as N,X as O,Y as P,Z as Q,_ as R,aa as T,ba as U,ca as V,da as W,fa as X,ga as Y,ha as Z,ia as _,k as q,ka as $,la as aa,m as r,ma as ba,n as s,pa as ca,v as t}from"./chunk-4KR4VUZK.js";import"./chunk-52EN2777.js";import"./chunk-WMMESRP3.js";import"./chunk-UF3GZ5PO.js";import"./chunk-QP47JIWP.js";import{$ as p,F as g,G as h,N as i,O as j,P as k,Q as l,R as m,S as n,Y as o}from"./chunk-KE2NBMAP.js";import"./chunk-V5RCDBKU.js";import{a as d,b as e,d as f}from"./chunk-KDLOPBFZ.js";import"./chunk-V4WSBIXB.js";export{xh as ALWAYS_RESIDENT_TOOL_NAMES,Sj as AUTO_MODE_DENIAL_CONSECUTIVE_THRESHOLD,Uj as AUTO_MODE_DENIAL_WINDOW_SIZE,Tj as AUTO_MODE_RECENT_DENIAL_THRESHOLD,jk as BASH_POLICY_SPEC,ed as BASH_SAFE_READ_COMMANDS,dd as BASH_WRITE_COMMANDS,Ui as BLOCKER_REQUIRED_CONSECUTIVE_TURNS,Zj as BREAKER_ERROR_THRESHOLD,_j as BREAKER_WINDOW_MS,hi as BUILTIN_WORKFLOWS,rc as CANCELLED_TOOL_RESULT_MESSAGE,qc as CANCELLED_TOOL_RESULT_PREFIX,Dj as CLASSIFIER_MAX_OUTPUT_TOKENS,Mi as CODING_INVARIANTS,zh as CODING_SUMMARY_PROMPT,Ah as CODING_UPDATE_SUMMARY_PROMPT,pf as CapabilityDeniedError,Oi as Client,Nh as CodingActorSession,_f as CombinedExtensionRuntime,qf as ConstructionManifestError,Cj as DEFAULT_CLASSIFIER_RETRY_TIMEOUT_MS,Bj as DEFAULT_CLASSIFIER_TIMEOUT_MS,Gh as DEFAULT_CODING_AGENT_NAME,oj as DEFAULT_DANGEROUS_PATTERNS,nf as DEFAULT_HANDLER_TIMEOUT_MS,Qg as DEFAULT_RESILIENCE_CONFIG,nj as DEFAULT_SAFE_PATTERNS,Af as DEFAULT_SELF_MODIFY_BUDGET,Dc as DEFAULT_TOOL_OUTPUT_MAX_BYTES,Cc as DEFAULT_TOOL_OUTPUT_MAX_LINES,Rh as DEFAULT_WORKFLOW_GENERATION_TIMEOUT_MS,ya as DefaultSummaryCompaction,oc as ErrorCategory,bd as FILE_MODIFICATION_TOOLS,$h as FINDING_VERIFICATION_OUTPUT_SCHEMA,Ce as GENERATOR_AGENT_NAME,Da as ImageResizeError,ra as KODAX_API_MIN_INTERVAL,w as KODAX_DEFAULT_PROVIDER,la as KODAX_DEFAULT_TIMEOUT,Ua as KODAX_FILE_MEDIA_TYPES,ma as KODAX_HARD_TIMEOUT,Sa as KODAX_IMAGE_MEDIA_TYPES,pa as KODAX_MAX_INCOMPLETE_RETRIES,na as KODAX_MAX_RETRIES,ka as KODAX_MAX_TOKENS,v as KODAX_PROVIDERS,u as KODAX_PROVIDER_SNAPSHOTS,g as KODAX_REASONING_MODE_SEQUENCE,oa as KODAX_RETRY_BASE_DELAY,h as KODAX_STABLE_EFFORT_INTENTS,qa as KODAX_STAGGER_DELAY,eg as KODAX_TOOLS,Pc as KODAX_UNDERLYING_CAPABILITY_TOPICS,Ta as KODAX_VIDEO_MEDIA_TYPES,t as KodaXAnthropicCompatProvider,o as KodaXBaseProvider,Oi as KodaXClient,d as KodaXError,Zf as KodaXExtensionRuntime,Ca as KodaXMediaError,q as KodaXOpenAICompatProvider,e as KodaXProviderError,f as KodaXRateLimitError,mc as KodaXSessionError,hh as KodaXSkillInvocationError,nc as KodaXTerminalError,lc as KodaXToolError,_b as KodaXTrustedTextMutationError,Qb as LEARNING_REVIEW_PROMPT_SHA256,Rb as LEARNING_REVIEW_SCHEMA_SHA256,Ob as LEARNING_REVIEW_SYSTEM_PROMPT,Pb as LEARNING_REVIEW_TOOL,ub as LINEAGE_ENTRY_TYPES,Hg as LSP_SERVERS,wb as LineageCompaction,vb as LineageExtension,Ig as LspService,Qc as MANUAL_REGISTRY,Oc as MANUAL_TOPIC_IDS,Ja as MAX_DIMENSION,kj as MEMORY_INTERVENTION_SELECTOR_PROMPT,lj as MEMORY_INTERVENTION_SELECTOR_SHA256,cd as MODIFICATION_TOOLS,fb as McpAuthRequiredError,rb as McpCapabilityProvider,eb as McpExpiredSessionError,sb as McpManager,qb as McpServerRuntime,Oa as PASTE_TMP_DIR_ENV,Pa as PASTE_TMP_TTL_MS,Be as PLANNER_AGENT_NAME,sa as PROMISE_PATTERN,kh as PROMPT_SECTION_REGISTRY,Ug as ProviderRecoveryCoordinator,Ec as READ_DEFAULT_LIMIT,Gc as READ_MAX_LINE_CHARS,Fc as READ_PREFLIGHT_SIZE_BYTES,Vf as REPO_EXPLORER_AGENT_NAME,Wf as REPO_EXPLORER_TOOL_NAMES,Aa as Runner,_h as SCOPED_REVIEW_OUTPUT_SCHEMA,Ae as SCOUT_AGENT_NAME,tk as SCOUT_THEN_AUTHOR_PROMPT_LINES,qh as SELF_KNOWLEDGE_ROUTING_RULE,jh as SYSTEM_PROMPT,yi as SYSTEM_WORKFLOW_LIMITS,Sg as StableBoundaryTracker,Ka as TARGET_RAW_SIZE_BYTES,Fe as TASK_ENGINE_ROLE_AGENTS,wj as TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME,mk as TRACING_ENV,$c as ToolResultBatchCapacityError,De as WORKER_AGENT_NAME,Qh as WORKFLOW_GENERATION_SYSTEM_PROMPT,Hf as _resetRuntimeForTesting,Kf as activate,Ba as actorQueueId,Jj as analyzeAutoModeCall,Ud as analyzeChangedScope,kd as analyzePowerShellMutation,yf as appendAuditEntry,Eb as appendSessionLineageLabel,Qe as applyAccountingDelta,ci as applyFindingVerification,Bh as applyPostCompactAttachments,Fb as applySessionCompaction,ad as applyToolResultGuardrail,Lb as archiveOldIslands,$b as assertTrustedTextMutationPolicy,c as assertWorkModeAvailable,vk as authorWorkflowViaWorker,Yj as autoModeDenialShouldFallback,Yb as awaitLatestCodingMemoryReviewDrain,fk as bashSignalCollector,nk as bootstrapTracing,Ii as boundedRevise,bk as breakerShouldFallback,Ji as budgetCeiling,zi as buildApprovalSummary,Te as buildBlockedGoal,rh as buildCapabilityContextSections,yj as buildClassifierPrompt,Ue as buildCompleteGoal,Pe as buildCreatedGoal,dh as buildFallbackRoutingDecision,Xi as buildGoalRuntimeBinding,pb as buildInitializeCapabilities,vf as buildLlmReviewPrompt,Sc as buildManualToolDescription,dj as buildMcpReverseCapabilities,Re as buildPausedGoal,Vg as buildPromptMessageContent,oh as buildPromptSnapshot,Zg as buildProviderCapabilitySnapshot,eh as buildProviderPolicyHintsForDecision,_g as buildProviderPolicyPromptNotes,Td as buildRepoIntelligenceContext,ee as buildRepoIntelligenceIndex,Qd as buildRepoOverview,Se as buildResumedGoal,fi as buildScopedReviewFinalPrompt,di as buildScopedReviewPrimaryPrompt,ei as buildScopedReviewVerificationPrompt,uk as buildScoutThenAuthorPrompt,ph as buildSelfKnowledgeRoutingRule,Yi as buildSessionGoalRuntimeBinding,Jb as buildSessionTree,th as buildSystemPrompt,sh as buildSystemPromptSnapshot,Cg as buildToolResultBudget,Dg as buildToolResultBudgetFromUsage,$e as buildToolSearchIndex,vi as buildWorkflowCostReport,Vh as buildWorkflowGenerationSkillContext,Uh as buildWorkflowGenerationUserPrompt,Wb as canonicalMemoryProjectId,tc as canonicalizeAgentHomePolicyPath,Fj as canonicalizeAutoModePath,ek as checkAbsoluteDeny,Wg as checkIncompleteToolCalls,gh as checkPromiseSignal,Eg as clampToolResultPolicyToBudget,Ai as clampWorkflowLimits,Ej as classify,qj as classifyBashCommand,pc as classifyError,Pd as classifyFileCategory,Lg as classifyResilienceError,yg as cleanupExpiredToolOutputs,Za as cleanupIncompleteToolCalls,zg as cleanupUnreferencedToolOutputs,X as clearRuntimeModelProviders,kc as clearShellExecutionEnvironmentCache,hk as collectAllSignals,Ed as collectBashWriteTargets,Fd as collectDeterministicBashWriteTargets,$f as combineExtensionRuntimes,sj as computeInputSignature,Gf as configureRuntime,Eh as consumeCompactionCooldown,te as convertCapabilityReadResult,se as convertProviderSearchResults,Kb as countActiveLineageMessages,ua as countTokens,va as createAgent,Vj as createAutoModeDenialTracker,ik as createAutoModeToolGuardrail,pj as createBashClassifierConfig,lk as createBashPrefixExtractor,mg as createBuiltinToolDefinition,$j as createCircuitBreaker,mj as createCodingMemoryInterventionRunner,Mh as createCodingWorkflowBackend,Ch as createCompactionAntiThrashState,rf as createCtxProxy,J as createCustomProvider,Hh as createDefaultCodingAgent,rj as createDenialTracker,Pj as createExecPolicyOperation,ag as createExtensionRuntime,Ph as createExternalActorTurnExecutor,Ha as createFileArtifactFromPath,wa as createHandoff,Ga as createImageArtifactFromPath,xa as createInMemorySession,gj as createKodaXTaskRunner,Oh as createLocalCodingActorControl,$a as createMcpCapabilityId,tb as createMcpManager,gb as createMcpTransport,da as createOutputSegmentProjection,Tb as createProductionLearningReviewer,lh as createPromptSection,fh as createReasoningPlan,xi as createRunGraphWriter,wh as createRuntimeContextBudgetSnapshot,Jh as createSessionControl,zb as createSessionLineage,xj as createToolResultTruncationGuardrail,Ia as createVideoArtifactFromPath,pk as createWorkflowLifecycleController,sk as createWorkflowPatternTemplateModule,Ei as createWorkflowRunManager,Qi as decideWorkflowInvocation,hf as dedupeExtensionPathsByEntrypoint,_a as defaultMcpCacheDir,of as defaultPolicy,qi as deleteSavedWorkflow,Vb as deriveCodingMemoryIdentity,Ub as deriveCodingMemoryIdentityFromRoot,Zb as deriveCodingMemoryReviewIdentities,Ff as disableSelfModify,kb as discoverAuthorizationServerMetadata,mf as discoverDefaultExtensions,lf as discoverExtensionsInDirectory,kf as discoverExtensionsInDirectoryDetailed,Uf as discoverMarkdownAgents,lb as discoverOAuthEndpoints,jb as discoverProtectedResourceMetadata,ki as discoverSavedWorkflows,Xb as drainCodingMemoryReviewInbox,Ie as drainPendingSwaps,fa as effectiveOutputSegmentText,k as effortToLegacyReasoningMode,Ci as emitWorkflowAgentDigest,Xa as enqueueWithArtifacts,Xf as ensureBuiltinRepoExplorerAgent,ta as estimateTokens,vh as estimateToolSchemaTokens,Oj as evaluateExecPolicy,$g as evaluateProviderPolicy,Qj as evaluateShellExecPolicy,jf as excludeExtensionPathsByEntrypoint,cf as exec,sc as executeManagedProcess,_e as executeRunScopedTool,wg as executeTool,xb as extractArtifactLedger,kk as extractCommandPrefix,Yg as extractComparableUserMessageText,re as extractHtmlTitle,ib as extractInsufficientScope,yd as extractPathsFromCommand,Xg as extractPromptComparableText,hb as extractResourceMetadataUrl,Nb as extractTitleFromMessages,gk as fileSignalCollector,ve as finalizeRetrievalResult,Qf as findByVersion,ld as findGitSubcommandIndex,Gb as findPreviousUserEntryId,hd as flattenArgv,id as flattenRedirections,Ib as forkSessionLineage,Pg as formatAgentsForPrompt,Lj as formatExecPolicyConfigurationError,Kj as formatExecPolicyRejection,ij as formatParallelDispatchResult,Hc as formatSize,vd as generateSavePattern,Mb as generateSessionId,Xh as generateWorkflow,Yh as generateWorkflowFromOptions,cg as getActiveExtensionRuntime,ha as getAgentConfigHome,ia as getAgentConfigPath,og as getAllRegisteredTools,ja as getAppDataDir,_ as getAvailableProviderNames,Hd as getBashOutsideProjectWriteRisk,lg as getBuiltinRegisteredToolDefinition,kg as getBuiltinToolDefinition,ii as getBuiltinWorkflow,R as getCustomModelCapabilities,L as getCustomProvider,O as getCustomProviderList,Q as getCustomProviderModelDescriptors,P as getCustomProviderModels,N as getCustomProviderNames,ff as getDefaultExtensionDirectory,Jg as getDefaultLspService,Fi as getDefaultWorkflowRunManager,vj as getDenialContext,rd as getDirectShellBypassBlockReason,Gd as getGovernedMemoryShellWriteDenial,je as getImpactEstimate,Ng as getKodaxGlobalDir,db as getMcpCachePaths,G as getModelCapabilities,Va as getModelInputCapabilities,ge as getModuleContext,Cd as getPlanModeAllowedWritablePaths,Id as getPlanModeBlockReason,ie as getProcessContext,x as getProvider,B as getProviderConfiguredCapabilityProfile,A as getProviderConfiguredReasoningCapability,C as getProviderList,z as getProviderModel,F as getProviderModelDescriptors,D as getProviderModels,ig as getRegisteredToolDefinition,fe as getRepoIntelligenceIndex,Rd as getRepoOverview,ke as getRepoRoutingSignals,tg as getRequiredToolParams,U as getRuntimeModelProvider,W as getRuntimeModelProviderNames,Ab as getSessionLineagePath,Bb as getSessionMessagesFromLineage,he as getSymbolContext,gg as getTool,hg as getToolDefinition,jg as getToolRegistrations,_c as getToolResultPolicy,rk as getWorkflowPatternTemplate,md as gitSignatureInspectionMayExecute,Me as goalTokenDelta,Pi as hasExplicitNaturalLanguageWorkflowIntent,He as hasPendingSwap,Ea as inferImageMediaType,Jd as inferPermissionMode,ch as inferTaskType,Fa as inferVideoMediaType,Yc as inspectEditFailure,de as inspectRepoIntelligenceRuntime,xg as inspectToolOutputStorage,Sb as installProductionLearningReviewer,zc as isAgentHomeHardMutationTarget,Ac as isAgentHomeHardRemovalTarget,wd as isAlwaysConfirmPath,wc as isAutoReadableAgentHomePath,Hj as isAutoReadableKodaxPath,uc as isAutoWritableAgentHomePath,Ij as isAutoWritableKodaxPath,qd as isBashReadCommand,Ad as isBashReadCommandAutoAllowed,sd as isBashWriteCommand,zd as isCommandOnProtectedPath,Gj as isCredentialBearingKodaxPath,M as isCustomProviderName,uj as isDeniedRecently,vc as isGovernedMemoryMutationTarget,pd as isHelpCommand,Z as isKnownProvider,fd as isNullDevice,hj as isParallelDispatchDirective,Bd as isPathInsideProject,Dd as isPlanModeAllowedPath,jd as isPowerShellMutationCommand,yc as isProtectedAgentHomeMutationTarget,xc as isProtectedAgentHomeReadTarget,Bc as isProtectedAgentHomeRemovalTarget,y as isProviderConfigured,E as isProviderName,V as isRuntimeModelProviderName,Mg as isSessionRecoveryCandidateError,od as isShellReadOnlyArgv,ef as isSupportedExtensionModulePath,ud as isToolCallAllowed,qg as isToolFileMutation,sg as isToolMutation,rg as isToolNetworkRead,pg as isToolPlanModeAllowed,Ve as isValidTokenBudget,Fg as languageIdForPath,Rf as listAll,ba as listAllModelCapabilities,Nf as listArtifacts,H as listBuiltinModelCapabilities,ng as listBuiltinToolDefinitions,ji as listBuiltinWorkflows,Je as listCodingDispatchableAgents,Pf as listConstructed,S as listCustomProviderModelCapabilities,We as listRunScopedTools,vg as listToolDefinitions,ug as listTools,qk as listWorkflowPatternTemplates,Og as loadAgentsFiles,Sf as loadAgentsFromMarkdown,Nj as loadExecPolicy,si as loadGeneratedWorkflowFromRun,cc as loadGenerationCheckpoint,sf as loadHandler,Tf as loadMarkdownAgentScope,ni as loadSavedWorkflow,mi as loadSavedWorkflowCapsule,ob as loadValidToken,Ye as lookupRunScopedTool,Le as makeDisabledGoalToolsContext,j as mapLegacyReasoningModeToEffortIntent,Bg as maybeRunReferenceAwareToolOutputGc,Ag as maybeRunToolOutputGc,cj as mcpRootsFromWorkspace,yb as mergeArtifactLedger,bi as mergeScopedReviewResults,ac as normalizeKodaXAgentMode,ab as normalizeMcpCapabilityId,La as normalizePastedImage,i as normalizeReasoningEffortValue,ai as normalizeScopedReviewResult,ic as normalizeShellExecutionContract,li as normalizeWorkflowModule,mh as orderPromptSections,Zh as parallelInvestigation,td as parseAllowedToolPattern,fc as parseBareInlineSlashReferences,gd as parseBashCommand,zj as parseClassifierOutput,Xc as parseEditToolError,Mj as parseExecPolicy,bc as parseGenerationCheckpoint,nd as parseGitGrepShortOption,ec as parseInlineSkillReferences,wf as parseLlmReviewVerdict,bb as parseMcpCapabilityId,ck as parseModelSpec,l as parseReasoningEffortEnv,dc as parseSandboxEnvironmentPass,s as parseTimeoutSecEnvMs,bf as parseToolSearchQuery,Wh as parseWorkflowGeneration,nb as performOAuthLogin,Qa as persistImageAsBlock,Mc as persistToolOutput,Zi as planGoalCreate,_i as planGoalTransition,yh as planToolExposure,ui as preflightWorkflowCapsule,le as prewarmRepoIntelligenceCaches,uh as providerResilienceConfigFromTimeouts,Ra as prunePasteTmpDir,Na as readAndNormalizeClipboardImage,Of as readArtifact,zf as readAuditEntries,Bf as readBudget,a as readClientItemRange,Ma as readClipboardImage,Ef as readDisableState,bh as reasoningModeToDepth,Tg as reconstructMessagesWithToolGuard,Xj as recordAutoModeAllow,Wj as recordAutoModeBlock,Si as recordBlockerAttempt,ak as recordBreakerError,Fh as recordCompactionSavings,tj as recordDenial,ea as reduceOutputSegmentProjection,Ni as registerCodingInvariants,aj as registerConfiguredMcpCapabilityProvider,K as registerCustomProviders,T as registerModelProvider,mb as registerOAuthClient,ej as registerOfficialSandboxExtension,za as registerPresetDispatcher,fg as registerTool,Lf as rehydrateActiveArtifacts,Cf as remainingSelfModifyBudget,pi as renameSavedWorkflow,Vd as renderChangedScope,ae as renderImpactEstimate,Zd as renderModuleContext,$d as renderProcessContext,nh as renderPromptSections,Sd as renderRepoOverview,ue as renderRetrievalResult,_d as renderSymbolContext,bj as replaceConfiguredMcpCapabilityProvider,ri as replaceSavedWorkflow,Gg as reportLspDiagnostics,Ti as resetBlockerCounter,Df as resetBudget,dk as resolveClassifierModel,Ke as resolveCodingDispatchableAgent,Ge as resolveConstructedAgent,gf as resolveExtensionEntrypoint,Rc as resolveKodaXManual,aa as resolveModelCapabilities,Y as resolveProvider,$ as resolveProviderModelDescriptors,m as resolveReasoningEffort,n as resolveReasoningEffortForModelSwitch,ah as resolveReasoningMode,ce as resolveRepoIntelligenceMode,be as resolveRepoIntelligenceRuntimeConfig,Rg as resolveResilienceConfig,Cb as resolveSessionLineageTarget,ih as resolveSkillModelOverride,Uc as resolveToolBridgeTarget,Ki as resolveToolCapability,Lc as resolveToolOutputDir,ca as resolveWireEffort,b as resolveWorkMode,Sh as resolveWorkflowGenerationTimeoutMs,ok as resolveWorkflowIdentity,Lh as resumeWorkflowGenerationTurn,Mf as revoke,Hb as rewindSessionLineage,Yf as rollbackSelfModify,tf as runAstRules,Ih as runKodaX,xf as runLlmReview,$i as runManagedTask,fj as runOrchestration,Xe as runScopedToolMap,Hi as runToolInvocation,Di as runWorkflowFromOptions,Bi as runWorkflowModule,wi as safeWorkflowArtifactName,oi as saveGeneratedWorkflow,ti as saveGeneratedWorkflowFromRun,gi as scopedReview,cb as searchMcpCatalog,af as searchToolIndex,bg as setActiveExtensionRuntime,ga as setAgentConfigHome,Db as setSessionLineageActiveEntry,jc as shellExecutionContractFingerprint,Oe as shouldFlipBudgetLimited,Dh as shouldSkipLlmCompaction,Kg as shutdownDefaultLspService,If as stage,Kh as startKodaX,Gi as startManagedWorkflow,Aj as stripAssistantText,qe as stripHtmlToText,Jf as testArtifact,r as timeoutSecToMs,Ze as toModelToolDefinition,xd as tokenizeRawCommandStages,Rj as tokenizeShellCommand,Od as toolAskUserQuestion,Kd as toolBash,Yd as toolChangedDiff,Xd as toolChangedScope,ye as toolCodeSearch,Wc as toolEdit,Ld as toolGlob,Md as toolGrep,pe as toolImpactEstimate,Zc as toolInsertAfterAnchor,me as toolModuleContext,Li as toolPermission,oe as toolProcessContext,Nc as toolRead,Wd as toolRepoOverview,ze as toolSemanticLookup,ne as toolSymbolContext,Nd as toolUndo,xe as toolWebFetch,we as toolWebSearch,Vc as toolWrite,Ic as truncateHead,Kc as truncateLine,Jc as truncateTail,Ne as turnWallTimeDelta,hc as uniqueBareInlineSlashNames,gc as uniqueInlineSkillNames,Ya as validateAndFixToolHistory,I as validateCustomProviderConfig,Th as validateGeneratedWorkflowSource,p as validateImageBytes,Wa as validateInputArtifactsForModel,jj as validateSubtaskIndependence,uf as validateToolSchemaForProvider,df as webhook,dg as withExtensionRuntimeContext,Vi as withGoalBeforeNextTurn,Wi as withGoalStopHook,Tc as withManualToolBranding,Ee as workerAgent,Ri as workflowStartOutcomeConsumesTurn,wk as writeReviewPackets};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{j as a}from"./chunk-7U2BL7CM.js";import"./chunk-5WZ5FUUD.js";import"./chunk-N2B6A3CX.js";import"./chunk-HA4IKFUK.js";import"./chunk-G2IMBA3R.js";import"./chunk-FZZMHNDB.js";import"./chunk-ISLK6R2P.js";import"./chunk-BZF7WPRK.js";import"./chunk-TXI6SHDO.js";import"./chunk-GZUWQZJD.js";import"./chunk-65652LR4.js";import"./chunk-3ZEJRVNA.js";import"./chunk-KQ3XVHKK.js";import"./chunk-E2Z754K5.js";import"./chunk-A3SLNYBB.js";import"./chunk-4KR4VUZK.js";import"./chunk-52EN2777.js";import"./chunk-WMMESRP3.js";import"./chunk-UF3GZ5PO.js";import"./chunk-QP47JIWP.js";import"./chunk-KE2NBMAP.js";import"./chunk-V5RCDBKU.js";import"./chunk-KDLOPBFZ.js";import"./chunk-V4WSBIXB.js";export{a as startManagedWorkflow};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{a,b,c,d,e,f,g}from"./chunk-MJ4IGUD4.js";import"./chunk-GZUWQZJD.js";import"./chunk-ED7D73C3.js";import"./chunk-65652LR4.js";import"./chunk-V4WSBIXB.js";export{b as SCRIPT_MODEL_LIMITS,a as SCRIPT_TOOL_NAME,c as buildScriptModelDescription,g as canReadWithModelTools,d as getScriptModelContracts,f as projectScriptModelTools,e as withScriptModelTool};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{o as a,p as b,q as c,r as d}from"./chunk-ADIWJDFS.js";import"./chunk-ZQYWDI4O.js";import"./chunk-5MDNQCAV.js";import"./chunk-LPHKXPF7.js";import"./chunk-7U2BL7CM.js";import"./chunk-5WZ5FUUD.js";import"./chunk-N2B6A3CX.js";import"./chunk-FMZN5F3Q.js";import"./chunk-W6MHQ7ED.js";import"./chunk-NM3AINLH.js";import"./chunk-HA4IKFUK.js";import"./chunk-G2IMBA3R.js";import"./chunk-FZZMHNDB.js";import"./chunk-4Y6U7AH4.js";import"./chunk-PRH5G5J7.js";import"./chunk-ISLK6R2P.js";import"./chunk-BZF7WPRK.js";import"./chunk-TXI6SHDO.js";import"./chunk-MJ4IGUD4.js";import"./chunk-GZUWQZJD.js";import"./chunk-ED7D73C3.js";import"./chunk-65652LR4.js";import"./chunk-3ZEJRVNA.js";import"./chunk-KQ3XVHKK.js";import"./chunk-E2Z754K5.js";import"./chunk-A3SLNYBB.js";import"./chunk-4KR4VUZK.js";import"./chunk-52EN2777.js";import"./chunk-WMMESRP3.js";import"./chunk-UF3GZ5PO.js";import"./chunk-QP47JIWP.js";import"./chunk-KE2NBMAP.js";import"./chunk-V5RCDBKU.js";import"./chunk-KDLOPBFZ.js";import"./chunk-V4WSBIXB.js";export{b as askInput,a as getPrompt,d as needsContinuation,c as openExternalEditor};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{H as a,I as b}from"./chunk-5WZ5FUUD.js";import"./chunk-N2B6A3CX.js";import"./chunk-G2IMBA3R.js";import"./chunk-FZZMHNDB.js";import"./chunk-ISLK6R2P.js";import"./chunk-BZF7WPRK.js";import"./chunk-TXI6SHDO.js";import"./chunk-GZUWQZJD.js";import"./chunk-65652LR4.js";import"./chunk-3ZEJRVNA.js";import"./chunk-KQ3XVHKK.js";import"./chunk-E2Z754K5.js";import"./chunk-A3SLNYBB.js";import"./chunk-4KR4VUZK.js";import"./chunk-52EN2777.js";import"./chunk-WMMESRP3.js";import"./chunk-UF3GZ5PO.js";import"./chunk-QP47JIWP.js";import"./chunk-KE2NBMAP.js";import"./chunk-V5RCDBKU.js";import"./chunk-KDLOPBFZ.js";import"./chunk-V4WSBIXB.js";export{a as createWorkflowRunManager,b as getDefaultWorkflowRunManager};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{a,b}from"./chunk-W6MHQ7ED.js";import"./chunk-NM3AINLH.js";import"./chunk-HA4IKFUK.js";import"./chunk-G2IMBA3R.js";import"./chunk-FZZMHNDB.js";import"./chunk-4Y6U7AH4.js";import"./chunk-PRH5G5J7.js";import"./chunk-ISLK6R2P.js";import"./chunk-BZF7WPRK.js";import"./chunk-TXI6SHDO.js";import"./chunk-MJ4IGUD4.js";import"./chunk-GZUWQZJD.js";import"./chunk-ED7D73C3.js";import"./chunk-65652LR4.js";import"./chunk-3ZEJRVNA.js";import"./chunk-KQ3XVHKK.js";import"./chunk-E2Z754K5.js";import"./chunk-A3SLNYBB.js";import"./chunk-4KR4VUZK.js";import"./chunk-52EN2777.js";import"./chunk-WMMESRP3.js";import"./chunk-UF3GZ5PO.js";import"./chunk-QP47JIWP.js";import"./chunk-KE2NBMAP.js";import"./chunk-V5RCDBKU.js";import"./chunk-KDLOPBFZ.js";import"./chunk-V4WSBIXB.js";export{a as createSessionControl,b as startKodaX};
|