@zibby/skills 0.1.9 → 0.1.10

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 +1 @@
1
- import{createRequire as i}from"module";import{fileURLToPath as a}from"url";import{registerHandlers as u}from"@zibby/core/framework/function-skill-registry.js";import{registerSkill as c}from"@zibby/workflow";var p=i(import.meta.url);function f(){try{return p.resolve("@zibby/core/framework/function-bridge.js")}catch{return null}}var m=import.meta.url;function h(){let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(l,o)=>o;let t=new Error().stack;for(let l=2;l<t.length;l++){let o=t[l].getFileName();if(o&&o!==m&&!o.startsWith("node:"))return o.startsWith("file://")?a(o):o}return null}finally{Error.prepareStackTrace=e}}function y(e){if(!e||typeof e!="object")return{type:"object",properties:{},required:[]};let r={},t=[];for(let[l,o]of Object.entries(e))if(typeof o=="string")r[l]={type:o},t.push(l);else{let{required:s,...n}=o;r[l]=n,s!==!1&&t.push(l)}return{type:"object",properties:r,required:t}}function k(e,r,t){if(typeof t.handler!="function")throw new Error(`Skill "${e}" must have a handler function`);let l={[e]:t.handler},o=[{name:e,description:t.description||"",input_schema:y(t.input)}];return u(e,l,o),{id:e,type:"function",serverName:e,allowedTools:[`mcp__${e}__*`],description:t.description||`Function skill: ${e}`,envKeys:[],tools:o,resolve(){let s=f();return s?{command:"node",args:[s,r,e]}:null}}}function v(e,r){return{id:e,type:"mcp",serverName:r.serverName||e,allowedTools:r.allowedTools||[`mcp__${r.serverName||e}__*`],description:r.description||`MCP skill: ${e}`,envKeys:r.envKeys||[],tools:r.tools||[],resolve:r.resolve,...r.cursorKey&&{cursorKey:r.cursorKey},...r.sessionEnvKey&&{sessionEnvKey:r.sessionEnvKey}}}function d(e,r){let t;if("handler"in r){if(typeof r.handler!="function")throw new Error(`Skill "${e}" must have a handler function`);let l=h();if(!l)throw new Error(`Could not resolve caller file for skill "${e}".`);t=k(e,l,r)}else if(typeof r.resolve=="function")t=v(e,r);else throw new Error(`Skill "${e}" must have either a handler (function skill) or resolve (MCP skill).`);return c(t),t}var S=d;export{S as functionSkill,d as skill};
1
+ import{createRequire as i}from"module";import{fileURLToPath as a}from"url";import{registerHandlers as u}from"@zibby/core/function-skill-registry.js";import{registerSkill as c}from"@zibby/workflow";var p=i(import.meta.url);function f(){try{return p.resolve("@zibby/core/function-bridge.js")}catch{return null}}var m=import.meta.url;function h(){let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(l,o)=>o;let t=new Error().stack;for(let l=2;l<t.length;l++){let o=t[l].getFileName();if(o&&o!==m&&!o.startsWith("node:"))return o.startsWith("file://")?a(o):o}return null}finally{Error.prepareStackTrace=e}}function y(e){if(!e||typeof e!="object")return{type:"object",properties:{},required:[]};let r={},t=[];for(let[l,o]of Object.entries(e))if(typeof o=="string")r[l]={type:o},t.push(l);else{let{required:s,...n}=o;r[l]=n,s!==!1&&t.push(l)}return{type:"object",properties:r,required:t}}function v(e,r,t){if(typeof t.handler!="function")throw new Error(`Skill "${e}" must have a handler function`);let l={[e]:t.handler},o=[{name:e,description:t.description||"",input_schema:y(t.input)}];return u(e,l,o),{id:e,type:"function",serverName:e,allowedTools:[`mcp__${e}__*`],description:t.description||`Function skill: ${e}`,envKeys:[],tools:o,resolve(){let s=f();return s?{command:"node",args:[s,r,e]}:null}}}function k(e,r){return{id:e,type:"mcp",serverName:r.serverName||e,allowedTools:r.allowedTools||[`mcp__${r.serverName||e}__*`],description:r.description||`MCP skill: ${e}`,envKeys:r.envKeys||[],tools:r.tools||[],resolve:r.resolve,...r.cursorKey&&{cursorKey:r.cursorKey},...r.sessionEnvKey&&{sessionEnvKey:r.sessionEnvKey}}}function d(e,r){let t;if("handler"in r){if(typeof r.handler!="function")throw new Error(`Skill "${e}" must have a handler function`);let l=h();if(!l)throw new Error(`Could not resolve caller file for skill "${e}".`);t=v(e,l,r)}else if(typeof r.resolve=="function")t=k(e,r);else throw new Error(`Skill "${e}" must have either a handler (function skill) or resolve (MCP skill).`);return c(t),t}var S=d;export{S as functionSkill,d as skill};
package/dist/index.js CHANGED
@@ -643,4 +643,4 @@ ${m}
643
643
  }
644
644
  `;H(S(o,"graph.mjs"),f,"utf-8");let k={name:n,description:e.description||`${i} workflow`,entryClass:i,triggers:{api:!0}};H(S(o,"workflow.json"),`${JSON.stringify(k,null,2)}
645
645
  `,"utf-8");let h=["graph.mjs","workflow.json","nodes/index.mjs",...c.map(g=>`nodes/${g.replace(/_/g,"-")}.mjs`)];return{workflowDir:Ut(r,o),files:h,className:i,slug:n}}async function Kr(r){let{name:t,description:e,nodes:s,edges:n}=r;if(!t||!Kt.test(t.toLowerCase()))return JSON.stringify({error:`Invalid workflow name "${t}". Must be kebab-case, 2-64 chars, lowercase letters/numbers/hyphens.`});if(!s||s.length===0)return JSON.stringify({error:"At least one node is required."});let i={name:t.toLowerCase(),description:e||`${Pt(t.toLowerCase())} workflow`,nodes:s.map(o=>({name:o.name.replace(/-/g,"_"),description:o.description||`Process ${o.name}`,inputFields:o.inputFields||[],outputFields:o.outputFields||[]})),edges:n||[]};if(i.edges.length===0&&i.nodes.length>0){for(let o=0;o<i.nodes.length-1;o++)i.edges.push({from:i.nodes[o].name,to:i.nodes[o+1].name});i.edges.push({from:i.nodes[i.nodes.length-1].name,to:"END"})}return JSON.stringify({ok:!0,spec:i,message:`Workflow "${i.name}" designed with ${i.nodes.length} node(s). Call build_workflow to generate the code.`,preview:{nodes:i.nodes.map(o=>o.name),flow:i.edges.map(o=>o.condition?`${o.from} \u2192(if ${o.condition})\u2192 ${o.to}`:`${o.from} \u2192 ${o.to}`)}})}async function Pr(r,t){let{name:e,spec:s}=r,n=(e||s?.name||"").toLowerCase();if(!n||!Kt.test(n))return JSON.stringify({error:`Invalid workflow name "${n}".`});if(!s||!s.nodes||s.nodes.length===0)return JSON.stringify({error:"spec with nodes is required. Call design_workflow first."});let i=S(t,".zibby","workflows",n);if(M(i))return JSON.stringify({error:`Workflow "${n}" already exists at .zibby/workflows/${n}/. Delete it first or choose a different name.`});let o=await Wt(s,t),a=qr(t,n,s,o);return JSON.stringify({ok:!0,...a,message:`Workflow "${n}" created at ${a.workflowDir}/`,nextSteps:[`Test locally: zibby start ${n}`,`Deploy to cloud: zibby deploy ${n} --project <project-id>`,`Tail logs: zibby logs --workflow ${n} --project <project-id>`]})}async function Br(r,t){let{workflowName:e,nodeName:s,description:n,inputFields:i,outputFields:o}=r,a=(e||"").toLowerCase(),c=(s||"").replace(/-/g,"_"),l=S(t,".zibby","workflows",a);if(!M(l))return JSON.stringify({error:`Workflow "${a}" not found. Create it first with build_workflow.`});let u={name:a,description:"",nodes:[{name:c,description:n||`Process ${c}`,inputFields:i||[],outputFields:o||[]}],edges:[]},y=(await Wt(u,t)).nodes?.[c]?.code;if(!y)return JSON.stringify({error:"Failed to generate node code."});let m=S(l,"nodes"),f=`${c.replace(/_/g,"-")}.mjs`;H(S(m,f),y,"utf-8");let k=S(m,"index.mjs"),h=V(c),g=`export { ${h} } from './${c.replace(/_/g,"-")}.mjs';
646
- `,_=M(k)?Q(k,"utf-8"):"";return _.includes(h)||H(k,_+g,"utf-8"),JSON.stringify({ok:!0,file:`nodes/${f}`,exportName:h,message:`Node "${c}" added. Update graph.mjs to wire it into the graph.`})}async function Fr(r,t){let{name:e,projectId:s}=r,n=(e||"").toLowerCase();if(!n)return JSON.stringify({error:"Workflow name is required."});if(!s)return JSON.stringify({error:"projectId is required."});let i=S(t,".zibby","workflows",n);if(!M(i))return JSON.stringify({error:`Workflow "${n}" not found at .zibby/workflows/${n}/`});try{let{execSync:o}=await import("child_process"),a=o(`node "${S(t,"packages/cli/bin/zibby.js")}" deploy ${n} --project ${s}`,{cwd:t,encoding:"utf-8",timeout:3e4,stdio:["pipe","pipe","pipe"]});return JSON.stringify({ok:!0,output:a.trim()})}catch{try{let{execSync:a}=await import("child_process"),c=a(`npx zibby deploy ${n} --project ${s}`,{cwd:t,encoding:"utf-8",timeout:3e4,stdio:["pipe","pipe","pipe"]});return JSON.stringify({ok:!0,output:c.trim()})}catch(a){return JSON.stringify({error:`Deploy failed: ${a.message}`})}}}function Wr(r){let t=S(r,".zibby","workflows");if(!M(t))return JSON.stringify({workflows:[],message:"No workflows found. Use build_workflow to create one."});let s=Ie(t).filter(n=>{try{return Mt(S(t,n)).isDirectory()}catch{return!1}}).map(n=>{let i=S(t,n,"workflow.json"),o={};try{o=JSON.parse(Q(i,"utf-8"))}catch{}let a=S(t,n,"nodes"),c=0;try{c=Ie(a).filter(l=>l.endsWith(".mjs")&&l!=="index.mjs").length}catch{}return{name:n,description:o.description||"",nodeCount:c,path:Ut(r,S(t,n))}});return JSON.stringify({workflows:s})}var zt={id:"workflow-builder",description:"Build, scaffold, and deploy custom AI workflows via conversation",envKeys:[],promptFragment:xr,tools:[{name:"design_workflow",description:"Design a workflow spec (nodes, edges, descriptions) for the user to review before building. Call this after understanding requirements.",input_schema:{type:"object",properties:{name:{type:"string",description:"Workflow name in kebab-case (e.g., ticket-triage)"},description:{type:"string",description:"What the workflow does"},nodes:{type:"array",items:{type:"object",properties:{name:{type:"string",description:"Node name in snake_case (e.g., classify_ticket)"},description:{type:"string",description:"What this node does \u2014 be specific about input/output"},inputFields:{type:"array",items:{type:"string"},description:"Key fields this node reads from state"},outputFields:{type:"array",items:{type:"string"},description:"Key fields this node produces"}},required:["name","description"]},description:"Workflow nodes (processing steps)"},edges:{type:"array",items:{type:"object",properties:{from:{type:"string",description:"Source node name"},to:{type:"string",description:'Target node name (or "END")'},condition:{type:"string",description:"JS expression for conditional routing (optional)"}},required:["from","to"]},description:"Edges connecting nodes. If omitted, nodes are wired linearly."}},required:["name","description","nodes"]}},{name:"build_workflow",description:"Generate real workflow code on disk from a design spec. Uses the configured AI agent for high-quality code generation.",input_schema:{type:"object",properties:{name:{type:"string",description:"Workflow name (from design_workflow)"},spec:{type:"object",description:"The full spec object returned by design_workflow",properties:{name:{type:"string"},description:{type:"string"},nodes:{type:"array",items:{type:"object"}},edges:{type:"array",items:{type:"object"}}}}},required:["name","spec"]}},{name:"add_node",description:"Add a new node to an existing workflow. Generates the node file and updates the barrel export.",input_schema:{type:"object",properties:{workflowName:{type:"string",description:"Existing workflow name (kebab-case)"},nodeName:{type:"string",description:"New node name (snake_case)"},description:{type:"string",description:"What this node does"},inputFields:{type:"array",items:{type:"string"},description:"Fields read from state"},outputFields:{type:"array",items:{type:"string"},description:"Fields produced"}},required:["workflowName","nodeName","description"]}},{name:"deploy_workflow",description:"Deploy a workflow to Zibby Cloud. Returns the trigger URL.",input_schema:{type:"object",properties:{name:{type:"string",description:"Workflow name to deploy"},projectId:{type:"string",description:"Target project ID"}},required:["name","projectId"]}},{name:"list_workflows",description:"List all local workflows in .zibby/workflows/.",input_schema:{type:"object",properties:{}}},{name:"explore_framework_docs",description:"Read Zibby framework documentation on demand. Call this before building complex workflows or when you need details on advanced patterns (middleware, conditional routing, skills, deployment, CLI commands).",input_schema:{type:"object",properties:{topic:{type:"string",description:'Doc topic to read (e.g., "workflow", "custom-workflows", "cli-reference", "packages/core", "packages/skills", "integrations/jira"). Call with no topic to list all available docs.'}}}}],async handleToolCall(r,t,e){let s=e?.options?.workspace||process.cwd();try{switch(r){case"design_workflow":return await Kr(t);case"build_workflow":return await Pr(t,s);case"add_node":return await Br(t,s);case"deploy_workflow":return await Fr(t,s);case"list_workflows":return Wr(s);case"explore_framework_docs":{let n=(t.topic||"").trim();if(!n){let o=Dt();return JSON.stringify({available:o,hint:"Call again with a topic to read its content."})}let i=Ft(n);if(!i){let o=Dt();return JSON.stringify({error:`Doc "${n}" not found.`,available:o})}return JSON.stringify({topic:n,content:i})}default:return JSON.stringify({error:`Unknown tool: ${r}`})}}catch(n){return JSON.stringify({error:n.message})}},resolve(){return null}};import{createRequire as zr}from"module";import{fileURLToPath as Gr}from"url";import{registerHandlers as Hr}from"@zibby/core/framework/function-skill-registry.js";import{registerSkill as Yr}from"@zibby/workflow";var Zr=zr(import.meta.url);function Vr(){try{return Zr.resolve("@zibby/core/framework/function-bridge.js")}catch{return null}}var Qr=import.meta.url;function Xr(){let r=Error.prepareStackTrace;try{Error.prepareStackTrace=(s,n)=>n;let e=new Error().stack;for(let s=2;s<e.length;s++){let n=e[s].getFileName();if(n&&n!==Qr&&!n.startsWith("node:"))return n.startsWith("file://")?Gr(n):n}return null}finally{Error.prepareStackTrace=r}}function en(r){if(!r||typeof r!="object")return{type:"object",properties:{},required:[]};let t={},e=[];for(let[s,n]of Object.entries(r))if(typeof n=="string")t[s]={type:n},e.push(s);else{let{required:i,...o}=n;t[s]=o,i!==!1&&e.push(s)}return{type:"object",properties:t,required:e}}function tn(r,t,e){if(typeof e.handler!="function")throw new Error(`Skill "${r}" must have a handler function`);let s={[r]:e.handler},n=[{name:r,description:e.description||"",input_schema:en(e.input)}];return Hr(r,s,n),{id:r,type:"function",serverName:r,allowedTools:[`mcp__${r}__*`],description:e.description||`Function skill: ${r}`,envKeys:[],tools:n,resolve(){let i=Vr();return i?{command:"node",args:[i,t,r]}:null}}}function sn(r,t){return{id:r,type:"mcp",serverName:t.serverName||r,allowedTools:t.allowedTools||[`mcp__${t.serverName||r}__*`],description:t.description||`MCP skill: ${r}`,envKeys:t.envKeys||[],tools:t.tools||[],resolve:t.resolve,...t.cursorKey&&{cursorKey:t.cursorKey},...t.sessionEnvKey&&{sessionEnvKey:t.sessionEnvKey}}}function Gt(r,t){let e;if("handler"in t){if(typeof t.handler!="function")throw new Error(`Skill "${r}" must have a handler function`);let s=Xr();if(!s)throw new Error(`Could not resolve caller file for skill "${r}".`);e=tn(r,s,t)}else if(typeof t.resolve=="function")e=sn(r,t);else throw new Error(`Skill "${r}" must have either a handler (function skill) or resolve (MCP skill).`);return Yr(e),e}var rn=Gt;import{registerSkill as bi,getSkill as Si,hasSkill as vi,getAllSkills as Ni,listSkillIds as Oi}from"@zibby/workflow";E(xe);E(De);E(Ue);E(fe);E(Ve);E(Ke);E(dt);E(ht);E(Be);E(He);E(Et);E(zt);E({...fe,id:"slack_notify"});var hi={BROWSER:"browser",JIRA:"jira",GITHUB:"github",GIT:"git",SLACK:"slack",SENTRY:"sentry",MEMORY:"memory",RUNNER:"runner",SKILL_INSTALLER:"skill-installer",CORE_TOOLS:"core-tools",CHAT_MEMORY:"chat-memory",WORKFLOW_BUILDER:"workflow-builder"};export{hi as SKILLS,xe as browserSkill,Et as chatMemorySkill,He as coreToolsSkill,rn as functionSkill,Ni as getAllSkills,Si as getSkill,ht as gitSkill,Ue as githubSkill,vi as hasSkill,De as jiraSkill,Oi as listSkillIds,Ke as memorySkill,bi as registerSkill,dt as runnerSkill,Ve as sentrySkill,Gt as skill,Be as skillInstallerSkill,fe as slackSkill,dt as testRunnerSkill,zt as workflowBuilderSkill};
646
+ `,_=M(k)?Q(k,"utf-8"):"";return _.includes(h)||H(k,_+g,"utf-8"),JSON.stringify({ok:!0,file:`nodes/${f}`,exportName:h,message:`Node "${c}" added. Update graph.mjs to wire it into the graph.`})}async function Fr(r,t){let{name:e,projectId:s}=r,n=(e||"").toLowerCase();if(!n)return JSON.stringify({error:"Workflow name is required."});if(!s)return JSON.stringify({error:"projectId is required."});let i=S(t,".zibby","workflows",n);if(!M(i))return JSON.stringify({error:`Workflow "${n}" not found at .zibby/workflows/${n}/`});try{let{execSync:o}=await import("child_process"),a=o(`node "${S(t,"packages/cli/bin/zibby.js")}" deploy ${n} --project ${s}`,{cwd:t,encoding:"utf-8",timeout:3e4,stdio:["pipe","pipe","pipe"]});return JSON.stringify({ok:!0,output:a.trim()})}catch{try{let{execSync:a}=await import("child_process"),c=a(`npx zibby deploy ${n} --project ${s}`,{cwd:t,encoding:"utf-8",timeout:3e4,stdio:["pipe","pipe","pipe"]});return JSON.stringify({ok:!0,output:c.trim()})}catch(a){return JSON.stringify({error:`Deploy failed: ${a.message}`})}}}function Wr(r){let t=S(r,".zibby","workflows");if(!M(t))return JSON.stringify({workflows:[],message:"No workflows found. Use build_workflow to create one."});let s=Ie(t).filter(n=>{try{return Mt(S(t,n)).isDirectory()}catch{return!1}}).map(n=>{let i=S(t,n,"workflow.json"),o={};try{o=JSON.parse(Q(i,"utf-8"))}catch{}let a=S(t,n,"nodes"),c=0;try{c=Ie(a).filter(l=>l.endsWith(".mjs")&&l!=="index.mjs").length}catch{}return{name:n,description:o.description||"",nodeCount:c,path:Ut(r,S(t,n))}});return JSON.stringify({workflows:s})}var zt={id:"workflow-builder",description:"Build, scaffold, and deploy custom AI workflows via conversation",envKeys:[],promptFragment:xr,tools:[{name:"design_workflow",description:"Design a workflow spec (nodes, edges, descriptions) for the user to review before building. Call this after understanding requirements.",input_schema:{type:"object",properties:{name:{type:"string",description:"Workflow name in kebab-case (e.g., ticket-triage)"},description:{type:"string",description:"What the workflow does"},nodes:{type:"array",items:{type:"object",properties:{name:{type:"string",description:"Node name in snake_case (e.g., classify_ticket)"},description:{type:"string",description:"What this node does \u2014 be specific about input/output"},inputFields:{type:"array",items:{type:"string"},description:"Key fields this node reads from state"},outputFields:{type:"array",items:{type:"string"},description:"Key fields this node produces"}},required:["name","description"]},description:"Workflow nodes (processing steps)"},edges:{type:"array",items:{type:"object",properties:{from:{type:"string",description:"Source node name"},to:{type:"string",description:'Target node name (or "END")'},condition:{type:"string",description:"JS expression for conditional routing (optional)"}},required:["from","to"]},description:"Edges connecting nodes. If omitted, nodes are wired linearly."}},required:["name","description","nodes"]}},{name:"build_workflow",description:"Generate real workflow code on disk from a design spec. Uses the configured AI agent for high-quality code generation.",input_schema:{type:"object",properties:{name:{type:"string",description:"Workflow name (from design_workflow)"},spec:{type:"object",description:"The full spec object returned by design_workflow",properties:{name:{type:"string"},description:{type:"string"},nodes:{type:"array",items:{type:"object"}},edges:{type:"array",items:{type:"object"}}}}},required:["name","spec"]}},{name:"add_node",description:"Add a new node to an existing workflow. Generates the node file and updates the barrel export.",input_schema:{type:"object",properties:{workflowName:{type:"string",description:"Existing workflow name (kebab-case)"},nodeName:{type:"string",description:"New node name (snake_case)"},description:{type:"string",description:"What this node does"},inputFields:{type:"array",items:{type:"string"},description:"Fields read from state"},outputFields:{type:"array",items:{type:"string"},description:"Fields produced"}},required:["workflowName","nodeName","description"]}},{name:"deploy_workflow",description:"Deploy a workflow to Zibby Cloud. Returns the trigger URL.",input_schema:{type:"object",properties:{name:{type:"string",description:"Workflow name to deploy"},projectId:{type:"string",description:"Target project ID"}},required:["name","projectId"]}},{name:"list_workflows",description:"List all local workflows in .zibby/workflows/.",input_schema:{type:"object",properties:{}}},{name:"explore_framework_docs",description:"Read Zibby framework documentation on demand. Call this before building complex workflows or when you need details on advanced patterns (middleware, conditional routing, skills, deployment, CLI commands).",input_schema:{type:"object",properties:{topic:{type:"string",description:'Doc topic to read (e.g., "workflow", "custom-workflows", "cli-reference", "packages/core", "packages/skills", "integrations/jira"). Call with no topic to list all available docs.'}}}}],async handleToolCall(r,t,e){let s=e?.options?.workspace||process.cwd();try{switch(r){case"design_workflow":return await Kr(t);case"build_workflow":return await Pr(t,s);case"add_node":return await Br(t,s);case"deploy_workflow":return await Fr(t,s);case"list_workflows":return Wr(s);case"explore_framework_docs":{let n=(t.topic||"").trim();if(!n){let o=Dt();return JSON.stringify({available:o,hint:"Call again with a topic to read its content."})}let i=Ft(n);if(!i){let o=Dt();return JSON.stringify({error:`Doc "${n}" not found.`,available:o})}return JSON.stringify({topic:n,content:i})}default:return JSON.stringify({error:`Unknown tool: ${r}`})}}catch(n){return JSON.stringify({error:n.message})}},resolve(){return null}};import{createRequire as zr}from"module";import{fileURLToPath as Gr}from"url";import{registerHandlers as Hr}from"@zibby/core/function-skill-registry.js";import{registerSkill as Yr}from"@zibby/workflow";var Zr=zr(import.meta.url);function Vr(){try{return Zr.resolve("@zibby/core/function-bridge.js")}catch{return null}}var Qr=import.meta.url;function Xr(){let r=Error.prepareStackTrace;try{Error.prepareStackTrace=(s,n)=>n;let e=new Error().stack;for(let s=2;s<e.length;s++){let n=e[s].getFileName();if(n&&n!==Qr&&!n.startsWith("node:"))return n.startsWith("file://")?Gr(n):n}return null}finally{Error.prepareStackTrace=r}}function en(r){if(!r||typeof r!="object")return{type:"object",properties:{},required:[]};let t={},e=[];for(let[s,n]of Object.entries(r))if(typeof n=="string")t[s]={type:n},e.push(s);else{let{required:i,...o}=n;t[s]=o,i!==!1&&e.push(s)}return{type:"object",properties:t,required:e}}function tn(r,t,e){if(typeof e.handler!="function")throw new Error(`Skill "${r}" must have a handler function`);let s={[r]:e.handler},n=[{name:r,description:e.description||"",input_schema:en(e.input)}];return Hr(r,s,n),{id:r,type:"function",serverName:r,allowedTools:[`mcp__${r}__*`],description:e.description||`Function skill: ${r}`,envKeys:[],tools:n,resolve(){let i=Vr();return i?{command:"node",args:[i,t,r]}:null}}}function sn(r,t){return{id:r,type:"mcp",serverName:t.serverName||r,allowedTools:t.allowedTools||[`mcp__${t.serverName||r}__*`],description:t.description||`MCP skill: ${r}`,envKeys:t.envKeys||[],tools:t.tools||[],resolve:t.resolve,...t.cursorKey&&{cursorKey:t.cursorKey},...t.sessionEnvKey&&{sessionEnvKey:t.sessionEnvKey}}}function Gt(r,t){let e;if("handler"in t){if(typeof t.handler!="function")throw new Error(`Skill "${r}" must have a handler function`);let s=Xr();if(!s)throw new Error(`Could not resolve caller file for skill "${r}".`);e=tn(r,s,t)}else if(typeof t.resolve=="function")e=sn(r,t);else throw new Error(`Skill "${r}" must have either a handler (function skill) or resolve (MCP skill).`);return Yr(e),e}var rn=Gt;import{registerSkill as bi,getSkill as Si,hasSkill as vi,getAllSkills as Ni,listSkillIds as Oi}from"@zibby/workflow";E(xe);E(De);E(Ue);E(fe);E(Ve);E(Ke);E(dt);E(ht);E(Be);E(He);E(Et);E(zt);E({...fe,id:"slack_notify"});var hi={BROWSER:"browser",JIRA:"jira",GITHUB:"github",GIT:"git",SLACK:"slack",SENTRY:"sentry",MEMORY:"memory",RUNNER:"runner",SKILL_INSTALLER:"skill-installer",CORE_TOOLS:"core-tools",CHAT_MEMORY:"chat-memory",WORKFLOW_BUILDER:"workflow-builder"};export{hi as SKILLS,xe as browserSkill,Et as chatMemorySkill,He as coreToolsSkill,rn as functionSkill,Ni as getAllSkills,Si as getSkill,ht as gitSkill,Ue as githubSkill,vi as hasSkill,De as jiraSkill,Oi as listSkillIds,Ke as memorySkill,bi as registerSkill,dt as runnerSkill,Ve as sentrySkill,Gt as skill,Be as skillInstallerSkill,fe as slackSkill,dt as testRunnerSkill,zt as workflowBuilderSkill};
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zibby/skills",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Built-in skill definitions for Zibby test automation framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -46,10 +46,10 @@
46
46
  "node": ">=18.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@zibby/workflow": "^0.1.0"
49
+ "@zibby/workflow": "^0.1.1"
50
50
  },
51
51
  "peerDependencies": {
52
- "@zibby/core": ">=0.1.0"
52
+ "@zibby/core": ">=0.1.43"
53
53
  },
54
54
  "optionalDependencies": {
55
55
  "@zibby/mcp-browser": "^0.1.8",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zibby/skills",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Built-in skill definitions for Zibby test automation framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -46,10 +46,10 @@
46
46
  "node": ">=18.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@zibby/workflow": "^0.1.0"
49
+ "@zibby/workflow": "^0.1.1"
50
50
  },
51
51
  "peerDependencies": {
52
- "@zibby/core": ">=0.1.0"
52
+ "@zibby/core": ">=0.1.43"
53
53
  },
54
54
  "optionalDependencies": {
55
55
  "@zibby/mcp-browser": "^0.1.8",