@zibby/skills 0.1.95 → 0.2.0

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.
Files changed (78) hide show
  1. package/README.md +1 -1
  2. package/dist/artifact.d.ts +1 -115
  3. package/dist/browser.d.ts +10 -19
  4. package/dist/chartRender.d.ts +46 -57
  5. package/dist/chartRender.js +1 -1
  6. package/dist/chat-memory.d.ts +26 -330
  7. package/dist/chat-notify.d.ts +30 -409
  8. package/dist/chat-notify.js +3 -3
  9. package/dist/chatProgress.d.ts +28 -47
  10. package/dist/code-scan.d.ts +52 -58
  11. package/dist/codeStats.d.ts +36 -136
  12. package/dist/codeStats.js +1 -1
  13. package/dist/codebaseMemory.d.ts +52 -32
  14. package/dist/codebaseMemory.js +2 -2
  15. package/dist/core-tools.d.ts +10 -131
  16. package/dist/datasetStore.d.ts +52 -179
  17. package/dist/datasetStore.js +12 -3
  18. package/dist/discord.d.ts +32 -68
  19. package/dist/figma.d.ts +5 -408
  20. package/dist/function-skill.d.ts +23 -135
  21. package/dist/function-skill.js +1 -1
  22. package/dist/gbrain.d.ts +46 -114
  23. package/dist/git-write.d.ts +45 -137
  24. package/dist/git-write.js +6 -6
  25. package/dist/git.d.ts +2 -73
  26. package/dist/github.d.ts +2 -1202
  27. package/dist/gitlab.d.ts +55 -1059
  28. package/dist/gitlab.js +2 -2
  29. package/dist/googleDocs.d.ts +39 -175
  30. package/dist/hubspot.d.ts +1 -381
  31. package/dist/index.d.ts +19 -12
  32. package/dist/index.js +157 -148
  33. package/dist/integrations.d.ts +2 -2
  34. package/dist/jira.d.ts +2 -532
  35. package/dist/jira.js +4 -4
  36. package/dist/kvMemory.d.ts +47 -78
  37. package/dist/lark.d.ts +2 -161
  38. package/dist/lark.js +1 -1
  39. package/dist/larkDocs.d.ts +35 -236
  40. package/dist/linear.d.ts +36 -343
  41. package/dist/linkedin.d.ts +10 -120
  42. package/dist/llm-billing.d.ts +92 -180
  43. package/dist/llm-billing.js +1 -1
  44. package/dist/memory.d.ts +11 -137
  45. package/dist/notion.d.ts +28 -276
  46. package/dist/notion.js +4 -4
  47. package/dist/opendesign.d.ts +24 -202
  48. package/dist/opendesign.js +2 -2
  49. package/dist/package.json +3 -2
  50. package/dist/plane.d.ts +40 -24
  51. package/dist/report.d.ts +153 -110
  52. package/dist/review-dedup.d.ts +8 -8
  53. package/dist/review.d.ts +12 -2
  54. package/dist/reviewMemoryIo.d.ts +37 -3
  55. package/dist/reviewRecord.d.ts +41 -47
  56. package/dist/sentry.d.ts +25 -22
  57. package/dist/skill-installer.d.ts +11 -86
  58. package/dist/slack.d.ts +1 -284
  59. package/dist/socialCard.d.ts +35 -89
  60. package/dist/test-runner.d.ts +1 -220
  61. package/dist/trackers/github-adapter.d.ts +39 -94
  62. package/dist/trackers/index.d.ts +25 -18
  63. package/dist/trackers/jira-adapter.d.ts +20 -88
  64. package/dist/trackers/linear-adapter.d.ts +24 -87
  65. package/dist/trackers/plane-adapter.d.ts +29 -85
  66. package/dist/trackers/plane-adapter.js +1 -1
  67. package/dist/trackers/types.d.ts +1 -186
  68. package/dist/triggerAgent.d.ts +26 -42
  69. package/dist/triggerAgent.js +1 -1
  70. package/dist/workflow-builder.d.ts +11 -245
  71. package/docs/cli-reference.md +33 -0
  72. package/docs/concepts/designing-agents.md +201 -0
  73. package/docs/self-host/backup-restore.md +52 -0
  74. package/docs/self-host/index.md +75 -0
  75. package/docs/self-host/storage.md +50 -0
  76. package/docs/self-host/troubleshooting.md +48 -0
  77. package/docs/self-host/upgrade.md +81 -0
  78. package/package.json +3 -2
package/dist/gitlab.js CHANGED
@@ -28,6 +28,6 @@ You have access to the user's GitLab projects via the REST API (cloud gitlab.com
28
28
 
29
29
  ### Notes
30
30
  - 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.
31
- - 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 l=B();if(!l)return{command:null,args:[],env:{},description:this.description};let n={};for(let r of this.envKeys)process.env[r]&&(n[r]=process.env[r]);return{type:"stdio",command:"node",args:[l,"../dist/gitlab.js","gitlabSkill"],env:n,description:this.description,alwaysLoad:!0}},async handleToolCall(l,n){try{switch(l){case"gitlab_clone":{let{projectPath:r,projectId:s,destination:e,branch:i}=n||{},t=r&&String(r).trim();if(!t&&s!=null&&(/^\d+$/.test(String(s))?t=(await h(`/projects/${g(s)}`))?.path_with_namespace:t=String(s).trim()),!t)return JSON.stringify({error:'projectPath (e.g. "group/repo") or a numeric projectId is required'});let a=F();if(!a)return JSON.stringify({error:"GitLab is not connected (no token to authenticate the clone)."});let{execSync:o}=await import("child_process"),{join:p,resolve:d}=await import("path"),{existsSync:f,mkdirSync:c}=await import("fs"),_=e?d(e):d(process.cwd(),".zibby","repos"),y=t.split("/").filter(Boolean).pop(),u=p(_,y);if(c(_,{recursive:!0}),f(u))return JSON.stringify({success:!0,path:u,message:`Already cloned at ${u}`,alreadyCloned:!0});let j=T().replace(/^https?:\/\//,""),m=T().startsWith("http://")?"http":"https",b=`${m}://oauth2:${a}@${j}/${t}.git`,I=i?`--branch "${String(i).replace(/"/g,"")}" `:"";try{o(`git clone --depth 1 ${I}${b} "${u}"`,{stdio:"pipe",env:{...process.env,GIT_TERMINAL_PROMPT:"0"}});let w=`${m}://${j}/${t}.git`;R(o,u,w,a,"gitlab_clone");let S=o(`ls -la "${u}"`,{encoding:"utf-8"});return JSON.stringify({success:!0,path:u,message:`Cloned ${t} to ${u}`,contents:S.split(`
31
+ - 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 l=B();if(!l)return{command:null,args:[],env:{},description:this.description};let n={};for(let r of this.envKeys)process.env[r]&&(n[r]=process.env[r]);return{type:"stdio",command:"node",args:[l,"../dist/gitlab.js","gitlabSkill"],env:n,description:this.description,alwaysLoad:!0}},async handleToolCall(l,n){try{switch(l){case"gitlab_clone":{let{projectPath:r,projectId:s,destination:e,branch:i}=n||{},t=r&&String(r).trim();if(!t&&s!=null&&(/^\d+$/.test(String(s))?t=(await h(`/projects/${g(s)}`))?.path_with_namespace:t=String(s).trim()),!t)return JSON.stringify({error:'projectPath (e.g. "group/repo") or a numeric projectId is required'});let a=F();if(!a)return JSON.stringify({error:"GitLab is not connected (no token to authenticate the clone)."});let{execSync:o}=await import("child_process"),{join:p,resolve:d}=await import("path"),{existsSync:f,mkdirSync:c}=await import("fs"),_=e?d(e):d(process.cwd(),".zibby","repos"),b=t.split("/").filter(Boolean).pop(),u=p(_,b);if(c(_,{recursive:!0}),f(u))return JSON.stringify({success:!0,path:u,message:`Already cloned at ${u}`,alreadyCloned:!0});let j=T().replace(/^https?:\/\//,""),m=T().startsWith("http://")?"http":"https",y=`${m}://oauth2:${a}@${j}/${t}.git`,I=i?`--branch "${String(i).replace(/"/g,"")}" `:"";try{o(`git clone --depth 1 ${I}${y} "${u}"`,{stdio:"pipe",env:{...process.env,GIT_TERMINAL_PROMPT:"0"}});let w=`${m}://${j}/${t}.git`;R(o,u,w,a,"gitlab_clone");let S=o(`ls -la "${u}"`,{encoding:"utf-8"});return JSON.stringify({success:!0,path:u,message:`Cloned ${t} to ${u}`,contents:S.split(`
32
32
  `).slice(0,30).join(`
33
- `)})}catch(w){let S=String(w.message||w).split(a).join("***").replace(/oauth2:[^@]*@/g,"oauth2:***@");return JSON.stringify({error:`Clone failed: ${S}`})}}case"gitlab_create_mr":{let r=n?.project??n?.projectId,s=n?.source_branch??n?.sourceBranch,{title:e}=n||{};if(!r||!s||!e)return JSON.stringify({error:'project (id or "group/repo" path), source_branch, and title are required'});let i=g(r),t=n?.target_branch??n?.targetBranch;if(!t)try{t=(await h(`/projects/${i}`)).default_branch||"main"}catch{t="main"}let a={source_branch:String(s),target_branch:String(t),title:String(e),description:n?.description?String(n.description):""};try{let o=await h(`/projects/${i}/merge_requests`,{method:"POST",body:a});return JSON.stringify({success:!0,pr_url:o.web_url,number:o.iid,branch:a.source_branch,targetBranch:a.target_branch,project:String(r),provider:"gitlab",state:o.state})}catch(o){let p=String(o.message||o);if(/GitLab API (409|400)/.test(p))return JSON.stringify({success:!1,branch:a.source_branch,targetBranch:a.target_branch,project:String(r),provider:"gitlab",skippedReason:p});throw o}}case"gitlab_accept_mr":{let r=n?.project??n?.projectId,{iid:s}=n||{};if(!r||!s)return JSON.stringify({error:'project (id or "group/repo" path) and iid are required'});let e=g(r),i={};n.squash!=null&&(i.squash=!!n.squash),n.mergeCommitMessage&&(i.merge_commit_message=String(n.mergeCommitMessage)),n.mergeWhenPipelineSucceeds!=null&&(i.merge_when_pipeline_succeeds=!!n.mergeWhenPipelineSucceeds);try{let t=await h(`/projects/${e}/merge_requests/${s}/merge`,{method:"PUT",body:i});return JSON.stringify({success:!0,merged:!0,sha:t.merge_commit_sha??t.sha??null,iid:t.iid??s,project:String(r),provider:"gitlab",state:t.state})}catch(t){let a=String(t.message||t);if(/GitLab API (405|406|404)/.test(a))return JSON.stringify({success:!1,iid:s,project:String(r),provider:"gitlab",skippedReason:a});throw t}}case"gitlab_get_mr":{let{projectId:r,iid:s}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await h(`/projects/${g(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}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await h(`/projects/${g(r)}/merge_requests/${s}/changes`),i=Array.isArray(e.changes)?e.changes:[];return JSON.stringify({iid:e.iid,total:i.length,diffRefs:e.diff_refs||null,files:i.map(t=>({oldPath:t.old_path,newPath:t.new_path,newFile:!!t.new_file,deletedFile:!!t.deleted_file,renamedFile:!!t.renamed_file,diff:typeof t.diff=="string"?t.diff.slice(0,3e3):""}))})}case"gitlab_list_commits":{let{projectId:r,since:s,until:e,refName:i,page:t,perPage:a,withStats:o}=n||{};if(!r)return JSON.stringify({error:"projectId is required"});let p=new URLSearchParams;p.set("per_page",String(Math.min(Number(a)||50,100))),p.set("page",String(Number(t)||1)),s&&p.set("since",s),e&&p.set("until",e),i&&p.set("ref_name",i),o!==!1&&p.set("with_stats","true");let d=await h(`/projects/${g(r)}/repository/commits?${p.toString()}`),f=(Array.isArray(d)?d:[]).map(c=>({id:c.id,shortId:c.short_id,title:c.title,authorName:c.author_name,authorEmail:c.author_email,authoredDate:c.authored_date,committedDate:c.committed_date,parentIds:Array.isArray(c.parent_ids)?c.parent_ids:[],stats:c.stats||null}));return JSON.stringify({page:Number(t)||1,count:f.length,hasMore:f.length>=Math.min(Number(a)||50,100),commits:f})}case"gitlab_get_commit":{let{projectId:r,sha:s,includeDiff:e,includeMrs:i}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and sha are required"});let t=await h(`/projects/${g(r)}/repository/commits/${encodeURIComponent(s)}`),a;if(i)try{let p=await h(`/projects/${g(r)}/repository/commits/${encodeURIComponent(s)}/merge_requests`);a=(Array.isArray(p)?p:[]).map(d=>({iid:d.iid,title:d.title,state:d.state,webUrl:d.web_url}))}catch{a=[]}let o;if(e!==!1){let p=await h(`/projects/${g(r)}/repository/commits/${encodeURIComponent(s)}/diff`);o=(Array.isArray(p)?p:[]).map(d=>({oldPath:d.old_path,newPath:d.new_path,newFile:!!d.new_file,deletedFile:!!d.deleted_file,renamedFile:!!d.renamed_file,diff:typeof d.diff=="string"?d.diff.slice(0,3e3):""}))}return JSON.stringify({id:t.id,shortId:t.short_id,title:t.title,message:typeof t.message=="string"?t.message.slice(0,2e3):"",authorName:t.author_name,authorEmail:t.author_email,authoredDate:t.authored_date,committedDate:t.committed_date,parentIds:Array.isArray(t.parent_ids)?t.parent_ids:[],stats:t.stats||null,webUrl:t.web_url,...o?{filesChanged:o.length,files:o}:{},...a?{mergeRequests:a}:{}})}case"gitlab_list_mrs":{let{projectId:r,state:s,targetBranch:e,sourceBranch:i,authorUsername:t,labels:a,search:o,sort:p,orderBy:d,limit:f}=n||{};if(!r)return JSON.stringify({error:"projectId is required"});let c=new URLSearchParams;c.set("state",s||"opened"),c.set("per_page",String(f||20)),c.set("order_by",d||"updated_at"),c.set("sort",p||"desc"),e&&c.set("target_branch",e),i&&c.set("source_branch",i),t&&c.set("author_username",t),a&&c.set("labels",Array.isArray(a)?a.join(","):a),o&&c.set("search",o);let _=await h(`/projects/${g(r)}/merge_requests?${c.toString()}`),y=(Array.isArray(_)?_:[]).map(u=>({iid:u.iid,title:u.title,state:u.state,author:u.author?.username,sourceBranch:u.source_branch,targetBranch:u.target_branch,draft:u.draft??u.work_in_progress??!1,labels:Array.isArray(u.labels)?u.labels:[],webUrl:u.web_url,createdAt:u.created_at,updatedAt:u.updated_at}));return JSON.stringify({count:y.length,mergeRequests:y})}case"gitlab_list_mr_notes":{let{projectId:r,iid:s,limit:e}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let i=await h(`/projects/${g(r)}/merge_requests/${s}/notes?per_page=${e||50}&sort=asc&order_by=created_at`);return JSON.stringify({total:Array.isArray(i)?i.length:0,notes:(Array.isArray(i)?i:[]).map(t=>({id:t.id,author:t.author?.username,body:(t.body||"").slice(0,1e3),system:!!t.system,createdAt:t.created_at}))})}case"gitlab_post_mr_note":{let{projectId:r,iid:s,body:e}=n||{};if(!r||!s||!e)return JSON.stringify({error:"projectId, iid, and body are required"});let i=await h(`/projects/${g(r)}/merge_requests/${s}/notes`,{method:"POST",body:{body:String(e)}});return JSON.stringify({ok:!0,id:i.id,createdAt:i.created_at})}case"gitlab_post_mr_discussion":{let{projectId:r,iid:s,path:e,oldPath:i,newLine:t,oldLine:a,body:o}=n||{};if(!r||!s||!e||!o)return JSON.stringify({error:"projectId, iid, path, and body are required"});if(t==null&&a==null)return JSON.stringify({error:"newLine (added/changed line) or oldLine (removed/context line) is required to anchor an inline comment"});let p=g(r),d=n.diffRefs||null;if(d||(d=(await h(`/projects/${p}/merge_requests/${s}`)).diff_refs||null),!d||!d.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 f={base_sha:d.base_sha,start_sha:d.start_sha,head_sha:d.head_sha,position_type:"text",new_path:e,old_path:i||e};t!=null&&(f.new_line=Number(t)),a!=null&&(f.old_line=Number(a));try{let c=await h(`/projects/${p}/merge_requests/${s}/discussions`,{method:"POST",body:{body:String(o),position:f}});return JSON.stringify({ok:!0,discussionId:c.id})}catch(c){return JSON.stringify({ok:!1,error:`inline anchor rejected (${c.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:i}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let t=g(r),a=Array.isArray(i)?i.filter(m=>m&&m.path&&m.body&&(m.newLine!=null||m.oldLine!=null)):[];if(!e&&a.length===0)return JSON.stringify({error:"a review needs a body and/or inline comments"});let o=n.diffRefs||null;a.length>0&&!o&&(o=(await h(`/projects/${t}/merge_requests/${s}`)).diff_refs||null);let p=new Set,d=null;try{for(let m=1;m<=20;m+=1){let b=await h(`/projects/${t}/merge_requests/${s}/discussions?per_page=100&page=${m}`);if(!Array.isArray(b)||b.length===0)break;for(let I of b)for(let w of I.notes||[]){let S=v(w.body);S&&p.add(S),d==null&&k(w.body)&&(d=w.id)}if(b.length<100)break}}catch{}let f=!1,c=!1;if(e){let m=`${String(e)}${N}`;try{d!=null?(await h(`/projects/${t}/merge_requests/${s}/notes/${d}`,{method:"PUT",body:{body:m}}),c=!0):await h(`/projects/${t}/merge_requests/${s}/notes`,{method:"POST",body:{body:m}}),f=!0}catch{await h(`/projects/${t}/merge_requests/${s}/notes`,{method:"POST",body:{body:m}}),f=!0}}let{toPost:_,skipped:y}=P(a,p),u=0,j=[];if(_.length>0&&o)for(let m of _){let b={base_sha:o.base_sha,start_sha:o.start_sha,head_sha:o.head_sha,position_type:"text",new_path:m.path,old_path:m.oldPath||m.path};m.newLine!=null&&(b.new_line=Number(m.newLine)),m.oldLine!=null&&(b.old_line=Number(m.oldLine));try{await h(`/projects/${t}/merge_requests/${s}/discussions`,{method:"POST",body:{body:String(m.body),position:b}}),u+=1}catch(I){j.push(`${m.path}:${m.newLine??m.oldLine} \u2014 ${I.message}`)}}else _.length>0&&!o&&j.push("no diff_refs available \u2014 inline comments skipped (pass diffRefs from gitlab_get_mr)");return JSON.stringify({ok:!0,notePosted:f,summaryUpdated:c,inlinePosted:u,inlineSkipped:y||void 0,inlineErrors:j.length?j:void 0})}case"gitlab_get_discussion":{let{projectId:r,iid:s,discussionId:e}=n||{};if(!r||!s||!e)return JSON.stringify({error:"projectId, iid, and discussionId are required"});let i=await h(`/projects/${g(r)}/merge_requests/${s}/discussions/${encodeURIComponent(e)}`),t=Array.isArray(i.notes)?i.notes:[],a=t.find(p=>p.position)||null,o=a?a.position:null;return JSON.stringify({discussionId:i.id,individualNote:!!i.individual_note,path:o&&(o.new_path||o.old_path)||null,newLine:o?o.new_line??null:null,oldLine:o?o.old_line??null:null,diffRefs:o?{base_sha:o.base_sha,start_sha:o.start_sha,head_sha:o.head_sha}:null,notes:t.map(p=>({id:p.id,author:p.author?.username,body:(p.body||"").slice(0,4e3),system:!!p.system,createdAt:p.created_at}))})}case"gitlab_reply_discussion":{let{projectId:r,iid:s,discussionId:e,body:i}=n||{};if(!r||!s||!e||!i)return JSON.stringify({error:"projectId, iid, discussionId, and body are required"});let t=await h(`/projects/${g(r)}/merge_requests/${s}/discussions/${encodeURIComponent(e)}/notes`,{method:"POST",body:{body:String(i)}});return JSON.stringify({ok:!0,id:t.id,createdAt:t.created_at})}case"gitlab_list_projects":{let{query:r,limit:s}=n||{},e=Math.min(Number(s)>0?Number(s):50,200),i=new URLSearchParams;i.set("membership","true"),i.set("simple","true"),i.set("order_by","last_activity_at"),i.set("sort","desc"),i.set("per_page",String(Math.min(e+1,100))),r&&i.set("search",String(r));let t=await h(`/projects?${i.toString()}`),a=Array.isArray(t)?t:[],o=a.length>e,p=a.slice(0,e).map(d=>({fullPath:d.path_with_namespace,name:d.name,webUrl:d.web_url,defaultBranch:d.default_branch||null,visibility:d.visibility||null}));return JSON.stringify({count:p.length,truncated:o,projects:p})}case"gitlab_list_issues":{let{projectId:r,state:s,labels:e,assigneeUsername:i,authorUsername:t,updatedAfter:a,search:o,sort:p,orderBy:d,limit:f}=n||{};if(!r)return JSON.stringify({error:"projectId is required"});let c=new URLSearchParams;c.set("state",s||"opened"),c.set("per_page",String(f||30)),c.set("order_by",d||"updated_at"),c.set("sort",p||"desc"),e&&c.set("labels",Array.isArray(e)?e.join(","):e),i&&c.set("assignee_username",i),t&&c.set("author_username",t),a&&c.set("updated_after",a),o&&c.set("search",o);let _=await h(`/projects/${g(r)}/issues?${c.toString()}`),y=(Array.isArray(_)?_:[]).map(u=>({iid:u.iid,title:u.title,state:u.state,labels:Array.isArray(u.labels)?u.labels:[],author:u.author?.username,assignees:(u.assignees||[]).map(j=>j.username),userNotesCount:u.user_notes_count,webUrl:u.web_url,createdAt:u.created_at,updatedAt:u.updated_at}));return JSON.stringify({count:y.length,issues:y})}case"gitlab_get_issue":{let{projectId:r,iid:s}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await h(`/projects/${g(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(i=>i.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}=n||{};if(!r||!s||!e)return JSON.stringify({error:"projectId, iid, and body are required"});let i=await h(`/projects/${g(r)}/issues/${s}/notes`,{method:"POST",body:{body:String(e)}});return JSON.stringify({ok:!0,id:i.id,createdAt:i.created_at})}default:return JSON.stringify({error:`Unknown tool: ${l}`})}}catch(r){return JSON.stringify({error:r.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_clone",description:"Clone a GitLab repository locally (shallow) so you can read code OUTSIDE the MR diff \u2014 callers of a changed symbol, shared types/contracts, an existing util, or a cross-repo dependency. Auto-authenticates with the connected GitLab token. After cloning, use Grep/Glob/Read on the returned path. Clone SPARINGLY \u2014 only when the change's correctness depends on code beyond the diff.",input_schema:{type:"object",properties:{projectPath:{type:"string",description:'Full project path, e.g. "group/subgroup/repo" (preferred).'},projectId:{type:"string",description:"Alternatively a numeric project id (resolved to its path via the API)."},branch:{type:"string",description:"Branch to clone (default: the repo default branch)."},destination:{type:"string",description:"Destination dir (default: <workspace>/.zibby/repos/<repo>)."}}}},{name:"gitlab_create_mr",description:"Open a merge request on GitLab (POST /projects/{id}/merge_requests). The source_branch must already be pushed. Returns the REAL pr_url (the MR web_url) from GitLab \u2014 never fabricate it. Expected business outcomes (no changes between branches, an MR already exists, source==target) return { success:false, skippedReason } rather than erroring.",input_schema:{type:"object",properties:{project:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},source_branch:{type:"string",description:"Source branch to merge FROM (must already be pushed)"},target_branch:{type:"string",description:"Target branch to merge INTO (default: the project's default branch)"},title:{type:"string",description:"MR title"},description:{type:"string",description:"MR description (markdown)"}},required:["project","source_branch","title"]}},{name:"gitlab_accept_mr",description:"Accept (merge) a merge request on GitLab (PUT /projects/{id}/merge_requests/{iid}/merge). Optional squash, mergeCommitMessage, mergeWhenPipelineSucceeds. Returns { success:true, merged:true, sha } with the REAL merge_commit_sha from GitLab. Expected non-mergeable outcomes (405/406 = not mergeable / WIP / conflicts / pipeline not done, 404 = not found) return { success:false, skippedReason } rather than erroring.",input_schema:{type:"object",properties:{project:{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)"},squash:{type:"boolean",description:"Squash the MR commits into one on merge (optional)"},mergeCommitMessage:{type:"string",description:"Custom merge commit message (optional)"},mergeWhenPipelineSucceeds:{type:"boolean",description:"Merge automatically once the pipeline succeeds (optional)"}},required:["project","iid"]}},{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_commits",description:"List a project's repository commits (the commit HISTORY \u2014 not MRs), optionally bounded by since/until ISO dates and a ref/branch, with per-commit stats (additions/deletions). Paginated: keep calling with page+1 while hasMore is true. This is the ONLY correct way to enumerate commits in a date window \u2014 gitlab_clone is shallow (depth 1) and its git log shows just one commit.",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},since:{type:"string",description:'Only commits after this ISO-8601 date/time (inclusive), e.g. "2026-01-01T00:00:00Z"'},until:{type:"string",description:'Only commits before this ISO-8601 date/time, e.g. "2026-07-01T00:00:00Z"'},refName:{type:"string",description:"Branch/tag to list (defaults to the default branch)"},page:{type:"number",description:"Page number, 1-based (default 1)"},perPage:{type:"number",description:"Commits per page, max 100 (default 50)"},withStats:{type:"boolean",description:"Include per-commit additions/deletions stats (default true)"}},required:["projectId"]}},{name:"gitlab_get_commit",description:"Get ONE commit's full detail \u2014 message, author, timestamps, stats, and (by default) its per-file diffs (each capped at 3000 chars) \u2014 so you can judge the nature/complexity of the change. Use after gitlab_list_commits.",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},sha:{type:"string",description:"The commit sha (full or short)"},includeDiff:{type:"boolean",description:"Include per-file diffs (default true; set false for metadata-only)"},includeMrs:{type:"boolean",description:"Also return the merge request(s) containing this commit ({iid,title,state,webUrl}) \u2014 the evidence link for contribution records (default false)"}},required:["projectId","sha"]}},{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{ge as gitlabSkill,h as glFetch};
33
+ `)})}catch(w){let S=String(w.message||w).split(a).join("***").replace(/oauth2:[^@]*@/g,"oauth2:***@");return JSON.stringify({error:`Clone failed: ${S}`})}}case"gitlab_create_mr":{let r=n?.project??n?.projectId,s=n?.source_branch??n?.sourceBranch,{title:e}=n||{};if(!r||!s||!e)return JSON.stringify({error:'project (id or "group/repo" path), source_branch, and title are required'});let i=g(r),t=n?.target_branch??n?.targetBranch;if(!t)try{t=(await h(`/projects/${i}`)).default_branch||"main"}catch{t="main"}let a={source_branch:String(s),target_branch:String(t),title:String(e),description:n?.description?String(n.description):""};try{let o=await h(`/projects/${i}/merge_requests`,{method:"POST",body:a});return JSON.stringify({success:!0,pr_url:o.web_url,number:o.iid,branch:a.source_branch,targetBranch:a.target_branch,project:String(r),provider:"gitlab",state:o.state})}catch(o){let p=String(o.message||o);if(/GitLab API (409|400)/.test(p))return JSON.stringify({success:!1,branch:a.source_branch,targetBranch:a.target_branch,project:String(r),provider:"gitlab",skippedReason:p});throw o}}case"gitlab_accept_mr":{let r=n?.project??n?.projectId,{iid:s}=n||{};if(!r||!s)return JSON.stringify({error:'project (id or "group/repo" path) and iid are required'});let e=g(r),i={};n.squash!=null&&(i.squash=!!n.squash),n.mergeCommitMessage&&(i.merge_commit_message=String(n.mergeCommitMessage)),n.mergeWhenPipelineSucceeds!=null&&(i.merge_when_pipeline_succeeds=!!n.mergeWhenPipelineSucceeds);try{let t=await h(`/projects/${e}/merge_requests/${s}/merge`,{method:"PUT",body:i});return JSON.stringify({success:!0,merged:!0,sha:t.merge_commit_sha??t.sha??null,iid:t.iid??s,project:String(r),provider:"gitlab",state:t.state})}catch(t){let a=String(t.message||t);if(/GitLab API (405|406|404)/.test(a))return JSON.stringify({success:!1,iid:s,project:String(r),provider:"gitlab",skippedReason:a});throw t}}case"gitlab_get_mr":{let{projectId:r,iid:s}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await h(`/projects/${g(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}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await h(`/projects/${g(r)}/merge_requests/${s}/changes`),i=Array.isArray(e.changes)?e.changes:[];return JSON.stringify({iid:e.iid,total:i.length,diffRefs:e.diff_refs||null,files:i.map(t=>({oldPath:t.old_path,newPath:t.new_path,newFile:!!t.new_file,deletedFile:!!t.deleted_file,renamedFile:!!t.renamed_file,diff:typeof t.diff=="string"?t.diff.slice(0,3e3):""}))})}case"gitlab_list_commits":{let{projectId:r,since:s,until:e,refName:i,page:t,perPage:a,withStats:o}=n||{};if(!r)return JSON.stringify({error:"projectId is required"});let p=new URLSearchParams;p.set("per_page",String(Math.min(Number(a)||50,100))),p.set("page",String(Number(t)||1)),s&&p.set("since",s),e&&p.set("until",e),i&&p.set("ref_name",i),o!==!1&&p.set("with_stats","true");let d=await h(`/projects/${g(r)}/repository/commits?${p.toString()}`),f=(Array.isArray(d)?d:[]).map(c=>({id:c.id,shortId:c.short_id,title:c.title,authorName:c.author_name,authorEmail:c.author_email,authoredDate:c.authored_date,committedDate:c.committed_date,parentIds:Array.isArray(c.parent_ids)?c.parent_ids:[],stats:c.stats||null}));return JSON.stringify({page:Number(t)||1,count:f.length,hasMore:f.length>=Math.min(Number(a)||50,100),commits:f})}case"gitlab_get_commit":{let{projectId:r,sha:s,includeDiff:e,includeMrs:i}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and sha are required"});let t=await h(`/projects/${g(r)}/repository/commits/${encodeURIComponent(s)}`),a;if(i)try{let p=await h(`/projects/${g(r)}/repository/commits/${encodeURIComponent(s)}/merge_requests`);a=(Array.isArray(p)?p:[]).map(d=>({iid:d.iid,title:d.title,state:d.state,webUrl:d.web_url}))}catch{a=[]}let o;if(e!==!1){let p=await h(`/projects/${g(r)}/repository/commits/${encodeURIComponent(s)}/diff`);o=(Array.isArray(p)?p:[]).map(d=>({oldPath:d.old_path,newPath:d.new_path,newFile:!!d.new_file,deletedFile:!!d.deleted_file,renamedFile:!!d.renamed_file,diff:typeof d.diff=="string"?d.diff.slice(0,3e3):""}))}return JSON.stringify({id:t.id,shortId:t.short_id,title:t.title,message:typeof t.message=="string"?t.message.slice(0,2e3):"",authorName:t.author_name,authorEmail:t.author_email,authoredDate:t.authored_date,committedDate:t.committed_date,parentIds:Array.isArray(t.parent_ids)?t.parent_ids:[],stats:t.stats||null,webUrl:t.web_url,...o?{filesChanged:o.length,files:o}:{},...a?{mergeRequests:a}:{}})}case"gitlab_list_mrs":{let{projectId:r,state:s,targetBranch:e,sourceBranch:i,authorUsername:t,labels:a,search:o,sort:p,orderBy:d,limit:f}=n||{};if(!r)return JSON.stringify({error:"projectId is required"});let c=new URLSearchParams;c.set("state",s||"opened"),c.set("per_page",String(f||20)),c.set("order_by",d||"updated_at"),c.set("sort",p||"desc"),e&&c.set("target_branch",e),i&&c.set("source_branch",i),t&&c.set("author_username",t),a&&c.set("labels",Array.isArray(a)?a.join(","):a),o&&c.set("search",o);let _=await h(`/projects/${g(r)}/merge_requests?${c.toString()}`),b=(Array.isArray(_)?_:[]).map(u=>({iid:u.iid,title:u.title,state:u.state,author:u.author?.username,sourceBranch:u.source_branch,targetBranch:u.target_branch,draft:u.draft??u.work_in_progress??!1,labels:Array.isArray(u.labels)?u.labels:[],webUrl:u.web_url,createdAt:u.created_at,updatedAt:u.updated_at}));return JSON.stringify({count:b.length,mergeRequests:b})}case"gitlab_list_mr_notes":{let{projectId:r,iid:s,limit:e}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let i=await h(`/projects/${g(r)}/merge_requests/${s}/notes?per_page=${e||50}&sort=asc&order_by=created_at`);return JSON.stringify({total:Array.isArray(i)?i.length:0,notes:(Array.isArray(i)?i:[]).map(t=>({id:t.id,author:t.author?.username,body:(t.body||"").slice(0,1e3),system:!!t.system,createdAt:t.created_at}))})}case"gitlab_post_mr_note":{let{projectId:r,iid:s,body:e}=n||{};if(!r||!s||!e)return JSON.stringify({error:"projectId, iid, and body are required"});let i=await h(`/projects/${g(r)}/merge_requests/${s}/notes`,{method:"POST",body:{body:String(e)}});return JSON.stringify({ok:!0,id:i.id,createdAt:i.created_at})}case"gitlab_post_mr_discussion":{let{projectId:r,iid:s,path:e,oldPath:i,newLine:t,oldLine:a,body:o}=n||{};if(!r||!s||!e||!o)return JSON.stringify({error:"projectId, iid, path, and body are required"});if(t==null&&a==null)return JSON.stringify({error:"newLine (added/changed line) or oldLine (removed/context line) is required to anchor an inline comment"});let p=g(r),d=n.diffRefs||null;if(d||(d=(await h(`/projects/${p}/merge_requests/${s}`)).diff_refs||null),!d||!d.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 f={base_sha:d.base_sha,start_sha:d.start_sha,head_sha:d.head_sha,position_type:"text",new_path:e,old_path:i||e};t!=null&&(f.new_line=Number(t)),a!=null&&(f.old_line=Number(a));try{let c=await h(`/projects/${p}/merge_requests/${s}/discussions`,{method:"POST",body:{body:String(o),position:f}});return JSON.stringify({ok:!0,discussionId:c.id})}catch(c){return JSON.stringify({ok:!1,error:`inline anchor rejected (${c.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:i}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let t=g(r),a=Array.isArray(i)?i.filter(m=>m&&m.path&&m.body&&(m.newLine!=null||m.oldLine!=null)):[];if(!e&&a.length===0)return JSON.stringify({error:"a review needs a body and/or inline comments"});let o=n.diffRefs||null;a.length>0&&!o&&(o=(await h(`/projects/${t}/merge_requests/${s}`)).diff_refs||null);let p=new Set,d=null;try{for(let m=1;m<=20;m+=1){let y=await h(`/projects/${t}/merge_requests/${s}/discussions?per_page=100&page=${m}`);if(!Array.isArray(y)||y.length===0)break;for(let I of y)for(let w of I.notes||[]){let S=v(w.body);S&&p.add(S),d==null&&k(w.body)&&(d=w.id)}if(y.length<100)break}}catch{}let f=!1,c=!1;if(e){let m=`${String(e)}${N}`;try{d!=null?(await h(`/projects/${t}/merge_requests/${s}/notes/${d}`,{method:"PUT",body:{body:m}}),c=!0):await h(`/projects/${t}/merge_requests/${s}/notes`,{method:"POST",body:{body:m}}),f=!0}catch{await h(`/projects/${t}/merge_requests/${s}/notes`,{method:"POST",body:{body:m}}),f=!0}}let{toPost:_,skipped:b}=P(a,p),u=0,j=[];if(_.length>0&&o)for(let m of _){let y={base_sha:o.base_sha,start_sha:o.start_sha,head_sha:o.head_sha,position_type:"text",new_path:m.path,old_path:m.oldPath||m.path};m.newLine!=null&&(y.new_line=Number(m.newLine)),m.oldLine!=null&&(y.old_line=Number(m.oldLine));try{await h(`/projects/${t}/merge_requests/${s}/discussions`,{method:"POST",body:{body:String(m.body),position:y}}),u+=1}catch(I){j.push(`${m.path}:${m.newLine??m.oldLine} \u2014 ${I.message}`)}}else _.length>0&&!o&&j.push("no diff_refs available \u2014 inline comments skipped (pass diffRefs from gitlab_get_mr)");return JSON.stringify({ok:!0,notePosted:f,summaryUpdated:c,inlinePosted:u,inlineSkipped:b||void 0,inlineErrors:j.length?j:void 0})}case"gitlab_get_discussion":{let{projectId:r,iid:s,discussionId:e}=n||{};if(!r||!s||!e)return JSON.stringify({error:"projectId, iid, and discussionId are required"});let i=await h(`/projects/${g(r)}/merge_requests/${s}/discussions/${encodeURIComponent(e)}`),t=Array.isArray(i.notes)?i.notes:[],a=t.find(p=>p.position)||null,o=a?a.position:null;return JSON.stringify({discussionId:i.id,individualNote:!!i.individual_note,path:o&&(o.new_path||o.old_path)||null,newLine:o?o.new_line??null:null,oldLine:o?o.old_line??null:null,diffRefs:o?{base_sha:o.base_sha,start_sha:o.start_sha,head_sha:o.head_sha}:null,notes:t.map(p=>({id:p.id,author:p.author?.username,body:(p.body||"").slice(0,4e3),system:!!p.system,createdAt:p.created_at}))})}case"gitlab_reply_discussion":{let{projectId:r,iid:s,discussionId:e,body:i}=n||{};if(!r||!s||!e||!i)return JSON.stringify({error:"projectId, iid, discussionId, and body are required"});let t=await h(`/projects/${g(r)}/merge_requests/${s}/discussions/${encodeURIComponent(e)}/notes`,{method:"POST",body:{body:String(i)}});return JSON.stringify({ok:!0,id:t.id,createdAt:t.created_at})}case"gitlab_list_projects":{let{query:r,limit:s}=n||{},e=Math.min(Number(s)>0?Number(s):50,200),i=new URLSearchParams;i.set("membership","true"),i.set("simple","true"),i.set("order_by","last_activity_at"),i.set("sort","desc"),i.set("per_page",String(Math.min(e+1,100))),r&&i.set("search",String(r));let t=await h(`/projects?${i.toString()}`),a=Array.isArray(t)?t:[],o=a.length>e,p=a.slice(0,e).map(d=>({fullPath:d.path_with_namespace,name:d.name,webUrl:d.web_url,defaultBranch:d.default_branch||null,visibility:d.visibility||null}));return JSON.stringify({count:p.length,truncated:o,projects:p})}case"gitlab_list_issues":{let{projectId:r,state:s,labels:e,assigneeUsername:i,authorUsername:t,updatedAfter:a,search:o,sort:p,orderBy:d,limit:f}=n||{};if(!r)return JSON.stringify({error:"projectId is required"});let c=new URLSearchParams;c.set("state",s||"opened"),c.set("per_page",String(f||30)),c.set("order_by",d||"updated_at"),c.set("sort",p||"desc"),e&&c.set("labels",Array.isArray(e)?e.join(","):e),i&&c.set("assignee_username",i),t&&c.set("author_username",t),a&&c.set("updated_after",a),o&&c.set("search",o);let _=await h(`/projects/${g(r)}/issues?${c.toString()}`),b=(Array.isArray(_)?_:[]).map(u=>({iid:u.iid,title:u.title,state:u.state,labels:Array.isArray(u.labels)?u.labels:[],author:u.author?.username,assignees:(u.assignees||[]).map(j=>j.username),userNotesCount:u.user_notes_count,webUrl:u.web_url,createdAt:u.created_at,updatedAt:u.updated_at}));return JSON.stringify({count:b.length,issues:b})}case"gitlab_get_issue":{let{projectId:r,iid:s}=n||{};if(!r||!s)return JSON.stringify({error:"projectId and iid are required"});let e=await h(`/projects/${g(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(i=>i.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}=n||{};if(!r||!s||!e)return JSON.stringify({error:"projectId, iid, and body are required"});let i=await h(`/projects/${g(r)}/issues/${s}/notes`,{method:"POST",body:{body:String(e)}});return JSON.stringify({ok:!0,id:i.id,createdAt:i.created_at})}default:return JSON.stringify({error:`Unknown tool: ${l}`})}}catch(r){return JSON.stringify({error:r.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_clone",description:"Clone a GitLab repository locally (shallow) so you can read code OUTSIDE the MR diff \u2014 callers of a changed symbol, shared types/contracts, an existing util, or a cross-repo dependency. Auto-authenticates with the connected GitLab token. After cloning, use Grep/Glob/Read on the returned path. Clone SPARINGLY \u2014 only when the change's correctness depends on code beyond the diff.",input_schema:{type:"object",properties:{projectPath:{type:"string",description:'Full project path, e.g. "group/subgroup/repo" (preferred).'},projectId:{type:"string",description:"Alternatively a numeric project id (resolved to its path via the API)."},branch:{type:"string",description:"Branch to clone (default: the repo default branch)."},destination:{type:"string",description:"Destination dir (default: <workspace>/.zibby/repos/<repo>)."}}}},{name:"gitlab_create_mr",description:"Open a merge request on GitLab (POST /projects/{id}/merge_requests). The source_branch must already be pushed. Returns the REAL pr_url (the MR web_url) from GitLab \u2014 never fabricate it. Expected business outcomes (no changes between branches, an MR already exists, source==target) return { success:false, skippedReason } rather than erroring.",input_schema:{type:"object",properties:{project:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},source_branch:{type:"string",description:"Source branch to merge FROM (must already be pushed)"},target_branch:{type:"string",description:"Target branch to merge INTO (default: the project's default branch)"},title:{type:"string",description:"MR title"},description:{type:"string",description:"MR description (markdown)"}},required:["project","source_branch","title"]}},{name:"gitlab_accept_mr",description:"Accept (merge) a merge request on GitLab (PUT /projects/{id}/merge_requests/{iid}/merge). Optional squash, mergeCommitMessage, mergeWhenPipelineSucceeds. Returns { success:true, merged:true, sha } with the REAL merge_commit_sha from GitLab. Expected non-mergeable outcomes (405/406 = not mergeable / WIP / conflicts / pipeline not done, 404 = not found) return { success:false, skippedReason } rather than erroring.",input_schema:{type:"object",properties:{project:{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)"},squash:{type:"boolean",description:"Squash the MR commits into one on merge (optional)"},mergeCommitMessage:{type:"string",description:"Custom merge commit message (optional)"},mergeWhenPipelineSucceeds:{type:"boolean",description:"Merge automatically once the pipeline succeeds (optional)"}},required:["project","iid"]}},{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_commits",description:"List a project's repository commits (the commit HISTORY \u2014 not MRs), optionally bounded by since/until ISO dates and a ref/branch, with per-commit stats (additions/deletions). Paginated: keep calling with page+1 while hasMore is true. This is the ONLY correct way to enumerate commits in a date window \u2014 gitlab_clone is shallow (depth 1) and its git log shows just one commit.",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},since:{type:"string",description:'Only commits after this ISO-8601 date/time (inclusive), e.g. "2026-01-01T00:00:00Z"'},until:{type:"string",description:'Only commits before this ISO-8601 date/time, e.g. "2026-07-01T00:00:00Z"'},refName:{type:"string",description:"Branch/tag to list (defaults to the default branch)"},page:{type:"number",description:"Page number, 1-based (default 1)"},perPage:{type:"number",description:"Commits per page, max 100 (default 50)"},withStats:{type:"boolean",description:"Include per-commit additions/deletions stats (default true)"}},required:["projectId"]}},{name:"gitlab_get_commit",description:"Get ONE commit's full detail \u2014 message, author, timestamps, stats, and (by default) its per-file diffs (each capped at 3000 chars) \u2014 so you can judge the nature/complexity of the change. Use after gitlab_list_commits.",input_schema:{type:"object",properties:{projectId:{type:"string",description:'Project numeric id OR full path (e.g. "group/repo")'},sha:{type:"string",description:"The commit sha (full or short)"},includeDiff:{type:"boolean",description:"Include per-file diffs (default true; set false for metadata-only)"},includeMrs:{type:"boolean",description:"Also return the merge request(s) containing this commit ({iid,title,state,webUrl}) \u2014 the evidence link for contribution records (default false)"}},required:["projectId","sha"]}},{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{ge as gitlabSkill,h as glFetch};
@@ -1,3 +1,30 @@
1
+ /**
2
+ * Google Docs skill — create / append / read Google Docs from an agent.
3
+ *
4
+ * Modelled on notion.js:
5
+ * - resolveIntegrationToken('google') is the SINGLE auth chokepoint (via
6
+ * the googleApi() helper below). Don't re-resolve at call sites. The
7
+ * backend resolver auto-refreshes the ~1h Google access token
8
+ * server-side, so the skill only ever sees a valid bearer.
9
+ * - handleToolCall() dispatches the tools and NEVER throws — any HTTP or
10
+ * parse failure is returned as { ok:false, error } so a missing/broken
11
+ * Google connection can't crash the run.
12
+ *
13
+ * Token shape (GET /integrations/token/google → resolveIntegrationToken):
14
+ * { provider:'google', token, email, scopes, expiresInSec }
15
+ *
16
+ * SCOPE / VISIBILITY (drive.file):
17
+ * The integration requests ONLY the non-sensitive
18
+ * https://www.googleapis.com/auth/drive.file scope, which grants per-file
19
+ * access to files this app CREATED or the user explicitly PICKED (via the
20
+ * Google Picker). The Docs API's documents.create / documents.get /
21
+ * documents.batchUpdate all accept drive.file, so create→append→read-back of
22
+ * our own / picked docs works fully. Reading an arbitrary pre-existing doc
23
+ * requires the user to PICK it once first (the Picker grants drive.file on
24
+ * that file). We do NOT request the sensitive documents.readonly scope —
25
+ * Google's OAuth review rejected it; drive.file + Picker is the sanctioned
26
+ * path.
27
+ */
1
28
  /**
2
29
  * INJECTED-TOKEN fast path (Zibby Copilot per-turn credential injection) +
3
30
  * NON-OWNER SAFETY GATE — the Google twin of linkedin.js injectedPersonalToken.
@@ -24,12 +51,12 @@
24
51
  * Absent both (owner/self turns, Fargate workflows, self-host — no
25
52
  * sender-identity context) → the normal PAT chokepoint runs unchanged.
26
53
  */
27
- export function injectedGoogleToken(): {
54
+ export declare function injectedGoogleToken(): {
28
55
  token: string;
29
56
  email: string;
30
57
  };
31
58
  /** True when the runtime flagged this turn's verified sender as NOT the tenant owner. */
32
- export function senderIsNonOwner(): boolean;
59
+ export declare function senderIsNonOwner(): boolean;
33
60
  /**
34
61
  * STRICT CHAT-TURN INVARIANT (fail-CLOSED) — ZIBBY_CHAT_STRICT_PERSONAL=1.
35
62
  *
@@ -48,40 +75,23 @@ export function senderIsNonOwner(): boolean;
48
75
  * Absent both flags (Fargate workflows, self-host, direct tool use — no chat
49
76
  * sender context) → the normal PAT chokepoint runs unchanged.
50
77
  */
51
- export function chatStrictPersonal(): boolean;
78
+ export declare function chatStrictPersonal(): boolean;
79
+ export declare const NON_OWNER_REFUSAL = "You haven't connected your own Google account \u2014 connect it at https://studio.zibby.dev/integrations (Google Docs). For privacy, I can't use anyone else's Google (including the project owner's) on your behalf.";
52
80
  /**
53
81
  * Extract a Google Docs document id from a raw id OR a Docs URL
54
82
  * (https://docs.google.com/document/d/<id>/edit...). Returns the id string
55
83
  * or null.
56
84
  */
57
- export function parseDocId(ref: any): string;
58
- export function googleApi(url: any, opts?: {}): Promise<any>;
85
+ export declare function parseDocId(ref: any): string;
86
+ export declare function googleApi(url: any, opts?: any): Promise<any>;
59
87
  /**
60
88
  * Parse ONE markdown line's inline marks (bold `**x**`, links `[t](u)`,
61
89
  * inline code `` `x` ``) into { text, styles } where `styles` are ranges
62
90
  * RELATIVE to the returned plain text.
63
91
  */
64
- export function parseInlineMarkdown(line: any): {
92
+ export declare function parseInlineMarkdown(line: any): {
65
93
  text: string;
66
- styles: ({
67
- start: number;
68
- end: number;
69
- link: string;
70
- bold?: undefined;
71
- code?: undefined;
72
- } | {
73
- start: number;
74
- end: number;
75
- bold: boolean;
76
- link?: undefined;
77
- code?: undefined;
78
- } | {
79
- start: number;
80
- end: number;
81
- code: boolean;
82
- link?: undefined;
83
- bold?: undefined;
84
- })[];
94
+ styles: any[];
85
95
  };
86
96
  /**
87
97
  * Convert a small, common subset of markdown (headings #/##/###, bullet
@@ -98,15 +108,8 @@ export function parseInlineMarkdown(line: any): {
98
108
  * Returns { requests, endIndex }. Plain text (no markdown) passes through as
99
109
  * plain paragraphs — the converter is safe for the `text` input too.
100
110
  */
101
- export function markdownToRequests(markdown: any, startIndex: any): {
102
- requests: {
103
- insertText: {
104
- location: {
105
- index: any;
106
- };
107
- text: string;
108
- };
109
- }[];
111
+ export declare function markdownToRequests(markdown: any, startIndex: any): {
112
+ requests: any[];
110
113
  endIndex: any;
111
114
  };
112
115
  /**
@@ -114,144 +117,5 @@ export function markdownToRequests(markdown: any, startIndex: any): {
114
117
  * newline-separated — table cells + nested content included via recursion).
115
118
  * Bounded by MAX_TEXT_CHARS.
116
119
  */
117
- export function extractPlainText(body: any): string;
118
- export const NON_OWNER_REFUSAL: "You haven't connected your own Google account \u2014 connect it at https://studio.zibby.dev/integrations (Google Docs). For privacy, I can't use anyone else's Google (including the project owner's) on your behalf.";
119
- export namespace googleDocsSkill {
120
- let id: string;
121
- let serverName: string;
122
- let allowedTools: string[];
123
- let requiresIntegration: "google";
124
- let description: string;
125
- let promptFragment: string;
126
- /**
127
- * Spawn the GENERIC skill MCP server (bin/mcp-skill.mjs) pointing at this
128
- * module's googleDocsSkill export, so the AGENT gets real mcp__gdocs__*
129
- * tools. Auth flows through the INHERITED env (PROJECT_API_TOKEN →
130
- * resolveIntegrationToken('google')), so no provider-specific env keys are
131
- * needed here. When unconnected, handleToolCall returns { ok:false, error }
132
- * — the agent tolerates it.
133
- */
134
- function resolve(): {
135
- type: string;
136
- command: string;
137
- args: any[];
138
- env: {};
139
- description: string;
140
- alwaysLoad: boolean;
141
- };
142
- function handleToolCall(name: any, args: any): Promise<string>;
143
- let tools: ({
144
- name: string;
145
- description: string;
146
- input_schema: {
147
- type: string;
148
- properties: {
149
- title: {
150
- type: string;
151
- description: string;
152
- };
153
- markdown: {
154
- type: string;
155
- description: string;
156
- };
157
- text: {
158
- type: string;
159
- description: string;
160
- };
161
- documentId?: undefined;
162
- imagePath?: undefined;
163
- width?: undefined;
164
- height?: undefined;
165
- };
166
- required: string[];
167
- };
168
- } | {
169
- name: string;
170
- description: string;
171
- input_schema: {
172
- type: string;
173
- properties: {
174
- documentId: {
175
- type: string;
176
- description: string;
177
- };
178
- markdown: {
179
- type: string;
180
- description: string;
181
- };
182
- text: {
183
- type: string;
184
- description: string;
185
- };
186
- title?: undefined;
187
- imagePath?: undefined;
188
- width?: undefined;
189
- height?: undefined;
190
- };
191
- required: string[];
192
- };
193
- } | {
194
- name: string;
195
- description: string;
196
- input_schema: {
197
- type: string;
198
- properties: {
199
- documentId: {
200
- type: string;
201
- description: string;
202
- };
203
- imagePath: {
204
- type: string;
205
- description: string;
206
- };
207
- width: {
208
- type: string;
209
- description: string;
210
- };
211
- height: {
212
- type: string;
213
- description: string;
214
- };
215
- title?: undefined;
216
- markdown?: undefined;
217
- text?: undefined;
218
- };
219
- required: string[];
220
- };
221
- } | {
222
- name: string;
223
- description: string;
224
- input_schema: {
225
- type: string;
226
- properties: {
227
- documentId: {
228
- type: string;
229
- description: string;
230
- };
231
- title?: undefined;
232
- markdown?: undefined;
233
- text?: undefined;
234
- imagePath?: undefined;
235
- width?: undefined;
236
- height?: undefined;
237
- };
238
- required: string[];
239
- };
240
- } | {
241
- name: string;
242
- description: string;
243
- input_schema: {
244
- type: string;
245
- properties: {
246
- title?: undefined;
247
- markdown?: undefined;
248
- text?: undefined;
249
- documentId?: undefined;
250
- imagePath?: undefined;
251
- width?: undefined;
252
- height?: undefined;
253
- };
254
- required?: undefined;
255
- };
256
- })[];
257
- }
120
+ export declare function extractPlainText(body: any): string;
121
+ export declare const googleDocsSkill: any;