@kodax-ai/kodax 0.7.71 → 0.7.72
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 +602 -487
- package/README.md +46 -27
- package/README_CN.md +30 -13
- package/dist/chunks/agent-YKGU4USA.js +2 -0
- package/dist/chunks/argument-completer-QZETLNAB.js +2 -0
- package/dist/chunks/{chunk-SX2WFHIS.js → chunk-2RI252RN.js} +1 -1
- package/dist/chunks/chunk-CLFP6UGU.js +71 -0
- package/dist/chunks/chunk-E27LHEIP.js +37 -0
- package/dist/chunks/chunk-EDZ5KJFT.js +5 -0
- package/dist/chunks/chunk-GIK4SGAT.js +364 -0
- package/dist/chunks/chunk-GVWPHE23.js +310 -0
- package/dist/chunks/{chunk-A2TFSV5M.js → chunk-IR5KIK7E.js} +1 -1
- package/dist/chunks/chunk-JSDLBXME.js +755 -0
- package/dist/chunks/chunk-MVARIMQV.js +22 -0
- package/dist/chunks/chunk-PKQOEDHJ.js +628 -0
- package/dist/chunks/{chunk-64NQBOSN.js → chunk-SQODXBLX.js} +1 -1
- package/dist/chunks/chunk-VDGCGOQH.js +328 -0
- package/dist/chunks/chunk-VVE3UM4F.js +410 -0
- package/dist/chunks/chunk-WIBLZK4G.js +151 -0
- package/dist/chunks/{compaction-config-5KKKXYFT.js → compaction-config-TWCDFLX6.js} +1 -1
- package/dist/chunks/{construction-bootstrap-OXDDDW6O.js → construction-bootstrap-ZJPXUPXQ.js} +1 -1
- package/dist/chunks/dist-JT4ATXVM.js +2 -0
- package/dist/chunks/host-SVEDZUC5.js +2 -0
- package/dist/chunks/{run-manager-Z3W6MDO7.js → run-manager-RX42UNEM.js} +1 -1
- package/dist/chunks/{utils-CFOXDCB5.js → utils-OTT5CG5J.js} +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.js +4 -4
- package/dist/kodax_bootstrap.js +28 -0
- package/dist/kodax_cli.js +1325 -1333
- package/dist/kodax_resume.js +44 -0
- package/dist/provider-capabilities.json +50 -48
- package/dist/runtime-worker.js +1322 -1330
- package/dist/sdk-a2a.d.ts +10 -9
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-agent.d.ts +382 -206
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +80 -128
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +3 -0
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +71 -23
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +143 -31
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-session.d.ts +6 -5
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.d.ts +5 -5
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +14 -14
- package/dist/types-chunks/{bash-prefix-extractor.d-YoiZl5yt.d.ts → bash-prefix-extractor.d-CHJO5y94.d.ts} +107 -248
- package/dist/types-chunks/{capsule.d-CK5Pfz1k.d.ts → capsule.d-DxtdE-GD.d.ts} +24 -95
- package/dist/types-chunks/center-types.d-BBT122uJ.d.ts +91 -0
- package/dist/types-chunks/{commands.d-D6g2jq8V.d.ts → commands.d-DZxHzH5-.d.ts} +6 -4
- package/dist/types-chunks/{guardrail.d-DilYC1dh.d.ts → guardrail.d-DlpMnd-Y.d.ts} +1 -1
- package/dist/types-chunks/{guardrail.d-DdeDWnVu.d.ts → guardrail.d-auV61_h5.d.ts} +83 -10
- package/dist/types-chunks/public-api.d--IDNJsu1.d.ts +1342 -0
- package/dist/types-chunks/{run-manager.d-DxU3SSGR.d.ts → run-manager.d-Bh50OdVl.d.ts} +1 -1
- package/dist/types-chunks/sdk-session-Cfw6NFu-.d.ts +82 -0
- package/dist/types-chunks/{types.d-CEZZSY9s.d.ts → types.d-CNZgY52F.d.ts} +2 -2
- package/dist/types-chunks/{types.d-vJExiRje.d.ts → types.d-DCQVBqVn.d.ts} +10 -5
- package/dist/types-chunks/{types.d-CRCaLt_s.d.ts → types.d-DH1mvdcl.d.ts} +284 -164
- package/dist/types-chunks/{types.d-CzsLFqmf.d.ts → types.d-EqQmHztg.d.ts} +9 -10
- package/dist/types-chunks/{utils.d-Cb6vdvFM.d.ts → utils.d-gmn3c5U4.d.ts} +9 -12
- package/docs/SDK_EMBEDDER_GUIDE.md +171 -26
- package/package.json +4 -4
- package/scripts/kodax-bin.cjs +4 -2
- package/scripts/production-env.cjs +9 -0
- package/dist/chunks/agent-X2EWQADL.js +0 -2
- package/dist/chunks/argument-completer-BLNXDO2F.js +0 -2
- package/dist/chunks/chunk-4DY756KL.js +0 -70
- package/dist/chunks/chunk-52JSZ77P.js +0 -37
- package/dist/chunks/chunk-A574DBTV.js +0 -422
- package/dist/chunks/chunk-F7KGYHJ3.js +0 -624
- package/dist/chunks/chunk-GVTM4Z6O.js +0 -151
- package/dist/chunks/chunk-PHH4TRGF.js +0 -22
- package/dist/chunks/chunk-PVUXONQB.js +0 -366
- package/dist/chunks/chunk-T7LYK53M.js +0 -329
- package/dist/chunks/chunk-VRSVNU2Y.js +0 -7
- package/dist/chunks/chunk-Y5XKAN7C.js +0 -755
- package/dist/chunks/chunk-Z535BARK.js +0 -306
- package/dist/chunks/dist-IXJRJ27U.js +0 -2
- package/dist/chunks/host-VRKDAN26.js +0 -2
- package/dist/types-chunks/public-api.d-BvCp5VkW.d.ts +0 -601
- package/dist/types-chunks/sdk-session-wGpa7X_U.d.ts +0 -796
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{D as j,J as N}from"./chunk-
|
|
2
|
+
import{D as j,J as N}from"./chunk-MVARIMQV.js";import{yd as _,zd as q}from"./chunk-GIK4SGAT.js";import{Ma as E,cb as T,m as v,n as R}from"./chunk-ZJIMT5I3.js";import{Fd as I,Gd as g,Hd as k,Kd as $,Ld as y,Md as b}from"./chunk-JSDLBXME.js";import{W as O,X as W,aa as M}from"./chunk-E27LHEIP.js";import{a as o}from"./chunk-ONUPGMER.js";import{join as Pe}from"node:path";var te=["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
|
`),C=12e4,ne="KODAX_WORKFLOW_GENERATION_TIMEOUT_SEC",re="KODAX_WORKFLOW_GENERATION_TIMEOUT_MS",se=64,oe=2,ie=2e3,ae=[{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")}],le=["- classify-and-act: first classify a mixed request, then route to the right worker behavior.","- fan-out-and-synthesize: split independent areas, files, hypotheses, reviewers, or perspectives; run them with wf.parallel, then wf.synthesize.","- adversarial-verification: produce or inspect a candidate, then have an independent verifier attack assumptions, evidence, and edge cases.","- generate-and-filter: ask several generators for distinct candidates, then filter/dedupe/rank before synthesis.","- tournament: compare competing approaches or answers and use synthesis as the judge.","- loop-until-done: run bounded follow-up rounds when findings should drive the next prompt.","- review or audit combines fan-out-and-synthesize with adversarial-verification: fan independent reviewers out across the dimensions, then pipe each finding straight into a verifier that tries to refute it before synthesis. A review with no verification stage ships findings a single reviewer's blind spot would have hidden."],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=v(n?.workflow?.generationTimeoutSec,"timeouts.workflow.generationTimeoutSec");if(t!==void 0)return t;let r=R(e[ne]);if(r!==void 0)return r;let s=e[re];if(s===void 0||s.trim().length===0)return C;let i=Number(s);return!Number.isFinite(i)||i<=0?C: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 P(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(P,"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 he(e){return e.split(/(?:->|\u2192|,|\n)/).map(n=>n.trim()).filter(n=>n.length>0)}o(he,"splitPhaseString");function we(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=he(t);s.length>0&&(r=s)}return r?{...n,phases:r}:e}o(we,"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(se,Math.max(e.maxAgents,t,r));return s>e.maxAgents?{...e,maxAgents:s}:e}o(ke,"reserveGeneratedWorkflowAgentCapacity");function h(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]!==`
|