@zibby/skills 0.1.20 → 0.1.22
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/bin/mcp-lark.mjs +209 -0
- package/bin/mcp-sentry.mjs +151 -0
- package/dist/index.js +56 -56
- package/dist/lark.js +2 -2
- package/dist/package.json +7 -2
- package/dist/sentry.js +2 -2
- package/package.json +7 -2
package/dist/lark.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createRequire as p}from"module";import{resolveIntegrationToken as m}from"@zibby/core/backend-client.js";var l=p(import.meta.url);function u(){if(process.env.MCP_LARK_PATH)return process.env.MCP_LARK_PATH;try{return l.resolve("@zibby/skills/bin/mcp-lark.mjs")}catch{return null}}var h=6e3*1e3,a=null;async function g(){let{appId:e,appSecret:t,host:r}=await m("lark");if(a&&a.appId===e&&a.expiresAt>Date.now())return{token:a.token,host:r};let n=await(await fetch(`${r}/open-apis/auth/v3/tenant_access_token/internal`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_id:e,app_secret:t})})).json();if(n.code!==0)throw new Error(`Lark tenant_access_token failed: ${n.msg||n.code}`);return a={token:n.tenant_access_token,expiresAt:Date.now()+h,appId:e},{token:n.tenant_access_token,host:r}}async function c(e,t,r={}){let{token:i,host:n}=await g(),s=`${n}${t}`,_={method:e,headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json; charset=utf-8"}};e!=="GET"&&(_.body=JSON.stringify(r));let o=await(await fetch(s,_)).json();if(o.code!==0)throw new Error(`Lark API ${t} error: ${o.msg||o.code}`);return o.data||{}}function d(e){return JSON.stringify({text:e})}function y(e){return!e||typeof e!="string"||e.startsWith("oc_")?"chat_id":e.startsWith("ou_")?"open_id":e.startsWith("on_")?"union_id":e.startsWith("cli_")?"app_id":e.includes("@")?"email":"chat_id"}var T={id:"lark",serverName:"lark",allowedTools:["mcp__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
|
-
When responding to an incoming event, prefer lark_reply with the source message_id so the response threads cleanly.`,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"]}}],async handleToolCall(e,t){try{switch(e){case"lark_send_message":{if(!t.receive_id||!t.text)return JSON.stringify({error:"receive_id and text are required"});let
|
|
7
|
+
When responding to an incoming event, prefer lark_reply with the source message_id so the response threads cleanly.`,resolve(){let e=u();if(!e)return null;let t={};for(let r of["PROJECT_API_TOKEN","PROGRESS_API_URL","EXECUTION_ID","PROJECT_ID","STAGE"])process.env[r]&&(t[r]=process.env[r]);return{command:"node",args:[e],env:t}},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"]}}],async handleToolCall(e,t){try{switch(e){case"lark_send_message":{if(!t.receive_id||!t.text)return JSON.stringify({error:"receive_id and text are required"});let r=y(t.receive_id),i=await c("POST",`/open-apis/im/v1/messages?receive_id_type=${r}`,{receive_id:t.receive_id,msg_type:"text",content:d(t.text)});return JSON.stringify({ok:!0,message_id:i.message_id})}case"lark_reply":{if(!t.message_id||!t.text)return JSON.stringify({error:"message_id and text are required"});let r=await c("POST",`/open-apis/im/v1/messages/${encodeURIComponent(t.message_id)}/reply`,{msg_type:"text",content:d(t.text)});return JSON.stringify({ok:!0,message_id:r.message_id})}case"lark_list_chats":{let r=t.page_size||50,n=((await c("GET",`/open-apis/im/v1/chats?page_size=${r}`)).items||[]).map(s=>({chat_id:s.chat_id,name:s.name,description:s.description,owner_id:s.owner_id,chat_mode:s.chat_mode}));return JSON.stringify({chats:n})}case"lark_get_chat_history":{if(!t.chat_id)return JSON.stringify({error:"chat_id is required"});let r=t.page_size||20,n=((await c("GET",`/open-apis/im/v1/messages?container_id_type=chat&container_id=${encodeURIComponent(t.chat_id)}&page_size=${r}&sort_type=ByCreateTimeDesc`)).items||[]).map(s=>({message_id:s.message_id,sender_id:s.sender?.id,sender_type:s.sender?.sender_type,msg_type:s.msg_type,content:s.body?.content,create_time:s.create_time}));return JSON.stringify({messages:n})}default:return JSON.stringify({error:`Unknown tool: ${e}`})}}catch(r){return JSON.stringify({error:r.message})}}};function x(){a=null}export{x as _resetLarkTokenCache,T as larkSkill};
|
package/dist/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zibby/skills",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Built-in skill definitions for Zibby test automation framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|
|
9
|
+
"./bin/mcp-sentry.mjs": "./bin/mcp-sentry.mjs",
|
|
10
|
+
"./bin/mcp-lark.mjs": "./bin/mcp-lark.mjs",
|
|
9
11
|
"./browser": "./dist/browser.js",
|
|
10
12
|
"./jira": "./dist/jira.js",
|
|
11
13
|
"./github": "./dist/github.js",
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
},
|
|
40
42
|
"files": [
|
|
41
43
|
"dist/",
|
|
44
|
+
"bin/",
|
|
42
45
|
"docs/",
|
|
43
46
|
"README.md",
|
|
44
47
|
"LICENSE"
|
|
@@ -47,7 +50,9 @@
|
|
|
47
50
|
"node": ">=18.0.0"
|
|
48
51
|
},
|
|
49
52
|
"dependencies": {
|
|
50
|
-
"@zibby/agent-workflow": "^0.3.0"
|
|
53
|
+
"@zibby/agent-workflow": "^0.3.0",
|
|
54
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
55
|
+
"zod": "^3.23.0 || ^4.0.0"
|
|
51
56
|
},
|
|
52
57
|
"peerDependencies": {
|
|
53
58
|
"@zibby/core": ">=0.1.44"
|
package/dist/sentry.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as l}from"module";import{
|
|
1
|
+
import{createRequire as l}from"module";import{resolveIntegrationToken as p}from"@zibby/core/backend-client.js";var y=l(import.meta.url);function d(){if(process.env.MCP_SENTRY_PATH)return process.env.MCP_SENTRY_PATH;try{return y.resolve("@zibby/skills/bin/mcp-sentry.mjs")}catch{return null}}async function c(o,s={}){let{token:t,organizationSlug:r}=await p("sentry"),i=`https://sentry.io/api/0/organizations/${r}${o}`,e=await fetch(i,{method:s.method||"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!e.ok){let a=await e.text().catch(()=>"");throw new Error(`Sentry API ${e.status}: ${a.slice(0,300)}`)}return e.json()}var u={id:"sentry",serverName:"sentry",allowedTools:["mcp__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
|
-
- sentry_get_issue: Get detailed info about a specific issue (requires issueId)`,
|
|
5
|
+
- sentry_get_issue: Get detailed info about a specific issue (requires issueId)`,resolve(){let o=d();if(!o)return null;let s={};for(let t of["PROJECT_API_TOKEN","PROGRESS_API_URL","EXECUTION_ID","PROJECT_ID","STAGE"])process.env[t]&&(s[t]=process.env[t]);return{command:"node",args:[o],env:s}},async handleToolCall(o,s={}){try{switch(o){case"sentry_list_projects":{let t=await c("/projects/?per_page=50");return JSON.stringify({projects:t.map(r=>({slug:r.slug,name:r.name,platform:r.platform}))})}case"sentry_list_issues":{let t=s.project||"",r=s.query||"is:unresolved",i=s.sort||"date",e=`/issues/?query=${encodeURIComponent(r)}&sort=${i}&per_page=${s.limit||25}`;t&&(e+=`&project=${encodeURIComponent(t)}`);let a=await c(e);return JSON.stringify({issues:a.map(n=>({id:n.id,title:n.title,culprit:n.culprit,count:n.count,firstSeen:n.firstSeen,lastSeen:n.lastSeen,level:n.level,status:n.status}))})}case"sentry_get_issue":{let{issueId:t}=s;if(!t)return JSON.stringify({error:"issueId is required"});let{token:r}=await p("sentry"),i=await fetch(`https://sentry.io/api/0/issues/${t}/`,{headers:{Authorization:`Bearer ${r}`}});if(!i.ok)throw new Error(`Sentry API ${i.status}`);let e=await i.json();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}})}default:return JSON.stringify({error:`Unknown tool: ${o}`})}}catch(t){return JSON.stringify({error:t.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"]}}]};u.tools=u.toolsForAssistant;export{u as sentrySkill};
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zibby/skills",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Built-in skill definitions for Zibby test automation framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|
|
9
|
+
"./bin/mcp-sentry.mjs": "./bin/mcp-sentry.mjs",
|
|
10
|
+
"./bin/mcp-lark.mjs": "./bin/mcp-lark.mjs",
|
|
9
11
|
"./browser": "./dist/browser.js",
|
|
10
12
|
"./jira": "./dist/jira.js",
|
|
11
13
|
"./github": "./dist/github.js",
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
},
|
|
40
42
|
"files": [
|
|
41
43
|
"dist/",
|
|
44
|
+
"bin/",
|
|
42
45
|
"docs/",
|
|
43
46
|
"README.md",
|
|
44
47
|
"LICENSE"
|
|
@@ -47,7 +50,9 @@
|
|
|
47
50
|
"node": ">=18.0.0"
|
|
48
51
|
},
|
|
49
52
|
"dependencies": {
|
|
50
|
-
"@zibby/agent-workflow": "^0.3.0"
|
|
53
|
+
"@zibby/agent-workflow": "^0.3.0",
|
|
54
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
55
|
+
"zod": "^3.23.0 || ^4.0.0"
|
|
51
56
|
},
|
|
52
57
|
"peerDependencies": {
|
|
53
58
|
"@zibby/core": ">=0.1.44"
|