@zibby/skills 0.1.64 → 0.1.65
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/chat-notify.js +3 -3
- package/dist/figma.js +2 -2
- package/dist/git-write.js +1 -1
- package/dist/github.js +2 -2
- package/dist/gitlab.js +1 -1
- package/dist/googleDocs.d.ts +173 -0
- package/dist/googleDocs.js +11 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +115 -105
- package/dist/integrations.d.ts +6 -0
- package/dist/integrations.js +1 -1
- package/dist/jira.js +1 -1
- package/dist/lark.js +2 -2
- package/dist/linear.js +1 -1
- package/dist/llm-billing.js +1 -1
- package/dist/notion.js +5 -5
- package/dist/opendesign.js +2 -2
- package/dist/package.json +1 -1
- package/dist/plane.js +2 -2
- package/dist/sentry.js +2 -2
- package/dist/slack.js +1 -1
- package/dist/trackers/github-adapter.js +1 -1
- package/dist/trackers/index.js +1 -1
- package/dist/trackers/jira-adapter.js +3 -3
- package/dist/trackers/linear-adapter.js +9 -9
- package/package.json +1 -1
package/dist/integrations.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export const INTEGRATIONS: Readonly<{
|
|
|
30
30
|
ANTHROPIC_BILLING: "anthropic_billing";
|
|
31
31
|
CURSOR_ADMIN: "cursor_admin";
|
|
32
32
|
NOTION: "notion";
|
|
33
|
+
GOOGLE: "google";
|
|
33
34
|
PLANE: "plane";
|
|
34
35
|
LINEAR: "linear";
|
|
35
36
|
FIGMA: "figma";
|
|
@@ -101,6 +102,11 @@ export const INTEGRATION_REGISTRY: Readonly<{
|
|
|
101
102
|
name: string;
|
|
102
103
|
connectPath: string;
|
|
103
104
|
};
|
|
105
|
+
google: {
|
|
106
|
+
id: string;
|
|
107
|
+
name: string;
|
|
108
|
+
connectPath: string;
|
|
109
|
+
};
|
|
104
110
|
plane: {
|
|
105
111
|
id: string;
|
|
106
112
|
name: string;
|
package/dist/integrations.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var n=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),i=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});export{n as INTEGRATIONS,i as INTEGRATION_REGISTRY};
|
|
1
|
+
var n=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),i=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});export{n as INTEGRATIONS,i as INTEGRATION_REGISTRY};
|
package/dist/jira.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as T}from"module";import{resolveIntegrationToken as P,clearTokenCache as $}from"@zibby/core/backend-client.js";var O=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),U=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});var q=T(import.meta.url);function K(){if(process.env.MCP_JIRA_PATH)return process.env.MCP_JIRA_PATH;try{return q.resolve("@zibby/mcp-jira/index.js")}catch{return null}}var C=new Set(["paragraph","heading","bulletList","orderedList","listItem","blockquote","codeBlock","rule","table","tableRow","tableCell","tableHeader","mediaSingle","panel"]);function L(c,a){if(!a||!a.length)return c;let e=c;for(let t of a)t.type==="strong"?e=`**${e}**`:t.type==="em"?e=`_${e}_`:t.type==="code"?e=`\`${e}\``:t.type==="strike"?e=`~~${e}~~`:t.type==="link"&&t.attrs?.href&&(e=`[${e}](${t.attrs.href})`);return e}function S(c,a=0){if(!Array.isArray(c))return"";let e=[];for(let t of c){if(t.type==="text"){e.push(L(t.text||"",t.marks));continue}if(t.type==="hardBreak"){e.push(`
|
|
1
|
+
import{createRequire as T}from"module";import{resolveIntegrationToken as P,clearTokenCache as $}from"@zibby/core/backend-client.js";var O=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),U=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});var q=T(import.meta.url);function K(){if(process.env.MCP_JIRA_PATH)return process.env.MCP_JIRA_PATH;try{return q.resolve("@zibby/mcp-jira/index.js")}catch{return null}}var C=new Set(["paragraph","heading","bulletList","orderedList","listItem","blockquote","codeBlock","rule","table","tableRow","tableCell","tableHeader","mediaSingle","panel"]);function L(c,a){if(!a||!a.length)return c;let e=c;for(let t of a)t.type==="strong"?e=`**${e}**`:t.type==="em"?e=`_${e}_`:t.type==="code"?e=`\`${e}\``:t.type==="strike"?e=`~~${e}~~`:t.type==="link"&&t.attrs?.href&&(e=`[${e}](${t.attrs.href})`);return e}function S(c,a=0){if(!Array.isArray(c))return"";let e=[];for(let t of c){if(t.type==="text"){e.push(L(t.text||"",t.marks));continue}if(t.type==="hardBreak"){e.push(`
|
|
2
2
|
`);continue}if(t.type==="rule"){e.push(`
|
|
3
3
|
---
|
|
4
4
|
`);continue}let r=t.content?S(t.content,a+1):"";if(t.type==="listItem")e.push(r);else if(t.type==="bulletList"){let i=(t.content||[]).map(o=>`- ${S(o.content||[],a+1).trim()}`);e.push(`
|
package/dist/lark.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{existsSync as f}from"fs";import{fileURLToPath as y}from"url";import{dirname as k,resolve as b}from"path";import{resolveIntegrationToken as v}from"@zibby/core/backend-client.js";var u=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),
|
|
1
|
+
import{existsSync as f}from"fs";import{fileURLToPath as y}from"url";import{dirname as k,resolve as b}from"path";import{resolveIntegrationToken as v}from"@zibby/core/backend-client.js";var u=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),T=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});function I(){if(process.env.MCP_LARK_PATH)return process.env.MCP_LARK_PATH;let i=k(y(import.meta.url)),e=b(i,"..","bin","mcp-lark.mjs");return f(e)?e:null}var N=6e3*1e3,p=null;async function S(){let{appId:i,appSecret:e,host:t}=await v("lark");if(p&&p.appId===i&&p.expiresAt>Date.now())return{token:p.token,host:t};let n=await(await fetch(`${t}/open-apis/auth/v3/tenant_access_token/internal`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_id:i,app_secret:e})})).json();if(n.code!==0)throw new Error(`Lark tenant_access_token failed: ${n.msg||n.code}`);return p={token:n.tenant_access_token,expiresAt:Date.now()+N,appId:i},{token:n.tenant_access_token,host:t}}async function _(i,e,t={}){let{token:a,host:n}=await S(),r=`${n}${e}`,m={method:i,headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json; charset=utf-8"}};i!=="GET"&&(m.body=JSON.stringify(t));let c=await(await fetch(r,m)).json();if(c.code!==0)throw new Error(`Lark API ${e} error: ${c.msg||c.code}`);return c.data||{}}function g(i){return JSON.stringify({text:i})}function O(i){return!i||typeof i!="string"||i.startsWith("oc_")?"chat_id":i.startsWith("ou_")?"open_id":i.startsWith("on_")?"union_id":i.startsWith("cli_")?"app_id":i.includes("@")?"email":"chat_id"}var x={id:"lark",serverName:"lark",allowedTools:["mcp__lark__*"],requiresIntegration:u.LARK,description:"Lark / Feishu messaging \u2014 send messages and reply in threads.",envKeys:[],promptFragment:`## Lark (connected)
|
|
2
2
|
You can send messages and replies on Lark. Use:
|
|
3
3
|
- lark_send_message: post a message to a chat, user, or DM
|
|
4
4
|
- lark_reply: reply to an existing message (threaded)
|
|
5
5
|
- lark_list_chats: list chats the bot is a member of
|
|
6
6
|
- lark_get_chat_history: fetch recent messages in a chat
|
|
7
7
|
- lark_lookup_user_by_email: resolve an email \u2192 open_id for direct DM (prefer this over emailing through lark_send_message when the agent has a user_id already)
|
|
8
|
-
When responding to an incoming event, prefer lark_reply with the source message_id so the response threads cleanly.`,resolve(){let i=I();if(!i)return null;let e={};for(let t of["PROJECT_API_TOKEN","ZIBBY_USER_TOKEN","ZIBBY_ACCOUNT_API_URL","ZIBBY_ENV","ZIBBY_PROD_ACCOUNT_API_URL","PROGRESS_API_URL","EXECUTION_ID","PROJECT_ID","STAGE"])process.env[t]&&(e[t]=process.env[t]);return{type:"stdio",command:"node",args:[i],env:e,alwaysLoad:!0}},tools:[{name:"lark_send_message",description:"Send a text message to a Lark chat, user, or DM. receive_id can be a chat_id (oc_*), open_id (ou_*), union_id (on_*), or email.",input_schema:{type:"object",properties:{receive_id:{type:"string",description:"Target id: chat_id (oc_*), open_id (ou_*), union_id (on_*), or email"},text:{type:"string",description:"Message text"}},required:["receive_id","text"]}},{name:"lark_reply",description:"Reply to an existing Lark message (creates a thread). Use the message_id from the inbound event.",input_schema:{type:"object",properties:{message_id:{type:"string",description:"Lark message id (om_*) to reply to"},text:{type:"string",description:"Reply text"}},required:["message_id","text"]}},{name:"lark_list_chats",description:"List chats (groups + DMs) the bot is a member of.",input_schema:{type:"object",properties:{page_size:{type:"number",description:"Max results (default 50)"}}}},{name:"lark_get_chat_history",description:"Fetch recent messages in a chat.",input_schema:{type:"object",properties:{chat_id:{type:"string",description:"Chat id (oc_*)"},page_size:{type:"number",description:"Max messages (default 20)"}},required:["chat_id"]}},{name:"lark_lookup_user_by_email",description:"Resolve an email address to a Lark user id (open_id). Returns { ok:true, user:{open_id,email,name} } on hit, { ok:false } if no Lark user has that email. Use the open_id as `receive_id` in lark_send_message to DM.",input_schema:{type:"object",properties:{email:{type:"string",description:"Email address to look up"}},required:["email"]}},{name:"lark_search_users",description:'Fuzzy-search users by name across chats the bot is a member of. Lark has no public org-wide user search API for bots \u2014 this walks the bot\'s chat memberships and matches names client-side. Best for "send to Sam" style routing where you have a name but no email. Returns up to `limit` ranked matches { open_id, name }.',input_schema:{type:"object",properties:{query:{type:"string",description:"Substring to match against user names (case-insensitive)"},limit:{type:"number",description:"Max matches to return (default 5, max 25)"}},required:["query"]}}],async handleToolCall(i,e){try{switch(i){case"lark_send_message":{if(!e.receive_id||!e.text)return JSON.stringify({error:"receive_id and text are required"});let t=
|
|
8
|
+
When responding to an incoming event, prefer lark_reply with the source message_id so the response threads cleanly.`,resolve(){let i=I();if(!i)return null;let e={};for(let t of["PROJECT_API_TOKEN","ZIBBY_USER_TOKEN","ZIBBY_ACCOUNT_API_URL","ZIBBY_ENV","ZIBBY_PROD_ACCOUNT_API_URL","PROGRESS_API_URL","EXECUTION_ID","PROJECT_ID","STAGE"])process.env[t]&&(e[t]=process.env[t]);return{type:"stdio",command:"node",args:[i],env:e,alwaysLoad:!0}},tools:[{name:"lark_send_message",description:"Send a text message to a Lark chat, user, or DM. receive_id can be a chat_id (oc_*), open_id (ou_*), union_id (on_*), or email.",input_schema:{type:"object",properties:{receive_id:{type:"string",description:"Target id: chat_id (oc_*), open_id (ou_*), union_id (on_*), or email"},text:{type:"string",description:"Message text"}},required:["receive_id","text"]}},{name:"lark_reply",description:"Reply to an existing Lark message (creates a thread). Use the message_id from the inbound event.",input_schema:{type:"object",properties:{message_id:{type:"string",description:"Lark message id (om_*) to reply to"},text:{type:"string",description:"Reply text"}},required:["message_id","text"]}},{name:"lark_list_chats",description:"List chats (groups + DMs) the bot is a member of.",input_schema:{type:"object",properties:{page_size:{type:"number",description:"Max results (default 50)"}}}},{name:"lark_get_chat_history",description:"Fetch recent messages in a chat.",input_schema:{type:"object",properties:{chat_id:{type:"string",description:"Chat id (oc_*)"},page_size:{type:"number",description:"Max messages (default 20)"}},required:["chat_id"]}},{name:"lark_lookup_user_by_email",description:"Resolve an email address to a Lark user id (open_id). Returns { ok:true, user:{open_id,email,name} } on hit, { ok:false } if no Lark user has that email. Use the open_id as `receive_id` in lark_send_message to DM.",input_schema:{type:"object",properties:{email:{type:"string",description:"Email address to look up"}},required:["email"]}},{name:"lark_search_users",description:'Fuzzy-search users by name across chats the bot is a member of. Lark has no public org-wide user search API for bots \u2014 this walks the bot\'s chat memberships and matches names client-side. Best for "send to Sam" style routing where you have a name but no email. Returns up to `limit` ranked matches { open_id, name }.',input_schema:{type:"object",properties:{query:{type:"string",description:"Substring to match against user names (case-insensitive)"},limit:{type:"number",description:"Max matches to return (default 5, max 25)"}},required:["query"]}}],async handleToolCall(i,e){try{switch(i){case"lark_send_message":{if(!e.receive_id||!e.text)return JSON.stringify({error:"receive_id and text are required"});let t=O(e.receive_id),a=await _("POST",`/open-apis/im/v1/messages?receive_id_type=${t}`,{receive_id:e.receive_id,msg_type:"text",content:g(e.text)});return JSON.stringify({ok:!0,message_id:a.message_id})}case"lark_reply":{if(!e.message_id||!e.text)return JSON.stringify({error:"message_id and text are required"});let t=await _("POST",`/open-apis/im/v1/messages/${encodeURIComponent(e.message_id)}/reply`,{msg_type:"text",content:g(e.text)});return JSON.stringify({ok:!0,message_id:t.message_id})}case"lark_list_chats":{let t=e.page_size||50,n=((await _("GET",`/open-apis/im/v1/chats?page_size=${t}`)).items||[]).map(r=>({chat_id:r.chat_id,name:r.name,description:r.description,owner_id:r.owner_id,chat_mode:r.chat_mode}));return JSON.stringify({chats:n})}case"lark_get_chat_history":{if(!e.chat_id)return JSON.stringify({error:"chat_id is required"});let t=e.page_size||20,n=((await _("GET",`/open-apis/im/v1/messages?container_id_type=chat&container_id=${encodeURIComponent(e.chat_id)}&page_size=${t}&sort_type=ByCreateTimeDesc`)).items||[]).map(r=>({message_id:r.message_id,sender_id:r.sender?.id,sender_type:r.sender?.sender_type,msg_type:r.msg_type,content:r.body?.content,create_time:r.create_time}));return JSON.stringify({messages:n})}case"lark_lookup_user_by_email":{if(!e.email)return JSON.stringify({error:"email is required"});let a=((await _("POST","/open-apis/contact/v3/users/batch_get_id?user_id_type=open_id",{emails:[e.email]})).user_list||[]).find(n=>n.email===e.email&&n.user_id);return JSON.stringify(a?{ok:!0,user:{open_id:a.user_id,email:a.email,name:a.name||void 0}}:{ok:!1,reason:"no_lark_user_for_email"})}case"lark_search_users":{if(!e.query||typeof e.query!="string")return JSON.stringify({error:"query is required"});let t=e.query.trim().toLowerCase();if(!t)return JSON.stringify({ok:!0,matches:[]});let a=Math.max(1,Math.min(Number(e.limit)||5,25)),n=200,m=((await _("GET","/open-apis/im/v1/chats?page_size=100")).items||[]).map(o=>o.chat_id),l=new Set,c=[];for(let o of m){if(c.length>=n)break;try{let s=await _("GET",`/open-apis/im/v1/chats/${encodeURIComponent(o)}/members?member_id_type=open_id&page_size=100`);for(let d of s.items||[])if(!(!d.member_id||l.has(d.member_id))&&(l.add(d.member_id),c.push({open_id:d.member_id,name:d.name||""}),c.length>=n))break}catch(s){console.warn(`[lark] member scan failed for ${o}: ${s.message}`)}}let h=[];for(let o of c){let s=(o.name||"").toLowerCase();if(!s)continue;let d=0;s.includes(t)&&(d+=100-Math.abs(s.length-t.length)),s===t&&(d+=200),d>0&&h.push({open_id:o.open_id,name:o.name,_score:d})}return h.sort((o,s)=>s._score-o._score),JSON.stringify({ok:!0,matches:h.slice(0,a).map(({_score:o,...s})=>s),scanned:c.length})}default:return JSON.stringify({error:`Unknown tool: ${i}`})}}catch(t){return JSON.stringify({error:t.message})}}};function C(){p=null}export{C as _resetLarkTokenCache,x as larkSkill};
|
package/dist/linear.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{existsSync as N}from"fs";import{fileURLToPath as k}from"url";import{dirname as L,resolve as w}from"path";var h=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),R=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});function S(){if(process.env.MCP_SKILL_PATH)return process.env.MCP_SKILL_PATH;let a=L(k(import.meta.url)),i=w(a,"..","bin","mcp-skill.mjs");return N(i)?i:null}var v=process.env.LINEAR_API_URL||"https://api.linear.app/graphql";function O(){if(process.env.LINEAR_OAUTH_TOKEN)return`Bearer ${process.env.LINEAR_OAUTH_TOKEN}`;let a=process.env.LINEAR_API_KEY;if(!a)throw new Error("Linear is not connected: set LINEAR_API_KEY (personal API key) or LINEAR_OAUTH_TOKEN.");return a}async function f(a,i={}){let t=await fetch(v,{method:"POST",headers:{Authorization:O(),"Content-Type":"application/json"},body:JSON.stringify({query:a,variables:i})});if(!t.ok){let s=await t.text().catch(()=>"");throw new Error(`Linear API ${t.status}: ${s.slice(0,300)}`)}let e=await t.json().catch(()=>null);if(!e)throw new Error("Linear API returned a non-JSON body");if(Array.isArray(e.errors)&&e.errors.length){let s=e.errors.map(n=>n?.message||String(n)).join("; ");throw new Error(`Linear GraphQL error: ${s.slice(0,300)}`)}return e.data}function _(a){return String(a||"").toLowerCase().replace(/\s+/g,"").replace(/[()\-_::"'`]/g,"")}function E(a,i){let t=_(a),e=_(i);if(!t||!e)return 0;if(t===e)return 1;if(t.length===1||e.length===1)return t===e?1:0;let s=d=>{let u=new Map;for(let y=0;y<d.length-1;y++){let g=d.slice(y,y+2);u.set(g,(u.get(g)||0)+1)}return u},n=s(t),r=s(e),o=0,l=0,m=0;for(let d of n.values())l+=d;for(let d of r.values())m+=d;for(let[d,u]of n.entries())o+=Math.min(u,r.get(d)||0);return 2*o/Math.max(1,l+m)}function P(a,i){let t=Array.isArray(a)?a:[];if(!t.length)return{state:null,strategy:"no-states"};let e=_(i);if(!e)return{state:null,strategy:"no-target"};let s=t.find(o=>_(o.name)===e);if(s)return{state:s,strategy:"exact"};let n={backlog:["backlog"],unstarted:["todo","unstarted","open"],started:["inprogress","started","doing","wip"],completed:["done","completed","closed","resolved","fixed"],canceled:["canceled","cancelled","wontfix","won'tfix"],triage:["triage"]};for(let[o,l]of Object.entries(n)){if(!l.some(d=>_(d)===e))continue;let m=t.find(d=>d.type===o);if(m)return{state:m,strategy:"type-alias"}}let r=t.map(o=>({s:o,score:E(i,o.name)})).sort((o,l)=>l.score-o.score);return r[0]&&r[0].score>=.5?{state:r[0].s,strategy:"fuzzy"}:{state:null,strategy:"no-match"}}var T=`
|
|
1
|
+
import{existsSync as N}from"fs";import{fileURLToPath as k}from"url";import{dirname as L,resolve as w}from"path";var h=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),R=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});function S(){if(process.env.MCP_SKILL_PATH)return process.env.MCP_SKILL_PATH;let a=L(k(import.meta.url)),i=w(a,"..","bin","mcp-skill.mjs");return N(i)?i:null}var v=process.env.LINEAR_API_URL||"https://api.linear.app/graphql";function O(){if(process.env.LINEAR_OAUTH_TOKEN)return`Bearer ${process.env.LINEAR_OAUTH_TOKEN}`;let a=process.env.LINEAR_API_KEY;if(!a)throw new Error("Linear is not connected: set LINEAR_API_KEY (personal API key) or LINEAR_OAUTH_TOKEN.");return a}async function f(a,i={}){let t=await fetch(v,{method:"POST",headers:{Authorization:O(),"Content-Type":"application/json"},body:JSON.stringify({query:a,variables:i})});if(!t.ok){let s=await t.text().catch(()=>"");throw new Error(`Linear API ${t.status}: ${s.slice(0,300)}`)}let e=await t.json().catch(()=>null);if(!e)throw new Error("Linear API returned a non-JSON body");if(Array.isArray(e.errors)&&e.errors.length){let s=e.errors.map(n=>n?.message||String(n)).join("; ");throw new Error(`Linear GraphQL error: ${s.slice(0,300)}`)}return e.data}function _(a){return String(a||"").toLowerCase().replace(/\s+/g,"").replace(/[()\-_::"'`]/g,"")}function E(a,i){let t=_(a),e=_(i);if(!t||!e)return 0;if(t===e)return 1;if(t.length===1||e.length===1)return t===e?1:0;let s=d=>{let u=new Map;for(let y=0;y<d.length-1;y++){let g=d.slice(y,y+2);u.set(g,(u.get(g)||0)+1)}return u},n=s(t),r=s(e),o=0,l=0,m=0;for(let d of n.values())l+=d;for(let d of r.values())m+=d;for(let[d,u]of n.entries())o+=Math.min(u,r.get(d)||0);return 2*o/Math.max(1,l+m)}function P(a,i){let t=Array.isArray(a)?a:[];if(!t.length)return{state:null,strategy:"no-states"};let e=_(i);if(!e)return{state:null,strategy:"no-target"};let s=t.find(o=>_(o.name)===e);if(s)return{state:s,strategy:"exact"};let n={backlog:["backlog"],unstarted:["todo","unstarted","open"],started:["inprogress","started","doing","wip"],completed:["done","completed","closed","resolved","fixed"],canceled:["canceled","cancelled","wontfix","won'tfix"],triage:["triage"]};for(let[o,l]of Object.entries(n)){if(!l.some(d=>_(d)===e))continue;let m=t.find(d=>d.type===o);if(m)return{state:m,strategy:"type-alias"}}let r=t.map(o=>({s:o,score:E(i,o.name)})).sort((o,l)=>l.score-o.score);return r[0]&&r[0].score>=.5?{state:r[0].s,strategy:"fuzzy"}:{state:null,strategy:"no-match"}}var T=`
|
|
2
2
|
id
|
|
3
3
|
identifier
|
|
4
4
|
number
|
package/dist/llm-billing.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveIntegrationToken as w}from"@zibby/core/backend-client.js";var k=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),
|
|
1
|
+
import{resolveIntegrationToken as w}from"@zibby/core/backend-client.js";var k=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),N=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});var S=Object.freeze({id:"openai_billing",requiresIntegration:k.OPENAI_BILLING,description:"OpenAI organization billing/usage admin API (paste sk-admin-... key)"}),$=Object.freeze({id:"anthropic_billing",requiresIntegration:k.ANTHROPIC_BILLING,description:"Anthropic organization cost/usage admin API (paste sk-ant-admin-... key)"}),E=Object.freeze({id:"cursor_admin",requiresIntegration:k.CURSOR_ADMIN,description:"Cursor Team/Enterprise admin API (paste admin key)"});function I(t){return Math.floor(t/1e3)}function _(t){return new Date(t).toISOString().slice(0,10)}function b(t){return new Date(t).toISOString()}async function f(t){let a=await w(t);if(!a?.token)throw new Error(`${t} token resolver returned no token`);return a.token}async function A({startMs:t,endMs:a,groupBy:o=["project_id","line_item"]}){let i=await f("openai_billing"),e=[],n=0,m=o.map(d=>`group_by[]=${encodeURIComponent(d)}`).join("&"),u=null;for(let d=0;d<50;d++){let r=`https://api.openai.com/v1/organization/costs?${[`start_time=${I(t)}`,`end_time=${I(a)}`,"bucket_width=1d","limit=180",m,u?`page=${encodeURIComponent(u)}`:""].filter(Boolean).join("&")}`,c=await fetch(r,{headers:{Authorization:`Bearer ${i}`}});if(!c.ok){let l=await c.text().catch(()=>"");throw new Error(`OpenAI costs API ${c.status}: ${l.slice(0,200)}`)}let p=await c.json();for(let l of p.data||[]){n+=1;let h=_((l.start_time||0)*1e3);for(let s of l.results||[])e.push({provider:"openai",day:h,costUsd:Number(s.amount?.value??0),projectId:s.project_id||void 0,apiKeyId:s.api_key_id||void 0,model:s.line_item||void 0})}if(!p.has_more||!p.next_page)break;u=p.next_page}return{ok:!0,items:e,rawBuckets:n}}async function j(){let t=await f("openai_billing"),o=await fetch("https://api.openai.com/v1/organization/projects?limit=100",{headers:{Authorization:`Bearer ${t}`}});if(!o.ok){let n=await o.text().catch(()=>"");throw new Error(`OpenAI projects API ${o.status}: ${n.slice(0,200)}`)}let i=await o.json(),e=new Map;for(let n of i.data||[])e.set(n.id,n.name);return e}async function y({startMs:t,endMs:a,groupBy:o=["workspace_id"]}){let i=await f("anthropic_billing"),e=[],n=0,m=o.map(d=>`group_by[]=${encodeURIComponent(d)}`).join("&"),u=null;for(let d=0;d<50;d++){let r=`https://api.anthropic.com/v1/organizations/cost_report?${[`starting_at=${encodeURIComponent(b(t))}`,`ending_at=${encodeURIComponent(b(a))}`,"bucket=1d","limit=100",m,u?`page=${encodeURIComponent(u)}`:""].filter(Boolean).join("&")}`,c=await fetch(r,{headers:{"x-api-key":i,"anthropic-version":"2023-06-01"}});if(!c.ok){let l=await c.text().catch(()=>"");throw new Error(`Anthropic cost_report ${c.status}: ${l.slice(0,200)}`)}let p=await c.json();for(let l of p.data||[]){n+=1;let h=(l.starting_at||"").slice(0,10);for(let s of l.results||[])e.push({provider:"anthropic",day:h,costUsd:Number(s.amount??s.cost??0),workspaceId:s.workspace_id||void 0,apiKeyId:s.api_key_id||void 0,model:s.model||void 0,tokensIn:s.uncached_input_tokens!=null?Number(s.uncached_input_tokens):void 0,tokensOut:s.output_tokens!=null?Number(s.output_tokens):void 0,cachedTokens:s.cached_input_tokens!=null?Number(s.cached_input_tokens):void 0})}if(!p.has_more||!p.next_page)break;u=p.next_page}return{ok:!0,items:e,rawBuckets:n}}async function L(){let t=await f("anthropic_billing"),o=await fetch("https://api.anthropic.com/v1/organizations/workspaces?limit=100",{headers:{"x-api-key":t,"anthropic-version":"2023-06-01"}});if(!o.ok){let n=await o.text().catch(()=>"");throw new Error(`Anthropic workspaces ${o.status}: ${n.slice(0,200)}`)}let i=await o.json(),e=new Map;for(let n of i.data||[])e.set(n.id,n.name);return e}async function v({startMs:t,endMs:a}){let o=await f("cursor_admin"),i=_(t),e=_(a),n=`https://api.cursor.com/teams/daily-usage-data?startDate=${i}&endDate=${e}`,m=await fetch(n,{headers:{Authorization:`Bearer ${o}`}});if(!m.ok){let r=await m.text().catch(()=>"");throw new Error(`Cursor daily-usage ${m.status}: ${r.slice(0,200)}`)}let u=await m.json(),d=[],g=0;for(let r of u.data||[]){g+=1;let c=r.date;for(let p of r.userMetrics||[]){for(let l of p.modelUsage||[]){let h=Number(l.acceptedLines??0),s=Number(l.suggestedLines??0);d.push({provider:"cursor",day:c,costUsd:Number(l.totalCents??0)/100,userEmail:p.email,model:l.model,requestCount:Number(l.requestCount??0),acceptanceRate:s>0?h/s:void 0})}(!p.modelUsage||p.modelUsage.length===0)&&d.push({provider:"cursor",day:c,costUsd:Number(p.totalCents??0)/100,userEmail:p.email})}}return{ok:!0,items:d,rawBuckets:g}}async function R({startMs:t,endMs:a}){let[o,i,e]=await Promise.allSettled([A({startMs:t,endMs:a}),y({startMs:t,endMs:a}),v({startMs:t,endMs:a})]),n=r=>r.status==="fulfilled"?r.value:{ok:!1,error:r.reason?.message||String(r.reason),items:[]},m=n(o),u=n(i),d=n(e),g=[{provider:"openai",totalUsd:m.items.reduce((r,c)=>r+(c.costUsd||0),0)},{provider:"anthropic",totalUsd:u.items.reduce((r,c)=>r+(c.costUsd||0),0)},{provider:"cursor",totalUsd:d.items.reduce((r,c)=>r+(c.costUsd||0),0)}];return{openai:m,anthropic:u,cursor:d,totals:g}}function x(t,a){let o=new Map;for(let i of t){let e=a(i);if(!e)continue;let n=o.get(e)||{key:e,totalUsd:0,count:0};n.totalUsd+=i.costUsd||0,n.count+=1,o.set(e,n)}return[...o.values()].sort((i,e)=>e.totalUsd-i.totalUsd)}function B(t){if(!t.length)return{mean:0,stddev:0};let a=t.reduce((i,e)=>i+e,0)/t.length,o=t.reduce((i,e)=>i+(e-a)**2,0)/t.length;return{mean:a,stddev:Math.sqrt(o)}}export{$ as anthropicBillingSkill,E as cursorAdminSkill,R as fetchAllProviders,y as fetchAnthropicCosts,L as fetchAnthropicWorkspaces,v as fetchCursorSpend,A as fetchOpenAICosts,j as fetchOpenAIProjects,x as groupByKey,B as meanStddev,S as openaiBillingSkill};
|
package/dist/notion.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{existsSync as $}from"fs";import{fileURLToPath as I}from"url";import{dirname as A,resolve as w}from"path";import{resolveIntegrationToken as O,clearTokenCache as S}from"@zibby/core/backend-client.js";var
|
|
1
|
+
import{existsSync as $}from"fs";import{fileURLToPath as I}from"url";import{dirname as A,resolve as w}from"path";import{resolveIntegrationToken as O,clearTokenCache as S}from"@zibby/core/backend-client.js";var m=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),j=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});function x(){if(process.env.MCP_SKILL_PATH)return process.env.MCP_SKILL_PATH;let t=A(I(import.meta.url)),a=w(t,"..","bin","mcp-skill.mjs");return $(a)?a:null}var L="2022-06-28",R="https://api.notion.com/v1",g=2e4,b=25,v=25;function _(t){if(!t||typeof t!="string")return null;let i=t.trim().split(/[?#]/)[0],e=i.match(/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/);if(e)return e[0].toLowerCase();let n=i.match(/[0-9a-fA-F]{32}/g);if(n&&n.length){let r=n[n.length-1].toLowerCase();return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}return null}async function f(t,a={}){let i=async()=>{let{token:e}=await O("notion");if(typeof e!="string"||!e)throw new Error(`Invalid notion token type: ${typeof e}`);let n=await fetch(`${R}${t}`,{method:a.method||"GET",headers:{Authorization:`Bearer ${e}`,"Notion-Version":L,Accept:"application/json",...a.body?{"Content-Type":"application/json"}:{},...a.headers},body:a.body?JSON.stringify(a.body):void 0});if(!n.ok){let s=await n.text().catch(()=>"");throw new Error(`Notion API ${n.status}: ${s.slice(0,300)}`)}let r=await n.text().catch(()=>"");if(!r||!r.trim())return{};try{return JSON.parse(r)}catch{return{raw:r}}};try{return await i()}catch(e){let n=String(e?.message||e||"").toLowerCase();if(!(n.includes("token")||n.includes("401")||n.includes("unauthorized")))throw e;return S("notion"),i()}}function p(t){if(!Array.isArray(t))return"";let a="";for(let i of t){let e=i?.plain_text??i?.text?.content??"";if(!e)continue;let n=i.annotations||{};n.code&&(e=`\`${e}\``),n.bold&&(e=`**${e}**`),n.italic&&(e=`_${e}_`),n.strikethrough&&(e=`~~${e}~~`);let r=i?.href||i?.text?.link?.url;r&&(e=`[${e}](${r})`),a+=e}return a}function P(t,a,i){let e=t?.type,n=t?.[e]||{},r=" ".repeat(Math.max(0,a)),s=(c="rich_text")=>p(n[c]),o;switch(e){case"paragraph":o=s();break;case"heading_1":o=`# ${s()}`;break;case"heading_2":o=`## ${s()}`;break;case"heading_3":o=`### ${s()}`;break;case"bulleted_list_item":o=`${r}- ${s()}`;break;case"numbered_list_item":o=`${r}1. ${s()}`;break;case"to_do":o=`${r}- [${n.checked?"x":" "}] ${s()}`;break;case"toggle":o=`${r}- ${s()}`;break;case"quote":o=`> ${s()}`;break;case"callout":{o=`> ${n.icon?.emoji?`${n.icon.emoji} `:""}${s()}`;break}case"code":{o=`\`\`\`${n.language||""}
|
|
2
2
|
${s()}
|
|
3
|
-
\`\`\``;break}case"divider":
|
|
4
|
-
`)}async function y(t,a,i){let e=[],n,
|
|
5
|
-
`)}function k(t){let a=t?.properties||{};for(let i of Object.values(a))if(i?.type==="title"){let e=p(i.title).trim();if(e)return e}return""}function T(t){if(!t||!t.type)return"";switch(t.type){case"title":return p(t.title).trim();case"rich_text":return p(t.rich_text).trim();case"number":return t.number==null?"":String(t.number);case"select":return t.select?.name||"";case"status":return t.status?.name||"";case"multi_select":return(t.multi_select||[]).map(i=>i.name).join(", ");case"checkbox":return t.checkbox?"true":"false";case"url":return t.url||"";case"email":return t.email||"";case"phone_number":return t.phone_number||"";case"date":return t.date?.start||"";case"people":return(t.people||[]).map(i=>i.name||i.id).join(", ");default:return""}}var B={id:"notion",serverName:"notion",allowedTools:["mcp__notion__*"],requiresIntegration:
|
|
3
|
+
\`\`\``;break}case"divider":o="---";break;case"child_page":o=`[child page: ${n.title||""}]`;break;case"child_database":o=`[child database: ${n.title||""}]`;break;case"bookmark":case"embed":case"link_preview":o=n.url?`<${n.url}>`:"";break;case"equation":o=n.expression?`$${n.expression}$`:"";break;case"table":case"column_list":case"column":o="";break;case"table_row":{let c=(n.cells||[]).map(d=>p(d).trim());o=`${r}| ${c.join(" | ")} |`;break}default:o=s();break}let l=[];return o&&o.trim()&&l.push(o),i&&i.trim()&&l.push(i),l.join(`
|
|
4
|
+
`)}async function y(t,a,i){let e=[],n,r=0;do{if(i.used>=g)break;let s=new URLSearchParams({page_size:"100"});n&&s.set("start_cursor",n);let o=await f(`/blocks/${t}/children?${s.toString()}`),l=Array.isArray(o.results)?o.results:[];for(let c of l){let d="";c.has_children&&(d=await y(c.id,a+1,i));let u=P(c,a,d);if(u&&(e.push(u),i.used+=u.length+1),i.used>=g)break}n=o.has_more?o.next_cursor:void 0,r+=1}while(n&&r<v);return e.join(`
|
|
5
|
+
`)}function k(t){let a=t?.properties||{};for(let i of Object.values(a))if(i?.type==="title"){let e=p(i.title).trim();if(e)return e}return""}function T(t){if(!t||!t.type)return"";switch(t.type){case"title":return p(t.title).trim();case"rich_text":return p(t.rich_text).trim();case"number":return t.number==null?"":String(t.number);case"select":return t.select?.name||"";case"status":return t.status?.name||"";case"multi_select":return(t.multi_select||[]).map(i=>i.name).join(", ");case"checkbox":return t.checkbox?"true":"false";case"url":return t.url||"";case"email":return t.email||"";case"phone_number":return t.phone_number||"";case"date":return t.date?.start||"";case"people":return(t.people||[]).map(i=>i.name||i.id).join(", ");default:return""}}var B={id:"notion",serverName:"notion",allowedTools:["mcp__notion__*"],requiresIntegration:m.NOTION,description:"Notion read-only context (pull a page/database as markdown)",promptFragment:`## Notion (connected, read-only context)
|
|
6
6
|
You can pull a referenced Notion page in as extra context. This is OPTIONAL \u2014 only use it when the task references a Notion page/URL (e.g. an engineering-standards or design doc to review against).
|
|
7
7
|
- notion_get_page: pass a Notion page id OR a full Notion URL; returns { id, title, url, text } where text is the page flattened to markdown (truncated to ~20k chars). Use the text as reference context.
|
|
8
8
|
- notion_query_database: pass a database id/URL; returns a small list of rows ({ id, title, url, props }). Use to find a specific page, then notion_get_page it.
|
|
9
|
-
Do not block the task if Notion is unavailable \u2014 these tools return { ok:false, error } on failure; treat a missing page as "no extra context" and continue.`,resolve(){let t=x();return t?{type:"stdio",command:"node",args:[t,"../dist/notion.js","notionSkill"],env:{},description:this.description,alwaysLoad:!0}:null},async handleToolCall(t,a){try{switch(t){case"notion_get_page":{let i=a?.pageId||a?.page||a?.url||a?.id,e=_(i);if(!e)return JSON.stringify({ok:!1,error:"A valid Notion page id or URL is required"});let n=await
|
|
9
|
+
Do not block the task if Notion is unavailable \u2014 these tools return { ok:false, error } on failure; treat a missing page as "no extra context" and continue.`,resolve(){let t=x();return t?{type:"stdio",command:"node",args:[t,"../dist/notion.js","notionSkill"],env:{},description:this.description,alwaysLoad:!0}:null},async handleToolCall(t,a){try{switch(t){case"notion_get_page":{let i=a?.pageId||a?.page||a?.url||a?.id,e=_(i);if(!e)return JSON.stringify({ok:!1,error:"A valid Notion page id or URL is required"});let n=await f(`/pages/${e}`),r=k(n),s=n?.url||`https://www.notion.so/${e.replace(/-/g,"")}`,l=await y(e,0,{used:0}),c=!1;return l.length>g&&(l=l.slice(0,g),c=!0),JSON.stringify({ok:!0,id:e,title:r,url:s,text:l,...c?{truncated:!0}:{}})}case"notion_query_database":{let i=a?.databaseId||a?.database||a?.url||a?.id,e=_(i);if(!e)return JSON.stringify({ok:!1,error:"A valid Notion database id or URL is required"});let r={page_size:Math.max(1,Math.min(Number(a?.maxResults)||b,b))};a?.filter&&typeof a.filter=="object"&&(r.filter=a.filter);let s=await f(`/databases/${e}/query`,{method:"POST",body:r}),l=(Array.isArray(s.results)?s.results:[]).map(c=>{let d={};for(let[u,N]of Object.entries(c.properties||{})){let h=T(N);h&&(d[u]=h)}return{id:c.id,title:k(c),url:c.url||`https://www.notion.so/${String(c.id||"").replace(/-/g,"")}`,props:d}});return JSON.stringify({ok:!0,id:e,count:l.length,hasMore:!!s.has_more,rows:l})}default:return JSON.stringify({ok:!1,error:`Unknown tool: ${t}`})}}catch(i){return JSON.stringify({ok:!1,error:i.message})}},tools:[{name:"notion_get_page",description:"Fetch a Notion page and its content flattened to markdown, for use as read-only context. Accepts a raw page id OR a full Notion URL. Returns { ok, id, title, url, text }. Text is truncated to ~20k chars.",input_schema:{type:"object",properties:{pageId:{type:"string",description:"Notion page id (dashed UUID or 32-char) OR a full Notion page URL."}},required:["pageId"]}},{name:"notion_query_database",description:"Query a Notion database and return a bounded list of rows (id, title, url, key props). Accepts a database id OR full Notion URL. Optional Notion filter object. Returns at most 25 rows.",input_schema:{type:"object",properties:{databaseId:{type:"string",description:"Notion database id (dashed UUID or 32-char) OR a full Notion database URL."},filter:{type:"object",description:"Optional Notion filter object (Notion query filter syntax).",additionalProperties:!0},maxResults:{type:"number",description:"Max rows to return (default 25, max 25)."}},required:["databaseId"]}}]};export{f as notionApi,B as notionSkill,_ as parseNotionId};
|
package/dist/opendesign.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{existsSync as m}from"fs";import{fileURLToPath as f}from"url";import{dirname as _,resolve as y}from"path";import{resolveIntegrationToken as I}from"@zibby/core/backend-client.js";var
|
|
1
|
+
import{existsSync as m}from"fs";import{fileURLToPath as f}from"url";import{dirname as _,resolve as y}from"path";import{resolveIntegrationToken as I}from"@zibby/core/backend-client.js";var g=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),O=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});function j(){if(process.env.MCP_SKILL_PATH)return process.env.MCP_SKILL_PATH;let r=_(f(import.meta.url)),n=y(r,"..","bin","mcp-skill.mjs");return m(n)?n:null}async function l(){let r=await I(g.OPEN_DESIGN),n=r?.token,e=r?.baseUrl;if(!n||typeof n!="string")throw new Error("OpenDesign is not connected: missing token. Connect it in Integrations.");if(!e||typeof e!="string")throw new Error("OpenDesign is not connected: missing baseUrl. Connect it in Integrations.");let t=e.replace(/\/+$/,"");return{token:n,baseUrl:t}}async function d(r,n={}){let{token:e,baseUrl:t}=await l(),i=`${t}/api${r}`;if(n.query&&typeof n.query=="object"){let a=new URLSearchParams;for(let[h,c]of Object.entries(n.query))c!=null&&c!==""&&a.set(h,String(c));let p=a.toString();p&&(i+=(i.includes("?")?"&":"?")+p)}let o={Authorization:`Bearer ${e}`,Accept:"application/json",...n.body?{"Content-Type":"application/json"}:{}},s=await fetch(i,{method:n.method||"GET",headers:o,body:n.body?JSON.stringify(n.body):void 0});return u(s,"OpenDesign")}async function u(r,n){if(!r.ok){let t=await r.text().catch(()=>""),i=t.slice(0,300);try{let o=JSON.parse(t),s=o?.code||o?.error?.code,a=o?.message||o?.error?.message||o?.error;(s||a)&&(i=[s?`[${s}]`:null,a].filter(Boolean).join(" ")||i)}catch{}throw new Error(`${n} API ${r.status}: ${i}`)}let e=await r.text().catch(()=>"");if(!e)return{};try{return JSON.parse(e)}catch{return{raw:e}}}var T={id:"open-design",serverName:"opendesign",allowedTools:["mcp__opendesign__*"],envKeys:[],description:"OpenDesign \u2014 list projects/designs, run the design agent, and export decks to PDF/HTML",promptFragment:`## OpenDesign (optional)
|
|
2
2
|
You may have access to the user's OpenDesign workspace (the Zibby-managed design/deck app) via its REST API. These tools are OPTIONAL \u2014 if OpenDesign is not connected they will return a "not connected" error; reach for them only when the task involves OpenDesign projects, designs, or exports. Tools (mcp__opendesign__*):
|
|
3
3
|
|
|
4
4
|
### Connectivity
|
|
@@ -20,4 +20,4 @@ You may have access to the user's OpenDesign workspace (the Zibby-managed design
|
|
|
20
20
|
|
|
21
21
|
### Notes
|
|
22
22
|
- A design artifact lookup ALWAYS needs its projectId (it scopes the query).
|
|
23
|
-
- After opendesign_cli_run, poll opendesign_cli_status with the returned runId until the run is no longer running.`,resolve(){let r=j();if(!r)return{command:null,args:[],env:{},description:this.description};let n={};for(let e of this.envKeys)process.env[e]&&(n[e]=process.env[e]);return{type:"stdio",command:"node",args:[r,"../dist/opendesign.js","opendesignSkill"],env:n,description:this.description,alwaysLoad:!0}},async handleToolCall(r,n){try{switch(r){case"opendesign_health":{let{baseUrl:e}=await
|
|
23
|
+
- After opendesign_cli_run, poll opendesign_cli_status with the returned runId until the run is no longer running.`,resolve(){let r=j();if(!r)return{command:null,args:[],env:{},description:this.description};let n={};for(let e of this.envKeys)process.env[e]&&(n[e]=process.env[e]);return{type:"stdio",command:"node",args:[r,"../dist/opendesign.js","opendesignSkill"],env:n,description:this.description,alwaysLoad:!0}},async handleToolCall(r,n){try{switch(r){case"opendesign_health":{let{baseUrl:e}=await l(),t=await fetch(`${e}/api/health`,{method:"GET",headers:{Accept:"application/json"}}),i=await u(t,"OpenDesign");return JSON.stringify({ok:!0,health:i})}case"opendesign_list_projects":{let e=await d("/projects");return JSON.stringify(e)}case"opendesign_get_project":{let e=n?.id||n?.projectId;if(!e)return JSON.stringify({error:"id is required"});let t=await d(`/projects/${encodeURIComponent(e)}`);return JSON.stringify(t)}case"opendesign_list_designs":{let e=n?.projectId;if(!e)return JSON.stringify({error:"projectId is required"});let t=await d("/live-artifacts",{query:{projectId:e}});return JSON.stringify(t)}case"opendesign_get_design":{let e=n?.id,t=n?.projectId;if(!e)return JSON.stringify({error:"id is required"});if(!t)return JSON.stringify({error:"projectId is required"});let i=await d(`/live-artifacts/${encodeURIComponent(e)}`,{query:{projectId:t}});return JSON.stringify(i)}case"opendesign_export_pdf":{let e=n?.projectId||n?.id,{fileName:t,title:i,deck:o}=n||{};if(!e)return JSON.stringify({error:"projectId is required"});if(!t)return JSON.stringify({error:"fileName is required"});let s={fileName:t};i!==void 0&&(s.title=i),o!==void 0&&(s.deck=o);let a=await d(`/projects/${encodeURIComponent(e)}/export/pdf`,{method:"POST",body:s});return JSON.stringify(a)}case"opendesign_export_html":{let e=n?.projectId||n?.id,t=n?.path;if(!e)return JSON.stringify({error:"projectId is required"});if(!t)return JSON.stringify({error:"path is required (the export sub-path)"});let o=String(t).replace(/^\/+/,"").split("/").map(a=>encodeURIComponent(a)).join("/"),s=await d(`/projects/${encodeURIComponent(e)}/export/${o}`,{query:{inline:1}});return JSON.stringify(s)}case"opendesign_cli_run":{let{agentId:e,message:t,projectId:i,conversationId:o,model:s}=n||{};if(!e)return JSON.stringify({error:"agentId is required"});if(!t)return JSON.stringify({error:"message is required"});let a={agentId:e,message:t};i!==void 0&&(a.projectId=i),o!==void 0&&(a.conversationId=o),s!==void 0&&(a.model=s);let p=await d("/runs",{method:"POST",body:a});return JSON.stringify(p)}case"opendesign_cli_status":{let e=n?.id||n?.runId;if(!e)return JSON.stringify({error:"id (runId) is required"});let t=await d(`/runs/${encodeURIComponent(e)}`);return JSON.stringify(t)}default:return JSON.stringify({error:`Unknown tool: ${r}`})}}catch(e){return JSON.stringify({error:e.message})}},tools:[{name:"opendesign_health",description:"Probe the OpenDesign instance (GET /api/health, no auth). Use to confirm connectivity before other calls.",input_schema:{type:"object",properties:{}}},{name:"opendesign_list_projects",description:"List the projects in the OpenDesign workspace.",input_schema:{type:"object",properties:{}}},{name:"opendesign_get_project",description:"Get a single OpenDesign project by id.",input_schema:{type:"object",properties:{id:{type:"string",description:"The project id."}},required:["id"]}},{name:"opendesign_list_designs",description:"List the live design artifacts in an OpenDesign project. Requires the projectId, which scopes the query.",input_schema:{type:"object",properties:{projectId:{type:"string",description:"The project id whose designs to list."}},required:["projectId"]}},{name:"opendesign_get_design",description:"Get a single live design artifact by id. Requires both the design id and its projectId.",input_schema:{type:"object",properties:{id:{type:"string",description:"The live-artifact (design) id."},projectId:{type:"string",description:"The project id the design belongs to (scopes the lookup)."}},required:["id","projectId"]}},{name:"opendesign_export_pdf",description:"Export an OpenDesign project deck to PDF. Returns the export result (e.g. a download URL/path).",input_schema:{type:"object",properties:{projectId:{type:"string",description:"The project id to export."},fileName:{type:"string",description:"The output PDF file name."},title:{type:"string",description:"Optional deck title for the PDF."},deck:{description:"Optional deck payload/override to render instead of the project's current deck."}},required:["projectId","fileName"]}},{name:"opendesign_export_html",description:"Fetch an OpenDesign project's HTML export by sub-path (requested inline). Requires projectId and the export path.",input_schema:{type:"object",properties:{projectId:{type:"string",description:"The project id to export."},path:{type:"string",description:'The export sub-path under /projects/:id/export/ (e.g. "index.html" or a slide path).'}},required:["projectId","path"]}},{name:"opendesign_cli_run",description:"Start an OpenDesign agent run. Returns a runId; poll opendesign_cli_status with it until the run finishes.",input_schema:{type:"object",properties:{agentId:{type:"string",description:"The OpenDesign agent id to run."},message:{type:"string",description:"The instruction/message to send to the agent."},projectId:{type:"string",description:"Optional project id to scope the run to."},conversationId:{type:"string",description:"Optional conversation id to continue an existing thread."},model:{type:"string",description:"Optional model id override for the run."}},required:["agentId","message"]}},{name:"opendesign_cli_status",description:"Poll the status of an OpenDesign agent run by its runId.",input_schema:{type:"object",properties:{id:{type:"string",description:"The runId returned by opendesign_cli_run."}},required:["id"]}}]};export{T as opendesignSkill};
|
package/dist/package.json
CHANGED
package/dist/plane.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var i=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),t=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});var
|
|
1
|
+
var i=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),t=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});var r={id:"plane",serverName:"plane",allowedTools:["mcp__plane__*"],requiresIntegration:i.PLANE,envKeys:["PLANE_API_KEY","PLANE_WORKSPACE_SLUG","PLANE_BASE_URL"],description:"Plane \u2014 projects, work items, cycles, modules, epics, comments (official MCP, API key)",tools:[],promptFragment:`## Plane (connected)
|
|
2
2
|
You have direct access to the user's Plane workspace via the official Plane MCP server. All Plane tools are available under the mcp__plane__* namespace \u2014 use them proactively to read and write projects, work items (issues), cycles, modules, epics, sub-issues, comments, labels, states, pages, and workspace data.
|
|
3
3
|
|
|
4
4
|
- List/get projects and work items, then create/update/delete or search work items as needed.
|
|
5
5
|
- For status changes, read the project's available states first, then set the work item's state.
|
|
6
6
|
- Cycles and modules group work items \u2014 list them to scope queries before drilling into items.
|
|
7
|
-
- Always operate within the connected workspace; the workspace slug and base URL are pre-configured (Plane Cloud, self-hosted, or Zibby-hosted all work transparently).`,resolve(){let n={};for(let e of this.envKeys)process.env[e]&&(n[e]=process.env[e]);return{type:"stdio",command:"uvx",args:["plane-mcp-server","stdio"],env:n,description:this.description}}};export{
|
|
7
|
+
- Always operate within the connected workspace; the workspace slug and base URL are pre-configured (Plane Cloud, self-hosted, or Zibby-hosted all work transparently).`,resolve(){let n={};for(let e of this.envKeys)process.env[e]&&(n[e]=process.env[e]);return{type:"stdio",command:"uvx",args:["plane-mcp-server","stdio"],env:n,description:this.description}}};export{r as planeSkill};
|
package/dist/sentry.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{existsSync as m}from"fs";import{fileURLToPath as
|
|
1
|
+
import{existsSync as m}from"fs";import{fileURLToPath as g}from"url";import{dirname as _,resolve as h}from"path";import{resolveIntegrationToken as c}from"@zibby/core/backend-client.js";var u=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),T=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});function S(){if(process.env.MCP_SENTRY_PATH)return process.env.MCP_SENTRY_PATH;let n=_(g(import.meta.url)),t=h(n,"..","bin","mcp-sentry.mjs");return m(t)?t:null}function d(n){return(n||process.env.SENTRY_URL||"https://sentry.io").trim().replace(/\/+$/,"")}function f(n){let t=n||process.env.SENTRY_ORG;if(!t)throw new Error('Sentry organization not resolved \u2014 reconnect Sentry, or set SENTRY_ORG (self-hosted; the default org slug is "sentry").');return t}async function p(n,t={}){let{token:e,organizationSlug:s,baseUrl:r}=await c("sentry"),i=`${d(r)}/api/0/organizations/${f(s)}${n}`,o={method:t.method||"GET",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}};t.body!=null&&(o.body=typeof t.body=="string"?t.body:JSON.stringify(t.body));let a=await fetch(i,o);if(!a.ok){let y=await a.text().catch(()=>"");throw new Error(`Sentry API ${a.status}: ${y.slice(0,300)}`)}return a.json()}async function I(){return p("/projects/?per_page=50")}async function k({query:n="is:unresolved",sort:t="date",project:e,limit:s=25}={}){let r=`/issues/?query=${encodeURIComponent(n)}&sort=${t}&per_page=${s}`;return e&&(r+=`&project=${encodeURIComponent(e)}`),p(r)}async function w(n){if(!n)throw new Error("sentryGetIssue: issueId is required");let{token:t,baseUrl:e}=await c("sentry"),s=await fetch(`${d(e)}/api/0/issues/${n}/`,{headers:{Authorization:`Bearer ${t}`}});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Sentry API ${s.status}: ${r.slice(0,300)}`)}return s.json()}async function b(n,t={}){if(!n)throw new Error("sentryUpdateIssue: issueId is required");let e={};for(let o of["status","statusDetails","assignedTo","isBookmarked","hasSeen"])t[o]!==void 0&&(e[o]=t[o]);if(Object.keys(e).length===0)throw new Error("sentryUpdateIssue: nothing to update (pass status / statusDetails / assignedTo / isBookmarked / hasSeen)");let{token:s,baseUrl:r}=await c("sentry"),i=await fetch(`${d(r)}/api/0/issues/${n}/`,{method:"PUT",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!i.ok){let o=await i.text().catch(()=>"");throw i.status===403?new Error(`Sentry API 403 updating issue ${n}: ${o.slice(0,200)}. The connected Sentry integration likely lacks the \`event:write\` scope \u2014 reconnect Sentry with write access to let Zibby resolve/comment on issues.`):new Error(`Sentry API ${i.status} updating issue ${n}: ${o.slice(0,300)}`)}return i.json()}async function N(n,t){if(!n)throw new Error("sentryAddComment: issueId is required");if(!t||!String(t).trim())throw new Error("sentryAddComment: text is required");let{token:e,baseUrl:s}=await c("sentry"),r=await fetch(`${d(s)}/api/0/issues/${n}/comments/`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({text:String(t)})});if(!r.ok){let i=await r.text().catch(()=>"");throw r.status===403?new Error(`Sentry API 403 commenting on issue ${n}: ${i.slice(0,200)}. The connected Sentry integration likely lacks the \`event:write\` scope \u2014 reconnect Sentry with write access.`):new Error(`Sentry API ${r.status} commenting on issue ${n}: ${i.slice(0,300)}`)}return r.json()}var l={id:"sentry",serverName:"sentry",allowedTools:["mcp__sentry__*"],requiresIntegration:u.SENTRY,description:"Sentry error tracking \u2014 projects, issues, events",envKeys:[],tools:[],promptFragment:`## Sentry (connected)
|
|
2
2
|
You have access to the user's Sentry. Use these tools:
|
|
3
3
|
- sentry_list_projects: List projects in the organization
|
|
4
4
|
- sentry_list_issues: List errors/issues (supports Sentry search query, project filter, sort)
|
|
5
5
|
- sentry_get_issue: Get detailed info about a specific issue (requires issueId)
|
|
6
6
|
- sentry_update_issue: Change an issue's status (resolved / resolvedInNextRelease / ignored / unresolved / muted), assignment, or bookmark (requires issueId; needs write scope)
|
|
7
|
-
- sentry_add_comment: Post a comment/note on an issue (requires issueId + text; needs write scope)`,resolve(){let n=S();if(!n)return null;let t={};for(let e of["PROJECT_API_TOKEN","ZIBBY_USER_TOKEN","ZIBBY_ACCOUNT_API_URL","ZIBBY_ENV","ZIBBY_PROD_ACCOUNT_API_URL","PROGRESS_API_URL","EXECUTION_ID","PROJECT_ID","STAGE","ZIBBY_SELF_HOST","SENTRY_URL","SENTRY_ORG","SENTRY_AUTH_TOKEN"])process.env[e]&&(t[e]=process.env[e]);return{type:"stdio",command:"node",args:[n],env:t,alwaysLoad:!0}},async handleToolCall(n,t={}){try{switch(n){case"sentry_list_projects":{let e=await I();return JSON.stringify({projects:e.map(s=>({slug:s.slug,name:s.name,platform:s.platform}))})}case"sentry_list_issues":{let e=await k({query:t.query,sort:t.sort,project:t.project,limit:t.limit});return JSON.stringify({issues:e.map(s=>({id:s.id,title:s.title,culprit:s.culprit,count:s.count,firstSeen:s.firstSeen,lastSeen:s.lastSeen,level:s.level,status:s.status}))})}case"sentry_get_issue":{let e=await w(t.issueId);return JSON.stringify({id:e.id,title:e.title,culprit:e.culprit,metadata:e.metadata,count:e.count,userCount:e.userCount,firstSeen:e.firstSeen,lastSeen:e.lastSeen,level:e.level,status:e.status,project:{slug:e.project?.slug,name:e.project?.name}})}case"sentry_update_issue":{let e=await b(t.issueId,{status:t.status,statusDetails:t.statusDetails,assignedTo:t.assignedTo,isBookmarked:t.isBookmarked,hasSeen:t.hasSeen});return JSON.stringify({ok:!0,id:e.id??t.issueId,status:e.status,assignedTo:e.assignedTo,isBookmarked:e.isBookmarked})}case"sentry_add_comment":{let e=await N(t.issueId,t.text);return JSON.stringify({ok:!0,id:e.id,issueId:t.issueId})}default:return JSON.stringify({error:`Unknown tool: ${n}`})}}catch(e){return JSON.stringify({error:e.message})}},toolsForAssistant:[{name:"sentry_list_projects",description:"List Sentry projects",input_schema:{type:"object",properties:{}}},{name:"sentry_list_issues",description:"List Sentry issues (errors)",input_schema:{type:"object",properties:{project:{type:"string",description:"Project slug (optional)"},query:{type:"string",description:"Sentry search query (default: is:unresolved)"},sort:{type:"string",description:"Sort order: date, new, priority, freq, user (default: date)"},limit:{type:"number",description:"Max issues to return (default 25)"}}}},{name:"sentry_get_issue",description:"Get details of a specific Sentry issue",input_schema:{type:"object",properties:{issueId:{type:"string",description:"Sentry issue ID"}},required:["issueId"]}},{name:"sentry_update_issue",description:"Update a Sentry issue's status, assignment, or bookmark (needs event:write scope)",input_schema:{type:"object",properties:{issueId:{type:"string",description:"Sentry issue ID"},status:{type:"string",description:"resolved | resolvedInNextRelease | unresolved | ignored | muted"},statusDetails:{type:"object",description:'Optional status details, e.g. { "inRelease": "latest" }'},assignedTo:{type:"string",description:'Assignee actor id, e.g. "user:123" or "team:456" (optional)'},isBookmarked:{type:"boolean",description:"Bookmark/unbookmark the issue (optional)"},hasSeen:{type:"boolean",description:"Mark the issue seen/unseen (optional)"}},required:["issueId"]}},{name:"sentry_add_comment",description:"Post a comment/note on a Sentry issue (needs event:write scope)",input_schema:{type:"object",properties:{issueId:{type:"string",description:"Sentry issue ID"},text:{type:"string",description:"Comment body (markdown)"}},required:["issueId","text"]}}]};
|
|
7
|
+
- sentry_add_comment: Post a comment/note on an issue (requires issueId + text; needs write scope)`,resolve(){let n=S();if(!n)return null;let t={};for(let e of["PROJECT_API_TOKEN","ZIBBY_USER_TOKEN","ZIBBY_ACCOUNT_API_URL","ZIBBY_ENV","ZIBBY_PROD_ACCOUNT_API_URL","PROGRESS_API_URL","EXECUTION_ID","PROJECT_ID","STAGE","ZIBBY_SELF_HOST","SENTRY_URL","SENTRY_ORG","SENTRY_AUTH_TOKEN"])process.env[e]&&(t[e]=process.env[e]);return{type:"stdio",command:"node",args:[n],env:t,alwaysLoad:!0}},async handleToolCall(n,t={}){try{switch(n){case"sentry_list_projects":{let e=await I();return JSON.stringify({projects:e.map(s=>({slug:s.slug,name:s.name,platform:s.platform}))})}case"sentry_list_issues":{let e=await k({query:t.query,sort:t.sort,project:t.project,limit:t.limit});return JSON.stringify({issues:e.map(s=>({id:s.id,title:s.title,culprit:s.culprit,count:s.count,firstSeen:s.firstSeen,lastSeen:s.lastSeen,level:s.level,status:s.status}))})}case"sentry_get_issue":{let e=await w(t.issueId);return JSON.stringify({id:e.id,title:e.title,culprit:e.culprit,metadata:e.metadata,count:e.count,userCount:e.userCount,firstSeen:e.firstSeen,lastSeen:e.lastSeen,level:e.level,status:e.status,project:{slug:e.project?.slug,name:e.project?.name}})}case"sentry_update_issue":{let e=await b(t.issueId,{status:t.status,statusDetails:t.statusDetails,assignedTo:t.assignedTo,isBookmarked:t.isBookmarked,hasSeen:t.hasSeen});return JSON.stringify({ok:!0,id:e.id??t.issueId,status:e.status,assignedTo:e.assignedTo,isBookmarked:e.isBookmarked})}case"sentry_add_comment":{let e=await N(t.issueId,t.text);return JSON.stringify({ok:!0,id:e.id,issueId:t.issueId})}default:return JSON.stringify({error:`Unknown tool: ${n}`})}}catch(e){return JSON.stringify({error:e.message})}},toolsForAssistant:[{name:"sentry_list_projects",description:"List Sentry projects",input_schema:{type:"object",properties:{}}},{name:"sentry_list_issues",description:"List Sentry issues (errors)",input_schema:{type:"object",properties:{project:{type:"string",description:"Project slug (optional)"},query:{type:"string",description:"Sentry search query (default: is:unresolved)"},sort:{type:"string",description:"Sort order: date, new, priority, freq, user (default: date)"},limit:{type:"number",description:"Max issues to return (default 25)"}}}},{name:"sentry_get_issue",description:"Get details of a specific Sentry issue",input_schema:{type:"object",properties:{issueId:{type:"string",description:"Sentry issue ID"}},required:["issueId"]}},{name:"sentry_update_issue",description:"Update a Sentry issue's status, assignment, or bookmark (needs event:write scope)",input_schema:{type:"object",properties:{issueId:{type:"string",description:"Sentry issue ID"},status:{type:"string",description:"resolved | resolvedInNextRelease | unresolved | ignored | muted"},statusDetails:{type:"object",description:'Optional status details, e.g. { "inRelease": "latest" }'},assignedTo:{type:"string",description:'Assignee actor id, e.g. "user:123" or "team:456" (optional)'},isBookmarked:{type:"boolean",description:"Bookmark/unbookmark the issue (optional)"},hasSeen:{type:"boolean",description:"Mark the issue seen/unseen (optional)"}},required:["issueId"]}},{name:"sentry_add_comment",description:"Post a comment/note on a Sentry issue (needs event:write scope)",input_schema:{type:"object",properties:{issueId:{type:"string",description:"Sentry issue ID"},text:{type:"string",description:"Comment body (markdown)"}},required:["issueId","text"]}}]};l.tools=l.toolsForAssistant;export{N as sentryAddComment,p as sentryFetch,w as sentryGetIssue,k as sentryListIssues,I as sentryListProjects,l as sentrySkill,b as sentryUpdateIssue};
|
package/dist/slack.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{existsSync as h}from"fs";import{fileURLToPath as g}from"url";import{dirname as k,resolve as f}from"path";import{resolveIntegrationToken as y}from"@zibby/core/backend-client.js";var _=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),S=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});function b(){if(process.env.MCP_SLACK_PATH)return process.env.MCP_SLACK_PATH;let a=k(g(import.meta.url)),t=f(a,"..","bin","mcp-slack.mjs");return h(t)?t:null}async function n(a,t={}){let{token:e}=await y("slack"),i=["conversations.list","users.list","users.profile.get","users.lookupByEmail","usergroups.list","usergroups.users.list","conversations.history","conversations.replies"].includes(a),c=`https://slack.com/api/${a}`,o={Authorization:`Bearer ${e}`},d;if(i){let s=new URLSearchParams(t).toString();s&&(c+=`?${s}`)}else o["Content-Type"]="application/json; charset=utf-8",d=JSON.stringify(t);let r=await(await fetch(c,{method:i?"GET":"POST",headers:o,body:d})).json();if(!r.ok)throw new Error(`Slack API error: ${r.error}`);return r}var w={id:"slack",serverName:"slack",allowedTools:["mcp__slack__*"],requiresIntegration:_.SLACK,envKeys:["SLACK_BOT_TOKEN","SLACK_TEAM_ID"],description:"Slack MCP Server",promptFragment:`## Slack (connected)
|
|
1
|
+
import{existsSync as h}from"fs";import{fileURLToPath as g}from"url";import{dirname as k,resolve as f}from"path";import{resolveIntegrationToken as y}from"@zibby/core/backend-client.js";var _=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),S=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});function b(){if(process.env.MCP_SLACK_PATH)return process.env.MCP_SLACK_PATH;let a=k(g(import.meta.url)),t=f(a,"..","bin","mcp-slack.mjs");return h(t)?t:null}async function n(a,t={}){let{token:e}=await y("slack"),i=["conversations.list","users.list","users.profile.get","users.lookupByEmail","usergroups.list","usergroups.users.list","conversations.history","conversations.replies"].includes(a),c=`https://slack.com/api/${a}`,o={Authorization:`Bearer ${e}`},d;if(i){let s=new URLSearchParams(t).toString();s&&(c+=`?${s}`)}else o["Content-Type"]="application/json; charset=utf-8",d=JSON.stringify(t);let r=await(await fetch(c,{method:i?"GET":"POST",headers:o,body:d})).json();if(!r.ok)throw new Error(`Slack API error: ${r.error}`);return r}var w={id:"slack",serverName:"slack",allowedTools:["mcp__slack__*"],requiresIntegration:_.SLACK,envKeys:["SLACK_BOT_TOKEN","SLACK_TEAM_ID"],description:"Slack MCP Server",promptFragment:`## Slack (connected)
|
|
2
2
|
You have access to the user's Slack workspace. Use these tools:
|
|
3
3
|
- slack_list_channels, slack_post_message, slack_reply_to_thread
|
|
4
4
|
- slack_add_reaction, slack_get_channel_history, slack_get_thread_replies
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{existsSync as M}from"fs";import{fileURLToPath as D}from"url";import{dirname as B,resolve as F}from"path";import{resolveIntegrationToken as G}from"@zibby/core/backend-client.js";var C=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),Y=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});function z(){if(process.env.MCP_SKILL_PATH)return process.env.MCP_SKILL_PATH;let p=B(D(import.meta.url)),s=F(p,"..","bin","mcp-skill.mjs");return M(s)?s:null}async function l(p,s={}){let{token:t}=await G("github"),r=p.startsWith("https://")?p:`https://api.github.com${p}`,n={Authorization:`Bearer ${t}`,Accept:s.accept||"application/vnd.github.v3+json","User-Agent":"Zibby-App",...s.body?{"Content-Type":"application/json"}:{}},e=await fetch(r,{method:s.method||"GET",headers:n,body:s.body?JSON.stringify(s.body):void 0});if(!e.ok){let i=await e.text().catch(()=>"");throw new Error(`GitHub API ${e.status}: ${i.slice(0,300)}`)}return s.raw?e.text():e.json()}var _={id:"github",serverName:"github",allowedTools:["mcp__github__*"],requiresIntegration:C.GITHUB,envKeys:["GITHUB_TOKEN"],description:"GitHub \u2014 issues, PRs, commits, code search, file reading",promptFragment:`## GitHub (connected)
|
|
1
|
+
import{existsSync as M}from"fs";import{fileURLToPath as D}from"url";import{dirname as B,resolve as F}from"path";import{resolveIntegrationToken as G}from"@zibby/core/backend-client.js";var C=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),Y=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});function z(){if(process.env.MCP_SKILL_PATH)return process.env.MCP_SKILL_PATH;let p=B(D(import.meta.url)),s=F(p,"..","bin","mcp-skill.mjs");return M(s)?s:null}async function l(p,s={}){let{token:t}=await G("github"),r=p.startsWith("https://")?p:`https://api.github.com${p}`,n={Authorization:`Bearer ${t}`,Accept:s.accept||"application/vnd.github.v3+json","User-Agent":"Zibby-App",...s.body?{"Content-Type":"application/json"}:{}},e=await fetch(r,{method:s.method||"GET",headers:n,body:s.body?JSON.stringify(s.body):void 0});if(!e.ok){let i=await e.text().catch(()=>"");throw new Error(`GitHub API ${e.status}: ${i.slice(0,300)}`)}return s.raw?e.text():e.json()}var _={id:"github",serverName:"github",allowedTools:["mcp__github__*"],requiresIntegration:C.GITHUB,envKeys:["GITHUB_TOKEN"],description:"GitHub \u2014 issues, PRs, commits, code search, file reading",promptFragment:`## GitHub (connected)
|
|
2
2
|
You have access to the user's GitHub repositories. Available tools:
|
|
3
3
|
|
|
4
4
|
### Discovery
|
package/dist/trackers/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as ke}from"module";import{resolveIntegrationToken as Ae,clearTokenCache as Re}from"@zibby/core/backend-client.js";var E=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),lt=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});var Ie=ke(import.meta.url);function ve(){if(process.env.MCP_JIRA_PATH)return process.env.MCP_JIRA_PATH;try{return Ie.resolve("@zibby/mcp-jira/index.js")}catch{return null}}var Ne=new Set(["paragraph","heading","bulletList","orderedList","listItem","blockquote","codeBlock","rule","table","tableRow","tableCell","tableHeader","mediaSingle","panel"]);function Oe(r,s){if(!s||!s.length)return r;let e=r;for(let t of s)t.type==="strong"?e=`**${e}**`:t.type==="em"?e=`_${e}_`:t.type==="code"?e=`\`${e}\``:t.type==="strike"?e=`~~${e}~~`:t.type==="link"&&t.attrs?.href&&(e=`[${e}](${t.attrs.href})`);return e}function K(r,s=0){if(!Array.isArray(r))return"";let e=[];for(let t of r){if(t.type==="text"){e.push(Oe(t.text||"",t.marks));continue}if(t.type==="hardBreak"){e.push(`
|
|
1
|
+
import{createRequire as ke}from"module";import{resolveIntegrationToken as Ae,clearTokenCache as Re}from"@zibby/core/backend-client.js";var E=Object.freeze({SENTRY:"sentry",JIRA:"jira",GITHUB:"github",GITLAB:"gitlab",SLACK:"slack",LARK:"lark",OPENAI_BILLING:"openai_billing",ANTHROPIC_BILLING:"anthropic_billing",CURSOR_ADMIN:"cursor_admin",NOTION:"notion",GOOGLE:"google",PLANE:"plane",LINEAR:"linear",FIGMA:"figma",OPEN_DESIGN:"open_design",LINKEDIN_PERSONAL:"linkedin_personal",LINKEDIN_BUSINESS:"linkedin_business"}),lt=Object.freeze({sentry:{id:"sentry",name:"Sentry",connectPath:"/integrations?provider=sentry"},jira:{id:"jira",name:"Jira",connectPath:"/integrations?provider=jira"},github:{id:"github",name:"GitHub",connectPath:"/integrations?provider=github"},gitlab:{id:"gitlab",name:"GitLab",connectPath:"/integrations?provider=gitlab"},slack:{id:"slack",name:"Slack",connectPath:"/integrations?provider=slack"},lark:{id:"lark",name:"Lark",connectPath:"/integrations?provider=lark"},openai_billing:{id:"openai_billing",name:"OpenAI Admin",connectPath:"/integrations?provider=openai_billing"},anthropic_billing:{id:"anthropic_billing",name:"Anthropic Admin",connectPath:"/integrations?provider=anthropic_billing"},cursor_admin:{id:"cursor_admin",name:"Cursor Admin",connectPath:"/integrations?provider=cursor_admin"},notion:{id:"notion",name:"Notion",connectPath:"/integrations?provider=notion"},google:{id:"google",name:"Google Docs",connectPath:"/integrations?provider=google"},plane:{id:"plane",name:"Plane",connectPath:"/integrations?provider=plane"},linear:{id:"linear",name:"Linear",connectPath:"/integrations?provider=linear"},figma:{id:"figma",name:"Figma",connectPath:"/integrations?provider=figma"},open_design:{id:"open_design",name:"OpenDesign",connectPath:"/integrations?provider=open_design"},linkedin_personal:{id:"linkedin_personal",name:"LinkedIn (Personal)",connectPath:"/integrations?provider=linkedin_personal"},linkedin_business:{id:"linkedin_business",name:"LinkedIn (Business)",connectPath:"/integrations?provider=linkedin_business"}});var Ie=ke(import.meta.url);function ve(){if(process.env.MCP_JIRA_PATH)return process.env.MCP_JIRA_PATH;try{return Ie.resolve("@zibby/mcp-jira/index.js")}catch{return null}}var Ne=new Set(["paragraph","heading","bulletList","orderedList","listItem","blockquote","codeBlock","rule","table","tableRow","tableCell","tableHeader","mediaSingle","panel"]);function Oe(r,s){if(!s||!s.length)return r;let e=r;for(let t of s)t.type==="strong"?e=`**${e}**`:t.type==="em"?e=`_${e}_`:t.type==="code"?e=`\`${e}\``:t.type==="strike"?e=`~~${e}~~`:t.type==="link"&&t.attrs?.href&&(e=`[${e}](${t.attrs.href})`);return e}function K(r,s=0){if(!Array.isArray(r))return"";let e=[];for(let t of r){if(t.type==="text"){e.push(Oe(t.text||"",t.marks));continue}if(t.type==="hardBreak"){e.push(`
|
|
2
2
|
`);continue}if(t.type==="rule"){e.push(`
|
|
3
3
|
---
|
|
4
4
|
`);continue}let n=t.content?K(t.content,s+1):"";if(t.type==="listItem")e.push(n);else if(t.type==="bulletList"){let i=(t.content||[]).map(o=>`- ${K(o.content||[],s+1).trim()}`);e.push(`
|