@shipfox/api-integration-core 2.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 (275) hide show
  1. package/.turbo/turbo-build.log +2 -0
  2. package/.turbo/turbo-type$colon$emit.log +1 -0
  3. package/.turbo/turbo-type.log +1 -0
  4. package/CHANGELOG.md +264 -0
  5. package/LICENSE +21 -0
  6. package/dist/config.d.ts +9 -0
  7. package/dist/config.d.ts.map +1 -0
  8. package/dist/config.js +29 -0
  9. package/dist/config.js.map +1 -0
  10. package/dist/core/agent-tool-selection.d.ts +15 -0
  11. package/dist/core/agent-tool-selection.d.ts.map +1 -0
  12. package/dist/core/agent-tool-selection.js +48 -0
  13. package/dist/core/agent-tool-selection.js.map +1 -0
  14. package/dist/core/entities/connection.d.ts +2 -0
  15. package/dist/core/entities/connection.d.ts.map +1 -0
  16. package/dist/core/entities/connection.js +3 -0
  17. package/dist/core/entities/connection.js.map +1 -0
  18. package/dist/core/entities/provider.d.ts +6 -0
  19. package/dist/core/entities/provider.d.ts.map +1 -0
  20. package/dist/core/entities/provider.js +3 -0
  21. package/dist/core/entities/provider.js.map +1 -0
  22. package/dist/core/errors.d.ts +29 -0
  23. package/dist/core/errors.d.ts.map +1 -0
  24. package/dist/core/errors.js +40 -0
  25. package/dist/core/errors.js.map +1 -0
  26. package/dist/core/providers/agent-tools.d.ts +2 -0
  27. package/dist/core/providers/agent-tools.d.ts.map +1 -0
  28. package/dist/core/providers/agent-tools.js +3 -0
  29. package/dist/core/providers/agent-tools.js.map +1 -0
  30. package/dist/core/providers/redact-checkout-spec.d.ts +9 -0
  31. package/dist/core/providers/redact-checkout-spec.d.ts.map +1 -0
  32. package/dist/core/providers/redact-checkout-spec.js +25 -0
  33. package/dist/core/providers/redact-checkout-spec.js.map +1 -0
  34. package/dist/core/providers/registry.d.ts +9 -0
  35. package/dist/core/providers/registry.d.ts.map +1 -0
  36. package/dist/core/providers/registry.js +52 -0
  37. package/dist/core/providers/registry.js.map +1 -0
  38. package/dist/core/providers/source-control.d.ts +2 -0
  39. package/dist/core/providers/source-control.d.ts.map +1 -0
  40. package/dist/core/providers/source-control.js +3 -0
  41. package/dist/core/providers/source-control.js.map +1 -0
  42. package/dist/core/source-control-service.d.ts +46 -0
  43. package/dist/core/source-control-service.d.ts.map +1 -0
  44. package/dist/core/source-control-service.js +84 -0
  45. package/dist/core/source-control-service.js.map +1 -0
  46. package/dist/db/connections.d.ts +67 -0
  47. package/dist/db/connections.d.ts.map +1 -0
  48. package/dist/db/connections.js +130 -0
  49. package/dist/db/connections.js.map +1 -0
  50. package/dist/db/db.d.ts +865 -0
  51. package/dist/db/db.d.ts.map +1 -0
  52. package/dist/db/db.js +22 -0
  53. package/dist/db/db.js.map +1 -0
  54. package/dist/db/migrations.d.ts +2 -0
  55. package/dist/db/migrations.d.ts.map +1 -0
  56. package/dist/db/migrations.js +5 -0
  57. package/dist/db/migrations.js.map +1 -0
  58. package/dist/db/schema/common.d.ts +2 -0
  59. package/dist/db/schema/common.d.ts.map +1 -0
  60. package/dist/db/schema/common.js +4 -0
  61. package/dist/db/schema/common.js.map +1 -0
  62. package/dist/db/schema/connections.d.ts +165 -0
  63. package/dist/db/schema/connections.d.ts.map +1 -0
  64. package/dist/db/schema/connections.js +37 -0
  65. package/dist/db/schema/connections.js.map +1 -0
  66. package/dist/db/schema/outbox.d.ts +195 -0
  67. package/dist/db/schema/outbox.d.ts.map +1 -0
  68. package/dist/db/schema/outbox.js +5 -0
  69. package/dist/db/schema/outbox.js.map +1 -0
  70. package/dist/db/schema/webhook-deliveries.d.ts +76 -0
  71. package/dist/db/schema/webhook-deliveries.d.ts.map +1 -0
  72. package/dist/db/schema/webhook-deliveries.js +22 -0
  73. package/dist/db/schema/webhook-deliveries.js.map +1 -0
  74. package/dist/db/webhook-deliveries.d.ts +55 -0
  75. package/dist/db/webhook-deliveries.d.ts.map +1 -0
  76. package/dist/db/webhook-deliveries.js +132 -0
  77. package/dist/db/webhook-deliveries.js.map +1 -0
  78. package/dist/index.d.ts +54 -0
  79. package/dist/index.d.ts.map +1 -0
  80. package/dist/index.js +105 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/metrics/index.d.ts +2 -0
  83. package/dist/metrics/index.d.ts.map +1 -0
  84. package/dist/metrics/index.js +3 -0
  85. package/dist/metrics/index.js.map +1 -0
  86. package/dist/metrics/instance.d.ts +8 -0
  87. package/dist/metrics/instance.d.ts.map +1 -0
  88. package/dist/metrics/instance.js +17 -0
  89. package/dist/metrics/instance.js.map +1 -0
  90. package/dist/presentation/dto/integrations.d.ts +36 -0
  91. package/dist/presentation/dto/integrations.d.ts.map +1 -0
  92. package/dist/presentation/dto/integrations.js +26 -0
  93. package/dist/presentation/dto/integrations.js.map +1 -0
  94. package/dist/presentation/routes/agent-tools-gateway/audit.d.ts +24 -0
  95. package/dist/presentation/routes/agent-tools-gateway/audit.d.ts.map +1 -0
  96. package/dist/presentation/routes/agent-tools-gateway/audit.js +52 -0
  97. package/dist/presentation/routes/agent-tools-gateway/audit.js.map +1 -0
  98. package/dist/presentation/routes/agent-tools-gateway/dispatch.d.ts +7 -0
  99. package/dist/presentation/routes/agent-tools-gateway/dispatch.d.ts.map +1 -0
  100. package/dist/presentation/routes/agent-tools-gateway/dispatch.js +108 -0
  101. package/dist/presentation/routes/agent-tools-gateway/dispatch.js.map +1 -0
  102. package/dist/presentation/routes/agent-tools-gateway/index.d.ts +12 -0
  103. package/dist/presentation/routes/agent-tools-gateway/index.d.ts.map +1 -0
  104. package/dist/presentation/routes/agent-tools-gateway/index.js +46 -0
  105. package/dist/presentation/routes/agent-tools-gateway/index.js.map +1 -0
  106. package/dist/presentation/routes/agent-tools-gateway/mcp-server.d.ts +17 -0
  107. package/dist/presentation/routes/agent-tools-gateway/mcp-server.d.ts.map +1 -0
  108. package/dist/presentation/routes/agent-tools-gateway/mcp-server.js +126 -0
  109. package/dist/presentation/routes/agent-tools-gateway/mcp-server.js.map +1 -0
  110. package/dist/presentation/routes/agent-tools-gateway/resolve-authorized-tools.d.ts +37 -0
  111. package/dist/presentation/routes/agent-tools-gateway/resolve-authorized-tools.d.ts.map +1 -0
  112. package/dist/presentation/routes/agent-tools-gateway/resolve-authorized-tools.js +145 -0
  113. package/dist/presentation/routes/agent-tools-gateway/resolve-authorized-tools.js.map +1 -0
  114. package/dist/presentation/routes/errors.d.ts +2 -0
  115. package/dist/presentation/routes/errors.d.ts.map +1 -0
  116. package/dist/presentation/routes/errors.js +53 -0
  117. package/dist/presentation/routes/errors.js.map +1 -0
  118. package/dist/presentation/routes/index.d.ts +14 -0
  119. package/dist/presentation/routes/index.d.ts.map +1 -0
  120. package/dist/presentation/routes/index.js +26 -0
  121. package/dist/presentation/routes/index.js.map +1 -0
  122. package/dist/presentation/routes/list-connections.d.ts +3 -0
  123. package/dist/presentation/routes/list-connections.d.ts.map +1 -0
  124. package/dist/presentation/routes/list-connections.js +58 -0
  125. package/dist/presentation/routes/list-connections.js.map +1 -0
  126. package/dist/presentation/routes/list-providers.d.ts +3 -0
  127. package/dist/presentation/routes/list-providers.d.ts.map +1 -0
  128. package/dist/presentation/routes/list-providers.js +27 -0
  129. package/dist/presentation/routes/list-providers.js.map +1 -0
  130. package/dist/presentation/routes/list-repositories.d.ts +3 -0
  131. package/dist/presentation/routes/list-repositories.d.ts.map +1 -0
  132. package/dist/presentation/routes/list-repositories.js +41 -0
  133. package/dist/presentation/routes/list-repositories.js.map +1 -0
  134. package/dist/presentation/routes/manage-connections.d.ts +4 -0
  135. package/dist/presentation/routes/manage-connections.d.ts.map +1 -0
  136. package/dist/presentation/routes/manage-connections.js +81 -0
  137. package/dist/presentation/routes/manage-connections.js.map +1 -0
  138. package/dist/providers/connection-slug.d.ts +2 -0
  139. package/dist/providers/connection-slug.d.ts.map +1 -0
  140. package/dist/providers/connection-slug.js +19 -0
  141. package/dist/providers/connection-slug.js.map +1 -0
  142. package/dist/providers/cron.d.ts +3 -0
  143. package/dist/providers/cron.d.ts.map +1 -0
  144. package/dist/providers/cron.js +13 -0
  145. package/dist/providers/cron.js.map +1 -0
  146. package/dist/providers/gitea.d.ts +3 -0
  147. package/dist/providers/gitea.d.ts.map +1 -0
  148. package/dist/providers/gitea.js +75 -0
  149. package/dist/providers/gitea.js.map +1 -0
  150. package/dist/providers/github.d.ts +3 -0
  151. package/dist/providers/github.d.ts.map +1 -0
  152. package/dist/providers/github.js +109 -0
  153. package/dist/providers/github.js.map +1 -0
  154. package/dist/providers/linear.d.ts +3 -0
  155. package/dist/providers/linear.d.ts.map +1 -0
  156. package/dist/providers/linear.js +134 -0
  157. package/dist/providers/linear.js.map +1 -0
  158. package/dist/providers/modules.d.ts +3 -0
  159. package/dist/providers/modules.d.ts.map +1 -0
  160. package/dist/providers/modules.js +26 -0
  161. package/dist/providers/modules.js.map +1 -0
  162. package/dist/providers/sentry.d.ts +3 -0
  163. package/dist/providers/sentry.d.ts.map +1 -0
  164. package/dist/providers/sentry.js +83 -0
  165. package/dist/providers/sentry.js.map +1 -0
  166. package/dist/providers/types.d.ts +58 -0
  167. package/dist/providers/types.d.ts.map +1 -0
  168. package/dist/providers/types.js +3 -0
  169. package/dist/providers/types.js.map +1 -0
  170. package/dist/providers/webhook.d.ts +3 -0
  171. package/dist/providers/webhook.d.ts.map +1 -0
  172. package/dist/providers/webhook.js +24 -0
  173. package/dist/providers/webhook.js.map +1 -0
  174. package/dist/temporal/activities/index.d.ts +5 -0
  175. package/dist/temporal/activities/index.d.ts.map +1 -0
  176. package/dist/temporal/activities/index.js +8 -0
  177. package/dist/temporal/activities/index.js.map +1 -0
  178. package/dist/temporal/activities/prune-webhook-deliveries.d.ts +4 -0
  179. package/dist/temporal/activities/prune-webhook-deliveries.d.ts.map +1 -0
  180. package/dist/temporal/activities/prune-webhook-deliveries.js +11 -0
  181. package/dist/temporal/activities/prune-webhook-deliveries.js.map +1 -0
  182. package/dist/temporal/constants.d.ts +3 -0
  183. package/dist/temporal/constants.d.ts.map +1 -0
  184. package/dist/temporal/constants.js +4 -0
  185. package/dist/temporal/constants.js.map +1 -0
  186. package/dist/temporal/workflows/index.d.ts +2 -0
  187. package/dist/temporal/workflows/index.d.ts.map +1 -0
  188. package/dist/temporal/workflows/index.js +3 -0
  189. package/dist/temporal/workflows/index.js.map +1 -0
  190. package/dist/temporal/workflows/prune-webhook-deliveries-cron.d.ts +2 -0
  191. package/dist/temporal/workflows/prune-webhook-deliveries-cron.d.ts.map +1 -0
  192. package/dist/temporal/workflows/prune-webhook-deliveries-cron.js +14 -0
  193. package/dist/temporal/workflows/prune-webhook-deliveries-cron.js.map +1 -0
  194. package/dist/tsconfig.test.tsbuildinfo +1 -0
  195. package/drizzle/0000_initial.sql +41 -0
  196. package/drizzle/meta/0001_snapshot.json +341 -0
  197. package/drizzle/meta/_journal.json +13 -0
  198. package/drizzle.config.ts +7 -0
  199. package/package.json +85 -0
  200. package/src/config.test.ts +32 -0
  201. package/src/config.ts +28 -0
  202. package/src/core/agent-tool-selection.test.ts +137 -0
  203. package/src/core/agent-tool-selection.ts +80 -0
  204. package/src/core/entities/connection.ts +4 -0
  205. package/src/core/entities/provider.ts +21 -0
  206. package/src/core/errors.ts +55 -0
  207. package/src/core/providers/agent-tools.ts +10 -0
  208. package/src/core/providers/redact-checkout-spec.test.ts +78 -0
  209. package/src/core/providers/redact-checkout-spec.ts +20 -0
  210. package/src/core/providers/registry.test.ts +138 -0
  211. package/src/core/providers/registry.ts +90 -0
  212. package/src/core/providers/source-control.ts +17 -0
  213. package/src/core/source-control-service.test.ts +230 -0
  214. package/src/core/source-control-service.ts +161 -0
  215. package/src/db/connections.test.ts +296 -0
  216. package/src/db/connections.ts +262 -0
  217. package/src/db/db.ts +22 -0
  218. package/src/db/migrations.ts +4 -0
  219. package/src/db/schema/common.ts +3 -0
  220. package/src/db/schema/connections.ts +49 -0
  221. package/src/db/schema/outbox.ts +4 -0
  222. package/src/db/schema/webhook-deliveries.ts +19 -0
  223. package/src/db/webhook-deliveries.test.ts +267 -0
  224. package/src/db/webhook-deliveries.ts +207 -0
  225. package/src/index.ts +212 -0
  226. package/src/metrics/index.ts +1 -0
  227. package/src/metrics/instance.ts +35 -0
  228. package/src/presentation/dto/integrations.ts +39 -0
  229. package/src/presentation/routes/agent-tools-gateway/agent-tools-gateway.route.test.ts +371 -0
  230. package/src/presentation/routes/agent-tools-gateway/audit.test.ts +86 -0
  231. package/src/presentation/routes/agent-tools-gateway/audit.ts +90 -0
  232. package/src/presentation/routes/agent-tools-gateway/dispatch.ts +139 -0
  233. package/src/presentation/routes/agent-tools-gateway/index.ts +62 -0
  234. package/src/presentation/routes/agent-tools-gateway/mcp-server.test.ts +308 -0
  235. package/src/presentation/routes/agent-tools-gateway/mcp-server.ts +155 -0
  236. package/src/presentation/routes/agent-tools-gateway/resolve-authorized-tools.test.ts +181 -0
  237. package/src/presentation/routes/agent-tools-gateway/resolve-authorized-tools.ts +245 -0
  238. package/src/presentation/routes/errors.ts +63 -0
  239. package/src/presentation/routes/index.ts +53 -0
  240. package/src/presentation/routes/list-connections.test.ts +227 -0
  241. package/src/presentation/routes/list-connections.ts +56 -0
  242. package/src/presentation/routes/list-providers.test.ts +113 -0
  243. package/src/presentation/routes/list-providers.ts +28 -0
  244. package/src/presentation/routes/list-repositories.test.ts +150 -0
  245. package/src/presentation/routes/list-repositories.ts +47 -0
  246. package/src/presentation/routes/manage-connections.test.ts +125 -0
  247. package/src/presentation/routes/manage-connections.ts +77 -0
  248. package/src/providers/connection-slug.ts +19 -0
  249. package/src/providers/cron.ts +13 -0
  250. package/src/providers/gitea.ts +103 -0
  251. package/src/providers/github.ts +150 -0
  252. package/src/providers/linear.ts +179 -0
  253. package/src/providers/modules.test.ts +40 -0
  254. package/src/providers/modules.ts +32 -0
  255. package/src/providers/sentry.ts +113 -0
  256. package/src/providers/types.ts +52 -0
  257. package/src/providers/webhook.ts +30 -0
  258. package/src/temporal/activities/index.ts +7 -0
  259. package/src/temporal/activities/prune-webhook-deliveries.test.ts +39 -0
  260. package/src/temporal/activities/prune-webhook-deliveries.ts +9 -0
  261. package/src/temporal/constants.ts +3 -0
  262. package/src/temporal/workflows/index.ts +1 -0
  263. package/src/temporal/workflows/prune-webhook-deliveries-cron.ts +15 -0
  264. package/test/agent-tools-gateway-helpers.ts +210 -0
  265. package/test/env.ts +23 -0
  266. package/test/factories/connection.ts +21 -0
  267. package/test/globalSetup.ts +22 -0
  268. package/test/index.ts +1 -0
  269. package/test/route-utils.ts +104 -0
  270. package/test/setup.ts +19 -0
  271. package/tsconfig.build.json +9 -0
  272. package/tsconfig.build.tsbuildinfo +1 -0
  273. package/tsconfig.json +3 -0
  274. package/tsconfig.test.json +8 -0
  275. package/vitest.config.ts +13 -0
@@ -0,0 +1,2 @@
1
+ $ shipfox-swc
2
+ Successfully compiled: 47 files with swc (105.03ms)
@@ -0,0 +1 @@
1
+ $ shipfox-tsc-emit
@@ -0,0 +1 @@
1
+ $ shipfox-tsc-check
package/CHANGELOG.md ADDED
@@ -0,0 +1,264 @@
1
+ # @shipfox/api-integration-core
2
+
3
+ ## 2.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0cd6dd4: Adds stoppable module workers and declarative module startup tasks for server composition.
8
+ - 1b0d344: Publishes the complete API runtime closure with packed-consumer-safe internal imports and records its exact package set in application releases.
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [0cd6dd4]
13
+ - Updated dependencies [a68458a]
14
+ - Updated dependencies [6eba800]
15
+ - Updated dependencies [1b0d344]
16
+ - Updated dependencies [521e006]
17
+ - @shipfox/node-module@0.2.0
18
+ - @shipfox/node-temporal@0.2.0
19
+ - @shipfox/api-agent-dto@2.0.0
20
+ - @shipfox/api-auth-context@2.0.0
21
+ - @shipfox/api-integration-core-dto@2.0.0
22
+ - @shipfox/api-integration-gitea@2.0.0
23
+ - @shipfox/api-integration-github@2.0.0
24
+ - @shipfox/api-integration-linear@2.0.0
25
+ - @shipfox/api-integration-sentry@2.0.0
26
+ - @shipfox/api-integration-webhook@2.0.0
27
+ - @shipfox/config@1.2.1
28
+ - @shipfox/node-drizzle@0.2.1
29
+ - @shipfox/node-fastify@0.2.1
30
+ - @shipfox/node-opentelemetry@0.5.0
31
+ - @shipfox/node-outbox@0.2.1
32
+ - @shipfox/node-postgres@0.4.1
33
+ - @shipfox/redact@0.2.1
34
+ - @shipfox/regex@0.2.1
35
+
36
+ ## 0.1.2
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [705dd43]
41
+ - @shipfox/node-outbox@0.2.0
42
+ - @shipfox/node-module@0.1.2
43
+ - @shipfox/api-integration-linear@1.0.2
44
+ - @shipfox/api-integration-github@0.1.2
45
+ - @shipfox/api-integration-sentry@0.1.2
46
+
47
+ ## 0.1.1
48
+
49
+ ### Patch Changes
50
+
51
+ - Updated dependencies [ec75cd5]
52
+ - Updated dependencies [68b8d03]
53
+ - Updated dependencies [6a1fb54]
54
+ - @shipfox/node-drizzle@0.2.0
55
+ - @shipfox/redact@0.2.0
56
+ - @shipfox/node-postgres@0.4.0
57
+ - @shipfox/api-integration-gitea@0.0.2
58
+ - @shipfox/api-integration-github@0.1.1
59
+ - @shipfox/api-integration-linear@1.0.1
60
+ - @shipfox/api-integration-sentry@0.1.1
61
+ - @shipfox/node-module@0.1.1
62
+ - @shipfox/node-outbox@0.1.1
63
+
64
+ ## 0.1.0
65
+
66
+ ### Minor Changes
67
+
68
+ - 115655e: Moves source-event translation to the integration module: source-control providers emit a typed, provider-agnostic `INTEGRATION_SOURCE_COMMIT_PUSHED` event via one transactional publisher, projects subscribes to it instead of decoding GitHub payloads, and branch-deletion pushes are dropped at the source.
69
+ - d245be8: [api/integrations] Make the signed Sentry installation webhook authoritative.
70
+ - `@shipfox/api-integration-sentry-dto`: reshape `sentryInstallationWebhookSchema`
71
+ to read `data.installation.{uuid, organization.slug, status, code}` plus an
72
+ optional top-level `actor`. Only consumed fields are validated and the raw
73
+ `code` is never logged.
74
+ - `@shipfox/api-integration-sentry`: the signed `installation.created` webhook now
75
+ exchanges the single-use code and persists a verified-but-unclaimed installation
76
+ (`connection_id IS NULL`, `code_hash = sha256(code)`). The browser flow narrows
77
+ to a claim that binds a verified install to a workspace under unified claim auth
78
+ (exchange-success, same-code hash match, or a retryable
79
+ `verification-in-progress` while a concurrent webhook is mid-exchange), with a
80
+ proof-mismatch 403 closing the bare-uuid IDOR. The exchange/verify run outside
81
+ the DB transaction; a short transaction wraps persist + delivery record. Adds
82
+ `connection_id` nullable + `code_hash` to the installations table and a daily TTL
83
+ cron that tombstones never-claimed installs.
84
+ - `@shipfox/api-integration-core`: inject the Sentry client into the webhook
85
+ context, resolve a null `connection_id` to "no connection" for pre-claim issue
86
+ deliveries, and register the unclaimed-installation cleanup cron when Sentry is
87
+ enabled.
88
+ - `@shipfox/client-integrations`: treat the retryable `verification-in-progress`
89
+ response as a backoff-eligible failure on the connect callback.
90
+
91
+ - b8e49ff: Add the client-side Sentry install/connect flow and a workspace settings
92
+ integrations hub.
93
+ - `@shipfox/client-integrations`: shared `IntegrationGallerySection` (capability
94
+ filter, lifecycle pills, "Added" date, external link, connected-first
95
+ ordering, degraded status mode), shared `RedirectInstallPage` powering the
96
+ GitHub and new Sentry install pages, `SentryCallbackPage` with an explicit
97
+ workspace confirm (sessionStorage only pre-selects), two-tier retry, and the
98
+ Sentry hooks (`useCreateSentryInstallMutation`, `connectSentry`,
99
+ `useIntegrationConnectionsQuery`).
100
+ - `@shipfox/client-workspace-settings`: new `/workspaces/$wid/settings/integrations`
101
+ page and an Integrations entry in the settings nav.
102
+ - `@shipfox/client-router`: routes for the Sentry install page, the root-level
103
+ Sentry callback, and the settings integrations page.
104
+ - `@shipfox/react-ui`: `sentry` icon (monochrome, theme-aware).
105
+ - `@shipfox/api-integration-core-dto`: optional `external_url` on the connection
106
+ DTO and an optional `connectionExternalUrl` method on `IntegrationProvider`.
107
+ - `@shipfox/api-integration-core`: `GET /integration-connections` now returns
108
+ connections of every lifecycle status (the active-only filter prevented
109
+ clients from surfacing disabled/error state) and resolves `external_url`
110
+ per connection best-effort.
111
+ - `@shipfox/api-integration-sentry` / `@shipfox/api-integration-github`:
112
+ implement `connectionExternalUrl` (Sentry org URL via a new
113
+ by-connection-id installation lookup; GitHub installation settings URL).
114
+
115
+ - d6d4862: Add a Sentry integration provider that ingests issue webhooks.
116
+ - New `@shipfox/api-integration-sentry` + `-sentry-dto` packages: a webhook
117
+ receiver that verifies the HMAC-SHA256 signature (keyed with the app client
118
+ secret), dedups on `Request-ID`, normalizes the issue payload, and publishes
119
+ `integrations.event.received` with `source: 'sentry'` and `event:
120
+ issue.<action>`. A raw `ignored` action is normalized to `archived`. Malformed,
121
+ bad-JSON, unknown-action, and unknown-resource deliveries are recorded-and-dropped
122
+ with a 204 (deliberate deviation from GitHub's 400 to avoid Sentry disabling the
123
+ webhook).
124
+ - `@shipfox/api-integration-core-dto`: add the `SentryIssuePayload` contract.
125
+ - `@shipfox/api-integration-core`: register the Sentry provider behind
126
+ `INTEGRATIONS_ENABLE_SENTRY_PROVIDER`, add the
127
+ `updateIntegrationConnectionLifecycleStatus` helper, and pin stable
128
+ migration-tracking table names per provider database.
129
+ - `@shipfox/node-fastify`: add the shared `rawBodyPlugin` and `WEBHOOK_BODY_LIMIT`
130
+ exports for webhook receivers.
131
+ - `@shipfox/node-module`: add an optional `migrationsTableName` to `ModuleDatabase`
132
+ so conditionally-composed databases get a position-independent migration table.
133
+ - `@shipfox/api-integration-github`: consume the shared `rawBodyPlugin` instead of
134
+ a local copy (internal refactor, no behavior change).
135
+
136
+ Deploy note: environments with GitHub enabled must rename the existing
137
+ `__drizzle_migrations_integrations_1` table to
138
+ `__drizzle_migrations_integrations_github` as part of this release, or GitHub
139
+ migrations re-run against existing tables.
140
+
141
+ ### Patch Changes
142
+
143
+ - 0948b67: Scaffolds the Linear integration provider, package pair, config, and installation store behind the core provider flag.
144
+ - a68ed61: Restructures the integrations composition root so each provider owns its loader, adapter wiring, and migrations-table name in one file under `src/providers/`, registered through a single list; no behavior change.
145
+ - ce062a9: Validates authored agent step integrations against provider tool catalogs and workspace connection capabilities.
146
+ - f3614ae: Add `createCheckoutSpec()` to the integration source-control service and the GitHub provider. GitHub mints a short-lived, repo-scoped installation access token and returns it as structured `CheckoutCredentials` alongside a clean `repositoryUrl`; the secret is never embedded in the URL. `ref` defaults to the repository default branch, providers without checkout support raise a typed `IntegrationCheckoutUnsupportedError`, and a `redactCheckoutSpec()` helper masks the token for logging. Dormant until the checkout-token endpoint and runner enrichment are wired in; no runtime behavior changes yet.
147
+ - f98c2be: [api/workflows] Add the lease-authed `POST /runs/jobs/current/checkout-token` endpoint. The runner exchanges its job lease for short-lived, read-only repository checkout credentials. The job's checkout intent is resolved server-side from the authoritative `jobId` claim (`job -> run -> project` source metadata) and minted on demand via the integration service's `createCheckoutSpec()`; no credential material is ever stored on the job/run or queued. `checkoutTokenResponseSchema.auth` stays optional so credential-free providers can return a public clone URL with no token, and `integrationRouteErrorHandler` is exported from `@shipfox/api-integration-core` so the route reuses the shared provider-error mapping.
148
+ - ae7a63c: Adds daily dispatched outbox row retention with bounded cleanup batches and retention indexes on module outbox tables.
149
+ - f8f339a: Add the `@shipfox/redact` package with shared credential-redaction helpers: `redactUrlCredentials` (scheme-agnostic free-text scrubber), `stripUrlCredentials` (structured single-URL stripper), `redactSecrets` (literal-secret scrubber), and the `REDACTION_PLACEHOLDER` constant. Move `redactCheckoutSpec` from `@shipfox/api-integration-core-dto` into `@shipfox/api-integration-core` so it can reuse the shared `stripUrlCredentials` without breaking the dto-only-dependency rule; its public export path (`@shipfox/api-integration-core`) is unchanged. No behavior change.
150
+ - 58f51bd: Scaffold an empty `gitea` integration provider that mirrors the `github` package structure, ahead of any behavior.
151
+ - New `@shipfox/api-integration-gitea` + `@shipfox/api-integration-gitea-dto` packages: `createGiteaIntegrationProvider()` returns an empty provider (`{provider: 'gitea', displayName: 'Gitea', adapters: {}, routes: []}`), plus a `src/config.ts` documenting the self-hoster variables (`GITEA_BASE_URL`, `GITEA_SERVICE_USERNAME`, `GITEA_SERVICE_TOKEN`, `GITEA_WEBHOOK_SECRET`, `GITEA_WEBHOOK_TARGET_URL`, `GITEA_CHECKOUT_TTL_SECONDS`) and an empty provider database wired with the stable migrations table `__drizzle_migrations_integrations_gitea`.
152
+ - `@shipfox/api-integration-core`: register the Gitea provider behind `INTEGRATIONS_ENABLE_GITEA_PROVIDER` (default false). With the flag enabled, `gitea` appears in `GET /integration-providers`. Dormant scaffold; no runtime behavior yet.
153
+
154
+ - 570ac69: Add the Gitea connection flow so a workspace member can link a Gitea org with a single authenticated request (no OAuth, no redirect).
155
+ - `@shipfox/api-integration-gitea-dto`: `createGiteaConnectionBodySchema` (`{workspace_id, org}`); the response reuses the shared `integrationConnectionDtoSchema`.
156
+ - `@shipfox/api-integration-gitea`: `POST /integrations/gitea/connections` (`AUTH_USER`, workspace membership) canonicalizes the org to lower case (Gitea routes org names case-insensitively, so this keeps the case-sensitive ownership lookup and unique indexes from being bypassed by a case variant), validates the org via the API, rejects an org already linked to another workspace (409), registers an org-level push webhook (`POST /orgs/{org}/hooks` with `GITEA_WEBHOOK_SECRET`/`GITEA_WEBHOOK_TARGET_URL`), and in one transaction upserts the core connection (`provider: 'gitea'`, `externalAccountId: org`) and a new `integrations_gitea_connections` row (`connection_id`/`org` unique, stored `webhook_id`). Re-connecting an already-active org is idempotent and skips a second webhook. Webhook registration itself is idempotent (an existing org hook for the target URL is reused) and compensated (a hook created before a transaction that then rolls back is deleted), so concurrent or retried connects do not leave orphaned hooks. The `GiteaApiClient` gains `organizationExists`, `createOrgPushWebhook`, and `deleteOrgWebhook`, and the provider exposes `connectionExternalUrl` pointing at the org on the Gitea instance.
157
+ - `@shipfox/api-integration-core`: wire the Gitea connect closure (`connectGiteaConnection`) and the cross-tenant lookup (`getExistingGiteaConnection`) into the provider, mirroring `connectGithubInstallation`.
158
+
159
+ Connecting an org creates an active connection visible in `GET /integration-connections` and registers a Gitea webhook whose id is stored.
160
+
161
+ - 857fd73: Receive Gitea push webhooks and trigger runs through the existing source-push pipeline.
162
+ - `@shipfox/api-integration-gitea-dto`: `giteaPushPayloadSchema` (`{ref, after, repository: {name, full_name, default_branch, owner: {username}}}`).
163
+ - `@shipfox/api-integration-gitea`: `POST /webhooks/integrations/gitea` (`auth: []`, `rawBodyPlugin`, standard webhook body limit). It verifies the `X-Gitea-Signature` header as hex HMAC-SHA256 of the raw body keyed by `GITEA_WEBHOOK_SECRET` (401 on mismatch), records non-`push` events for delivery dedup and returns 204, and on a `push` resolves the org (`repository.owner.username`, lower-cased to match the stored org) to its connection, drops branch deletions and unknown orgs, and publishes a normalized `SourcePushPayload` (`externalRepositoryId: gitea:<owner>/<repo>` built from `owner.username`/`repository.name` to match the source-control adapter, `refs/heads/` stripped, `headCommitSha: after`, `isDefaultBranch`). `getGiteaConnectionByOrg` gains an optional transaction executor so the lookup runs inside the publishing transaction. The webhook is registered out of band by the Gitea instance admin, so the connect flow registers nothing.
164
+ - `@shipfox/api-integration-core`: wire `publishSourcePush`, `recordDeliveryOnly`, `getIntegrationConnectionById`, and the core database into the Gitea provider, mirroring GitHub.
165
+ - `@shipfox/node-fastify`: add a shared `verifyHexHmacSignature` helper for hex HMAC-SHA256 webhook signatures.
166
+ - `@shipfox/api-integration-sentry`: `verifySentrySignature` now delegates to the shared helper.
167
+
168
+ A push to a connected org's repo creates a workflow run through the existing pipeline. Duplicate POSTs of the same delivery are deduped via `X-Gitea-Delivery`; note that a manual "Redeliver" in Gitea mints a new delivery id and intentionally produces a fresh run (unlike GitHub, whose redelivery reuses the original id and is suppressed).
169
+
170
+ - 444ac89: Enables the generic webhook integration provider by default because it does not require provider setup.
171
+ - 5b8ed32: Add the Sentry install/connect flow so a workspace member can link a Sentry
172
+ installation to a Shipfox workspace, writing the connection + installation rows
173
+ that the webhook receiver looks up.
174
+ - `@shipfox/api-integration-sentry`: add a stateless `SentryApiClient`
175
+ (authorization-code exchange, org-slug derivation, optional verify-install),
176
+ `handleSentryConnect`, and two authenticated routes —
177
+ `POST /integrations/sentry/install` (returns the external-install URL) and
178
+ `POST /integrations/sentry/connect` (links the installation). Sentry has no
179
+ `state` param, so the workspace is taken from the request body and authorized
180
+ against the live session; the org slug is derived from Sentry, never trusted
181
+ from the body. The verify-install side effect runs after the row is persisted,
182
+ and no Sentry token is stored. Provider HTTP errors map to a typed
183
+ `SentryIntegrationProviderError` and never carry the token, code, or client
184
+ secret.
185
+ - `@shipfox/api-integration-sentry-dto`: add the install/connect request and
186
+ response schemas.
187
+ - `@shipfox/api-integration-core`: wire the `getExistingSentryConnection` and
188
+ `connectSentryInstallation` closures into the Sentry provider (internal
189
+ wiring, no public API change).
190
+
191
+ A concurrent same-install connect race (shared with GitHub) is tracked
192
+ separately in ENG-409.
193
+
194
+ - 417f128: Move the Sentry unclaimed-installation cleanup cron out of `@shipfox/api-integration-core` into `@shipfox/api-integration-sentry`, which now owns its own Temporal maintenance worker. `core` aggregates per-integration workers from enabled providers instead of special-casing Sentry, keeping the integration dependency graph a tree (providers depend only on `*-core-dto`, never on `core`). The unclaimed-installation retention window is now configurable via `SENTRY_UNCLAIMED_INSTALLATION_RETENTION_DAYS` (default 7, minimum 1; startup fails on a smaller value so a misconfiguration cannot tombstone freshly created installs).
195
+ - 82d22e4: Make the workspace-membership gate stateless. `requireWorkspaceAccess` now lives in `@shipfox/api-auth-context` and authorizes a request purely from the verified session-token claims, replacing the `requireMembership` gate in `@shipfox/api-workspaces` that read the workspace row from the database on every workspace-scoped request. Membership and role already travel in the token, so the check needs no database access.
196
+
197
+ This removes the per-request database read and severs the runtime dependency on `@shipfox/api-workspaces` from feature modules that only needed the membership gate (integration providers, secrets, projects, agent, runners). Workspace existence and `active`-status enforcement, which no code path currently exercises, moves off the hot path; enforce it at token issuance when workspace suspension is introduced.
198
+
199
+ - 8b9c3e0: Runs the API runners and integration core test suites without per-file Vitest module isolation, removing runner auth-helper mocks and cleaning up module-reset handling for shared test modules.
200
+ - Updated dependencies [067a260]
201
+ - Updated dependencies [43d7996]
202
+ - Updated dependencies [0948b67]
203
+ - Updated dependencies [34ba284]
204
+ - Updated dependencies [5707d6d]
205
+ - Updated dependencies [b9c3f32]
206
+ - Updated dependencies [a81b68c]
207
+ - Updated dependencies [115655e]
208
+ - Updated dependencies [c0a883c]
209
+ - Updated dependencies [72ce351]
210
+ - Updated dependencies [e47f8da]
211
+ - Updated dependencies [de54da2]
212
+ - Updated dependencies [ce062a9]
213
+ - Updated dependencies [8958753]
214
+ - Updated dependencies [7b175f5]
215
+ - Updated dependencies [7ca4c65]
216
+ - Updated dependencies [5bcdbf4]
217
+ - Updated dependencies [f3614ae]
218
+ - Updated dependencies [9f1c0ef]
219
+ - Updated dependencies [ae7a63c]
220
+ - Updated dependencies [5729548]
221
+ - Updated dependencies [d245be8]
222
+ - Updated dependencies [f92122b]
223
+ - Updated dependencies [360d06d]
224
+ - Updated dependencies [f8f339a]
225
+ - Updated dependencies [58f51bd]
226
+ - Updated dependencies [75f2cc8]
227
+ - Updated dependencies [570ac69]
228
+ - Updated dependencies [857fd73]
229
+ - Updated dependencies [0667cce]
230
+ - Updated dependencies [aca162b]
231
+ - Updated dependencies [75520ff]
232
+ - Updated dependencies [b8e49ff]
233
+ - Updated dependencies [5b8ed32]
234
+ - Updated dependencies [417f128]
235
+ - Updated dependencies [d6d4862]
236
+ - Updated dependencies [c0a883c]
237
+ - Updated dependencies [6077301]
238
+ - Updated dependencies [3bea87f]
239
+ - Updated dependencies [82d22e4]
240
+ - Updated dependencies [6297b06]
241
+ - Updated dependencies [01be723]
242
+ - Updated dependencies [27770eb]
243
+ - Updated dependencies [2933c33]
244
+ - Updated dependencies [6181819]
245
+ - Updated dependencies [282e66a]
246
+ - Updated dependencies [9c149d1]
247
+ - @shipfox/api-agent-dto@0.1.0
248
+ - @shipfox/api-integration-linear@1.0.0
249
+ - @shipfox/node-fastify@0.2.0
250
+ - @shipfox/node-drizzle@0.1.0
251
+ - @shipfox/api-auth-context@0.1.0
252
+ - @shipfox/api-integration-core-dto@0.1.0
253
+ - @shipfox/api-integration-github@0.1.0
254
+ - @shipfox/node-opentelemetry@0.4.2
255
+ - @shipfox/node-postgres@0.3.2
256
+ - @shipfox/node-temporal@0.1.1
257
+ - @shipfox/regex@0.2.0
258
+ - @shipfox/api-integration-sentry@0.1.0
259
+ - @shipfox/node-module@0.1.0
260
+ - @shipfox/node-outbox@0.1.0
261
+ - @shipfox/redact@0.1.0
262
+ - @shipfox/api-integration-gitea@0.0.1
263
+ - @shipfox/api-integration-webhook@0.0.1
264
+ - @shipfox/config@1.2.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shipfox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,9 @@
1
+ export declare const config: Readonly<{
2
+ INTEGRATIONS_ENABLE_CRON_PROVIDER: boolean;
3
+ INTEGRATIONS_ENABLE_GITEA_PROVIDER: boolean;
4
+ INTEGRATIONS_ENABLE_GITHUB_PROVIDER: boolean;
5
+ INTEGRATIONS_ENABLE_LINEAR_PROVIDER: boolean;
6
+ INTEGRATIONS_ENABLE_SENTRY_PROVIDER: boolean;
7
+ INTEGRATIONS_ENABLE_WEBHOOK_PROVIDER: boolean;
8
+ } & import("@shipfox/config").CleanedEnvAccessors>;
9
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;;kDAyBjB,CAAC"}
package/dist/config.js ADDED
@@ -0,0 +1,29 @@
1
+ import { bool, createConfig } from '@shipfox/config';
2
+ export const config = createConfig({
3
+ INTEGRATIONS_ENABLE_CRON_PROVIDER: bool({
4
+ desc: 'Enables the cron integration provider so workflow schedules can use the built-in cron source. It is enabled by default because it does not require provider setup.',
5
+ default: true
6
+ }),
7
+ INTEGRATIONS_ENABLE_GITEA_PROVIDER: bool({
8
+ desc: 'Enables the Gitea integration provider so users can connect a Gitea instance.',
9
+ default: false
10
+ }),
11
+ INTEGRATIONS_ENABLE_GITHUB_PROVIDER: bool({
12
+ desc: 'Enables the GitHub integration provider so users can connect GitHub.',
13
+ default: false
14
+ }),
15
+ INTEGRATIONS_ENABLE_LINEAR_PROVIDER: bool({
16
+ desc: 'Enables the Linear integration provider so users can connect Linear workspaces.',
17
+ default: false
18
+ }),
19
+ INTEGRATIONS_ENABLE_SENTRY_PROVIDER: bool({
20
+ desc: 'Enables the Sentry integration provider so users can connect Sentry.',
21
+ default: false
22
+ }),
23
+ INTEGRATIONS_ENABLE_WEBHOOK_PROVIDER: bool({
24
+ desc: 'Enables the generic webhook integration provider so users can create inbound webhook URLs. It is enabled by default because it does not require provider setup.',
25
+ default: true
26
+ })
27
+ });
28
+
29
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config.ts"],"sourcesContent":["import {bool, createConfig} from '@shipfox/config';\n\nexport const config = createConfig({\n INTEGRATIONS_ENABLE_CRON_PROVIDER: bool({\n desc: 'Enables the cron integration provider so workflow schedules can use the built-in cron source. It is enabled by default because it does not require provider setup.',\n default: true,\n }),\n INTEGRATIONS_ENABLE_GITEA_PROVIDER: bool({\n desc: 'Enables the Gitea integration provider so users can connect a Gitea instance.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_GITHUB_PROVIDER: bool({\n desc: 'Enables the GitHub integration provider so users can connect GitHub.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_LINEAR_PROVIDER: bool({\n desc: 'Enables the Linear integration provider so users can connect Linear workspaces.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_SENTRY_PROVIDER: bool({\n desc: 'Enables the Sentry integration provider so users can connect Sentry.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_WEBHOOK_PROVIDER: bool({\n desc: 'Enables the generic webhook integration provider so users can create inbound webhook URLs. It is enabled by default because it does not require provider setup.',\n default: true,\n }),\n});\n"],"names":["bool","createConfig","config","INTEGRATIONS_ENABLE_CRON_PROVIDER","desc","default","INTEGRATIONS_ENABLE_GITEA_PROVIDER","INTEGRATIONS_ENABLE_GITHUB_PROVIDER","INTEGRATIONS_ENABLE_LINEAR_PROVIDER","INTEGRATIONS_ENABLE_SENTRY_PROVIDER","INTEGRATIONS_ENABLE_WEBHOOK_PROVIDER"],"mappings":"AAAA,SAAQA,IAAI,EAAEC,YAAY,QAAO,kBAAkB;AAEnD,OAAO,MAAMC,SAASD,aAAa;IACjCE,mCAAmCH,KAAK;QACtCI,MAAM;QACNC,SAAS;IACX;IACAC,oCAAoCN,KAAK;QACvCI,MAAM;QACNC,SAAS;IACX;IACAE,qCAAqCP,KAAK;QACxCI,MAAM;QACNC,SAAS;IACX;IACAG,qCAAqCR,KAAK;QACxCI,MAAM;QACNC,SAAS;IACX;IACAI,qCAAqCT,KAAK;QACxCI,MAAM;QACNC,SAAS;IACX;IACAK,sCAAsCV,KAAK;QACzCI,MAAM;QACNC,SAAS;IACX;AACF,GAAG"}
@@ -0,0 +1,15 @@
1
+ import type { AgentToolCatalogEntry, AgentToolSelectionCatalog, IntegrationCapability, IntegrationProviderKind } from '@shipfox/api-integration-core-dto';
2
+ import type { IntegrationProviderRegistry } from '#core/providers/registry.js';
3
+ export type AgentToolSelectionCatalogs = ReadonlyMap<IntegrationProviderKind, AgentToolSelectionCatalog>;
4
+ export type AgentToolCatalogs = ReadonlyMap<IntegrationProviderKind, readonly AgentToolCatalogEntry[]>;
5
+ export interface WorkspaceConnectionSnapshotEntry {
6
+ readonly id: string;
7
+ readonly provider: IntegrationProviderKind;
8
+ readonly capabilities: readonly IntegrationCapability[];
9
+ }
10
+ export type WorkspaceConnectionSnapshot = ReadonlyMap<string, WorkspaceConnectionSnapshotEntry>;
11
+ export type LoadWorkspaceConnectionSnapshot = (workspaceId: string) => Promise<WorkspaceConnectionSnapshot>;
12
+ export declare function buildAgentToolSelectionCatalogs(registry: IntegrationProviderRegistry): Promise<AgentToolSelectionCatalogs>;
13
+ export declare function buildAgentToolCatalogs(registry: IntegrationProviderRegistry): Promise<AgentToolCatalogs>;
14
+ export declare function createWorkspaceConnectionSnapshotLoader(registry: IntegrationProviderRegistry): LoadWorkspaceConnectionSnapshot;
15
+ //# sourceMappingURL=agent-tool-selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-tool-selection.d.ts","sourceRoot":"","sources":["../../src/core/agent-tool-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,6BAA6B,CAAC;AAG7E,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAClD,uBAAuB,EACvB,yBAAyB,CAC1B,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,WAAW,CACzC,uBAAuB,EACvB,SAAS,qBAAqB,EAAE,CACjC,CAAC;AAEF,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;IAC3C,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACzD;AAED,MAAM,MAAM,2BAA2B,GAAG,WAAW,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC;AAChG,MAAM,MAAM,+BAA+B,GAAG,CAC5C,WAAW,EAAE,MAAM,KAChB,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAE1C,wBAAsB,+BAA+B,CACnD,QAAQ,EAAE,2BAA2B,GACpC,OAAO,CAAC,0BAA0B,CAAC,CAWrC;AAED,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,2BAA2B,GACpC,OAAO,CAAC,iBAAiB,CAAC,CAW5B;AAED,wBAAgB,uCAAuC,CACrD,QAAQ,EAAE,2BAA2B,GACpC,+BAA+B,CAkBjC"}
@@ -0,0 +1,48 @@
1
+ import { listIntegrationConnections } from '#db/connections.js';
2
+ export async function buildAgentToolSelectionCatalogs(registry) {
3
+ const entries = await Promise.all(registry.list('agent_tools').map(async (provider)=>{
4
+ const adapter = provider.adapters.agent_tools;
5
+ if (adapter === undefined) {
6
+ throw new Error(`Integration provider "${provider.provider}" has no agent tools adapter`);
7
+ }
8
+ return [
9
+ provider.provider,
10
+ await adapter.selectionCatalog()
11
+ ];
12
+ }));
13
+ return new Map(entries);
14
+ }
15
+ export async function buildAgentToolCatalogs(registry) {
16
+ const entries = await Promise.all(registry.list('agent_tools').map(async (provider)=>{
17
+ const adapter = provider.adapters.agent_tools;
18
+ if (adapter === undefined) {
19
+ throw new Error(`Integration provider "${provider.provider}" has no agent tools adapter`);
20
+ }
21
+ return [
22
+ provider.provider,
23
+ await adapter.catalog()
24
+ ];
25
+ }));
26
+ return new Map(entries);
27
+ }
28
+ export function createWorkspaceConnectionSnapshotLoader(registry) {
29
+ const capabilitiesByProvider = new Map(registry.list().map((provider)=>[
30
+ provider.provider,
31
+ provider.capabilities
32
+ ]));
33
+ return async (workspaceId)=>{
34
+ const connections = await listIntegrationConnections({
35
+ workspaceId
36
+ });
37
+ return new Map(connections.map((connection)=>[
38
+ connection.slug,
39
+ {
40
+ id: connection.id,
41
+ provider: connection.provider,
42
+ capabilities: capabilitiesByProvider.get(connection.provider) ?? []
43
+ }
44
+ ]));
45
+ };
46
+ }
47
+
48
+ //# sourceMappingURL=agent-tool-selection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/agent-tool-selection.ts"],"sourcesContent":["import type {\n AgentToolCatalogEntry,\n AgentToolSelectionCatalog,\n IntegrationCapability,\n IntegrationProviderKind,\n} from '@shipfox/api-integration-core-dto';\nimport type {IntegrationProviderRegistry} from '#core/providers/registry.js';\nimport {listIntegrationConnections} from '#db/connections.js';\n\nexport type AgentToolSelectionCatalogs = ReadonlyMap<\n IntegrationProviderKind,\n AgentToolSelectionCatalog\n>;\nexport type AgentToolCatalogs = ReadonlyMap<\n IntegrationProviderKind,\n readonly AgentToolCatalogEntry[]\n>;\n\nexport interface WorkspaceConnectionSnapshotEntry {\n readonly id: string;\n readonly provider: IntegrationProviderKind;\n readonly capabilities: readonly IntegrationCapability[];\n}\n\nexport type WorkspaceConnectionSnapshot = ReadonlyMap<string, WorkspaceConnectionSnapshotEntry>;\nexport type LoadWorkspaceConnectionSnapshot = (\n workspaceId: string,\n) => Promise<WorkspaceConnectionSnapshot>;\n\nexport async function buildAgentToolSelectionCatalogs(\n registry: IntegrationProviderRegistry,\n): Promise<AgentToolSelectionCatalogs> {\n const entries = await Promise.all(\n registry.list('agent_tools').map(async (provider) => {\n const adapter = provider.adapters.agent_tools;\n if (adapter === undefined) {\n throw new Error(`Integration provider \"${provider.provider}\" has no agent tools adapter`);\n }\n return [provider.provider, await adapter.selectionCatalog()] as const;\n }),\n );\n return new Map(entries);\n}\n\nexport async function buildAgentToolCatalogs(\n registry: IntegrationProviderRegistry,\n): Promise<AgentToolCatalogs> {\n const entries = await Promise.all(\n registry.list('agent_tools').map(async (provider) => {\n const adapter = provider.adapters.agent_tools;\n if (adapter === undefined) {\n throw new Error(`Integration provider \"${provider.provider}\" has no agent tools adapter`);\n }\n return [provider.provider, await adapter.catalog()] as const;\n }),\n );\n return new Map(entries);\n}\n\nexport function createWorkspaceConnectionSnapshotLoader(\n registry: IntegrationProviderRegistry,\n): LoadWorkspaceConnectionSnapshot {\n const capabilitiesByProvider = new Map(\n registry.list().map((provider) => [provider.provider, provider.capabilities]),\n );\n\n return async (workspaceId) => {\n const connections = await listIntegrationConnections({workspaceId});\n return new Map(\n connections.map((connection) => [\n connection.slug,\n {\n id: connection.id,\n provider: connection.provider,\n capabilities: capabilitiesByProvider.get(connection.provider) ?? [],\n },\n ]),\n );\n };\n}\n"],"names":["listIntegrationConnections","buildAgentToolSelectionCatalogs","registry","entries","Promise","all","list","map","provider","adapter","adapters","agent_tools","undefined","Error","selectionCatalog","Map","buildAgentToolCatalogs","catalog","createWorkspaceConnectionSnapshotLoader","capabilitiesByProvider","capabilities","workspaceId","connections","connection","slug","id","get"],"mappings":"AAOA,SAAQA,0BAA0B,QAAO,qBAAqB;AAsB9D,OAAO,eAAeC,gCACpBC,QAAqC;IAErC,MAAMC,UAAU,MAAMC,QAAQC,GAAG,CAC/BH,SAASI,IAAI,CAAC,eAAeC,GAAG,CAAC,OAAOC;QACtC,MAAMC,UAAUD,SAASE,QAAQ,CAACC,WAAW;QAC7C,IAAIF,YAAYG,WAAW;YACzB,MAAM,IAAIC,MAAM,CAAC,sBAAsB,EAAEL,SAASA,QAAQ,CAAC,4BAA4B,CAAC;QAC1F;QACA,OAAO;YAACA,SAASA,QAAQ;YAAE,MAAMC,QAAQK,gBAAgB;SAAG;IAC9D;IAEF,OAAO,IAAIC,IAAIZ;AACjB;AAEA,OAAO,eAAea,uBACpBd,QAAqC;IAErC,MAAMC,UAAU,MAAMC,QAAQC,GAAG,CAC/BH,SAASI,IAAI,CAAC,eAAeC,GAAG,CAAC,OAAOC;QACtC,MAAMC,UAAUD,SAASE,QAAQ,CAACC,WAAW;QAC7C,IAAIF,YAAYG,WAAW;YACzB,MAAM,IAAIC,MAAM,CAAC,sBAAsB,EAAEL,SAASA,QAAQ,CAAC,4BAA4B,CAAC;QAC1F;QACA,OAAO;YAACA,SAASA,QAAQ;YAAE,MAAMC,QAAQQ,OAAO;SAAG;IACrD;IAEF,OAAO,IAAIF,IAAIZ;AACjB;AAEA,OAAO,SAASe,wCACdhB,QAAqC;IAErC,MAAMiB,yBAAyB,IAAIJ,IACjCb,SAASI,IAAI,GAAGC,GAAG,CAAC,CAACC,WAAa;YAACA,SAASA,QAAQ;YAAEA,SAASY,YAAY;SAAC;IAG9E,OAAO,OAAOC;QACZ,MAAMC,cAAc,MAAMtB,2BAA2B;YAACqB;QAAW;QACjE,OAAO,IAAIN,IACTO,YAAYf,GAAG,CAAC,CAACgB,aAAe;gBAC9BA,WAAWC,IAAI;gBACf;oBACEC,IAAIF,WAAWE,EAAE;oBACjBjB,UAAUe,WAAWf,QAAQ;oBAC7BY,cAAcD,uBAAuBO,GAAG,CAACH,WAAWf,QAAQ,KAAK,EAAE;gBACrE;aACD;IAEL;AACF"}
@@ -0,0 +1,2 @@
1
+ export type { IntegrationConnection, IntegrationConnectionLifecycleStatus, } from '@shipfox/api-integration-core-dto';
2
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/core/entities/connection.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,qBAAqB,EACrB,oCAAoC,GACrC,MAAM,mCAAmC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/entities/connection.ts"],"sourcesContent":["export type {\n IntegrationConnection,\n IntegrationConnectionLifecycleStatus,\n} from '@shipfox/api-integration-core-dto';\n"],"names":[],"mappings":"AAAA,WAG2C"}
@@ -0,0 +1,6 @@
1
+ import type { IntegrationProvider as CoreIntegrationProvider, RegisteredIntegrationProvider as CoreRegisteredIntegrationProvider } from '@shipfox/api-integration-core-dto';
2
+ import type { RouteExport } from '@shipfox/node-fastify';
3
+ export type { AgentToolCallInput, AgentToolCatalogEntry, AgentToolJsonSchema, AgentToolSensitivity, AgentToolSession, AgentToolsProvider, IntegrationCapability, IntegrationProviderAdapters, IntegrationProviderKind, OpenAgentToolsSessionInput, } from '@shipfox/api-integration-core-dto';
4
+ export type IntegrationProvider = CoreIntegrationProvider<string, RouteExport>;
5
+ export type RegisteredIntegrationProvider = CoreRegisteredIntegrationProvider<string, RouteExport>;
6
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/core/entities/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,IAAI,uBAAuB,EAC9C,6BAA6B,IAAI,iCAAiC,EACnE,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAEvD,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAC/E,MAAM,MAAM,6BAA6B,GAAG,iCAAiC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/entities/provider.ts"],"sourcesContent":["import type {\n IntegrationProvider as CoreIntegrationProvider,\n RegisteredIntegrationProvider as CoreRegisteredIntegrationProvider,\n} from '@shipfox/api-integration-core-dto';\nimport type {RouteExport} from '@shipfox/node-fastify';\n\nexport type {\n AgentToolCallInput,\n AgentToolCatalogEntry,\n AgentToolJsonSchema,\n AgentToolSensitivity,\n AgentToolSession,\n AgentToolsProvider,\n IntegrationCapability,\n IntegrationProviderAdapters,\n IntegrationProviderKind,\n OpenAgentToolsSessionInput,\n} from '@shipfox/api-integration-core-dto';\n\nexport type IntegrationProvider = CoreIntegrationProvider<string, RouteExport>;\nexport type RegisteredIntegrationProvider = CoreRegisteredIntegrationProvider<string, RouteExport>;\n"],"names":[],"mappings":"AAoBA,WAAmG"}
@@ -0,0 +1,29 @@
1
+ import { ConnectionSlugConflictError, IntegrationProviderError, type IntegrationProviderErrorReason } from '@shipfox/api-integration-core-dto';
2
+ import type { IntegrationCapability, IntegrationProviderKind } from '#core/entities/provider.js';
3
+ export declare class IntegrationConnectionNotFoundError extends Error {
4
+ constructor(connectionId: string);
5
+ }
6
+ export declare class IntegrationConnectionInactiveError extends Error {
7
+ constructor(connectionId: string);
8
+ }
9
+ export declare class IntegrationConnectionWorkspaceMismatchError extends Error {
10
+ constructor(connectionId: string);
11
+ }
12
+ export declare class IntegrationConnectionAlreadyExistsError extends Error {
13
+ readonly workspaceId: string;
14
+ readonly provider: IntegrationProviderKind;
15
+ readonly externalAccountId: string;
16
+ constructor(workspaceId: string, provider: IntegrationProviderKind, externalAccountId: string);
17
+ }
18
+ export declare class IntegrationCapabilityUnavailableError extends Error {
19
+ constructor(capability: IntegrationCapability, provider: IntegrationProviderKind);
20
+ }
21
+ export declare class IntegrationCheckoutUnsupportedError extends Error {
22
+ readonly provider: IntegrationProviderKind;
23
+ constructor(provider: IntegrationProviderKind);
24
+ }
25
+ export declare class IntegrationProviderUnavailableError extends Error {
26
+ constructor(provider: IntegrationProviderKind);
27
+ }
28
+ export { ConnectionSlugConflictError, IntegrationProviderError, type IntegrationProviderErrorReason };
29
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,KAAK,8BAA8B,EACpC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAC,qBAAqB,EAAE,uBAAuB,EAAC,MAAM,4BAA4B,CAAC;AAE/F,qBAAa,kCAAmC,SAAQ,KAAK;gBAC/C,YAAY,EAAE,MAAM;CAGjC;AAED,qBAAa,kCAAmC,SAAQ,KAAK;gBAC/C,YAAY,EAAE,MAAM;CAGjC;AAED,qBAAa,2CAA4C,SAAQ,KAAK;gBACxD,YAAY,EAAE,MAAM;CAGjC;AAED,qBAAa,uCAAwC,SAAQ,KAAK;aAE9C,WAAW,EAAE,MAAM;aACnB,QAAQ,EAAE,uBAAuB;aACjC,iBAAiB,EAAE,MAAM;gBAFzB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,uBAAuB,EACjC,iBAAiB,EAAE,MAAM;CAK5C;AAED,qBAAa,qCAAsC,SAAQ,KAAK;gBAClD,UAAU,EAAE,qBAAqB,EAAE,QAAQ,EAAE,uBAAuB;CAGjF;AAED,qBAAa,mCAAoC,SAAQ,KAAK;aAChC,QAAQ,EAAE,uBAAuB;gBAAjC,QAAQ,EAAE,uBAAuB;CAG9D;AAED,qBAAa,mCAAoC,SAAQ,KAAK;gBAChD,QAAQ,EAAE,uBAAuB;CAG9C;AAED,OAAO,EAAC,2BAA2B,EAAE,wBAAwB,EAAE,KAAK,8BAA8B,EAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { ConnectionSlugConflictError, IntegrationProviderError } from '@shipfox/api-integration-core-dto';
2
+ export class IntegrationConnectionNotFoundError extends Error {
3
+ constructor(connectionId){
4
+ super(`Integration connection not found: ${connectionId}`);
5
+ }
6
+ }
7
+ export class IntegrationConnectionInactiveError extends Error {
8
+ constructor(connectionId){
9
+ super(`Integration connection is not active: ${connectionId}`);
10
+ }
11
+ }
12
+ export class IntegrationConnectionWorkspaceMismatchError extends Error {
13
+ constructor(connectionId){
14
+ super(`Integration connection does not belong to the requested workspace: ${connectionId}`);
15
+ }
16
+ }
17
+ export class IntegrationConnectionAlreadyExistsError extends Error {
18
+ constructor(workspaceId, provider, externalAccountId){
19
+ super(`Integration connection already exists: ${workspaceId}/${provider}/${externalAccountId}`), this.workspaceId = workspaceId, this.provider = provider, this.externalAccountId = externalAccountId;
20
+ this.name = 'IntegrationConnectionAlreadyExistsError';
21
+ }
22
+ }
23
+ export class IntegrationCapabilityUnavailableError extends Error {
24
+ constructor(capability, provider){
25
+ super(`Integration provider ${provider} does not expose ${capability}`);
26
+ }
27
+ }
28
+ export class IntegrationCheckoutUnsupportedError extends Error {
29
+ constructor(provider){
30
+ super(`Integration provider ${provider} cannot create a checkout spec`), this.provider = provider;
31
+ }
32
+ }
33
+ export class IntegrationProviderUnavailableError extends Error {
34
+ constructor(provider){
35
+ super(`No integration provider registered for ${provider}`);
36
+ }
37
+ }
38
+ export { ConnectionSlugConflictError, IntegrationProviderError };
39
+
40
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/errors.ts"],"sourcesContent":["import {\n ConnectionSlugConflictError,\n IntegrationProviderError,\n type IntegrationProviderErrorReason,\n} from '@shipfox/api-integration-core-dto';\nimport type {IntegrationCapability, IntegrationProviderKind} from '#core/entities/provider.js';\n\nexport class IntegrationConnectionNotFoundError extends Error {\n constructor(connectionId: string) {\n super(`Integration connection not found: ${connectionId}`);\n }\n}\n\nexport class IntegrationConnectionInactiveError extends Error {\n constructor(connectionId: string) {\n super(`Integration connection is not active: ${connectionId}`);\n }\n}\n\nexport class IntegrationConnectionWorkspaceMismatchError extends Error {\n constructor(connectionId: string) {\n super(`Integration connection does not belong to the requested workspace: ${connectionId}`);\n }\n}\n\nexport class IntegrationConnectionAlreadyExistsError extends Error {\n constructor(\n public readonly workspaceId: string,\n public readonly provider: IntegrationProviderKind,\n public readonly externalAccountId: string,\n ) {\n super(`Integration connection already exists: ${workspaceId}/${provider}/${externalAccountId}`);\n this.name = 'IntegrationConnectionAlreadyExistsError';\n }\n}\n\nexport class IntegrationCapabilityUnavailableError extends Error {\n constructor(capability: IntegrationCapability, provider: IntegrationProviderKind) {\n super(`Integration provider ${provider} does not expose ${capability}`);\n }\n}\n\nexport class IntegrationCheckoutUnsupportedError extends Error {\n constructor(public readonly provider: IntegrationProviderKind) {\n super(`Integration provider ${provider} cannot create a checkout spec`);\n }\n}\n\nexport class IntegrationProviderUnavailableError extends Error {\n constructor(provider: IntegrationProviderKind) {\n super(`No integration provider registered for ${provider}`);\n }\n}\n\nexport {ConnectionSlugConflictError, IntegrationProviderError, type IntegrationProviderErrorReason};\n"],"names":["ConnectionSlugConflictError","IntegrationProviderError","IntegrationConnectionNotFoundError","Error","connectionId","IntegrationConnectionInactiveError","IntegrationConnectionWorkspaceMismatchError","IntegrationConnectionAlreadyExistsError","workspaceId","provider","externalAccountId","name","IntegrationCapabilityUnavailableError","capability","IntegrationCheckoutUnsupportedError","IntegrationProviderUnavailableError"],"mappings":"AAAA,SACEA,2BAA2B,EAC3BC,wBAAwB,QAEnB,oCAAoC;AAG3C,OAAO,MAAMC,2CAA2CC;IACtD,YAAYC,YAAoB,CAAE;QAChC,KAAK,CAAC,CAAC,kCAAkC,EAAEA,cAAc;IAC3D;AACF;AAEA,OAAO,MAAMC,2CAA2CF;IACtD,YAAYC,YAAoB,CAAE;QAChC,KAAK,CAAC,CAAC,sCAAsC,EAAEA,cAAc;IAC/D;AACF;AAEA,OAAO,MAAME,oDAAoDH;IAC/D,YAAYC,YAAoB,CAAE;QAChC,KAAK,CAAC,CAAC,mEAAmE,EAAEA,cAAc;IAC5F;AACF;AAEA,OAAO,MAAMG,gDAAgDJ;IAC3D,YACE,AAAgBK,WAAmB,EACnC,AAAgBC,QAAiC,EACjD,AAAgBC,iBAAyB,CACzC;QACA,KAAK,CAAC,CAAC,uCAAuC,EAAEF,YAAY,CAAC,EAAEC,SAAS,CAAC,EAAEC,mBAAmB,QAJ9EF,cAAAA,kBACAC,WAAAA,eACAC,oBAAAA;QAGhB,IAAI,CAACC,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMC,8CAA8CT;IACzD,YAAYU,UAAiC,EAAEJ,QAAiC,CAAE;QAChF,KAAK,CAAC,CAAC,qBAAqB,EAAEA,SAAS,iBAAiB,EAAEI,YAAY;IACxE;AACF;AAEA,OAAO,MAAMC,4CAA4CX;IACvD,YAAY,AAAgBM,QAAiC,CAAE;QAC7D,KAAK,CAAC,CAAC,qBAAqB,EAAEA,SAAS,8BAA8B,CAAC,QAD5CA,WAAAA;IAE5B;AACF;AAEA,OAAO,MAAMM,4CAA4CZ;IACvD,YAAYM,QAAiC,CAAE;QAC7C,KAAK,CAAC,CAAC,uCAAuC,EAAEA,UAAU;IAC5D;AACF;AAEA,SAAQT,2BAA2B,EAAEC,wBAAwB,GAAuC"}
@@ -0,0 +1,2 @@
1
+ export type { AgentToolCallInput, AgentToolCatalogEntry, AgentToolCatalogMethod, AgentToolJsonSchema, AgentToolSensitivity, AgentToolSession, AgentToolsProvider, OpenAgentToolsSessionInput, } from '@shipfox/api-integration-core-dto';
2
+ //# sourceMappingURL=agent-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../../src/core/providers/agent-tools.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,mCAAmC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=agent-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/providers/agent-tools.ts"],"sourcesContent":["export type {\n AgentToolCallInput,\n AgentToolCatalogEntry,\n AgentToolCatalogMethod,\n AgentToolJsonSchema,\n AgentToolSensitivity,\n AgentToolSession,\n AgentToolsProvider,\n OpenAgentToolsSessionInput,\n} from '@shipfox/api-integration-core-dto';\n"],"names":[],"mappings":"AAAA,WAS2C"}
@@ -0,0 +1,9 @@
1
+ import type { CheckoutSpec } from '@shipfox/api-integration-core-dto';
2
+ /**
3
+ * Returns a copy of `spec` that is safe to log: the credential token is masked
4
+ * and any userinfo a provider mistakenly left in `repositoryUrl` is stripped.
5
+ * Returns the original spec unchanged when it has no credentials and the URL is
6
+ * already clean.
7
+ */
8
+ export declare function redactCheckoutSpec(spec: CheckoutSpec): CheckoutSpec;
9
+ //# sourceMappingURL=redact-checkout-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact-checkout-spec.d.ts","sourceRoot":"","sources":["../../../src/core/providers/redact-checkout-spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAGpE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,CAUnE"}
@@ -0,0 +1,25 @@
1
+ import { REDACTION_PLACEHOLDER, stripUrlCredentials } from '@shipfox/redact';
2
+ /**
3
+ * Returns a copy of `spec` that is safe to log: the credential token is masked
4
+ * and any userinfo a provider mistakenly left in `repositoryUrl` is stripped.
5
+ * Returns the original spec unchanged when it has no credentials and the URL is
6
+ * already clean.
7
+ */ export function redactCheckoutSpec(spec) {
8
+ const repositoryUrl = stripUrlCredentials(spec.repositoryUrl);
9
+ if (!spec.credentials) {
10
+ return repositoryUrl === spec.repositoryUrl ? spec : {
11
+ ...spec,
12
+ repositoryUrl
13
+ };
14
+ }
15
+ return {
16
+ ...spec,
17
+ repositoryUrl,
18
+ credentials: {
19
+ ...spec.credentials,
20
+ token: REDACTION_PLACEHOLDER
21
+ }
22
+ };
23
+ }
24
+
25
+ //# sourceMappingURL=redact-checkout-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/providers/redact-checkout-spec.ts"],"sourcesContent":["import type {CheckoutSpec} from '@shipfox/api-integration-core-dto';\nimport {REDACTION_PLACEHOLDER, stripUrlCredentials} from '@shipfox/redact';\n\n/**\n * Returns a copy of `spec` that is safe to log: the credential token is masked\n * and any userinfo a provider mistakenly left in `repositoryUrl` is stripped.\n * Returns the original spec unchanged when it has no credentials and the URL is\n * already clean.\n */\nexport function redactCheckoutSpec(spec: CheckoutSpec): CheckoutSpec {\n const repositoryUrl = stripUrlCredentials(spec.repositoryUrl);\n if (!spec.credentials) {\n return repositoryUrl === spec.repositoryUrl ? spec : {...spec, repositoryUrl};\n }\n return {\n ...spec,\n repositoryUrl,\n credentials: {...spec.credentials, token: REDACTION_PLACEHOLDER},\n };\n}\n"],"names":["REDACTION_PLACEHOLDER","stripUrlCredentials","redactCheckoutSpec","spec","repositoryUrl","credentials","token"],"mappings":"AACA,SAAQA,qBAAqB,EAAEC,mBAAmB,QAAO,kBAAkB;AAE3E;;;;;CAKC,GACD,OAAO,SAASC,mBAAmBC,IAAkB;IACnD,MAAMC,gBAAgBH,oBAAoBE,KAAKC,aAAa;IAC5D,IAAI,CAACD,KAAKE,WAAW,EAAE;QACrB,OAAOD,kBAAkBD,KAAKC,aAAa,GAAGD,OAAO;YAAC,GAAGA,IAAI;YAAEC;QAAa;IAC9E;IACA,OAAO;QACL,GAAGD,IAAI;QACPC;QACAC,aAAa;YAAC,GAAGF,KAAKE,WAAW;YAAEC,OAAON;QAAqB;IACjE;AACF"}