@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.
- package/CHANGELOG.md +431 -0
- package/LICENSE +1 -37
- package/dist/{ApiPaths-CLTHphYZ.js → ApiPaths-Dv1dcHu_.js} +4 -4
- package/dist/ApiPaths-Dv1dcHu_.js.map +1 -0
- package/dist/{AppConfigFactory-C6q-CSKb.js → AppConfigFactory-Cx4qQvRk.js} +112 -52
- package/dist/AppConfigFactory-Cx4qQvRk.js.map +1 -0
- package/dist/{AppConfigFactory-YnveXE9k.d.ts → AppConfigFactory-DnLoQ9Li.d.ts} +8490 -5548
- package/dist/{AppContainerFactory-qaqc-R1D.js → AppContainerFactory-DqKYCRNP.js} +7641 -2083
- package/dist/AppContainerFactory-DqKYCRNP.js.map +1 -0
- package/dist/{CodemationAppContext-DRu1Dpri.d.ts → CodemationAppContext-CKVv9W9q.d.ts} +8 -4
- package/dist/{CodemationAuthoring.types-fBRppnmi.d.ts → CodemationAuthoring.types-DA3G3s6d.d.ts} +25 -5
- package/dist/{CodemationAuthoring.types-DZl-sJaM.js → CodemationAuthoring.types-NGkBcmmT.js} +18 -6
- package/dist/CodemationAuthoring.types-NGkBcmmT.js.map +1 -0
- package/dist/{CodemationConfigNormalizer-DVko3cVN.d.ts → CodemationConfigNormalizer-BAKjetJ6.d.ts} +3 -3
- package/dist/{CodemationConsumerConfigLoader-BeAUS144.js → CodemationConsumerConfigLoader-GYpBBvqE.js} +79 -10
- package/dist/CodemationConsumerConfigLoader-GYpBBvqE.js.map +1 -0
- package/dist/{CodemationConsumerConfigLoader-DJWr86f-.d.ts → CodemationConsumerConfigLoader-nxOqvv46.d.ts} +17 -2
- package/dist/{CodemationPluginListMerger-B-W5Fa_X.js → CodemationPluginListMerger-D1B1IEbt.js} +1 -1
- package/dist/{CodemationPluginListMerger-B-W5Fa_X.js.map → CodemationPluginListMerger-D1B1IEbt.js.map} +1 -1
- package/dist/{CodemationPluginListMerger-DGc-jfa2.d.ts → CodemationPluginListMerger-DKLAHT2b.d.ts} +123 -16
- package/dist/CodemationTsyringeTypeInfoRegistrar-Bj6FJYFz.js +97 -0
- package/dist/CodemationTsyringeTypeInfoRegistrar-Bj6FJYFz.js.map +1 -0
- package/dist/{CodemationWhitelabelConfig-CWbcyQqn.d.ts → CodemationWhitelabelConfig-Ca2mCUeC.d.ts} +2 -2
- package/dist/{CollectionContracts.types-DdpHft0i.d.ts → CollectionContracts.types-DDyFYT_D.d.ts} +1 -1
- package/dist/{CredentialContractsRegistry-DrMIDSw8.d.ts → CredentialContractsRegistry-Bq2bq28t.d.ts} +2 -2
- package/dist/{CredentialServices-UfvHB-rN.d.ts → CredentialServices-Be2I60Th.d.ts} +65 -20
- package/dist/{CredentialServices-CgxwguAv.js → CredentialServices-Dk8yypeL.js} +310 -51
- package/dist/CredentialServices-Dk8yypeL.js.map +1 -0
- package/dist/InternalHonoApiRouteRegistrar-Ce1yxpnO.d.ts +17 -0
- package/dist/InternalPingRegistrar-DY3kSfxP.js +221 -0
- package/dist/InternalPingRegistrar-DY3kSfxP.js.map +1 -0
- package/dist/{ItemsInputNormalizer-C-KHg9Mo.d.ts → ItemsInputNormalizer-_RwIfRIQ.d.ts} +89 -25
- package/dist/{LogLevelPolicyFactory-CampWO0l.d.ts → LogLevelPolicyFactory-ewCHLDLn.d.ts} +2 -2
- package/dist/{PublicFrontendBootstrap-DzBgwOnG.d.ts → PublicFrontendBootstrap-Cev3qK46.d.ts} +9 -2
- package/dist/PublicFrontendBootstrapFactory-CY2FS-5g.d.ts +82 -0
- package/dist/{PublicFrontendBootstrapJsonCodec-Cl_DLRh0.d.ts → PublicFrontendBootstrapJsonCodec-CXG9Dxft.d.ts} +3 -3
- package/dist/{PublicFrontendBootstrapJsonCodec-DzqvA0uo.js → PublicFrontendBootstrapJsonCodec-CegIF_ne.js} +7 -2
- package/dist/PublicFrontendBootstrapJsonCodec-CegIF_ne.js.map +1 -0
- package/dist/ServerLoggerFactory-Ckk52S3w.js +223 -0
- package/dist/ServerLoggerFactory-Ckk52S3w.js.map +1 -0
- package/dist/{TelemetryContracts-DbaNomrH.d.ts → TelemetryContracts-BtDx84Cp.d.ts} +13 -4
- package/dist/{WorkflowPolicyUiPresentationFactory-DQEY-h_S.d.ts → WorkflowPolicyUiPresentationFactory-6MyjCvBO.d.ts} +2 -2
- package/dist/{WorkflowPolicyUiPresentationFactory-DhPqQ9aB.js → WorkflowPolicyUiPresentationFactory-Bb-ae_Zh.js} +1 -1
- package/dist/{WorkflowPolicyUiPresentationFactory-DhPqQ9aB.js.map → WorkflowPolicyUiPresentationFactory-Bb-ae_Zh.js.map} +1 -1
- package/dist/{WorkflowViewContracts-CzK2KFuz.d.ts → WorkflowViewContracts-B7aFQcIw.d.ts} +10 -1
- package/dist/authoring.d.ts +5 -5
- package/dist/authoring.js +1 -1
- package/dist/client.d.ts +4 -4
- package/dist/client.js +2 -2
- package/dist/consumer.d.ts +6 -6
- package/dist/consumer.js +2 -2
- package/dist/credentials.d.ts +6 -6
- package/dist/credentials.js +1 -1
- package/dist/devServerSidecar.d.ts +2 -2
- package/dist/devServerSidecar.js +1 -94
- package/dist/devServerSidecar.js.map +1 -1
- package/dist/dto.d.ts +6 -6
- package/dist/{index-BbBk26m0.d.ts → index-DilAYwnH.d.ts} +49 -3
- package/dist/index.d.ts +110 -21
- package/dist/index.js +15 -13
- package/dist/mapping.d.ts +2 -2
- package/dist/mapping.js +1 -1
- package/dist/nextServer.d.ts +43 -88
- package/dist/nextServer.js +9 -7
- package/dist/pairing.d.ts +93 -0
- package/dist/pairing.js +5 -0
- package/dist/pairing.types-snfZ_OzB.d.ts +19 -0
- package/dist/{persistenceServer-CmsIKnO9.js → persistenceServer-C-hH4z6l.js} +2 -2
- package/dist/{persistenceServer-CmsIKnO9.js.map → persistenceServer-C-hH4z6l.js.map} +1 -1
- package/dist/persistenceServer-CeTHtC6E.d.ts +30 -0
- package/dist/persistenceServer.d.ts +8 -8
- package/dist/persistenceServer.js +3 -3
- package/dist/{server-MUNGsBYK.d.ts → server-C4bS62rg.d.ts} +21 -6
- package/dist/{server-CJFfY67o.js → server-Y7kxwtCK.js} +7 -6
- package/dist/{server-CJFfY67o.js.map → server-Y7kxwtCK.js.map} +1 -1
- package/dist/server.d.ts +14 -14
- package/dist/server.js +13 -11
- package/package.json +29 -42
- package/prisma/migrations/20260519000000_workflow_audit_log/migration.sql +23 -0
- package/prisma/migrations/20260519100000_storage_growth_fixes/migration.sql +61 -0
- package/prisma/migrations.sqlite/20260519000000_workflow_audit_log/migration.sql +21 -0
- package/prisma/migrations.sqlite/20260519100000_storage_growth_fixes/migration.sql +29 -0
- package/prisma/schema.postgresql.prisma +55 -17
- package/prisma/schema.sqlite.prisma +55 -17
- package/prisma-generated/prisma-postgresql-client/edge.js +33 -5
- package/prisma-generated/prisma-postgresql-client/index-browser.js +29 -1
- package/prisma-generated/prisma-postgresql-client/index.d.ts +8933 -5716
- package/prisma-generated/prisma-postgresql-client/index.js +33 -5
- package/prisma-generated/prisma-postgresql-client/package.json +1 -1
- package/prisma-generated/prisma-postgresql-client/schema.prisma +38 -0
- package/prisma-generated/prisma-sqlite-client/edge.js +33 -5
- package/prisma-generated/prisma-sqlite-client/index-browser.js +29 -1
- package/prisma-generated/prisma-sqlite-client/index.d.ts +8925 -5713
- package/prisma-generated/prisma-sqlite-client/index.js +33 -5
- package/prisma-generated/prisma-sqlite-client/package.json +1 -1
- package/prisma-generated/prisma-sqlite-client/schema.prisma +38 -0
- package/scripts/check-collections.mjs +18 -0
- package/scripts/generate-prisma-clients.mjs +20 -11
- package/src/application/WorkflowAuditLogPruneScheduler.ts +96 -0
- package/src/application/auth/AuthenticatedPrincipal.ts +4 -0
- package/src/application/commands/StartWorkflowRunCommandHandler.ts +4 -0
- package/src/application/contracts/WorkflowViewContracts.ts +6 -0
- package/src/application/contracts/WorkflowWebsocketMessage.ts +3 -1
- package/src/application/mapping/WorkflowDefinitionMapper.ts +40 -1
- package/src/application/runs/WorkflowRunRetentionPruneScheduler.ts +7 -1
- package/src/application/telemetry/OtelExecutionTelemetry.types.ts +5 -0
- package/src/application/telemetry/OtelExecutionTelemetryFactory.ts +4 -0
- package/src/application/telemetry/StoredTelemetrySpanScope.ts +6 -2
- package/src/application/telemetry/TelemetryRetentionTimestampFactory.ts +27 -17
- package/src/application/telemetry/TelemetrySpanPublisher.ts +11 -0
- package/src/application/websocket/TelemetrySpanWebsocketRelay.ts +31 -0
- package/src/applicationTokens.ts +20 -1
- package/src/audit/IAuditEmitter.ts +32 -0
- package/src/audit/PrismaWorkflowAuditLogRepository.ts +34 -0
- package/src/audit/WorkflowAuditLogWriter.ts +125 -0
- package/src/auth/managed/ManagedAuthConfig.ts +29 -0
- package/src/auth/managed/ManagedAuthMiddleware.ts +52 -0
- package/src/auth/managed/ManagedCorsMiddleware.ts +43 -0
- package/src/auth/managed/ManagedModeBootGuard.ts +27 -0
- package/src/auth/managed/index.ts +5 -0
- package/src/bootstrap/AppContainerFactory.ts +277 -29
- package/src/bootstrap/AppContainerLifecycle.ts +31 -0
- package/src/bootstrap/perf/BootTimer.ts +168 -0
- package/src/bootstrap/runtime/AppConfigFactory.ts +21 -65
- package/src/bootstrap/runtime/FrontendRuntime.ts +4 -1
- package/src/bootstrap/runtime/WorkerRuntime.ts +2 -1
- package/src/credentials/BrokerClient.ts +49 -0
- package/src/credentials/BrokerRefreshError.ts +12 -0
- package/src/credentials/BrokerRefreshInvalidGrantError.ts +13 -0
- package/src/credentials/ControlPlaneCatalogFetcher.ts +261 -0
- package/src/credentials/CredentialOAuth2MaterialReader.ts +136 -0
- package/src/credentials/InternalCredentialsListRegistrar.ts +48 -0
- package/src/credentials/InternalCredentialsPushRegistrar.ts +125 -0
- package/src/credentials/LocalOAuthFlowExecutor.ts +316 -0
- package/src/credentials/ManagedOAuthFlowExecutor.ts +94 -0
- package/src/credentials/ManagedOAuthRefreshInvalidGrantError.ts +13 -0
- package/src/credentials/catalogTypes.ts +4 -0
- package/src/credentials/refresh/CredentialDisconnectedError.ts +11 -0
- package/src/domain/credentials/CredentialBindingService.ts +54 -2
- package/src/domain/credentials/CredentialKeyRotatedError.ts +22 -0
- package/src/domain/credentials/CredentialSecretCipher.ts +68 -6
- package/src/domain/credentials/CredentialTypeRegistryImpl.ts +117 -10
- package/src/domain/credentials/OAuth2RedirectUriResolver.ts +79 -0
- package/src/domain/credentials/WorkflowCredentialNodeResolver.ts +14 -5
- package/src/domain/telemetry/TelemetryContracts.ts +7 -1
- package/src/domain/workflows/WorkflowActivationPreflight.ts +24 -1
- package/src/domain/workflows/WorkflowActivationPreflightRules.ts +40 -1
- package/src/index.ts +6 -0
- package/src/infrastructure/binary/LocalFilesystemBinaryStorageRegistry.ts +29 -1
- package/src/infrastructure/binary/S3BinaryStorage.ts +169 -0
- package/src/infrastructure/binary/S3BinaryStorageConfig.ts +17 -0
- package/src/infrastructure/config/CodemationPluginRegistrar.ts +3 -1
- package/src/infrastructure/persistence/CodemationDatabaseUrlParser.ts +41 -0
- package/src/infrastructure/persistence/InMemoryTelemetryArtifactStore.ts +8 -3
- package/src/infrastructure/persistence/PrismaMigrationDeployer.ts +21 -13
- package/src/infrastructure/persistence/PrismaTelemetryArtifactStore.ts +43 -8
- package/src/infrastructure/persistence/PrismaWorkflowRunRepository.ts +26 -3
- package/src/infrastructure/persistence/PrismaWorkflowSnapshotRepository.ts +48 -0
- package/src/mcp/AgentMcpIntegrationImpl.ts +344 -0
- package/src/mcp/McpClientFactory.ts +29 -0
- package/src/mcp/McpConnectionPool.ts +184 -0
- package/src/mcp/McpConnectionPool.types.ts +12 -0
- package/src/mcp/McpServerCatalog.ts +104 -0
- package/src/mcp/index.ts +5 -0
- package/src/pairing/HmacRequestSigner.ts +32 -0
- package/src/pairing/IncomingHmacVerifier.ts +82 -0
- package/src/pairing/InternalHmacAuthMiddleware.ts +33 -0
- package/src/pairing/InternalPingRegistrar.ts +25 -0
- package/src/pairing/PairedFetch.ts +33 -0
- package/src/pairing/PairingConfigFactory.ts +35 -0
- package/src/pairing/PairingConfigToken.ts +6 -0
- package/src/pairing/index.ts +14 -0
- package/src/pairing/pairing.types.ts +18 -0
- package/src/pairing.ts +17 -0
- package/src/persistenceServer.ts +1 -0
- package/src/presentation/config/AppConfig.ts +7 -1
- package/src/presentation/config/CodemationAuthConfig.ts +1 -1
- package/src/presentation/config/CodemationAuthoring.types.ts +54 -5
- package/src/presentation/config/CodemationConfig.ts +3 -0
- package/src/presentation/config/CodemationConfigNormalizer.ts +39 -1
- package/src/presentation/config/CodemationPlugin.ts +2 -1
- package/src/presentation/frontend/CodemationFrontendAuthSnapshot.ts +5 -0
- package/src/presentation/frontend/CodemationFrontendAuthSnapshotFactory.ts +7 -1
- package/src/presentation/frontend/PublicFrontendBootstrap.ts +2 -0
- package/src/presentation/frontend/PublicFrontendBootstrapFactory.ts +5 -1
- package/src/presentation/frontend/PublicFrontendBootstrapJsonCodec.ts +4 -1
- package/src/presentation/http/ApiPaths.ts +4 -4
- package/src/presentation/http/ServerHttpErrorResponseFactory.ts +39 -2
- package/src/presentation/http/hono/CodemationHonoApiAppFactory.ts +33 -8
- package/src/presentation/http/hono/InternalHonoApiRouteRegistrar.ts +12 -0
- package/src/presentation/http/hono/registrars/ManagedMeHonoApiRouteRegistrar.ts +35 -0
- package/src/presentation/http/hono/registrars/OAuth2HonoApiRouteRegistrar.ts +2 -2
- package/src/presentation/http/routeHandlers/CredentialHttpRouteHandler.ts +28 -0
- package/src/presentation/http/routeHandlers/OAuth2HttpRouteHandlerFactory.ts +98 -41
- package/src/presentation/server/CodemationConsumerConfigLoader.ts +54 -7
- package/src/presentation/server/CodemationPluginDiscovery.ts +5 -0
- package/src/presentation/server/WorkflowDefinitionExportsResolver.ts +18 -0
- package/src/presentation/server/WorkflowModulePathFinder.ts +12 -1
- package/src/presentation/websocket/ManagedWebsocketAuthenticator.ts +50 -0
- package/src/presentation/websocket/WebsocketAuthenticator.types.ts +12 -0
- package/src/presentation/websocket/WorkflowWebsocketServer.ts +24 -3
- package/src/process/ExecaProcessRunner.ts +41 -0
- package/src/process/ProcessRunner.types.ts +39 -0
- package/src/server.ts +2 -0
- package/src/workflows/InternalWorkflowActivationRegistrar.ts +42 -0
- package/src/workflows/InternalWorkflowDetailRegistrar.ts +33 -0
- package/src/workflows/InternalWorkflowTestRunRegistrar.ts +91 -0
- package/src/workflows/InternalWorkflowsListRegistrar.ts +28 -0
- package/src/workflows/discovery/WorkflowDirectoryDiscoverer.ts +79 -0
- package/tsconfig.json +2 -0
- package/vitest.shared.ts +5 -0
- package/dist/ApiPaths-CLTHphYZ.js.map +0 -1
- package/dist/AppConfigFactory-C6q-CSKb.js.map +0 -1
- package/dist/AppContainerFactory-qaqc-R1D.js.map +0 -1
- package/dist/CodemationAuthoring.types-DZl-sJaM.js.map +0 -1
- package/dist/CodemationConsumerConfigLoader-BeAUS144.js.map +0 -1
- package/dist/CredentialServices-CgxwguAv.js.map +0 -1
- package/dist/PublicFrontendBootstrapFactory-Cb2pLmDd.d.ts +0 -45
- package/dist/PublicFrontendBootstrapJsonCodec-DzqvA0uo.js.map +0 -1
- package/dist/ServerLoggerFactory-BKSIh9Xv.js +0 -98
- package/dist/ServerLoggerFactory-BKSIh9Xv.js.map +0 -1
- package/dist/persistenceServer-vtJAGDat.d.ts +0 -9
- 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-
|
|
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-
|
|
4
|
-
import { i as CodemationFrontendAuthSnapshotJsonCodec, n as InternalAuthBootstrapJsonCodec, r as FrontendAppConfigJsonCodec, t as PublicFrontendBootstrapJsonCodec } from "./PublicFrontendBootstrapJsonCodec-
|
|
5
|
-
import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-
|
|
6
|
-
import "./ServerLoggerFactory-
|
|
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 {
|
|
10
|
-
import
|
|
11
|
-
import "./
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { t as
|
|
15
|
-
import {
|
|
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-
|
|
2
|
-
import { t as WorkflowPolicyUiPresentationFactory } from "./WorkflowPolicyUiPresentationFactory-
|
|
1
|
+
import "./ItemsInputNormalizer-_RwIfRIQ.js";
|
|
2
|
+
import { t as WorkflowPolicyUiPresentationFactory } from "./WorkflowPolicyUiPresentationFactory-6MyjCvBO.js";
|
|
3
3
|
export { WorkflowPolicyUiPresentationFactory };
|
package/dist/mapping.js
CHANGED
package/dist/nextServer.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { r as AppConfig } from "./CodemationAppContext-
|
|
4
|
-
import { l as Logger, u as LoggerFactory } from "./CodemationWhitelabelConfig-
|
|
5
|
-
import { n as logLevelPolicyFactory, t as LogLevelPolicyFactory } from "./LogLevelPolicyFactory-
|
|
6
|
-
import { a as CodemationFrontendAuthSnapshot, i as CodemationFrontendAuthProviderSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-
|
|
7
|
-
import "./CodemationConfigNormalizer-
|
|
8
|
-
import { a as
|
|
9
|
-
import "./CredentialContractsRegistry-
|
|
10
|
-
import "./TelemetryContracts-
|
|
11
|
-
import { i as WorkflowSummary, t as WorkflowDto } from "./WorkflowViewContracts-
|
|
12
|
-
import { _ as
|
|
13
|
-
import { t as AppConfigFactory } from "./AppConfigFactory-
|
|
14
|
-
import { n as InternalAuthBootstrapFactory, r as FrontendAppConfigFactory, t as PublicFrontendBootstrapFactory } from "./PublicFrontendBootstrapFactory-
|
|
15
|
-
import { t as
|
|
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
|
-
|
|
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
|
-
|
|
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/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
-
|
|
214
|
-
|
|
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
|
-
*
|
|
224
|
-
*
|
|
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
|
|
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
|
|
199
|
+
private readonly redirectUriResolver;
|
|
248
200
|
private readonly credentialInstanceService;
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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;
|
package/dist/nextServer.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { n as logLevelPolicyFactory, t as LogLevelPolicyFactory } from "./LogLevelPolicyFactory-DCUzIN6G.js";
|
|
2
|
-
import "./ApiPaths-
|
|
3
|
-
import { a as FilteringLogger, i as PerformanceLogPolicy, n as PerformanceLogPolicyFactory, r as performanceLogPolicyFactory, t as ServerLoggerFactory } from "./ServerLoggerFactory-
|
|
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,
|
|
7
|
-
import
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import
|
|
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
|
package/dist/pairing.js
ADDED
|
@@ -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 {
|
|
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-
|
|
15
|
+
//# sourceMappingURL=persistenceServer-C-hH4z6l.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistenceServer-
|
|
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-
|
|
2
|
-
import "./ItemsInputNormalizer-
|
|
3
|
-
import { i as AppPersistenceConfig } from "./CodemationAppContext-
|
|
4
|
-
import "./CodemationWhitelabelConfig-
|
|
5
|
-
import "./CodemationConfigNormalizer-
|
|
6
|
-
import { n as PrismaMigrationDeployer, r as PrismaDatabaseClient, t as AppConfigFactory } from "./AppConfigFactory-
|
|
7
|
-
import {
|
|
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 {
|
|
3
|
-
import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-
|
|
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-
|
|
2
|
-
import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-
|
|
3
|
-
import { i as WorkflowSummary, t as WorkflowDto } from "./WorkflowViewContracts-
|
|
4
|
-
import { t as AppConfigFactory } from "./AppConfigFactory-
|
|
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-
|
|
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-
|
|
2
|
-
import {
|
|
3
|
-
import { A as
|
|
4
|
-
import {
|
|
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
|
-
|
|
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-
|
|
222
|
+
//# sourceMappingURL=server-Y7kxwtCK.js.map
|