@codemation/host 0.5.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +465 -0
- package/LICENSE +1 -37
- package/dist/{ApiPaths-CLTHphYZ.js → ApiPaths-Dv1dcHu_.js} +4 -4
- package/dist/ApiPaths-Dv1dcHu_.js.map +1 -0
- package/dist/{AppConfigFactory-CvpFScwB.js → AppConfigFactory-Cx4qQvRk.js} +114 -53
- package/dist/AppConfigFactory-Cx4qQvRk.js.map +1 -0
- package/dist/{AppConfigFactory-LK76niPc.d.ts → AppConfigFactory-DnLoQ9Li.d.ts} +8527 -5549
- package/dist/{AppContainerFactory-BlLrm6_h.js → AppContainerFactory-DqKYCRNP.js} +7656 -2090
- package/dist/AppContainerFactory-DqKYCRNP.js.map +1 -0
- package/dist/{CodemationAppContext-CvWi5gey.d.ts → CodemationAppContext-CKVv9W9q.d.ts} +8 -4
- package/dist/{CodemationAuthoring.types-BuKNTDC1.d.ts → CodemationAuthoring.types-DA3G3s6d.d.ts} +25 -5
- package/dist/{CodemationAuthoring.types-DZl-sJaM.js → CodemationAuthoring.types-NGkBcmmT.js} +18 -6
- package/dist/CodemationAuthoring.types-NGkBcmmT.js.map +1 -0
- package/dist/{CodemationConfigNormalizer-CYdR0PR5.d.ts → CodemationConfigNormalizer-BAKjetJ6.d.ts} +3 -3
- package/dist/{CodemationConsumerConfigLoader-BeAUS144.js → CodemationConsumerConfigLoader-GYpBBvqE.js} +79 -10
- package/dist/CodemationConsumerConfigLoader-GYpBBvqE.js.map +1 -0
- package/dist/{CodemationConsumerConfigLoader-C3nAj9Bj.d.ts → CodemationConsumerConfigLoader-nxOqvv46.d.ts} +17 -2
- package/dist/{CodemationPluginListMerger-B-W5Fa_X.js → CodemationPluginListMerger-D1B1IEbt.js} +1 -1
- package/dist/{CodemationPluginListMerger-B-W5Fa_X.js.map → CodemationPluginListMerger-D1B1IEbt.js.map} +1 -1
- package/dist/{CodemationPluginListMerger-D-gwVwtw.d.ts → CodemationPluginListMerger-DKLAHT2b.d.ts} +123 -16
- package/dist/CodemationTsyringeTypeInfoRegistrar-Bj6FJYFz.js +97 -0
- package/dist/CodemationTsyringeTypeInfoRegistrar-Bj6FJYFz.js.map +1 -0
- package/dist/{CodemationWhitelabelConfig-CWbcyQqn.d.ts → CodemationWhitelabelConfig-Ca2mCUeC.d.ts} +2 -2
- package/dist/{CollectionContracts.types-DdpHft0i.d.ts → CollectionContracts.types-DDyFYT_D.d.ts} +1 -1
- package/dist/{CredentialContractsRegistry-D7mcPed2.d.ts → CredentialContractsRegistry-Bq2bq28t.d.ts} +2 -2
- package/dist/{CredentialServices-DdCEP2xt.d.ts → CredentialServices-Be2I60Th.d.ts} +65 -20
- package/dist/{CredentialServices-CgxwguAv.js → CredentialServices-Dk8yypeL.js} +310 -51
- package/dist/CredentialServices-Dk8yypeL.js.map +1 -0
- package/dist/InternalHonoApiRouteRegistrar-Ce1yxpnO.d.ts +17 -0
- package/dist/InternalPingRegistrar-DY3kSfxP.js +221 -0
- package/dist/InternalPingRegistrar-DY3kSfxP.js.map +1 -0
- package/dist/{ItemsInputNormalizer-D1WppVMU.d.ts → ItemsInputNormalizer-_RwIfRIQ.d.ts} +108 -25
- package/dist/{LogLevelPolicyFactory-CampWO0l.d.ts → LogLevelPolicyFactory-ewCHLDLn.d.ts} +2 -2
- package/dist/{PublicFrontendBootstrap-DzBgwOnG.d.ts → PublicFrontendBootstrap-Cev3qK46.d.ts} +9 -2
- package/dist/PublicFrontendBootstrapFactory-CY2FS-5g.d.ts +82 -0
- package/dist/{PublicFrontendBootstrapJsonCodec-Cl_DLRh0.d.ts → PublicFrontendBootstrapJsonCodec-CXG9Dxft.d.ts} +3 -3
- package/dist/{PublicFrontendBootstrapJsonCodec-DzqvA0uo.js → PublicFrontendBootstrapJsonCodec-CegIF_ne.js} +7 -2
- package/dist/PublicFrontendBootstrapJsonCodec-CegIF_ne.js.map +1 -0
- package/dist/ServerLoggerFactory-Ckk52S3w.js +223 -0
- package/dist/ServerLoggerFactory-Ckk52S3w.js.map +1 -0
- package/dist/{TelemetryContracts-BsOD_Y17.d.ts → TelemetryContracts-BtDx84Cp.d.ts} +13 -4
- package/dist/{WorkflowPolicyUiPresentationFactory-DNE5oAI6.d.ts → WorkflowPolicyUiPresentationFactory-6MyjCvBO.d.ts} +2 -2
- package/dist/{WorkflowPolicyUiPresentationFactory-DhPqQ9aB.js → WorkflowPolicyUiPresentationFactory-Bb-ae_Zh.js} +1 -1
- package/dist/{WorkflowPolicyUiPresentationFactory-DhPqQ9aB.js.map → WorkflowPolicyUiPresentationFactory-Bb-ae_Zh.js.map} +1 -1
- package/dist/{WorkflowViewContracts-0ZgsHQdp.d.ts → WorkflowViewContracts-B7aFQcIw.d.ts} +15 -1
- package/dist/authoring.d.ts +5 -5
- package/dist/authoring.js +1 -1
- package/dist/client.d.ts +4 -4
- package/dist/client.js +2 -2
- package/dist/consumer.d.ts +6 -6
- package/dist/consumer.js +2 -2
- package/dist/credentials.d.ts +6 -6
- package/dist/credentials.js +1 -1
- package/dist/devServerSidecar.d.ts +2 -2
- package/dist/devServerSidecar.js +1 -94
- package/dist/devServerSidecar.js.map +1 -1
- package/dist/dto.d.ts +6 -6
- package/dist/{index-BlGs9e9Q.d.ts → index-DilAYwnH.d.ts} +49 -3
- package/dist/index.d.ts +110 -21
- package/dist/index.js +15 -13
- package/dist/mapping.d.ts +2 -2
- package/dist/mapping.js +1 -1
- package/dist/nextServer.d.ts +43 -88
- package/dist/nextServer.js +9 -7
- package/dist/pairing.d.ts +93 -0
- package/dist/pairing.js +5 -0
- package/dist/pairing.types-snfZ_OzB.d.ts +19 -0
- package/dist/{persistenceServer-CpNFYa_q.js → persistenceServer-C-hH4z6l.js} +2 -2
- package/dist/{persistenceServer-CpNFYa_q.js.map → persistenceServer-C-hH4z6l.js.map} +1 -1
- package/dist/persistenceServer-CeTHtC6E.d.ts +30 -0
- package/dist/persistenceServer.d.ts +8 -8
- package/dist/persistenceServer.js +3 -3
- package/dist/{server-CQWdkT7t.d.ts → server-C4bS62rg.d.ts} +21 -6
- package/dist/{server-BK43OKxW.js → server-Y7kxwtCK.js} +7 -6
- package/dist/{server-BK43OKxW.js.map → server-Y7kxwtCK.js.map} +1 -1
- package/dist/server.d.ts +14 -14
- package/dist/server.js +13 -11
- package/package.json +29 -42
- package/prisma/migrations/20260507120000_execution_instance_child_run_id/migration.sql +5 -0
- package/prisma/migrations/20260519000000_workflow_audit_log/migration.sql +23 -0
- package/prisma/migrations/20260519100000_storage_growth_fixes/migration.sql +61 -0
- package/prisma/migrations.sqlite/20260507120000_execution_instance_child_run_id/migration.sql +5 -0
- package/prisma/migrations.sqlite/20260519000000_workflow_audit_log/migration.sql +21 -0
- package/prisma/migrations.sqlite/20260519100000_storage_growth_fixes/migration.sql +29 -0
- package/prisma/schema.postgresql.prisma +56 -17
- package/prisma/schema.sqlite.prisma +56 -17
- package/prisma-generated/prisma-postgresql-client/edge.js +35 -6
- package/prisma-generated/prisma-postgresql-client/index-browser.js +31 -2
- package/prisma-generated/prisma-postgresql-client/index.d.ts +8971 -5718
- package/prisma-generated/prisma-postgresql-client/index.js +35 -6
- package/prisma-generated/prisma-postgresql-client/package.json +1 -1
- package/prisma-generated/prisma-postgresql-client/schema.prisma +39 -0
- package/prisma-generated/prisma-sqlite-client/edge.js +35 -6
- package/prisma-generated/prisma-sqlite-client/index-browser.js +31 -2
- package/prisma-generated/prisma-sqlite-client/index.d.ts +8963 -5715
- package/prisma-generated/prisma-sqlite-client/index.js +35 -6
- package/prisma-generated/prisma-sqlite-client/package.json +1 -1
- package/prisma-generated/prisma-sqlite-client/schema.prisma +39 -0
- package/scripts/check-collections.mjs +18 -0
- package/scripts/generate-prisma-clients.mjs +20 -11
- package/src/application/WorkflowAuditLogPruneScheduler.ts +96 -0
- package/src/application/auth/AuthenticatedPrincipal.ts +4 -0
- package/src/application/commands/StartWorkflowRunCommandHandler.ts +4 -0
- package/src/application/contracts/WorkflowViewContracts.ts +11 -0
- package/src/application/contracts/WorkflowWebsocketMessage.ts +3 -1
- package/src/application/mapping/WorkflowDefinitionMapper.ts +44 -1
- package/src/application/runs/WorkflowRunRetentionPruneScheduler.ts +7 -1
- package/src/application/telemetry/OtelExecutionTelemetry.types.ts +5 -0
- package/src/application/telemetry/OtelExecutionTelemetryFactory.ts +4 -0
- package/src/application/telemetry/StoredTelemetrySpanScope.ts +6 -2
- package/src/application/telemetry/TelemetryRetentionTimestampFactory.ts +27 -17
- package/src/application/telemetry/TelemetrySpanPublisher.ts +11 -0
- package/src/application/websocket/TelemetrySpanWebsocketRelay.ts +31 -0
- package/src/applicationTokens.ts +20 -1
- package/src/audit/IAuditEmitter.ts +32 -0
- package/src/audit/PrismaWorkflowAuditLogRepository.ts +34 -0
- package/src/audit/WorkflowAuditLogWriter.ts +125 -0
- package/src/auth/managed/ManagedAuthConfig.ts +29 -0
- package/src/auth/managed/ManagedAuthMiddleware.ts +52 -0
- package/src/auth/managed/ManagedCorsMiddleware.ts +43 -0
- package/src/auth/managed/ManagedModeBootGuard.ts +27 -0
- package/src/auth/managed/index.ts +5 -0
- package/src/bootstrap/AppContainerFactory.ts +277 -29
- package/src/bootstrap/AppContainerLifecycle.ts +31 -0
- package/src/bootstrap/perf/BootTimer.ts +168 -0
- package/src/bootstrap/runtime/AppConfigFactory.ts +21 -65
- package/src/bootstrap/runtime/FrontendRuntime.ts +4 -1
- package/src/bootstrap/runtime/WorkerRuntime.ts +2 -1
- package/src/credentials/BrokerClient.ts +49 -0
- package/src/credentials/BrokerRefreshError.ts +12 -0
- package/src/credentials/BrokerRefreshInvalidGrantError.ts +13 -0
- package/src/credentials/ControlPlaneCatalogFetcher.ts +261 -0
- package/src/credentials/CredentialOAuth2MaterialReader.ts +136 -0
- package/src/credentials/InternalCredentialsListRegistrar.ts +48 -0
- package/src/credentials/InternalCredentialsPushRegistrar.ts +125 -0
- package/src/credentials/LocalOAuthFlowExecutor.ts +316 -0
- package/src/credentials/ManagedOAuthFlowExecutor.ts +94 -0
- package/src/credentials/ManagedOAuthRefreshInvalidGrantError.ts +13 -0
- package/src/credentials/catalogTypes.ts +4 -0
- package/src/credentials/refresh/CredentialDisconnectedError.ts +11 -0
- package/src/domain/credentials/CredentialBindingService.ts +54 -2
- package/src/domain/credentials/CredentialKeyRotatedError.ts +22 -0
- package/src/domain/credentials/CredentialSecretCipher.ts +68 -6
- package/src/domain/credentials/CredentialTypeRegistryImpl.ts +117 -10
- package/src/domain/credentials/OAuth2RedirectUriResolver.ts +79 -0
- package/src/domain/credentials/WorkflowCredentialNodeResolver.ts +14 -5
- package/src/domain/telemetry/TelemetryContracts.ts +7 -1
- package/src/domain/workflows/WorkflowActivationPreflight.ts +24 -1
- package/src/domain/workflows/WorkflowActivationPreflightRules.ts +40 -1
- package/src/index.ts +6 -0
- package/src/infrastructure/binary/LocalFilesystemBinaryStorageRegistry.ts +29 -1
- package/src/infrastructure/binary/S3BinaryStorage.ts +169 -0
- package/src/infrastructure/binary/S3BinaryStorageConfig.ts +17 -0
- package/src/infrastructure/config/CodemationPluginRegistrar.ts +3 -1
- package/src/infrastructure/persistence/CodemationDatabaseUrlParser.ts +41 -0
- package/src/infrastructure/persistence/InMemoryTelemetryArtifactStore.ts +8 -3
- package/src/infrastructure/persistence/InMemoryWorkflowRunRepository.ts +1 -0
- package/src/infrastructure/persistence/PrismaMigrationDeployer.ts +21 -13
- package/src/infrastructure/persistence/PrismaTelemetryArtifactStore.ts +43 -8
- package/src/infrastructure/persistence/PrismaWorkflowRunRepository.ts +33 -3
- package/src/infrastructure/persistence/PrismaWorkflowSnapshotRepository.ts +48 -0
- package/src/mcp/AgentMcpIntegrationImpl.ts +344 -0
- package/src/mcp/McpClientFactory.ts +29 -0
- package/src/mcp/McpConnectionPool.ts +184 -0
- package/src/mcp/McpConnectionPool.types.ts +12 -0
- package/src/mcp/McpServerCatalog.ts +104 -0
- package/src/mcp/index.ts +5 -0
- package/src/pairing/HmacRequestSigner.ts +32 -0
- package/src/pairing/IncomingHmacVerifier.ts +82 -0
- package/src/pairing/InternalHmacAuthMiddleware.ts +33 -0
- package/src/pairing/InternalPingRegistrar.ts +25 -0
- package/src/pairing/PairedFetch.ts +33 -0
- package/src/pairing/PairingConfigFactory.ts +35 -0
- package/src/pairing/PairingConfigToken.ts +6 -0
- package/src/pairing/index.ts +14 -0
- package/src/pairing/pairing.types.ts +18 -0
- package/src/pairing.ts +17 -0
- package/src/persistenceServer.ts +1 -0
- package/src/presentation/config/AppConfig.ts +7 -1
- package/src/presentation/config/CodemationAuthConfig.ts +1 -1
- package/src/presentation/config/CodemationAuthoring.types.ts +54 -5
- package/src/presentation/config/CodemationConfig.ts +3 -0
- package/src/presentation/config/CodemationConfigNormalizer.ts +39 -1
- package/src/presentation/config/CodemationPlugin.ts +2 -1
- package/src/presentation/frontend/CodemationFrontendAuthSnapshot.ts +5 -0
- package/src/presentation/frontend/CodemationFrontendAuthSnapshotFactory.ts +7 -1
- package/src/presentation/frontend/PublicFrontendBootstrap.ts +2 -0
- package/src/presentation/frontend/PublicFrontendBootstrapFactory.ts +5 -1
- package/src/presentation/frontend/PublicFrontendBootstrapJsonCodec.ts +4 -1
- package/src/presentation/http/ApiPaths.ts +4 -4
- package/src/presentation/http/ServerHttpErrorResponseFactory.ts +39 -2
- package/src/presentation/http/hono/CodemationHonoApiAppFactory.ts +33 -8
- package/src/presentation/http/hono/InternalHonoApiRouteRegistrar.ts +12 -0
- package/src/presentation/http/hono/registrars/ManagedMeHonoApiRouteRegistrar.ts +35 -0
- package/src/presentation/http/hono/registrars/OAuth2HonoApiRouteRegistrar.ts +2 -2
- package/src/presentation/http/routeHandlers/CredentialHttpRouteHandler.ts +28 -0
- package/src/presentation/http/routeHandlers/OAuth2HttpRouteHandlerFactory.ts +98 -41
- package/src/presentation/server/CodemationConsumerConfigLoader.ts +54 -7
- package/src/presentation/server/CodemationPluginDiscovery.ts +5 -0
- package/src/presentation/server/WorkflowDefinitionExportsResolver.ts +18 -0
- package/src/presentation/server/WorkflowModulePathFinder.ts +12 -1
- package/src/presentation/websocket/ManagedWebsocketAuthenticator.ts +50 -0
- package/src/presentation/websocket/WebsocketAuthenticator.types.ts +12 -0
- package/src/presentation/websocket/WorkflowWebsocketServer.ts +24 -3
- package/src/process/ExecaProcessRunner.ts +41 -0
- package/src/process/ProcessRunner.types.ts +39 -0
- package/src/server.ts +2 -0
- package/src/workflows/InternalWorkflowActivationRegistrar.ts +42 -0
- package/src/workflows/InternalWorkflowDetailRegistrar.ts +33 -0
- package/src/workflows/InternalWorkflowTestRunRegistrar.ts +91 -0
- package/src/workflows/InternalWorkflowsListRegistrar.ts +28 -0
- package/src/workflows/discovery/WorkflowDirectoryDiscoverer.ts +79 -0
- package/tsconfig.json +2 -0
- package/vitest.shared.ts +5 -0
- package/dist/ApiPaths-CLTHphYZ.js.map +0 -1
- package/dist/AppConfigFactory-CvpFScwB.js.map +0 -1
- package/dist/AppContainerFactory-BlLrm6_h.js.map +0 -1
- package/dist/CodemationAuthoring.types-DZl-sJaM.js.map +0 -1
- package/dist/CodemationConsumerConfigLoader-BeAUS144.js.map +0 -1
- package/dist/CredentialServices-CgxwguAv.js.map +0 -1
- package/dist/PublicFrontendBootstrapFactory-BMWqNM9a.d.ts +0 -45
- package/dist/PublicFrontendBootstrapJsonCodec-DzqvA0uo.js.map +0 -1
- package/dist/ServerLoggerFactory-BKSIh9Xv.js +0 -98
- package/dist/ServerLoggerFactory-BKSIh9Xv.js.map +0 -1
- package/dist/persistenceServer-CIVt3UOX.d.ts +0 -9
- package/src/domain/credentials/OAuth2ConnectServiceFactory.ts +0 -411
|
@@ -262,6 +262,11 @@ interface PersistedWorkflowSnapshotNode {
|
|
|
262
262
|
tokenName?: string;
|
|
263
263
|
configTokenName?: string;
|
|
264
264
|
config: unknown;
|
|
265
|
+
/** Pre-computed static configuration summary; populated by WorkflowSnapshotCodec. */
|
|
266
|
+
inspectorSummary?: ReadonlyArray<Readonly<{
|
|
267
|
+
label: string;
|
|
268
|
+
value: string;
|
|
269
|
+
}>>;
|
|
265
270
|
}
|
|
266
271
|
interface PersistedWorkflowSnapshot {
|
|
267
272
|
id: WorkflowId;
|
|
@@ -318,6 +323,11 @@ interface NodeExecutionSnapshot {
|
|
|
318
323
|
inputsByPort?: NodeInputsByPort;
|
|
319
324
|
outputs?: NodeOutputs;
|
|
320
325
|
error?: NodeExecutionError;
|
|
326
|
+
/**
|
|
327
|
+
* When the node is a SubWorkflow invocation, the run id of the child run it spawned.
|
|
328
|
+
* Populated after the child run completes so the UI can deep-link to that specific execution.
|
|
329
|
+
*/
|
|
330
|
+
childRunId?: RunId;
|
|
321
331
|
}
|
|
322
332
|
/** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
|
|
323
333
|
type ConnectionInvocationId = string;
|
|
@@ -335,6 +345,10 @@ interface ConnectionInvocationRecord {
|
|
|
335
345
|
readonly status: NodeExecutionStatus;
|
|
336
346
|
readonly managedInput?: JsonValue;
|
|
337
347
|
readonly managedOutput?: JsonValue;
|
|
348
|
+
/** Short human-readable description of what this invocation is doing right now (e.g. `"calling search_messages"`). Rendered as a sub-line on the canvas node card. */
|
|
349
|
+
readonly statusLabel?: string;
|
|
350
|
+
/** Stable identifier for the thing this invocation acts on (e.g. an MCP tool name like `"search_messages"`). Persists across status transitions so the inspector can show it on completed/failed entries too. Connection nodes that ARE the tool (e.g. node-backed agent tools) leave this unset — the parent node id already identifies the subject. */
|
|
351
|
+
readonly subjectName?: string;
|
|
338
352
|
readonly error?: NodeExecutionError;
|
|
339
353
|
readonly queuedAt?: string;
|
|
340
354
|
readonly startedAt?: string;
|
|
@@ -356,6 +370,8 @@ type ConnectionInvocationAppendArgs = Readonly<{
|
|
|
356
370
|
status: NodeExecutionStatus;
|
|
357
371
|
managedInput?: JsonValue;
|
|
358
372
|
managedOutput?: JsonValue;
|
|
373
|
+
statusLabel?: string;
|
|
374
|
+
subjectName?: string;
|
|
359
375
|
error?: NodeExecutionError;
|
|
360
376
|
queuedAt?: string;
|
|
361
377
|
startedAt?: string;
|
|
@@ -614,6 +630,26 @@ interface NodeConfigBase {
|
|
|
614
630
|
* configs (e.g. `AssertionNodeConfig`, `StringEqualsAssertionNodeConfig`).
|
|
615
631
|
*/
|
|
616
632
|
readonly emitsAssertions?: true;
|
|
633
|
+
/**
|
|
634
|
+
* Static configuration summary surfaced in the workflow inspector — the design-time
|
|
635
|
+
* "what does this node do" panel that renders before any run telemetry exists.
|
|
636
|
+
*
|
|
637
|
+
* Return 2–6 short label/value pairs derived from this config (method + url for an HTTP
|
|
638
|
+
* call, model + tool list for an agent, schedule + timezone for a cron trigger, etc.).
|
|
639
|
+
* Values are truncated by the UI; aim for one line each. Return `undefined` to opt out
|
|
640
|
+
* — the inspector hides the section when no rows are produced.
|
|
641
|
+
*
|
|
642
|
+
* Implement on the config class instance so the function can read sibling config fields.
|
|
643
|
+
* `defineNode({ inspectorSummary })` plumbs through to this.
|
|
644
|
+
*/
|
|
645
|
+
inspectorSummary?(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* One row of a node's static configuration summary. See {@link NodeConfigBase.inspectorSummary}.
|
|
649
|
+
*/
|
|
650
|
+
interface NodeInspectorSummaryRow {
|
|
651
|
+
readonly label: string;
|
|
652
|
+
readonly value: string;
|
|
617
653
|
}
|
|
618
654
|
declare const runnableNodeInputType: unique symbol;
|
|
619
655
|
declare const runnableNodeOutputType: unique symbol;
|
|
@@ -791,6 +827,29 @@ type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
|
|
|
791
827
|
*/
|
|
792
828
|
type TestSuiteRunId = string;
|
|
793
829
|
//#endregion
|
|
830
|
+
//#region ../core/src/contracts/CostTrackingTelemetryContract.d.ts
|
|
831
|
+
type CostTrackingComponent = "chat" | "ocr" | "rag";
|
|
832
|
+
interface CostTrackingUsageRecord {
|
|
833
|
+
readonly component: CostTrackingComponent;
|
|
834
|
+
readonly provider: string;
|
|
835
|
+
readonly operation: string;
|
|
836
|
+
readonly pricingKey: string;
|
|
837
|
+
readonly usageUnit: string;
|
|
838
|
+
readonly quantity: number;
|
|
839
|
+
readonly modelName?: string;
|
|
840
|
+
readonly attributes?: TelemetryAttributes;
|
|
841
|
+
}
|
|
842
|
+
interface CostTrackingPriceQuote {
|
|
843
|
+
readonly currency: string;
|
|
844
|
+
readonly currencyScale: number;
|
|
845
|
+
readonly estimatedAmountMinor: number;
|
|
846
|
+
readonly estimateKind: "catalog";
|
|
847
|
+
}
|
|
848
|
+
interface CostTrackingTelemetry {
|
|
849
|
+
captureUsage(args: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
|
|
850
|
+
forScope(scope: TelemetryScope): CostTrackingTelemetry;
|
|
851
|
+
}
|
|
852
|
+
//#endregion
|
|
794
853
|
//#region ../core/src/contracts/telemetryTypes.d.ts
|
|
795
854
|
type TelemetryAttributePrimitive = string | number | boolean | null;
|
|
796
855
|
interface TelemetryAttributes {
|
|
@@ -871,29 +930,6 @@ interface ExecutionTelemetry extends TelemetryScope {
|
|
|
871
930
|
}>): NodeExecutionTelemetry;
|
|
872
931
|
}
|
|
873
932
|
//#endregion
|
|
874
|
-
//#region ../core/src/contracts/CostTrackingTelemetryContract.d.ts
|
|
875
|
-
type CostTrackingComponent = "chat" | "ocr" | "rag";
|
|
876
|
-
interface CostTrackingUsageRecord {
|
|
877
|
-
readonly component: CostTrackingComponent;
|
|
878
|
-
readonly provider: string;
|
|
879
|
-
readonly operation: string;
|
|
880
|
-
readonly pricingKey: string;
|
|
881
|
-
readonly usageUnit: string;
|
|
882
|
-
readonly quantity: number;
|
|
883
|
-
readonly modelName?: string;
|
|
884
|
-
readonly attributes?: TelemetryAttributes;
|
|
885
|
-
}
|
|
886
|
-
interface CostTrackingPriceQuote {
|
|
887
|
-
readonly currency: string;
|
|
888
|
-
readonly currencyScale: number;
|
|
889
|
-
readonly estimatedAmountMinor: number;
|
|
890
|
-
readonly estimateKind: "catalog";
|
|
891
|
-
}
|
|
892
|
-
interface CostTrackingTelemetry {
|
|
893
|
-
captureUsage(args: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
|
|
894
|
-
forScope(scope: TelemetryScope): CostTrackingTelemetry;
|
|
895
|
-
}
|
|
896
|
-
//#endregion
|
|
897
933
|
//#region ../core/src/contracts/executionPersistenceContracts.d.ts
|
|
898
934
|
/** Canonical id for persisted execution rows (activation or connection invocation). */
|
|
899
935
|
type ExecutionInstanceId = string;
|
|
@@ -968,6 +1004,11 @@ interface ExecutionInstanceDto {
|
|
|
968
1004
|
readonly itemIndex?: number;
|
|
969
1005
|
/** Parent invocation id when this instance was emitted by a sub-agent triggered by an outer LLM/tool call. */
|
|
970
1006
|
readonly parentInvocationId?: string;
|
|
1007
|
+
/**
|
|
1008
|
+
* When this instance is a SubWorkflow node activation, the run id of the child run it spawned.
|
|
1009
|
+
* Used by the UI to deep-link directly to the child execution.
|
|
1010
|
+
*/
|
|
1011
|
+
readonly childRunId?: string;
|
|
971
1012
|
}
|
|
972
1013
|
//#endregion
|
|
973
1014
|
//#region ../core/src/contracts/webhookTypes.d.ts
|
|
@@ -1006,6 +1047,35 @@ interface WebhookTriggerMatcher {
|
|
|
1006
1047
|
reloadWebhookRoutes?(): void;
|
|
1007
1048
|
}
|
|
1008
1049
|
//#endregion
|
|
1050
|
+
//#region ../core/src/contracts/mcpTypes.d.ts
|
|
1051
|
+
type McpServerTransport = "http";
|
|
1052
|
+
interface McpServerDeclaration {
|
|
1053
|
+
/** Globally unique slug, e.g. "gmail". Workflow authors reference this. */
|
|
1054
|
+
id: string;
|
|
1055
|
+
displayName: string;
|
|
1056
|
+
description: string;
|
|
1057
|
+
transport: McpServerTransport;
|
|
1058
|
+
url: string;
|
|
1059
|
+
/**
|
|
1060
|
+
* Credential types accepted by this MCP server, matching CredentialRequirement.acceptedTypes.
|
|
1061
|
+
* Absent or empty means no credential is required.
|
|
1062
|
+
*/
|
|
1063
|
+
acceptedCredentialTypes?: ReadonlyArray<string>;
|
|
1064
|
+
/**
|
|
1065
|
+
* Documentation only in MVP. The bind-time validator checks
|
|
1066
|
+
* requiredScopes ⊆ CredentialInstance.scopesGranted.
|
|
1067
|
+
*/
|
|
1068
|
+
requiredScopes?: string[];
|
|
1069
|
+
/** Non-secret static headers merged onto every MCP request. */
|
|
1070
|
+
staticHeaders?: Record<string, string>;
|
|
1071
|
+
/**
|
|
1072
|
+
* Overrides for tool descriptions advertised by the MCP server.
|
|
1073
|
+
* Applied by the connection pool after tools/list.
|
|
1074
|
+
* Key: exact tool name as returned by the server.
|
|
1075
|
+
*/
|
|
1076
|
+
toolDescriptionOverrides?: Record<string, string>;
|
|
1077
|
+
}
|
|
1078
|
+
//#endregion
|
|
1009
1079
|
//#region ../core/src/contracts/collectionTypes.d.ts
|
|
1010
1080
|
/**
|
|
1011
1081
|
* Represents a typed store for a single collection.
|
|
@@ -1303,6 +1373,15 @@ interface NodeExecutionStatePublisher {
|
|
|
1303
1373
|
error: Error;
|
|
1304
1374
|
}): Promise<void>;
|
|
1305
1375
|
appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
|
|
1376
|
+
/**
|
|
1377
|
+
* Annotates the current snapshot for `nodeId` with the id of the child run spawned by a
|
|
1378
|
+
* SubWorkflow invocation. Called from `SubWorkflowNode.execute` after `runById` resolves.
|
|
1379
|
+
* The engine's subsequent `markCompleted` call preserves the value via `previous.childRunId`.
|
|
1380
|
+
*/
|
|
1381
|
+
setChildRunId?(args: {
|
|
1382
|
+
nodeId: NodeId;
|
|
1383
|
+
childRunId: RunId;
|
|
1384
|
+
}): Promise<void>;
|
|
1306
1385
|
}
|
|
1307
1386
|
type BinaryBody = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array | ArrayBuffer;
|
|
1308
1387
|
interface BinaryStorageWriteRequest {
|
|
@@ -1328,6 +1407,10 @@ interface BinaryStorage {
|
|
|
1328
1407
|
openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;
|
|
1329
1408
|
stat(storageKey: string): Promise<BinaryStorageStatResult>;
|
|
1330
1409
|
delete(storageKey: string): Promise<void>;
|
|
1410
|
+
/** Deletes multiple objects in bulk. Keys are batched internally. */
|
|
1411
|
+
deleteMany(storageKeys: ReadonlyArray<string>): Promise<void>;
|
|
1412
|
+
/** Lists all keys sharing a common prefix. Returns keys in arbitrary order. */
|
|
1413
|
+
listByPrefix(prefix: string): Promise<ReadonlyArray<string>>;
|
|
1331
1414
|
}
|
|
1332
1415
|
interface BinaryAttachmentCreateRequest {
|
|
1333
1416
|
name: string;
|
|
@@ -1550,5 +1633,5 @@ interface ChatModelFactory<TConfig extends ChatModelConfig = ChatModelConfig> {
|
|
|
1550
1633
|
}>): Promise<ChatLanguageModel> | ChatLanguageModel;
|
|
1551
1634
|
}
|
|
1552
1635
|
//#endregion
|
|
1553
|
-
export {
|
|
1554
|
-
//# sourceMappingURL=ItemsInputNormalizer-
|
|
1636
|
+
export { PersistedRunState as $, WorkflowRunDetailDto as A, NodeActivationId as B, AnyRunnableNodeConfig as C, CredentialSetupStatus as Ct, WebhookInvocationMatch as D, CredentialTypeRegistry as Dt, HttpMethod as E, CredentialTypeId as Et, ActivationIdFactory as F, PersistedRunPolicySnapshot as G, NodeInspectorSummaryRow as H, BinaryAttachment as I, RunnableNodeConfig as J, RunId as K, Item as L, TelemetryAttributes as M, TelemetryMetricRecord as N, WebhookTriggerMatcher as O, NodeId as Ot, TelemetrySpanEventRecord as P, NodeInputsByPort as Q, Items as R, ChainCursor as S, CredentialSessionService as St, McpServerDeclaration as T, CredentialTypeDefinition as Tt, NodeOutputs as U, NodeDefinition as V, ParentExecutionRef as W, WorkflowDefinition as X, RunnableNodeOutputJson as Y, CurrentStateExecutionRequest as Z, EngineExecutionLimitsPolicyConfig as _, CredentialJsonRecord as _t, ParamDeep as a, RunStatus as at, TestCaseRunStatus as b, CredentialRequirement as bt, NodeActivationContinuation as c, WebhookRunResult as ct, NodeExecutionRequestHandler as d, CredentialBinding as dt, PersistedWorkflowTokenRegistryLike as et, NodeExecutionScheduler as f, CredentialBindingKey as ft, TypeToken as g, CredentialInstanceRecord as gt, Container as h, CredentialInstanceId as ht, ToolConfig as i, RunResult as it, TelemetryArtifactAttachment as j, WebhookTriggerResolution as k, WorkflowId as kt, NodeExecutionContext as l, WorkflowExecutionRepository as lt, WorkflowSnapshotResolver as m, CredentialHealth as mt, AgentMessageConfig as n, RunExecutionOptions as nt, BinaryStorage as o, RunStopCondition as ot, WorkflowRepository as p, CredentialFieldSchema as pt, RunIdFactory as q, ChatModelConfig as r, RunPruneCandidate as rt, LiveWorkflowRepository as s, RunSummary as st, AgentGuardrailConfig as t, RunCurrentState as tt, NodeExecutionRequest as u, AnyCredentialType as ut, RunEvent as v, CredentialMaterialSourceKind as vt, WorkflowActivationPolicy as w, CredentialType as wt, TestSuiteRunStatus as x, CredentialSessionFactoryArgs as xt, RunEventBus as y, CredentialOAuth2AuthDefinition as yt, JsonValue as z };
|
|
1637
|
+
//# sourceMappingURL=ItemsInputNormalizer-_RwIfRIQ.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as CodemationLogConfig } from "./CodemationWhitelabelConfig-
|
|
1
|
+
import { n as CodemationLogConfig } from "./CodemationWhitelabelConfig-Ca2mCUeC.js";
|
|
2
2
|
|
|
3
3
|
//#region src/infrastructure/logging/LogLevelPolicy.d.ts
|
|
4
4
|
type LogLevel = "silent" | "debug" | "info" | "warn" | "error";
|
|
@@ -46,4 +46,4 @@ declare class LogLevelPolicyFactory {
|
|
|
46
46
|
declare const logLevelPolicyFactory: LogLevelPolicyFactory;
|
|
47
47
|
//#endregion
|
|
48
48
|
export { LogLevelPolicy as i, logLevelPolicyFactory as n, LogLevel as r, LogLevelPolicyFactory as t };
|
|
49
|
-
//# sourceMappingURL=LogLevelPolicyFactory-
|
|
49
|
+
//# sourceMappingURL=LogLevelPolicyFactory-ewCHLDLn.d.ts.map
|
package/dist/{PublicFrontendBootstrap-DzBgwOnG.d.ts → PublicFrontendBootstrap-Cev3qK46.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CodemationAuthConfig } from "./CodemationWhitelabelConfig-
|
|
1
|
+
import { a as CodemationAuthConfig } from "./CodemationWhitelabelConfig-Ca2mCUeC.js";
|
|
2
2
|
|
|
3
3
|
//#region src/presentation/frontend/CodemationFrontendAuthSnapshot.d.ts
|
|
4
4
|
type CodemationFrontendAuthProviderSnapshot = Readonly<{
|
|
@@ -11,6 +11,11 @@ type CodemationFrontendAuthSnapshot = Readonly<{
|
|
|
11
11
|
oauthProviders: ReadonlyArray<CodemationFrontendAuthProviderSnapshot>;
|
|
12
12
|
secret: string | null;
|
|
13
13
|
uiAuthEnabled: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Present when auth.kind === "managed". Carries the CP-web origin for CORS
|
|
16
|
+
* awareness. No UI login flow is rendered in managed mode.
|
|
17
|
+
*/
|
|
18
|
+
cpWebOrigin?: string;
|
|
14
19
|
}>;
|
|
15
20
|
//#endregion
|
|
16
21
|
//#region src/presentation/frontend/FrontendAppConfig.d.ts
|
|
@@ -44,7 +49,9 @@ type PublicFrontendBootstrap = Readonly<{
|
|
|
44
49
|
oauthProviders: ReadonlyArray<CodemationFrontendAuthProviderSnapshot>;
|
|
45
50
|
productName: string;
|
|
46
51
|
uiAuthEnabled: boolean;
|
|
52
|
+
/** Present in managed mode — the CP web origin. No UI login is rendered when this is set. */
|
|
53
|
+
cpWebOrigin?: string;
|
|
47
54
|
}>;
|
|
48
55
|
//#endregion
|
|
49
56
|
export { CodemationFrontendAuthSnapshot as a, CodemationFrontendAuthProviderSnapshot as i, InternalAuthBootstrap as n, FrontendAppConfig as r, PublicFrontendBootstrap as t };
|
|
50
|
-
//# sourceMappingURL=PublicFrontendBootstrap-
|
|
57
|
+
//# sourceMappingURL=PublicFrontendBootstrap-Cev3qK46.d.ts.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { r as AppConfig } from "./CodemationAppContext-CKVv9W9q.js";
|
|
2
|
+
import { a as CodemationAuthConfig } from "./CodemationWhitelabelConfig-Ca2mCUeC.js";
|
|
3
|
+
import { a as CodemationFrontendAuthSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-Cev3qK46.js";
|
|
4
|
+
import { ChildProcess } from "node:child_process";
|
|
5
|
+
|
|
6
|
+
//#region src/process/ProcessRunner.types.d.ts
|
|
7
|
+
type ProcessRunOptions = Readonly<{
|
|
8
|
+
cwd?: string;
|
|
9
|
+
env?: NodeJS.ProcessEnv;
|
|
10
|
+
/**
|
|
11
|
+
* Mirrors `child_process.SpawnOptions["stdio"]`. The runner forwards the value verbatim to the
|
|
12
|
+
* underlying subprocess, so callers that need fine-grained per-fd control (e.g.
|
|
13
|
+
* `["ignore", "pipe", "pipe"]`) can pass a tuple.
|
|
14
|
+
*/
|
|
15
|
+
stdio?: "inherit" | "pipe" | "ignore" | ReadonlyArray<"inherit" | "pipe" | "ignore">;
|
|
16
|
+
/**
|
|
17
|
+
* On Unix this detaches the child from the parent's process group so it becomes the group
|
|
18
|
+
* leader (used by {@link DevTrackedProcessTreeKiller} to broadcast SIGTERM to descendants).
|
|
19
|
+
* On Windows it is ignored — `windowsHide` should be used to suppress console windows instead.
|
|
20
|
+
*/
|
|
21
|
+
detached?: boolean;
|
|
22
|
+
windowsHide?: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
type ProcessRunResult = Readonly<{
|
|
25
|
+
exitCode: number | null;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Cross-platform process spawning seam. Implementations resolve bare CLI names (`pnpm`, `prisma`,
|
|
29
|
+
* `next`, …) against the OS PATH using OS-appropriate executable lookup, so call sites stop having
|
|
30
|
+
* to remember `pnpm.cmd` or `shell: true` on Windows.
|
|
31
|
+
*
|
|
32
|
+
* `spawn` returns a Node `ChildProcess` so existing helpers like `DevNextChildProcessOutputFilter`
|
|
33
|
+
* and `DevTrackedProcessTreeKiller` keep working unchanged.
|
|
34
|
+
*/
|
|
35
|
+
interface ProcessRunner {
|
|
36
|
+
/** Long-lived child (dev watcher, Next dev server). Returns a `ChildProcess`. */
|
|
37
|
+
spawn(command: string, args: ReadonlyArray<string>, options?: ProcessRunOptions): ChildProcess;
|
|
38
|
+
/** Synchronous one-shot (used by Prisma migrate deploy). */
|
|
39
|
+
runSync(command: string, args: ReadonlyArray<string>, options?: ProcessRunOptions): ProcessRunResult;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/presentation/frontend/CodemationFrontendAuthSnapshotFactory.d.ts
|
|
43
|
+
declare class CodemationFrontendAuthSnapshotFactory {
|
|
44
|
+
createFromAppConfig(appConfig: AppConfig): CodemationFrontendAuthSnapshot;
|
|
45
|
+
createFromResolvedInputs(args: Readonly<{
|
|
46
|
+
authConfig: CodemationAuthConfig | undefined;
|
|
47
|
+
env: NodeJS.ProcessEnv;
|
|
48
|
+
uiAuthEnabled: boolean;
|
|
49
|
+
}>): CodemationFrontendAuthSnapshot;
|
|
50
|
+
private resolveUiAuthEnabled;
|
|
51
|
+
private resolveAuthSecret;
|
|
52
|
+
private createOauthProviders;
|
|
53
|
+
private createOAuthProvider;
|
|
54
|
+
private createOidcProvider;
|
|
55
|
+
private resolveOAuthProviderName;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/presentation/frontend/FrontendAppConfigFactory.d.ts
|
|
59
|
+
declare class FrontendAppConfigFactory {
|
|
60
|
+
private readonly appConfig;
|
|
61
|
+
private readonly authSnapshotFactory;
|
|
62
|
+
constructor(appConfig: AppConfig, authSnapshotFactory: CodemationFrontendAuthSnapshotFactory);
|
|
63
|
+
create(): FrontendAppConfig;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/presentation/frontend/InternalAuthBootstrapFactory.d.ts
|
|
67
|
+
declare class InternalAuthBootstrapFactory {
|
|
68
|
+
private readonly appConfig;
|
|
69
|
+
private readonly authSnapshotFactory;
|
|
70
|
+
constructor(appConfig: AppConfig, authSnapshotFactory: CodemationFrontendAuthSnapshotFactory);
|
|
71
|
+
create(): InternalAuthBootstrap;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/presentation/frontend/PublicFrontendBootstrapFactory.d.ts
|
|
75
|
+
declare class PublicFrontendBootstrapFactory {
|
|
76
|
+
private readonly frontendAppConfigFactory;
|
|
77
|
+
constructor(frontendAppConfigFactory: FrontendAppConfigFactory);
|
|
78
|
+
create(): PublicFrontendBootstrap;
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { ProcessRunOptions as a, CodemationFrontendAuthSnapshotFactory as i, InternalAuthBootstrapFactory as n, ProcessRunResult as o, FrontendAppConfigFactory as r, ProcessRunner as s, PublicFrontendBootstrapFactory as t };
|
|
82
|
+
//# sourceMappingURL=PublicFrontendBootstrapFactory-CY2FS-5g.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CodemationFrontendAuthSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-
|
|
1
|
+
import { a as CodemationFrontendAuthSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-Cev3qK46.js";
|
|
2
2
|
|
|
3
3
|
//#region src/presentation/http/ApiPaths.d.ts
|
|
4
4
|
declare class ApiPaths {
|
|
@@ -47,9 +47,9 @@ declare class ApiPaths {
|
|
|
47
47
|
static credentialInstance(instanceId: string, withSecrets?: boolean): string;
|
|
48
48
|
static credentialInstanceTest(instanceId: string): string;
|
|
49
49
|
static credentialBindings(): string;
|
|
50
|
-
static oauth2Auth(instanceId: string): string;
|
|
51
50
|
static oauth2RedirectUri(): string;
|
|
52
51
|
static oauth2Disconnect(instanceId: string): string;
|
|
52
|
+
static credentialOAuthStart(): string;
|
|
53
53
|
static workflowWebsocket(): string;
|
|
54
54
|
/** Dev gateway: stable browser WebSocket for build lifecycle (CLI → gateway → browser). */
|
|
55
55
|
static devGatewaySocket(): string;
|
|
@@ -116,4 +116,4 @@ declare class PublicFrontendBootstrapJsonCodec {
|
|
|
116
116
|
}
|
|
117
117
|
//#endregion
|
|
118
118
|
export { ApiPaths as a, CodemationFrontendAuthSnapshotJsonCodec as i, InternalAuthBootstrapJsonCodec as n, FrontendAppConfigJsonCodec as r, PublicFrontendBootstrapJsonCodec as t };
|
|
119
|
-
//# sourceMappingURL=PublicFrontendBootstrapJsonCodec-
|
|
119
|
+
//# sourceMappingURL=PublicFrontendBootstrapJsonCodec-CXG9Dxft.d.ts.map
|
|
@@ -128,13 +128,18 @@ var PublicFrontendBootstrapJsonCodec = class {
|
|
|
128
128
|
try {
|
|
129
129
|
const parsed = JSON.parse(serialized);
|
|
130
130
|
if (!parsed || typeof parsed !== "object") return null;
|
|
131
|
-
|
|
131
|
+
const base = {
|
|
132
132
|
credentialsEnabled: parsed.credentialsEnabled === true,
|
|
133
133
|
logoUrl: typeof parsed.logoUrl === "string" && parsed.logoUrl.trim().length > 0 ? parsed.logoUrl : null,
|
|
134
134
|
oauthProviders: this.resolveOauthProviders(parsed.oauthProviders),
|
|
135
135
|
productName: typeof parsed.productName === "string" && parsed.productName.trim().length > 0 ? parsed.productName : "Codemation",
|
|
136
136
|
uiAuthEnabled: parsed.uiAuthEnabled !== false
|
|
137
137
|
};
|
|
138
|
+
const cpWebOrigin = typeof parsed.cpWebOrigin === "string" && parsed.cpWebOrigin.trim().length > 0 ? parsed.cpWebOrigin : void 0;
|
|
139
|
+
return cpWebOrigin ? {
|
|
140
|
+
...base,
|
|
141
|
+
cpWebOrigin
|
|
142
|
+
} : base;
|
|
138
143
|
} catch {
|
|
139
144
|
return null;
|
|
140
145
|
}
|
|
@@ -155,4 +160,4 @@ var PublicFrontendBootstrapJsonCodec = class {
|
|
|
155
160
|
|
|
156
161
|
//#endregion
|
|
157
162
|
export { CodemationFrontendAuthSnapshotJsonCodec as i, InternalAuthBootstrapJsonCodec as n, FrontendAppConfigJsonCodec as r, PublicFrontendBootstrapJsonCodec as t };
|
|
158
|
-
//# sourceMappingURL=PublicFrontendBootstrapJsonCodec-
|
|
163
|
+
//# sourceMappingURL=PublicFrontendBootstrapJsonCodec-CegIF_ne.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublicFrontendBootstrapJsonCodec-CegIF_ne.js","names":["base: PublicFrontendBootstrap"],"sources":["../src/presentation/frontend/CodemationFrontendAuthSnapshotJsonCodec.ts","../src/presentation/frontend/FrontendAppConfigJsonCodec.ts","../src/presentation/frontend/InternalAuthBootstrapJsonCodec.ts","../src/presentation/frontend/PublicFrontendBootstrapJsonCodec.ts"],"sourcesContent":["import type { CodemationAuthConfig } from \"../config/CodemationAuthConfig\";\n\nimport type {\n CodemationFrontendAuthProviderSnapshot,\n CodemationFrontendAuthSnapshot,\n} from \"./CodemationFrontendAuthSnapshot\";\n\nexport class CodemationFrontendAuthSnapshotJsonCodec {\n serialize(snapshot: CodemationFrontendAuthSnapshot): string {\n return JSON.stringify(snapshot);\n }\n\n deserialize(serialized: string | undefined): CodemationFrontendAuthSnapshot | null {\n if (!serialized || serialized.trim().length === 0) {\n return null;\n }\n try {\n const parsed = JSON.parse(serialized) as Partial<CodemationFrontendAuthSnapshot> | null;\n if (!parsed || typeof parsed !== \"object\") {\n return null;\n }\n return {\n config: this.resolveAuthConfig(parsed.config),\n credentialsEnabled: parsed.credentialsEnabled === true,\n oauthProviders: this.resolveOauthProviders(parsed.oauthProviders),\n secret: typeof parsed.secret === \"string\" && parsed.secret.trim().length > 0 ? parsed.secret : null,\n uiAuthEnabled: parsed.uiAuthEnabled !== false,\n };\n } catch {\n return null;\n }\n }\n\n private resolveAuthConfig(value: unknown): CodemationAuthConfig | undefined {\n return value && typeof value === \"object\" ? (value as CodemationAuthConfig) : undefined;\n }\n\n private resolveOauthProviders(value: unknown): ReadonlyArray<CodemationFrontendAuthProviderSnapshot> {\n if (!Array.isArray(value)) {\n return [];\n }\n return value.flatMap((entry) => {\n if (!entry || typeof entry !== \"object\") {\n return [];\n }\n const provider = entry as Partial<CodemationFrontendAuthProviderSnapshot>;\n if (typeof provider.id !== \"string\" || typeof provider.name !== \"string\") {\n return [];\n }\n return [\n {\n id: provider.id,\n name: provider.name,\n },\n ];\n });\n }\n}\n","import type { CodemationAuthConfig } from \"../config/CodemationAuthConfig\";\nimport type { FrontendAppConfig } from \"./FrontendAppConfig\";\nimport type { CodemationFrontendAuthProviderSnapshot } from \"./CodemationFrontendAuthSnapshot\";\n\nexport class FrontendAppConfigJsonCodec {\n serialize(config: FrontendAppConfig): string {\n return JSON.stringify(config);\n }\n\n deserialize(serialized: string | undefined): FrontendAppConfig | null {\n if (!serialized || serialized.trim().length === 0) {\n return null;\n }\n try {\n const parsed = JSON.parse(serialized) as Partial<FrontendAppConfig> | null;\n if (!parsed || typeof parsed !== \"object\" || !parsed.auth || typeof parsed.auth !== \"object\") {\n return null;\n }\n return {\n auth: {\n config: this.resolveAuthConfig(parsed.auth.config),\n credentialsEnabled: parsed.auth.credentialsEnabled === true,\n oauthProviders: this.resolveOauthProviders(parsed.auth.oauthProviders),\n secret:\n typeof parsed.auth.secret === \"string\" && parsed.auth.secret.trim().length > 0 ? parsed.auth.secret : null,\n uiAuthEnabled: parsed.auth.uiAuthEnabled !== false,\n },\n productName:\n typeof parsed.productName === \"string\" && parsed.productName.trim().length > 0\n ? parsed.productName\n : \"Codemation\",\n logoUrl: typeof parsed.logoUrl === \"string\" && parsed.logoUrl.trim().length > 0 ? parsed.logoUrl : null,\n };\n } catch {\n return null;\n }\n }\n\n private resolveAuthConfig(value: unknown): CodemationAuthConfig | undefined {\n return value && typeof value === \"object\" ? (value as CodemationAuthConfig) : undefined;\n }\n\n private resolveOauthProviders(value: unknown): ReadonlyArray<CodemationFrontendAuthProviderSnapshot> {\n if (!Array.isArray(value)) {\n return [];\n }\n return value.flatMap((entry) => {\n if (!entry || typeof entry !== \"object\") {\n return [];\n }\n const provider = entry as Partial<CodemationFrontendAuthProviderSnapshot>;\n if (typeof provider.id !== \"string\" || typeof provider.name !== \"string\") {\n return [];\n }\n return [{ id: provider.id, name: provider.name }];\n });\n }\n}\n","import type { CodemationAuthConfig } from \"../config/CodemationAuthConfig\";\nimport type { CodemationFrontendAuthProviderSnapshot } from \"./CodemationFrontendAuthSnapshot\";\nimport type { InternalAuthBootstrap } from \"./InternalAuthBootstrap\";\n\nexport class InternalAuthBootstrapJsonCodec {\n serialize(bootstrap: InternalAuthBootstrap): string {\n return JSON.stringify(bootstrap);\n }\n\n deserialize(serialized: string | undefined): InternalAuthBootstrap | null {\n if (!serialized || serialized.trim().length === 0) {\n return null;\n }\n try {\n const parsed = JSON.parse(serialized) as Partial<InternalAuthBootstrap> | null;\n if (!parsed || typeof parsed !== \"object\") {\n return null;\n }\n return {\n authConfig: this.resolveAuthConfig(parsed.authConfig),\n credentialsEnabled: parsed.credentialsEnabled === true,\n oauthProviders: this.resolveOauthProviders(parsed.oauthProviders),\n uiAuthEnabled: parsed.uiAuthEnabled !== false,\n };\n } catch {\n return null;\n }\n }\n\n private resolveAuthConfig(value: unknown): CodemationAuthConfig | undefined {\n return value && typeof value === \"object\" ? (value as CodemationAuthConfig) : undefined;\n }\n\n private resolveOauthProviders(value: unknown): ReadonlyArray<CodemationFrontendAuthProviderSnapshot> {\n if (!Array.isArray(value)) {\n return [];\n }\n return value.flatMap((entry) => {\n if (!entry || typeof entry !== \"object\") {\n return [];\n }\n const provider = entry as Partial<CodemationFrontendAuthProviderSnapshot>;\n if (typeof provider.id !== \"string\" || typeof provider.name !== \"string\") {\n return [];\n }\n return [{ id: provider.id, name: provider.name }];\n });\n }\n}\n","import type { PublicFrontendBootstrap } from \"./PublicFrontendBootstrap\";\nimport type { CodemationFrontendAuthProviderSnapshot } from \"./CodemationFrontendAuthSnapshot\";\n\nexport class PublicFrontendBootstrapJsonCodec {\n serialize(bootstrap: PublicFrontendBootstrap): string {\n return JSON.stringify(bootstrap);\n }\n\n deserialize(serialized: string | undefined): PublicFrontendBootstrap | null {\n if (!serialized || serialized.trim().length === 0) {\n return null;\n }\n try {\n const parsed = JSON.parse(serialized) as Partial<PublicFrontendBootstrap> | null;\n if (!parsed || typeof parsed !== \"object\") {\n return null;\n }\n const base: PublicFrontendBootstrap = {\n credentialsEnabled: parsed.credentialsEnabled === true,\n logoUrl: typeof parsed.logoUrl === \"string\" && parsed.logoUrl.trim().length > 0 ? parsed.logoUrl : null,\n oauthProviders: this.resolveOauthProviders(parsed.oauthProviders),\n productName:\n typeof parsed.productName === \"string\" && parsed.productName.trim().length > 0\n ? parsed.productName\n : \"Codemation\",\n uiAuthEnabled: parsed.uiAuthEnabled !== false,\n };\n const cpWebOrigin =\n typeof parsed.cpWebOrigin === \"string\" && parsed.cpWebOrigin.trim().length > 0 ? parsed.cpWebOrigin : undefined;\n return cpWebOrigin ? { ...base, cpWebOrigin } : base;\n } catch {\n return null;\n }\n }\n\n private resolveOauthProviders(value: unknown): ReadonlyArray<CodemationFrontendAuthProviderSnapshot> {\n if (!Array.isArray(value)) {\n return [];\n }\n return value.flatMap((entry) => {\n if (!entry || typeof entry !== \"object\") {\n return [];\n }\n const provider = entry as Partial<CodemationFrontendAuthProviderSnapshot>;\n if (typeof provider.id !== \"string\" || typeof provider.name !== \"string\") {\n return [];\n }\n return [{ id: provider.id, name: provider.name }];\n });\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { r as ConsoleLogger, t as LogLevelPolicyFactory } from "./LogLevelPolicyFactory-DCUzIN6G.js";
|
|
2
|
+
import { n as __decorateMetadata, t as __decorateParam } from "./decorateParam-BWxkAUSj.js";
|
|
3
|
+
import { t as __decorate } from "./decorate-CXWmflG_.js";
|
|
4
|
+
import { inject, injectable } from "@codemation/core";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { promises } from "node:fs";
|
|
7
|
+
|
|
8
|
+
//#region src/bootstrap/perf/BootTimer.ts
|
|
9
|
+
var BootTimer = class {
|
|
10
|
+
static enabled = false;
|
|
11
|
+
static root = null;
|
|
12
|
+
static current = null;
|
|
13
|
+
/** Enable boot tracing for the lifetime of the current process. Idempotent. */
|
|
14
|
+
static enable() {
|
|
15
|
+
if (this.enabled) return;
|
|
16
|
+
this.enabled = true;
|
|
17
|
+
this.root = {
|
|
18
|
+
name: "boot",
|
|
19
|
+
startNs: process.hrtime.bigint(),
|
|
20
|
+
endNs: null,
|
|
21
|
+
children: [],
|
|
22
|
+
parent: null
|
|
23
|
+
};
|
|
24
|
+
this.current = this.root;
|
|
25
|
+
}
|
|
26
|
+
static isEnabled() {
|
|
27
|
+
return this.enabled;
|
|
28
|
+
}
|
|
29
|
+
/** Wrap an async phase. Pass-through when disabled. */
|
|
30
|
+
static async measureAsync(name, fn) {
|
|
31
|
+
if (!this.enabled || !this.current) return await fn();
|
|
32
|
+
const node = this.pushPhase(name);
|
|
33
|
+
try {
|
|
34
|
+
return await fn();
|
|
35
|
+
} finally {
|
|
36
|
+
this.popPhase(node);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** Wrap a sync phase. Pass-through when disabled. */
|
|
40
|
+
static measure(name, fn) {
|
|
41
|
+
if (!this.enabled || !this.current) return fn();
|
|
42
|
+
const node = this.pushPhase(name);
|
|
43
|
+
try {
|
|
44
|
+
return fn();
|
|
45
|
+
} finally {
|
|
46
|
+
this.popPhase(node);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Manual start/stop for fire-and-forget phases (e.g. a spawned child process you only
|
|
51
|
+
* stop once a readiness probe succeeds). Returns the stop function.
|
|
52
|
+
*/
|
|
53
|
+
static start(name) {
|
|
54
|
+
if (!this.enabled || !this.current) return () => {};
|
|
55
|
+
const node = this.pushPhase(name);
|
|
56
|
+
return () => this.popPhase(node);
|
|
57
|
+
}
|
|
58
|
+
/** Print the tree to stderr and write JSON to the given path. Finalizes the root span. */
|
|
59
|
+
static async finish(outputJsonPath) {
|
|
60
|
+
if (!this.enabled || !this.root) return;
|
|
61
|
+
if (this.root.endNs === null) this.root.endNs = process.hrtime.bigint();
|
|
62
|
+
const totalMs = nodeMs(this.root);
|
|
63
|
+
process.stderr.write(`\n=== Boot trace (total ${totalMs.toFixed(0)}ms) ===\n`);
|
|
64
|
+
writeTree(this.root, 0, totalMs);
|
|
65
|
+
process.stderr.write("=========================================\n\n");
|
|
66
|
+
if (outputJsonPath) try {
|
|
67
|
+
await promises.mkdir(path.dirname(outputJsonPath), { recursive: true });
|
|
68
|
+
await promises.writeFile(outputJsonPath, JSON.stringify(this.snapshot(), null, 2), "utf8");
|
|
69
|
+
} catch (error) {
|
|
70
|
+
process.stderr.write(`[boot-timer] failed to write JSON trace: ${String(error)}\n`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** Return a plain-object snapshot of the current tree (for tests / diffing). */
|
|
74
|
+
static snapshot() {
|
|
75
|
+
if (!this.root) return {
|
|
76
|
+
name: "boot",
|
|
77
|
+
ms: 0,
|
|
78
|
+
pct: 100,
|
|
79
|
+
children: []
|
|
80
|
+
};
|
|
81
|
+
const totalMs = nodeMs(this.root);
|
|
82
|
+
return toReport(this.root, totalMs);
|
|
83
|
+
}
|
|
84
|
+
/** Test helper: reset all state. Do not call in production code. */
|
|
85
|
+
static reset() {
|
|
86
|
+
this.enabled = false;
|
|
87
|
+
this.root = null;
|
|
88
|
+
this.current = null;
|
|
89
|
+
}
|
|
90
|
+
static pushPhase(name) {
|
|
91
|
+
const node = {
|
|
92
|
+
name,
|
|
93
|
+
startNs: process.hrtime.bigint(),
|
|
94
|
+
endNs: null,
|
|
95
|
+
children: [],
|
|
96
|
+
parent: this.current
|
|
97
|
+
};
|
|
98
|
+
this.current.children.push(node);
|
|
99
|
+
this.current = node;
|
|
100
|
+
return node;
|
|
101
|
+
}
|
|
102
|
+
static popPhase(node) {
|
|
103
|
+
node.endNs = process.hrtime.bigint();
|
|
104
|
+
this.current = node.parent ?? this.root;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
function nodeMs(node) {
|
|
108
|
+
const end = node.endNs ?? node.startNs;
|
|
109
|
+
return Number(end - node.startNs) / 1e6;
|
|
110
|
+
}
|
|
111
|
+
function toReport(node, totalMs) {
|
|
112
|
+
const ms = nodeMs(node);
|
|
113
|
+
return {
|
|
114
|
+
name: node.name,
|
|
115
|
+
ms,
|
|
116
|
+
pct: totalMs > 0 ? ms / totalMs * 100 : 0,
|
|
117
|
+
children: node.children.map((child) => toReport(child, totalMs))
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function writeTree(node, depth, totalMs) {
|
|
121
|
+
const ms = nodeMs(node);
|
|
122
|
+
const pct = totalMs > 0 ? (ms / totalMs * 100).toFixed(1) : "—";
|
|
123
|
+
const indent = " ".repeat(depth);
|
|
124
|
+
const msStr = ms.toFixed(0).padStart(6);
|
|
125
|
+
const pctStr = pct.padStart(5);
|
|
126
|
+
process.stderr.write(`${indent}${msStr}ms ${pctStr}% ${node.name}\n`);
|
|
127
|
+
for (const child of node.children) writeTree(child, depth + 1, totalMs);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/infrastructure/logging/FilteringLogger.ts
|
|
132
|
+
var FilteringLogger = class {
|
|
133
|
+
constructor(inner, scope, filter) {
|
|
134
|
+
this.inner = inner;
|
|
135
|
+
this.scope = scope;
|
|
136
|
+
this.filter = filter;
|
|
137
|
+
}
|
|
138
|
+
info(message, exception) {
|
|
139
|
+
if (!this.filter({
|
|
140
|
+
scope: this.scope,
|
|
141
|
+
level: "info",
|
|
142
|
+
message
|
|
143
|
+
})) return;
|
|
144
|
+
this.inner.info(message, exception);
|
|
145
|
+
}
|
|
146
|
+
warn(message, exception) {
|
|
147
|
+
if (!this.filter({
|
|
148
|
+
scope: this.scope,
|
|
149
|
+
level: "warn",
|
|
150
|
+
message
|
|
151
|
+
})) return;
|
|
152
|
+
this.inner.warn(message, exception);
|
|
153
|
+
}
|
|
154
|
+
error(message, exception) {
|
|
155
|
+
if (!this.filter({
|
|
156
|
+
scope: this.scope,
|
|
157
|
+
level: "error",
|
|
158
|
+
message
|
|
159
|
+
})) return;
|
|
160
|
+
this.inner.error(message, exception);
|
|
161
|
+
}
|
|
162
|
+
debug(message, exception) {
|
|
163
|
+
if (!this.filter({
|
|
164
|
+
scope: this.scope,
|
|
165
|
+
level: "debug",
|
|
166
|
+
message
|
|
167
|
+
})) return;
|
|
168
|
+
this.inner.debug(message, exception);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/infrastructure/logging/PerformanceLogPolicy.ts
|
|
174
|
+
/**
|
|
175
|
+
* Opt-in detailed timing / diagnostics lines (used with `ServerLoggerFactory#createPerformanceDiagnostics`).
|
|
176
|
+
*
|
|
177
|
+
* Set `CODEMATION_PERFORMANCE_LOGGING=true` to enable. Otherwise those loggers are silent regardless of level.
|
|
178
|
+
*/
|
|
179
|
+
var PerformanceLogPolicy = class {
|
|
180
|
+
shouldEmitDetailedTiming() {
|
|
181
|
+
return process.env.CODEMATION_PERFORMANCE_LOGGING === "true";
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/infrastructure/logging/PerformanceLogPolicyFactory.ts
|
|
187
|
+
/**
|
|
188
|
+
* Process-wide {@link PerformanceLogPolicy} singleton (same pattern as {@link LogLevelPolicyFactory}).
|
|
189
|
+
*/
|
|
190
|
+
var PerformanceLogPolicyFactory = class {
|
|
191
|
+
policy = new PerformanceLogPolicy();
|
|
192
|
+
create() {
|
|
193
|
+
return this.policy;
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
const performanceLogPolicyFactory = new PerformanceLogPolicyFactory();
|
|
197
|
+
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/infrastructure/logging/ServerLoggerFactory.ts
|
|
200
|
+
var _ref;
|
|
201
|
+
let ServerLoggerFactory = class ServerLoggerFactory$1 {
|
|
202
|
+
constructor(logLevelPolicyFactory) {
|
|
203
|
+
this.logLevelPolicyFactory = logLevelPolicyFactory;
|
|
204
|
+
}
|
|
205
|
+
create(scope) {
|
|
206
|
+
return new ConsoleLogger(scope, this.logLevelPolicyFactory.create());
|
|
207
|
+
}
|
|
208
|
+
createFiltered(scope, filter) {
|
|
209
|
+
return new FilteringLogger(this.create(scope), scope, filter);
|
|
210
|
+
}
|
|
211
|
+
createPerformanceDiagnostics(scope) {
|
|
212
|
+
return this.createFiltered(scope, (_entry) => performanceLogPolicyFactory.create().shouldEmitDetailedTiming());
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
ServerLoggerFactory = __decorate([
|
|
216
|
+
injectable(),
|
|
217
|
+
__decorateParam(0, inject(LogLevelPolicyFactory)),
|
|
218
|
+
__decorateMetadata("design:paramtypes", [typeof (_ref = typeof LogLevelPolicyFactory !== "undefined" && LogLevelPolicyFactory) === "function" ? _ref : Object])
|
|
219
|
+
], ServerLoggerFactory);
|
|
220
|
+
|
|
221
|
+
//#endregion
|
|
222
|
+
export { FilteringLogger as a, PerformanceLogPolicy as i, PerformanceLogPolicyFactory as n, BootTimer as o, performanceLogPolicyFactory as r, ServerLoggerFactory as t };
|
|
223
|
+
//# sourceMappingURL=ServerLoggerFactory-Ckk52S3w.js.map
|