@useconductor/conductor 1.0.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 (504) hide show
  1. package/.claude-plugin/marketplace.json +33 -0
  2. package/.claude-plugin/plugin.json +23 -0
  3. package/.eslintrc.json +23 -0
  4. package/.gitattributes +6 -0
  5. package/.github/FUNDING.yml +15 -0
  6. package/.github/ISSUE_TEMPLATE/bug_report.yml +91 -0
  7. package/.github/ISSUE_TEMPLATE/config.yml +8 -0
  8. package/.github/ISSUE_TEMPLATE/feature_request.yml +63 -0
  9. package/.github/ISSUE_TEMPLATE/plugin_request.yml +71 -0
  10. package/.github/README.md +13 -0
  11. package/.github/workflows/README.md +22 -0
  12. package/.github/workflows/auto-release.yml +112 -0
  13. package/.github/workflows/ci.yml +49 -0
  14. package/.github/workflows/claude-code-review.yml +44 -0
  15. package/.github/workflows/claude.yml +36 -0
  16. package/.github/workflows/sync-install.yml +47 -0
  17. package/.mcp.json +9 -0
  18. package/.prettierrc.json +7 -0
  19. package/C.png +0 -0
  20. package/CHANGELOG.md +74 -0
  21. package/CLAUDE.md +118 -0
  22. package/CONTRIBUTING.md +231 -0
  23. package/LICENSE +201 -0
  24. package/README.md +179 -0
  25. package/SECURITY.md +47 -0
  26. package/commands/conductor-setup.md +11 -0
  27. package/commands/conductor-status.md +7 -0
  28. package/dist/ai/base.d.ts +44 -0
  29. package/dist/ai/base.d.ts.map +1 -0
  30. package/dist/ai/base.js +47 -0
  31. package/dist/ai/base.js.map +1 -0
  32. package/dist/ai/claude.d.ts +11 -0
  33. package/dist/ai/claude.d.ts.map +1 -0
  34. package/dist/ai/claude.js +149 -0
  35. package/dist/ai/claude.js.map +1 -0
  36. package/dist/ai/gemini.d.ts +15 -0
  37. package/dist/ai/gemini.d.ts.map +1 -0
  38. package/dist/ai/gemini.js +156 -0
  39. package/dist/ai/gemini.js.map +1 -0
  40. package/dist/ai/maestro.d.ts +22 -0
  41. package/dist/ai/maestro.d.ts.map +1 -0
  42. package/dist/ai/maestro.js +142 -0
  43. package/dist/ai/maestro.js.map +1 -0
  44. package/dist/ai/manager.d.ts +47 -0
  45. package/dist/ai/manager.d.ts.map +1 -0
  46. package/dist/ai/manager.js +450 -0
  47. package/dist/ai/manager.js.map +1 -0
  48. package/dist/ai/ollama.d.ts +16 -0
  49. package/dist/ai/ollama.d.ts.map +1 -0
  50. package/dist/ai/ollama.js +151 -0
  51. package/dist/ai/ollama.js.map +1 -0
  52. package/dist/ai/openai.d.ts +11 -0
  53. package/dist/ai/openai.d.ts.map +1 -0
  54. package/dist/ai/openai.js +132 -0
  55. package/dist/ai/openai.js.map +1 -0
  56. package/dist/ai/openrouter.d.ts +11 -0
  57. package/dist/ai/openrouter.d.ts.map +1 -0
  58. package/dist/ai/openrouter.js +139 -0
  59. package/dist/ai/openrouter.js.map +1 -0
  60. package/dist/bot/slack.d.ts +17 -0
  61. package/dist/bot/slack.d.ts.map +1 -0
  62. package/dist/bot/slack.js +144 -0
  63. package/dist/bot/slack.js.map +1 -0
  64. package/dist/bot/telegram.d.ts +19 -0
  65. package/dist/bot/telegram.d.ts.map +1 -0
  66. package/dist/bot/telegram.js +157 -0
  67. package/dist/bot/telegram.js.map +1 -0
  68. package/dist/cli/commands/ai.d.ts +4 -0
  69. package/dist/cli/commands/ai.d.ts.map +1 -0
  70. package/dist/cli/commands/ai.js +161 -0
  71. package/dist/cli/commands/ai.js.map +1 -0
  72. package/dist/cli/commands/doctor.d.ts +18 -0
  73. package/dist/cli/commands/doctor.d.ts.map +1 -0
  74. package/dist/cli/commands/doctor.js +213 -0
  75. package/dist/cli/commands/doctor.js.map +1 -0
  76. package/dist/cli/commands/init.d.ts +15 -0
  77. package/dist/cli/commands/init.d.ts.map +1 -0
  78. package/dist/cli/commands/init.js +281 -0
  79. package/dist/cli/commands/init.js.map +1 -0
  80. package/dist/cli/commands/install.d.ts +16 -0
  81. package/dist/cli/commands/install.d.ts.map +1 -0
  82. package/dist/cli/commands/install.js +750 -0
  83. package/dist/cli/commands/install.js.map +1 -0
  84. package/dist/cli/commands/lifecycle.d.ts +4 -0
  85. package/dist/cli/commands/lifecycle.d.ts.map +1 -0
  86. package/dist/cli/commands/lifecycle.js +84 -0
  87. package/dist/cli/commands/lifecycle.js.map +1 -0
  88. package/dist/cli/commands/marketplace.d.ts +13 -0
  89. package/dist/cli/commands/marketplace.d.ts.map +1 -0
  90. package/dist/cli/commands/marketplace.js +197 -0
  91. package/dist/cli/commands/marketplace.js.map +1 -0
  92. package/dist/cli/commands/mcp.d.ts +6 -0
  93. package/dist/cli/commands/mcp.d.ts.map +1 -0
  94. package/dist/cli/commands/mcp.js +83 -0
  95. package/dist/cli/commands/mcp.js.map +1 -0
  96. package/dist/cli/commands/onboard.d.ts +10 -0
  97. package/dist/cli/commands/onboard.d.ts.map +1 -0
  98. package/dist/cli/commands/onboard.js +207 -0
  99. package/dist/cli/commands/onboard.js.map +1 -0
  100. package/dist/cli/commands/plugin-create.d.ts +13 -0
  101. package/dist/cli/commands/plugin-create.d.ts.map +1 -0
  102. package/dist/cli/commands/plugin-create.js +122 -0
  103. package/dist/cli/commands/plugin-create.js.map +1 -0
  104. package/dist/cli/commands/plugins.d.ts +5 -0
  105. package/dist/cli/commands/plugins.d.ts.map +1 -0
  106. package/dist/cli/commands/plugins.js +30 -0
  107. package/dist/cli/commands/plugins.js.map +1 -0
  108. package/dist/cli/commands/release.d.ts +13 -0
  109. package/dist/cli/commands/release.d.ts.map +1 -0
  110. package/dist/cli/commands/release.js +243 -0
  111. package/dist/cli/commands/release.js.map +1 -0
  112. package/dist/cli/commands/telegram.d.ts +3 -0
  113. package/dist/cli/commands/telegram.d.ts.map +1 -0
  114. package/dist/cli/commands/telegram.js +20 -0
  115. package/dist/cli/commands/telegram.js.map +1 -0
  116. package/dist/cli/index.d.ts +3 -0
  117. package/dist/cli/index.d.ts.map +1 -0
  118. package/dist/cli/index.js +402 -0
  119. package/dist/cli/index.js.map +1 -0
  120. package/dist/config/oauth.d.ts +8 -0
  121. package/dist/config/oauth.d.ts.map +1 -0
  122. package/dist/config/oauth.js +13 -0
  123. package/dist/config/oauth.js.map +1 -0
  124. package/dist/core/audit.d.ts +91 -0
  125. package/dist/core/audit.d.ts.map +1 -0
  126. package/dist/core/audit.js +233 -0
  127. package/dist/core/audit.js.map +1 -0
  128. package/dist/core/circuit-breaker.d.ts +56 -0
  129. package/dist/core/circuit-breaker.d.ts.map +1 -0
  130. package/dist/core/circuit-breaker.js +107 -0
  131. package/dist/core/circuit-breaker.js.map +1 -0
  132. package/dist/core/conductor.d.ts +44 -0
  133. package/dist/core/conductor.d.ts.map +1 -0
  134. package/dist/core/conductor.js +200 -0
  135. package/dist/core/conductor.js.map +1 -0
  136. package/dist/core/config.d.ts +66 -0
  137. package/dist/core/config.d.ts.map +1 -0
  138. package/dist/core/config.js +86 -0
  139. package/dist/core/config.js.map +1 -0
  140. package/dist/core/database.d.ts +59 -0
  141. package/dist/core/database.d.ts.map +1 -0
  142. package/dist/core/database.js +342 -0
  143. package/dist/core/database.js.map +1 -0
  144. package/dist/core/errors.d.ts +231 -0
  145. package/dist/core/errors.d.ts.map +1 -0
  146. package/dist/core/errors.js +254 -0
  147. package/dist/core/errors.js.map +1 -0
  148. package/dist/core/health.d.ts +72 -0
  149. package/dist/core/health.d.ts.map +1 -0
  150. package/dist/core/health.js +116 -0
  151. package/dist/core/health.js.map +1 -0
  152. package/dist/core/interfaces.d.ts +62 -0
  153. package/dist/core/interfaces.d.ts.map +1 -0
  154. package/dist/core/interfaces.js +8 -0
  155. package/dist/core/interfaces.js.map +1 -0
  156. package/dist/core/logger.d.ts +15 -0
  157. package/dist/core/logger.d.ts.map +1 -0
  158. package/dist/core/logger.js +30 -0
  159. package/dist/core/logger.js.map +1 -0
  160. package/dist/core/rbac.d.ts +132 -0
  161. package/dist/core/rbac.d.ts.map +1 -0
  162. package/dist/core/rbac.js +230 -0
  163. package/dist/core/rbac.js.map +1 -0
  164. package/dist/core/retry.d.ts +22 -0
  165. package/dist/core/retry.d.ts.map +1 -0
  166. package/dist/core/retry.js +41 -0
  167. package/dist/core/retry.js.map +1 -0
  168. package/dist/core/webhooks.d.ts +92 -0
  169. package/dist/core/webhooks.d.ts.map +1 -0
  170. package/dist/core/webhooks.js +176 -0
  171. package/dist/core/webhooks.js.map +1 -0
  172. package/dist/core/zero-config.d.ts +22 -0
  173. package/dist/core/zero-config.d.ts.map +1 -0
  174. package/dist/core/zero-config.js +59 -0
  175. package/dist/core/zero-config.js.map +1 -0
  176. package/dist/dashboard/cli.d.ts +6 -0
  177. package/dist/dashboard/cli.d.ts.map +1 -0
  178. package/dist/dashboard/cli.js +42 -0
  179. package/dist/dashboard/cli.js.map +1 -0
  180. package/dist/dashboard/index.html +3426 -0
  181. package/dist/dashboard/server.d.ts +7 -0
  182. package/dist/dashboard/server.d.ts.map +1 -0
  183. package/dist/dashboard/server.js +1427 -0
  184. package/dist/dashboard/server.js.map +1 -0
  185. package/dist/mcp/server.d.ts +27 -0
  186. package/dist/mcp/server.d.ts.map +1 -0
  187. package/dist/mcp/server.js +380 -0
  188. package/dist/mcp/server.js.map +1 -0
  189. package/dist/mcp/tools/misc.d.ts +15 -0
  190. package/dist/mcp/tools/misc.d.ts.map +1 -0
  191. package/dist/mcp/tools/misc.js +49 -0
  192. package/dist/mcp/tools/misc.js.map +1 -0
  193. package/dist/plugins/builtin/calculator.d.ts +11 -0
  194. package/dist/plugins/builtin/calculator.d.ts.map +1 -0
  195. package/dist/plugins/builtin/calculator.js +166 -0
  196. package/dist/plugins/builtin/calculator.js.map +1 -0
  197. package/dist/plugins/builtin/colors.d.ts +15 -0
  198. package/dist/plugins/builtin/colors.d.ts.map +1 -0
  199. package/dist/plugins/builtin/colors.js +193 -0
  200. package/dist/plugins/builtin/colors.js.map +1 -0
  201. package/dist/plugins/builtin/cron.d.ts +40 -0
  202. package/dist/plugins/builtin/cron.d.ts.map +1 -0
  203. package/dist/plugins/builtin/cron.js +578 -0
  204. package/dist/plugins/builtin/cron.js.map +1 -0
  205. package/dist/plugins/builtin/crypto.d.ts +11 -0
  206. package/dist/plugins/builtin/crypto.d.ts.map +1 -0
  207. package/dist/plugins/builtin/crypto.js +83 -0
  208. package/dist/plugins/builtin/crypto.js.map +1 -0
  209. package/dist/plugins/builtin/database.d.ts +29 -0
  210. package/dist/plugins/builtin/database.d.ts.map +1 -0
  211. package/dist/plugins/builtin/database.js +230 -0
  212. package/dist/plugins/builtin/database.js.map +1 -0
  213. package/dist/plugins/builtin/docker.d.ts +12 -0
  214. package/dist/plugins/builtin/docker.d.ts.map +1 -0
  215. package/dist/plugins/builtin/docker.js +436 -0
  216. package/dist/plugins/builtin/docker.js.map +1 -0
  217. package/dist/plugins/builtin/fun.d.ts +11 -0
  218. package/dist/plugins/builtin/fun.d.ts.map +1 -0
  219. package/dist/plugins/builtin/fun.js +114 -0
  220. package/dist/plugins/builtin/fun.js.map +1 -0
  221. package/dist/plugins/builtin/gcal.d.ts +38 -0
  222. package/dist/plugins/builtin/gcal.d.ts.map +1 -0
  223. package/dist/plugins/builtin/gcal.js +280 -0
  224. package/dist/plugins/builtin/gcal.js.map +1 -0
  225. package/dist/plugins/builtin/gdrive.d.ts +26 -0
  226. package/dist/plugins/builtin/gdrive.d.ts.map +1 -0
  227. package/dist/plugins/builtin/gdrive.js +295 -0
  228. package/dist/plugins/builtin/gdrive.js.map +1 -0
  229. package/dist/plugins/builtin/github-actions.d.ts +38 -0
  230. package/dist/plugins/builtin/github-actions.d.ts.map +1 -0
  231. package/dist/plugins/builtin/github-actions.js +629 -0
  232. package/dist/plugins/builtin/github-actions.js.map +1 -0
  233. package/dist/plugins/builtin/github.d.ts +26 -0
  234. package/dist/plugins/builtin/github.d.ts.map +1 -0
  235. package/dist/plugins/builtin/github.js +800 -0
  236. package/dist/plugins/builtin/github.js.map +1 -0
  237. package/dist/plugins/builtin/gmail.d.ts +50 -0
  238. package/dist/plugins/builtin/gmail.d.ts.map +1 -0
  239. package/dist/plugins/builtin/gmail.js +445 -0
  240. package/dist/plugins/builtin/gmail.js.map +1 -0
  241. package/dist/plugins/builtin/hash.d.ts +11 -0
  242. package/dist/plugins/builtin/hash.d.ts.map +1 -0
  243. package/dist/plugins/builtin/hash.js +95 -0
  244. package/dist/plugins/builtin/hash.js.map +1 -0
  245. package/dist/plugins/builtin/homekit.d.ts +53 -0
  246. package/dist/plugins/builtin/homekit.d.ts.map +1 -0
  247. package/dist/plugins/builtin/homekit.js +341 -0
  248. package/dist/plugins/builtin/homekit.js.map +1 -0
  249. package/dist/plugins/builtin/index.d.ts +4 -0
  250. package/dist/plugins/builtin/index.d.ts.map +1 -0
  251. package/dist/plugins/builtin/index.js +96 -0
  252. package/dist/plugins/builtin/index.js.map +1 -0
  253. package/dist/plugins/builtin/jira.d.ts +50 -0
  254. package/dist/plugins/builtin/jira.d.ts.map +1 -0
  255. package/dist/plugins/builtin/jira.js +353 -0
  256. package/dist/plugins/builtin/jira.js.map +1 -0
  257. package/dist/plugins/builtin/linear.d.ts +35 -0
  258. package/dist/plugins/builtin/linear.d.ts.map +1 -0
  259. package/dist/plugins/builtin/linear.js +397 -0
  260. package/dist/plugins/builtin/linear.js.map +1 -0
  261. package/dist/plugins/builtin/lumen.d.ts +21 -0
  262. package/dist/plugins/builtin/lumen.d.ts.map +1 -0
  263. package/dist/plugins/builtin/lumen.js +404 -0
  264. package/dist/plugins/builtin/lumen.js.map +1 -0
  265. package/dist/plugins/builtin/memory.d.ts +22 -0
  266. package/dist/plugins/builtin/memory.d.ts.map +1 -0
  267. package/dist/plugins/builtin/memory.js +184 -0
  268. package/dist/plugins/builtin/memory.js.map +1 -0
  269. package/dist/plugins/builtin/n8n.d.ts +60 -0
  270. package/dist/plugins/builtin/n8n.d.ts.map +1 -0
  271. package/dist/plugins/builtin/n8n.js +519 -0
  272. package/dist/plugins/builtin/n8n.js.map +1 -0
  273. package/dist/plugins/builtin/network.d.ts +11 -0
  274. package/dist/plugins/builtin/network.d.ts.map +1 -0
  275. package/dist/plugins/builtin/network.js +88 -0
  276. package/dist/plugins/builtin/network.js.map +1 -0
  277. package/dist/plugins/builtin/notes.d.ts +47 -0
  278. package/dist/plugins/builtin/notes.d.ts.map +1 -0
  279. package/dist/plugins/builtin/notes.js +641 -0
  280. package/dist/plugins/builtin/notes.js.map +1 -0
  281. package/dist/plugins/builtin/notion.d.ts +47 -0
  282. package/dist/plugins/builtin/notion.d.ts.map +1 -0
  283. package/dist/plugins/builtin/notion.js +317 -0
  284. package/dist/plugins/builtin/notion.js.map +1 -0
  285. package/dist/plugins/builtin/shell.d.ts +12 -0
  286. package/dist/plugins/builtin/shell.d.ts.map +1 -0
  287. package/dist/plugins/builtin/shell.js +310 -0
  288. package/dist/plugins/builtin/shell.js.map +1 -0
  289. package/dist/plugins/builtin/slack.d.ts +31 -0
  290. package/dist/plugins/builtin/slack.d.ts.map +1 -0
  291. package/dist/plugins/builtin/slack.js +295 -0
  292. package/dist/plugins/builtin/slack.js.map +1 -0
  293. package/dist/plugins/builtin/spotify.d.ts +55 -0
  294. package/dist/plugins/builtin/spotify.d.ts.map +1 -0
  295. package/dist/plugins/builtin/spotify.js +623 -0
  296. package/dist/plugins/builtin/spotify.js.map +1 -0
  297. package/dist/plugins/builtin/stripe.d.ts +35 -0
  298. package/dist/plugins/builtin/stripe.d.ts.map +1 -0
  299. package/dist/plugins/builtin/stripe.js +376 -0
  300. package/dist/plugins/builtin/stripe.js.map +1 -0
  301. package/dist/plugins/builtin/system.d.ts +11 -0
  302. package/dist/plugins/builtin/system.d.ts.map +1 -0
  303. package/dist/plugins/builtin/system.js +91 -0
  304. package/dist/plugins/builtin/system.js.map +1 -0
  305. package/dist/plugins/builtin/text-tools.d.ts +11 -0
  306. package/dist/plugins/builtin/text-tools.d.ts.map +1 -0
  307. package/dist/plugins/builtin/text-tools.js +146 -0
  308. package/dist/plugins/builtin/text-tools.js.map +1 -0
  309. package/dist/plugins/builtin/timezone.d.ts +13 -0
  310. package/dist/plugins/builtin/timezone.d.ts.map +1 -0
  311. package/dist/plugins/builtin/timezone.js +164 -0
  312. package/dist/plugins/builtin/timezone.js.map +1 -0
  313. package/dist/plugins/builtin/todoist.d.ts +49 -0
  314. package/dist/plugins/builtin/todoist.d.ts.map +1 -0
  315. package/dist/plugins/builtin/todoist.js +540 -0
  316. package/dist/plugins/builtin/todoist.js.map +1 -0
  317. package/dist/plugins/builtin/translate.d.ts +11 -0
  318. package/dist/plugins/builtin/translate.d.ts.map +1 -0
  319. package/dist/plugins/builtin/translate.js +42 -0
  320. package/dist/plugins/builtin/translate.js.map +1 -0
  321. package/dist/plugins/builtin/url-tools.d.ts +11 -0
  322. package/dist/plugins/builtin/url-tools.d.ts.map +1 -0
  323. package/dist/plugins/builtin/url-tools.js +70 -0
  324. package/dist/plugins/builtin/url-tools.js.map +1 -0
  325. package/dist/plugins/builtin/vercel.d.ts +55 -0
  326. package/dist/plugins/builtin/vercel.d.ts.map +1 -0
  327. package/dist/plugins/builtin/vercel.js +514 -0
  328. package/dist/plugins/builtin/vercel.js.map +1 -0
  329. package/dist/plugins/builtin/weather.d.ts +13 -0
  330. package/dist/plugins/builtin/weather.d.ts.map +1 -0
  331. package/dist/plugins/builtin/weather.js +103 -0
  332. package/dist/plugins/builtin/weather.js.map +1 -0
  333. package/dist/plugins/builtin/x.d.ts +54 -0
  334. package/dist/plugins/builtin/x.d.ts.map +1 -0
  335. package/dist/plugins/builtin/x.js +402 -0
  336. package/dist/plugins/builtin/x.js.map +1 -0
  337. package/dist/plugins/manager.d.ts +77 -0
  338. package/dist/plugins/manager.d.ts.map +1 -0
  339. package/dist/plugins/manager.js +141 -0
  340. package/dist/plugins/manager.js.map +1 -0
  341. package/dist/plugins/validation.d.ts +18 -0
  342. package/dist/plugins/validation.d.ts.map +1 -0
  343. package/dist/plugins/validation.js +81 -0
  344. package/dist/plugins/validation.js.map +1 -0
  345. package/dist/security/auth.d.ts +23 -0
  346. package/dist/security/auth.d.ts.map +1 -0
  347. package/dist/security/auth.js +56 -0
  348. package/dist/security/auth.js.map +1 -0
  349. package/dist/security/keychain.d.ts +60 -0
  350. package/dist/security/keychain.d.ts.map +1 -0
  351. package/dist/security/keychain.js +213 -0
  352. package/dist/security/keychain.js.map +1 -0
  353. package/dist/utils/google-auth.d.ts +21 -0
  354. package/dist/utils/google-auth.d.ts.map +1 -0
  355. package/dist/utils/google-auth.js +135 -0
  356. package/dist/utils/google-auth.js.map +1 -0
  357. package/dist/utils/retry.d.ts +5 -0
  358. package/dist/utils/retry.d.ts.map +1 -0
  359. package/dist/utils/retry.js +34 -0
  360. package/dist/utils/retry.js.map +1 -0
  361. package/docs/README.md +13 -0
  362. package/docs/api.md +210 -0
  363. package/docs/getting-started.md +100 -0
  364. package/docs/plugins.md +306 -0
  365. package/docs-site/.vitepress/config.ts +59 -0
  366. package/docs-site/README.md +12 -0
  367. package/docs-site/index.md +30 -0
  368. package/eslint.config.js +29 -0
  369. package/install.ps1 +334 -0
  370. package/install.sh +1119 -0
  371. package/local-install.sh +304 -0
  372. package/package.json +90 -0
  373. package/packages/README.md +11 -0
  374. package/packages/plugin-sdk/README.md +12 -0
  375. package/packages/plugin-sdk/package.json +22 -0
  376. package/packages/plugin-sdk/src/README.md +11 -0
  377. package/packages/plugin-sdk/src/index.ts +191 -0
  378. package/sdks/README.md +26 -0
  379. package/sdks/csharp/ConductorClient.cs +65 -0
  380. package/sdks/csharp/README.md +11 -0
  381. package/sdks/go/README.md +11 -0
  382. package/sdks/go/conductor.go +257 -0
  383. package/sdks/java/ConductorClient.java +27 -0
  384. package/sdks/java/README.md +11 -0
  385. package/sdks/php/README.md +11 -0
  386. package/sdks/php/src/Client.php +72 -0
  387. package/sdks/python/README.md +12 -0
  388. package/sdks/python/conductor/__init__.py +227 -0
  389. package/sdks/python/pyproject.toml +30 -0
  390. package/sdks/ruby/README.md +11 -0
  391. package/sdks/ruby/lib/conductor.rb +46 -0
  392. package/sdks/rust/Cargo.toml +14 -0
  393. package/sdks/rust/README.md +11 -0
  394. package/sdks/swift/README.md +11 -0
  395. package/sdks/swift/Sources/Conductor/ConductorClient.swift +65 -0
  396. package/skills/conductor-mcp/SKILL.md +38 -0
  397. package/src/README.md +20 -0
  398. package/src/ai/README.md +18 -0
  399. package/src/ai/base.ts +93 -0
  400. package/src/ai/claude.ts +162 -0
  401. package/src/ai/gemini.ts +188 -0
  402. package/src/ai/maestro.ts +168 -0
  403. package/src/ai/manager.ts +537 -0
  404. package/src/ai/ollama.ts +186 -0
  405. package/src/ai/openai.ts +147 -0
  406. package/src/ai/openrouter.ts +152 -0
  407. package/src/bot/README.md +12 -0
  408. package/src/bot/slack.ts +164 -0
  409. package/src/bot/telegram.ts +185 -0
  410. package/src/cli/README.md +24 -0
  411. package/src/cli/commands/README.md +20 -0
  412. package/src/cli/commands/ai.ts +170 -0
  413. package/src/cli/commands/doctor.ts +221 -0
  414. package/src/cli/commands/init.ts +348 -0
  415. package/src/cli/commands/install.ts +792 -0
  416. package/src/cli/commands/lifecycle.ts +95 -0
  417. package/src/cli/commands/marketplace.ts +253 -0
  418. package/src/cli/commands/mcp.ts +92 -0
  419. package/src/cli/commands/onboard.ts +248 -0
  420. package/src/cli/commands/plugin-create.ts +130 -0
  421. package/src/cli/commands/plugins.ts +36 -0
  422. package/src/cli/commands/release.ts +251 -0
  423. package/src/cli/commands/telegram.ts +25 -0
  424. package/src/cli/index.ts +450 -0
  425. package/src/config/README.md +11 -0
  426. package/src/config/oauth.ts +26 -0
  427. package/src/core/README.md +22 -0
  428. package/src/core/audit.ts +291 -0
  429. package/src/core/circuit-breaker.ts +129 -0
  430. package/src/core/conductor.ts +240 -0
  431. package/src/core/config.ts +149 -0
  432. package/src/core/database.ts +411 -0
  433. package/src/core/errors.ts +275 -0
  434. package/src/core/health.ts +159 -0
  435. package/src/core/interfaces.ts +75 -0
  436. package/src/core/logger.ts +33 -0
  437. package/src/core/rbac.ts +321 -0
  438. package/src/core/retry.ts +61 -0
  439. package/src/core/webhooks.ts +234 -0
  440. package/src/core/zero-config.ts +72 -0
  441. package/src/dashboard/README.md +15 -0
  442. package/src/dashboard/cli.ts +48 -0
  443. package/src/dashboard/index.html +3426 -0
  444. package/src/dashboard/server.ts +1544 -0
  445. package/src/mcp/README.md +20 -0
  446. package/src/mcp/server.ts +475 -0
  447. package/src/mcp/tools/README.md +11 -0
  448. package/src/mcp/tools/misc.ts +61 -0
  449. package/src/plugins/README.md +28 -0
  450. package/src/plugins/builtin/README.md +23 -0
  451. package/src/plugins/builtin/calculator.ts +178 -0
  452. package/src/plugins/builtin/colors.ts +201 -0
  453. package/src/plugins/builtin/cron.ts +649 -0
  454. package/src/plugins/builtin/crypto.ts +85 -0
  455. package/src/plugins/builtin/database.ts +235 -0
  456. package/src/plugins/builtin/docker.ts +426 -0
  457. package/src/plugins/builtin/fun.ts +118 -0
  458. package/src/plugins/builtin/gcal.ts +305 -0
  459. package/src/plugins/builtin/gdrive.ts +326 -0
  460. package/src/plugins/builtin/github-actions.ts +666 -0
  461. package/src/plugins/builtin/github.ts +912 -0
  462. package/src/plugins/builtin/gmail.ts +492 -0
  463. package/src/plugins/builtin/hash.ts +98 -0
  464. package/src/plugins/builtin/homekit.ts +389 -0
  465. package/src/plugins/builtin/index.ts +116 -0
  466. package/src/plugins/builtin/jira.ts +380 -0
  467. package/src/plugins/builtin/linear.ts +448 -0
  468. package/src/plugins/builtin/lumen.ts +497 -0
  469. package/src/plugins/builtin/memory.ts +200 -0
  470. package/src/plugins/builtin/n8n.ts +565 -0
  471. package/src/plugins/builtin/network.ts +92 -0
  472. package/src/plugins/builtin/notes.ts +689 -0
  473. package/src/plugins/builtin/notion.ts +348 -0
  474. package/src/plugins/builtin/shell.ts +334 -0
  475. package/src/plugins/builtin/slack.ts +327 -0
  476. package/src/plugins/builtin/spotify.ts +665 -0
  477. package/src/plugins/builtin/stripe.ts +388 -0
  478. package/src/plugins/builtin/system.ts +93 -0
  479. package/src/plugins/builtin/text-tools.ts +150 -0
  480. package/src/plugins/builtin/timezone.ts +173 -0
  481. package/src/plugins/builtin/todoist.ts +625 -0
  482. package/src/plugins/builtin/translate.ts +47 -0
  483. package/src/plugins/builtin/url-tools.ts +73 -0
  484. package/src/plugins/builtin/vercel.ts +546 -0
  485. package/src/plugins/builtin/weather.ts +112 -0
  486. package/src/plugins/builtin/x.ts +440 -0
  487. package/src/plugins/manager.ts +213 -0
  488. package/src/plugins/validation.ts +94 -0
  489. package/src/security/README.md +12 -0
  490. package/src/security/auth.ts +72 -0
  491. package/src/security/keychain.ts +226 -0
  492. package/src/utils/README.md +12 -0
  493. package/src/utils/google-auth.ts +159 -0
  494. package/src/utils/retry.ts +41 -0
  495. package/test-all.mjs +1256 -0
  496. package/test.mjs +633 -0
  497. package/tests/README.md +19 -0
  498. package/tests/calculator.test.ts +54 -0
  499. package/tests/docker.test.ts +42 -0
  500. package/tests/load.test.ts +129 -0
  501. package/tests/mcp.test.ts +14 -0
  502. package/tests/shell.test.ts +42 -0
  503. package/tsconfig.json +21 -0
  504. package/vitest.config.ts +14 -0
@@ -0,0 +1,800 @@
1
+ import { Keychain } from '../../security/keychain.js';
2
+ export class GitHubPlugin {
3
+ name = 'github';
4
+ description = 'GitHub repositories, issues, PRs, releases, code search, and more (public data free, private needs token)';
5
+ version = '2.0.0';
6
+ configSchema = {
7
+ fields: [
8
+ {
9
+ key: 'token',
10
+ label: 'GitHub PAT (Personal Access Token)',
11
+ type: 'password',
12
+ required: false,
13
+ secret: true,
14
+ service: 'github',
15
+ description: 'Create a PAT with "repo" and "workflow" scopes at GitHub Settings > Developer Settings > Personal Access Tokens.',
16
+ },
17
+ ],
18
+ setupInstructions: 'GitHub integration works for public data without a token. For private repos, issues, PRs and write operations, create a Personal Access Token at https://github.com/settings/tokens with "repo" and "workflow" scopes.',
19
+ };
20
+ keychain;
21
+ async initialize(conductor) {
22
+ this.keychain = new Keychain(conductor.getConfig().getConfigDir());
23
+ }
24
+ isConfigured() {
25
+ return true; // public endpoints work without token
26
+ }
27
+ async getToken() {
28
+ try {
29
+ return await this.keychain.get('github', 'token');
30
+ }
31
+ catch {
32
+ return null;
33
+ }
34
+ }
35
+ async ghFetch(path, options = {}) {
36
+ const headers = {
37
+ Accept: 'application/vnd.github+json',
38
+ 'X-GitHub-Api-Version': '2022-11-28',
39
+ };
40
+ if (options.token)
41
+ headers['Authorization'] = `Bearer ${options.token}`;
42
+ const res = await fetch(`https://api.github.com${path}`, {
43
+ method: options.method ?? 'GET',
44
+ headers,
45
+ body: options.body ? JSON.stringify(options.body) : undefined,
46
+ });
47
+ if (!res.ok) {
48
+ const errText = await res.text().catch(() => res.statusText);
49
+ throw new Error(`GitHub API ${res.status}: ${errText}`);
50
+ }
51
+ if (res.status === 204)
52
+ return null;
53
+ return res.json();
54
+ }
55
+ getTools() {
56
+ return [
57
+ // ── User & repo basics ───────────────────────────────────────────────
58
+ {
59
+ name: 'github_user',
60
+ description: 'Get GitHub user profile info',
61
+ inputSchema: {
62
+ type: 'object',
63
+ properties: {
64
+ username: { type: 'string', description: 'GitHub username' },
65
+ },
66
+ required: ['username'],
67
+ },
68
+ handler: async (input) => {
69
+ const u = await this.ghFetch(`/users/${encodeURIComponent(input.username)}`);
70
+ return {
71
+ login: u.login,
72
+ name: u.name,
73
+ bio: u.bio,
74
+ public_repos: u.public_repos,
75
+ followers: u.followers,
76
+ following: u.following,
77
+ created: u.created_at,
78
+ url: u.html_url,
79
+ avatar: u.avatar_url,
80
+ };
81
+ },
82
+ },
83
+ {
84
+ name: 'github_repo',
85
+ description: 'Get repository details',
86
+ inputSchema: {
87
+ type: 'object',
88
+ properties: {
89
+ owner: { type: 'string', description: 'Repository owner' },
90
+ repo: { type: 'string', description: 'Repository name' },
91
+ },
92
+ required: ['owner', 'repo'],
93
+ },
94
+ handler: async (input) => {
95
+ const token = await this.getToken();
96
+ const r = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}`, {
97
+ token,
98
+ });
99
+ return {
100
+ name: r.full_name,
101
+ description: r.description,
102
+ language: r.language,
103
+ stars: r.stargazers_count,
104
+ forks: r.forks_count,
105
+ open_issues: r.open_issues_count,
106
+ license: r.license?.spdx_id,
107
+ created: r.created_at,
108
+ updated: r.updated_at,
109
+ default_branch: r.default_branch,
110
+ url: r.html_url,
111
+ topics: r.topics,
112
+ private: r.private,
113
+ };
114
+ },
115
+ },
116
+ {
117
+ name: 'github_repos',
118
+ description: 'List repositories for a user',
119
+ inputSchema: {
120
+ type: 'object',
121
+ properties: {
122
+ username: { type: 'string', description: 'GitHub username' },
123
+ sort: { type: 'string', description: 'Sort by: stars, updated, created, name', default: 'updated' },
124
+ per_page: { type: 'number', description: 'Results per page (max 100)', default: 30 },
125
+ },
126
+ required: ['username'],
127
+ },
128
+ handler: async (input) => {
129
+ const token = await this.getToken();
130
+ const sort = input.sort ?? 'updated';
131
+ const perPage = Math.min(input.per_page ?? 30, 100);
132
+ const repos = await this.ghFetch(`/users/${encodeURIComponent(input.username)}/repos?sort=${sort}&per_page=${perPage}`, { token });
133
+ return repos.map((r) => ({
134
+ name: r.name,
135
+ description: r.description,
136
+ language: r.language,
137
+ stars: r.stargazers_count,
138
+ forks: r.forks_count,
139
+ updated: r.updated_at,
140
+ url: r.html_url,
141
+ private: r.private,
142
+ }));
143
+ },
144
+ },
145
+ {
146
+ name: 'github_trending',
147
+ description: 'Search trending/popular repositories by query and optional language filter',
148
+ inputSchema: {
149
+ type: 'object',
150
+ properties: {
151
+ query: { type: 'string', description: 'Search query (e.g. "machine learning", "typescript cli")' },
152
+ language: { type: 'string', description: 'Filter by language (e.g. typescript, python)' },
153
+ per_page: { type: 'number', description: 'Results per page (default 10, max 30)', default: 10 },
154
+ },
155
+ required: ['query'],
156
+ },
157
+ handler: async (input) => {
158
+ const token = await this.getToken();
159
+ let q = encodeURIComponent(input.query);
160
+ if (input.language)
161
+ q += `+language:${encodeURIComponent(input.language)}`;
162
+ const perPage = Math.min(input.per_page ?? 10, 30);
163
+ const data = await this.ghFetch(`/search/repositories?q=${q}&sort=stars&per_page=${perPage}`, { token });
164
+ return data.items.map((r) => ({
165
+ name: r.full_name,
166
+ description: r.description,
167
+ language: r.language,
168
+ stars: r.stargazers_count,
169
+ forks: r.forks_count,
170
+ url: r.html_url,
171
+ }));
172
+ },
173
+ },
174
+ // ── Issues ──────────────────────────────────────────────────────────
175
+ {
176
+ name: 'github_issues',
177
+ description: 'List issues for a repository with optional filters',
178
+ inputSchema: {
179
+ type: 'object',
180
+ properties: {
181
+ owner: { type: 'string', description: 'Repository owner' },
182
+ repo: { type: 'string', description: 'Repository name' },
183
+ state: { type: 'string', enum: ['open', 'closed', 'all'], description: 'Issue state (default: open)' },
184
+ label: { type: 'string', description: 'Filter by label name' },
185
+ assignee: { type: 'string', description: 'Filter by assignee username' },
186
+ per_page: { type: 'number', description: 'Results per page (default 25, max 100)' },
187
+ },
188
+ required: ['owner', 'repo'],
189
+ },
190
+ handler: async (input) => {
191
+ const token = await this.getToken();
192
+ const params = new URLSearchParams({
193
+ state: input.state ?? 'open',
194
+ per_page: String(Math.min(input.per_page ?? 25, 100)),
195
+ });
196
+ if (input.label)
197
+ params.set('labels', input.label);
198
+ if (input.assignee)
199
+ params.set('assignee', input.assignee);
200
+ const issues = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/issues?${params}`, { token });
201
+ return issues
202
+ .filter((i) => !i.pull_request)
203
+ .map((i) => ({
204
+ number: i.number,
205
+ title: i.title,
206
+ state: i.state,
207
+ author: i.user?.login,
208
+ assignees: i.assignees?.map((a) => a.login),
209
+ labels: i.labels?.map((l) => l.name),
210
+ comments: i.comments,
211
+ created: i.created_at,
212
+ updated: i.updated_at,
213
+ url: i.html_url,
214
+ }));
215
+ },
216
+ },
217
+ {
218
+ name: 'github_issue',
219
+ description: 'Get a single issue by number',
220
+ inputSchema: {
221
+ type: 'object',
222
+ properties: {
223
+ owner: { type: 'string', description: 'Repository owner' },
224
+ repo: { type: 'string', description: 'Repository name' },
225
+ issue_number: { type: 'number', description: 'Issue number' },
226
+ },
227
+ required: ['owner', 'repo', 'issue_number'],
228
+ },
229
+ handler: async (input) => {
230
+ const token = await this.getToken();
231
+ const i = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/issues/${input.issue_number}`, { token });
232
+ return {
233
+ number: i.number,
234
+ title: i.title,
235
+ state: i.state,
236
+ body: i.body,
237
+ author: i.user?.login,
238
+ assignees: i.assignees?.map((a) => a.login),
239
+ labels: i.labels?.map((l) => l.name),
240
+ milestone: i.milestone?.title,
241
+ comments: i.comments,
242
+ created: i.created_at,
243
+ updated: i.updated_at,
244
+ closed_at: i.closed_at,
245
+ url: i.html_url,
246
+ };
247
+ },
248
+ },
249
+ {
250
+ name: 'github_create_issue',
251
+ description: 'Create a new issue in a repository',
252
+ inputSchema: {
253
+ type: 'object',
254
+ properties: {
255
+ owner: { type: 'string', description: 'Repository owner' },
256
+ repo: { type: 'string', description: 'Repository name' },
257
+ title: { type: 'string', description: 'Issue title' },
258
+ body: { type: 'string', description: 'Issue body (markdown)' },
259
+ labels: { type: 'array', items: { type: 'string' }, description: 'Label names to add' },
260
+ assignees: { type: 'array', items: { type: 'string' }, description: 'Usernames to assign' },
261
+ },
262
+ required: ['owner', 'repo', 'title'],
263
+ },
264
+ requiresApproval: true,
265
+ handler: async (input) => {
266
+ const token = await this.getToken();
267
+ if (!token)
268
+ throw new Error('GitHub token required to create issues');
269
+ const issue = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/issues`, {
270
+ method: 'POST',
271
+ token,
272
+ body: { title: input.title, body: input.body, labels: input.labels, assignees: input.assignees },
273
+ });
274
+ return { number: issue.number, url: issue.html_url, title: issue.title };
275
+ },
276
+ },
277
+ {
278
+ name: 'github_close_issue',
279
+ description: 'Close an open issue',
280
+ inputSchema: {
281
+ type: 'object',
282
+ properties: {
283
+ owner: { type: 'string', description: 'Repository owner' },
284
+ repo: { type: 'string', description: 'Repository name' },
285
+ issue_number: { type: 'number', description: 'Issue number to close' },
286
+ reason: { type: 'string', enum: ['completed', 'not_planned'], description: 'Close reason' },
287
+ },
288
+ required: ['owner', 'repo', 'issue_number'],
289
+ },
290
+ requiresApproval: true,
291
+ handler: async (input) => {
292
+ const token = await this.getToken();
293
+ if (!token)
294
+ throw new Error('GitHub token required to close issues');
295
+ await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/issues/${input.issue_number}`, {
296
+ method: 'PATCH',
297
+ token,
298
+ body: { state: 'closed', state_reason: input.reason ?? 'completed' },
299
+ });
300
+ return { closed: true, issue_number: input.issue_number };
301
+ },
302
+ },
303
+ {
304
+ name: 'github_comment_issue',
305
+ description: 'Add a comment to an issue or pull request',
306
+ inputSchema: {
307
+ type: 'object',
308
+ properties: {
309
+ owner: { type: 'string', description: 'Repository owner' },
310
+ repo: { type: 'string', description: 'Repository name' },
311
+ issue_number: { type: 'number', description: 'Issue or PR number' },
312
+ body: { type: 'string', description: 'Comment text (markdown)' },
313
+ },
314
+ required: ['owner', 'repo', 'issue_number', 'body'],
315
+ },
316
+ requiresApproval: true,
317
+ handler: async (input) => {
318
+ const token = await this.getToken();
319
+ if (!token)
320
+ throw new Error('GitHub token required to post comments');
321
+ const comment = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/issues/${input.issue_number}/comments`, { method: 'POST', token, body: { body: input.body } });
322
+ return { comment_id: comment.id, url: comment.html_url };
323
+ },
324
+ },
325
+ // ── Pull requests ────────────────────────────────────────────────────
326
+ {
327
+ name: 'github_prs',
328
+ description: 'List pull requests for a repository',
329
+ inputSchema: {
330
+ type: 'object',
331
+ properties: {
332
+ owner: { type: 'string', description: 'Repository owner' },
333
+ repo: { type: 'string', description: 'Repository name' },
334
+ state: { type: 'string', enum: ['open', 'closed', 'all'], description: 'PR state (default: open)' },
335
+ base: { type: 'string', description: 'Filter by base branch name' },
336
+ per_page: { type: 'number', description: 'Results per page (default 25, max 100)' },
337
+ },
338
+ required: ['owner', 'repo'],
339
+ },
340
+ handler: async (input) => {
341
+ const token = await this.getToken();
342
+ const params = new URLSearchParams({
343
+ state: input.state ?? 'open',
344
+ per_page: String(Math.min(input.per_page ?? 25, 100)),
345
+ });
346
+ if (input.base)
347
+ params.set('base', input.base);
348
+ const prs = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/pulls?${params}`, { token });
349
+ return prs.map((p) => ({
350
+ number: p.number,
351
+ title: p.title,
352
+ state: p.state,
353
+ author: p.user?.login,
354
+ head: p.head?.ref,
355
+ base: p.base?.ref,
356
+ draft: p.draft,
357
+ mergeable: p.mergeable,
358
+ reviews_requested: p.requested_reviewers?.map((r) => r.login),
359
+ created: p.created_at,
360
+ updated: p.updated_at,
361
+ url: p.html_url,
362
+ }));
363
+ },
364
+ },
365
+ {
366
+ name: 'github_pr',
367
+ description: 'Get detailed PR info including diff stats, reviewers, and checks',
368
+ inputSchema: {
369
+ type: 'object',
370
+ properties: {
371
+ owner: { type: 'string', description: 'Repository owner' },
372
+ repo: { type: 'string', description: 'Repository name' },
373
+ pr_number: { type: 'number', description: 'Pull request number' },
374
+ },
375
+ required: ['owner', 'repo', 'pr_number'],
376
+ },
377
+ handler: async (input) => {
378
+ const token = await this.getToken();
379
+ const base = `/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}`;
380
+ const [p, reviews] = await Promise.all([
381
+ this.ghFetch(`${base}/pulls/${input.pr_number}`, { token }),
382
+ this.ghFetch(`${base}/pulls/${input.pr_number}/reviews`, { token }).catch(() => []),
383
+ ]);
384
+ return {
385
+ number: p.number,
386
+ title: p.title,
387
+ state: p.state,
388
+ author: p.user?.login,
389
+ body: p.body,
390
+ head: p.head?.ref,
391
+ base: p.base?.ref,
392
+ draft: p.draft,
393
+ mergeable: p.mergeable,
394
+ additions: p.additions,
395
+ deletions: p.deletions,
396
+ changed_files: p.changed_files,
397
+ commits: p.commits,
398
+ requested_reviewers: p.requested_reviewers?.map((r) => r.login),
399
+ reviews: reviews.map((r) => ({ reviewer: r.user?.login, state: r.state })),
400
+ created: p.created_at,
401
+ updated: p.updated_at,
402
+ merged: p.merged,
403
+ merged_at: p.merged_at,
404
+ url: p.html_url,
405
+ };
406
+ },
407
+ },
408
+ {
409
+ name: 'github_create_pr',
410
+ description: 'Create a new pull request',
411
+ inputSchema: {
412
+ type: 'object',
413
+ properties: {
414
+ owner: { type: 'string', description: 'Repository owner' },
415
+ repo: { type: 'string', description: 'Repository name' },
416
+ title: { type: 'string', description: 'PR title' },
417
+ body: { type: 'string', description: 'PR description (markdown)' },
418
+ head: { type: 'string', description: 'Head branch (source)' },
419
+ base: { type: 'string', description: 'Base branch (target, e.g. main)' },
420
+ draft: { type: 'boolean', description: 'Create as draft PR', default: false },
421
+ },
422
+ required: ['owner', 'repo', 'title', 'head', 'base'],
423
+ },
424
+ requiresApproval: true,
425
+ handler: async (input) => {
426
+ const token = await this.getToken();
427
+ if (!token)
428
+ throw new Error('GitHub token required to create pull requests');
429
+ const pr = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/pulls`, {
430
+ method: 'POST',
431
+ token,
432
+ body: {
433
+ title: input.title,
434
+ body: input.body,
435
+ head: input.head,
436
+ base: input.base,
437
+ draft: input.draft ?? false,
438
+ },
439
+ });
440
+ return { number: pr.number, url: pr.html_url, title: pr.title };
441
+ },
442
+ },
443
+ {
444
+ name: 'github_merge_pr',
445
+ description: 'Merge a pull request',
446
+ inputSchema: {
447
+ type: 'object',
448
+ properties: {
449
+ owner: { type: 'string', description: 'Repository owner' },
450
+ repo: { type: 'string', description: 'Repository name' },
451
+ pr_number: { type: 'number', description: 'Pull request number' },
452
+ merge_method: {
453
+ type: 'string',
454
+ enum: ['merge', 'squash', 'rebase'],
455
+ description: 'Merge method (default: merge)',
456
+ },
457
+ commit_message: { type: 'string', description: 'Optional commit message' },
458
+ },
459
+ required: ['owner', 'repo', 'pr_number'],
460
+ },
461
+ requiresApproval: true,
462
+ handler: async (input) => {
463
+ const token = await this.getToken();
464
+ if (!token)
465
+ throw new Error('GitHub token required to merge pull requests');
466
+ const result = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/pulls/${input.pr_number}/merge`, {
467
+ method: 'PUT',
468
+ token,
469
+ body: {
470
+ merge_method: input.merge_method ?? 'merge',
471
+ commit_message: input.commit_message,
472
+ },
473
+ });
474
+ return { merged: result?.merged ?? true, sha: result?.sha, message: result?.message };
475
+ },
476
+ },
477
+ // ── Code & files ─────────────────────────────────────────────────────
478
+ {
479
+ name: 'github_search_code',
480
+ description: 'Search code across GitHub repositories',
481
+ inputSchema: {
482
+ type: 'object',
483
+ properties: {
484
+ query: { type: 'string', description: 'Search query (e.g. "useState repo:facebook/react")' },
485
+ per_page: { type: 'number', description: 'Results per page (default 10, max 30)' },
486
+ },
487
+ required: ['query'],
488
+ },
489
+ handler: async (input) => {
490
+ const token = await this.getToken();
491
+ const perPage = Math.min(input.per_page ?? 10, 30);
492
+ const data = await this.ghFetch(`/search/code?q=${encodeURIComponent(input.query)}&per_page=${perPage}`, {
493
+ token,
494
+ });
495
+ return {
496
+ total_count: data.total_count,
497
+ results: data.items.map((i) => ({
498
+ name: i.name,
499
+ path: i.path,
500
+ repo: i.repository?.full_name,
501
+ url: i.html_url,
502
+ sha: i.sha,
503
+ })),
504
+ };
505
+ },
506
+ },
507
+ {
508
+ name: 'github_file',
509
+ description: 'Get file contents from a repository',
510
+ inputSchema: {
511
+ type: 'object',
512
+ properties: {
513
+ owner: { type: 'string', description: 'Repository owner' },
514
+ repo: { type: 'string', description: 'Repository name' },
515
+ path: { type: 'string', description: 'File path in the repository (e.g. "src/index.ts")' },
516
+ ref: { type: 'string', description: 'Branch, tag, or commit SHA (default: default branch)' },
517
+ },
518
+ required: ['owner', 'repo', 'path'],
519
+ },
520
+ handler: async (input) => {
521
+ const token = await this.getToken();
522
+ const params = input.ref ? `?ref=${encodeURIComponent(input.ref)}` : '';
523
+ const data = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/contents/${input.path}${params}`, { token });
524
+ if (Array.isArray(data)) {
525
+ // It's a directory listing
526
+ return {
527
+ type: 'directory',
528
+ path: input.path,
529
+ entries: data.map((e) => ({ name: e.name, type: e.type, size: e.size, path: e.path })),
530
+ };
531
+ }
532
+ const content = data.encoding === 'base64' ? Buffer.from(data.content, 'base64').toString('utf-8') : data.content;
533
+ return {
534
+ type: 'file',
535
+ name: data.name,
536
+ path: data.path,
537
+ size: data.size,
538
+ sha: data.sha,
539
+ content: content.slice(0, 50000), // cap at 50 KB
540
+ encoding: data.encoding,
541
+ };
542
+ },
543
+ },
544
+ // ── Commits ──────────────────────────────────────────────────────────
545
+ {
546
+ name: 'github_commits',
547
+ description: 'List commits for a repository or branch',
548
+ inputSchema: {
549
+ type: 'object',
550
+ properties: {
551
+ owner: { type: 'string', description: 'Repository owner' },
552
+ repo: { type: 'string', description: 'Repository name' },
553
+ branch: { type: 'string', description: 'Branch name (default: default branch)' },
554
+ author: { type: 'string', description: 'Filter by author username or email' },
555
+ per_page: { type: 'number', description: 'Results per page (default 20, max 100)' },
556
+ },
557
+ required: ['owner', 'repo'],
558
+ },
559
+ handler: async (input) => {
560
+ const token = await this.getToken();
561
+ const params = new URLSearchParams({
562
+ per_page: String(Math.min(input.per_page ?? 20, 100)),
563
+ });
564
+ if (input.branch)
565
+ params.set('sha', input.branch);
566
+ if (input.author)
567
+ params.set('author', input.author);
568
+ const commits = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/commits?${params}`, { token });
569
+ return commits.map((c) => ({
570
+ sha: c.sha?.slice(0, 8),
571
+ message: c.commit?.message?.split('\n')[0],
572
+ author: c.commit?.author?.name,
573
+ date: c.commit?.author?.date,
574
+ url: c.html_url,
575
+ }));
576
+ },
577
+ },
578
+ // ── Releases ─────────────────────────────────────────────────────────
579
+ {
580
+ name: 'github_releases',
581
+ description: 'List releases for a repository',
582
+ inputSchema: {
583
+ type: 'object',
584
+ properties: {
585
+ owner: { type: 'string', description: 'Repository owner' },
586
+ repo: { type: 'string', description: 'Repository name' },
587
+ per_page: { type: 'number', description: 'Results per page (default 10, max 30)' },
588
+ },
589
+ required: ['owner', 'repo'],
590
+ },
591
+ handler: async (input) => {
592
+ const token = await this.getToken();
593
+ const perPage = Math.min(input.per_page ?? 10, 30);
594
+ const releases = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/releases?per_page=${perPage}`, { token });
595
+ return releases.map((r) => ({
596
+ id: r.id,
597
+ tag: r.tag_name,
598
+ name: r.name,
599
+ prerelease: r.prerelease,
600
+ draft: r.draft,
601
+ body: r.body?.slice(0, 2000),
602
+ author: r.author?.login,
603
+ created: r.created_at,
604
+ published: r.published_at,
605
+ url: r.html_url,
606
+ assets: r.assets?.map((a) => ({ name: a.name, size: a.size, downloads: a.download_count })),
607
+ }));
608
+ },
609
+ },
610
+ {
611
+ name: 'github_create_release',
612
+ description: 'Create a new release/tag for a repository',
613
+ inputSchema: {
614
+ type: 'object',
615
+ properties: {
616
+ owner: { type: 'string', description: 'Repository owner' },
617
+ repo: { type: 'string', description: 'Repository name' },
618
+ tag_name: { type: 'string', description: 'Tag name (e.g. v1.2.0)' },
619
+ name: { type: 'string', description: 'Release name/title' },
620
+ body: { type: 'string', description: 'Release notes (markdown)' },
621
+ draft: { type: 'boolean', description: 'Create as draft', default: false },
622
+ prerelease: { type: 'boolean', description: 'Mark as pre-release', default: false },
623
+ target_commitish: { type: 'string', description: 'Branch or SHA to tag (default: default branch)' },
624
+ },
625
+ required: ['owner', 'repo', 'tag_name'],
626
+ },
627
+ requiresApproval: true,
628
+ handler: async (input) => {
629
+ const token = await this.getToken();
630
+ if (!token)
631
+ throw new Error('GitHub token required to create releases');
632
+ const release = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/releases`, {
633
+ method: 'POST',
634
+ token,
635
+ body: {
636
+ tag_name: input.tag_name,
637
+ name: input.name,
638
+ body: input.body,
639
+ draft: input.draft ?? false,
640
+ prerelease: input.prerelease ?? false,
641
+ target_commitish: input.target_commitish,
642
+ },
643
+ });
644
+ return { id: release.id, tag: release.tag_name, url: release.html_url };
645
+ },
646
+ },
647
+ // ── Social ───────────────────────────────────────────────────────────
648
+ {
649
+ name: 'github_star',
650
+ description: 'Star a GitHub repository',
651
+ inputSchema: {
652
+ type: 'object',
653
+ properties: {
654
+ owner: { type: 'string', description: 'Repository owner' },
655
+ repo: { type: 'string', description: 'Repository name' },
656
+ },
657
+ required: ['owner', 'repo'],
658
+ },
659
+ requiresApproval: true,
660
+ handler: async (input) => {
661
+ const token = await this.getToken();
662
+ if (!token)
663
+ throw new Error('GitHub token required to star repositories');
664
+ await this.ghFetch(`/user/starred/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}`, {
665
+ method: 'PUT',
666
+ token,
667
+ });
668
+ return { starred: true, repo: `${input.owner}/${input.repo}` };
669
+ },
670
+ },
671
+ {
672
+ name: 'github_fork',
673
+ description: 'Fork a GitHub repository',
674
+ inputSchema: {
675
+ type: 'object',
676
+ properties: {
677
+ owner: { type: 'string', description: 'Repository owner' },
678
+ repo: { type: 'string', description: 'Repository name' },
679
+ organization: {
680
+ type: 'string',
681
+ description: 'Fork into this organization (optional, defaults to your account)',
682
+ },
683
+ },
684
+ required: ['owner', 'repo'],
685
+ },
686
+ requiresApproval: true,
687
+ handler: async (input) => {
688
+ const token = await this.getToken();
689
+ if (!token)
690
+ throw new Error('GitHub token required to fork repositories');
691
+ const fork = await this.ghFetch(`/repos/${encodeURIComponent(input.owner)}/${encodeURIComponent(input.repo)}/forks`, {
692
+ method: 'POST',
693
+ token,
694
+ body: input.organization ? { organization: input.organization } : {},
695
+ });
696
+ return { name: fork.full_name, url: fork.html_url, cloneUrl: fork.clone_url };
697
+ },
698
+ },
699
+ // ── Authenticated user ───────────────────────────────────────────────
700
+ {
701
+ name: 'github_notifications',
702
+ description: 'List unread GitHub notifications (requires authentication)',
703
+ inputSchema: {
704
+ type: 'object',
705
+ properties: {
706
+ all: { type: 'boolean', description: 'Include read notifications', default: false },
707
+ per_page: { type: 'number', description: 'Results per page (default 20, max 50)' },
708
+ },
709
+ },
710
+ handler: async (input) => {
711
+ const token = await this.getToken();
712
+ if (!token)
713
+ throw new Error('GitHub token required to read notifications');
714
+ const params = new URLSearchParams({
715
+ all: String(input.all ?? false),
716
+ per_page: String(Math.min(input.per_page ?? 20, 50)),
717
+ });
718
+ const notifications = await this.ghFetch(`/notifications?${params}`, { token });
719
+ return notifications.map((n) => ({
720
+ id: n.id,
721
+ unread: n.unread,
722
+ reason: n.reason,
723
+ subject_type: n.subject?.type,
724
+ subject_title: n.subject?.title,
725
+ repo: n.repository?.full_name,
726
+ updated: n.updated_at,
727
+ }));
728
+ },
729
+ },
730
+ {
731
+ name: 'github_my_repos',
732
+ description: "List the authenticated user's repositories (requires authentication)",
733
+ inputSchema: {
734
+ type: 'object',
735
+ properties: {
736
+ type: {
737
+ type: 'string',
738
+ enum: ['all', 'public', 'private', 'forks', 'sources'],
739
+ description: 'Repository type filter (default: all)',
740
+ },
741
+ sort: { type: 'string', enum: ['created', 'updated', 'pushed', 'full_name'], description: 'Sort order' },
742
+ per_page: { type: 'number', description: 'Results per page (default 30, max 100)' },
743
+ },
744
+ },
745
+ handler: async (input) => {
746
+ const token = await this.getToken();
747
+ if (!token)
748
+ throw new Error('GitHub token required to list your repositories');
749
+ const params = new URLSearchParams({
750
+ type: input.type ?? 'all',
751
+ sort: input.sort ?? 'updated',
752
+ per_page: String(Math.min(input.per_page ?? 30, 100)),
753
+ });
754
+ const repos = await this.ghFetch(`/user/repos?${params}`, { token });
755
+ return repos.map((r) => ({
756
+ name: r.name,
757
+ full_name: r.full_name,
758
+ private: r.private,
759
+ description: r.description,
760
+ language: r.language,
761
+ stars: r.stargazers_count,
762
+ forks: r.forks_count,
763
+ updated: r.updated_at,
764
+ url: r.html_url,
765
+ }));
766
+ },
767
+ },
768
+ {
769
+ name: 'github_gists',
770
+ description: 'List public gists for a user',
771
+ inputSchema: {
772
+ type: 'object',
773
+ properties: {
774
+ username: { type: 'string', description: 'GitHub username (omit to list your own gists, requires auth)' },
775
+ per_page: { type: 'number', description: 'Results per page (default 20, max 100)' },
776
+ },
777
+ },
778
+ handler: async (input) => {
779
+ const token = await this.getToken();
780
+ const perPage = Math.min(input.per_page ?? 20, 100);
781
+ const path = input.username
782
+ ? `/users/${encodeURIComponent(input.username)}/gists?per_page=${perPage}`
783
+ : `/gists?per_page=${perPage}`;
784
+ const gists = await this.ghFetch(path, { token });
785
+ return gists.map((g) => ({
786
+ id: g.id,
787
+ description: g.description,
788
+ public: g.public,
789
+ files: Object.keys(g.files ?? {}),
790
+ owner: g.owner?.login,
791
+ created: g.created_at,
792
+ updated: g.updated_at,
793
+ url: g.html_url,
794
+ }));
795
+ },
796
+ },
797
+ ];
798
+ }
799
+ }
800
+ //# sourceMappingURL=github.js.map