agentix-cli 0.221.0 → 0.221.1

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 (37) hide show
  1. package/dist/{agent-5FVRGDGM.js → agent-DXKDG4DQ.js} +2 -2
  2. package/dist/{board-dashboard-ZJLIP2L4.js → board-dashboard-QV7OD4SO.js} +3 -3
  3. package/dist/{chunk-ZWD4ADV4.js → chunk-575LJSX2.js} +3 -3
  4. package/dist/{chunk-F6LT3DHK.js → chunk-AAPHOKWS.js} +2 -2
  5. package/dist/{chunk-RFVXW6F2.js → chunk-AAQOXNLE.js} +242 -242
  6. package/dist/chunk-AAQOXNLE.js.map +1 -0
  7. package/dist/chunk-EFXZACH4.js +2 -0
  8. package/dist/chunk-EFXZACH4.js.map +1 -0
  9. package/dist/chunk-FG2FPOML.js +2 -0
  10. package/dist/chunk-FG2FPOML.js.map +1 -0
  11. package/dist/{chunk-AX6CCD5P.js → chunk-FRYEUVYD.js} +3 -3
  12. package/dist/{chunk-AX6CCD5P.js.map → chunk-FRYEUVYD.js.map} +1 -1
  13. package/dist/{chunk-BX4RQ2IZ.js → chunk-LO5A3VKY.js} +2 -2
  14. package/dist/{chunk-B5QQ4IH2.js → chunk-RMB6G7X2.js} +2 -2
  15. package/dist/cli.js +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/{program-YGEXHPRD.js → program-Q4DXWAQU.js} +4 -4
  18. package/dist/{registry-KYCXXPEA.js → registry-Q3H6QR6Q.js} +2 -2
  19. package/dist/{runner-I4ZB37JE.js → runner-KWSARUS4.js} +2 -2
  20. package/dist/step-proof-GLY7XVPD.js +2 -0
  21. package/package.json +1 -1
  22. package/dist/chunk-LIY6X3LU.js +0 -2
  23. package/dist/chunk-LIY6X3LU.js.map +0 -1
  24. package/dist/chunk-RFVXW6F2.js.map +0 -1
  25. package/dist/chunk-TCM3UOEQ.js +0 -2
  26. package/dist/chunk-TCM3UOEQ.js.map +0 -1
  27. package/dist/step-proof-NMKY7T5A.js +0 -2
  28. /package/dist/{agent-5FVRGDGM.js.map → agent-DXKDG4DQ.js.map} +0 -0
  29. /package/dist/{board-dashboard-ZJLIP2L4.js.map → board-dashboard-QV7OD4SO.js.map} +0 -0
  30. /package/dist/{chunk-ZWD4ADV4.js.map → chunk-575LJSX2.js.map} +0 -0
  31. /package/dist/{chunk-F6LT3DHK.js.map → chunk-AAPHOKWS.js.map} +0 -0
  32. /package/dist/{chunk-BX4RQ2IZ.js.map → chunk-LO5A3VKY.js.map} +0 -0
  33. /package/dist/{chunk-B5QQ4IH2.js.map → chunk-RMB6G7X2.js.map} +0 -0
  34. /package/dist/{program-YGEXHPRD.js.map → program-Q4DXWAQU.js.map} +0 -0
  35. /package/dist/{registry-KYCXXPEA.js.map → registry-Q3H6QR6Q.js.map} +0 -0
  36. /package/dist/{runner-I4ZB37JE.js.map → runner-KWSARUS4.js.map} +0 -0
  37. /package/dist/{step-proof-NMKY7T5A.js.map → step-proof-GLY7XVPD.js.map} +0 -0
@@ -1,2 +0,0 @@
1
- import{b as g,c as R}from"./chunk-LIY6X3LU.js";import{exec as k}from"child_process";var p=32*1024;function d(n,o){return n.replace(/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g,(r,e)=>{let t=o[e];return t==null?"":String(t)}).replace(/\$\{?([A-Z_][A-Z0-9_]*)\}?/g,(r,e)=>process.env[e]??"")}function b(n,o){let r={};for(let e of n.inputs){let t=o[e.name]??e.defaultValue;if(t===void 0||t===""){if(e.required)throw new Error(`input "${e.name}" is required`);continue}if(e.type==="number"){let s=typeof t=="number"?t:Number(t);if(!Number.isFinite(s))throw new Error(`input "${e.name}" must be a number`);t=s}else e.type==="boolean"?t=t===!0||t==="true"||t==="1"||t===1:t=String(t);r[e.name]=t}return r}async function S(n,o={},r={}){let e=Date.now(),t=b(n,o);if(n.kind==="shell")return E(n,t,e,r.stepProof);if(n.kind==="http")return y(n,t,e,r.stepProof);throw new Error(`unsupported action kind: ${n.kind}`)}function E(n,o,r,e){let t=d(n.command,o),s={...process.env};if(n.env)for(let[a,c]of Object.entries(n.env))s[a]=d(c,o);delete s[g],e&&(s[g]=e);let l=n.cwd?d(n.cwd,o):process.cwd();return new Promise(a=>{let c=!1,m=i=>{c||(c=!0,a(i))};k(t,{cwd:l,env:s,timeout:n.timeoutMs,maxBuffer:p},(i,u,f)=>{let A=String(u||"").slice(0,p),h=String(f||"").slice(0,p),w=i?i.code??1:0;m({ok:!i,output:A,errors:h||(i?i.message:void 0),status:typeof w=="number"?w:1,durationMs:Date.now()-r})})})}async function y(n,o,r,e){let t=d(n.url,o),s={},l=e&&x(t)?e:"",a={...o,[R]:l};if(n.headers)for(let[u,f]of Object.entries(n.headers))s[u]=d(f,a);let c=n.method==="GET"||n.method==="DELETE"?void 0:n.body?d(n.body,o):void 0,m=new AbortController,i=setTimeout(()=>m.abort(),n.timeoutMs);try{let u=await fetch(t,{method:n.method,headers:s,body:c,signal:m.signal,...l?{redirect:"manual"}:{}}),f=(await u.text()).slice(0,p);return{ok:u.ok,output:f,status:u.status,durationMs:Date.now()-r}}catch(u){return{ok:!1,output:"",errors:u?.message||String(u),status:0,durationMs:Date.now()-r}}finally{clearTimeout(i)}}function x(n){try{let o=new URL(n).hostname.replace(/^\[|\]$/g,"");return o==="127.0.0.1"||o==="localhost"||o==="::1"}catch{return!1}}export{d as a,b,S as c,x as d};
2
- //# sourceMappingURL=chunk-TCM3UOEQ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/actions/runner.ts"],"sourcesContent":["import { exec } from \"child_process\"\nimport type { Action, ActionRunResult, ActionInput } from \"./types\"\nimport { STEP_PROOF_ENV, STEP_PROOF_TEMPLATE } from \"../workflows/step-proof\"\n\n// --- Action runner ---\n//\n// Resolves {{name}} markers from `inputs` and ${VAR} from process.env,\n// then dispatches by kind:\n// - \"shell\" — exec the command (cwd-aware, env-merge)\n// - \"http\" — fetch the url with method/headers/body\n//\n// Output is capped at ~32KB so a runaway command doesn't blow up the\n// dashboard JSON response.\n\nconst MAX_OUTPUT = 32 * 1024\n\n/** Fill {{name}} markers from values; ${VAR} from process.env. */\nexport function template(s: string, values: Record<string, unknown>): string {\n return s\n .replace(/\\{\\{\\s*([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\}\\}/g, (_, name) => {\n const v = values[name]\n return v === undefined || v === null ? \"\" : String(v)\n })\n .replace(/\\$\\{?([A-Z_][A-Z0-9_]*)\\}?/g, (_, name) => process.env[name] ?? \"\")\n}\n\n/** Validate inputs against the action's declared schema, applying defaults\n * and rejecting missing required fields. Returns the cleaned values\n * (booleans/numbers coerced from string CLI input). */\nexport function resolveInputs(action: Action, raw: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {}\n for (const def of action.inputs as ActionInput[]) {\n let v: unknown = raw[def.name] ?? def.defaultValue\n if (v === undefined || v === \"\") {\n if (def.required) throw new Error(`input \"${def.name}\" is required`)\n continue\n }\n if (def.type === \"number\") {\n const n = typeof v === \"number\" ? v : Number(v)\n if (!Number.isFinite(n)) throw new Error(`input \"${def.name}\" must be a number`)\n v = n\n } else if (def.type === \"boolean\") {\n v = v === true || v === \"true\" || v === \"1\" || v === 1\n } else {\n v = String(v)\n }\n out[def.name] = v\n }\n return out\n}\n\nexport interface RunActionOptions {\n /** A workflow step's proof (#1849): the env var AGENTX_STEP_PROOF of a\n * shell action, `{{agentx_step_proof}}` in an http action's headers.\n * Never put into the command, url, body or output. */\n stepProof?: string\n}\n\nexport async function runAction(action: Action, rawInputs: Record<string, unknown> = {}, opts: RunActionOptions = {}): Promise<ActionRunResult> {\n const start = Date.now()\n const values = resolveInputs(action, rawInputs)\n if (action.kind === \"shell\") return runShell(action, values, start, opts.stepProof)\n if (action.kind === \"http\") return runHttp(action, values, start, opts.stepProof)\n throw new Error(`unsupported action kind: ${(action as Action).kind}`)\n}\n\nfunction runShell(action: Extract<Action, { kind: \"shell\" }>, values: Record<string, unknown>, start: number, stepProof?: string): Promise<ActionRunResult> {\n const cmd = template(action.command, values)\n const env: NodeJS.ProcessEnv = { ...process.env }\n if (action.env) {\n for (const [k, v] of Object.entries(action.env)) env[k] = template(v, values)\n }\n // Set last, so the action's own env cannot stand in for the daemon's.\n delete env[STEP_PROOF_ENV]\n if (stepProof) env[STEP_PROOF_ENV] = stepProof\n const cwd = action.cwd ? template(action.cwd, values) : process.cwd()\n\n return new Promise<ActionRunResult>((resolve) => {\n let settled = false\n const finish = (r: ActionRunResult) => { if (settled) return; settled = true; resolve(r) }\n exec(cmd, { cwd, env, timeout: action.timeoutMs, maxBuffer: MAX_OUTPUT }, (err, stdout, stderr) => {\n const out = String(stdout || \"\").slice(0, MAX_OUTPUT)\n const errs = String(stderr || \"\").slice(0, MAX_OUTPUT)\n const status = err ? (err as NodeJS.ErrnoException & { code?: number }).code ?? 1 : 0\n finish({\n ok: !err,\n output: out,\n errors: errs || (err ? err.message : undefined),\n status: typeof status === \"number\" ? status : 1,\n durationMs: Date.now() - start,\n })\n })\n })\n}\n\nasync function runHttp(action: Extract<Action, { kind: \"http\" }>, values: Record<string, unknown>, start: number, stepProof?: string): Promise<ActionRunResult> {\n const url = template(action.url, values)\n const headers: Record<string, string> = {}\n // The proof is offered to headers only, so it never lands in a url or\n // body that may be logged; an input of the same name cannot fake it.\n // Only to this machine, so it cannot be sent off to a host a run input\n // names; and no redirect may carry it elsewhere.\n const proof = stepProof && isLoopbackUrl(url) ? stepProof : \"\"\n const headerValues = { ...values, [STEP_PROOF_TEMPLATE]: proof }\n if (action.headers) for (const [k, v] of Object.entries(action.headers)) headers[k] = template(v, headerValues)\n const body = action.method === \"GET\" || action.method === \"DELETE\" ? undefined : (action.body ? template(action.body, values) : undefined)\n const ac = new AbortController()\n const timer = setTimeout(() => ac.abort(), action.timeoutMs)\n try {\n const res = await fetch(url, { method: action.method, headers, body, signal: ac.signal, ...(proof ? { redirect: \"manual\" as const } : {}) })\n const text = (await res.text()).slice(0, MAX_OUTPUT)\n return {\n ok: res.ok,\n output: text,\n status: res.status,\n durationMs: Date.now() - start,\n }\n } catch (e: any) {\n return {\n ok: false,\n output: \"\",\n errors: e?.message || String(e),\n status: 0,\n durationMs: Date.now() - start,\n }\n } finally {\n clearTimeout(timer)\n }\n}\n\n/** True for an http(s) url on this machine's loopback address. */\nexport function isLoopbackUrl(url: string): boolean {\n try {\n const h = new URL(url).hostname.replace(/^\\[|\\]$/g, \"\")\n return h === \"127.0.0.1\" || h === \"localhost\" || h === \"::1\"\n } catch {\n return false\n }\n}\n"],"mappings":"+CAAA,OAAS,QAAAA,MAAY,gBAcrB,IAAMC,EAAa,GAAK,KAGjB,SAASC,EAASC,EAAWC,EAAyC,CAC3E,OAAOD,EACJ,QAAQ,0CAA2C,CAACE,EAAGC,IAAS,CAC/D,IAAMC,EAAIH,EAAOE,CAAI,EACrB,OAA0BC,GAAM,KAAO,GAAK,OAAOA,CAAC,CACtD,CAAC,EACA,QAAQ,8BAA+B,CAACF,EAAGC,IAAS,QAAQ,IAAIA,CAAI,GAAK,EAAE,CAChF,CAKO,SAASE,EAAcC,EAAgBC,EAAuD,CACnG,IAAMC,EAA+B,CAAC,EACtC,QAAWC,KAAOH,EAAO,OAAyB,CAChD,IAAIF,EAAaG,EAAIE,EAAI,IAAI,GAAKA,EAAI,aACtC,GAAIL,IAAM,QAAaA,IAAM,GAAI,CAC/B,GAAIK,EAAI,SAAU,MAAM,IAAI,MAAM,UAAUA,EAAI,mBAAmB,EACnE,SAEF,GAAIA,EAAI,OAAS,SAAU,CACzB,IAAMC,EAAI,OAAON,GAAM,SAAWA,EAAI,OAAOA,CAAC,EAC9C,GAAI,CAAC,OAAO,SAASM,CAAC,EAAG,MAAM,IAAI,MAAM,UAAUD,EAAI,wBAAwB,EAC/EL,EAAIM,OACKD,EAAI,OAAS,UACtBL,EAAIA,IAAM,IAAQA,IAAM,QAAUA,IAAM,KAAOA,IAAM,EAErDA,EAAI,OAAOA,CAAC,EAEdI,EAAIC,EAAI,IAAI,EAAIL,EAElB,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2B,CAAK,CACpB,CACF,CAGO,SAASL,EAAcH,EAAsB,CAClD,GAAI,CACF,IAAMY,EAAI,IAAI,IAAIZ,CAAG,EAAE,SAAS,QAAQ,WAAY,EAAE,EACtD,OAAOY,IAAM,aAAeA,IAAM,aAAeA,IAAM,KACzD,MAAE,CACA,MAAO,EACT,CACF","names":["exec","MAX_OUTPUT","template","s","values","_","name","v","resolveInputs","action","raw","out","def","n","runAction","rawInputs","opts","start","runShell","runHttp","stepProof","cmd","env","k","STEP_PROOF_ENV","cwd","resolve","settled","finish","r","exec","err","stdout","stderr","errs","status","url","headers","proof","isLoopbackUrl","headerValues","STEP_PROOF_TEMPLATE","body","ac","timer","res","text","e","h"]}
@@ -1,2 +0,0 @@
1
- import{a,b,c,d,e,f,g}from"./chunk-LIY6X3LU.js";import"./chunk-QIJLFPWE.js";export{b as STEP_PROOF_ENV,d as STEP_PROOF_GRACE_MS,a as STEP_PROOF_HEADER,c as STEP_PROOF_TEMPLATE,e as StepProofs,g as provenStep,f as stepProofMinter};
2
- //# sourceMappingURL=step-proof-NMKY7T5A.js.map