@zibby/agent-workflow 0.4.36 → 0.4.38

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/dist/node.js CHANGED
@@ -1,34 +1,34 @@
1
- var lt=Object.defineProperty;var R=(r,t)=>()=>(r&&(t=r(r=0)),t);var ct=(r,t)=>{for(var e in t)lt(r,e,{get:t[e],enumerable:!0})};var B,ut,k,u,L=R(()=>{B=()=>{},ut={debug:B,info:B,warn:(...r)=>console.warn("[workflow]",...r),error:(...r)=>console.error("[workflow]",...r)},k={impl:ut},u={debug:(...r)=>k.impl.debug?.(...r),info:(...r)=>k.impl.info?.(...r),warn:(...r)=>k.impl.warn?.(...r),error:(...r)=>k.impl.error?.(...r)}});var X=R(()=>{});function Q(r){return ht.get(r)||null}var P,ht,tt=R(()=>{P=Symbol.for("@zibby/agent-workflow.skills");globalThis[P]||(globalThis[P]=new Map);ht=globalThis[P]});var rt={};ct(rt,{getAgentStrategy:()=>et,invokeAgent:()=>gt,listStrategies:()=>mt,registerStrategy:()=>ft});function ft(r){if(!r||typeof r.getName!="function"||typeof r.invoke!="function")throw new Error("strategy must implement getName() and invoke() (AgentStrategy shape)");let t=y.findIndex(e=>e.getName()===r.getName());t>=0?y[t]=r:y.push(r)}function mt(){return y.map(r=>r.getName())}function et(r={}){let{state:t={},preferredAgent:e=null}=r,o=e||t.agentType||process.env.AGENT_TYPE;if(!o){let i=y.map(l=>l.getName()).join(", ")||"none registered";throw new Error(`No agent specified. Set agentType in state or AGENT_TYPE env var. Available: ${i}`)}u.debug(`[workflow] agent selection: requested=${o}`);let a=y.find(i=>i.getName()===o);if(!a){let i=y.map(l=>l.getName()).join(", ")||"none registered";throw new Error(`Unknown agent '${o}'. Available: ${i}`)}if(!a.canHandle(r))throw new Error(`Agent '${o}' is not available in this environment. Check credentials/environment.`);return u.debug(`[workflow] using agent: ${a.getName()}`),a}async function gt(r,t={},e={}){let o=t.state&&typeof t.state.getAll=="function"?t.state.getAll():t.state||{},a={...t,state:o},i=et(a),l=o.config||e.config||{},_=l.models||{},d=e.nodeName&&_[e.nodeName]||null,S=_.default||null,N=l.agent?.[i.name]?.model||null,s=d||S||N||e.model||null,m={...e,model:s,workspace:o.workspace||e.workspace,schema:e.schema||t.schema,images:e.images||t.images||[],skills:e.skills||t.skills||[],plugins:e.plugins||t.plugins||[],config:l},h=r,I=m.skills||[];if(I.length>0&&!e.skipPromptFragments){let E=I.map(f=>{let n=Q(f)?.promptFragment;return typeof n=="function"?n():n}).filter(Boolean);E.length>0&&(h+=`
1
+ var nt=Object.defineProperty;var N=(r,t)=>()=>(r&&(t=r(r=0)),t);var at=(r,t)=>{for(var e in t)nt(r,e,{get:t[e],enumerable:!0})};var D,lt,A,p,W=N(()=>{D=()=>{},lt={debug:D,info:D,warn:(...r)=>console.warn("[workflow]",...r),error:(...r)=>console.error("[workflow]",...r)},A={impl:lt},p={debug:(...r)=>A.impl.debug?.(...r),info:(...r)=>A.impl.info?.(...r),warn:(...r)=>A.impl.warn?.(...r),error:(...r)=>A.impl.error?.(...r)}});var z=N(()=>{});function V(r){return pt.get(r)||null}var P,C,pt,kt,q=N(()=>{P=Symbol.for("@zibby/agent-workflow.skills"),C=Symbol.for("@zibby/agent-workflow.skills.sources");globalThis[P]||(globalThis[P]=new Map);globalThis[C]||(globalThis[C]=new Map);pt=globalThis[P],kt=globalThis[C]});var tt={};at(tt,{getAgentStrategy:()=>Q,invokeAgent:()=>ht,listStrategies:()=>ft,registerStrategy:()=>dt,resolveInvocationModel:()=>X});function dt(r){if(!r||typeof r.getName!="function"||typeof r.invoke!="function")throw new Error("strategy must implement getName() and invoke() (AgentStrategy shape)");let t=y.findIndex(e=>e.getName()===r.getName());t>=0?y[t]=r:y.push(r)}function ft(){return y.map(r=>r.getName())}function X({config:r={},options:t={},strategyName:e,envModel:o}={}){let n=r.models||{},s=t.nodeName&&n[t.nodeName]||null,a=n.default||null,S=r.agent?.[e]?.model||null,u=(typeof o=="string"?o.trim():"")||null;return s||a||S||t.model||u||null}function Q(r={}){let{state:t={},preferredAgent:e=null}=r,o=e||t.agentType||process.env.AGENT_TYPE;if(!o){let s=y.map(a=>a.getName()).join(", ")||"none registered";throw new Error(`No agent specified. Set agentType in state or AGENT_TYPE env var. Available: ${s}`)}p.debug(`[workflow] agent selection: requested=${o}`);let n=y.find(s=>s.getName()===o);if(!n){let s=y.map(a=>a.getName()).join(", ")||"none registered";throw new Error(`Unknown agent '${o}'. Available: ${s}`)}if(!n.canHandle(r))throw new Error(`Agent '${o}' is not available in this environment. Check credentials/environment.`);return p.debug(`[workflow] using agent: ${n.getName()}`),n}async function ht(r,t={},e={}){let o=t.state&&typeof t.state.getAll=="function"?t.state.getAll():t.state||{},n={...t,state:o},s=Q(n),a=o.config||e.config||{},S=X({config:a,options:e,strategyName:s.name,envModel:process.env.MODEL}),u={...e,model:S,workspace:o.workspace||e.workspace,schema:e.schema||t.schema,images:e.images||t.images||[],skills:e.skills||t.skills||[],plugins:e.plugins||t.plugins||[],config:a},h=r,b=u.skills||[];if(b.length>0&&!e.skipPromptFragments){let g=b.map(E=>{let l=V(E)?.promptFragment;return typeof l=="function"?l():l}).filter(Boolean);g.length>0&&(h+=`
2
2
 
3
- ${E.join(`
3
+ ${g.join(`
4
4
 
5
- `)}`)}let w=o._currentNodeConfig?.stores;if(Array.isArray(w)&&w.length>0&&typeof w[0]=="object"){let E=w.length<=8,f=w.map(n=>{let g=n?.id??n?.storeId??"",c=(n?.name??"").toString().trim()||g,T=n?.type?` \xB7 ${n.type}`:"",at=(n?.description||"").toString().replace(/\s+/g," ").trim(),F=`- ${c} \xB7 ${at||"(no description)"}${T} (id: ${g})`;if(E&&n?.schema&&typeof n.schema=="object"){let j=n.schema.properties&&typeof n.schema.properties=="object"?Object.keys(n.schema.properties):Object.keys(n.schema);j.length&&(F+=`
6
- fields: ${j.join(", ")}`)}return F});h+=`
5
+ `)}`)}let i=o._currentNodeConfig?.stores;if(Array.isArray(i)&&i.length>0&&typeof i[0]=="object"){let g=i.length<=8,E=i.map(l=>{let I=l?.id??l?.storeId??"",O=(l?.name??"").toString().trim()||I,w=l?.type?` \xB7 ${l.type}`:"",f=(l?.description||"").toString().replace(/\s+/g," ").trim(),_=`- ${O} \xB7 ${f||"(no description)"}${w} (id: ${I})`;if(g&&l?.schema&&typeof l.schema=="object"){let c=l.schema.properties&&typeof l.schema.properties=="object"?Object.keys(l.schema.properties):Object.keys(l.schema);c.length&&(_+=`
6
+ fields: ${c.join(", ")}`)}return _});h+=`
7
7
 
8
8
  AVAILABLE STORES (pick a store by its description and pass its NAME to the store tool):
9
- ${f.join(`
10
- `)}`}let b=o._currentNodeConfig?.extraPromptInstructions?.trim();return b&&(h+=`
9
+ ${E.join(`
10
+ `)}`}let m=o._currentNodeConfig?.extraPromptInstructions?.trim();return m&&(h+=`
11
11
 
12
12
  \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
13
13
  PRIORITY OVERRIDE \u2014 THE FOLLOWING INSTRUCTIONS TAKE PRECEDENCE OVER ALL PREVIOUS CONTENT
14
14
  \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
15
15
 
16
- ${b}
17
- `),u.debug(`[workflow] prompt length: ${h.length} chars`),i.invoke(h,m)}var D,y,ot=R(()=>{X();L();tt();D=Symbol.for("@zibby/agent-workflow.strategies");globalThis[D]||(globalThis[D]=[]);y=globalThis[D]});import O from"handlebars";var A=class{constructor(t){this.schema=t}parse(t){let e=t.match(/```json\s*([\s\S]*?)\s*```/);if(e)return this.validate(JSON.parse(e[1]));let o=[t.match(/\{[\s\S]*?\}/),t.match(/\{[\s\S]*\}/)].filter(Boolean).map(a=>a[0]);for(let a of o)try{return this.validate(JSON.parse(a))}catch(i){if(!(i instanceof SyntaxError))throw i}return this.validate({result:t.trim()})}validate(t){let e=[];for(let[o,a]of Object.entries(this.schema)){if(a.required&&!(o in t)&&e.push(`Missing required field: ${o}`),o in t&&a.type){let i=typeof t[o];i!==a.type&&e.push(`Field '${o}' expected ${a.type}, got ${i}`)}if(a.validate&&o in t){let i=a.validate(t[o]);i&&e.push(`Field '${o}': ${i}`)}}if(e.length>0)throw new Error(`Output validation failed:
16
+ ${m}
17
+ `),p.debug(`[workflow] prompt length: ${h.length} chars`),s.invoke(h,u)}var M,y,et=N(()=>{z();W();q();M=Symbol.for("@zibby/agent-workflow.strategies");globalThis[M]||(globalThis[M]=[]);y=globalThis[M]});import $ from"handlebars";var T=class{constructor(t){this.schema=t}parse(t){let e=t.match(/```json\s*([\s\S]*?)\s*```/);if(e)return this.validate(JSON.parse(e[1]));let o=[t.match(/\{[\s\S]*?\}/),t.match(/\{[\s\S]*\}/)].filter(Boolean).map(n=>n[0]);for(let n of o)try{return this.validate(JSON.parse(n))}catch(s){if(!(s instanceof SyntaxError))throw s}return this.validate({result:t.trim()})}validate(t){let e=[];for(let[o,n]of Object.entries(this.schema)){if(n.required&&!(o in t)&&e.push(`Missing required field: ${o}`),o in t&&n.type){let s=typeof t[o];s!==n.type&&e.push(`Field '${o}' expected ${n.type}, got ${s}`)}if(n.validate&&o in t){let s=n.validate(t[o]);s&&e.push(`Field '${o}': ${s}`)}}if(e.length>0)throw new Error(`Output validation failed:
18
18
  ${e.join(`
19
- `)}`);return t}};L();import{writeFileSync as G,readFileSync as it,existsSync as st,mkdirSync as _t}from"node:fs";import{join as M,dirname as St}from"node:path";import p from"chalk";var pt="__WORKFLOW_GRAPH_LOG__",$=p.gray("\u2502"),dt=p.gray("\u250C"),H=p.gray("\u2514"),W=p.green("\u25C6"),K=p.hex("#c084fc")("\u25C6"),U=p.hex("#2dd4bf")("\u25C6"),C=p.red("\u25C6"),J=`${$} `,Y=2;function V(r){return r<1e3?`${r}ms`:`${(r/1e3).toFixed(1)}s`}function Z(r,t){return(e,o,a)=>{if(typeof e!="string")return r(e,o,a);let i=process.stdout.columns||120,l="";for(let _=0;_<e.length;_++){let d=e[_];t.lineStart&&(l+=J,t.col=Y,t.lineStart=!1),d===`
20
- `?(l+=d,t.lineStart=!0,t.col=0,t.inEsc=!1):d==="\x1B"?(t.inEsc=!0,l+=d):t.inEsc?(l+=d,(d>="A"&&d<="Z"||d>="a"&&d<="z")&&(t.inEsc=!1)):(t.col++,l+=d,t.col>=i&&(l+=`
21
- ${J}`,t.col=Y))}return r(l,o,a)}}var x=class{constructor(){this._currentNode=null,this._origStdoutWrite=null,this._origStderrWrite=null,this._emitWorkflowGraphMarkers=String(process.env.ZIBBY_EMIT_GRAPH_MARKERS||"").trim()==="1"||String(process.env.ZIBBY_WORKFLOW_GRAPH_LOG_MARKERS||"").trim()==="1"}get isInsideNode(){return this._currentNode!==null}_startIntercepting(){this._origStdoutWrite=process.stdout.write.bind(process.stdout),this._origStderrWrite=process.stderr.write.bind(process.stderr);let t={lineStart:!0,col:0,inEsc:!1},e={lineStart:!0,col:0,inEsc:!1};this._outState=t,this._errState=e,process.stdout.write=Z(this._origStdoutWrite,t),process.stderr.write=Z(this._origStderrWrite,e)}_stopIntercepting(){this._origStdoutWrite&&(this._outState&&!this._outState.lineStart&&this._origStdoutWrite(`
19
+ `)}`);return t}};W();import{writeFileSync as F,readFileSync as rt,existsSync as ot,mkdirSync as mt}from"node:fs";import{join as j,dirname as gt}from"node:path";import d from"chalk";var ct="__WORKFLOW_GRAPH_LOG__",k=d.gray("\u2502"),ut=d.gray("\u250C"),G=d.gray("\u2514"),v=d.green("\u25C6"),H=d.hex("#c084fc")("\u25C6"),J=d.hex("#2dd4bf")("\u25C6"),x=d.red("\u25C6"),U=`${k} `,B=2;function K(r){return r<1e3?`${r}ms`:`${(r/1e3).toFixed(1)}s`}function Y(r,t){return(e,o,n)=>{if(typeof e!="string")return r(e,o,n);let s=process.stdout.columns||120,a="";for(let S=0;S<e.length;S++){let u=e[S];t.lineStart&&(a+=U,t.col=B,t.lineStart=!1),u===`
20
+ `?(a+=u,t.lineStart=!0,t.col=0,t.inEsc=!1):u==="\x1B"?(t.inEsc=!0,a+=u):t.inEsc?(a+=u,(u>="A"&&u<="Z"||u>="a"&&u<="z")&&(t.inEsc=!1)):(t.col++,a+=u,t.col>=s&&(a+=`
21
+ ${U}`,t.col=B))}return r(a,o,n)}}var R=class{constructor(){this._currentNode=null,this._origStdoutWrite=null,this._origStderrWrite=null,this._emitWorkflowGraphMarkers=String(process.env.ZIBBY_EMIT_GRAPH_MARKERS||"").trim()==="1"||String(process.env.ZIBBY_WORKFLOW_GRAPH_LOG_MARKERS||"").trim()==="1"}get isInsideNode(){return this._currentNode!==null}_startIntercepting(){this._origStdoutWrite=process.stdout.write.bind(process.stdout),this._origStderrWrite=process.stderr.write.bind(process.stderr);let t={lineStart:!0,col:0,inEsc:!1},e={lineStart:!0,col:0,inEsc:!1};this._outState=t,this._errState=e,process.stdout.write=Y(this._origStdoutWrite,t),process.stderr.write=Y(this._origStderrWrite,e)}_stopIntercepting(){this._origStdoutWrite&&(this._outState&&!this._outState.lineStart&&this._origStdoutWrite(`
22
22
  `),process.stdout.write=this._origStdoutWrite),this._origStderrWrite&&(this._errState&&!this._errState.lineStart&&this._origStderrWrite(`
23
23
  `),process.stderr.write=this._origStderrWrite),this._origStdoutWrite=null,this._origStderrWrite=null}_rawWrite(t){(this._origStdoutWrite||process.stdout.write.bind(process.stdout))(`${t}
24
- `)}_emitGraphLogMarker(t){if(!this._emitWorkflowGraphMarkers)return;let e=`${pt}${JSON.stringify(t)}
24
+ `)}_emitGraphLogMarker(t){if(!this._emitWorkflowGraphMarkers)return;let e=`${ct}${JSON.stringify(t)}
25
25
  `;this._origStdoutWrite?this._origStdoutWrite(e):process.stdout.write(e)}_writeDot(t,e){this._origStdoutWrite?(this._outState&&!this._outState.lineStart&&(this._origStdoutWrite(`
26
26
  `),this._outState.lineStart=!0,this._outState.col=0),this._origStdoutWrite(`${t} ${e}
27
27
  `)):process.stdout.write.bind(process.stdout)(`${t} ${e}
28
- `)}step(t){this._origStdoutWrite?this._writeDot(W,t):process.stdout.write.bind(process.stdout)(`${$} ${W} ${t}
29
- `)}stepInfo(t){this.step(t)}stepTool(t){this._origStdoutWrite?this._writeDot(K,t):process.stdout.write.bind(process.stdout)(`${$} ${K} ${t}
30
- `)}stepMemory(t){let e=p.hex("#2dd4bf")(t);this._origStdoutWrite?this._writeDot(U,e):process.stdout.write.bind(process.stdout)(`${$} ${U} ${e}
31
- `)}stepFail(t){this._origStdoutWrite?this._writeDot(C,p.red(t)):process.stdout.write.bind(process.stdout)(`${$} ${C} ${p.red(t)}
32
- `)}nodeStart(t){this._currentNode=t,this._emitGraphLogMarker({phase:"node_begin",node:t}),this._rawWrite(`${dt} ${t}`),this._startIntercepting()}nodeComplete(t,e={}){this._stopIntercepting();let{duration:o,details:a}=e;if(a)for(let l of a)this._rawWrite(`${W} ${l}`);let i=o?p.dim(` ${V(o)}`):"";this._rawWrite(`${H} ${p.green("done")}${i}`),this._emitGraphLogMarker({phase:"node_end",node:t}),this._rawWrite("")}nodeFailed(t,e,o={}){this._stopIntercepting();let{duration:a}=o,i=a?p.dim(` ${V(a)}`):"";this._rawWrite(`${C} ${p.red(e)}`),this._rawWrite(`${H} ${p.red("failed")}${i}`),this._emitGraphLogMarker({phase:"node_end",node:t}),this._rawWrite("")}route(t,e){this._rawWrite(p.dim(` ${t} \u2192 ${e}`)),this._rawWrite("")}graphComplete(){}},z=new x;var v=".session-info.json";var q={BROWSER:"browser",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",FIGMA:"figma",OPEN_DESIGN:"open-design",GIT:"git",GIT_WRITE:"git-write",SLACK:"slack",LARK:"lark",DISCORD:"discord",CHAT_NOTIFY:"chat_notify",SENTRY:"sentry",MEMORY:"memory",CHAT_MEMORY:"chat-memory",KV_MEMORY:"kv-memory",RUNNER:"runner",SKILL_INSTALLER:"skill-installer",CORE_TOOLS:"core-tools",WORKFLOW_BUILDER:"workflow-builder",SESSION:"session",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE_DOCS:"google-docs",LARK_DOCS:"lark-docs",DOC_SOURCE:"doc_source",LINEAR:"linear",PLANE:"plane",CODEBASE_MEMORY:"codebase-memory",DATASET_STORE:"dataset-store",LINKEDIN:"linkedin",CIRCLECI:"circleci",TRIGGER_AGENT:"trigger-agent",CODE_SCAN:"code-scan"},$t=Object.freeze([q.CODEBASE_MEMORY,q.CODE_SCAN]);O.helpers.inc||O.registerHelper("inc",r=>Number(r)+1);O.helpers.json||O.registerHelper("json",r=>JSON.stringify(r,null,2));O.helpers.eq||O.registerHelper("eq",(r,t)=>r===t);var nt=class{constructor(t){if(this.config=t,this.name=t.name,this.prompt=t.prompt,this.outputSchema=t.outputSchema,!this.outputSchema&&!t._isCustomCode&&!t._isRouter)throw new Error(`Node '${this.name}' must define outputSchema (Zod schema). This defines the contract for what the node returns to state.`);this.isZodSchema=this.outputSchema&&typeof this.outputSchema._def<"u",this.parser=t.outputSchema&&!this.isZodSchema?new A(t.outputSchema):null,this.retries=t.retries||0,this.onComplete=t.onComplete,this.customExecute=t.execute}async execute(t,e){if(this.config._isRouter)return u.debug(`[workflow] node '${this.name}': router passthrough (routing happens on its conditional edges)`),{success:!0,output:{},raw:null};let o=()=>e&&typeof e.getAll=="function"?e.getAll():t,a=s=>e&&typeof e.get=="function"?e.get(s):t?.[s];if(typeof this.customExecute=="function"){u.debug(`[workflow] node '${this.name}': custom execute (skipping LLM)`);try{let s=await this.customExecute(t);return typeof s=="object"&&s!==null&&s.success===!1?{success:!1,error:s.error||"Node execution failed",raw:s.raw||null}:this.isZodSchema?(u.debug(`[workflow] node '${this.name}': validating output schema`),{success:!0,output:this.outputSchema.parse(s),raw:null}):{success:!0,output:s,raw:null}}catch(s){return u.error(`[workflow] node '${this.name}' failed: ${s.message}`),s.name==="ZodError"&&u.error(`Schema errors: ${JSON.stringify(s.issues||s.errors,null,2)}`),{success:!1,error:s.message,raw:null}}}let i;typeof this.prompt=="function"?i=this.prompt(o()):typeof this.prompt=="string"&&this.prompt.includes("{{")?(this._compiledPrompt||(this._compiledPrompt=O.compile(this.prompt,{noEscape:!0})),i=this._compiledPrompt(o())):i=this.prompt;let l=a("_skillHints");l&&(i=`${l}
28
+ `)}step(t){this._origStdoutWrite?this._writeDot(v,t):process.stdout.write.bind(process.stdout)(`${k} ${v} ${t}
29
+ `)}stepInfo(t){this.step(t)}stepTool(t){this._origStdoutWrite?this._writeDot(H,t):process.stdout.write.bind(process.stdout)(`${k} ${H} ${t}
30
+ `)}stepMemory(t){let e=d.hex("#2dd4bf")(t);this._origStdoutWrite?this._writeDot(J,e):process.stdout.write.bind(process.stdout)(`${k} ${J} ${e}
31
+ `)}stepFail(t){this._origStdoutWrite?this._writeDot(x,d.red(t)):process.stdout.write.bind(process.stdout)(`${k} ${x} ${d.red(t)}
32
+ `)}nodeStart(t){this._currentNode=t,this._emitGraphLogMarker({phase:"node_begin",node:t}),this._rawWrite(`${ut} ${t}`),this._startIntercepting()}nodeComplete(t,e={}){this._stopIntercepting();let{duration:o,details:n}=e;if(n)for(let a of n)this._rawWrite(`${v} ${a}`);let s=o?d.dim(` ${K(o)}`):"";this._rawWrite(`${G} ${d.green("done")}${s}`),this._emitGraphLogMarker({phase:"node_end",node:t}),this._rawWrite("")}nodeFailed(t,e,o={}){this._stopIntercepting();let{duration:n}=o,s=n?d.dim(` ${K(n)}`):"";this._rawWrite(`${x} ${d.red(e)}`),this._rawWrite(`${G} ${d.red("failed")}${s}`),this._emitGraphLogMarker({phase:"node_end",node:t}),this._rawWrite("")}route(t,e){this._rawWrite(d.dim(` ${t} \u2192 ${e}`)),this._rawWrite("")}graphComplete(){}},Z=new R;var L=".session-info.json";var Et=Object.freeze(["codebase-memory","code-scan"]);$.helpers.inc||$.registerHelper("inc",r=>Number(r)+1);$.helpers.json||$.registerHelper("json",r=>JSON.stringify(r,null,2));$.helpers.eq||$.registerHelper("eq",(r,t)=>r===t);var it=class{constructor(t){if(this.config=t,this.name=t.name,this.prompt=t.prompt,this.outputSchema=t.outputSchema,!this.outputSchema&&!t._isCustomCode&&!t._isRouter)throw new Error(`Node '${this.name}' must define outputSchema (Zod schema). This defines the contract for what the node returns to state.`);this.isZodSchema=this.outputSchema&&typeof this.outputSchema._def<"u",this.parser=t.outputSchema&&!this.isZodSchema?new T(t.outputSchema):null,this.retries=t.retries||0,this.onComplete=t.onComplete,this.customExecute=t.execute}async execute(t,e){if(this.config._isRouter)return p.debug(`[workflow] node '${this.name}': router passthrough (routing happens on its conditional edges)`),{success:!0,output:{},raw:null};let o=()=>e&&typeof e.getAll=="function"?e.getAll():t,n=i=>e&&typeof e.get=="function"?e.get(i):t?.[i];if(typeof this.customExecute=="function"){p.debug(`[workflow] node '${this.name}': custom execute (skipping LLM)`);try{let i=await this.customExecute(t);return typeof i=="object"&&i!==null&&i.success===!1?{success:!1,error:i.error||"Node execution failed",raw:i.raw||null}:this.isZodSchema?(p.debug(`[workflow] node '${this.name}': validating output schema`),{success:!0,output:this.outputSchema.parse(i),raw:null}):{success:!0,output:i,raw:null}}catch(i){return p.error(`[workflow] node '${this.name}' failed: ${i.message}`),i.name==="ZodError"&&p.error(`Schema errors: ${JSON.stringify(i.issues||i.errors,null,2)}`),{success:!1,error:i.message,raw:null}}}let s;typeof this.prompt=="function"?s=this.prompt(o()):typeof this.prompt=="string"&&this.prompt.includes("{{")?(this._compiledPrompt||(this._compiledPrompt=$.compile(this.prompt,{noEscape:!0})),s=this._compiledPrompt(o())):s=this.prompt;let a=n("_skillHints");a&&(s=`${a}
33
33
 
34
- ${i}`);let _=o(),d=_.cwd||process.cwd(),S=_.sessionPath;try{if(S){let s=M(S,v);if(st(s)){let h=JSON.parse(it(s,"utf-8"));h.currentNode=this.name,G(s,JSON.stringify(h,null,2),"utf-8")}let m=M(S,"..",v);if(st(m))try{let h=JSON.parse(it(m,"utf-8"));h.currentNode=this.name,G(m,JSON.stringify(h,null,2),"utf-8")}catch{}}}catch(s){u.debug(`[workflow] could not update session info: ${s.message}`)}let N=null;for(let s=0;s<=this.retries;s++)try{u.debug(`[workflow] node '${this.name}' attempt ${s}`);let m=o().config||{},h=m.agents||{},I=this.config.agent??h[this.name]??null,w={state:o()};I&&(w.preferredAgent=I);let b={workspace:d,schema:this.isZodSchema?this.outputSchema:null,skills:this.config.skills||[],plugins:this.config.plugins||[],sessionPath:S,config:m,nodeName:this.name,timeout:this.config?.timeout||3e5},E=t?._coreInvokeAgent;E||(E=(await Promise.resolve().then(()=>(ot(),rt))).invokeAgent);let f=await E(i,w,b),n,g;if(typeof f=="string"?(n=f,g=null):f.structured?(n=f.raw||JSON.stringify(f.structured,null,2),g=f.structured):(n=f.raw||JSON.stringify(f,null,2),g=f.extracted||null),S)try{let c=M(S,this.name,"raw_stream_output.txt");_t(St(c),{recursive:!0}),G(c,typeof n=="string"?n:JSON.stringify(n),"utf-8")}catch(c){u.debug(`[workflow] could not save raw output: ${c.message}`)}if(this.isZodSchema&&g){u.info(`[workflow] node '${this.name}': output validated: ${JSON.stringify(g,null,2)}`);let c=g;if(typeof this.onComplete=="function")try{c=await this.onComplete(o(),g)}catch(T){u.warn(`[workflow] onComplete hook failed: ${T.message}`)}return{success:!0,output:c,raw:n}}if(typeof this.onComplete=="function")try{return{success:!0,output:await this.onComplete(o(),{raw:n}),raw:n}}catch(c){throw new Error(`onComplete failed: ${c.message}`,{cause:c})}if(this.parser){let c=this.parser.parse(n);return u.info(`[workflow] node '${this.name}': parsed output: ${JSON.stringify(c,null,2)}`),z.step("Output parsed"),{success:!0,output:c,raw:n}}return{success:!0,output:n,raw:n}}catch(m){N=m,s<this.retries&&u.info(`[workflow] node '${this.name}' failed, retrying (${s+1}/${this.retries})\u2026`)}return{success:!1,error:N.message,raw:null}}};export{nt as Node};
34
+ ${s}`);let S=o(),u=S.cwd||process.cwd(),h=S.sessionPath;try{if(h){let i=j(h,L);if(ot(i)){let g=JSON.parse(rt(i,"utf-8"));g.currentNode=this.name,F(i,JSON.stringify(g,null,2),"utf-8")}let m=j(h,"..",L);if(ot(m))try{let g=JSON.parse(rt(m,"utf-8"));g.currentNode=this.name,F(m,JSON.stringify(g,null,2),"utf-8")}catch{}}}catch(i){p.debug(`[workflow] could not update session info: ${i.message}`)}let b=null;for(let i=0;i<=this.retries;i++)try{p.debug(`[workflow] node '${this.name}' attempt ${i}`);let m=o().config||{},g=m.agents||{},E=this.config.agent??g[this.name]??null,l={state:o()};E&&(l.preferredAgent=E);let I={workspace:u,schema:this.isZodSchema?this.outputSchema:null,skills:this.config.skills||[],plugins:this.config.plugins||[],sessionPath:h,config:m,nodeName:this.name,timeout:this.config?.timeout||3e5},O=t?._coreInvokeAgent;O||(O=(await Promise.resolve().then(()=>(et(),tt))).invokeAgent);let w=await O(s,l,I),f,_;if(typeof w=="string"?(f=w,_=null):w.structured?(f=w.raw||JSON.stringify(w.structured,null,2),_=w.structured):(f=w.raw||JSON.stringify(w,null,2),_=w.extracted||null),h)try{let c=j(h,this.name,"raw_stream_output.txt");mt(gt(c),{recursive:!0}),F(c,typeof f=="string"?f:JSON.stringify(f),"utf-8")}catch(c){p.debug(`[workflow] could not save raw output: ${c.message}`)}if(this.isZodSchema&&_){p.info(`[workflow] node '${this.name}': output validated: ${JSON.stringify(_,null,2)}`);let c=_;if(typeof this.onComplete=="function")try{c=await this.onComplete(o(),_)}catch(st){p.warn(`[workflow] onComplete hook failed: ${st.message}`)}return{success:!0,output:c,raw:f}}if(typeof this.onComplete=="function")try{return{success:!0,output:await this.onComplete(o(),{raw:f}),raw:f}}catch(c){throw new Error(`onComplete failed: ${c.message}`,{cause:c})}if(this.parser){let c=this.parser.parse(f);return p.info(`[workflow] node '${this.name}': parsed output: ${JSON.stringify(c,null,2)}`),Z.step("Output parsed"),{success:!0,output:c,raw:f}}return{success:!0,output:f,raw:f}}catch(m){b=m,i<this.retries&&p.info(`[workflow] node '${this.name}' failed, retrying (${i+1}/${this.retries})\u2026`)}return{success:!1,error:b.message,raw:null}}};export{it as Node};
@@ -11,6 +11,13 @@
11
11
  * @param {string} [skill.cursorKey] - Override key for ~/.cursor/mcp.json
12
12
  * @param {Function} [skill.promptFragment] - () => string | string injected into agent prompt
13
13
  * @param {Function} [skill.middleware] - async () => middlewareFn | null
14
+ * @param {Object} [opts]
15
+ * @param {string} [opts.source] - Provenance (package name) registering this skill.
16
+ * The Phase-3 loader tags each package's skills with
17
+ * its name; first-party callers omit it (trusted).
18
+ * @param {boolean} [opts.override] - Explicit escape hatch: replace an existing id even
19
+ * across sources. First-party / intentional only.
20
+ * @throws if a DIFFERENT source tries to overwrite an already-registered id (collision).
14
21
  */
15
22
  export function registerSkill(skill: {
16
23
  id: string;
@@ -23,11 +30,22 @@ export function registerSkill(skill: {
23
30
  cursorKey?: string;
24
31
  promptFragment?: Function;
25
32
  middleware?: Function;
33
+ }, opts?: {
34
+ source?: string;
35
+ override?: boolean;
26
36
  }): void;
27
37
  /** @returns {object|null} */
28
38
  export function getSkill(id: any): object | null;
29
39
  /** @returns {boolean} */
30
40
  export function hasSkill(id: any): boolean;
41
+ /**
42
+ * The provenance (package name) that registered an id, or `null` for a
43
+ * first-party (untagged) registration / an unknown id. Lets the runtime decide
44
+ * secret-scoping: a skill with a non-null third-party source must NOT receive
45
+ * ambient tenant tokens / the egress JWT (Phase-3 secret-scoping prereq).
46
+ * @returns {string|null}
47
+ */
48
+ export function getSkillSource(id: any): string | null;
31
49
  /** @returns {Map<string, object>} shallow copy */
32
50
  export function getAllSkills(): Map<string, object>;
33
51
  /** @returns {string[]} */
@@ -1 +1 @@
1
- var e=Symbol.for("@zibby/agent-workflow.skills");globalThis[e]||(globalThis[e]=new Map);var r=globalThis[e];function i(t){if(!t||typeof t.id!="string")throw new Error("Skill definition must include a string id");r.set(t.id,Object.freeze({...t}))}function n(t){return r.get(t)||null}function l(t){return r.has(t)}function o(){return new Map(r)}function s(){return Array.from(r.keys())}function f(){r.clear()}export{f as clearSkills,o as getAllSkills,n as getSkill,l as hasSkill,s as listSkillIds,i as registerSkill};
1
+ var n=Symbol.for("@zibby/agent-workflow.skills"),s=Symbol.for("@zibby/agent-workflow.skills.sources");globalThis[n]||(globalThis[n]=new Map);globalThis[s]||(globalThis[s]=new Map);var r=globalThis[n],i=globalThis[s];function g(e,a={}){if(!e||typeof e.id!="string")throw new Error("Skill definition must include a string id");let{source:o,override:c=!1}=a,t=e.id;if(r.has(t)&&!c){let l=i.get(t);if(!(l===o)){let f=l||"first-party",u=o||"first-party";throw new Error(`Skill id collision: "${t}" is already registered by ${f}; ${u} may not overwrite it. Ids are append-only and first-party ids cannot be shadowed. Pick a unique id (or pass { override: true } for a deliberate first-party replacement).`)}}r.set(t,Object.freeze({...e})),o===void 0?i.delete(t):i.set(t,o)}function p(e){return r.get(e)||null}function b(e){return r.has(e)}function y(e){return i.get(e)||null}function S(){return new Map(r)}function w(){return Array.from(r.keys())}function h(){r.clear(),i.clear()}export{h as clearSkills,S as getAllSkills,p as getSkill,y as getSkillSource,b as hasSkill,w as listSkillIds,g as registerSkill};
@@ -18,7 +18,19 @@ export function listStrategies(): string[];
18
18
  * @param {object} [context]
19
19
  * @returns {AgentStrategy}
20
20
  */
21
- export function getAgentStrategy(context?: object): AgentStrategy;
21
+ /**
22
+ * The ONE place an invocation's model is resolved. Chain, most-specific first:
23
+ * config.models[node] > config.models.default > config.agent[vendor].model
24
+ * > options.model (the node's explicit per-call pick, e.g. triage's cheap tier)
25
+ * Pure function so the contract is unit-tested — the o4-mini incident was this
26
+ * chain resolving to null and the strategy silently substituting its vendor
27
+ * default underneath us.
28
+ */
29
+ export function resolveInvocationModel({ config, options, strategyName, envModel }?: {
30
+ config?: {};
31
+ options?: {};
32
+ }): any;
33
+ export function getAgentStrategy(context?: {}): any;
22
34
  /**
23
35
  * Invoke an agent with automatic strategy selection.
24
36
  * @param {string} prompt
@@ -1,17 +1,17 @@
1
- var T=()=>{},x={debug:T,info:T,warn:(...e)=>console.warn("[workflow]",...e),error:(...e)=>console.error("[workflow]",...e)},p={impl:x};var f={debug:(...e)=>p.impl.debug?.(...e),info:(...e)=>p.impl.info?.(...e),warn:(...e)=>p.impl.warn?.(...e),error:(...e)=>p.impl.error?.(...e)};var d=Symbol.for("@zibby/agent-workflow.skills");globalThis[d]||(globalThis[d]=new Map);var P=globalThis[d];function A(e){return P.get(e)||null}var h=Symbol.for("@zibby/agent-workflow.strategies");globalThis[h]||(globalThis[h]=[]);var l=globalThis[h];function D(e){if(!e||typeof e.getName!="function"||typeof e.invoke!="function")throw new Error("strategy must implement getName() and invoke() (AgentStrategy shape)");let o=l.findIndex(n=>n.getName()===e.getName());o>=0?l[o]=e:l.push(e)}function F(){return l.map(e=>e.getName())}function C(e={}){let{state:o={},preferredAgent:n=null}=e,r=n||o.agentType||process.env.AGENT_TYPE;if(!r){let i=l.map(s=>s.getName()).join(", ")||"none registered";throw new Error(`No agent specified. Set agentType in state or AGENT_TYPE env var. Available: ${i}`)}f.debug(`[workflow] agent selection: requested=${r}`);let a=l.find(i=>i.getName()===r);if(!a){let i=l.map(s=>s.getName()).join(", ")||"none registered";throw new Error(`Unknown agent '${r}'. Available: ${i}`)}if(!a.canHandle(e))throw new Error(`Agent '${r}' is not available in this environment. Check credentials/environment.`);return f.debug(`[workflow] using agent: ${a.getName()}`),a}async function K(e,o={},n={}){let r=o.state&&typeof o.state.getAll=="function"?o.state.getAll():o.state||{},a={...o,state:r},i=C(a),s=r.config||n.config||{},w=s.models||{},$=n.nodeName&&w[n.nodeName]||null,v=w.default||null,I=s.agent?.[i.name]?.model||null,_=$||v||I||n.model||null,k={...n,model:_,workspace:r.workspace||n.workspace,schema:n.schema||o.schema,images:n.images||o.images||[],skills:n.skills||o.skills||[],plugins:n.plugins||o.plugins||[],config:s},c=e,b=k.skills||[];if(b.length>0&&!n.skipPromptFragments){let m=b.map(u=>{let t=A(u)?.promptFragment;return typeof t=="function"?t():t}).filter(Boolean);m.length>0&&(c+=`
1
+ var v=()=>{},_={debug:v,info:v,warn:(...e)=>console.warn("[workflow]",...e),error:(...e)=>console.error("[workflow]",...e)},m={impl:_};var d={debug:(...e)=>m.impl.debug?.(...e),info:(...e)=>m.impl.info?.(...e),warn:(...e)=>m.impl.warn?.(...e),error:(...e)=>m.impl.error?.(...e)};var w=Symbol.for("@zibby/agent-workflow.skills"),b=Symbol.for("@zibby/agent-workflow.skills.sources");globalThis[w]||(globalThis[w]=new Map);globalThis[b]||(globalThis[b]=new Map);var x=globalThis[w],P=globalThis[b];function A(e){return x.get(e)||null}var y=Symbol.for("@zibby/agent-workflow.strategies");globalThis[y]||(globalThis[y]=[]);var a=globalThis[y];function D(e){if(!e||typeof e.getName!="function"||typeof e.invoke!="function")throw new Error("strategy must implement getName() and invoke() (AgentStrategy shape)");let t=a.findIndex(r=>r.getName()===e.getName());t>=0?a[t]=e:a.push(e)}function H(){return a.map(e=>e.getName())}function R({config:e={},options:t={},strategyName:r,envModel:o}={}){let s=e.models||{},i=t.nodeName&&s[t.nodeName]||null,l=s.default||null,u=e.agent?.[r]?.model||null,p=(typeof o=="string"?o.trim():"")||null;return i||l||u||t.model||p||null}function j(e={}){let{state:t={},preferredAgent:r=null}=e,o=r||t.agentType||process.env.AGENT_TYPE;if(!o){let i=a.map(l=>l.getName()).join(", ")||"none registered";throw new Error(`No agent specified. Set agentType in state or AGENT_TYPE env var. Available: ${i}`)}d.debug(`[workflow] agent selection: requested=${o}`);let s=a.find(i=>i.getName()===o);if(!s){let i=a.map(l=>l.getName()).join(", ")||"none registered";throw new Error(`Unknown agent '${o}'. Available: ${i}`)}if(!s.canHandle(e))throw new Error(`Agent '${o}' is not available in this environment. Check credentials/environment.`);return d.debug(`[workflow] using agent: ${s.getName()}`),s}async function K(e,t={},r={}){let o=t.state&&typeof t.state.getAll=="function"?t.state.getAll():t.state||{},s={...t,state:o},i=j(s),l=o.config||r.config||{},u=R({config:l,options:r,strategyName:i.name,envModel:process.env.MODEL}),p={...r,model:u,workspace:o.workspace||r.workspace,schema:r.schema||t.schema,images:r.images||t.images||[],skills:r.skills||t.skills||[],plugins:r.plugins||t.plugins||[],config:l},c=e,k=p.skills||[];if(k.length>0&&!r.skipPromptFragments){let f=k.map(h=>{let n=A(h)?.promptFragment;return typeof n=="function"?n():n}).filter(Boolean);f.length>0&&(c+=`
2
2
 
3
- ${m.join(`
3
+ ${f.join(`
4
4
 
5
- `)}`)}let g=r._currentNodeConfig?.stores;if(Array.isArray(g)&&g.length>0&&typeof g[0]=="object"){let m=g.length<=8,u=g.map(t=>{let E=t?.id??t?.storeId??"",O=(t?.name??"").toString().trim()||E,R=t?.type?` \xB7 ${t.type}`:"",j=(t?.description||"").toString().replace(/\s+/g," ").trim(),S=`- ${O} \xB7 ${j||"(no description)"}${R} (id: ${E})`;if(m&&t?.schema&&typeof t.schema=="object"){let N=t.schema.properties&&typeof t.schema.properties=="object"?Object.keys(t.schema.properties):Object.keys(t.schema);N.length&&(S+=`
6
- fields: ${N.join(", ")}`)}return S});c+=`
5
+ `)}`)}let g=o._currentNodeConfig?.stores;if(Array.isArray(g)&&g.length>0&&typeof g[0]=="object"){let f=g.length<=8,h=g.map(n=>{let S=n?.id??n?.storeId??"",$=(n?.name??"").toString().trim()||S,I=n?.type?` \xB7 ${n.type}`:"",O=(n?.description||"").toString().replace(/\s+/g," ").trim(),N=`- ${$} \xB7 ${O||"(no description)"}${I} (id: ${S})`;if(f&&n?.schema&&typeof n.schema=="object"){let T=n.schema.properties&&typeof n.schema.properties=="object"?Object.keys(n.schema.properties):Object.keys(n.schema);T.length&&(N+=`
6
+ fields: ${T.join(", ")}`)}return N});c+=`
7
7
 
8
8
  AVAILABLE STORES (pick a store by its description and pass its NAME to the store tool):
9
- ${u.join(`
10
- `)}`}let y=r._currentNodeConfig?.extraPromptInstructions?.trim();return y&&(c+=`
9
+ ${h.join(`
10
+ `)}`}let E=o._currentNodeConfig?.extraPromptInstructions?.trim();return E&&(c+=`
11
11
 
12
12
  \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
13
13
  PRIORITY OVERRIDE \u2014 THE FOLLOWING INSTRUCTIONS TAKE PRECEDENCE OVER ALL PREVIOUS CONTENT
14
14
  \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
15
15
 
16
- ${y}
17
- `),f.debug(`[workflow] prompt length: ${c.length} chars`),i.invoke(c,k)}export{C as getAgentStrategy,K as invokeAgent,F as listStrategies,D as registerStrategy};
16
+ ${E}
17
+ `),d.debug(`[workflow] prompt length: ${c.length} chars`),i.invoke(c,p)}export{j as getAgentStrategy,K as invokeAgent,H as listStrategies,D as registerStrategy,R as resolveInvocationModel};
@@ -1 +1 @@
1
- var f=Symbol.for("@zibby/agent-workflow.skills");globalThis[f]||(globalThis[f]=new Map);var d=globalThis[f];function u(o){return d.get(o)||null}var p=()=>{},w={debug:p,info:p,warn:(...o)=>console.warn("[workflow]",...o),error:(...o)=>console.error("[workflow]",...o)},l={impl:w};var g={debug:(...o)=>l.impl.debug?.(...o),info:(...o)=>l.impl.info?.(...o),warn:(...o)=>l.impl.warn?.(...o),error:(...o)=>l.impl.error?.(...o)};var k={};function S(o,t){if(Array.isArray(t))return m(t);let n=k[o];return!n||n.length===0?null:m(n)}function m(o){if(!Array.isArray(o)||o.length===0)return null;let t=[],n={},s=[];for(let i of o){let e=u(i);if(!e){g.warn(`[workflow] unknown skill "${i}" \u2014 skipping`);continue}s.push(i);for(let r of e.tools||[])t.push({name:r.name,description:r.description,input_schema:r.input_schema||{type:"object",properties:{}}});if(!n[e.serverName])if(typeof e.resolve=="function"){let r=e.resolve();r&&(n[e.serverName]={...r,toolPrefix:i})}else{let r={};for(let c of e.envKeys||[]){let a=process.env[c];a&&(r[c]=a)}n[e.serverName]={command:e.command,args:[...e.args||[]],env:r,toolPrefix:i}}}return s.length===0?null:{toolIds:s,claudeTools:t,mcpServers:n}}export{k as NODE_DEFAULT_TOOLS,m as getResolvedToolDefinitions,S as resolveNodeTools};
1
+ var a=Symbol.for("@zibby/agent-workflow.skills"),c=Symbol.for("@zibby/agent-workflow.skills.sources");globalThis[a]||(globalThis[a]=new Map);globalThis[c]||(globalThis[c]=new Map);var w=globalThis[a],k=globalThis[c];function p(e){return w.get(e)||null}var g=()=>{},y={debug:g,info:g,warn:(...e)=>console.warn("[workflow]",...e),error:(...e)=>console.error("[workflow]",...e)},s={impl:y};var d={debug:(...e)=>s.impl.debug?.(...e),info:(...e)=>s.impl.info?.(...e),warn:(...e)=>s.impl.warn?.(...e),error:(...e)=>s.impl.error?.(...e)};var b={};function T(e,t){if(Array.isArray(t))return m(t);let n=b[e];return!n||n.length===0?null:m(n)}function m(e){if(!Array.isArray(e)||e.length===0)return null;let t=[],n={},l=[];for(let i of e){let o=p(i);if(!o){d.warn(`[workflow] unknown skill "${i}" \u2014 skipping`);continue}l.push(i);for(let r of o.tools||[])t.push({name:r.name,description:r.description,input_schema:r.input_schema||{type:"object",properties:{}}});if(!n[o.serverName])if(typeof o.resolve=="function"){let r=o.resolve();r&&(n[o.serverName]={...r,toolPrefix:i})}else{let r={};for(let f of o.envKeys||[]){let u=process.env[f];u&&(r[f]=u)}n[o.serverName]={command:o.command,args:[...o.args||[]],env:r,toolPrefix:i}}}return l.length===0?null:{toolIds:l,claudeTools:t,mcpServers:n}}export{b as NODE_DEFAULT_TOOLS,m as getResolvedToolDefinitions,T as resolveNodeTools};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zibby/agent-workflow",
3
- "version": "0.4.36",
3
+ "version": "0.4.38",
4
4
  "description": "Graph-based AI agent workflow orchestration. Bring your own agent strategies.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",