@codemation/host 0.6.0 → 0.7.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 (223) hide show
  1. package/CHANGELOG.md +431 -0
  2. package/LICENSE +1 -37
  3. package/dist/{ApiPaths-CLTHphYZ.js → ApiPaths-Dv1dcHu_.js} +4 -4
  4. package/dist/ApiPaths-Dv1dcHu_.js.map +1 -0
  5. package/dist/{AppConfigFactory-C6q-CSKb.js → AppConfigFactory-Cx4qQvRk.js} +112 -52
  6. package/dist/AppConfigFactory-Cx4qQvRk.js.map +1 -0
  7. package/dist/{AppConfigFactory-YnveXE9k.d.ts → AppConfigFactory-DnLoQ9Li.d.ts} +8490 -5548
  8. package/dist/{AppContainerFactory-qaqc-R1D.js → AppContainerFactory-DqKYCRNP.js} +7641 -2083
  9. package/dist/AppContainerFactory-DqKYCRNP.js.map +1 -0
  10. package/dist/{CodemationAppContext-DRu1Dpri.d.ts → CodemationAppContext-CKVv9W9q.d.ts} +8 -4
  11. package/dist/{CodemationAuthoring.types-fBRppnmi.d.ts → CodemationAuthoring.types-DA3G3s6d.d.ts} +25 -5
  12. package/dist/{CodemationAuthoring.types-DZl-sJaM.js → CodemationAuthoring.types-NGkBcmmT.js} +18 -6
  13. package/dist/CodemationAuthoring.types-NGkBcmmT.js.map +1 -0
  14. package/dist/{CodemationConfigNormalizer-DVko3cVN.d.ts → CodemationConfigNormalizer-BAKjetJ6.d.ts} +3 -3
  15. package/dist/{CodemationConsumerConfigLoader-BeAUS144.js → CodemationConsumerConfigLoader-GYpBBvqE.js} +79 -10
  16. package/dist/CodemationConsumerConfigLoader-GYpBBvqE.js.map +1 -0
  17. package/dist/{CodemationConsumerConfigLoader-DJWr86f-.d.ts → CodemationConsumerConfigLoader-nxOqvv46.d.ts} +17 -2
  18. package/dist/{CodemationPluginListMerger-B-W5Fa_X.js → CodemationPluginListMerger-D1B1IEbt.js} +1 -1
  19. package/dist/{CodemationPluginListMerger-B-W5Fa_X.js.map → CodemationPluginListMerger-D1B1IEbt.js.map} +1 -1
  20. package/dist/{CodemationPluginListMerger-DGc-jfa2.d.ts → CodemationPluginListMerger-DKLAHT2b.d.ts} +123 -16
  21. package/dist/CodemationTsyringeTypeInfoRegistrar-Bj6FJYFz.js +97 -0
  22. package/dist/CodemationTsyringeTypeInfoRegistrar-Bj6FJYFz.js.map +1 -0
  23. package/dist/{CodemationWhitelabelConfig-CWbcyQqn.d.ts → CodemationWhitelabelConfig-Ca2mCUeC.d.ts} +2 -2
  24. package/dist/{CollectionContracts.types-DdpHft0i.d.ts → CollectionContracts.types-DDyFYT_D.d.ts} +1 -1
  25. package/dist/{CredentialContractsRegistry-DrMIDSw8.d.ts → CredentialContractsRegistry-Bq2bq28t.d.ts} +2 -2
  26. package/dist/{CredentialServices-UfvHB-rN.d.ts → CredentialServices-Be2I60Th.d.ts} +65 -20
  27. package/dist/{CredentialServices-CgxwguAv.js → CredentialServices-Dk8yypeL.js} +310 -51
  28. package/dist/CredentialServices-Dk8yypeL.js.map +1 -0
  29. package/dist/InternalHonoApiRouteRegistrar-Ce1yxpnO.d.ts +17 -0
  30. package/dist/InternalPingRegistrar-DY3kSfxP.js +221 -0
  31. package/dist/InternalPingRegistrar-DY3kSfxP.js.map +1 -0
  32. package/dist/{ItemsInputNormalizer-C-KHg9Mo.d.ts → ItemsInputNormalizer-_RwIfRIQ.d.ts} +89 -25
  33. package/dist/{LogLevelPolicyFactory-CampWO0l.d.ts → LogLevelPolicyFactory-ewCHLDLn.d.ts} +2 -2
  34. package/dist/{PublicFrontendBootstrap-DzBgwOnG.d.ts → PublicFrontendBootstrap-Cev3qK46.d.ts} +9 -2
  35. package/dist/PublicFrontendBootstrapFactory-CY2FS-5g.d.ts +82 -0
  36. package/dist/{PublicFrontendBootstrapJsonCodec-Cl_DLRh0.d.ts → PublicFrontendBootstrapJsonCodec-CXG9Dxft.d.ts} +3 -3
  37. package/dist/{PublicFrontendBootstrapJsonCodec-DzqvA0uo.js → PublicFrontendBootstrapJsonCodec-CegIF_ne.js} +7 -2
  38. package/dist/PublicFrontendBootstrapJsonCodec-CegIF_ne.js.map +1 -0
  39. package/dist/ServerLoggerFactory-Ckk52S3w.js +223 -0
  40. package/dist/ServerLoggerFactory-Ckk52S3w.js.map +1 -0
  41. package/dist/{TelemetryContracts-DbaNomrH.d.ts → TelemetryContracts-BtDx84Cp.d.ts} +13 -4
  42. package/dist/{WorkflowPolicyUiPresentationFactory-DQEY-h_S.d.ts → WorkflowPolicyUiPresentationFactory-6MyjCvBO.d.ts} +2 -2
  43. package/dist/{WorkflowPolicyUiPresentationFactory-DhPqQ9aB.js → WorkflowPolicyUiPresentationFactory-Bb-ae_Zh.js} +1 -1
  44. package/dist/{WorkflowPolicyUiPresentationFactory-DhPqQ9aB.js.map → WorkflowPolicyUiPresentationFactory-Bb-ae_Zh.js.map} +1 -1
  45. package/dist/{WorkflowViewContracts-CzK2KFuz.d.ts → WorkflowViewContracts-B7aFQcIw.d.ts} +10 -1
  46. package/dist/authoring.d.ts +5 -5
  47. package/dist/authoring.js +1 -1
  48. package/dist/client.d.ts +4 -4
  49. package/dist/client.js +2 -2
  50. package/dist/consumer.d.ts +6 -6
  51. package/dist/consumer.js +2 -2
  52. package/dist/credentials.d.ts +6 -6
  53. package/dist/credentials.js +1 -1
  54. package/dist/devServerSidecar.d.ts +2 -2
  55. package/dist/devServerSidecar.js +1 -94
  56. package/dist/devServerSidecar.js.map +1 -1
  57. package/dist/dto.d.ts +6 -6
  58. package/dist/{index-BbBk26m0.d.ts → index-DilAYwnH.d.ts} +49 -3
  59. package/dist/index.d.ts +110 -21
  60. package/dist/index.js +15 -13
  61. package/dist/mapping.d.ts +2 -2
  62. package/dist/mapping.js +1 -1
  63. package/dist/nextServer.d.ts +43 -88
  64. package/dist/nextServer.js +9 -7
  65. package/dist/pairing.d.ts +93 -0
  66. package/dist/pairing.js +5 -0
  67. package/dist/pairing.types-snfZ_OzB.d.ts +19 -0
  68. package/dist/{persistenceServer-CmsIKnO9.js → persistenceServer-C-hH4z6l.js} +2 -2
  69. package/dist/{persistenceServer-CmsIKnO9.js.map → persistenceServer-C-hH4z6l.js.map} +1 -1
  70. package/dist/persistenceServer-CeTHtC6E.d.ts +30 -0
  71. package/dist/persistenceServer.d.ts +8 -8
  72. package/dist/persistenceServer.js +3 -3
  73. package/dist/{server-MUNGsBYK.d.ts → server-C4bS62rg.d.ts} +21 -6
  74. package/dist/{server-CJFfY67o.js → server-Y7kxwtCK.js} +7 -6
  75. package/dist/{server-CJFfY67o.js.map → server-Y7kxwtCK.js.map} +1 -1
  76. package/dist/server.d.ts +14 -14
  77. package/dist/server.js +13 -11
  78. package/package.json +29 -42
  79. package/prisma/migrations/20260519000000_workflow_audit_log/migration.sql +23 -0
  80. package/prisma/migrations/20260519100000_storage_growth_fixes/migration.sql +61 -0
  81. package/prisma/migrations.sqlite/20260519000000_workflow_audit_log/migration.sql +21 -0
  82. package/prisma/migrations.sqlite/20260519100000_storage_growth_fixes/migration.sql +29 -0
  83. package/prisma/schema.postgresql.prisma +55 -17
  84. package/prisma/schema.sqlite.prisma +55 -17
  85. package/prisma-generated/prisma-postgresql-client/edge.js +33 -5
  86. package/prisma-generated/prisma-postgresql-client/index-browser.js +29 -1
  87. package/prisma-generated/prisma-postgresql-client/index.d.ts +8933 -5716
  88. package/prisma-generated/prisma-postgresql-client/index.js +33 -5
  89. package/prisma-generated/prisma-postgresql-client/package.json +1 -1
  90. package/prisma-generated/prisma-postgresql-client/schema.prisma +38 -0
  91. package/prisma-generated/prisma-sqlite-client/edge.js +33 -5
  92. package/prisma-generated/prisma-sqlite-client/index-browser.js +29 -1
  93. package/prisma-generated/prisma-sqlite-client/index.d.ts +8925 -5713
  94. package/prisma-generated/prisma-sqlite-client/index.js +33 -5
  95. package/prisma-generated/prisma-sqlite-client/package.json +1 -1
  96. package/prisma-generated/prisma-sqlite-client/schema.prisma +38 -0
  97. package/scripts/check-collections.mjs +18 -0
  98. package/scripts/generate-prisma-clients.mjs +20 -11
  99. package/src/application/WorkflowAuditLogPruneScheduler.ts +96 -0
  100. package/src/application/auth/AuthenticatedPrincipal.ts +4 -0
  101. package/src/application/commands/StartWorkflowRunCommandHandler.ts +4 -0
  102. package/src/application/contracts/WorkflowViewContracts.ts +6 -0
  103. package/src/application/contracts/WorkflowWebsocketMessage.ts +3 -1
  104. package/src/application/mapping/WorkflowDefinitionMapper.ts +40 -1
  105. package/src/application/runs/WorkflowRunRetentionPruneScheduler.ts +7 -1
  106. package/src/application/telemetry/OtelExecutionTelemetry.types.ts +5 -0
  107. package/src/application/telemetry/OtelExecutionTelemetryFactory.ts +4 -0
  108. package/src/application/telemetry/StoredTelemetrySpanScope.ts +6 -2
  109. package/src/application/telemetry/TelemetryRetentionTimestampFactory.ts +27 -17
  110. package/src/application/telemetry/TelemetrySpanPublisher.ts +11 -0
  111. package/src/application/websocket/TelemetrySpanWebsocketRelay.ts +31 -0
  112. package/src/applicationTokens.ts +20 -1
  113. package/src/audit/IAuditEmitter.ts +32 -0
  114. package/src/audit/PrismaWorkflowAuditLogRepository.ts +34 -0
  115. package/src/audit/WorkflowAuditLogWriter.ts +125 -0
  116. package/src/auth/managed/ManagedAuthConfig.ts +29 -0
  117. package/src/auth/managed/ManagedAuthMiddleware.ts +52 -0
  118. package/src/auth/managed/ManagedCorsMiddleware.ts +43 -0
  119. package/src/auth/managed/ManagedModeBootGuard.ts +27 -0
  120. package/src/auth/managed/index.ts +5 -0
  121. package/src/bootstrap/AppContainerFactory.ts +277 -29
  122. package/src/bootstrap/AppContainerLifecycle.ts +31 -0
  123. package/src/bootstrap/perf/BootTimer.ts +168 -0
  124. package/src/bootstrap/runtime/AppConfigFactory.ts +21 -65
  125. package/src/bootstrap/runtime/FrontendRuntime.ts +4 -1
  126. package/src/bootstrap/runtime/WorkerRuntime.ts +2 -1
  127. package/src/credentials/BrokerClient.ts +49 -0
  128. package/src/credentials/BrokerRefreshError.ts +12 -0
  129. package/src/credentials/BrokerRefreshInvalidGrantError.ts +13 -0
  130. package/src/credentials/ControlPlaneCatalogFetcher.ts +261 -0
  131. package/src/credentials/CredentialOAuth2MaterialReader.ts +136 -0
  132. package/src/credentials/InternalCredentialsListRegistrar.ts +48 -0
  133. package/src/credentials/InternalCredentialsPushRegistrar.ts +125 -0
  134. package/src/credentials/LocalOAuthFlowExecutor.ts +316 -0
  135. package/src/credentials/ManagedOAuthFlowExecutor.ts +94 -0
  136. package/src/credentials/ManagedOAuthRefreshInvalidGrantError.ts +13 -0
  137. package/src/credentials/catalogTypes.ts +4 -0
  138. package/src/credentials/refresh/CredentialDisconnectedError.ts +11 -0
  139. package/src/domain/credentials/CredentialBindingService.ts +54 -2
  140. package/src/domain/credentials/CredentialKeyRotatedError.ts +22 -0
  141. package/src/domain/credentials/CredentialSecretCipher.ts +68 -6
  142. package/src/domain/credentials/CredentialTypeRegistryImpl.ts +117 -10
  143. package/src/domain/credentials/OAuth2RedirectUriResolver.ts +79 -0
  144. package/src/domain/credentials/WorkflowCredentialNodeResolver.ts +14 -5
  145. package/src/domain/telemetry/TelemetryContracts.ts +7 -1
  146. package/src/domain/workflows/WorkflowActivationPreflight.ts +24 -1
  147. package/src/domain/workflows/WorkflowActivationPreflightRules.ts +40 -1
  148. package/src/index.ts +6 -0
  149. package/src/infrastructure/binary/LocalFilesystemBinaryStorageRegistry.ts +29 -1
  150. package/src/infrastructure/binary/S3BinaryStorage.ts +169 -0
  151. package/src/infrastructure/binary/S3BinaryStorageConfig.ts +17 -0
  152. package/src/infrastructure/config/CodemationPluginRegistrar.ts +3 -1
  153. package/src/infrastructure/persistence/CodemationDatabaseUrlParser.ts +41 -0
  154. package/src/infrastructure/persistence/InMemoryTelemetryArtifactStore.ts +8 -3
  155. package/src/infrastructure/persistence/PrismaMigrationDeployer.ts +21 -13
  156. package/src/infrastructure/persistence/PrismaTelemetryArtifactStore.ts +43 -8
  157. package/src/infrastructure/persistence/PrismaWorkflowRunRepository.ts +26 -3
  158. package/src/infrastructure/persistence/PrismaWorkflowSnapshotRepository.ts +48 -0
  159. package/src/mcp/AgentMcpIntegrationImpl.ts +344 -0
  160. package/src/mcp/McpClientFactory.ts +29 -0
  161. package/src/mcp/McpConnectionPool.ts +184 -0
  162. package/src/mcp/McpConnectionPool.types.ts +12 -0
  163. package/src/mcp/McpServerCatalog.ts +104 -0
  164. package/src/mcp/index.ts +5 -0
  165. package/src/pairing/HmacRequestSigner.ts +32 -0
  166. package/src/pairing/IncomingHmacVerifier.ts +82 -0
  167. package/src/pairing/InternalHmacAuthMiddleware.ts +33 -0
  168. package/src/pairing/InternalPingRegistrar.ts +25 -0
  169. package/src/pairing/PairedFetch.ts +33 -0
  170. package/src/pairing/PairingConfigFactory.ts +35 -0
  171. package/src/pairing/PairingConfigToken.ts +6 -0
  172. package/src/pairing/index.ts +14 -0
  173. package/src/pairing/pairing.types.ts +18 -0
  174. package/src/pairing.ts +17 -0
  175. package/src/persistenceServer.ts +1 -0
  176. package/src/presentation/config/AppConfig.ts +7 -1
  177. package/src/presentation/config/CodemationAuthConfig.ts +1 -1
  178. package/src/presentation/config/CodemationAuthoring.types.ts +54 -5
  179. package/src/presentation/config/CodemationConfig.ts +3 -0
  180. package/src/presentation/config/CodemationConfigNormalizer.ts +39 -1
  181. package/src/presentation/config/CodemationPlugin.ts +2 -1
  182. package/src/presentation/frontend/CodemationFrontendAuthSnapshot.ts +5 -0
  183. package/src/presentation/frontend/CodemationFrontendAuthSnapshotFactory.ts +7 -1
  184. package/src/presentation/frontend/PublicFrontendBootstrap.ts +2 -0
  185. package/src/presentation/frontend/PublicFrontendBootstrapFactory.ts +5 -1
  186. package/src/presentation/frontend/PublicFrontendBootstrapJsonCodec.ts +4 -1
  187. package/src/presentation/http/ApiPaths.ts +4 -4
  188. package/src/presentation/http/ServerHttpErrorResponseFactory.ts +39 -2
  189. package/src/presentation/http/hono/CodemationHonoApiAppFactory.ts +33 -8
  190. package/src/presentation/http/hono/InternalHonoApiRouteRegistrar.ts +12 -0
  191. package/src/presentation/http/hono/registrars/ManagedMeHonoApiRouteRegistrar.ts +35 -0
  192. package/src/presentation/http/hono/registrars/OAuth2HonoApiRouteRegistrar.ts +2 -2
  193. package/src/presentation/http/routeHandlers/CredentialHttpRouteHandler.ts +28 -0
  194. package/src/presentation/http/routeHandlers/OAuth2HttpRouteHandlerFactory.ts +98 -41
  195. package/src/presentation/server/CodemationConsumerConfigLoader.ts +54 -7
  196. package/src/presentation/server/CodemationPluginDiscovery.ts +5 -0
  197. package/src/presentation/server/WorkflowDefinitionExportsResolver.ts +18 -0
  198. package/src/presentation/server/WorkflowModulePathFinder.ts +12 -1
  199. package/src/presentation/websocket/ManagedWebsocketAuthenticator.ts +50 -0
  200. package/src/presentation/websocket/WebsocketAuthenticator.types.ts +12 -0
  201. package/src/presentation/websocket/WorkflowWebsocketServer.ts +24 -3
  202. package/src/process/ExecaProcessRunner.ts +41 -0
  203. package/src/process/ProcessRunner.types.ts +39 -0
  204. package/src/server.ts +2 -0
  205. package/src/workflows/InternalWorkflowActivationRegistrar.ts +42 -0
  206. package/src/workflows/InternalWorkflowDetailRegistrar.ts +33 -0
  207. package/src/workflows/InternalWorkflowTestRunRegistrar.ts +91 -0
  208. package/src/workflows/InternalWorkflowsListRegistrar.ts +28 -0
  209. package/src/workflows/discovery/WorkflowDirectoryDiscoverer.ts +79 -0
  210. package/tsconfig.json +2 -0
  211. package/vitest.shared.ts +5 -0
  212. package/dist/ApiPaths-CLTHphYZ.js.map +0 -1
  213. package/dist/AppConfigFactory-C6q-CSKb.js.map +0 -1
  214. package/dist/AppContainerFactory-qaqc-R1D.js.map +0 -1
  215. package/dist/CodemationAuthoring.types-DZl-sJaM.js.map +0 -1
  216. package/dist/CodemationConsumerConfigLoader-BeAUS144.js.map +0 -1
  217. package/dist/CredentialServices-CgxwguAv.js.map +0 -1
  218. package/dist/PublicFrontendBootstrapFactory-Cb2pLmDd.d.ts +0 -45
  219. package/dist/PublicFrontendBootstrapJsonCodec-DzqvA0uo.js.map +0 -1
  220. package/dist/ServerLoggerFactory-BKSIh9Xv.js +0 -98
  221. package/dist/ServerLoggerFactory-BKSIh9Xv.js.map +0 -1
  222. package/dist/persistenceServer-vtJAGDat.d.ts +0 -9
  223. package/src/domain/credentials/OAuth2ConnectServiceFactory.ts +0 -411
package/dist/index.js CHANGED
@@ -1,18 +1,20 @@
1
- import { n as definePlugin, t as defineCodemationApp } from "./CodemationAuthoring.types-DZl-sJaM.js";
1
+ import { n as definePlugin, t as defineCodemationApp } from "./CodemationAuthoring.types-NGkBcmmT.js";
2
2
  import "./LogLevelPolicyFactory-DCUzIN6G.js";
3
- import { t as ApiPaths } from "./ApiPaths-CLTHphYZ.js";
4
- import { i as CodemationFrontendAuthSnapshotJsonCodec, n as InternalAuthBootstrapJsonCodec, r as FrontendAppConfigJsonCodec, t as PublicFrontendBootstrapJsonCodec } from "./PublicFrontendBootstrapJsonCodec-DzqvA0uo.js";
5
- import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-BeAUS144.js";
6
- import "./ServerLoggerFactory-BKSIh9Xv.js";
3
+ import { t as ApiPaths } from "./ApiPaths-Dv1dcHu_.js";
4
+ import { i as CodemationFrontendAuthSnapshotJsonCodec, n as InternalAuthBootstrapJsonCodec, r as FrontendAppConfigJsonCodec, t as PublicFrontendBootstrapJsonCodec } from "./PublicFrontendBootstrapJsonCodec-CegIF_ne.js";
5
+ import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-GYpBBvqE.js";
6
+ import { o as BootTimer } from "./ServerLoggerFactory-Ckk52S3w.js";
7
7
  import "./decorateParam-BWxkAUSj.js";
8
8
  import "./decorate-CXWmflG_.js";
9
- import { d as ApplicationTokens } from "./CredentialServices-CgxwguAv.js";
10
- import { D as CodemationFrontendAuthSnapshotFactory, E as FrontendAppConfigFactory, N as UpsertLocalBootstrapUserCommand, P as ListUserAccountsQuery, T as InternalAuthBootstrapFactory, a as GetCollectionQuery, c as InsertCollectionRowCommand, d as FrontendRuntime, f as CollectionSchemaSyncerHolder, i as GetCollectionRowQuery, l as DeleteCollectionRowCommand, m as AppContainerLifecycle, n as ListCollectionsQuery, o as UpdateCollectionRowCommand, p as DatabaseMigrations, r as ListCollectionRowsQuery, s as SyncCollectionsCommand, t as AppContainerFactory, u as WorkerRuntime, w as PublicFrontendBootstrapFactory } from "./AppContainerFactory-qaqc-R1D.js";
11
- import "./WorkflowPolicyUiPresentationFactory-DhPqQ9aB.js";
12
- import { n as CodemationPluginPackageMetadata, t as AppConfigFactory } from "./AppConfigFactory-C6q-CSKb.js";
13
- import { n as CodemationBootstrapRequest, t as CodemationPluginListMerger } from "./CodemationPluginListMerger-B-W5Fa_X.js";
14
- import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-CmsIKnO9.js";
15
- import { r as CodemationServerGateway } from "./server-CJFfY67o.js";
9
+ import { f as ApplicationRequestError, m as ApplicationTokens } from "./CredentialServices-Dk8yypeL.js";
10
+ import "./CodemationTsyringeTypeInfoRegistrar-Bj6FJYFz.js";
11
+ import { D as FrontendAppConfigFactory, E as InternalAuthBootstrapFactory, F as StartWorkflowRunCommand, I as UpsertLocalBootstrapUserCommand, L as ListUserAccountsQuery, N as GetRunStateQuery, O as CodemationFrontendAuthSnapshotFactory, T as PublicFrontendBootstrapFactory, a as GetCollectionQuery, c as InsertCollectionRowCommand, d as FrontendRuntime, f as CollectionSchemaSyncerHolder, i as GetCollectionRowQuery, l as DeleteCollectionRowCommand, m as AppContainerLifecycle, n as ListCollectionsQuery, o as UpdateCollectionRowCommand, p as DatabaseMigrations, r as ListCollectionRowsQuery, s as SyncCollectionsCommand, t as AppContainerFactory, u as WorkerRuntime } from "./AppContainerFactory-DqKYCRNP.js";
12
+ import "./WorkflowPolicyUiPresentationFactory-Bb-ae_Zh.js";
13
+ import "./InternalPingRegistrar-DY3kSfxP.js";
14
+ import { r as CodemationPluginPackageMetadata, t as AppConfigFactory } from "./AppConfigFactory-Cx4qQvRk.js";
15
+ import { n as CodemationBootstrapRequest, t as CodemationPluginListMerger } from "./CodemationPluginListMerger-D1B1IEbt.js";
16
+ import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-C-hH4z6l.js";
17
+ import { r as CodemationServerGateway } from "./server-Y7kxwtCK.js";
16
18
  import { workflow } from "@codemation/core-nodes";
17
19
 
18
- export { ApiPaths, AppConfigFactory, AppContainerFactory, AppContainerLifecycle, ApplicationTokens, CodemationBootstrapRequest, CodemationConsumerConfigLoader, CodemationFrontendAuthSnapshotFactory, CodemationFrontendAuthSnapshotJsonCodec, CodemationPluginListMerger, CodemationPluginPackageMetadata, CodemationPostgresPrismaClientFactory, CodemationServerGateway, CollectionSchemaSyncerHolder, DatabaseMigrations, DeleteCollectionRowCommand, FrontendAppConfigFactory, FrontendAppConfigJsonCodec, FrontendRuntime, GetCollectionQuery, GetCollectionRowQuery, InsertCollectionRowCommand, InternalAuthBootstrapFactory, InternalAuthBootstrapJsonCodec, ListCollectionRowsQuery, ListCollectionsQuery, ListUserAccountsQuery, PublicFrontendBootstrapFactory, PublicFrontendBootstrapJsonCodec, SyncCollectionsCommand, UpdateCollectionRowCommand, UpsertLocalBootstrapUserCommand, WorkerRuntime, defineCodemationApp, definePlugin, workflow };
20
+ export { ApiPaths, AppConfigFactory, AppContainerFactory, AppContainerLifecycle, ApplicationRequestError, ApplicationTokens, BootTimer, CodemationBootstrapRequest, CodemationConsumerConfigLoader, CodemationFrontendAuthSnapshotFactory, CodemationFrontendAuthSnapshotJsonCodec, CodemationPluginListMerger, CodemationPluginPackageMetadata, CodemationPostgresPrismaClientFactory, CodemationServerGateway, CollectionSchemaSyncerHolder, DatabaseMigrations, DeleteCollectionRowCommand, FrontendAppConfigFactory, FrontendAppConfigJsonCodec, FrontendRuntime, GetCollectionQuery, GetCollectionRowQuery, GetRunStateQuery, InsertCollectionRowCommand, InternalAuthBootstrapFactory, InternalAuthBootstrapJsonCodec, ListCollectionRowsQuery, ListCollectionsQuery, ListUserAccountsQuery, PublicFrontendBootstrapFactory, PublicFrontendBootstrapJsonCodec, StartWorkflowRunCommand, SyncCollectionsCommand, UpdateCollectionRowCommand, UpsertLocalBootstrapUserCommand, WorkerRuntime, defineCodemationApp, definePlugin, workflow };
package/dist/mapping.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import "./ItemsInputNormalizer-C-KHg9Mo.js";
2
- import { t as WorkflowPolicyUiPresentationFactory } from "./WorkflowPolicyUiPresentationFactory-DQEY-h_S.js";
1
+ import "./ItemsInputNormalizer-_RwIfRIQ.js";
2
+ import { t as WorkflowPolicyUiPresentationFactory } from "./WorkflowPolicyUiPresentationFactory-6MyjCvBO.js";
3
3
  export { WorkflowPolicyUiPresentationFactory };
package/dist/mapping.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as WorkflowPolicyUiPresentationFactory } from "./WorkflowPolicyUiPresentationFactory-DhPqQ9aB.js";
1
+ import { t as WorkflowPolicyUiPresentationFactory } from "./WorkflowPolicyUiPresentationFactory-Bb-ae_Zh.js";
2
2
 
3
3
  export { WorkflowPolicyUiPresentationFactory };
@@ -1,18 +1,20 @@
1
- import { t as RunIntentService } from "./index-BbBk26m0.js";
2
- import { Ct as CredentialTypeDefinition, E as WebhookInvocationMatch, F as BinaryAttachment, G as RunIdFactory, I as Item, J as WorkflowDefinition, P as ActivationIdFactory, _t as CredentialOAuth2AuthDefinition, o as BinaryStorage, w as WorkflowActivationPolicy } from "./ItemsInputNormalizer-C-KHg9Mo.js";
3
- import { r as AppConfig } from "./CodemationAppContext-DRu1Dpri.js";
4
- import { l as Logger, u as LoggerFactory } from "./CodemationWhitelabelConfig-CWbcyQqn.js";
5
- import { n as logLevelPolicyFactory, t as LogLevelPolicyFactory } from "./LogLevelPolicyFactory-CampWO0l.js";
6
- import { a as CodemationFrontendAuthSnapshot, i as CodemationFrontendAuthProviderSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-DzBgwOnG.js";
7
- import "./CodemationConfigNormalizer-DVko3cVN.js";
8
- import { a as CredentialInstanceService, c as CredentialSecretCipher, i as CredentialBindingService, l as CredentialFieldEnvOverlayService, o as CredentialOAuth2ScopeResolver, r as CredentialRuntimeMaterialService, s as CredentialMaterialResolver, t as CredentialStore, u as CredentialTypeRegistryImpl } from "./CredentialServices-UfvHB-rN.js";
9
- import "./CredentialContractsRegistry-DrMIDSw8.js";
10
- import "./TelemetryContracts-DbaNomrH.js";
11
- import { i as WorkflowSummary, t as WorkflowDto } from "./WorkflowViewContracts-CzK2KFuz.js";
12
- import { _ as WorkflowWebsocketServer, a as WorkflowDebuggerOverlayRepository, b as CommandBus, c as FrontendRuntime, d as LogFilter, f as WorkflowRunRepository, g as AppContainerFactory, h as AppContainerLifecycle, i as HonoApiRouteRegistrar, l as WorkflowRunRetentionPruneScheduler, m as DatabaseMigrations, n as CodemationBootstrapRequest, o as SessionVerifier, r as ApplicationTokens, s as WorkerRuntime, t as CodemationPluginListMerger, u as ServerLoggerFactory, v as QueryBus } from "./CodemationPluginListMerger-DGc-jfa2.js";
13
- import { t as AppConfigFactory } from "./AppConfigFactory-YnveXE9k.js";
14
- import { n as InternalAuthBootstrapFactory, r as FrontendAppConfigFactory, t as PublicFrontendBootstrapFactory } from "./PublicFrontendBootstrapFactory-Cb2pLmDd.js";
15
- import { t as WorkflowPolicyUiPresentationFactory } from "./WorkflowPolicyUiPresentationFactory-DQEY-h_S.js";
1
+ import { n as RunIntentService, t as OAuthFlowExecutor } from "./index-DilAYwnH.js";
2
+ import { D as WebhookInvocationMatch, F as ActivationIdFactory, I as BinaryAttachment, L as Item, X as WorkflowDefinition, o as BinaryStorage, q as RunIdFactory, w as WorkflowActivationPolicy } from "./ItemsInputNormalizer-_RwIfRIQ.js";
3
+ import { r as AppConfig } from "./CodemationAppContext-CKVv9W9q.js";
4
+ import { l as Logger, u as LoggerFactory } from "./CodemationWhitelabelConfig-Ca2mCUeC.js";
5
+ import { n as logLevelPolicyFactory, t as LogLevelPolicyFactory } from "./LogLevelPolicyFactory-ewCHLDLn.js";
6
+ import { a as CodemationFrontendAuthSnapshot, i as CodemationFrontendAuthProviderSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-Cev3qK46.js";
7
+ import "./CodemationConfigNormalizer-BAKjetJ6.js";
8
+ import { a as CredentialSecretCipher, i as CredentialInstanceService, o as McpServerCatalog, r as CredentialBindingService, t as CredentialStore } from "./CredentialServices-Be2I60Th.js";
9
+ import "./CredentialContractsRegistry-Bq2bq28t.js";
10
+ import "./TelemetryContracts-BtDx84Cp.js";
11
+ import { i as WorkflowSummary, t as WorkflowDto } from "./WorkflowViewContracts-B7aFQcIw.js";
12
+ import { _ as AppContainerFactory, a as HonoApiRouteRegistrar, c as WorkerRuntime, d as ServerLoggerFactory, f as LogFilter, g as AppContainerLifecycle, h as DatabaseMigrations, i as ManagedCorsMiddleware, l as FrontendRuntime, n as CodemationBootstrapRequest, o as WorkflowDebuggerOverlayRepository, p as WorkflowRunRepository, r as ApplicationTokens, s as SessionVerifier, t as CodemationPluginListMerger, u as WorkflowRunRetentionPruneScheduler, v as WorkflowWebsocketServer, x as CommandBus, y as QueryBus } from "./CodemationPluginListMerger-DKLAHT2b.js";
13
+ import { t as AppConfigFactory } from "./AppConfigFactory-DnLoQ9Li.js";
14
+ import { n as InternalAuthBootstrapFactory, r as FrontendAppConfigFactory, t as PublicFrontendBootstrapFactory } from "./PublicFrontendBootstrapFactory-CY2FS-5g.js";
15
+ import { t as InternalHonoApiRouteRegistrar } from "./InternalHonoApiRouteRegistrar-Ce1yxpnO.js";
16
+ import { t as WorkflowPolicyUiPresentationFactory } from "./WorkflowPolicyUiPresentationFactory-6MyjCvBO.js";
17
+ import { t as PairingConfig } from "./pairing.types-snfZ_OzB.js";
16
18
  import { Hono } from "hono";
17
19
 
18
20
  //#region src/application/dev/DevBootstrapSummaryJson.types.d.ts
@@ -91,7 +93,8 @@ interface DataMapper<TSource, TTarget> {
91
93
  declare class WorkflowDefinitionMapper implements DataMapper<WorkflowDefinition, WorkflowDto> {
92
94
  private readonly policyUi;
93
95
  private readonly workflowActivationPolicy;
94
- constructor(policyUi: WorkflowPolicyUiPresentationFactory, workflowActivationPolicy: WorkflowActivationPolicy);
96
+ private readonly mcpCatalog;
97
+ constructor(policyUi: WorkflowPolicyUiPresentationFactory, workflowActivationPolicy: WorkflowActivationPolicy, mcpCatalog: McpServerCatalog);
95
98
  map(workflow: WorkflowDefinition): Promise<WorkflowDto>;
96
99
  mapSync(workflow: WorkflowDefinition): WorkflowDto;
97
100
  toSummary(workflow: WorkflowDefinition): WorkflowSummary;
@@ -109,6 +112,7 @@ declare class WorkflowDefinitionMapper implements DataMapper<WorkflowDefinition,
109
112
  * Omit optional port fields when undefined so persisted snapshot DTOs (which never serialize
110
113
  * undefined keys) stay aligned with live workflow mapping.
111
114
  */
115
+ private readInspectorSummary;
112
116
  private nodePortFieldsFromConfig;
113
117
  private nodeTypeName;
114
118
  }
@@ -148,7 +152,7 @@ declare class BinaryHttpRouteHandler {
148
152
  //#region src/presentation/http/hono/CodemationHonoApiAppFactory.d.ts
149
153
  declare class CodemationHonoApiApp {
150
154
  private readonly app;
151
- constructor(sessionVerifier: SessionVerifier, registrars: ReadonlyArray<HonoApiRouteRegistrar>, binaryHttpRouteHandler: BinaryHttpRouteHandler);
155
+ constructor(sessionVerifier: SessionVerifier, registrars: ReadonlyArray<HonoApiRouteRegistrar>, binaryHttpRouteHandler: BinaryHttpRouteHandler, internalRegistrars: ReadonlyArray<InternalHonoApiRouteRegistrar>, corsMiddlewareList: ReadonlyArray<ManagedCorsMiddleware>);
152
156
  getHono(): Hono;
153
157
  fetch(request: Request): Response | Promise<Response>;
154
158
  }
@@ -157,7 +161,9 @@ declare class CodemationHonoApiApp {
157
161
  declare class CredentialHttpRouteHandler {
158
162
  private readonly queryBus;
159
163
  private readonly commandBus;
160
- constructor(queryBus: QueryBus, commandBus: CommandBus);
164
+ private readonly sessionVerifier;
165
+ private readonly pairingConfig;
166
+ constructor(queryBus: QueryBus, commandBus: CommandBus, sessionVerifier: SessionVerifier, pairingConfig: PairingConfig | null);
161
167
  getCredentialTypes(): Promise<Response>;
162
168
  getCredentialFieldEnvStatus(): Promise<Response>;
163
169
  getCredentialInstances(): Promise<Response>;
@@ -170,87 +176,36 @@ declare class CredentialHttpRouteHandler {
170
176
  getWorkflowCredentialHealth(_: Request, params: ServerHttpRouteParams): Promise<Response>;
171
177
  }
172
178
  //#endregion
173
- //#region src/domain/credentials/OAuth2ProviderRegistry.d.ts
174
- type JsonRecord = Readonly<Record<string, unknown>>;
175
- type OAuth2ResolvedProvider = Readonly<{
176
- providerId: string;
177
- authorizeUrl: string;
178
- tokenUrl: string;
179
- userInfoUrl?: string;
180
- }>;
181
- declare class OAuth2ProviderRegistry {
182
- private static readonly googleProvider;
183
- resolve(definition: CredentialTypeDefinition, publicConfig: JsonRecord): OAuth2ResolvedProvider;
184
- resolveClientId(auth: CredentialOAuth2AuthDefinition, publicConfig: JsonRecord): string;
185
- resolveClientSecretFieldKey(auth: CredentialOAuth2AuthDefinition): string;
186
- private resolveBuiltInProvider;
187
- private resolveTemplateProvider;
188
- private expandTemplate;
189
- private resolvePublicConfigProvider;
190
- }
191
- //#endregion
192
- //#region src/domain/credentials/OAuth2ConnectServiceFactory.d.ts
193
- type OAuth2AuthRedirectResult = Readonly<{
194
- instanceId: string;
195
- redirectUri: string;
196
- redirectUrl: string;
197
- }>;
198
- type OAuth2CallbackResult = Readonly<{
199
- instanceId: string;
200
- connectedEmail?: string;
201
- }>;
202
- declare class OAuth2ConnectService {
203
- private readonly credentialStore;
204
- private readonly credentialInstanceService;
205
- private readonly credentialTypeRegistry;
206
- private readonly credentialRuntimeMaterialService;
207
- private readonly credentialFieldEnvOverlayService;
208
- private readonly credentialMaterialResolver;
209
- private readonly credentialSecretCipher;
210
- private readonly credentialOAuth2ScopeResolver;
211
- private readonly oauth2ProviderRegistry;
179
+ //#region src/domain/credentials/OAuth2RedirectUriResolver.d.ts
180
+ /**
181
+ * Resolves the canonical OAuth2 redirect URI from the public base URL or request origin.
182
+ * The redirect URI always points to `/api/oauth2/callback`, which is the URL operators
183
+ * register with their OAuth provider.
184
+ */
185
+ declare class OAuth2RedirectUriResolver {
212
186
  private readonly appConfig;
213
- private static readonly stateTtlMs;
214
- constructor(credentialStore: CredentialStore, credentialInstanceService: CredentialInstanceService, credentialTypeRegistry: CredentialTypeRegistryImpl, credentialRuntimeMaterialService: CredentialRuntimeMaterialService, credentialFieldEnvOverlayService: CredentialFieldEnvOverlayService, credentialMaterialResolver: CredentialMaterialResolver, credentialSecretCipher: CredentialSecretCipher, credentialOAuth2ScopeResolver: CredentialOAuth2ScopeResolver, oauth2ProviderRegistry: OAuth2ProviderRegistry, appConfig: AppConfig);
215
- createAuthRedirect(instanceId: string, requestOrigin: string): Promise<OAuth2AuthRedirectResult>;
216
- handleCallback(args: Readonly<{
217
- code?: string | null;
218
- state?: string | null;
219
- requestOrigin: string;
220
- }>): Promise<OAuth2CallbackResult>;
221
- getRedirectUri(requestOrigin: string): string;
187
+ constructor(appConfig: AppConfig);
188
+ resolve(requestOrigin: string): string;
222
189
  /**
223
- * `new URL(path, base)` requires `base` to be an absolute URL with a scheme.
224
- * Misconfigured CODEMATION_PUBLIC_BASE_URL (e.g. `localhost:3000` without http://) or odd
225
- * forwarded headers otherwise throw TypeError: Invalid URL.
226
- *
227
- * Comma-separated values (proxy chains or copy-paste mistakes like `http,http`) use the
228
- * first segment only; obviously invalid hostnames are rejected.
190
+ * Ensures the base URL has an http/https scheme. Comma-separated values (proxy chains) use
191
+ * the first segment only.
229
192
  */
230
- private ensureAbsoluteUrlForOAuth2Base;
231
- private requireOAuth2Type;
232
- private exchangeAuthorizationCode;
233
- private mergeTokenMaterial;
234
- private resolveExpiry;
235
- private resolveGrantedScopes;
236
- private resolveConnectedEmail;
237
- private findEmail;
238
- private parseJsonRecord;
239
- private createTokenExchangeErrorMessage;
240
- private createOpaqueValue;
241
- private createPkceCodeChallenge;
193
+ private ensureAbsoluteUrl;
242
194
  private normalizeBaseUrl;
243
195
  }
244
196
  //#endregion
245
197
  //#region src/presentation/http/routeHandlers/OAuth2HttpRouteHandlerFactory.d.ts
246
198
  declare class OAuth2HttpRouteHandler {
247
- private readonly oauth2ConnectService;
199
+ private readonly redirectUriResolver;
248
200
  private readonly credentialInstanceService;
249
- constructor(oauth2ConnectService: OAuth2ConnectService, credentialInstanceService: CredentialInstanceService);
250
- getAuthRedirect(request: Request): Promise<Response>;
251
- getCallback(request: Request): Promise<Response>;
201
+ private readonly oauthFlowExecutor;
202
+ private readonly credentialStore;
203
+ private readonly credentialSecretCipher;
204
+ constructor(redirectUriResolver: OAuth2RedirectUriResolver, credentialInstanceService: CredentialInstanceService, oauthFlowExecutor: OAuthFlowExecutor, credentialStore: CredentialStore, credentialSecretCipher: CredentialSecretCipher);
252
205
  getRedirectUri(request: Request): Promise<Response>;
253
206
  postDisconnect(request: Request): Promise<Response>;
207
+ postOAuthStart(request: Request): Promise<Response>;
208
+ getOAuthCallback(request: Request): Promise<Response>;
254
209
  private resolveRequestOrigin;
255
210
  /** Proxies may send comma-separated lists (chain); use the first host/proto only. */
256
211
  private static firstCommaSeparatedValue;
@@ -1,12 +1,14 @@
1
1
  import { n as logLevelPolicyFactory, t as LogLevelPolicyFactory } from "./LogLevelPolicyFactory-DCUzIN6G.js";
2
- import "./ApiPaths-CLTHphYZ.js";
3
- import { a as FilteringLogger, i as PerformanceLogPolicy, n as PerformanceLogPolicyFactory, r as performanceLogPolicyFactory, t as ServerLoggerFactory } from "./ServerLoggerFactory-BKSIh9Xv.js";
2
+ import "./ApiPaths-Dv1dcHu_.js";
3
+ import { a as FilteringLogger, i as PerformanceLogPolicy, n as PerformanceLogPolicyFactory, r as performanceLogPolicyFactory, t as ServerLoggerFactory } from "./ServerLoggerFactory-Ckk52S3w.js";
4
4
  import "./decorateParam-BWxkAUSj.js";
5
5
  import "./decorate-CXWmflG_.js";
6
- import { a as CredentialInstanceService, d as ApplicationTokens, i as CredentialBindingService } from "./CredentialServices-CgxwguAv.js";
7
- import { C as BinaryHttpRouteHandler, E as FrontendAppConfigFactory, M as RunBinaryAttachmentLookupService, O as WorkflowWebsocketServer, S as CodemationHonoApiApp, T as InternalAuthBootstrapFactory, _ as WebhookHttpRouteHandler, b as OAuth2HttpRouteHandler, d as FrontendRuntime, g as WorkflowHttpRouteHandler, h as WorkflowRunRetentionPruneScheduler, k as WorkflowDefinitionMapper, m as AppContainerLifecycle, p as DatabaseMigrations, t as AppContainerFactory, u as WorkerRuntime, v as RequestToWebhookItemMapper, w as PublicFrontendBootstrapFactory, x as CredentialHttpRouteHandler, y as RunHttpRouteHandler } from "./AppContainerFactory-qaqc-R1D.js";
8
- import { t as WorkflowPolicyUiPresentationFactory } from "./WorkflowPolicyUiPresentationFactory-DhPqQ9aB.js";
9
- import { t as AppConfigFactory } from "./AppConfigFactory-C6q-CSKb.js";
10
- import { n as CodemationBootstrapRequest, t as CodemationPluginListMerger } from "./CodemationPluginListMerger-B-W5Fa_X.js";
6
+ import { a as CredentialInstanceService, i as CredentialBindingService, m as ApplicationTokens } from "./CredentialServices-Dk8yypeL.js";
7
+ import "./CodemationTsyringeTypeInfoRegistrar-Bj6FJYFz.js";
8
+ import { A as WorkflowDefinitionMapper, C as CodemationHonoApiApp, D as FrontendAppConfigFactory, E as InternalAuthBootstrapFactory, P as RunBinaryAttachmentLookupService, S as CredentialHttpRouteHandler, T as PublicFrontendBootstrapFactory, _ as WorkflowHttpRouteHandler, b as RunHttpRouteHandler, d as FrontendRuntime, h as WorkflowRunRetentionPruneScheduler, k as WorkflowWebsocketServer, m as AppContainerLifecycle, p as DatabaseMigrations, t as AppContainerFactory, u as WorkerRuntime, v as WebhookHttpRouteHandler, w as BinaryHttpRouteHandler, x as OAuth2HttpRouteHandler, y as RequestToWebhookItemMapper } from "./AppContainerFactory-DqKYCRNP.js";
9
+ import { t as WorkflowPolicyUiPresentationFactory } from "./WorkflowPolicyUiPresentationFactory-Bb-ae_Zh.js";
10
+ import "./InternalPingRegistrar-DY3kSfxP.js";
11
+ import { t as AppConfigFactory } from "./AppConfigFactory-Cx4qQvRk.js";
12
+ import { n as CodemationBootstrapRequest, t as CodemationPluginListMerger } from "./CodemationPluginListMerger-D1B1IEbt.js";
11
13
 
12
14
  export { AppConfigFactory, AppContainerFactory, AppContainerLifecycle, ApplicationTokens, BinaryHttpRouteHandler, CodemationBootstrapRequest, CodemationHonoApiApp, CodemationPluginListMerger, CredentialBindingService, CredentialHttpRouteHandler, CredentialInstanceService, DatabaseMigrations, FilteringLogger, FrontendAppConfigFactory, FrontendRuntime, InternalAuthBootstrapFactory, LogLevelPolicyFactory, OAuth2HttpRouteHandler, PerformanceLogPolicy, PerformanceLogPolicyFactory, PublicFrontendBootstrapFactory, RequestToWebhookItemMapper, RunBinaryAttachmentLookupService, RunHttpRouteHandler, ServerLoggerFactory, WebhookHttpRouteHandler, WorkerRuntime, WorkflowDefinitionMapper, WorkflowHttpRouteHandler, WorkflowPolicyUiPresentationFactory, WorkflowRunRetentionPruneScheduler, WorkflowWebsocketServer, logLevelPolicyFactory, performanceLogPolicyFactory };
@@ -0,0 +1,93 @@
1
+ import "./index-DilAYwnH.js";
2
+ import { g as TypeToken } from "./ItemsInputNormalizer-_RwIfRIQ.js";
3
+ import { t as InternalHonoApiRouteRegistrar } from "./InternalHonoApiRouteRegistrar-Ce1yxpnO.js";
4
+ import { i as PairingVerificationSuccess, n as PairingVerificationFailure, r as PairingVerificationResult, t as PairingConfig } from "./pairing.types-snfZ_OzB.js";
5
+ import { Hono, MiddlewareHandler } from "hono";
6
+
7
+ //#region src/pairing/HmacRequestSigner.d.ts
8
+ interface SignedHeaders {
9
+ readonly Authorization: string;
10
+ }
11
+ declare class HmacRequestSigner {
12
+ private readonly config;
13
+ constructor(config: PairingConfig);
14
+ sign(method: string, urlOrPath: string, body: string): SignedHeaders;
15
+ }
16
+ //#endregion
17
+ //#region src/pairing/PairedFetch.d.ts
18
+ /**
19
+ * Thin fetch wrapper that automatically HMAC-signs outgoing requests
20
+ * to the control plane using the workspace's pairing secret.
21
+ *
22
+ * Use this for any server-to-server request from the installation to the CP.
23
+ */
24
+ declare class PairedFetch {
25
+ private readonly signer;
26
+ constructor(signer: HmacRequestSigner);
27
+ get(url: string): Promise<Response>;
28
+ post(url: string, body: unknown): Promise<Response>;
29
+ delete(url: string): Promise<Response>;
30
+ }
31
+ //#endregion
32
+ //#region src/pairing/IncomingHmacVerifier.d.ts
33
+ /**
34
+ * Verifies incoming HMAC-signed requests from the control plane.
35
+ * Mirrors the control-plane HmacVerifier — both sides follow docs/pairing-protocol.md.
36
+ */
37
+ declare class IncomingHmacVerifier {
38
+ private readonly config;
39
+ private readonly usedNonces;
40
+ private readonly nonceTtlSeconds;
41
+ constructor(config: PairingConfig);
42
+ verify(method: string, url: string, body: string, authHeader: string | null): PairingVerificationResult;
43
+ private parseHeader;
44
+ private pruneExpiredNonces;
45
+ }
46
+ //#endregion
47
+ //#region src/pairing/InternalHmacAuthMiddleware.d.ts
48
+ /**
49
+ * Hono middleware that verifies HMAC-signed requests on /internal/* routes.
50
+ * Rejects with 401 on any auth failure (failure mode is never leaked).
51
+ *
52
+ * Downstream handlers read the consumed body from `c.get("body")` when needed —
53
+ * do NOT call `c.req.text()` again after this middleware runs.
54
+ */
55
+ declare class InternalHmacAuthMiddleware {
56
+ private readonly verifier;
57
+ constructor(verifier: IncomingHmacVerifier);
58
+ handle(): MiddlewareHandler;
59
+ }
60
+ //#endregion
61
+ //#region src/pairing/InternalPingRegistrar.d.ts
62
+ /**
63
+ * Registers GET /internal/ping — a smoke-test endpoint for verifying workspace pairing.
64
+ * Returns { pong: true, workspaceId } when the HMAC signature validates correctly.
65
+ */
66
+ declare class InternalPingRegistrar implements InternalHonoApiRouteRegistrar {
67
+ private readonly hmacMiddleware;
68
+ private readonly pairingConfig;
69
+ constructor(hmacMiddleware: InternalHmacAuthMiddleware, pairingConfig: PairingConfig);
70
+ register(app: Hono): void;
71
+ }
72
+ //#endregion
73
+ //#region src/pairing/PairingConfigFactory.d.ts
74
+ /**
75
+ * Reads pairing configuration from environment variables.
76
+ *
77
+ * Required env vars when pairing is enabled:
78
+ * WORKSPACE_ID — the workspace's database ID
79
+ * WORKSPACE_PAIRING_SECRET — base64-encoded 32-byte shared secret
80
+ * CONTROL_PLANE_URL — base URL of the control plane API
81
+ *
82
+ * Returns null if any required variable is absent (pairing disabled).
83
+ * See docs/pairing-protocol.md for full bootstrap instructions.
84
+ */
85
+ declare class PairingConfigFactory {
86
+ create(env: Readonly<NodeJS.ProcessEnv>): PairingConfig | null;
87
+ }
88
+ //#endregion
89
+ //#region src/pairing/PairingConfigToken.d.ts
90
+ declare const PairingConfigToken: TypeToken<PairingConfig>;
91
+ //#endregion
92
+ export { HmacRequestSigner, IncomingHmacVerifier, InternalHmacAuthMiddleware, InternalPingRegistrar, PairedFetch, type PairingConfig, PairingConfigFactory, PairingConfigToken, type PairingVerificationFailure, type PairingVerificationResult, type PairingVerificationSuccess, type SignedHeaders };
93
+ //# sourceMappingURL=pairing.d.ts.map
@@ -0,0 +1,5 @@
1
+ import "./decorateParam-BWxkAUSj.js";
2
+ import "./decorate-CXWmflG_.js";
3
+ import { a as PairedFetch, i as PairingConfigFactory, n as InternalHmacAuthMiddleware, o as HmacRequestSigner, r as IncomingHmacVerifier, s as PairingConfigToken, t as InternalPingRegistrar } from "./InternalPingRegistrar-DY3kSfxP.js";
4
+
5
+ export { HmacRequestSigner, IncomingHmacVerifier, InternalHmacAuthMiddleware, InternalPingRegistrar, PairedFetch, PairingConfigFactory, PairingConfigToken };
@@ -0,0 +1,19 @@
1
+ //#region src/pairing/pairing.types.d.ts
2
+ interface PairingConfig {
3
+ /** The workspace's database ID. */
4
+ readonly workspaceId: string;
5
+ /** Base64-encoded 32-byte raw secret shared with the control plane. */
6
+ readonly pairingSecret: string;
7
+ /** Base URL of the control plane API, e.g. https://api.codemation.io */
8
+ readonly controlPlaneUrl: string;
9
+ }
10
+ type PairingVerificationFailure = {
11
+ readonly failure: "missing" | "version" | "expired" | "workspace" | "signature" | "replay";
12
+ };
13
+ type PairingVerificationSuccess = {
14
+ readonly workspaceId: string;
15
+ };
16
+ type PairingVerificationResult = PairingVerificationSuccess | PairingVerificationFailure;
17
+ //#endregion
18
+ export { PairingVerificationSuccess as i, PairingVerificationFailure as n, PairingVerificationResult as r, PairingConfig as t };
19
+ //# sourceMappingURL=pairing.types-snfZ_OzB.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { i as __toESM } from "./chunk-7V6ThxGB.js";
2
- import { i as require_client } from "./AppConfigFactory-C6q-CSKb.js";
2
+ import { a as require_client } from "./AppConfigFactory-Cx4qQvRk.js";
3
3
  import { PrismaPg } from "@prisma/adapter-pg";
4
4
 
5
5
  //#region src/infrastructure/persistence/CodemationPostgresPrismaClientFactory.ts
@@ -12,4 +12,4 @@ var CodemationPostgresPrismaClientFactory = class {
12
12
 
13
13
  //#endregion
14
14
  export { CodemationPostgresPrismaClientFactory as t };
15
- //# sourceMappingURL=persistenceServer-CmsIKnO9.js.map
15
+ //# sourceMappingURL=persistenceServer-C-hH4z6l.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"persistenceServer-CmsIKnO9.js","names":["PrismaClient"],"sources":["../src/infrastructure/persistence/CodemationPostgresPrismaClientFactory.ts"],"sourcesContent":["import { PrismaPg } from \"@prisma/adapter-pg\";\nimport { PrismaClient } from \"../../../prisma-generated/prisma-postgresql-client/client.js\";\n\nexport class CodemationPostgresPrismaClientFactory {\n static create(databaseUrl: string): PrismaClient {\n const adapter = new PrismaPg({ connectionString: databaseUrl });\n return new PrismaClient({ adapter });\n }\n}\n"],"mappings":";;;;;;AAGA,IAAa,wCAAb,MAAmD;CACjD,OAAO,OAAO,aAAmC;AAE/C,SAAO,IAAIA,2BAAa,EAAE,SADV,IAAI,SAAS,EAAE,kBAAkB,aAAa,CAAC,EAC5B,CAAC"}
1
+ {"version":3,"file":"persistenceServer-C-hH4z6l.js","names":["PrismaClient"],"sources":["../src/infrastructure/persistence/CodemationPostgresPrismaClientFactory.ts"],"sourcesContent":["import { PrismaPg } from \"@prisma/adapter-pg\";\nimport { PrismaClient } from \"../../../prisma-generated/prisma-postgresql-client/client.js\";\n\nexport class CodemationPostgresPrismaClientFactory {\n static create(databaseUrl: string): PrismaClient {\n const adapter = new PrismaPg({ connectionString: databaseUrl });\n return new PrismaClient({ adapter });\n }\n}\n"],"mappings":";;;;;;AAGA,IAAa,wCAAb,MAAmD;CACjD,OAAO,OAAO,aAAmC;AAE/C,SAAO,IAAIA,2BAAa,EAAE,SADV,IAAI,SAAS,EAAE,kBAAkB,aAAa,CAAC,EAC5B,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { i as AppPersistenceConfig } from "./CodemationAppContext-CKVv9W9q.js";
2
+ import { i as PrismaClient } from "./AppConfigFactory-DnLoQ9Li.js";
3
+
4
+ //#region src/infrastructure/persistence/CodemationPostgresPrismaClientFactory.d.ts
5
+ declare class CodemationPostgresPrismaClientFactory {
6
+ static create(databaseUrl: string): PrismaClient;
7
+ }
8
+ //#endregion
9
+ //#region src/infrastructure/persistence/CodemationDatabaseUrlParser.d.ts
10
+ /**
11
+ * Parses `CODEMATION_DATABASE_URL` into an {@link AppPersistenceConfig}.
12
+ *
13
+ * Supported schemes (case-insensitive):
14
+ * - `sqlite://relative/path/to/file.db` → resolved relative to consumerRoot
15
+ * - `sqlite:///absolute/path/to/file.db` → leading slash = POSIX absolute
16
+ * - `sqlite://C:/path/file.db` → Windows-style absolute (path.isAbsolute()
17
+ * returns true for these)
18
+ * - `pgsql://user:pass@host:5432/dbname` → normalised to postgresql://
19
+ * - `postgresql://user:pass@host:5432/db` → pass-through (Prisma's expected scheme)
20
+ * - `postgres://user:pass@host:5432/db` → pass-through (common alias)
21
+ *
22
+ * Throws on any other scheme. Empty / whitespace input is also an error — callers
23
+ * should default before calling parse().
24
+ */
25
+ declare class CodemationDatabaseUrlParser {
26
+ parse(url: string, consumerRoot: string): AppPersistenceConfig;
27
+ }
28
+ //#endregion
29
+ export { CodemationPostgresPrismaClientFactory as n, CodemationDatabaseUrlParser as t };
30
+ //# sourceMappingURL=persistenceServer-CeTHtC6E.d.ts.map
@@ -1,8 +1,8 @@
1
- import "./index-BbBk26m0.js";
2
- import "./ItemsInputNormalizer-C-KHg9Mo.js";
3
- import { i as AppPersistenceConfig } from "./CodemationAppContext-DRu1Dpri.js";
4
- import "./CodemationWhitelabelConfig-CWbcyQqn.js";
5
- import "./CodemationConfigNormalizer-DVko3cVN.js";
6
- import { n as PrismaMigrationDeployer, r as PrismaDatabaseClient, t as AppConfigFactory } from "./AppConfigFactory-YnveXE9k.js";
7
- import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-vtJAGDat.js";
8
- export { AppConfigFactory, AppPersistenceConfig, CodemationPostgresPrismaClientFactory, PrismaDatabaseClient as PrismaClient, PrismaMigrationDeployer };
1
+ import "./index-DilAYwnH.js";
2
+ import "./ItemsInputNormalizer-_RwIfRIQ.js";
3
+ import { i as AppPersistenceConfig } from "./CodemationAppContext-CKVv9W9q.js";
4
+ import "./CodemationWhitelabelConfig-Ca2mCUeC.js";
5
+ import "./CodemationConfigNormalizer-BAKjetJ6.js";
6
+ import { n as PrismaMigrationDeployer, r as PrismaDatabaseClient, t as AppConfigFactory } from "./AppConfigFactory-DnLoQ9Li.js";
7
+ import { n as CodemationPostgresPrismaClientFactory, t as CodemationDatabaseUrlParser } from "./persistenceServer-CeTHtC6E.js";
8
+ export { AppConfigFactory, AppPersistenceConfig, CodemationDatabaseUrlParser, CodemationPostgresPrismaClientFactory, PrismaDatabaseClient as PrismaClient, PrismaMigrationDeployer };
@@ -1,5 +1,5 @@
1
1
  import "./decorate-CXWmflG_.js";
2
- import { r as PrismaMigrationDeployer, t as AppConfigFactory } from "./AppConfigFactory-C6q-CSKb.js";
3
- import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-CmsIKnO9.js";
2
+ import { i as PrismaMigrationDeployer, n as CodemationDatabaseUrlParser, t as AppConfigFactory } from "./AppConfigFactory-Cx4qQvRk.js";
3
+ import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-C-hH4z6l.js";
4
4
 
5
- export { AppConfigFactory, CodemationPostgresPrismaClientFactory, PrismaMigrationDeployer };
5
+ export { AppConfigFactory, CodemationDatabaseUrlParser, CodemationPostgresPrismaClientFactory, PrismaMigrationDeployer };
@@ -1,8 +1,23 @@
1
- import { m as CodemationConfig, o as CodemationPlugin, r as AppConfig } from "./CodemationAppContext-DRu1Dpri.js";
2
- import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-DJWr86f-.js";
3
- import { i as WorkflowSummary, t as WorkflowDto } from "./WorkflowViewContracts-CzK2KFuz.js";
4
- import { t as AppConfigFactory } from "./AppConfigFactory-YnveXE9k.js";
1
+ import { m as CodemationConfig, o as CodemationPlugin, r as AppConfig } from "./CodemationAppContext-CKVv9W9q.js";
2
+ import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-nxOqvv46.js";
3
+ import { i as WorkflowSummary, t as WorkflowDto } from "./WorkflowViewContracts-B7aFQcIw.js";
4
+ import { t as AppConfigFactory } from "./AppConfigFactory-DnLoQ9Li.js";
5
+ import { a as ProcessRunOptions, o as ProcessRunResult, s as ProcessRunner } from "./PublicFrontendBootstrapFactory-CY2FS-5g.js";
6
+ import { ChildProcess } from "node:child_process";
5
7
 
8
+ //#region src/process/ExecaProcessRunner.d.ts
9
+ /**
10
+ * Production {@link ProcessRunner}. Defers cross-platform executable resolution (`pnpm` ↔ `pnpm.cmd`,
11
+ * `.cmd` / `.bat` / `.ps1` shims on Windows) and argument quoting to execa so call sites stop having
12
+ * to hand-roll platform conditionals.
13
+ */
14
+ declare class ExecaProcessRunner implements ProcessRunner {
15
+ spawn(command: string, args: ReadonlyArray<string>, options?: ProcessRunOptions): ChildProcess;
16
+ runSync(command: string, args: ReadonlyArray<string>, options?: ProcessRunOptions): ProcessRunResult;
17
+ private toExecaOptions;
18
+ private toExecaSyncOptions;
19
+ }
20
+ //#endregion
6
21
  //#region src/presentation/http/CodemationServerGatewayFactory.d.ts
7
22
  declare class CodemationServerGateway {
8
23
  private readonly config;
@@ -88,5 +103,5 @@ declare class WorkflowDiscoveryPathSegmentsComputer {
88
103
  }>): readonly string[] | undefined;
89
104
  }
90
105
  //#endregion
91
- export { CodemationResolvedPluginPackage as a, CodemationServerGateway as c, CodemationPluginDiscovery as i, WorkflowModulePathFinder as n, AppConfigLoadResult as o, CodemationDiscoveredPluginPackage as r, AppConfigLoader as s, WorkflowDiscoveryPathSegmentsComputer as t };
92
- //# sourceMappingURL=server-MUNGsBYK.d.ts.map
106
+ export { CodemationResolvedPluginPackage as a, CodemationServerGateway as c, CodemationPluginDiscovery as i, ExecaProcessRunner as l, WorkflowModulePathFinder as n, AppConfigLoadResult as o, CodemationDiscoveredPluginPackage as r, AppConfigLoader as s, WorkflowDiscoveryPathSegmentsComputer as t };
107
+ //# sourceMappingURL=server-C4bS62rg.d.ts.map
@@ -1,7 +1,7 @@
1
- import { a as CodemationConfigNormalizer, t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-BeAUS144.js";
2
- import { d as ApplicationTokens } from "./CredentialServices-CgxwguAv.js";
3
- import { A as GetWorkflowSummariesQuery, S as CodemationHonoApiApp, d as FrontendRuntime, j as GetWorkflowDetailQuery, k as WorkflowDefinitionMapper, m as AppContainerLifecycle, t as AppContainerFactory } from "./AppContainerFactory-qaqc-R1D.js";
4
- import { n as CodemationPluginPackageMetadata, t as AppConfigFactory } from "./AppConfigFactory-C6q-CSKb.js";
1
+ import { a as CodemationConfigNormalizer, t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-GYpBBvqE.js";
2
+ import { m as ApplicationTokens } from "./CredentialServices-Dk8yypeL.js";
3
+ import { A as WorkflowDefinitionMapper, C as CodemationHonoApiApp, M as GetWorkflowDetailQuery, d as FrontendRuntime, j as GetWorkflowSummariesQuery, m as AppContainerLifecycle, t as AppContainerFactory } from "./AppContainerFactory-DqKYCRNP.js";
4
+ import { r as CodemationPluginPackageMetadata, t as AppConfigFactory } from "./AppConfigFactory-Cx4qQvRk.js";
5
5
  import { readFile, readdir } from "node:fs/promises";
6
6
  import path from "node:path";
7
7
  import { pathToFileURL } from "node:url";
@@ -189,7 +189,8 @@ var CodemationPluginDiscovery = class {
189
189
  const pluginValue = value;
190
190
  if (pluginValue.register !== void 0 && typeof pluginValue.register !== "function") return false;
191
191
  if (pluginValue.credentialTypes !== void 0 && !Array.isArray(pluginValue.credentialTypes)) return false;
192
- return pluginValue.register !== void 0 || pluginValue.credentialTypes !== void 0 || pluginValue.sandbox !== void 0 || Object.keys(pluginValue).length === 0;
192
+ if (pluginValue.mcpServers !== void 0 && !Array.isArray(pluginValue.mcpServers)) return false;
193
+ return pluginValue.register !== void 0 || pluginValue.credentialTypes !== void 0 || pluginValue.mcpServers !== void 0 || pluginValue.sandbox !== void 0 || Object.keys(pluginValue).length === 0;
193
194
  }
194
195
  resolvePluginEntry(discoveredPackage) {
195
196
  return process.env.CODEMATION_PREFER_PLUGIN_SOURCE_ENTRY === "true" && typeof discoveredPackage.developmentEntry === "string" && discoveredPackage.developmentEntry.trim().length > 0 ? discoveredPackage.developmentEntry : discoveredPackage.pluginEntry;
@@ -218,4 +219,4 @@ var CodemationPluginDiscovery = class {
218
219
 
219
220
  //#endregion
220
221
  export { AppConfigLoader as n, CodemationServerGateway as r, CodemationPluginDiscovery as t };
221
- //# sourceMappingURL=server-CJFfY67o.js.map
222
+ //# sourceMappingURL=server-Y7kxwtCK.js.map