@zibby/skills 0.1.47 → 0.1.49

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.d.ts CHANGED
@@ -50,6 +50,9 @@ export namespace githubSkill {
50
50
  base?: undefined;
51
51
  title?: undefined;
52
52
  draft?: undefined;
53
+ mergeMethod?: undefined;
54
+ commitTitle?: undefined;
55
+ commitMessage?: undefined;
53
56
  state?: undefined;
54
57
  labels?: undefined;
55
58
  since?: undefined;
@@ -108,6 +111,9 @@ export namespace githubSkill {
108
111
  base?: undefined;
109
112
  title?: undefined;
110
113
  draft?: undefined;
114
+ mergeMethod?: undefined;
115
+ commitTitle?: undefined;
116
+ commitMessage?: undefined;
111
117
  state?: undefined;
112
118
  labels?: undefined;
113
119
  since?: undefined;
@@ -154,6 +160,9 @@ export namespace githubSkill {
154
160
  base?: undefined;
155
161
  title?: undefined;
156
162
  draft?: undefined;
163
+ mergeMethod?: undefined;
164
+ commitTitle?: undefined;
165
+ commitMessage?: undefined;
157
166
  state?: undefined;
158
167
  labels?: undefined;
159
168
  since?: undefined;
@@ -197,6 +206,9 @@ export namespace githubSkill {
197
206
  base?: undefined;
198
207
  title?: undefined;
199
208
  draft?: undefined;
209
+ mergeMethod?: undefined;
210
+ commitTitle?: undefined;
211
+ commitMessage?: undefined;
200
212
  state?: undefined;
201
213
  labels?: undefined;
202
214
  since?: undefined;
@@ -246,6 +258,9 @@ export namespace githubSkill {
246
258
  base?: undefined;
247
259
  title?: undefined;
248
260
  draft?: undefined;
261
+ mergeMethod?: undefined;
262
+ commitTitle?: undefined;
263
+ commitMessage?: undefined;
249
264
  state?: undefined;
250
265
  labels?: undefined;
251
266
  since?: undefined;
@@ -292,6 +307,9 @@ export namespace githubSkill {
292
307
  base?: undefined;
293
308
  title?: undefined;
294
309
  draft?: undefined;
310
+ mergeMethod?: undefined;
311
+ commitTitle?: undefined;
312
+ commitMessage?: undefined;
295
313
  state?: undefined;
296
314
  labels?: undefined;
297
315
  since?: undefined;
@@ -341,6 +359,9 @@ export namespace githubSkill {
341
359
  base?: undefined;
342
360
  title?: undefined;
343
361
  draft?: undefined;
362
+ mergeMethod?: undefined;
363
+ commitTitle?: undefined;
364
+ commitMessage?: undefined;
344
365
  state?: undefined;
345
366
  labels?: undefined;
346
367
  since?: undefined;
@@ -393,6 +414,9 @@ export namespace githubSkill {
393
414
  base?: undefined;
394
415
  title?: undefined;
395
416
  draft?: undefined;
417
+ mergeMethod?: undefined;
418
+ commitTitle?: undefined;
419
+ commitMessage?: undefined;
396
420
  state?: undefined;
397
421
  labels?: undefined;
398
422
  since?: undefined;
@@ -442,6 +466,9 @@ export namespace githubSkill {
442
466
  base?: undefined;
443
467
  title?: undefined;
444
468
  draft?: undefined;
469
+ mergeMethod?: undefined;
470
+ commitTitle?: undefined;
471
+ commitMessage?: undefined;
445
472
  state?: undefined;
446
473
  labels?: undefined;
447
474
  since?: undefined;
@@ -521,6 +548,9 @@ export namespace githubSkill {
521
548
  base?: undefined;
522
549
  title?: undefined;
523
550
  draft?: undefined;
551
+ mergeMethod?: undefined;
552
+ commitTitle?: undefined;
553
+ commitMessage?: undefined;
524
554
  state?: undefined;
525
555
  labels?: undefined;
526
556
  since?: undefined;
@@ -573,6 +603,9 @@ export namespace githubSkill {
573
603
  base?: undefined;
574
604
  title?: undefined;
575
605
  draft?: undefined;
606
+ mergeMethod?: undefined;
607
+ commitTitle?: undefined;
608
+ commitMessage?: undefined;
576
609
  state?: undefined;
577
610
  labels?: undefined;
578
611
  since?: undefined;
@@ -619,6 +652,9 @@ export namespace githubSkill {
619
652
  base?: undefined;
620
653
  title?: undefined;
621
654
  draft?: undefined;
655
+ mergeMethod?: undefined;
656
+ commitTitle?: undefined;
657
+ commitMessage?: undefined;
622
658
  state?: undefined;
623
659
  labels?: undefined;
624
660
  since?: undefined;
@@ -668,6 +704,9 @@ export namespace githubSkill {
668
704
  base?: undefined;
669
705
  title?: undefined;
670
706
  draft?: undefined;
707
+ mergeMethod?: undefined;
708
+ commitTitle?: undefined;
709
+ commitMessage?: undefined;
671
710
  state?: undefined;
672
711
  labels?: undefined;
673
712
  since?: undefined;
@@ -726,6 +765,68 @@ export namespace githubSkill {
726
765
  path?: undefined;
727
766
  sha?: undefined;
728
767
  ref?: undefined;
768
+ mergeMethod?: undefined;
769
+ commitTitle?: undefined;
770
+ commitMessage?: undefined;
771
+ state?: undefined;
772
+ labels?: undefined;
773
+ since?: undefined;
774
+ assignee?: undefined;
775
+ stateReason?: undefined;
776
+ mode?: undefined;
777
+ };
778
+ required: string[];
779
+ };
780
+ } | {
781
+ name: string;
782
+ description: string;
783
+ input_schema: {
784
+ type: string;
785
+ properties: {
786
+ owner: {
787
+ type: string;
788
+ description: string;
789
+ };
790
+ repo: {
791
+ type: string;
792
+ description: string;
793
+ };
794
+ number: {
795
+ type: string;
796
+ description: string;
797
+ };
798
+ mergeMethod: {
799
+ type: string;
800
+ enum: string[];
801
+ description: string;
802
+ };
803
+ commitTitle: {
804
+ type: string;
805
+ description: string;
806
+ };
807
+ commitMessage: {
808
+ type: string;
809
+ description: string;
810
+ };
811
+ query?: undefined;
812
+ type?: undefined;
813
+ sort?: undefined;
814
+ direction?: undefined;
815
+ limit?: undefined;
816
+ destination?: undefined;
817
+ language?: undefined;
818
+ commentId?: undefined;
819
+ body?: undefined;
820
+ event?: undefined;
821
+ comments?: undefined;
822
+ branch?: undefined;
823
+ path?: undefined;
824
+ sha?: undefined;
825
+ ref?: undefined;
826
+ head?: undefined;
827
+ base?: undefined;
828
+ title?: undefined;
829
+ draft?: undefined;
729
830
  state?: undefined;
730
831
  labels?: undefined;
731
832
  since?: undefined;
@@ -775,6 +876,9 @@ export namespace githubSkill {
775
876
  head?: undefined;
776
877
  base?: undefined;
777
878
  draft?: undefined;
879
+ mergeMethod?: undefined;
880
+ commitTitle?: undefined;
881
+ commitMessage?: undefined;
778
882
  state?: undefined;
779
883
  labels?: undefined;
780
884
  since?: undefined;
@@ -849,6 +953,9 @@ export namespace githubSkill {
849
953
  base?: undefined;
850
954
  title?: undefined;
851
955
  draft?: undefined;
956
+ mergeMethod?: undefined;
957
+ commitTitle?: undefined;
958
+ commitMessage?: undefined;
852
959
  stateReason?: undefined;
853
960
  mode?: undefined;
854
961
  };
@@ -894,6 +1001,9 @@ export namespace githubSkill {
894
1001
  base?: undefined;
895
1002
  title?: undefined;
896
1003
  draft?: undefined;
1004
+ mergeMethod?: undefined;
1005
+ commitTitle?: undefined;
1006
+ commitMessage?: undefined;
897
1007
  state?: undefined;
898
1008
  labels?: undefined;
899
1009
  since?: undefined;
@@ -945,6 +1055,9 @@ export namespace githubSkill {
945
1055
  base?: undefined;
946
1056
  title?: undefined;
947
1057
  draft?: undefined;
1058
+ mergeMethod?: undefined;
1059
+ commitTitle?: undefined;
1060
+ commitMessage?: undefined;
948
1061
  state?: undefined;
949
1062
  labels?: undefined;
950
1063
  since?: undefined;
@@ -1002,6 +1115,9 @@ export namespace githubSkill {
1002
1115
  base?: undefined;
1003
1116
  title?: undefined;
1004
1117
  draft?: undefined;
1118
+ mergeMethod?: undefined;
1119
+ commitTitle?: undefined;
1120
+ commitMessage?: undefined;
1005
1121
  state?: undefined;
1006
1122
  since?: undefined;
1007
1123
  assignee?: undefined;
package/dist/github.js CHANGED
@@ -1,4 +1,4 @@
1
- import{existsSync as J}from"fs";import{fileURLToPath as E}from"url";import{dirname as I,resolve as k}from"path";import{resolveIntegrationToken as q}from"@zibby/core/backend-client.js";var P=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"}),H=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_SKILL_PATH)return process.env.MCP_SKILL_PATH;let y=I(E(import.meta.url)),a=k(y,"..","bin","mcp-skill.mjs");return J(a)?a:null}async function d(y,a={}){let{token:t}=await q("github"),i=y.startsWith("https://")?y:`https://api.github.com${y}`,n={Authorization:`Bearer ${t}`,Accept:a.accept||"application/vnd.github.v3+json","User-Agent":"Zibby-App",...a.body?{"Content-Type":"application/json"}:{}},e=await fetch(i,{method:a.method||"GET",headers:n,body:a.body?JSON.stringify(a.body):void 0});if(!e.ok){let r=await e.text().catch(()=>"");throw new Error(`GitHub API ${e.status}: ${r.slice(0,300)}`)}return a.raw?e.text():e.json()}var F={id:"github",serverName:"github",allowedTools:["mcp__github__*"],requiresIntegration:P.GITHUB,envKeys:["GITHUB_TOKEN"],description:"GitHub \u2014 issues, PRs, commits, code search, file reading",promptFragment:`## GitHub (connected)
1
+ import{existsSync as k}from"fs";import{fileURLToPath as E}from"url";import{dirname as J,resolve as G}from"path";import{resolveIntegrationToken as q}from"@zibby/core/backend-client.js";var P=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"}),H=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 I(){if(process.env.MCP_SKILL_PATH)return process.env.MCP_SKILL_PATH;let b=J(E(import.meta.url)),a=G(b,"..","bin","mcp-skill.mjs");return k(a)?a:null}async function u(b,a={}){let{token:t}=await q("github"),n=b.startsWith("https://")?b:`https://api.github.com${b}`,i={Authorization:`Bearer ${t}`,Accept:a.accept||"application/vnd.github.v3+json","User-Agent":"Zibby-App",...a.body?{"Content-Type":"application/json"}:{}},e=await fetch(n,{method:a.method||"GET",headers:i,body:a.body?JSON.stringify(a.body):void 0});if(!e.ok){let r=await e.text().catch(()=>"");throw new Error(`GitHub API ${e.status}: ${r.slice(0,300)}`)}return a.raw?e.text():e.json()}var F={id:"github",serverName:"github",allowedTools:["mcp__github__*"],requiresIntegration:P.GITHUB,envKeys:["GITHUB_TOKEN"],description:"GitHub \u2014 issues, PRs, commits, code search, file reading",promptFragment:`## GitHub (connected)
2
2
  You have access to the user's GitHub repositories. Available tools:
3
3
 
4
4
  ### Discovery
@@ -25,6 +25,7 @@ You have access to the user's GitHub repositories. Available tools:
25
25
  - github_reply_issue_comment: Reply on the PR's top-level conversation (for non-inline/summary comments)
26
26
  - github_create_review: Post a review on a PR \u2014 a summary body plus optional inline comments on specific file/line positions, with an event (COMMENT, APPROVE, or REQUEST_CHANGES)
27
27
  - github_create_pr: OPEN a pull request (POST /repos/{owner}/{repo}/pulls). The branch must already be pushed. Returns the REAL pr_url from GitHub (never fabricate a PR url). Expected business errors (no commits between base and head, a PR already exists, base==head) come back as { success:false, skippedReason } \u2014 not a hard failure.
28
+ - github_merge_pr: MERGE a pull request (PUT /repos/{owner}/{repo}/pulls/{number}/merge). mergeMethod is 'merge'|'squash'|'rebase' (default 'squash'). Returns { success:true, merged:true, sha } on a real merge. Expected non-mergeable cases (405 = draft / failing checks / not mergeable, 409 = head sha moved / conflict, 404) come back as { success:false, skippedReason } \u2014 not a hard failure.
28
29
  - github_create_issue: Create new issue
29
30
  - github_list_issues: List issues in a repo (filter by state/labels/since cursor) \u2014 excludes PRs
30
31
  - github_get_issue: Get a single issue's full detail (title, body, state, labels, assignee, url)
@@ -40,6 +41,6 @@ When user says "check out repo-name" or "clone repo-name":
40
41
  3. STOP. Do not offer to inspect files or ask what to do next.
41
42
 
42
43
  When user just wants to "look at" or "read" files (not clone):
43
- - Use github_get_file to read individual files via API`,resolve(){let y=G();if(!y)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:[y,"../dist/github.js","githubSkill"],env:a,description:this.description,alwaysLoad:!0}},async handleToolCall(y,a){try{switch(y){case"github_search_issues":{let t=a.query;if(!t)return JSON.stringify({error:"query is required"});let i=await d(`/search/issues?q=${encodeURIComponent(t)}&per_page=${a.limit||20}`),n=(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(r=>r.name),createdAt:e.created_at}));return JSON.stringify({total:i.total_count,items:n})}case"github_search_code":{let t=a.query;if(!t)return JSON.stringify({error:"query is required"});let i=a.repo?`+repo:${a.repo}`:"",n=a.language?`+language:${a.language}`:"",e=await d(`/search/code?q=${encodeURIComponent(t)}${i}${n}&per_page=${a.limit||15}`),r=(e.items||[]).map(s=>({name:s.name,path:s.path,repo:s.repository?.full_name,url:s.html_url,score:s.score}));return JSON.stringify({total:e.total_count,items:r})}case"github_get_pr":{let{owner:t,repo:i,number:n}=a;if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and number are required"});let e=await d(`/repos/${t}/${i}/pulls/${n}`);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(r=>r.name)})}case"github_get_pr_diff":{let{owner:t,repo:i,number:n}=a;if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and number are required"});let e=await d(`/repos/${t}/${i}/pulls/${n}`,{accept:"application/vnd.github.v3.diff",raw:!0}),r=e.length>15e3;return JSON.stringify({number:n,diff:r?e.slice(0,15e3):e,truncated:r,totalLength:e.length})}case"github_list_pr_files":{let{owner:t,repo:i,number:n}=a;if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and number are required"});let e=await d(`/repos/${t}/${i}/pulls/${n}/files?per_page=100`);return JSON.stringify({total:e.length,files:e.map(r=>({filename:r.filename,status:r.status,additions:r.additions,deletions:r.deletions,patch:r.patch?.slice(0,3e3)}))})}case"github_list_pr_comments":{let{owner:t,repo:i,number:n}=a;if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and number are required"});let e=await d(`/repos/${t}/${i}/pulls/${n}/comments?per_page=50`),r=await d(`/repos/${t}/${i}/issues/${n}/comments?per_page=50`),s=[...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})),...r.map(o=>({type:"issue",user:o.user?.login,body:o.body?.slice(0,1e3),createdAt:o.created_at}))].sort((o,u)=>new Date(o.createdAt)-new Date(u.createdAt));return JSON.stringify({total:s.length,comments:s})}case"github_get_review_thread":{let{owner:t,repo:i,number:n,commentId:e}=a||{};if(!t||!i||!n||!e)return JSON.stringify({error:"owner, repo, number, and commentId are required"});let r=await d(`/repos/${t}/${i}/pulls/comments/${e}`),s=r.in_reply_to_id||r.id,o=[];try{o=await d(`/repos/${t}/${i}/pulls/${n}/comments?per_page=100`)}catch{o=[r]}(!Array.isArray(o)||o.length===0)&&(o=[r]);let u=o.filter(l=>l.id===s||l.in_reply_to_id===s).sort((l,g)=>new Date(l.created_at)-new Date(g.created_at)),c=u.length?u:[r],p=c.find(l=>l.id===s)||c[0];return JSON.stringify({rootCommentId:s,path:p.path,line:p.line??p.original_line??null,side:p.side||"RIGHT",diffHunk:typeof p.diff_hunk=="string"?p.diff_hunk.slice(0,3e3):null,commitId:p.commit_id||p.original_commit_id||null,notes:c.map(l=>({id:l.id,user:l.user?.login,body:(l.body||"").slice(0,4e3),createdAt:l.created_at,isRoot:l.id===s,url:l.html_url}))})}case"github_reply_review_thread":{let{owner:t,repo:i,number:n,commentId:e,body:r}=a||{};if(!t||!i||!n||!e||!r)return JSON.stringify({error:"owner, repo, number, commentId, and body are required"});let s=await d(`/repos/${t}/${i}/pulls/${n}/comments/${e}/replies`,{method:"POST",body:{body:String(r)}});return JSON.stringify({ok:!0,id:s.id,url:s.html_url,inReplyTo:s.in_reply_to_id})}case"github_reply_issue_comment":{let{owner:t,repo:i,number:n,body:e}=a||{};if(!t||!i||!n||!e)return JSON.stringify({error:"owner, repo, number, and body are required"});let r=await d(`/repos/${t}/${i}/issues/${n}/comments`,{method:"POST",body:{body:String(e)}});return JSON.stringify({ok:!0,id:r.id,url:r.html_url})}case"github_create_review":{let{owner:t,repo:i,number:n,body:e,event:r,comments:s}=a||{};if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and number are required"});let o=(r||"COMMENT").toUpperCase();if(!["COMMENT","APPROVE","REQUEST_CHANGES"].includes(o))return JSON.stringify({error:`event must be COMMENT, APPROVE, or REQUEST_CHANGES (got ${r})`});let u=Array.isArray(s)?s.filter(l=>l&&l.path&&l.body&&(l.line!=null||l.position!=null)).map(l=>{let g={path:l.path,body:String(l.body)};return l.line!=null?(g.line=Number(l.line),g.side=l.side==="LEFT"?"LEFT":"RIGHT"):g.position=Number(l.position),g}):[];if(o!=="APPROVE"&&!e&&u.length===0)return JSON.stringify({error:"a COMMENT or REQUEST_CHANGES review needs a body and/or inline comments"});let c={event:o};e&&(c.body=String(e)),u.length>0&&(c.comments=u);let p=await d(`/repos/${t}/${i}/pulls/${n}/reviews`,{method:"POST",body:c});return JSON.stringify({ok:!0,id:p.id,state:p.state,event:o,commentsPosted:u.length,url:p.html_url})}case"github_list_commits":{let{owner:t,repo:i,branch:n,path:e,limit:r}=a;if(!t||!i)return JSON.stringify({error:"owner and repo are required"});let s=`/repos/${t}/${i}/commits?per_page=${r||20}`;n&&(s+=`&sha=${encodeURIComponent(n)}`),e&&(s+=`&path=${encodeURIComponent(e)}`);let o=await d(s);return JSON.stringify({total:o.length,commits:o.map(u=>({sha:u.sha?.slice(0,8),fullSha:u.sha,message:u.commit?.message?.slice(0,300),author:u.commit?.author?.name,date:u.commit?.author?.date,url:u.html_url}))})}case"github_get_commit":{let{owner:t,repo:i,sha:n}=a;if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and sha are required"});let e=await d(`/repos/${t}/${i}/commits/${n}`);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(r=>({filename:r.filename,status:r.status,additions:r.additions,deletions:r.deletions,patch:r.patch?.slice(0,3e3)}))})}case"github_get_file":{let{owner:t,repo:i,path:n,ref:e}=a;if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and path are required"});let r=`/repos/${t}/${i}/contents/${encodeURIComponent(n)}`;e&&(r+=`?ref=${encodeURIComponent(e)}`);let s=await d(r);if(s.type!=="file")return Array.isArray(s)?JSON.stringify({type:"directory",path:n,entries:s.map(c=>({name:c.name,type:c.type,size:c.size,path:c.path}))}):JSON.stringify({error:`Not a file: ${s.type}`});let o=Buffer.from(s.content||"","base64").toString("utf-8"),u=o.length>2e4;return JSON.stringify({path:s.path,size:s.size,sha:s.sha?.slice(0,8),content:u?o.slice(0,2e4):o,truncated:u})}case"github_get_user":try{let t=await d("/installation/repositories?per_page=1");if(t.repositories&&t.repositories.length>0){let i=t.repositories[0],n=i.owner.login,e=i.owner.type,r=e==="Organization"?`/orgs/${n}`:`/users/${n}`,s=await d(r);return JSON.stringify({login:s.login,name:s.name||s.login,avatar:s.avatar_url,bio:s.bio||s.description,type:e,isOrg:e==="Organization",publicRepos:s.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 d("/installation/repositories?per_page=100")).repositories||[],n=new Map;for(let r of i)r.owner.type==="Organization"&&(n.has(r.owner.login)||n.set(r.owner.login,{login:r.owner.login,description:null,url:r.owner.url}));let e=Array.from(n.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 h=function(_){let S=_.replace(/^~(?=$|\/|\\)/,g);return s(S)},{owner:t,repo:i,destination:n}=a;if(!t||!i)return JSON.stringify({error:"owner and repo are required"});let{execSync:e}=await import("child_process"),{join:r,resolve:s}=await import("path"),{existsSync:o,mkdirSync:u}=await import("fs"),{homedir:c,platform:p}=await import("os"),{token:l}=await q("github"),g=c(),b=n?h(n):r(g,"zibby-repos"),f=r(b,i);if(u(b,{recursive:!0}),o(f))return JSON.stringify({error:`Directory ${f} already exists. Remove it first or use a different destination.`,existingPath:f});try{let _=`https://x-access-token:${l}@github.com/${t}/${i}.git`;e(`git clone ${_} "${f}"`,{stdio:"pipe"});let S=p()==="win32",m;return S?m=e(`dir "${f}"`,{encoding:"utf-8",shell:"cmd.exe"}):m=e(`ls -la "${f}"`,{encoding:"utf-8"}),JSON.stringify({success:!0,path:f,message:`Cloned ${t}/${i} to ${f}`,contents:m.split(`
44
+ - Use github_get_file to read individual files via API`,resolve(){let b=I();if(!b)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:[b,"../dist/github.js","githubSkill"],env:a,description:this.description,alwaysLoad:!0}},async handleToolCall(b,a){try{switch(b){case"github_search_issues":{let t=a.query;if(!t)return JSON.stringify({error:"query is required"});let n=await u(`/search/issues?q=${encodeURIComponent(t)}&per_page=${a.limit||20}`),i=(n.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(r=>r.name),createdAt:e.created_at}));return JSON.stringify({total:n.total_count,items:i})}case"github_search_code":{let t=a.query;if(!t)return JSON.stringify({error:"query is required"});let n=a.repo?`+repo:${a.repo}`:"",i=a.language?`+language:${a.language}`:"",e=await u(`/search/code?q=${encodeURIComponent(t)}${n}${i}&per_page=${a.limit||15}`),r=(e.items||[]).map(s=>({name:s.name,path:s.path,repo:s.repository?.full_name,url:s.html_url,score:s.score}));return JSON.stringify({total:e.total_count,items:r})}case"github_get_pr":{let{owner:t,repo:n,number:i}=a;if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and number are required"});let e=await u(`/repos/${t}/${n}/pulls/${i}`);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(r=>r.name)})}case"github_get_pr_diff":{let{owner:t,repo:n,number:i}=a;if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and number are required"});let e=await u(`/repos/${t}/${n}/pulls/${i}`,{accept:"application/vnd.github.v3.diff",raw:!0}),r=e.length>15e3;return JSON.stringify({number:i,diff:r?e.slice(0,15e3):e,truncated:r,totalLength:e.length})}case"github_list_pr_files":{let{owner:t,repo:n,number:i}=a;if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and number are required"});let e=await u(`/repos/${t}/${n}/pulls/${i}/files?per_page=100`);return JSON.stringify({total:e.length,files:e.map(r=>({filename:r.filename,status:r.status,additions:r.additions,deletions:r.deletions,patch:r.patch?.slice(0,3e3)}))})}case"github_list_pr_comments":{let{owner:t,repo:n,number:i}=a;if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and number are required"});let e=await u(`/repos/${t}/${n}/pulls/${i}/comments?per_page=50`),r=await u(`/repos/${t}/${n}/issues/${i}/comments?per_page=50`),s=[...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})),...r.map(o=>({type:"issue",user:o.user?.login,body:o.body?.slice(0,1e3),createdAt:o.created_at}))].sort((o,l)=>new Date(o.createdAt)-new Date(l.createdAt));return JSON.stringify({total:s.length,comments:s})}case"github_get_review_thread":{let{owner:t,repo:n,number:i,commentId:e}=a||{};if(!t||!n||!i||!e)return JSON.stringify({error:"owner, repo, number, and commentId are required"});let r=await u(`/repos/${t}/${n}/pulls/comments/${e}`),s=r.in_reply_to_id||r.id,o=[];try{o=await u(`/repos/${t}/${n}/pulls/${i}/comments?per_page=100`)}catch{o=[r]}(!Array.isArray(o)||o.length===0)&&(o=[r]);let l=o.filter(d=>d.id===s||d.in_reply_to_id===s).sort((d,h)=>new Date(d.created_at)-new Date(h.created_at)),c=l.length?l:[r],p=c.find(d=>d.id===s)||c[0];return JSON.stringify({rootCommentId:s,path:p.path,line:p.line??p.original_line??null,side:p.side||"RIGHT",diffHunk:typeof p.diff_hunk=="string"?p.diff_hunk.slice(0,3e3):null,commitId:p.commit_id||p.original_commit_id||null,notes:c.map(d=>({id:d.id,user:d.user?.login,body:(d.body||"").slice(0,4e3),createdAt:d.created_at,isRoot:d.id===s,url:d.html_url}))})}case"github_reply_review_thread":{let{owner:t,repo:n,number:i,commentId:e,body:r}=a||{};if(!t||!n||!i||!e||!r)return JSON.stringify({error:"owner, repo, number, commentId, and body are required"});let s=await u(`/repos/${t}/${n}/pulls/${i}/comments/${e}/replies`,{method:"POST",body:{body:String(r)}});return JSON.stringify({ok:!0,id:s.id,url:s.html_url,inReplyTo:s.in_reply_to_id})}case"github_reply_issue_comment":{let{owner:t,repo:n,number:i,body:e}=a||{};if(!t||!n||!i||!e)return JSON.stringify({error:"owner, repo, number, and body are required"});let r=await u(`/repos/${t}/${n}/issues/${i}/comments`,{method:"POST",body:{body:String(e)}});return JSON.stringify({ok:!0,id:r.id,url:r.html_url})}case"github_create_review":{let{owner:t,repo:n,number:i,body:e,event:r,comments:s}=a||{};if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and number are required"});let o=(r||"COMMENT").toUpperCase();if(!["COMMENT","APPROVE","REQUEST_CHANGES"].includes(o))return JSON.stringify({error:`event must be COMMENT, APPROVE, or REQUEST_CHANGES (got ${r})`});let l=Array.isArray(s)?s.filter(d=>d&&d.path&&d.body&&(d.line!=null||d.position!=null)).map(d=>{let h={path:d.path,body:String(d.body)};return d.line!=null?(h.line=Number(d.line),h.side=d.side==="LEFT"?"LEFT":"RIGHT"):h.position=Number(d.position),h}):[];if(o!=="APPROVE"&&!e&&l.length===0)return JSON.stringify({error:"a COMMENT or REQUEST_CHANGES review needs a body and/or inline comments"});let c={event:o};e&&(c.body=String(e)),l.length>0&&(c.comments=l);let p=await u(`/repos/${t}/${n}/pulls/${i}/reviews`,{method:"POST",body:c});return JSON.stringify({ok:!0,id:p.id,state:p.state,event:o,commentsPosted:l.length,url:p.html_url})}case"github_list_commits":{let{owner:t,repo:n,branch:i,path:e,limit:r}=a;if(!t||!n)return JSON.stringify({error:"owner and repo are required"});let s=`/repos/${t}/${n}/commits?per_page=${r||20}`;i&&(s+=`&sha=${encodeURIComponent(i)}`),e&&(s+=`&path=${encodeURIComponent(e)}`);let o=await u(s);return JSON.stringify({total:o.length,commits:o.map(l=>({sha:l.sha?.slice(0,8),fullSha:l.sha,message:l.commit?.message?.slice(0,300),author:l.commit?.author?.name,date:l.commit?.author?.date,url:l.html_url}))})}case"github_get_commit":{let{owner:t,repo:n,sha:i}=a;if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and sha are required"});let e=await u(`/repos/${t}/${n}/commits/${i}`);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(r=>({filename:r.filename,status:r.status,additions:r.additions,deletions:r.deletions,patch:r.patch?.slice(0,3e3)}))})}case"github_get_file":{let{owner:t,repo:n,path:i,ref:e}=a;if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and path are required"});let r=`/repos/${t}/${n}/contents/${encodeURIComponent(i)}`;e&&(r+=`?ref=${encodeURIComponent(e)}`);let s=await u(r);if(s.type!=="file")return Array.isArray(s)?JSON.stringify({type:"directory",path:i,entries:s.map(c=>({name:c.name,type:c.type,size:c.size,path:c.path}))}):JSON.stringify({error:`Not a file: ${s.type}`});let o=Buffer.from(s.content||"","base64").toString("utf-8"),l=o.length>2e4;return JSON.stringify({path:s.path,size:s.size,sha:s.sha?.slice(0,8),content:l?o.slice(0,2e4):o,truncated:l})}case"github_get_user":try{let t=await u("/installation/repositories?per_page=1");if(t.repositories&&t.repositories.length>0){let n=t.repositories[0],i=n.owner.login,e=n.owner.type,r=e==="Organization"?`/orgs/${i}`:`/users/${i}`,s=await u(r);return JSON.stringify({login:s.login,name:s.name||s.login,avatar:s.avatar_url,bio:s.bio||s.description,type:e,isOrg:e==="Organization",publicRepos:s.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 n=(await u("/installation/repositories?per_page=100")).repositories||[],i=new Map;for(let r of n)r.owner.type==="Organization"&&(i.has(r.owner.login)||i.set(r.owner.login,{login:r.owner.login,description:null,url:r.owner.url}));let e=Array.from(i.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 g=function(_){let S=_.replace(/^~(?=$|\/|\\)/,h);return s(S)},{owner:t,repo:n,destination:i}=a;if(!t||!n)return JSON.stringify({error:"owner and repo are required"});let{execSync:e}=await import("child_process"),{join:r,resolve:s}=await import("path"),{existsSync:o,mkdirSync:l}=await import("fs"),{homedir:c,platform:p}=await import("os"),{token:d}=await q("github"),h=c(),y=i?g(i):r(h,"zibby-repos"),f=r(y,n);if(l(y,{recursive:!0}),o(f))return JSON.stringify({error:`Directory ${f} already exists. Remove it first or use a different destination.`,existingPath:f});try{let _=`https://x-access-token:${d}@github.com/${t}/${n}.git`;e(`git clone ${_} "${f}"`,{stdio:"pipe"});let S=p()==="win32",m;return S?m=e(`dir "${f}"`,{encoding:"utf-8",shell:"cmd.exe"}):m=e(`ls -la "${f}"`,{encoding:"utf-8"}),JSON.stringify({success:!0,path:f,message:`Cloned ${t}/${n} to ${f}`,contents:m.split(`
44
45
  `).slice(0,30).join(`
45
- `),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 n=await this.handleToolCall("github_list_repos",{limit:200},{}),e=JSON.parse(n);if(e.error)return JSON.stringify(e);let r=t.toLowerCase(),s=e.repos.filter(o=>o.name.toLowerCase().includes(r)||o.fullName.toLowerCase().includes(r)||o.description&&o.description.toLowerCase().includes(r));return JSON.stringify({query:t,count:s.length,repos:s.slice(0,i||20)})}case"github_list_repos":{let{owner:t,type:i,sort:n,direction:e,limit:r,query:s}=a,o=100,u=r||200,c=[],p=m=>({name:m.name,fullName:m.full_name,private:m.private,description:m.description,language:m.language,defaultBranch:m.default_branch,updatedAt:m.updated_at,stars:m.stargazers_count,url:m.html_url,fullPath:m.full_name,webUrl:m.html_url,visibility:m.visibility||(m.private?"private":"public")}),l=m=>{if(!s)return!0;let w=String(s).toLowerCase();return m.name&&m.name.toLowerCase().includes(w)||m.fullName&&m.fullName.toLowerCase().includes(w)||m.description&&m.description.toLowerCase().includes(w)};if(!t){let m=1,w=!0;for(;w&&c.length<u;){let O=`/installation/repositories?per_page=${o}&page=${m}`,v=(await d(O)).repositories||[];if(v.length===0)break;c=c.concat(v),w=v.length===o,m++}let R=c.map(p).filter(l),$=R.slice(0,u),T=R.length>$.length,N=$.filter(O=>O.private).length,A=$.filter(O=>!O.private).length;return JSON.stringify({count:$.length,repos:$,truncated:T,privateCount:N,publicCount:A,message:`Found ${N} private and ${A} public repos`})}let g=await d(`/orgs/${t}`).then(()=>!0).catch(()=>!1),h=1,b=!0;for(;b&&c.length<u;){let m;g?m=`/orgs/${t}/repos?per_page=${o}&page=${h}&type=${i||"all"}&sort=${n||"updated"}&direction=${e||"desc"}`:m=`/users/${t}/repos?per_page=${o}&page=${h}&type=${i||"all"}&sort=${n||"updated"}&direction=${e||"desc"}`;let w=await d(m),R=Array.isArray(w)?w:[];if(R.length===0)break;c=c.concat(R),b=R.length===o,h++}let f=c.map(p).filter(l),_=f.slice(0,u),S=f.length>_.length;return JSON.stringify({count:_.length,repos:_,truncated:S})}case"github_create_pr":{let{owner:t,repo:i,head:n,title:e}=a||{};if(!t||!i||!n||!e)return JSON.stringify({error:"owner, repo, head (source branch), and title are required"});let r=a.base;if(!r)try{r=(await d(`/repos/${t}/${i}`)).default_branch||"main"}catch{r="main"}let s={title:String(e),head:String(n),base:String(r),body:a.body?String(a.body):"",draft:!!a.draft};try{let o=await d(`/repos/${t}/${i}/pulls`,{method:"POST",body:s});return JSON.stringify({success:!0,pr_url:o.html_url,number:o.number,branch:n,base:r,repo:`${t}/${i}`,provider:"github",draft:!!o.draft,state:o.state})}catch(o){let u=String(o.message||o);if(/GitHub API 422/.test(u))return JSON.stringify({success:!1,branch:n,base:r,repo:`${t}/${i}`,provider:"github",skippedReason:u});throw o}}case"github_create_issue":{let{owner:t,repo:i,title:n,body:e}=a;if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and title are required"});let r=await d(`/repos/${t}/${i}/issues`,{method:"POST",body:{title:n,body:e||""}});return JSON.stringify({number:r.number,url:r.html_url,title:r.title})}case"github_list_issues":{let{owner:t,repo:i,state:n,labels:e,since:r,assignee:s,sort:o,direction:u,limit:c}=a||{};if(!t||!i)return JSON.stringify({error:"owner and repo are required"});let p=new URLSearchParams;p.set("state",n||"open"),p.set("per_page",String(c||30)),p.set("sort",o||"updated"),p.set("direction",u||"desc"),e&&p.set("labels",Array.isArray(e)?e.join(","):e),r&&p.set("since",r),s&&p.set("assignee",s);let l=await d(`/repos/${t}/${i}/issues?${p.toString()}`),g=(Array.isArray(l)?l:[]).filter(h=>!h.pull_request).map(h=>({number:h.number,title:h.title,state:h.state,labels:(h.labels||[]).map(b=>typeof b=="string"?b:b.name),assignee:h.assignee?.login||null,assignees:(h.assignees||[]).map(b=>b.login),user:h.user?.login,comments:h.comments,url:h.html_url,createdAt:h.created_at,updatedAt:h.updated_at}));return JSON.stringify({count:g.length,issues:g})}case"github_get_issue":{let{owner:t,repo:i,number:n}=a||{};if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and number are required"});let e=await d(`/repos/${t}/${i}/issues/${n}`);return e.pull_request?JSON.stringify({error:`#${n} 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(r=>typeof r=="string"?r:r.name),assignee:e.assignee?.login||null,assignees:(e.assignees||[]).map(r=>r.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:n,limit:e}=a||{};if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and number are required"});let r=await d(`/repos/${t}/${i}/issues/${n}/comments?per_page=${e||100}`),s=(Array.isArray(r)?r:[]).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:s.length,comments:s})}case"github_add_issue_comment":{let{owner:t,repo:i,number:n,body:e}=a||{};if(!t||!i||!n||!e)return JSON.stringify({error:"owner, repo, number, and body are required"});let r=await d(`/repos/${t}/${i}/issues/${n}/comments`,{method:"POST",body:{body:e}});return JSON.stringify({ok:!0,id:r.id,url:r.html_url})}case"github_close_issue":{let{owner:t,repo:i,number:n,stateReason:e}=a||{};if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and number are required"});let r={state:"closed"};e&&(r.state_reason=e);let s=await d(`/repos/${t}/${i}/issues/${n}`,{method:"PATCH",body:r});return JSON.stringify({ok:!0,number:s.number,state:s.state,stateReason:s.state_reason||null,url:s.html_url})}case"github_reopen_issue":{let{owner:t,repo:i,number:n}=a||{};if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and number are required"});let e=await d(`/repos/${t}/${i}/issues/${n}`,{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:n,labels:e,mode:r}=a||{};if(!t||!i||!n)return JSON.stringify({error:"owner, repo, and number are required"});let s=Array.isArray(e)?e:e?[e]:[];if(!s.length)return JSON.stringify({error:"labels (string or array) is required"});let o=r||"add";if(o==="set"){let c=await d(`/repos/${t}/${i}/issues/${n}`,{method:"PATCH",body:{labels:s}});return JSON.stringify({ok:!0,number:c.number,labels:(c.labels||[]).map(p=>typeof p=="string"?p:p.name)})}if(o==="remove"){for(let p of s)await d(`/repos/${t}/${i}/issues/${n}/labels/${encodeURIComponent(p)}`,{method:"DELETE"});let c=await d(`/repos/${t}/${i}/issues/${n}`);return JSON.stringify({ok:!0,number:c.number,labels:(c.labels||[]).map(p=>typeof p=="string"?p:p.name)})}let u=await d(`/repos/${t}/${i}/issues/${n}/labels`,{method:"POST",body:{labels:s}});return JSON.stringify({ok:!0,number:n,labels:(Array.isArray(u)?u:[]).map(c=>typeof c=="string"?c:c.name)})}default:return JSON.stringify({error:`Unknown tool: ${y}`})}}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 the repositories this token/installation can access (omit owner) \u2014 or a specific user/org's repos (pass owner). Use this to discover a RELATED repo worth cloning when a change's correctness depends on another accessible repo. Each repo carries a normalized { fullPath, name, webUrl, defaultBranch, visibility } shape (identical to gitlab_list_projects) alongside legacy fields, plus a truncated flag.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Org or user login. Omit to list every repo your token/installation can access."},query:{type:"string",description:"Optional term matched against repo name/full-name/description"},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: 200, hard-capped at the fetch ceiling)"}}}},{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_get_review_thread",description:"Read a PR review-comment THREAD given any comment id in it: the root review comment + all its replies, plus the anchored diff context (file, line, the original diff hunk). Use this to understand a human's reply to a previous review comment before replying in-thread.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"PR number"},commentId:{type:"number",description:"Any review-comment id in the thread (the root or any reply)"}},required:["owner","repo","number","commentId"]}},{name:"github_reply_review_thread",description:"Reply IN-THREAD to an existing PR review-comment thread (a conversational reply nested under the thread the human commented on \u2014 NOT a fresh full review). Pass any comment id in the thread.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"PR number"},commentId:{type:"number",description:"Any review-comment id in the thread to reply to"},body:{type:"string",description:"The reply text (markdown)"}},required:["owner","repo","number","commentId","body"]}},{name:"github_reply_issue_comment",description:"Post a reply on a PR's top-level conversation (a new issue comment on the PR). Use when the human replied to a non-inline/summary comment rather than an inline review thread. Quote or @-mention for context since issue comments are not threaded.",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 reply text (markdown)"}},required:["owner","repo","number","body"]}},{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_pr",description:"Open a pull request on GitHub (POST /repos/{owner}/{repo}/pulls). The head (source) branch must already be pushed. Returns the REAL pr_url from GitHub \u2014 never fabricate a PR url. Expected business outcomes (no commits between base and head, a PR already exists for this branch, base==head, missing head) return { success:false, skippedReason } rather than erroring.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},head:{type:"string",description:'Source branch to merge FROM (must already be pushed). For a cross-fork PR use "fork-owner:branch".'},base:{type:"string",description:"Target branch to merge INTO (default: the repo's default branch)"},title:{type:"string",description:"PR title"},body:{type:"string",description:"PR description (markdown)"},draft:{type:"boolean",description:"Open as a draft PR (default: false)"}},required:["owner","repo","head","title"]}},{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{F as githubSkill};
46
+ `),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:n}=a;if(!t)return JSON.stringify({error:"query is required"});let i=await this.handleToolCall("github_list_repos",{limit:200},{}),e=JSON.parse(i);if(e.error)return JSON.stringify(e);let r=t.toLowerCase(),s=e.repos.filter(o=>o.name.toLowerCase().includes(r)||o.fullName.toLowerCase().includes(r)||o.description&&o.description.toLowerCase().includes(r));return JSON.stringify({query:t,count:s.length,repos:s.slice(0,n||20)})}case"github_list_repos":{let{owner:t,type:n,sort:i,direction:e,limit:r,query:s}=a,o=100,l=r||200,c=[],p=m=>({name:m.name,fullName:m.full_name,private:m.private,description:m.description,language:m.language,defaultBranch:m.default_branch,updatedAt:m.updated_at,stars:m.stargazers_count,url:m.html_url,fullPath:m.full_name,webUrl:m.html_url,visibility:m.visibility||(m.private?"private":"public")}),d=m=>{if(!s)return!0;let w=String(s).toLowerCase();return m.name&&m.name.toLowerCase().includes(w)||m.fullName&&m.fullName.toLowerCase().includes(w)||m.description&&m.description.toLowerCase().includes(w)};if(!t){let m=1,w=!0;for(;w&&c.length<l;){let O=`/installation/repositories?per_page=${o}&page=${m}`,v=(await u(O)).repositories||[];if(v.length===0)break;c=c.concat(v),w=v.length===o,m++}let R=c.map(p).filter(d),$=R.slice(0,l),T=R.length>$.length,N=$.filter(O=>O.private).length,A=$.filter(O=>!O.private).length;return JSON.stringify({count:$.length,repos:$,truncated:T,privateCount:N,publicCount:A,message:`Found ${N} private and ${A} public repos`})}let h=await u(`/orgs/${t}`).then(()=>!0).catch(()=>!1),g=1,y=!0;for(;y&&c.length<l;){let m;h?m=`/orgs/${t}/repos?per_page=${o}&page=${g}&type=${n||"all"}&sort=${i||"updated"}&direction=${e||"desc"}`:m=`/users/${t}/repos?per_page=${o}&page=${g}&type=${n||"all"}&sort=${i||"updated"}&direction=${e||"desc"}`;let w=await u(m),R=Array.isArray(w)?w:[];if(R.length===0)break;c=c.concat(R),y=R.length===o,g++}let f=c.map(p).filter(d),_=f.slice(0,l),S=f.length>_.length;return JSON.stringify({count:_.length,repos:_,truncated:S})}case"github_create_pr":{let{owner:t,repo:n,head:i,title:e}=a||{};if(!t||!n||!i||!e)return JSON.stringify({error:"owner, repo, head (source branch), and title are required"});let r=a.base;if(!r)try{r=(await u(`/repos/${t}/${n}`)).default_branch||"main"}catch{r="main"}let s={title:String(e),head:String(i),base:String(r),body:a.body?String(a.body):"",draft:!!a.draft};try{let o=await u(`/repos/${t}/${n}/pulls`,{method:"POST",body:s});return JSON.stringify({success:!0,pr_url:o.html_url,number:o.number,branch:i,base:r,repo:`${t}/${n}`,provider:"github",draft:!!o.draft,state:o.state})}catch(o){let l=String(o.message||o);if(/GitHub API 422/.test(l))return JSON.stringify({success:!1,branch:i,base:r,repo:`${t}/${n}`,provider:"github",skippedReason:l});throw o}}case"github_merge_pr":{let{owner:t,repo:n,number:i}=a||{};if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and number are required"});let e=a.mergeMethod||"squash";if(!["merge","squash","rebase"].includes(e))return JSON.stringify({error:`mergeMethod must be merge, squash, or rebase (got ${e})`});let r={merge_method:e};a.commitTitle&&(r.commit_title=String(a.commitTitle)),a.commitMessage&&(r.commit_message=String(a.commitMessage));try{let s=await u(`/repos/${t}/${n}/pulls/${i}/merge`,{method:"PUT",body:r});return JSON.stringify({success:!0,merged:!0,sha:s.sha,number:i,provider:"github"})}catch(s){let o=String(s.message||s);if(/GitHub API (405|409|404)/.test(o))return JSON.stringify({success:!1,number:i,provider:"github",skippedReason:o});throw s}}case"github_create_issue":{let{owner:t,repo:n,title:i,body:e}=a;if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and title are required"});let r=await u(`/repos/${t}/${n}/issues`,{method:"POST",body:{title:i,body:e||""}});return JSON.stringify({number:r.number,url:r.html_url,title:r.title})}case"github_list_issues":{let{owner:t,repo:n,state:i,labels:e,since:r,assignee:s,sort:o,direction:l,limit:c}=a||{};if(!t||!n)return JSON.stringify({error:"owner and repo are required"});let p=new URLSearchParams;p.set("state",i||"open"),p.set("per_page",String(c||30)),p.set("sort",o||"updated"),p.set("direction",l||"desc"),e&&p.set("labels",Array.isArray(e)?e.join(","):e),r&&p.set("since",r),s&&p.set("assignee",s);let d=await u(`/repos/${t}/${n}/issues?${p.toString()}`),h=(Array.isArray(d)?d:[]).filter(g=>!g.pull_request).map(g=>({number:g.number,title:g.title,state:g.state,labels:(g.labels||[]).map(y=>typeof y=="string"?y:y.name),assignee:g.assignee?.login||null,assignees:(g.assignees||[]).map(y=>y.login),user:g.user?.login,comments:g.comments,url:g.html_url,createdAt:g.created_at,updatedAt:g.updated_at}));return JSON.stringify({count:h.length,issues:h})}case"github_get_issue":{let{owner:t,repo:n,number:i}=a||{};if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and number are required"});let e=await u(`/repos/${t}/${n}/issues/${i}`);return e.pull_request?JSON.stringify({error:`#${i} 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(r=>typeof r=="string"?r:r.name),assignee:e.assignee?.login||null,assignees:(e.assignees||[]).map(r=>r.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:n,number:i,limit:e}=a||{};if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and number are required"});let r=await u(`/repos/${t}/${n}/issues/${i}/comments?per_page=${e||100}`),s=(Array.isArray(r)?r:[]).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:s.length,comments:s})}case"github_add_issue_comment":{let{owner:t,repo:n,number:i,body:e}=a||{};if(!t||!n||!i||!e)return JSON.stringify({error:"owner, repo, number, and body are required"});let r=await u(`/repos/${t}/${n}/issues/${i}/comments`,{method:"POST",body:{body:e}});return JSON.stringify({ok:!0,id:r.id,url:r.html_url})}case"github_close_issue":{let{owner:t,repo:n,number:i,stateReason:e}=a||{};if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and number are required"});let r={state:"closed"};e&&(r.state_reason=e);let s=await u(`/repos/${t}/${n}/issues/${i}`,{method:"PATCH",body:r});return JSON.stringify({ok:!0,number:s.number,state:s.state,stateReason:s.state_reason||null,url:s.html_url})}case"github_reopen_issue":{let{owner:t,repo:n,number:i}=a||{};if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and number are required"});let e=await u(`/repos/${t}/${n}/issues/${i}`,{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:n,number:i,labels:e,mode:r}=a||{};if(!t||!n||!i)return JSON.stringify({error:"owner, repo, and number are required"});let s=Array.isArray(e)?e:e?[e]:[];if(!s.length)return JSON.stringify({error:"labels (string or array) is required"});let o=r||"add";if(o==="set"){let c=await u(`/repos/${t}/${n}/issues/${i}`,{method:"PATCH",body:{labels:s}});return JSON.stringify({ok:!0,number:c.number,labels:(c.labels||[]).map(p=>typeof p=="string"?p:p.name)})}if(o==="remove"){for(let p of s)await u(`/repos/${t}/${n}/issues/${i}/labels/${encodeURIComponent(p)}`,{method:"DELETE"});let c=await u(`/repos/${t}/${n}/issues/${i}`);return JSON.stringify({ok:!0,number:c.number,labels:(c.labels||[]).map(p=>typeof p=="string"?p:p.name)})}let l=await u(`/repos/${t}/${n}/issues/${i}/labels`,{method:"POST",body:{labels:s}});return JSON.stringify({ok:!0,number:i,labels:(Array.isArray(l)?l:[]).map(c=>typeof c=="string"?c:c.name)})}default:return JSON.stringify({error:`Unknown tool: ${b}`})}}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 the repositories this token/installation can access (omit owner) \u2014 or a specific user/org's repos (pass owner). Use this to discover a RELATED repo worth cloning when a change's correctness depends on another accessible repo. Each repo carries a normalized { fullPath, name, webUrl, defaultBranch, visibility } shape (identical to gitlab_list_projects) alongside legacy fields, plus a truncated flag.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Org or user login. Omit to list every repo your token/installation can access."},query:{type:"string",description:"Optional term matched against repo name/full-name/description"},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: 200, hard-capped at the fetch ceiling)"}}}},{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_get_review_thread",description:"Read a PR review-comment THREAD given any comment id in it: the root review comment + all its replies, plus the anchored diff context (file, line, the original diff hunk). Use this to understand a human's reply to a previous review comment before replying in-thread.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"PR number"},commentId:{type:"number",description:"Any review-comment id in the thread (the root or any reply)"}},required:["owner","repo","number","commentId"]}},{name:"github_reply_review_thread",description:"Reply IN-THREAD to an existing PR review-comment thread (a conversational reply nested under the thread the human commented on \u2014 NOT a fresh full review). Pass any comment id in the thread.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"PR number"},commentId:{type:"number",description:"Any review-comment id in the thread to reply to"},body:{type:"string",description:"The reply text (markdown)"}},required:["owner","repo","number","commentId","body"]}},{name:"github_reply_issue_comment",description:"Post a reply on a PR's top-level conversation (a new issue comment on the PR). Use when the human replied to a non-inline/summary comment rather than an inline review thread. Quote or @-mention for context since issue comments are not threaded.",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 reply text (markdown)"}},required:["owner","repo","number","body"]}},{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_pr",description:"Open a pull request on GitHub (POST /repos/{owner}/{repo}/pulls). The head (source) branch must already be pushed. Returns the REAL pr_url from GitHub \u2014 never fabricate a PR url. Expected business outcomes (no commits between base and head, a PR already exists for this branch, base==head, missing head) return { success:false, skippedReason } rather than erroring.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},head:{type:"string",description:'Source branch to merge FROM (must already be pushed). For a cross-fork PR use "fork-owner:branch".'},base:{type:"string",description:"Target branch to merge INTO (default: the repo's default branch)"},title:{type:"string",description:"PR title"},body:{type:"string",description:"PR description (markdown)"},draft:{type:"boolean",description:"Open as a draft PR (default: false)"}},required:["owner","repo","head","title"]}},{name:"github_merge_pr",description:"Merge a pull request on GitHub (PUT /repos/{owner}/{repo}/pulls/{number}/merge). mergeMethod is merge | squash | rebase (default squash). Returns { success:true, merged:true, sha } with the REAL merge SHA from GitHub. Expected non-mergeable outcomes (405 = draft / failing checks / branch protection, 409 = head sha moved / conflict, 404 = not found) return { success:false, skippedReason } rather than erroring.",input_schema:{type:"object",properties:{owner:{type:"string",description:"Repository owner"},repo:{type:"string",description:"Repository name"},number:{type:"number",description:"PR number to merge"},mergeMethod:{type:"string",enum:["merge","squash","rebase"],description:"How to merge (default: squash)"},commitTitle:{type:"string",description:"Title for the merge/squash commit (optional)"},commitMessage:{type:"string",description:"Body for the merge/squash commit (optional)"}},required:["owner","repo","number"]}},{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{F as githubSkill};
package/dist/gitlab.d.ts CHANGED
@@ -61,6 +61,9 @@ export namespace gitlabSkill {
61
61
  title?: undefined;
62
62
  description?: undefined;
63
63
  iid?: undefined;
64
+ squash?: undefined;
65
+ mergeCommitMessage?: undefined;
66
+ mergeWhenPipelineSucceeds?: undefined;
64
67
  state?: undefined;
65
68
  targetBranch?: undefined;
66
69
  sourceBranch?: undefined;
@@ -112,6 +115,9 @@ export namespace gitlabSkill {
112
115
  title?: undefined;
113
116
  description?: undefined;
114
117
  iid?: undefined;
118
+ squash?: undefined;
119
+ mergeCommitMessage?: undefined;
120
+ mergeWhenPipelineSucceeds?: undefined;
115
121
  state?: undefined;
116
122
  targetBranch?: undefined;
117
123
  sourceBranch?: undefined;
@@ -166,6 +172,66 @@ export namespace gitlabSkill {
166
172
  branch?: undefined;
167
173
  destination?: undefined;
168
174
  iid?: undefined;
175
+ squash?: undefined;
176
+ mergeCommitMessage?: undefined;
177
+ mergeWhenPipelineSucceeds?: undefined;
178
+ state?: undefined;
179
+ targetBranch?: undefined;
180
+ sourceBranch?: undefined;
181
+ authorUsername?: undefined;
182
+ labels?: undefined;
183
+ search?: undefined;
184
+ orderBy?: undefined;
185
+ sort?: undefined;
186
+ body?: undefined;
187
+ path?: undefined;
188
+ oldPath?: undefined;
189
+ newLine?: undefined;
190
+ oldLine?: undefined;
191
+ diffRefs?: undefined;
192
+ comments?: undefined;
193
+ discussionId?: undefined;
194
+ assigneeUsername?: undefined;
195
+ updatedAfter?: undefined;
196
+ };
197
+ required: string[];
198
+ };
199
+ } | {
200
+ name: string;
201
+ description: string;
202
+ input_schema: {
203
+ type: string;
204
+ properties: {
205
+ project: {
206
+ type: string;
207
+ description: string;
208
+ };
209
+ iid: {
210
+ type: string;
211
+ description: string;
212
+ };
213
+ squash: {
214
+ type: string;
215
+ description: string;
216
+ };
217
+ mergeCommitMessage: {
218
+ type: string;
219
+ description: string;
220
+ };
221
+ mergeWhenPipelineSucceeds: {
222
+ type: string;
223
+ description: string;
224
+ };
225
+ query?: undefined;
226
+ limit?: undefined;
227
+ projectPath?: undefined;
228
+ projectId?: undefined;
229
+ branch?: undefined;
230
+ destination?: undefined;
231
+ source_branch?: undefined;
232
+ target_branch?: undefined;
233
+ title?: undefined;
234
+ description?: undefined;
169
235
  state?: undefined;
170
236
  targetBranch?: undefined;
171
237
  sourceBranch?: undefined;
@@ -211,6 +277,9 @@ export namespace gitlabSkill {
211
277
  target_branch?: undefined;
212
278
  title?: undefined;
213
279
  description?: undefined;
280
+ squash?: undefined;
281
+ mergeCommitMessage?: undefined;
282
+ mergeWhenPipelineSucceeds?: undefined;
214
283
  state?: undefined;
215
284
  targetBranch?: undefined;
216
285
  sourceBranch?: undefined;
@@ -294,6 +363,9 @@ export namespace gitlabSkill {
294
363
  title?: undefined;
295
364
  description?: undefined;
296
365
  iid?: undefined;
366
+ squash?: undefined;
367
+ mergeCommitMessage?: undefined;
368
+ mergeWhenPipelineSucceeds?: undefined;
297
369
  body?: undefined;
298
370
  path?: undefined;
299
371
  oldPath?: undefined;
@@ -334,6 +406,9 @@ export namespace gitlabSkill {
334
406
  target_branch?: undefined;
335
407
  title?: undefined;
336
408
  description?: undefined;
409
+ squash?: undefined;
410
+ mergeCommitMessage?: undefined;
411
+ mergeWhenPipelineSucceeds?: undefined;
337
412
  state?: undefined;
338
413
  targetBranch?: undefined;
339
414
  sourceBranch?: undefined;
@@ -383,6 +458,9 @@ export namespace gitlabSkill {
383
458
  target_branch?: undefined;
384
459
  title?: undefined;
385
460
  description?: undefined;
461
+ squash?: undefined;
462
+ mergeCommitMessage?: undefined;
463
+ mergeWhenPipelineSucceeds?: undefined;
386
464
  state?: undefined;
387
465
  targetBranch?: undefined;
388
466
  sourceBranch?: undefined;
@@ -451,6 +529,9 @@ export namespace gitlabSkill {
451
529
  target_branch?: undefined;
452
530
  title?: undefined;
453
531
  description?: undefined;
532
+ squash?: undefined;
533
+ mergeCommitMessage?: undefined;
534
+ mergeWhenPipelineSucceeds?: undefined;
454
535
  state?: undefined;
455
536
  targetBranch?: undefined;
456
537
  sourceBranch?: undefined;
@@ -528,6 +609,9 @@ export namespace gitlabSkill {
528
609
  target_branch?: undefined;
529
610
  title?: undefined;
530
611
  description?: undefined;
612
+ squash?: undefined;
613
+ mergeCommitMessage?: undefined;
614
+ mergeWhenPipelineSucceeds?: undefined;
531
615
  state?: undefined;
532
616
  targetBranch?: undefined;
533
617
  sourceBranch?: undefined;
@@ -574,6 +658,9 @@ export namespace gitlabSkill {
574
658
  target_branch?: undefined;
575
659
  title?: undefined;
576
660
  description?: undefined;
661
+ squash?: undefined;
662
+ mergeCommitMessage?: undefined;
663
+ mergeWhenPipelineSucceeds?: undefined;
577
664
  state?: undefined;
578
665
  targetBranch?: undefined;
579
666
  sourceBranch?: undefined;
@@ -626,6 +713,9 @@ export namespace gitlabSkill {
626
713
  target_branch?: undefined;
627
714
  title?: undefined;
628
715
  description?: undefined;
716
+ squash?: undefined;
717
+ mergeCommitMessage?: undefined;
718
+ mergeWhenPipelineSucceeds?: undefined;
629
719
  state?: undefined;
630
720
  targetBranch?: undefined;
631
721
  sourceBranch?: undefined;
@@ -707,6 +797,9 @@ export namespace gitlabSkill {
707
797
  title?: undefined;
708
798
  description?: undefined;
709
799
  iid?: undefined;
800
+ squash?: undefined;
801
+ mergeCommitMessage?: undefined;
802
+ mergeWhenPipelineSucceeds?: undefined;
710
803
  targetBranch?: undefined;
711
804
  sourceBranch?: undefined;
712
805
  body?: undefined;