@kodax-ai/kodax 0.7.86 → 0.7.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +16 -4
  3. package/README_CN.md +6 -4
  4. package/dist/chunks/{agent-IO6TXNCV.js → agent-Z64QF7KG.js} +1 -1
  5. package/dist/chunks/argument-completer-HIJBXRUT.js +2 -0
  6. package/dist/chunks/{chunk-Q6UAGROD.js → chunk-3PGNESV3.js} +2 -2
  7. package/dist/chunks/{chunk-B36G256E.js → chunk-4OLXWSCQ.js} +2 -2
  8. package/dist/chunks/{chunk-2RAXDUC7.js → chunk-7XTUXMAI.js} +2 -2
  9. package/dist/chunks/{chunk-AAFFS6RU.js → chunk-ASFCAPIG.js} +3 -3
  10. package/dist/chunks/{chunk-XA4ENCAH.js → chunk-BCYJIACJ.js} +2 -2
  11. package/dist/chunks/{chunk-U6HNMLNN.js → chunk-DB4O33RR.js} +5 -5
  12. package/dist/chunks/{chunk-GVGLYVG4.js → chunk-GRJ7NKWP.js} +1 -1
  13. package/dist/chunks/{chunk-G5FGIRDJ.js → chunk-ITP7J5HX.js} +1 -1
  14. package/dist/chunks/{chunk-HTVLCHWH.js → chunk-JS4RSF4B.js} +1 -1
  15. package/dist/chunks/chunk-SKELDH3G.js +123 -0
  16. package/dist/chunks/{chunk-A5VQGXH2.js → chunk-U44C5STU.js} +1 -1
  17. package/dist/chunks/{chunk-R4EHASEN.js → chunk-UWKM3HNY.js} +4 -4
  18. package/dist/chunks/chunk-XH7UM4GO.js +92 -0
  19. package/dist/chunks/{chunk-UKCDCVMD.js → chunk-XKLVC7F6.js} +1 -1
  20. package/dist/chunks/{chunk-MFCPQZ7E.js → chunk-YB7YVAPL.js} +1 -1
  21. package/dist/chunks/{chunk-XUKLF26Q.js → chunk-ZQNOEKOB.js} +2 -2
  22. package/dist/chunks/compaction-config-E4TFBCDJ.js +2 -0
  23. package/dist/chunks/{construction-bootstrap-4DGAYOWH.js → construction-bootstrap-YTFOT4M2.js} +1 -1
  24. package/dist/chunks/{dist-DFW7MXT7.js → dist-M3JV4PNA.js} +1 -1
  25. package/dist/chunks/{dist-WWL2DNIJ.js → dist-X55TWIK4.js} +1 -1
  26. package/dist/chunks/host-SJHHJBPB.js +2 -0
  27. package/dist/chunks/run-manager-T5QGWNON.js +2 -0
  28. package/dist/chunks/{utils-LV7FHKYN.js → utils-2FHVIO6X.js} +1 -1
  29. package/dist/index.d.ts +19 -19
  30. package/dist/index.js +1 -1
  31. package/dist/kodax_bootstrap.js +1 -1
  32. package/dist/kodax_cli.js +762 -762
  33. package/dist/kodax_resume.js +1 -1
  34. package/dist/provider-capabilities.json +239 -133
  35. package/dist/runtime-worker.js +716 -716
  36. package/dist/sandbox-workspace-session.js +4 -4
  37. package/dist/sdk-a2a.d.ts +12 -12
  38. package/dist/sdk-a2a.js +1 -1
  39. package/dist/sdk-agent.d.ts +17 -17
  40. package/dist/sdk-agent.js +1 -1
  41. package/dist/sdk-coding.d.ts +21 -21
  42. package/dist/sdk-coding.js +1 -1
  43. package/dist/sdk-experimental-memory.d.ts +4 -4
  44. package/dist/sdk-experimental-memory.js +1 -1
  45. package/dist/sdk-llm.d.ts +7 -7
  46. package/dist/sdk-llm.js +1 -1
  47. package/dist/sdk-mcp.js +1 -1
  48. package/dist/sdk-media.d.ts +1 -1
  49. package/dist/sdk-media.js +1 -1
  50. package/dist/sdk-repl.d.ts +16 -16
  51. package/dist/sdk-repl.js +1 -1
  52. package/dist/sdk-runtime.d.ts +13 -13
  53. package/dist/sdk-runtime.js +1 -1
  54. package/dist/sdk-sandbox.js +1 -1
  55. package/dist/sdk-session.d.ts +7 -7
  56. package/dist/sdk-session.js +1 -1
  57. package/dist/sdk-skills.js +1 -1
  58. package/dist/semantic-worker.js +1 -1
  59. package/dist/types-chunks/{base.d-DxG0m09Z.d.ts → base.d-vopO1rml.d.ts} +1 -1
  60. package/dist/types-chunks/{bash-prefix-extractor.d-QqKtuLZm.d.ts → bash-prefix-extractor.d-B36OQwNA.d.ts} +4 -4
  61. package/dist/types-chunks/{capability-learning.d-iPSiAmc_.d.ts → capability-learning.d-CE1tm29C.d.ts} +1 -1
  62. package/dist/types-chunks/{capsule.d-CN_iMqAS.d.ts → capsule.d-DEncDNzD.d.ts} +3 -3
  63. package/dist/types-chunks/{controller.d-A73Kf6tH.d.ts → controller.d-C1YdP_pQ.d.ts} +1 -1
  64. package/dist/types-chunks/{controller.d-Dzxz22X-.d.ts → controller.d-Dif9pbC9.d.ts} +2 -2
  65. package/dist/types-chunks/{guardrail.d-Y_AIh8-I.d.ts → guardrail.d-DhpnJv4Y.d.ts} +5 -5
  66. package/dist/types-chunks/{history-retrieval.d-Debbzn1z.d.ts → history-retrieval.d-YJQpQt7h.d.ts} +2 -2
  67. package/dist/types-chunks/{public-api.d-Cg-4GTbK.d.ts → public-api.d-D4q3WxKq.d.ts} +4 -4
  68. package/dist/types-chunks/{repl.d-Bhrbueab.d.ts → repl.d-D4ye29Kk.d.ts} +5 -5
  69. package/dist/types-chunks/{resolver.d-C9IW4fmU.d.ts → resolver.d-RyPo99tB.d.ts} +2 -2
  70. package/dist/types-chunks/{review-inbox.d-DuZqFX-z.d.ts → review-inbox.d-C1_xZ-yg.d.ts} +1 -1
  71. package/dist/types-chunks/{run-manager.d-BS4lJfL3.d.ts → run-manager.d-D30IvnwV.d.ts} +1 -1
  72. package/dist/types-chunks/{sdk-session-fQ_KENev.d.ts → sdk-session-DIU6sHa2.d.ts} +3 -3
  73. package/dist/types-chunks/{shell-command-sets.d-DRGjd_7Q.d.ts → shell-command-sets.d-rIHkZ_VR.d.ts} +1 -1
  74. package/dist/types-chunks/{side-query.d-CP1LiRiH.d.ts → side-query.d-iH0P9ASy.d.ts} +2 -2
  75. package/dist/types-chunks/{types.d-BRrJU4pb.d.ts → types.d-Bz5Y-PD9.d.ts} +4 -4
  76. package/dist/types-chunks/{types.d-CgrXrFrq.d.ts → types.d-CK9A9rpP.d.ts} +1 -1
  77. package/dist/types-chunks/{types.d-Bo4fyMLu.d.ts → types.d-COhAF5Xo.d.ts} +2 -2
  78. package/dist/types-chunks/{types.d-DlLBRqZ9.d.ts → types.d-sW-OqiFt.d.ts} +1 -1
  79. package/dist/types-chunks/{utils.d-BIhh_BqE.d.ts → utils.d-B65ozSTV.d.ts} +6 -6
  80. package/package.json +1 -1
  81. package/dist/chunks/argument-completer-JMICSGL6.js +0 -2
  82. package/dist/chunks/chunk-TRNAWSXP.js +0 -123
  83. package/dist/chunks/chunk-UH5WNJXF.js +0 -92
  84. package/dist/chunks/compaction-config-5RMG22CY.js +0 -2
  85. package/dist/chunks/host-6MMHYTI5.js +0 -2
  86. package/dist/chunks/run-manager-ISQSWCAM.js +0 -2
@@ -0,0 +1,92 @@
1
+ // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
+ import{a as n}from"./chunk-ONUPGMER.js";var M={user:0,background:1};function xt(e,t){return M[e]<=M[t]}n(xt,"priorityWithinMax");function me(e,t){return!(e.agentId!==t.agentId||!xt(e.priority,t.maxPriority)||t.mode!==void 0&&e.mode!==t.mode||t.id!==void 0&&e.id!==t.id||t.predicate&&!t.predicate(e))}n(me,"matchesFilter");var U=class{static{n(this,"MessageQueue")}messages=[];nextSeq=1;listeners=new Set;snapshotRef=Object.freeze([]);notify(t){this.snapshotRef=Object.freeze([...this.messages]);for(let o of this.listeners)try{o(t)}catch{}}subscribe=n(t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}),"subscribe");getSnapshot=n(()=>this.snapshotRef,"getSnapshot");enqueue(t){let o=`msg-${this.nextSeq++}`,r={id:o,priority:t.priority,mode:t.mode,content:t.content,agentId:t.agentId,inputArtifacts:t.inputArtifacts,taskResult:t.taskResult,enqueuedAt:Date.now()};return this.messages=[...this.messages,r],this.notify({kind:"enqueued",message:r}),o}dequeue(t){let o=[];for(let d=0;d<this.messages.length;d++){let l=this.messages[d];l&&me(l,t)&&o.push({originalIndex:d,message:l})}o.sort((d,l)=>{let y=M[d.message.priority]-M[l.message.priority];return y!==0?y:d.originalIndex-l.originalIndex});let r=t.limit,i=typeof r=="number"&&o.length>r?o.slice(0,r):o;if(i.length===0)return[];let s=new Set(i.map(d=>d.originalIndex));this.messages=this.messages.filter((d,l)=>!s.has(l));let a=i.map(d=>d.message);return this.notify({kind:"dequeued",messages:a}),a}peek(t){let o=[];for(let s=0;s<this.messages.length;s++){let a=this.messages[s];a&&me(a,t)&&o.push({originalIndex:s,message:a})}o.sort((s,a)=>{let d=M[s.message.priority]-M[a.message.priority];return d!==0?d:s.originalIndex-a.originalIndex});let r=t.limit;return(typeof r=="number"&&o.length>r?o.slice(0,r):o).map(s=>s.message)}size(){return this.messages.length}count(t){return this.peek(t).length}has(t){return this.count(t)>0}clear(){if(this.messages.length===0)return;let t=this.messages;this.messages=[],this.notify({kind:"cleared",messages:t})}},j;function I(){return j||(j=new U),j}n(I,"getMessageQueue");function wt(){j=void 0}n(wt,"_resetMessageQueueForTests");function J(e,t){return e?`actor:${e}:${t}`:t==="/root"?void 0:t}n(J,"actorQueueId");var k=new Map;function Mt(e){k.set(e,(k.get(e)??0)+1);let t=!1;return()=>{if(t)return;t=!0;let o=k.get(e);o===void 0||o<=1?k.delete(e):k.set(e,o-1)}}n(Mt,"registerActiveRootQueueRoute");function Y(){if(k.size!==0){if(k.size===1)return k.keys().next().value;throw new Error("Cannot infer queued follow-up target: multiple Actor root sessions are active. Pass sessionId or agentId explicitly.")}}n(Y,"resolveActiveRootQueueRoute");function St(){k.clear()}n(St,"_resetActiveRootQueueRoutesForTests");var he=new Set(["wait_agent"]);function ye(e){return e.some(o=>he.has(o))?"background":"user"}n(ye,"midTurnDrainPriority");function _t(e){let t=ye(e.lastTurnToolNames);return I().dequeue({agentId:e.agentId,maxPriority:t,limit:e.limit})}n(_t,"maybeDrainMidTurn");var m=class extends Error{static{n(this,"KodaXMediaError")}code;detail;cause;constructor(t,o,r={}){super(o),this.name="KodaXMediaError",this.code=t,this.detail=r.detail,this.cause=r.cause}},x=class extends m{static{n(this,"ImageResizeError")}constructor(t,o={}){super(o.code??"IMAGE_TOO_LARGE",t,o),this.name="ImageResizeError"}};import be from"node:path";var At={".gif":"image/gif",".jpeg":"image/jpeg",".jpg":"image/jpeg",".png":"image/png",".webp":"image/webp"},Kt={".3gp":"video/3gpp",".3gpp":"video/3gpp",".avi":"video/x-msvideo",".flv":"video/x-flv",".mov":"video/quicktime",".mp4":"video/mp4",".mpeg":"video/mpeg",".mpg":"video/mpeg",".webm":"video/webm",".wmv":"video/x-ms-wmv"};function ve(e){return At[be.extname(e).toLowerCase()]}n(ve,"inferImageMediaType");function ke(e){return Kt[be.extname(e).toLowerCase()]}n(ke,"inferVideoMediaType");function Xt(e,t={}){let o=t.mediaType??ve(e);return{kind:"image",path:e,...o?{mediaType:o}:{},...t.source?{source:t.source}:{},...t.description?{description:t.description}:{}}}n(Xt,"createImageArtifactFromPath");function It(e,t={}){if(t.mediaType!==void 0&&t.mimeType!==void 0&&t.mediaType!==t.mimeType)throw new m("UNSUPPORTED_MEDIA_TYPE",`File artifact mediaType and mimeType disagree: ${t.mediaType} != ${t.mimeType}.`);return{kind:"file",path:e,...t.mediaType?{mediaType:t.mediaType}:{},...t.mimeType?{mimeType:t.mimeType}:{},...t.name?{name:t.name}:{},...t.source?{source:t.source}:{},...t.description?{description:t.description}:{}}}n(It,"createFileArtifactFromPath");function Ot(e,t={}){let o=t.mediaType??ke(e);if(!o)throw new m("UNSUPPORTED_MEDIA_TYPE",`Cannot infer video media type from path: ${e}.`);return{kind:"video",path:e,mediaType:o,...t.name?{name:t.name}:{},...t.source?{source:t.source}:{},...t.description?{description:t.description}:{}}}n(Ot,"createVideoArtifactFromPath");import{Jimp as Dt}from"jimp";var Ce=2e3,Pe=Math.floor(3.75*1024*1024),Nt=[80,60,40];async function Q(e,t={}){let o=t.maxDimension??Ce,r=t.targetBytes??Pe;if(e.length===0)throw new x("Empty image buffer.",{code:"IMAGE_DECODE_FAILED"});let i;try{i=await Dt.read(e)}catch(u){let v=u instanceof Error?u.message:String(u);throw new x(`Failed to decode image: ${v}`,{code:"IMAGE_DECODE_FAILED",cause:u})}let{width:s,height:a}=i.bitmap,d=Math.max(s,a);if(d>o){let u=o/d;i.resize({w:Math.max(1,Math.round(s*u)),h:Math.max(1,Math.round(a*u))})}let l=i.bitmap.width,y=i.bitmap.height;if(t.preferMediaType!=="image/jpeg"){let u=await i.getBuffer("image/png");if(u.length<=r)return{buffer:Buffer.from(u),mediaType:"image/png",width:l,height:y}}for(let u of Nt){let v=await i.getBuffer("image/jpeg",{quality:u});if(v.length<=r)return{buffer:Buffer.from(v),mediaType:"image/jpeg",width:l,height:y}}if(t.preferMediaType==="image/jpeg"){let u=await i.getBuffer("image/png");if(u.length<=r)return{buffer:Buffer.from(u),mediaType:"image/png",width:l,height:y}}throw new x(`Image still exceeds budget (${r} bytes raw) after PNG and JPEG q40 compression. Try a smaller image or take a fresh screenshot of a smaller region.`,{code:"IMAGE_TOO_LARGE"})}n(Q,"normalizePastedImage");import{spawn as Ee}from"node:child_process";import{mkdtemp as Bt,readFile as Lt,rm as Ft}from"node:fs/promises";import{tmpdir as $t}from"node:os";import Te from"node:path";var xe=5e3;async function we(){switch(process.platform){case"darwin":return Ut();case"win32":return Wt();case"linux":return zt();default:throw new m("UNSUPPORTED_PLATFORM",`Clipboard image fallback is not supported on platform "${process.platform}".`)}}n(we,"readClipboardImage");async function jt(e={}){let t=await we();return t?Q(t,e):null}n(jt,"readAndNormalizeClipboardImage");async function Me(e){let t=await Bt(Te.join($t(),"kodax-clip-")),o=Te.join(t,"clip.png");try{return await e(o)}finally{await Ft(t,{recursive:!0,force:!0}).catch(r=>{})}}n(Me,"runWithTempPng");async function Ut(){return Me(async e=>{let t=`set png_data to (the clipboard as \xABclass PNGf\xBB)
3
+ set fh to open for access POSIX file "${e.replace(/"/g,'\\"')}" with write permission
4
+ write png_data to fh
5
+ close access fh`;return await _e("osascript",["-e",t])?Se(e):null})}n(Ut,"readMacClipboard");async function Wt(){return Me(async e=>{let t=["Add-Type -AssemblyName System.Drawing | Out-Null","$img = Get-Clipboard -Format Image","if ($null -eq $img) { exit 1 }",`$img.Save('${e.replace(/'/g,"''")}', [System.Drawing.Imaging.ImageFormat]::Png)`].join("; ");return await _e("powershell",["-NoProfile","-Command",t])?Se(e):null})}n(Wt,"readWinClipboard");async function zt(){return await Re("wl-paste",["--type","image/png"])??Re("xclip",["-selection","clipboard","-t","image/png","-o"])}n(zt,"readLinuxClipboard");async function Se(e){try{let t=await Lt(e);return t.length>0?t:null}catch(t){return null}}n(Se,"readNonEmptyFile");function _e(e,t){return new Promise(o=>{let r=!1,i=Ee(e,[...t],{stdio:"ignore",windowsHide:!0}),s=setTimeout(()=>{r||(r=!0,i.kill(),o(!1))},xe);i.once("error",()=>{r||(r=!0,clearTimeout(s),o(!1))}),i.once("exit",a=>{r||(r=!0,clearTimeout(s),o(a===0))})})}n(_e,"runCommand");function Re(e,t){return new Promise(o=>{let r=!1,i=[],s=Ee(e,[...t],{stdio:["ignore","pipe","ignore"],windowsHide:!0}),a=setTimeout(()=>{r||(r=!0,s.kill(),o(null))},xe);s.stdout?.on("data",d=>i.push(d)),s.once("error",()=>{r||(r=!0,clearTimeout(a),o(null))}),s.once("exit",d=>{if(r)return;if(r=!0,clearTimeout(a),d!==0){o(null);return}let l=Buffer.concat(i);o(l.length>0?l:null)})})}n(Re,"collectStdoutBytes");import{createHash as Vt}from"node:crypto";import{mkdir as Gt,readdir as qt,stat as Ht,unlink as Jt,writeFile as Yt}from"node:fs/promises";import{tmpdir as Qt}from"node:os";import Z from"node:path";var Ae="KODAX_PASTE_TMP_DIR",Ke=1440*60*1e3;function Xe(){return process.env[Ae]??Z.join(Qt(),"kodax-paste")}n(Xe,"resolvePasteTmpDir");function Zt(e){let t=e?.trim().replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return t&&t.length>0?t:"paste"}n(Zt,"sanitizeFileNamePrefix");async function en(e,t={}){let o=t.directory??Xe();await Gt(o,{recursive:!0});let r=e.mediaType==="image/jpeg"?".jpg":".png",i=Vt("sha256").update(e.buffer).digest("hex").slice(0,16),s=`${Zt(t.fileNamePrefix)}-${i}${r}`,a=Z.join(o,s);return await Yt(a,e.buffer),{type:"image",path:a,mediaType:e.mediaType}}n(en,"persistImageAsBlock");async function tn(e=Date.now()){let t=Xe(),o;try{o=await qt(t)}catch(s){return 0}let r=e-Ke,i=0;return await Promise.all(o.filter(s=>/-[0-9a-f]{16}\.(?:png|jpg)$/.test(s)).map(async s=>{let a=Z.join(t,s);try{(await Ht(a)).mtimeMs<r&&(await Jt(a),i+=1)}catch(d){}})),i}n(tn,"prunePasteTmpDir");import{AsyncLocalStorage as nn}from"node:async_hooks";var on=new nn;function rn(e){let t=on.getStore()?.credential;return t?O(e,t,new WeakMap):e}n(rn,"redactScopedProviderCredential");function O(e,t,o){if(typeof e=="string")return e.split(t).join("[REDACTED_CREDENTIAL]");if(e===null||typeof e!="object")return e;let r=o.get(e);if(r!==void 0)return r;if(e instanceof Error){let s=new Error(O(e.message,t,o));return o.set(e,s),s.name=e.name,e.stack!==void 0&&(s.stack=O(e.stack,t,o)),s}if(Array.isArray(e)){let s=[];o.set(e,s);for(let a of e)s.push(O(a,t,o));return s}let i={};o.set(e,i);for(let[s,a]of Object.entries(Object.getOwnPropertyDescriptors(e))){if(!a.enumerable||!("value"in a))continue;let d=s.split(t).join("[REDACTED_CREDENTIAL]");i[d]=O(a.value,t,o)}return i}n(O,"redactCredentialValue");function W(e,t){return`${e}/${t??""}`}n(W,"capabilityCacheKey");function sn(e,t,o){return e[W(t,o)]?.rejected??[]}n(sn,"getRejectedEfforts");function an(e,t,o,r,i,s){let a=W(t,o),d=e[a],l=d?.rejected.includes(r)?d.rejected:[...d?.rejected??[],r];return{...e,[a]:{rejected:l,source:i,updatedAt:s}}}n(an,"addRejectedEffort");function dn(e,t,o){if(!t)return{};let r={...e};return delete r[W(t,o)],r}n(dn,"removeCacheEntry");function ln(e){if(!e||typeof e!="object")return{};let t={};for(let[o,r]of Object.entries(e)){if(!r||typeof r!="object")continue;let i=r,s=Array.isArray(i.rejected)?i.rejected.filter(l=>typeof l=="string"):[],a=i.source==="probed"?"probed":"observed",d=typeof i.updatedAt=="string"?i.updatedAt:"";t[o]={rejected:s,source:a,updatedAt:d}}return t}n(ln,"sanitizeCapabilityCache");import{AsyncLocalStorage as un}from"node:async_hooks";var cn=new un,Ie=8,Oe=32;function fn(e){if(e===void 0)return;let t=Number.parseInt(e,10);return Number.isInteger(t)&&t>0?t:void 0}n(fn,"parsePositiveInt");function pn(){let e=ee()?.workflow?.maxConcurrency,t=typeof e=="number"&&Number.isInteger(e)&&e>0?e:fn(process.env.KODAX_WORKFLOW_MAX_CONCURRENCY)??Ie;return Math.max(1,Math.min(Oe,t))}n(pn,"resolveWorkflowMaxConcurrency");function ee(){return cn.getStore()}n(ee,"getRunScopedConfig");var D={transport:"native-api",conversationSemantics:"full-history",mcpSupport:"none",contextFidelity:"full",toolCallingFidelity:"full",sessionSupport:"full",longRunningSupport:"full",multimodalSupport:"none",evidenceSupport:"full"},De={...D,multimodalSupport:"image-input"},z={transport:"cli-bridge",conversationSemantics:"last-user-message",mcpSupport:"none",contextFidelity:"lossy",toolCallingFidelity:"limited",sessionSupport:"stateless",longRunningSupport:"limited",multimodalSupport:"none",evidenceSupport:"limited"},Ne={...z,multimodalSupport:"image-input"};function N(e){return{transport:e.transport,conversationSemantics:e.conversationSemantics,mcpSupport:e.mcpSupport,contextFidelity:e.contextFidelity??"full",toolCallingFidelity:e.toolCallingFidelity??"full",sessionSupport:e.sessionSupport??"full",longRunningSupport:e.longRunningSupport??"full",multimodalSupport:e.multimodalSupport??"none",evidenceSupport:e.evidenceSupport??"full"}}n(N,"normalizeCapabilityProfile");import Ti from"@anthropic-ai/sdk";import{parse as li}from"partial-json";import Li from"openai";import{ClientSideConnection as rs,PROTOCOL_VERSION as is,ndJsonStream as ss}from"@agentclientprotocol/sdk";var Yi=Object.freeze({status:"terminated"}),Qi=Object.freeze({status:"already-exited"}),Zi=Object.freeze({status:"unknown"}),es=String.raw`
6
+ using System;
7
+ using System.Runtime.InteropServices;
8
+ using System.Text;
9
+ public static class KodaXNativeProcessSnapshot {
10
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
11
+ private struct ProcessEntry32 {
12
+ public uint dwSize;
13
+ public uint cntUsage;
14
+ public uint th32ProcessID;
15
+ public IntPtr th32DefaultHeapID;
16
+ public uint th32ModuleID;
17
+ public uint cntThreads;
18
+ public uint th32ParentProcessID;
19
+ public int pcPriClassBase;
20
+ public uint dwFlags;
21
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
22
+ public string szExeFile;
23
+ }
24
+ [DllImport("kernel32.dll", SetLastError = true)]
25
+ private static extern IntPtr CreateToolhelp32Snapshot(uint flags, uint processId);
26
+ [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
27
+ private static extern bool Process32First(IntPtr snapshot, ref ProcessEntry32 entry);
28
+ [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
29
+ private static extern bool Process32Next(IntPtr snapshot, ref ProcessEntry32 entry);
30
+ [StructLayout(LayoutKind.Sequential)]
31
+ private struct FileTime {
32
+ public uint Low;
33
+ public uint High;
34
+ }
35
+ [DllImport("kernel32.dll", SetLastError = true)]
36
+ private static extern IntPtr OpenProcess(uint access, bool inheritHandle, uint processId);
37
+ [DllImport("kernel32.dll", SetLastError = true)]
38
+ private static extern bool GetProcessTimes(IntPtr process, out FileTime creation, out FileTime exit, out FileTime kernel, out FileTime user);
39
+ [DllImport("kernel32.dll", SetLastError = true)]
40
+ private static extern bool TerminateProcess(IntPtr process, uint exitCode);
41
+ [DllImport("kernel32.dll")]
42
+ private static extern void GetSystemTimeAsFileTime(out FileTime systemTime);
43
+ [DllImport("kernel32.dll")]
44
+ private static extern bool CloseHandle(IntPtr handle);
45
+ private static ulong ReadCreationTime(uint processId) {
46
+ var process = OpenProcess(0x1000, false, processId);
47
+ if (process == IntPtr.Zero) return 0;
48
+ try {
49
+ FileTime creation, exit, kernel, user;
50
+ if (!GetProcessTimes(process, out creation, out exit, out kernel, out user)) return 0;
51
+ return ((ulong)creation.High << 32) | creation.Low;
52
+ } finally {
53
+ CloseHandle(process);
54
+ }
55
+ }
56
+ public static int TerminateExact(uint processId, ulong expectedCreationTime) {
57
+ var process = OpenProcess(0x1001, false, processId);
58
+ if (process == IntPtr.Zero) return 0;
59
+ try {
60
+ FileTime creation, exit, kernel, user;
61
+ if (!GetProcessTimes(process, out creation, out exit, out kernel, out user)) return 0;
62
+ var actual = (((ulong)creation.High << 32) | creation.Low) / 10000;
63
+ if (actual != expectedCreationTime) return 2;
64
+ return TerminateProcess(process, 1) ? 1 : 0;
65
+ } finally {
66
+ CloseHandle(process);
67
+ }
68
+ }
69
+ public static string ReadRows() {
70
+ FileTime cutoffTime;
71
+ GetSystemTimeAsFileTime(out cutoffTime);
72
+ var cutoff = (((ulong)cutoffTime.High << 32) | cutoffTime.Low) / 10000;
73
+ var snapshot = CreateToolhelp32Snapshot(2, 0);
74
+ if (snapshot == new IntPtr(-1)) return string.Empty;
75
+ var rows = new StringBuilder();
76
+ var entry = new ProcessEntry32();
77
+ entry.dwSize = (uint)Marshal.SizeOf(entry);
78
+ try {
79
+ if (!Process32First(snapshot, ref entry)) return string.Empty;
80
+ do {
81
+ var creationTime = ReadCreationTime(entry.th32ProcessID) / 10000;
82
+ if (creationTime == 0 || creationTime <= cutoff) {
83
+ rows.Append(entry.th32ProcessID).Append(',').Append(entry.th32ParentProcessID).Append(',').Append(creationTime).Append('\n');
84
+ }
85
+ entry.dwSize = (uint)Marshal.SizeOf(entry);
86
+ } while (Process32Next(snapshot, ref entry));
87
+ return rows.ToString();
88
+ } finally {
89
+ CloseHandle(snapshot);
90
+ }
91
+ }
92
+ }`;import We from"node:fs";import ze from"node:os";import Ve from"node:path";var On="gpt-5.4",Dn="auto-gemini-3",Nn=["gpt-5.4","gpt-5.3-codex","gpt-5.3-codex-spark"],Bn=["auto-gemini-3","gemini-3.1-pro-preview","gemini-3-flash-preview","gemini-2.5-pro","gemini-2.5-flash"];function Ge(e){let t=new Set,o=[];for(let r of e){let i=r.trim();if(!i)continue;let s=i.toLowerCase();t.has(s)||(t.add(s),o.push(i))}return o}n(Ge,"dedupePreserveOrder");function Ln(){let e=Ve.join(ze.homedir(),".codex","config.toml");try{return We.readFileSync(e,"utf8").match(/^\s*model\s*=\s*"([^"]+)"/m)?.[1]?.trim()||null}catch{return null}}n(Ln,"readCodexConfiguredModel");function Fn(){let e=Ve.join(ze.homedir(),".gemini","settings.json");try{let t=JSON.parse(We.readFileSync(e,"utf8")),o=typeof t.model=="string"?t.model.trim():"";return o||(typeof t.general?.model=="string"?t.general.model.trim():"")||null}catch{return null}}n(Fn,"readGeminiConfiguredModel");function S(){return Ln()||On}n(S,"getCodexCliDefaultModel");function _(){return Fn()||Dn}n(_,"getGeminiCliDefaultModel");function B(){return Ge([S(),...Nn])}n(B,"getCodexCliKnownModels");function L(){return Ge([_(),...Bn])}n(L,"getGeminiCliKnownModels");var Fs=_(),$s=L();var Zs=S(),ea=B();import{existsSync as Yn,readFileSync as Qn}from"node:fs";import K from"node:path";import{fileURLToPath as Zn}from"node:url";var qe=["none","prompt-only","native-effort","native-budget","native-toggle","native-adaptive","unknown"],He=["openai-responses-effort","openai-chat-effort","codex-cli-config","anthropic-output-effort","anthropic-reasoning-effort","provider-budget","provider-toggle","prompt-only","none"],Je=["anthropic-adaptive","anthropic-budget","provider-budget","provider-toggle","none"],Ye=["zai-glm-5.3","zai-glm-5.2","zai-glm-toggle","deepseek-v4-flash-openai","deepseek-v4-pro-openai","deepseek-v4-openai","deepseek-v4-anthropic","deepseek-toggle","kimi-k3","kimi-k2.7-code","kimi-hybrid-toggle","minimax-m3","minimax-m2-always","mimo-v2.5-toggle","qwen-hybrid-thinking","openai-chat-reasoning","openai-responses-reasoning","codex-cli-effort","claude-adaptive-xhigh","claude-adaptive-max","anthropic-budget","generic-thinking-toggle","none"],Qe=["max_tokens","max_completion_tokens"],Ze=["native","image-input-native","cli-bridge","image-input-cli-bridge"],et=["count-tokens","models-list","minimal-message","unsupported"];function C(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}n(C,"isPlainObject");function w(e,t){if(typeof e!="string"||e.length===0)throw new Error(`provider-capabilities.json: ${t} must be a non-empty string`);return e}n(w,"requireString");function A(e,t){if(e!==void 0)return w(e,t)}n(A,"optionalString");function ot(e,t){if(e!==void 0){if(typeof e!="string"||!Qe.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${Qe.join(", ")}, got ${JSON.stringify(e)}`);return e}}n(ot,"optionalMaxOutputTokensField");function E(e,t){if(e!==void 0){if(typeof e!="number"||!Number.isFinite(e)||e<0)throw new Error(`provider-capabilities.json: ${t} must be a non-negative finite number`);return e}}n(E,"optionalNumber");function h(e,t){if(e!==void 0){if(typeof e!="boolean")throw new Error(`provider-capabilities.json: ${t} must be a boolean`);return e}}n(h,"optionalBoolean");function tt(e,t){if(e!==void 0){if(!Array.isArray(e))throw new Error(`provider-capabilities.json: ${t} must be an array`);return e.map((o,r)=>w(o,`${t}[${r}]`))}}n(tt,"optionalStringArray");function jn(e,t){if(e===void 0)return;if(!C(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let o={};for(let[r,i]of Object.entries(e))o[r]=w(i,`${t}.${r}`);return o}n(jn,"optionalStringMap");function Un(e,t){if(e!==void 0){if(typeof e!="string"||!Ye.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${Ye.join(", ")}, got ${JSON.stringify(e)}`);return e}}n(Un,"optionalReasoningPreset");function oe(e,t){if(typeof e!="string"||!qe.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${qe.join(", ")}, got ${JSON.stringify(e)}`);return e}n(oe,"requireReasoningCapability");function Wn(e,t){if(typeof e!="string"||!He.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${He.join(", ")}, got ${JSON.stringify(e)}`);return e}n(Wn,"requireEffortStrategy");function zn(e,t){if(e!==void 0){if(typeof e!="string"||!Je.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${Je.join(", ")}, got ${JSON.stringify(e)}`);return e}}n(zn,"optionalThinkingStrategy");function nt(e,t){if(e===void 0)return;if(!C(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let o=Wn(e.effortStrategy,`${t}.effortStrategy`),r=Un(e.reasoningPreset,`${t}.reasoningPreset`),i=zn(e.thinkingStrategy,`${t}.thinkingStrategy`),s=A(e.defaultEffort,`${t}.defaultEffort`),a=jn(e.effortAliases,`${t}.effortAliases`),d=tt(e.disabledEfforts,`${t}.disabledEfforts`),l=tt(e.localRejectEfforts,`${t}.localRejectEfforts`),y=h(e.allowCustomEffort,`${t}.allowCustomEffort`),u=h(e.supportsReasoningEffort,`${t}.supportsReasoningEffort`),v=h(e.supportsReasoningSummary,`${t}.supportsReasoningSummary`),P=h(e.supportsEncryptedReasoningReplay,`${t}.supportsEncryptedReasoningReplay`),T=h(e.supportsAdaptiveThinking,`${t}.supportsAdaptiveThinking`),c=h(e.supportsManualThinkingBudget,`${t}.supportsManualThinkingBudget`),R=h(e.supportsDisabledThinking,`${t}.supportsDisabledThinking`),b=h(e.requiresEffortBetaHeader,`${t}.requiresEffortBetaHeader`),f={effortStrategy:o};if(r!==void 0&&(f.reasoningPreset=r),i!==void 0&&(f.thinkingStrategy=i),s!==void 0&&(f.defaultEffort=s),a!==void 0&&(f.effortAliases=a),d!==void 0&&(f.disabledEfforts=d),l!==void 0&&(f.localRejectEfforts=l),e.supportedEfforts!==void 0){if(!Array.isArray(e.supportedEfforts))throw new Error(`provider-capabilities.json: ${t}.supportedEfforts must be an array`);f.supportedEfforts=e.supportedEfforts.map((p,g)=>{if(!C(p))throw new Error(`provider-capabilities.json: ${t}.supportedEfforts[${g}] must be an object`);return{value:w(p.value,`${t}.supportedEfforts[${g}].value`),...A(p.description,`${t}.supportedEfforts[${g}].description`)!==void 0?{description:A(p.description,`${t}.supportedEfforts[${g}].description`)}:{},...h(p.isDefault,`${t}.supportedEfforts[${g}].isDefault`)!==void 0?{isDefault:h(p.isDefault,`${t}.supportedEfforts[${g}].isDefault`)}:{},...h(p.isUserVisible,`${t}.supportedEfforts[${g}].isUserVisible`)!==void 0?{isUserVisible:h(p.isUserVisible,`${t}.supportedEfforts[${g}].isUserVisible`)}:{}}})}if(e.budgetByEffort!==void 0){if(!C(e.budgetByEffort))throw new Error(`provider-capabilities.json: ${t}.budgetByEffort must be an object`);let p={};for(let[g,ge]of Object.entries(e.budgetByEffort))p[g]=E(ge,`${t}.budgetByEffort.${g}`)??0;f.budgetByEffort=p}return y!==void 0&&(f.allowCustomEffort=y),u!==void 0&&(f.supportsReasoningEffort=u),v!==void 0&&(f.supportsReasoningSummary=v),P!==void 0&&(f.supportsEncryptedReasoningReplay=P),T!==void 0&&(f.supportsAdaptiveThinking=T),c!==void 0&&(f.supportsManualThinkingBudget=c),R!==void 0&&(f.supportsDisabledThinking=R),b!==void 0&&(f.requiresEffortBetaHeader=b),f}n(nt,"validateReasoningProfile");function rt(e,t){let o=e.reasoningProfile,r=e.reasoningCapabilityV2;if(o!==void 0&&r!==void 0)throw new Error(`provider-capabilities.json: ${t} must not define both reasoningProfile and deprecated reasoningCapabilityV2`);return o!==void 0?nt(o,`${t}.reasoningProfile`):nt(r,`${t}.reasoningCapabilityV2`)}n(rt,"validateReasoningProfileField");function Vn(e,t){if(typeof e!="string"||!Ze.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${Ze.join(", ")}, got ${JSON.stringify(e)}`);return e}n(Vn,"requireProfileName");function Gn(e,t){if(typeof e!="string"||!et.includes(e))throw new Error(`provider-capabilities.json: ${t} must be one of ${et.join(", ")}, got ${JSON.stringify(e)}`);return e}n(Gn,"requireVerifyStrategy");function qn(e,t){if(!C(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let o=w(e.id,`${t}.id`),r=A(e.wireModel,`${t}.wireModel`),i=A(e.displayName,`${t}.displayName`),s=E(e.contextWindow,`${t}.contextWindow`),a=E(e.maxOutputTokens,`${t}.maxOutputTokens`),d=ot(e.maxOutputTokensField,`${t}.maxOutputTokensField`),l=E(e.thinkingBudgetCap,`${t}.thinkingBudgetCap`),y=h(e.replayReasoningContent,`${t}.replayReasoningContent`),u=h(e.strictThinkingSignature,`${t}.strictThinkingSignature`),v=E(e.streamMaxDurationMs,`${t}.streamMaxDurationMs`),P=e.reasoningCapability===void 0?void 0:oe(e.reasoningCapability,`${t}.reasoningCapability`),T=rt(e,t),c={id:o};return r!==void 0&&(c.wireModel=r),i!==void 0&&(c.displayName=i),s!==void 0&&(c.contextWindow=s),a!==void 0&&(c.maxOutputTokens=a),d!==void 0&&(c.maxOutputTokensField=d),l!==void 0&&(c.thinkingBudgetCap=l),P!==void 0&&(c.reasoningCapability=P),T!==void 0&&(c.reasoningProfile=T),y!==void 0&&(c.replayReasoningContent=y),u!==void 0&&(c.strictThinkingSignature=u),v!==void 0&&(c.streamMaxDurationMs=v),c}n(qn,"validateModelDescriptor");function Hn(e,t){if(e===void 0)return;if(!C(e))throw new Error(`provider-capabilities.json: ${t} must be an object`);let o={};for(let[r,i]of Object.entries(e))o[r]=oe(i,`${t}.${r}`);return o}n(Hn,"validateModelReasoningCapabilities");function Jn(e,t){if(!C(e))throw new Error(`provider-capabilities.json: providers.${t} must be an object`);let o=h(e.cliBridge,`providers.${t}.cliBridge`),r=w(e.apiKeyEnv,`providers.${t}.apiKeyEnv`),i=oe(e.reasoningCapability,`providers.${t}.reasoningCapability`),s=rt(e,`providers.${t}`),a=Vn(e.capabilityProfile,`providers.${t}.capabilityProfile`),d=Gn(e.verifyStrategy,`providers.${t}.verifyStrategy`);if(o&&d!=="unsupported")throw new Error(`provider-capabilities.json: providers.${t} is a cliBridge entry but verifyStrategy="${d}" \u2014 must be "unsupported" (CLI binary owns credentials)`);let l=E(e.contextWindow,`providers.${t}.contextWindow`),y=E(e.maxOutputTokens,`providers.${t}.maxOutputTokens`),u=ot(e.maxOutputTokensField,`providers.${t}.maxOutputTokensField`),v=E(e.thinkingBudgetCap,`providers.${t}.thinkingBudgetCap`),P=h(e.supportsThinking,`providers.${t}.supportsThinking`),T=Hn(e.modelReasoningCapabilities,`providers.${t}.modelReasoningCapabilities`),c=A(e.model,`providers.${t}.model`);if(o&&(c!==void 0||e.models!==void 0))throw new Error(`provider-capabilities.json: providers.${t} is a cliBridge entry but defines model/models \u2014 must be omitted (filled at load time)`);if(!o&&c===void 0)throw new Error(`provider-capabilities.json: providers.${t}.model is required (only cliBridge entries may omit)`);let R;if(e.models!==void 0){if(!Array.isArray(e.models))throw new Error(`provider-capabilities.json: providers.${t}.models must be an array`);R=e.models.map((p,g)=>qn(p,`providers.${t}.models[${g}]`));let f=new Set([...c===void 0?[]:[c],...R.map(p=>p.id)]);for(let[p,g]of R.entries())if(g.wireModel!==void 0&&!f.has(g.wireModel))throw new Error(`provider-capabilities.json: providers.${t}.models[${p}].wireModel must reference a declared model, got ${JSON.stringify(g.wireModel)}`)}let b={apiKeyEnv:r,reasoningCapability:i,capabilityProfile:a,verifyStrategy:d};return s!==void 0&&(b.reasoningProfile=s),c!==void 0&&(b.model=c),R!==void 0&&(b.models=R),l!==void 0&&(b.contextWindow=l),y!==void 0&&(b.maxOutputTokens=y),u!==void 0&&(b.maxOutputTokensField=u),v!==void 0&&(b.thinkingBudgetCap=v),P!==void 0&&(b.supportsThinking=P),T!==void 0&&(b.modelReasoningCapabilities=T),o&&(b.cliBridge=!0),b}n(Jn,"validateProviderEntry");function it(e){if(!C(e))throw new Error("provider-capabilities.json: root must be an object");if(e.version!==1)throw new Error(`provider-capabilities.json: version must be 1, got ${JSON.stringify(e.version)}`);let t=w(e.updatedAt,"updatedAt");if(!C(e.providers))throw new Error("provider-capabilities.json: providers must be an object");let o={};for(let[r,i]of Object.entries(e.providers))o[r]=Jn(i,r);return{version:1,updatedAt:t,providers:o}}n(it,"validateProviderCapabilitiesJson");var eo=Object.freeze({native:D,"image-input-native":De,"cli-bridge":z,"image-input-cli-bridge":Ne}),H=null;function to(){if(process.env.KODAX_BUNDLED==="true")return K.join(K.dirname(process.execPath),"provider-capabilities.json");let e=K.dirname(Zn(import.meta.url)),t=[K.join(e,"provider-capabilities.json"),K.join(K.dirname(e),"provider-capabilities.json")];for(let o of t)if(Yn(o))return o;return t[0]}n(to,"resolveJsonPath");function no(e){if(e.models){for(let t of e.models)t.reasoningProfile&&st(t.reasoningProfile);for(let t of e.models)Object.freeze(t);Object.freeze(e.models)}return e.reasoningProfile&&st(e.reasoningProfile),e.modelReasoningCapabilities&&Object.freeze(e.modelReasoningCapabilities),Object.freeze(e)}n(no,"deepFreezeSnapshot");function st(e){if(e.supportedEfforts){for(let t of e.supportedEfforts)Object.freeze(t);Object.freeze(e.supportedEfforts)}e.budgetByEffort&&Object.freeze(e.budgetByEffort),e.effortAliases&&Object.freeze(e.effortAliases),e.disabledEfforts&&Object.freeze(e.disabledEfforts),e.localRejectEfforts&&Object.freeze(e.localRejectEfforts),Object.freeze(e)}n(st,"freezeReasoningProfile");function oo(e){if(e==="gemini-cli"){let t=_();return{model:t,models:L().filter(o=>o!==t).map(o=>({id:o}))}}if(e==="codex-cli"){let t=S();return{model:t,models:B().filter(o=>o!==t).map(o=>({id:o}))}}throw new Error(`provider-capabilities loader: unknown cliBridge provider '${e}'`)}n(oo,"resolveCliBridgeModels");function ro(e,t){let o=eo[t.capabilityProfile];if(!o)throw new Error(`provider-capabilities loader: unknown capabilityProfile '${t.capabilityProfile}' for provider '${e}'`);if(t.cliBridge){let i=oo(e),s={model:i.model,models:i.models,apiKeyEnv:t.apiKeyEnv,reasoningCapability:t.reasoningCapability,capabilityProfile:o,verifyStrategy:t.verifyStrategy};return t.reasoningProfile!==void 0&&(s.reasoningProfile=t.reasoningProfile),t.supportsThinking!==void 0&&(s.supportsThinking=t.supportsThinking),s}let r={model:t.model,apiKeyEnv:t.apiKeyEnv,reasoningCapability:t.reasoningCapability,capabilityProfile:o,verifyStrategy:t.verifyStrategy};return t.reasoningProfile!==void 0&&(r.reasoningProfile=t.reasoningProfile),t.models!==void 0&&(r.models=t.models),t.modelReasoningCapabilities!==void 0&&(r.modelReasoningCapabilities=t.modelReasoningCapabilities),t.contextWindow!==void 0&&(r.contextWindow=t.contextWindow),t.maxOutputTokens!==void 0&&(r.maxOutputTokens=t.maxOutputTokens),t.maxOutputTokensField!==void 0&&(r.maxOutputTokensField=t.maxOutputTokensField),t.thinkingBudgetCap!==void 0&&(r.thinkingBudgetCap=t.thinkingBudgetCap),t.supportsThinking!==void 0&&(r.supportsThinking=t.supportsThinking),r}n(ro,"buildSnapshot");function at(){if(H)return H;let e=to(),t;try{let i=Qn(e,"utf8");t=JSON.parse(i)}catch(i){let s=i instanceof Error?i.message:String(i);throw new Error(`provider-capabilities loader: failed to read ${e}: ${s}`)}let o=it(t),r={};for(let[i,s]of Object.entries(o.providers))r[i]=no(ro(i,s));return H=Object.freeze(r),H}n(at,"getProviderSnapshots");import Ra from"@anthropic-ai/sdk";var X=at();var dt=process.env.KODAX_PROVIDER??"zhipu-coding";var F=["image/png","image/jpeg","image/webp","image/gif"],$=["video/mp4","video/mpeg","video/quicktime","video/x-msvideo","video/x-flv","video/webm","video/x-ms-wmv","video/3gpp"],Ko=[],Xo=new Set(["anthropic","openai"]),Io=new Set(["ark-coding/doubao-seed-2.0-code","ark-coding/doubao-seed-2.0-pro","ark-coding/kimi-k2.6","ark-coding/kimi-k2.7-code","ark-coding/minimax-m3","kimi-code/k3-256k","qwen-token-plan/qwen3.8-max","qwen-token-plan/qwen3.8-max-preview","qwen-token-plan/qwen3.7-plus","qwen-token-plan/qwen3.6-flash"]),Oo=new Set(["kimi-code/kimi-for-coding","kimi-code/kimi-for-coding-highspeed","kimi-code/k3","kimi/kimi-k3","kimi/kimi-k2.5","kimi/kimi-k2.6","kimi/kimi-k2.7-code","kimi/kimi-k2.7-code-highspeed","minimax-coding/minimax-m3","minimax/minimax-m3","mimo-coding/mimo-v2.5","mimo/mimo-v2.5"]);function le(e){return{nativeSupported:!1,sdkSupported:!1,status:"unsupported",mediaTypes:[],maxCount:0,reason:e}}n(le,"unsupported");function Do(e){return{nativeSupported:!0,sdkSupported:!0,status:"supported",mediaTypes:F,nativeMediaTypes:F,reason:e}}n(Do,"supportedImage");function No(e){return{nativeSupported:!0,sdkSupported:!1,status:"provider-native-unwired",mediaTypes:[],nativeMediaTypes:$,maxCount:0,reason:e}}n(No,"nativeVideoUnwired");function Bo(e){return e.trim().toLowerCase()}n(Bo,"normalizeProvider");function Lo(e){return X[e]?.model}n(Lo,"resolveProviderDefaultModel");function Et(e,t){if(!t)return;let o=t.trim().toLowerCase();if(e==="kimi"){if(o==="k2.5")return"kimi-k2.5";if(o==="k2.6")return"kimi-k2.6";if(o==="k2.7-code")return"kimi-k2.7-code";if(o==="k2.7-code-highspeed")return"kimi-k2.7-code-highspeed"}return(e==="minimax-coding"||e==="minimax")&&o==="minimax-m3"?"minimax-m3":o}n(Et,"normalizeModel");function Fo(e){if(!Xo.has(e))return!1;let t=X[e];return t?N(t.capabilityProfile).multimodalSupport!=="none":!1}n(Fo,"hasOfficialImageSupport");function $o(e,t){let o=Et(e,t);if(!o)return!1;let r=`${e}/${o}`;return Oo.has(r)}n($o,"hasSourceBackedNativeMedia");function jo(e,t){let o=Et(e,t);return o?Io.has(`${e}/${o}`):!1}n(jo,"hasSourceBackedImage");function Uo(e,t,o){if(o)return"source-backed";if(t){if(e==="openai")return"openai-official";if(e==="anthropic")return"anthropic-official"}}n(Uo,"resolveImageCapabilityRoute");function Wo(e){switch(e){case"openai-official":return"Model route supports KodaX image input. Direct-path image/gif is sent as image/gif, but OpenAI requires non-animated GIF semantics.";case"anthropic-official":return"Model route supports KodaX image input. Direct-path image/gif is sent as image/gif, but Anthropic uses only the first frame of animated GIFs.";case"source-backed":return"Model route supports KodaX image input. Direct-path image/gif is sent as image/gif; animated-GIF interpretation is provider-owned."}}n(Wo,"imageCapabilityReason");function ue(e){let t=Bo(e.provider),o=e.model?.trim()||Lo(t),r=Fo(t),i=$o(t,o),s=i||jo(t,o),a=Uo(t,r,s),d=a!==void 0,l=i;return{text:!0,image:d?Do(Wo(a)):le("No verified KodaX image-input route for this provider/model."),video:l?No("Model route is native-video capable, but KodaX SDK video sending is not wired yet. Reject or downgrade before send."):le("No verified native video route for this provider/model."),file:le("File artifact contract is stable, but KodaX SDK file sending/extraction is not wired yet. Reject or downgrade before send.")}}n(ue,"getModelInputCapabilities");function zo(e){return F.includes(e)}n(zo,"isKnownImageMediaType");function Vo(e){return $.includes(e)}n(Vo,"isKnownVideoMediaType");function ce(e){return`${e.provider}${e.model?`/${e.model}`:""}`}n(ce,"routeLabel");function fe(e){return e.reason?`${e.status}: ${e.reason}`:e.status}n(fe,"capabilityDetail");function pe(e,t){if(e.length===0)return;let o=ue(t);for(let r of e){let i=r;if(i.kind==="image"){if(!o.image.nativeSupported||!o.image.sdkSupported)throw new m("MODEL_INPUT_UNSUPPORTED",`Provider/model cannot consume image artifacts: ${ce(t)}.`,{detail:fe(o.image)});if(typeof i.mediaType=="string"&&!zo(i.mediaType))throw new m("UNSUPPORTED_MEDIA_TYPE",`Unsupported image media type: ${i.mediaType}.`);continue}throw i.kind==="video"?typeof i.mediaType!="string"||!Vo(i.mediaType)?new m("UNSUPPORTED_MEDIA_TYPE",`Unsupported video media type: ${String(i.mediaType)}.`,{detail:`Supported video media types: ${$.join(", ")}`}):new m("MODEL_INPUT_UNSUPPORTED",`Provider/model cannot consume video artifacts through this SDK runtime: ${ce(t)}.`,{detail:fe(o.video)}):i.kind==="file"?typeof i.mediaType=="string"&&typeof i.mimeType=="string"&&i.mediaType!==i.mimeType?new m("UNSUPPORTED_MEDIA_TYPE",`File artifact mediaType and mimeType disagree: ${i.mediaType} != ${i.mimeType}.`):new m("MODEL_INPUT_UNSUPPORTED",`Provider/model cannot consume file artifacts through this SDK runtime: ${ce(t)}.`,{detail:fe(o.file)}):new m("MODEL_INPUT_UNSUPPORTED",`Unsupported input artifact kind: ${String(i.kind)}.`)}}n(pe,"validateInputArtifactsForModel");function Go(e){if(pe(e.inputArtifacts??[],e),e.agentId!==void 0&&e.sessionId!==void 0)throw new Error("enqueueWithArtifacts accepts either agentId or sessionId, not both.");if(e.sessionId!==void 0&&e.sessionId.trim().length===0)throw new Error("enqueueWithArtifacts sessionId must not be empty.");let t=e.agentId??(e.sessionId!==void 0?J(e.sessionId,"/root"):Y());return I().enqueue({priority:e.priority??"user",mode:"prompt",content:e.content,agentId:t,inputArtifacts:e.inputArtifacts})}n(Go,"enqueueWithArtifacts");export{rn as a,sn as b,an as c,dn as d,ln as e,pn as f,U as g,I as h,wt as i,J as j,Mt as k,Y as l,St as m,he as n,ye as o,_t as p,m as q,x as r,ve as s,ke as t,Xt as u,It as v,Ot as w,Ce as x,Pe as y,Q as z,we as A,jt as B,Ae as C,Ke as D,en as E,tn as F,F as G,$ as H,Ko as I,ue as J,pe as K,Go as L};
@@ -1,5 +1,5 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{D as N,J as C}from"./chunk-XUKLF26Q.js";import{ee as q,fe as j,na as _}from"./chunk-U6HNMLNN.js";import{Pa as E,gb as T,m as x,n as R}from"./chunk-TRNAWSXP.js";import{Fd as O,Gd as W,Ld as M,og as $,pg as g,qg as k,tg as I,ug as y,vg as b}from"./chunk-G5FGIRDJ.js";import{a as o}from"./chunk-ONUPGMER.js";import{join as Pe}from"node:path";var ne=["You generate KodaX Dynamic Workflow scripts.","Return JSON only. Do not wrap the answer in prose.","For simple tasks that do not benefit from multiple agents, return:",'{"action":"decline","reason":"..."}',"For complex tasks, return:",'{"action":"generate","manifest":{...},"source":"async function run(wf, args) { ... }","approvalSummary":"..."}',"Generated source may only coordinate agents through wf and args.","Generated source must return displayable final text for the user.","Never use import, require, process, fs, child_process, network APIs, shell commands, or direct file access."].join(`
2
+ import{D as N,J as C}from"./chunk-ZQNOEKOB.js";import{ee as q,fe as j,na as _}from"./chunk-DB4O33RR.js";import{Pa as E,gb as T,m as x,n as R}from"./chunk-SKELDH3G.js";import{Fd as O,Gd as W,Ld as M,og as $,pg as g,qg as k,tg as I,ug as y,vg as b}from"./chunk-ITP7J5HX.js";import{a as o}from"./chunk-ONUPGMER.js";import{join as Pe}from"node:path";var ne=["You generate KodaX Dynamic Workflow scripts.","Return JSON only. Do not wrap the answer in prose.","For simple tasks that do not benefit from multiple agents, return:",'{"action":"decline","reason":"..."}',"For complex tasks, return:",'{"action":"generate","manifest":{...},"source":"async function run(wf, args) { ... }","approvalSummary":"..."}',"Generated source may only coordinate agents through wf and args.","Generated source must return displayable final text for the user.","Never use import, require, process, fs, child_process, network APIs, shell commands, or direct file access."].join(`
3
3
  `),P=12e4,re="KODAX_WORKFLOW_GENERATION_TIMEOUT_SEC",se="KODAX_WORKFLOW_GENERATION_TIMEOUT_MS",oe=64,ie=2,ae=2e3,le=[{name:"default"},{name:"variant-results",finalText:o((e,n)=>`Variant smoke child report from ${e} (${n}).`,"finalText"),synthesizeText:"Variant smoke synthesis report."},{name:"unverified-success",status:o(()=>"completed_unverified","status"),finalText:o(e=>`Smoke result for ${e}: completed with verification warnings.`,"finalText"),synthesizeText:"Smoke synthesis: completed with verification warnings."},{name:"empty-args-rerun",args:o(()=>({}),"args")}],ce=[{id:"import",pattern:/\bimport\s*(?:\(|['"*{]|\w+\s+from\b)/},{id:"require",pattern:/\brequire\s*\(/},{id:"process",pattern:/\bprocess\s*(?:\.|\[)/},{id:"fs",pattern:/\b(?:node:)?fs\b/},{id:"child_process",pattern:/\bchild_process\b/},{id:"shell",pattern:/\b(?:exec|spawn|execFile)\s*\(/},{id:"fetch",pattern:/\bfetch\s*\(/},{id:"Deno",pattern:/\bDeno\s*(?:\.|\[)/},{id:"Bun",pattern:/\bBun\s*(?:\.|\[)/},{id:"globalThis-index",pattern:/\bglobalThis\s*\[/}];function ue(e=process.env,n){let t=x(n?.workflow?.generationTimeoutSec,"timeouts.workflow.generationTimeoutSec");if(t!==void 0)return t;let r=R(e[re]);if(r!==void 0)return r;let s=e[se];if(s===void 0||s.trim().length===0)return P;let i=Number(s);return!Number.isFinite(i)||i<=0?P:Math.floor(i)}o(ue,"resolveWorkflowGenerationTimeoutMs");function fe(e,n){if(typeof e!="object"||e===null)throw new Error(`${n} must be an object`);return e}o(fe,"readRecord");function D(e,n){let t=e[n];if(typeof t!="string"||t.trim().length===0)throw new Error(`workflow generation ${n} must be a non-empty string`);return t}o(D,"readNonEmptyString");function de(e){let n=e.trim(),t=/^```(?:json)?\s*([\s\S]*?)\s*```$/i.exec(n);if(t?.[1])return t[1].trim();let r=n.indexOf("{"),s=n.lastIndexOf("}");if(r>=0&&s>r)return n.slice(r,s+1);throw new Error("workflow generation output did not contain a JSON object")}o(de,"extractJsonText");function pe(e){let n=de(e);return fe(JSON.parse(n),"workflow generation output")}o(pe,"parseGenerationJson");function me(e){if(typeof e=="string"){let t=e.trim();return t.length>0?t:void 0}if(typeof e!="object"||e===null)return;let n=e;for(let t of["name","id","title","phase"]){let r=n[t];if(typeof r=="string"&&r.trim().length>0)return r.trim()}}o(me,"normalizePhaseEntry");function we(e){return e.split(/(?:->|\u2192|,|\n)/).map(n=>n.trim()).filter(n=>n.length>0)}o(we,"splitPhaseString");function he(e){if(typeof e!="object"||e===null)return e;let n=e,t=n.phases,r;if(Array.isArray(t)){let s=t.map(me);s.every(i=>i!==void 0)&&(r=s)}else if(typeof t=="string"){let s=we(t);s.length>0&&(r=s)}return r?{...n,phases:r}:e}o(he,"normalizeGeneratedManifestCandidate");function ge(e){return e.match(/\bwf\.(?:runAgent|spawnAgent|synthesize)\s*\(/g)?.length??0}o(ge,"estimateDirectAgentCalls");function ke(e,n){let t=e.maxConcurrency*Math.max(1,e.phases.length)+2,r=ge(n)+2,s=Math.min(oe,Math.max(e.maxAgents,t,r));return s>e.maxAgents?{...e,maxAgents:s}:e}o(ke,"reserveGeneratedWorkflowAgentCapacity");function w(e){let n="",t=0,r=["code"],s=[0];for(;t<e.length;){let i=e[t],a=e[t+1];if(r[r.length-1]==="template"){if(i==="\\"){n+=" ",t+=2;continue}if(i==="`"){n+=" ",t+=1,r.pop(),s.pop();continue}if(i==="$"&&a==="{"){n+=" ",t+=2,r.push("code"),s.push(0);continue}n+=i===`
4
4
  `?`
5
5
  `:" ",t+=1;continue}if(i==="/"&&a==="/"){for(n+=" ",t+=2;t<e.length&&e[t]!==`
@@ -1,5 +1,5 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{k as xn}from"./chunk-U6HNMLNN.js";import{Ia as X,Wa as ir,Ya as ar,_a as Te,db as _e,fb as bn,ib as vn,t as T,zc as se}from"./chunk-G5FGIRDJ.js";import{a as s}from"./chunk-ONUPGMER.js";import{spawn as hr,spawnSync as Xe}from"node:child_process";import{createHash as un,randomUUID as H}from"node:crypto";import{once as dr}from"node:events";import{constants as rt,existsSync as br,lstatSync as vr,mkdirSync as cr,readFileSync as xr,readdirSync as jn,realpathSync as ce,renameSync as $n,rmSync as Be,statSync as fn,writeFileSync as lr,writeSync as Ro}from"node:fs";import{copyFile as kr,lstat as tt,mkdir as K,readFile as he,realpath as Fe,rename as ot,rm as G,rmdir as st,stat as nn,writeFile as be}from"node:fs/promises";import{createRequire as it}from"node:module";import{createServer as at}from"node:net";import te from"node:os";import i from"node:path";import dt from"node:readline";import{fileURLToPath as ur,pathToFileURL as Ar}from"node:url";import{DEFAULT_WINDOWS_PROXY_PORT_RANGE as ct,SandboxManager as kn,getSrtWinPath as lt,getWindowsSandboxUserStatus as Mn,grantWindowsAcl as ut,installWindowsSandbox as ft,resolveSrtWin as pt,revokeWindowsAcl as Er}from"@anthropic-ai/sandbox-runtime";var ae="0.0.65";function wt(){let e=process.platform==="win32"?"windows-restricted-user":process.platform==="darwin"?"macos-seatbelt":process.platform==="linux"?"linux-bubblewrap":"unsupported";return{version:3,asrtVersion:ae,platform:process.platform,backend:e,genericCommandExecution:!0,controls:["filesystem","network","environment","timeout","output"],ordinaryCallsTriggerSetup:!1,setupMayElevate:process.platform==="win32",unavailableBehavior:"structured-no-execution",permissionFallback:"normal-permission-policy"}}s(wt,"sandboxRuntimeCapability");var qn=1048576,Kn=12e4,Xn=it(import.meta.url),Rr=process.env.KODAX_BUNDLED==="true"?void 0:Ar(Xn.resolve("@anthropic-ai/sandbox-runtime")).href,mt=new Set([".ssh",".aws",".azure",".gnupg",".kodax",".agents",".codex",".claude",".gemini",".direnv",".terraform.d"]),gt=new Set([".env",".envrc",".pgpass",".npmrc",".pypirc","credentials","id_rsa","id_ed25519"]),yt=[".ssh",".aws",".azure",".gnupg",".kube",".docker",".kodax",".agents",".codex",".claude",".gemini",".direnv",".terraform.d",i.join(".cargo","credentials.toml"),i.join(".config","gcloud"),i.join(".config","gh"),i.join(".config","openai"),i.join(".config","anthropic"),".gitconfig",i.join(".config","git","config"),".terraformrc",i.join(".config","pypoetry","auth.toml"),".condarc",".bashrc",".bash_profile",".zshrc",".zprofile",".profile",i.join(".config","fish","config.fish"),i.join(".config","fish","fish_variables"),".bash_history",".zsh_history",i.join(".m2","settings.xml"),i.join(".m2","settings-security.xml"),i.join(".gradle","gradle.properties"),i.join(".nuget","NuGet","NuGet.Config"),i.join(".pip","pip.conf"),i.join(".config","pip","pip.conf"),i.join(".cache","huggingface","token"),i.join(".huggingface","token"),i.join(".config","rclone","rclone.conf"),i.join(".local","share","keyrings"),i.join("Library","Keychains"),i.join("AppData","Roaming","Microsoft","Protect"),i.join("AppData","Roaming","Microsoft","Credentials"),i.join("AppData","Roaming","Microsoft","Vault"),i.join("AppData","Local","Microsoft","Credentials"),i.join("AppData","Local","Microsoft","Protect"),i.join("AppData","Local","Microsoft","Vault"),".password-store",".env",".envrc",".pgpass",".env.local",".env.development",".env.production",".env.test",".env.staging",".npmrc",".pypirc",".netrc",".git-credentials","credentials","credentials.json","application_default_credentials.json","id_rsa","id_dsa","id_ecdsa","id_ed25519"],St=["runtime","mcp-tokens","mcp-clients","integrations","sandbox-runtime","processes","learned","config.json","auth.json","trusted-project-rules.json",".env",".envrc",".pgpass",".npmrc",".pypirc",".netrc",".git-credentials","credentials","credentials.json","application_default_credentials.json"],Gn=["runtime","processes","learned"],ht=String.raw`
2
+ import{k as xn}from"./chunk-DB4O33RR.js";import{Ia as X,Wa as ir,Ya as ar,_a as Te,db as _e,fb as bn,ib as vn,t as T,zc as se}from"./chunk-ITP7J5HX.js";import{a as s}from"./chunk-ONUPGMER.js";import{spawn as hr,spawnSync as Xe}from"node:child_process";import{createHash as un,randomUUID as H}from"node:crypto";import{once as dr}from"node:events";import{constants as rt,existsSync as br,lstatSync as vr,mkdirSync as cr,readFileSync as xr,readdirSync as jn,realpathSync as ce,renameSync as $n,rmSync as Be,statSync as fn,writeFileSync as lr,writeSync as Ro}from"node:fs";import{copyFile as kr,lstat as tt,mkdir as K,readFile as he,realpath as Fe,rename as ot,rm as G,rmdir as st,stat as nn,writeFile as be}from"node:fs/promises";import{createRequire as it}from"node:module";import{createServer as at}from"node:net";import te from"node:os";import i from"node:path";import dt from"node:readline";import{fileURLToPath as ur,pathToFileURL as Ar}from"node:url";import{DEFAULT_WINDOWS_PROXY_PORT_RANGE as ct,SandboxManager as kn,getSrtWinPath as lt,getWindowsSandboxUserStatus as Mn,grantWindowsAcl as ut,installWindowsSandbox as ft,resolveSrtWin as pt,revokeWindowsAcl as Er}from"@anthropic-ai/sandbox-runtime";var ae="0.0.65";function wt(){let e=process.platform==="win32"?"windows-restricted-user":process.platform==="darwin"?"macos-seatbelt":process.platform==="linux"?"linux-bubblewrap":"unsupported";return{version:3,asrtVersion:ae,platform:process.platform,backend:e,genericCommandExecution:!0,controls:["filesystem","network","environment","timeout","output"],ordinaryCallsTriggerSetup:!1,setupMayElevate:process.platform==="win32",unavailableBehavior:"structured-no-execution",permissionFallback:"normal-permission-policy"}}s(wt,"sandboxRuntimeCapability");var qn=1048576,Kn=12e4,Xn=it(import.meta.url),Rr=process.env.KODAX_BUNDLED==="true"?void 0:Ar(Xn.resolve("@anthropic-ai/sandbox-runtime")).href,mt=new Set([".ssh",".aws",".azure",".gnupg",".kodax",".agents",".codex",".claude",".gemini",".direnv",".terraform.d"]),gt=new Set([".env",".envrc",".pgpass",".npmrc",".pypirc","credentials","id_rsa","id_ed25519"]),yt=[".ssh",".aws",".azure",".gnupg",".kube",".docker",".kodax",".agents",".codex",".claude",".gemini",".direnv",".terraform.d",i.join(".cargo","credentials.toml"),i.join(".config","gcloud"),i.join(".config","gh"),i.join(".config","openai"),i.join(".config","anthropic"),".gitconfig",i.join(".config","git","config"),".terraformrc",i.join(".config","pypoetry","auth.toml"),".condarc",".bashrc",".bash_profile",".zshrc",".zprofile",".profile",i.join(".config","fish","config.fish"),i.join(".config","fish","fish_variables"),".bash_history",".zsh_history",i.join(".m2","settings.xml"),i.join(".m2","settings-security.xml"),i.join(".gradle","gradle.properties"),i.join(".nuget","NuGet","NuGet.Config"),i.join(".pip","pip.conf"),i.join(".config","pip","pip.conf"),i.join(".cache","huggingface","token"),i.join(".huggingface","token"),i.join(".config","rclone","rclone.conf"),i.join(".local","share","keyrings"),i.join("Library","Keychains"),i.join("AppData","Roaming","Microsoft","Protect"),i.join("AppData","Roaming","Microsoft","Credentials"),i.join("AppData","Roaming","Microsoft","Vault"),i.join("AppData","Local","Microsoft","Credentials"),i.join("AppData","Local","Microsoft","Protect"),i.join("AppData","Local","Microsoft","Vault"),".password-store",".env",".envrc",".pgpass",".env.local",".env.development",".env.production",".env.test",".env.staging",".npmrc",".pypirc",".netrc",".git-credentials","credentials","credentials.json","application_default_credentials.json","id_rsa","id_dsa","id_ecdsa","id_ed25519"],St=["runtime","mcp-tokens","mcp-clients","integrations","sandbox-runtime","processes","learned","config.json","auth.json","trusted-project-rules.json",".env",".envrc",".pgpass",".npmrc",".pypirc",".netrc",".git-credentials","credentials","credentials.json","application_default_credentials.json"],Gn=["runtime","processes","learned"],ht=String.raw`
3
3
  $ErrorActionPreference = 'Stop'
4
4
  $payload = [Console]::In.ReadToEnd() | ConvertFrom-Json
5
5
  $mutex = [System.Threading.Mutex]::new($false, 'Local\KodaXAsrtAclGuard-v1')
@@ -1,5 +1,5 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{Eb as Ke,Fb as Le,Ib as ze,Jb as Je,ge,he as Ge,je as Xe,ke as Ye,le as Ze,se as Qe}from"./chunk-U6HNMLNN.js";import{Q as Ne}from"./chunk-TRNAWSXP.js";import{Ag as B,Bg as we,Cg as Ue,Jg as Ve,Kg as Be,Lg as He,jg as re,mg as De,ng as je,pg as Z,t as fe,tg as me,zg as pe}from"./chunk-G5FGIRDJ.js";import{a as i}from"./chunk-ONUPGMER.js";import{basename as kr,dirname as vr}from"node:path";import{execFile as Qt}from"node:child_process";import oe from"node:path";import{promisify as en}from"node:util";var tn=en(Qt),nn=1e4,at=2,et=new Set(["write","edit","multi_edit","insert_after_anchor"]),tt=new Set(["read"]);function rn(e,t){if(t.includes("*"))return e;if(e.includes("*"))return t;let n=new Set(t);return e.filter(r=>n.has(r))}i(rn,"intersectWorkflowToolCeilings");var on=/^\s*(?:let me|i will|i'll|i am going to)\b[\s\S]{0,120}\b(?:start|create|implement|write|build|plan)\b|^\s*(?:我将|让我|接下来)[\s\S]{0,80}(?:开始|创建|编写|实现|制定)/i;function an(e){if(e?.timeoutMs!==void 0){if(!Number.isFinite(e.timeoutMs)||e.timeoutMs<=0)throw new Error("workflow wait timeoutMs must be a positive number");return Math.floor(e.timeoutMs)}}i(an,"normalizeWaitTimeoutMs");function he(e){return e?.requiresMutation===!0||(e?.requiredChangedPaths?.length??0)>0}i(he,"hasVerificationWork");function H(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").trim()}i(H,"normalizeWorkspacePath");function ye(e,t){let n=t.gitRoot?oe.resolve(t.gitRoot):void 0,r=oe.isAbsolute(e)&&n?oe.relative(n,oe.resolve(e)):e;return H(r)}i(ye,"normalizeRequiredPath");function sn(e){let t=(e.readOnly??!1)===!1?{enforcement:"warn",requiresMutation:!0,rejectPreparatoryFinalText:!0}:void 0;if(e.verification!==void 0){let n={...t??{},...e.verification,enforcement:e.verification.enforcement??"hard"},r=e.verification.requiredChangedPaths;return{verification:{...n,...r!==void 0&&r.length>0&&n.requiresMutation===void 0?{requiresMutation:!0}:{}}}}return{verification:t}}i(sn,"resolveVerificationForInput");function cn(e,t){if(t===!0&&e.readOnly===!1)throw new Error(`workflow manifest readOnly=true cannot spawn write-capable child "${e.name}"; set the workflow manifest readOnly=false or use child readOnly:true`);let n=e.readOnly??t??!1;return e.readOnly===n?e:{...e,readOnly:n}}i(cn,"resolveSpawnAgentInput");function st(e){let t=e.trim();return t.length>0&&on.test(t)}i(st,"isPreparatoryOnlyText");function dn(e,t){let n=e.trim(),r=t?.trim();return r&&(n.length===0||st(n))?r:e}i(dn,"selectWorkflowFinalText");async function ie(e,t){return(await tn("git",[...e],{cwd:t,timeout:nn,windowsHide:!0,maxBuffer:4194304})).stdout.toString()}i(ie,"runGit");async function un(e){let t=e.gitRoot??e.executionCwd??process.cwd(),n=(await ie(["rev-parse","--show-toplevel"],t)).trim(),r=await Promise.all([ie(["diff","--name-only","--"],n),ie(["diff","--cached","--name-only","--"],n),ie(["ls-files","--others","--exclude-standard"],n)]);return[...new Set(r.flatMap(a=>a.split(/\r?\n/)).map(H).filter(a=>a.length>0))]}i(un,"listGitChangedFiles");async function ke(e,t){try{return{paths:(await t(e)).map(H).filter(r=>r.length>0)}}catch(n){return{paths:[],error:n instanceof Error?n.message:String(n)}}}i(ke,"captureChangedPaths");function ln(){return{toolNameById:new Map,toolPathById:new Map,succeededToolCalls:[],succeededPaths:[],readPathById:new Map,succeededReadPaths:[]}}i(ln,"createMutationRecorder");function nt(e){if(e)for(let t of["path","file_path","target_path"]){let n=e[t];if(typeof n=="string"&&n.trim().length>0)return H(n)}}i(nt,"readMutationPath");function fn(e,t){return{...e??{},onToolUseStart:i((n,r)=>{if(et.has(n.name)){t.toolNameById.set(n.id,n.name);let a=nt(n.input);a!==void 0&&t.toolPathById.set(n.id,a)}if(tt.has(n.name)){let a=nt(n.input);a!==void 0&&t.readPathById.set(n.id,a)}e?.onToolUseStart?.(n,r)},"onToolUseStart"),onToolResult:i((n,r)=>{let a=t.toolNameById.get(n.id)??n.name;if(et.has(a)&&!n.content.trimStart().startsWith("[Tool Error]")){t.succeededToolCalls.push(a);let o=t.toolPathById.get(n.id);o!==void 0&&t.succeededPaths.push(o)}if(tt.has(a)&&!n.content.trimStart().startsWith("[Tool Error]")){let o=t.readPathById.get(n.id);o!==void 0&&t.succeededReadPaths.push(o)}e?.onToolResult?.(n,r)},"onToolResult")}}i(fn,"wrapEventsForMutationRecording");function ae(e){return[...new Set(e.filter(t=>t.trim().length>0))]}i(ae,"uniqueItems");function rt(e){let t=e.verification;if(!t)return;let n=[],r=new Set(e.before.paths.map(H)),a=ae(e.after.paths.map(H)),o=a.filter(m=>!r.has(m)),s=ae(e.mutationRecorder.succeededToolCalls),d=e.acceptToolMutationEvidence?s:[],g=e.acceptToolMutationEvidence?ae(e.mutationRecorder.succeededPaths.map(H)):[],h=o.length>0||d.length>0,y=t.enforcement??"hard",p=(t.requiredChangedPaths??[]).map(m=>ye(m,e.ctx)),b=ae(e.mutationRecorder.succeededReadPaths.map(m=>ye(m,e.ctx))),v=(t.requiredReadPaths??[]).map(m=>ye(m,e.ctx));t.requiresMutation===!0&&(e.before.error!==void 0||e.after.error!==void 0?n.push(`workspace mutation verification could not read changed files: ${e.after.error??e.before.error}`):h||n.push(e.acceptToolMutationEvidence||s.length===0?"expected file mutations, but no new workspace changes or successful write tools were observed":"write tools ran in an isolated worktree, but no main workspace changes were present after cleanup")),e.term.limitReached===!0&&!h&&n.push("workflow child reached its iteration limit before satisfying the task");for(let m of p)!a.includes(m)&&!g.includes(m)&&n.push(`required changed path was not present in workspace changes: ${m}`);for(let m of v)b.includes(m)||n.push(`required review evidence was not read: ${m}`);let W=t.minFinalTextChars;return W!==void 0&&!h&&e.term.finalText.trim().length<W&&n.push(`finalText was shorter than the required ${W} characters`),t.rejectPreparatoryFinalText===!0&&!h&&st(e.term.finalText)&&n.push("finalText looks preparatory instead of terminal"),{ok:n.length===0,enforcement:y,reasons:n,changedPaths:a,mutationToolCalls:s,mutationEvidence:h,...b.length>0?{readPaths:b}:{}}}i(rt,"evaluateVerification");function ve(e,t){if(t.ok)return e;let r=[t.enforcement==="warn"?"[Workflow task completed without verification]":"[Workflow task verification failed]",...t.reasons.map(a=>`- ${a}`)].join(`
2
+ import{Eb as Ke,Fb as Le,Ib as ze,Jb as Je,ge,he as Ge,je as Xe,ke as Ye,le as Ze,se as Qe}from"./chunk-DB4O33RR.js";import{Q as Ne}from"./chunk-SKELDH3G.js";import{Ag as B,Bg as we,Cg as Ue,Jg as Ve,Kg as Be,Lg as He,jg as re,mg as De,ng as je,pg as Z,t as fe,tg as me,zg as pe}from"./chunk-ITP7J5HX.js";import{a as i}from"./chunk-ONUPGMER.js";import{basename as kr,dirname as vr}from"node:path";import{execFile as Qt}from"node:child_process";import oe from"node:path";import{promisify as en}from"node:util";var tn=en(Qt),nn=1e4,at=2,et=new Set(["write","edit","multi_edit","insert_after_anchor"]),tt=new Set(["read"]);function rn(e,t){if(t.includes("*"))return e;if(e.includes("*"))return t;let n=new Set(t);return e.filter(r=>n.has(r))}i(rn,"intersectWorkflowToolCeilings");var on=/^\s*(?:let me|i will|i'll|i am going to)\b[\s\S]{0,120}\b(?:start|create|implement|write|build|plan)\b|^\s*(?:我将|让我|接下来)[\s\S]{0,80}(?:开始|创建|编写|实现|制定)/i;function an(e){if(e?.timeoutMs!==void 0){if(!Number.isFinite(e.timeoutMs)||e.timeoutMs<=0)throw new Error("workflow wait timeoutMs must be a positive number");return Math.floor(e.timeoutMs)}}i(an,"normalizeWaitTimeoutMs");function he(e){return e?.requiresMutation===!0||(e?.requiredChangedPaths?.length??0)>0}i(he,"hasVerificationWork");function H(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").trim()}i(H,"normalizeWorkspacePath");function ye(e,t){let n=t.gitRoot?oe.resolve(t.gitRoot):void 0,r=oe.isAbsolute(e)&&n?oe.relative(n,oe.resolve(e)):e;return H(r)}i(ye,"normalizeRequiredPath");function sn(e){let t=(e.readOnly??!1)===!1?{enforcement:"warn",requiresMutation:!0,rejectPreparatoryFinalText:!0}:void 0;if(e.verification!==void 0){let n={...t??{},...e.verification,enforcement:e.verification.enforcement??"hard"},r=e.verification.requiredChangedPaths;return{verification:{...n,...r!==void 0&&r.length>0&&n.requiresMutation===void 0?{requiresMutation:!0}:{}}}}return{verification:t}}i(sn,"resolveVerificationForInput");function cn(e,t){if(t===!0&&e.readOnly===!1)throw new Error(`workflow manifest readOnly=true cannot spawn write-capable child "${e.name}"; set the workflow manifest readOnly=false or use child readOnly:true`);let n=e.readOnly??t??!1;return e.readOnly===n?e:{...e,readOnly:n}}i(cn,"resolveSpawnAgentInput");function st(e){let t=e.trim();return t.length>0&&on.test(t)}i(st,"isPreparatoryOnlyText");function dn(e,t){let n=e.trim(),r=t?.trim();return r&&(n.length===0||st(n))?r:e}i(dn,"selectWorkflowFinalText");async function ie(e,t){return(await tn("git",[...e],{cwd:t,timeout:nn,windowsHide:!0,maxBuffer:4194304})).stdout.toString()}i(ie,"runGit");async function un(e){let t=e.gitRoot??e.executionCwd??process.cwd(),n=(await ie(["rev-parse","--show-toplevel"],t)).trim(),r=await Promise.all([ie(["diff","--name-only","--"],n),ie(["diff","--cached","--name-only","--"],n),ie(["ls-files","--others","--exclude-standard"],n)]);return[...new Set(r.flatMap(a=>a.split(/\r?\n/)).map(H).filter(a=>a.length>0))]}i(un,"listGitChangedFiles");async function ke(e,t){try{return{paths:(await t(e)).map(H).filter(r=>r.length>0)}}catch(n){return{paths:[],error:n instanceof Error?n.message:String(n)}}}i(ke,"captureChangedPaths");function ln(){return{toolNameById:new Map,toolPathById:new Map,succeededToolCalls:[],succeededPaths:[],readPathById:new Map,succeededReadPaths:[]}}i(ln,"createMutationRecorder");function nt(e){if(e)for(let t of["path","file_path","target_path"]){let n=e[t];if(typeof n=="string"&&n.trim().length>0)return H(n)}}i(nt,"readMutationPath");function fn(e,t){return{...e??{},onToolUseStart:i((n,r)=>{if(et.has(n.name)){t.toolNameById.set(n.id,n.name);let a=nt(n.input);a!==void 0&&t.toolPathById.set(n.id,a)}if(tt.has(n.name)){let a=nt(n.input);a!==void 0&&t.readPathById.set(n.id,a)}e?.onToolUseStart?.(n,r)},"onToolUseStart"),onToolResult:i((n,r)=>{let a=t.toolNameById.get(n.id)??n.name;if(et.has(a)&&!n.content.trimStart().startsWith("[Tool Error]")){t.succeededToolCalls.push(a);let o=t.toolPathById.get(n.id);o!==void 0&&t.succeededPaths.push(o)}if(tt.has(a)&&!n.content.trimStart().startsWith("[Tool Error]")){let o=t.readPathById.get(n.id);o!==void 0&&t.succeededReadPaths.push(o)}e?.onToolResult?.(n,r)},"onToolResult")}}i(fn,"wrapEventsForMutationRecording");function ae(e){return[...new Set(e.filter(t=>t.trim().length>0))]}i(ae,"uniqueItems");function rt(e){let t=e.verification;if(!t)return;let n=[],r=new Set(e.before.paths.map(H)),a=ae(e.after.paths.map(H)),o=a.filter(m=>!r.has(m)),s=ae(e.mutationRecorder.succeededToolCalls),d=e.acceptToolMutationEvidence?s:[],g=e.acceptToolMutationEvidence?ae(e.mutationRecorder.succeededPaths.map(H)):[],h=o.length>0||d.length>0,y=t.enforcement??"hard",p=(t.requiredChangedPaths??[]).map(m=>ye(m,e.ctx)),b=ae(e.mutationRecorder.succeededReadPaths.map(m=>ye(m,e.ctx))),v=(t.requiredReadPaths??[]).map(m=>ye(m,e.ctx));t.requiresMutation===!0&&(e.before.error!==void 0||e.after.error!==void 0?n.push(`workspace mutation verification could not read changed files: ${e.after.error??e.before.error}`):h||n.push(e.acceptToolMutationEvidence||s.length===0?"expected file mutations, but no new workspace changes or successful write tools were observed":"write tools ran in an isolated worktree, but no main workspace changes were present after cleanup")),e.term.limitReached===!0&&!h&&n.push("workflow child reached its iteration limit before satisfying the task");for(let m of p)!a.includes(m)&&!g.includes(m)&&n.push(`required changed path was not present in workspace changes: ${m}`);for(let m of v)b.includes(m)||n.push(`required review evidence was not read: ${m}`);let W=t.minFinalTextChars;return W!==void 0&&!h&&e.term.finalText.trim().length<W&&n.push(`finalText was shorter than the required ${W} characters`),t.rejectPreparatoryFinalText===!0&&!h&&st(e.term.finalText)&&n.push("finalText looks preparatory instead of terminal"),{ok:n.length===0,enforcement:y,reasons:n,changedPaths:a,mutationToolCalls:s,mutationEvidence:h,...b.length>0?{readPaths:b}:{}}}i(rt,"evaluateVerification");function ve(e,t){if(t.ok)return e;let r=[t.enforcement==="warn"?"[Workflow task completed without verification]":"[Workflow task verification failed]",...t.reasons.map(a=>`- ${a}`)].join(`
3
3
  `);return e.trim().length>0?`${e}
4
4
 
5
5
  ${r}`:r}i(ve,"appendVerificationFailure");function ot(){return{ok:!1,enforcement:"warn",reasons:["workflow child reached its iteration limit before satisfying the task"],mutationEvidence:!1}}i(ot,"limitReachedWarningVerification");function mn(e){return e.entry.bundle.readOnly!==!0&&e.entry.repairAttempts<at&&e.term.status==="completed"&&e.verification!==void 0&&e.verification.ok!==!0&&e.verification.enforcement!=="warn"}i(mn,"shouldRepairVerificationFailure");function pn(e){let t=e.verification.reasons.map(r=>`- ${r}`).join(`
@@ -13,7 +13,7 @@ ${s.text}`),rubric:t.rubric??vn}))).text,findings:r,degraded:a}}i(Pn,"runParalle
13
13
  `).trim().replace(/[\t\n\f\r ]+/g," ")}i(j,"normalizeText");function lt(e){return j(e).replace(/\\/g,"/")}i(lt,"normalizeLocation");function se(e){return[...new Set(e.map(j).filter(Boolean))].sort((t,n)=>t<n?-1:t>n?1:0)}i(se,"uniqueSorted");function An(e,t,n){return Mn("sha256").update(`${e}\0${lt(t)}\0${j(n)}`,"utf8").digest("hex")}i(An,"findingId");function ft(e,t,n){if(!t&&n.specVerdict!=="not-verifiable")throw new Error('review result must use specVerdict "not-verifiable" when requirements are absent');return{specVerdict:n.specVerdict,qualityVerdict:n.qualityVerdict,findings:n.findings.map(r=>{let a=lt(r.location),o=j(r.claim),s=j(r.evidence);return{findingId:An(e,a,o),severity:r.severity,location:a,claim:o,evidence:s,...r.suggestedFix?{suggestedFix:j(r.suggestedFix)}:{}}}).sort((r,a)=>r.findingId<a.findingId?-1:r.findingId>a.findingId?1:0),unverifiedRequirements:se(n.unverifiedRequirements)}}i(ft,"normalizeScopedReviewResult");var ut={low:0,medium:1,high:2,critical:3};function En(e){return e.reduce((t,n)=>ut[n]>ut[t]?n:t,"low")}i(En,"maxSeverity");function mt(e){if(e.length===0)throw new Error("at least one primary review result is required");let t=new Map;for(let a of e)for(let o of a.findings)t.set(o.findingId,[...t.get(o.findingId)??[],o]);let n=[...t.entries()].map(([a,o])=>({findingId:a,severity:En(o.map(s=>s.severity)),location:o[0].location,claim:o[0].claim,evidence:se(o.map(s=>s.evidence)),suggestedFixes:se(o.flatMap(s=>s.suggestedFix?[s.suggestedFix]:[]))})).sort((a,o)=>a.findingId<o.findingId?-1:a.findingId>o.findingId?1:0);return{specVerdict:e.some(a=>a.specVerdict==="issues")?"issues":e.some(a=>a.specVerdict==="not-verifiable")?"not-verifiable":"compliant",qualityVerdict:e.some(a=>a.qualityVerdict==="needs-fixes")?"needs-fixes":"approved",findings:n,unverifiedRequirements:se(e.flatMap(a=>a.unverifiedRequirements))}}i(mt,"mergeScopedReviewResults");function pt(e,t){let n=new Set(e.findings.map(s=>s.findingId)),r=new Set;for(let s of t.findings){if(!n.has(s.findingId)||r.has(s.findingId))throw new Error("verifier must return every input findingId exactly once");r.add(s.findingId)}if(r.size!==n.size)throw new Error("verifier must return every input findingId exactly once");let a=new Map(t.findings.map(s=>[s.findingId,s])),o=e.findings.flatMap(s=>{let d=a.get(s.findingId);if(d.disposition==="refuted")return[];let g=d.severityReason?.trim(),h=d.effectiveSeverity!==void 0&&!!g;return[{...s,disposition:d.disposition,severity:h?d.effectiveSeverity:s.severity,verificationEvidence:j(d.evidence),...g?{severityReason:j(g)}:{}}]});return{specVerdict:e.specVerdict,qualityVerdict:e.qualityVerdict,unverifiedRequirements:e.unverifiedRequirements,actionable:o,audit:t,unqualifiedApprovalAllowed:o.length===0&&e.unverifiedRequirements.length===0&&e.specVerdict==="compliant"&&e.qualityVerdict==="approved"}}i(pt,"applyFindingVerification");var Wn={type:"object",additionalProperties:!1,required:["summary"],properties:{summary:{type:"string"}}};function gt(e){return[e.packetPath,...e.evidenceChunks.map(t=>t.path)]}i(gt,"evidencePaths");function Fn(e){let t=ge(e,Se);if(t.length>0)throw new Error(`primary reviewer structured result is invalid: ${t.join("; ")}`);return e}i(Fn,"rawReview");function On(e){let t=ge(e,Re);if(t.length>0)throw new Error(`finding verifier structured result is invalid: ${t.join("; ")}`);return e}i(On,"rawVerification");function be(e,t){if(e===null||e.status!=="completed")throw new Error(`${t} did not complete; no verdict was accepted`);if(e.verification!==void 0&&!e.verification.ok)throw new Error(`${t} did not read every required packet path; no verdict was accepted`);return e}i(be,"resultOrThrow");function qn(e,t,n){return["Review one immutable KodaX packet as an independent third-party reviewer.",`Packet manifest: ${e.packetPath}`,...e.evidenceChunks.map(r=>`Evidence chunk: ${r.path}`),`This packet has binding requirements: ${e.requirementsPresent?"yes":"no"}.`,t?"This is the additional high-risk primary. Actively seek a disagreement with the first reader; do not assume it was correct.":"Own both specification and implementation-quality verdicts for this scope.",n.lean?"Also identify unnecessary additions, but never remove validation, security, data-loss protection, accessibility, or requested behavior.":"",n.reviewFocus?`Additional user focus: ${n.reviewFocus}`:"","Read the manifest and every listed chunk with the read tool before deciding.","Begin with the required JSON result. No preamble or process narration.","The findings array contains only actionable defects, never approval evidence or positive observations.","When the scope is compliant and approved with no actionable defect, findings must be empty.","If a named requirement cannot be proven compliant or violated from surfaced evidence, use specVerdict not-verifiable, list it in unverifiedRequirements, and emit no finding for that uncertainty; absence of evidence is not proof of a defect.","If requirements are absent, specVerdict must be not-verifiable."].filter(Boolean).join(`
14
14
  `)}i(qn,"buildScopedReviewPrimaryPrompt");function Cn(e,t){return["Independently attempt to refute every candidate finding in this batch.",`Packet manifest: ${e.packetPath}`,...e.evidenceChunks.map(n=>`Evidence chunk: ${n.path}`),`Canonical candidates: ${JSON.stringify(t.findings)}`,"Read the packet evidence. You may run one focused check after naming the concrete doubt.","Return every findingId exactly once. A severity change requires severityReason.","Begin with the required JSON result; no preamble."].join(`
15
15
  `)}i(Cn,"buildScopedReviewVerificationPrompt");function $n(e){return["Synthesize the structured review results below without rereading packet bodies.","Lead with confirmed findings, keep unresolved findings visibly unresolved, omit refuted findings from the actionable list, and never silently downgrade severity.","Cite locations and state explicitly when no actionable issue was confirmed.",JSON.stringify(e)].join(`
16
- `)}i($n,"buildScopedReviewFinalPrompt");async function wt(e,t,n,r){let a=be(await e.runAgent({name:`${n?"high-risk-":""}primary-${t.partitionKey}`,phase:"primary-review",prompt:qn(t,n,r),scopeSummary:`${t.partitionKey}: ${t.scopePaths.join(", ")}`,constraints:["read every required packet path","return both verdicts","cite evidence at each finding"],readOnly:!0,modelHint:n?"deep":"balanced",verification:{enforcement:"hard",requiredReadPaths:gt(t)},outputSchema:Se,terseResult:!0}),"primary reviewer");return e.log({message:`primary read accepted for ${t.partitionKey}`,data:{kind:"review_packet_read",role:"primary",contentHash:t.contentHash}}),Fn(a.structured)}i(wt,"runPrimary");async function _n(e,t,n){if(n.findings.length===0)return{specVerdict:n.specVerdict,qualityVerdict:n.qualityVerdict,unverifiedRequirements:n.unverifiedRequirements,actionable:[],audit:{findings:[]},unqualifiedApprovalAllowed:n.unverifiedRequirements.length===0&&n.specVerdict==="compliant"&&n.qualityVerdict==="approved"};let r=be(await e.runAgent({name:`verify-${t.partitionKey}`,phase:"verifier",prompt:Cn(t,n),scopeSummary:`verify ${n.findings.length} candidate finding(s) in ${t.partitionKey}`,constraints:["fresh context","attempt refutation","one disposition per findingId"],readOnly:!0,modelHint:"deep",verification:{enforcement:"hard",requiredReadPaths:gt(t)},outputSchema:Re,terseResult:!0}),"finding verifier");return e.log({message:`verification read accepted for ${t.partitionKey}`,data:{kind:"review_packet_read",role:"verification",contentHash:t.contentHash,reason:"candidate findings"}}),pt(n,On(r.structured))}i(_n,"verifyFindings");async function Nn(e,t,n){let r=[await wt(e,t,!1,n)];t.riskFlags.includes("routing-high")&&r.push(await wt(e,t,!0,n));let a=r.map(d=>ft(t.contentHash,t.requirementsPresent,d)),o=mt(a),s=await _n(e,t,o);return e.log({message:`quality gate completed for ${t.partitionKey}`,data:{kind:"review_quality_gate",contentHash:t.contentHash,actionableFindings:s.actionable.length,unresolvedFindings:s.actionable.filter(d=>d.disposition==="unresolved").length,unqualifiedApprovalAllowed:s.unqualifiedApprovalAllowed}}),{contentHash:t.contentHash,result:s}}i(Nn,"reviewPacket");async function Dn(e,t){if(!Array.isArray(t.packets)||t.packets.length===0)throw new Error("scoped-review requires at least one review packet");let n=await e.parallel(t.packets.map(d=>()=>Nn(e,d,t)),{concurrency:4});if(n.some(d=>d===null))throw new Error("one or more scope packets failed review; no final verdict was accepted");let r=n.filter(d=>d!==null);await e.artifact("scoped-review-audit",r);let a=be(await e.runAgent({name:"final-review-synthesis",phase:"final-synthesis",prompt:$n(r),scopeSummary:`cross-scope synthesis for ${r.length} packet(s)`,constraints:["preserve severity","preserve unresolved uncertainty","do not invent evidence"],readOnly:!0,modelHint:"deep",outputSchema:Wn,terseResult:!0}),"final synthesis"),o=a.structured;return{summary:typeof o?.summary=="string"?o.summary:a.finalText,packetResults:r}}i(Dn,"runScopedReview");var ht={meta:{name:"scoped-review",description:"Review immutable scope packets once, verify only candidate findings, then synthesize.",readOnly:!0,phases:["primary-review","verifier","final-synthesis"],maxAgents:64,maxConcurrency:4},run:Dn};function yt(e){return{meta:e.meta,run:i((t,n)=>e.run(t,n),"run")}}i(yt,"erase");var kt=[yt(dt),yt(ht)];function vt(e){return kt.find(t=>t.meta.name===e)}i(vt,"getBuiltinWorkflow");function no(){return kt.map(e=>e.meta)}i(no,"listBuiltinWorkflows");import{mkdir as Tt,readdir as jn,readFile as Q,rename as Un,unlink as Pe,writeFile as Me}from"node:fs/promises";import{basename as Vn,dirname as Ie,join as K}from"node:path";import{pathToFileURL as Bn}from"node:url";var It=[".workflow.json",".ts",".mjs",".js"],ee="0.7.49";function Pt(){return"0.7.86"}i(Pt,"currentKodaxWorkflowVersion");function Hn(e){return e.endsWith(".workflow.json")?"capability-generated":"trusted-local"}i(Hn,"executionForPath");function Kn(e){let t=It.find(n=>e.endsWith(n));return t?e.slice(0,-t.length):void 0}i(Kn,"stripWorkflowSuffix");function Ae(e){let t=e.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").slice(0,80);if(!t||t==="."||t==="..")throw new Error("workflow name must contain at least one safe filename character");return t}i(Ae,"safeWorkflowName");function Ee(e){return typeof e=="object"&&e!==null}i(Ee,"isRecord");function xt(e,t){let n=e[t];if(typeof n!="string"||n.length===0)throw new Error(`workflow run.json missing ${t}`);return n}i(xt,"readRequiredString");async function St(e,t){if(!e)return[];let n;try{n=await jn(e)}catch{return[]}let r=new Map;for(let a of It)for(let o of n){if(!o.endsWith(a))continue;let s=Kn(o);if(!s||s.length===0||r.has(s))continue;let d=K(e,o);r.set(s,{name:s,path:d,source:t,execution:Hn(d)})}return[...r.values()]}i(St,"scanDir");async function te(e){let t=await St(e.personal,"personal"),n=await St(e.project,"project"),r=new Map;for(let a of t)r.set(a.name,a);for(let a of n)r.set(a.name,a);return[...r.values()].sort((a,o)=>a.name.localeCompare(o.name))}i(te,"discoverSavedWorkflows");function Ln(e){return typeof e=="object"&&e!==null&&"meta"in e&&"run"in e&&typeof e.run=="function"}i(Ln,"isWorkflowModule");function zn(e){let t=e.default;if(Ln(t))return t;let n=typeof t=="function"?t:e.run,r=e.workflow??e.meta;if(typeof n=="function"&&typeof r=="object"&&r!==null&&"name"in r)return{meta:r,run:n};throw new Error("invalid workflow module: expected a `{ meta, run }` default export, or `export const workflow = {...}` + a default run function")}i(zn,"normalizeWorkflowModule");function Jn(e){let t=JSON.parse(e);if(!Ee(t))throw new Error("generated workflow file must be an object");if(t.format!==void 0&&t.format!=="kodax.workflow")throw new Error(`unsupported workflow capsule format: ${String(t.format)}`);if(t.format==="kodax.workflow"){let a=pe(t);return{manifest:a.manifest,source:a.source,capsule:a,legacy:!1}}let n=t.source;if(typeof n!="string"||n.trim().length===0)throw new Error("generated workflow file source must be a non-empty string");let r=Z(t.manifest);return{manifest:r,source:n,capsule:B({minKodaxVersion:ee,manifest:r,source:n}),legacy:!0}}i(Jn,"parseGeneratedWorkflowFile");async function We(e){let t=Jn(await Q(e,"utf8"));return t.capsule??B({minKodaxVersion:ee,manifest:t.manifest,source:t.source})}i(We,"loadSavedWorkflowCapsule");async function Mt(e){if(e.endsWith(".workflow.json"))return we(await We(e));let t=await import(Bn(e).href);return zn(t)}i(Mt,"loadSavedWorkflow");function Fe(e){if(e.mayUseWorktree===!0)return{environment:["git-repo","worktree-capable"]}}i(Fe,"deriveRequirements");function ce(e,t){me(t,{filename:`${e.name}.workflow.js`,requireAsyncRun:!0})}i(ce,"assertGeneratedCapsuleSource");async function Gn(e){let t=Ae(e.name),n=Z(e.manifest);ce(n,e.source);let r=e.requires??Fe(n),a=B({minKodaxVersion:e.minKodaxVersion??ee,manifest:n,source:e.source,...e.intent!==void 0?{intent:e.intent}:{},...e.inputs!==void 0?{inputs:e.inputs}:{},...r!==void 0?{requires:r}:{},...e.provenance!==void 0?{provenance:e.provenance}:{}});await Tt(e.dir,{recursive:!0});let o=K(e.dir,`${t}.workflow.json`);return await Me(o,`${JSON.stringify(a,null,2)}
16
+ `)}i($n,"buildScopedReviewFinalPrompt");async function wt(e,t,n,r){let a=be(await e.runAgent({name:`${n?"high-risk-":""}primary-${t.partitionKey}`,phase:"primary-review",prompt:qn(t,n,r),scopeSummary:`${t.partitionKey}: ${t.scopePaths.join(", ")}`,constraints:["read every required packet path","return both verdicts","cite evidence at each finding"],readOnly:!0,modelHint:n?"deep":"balanced",verification:{enforcement:"hard",requiredReadPaths:gt(t)},outputSchema:Se,terseResult:!0}),"primary reviewer");return e.log({message:`primary read accepted for ${t.partitionKey}`,data:{kind:"review_packet_read",role:"primary",contentHash:t.contentHash}}),Fn(a.structured)}i(wt,"runPrimary");async function _n(e,t,n){if(n.findings.length===0)return{specVerdict:n.specVerdict,qualityVerdict:n.qualityVerdict,unverifiedRequirements:n.unverifiedRequirements,actionable:[],audit:{findings:[]},unqualifiedApprovalAllowed:n.unverifiedRequirements.length===0&&n.specVerdict==="compliant"&&n.qualityVerdict==="approved"};let r=be(await e.runAgent({name:`verify-${t.partitionKey}`,phase:"verifier",prompt:Cn(t,n),scopeSummary:`verify ${n.findings.length} candidate finding(s) in ${t.partitionKey}`,constraints:["fresh context","attempt refutation","one disposition per findingId"],readOnly:!0,modelHint:"deep",verification:{enforcement:"hard",requiredReadPaths:gt(t)},outputSchema:Re,terseResult:!0}),"finding verifier");return e.log({message:`verification read accepted for ${t.partitionKey}`,data:{kind:"review_packet_read",role:"verification",contentHash:t.contentHash,reason:"candidate findings"}}),pt(n,On(r.structured))}i(_n,"verifyFindings");async function Nn(e,t,n){let r=[await wt(e,t,!1,n)];t.riskFlags.includes("routing-high")&&r.push(await wt(e,t,!0,n));let a=r.map(d=>ft(t.contentHash,t.requirementsPresent,d)),o=mt(a),s=await _n(e,t,o);return e.log({message:`quality gate completed for ${t.partitionKey}`,data:{kind:"review_quality_gate",contentHash:t.contentHash,actionableFindings:s.actionable.length,unresolvedFindings:s.actionable.filter(d=>d.disposition==="unresolved").length,unqualifiedApprovalAllowed:s.unqualifiedApprovalAllowed}}),{contentHash:t.contentHash,result:s}}i(Nn,"reviewPacket");async function Dn(e,t){if(!Array.isArray(t.packets)||t.packets.length===0)throw new Error("scoped-review requires at least one review packet");let n=await e.parallel(t.packets.map(d=>()=>Nn(e,d,t)),{concurrency:4});if(n.some(d=>d===null))throw new Error("one or more scope packets failed review; no final verdict was accepted");let r=n.filter(d=>d!==null);await e.artifact("scoped-review-audit",r);let a=be(await e.runAgent({name:"final-review-synthesis",phase:"final-synthesis",prompt:$n(r),scopeSummary:`cross-scope synthesis for ${r.length} packet(s)`,constraints:["preserve severity","preserve unresolved uncertainty","do not invent evidence"],readOnly:!0,modelHint:"deep",outputSchema:Wn,terseResult:!0}),"final synthesis"),o=a.structured;return{summary:typeof o?.summary=="string"?o.summary:a.finalText,packetResults:r}}i(Dn,"runScopedReview");var ht={meta:{name:"scoped-review",description:"Review immutable scope packets once, verify only candidate findings, then synthesize.",readOnly:!0,phases:["primary-review","verifier","final-synthesis"],maxAgents:64,maxConcurrency:4},run:Dn};function yt(e){return{meta:e.meta,run:i((t,n)=>e.run(t,n),"run")}}i(yt,"erase");var kt=[yt(dt),yt(ht)];function vt(e){return kt.find(t=>t.meta.name===e)}i(vt,"getBuiltinWorkflow");function no(){return kt.map(e=>e.meta)}i(no,"listBuiltinWorkflows");import{mkdir as Tt,readdir as jn,readFile as Q,rename as Un,unlink as Pe,writeFile as Me}from"node:fs/promises";import{basename as Vn,dirname as Ie,join as K}from"node:path";import{pathToFileURL as Bn}from"node:url";var It=[".workflow.json",".ts",".mjs",".js"],ee="0.7.49";function Pt(){return"0.7.87"}i(Pt,"currentKodaxWorkflowVersion");function Hn(e){return e.endsWith(".workflow.json")?"capability-generated":"trusted-local"}i(Hn,"executionForPath");function Kn(e){let t=It.find(n=>e.endsWith(n));return t?e.slice(0,-t.length):void 0}i(Kn,"stripWorkflowSuffix");function Ae(e){let t=e.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").slice(0,80);if(!t||t==="."||t==="..")throw new Error("workflow name must contain at least one safe filename character");return t}i(Ae,"safeWorkflowName");function Ee(e){return typeof e=="object"&&e!==null}i(Ee,"isRecord");function xt(e,t){let n=e[t];if(typeof n!="string"||n.length===0)throw new Error(`workflow run.json missing ${t}`);return n}i(xt,"readRequiredString");async function St(e,t){if(!e)return[];let n;try{n=await jn(e)}catch{return[]}let r=new Map;for(let a of It)for(let o of n){if(!o.endsWith(a))continue;let s=Kn(o);if(!s||s.length===0||r.has(s))continue;let d=K(e,o);r.set(s,{name:s,path:d,source:t,execution:Hn(d)})}return[...r.values()]}i(St,"scanDir");async function te(e){let t=await St(e.personal,"personal"),n=await St(e.project,"project"),r=new Map;for(let a of t)r.set(a.name,a);for(let a of n)r.set(a.name,a);return[...r.values()].sort((a,o)=>a.name.localeCompare(o.name))}i(te,"discoverSavedWorkflows");function Ln(e){return typeof e=="object"&&e!==null&&"meta"in e&&"run"in e&&typeof e.run=="function"}i(Ln,"isWorkflowModule");function zn(e){let t=e.default;if(Ln(t))return t;let n=typeof t=="function"?t:e.run,r=e.workflow??e.meta;if(typeof n=="function"&&typeof r=="object"&&r!==null&&"name"in r)return{meta:r,run:n};throw new Error("invalid workflow module: expected a `{ meta, run }` default export, or `export const workflow = {...}` + a default run function")}i(zn,"normalizeWorkflowModule");function Jn(e){let t=JSON.parse(e);if(!Ee(t))throw new Error("generated workflow file must be an object");if(t.format!==void 0&&t.format!=="kodax.workflow")throw new Error(`unsupported workflow capsule format: ${String(t.format)}`);if(t.format==="kodax.workflow"){let a=pe(t);return{manifest:a.manifest,source:a.source,capsule:a,legacy:!1}}let n=t.source;if(typeof n!="string"||n.trim().length===0)throw new Error("generated workflow file source must be a non-empty string");let r=Z(t.manifest);return{manifest:r,source:n,capsule:B({minKodaxVersion:ee,manifest:r,source:n}),legacy:!0}}i(Jn,"parseGeneratedWorkflowFile");async function We(e){let t=Jn(await Q(e,"utf8"));return t.capsule??B({minKodaxVersion:ee,manifest:t.manifest,source:t.source})}i(We,"loadSavedWorkflowCapsule");async function Mt(e){if(e.endsWith(".workflow.json"))return we(await We(e));let t=await import(Bn(e).href);return zn(t)}i(Mt,"loadSavedWorkflow");function Fe(e){if(e.mayUseWorktree===!0)return{environment:["git-repo","worktree-capable"]}}i(Fe,"deriveRequirements");function ce(e,t){me(t,{filename:`${e.name}.workflow.js`,requireAsyncRun:!0})}i(ce,"assertGeneratedCapsuleSource");async function Gn(e){let t=Ae(e.name),n=Z(e.manifest);ce(n,e.source);let r=e.requires??Fe(n),a=B({minKodaxVersion:e.minKodaxVersion??ee,manifest:n,source:e.source,...e.intent!==void 0?{intent:e.intent}:{},...e.inputs!==void 0?{inputs:e.inputs}:{},...r!==void 0?{requires:r}:{},...e.provenance!==void 0?{provenance:e.provenance}:{}});await Tt(e.dir,{recursive:!0});let o=K(e.dir,`${t}.workflow.json`);return await Me(o,`${JSON.stringify(a,null,2)}
17
17
  `,"utf8"),{name:t,path:o,source:"project",execution:"capability-generated"}}i(Gn,"saveGeneratedWorkflow");async function Rt(e,t){await Me(e,`${JSON.stringify(t,null,2)}
18
18
  `,"utf8")}i(Rt,"writeCapsuleFile");async function Xn(e){try{return await Q(e,"utf8"),!0}catch{return!1}}i(Xn,"fileExists");async function uo(e){let t=(await te(e.dirs)).filter(d=>d.name===e.name).filter(d=>e.source===void 0||d.source===e.source);if(t.length===0)throw new Error(`saved workflow not found: ${e.name}`);if(t.length>1)throw new Error(`ambiguous saved workflow name: ${e.name}`);let n=t[0];if(!n.path.endsWith(".workflow.json"))throw new Error("only generated workflow capsules can be renamed");let r=Ae(e.newName),a=K(Ie(n.path),`${r}.workflow.json`);if(a!==n.path&&await Xn(a))throw new Error(`saved workflow already exists: ${r}`);let o=await We(n.path);ce(o.manifest,o.source);let s=B({minKodaxVersion:o.minKodaxVersion,manifest:{...o.manifest,name:r},source:o.source,...o.intent!==void 0?{intent:o.intent}:{},...o.inputs!==void 0?{inputs:o.inputs}:{},...o.requires!==void 0?{requires:o.requires}:{},...o.provenance!==void 0?{provenance:o.provenance}:{}});return await Me(a,`${JSON.stringify(s,null,2)}
19
19
  `,"utf8"),a!==n.path&&await Pe(n.path),{name:r,path:a,source:n.source,execution:"capability-generated"}}i(uo,"renameSavedWorkflow");async function lo(e){let t=(await te(e.dirs)).filter(r=>r.name===e.name).filter(r=>e.source===void 0||r.source===e.source);if(t.length===0)throw new Error(`saved workflow not found: ${e.name}`);if(t.length>1)throw new Error(`ambiguous saved workflow name: ${e.name}`);let n=t[0];if(!n.path.endsWith(".workflow.json"))throw new Error("only generated workflow capsules can be deleted");return await Pe(n.path),n}i(lo,"deleteSavedWorkflow");async function fo(e){let t=Ae(e.name),n=(await te(e.dirs)).filter(v=>v.name===t).filter(v=>e.savedSource===void 0||v.source===e.savedSource);if(n.length===0)throw new Error(`saved workflow not found: ${t}`);if(n.length>1)throw new Error(`ambiguous saved workflow name: ${t}`);let r=n[0];if(!r.path.endsWith(".workflow.json"))throw new Error("only generated workflow capsules can be replaced");let a=Z({...e.manifest,name:t});ce(a,e.source);let o=e.requires??Fe(a),s=B({minKodaxVersion:e.minKodaxVersion??ee,manifest:a,source:e.source,...e.intent!==void 0?{intent:e.intent}:{},...e.inputs!==void 0?{inputs:e.inputs}:{},...o!==void 0?{requires:o}:{},...e.provenance!==void 0?{provenance:e.provenance}:{}}),d=await We(r.path),g=new Date().toISOString().replace(/[:.]/g,"-"),h=K(Ie(r.path),".revisions",t),y=`${g}-${process.hrtime.bigint().toString(36)}`,p=K(h,`${t}-${y}.workflow.json`),b=K(Ie(r.path),`.${t}.${process.pid}.${Date.now().toString(36)}.tmp`);await Tt(h,{recursive:!0}),await Rt(p,d);try{await Rt(b,s),await Un(b,r.path)}catch(v){try{await Pe(b)}catch{}throw v}return{name:t,path:r.path,source:r.source,execution:"capability-generated",previousPath:p}}i(fo,"replaceSavedWorkflow");function Yn(e){if(!Ee(e))return;let t=e.request;if(typeof t=="string"&&t.trim().length>0)return t;let n=e.question;if(typeof n=="string"&&n.trim().length>0)return n}i(Yn,"readOptionalOriginalRequest");function At(e){return Zn(e)}i(At,"buildCapsuleFromRun");async function Zn(e){let t=JSON.parse(await Q(K(e.runDir,"run.json"),"utf8"));if(!Ee(t))throw new Error("workflow run.json must be an object");let n=xt(t,"scriptSnapshotPath"),r=xt(t,"manifestSnapshotPath"),a=await Q(n,"utf8"),o=Z(JSON.parse(await Q(r,"utf8")));ce(o,a);let s=typeof t.runId=="string"&&t.runId.length>0?t.runId:Vn(e.runDir),d=Yn(t.args),g=Fe(o),h=Ue(o,d!==void 0?{originalRequest:d}:{}),y={description:"Provide new workflow args matching the generated request shape.",..."args"in t?{examples:[t.args]}:{}};return B({minKodaxVersion:ee,manifest:o,source:a,intent:h,inputs:y,...g!==void 0?{requires:g}:{},provenance:{fromRunId:s,createdAt:new Date().toISOString(),kodaxVersion:Pt()}})}i(Zn,"readCapsuleFromRun");async function mo(e){let t=await At(e);return{capsule:t,module:we(t)}}i(mo,"loadGeneratedWorkflowFromRun");async function po(e){let t=await At(e);return Gn({dir:e.targetDir,name:e.name,manifest:t.manifest,source:t.source,...t.intent!==void 0?{intent:t.intent}:{},...t.inputs!==void 0?{inputs:t.inputs}:{},...t.requires!==void 0?{requires:t.requires}:{},...t.provenance!==void 0?{provenance:t.provenance}:{},minKodaxVersion:t.minKodaxVersion})}i(po,"saveGeneratedWorkflowFromRun");function U(e,t,n,r){e.push({severity:t,requirement:n,message:r})}i(U,"addRequirementIssue");function bt(e){let t=/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e.trim());if(t)return[Number(t[1]),Number(t[2]),Number(t[3])]}i(bt,"parseSemver");function Qn(e,t){for(let n=0;n<3;n+=1){let r=e[n]-t[n];if(r!==0)return r}return 0}i(Qn,"compareSemver");function er(e,t,n){let r=bt(t),a=bt(n);if(!r){U(e,"error","kodax:min-version",`workflow minKodaxVersion is not valid semver: ${t}`);return}if(!a){U(e,"warning","kodax:min-version",`cannot verify workflow minKodaxVersion ${t}; current version is unknown`);return}Qn(a,r)<0&&U(e,"error","kodax:min-version",`workflow requires KodaX >= ${t}, current version is ${n}`)}i(er,"addMinVersionIssue");function Te(e,t,n,r){if(!n)return;if(!r){for(let o of n)U(e,"warning",`${t}:${o}`,`workflow requires ${t}:${o}, but no ${t} inventory was provided`);return}let a=new Set(r);for(let o of n)a.has(o)||U(e,"error",`${t}:${o}`,`missing required workflow ${t}: ${o}`)}i(Te,"addMissingItems");function wo(e,t={}){let n=pe(e),r=[],a=n.requires;er(r,n.minKodaxVersion,t.kodaxVersion??Pt()),a?.environment?.includes("git-repo")&&t.isGitRepo===!1&&U(r,"error","environment:git-repo","workflow requires a git repository"),a?.environment?.includes("worktree-capable")&&t.worktreeCapable===!1&&U(r,"error","environment:worktree-capable","workflow may request git worktree isolation");try{me(n.source,{filename:`${n.manifest.name}.workflow.js`,requireAsyncRun:!0})}catch(o){let s=o instanceof Error?o.message:String(o);U(r,"error","workflow:source",s)}return Te(r,"tools",a?.tools,t.availableTools),Te(r,"mcp",a?.mcp,t.availableMcp),Te(r,"skills",a?.skills,t.availableSkills),{ok:!r.some(o=>o.severity==="error"),issues:r}}i(wo,"preflightWorkflowCapsule");function nr(e){return{project:Et(e,".kodax","workflows"),personal:Et(tr(),".kodax","workflows")}}i(nr,"defaultSavedWorkflowDirs");async function rr(e,t){let r=(await te(t)).find(a=>a.name===e);if(r)return Mt(r.path)}i(rr,"resolveSavedByName");function Wt(e){let t=nr(e);return async n=>vt(n)??await rr(n,t)}i(Wt,"createNestedWorkflowResolver");import{existsSync as or,mkdirSync as ir,readFileSync as ar,writeFileSync as Ft}from"node:fs";import{join as ne}from"node:path";var Ot="results";function qt(e){return e.replace(/[^a-zA-Z0-9._-]/g,"_")}i(qt,"safeKey");function Ct(e,t){let n=ne(e,t);if(or(n))try{return JSON.parse(ar(n,"utf8"))}catch{return}}i(Ct,"readResult");function $t(e,t={}){let n=ne(e,Ot);ir(n,{recursive:!0});let r=t.readFrom?ne(t.readFrom,Ot):void 0;return{get:i(a=>{let o=`${qt(a)}.json`,s=Ct(n,o);if(s!==void 0)return s;if(r===void 0)return;let d=Ct(r,o);if(d!==void 0){try{Ft(ne(n,o),JSON.stringify(d),"utf8")}catch{}return d}},"get"),set:i((a,o)=>{try{Ft(ne(n,`${qt(a)}.json`),JSON.stringify(o),"utf8")}catch{}},"set")}}i($t,"createFsResultCache");import{mkdirSync as sr,appendFileSync as cr,writeFileSync as ue}from"node:fs";import{join as J}from"node:path";function de(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}i(de,"record");function F(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:0}i(F,"finiteNumber");function _t(e){let t=new Map,n=new Set,r=[],a=[],o=new Set,s=[],d=[],g=0,h=0,y=0,p=0,b=0,v=0,W=0,m=0,T={},$=[];for(let C of e){let M=C.data??{};if(C.type==="agent_spawned"){let u=typeof M.taskId=="string"?M.taskId:void 0;u&&t.set(u,M),M.role==="primary-review"&&(v+=1);let w=typeof M.role=="string"?M.role:"agent",S=typeof M.requestedTier=="string"?M.requestedTier:"inherited",I=`${w}/${S}`;T[I]=(T[I]??0)+1;continue}if(C.type==="agent_completed"||C.type==="agent_unverified"||C.type==="agent_failed"){let u=typeof M.taskId=="string"?M.taskId:void 0;if(!u||n.has(u))continue;n.add(u);let w=de(M.usage);!w||typeof w.totalTokens!="number"?typeof t.get(u)?.externalTarget=="string"?a.push(u):r.push(u):(g+=F(w.totalTokens),h+=F(w.inputTokens),y+=F(w.cacheReadTokens??w.cachedReadTokens),p+=F(w.outputTokens));let S=de(M.digestUsage);b+=F(S?.totalTokens),h+=F(S?.inputTokens),p+=F(S?.outputTokens),y+=F(S?.cacheReadTokens??S?.cachedReadTokens),W+=F(M.iterations);continue}if(C.type==="agent_summary_updated"){let u=de(M.usage),w=M.summaryKind;if((w==="digest"||w==="digest-failed")&&u){let S=F(u.totalTokens);g+=S,b+=S,h+=F(u.inputTokens),p+=F(u.outputTokens),y+=F(u.cacheReadTokens??u.cachedReadTokens)}continue}if(C.type!=="workflow_log")continue;let f=de(M.data);if(f?.kind==="review_quality_gate"&&typeof f.contentHash=="string"){$.push({contentHash:f.contentHash,actionableFindings:F(f.actionableFindings),unresolvedFindings:F(f.unresolvedFindings),unqualifiedApprovalAllowed:f.unqualifiedApprovalAllowed===!0});continue}if(f?.kind!=="review_packet_read"||typeof f.contentHash!="string")continue;let l={contentHash:f.contentHash,...typeof f.reason=="string"?{reason:f.reason}:{}};f.role==="primary"?(o.has(f.contentHash)&&(m+=1),o.add(f.contentHash)):f.role==="verification"?s.push(l):f.role==="synthesis"&&d.push(l)}for(let C of t.keys())n.has(C)||r.push(C);let G=[...new Set(r)].sort();return{totalModelTokens:g,inputTokens:h,cacheReadTokens:y,outputTokens:p,digestTokens:b,agentStarts:t.size,childTurns:W,agentStartsByRoleTier:T,primaryReviewStarts:v,duplicatePrimaryPacketReads:m,verificationPacketReads:s,synthesisPacketReads:d,reviewWaves:v>0?1:0,fixWaves:0,rereviewWaves:0,qualityGateOutcomes:$,tokenCoverage:{ok:G.length===0,missingTaskIds:G},excludedExternalTaskIds:[...new Set(a)].sort()}}i(_t,"buildWorkflowCostReport");function dr(e){let t=e.replace(/[^a-zA-Z0-9._-]/g,"_").slice(0,120);return t.length>0?t:"artifact"}i(dr,"safeWorkflowArtifactName");function Nt(e,t={}){let n=t.now??(()=>Date.now()),r=J(e,"artifacts");sr(r,{recursive:!0});let a=J(e,"events.jsonl");return{runDir:e,onEvent:i(o=>{cr(a,`${JSON.stringify({...o,ts:n()})}
@@ -0,0 +1,2 @@
1
+ // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
+ import{a}from"./chunk-U44C5STU.js";import"./chunk-ITP7J5HX.js";import"./chunk-XH7UM4GO.js";import"./chunk-ONUPGMER.js";export{a as loadCompactionConfig};
@@ -1,5 +1,5 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import"./chunk-XA4ENCAH.js";import"./chunk-Q6UAGROD.js";import"./chunk-UKCDCVMD.js";import"./chunk-HTVLCHWH.js";import"./chunk-XUKLF26Q.js";import{Ic as a,Nc as i,Uc as l,Zc as c}from"./chunk-U6HNMLNN.js";import"./chunk-GVGLYVG4.js";import"./chunk-TRNAWSXP.js";import"./chunk-G5FGIRDJ.js";import"./chunk-UH5WNJXF.js";import{a as n}from"./chunk-ONUPGMER.js";var r=null;function y(e){r=e}n(y,"bindAskUserForConstruction");function p(e){return e.content?.capabilities?.tools??[]}n(p,"readDeclaredTools");var m=n(async e=>{if(!r)return"reject";let t=p(e),o=t.length>0?t.join(", "):"<none>";return await r({question:`Activate constructed tool ${e.name}@${e.version}?
2
+ import"./chunk-BCYJIACJ.js";import"./chunk-3PGNESV3.js";import"./chunk-XKLVC7F6.js";import"./chunk-JS4RSF4B.js";import"./chunk-ZQNOEKOB.js";import{Ic as a,Nc as i,Uc as l,Zc as c}from"./chunk-DB4O33RR.js";import"./chunk-GRJ7NKWP.js";import"./chunk-SKELDH3G.js";import"./chunk-ITP7J5HX.js";import"./chunk-XH7UM4GO.js";import{a as n}from"./chunk-ONUPGMER.js";var r=null;function y(e){r=e}n(y,"bindAskUserForConstruction");function p(e){return e.content?.capabilities?.tools??[]}n(p,"readDeclaredTools");var m=n(async e=>{if(!r)return"reject";let t=p(e),o=t.length>0?t.join(", "):"<none>";return await r({question:`Activate constructed tool ${e.name}@${e.version}?
3
3
  It declares capabilities.tools = [${o}].`,allowCustomInput:!1,options:[{label:"Approve \u2014 register and make callable",description:"The tool will be added to the active tool registry and the LLM can invoke it on the next turn.",value:"approve"},{label:"Reject \u2014 do not register",description:"The artifact stays staged on disk; rerun activate_tool to retry.",value:"reject"}]})==="approve"?"approve":"reject"},"replConstructionPolicy"),v=n(async e=>{if(!r)return"reject";let t=e.llmSummary.flaggedConcerns.length>0?e.llmSummary.flaggedConcerns.map(u=>` \u2022 ${u}`).join(`
4
4
  `):" \u2022 <none>",o=e.prevContent.instructions??"<no instructions>",s=e.nextContent.instructions??"<no instructions>",d=[`Self-modify activation: ${e.agentName}@${e.fromVersion} \u2192 ${e.toVersion}`,"",`LLM diff summary (severity=${e.llmSummary.severity}):`,` ${e.llmSummary.summary}`,"","Flagged concerns:",t,"",`Budget remaining (after approve): ${e.budgetRemaining-1}/${e.budgetLimit}`,"","\u2500\u2500 Previous instructions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",o,"\u2500\u2500 Proposed instructions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",s,"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","","The LLM summary is advisory \u2014 read the proposed instructions above before approving."].join(`
5
5
  `);return await r({question:d,allowCustomInput:!1,options:[{label:"Approve \u2014 activate the new version on the next run",description:"Resolver swap is deferred to the next Runner.run boundary so the in-flight conversation keeps the prior reference.",value:"approve"},{label:"Reject \u2014 stay on the previous version",description:"Budget is not consumed on rejection; the staged version is left on disk for diff inspection.",value:"reject"}]})==="approve"?"approve":"reject"},"replSelfModifyAskUser");async function h(e){a({cwd:e,policy:m,selfModifyAskUser:v});let t=await i();await c();let o=await l({cwd:e});return{loaded:t.loaded,failed:t.failed,tampered:t.tampered,markdownLoaded:o.loaded,markdownFailures:o.failed}}n(h,"bootstrapConstructionRuntime");export{y as bindAskUserForConstruction,h as bootstrapConstructionRuntime};
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{$ as Lj,A as kj,B as lj,C as mj,D as nj,E as oj,F as pj,G as qj,H as rj,I as sj,J as tj,K as uj,L as vj,M as wj,N as xj,O as yj,P as zj,Q as Aj,R as Bj,S as Cj,T as Dj,U as Ej,V as Fj,W as Gj,X as Hj,Y as Ij,Z as Jj,_ as Kj,a as ec,aa as Mj,b as fc,ba as Nj,c as gc,ca as Oj,d as Pi,da as Pj,e as Qi,ea as Qj,f as Ri,fa as Rj,g as Si,ga as Sj,h as Ti,ha as Tj,i as Ui,ia as Uj,j as Vi,ja as Vj,k as Wi,ka as Wj,l as Xi,la as Xj,m as Yi,n as Zi,o as _i,p as $i,q as aj,r as bj,s as cj,t as dj,u as ej,v as fj,w as gj,x as hj,y as ij,z as jj}from"./chunk-XA4ENCAH.js";import{$ as bg,$b as qi,A as Lf,Ab as Rh,B as Mf,Bb as Sh,C as Nf,Cb as Th,D as Of,Db as Uh,Eb as Vh,Fb as Wh,Gb as Xh,Hb as Yh,I as Pf,Ib as Zh,J as Qf,Jb as _h,Kb as $h,Lb as ai,Mb as bi,N as Rf,Nb as ci,O as Sf,Ob as di,P as Tf,Pb as ei,Q as Uf,Qb as fi,R as Vf,Rb as gi,S as Wf,Sb as hi,T as Xf,Tb as ii,U as Yf,Ua as qh,Ub as ji,Va as rh,Vb as ki,Wb as li,X as Zf,Xb as mi,Y as _f,Yb as ni,Z as $f,Zb as oi,_ as ag,_b as pi,aa as cg,ac as ri,b as Hb,ba as dg,bb as sh,bc as si,c as Ib,cb as th,cc as ti,d as Jb,db as uh,dc as ui,e as Kb,eb as vh,ec as vi,f as Lb,fb as wh,fc as wi,g as Mb,ga as eg,gb as xh,gc as xi,ha as fg,hb as yh,hc as yi,i as Nb,ia as gg,ib as zh,ic as zi,j as Ob,ja as hg,jb as Ah,jc as Ai,ka as ig,kb as Bh,kc as Bi,l as Pb,lb as Ch,lc as Ci,m as Qb,mb as Dh,mc as Di,n as Rb,nb as Eh,nc as Ei,o as $b,oa as jg,ob as Fh,oc as Fi,p as hc,pa as kg,pb as Gh,pc as Gi,q as ic,qa as lg,qb as Hh,qc as Hi,r as zf,ra as mg,rb as Ih,rc as Ii,s as Af,sb as Jh,sc as Ji,t as Bf,tb as Kh,tc as Ki,u as Cf,ua as ng,ub as Lh,uc as Li,v as Df,vb as Mh,vc as Mi,w as Ef,wb as Nh,wc as Ni,x as If,xb as Oh,y as Jf,yb as Ph,yc as Oi,z as Kf,zb as Qh}from"./chunk-Q6UAGROD.js";import{a as yg,b as zg,c as Ag,d as Bg,e as Cg,f as Dg,g as Eg,h as Fg,i as Gg,j as ph}from"./chunk-UKCDCVMD.js";import{a as xg}from"./chunk-HTVLCHWH.js";import{A as fh,B as gh,C as hh,D as ih,E as jh,F as kh,G as lh,H as mh,I as nh,J as oh,a as Hg,b as Ig,c as Jg,d as Kg,e as Lg,f as Mg,g as Ng,h as Og,i as Pg,j as Qg,k as Rg,l as Sg,m as Tg,n as Ug,o as Vg,p as Wg,q as Xg,r as Yg,s as Zg,t as _g,u as $g,v as ah,w as bh,x as ch,y as dh,z as eh}from"./chunk-XUKLF26Q.js";import{$ as yc,$a as ed,$c as Ue,$d as pg,Aa as Jc,Ab as Ed,Ac as te,Ad as pf,Bb as Fd,Bc as ue,Bd as qf,Ca as Kc,Cb as Gd,Cc as ve,Da as Lc,Dc as we,Dd as rf,E as lc,Ea as Mc,Ec as xe,Ed as sf,F as mc,Fa as Nc,Fc as ye,Fd as tf,G as nc,Ga as Oc,Gb as Hd,Gc as ze,Gd as uf,H as oc,Hb as Id,Hc as Ae,Hd as vf,I as pc,Ia as Pc,Ib as Jd,Ic as Be,Id as wf,J as qc,Ja as Qc,Jb as Kd,Jc as Ce,Jd as xf,K as rc,Ka as Rc,Kc as De,Kd as yf,L as sc,La as Sc,Lc as Ee,Ld as Ff,M as tc,Ma as Tc,Mc as Fe,Md as Gf,N as uc,Na as Uc,Nb as Ld,Nc as Ge,Nd as Hf,O as vc,Oa as Vc,Ob as Md,Oc as He,P as wc,Pa as Wc,Pb as Nd,Pc as Ie,Qa as Xc,Qb as Od,Qc as Je,Ra as Yc,Rb as Pd,Rc as Ke,Sa as Zc,Sb as Qd,Sc as Le,Ta as _c,Tb as Rd,Tc as Me,Ua as $c,Ub as Sd,Uc as Ne,Va as ad,Vb as Td,Vc as Oe,Wa as bd,Wb as Ud,Wc as Pe,Xa as cd,Xb as Vd,Xc as Qe,Ya as dd,Yc as Re,Zc as Se,_ as xc,_b as Wd,_c as Te,_d as og,aa as zc,ab as fd,ad as Ve,ae as qg,ba as Ac,bb as gd,bd as We,be as rg,c as Sb,ca as Bc,cb as hd,cc as Xd,cd as Xe,ce as sg,d as Tb,da as Cc,db as id,dc as Yd,dd as Ye,de as tg,e as Ub,eb as jd,ec as Zd,ed as Ze,f as Vb,fb as kd,fc as _d,g as Wb,gc as $d,h as Xb,hb as ld,hc as ae,i as Yb,ib as md,ic as be,j as Zb,jb as nd,jc as ce,k as _b,kb as od,kc as de,kd as _e,lb as pd,lc as ee,ld as $e,le as ug,m as ac,mb as qd,mc as fe,md as af,me as vg,n as bc,nb as rd,nc as ge,nd as bf,ne as wg,ob as sd,oc as he,od as cf,p as cc,pa as Dc,pb as td,pc as ie,pd as df,qa as Ec,qb as ud,qc as je,qd as ef,r as dc,ra as Fc,rb as vd,rc as ke,rd as ff,sa as Gc,sb as wd,sc as le,sd as gf,ta as Hc,tb as xd,tc as me,td as hf,ub as yd,uc as ne,ud as jf,vb as zd,vc as oe,vd as kf,wb as Ad,wc as pe,wd as lf,xb as Bd,xc as qe,xd as mf,y as jc,ya as Ic,yb as Cd,yc as re,yd as nf,z as kc,zb as Dd,zc as se,zd as of}from"./chunk-U6HNMLNN.js";import"./chunk-GVGLYVG4.js";import{Aa as G,Ba as H,C as h,Ca as I,D as i,Da as J,E as j,Ea as K,F as k,Fa as L,G as l,Ga as M,H as m,Ha as N,Ia as O,Ja as P,Ka as Q,La as R,Ma as S,Oa as T,Pa as U,Qa as V,Ra as W,Ta as X,Ua as Y,V as n,Va as Z,Ya as _,d as a,da as o,e as b,ea as p,f as c,ka as q,la as r,m as d,ma as s,n as e,na as t,oa as u,pa as v,qa as w,ra as x,sa as y,ta as z,ua as A,v as f,va as B,w as g,wa as C,xa as D,ya as E,za as F}from"./chunk-TRNAWSXP.js";import{Aa as pa,Ae as ab,Af as wb,Be as bb,Bf as xb,Ce as cb,Cf as yb,De as db,Ee as eb,Fe as fb,Ff as zb,Ge as gb,Gf as Ab,Ha as qa,He as hb,Hf as Bb,Ia as ra,Ie as ib,If as Cb,Ja as sa,Jb as Ra,Je as jb,Jf as Db,Kb as Sa,Ke as kb,Kf as Eb,Le as lb,Ma as ta,Me as mb,Oe as nb,Pe as ob,Qe as pb,Qf as Fb,Rf as Gb,Te as qb,Ue as rb,a as $,b as aa,c as ba,d as ca,e as da,f as ea,h as fa,i as ga,j as ha,k as ia,l as ja,qe as Ta,re as Ua,se as Va,te as Wa,ue as Xa,v as ka,ve as Ya,w as la,we as Za,wf as sb,x as ma,xa as oa,xe as _a,xf as tb,y as na,yf as ub,ze as $a,zf as vb}from"./chunk-G5FGIRDJ.js";import{A as Fa,B as Ga,C as Ha,D as Ia,E as Ja,F as Ka,G as La,H as Ma,I as Na,J as Oa,K as Pa,L as Qa,j as ua,q as va,r as wa,s as xa,t as ya,u as za,v as Aa,w as Ba,x as Ca,y as Da,z as Ea}from"./chunk-UH5WNJXF.js";import"./chunk-ONUPGMER.js";export{Tf as ALWAYS_RESIDENT_TOOL_NAMES,zi as AUTO_MODE_DENIAL_CONSECUTIVE_THRESHOLD,Ai as AUTO_MODE_DENIAL_CUMULATIVE_THRESHOLD,Kj as BASH_POLICY_SPEC,Bh as BASH_SAFE_READ_COMMANDS,Ah as BASH_WRITE_COMMANDS,bj as BLOCKER_REQUIRED_CONSECUTIVE_TURNS,ui as BREAKER_ERROR_THRESHOLD,vi as BREAKER_WINDOW_MS,Sg as BUILTIN_WORKFLOWS,kc as CANCELLED_TOOL_RESULT_MESSAGE,jc as CANCELLED_TOOL_RESULT_PREFIX,si as CLASSIFIER_MAX_OUTPUT_TOKENS,Cj as CODING_AGENT_MARKER,Vi as CODING_INVARIANTS,qh as CODING_SUMMARY_PROMPT,rh as CODING_UPDATE_SUMMARY_PROMPT,ke as CapabilityDeniedError,Xi as Client,ug as CodingActorSession,Ve as CombinedExtensionRuntime,le as ConstructionManifestError,ri as DEFAULT_CLASSIFIER_RETRY_TIMEOUT_MS,qi as DEFAULT_CLASSIFIER_TIMEOUT_MS,sh as DEFAULT_CODING_AGENT_NAME,ji as DEFAULT_DANGEROUS_PATTERNS,ie as DEFAULT_HANDLER_TIMEOUT_MS,Zf as DEFAULT_RESILIENCE_CONFIG,ii as DEFAULT_SAFE_PATTERNS,ve as DEFAULT_SELF_MODIFY_BUDGET,Ji as DEFAULT_SPECULATIVE_WINDOW_MS,mc as DEFAULT_TOOL_OUTPUT_MAX_BYTES,lc as DEFAULT_TOOL_OUTPUT_MAX_LINES,zg as DEFAULT_WORKFLOW_GENERATION_TIMEOUT_MS,na as DefaultSummaryCompaction,zj as EMIT_VERDICT_TOOL_NAME,hc as ErrorCategory,yh as FILE_MODIFICATION_TOOLS,Kg as FINDING_VERIFICATION_OUTPUT_SCHEMA,Cd as GENERATOR_AGENT_NAME,wa as ImageResizeError,ga as KODAX_API_MIN_INTERVAL,s as KODAX_DEFAULT_PROVIDER,aa as KODAX_DEFAULT_TIMEOUT,Na as KODAX_FILE_MEDIA_TYPES,ba as KODAX_HARD_TIMEOUT,La as KODAX_IMAGE_MEDIA_TYPES,ea as KODAX_MAX_INCOMPLETE_RETRIES,ca as KODAX_MAX_RETRIES,$ as KODAX_MAX_TOKENS,r as KODAX_PROVIDERS,q as KODAX_PROVIDER_SNAPSHOTS,f as KODAX_REASONING_MODE_SEQUENCE,da as KODAX_RETRY_BASE_DELAY,g as KODAX_STABLE_EFFORT_INTENTS,fa as KODAX_STAGGER_DELAY,_e as KODAX_TOOLS,yc as KODAX_UNDERLYING_CAPABILITY_TOPICS,Ma as KODAX_VIDEO_MEDIA_TYPES,o as KodaXAnthropicCompatProvider,n as KodaXBaseProvider,Xi as KodaXClient,a as KodaXError,Ue as KodaXExtensionRuntime,va as KodaXMediaError,p as KodaXOpenAICompatProvider,b as KodaXProviderError,c as KodaXRateLimitError,fc as KodaXSessionError,gc as KodaXTerminalError,ec as KodaXToolError,Jb as LEARNING_REVIEW_PROMPT_SHA256,Kb as LEARNING_REVIEW_SCHEMA_SHA256,Hb as LEARNING_REVIEW_SYSTEM_PROMPT,Ib as LEARNING_REVIEW_TOOL,nb as LINEAGE_ENTRY_TYPES,qg as LSP_SERVERS,pb as LineageCompaction,ob as LineageExtension,rg as LspService,zc as MANUAL_REGISTRY,xc as MANUAL_TOPIC_IDS,Ca as MAX_DIMENSION,rj as MEMORY_INTERVENTION_SELECTOR_PROMPT,sj as MEMORY_INTERVENTION_SELECTOR_SHA256,zh as MODIFICATION_TOOLS,_a as McpAuthRequiredError,kb as McpCapabilityProvider,Za as McpExpiredSessionError,lb as McpManager,jb as McpServerRuntime,Ha as PASTE_TMP_DIR_ENV,Ia as PASTE_TMP_TTL_MS,Bd as PLANNER_AGENT_NAME,ha as PROMISE_PATTERN,Af as PROMPT_SECTION_REGISTRY,Bj as PROTOCOL_EMITTER_TOOLS,dg as ProviderRecoveryCoordinator,nc as READ_DEFAULT_LIMIT,pc as READ_MAX_LINE_CHARS,oc as READ_PREFLIGHT_SIZE_BYTES,Qe as REPO_EXPLORER_AGENT_NAME,Re as REPO_EXPLORER_TOOL_NAMES,pa as Runner,Jg as SCOPED_REVIEW_OUTPUT_SCHEMA,Ad as SCOUT_AGENT_NAME,Uj as SCOUT_THEN_AUTHOR_PROMPT_LINES,Jf as SELF_KNOWLEDGE_ROUTING_RULE,zf as SYSTEM_PROMPT,hh as SYSTEM_WORKFLOW_LIMITS,bg as StableBoundaryTracker,Da as TARGET_RAW_SIZE_BYTES,Fd as TASK_ENGINE_ROLE_AGENTS,Dj as TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME,Nj as TRACING_ENV,Dd as WORKER_AGENT_NAME,yg as WORKFLOW_GENERATION_SYSTEM_PROMPT,Ce as _resetRuntimeForTesting,_b as acquireExclusiveFileSystemEffectLease,Fe as activate,ua as actorQueueId,fi as analyzeAutoModeCall,Uc as analyzeChangedScope,Dh as analyzePowerShellMutation,te as appendAuditEntry,xb as appendSessionLineageLabel,Qd as applyAccountingDelta,Ng as applyFindingVerification,yb as applySessionCompaction,Jc as applyToolResultGuardrail,Eb as archiveOldIslands,ei as assessAutoModeCall,Wj as authorWorkflowViaWorker,Ei as autoModeDenialShouldFallback,Qb as awaitLatestCodingMemoryReviewDrain,mi as bashSignalCollector,Oj as bootstrapTracing,Ri as boundedRevise,yi as breakerShouldFallback,Si as budgetCeiling,ih as buildApprovalSummary,Td as buildBlockedGoal,Kf as buildCapabilityContextSections,ni as buildClassifierPrompt,Ud as buildCompleteGoal,Pd as buildCreatedGoal,kg as buildFallbackRoutingDecision,fj as buildGoalRuntimeBinding,ib as buildInitializeCapabilities,qe as buildLlmReviewPrompt,Bc as buildManualToolDescription,kj as buildMcpReverseCapabilities,Rd as buildPausedGoal,Of as buildPromptMessageContent,Ef as buildPromptSnapshot,eg as buildProviderCapabilitySnapshot,lg as buildProviderPolicyHintsForDecision,fg as buildProviderPolicyPromptNotes,Tc as buildRepoIntelligenceContext,ed as buildRepoIntelligenceIndex,Qc as buildRepoOverview,Sd as buildResumedGoal,Qg as buildScopedReviewFinalPrompt,Og as buildScopedReviewPrimaryPrompt,Pg as buildScopedReviewVerificationPrompt,Vj as buildScoutThenAuthorPrompt,If as buildSelfKnowledgeRoutingRule,Cb as buildSessionTree,Mf as buildSystemPrompt,Lf as buildSystemPromptSnapshot,wf as buildToolResultBudget,xf as buildToolResultBudgetFromUsage,Xd as buildToolSearchIndex,eh as buildWorkflowCostReport,Dg as buildWorkflowGenerationSkillContext,Cg as buildWorkflowGenerationUserPrompt,Ob as canonicalMemoryProjectId,Sb as canonicalizeAgentHomePolicyPath,ai as canonicalizeAutoModePath,hi as checkAbsoluteDeny,Nf as checkIncompleteToolCalls,ng as checkPromiseSignal,yf as clampToolResultPolicyToBudget,jh as clampWorkflowLimits,ti as classify,li as classifyBashCommand,ic as classifyError,Pc as classifyFileCategory,$f as classifyResilienceError,sf as cleanupExpiredToolOutputs,Sa as cleanupIncompleteToolCalls,tf as cleanupUnreferencedToolOutputs,T as clearRuntimeModelProviders,dc as clearShellExecutionEnvironmentCache,Ii as collectAllSignals,Xh as collectBashWriteTargets,Yh as collectDeterministicBashWriteTargets,We as combineExtensionRuntimes,vj as computeInputSignature,Fj as computeRulesFingerprint,Be as configureRuntime,Xf as consumeCompactionCooldown,td as convertCapabilityReadResult,sd as convertProviderSearchResults,Db as countActiveLineageMessages,ja as countTokens,ka as createAgent,Mi as createAgentHomeShellBoundaryGuardrail,Bi as createAutoModeDenialTracker,Ni as createAutoModeToolGuardrail,ki as createBashClassifierConfig,Mj as createBashPrefixExtractor,gf as createBuiltinToolDefinition,wi as createCircuitBreaker,tj as createCodingMemoryInterventionRunner,Hg as createCodingWorkflowBackend,Vf as createCompactionAntiThrashState,me as createCtxProxy,F as createCustomProvider,th as createDefaultCodingAgent,uj as createDenialTracker,Xe as createExtensionRuntime,wg as createExternalActorTurnExecutor,Aa as createFileArtifactFromPath,la as createHandoff,za as createImageArtifactFromPath,ma as createInMemorySession,nj as createKodaXTaskRunner,vg as createLocalCodingActorControl,Ua as createMcpCapabilityId,mb as createMcpManager,$a as createMcpTransport,Mb as createProductionLearningReviewer,Bf as createPromptSection,mg as createReasoningPlan,gh as createRunGraphWriter,Sf as createRuntimeContextBudgetSnapshot,Pi as createSessionControl,sb as createSessionLineage,Ej as createToolResultTruncationGuardrail,Ba as createVideoArtifactFromPath,Qj as createWorkflowLifecycleController,Tj as createWorkflowPatternTemplateModule,nh as createWorkflowRunManager,Zi as decideWorkflowInvocation,de as dedupeExtensionPathsByEntrypoint,Ta as defaultMcpCacheDir,je as defaultPolicy,$g as deleteSavedWorkflow,Nb as deriveCodingMemoryIdentity,Rb as deriveCodingMemoryReviewIdentities,Ae as disableSelfModify,db as discoverAuthorizationServerMetadata,he as discoverDefaultExtensions,ge as discoverExtensionsInDirectory,fe as discoverExtensionsInDirectoryDetailed,Pe as discoverMarkdownAgents,eb as discoverOAuthEndpoints,cb as discoverProtectedResourceMetadata,Vg as discoverSavedWorkflows,Pb as drainCodingMemoryReviewInbox,Id as drainPendingSwaps,j as effortToLegacyReasoningMode,Aj as emitVerdict,lh as emitWorkflowAgentDigest,Qa as enqueueWithArtifacts,Se as ensureBuiltinRepoExplorerAgent,ia as estimateTokens,Rf as estimateToolSchemaTokens,gi as evaluateAutoRulesCall,gg as evaluateProviderPolicy,ee as excludeExtensionPathsByEntrypoint,_d as exec,rf as executeTool,qb as extractArtifactLedger,Lj as extractCommandPrefix,Qf as extractComparableUserMessageText,rd as extractHtmlTitle,bb as extractInsufficientScope,Rh as extractPathsFromCommand,Pf as extractPromptComparableText,ab as extractResourceMetadataUrl,Gb as extractTitleFromMessages,Fi as fileSignalCollector,vd as finalizeRetrievalResult,Le as findByVersion,Eh as findGitSubcommandIndex,zb as findPreviousUserEntryId,wh as flattenArgv,xh as flattenRedirections,Bb as forkSessionLineage,Hf as formatAgentsForPrompt,pj as formatParallelDispatchResult,qc as formatSize,Oh as generateSavePattern,Fb as generateSessionId,Fg as generateWorkflow,Gg as generateWorkflowFromOptions,Ze as getActiveExtensionRuntime,ra as getAgentConfigHome,sa as getAgentConfigPath,jf as getAllRegisteredTools,ta as getAppDataDir,W as getAvailableProviderNames,Zh as getBashOutsideProjectWriteRisk,ff as getBuiltinRegisteredToolDefinition,ef as getBuiltinToolDefinition,Tg as getBuiltinWorkflow,N as getCustomModelCapabilities,H as getCustomProvider,K as getCustomProviderList,M as getCustomProviderModelDescriptors,L as getCustomProviderModels,J as getCustomProviderNames,be as getDefaultExtensionDirectory,sg as getDefaultLspService,oh as getDefaultWorkflowRunManager,yj as getDenialContext,Kh as getDirectShellBypassBlockReason,jd as getImpactEstimate,Ff as getKodaxGlobalDir,Ya as getMcpCachePaths,C as getModelCapabilities,Oa as getModelInputCapabilities,gd as getModuleContext,Vh as getPlanModeAllowedWritablePaths,_h as getPlanModeBlockReason,id as getProcessContext,t as getProvider,x as getProviderConfiguredCapabilityProfile,w as getProviderConfiguredReasoningCapability,y as getProviderList,v as getProviderModel,B as getProviderModelDescriptors,z as getProviderModels,cf as getRegisteredToolDefinition,fd as getRepoIntelligenceIndex,Rc as getRepoOverview,kd as getRepoRoutingSignals,of as getRequiredToolParams,Q as getRuntimeModelProvider,S as getRuntimeModelProviderNames,tb as getSessionLineagePath,ub as getSessionMessagesFromLineage,hd as getSymbolContext,af as getTool,bf as getToolDefinition,df as getToolRegistrations,Ic as getToolResultPolicy,Sj as getWorkflowPatternTemplate,Fh as gitSignatureInspectionMayExecute,Md as goalTokenDelta,Yi as hasExplicitNaturalLanguageWorkflowIntent,Hd as hasPendingSwap,xa as inferImageMediaType,$h as inferPermissionMode,jg as inferTaskType,ya as inferVideoMediaType,Gc as inspectEditFailure,dd as inspectRepoIntelligenceRuntime,Lb as installProductionLearningReviewer,Xb as isAgentHomeHardMutationTarget,Yb as isAgentHomeHardRemovalTarget,Ph as isAlwaysConfirmPath,Ub as isAutoReadableAgentHomePath,ci as isAutoReadableKodaxPath,Tb as isAutoWritableAgentHomePath,di as isAutoWritableKodaxPath,Jh as isBashReadCommand,Th as isBashReadCommandAutoAllowed,Lh as isBashWriteCommand,Sh as isCommandOnProtectedPath,bi as isCredentialBearingKodaxPath,I as isCustomProviderName,xj as isDeniedRecently,Ih as isHelpCommand,V as isKnownProvider,uh as isNullDevice,oj as isParallelDispatchDirective,Uh as isPathInsideProject,Wh as isPlanModeAllowedPath,Ch as isPowerShellMutationCommand,Wb as isProtectedAgentHomeMutationTarget,Vb as isProtectedAgentHomeReadTarget,Zb as isProtectedAgentHomeRemovalTarget,u as isProviderConfigured,A as isProviderName,R as isRuntimeModelProviderName,ag as isSessionRecoveryCandidateError,Hh as isShellReadOnlyArgv,ae as isSupportedExtensionModulePath,Nh as isToolCallAllowed,lf as isToolFileMutation,nf as isToolMutation,mf as isToolNetworkRead,kf as isToolPlanModeAllowed,Vd as isValidTokenBudget,og as languageIdForPath,Me as listAll,Z as listAllModelCapabilities,Ie as listArtifacts,D as listBuiltinModelCapabilities,hf as listBuiltinToolDefinitions,Ug as listBuiltinWorkflows,Jd as listCodingDispatchableAgents,Ke as listConstructed,O as listCustomProviderModelCapabilities,qf as listToolDefinitions,pf as listTools,Rj as listWorkflowPatternTemplates,Gf as loadAgentsFiles,Ne as loadAgentsFromMarkdown,Jj as loadAutoRules,bh as loadGeneratedWorkflowFromRun,ne as loadHandler,Oe as loadMarkdownAgentScope,Yg as loadSavedWorkflow,Xg as loadSavedWorkflowCapsule,hb as loadValidToken,Ld as makeDisabledGoalToolsContext,i as mapLegacyReasoningModeToEffortIntent,vf as maybeRunReferenceAwareToolOutputGc,uf as maybeRunToolOutputGc,jj as mcpRootsFromWorkspace,rb as mergeArtifactLedger,Mg as mergeScopedReviewResults,$b as normalizeKodaXAgentMode,Va as normalizeMcpCapabilityId,Ea as normalizePastedImage,h as normalizeReasoningEffortValue,Lg as normalizeScopedReviewResult,ac as normalizeShellExecutionContract,Wg as normalizeWorkflowModule,Cf as orderPromptSections,Ig as parallelInvestigation,Mh as parseAllowedToolPattern,Ij as parseAutoRules,vh as parseBashCommand,oi as parseClassifierOutput,Fc as parseEditToolError,Gh as parseGitGrepShortOption,re as parseLlmReviewVerdict,Wa as parseMcpCapabilityId,Gi as parseModelSpec,k as parseReasoningEffortEnv,cc as parseSandboxEnvironmentPass,e as parseTimeoutSecEnvMs,Zd as parseToolSearchQuery,Eg as parseWorkflowGeneration,gb as performOAuthLogin,Ja as persistImageAsBlock,vc as persistToolOutput,Uf as planToolExposure,dh as preflightWorkflowCapsule,ld as prewarmRepoIntelligenceCaches,xg as providerResilienceConfigFromTimeouts,Ka as prunePasteTmpDir,Ga as readAndNormalizeClipboardImage,Je as readArtifact,ue as readAuditEntries,we as readBudget,Fa as readClipboardImage,ze as readDisableState,Ki as readSpeculativeWindowFromEnv,Gj as readTrustState,ig as reasoningModeToDepth,cg as reconstructMessagesWithToolGuard,Di as recordAutoModeAllow,Ci as recordAutoModeBlock,$i as recordBlockerAttempt,xi as recordBreakerError,Yf as recordCompactionSavings,wj as recordDenial,Wi as registerCodingInvariants,hj as registerConfiguredMcpCapabilityProvider,G as registerCustomProviders,P as registerModelProvider,fb as registerOAuthClient,lj as registerOfficialSandboxExtension,oa as registerPresetDispatcher,$e as registerTool,Ge as rehydrateActiveArtifacts,xe as remainingSelfModifyBudget,_g as renameSavedWorkflow,Vc as renderChangedScope,ad as renderImpactEstimate,Zc as renderModuleContext,$c as renderProcessContext,Df as renderPromptSections,Sc as renderRepoOverview,ud as renderRetrievalResult,_c as renderSymbolContext,ij as replaceConfiguredMcpCapabilityProvider,ah as replaceSavedWorkflow,pg as reportLspDiagnostics,aj as resetBlockerCounter,ye as resetBudget,Hi as resolveClassifierModel,Kd as resolveCodingDispatchableAgent,Gd as resolveConstructedAgent,ce as resolveExtensionEntrypoint,Ac as resolveKodaXManual,Y as resolveModelCapabilities,U as resolveProvider,X as resolveProviderModelDescriptors,l as resolveReasoningEffort,m as resolveReasoningEffortForModelSwitch,hg as resolveReasoningMode,cd as resolveRepoIntelligenceMode,bd as resolveRepoIntelligenceRuntimeConfig,_f as resolveResilienceConfig,vb as resolveSessionLineageTarget,Wd as resolveToolBridgeTarget,Ti as resolveToolCapability,uc as resolveToolOutputDir,_ as resolveWireEffort,Ag as resolveWorkflowGenerationTimeoutMs,Pj as resolveWorkflowIdentity,He as revoke,Ab as rewindSessionLineage,Te as rollbackSelfModify,oe as runAstRules,Oi as runKodaX,se as runLlmReview,gj as runManagedTask,mj as runOrchestration,mh as runWorkflowFromOptions,kh as runWorkflowModule,fh as safeWorkflowArtifactName,Zg as saveGeneratedWorkflow,ch as saveGeneratedWorkflowFromRun,Rg as scopedReview,Xa as searchMcpCatalog,Yd as searchToolIndex,Ye as setActiveExtensionRuntime,qa as setAgentConfigHome,wb as setSessionLineageActiveEntry,bc as shellExecutionContractFingerprint,Od as shouldFlipBudgetLimited,Wf as shouldSkipLlmCompaction,tg as shutdownDefaultLspService,Li as speculativeRace,De as stage,Qi as startKodaX,ph as startManagedWorkflow,pi as stripAssistantText,qd as stripHtmlToText,Ee as testArtifact,d as timeoutSecToMs,Qh as tokenizeRawCommandStages,Oc as toolAskUserQuestion,Kc as toolBash,Yc as toolChangedDiff,Xc as toolChangedScope,yd as toolCodeSearch,Ec as toolEdit,Lc as toolGlob,Mc as toolGrep,pd as toolImpactEstimate,Hc as toolInsertAfterAnchor,md as toolModuleContext,Ui as toolPermission,od as toolProcessContext,wc as toolRead,Wc as toolRepoOverview,zd as toolSemanticLookup,nd as toolSymbolContext,Nc as toolUndo,xd as toolWebFetch,wd as toolWebSearch,Dc as toolWrite,rc as truncateHead,tc as truncateLine,sc as truncateTail,Hj as trustProjectRules,Nd as turnWallTimeDelta,Ra as validateAndFixToolHistory,E as validateCustomProviderConfig,Bg as validateGeneratedWorkflowSource,Pa as validateInputArtifactsForModel,qj as validateSubtaskIndependence,pe as validateToolSchemaForProvider,ej as verifyGoalCompletion,$d as webhook,cj as withGoalBeforeNextTurn,dj as withGoalStopHook,Cc as withManualToolBranding,Ed as workerAgent,_i as workflowStartOutcomeConsumesTurn,Xj as writeReviewPackets};
2
+ import{$ as Lj,A as kj,B as lj,C as mj,D as nj,E as oj,F as pj,G as qj,H as rj,I as sj,J as tj,K as uj,L as vj,M as wj,N as xj,O as yj,P as zj,Q as Aj,R as Bj,S as Cj,T as Dj,U as Ej,V as Fj,W as Gj,X as Hj,Y as Ij,Z as Jj,_ as Kj,a as ec,aa as Mj,b as fc,ba as Nj,c as gc,ca as Oj,d as Pi,da as Pj,e as Qi,ea as Qj,f as Ri,fa as Rj,g as Si,ga as Sj,h as Ti,ha as Tj,i as Ui,ia as Uj,j as Vi,ja as Vj,k as Wi,ka as Wj,l as Xi,la as Xj,m as Yi,n as Zi,o as _i,p as $i,q as aj,r as bj,s as cj,t as dj,u as ej,v as fj,w as gj,x as hj,y as ij,z as jj}from"./chunk-BCYJIACJ.js";import{$ as bg,$b as qi,A as Lf,Ab as Rh,B as Mf,Bb as Sh,C as Nf,Cb as Th,D as Of,Db as Uh,Eb as Vh,Fb as Wh,Gb as Xh,Hb as Yh,I as Pf,Ib as Zh,J as Qf,Jb as _h,Kb as $h,Lb as ai,Mb as bi,N as Rf,Nb as ci,O as Sf,Ob as di,P as Tf,Pb as ei,Q as Uf,Qb as fi,R as Vf,Rb as gi,S as Wf,Sb as hi,T as Xf,Tb as ii,U as Yf,Ua as qh,Ub as ji,Va as rh,Vb as ki,Wb as li,X as Zf,Xb as mi,Y as _f,Yb as ni,Z as $f,Zb as oi,_ as ag,_b as pi,aa as cg,ac as ri,b as Hb,ba as dg,bb as sh,bc as si,c as Ib,cb as th,cc as ti,d as Jb,db as uh,dc as ui,e as Kb,eb as vh,ec as vi,f as Lb,fb as wh,fc as wi,g as Mb,ga as eg,gb as xh,gc as xi,ha as fg,hb as yh,hc as yi,i as Nb,ia as gg,ib as zh,ic as zi,j as Ob,ja as hg,jb as Ah,jc as Ai,ka as ig,kb as Bh,kc as Bi,l as Pb,lb as Ch,lc as Ci,m as Qb,mb as Dh,mc as Di,n as Rb,nb as Eh,nc as Ei,o as $b,oa as jg,ob as Fh,oc as Fi,p as hc,pa as kg,pb as Gh,pc as Gi,q as ic,qa as lg,qb as Hh,qc as Hi,r as zf,ra as mg,rb as Ih,rc as Ii,s as Af,sb as Jh,sc as Ji,t as Bf,tb as Kh,tc as Ki,u as Cf,ua as ng,ub as Lh,uc as Li,v as Df,vb as Mh,vc as Mi,w as Ef,wb as Nh,wc as Ni,x as If,xb as Oh,y as Jf,yb as Ph,yc as Oi,z as Kf,zb as Qh}from"./chunk-3PGNESV3.js";import{a as yg,b as zg,c as Ag,d as Bg,e as Cg,f as Dg,g as Eg,h as Fg,i as Gg,j as ph}from"./chunk-XKLVC7F6.js";import{a as xg}from"./chunk-JS4RSF4B.js";import{A as fh,B as gh,C as hh,D as ih,E as jh,F as kh,G as lh,H as mh,I as nh,J as oh,a as Hg,b as Ig,c as Jg,d as Kg,e as Lg,f as Mg,g as Ng,h as Og,i as Pg,j as Qg,k as Rg,l as Sg,m as Tg,n as Ug,o as Vg,p as Wg,q as Xg,r as Yg,s as Zg,t as _g,u as $g,v as ah,w as bh,x as ch,y as dh,z as eh}from"./chunk-ZQNOEKOB.js";import{$ as yc,$a as ed,$c as Ue,$d as pg,Aa as Jc,Ab as Ed,Ac as te,Ad as pf,Bb as Fd,Bc as ue,Bd as qf,Ca as Kc,Cb as Gd,Cc as ve,Da as Lc,Dc as we,Dd as rf,E as lc,Ea as Mc,Ec as xe,Ed as sf,F as mc,Fa as Nc,Fc as ye,Fd as tf,G as nc,Ga as Oc,Gb as Hd,Gc as ze,Gd as uf,H as oc,Hb as Id,Hc as Ae,Hd as vf,I as pc,Ia as Pc,Ib as Jd,Ic as Be,Id as wf,J as qc,Ja as Qc,Jb as Kd,Jc as Ce,Jd as xf,K as rc,Ka as Rc,Kc as De,Kd as yf,L as sc,La as Sc,Lc as Ee,Ld as Ff,M as tc,Ma as Tc,Mc as Fe,Md as Gf,N as uc,Na as Uc,Nb as Ld,Nc as Ge,Nd as Hf,O as vc,Oa as Vc,Ob as Md,Oc as He,P as wc,Pa as Wc,Pb as Nd,Pc as Ie,Qa as Xc,Qb as Od,Qc as Je,Ra as Yc,Rb as Pd,Rc as Ke,Sa as Zc,Sb as Qd,Sc as Le,Ta as _c,Tb as Rd,Tc as Me,Ua as $c,Ub as Sd,Uc as Ne,Va as ad,Vb as Td,Vc as Oe,Wa as bd,Wb as Ud,Wc as Pe,Xa as cd,Xb as Vd,Xc as Qe,Ya as dd,Yc as Re,Zc as Se,_ as xc,_b as Wd,_c as Te,_d as og,aa as zc,ab as fd,ad as Ve,ae as qg,ba as Ac,bb as gd,bd as We,be as rg,c as Sb,ca as Bc,cb as hd,cc as Xd,cd as Xe,ce as sg,d as Tb,da as Cc,db as id,dc as Yd,dd as Ye,de as tg,e as Ub,eb as jd,ec as Zd,ed as Ze,f as Vb,fb as kd,fc as _d,g as Wb,gc as $d,h as Xb,hb as ld,hc as ae,i as Yb,ib as md,ic as be,j as Zb,jb as nd,jc as ce,k as _b,kb as od,kc as de,kd as _e,lb as pd,lc as ee,ld as $e,le as ug,m as ac,mb as qd,mc as fe,md as af,me as vg,n as bc,nb as rd,nc as ge,nd as bf,ne as wg,ob as sd,oc as he,od as cf,p as cc,pa as Dc,pb as td,pc as ie,pd as df,qa as Ec,qb as ud,qc as je,qd as ef,r as dc,ra as Fc,rb as vd,rc as ke,rd as ff,sa as Gc,sb as wd,sc as le,sd as gf,ta as Hc,tb as xd,tc as me,td as hf,ub as yd,uc as ne,ud as jf,vb as zd,vc as oe,vd as kf,wb as Ad,wc as pe,wd as lf,xb as Bd,xc as qe,xd as mf,y as jc,ya as Ic,yb as Cd,yc as re,yd as nf,z as kc,zb as Dd,zc as se,zd as of}from"./chunk-DB4O33RR.js";import"./chunk-GRJ7NKWP.js";import{Aa as G,Ba as H,C as h,Ca as I,D as i,Da as J,E as j,Ea as K,F as k,Fa as L,G as l,Ga as M,H as m,Ha as N,Ia as O,Ja as P,Ka as Q,La as R,Ma as S,Oa as T,Pa as U,Qa as V,Ra as W,Ta as X,Ua as Y,V as n,Va as Z,Ya as _,d as a,da as o,e as b,ea as p,f as c,ka as q,la as r,m as d,ma as s,n as e,na as t,oa as u,pa as v,qa as w,ra as x,sa as y,ta as z,ua as A,v as f,va as B,w as g,wa as C,xa as D,ya as E,za as F}from"./chunk-SKELDH3G.js";import{Aa as pa,Ae as ab,Af as wb,Be as bb,Bf as xb,Ce as cb,Cf as yb,De as db,Ee as eb,Fe as fb,Ff as zb,Ge as gb,Gf as Ab,Ha as qa,He as hb,Hf as Bb,Ia as ra,Ie as ib,If as Cb,Ja as sa,Jb as Ra,Je as jb,Jf as Db,Kb as Sa,Ke as kb,Kf as Eb,Le as lb,Ma as ta,Me as mb,Oe as nb,Pe as ob,Qe as pb,Qf as Fb,Rf as Gb,Te as qb,Ue as rb,a as $,b as aa,c as ba,d as ca,e as da,f as ea,h as fa,i as ga,j as ha,k as ia,l as ja,qe as Ta,re as Ua,se as Va,te as Wa,ue as Xa,v as ka,ve as Ya,w as la,we as Za,wf as sb,x as ma,xa as oa,xe as _a,xf as tb,y as na,yf as ub,ze as $a,zf as vb}from"./chunk-ITP7J5HX.js";import{A as Fa,B as Ga,C as Ha,D as Ia,E as Ja,F as Ka,G as La,H as Ma,I as Na,J as Oa,K as Pa,L as Qa,j as ua,q as va,r as wa,s as xa,t as ya,u as za,v as Aa,w as Ba,x as Ca,y as Da,z as Ea}from"./chunk-XH7UM4GO.js";import"./chunk-ONUPGMER.js";export{Tf as ALWAYS_RESIDENT_TOOL_NAMES,zi as AUTO_MODE_DENIAL_CONSECUTIVE_THRESHOLD,Ai as AUTO_MODE_DENIAL_CUMULATIVE_THRESHOLD,Kj as BASH_POLICY_SPEC,Bh as BASH_SAFE_READ_COMMANDS,Ah as BASH_WRITE_COMMANDS,bj as BLOCKER_REQUIRED_CONSECUTIVE_TURNS,ui as BREAKER_ERROR_THRESHOLD,vi as BREAKER_WINDOW_MS,Sg as BUILTIN_WORKFLOWS,kc as CANCELLED_TOOL_RESULT_MESSAGE,jc as CANCELLED_TOOL_RESULT_PREFIX,si as CLASSIFIER_MAX_OUTPUT_TOKENS,Cj as CODING_AGENT_MARKER,Vi as CODING_INVARIANTS,qh as CODING_SUMMARY_PROMPT,rh as CODING_UPDATE_SUMMARY_PROMPT,ke as CapabilityDeniedError,Xi as Client,ug as CodingActorSession,Ve as CombinedExtensionRuntime,le as ConstructionManifestError,ri as DEFAULT_CLASSIFIER_RETRY_TIMEOUT_MS,qi as DEFAULT_CLASSIFIER_TIMEOUT_MS,sh as DEFAULT_CODING_AGENT_NAME,ji as DEFAULT_DANGEROUS_PATTERNS,ie as DEFAULT_HANDLER_TIMEOUT_MS,Zf as DEFAULT_RESILIENCE_CONFIG,ii as DEFAULT_SAFE_PATTERNS,ve as DEFAULT_SELF_MODIFY_BUDGET,Ji as DEFAULT_SPECULATIVE_WINDOW_MS,mc as DEFAULT_TOOL_OUTPUT_MAX_BYTES,lc as DEFAULT_TOOL_OUTPUT_MAX_LINES,zg as DEFAULT_WORKFLOW_GENERATION_TIMEOUT_MS,na as DefaultSummaryCompaction,zj as EMIT_VERDICT_TOOL_NAME,hc as ErrorCategory,yh as FILE_MODIFICATION_TOOLS,Kg as FINDING_VERIFICATION_OUTPUT_SCHEMA,Cd as GENERATOR_AGENT_NAME,wa as ImageResizeError,ga as KODAX_API_MIN_INTERVAL,s as KODAX_DEFAULT_PROVIDER,aa as KODAX_DEFAULT_TIMEOUT,Na as KODAX_FILE_MEDIA_TYPES,ba as KODAX_HARD_TIMEOUT,La as KODAX_IMAGE_MEDIA_TYPES,ea as KODAX_MAX_INCOMPLETE_RETRIES,ca as KODAX_MAX_RETRIES,$ as KODAX_MAX_TOKENS,r as KODAX_PROVIDERS,q as KODAX_PROVIDER_SNAPSHOTS,f as KODAX_REASONING_MODE_SEQUENCE,da as KODAX_RETRY_BASE_DELAY,g as KODAX_STABLE_EFFORT_INTENTS,fa as KODAX_STAGGER_DELAY,_e as KODAX_TOOLS,yc as KODAX_UNDERLYING_CAPABILITY_TOPICS,Ma as KODAX_VIDEO_MEDIA_TYPES,o as KodaXAnthropicCompatProvider,n as KodaXBaseProvider,Xi as KodaXClient,a as KodaXError,Ue as KodaXExtensionRuntime,va as KodaXMediaError,p as KodaXOpenAICompatProvider,b as KodaXProviderError,c as KodaXRateLimitError,fc as KodaXSessionError,gc as KodaXTerminalError,ec as KodaXToolError,Jb as LEARNING_REVIEW_PROMPT_SHA256,Kb as LEARNING_REVIEW_SCHEMA_SHA256,Hb as LEARNING_REVIEW_SYSTEM_PROMPT,Ib as LEARNING_REVIEW_TOOL,nb as LINEAGE_ENTRY_TYPES,qg as LSP_SERVERS,pb as LineageCompaction,ob as LineageExtension,rg as LspService,zc as MANUAL_REGISTRY,xc as MANUAL_TOPIC_IDS,Ca as MAX_DIMENSION,rj as MEMORY_INTERVENTION_SELECTOR_PROMPT,sj as MEMORY_INTERVENTION_SELECTOR_SHA256,zh as MODIFICATION_TOOLS,_a as McpAuthRequiredError,kb as McpCapabilityProvider,Za as McpExpiredSessionError,lb as McpManager,jb as McpServerRuntime,Ha as PASTE_TMP_DIR_ENV,Ia as PASTE_TMP_TTL_MS,Bd as PLANNER_AGENT_NAME,ha as PROMISE_PATTERN,Af as PROMPT_SECTION_REGISTRY,Bj as PROTOCOL_EMITTER_TOOLS,dg as ProviderRecoveryCoordinator,nc as READ_DEFAULT_LIMIT,pc as READ_MAX_LINE_CHARS,oc as READ_PREFLIGHT_SIZE_BYTES,Qe as REPO_EXPLORER_AGENT_NAME,Re as REPO_EXPLORER_TOOL_NAMES,pa as Runner,Jg as SCOPED_REVIEW_OUTPUT_SCHEMA,Ad as SCOUT_AGENT_NAME,Uj as SCOUT_THEN_AUTHOR_PROMPT_LINES,Jf as SELF_KNOWLEDGE_ROUTING_RULE,zf as SYSTEM_PROMPT,hh as SYSTEM_WORKFLOW_LIMITS,bg as StableBoundaryTracker,Da as TARGET_RAW_SIZE_BYTES,Fd as TASK_ENGINE_ROLE_AGENTS,Dj as TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME,Nj as TRACING_ENV,Dd as WORKER_AGENT_NAME,yg as WORKFLOW_GENERATION_SYSTEM_PROMPT,Ce as _resetRuntimeForTesting,_b as acquireExclusiveFileSystemEffectLease,Fe as activate,ua as actorQueueId,fi as analyzeAutoModeCall,Uc as analyzeChangedScope,Dh as analyzePowerShellMutation,te as appendAuditEntry,xb as appendSessionLineageLabel,Qd as applyAccountingDelta,Ng as applyFindingVerification,yb as applySessionCompaction,Jc as applyToolResultGuardrail,Eb as archiveOldIslands,ei as assessAutoModeCall,Wj as authorWorkflowViaWorker,Ei as autoModeDenialShouldFallback,Qb as awaitLatestCodingMemoryReviewDrain,mi as bashSignalCollector,Oj as bootstrapTracing,Ri as boundedRevise,yi as breakerShouldFallback,Si as budgetCeiling,ih as buildApprovalSummary,Td as buildBlockedGoal,Kf as buildCapabilityContextSections,ni as buildClassifierPrompt,Ud as buildCompleteGoal,Pd as buildCreatedGoal,kg as buildFallbackRoutingDecision,fj as buildGoalRuntimeBinding,ib as buildInitializeCapabilities,qe as buildLlmReviewPrompt,Bc as buildManualToolDescription,kj as buildMcpReverseCapabilities,Rd as buildPausedGoal,Of as buildPromptMessageContent,Ef as buildPromptSnapshot,eg as buildProviderCapabilitySnapshot,lg as buildProviderPolicyHintsForDecision,fg as buildProviderPolicyPromptNotes,Tc as buildRepoIntelligenceContext,ed as buildRepoIntelligenceIndex,Qc as buildRepoOverview,Sd as buildResumedGoal,Qg as buildScopedReviewFinalPrompt,Og as buildScopedReviewPrimaryPrompt,Pg as buildScopedReviewVerificationPrompt,Vj as buildScoutThenAuthorPrompt,If as buildSelfKnowledgeRoutingRule,Cb as buildSessionTree,Mf as buildSystemPrompt,Lf as buildSystemPromptSnapshot,wf as buildToolResultBudget,xf as buildToolResultBudgetFromUsage,Xd as buildToolSearchIndex,eh as buildWorkflowCostReport,Dg as buildWorkflowGenerationSkillContext,Cg as buildWorkflowGenerationUserPrompt,Ob as canonicalMemoryProjectId,Sb as canonicalizeAgentHomePolicyPath,ai as canonicalizeAutoModePath,hi as checkAbsoluteDeny,Nf as checkIncompleteToolCalls,ng as checkPromiseSignal,yf as clampToolResultPolicyToBudget,jh as clampWorkflowLimits,ti as classify,li as classifyBashCommand,ic as classifyError,Pc as classifyFileCategory,$f as classifyResilienceError,sf as cleanupExpiredToolOutputs,Sa as cleanupIncompleteToolCalls,tf as cleanupUnreferencedToolOutputs,T as clearRuntimeModelProviders,dc as clearShellExecutionEnvironmentCache,Ii as collectAllSignals,Xh as collectBashWriteTargets,Yh as collectDeterministicBashWriteTargets,We as combineExtensionRuntimes,vj as computeInputSignature,Fj as computeRulesFingerprint,Be as configureRuntime,Xf as consumeCompactionCooldown,td as convertCapabilityReadResult,sd as convertProviderSearchResults,Db as countActiveLineageMessages,ja as countTokens,ka as createAgent,Mi as createAgentHomeShellBoundaryGuardrail,Bi as createAutoModeDenialTracker,Ni as createAutoModeToolGuardrail,ki as createBashClassifierConfig,Mj as createBashPrefixExtractor,gf as createBuiltinToolDefinition,wi as createCircuitBreaker,tj as createCodingMemoryInterventionRunner,Hg as createCodingWorkflowBackend,Vf as createCompactionAntiThrashState,me as createCtxProxy,F as createCustomProvider,th as createDefaultCodingAgent,uj as createDenialTracker,Xe as createExtensionRuntime,wg as createExternalActorTurnExecutor,Aa as createFileArtifactFromPath,la as createHandoff,za as createImageArtifactFromPath,ma as createInMemorySession,nj as createKodaXTaskRunner,vg as createLocalCodingActorControl,Ua as createMcpCapabilityId,mb as createMcpManager,$a as createMcpTransport,Mb as createProductionLearningReviewer,Bf as createPromptSection,mg as createReasoningPlan,gh as createRunGraphWriter,Sf as createRuntimeContextBudgetSnapshot,Pi as createSessionControl,sb as createSessionLineage,Ej as createToolResultTruncationGuardrail,Ba as createVideoArtifactFromPath,Qj as createWorkflowLifecycleController,Tj as createWorkflowPatternTemplateModule,nh as createWorkflowRunManager,Zi as decideWorkflowInvocation,de as dedupeExtensionPathsByEntrypoint,Ta as defaultMcpCacheDir,je as defaultPolicy,$g as deleteSavedWorkflow,Nb as deriveCodingMemoryIdentity,Rb as deriveCodingMemoryReviewIdentities,Ae as disableSelfModify,db as discoverAuthorizationServerMetadata,he as discoverDefaultExtensions,ge as discoverExtensionsInDirectory,fe as discoverExtensionsInDirectoryDetailed,Pe as discoverMarkdownAgents,eb as discoverOAuthEndpoints,cb as discoverProtectedResourceMetadata,Vg as discoverSavedWorkflows,Pb as drainCodingMemoryReviewInbox,Id as drainPendingSwaps,j as effortToLegacyReasoningMode,Aj as emitVerdict,lh as emitWorkflowAgentDigest,Qa as enqueueWithArtifacts,Se as ensureBuiltinRepoExplorerAgent,ia as estimateTokens,Rf as estimateToolSchemaTokens,gi as evaluateAutoRulesCall,gg as evaluateProviderPolicy,ee as excludeExtensionPathsByEntrypoint,_d as exec,rf as executeTool,qb as extractArtifactLedger,Lj as extractCommandPrefix,Qf as extractComparableUserMessageText,rd as extractHtmlTitle,bb as extractInsufficientScope,Rh as extractPathsFromCommand,Pf as extractPromptComparableText,ab as extractResourceMetadataUrl,Gb as extractTitleFromMessages,Fi as fileSignalCollector,vd as finalizeRetrievalResult,Le as findByVersion,Eh as findGitSubcommandIndex,zb as findPreviousUserEntryId,wh as flattenArgv,xh as flattenRedirections,Bb as forkSessionLineage,Hf as formatAgentsForPrompt,pj as formatParallelDispatchResult,qc as formatSize,Oh as generateSavePattern,Fb as generateSessionId,Fg as generateWorkflow,Gg as generateWorkflowFromOptions,Ze as getActiveExtensionRuntime,ra as getAgentConfigHome,sa as getAgentConfigPath,jf as getAllRegisteredTools,ta as getAppDataDir,W as getAvailableProviderNames,Zh as getBashOutsideProjectWriteRisk,ff as getBuiltinRegisteredToolDefinition,ef as getBuiltinToolDefinition,Tg as getBuiltinWorkflow,N as getCustomModelCapabilities,H as getCustomProvider,K as getCustomProviderList,M as getCustomProviderModelDescriptors,L as getCustomProviderModels,J as getCustomProviderNames,be as getDefaultExtensionDirectory,sg as getDefaultLspService,oh as getDefaultWorkflowRunManager,yj as getDenialContext,Kh as getDirectShellBypassBlockReason,jd as getImpactEstimate,Ff as getKodaxGlobalDir,Ya as getMcpCachePaths,C as getModelCapabilities,Oa as getModelInputCapabilities,gd as getModuleContext,Vh as getPlanModeAllowedWritablePaths,_h as getPlanModeBlockReason,id as getProcessContext,t as getProvider,x as getProviderConfiguredCapabilityProfile,w as getProviderConfiguredReasoningCapability,y as getProviderList,v as getProviderModel,B as getProviderModelDescriptors,z as getProviderModels,cf as getRegisteredToolDefinition,fd as getRepoIntelligenceIndex,Rc as getRepoOverview,kd as getRepoRoutingSignals,of as getRequiredToolParams,Q as getRuntimeModelProvider,S as getRuntimeModelProviderNames,tb as getSessionLineagePath,ub as getSessionMessagesFromLineage,hd as getSymbolContext,af as getTool,bf as getToolDefinition,df as getToolRegistrations,Ic as getToolResultPolicy,Sj as getWorkflowPatternTemplate,Fh as gitSignatureInspectionMayExecute,Md as goalTokenDelta,Yi as hasExplicitNaturalLanguageWorkflowIntent,Hd as hasPendingSwap,xa as inferImageMediaType,$h as inferPermissionMode,jg as inferTaskType,ya as inferVideoMediaType,Gc as inspectEditFailure,dd as inspectRepoIntelligenceRuntime,Lb as installProductionLearningReviewer,Xb as isAgentHomeHardMutationTarget,Yb as isAgentHomeHardRemovalTarget,Ph as isAlwaysConfirmPath,Ub as isAutoReadableAgentHomePath,ci as isAutoReadableKodaxPath,Tb as isAutoWritableAgentHomePath,di as isAutoWritableKodaxPath,Jh as isBashReadCommand,Th as isBashReadCommandAutoAllowed,Lh as isBashWriteCommand,Sh as isCommandOnProtectedPath,bi as isCredentialBearingKodaxPath,I as isCustomProviderName,xj as isDeniedRecently,Ih as isHelpCommand,V as isKnownProvider,uh as isNullDevice,oj as isParallelDispatchDirective,Uh as isPathInsideProject,Wh as isPlanModeAllowedPath,Ch as isPowerShellMutationCommand,Wb as isProtectedAgentHomeMutationTarget,Vb as isProtectedAgentHomeReadTarget,Zb as isProtectedAgentHomeRemovalTarget,u as isProviderConfigured,A as isProviderName,R as isRuntimeModelProviderName,ag as isSessionRecoveryCandidateError,Hh as isShellReadOnlyArgv,ae as isSupportedExtensionModulePath,Nh as isToolCallAllowed,lf as isToolFileMutation,nf as isToolMutation,mf as isToolNetworkRead,kf as isToolPlanModeAllowed,Vd as isValidTokenBudget,og as languageIdForPath,Me as listAll,Z as listAllModelCapabilities,Ie as listArtifacts,D as listBuiltinModelCapabilities,hf as listBuiltinToolDefinitions,Ug as listBuiltinWorkflows,Jd as listCodingDispatchableAgents,Ke as listConstructed,O as listCustomProviderModelCapabilities,qf as listToolDefinitions,pf as listTools,Rj as listWorkflowPatternTemplates,Gf as loadAgentsFiles,Ne as loadAgentsFromMarkdown,Jj as loadAutoRules,bh as loadGeneratedWorkflowFromRun,ne as loadHandler,Oe as loadMarkdownAgentScope,Yg as loadSavedWorkflow,Xg as loadSavedWorkflowCapsule,hb as loadValidToken,Ld as makeDisabledGoalToolsContext,i as mapLegacyReasoningModeToEffortIntent,vf as maybeRunReferenceAwareToolOutputGc,uf as maybeRunToolOutputGc,jj as mcpRootsFromWorkspace,rb as mergeArtifactLedger,Mg as mergeScopedReviewResults,$b as normalizeKodaXAgentMode,Va as normalizeMcpCapabilityId,Ea as normalizePastedImage,h as normalizeReasoningEffortValue,Lg as normalizeScopedReviewResult,ac as normalizeShellExecutionContract,Wg as normalizeWorkflowModule,Cf as orderPromptSections,Ig as parallelInvestigation,Mh as parseAllowedToolPattern,Ij as parseAutoRules,vh as parseBashCommand,oi as parseClassifierOutput,Fc as parseEditToolError,Gh as parseGitGrepShortOption,re as parseLlmReviewVerdict,Wa as parseMcpCapabilityId,Gi as parseModelSpec,k as parseReasoningEffortEnv,cc as parseSandboxEnvironmentPass,e as parseTimeoutSecEnvMs,Zd as parseToolSearchQuery,Eg as parseWorkflowGeneration,gb as performOAuthLogin,Ja as persistImageAsBlock,vc as persistToolOutput,Uf as planToolExposure,dh as preflightWorkflowCapsule,ld as prewarmRepoIntelligenceCaches,xg as providerResilienceConfigFromTimeouts,Ka as prunePasteTmpDir,Ga as readAndNormalizeClipboardImage,Je as readArtifact,ue as readAuditEntries,we as readBudget,Fa as readClipboardImage,ze as readDisableState,Ki as readSpeculativeWindowFromEnv,Gj as readTrustState,ig as reasoningModeToDepth,cg as reconstructMessagesWithToolGuard,Di as recordAutoModeAllow,Ci as recordAutoModeBlock,$i as recordBlockerAttempt,xi as recordBreakerError,Yf as recordCompactionSavings,wj as recordDenial,Wi as registerCodingInvariants,hj as registerConfiguredMcpCapabilityProvider,G as registerCustomProviders,P as registerModelProvider,fb as registerOAuthClient,lj as registerOfficialSandboxExtension,oa as registerPresetDispatcher,$e as registerTool,Ge as rehydrateActiveArtifacts,xe as remainingSelfModifyBudget,_g as renameSavedWorkflow,Vc as renderChangedScope,ad as renderImpactEstimate,Zc as renderModuleContext,$c as renderProcessContext,Df as renderPromptSections,Sc as renderRepoOverview,ud as renderRetrievalResult,_c as renderSymbolContext,ij as replaceConfiguredMcpCapabilityProvider,ah as replaceSavedWorkflow,pg as reportLspDiagnostics,aj as resetBlockerCounter,ye as resetBudget,Hi as resolveClassifierModel,Kd as resolveCodingDispatchableAgent,Gd as resolveConstructedAgent,ce as resolveExtensionEntrypoint,Ac as resolveKodaXManual,Y as resolveModelCapabilities,U as resolveProvider,X as resolveProviderModelDescriptors,l as resolveReasoningEffort,m as resolveReasoningEffortForModelSwitch,hg as resolveReasoningMode,cd as resolveRepoIntelligenceMode,bd as resolveRepoIntelligenceRuntimeConfig,_f as resolveResilienceConfig,vb as resolveSessionLineageTarget,Wd as resolveToolBridgeTarget,Ti as resolveToolCapability,uc as resolveToolOutputDir,_ as resolveWireEffort,Ag as resolveWorkflowGenerationTimeoutMs,Pj as resolveWorkflowIdentity,He as revoke,Ab as rewindSessionLineage,Te as rollbackSelfModify,oe as runAstRules,Oi as runKodaX,se as runLlmReview,gj as runManagedTask,mj as runOrchestration,mh as runWorkflowFromOptions,kh as runWorkflowModule,fh as safeWorkflowArtifactName,Zg as saveGeneratedWorkflow,ch as saveGeneratedWorkflowFromRun,Rg as scopedReview,Xa as searchMcpCatalog,Yd as searchToolIndex,Ye as setActiveExtensionRuntime,qa as setAgentConfigHome,wb as setSessionLineageActiveEntry,bc as shellExecutionContractFingerprint,Od as shouldFlipBudgetLimited,Wf as shouldSkipLlmCompaction,tg as shutdownDefaultLspService,Li as speculativeRace,De as stage,Qi as startKodaX,ph as startManagedWorkflow,pi as stripAssistantText,qd as stripHtmlToText,Ee as testArtifact,d as timeoutSecToMs,Qh as tokenizeRawCommandStages,Oc as toolAskUserQuestion,Kc as toolBash,Yc as toolChangedDiff,Xc as toolChangedScope,yd as toolCodeSearch,Ec as toolEdit,Lc as toolGlob,Mc as toolGrep,pd as toolImpactEstimate,Hc as toolInsertAfterAnchor,md as toolModuleContext,Ui as toolPermission,od as toolProcessContext,wc as toolRead,Wc as toolRepoOverview,zd as toolSemanticLookup,nd as toolSymbolContext,Nc as toolUndo,xd as toolWebFetch,wd as toolWebSearch,Dc as toolWrite,rc as truncateHead,tc as truncateLine,sc as truncateTail,Hj as trustProjectRules,Nd as turnWallTimeDelta,Ra as validateAndFixToolHistory,E as validateCustomProviderConfig,Bg as validateGeneratedWorkflowSource,Pa as validateInputArtifactsForModel,qj as validateSubtaskIndependence,pe as validateToolSchemaForProvider,ej as verifyGoalCompletion,$d as webhook,cj as withGoalBeforeNextTurn,dj as withGoalStopHook,Cc as withManualToolBranding,Ed as workerAgent,_i as workflowStartOutcomeConsumesTurn,Xj as writeReviewPackets};
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{$,$a,A,Aa,B,Ba,C,Ca,D,Da,E,Ea,F,Fa,G,Ga,H,Ha,I,Ia,J,Ja,K,Ka,L,La,M,Ma,N,Na,O,Oa,P,Pa,Q,Qa,R,Ra,S,Sa,T,Ta,U,Ua,V,Va,W,Wa,X,Xa,Y,Ya,Z,Za,_,_a,a,aa,ab,b,ba,bb,c,ca,cb,d,da,db,e,ea,eb,f,fa,fb,g,ga,gb,h,ha,i,ia,j,ja,k,ka,l,la,m,ma,n,na,o,oa,p,pa,q,qa,r,ra,s,sa,t,ta,u,ua,v,va,w,wa,x,xa,y,ya,z,za}from"./chunk-TRNAWSXP.js";import"./chunk-ONUPGMER.js";export{Za as DEFAULT_COST_RATES,l as KODAX_API_MIN_INTERVAL,j as KODAX_CAPPED_MAX_OUTPUT_TOKENS,ma as KODAX_DEFAULT_PROVIDER,x as KODAX_DEFAULT_THINKING_BUDGETS,k as KODAX_ESCALATED_MAX_OUTPUT_TOKENS,i as KODAX_MAX_TOKENS,la as KODAX_PROVIDERS,ka as KODAX_PROVIDER_SNAPSHOTS,v as KODAX_REASONING_MODE_SEQUENCE,y as KODAX_REASONING_SAFETY_RESERVE,w as KODAX_STABLE_EFFORT_INTENTS,fa as KodaXAcpProvider,da as KodaXAnthropicCompatProvider,V as KodaXBaseProvider,d as KodaXError,g as KodaXNetworkError,ea as KodaXOpenAICompatProvider,e as KodaXProviderError,f as KodaXRateLimitError,h as KodaXToolCallIdError,P as WORKFLOW_MAX_CONCURRENCY_ABSOLUTE,O as WORKFLOW_MAX_CONCURRENCY_DEFAULT,s as addRejectedEffort,$a as calculateCost,p as capabilityCacheKey,K as clampThinkingBudget,X as classifyStopReason,_ as classifyVerifyError,Oa as clearRuntimeModelProviders,ab as createCostTracker,za as createCustomProvider,E as effortToLegacyReasoningMode,N as extractHeadersFromError,eb as formatCost,fb as formatCostReport,Ra as getAvailableProviderNames,ga as getCodexCliDefaultModel,ia as getCodexCliKnownModels,_a as getCostRate,Ha as getCustomModelCapabilities,Ba as getCustomProvider,Ea as getCustomProviderList,Ga as getCustomProviderModelDescriptors,Fa as getCustomProviderModels,Da as getCustomProviderNames,I as getDefaultThinkingDepthForMode,ha as getGeminiCliDefaultModel,ja as getGeminiCliKnownModels,wa as getModelCapabilities,na as getProvider,ra as getProviderConfiguredCapabilityProfile,qa as getProviderConfiguredReasoningCapability,Sa as getProviderCredentialEnvironmentNames,sa as getProviderList,pa as getProviderModel,va as getProviderModelDescriptors,ta as getProviderModels,z as getReasoningCapability,r as getRejectedEfforts,S as getRunScopedConfig,Ka as getRuntimeModelProvider,Na as getRuntimeModelProviderCredentialEnvironmentNames,Ma as getRuntimeModelProviderNames,b as getScopedProviderCredential,db as getSummary,$ as insertCacheBoundary,aa as isCacheBoundary,Y as isCleanStop,Ca as isCustomProviderName,Qa as isKnownProvider,oa as isProviderConfigured,ua as isProviderName,A as isReasoningEnabled,La as isRuntimeModelProviderName,Va as listAllModelCapabilities,xa as listBuiltinModelCapabilities,Ia as listCustomProviderModelCapabilities,Xa as listProviderModels,ba as lowerCacheBoundaries,L as mapDepthToOpenAIReasoningEffort,D as mapLegacyReasoningModeToEffortIntent,q as narrowReasoningProfile,U as normalizeCapabilityProfile,C as normalizeReasoningEffortValue,B as normalizeReasoningRequest,F as parseReasoningEffortEnv,M as parseRetryAfter,n as parseTimeoutSecEnvMs,W as parseToolInputWithSalvage,bb as recordRetry,cb as recordUsage,c as redactScopedProviderCredential,Aa as registerCustomProviders,Ja as registerModelProvider,t as removeCacheEntry,o as resolveLlmTimeoutConfig,Ua as resolveModelCapabilities,T as resolvePromptCacheDisabled,Pa as resolveProvider,Ta as resolveProviderModelDescriptors,G as resolveReasoningEffort,H as resolveReasoningEffortForModelSwitch,J as resolveThinkingBudget,Ya as resolveWireEffort,Q as resolveWorkflowMaxConcurrency,Z as runVerifyCredential,a as runWithProviderCredential,R as runWithScopedConfig,u as sanitizeCapabilityCache,gb as sideQuery,ca as stripCacheBoundaries,m as timeoutSecToMs,ya as validateCustomProviderConfig,Wa as verifyProviderCredential};
2
+ import{$,$a,A,Aa,B,Ba,C,Ca,D,Da,E,Ea,F,Fa,G,Ga,H,Ha,I,Ia,J,Ja,K,Ka,L,La,M,Ma,N,Na,O,Oa,P,Pa,Q,Qa,R,Ra,S,Sa,T,Ta,U,Ua,V,Va,W,Wa,X,Xa,Y,Ya,Z,Za,_,_a,a,aa,ab,b,ba,bb,c,ca,cb,d,da,db,e,ea,eb,f,fa,fb,g,ga,gb,h,ha,i,ia,j,ja,k,ka,l,la,m,ma,n,na,o,oa,p,pa,q,qa,r,ra,s,sa,t,ta,u,ua,v,va,w,wa,x,xa,y,ya,z,za}from"./chunk-SKELDH3G.js";import"./chunk-ONUPGMER.js";export{Za as DEFAULT_COST_RATES,l as KODAX_API_MIN_INTERVAL,j as KODAX_CAPPED_MAX_OUTPUT_TOKENS,ma as KODAX_DEFAULT_PROVIDER,x as KODAX_DEFAULT_THINKING_BUDGETS,k as KODAX_ESCALATED_MAX_OUTPUT_TOKENS,i as KODAX_MAX_TOKENS,la as KODAX_PROVIDERS,ka as KODAX_PROVIDER_SNAPSHOTS,v as KODAX_REASONING_MODE_SEQUENCE,y as KODAX_REASONING_SAFETY_RESERVE,w as KODAX_STABLE_EFFORT_INTENTS,fa as KodaXAcpProvider,da as KodaXAnthropicCompatProvider,V as KodaXBaseProvider,d as KodaXError,g as KodaXNetworkError,ea as KodaXOpenAICompatProvider,e as KodaXProviderError,f as KodaXRateLimitError,h as KodaXToolCallIdError,P as WORKFLOW_MAX_CONCURRENCY_ABSOLUTE,O as WORKFLOW_MAX_CONCURRENCY_DEFAULT,s as addRejectedEffort,$a as calculateCost,p as capabilityCacheKey,K as clampThinkingBudget,X as classifyStopReason,_ as classifyVerifyError,Oa as clearRuntimeModelProviders,ab as createCostTracker,za as createCustomProvider,E as effortToLegacyReasoningMode,N as extractHeadersFromError,eb as formatCost,fb as formatCostReport,Ra as getAvailableProviderNames,ga as getCodexCliDefaultModel,ia as getCodexCliKnownModels,_a as getCostRate,Ha as getCustomModelCapabilities,Ba as getCustomProvider,Ea as getCustomProviderList,Ga as getCustomProviderModelDescriptors,Fa as getCustomProviderModels,Da as getCustomProviderNames,I as getDefaultThinkingDepthForMode,ha as getGeminiCliDefaultModel,ja as getGeminiCliKnownModels,wa as getModelCapabilities,na as getProvider,ra as getProviderConfiguredCapabilityProfile,qa as getProviderConfiguredReasoningCapability,Sa as getProviderCredentialEnvironmentNames,sa as getProviderList,pa as getProviderModel,va as getProviderModelDescriptors,ta as getProviderModels,z as getReasoningCapability,r as getRejectedEfforts,S as getRunScopedConfig,Ka as getRuntimeModelProvider,Na as getRuntimeModelProviderCredentialEnvironmentNames,Ma as getRuntimeModelProviderNames,b as getScopedProviderCredential,db as getSummary,$ as insertCacheBoundary,aa as isCacheBoundary,Y as isCleanStop,Ca as isCustomProviderName,Qa as isKnownProvider,oa as isProviderConfigured,ua as isProviderName,A as isReasoningEnabled,La as isRuntimeModelProviderName,Va as listAllModelCapabilities,xa as listBuiltinModelCapabilities,Ia as listCustomProviderModelCapabilities,Xa as listProviderModels,ba as lowerCacheBoundaries,L as mapDepthToOpenAIReasoningEffort,D as mapLegacyReasoningModeToEffortIntent,q as narrowReasoningProfile,U as normalizeCapabilityProfile,C as normalizeReasoningEffortValue,B as normalizeReasoningRequest,F as parseReasoningEffortEnv,M as parseRetryAfter,n as parseTimeoutSecEnvMs,W as parseToolInputWithSalvage,bb as recordRetry,cb as recordUsage,c as redactScopedProviderCredential,Aa as registerCustomProviders,Ja as registerModelProvider,t as removeCacheEntry,o as resolveLlmTimeoutConfig,Ua as resolveModelCapabilities,T as resolvePromptCacheDisabled,Pa as resolveProvider,Ta as resolveProviderModelDescriptors,G as resolveReasoningEffort,H as resolveReasoningEffortForModelSwitch,J as resolveThinkingBudget,Ya as resolveWireEffort,Q as resolveWorkflowMaxConcurrency,Z as runVerifyCredential,a as runWithProviderCredential,R as runWithScopedConfig,u as sanitizeCapabilityCache,gb as sideQuery,ca as stripCacheBoundaries,m as timeoutSecToMs,ya as validateCustomProviderConfig,Wa as verifyProviderCredential};
@@ -0,0 +1,2 @@
1
+ // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
+ import{j as a}from"./chunk-XKLVC7F6.js";import"./chunk-JS4RSF4B.js";import"./chunk-ZQNOEKOB.js";import"./chunk-DB4O33RR.js";import"./chunk-GRJ7NKWP.js";import"./chunk-SKELDH3G.js";import"./chunk-ITP7J5HX.js";import"./chunk-XH7UM4GO.js";import"./chunk-ONUPGMER.js";export{a as startManagedWorkflow};
@@ -0,0 +1,2 @@
1
+ // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
+ import{I as a,J as b}from"./chunk-ZQNOEKOB.js";import"./chunk-DB4O33RR.js";import"./chunk-GRJ7NKWP.js";import"./chunk-SKELDH3G.js";import"./chunk-ITP7J5HX.js";import"./chunk-XH7UM4GO.js";import"./chunk-ONUPGMER.js";export{a as createWorkflowRunManager,b as getDefaultWorkflowRunManager};
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{$ as N,A as m,B as n,C as o,D as p,E as q,F as r,G as s,H as t,I as u,J as v,K as w,L as x,M as y,N as z,O as A,P as B,Q as C,R as D,S as E,T as F,U as G,V as H,W as I,X as J,Y as K,Z as L,_ as M,aa as O,b as a,ba as P,c as b,ca as Q,da as R,ea as S,fa as T,ga as U,q as c,r as d,s as e,t as f,u as g,v as h,w as i,x as j,y as k,z as l}from"./chunk-AAFFS6RU.js";import"./chunk-XA4ENCAH.js";import"./chunk-Q6UAGROD.js";import"./chunk-UKCDCVMD.js";import"./chunk-HTVLCHWH.js";import"./chunk-XUKLF26Q.js";import"./chunk-U6HNMLNN.js";import"./chunk-GVGLYVG4.js";import"./chunk-TRNAWSXP.js";import"./chunk-G5FGIRDJ.js";import"./chunk-UH5WNJXF.js";import"./chunk-ONUPGMER.js";export{a as CONFIG_TEMPLATES,H as KODAX_CONFIG_ENV_BINDINGS,e as KODAX_CONFIG_FILE,c as KODAX_DIR,D as KODAX_EXAMPLE_CONFIG_FILE,E as KODAX_INTEGRATION_EXAMPLE_FILES,d as KODAX_SESSIONS_DIR,k as KODAX_VERSION,f as PREVIEW_MAX_LENGTH,I as applyConfigEnvironment,r as describeProviderCapabilitySummary,y as describeReasoningCapabilityControl,z as describeReasoningExecution,G as ensureExampleConfigFile,F as ensureExampleConfigFiles,S as formatProviderCapabilityDetailLines,R as formatProviderSourceKind,s as formatReasoningCapabilityShort,t as formatReasoningEffortForDisplay,w as formatReasoningEffortStatusLabel,b as getConfigTemplate,Q as getGitRoot,m as getProviderAvailableModels,o as getProviderCapabilityProfile,p as getProviderCapabilitySnapshot,T as getProviderCommonPolicyScenarios,A as getProviderList,l as getProviderModel,q as getProviderPolicyDecision,n as getProviderReasoningCapability,v as getProviderReasoningEffortCycle,u as getProviderReasoningEffortOptions,j as getVersion,g as hydrateProcessEnvFromShell,B as isProviderConfigured,C as loadConfig,J as prepareRuntimeConfig,U as rateLimitedCall,i as registerConfiguredCustomProviders,h as resetShellEnvironmentHydrationForTesting,L as resolveInitialEffortOverride,P as resolvePermissionModeEffort,x as resolveProviderReasoningRuntimeEffort,O as resolveRuntimeEffortSelection,N as resolveRuntimeModelSelection,M as resolveRuntimeProviderSelection,K as saveConfig};
2
+ import{$ as N,A as m,B as n,C as o,D as p,E as q,F as r,G as s,H as t,I as u,J as v,K as w,L as x,M as y,N as z,O as A,P as B,Q as C,R as D,S as E,T as F,U as G,V as H,W as I,X as J,Y as K,Z as L,_ as M,aa as O,b as a,ba as P,c as b,ca as Q,da as R,ea as S,fa as T,ga as U,q as c,r as d,s as e,t as f,u as g,v as h,w as i,x as j,y as k,z as l}from"./chunk-ASFCAPIG.js";import"./chunk-BCYJIACJ.js";import"./chunk-3PGNESV3.js";import"./chunk-XKLVC7F6.js";import"./chunk-JS4RSF4B.js";import"./chunk-ZQNOEKOB.js";import"./chunk-DB4O33RR.js";import"./chunk-GRJ7NKWP.js";import"./chunk-SKELDH3G.js";import"./chunk-ITP7J5HX.js";import"./chunk-XH7UM4GO.js";import"./chunk-ONUPGMER.js";export{a as CONFIG_TEMPLATES,H as KODAX_CONFIG_ENV_BINDINGS,e as KODAX_CONFIG_FILE,c as KODAX_DIR,D as KODAX_EXAMPLE_CONFIG_FILE,E as KODAX_INTEGRATION_EXAMPLE_FILES,d as KODAX_SESSIONS_DIR,k as KODAX_VERSION,f as PREVIEW_MAX_LENGTH,I as applyConfigEnvironment,r as describeProviderCapabilitySummary,y as describeReasoningCapabilityControl,z as describeReasoningExecution,G as ensureExampleConfigFile,F as ensureExampleConfigFiles,S as formatProviderCapabilityDetailLines,R as formatProviderSourceKind,s as formatReasoningCapabilityShort,t as formatReasoningEffortForDisplay,w as formatReasoningEffortStatusLabel,b as getConfigTemplate,Q as getGitRoot,m as getProviderAvailableModels,o as getProviderCapabilityProfile,p as getProviderCapabilitySnapshot,T as getProviderCommonPolicyScenarios,A as getProviderList,l as getProviderModel,q as getProviderPolicyDecision,n as getProviderReasoningCapability,v as getProviderReasoningEffortCycle,u as getProviderReasoningEffortOptions,j as getVersion,g as hydrateProcessEnvFromShell,B as isProviderConfigured,C as loadConfig,J as prepareRuntimeConfig,U as rateLimitedCall,i as registerConfiguredCustomProviders,h as resetShellEnvironmentHydrationForTesting,L as resolveInitialEffortOverride,P as resolvePermissionModeEffort,x as resolveProviderReasoningRuntimeEffort,O as resolveRuntimeEffortSelection,N as resolveRuntimeModelSelection,M as resolveRuntimeProviderSelection,K as saveConfig};