@zibby/skills 0.1.38 → 0.1.40

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/gitlab.d.ts CHANGED
@@ -38,6 +38,43 @@ export namespace gitlabSkill {
38
38
  };
39
39
  function handleToolCall(name: any, args: any): Promise<string>;
40
40
  let tools: ({
41
+ name: string;
42
+ description: string;
43
+ input_schema: {
44
+ type: string;
45
+ properties: {
46
+ query: {
47
+ type: string;
48
+ description: string;
49
+ };
50
+ limit: {
51
+ type: string;
52
+ description: string;
53
+ };
54
+ projectId?: undefined;
55
+ iid?: undefined;
56
+ state?: undefined;
57
+ targetBranch?: undefined;
58
+ sourceBranch?: undefined;
59
+ authorUsername?: undefined;
60
+ labels?: undefined;
61
+ search?: undefined;
62
+ orderBy?: undefined;
63
+ sort?: undefined;
64
+ body?: undefined;
65
+ path?: undefined;
66
+ oldPath?: undefined;
67
+ newLine?: undefined;
68
+ oldLine?: undefined;
69
+ diffRefs?: undefined;
70
+ comments?: undefined;
71
+ discussionId?: undefined;
72
+ assigneeUsername?: undefined;
73
+ updatedAfter?: undefined;
74
+ };
75
+ required?: undefined;
76
+ };
77
+ } | {
41
78
  name: string;
42
79
  description: string;
43
80
  input_schema: {
@@ -51,6 +88,8 @@ export namespace gitlabSkill {
51
88
  type: string;
52
89
  description: string;
53
90
  };
91
+ query?: undefined;
92
+ limit?: undefined;
54
93
  state?: undefined;
55
94
  targetBranch?: undefined;
56
95
  sourceBranch?: undefined;
@@ -59,7 +98,6 @@ export namespace gitlabSkill {
59
98
  search?: undefined;
60
99
  orderBy?: undefined;
61
100
  sort?: undefined;
62
- limit?: undefined;
63
101
  body?: undefined;
64
102
  path?: undefined;
65
103
  oldPath?: undefined;
@@ -67,6 +105,7 @@ export namespace gitlabSkill {
67
105
  oldLine?: undefined;
68
106
  diffRefs?: undefined;
69
107
  comments?: undefined;
108
+ discussionId?: undefined;
70
109
  assigneeUsername?: undefined;
71
110
  updatedAfter?: undefined;
72
111
  };
@@ -124,6 +163,7 @@ export namespace gitlabSkill {
124
163
  type: string;
125
164
  description: string;
126
165
  };
166
+ query?: undefined;
127
167
  iid?: undefined;
128
168
  body?: undefined;
129
169
  path?: undefined;
@@ -132,6 +172,7 @@ export namespace gitlabSkill {
132
172
  oldLine?: undefined;
133
173
  diffRefs?: undefined;
134
174
  comments?: undefined;
175
+ discussionId?: undefined;
135
176
  assigneeUsername?: undefined;
136
177
  updatedAfter?: undefined;
137
178
  };
@@ -155,6 +196,7 @@ export namespace gitlabSkill {
155
196
  type: string;
156
197
  description: string;
157
198
  };
199
+ query?: undefined;
158
200
  state?: undefined;
159
201
  targetBranch?: undefined;
160
202
  sourceBranch?: undefined;
@@ -170,6 +212,7 @@ export namespace gitlabSkill {
170
212
  oldLine?: undefined;
171
213
  diffRefs?: undefined;
172
214
  comments?: undefined;
215
+ discussionId?: undefined;
173
216
  assigneeUsername?: undefined;
174
217
  updatedAfter?: undefined;
175
218
  };
@@ -193,6 +236,8 @@ export namespace gitlabSkill {
193
236
  type: string;
194
237
  description: string;
195
238
  };
239
+ query?: undefined;
240
+ limit?: undefined;
196
241
  state?: undefined;
197
242
  targetBranch?: undefined;
198
243
  sourceBranch?: undefined;
@@ -201,13 +246,13 @@ export namespace gitlabSkill {
201
246
  search?: undefined;
202
247
  orderBy?: undefined;
203
248
  sort?: undefined;
204
- limit?: undefined;
205
249
  path?: undefined;
206
250
  oldPath?: undefined;
207
251
  newLine?: undefined;
208
252
  oldLine?: undefined;
209
253
  diffRefs?: undefined;
210
254
  comments?: undefined;
255
+ discussionId?: undefined;
211
256
  assigneeUsername?: undefined;
212
257
  updatedAfter?: undefined;
213
258
  };
@@ -251,6 +296,8 @@ export namespace gitlabSkill {
251
296
  type: string;
252
297
  description: string;
253
298
  };
299
+ query?: undefined;
300
+ limit?: undefined;
254
301
  state?: undefined;
255
302
  targetBranch?: undefined;
256
303
  sourceBranch?: undefined;
@@ -259,8 +306,8 @@ export namespace gitlabSkill {
259
306
  search?: undefined;
260
307
  orderBy?: undefined;
261
308
  sort?: undefined;
262
- limit?: undefined;
263
309
  comments?: undefined;
310
+ discussionId?: undefined;
264
311
  assigneeUsername?: undefined;
265
312
  updatedAfter?: undefined;
266
313
  };
@@ -318,6 +365,46 @@ export namespace gitlabSkill {
318
365
  required: string[];
319
366
  };
320
367
  };
368
+ query?: undefined;
369
+ limit?: undefined;
370
+ state?: undefined;
371
+ targetBranch?: undefined;
372
+ sourceBranch?: undefined;
373
+ authorUsername?: undefined;
374
+ labels?: undefined;
375
+ search?: undefined;
376
+ orderBy?: undefined;
377
+ sort?: undefined;
378
+ path?: undefined;
379
+ oldPath?: undefined;
380
+ newLine?: undefined;
381
+ oldLine?: undefined;
382
+ discussionId?: undefined;
383
+ assigneeUsername?: undefined;
384
+ updatedAfter?: undefined;
385
+ };
386
+ required: string[];
387
+ };
388
+ } | {
389
+ name: string;
390
+ description: string;
391
+ input_schema: {
392
+ type: string;
393
+ properties: {
394
+ projectId: {
395
+ type: string;
396
+ description: string;
397
+ };
398
+ iid: {
399
+ type: string;
400
+ description: string;
401
+ };
402
+ discussionId: {
403
+ type: string;
404
+ description: string;
405
+ };
406
+ query?: undefined;
407
+ limit?: undefined;
321
408
  state?: undefined;
322
409
  targetBranch?: undefined;
323
410
  sourceBranch?: undefined;
@@ -326,11 +413,56 @@ export namespace gitlabSkill {
326
413
  search?: undefined;
327
414
  orderBy?: undefined;
328
415
  sort?: undefined;
416
+ body?: undefined;
417
+ path?: undefined;
418
+ oldPath?: undefined;
419
+ newLine?: undefined;
420
+ oldLine?: undefined;
421
+ diffRefs?: undefined;
422
+ comments?: undefined;
423
+ assigneeUsername?: undefined;
424
+ updatedAfter?: undefined;
425
+ };
426
+ required: string[];
427
+ };
428
+ } | {
429
+ name: string;
430
+ description: string;
431
+ input_schema: {
432
+ type: string;
433
+ properties: {
434
+ projectId: {
435
+ type: string;
436
+ description: string;
437
+ };
438
+ iid: {
439
+ type: string;
440
+ description: string;
441
+ };
442
+ discussionId: {
443
+ type: string;
444
+ description: string;
445
+ };
446
+ body: {
447
+ type: string;
448
+ description: string;
449
+ };
450
+ query?: undefined;
329
451
  limit?: undefined;
452
+ state?: undefined;
453
+ targetBranch?: undefined;
454
+ sourceBranch?: undefined;
455
+ authorUsername?: undefined;
456
+ labels?: undefined;
457
+ search?: undefined;
458
+ orderBy?: undefined;
459
+ sort?: undefined;
330
460
  path?: undefined;
331
461
  oldPath?: undefined;
332
462
  newLine?: undefined;
333
463
  oldLine?: undefined;
464
+ diffRefs?: undefined;
465
+ comments?: undefined;
334
466
  assigneeUsername?: undefined;
335
467
  updatedAfter?: undefined;
336
468
  };
@@ -388,6 +520,7 @@ export namespace gitlabSkill {
388
520
  type: string;
389
521
  description: string;
390
522
  };
523
+ query?: undefined;
391
524
  iid?: undefined;
392
525
  targetBranch?: undefined;
393
526
  sourceBranch?: undefined;
@@ -398,6 +531,7 @@ export namespace gitlabSkill {
398
531
  oldLine?: undefined;
399
532
  diffRefs?: undefined;
400
533
  comments?: undefined;
534
+ discussionId?: undefined;
401
535
  };
402
536
  required: string[];
403
537
  };
package/dist/gitlab.js CHANGED
@@ -1,11 +1,16 @@
1
- import{existsSync as j}from"fs";import{fileURLToPath as A}from"url";import{dirname as I,resolve as L}from"path";var b=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"}),R=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"}});function w(){if(process.env.MCP_SKILL_PATH)return process.env.MCP_SKILL_PATH;let d=I(A(import.meta.url)),i=L(d,"..","bin","mcp-skill.mjs");return j(i)?i:null}function O(){let d=process.env.GITLAB_API_URL;if(d)return d.replace(/\/+$/,"");let i=(process.env.GITLAB_URL||process.env.GITLAB_INSTANCE_URL||"https://gitlab.com").trim().replace(/\/+$/,"");return/\/api\/v\d+$/.test(i)?i:`${i}/api/v4`}function N(){if(process.env.GITLAB_OAUTH_TOKEN)return{Authorization:`Bearer ${process.env.GITLAB_OAUTH_TOKEN}`};let d=process.env.GITLAB_TOKEN;if(!d)throw new Error("GitLab is not connected: set GITLAB_TOKEN (personal/project access token, api scope) or GITLAB_OAUTH_TOKEN.");return{"PRIVATE-TOKEN":d}}async function u(d,i={}){let r=/^https?:\/\//.test(d)?d:`${O()}${d}`,s={Accept:"application/json","User-Agent":"Zibby-App",...N(),...i.body?{"Content-Type":"application/json"}:{}},e=await fetch(r,{method:i.method||"GET",headers:s,body:i.body?JSON.stringify(i.body):void 0});if(!e.ok){let n=await e.text().catch(()=>"");throw new Error(`GitLab API ${e.status}: ${n.slice(0,300)}`)}return i.raw?e.text():e.json()}function h(d){let i=String(d);return/^\d+$/.test(i)?i:encodeURIComponent(i)}var G={id:"gitlab",serverName:"gitlab",allowedTools:["mcp__gitlab__*"],requiresIntegration:b.GITLAB,envKeys:["GITLAB_TOKEN","GITLAB_OAUTH_TOKEN","GITLAB_INSTANCE_URL","GITLAB_API_URL"],description:"GitLab \u2014 merge requests, diffs, MR reviews/discussions, issues",promptFragment:`## GitLab (connected)
1
+ import{existsSync as j}from"fs";import{fileURLToPath as I}from"url";import{dirname as w,resolve as A}from"path";var b=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"}),N=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"}});function L(){if(process.env.MCP_SKILL_PATH)return process.env.MCP_SKILL_PATH;let u=w(I(import.meta.url)),o=A(u,"..","bin","mcp-skill.mjs");return j(o)?o:null}function O(){let u=process.env.GITLAB_API_URL;if(u)return u.replace(/\/+$/,"");let o=(process.env.GITLAB_URL||process.env.GITLAB_INSTANCE_URL||"https://gitlab.com").trim().replace(/\/+$/,"");return/\/api\/v\d+$/.test(o)?o:`${o}/api/v4`}function R(){if(process.env.GITLAB_OAUTH_TOKEN)return{Authorization:`Bearer ${process.env.GITLAB_OAUTH_TOKEN}`};let u=process.env.GITLAB_TOKEN;if(!u)throw new Error("GitLab is not connected: set GITLAB_TOKEN (personal/project access token, api scope) or GITLAB_OAUTH_TOKEN.");return{"PRIVATE-TOKEN":u}}async function m(u,o={}){let t=/^https?:\/\//.test(u)?u:`${O()}${u}`,s={Accept:"application/json","User-Agent":"Zibby-App",...R(),...o.body?{"Content-Type":"application/json"}:{}},e=await fetch(t,{method:o.method||"GET",headers:s,body:o.body?JSON.stringify(o.body):void 0});if(!e.ok){let r=await e.text().catch(()=>"");throw new Error(`GitLab API ${e.status}: ${r.slice(0,300)}`)}return o.raw?e.text():e.json()}function g(u){let o=String(u);return/^\d+$/.test(o)?o:encodeURIComponent(o)}var G={id:"gitlab",serverName:"gitlab",allowedTools:["mcp__gitlab__*"],requiresIntegration:b.GITLAB,envKeys:["GITLAB_TOKEN","GITLAB_OAUTH_TOKEN","GITLAB_INSTANCE_URL","GITLAB_API_URL"],description:"GitLab \u2014 merge requests, diffs, MR reviews/discussions, issues",promptFragment:`## GitLab (connected)
2
2
  You have access to the user's GitLab projects via the REST API (cloud gitlab.com OR self-hosted). A "merge request" (MR) is GitLab's pull request. An MR is addressed by a PROJECT (numeric id OR full path like "group/repo") and an \`iid\` (the per-project MR number shown in the URL). For projects, prefer the full path form ("group/subgroup/repo") \u2014 it's what users have. Available tools:
3
3
 
4
+ ### Discovery
5
+ - gitlab_list_projects: List the projects this token can access (the ones you're a member of), optionally filtered by a search query. Use to find a RELATED project worth cloning for cross-repo context.
6
+
4
7
  ### Merge requests
5
8
  - gitlab_get_mr: Get an MR's details (title, description, author, source/target branch, state, web url, diff_refs)
6
9
  - gitlab_get_mr_changes: Get the MR's changed files with per-file diffs \u2014 THIS is the code to review
7
10
  - gitlab_list_mrs: List a project's merge requests (filter by state: opened|closed|merged|all)
8
11
  - gitlab_list_mr_notes: Get the discussion/notes thread on an MR
12
+ - gitlab_get_discussion: Read a single MR discussion (thread) by id \u2014 all its notes + the file/line it is anchored to
13
+ - gitlab_reply_discussion: Reply IN-THREAD to an existing MR discussion (conversational reply, not a new review)
9
14
  - gitlab_post_mr_note: Post a general (non-inline) comment on an MR
10
15
  - gitlab_post_mr_discussion: Post an INLINE review comment anchored to a file + line in the MR diff. Needs diff_refs (pass them from gitlab_get_mr / gitlab_get_mr_changes, or omit and the tool fetches them). Provide newLine for added/changed lines (or oldLine for removed/context lines).
11
16
 
@@ -16,4 +21,4 @@ You have access to the user's GitLab projects via the REST API (cloud gitlab.com
16
21
 
17
22
  ### Notes
18
23
  - A code-review flow is: gitlab_get_mr (context + diff_refs) \u2192 gitlab_get_mr_changes (the diff) \u2192 gitlab_post_mr_discussion per inline finding \u2192 gitlab_post_mr_note for the summary.
19
- - If an inline position is rejected by GitLab (bad line anchor), fall back to gitlab_post_mr_note with the file/line in the text.`,resolve(){let d=w();if(!d)return{command:null,args:[],env:{},description:this.description};let i={};for(let r of this.envKeys)process.env[r]&&(i[r]=process.env[r]);return{type:"stdio",command:"node",args:[d,"../dist/gitlab.js","gitlabSkill"],env:i,description:this.description,alwaysLoad:!0}},async handleToolCall(d,i){try{switch(d){case"gitlab_get_mr":{let{projectId:r,iid:s}=i||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await u(`/projects/${h(r)}/merge_requests/${s}`);return JSON.stringify({iid:e.iid,projectId:e.project_id,title:e.title,description:(e.description||"").slice(0,5e3),state:e.state,author:e.author?.username,sourceBranch:e.source_branch,targetBranch:e.target_branch,draft:e.draft??e.work_in_progress??!1,mergeStatus:e.merge_status,changesCount:e.changes_count,labels:Array.isArray(e.labels)?e.labels:[],webUrl:e.web_url,createdAt:e.created_at,updatedAt:e.updated_at,mergedAt:e.merged_at,diffRefs:e.diff_refs||null})}case"gitlab_get_mr_changes":{let{projectId:r,iid:s}=i||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await u(`/projects/${h(r)}/merge_requests/${s}/changes`),n=Array.isArray(e.changes)?e.changes:[];return JSON.stringify({iid:e.iid,total:n.length,diffRefs:e.diff_refs||null,files:n.map(o=>({oldPath:o.old_path,newPath:o.new_path,newFile:!!o.new_file,deletedFile:!!o.deleted_file,renamedFile:!!o.renamed_file,diff:typeof o.diff=="string"?o.diff.slice(0,3e3):""}))})}case"gitlab_list_mrs":{let{projectId:r,state:s,targetBranch:e,sourceBranch:n,authorUsername:o,labels:c,search:l,sort:f,orderBy:p,limit:m}=i||{};if(!r)return JSON.stringify({error:"projectId is required"});let t=new URLSearchParams;t.set("state",s||"opened"),t.set("per_page",String(m||20)),t.set("order_by",p||"updated_at"),t.set("sort",f||"desc"),e&&t.set("target_branch",e),n&&t.set("source_branch",n),o&&t.set("author_username",o),c&&t.set("labels",Array.isArray(c)?c.join(","):c),l&&t.set("search",l);let _=await u(`/projects/${h(r)}/merge_requests?${t.toString()}`),g=(Array.isArray(_)?_:[]).map(a=>({iid:a.iid,title:a.title,state:a.state,author:a.author?.username,sourceBranch:a.source_branch,targetBranch:a.target_branch,draft:a.draft??a.work_in_progress??!1,labels:Array.isArray(a.labels)?a.labels:[],webUrl:a.web_url,createdAt:a.created_at,updatedAt:a.updated_at}));return JSON.stringify({count:g.length,mergeRequests:g})}case"gitlab_list_mr_notes":{let{projectId:r,iid:s,limit:e}=i||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let n=await u(`/projects/${h(r)}/merge_requests/${s}/notes?per_page=${e||50}&sort=asc&order_by=created_at`);return JSON.stringify({total:Array.isArray(n)?n.length:0,notes:(Array.isArray(n)?n:[]).map(o=>({id:o.id,author:o.author?.username,body:(o.body||"").slice(0,1e3),system:!!o.system,createdAt:o.created_at}))})}case"gitlab_post_mr_note":{let{projectId:r,iid:s,body:e}=i||{};if(!r||!s||!e)return JSON.stringify({error:"projectId, iid, and body are required"});let n=await u(`/projects/${h(r)}/merge_requests/${s}/notes`,{method:"POST",body:{body:String(e)}});return JSON.stringify({ok:!0,id:n.id,createdAt:n.created_at})}case"gitlab_post_mr_discussion":{let{projectId:r,iid:s,path:e,oldPath:n,newLine:o,oldLine:c,body:l}=i||{};if(!r||!s||!e||!l)return JSON.stringify({error:"projectId, iid, path, and body are required"});if(o==null&&c==null)return JSON.stringify({error:"newLine (added/changed line) or oldLine (removed/context line) is required to anchor an inline comment"});let f=h(r),p=i.diffRefs||null;if(p||(p=(await u(`/projects/${f}/merge_requests/${s}`)).diff_refs||null),!p||!p.head_sha)return JSON.stringify({error:"could not resolve diff_refs for this MR \u2014 cannot anchor an inline comment. Use gitlab_post_mr_note instead."});let m={base_sha:p.base_sha,start_sha:p.start_sha,head_sha:p.head_sha,position_type:"text",new_path:e,old_path:n||e};o!=null&&(m.new_line=Number(o)),c!=null&&(m.old_line=Number(c));try{let t=await u(`/projects/${f}/merge_requests/${s}/discussions`,{method:"POST",body:{body:String(l),position:m}});return JSON.stringify({ok:!0,discussionId:t.id})}catch(t){return JSON.stringify({ok:!1,error:`inline anchor rejected (${t.message}). The line must be part of the MR diff. Fall back to gitlab_post_mr_note with the file/line in the text.`})}}case"gitlab_create_mr_review":{let{projectId:r,iid:s,body:e,comments:n}=i||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let o=h(r),c=Array.isArray(n)?n.filter(t=>t&&t.path&&t.body&&(t.newLine!=null||t.oldLine!=null)):[];if(!e&&c.length===0)return JSON.stringify({error:"a review needs a body and/or inline comments"});let l=i.diffRefs||null;c.length>0&&!l&&(l=(await u(`/projects/${o}/merge_requests/${s}`)).diff_refs||null);let f=!1;e&&(await u(`/projects/${o}/merge_requests/${s}/notes`,{method:"POST",body:{body:String(e)}}),f=!0);let p=0,m=[];if(c.length>0&&l)for(let t of c){let _={base_sha:l.base_sha,start_sha:l.start_sha,head_sha:l.head_sha,position_type:"text",new_path:t.path,old_path:t.oldPath||t.path};t.newLine!=null&&(_.new_line=Number(t.newLine)),t.oldLine!=null&&(_.old_line=Number(t.oldLine));try{await u(`/projects/${o}/merge_requests/${s}/discussions`,{method:"POST",body:{body:String(t.body),position:_}}),p+=1}catch(g){m.push(`${t.path}:${t.newLine??t.oldLine} \u2014 ${g.message}`)}}else c.length>0&&!l&&m.push("no diff_refs available \u2014 inline comments skipped (pass diffRefs from gitlab_get_mr)");return JSON.stringify({ok:!0,notePosted:f,inlinePosted:p,inlineErrors:m.length?m:void 0})}case"gitlab_list_issues":{let{projectId:r,state:s,labels:e,assigneeUsername:n,authorUsername:o,updatedAfter:c,search:l,sort:f,orderBy:p,limit:m}=i||{};if(!r)return JSON.stringify({error:"projectId is required"});let t=new URLSearchParams;t.set("state",s||"opened"),t.set("per_page",String(m||30)),t.set("order_by",p||"updated_at"),t.set("sort",f||"desc"),e&&t.set("labels",Array.isArray(e)?e.join(","):e),n&&t.set("assignee_username",n),o&&t.set("author_username",o),c&&t.set("updated_after",c),l&&t.set("search",l);let _=await u(`/projects/${h(r)}/issues?${t.toString()}`),g=(Array.isArray(_)?_:[]).map(a=>({iid:a.iid,title:a.title,state:a.state,labels:Array.isArray(a.labels)?a.labels:[],author:a.author?.username,assignees:(a.assignees||[]).map(y=>y.username),userNotesCount:a.user_notes_count,webUrl:a.web_url,createdAt:a.created_at,updatedAt:a.updated_at}));return JSON.stringify({count:g.length,issues:g})}case"gitlab_get_issue":{let{projectId:r,iid:s}=i||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await u(`/projects/${h(r)}/issues/${s}`);return JSON.stringify({iid:e.iid,projectId:e.project_id,title:e.title,description:(e.description||"").slice(0,5e3),state:e.state,labels:Array.isArray(e.labels)?e.labels:[],author:e.author?.username,assignees:(e.assignees||[]).map(n=>n.username),milestone:e.milestone?.title||null,webUrl:e.web_url,createdAt:e.created_at,updatedAt:e.updated_at,closedAt:e.closed_at})}case"gitlab_add_issue_comment":{let{projectId:r,iid:s,body:e}=i||{};if(!r||!s||!e)return JSON.stringify({error:"projectId, iid, and body are required"});let n=await u(`/projects/${h(r)}/issues/${s}/notes`,{method:"POST",body:{body:String(e)}});return JSON.stringify({ok:!0,id:n.id,createdAt:n.created_at})}default:return JSON.stringify({error:`Unknown tool: ${d}`})}}catch(r){return JSON.stringify({error:r.message})}},tools:[{name:"gitlab_get_mr",description:"Get a GitLab merge request \u2014 title, description, branches, state, author, web url, and diff_refs (needed to anchor inline review comments).",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},iid:{type:"number",description:"Merge request iid (the per-project MR number in the URL)"}},required:["projectId","iid"]}},{name:"gitlab_get_mr_changes",description:"Get the changed files of a GitLab merge request with per-file diffs \u2014 the actual code changes to review. Also returns diff_refs for inline comments.",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},iid:{type:"number",description:"Merge request iid"}},required:["projectId","iid"]}},{name:"gitlab_list_mrs",description:"List a GitLab project's merge requests, filtered by state and other criteria. Returns newest-updated first.",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},state:{type:"string",enum:["opened","closed","merged","locked","all"],description:"Filter by state (default: opened)"},targetBranch:{type:"string",description:"Filter by target branch"},sourceBranch:{type:"string",description:"Filter by source branch"},authorUsername:{type:"string",description:"Filter by author username"},labels:{type:"array",items:{type:"string"},description:"Only MRs carrying ALL of these labels"},search:{type:"string",description:"Search title and description"},orderBy:{type:"string",enum:["created_at","updated_at","title"],description:"Sort field (default: updated_at)"},sort:{type:"string",enum:["asc","desc"],description:"Sort direction (default: desc)"},limit:{type:"number",description:"Max MRs (default: 20)"}},required:["projectId"]}},{name:"gitlab_list_mr_notes",description:"List the discussion notes on a GitLab merge request (chronological).",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Merge request iid"},limit:{type:"number",description:"Max notes (default 50)"}},required:["projectId","iid"]}},{name:"gitlab_post_mr_note",description:"Post a general (non-inline) comment on a GitLab merge request. Use for a review summary or a top-level remark.",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Merge request iid"},body:{type:"string",description:"Comment body (markdown)"}},required:["projectId","iid","body"]}},{name:"gitlab_post_mr_discussion",description:"Post an INLINE review comment anchored to a file + line in a GitLab merge request diff. Provide newLine (added/changed line) or oldLine (removed/context line). Pass diffRefs from gitlab_get_mr/gitlab_get_mr_changes, or omit to have the tool fetch them. If the line anchor is rejected, fall back to gitlab_post_mr_note.",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Merge request iid"},path:{type:"string",description:"New file path as it appears in the diff"},oldPath:{type:"string",description:"Old file path (defaults to path)"},newLine:{type:"number",description:"Line number in the NEW version of the file (for added/changed lines)"},oldLine:{type:"number",description:"Line number in the OLD version (for removed/context lines)"},body:{type:"string",description:"The inline comment text (markdown)"},diffRefs:{type:"object",description:"The MR diff_refs ({ base_sha, start_sha, head_sha }) from gitlab_get_mr. Omit and the tool fetches them."}},required:["projectId","iid","path","body"]}},{name:"gitlab_create_mr_review",description:"Post a full review on a GitLab merge request in one call: a summary note plus optional inline comments anchored to file/line in the diff. Convenience wrapper over gitlab_post_mr_note + gitlab_post_mr_discussion.",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Merge request iid"},body:{type:"string",description:"The review summary (markdown). Posted as a top-level MR note."},diffRefs:{type:"object",description:"The MR diff_refs ({ base_sha, start_sha, head_sha }) from gitlab_get_mr \u2014 required to anchor inline comments. Omit and the tool fetches them."},comments:{type:"array",description:"Optional inline comments, each anchored to a changed line in a file.",items:{type:"object",properties:{path:{type:"string",description:"New file path as it appears in the diff"},oldPath:{type:"string",description:"Old file path (defaults to path)"},newLine:{type:"number",description:"Line number in the NEW version of the file (for added/changed lines)"},oldLine:{type:"number",description:"Line number in the OLD version (for removed/context lines)"},body:{type:"string",description:"The inline comment text (markdown)"}},required:["path","body"]}}},required:["projectId","iid"]}},{name:"gitlab_list_issues",description:"List a GitLab project's issues, filtered by state, labels, and an updatedAfter polling cursor. Returns newest-updated first.",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},state:{type:"string",enum:["opened","closed","all"],description:"Filter by state (default: opened)"},labels:{type:"array",items:{type:"string"},description:"Only issues carrying ALL of these labels"},assigneeUsername:{type:"string",description:"Filter by assignee username"},authorUsername:{type:"string",description:"Filter by author username"},updatedAfter:{type:"string",description:"ISO-8601 timestamp; only issues updated after this (polling cursor)"},search:{type:"string",description:"Search title and description"},orderBy:{type:"string",enum:["created_at","updated_at"],description:"Sort field (default: updated_at)"},sort:{type:"string",enum:["asc","desc"],description:"Sort direction (default: desc)"},limit:{type:"number",description:"Max issues (default: 30)"}},required:["projectId"]}},{name:"gitlab_get_issue",description:"Get a single GitLab issue with full detail (title, description, state, labels, assignees, web url).",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Issue iid (the per-project issue number in the URL)"}},required:["projectId","iid"]}},{name:"gitlab_add_issue_comment",description:"Add a comment to a GitLab issue. Also the way to record an MR link on a ticket (post a markdown link).",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Issue iid"},body:{type:"string",description:"Comment body (markdown)"}},required:["projectId","iid","body"]}}]};export{G as gitlabSkill,u as glFetch};
24
+ - If an inline position is rejected by GitLab (bad line anchor), fall back to gitlab_post_mr_note with the file/line in the text.`,resolve(){let u=L();if(!u)return{command:null,args:[],env:{},description:this.description};let o={};for(let t of this.envKeys)process.env[t]&&(o[t]=process.env[t]);return{type:"stdio",command:"node",args:[u,"../dist/gitlab.js","gitlabSkill"],env:o,description:this.description,alwaysLoad:!0}},async handleToolCall(u,o){try{switch(u){case"gitlab_get_mr":{let{projectId:t,iid:s}=o||{};if(!t||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await m(`/projects/${g(t)}/merge_requests/${s}`);return JSON.stringify({iid:e.iid,projectId:e.project_id,title:e.title,description:(e.description||"").slice(0,5e3),state:e.state,author:e.author?.username,sourceBranch:e.source_branch,targetBranch:e.target_branch,draft:e.draft??e.work_in_progress??!1,mergeStatus:e.merge_status,changesCount:e.changes_count,labels:Array.isArray(e.labels)?e.labels:[],webUrl:e.web_url,createdAt:e.created_at,updatedAt:e.updated_at,mergedAt:e.merged_at,diffRefs:e.diff_refs||null})}case"gitlab_get_mr_changes":{let{projectId:t,iid:s}=o||{};if(!t||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await m(`/projects/${g(t)}/merge_requests/${s}/changes`),r=Array.isArray(e.changes)?e.changes:[];return JSON.stringify({iid:e.iid,total:r.length,diffRefs:e.diff_refs||null,files:r.map(n=>({oldPath:n.old_path,newPath:n.new_path,newFile:!!n.new_file,deletedFile:!!n.deleted_file,renamedFile:!!n.renamed_file,diff:typeof n.diff=="string"?n.diff.slice(0,3e3):""}))})}case"gitlab_list_mrs":{let{projectId:t,state:s,targetBranch:e,sourceBranch:r,authorUsername:n,labels:c,search:a,sort:l,orderBy:p,limit:h}=o||{};if(!t)return JSON.stringify({error:"projectId is required"});let i=new URLSearchParams;i.set("state",s||"opened"),i.set("per_page",String(h||20)),i.set("order_by",p||"updated_at"),i.set("sort",l||"desc"),e&&i.set("target_branch",e),r&&i.set("source_branch",r),n&&i.set("author_username",n),c&&i.set("labels",Array.isArray(c)?c.join(","):c),a&&i.set("search",a);let _=await m(`/projects/${g(t)}/merge_requests?${i.toString()}`),f=(Array.isArray(_)?_:[]).map(d=>({iid:d.iid,title:d.title,state:d.state,author:d.author?.username,sourceBranch:d.source_branch,targetBranch:d.target_branch,draft:d.draft??d.work_in_progress??!1,labels:Array.isArray(d.labels)?d.labels:[],webUrl:d.web_url,createdAt:d.created_at,updatedAt:d.updated_at}));return JSON.stringify({count:f.length,mergeRequests:f})}case"gitlab_list_mr_notes":{let{projectId:t,iid:s,limit:e}=o||{};if(!t||!s)return JSON.stringify({error:"projectId and iid are required"});let r=await m(`/projects/${g(t)}/merge_requests/${s}/notes?per_page=${e||50}&sort=asc&order_by=created_at`);return JSON.stringify({total:Array.isArray(r)?r.length:0,notes:(Array.isArray(r)?r:[]).map(n=>({id:n.id,author:n.author?.username,body:(n.body||"").slice(0,1e3),system:!!n.system,createdAt:n.created_at}))})}case"gitlab_post_mr_note":{let{projectId:t,iid:s,body:e}=o||{};if(!t||!s||!e)return JSON.stringify({error:"projectId, iid, and body are required"});let r=await m(`/projects/${g(t)}/merge_requests/${s}/notes`,{method:"POST",body:{body:String(e)}});return JSON.stringify({ok:!0,id:r.id,createdAt:r.created_at})}case"gitlab_post_mr_discussion":{let{projectId:t,iid:s,path:e,oldPath:r,newLine:n,oldLine:c,body:a}=o||{};if(!t||!s||!e||!a)return JSON.stringify({error:"projectId, iid, path, and body are required"});if(n==null&&c==null)return JSON.stringify({error:"newLine (added/changed line) or oldLine (removed/context line) is required to anchor an inline comment"});let l=g(t),p=o.diffRefs||null;if(p||(p=(await m(`/projects/${l}/merge_requests/${s}`)).diff_refs||null),!p||!p.head_sha)return JSON.stringify({error:"could not resolve diff_refs for this MR \u2014 cannot anchor an inline comment. Use gitlab_post_mr_note instead."});let h={base_sha:p.base_sha,start_sha:p.start_sha,head_sha:p.head_sha,position_type:"text",new_path:e,old_path:r||e};n!=null&&(h.new_line=Number(n)),c!=null&&(h.old_line=Number(c));try{let i=await m(`/projects/${l}/merge_requests/${s}/discussions`,{method:"POST",body:{body:String(a),position:h}});return JSON.stringify({ok:!0,discussionId:i.id})}catch(i){return JSON.stringify({ok:!1,error:`inline anchor rejected (${i.message}). The line must be part of the MR diff. Fall back to gitlab_post_mr_note with the file/line in the text.`})}}case"gitlab_create_mr_review":{let{projectId:t,iid:s,body:e,comments:r}=o||{};if(!t||!s)return JSON.stringify({error:"projectId and iid are required"});let n=g(t),c=Array.isArray(r)?r.filter(i=>i&&i.path&&i.body&&(i.newLine!=null||i.oldLine!=null)):[];if(!e&&c.length===0)return JSON.stringify({error:"a review needs a body and/or inline comments"});let a=o.diffRefs||null;c.length>0&&!a&&(a=(await m(`/projects/${n}/merge_requests/${s}`)).diff_refs||null);let l=!1;e&&(await m(`/projects/${n}/merge_requests/${s}/notes`,{method:"POST",body:{body:String(e)}}),l=!0);let p=0,h=[];if(c.length>0&&a)for(let i of c){let _={base_sha:a.base_sha,start_sha:a.start_sha,head_sha:a.head_sha,position_type:"text",new_path:i.path,old_path:i.oldPath||i.path};i.newLine!=null&&(_.new_line=Number(i.newLine)),i.oldLine!=null&&(_.old_line=Number(i.oldLine));try{await m(`/projects/${n}/merge_requests/${s}/discussions`,{method:"POST",body:{body:String(i.body),position:_}}),p+=1}catch(f){h.push(`${i.path}:${i.newLine??i.oldLine} \u2014 ${f.message}`)}}else c.length>0&&!a&&h.push("no diff_refs available \u2014 inline comments skipped (pass diffRefs from gitlab_get_mr)");return JSON.stringify({ok:!0,notePosted:l,inlinePosted:p,inlineErrors:h.length?h:void 0})}case"gitlab_get_discussion":{let{projectId:t,iid:s,discussionId:e}=o||{};if(!t||!s||!e)return JSON.stringify({error:"projectId, iid, and discussionId are required"});let r=await m(`/projects/${g(t)}/merge_requests/${s}/discussions/${encodeURIComponent(e)}`),n=Array.isArray(r.notes)?r.notes:[],c=n.find(l=>l.position)||null,a=c?c.position:null;return JSON.stringify({discussionId:r.id,individualNote:!!r.individual_note,path:a&&(a.new_path||a.old_path)||null,newLine:a?a.new_line??null:null,oldLine:a?a.old_line??null:null,diffRefs:a?{base_sha:a.base_sha,start_sha:a.start_sha,head_sha:a.head_sha}:null,notes:n.map(l=>({id:l.id,author:l.author?.username,body:(l.body||"").slice(0,4e3),system:!!l.system,createdAt:l.created_at}))})}case"gitlab_reply_discussion":{let{projectId:t,iid:s,discussionId:e,body:r}=o||{};if(!t||!s||!e||!r)return JSON.stringify({error:"projectId, iid, discussionId, and body are required"});let n=await m(`/projects/${g(t)}/merge_requests/${s}/discussions/${encodeURIComponent(e)}/notes`,{method:"POST",body:{body:String(r)}});return JSON.stringify({ok:!0,id:n.id,createdAt:n.created_at})}case"gitlab_list_projects":{let{query:t,limit:s}=o||{},e=Math.min(Number(s)>0?Number(s):50,200),r=new URLSearchParams;r.set("membership","true"),r.set("simple","true"),r.set("order_by","last_activity_at"),r.set("sort","desc"),r.set("per_page",String(Math.min(e+1,100))),t&&r.set("search",String(t));let n=await m(`/projects?${r.toString()}`),c=Array.isArray(n)?n:[],a=c.length>e,l=c.slice(0,e).map(p=>({fullPath:p.path_with_namespace,name:p.name,webUrl:p.web_url,defaultBranch:p.default_branch||null,visibility:p.visibility||null}));return JSON.stringify({count:l.length,truncated:a,projects:l})}case"gitlab_list_issues":{let{projectId:t,state:s,labels:e,assigneeUsername:r,authorUsername:n,updatedAfter:c,search:a,sort:l,orderBy:p,limit:h}=o||{};if(!t)return JSON.stringify({error:"projectId is required"});let i=new URLSearchParams;i.set("state",s||"opened"),i.set("per_page",String(h||30)),i.set("order_by",p||"updated_at"),i.set("sort",l||"desc"),e&&i.set("labels",Array.isArray(e)?e.join(","):e),r&&i.set("assignee_username",r),n&&i.set("author_username",n),c&&i.set("updated_after",c),a&&i.set("search",a);let _=await m(`/projects/${g(t)}/issues?${i.toString()}`),f=(Array.isArray(_)?_:[]).map(d=>({iid:d.iid,title:d.title,state:d.state,labels:Array.isArray(d.labels)?d.labels:[],author:d.author?.username,assignees:(d.assignees||[]).map(y=>y.username),userNotesCount:d.user_notes_count,webUrl:d.web_url,createdAt:d.created_at,updatedAt:d.updated_at}));return JSON.stringify({count:f.length,issues:f})}case"gitlab_get_issue":{let{projectId:t,iid:s}=o||{};if(!t||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await m(`/projects/${g(t)}/issues/${s}`);return JSON.stringify({iid:e.iid,projectId:e.project_id,title:e.title,description:(e.description||"").slice(0,5e3),state:e.state,labels:Array.isArray(e.labels)?e.labels:[],author:e.author?.username,assignees:(e.assignees||[]).map(r=>r.username),milestone:e.milestone?.title||null,webUrl:e.web_url,createdAt:e.created_at,updatedAt:e.updated_at,closedAt:e.closed_at})}case"gitlab_add_issue_comment":{let{projectId:t,iid:s,body:e}=o||{};if(!t||!s||!e)return JSON.stringify({error:"projectId, iid, and body are required"});let r=await m(`/projects/${g(t)}/issues/${s}/notes`,{method:"POST",body:{body:String(e)}});return JSON.stringify({ok:!0,id:r.id,createdAt:r.created_at})}default:return JSON.stringify({error:`Unknown tool: ${u}`})}}catch(t){return JSON.stringify({error:t.message})}},tools:[{name:"gitlab_list_projects",description:"List the GitLab projects this token can access (the projects you are a member of), optionally filtered by a search query. Use this to discover a RELATED project worth cloning when a change's correctness depends on another accessible repo. Returns a normalized list of { fullPath, name, webUrl, defaultBranch, visibility } and a truncated flag.",input_schema:{type:"object",properties:{query:{type:"string",description:"Optional search term matched against project name/path"},limit:{type:"number",description:"Max projects (default 50, hard max 200)"}}}},{name:"gitlab_get_mr",description:"Get a GitLab merge request \u2014 title, description, branches, state, author, web url, and diff_refs (needed to anchor inline review comments).",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},iid:{type:"number",description:"Merge request iid (the per-project MR number in the URL)"}},required:["projectId","iid"]}},{name:"gitlab_get_mr_changes",description:"Get the changed files of a GitLab merge request with per-file diffs \u2014 the actual code changes to review. Also returns diff_refs for inline comments.",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},iid:{type:"number",description:"Merge request iid"}},required:["projectId","iid"]}},{name:"gitlab_list_mrs",description:"List a GitLab project's merge requests, filtered by state and other criteria. Returns newest-updated first.",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},state:{type:"string",enum:["opened","closed","merged","locked","all"],description:"Filter by state (default: opened)"},targetBranch:{type:"string",description:"Filter by target branch"},sourceBranch:{type:"string",description:"Filter by source branch"},authorUsername:{type:"string",description:"Filter by author username"},labels:{type:"array",items:{type:"string"},description:"Only MRs carrying ALL of these labels"},search:{type:"string",description:"Search title and description"},orderBy:{type:"string",enum:["created_at","updated_at","title"],description:"Sort field (default: updated_at)"},sort:{type:"string",enum:["asc","desc"],description:"Sort direction (default: desc)"},limit:{type:"number",description:"Max MRs (default: 20)"}},required:["projectId"]}},{name:"gitlab_list_mr_notes",description:"List the discussion notes on a GitLab merge request (chronological).",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Merge request iid"},limit:{type:"number",description:"Max notes (default 50)"}},required:["projectId","iid"]}},{name:"gitlab_post_mr_note",description:"Post a general (non-inline) comment on a GitLab merge request. Use for a review summary or a top-level remark.",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Merge request iid"},body:{type:"string",description:"Comment body (markdown)"}},required:["projectId","iid","body"]}},{name:"gitlab_post_mr_discussion",description:"Post an INLINE review comment anchored to a file + line in a GitLab merge request diff. Provide newLine (added/changed line) or oldLine (removed/context line). Pass diffRefs from gitlab_get_mr/gitlab_get_mr_changes, or omit to have the tool fetch them. If the line anchor is rejected, fall back to gitlab_post_mr_note.",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Merge request iid"},path:{type:"string",description:"New file path as it appears in the diff"},oldPath:{type:"string",description:"Old file path (defaults to path)"},newLine:{type:"number",description:"Line number in the NEW version of the file (for added/changed lines)"},oldLine:{type:"number",description:"Line number in the OLD version (for removed/context lines)"},body:{type:"string",description:"The inline comment text (markdown)"},diffRefs:{type:"object",description:"The MR diff_refs ({ base_sha, start_sha, head_sha }) from gitlab_get_mr. Omit and the tool fetches them."}},required:["projectId","iid","path","body"]}},{name:"gitlab_create_mr_review",description:"Post a full review on a GitLab merge request in one call: a summary note plus optional inline comments anchored to file/line in the diff. Convenience wrapper over gitlab_post_mr_note + gitlab_post_mr_discussion.",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Merge request iid"},body:{type:"string",description:"The review summary (markdown). Posted as a top-level MR note."},diffRefs:{type:"object",description:"The MR diff_refs ({ base_sha, start_sha, head_sha }) from gitlab_get_mr \u2014 required to anchor inline comments. Omit and the tool fetches them."},comments:{type:"array",description:"Optional inline comments, each anchored to a changed line in a file.",items:{type:"object",properties:{path:{type:"string",description:"New file path as it appears in the diff"},oldPath:{type:"string",description:"Old file path (defaults to path)"},newLine:{type:"number",description:"Line number in the NEW version of the file (for added/changed lines)"},oldLine:{type:"number",description:"Line number in the OLD version (for removed/context lines)"},body:{type:"string",description:"The inline comment text (markdown)"}},required:["path","body"]}}},required:["projectId","iid"]}},{name:"gitlab_get_discussion",description:"Read a single GitLab merge-request DISCUSSION (thread) by its discussion id: all notes in order plus the diff position (file + line) it is anchored to. Use this to understand a human's reply to a previous review discussion before replying in-thread.",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Merge request iid"},discussionId:{type:"string",description:"The discussion id (from the Note Hook payload or gitlab_list_mr_notes)"}},required:["projectId","iid","discussionId"]}},{name:"gitlab_reply_discussion",description:"Reply IN-THREAD to an existing GitLab merge-request discussion (a conversational reply appended to the SAME thread \u2014 NOT a fresh review). Use after gitlab_get_discussion to answer a human's reply to a review comment.",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Merge request iid"},discussionId:{type:"string",description:"The discussion id to reply to"},body:{type:"string",description:"The reply text (markdown)"}},required:["projectId","iid","discussionId","body"]}},{name:"gitlab_list_issues",description:"List a GitLab project's issues, filtered by state, labels, and an updatedAfter polling cursor. Returns newest-updated first.",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},state:{type:"string",enum:["opened","closed","all"],description:"Filter by state (default: opened)"},labels:{type:"array",items:{type:"string"},description:"Only issues carrying ALL of these labels"},assigneeUsername:{type:"string",description:"Filter by assignee username"},authorUsername:{type:"string",description:"Filter by author username"},updatedAfter:{type:"string",description:"ISO-8601 timestamp; only issues updated after this (polling cursor)"},search:{type:"string",description:"Search title and description"},orderBy:{type:"string",enum:["created_at","updated_at"],description:"Sort field (default: updated_at)"},sort:{type:"string",enum:["asc","desc"],description:"Sort direction (default: desc)"},limit:{type:"number",description:"Max issues (default: 30)"}},required:["projectId"]}},{name:"gitlab_get_issue",description:"Get a single GitLab issue with full detail (title, description, state, labels, assignees, web url).",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Issue iid (the per-project issue number in the URL)"}},required:["projectId","iid"]}},{name:"gitlab_add_issue_comment",description:"Add a comment to a GitLab issue. Also the way to record an MR link on a ticket (post a markdown link).",input_schema:{type:"object",properties:{projectId:{type:"string",description:"Project numeric id OR full path"},iid:{type:"number",description:"Issue iid"},body:{type:"string",description:"Comment body (markdown)"}},required:["projectId","iid","body"]}}]};export{G as gitlabSkill,m as glFetch};
package/dist/index.d.ts CHANGED
@@ -3,11 +3,13 @@ export namespace SKILLS {
3
3
  let JIRA: string;
4
4
  let GITHUB: string;
5
5
  let GITLAB: string;
6
+ let FIGMA: string;
6
7
  let LINEAR: string;
7
8
  let PLANE: string;
8
9
  let GIT: string;
9
10
  let SLACK: string;
10
11
  let LARK: string;
12
+ let NOTION: string;
11
13
  let CHAT_NOTIFY: string;
12
14
  let SENTRY: string;
13
15
  let MEMORY: string;
@@ -25,11 +27,13 @@ import { browserSkill } from './browser.js';
25
27
  import { jiraSkill } from './jira.js';
26
28
  import { githubSkill } from './github.js';
27
29
  import { gitlabSkill } from './gitlab.js';
30
+ import { figmaSkill } from './figma.js';
28
31
  import { linearSkill } from './linear.js';
29
32
  import { planeSkill } from './plane.js';
30
33
  import { gitSkill } from './git.js';
31
34
  import { slackSkill } from './slack.js';
32
35
  import { larkSkill } from './lark.js';
36
+ import { notionSkill } from './notion.js';
33
37
  import { chatNotifySkill } from './chat-notify.js';
34
38
  import { sentrySkill } from './sentry.js';
35
39
  import { memorySkill } from './memory.js';
@@ -39,7 +43,7 @@ import { testRunnerSkill } from './test-runner.js';
39
43
  import { skillInstallerSkill } from './skill-installer.js';
40
44
  import { coreToolsSkill } from './core-tools.js';
41
45
  import { workflowBuilderSkill } from './workflow-builder.js';
42
- export { browserSkill, jiraSkill, githubSkill, gitlabSkill, linearSkill, planeSkill, gitSkill, slackSkill, larkSkill, chatNotifySkill, sentrySkill, memorySkill, chatMemorySkill, reviewMemorySkill, testRunnerSkill, testRunnerSkill as runnerSkill, skillInstallerSkill, coreToolsSkill, workflowBuilderSkill };
46
+ export { browserSkill, jiraSkill, githubSkill, gitlabSkill, figmaSkill, linearSkill, planeSkill, gitSkill, slackSkill, larkSkill, notionSkill, chatNotifySkill, sentrySkill, memorySkill, chatMemorySkill, reviewMemorySkill, testRunnerSkill, testRunnerSkill as runnerSkill, skillInstallerSkill, coreToolsSkill, workflowBuilderSkill };
43
47
  export { openaiBillingSkill, anthropicBillingSkill, cursorAdminSkill, fetchOpenAICosts, fetchOpenAIProjects, fetchAnthropicCosts, fetchAnthropicWorkspaces, fetchCursorSpend, fetchAllProviders, groupByKey, meanStddev } from "./llm-billing.js";
44
48
  export { reportObjectSchema, reportToBlockKit, reportToLarkCard, SEVERITIES as REPORT_SEVERITIES } from "./report.js";
45
49
  export { skill, functionSkill } from "./function-skill.js";