@kodax-ai/kodax 0.7.87 → 0.7.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/README.md +20 -12
- package/README_CN.md +5 -3
- package/dist/chunks/agent-ZVZPWX5T.js +2 -0
- package/dist/chunks/argument-completer-LF5FUYJI.js +2 -0
- package/dist/chunks/{chunk-U44C5STU.js → chunk-4Y6OSDZE.js} +1 -1
- package/dist/chunks/{chunk-XH7UM4GO.js → chunk-5247AKGN.js} +3 -3
- package/dist/chunks/{chunk-DB4O33RR.js → chunk-6MGD2A7Z.js} +220 -220
- package/dist/chunks/{chunk-ITP7J5HX.js → chunk-72H6JNPN.js} +142 -142
- package/dist/chunks/{chunk-BCYJIACJ.js → chunk-GSGNXLDU.js} +2 -2
- package/dist/chunks/{chunk-XKLVC7F6.js → chunk-L2SYMK46.js} +1 -1
- package/dist/chunks/{chunk-JS4RSF4B.js → chunk-O2ZV775M.js} +1 -1
- package/dist/chunks/{chunk-3PGNESV3.js → chunk-OG4ML65E.js} +11 -11
- package/dist/chunks/chunk-PROPMIT4.js +2 -0
- package/dist/chunks/{chunk-ZQNOEKOB.js → chunk-QCXFQFIO.js} +2 -2
- package/dist/chunks/{chunk-4OLXWSCQ.js → chunk-RGAMBFT4.js} +254 -254
- package/dist/chunks/chunk-TXZ2XYMA.js +320 -0
- package/dist/chunks/{chunk-SKELDH3G.js → chunk-UNEC2WXJ.js} +17 -17
- package/dist/chunks/{chunk-GRJ7NKWP.js → chunk-W5RPVR3O.js} +1 -1
- package/dist/chunks/{chunk-ASFCAPIG.js → chunk-WSDVHFBK.js} +2 -2
- package/dist/chunks/{chunk-YB7YVAPL.js → chunk-ZKJEAQHA.js} +4 -4
- package/dist/chunks/{chunk-7XTUXMAI.js → chunk-ZWRG2GHC.js} +3 -3
- package/dist/chunks/client-ZXBSEDS4.js +2 -0
- package/dist/chunks/compaction-config-HVHPJ6CS.js +2 -0
- package/dist/chunks/{construction-bootstrap-YTFOT4M2.js → construction-bootstrap-HUGXOAUK.js} +1 -1
- package/dist/chunks/dist-VH56OGLV.js +2 -0
- package/dist/chunks/{dist-X55TWIK4.js → dist-WILA35IA.js} +1 -1
- package/dist/chunks/host-33L5PX3J.js +2 -0
- package/dist/chunks/run-manager-OOMXDNDA.js +2 -0
- package/dist/chunks/utils-WCVYP3JY.js +2 -0
- package/dist/index.d.ts +14 -14
- package/dist/index.js +5 -5
- package/dist/kodax_bootstrap.js +1 -1
- package/dist/kodax_cli.js +1562 -1559
- package/dist/kodax_resume.js +35 -826
- package/dist/provider-capabilities.json +1156 -1118
- package/dist/runtime-worker.js +1254 -1253
- package/dist/sandbox-workspace-session.js +264 -264
- package/dist/sdk-a2a.d.ts +9 -9
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-agent.d.ts +12 -12
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +16 -16
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.d.ts +3 -3
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +12 -12
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-runtime.d.ts +11 -11
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-sandbox.js +1 -1
- package/dist/sdk-session.d.ts +5 -5
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +59 -59
- package/dist/types-chunks/{bash-prefix-extractor.d-B36OQwNA.d.ts → bash-prefix-extractor.d-DcHi4vz5.d.ts} +2 -2
- package/dist/types-chunks/{capsule.d-DEncDNzD.d.ts → capsule.d-CjNNucoy.d.ts} +2 -2
- package/dist/types-chunks/{controller.d-C1YdP_pQ.d.ts → controller.d-BcUJlVOt.d.ts} +1 -1
- package/dist/types-chunks/{controller.d-Dif9pbC9.d.ts → controller.d-C-GjOuPV.d.ts} +8 -1
- package/dist/types-chunks/{guardrail.d-DhpnJv4Y.d.ts → guardrail.d-BuI5uypW.d.ts} +8 -2
- package/dist/types-chunks/{history-retrieval.d-YJQpQt7h.d.ts → history-retrieval.d-BjJTJtKF.d.ts} +1 -1
- package/dist/types-chunks/{public-api.d-D4q3WxKq.d.ts → public-api.d-hYcrNiNt.d.ts} +9 -4
- package/dist/types-chunks/{repl.d-D4ye29Kk.d.ts → repl.d-DSQdq_FY.d.ts} +5 -5
- package/dist/types-chunks/{review-inbox.d-C1_xZ-yg.d.ts → review-inbox.d-D2EtBlPt.d.ts} +1 -1
- package/dist/types-chunks/{run-manager.d-D30IvnwV.d.ts → run-manager.d-i7Q30bns.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-DIU6sHa2.d.ts → sdk-session-CAL2IZsM.d.ts} +2 -2
- package/dist/types-chunks/{shell-command-sets.d-rIHkZ_VR.d.ts → shell-command-sets.d-BLjNQYPi.d.ts} +1 -1
- package/dist/types-chunks/{types.d-sW-OqiFt.d.ts → types.d-BSFS8--Y.d.ts} +33 -2
- package/dist/types-chunks/{types.d-COhAF5Xo.d.ts → types.d-CqIcGQlc.d.ts} +1 -1
- package/dist/types-chunks/{types.d-Bz5Y-PD9.d.ts → types.d-DNIzbJD_.d.ts} +2 -2
- package/dist/types-chunks/{utils.d-B65ozSTV.d.ts → utils.d-CeM3tG-E.d.ts} +5 -5
- package/package.json +2 -2
- package/dist/chunks/agent-Z64QF7KG.js +0 -2
- package/dist/chunks/argument-completer-HIJBXRUT.js +0 -2
- package/dist/chunks/chunk-UWKM3HNY.js +0 -319
- package/dist/chunks/compaction-config-E4TFBCDJ.js +0 -2
- package/dist/chunks/dist-M3JV4PNA.js +0 -2
- package/dist/chunks/host-SJHHJBPB.js +0 -2
- package/dist/chunks/run-manager-T5QGWNON.js +0 -2
- package/dist/chunks/utils-2FHVIO6X.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{$ as To,$a as Za,Aa as Vt,Ba as Ea,Ca as xa,D as Mn,Da as Sa,E as On,Ea as _a,F as ra,Fa as yt,G as co,Ga as Ca,H as oa,Ha as Aa,Ia,Ja as Fa,K as ia,Ka as Ua,L as sa,La as Wa,M as aa,Ma as Ga,N as Gt,Na as Dn,O as uo,Oa as Ha,Pa as Va,Qa as qa,R as lo,Ra as Ka,S as fo,Sa as Xa,T as mo,Ta as Nn,U as po,Ua as Co,V as ma,Va as Ao,W as pa,Wa as za,Xa as Ya,Y as go,Ya as Ja,Z as ho,Za as Io,_a as Qa,a as Ie,ab as ec,ba as vo,ca as ga,da as ha,ea as yo,f as Ar,fa as ko,h as Is,i as Ir,ja as Ht,k as Mr,l as vn,la as Ta,ma as va,na as wo,o as jt,pa as Ro,ra as bo,sa as ya,ta as ka,va as Eo,wa,xa as xo,xc as tc,ya as Ra,yc as $e,z as ao,za as ba}from"./chunk-3PGNESV3.js";import{a as So}from"./chunk-JS4RSF4B.js";import{A as _o,o as Da,t as Na,u as $a,v as La,y as ja}from"./chunk-ZQNOEKOB.js";import{$b as no,Ba as Rn,Bd as Be,Cd as io,D as Ls,F as Nr,G as $r,Ha as Ut,I as Lr,Ia as Vr,Jd as so,Ka as qr,Kb as Ys,La as Kr,Lb as Js,Mb as Qs,Na as Xr,Oa as zr,Od as na,Pb as xn,Qd as ca,Rb as Sn,Rd as da,S as Bs,Sa as Yr,Sb as _n,Sd as ua,T as Fs,Td as la,V as Us,Va as Jr,Vb as Cn,W as Ws,Wb as An,Wd as fa,X as jr,Y as Gs,Yb as to,Yc as ro,Za as bn,Zb as je,_a as En,a as Tn,ac as Zs,b as As,bb as Qr,da as kn,eb as Zr,fa as Br,fb as eo,ga as Fr,gb as zs,ha as wn,ia as Hs,id as ea,ie as Ma,ja as Ur,jd as ta,ka as Wr,l as Or,la as Vs,ma as tt,nd as In,o as Ms,oa as qs,od as Wt,oe as Oa,p as Pr,pe as Pn,q as Os,qe as Pa,s as Ps,sd as oo,se as Ba,t as Ds,u as yn,ua as Gr,v as Ns,va as Hr,w as Bt,wa as Ks,x as $s,xa as Xs,z as Dr,za as Ft,zb as Me}from"./chunk-DB4O33RR.js";import{h as js}from"./chunk-GRJ7NKWP.js";import{D as Je,Pa as we,R as Vi,T as un,ab as vr,bb as ln,cb as yr,db as kr,e as Tr,fb as wr,gb as qi,k as dn,na as Qe,ua as Ze}from"./chunk-SKELDH3G.js";import{Aa as br,Ab as cs,B as Xi,Db as ds,Eb as us,Ga as es,Gb as ls,Ia as Er,Jb as xr,Kb as Sr,Ke as hn,L as zi,Nb as Tt,O as Yi,Ob as fs,Td as ms,Xd as ps,Yd as gs,Yf as vt,Zf as bs,ef as hs,fb as ts,g as fn,ha as Rr,ib as ns,ig as Es,k as ne,l as Le,mg as xs,nf as _r,ng as Ss,o as Lt,of as Ts,pf as vs,pg as _s,q as mn,qb as Ae,r as Ki,rf as ys,sb as rs,sf as ks,t as et,ta as ht,tf as ws,ua as Ji,uf as Rs,vb as as,vf as Cr,vg as Cs,wa as Qi,za as Zi}from"./chunk-ITP7J5HX.js";import{K as ss,h as pn,j as gn,k as os,p as is}from"./chunk-XH7UM4GO.js";import{a as o}from"./chunk-ONUPGMER.js";var qt=class extends Error{static{o(this,"KodaXError")}code;constructor(t,n="KODAX_ERROR"){super(t),this.code=n,this.name="KodaXError"}};var Mo=class extends qt{static{o(this,"KodaXToolError")}toolName;toolId;constructor(t,n,r){super(t,"TOOL_ERROR"),this.toolName=n,this.toolId=r,this.name="KodaXToolError"}};var Oo=class extends qt{static{o(this,"KodaXSessionError")}sessionId;constructor(t,n){super(t,"SESSION_ERROR"),this.sessionId=n,this.name="KodaXSessionError"}},Po=class extends qt{static{o(this,"KodaXTerminalError")}suggestions;constructor(t,n=[]){super(t,"TERMINAL_ERROR"),this.name="KodaXTerminalError",this.suggestions=n}};function Gl(){return new $n}o(Gl,"createSessionControl");function Do(e,t){let n=new AbortController,r=!1,i=o(p=>{r||(r=!0,n.abort(p))},"markAborted");e.abortSignal&&(e.abortSignal.aborted?i(e.abortSignal.reason):e.abortSignal.addEventListener("abort",()=>i(e.abortSignal.reason),{once:!0}));let s=new $n;s.seed({provider:e.provider,model:e.modelOverride??e.model,reasoning:e.reasoningMode});let a=e.session?.id,c=a!=null,d=a??Hl(),f=!c&&e.session?.autoResume!==!0&&e.session?.resume!==!0?Ja({...e.session??{},id:d}):e.session,l={...e,...e.agentMode!==void 0?{agentMode:jt(e.agentMode)}:{},...f!==void 0?{session:f}:{},abortSignal:n.signal,sessionControl:s},g=$e(l,t);return{id:d,get currentProvider(){return s.getProvider()},get currentModel(){return s.getModel()},get currentReasoning(){return s.getReasoning()},get aborted(){return r},get attached(){return s.isAttached()},setProvider:o(p=>s.setProvider(p),"setProvider"),setModel:o(p=>s.setModel(p),"setModel"),setReasoning:o(p=>s.setReasoning(p),"setReasoning"),abort:o(p=>i(p),"abort"),result:g}}o(Do,"startKodaX");function Hl(){return`sess_${Date.now()}_${Math.random().toString(36).slice(2,10)}`}o(Hl,"generateSessionId");var $n=class{static{o(this,"SessionControlImpl")}mutators=null;providerValue;modelValue;reasoningValue;hasPendingProvider=!1;hasPendingModel=!1;hasPendingReasoning=!1;seed(t){this.providerValue=t.provider,this.modelValue=t.model,this.reasoningValue=t.reasoning}setProvider(t){this.providerValue=t,this.mutators?this.mutators.setProvider(t):this.hasPendingProvider=!0}setModel(t){this.modelValue=t,this.mutators?this.mutators.setModel(t):this.hasPendingModel=!0}setReasoning(t){this.reasoningValue=t,this.mutators?this.mutators.setReasoning(t):this.hasPendingReasoning=!0}getProvider(){return this.providerValue??""}getModel(){return this.modelValue}getReasoning(){return this.reasoningValue}isAttached(){return this.mutators!==null}_attach(t){this.mutators,this.mutators=t,this.hasPendingProvider&&this.providerValue!==void 0&&t.setProvider(this.providerValue),this.hasPendingModel&&t.setModel(this.modelValue),this.hasPendingReasoning&&t.setReasoning(this.reasoningValue),this.hasPendingProvider=!1,this.hasPendingModel=!1,this.hasPendingReasoning=!1}};function Vl(e,t){return e.kind!=="revise_count"?{ok:!0}:e.count<=3?{ok:!0}:{ok:!1,severity:"warn",reason:`boundedRevise: revise_count for harness="${e.harness}" reached ${e.count}, exceeding soft threshold 3`}}o(Vl,"observe");var No={id:"boundedRevise",description:"Per-harness revise count must stay within the soft threshold; crossings emit a warn signal for dispatch-eval (hard cap enforced by the budget controller).",observe:Vl};function ql(e,t){return typeof e.maxBudget!="number"?{ok:!0}:e.maxBudget<=t.systemCap.maxBudget?{ok:!0}:{ok:!1,severity:"clamp",reason:`budgetCeiling: manifest.maxBudget=${e.maxBudget} exceeds systemCap.maxBudget=${t.systemCap.maxBudget}`,patch:{clampMaxBudget:t.systemCap.maxBudget}}}o(ql,"admit");var $o={id:"budgetCeiling",description:"manifest.maxBudget must be \u2264 systemCap.maxBudget; over-cap declarations are clamped down to the cap.",admit:ql};function Kl(e,t){return{ok:!0}}o(Kl,"observe");var nc={id:"harnessSelectionTiming",description:"FEATURE_193 V2 no-op shell \u2014 predicate always admits since V1 Scout retired. Kept registered for admission-framework / audit-array compat.",observe:Kl};function Xl(e,t){if(e.kind!=="mutation_recorded")return{ok:!0};let n=t.recorder;return typeof n.todoUpdateCount!="number"?{ok:!0}:n.todoUpdateCount>0?{ok:!0}:n.workerTrivialDeclaration===!0?{ok:!0}:{ok:!1,severity:"warn",reason:`planBeforeMutate: Worker mutated ${e.file} without a prior todo_update plan commit and without a trivial declaration`}}o(Xl,"observe");var rc={id:"planBeforeMutate",description:"Worker mutations should be preceded by a todo_update plan commit (or an explicit trivial declaration). Missing plan is a warn-only signal in v0.7.36.",observe:Xl};function Lo(e){switch(e){case"read":case"glob":case"grep":case"code_search":case"semantic_lookup":case"lsp_definition":case"lsp_hover":case"lsp_references":case"lsp_document_symbols":case"lsp_workspace_symbols":case"lsp_implementation":case"lsp_prepare_call_hierarchy":case"lsp_incoming_calls":case"lsp_outgoing_calls":case"repo_overview":case"changed_scope":case"changed_diff":case"changed_diff_bundle":case"module_context":case"symbol_context":case"process_context":case"impact_estimate":case"relationship_scan":case"cyclic_dependencies":case"ask_user_question":case"exit_plan_mode":return"read";case"write":case"edit":case"multi_edit":case"insert_after_anchor":case"undo":return"edit";case"bash":return"bash:mutating";case"web_search":case"web_fetch":case"mcp_search":case"mcp_describe":case"mcp_call":case"mcp_read_resource":case"mcp_get_prompt":return"bash:network";case"spawn_agent":case"send_message":case"followup_task":case"wait_agent":case"interrupt_agent":case"list_agents":case"agent_output":case"emit_verdict":case"scaffold_tool":case"validate_tool":case"stage_construction":case"test_tool":case"activate_tool":case"scaffold_agent":case"validate_agent":case"stage_agent_construction":case"test_agent":case"activate_agent":case"worktree_create":case"worktree_remove":return"subagent";default:return"subagent"}}o(Lo,"resolveToolCapability");function zl(e){if(typeof e=="object"&&e!==null&&"name"in e){let t=e.name;if(typeof t=="string"&&t.length>0)return t}}o(zl,"getToolName");function Yl(e,t){if(!e.tools||e.tools.length===0)return{ok:!0};let n=new Set(t.systemCap.allowedToolCapabilities),r=[];for(let a of e.tools){let c=zl(a);if(!c)continue;let d=Lo(c);n.has(d)||r.push({name:c,capability:d})}if(r.length===0)return{ok:!0};let i=r.map(a=>a.name);return{ok:!1,severity:"clamp",reason:`toolPermission: tools requiring disallowed capabilities \u2014 ${r.map(a=>`${a.name}=${a.capability}`).join(", ")}`,patch:{removeTools:i}}}o(Yl,"admit");var jo={id:"toolPermission",description:"Every tool in manifest.tools must resolve to a capability tier that systemCap.allowedToolCapabilities permits; offending tools are clamped via removeTools.",admit:Yl};var oc=[$o,jo,No,nc,rc];function Jl(){es();for(let e of oc)Yi(e)}o(Jl,"registerCodingInvariants");var Ln=class{static{o(this,"KodaXClient")}options;sessionId;messages=[];contextTokenSnapshot;constructor(t){this.options=t,this.sessionId=t.session?.id??"",this.messages=t.session?.initialMessages?[...t.session.initialMessages]:[],this.contextTokenSnapshot=t.context?.contextTokenSnapshot}async send(t){let n=this.messages.length>0?this.messages:this.options.session?.initialMessages,r=await $e({...this.options,session:{...this.options.session,id:this.sessionId||void 0,initialMessages:n},context:{...this.options.context,contextTokenSnapshot:this.contextTokenSnapshot}},t);return this.sessionId=r.sessionId,this.messages=r.messages,this.contextTokenSnapshot=r.contextTokenSnapshot,r}getSessionId(){return this.sessionId}getMessages(){return[...this.messages]}clear(){this.messages=[],this.sessionId="",this.contextTokenSnapshot=void 0}};function ic(e){return/\bworkflows?\b|工作流(?!程)|ワークフロー|워크플로우/iu.test(e)}o(ic,"hasExplicitNaturalLanguageWorkflowIntent");function Lv(e){return{action:e.source==="command"?"suggest":"none"}}o(Lv,"decideWorkflowInvocation");function jv(e){return e.outcome==="started"||e.outcome==="cancelled"}o(jv,"workflowStartOutcomeConsumesTurn");var Ql="KODAX_VERIFIER_PROVIDER",Zl="KODAX_VERIFIER_MODEL";function ef(e){if(Ze(e))try{return Qe(e)}catch{return}}o(ef,"tryGetProvider");function jn(e){let t=e.env??process.env,n=t[Ql],r=t[Zl];if(n&&r){let i=ef(n);if(i)return{provider:i,model:r,providerName:n,source:"explicit-env"}}return{provider:e.mainProvider,model:e.mainModel,providerName:e.mainProviderName,source:"inherit-main"}}o(jn,"resolveVerifierProvider");function Bo(e){let t=e.context?.agentProfile;if(!t)return;let n=t.verification,r=e.context?.taskVerification;if(!n&&!r)return;let i={...n,...r};return Array.isArray(r?.criteria)&&r.criteria.length===0&&Array.isArray(n?.criteria)&&n.criteria.length>0?{...i,criteria:n.criteria}:i}o(Bo,"resolveEffectiveVerification");function tf(e){let t=e.provider??"anthropic";if(Ze(t))try{let n=jn({mainProvider:Qe(t),mainProviderName:t,mainModel:e.modelOverride??e.model});return{provider:n.providerName,...n.model!==void 0?{model:n.model}:{}}}catch{return}}o(tf,"resolveVerifierAttribution");function Fo(e,t){let n=e.events?.onEffectiveConfig;if(!n)return;let r=t.verifier??tf(e),i={agentMode:t.agentMode,agentProfile:e.context?.agentProfile,toolScope:t.toolScope,verification:Bo(e),...r?{verifier:r}:{}};try{n(i)}catch{}}o(Fo,"emitEffectiveTaskConfig");var sc="kodax-review-findings",ac="kodax-investigation-shards",cc="kodax-lookup-shards",dc="kodax-child-result";var uc="kodax-budget-request";function nt(e,t=!1){return{globalWorkBudget:e?.totalBudget,budgetUsage:e?.spentBudget,budgetApprovalRequired:t}}o(nt,"buildManagedStatusBudgetFields");function Kt(e,t=1){e.spentBudget=Math.max(0,e.spentBudget+t)}o(Kt,"incrementManagedBudgetUsage");function rf(e,t=200){e.totalBudget+=t}o(rf,"extendManagedWorkBudget");function Fn(e,t,n=!1){if(!e?.askUser)return!1;if(!n){let r=Math.ceil(t.totalBudget*.9);if(t.spentBudget<r)return!1}return t.lastApprovalBudgetTotal!==t.totalBudget}o(Fn,"canRequestAdditionalWorkBudget");async function Uo(e,t,n){let r=e?.askUser;if(!r||!Fn(e,t,n.force))return"skipped";let i=n.additionalUnits??200,s=Math.min(100,Math.round(t.spentBudget/Math.max(1,t.totalBudget)*100)),a=/[\u4e00-\u9fff]/.test(n.originalTask??n.summary),c=Ae(await r({question:a?`\u5F53\u524D AMA \u8FD0\u884C\u5DF2\u4F7F\u7528 ${t.spentBudget}/${t.totalBudget} \u5DE5\u4F5C\u5355\u5143\uFF08${s}%\uFF09\uFF0C\u9700\u8981\u66F4\u591A\u5DE5\u4F5C\u91CF\u3002\u662F\u5426\u8FFD\u52A0 ${i} \u5355\u5143\uFF1F`:`This AMA run has used ${t.spentBudget}/${t.totalBudget} work units (${s}%) and needs more work. Add ${i} more work units?`,allowCustomInput:!1,options:[{label:a?`\u7EE7\u7EED (+${i})`:`Continue (+${i})`,value:"continue",description:a?`\u8FFD\u52A0 ${i} \u5DE5\u4F5C\u5355\u5143\uFF0C\u4ECE\u7B2C ${n.currentRound}/${n.maxRounds} \u8F6E\u7EE7\u7EED\u3002`:`Grant ${i} more work units and continue from round ${n.currentRound}/${n.maxRounds}.`},{label:a?"\u505C\u6B62":"Stop here",value:"stop",description:a?`\u4F7F\u7528\u5F53\u524D\u6700\u4F73\u7ED3\u679C\u3002\u6700\u65B0\u8FDB\u5C55\uFF1A${co(n.summary,80)}`:`Finish now with the current best result. Latest note: ${co(n.summary,80)}`}],default:"continue"})),d=t.totalBudget;return c==="continue"?(t.lastApprovalBudgetTotal=d,rf(t,i),"approved"):(t.lastApprovalBudgetTotal=d,"denied")}o(Uo,"maybeRequestAdditionalWorkBudget");import{readdir as cf,readFile as fc,stat as df}from"node:fs/promises";import{execFile as uf}from"node:child_process";import{promisify as lf}from"node:util";import kt from"node:path";import Wo from"node:path";import{mkdir as of,unlink as sf,writeFile as af}from"node:fs/promises";function Fe(e){return e.context?.taskSurface??"cli"}o(Fe,"getManagedTaskSurface");function Ue(e,t){if(e.context?.managedTaskWorkspaceDir?.trim())return Wo.resolve(e.context.managedTaskWorkspaceDir);let n=e.context?.executionCwd??e.context?.gitRoot??process.cwd();return Wo.resolve(n,".agent","managed-tasks")}o(Ue,"getManagedTaskWorkspaceRoot");async function Q(e,t,n="utf8"){await Or(e,async()=>{await of(Wo.dirname(e),{recursive:!0}),await af(e,t,"utf8")})}o(Q,"writeManagedTaskFile");async function lc(e){await Or(e,async()=>{try{await sf(e)}catch(t){if(t.code!=="ENOENT")throw t}})}o(lc,"deleteManagedTaskFile");var ff=lf(uf),mc=3600*1e3,Un="checkpoint.json";function Go(e){let t=e.session?.id?.trim();return t||void 0}o(Go,"getCheckpointSessionId");function mf(e,t){return t?e.sessionId===t:!1}o(mf,"checkpointBelongsToSession");async function Wn(e){let t=kt.resolve(e?.trim()||process.cwd());try{let{stdout:n}=await ff("git",["rev-parse","--short","HEAD"],{cwd:t,windowsHide:!0});return n.trim()||void 0}catch{return}}o(Wn,"getGitHeadCommit");async function Ho(e,t){await Q(kt.join(e,Un),`${JSON.stringify(t,null,2)}
|
|
2
|
+
import{$ as To,$a as Za,Aa as Vt,Ba as Ea,Ca as xa,D as Mn,Da as Sa,E as On,Ea as _a,F as ra,Fa as yt,G as co,Ga as Ca,H as oa,Ha as Aa,Ia,Ja as Fa,K as ia,Ka as Ua,L as sa,La as Wa,M as aa,Ma as Ga,N as Gt,Na as Dn,O as uo,Oa as Ha,Pa as Va,Qa as qa,R as lo,Ra as Ka,S as fo,Sa as Xa,T as mo,Ta as Nn,U as po,Ua as Co,V as ma,Va as Ao,W as pa,Wa as za,Xa as Ya,Y as go,Ya as Ja,Z as ho,Za as Io,_a as Qa,a as Ie,ab as ec,ba as vo,ca as ga,da as ha,ea as yo,f as Ar,fa as ko,h as Is,i as Ir,ja as Ht,k as Mr,l as vn,la as Ta,ma as va,na as wo,o as jt,pa as Ro,ra as bo,sa as ya,ta as ka,va as Eo,wa,xa as xo,xc as tc,ya as Ra,yc as $e,z as ao,za as ba}from"./chunk-OG4ML65E.js";import{a as So}from"./chunk-O2ZV775M.js";import{A as _o,o as Da,t as Na,u as $a,v as La,y as ja}from"./chunk-QCXFQFIO.js";import{$b as no,Ba as Rn,Bd as Be,Cd as io,D as Ls,F as Nr,G as $r,Ha as Ut,I as Lr,Ia as Vr,Jd as so,Ka as qr,Kb as Ys,La as Kr,Lb as Js,Mb as Qs,Na as Xr,Oa as zr,Od as na,Pb as xn,Qd as ca,Rb as Sn,Rd as da,S as Bs,Sa as Yr,Sb as _n,Sd as ua,T as Fs,Td as la,V as Us,Va as Jr,Vb as Cn,W as Ws,Wb as An,Wd as fa,X as jr,Y as Gs,Yb as to,Yc as ro,Za as bn,Zb as je,_a as En,a as Tn,ac as Zs,b as As,bb as Qr,da as kn,eb as Zr,fa as Br,fb as eo,ga as Fr,gb as zs,ha as wn,he as Ma,ia as Hs,id as ea,ja as Ur,jd as ta,ka as Wr,l as Or,la as Vs,ma as tt,nd as In,ne as Oa,o as Ms,oa as qs,od as Wt,oe as Pn,p as Pr,pe as Pa,q as Os,re as Ba,s as Ps,sd as oo,t as Ds,u as yn,ua as Gr,v as Ns,va as Hr,w as Bt,wa as Ks,x as $s,xa as Xs,z as Dr,za as Ft,zb as Me}from"./chunk-6MGD2A7Z.js";import{h as js}from"./chunk-W5RPVR3O.js";import{D as Je,Pa as we,R as Vi,T as un,ab as vr,bb as ln,cb as yr,db as kr,e as Tr,fb as wr,gb as qi,k as dn,na as Qe,ua as Ze}from"./chunk-UNEC2WXJ.js";import{Aa as br,Ab as cs,B as Xi,Db as ds,Eb as us,Ga as es,Gb as ls,Ia as Er,Jb as xr,Kb as Sr,Ke as hn,L as zi,Nb as Tt,O as Yi,Ob as fs,Td as ms,Xd as ps,Yd as gs,Yf as vt,Zf as bs,ef as hs,fb as ts,g as fn,ha as Rr,ib as ns,ig as Es,k as ne,l as Le,mg as xs,nf as _r,ng as Ss,o as Lt,of as Ts,pf as vs,pg as _s,q as mn,qb as Ae,r as Ki,rf as ys,sb as rs,sf as ks,t as et,ta as ht,tf as ws,ua as Ji,uf as Rs,vb as as,vf as Cr,vg as Cs,wa as Qi,za as Zi}from"./chunk-72H6JNPN.js";import{K as ss,h as pn,j as gn,k as os,p as is}from"./chunk-5247AKGN.js";import{a as o}from"./chunk-ONUPGMER.js";var qt=class extends Error{static{o(this,"KodaXError")}code;constructor(t,n="KODAX_ERROR"){super(t),this.code=n,this.name="KodaXError"}};var Mo=class extends qt{static{o(this,"KodaXToolError")}toolName;toolId;constructor(t,n,r){super(t,"TOOL_ERROR"),this.toolName=n,this.toolId=r,this.name="KodaXToolError"}};var Oo=class extends qt{static{o(this,"KodaXSessionError")}sessionId;constructor(t,n){super(t,"SESSION_ERROR"),this.sessionId=n,this.name="KodaXSessionError"}},Po=class extends qt{static{o(this,"KodaXTerminalError")}suggestions;constructor(t,n=[]){super(t,"TERMINAL_ERROR"),this.name="KodaXTerminalError",this.suggestions=n}};function Gl(){return new $n}o(Gl,"createSessionControl");function Do(e,t){let n=new AbortController,r=!1,i=o(p=>{r||(r=!0,n.abort(p))},"markAborted");e.abortSignal&&(e.abortSignal.aborted?i(e.abortSignal.reason):e.abortSignal.addEventListener("abort",()=>i(e.abortSignal.reason),{once:!0}));let s=new $n;s.seed({provider:e.provider,model:e.modelOverride??e.model,reasoning:e.reasoningMode});let a=e.session?.id,c=a!=null,d=a??Hl(),f=!c&&e.session?.autoResume!==!0&&e.session?.resume!==!0?Ja({...e.session??{},id:d}):e.session,l={...e,...e.agentMode!==void 0?{agentMode:jt(e.agentMode)}:{},...f!==void 0?{session:f}:{},abortSignal:n.signal,sessionControl:s},g=$e(l,t);return{id:d,get currentProvider(){return s.getProvider()},get currentModel(){return s.getModel()},get currentReasoning(){return s.getReasoning()},get aborted(){return r},get attached(){return s.isAttached()},setProvider:o(p=>s.setProvider(p),"setProvider"),setModel:o(p=>s.setModel(p),"setModel"),setReasoning:o(p=>s.setReasoning(p),"setReasoning"),abort:o(p=>i(p),"abort"),result:g}}o(Do,"startKodaX");function Hl(){return`sess_${Date.now()}_${Math.random().toString(36).slice(2,10)}`}o(Hl,"generateSessionId");var $n=class{static{o(this,"SessionControlImpl")}mutators=null;providerValue;modelValue;reasoningValue;hasPendingProvider=!1;hasPendingModel=!1;hasPendingReasoning=!1;seed(t){this.providerValue=t.provider,this.modelValue=t.model,this.reasoningValue=t.reasoning}setProvider(t){this.providerValue=t,this.mutators?this.mutators.setProvider(t):this.hasPendingProvider=!0}setModel(t){this.modelValue=t,this.mutators?this.mutators.setModel(t):this.hasPendingModel=!0}setReasoning(t){this.reasoningValue=t,this.mutators?this.mutators.setReasoning(t):this.hasPendingReasoning=!0}getProvider(){return this.providerValue??""}getModel(){return this.modelValue}getReasoning(){return this.reasoningValue}isAttached(){return this.mutators!==null}_attach(t){this.mutators,this.mutators=t,this.hasPendingProvider&&this.providerValue!==void 0&&t.setProvider(this.providerValue),this.hasPendingModel&&t.setModel(this.modelValue),this.hasPendingReasoning&&t.setReasoning(this.reasoningValue),this.hasPendingProvider=!1,this.hasPendingModel=!1,this.hasPendingReasoning=!1}};function Vl(e,t){return e.kind!=="revise_count"?{ok:!0}:e.count<=3?{ok:!0}:{ok:!1,severity:"warn",reason:`boundedRevise: revise_count for harness="${e.harness}" reached ${e.count}, exceeding soft threshold 3`}}o(Vl,"observe");var No={id:"boundedRevise",description:"Per-harness revise count must stay within the soft threshold; crossings emit a warn signal for dispatch-eval (hard cap enforced by the budget controller).",observe:Vl};function ql(e,t){return typeof e.maxBudget!="number"?{ok:!0}:e.maxBudget<=t.systemCap.maxBudget?{ok:!0}:{ok:!1,severity:"clamp",reason:`budgetCeiling: manifest.maxBudget=${e.maxBudget} exceeds systemCap.maxBudget=${t.systemCap.maxBudget}`,patch:{clampMaxBudget:t.systemCap.maxBudget}}}o(ql,"admit");var $o={id:"budgetCeiling",description:"manifest.maxBudget must be \u2264 systemCap.maxBudget; over-cap declarations are clamped down to the cap.",admit:ql};function Kl(e,t){return{ok:!0}}o(Kl,"observe");var nc={id:"harnessSelectionTiming",description:"FEATURE_193 V2 no-op shell \u2014 predicate always admits since V1 Scout retired. Kept registered for admission-framework / audit-array compat.",observe:Kl};function Xl(e,t){if(e.kind!=="mutation_recorded")return{ok:!0};let n=t.recorder;return typeof n.todoUpdateCount!="number"?{ok:!0}:n.todoUpdateCount>0?{ok:!0}:n.workerTrivialDeclaration===!0?{ok:!0}:{ok:!1,severity:"warn",reason:`planBeforeMutate: Worker mutated ${e.file} without a prior todo_update plan commit and without a trivial declaration`}}o(Xl,"observe");var rc={id:"planBeforeMutate",description:"Worker mutations should be preceded by a todo_update plan commit (or an explicit trivial declaration). Missing plan is a warn-only signal in v0.7.36.",observe:Xl};function Lo(e){switch(e){case"read":case"glob":case"grep":case"code_search":case"semantic_lookup":case"lsp_definition":case"lsp_hover":case"lsp_references":case"lsp_document_symbols":case"lsp_workspace_symbols":case"lsp_implementation":case"lsp_prepare_call_hierarchy":case"lsp_incoming_calls":case"lsp_outgoing_calls":case"repo_overview":case"changed_scope":case"changed_diff":case"changed_diff_bundle":case"module_context":case"symbol_context":case"process_context":case"impact_estimate":case"relationship_scan":case"cyclic_dependencies":case"ask_user_question":case"exit_plan_mode":return"read";case"write":case"edit":case"multi_edit":case"insert_after_anchor":case"undo":return"edit";case"bash":return"bash:mutating";case"web_search":case"web_fetch":case"mcp_search":case"mcp_describe":case"mcp_call":case"mcp_read_resource":case"mcp_get_prompt":return"bash:network";case"spawn_agent":case"send_message":case"followup_task":case"wait_agent":case"interrupt_agent":case"list_agents":case"agent_output":case"emit_verdict":case"scaffold_tool":case"validate_tool":case"stage_construction":case"test_tool":case"activate_tool":case"scaffold_agent":case"validate_agent":case"stage_agent_construction":case"test_agent":case"activate_agent":case"worktree_create":case"worktree_remove":return"subagent";default:return"subagent"}}o(Lo,"resolveToolCapability");function zl(e){if(typeof e=="object"&&e!==null&&"name"in e){let t=e.name;if(typeof t=="string"&&t.length>0)return t}}o(zl,"getToolName");function Yl(e,t){if(!e.tools||e.tools.length===0)return{ok:!0};let n=new Set(t.systemCap.allowedToolCapabilities),r=[];for(let a of e.tools){let c=zl(a);if(!c)continue;let d=Lo(c);n.has(d)||r.push({name:c,capability:d})}if(r.length===0)return{ok:!0};let i=r.map(a=>a.name);return{ok:!1,severity:"clamp",reason:`toolPermission: tools requiring disallowed capabilities \u2014 ${r.map(a=>`${a.name}=${a.capability}`).join(", ")}`,patch:{removeTools:i}}}o(Yl,"admit");var jo={id:"toolPermission",description:"Every tool in manifest.tools must resolve to a capability tier that systemCap.allowedToolCapabilities permits; offending tools are clamped via removeTools.",admit:Yl};var oc=[$o,jo,No,nc,rc];function Jl(){es();for(let e of oc)Yi(e)}o(Jl,"registerCodingInvariants");var Ln=class{static{o(this,"KodaXClient")}options;sessionId;messages=[];contextTokenSnapshot;constructor(t){this.options=t,this.sessionId=t.session?.id??"",this.messages=t.session?.initialMessages?[...t.session.initialMessages]:[],this.contextTokenSnapshot=t.context?.contextTokenSnapshot}async send(t){let n=this.messages.length>0?this.messages:this.options.session?.initialMessages,r=await $e({...this.options,session:{...this.options.session,id:this.sessionId||void 0,initialMessages:n},context:{...this.options.context,contextTokenSnapshot:this.contextTokenSnapshot}},t);return this.sessionId=r.sessionId,this.messages=r.messages,this.contextTokenSnapshot=r.contextTokenSnapshot,r}getSessionId(){return this.sessionId}getMessages(){return[...this.messages]}clear(){this.messages=[],this.sessionId="",this.contextTokenSnapshot=void 0}};function ic(e){return/\bworkflows?\b|工作流(?!程)|ワークフロー|워크플로우/iu.test(e)}o(ic,"hasExplicitNaturalLanguageWorkflowIntent");function Lv(e){return{action:e.source==="command"?"suggest":"none"}}o(Lv,"decideWorkflowInvocation");function jv(e){return e.outcome==="started"||e.outcome==="cancelled"}o(jv,"workflowStartOutcomeConsumesTurn");var Ql="KODAX_VERIFIER_PROVIDER",Zl="KODAX_VERIFIER_MODEL";function ef(e){if(Ze(e))try{return Qe(e)}catch{return}}o(ef,"tryGetProvider");function jn(e){let t=e.env??process.env,n=t[Ql],r=t[Zl];if(n&&r){let i=ef(n);if(i)return{provider:i,model:r,providerName:n,source:"explicit-env"}}return{provider:e.mainProvider,model:e.mainModel,providerName:e.mainProviderName,source:"inherit-main"}}o(jn,"resolveVerifierProvider");function Bo(e){let t=e.context?.agentProfile;if(!t)return;let n=t.verification,r=e.context?.taskVerification;if(!n&&!r)return;let i={...n,...r};return Array.isArray(r?.criteria)&&r.criteria.length===0&&Array.isArray(n?.criteria)&&n.criteria.length>0?{...i,criteria:n.criteria}:i}o(Bo,"resolveEffectiveVerification");function tf(e){let t=e.provider??"anthropic";if(Ze(t))try{let n=jn({mainProvider:Qe(t),mainProviderName:t,mainModel:e.modelOverride??e.model});return{provider:n.providerName,...n.model!==void 0?{model:n.model}:{}}}catch{return}}o(tf,"resolveVerifierAttribution");function Fo(e,t){let n=e.events?.onEffectiveConfig;if(!n)return;let r=t.verifier??tf(e),i={agentMode:t.agentMode,agentProfile:e.context?.agentProfile,toolScope:t.toolScope,verification:Bo(e),...r?{verifier:r}:{}};try{n(i)}catch{}}o(Fo,"emitEffectiveTaskConfig");var sc="kodax-review-findings",ac="kodax-investigation-shards",cc="kodax-lookup-shards",dc="kodax-child-result";var uc="kodax-budget-request";function nt(e,t=!1){return{globalWorkBudget:e?.totalBudget,budgetUsage:e?.spentBudget,budgetApprovalRequired:t}}o(nt,"buildManagedStatusBudgetFields");function Kt(e,t=1){e.spentBudget=Math.max(0,e.spentBudget+t)}o(Kt,"incrementManagedBudgetUsage");function rf(e,t=200){e.totalBudget+=t}o(rf,"extendManagedWorkBudget");function Fn(e,t,n=!1){if(!e?.askUser)return!1;if(!n){let r=Math.ceil(t.totalBudget*.9);if(t.spentBudget<r)return!1}return t.lastApprovalBudgetTotal!==t.totalBudget}o(Fn,"canRequestAdditionalWorkBudget");async function Uo(e,t,n){let r=e?.askUser;if(!r||!Fn(e,t,n.force))return"skipped";let i=n.additionalUnits??200,s=Math.min(100,Math.round(t.spentBudget/Math.max(1,t.totalBudget)*100)),a=/[\u4e00-\u9fff]/.test(n.originalTask??n.summary),c=Ae(await r({question:a?`\u5F53\u524D AMA \u8FD0\u884C\u5DF2\u4F7F\u7528 ${t.spentBudget}/${t.totalBudget} \u5DE5\u4F5C\u5355\u5143\uFF08${s}%\uFF09\uFF0C\u9700\u8981\u66F4\u591A\u5DE5\u4F5C\u91CF\u3002\u662F\u5426\u8FFD\u52A0 ${i} \u5355\u5143\uFF1F`:`This AMA run has used ${t.spentBudget}/${t.totalBudget} work units (${s}%) and needs more work. Add ${i} more work units?`,allowCustomInput:!1,options:[{label:a?`\u7EE7\u7EED (+${i})`:`Continue (+${i})`,value:"continue",description:a?`\u8FFD\u52A0 ${i} \u5DE5\u4F5C\u5355\u5143\uFF0C\u4ECE\u7B2C ${n.currentRound}/${n.maxRounds} \u8F6E\u7EE7\u7EED\u3002`:`Grant ${i} more work units and continue from round ${n.currentRound}/${n.maxRounds}.`},{label:a?"\u505C\u6B62":"Stop here",value:"stop",description:a?`\u4F7F\u7528\u5F53\u524D\u6700\u4F73\u7ED3\u679C\u3002\u6700\u65B0\u8FDB\u5C55\uFF1A${co(n.summary,80)}`:`Finish now with the current best result. Latest note: ${co(n.summary,80)}`}],default:"continue"})),d=t.totalBudget;return c==="continue"?(t.lastApprovalBudgetTotal=d,rf(t,i),"approved"):(t.lastApprovalBudgetTotal=d,"denied")}o(Uo,"maybeRequestAdditionalWorkBudget");import{readdir as cf,readFile as fc,stat as df}from"node:fs/promises";import{execFile as uf}from"node:child_process";import{promisify as lf}from"node:util";import kt from"node:path";import Wo from"node:path";import{mkdir as of,unlink as sf,writeFile as af}from"node:fs/promises";function Fe(e){return e.context?.taskSurface??"cli"}o(Fe,"getManagedTaskSurface");function Ue(e,t){if(e.context?.managedTaskWorkspaceDir?.trim())return Wo.resolve(e.context.managedTaskWorkspaceDir);let n=e.context?.executionCwd??e.context?.gitRoot??process.cwd();return Wo.resolve(n,".agent","managed-tasks")}o(Ue,"getManagedTaskWorkspaceRoot");async function Q(e,t,n="utf8"){await Or(e,async()=>{await of(Wo.dirname(e),{recursive:!0}),await af(e,t,"utf8")})}o(Q,"writeManagedTaskFile");async function lc(e){await Or(e,async()=>{try{await sf(e)}catch(t){if(t.code!=="ENOENT")throw t}})}o(lc,"deleteManagedTaskFile");var ff=lf(uf),mc=3600*1e3,Un="checkpoint.json";function Go(e){let t=e.session?.id?.trim();return t||void 0}o(Go,"getCheckpointSessionId");function mf(e,t){return t?e.sessionId===t:!1}o(mf,"checkpointBelongsToSession");async function Wn(e){let t=kt.resolve(e?.trim()||process.cwd());try{let{stdout:n}=await ff("git",["rev-parse","--short","HEAD"],{cwd:t,windowsHide:!0});return n.trim()||void 0}catch{return}}o(Wn,"getGitHeadCommit");async function Ho(e,t){await Q(kt.join(e,Un),`${JSON.stringify(t,null,2)}
|
|
3
3
|
`,"utf8")}o(Ho,"writeCheckpoint");async function rt(e){await lc(kt.join(e,Un))}o(rt,"deleteCheckpoint");async function Vo(e){let t=e.context?.gitRoot,n=Fe(e),r=Ue(e,n),i;try{i=await cf(r)}catch{return}let s=await Wn(t),a=Go(e),c=Date.now();for(let d of i){let u=kt.join(r,d),f=kt.join(u,Un);try{let l=await df(f);if(!l.isFile())continue;let g=await fc(f,"utf8"),p=JSON.parse(g);if(!p||typeof p!="object")continue;let m=p;if(m.version!==1||typeof m.taskId!="string"||typeof m.createdAt!="string"||typeof m.gitCommit!="string"||typeof m.harnessProfile!="string"||m.sessionId!==void 0&&typeof m.sessionId!="string")continue;if(m.processId!==void 0||m.pid!==void 0){let M=m.processId??m.pid;if(typeof M!="number"||!Number.isFinite(M))continue}let v=m.processId??m.pid,h={version:1,taskId:m.taskId,...typeof m.sessionId=="string"&&m.sessionId.trim()?{sessionId:m.sessionId}:{},...typeof v=="number"&&Number.isFinite(v)?{processId:v}:{},createdAt:m.createdAt,gitCommit:m.gitCommit,objective:typeof m.objective=="string"?m.objective:"",harnessProfile:m.harnessProfile,currentRound:typeof m.currentRound=="number"?m.currentRound:1,completedWorkerIds:Array.isArray(m.completedWorkerIds)?m.completedWorkerIds.filter(M=>typeof M=="string"):[],scoutCompleted:m.scoutCompleted===!0},y=new Date(h.createdAt).getTime();if(Number.isNaN(y))continue;let x=c-l.mtimeMs;if(x>mc||x<0){await rt(u);continue}if(!mf(h,a))continue;if(s&&h.gitCommit&&h.gitCommit!==s){await rt(u);continue}let k=kt.join(u,"managed-task.json"),R=await fc(k,"utf8"),_=JSON.parse(R);if(!_||typeof _!="object")continue;let S=_;if(!S.contract?.taskId||!S.evidence?.workspaceDir)continue;return{checkpoint:h,workspaceDir:u,managedTask:S}}catch{continue}}}o(Vo,"findValidCheckpoint");import j from"node:path";function qo(e){let t=e?.runtime;return t?`${["# Runtime Execution Guide","","Use this guide to drive live verification against the runtime under test.","",t.cwd?`- Working directory: ${t.cwd}`:void 0,t.startupCommand?`- Startup command: ${t.startupCommand}`:void 0,t.readySignal?`- Ready signal: ${t.readySignal}`:void 0,t.baseUrl?`- Base URL: ${t.baseUrl}`:void 0,t.env&&Object.keys(t.env).length>0?`- Environment keys: ${Object.keys(t.env).join(", ")}`:void 0,"","Execution protocol:",t.startupCommand?"1. Start or confirm the runtime using the declared startup command before accepting the task.":"1. Confirm the target runtime is available before accepting the task.",t.readySignal||t.baseUrl?"2. Wait until the runtime is ready, using the ready signal or base URL when available.":"2. Confirm runtime readiness using the strongest observable signal you have.",t.uiFlows?.length?["3. Execute the declared UI flows:",...t.uiFlows.map((r,i)=>` ${i+1}. ${r}`)].join(`
|
|
4
4
|
`):"3. Execute the critical user-facing flow when browser verification is required.",t.apiChecks?.length?["4. Run the declared API checks:",...t.apiChecks.map((r,i)=>` ${i+1}. ${r}`)].join(`
|
|
5
5
|
`):void 0,t.dbChecks?.length?["5. Run the declared DB checks:",...t.dbChecks.map((r,i)=>` ${i+1}. ${r}`)].join(`
|
|
@@ -134,7 +134,7 @@ ${n}`:n:[...r.content,{type:"text",text:n}];return[...e.slice(0,-1),{...r,conten
|
|
|
134
134
|
|
|
135
135
|
`),S=y.slice(k),M=f?.(),w=m;m=[];let N=[];if(s&&d){let b=Ld(d,s);b&&w.push(b);let B=Nd(d,s,S);B&&w.push(B)}if(s&&a){if(ad(a,x.name)&&Xn(a),od(a,s)){let b=sd(s,a.roundsSinceUpdate.current);w.push(b)}id(a)}if(w.length>0){let b=[...S].reverse().find($=>$.turnId!==void 0||$.timestamp!==void 0),B={role:"user",content:w.join(`
|
|
136
136
|
|
|
137
|
-
`),_synthetic:!0,_source:"managed-runtime-reminder",turnId:b?.turnId,timestamp:b?.timestamp??new Date().toISOString()},F=S.at(-1);F?.role==="user"&&F._synthetic!==!0&&(typeof F.content=="string"||F.content.some($=>$.type!=="tool_result"))?m=w:(N.push(B),S=[...S,B])}let V=(x.tools??[]).map(b=>({name:b.name,description:b.description,input_schema:b.input_schema})),C=pi(e,x);g.current+=1,e.events?.onIterationStart?.(g.current,p);let E;if(t)E=await t(S,V,_,M);else{let b=we(e.provider??"anthropic"),B=e.provider??b.name??"anthropic",F=typeof b.supportsEphemeralSuffix=="function"&&b.supportsEphemeralSuffix(),he=F?M:void 0,$=o(Y=>F?[...Y]:vg(Y,M),"lowerProviderMessages"),oe=e.context?.contextIdentitySessionId??e.session?.id,se=e.context?.currentAgentId,Oe=e.context?.parentAgentId,ut=oe===void 0?void 0:se===void 0?oe:`${oe}/agent/${encodeURIComponent(se)}`,Mt={...ut!==void 0?{contextId:ut}:{},contextKind:se!==void 0?"child":"root",...oe!==void 0&&se!==void 0?{parentContextId:Oe===void 0||Oe==="/root"?oe:`${oe}/agent/${encodeURIComponent(Oe)}`}:{},...se!==void 0?{agentId:se}:{}},Pe=un(e.disablePromptCache)?void 0:Nn({logicalSessionId:oe,...se!==void 0?{agentId:se}:{}}),qe=o(Y=>{if(!(e.context?.contextDiagnostics!==!0||!e.events?.onContextBudgetSnapshot))try{let X=Va(_,Y,b),G=u?.contextWindow??b.getEffectiveContextWindow(h),ae=[...X.messages].reverse().find(_e=>_e.turnId!==void 0)?.turnId,U=M?.content?[...X.messages,{role:"user",content:M.content,_synthetic:!0,_source:"managed-run-context",...ae!==void 0?{turnId:ae}:{}}]:X.messages,q=aa(U,{skillTexts:[u?.skillCatalogText,u?.selectedSkillText].filter(_e=>_e!==void 0),mcpTexts:u?.mcpCatalogText?[u.mcpCatalogText]:[]});e.events.onContextBudgetSnapshot(uo({sessionId:e.session?.id,turnId:ae,...Mt,provider:B,model:h??b.getModel?.()??"unknown",contextWindow:G,systemPrompt:X.system,toolDefinitions:V,messageTokenBreakdown:q,reservedResponseTokens:b.getEffectiveMaxOutputTokens(h),profile:"report_only"}))}catch(X){Ie("[context-diagnostics:budget-error]",{error:X instanceof Error?X.message:String(X)})}},"emitContextBudgetSnapshot"),be=o((Y,X,G="stream")=>Ka({events:e.events,enabled:e.context?.contextDiagnostics===!0,provider:b,providerName:B,...Mt,model:h??b.getModel?.()??"unknown",reasoning:C,disablePromptCache:e.disablePromptCache,system:_,tools:V,messages:Y,...M!==void 0?{ephemeralSuffix:M}:{},...Pe!==void 0?{promptCacheKey:Pe}:{},attempt:X,transport:G}),"beginPromptCacheDiagnostic"),Ke=o((Y,X)=>{Xa(e.events,Y,X)},"completePromptCacheDiagnostic"),Te=go(B,So(e.timeouts)),Ot=Te.requestTimeoutMs,Xe=Te.streamIdleTimeoutMs,pe=new To,rn=typeof b.supportsNonStreamingFallback=="function"?b.supportsNonStreamingFallback():!1,ve=new vo(pe,{...Te,enableNonStreamingFallback:Te.enableNonStreamingFallback&&rn}),P=[...S];P=Sr(P),P=xr(P);let te=0,W,lt=!1,ye=0;for(;;){Ct(e.abortSignal,P),te+=1;let Y=$(P);pe.beginRequest(B,h??b.getModel?.()??"unknown",Y,te,!1),yo(pe.snapshot());let X=new AbortController,G=setTimeout(()=>{X.abort(new Error("API Hard Timeout (10 minutes)"))},Ot),ae=Xe>0,U;ae&&(U=setTimeout(()=>{X.abort(new Error(`Stream stalled or delayed response (${Xe}ms idle)`))},Xe));let q=o(()=>{ae&&(U&&clearTimeout(U),X.signal.aborted||(U=setTimeout(()=>{X.abort(new Error(`Stream stalled or delayed response (${Xe}ms idle)`))},Xe)))},"resetIdleTimer"),_e=e.abortSignal?AbortSignal.any([e.abortSignal,X.signal]):X.signal,Ee=ya(P,_)+Buffer.byteLength(M?.content??"","utf8");Ie("[resilience:request]",{provider:B,attempt:te,fallbackActive:!1,payloadBytes:Ee,payloadBucket:ka(Ee)});let ft={promptCacheKey:Pe,modelOverride:h,ephemeralSuffix:he,onTextDelta:o(H=>{pe.markTextDelta(H),q();let De=H.includes("```")||Xt.some(Ye=>H.includes(Ye))?ni(H):H;De.length!==0&&e.events?.onTextDelta?.(De)},"onTextDelta"),onThinkingDelta:o(H=>{pe.markThinkingDelta(H),q(),e.events?.onThinkingDelta?.(H)},"onThinkingDelta"),onThinkingEnd:o(H=>{e.events?.onThinkingEnd?.(H)},"onThinkingEnd"),onToolInputDelta:e.events?.onToolInputDelta,onRateLimit:o((H,ce,De)=>{q(),e.events&&yt(e.events,H,ce,De)},"onRateLimit"),onRetryAfter:o(H=>{q(),v=ln(v,{provider:H.provider,waitMs:H.waitMs,reason:H.reason,source:H.source}),e.events?.onRetryAfter?.(H)},"onRetryAfter")};try{qe(P);let H=be(P,te);if(W=await b.stream(Y,[...V],_,C,ft,_e),Ke(H,W.usage),W.stopReason==="max_tokens"&&!lt&&!process.env.KODAX_MAX_OUTPUT_TOKENS&&b.getEffectiveMaxOutputTokens(h)<64e3){Ct(e.abortSignal,P),lt=!0,b.setMaxOutputTokensOverride(64e3),e.events?.onRetry?.(`Output budget reached, escalating to ${64e3} tokens and retrying the same turn`,1,1),G&&clearTimeout(G),U&&clearTimeout(U),G=void 0,U=void 0,te-=1;continue}if(fu(W)&&W.stopReason!=="max_tokens"&&ye<yn&&!e.abortSignal?.aborted){ye+=1,e.events?.onRetry?.(`Provider returned an empty turn, retrying ${ye}/${yn}`,ye,yn),G&&clearTimeout(G),U&&clearTimeout(U),G=void 0,U=void 0,te-=1,await mi(Ns*ye,e.abortSignal,P);continue}break}catch(H){let ce=H instanceof Error?H:new Error(String(H));if(ce.name==="AbortError"&&X.signal.aborted&&!e.abortSignal?.aborted){let ke=X.signal.reason?.message??"Stream stalled",{KodaXNetworkError:pt}=await import("./dist-
|
|
137
|
+
`),_synthetic:!0,_source:"managed-runtime-reminder",turnId:b?.turnId,timestamp:b?.timestamp??new Date().toISOString()},F=S.at(-1);F?.role==="user"&&F._synthetic!==!0&&(typeof F.content=="string"||F.content.some($=>$.type!=="tool_result"))?m=w:(N.push(B),S=[...S,B])}let V=(x.tools??[]).map(b=>({name:b.name,description:b.description,input_schema:b.input_schema})),C=pi(e,x);g.current+=1,e.events?.onIterationStart?.(g.current,p);let E;if(t)E=await t(S,V,_,M);else{let b=we(e.provider??"anthropic"),B=e.provider??b.name??"anthropic",F=typeof b.supportsEphemeralSuffix=="function"&&b.supportsEphemeralSuffix(),he=F?M:void 0,$=o(Y=>F?[...Y]:vg(Y,M),"lowerProviderMessages"),oe=e.context?.contextIdentitySessionId??e.session?.id,se=e.context?.currentAgentId,Oe=e.context?.parentAgentId,ut=oe===void 0?void 0:se===void 0?oe:`${oe}/agent/${encodeURIComponent(se)}`,Mt={...ut!==void 0?{contextId:ut}:{},contextKind:se!==void 0?"child":"root",...oe!==void 0&&se!==void 0?{parentContextId:Oe===void 0||Oe==="/root"?oe:`${oe}/agent/${encodeURIComponent(Oe)}`}:{},...se!==void 0?{agentId:se}:{}},Pe=un(e.disablePromptCache)?void 0:Nn({logicalSessionId:oe,...se!==void 0?{agentId:se}:{}}),qe=o(Y=>{if(!(e.context?.contextDiagnostics!==!0||!e.events?.onContextBudgetSnapshot))try{let X=Va(_,Y,b),G=u?.contextWindow??b.getEffectiveContextWindow(h),ae=[...X.messages].reverse().find(_e=>_e.turnId!==void 0)?.turnId,U=M?.content?[...X.messages,{role:"user",content:M.content,_synthetic:!0,_source:"managed-run-context",...ae!==void 0?{turnId:ae}:{}}]:X.messages,q=aa(U,{skillTexts:[u?.skillCatalogText,u?.selectedSkillText].filter(_e=>_e!==void 0),mcpTexts:u?.mcpCatalogText?[u.mcpCatalogText]:[]});e.events.onContextBudgetSnapshot(uo({sessionId:e.session?.id,turnId:ae,...Mt,provider:B,model:h??b.getModel?.()??"unknown",contextWindow:G,systemPrompt:X.system,toolDefinitions:V,messageTokenBreakdown:q,reservedResponseTokens:b.getEffectiveMaxOutputTokens(h),profile:"report_only"}))}catch(X){Ie("[context-diagnostics:budget-error]",{error:X instanceof Error?X.message:String(X)})}},"emitContextBudgetSnapshot"),be=o((Y,X,G="stream")=>Ka({events:e.events,enabled:e.context?.contextDiagnostics===!0,provider:b,providerName:B,...Mt,model:h??b.getModel?.()??"unknown",reasoning:C,disablePromptCache:e.disablePromptCache,system:_,tools:V,messages:Y,...M!==void 0?{ephemeralSuffix:M}:{},...Pe!==void 0?{promptCacheKey:Pe}:{},attempt:X,transport:G}),"beginPromptCacheDiagnostic"),Ke=o((Y,X)=>{Xa(e.events,Y,X)},"completePromptCacheDiagnostic"),Te=go(B,So(e.timeouts)),Ot=Te.requestTimeoutMs,Xe=Te.streamIdleTimeoutMs,pe=new To,rn=typeof b.supportsNonStreamingFallback=="function"?b.supportsNonStreamingFallback():!1,ve=new vo(pe,{...Te,enableNonStreamingFallback:Te.enableNonStreamingFallback&&rn}),P=[...S];P=Sr(P),P=xr(P);let te=0,W,lt=!1,ye=0;for(;;){Ct(e.abortSignal,P),te+=1;let Y=$(P);pe.beginRequest(B,h??b.getModel?.()??"unknown",Y,te,!1),yo(pe.snapshot());let X=new AbortController,G=setTimeout(()=>{X.abort(new Error("API Hard Timeout (10 minutes)"))},Ot),ae=Xe>0,U;ae&&(U=setTimeout(()=>{X.abort(new Error(`Stream stalled or delayed response (${Xe}ms idle)`))},Xe));let q=o(()=>{ae&&(U&&clearTimeout(U),X.signal.aborted||(U=setTimeout(()=>{X.abort(new Error(`Stream stalled or delayed response (${Xe}ms idle)`))},Xe)))},"resetIdleTimer"),_e=e.abortSignal?AbortSignal.any([e.abortSignal,X.signal]):X.signal,Ee=ya(P,_)+Buffer.byteLength(M?.content??"","utf8");Ie("[resilience:request]",{provider:B,attempt:te,fallbackActive:!1,payloadBytes:Ee,payloadBucket:ka(Ee)});let ft={promptCacheKey:Pe,modelOverride:h,ephemeralSuffix:he,onTextDelta:o(H=>{pe.markTextDelta(H),q();let De=H.includes("```")||Xt.some(Ye=>H.includes(Ye))?ni(H):H;De.length!==0&&e.events?.onTextDelta?.(De)},"onTextDelta"),onThinkingDelta:o(H=>{pe.markThinkingDelta(H),q(),e.events?.onThinkingDelta?.(H)},"onThinkingDelta"),onThinkingEnd:o(H=>{e.events?.onThinkingEnd?.(H)},"onThinkingEnd"),onToolInputDelta:e.events?.onToolInputDelta,onRateLimit:o((H,ce,De)=>{q(),e.events&&yt(e.events,H,ce,De)},"onRateLimit"),onRetryAfter:o(H=>{q(),v=ln(v,{provider:H.provider,waitMs:H.waitMs,reason:H.reason,source:H.source}),e.events?.onRetryAfter?.(H)},"onRetryAfter")};try{qe(P);let H=be(P,te);if(W=await b.stream(Y,[...V],_,C,ft,_e),Ke(H,W.usage),W.stopReason==="max_tokens"&&!lt&&!process.env.KODAX_MAX_OUTPUT_TOKENS&&b.getEffectiveMaxOutputTokens(h)<64e3){Ct(e.abortSignal,P),lt=!0,b.setMaxOutputTokensOverride(64e3),e.events?.onRetry?.(`Output budget reached, escalating to ${64e3} tokens and retrying the same turn`,1,1),G&&clearTimeout(G),U&&clearTimeout(U),G=void 0,U=void 0,te-=1;continue}if(fu(W)&&W.stopReason!=="max_tokens"&&ye<yn&&!e.abortSignal?.aborted){ye+=1,e.events?.onRetry?.(`Provider returned an empty turn, retrying ${ye}/${yn}`,ye,yn),G&&clearTimeout(G),U&&clearTimeout(U),G=void 0,U=void 0,te-=1,await mi(Ns*ye,e.abortSignal,P);continue}break}catch(H){let ce=H instanceof Error?H:new Error(String(H));if(ce.name==="AbortError"&&X.signal.aborted&&!e.abortSignal?.aborted){let ke=X.signal.reason?.message??"Stream stalled",{KodaXNetworkError:pt}=await import("./dist-WILA35IA.js");ce=new pt(ke,!0)}fi(e.abortSignal,ce,P);let De=pe.inferFailureStage(),Ye=ho(ce,De);ga(ce,Ye);let z=ve.decideRecoveryAction(ce,Ye,te);if(ha(z,te),e.events?.onProviderRecovery?.({stage:z.failureStage,errorClass:z.reasonCode,attempt:te,maxAttempts:Te.maxRetries,delayMs:z.delayMs,recoveryAction:z.action,ladderStep:z.ladderStep,fallbackUsed:z.shouldUseNonStreaming,serverRetryAfterMs:z.serverRetryAfterMs}),z.reasonCode==="rate_limit"&&e.events&&yt(e.events,te,Te.maxRetries,z.delayMs),!e.events?.onProviderRecovery&&z.action!=="manual_continue"&&e.events?.onRetry?.(`${Ga(ce)} \xB7 retry ${te}/${Te.maxRetries} in ${Math.round(z.delayMs/1e3)}s`,te,Te.maxRetries),z.shouldUseNonStreaming&&typeof b.complete=="function"){Ct(e.abortSignal,P);let ke=new AbortController,pt=e.abortSignal?AbortSignal.any([e.abortSignal,ke.signal]):ke.signal,dr=setTimeout(()=>{ke.abort(new Error("API Hard Timeout (10 minutes)"))},Ot);try{U&&clearTimeout(U),G&&clearTimeout(G),G=void 0,U=void 0;let Ce=$(P);pe.beginRequest(B,h??b.getModel?.()??"unknown",Ce,te,!0),yo(pe.snapshot()),qe(P);let gt=be(P,te,"complete");W=await b.complete(Ce,[...V],_,C,{promptCacheKey:Pe,modelOverride:h,ephemeralSuffix:he,onTextDelta:o(Ne=>{pe.markTextDelta(Ne),e.events?.onTextDelta?.(Ne)},"onTextDelta"),onThinkingDelta:o(Ne=>{pe.markThinkingDelta(Ne),e.events?.onThinkingDelta?.(Ne)},"onThinkingDelta"),onThinkingEnd:o(Ne=>{e.events?.onThinkingEnd?.(Ne)},"onThinkingEnd"),signal:pt},pt),Ke(gt,W.usage);break}catch(Ce){ce=Ce instanceof Error?Ce:new Error(String(Ce)),fi(e.abortSignal,ce,P)}finally{clearTimeout(dr)}}if(z.action==="sanitize_thinking_and_retry"){let ke=ve.executeRecovery(P,z);ko(z.action,ke),P=ke.messages,G&&clearTimeout(G),U&&clearTimeout(U),G=void 0,U=void 0,te-=1,await mi(z.delayMs,e.abortSignal,P);continue}if(z.action==="manual_continue"||te>=Te.maxRetries)throw ht(ce,P),ce;let mt=ve.executeRecovery(P,z);ko(z.action,mt),P=mt.messages,G&&clearTimeout(G),U&&clearTimeout(U),G=void 0,U=void 0,await mi(z.delayMs,e.abortSignal,P);continue}finally{G&&clearTimeout(G),U&&clearTimeout(U)}}if(fu(W)){let Y=new Tr("Provider returned no user-visible text or tool calls after recovery attempts; refusing to commit an empty assistant turn.",B);throw ht(Y,P),Y}let ue=0,Se=(W.textBlocks??[]).map(Y=>Y.text).join(""),ze=W.thinkingBlocks?[...W.thinkingBlocks]:void 0;for(;W.stopReason==="max_tokens"&&(W.toolBlocks?.length??0)===0&&Se.trim().length>0&&ue<3;){Ct(e.abortSignal,P),ue+=1,e.events?.onTextDelta?.(`
|
|
138
138
|
|
|
139
139
|
[max_tokens reached, continuing...]
|
|
140
140
|
|
|
@@ -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-
|
|
2
|
+
import{D as N,J as C}from"./chunk-QCXFQFIO.js";import{de as q,ee as j,na as _}from"./chunk-6MGD2A7Z.js";import{Pa as E,gb as T,m as x,n as R}from"./chunk-UNEC2WXJ.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-72H6JNPN.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,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{o}from"./chunk-
|
|
2
|
+
import{o}from"./chunk-UNEC2WXJ.js";import{a as i}from"./chunk-ONUPGMER.js";function r(u){let e=o(u?.llm);if(!e)return;let t={};return e.requestTimeoutMs!==void 0&&(t.requestTimeoutMs=e.requestTimeoutMs),e.streamIdleTimeoutMs!==void 0&&(t.streamIdleTimeoutMs=e.streamIdleTimeoutMs),e.chunkTimeoutMs!==void 0&&(t.chunkTimeoutMs=e.chunkTimeoutMs),e.maxRetryDelayMs!==void 0&&(t.maxRetryDelayMs=e.maxRetryDelayMs),Object.keys(t).length>0?t:void 0}i(r,"providerResilienceConfigFromTimeouts");export{r as a};
|