@mastra/factory 0.0.0-esbuild-bundle-worker-20260807173433

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 (329) hide show
  1. package/CHANGELOG.md +1008 -0
  2. package/LICENSE.md +30 -0
  3. package/README.md +27 -0
  4. package/dist/auth.d.ts +183 -0
  5. package/dist/auth.d.ts.map +1 -0
  6. package/dist/auth.js +507 -0
  7. package/dist/auth.js.map +1 -0
  8. package/dist/capabilities/connection.d.ts +9 -0
  9. package/dist/capabilities/connection.d.ts.map +1 -0
  10. package/dist/capabilities/connection.js +1 -0
  11. package/dist/capabilities/intake.d.ts +141 -0
  12. package/dist/capabilities/intake.d.ts.map +1 -0
  13. package/dist/capabilities/intake.js +1 -0
  14. package/dist/capabilities/version-control.d.ts +247 -0
  15. package/dist/capabilities/version-control.d.ts.map +1 -0
  16. package/dist/capabilities/version-control.js +1 -0
  17. package/dist/factory.d.ts +159 -0
  18. package/dist/factory.d.ts.map +1 -0
  19. package/dist/factory.js +491 -0
  20. package/dist/factory.js.map +1 -0
  21. package/dist/index.d.ts +14 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +7 -0
  24. package/dist/integrations/base.d.ts +254 -0
  25. package/dist/integrations/base.d.ts.map +1 -0
  26. package/dist/integrations/base.js +1 -0
  27. package/dist/integrations/github/config.d.ts +60 -0
  28. package/dist/integrations/github/config.d.ts.map +1 -0
  29. package/dist/integrations/github/config.js +42 -0
  30. package/dist/integrations/github/config.js.map +1 -0
  31. package/dist/integrations/github/integration.d.ts +220 -0
  32. package/dist/integrations/github/integration.d.ts.map +1 -0
  33. package/dist/integrations/github/integration.js +1162 -0
  34. package/dist/integrations/github/integration.js.map +1 -0
  35. package/dist/integrations/github/issue-triage.d.ts +27 -0
  36. package/dist/integrations/github/issue-triage.d.ts.map +1 -0
  37. package/dist/integrations/github/issue-triage.js +82 -0
  38. package/dist/integrations/github/issue-triage.js.map +1 -0
  39. package/dist/integrations/github/pat.d.ts +38 -0
  40. package/dist/integrations/github/pat.d.ts.map +1 -0
  41. package/dist/integrations/github/pat.js +59 -0
  42. package/dist/integrations/github/pat.js.map +1 -0
  43. package/dist/integrations/github/provenance.d.ts +27 -0
  44. package/dist/integrations/github/provenance.d.ts.map +1 -0
  45. package/dist/integrations/github/provenance.js +75 -0
  46. package/dist/integrations/github/provenance.js.map +1 -0
  47. package/dist/integrations/github/reconcile-worker.d.ts +41 -0
  48. package/dist/integrations/github/reconcile-worker.d.ts.map +1 -0
  49. package/dist/integrations/github/reconcile-worker.js +125 -0
  50. package/dist/integrations/github/reconcile-worker.js.map +1 -0
  51. package/dist/integrations/github/routes.d.ts +69 -0
  52. package/dist/integrations/github/routes.d.ts.map +1 -0
  53. package/dist/integrations/github/routes.js +1335 -0
  54. package/dist/integrations/github/routes.js.map +1 -0
  55. package/dist/integrations/github/rules.d.ts +105 -0
  56. package/dist/integrations/github/rules.d.ts.map +1 -0
  57. package/dist/integrations/github/rules.js +551 -0
  58. package/dist/integrations/github/rules.js.map +1 -0
  59. package/dist/integrations/github/sandbox-release.d.ts +53 -0
  60. package/dist/integrations/github/sandbox-release.d.ts.map +1 -0
  61. package/dist/integrations/github/sandbox-release.js +115 -0
  62. package/dist/integrations/github/sandbox-release.js.map +1 -0
  63. package/dist/integrations/github/sandbox.d.ts +281 -0
  64. package/dist/integrations/github/sandbox.d.ts.map +1 -0
  65. package/dist/integrations/github/sandbox.js +547 -0
  66. package/dist/integrations/github/sandbox.js.map +1 -0
  67. package/dist/integrations/github/session-subscriptions.d.ts +26 -0
  68. package/dist/integrations/github/session-subscriptions.d.ts.map +1 -0
  69. package/dist/integrations/github/session-subscriptions.js +192 -0
  70. package/dist/integrations/github/session-subscriptions.js.map +1 -0
  71. package/dist/integrations/github/subscriptions.d.ts +54 -0
  72. package/dist/integrations/github/subscriptions.d.ts.map +1 -0
  73. package/dist/integrations/github/subscriptions.js +62 -0
  74. package/dist/integrations/github/subscriptions.js.map +1 -0
  75. package/dist/integrations/github/token-refresh.d.ts +12 -0
  76. package/dist/integrations/github/token-refresh.d.ts.map +1 -0
  77. package/dist/integrations/github/token-refresh.js +24 -0
  78. package/dist/integrations/github/token-refresh.js.map +1 -0
  79. package/dist/integrations/github/webhook.d.ts +107 -0
  80. package/dist/integrations/github/webhook.d.ts.map +1 -0
  81. package/dist/integrations/github/webhook.js +371 -0
  82. package/dist/integrations/github/webhook.js.map +1 -0
  83. package/dist/integrations/linear/agent-tools.d.ts +34 -0
  84. package/dist/integrations/linear/agent-tools.d.ts.map +1 -0
  85. package/dist/integrations/linear/agent-tools.js +85 -0
  86. package/dist/integrations/linear/agent-tools.js.map +1 -0
  87. package/dist/integrations/linear/integration.d.ts +235 -0
  88. package/dist/integrations/linear/integration.d.ts.map +1 -0
  89. package/dist/integrations/linear/integration.js +676 -0
  90. package/dist/integrations/linear/integration.js.map +1 -0
  91. package/dist/integrations/linear/routes.d.ts +61 -0
  92. package/dist/integrations/linear/routes.d.ts.map +1 -0
  93. package/dist/integrations/linear/routes.js +240 -0
  94. package/dist/integrations/linear/routes.js.map +1 -0
  95. package/dist/integrations/linear/rules.d.ts +44 -0
  96. package/dist/integrations/linear/rules.d.ts.map +1 -0
  97. package/dist/integrations/linear/rules.js +133 -0
  98. package/dist/integrations/linear/rules.js.map +1 -0
  99. package/dist/integrations/linear/storage.d.ts +65 -0
  100. package/dist/integrations/linear/storage.d.ts.map +1 -0
  101. package/dist/integrations/linear/storage.js +1 -0
  102. package/dist/integrations/platform/api-client.d.ts +26 -0
  103. package/dist/integrations/platform/api-client.d.ts.map +1 -0
  104. package/dist/integrations/platform/api-client.js +156 -0
  105. package/dist/integrations/platform/api-client.js.map +1 -0
  106. package/dist/integrations/platform/github/event-worker.d.ts +44 -0
  107. package/dist/integrations/platform/github/event-worker.d.ts.map +1 -0
  108. package/dist/integrations/platform/github/event-worker.js +349 -0
  109. package/dist/integrations/platform/github/event-worker.js.map +1 -0
  110. package/dist/integrations/platform/github/integration.d.ts +64 -0
  111. package/dist/integrations/platform/github/integration.d.ts.map +1 -0
  112. package/dist/integrations/platform/github/integration.js +1006 -0
  113. package/dist/integrations/platform/github/integration.js.map +1 -0
  114. package/dist/integrations/platform/linear/integration.d.ts +46 -0
  115. package/dist/integrations/platform/linear/integration.d.ts.map +1 -0
  116. package/dist/integrations/platform/linear/integration.js +483 -0
  117. package/dist/integrations/platform/linear/integration.js.map +1 -0
  118. package/dist/integrations/slack/connect-route.d.ts +46 -0
  119. package/dist/integrations/slack/connect-route.d.ts.map +1 -0
  120. package/dist/integrations/slack/connect-route.js +186 -0
  121. package/dist/integrations/slack/connect-route.js.map +1 -0
  122. package/dist/integrations/slack/integration.d.ts +62 -0
  123. package/dist/integrations/slack/integration.d.ts.map +1 -0
  124. package/dist/integrations/slack/integration.js +68 -0
  125. package/dist/integrations/slack/integration.js.map +1 -0
  126. package/dist/integrations/slack/slack.d.ts +200 -0
  127. package/dist/integrations/slack/slack.d.ts.map +1 -0
  128. package/dist/integrations/slack/slack.js +411 -0
  129. package/dist/integrations/slack/slack.js.map +1 -0
  130. package/dist/integrations/workos/integration.d.ts +39 -0
  131. package/dist/integrations/workos/integration.d.ts.map +1 -0
  132. package/dist/integrations/workos/integration.js +91 -0
  133. package/dist/integrations/workos/integration.js.map +1 -0
  134. package/dist/routes/config.d.ts +235 -0
  135. package/dist/routes/config.d.ts.map +1 -0
  136. package/dist/routes/config.js +972 -0
  137. package/dist/routes/config.js.map +1 -0
  138. package/dist/routes/custom-provider-source.d.ts +52 -0
  139. package/dist/routes/custom-provider-source.d.ts.map +1 -0
  140. package/dist/routes/custom-provider-source.js +124 -0
  141. package/dist/routes/custom-provider-source.js.map +1 -0
  142. package/dist/routes/fs.d.ts +151 -0
  143. package/dist/routes/fs.d.ts.map +1 -0
  144. package/dist/routes/fs.js +708 -0
  145. package/dist/routes/fs.js.map +1 -0
  146. package/dist/routes/intake.d.ts +23 -0
  147. package/dist/routes/intake.d.ts.map +1 -0
  148. package/dist/routes/intake.js +179 -0
  149. package/dist/routes/intake.js.map +1 -0
  150. package/dist/routes/oauth.d.ts +43 -0
  151. package/dist/routes/oauth.d.ts.map +1 -0
  152. package/dist/routes/oauth.js +463 -0
  153. package/dist/routes/oauth.js.map +1 -0
  154. package/dist/routes/projects.d.ts +19 -0
  155. package/dist/routes/projects.d.ts.map +1 -0
  156. package/dist/routes/projects.js +461 -0
  157. package/dist/routes/projects.js.map +1 -0
  158. package/dist/routes/provider-credentials.d.ts +81 -0
  159. package/dist/routes/provider-credentials.d.ts.map +1 -0
  160. package/dist/routes/provider-credentials.js +86 -0
  161. package/dist/routes/provider-credentials.js.map +1 -0
  162. package/dist/routes/route.d.ts +48 -0
  163. package/dist/routes/route.d.ts.map +1 -0
  164. package/dist/routes/route.js +15 -0
  165. package/dist/routes/route.js.map +1 -0
  166. package/dist/routes/skills.d.ts +30 -0
  167. package/dist/routes/skills.d.ts.map +1 -0
  168. package/dist/routes/skills.js +168 -0
  169. package/dist/routes/skills.js.map +1 -0
  170. package/dist/routes/surface.d.ts +107 -0
  171. package/dist/routes/surface.d.ts.map +1 -0
  172. package/dist/routes/surface.js +297 -0
  173. package/dist/routes/surface.js.map +1 -0
  174. package/dist/routes/tenant-credentials.d.ts +74 -0
  175. package/dist/routes/tenant-credentials.d.ts.map +1 -0
  176. package/dist/routes/tenant-credentials.js +156 -0
  177. package/dist/routes/tenant-credentials.js.map +1 -0
  178. package/dist/routes/work-items.d.ts +40 -0
  179. package/dist/routes/work-items.d.ts.map +1 -0
  180. package/dist/routes/work-items.js +695 -0
  181. package/dist/routes/work-items.js.map +1 -0
  182. package/dist/rules/binding-context.d.ts +5 -0
  183. package/dist/rules/binding-context.d.ts.map +1 -0
  184. package/dist/rules/binding-context.js +28 -0
  185. package/dist/rules/binding-context.js.map +1 -0
  186. package/dist/rules/defaults.d.ts +9 -0
  187. package/dist/rules/defaults.d.ts.map +1 -0
  188. package/dist/rules/defaults.js +322 -0
  189. package/dist/rules/defaults.js.map +1 -0
  190. package/dist/rules/dispatcher.d.ts +43 -0
  191. package/dist/rules/dispatcher.d.ts.map +1 -0
  192. package/dist/rules/dispatcher.js +547 -0
  193. package/dist/rules/dispatcher.js.map +1 -0
  194. package/dist/rules/index.d.ts +7 -0
  195. package/dist/rules/index.d.ts.map +1 -0
  196. package/dist/rules/index.js +5 -0
  197. package/dist/rules/processor.d.ts +54 -0
  198. package/dist/rules/processor.d.ts.map +1 -0
  199. package/dist/rules/processor.js +378 -0
  200. package/dist/rules/processor.js.map +1 -0
  201. package/dist/rules/resolve.d.ts +17 -0
  202. package/dist/rules/resolve.d.ts.map +1 -0
  203. package/dist/rules/resolve.js +30 -0
  204. package/dist/rules/resolve.js.map +1 -0
  205. package/dist/rules/start-coordinator.d.ts +60 -0
  206. package/dist/rules/start-coordinator.d.ts.map +1 -0
  207. package/dist/rules/start-coordinator.js +175 -0
  208. package/dist/rules/start-coordinator.js.map +1 -0
  209. package/dist/rules/tools.d.ts +10 -0
  210. package/dist/rules/tools.d.ts.map +1 -0
  211. package/dist/rules/tools.js +59 -0
  212. package/dist/rules/tools.js.map +1 -0
  213. package/dist/rules/transition-service.d.ts +49 -0
  214. package/dist/rules/transition-service.d.ts.map +1 -0
  215. package/dist/rules/transition-service.js +232 -0
  216. package/dist/rules/transition-service.js.map +1 -0
  217. package/dist/rules/types.d.ts +261 -0
  218. package/dist/rules/types.d.ts.map +1 -0
  219. package/dist/rules/types.js +43 -0
  220. package/dist/rules/types.js.map +1 -0
  221. package/dist/rules/validation.d.ts +11 -0
  222. package/dist/rules/validation.d.ts.map +1 -0
  223. package/dist/rules/validation.js +308 -0
  224. package/dist/rules/validation.js.map +1 -0
  225. package/dist/sandbox/fleet.d.ts +222 -0
  226. package/dist/sandbox/fleet.d.ts.map +1 -0
  227. package/dist/sandbox/fleet.js +322 -0
  228. package/dist/sandbox/fleet.js.map +1 -0
  229. package/dist/sandbox/reattach.d.ts +3 -0
  230. package/dist/sandbox/reattach.d.ts.map +1 -0
  231. package/dist/sandbox/reattach.js +16 -0
  232. package/dist/sandbox/reattach.js.map +1 -0
  233. package/dist/server-error.d.ts +12 -0
  234. package/dist/server-error.d.ts.map +1 -0
  235. package/dist/server-error.js +16 -0
  236. package/dist/server-error.js.map +1 -0
  237. package/dist/session/factory-session.d.ts +116 -0
  238. package/dist/session/factory-session.d.ts.map +1 -0
  239. package/dist/session/factory-session.js +162 -0
  240. package/dist/session/factory-session.js.map +1 -0
  241. package/dist/skills/service.d.ts +48 -0
  242. package/dist/skills/service.d.ts.map +1 -0
  243. package/dist/skills/service.js +40 -0
  244. package/dist/skills/service.js.map +1 -0
  245. package/dist/spa-static.d.ts +33 -0
  246. package/dist/spa-static.d.ts.map +1 -0
  247. package/dist/spa-static.js +104 -0
  248. package/dist/spa-static.js.map +1 -0
  249. package/dist/state-signing.d.ts +59 -0
  250. package/dist/state-signing.d.ts.map +1 -0
  251. package/dist/state-signing.js +83 -0
  252. package/dist/state-signing.js.map +1 -0
  253. package/dist/storage/domains/audit/agent-audit.d.ts +27 -0
  254. package/dist/storage/domains/audit/agent-audit.d.ts.map +1 -0
  255. package/dist/storage/domains/audit/agent-audit.js +66 -0
  256. package/dist/storage/domains/audit/agent-audit.js.map +1 -0
  257. package/dist/storage/domains/audit/base.d.ts +140 -0
  258. package/dist/storage/domains/audit/base.d.ts.map +1 -0
  259. package/dist/storage/domains/audit/base.js +184 -0
  260. package/dist/storage/domains/audit/base.js.map +1 -0
  261. package/dist/storage/domains/audit/domain.d.ts +76 -0
  262. package/dist/storage/domains/audit/domain.d.ts.map +1 -0
  263. package/dist/storage/domains/audit/domain.js +269 -0
  264. package/dist/storage/domains/audit/domain.js.map +1 -0
  265. package/dist/storage/domains/channel-identity/base.d.ts +96 -0
  266. package/dist/storage/domains/channel-identity/base.d.ts.map +1 -0
  267. package/dist/storage/domains/channel-identity/base.js +149 -0
  268. package/dist/storage/domains/channel-identity/base.js.map +1 -0
  269. package/dist/storage/domains/credentials/base.d.ts +134 -0
  270. package/dist/storage/domains/credentials/base.d.ts.map +1 -0
  271. package/dist/storage/domains/credentials/base.js +273 -0
  272. package/dist/storage/domains/credentials/base.js.map +1 -0
  273. package/dist/storage/domains/custom-providers/base.d.ts +57 -0
  274. package/dist/storage/domains/custom-providers/base.d.ts.map +1 -0
  275. package/dist/storage/domains/custom-providers/base.js +145 -0
  276. package/dist/storage/domains/custom-providers/base.js.map +1 -0
  277. package/dist/storage/domains/intake/base.d.ts +38 -0
  278. package/dist/storage/domains/intake/base.d.ts.map +1 -0
  279. package/dist/storage/domains/intake/base.js +80 -0
  280. package/dist/storage/domains/intake/base.js.map +1 -0
  281. package/dist/storage/domains/integrations/base.d.ts +126 -0
  282. package/dist/storage/domains/integrations/base.d.ts.map +1 -0
  283. package/dist/storage/domains/integrations/base.js +317 -0
  284. package/dist/storage/domains/integrations/base.js.map +1 -0
  285. package/dist/storage/domains/memory-settings/base.d.ts +62 -0
  286. package/dist/storage/domains/memory-settings/base.d.ts.map +1 -0
  287. package/dist/storage/domains/memory-settings/base.js +126 -0
  288. package/dist/storage/domains/memory-settings/base.js.map +1 -0
  289. package/dist/storage/domains/model-packs/base.d.ts +49 -0
  290. package/dist/storage/domains/model-packs/base.d.ts.map +1 -0
  291. package/dist/storage/domains/model-packs/base.js +96 -0
  292. package/dist/storage/domains/model-packs/base.js.map +1 -0
  293. package/dist/storage/domains/projects/base.d.ts +58 -0
  294. package/dist/storage/domains/projects/base.d.ts.map +1 -0
  295. package/dist/storage/domains/projects/base.js +111 -0
  296. package/dist/storage/domains/projects/base.js.map +1 -0
  297. package/dist/storage/domains/queue-health/base.d.ts +52 -0
  298. package/dist/storage/domains/queue-health/base.d.ts.map +1 -0
  299. package/dist/storage/domains/queue-health/base.js +122 -0
  300. package/dist/storage/domains/queue-health/base.js.map +1 -0
  301. package/dist/storage/domains/source-control/base.d.ts +360 -0
  302. package/dist/storage/domains/source-control/base.d.ts.map +1 -0
  303. package/dist/storage/domains/source-control/base.js +914 -0
  304. package/dist/storage/domains/source-control/base.js.map +1 -0
  305. package/dist/storage/domains/source-control/inmemory.d.ts +175 -0
  306. package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -0
  307. package/dist/storage/domains/source-control/inmemory.js +380 -0
  308. package/dist/storage/domains/source-control/inmemory.js.map +1 -0
  309. package/dist/storage/domains/work-items/base.d.ts +412 -0
  310. package/dist/storage/domains/work-items/base.d.ts.map +1 -0
  311. package/dist/storage/domains/work-items/base.js +1320 -0
  312. package/dist/storage/domains/work-items/base.js.map +1 -0
  313. package/dist/storage/domains/work-items/metrics.d.ts +101 -0
  314. package/dist/storage/domains/work-items/metrics.d.ts.map +1 -0
  315. package/dist/storage/domains/work-items/metrics.js +221 -0
  316. package/dist/storage/domains/work-items/metrics.js.map +1 -0
  317. package/dist/timing.d.ts +15 -0
  318. package/dist/timing.d.ts.map +1 -0
  319. package/dist/timing.js +34 -0
  320. package/dist/timing.js.map +1 -0
  321. package/dist/workspace.d.ts +24 -0
  322. package/dist/workspace.d.ts.map +1 -0
  323. package/dist/workspace.js +287 -0
  324. package/dist/workspace.js.map +1 -0
  325. package/factory-skills/configure-factory-rules/SKILL.md +67 -0
  326. package/factory-skills/factory-plan/SKILL.md +61 -0
  327. package/factory-skills/factory-review/SKILL.md +157 -0
  328. package/factory-skills/factory-triage/SKILL.md +99 -0
  329. package/package.json +83 -0
@@ -0,0 +1,254 @@
1
+ /**
2
+ * `FactoryIntegration` — the common contract for pluggable web integrations
3
+ * (GitHub, Linear, third-party).
4
+ *
5
+ * Each integration is a self-contained class: the deploy entry
6
+ * (`src/mastra/index.ts`) reads that integration's env vars ONCE, constructs
7
+ * an instance with explicit credentials, and passes it to `MastraFactory`
8
+ * via `integrations: [...]`. The factory registers the pieces each instance
9
+ * provides — HTTP routes, agent/session tools, diagnostics — into the system.
10
+ * No system code reads integration env vars or imports integration free
11
+ * functions; everything downstream talks to instances through this interface.
12
+ *
13
+ * An absent integration means: its routes never mount, its tools never
14
+ * register, diagnostics report "not configured", and the server boots fine.
15
+ * Third parties add capabilities by implementing this same interface — no
16
+ * factory changes required (the same capability-based philosophy as the
17
+ * sandbox machine's `derive()` gate).
18
+ */
19
+ import type { MastraCodeConfig, MountedMastraCode } from '@mastra/code-sdk';
20
+ import type { AgentControllerChannelsConfig, ChannelAdapterConfig } from '@mastra/core/channels';
21
+ import type { RequestContext } from '@mastra/core/request-context';
22
+ import type { ApiRoute } from '@mastra/core/server';
23
+ import type { FactoryStorage } from '@mastra/core/storage';
24
+ import type { MastraWorker } from '@mastra/core/worker';
25
+ import type { Intake } from '../capabilities/intake.js';
26
+ import type { VersionControl } from '../capabilities/version-control.js';
27
+ import type { RouteAuth } from '../routes/route.js';
28
+ import type { FactoryRules } from '../rules/types.js';
29
+ import type { SandboxFleet } from '../sandbox/fleet.js';
30
+ import type { StateSigner } from '../state-signing.js';
31
+ import type { AuditEventRow } from '../storage/domains/audit/base.js';
32
+ import type { AuditEmitter } from '../storage/domains/audit/domain.js';
33
+ import type { ChannelIdentityStorage } from '../storage/domains/channel-identity/base.js';
34
+ import type { IntakeStorage } from '../storage/domains/intake/base.js';
35
+ import type { IntegrationStorageHandle } from '../storage/domains/integrations/base.js';
36
+ import type { MemorySettingsStorage } from '../storage/domains/memory-settings/base.js';
37
+ import type { FactoryProjectsStorage } from '../storage/domains/projects/base.js';
38
+ import type { SourceControlStorageHandle } from '../storage/domains/source-control/base.js';
39
+ import type { WorkItemsStorage } from '../storage/domains/work-items/base.js';
40
+ /** Factory-owned hooks integrations may invoke. */
41
+ export interface IntegrationHooks {
42
+ emitAudit?: AuditEmitter['emit'];
43
+ }
44
+ /**
45
+ * Tool records integrations contribute — the same static-record shape the
46
+ * SDK's `extraTools` accepts, so the factory can merge every integration's
47
+ * tools into one dynamic tool set.
48
+ */
49
+ export type IntegrationTools = Extract<NonNullable<MastraCodeConfig['extraTools']>, Record<string, unknown>>;
50
+ export interface IntegrationPostToolContext {
51
+ toolName: string;
52
+ input: unknown;
53
+ output?: unknown;
54
+ error?: unknown;
55
+ context: unknown;
56
+ }
57
+ /**
58
+ * Everything the factory hands an integration when collecting its routes.
59
+ * Built once per boot in `MastraFactory.prepare()`.
60
+ */
61
+ export interface IntegrationContext {
62
+ /** Host auth seam — integration routes resolve callers through this. */
63
+ auth: RouteAuth;
64
+ /**
65
+ * Sandbox fleet for per-project sandboxes. Always constructed at boot; a
66
+ * fleet built without a machine config reports `enabled: false` and
67
+ * sandbox-backed routes respond 503.
68
+ */
69
+ fleet: SandboxFleet;
70
+ /**
71
+ * Root factory storage backend and source of the `appDbConfigured`
72
+ * diagnostic. Absent when the host runs without an application database.
73
+ */
74
+ factoryStorage?: FactoryStorage;
75
+ /** Browser-facing origin (OAuth redirect base), no trailing slash. */
76
+ baseUrl?: string;
77
+ /** Mounted agent controller for webhook → session signal delivery. */
78
+ controller?: MountedMastraCode['controller'];
79
+ /**
80
+ * Shared OAuth state signer created by the factory. One signer per boot, so
81
+ * every integration's OAuth flow signs and verifies with the same secret.
82
+ */
83
+ stateSigner?: StateSigner;
84
+ /** Persistence handles pre-scoped to this integration's stable id. */
85
+ storage: {
86
+ generic: IntegrationStorageHandle;
87
+ sourceControl: SourceControlStorageHandle;
88
+ /**
89
+ * The factory's source-control-owning integration's storage handle
90
+ * (today: GitHub when registered; the handle carries its own
91
+ * `integrationId`). Channel integrations use it to make sessions
92
+ * repo-backed without the entry hand-wiring a source-control slice.
93
+ * Absent when no source-control owner is registered.
94
+ */
95
+ sourceControlOwner?: SourceControlStorageHandle;
96
+ /** Factory projects domain — e.g. resolving a project's default model. */
97
+ projects: FactoryProjectsStorage;
98
+ /**
99
+ * Observational-memory settings domain, so a session an integration starts
100
+ * adopts the same memory configuration the web kickoff applies.
101
+ */
102
+ memorySettings: MemorySettingsStorage;
103
+ /** Cross-integration intake selection (which sources are synced). */
104
+ intake: IntakeStorage;
105
+ /**
106
+ * Reverse index from a chat-platform sender to a Mastra tenant. Channel
107
+ * integrations resolve an inbound sender through this to run under the
108
+ * right user's credentials.
109
+ */
110
+ channelIdentity: ChannelIdentityStorage;
111
+ };
112
+ /**
113
+ * Factory rule runtime available when the work-item domain is ready.
114
+ * Integrations attach their own provider event rules to their ingress
115
+ * surfaces instead of relying on provider-specific services in the host.
116
+ */
117
+ rules?: {
118
+ config: FactoryRules;
119
+ workItems: WorkItemsStorage;
120
+ };
121
+ /** System hooks integrations may invoke. */
122
+ hooks?: IntegrationHooks;
123
+ }
124
+ /**
125
+ * One adapter entry in a {@link FactoryChannelsConfig} adapter map.
126
+ *
127
+ * Core's adapter-map entry is `ChannelAdapterConfig | Adapter<any, any>`, and
128
+ * `ChannelAdapterConfig` is itself a union — so this MUST be a type alias, not
129
+ * an interface extends (illegal on unions). Factory's contract deliberately
130
+ * EXCLUDES the bare-`Adapter` shorthand core accepts: entries use the config
131
+ * form so future per-platform extras (e.g. a `resolveWorkspaceId`, connect
132
+ * handlers) have a home. Today the alias adds no fields; it is the stable
133
+ * extension point.
134
+ */
135
+ export type FactoryChannelAdapterEntry = ChannelAdapterConfig;
136
+ /**
137
+ * The channels contribution a {@link FactoryIntegration} returns from
138
+ * `channels()`. A config object, not a built instance — the factory constructs
139
+ * the `AgentControllerChannels` at the attach site.
140
+ *
141
+ * The adapter-map key is the platform identity (`'slack'`, `'discord'`, …).
142
+ * One integration = one platform = one entry is the norm: the map shape is
143
+ * inherited from core (one `AgentControllerChannels` instance drives multiple
144
+ * adapters) and is where cross-integration merging will happen later — it is
145
+ * NOT an invitation for a single integration to bundle multiple platforms.
146
+ * Note the top-level `handlers` and resolvers are shared across all adapters
147
+ * in the map. Entries use the config form; the bare-`Adapter` shorthand core
148
+ * accepts is deliberately excluded (see {@link FactoryChannelAdapterEntry}).
149
+ */
150
+ export interface FactoryChannelsConfig extends Omit<AgentControllerChannelsConfig, 'adapters'> {
151
+ adapters: Record<string, FactoryChannelAdapterEntry>;
152
+ }
153
+ /**
154
+ * A pluggable web integration. Implementations own their credentials
155
+ * (validated at construction), their API surface, and their HTTP routes.
156
+ */
157
+ export interface FactoryIntegration {
158
+ /** Stable identifier: `'github'`, `'linear'`, custom ids for third parties. */
159
+ readonly id: string;
160
+ /** Issue-oriented capability consumed by Intake. */
161
+ readonly intake?: Intake;
162
+ /** Repository, installation, and pull-request capability. */
163
+ readonly versionControl?: VersionControl;
164
+ /**
165
+ * Bind the integration's generic persistence handle. Called once by the
166
+ * factory during `prepare()` (before routes/tools/workers are collected),
167
+ * so instance methods that run outside an `IntegrationContext` — per-request
168
+ * agent tools, intake capability calls — reach storage without a service
169
+ * locator. Mirrors `sourceControl.initialize`.
170
+ */
171
+ initialize?(args: {
172
+ storage: IntegrationStorageHandle;
173
+ projects: FactoryProjectsStorage;
174
+ auth: RouteAuth;
175
+ }): void;
176
+ /**
177
+ * The integration's full HTTP surface (status, OAuth, webhooks, feature
178
+ * routes), as Mastra `apiRoutes`. Called once at boot; the factory folds
179
+ * the result into the server's route table.
180
+ */
181
+ routes(ctx: IntegrationContext): ApiRoute[];
182
+ /**
183
+ * Org-scoped agent tools resolved per request (e.g. Linear's issue tools).
184
+ * Optional capability; the factory merges results into the SDK's async
185
+ * `extraTools` provider.
186
+ */
187
+ agentTools?(args: {
188
+ requestContext: RequestContext;
189
+ }): Promise<IntegrationTools>;
190
+ /**
191
+ * Session-scoped tools (e.g. GitHub's PR subscribe/unsubscribe). Optional
192
+ * capability, resolved synchronously per request.
193
+ */
194
+ sessionTools?(args: {
195
+ requestContext: RequestContext;
196
+ }): IntegrationTools;
197
+ /**
198
+ * Optional provider-owned observer for successful or failed tool calls.
199
+ * The factory invokes every configured observer independently so one
200
+ * integration cannot prevent another from observing the same tool result.
201
+ */
202
+ postToolObserver?(args: {
203
+ toolContext: IntegrationPostToolContext;
204
+ requestContext?: RequestContext;
205
+ }): Promise<void>;
206
+ /**
207
+ * Background workers the integration needs running for its lifecycle
208
+ * (e.g. polling an upstream that doesn't support webhooks). Optional
209
+ * capability: called once at boot for READY integrations only; the factory
210
+ * folds the returned workers into the server Mastra's `workers` option, so
211
+ * they are merged with the built-in workers and started with them
212
+ * (`startWorkers()`). Worker names must be unique across integrations —
213
+ * duplicates fail the `new Mastra(...)` construction loudly.
214
+ */
215
+ workers?(ctx: IntegrationContext): MastraWorker[];
216
+ /**
217
+ * Chat-platform channels this integration contributes (Slack, Discord, …).
218
+ * Called once at boot for READY integrations only; the factory constructs an
219
+ * `AgentControllerChannels` from the returned config and attaches it to the
220
+ * mounted agent controller via `setChannels`, so inbound platform messages
221
+ * reach the same agents the web UI drives.
222
+ *
223
+ * An integration providing this slot also declares a dependency on the
224
+ * `channel-identity` domain, which the factory folds into its readiness
225
+ * gate — so an integration whose reverse index isn't migrated yet reports
226
+ * not-ready and its channels never attach, rather than dispatching runs it
227
+ * can't resolve a tenant for.
228
+ *
229
+ * Only one integration may provide channels; the factory fails loud at boot
230
+ * on a second, because `setChannels` replaces rather than merges and the
231
+ * loser would silently never receive a message.
232
+ */
233
+ channels?(ctx: IntegrationContext): FactoryChannelsConfig;
234
+ /**
235
+ * Non-secret config snapshot (booleans + names only, never values). The
236
+ * factory merges it into system diagnostics/startup logs.
237
+ */
238
+ diagnostics(): Record<string, unknown>;
239
+ /**
240
+ * Optional best-effort destination for locally persisted audit events.
241
+ * Audit export remains independent of the configured web auth adapter.
242
+ */
243
+ audit?(args: {
244
+ event: AuditEventRow;
245
+ }): Promise<void>;
246
+ /**
247
+ * True when the integration signs OAuth `state` and therefore needs a
248
+ * replica-stable signer. The factory fails loud at boot when a registered
249
+ * integration requires stability but only a per-process random secret is
250
+ * available (see `./state-signing.ts`).
251
+ */
252
+ readonly requiresStableStateSigner?: boolean;
253
+ }
254
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/integrations/base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AA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;IAClD;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,CAAC,GAAG,EAAE,kBAAkB,GAAG,qBAAqB,CAAC;IAC1D;;;OAGG;IACH,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC;;;OAGG;IACH,KAAK,CAAC,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,aAAa,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD;;;;;OAKG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,OAAO,CAAC;CAC9C"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Composite feature gate + diagnostics for the GitHub App project feature.
3
+ *
4
+ * The GitHub feature is enabled only when *all three* hold:
5
+ * - a `GithubIntegration` instance is registered with the factory
6
+ * (constructed by the deploy entry from the `GITHUB_APP_*` env vars),
7
+ * - web auth is enabled (a per-user installation requires a logged-in user),
8
+ * - the application database is configured.
9
+ *
10
+ * OAuth/install `state` signing lives in `../../state-signing.ts` — the factory
11
+ * creates one shared signer at boot and hands it to every integration.
12
+ *
13
+ * Everything here is pure: callers pass the handles they already own (the
14
+ * integration, auth seam, state signer, sandbox fleet) — there is no global
15
+ * registry lookup.
16
+ */
17
+ import type { RouteAuth } from '../../routes/route.js';
18
+ import type { SandboxFleet } from '../../sandbox/fleet.js';
19
+ import type { StateSigner } from '../../state-signing.js';
20
+ import type { GithubIntegration } from './integration.js';
21
+ /** Handles the GitHub feature gate + diagnostics are computed from. */
22
+ export interface GithubFeatureGateOptions {
23
+ /** The registered GitHub integration, when configured. */
24
+ github: GithubIntegration | undefined;
25
+ /** Web auth seam — the feature requires a logged-in user. */
26
+ auth: RouteAuth;
27
+ /** True when the application database is configured. */
28
+ appDbConfigured: boolean;
29
+ /** Shared OAuth/install `state` signer, when configured. */
30
+ stateSigner?: StateSigner;
31
+ /** Sandbox fleet, when sandboxes are configured. */
32
+ fleet?: SandboxFleet;
33
+ }
34
+ /**
35
+ * True when the GitHub App project feature should be active.
36
+ */
37
+ export declare function isGithubFeatureEnabled(options: Pick<GithubFeatureGateOptions, 'github' | 'auth'>): boolean;
38
+ /**
39
+ * Non-secret diagnostic snapshot of every GitHub feature gate. Used by startup
40
+ * logs, `/web/github/status`, and the SPA so all three explain the same state.
41
+ *
42
+ * Only env var *names* and booleans are exposed — never secret values.
43
+ */
44
+ export interface GithubFeatureDiagnostics {
45
+ githubAppConfigured: boolean;
46
+ factoryAuthEnabled: boolean;
47
+ appDbConfigured: boolean;
48
+ stateSecretConfigured: boolean;
49
+ sandboxEnabled: boolean;
50
+ sandboxProvider: string;
51
+ /** Names of the GitHub App env vars still needed (empty when configured). */
52
+ missingGithubAppEnvVars: string[];
53
+ }
54
+ /**
55
+ * Collect a non-secret diagnostic snapshot of every GitHub feature gate. Centralizes
56
+ * the feature-gate reasoning so startup logs, the status API, and the SPA explain
57
+ * the same state. Does not change `isGithubFeatureEnabled()` behavior.
58
+ */
59
+ export declare function getGithubFeatureDiagnostics(options: GithubFeatureGateOptions): GithubFeatureDiagnostics;
60
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/integrations/github/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAiB1D,uEAAuE;AACvE,MAAM,WAAW,wBAAwB;IACvC,0DAA0D;IAC1D,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACtC,6DAA6D;IAC7D,IAAI,EAAE,SAAS,CAAC;IAChB,wDAAwD;IACxD,eAAe,EAAE,OAAO,CAAC;IACzB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,oDAAoD;IACpD,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,wBAAwB,EAAE,QAAQ,GAAG,MAAM,CAAC,GAAG,OAAO,CAE1G;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,uBAAuB,EAAE,MAAM,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,wBAAwB,GAAG,wBAAwB,CAWvG"}
@@ -0,0 +1,42 @@
1
+ //#region src/integrations/github/config.ts
2
+ /**
3
+ * Env vars the deploy entry reads to construct a `GithubIntegration`. Names
4
+ * only — used by diagnostics to tell an operator what to set when the
5
+ * integration is absent. The entry enforces all-or-nothing: partial config
6
+ * fails the boot, so at runtime the integration is either fully configured or
7
+ * not configured at all.
8
+ */
9
+ const GITHUB_APP_ENV_VARS = [
10
+ "GITHUB_APP_ID",
11
+ "GITHUB_APP_PRIVATE_KEY",
12
+ "GITHUB_APP_CLIENT_ID",
13
+ "GITHUB_APP_CLIENT_SECRET",
14
+ "GITHUB_APP_SLUG"
15
+ ];
16
+ /**
17
+ * True when the GitHub App project feature should be active.
18
+ */
19
+ function isGithubFeatureEnabled(options) {
20
+ return options.github !== void 0 && options.auth.enabled();
21
+ }
22
+ /**
23
+ * Collect a non-secret diagnostic snapshot of every GitHub feature gate. Centralizes
24
+ * the feature-gate reasoning so startup logs, the status API, and the SPA explain
25
+ * the same state. Does not change `isGithubFeatureEnabled()` behavior.
26
+ */
27
+ function getGithubFeatureDiagnostics(options) {
28
+ const { github, auth, appDbConfigured, stateSigner, fleet } = options;
29
+ return {
30
+ githubAppConfigured: github !== void 0,
31
+ factoryAuthEnabled: auth.enabled(),
32
+ appDbConfigured,
33
+ stateSecretConfigured: stateSigner?.stable ?? false,
34
+ sandboxEnabled: fleet?.enabled ?? false,
35
+ sandboxProvider: fleet?.provider ?? "none",
36
+ missingGithubAppEnvVars: github ? [] : [...GITHUB_APP_ENV_VARS]
37
+ };
38
+ }
39
+ //#endregion
40
+ export { getGithubFeatureDiagnostics, isGithubFeatureEnabled };
41
+
42
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","names":[],"sources":["../../../src/integrations/github/config.ts"],"sourcesContent":["/**\n * Composite feature gate + diagnostics for the GitHub App project feature.\n *\n * The GitHub feature is enabled only when *all three* hold:\n * - a `GithubIntegration` instance is registered with the factory\n * (constructed by the deploy entry from the `GITHUB_APP_*` env vars),\n * - web auth is enabled (a per-user installation requires a logged-in user),\n * - the application database is configured.\n *\n * OAuth/install `state` signing lives in `../../state-signing.ts` — the factory\n * creates one shared signer at boot and hands it to every integration.\n *\n * Everything here is pure: callers pass the handles they already own (the\n * integration, auth seam, state signer, sandbox fleet) — there is no global\n * registry lookup.\n */\n\nimport type { RouteAuth } from '../../routes/route.js';\nimport type { SandboxFleet } from '../../sandbox/fleet.js';\nimport type { StateSigner } from '../../state-signing.js';\nimport type { GithubIntegration } from './integration.js';\n\n/**\n * Env vars the deploy entry reads to construct a `GithubIntegration`. Names\n * only — used by diagnostics to tell an operator what to set when the\n * integration is absent. The entry enforces all-or-nothing: partial config\n * fails the boot, so at runtime the integration is either fully configured or\n * not configured at all.\n */\nconst GITHUB_APP_ENV_VARS = [\n 'GITHUB_APP_ID',\n 'GITHUB_APP_PRIVATE_KEY',\n 'GITHUB_APP_CLIENT_ID',\n 'GITHUB_APP_CLIENT_SECRET',\n 'GITHUB_APP_SLUG',\n] as const;\n\n/** Handles the GitHub feature gate + diagnostics are computed from. */\nexport interface GithubFeatureGateOptions {\n /** The registered GitHub integration, when configured. */\n github: GithubIntegration | undefined;\n /** Web auth seam — the feature requires a logged-in user. */\n auth: RouteAuth;\n /** True when the application database is configured. */\n appDbConfigured: boolean;\n /** Shared OAuth/install `state` signer, when configured. */\n stateSigner?: StateSigner;\n /** Sandbox fleet, when sandboxes are configured. */\n fleet?: SandboxFleet;\n}\n\n/**\n * True when the GitHub App project feature should be active.\n */\nexport function isGithubFeatureEnabled(options: Pick<GithubFeatureGateOptions, 'github' | 'auth'>): boolean {\n return options.github !== undefined && options.auth.enabled();\n}\n\n/**\n * Non-secret diagnostic snapshot of every GitHub feature gate. Used by startup\n * logs, `/web/github/status`, and the SPA so all three explain the same state.\n *\n * Only env var *names* and booleans are exposed — never secret values.\n */\nexport interface GithubFeatureDiagnostics {\n githubAppConfigured: boolean;\n factoryAuthEnabled: boolean;\n appDbConfigured: boolean;\n stateSecretConfigured: boolean;\n sandboxEnabled: boolean;\n sandboxProvider: string;\n /** Names of the GitHub App env vars still needed (empty when configured). */\n missingGithubAppEnvVars: string[];\n}\n\n/**\n * Collect a non-secret diagnostic snapshot of every GitHub feature gate. Centralizes\n * the feature-gate reasoning so startup logs, the status API, and the SPA explain\n * the same state. Does not change `isGithubFeatureEnabled()` behavior.\n */\nexport function getGithubFeatureDiagnostics(options: GithubFeatureGateOptions): GithubFeatureDiagnostics {\n const { github, auth, appDbConfigured, stateSigner, fleet } = options;\n return {\n githubAppConfigured: github !== undefined,\n factoryAuthEnabled: auth.enabled(),\n appDbConfigured,\n stateSecretConfigured: stateSigner?.stable ?? false,\n sandboxEnabled: fleet?.enabled ?? false,\n sandboxProvider: fleet?.provider ?? 'none',\n missingGithubAppEnvVars: github ? [] : [...GITHUB_APP_ENV_VARS],\n };\n}\n"],"mappings":";;;;;;;;AA6BA,MAAM,sBAAsB;CAC1B;CACA;CACA;CACA;CACA;AACF;;;;AAmBA,SAAgB,uBAAuB,SAAqE;CAC1G,OAAO,QAAQ,WAAW,KAAA,KAAa,QAAQ,KAAK,QAAQ;AAC9D;;;;;;AAwBA,SAAgB,4BAA4B,SAA6D;CACvG,MAAM,EAAE,QAAQ,MAAM,iBAAiB,aAAa,UAAU;CAC9D,OAAO;EACL,qBAAqB,WAAW,KAAA;EAChC,oBAAoB,KAAK,QAAQ;EACjC;EACA,uBAAuB,aAAa,UAAU;EAC9C,gBAAgB,OAAO,WAAW;EAClC,iBAAiB,OAAO,YAAY;EACpC,yBAAyB,SAAS,CAAC,IAAI,CAAC,GAAG,mBAAmB;CAChE;AACF"}
@@ -0,0 +1,220 @@
1
+ /**
2
+ * `GithubIntegration` — the injectable GitHub App integration for the web
3
+ * factory.
4
+ *
5
+ * The deploy entry (`src/mastra/index.ts`) reads the `GITHUB_APP_*` env vars
6
+ * once, constructs an instance, and passes it to `MastraFactory` (the same
7
+ * dependency-injection pattern as the auth adapter and the sandbox machine).
8
+ * The factory seeds it into the runtime-config registry for the feature gate
9
+ * (`./config.ts`) and hands the instance to every consumer explicitly — route
10
+ * handlers receive it through `routes()`, the webhook fan-out and session
11
+ * subscription tools through their deps.
12
+ *
13
+ * The class owns:
14
+ * - the GitHub App credentials (validated + PEM-normalized at construction),
15
+ * - every GitHub API operation the web surface performs (Octokit factories,
16
+ * token minting, installation/repo/issue/PR listings, OAuth exchange),
17
+ * - the webhook secret used to verify GitHub webhook deliveries,
18
+ * - its own HTTP surface: `routes()` returns the `/web/github/*` +
19
+ * `/auth/github/*` Mastra `apiRoutes`.
20
+ *
21
+ * A custom integration (different app per tenant, custom Octokit config) can
22
+ * subclass this and override individual methods — everything downstream only
23
+ * talks to the instance.
24
+ */
25
+ import type { RequestContext } from '@mastra/core/request-context';
26
+ import type { ApiRoute } from '@mastra/core/server';
27
+ import type { MastraWorker } from '@mastra/core/worker';
28
+ import { Octokit } from '@octokit/rest';
29
+ import type { Intake } from '../../capabilities/intake.js';
30
+ import type { VersionControl } from '../../capabilities/version-control.js';
31
+ import type { FactoryIntegration, IntegrationContext, IntegrationTools } from '../base.js';
32
+ import type { ReconcileIssueState, ReconcilePullRequestState } from './rules.js';
33
+ import type { GithubSubscriptionStorage } from './subscriptions.js';
34
+ /**
35
+ * Normalize a PEM private key supplied via env. Env tooling tends to mangle
36
+ * multi-line PEMs, so two single-line forms are supported:
37
+ * - `\n`-escaped: literal `\n` sequences become real newlines
38
+ * - fully flattened: newlines stripped entirely — the PEM is rebuilt by
39
+ * re-wrapping the base64 body (Node's decoder rejects header/body/footer
40
+ * on one line with `error:1E08010C:DECODER routines::unsupported`)
41
+ */
42
+ export declare function normalizePrivateKey(raw: string): string;
43
+ export interface UserInstallation {
44
+ installationId: number;
45
+ accountLogin: string | null;
46
+ accountType: string | null;
47
+ }
48
+ export interface RepoSummary {
49
+ id: number;
50
+ fullName: string;
51
+ name: string;
52
+ owner: string;
53
+ defaultBranch: string;
54
+ private: boolean;
55
+ installationId: number;
56
+ }
57
+ export type GithubRepositoryPermission = 'admin' | 'maintain' | 'write' | 'triage' | 'read' | 'none';
58
+ export interface IssueSummary {
59
+ number: number;
60
+ title: string;
61
+ url: string;
62
+ author: string | null;
63
+ assignees: string[];
64
+ labels: string[];
65
+ comments: number;
66
+ createdAt: string;
67
+ updatedAt: string;
68
+ }
69
+ /** Page size for issue/PR listings; one GitHub API call per page. */
70
+ export declare const LIST_PAGE_SIZE = 30;
71
+ export interface IssuePage {
72
+ issues: IssueSummary[];
73
+ /** Next page number to request, or `null` when this was the last page. */
74
+ nextPage: number | null;
75
+ }
76
+ export interface ListRepoOpenIssuesOptions {
77
+ label?: string;
78
+ }
79
+ export interface GithubIntegrationConfig {
80
+ /** GitHub App id (the numeric id, as a string). */
81
+ appId: string;
82
+ /**
83
+ * App private key (PEM). Multi-line, `\n`-escaped, and fully flattened
84
+ * single-line forms are all accepted (normalized at construction).
85
+ */
86
+ privateKey: string;
87
+ /** OAuth client id of the GitHub App. */
88
+ clientId: string;
89
+ /** OAuth client secret of the GitHub App. */
90
+ clientSecret: string;
91
+ /** App slug — the URL name used to build the install URL. */
92
+ slug: string;
93
+ /**
94
+ * Secret GitHub uses to sign webhook deliveries. Omitted → webhook
95
+ * signature verification rejects all deliveries. Also serves as the default
96
+ * replica-stable OAuth/install `state` secret (see `./config.ts`).
97
+ */
98
+ webhookSecret?: string;
99
+ }
100
+ export declare class GithubIntegration implements FactoryIntegration {
101
+ #private;
102
+ /** Stable integration identifier (see `../factory-integration.ts`). */
103
+ readonly id = "github";
104
+ readonly intake: Intake;
105
+ readonly versionControl: VersionControl;
106
+ /**
107
+ * The OAuth/install flow round-trips a signed `state` through GitHub, so a
108
+ * multi-replica deploy needs a deployment-stable state secret.
109
+ */
110
+ readonly requiresStableStateSigner = true;
111
+ constructor(config: GithubIntegrationConfig);
112
+ /** App slug — the URL name used to build the install URL. */
113
+ get slug(): string;
114
+ get genericStorage(): IntegrationContext['storage']['generic'];
115
+ get sourceControlStorage(): IntegrationContext['storage']['sourceControl'];
116
+ get integrationStorage(): GithubSubscriptionStorage;
117
+ /** Secret GitHub uses to sign webhook deliveries, when configured. */
118
+ get webhookSecret(): string | undefined;
119
+ /**
120
+ * Octokit authenticated as the GitHub App itself (app JWT). Used for
121
+ * app-level operations and to mint installation tokens.
122
+ */
123
+ getAppOctokit(): Octokit;
124
+ /**
125
+ * Octokit authenticated as a specific installation (installation access
126
+ * token). Used to list repos and to operate on a repo on the user's behalf.
127
+ */
128
+ getInstallationOctokit(installationId: number): Octokit;
129
+ /** Octokit authenticated as a user via their OAuth token (the identify step). */
130
+ getUserOctokit(userToken: string): Octokit;
131
+ /**
132
+ * Mint a short-lived installation access token. Returned token is used only
133
+ * server-side / inside the sandbox clone URL and never sent to the browser.
134
+ */
135
+ mintInstallationToken(installationId: number): Promise<string>;
136
+ /**
137
+ * List the installations the authenticated user can access, via their OAuth
138
+ * token (`GET /user/installations`).
139
+ */
140
+ listUserInstallations(userToken: string): Promise<UserInstallation[]>;
141
+ /** List repos accessible to an installation (paginated). */
142
+ listInstallationRepos(installationId: number): Promise<RepoSummary[]>;
143
+ /**
144
+ * The authenticated user's permission level on a repo, through the
145
+ * installation. `undefined` when the repo/user is not accessible.
146
+ */
147
+ getRepositoryCollaboratorPermission(installationId: number, repoFullName: string, username: string, signal?: AbortSignal): Promise<GithubRepositoryPermission | undefined>;
148
+ /**
149
+ * Fetch a single repo's metadata through an installation token and confirm
150
+ * the installation actually has access to it. Returns `null` when the repo
151
+ * is not accessible to the installation (so a client can't create a project
152
+ * for an arbitrary repo under an installation id it merely owns).
153
+ */
154
+ getInstallationRepo(installationId: number, repoFullName: string): Promise<RepoSummary | null>;
155
+ /** Add labels to an issue (deduplicated; no-op on empty/malformed input). */
156
+ addIssueLabels(installationId: number, repoFullName: string, issueNumber: number, labels: string[]): Promise<void>;
157
+ /**
158
+ * List one page of a repo's open issues through an installation token. The
159
+ * issues API also returns pull requests, so those are filtered out (the
160
+ * filter can make a non-final page shorter than the page size — `nextPage`
161
+ * is derived from the raw response length, not the filtered one).
162
+ */
163
+ listRepoOpenIssues(installationId: number, repoFullName: string, page: number, options?: ListRepoOpenIssuesOptions): Promise<IssuePage>;
164
+ /**
165
+ * Build the GitHub App install URL. `state` is carried through the install
166
+ * flow and validated on callback.
167
+ */
168
+ buildInstallUrl(state: string): string;
169
+ /**
170
+ * Build the OAuth identify URL (authorize) used to confirm the user's
171
+ * identity and obtain a user token for listing their installations.
172
+ */
173
+ buildOAuthIdentifyUrl(state: string, redirectUri: string): string;
174
+ /** Exchange an OAuth `code` for a user access token. */
175
+ exchangeOAuthCode(code: string, redirectUri: string): Promise<string>;
176
+ /**
177
+ * The integration's HTTP surface: the `/web/github/*` + `/auth/github/*`
178
+ * Mastra `apiRoutes` (webhook handler, install/OAuth flow, project +
179
+ * worktree + session operations). The factory folds these into the server's
180
+ * `apiRoutes` when the feature is ready. Handlers operate on this instance.
181
+ */
182
+ routes(ctx: IntegrationContext): ApiRoute[];
183
+ /**
184
+ * Merge-state safety net. Webhooks are the only other writer of merge state,
185
+ * and a self-hosted deployment GitHub cannot reach (private network, local
186
+ * dev) never receives one — without this sweep its PR cards stay open
187
+ * forever. Disable with `MASTRACODE_GITHUB_RECONCILE_ENABLED=false`.
188
+ */
189
+ workers(ctx: IntegrationContext): MastraWorker[];
190
+ /**
191
+ * Reads live PR state for the merge reconciler. Returns undefined when the PR
192
+ * cannot be resolved so a sweep never fabricates a merge.
193
+ */
194
+ fetchPullRequestState(input: {
195
+ installationId: number;
196
+ repository: string;
197
+ number: number;
198
+ }): Promise<ReconcilePullRequestState | undefined>;
199
+ /**
200
+ * Reads live issue state for the reconciler. Returns undefined when the
201
+ * issue cannot be resolved (missing, is actually a PR, API error) so a
202
+ * sweep never fabricates a close.
203
+ */
204
+ fetchIssueState(input: {
205
+ installationId: number;
206
+ repository: string;
207
+ number: number;
208
+ }): Promise<ReconcileIssueState | undefined>;
209
+ /**
210
+ * Session-scoped agent tools for token refresh and PR subscriptions in
211
+ * sessions bound to a GitHub-backed project. Empty elsewhere.
212
+ */
213
+ sessionTools({ requestContext }: {
214
+ requestContext: RequestContext;
215
+ }): IntegrationTools;
216
+ postToolObserver({ toolContext, requestContext, }: Parameters<NonNullable<FactoryIntegration['postToolObserver']>>[0]): Promise<void>;
217
+ /** Non-secret config snapshot for system diagnostics/startup logs. */
218
+ diagnostics(): Record<string, unknown>;
219
+ }
220
+ //# sourceMappingURL=integration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/integrations/github/integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD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