@codemation/host 0.6.0 → 0.8.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 +483 -0
- package/dist/{ApiPaths-CLTHphYZ.js → ApiPaths-Dv1dcHu_.js} +4 -4
- package/dist/ApiPaths-Dv1dcHu_.js.map +1 -0
- package/dist/{AppConfigFactory-YnveXE9k.d.ts → AppConfigFactory-BT0y0LVC.d.ts} +8490 -5548
- package/dist/{AppConfigFactory-C6q-CSKb.js → AppConfigFactory-Cx4qQvRk.js} +112 -52
- package/dist/AppConfigFactory-Cx4qQvRk.js.map +1 -0
- package/dist/{AppContainerFactory-qaqc-R1D.js → AppContainerFactory-DRTjG7nG.js} +7298 -1732
- package/dist/AppContainerFactory-DRTjG7nG.js.map +1 -0
- package/dist/{CodemationAppContext-DRu1Dpri.d.ts → CodemationAppContext-CGFYVcSb.d.ts} +14 -4
- package/dist/{CodemationAuthoring.types-DZl-sJaM.js → CodemationAuthoring.types-BteaR3Dc.js} +19 -6
- package/dist/CodemationAuthoring.types-BteaR3Dc.js.map +1 -0
- package/dist/{CodemationAuthoring.types-fBRppnmi.d.ts → CodemationAuthoring.types-DiKKogum.d.ts} +30 -5
- package/dist/{CodemationConfigNormalizer-DVko3cVN.d.ts → CodemationConfigNormalizer-48f-T66P.d.ts} +3 -3
- package/dist/{CodemationConsumerConfigLoader-BeAUS144.js → CodemationConsumerConfigLoader-By-6tuGc.js} +81 -10
- package/dist/CodemationConsumerConfigLoader-By-6tuGc.js.map +1 -0
- package/dist/{CodemationConsumerConfigLoader-DJWr86f-.d.ts → CodemationConsumerConfigLoader-_PIYqwVx.d.ts} +18 -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-DP7djJ9S.d.ts} +151 -19
- 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-BLloBztI.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-c7t3KnV_.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-Dv04tJ-6.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 +141 -21
- package/dist/index.js +109 -14
- package/dist/index.js.map +1 -0
- package/dist/mapping.d.ts +2 -2
- package/dist/mapping.js +1 -1
- package/dist/nextServer.d.ts +42 -113
- 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-B71RGvSj.d.ts +30 -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.d.ts +8 -8
- package/dist/persistenceServer.js +3 -3
- package/dist/{server-MUNGsBYK.d.ts → server-09PKasWR.d.ts} +21 -6
- package/dist/{server-CJFfY67o.js → server-vtRCPgRJ.js} +7 -6
- package/dist/{server-CJFfY67o.js.map → server-vtRCPgRJ.js.map} +1 -1
- package/dist/server.d.ts +14 -14
- package/dist/server.js +13 -11
- package/package.json +47 -58
- 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 +295 -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/HeadlessApiRuntime.ts +47 -0
- 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 +9 -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 +60 -5
- package/src/presentation/config/CodemationConfig.ts +9 -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/HeadlessHttpServerFactory.ts +56 -0
- 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 +59 -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/presentation/websocket/WorkflowWebsocketServerFactory.ts +16 -0
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemation/host",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -19,131 +19,107 @@
|
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
|
-
"development":
|
|
23
|
-
"import": "./src/index.ts"
|
|
24
|
-
},
|
|
22
|
+
"development": "./src/index.ts",
|
|
25
23
|
"import": "./dist/index.js"
|
|
26
24
|
},
|
|
27
25
|
"./authoring": {
|
|
28
26
|
"types": "./dist/authoring.d.ts",
|
|
29
|
-
"development":
|
|
30
|
-
"import": "./src/authoring.ts"
|
|
31
|
-
},
|
|
27
|
+
"development": "./src/authoring.ts",
|
|
32
28
|
"import": "./dist/authoring.js"
|
|
33
29
|
},
|
|
34
30
|
"./client": {
|
|
35
31
|
"types": "./dist/client.d.ts",
|
|
36
|
-
"development":
|
|
37
|
-
"import": "./src/client.ts"
|
|
38
|
-
},
|
|
32
|
+
"development": "./src/client.ts",
|
|
39
33
|
"import": "./dist/client.js"
|
|
40
34
|
},
|
|
41
35
|
"./dto": {
|
|
42
36
|
"types": "./dist/dto.d.ts",
|
|
43
|
-
"development":
|
|
44
|
-
"import": "./src/dto.ts"
|
|
45
|
-
},
|
|
37
|
+
"development": "./src/dto.ts",
|
|
46
38
|
"import": "./dist/dto.js"
|
|
47
39
|
},
|
|
48
40
|
"./mapping": {
|
|
49
41
|
"types": "./dist/mapping.d.ts",
|
|
50
|
-
"development":
|
|
51
|
-
"import": "./src/mapping.ts"
|
|
52
|
-
},
|
|
42
|
+
"development": "./src/mapping.ts",
|
|
53
43
|
"import": "./dist/mapping.js"
|
|
54
44
|
},
|
|
55
45
|
"./credentials": {
|
|
56
46
|
"types": "./dist/credentials.d.ts",
|
|
57
|
-
"development":
|
|
58
|
-
"import": "./src/credentials.ts"
|
|
59
|
-
},
|
|
47
|
+
"development": "./src/credentials.ts",
|
|
60
48
|
"import": "./dist/credentials.js"
|
|
61
49
|
},
|
|
62
50
|
"./consumer": {
|
|
63
51
|
"types": "./dist/consumer.d.ts",
|
|
64
|
-
"development":
|
|
65
|
-
"import": "./src/consumer.ts"
|
|
66
|
-
},
|
|
52
|
+
"development": "./src/consumer.ts",
|
|
67
53
|
"import": "./dist/consumer.js"
|
|
68
54
|
},
|
|
69
55
|
"./next/server": {
|
|
70
56
|
"types": "./dist/nextServer.d.ts",
|
|
71
|
-
"development":
|
|
72
|
-
"import": "./src/nextServer.ts"
|
|
73
|
-
},
|
|
57
|
+
"development": "./src/nextServer.ts",
|
|
74
58
|
"import": "./dist/nextServer.js"
|
|
75
59
|
},
|
|
76
60
|
"./server": {
|
|
77
61
|
"types": "./dist/server.d.ts",
|
|
78
|
-
"development":
|
|
79
|
-
"import": "./src/server.ts"
|
|
80
|
-
},
|
|
62
|
+
"development": "./src/server.ts",
|
|
81
63
|
"import": "./dist/server.js"
|
|
82
64
|
},
|
|
65
|
+
"./pairing": {
|
|
66
|
+
"types": "./dist/pairing.d.ts",
|
|
67
|
+
"development": "./src/pairing.ts",
|
|
68
|
+
"import": "./dist/pairing.js"
|
|
69
|
+
},
|
|
83
70
|
"./dev-server-sidecar": {
|
|
84
71
|
"types": "./dist/devServerSidecar.d.ts",
|
|
85
|
-
"development":
|
|
86
|
-
"import": "./src/devServerSidecar.ts"
|
|
87
|
-
},
|
|
72
|
+
"development": "./src/devServerSidecar.ts",
|
|
88
73
|
"import": "./dist/devServerSidecar.js"
|
|
89
74
|
},
|
|
90
75
|
"./persistence": {
|
|
91
76
|
"types": "./dist/persistenceServer.d.ts",
|
|
92
|
-
"development":
|
|
93
|
-
"import": "./src/persistenceServer.ts"
|
|
94
|
-
},
|
|
77
|
+
"development": "./src/persistenceServer.ts",
|
|
95
78
|
"import": "./dist/persistenceServer.js"
|
|
96
79
|
},
|
|
97
80
|
"./package.json": "./package.json"
|
|
98
81
|
},
|
|
99
82
|
"dependencies": {
|
|
100
|
-
"ai": "^
|
|
83
|
+
"@ai-sdk/mcp": "^1.0.42",
|
|
101
84
|
"@ai-sdk/provider": "^3.0.8",
|
|
102
85
|
"@auth/core": "^0.34.3",
|
|
103
86
|
"@auth/prisma-adapter": "^2.11.1",
|
|
87
|
+
"@aws-sdk/client-s3": "^3.1049.0",
|
|
88
|
+
"@aws-sdk/lib-storage": "^3.1049.0",
|
|
104
89
|
"@better-auth/prisma-adapter": "^1.5.6",
|
|
105
90
|
"@libsql/client": "^0.17.2",
|
|
106
|
-
"@monaco-editor/react": "^4.7.0",
|
|
107
91
|
"@prisma/adapter-libsql": "^7.6.0",
|
|
108
92
|
"@prisma/adapter-pg": "^7.0.0",
|
|
109
93
|
"@prisma/client": "^7.0.0",
|
|
110
94
|
"@prisma/client-runtime-utils": "^7.5.0",
|
|
111
|
-
"
|
|
112
|
-
"@types/bcryptjs": "^3.0.0",
|
|
113
|
-
"@uiw/react-json-view": "2.0.0-alpha.41",
|
|
114
|
-
"@xyflow/react": "^12.10.1",
|
|
95
|
+
"ai": "^6.0.168",
|
|
115
96
|
"bcryptjs": "^3.0.3",
|
|
116
97
|
"better-auth": "^1.5.6",
|
|
117
98
|
"bullmq": "^5.58.3",
|
|
118
|
-
"dagre": "^0.8.5",
|
|
119
|
-
"date-fns": "^4.1.0",
|
|
120
99
|
"hono": "^4.12.8",
|
|
121
100
|
"jose": "^6.2.2",
|
|
122
|
-
"lucide-react": "^0.577.0",
|
|
123
|
-
"monaco-editor": "^0.55.1",
|
|
124
101
|
"pg": "^8.16.3",
|
|
125
|
-
"pretty-ms": "^9.3.0",
|
|
126
102
|
"prisma": "^7.0.0",
|
|
127
|
-
"rc-tree": "^5.13.1",
|
|
128
|
-
"react": "^19.2.4",
|
|
129
|
-
"react-dom": "^19.2.4",
|
|
130
|
-
"react-router-dom": "^7.13.1",
|
|
131
|
-
"react-use-websocket": "^4.13.0",
|
|
132
103
|
"reflect-metadata": "^0.2.2",
|
|
133
104
|
"sanitize-filename": "^1.6.4",
|
|
134
105
|
"serialize-javascript": "^7.0.4",
|
|
106
|
+
"dotenv": "^17.3.1",
|
|
107
|
+
"execa": "^9.6.1",
|
|
135
108
|
"tsx": "^4.21.0",
|
|
136
109
|
"ws": "^8.19.0",
|
|
137
|
-
"
|
|
138
|
-
"@codemation/
|
|
139
|
-
"@codemation/core
|
|
140
|
-
"@codemation/
|
|
110
|
+
"@codemation/core-nodes": "0.8.1",
|
|
111
|
+
"@codemation/eventbus-redis": "0.0.39",
|
|
112
|
+
"@codemation/core": "0.11.1",
|
|
113
|
+
"@codemation/managed-auth": "0.1.0"
|
|
141
114
|
},
|
|
142
115
|
"devDependencies": {
|
|
116
|
+
"@monaco-editor/react": "^4.7.0",
|
|
143
117
|
"@playwright/test": "^1.58.2",
|
|
118
|
+
"@tanstack/react-query": "^5.90.21",
|
|
144
119
|
"@tanstack/react-router": "^1.167.3",
|
|
145
120
|
"@testing-library/jest-dom": "^6.9.1",
|
|
146
121
|
"@testing-library/react": "^16.3.2",
|
|
122
|
+
"@types/bcryptjs": "^3.0.0",
|
|
147
123
|
"@types/dagre": "^0.7.54",
|
|
148
124
|
"@types/node": "^25.3.5",
|
|
149
125
|
"@types/pg": "^8.15.5",
|
|
@@ -152,24 +128,37 @@
|
|
|
152
128
|
"@types/serialize-javascript": "^5.0.4",
|
|
153
129
|
"@types/ws": "^8.18.1",
|
|
154
130
|
"@types/zxcvbn": "^4.4.5",
|
|
131
|
+
"@uiw/react-json-view": "2.0.0-alpha.41",
|
|
155
132
|
"@vitest/coverage-v8": "^4.0.18",
|
|
156
|
-
"
|
|
133
|
+
"@xyflow/react": "^12.10.1",
|
|
134
|
+
"dagre": "^0.8.5",
|
|
135
|
+
"date-fns": "^4.1.0",
|
|
157
136
|
"eslint": "^10.0.3",
|
|
137
|
+
"execa": "^9.6.1",
|
|
158
138
|
"jsdom": "^28.1.0",
|
|
139
|
+
"lucide-react": "^0.577.0",
|
|
140
|
+
"monaco-editor": "^0.55.1",
|
|
159
141
|
"monocart-coverage-reports": "^2.12.9",
|
|
160
142
|
"monocart-reporter": "^2.10.0",
|
|
143
|
+
"pretty-ms": "^9.3.0",
|
|
144
|
+
"rc-tree": "^5.13.1",
|
|
145
|
+
"react": "^19.2.4",
|
|
146
|
+
"react-dom": "^19.2.4",
|
|
147
|
+
"react-router-dom": "^7.13.1",
|
|
148
|
+
"react-use-websocket": "^4.13.0",
|
|
161
149
|
"testcontainers": "^10.28.0",
|
|
162
150
|
"tsdown": "^0.15.5",
|
|
163
151
|
"typescript": "^5.9.3",
|
|
164
152
|
"vitest": "^4.0.18",
|
|
165
153
|
"zod": "^4.3.6",
|
|
166
|
-
"
|
|
154
|
+
"zxcvbn": "^4.4.2",
|
|
155
|
+
"@codemation/core-nodes-gmail": "0.3.1"
|
|
167
156
|
},
|
|
168
157
|
"scripts": {
|
|
169
158
|
"changeset:verify": "pnpm --workspace-root run changeset:verify",
|
|
170
159
|
"prisma:generate": "node ./scripts/generate-prisma-clients.mjs && node ./scripts/ensure-prisma-runtime-sourcemaps.mjs",
|
|
171
|
-
"build": "tsdown src/index.ts src/authoring.ts src/client.ts src/credentials.ts src/consumer.ts src/dto.ts src/mapping.ts src/nextServer.ts src/server.ts src/devServerSidecar.ts src/persistenceServer.ts --out-dir dist --sourcemap",
|
|
172
|
-
"dev": "tsdown src/index.ts src/authoring.ts src/client.ts src/credentials.ts src/consumer.ts src/dto.ts src/mapping.ts src/nextServer.ts src/server.ts src/devServerSidecar.ts src/persistenceServer.ts --out-dir dist --sourcemap --watch",
|
|
160
|
+
"build": "tsdown src/index.ts src/authoring.ts src/client.ts src/credentials.ts src/consumer.ts src/dto.ts src/mapping.ts src/nextServer.ts src/server.ts src/devServerSidecar.ts src/persistenceServer.ts src/pairing.ts --out-dir dist --sourcemap",
|
|
161
|
+
"dev": "tsdown src/index.ts src/authoring.ts src/client.ts src/credentials.ts src/consumer.ts src/dto.ts src/mapping.ts src/nextServer.ts src/server.ts src/devServerSidecar.ts src/persistenceServer.ts src/pairing.ts --out-dir dist --sourcemap --watch",
|
|
173
162
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
174
163
|
"lint": "eslint .",
|
|
175
164
|
"test": "pnpm -w exec concurrently -m 5 -c auto -n unit,integration,ui,browser,e2e \"pnpm run test:unit\" \"pnpm run test:integration\" \"pnpm run test:ui\" \"pnpm run test:browser\" \"pnpm run test:e2e\"",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
-- Create WorkflowAuditLog table for workspace-local run-event audit trail (Sprint 13 Story B).
|
|
2
|
+
-- Indexed by (actor_user_id, occurred_at) and (workflow_id, occurred_at) for SOC2 queries.
|
|
3
|
+
|
|
4
|
+
CREATE TABLE "workflow_audit_log" (
|
|
5
|
+
"id" TEXT NOT NULL,
|
|
6
|
+
"occurred_at" TIMESTAMP(3) NOT NULL,
|
|
7
|
+
"actor_user_id" TEXT NOT NULL,
|
|
8
|
+
"actor_session_id" TEXT,
|
|
9
|
+
"action" TEXT NOT NULL,
|
|
10
|
+
"resource_type" TEXT NOT NULL,
|
|
11
|
+
"resource_id" TEXT NOT NULL,
|
|
12
|
+
"outcome" TEXT NOT NULL,
|
|
13
|
+
"error_code" TEXT,
|
|
14
|
+
"correlation_id" TEXT,
|
|
15
|
+
"workflow_id" TEXT NOT NULL,
|
|
16
|
+
"run_id" TEXT,
|
|
17
|
+
"node_id" TEXT,
|
|
18
|
+
|
|
19
|
+
CONSTRAINT "workflow_audit_log_pkey" PRIMARY KEY ("id")
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
CREATE INDEX "workflow_audit_log_actor_user_id_occurred_at_idx" ON "workflow_audit_log"("actor_user_id", "occurred_at");
|
|
23
|
+
CREATE INDEX "workflow_audit_log_workflow_id_occurred_at_idx" ON "workflow_audit_log"("workflow_id", "occurred_at");
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
-- Migration: Storage growth fixes (Sprint 14 Story 07)
|
|
2
|
+
-- 1. Add WorkflowSnapshot table for run snapshot deduplication (keyed by content hash)
|
|
3
|
+
-- 2. Add workflowSnapshotId FK to Run (nullable - existing rows remain valid)
|
|
4
|
+
-- 3. Add payloadStorageKey to TelemetryArtifact for large-payload offload
|
|
5
|
+
-- 4. Backfill: insert unique (workflowId, snapshotHash) snapshots from existing Run rows
|
|
6
|
+
-- 5. Set workflowSnapshotId on backfilled runs
|
|
7
|
+
|
|
8
|
+
-- Create WorkflowSnapshot table
|
|
9
|
+
CREATE TABLE "WorkflowSnapshot" (
|
|
10
|
+
"id" TEXT NOT NULL,
|
|
11
|
+
"workflow_id" TEXT NOT NULL,
|
|
12
|
+
"snapshot_hash" TEXT NOT NULL,
|
|
13
|
+
"snapshot_json" TEXT NOT NULL,
|
|
14
|
+
"created_at" TEXT NOT NULL,
|
|
15
|
+
CONSTRAINT "WorkflowSnapshot_pkey" PRIMARY KEY ("id")
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
CREATE UNIQUE INDEX "WorkflowSnapshot_workflow_id_snapshot_hash_key"
|
|
19
|
+
ON "WorkflowSnapshot"("workflow_id", "snapshot_hash");
|
|
20
|
+
|
|
21
|
+
CREATE INDEX "WorkflowSnapshot_workflow_id_snapshot_hash_idx"
|
|
22
|
+
ON "WorkflowSnapshot"("workflow_id", "snapshot_hash");
|
|
23
|
+
|
|
24
|
+
-- Add FK column to Run (nullable)
|
|
25
|
+
ALTER TABLE "Run" ADD COLUMN "workflow_snapshot_id" TEXT;
|
|
26
|
+
|
|
27
|
+
CREATE INDEX "Run_workflow_snapshot_id_idx"
|
|
28
|
+
ON "Run"("workflow_snapshot_id");
|
|
29
|
+
|
|
30
|
+
ALTER TABLE "Run"
|
|
31
|
+
ADD CONSTRAINT "Run_workflow_snapshot_id_fkey"
|
|
32
|
+
FOREIGN KEY ("workflow_snapshot_id")
|
|
33
|
+
REFERENCES "WorkflowSnapshot"("id")
|
|
34
|
+
ON DELETE SET NULL ON UPDATE CASCADE
|
|
35
|
+
DEFERRABLE INITIALLY DEFERRED;
|
|
36
|
+
|
|
37
|
+
-- Add payloadStorageKey to TelemetryArtifact
|
|
38
|
+
ALTER TABLE "TelemetryArtifact" ADD COLUMN "payload_storage_key" TEXT;
|
|
39
|
+
|
|
40
|
+
-- Backfill: deduplicate workflow snapshots from existing Run rows by content hash.
|
|
41
|
+
-- md5 is available in PostgreSQL without extensions; we use encode(digest(...), 'hex')
|
|
42
|
+
-- from pgcrypto — fall back to md5 which is always available.
|
|
43
|
+
INSERT INTO "WorkflowSnapshot" ("id", "workflow_id", "snapshot_hash", "snapshot_json", "created_at")
|
|
44
|
+
SELECT DISTINCT ON (r."workflow_id", md5(r."workflow_snapshot_json"))
|
|
45
|
+
gen_random_uuid()::text,
|
|
46
|
+
r."workflow_id",
|
|
47
|
+
md5(r."workflow_snapshot_json"),
|
|
48
|
+
r."workflow_snapshot_json",
|
|
49
|
+
MIN(r."started_at") OVER (PARTITION BY r."workflow_id", md5(r."workflow_snapshot_json"))
|
|
50
|
+
FROM "Run" r
|
|
51
|
+
WHERE r."workflow_snapshot_json" IS NOT NULL
|
|
52
|
+
ON CONFLICT ("workflow_id", "snapshot_hash") DO NOTHING;
|
|
53
|
+
|
|
54
|
+
-- Set workflowSnapshotId on existing runs that have snapshots
|
|
55
|
+
UPDATE "Run" r
|
|
56
|
+
SET "workflow_snapshot_id" = ws."id"
|
|
57
|
+
FROM "WorkflowSnapshot" ws
|
|
58
|
+
WHERE r."workflow_id" = ws."workflow_id"
|
|
59
|
+
AND md5(r."workflow_snapshot_json") = ws."snapshot_hash"
|
|
60
|
+
AND r."workflow_snapshot_json" IS NOT NULL
|
|
61
|
+
AND r."workflow_snapshot_id" IS NULL;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Create WorkflowAuditLog table for workspace-local run-event audit trail (Sprint 13 Story B).
|
|
2
|
+
-- SQLite variant: no TIMESTAMP(3), no quoted identifiers.
|
|
3
|
+
|
|
4
|
+
CREATE TABLE workflow_audit_log (
|
|
5
|
+
id TEXT NOT NULL PRIMARY KEY,
|
|
6
|
+
occurred_at DATETIME NOT NULL,
|
|
7
|
+
actor_user_id TEXT NOT NULL,
|
|
8
|
+
actor_session_id TEXT,
|
|
9
|
+
action TEXT NOT NULL,
|
|
10
|
+
resource_type TEXT NOT NULL,
|
|
11
|
+
resource_id TEXT NOT NULL,
|
|
12
|
+
outcome TEXT NOT NULL,
|
|
13
|
+
error_code TEXT,
|
|
14
|
+
correlation_id TEXT,
|
|
15
|
+
workflow_id TEXT NOT NULL,
|
|
16
|
+
run_id TEXT,
|
|
17
|
+
node_id TEXT
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
CREATE INDEX workflow_audit_log_actor_user_id_occurred_at_idx ON workflow_audit_log(actor_user_id, occurred_at);
|
|
21
|
+
CREATE INDEX workflow_audit_log_workflow_id_occurred_at_idx ON workflow_audit_log(workflow_id, occurred_at);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
-- Migration: Storage growth fixes (Sprint 14 Story 07) - SQLite variant
|
|
2
|
+
-- 1. Add WorkflowSnapshot table for run snapshot deduplication
|
|
3
|
+
-- 2. Add workflowSnapshotId FK to Run (nullable)
|
|
4
|
+
-- 3. Add payloadStorageKey to TelemetryArtifact
|
|
5
|
+
-- Note: SQLite has no md5() — runtime backfill handled by PrismaWorkflowSnapshotRepository.
|
|
6
|
+
|
|
7
|
+
-- Create WorkflowSnapshot table
|
|
8
|
+
CREATE TABLE "WorkflowSnapshot" (
|
|
9
|
+
"id" TEXT NOT NULL PRIMARY KEY,
|
|
10
|
+
"workflow_id" TEXT NOT NULL,
|
|
11
|
+
"snapshot_hash" TEXT NOT NULL,
|
|
12
|
+
"snapshot_json" TEXT NOT NULL,
|
|
13
|
+
"created_at" TEXT NOT NULL
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
CREATE UNIQUE INDEX "WorkflowSnapshot_workflow_id_snapshot_hash_key"
|
|
17
|
+
ON "WorkflowSnapshot"("workflow_id", "snapshot_hash");
|
|
18
|
+
|
|
19
|
+
CREATE INDEX "WorkflowSnapshot_workflow_id_snapshot_hash_idx"
|
|
20
|
+
ON "WorkflowSnapshot"("workflow_id", "snapshot_hash");
|
|
21
|
+
|
|
22
|
+
-- Add FK column to Run (nullable; SQLite cannot add FK constraints after the fact)
|
|
23
|
+
ALTER TABLE "Run" ADD COLUMN "workflow_snapshot_id" TEXT;
|
|
24
|
+
|
|
25
|
+
CREATE INDEX "Run_workflow_snapshot_id_idx"
|
|
26
|
+
ON "Run"("workflow_snapshot_id");
|
|
27
|
+
|
|
28
|
+
-- Add payloadStorageKey to TelemetryArtifact
|
|
29
|
+
ALTER TABLE "TelemetryArtifact" ADD COLUMN "payload_storage_key" TEXT;
|
|
@@ -18,6 +18,7 @@ model Run {
|
|
|
18
18
|
executionOptionsJson String? @map("execution_options_json")
|
|
19
19
|
controlJson String? @map("control_json")
|
|
20
20
|
workflowSnapshotJson String? @map("workflow_snapshot_json")
|
|
21
|
+
workflowSnapshotId String? @map("workflow_snapshot_id")
|
|
21
22
|
policySnapshotJson String? @map("policy_snapshot_json")
|
|
22
23
|
engineCountersJson String? @map("engine_counters_json")
|
|
23
24
|
mutableStateJson String? @map("mutable_state_json")
|
|
@@ -33,9 +34,11 @@ model Run {
|
|
|
33
34
|
slotProjection RunSlotProjection?
|
|
34
35
|
testSuiteRun TestSuiteRun? @relation(fields: [testSuiteRunId], references: [id])
|
|
35
36
|
testAssertions TestAssertion[]
|
|
37
|
+
workflowSnapshot WorkflowSnapshot? @relation(fields: [workflowSnapshotId], references: [id])
|
|
36
38
|
@@index([workflowId, startedAt])
|
|
37
39
|
@@index([workflowId, status, finishedAt])
|
|
38
40
|
@@index([testSuiteRunId, testCaseIndex])
|
|
41
|
+
@@index([workflowSnapshotId])
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
model RunWorkItem {
|
|
@@ -258,24 +261,39 @@ model TelemetrySpan {
|
|
|
258
261
|
@@index([retentionExpiresAt])
|
|
259
262
|
}
|
|
260
263
|
|
|
264
|
+
model WorkflowSnapshot {
|
|
265
|
+
id String @id
|
|
266
|
+
workflowId String @map("workflow_id")
|
|
267
|
+
/// SHA-256 hex digest of snapshotJson — dedup key: same workflow content → one row.
|
|
268
|
+
snapshotHash String @map("snapshot_hash")
|
|
269
|
+
snapshotJson String @map("snapshot_json")
|
|
270
|
+
createdAt String @map("created_at")
|
|
271
|
+
|
|
272
|
+
runs Run[]
|
|
273
|
+
|
|
274
|
+
@@unique([workflowId, snapshotHash])
|
|
275
|
+
@@index([workflowId, snapshotHash])
|
|
276
|
+
}
|
|
277
|
+
|
|
261
278
|
model TelemetryArtifact {
|
|
262
|
-
artifactId
|
|
263
|
-
traceId
|
|
264
|
-
spanId
|
|
265
|
-
runId
|
|
266
|
-
workflowId
|
|
267
|
-
nodeId
|
|
268
|
-
activationId
|
|
269
|
-
kind
|
|
270
|
-
contentType
|
|
271
|
-
previewText
|
|
272
|
-
previewJson
|
|
273
|
-
payloadText
|
|
274
|
-
payloadJson
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
+
artifactId String @id @map("artifact_id")
|
|
280
|
+
traceId String @map("trace_id")
|
|
281
|
+
spanId String @map("span_id")
|
|
282
|
+
runId String @map("run_id")
|
|
283
|
+
workflowId String @map("workflow_id")
|
|
284
|
+
nodeId String? @map("node_id")
|
|
285
|
+
activationId String? @map("activation_id")
|
|
286
|
+
kind String
|
|
287
|
+
contentType String @map("content_type")
|
|
288
|
+
previewText String? @map("preview_text")
|
|
289
|
+
previewJson String? @map("preview_json")
|
|
290
|
+
payloadText String? @map("payload_text")
|
|
291
|
+
payloadJson String? @map("payload_json")
|
|
292
|
+
payloadStorageKey String? @map("payload_storage_key")
|
|
293
|
+
bytes Int?
|
|
294
|
+
truncated Boolean?
|
|
295
|
+
createdAt String @map("created_at")
|
|
296
|
+
expiresAt String? @map("expires_at")
|
|
279
297
|
retentionExpiresAt String? @map("retention_expires_at")
|
|
280
298
|
|
|
281
299
|
@@index([traceId, createdAt])
|
|
@@ -469,3 +487,23 @@ model VerificationToken {
|
|
|
469
487
|
@@unique([identifier, token])
|
|
470
488
|
@@map("codemation_auth_verification_token")
|
|
471
489
|
}
|
|
490
|
+
|
|
491
|
+
model WorkflowAuditLog {
|
|
492
|
+
id String @id @map("id")
|
|
493
|
+
occurredAt DateTime @map("occurred_at")
|
|
494
|
+
actorUserId String @map("actor_user_id")
|
|
495
|
+
actorSessionId String? @map("actor_session_id")
|
|
496
|
+
action String @map("action")
|
|
497
|
+
resourceType String @map("resource_type")
|
|
498
|
+
resourceId String @map("resource_id")
|
|
499
|
+
outcome String @map("outcome")
|
|
500
|
+
errorCode String? @map("error_code")
|
|
501
|
+
correlationId String? @map("correlation_id")
|
|
502
|
+
workflowId String @map("workflow_id")
|
|
503
|
+
runId String? @map("run_id")
|
|
504
|
+
nodeId String? @map("node_id")
|
|
505
|
+
|
|
506
|
+
@@index([actorUserId, occurredAt])
|
|
507
|
+
@@index([workflowId, occurredAt])
|
|
508
|
+
@@map("workflow_audit_log")
|
|
509
|
+
}
|
|
@@ -18,6 +18,7 @@ model Run {
|
|
|
18
18
|
executionOptionsJson String? @map("execution_options_json")
|
|
19
19
|
controlJson String? @map("control_json")
|
|
20
20
|
workflowSnapshotJson String? @map("workflow_snapshot_json")
|
|
21
|
+
workflowSnapshotId String? @map("workflow_snapshot_id")
|
|
21
22
|
policySnapshotJson String? @map("policy_snapshot_json")
|
|
22
23
|
engineCountersJson String? @map("engine_counters_json")
|
|
23
24
|
mutableStateJson String? @map("mutable_state_json")
|
|
@@ -33,9 +34,11 @@ model Run {
|
|
|
33
34
|
slotProjection RunSlotProjection?
|
|
34
35
|
testSuiteRun TestSuiteRun? @relation(fields: [testSuiteRunId], references: [id])
|
|
35
36
|
testAssertions TestAssertion[]
|
|
37
|
+
workflowSnapshot WorkflowSnapshot? @relation(fields: [workflowSnapshotId], references: [id])
|
|
36
38
|
@@index([workflowId, startedAt])
|
|
37
39
|
@@index([workflowId, status, finishedAt])
|
|
38
40
|
@@index([testSuiteRunId, testCaseIndex])
|
|
41
|
+
@@index([workflowSnapshotId])
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
model RunWorkItem {
|
|
@@ -259,24 +262,39 @@ model TelemetrySpan {
|
|
|
259
262
|
@@index([retentionExpiresAt])
|
|
260
263
|
}
|
|
261
264
|
|
|
265
|
+
model WorkflowSnapshot {
|
|
266
|
+
id String @id
|
|
267
|
+
workflowId String @map("workflow_id")
|
|
268
|
+
/// SHA-256 hex digest of snapshotJson — dedup key: same workflow content → one row.
|
|
269
|
+
snapshotHash String @map("snapshot_hash")
|
|
270
|
+
snapshotJson String @map("snapshot_json")
|
|
271
|
+
createdAt String @map("created_at")
|
|
272
|
+
|
|
273
|
+
runs Run[]
|
|
274
|
+
|
|
275
|
+
@@unique([workflowId, snapshotHash])
|
|
276
|
+
@@index([workflowId, snapshotHash])
|
|
277
|
+
}
|
|
278
|
+
|
|
262
279
|
model TelemetryArtifact {
|
|
263
|
-
artifactId
|
|
264
|
-
traceId
|
|
265
|
-
spanId
|
|
266
|
-
runId
|
|
267
|
-
workflowId
|
|
268
|
-
nodeId
|
|
269
|
-
activationId
|
|
270
|
-
kind
|
|
271
|
-
contentType
|
|
272
|
-
previewText
|
|
273
|
-
previewJson
|
|
274
|
-
payloadText
|
|
275
|
-
payloadJson
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
+
artifactId String @id @map("artifact_id")
|
|
281
|
+
traceId String @map("trace_id")
|
|
282
|
+
spanId String @map("span_id")
|
|
283
|
+
runId String @map("run_id")
|
|
284
|
+
workflowId String @map("workflow_id")
|
|
285
|
+
nodeId String? @map("node_id")
|
|
286
|
+
activationId String? @map("activation_id")
|
|
287
|
+
kind String
|
|
288
|
+
contentType String @map("content_type")
|
|
289
|
+
previewText String? @map("preview_text")
|
|
290
|
+
previewJson String? @map("preview_json")
|
|
291
|
+
payloadText String? @map("payload_text")
|
|
292
|
+
payloadJson String? @map("payload_json")
|
|
293
|
+
payloadStorageKey String? @map("payload_storage_key")
|
|
294
|
+
bytes Int?
|
|
295
|
+
truncated Boolean?
|
|
296
|
+
createdAt String @map("created_at")
|
|
297
|
+
expiresAt String? @map("expires_at")
|
|
280
298
|
retentionExpiresAt String? @map("retention_expires_at")
|
|
281
299
|
|
|
282
300
|
@@index([traceId, createdAt])
|
|
@@ -469,3 +487,23 @@ model VerificationToken {
|
|
|
469
487
|
@@unique([identifier, token])
|
|
470
488
|
@@map("codemation_auth_verification_token")
|
|
471
489
|
}
|
|
490
|
+
|
|
491
|
+
model WorkflowAuditLog {
|
|
492
|
+
id String @id @map("id")
|
|
493
|
+
occurredAt DateTime @map("occurred_at")
|
|
494
|
+
actorUserId String @map("actor_user_id")
|
|
495
|
+
actorSessionId String? @map("actor_session_id")
|
|
496
|
+
action String @map("action")
|
|
497
|
+
resourceType String @map("resource_type")
|
|
498
|
+
resourceId String @map("resource_id")
|
|
499
|
+
outcome String @map("outcome")
|
|
500
|
+
errorCode String? @map("error_code")
|
|
501
|
+
correlationId String? @map("correlation_id")
|
|
502
|
+
workflowId String @map("workflow_id")
|
|
503
|
+
runId String? @map("run_id")
|
|
504
|
+
nodeId String? @map("node_id")
|
|
505
|
+
|
|
506
|
+
@@index([actorUserId, occurredAt])
|
|
507
|
+
@@index([workflowId, occurredAt])
|
|
508
|
+
@@map("workflow_audit_log")
|
|
509
|
+
}
|