@zibby/skills 0.1.37 → 0.1.38
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/github.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +90 -73
- package/dist/package.json +1 -1
- package/dist/reviewMemory.d.ts +90 -0
- package/dist/reviewMemory.js +18 -0
- package/dist/trackers/github-adapter.js +3 -3
- package/dist/trackers/index.js +1 -1
- package/package.json +1 -1
package/dist/github.js
CHANGED
|
@@ -36,6 +36,6 @@ When user says "check out repo-name" or "clone repo-name":
|
|
|
36
36
|
3. STOP. Do not offer to inspect files or ask what to do next.
|
|
37
37
|
|
|
38
38
|
When user just wants to "look at" or "read" files (not clone):
|
|
39
|
-
- Use github_get_file to read individual files via API`,resolve(){let f=P();if(!f)return{command:null,args:[],env:{},description:this.description};let a={};for(let t of this.envKeys)process.env[t]&&(a[t]=process.env[t]);return{type:"stdio",command:"node",args:[f,"../dist/github.js","githubSkill"],env:a,description:this.description,alwaysLoad:!0}},async handleToolCall(f,a){try{switch(f){case"github_search_issues":{let t=a.query;if(!t)return JSON.stringify({error:"query is required"});let i=await l(`/search/issues?q=${encodeURIComponent(t)}&per_page=${a.limit||20}`),r=(i.items||[]).map(e=>({number:e.number,title:e.title,state:e.state,repo:e.repository_url?.split("/").slice(-2).join("/"),url:e.html_url,user:e.user?.login,isPR:!!e.pull_request,labels:(e.labels||[]).map(s=>s.name),createdAt:e.created_at}));return JSON.stringify({total:i.total_count,items:r})}case"github_search_code":{let t=a.query;if(!t)return JSON.stringify({error:"query is required"});let i=a.repo?`+repo:${a.repo}`:"",r=a.language?`+language:${a.language}`:"",e=await l(`/search/code?q=${encodeURIComponent(t)}${i}${r}&per_page=${a.limit||15}`),s=(e.items||[]).map(n=>({name:n.name,path:n.path,repo:n.repository?.full_name,url:n.html_url,score:n.score}));return JSON.stringify({total:e.total_count,items:s})}case"github_get_pr":{let{owner:t,repo:i,number:r}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let e=await l(`/repos/${t}/${i}/pulls/${r}`);return JSON.stringify({number:e.number,title:e.title,state:e.state,merged:e.merged,body:e.body?.slice(0,5e3),user:e.user?.login,branch:e.head?.ref,base:e.base?.ref,changedFiles:e.changed_files,additions:e.additions,deletions:e.deletions,createdAt:e.created_at,mergedAt:e.merged_at,url:e.html_url,labels:(e.labels||[]).map(s=>s.name)})}case"github_get_pr_diff":{let{owner:t,repo:i,number:r}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let e=await l(`/repos/${t}/${i}/pulls/${r}`,{accept:"application/vnd.github.v3.diff",raw:!0}),s=e.length>15e3;return JSON.stringify({number:r,diff:s?e.slice(0,15e3):e,truncated:s,totalLength:e.length})}case"github_list_pr_files":{let{owner:t,repo:i,number:r}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let e=await l(`/repos/${t}/${i}/pulls/${r}/files?per_page=100`);return JSON.stringify({total:e.length,files:e.map(s=>({filename:s.filename,status:s.status,additions:s.additions,deletions:s.deletions,patch:s.patch?.slice(0,3e3)}))})}case"github_list_pr_comments":{let{owner:t,repo:i,number:r}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let e=await l(`/repos/${t}/${i}/pulls/${r}/comments?per_page=50`),s=await l(`/repos/${t}/${i}/issues/${r}/comments?per_page=50`),n=[...e.map(o=>({type:"review",user:o.user?.login,body:o.body?.slice(0,1e3),path:o.path,line:o.line,createdAt:o.created_at})),...s.map(o=>({type:"issue",user:o.user?.login,body:o.body?.slice(0,1e3),createdAt:o.created_at}))].sort((o,p)=>new Date(o.createdAt)-new Date(p.createdAt));return JSON.stringify({total:n.length,comments:n})}case"github_create_review":{let{owner:t,repo:i,number:r,body:e,event:s,comments:n}=a||{};if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let o=(s||"COMMENT").toUpperCase();if(!["COMMENT","APPROVE","REQUEST_CHANGES"].includes(o))return JSON.stringify({error:`event must be COMMENT, APPROVE, or REQUEST_CHANGES (got ${s})`});let p=Array.isArray(n)?n.filter(m=>m&&m.path&&m.body&&(m.line!=null||m.position!=null)).map(m=>{let y={path:m.path,body:String(m.body)};return m.line!=null?(y.line=Number(m.line),y.side=m.side==="LEFT"?"LEFT":"RIGHT"):y.position=Number(m.position),y}):[];if(o!=="APPROVE"&&!e&&p.length===0)return JSON.stringify({error:"a COMMENT or REQUEST_CHANGES review needs a body and/or inline comments"});let d={event:o};e&&(d.body=String(e)),p.length>0&&(d.comments=p);let c=await l(`/repos/${t}/${i}/pulls/${r}/reviews`,{method:"POST",body:d});return JSON.stringify({ok:!0,id:c.id,state:c.state,event:o,commentsPosted:p.length,url:c.html_url})}case"github_list_commits":{let{owner:t,repo:i,branch:r,path:e,limit:s}=a;if(!t||!i)return JSON.stringify({error:"owner and repo are required"});let n=`/repos/${t}/${i}/commits?per_page=${s||20}`;r&&(n+=`&sha=${encodeURIComponent(r)}`),e&&(n+=`&path=${encodeURIComponent(e)}`);let o=await l(n);return JSON.stringify({total:o.length,commits:o.map(p=>({sha:p.sha?.slice(0,8),fullSha:p.sha,message:p.commit?.message?.slice(0,300),author:p.commit?.author?.name,date:p.commit?.author?.date,url:p.html_url}))})}case"github_get_commit":{let{owner:t,repo:i,sha:r}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and sha are required"});let e=await l(`/repos/${t}/${i}/commits/${r}`);return JSON.stringify({sha:e.sha?.slice(0,8),message:e.commit?.message,author:e.commit?.author?.name,date:e.commit?.author?.date,stats:e.stats,files:(e.files||[]).map(s=>({filename:s.filename,status:s.status,additions:s.additions,deletions:s.deletions,patch:s.patch?.slice(0,3e3)}))})}case"github_get_file":{let{owner:t,repo:i,path:r,ref:e}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and path are required"});let s=`/repos/${t}/${i}/contents/${encodeURIComponent(r)}`;e&&(s+=`?ref=${encodeURIComponent(e)}`);let n=await l(s);if(n.type!=="file")return Array.isArray(n)?JSON.stringify({type:"directory",path:r,entries:n.map(d=>({name:d.name,type:d.type,size:d.size,path:d.path}))}):JSON.stringify({error:`Not a file: ${n.type}`});let o=Buffer.from(n.content||"","base64").toString("utf-8"),p=o.length>2e4;return JSON.stringify({path:n.path,size:n.size,sha:n.sha?.slice(0,8),content:p?o.slice(0,2e4):o,truncated:p})}case"github_get_user":try{let t=await l("/installation/repositories?per_page=1");if(t.repositories&&t.repositories.length>0){let i=t.repositories[0],r=i.owner.login,e=i.owner.type,s=e==="Organization"?`/orgs/${r}`:`/users/${r}`,n=await l(s);return JSON.stringify({login:n.login,name:n.name||n.login,avatar:n.avatar_url,bio:n.bio||n.description,type:e,isOrg:e==="Organization",publicRepos:n.public_repos,message:"Showing GitHub App installation owner (GitHub Apps cannot access /user endpoint)"})}return JSON.stringify({error:"No repositories accessible to this GitHub App installation"})}catch(t){return JSON.stringify({error:`GitHub App cannot access /user endpoint. Use github_list_repos instead. (${t.message})`})}case"github_list_orgs":try{let i=(await l("/installation/repositories?per_page=100")).repositories||[],r=new Map;for(let s of i)s.owner.type==="Organization"&&(r.has(s.owner.login)||r.set(s.owner.login,{login:s.owner.login,description:null,url:s.owner.url}));let e=Array.from(r.values());return JSON.stringify({count:e.length,orgs:e,message:"Extracted from accessible repositories (GitHub Apps cannot access /user/orgs directly)"})}catch(t){return JSON.stringify({error:`GitHub App cannot list orgs via /user/orgs. Error: ${t.message}`})}case"github_clone":{let u=function(_){let w=_.replace(/^~(?=$|\/|\\)/,y);return n(w)},{owner:t,repo:i,destination:r}=a;if(!t||!i)return JSON.stringify({error:"owner and repo are required"});let{execSync:e}=await import("child_process"),{join:s,resolve:n}=await import("path"),{existsSync:o,mkdirSync:p}=await import("fs"),{homedir:d,platform:c}=await import("os"),{token:m}=await $("github"),y=d(),b=r?u(r):s(y,"zibby-repos"),h=s(b,i);if(p(b,{recursive:!0}),o(h))return JSON.stringify({error:`Directory ${h} already exists. Remove it first or use a different destination.`,existingPath:h});try{let _=`https://x-access-token:${m}@github.com/${t}/${i}.git`;e(`git clone ${_} "${h}"`,{stdio:"pipe"});let w=c()==="win32",g;return w?g=e(`dir "${h}"`,{encoding:"utf-8",shell:"cmd.exe"}):g=e(`ls -la "${h}"`,{encoding:"utf-8"}),JSON.stringify({success:!0,path:h,message:`Cloned ${t}/${i} to ${h}`,contents:g.split(`
|
|
39
|
+
- Use github_get_file to read individual files via API`,resolve(){let f=P();if(!f)return{command:null,args:[],env:{},description:this.description};let a={};for(let t of this.envKeys)process.env[t]&&(a[t]=process.env[t]);return{type:"stdio",command:"node",args:[f,"../dist/github.js","githubSkill"],env:a,description:this.description,alwaysLoad:!0}},async handleToolCall(f,a){try{switch(f){case"github_search_issues":{let t=a.query;if(!t)return JSON.stringify({error:"query is required"});let i=await l(`/search/issues?q=${encodeURIComponent(t)}&per_page=${a.limit||20}`),r=(i.items||[]).map(e=>({number:e.number,title:e.title,state:e.state,repo:e.repository_url?.split("/").slice(-2).join("/"),url:e.html_url,user:e.user?.login,isPR:!!e.pull_request,labels:(e.labels||[]).map(s=>s.name),createdAt:e.created_at}));return JSON.stringify({total:i.total_count,items:r})}case"github_search_code":{let t=a.query;if(!t)return JSON.stringify({error:"query is required"});let i=a.repo?`+repo:${a.repo}`:"",r=a.language?`+language:${a.language}`:"",e=await l(`/search/code?q=${encodeURIComponent(t)}${i}${r}&per_page=${a.limit||15}`),s=(e.items||[]).map(n=>({name:n.name,path:n.path,repo:n.repository?.full_name,url:n.html_url,score:n.score}));return JSON.stringify({total:e.total_count,items:s})}case"github_get_pr":{let{owner:t,repo:i,number:r}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let e=await l(`/repos/${t}/${i}/pulls/${r}`);return JSON.stringify({number:e.number,title:e.title,state:e.state,merged:e.merged,body:e.body?.slice(0,5e3),user:e.user?.login,branch:e.head?.ref,headSha:e.head?.sha,base:e.base?.ref,changedFiles:e.changed_files,additions:e.additions,deletions:e.deletions,createdAt:e.created_at,mergedAt:e.merged_at,url:e.html_url,labels:(e.labels||[]).map(s=>s.name)})}case"github_get_pr_diff":{let{owner:t,repo:i,number:r}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let e=await l(`/repos/${t}/${i}/pulls/${r}`,{accept:"application/vnd.github.v3.diff",raw:!0}),s=e.length>15e3;return JSON.stringify({number:r,diff:s?e.slice(0,15e3):e,truncated:s,totalLength:e.length})}case"github_list_pr_files":{let{owner:t,repo:i,number:r}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let e=await l(`/repos/${t}/${i}/pulls/${r}/files?per_page=100`);return JSON.stringify({total:e.length,files:e.map(s=>({filename:s.filename,status:s.status,additions:s.additions,deletions:s.deletions,patch:s.patch?.slice(0,3e3)}))})}case"github_list_pr_comments":{let{owner:t,repo:i,number:r}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let e=await l(`/repos/${t}/${i}/pulls/${r}/comments?per_page=50`),s=await l(`/repos/${t}/${i}/issues/${r}/comments?per_page=50`),n=[...e.map(o=>({type:"review",user:o.user?.login,body:o.body?.slice(0,1e3),path:o.path,line:o.line,createdAt:o.created_at})),...s.map(o=>({type:"issue",user:o.user?.login,body:o.body?.slice(0,1e3),createdAt:o.created_at}))].sort((o,p)=>new Date(o.createdAt)-new Date(p.createdAt));return JSON.stringify({total:n.length,comments:n})}case"github_create_review":{let{owner:t,repo:i,number:r,body:e,event:s,comments:n}=a||{};if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let o=(s||"COMMENT").toUpperCase();if(!["COMMENT","APPROVE","REQUEST_CHANGES"].includes(o))return JSON.stringify({error:`event must be COMMENT, APPROVE, or REQUEST_CHANGES (got ${s})`});let p=Array.isArray(n)?n.filter(m=>m&&m.path&&m.body&&(m.line!=null||m.position!=null)).map(m=>{let y={path:m.path,body:String(m.body)};return m.line!=null?(y.line=Number(m.line),y.side=m.side==="LEFT"?"LEFT":"RIGHT"):y.position=Number(m.position),y}):[];if(o!=="APPROVE"&&!e&&p.length===0)return JSON.stringify({error:"a COMMENT or REQUEST_CHANGES review needs a body and/or inline comments"});let d={event:o};e&&(d.body=String(e)),p.length>0&&(d.comments=p);let c=await l(`/repos/${t}/${i}/pulls/${r}/reviews`,{method:"POST",body:d});return JSON.stringify({ok:!0,id:c.id,state:c.state,event:o,commentsPosted:p.length,url:c.html_url})}case"github_list_commits":{let{owner:t,repo:i,branch:r,path:e,limit:s}=a;if(!t||!i)return JSON.stringify({error:"owner and repo are required"});let n=`/repos/${t}/${i}/commits?per_page=${s||20}`;r&&(n+=`&sha=${encodeURIComponent(r)}`),e&&(n+=`&path=${encodeURIComponent(e)}`);let o=await l(n);return JSON.stringify({total:o.length,commits:o.map(p=>({sha:p.sha?.slice(0,8),fullSha:p.sha,message:p.commit?.message?.slice(0,300),author:p.commit?.author?.name,date:p.commit?.author?.date,url:p.html_url}))})}case"github_get_commit":{let{owner:t,repo:i,sha:r}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and sha are required"});let e=await l(`/repos/${t}/${i}/commits/${r}`);return JSON.stringify({sha:e.sha?.slice(0,8),message:e.commit?.message,author:e.commit?.author?.name,date:e.commit?.author?.date,stats:e.stats,files:(e.files||[]).map(s=>({filename:s.filename,status:s.status,additions:s.additions,deletions:s.deletions,patch:s.patch?.slice(0,3e3)}))})}case"github_get_file":{let{owner:t,repo:i,path:r,ref:e}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and path are required"});let s=`/repos/${t}/${i}/contents/${encodeURIComponent(r)}`;e&&(s+=`?ref=${encodeURIComponent(e)}`);let n=await l(s);if(n.type!=="file")return Array.isArray(n)?JSON.stringify({type:"directory",path:r,entries:n.map(d=>({name:d.name,type:d.type,size:d.size,path:d.path}))}):JSON.stringify({error:`Not a file: ${n.type}`});let o=Buffer.from(n.content||"","base64").toString("utf-8"),p=o.length>2e4;return JSON.stringify({path:n.path,size:n.size,sha:n.sha?.slice(0,8),content:p?o.slice(0,2e4):o,truncated:p})}case"github_get_user":try{let t=await l("/installation/repositories?per_page=1");if(t.repositories&&t.repositories.length>0){let i=t.repositories[0],r=i.owner.login,e=i.owner.type,s=e==="Organization"?`/orgs/${r}`:`/users/${r}`,n=await l(s);return JSON.stringify({login:n.login,name:n.name||n.login,avatar:n.avatar_url,bio:n.bio||n.description,type:e,isOrg:e==="Organization",publicRepos:n.public_repos,message:"Showing GitHub App installation owner (GitHub Apps cannot access /user endpoint)"})}return JSON.stringify({error:"No repositories accessible to this GitHub App installation"})}catch(t){return JSON.stringify({error:`GitHub App cannot access /user endpoint. Use github_list_repos instead. (${t.message})`})}case"github_list_orgs":try{let i=(await l("/installation/repositories?per_page=100")).repositories||[],r=new Map;for(let s of i)s.owner.type==="Organization"&&(r.has(s.owner.login)||r.set(s.owner.login,{login:s.owner.login,description:null,url:s.owner.url}));let e=Array.from(r.values());return JSON.stringify({count:e.length,orgs:e,message:"Extracted from accessible repositories (GitHub Apps cannot access /user/orgs directly)"})}catch(t){return JSON.stringify({error:`GitHub App cannot list orgs via /user/orgs. Error: ${t.message}`})}case"github_clone":{let u=function(_){let w=_.replace(/^~(?=$|\/|\\)/,y);return n(w)},{owner:t,repo:i,destination:r}=a;if(!t||!i)return JSON.stringify({error:"owner and repo are required"});let{execSync:e}=await import("child_process"),{join:s,resolve:n}=await import("path"),{existsSync:o,mkdirSync:p}=await import("fs"),{homedir:d,platform:c}=await import("os"),{token:m}=await $("github"),y=d(),b=r?u(r):s(y,"zibby-repos"),h=s(b,i);if(p(b,{recursive:!0}),o(h))return JSON.stringify({error:`Directory ${h} already exists. Remove it first or use a different destination.`,existingPath:h});try{let _=`https://x-access-token:${m}@github.com/${t}/${i}.git`;e(`git clone ${_} "${h}"`,{stdio:"pipe"});let w=c()==="win32",g;return w?g=e(`dir "${h}"`,{encoding:"utf-8",shell:"cmd.exe"}):g=e(`ls -la "${h}"`,{encoding:"utf-8"}),JSON.stringify({success:!0,path:h,message:`Cloned ${t}/${i} to ${h}`,contents:g.split(`
|
|
40
40
|
`).slice(0,30).join(`
|
|
41
41
|
`),instructions:"IMPORTANT: Show the contents field to the user - it contains the directory listing."})}catch(_){return JSON.stringify({error:`Clone failed: ${_.message}`})}}case"github_search_repos":{let{query:t,limit:i}=a;if(!t)return JSON.stringify({error:"query is required"});let r=await this.handleToolCall("github_list_repos",{limit:200},{}),e=JSON.parse(r);if(e.error)return JSON.stringify(e);let s=t.toLowerCase(),n=e.repos.filter(o=>o.name.toLowerCase().includes(s)||o.fullName.toLowerCase().includes(s)||o.description&&o.description.toLowerCase().includes(s));return JSON.stringify({query:t,count:n.length,repos:n.slice(0,i||20)})}case"github_list_repos":{let{owner:t,type:i,sort:r,direction:e,limit:s}=a,n=100,o=s||200,p=[];if(!t){let u=1,b=!0;for(;b&&p.length<o;){let g=`/installation/repositories?per_page=${n}&page=${u}`,S=(await l(g)).repositories||[];if(S.length===0)break;p=p.concat(S),b=S.length===n,u++}let h=p.slice(0,o).map(g=>({name:g.name,fullName:g.full_name,private:g.private,description:g.description,language:g.language,defaultBranch:g.default_branch,updatedAt:g.updated_at,stars:g.stargazers_count,url:g.html_url})),_=h.filter(g=>g.private).length,w=h.filter(g=>!g.private).length;return JSON.stringify({count:h.length,repos:h,privateCount:_,publicCount:w,message:`Found ${_} private and ${w} public repos`})}let d=await l(`/orgs/${t}`).then(()=>!0).catch(()=>!1),c=1,m=!0;for(;m&&p.length<o;){let u;d?u=`/orgs/${t}/repos?per_page=${n}&page=${c}&type=${i||"all"}&sort=${r||"updated"}&direction=${e||"desc"}`:u=`/users/${t}/repos?per_page=${n}&page=${c}&type=${i||"all"}&sort=${r||"updated"}&direction=${e||"desc"}`;let b=await l(u),h=Array.isArray(b)?b:[];if(h.length===0)break;p=p.concat(h),m=h.length===n,c++}let y=p.slice(0,o).map(u=>({name:u.name,fullName:u.full_name,private:u.private,description:u.description,language:u.language,defaultBranch:u.default_branch,updatedAt:u.updated_at,stars:u.stargazers_count,url:u.html_url}));return JSON.stringify({count:y.length,repos:y})}case"github_create_issue":{let{owner:t,repo:i,title:r,body:e}=a;if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and title are required"});let s=await l(`/repos/${t}/${i}/issues`,{method:"POST",body:{title:r,body:e||""}});return JSON.stringify({number:s.number,url:s.html_url,title:s.title})}case"github_list_issues":{let{owner:t,repo:i,state:r,labels:e,since:s,assignee:n,sort:o,direction:p,limit:d}=a||{};if(!t||!i)return JSON.stringify({error:"owner and repo are required"});let c=new URLSearchParams;c.set("state",r||"open"),c.set("per_page",String(d||30)),c.set("sort",o||"updated"),c.set("direction",p||"desc"),e&&c.set("labels",Array.isArray(e)?e.join(","):e),s&&c.set("since",s),n&&c.set("assignee",n);let m=await l(`/repos/${t}/${i}/issues?${c.toString()}`),y=(Array.isArray(m)?m:[]).filter(u=>!u.pull_request).map(u=>({number:u.number,title:u.title,state:u.state,labels:(u.labels||[]).map(b=>typeof b=="string"?b:b.name),assignee:u.assignee?.login||null,assignees:(u.assignees||[]).map(b=>b.login),user:u.user?.login,comments:u.comments,url:u.html_url,createdAt:u.created_at,updatedAt:u.updated_at}));return JSON.stringify({count:y.length,issues:y})}case"github_get_issue":{let{owner:t,repo:i,number:r}=a||{};if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let e=await l(`/repos/${t}/${i}/issues/${r}`);return e.pull_request?JSON.stringify({error:`#${r} is a pull request, not an issue`,isPR:!0}):JSON.stringify({number:e.number,title:e.title,body:e.body||"",state:e.state,stateReason:e.state_reason||null,labels:(e.labels||[]).map(s=>typeof s=="string"?s:s.name),assignee:e.assignee?.login||null,assignees:(e.assignees||[]).map(s=>s.login),user:e.user?.login,milestone:e.milestone?.title||null,comments:e.comments,url:e.html_url,createdAt:e.created_at,updatedAt:e.updated_at,closedAt:e.closed_at})}case"github_get_issue_comments":{let{owner:t,repo:i,number:r,limit:e}=a||{};if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let s=await l(`/repos/${t}/${i}/issues/${r}/comments?per_page=${e||100}`),n=(Array.isArray(s)?s:[]).map(o=>({id:o.id,user:o.user?.login,body:o.body||"",createdAt:o.created_at,updatedAt:o.updated_at,url:o.html_url}));return JSON.stringify({count:n.length,comments:n})}case"github_add_issue_comment":{let{owner:t,repo:i,number:r,body:e}=a||{};if(!t||!i||!r||!e)return JSON.stringify({error:"owner, repo, number, and body are required"});let s=await l(`/repos/${t}/${i}/issues/${r}/comments`,{method:"POST",body:{body:e}});return JSON.stringify({ok:!0,id:s.id,url:s.html_url})}case"github_close_issue":{let{owner:t,repo:i,number:r,stateReason:e}=a||{};if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let s={state:"closed"};e&&(s.state_reason=e);let n=await l(`/repos/${t}/${i}/issues/${r}`,{method:"PATCH",body:s});return JSON.stringify({ok:!0,number:n.number,state:n.state,stateReason:n.state_reason||null,url:n.html_url})}case"github_reopen_issue":{let{owner:t,repo:i,number:r}=a||{};if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let e=await l(`/repos/${t}/${i}/issues/${r}`,{method:"PATCH",body:{state:"open"}});return JSON.stringify({ok:!0,number:e.number,state:e.state,url:e.html_url})}case"github_label_issue":{let{owner:t,repo:i,number:r,labels:e,mode:s}=a||{};if(!t||!i||!r)return JSON.stringify({error:"owner, repo, and number are required"});let n=Array.isArray(e)?e:e?[e]:[];if(!n.length)return JSON.stringify({error:"labels (string or array) is required"});let o=s||"add";if(o==="set"){let d=await l(`/repos/${t}/${i}/issues/${r}`,{method:"PATCH",body:{labels:n}});return JSON.stringify({ok:!0,number:d.number,labels:(d.labels||[]).map(c=>typeof c=="string"?c:c.name)})}if(o==="remove"){for(let c of n)await l(`/repos/${t}/${i}/issues/${r}/labels/${encodeURIComponent(c)}`,{method:"DELETE"});let d=await l(`/repos/${t}/${i}/issues/${r}`);return JSON.stringify({ok:!0,number:d.number,labels:(d.labels||[]).map(c=>typeof c=="string"?c:c.name)})}let p=await l(`/repos/${t}/${i}/issues/${r}/labels`,{method:"POST",body:{labels:n}});return JSON.stringify({ok:!0,number:r,labels:(Array.isArray(p)?p:[]).map(d=>typeof d=="string"?d:d.name)})}default:return JSON.stringify({error:`Unknown tool: ${f}`})}}catch(t){return JSON.stringify({error:t.message})}},tools:[{name:"github_get_user",description:"Get the authenticated GitHub user profile and their organizations",input_schema:{type:"object",properties:{}}},{name:"github_list_orgs",description:"List GitHub organizations the authenticated user belongs to",input_schema:{type:"object",properties:{}}},{name:"github_list_repos",description:"List repositories for a user or org. If no owner given, lists the authenticated user's repos.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Org or user login. Omit to list your own repos."},type:{type:"string",enum:["all","public","private","forks","sources","member"],description:"Filter by type (default: all)"},sort:{type:"string",enum:["created","updated","pushed","full_name"],description:"Sort field (default: updated)"},direction:{type:"string",enum:["asc","desc"],description:"Sort direction (default: desc)"},limit:{type:"number",description:"Max repos to return (default: 30)"}}}},{name:"github_clone",description:'Clone a GitHub repository to the local filesystem. Use when user says "check out" or "clone" a repo.',input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner (user or org name)"},repo:{type:"string",description:"Repository name"},destination:{type:"string",description:"Destination directory. Accepts absolute paths, ~-prefixed paths, or relative names. Defaults to ~/zibby-repos/<repo>."}},required:["owner","repo"]}},{name:"github_search_repos",description:"Search accessible repositories by name or description. Use this when the user asks to find a specific repo.",input_schema:{type:"object",properties:{query:{type:"string",description:'Search term to match against repo name or description (e.g., "electron", "my-app")'},limit:{type:"number",description:"Max results (default: 20)"}},required:["query"]}},{name:"github_search_issues",description:"Search GitHub issues and pull requests",input_schema:{type:"object",properties:{query:{type:"string",description:'GitHub search query (e.g. "SCRUM-123", "login bug repo:org/app")'},limit:{type:"number",description:"Max results (default: 20)"}},required:["query"]}},{name:"github_search_code",description:"Search code across GitHub repositories by keyword",input_schema:{type:"object",properties:{query:{type:"string",description:'Code search query (e.g. "handleLogin", "class AuthService")'},repo:{type:"string",description:'Scope to a specific repo (e.g. "org/app"). Optional.'},language:{type:"string",description:'Filter by language (e.g. "javascript", "python"). Optional.'},limit:{type:"number",description:"Max results (default: 15)"}},required:["query"]}},{name:"github_get_pr",description:"Get details of a pull request \u2014 title, description, branch, stats",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"PR number"}},required:["owner","repo","number"]}},{name:"github_get_pr_diff",description:"Get the unified diff of a pull request \u2014 the actual code changes",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"PR number"}},required:["owner","repo","number"]}},{name:"github_list_pr_files",description:"List files changed in a PR with per-file patches",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"PR number"}},required:["owner","repo","number"]}},{name:"github_list_pr_comments",description:"Get all review and issue comments on a PR",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"PR number"}},required:["owner","repo","number"]}},{name:"github_create_review",description:"Post a review on a pull request: a summary body plus optional inline comments anchored to file/line, with an event (COMMENT, APPROVE, or REQUEST_CHANGES). Use this to deliver a code review back to the PR.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"PR number"},body:{type:"string",description:"The review summary (markdown). Shown as the top-level review comment."},event:{type:"string",enum:["COMMENT","APPROVE","REQUEST_CHANGES"],description:"Review verdict. Default COMMENT (no approval state). Use REQUEST_CHANGES for blocking issues."},comments:{type:"array",description:"Optional inline comments, each anchored to a changed line.",items:{type:"object",properties:{path:{type:"string",description:"File path as it appears in the diff"},line:{type:"number",description:"Line number in the file's NEW version (the right side of the diff)"},side:{type:"string",enum:["LEFT","RIGHT"],description:"RIGHT (new) or LEFT (old). Default RIGHT."},body:{type:"string",description:"The inline comment text (markdown)"}},required:["path","line","body"]}}},required:["owner","repo","number"]}},{name:"github_list_commits",description:"List recent commits on a branch, optionally filtered by file path",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},branch:{type:"string",description:"Branch name (default: repo default branch)"},path:{type:"string",description:"Filter commits touching this file path"},limit:{type:"number",description:"Max commits (default: 20)"}},required:["owner","repo"]}},{name:"github_get_commit",description:"Get details of a specific commit \u2014 message, stats, file diffs",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},sha:{type:"string",description:"Commit SHA (full or short)"}},required:["owner","repo","sha"]}},{name:"github_get_file",description:"Read a file (or list a directory) from a GitHub repo. Works on any branch/ref.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},path:{type:"string",description:'File or directory path (e.g. "src/auth/login.ts")'},ref:{type:"string",description:"Branch, tag, or commit SHA (default: repo default branch)"}},required:["owner","repo","path"]}},{name:"github_create_issue",description:"Create a GitHub issue",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},title:{type:"string",description:"Issue title"},body:{type:"string",description:"Issue body (markdown)"}},required:["owner","repo","title"]}},{name:"github_list_issues",description:"List issues in a repo (excludes pull requests). Filter by state, labels, and an updated-since cursor for polling.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},state:{type:"string",enum:["open","closed","all"],description:"Filter by state (default: open)"},labels:{type:"array",items:{type:"string"},description:"Only issues carrying ALL of these labels"},since:{type:"string",description:"ISO-8601 timestamp; only issues updated at/after this (polling cursor)"},assignee:{type:"string",description:'Filter by assignee login, "none", or "*"'},sort:{type:"string",enum:["created","updated","comments"],description:"Sort field (default: updated)"},direction:{type:"string",enum:["asc","desc"],description:"Sort direction (default: desc)"},limit:{type:"number",description:"Max issues (default: 30, max 100 per page)"}},required:["owner","repo"]}},{name:"github_get_issue",description:"Get a single GitHub issue with full detail (title, body, state, labels, assignee, url)",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"Issue number"}},required:["owner","repo","number"]}},{name:"github_get_issue_comments",description:"Get the comment thread on a GitHub issue (chronological)",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"Issue number"},limit:{type:"number",description:"Max comments (default: 100)"}},required:["owner","repo","number"]}},{name:"github_add_issue_comment",description:"Add a comment to a GitHub issue. Also the way to record a PR link on an issue (post a markdown link).",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"Issue number"},body:{type:"string",description:"Comment body (markdown)"}},required:["owner","repo","number","body"]}},{name:"github_close_issue",description:"Close a GitHub issue. Optionally set the close reason (completed or not_planned).",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"Issue number"},stateReason:{type:"string",enum:["completed","not_planned"],description:"Why the issue was closed (optional)"}},required:["owner","repo","number"]}},{name:"github_reopen_issue",description:"Reopen a closed GitHub issue",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"Issue number"}},required:["owner","repo","number"]}},{name:"github_label_issue",description:"Add, set (replace all), or remove labels on a GitHub issue. Labels back state-like transitions on GitHub.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"Issue number"},labels:{type:"array",items:{type:"string"},description:"Label name(s)"},mode:{type:"string",enum:["add","set","remove"],description:"add appends, set replaces all, remove deletes (default: add)"}},required:["owner","repo","number","labels"]}}]};export{L as githubSkill};
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export namespace SKILLS {
|
|
|
15
15
|
let SKILL_INSTALLER: string;
|
|
16
16
|
let CORE_TOOLS: string;
|
|
17
17
|
let CHAT_MEMORY: string;
|
|
18
|
+
let REVIEW_MEMORY: string;
|
|
18
19
|
let WORKFLOW_BUILDER: string;
|
|
19
20
|
let OPENAI_BILLING: string;
|
|
20
21
|
let ANTHROPIC_BILLING: string;
|
|
@@ -33,11 +34,12 @@ import { chatNotifySkill } from './chat-notify.js';
|
|
|
33
34
|
import { sentrySkill } from './sentry.js';
|
|
34
35
|
import { memorySkill } from './memory.js';
|
|
35
36
|
import { chatMemorySkill } from './chat-memory.js';
|
|
37
|
+
import { reviewMemorySkill } from './reviewMemory.js';
|
|
36
38
|
import { testRunnerSkill } from './test-runner.js';
|
|
37
39
|
import { skillInstallerSkill } from './skill-installer.js';
|
|
38
40
|
import { coreToolsSkill } from './core-tools.js';
|
|
39
41
|
import { workflowBuilderSkill } from './workflow-builder.js';
|
|
40
|
-
export { browserSkill, jiraSkill, githubSkill, gitlabSkill, linearSkill, planeSkill, gitSkill, slackSkill, larkSkill, chatNotifySkill, sentrySkill, memorySkill, chatMemorySkill, testRunnerSkill, testRunnerSkill as runnerSkill, skillInstallerSkill, coreToolsSkill, workflowBuilderSkill };
|
|
42
|
+
export { browserSkill, jiraSkill, githubSkill, gitlabSkill, linearSkill, planeSkill, gitSkill, slackSkill, larkSkill, chatNotifySkill, sentrySkill, memorySkill, chatMemorySkill, reviewMemorySkill, testRunnerSkill, testRunnerSkill as runnerSkill, skillInstallerSkill, coreToolsSkill, workflowBuilderSkill };
|
|
41
43
|
export { openaiBillingSkill, anthropicBillingSkill, cursorAdminSkill, fetchOpenAICosts, fetchOpenAIProjects, fetchAnthropicCosts, fetchAnthropicWorkspaces, fetchCursorSpend, fetchAllProviders, groupByKey, meanStddev } from "./llm-billing.js";
|
|
42
44
|
export { reportObjectSchema, reportToBlockKit, reportToLarkCard, SEVERITIES as REPORT_SEVERITIES } from "./report.js";
|
|
43
45
|
export { skill, functionSkill } from "./function-skill.js";
|