@zibby/skills 0.1.58 → 0.1.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zibby/skills",
3
- "version": "0.1.58",
3
+ "version": "0.1.59",
4
4
  "description": "Built-in skill definitions for the Zibby agent-workflow framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,42 @@
1
+ export namespace triggerWorkflowSkill {
2
+ let id: string;
3
+ let serverName: string;
4
+ let allowedTools: string[];
5
+ let envKeys: any[];
6
+ let description: string;
7
+ let promptFragment: string;
8
+ function resolve(): {
9
+ command: any;
10
+ args: any[];
11
+ env: {};
12
+ description: string;
13
+ type?: undefined;
14
+ alwaysLoad?: undefined;
15
+ } | {
16
+ type: string;
17
+ command: string;
18
+ args: any[];
19
+ env: {};
20
+ description: string;
21
+ alwaysLoad: boolean;
22
+ };
23
+ function handleToolCall(name: any, args?: {}): Promise<string>;
24
+ let tools: {
25
+ name: string;
26
+ description: string;
27
+ input_schema: {
28
+ type: string;
29
+ properties: {
30
+ workflowType: {
31
+ type: string;
32
+ description: string;
33
+ };
34
+ input: {
35
+ type: string;
36
+ description: string;
37
+ };
38
+ };
39
+ required: any[];
40
+ };
41
+ }[];
42
+ }
@@ -0,0 +1 @@
1
+ import{dirname as g,resolve as d}from"path";import{fileURLToPath as u}from"url";import{existsSync as w}from"fs";function h(){if(process.env.MCP_SKILL_PATH)return process.env.MCP_SKILL_PATH;let r=g(u(import.meta.url)),e=d(r,"..","bin","mcp-skill.mjs");return w(e)?e:null}function T(){return process.env.PROJECT_API_TOKEN||process.env.ZIBBY_USER_TOKEN||null}function _(){return((process.env.PROGRESS_API_URL||"").replace(/\/executions\/?$/,"")||process.env.ZIBBY_ACCOUNT_API_URL||process.env.ZIBBY_PROD_ACCOUNT_API_URL||(process.env.ZIBBY_ENV==="local"?"http://localhost:3001":"https://api-prod.zibby.app")).replace(/\/+$/,"")}var y={name:"trigger_workflow",description:"Trigger another Zibby workflow/agent run in THIS project (fire-and-forget). Call it once per run you want to start \u2014 the agent decides which and how many. Omit workflowType to re-run THIS same agent (self-dispatch, e.g. with a different trigger input). Returns the started run's executionId; does NOT wait for it to finish.",input_schema:{type:"object",properties:{workflowType:{type:"string",description:"Which workflow to trigger (its type/slug in this project). Omit to trigger THIS same agent (self-dispatch)."},input:{type:"object",description:"The trigger payload passed to the target workflow (validated against its state schema)."}},required:[]}},I={id:"trigger-workflow",serverName:"trigger",allowedTools:["mcp__trigger__*"],envKeys:[],description:"Trigger another Zibby workflow/agent run in this project (agent-driven, fire-and-forget; cloud + self-hosted).",promptFragment:"## Trigger another workflow (agent-driven)\nYou can start another Zibby workflow/agent run yourself with the `trigger_workflow`\ntool \u2014 and YOU decide when and how many times to call it. Each call starts ONE\nindependent run (fire-and-forget) and returns its executionId; it does NOT wait for\nthat run to finish.\n- To re-run THIS same agent (self-dispatch) \u2014 e.g. to hand an item to another of\n this agent's scenarios \u2014 OMIT `workflowType` and pass the `input` for that run.\n- To trigger a DIFFERENT agent in the project, pass its `workflowType` + `input`.\nCall it once per run you want to start (loop over your items and call it for each).\nIt never throws \u2014 a failure comes back as { ok:false, error }; log it and move on.",resolve(){let r=h();if(!r)return{command:null,args:[],env:{},description:this.description};let e={};for(let t of["PROJECT_API_TOKEN","PROJECT_ID","WORKFLOW_TYPE","PROGRESS_API_URL","ZIBBY_ACCOUNT_API_URL","ZIBBY_PROD_ACCOUNT_API_URL","ZIBBY_ENV","ZIBBY_USER_TOKEN"])process.env[t]&&(e[t]=process.env[t]);return{type:"stdio",command:"node",args:[r,"../dist/triggerWorkflow.js","triggerWorkflowSkill"],env:e,description:this.description,alwaysLoad:!1}},async handleToolCall(r,e={}){if(r!=="trigger_workflow")return JSON.stringify({ok:!1,error:`unknown tool: ${r}`});try{let t=process.env.PROJECT_ID,a=T(),s=typeof e.workflowType=="string"&&e.workflowType.trim()?e.workflowType.trim():(process.env.WORKFLOW_TYPE||"").trim();if(!t)return JSON.stringify({ok:!1,error:"PROJECT_ID not set \u2014 cannot resolve the target project."});if(!a)return JSON.stringify({ok:!1,error:"PROJECT_API_TOKEN not set \u2014 cannot authenticate the trigger."});if(!s)return JSON.stringify({ok:!1,error:"No workflowType given and WORKFLOW_TYPE is unset \u2014 nothing to trigger."});let c=`${_()}/projects/${encodeURIComponent(t)}/workflows/${encodeURIComponent(s)}/trigger`,l=new AbortController,p=setTimeout(()=>l.abort(),2e4),n;try{n=await fetch(c,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${a}`},body:JSON.stringify({input:e.input&&typeof e.input=="object"?e.input:{}}),signal:l.signal})}finally{clearTimeout(p)}let i=await n.text().catch(()=>""),o;try{o=i?JSON.parse(i):{}}catch{o={raw:i}}if(!n.ok)return JSON.stringify({ok:!1,error:`trigger failed (HTTP ${n.status})`,detail:o&&(o.error||o.message)||i.slice(0,300)});let f=o.executionId||o.execution?.id||o.id||null;return JSON.stringify({ok:!0,workflowType:s,executionId:f,note:"run started (fire-and-forget)"})}catch(t){return JSON.stringify({ok:!1,error:`trigger_workflow failed: ${t?.message||String(t)}`})}},tools:[y]};export{I as triggerWorkflowSkill};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zibby/skills",
3
- "version": "0.1.58",
3
+ "version": "0.1.59",
4
4
  "description": "Built-in skill definitions for the Zibby agent-workflow framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",