@zibby/skills 0.1.49 → 0.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zibby/skills",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "description": "Built-in skill definitions for the Zibby agent-workflow framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/dist/sentry.d.ts CHANGED
@@ -37,6 +37,45 @@ export function sentryListIssues({ query, sort, project, limit }?: {
37
37
  * integration's token.
38
38
  */
39
39
  export function sentryGetIssue(issueId: any): Promise<any>;
40
+ /**
41
+ * WRITE-back to a Sentry issue. Mutates issue STATE (resolve / ignore / mute /
42
+ * reopen), assignment, bookmark, or seen-flag via the global
43
+ * `PUT /issues/<id>/` endpoint (NOT org-scoped — issues route by id, same as
44
+ * sentryGetIssue). Only the fields you pass are sent.
45
+ *
46
+ * Common uses:
47
+ * sentryUpdateIssue(id, { status: 'resolvedInNextRelease' }) // leaves the
48
+ * is:unresolved queue, regresses only if it recurs in a LATER release
49
+ * sentryUpdateIssue(id, { status: 'resolved', statusDetails: { inRelease: 'latest' } })
50
+ * sentryUpdateIssue(id, { status: 'ignored' })
51
+ * sentryUpdateIssue(id, { assignedTo: 'user:123' })
52
+ *
53
+ * @param {string} issueId
54
+ * @param {{ status?: 'resolved'|'resolvedInNextRelease'|'unresolved'|'ignored'|'muted',
55
+ * statusDetails?: object, assignedTo?: string, isBookmarked?: boolean,
56
+ * hasSeen?: boolean }} update
57
+ *
58
+ * Requires the connected Sentry integration's token to carry the `event:write`
59
+ * scope. A 403 → a CLEAR error telling the operator the Sentry connection likely
60
+ * lacks write scope and must be reconnected with it.
61
+ */
62
+ export function sentryUpdateIssue(issueId: string, update?: {
63
+ status?: "resolved" | "resolvedInNextRelease" | "unresolved" | "ignored" | "muted";
64
+ statusDetails?: object;
65
+ assignedTo?: string;
66
+ isBookmarked?: boolean;
67
+ hasSeen?: boolean;
68
+ }): Promise<any>;
69
+ /**
70
+ * Post a comment ("note") on a Sentry issue via
71
+ * `POST /issues/<id>/comments/`. Same global-issue endpoint + token as
72
+ * sentryGetIssue / sentryUpdateIssue, and the same `event:write`-scope 403 →
73
+ * clear-error contract.
74
+ *
75
+ * @param {string} issueId
76
+ * @param {string} text the comment body (Sentry markdown)
77
+ */
78
+ export function sentryAddComment(issueId: string, text: string): Promise<any>;
40
79
  export namespace sentrySkill {
41
80
  import tools = sentrySkill.toolsForAssistant;
42
81
  export { tools };
package/dist/sentry.js CHANGED
@@ -1,5 +1,7 @@
1
- import{existsSync as u}from"fs";import{fileURLToPath as d}from"url";import{dirname as m,resolve as y}from"path";import{resolveIntegrationToken as c}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"}),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"}});function _(){if(process.env.MCP_SENTRY_PATH)return process.env.MCP_SENTRY_PATH;let r=m(d(import.meta.url)),n=y(r,"..","bin","mcp-sentry.mjs");return u(n)?n:null}async function p(r,n={}){let{token:e,organizationSlug:t}=await c("sentry"),i=`https://sentry.io/api/0/organizations/${t}${r}`,s=await fetch(i,{method:n.method||"GET",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!s.ok){let l=await s.text().catch(()=>"");throw new Error(`Sentry API ${s.status}: ${l.slice(0,300)}`)}return s.json()}async function g(){return p("/projects/?per_page=50")}async function h({query:r="is:unresolved",sort:n="date",project:e,limit:t=25}={}){let i=`/issues/?query=${encodeURIComponent(r)}&sort=${n}&per_page=${t}`;return e&&(i+=`&project=${encodeURIComponent(e)}`),p(i)}async function f(r){if(!r)throw new Error("sentryGetIssue: issueId is required");let{token:n}=await c("sentry"),e=await fetch(`https://sentry.io/api/0/issues/${r}/`,{headers:{Authorization:`Bearer ${n}`}});if(!e.ok){let t=await e.text().catch(()=>"");throw new Error(`Sentry API ${e.status}: ${t.slice(0,300)}`)}return e.json()}var a={id:"sentry",serverName:"sentry",allowedTools:["mcp__sentry__*"],requiresIntegration:o.SENTRY,description:"Sentry error tracking \u2014 projects, issues, events",envKeys:[],tools:[],promptFragment:`## Sentry (connected)
1
+ import{existsSync as l}from"fs";import{fileURLToPath as y}from"url";import{dirname as m,resolve as h}from"path";import{resolveIntegrationToken as a}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"}),w=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"}});function g(){if(process.env.MCP_SENTRY_PATH)return process.env.MCP_SENTRY_PATH;let n=m(y(import.meta.url)),t=h(n,"..","bin","mcp-sentry.mjs");return l(t)?t:null}async function u(n,t={}){let{token:e,organizationSlug:s}=await a("sentry"),r=`https://sentry.io/api/0/organizations/${s}${n}`,i={method:t.method||"GET",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}};t.body!=null&&(i.body=typeof t.body=="string"?t.body:JSON.stringify(t.body));let o=await fetch(r,i);if(!o.ok){let p=await o.text().catch(()=>"");throw new Error(`Sentry API ${o.status}: ${p.slice(0,300)}`)}return o.json()}async function _(){return u("/projects/?per_page=50")}async function f({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)}`),u(r)}async function S(n){if(!n)throw new Error("sentryGetIssue: issueId is required");let{token:t}=await a("sentry"),e=await fetch(`https://sentry.io/api/0/issues/${n}/`,{headers:{Authorization:`Bearer ${t}`}});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Sentry API ${e.status}: ${s.slice(0,300)}`)}return e.json()}async function I(n,t={}){if(!n)throw new Error("sentryUpdateIssue: issueId is required");let e={};for(let i of["status","statusDetails","assignedTo","isBookmarked","hasSeen"])t[i]!==void 0&&(e[i]=t[i]);if(Object.keys(e).length===0)throw new Error("sentryUpdateIssue: nothing to update (pass status / statusDetails / assignedTo / isBookmarked / hasSeen)");let{token:s}=await a("sentry"),r=await fetch(`https://sentry.io/api/0/issues/${n}/`,{method:"PUT",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){let i=await r.text().catch(()=>"");throw r.status===403?new Error(`Sentry API 403 updating issue ${n}: ${i.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 ${r.status} updating issue ${n}: ${i.slice(0,300)}`)}return r.json()}async function k(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}=await a("sentry"),s=await fetch(`https://sentry.io/api/0/issues/${n}/comments/`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({text:String(t)})});if(!s.ok){let r=await s.text().catch(()=>"");throw s.status===403?new Error(`Sentry API 403 commenting on issue ${n}: ${r.slice(0,200)}. The connected Sentry integration likely lacks the \`event:write\` scope \u2014 reconnect Sentry with write access.`):new Error(`Sentry API ${s.status} commenting on issue ${n}: ${r.slice(0,300)}`)}return s.json()}var d={id:"sentry",serverName:"sentry",allowedTools:["mcp__sentry__*"],requiresIntegration:c.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)`,resolve(){let r=_();if(!r)return null;let n={};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"])process.env[e]&&(n[e]=process.env[e]);return{type:"stdio",command:"node",args:[r],env:n,alwaysLoad:!0}},async handleToolCall(r,n={}){try{switch(r){case"sentry_list_projects":{let e=await g();return JSON.stringify({projects:e.map(t=>({slug:t.slug,name:t.name,platform:t.platform}))})}case"sentry_list_issues":{let e=await h({query:n.query,sort:n.sort,project:n.project,limit:n.limit});return JSON.stringify({issues:e.map(t=>({id:t.id,title:t.title,culprit:t.culprit,count:t.count,firstSeen:t.firstSeen,lastSeen:t.lastSeen,level:t.level,status:t.status}))})}case"sentry_get_issue":{let e=await f(n.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}})}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"]}}]};a.tools=a.toolsForAssistant;export{p as sentryFetch,f as sentryGetIssue,h as sentryListIssues,g as sentryListProjects,a as sentrySkill};
5
+ - sentry_get_issue: Get detailed info about a specific issue (requires issueId)
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=g();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"])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 _();return JSON.stringify({projects:e.map(s=>({slug:s.slug,name:s.name,platform:s.platform}))})}case"sentry_list_issues":{let e=await f({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 S(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 I(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 k(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"]}}]};d.tools=d.toolsForAssistant;export{k as sentryAddComment,u as sentryFetch,S as sentryGetIssue,f as sentryListIssues,_ as sentryListProjects,d as sentrySkill,I as sentryUpdateIssue};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zibby/skills",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "description": "Built-in skill definitions for the Zibby agent-workflow framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",