Lines 1-43javascript
1var ve=Object.defineProperty;var ot=(r,t)=>()=>(r&&(t=r(r=0)),t);var Dt=(r,t)=>{for(var e in t)ve(r,e,{get:t[e],enumerable:!0})};var Lt,ke,it,_,V=ot(()=>{Lt=()=>{},ke={debug:Lt,info:Lt,warn:(...r)=>console.warn("[workflow]",...r),error:(...r)=>console.error("[workflow]",...r)},it={impl:ke},_={debug:(...r)=>it.impl.debug?.(...r),info:(...r)=>it.impl.info?.(...r),warn:(...r)=>it.impl.warn?.(...r),error:(...r)=>it.impl.error?.(...r)}});var Kt=ot(()=>{});var Vt={};Dt(Vt,{clearSkills:()=>De,getAllSkills:()=>Ce,getSkill:()=>St,hasSkill:()=>Be,listSkillIds:()=>Me,registerSkill:()=>Re});function Re(r) ...
5`)}`)}let E=o._currentNodeConfig?.stores;if(Array.isArray(E)&&E.length>0&&typeof E[0]=="object"){let I=E.length<=8,d=E.map(f=>{let g=f?.id??f?.storeId??"",m=(f?.name??"").toString().trim()||g,P=f?.type?` \xB7 ${f.type}`:"",T=(f?.description||"").toString().replace(/\s+/g," ").trim(),B=`- ${m} \xB7 ${T||"(no description)"}${P} (id: ${g})`;if(I&&f?.schema&&typeof f.schema=="object"){let y=f.schema.properties&&typeof f.schema.properties=="object"?Object.keys(f.schema.properties):Object.keys
6 fields: ${y.join(", ")}`)}return B});h+=`
8AVAILABLE STORES (pick a store by its description and pass its NAME to the store tool):
10`)}`}let A=o._currentNodeConfig?.extraPromptInstructions?.trim();return A&&(h+=`
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
13PRIORITY OVERRIDE \u2014 THE FOLLOWING INSTRUCTIONS TAKE PRECEDENCE OVER ALL PREVIOUS CONTENT
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
17`),_.debug(`[workflow] prompt length: ${h.length} chars`),n.invoke(h,S)}var _t,U,It=ot(()=>{Kt();V();yt();_t=Symbol.for("@zibby/agent-workflow.strategies");globalThis[_t]||(globalThis[_t]=[]);U=globalThis[_t]});var Oe=new Set(["__proto__",
19`)}`);return t}};V();import{writeFileSync as Et,readFileSync as Xt,existsSync as Qt,mkdirSync as We}from"node:fs";import{join as bt,dirname as Ge}from"node:path";import O from"chalk";var xe="__WORKFLOW_GRAPH_LOG__",q=O.gray("\u2502"),Pe=O.gray("\u250C"),jt=O.gray("\u2514"),ft=O.green("\u25C6"),Ut=O.hex("#c084fc")("\u25C6"),Wt=O.hex("#2dd4bf")("\u25C6"),ht=O.red("\u25C6"),Gt=`${q} `,Ft=2;function Ht(r){return r<1e3?`${r}ms`:`${(r/1e3).toFixed(1)}s`}function Jt(r,t){return(e,o,s)=>{if(typeof e!="string")return r(e,o,s);let n=process.stdout.columns||120,i="";for(let a=0;a<e.length;a++){let l=e[a] ...
20`?(i+=l,t.lineStart=!0,t.col=0,t.inEsc=!1):l==="\x1B"?(t.inEsc=!0,i+=l):t.inEsc?(i+=l,(l>="A"&&l<="Z"||l>="a"&&l<="z")&&(t.inEsc=!
21${Gt}`,t.col=Ft))}return r(i,o,s)}}var gt=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||"").
22`),process.stdout.write=this._origStdoutWrite),this._origStderrWrite&&(this._errState&&!this._errState.lineStart&&this._origStderrWrite(`
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=`${xe}${JSON.stringify(t)}
25`;this._origStdoutWrite?this._origStdoutWrite(e):process.stdout.write(e)}_writeDot(t,e){this._origStdoutWrite?(this._outState&&!this._outState.lineStart&&(this._origStdoutWrite(`
26`),this._outState.lineStart=!0,this._outState.col=0),this._origStdoutWrite(`${t} ${e}
27`)):process.stdout.write.bind(process.stdout)(`${t} ${e}
28`)}step(t){this._origStdoutWrite?this._writeDot(ft,t):process.stdout.write.bind(process.stdout)(`${q} ${ft} ${t}
29`)}stepInfo(t){this.step(t)}stepTool(t){this._origStdoutWrite?this._writeDot(Ut,t):process.stdout.write.bind(process.stdout)(`${q} ${Ut} ${t}
30`)}stepMemory(t){let e=O.hex("#2dd4bf")(t);this._origStdoutWrite?this._writeDot(Wt,e):process.stdout.write.bind(process.stdout)(`${q} ${Wt} ${e}
31`)}stepFail(t){this._origStdoutWrite?this._writeDot(ht,O.red(t)):process.stdout.write.bind(process.stdout)(`${q} ${ht} ${O.red(t)}
32`)}nodeStart(t){this._currentNode=t,this._emitGraphLogMarker({phase:"node_begin",node:t}),this._rawWrite(`${Pe} ${t}`),this._startIntercepting()}nodeComplete(t,e={}){this._stopIntercepting();let{duration:o,details:s}=e;if(s)for(let i of s)this._rawWrite(`${ft} ${i}`);let n=o?O.dim(` ${Ht
34${n}`);let a=o(),l=a.cwd||process.cwd(),u=a.sessionPath;try{if(u){let c=bt(u,Z);if(Qt(c)){let h=JSON.parse(Xt(c,"utf-8"));h.currentNode=this.name,Et(c,JSON.stringify(h,null,2),"utf-8")}let S=bt(u,"..",Z);if(Qt(S))try{let h=JSON.parse(Xt(S,"utf-8"));h.currentNode=this.name,Et(S,JSON.stringify(h,null,2),"utf-8")}catch{}}}catch(c){_.debug(`[workflow] could not update session info: ${c.message}`)}let p=null;for(let c=0;c<=this.retries;c++)try{_.debug(`[workflow] node '${this.name}' attempt ${c}`);let S=o().config||{},h=S.agents||{},b=this.config.agent??h[this.name]??null,E={state:o()};b&&(E.prefer ...
35
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/graph.jsView on unpkg · L20 HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/graph.jsView on unpkg · L18 HighChild Process
Package source references child process execution.
dist/graph.jsView on unpkg · L33 MediumDynamic Require
Package source references dynamic require/import behavior.
dist/graph.jsView on unpkg · L33 38`):s.every(i=>typeof i=="object")?Object.assign({},...s):s[s.length-1]}static async loadFile(t){let e=cr(t,"utf-8");if(t.endsWith(".json"))return JSON.parse(e);if(t.endsWith(".js")||t.
40`);console.log(`[zibby:session] stack (${r}):
41${p}`)}}function fr(){return process.env.ZIBBY_TRUST_SESSION_ENV==="1"||process.env.ZIBBY_TRUST_SESSION_ENV==="true"||process.env.ZIBBY_KEEP_SESSION_ENV==="1"||process.env.ZIBBY_KEEP_SESSION_ENV==="true"}function hr(){if(!(process.env.ZIBBY_PIN_SESSION_PATH==="1"||process.env.ZIBBY_PIN_SESSION_PATH==="true"))return;let t=process.env.ZIBBY_SESSION_PATH;if(!(t==null||String(t).trim()===""))try{return Se(String(t).trim())}catch{return String(t).trim()}}function gr(){fr()||(delete process.env.ZIBBY_SESSION_PATH,delete process.env.ZIBBY_SESSION_ID)}function mr({sessionPath:r,sessionId:t}){r&&typeof ...
42\u{1F6D1} External stop requested \u2014 ending workflow.`),k.step("Workflow stopped externally"),{success:!0,state:d.getAll(),executionLog:tt,stoppedExternally:!0};let R=this.nodes.get(y);if(!R)throw new Error
Long lines were clipped for display.