@zibby/core 0.1.40 → 0.1.42

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.
@@ -1,3 +1 @@
1
- var o=class{constructor(e){this.schema=e}parse(e){let i=e.match(/```json\s*([\s\S]*?)\s*```/);if(i)return this.validate(JSON.parse(i[1]));let r=e.match(/\{[\s\S]*\}/);return r?this.validate(JSON.parse(r[0])):this.validate({result:e.trim()})}validate(e){let i=[];for(let[r,n]of Object.entries(this.schema)){if(n.required&&!(r in e)&&i.push(`Missing required field: ${r}`),r in e&&n.type){let s=typeof e[r];s!==n.type&&i.push(`Field '${r}' expected ${n.type}, got ${s}`)}if(n.validate&&r in e){let s=n.validate(e[r]);s&&i.push(`Field '${r}': ${s}`)}}if(i.length>0)throw new Error(`Output validation failed:
2
- ${i.join(`
3
- `)}`);return e}},a={string:(t=!0)=>({type:"string",required:t}),number:(t=!0)=>({type:"number",required:t}),boolean:(t=!0)=>({type:"boolean",required:t}),array:(t=!0)=>({type:"object",required:t,validate:e=>Array.isArray(e)?null:"must be an array"}),enum:(t,e=!0)=>({type:"string",required:e,validate:i=>t.includes(i)?null:`must be one of: ${t.join(", ")}`})};export{o as OutputParser,a as SchemaTypes};
1
+ import{OutputParser as p,SchemaTypes as t}from"@zibby/workflow";export{p as OutputParser,t as SchemaTypes};
@@ -1 +1 @@
1
- var e=new Map;function r(t){if(!t||typeof t.id!="string")throw new Error("Skill definition must include a string id");e.set(t.id,Object.freeze({...t}))}function n(t){return e.get(t)||null}function i(t){return e.has(t)}function o(){return new Map(e)}function l(){return Array.from(e.keys())}export{o as getAllSkills,n as getSkill,i as hasSkill,l as listSkillIds,r as registerSkill};
1
+ import{registerSkill as e,getSkill as k,hasSkill as s,getAllSkills as t,listSkillIds as S}from"@zibby/workflow";export{t as getAllSkills,k as getSkill,s as hasSkill,S as listSkillIds,e as registerSkill};
@@ -1 +1 @@
1
- var a=new Set(["__proto__","constructor","prototype"]);function i(r){if(a.has(r))throw new Error(`Invalid state key: "${r}"`)}var h=class{constructor(t={}){this._state=Object.create(null),Object.assign(this._state,{messages:[],errors:[],artifacts:{},metadata:{},...t}),this._history=[]}get(t){return this._state[t]}set(t,s){i(t),this._history.push({...this._state}),this._state[t]=s}update(t){let s=Object.getOwnPropertyNames(t);for(let e of s)i(e);this._history.push({...this._state});for(let e of s)this._state[e]=t[e]}append(t,s){i(t),this._history.push({...this._state}),Array.isArray(this._state[t])||(this._state[t]=[]),this._state[t].push(s)}getAll(){return{...this._state}}rollback(){this._history.length>0&&(this._state=this._history.pop())}};export{h as WorkflowState};
1
+ import{WorkflowState as t}from"@zibby/workflow";export{t as WorkflowState};
@@ -1 +1 @@
1
- var a=new Map;function f(n){return a.get(n)||null}var p={};function g(n,t){if(Array.isArray(t))return u(t);let o=p[n];return!o||o.length===0?null:u(o)}function u(n){if(!Array.isArray(n)||n.length===0)return null;let t=[],o={},s=[];for(let i of n){let e=f(i);if(!e){console.warn(`[ToolResolver] 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(!o[e.serverName])if(typeof e.resolve=="function"){let r=e.resolve();r&&(o[e.serverName]={...r,toolPrefix:i})}else{let r={};for(let l of e.envKeys||[]){let c=process.env[l];c&&(r[l]=c)}o[e.serverName]={command:e.command,args:[...e.args||[]],env:r,toolPrefix:i}}}return s.length===0?null:{toolIds:s,claudeTools:t,mcpServers:o}}export{p as NODE_DEFAULT_TOOLS,u as getResolvedToolDefinitions,g as resolveNodeTools};
1
+ import{resolveNodeTools as l,getResolvedToolDefinitions as s,NODE_DEFAULT_TOOLS as T}from"@zibby/workflow";export{T as NODE_DEFAULT_TOOLS,s as getResolvedToolDefinitions,l as resolveNodeTools};