@codemation/host 0.0.5 → 0.0.11

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 (132) hide show
  1. package/README.md +3 -3
  2. package/dist/{PrismaMigrationDeployer-B7cHGrXP.js → AppConfigFactory-DWIz2hy-.js} +104 -58
  3. package/dist/AppConfigFactory-DWIz2hy-.js.map +1 -0
  4. package/dist/{client-Yh7-CQud.d.ts → AppConfigFactory-DmHOpg8O.d.ts} +52 -31
  5. package/dist/{CodemationFrontendBootstrapRequest-CNEk-C4D.js → AppContainerFactory-B5eRpvAa.js} +3269 -3374
  6. package/dist/AppContainerFactory-B5eRpvAa.js.map +1 -0
  7. package/dist/{CodemationWhitelabelConfig-DgbjgtrR.d.ts → CodemationAuthConfig-Bh2cCNCI.d.ts} +32 -2
  8. package/dist/{CodemationConfig-XCkSV2dj.d.ts → CodemationConfig-D2ULNkec.d.ts} +53 -49
  9. package/dist/CodemationConfigNormalizer-CBLxXaRV.d.ts +9 -0
  10. package/dist/{CodemationConsumerConfigLoader-scS_RQMy.js → CodemationConsumerConfigLoader-BBzAr6L_.js} +128 -3
  11. package/dist/CodemationConsumerConfigLoader-BBzAr6L_.js.map +1 -0
  12. package/dist/{CodemationConsumerConfigLoader-Dmm2TzAA.d.ts → CodemationConsumerConfigLoader-BLvzcfb7.d.ts} +4 -4
  13. package/dist/CodemationPluginListMerger-B0-e4CJ6.d.ts +391 -0
  14. package/dist/{CodemationPluginListMerger-BNmaoXQL.js → CodemationPluginListMerger-DrVOw9KP.js} +18 -10
  15. package/dist/CodemationPluginListMerger-DrVOw9KP.js.map +1 -0
  16. package/dist/{CredentialServices-DpDpm8mL.d.ts → CredentialServices-BeuMtqYA.d.ts} +3 -3
  17. package/dist/{CredentialServices-BKBGe7l3.js → CredentialServices-DNb3CZwW.js} +3 -3
  18. package/dist/CredentialServices-DNb3CZwW.js.map +1 -0
  19. package/dist/FrontendAppConfig-D50wjj_n.d.ts +27 -0
  20. package/dist/{WorkflowViewContracts-DCLpTn25.d.ts → FrontendAppConfigFactory-Bj-DZNlt.d.ts} +29 -2
  21. package/dist/FrontendAppConfigJsonCodec-1_L7H_Qo.d.ts +20 -0
  22. package/dist/FrontendAppConfigJsonCodec-nOCQI0ag.js +84 -0
  23. package/dist/FrontendAppConfigJsonCodec-nOCQI0ag.js.map +1 -0
  24. package/dist/{LogLevelPolicy-4cq9z0TI.d.ts → LogLevelPolicy-BS_NlAOg.d.ts} +2 -2
  25. package/dist/{ServerLoggerFactory-BRHxIDS7.js → ServerLoggerFactory-BltIIDfQ.js} +4 -129
  26. package/dist/ServerLoggerFactory-BltIIDfQ.js.map +1 -0
  27. package/dist/client.d.ts +5 -3
  28. package/dist/client.js +2 -1
  29. package/dist/client.js.map +1 -1
  30. package/dist/consumer.d.ts +5 -4
  31. package/dist/consumer.js +4 -4
  32. package/dist/credentials.d.ts +4 -4
  33. package/dist/credentials.js +3 -3
  34. package/dist/devServerSidecar.d.ts +1 -1
  35. package/dist/{index-Bs4F1IsC.d.ts → index-CkiptHb-.d.ts} +19 -20
  36. package/dist/index.d.ts +14 -19
  37. package/dist/index.js +12 -11
  38. package/dist/nextServer.d.ts +244 -9
  39. package/dist/nextServer.js +8 -8
  40. package/dist/persistenceServer-CaehMh3M.d.ts +9 -0
  41. package/dist/{persistenceServer-8tcM2S48.js → persistenceServer-DVeWUbc3.js} +2 -2
  42. package/dist/{persistenceServer-8tcM2S48.js.map → persistenceServer-DVeWUbc3.js.map} +1 -1
  43. package/dist/persistenceServer.d.ts +7 -6
  44. package/dist/persistenceServer.js +4 -4
  45. package/dist/{server-Dd65rNm6.js → server-C65z_kqm.js} +47 -17
  46. package/dist/server-C65z_kqm.js.map +1 -0
  47. package/dist/{server-BBdsATju.d.ts → server-Dyo8qh4k.d.ts} +23 -4
  48. package/dist/server.d.ts +12 -9
  49. package/dist/server.js +11 -10
  50. package/package.json +11 -6
  51. package/prisma/migrations/20260315063514_init/migration.sql +16 -16
  52. package/prisma/migrations/20260316090000_workflow_debugger_overlay/migration.sql +9 -9
  53. package/prisma/migrations/20260317120000_trigger_state_store/migration.sql +3 -3
  54. package/prisma/migrations/20260317153000_trigger_setup_state/migration.sql +8 -8
  55. package/prisma/migrations/20260318110000_credentials_v2/migration.sql +49 -49
  56. package/prisma/migrations/20260319110000_credential_oauth2_material/migration.sql +28 -28
  57. package/prisma/migrations/20260319200000_codemation_auth_tables/migration.sql +56 -56
  58. package/prisma/migrations/20260320140000_user_invites_account_status/migration.sql +20 -20
  59. package/prisma/migrations/20260325120000_workflow_activation/migration.sql +8 -8
  60. package/prisma/migrations/migration_lock.toml +3 -3
  61. package/prisma/schema.prisma +179 -179
  62. package/prisma.config.ts +15 -2
  63. package/src/application/commands/WorkflowCommandHandlers.ts +9 -0
  64. package/src/application/dev/BootRuntimeSnapshotHolder.ts +2 -2
  65. package/src/application/dev/BootRuntimeSummary.types.ts +2 -2
  66. package/src/application/queries/WorkflowQueryHandlers.ts +7 -0
  67. package/src/applicationTokens.ts +1 -1
  68. package/src/bootstrap/AppContainerFactory.ts +584 -0
  69. package/src/bootstrap/{PreparedCodemationRuntime.ts → AppContainerLifecycle.ts} +3 -8
  70. package/src/bootstrap/runtime/AppConfigFactory.ts +155 -30
  71. package/src/bootstrap/runtime/DatabaseMigrations.ts +18 -0
  72. package/src/bootstrap/runtime/FrontendRuntime.ts +44 -0
  73. package/src/bootstrap/runtime/WorkerRuntime.ts +55 -0
  74. package/src/client.ts +7 -0
  75. package/src/index.ts +15 -5
  76. package/src/infrastructure/persistence/PrismaMigrationDeployer.ts +2 -2
  77. package/src/infrastructure/persistence/SchedulerPersistenceCompatibilityValidator.ts +2 -2
  78. package/src/infrastructure/scheduler/WorkerRuntimeScheduler.ts +16 -0
  79. package/src/infrastructure/scheduler/bullmq/BullmqNodeExecutionScheduler.ts +47 -0
  80. package/src/infrastructure/scheduler/bullmq/BullmqScheduler.ts +33 -0
  81. package/src/infrastructure/scheduler/bullmq/BullmqWorker.ts +48 -0
  82. package/src/infrastructure/scheduler/bullmq/RedisConnectionOptionsFactory.ts +48 -0
  83. package/src/nextServer.ts +12 -3
  84. package/src/persistenceServer.ts +2 -2
  85. package/src/presentation/config/AppConfig.ts +25 -1
  86. package/src/presentation/frontend/CodemationFrontendAuthSnapshot.ts +14 -0
  87. package/src/presentation/frontend/CodemationFrontendAuthSnapshotFactory.ts +84 -0
  88. package/src/presentation/frontend/CodemationFrontendAuthSnapshotJsonCodec.ts +58 -0
  89. package/src/presentation/frontend/FrontendAppConfig.ts +10 -0
  90. package/src/presentation/frontend/FrontendAppConfigFactory.ts +26 -0
  91. package/src/presentation/frontend/FrontendAppConfigJsonCodec.ts +58 -0
  92. package/src/presentation/http/CodemationServerGatewayFactory.ts +22 -16
  93. package/src/presentation/server/AppConfigLoader.ts +39 -0
  94. package/src/presentation/server/CodemationConsumerAppResolver.ts +2 -2
  95. package/src/presentation/server/CodemationConsumerConfigLoader.ts +3 -2
  96. package/src/server.ts +7 -0
  97. package/vitest.shared.ts +0 -4
  98. package/dist/CodemationConsumerConfigLoader-scS_RQMy.js.map +0 -1
  99. package/dist/CodemationFrontendBootstrapRequest-CNEk-C4D.js.map +0 -1
  100. package/dist/CodemationPluginListMerger-BNmaoXQL.js.map +0 -1
  101. package/dist/CodemationPluginListMerger-BRYqEk0y.d.ts +0 -793
  102. package/dist/CredentialServices-BKBGe7l3.js.map +0 -1
  103. package/dist/PrismaMigrationDeployer-B7cHGrXP.js.map +0 -1
  104. package/dist/ServerLoggerFactory-BRHxIDS7.js.map +0 -1
  105. package/dist/persistenceServer-DPSj_-oU.d.ts +0 -37
  106. package/dist/server-Dd65rNm6.js.map +0 -1
  107. package/src/bootstrap/CodemationContainerFactory.ts +0 -310
  108. package/src/bootstrap/CodemationFrontendBootstrapRequest.ts +0 -16
  109. package/src/bootstrap/CodemationWorkerBootstrapRequest.ts +0 -19
  110. package/src/bootstrap/PreparedCodemationRuntimeFactory.ts +0 -308
  111. package/src/bootstrap/boot/CliRuntimeBootService.ts +0 -27
  112. package/src/bootstrap/boot/FrontendRuntimeBootService.ts +0 -86
  113. package/src/bootstrap/boot/WorkerRuntimeBootService.ts +0 -64
  114. package/src/bootstrap/runtime/ResolvedImplementationSelectionFactory.ts +0 -118
  115. package/src/codemationApplication.ts +0 -311
  116. package/src/infrastructure/credentials/FrameworkBuiltinCredentialTypesRegistrar.ts +0 -21
  117. package/src/infrastructure/persistence/DatabasePersistenceResolver.ts +0 -91
  118. package/src/infrastructure/persistence/generated/prisma/client.d.ts +0 -1
  119. package/src/infrastructure/persistence/generated/prisma/default.d.ts +0 -1
  120. package/src/infrastructure/persistence/generated/prisma/edge.d.ts +0 -1
  121. package/src/infrastructure/persistence/generated/prisma/index.d.ts +0 -4766
  122. package/src/infrastructure/persistence/generated/prisma/package.json +0 -144
  123. package/src/infrastructure/persistence/generated/prisma/query_compiler_fast_bg.wasm +0 -0
  124. package/src/infrastructure/persistence/generated/prisma/runtime/client.d.ts +0 -3358
  125. package/src/infrastructure/persistence/generated/prisma/runtime/index-browser.d.ts +0 -90
  126. package/src/infrastructure/persistence/generated/prisma/schema.prisma +0 -35
  127. package/src/infrastructure/persistence/generated/prisma/wasm-edge-light-loader.mjs +0 -5
  128. package/src/infrastructure/persistence/generated/prisma/wasm-worker-loader.mjs +0 -5
  129. package/src/infrastructure/runtime/WorkerRuntimeScheduler.ts +0 -35
  130. package/src/presentation/config/CodemationApplicationFacade.ts +0 -5
  131. /package/dist/{decorate-B-N_5S4p.js → decorate-B0PP651O.js} +0 -0
  132. /package/dist/{decorateParam-BTcc3KNk.js → decorateParam-DrsXNPuw.js} +0 -0
@@ -0,0 +1,391 @@
1
+ import { a as CodemationWhitelabelConfig, l as Logger, t as CodemationAuthConfig, u as LoggerFactory } from "./CodemationAuthConfig-Bh2cCNCI.js";
2
+ import { A as RunId, B as PersistedRunState, D as BinaryAttachment, F as NodeExecutionRequestHandler, H as RunSummary, I as NodeExecutionScheduler, L as WorkflowRepository, M as WorkflowDefinition, N as WorkflowId, U as Clock, V as RunCurrentState, c as AnyCredentialType, i as TypeToken, n as Engine, o as RunEvent, r as Container, s as RunEventBus, z as WorkflowActivationPolicy } from "./index-CkiptHb-.js";
3
+ import { b as CodemationContainerRegistration, g as AppConfig, v as CodemationPlugin } from "./CodemationConfig-D2ULNkec.js";
4
+ import { t as CredentialStore } from "./CredentialServices-BeuMtqYA.js";
5
+ import { n as PrismaMigrationDeployer, r as PrismaClient } from "./AppConfigFactory-DmHOpg8O.js";
6
+ import "reflect-metadata";
7
+ import { Hono } from "hono";
8
+ import { PGlite } from "@electric-sql/pglite";
9
+
10
+ //#region src/application/bus/Command.d.ts
11
+ declare abstract class Command<TResult> {
12
+ protected readonly __resultType?: TResult;
13
+ }
14
+ //#endregion
15
+ //#region src/application/bus/CommandBus.d.ts
16
+ interface CommandBus {
17
+ execute<TResult>(command: Command<TResult>): Promise<TResult>;
18
+ }
19
+ //#endregion
20
+ //#region src/application/bus/Query.d.ts
21
+ declare abstract class Query<TResult> {
22
+ protected readonly __resultType?: TResult;
23
+ }
24
+ //#endregion
25
+ //#region src/application/bus/QueryBus.d.ts
26
+ interface QueryBus {
27
+ execute<TResult>(query: Query<TResult>): Promise<TResult>;
28
+ }
29
+ //#endregion
30
+ //#region src/application/contracts/userDirectoryContracts.types.d.ts
31
+ type UserAccountStatus = "invited" | "active" | "inactive";
32
+ type UserAccountDto = Readonly<{
33
+ id: string;
34
+ email: string;
35
+ status: UserAccountStatus;
36
+ inviteExpiresAt: string | null;
37
+ /** Ways the user can sign in (password + linked OAuth / OIDC / email-link accounts). */
38
+ loginMethods: ReadonlyArray<string>;
39
+ }>;
40
+ /** Result of CLI/bootstrap `upsert` for a local password user (distinct from invite-based onboarding). */
41
+ type UpsertLocalBootstrapUserResultDto = Readonly<{
42
+ outcome: "created" | "updated";
43
+ }>;
44
+ //#endregion
45
+ //#region src/application/queries/ListUserAccountsQuery.d.ts
46
+ declare class ListUserAccountsQuery extends Query<ReadonlyArray<UserAccountDto>> {}
47
+ //#endregion
48
+ //#region src/application/commands/UpsertLocalBootstrapUserCommand.d.ts
49
+ declare class UpsertLocalBootstrapUserCommand extends Command<UpsertLocalBootstrapUserResultDto> {
50
+ readonly email: string;
51
+ readonly password: string;
52
+ constructor(email: string, password: string);
53
+ }
54
+ //#endregion
55
+ //#region src/application/bus/CommandHandler.d.ts
56
+ declare abstract class CommandHandler<TCommand extends Command<TResult>, TResult> {
57
+ abstract execute(command: TCommand): Promise<TResult>;
58
+ }
59
+ //#endregion
60
+ //#region src/domain/runs/WorkflowRunRepository.d.ts
61
+ interface WorkflowRunRepository {
62
+ load(runId: string): Promise<PersistedRunState | undefined>;
63
+ save(state: PersistedRunState): Promise<void>;
64
+ listRuns(args: Readonly<{
65
+ workflowId?: string;
66
+ limit?: number;
67
+ }>): Promise<ReadonlyArray<RunSummary>>;
68
+ deleteRun(runId: RunId): Promise<void>;
69
+ }
70
+ //#endregion
71
+ //#region src/domain/workflows/WorkflowDebuggerOverlayState.d.ts
72
+ type WorkflowDebuggerOverlayState = Readonly<{
73
+ workflowId: string;
74
+ updatedAt: string;
75
+ copiedFromRunId?: string;
76
+ currentState: RunCurrentState;
77
+ }>;
78
+ //#endregion
79
+ //#region src/domain/workflows/WorkflowDebuggerOverlayRepository.d.ts
80
+ interface WorkflowDebuggerOverlayRepository {
81
+ load(workflowId: string): Promise<WorkflowDebuggerOverlayState | undefined>;
82
+ save(state: WorkflowDebuggerOverlayState): Promise<void>;
83
+ }
84
+ //#endregion
85
+ //#region src/domain/workflows/WorkflowDefinitionRepository.d.ts
86
+ interface WorkflowDefinitionRepository {
87
+ listDefinitions(): Promise<ReadonlyArray<WorkflowDefinition>>;
88
+ getDefinition(workflowId: string): Promise<WorkflowDefinition | undefined>;
89
+ resolveSnapshot(args: Readonly<{
90
+ workflowId: string;
91
+ workflowSnapshot?: unknown;
92
+ }>): Promise<WorkflowDefinition | undefined>;
93
+ }
94
+ //#endregion
95
+ //#region src/domain/workflows/WorkflowActivationRepository.d.ts
96
+ type WorkflowActivationRow = Readonly<{
97
+ workflowId: string;
98
+ isActive: boolean;
99
+ }>;
100
+ interface WorkflowActivationRepository {
101
+ loadAll(): Promise<ReadonlyArray<WorkflowActivationRow>>;
102
+ upsert(workflowId: string, active: boolean): Promise<void>;
103
+ }
104
+ //#endregion
105
+ //#region src/infrastructure/persistence/RuntimeWorkflowActivationPolicy.d.ts
106
+ /**
107
+ * In-memory activation map: missing workflow id ⇒ inactive. Hydrated from persistence at startup and updated on command.
108
+ */
109
+ declare class RuntimeWorkflowActivationPolicy implements WorkflowActivationPolicy {
110
+ private readonly activeByWorkflowId;
111
+ hydrateFromRepository(repository: WorkflowActivationRepository): Promise<void>;
112
+ set(workflowId: string, active: boolean): void;
113
+ isActive(workflowId: WorkflowId): boolean;
114
+ }
115
+ //#endregion
116
+ //#region src/application/bus/QueryHandler.d.ts
117
+ declare abstract class QueryHandler<TQuery extends Query<TResult>, TResult> {
118
+ abstract execute(query: TQuery): Promise<TResult>;
119
+ }
120
+ //#endregion
121
+ //#region src/application/binary/RunBinaryAttachmentLookupService.d.ts
122
+ declare class RunBinaryAttachmentLookupService {
123
+ private readonly workflowRunRepository;
124
+ private readonly workflowDebuggerOverlayRepository;
125
+ constructor(workflowRunRepository: WorkflowRunRepository, workflowDebuggerOverlayRepository: WorkflowDebuggerOverlayRepository);
126
+ findForRun(runId: string, binaryId: string): Promise<BinaryAttachment | undefined>;
127
+ findForWorkflowOverlay(workflowId: string, binaryId: string): Promise<BinaryAttachment | undefined>;
128
+ private findInRunState;
129
+ private findInCurrentState;
130
+ private findInOutputsByNode;
131
+ private findInNodeSnapshots;
132
+ private findInCurrentStateSnapshots;
133
+ private findInMutableState;
134
+ private findInPortItemMap;
135
+ private findInItems;
136
+ }
137
+ //#endregion
138
+ //#region src/infrastructure/config/CodemationPluginRegistrar.d.ts
139
+ declare class CodemationPluginRegistrar {
140
+ apply(args: Readonly<{
141
+ plugins: ReadonlyArray<CodemationPlugin>;
142
+ container: Container;
143
+ appConfig: AppConfig;
144
+ registerCredentialType: (type: AnyCredentialType) => void;
145
+ loggerFactory: LoggerFactory;
146
+ }>): Promise<void>;
147
+ }
148
+ //#endregion
149
+ //#region src/application/contracts/WorkflowWebsocketMessage.d.ts
150
+ type WorkflowWebsocketMessage = Readonly<{
151
+ kind: "event";
152
+ event: RunEvent;
153
+ }> | Readonly<{
154
+ kind: "workflowChanged";
155
+ workflowId: string;
156
+ }> | Readonly<{
157
+ kind: "devBuildStarted";
158
+ workflowId: string;
159
+ buildVersion?: string;
160
+ }> | Readonly<{
161
+ kind: "devBuildCompleted";
162
+ workflowId: string;
163
+ buildVersion: string;
164
+ }> | Readonly<{
165
+ kind: "devBuildFailed";
166
+ workflowId: string;
167
+ message: string;
168
+ }>;
169
+ //#endregion
170
+ //#region src/application/websocket/WorkflowWebsocketPublisher.d.ts
171
+ interface WorkflowWebsocketPublisher {
172
+ publishToRoom(roomId: string, message: WorkflowWebsocketMessage): Promise<void>;
173
+ }
174
+ //#endregion
175
+ //#region src/presentation/websocket/WorkflowWebsocketServer.d.ts
176
+ declare class WorkflowWebsocketServer implements WorkflowWebsocketPublisher {
177
+ private readonly port;
178
+ private readonly bindHost;
179
+ private readonly logger;
180
+ private websocketServer;
181
+ private readonly sockets;
182
+ private readonly roomIdsBySocket;
183
+ private started;
184
+ constructor(port: number, bindHost: string, logger: Logger);
185
+ start(): Promise<void>;
186
+ stop(): Promise<void>;
187
+ publishToRoom(roomId: string, message: WorkflowWebsocketMessage): Promise<void>;
188
+ private connect;
189
+ private handleMessage;
190
+ private awaitListening;
191
+ private closeAfterFailedStart;
192
+ private parseClientMessage;
193
+ }
194
+ //#endregion
195
+ //#region src/bootstrap/CodemationContainerRegistrationRegistrar.d.ts
196
+ declare class CodemationContainerRegistrationRegistrar {
197
+ apply(container: Container, registrations: ReadonlyArray<CodemationContainerRegistration<unknown>>): void;
198
+ private applyRegistration;
199
+ private isValueRegistration;
200
+ private isClassRegistration;
201
+ }
202
+ //#endregion
203
+ //#region src/bootstrap/AppContainerFactory.d.ts
204
+ type AppContainerInputs = Readonly<{
205
+ appConfig: AppConfig;
206
+ sharedWorkflowWebsocketServer: WorkflowWebsocketServer | null;
207
+ }>;
208
+ declare class AppContainerFactory {
209
+ private readonly containerRegistrationRegistrar;
210
+ private readonly pluginRegistrar;
211
+ private static readonly honoRouteRegistrars;
212
+ constructor(containerRegistrationRegistrar?: CodemationContainerRegistrationRegistrar, pluginRegistrar?: CodemationPluginRegistrar);
213
+ create(inputs: AppContainerInputs): Promise<Container>;
214
+ private collectCredentialTypes;
215
+ private applyPlugins;
216
+ private registerCredentialTypes;
217
+ private registerConfiguredRegistrations;
218
+ private registerCoreInfrastructure;
219
+ private registerRepositoriesAndBuses;
220
+ private registerApplicationServicesAndRoutes;
221
+ private registerOperationalInfrastructure;
222
+ private registerRuntimeInfrastructure;
223
+ private resolvePrismaOwnership;
224
+ private registerRuntimeNodeActivationScheduler;
225
+ private createBinaryStorage;
226
+ private createRuntimeSummary;
227
+ private requireRedisUrl;
228
+ private synchronizeLiveWorkflowRepository;
229
+ }
230
+ //#endregion
231
+ //#region src/bootstrap/AppContainerLifecycle.d.ts
232
+ declare class AppContainerLifecycle {
233
+ private readonly container;
234
+ private readonly ownedPrismaClient;
235
+ private readonly ownedPglite;
236
+ constructor(container: Container, ownedPrismaClient: PrismaClient | null, ownedPglite: PGlite | null);
237
+ stop(args?: Readonly<{
238
+ stopWebsocketServer?: boolean;
239
+ }>): Promise<void>;
240
+ }
241
+ //#endregion
242
+ //#region src/bootstrap/runtime/DatabaseMigrations.d.ts
243
+ declare class DatabaseMigrations {
244
+ private readonly appConfig;
245
+ private readonly prismaMigrationDeployer;
246
+ constructor(appConfig: AppConfig, prismaMigrationDeployer: PrismaMigrationDeployer);
247
+ migrate(): Promise<void>;
248
+ }
249
+ //#endregion
250
+ //#region src/application/websocket/WorkflowRunEventWebsocketRelay.d.ts
251
+ declare class WorkflowRunEventWebsocketRelay {
252
+ private readonly workflowWebsocketPublisher;
253
+ private readonly runEventBus;
254
+ private subscription;
255
+ constructor(workflowWebsocketPublisher: WorkflowWebsocketPublisher, runEventBus: RunEventBus);
256
+ start(): Promise<void>;
257
+ stop(): Promise<void>;
258
+ }
259
+ //#endregion
260
+ //#region src/bootstrap/runtime/FrontendRuntime.d.ts
261
+ declare class FrontendRuntime {
262
+ private readonly appConfig;
263
+ private readonly databaseMigrations;
264
+ private readonly runtimeWorkflowActivationPolicy;
265
+ private readonly workflowActivationRepository;
266
+ private readonly workflowRepository;
267
+ private readonly workflowWebsocketServer;
268
+ private readonly workflowRunEventWebsocketRelay;
269
+ private readonly engine;
270
+ constructor(appConfig: AppConfig, databaseMigrations: DatabaseMigrations, runtimeWorkflowActivationPolicy: RuntimeWorkflowActivationPolicy, workflowActivationRepository: WorkflowActivationRepository, workflowRepository: WorkflowRepository, workflowWebsocketServer: WorkflowWebsocketServer, workflowRunEventWebsocketRelay: WorkflowRunEventWebsocketRelay, engine: Engine);
271
+ start(args?: Readonly<{
272
+ skipPresentationServers?: boolean;
273
+ }>): Promise<void>;
274
+ }
275
+ //#endregion
276
+ //#region src/infrastructure/scheduler/WorkerRuntimeScheduler.d.ts
277
+ type WorkerRuntimeHandle = Readonly<{
278
+ stop: () => Promise<void>;
279
+ }>;
280
+ interface WorkerRuntimeScheduler extends NodeExecutionScheduler {
281
+ createWorker(args: Readonly<{
282
+ queues: ReadonlyArray<string>;
283
+ requestHandler: NodeExecutionRequestHandler;
284
+ }>): WorkerRuntimeHandle;
285
+ close(): Promise<void>;
286
+ }
287
+ //#endregion
288
+ //#region src/bootstrap/runtime/WorkerRuntime.d.ts
289
+ declare class WorkerRuntime {
290
+ private readonly appConfig;
291
+ private readonly databaseMigrations;
292
+ private readonly runtimeWorkflowActivationPolicy;
293
+ private readonly workflowActivationRepository;
294
+ private readonly workflowRepository;
295
+ private readonly engine;
296
+ private readonly scheduler;
297
+ private readonly lifecycle;
298
+ constructor(appConfig: AppConfig, databaseMigrations: DatabaseMigrations, runtimeWorkflowActivationPolicy: RuntimeWorkflowActivationPolicy, workflowActivationRepository: WorkflowActivationRepository, workflowRepository: WorkflowRepository, engine: Engine, scheduler: WorkerRuntimeScheduler, lifecycle: AppContainerLifecycle);
299
+ start(queues: ReadonlyArray<string>): Promise<WorkerRuntimeHandle>;
300
+ }
301
+ //#endregion
302
+ //#region src/application/auth/AuthenticatedPrincipal.d.ts
303
+ type AuthenticatedPrincipal = Readonly<{
304
+ id: string;
305
+ email: string | null;
306
+ name: string | null;
307
+ }>;
308
+ //#endregion
309
+ //#region src/application/auth/SessionVerifier.d.ts
310
+ interface SessionVerifier {
311
+ verify(request: Request): Promise<AuthenticatedPrincipal | null>;
312
+ }
313
+ //#endregion
314
+ //#region src/application/bus/DomainEvent.d.ts
315
+ declare abstract class DomainEvent {}
316
+ //#endregion
317
+ //#region src/application/bus/DomainEventBus.d.ts
318
+ interface DomainEventBus {
319
+ publish(event: DomainEvent): Promise<void>;
320
+ }
321
+ //#endregion
322
+ //#region src/application/bus/DomainEventHandler.d.ts
323
+ declare abstract class DomainEventHandler<TEvent extends DomainEvent> {
324
+ abstract handle(event: TEvent): Promise<void>;
325
+ }
326
+ //#endregion
327
+ //#region src/presentation/http/hono/HonoApiRouteRegistrar.d.ts
328
+ interface HonoApiRouteRegistrar {
329
+ register(app: Hono): void;
330
+ }
331
+ //#endregion
332
+ //#region src/applicationTokens.d.ts
333
+ declare const ApplicationTokens: {
334
+ readonly CodemationAuthConfig: TypeToken<CodemationAuthConfig | undefined>;
335
+ readonly CodemationWhitelabelConfig: TypeToken<CodemationWhitelabelConfig>;
336
+ readonly AppConfig: TypeToken<AppConfig>;
337
+ readonly WebSocketPort: TypeToken<number>;
338
+ readonly WebSocketBindHost: TypeToken<string>;
339
+ readonly QueryBus: TypeToken<QueryBus>;
340
+ readonly CommandBus: TypeToken<CommandBus>;
341
+ readonly DomainEventBus: TypeToken<DomainEventBus>;
342
+ readonly QueryHandler: TypeToken<QueryHandler<Query<unknown>, unknown>>;
343
+ readonly CommandHandler: TypeToken<CommandHandler<Command<unknown>, unknown>>;
344
+ readonly DomainEventHandler: TypeToken<DomainEventHandler<DomainEvent>>;
345
+ readonly HonoApiRouteRegistrar: TypeToken<HonoApiRouteRegistrar>;
346
+ readonly WorkflowWebsocketPublisher: TypeToken<WorkflowWebsocketPublisher>;
347
+ readonly WorkerRuntimeScheduler: TypeToken<WorkerRuntimeScheduler>;
348
+ readonly WorkflowDefinitionRepository: TypeToken<WorkflowDefinitionRepository>;
349
+ readonly WorkflowActivationRepository: TypeToken<WorkflowActivationRepository>;
350
+ readonly WorkflowDebuggerOverlayRepository: TypeToken<WorkflowDebuggerOverlayRepository>;
351
+ readonly WorkflowRunRepository: TypeToken<WorkflowRunRepository>;
352
+ readonly LoggerFactory: TypeToken<LoggerFactory>;
353
+ /**
354
+ * Opt-in timing/diagnostics logger (`CODEMATION_PERFORMANCE_LOGGING` + normal minimum log level).
355
+ */
356
+ readonly PerformanceDiagnosticsLogger: TypeToken<Logger>;
357
+ readonly CredentialStore: TypeToken<CredentialStore>;
358
+ readonly PrismaClient: TypeToken<PrismaClient>;
359
+ readonly SessionVerifier: TypeToken<SessionVerifier>;
360
+ readonly Clock: TypeToken<Clock>;
361
+ };
362
+ //#endregion
363
+ //#region src/bootstrap/CodemationBootstrapRequest.d.ts
364
+ declare class CodemationBootstrapRequest {
365
+ readonly consumerRoot: string;
366
+ readonly repoRoot: string;
367
+ readonly workflowSources: ReadonlyArray<string>;
368
+ readonly env?: Readonly<NodeJS.ProcessEnv>;
369
+ constructor(args: Readonly<{
370
+ consumerRoot: string;
371
+ repoRoot: string;
372
+ workflowSources?: ReadonlyArray<string>;
373
+ env?: Readonly<NodeJS.ProcessEnv>;
374
+ }>);
375
+ resolveEnvironment(): NodeJS.ProcessEnv;
376
+ }
377
+ //#endregion
378
+ //#region src/presentation/config/CodemationPluginListMerger.d.ts
379
+ /**
380
+ * Merges explicitly configured plugins with auto-discovered plugins.
381
+ * Configured plugins are applied first; discovered plugins fill in gaps.
382
+ * Plugins that declare `pluginPackageId` are deduped by that string so the same npm package is not
383
+ * registered twice when the consumer config lists a plugin and discovery also finds it, or when two
384
+ * module evaluations produce different `constructor` identities for the same logical plugin.
385
+ */
386
+ declare class CodemationPluginListMerger {
387
+ merge(configuredPlugins: ReadonlyArray<CodemationPlugin>, discoveredPlugins: ReadonlyArray<CodemationPlugin>): ReadonlyArray<CodemationPlugin>;
388
+ }
389
+ //#endregion
390
+ export { QueryBus as _, SessionVerifier as a, DatabaseMigrations as c, WorkflowWebsocketServer as d, RunBinaryAttachmentLookupService as f, UpsertLocalBootstrapUserResultDto as g, ListUserAccountsQuery as h, HonoApiRouteRegistrar as i, AppContainerLifecycle as l, UpsertLocalBootstrapUserCommand as m, CodemationBootstrapRequest as n, WorkerRuntime as o, WorkflowRunRepository as p, ApplicationTokens as r, FrontendRuntime as s, CodemationPluginListMerger as t, AppContainerFactory as u, CommandBus as v };
391
+ //# sourceMappingURL=CodemationPluginListMerger-B0-e4CJ6.d.ts.map
@@ -1,12 +1,20 @@
1
- //#region src/bootstrap/CodemationWorkerBootstrapRequest.ts
2
- var CodemationWorkerBootstrapRequest = class {
3
- bootstrap;
4
- queues;
5
- bootstrapSource;
1
+ //#region src/bootstrap/CodemationBootstrapRequest.ts
2
+ var CodemationBootstrapRequest = class {
3
+ consumerRoot;
4
+ repoRoot;
5
+ workflowSources;
6
+ env;
6
7
  constructor(args) {
7
- this.bootstrap = args.bootstrap;
8
- this.queues = [...args.queues];
9
- this.bootstrapSource = args.bootstrapSource;
8
+ this.consumerRoot = args.consumerRoot;
9
+ this.repoRoot = args.repoRoot;
10
+ this.workflowSources = [...args.workflowSources ?? []];
11
+ this.env = args.env;
12
+ }
13
+ resolveEnvironment() {
14
+ return {
15
+ ...process.env,
16
+ ...this.env ?? {}
17
+ };
10
18
  }
11
19
  };
12
20
 
@@ -45,5 +53,5 @@ var CodemationPluginListMerger = class {
45
53
  };
46
54
 
47
55
  //#endregion
48
- export { CodemationWorkerBootstrapRequest as n, CodemationPluginListMerger as t };
49
- //# sourceMappingURL=CodemationPluginListMerger-BNmaoXQL.js.map
56
+ export { CodemationBootstrapRequest as n, CodemationPluginListMerger as t };
57
+ //# sourceMappingURL=CodemationPluginListMerger-DrVOw9KP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodemationPluginListMerger-DrVOw9KP.js","names":["result: CodemationPlugin[]"],"sources":["../src/bootstrap/CodemationBootstrapRequest.ts","../src/presentation/config/CodemationPluginListMerger.ts"],"sourcesContent":["export class CodemationBootstrapRequest {\n readonly consumerRoot: string;\n readonly repoRoot: string;\n readonly workflowSources: ReadonlyArray<string>;\n readonly env?: Readonly<NodeJS.ProcessEnv>;\n\n constructor(\n args: Readonly<{\n consumerRoot: string;\n repoRoot: string;\n workflowSources?: ReadonlyArray<string>;\n env?: Readonly<NodeJS.ProcessEnv>;\n }>,\n ) {\n this.consumerRoot = args.consumerRoot;\n this.repoRoot = args.repoRoot;\n this.workflowSources = [...(args.workflowSources ?? [])];\n this.env = args.env;\n }\n\n resolveEnvironment(): NodeJS.ProcessEnv {\n return {\n ...process.env,\n ...(this.env ?? {}),\n };\n }\n}\n","import type { CodemationPlugin } from \"./CodemationPlugin\";\n\n/**\n * Merges explicitly configured plugins with auto-discovered plugins.\n * Configured plugins are applied first; discovered plugins fill in gaps.\n * Plugins that declare `pluginPackageId` are deduped by that string so the same npm package is not\n * registered twice when the consumer config lists a plugin and discovery also finds it, or when two\n * module evaluations produce different `constructor` identities for the same logical plugin.\n */\nexport class CodemationPluginListMerger {\n merge(\n configuredPlugins: ReadonlyArray<CodemationPlugin>,\n discoveredPlugins: ReadonlyArray<CodemationPlugin>,\n ): ReadonlyArray<CodemationPlugin> {\n const pluginsByPackageId = new Map<string, CodemationPlugin>();\n const pluginsByConstructor = new Map<unknown, CodemationPlugin>();\n const result: CodemationPlugin[] = [];\n\n const tryAdd = (plugin: CodemationPlugin): void => {\n const packageId = plugin.pluginPackageId;\n if (typeof packageId === \"string\" && packageId.trim().length > 0) {\n const key = packageId.trim();\n if (pluginsByPackageId.has(key)) {\n return;\n }\n pluginsByPackageId.set(key, plugin);\n result.push(plugin);\n return;\n }\n const constructorKey = Object.getPrototypeOf(plugin)?.constructor ?? plugin;\n if (pluginsByConstructor.has(constructorKey)) {\n return;\n }\n pluginsByConstructor.set(constructorKey, plugin);\n result.push(plugin);\n };\n\n for (const plugin of configuredPlugins) {\n tryAdd(plugin);\n }\n for (const plugin of discoveredPlugins) {\n tryAdd(plugin);\n }\n return result;\n }\n}\n"],"mappings":";AAAA,IAAa,6BAAb,MAAwC;CACtC,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CAET,YACE,MAMA;AACA,OAAK,eAAe,KAAK;AACzB,OAAK,WAAW,KAAK;AACrB,OAAK,kBAAkB,CAAC,GAAI,KAAK,mBAAmB,EAAE,CAAE;AACxD,OAAK,MAAM,KAAK;;CAGlB,qBAAwC;AACtC,SAAO;GACL,GAAG,QAAQ;GACX,GAAI,KAAK,OAAO,EAAE;GACnB;;;;;;;;;;;;;ACfL,IAAa,6BAAb,MAAwC;CACtC,MACE,mBACA,mBACiC;EACjC,MAAM,qCAAqB,IAAI,KAA+B;EAC9D,MAAM,uCAAuB,IAAI,KAAgC;EACjE,MAAMA,SAA6B,EAAE;EAErC,MAAM,UAAU,WAAmC;GACjD,MAAM,YAAY,OAAO;AACzB,OAAI,OAAO,cAAc,YAAY,UAAU,MAAM,CAAC,SAAS,GAAG;IAChE,MAAM,MAAM,UAAU,MAAM;AAC5B,QAAI,mBAAmB,IAAI,IAAI,CAC7B;AAEF,uBAAmB,IAAI,KAAK,OAAO;AACnC,WAAO,KAAK,OAAO;AACnB;;GAEF,MAAM,iBAAiB,OAAO,eAAe,OAAO,EAAE,eAAe;AACrE,OAAI,qBAAqB,IAAI,eAAe,CAC1C;AAEF,wBAAqB,IAAI,gBAAgB,OAAO;AAChD,UAAO,KAAK,OAAO;;AAGrB,OAAK,MAAM,UAAU,kBACnB,QAAO,OAAO;AAEhB,OAAK,MAAM,UAAU,kBACnB,QAAO,OAAO;AAEhB,SAAO"}
@@ -1,5 +1,5 @@
1
- import { C as CredentialTypeId, L as WorkflowRepository, S as CredentialTypeDefinition, _ as CredentialRequirement, b as CredentialSetupStatus, c as CredentialBinding, d as CredentialHealth, f as CredentialInstanceId, h as CredentialMaterialSourceKind, j as WorkflowDefinition, l as CredentialBindingKey, m as CredentialJsonRecord, p as CredentialInstanceRecord, s as AnyCredentialType, u as CredentialFieldSchema, w as CredentialTypeRegistry, x as CredentialType, y as CredentialSessionService } from "./index-Bs4F1IsC.js";
2
- import { y as AppConfig } from "./CodemationConfig-XCkSV2dj.js";
1
+ import { C as CredentialTypeDefinition, L as WorkflowRepository, M as WorkflowDefinition, S as CredentialType, T as CredentialTypeRegistry, b as CredentialSessionService, c as AnyCredentialType, d as CredentialFieldSchema, f as CredentialHealth, g as CredentialMaterialSourceKind, h as CredentialJsonRecord, l as CredentialBinding, m as CredentialInstanceRecord, p as CredentialInstanceId, u as CredentialBindingKey, v as CredentialRequirement, w as CredentialTypeId, x as CredentialSetupStatus } from "./index-CkiptHb-.js";
2
+ import { g as AppConfig } from "./CodemationConfig-D2ULNkec.js";
3
3
 
4
4
  //#region src/domain/credentials/CredentialTypeRegistryImpl.d.ts
5
5
  declare class CredentialTypeRegistryImpl implements CredentialTypeRegistry {
@@ -288,4 +288,4 @@ type MutableCredentialSessionService = CredentialSessionService & Readonly<{
288
288
  }>;
289
289
  //#endregion
290
290
  export { CredentialInstanceService as a, CredentialFieldEnvOverlayService as c, CredentialBindingService as i, CredentialTypeRegistryImpl as l, CredentialType$1 as n, CredentialMaterialResolver as o, CredentialRuntimeMaterialService as r, CredentialSecretCipher as s, CredentialStore as t };
291
- //# sourceMappingURL=CredentialServices-DpDpm8mL.d.ts.map
291
+ //# sourceMappingURL=CredentialServices-BeuMtqYA.d.ts.map
@@ -1,5 +1,5 @@
1
- import { n as __decorateMetadata, t as __decorateParam } from "./decorateParam-BTcc3KNk.js";
2
- import { t as __decorate } from "./decorate-B-N_5S4p.js";
1
+ import { n as __decorateMetadata, t as __decorateParam } from "./decorateParam-DrsXNPuw.js";
2
+ import { t as __decorate } from "./decorate-B0PP651O.js";
3
3
  import { AgentConfigInspector, ConnectionNodeIdFactory, CoreTokens, CredentialUnboundError, WorkflowExecutableNodeClassifierFactory, inject, injectable } from "@codemation/core";
4
4
  import { createCipheriv, createDecipheriv, createHash, randomBytes, randomUUID } from "node:crypto";
5
5
 
@@ -1027,4 +1027,4 @@ CredentialTestService = __decorate([
1027
1027
 
1028
1028
  //#endregion
1029
1029
  export { CredentialInstanceService as a, CredentialFieldEnvOverlayService as c, ApplicationRequestError as d, CredentialTypeRegistryImpl as f, CredentialBindingService as i, WorkflowCredentialNodeResolver as l, OpenAiApiKeyCredentialHealthTester as m, CredentialSessionServiceImpl as n, CredentialMaterialResolver as o, OpenAiApiKeyCredentialTypeFactory as p, CredentialRuntimeMaterialService as r, CredentialSecretCipher as s, CredentialTestService as t, ApplicationTokens as u };
1030
- //# sourceMappingURL=CredentialServices-BKBGe7l3.js.map
1030
+ //# sourceMappingURL=CredentialServices-DNb3CZwW.js.map