@zibby/agent-workflow 0.1.2

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.
@@ -0,0 +1,14 @@
1
+ import e from"chalk";var I="__WORKFLOW_GRAPH_LOG__",c=e.gray("\u2502"),E=e.gray("\u250C"),p=e.gray("\u2514"),h=e.green("\u25C6"),S=e.hex("#c084fc")("\u25C6"),W=e.hex("#2dd4bf")("\u25C6"),l=e.red("\u25C6"),w=`${c} `,f=2;function g(d){return d<1e3?`${d}ms`:`${(d/1e3).toFixed(1)}s`}function $(d,t){return(r,o,n)=>{if(typeof r!="string")return d(r,o,n);let _=process.stdout.columns||120,s="";for(let u=0;u<r.length;u++){let i=r[u];t.lineStart&&(s+=w,t.col=f,t.lineStart=!1),i===`
2
+ `?(s+=i,t.lineStart=!0,t.col=0,t.inEsc=!1):i==="\x1B"?(t.inEsc=!0,s+=i):t.inEsc?(s+=i,(i>="A"&&i<="Z"||i>="a"&&i<="z")&&(t.inEsc=!1)):(t.col++,s+=i,t.col>=_&&(s+=`
3
+ ${w}`,t.col=f))}return d(s,o,n)}}var a=class{constructor(){this._currentNode=null,this._origStdoutWrite=null,this._origStderrWrite=null;let t=String(process.env.ZIBBY_RUN_SOURCE||"").trim().toLowerCase(),r=String(process.env.ZIBBY_WORKFLOW_GRAPH_LOG_MARKERS||"").trim()==="1";this._emitWorkflowGraphMarkers=r||t==="studio"}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},r={lineStart:!0,col:0,inEsc:!1};this._outState=t,this._errState=r,process.stdout.write=$(this._origStdoutWrite,t),process.stderr.write=$(this._origStderrWrite,r)}_stopIntercepting(){this._origStdoutWrite&&(this._outState&&!this._outState.lineStart&&this._origStdoutWrite(`
4
+ `),process.stdout.write=this._origStdoutWrite),this._origStderrWrite&&(this._errState&&!this._errState.lineStart&&this._origStderrWrite(`
5
+ `),process.stderr.write=this._origStderrWrite),this._origStdoutWrite=null,this._origStderrWrite=null}_rawWrite(t){(this._origStdoutWrite||process.stdout.write.bind(process.stdout))(`${t}
6
+ `)}_emitGraphLogMarker(t){if(!this._emitWorkflowGraphMarkers)return;let r=`${I}${JSON.stringify(t)}
7
+ `;this._origStdoutWrite?this._origStdoutWrite(r):process.stdout.write(r)}_writeDot(t,r){this._origStdoutWrite?(this._outState&&!this._outState.lineStart&&(this._origStdoutWrite(`
8
+ `),this._outState.lineStart=!0,this._outState.col=0),this._origStdoutWrite(`${t} ${r}
9
+ `)):process.stdout.write.bind(process.stdout)(`${t} ${r}
10
+ `)}step(t){this._origStdoutWrite?this._writeDot(h,t):process.stdout.write.bind(process.stdout)(`${c} ${h} ${t}
11
+ `)}stepInfo(t){this.step(t)}stepTool(t){this._origStdoutWrite?this._writeDot(S,t):process.stdout.write.bind(process.stdout)(`${c} ${S} ${t}
12
+ `)}stepMemory(t){let r=e.hex("#2dd4bf")(t);this._origStdoutWrite?this._writeDot(W,r):process.stdout.write.bind(process.stdout)(`${c} ${W} ${r}
13
+ `)}stepFail(t){this._origStdoutWrite?this._writeDot(l,e.red(t)):process.stdout.write.bind(process.stdout)(`${c} ${l} ${e.red(t)}
14
+ `)}nodeStart(t){this._currentNode=t,this._emitGraphLogMarker({phase:"node_begin",node:t}),this._rawWrite(`${E} ${t}`),this._startIntercepting()}nodeComplete(t,r={}){this._stopIntercepting();let{duration:o,details:n}=r;if(n)for(let s of n)this._rawWrite(`${h} ${s}`);let _=o?e.dim(` ${g(o)}`):"";this._rawWrite(`${p} ${e.green("done")}${_}`),this._emitGraphLogMarker({phase:"node_end",node:t}),this._rawWrite("")}nodeFailed(t,r,o={}){this._stopIntercepting();let{duration:n}=o,_=n?e.dim(` ${g(n)}`):"";this._rawWrite(`${l} ${e.red(r)}`),this._rawWrite(`${p} ${e.red("failed")}${_}`),this._emitGraphLogMarker({phase:"node_end",node:t}),this._rawWrite("")}route(t,r){this._rawWrite(e.dim(` ${t} \u2192 ${r}`)),this._rawWrite("")}graphComplete(){this._rawWrite(e.green.bold("\u2713 Workflow completed"))}},O=new a;var P=O;export{a as Timeline,I as WORKFLOW_GRAPH_LOG_MARKER_PREFIX,P as default,O as timeline};
@@ -0,0 +1,19 @@
1
+ export function resolveNodeTools(nodeType: any, userToolIds: any): {
2
+ toolIds: any[];
3
+ claudeTools: {
4
+ name: any;
5
+ description: any;
6
+ input_schema: any;
7
+ }[];
8
+ mcpServers: {};
9
+ };
10
+ export function getResolvedToolDefinitions(toolIds: any): {
11
+ toolIds: any[];
12
+ claudeTools: {
13
+ name: any;
14
+ description: any;
15
+ input_schema: any;
16
+ }[];
17
+ mcpServers: {};
18
+ };
19
+ export const NODE_DEFAULT_TOOLS: {};
@@ -0,0 +1 @@
1
+ var m=new Map;function u(e){return m.get(e)||null}var p=()=>{},d={debug:p,info:p,warn:(...e)=>console.warn("[workflow]",...e),error:(...e)=>console.error("[workflow]",...e)},l={impl:d};var a={debug:(...e)=>l.impl.debug?.(...e),info:(...e)=>l.impl.info?.(...e),warn:(...e)=>l.impl.warn?.(...e),error:(...e)=>l.impl.error?.(...e)};var w={};function h(e,t){if(Array.isArray(t))return g(t);let n=w[e];return!n||n.length===0?null:g(n)}function g(e){if(!Array.isArray(e)||e.length===0)return null;let t=[],n={},s=[];for(let i of e){let r=u(i);if(!r){a.warn(`[workflow] unknown skill "${i}" \u2014 skipping`);continue}s.push(i);for(let o of r.tools||[])t.push({name:o.name,description:o.description,input_schema:o.input_schema||{type:"object",properties:{}}});if(!n[r.serverName])if(typeof r.resolve=="function"){let o=r.resolve();o&&(n[r.serverName]={...o,toolPrefix:i})}else{let o={};for(let c of r.envKeys||[]){let f=process.env[c];f&&(o[c]=f)}n[r.serverName]={command:r.command,args:[...r.args||[]],env:o,toolPrefix:i}}}return s.length===0?null:{toolIds:s,claudeTools:t,mcpServers:n}}export{w as NODE_DEFAULT_TOOLS,g as getResolvedToolDefinitions,h as resolveNodeTools};
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@zibby/agent-workflow",
3
+ "version": "0.1.2",
4
+ "description": "Graph-based AI agent workflow orchestration. Bring your own agent strategies.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "dist/",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "engines": {
21
+ "node": ">=18.0.0"
22
+ },
23
+ "keywords": [
24
+ "ai",
25
+ "workflow",
26
+ "graph",
27
+ "agents",
28
+ "orchestration",
29
+ "langgraph"
30
+ ],
31
+ "author": "Zibby",
32
+ "license": "MIT",
33
+ "dependencies": {
34
+ "chalk": "^5.6.2",
35
+ "dotenv": "^17.0.0",
36
+ "handlebars": "^4.7.9",
37
+ "zod-to-json-schema": "^3.25.2"
38
+ },
39
+ "peerDependencies": {
40
+ "zod": ">=3.0.0"
41
+ },
42
+ "peerDependenciesMeta": {
43
+ "zod": {
44
+ "optional": true
45
+ }
46
+ },
47
+ "devDependencies": {
48
+ "esbuild": "^0.28.0",
49
+ "typescript": "^6.0.3",
50
+ "vitest": "^4.1.4",
51
+ "zod": "^4.3.6"
52
+ },
53
+ "scripts": {
54
+ "build": "node scripts/build.mjs && tsc",
55
+ "build:js": "node scripts/build.mjs",
56
+ "build:types": "tsc",
57
+ "test": "vitest run --passWithNoTests"
58
+ }
59
+ }