@vicoa/cli 1.7.12-win32-x64 → 1.7.12

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 (330) hide show
  1. package/README.md +82 -0
  2. package/bin/vicoa.js +38 -0
  3. package/package.json +30 -10
  4. package/bin/_internal/VCRUNTIME140.dll +0 -0
  5. package/bin/_internal/VCRUNTIME140_1.dll +0 -0
  6. package/bin/_internal/_asyncio.pyd +0 -0
  7. package/bin/_internal/_bz2.pyd +0 -0
  8. package/bin/_internal/_cffi_backend.cp312-win_amd64.pyd +0 -0
  9. package/bin/_internal/_ctypes.pyd +0 -0
  10. package/bin/_internal/_decimal.pyd +0 -0
  11. package/bin/_internal/_hashlib.pyd +0 -0
  12. package/bin/_internal/_lzma.pyd +0 -0
  13. package/bin/_internal/_multiprocessing.pyd +0 -0
  14. package/bin/_internal/_overlapped.pyd +0 -0
  15. package/bin/_internal/_queue.pyd +0 -0
  16. package/bin/_internal/_socket.pyd +0 -0
  17. package/bin/_internal/_sqlite3.pyd +0 -0
  18. package/bin/_internal/_ssl.pyd +0 -0
  19. package/bin/_internal/_uuid.pyd +0 -0
  20. package/bin/_internal/_wmi.pyd +0 -0
  21. package/bin/_internal/_zoneinfo.pyd +0 -0
  22. package/bin/_internal/aiofile-3.12.3.dist-info/INSTALLER +0 -1
  23. package/bin/_internal/aiofile-3.12.3.dist-info/METADATA +0 -564
  24. package/bin/_internal/aiofile-3.12.3.dist-info/RECORD +0 -15
  25. package/bin/_internal/aiofile-3.12.3.dist-info/WHEEL +0 -4
  26. package/bin/_internal/aiofile-3.12.3.dist-info/licenses/LICENCE +0 -195
  27. package/bin/_internal/aiofile-3.12.3.dist-info/licenses/LICENCE.md +0 -195
  28. package/bin/_internal/aiohttp/_http_parser.cp312-win_amd64.pyd +0 -0
  29. package/bin/_internal/aiohttp/_http_writer.cp312-win_amd64.pyd +0 -0
  30. package/bin/_internal/aiohttp/_websocket/mask.cp312-win_amd64.pyd +0 -0
  31. package/bin/_internal/aiohttp/_websocket/reader_c.cp312-win_amd64.pyd +0 -0
  32. package/bin/_internal/aiohttp-3.14.3.dist-info/INSTALLER +0 -1
  33. package/bin/_internal/aiohttp-3.14.3.dist-info/METADATA +0 -257
  34. package/bin/_internal/aiohttp-3.14.3.dist-info/RECORD +0 -130
  35. package/bin/_internal/aiohttp-3.14.3.dist-info/WHEEL +0 -5
  36. package/bin/_internal/aiohttp-3.14.3.dist-info/licenses/LICENSE.txt +0 -201
  37. package/bin/_internal/aiohttp-3.14.3.dist-info/licenses/vendor/llhttp/LICENSE +0 -22
  38. package/bin/_internal/aiohttp-3.14.3.dist-info/top_level.txt +0 -1
  39. package/bin/_internal/api-ms-win-core-console-l1-1-0.dll +0 -0
  40. package/bin/_internal/api-ms-win-core-datetime-l1-1-0.dll +0 -0
  41. package/bin/_internal/api-ms-win-core-debug-l1-1-0.dll +0 -0
  42. package/bin/_internal/api-ms-win-core-errorhandling-l1-1-0.dll +0 -0
  43. package/bin/_internal/api-ms-win-core-fibers-l1-1-0.dll +0 -0
  44. package/bin/_internal/api-ms-win-core-fibers-l1-1-1.dll +0 -0
  45. package/bin/_internal/api-ms-win-core-file-l1-1-0.dll +0 -0
  46. package/bin/_internal/api-ms-win-core-file-l1-2-0.dll +0 -0
  47. package/bin/_internal/api-ms-win-core-file-l2-1-0.dll +0 -0
  48. package/bin/_internal/api-ms-win-core-handle-l1-1-0.dll +0 -0
  49. package/bin/_internal/api-ms-win-core-heap-l1-1-0.dll +0 -0
  50. package/bin/_internal/api-ms-win-core-interlocked-l1-1-0.dll +0 -0
  51. package/bin/_internal/api-ms-win-core-kernel32-legacy-l1-1-1.dll +0 -0
  52. package/bin/_internal/api-ms-win-core-libraryloader-l1-1-0.dll +0 -0
  53. package/bin/_internal/api-ms-win-core-localization-l1-2-0.dll +0 -0
  54. package/bin/_internal/api-ms-win-core-memory-l1-1-0.dll +0 -0
  55. package/bin/_internal/api-ms-win-core-namedpipe-l1-1-0.dll +0 -0
  56. package/bin/_internal/api-ms-win-core-processenvironment-l1-1-0.dll +0 -0
  57. package/bin/_internal/api-ms-win-core-processthreads-l1-1-0.dll +0 -0
  58. package/bin/_internal/api-ms-win-core-processthreads-l1-1-1.dll +0 -0
  59. package/bin/_internal/api-ms-win-core-profile-l1-1-0.dll +0 -0
  60. package/bin/_internal/api-ms-win-core-rtlsupport-l1-1-0.dll +0 -0
  61. package/bin/_internal/api-ms-win-core-string-l1-1-0.dll +0 -0
  62. package/bin/_internal/api-ms-win-core-synch-l1-1-0.dll +0 -0
  63. package/bin/_internal/api-ms-win-core-synch-l1-2-0.dll +0 -0
  64. package/bin/_internal/api-ms-win-core-sysinfo-l1-1-0.dll +0 -0
  65. package/bin/_internal/api-ms-win-core-sysinfo-l1-2-0.dll +0 -0
  66. package/bin/_internal/api-ms-win-core-timezone-l1-1-0.dll +0 -0
  67. package/bin/_internal/api-ms-win-core-util-l1-1-0.dll +0 -0
  68. package/bin/_internal/api-ms-win-crt-conio-l1-1-0.dll +0 -0
  69. package/bin/_internal/api-ms-win-crt-convert-l1-1-0.dll +0 -0
  70. package/bin/_internal/api-ms-win-crt-environment-l1-1-0.dll +0 -0
  71. package/bin/_internal/api-ms-win-crt-filesystem-l1-1-0.dll +0 -0
  72. package/bin/_internal/api-ms-win-crt-heap-l1-1-0.dll +0 -0
  73. package/bin/_internal/api-ms-win-crt-locale-l1-1-0.dll +0 -0
  74. package/bin/_internal/api-ms-win-crt-math-l1-1-0.dll +0 -0
  75. package/bin/_internal/api-ms-win-crt-process-l1-1-0.dll +0 -0
  76. package/bin/_internal/api-ms-win-crt-runtime-l1-1-0.dll +0 -0
  77. package/bin/_internal/api-ms-win-crt-stdio-l1-1-0.dll +0 -0
  78. package/bin/_internal/api-ms-win-crt-string-l1-1-0.dll +0 -0
  79. package/bin/_internal/api-ms-win-crt-time-l1-1-0.dll +0 -0
  80. package/bin/_internal/api-ms-win-crt-utility-l1-1-0.dll +0 -0
  81. package/bin/_internal/attrs-26.1.0.dist-info/INSTALLER +0 -1
  82. package/bin/_internal/attrs-26.1.0.dist-info/METADATA +0 -199
  83. package/bin/_internal/attrs-26.1.0.dist-info/RECORD +0 -55
  84. package/bin/_internal/attrs-26.1.0.dist-info/WHEEL +0 -4
  85. package/bin/_internal/attrs-26.1.0.dist-info/licenses/LICENSE +0 -21
  86. package/bin/_internal/base_library.zip +0 -0
  87. package/bin/_internal/certifi/cacert.pem +0 -3959
  88. package/bin/_internal/certifi/py.typed +0 -0
  89. package/bin/_internal/charset_normalizer/cd.cp312-win_amd64.pyd +0 -0
  90. package/bin/_internal/charset_normalizer/md.cp312-win_amd64.pyd +0 -0
  91. package/bin/_internal/click-8.4.2.dist-info/INSTALLER +0 -1
  92. package/bin/_internal/click-8.4.2.dist-info/METADATA +0 -84
  93. package/bin/_internal/click-8.4.2.dist-info/RECORD +0 -40
  94. package/bin/_internal/click-8.4.2.dist-info/WHEEL +0 -4
  95. package/bin/_internal/click-8.4.2.dist-info/licenses/LICENSE.txt +0 -28
  96. package/bin/_internal/cryptography/hazmat/bindings/_rust.pyd +0 -0
  97. package/bin/_internal/cryptography-50.0.0.dist-info/INSTALLER +0 -1
  98. package/bin/_internal/cryptography-50.0.0.dist-info/METADATA +0 -110
  99. package/bin/_internal/cryptography-50.0.0.dist-info/RECORD +0 -199
  100. package/bin/_internal/cryptography-50.0.0.dist-info/WHEEL +0 -4
  101. package/bin/_internal/cryptography-50.0.0.dist-info/licenses/LICENSE +0 -3
  102. package/bin/_internal/cryptography-50.0.0.dist-info/licenses/LICENSE.APACHE +0 -202
  103. package/bin/_internal/cryptography-50.0.0.dist-info/licenses/LICENSE.BSD +0 -27
  104. package/bin/_internal/cryptography-50.0.0.dist-info/sboms/cryptography-rust.cyclonedx.json +0 -1365
  105. package/bin/_internal/cryptography-50.0.0.dist-info/sboms/sbom.json +0 -43
  106. package/bin/_internal/email_validator-2.3.0.dist-info/INSTALLER +0 -1
  107. package/bin/_internal/email_validator-2.3.0.dist-info/METADATA +0 -466
  108. package/bin/_internal/email_validator-2.3.0.dist-info/RECORD +0 -27
  109. package/bin/_internal/email_validator-2.3.0.dist-info/WHEEL +0 -5
  110. package/bin/_internal/email_validator-2.3.0.dist-info/entry_points.txt +0 -2
  111. package/bin/_internal/email_validator-2.3.0.dist-info/licenses/LICENSE +0 -27
  112. package/bin/_internal/email_validator-2.3.0.dist-info/top_level.txt +0 -1
  113. package/bin/_internal/fastmcp-3.4.7.dist-info/INSTALLER +0 -1
  114. package/bin/_internal/fastmcp-3.4.7.dist-info/METADATA +0 -160
  115. package/bin/_internal/fastmcp-3.4.7.dist-info/RECORD +0 -5
  116. package/bin/_internal/fastmcp-3.4.7.dist-info/WHEEL +0 -4
  117. package/bin/_internal/fastmcp-3.4.7.dist-info/licenses/LICENSE +0 -201
  118. package/bin/_internal/frozenlist/_frozenlist.cp312-win_amd64.pyd +0 -0
  119. package/bin/_internal/httpcore2-2.12.0.dist-info/INSTALLER +0 -1
  120. package/bin/_internal/httpcore2-2.12.0.dist-info/METADATA +0 -737
  121. package/bin/_internal/httpcore2-2.12.0.dist-info/RECORD +0 -68
  122. package/bin/_internal/httpcore2-2.12.0.dist-info/WHEEL +0 -4
  123. package/bin/_internal/httpcore2-2.12.0.dist-info/licenses/LICENSE.md +0 -28
  124. package/bin/_internal/httpx2-2.12.0.dist-info/INSTALLER +0 -1
  125. package/bin/_internal/httpx2-2.12.0.dist-info/METADATA +0 -230
  126. package/bin/_internal/httpx2-2.12.0.dist-info/RECORD +0 -68
  127. package/bin/_internal/httpx2-2.12.0.dist-info/WHEEL +0 -4
  128. package/bin/_internal/httpx2-2.12.0.dist-info/entry_points.txt +0 -2
  129. package/bin/_internal/httpx2-2.12.0.dist-info/licenses/LICENSE.md +0 -13
  130. package/bin/_internal/integrations/cli_wrappers/IMPORTANT_USE_CASES.md +0 -33
  131. package/bin/_internal/integrations/github/claude-code-action/CLAUDE.md +0 -136
  132. package/bin/_internal/integrations/github/claude-code-action/CODE_OF_CONDUCT.md +0 -128
  133. package/bin/_internal/integrations/github/claude-code-action/CONTRIBUTING.md +0 -116
  134. package/bin/_internal/integrations/github/claude-code-action/LICENSE +0 -21
  135. package/bin/_internal/integrations/github/claude-code-action/README.md +0 -53
  136. package/bin/_internal/integrations/github/claude-code-action/ROADMAP.md +0 -20
  137. package/bin/_internal/integrations/github/claude-code-action/SECURITY.md +0 -15
  138. package/bin/_internal/integrations/github/claude-code-action/action.yml +0 -294
  139. package/bin/_internal/integrations/github/claude-code-action/base-action/CLAUDE.md +0 -60
  140. package/bin/_internal/integrations/github/claude-code-action/base-action/CODE_OF_CONDUCT.md +0 -128
  141. package/bin/_internal/integrations/github/claude-code-action/base-action/CONTRIBUTING.md +0 -136
  142. package/bin/_internal/integrations/github/claude-code-action/base-action/LICENSE +0 -21
  143. package/bin/_internal/integrations/github/claude-code-action/base-action/MIRROR_DISCLAIMER.md +0 -11
  144. package/bin/_internal/integrations/github/claude-code-action/base-action/README.md +0 -521
  145. package/bin/_internal/integrations/github/claude-code-action/base-action/action.yml +0 -149
  146. package/bin/_internal/integrations/github/claude-code-action/base-action/bun.lock +0 -54
  147. package/bin/_internal/integrations/github/claude-code-action/base-action/examples/issue-triage.yml +0 -108
  148. package/bin/_internal/integrations/github/claude-code-action/base-action/package.json +0 -23
  149. package/bin/_internal/integrations/github/claude-code-action/base-action/scripts/install-hooks.sh +0 -13
  150. package/bin/_internal/integrations/github/claude-code-action/base-action/scripts/pre-push +0 -46
  151. package/bin/_internal/integrations/github/claude-code-action/base-action/src/index.ts +0 -82
  152. package/bin/_internal/integrations/github/claude-code-action/base-action/src/prepare-prompt.ts +0 -82
  153. package/bin/_internal/integrations/github/claude-code-action/base-action/src/run-claude.ts +0 -257
  154. package/bin/_internal/integrations/github/claude-code-action/base-action/src/run-vicoa.ts +0 -301
  155. package/bin/_internal/integrations/github/claude-code-action/base-action/src/setup-claude-code-settings.ts +0 -68
  156. package/bin/_internal/integrations/github/claude-code-action/base-action/src/validate-env.ts +0 -54
  157. package/bin/_internal/integrations/github/claude-code-action/base-action/test-local.sh +0 -12
  158. package/bin/_internal/integrations/github/claude-code-action/base-action/test-mcp-local.sh +0 -18
  159. package/bin/_internal/integrations/github/claude-code-action/base-action/tsconfig.json +0 -30
  160. package/bin/_internal/integrations/github/claude-code-action/bun.lock +0 -384
  161. package/bin/_internal/integrations/github/claude-code-action/docs/capabilities-and-limitations.md +0 -33
  162. package/bin/_internal/integrations/github/claude-code-action/docs/cloud-providers.md +0 -99
  163. package/bin/_internal/integrations/github/claude-code-action/docs/configuration.md +0 -345
  164. package/bin/_internal/integrations/github/claude-code-action/docs/custom-automations.md +0 -113
  165. package/bin/_internal/integrations/github/claude-code-action/docs/experimental.md +0 -128
  166. package/bin/_internal/integrations/github/claude-code-action/docs/faq.md +0 -205
  167. package/bin/_internal/integrations/github/claude-code-action/docs/migration-guide.md +0 -261
  168. package/bin/_internal/integrations/github/claude-code-action/docs/security.md +0 -38
  169. package/bin/_internal/integrations/github/claude-code-action/docs/setup.md +0 -146
  170. package/bin/_internal/integrations/github/claude-code-action/docs/usage.md +0 -213
  171. package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci/auto-fix-ci.yml +0 -97
  172. package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci/commands/fix-ci.md +0 -127
  173. package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci-signed/auto-fix-ci-signed.yml +0 -97
  174. package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci-signed/commands/fix-ci-signed.md +0 -148
  175. package/bin/_internal/integrations/github/claude-code-action/examples/issue-deduplication.yml +0 -63
  176. package/bin/_internal/integrations/github/claude-code-action/examples/issue-triage.yml +0 -75
  177. package/bin/_internal/integrations/github/claude-code-action/examples/vicoa.yml +0 -75
  178. package/bin/_internal/integrations/github/claude-code-action/package.json +0 -31
  179. package/bin/_internal/integrations/github/claude-code-action/scripts/install-hooks.sh +0 -13
  180. package/bin/_internal/integrations/github/claude-code-action/scripts/pre-commit +0 -46
  181. package/bin/_internal/integrations/github/claude-code-action/scripts/setup-network-restrictions.sh +0 -123
  182. package/bin/_internal/integrations/github/claude-code-action/src/create-prompt/index.ts +0 -799
  183. package/bin/_internal/integrations/github/claude-code-action/src/create-prompt/types.ts +0 -102
  184. package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/collect-inputs.ts +0 -58
  185. package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/format-turns.ts +0 -465
  186. package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/prepare.ts +0 -98
  187. package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/update-comment-link.ts +0 -245
  188. package/bin/_internal/integrations/github/claude-code-action/src/github/api/client.ts +0 -23
  189. package/bin/_internal/integrations/github/claude-code-action/src/github/api/config.ts +0 -4
  190. package/bin/_internal/integrations/github/claude-code-action/src/github/api/queries/github.ts +0 -117
  191. package/bin/_internal/integrations/github/claude-code-action/src/github/context.ts +0 -277
  192. package/bin/_internal/integrations/github/claude-code-action/src/github/data/fetcher.ts +0 -233
  193. package/bin/_internal/integrations/github/claude-code-action/src/github/data/formatter.ts +0 -144
  194. package/bin/_internal/integrations/github/claude-code-action/src/github/operations/branch-cleanup.ts +0 -132
  195. package/bin/_internal/integrations/github/claude-code-action/src/github/operations/branch.ts +0 -163
  196. package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comment-logic.ts +0 -203
  197. package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/common.ts +0 -33
  198. package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/create-initial.ts +0 -111
  199. package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/update-claude-comment.ts +0 -70
  200. package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/update-with-branch.ts +0 -57
  201. package/bin/_internal/integrations/github/claude-code-action/src/github/operations/git-config.ts +0 -62
  202. package/bin/_internal/integrations/github/claude-code-action/src/github/token.ts +0 -108
  203. package/bin/_internal/integrations/github/claude-code-action/src/github/types.ts +0 -98
  204. package/bin/_internal/integrations/github/claude-code-action/src/github/utils/image-downloader.ts +0 -246
  205. package/bin/_internal/integrations/github/claude-code-action/src/github/utils/sanitizer.ts +0 -100
  206. package/bin/_internal/integrations/github/claude-code-action/src/github/validation/actor.ts +0 -64
  207. package/bin/_internal/integrations/github/claude-code-action/src/github/validation/permissions.ts +0 -47
  208. package/bin/_internal/integrations/github/claude-code-action/src/github/validation/trigger.ts +0 -148
  209. package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-actions-server.ts +0 -279
  210. package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-comment-server.ts +0 -101
  211. package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-file-ops-server.ts +0 -677
  212. package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-inline-comment-server.ts +0 -184
  213. package/bin/_internal/integrations/github/claude-code-action/src/mcp/install-mcp-server.ts +0 -201
  214. package/bin/_internal/integrations/github/claude-code-action/src/modes/agent/index.ts +0 -152
  215. package/bin/_internal/integrations/github/claude-code-action/src/modes/agent/parse-tools.ts +0 -22
  216. package/bin/_internal/integrations/github/claude-code-action/src/modes/detector.ts +0 -66
  217. package/bin/_internal/integrations/github/claude-code-action/src/modes/registry.ts +0 -54
  218. package/bin/_internal/integrations/github/claude-code-action/src/modes/tag/index.ts +0 -187
  219. package/bin/_internal/integrations/github/claude-code-action/src/modes/types.ts +0 -100
  220. package/bin/_internal/integrations/github/claude-code-action/src/prepare/index.ts +0 -20
  221. package/bin/_internal/integrations/github/claude-code-action/src/prepare/types.ts +0 -20
  222. package/bin/_internal/integrations/github/claude-code-action/src/utils/retry.ts +0 -40
  223. package/bin/_internal/integrations/github/claude-code-action/tsconfig.json +0 -30
  224. package/bin/_internal/integrations/headless/tests/README.md +0 -58
  225. package/bin/_internal/integrations/n8n/LICENSE +0 -21
  226. package/bin/_internal/integrations/n8n/README.md +0 -298
  227. package/bin/_internal/integrations/n8n/package-lock.json +0 -2989
  228. package/bin/_internal/integrations/n8n/package.json +0 -68
  229. package/bin/_internal/integrations/n8n/src/credentials/OmnaraApi.credentials.ts +0 -52
  230. package/bin/_internal/integrations/n8n/src/nodes/Omnara/Omnara.node.json +0 -35
  231. package/bin/_internal/integrations/n8n/src/nodes/Omnara/Omnara.node.ts +0 -304
  232. package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/message/index.ts +0 -37
  233. package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/message/send.operation.ts +0 -151
  234. package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/message/sendAndWait.operation.ts +0 -252
  235. package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/session/end.operation.ts +0 -56
  236. package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/session/index.ts +0 -29
  237. package/bin/_internal/integrations/n8n/src/nodes/Omnara/vicoa.png +0 -0
  238. package/bin/_internal/integrations/n8n/src/utils/GenericFunctions.ts +0 -93
  239. package/bin/_internal/integrations/n8n/src/utils/sendAndWait/configureWaitTillDate.ts +0 -42
  240. package/bin/_internal/integrations/n8n/src/utils/sendAndWait/descriptions.ts +0 -20
  241. package/bin/_internal/integrations/n8n/src/utils/sendAndWaitWebhook.ts +0 -72
  242. package/bin/_internal/integrations/n8n/tsconfig.json +0 -20
  243. package/bin/_internal/jiter/jiter.cp312-win_amd64.pyd +0 -0
  244. package/bin/_internal/jsonschema/benchmarks/issue232/issue.json +0 -2653
  245. package/bin/_internal/jsonschema-4.26.0.dist-info/INSTALLER +0 -1
  246. package/bin/_internal/jsonschema-4.26.0.dist-info/METADATA +0 -170
  247. package/bin/_internal/jsonschema-4.26.0.dist-info/RECORD +0 -82
  248. package/bin/_internal/jsonschema-4.26.0.dist-info/WHEEL +0 -4
  249. package/bin/_internal/jsonschema-4.26.0.dist-info/entry_points.txt +0 -2
  250. package/bin/_internal/jsonschema-4.26.0.dist-info/licenses/COPYING +0 -19
  251. package/bin/_internal/jsonschema_specifications/schemas/draft201909/metaschema.json +0 -42
  252. package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/applicator +0 -56
  253. package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/content +0 -17
  254. package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/core +0 -57
  255. package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/format +0 -14
  256. package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/meta-data +0 -37
  257. package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/validation +0 -98
  258. package/bin/_internal/jsonschema_specifications/schemas/draft202012/metaschema.json +0 -58
  259. package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/applicator +0 -48
  260. package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/content +0 -17
  261. package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/core +0 -51
  262. package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/format-annotation +0 -14
  263. package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/format-assertion +0 -14
  264. package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/meta-data +0 -37
  265. package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/unevaluated +0 -15
  266. package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/validation +0 -98
  267. package/bin/_internal/jsonschema_specifications/schemas/draft3/metaschema.json +0 -172
  268. package/bin/_internal/jsonschema_specifications/schemas/draft4/metaschema.json +0 -149
  269. package/bin/_internal/jsonschema_specifications/schemas/draft6/metaschema.json +0 -153
  270. package/bin/_internal/jsonschema_specifications/schemas/draft7/metaschema.json +0 -166
  271. package/bin/_internal/libcrypto-3.dll +0 -0
  272. package/bin/_internal/libffi-8.dll +0 -0
  273. package/bin/_internal/libssl-3.dll +0 -0
  274. package/bin/_internal/mcp-1.29.0.dist-info/INSTALLER +0 -1
  275. package/bin/_internal/mcp-1.29.0.dist-info/METADATA +0 -239
  276. package/bin/_internal/mcp-1.29.0.dist-info/RECORD +0 -228
  277. package/bin/_internal/mcp-1.29.0.dist-info/WHEEL +0 -4
  278. package/bin/_internal/mcp-1.29.0.dist-info/entry_points.txt +0 -2
  279. package/bin/_internal/mcp-1.29.0.dist-info/licenses/LICENSE +0 -21
  280. package/bin/_internal/multidict/_multidict.cp312-win_amd64.pyd +0 -0
  281. package/bin/_internal/opentelemetry_api-1.44.0.dist-info/INSTALLER +0 -1
  282. package/bin/_internal/opentelemetry_api-1.44.0.dist-info/METADATA +0 -43
  283. package/bin/_internal/opentelemetry_api-1.44.0.dist-info/RECORD +0 -78
  284. package/bin/_internal/opentelemetry_api-1.44.0.dist-info/WHEEL +0 -4
  285. package/bin/_internal/opentelemetry_api-1.44.0.dist-info/entry_points.txt +0 -15
  286. package/bin/_internal/opentelemetry_api-1.44.0.dist-info/licenses/LICENSE +0 -201
  287. package/bin/_internal/propcache/_helpers_c.cp312-win_amd64.pyd +0 -0
  288. package/bin/_internal/pydantic-2.13.4.dist-info/INSTALLER +0 -1
  289. package/bin/_internal/pydantic-2.13.4.dist-info/METADATA +0 -1294
  290. package/bin/_internal/pydantic-2.13.4.dist-info/RECORD +0 -217
  291. package/bin/_internal/pydantic-2.13.4.dist-info/WHEEL +0 -4
  292. package/bin/_internal/pydantic-2.13.4.dist-info/licenses/LICENSE +0 -21
  293. package/bin/_internal/pydantic_core/_pydantic_core.cp312-win_amd64.pyd +0 -0
  294. package/bin/_internal/pyexpat.pyd +0 -0
  295. package/bin/_internal/python3.dll +0 -0
  296. package/bin/_internal/python312.dll +0 -0
  297. package/bin/_internal/pywin32_system32/pythoncom312.dll +0 -0
  298. package/bin/_internal/pywin32_system32/pywintypes312.dll +0 -0
  299. package/bin/_internal/rpds/rpds.cp312-win_amd64.pyd +0 -0
  300. package/bin/_internal/select.pyd +0 -0
  301. package/bin/_internal/setuptools/_vendor/jaraco/text/Lorem ipsum.txt +0 -2
  302. package/bin/_internal/sqlite3.dll +0 -0
  303. package/bin/_internal/ucrtbase.dll +0 -0
  304. package/bin/_internal/unicodedata.pyd +0 -0
  305. package/bin/_internal/vicoa/_bin/README.md +0 -28
  306. package/bin/_internal/vicoa-1.7.12.dist-info/INSTALLER +0 -1
  307. package/bin/_internal/vicoa-1.7.12.dist-info/METADATA +0 -314
  308. package/bin/_internal/vicoa-1.7.12.dist-info/RECORD +0 -11
  309. package/bin/_internal/vicoa-1.7.12.dist-info/REQUESTED +0 -0
  310. package/bin/_internal/vicoa-1.7.12.dist-info/WHEEL +0 -5
  311. package/bin/_internal/vicoa-1.7.12.dist-info/direct_url.json +0 -1
  312. package/bin/_internal/vicoa-1.7.12.dist-info/entry_points.txt +0 -2
  313. package/bin/_internal/vicoa-1.7.12.dist-info/licenses/LICENSE +0 -201
  314. package/bin/_internal/vicoa-1.7.12.dist-info/top_level.txt +0 -4
  315. package/bin/_internal/watchfiles/_rust_notify.cp312-win_amd64.pyd +0 -0
  316. package/bin/_internal/websockets/speedups.cp312-win_amd64.pyd +0 -0
  317. package/bin/_internal/websockets-17.0.1.dist-info/INSTALLER +0 -1
  318. package/bin/_internal/websockets-17.0.1.dist-info/METADATA +0 -170
  319. package/bin/_internal/websockets-17.0.1.dist-info/RECORD +0 -116
  320. package/bin/_internal/websockets-17.0.1.dist-info/WHEEL +0 -5
  321. package/bin/_internal/websockets-17.0.1.dist-info/entry_points.txt +0 -2
  322. package/bin/_internal/websockets-17.0.1.dist-info/licenses/LICENSE +0 -24
  323. package/bin/_internal/websockets-17.0.1.dist-info/top_level.txt +0 -1
  324. package/bin/_internal/win32/_win32sysloader.pyd +0 -0
  325. package/bin/_internal/win32/win32api.pyd +0 -0
  326. package/bin/_internal/win32/win32evtlog.pyd +0 -0
  327. package/bin/_internal/win32/win32job.pyd +0 -0
  328. package/bin/_internal/yaml/_yaml.cp312-win_amd64.pyd +0 -0
  329. package/bin/_internal/yarl/_quoting_c.cp312-win_amd64.pyd +0 -0
  330. package/bin/vicoa.exe +0 -0
@@ -1,677 +0,0 @@
1
- #!/usr/bin/env node
2
- // GitHub File Operations MCP Server
3
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
- import { z } from "zod";
6
- import { readFile, stat } from "fs/promises";
7
- import { join } from "path";
8
- import { constants } from "fs";
9
- import fetch from "node-fetch";
10
- import { GITHUB_API_URL } from "../github/api/config";
11
- import { retryWithBackoff } from "../utils/retry";
12
-
13
- type GitHubRef = {
14
- object: {
15
- sha: string;
16
- };
17
- };
18
-
19
- type GitHubCommit = {
20
- tree: {
21
- sha: string;
22
- };
23
- };
24
-
25
- type GitHubTree = {
26
- sha: string;
27
- };
28
-
29
- type GitHubNewCommit = {
30
- sha: string;
31
- message: string;
32
- author: {
33
- name: string;
34
- date: string;
35
- };
36
- };
37
-
38
- // Get repository information from environment variables
39
- const REPO_OWNER = process.env.REPO_OWNER;
40
- const REPO_NAME = process.env.REPO_NAME;
41
- const BRANCH_NAME = process.env.BRANCH_NAME;
42
- const REPO_DIR = process.env.REPO_DIR || process.cwd();
43
-
44
- if (!REPO_OWNER || !REPO_NAME || !BRANCH_NAME) {
45
- console.error(
46
- "Error: REPO_OWNER, REPO_NAME, and BRANCH_NAME environment variables are required",
47
- );
48
- process.exit(1);
49
- }
50
-
51
- const server = new McpServer({
52
- name: "GitHub File Operations Server",
53
- version: "0.0.1",
54
- });
55
-
56
- // Helper function to get or create branch reference
57
- async function getOrCreateBranchRef(
58
- owner: string,
59
- repo: string,
60
- branch: string,
61
- githubToken: string,
62
- ): Promise<string> {
63
- // Try to get the branch reference
64
- const refUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/refs/heads/${branch}`;
65
- const refResponse = await fetch(refUrl, {
66
- headers: {
67
- Accept: "application/vnd.github+json",
68
- Authorization: `Bearer ${githubToken}`,
69
- "X-GitHub-Api-Version": "2022-11-28",
70
- },
71
- });
72
-
73
- if (refResponse.ok) {
74
- const refData = (await refResponse.json()) as GitHubRef;
75
- return refData.object.sha;
76
- }
77
-
78
- if (refResponse.status !== 404) {
79
- throw new Error(`Failed to get branch reference: ${refResponse.status}`);
80
- }
81
-
82
- const baseBranch = process.env.BASE_BRANCH!;
83
-
84
- // Get the SHA of the base branch
85
- const baseRefUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/refs/heads/${baseBranch}`;
86
- const baseRefResponse = await fetch(baseRefUrl, {
87
- headers: {
88
- Accept: "application/vnd.github+json",
89
- Authorization: `Bearer ${githubToken}`,
90
- "X-GitHub-Api-Version": "2022-11-28",
91
- },
92
- });
93
-
94
- let baseSha: string;
95
-
96
- if (!baseRefResponse.ok) {
97
- // If base branch doesn't exist, try default branch
98
- const repoUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}`;
99
- const repoResponse = await fetch(repoUrl, {
100
- headers: {
101
- Accept: "application/vnd.github+json",
102
- Authorization: `Bearer ${githubToken}`,
103
- "X-GitHub-Api-Version": "2022-11-28",
104
- },
105
- });
106
-
107
- if (!repoResponse.ok) {
108
- throw new Error(`Failed to get repository info: ${repoResponse.status}`);
109
- }
110
-
111
- const repoData = (await repoResponse.json()) as {
112
- default_branch: string;
113
- };
114
- const defaultBranch = repoData.default_branch;
115
-
116
- // Try default branch
117
- const defaultRefUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/refs/heads/${defaultBranch}`;
118
- const defaultRefResponse = await fetch(defaultRefUrl, {
119
- headers: {
120
- Accept: "application/vnd.github+json",
121
- Authorization: `Bearer ${githubToken}`,
122
- "X-GitHub-Api-Version": "2022-11-28",
123
- },
124
- });
125
-
126
- if (!defaultRefResponse.ok) {
127
- throw new Error(
128
- `Failed to get default branch reference: ${defaultRefResponse.status}`,
129
- );
130
- }
131
-
132
- const defaultRefData = (await defaultRefResponse.json()) as GitHubRef;
133
- baseSha = defaultRefData.object.sha;
134
- } else {
135
- const baseRefData = (await baseRefResponse.json()) as GitHubRef;
136
- baseSha = baseRefData.object.sha;
137
- }
138
-
139
- // Create the new branch using the same pattern as octokit
140
- const createRefUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/refs`;
141
- const createRefResponse = await fetch(createRefUrl, {
142
- method: "POST",
143
- headers: {
144
- Accept: "application/vnd.github+json",
145
- Authorization: `Bearer ${githubToken}`,
146
- "X-GitHub-Api-Version": "2022-11-28",
147
- "Content-Type": "application/json",
148
- },
149
- body: JSON.stringify({
150
- ref: `refs/heads/${branch}`,
151
- sha: baseSha,
152
- }),
153
- });
154
-
155
- if (!createRefResponse.ok) {
156
- const errorText = await createRefResponse.text();
157
- throw new Error(
158
- `Failed to create branch: ${createRefResponse.status} - ${errorText}`,
159
- );
160
- }
161
-
162
- console.log(`Successfully created branch ${branch}`);
163
- return baseSha;
164
- }
165
-
166
- // Get the appropriate Git file mode for a file
167
- async function getFileMode(filePath: string): Promise<string> {
168
- try {
169
- const fileStat = await stat(filePath);
170
- if (fileStat.isFile()) {
171
- // Check if execute bit is set for user
172
- if (fileStat.mode & constants.S_IXUSR) {
173
- return "100755"; // Executable file
174
- } else {
175
- return "100644"; // Regular file
176
- }
177
- } else if (fileStat.isDirectory()) {
178
- return "040000"; // Directory (tree)
179
- } else if (fileStat.isSymbolicLink()) {
180
- return "120000"; // Symbolic link
181
- } else {
182
- // Fallback for unknown file types
183
- return "100644";
184
- }
185
- } catch (error) {
186
- // If we can't stat the file, default to regular file
187
- console.warn(
188
- `Could not determine file mode for ${filePath}, using default: ${error}`,
189
- );
190
- return "100644";
191
- }
192
- }
193
-
194
- // Commit files tool
195
- server.tool(
196
- "commit_files",
197
- "Commit one or more files to a repository in a single commit (this will commit them atomically in the remote repository)",
198
- {
199
- files: z
200
- .array(z.string())
201
- .describe(
202
- 'Array of file paths relative to repository root (e.g. ["src/main.js", "README.md"]). All files must exist locally.',
203
- ),
204
- message: z.string().describe("Commit message"),
205
- },
206
- async ({ files, message }) => {
207
- const owner = REPO_OWNER;
208
- const repo = REPO_NAME;
209
- const branch = BRANCH_NAME;
210
- try {
211
- const githubToken = process.env.GITHUB_TOKEN;
212
- if (!githubToken) {
213
- throw new Error("GITHUB_TOKEN environment variable is required");
214
- }
215
-
216
- const processedFiles = files.map((filePath) => {
217
- if (filePath.startsWith("/")) {
218
- return filePath.slice(1);
219
- }
220
- return filePath;
221
- });
222
-
223
- // 1. Get the branch reference (create if doesn't exist)
224
- const baseSha = await getOrCreateBranchRef(
225
- owner,
226
- repo,
227
- branch,
228
- githubToken,
229
- );
230
-
231
- // 2. Get the base commit
232
- const commitUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/commits/${baseSha}`;
233
- const commitResponse = await fetch(commitUrl, {
234
- headers: {
235
- Accept: "application/vnd.github+json",
236
- Authorization: `Bearer ${githubToken}`,
237
- "X-GitHub-Api-Version": "2022-11-28",
238
- },
239
- });
240
-
241
- if (!commitResponse.ok) {
242
- throw new Error(`Failed to get base commit: ${commitResponse.status}`);
243
- }
244
-
245
- const commitData = (await commitResponse.json()) as GitHubCommit;
246
- const baseTreeSha = commitData.tree.sha;
247
-
248
- // 3. Create tree entries for all files
249
- const treeEntries = await Promise.all(
250
- processedFiles.map(async (filePath) => {
251
- const fullPath = filePath.startsWith("/")
252
- ? filePath
253
- : join(REPO_DIR, filePath);
254
-
255
- // Get the proper file mode based on file permissions
256
- const fileMode = await getFileMode(fullPath);
257
-
258
- // Check if file is binary (images, etc.)
259
- const isBinaryFile =
260
- /\.(png|jpg|jpeg|gif|webp|ico|pdf|zip|tar|gz|exe|bin|woff|woff2|ttf|eot)$/i.test(
261
- filePath,
262
- );
263
-
264
- if (isBinaryFile) {
265
- // For binary files, create a blob first using the Blobs API
266
- const binaryContent = await readFile(fullPath);
267
-
268
- // Create blob using Blobs API (supports encoding parameter)
269
- const blobUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/blobs`;
270
- const blobResponse = await fetch(blobUrl, {
271
- method: "POST",
272
- headers: {
273
- Accept: "application/vnd.github+json",
274
- Authorization: `Bearer ${githubToken}`,
275
- "X-GitHub-Api-Version": "2022-11-28",
276
- "Content-Type": "application/json",
277
- },
278
- body: JSON.stringify({
279
- content: binaryContent.toString("base64"),
280
- encoding: "base64",
281
- }),
282
- });
283
-
284
- if (!blobResponse.ok) {
285
- const errorText = await blobResponse.text();
286
- throw new Error(
287
- `Failed to create blob for ${filePath}: ${blobResponse.status} - ${errorText}`,
288
- );
289
- }
290
-
291
- const blobData = (await blobResponse.json()) as { sha: string };
292
-
293
- // Return tree entry with blob SHA
294
- return {
295
- path: filePath,
296
- mode: fileMode,
297
- type: "blob",
298
- sha: blobData.sha,
299
- };
300
- } else {
301
- // For text files, include content directly in tree
302
- const content = await readFile(fullPath, "utf-8");
303
- return {
304
- path: filePath,
305
- mode: fileMode,
306
- type: "blob",
307
- content: content,
308
- };
309
- }
310
- }),
311
- );
312
-
313
- // 4. Create a new tree
314
- const treeUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/trees`;
315
- const treeResponse = await fetch(treeUrl, {
316
- method: "POST",
317
- headers: {
318
- Accept: "application/vnd.github+json",
319
- Authorization: `Bearer ${githubToken}`,
320
- "X-GitHub-Api-Version": "2022-11-28",
321
- "Content-Type": "application/json",
322
- },
323
- body: JSON.stringify({
324
- base_tree: baseTreeSha,
325
- tree: treeEntries,
326
- }),
327
- });
328
-
329
- if (!treeResponse.ok) {
330
- const errorText = await treeResponse.text();
331
- throw new Error(
332
- `Failed to create tree: ${treeResponse.status} - ${errorText}`,
333
- );
334
- }
335
-
336
- const treeData = (await treeResponse.json()) as GitHubTree;
337
-
338
- // 5. Create a new commit
339
- const newCommitUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/commits`;
340
- const newCommitResponse = await fetch(newCommitUrl, {
341
- method: "POST",
342
- headers: {
343
- Accept: "application/vnd.github+json",
344
- Authorization: `Bearer ${githubToken}`,
345
- "X-GitHub-Api-Version": "2022-11-28",
346
- "Content-Type": "application/json",
347
- },
348
- body: JSON.stringify({
349
- message: message,
350
- tree: treeData.sha,
351
- parents: [baseSha],
352
- }),
353
- });
354
-
355
- if (!newCommitResponse.ok) {
356
- const errorText = await newCommitResponse.text();
357
- throw new Error(
358
- `Failed to create commit: ${newCommitResponse.status} - ${errorText}`,
359
- );
360
- }
361
-
362
- const newCommitData = (await newCommitResponse.json()) as GitHubNewCommit;
363
-
364
- // 6. Update the reference to point to the new commit
365
- const updateRefUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/refs/heads/${branch}`;
366
-
367
- // We're seeing intermittent 403 "Resource not accessible by integration" errors
368
- // on certain repos when updating git references. These appear to be transient
369
- // GitHub API issues that succeed on retry.
370
- await retryWithBackoff(
371
- async () => {
372
- const updateRefResponse = await fetch(updateRefUrl, {
373
- method: "PATCH",
374
- headers: {
375
- Accept: "application/vnd.github+json",
376
- Authorization: `Bearer ${githubToken}`,
377
- "X-GitHub-Api-Version": "2022-11-28",
378
- "Content-Type": "application/json",
379
- },
380
- body: JSON.stringify({
381
- sha: newCommitData.sha,
382
- force: false,
383
- }),
384
- });
385
-
386
- if (!updateRefResponse.ok) {
387
- const errorText = await updateRefResponse.text();
388
-
389
- // Provide a more helpful error message for 403 permission errors
390
- if (updateRefResponse.status === 403) {
391
- const permissionError = new Error(
392
- `Permission denied: Unable to push commits to branch '${branch}'. ` +
393
- `Please rebase your branch from the main/master branch to allow Claude to commit.\n\n` +
394
- `Original error: ${errorText}`,
395
- );
396
- throw permissionError;
397
- }
398
-
399
- // For other errors, use the original message
400
- const error = new Error(
401
- `Failed to update reference: ${updateRefResponse.status} - ${errorText}`,
402
- );
403
-
404
- // For non-403 errors, fail immediately without retry
405
- console.error("Non-retryable error:", updateRefResponse.status);
406
- throw error;
407
- }
408
- },
409
- {
410
- maxAttempts: 3,
411
- initialDelayMs: 1000, // Start with 1 second delay
412
- maxDelayMs: 5000, // Max 5 seconds delay
413
- backoffFactor: 2, // Double the delay each time
414
- },
415
- );
416
-
417
- const simplifiedResult = {
418
- commit: {
419
- sha: newCommitData.sha,
420
- message: newCommitData.message,
421
- author: newCommitData.author.name,
422
- date: newCommitData.author.date,
423
- },
424
- files: processedFiles.map((path) => ({ path })),
425
- tree: {
426
- sha: treeData.sha,
427
- },
428
- };
429
-
430
- return {
431
- content: [
432
- {
433
- type: "text",
434
- text: JSON.stringify(simplifiedResult, null, 2),
435
- },
436
- ],
437
- };
438
- } catch (error) {
439
- const errorMessage =
440
- error instanceof Error ? error.message : String(error);
441
- return {
442
- content: [
443
- {
444
- type: "text",
445
- text: `Error: ${errorMessage}`,
446
- },
447
- ],
448
- error: errorMessage,
449
- isError: true,
450
- };
451
- }
452
- },
453
- );
454
-
455
- // Delete files tool
456
- server.tool(
457
- "delete_files",
458
- "Delete one or more files from a repository in a single commit",
459
- {
460
- paths: z
461
- .array(z.string())
462
- .describe(
463
- 'Array of file paths to delete relative to repository root (e.g. ["src/old-file.js", "docs/deprecated.md"])',
464
- ),
465
- message: z.string().describe("Commit message"),
466
- },
467
- async ({ paths, message }) => {
468
- const owner = REPO_OWNER;
469
- const repo = REPO_NAME;
470
- const branch = BRANCH_NAME;
471
- try {
472
- const githubToken = process.env.GITHUB_TOKEN;
473
- if (!githubToken) {
474
- throw new Error("GITHUB_TOKEN environment variable is required");
475
- }
476
-
477
- // Convert absolute paths to relative if they match CWD
478
- const cwd = process.cwd();
479
- const processedPaths = paths.map((filePath) => {
480
- if (filePath.startsWith("/")) {
481
- if (filePath.startsWith(cwd)) {
482
- // Strip CWD from absolute path
483
- return filePath.slice(cwd.length + 1);
484
- } else {
485
- throw new Error(
486
- `Path '${filePath}' must be relative to repository root or within current working directory`,
487
- );
488
- }
489
- }
490
- return filePath;
491
- });
492
-
493
- // 1. Get the branch reference (create if doesn't exist)
494
- const baseSha = await getOrCreateBranchRef(
495
- owner,
496
- repo,
497
- branch,
498
- githubToken,
499
- );
500
-
501
- // 2. Get the base commit
502
- const commitUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/commits/${baseSha}`;
503
- const commitResponse = await fetch(commitUrl, {
504
- headers: {
505
- Accept: "application/vnd.github+json",
506
- Authorization: `Bearer ${githubToken}`,
507
- "X-GitHub-Api-Version": "2022-11-28",
508
- },
509
- });
510
-
511
- if (!commitResponse.ok) {
512
- throw new Error(`Failed to get base commit: ${commitResponse.status}`);
513
- }
514
-
515
- const commitData = (await commitResponse.json()) as GitHubCommit;
516
- const baseTreeSha = commitData.tree.sha;
517
-
518
- // 3. Create tree entries for file deletions (setting SHA to null)
519
- const treeEntries = processedPaths.map((path) => ({
520
- path: path,
521
- mode: "100644",
522
- type: "blob" as const,
523
- sha: null,
524
- }));
525
-
526
- // 4. Create a new tree with deletions
527
- const treeUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/trees`;
528
- const treeResponse = await fetch(treeUrl, {
529
- method: "POST",
530
- headers: {
531
- Accept: "application/vnd.github+json",
532
- Authorization: `Bearer ${githubToken}`,
533
- "X-GitHub-Api-Version": "2022-11-28",
534
- "Content-Type": "application/json",
535
- },
536
- body: JSON.stringify({
537
- base_tree: baseTreeSha,
538
- tree: treeEntries,
539
- }),
540
- });
541
-
542
- if (!treeResponse.ok) {
543
- const errorText = await treeResponse.text();
544
- throw new Error(
545
- `Failed to create tree: ${treeResponse.status} - ${errorText}`,
546
- );
547
- }
548
-
549
- const treeData = (await treeResponse.json()) as GitHubTree;
550
-
551
- // 5. Create a new commit
552
- const newCommitUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/commits`;
553
- const newCommitResponse = await fetch(newCommitUrl, {
554
- method: "POST",
555
- headers: {
556
- Accept: "application/vnd.github+json",
557
- Authorization: `Bearer ${githubToken}`,
558
- "X-GitHub-Api-Version": "2022-11-28",
559
- "Content-Type": "application/json",
560
- },
561
- body: JSON.stringify({
562
- message: message,
563
- tree: treeData.sha,
564
- parents: [baseSha],
565
- }),
566
- });
567
-
568
- if (!newCommitResponse.ok) {
569
- const errorText = await newCommitResponse.text();
570
- throw new Error(
571
- `Failed to create commit: ${newCommitResponse.status} - ${errorText}`,
572
- );
573
- }
574
-
575
- const newCommitData = (await newCommitResponse.json()) as GitHubNewCommit;
576
-
577
- // 6. Update the reference to point to the new commit
578
- const updateRefUrl = `${GITHUB_API_URL}/repos/${owner}/${repo}/git/refs/heads/${branch}`;
579
-
580
- // We're seeing intermittent 403 "Resource not accessible by integration" errors
581
- // on certain repos when updating git references. These appear to be transient
582
- // GitHub API issues that succeed on retry.
583
- await retryWithBackoff(
584
- async () => {
585
- const updateRefResponse = await fetch(updateRefUrl, {
586
- method: "PATCH",
587
- headers: {
588
- Accept: "application/vnd.github+json",
589
- Authorization: `Bearer ${githubToken}`,
590
- "X-GitHub-Api-Version": "2022-11-28",
591
- "Content-Type": "application/json",
592
- },
593
- body: JSON.stringify({
594
- sha: newCommitData.sha,
595
- force: false,
596
- }),
597
- });
598
-
599
- if (!updateRefResponse.ok) {
600
- const errorText = await updateRefResponse.text();
601
-
602
- // Provide a more helpful error message for 403 permission errors
603
- if (updateRefResponse.status === 403) {
604
- console.log("Received 403 error, will retry...");
605
- const permissionError = new Error(
606
- `Permission denied: Unable to push commits to branch '${branch}'. ` +
607
- `Please rebase your branch from the main/master branch to allow Claude to commit.\n\n` +
608
- `Original error: ${errorText}`,
609
- );
610
- throw permissionError;
611
- }
612
-
613
- // For other errors, use the original message
614
- const error = new Error(
615
- `Failed to update reference: ${updateRefResponse.status} - ${errorText}`,
616
- );
617
-
618
- // For non-403 errors, fail immediately without retry
619
- console.error("Non-retryable error:", updateRefResponse.status);
620
- throw error;
621
- }
622
- },
623
- {
624
- maxAttempts: 3,
625
- initialDelayMs: 1000, // Start with 1 second delay
626
- maxDelayMs: 5000, // Max 5 seconds delay
627
- backoffFactor: 2, // Double the delay each time
628
- },
629
- );
630
-
631
- const simplifiedResult = {
632
- commit: {
633
- sha: newCommitData.sha,
634
- message: newCommitData.message,
635
- author: newCommitData.author.name,
636
- date: newCommitData.author.date,
637
- },
638
- deletedFiles: processedPaths.map((path) => ({ path })),
639
- tree: {
640
- sha: treeData.sha,
641
- },
642
- };
643
-
644
- return {
645
- content: [
646
- {
647
- type: "text",
648
- text: JSON.stringify(simplifiedResult, null, 2),
649
- },
650
- ],
651
- };
652
- } catch (error) {
653
- const errorMessage =
654
- error instanceof Error ? error.message : String(error);
655
- return {
656
- content: [
657
- {
658
- type: "text",
659
- text: `Error: ${errorMessage}`,
660
- },
661
- ],
662
- error: errorMessage,
663
- isError: true,
664
- };
665
- }
666
- },
667
- );
668
-
669
- async function runServer() {
670
- const transport = new StdioServerTransport();
671
- await server.connect(transport);
672
- process.on("exit", () => {
673
- server.close();
674
- });
675
- }
676
-
677
- runServer().catch(console.error);