@zibby/skills 0.1.22 → 0.1.23
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/index.js +2 -2
- package/dist/lark.js +1 -1
- package/dist/package.json +1 -1
- package/dist/sentry.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -114,7 +114,7 @@ You can send messages and replies on Lark. Use:
|
|
|
114
114
|
- lark_reply: reply to an existing message (threaded)
|
|
115
115
|
- lark_list_chats: list chats the bot is a member of
|
|
116
116
|
- lark_get_chat_history: fetch recent messages in a chat
|
|
117
|
-
When responding to an incoming event, prefer lark_reply with the source message_id so the response threads cleanly.`,resolve(){let r=ks();if(!r)return null;let t={};for(let e of["PROJECT_API_TOKEN","PROGRESS_API_URL","EXECUTION_ID","PROJECT_ID","STAGE"])process.env[e]&&(t[e]=process.env[e]);return{command:"node",args:[r],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(r,t){try{switch(r){case"lark_send_message":{if(!t.receive_id||!t.text)return JSON.stringify({error:"receive_id and text are required"});let e=Ss(t.receive_id),s=await se("POST",`/open-apis/im/v1/messages?receive_id_type=${e}`,{receive_id:t.receive_id,msg_type:"text",content:qe(t.text)});return JSON.stringify({ok:!0,message_id:s.message_id})}case"lark_reply":{if(!t.message_id||!t.text)return JSON.stringify({error:"message_id and text are required"});let e=await se("POST",`/open-apis/im/v1/messages/${encodeURIComponent(t.message_id)}/reply`,{msg_type:"text",content:qe(t.text)});return JSON.stringify({ok:!0,message_id:e.message_id})}case"lark_list_chats":{let e=t.page_size||50,n=((await se("GET",`/open-apis/im/v1/chats?page_size=${e}`)).items||[]).map(i=>({chat_id:i.chat_id,name:i.name,description:i.description,owner_id:i.owner_id,chat_mode:i.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 e=t.page_size||20,n=((await se("GET",`/open-apis/im/v1/messages?container_id_type=chat&container_id=${encodeURIComponent(t.chat_id)}&page_size=${e}&sort_type=ByCreateTimeDesc`)).items||[]).map(i=>({message_id:i.message_id,sender_id:i.sender?.id,sender_type:i.sender?.sender_type,msg_type:i.msg_type,content:i.body?.content,create_time:i.create_time}));return JSON.stringify({messages:n})}default:return JSON.stringify({error:`Unknown tool: ${r}`})}}catch(e){return JSON.stringify({error:e.message})}}};import{createRequire as vs}from"module";import{execFileSync as Ns}from"child_process";import{join as Ke}from"path";import{existsSync as Os}from"fs";var Rs=vs(import.meta.url);function $s(){if(process.env.MCP_MEMORY_PATH)return process.env.MCP_MEMORY_PATH;try{return Rs.resolve("@zibby/ui-memory/mcp-server")}catch{return null}}var Be={id:"memory",serverName:"memory",allowedTools:["mcp__memory__*"],envKeys:[],description:"Zibby Memory MCP Server (test history, selectors, page model)",async middleware(){try{let{createMemoryMiddleware:r}=await import("@zibby/ui-memory");return r()}catch{return null}},promptFragment:`BEFORE executing browser actions:
|
|
117
|
+
When responding to an incoming event, prefer lark_reply with the source message_id so the response threads cleanly.`,resolve(){let r=ks();if(!r)return null;let t={};for(let e of["PROJECT_API_TOKEN","PROGRESS_API_URL","EXECUTION_ID","PROJECT_ID","STAGE"])process.env[e]&&(t[e]=process.env[e]);return{type:"stdio",command:"node",args:[r],env:t,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"]}}],async handleToolCall(r,t){try{switch(r){case"lark_send_message":{if(!t.receive_id||!t.text)return JSON.stringify({error:"receive_id and text are required"});let e=Ss(t.receive_id),s=await se("POST",`/open-apis/im/v1/messages?receive_id_type=${e}`,{receive_id:t.receive_id,msg_type:"text",content:qe(t.text)});return JSON.stringify({ok:!0,message_id:s.message_id})}case"lark_reply":{if(!t.message_id||!t.text)return JSON.stringify({error:"message_id and text are required"});let e=await se("POST",`/open-apis/im/v1/messages/${encodeURIComponent(t.message_id)}/reply`,{msg_type:"text",content:qe(t.text)});return JSON.stringify({ok:!0,message_id:e.message_id})}case"lark_list_chats":{let e=t.page_size||50,n=((await se("GET",`/open-apis/im/v1/chats?page_size=${e}`)).items||[]).map(i=>({chat_id:i.chat_id,name:i.name,description:i.description,owner_id:i.owner_id,chat_mode:i.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 e=t.page_size||20,n=((await se("GET",`/open-apis/im/v1/messages?container_id_type=chat&container_id=${encodeURIComponent(t.chat_id)}&page_size=${e}&sort_type=ByCreateTimeDesc`)).items||[]).map(i=>({message_id:i.message_id,sender_id:i.sender?.id,sender_type:i.sender?.sender_type,msg_type:i.msg_type,content:i.body?.content,create_time:i.create_time}));return JSON.stringify({messages:n})}default:return JSON.stringify({error:`Unknown tool: ${r}`})}}catch(e){return JSON.stringify({error:e.message})}}};import{createRequire as vs}from"module";import{execFileSync as Ns}from"child_process";import{join as Ke}from"path";import{existsSync as Os}from"fs";var Rs=vs(import.meta.url);function $s(){if(process.env.MCP_MEMORY_PATH)return process.env.MCP_MEMORY_PATH;try{return Rs.resolve("@zibby/ui-memory/mcp-server")}catch{return null}}var Be={id:"memory",serverName:"memory",allowedTools:["mcp__memory__*"],envKeys:[],description:"Zibby Memory MCP Server (test history, selectors, page model)",async middleware(){try{let{createMemoryMiddleware:r}=await import("@zibby/ui-memory");return r()}catch{return null}},promptFragment:`BEFORE executing browser actions:
|
|
118
118
|
- Review any test memory/history above. Prefer selectors proven to work.
|
|
119
119
|
- If a previous run failed, avoid the same approach.
|
|
120
120
|
- After setup/login completes, navigate directly to the target page instead of clicking through menus.
|
|
@@ -155,7 +155,7 @@ AFTER completing the test, you MUST call memory_save_insight at least once:
|
|
|
155
155
|
You have access to the user's Sentry. Use these tools:
|
|
156
156
|
- sentry_list_projects: List projects in the organization
|
|
157
157
|
- sentry_list_issues: List errors/issues (supports Sentry search query, project filter, sort)
|
|
158
|
-
- sentry_get_issue: Get detailed info about a specific issue (requires issueId)`,resolve(){let r=Xs();if(!r)return null;let t={};for(let e of["PROJECT_API_TOKEN","PROGRESS_API_URL","EXECUTION_ID","PROJECT_ID","STAGE"])process.env[e]&&(t[e]=process.env[e]);return{command:"node",args:[r],env:t}},async handleToolCall(r,t={}){try{switch(r){case"sentry_list_projects":{let e=await Ve("/projects/?per_page=50");return JSON.stringify({projects:e.map(s=>({slug:s.slug,name:s.name,platform:s.platform}))})}case"sentry_list_issues":{let e=t.project||"",s=t.query||"is:unresolved",n=t.sort||"date",i=`/issues/?query=${encodeURIComponent(s)}&sort=${n}&per_page=${t.limit||25}`;e&&(i+=`&project=${encodeURIComponent(e)}`);let o=await Ve(i);return JSON.stringify({issues:o.map(a=>({id:a.id,title:a.title,culprit:a.culprit,count:a.count,firstSeen:a.firstSeen,lastSeen:a.lastSeen,level:a.level,status:a.status}))})}case"sentry_get_issue":{let{issueId:e}=t;if(!e)return JSON.stringify({error:"issueId is required"});let{token:s}=await Qe("sentry"),n=await fetch(`https://sentry.io/api/0/issues/${e}/`,{headers:{Authorization:`Bearer ${s}`}});if(!n.ok)throw new Error(`Sentry API ${n.status}`);let i=await n.json();return JSON.stringify({id:i.id,title:i.title,culprit:i.culprit,metadata:i.metadata,count:i.count,userCount:i.userCount,firstSeen:i.firstSeen,lastSeen:i.lastSeen,level:i.level,status:i.status,project:{slug:i.project?.slug,name:i.project?.name}})}default:return JSON.stringify({error:`Unknown tool: ${r}`})}}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"]}}]};ne.tools=ne.toolsForAssistant;import{spawn as ct}from"child_process";import{writeFileSync as er,mkdirSync as Xe,existsSync as L,readdirSync as ce,readFileSync as ae,unlinkSync as tr,createWriteStream as sr,statSync as rr}from"fs";import{resolve as F,join as x}from"path";import{resolveMaxParallelRuns as lt}from"@zibby/core/utils/parallel-config.js";import{zibbyScratchSpecsDir as nr}from"@zibby/core/constants/zibby-scratch.js";var be="sessions",Se=".zibby/output",ie=process.env.ZIBBY_RUNNER_NODE_PROGRESS==="1",ir=process.env.ZIBBY_RUNNER_STATUS_STREAM==="1",ut=process.env.ZIBBY_RUNNER_SPAWN_LOGS==="1",A=new Map,U=[],or=0,ke=0,et=3e3;function pt(){return`run_${++or}_${Date.now().toString(36)}`}function tt(r){let t=Math.floor(r/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function dt(r){return r.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"")}function j(r,t,e){if(!ir)return;let s=`
|
|
158
|
+
- sentry_get_issue: Get detailed info about a specific issue (requires issueId)`,resolve(){let r=Xs();if(!r)return null;let t={};for(let e of["PROJECT_API_TOKEN","PROGRESS_API_URL","EXECUTION_ID","PROJECT_ID","STAGE"])process.env[e]&&(t[e]=process.env[e]);return{type:"stdio",command:"node",args:[r],env:t,alwaysLoad:!0}},async handleToolCall(r,t={}){try{switch(r){case"sentry_list_projects":{let e=await Ve("/projects/?per_page=50");return JSON.stringify({projects:e.map(s=>({slug:s.slug,name:s.name,platform:s.platform}))})}case"sentry_list_issues":{let e=t.project||"",s=t.query||"is:unresolved",n=t.sort||"date",i=`/issues/?query=${encodeURIComponent(s)}&sort=${n}&per_page=${t.limit||25}`;e&&(i+=`&project=${encodeURIComponent(e)}`);let o=await Ve(i);return JSON.stringify({issues:o.map(a=>({id:a.id,title:a.title,culprit:a.culprit,count:a.count,firstSeen:a.firstSeen,lastSeen:a.lastSeen,level:a.level,status:a.status}))})}case"sentry_get_issue":{let{issueId:e}=t;if(!e)return JSON.stringify({error:"issueId is required"});let{token:s}=await Qe("sentry"),n=await fetch(`https://sentry.io/api/0/issues/${e}/`,{headers:{Authorization:`Bearer ${s}`}});if(!n.ok)throw new Error(`Sentry API ${n.status}`);let i=await n.json();return JSON.stringify({id:i.id,title:i.title,culprit:i.culprit,metadata:i.metadata,count:i.count,userCount:i.userCount,firstSeen:i.firstSeen,lastSeen:i.lastSeen,level:i.level,status:i.status,project:{slug:i.project?.slug,name:i.project?.name}})}default:return JSON.stringify({error:`Unknown tool: ${r}`})}}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"]}}]};ne.tools=ne.toolsForAssistant;import{spawn as ct}from"child_process";import{writeFileSync as er,mkdirSync as Xe,existsSync as L,readdirSync as ce,readFileSync as ae,unlinkSync as tr,createWriteStream as sr,statSync as rr}from"fs";import{resolve as F,join as x}from"path";import{resolveMaxParallelRuns as lt}from"@zibby/core/utils/parallel-config.js";import{zibbyScratchSpecsDir as nr}from"@zibby/core/constants/zibby-scratch.js";var be="sessions",Se=".zibby/output",ie=process.env.ZIBBY_RUNNER_NODE_PROGRESS==="1",ir=process.env.ZIBBY_RUNNER_STATUS_STREAM==="1",ut=process.env.ZIBBY_RUNNER_SPAWN_LOGS==="1",A=new Map,U=[],or=0,ke=0,et=3e3;function pt(){return`run_${++or}_${Date.now().toString(36)}`}function tt(r){let t=Math.floor(r/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function dt(r){return r.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"")}function j(r,t,e){if(!ir)return;let s=`
|
|
159
159
|
${t} [${r}] ${e}
|
|
160
160
|
`;try{process.stderr.write(s)}catch{}}function ve(){U.length=0;for(let[,r]of A)if(r.status==="queued"&&(r.status="cancelled"),r.status==="running"&&r._child)try{r._child.kill("SIGTERM")}catch{}}process.on("exit",ve);process.on("SIGINT",()=>{ve(),process.exit(0)});process.on("SIGTERM",()=>{ve(),process.exit(0)});var mt={id:"runner",description:"Run zibby test workflows from chat (parallel supported)",envKeys:[],promptFragment:`## Test Runner
|
|
161
161
|
You can run zibby test workflows directly from chat:
|
package/dist/lark.js
CHANGED
|
@@ -4,4 +4,4 @@ You can send messages and replies on Lark. Use:
|
|
|
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.`,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};
|
|
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{type:"stdio",command:"node",args:[e],env:t,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"]}}],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
package/dist/sentry.js
CHANGED
|
@@ -2,4 +2,4 @@ import{createRequire as l}from"module";import{resolveIntegrationToken as p}from"
|
|
|
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)`,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};
|
|
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{type:"stdio",command:"node",args:[o],env:s,alwaysLoad:!0}},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};
|