@codemation/host 0.2.5 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/{AppConfigFactory-CqKWXqOm.js → AppConfigFactory-BPp02HMv.js} +82 -5
  3. package/dist/{AppConfigFactory-CqKWXqOm.js.map → AppConfigFactory-BPp02HMv.js.map} +1 -1
  4. package/dist/{AppConfigFactory-CK28UPK0.d.ts → AppConfigFactory-Dq7ttwQ_.d.ts} +6001 -144
  5. package/dist/{AppContainerFactory-CcSGFNLW.js → AppContainerFactory-D9je1sSV.js} +2604 -155
  6. package/dist/AppContainerFactory-D9je1sSV.js.map +1 -0
  7. package/dist/{CodemationAppContext-KqDoeHqN.d.ts → CodemationAppContext-P7P-xZhQ.d.ts} +2 -2
  8. package/dist/{CodemationAuthoring.types-BP6Inucu.d.ts → CodemationAuthoring.types-OMYu7vKP.d.ts} +3 -3
  9. package/dist/{CodemationConfigNormalizer-DIAE0VHw.d.ts → CodemationConfigNormalizer-BCtBrJDe.d.ts} +2 -2
  10. package/dist/{CodemationConsumerConfigLoader-nj9kTmfJ.d.ts → CodemationConsumerConfigLoader-evvw4b_a.d.ts} +2 -2
  11. package/dist/CodemationPluginListMerger-PSTtEQjC.d.ts +674 -0
  12. package/dist/{CredentialServices-BFQD_VN1.d.ts → CredentialServices-0Hk8RFY1.d.ts} +3 -3
  13. package/dist/{CredentialServices-BPKUF8Xs.js → CredentialServices-BNBMFOPt.js} +6 -1
  14. package/dist/CredentialServices-BNBMFOPt.js.map +1 -0
  15. package/dist/{PublicFrontendBootstrapFactory-DTA1iDo0.d.ts → PublicFrontendBootstrapFactory-D0_ds7nS.d.ts} +2 -2
  16. package/dist/authoring.d.ts +3 -3
  17. package/dist/consumer.d.ts +4 -4
  18. package/dist/credentials.d.ts +3 -3
  19. package/dist/credentials.js +1 -1
  20. package/dist/devServerSidecar.d.ts +1 -1
  21. package/dist/{index-Dd6BrWyH.d.ts → index-CeS2saCe.d.ts} +105 -2
  22. package/dist/index.d.ts +12 -11
  23. package/dist/index.js +5 -5
  24. package/dist/nextServer.d.ts +8 -58
  25. package/dist/nextServer.js +6 -100
  26. package/dist/{persistenceServer-DKbFDxoS.js → persistenceServer-CA0_q0D7.js} +2 -2
  27. package/dist/{persistenceServer-DKbFDxoS.js.map → persistenceServer-CA0_q0D7.js.map} +1 -1
  28. package/dist/{persistenceServer-Y-u7lV7f.d.ts → persistenceServer-CJeu1STC.d.ts} +2 -2
  29. package/dist/persistenceServer.d.ts +5 -5
  30. package/dist/persistenceServer.js +2 -2
  31. package/dist/{server-CFpgKuVE.js → server-C_ZIEOTY.js} +4 -4
  32. package/dist/{server-CFpgKuVE.js.map → server-C_ZIEOTY.js.map} +1 -1
  33. package/dist/{server-axppTMgo.d.ts → server-Clvg5x1w.d.ts} +11 -5
  34. package/dist/server.d.ts +8 -8
  35. package/dist/server.js +5 -5
  36. package/package.json +6 -5
  37. package/prisma/migrations/20260414120000_telemetry_foundation/migration.sql +112 -0
  38. package/prisma/migrations/20260414153000_telemetry_retention_metrics_refactor/migration.sql +239 -0
  39. package/prisma/migrations.sqlite/20260414120000_telemetry_foundation/migration.sql +103 -0
  40. package/prisma/migrations.sqlite/20260414153000_telemetry_retention_metrics_refactor/migration.sql +540 -0
  41. package/prisma/schema.postgresql.prisma +100 -1
  42. package/prisma/schema.sqlite.prisma +100 -1
  43. package/scripts/generate-prisma-clients.mjs +89 -1
  44. package/src/application/contracts/TelemetryDashboardContracts.ts +113 -0
  45. package/src/application/contracts/TelemetryRunTraceContracts.ts +13 -0
  46. package/src/application/cost/FrameworkCostCatalogEntries.ts +126 -0
  47. package/src/application/queries/GetTelemetryDashboardDimensionsQuery.ts +11 -0
  48. package/src/application/queries/GetTelemetryDashboardDimensionsQueryHandler.ts +20 -0
  49. package/src/application/queries/GetTelemetryDashboardRunsQuery.ts +11 -0
  50. package/src/application/queries/GetTelemetryDashboardRunsQueryHandler.ts +20 -0
  51. package/src/application/queries/GetTelemetryDashboardSummaryQuery.ts +11 -0
  52. package/src/application/queries/GetTelemetryDashboardSummaryQueryHandler.ts +29 -0
  53. package/src/application/queries/GetTelemetryDashboardTimeseriesQuery.ts +11 -0
  54. package/src/application/queries/GetTelemetryDashboardTimeseriesQueryHandler.ts +36 -0
  55. package/src/application/queries/GetTelemetryRunTraceQuery.ts +8 -0
  56. package/src/application/queries/GetTelemetryRunTraceQueryHandler.ts +20 -0
  57. package/src/application/queries/WorkflowQueryHandlers.ts +5 -0
  58. package/src/application/runs/WorkflowRunRetentionPruneScheduler.ts +71 -26
  59. package/src/application/telemetry/CompositeTelemetryExporter.ts +13 -0
  60. package/src/application/telemetry/LazyExecutionTelemetryFactory.ts +21 -0
  61. package/src/application/telemetry/NoOpTelemetryExporter.ts +7 -0
  62. package/src/application/telemetry/OtelExecutionTelemetry.types.ts +41 -0
  63. package/src/application/telemetry/OtelExecutionTelemetryFactory.ts +56 -0
  64. package/src/application/telemetry/OtelIdentityFactory.ts +41 -0
  65. package/src/application/telemetry/RunEventBusTelemetryReporter.ts +188 -0
  66. package/src/application/telemetry/StoredExecutionTelemetry.ts +56 -0
  67. package/src/application/telemetry/StoredNodeExecutionTelemetry.ts +35 -0
  68. package/src/application/telemetry/StoredTelemetrySpanScope.ts +188 -0
  69. package/src/application/telemetry/TelemetryEnricherChain.ts +85 -0
  70. package/src/application/telemetry/TelemetryPrivacyPolicy.ts +19 -0
  71. package/src/application/telemetry/TelemetryQueryService.ts +815 -0
  72. package/src/application/telemetry/TelemetryRetentionTimestampFactory.ts +40 -0
  73. package/src/applicationTokens.ts +18 -0
  74. package/src/bootstrap/AppContainerFactory.ts +124 -1
  75. package/src/bootstrap/AppContainerLifecycle.ts +8 -0
  76. package/src/bootstrap/runtime/FrontendRuntime.ts +8 -0
  77. package/src/bootstrap/runtime/WorkerRuntime.ts +8 -0
  78. package/src/domain/runs/WorkflowRunRepository.ts +3 -1
  79. package/src/domain/telemetry/TelemetryContracts.ts +197 -0
  80. package/src/infrastructure/persistence/InMemoryRunTraceContextRepository.ts +56 -0
  81. package/src/infrastructure/persistence/InMemoryTelemetryArtifactStore.ts +56 -0
  82. package/src/infrastructure/persistence/InMemoryTelemetryMetricPointStore.ts +97 -0
  83. package/src/infrastructure/persistence/InMemoryTelemetrySpanStore.ts +113 -0
  84. package/src/infrastructure/persistence/InMemoryWorkflowRunRepository.ts +4 -2
  85. package/src/infrastructure/persistence/PrismaRunTraceContextRepository.ts +92 -0
  86. package/src/infrastructure/persistence/PrismaTelemetryArtifactStore.ts +125 -0
  87. package/src/infrastructure/persistence/PrismaTelemetryMetricPointStore.ts +134 -0
  88. package/src/infrastructure/persistence/PrismaTelemetrySpanStore.ts +166 -0
  89. package/src/infrastructure/persistence/PrismaWorkflowRunRepository.ts +20 -7
  90. package/src/infrastructure/persistence/generated/prisma-postgresql-client/edge.js +85 -4
  91. package/src/infrastructure/persistence/generated/prisma-postgresql-client/index-browser.js +81 -0
  92. package/src/infrastructure/persistence/generated/prisma-postgresql-client/index.d.ts +6488 -102
  93. package/src/infrastructure/persistence/generated/prisma-postgresql-client/index.js +85 -4
  94. package/src/infrastructure/persistence/generated/prisma-postgresql-client/package.json +1 -1
  95. package/src/infrastructure/persistence/generated/prisma-postgresql-client/schema.prisma +100 -0
  96. package/src/infrastructure/persistence/generated/prisma-sqlite-client/edge.js +85 -4
  97. package/src/infrastructure/persistence/generated/prisma-sqlite-client/index-browser.js +81 -0
  98. package/src/infrastructure/persistence/generated/prisma-sqlite-client/index.d.ts +6476 -98
  99. package/src/infrastructure/persistence/generated/prisma-sqlite-client/index.js +85 -4
  100. package/src/infrastructure/persistence/generated/prisma-sqlite-client/package.json +1 -1
  101. package/src/infrastructure/persistence/generated/prisma-sqlite-client/schema.prisma +100 -0
  102. package/src/presentation/http/ApiPaths.ts +22 -0
  103. package/src/presentation/http/hono/registrars/TelemetryHonoApiRouteRegistrar.ts +19 -0
  104. package/src/presentation/http/routeHandlers/TelemetryDashboardRequestError.ts +1 -0
  105. package/src/presentation/http/routeHandlers/TelemetryHttpRouteHandler.ts +181 -0
  106. package/dist/AppContainerFactory-CcSGFNLW.js.map +0 -1
  107. package/dist/CodemationPluginListMerger-QvUa2SIt.d.ts +0 -357
  108. package/dist/CredentialServices-BPKUF8Xs.js.map +0 -1
  109. package/dist/nextServer.js.map +0 -1
@@ -0,0 +1,674 @@
1
+ import { $ as PersistedRunState, B as NodeExecutionRequestHandler, H as WorkflowRepository, I as WorkflowDefinition, K as RunEvent, L as WorkflowId, M as RunId, Q as WorkflowRunDetailDto, R as BinaryStorage, U as Container, V as NodeExecutionScheduler, W as TypeToken, X as WorkflowActivationPolicy, at as TelemetryMetricRecord, et as RunCurrentState, it as TelemetryAttributes, j as PersistedRunPolicySnapshot, l as AnyCredentialType, n as Engine, nt as RunSummary, ot as TelemetrySpanEventRecord, q as RunEventBus, rt as TelemetryArtifactAttachment, st as Clock, tt as RunPruneCandidate } from "./index-CeS2saCe.js";
2
+ import { C as CodemationContainerRegistration, l as CodemationPluginPackageMetadata, o as CodemationPlugin, r as AppConfig } from "./CodemationAppContext-P7P-xZhQ.js";
3
+ import { a as CodemationAuthConfig, l as Logger, t as CodemationWhitelabelConfig, u as LoggerFactory } from "./CodemationWhitelabelConfig-D5rYcLlj.js";
4
+ import { t as LogLevelPolicy } from "./LogLevelPolicy-CkiJAH75.js";
5
+ import { t as CredentialStore } from "./CredentialServices-0Hk8RFY1.js";
6
+ import { n as PrismaMigrationDeployer, r as PrismaDatabaseClient } from "./AppConfigFactory-Dq7ttwQ_.js";
7
+ import "reflect-metadata";
8
+ import { Hono } from "hono";
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/infrastructure/config/CodemationPluginRegistrar.d.ts
31
+ declare class CodemationPluginRegistrar {
32
+ apply(args: Readonly<{
33
+ plugins: ReadonlyArray<CodemationPlugin>;
34
+ container: Container;
35
+ appConfig: AppConfig;
36
+ registerCredentialType: (type: AnyCredentialType) => void;
37
+ loggerFactory: LoggerFactory;
38
+ }>): Promise<void>;
39
+ }
40
+ //#endregion
41
+ //#region src/application/contracts/WorkflowWebsocketMessage.d.ts
42
+ type WorkflowWebsocketMessage = Readonly<{
43
+ kind: "event";
44
+ event: RunEvent;
45
+ }> | Readonly<{
46
+ kind: "workflowChanged";
47
+ workflowId: string;
48
+ }> | Readonly<{
49
+ kind: "devBuildStarted";
50
+ workflowId: string;
51
+ buildVersion?: string;
52
+ }> | Readonly<{
53
+ kind: "devBuildCompleted";
54
+ workflowId: string;
55
+ buildVersion: string;
56
+ }> | Readonly<{
57
+ kind: "devBuildFailed";
58
+ workflowId: string;
59
+ message: string;
60
+ }>;
61
+ //#endregion
62
+ //#region src/application/websocket/WorkflowWebsocketPublisher.d.ts
63
+ interface WorkflowWebsocketPublisher {
64
+ publishToRoom(roomId: string, message: WorkflowWebsocketMessage): Promise<void>;
65
+ }
66
+ //#endregion
67
+ //#region src/presentation/websocket/WorkflowWebsocketServer.d.ts
68
+ declare class WorkflowWebsocketServer implements WorkflowWebsocketPublisher {
69
+ private readonly port;
70
+ private readonly bindHost;
71
+ private readonly logger;
72
+ private websocketServer;
73
+ private readonly sockets;
74
+ private readonly roomIdsBySocket;
75
+ private started;
76
+ constructor(port: number, bindHost: string, logger: Logger);
77
+ start(): Promise<void>;
78
+ stop(): Promise<void>;
79
+ publishToRoom(roomId: string, message: WorkflowWebsocketMessage): Promise<void>;
80
+ private connect;
81
+ private handleMessage;
82
+ private awaitListening;
83
+ private closeAfterFailedStart;
84
+ private parseClientMessage;
85
+ }
86
+ //#endregion
87
+ //#region src/bootstrap/CodemationContainerRegistrationRegistrar.d.ts
88
+ declare class CodemationContainerRegistrationRegistrar {
89
+ apply(container: Container, registrations: ReadonlyArray<CodemationContainerRegistration<unknown>>): void;
90
+ private applyRegistration;
91
+ private isValueRegistration;
92
+ private isClassRegistration;
93
+ }
94
+ //#endregion
95
+ //#region src/bootstrap/AppContainerFactory.d.ts
96
+ type AppContainerInputs = Readonly<{
97
+ appConfig: AppConfig;
98
+ sharedWorkflowWebsocketServer: WorkflowWebsocketServer | null;
99
+ }>;
100
+ declare class AppContainerFactory {
101
+ private readonly containerRegistrationRegistrar;
102
+ private readonly pluginRegistrar;
103
+ private static readonly queryHandlers;
104
+ private static readonly commandHandlers;
105
+ private static readonly honoRouteRegistrars;
106
+ constructor(containerRegistrationRegistrar?: CodemationContainerRegistrationRegistrar, pluginRegistrar?: CodemationPluginRegistrar);
107
+ create(inputs: AppContainerInputs): Promise<Container>;
108
+ private collectCredentialTypes;
109
+ private applyPlugins;
110
+ private registerCredentialTypes;
111
+ private registerConfiguredRegistrations;
112
+ private registerCoreInfrastructure;
113
+ private registerRepositoriesAndBuses;
114
+ private registerApplicationServicesAndRoutes;
115
+ private registerOperationalInfrastructure;
116
+ private registerRuntimeInfrastructure;
117
+ private resolvePrismaOwnership;
118
+ private registerRuntimeNodeActivationScheduler;
119
+ private createWorkflowPolicyRuntimeDefaults;
120
+ private createBinaryStorage;
121
+ private createRuntimeSummary;
122
+ private requireRedisUrl;
123
+ private readPositiveInteger;
124
+ private synchronizeLiveWorkflowRepository;
125
+ }
126
+ //#endregion
127
+ //#region src/bootstrap/AppContainerLifecycle.d.ts
128
+ declare class AppContainerLifecycle {
129
+ private readonly container;
130
+ private readonly ownedPrismaClient;
131
+ constructor(container: Container, ownedPrismaClient: PrismaDatabaseClient | null);
132
+ stop(args?: Readonly<{
133
+ stopWebsocketServer?: boolean;
134
+ }>): Promise<void>;
135
+ }
136
+ //#endregion
137
+ //#region src/bootstrap/runtime/DatabaseMigrations.d.ts
138
+ declare class DatabaseMigrations {
139
+ private readonly appConfig;
140
+ private readonly prismaMigrationDeployer;
141
+ constructor(appConfig: AppConfig, prismaMigrationDeployer: PrismaMigrationDeployer);
142
+ migrate(): Promise<void>;
143
+ }
144
+ //#endregion
145
+ //#region src/domain/workflows/WorkflowActivationRepository.d.ts
146
+ type WorkflowActivationRow = Readonly<{
147
+ workflowId: string;
148
+ isActive: boolean;
149
+ }>;
150
+ interface WorkflowActivationRepository {
151
+ loadAll(): Promise<ReadonlyArray<WorkflowActivationRow>>;
152
+ upsert(workflowId: string, active: boolean): Promise<void>;
153
+ }
154
+ //#endregion
155
+ //#region src/infrastructure/persistence/RuntimeWorkflowActivationPolicy.d.ts
156
+ /**
157
+ * In-memory activation map: missing workflow id ⇒ inactive. Hydrated from persistence at startup and updated on command.
158
+ */
159
+ declare class RuntimeWorkflowActivationPolicy implements WorkflowActivationPolicy {
160
+ private readonly activeByWorkflowId;
161
+ hydrateFromRepository(repository: WorkflowActivationRepository): Promise<void>;
162
+ set(workflowId: string, active: boolean): void;
163
+ isActive(workflowId: WorkflowId): boolean;
164
+ }
165
+ //#endregion
166
+ //#region src/domain/telemetry/TelemetryContracts.d.ts
167
+ type TelemetrySpanStatus = "running" | "completed" | "failed";
168
+ type TelemetrySpanKind = "internal" | "client";
169
+ interface TelemetryTraceContext {
170
+ readonly runId: string;
171
+ readonly workflowId: string;
172
+ readonly traceId: string;
173
+ readonly rootSpanId: string;
174
+ readonly serviceName?: string;
175
+ readonly createdAt: string;
176
+ readonly expiresAt?: string;
177
+ }
178
+ interface TelemetrySpanRecord {
179
+ readonly traceId: string;
180
+ readonly spanId: string;
181
+ readonly parentSpanId?: string;
182
+ readonly runId: string;
183
+ readonly workflowId: string;
184
+ readonly nodeId?: string;
185
+ readonly activationId?: string;
186
+ readonly connectionInvocationId?: string;
187
+ readonly name: string;
188
+ readonly kind: TelemetrySpanKind;
189
+ readonly status?: TelemetrySpanStatus;
190
+ readonly statusMessage?: string;
191
+ readonly startTime?: string;
192
+ readonly endTime?: string;
193
+ readonly workflowFolder?: string;
194
+ readonly nodeType?: string;
195
+ readonly nodeRole?: string;
196
+ readonly modelName?: string;
197
+ readonly attributes?: TelemetryAttributes;
198
+ readonly events?: ReadonlyArray<TelemetrySpanEventRecord>;
199
+ readonly retentionExpiresAt?: string;
200
+ }
201
+ interface TelemetrySpanUpsert {
202
+ readonly traceId: string;
203
+ readonly spanId: string;
204
+ readonly parentSpanId?: string;
205
+ readonly runId: string;
206
+ readonly workflowId: string;
207
+ readonly nodeId?: string;
208
+ readonly activationId?: string;
209
+ readonly connectionInvocationId?: string;
210
+ readonly name?: string;
211
+ readonly kind?: TelemetrySpanKind;
212
+ readonly status?: TelemetrySpanStatus;
213
+ readonly statusMessage?: string;
214
+ readonly startTime?: string;
215
+ readonly endTime?: string;
216
+ readonly workflowFolder?: string;
217
+ readonly nodeType?: string;
218
+ readonly nodeRole?: string;
219
+ readonly modelName?: string;
220
+ readonly attributes?: TelemetryAttributes;
221
+ readonly events?: ReadonlyArray<TelemetrySpanEventRecord>;
222
+ readonly retentionExpiresAt?: string;
223
+ }
224
+ interface TelemetryArtifactRecord {
225
+ readonly artifactId: string;
226
+ readonly traceId: string;
227
+ readonly spanId: string;
228
+ readonly runId: string;
229
+ readonly workflowId: string;
230
+ readonly nodeId?: string;
231
+ readonly activationId?: string;
232
+ readonly kind: string;
233
+ readonly contentType: string;
234
+ readonly previewText?: string;
235
+ readonly previewJson?: unknown;
236
+ readonly payloadText?: string;
237
+ readonly payloadJson?: unknown;
238
+ readonly bytes?: number;
239
+ readonly truncated?: boolean;
240
+ readonly createdAt: string;
241
+ readonly expiresAt?: string;
242
+ readonly retentionExpiresAt?: string;
243
+ }
244
+ interface TelemetryArtifactWrite extends TelemetryArtifactAttachment {
245
+ readonly traceId: string;
246
+ readonly spanId: string;
247
+ readonly runId: string;
248
+ readonly workflowId: string;
249
+ readonly nodeId?: string;
250
+ readonly activationId?: string;
251
+ readonly retentionExpiresAt?: string;
252
+ }
253
+ interface TelemetryMetricPointRecord {
254
+ readonly metricPointId: string;
255
+ readonly traceId?: string;
256
+ readonly spanId?: string;
257
+ readonly runId?: string;
258
+ readonly workflowId: string;
259
+ readonly nodeId?: string;
260
+ readonly activationId?: string;
261
+ readonly metricName: string;
262
+ readonly value: number;
263
+ readonly unit?: string;
264
+ readonly observedAt: string;
265
+ readonly workflowFolder?: string;
266
+ readonly nodeType?: string;
267
+ readonly nodeRole?: string;
268
+ readonly modelName?: string;
269
+ readonly dimensions?: TelemetryAttributes;
270
+ readonly retentionExpiresAt?: string;
271
+ }
272
+ interface TelemetryMetricPointWrite extends TelemetryMetricRecord {
273
+ readonly traceId?: string;
274
+ readonly spanId?: string;
275
+ readonly runId?: string;
276
+ readonly workflowId: string;
277
+ readonly nodeId?: string;
278
+ readonly activationId?: string;
279
+ readonly observedAt: string;
280
+ readonly workflowFolder?: string;
281
+ readonly nodeType?: string;
282
+ readonly nodeRole?: string;
283
+ readonly modelName?: string;
284
+ readonly retentionExpiresAt?: string;
285
+ }
286
+ interface TelemetrySpanListQuery {
287
+ readonly traceId?: string;
288
+ readonly runId?: string;
289
+ readonly runIds?: ReadonlyArray<string>;
290
+ readonly workflowId?: string;
291
+ readonly workflowIds?: ReadonlyArray<string>;
292
+ readonly statuses?: ReadonlyArray<TelemetrySpanStatus>;
293
+ readonly names?: ReadonlyArray<string>;
294
+ readonly modelNames?: ReadonlyArray<string>;
295
+ readonly startTimeGte?: string;
296
+ readonly endTimeLte?: string;
297
+ readonly limit?: number;
298
+ }
299
+ interface TelemetryMetricPointListQuery {
300
+ readonly traceId?: string;
301
+ readonly runId?: string;
302
+ readonly runIds?: ReadonlyArray<string>;
303
+ readonly workflowId?: string;
304
+ readonly workflowIds?: ReadonlyArray<string>;
305
+ readonly nodeId?: string;
306
+ readonly metricNames?: ReadonlyArray<string>;
307
+ readonly modelNames?: ReadonlyArray<string>;
308
+ readonly observedAtGte?: string;
309
+ readonly observedAtLte?: string;
310
+ readonly limit?: number;
311
+ }
312
+ interface TelemetryPruneArgs {
313
+ readonly nowIso: string;
314
+ readonly limit?: number;
315
+ }
316
+ interface RunTraceContextRepository {
317
+ load(runId: string): Promise<TelemetryTraceContext | undefined>;
318
+ getOrCreate(args: Readonly<{
319
+ runId: string;
320
+ workflowId: string;
321
+ serviceName?: string;
322
+ }>): Promise<TelemetryTraceContext>;
323
+ upsertExpiry(args: Readonly<{
324
+ runId: string;
325
+ expiresAt?: string;
326
+ }>): Promise<void>;
327
+ }
328
+ interface TelemetrySpanStore {
329
+ upsert(record: TelemetrySpanUpsert): Promise<void>;
330
+ list(args?: TelemetrySpanListQuery): Promise<ReadonlyArray<TelemetrySpanRecord>>;
331
+ listByTraceId(traceId: string): Promise<ReadonlyArray<TelemetrySpanRecord>>;
332
+ pruneExpired(args: TelemetryPruneArgs): Promise<number>;
333
+ }
334
+ interface TelemetryArtifactStore {
335
+ save(record: TelemetryArtifactWrite): Promise<TelemetryArtifactRecord>;
336
+ listByTraceId(traceId: string): Promise<ReadonlyArray<TelemetryArtifactRecord>>;
337
+ pruneExpired(args: TelemetryPruneArgs): Promise<number>;
338
+ }
339
+ interface TelemetryMetricPointStore {
340
+ save(record: TelemetryMetricPointWrite): Promise<TelemetryMetricPointRecord>;
341
+ list(args?: TelemetryMetricPointListQuery): Promise<ReadonlyArray<TelemetryMetricPointRecord>>;
342
+ pruneExpired(args: TelemetryPruneArgs): Promise<number>;
343
+ }
344
+ interface TelemetryExporter {
345
+ exportSpans(spans: ReadonlyArray<TelemetrySpanRecord>): Promise<void>;
346
+ }
347
+ //#endregion
348
+ //#region src/domain/runs/WorkflowRunRepository.d.ts
349
+ interface WorkflowRunRepository {
350
+ load(runId: string): Promise<PersistedRunState | undefined>;
351
+ loadRunDetail?(runId: string): Promise<WorkflowRunDetailDto | undefined>;
352
+ save(state: PersistedRunState): Promise<void>;
353
+ listRuns(args: Readonly<{
354
+ workflowId?: string;
355
+ limit?: number;
356
+ }>): Promise<ReadonlyArray<RunSummary>>;
357
+ listRunsOlderThan?(args: Readonly<{
358
+ nowIso: string;
359
+ defaultRetentionSeconds: number;
360
+ limit?: number;
361
+ }>): Promise<ReadonlyArray<RunPruneCandidate>>;
362
+ listBinaryStorageKeys?(runId: RunId): Promise<ReadonlyArray<string>>;
363
+ deleteRun(runId: RunId): Promise<void>;
364
+ }
365
+ //#endregion
366
+ //#region src/application/telemetry/OtelIdentityFactory.d.ts
367
+ declare class OtelIdentityFactory {
368
+ createTraceId(runId: string): string;
369
+ createRootSpanId(runId: string): string;
370
+ createNodeSpanId(activationId: string): string;
371
+ createConnectionInvocationSpanId(invocationId: string): string;
372
+ createArtifactId(): string;
373
+ createEphemeralSpanId(): string;
374
+ private hashToHex;
375
+ private ensureNonZeroHex;
376
+ }
377
+ //#endregion
378
+ //#region src/domain/workflows/WorkflowDefinitionRepository.d.ts
379
+ interface WorkflowDefinitionRepository {
380
+ listDefinitions(): Promise<ReadonlyArray<WorkflowDefinition>>;
381
+ getDefinition(workflowId: string): Promise<WorkflowDefinition | undefined>;
382
+ resolveSnapshot(args: Readonly<{
383
+ workflowId: string;
384
+ workflowSnapshot?: unknown;
385
+ }>): Promise<WorkflowDefinition | undefined>;
386
+ }
387
+ //#endregion
388
+ //#region src/application/telemetry/TelemetryEnricherChain.d.ts
389
+ interface TelemetryNodeMetadata {
390
+ readonly workflowFolder?: string;
391
+ readonly nodeType?: string;
392
+ readonly nodeRole?: string;
393
+ }
394
+ declare class TelemetryEnricherChain {
395
+ private readonly workflowDefinitionRepository;
396
+ private readonly definitionsByWorkflowId;
397
+ constructor(workflowDefinitionRepository: WorkflowDefinitionRepository);
398
+ enrichNode(args: Readonly<{
399
+ workflowId: string;
400
+ nodeId: string;
401
+ }>): Promise<TelemetryNodeMetadata>;
402
+ enrichRun(workflowId: string): Promise<Readonly<{
403
+ workflowFolder?: string;
404
+ }>>;
405
+ private loadDefinition;
406
+ private toWorkflowFolder;
407
+ private toNodeType;
408
+ private toNodeRole;
409
+ }
410
+ //#endregion
411
+ //#region src/application/telemetry/TelemetryRetentionTimestampFactory.d.ts
412
+ declare class TelemetryRetentionTimestampFactory {
413
+ createSpanExpiry(policySnapshot: PersistedRunPolicySnapshot | undefined, observedAt: Date): string | undefined;
414
+ createArtifactExpiry(policySnapshot: PersistedRunPolicySnapshot | undefined, observedAt: Date): string | undefined;
415
+ createMetricExpiry(policySnapshot: PersistedRunPolicySnapshot | undefined, observedAt: Date): string | undefined;
416
+ createTraceContextExpiry(policySnapshot: PersistedRunPolicySnapshot | undefined, observedAt: Date): string | undefined;
417
+ private createExpiry;
418
+ }
419
+ //#endregion
420
+ //#region src/application/telemetry/RunEventBusTelemetryReporter.d.ts
421
+ declare class RunEventBusTelemetryReporter {
422
+ private readonly runEventBus;
423
+ private readonly runTraceContextRepository;
424
+ private readonly workflowRunRepository;
425
+ private readonly telemetrySpanStore;
426
+ private readonly telemetryEnricherChain;
427
+ private readonly telemetryRetentionTimestampFactory;
428
+ private readonly otelIdentityFactory;
429
+ private subscription;
430
+ constructor(runEventBus: RunEventBus, runTraceContextRepository: RunTraceContextRepository, workflowRunRepository: WorkflowRunRepository, telemetrySpanStore: TelemetrySpanStore, telemetryEnricherChain: TelemetryEnricherChain, telemetryRetentionTimestampFactory: TelemetryRetentionTimestampFactory, otelIdentityFactory: OtelIdentityFactory);
431
+ start(): Promise<void>;
432
+ stop(): Promise<void>;
433
+ private handleEvent;
434
+ private handleRunCreated;
435
+ private handleRunSaved;
436
+ private handleNodeSnapshot;
437
+ private createNodeSpanUpsert;
438
+ private loadPolicySnapshot;
439
+ }
440
+ //#endregion
441
+ //#region src/application/websocket/WorkflowRunEventWebsocketRelay.d.ts
442
+ declare class WorkflowRunEventWebsocketRelay {
443
+ private readonly workflowWebsocketPublisher;
444
+ private readonly runEventBus;
445
+ private subscription;
446
+ constructor(workflowWebsocketPublisher: WorkflowWebsocketPublisher, runEventBus: RunEventBus);
447
+ start(): Promise<void>;
448
+ stop(): Promise<void>;
449
+ }
450
+ //#endregion
451
+ //#region src/application/logging/LogFilter.d.ts
452
+ type LogFilter = (entry: Readonly<{
453
+ scope: string;
454
+ level: "info" | "warn" | "error" | "debug";
455
+ message: string;
456
+ }>) => boolean;
457
+ //#endregion
458
+ //#region src/infrastructure/logging/LogLevelPolicyFactory.d.ts
459
+ /**
460
+ * Process-wide {@link LogLevelPolicy} singleton for server and browser loggers.
461
+ * Plain class (no `@injectable` from `@codemation/core`): client components import this file; decorating would pull core into the browser bundle.
462
+ */
463
+ declare class LogLevelPolicyFactory {
464
+ private readonly policy;
465
+ create(): LogLevelPolicy;
466
+ }
467
+ /** Shared factory for call sites outside the DI container (e.g. next-host bootstrap). */
468
+ declare const logLevelPolicyFactory: LogLevelPolicyFactory;
469
+ //#endregion
470
+ //#region src/infrastructure/logging/ServerLoggerFactory.d.ts
471
+ declare class ServerLoggerFactory implements LoggerFactory {
472
+ private readonly logLevelPolicyFactory;
473
+ constructor(logLevelPolicyFactory: LogLevelPolicyFactory);
474
+ create(scope: string): Logger;
475
+ createFiltered(scope: string, filter: LogFilter): Logger;
476
+ createPerformanceDiagnostics(scope: string): Logger;
477
+ }
478
+ //#endregion
479
+ //#region src/application/runs/WorkflowRunRetentionPruneScheduler.d.ts
480
+ /**
481
+ * Periodically deletes terminal workflow runs whose age exceeds the effective retention
482
+ * (`policySnapshot.retentionSeconds` or `CODEMATION_RUN_RETENTION_DEFAULT_SECONDS`),
483
+ * removes binary blobs referenced from run state via {@link BinaryStorage}, and
484
+ * independently prunes spans, artifacts, and metric points once their own retention
485
+ * timestamps expire.
486
+ */
487
+ declare class WorkflowRunRetentionPruneScheduler {
488
+ private readonly clock;
489
+ private readonly runs;
490
+ private readonly binaryStorage;
491
+ private readonly telemetrySpanStore;
492
+ private readonly telemetryArtifactStore;
493
+ private readonly telemetryMetricPointStore;
494
+ private readonly appConfig;
495
+ private static readonly defaultIntervalMs;
496
+ private timer;
497
+ private readonly logger;
498
+ constructor(clock: Clock, runs: WorkflowRunRepository, binaryStorage: BinaryStorage, telemetrySpanStore: TelemetrySpanStore, telemetryArtifactStore: TelemetryArtifactStore, telemetryMetricPointStore: TelemetryMetricPointStore, appConfig: AppConfig, loggerFactory: ServerLoggerFactory);
499
+ start(): void;
500
+ stop(): void;
501
+ /** Exposed for tests; production path is the interval started by {@link start}. */
502
+ runOnce(): Promise<void>;
503
+ private runScheduledTick;
504
+ private loadStorageKeysFromRunStateFallback;
505
+ private collectStorageKeysFromValue;
506
+ }
507
+ //#endregion
508
+ //#region src/bootstrap/runtime/FrontendRuntime.d.ts
509
+ declare class FrontendRuntime {
510
+ private readonly appConfig;
511
+ private readonly databaseMigrations;
512
+ private readonly runtimeWorkflowActivationPolicy;
513
+ private readonly workflowActivationRepository;
514
+ private readonly workflowRepository;
515
+ private readonly workflowWebsocketServer;
516
+ private readonly workflowRunEventWebsocketRelay;
517
+ private readonly runEventBusTelemetryReporter;
518
+ private readonly workflowRunRetentionPruneScheduler;
519
+ private readonly engine;
520
+ constructor(appConfig: AppConfig, databaseMigrations: DatabaseMigrations, runtimeWorkflowActivationPolicy: RuntimeWorkflowActivationPolicy, workflowActivationRepository: WorkflowActivationRepository, workflowRepository: WorkflowRepository, workflowWebsocketServer: WorkflowWebsocketServer, workflowRunEventWebsocketRelay: WorkflowRunEventWebsocketRelay, runEventBusTelemetryReporter: RunEventBusTelemetryReporter, workflowRunRetentionPruneScheduler: WorkflowRunRetentionPruneScheduler, engine: Engine);
521
+ start(args?: Readonly<{
522
+ skipPresentationServers?: boolean;
523
+ }>): Promise<void>;
524
+ }
525
+ //#endregion
526
+ //#region src/infrastructure/scheduler/WorkerRuntimeScheduler.d.ts
527
+ type WorkerRuntimeHandle = Readonly<{
528
+ stop: () => Promise<void>;
529
+ }>;
530
+ interface WorkerRuntimeScheduler extends NodeExecutionScheduler {
531
+ createWorker(args: Readonly<{
532
+ queues: ReadonlyArray<string>;
533
+ requestHandler: NodeExecutionRequestHandler;
534
+ }>): WorkerRuntimeHandle;
535
+ close(): Promise<void>;
536
+ }
537
+ //#endregion
538
+ //#region src/bootstrap/runtime/WorkerRuntime.d.ts
539
+ declare class WorkerRuntime {
540
+ private readonly appConfig;
541
+ private readonly databaseMigrations;
542
+ private readonly runtimeWorkflowActivationPolicy;
543
+ private readonly workflowActivationRepository;
544
+ private readonly workflowRepository;
545
+ private readonly engine;
546
+ private readonly runEventBusTelemetryReporter;
547
+ private readonly workflowRunRetentionPruneScheduler;
548
+ private readonly scheduler;
549
+ private readonly lifecycle;
550
+ constructor(appConfig: AppConfig, databaseMigrations: DatabaseMigrations, runtimeWorkflowActivationPolicy: RuntimeWorkflowActivationPolicy, workflowActivationRepository: WorkflowActivationRepository, workflowRepository: WorkflowRepository, engine: Engine, runEventBusTelemetryReporter: RunEventBusTelemetryReporter, workflowRunRetentionPruneScheduler: WorkflowRunRetentionPruneScheduler, scheduler: WorkerRuntimeScheduler, lifecycle: AppContainerLifecycle);
551
+ start(queues: ReadonlyArray<string>): Promise<WorkerRuntimeHandle>;
552
+ }
553
+ //#endregion
554
+ //#region src/application/auth/AuthenticatedPrincipal.d.ts
555
+ type AuthenticatedPrincipal = Readonly<{
556
+ id: string;
557
+ email: string | null;
558
+ name: string | null;
559
+ }>;
560
+ //#endregion
561
+ //#region src/application/auth/SessionVerifier.d.ts
562
+ interface SessionVerifier {
563
+ verify(request: Request): Promise<AuthenticatedPrincipal | null>;
564
+ }
565
+ //#endregion
566
+ //#region src/application/bus/CommandHandler.d.ts
567
+ declare abstract class CommandHandler<TCommand extends Command<TResult>, TResult> {
568
+ abstract execute(command: TCommand): Promise<TResult>;
569
+ }
570
+ //#endregion
571
+ //#region src/application/bus/DomainEvent.d.ts
572
+ declare abstract class DomainEvent {}
573
+ //#endregion
574
+ //#region src/application/bus/DomainEventBus.d.ts
575
+ interface DomainEventBus {
576
+ publish(event: DomainEvent): Promise<void>;
577
+ }
578
+ //#endregion
579
+ //#region src/application/bus/DomainEventHandler.d.ts
580
+ declare abstract class DomainEventHandler<TEvent extends DomainEvent> {
581
+ abstract handle(event: TEvent): Promise<void>;
582
+ }
583
+ //#endregion
584
+ //#region src/application/bus/QueryHandler.d.ts
585
+ declare abstract class QueryHandler<TQuery extends Query<TResult>, TResult> {
586
+ abstract execute(query: TQuery): Promise<TResult>;
587
+ }
588
+ //#endregion
589
+ //#region src/domain/workflows/WorkflowDebuggerOverlayState.d.ts
590
+ type WorkflowDebuggerOverlayState = Readonly<{
591
+ workflowId: string;
592
+ updatedAt: string;
593
+ copiedFromRunId?: string;
594
+ currentState: RunCurrentState;
595
+ }>;
596
+ //#endregion
597
+ //#region src/domain/workflows/WorkflowDebuggerOverlayRepository.d.ts
598
+ interface WorkflowDebuggerOverlayRepository {
599
+ load(workflowId: string): Promise<WorkflowDebuggerOverlayState | undefined>;
600
+ save(state: WorkflowDebuggerOverlayState): Promise<void>;
601
+ }
602
+ //#endregion
603
+ //#region src/presentation/http/hono/HonoApiRouteRegistrar.d.ts
604
+ interface HonoApiRouteRegistrar {
605
+ register(app: Hono): void;
606
+ }
607
+ //#endregion
608
+ //#region src/applicationTokens.d.ts
609
+ declare const ApplicationTokens: {
610
+ readonly CodemationAuthConfig: TypeToken<CodemationAuthConfig | undefined>;
611
+ readonly CodemationWhitelabelConfig: TypeToken<CodemationWhitelabelConfig>;
612
+ readonly AppConfig: TypeToken<AppConfig>;
613
+ readonly WebSocketPort: TypeToken<number>;
614
+ readonly WebSocketBindHost: TypeToken<string>;
615
+ readonly QueryBus: TypeToken<QueryBus>;
616
+ readonly CommandBus: TypeToken<CommandBus>;
617
+ readonly DomainEventBus: TypeToken<DomainEventBus>;
618
+ readonly QueryHandler: TypeToken<QueryHandler<Query<unknown>, unknown>>;
619
+ readonly CommandHandler: TypeToken<CommandHandler<Command<unknown>, unknown>>;
620
+ readonly DomainEventHandler: TypeToken<DomainEventHandler<DomainEvent>>;
621
+ readonly HonoApiRouteRegistrar: TypeToken<HonoApiRouteRegistrar>;
622
+ readonly WorkflowWebsocketPublisher: TypeToken<WorkflowWebsocketPublisher>;
623
+ readonly WorkerRuntimeScheduler: TypeToken<WorkerRuntimeScheduler>;
624
+ readonly WorkflowDefinitionRepository: TypeToken<WorkflowDefinitionRepository>;
625
+ readonly WorkflowActivationRepository: TypeToken<WorkflowActivationRepository>;
626
+ readonly WorkflowDebuggerOverlayRepository: TypeToken<WorkflowDebuggerOverlayRepository>;
627
+ readonly WorkflowRunRepository: TypeToken<WorkflowRunRepository>;
628
+ readonly LoggerFactory: TypeToken<LoggerFactory>;
629
+ /**
630
+ * Opt-in timing/diagnostics logger (`CODEMATION_PERFORMANCE_LOGGING` + normal minimum log level).
631
+ */
632
+ readonly PerformanceDiagnosticsLogger: TypeToken<Logger>;
633
+ readonly CredentialStore: TypeToken<CredentialStore>;
634
+ readonly RunTraceContextRepository: TypeToken<RunTraceContextRepository>;
635
+ readonly TelemetrySpanStore: TypeToken<TelemetrySpanStore>;
636
+ readonly TelemetryArtifactStore: TypeToken<TelemetryArtifactStore>;
637
+ readonly TelemetryMetricPointStore: TypeToken<TelemetryMetricPointStore>;
638
+ readonly TelemetryExporter: TypeToken<TelemetryExporter>;
639
+ readonly PrismaClient: TypeToken<PrismaDatabaseClient>;
640
+ readonly SessionVerifier: TypeToken<SessionVerifier>;
641
+ readonly Clock: TypeToken<Clock>;
642
+ };
643
+ //#endregion
644
+ //#region src/bootstrap/CodemationBootstrapRequest.d.ts
645
+ declare class CodemationBootstrapRequest {
646
+ readonly consumerRoot: string;
647
+ readonly repoRoot: string;
648
+ readonly workflowSources: ReadonlyArray<string>;
649
+ readonly env?: Readonly<NodeJS.ProcessEnv>;
650
+ constructor(args: Readonly<{
651
+ consumerRoot: string;
652
+ repoRoot: string;
653
+ workflowSources?: ReadonlyArray<string>;
654
+ env?: Readonly<NodeJS.ProcessEnv>;
655
+ }>);
656
+ resolveEnvironment(): NodeJS.ProcessEnv;
657
+ }
658
+ //#endregion
659
+ //#region src/presentation/config/CodemationPluginListMerger.d.ts
660
+ /**
661
+ * Merges explicitly configured plugins with auto-discovered plugins.
662
+ * Configured plugins are applied first; discovered plugins fill in gaps.
663
+ * Plugins discovered from package.json manifests are deduped by npm package name so the same package is not
664
+ * registered twice when the consumer config lists a discovered plugin explicitly and auto-discovery also finds it.
665
+ */
666
+ declare class CodemationPluginListMerger {
667
+ private readonly packageMetadata;
668
+ constructor(packageMetadata: CodemationPluginPackageMetadata);
669
+ merge(configuredPlugins: ReadonlyArray<CodemationPlugin>, discoveredPlugins: ReadonlyArray<CodemationPlugin>): ReadonlyArray<CodemationPlugin>;
670
+ private tryAdd;
671
+ }
672
+ //#endregion
673
+ export { Command as S, AppContainerFactory as _, WorkflowDebuggerOverlayRepository as a, Query as b, FrontendRuntime as c, LogLevelPolicyFactory as d, logLevelPolicyFactory as f, AppContainerLifecycle as g, DatabaseMigrations as h, HonoApiRouteRegistrar as i, WorkflowRunRetentionPruneScheduler as l, WorkflowRunRepository as m, CodemationBootstrapRequest as n, SessionVerifier as o, LogFilter as p, ApplicationTokens as r, WorkerRuntime as s, CodemationPluginListMerger as t, ServerLoggerFactory as u, WorkflowWebsocketServer as v, CommandBus as x, QueryBus as y };
674
+ //# sourceMappingURL=CodemationPluginListMerger-PSTtEQjC.d.ts.map
@@ -1,5 +1,5 @@
1
- import { C as CredentialType, E as CredentialTypeRegistry, F as WorkflowDefinition, S as CredentialSetupStatus, T as CredentialTypeId, V as WorkflowRepository, _ as CredentialMaterialSourceKind, d as CredentialBindingKey, f as CredentialFieldSchema, g as CredentialJsonRecord, h as CredentialInstanceRecord, l as AnyCredentialType, m as CredentialInstanceId, p as CredentialHealth, u as CredentialBinding, v as CredentialOAuth2AuthDefinition, w as CredentialTypeDefinition, x as CredentialSessionService, y as CredentialRequirement } from "./index-Dd6BrWyH.js";
2
- import { r as AppConfig } from "./CodemationAppContext-KqDoeHqN.js";
1
+ import { C as CredentialType, E as CredentialTypeRegistry, H as WorkflowRepository, I as WorkflowDefinition, S as CredentialSetupStatus, T as CredentialTypeId, _ as CredentialMaterialSourceKind, d as CredentialBindingKey, f as CredentialFieldSchema, g as CredentialJsonRecord, h as CredentialInstanceRecord, l as AnyCredentialType, m as CredentialInstanceId, p as CredentialHealth, u as CredentialBinding, v as CredentialOAuth2AuthDefinition, w as CredentialTypeDefinition, x as CredentialSessionService, y as CredentialRequirement } from "./index-CeS2saCe.js";
2
+ import { r as AppConfig } from "./CodemationAppContext-P7P-xZhQ.js";
3
3
 
4
4
  //#region src/domain/credentials/CredentialTypeRegistryImpl.d.ts
5
5
  declare class CredentialTypeRegistryImpl implements CredentialTypeRegistry {
@@ -298,4 +298,4 @@ type MutableCredentialSessionService = CredentialSessionService & Readonly<{
298
298
  }>;
299
299
  //#endregion
300
300
  export { CredentialInstanceService as a, CredentialSecretCipher as c, CredentialBindingService as i, CredentialFieldEnvOverlayService as l, CredentialType$1 as n, CredentialOAuth2ScopeResolver as o, CredentialRuntimeMaterialService as r, CredentialMaterialResolver as s, CredentialStore as t, CredentialTypeRegistryImpl as u };
301
- //# sourceMappingURL=CredentialServices-BFQD_VN1.d.ts.map
301
+ //# sourceMappingURL=CredentialServices-0Hk8RFY1.d.ts.map