@codemation/host 0.2.5 → 0.3.1

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 (123) hide show
  1. package/CHANGELOG.md +45 -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-DL_qZ80U.js} +2665 -264
  6. package/dist/AppContainerFactory-DL_qZ80U.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-axppTMgo.d.ts → server-Clvg5x1w.d.ts} +11 -5
  32. package/dist/{server-CFpgKuVE.js → server-DteBORJX.js} +4 -4
  33. package/dist/{server-CFpgKuVE.js.map → server-DteBORJX.js.map} +1 -1
  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 +183 -64
  75. package/src/bootstrap/AppContainerLifecycle.ts +8 -0
  76. package/src/bootstrap/CodemationContainerRegistrationRegistrar.ts +1 -3
  77. package/src/bootstrap/runtime/FrontendRuntime.ts +8 -0
  78. package/src/bootstrap/runtime/WorkerRuntime.ts +8 -0
  79. package/src/domain/runs/WorkflowRunRepository.ts +3 -1
  80. package/src/domain/telemetry/TelemetryContracts.ts +197 -0
  81. package/src/infrastructure/config/CodemationPluginRegistrar.ts +2 -6
  82. package/src/infrastructure/di/HandlesDomainEventRegistry.ts +5 -7
  83. package/src/infrastructure/persistence/InMemoryRunTraceContextRepository.ts +56 -0
  84. package/src/infrastructure/persistence/InMemoryTelemetryArtifactStore.ts +56 -0
  85. package/src/infrastructure/persistence/InMemoryTelemetryMetricPointStore.ts +97 -0
  86. package/src/infrastructure/persistence/InMemoryTelemetrySpanStore.ts +113 -0
  87. package/src/infrastructure/persistence/InMemoryWorkflowRunRepository.ts +4 -2
  88. package/src/infrastructure/persistence/PrismaRunTraceContextRepository.ts +92 -0
  89. package/src/infrastructure/persistence/PrismaTelemetryArtifactStore.ts +125 -0
  90. package/src/infrastructure/persistence/PrismaTelemetryMetricPointStore.ts +134 -0
  91. package/src/infrastructure/persistence/PrismaTelemetrySpanStore.ts +166 -0
  92. package/src/infrastructure/persistence/PrismaWorkflowRunRepository.ts +20 -7
  93. package/src/infrastructure/persistence/generated/prisma-postgresql-client/edge.js +85 -4
  94. package/src/infrastructure/persistence/generated/prisma-postgresql-client/index-browser.js +81 -0
  95. package/src/infrastructure/persistence/generated/prisma-postgresql-client/index.d.ts +6488 -102
  96. package/src/infrastructure/persistence/generated/prisma-postgresql-client/index.js +85 -4
  97. package/src/infrastructure/persistence/generated/prisma-postgresql-client/package.json +1 -1
  98. package/src/infrastructure/persistence/generated/prisma-postgresql-client/schema.prisma +100 -0
  99. package/src/infrastructure/persistence/generated/prisma-sqlite-client/edge.js +85 -4
  100. package/src/infrastructure/persistence/generated/prisma-sqlite-client/index-browser.js +81 -0
  101. package/src/infrastructure/persistence/generated/prisma-sqlite-client/index.d.ts +6476 -98
  102. package/src/infrastructure/persistence/generated/prisma-sqlite-client/index.js +85 -4
  103. package/src/infrastructure/persistence/generated/prisma-sqlite-client/package.json +1 -1
  104. package/src/infrastructure/persistence/generated/prisma-sqlite-client/schema.prisma +100 -0
  105. package/src/presentation/http/ApiPaths.ts +22 -0
  106. package/src/presentation/http/hono/registrars/AuthHonoApiRouteRegistrar.ts +1 -3
  107. package/src/presentation/http/hono/registrars/BinaryHonoApiRouteRegistrar.ts +1 -3
  108. package/src/presentation/http/hono/registrars/BootstrapHonoApiRouteRegistrar.ts +1 -3
  109. package/src/presentation/http/hono/registrars/CredentialHonoApiRouteRegistrar.ts +1 -3
  110. package/src/presentation/http/hono/registrars/DevHonoApiRouteRegistrar.ts +1 -3
  111. package/src/presentation/http/hono/registrars/OAuth2HonoApiRouteRegistrar.ts +1 -3
  112. package/src/presentation/http/hono/registrars/RunHonoApiRouteRegistrar.ts +1 -3
  113. package/src/presentation/http/hono/registrars/TelemetryHonoApiRouteRegistrar.ts +17 -0
  114. package/src/presentation/http/hono/registrars/UserHonoApiRouteRegistrar.ts +1 -3
  115. package/src/presentation/http/hono/registrars/WebhookHonoApiRouteRegistrar.ts +1 -3
  116. package/src/presentation/http/hono/registrars/WhitelabelHonoApiRouteRegistrar.ts +1 -3
  117. package/src/presentation/http/hono/registrars/WorkflowHonoApiRouteRegistrar.ts +1 -3
  118. package/src/presentation/http/routeHandlers/TelemetryDashboardRequestError.ts +1 -0
  119. package/src/presentation/http/routeHandlers/TelemetryHttpRouteHandler.ts +181 -0
  120. package/dist/AppContainerFactory-CcSGFNLW.js.map +0 -1
  121. package/dist/CodemationPluginListMerger-QvUa2SIt.d.ts +0 -357
  122. package/dist/CredentialServices-BPKUF8Xs.js.map +0 -1
  123. package/dist/nextServer.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @codemation/host
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7eaa288`](https://github.com/MadeRelevant/codemation/commit/7eaa288737f2d126218dac84fa4fde2a4113b7f3) Thanks [@cblokland90](https://github.com/cblokland90)! - Default DI container registrations to singletons so framework services that own long-lived resources (timers, subscriptions, sockets) have deterministic lifecycles. Previously `container.register(Class, { useClass: Class })` produced a new instance per resolution, which caused the `WorkflowRunRetentionPruneScheduler` `setInterval` timer to leak across HMR reloads and blocked `pnpm dev` from shutting down on Ctrl+C.
8
+
9
+ Public registration DTOs still accept `useClass` as a shape hint, but the host applies every class-based registration as a singleton. Plugin authors using `plugin.register({ registerNode, registerClass })` and consumers using `containerRegistrations: [{ token, useClass }]` no longer need to reason about lifecycle. Redundant `@registry([{ useClass }])` decorators on Hono route registrars and domain event handlers have been removed.
10
+
11
+ A new ESLint rule (`codemation/no-transient-container-register`) prevents reintroducing `.register(token, { useClass: Class })` and `@registry([{ useClass: Class }])` patterns across `packages/**` and `apps/**`.
12
+
13
+ - Updated dependencies [[`7eaa288`](https://github.com/MadeRelevant/codemation/commit/7eaa288737f2d126218dac84fa4fde2a4113b7f3)]:
14
+ - @codemation/core@0.8.1
15
+ - @codemation/core-nodes@0.4.3
16
+ - @codemation/eventbus-redis@0.0.31
17
+
18
+ ## 0.3.0
19
+
20
+ ### Minor Changes
21
+
22
+ - [#85](https://github.com/MadeRelevant/codemation/pull/85) [`a250ab8`](https://github.com/MadeRelevant/codemation/commit/a250ab8b973429cdfe708526a205e2565b004868) Thanks [@cblokland90](https://github.com/cblokland90)! - Decouple telemetry retention from run deletion and move node-specific measurements onto metric points.
23
+ - allow telemetry spans, artifacts, and metrics to outlive raw run state through explicit retention timestamps
24
+ - narrow telemetry spans to canonical span fields and persist extensible node-specific measurements as metric points
25
+ - update telemetry queries, docs, and regression coverage around real workflow execution plus agent/tool observability
26
+
27
+ - [`782e934`](https://github.com/MadeRelevant/codemation/commit/782e93469ea6eee701d976b8f1dc18649d045c79) Thanks [@cblokland90](https://github.com/cblokland90)! - Add catalog-backed cost tracking contracts and wire AI/OCR usage into telemetry so hosts can aggregate provider-native execution costs.
28
+
29
+ Improve the telemetry dashboard and workflow detail experience with cost breakdowns, richer inspector data, workflow run cost totals, and credential rebinding fixes.
30
+
31
+ - [#87](https://github.com/MadeRelevant/codemation/pull/87) [`4c50f29`](https://github.com/MadeRelevant/codemation/commit/4c50f29763ad7bc1e39723a6711ca3cf9add5014) Thanks [@cblokland90](https://github.com/cblokland90)! - Add a telemetry dashboard API and replace the placeholder dashboard with filterable workflow and AI metrics.
32
+ - expose summary, timeseries, and model-dimension telemetry queries for dashboard clients
33
+ - add a next-host dashboard with time, workflow, folder, status, and model filters plus run/token charts
34
+
35
+ - [`5d649ee`](https://github.com/MadeRelevant/codemation/commit/5d649ee878f417ad18159584941af6de0a55c0a7) - Expand the telemetry dashboard so operators can filter, persist, and inspect workflow runs more effectively.
36
+ - add run-origin filters, paginated run results, and richer telemetry query support on the host API
37
+ - redesign the next-host dashboard with grouped metrics, sticky filters, nested workflow selection, persisted filters, and clearer multi-select controls
38
+
39
+ ### Patch Changes
40
+
41
+ - [#88](https://github.com/MadeRelevant/codemation/pull/88) [`052aba1`](https://github.com/MadeRelevant/codemation/commit/052aba17c9a4faf557bdfaa1a9644a1987ecc25e) Thanks [@cblokland90](https://github.com/cblokland90)! - Add a telemetry-backed node inspector slice for workflow detail and expose run-trace telemetry needed to power it.
42
+
43
+ - Updated dependencies [[`a250ab8`](https://github.com/MadeRelevant/codemation/commit/a250ab8b973429cdfe708526a205e2565b004868), [`782e934`](https://github.com/MadeRelevant/codemation/commit/782e93469ea6eee701d976b8f1dc18649d045c79), [`052aba1`](https://github.com/MadeRelevant/codemation/commit/052aba17c9a4faf557bdfaa1a9644a1987ecc25e), [`1a356af`](https://github.com/MadeRelevant/codemation/commit/1a356afae50bd3f982e92c3e9f931e3adbcd131f)]:
44
+ - @codemation/core@0.8.0
45
+ - @codemation/core-nodes@0.4.2
46
+ - @codemation/eventbus-redis@0.0.30
47
+
3
48
  ## 0.2.5
4
49
 
5
50
  ### Patch Changes