@contractspec/lib.contracts 1.56.1 → 1.58.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/dist/app-config/app-config.capability.d.ts +2 -7
- package/dist/app-config/app-config.capability.d.ts.map +1 -0
- package/dist/app-config/app-config.capability.js +729 -22
- package/dist/app-config/app-config.contracts.d.ts +226 -231
- package/dist/app-config/app-config.contracts.d.ts.map +1 -0
- package/dist/app-config/app-config.contracts.js +908 -376
- package/dist/app-config/app-config.contracts.test.d.ts +2 -0
- package/dist/app-config/app-config.contracts.test.d.ts.map +1 -0
- package/dist/app-config/app-config.feature.d.ts +2 -7
- package/dist/app-config/app-config.feature.d.ts.map +1 -0
- package/dist/app-config/app-config.feature.js +252 -58
- package/dist/app-config/branding.d.ts +47 -49
- package/dist/app-config/branding.d.ts.map +1 -0
- package/dist/app-config/branding.js +1 -0
- package/dist/app-config/branding.test.d.ts +2 -0
- package/dist/app-config/branding.test.d.ts.map +1 -0
- package/dist/app-config/docs/app-config.docblock.d.ts +3 -6
- package/dist/app-config/docs/app-config.docblock.d.ts.map +1 -0
- package/dist/app-config/docs/app-config.docblock.js +382 -20
- package/dist/app-config/events.d.ts +112 -118
- package/dist/app-config/events.d.ts.map +1 -0
- package/dist/app-config/events.js +380 -168
- package/dist/app-config/events.test.d.ts +2 -0
- package/dist/app-config/events.test.d.ts.map +1 -0
- package/dist/app-config/index.d.ts +10 -10
- package/dist/app-config/index.d.ts.map +1 -0
- package/dist/app-config/index.js +3113 -9
- package/dist/app-config/lifecycle-contracts.d.ts +249 -256
- package/dist/app-config/lifecycle-contracts.d.ts.map +1 -0
- package/dist/app-config/lifecycle-contracts.js +1078 -434
- package/dist/app-config/lifecycle-contracts.test.d.ts +2 -0
- package/dist/app-config/lifecycle-contracts.test.d.ts.map +1 -0
- package/dist/app-config/lifecycle.d.ts +21 -24
- package/dist/app-config/lifecycle.d.ts.map +1 -0
- package/dist/app-config/lifecycle.js +1 -0
- package/dist/app-config/lifecycle.test.d.ts +2 -0
- package/dist/app-config/lifecycle.test.d.ts.map +1 -0
- package/dist/app-config/runtime.d.ts +103 -111
- package/dist/app-config/runtime.d.ts.map +1 -0
- package/dist/app-config/runtime.js +672 -555
- package/dist/app-config/runtime.test.d.ts +2 -0
- package/dist/app-config/runtime.test.d.ts.map +1 -0
- package/dist/app-config/spec.d.ts +153 -158
- package/dist/app-config/spec.d.ts.map +1 -0
- package/dist/app-config/spec.js +226 -16
- package/dist/app-config/spec.test.d.ts +2 -0
- package/dist/app-config/spec.test.d.ts.map +1 -0
- package/dist/app-config/validation.d.ts +41 -46
- package/dist/app-config/validation.d.ts.map +1 -0
- package/dist/app-config/validation.js +607 -495
- package/dist/app-config/validation.test.d.ts +2 -0
- package/dist/app-config/validation.test.d.ts.map +1 -0
- package/dist/capabilities/capabilities.d.ts +77 -80
- package/dist/capabilities/capabilities.d.ts.map +1 -0
- package/dist/capabilities/capabilities.js +209 -165
- package/dist/capabilities/capabilities.test.d.ts +2 -0
- package/dist/capabilities/capabilities.test.d.ts.map +1 -0
- package/dist/capabilities/context.d.ts +73 -50
- package/dist/capabilities/context.d.ts.map +1 -0
- package/dist/capabilities/context.js +93 -79
- package/dist/capabilities/context.test.d.ts +2 -0
- package/dist/capabilities/context.test.d.ts.map +1 -0
- package/dist/capabilities/docs/capabilities.docblock.d.ts +3 -6
- package/dist/capabilities/docs/capabilities.docblock.d.ts.map +1 -0
- package/dist/capabilities/docs/capabilities.docblock.js +165 -22
- package/dist/capabilities/guards.d.ts +40 -28
- package/dist/capabilities/guards.d.ts.map +1 -0
- package/dist/capabilities/guards.js +158 -127
- package/dist/capabilities/index.d.ts +7 -6
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +738 -6
- package/dist/capabilities/meeting-recorder.d.ts +6 -0
- package/dist/capabilities/meeting-recorder.d.ts.map +1 -0
- package/dist/capabilities/meeting-recorder.js +154 -0
- package/dist/capabilities/openbanking.d.ts +6 -10
- package/dist/capabilities/openbanking.d.ts.map +1 -0
- package/dist/capabilities/openbanking.js +160 -86
- package/dist/capabilities/validation.d.ts +42 -38
- package/dist/capabilities/validation.d.ts.map +1 -0
- package/dist/capabilities/validation.js +179 -135
- package/dist/capabilities/validation.test.d.ts +2 -0
- package/dist/capabilities/validation.test.d.ts.map +1 -0
- package/dist/client/index.d.ts +2 -6
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +1377 -7
- package/dist/client/react/drivers/rn-reusables.d.ts +8 -8
- package/dist/client/react/drivers/rn-reusables.d.ts.map +1 -0
- package/dist/client/react/drivers/rn-reusables.js +36 -19
- package/dist/client/react/drivers/shadcn.d.ts +4 -8
- package/dist/client/react/drivers/shadcn.d.ts.map +1 -0
- package/dist/client/react/drivers/shadcn.js +36 -9
- package/dist/client/react/feature-render.d.ts +14 -21
- package/dist/client/react/feature-render.d.ts.map +1 -0
- package/dist/client/react/feature-render.js +824 -35
- package/dist/client/react/form-render.d.ts +83 -88
- package/dist/client/react/form-render.d.ts.map +1 -0
- package/dist/client/react/form-render.js +667 -287
- package/dist/client/react/index.d.ts +5 -5
- package/dist/client/react/index.d.ts.map +1 -0
- package/dist/client/react/index.js +1374 -6
- package/dist/contract-registry/index.d.ts +4 -3
- package/dist/contract-registry/index.d.ts.map +1 -0
- package/dist/contract-registry/index.js +128 -2
- package/dist/contract-registry/schemas.d.ts +88 -91
- package/dist/contract-registry/schemas.d.ts.map +1 -0
- package/dist/contract-registry/schemas.js +124 -56
- package/dist/contract-registry/schemas.test.d.ts +2 -0
- package/dist/contract-registry/schemas.test.d.ts.map +1 -0
- package/dist/contract-registry/types.d.ts +40 -43
- package/dist/contract-registry/types.d.ts.map +1 -0
- package/dist/contract-registry/types.js +1 -0
- package/dist/data-views/data-views.d.ts +5 -6
- package/dist/data-views/data-views.d.ts.map +1 -0
- package/dist/data-views/data-views.js +231 -4
- package/dist/data-views/data-views.test.d.ts +2 -0
- package/dist/data-views/data-views.test.d.ts.map +1 -0
- package/dist/data-views/docs/data-views.docblock.d.ts +3 -6
- package/dist/data-views/docs/data-views.docblock.d.ts.map +1 -0
- package/dist/data-views/docs/data-views.docblock.js +162 -19
- package/dist/data-views/index.d.ts +5 -5
- package/dist/data-views/index.d.ts.map +1 -0
- package/dist/data-views/index.js +231 -3
- package/dist/data-views/query-generator.d.ts +32 -36
- package/dist/data-views/query-generator.d.ts.map +1 -0
- package/dist/data-views/query-generator.js +87 -46
- package/dist/data-views/registry.d.ts +6 -10
- package/dist/data-views/registry.d.ts.map +1 -0
- package/dist/data-views/registry.js +223 -17
- package/dist/data-views/registry.test.d.ts +2 -0
- package/dist/data-views/registry.test.d.ts.map +1 -0
- package/dist/data-views/report/contractVerificationTable.d.ts +2 -7
- package/dist/data-views/report/contractVerificationTable.d.ts.map +1 -0
- package/dist/data-views/report/contractVerificationTable.js +237 -92
- package/dist/data-views/report/contractVerificationTable.test.d.ts +2 -0
- package/dist/data-views/report/contractVerificationTable.test.d.ts.map +1 -0
- package/dist/data-views/runtime.d.ts +23 -29
- package/dist/data-views/runtime.d.ts.map +1 -0
- package/dist/data-views/runtime.js +104 -64
- package/dist/data-views/runtime.test.d.ts +2 -0
- package/dist/data-views/runtime.test.d.ts.map +1 -0
- package/dist/data-views/spec.d.ts +16 -19
- package/dist/data-views/spec.d.ts.map +1 -0
- package/dist/data-views/spec.js +36 -8
- package/dist/data-views/spec.test.d.ts +2 -0
- package/dist/data-views/spec.test.d.ts.map +1 -0
- package/dist/data-views/types.d.ts +91 -95
- package/dist/data-views/types.d.ts.map +1 -0
- package/dist/data-views/types.js +1 -0
- package/dist/data-views/types.test.d.ts +2 -0
- package/dist/data-views/types.test.d.ts.map +1 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.d.ts +3 -6
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.d.ts.map +1 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +512 -16
- package/dist/docs/capabilities/documentationSystem.capability.d.ts +2 -7
- package/dist/docs/capabilities/documentationSystem.capability.d.ts.map +1 -0
- package/dist/docs/capabilities/documentationSystem.capability.js +782 -69
- package/dist/docs/capabilities/index.d.ts +2 -2
- package/dist/docs/capabilities/index.d.ts.map +1 -0
- package/dist/docs/capabilities/index.js +783 -2
- package/dist/docs/commands/docsGenerate.command.d.ts +82 -88
- package/dist/docs/commands/docsGenerate.command.d.ts.map +1 -0
- package/dist/docs/commands/docsGenerate.command.js +1011 -137
- package/dist/docs/commands/docsPublish.command.d.ts +55 -61
- package/dist/docs/commands/docsPublish.command.d.ts.map +1 -0
- package/dist/docs/commands/docsPublish.command.js +991 -103
- package/dist/docs/commands/index.d.ts +3 -3
- package/dist/docs/commands/index.d.ts.map +1 -0
- package/dist/docs/commands/index.js +1119 -3
- package/dist/docs/constants.d.ts +5 -7
- package/dist/docs/constants.d.ts.map +1 -0
- package/dist/docs/constants.js +76 -8
- package/dist/docs/contracts.d.ts +411 -422
- package/dist/docs/contracts.d.ts.map +1 -0
- package/dist/docs/contracts.js +2383 -58
- package/dist/docs/ensure-docblocks.d.ts +2 -1
- package/dist/docs/ensure-docblocks.d.ts.map +1 -0
- package/dist/docs/ensure-docblocks.js +264 -1
- package/dist/docs/events/docsGenerated.event.d.ts +55 -60
- package/dist/docs/events/docsGenerated.event.d.ts.map +1 -0
- package/dist/docs/events/docsGenerated.event.js +530 -50
- package/dist/docs/events/docsPublished.event.d.ts +63 -68
- package/dist/docs/events/docsPublished.event.d.ts.map +1 -0
- package/dist/docs/events/docsPublished.event.js +531 -54
- package/dist/docs/events/index.d.ts +3 -3
- package/dist/docs/events/index.d.ts.map +1 -0
- package/dist/docs/events/index.js +566 -3
- package/dist/docs/forms/docsSearch.form.d.ts +16 -21
- package/dist/docs/forms/docsSearch.form.d.ts.map +1 -0
- package/dist/docs/forms/docsSearch.form.js +673 -110
- package/dist/docs/forms/index.d.ts +2 -2
- package/dist/docs/forms/index.d.ts.map +1 -0
- package/dist/docs/forms/index.js +675 -2
- package/dist/docs/index.d.ts +41 -28
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +5491 -54
- package/dist/docs/meta.docs.d.ts +3 -6
- package/dist/docs/meta.docs.d.ts.map +1 -0
- package/dist/docs/meta.docs.js +162 -15
- package/dist/docs/presentations/docsLayout.presentation.d.ts +3 -7
- package/dist/docs/presentations/docsLayout.presentation.d.ts.map +1 -0
- package/dist/docs/presentations/docsLayout.presentation.js +1088 -33
- package/dist/docs/presentations/docsReferencePage.presentation.d.ts +3 -7
- package/dist/docs/presentations/docsReferencePage.presentation.d.ts.map +1 -0
- package/dist/docs/presentations/docsReferencePage.presentation.js +1088 -33
- package/dist/docs/presentations/index.d.ts +3 -3
- package/dist/docs/presentations/index.d.ts.map +1 -0
- package/dist/docs/presentations/index.js +1117 -3
- package/dist/docs/presentations.d.ts +26 -29
- package/dist/docs/presentations.d.ts.map +1 -0
- package/dist/docs/presentations.js +83 -43
- package/dist/docs/presentations.test.d.ts +2 -0
- package/dist/docs/presentations.test.d.ts.map +1 -0
- package/dist/docs/queries/contractReference.query.d.ts +190 -195
- package/dist/docs/queries/contractReference.query.d.ts.map +1 -0
- package/dist/docs/queries/contractReference.query.js +961 -120
- package/dist/docs/queries/docsIndex.query.d.ts +238 -243
- package/dist/docs/queries/docsIndex.query.d.ts.map +1 -0
- package/dist/docs/queries/docsIndex.query.js +961 -128
- package/dist/docs/queries/index.d.ts +3 -3
- package/dist/docs/queries/index.d.ts.map +1 -0
- package/dist/docs/queries/index.js +1040 -3
- package/dist/docs/registry.d.ts +18 -21
- package/dist/docs/registry.d.ts.map +1 -0
- package/dist/docs/registry.js +145 -43
- package/dist/docs/registry.test.d.ts +2 -0
- package/dist/docs/registry.test.d.ts.map +1 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.d.ts +3 -6
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.d.ts.map +1 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.js +164 -24
- package/dist/docs/tech/cli.docblock.d.ts +3 -6
- package/dist/docs/tech/cli.docblock.d.ts.map +1 -0
- package/dist/docs/tech/cli.docblock.js +164 -21
- package/dist/docs/tech/contracts/README.docblock.d.ts +3 -6
- package/dist/docs/tech/contracts/README.docblock.d.ts.map +1 -0
- package/dist/docs/tech/contracts/README.docblock.js +162 -19
- package/dist/docs/tech/contracts/migrations.docblock.d.ts +3 -6
- package/dist/docs/tech/contracts/migrations.docblock.d.ts.map +1 -0
- package/dist/docs/tech/contracts/migrations.docblock.js +162 -19
- package/dist/docs/tech/contracts/openapi-export.docblock.d.ts +3 -6
- package/dist/docs/tech/contracts/openapi-export.docblock.d.ts.map +1 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.js +165 -22
- package/dist/docs/tech/contracts/openapi-import.docblock.d.ts +3 -6
- package/dist/docs/tech/contracts/openapi-import.docblock.d.ts.map +1 -0
- package/dist/docs/tech/contracts/openapi-import.docblock.js +163 -21
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.d.ts +3 -6
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.d.ts.map +1 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +224 -20
- package/dist/docs/tech/contracts/overlays.docblock.d.ts +3 -6
- package/dist/docs/tech/contracts/overlays.docblock.d.ts.map +1 -0
- package/dist/docs/tech/contracts/overlays.docblock.js +230 -20
- package/dist/docs/tech/contracts/tests.docblock.d.ts +3 -6
- package/dist/docs/tech/contracts/tests.docblock.d.ts.map +1 -0
- package/dist/docs/tech/contracts/tests.docblock.js +162 -19
- package/dist/docs/tech/contracts/themes.docblock.d.ts +3 -6
- package/dist/docs/tech/contracts/themes.docblock.d.ts.map +1 -0
- package/dist/docs/tech/contracts/themes.docblock.js +256 -20
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.d.ts +3 -6
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.d.ts.map +1 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +163 -20
- package/dist/docs/tech/docs-system.docblock.d.ts +2 -1
- package/dist/docs/tech/docs-system.docblock.d.ts.map +1 -0
- package/dist/docs/tech/docs-system.docblock.js +211 -75
- package/dist/docs/tech/lifecycle-stage-system.docblock.d.ts +3 -6
- package/dist/docs/tech/lifecycle-stage-system.docblock.d.ts.map +1 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.js +375 -16
- package/dist/docs/tech/llm/llm-integration.docblock.d.ts +8 -7
- package/dist/docs/tech/llm/llm-integration.docblock.d.ts.map +1 -0
- package/dist/docs/tech/llm/llm-integration.docblock.js +193 -69
- package/dist/docs/tech/mcp-endpoints.docblock.d.ts +3 -6
- package/dist/docs/tech/mcp-endpoints.docblock.d.ts.map +1 -0
- package/dist/docs/tech/mcp-endpoints.docblock.js +170 -23
- package/dist/docs/tech/presentation-runtime.docblock.d.ts +3 -6
- package/dist/docs/tech/presentation-runtime.docblock.d.ts.map +1 -0
- package/dist/docs/tech/presentation-runtime.docblock.js +220 -16
- package/dist/docs/tech/report-verification-table.docblock.d.ts +2 -1
- package/dist/docs/tech/report-verification-table.docblock.d.ts.map +1 -0
- package/dist/docs/tech/report-verification-table.docblock.js +163 -22
- package/dist/docs/tech/report-verification-table.test.d.ts +2 -0
- package/dist/docs/tech/report-verification-table.test.d.ts.map +1 -0
- package/dist/docs/tech/schema/README.docblock.d.ts +3 -6
- package/dist/docs/tech/schema/README.docblock.d.ts.map +1 -0
- package/dist/docs/tech/schema/README.docblock.js +162 -19
- package/dist/docs/tech/studio/learning-events.docblock.d.ts +3 -6
- package/dist/docs/tech/studio/learning-events.docblock.d.ts.map +1 -0
- package/dist/docs/tech/studio/learning-events.docblock.js +168 -27
- package/dist/docs/tech/studio/learning-journeys.docblock.d.ts +3 -6
- package/dist/docs/tech/studio/learning-journeys.docblock.d.ts.map +1 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.js +178 -31
- package/dist/docs/tech/studio/platform-admin-panel.docblock.d.ts +3 -6
- package/dist/docs/tech/studio/platform-admin-panel.docblock.d.ts.map +1 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.js +163 -22
- package/dist/docs/tech/studio/project-access-teams.docblock.d.ts +3 -6
- package/dist/docs/tech/studio/project-access-teams.docblock.d.ts.map +1 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.js +176 -24
- package/dist/docs/tech/studio/project-routing.docblock.d.ts +3 -6
- package/dist/docs/tech/studio/project-routing.docblock.d.ts.map +1 -0
- package/dist/docs/tech/studio/project-routing.docblock.js +173 -32
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.d.ts +3 -6
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.d.ts.map +1 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.js +163 -21
- package/dist/docs/tech/studio/team-invitations.docblock.d.ts +3 -6
- package/dist/docs/tech/studio/team-invitations.docblock.d.ts.map +1 -0
- package/dist/docs/tech/studio/team-invitations.docblock.js +198 -40
- package/dist/docs/tech/studio/workspace-ops.docblock.d.ts +3 -6
- package/dist/docs/tech/studio/workspace-ops.docblock.d.ts.map +1 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.js +163 -22
- package/dist/docs/tech/studio/workspaces.docblock.d.ts +3 -6
- package/dist/docs/tech/studio/workspaces.docblock.d.ts.map +1 -0
- package/dist/docs/tech/studio/workspaces.docblock.js +164 -23
- package/dist/docs/tech/telemetry-ingest.docblock.d.ts +3 -6
- package/dist/docs/tech/telemetry-ingest.docblock.d.ts.map +1 -0
- package/dist/docs/tech/telemetry-ingest.docblock.js +177 -38
- package/dist/docs/tech/vscode-extension.docblock.d.ts +3 -6
- package/dist/docs/tech/vscode-extension.docblock.d.ts.map +1 -0
- package/dist/docs/tech/vscode-extension.docblock.js +175 -36
- package/dist/docs/tech-contracts.docs.d.ts +3 -6
- package/dist/docs/tech-contracts.docs.d.ts.map +1 -0
- package/dist/docs/tech-contracts.docs.js +166 -23
- package/dist/docs/types.d.ts +36 -39
- package/dist/docs/types.d.ts.map +1 -0
- package/dist/docs/types.js +1 -0
- package/dist/docs/views/contractReference.dataView.d.ts +3 -7
- package/dist/docs/views/contractReference.dataView.d.ts.map +1 -0
- package/dist/docs/views/contractReference.dataView.js +1045 -79
- package/dist/docs/views/docsIndex.dataView.d.ts +3 -7
- package/dist/docs/views/docsIndex.dataView.d.ts.map +1 -0
- package/dist/docs/views/docsIndex.dataView.js +1039 -134
- package/dist/docs/views/exampleCatalog.dataView.d.ts +3 -7
- package/dist/docs/views/exampleCatalog.dataView.d.ts.map +1 -0
- package/dist/docs/views/exampleCatalog.dataView.js +1023 -89
- package/dist/docs/views/index.d.ts +4 -4
- package/dist/docs/views/index.d.ts.map +1 -0
- package/dist/docs/views/index.js +1239 -4
- package/dist/events.d.ts +77 -47
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +225 -46
- package/dist/events.test.d.ts +2 -0
- package/dist/events.test.d.ts.map +1 -0
- package/dist/examples/docs/examples.docblock.d.ts +3 -6
- package/dist/examples/docs/examples.docblock.d.ts.map +1 -0
- package/dist/examples/docs/examples.docblock.js +163 -21
- package/dist/examples/index.d.ts +9 -10
- package/dist/examples/index.d.ts.map +1 -0
- package/dist/examples/index.js +604 -13
- package/dist/examples/registry.d.ts +23 -27
- package/dist/examples/registry.d.ts.map +1 -0
- package/dist/examples/registry.js +284 -86
- package/dist/examples/registry.test.d.ts +2 -0
- package/dist/examples/registry.test.d.ts.map +1 -0
- package/dist/examples/schema.d.ts +255 -258
- package/dist/examples/schema.d.ts.map +1 -0
- package/dist/examples/schema.js +141 -100
- package/dist/examples/schema.test.d.ts +2 -0
- package/dist/examples/schema.test.d.ts.map +1 -0
- package/dist/examples/types.d.ts +102 -106
- package/dist/examples/types.d.ts.map +1 -0
- package/dist/examples/types.js +66 -32
- package/dist/examples/types.test.d.ts +2 -0
- package/dist/examples/types.test.d.ts.map +1 -0
- package/dist/examples/validation.d.ts +37 -40
- package/dist/examples/validation.d.ts.map +1 -0
- package/dist/examples/validation.js +278 -135
- package/dist/examples/validation.test.d.ts +2 -0
- package/dist/examples/validation.test.d.ts.map +1 -0
- package/dist/experiments/docs/experiments.docblock.d.ts +3 -6
- package/dist/experiments/docs/experiments.docblock.d.ts.map +1 -0
- package/dist/experiments/docs/experiments.docblock.js +290 -20
- package/dist/experiments/evaluator.d.ts +30 -33
- package/dist/experiments/evaluator.d.ts.map +1 -0
- package/dist/experiments/evaluator.js +153 -99
- package/dist/experiments/evaluator.test.d.ts +2 -0
- package/dist/experiments/evaluator.test.d.ts.map +1 -0
- package/dist/experiments/spec-resolver.d.ts +12 -16
- package/dist/experiments/spec-resolver.d.ts.map +1 -0
- package/dist/experiments/spec-resolver.js +1 -0
- package/dist/experiments/spec.d.ts +66 -69
- package/dist/experiments/spec.d.ts.map +1 -0
- package/dist/experiments/spec.js +224 -12
- package/dist/experiments/spec.test.d.ts +2 -0
- package/dist/experiments/spec.test.d.ts.map +1 -0
- package/dist/features/index.d.ts +7 -10
- package/dist/features/index.d.ts.map +1 -0
- package/dist/features/index.js +275 -12
- package/dist/features/install.d.ts +12 -19
- package/dist/features/install.d.ts.map +1 -0
- package/dist/features/install.js +93 -34
- package/dist/features/install.test.d.ts +2 -0
- package/dist/features/install.test.d.ts.map +1 -0
- package/dist/features/registry.d.ts +20 -24
- package/dist/features/registry.d.ts.map +1 -0
- package/dist/features/registry.js +188 -45
- package/dist/features/registry.test.d.ts +2 -0
- package/dist/features/registry.test.d.ts.map +1 -0
- package/dist/features/types.d.ts +52 -57
- package/dist/features/types.d.ts.map +1 -0
- package/dist/features/types.js +1 -0
- package/dist/features/types.test.d.ts +2 -0
- package/dist/features/types.test.d.ts.map +1 -0
- package/dist/features/validation.d.ts +4 -7
- package/dist/features/validation.d.ts.map +1 -0
- package/dist/features/validation.js +46 -12
- package/dist/features/validation.test.d.ts +2 -0
- package/dist/features/validation.test.d.ts.map +1 -0
- package/dist/features.capabilities.test.d.ts +2 -0
- package/dist/features.capabilities.test.d.ts.map +1 -0
- package/dist/forms/docs/forms.docblock.d.ts +3 -6
- package/dist/forms/docs/forms.docblock.d.ts.map +1 -0
- package/dist/forms/docs/forms.docblock.js +162 -19
- package/dist/forms/forms.d.ts +222 -223
- package/dist/forms/forms.d.ts.map +1 -0
- package/dist/forms/forms.js +321 -132
- package/dist/forms/index.d.ts +2 -2
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +331 -2
- package/dist/index.d.ts +50 -185
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18233 -157
- package/dist/install.d.ts +53 -54
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +53 -33
- package/dist/integrations/binding.d.ts +14 -16
- package/dist/integrations/binding.d.ts.map +1 -0
- package/dist/integrations/binding.js +1 -0
- package/dist/integrations/connection.d.ts +44 -47
- package/dist/integrations/connection.d.ts.map +1 -0
- package/dist/integrations/connection.js +1 -0
- package/dist/integrations/docs/integrations.docblock.d.ts +3 -6
- package/dist/integrations/docs/integrations.docblock.d.ts.map +1 -0
- package/dist/integrations/docs/integrations.docblock.js +191 -30
- package/dist/integrations/health.d.ts +15 -18
- package/dist/integrations/health.d.ts.map +1 -0
- package/dist/integrations/health.js +100 -66
- package/dist/integrations/health.test.d.ts +2 -0
- package/dist/integrations/health.test.d.ts.map +1 -0
- package/dist/integrations/index.d.ts +12 -34
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +3809 -23
- package/dist/integrations/integrations.capability.d.ts +2 -7
- package/dist/integrations/integrations.capability.d.ts.map +1 -0
- package/dist/integrations/integrations.capability.js +726 -17
- package/dist/integrations/integrations.feature.d.ts +2 -7
- package/dist/integrations/integrations.feature.d.ts.map +1 -0
- package/dist/integrations/integrations.feature.js +298 -64
- package/dist/integrations/meeting-recorder/contracts/index.d.ts +8 -0
- package/dist/integrations/meeting-recorder/contracts/index.d.ts.map +1 -0
- package/dist/integrations/meeting-recorder/contracts/index.js +1231 -0
- package/dist/integrations/meeting-recorder/contracts/meetings.d.ts +452 -0
- package/dist/integrations/meeting-recorder/contracts/meetings.d.ts.map +1 -0
- package/dist/integrations/meeting-recorder/contracts/meetings.js +866 -0
- package/dist/integrations/meeting-recorder/contracts/transcripts.d.ts +167 -0
- package/dist/integrations/meeting-recorder/contracts/transcripts.d.ts.map +1 -0
- package/dist/integrations/meeting-recorder/contracts/transcripts.js +933 -0
- package/dist/integrations/meeting-recorder/contracts/webhooks.d.ts +86 -0
- package/dist/integrations/meeting-recorder/contracts/webhooks.d.ts.map +1 -0
- package/dist/integrations/meeting-recorder/contracts/webhooks.js +819 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.capability.d.ts +2 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.capability.d.ts.map +1 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.capability.js +726 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.feature.d.ts +6 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.feature.d.ts.map +1 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.feature.js +301 -0
- package/dist/integrations/meeting-recorder/models.d.ts +403 -0
- package/dist/integrations/meeting-recorder/models.d.ts.map +1 -0
- package/dist/integrations/meeting-recorder/models.js +152 -0
- package/dist/integrations/meeting-recorder/telemetry.d.ts +14 -0
- package/dist/integrations/meeting-recorder/telemetry.d.ts.map +1 -0
- package/dist/integrations/meeting-recorder/telemetry.js +84 -0
- package/dist/integrations/openbanking/contracts/accounts.d.ts +258 -264
- package/dist/integrations/openbanking/contracts/accounts.d.ts.map +1 -0
- package/dist/integrations/openbanking/contracts/accounts.js +971 -233
- package/dist/integrations/openbanking/contracts/balances.d.ts +151 -157
- package/dist/integrations/openbanking/contracts/balances.d.ts.map +1 -0
- package/dist/integrations/openbanking/contracts/balances.js +935 -163
- package/dist/integrations/openbanking/contracts/index.d.ts +8 -10
- package/dist/integrations/openbanking/contracts/index.d.ts.map +1 -0
- package/dist/integrations/openbanking/contracts/index.js +1396 -9
- package/dist/integrations/openbanking/contracts/transactions.d.ts +190 -196
- package/dist/integrations/openbanking/contracts/transactions.d.ts.map +1 -0
- package/dist/integrations/openbanking/contracts/transactions.js +941 -214
- package/dist/integrations/openbanking/guards.d.ts +8 -11
- package/dist/integrations/openbanking/guards.d.ts.map +1 -0
- package/dist/integrations/openbanking/guards.js +68 -29
- package/dist/integrations/openbanking/guards.test.d.ts +2 -0
- package/dist/integrations/openbanking/guards.test.d.ts.map +1 -0
- package/dist/integrations/openbanking/models.d.ts +221 -225
- package/dist/integrations/openbanking/models.d.ts.map +1 -0
- package/dist/integrations/openbanking/models.js +136 -236
- package/dist/integrations/openbanking/openbanking.capability.d.ts +2 -7
- package/dist/integrations/openbanking/openbanking.capability.d.ts.map +1 -0
- package/dist/integrations/openbanking/openbanking.capability.js +726 -21
- package/dist/integrations/openbanking/openbanking.feature.d.ts +2 -7
- package/dist/integrations/openbanking/openbanking.feature.d.ts.map +1 -0
- package/dist/integrations/openbanking/openbanking.feature.js +300 -73
- package/dist/integrations/openbanking/telemetry.d.ts +12 -14
- package/dist/integrations/openbanking/telemetry.d.ts.map +1 -0
- package/dist/integrations/openbanking/telemetry.js +75 -33
- package/dist/integrations/operations.d.ts +421 -427
- package/dist/integrations/operations.d.ts.map +1 -0
- package/dist/integrations/operations.js +926 -375
- package/dist/integrations/operations.test.d.ts +2 -0
- package/dist/integrations/operations.test.d.ts.map +1 -0
- package/dist/integrations/providers/analytics-reader.d.ts +104 -0
- package/dist/integrations/providers/analytics-reader.d.ts.map +1 -0
- package/dist/integrations/providers/analytics-reader.js +1 -0
- package/dist/integrations/providers/analytics-writer.d.ts +7 -0
- package/dist/integrations/providers/analytics-writer.d.ts.map +1 -0
- package/dist/integrations/providers/analytics-writer.js +1 -0
- package/dist/integrations/providers/analytics.d.ts +48 -0
- package/dist/integrations/providers/analytics.d.ts.map +1 -0
- package/dist/integrations/providers/analytics.js +1 -0
- package/dist/integrations/providers/calendar.d.ts +68 -70
- package/dist/integrations/providers/calendar.d.ts.map +1 -0
- package/dist/integrations/providers/calendar.js +1 -0
- package/dist/integrations/providers/database.d.ts +13 -0
- package/dist/integrations/providers/database.d.ts.map +1 -0
- package/dist/integrations/providers/database.js +1 -0
- package/dist/integrations/providers/elevenlabs.d.ts +4 -8
- package/dist/integrations/providers/elevenlabs.d.ts.map +1 -0
- package/dist/integrations/providers/elevenlabs.js +327 -52
- package/dist/integrations/providers/email.d.ts +74 -76
- package/dist/integrations/providers/email.d.ts.map +1 -0
- package/dist/integrations/providers/email.js +1 -0
- package/dist/integrations/providers/embedding.d.ts +19 -21
- package/dist/integrations/providers/embedding.d.ts.map +1 -0
- package/dist/integrations/providers/embedding.js +1 -0
- package/dist/integrations/providers/fal.d.ts +4 -0
- package/dist/integrations/providers/fal.d.ts.map +1 -0
- package/dist/integrations/providers/fal.js +357 -0
- package/dist/integrations/providers/fathom.d.ts +4 -0
- package/dist/integrations/providers/fathom.d.ts.map +1 -0
- package/dist/integrations/providers/fathom.js +371 -0
- package/dist/integrations/providers/fireflies.d.ts +4 -0
- package/dist/integrations/providers/fireflies.d.ts.map +1 -0
- package/dist/integrations/providers/fireflies.js +351 -0
- package/dist/integrations/providers/gcs-storage.d.ts +4 -8
- package/dist/integrations/providers/gcs-storage.d.ts.map +1 -0
- package/dist/integrations/providers/gcs-storage.js +338 -75
- package/dist/integrations/providers/gmail.d.ts +4 -8
- package/dist/integrations/providers/gmail.d.ts.map +1 -0
- package/dist/integrations/providers/gmail.js +350 -87
- package/dist/integrations/providers/google-calendar.d.ts +4 -8
- package/dist/integrations/providers/google-calendar.d.ts.map +1 -0
- package/dist/integrations/providers/google-calendar.js +333 -66
- package/dist/integrations/providers/gradium.d.ts +4 -0
- package/dist/integrations/providers/gradium.d.ts.map +1 -0
- package/dist/integrations/providers/gradium.js +355 -0
- package/dist/integrations/providers/granola.d.ts +4 -0
- package/dist/integrations/providers/granola.d.ts.map +1 -0
- package/dist/integrations/providers/granola.js +352 -0
- package/dist/integrations/providers/index.d.ts +38 -22
- package/dist/integrations/providers/index.d.ts.map +1 -0
- package/dist/integrations/providers/index.js +2142 -13
- package/dist/integrations/providers/jira.d.ts +4 -0
- package/dist/integrations/providers/jira.d.ts.map +1 -0
- package/dist/integrations/providers/jira.js +353 -0
- package/dist/integrations/providers/linear.d.ts +4 -0
- package/dist/integrations/providers/linear.d.ts.map +1 -0
- package/dist/integrations/providers/linear.js +352 -0
- package/dist/integrations/providers/llm.d.ts +65 -67
- package/dist/integrations/providers/llm.d.ts.map +1 -0
- package/dist/integrations/providers/llm.js +1 -0
- package/dist/integrations/providers/meeting-recorder.d.ts +130 -0
- package/dist/integrations/providers/meeting-recorder.d.ts.map +1 -0
- package/dist/integrations/providers/meeting-recorder.js +1 -0
- package/dist/integrations/providers/mistral.d.ts +4 -8
- package/dist/integrations/providers/mistral.d.ts.map +1 -0
- package/dist/integrations/providers/mistral.js +335 -68
- package/dist/integrations/providers/notion.d.ts +4 -0
- package/dist/integrations/providers/notion.d.ts.map +1 -0
- package/dist/integrations/providers/notion.js +358 -0
- package/dist/integrations/providers/openbanking.d.ts +113 -115
- package/dist/integrations/providers/openbanking.d.ts.map +1 -0
- package/dist/integrations/providers/openbanking.js +1 -0
- package/dist/integrations/providers/payments.d.ts +94 -96
- package/dist/integrations/providers/payments.d.ts.map +1 -0
- package/dist/integrations/providers/payments.js +1 -0
- package/dist/integrations/providers/posthog.d.ts +4 -0
- package/dist/integrations/providers/posthog.d.ts.map +1 -0
- package/dist/integrations/providers/posthog.js +349 -0
- package/dist/integrations/providers/postmark.d.ts +4 -8
- package/dist/integrations/providers/postmark.d.ts.map +1 -0
- package/dist/integrations/providers/postmark.js +339 -68
- package/dist/integrations/providers/powens.d.ts +4 -8
- package/dist/integrations/providers/powens.d.ts.map +1 -0
- package/dist/integrations/providers/powens.js +365 -116
- package/dist/integrations/providers/project-management.d.ts +33 -0
- package/dist/integrations/providers/project-management.d.ts.map +1 -0
- package/dist/integrations/providers/project-management.js +1 -0
- package/dist/integrations/providers/providers.test.d.ts +2 -0
- package/dist/integrations/providers/providers.test.d.ts.map +1 -0
- package/dist/integrations/providers/qdrant.d.ts +4 -8
- package/dist/integrations/providers/qdrant.d.ts.map +1 -0
- package/dist/integrations/providers/qdrant.js +342 -73
- package/dist/integrations/providers/registry.d.ts +3 -7
- package/dist/integrations/providers/registry.d.ts.map +1 -0
- package/dist/integrations/providers/registry.js +2099 -33
- package/dist/integrations/providers/sms.d.ts +28 -30
- package/dist/integrations/providers/sms.d.ts.map +1 -0
- package/dist/integrations/providers/sms.js +1 -0
- package/dist/integrations/providers/storage.d.ts +49 -51
- package/dist/integrations/providers/storage.d.ts.map +1 -0
- package/dist/integrations/providers/storage.js +1 -0
- package/dist/integrations/providers/stripe.d.ts +4 -8
- package/dist/integrations/providers/stripe.d.ts.map +1 -0
- package/dist/integrations/providers/stripe.js +346 -83
- package/dist/integrations/providers/supabase-postgres.d.ts +4 -0
- package/dist/integrations/providers/supabase-postgres.d.ts.map +1 -0
- package/dist/integrations/providers/supabase-postgres.js +332 -0
- package/dist/integrations/providers/supabase-vector.d.ts +4 -0
- package/dist/integrations/providers/supabase-vector.d.ts.map +1 -0
- package/dist/integrations/providers/supabase-vector.js +352 -0
- package/dist/integrations/providers/tldv.d.ts +4 -0
- package/dist/integrations/providers/tldv.d.ts.map +1 -0
- package/dist/integrations/providers/tldv.js +351 -0
- package/dist/integrations/providers/twilio-sms.d.ts +4 -8
- package/dist/integrations/providers/twilio-sms.d.ts.map +1 -0
- package/dist/integrations/providers/twilio-sms.js +332 -61
- package/dist/integrations/providers/vector-store.d.ts +34 -37
- package/dist/integrations/providers/vector-store.d.ts.map +1 -0
- package/dist/integrations/providers/vector-store.js +1 -0
- package/dist/integrations/providers/voice.d.ts +28 -30
- package/dist/integrations/providers/voice.d.ts.map +1 -0
- package/dist/integrations/providers/voice.js +1 -0
- package/dist/integrations/runtime.d.ts +87 -90
- package/dist/integrations/runtime.d.ts.map +1 -0
- package/dist/integrations/runtime.js +234 -181
- package/dist/integrations/runtime.test.d.ts +2 -0
- package/dist/integrations/runtime.test.d.ts.map +1 -0
- package/dist/integrations/secrets/aws-secret-manager.d.ts +24 -26
- package/dist/integrations/secrets/aws-secret-manager.d.ts.map +1 -0
- package/dist/integrations/secrets/aws-secret-manager.js +367 -222
- package/dist/integrations/secrets/env-secret-provider.d.ts +21 -23
- package/dist/integrations/secrets/env-secret-provider.d.ts.map +1 -0
- package/dist/integrations/secrets/env-secret-provider.js +187 -79
- package/dist/integrations/secrets/gcp-secret-manager.d.ts +26 -28
- package/dist/integrations/secrets/gcp-secret-manager.d.ts.map +1 -0
- package/dist/integrations/secrets/gcp-secret-manager.js +369 -221
- package/dist/integrations/secrets/index.d.ts +7 -7
- package/dist/integrations/secrets/index.d.ts.map +1 -0
- package/dist/integrations/secrets/index.js +1159 -8
- package/dist/integrations/secrets/manager.d.ts +33 -35
- package/dist/integrations/secrets/manager.d.ts.map +1 -0
- package/dist/integrations/secrets/manager.js +210 -100
- package/dist/integrations/secrets/provider.d.ts +43 -45
- package/dist/integrations/secrets/provider.d.ts.map +1 -0
- package/dist/integrations/secrets/provider.js +99 -53
- package/dist/integrations/secrets/provider.test.d.ts +2 -0
- package/dist/integrations/secrets/provider.test.d.ts.map +1 -0
- package/dist/integrations/secrets/scaleway-secret-manager.d.ts +33 -35
- package/dist/integrations/secrets/scaleway-secret-manager.d.ts.map +1 -0
- package/dist/integrations/secrets/scaleway-secret-manager.js +394 -236
- package/dist/integrations/secrets-types.d.ts +9 -11
- package/dist/integrations/secrets-types.d.ts.map +1 -0
- package/dist/integrations/secrets-types.js +1 -0
- package/dist/integrations/spec.d.ts +61 -65
- package/dist/integrations/spec.d.ts.map +1 -0
- package/dist/integrations/spec.js +229 -19
- package/dist/integrations/spec.test.d.ts +2 -0
- package/dist/integrations/spec.test.d.ts.map +1 -0
- package/dist/jobs/define-job.d.ts +9 -11
- package/dist/jobs/define-job.d.ts.map +1 -0
- package/dist/jobs/define-job.js +39 -14
- package/dist/jobs/gcp-cloud-tasks.d.ts +34 -36
- package/dist/jobs/gcp-cloud-tasks.d.ts.map +1 -0
- package/dist/jobs/gcp-cloud-tasks.js +100 -50
- package/dist/jobs/gcp-pubsub.d.ts +19 -21
- package/dist/jobs/gcp-pubsub.d.ts.map +1 -0
- package/dist/jobs/gcp-pubsub.js +88 -36
- package/dist/jobs/handlers/gmail-sync-handler.d.ts +6 -9
- package/dist/jobs/handlers/gmail-sync-handler.d.ts.map +1 -0
- package/dist/jobs/handlers/gmail-sync-handler.js +38 -7
- package/dist/jobs/handlers/handlers.test.d.ts +2 -0
- package/dist/jobs/handlers/handlers.test.d.ts.map +1 -0
- package/dist/jobs/handlers/index.d.ts +6 -9
- package/dist/jobs/handlers/index.d.ts.map +1 -0
- package/dist/jobs/handlers/index.js +80 -9
- package/dist/jobs/handlers/ping-handler.d.ts +7 -10
- package/dist/jobs/handlers/ping-handler.d.ts.map +1 -0
- package/dist/jobs/handlers/ping-handler.js +45 -13
- package/dist/jobs/handlers/storage-document-handler.d.ts +8 -11
- package/dist/jobs/handlers/storage-document-handler.d.ts.map +1 -0
- package/dist/jobs/handlers/storage-document-handler.js +45 -12
- package/dist/jobs/index.d.ts +3 -3
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +63 -3
- package/dist/jobs/memory-queue.d.ts +14 -17
- package/dist/jobs/memory-queue.d.ts.map +1 -0
- package/dist/jobs/memory-queue.js +126 -68
- package/dist/jobs/queue.d.ts +88 -92
- package/dist/jobs/queue.d.ts.map +1 -0
- package/dist/jobs/queue.js +49 -27
- package/dist/jobs/queue.test.d.ts +2 -0
- package/dist/jobs/queue.test.d.ts.map +1 -0
- package/dist/jobs/scaleway-sqs-queue.d.ts +25 -27
- package/dist/jobs/scaleway-sqs-queue.d.ts.map +1 -0
- package/dist/jobs/scaleway-sqs-queue.js +219 -150
- package/dist/jsonschema.d.ts +23 -25
- package/dist/jsonschema.d.ts.map +1 -0
- package/dist/jsonschema.js +60 -38
- package/dist/jsonschema.test.d.ts +2 -0
- package/dist/jsonschema.test.d.ts.map +1 -0
- package/dist/knowledge/binding.d.ts +22 -24
- package/dist/knowledge/binding.d.ts.map +1 -0
- package/dist/knowledge/binding.js +1 -0
- package/dist/knowledge/docs/knowledge.docblock.d.ts +3 -6
- package/dist/knowledge/docs/knowledge.docblock.d.ts.map +1 -0
- package/dist/knowledge/docs/knowledge.docblock.js +300 -20
- package/dist/knowledge/index.d.ts +5 -11
- package/dist/knowledge/index.d.ts.map +1 -0
- package/dist/knowledge/index.js +468 -10
- package/dist/knowledge/ingestion/document-processor.d.ts +19 -20
- package/dist/knowledge/ingestion/document-processor.d.ts.map +1 -0
- package/dist/knowledge/ingestion/document-processor.js +93 -52
- package/dist/knowledge/ingestion/embedding-service.d.ts +8 -11
- package/dist/knowledge/ingestion/embedding-service.d.ts.map +1 -0
- package/dist/knowledge/ingestion/embedding-service.js +55 -23
- package/dist/knowledge/ingestion/gmail-adapter.d.ts +14 -17
- package/dist/knowledge/ingestion/gmail-adapter.d.ts.map +1 -0
- package/dist/knowledge/ingestion/gmail-adapter.js +96 -44
- package/dist/knowledge/ingestion/index.d.ts +6 -6
- package/dist/knowledge/ingestion/index.d.ts.map +1 -0
- package/dist/knowledge/ingestion/index.js +251 -6
- package/dist/knowledge/ingestion/ingestion.test.d.ts +2 -0
- package/dist/knowledge/ingestion/ingestion.test.d.ts.map +1 -0
- package/dist/knowledge/ingestion/storage-adapter.d.ts +11 -14
- package/dist/knowledge/ingestion/storage-adapter.d.ts.map +1 -0
- package/dist/knowledge/ingestion/storage-adapter.js +60 -24
- package/dist/knowledge/ingestion/vector-indexer.d.ts +13 -16
- package/dist/knowledge/ingestion/vector-indexer.d.ts.map +1 -0
- package/dist/knowledge/ingestion/vector-indexer.js +61 -30
- package/dist/knowledge/knowledge.capability.d.ts +2 -7
- package/dist/knowledge/knowledge.capability.d.ts.map +1 -0
- package/dist/knowledge/knowledge.capability.js +726 -21
- package/dist/knowledge/knowledge.feature.d.ts +2 -7
- package/dist/knowledge/knowledge.feature.d.ts.map +1 -0
- package/dist/knowledge/knowledge.feature.js +298 -65
- package/dist/knowledge/operations.d.ts +283 -289
- package/dist/knowledge/operations.d.ts.map +1 -0
- package/dist/knowledge/operations.js +851 -303
- package/dist/knowledge/operations.test.d.ts +2 -0
- package/dist/knowledge/operations.test.d.ts.map +1 -0
- package/dist/knowledge/query/index.d.ts +2 -2
- package/dist/knowledge/query/index.d.ts.map +1 -0
- package/dist/knowledge/query/index.js +109 -2
- package/dist/knowledge/query/service.d.ts +23 -26
- package/dist/knowledge/query/service.d.ts.map +1 -0
- package/dist/knowledge/query/service.js +105 -60
- package/dist/knowledge/query/service.test.d.ts +2 -0
- package/dist/knowledge/query/service.test.d.ts.map +1 -0
- package/dist/knowledge/runtime.d.ts +25 -28
- package/dist/knowledge/runtime.d.ts.map +1 -0
- package/dist/knowledge/runtime.js +89 -47
- package/dist/knowledge/runtime.test.d.ts +2 -0
- package/dist/knowledge/runtime.test.d.ts.map +1 -0
- package/dist/knowledge/source.d.ts +28 -30
- package/dist/knowledge/source.d.ts.map +1 -0
- package/dist/knowledge/source.js +1 -0
- package/dist/knowledge/spaces/email-threads.d.ts +4 -7
- package/dist/knowledge/spaces/email-threads.d.ts.map +1 -0
- package/dist/knowledge/spaces/email-threads.js +98 -33
- package/dist/knowledge/spaces/financial-docs.d.ts +4 -7
- package/dist/knowledge/spaces/financial-docs.d.ts.map +1 -0
- package/dist/knowledge/spaces/financial-docs.js +98 -33
- package/dist/knowledge/spaces/financial-overview.d.ts +4 -7
- package/dist/knowledge/spaces/financial-overview.d.ts.map +1 -0
- package/dist/knowledge/spaces/financial-overview.js +98 -37
- package/dist/knowledge/spaces/index.d.ts +7 -7
- package/dist/knowledge/spaces/index.d.ts.map +1 -0
- package/dist/knowledge/spaces/index.js +273 -8
- package/dist/knowledge/spaces/product-canon.d.ts +4 -7
- package/dist/knowledge/spaces/product-canon.d.ts.map +1 -0
- package/dist/knowledge/spaces/product-canon.js +98 -33
- package/dist/knowledge/spaces/spaces.test.d.ts +2 -0
- package/dist/knowledge/spaces/spaces.test.d.ts.map +1 -0
- package/dist/knowledge/spaces/support-faq.d.ts +4 -7
- package/dist/knowledge/spaces/support-faq.d.ts.map +1 -0
- package/dist/knowledge/spaces/support-faq.js +99 -36
- package/dist/knowledge/spaces/uploaded-docs.d.ts +4 -7
- package/dist/knowledge/spaces/uploaded-docs.d.ts.map +1 -0
- package/dist/knowledge/spaces/uploaded-docs.js +98 -33
- package/dist/knowledge/spec.d.ts +37 -40
- package/dist/knowledge/spec.d.ts.map +1 -0
- package/dist/knowledge/spec.js +225 -14
- package/dist/knowledge/spec.test.d.ts +2 -0
- package/dist/knowledge/spec.test.d.ts.map +1 -0
- package/dist/llm/exporters.d.ts +31 -32
- package/dist/llm/exporters.d.ts.map +1 -0
- package/dist/llm/exporters.js +1248 -529
- package/dist/llm/index.d.ts +13 -4
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/llm/index.js +1714 -3
- package/dist/llm/prompts.d.ts +26 -24
- package/dist/llm/prompts.d.ts.map +1 -0
- package/dist/llm/prompts.js +1508 -212
- package/dist/llm/types.d.ts +180 -182
- package/dist/llm/types.d.ts.map +1 -0
- package/dist/llm/types.js +1 -0
- package/dist/markdown.d.ts +10 -15
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +776 -116
- package/dist/migrations.d.ts +49 -52
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +64 -28
- package/dist/migrations.test.d.ts +2 -0
- package/dist/migrations.test.d.ts.map +1 -0
- package/dist/model-registry.d.ts +8 -11
- package/dist/model-registry.d.ts.map +1 -0
- package/dist/model-registry.js +60 -29
- package/dist/model-registry.test.d.ts +2 -0
- package/dist/model-registry.test.d.ts.map +1 -0
- package/dist/node/app-config/app-config.capability.js +730 -0
- package/dist/node/app-config/app-config.contracts.js +927 -0
- package/dist/node/app-config/app-config.feature.js +255 -0
- package/dist/node/app-config/branding.js +0 -0
- package/dist/node/app-config/docs/app-config.docblock.js +383 -0
- package/dist/node/app-config/events.js +386 -0
- package/dist/node/app-config/index.js +3113 -0
- package/dist/node/app-config/lifecycle-contracts.js +1084 -0
- package/dist/node/app-config/lifecycle.js +0 -0
- package/dist/node/app-config/runtime.js +734 -0
- package/dist/node/app-config/spec.js +229 -0
- package/dist/node/app-config/validation.js +650 -0
- package/dist/node/capabilities/capabilities.js +217 -0
- package/dist/node/capabilities/context.js +101 -0
- package/dist/node/capabilities/docs/capabilities.docblock.js +353 -0
- package/dist/node/capabilities/guards.js +177 -0
- package/dist/node/capabilities/index.js +739 -0
- package/dist/node/capabilities/meeting-recorder.js +154 -0
- package/dist/node/capabilities/openbanking.js +166 -0
- package/dist/node/capabilities/validation.js +185 -0
- package/dist/node/client/index.js +1379 -0
- package/dist/node/client/react/drivers/rn-reusables.js +38 -0
- package/dist/node/client/react/drivers/shadcn.js +38 -0
- package/dist/node/client/react/feature-render.js +833 -0
- package/dist/node/client/react/form-render.js +681 -0
- package/dist/node/client/react/index.js +1376 -0
- package/dist/node/contract-registry/index.js +129 -0
- package/dist/node/contract-registry/schemas.js +129 -0
- package/dist/node/contract-registry/types.js +0 -0
- package/dist/node/data-views/data-views.js +232 -0
- package/dist/node/data-views/docs/data-views.docblock.js +164 -0
- package/dist/node/data-views/index.js +232 -0
- package/dist/node/data-views/query-generator.js +89 -0
- package/dist/node/data-views/registry.js +226 -0
- package/dist/node/data-views/report/contractVerificationTable.js +240 -0
- package/dist/node/data-views/runtime.js +108 -0
- package/dist/node/data-views/spec.js +38 -0
- package/dist/node/data-views/types.js +0 -0
- package/dist/node/docs/accessibility_wcag_compliance_specs.docblock.js +513 -0
- package/dist/node/docs/capabilities/documentationSystem.capability.js +784 -0
- package/dist/node/docs/capabilities/index.js +784 -0
- package/dist/node/docs/commands/docsGenerate.command.js +1016 -0
- package/dist/node/docs/commands/docsPublish.command.js +995 -0
- package/dist/node/docs/commands/index.js +1120 -0
- package/dist/node/docs/constants.js +78 -0
- package/dist/node/docs/contracts.js +2383 -0
- package/dist/node/docs/ensure-docblocks.js +264 -0
- package/dist/node/docs/events/docsGenerated.event.js +533 -0
- package/dist/node/docs/events/docsPublished.event.js +534 -0
- package/dist/node/docs/events/index.js +567 -0
- package/dist/node/docs/forms/docsSearch.form.js +676 -0
- package/dist/node/docs/forms/index.js +676 -0
- package/dist/node/docs/index.js +5491 -0
- package/dist/node/docs/meta.docs.js +176 -0
- package/dist/node/docs/presentations/docsLayout.presentation.js +1090 -0
- package/dist/node/docs/presentations/docsReferencePage.presentation.js +1090 -0
- package/dist/node/docs/presentations/index.js +1118 -0
- package/dist/node/docs/presentations.js +97 -0
- package/dist/node/docs/queries/contractReference.query.js +966 -0
- package/dist/node/docs/queries/docsIndex.query.js +966 -0
- package/dist/node/docs/queries/index.js +1041 -0
- package/dist/node/docs/registry.js +153 -0
- package/dist/node/docs/tech/auth/better-auth-nextjs.docblock.js +221 -0
- package/dist/node/docs/tech/cli.docblock.js +291 -0
- package/dist/node/docs/tech/contracts/README.docblock.js +164 -0
- package/dist/node/docs/tech/contracts/migrations.docblock.js +164 -0
- package/dist/node/docs/tech/contracts/openapi-export.docblock.js +201 -0
- package/dist/node/docs/tech/contracts/openapi-import.docblock.js +207 -0
- package/dist/node/docs/tech/contracts/ops-to-presentation-linking.docblock.js +225 -0
- package/dist/node/docs/tech/contracts/overlays.docblock.js +231 -0
- package/dist/node/docs/tech/contracts/tests.docblock.js +164 -0
- package/dist/node/docs/tech/contracts/themes.docblock.js +257 -0
- package/dist/node/docs/tech/contracts/vertical-pocket-family-office.docblock.js +269 -0
- package/dist/node/docs/tech/docs-system.docblock.js +264 -0
- package/dist/node/docs/tech/lifecycle-stage-system.docblock.js +376 -0
- package/dist/node/docs/tech/llm/llm-integration.docblock.js +482 -0
- package/dist/node/docs/tech/mcp-endpoints.docblock.js +185 -0
- package/dist/node/docs/tech/presentation-runtime.docblock.js +221 -0
- package/dist/node/docs/tech/report-verification-table.docblock.js +191 -0
- package/dist/node/docs/tech/schema/README.docblock.js +164 -0
- package/dist/node/docs/tech/studio/learning-events.docblock.js +190 -0
- package/dist/node/docs/tech/studio/learning-journeys.docblock.js +227 -0
- package/dist/node/docs/tech/studio/platform-admin-panel.docblock.js +226 -0
- package/dist/node/docs/tech/studio/project-access-teams.docblock.js +200 -0
- package/dist/node/docs/tech/studio/project-routing.docblock.js +209 -0
- package/dist/node/docs/tech/studio/sandbox-unlogged.docblock.js +183 -0
- package/dist/node/docs/tech/studio/team-invitations.docblock.js +228 -0
- package/dist/node/docs/tech/studio/workspace-ops.docblock.js +189 -0
- package/dist/node/docs/tech/studio/workspaces.docblock.js +204 -0
- package/dist/node/docs/tech/telemetry-ingest.docblock.js +305 -0
- package/dist/node/docs/tech/vscode-extension.docblock.js +241 -0
- package/dist/node/docs/tech-contracts.docs.js +239 -0
- package/dist/node/docs/types.js +0 -0
- package/dist/node/docs/views/contractReference.dataView.js +1047 -0
- package/dist/node/docs/views/docsIndex.dataView.js +1041 -0
- package/dist/node/docs/views/exampleCatalog.dataView.js +1025 -0
- package/dist/node/docs/views/index.js +1240 -0
- package/dist/node/events.js +228 -0
- package/dist/node/examples/docs/examples.docblock.js +307 -0
- package/dist/node/examples/index.js +604 -0
- package/dist/node/examples/registry.js +286 -0
- package/dist/node/examples/schema.js +166 -0
- package/dist/node/examples/types.js +77 -0
- package/dist/node/examples/validation.js +287 -0
- package/dist/node/experiments/docs/experiments.docblock.js +291 -0
- package/dist/node/experiments/evaluator.js +155 -0
- package/dist/node/experiments/spec-resolver.js +0 -0
- package/dist/node/experiments/spec.js +227 -0
- package/dist/node/features/index.js +275 -0
- package/dist/node/features/install.js +95 -0
- package/dist/node/features/registry.js +192 -0
- package/dist/node/features/types.js +0 -0
- package/dist/node/features/validation.js +48 -0
- package/dist/node/forms/docs/forms.docblock.js +164 -0
- package/dist/node/forms/forms.js +332 -0
- package/dist/node/forms/index.js +332 -0
- package/dist/node/index.js +18236 -0
- package/dist/node/install.js +60 -0
- package/dist/node/integrations/binding.js +0 -0
- package/dist/node/integrations/connection.js +0 -0
- package/dist/node/integrations/docs/integrations.docblock.js +255 -0
- package/dist/node/integrations/health.js +103 -0
- package/dist/node/integrations/index.js +3809 -0
- package/dist/node/integrations/integrations.capability.js +726 -0
- package/dist/node/integrations/integrations.feature.js +301 -0
- package/dist/node/integrations/meeting-recorder/contracts/index.js +1231 -0
- package/dist/node/integrations/meeting-recorder/contracts/meetings.js +866 -0
- package/dist/node/integrations/meeting-recorder/contracts/transcripts.js +933 -0
- package/dist/node/integrations/meeting-recorder/contracts/webhooks.js +819 -0
- package/dist/node/integrations/meeting-recorder/meeting-recorder.capability.js +726 -0
- package/dist/node/integrations/meeting-recorder/meeting-recorder.feature.js +301 -0
- package/dist/node/integrations/meeting-recorder/models.js +152 -0
- package/dist/node/integrations/meeting-recorder/telemetry.js +84 -0
- package/dist/node/integrations/openbanking/contracts/accounts.js +974 -0
- package/dist/node/integrations/openbanking/contracts/balances.js +938 -0
- package/dist/node/integrations/openbanking/contracts/index.js +1399 -0
- package/dist/node/integrations/openbanking/contracts/transactions.js +944 -0
- package/dist/node/integrations/openbanking/guards.js +72 -0
- package/dist/node/integrations/openbanking/models.js +140 -0
- package/dist/node/integrations/openbanking/openbanking.capability.js +726 -0
- package/dist/node/integrations/openbanking/openbanking.feature.js +303 -0
- package/dist/node/integrations/openbanking/telemetry.js +81 -0
- package/dist/node/integrations/operations.js +943 -0
- package/dist/node/integrations/providers/analytics-reader.js +0 -0
- package/dist/node/integrations/providers/analytics-writer.js +0 -0
- package/dist/node/integrations/providers/analytics.js +0 -0
- package/dist/node/integrations/providers/calendar.js +0 -0
- package/dist/node/integrations/providers/database.js +0 -0
- package/dist/node/integrations/providers/elevenlabs.js +331 -0
- package/dist/node/integrations/providers/email.js +0 -0
- package/dist/node/integrations/providers/embedding.js +0 -0
- package/dist/node/integrations/providers/fal.js +357 -0
- package/dist/node/integrations/providers/fathom.js +371 -0
- package/dist/node/integrations/providers/fireflies.js +351 -0
- package/dist/node/integrations/providers/gcs-storage.js +342 -0
- package/dist/node/integrations/providers/gmail.js +354 -0
- package/dist/node/integrations/providers/google-calendar.js +337 -0
- package/dist/node/integrations/providers/gradium.js +355 -0
- package/dist/node/integrations/providers/granola.js +352 -0
- package/dist/node/integrations/providers/index.js +2142 -0
- package/dist/node/integrations/providers/jira.js +353 -0
- package/dist/node/integrations/providers/linear.js +352 -0
- package/dist/node/integrations/providers/llm.js +0 -0
- package/dist/node/integrations/providers/meeting-recorder.js +0 -0
- package/dist/node/integrations/providers/mistral.js +339 -0
- package/dist/node/integrations/providers/notion.js +358 -0
- package/dist/node/integrations/providers/openbanking.js +0 -0
- package/dist/node/integrations/providers/payments.js +0 -0
- package/dist/node/integrations/providers/posthog.js +349 -0
- package/dist/node/integrations/providers/postmark.js +343 -0
- package/dist/node/integrations/providers/powens.js +369 -0
- package/dist/node/integrations/providers/project-management.js +0 -0
- package/dist/node/integrations/providers/qdrant.js +346 -0
- package/dist/node/integrations/providers/registry.js +2100 -0
- package/dist/node/integrations/providers/sms.js +0 -0
- package/dist/node/integrations/providers/storage.js +0 -0
- package/dist/node/integrations/providers/stripe.js +350 -0
- package/dist/node/integrations/providers/supabase-postgres.js +332 -0
- package/dist/node/integrations/providers/supabase-vector.js +352 -0
- package/dist/node/integrations/providers/tldv.js +351 -0
- package/dist/node/integrations/providers/twilio-sms.js +336 -0
- package/dist/node/integrations/providers/vector-store.js +0 -0
- package/dist/node/integrations/providers/voice.js +0 -0
- package/dist/node/integrations/runtime.js +239 -0
- package/dist/node/integrations/secrets/aws-secret-manager.js +376 -0
- package/dist/node/integrations/secrets/env-secret-provider.js +189 -0
- package/dist/node/integrations/secrets/gcp-secret-manager.js +377 -0
- package/dist/node/integrations/secrets/index.js +1159 -0
- package/dist/node/integrations/secrets/manager.js +213 -0
- package/dist/node/integrations/secrets/provider.js +104 -0
- package/dist/node/integrations/secrets/scaleway-secret-manager.js +405 -0
- package/dist/node/integrations/secrets-types.js +0 -0
- package/dist/node/integrations/spec.js +232 -0
- package/dist/node/jobs/define-job.js +41 -0
- package/dist/node/jobs/gcp-cloud-tasks.js +103 -0
- package/dist/node/jobs/gcp-pubsub.js +91 -0
- package/dist/node/jobs/handlers/gmail-sync-handler.js +40 -0
- package/dist/node/jobs/handlers/index.js +83 -0
- package/dist/node/jobs/handlers/ping-handler.js +47 -0
- package/dist/node/jobs/handlers/storage-document-handler.js +47 -0
- package/dist/node/jobs/index.js +64 -0
- package/dist/node/jobs/memory-queue.js +129 -0
- package/dist/node/jobs/queue.js +55 -0
- package/dist/node/jobs/scaleway-sqs-queue.js +222 -0
- package/dist/node/jsonschema.js +73 -0
- package/dist/node/knowledge/binding.js +0 -0
- package/dist/node/knowledge/docs/knowledge.docblock.js +301 -0
- package/dist/node/knowledge/index.js +468 -0
- package/dist/node/knowledge/ingestion/document-processor.js +95 -0
- package/dist/node/knowledge/ingestion/embedding-service.js +57 -0
- package/dist/node/knowledge/ingestion/gmail-adapter.js +103 -0
- package/dist/node/knowledge/ingestion/index.js +252 -0
- package/dist/node/knowledge/ingestion/storage-adapter.js +62 -0
- package/dist/node/knowledge/ingestion/vector-indexer.js +63 -0
- package/dist/node/knowledge/knowledge.capability.js +726 -0
- package/dist/node/knowledge/knowledge.feature.js +301 -0
- package/dist/node/knowledge/operations.js +869 -0
- package/dist/node/knowledge/query/index.js +110 -0
- package/dist/node/knowledge/query/service.js +110 -0
- package/dist/node/knowledge/runtime.js +91 -0
- package/dist/node/knowledge/source.js +0 -0
- package/dist/node/knowledge/spaces/email-threads.js +102 -0
- package/dist/node/knowledge/spaces/financial-docs.js +102 -0
- package/dist/node/knowledge/spaces/financial-overview.js +102 -0
- package/dist/node/knowledge/spaces/index.js +273 -0
- package/dist/node/knowledge/spaces/product-canon.js +102 -0
- package/dist/node/knowledge/spaces/support-faq.js +103 -0
- package/dist/node/knowledge/spaces/uploaded-docs.js +102 -0
- package/dist/node/knowledge/spec.js +228 -0
- package/dist/node/llm/exporters.js +1261 -0
- package/dist/node/llm/index.js +1715 -0
- package/dist/node/llm/prompts.js +1706 -0
- package/dist/node/llm/types.js +0 -0
- package/dist/node/markdown.js +779 -0
- package/dist/node/migrations.js +67 -0
- package/dist/node/model-registry.js +64 -0
- package/dist/node/onboarding-base.js +810 -0
- package/dist/node/openapi.js +151 -0
- package/dist/node/operations/index.js +665 -0
- package/dist/node/operations/operation.js +51 -0
- package/dist/node/operations/registry.js +405 -0
- package/dist/node/operations/report/getContractVerificationStatus.js +170 -0
- package/dist/node/operations/report/index.js +305 -0
- package/dist/node/ownership.js +73 -0
- package/dist/node/policy/context.js +206 -0
- package/dist/node/policy/docs/policy.docblock.js +313 -0
- package/dist/node/policy/engine.js +325 -0
- package/dist/node/policy/guards.js +387 -0
- package/dist/node/policy/index.js +1313 -0
- package/dist/node/policy/opa-adapter.js +110 -0
- package/dist/node/policy/registry.js +221 -0
- package/dist/node/policy/spec.js +0 -0
- package/dist/node/policy/validation.js +391 -0
- package/dist/node/presentations/docs/presentations-conventions.docblock.js +171 -0
- package/dist/node/presentations/index.js +795 -0
- package/dist/node/presentations/presentations.js +38 -0
- package/dist/node/presentations/registry.js +221 -0
- package/dist/node/presentations/transform-engine.js +600 -0
- package/dist/node/product-intent/contract-patch-intent.js +68 -0
- package/dist/node/product-intent/contract-spec-patch.js +75 -0
- package/dist/node/product-intent/evidence.js +45 -0
- package/dist/node/product-intent/findings.js +81 -0
- package/dist/node/product-intent/impact-report.js +62 -0
- package/dist/node/product-intent/index.js +742 -0
- package/dist/node/product-intent/insights.js +63 -0
- package/dist/node/product-intent/opportunity-brief.js +106 -0
- package/dist/node/product-intent/problems.js +55 -0
- package/dist/node/product-intent/registry.js +242 -0
- package/dist/node/product-intent/runtime.js +320 -0
- package/dist/node/product-intent/spec.js +425 -0
- package/dist/node/product-intent/task-pack.js +69 -0
- package/dist/node/product-intent/tickets.js +57 -0
- package/dist/node/product-intent/types.js +378 -0
- package/dist/node/product-intent/ui-wireframe.js +73 -0
- package/dist/node/prompt.js +38 -0
- package/dist/node/promptRegistry.js +63 -0
- package/dist/node/regenerator/adapters.js +0 -0
- package/dist/node/regenerator/docs/regenerator.docblock.js +164 -0
- package/dist/node/regenerator/executor.js +157 -0
- package/dist/node/regenerator/index.js +342 -0
- package/dist/node/regenerator/service.js +183 -0
- package/dist/node/regenerator/sinks.js +64 -0
- package/dist/node/regenerator/types.js +0 -0
- package/dist/node/regenerator/utils.js +87 -0
- package/dist/node/registry-utils.js +163 -0
- package/dist/node/registry.js +215 -0
- package/dist/node/resources.js +83 -0
- package/dist/node/schema-to-markdown.js +278 -0
- package/dist/node/serialization/index.js +179 -0
- package/dist/node/serialization/serializers.js +180 -0
- package/dist/node/serialization/types.js +0 -0
- package/dist/node/server/contracts-adapter-hydration.js +71 -0
- package/dist/node/server/contracts-adapter-input.js +130 -0
- package/dist/node/server/graphql-pothos.js +338 -0
- package/dist/node/server/index.js +1469 -0
- package/dist/node/server/mcp/createMcpServer.js +994 -0
- package/dist/node/server/mcp/mcpTypes.js +0 -0
- package/dist/node/server/mcp/registerPresentations.js +877 -0
- package/dist/node/server/mcp/registerPrompts.js +109 -0
- package/dist/node/server/mcp/registerResources.js +75 -0
- package/dist/node/server/mcp/registerTools.js +86 -0
- package/dist/node/server/provider-mcp.js +994 -0
- package/dist/node/server/rest-elysia.js +209 -0
- package/dist/node/server/rest-express.js +224 -0
- package/dist/node/server/rest-generic.js +192 -0
- package/dist/node/server/rest-next-app.js +200 -0
- package/dist/node/server/rest-next-mcp.js +103 -0
- package/dist/node/server/rest-next-pages.js +211 -0
- package/dist/node/telemetry/anomaly.js +91 -0
- package/dist/node/telemetry/docs/telemetry.docblock.js +164 -0
- package/dist/node/telemetry/index.js +417 -0
- package/dist/node/telemetry/spec.js +261 -0
- package/dist/node/telemetry/tracker.js +129 -0
- package/dist/node/tests/index.js +231 -0
- package/dist/node/tests/runner.js +189 -0
- package/dist/node/tests/spec.js +74 -0
- package/dist/node/themes.js +225 -0
- package/dist/node/translations/catalog.js +0 -0
- package/dist/node/translations/index.js +533 -0
- package/dist/node/translations/registry.js +170 -0
- package/dist/node/translations/spec.js +36 -0
- package/dist/node/translations/tenant.js +0 -0
- package/dist/node/translations/validation.js +392 -0
- package/dist/node/types.js +0 -0
- package/dist/node/versioning/index.js +274 -0
- package/dist/node/versioning/refs.js +99 -0
- package/dist/node/versioning/types.js +55 -0
- package/dist/node/versioning/utils.js +184 -0
- package/dist/node/workflow/adapters/db-adapter.js +127 -0
- package/dist/node/workflow/adapters/file-adapter.js +38 -0
- package/dist/node/workflow/adapters/index.js +194 -0
- package/dist/node/workflow/adapters/memory-store.js +93 -0
- package/dist/node/workflow/context.js +247 -0
- package/dist/node/workflow/expression.js +157 -0
- package/dist/node/workflow/index.js +1546 -0
- package/dist/node/workflow/overview.docblock.js +164 -0
- package/dist/node/workflow/runner.js +532 -0
- package/dist/node/workflow/sla-monitor.js +84 -0
- package/dist/node/workflow/spec.js +221 -0
- package/dist/node/workflow/state.js +0 -0
- package/dist/node/workflow/validation.js +425 -0
- package/dist/node/workspace-config/contractsrc-schema.js +344 -0
- package/dist/node/workspace-config/contractsrc-types.js +0 -0
- package/dist/node/workspace-config/index.js +325 -0
- package/dist/node/workspace-config/workspace-config.docblock.js +188 -0
- package/dist/onboarding-base.d.ts +116 -122
- package/dist/onboarding-base.d.ts.map +1 -0
- package/dist/onboarding-base.js +807 -192
- package/dist/openapi.d.ts +30 -27
- package/dist/openapi.d.ts.map +1 -0
- package/dist/openapi.js +140 -71
- package/dist/operations/index.d.ts +4 -6
- package/dist/operations/index.d.ts.map +1 -0
- package/dist/operations/index.js +664 -6
- package/dist/operations/operation.d.ts +151 -151
- package/dist/operations/operation.d.ts.map +1 -0
- package/dist/operations/operation.js +49 -33
- package/dist/operations/registry.d.ts +53 -48
- package/dist/operations/registry.d.ts.map +1 -0
- package/dist/operations/registry.js +401 -172
- package/dist/operations/report/getContractVerificationStatus.d.ts +61 -67
- package/dist/operations/report/getContractVerificationStatus.d.ts.map +1 -0
- package/dist/operations/report/getContractVerificationStatus.js +166 -92
- package/dist/operations/report/getContractVerificationStatus.test.d.ts +2 -0
- package/dist/operations/report/getContractVerificationStatus.test.d.ts.map +1 -0
- package/dist/operations/report/index.d.ts +8 -10
- package/dist/operations/report/index.d.ts.map +1 -0
- package/dist/operations/report/index.js +301 -41
- package/dist/operations/report/index.test.d.ts +2 -0
- package/dist/operations/report/index.test.d.ts.map +1 -0
- package/dist/ownership.d.ts +154 -151
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +70 -60
- package/dist/ownership.test.d.ts +2 -0
- package/dist/ownership.test.d.ts.map +1 -0
- package/dist/policy/context.d.ts +154 -156
- package/dist/policy/context.d.ts.map +1 -0
- package/dist/policy/context.js +197 -218
- package/dist/policy/context.test.d.ts +2 -0
- package/dist/policy/context.test.d.ts.map +1 -0
- package/dist/policy/docs/policy.docblock.d.ts +3 -6
- package/dist/policy/docs/policy.docblock.d.ts.map +1 -0
- package/dist/policy/docs/policy.docblock.js +312 -20
- package/dist/policy/engine.d.ts +32 -35
- package/dist/policy/engine.d.ts.map +1 -0
- package/dist/policy/engine.js +298 -198
- package/dist/policy/engine.test.d.ts +2 -0
- package/dist/policy/engine.test.d.ts.map +1 -0
- package/dist/policy/guards.d.ts +47 -35
- package/dist/policy/guards.d.ts.map +1 -0
- package/dist/policy/guards.js +373 -240
- package/dist/policy/guards.test.d.ts +2 -0
- package/dist/policy/guards.test.d.ts.map +1 -0
- package/dist/policy/index.d.ts +10 -13
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/index.js +1313 -15
- package/dist/policy/opa-adapter.d.ts +37 -40
- package/dist/policy/opa-adapter.d.ts.map +1 -0
- package/dist/policy/opa-adapter.js +103 -64
- package/dist/policy/opa-adapter.test.d.ts +2 -0
- package/dist/policy/opa-adapter.test.d.ts.map +1 -0
- package/dist/policy/registry.d.ts +5 -8
- package/dist/policy/registry.d.ts.map +1 -0
- package/dist/policy/registry.js +219 -9
- package/dist/policy/spec.d.ts +84 -87
- package/dist/policy/spec.d.ts.map +1 -0
- package/dist/policy/spec.js +1 -0
- package/dist/policy/validation.d.ts +45 -27
- package/dist/policy/validation.d.ts.map +1 -0
- package/dist/policy/validation.js +369 -285
- package/dist/policy/validation.test.d.ts +2 -0
- package/dist/policy/validation.test.d.ts.map +1 -0
- package/dist/presentations/docs/presentations-conventions.docblock.d.ts +3 -6
- package/dist/presentations/docs/presentations-conventions.docblock.d.ts.map +1 -0
- package/dist/presentations/docs/presentations-conventions.docblock.js +169 -19
- package/dist/presentations/index.d.ts +4 -4
- package/dist/presentations/index.d.ts.map +1 -0
- package/dist/presentations/index.js +794 -4
- package/dist/presentations/presentations.d.ts +42 -45
- package/dist/presentations/presentations.d.ts.map +1 -0
- package/dist/presentations/presentations.js +36 -5
- package/dist/presentations/registry.d.ts +5 -8
- package/dist/presentations/registry.d.ts.map +1 -0
- package/dist/presentations/registry.js +219 -10
- package/dist/presentations/transform-engine.d.ts +43 -46
- package/dist/presentations/transform-engine.d.ts.map +1 -0
- package/dist/presentations/transform-engine.js +580 -262
- package/dist/presentations/transform-engine.test.d.ts +2 -0
- package/dist/presentations/transform-engine.test.d.ts.map +1 -0
- package/dist/product-intent/contract-patch-intent.d.ts +101 -0
- package/dist/product-intent/contract-patch-intent.d.ts.map +1 -0
- package/dist/product-intent/contract-patch-intent.js +68 -0
- package/dist/product-intent/contract-spec-patch.d.ts +87 -0
- package/dist/product-intent/contract-spec-patch.d.ts.map +1 -0
- package/dist/product-intent/contract-spec-patch.js +75 -0
- package/dist/product-intent/evidence.d.ts +15 -0
- package/dist/product-intent/evidence.d.ts.map +1 -0
- package/dist/product-intent/evidence.js +45 -0
- package/dist/product-intent/findings.d.ts +58 -0
- package/dist/product-intent/findings.d.ts.map +1 -0
- package/dist/product-intent/findings.js +81 -0
- package/dist/product-intent/impact-report.d.ts +58 -0
- package/dist/product-intent/impact-report.d.ts.map +1 -0
- package/dist/product-intent/impact-report.js +62 -0
- package/dist/product-intent/index.d.ts +14 -0
- package/dist/product-intent/index.d.ts.map +1 -0
- package/dist/product-intent/index.js +742 -0
- package/dist/product-intent/insights.d.ts +63 -0
- package/dist/product-intent/insights.d.ts.map +1 -0
- package/dist/product-intent/insights.js +63 -0
- package/dist/product-intent/opportunity-brief.d.ts +193 -0
- package/dist/product-intent/opportunity-brief.d.ts.map +1 -0
- package/dist/product-intent/opportunity-brief.js +106 -0
- package/dist/product-intent/problems.d.ts +60 -0
- package/dist/product-intent/problems.d.ts.map +1 -0
- package/dist/product-intent/problems.js +55 -0
- package/dist/product-intent/registry.d.ts +29 -0
- package/dist/product-intent/registry.d.ts.map +1 -0
- package/dist/product-intent/registry.js +242 -0
- package/dist/product-intent/registry.test.d.ts +2 -0
- package/dist/product-intent/registry.test.d.ts.map +1 -0
- package/dist/product-intent/runtime.d.ts +93 -0
- package/dist/product-intent/runtime.d.ts.map +1 -0
- package/dist/product-intent/runtime.js +320 -0
- package/dist/product-intent/runtime.test.d.ts +2 -0
- package/dist/product-intent/runtime.test.d.ts.map +1 -0
- package/dist/product-intent/spec.d.ts +665 -0
- package/dist/product-intent/spec.d.ts.map +1 -0
- package/dist/product-intent/spec.js +425 -0
- package/dist/product-intent/task-pack.d.ts +99 -0
- package/dist/product-intent/task-pack.d.ts.map +1 -0
- package/dist/product-intent/task-pack.js +69 -0
- package/dist/product-intent/tickets.d.ts +68 -0
- package/dist/product-intent/tickets.d.ts.map +1 -0
- package/dist/product-intent/tickets.js +57 -0
- package/dist/product-intent/types.d.ts +12 -0
- package/dist/product-intent/types.d.ts.map +1 -0
- package/dist/product-intent/types.js +378 -0
- package/dist/product-intent/ui-wireframe.d.ts +101 -0
- package/dist/product-intent/ui-wireframe.d.ts.map +1 -0
- package/dist/product-intent/ui-wireframe.js +73 -0
- package/dist/prompt.d.ts +37 -40
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +35 -7
- package/dist/prompt.test.d.ts +2 -0
- package/dist/prompt.test.d.ts.map +1 -0
- package/dist/promptRegistry.d.ts +11 -14
- package/dist/promptRegistry.d.ts.map +1 -0
- package/dist/promptRegistry.js +60 -28
- package/dist/promptRegistry.test.d.ts +2 -0
- package/dist/promptRegistry.test.d.ts.map +1 -0
- package/dist/regenerator/adapters.d.ts +12 -15
- package/dist/regenerator/adapters.d.ts.map +1 -0
- package/dist/regenerator/adapters.js +1 -0
- package/dist/regenerator/docs/regenerator.docblock.d.ts +3 -6
- package/dist/regenerator/docs/regenerator.docblock.d.ts.map +1 -0
- package/dist/regenerator/docs/regenerator.docblock.js +162 -19
- package/dist/regenerator/executor.d.ts +52 -55
- package/dist/regenerator/executor.d.ts.map +1 -0
- package/dist/regenerator/executor.js +154 -83
- package/dist/regenerator/executor.test.d.ts +2 -0
- package/dist/regenerator/executor.test.d.ts.map +1 -0
- package/dist/regenerator/index.d.ts +7 -7
- package/dist/regenerator/index.d.ts.map +1 -0
- package/dist/regenerator/index.js +341 -5
- package/dist/regenerator/service.d.ts +28 -31
- package/dist/regenerator/service.d.ts.map +1 -0
- package/dist/regenerator/service.js +181 -91
- package/dist/regenerator/service.test.d.ts +2 -0
- package/dist/regenerator/service.test.d.ts.map +1 -0
- package/dist/regenerator/sinks.d.ts +20 -22
- package/dist/regenerator/sinks.d.ts.map +1 -0
- package/dist/regenerator/sinks.js +62 -30
- package/dist/regenerator/sinks.test.d.ts +2 -0
- package/dist/regenerator/sinks.test.d.ts.map +1 -0
- package/dist/regenerator/types.d.ts +87 -90
- package/dist/regenerator/types.d.ts.map +1 -0
- package/dist/regenerator/types.js +1 -0
- package/dist/regenerator/utils.d.ts +6 -8
- package/dist/regenerator/utils.d.ts.map +1 -0
- package/dist/regenerator/utils.js +73 -37
- package/dist/registry-utils.d.ts +63 -63
- package/dist/registry-utils.d.ts.map +1 -0
- package/dist/registry-utils.js +144 -103
- package/dist/registry-utils.test.d.ts +2 -0
- package/dist/registry-utils.test.d.ts.map +1 -0
- package/dist/registry.d.ts +25 -29
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +212 -58
- package/dist/resources.d.ts +56 -59
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +76 -43
- package/dist/schema-to-markdown.d.ts +35 -32
- package/dist/schema-to-markdown.d.ts.map +1 -0
- package/dist/schema-to-markdown.js +251 -190
- package/dist/serialization/index.d.ts +11 -3
- package/dist/serialization/index.d.ts.map +1 -0
- package/dist/serialization/index.js +179 -3
- package/dist/serialization/serializers.d.ts +18 -22
- package/dist/serialization/serializers.d.ts.map +1 -0
- package/dist/serialization/serializers.js +164 -132
- package/dist/serialization/types.d.ts +82 -84
- package/dist/serialization/types.d.ts.map +1 -0
- package/dist/serialization/types.js +1 -0
- package/dist/server/contracts-adapter-hydration.d.ts +10 -13
- package/dist/server/contracts-adapter-hydration.d.ts.map +1 -0
- package/dist/server/contracts-adapter-hydration.js +67 -37
- package/dist/server/contracts-adapter-input.d.ts +5 -8
- package/dist/server/contracts-adapter-input.d.ts.map +1 -0
- package/dist/server/contracts-adapter-input.js +121 -74
- package/dist/server/graphql-pothos.d.ts +10 -14
- package/dist/server/graphql-pothos.d.ts.map +1 -0
- package/dist/server/graphql-pothos.js +334 -130
- package/dist/server/index.d.ts +8 -9
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +1469 -10
- package/dist/server/mcp/createMcpServer.d.ts +7 -11
- package/dist/server/mcp/createMcpServer.d.ts.map +1 -0
- package/dist/server/mcp/createMcpServer.js +993 -26
- package/dist/server/mcp/mcpTypes.d.ts +22 -26
- package/dist/server/mcp/mcpTypes.d.ts.map +1 -0
- package/dist/server/mcp/mcpTypes.js +1 -0
- package/dist/server/mcp/registerPresentations.d.ts +4 -7
- package/dist/server/mcp/registerPresentations.d.ts.map +1 -0
- package/dist/server/mcp/registerPresentations.js +873 -50
- package/dist/server/mcp/registerPrompts.d.ts +5 -8
- package/dist/server/mcp/registerPrompts.d.ts.map +1 -0
- package/dist/server/mcp/registerPrompts.js +103 -35
- package/dist/server/mcp/registerResources.d.ts +5 -8
- package/dist/server/mcp/registerResources.d.ts.map +1 -0
- package/dist/server/mcp/registerResources.js +70 -30
- package/dist/server/mcp/registerTools.d.ts +5 -8
- package/dist/server/mcp/registerTools.d.ts.map +1 -0
- package/dist/server/mcp/registerTools.js +83 -19
- package/dist/server/provider-mcp.d.ts +2 -2
- package/dist/server/provider-mcp.d.ts.map +1 -0
- package/dist/server/provider-mcp.js +993 -2
- package/dist/server/provider-mcp.test.d.ts +2 -0
- package/dist/server/provider-mcp.test.d.ts.map +1 -0
- package/dist/server/rest-elysia.d.ts +30 -33
- package/dist/server/rest-elysia.d.ts.map +1 -0
- package/dist/server/rest-elysia.js +206 -17
- package/dist/server/rest-express.d.ts +8 -12
- package/dist/server/rest-express.d.ts.map +1 -0
- package/dist/server/rest-express.js +221 -33
- package/dist/server/rest-generic.d.ts +22 -25
- package/dist/server/rest-generic.d.ts.map +1 -0
- package/dist/server/rest-generic.js +185 -117
- package/dist/server/rest-next-app.d.ts +5 -9
- package/dist/server/rest-next-app.d.ts.map +1 -0
- package/dist/server/rest-next-app.js +197 -35
- package/dist/server/rest-next-mcp.d.ts +7 -10
- package/dist/server/rest-next-mcp.d.ts.map +1 -0
- package/dist/server/rest-next-mcp.js +100 -42
- package/dist/server/rest-next-pages.d.ts +6 -9
- package/dist/server/rest-next-pages.d.ts.map +1 -0
- package/dist/server/rest-next-pages.js +208 -19
- package/dist/telemetry/anomaly.d.ts +21 -24
- package/dist/telemetry/anomaly.d.ts.map +1 -0
- package/dist/telemetry/anomaly.js +89 -46
- package/dist/telemetry/anomaly.test.d.ts +2 -0
- package/dist/telemetry/anomaly.test.d.ts.map +1 -0
- package/dist/telemetry/docs/telemetry.docblock.d.ts +3 -6
- package/dist/telemetry/docs/telemetry.docblock.d.ts.map +1 -0
- package/dist/telemetry/docs/telemetry.docblock.js +162 -19
- package/dist/telemetry/index.d.ts +4 -4
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +416 -4
- package/dist/telemetry/spec.d.ts +78 -81
- package/dist/telemetry/spec.d.ts.map +1 -0
- package/dist/telemetry/spec.js +257 -38
- package/dist/telemetry/spec.test.d.ts +2 -0
- package/dist/telemetry/spec.test.d.ts.map +1 -0
- package/dist/telemetry/tracker.d.ts +44 -47
- package/dist/telemetry/tracker.d.ts.map +1 -0
- package/dist/telemetry/tracker.js +126 -73
- package/dist/telemetry/tracker.test.d.ts +2 -0
- package/dist/telemetry/tracker.test.d.ts.map +1 -0
- package/dist/tests/index.d.ts +3 -3
- package/dist/tests/index.d.ts.map +1 -0
- package/dist/tests/index.js +230 -3
- package/dist/tests/runner.d.ts +34 -38
- package/dist/tests/runner.d.ts.map +1 -0
- package/dist/tests/runner.js +186 -147
- package/dist/tests/runner.test.d.ts +2 -0
- package/dist/tests/runner.test.d.ts.map +1 -0
- package/dist/tests/spec.d.ts +59 -63
- package/dist/tests/spec.d.ts.map +1 -0
- package/dist/tests/spec.js +68 -28
- package/dist/tests/spec.test.d.ts +2 -0
- package/dist/tests/spec.test.d.ts.map +1 -0
- package/dist/themes.d.ts +44 -47
- package/dist/themes.d.ts.map +1 -0
- package/dist/themes.js +222 -14
- package/dist/themes.test.d.ts +2 -0
- package/dist/themes.test.d.ts.map +1 -0
- package/dist/translations/catalog.d.ts +22 -24
- package/dist/translations/catalog.d.ts.map +1 -0
- package/dist/translations/catalog.js +1 -0
- package/dist/translations/index.d.ts +45 -6
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/index.js +532 -4
- package/dist/translations/registry.d.ts +167 -138
- package/dist/translations/registry.d.ts.map +1 -0
- package/dist/translations/registry.js +168 -221
- package/dist/translations/registry.test.d.ts +2 -0
- package/dist/translations/registry.test.d.ts.map +1 -0
- package/dist/translations/spec.d.ts +114 -86
- package/dist/translations/spec.d.ts.map +1 -0
- package/dist/translations/spec.js +35 -30
- package/dist/translations/spec.test.d.ts +2 -0
- package/dist/translations/spec.test.d.ts.map +1 -0
- package/dist/translations/tenant.d.ts +11 -14
- package/dist/translations/tenant.d.ts.map +1 -0
- package/dist/translations/tenant.js +1 -0
- package/dist/translations/validation.d.ts +58 -36
- package/dist/translations/validation.d.ts.map +1 -0
- package/dist/translations/validation.js +366 -302
- package/dist/translations/validation.test.d.ts +2 -0
- package/dist/translations/validation.test.d.ts.map +1 -0
- package/dist/types.d.ts +117 -122
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/versioning/index.d.ts +10 -4
- package/dist/versioning/index.d.ts.map +1 -0
- package/dist/versioning/index.js +273 -4
- package/dist/versioning/refs.d.ts +22 -24
- package/dist/versioning/refs.d.ts.map +1 -0
- package/dist/versioning/refs.js +83 -145
- package/dist/versioning/refs.test.d.ts +5 -0
- package/dist/versioning/refs.test.d.ts.map +1 -0
- package/dist/versioning/types.d.ts +110 -106
- package/dist/versioning/types.d.ts.map +1 -0
- package/dist/versioning/types.js +49 -18
- package/dist/versioning/utils.d.ts +18 -19
- package/dist/versioning/utils.d.ts.map +1 -0
- package/dist/versioning/utils.js +158 -154
- package/dist/versioning/utils.test.d.ts +5 -0
- package/dist/versioning/utils.test.d.ts.map +1 -0
- package/dist/workflow/adapters/db-adapter.d.ts +39 -41
- package/dist/workflow/adapters/db-adapter.d.ts.map +1 -0
- package/dist/workflow/adapters/db-adapter.js +125 -81
- package/dist/workflow/adapters/file-adapter.d.ts +6 -9
- package/dist/workflow/adapters/file-adapter.d.ts.map +1 -0
- package/dist/workflow/adapters/file-adapter.js +36 -9
- package/dist/workflow/adapters/index.d.ts +4 -4
- package/dist/workflow/adapters/index.d.ts.map +1 -0
- package/dist/workflow/adapters/index.js +193 -4
- package/dist/workflow/adapters/memory-store.d.ts +9 -13
- package/dist/workflow/adapters/memory-store.d.ts.map +1 -0
- package/dist/workflow/adapters/memory-store.js +89 -54
- package/dist/workflow/context.d.ts +168 -141
- package/dist/workflow/context.d.ts.map +1 -0
- package/dist/workflow/context.js +237 -217
- package/dist/workflow/context.test.d.ts +2 -0
- package/dist/workflow/context.test.d.ts.map +1 -0
- package/dist/workflow/expression.d.ts +6 -8
- package/dist/workflow/expression.d.ts.map +1 -0
- package/dist/workflow/expression.js +143 -85
- package/dist/workflow/expression.test.d.ts +2 -0
- package/dist/workflow/expression.test.d.ts.map +1 -0
- package/dist/workflow/index.d.ts +11 -17
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +1546 -18
- package/dist/workflow/overview.docblock.d.ts +3 -6
- package/dist/workflow/overview.docblock.d.ts.map +1 -0
- package/dist/workflow/overview.docblock.js +162 -19
- package/dist/workflow/runner.d.ts +65 -70
- package/dist/workflow/runner.d.ts.map +1 -0
- package/dist/workflow/runner.js +519 -324
- package/dist/workflow/runner.test.d.ts +2 -0
- package/dist/workflow/runner.test.d.ts.map +1 -0
- package/dist/workflow/sla-monitor.d.ts +15 -18
- package/dist/workflow/sla-monitor.d.ts.map +1 -0
- package/dist/workflow/sla-monitor.js +82 -45
- package/dist/workflow/spec.d.ts +71 -75
- package/dist/workflow/spec.d.ts.map +1 -0
- package/dist/workflow/spec.js +219 -9
- package/dist/workflow/state.d.ts +28 -31
- package/dist/workflow/state.d.ts.map +1 -0
- package/dist/workflow/state.js +1 -0
- package/dist/workflow/validation.d.ts +35 -38
- package/dist/workflow/validation.d.ts.map +1 -0
- package/dist/workflow/validation.js +396 -340
- package/dist/workflow/validation.test.d.ts +2 -0
- package/dist/workflow/validation.test.d.ts.map +1 -0
- package/dist/workspace-config/contractsrc-schema.d.ts +44 -41
- package/dist/workspace-config/contractsrc-schema.d.ts.map +1 -0
- package/dist/workspace-config/contractsrc-schema.js +312 -390
- package/dist/workspace-config/contractsrc-schema.test.d.ts +2 -0
- package/dist/workspace-config/contractsrc-schema.test.d.ts.map +1 -0
- package/dist/workspace-config/contractsrc-types.d.ts +302 -304
- package/dist/workspace-config/contractsrc-types.d.ts.map +1 -0
- package/dist/workspace-config/contractsrc-types.js +1 -0
- package/dist/workspace-config/index.d.ts +6 -3
- package/dist/workspace-config/index.d.ts.map +1 -0
- package/dist/workspace-config/index.js +325 -3
- package/dist/workspace-config/workspace-config.docblock.d.ts +3 -6
- package/dist/workspace-config/workspace-config.docblock.d.ts.map +1 -0
- package/dist/workspace-config/workspace-config.docblock.js +163 -20
- package/package.json +2743 -587
- package/dist/_virtual/rolldown_runtime.js +0 -37
- package/dist/integrations/providers/impls/elevenlabs-voice.d.ts +0 -20
- package/dist/integrations/providers/impls/elevenlabs-voice.js +0 -95
- package/dist/integrations/providers/impls/gcs-storage.d.ts +0 -24
- package/dist/integrations/providers/impls/gcs-storage.js +0 -88
- package/dist/integrations/providers/impls/gmail-inbound.d.ts +0 -26
- package/dist/integrations/providers/impls/gmail-inbound.js +0 -200
- package/dist/integrations/providers/impls/gmail-outbound.d.ts +0 -18
- package/dist/integrations/providers/impls/gmail-outbound.js +0 -105
- package/dist/integrations/providers/impls/google-calendar.d.ts +0 -23
- package/dist/integrations/providers/impls/google-calendar.js +0 -154
- package/dist/integrations/providers/impls/index.d.ts +0 -15
- package/dist/integrations/providers/impls/index.js +0 -16
- package/dist/integrations/providers/impls/mistral-embedding.d.ts +0 -23
- package/dist/integrations/providers/impls/mistral-embedding.js +0 -41
- package/dist/integrations/providers/impls/mistral-llm.d.ts +0 -31
- package/dist/integrations/providers/impls/mistral-llm.js +0 -247
- package/dist/integrations/providers/impls/postmark-email.d.ts +0 -19
- package/dist/integrations/providers/impls/postmark-email.js +0 -55
- package/dist/integrations/providers/impls/powens-client.d.ts +0 -124
- package/dist/integrations/providers/impls/powens-client.js +0 -171
- package/dist/integrations/providers/impls/powens-openbanking.d.ts +0 -27
- package/dist/integrations/providers/impls/powens-openbanking.js +0 -218
- package/dist/integrations/providers/impls/provider-factory.d.ts +0 -26
- package/dist/integrations/providers/impls/provider-factory.js +0 -146
- package/dist/integrations/providers/impls/qdrant-vector.d.ts +0 -24
- package/dist/integrations/providers/impls/qdrant-vector.js +0 -69
- package/dist/integrations/providers/impls/stripe-payments.d.ts +0 -28
- package/dist/integrations/providers/impls/stripe-payments.js +0 -202
- package/dist/integrations/providers/impls/twilio-sms.d.ts +0 -20
- package/dist/integrations/providers/impls/twilio-sms.js +0 -58
|
@@ -0,0 +1,3113 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
7
|
+
var __toCommonJS = (from) => {
|
|
8
|
+
var entry = __moduleCache.get(from), desc;
|
|
9
|
+
if (entry)
|
|
10
|
+
return entry;
|
|
11
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
13
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
}));
|
|
17
|
+
__moduleCache.set(from, entry);
|
|
18
|
+
return entry;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, {
|
|
23
|
+
get: all[name],
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
set: (newValue) => all[name] = () => newValue
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
30
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
31
|
+
|
|
32
|
+
// src/registry-utils.ts
|
|
33
|
+
var exports_registry_utils = {};
|
|
34
|
+
__export(exports_registry_utils, {
|
|
35
|
+
groupByToArray: () => groupByToArray,
|
|
36
|
+
groupByMultiple: () => groupByMultiple,
|
|
37
|
+
groupBy: () => groupBy,
|
|
38
|
+
getUniqueTags: () => getUniqueTags,
|
|
39
|
+
getUniqueOwners: () => getUniqueOwners,
|
|
40
|
+
getUniqueDomains: () => getUniqueDomains,
|
|
41
|
+
filterBy: () => filterBy,
|
|
42
|
+
GroupingStrategies: () => GroupingStrategies
|
|
43
|
+
});
|
|
44
|
+
function filterBy(items, filter) {
|
|
45
|
+
return items.filter((item) => {
|
|
46
|
+
if (filter.tags?.length) {
|
|
47
|
+
const hasMatchingTag = filter.tags.some((tag) => item.meta.tags?.includes(tag));
|
|
48
|
+
if (!hasMatchingTag)
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
if (filter.owners?.length) {
|
|
52
|
+
const hasMatchingOwner = filter.owners.some((owner) => item.meta.owners?.includes(owner));
|
|
53
|
+
if (!hasMatchingOwner)
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
if (filter.stability?.length) {
|
|
57
|
+
if (!filter.stability.includes(item.meta.stability ?? "stable")) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (filter.domain) {
|
|
62
|
+
const itemDomain = GroupingStrategies.byDomain(item);
|
|
63
|
+
if (itemDomain !== filter.domain)
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
if (filter.keyPattern) {
|
|
67
|
+
const name = item.meta.key ?? item.meta.key ?? "";
|
|
68
|
+
const pattern = filter.keyPattern.replace(/\*/g, ".*").replace(/\?/g, ".");
|
|
69
|
+
const regex = new RegExp(`^${pattern}$`, "i");
|
|
70
|
+
if (!regex.test(name))
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
return true;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function groupBy(items, keyFn) {
|
|
77
|
+
const groups = new Map;
|
|
78
|
+
for (const item of items) {
|
|
79
|
+
const key = keyFn(item);
|
|
80
|
+
const existing = groups.get(key);
|
|
81
|
+
if (existing) {
|
|
82
|
+
existing.push(item);
|
|
83
|
+
} else {
|
|
84
|
+
groups.set(key, [item]);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return groups;
|
|
88
|
+
}
|
|
89
|
+
function groupByToArray(items, keyFn) {
|
|
90
|
+
const map = groupBy(items, keyFn);
|
|
91
|
+
return Array.from(map.entries()).map(([key, items2]) => ({ key, items: items2 }));
|
|
92
|
+
}
|
|
93
|
+
function groupByMultiple(items, keysFn) {
|
|
94
|
+
const groups = new Map;
|
|
95
|
+
for (const item of items) {
|
|
96
|
+
const keys = keysFn(item);
|
|
97
|
+
for (const key of keys) {
|
|
98
|
+
const existing = groups.get(key);
|
|
99
|
+
if (existing) {
|
|
100
|
+
existing.push(item);
|
|
101
|
+
} else {
|
|
102
|
+
groups.set(key, [item]);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return groups;
|
|
107
|
+
}
|
|
108
|
+
function getUniqueTags(items) {
|
|
109
|
+
const tags = new Set;
|
|
110
|
+
for (const item of items) {
|
|
111
|
+
for (const tag of item.meta.tags ?? []) {
|
|
112
|
+
tags.add(tag);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return Array.from(tags).sort();
|
|
116
|
+
}
|
|
117
|
+
function getUniqueOwners(items) {
|
|
118
|
+
const owners = new Set;
|
|
119
|
+
for (const item of items) {
|
|
120
|
+
for (const owner of item.meta.owners ?? []) {
|
|
121
|
+
owners.add(owner);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return Array.from(owners).sort();
|
|
125
|
+
}
|
|
126
|
+
function getUniqueDomains(items) {
|
|
127
|
+
const domains = new Set;
|
|
128
|
+
for (const item of items) {
|
|
129
|
+
domains.add(GroupingStrategies.byDomain(item));
|
|
130
|
+
}
|
|
131
|
+
return Array.from(domains).sort();
|
|
132
|
+
}
|
|
133
|
+
var GroupingStrategies;
|
|
134
|
+
var init_registry_utils = __esm(() => {
|
|
135
|
+
GroupingStrategies = {
|
|
136
|
+
byTag: (item) => item.meta.tags?.[0] ?? "untagged",
|
|
137
|
+
byAllTags: (item) => item.meta.tags?.length ? item.meta.tags : ["untagged"],
|
|
138
|
+
byOwner: (item) => item.meta.owners?.[0] ?? "unowned",
|
|
139
|
+
byDomain: (item) => {
|
|
140
|
+
const name = item.meta.key ?? item.meta.key ?? "";
|
|
141
|
+
return name.split(".")[0] ?? "default";
|
|
142
|
+
},
|
|
143
|
+
byStability: (item) => item.meta.stability ?? "stable",
|
|
144
|
+
byUrlPath: (level) => (item) => {
|
|
145
|
+
if (!item.path)
|
|
146
|
+
return "root";
|
|
147
|
+
const segments = item.path.split("/").filter(Boolean);
|
|
148
|
+
return segments.slice(0, level).join("/") || "root";
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// src/capabilities/capabilities.ts
|
|
154
|
+
import { compareVersions } from "compare-versions";
|
|
155
|
+
var capKey = (key, version) => `${key}.v${version}`;
|
|
156
|
+
|
|
157
|
+
class CapabilityRegistry {
|
|
158
|
+
items = new Map;
|
|
159
|
+
surfaceIndex = null;
|
|
160
|
+
register(spec) {
|
|
161
|
+
const key = capKey(spec.meta.key, spec.meta.version);
|
|
162
|
+
if (this.items.has(key))
|
|
163
|
+
throw new Error(`Duplicate capability ${key}`);
|
|
164
|
+
this.items.set(key, spec);
|
|
165
|
+
this.surfaceIndex = null;
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
list() {
|
|
169
|
+
return [...this.items.values()];
|
|
170
|
+
}
|
|
171
|
+
get(key, version) {
|
|
172
|
+
if (version != null)
|
|
173
|
+
return this.items.get(capKey(key, version));
|
|
174
|
+
let candidate;
|
|
175
|
+
for (const spec of this.items.values()) {
|
|
176
|
+
if (spec.meta.key !== key)
|
|
177
|
+
continue;
|
|
178
|
+
if (!candidate || compareVersions(spec.meta.version, candidate.meta.version) > 0) {
|
|
179
|
+
candidate = spec;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return candidate;
|
|
183
|
+
}
|
|
184
|
+
satisfies(requirement, additional) {
|
|
185
|
+
if (requirement.optional)
|
|
186
|
+
return true;
|
|
187
|
+
if (additional?.some((ref) => matchesRequirement(ref, requirement)))
|
|
188
|
+
return true;
|
|
189
|
+
const spec = requirement.version ? this.get(requirement.key, requirement.version) : this.get(requirement.key);
|
|
190
|
+
if (!spec)
|
|
191
|
+
return false;
|
|
192
|
+
if (requirement.kind && spec.meta.kind !== requirement.kind)
|
|
193
|
+
return false;
|
|
194
|
+
if (requirement.version != null && spec.meta.version !== requirement.version)
|
|
195
|
+
return false;
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
buildSurfaceIndex() {
|
|
199
|
+
if (this.surfaceIndex)
|
|
200
|
+
return this.surfaceIndex;
|
|
201
|
+
this.surfaceIndex = new Map;
|
|
202
|
+
for (const spec of this.items.values()) {
|
|
203
|
+
const capabilityKey = capKey(spec.meta.key, spec.meta.version);
|
|
204
|
+
for (const surface of spec.provides ?? []) {
|
|
205
|
+
const surfaceKey = `${surface.surface}:${surface.key}`;
|
|
206
|
+
if (!this.surfaceIndex.has(surfaceKey)) {
|
|
207
|
+
this.surfaceIndex.set(surfaceKey, new Set);
|
|
208
|
+
}
|
|
209
|
+
this.surfaceIndex.get(surfaceKey)?.add(capabilityKey);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return this.surfaceIndex;
|
|
213
|
+
}
|
|
214
|
+
getOperationsFor(capabilityKey, version) {
|
|
215
|
+
const spec = this.get(capabilityKey, version);
|
|
216
|
+
if (!spec)
|
|
217
|
+
return [];
|
|
218
|
+
return spec.provides?.filter((s) => s.surface === "operation").map((s) => s.key) ?? [];
|
|
219
|
+
}
|
|
220
|
+
getEventsFor(capabilityKey, version) {
|
|
221
|
+
const spec = this.get(capabilityKey, version);
|
|
222
|
+
if (!spec)
|
|
223
|
+
return [];
|
|
224
|
+
return spec.provides?.filter((s) => s.surface === "event").map((s) => s.key) ?? [];
|
|
225
|
+
}
|
|
226
|
+
getPresentationsFor(capabilityKey, version) {
|
|
227
|
+
const spec = this.get(capabilityKey, version);
|
|
228
|
+
if (!spec)
|
|
229
|
+
return [];
|
|
230
|
+
return spec.provides?.filter((s) => s.surface === "presentation").map((s) => s.key) ?? [];
|
|
231
|
+
}
|
|
232
|
+
getWorkflowsFor(capabilityKey, version) {
|
|
233
|
+
const spec = this.get(capabilityKey, version);
|
|
234
|
+
if (!spec)
|
|
235
|
+
return [];
|
|
236
|
+
return spec.provides?.filter((s) => s.surface === "workflow").map((s) => s.key) ?? [];
|
|
237
|
+
}
|
|
238
|
+
getResourcesFor(capabilityKey, version) {
|
|
239
|
+
const spec = this.get(capabilityKey, version);
|
|
240
|
+
if (!spec)
|
|
241
|
+
return [];
|
|
242
|
+
return spec.provides?.filter((s) => s.surface === "resource").map((s) => s.key) ?? [];
|
|
243
|
+
}
|
|
244
|
+
getCapabilitiesForOperation(operationKey) {
|
|
245
|
+
const index = this.buildSurfaceIndex();
|
|
246
|
+
const capKeys = index.get(`operation:${operationKey}`);
|
|
247
|
+
if (!capKeys)
|
|
248
|
+
return [];
|
|
249
|
+
return [...capKeys].map((k) => {
|
|
250
|
+
const spec = this.items.get(k);
|
|
251
|
+
return { key: spec?.meta.key ?? "", version: spec?.meta.version ?? "" };
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
getCapabilitiesForEvent(eventKey) {
|
|
255
|
+
const index = this.buildSurfaceIndex();
|
|
256
|
+
const capKeys = index.get(`event:${eventKey}`);
|
|
257
|
+
if (!capKeys)
|
|
258
|
+
return [];
|
|
259
|
+
return [...capKeys].map((k) => {
|
|
260
|
+
const spec = this.items.get(k);
|
|
261
|
+
return { key: spec?.meta.key ?? "", version: spec?.meta.version ?? "" };
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
getCapabilitiesForPresentation(presentationKey) {
|
|
265
|
+
const index = this.buildSurfaceIndex();
|
|
266
|
+
const capKeys = index.get(`presentation:${presentationKey}`);
|
|
267
|
+
if (!capKeys)
|
|
268
|
+
return [];
|
|
269
|
+
return [...capKeys].map((k) => {
|
|
270
|
+
const spec = this.items.get(k);
|
|
271
|
+
return { key: spec?.meta.key ?? "", version: spec?.meta.version ?? "" };
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
getAncestors(capabilityKey, version) {
|
|
275
|
+
const ancestors = [];
|
|
276
|
+
const visited = new Set;
|
|
277
|
+
let current = this.get(capabilityKey, version);
|
|
278
|
+
while (current?.extends) {
|
|
279
|
+
const parentKey = capKey(current.extends.key, current.extends.version);
|
|
280
|
+
if (visited.has(parentKey)) {
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
visited.add(parentKey);
|
|
284
|
+
const parent = this.get(current.extends.key, current.extends.version);
|
|
285
|
+
if (!parent)
|
|
286
|
+
break;
|
|
287
|
+
ancestors.push(parent);
|
|
288
|
+
current = parent;
|
|
289
|
+
}
|
|
290
|
+
return ancestors;
|
|
291
|
+
}
|
|
292
|
+
getEffectiveRequirements(capabilityKey, version) {
|
|
293
|
+
const spec = this.get(capabilityKey, version);
|
|
294
|
+
if (!spec)
|
|
295
|
+
return [];
|
|
296
|
+
const ancestors = this.getAncestors(capabilityKey, version);
|
|
297
|
+
const requirementMap = new Map;
|
|
298
|
+
for (const ancestor of [...ancestors].reverse()) {
|
|
299
|
+
for (const req of ancestor.requires ?? []) {
|
|
300
|
+
requirementMap.set(req.key, req);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
for (const req of spec.requires ?? []) {
|
|
304
|
+
requirementMap.set(req.key, req);
|
|
305
|
+
}
|
|
306
|
+
return [...requirementMap.values()];
|
|
307
|
+
}
|
|
308
|
+
getEffectiveSurfaces(capabilityKey, version) {
|
|
309
|
+
const spec = this.get(capabilityKey, version);
|
|
310
|
+
if (!spec)
|
|
311
|
+
return [];
|
|
312
|
+
const ancestors = this.getAncestors(capabilityKey, version);
|
|
313
|
+
const surfaces = [];
|
|
314
|
+
for (const ancestor of [...ancestors].reverse()) {
|
|
315
|
+
surfaces.push(...ancestor.provides ?? []);
|
|
316
|
+
}
|
|
317
|
+
surfaces.push(...spec.provides ?? []);
|
|
318
|
+
return surfaces;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function matchesRequirement(ref, requirement) {
|
|
322
|
+
if (ref.key !== requirement.key)
|
|
323
|
+
return false;
|
|
324
|
+
if (requirement.version != null && ref.version !== requirement.version)
|
|
325
|
+
return false;
|
|
326
|
+
return true;
|
|
327
|
+
}
|
|
328
|
+
function capabilityKey(spec) {
|
|
329
|
+
return capKey(spec.meta.key, spec.meta.version);
|
|
330
|
+
}
|
|
331
|
+
function defineCapability(spec) {
|
|
332
|
+
return spec;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// src/capabilities/validation.ts
|
|
336
|
+
function validateCapabilityConsistency(deps) {
|
|
337
|
+
const errors = [];
|
|
338
|
+
const warnings = [];
|
|
339
|
+
for (const capability of deps.capabilities.list()) {
|
|
340
|
+
const capKey2 = `${capability.meta.key}.v${capability.meta.version}`;
|
|
341
|
+
for (const surface of capability.provides ?? []) {
|
|
342
|
+
const exists = checkSurfaceExists(deps, surface.surface, surface.key);
|
|
343
|
+
if (!exists) {
|
|
344
|
+
errors.push({
|
|
345
|
+
type: "missing_surface_spec",
|
|
346
|
+
message: `Capability "${capKey2}" provides ${surface.surface} "${surface.key}" but spec not found`,
|
|
347
|
+
capabilityKey: capKey2,
|
|
348
|
+
surface: surface.surface,
|
|
349
|
+
specKey: surface.key
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
if (deps.operations) {
|
|
355
|
+
for (const op of deps.operations.list()) {
|
|
356
|
+
if (op.capability) {
|
|
357
|
+
const capSpec = deps.capabilities.get(op.capability.key, op.capability.version);
|
|
358
|
+
if (!capSpec) {
|
|
359
|
+
errors.push({
|
|
360
|
+
type: "capability_not_found",
|
|
361
|
+
message: `Operation "${op.meta.key}" references capability "${op.capability.key}.v${op.capability.version}" but capability not found`,
|
|
362
|
+
specKey: op.meta.key,
|
|
363
|
+
capabilityKey: `${op.capability.key}.v${op.capability.version}`,
|
|
364
|
+
surface: "operation"
|
|
365
|
+
});
|
|
366
|
+
} else {
|
|
367
|
+
const inProvides = capSpec.provides?.some((p) => p.surface === "operation" && p.key === op.meta.key);
|
|
368
|
+
if (!inProvides) {
|
|
369
|
+
errors.push({
|
|
370
|
+
type: "surface_not_in_provides",
|
|
371
|
+
message: `Operation "${op.meta.key}" claims capability "${op.capability.key}.v${op.capability.version}" but not in capability's provides`,
|
|
372
|
+
specKey: op.meta.key,
|
|
373
|
+
capabilityKey: `${op.capability.key}.v${op.capability.version}`,
|
|
374
|
+
surface: "operation"
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
if (deps.events) {
|
|
382
|
+
for (const event of deps.events.list()) {
|
|
383
|
+
if (event.capability) {
|
|
384
|
+
const capSpec = deps.capabilities.get(event.capability.key, event.capability.version);
|
|
385
|
+
if (!capSpec) {
|
|
386
|
+
errors.push({
|
|
387
|
+
type: "capability_not_found",
|
|
388
|
+
message: `Event "${event.meta.key}" references capability "${event.capability.key}.v${event.capability.version}" but capability not found`,
|
|
389
|
+
specKey: event.meta.key,
|
|
390
|
+
capabilityKey: `${event.capability.key}.v${event.capability.version}`,
|
|
391
|
+
surface: "event"
|
|
392
|
+
});
|
|
393
|
+
} else {
|
|
394
|
+
const inProvides = capSpec.provides?.some((p) => p.surface === "event" && p.key === event.meta.key);
|
|
395
|
+
if (!inProvides) {
|
|
396
|
+
errors.push({
|
|
397
|
+
type: "surface_not_in_provides",
|
|
398
|
+
message: `Event "${event.meta.key}" claims capability "${event.capability.key}.v${event.capability.version}" but not in capability's provides`,
|
|
399
|
+
specKey: event.meta.key,
|
|
400
|
+
capabilityKey: `${event.capability.key}.v${event.capability.version}`,
|
|
401
|
+
surface: "event"
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
if (deps.presentations) {
|
|
409
|
+
for (const pres of deps.presentations.list()) {
|
|
410
|
+
if (pres.capability) {
|
|
411
|
+
const capSpec = deps.capabilities.get(pres.capability.key, pres.capability.version);
|
|
412
|
+
if (!capSpec) {
|
|
413
|
+
errors.push({
|
|
414
|
+
type: "capability_not_found",
|
|
415
|
+
message: `Presentation "${pres.meta.key}" references capability "${pres.capability.key}.v${pres.capability.version}" but capability not found`,
|
|
416
|
+
specKey: pres.meta.key,
|
|
417
|
+
capabilityKey: `${pres.capability.key}.v${pres.capability.version}`,
|
|
418
|
+
surface: "presentation"
|
|
419
|
+
});
|
|
420
|
+
} else {
|
|
421
|
+
const inProvides = capSpec.provides?.some((p) => p.surface === "presentation" && p.key === pres.meta.key);
|
|
422
|
+
if (!inProvides) {
|
|
423
|
+
errors.push({
|
|
424
|
+
type: "surface_not_in_provides",
|
|
425
|
+
message: `Presentation "${pres.meta.key}" claims capability "${pres.capability.key}.v${pres.capability.version}" but not in capability's provides`,
|
|
426
|
+
specKey: pres.meta.key,
|
|
427
|
+
capabilityKey: `${pres.capability.key}.v${pres.capability.version}`,
|
|
428
|
+
surface: "presentation"
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return {
|
|
436
|
+
valid: errors.length === 0,
|
|
437
|
+
errors,
|
|
438
|
+
warnings
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
function checkSurfaceExists(deps, surface, key) {
|
|
442
|
+
switch (surface) {
|
|
443
|
+
case "operation":
|
|
444
|
+
return deps.operations?.has(key) ?? true;
|
|
445
|
+
case "event":
|
|
446
|
+
return deps.events?.has(key) ?? true;
|
|
447
|
+
case "presentation":
|
|
448
|
+
return deps.presentations?.has(key) ?? true;
|
|
449
|
+
case "workflow":
|
|
450
|
+
case "resource":
|
|
451
|
+
return true;
|
|
452
|
+
default:
|
|
453
|
+
return true;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
function findOrphanSpecs(deps) {
|
|
457
|
+
const result = {
|
|
458
|
+
operations: [],
|
|
459
|
+
events: [],
|
|
460
|
+
presentations: []
|
|
461
|
+
};
|
|
462
|
+
if (deps.operations) {
|
|
463
|
+
for (const op of deps.operations.list()) {
|
|
464
|
+
if (!op.capability) {
|
|
465
|
+
result.operations.push(op.meta.key);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (deps.events) {
|
|
470
|
+
for (const event of deps.events.list()) {
|
|
471
|
+
if (!event.capability) {
|
|
472
|
+
result.events.push(event.meta.key);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if (deps.presentations) {
|
|
477
|
+
for (const pres of deps.presentations.list()) {
|
|
478
|
+
if (!pres.capability) {
|
|
479
|
+
result.presentations.push(pres.meta.key);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
return result;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// src/capabilities/context.ts
|
|
487
|
+
class CapabilityMissingError extends Error {
|
|
488
|
+
capabilityKey;
|
|
489
|
+
requiredVersion;
|
|
490
|
+
constructor(capabilityKey2, requiredVersion) {
|
|
491
|
+
const versionSuffix = requiredVersion ? `.v${requiredVersion}` : "";
|
|
492
|
+
super(`Missing required capability: ${capabilityKey2}${versionSuffix}`);
|
|
493
|
+
this.name = "CapabilityMissingError";
|
|
494
|
+
this.capabilityKey = capabilityKey2;
|
|
495
|
+
this.requiredVersion = requiredVersion;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
class CapabilityContextImpl {
|
|
500
|
+
capabilities;
|
|
501
|
+
capabilityVersions;
|
|
502
|
+
constructor(enabledCapabilities) {
|
|
503
|
+
const capSet = new Set;
|
|
504
|
+
const versionMap = new Map;
|
|
505
|
+
for (const cap of enabledCapabilities) {
|
|
506
|
+
capSet.add(cap.key);
|
|
507
|
+
versionMap.set(cap.key, cap.version);
|
|
508
|
+
}
|
|
509
|
+
this.capabilities = capSet;
|
|
510
|
+
this.capabilityVersions = versionMap;
|
|
511
|
+
}
|
|
512
|
+
hasCapability(key, version) {
|
|
513
|
+
if (!this.capabilities.has(key))
|
|
514
|
+
return false;
|
|
515
|
+
if (version != null) {
|
|
516
|
+
const enabledVersion = this.capabilityVersions.get(key);
|
|
517
|
+
return enabledVersion === version;
|
|
518
|
+
}
|
|
519
|
+
return true;
|
|
520
|
+
}
|
|
521
|
+
requireCapability(key, version) {
|
|
522
|
+
if (!this.hasCapability(key, version)) {
|
|
523
|
+
throw new CapabilityMissingError(key, version);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
hasAllCapabilities(keys) {
|
|
527
|
+
return keys.every((k) => this.capabilities.has(k));
|
|
528
|
+
}
|
|
529
|
+
hasAnyCapability(keys) {
|
|
530
|
+
return keys.some((k) => this.capabilities.has(k));
|
|
531
|
+
}
|
|
532
|
+
getMatchingCapabilities(pattern) {
|
|
533
|
+
if (!pattern.includes("*")) {
|
|
534
|
+
return this.capabilities.has(pattern) ? [pattern] : [];
|
|
535
|
+
}
|
|
536
|
+
const regexPattern = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
|
|
537
|
+
const regex = new RegExp(`^${regexPattern}$`);
|
|
538
|
+
return [...this.capabilities].filter((key) => regex.test(key));
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
function createCapabilityContext(enabledCapabilities) {
|
|
542
|
+
return new CapabilityContextImpl(enabledCapabilities);
|
|
543
|
+
}
|
|
544
|
+
function createEmptyCapabilityContext() {
|
|
545
|
+
return new CapabilityContextImpl([]);
|
|
546
|
+
}
|
|
547
|
+
function createBypassCapabilityContext(allCapabilities) {
|
|
548
|
+
return new CapabilityContextImpl(allCapabilities);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
// src/capabilities/guards.ts
|
|
552
|
+
function checkCapabilityForOperation(ctx, operation) {
|
|
553
|
+
if (!operation.capability) {
|
|
554
|
+
return { allowed: true };
|
|
555
|
+
}
|
|
556
|
+
const { key, version } = operation.capability;
|
|
557
|
+
if (ctx.hasCapability(key, version)) {
|
|
558
|
+
return { allowed: true };
|
|
559
|
+
}
|
|
560
|
+
return {
|
|
561
|
+
allowed: false,
|
|
562
|
+
missingCapability: { key, version },
|
|
563
|
+
reason: `Operation "${operation.meta.key}" requires capability "${key}.v${version}"`
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
function assertCapabilityForOperation(ctx, operation) {
|
|
567
|
+
const result = checkCapabilityForOperation(ctx, operation);
|
|
568
|
+
if (!result.allowed && result.missingCapability) {
|
|
569
|
+
throw new CapabilityMissingError(result.missingCapability.key, result.missingCapability.version);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
function checkCapabilityForEvent(ctx, event) {
|
|
573
|
+
if (!event.capability) {
|
|
574
|
+
return { allowed: true };
|
|
575
|
+
}
|
|
576
|
+
const { key, version } = event.capability;
|
|
577
|
+
if (ctx.hasCapability(key, version)) {
|
|
578
|
+
return { allowed: true };
|
|
579
|
+
}
|
|
580
|
+
return {
|
|
581
|
+
allowed: false,
|
|
582
|
+
missingCapability: { key, version },
|
|
583
|
+
reason: `Event "${event.meta.key}" requires capability "${key}.v${version}"`
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
function assertCapabilityForEvent(ctx, event) {
|
|
587
|
+
const result = checkCapabilityForEvent(ctx, event);
|
|
588
|
+
if (!result.allowed && result.missingCapability) {
|
|
589
|
+
throw new CapabilityMissingError(result.missingCapability.key, result.missingCapability.version);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
function checkCapabilityForPresentation(ctx, presentation) {
|
|
593
|
+
if (!presentation.capability) {
|
|
594
|
+
return { allowed: true };
|
|
595
|
+
}
|
|
596
|
+
const { key, version } = presentation.capability;
|
|
597
|
+
if (ctx.hasCapability(key, version)) {
|
|
598
|
+
return { allowed: true };
|
|
599
|
+
}
|
|
600
|
+
return {
|
|
601
|
+
allowed: false,
|
|
602
|
+
missingCapability: { key, version },
|
|
603
|
+
reason: `Presentation "${presentation.meta.key}" requires capability "${key}.v${version}"`
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
function assertCapabilityForPresentation(ctx, presentation) {
|
|
607
|
+
const result = checkCapabilityForPresentation(ctx, presentation);
|
|
608
|
+
if (!result.allowed && result.missingCapability) {
|
|
609
|
+
throw new CapabilityMissingError(result.missingCapability.key, result.missingCapability.version);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
function filterOperationsByCapability(ctx, operations) {
|
|
613
|
+
return operations.filter((op) => checkCapabilityForOperation(ctx, op).allowed);
|
|
614
|
+
}
|
|
615
|
+
function filterEventsByCapability(ctx, events) {
|
|
616
|
+
return events.filter((ev) => checkCapabilityForEvent(ctx, ev).allowed);
|
|
617
|
+
}
|
|
618
|
+
function filterPresentationsByCapability(ctx, presentations) {
|
|
619
|
+
return presentations.filter((pres) => checkCapabilityForPresentation(ctx, pres).allowed);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// src/ownership.ts
|
|
623
|
+
var StabilityEnum = {
|
|
624
|
+
Idea: "idea",
|
|
625
|
+
InCreation: "in_creation",
|
|
626
|
+
Experimental: "experimental",
|
|
627
|
+
Beta: "beta",
|
|
628
|
+
Stable: "stable",
|
|
629
|
+
Deprecated: "deprecated"
|
|
630
|
+
};
|
|
631
|
+
var OwnersEnum = {
|
|
632
|
+
PlatformCore: "platform.core",
|
|
633
|
+
PlatformSigil: "platform.sigil",
|
|
634
|
+
PlatformMarketplace: "platform.marketplace",
|
|
635
|
+
PlatformMessaging: "platform.messaging",
|
|
636
|
+
PlatformContent: "platform.content",
|
|
637
|
+
PlatformFeatureFlags: "platform.featureflags",
|
|
638
|
+
PlatformFinance: "platform.finance"
|
|
639
|
+
};
|
|
640
|
+
var Owners = OwnersEnum;
|
|
641
|
+
var TagsEnum = {
|
|
642
|
+
Spots: "spots",
|
|
643
|
+
Collectivity: "collectivity",
|
|
644
|
+
Marketplace: "marketplace",
|
|
645
|
+
Sellers: "sellers",
|
|
646
|
+
Auth: "auth",
|
|
647
|
+
Login: "login",
|
|
648
|
+
Signup: "signup",
|
|
649
|
+
Guide: "guide",
|
|
650
|
+
Docs: "docs",
|
|
651
|
+
I18n: "i18n",
|
|
652
|
+
Incident: "incident",
|
|
653
|
+
Automation: "automation",
|
|
654
|
+
Hygiene: "hygiene"
|
|
655
|
+
};
|
|
656
|
+
var Tags = TagsEnum;
|
|
657
|
+
|
|
658
|
+
// src/capabilities/openbanking.ts
|
|
659
|
+
var OWNERS = ["platform.finance"];
|
|
660
|
+
var TAGS = ["open-banking", "finance"];
|
|
661
|
+
var openBankingAccountsReadCapability = {
|
|
662
|
+
meta: {
|
|
663
|
+
key: "openbanking.accounts.read",
|
|
664
|
+
version: "1.0.0",
|
|
665
|
+
kind: "integration",
|
|
666
|
+
title: "Open Banking Accounts (Read)",
|
|
667
|
+
description: "Provides read-only access to linked bank accounts, including account summaries and metadata.",
|
|
668
|
+
domain: "finance",
|
|
669
|
+
owners: [...OWNERS],
|
|
670
|
+
tags: [...TAGS],
|
|
671
|
+
stability: StabilityEnum.Experimental
|
|
672
|
+
},
|
|
673
|
+
provides: [
|
|
674
|
+
{
|
|
675
|
+
surface: "operation",
|
|
676
|
+
key: "openbanking.accounts.list",
|
|
677
|
+
version: "1.0.0",
|
|
678
|
+
description: "List bank accounts linked to a Powens open banking connection."
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
surface: "operation",
|
|
682
|
+
key: "openbanking.accounts.get",
|
|
683
|
+
version: "1.0.0",
|
|
684
|
+
description: "Retrieve the canonical bank account record for a specific account."
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
surface: "operation",
|
|
688
|
+
key: "openbanking.accounts.sync",
|
|
689
|
+
version: "1.0.0",
|
|
690
|
+
description: "Trigger a refresh of bank account metadata from the open banking provider."
|
|
691
|
+
}
|
|
692
|
+
]
|
|
693
|
+
};
|
|
694
|
+
var openBankingTransactionsReadCapability = {
|
|
695
|
+
meta: {
|
|
696
|
+
key: "openbanking.transactions.read",
|
|
697
|
+
version: "1.0.0",
|
|
698
|
+
kind: "integration",
|
|
699
|
+
title: "Open Banking Transactions (Read)",
|
|
700
|
+
description: "Enables retrieval of transaction history for linked bank accounts via open banking providers.",
|
|
701
|
+
domain: "finance",
|
|
702
|
+
owners: [...OWNERS],
|
|
703
|
+
tags: [...TAGS, "transactions"],
|
|
704
|
+
stability: StabilityEnum.Experimental
|
|
705
|
+
},
|
|
706
|
+
provides: [
|
|
707
|
+
{
|
|
708
|
+
surface: "operation",
|
|
709
|
+
key: "openbanking.transactions.list",
|
|
710
|
+
version: "1.0.0",
|
|
711
|
+
description: "List transactions for a given bank account with optional date filtering."
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
surface: "operation",
|
|
715
|
+
key: "openbanking.transactions.sync",
|
|
716
|
+
version: "1.0.0",
|
|
717
|
+
description: "Synchronise transactions from the open banking provider into the canonical ledger."
|
|
718
|
+
}
|
|
719
|
+
]
|
|
720
|
+
};
|
|
721
|
+
var openBankingBalancesReadCapability = {
|
|
722
|
+
meta: {
|
|
723
|
+
key: "openbanking.balances.read",
|
|
724
|
+
version: "1.0.0",
|
|
725
|
+
kind: "integration",
|
|
726
|
+
title: "Open Banking Balances (Read)",
|
|
727
|
+
description: "Allows querying of current and available balances for linked bank accounts via open banking providers.",
|
|
728
|
+
domain: "finance",
|
|
729
|
+
owners: [...OWNERS],
|
|
730
|
+
tags: [...TAGS, "balances"],
|
|
731
|
+
stability: StabilityEnum.Experimental
|
|
732
|
+
},
|
|
733
|
+
provides: [
|
|
734
|
+
{
|
|
735
|
+
surface: "operation",
|
|
736
|
+
key: "openbanking.balances.get",
|
|
737
|
+
version: "1.0.0",
|
|
738
|
+
description: "Retrieve the latest known balances for a specified bank account."
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
surface: "operation",
|
|
742
|
+
key: "openbanking.balances.refresh",
|
|
743
|
+
version: "1.0.0",
|
|
744
|
+
description: "Force a balance refresh from the open banking provider."
|
|
745
|
+
}
|
|
746
|
+
]
|
|
747
|
+
};
|
|
748
|
+
function registerOpenBankingCapabilities(registry) {
|
|
749
|
+
return registry.register(openBankingAccountsReadCapability).register(openBankingTransactionsReadCapability).register(openBankingBalancesReadCapability);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
// src/capabilities/meeting-recorder.ts
|
|
753
|
+
var OWNERS2 = ["platform.integrations"];
|
|
754
|
+
var TAGS2 = ["meeting-recorder", "transcripts", "integrations"];
|
|
755
|
+
var meetingRecorderMeetingsReadCapability = {
|
|
756
|
+
meta: {
|
|
757
|
+
key: "meeting-recorder.meetings.read",
|
|
758
|
+
version: "1.0.0",
|
|
759
|
+
kind: "integration",
|
|
760
|
+
title: "Meeting Recorder Meetings (Read)",
|
|
761
|
+
description: "Provides read-only access to recorded meetings and their metadata.",
|
|
762
|
+
domain: "integrations",
|
|
763
|
+
owners: [...OWNERS2],
|
|
764
|
+
tags: [...TAGS2, "meetings"],
|
|
765
|
+
stability: StabilityEnum.Experimental
|
|
766
|
+
},
|
|
767
|
+
provides: [
|
|
768
|
+
{
|
|
769
|
+
surface: "operation",
|
|
770
|
+
key: "meeting-recorder.meetings.list",
|
|
771
|
+
version: "1.0.0",
|
|
772
|
+
description: "List meetings available from the recorder provider."
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
surface: "operation",
|
|
776
|
+
key: "meeting-recorder.meetings.get",
|
|
777
|
+
version: "1.0.0",
|
|
778
|
+
description: "Fetch detailed metadata for a specific meeting."
|
|
779
|
+
}
|
|
780
|
+
]
|
|
781
|
+
};
|
|
782
|
+
var meetingRecorderTranscriptsReadCapability = {
|
|
783
|
+
meta: {
|
|
784
|
+
key: "meeting-recorder.transcripts.read",
|
|
785
|
+
version: "1.0.0",
|
|
786
|
+
kind: "integration",
|
|
787
|
+
title: "Meeting Recorder Transcripts (Read)",
|
|
788
|
+
description: "Enables retrieval of transcripts for recorded meetings from external providers.",
|
|
789
|
+
domain: "integrations",
|
|
790
|
+
owners: [...OWNERS2],
|
|
791
|
+
tags: [...TAGS2, "transcripts"],
|
|
792
|
+
stability: StabilityEnum.Experimental
|
|
793
|
+
},
|
|
794
|
+
provides: [
|
|
795
|
+
{
|
|
796
|
+
surface: "operation",
|
|
797
|
+
key: "meeting-recorder.transcripts.get",
|
|
798
|
+
version: "1.0.0",
|
|
799
|
+
description: "Fetch the transcript for a specific meeting recording."
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
surface: "operation",
|
|
803
|
+
key: "meeting-recorder.transcripts.sync",
|
|
804
|
+
version: "1.0.0",
|
|
805
|
+
description: "Trigger a transcript sync from the recorder provider."
|
|
806
|
+
}
|
|
807
|
+
]
|
|
808
|
+
};
|
|
809
|
+
var meetingRecorderWebhooksCapability = {
|
|
810
|
+
meta: {
|
|
811
|
+
key: "meeting-recorder.webhooks",
|
|
812
|
+
version: "1.0.0",
|
|
813
|
+
kind: "integration",
|
|
814
|
+
title: "Meeting Recorder Webhooks",
|
|
815
|
+
description: "Allows processing of webhook events for meeting transcript readiness.",
|
|
816
|
+
domain: "integrations",
|
|
817
|
+
owners: [...OWNERS2],
|
|
818
|
+
tags: [...TAGS2, "webhooks"],
|
|
819
|
+
stability: StabilityEnum.Experimental
|
|
820
|
+
},
|
|
821
|
+
provides: [
|
|
822
|
+
{
|
|
823
|
+
surface: "operation",
|
|
824
|
+
key: "meeting-recorder.webhooks.ingest",
|
|
825
|
+
version: "1.0.0",
|
|
826
|
+
description: "Ingest and verify meeting recorder webhook payloads."
|
|
827
|
+
}
|
|
828
|
+
]
|
|
829
|
+
};
|
|
830
|
+
function registerMeetingRecorderCapabilities(registry) {
|
|
831
|
+
return registry.register(meetingRecorderMeetingsReadCapability).register(meetingRecorderTranscriptsReadCapability).register(meetingRecorderWebhooksCapability);
|
|
832
|
+
}
|
|
833
|
+
// src/app-config/app-config.capability.ts
|
|
834
|
+
var AppConfigCapability = defineCapability({
|
|
835
|
+
meta: {
|
|
836
|
+
key: "app-config",
|
|
837
|
+
version: "1.0.0",
|
|
838
|
+
title: "App Configuration Capability",
|
|
839
|
+
description: "Provides tenant app configuration lifecycle management.",
|
|
840
|
+
domain: "platform",
|
|
841
|
+
owners: [OwnersEnum.PlatformSigil],
|
|
842
|
+
tags: [TagsEnum.Hygiene],
|
|
843
|
+
kind: "api",
|
|
844
|
+
stability: StabilityEnum.Stable
|
|
845
|
+
},
|
|
846
|
+
provides: [],
|
|
847
|
+
requires: []
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
// src/operations/operation.ts
|
|
851
|
+
var isEmitDeclRef = (e) => ("ref" in e);
|
|
852
|
+
var defineCommand = (spec) => ({
|
|
853
|
+
...spec,
|
|
854
|
+
meta: { ...spec.meta, kind: "command" },
|
|
855
|
+
policy: {
|
|
856
|
+
...spec.policy,
|
|
857
|
+
idempotent: spec.policy?.["policy"]?.idempotent ?? false
|
|
858
|
+
}
|
|
859
|
+
});
|
|
860
|
+
var defineQuery = (spec) => ({
|
|
861
|
+
...spec,
|
|
862
|
+
meta: { ...spec.meta, kind: "query" },
|
|
863
|
+
policy: { ...spec.policy, idempotent: true }
|
|
864
|
+
});
|
|
865
|
+
|
|
866
|
+
// src/registry.ts
|
|
867
|
+
init_registry_utils();
|
|
868
|
+
import { compareVersions as compareVersions2 } from "compare-versions";
|
|
869
|
+
var keyOfSpecContract = (spec) => `${spec.meta.key}.v${spec.meta.version}`;
|
|
870
|
+
|
|
871
|
+
class SpecContractRegistry {
|
|
872
|
+
contractType;
|
|
873
|
+
items = new Map;
|
|
874
|
+
constructor(contractType, items) {
|
|
875
|
+
this.contractType = contractType;
|
|
876
|
+
if (items) {
|
|
877
|
+
items.forEach((p) => this.register(p));
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
register(p) {
|
|
881
|
+
const key = keyOfSpecContract(p);
|
|
882
|
+
if (this.items.has(key))
|
|
883
|
+
throw new Error(`Duplicate contract \`${this.contractType}\` ${key}`);
|
|
884
|
+
this.items.set(key, p);
|
|
885
|
+
return this;
|
|
886
|
+
}
|
|
887
|
+
count() {
|
|
888
|
+
return this.items.size;
|
|
889
|
+
}
|
|
890
|
+
list() {
|
|
891
|
+
return [...this.items.values()];
|
|
892
|
+
}
|
|
893
|
+
get(key, version) {
|
|
894
|
+
if (version != null)
|
|
895
|
+
return this.items.get(`${key}.v${version}`);
|
|
896
|
+
let candidate;
|
|
897
|
+
for (const [k, p] of this.items.entries()) {
|
|
898
|
+
if (!k.startsWith(`${key}.v`))
|
|
899
|
+
continue;
|
|
900
|
+
if (!candidate || compareVersions2(p.meta.version, candidate.meta.version) > 0) {
|
|
901
|
+
candidate = p;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
return candidate;
|
|
905
|
+
}
|
|
906
|
+
has(key, version) {
|
|
907
|
+
return !!this.get(key, version);
|
|
908
|
+
}
|
|
909
|
+
filter(criteria) {
|
|
910
|
+
return filterBy(this.list(), criteria);
|
|
911
|
+
}
|
|
912
|
+
listByTag(tag) {
|
|
913
|
+
return this.list().filter((p) => p.meta.tags?.includes(tag));
|
|
914
|
+
}
|
|
915
|
+
listByOwner(owner) {
|
|
916
|
+
return this.list().filter((p) => p.meta.owners?.includes(owner));
|
|
917
|
+
}
|
|
918
|
+
groupBy(keyFn) {
|
|
919
|
+
return groupBy(this.list(), keyFn);
|
|
920
|
+
}
|
|
921
|
+
getUniqueTags() {
|
|
922
|
+
return getUniqueTags(this.list());
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
// src/events.ts
|
|
927
|
+
function defineEvent(e) {
|
|
928
|
+
return e;
|
|
929
|
+
}
|
|
930
|
+
var eventKey = (key, version) => `${key}.v${version}`;
|
|
931
|
+
|
|
932
|
+
class EventRegistry extends SpecContractRegistry {
|
|
933
|
+
constructor(items) {
|
|
934
|
+
super("event", items);
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
// src/operations/registry.ts
|
|
939
|
+
function opKey(key, version) {
|
|
940
|
+
return `${key}.v${version}`;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
class OperationSpecRegistry extends SpecContractRegistry {
|
|
944
|
+
handlers = new Map;
|
|
945
|
+
constructor(items) {
|
|
946
|
+
super("operation", items);
|
|
947
|
+
}
|
|
948
|
+
bind(spec, handler) {
|
|
949
|
+
const key = opKey(spec.meta.key, spec.meta.version);
|
|
950
|
+
if (!this.items.has(key))
|
|
951
|
+
throw new Error(`Cannot bind; spec not found: ${key}`);
|
|
952
|
+
if (this.handlers.has(key))
|
|
953
|
+
throw new Error(`Handler already bound for ${key}`);
|
|
954
|
+
this.handlers.set(key, handler);
|
|
955
|
+
return this;
|
|
956
|
+
}
|
|
957
|
+
getHandler(key, version) {
|
|
958
|
+
const spec = this.get(key, version);
|
|
959
|
+
if (!spec)
|
|
960
|
+
return;
|
|
961
|
+
return this.handlers.get(opKey(spec.meta.key, spec.meta.version));
|
|
962
|
+
}
|
|
963
|
+
listBound() {
|
|
964
|
+
const out = [];
|
|
965
|
+
for (const [k, spec] of this.items.entries()) {
|
|
966
|
+
const h = this.handlers.get(k);
|
|
967
|
+
if (h)
|
|
968
|
+
out.push({ spec, handler: h });
|
|
969
|
+
}
|
|
970
|
+
return out;
|
|
971
|
+
}
|
|
972
|
+
async execute(key, version, rawInput, ctx) {
|
|
973
|
+
const baseSpec = this.get(key, version);
|
|
974
|
+
if (!baseSpec)
|
|
975
|
+
throw new Error(`Spec not found for ${key}${version ? `.v${version}` : ""}`);
|
|
976
|
+
const spec = await ctx.specVariantResolver?.resolve({
|
|
977
|
+
name: baseSpec.meta.key,
|
|
978
|
+
version: baseSpec.meta.version,
|
|
979
|
+
kind: baseSpec.meta.kind
|
|
980
|
+
}, ctx) ?? baseSpec;
|
|
981
|
+
let handlerKey = opKey(spec.meta.key, spec.meta.version);
|
|
982
|
+
let handler = this.handlers.get(handlerKey);
|
|
983
|
+
if (!handler) {
|
|
984
|
+
const fallbackKey = opKey(baseSpec.meta.key, baseSpec.meta.version);
|
|
985
|
+
handler = this.handlers.get(fallbackKey);
|
|
986
|
+
handlerKey = fallbackKey;
|
|
987
|
+
}
|
|
988
|
+
if (!handler)
|
|
989
|
+
throw new Error(`No handler bound for ${handlerKey}`);
|
|
990
|
+
const parsedInput = spec.io.input?.getZod().parse(rawInput);
|
|
991
|
+
if (ctx.decide) {
|
|
992
|
+
const [service, command] = spec.meta.key.split(".");
|
|
993
|
+
if (!service || !command)
|
|
994
|
+
throw new Error(`Invalid spec name: ${spec.meta.key}`);
|
|
995
|
+
const decision = await ctx.decide({
|
|
996
|
+
service,
|
|
997
|
+
command,
|
|
998
|
+
version: spec.meta.version,
|
|
999
|
+
actor: ctx.actor ?? "anonymous",
|
|
1000
|
+
channel: ctx.channel,
|
|
1001
|
+
roles: ctx.roles,
|
|
1002
|
+
organizationId: ctx.organizationId,
|
|
1003
|
+
userId: ctx.userId,
|
|
1004
|
+
flags: []
|
|
1005
|
+
});
|
|
1006
|
+
if (decision.effect === "deny") {
|
|
1007
|
+
throw new Error(`PolicyDenied: ${spec.meta.key}.v${spec.meta.version}`);
|
|
1008
|
+
}
|
|
1009
|
+
if (decision.rateLimit && ctx.rateLimit) {
|
|
1010
|
+
const key2 = decision.rateLimit.key ?? "default";
|
|
1011
|
+
const rpm = decision.rateLimit.rpm ?? 60;
|
|
1012
|
+
await ctx.rateLimit(key2, 1, rpm);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
const allowedEvents = new Map;
|
|
1016
|
+
if (spec.sideEffects?.emits) {
|
|
1017
|
+
for (const e of spec.sideEffects.emits) {
|
|
1018
|
+
if (isEmitDeclRef(e)) {
|
|
1019
|
+
const eventSpec = ctx.eventSpecResolver?.get(e.ref.key, e.ref.version);
|
|
1020
|
+
if (eventSpec) {
|
|
1021
|
+
allowedEvents.set(`${e.ref.key}.v${e.ref.version}`, eventSpec.payload);
|
|
1022
|
+
}
|
|
1023
|
+
} else {
|
|
1024
|
+
allowedEvents.set(`${e.key}.v${e.version}`, e.payload);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
const emitGuard = async (eventName, eventVersion, payload) => {
|
|
1029
|
+
const key2 = eventKey(eventName, eventVersion);
|
|
1030
|
+
const schema = allowedEvents.get(key2);
|
|
1031
|
+
if (!schema)
|
|
1032
|
+
throw new Error(`UndeclaredEvent: ${key2} not allowed by ${opKey(spec.meta.key, spec.meta.version)}`);
|
|
1033
|
+
const parsed = schema.getZod().parse(payload);
|
|
1034
|
+
await ctx.eventPublisher?.({
|
|
1035
|
+
key: eventName,
|
|
1036
|
+
version: eventVersion,
|
|
1037
|
+
payload: parsed,
|
|
1038
|
+
traceId: ctx.traceId
|
|
1039
|
+
});
|
|
1040
|
+
};
|
|
1041
|
+
if (ctx.appConfig) {
|
|
1042
|
+
if (!ctx.branding) {
|
|
1043
|
+
ctx.branding = ctx.appConfig.branding;
|
|
1044
|
+
}
|
|
1045
|
+
if (!ctx.translation) {
|
|
1046
|
+
ctx.translation = { config: ctx.appConfig.translation };
|
|
1047
|
+
} else if (!ctx.translation.config) {
|
|
1048
|
+
ctx.translation = {
|
|
1049
|
+
...ctx.translation,
|
|
1050
|
+
config: ctx.appConfig.translation
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
const telemetryContext = ctx.telemetry;
|
|
1055
|
+
const trackTelemetry = async (trigger, details) => {
|
|
1056
|
+
if (!telemetryContext || !trigger?.event)
|
|
1057
|
+
return;
|
|
1058
|
+
try {
|
|
1059
|
+
const props = trigger.properties?.(details) ?? {};
|
|
1060
|
+
await telemetryContext.track(trigger.event.key, trigger.event.version ?? "1.0.0", props, {
|
|
1061
|
+
tenantId: ctx.organizationId ?? undefined,
|
|
1062
|
+
organizationId: ctx.organizationId,
|
|
1063
|
+
userId: ctx.userId,
|
|
1064
|
+
actor: ctx.actor,
|
|
1065
|
+
channel: ctx.channel,
|
|
1066
|
+
metadata: ctx.traceId ? { traceId: ctx.traceId } : undefined
|
|
1067
|
+
});
|
|
1068
|
+
} catch (_error) {}
|
|
1069
|
+
};
|
|
1070
|
+
let result;
|
|
1071
|
+
try {
|
|
1072
|
+
result = await handler(parsedInput, {
|
|
1073
|
+
...ctx,
|
|
1074
|
+
__emitGuard__: emitGuard
|
|
1075
|
+
});
|
|
1076
|
+
} catch (error) {
|
|
1077
|
+
if (spec.telemetry?.failure) {
|
|
1078
|
+
await trackTelemetry(spec.telemetry.failure, {
|
|
1079
|
+
input: parsedInput ?? rawInput,
|
|
1080
|
+
error
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
throw error;
|
|
1084
|
+
}
|
|
1085
|
+
if (spec.telemetry?.success) {
|
|
1086
|
+
await trackTelemetry(spec.telemetry.success, {
|
|
1087
|
+
input: parsedInput ?? rawInput,
|
|
1088
|
+
output: result
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
const outputModel = spec.io.output;
|
|
1092
|
+
if (outputModel?.getZod) {
|
|
1093
|
+
const parsedOutput = outputModel.getZod().parse(result);
|
|
1094
|
+
return parsedOutput;
|
|
1095
|
+
}
|
|
1096
|
+
return result;
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// src/operations/report/getContractVerificationStatus.ts
|
|
1101
|
+
import {
|
|
1102
|
+
ScalarTypeEnum,
|
|
1103
|
+
SchemaModel,
|
|
1104
|
+
ZodSchemaType
|
|
1105
|
+
} from "@contractspec/lib.schema";
|
|
1106
|
+
import * as z from "zod";
|
|
1107
|
+
var REPORT_DOMAIN = "report";
|
|
1108
|
+
var REPORT_OWNERS = ["platform.core"];
|
|
1109
|
+
var REPORT_TAGS = ["report", "drift", "verification"];
|
|
1110
|
+
var REPORT_STABILITY = StabilityEnum.Experimental;
|
|
1111
|
+
var ContractVerificationStatusModel = new SchemaModel({
|
|
1112
|
+
name: "ContractVerificationStatus",
|
|
1113
|
+
fields: {
|
|
1114
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
1115
|
+
lastVerifiedSha: {
|
|
1116
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
1117
|
+
isOptional: true
|
|
1118
|
+
},
|
|
1119
|
+
lastVerifiedDate: {
|
|
1120
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
1121
|
+
isOptional: true
|
|
1122
|
+
},
|
|
1123
|
+
surfaces: {
|
|
1124
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
1125
|
+
isOptional: false,
|
|
1126
|
+
isArray: true
|
|
1127
|
+
},
|
|
1128
|
+
driftMismatches: {
|
|
1129
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
1130
|
+
isOptional: false
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
});
|
|
1134
|
+
var GetContractVerificationStatusInput = new SchemaModel({
|
|
1135
|
+
name: "GetContractVerificationStatusInput",
|
|
1136
|
+
fields: {
|
|
1137
|
+
projectPath: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
1138
|
+
baseline: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
1139
|
+
}
|
|
1140
|
+
});
|
|
1141
|
+
var GetContractVerificationStatusOutput = new ZodSchemaType(z.object({
|
|
1142
|
+
contracts: z.object({
|
|
1143
|
+
name: z.string(),
|
|
1144
|
+
lastVerifiedSha: z.string().optional(),
|
|
1145
|
+
lastVerifiedDate: z.string().optional(),
|
|
1146
|
+
surfaces: z.string().array(),
|
|
1147
|
+
driftMismatches: z.int()
|
|
1148
|
+
}).array()
|
|
1149
|
+
}), {
|
|
1150
|
+
name: "GetContractVerificationStatusOutput"
|
|
1151
|
+
});
|
|
1152
|
+
var GetContractVerificationStatusQuery = defineQuery({
|
|
1153
|
+
meta: {
|
|
1154
|
+
key: "report.getContractVerificationStatus",
|
|
1155
|
+
title: "Get Contract Verification Status",
|
|
1156
|
+
version: "1.0.0",
|
|
1157
|
+
description: "Retrieves per-contract verification status for the impact report.",
|
|
1158
|
+
goal: "Enable stakeholders to see contract health at a glance.",
|
|
1159
|
+
context: "Part of the impact report domain. Reads from drift check outputs and verified.json to provide a consolidated view of each contract's drift debt and surface coverage.",
|
|
1160
|
+
domain: REPORT_DOMAIN,
|
|
1161
|
+
owners: REPORT_OWNERS,
|
|
1162
|
+
tags: REPORT_TAGS,
|
|
1163
|
+
stability: REPORT_STABILITY
|
|
1164
|
+
},
|
|
1165
|
+
io: {
|
|
1166
|
+
input: GetContractVerificationStatusInput,
|
|
1167
|
+
output: GetContractVerificationStatusOutput,
|
|
1168
|
+
errors: {
|
|
1169
|
+
PROJECT_NOT_FOUND: {
|
|
1170
|
+
description: "Project path does not exist.",
|
|
1171
|
+
http: 404,
|
|
1172
|
+
when: "The provided projectPath does not resolve to a valid directory."
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
},
|
|
1176
|
+
policy: {
|
|
1177
|
+
auth: "anonymous",
|
|
1178
|
+
pii: []
|
|
1179
|
+
}
|
|
1180
|
+
});
|
|
1181
|
+
|
|
1182
|
+
// src/install.ts
|
|
1183
|
+
function makeEmit(_spec, ctx) {
|
|
1184
|
+
return {
|
|
1185
|
+
ref: async (ev, payload) => {
|
|
1186
|
+
await ctx.__emitGuard__?.(ev.meta.key, ev.meta.version, payload);
|
|
1187
|
+
},
|
|
1188
|
+
key: async (key, version, payload) => {
|
|
1189
|
+
await ctx.__emitGuard__?.(key, version, payload);
|
|
1190
|
+
},
|
|
1191
|
+
object: async (evt) => {
|
|
1192
|
+
await ctx.__emitGuard__?.(evt.key, evt.version, evt.payload);
|
|
1193
|
+
}
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
function installOp(reg, spec, handler) {
|
|
1197
|
+
return reg.register(spec).bind(spec, handler);
|
|
1198
|
+
}
|
|
1199
|
+
function op(spec, handler) {
|
|
1200
|
+
return {
|
|
1201
|
+
spec,
|
|
1202
|
+
handler,
|
|
1203
|
+
install: (reg) => installOp(reg, spec, handler)
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
// src/data-views/spec.ts
|
|
1208
|
+
function defineDataView(spec) {
|
|
1209
|
+
return spec;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
// src/data-views/report/contractVerificationTable.ts
|
|
1213
|
+
var ContractVerificationTableDataView = defineDataView({
|
|
1214
|
+
meta: {
|
|
1215
|
+
key: "report.contractVerificationTable",
|
|
1216
|
+
title: "Contract Verification Table",
|
|
1217
|
+
version: "1.0.0",
|
|
1218
|
+
description: "Table view of per-contract verification status for the impact report.",
|
|
1219
|
+
domain: "report",
|
|
1220
|
+
owners: ["platform.core"],
|
|
1221
|
+
tags: ["report", "data-view", "verification"],
|
|
1222
|
+
stability: StabilityEnum.Experimental,
|
|
1223
|
+
entity: "contract-verification"
|
|
1224
|
+
},
|
|
1225
|
+
source: {
|
|
1226
|
+
primary: {
|
|
1227
|
+
key: GetContractVerificationStatusQuery.meta.key,
|
|
1228
|
+
version: GetContractVerificationStatusQuery.meta.version
|
|
1229
|
+
}
|
|
1230
|
+
},
|
|
1231
|
+
view: {
|
|
1232
|
+
kind: "table",
|
|
1233
|
+
fields: [
|
|
1234
|
+
{
|
|
1235
|
+
key: "name",
|
|
1236
|
+
label: "Contract / Endpoint / Event",
|
|
1237
|
+
dataPath: "name"
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
key: "timeSinceVerified",
|
|
1241
|
+
label: "Time since verified",
|
|
1242
|
+
dataPath: "lastVerifiedDate"
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
key: "driftMismatches",
|
|
1246
|
+
label: "Drift debt",
|
|
1247
|
+
dataPath: "driftMismatches",
|
|
1248
|
+
format: "number",
|
|
1249
|
+
sortable: true
|
|
1250
|
+
},
|
|
1251
|
+
{
|
|
1252
|
+
key: "surfaces",
|
|
1253
|
+
label: "Surfaces covered",
|
|
1254
|
+
dataPath: "surfaces",
|
|
1255
|
+
format: "badge"
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
key: "lastVerifiedSha",
|
|
1259
|
+
label: "Last verified commit",
|
|
1260
|
+
dataPath: "lastVerifiedSha",
|
|
1261
|
+
width: "sm"
|
|
1262
|
+
}
|
|
1263
|
+
],
|
|
1264
|
+
primaryField: "name",
|
|
1265
|
+
secondaryFields: ["driftMismatches", "timeSinceVerified"],
|
|
1266
|
+
columns: [
|
|
1267
|
+
{ field: "name", width: "lg" },
|
|
1268
|
+
{ field: "lastVerifiedSha", width: "sm" },
|
|
1269
|
+
{ field: "timeSinceVerified", width: "sm" },
|
|
1270
|
+
{ field: "surfaces", width: "md" },
|
|
1271
|
+
{ field: "driftMismatches", width: "xs", align: "right" }
|
|
1272
|
+
]
|
|
1273
|
+
},
|
|
1274
|
+
policy: {
|
|
1275
|
+
flags: [],
|
|
1276
|
+
pii: []
|
|
1277
|
+
}
|
|
1278
|
+
});
|
|
1279
|
+
|
|
1280
|
+
// src/operations/report/index.ts
|
|
1281
|
+
var getContractVerificationStatusHandler = async (input, _ctx) => {
|
|
1282
|
+
try {
|
|
1283
|
+
const cmdProcess = Bun.spawn(["contractspec", "impl", "status", "--format", "json", "--all"], {
|
|
1284
|
+
cwd: input.projectPath
|
|
1285
|
+
});
|
|
1286
|
+
const cmdStdout = await cmdProcess.stdout;
|
|
1287
|
+
const output = await Bun.readableStreamToText(cmdStdout);
|
|
1288
|
+
if (!output) {
|
|
1289
|
+
return { contracts: [] };
|
|
1290
|
+
}
|
|
1291
|
+
const cliOutput = JSON.parse(output);
|
|
1292
|
+
const contracts = [];
|
|
1293
|
+
for (const spec of cliOutput.results || []) {
|
|
1294
|
+
const contract = {
|
|
1295
|
+
name: spec.specKey,
|
|
1296
|
+
lastVerifiedSha: spec.specHash,
|
|
1297
|
+
lastVerifiedDate: spec.specHash ? new Date().toISOString() : undefined,
|
|
1298
|
+
surfaces: spec.implementations.filter((impl) => impl.exists).map((impl) => impl.type),
|
|
1299
|
+
driftMismatches: spec.implementations.filter((impl) => !impl.exists).length
|
|
1300
|
+
};
|
|
1301
|
+
contracts.push(contract);
|
|
1302
|
+
}
|
|
1303
|
+
return { contracts };
|
|
1304
|
+
} catch (error) {
|
|
1305
|
+
console.error("Failed to get contract verification status:", error);
|
|
1306
|
+
return { contracts: [] };
|
|
1307
|
+
}
|
|
1308
|
+
};
|
|
1309
|
+
function registerReportContracts(registry) {
|
|
1310
|
+
installOp(registry, GetContractVerificationStatusQuery, getContractVerificationStatusHandler);
|
|
1311
|
+
return registry;
|
|
1312
|
+
}
|
|
1313
|
+
// src/app-config/spec.ts
|
|
1314
|
+
var blueprintKey = (meta) => `${meta.key}.v${meta.version}`;
|
|
1315
|
+
|
|
1316
|
+
class AppBlueprintRegistry extends SpecContractRegistry {
|
|
1317
|
+
constructor(items) {
|
|
1318
|
+
super("app-config", items);
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
function makeAppBlueprintKey(meta) {
|
|
1322
|
+
return blueprintKey(meta);
|
|
1323
|
+
}
|
|
1324
|
+
var defineAppConfig = (spec) => spec;
|
|
1325
|
+
|
|
1326
|
+
// src/app-config/app-config.feature.ts
|
|
1327
|
+
var AppConfigFeature = defineAppConfig({
|
|
1328
|
+
meta: {
|
|
1329
|
+
key: "app-config",
|
|
1330
|
+
version: "1.0.0",
|
|
1331
|
+
title: "App Configuration",
|
|
1332
|
+
description: "Tenant app configuration lifecycle management with draft, preview, and publish stages",
|
|
1333
|
+
domain: "platform",
|
|
1334
|
+
owners: ["@platform.sigil"],
|
|
1335
|
+
tags: ["app-config", "lifecycle", "configuration", "tenant"],
|
|
1336
|
+
stability: "beta"
|
|
1337
|
+
},
|
|
1338
|
+
operations: [],
|
|
1339
|
+
events: [
|
|
1340
|
+
{ key: "app_config.draft_created", version: "1.0.0" },
|
|
1341
|
+
{ key: "app_config.promoted_to_preview", version: "1.0.0" },
|
|
1342
|
+
{ key: "app_config.published", version: "1.0.0" },
|
|
1343
|
+
{ key: "app_config.rolled_back", version: "1.0.0" }
|
|
1344
|
+
],
|
|
1345
|
+
presentations: [],
|
|
1346
|
+
opToPresentation: [],
|
|
1347
|
+
presentationsTargets: [],
|
|
1348
|
+
capabilities: {
|
|
1349
|
+
provides: [{ key: "app-config", version: "1.0.0" }],
|
|
1350
|
+
requires: []
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1353
|
+
// src/app-config/events.ts
|
|
1354
|
+
import { SchemaModel as SchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
1355
|
+
var lifecycleOwnership = {
|
|
1356
|
+
title: "Tenant App Config Lifecycle",
|
|
1357
|
+
description: "Events emitted when tenant app configurations move through lifecycle stages.",
|
|
1358
|
+
domain: "app-config.lifecycle",
|
|
1359
|
+
owners: [OwnersEnum.PlatformSigil],
|
|
1360
|
+
tags: [TagsEnum.Hygiene],
|
|
1361
|
+
stability: StabilityEnum.Beta
|
|
1362
|
+
};
|
|
1363
|
+
var ConfigDraftCreatedEvent = defineEvent({
|
|
1364
|
+
meta: {
|
|
1365
|
+
...lifecycleOwnership,
|
|
1366
|
+
key: "app_config.draft_created",
|
|
1367
|
+
version: "1.0.0",
|
|
1368
|
+
description: "A new tenant config draft was created."
|
|
1369
|
+
},
|
|
1370
|
+
payload: new SchemaModel2({
|
|
1371
|
+
name: "ConfigDraftCreatedPayload",
|
|
1372
|
+
fields: {
|
|
1373
|
+
tenantId: { type: ScalarTypeEnum2.ID(), isOptional: false },
|
|
1374
|
+
appId: { type: ScalarTypeEnum2.ID(), isOptional: false },
|
|
1375
|
+
version: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1376
|
+
blueprintName: {
|
|
1377
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
1378
|
+
isOptional: false
|
|
1379
|
+
},
|
|
1380
|
+
blueprintVersion: {
|
|
1381
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
1382
|
+
isOptional: false
|
|
1383
|
+
},
|
|
1384
|
+
createdBy: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1385
|
+
clonedFrom: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true }
|
|
1386
|
+
}
|
|
1387
|
+
})
|
|
1388
|
+
});
|
|
1389
|
+
var ConfigPromotedToPreviewEvent = defineEvent({
|
|
1390
|
+
meta: {
|
|
1391
|
+
...lifecycleOwnership,
|
|
1392
|
+
key: "app_config.promoted_to_preview",
|
|
1393
|
+
version: "1.0.0",
|
|
1394
|
+
description: "A tenant config draft was promoted to preview."
|
|
1395
|
+
},
|
|
1396
|
+
payload: new SchemaModel2({
|
|
1397
|
+
name: "ConfigPromotedToPreviewPayload",
|
|
1398
|
+
fields: {
|
|
1399
|
+
tenantId: { type: ScalarTypeEnum2.ID(), isOptional: false },
|
|
1400
|
+
appId: { type: ScalarTypeEnum2.ID(), isOptional: false },
|
|
1401
|
+
version: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1402
|
+
promotedBy: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1403
|
+
warnings: {
|
|
1404
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
1405
|
+
isOptional: true,
|
|
1406
|
+
isArray: true
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
})
|
|
1410
|
+
});
|
|
1411
|
+
var ConfigPublishedEvent = defineEvent({
|
|
1412
|
+
meta: {
|
|
1413
|
+
...lifecycleOwnership,
|
|
1414
|
+
key: "app_config.published",
|
|
1415
|
+
version: "1.0.0",
|
|
1416
|
+
description: "A tenant config version was published to production."
|
|
1417
|
+
},
|
|
1418
|
+
payload: new SchemaModel2({
|
|
1419
|
+
name: "ConfigPublishedPayload",
|
|
1420
|
+
fields: {
|
|
1421
|
+
tenantId: { type: ScalarTypeEnum2.ID(), isOptional: false },
|
|
1422
|
+
appId: { type: ScalarTypeEnum2.ID(), isOptional: false },
|
|
1423
|
+
version: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1424
|
+
previousVersion: {
|
|
1425
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
1426
|
+
isOptional: true
|
|
1427
|
+
},
|
|
1428
|
+
publishedBy: {
|
|
1429
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
1430
|
+
isOptional: false
|
|
1431
|
+
},
|
|
1432
|
+
changeSummary: {
|
|
1433
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
1434
|
+
isOptional: true
|
|
1435
|
+
},
|
|
1436
|
+
changedSections: {
|
|
1437
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
1438
|
+
isOptional: true,
|
|
1439
|
+
isArray: true
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
})
|
|
1443
|
+
});
|
|
1444
|
+
var ConfigRolledBackEvent = defineEvent({
|
|
1445
|
+
meta: {
|
|
1446
|
+
...lifecycleOwnership,
|
|
1447
|
+
key: "app_config.rolled_back",
|
|
1448
|
+
version: "1.0.0",
|
|
1449
|
+
description: "A tenant config was rolled back to a previous version."
|
|
1450
|
+
},
|
|
1451
|
+
payload: new SchemaModel2({
|
|
1452
|
+
name: "ConfigRolledBackPayload",
|
|
1453
|
+
fields: {
|
|
1454
|
+
tenantId: { type: ScalarTypeEnum2.ID(), isOptional: false },
|
|
1455
|
+
appId: { type: ScalarTypeEnum2.ID(), isOptional: false },
|
|
1456
|
+
newVersion: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1457
|
+
rolledBackFrom: {
|
|
1458
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
1459
|
+
isOptional: false
|
|
1460
|
+
},
|
|
1461
|
+
rolledBackTo: {
|
|
1462
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
1463
|
+
isOptional: false
|
|
1464
|
+
},
|
|
1465
|
+
rolledBackBy: {
|
|
1466
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
1467
|
+
isOptional: false
|
|
1468
|
+
},
|
|
1469
|
+
reason: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
|
|
1470
|
+
}
|
|
1471
|
+
})
|
|
1472
|
+
});
|
|
1473
|
+
|
|
1474
|
+
// src/app-config/runtime.ts
|
|
1475
|
+
function resolveAppConfig(blueprint, tenant, deps = {}) {
|
|
1476
|
+
const capabilities2 = mergeCapabilities(blueprint.capabilities, tenant.capabilities);
|
|
1477
|
+
const features = mergeFeatures(blueprint.features, tenant.features);
|
|
1478
|
+
const dataViews = mergeMappings(blueprint.dataViews ?? {}, tenant.dataViewOverrides);
|
|
1479
|
+
const workflows = mergeMappings(blueprint.workflows ?? {}, tenant.workflowOverrides);
|
|
1480
|
+
const policies = mergePolicies(blueprint.policies ?? [], tenant.additionalPolicies ?? []);
|
|
1481
|
+
const theme = mergeTheme(blueprint.theme, tenant.themeOverride);
|
|
1482
|
+
const telemetry = mergeTelemetry(blueprint.telemetry, tenant.telemetryOverride);
|
|
1483
|
+
const experiments = mergeExperiments(blueprint.experiments, tenant.experiments);
|
|
1484
|
+
const featureFlags = mergeFeatureFlags(blueprint.featureFlags ?? [], tenant.featureFlags ?? []);
|
|
1485
|
+
const routes = mergeRoutes(blueprint.routes ?? [], tenant.routeOverrides ?? []);
|
|
1486
|
+
const { resolved: integrations } = evaluateIntegrationSlots(blueprint.integrationSlots, tenant.integrations, deps.integrationConnections, deps.integrationSpecs);
|
|
1487
|
+
const knowledge = resolveKnowledgeBindings(tenant.knowledge, deps.knowledgeSpaces, deps.knowledgeSources);
|
|
1488
|
+
const branding = resolveBranding(blueprint.branding, tenant);
|
|
1489
|
+
const translation = resolveTranslation(blueprint.translationCatalog, tenant.locales, tenant.translationOverrides);
|
|
1490
|
+
return {
|
|
1491
|
+
appId: blueprint.meta.appId,
|
|
1492
|
+
tenantId: tenant.meta.tenantId,
|
|
1493
|
+
environment: tenant.meta.environment,
|
|
1494
|
+
blueprintName: blueprint.meta.key,
|
|
1495
|
+
blueprintVersion: blueprint.meta.version,
|
|
1496
|
+
configVersion: tenant.meta.version,
|
|
1497
|
+
capabilities: capabilities2,
|
|
1498
|
+
features,
|
|
1499
|
+
dataViews,
|
|
1500
|
+
workflows,
|
|
1501
|
+
policies,
|
|
1502
|
+
theme,
|
|
1503
|
+
telemetry,
|
|
1504
|
+
experiments,
|
|
1505
|
+
featureFlags,
|
|
1506
|
+
routes,
|
|
1507
|
+
integrations,
|
|
1508
|
+
knowledge,
|
|
1509
|
+
translation,
|
|
1510
|
+
branding,
|
|
1511
|
+
notes: tenant.notes ?? blueprint.notes
|
|
1512
|
+
};
|
|
1513
|
+
}
|
|
1514
|
+
function composeAppConfig(blueprint, tenant, deps, options = {}) {
|
|
1515
|
+
const resolved = resolveAppConfig(blueprint, tenant, deps);
|
|
1516
|
+
const missing = [];
|
|
1517
|
+
const integrationEvaluation = evaluateIntegrationSlots(blueprint.integrationSlots, tenant.integrations, deps.integrationConnections, deps.integrationSpecs);
|
|
1518
|
+
resolved.integrations = integrationEvaluation.resolved;
|
|
1519
|
+
missing.push(...integrationEvaluation.missing);
|
|
1520
|
+
missing.push(...collectMissingKnowledge(tenant.knowledge ?? [], deps.knowledgeSpaces, deps.knowledgeSources));
|
|
1521
|
+
const capabilities2 = resolveCapabilityRefs(resolved.capabilities.enabled, deps.capabilities, missing);
|
|
1522
|
+
const features = resolveFeatureRefs(resolved.features.include, deps.features, missing);
|
|
1523
|
+
const dataViews = resolvePointerRecord(resolved.dataViews, deps.dataViews, "dataView", missing);
|
|
1524
|
+
const workflows = resolvePointerRecord(resolved.workflows, deps.workflows, "workflow", missing);
|
|
1525
|
+
const policies = resolvePolicies(resolved.policies, deps.policies, missing);
|
|
1526
|
+
const { theme, fallbacks, themeMissing } = resolveThemeBinding(resolved.theme, deps.themes);
|
|
1527
|
+
missing.push(...themeMissing);
|
|
1528
|
+
const { telemetry, telemetryMissing } = resolveTelemetryBinding(resolved.telemetry, deps.telemetry);
|
|
1529
|
+
missing.push(...telemetryMissing);
|
|
1530
|
+
const experiments = resolveExperimentsSpecs(resolved.experiments, deps.experiments, missing);
|
|
1531
|
+
if (options.strict && missing.length > 0) {
|
|
1532
|
+
const reasons = missing.map((item) => `${item.type}:${item.identifier}`).join(", ");
|
|
1533
|
+
throw new Error(`composeAppConfig: missing references -> ${reasons}`);
|
|
1534
|
+
}
|
|
1535
|
+
return {
|
|
1536
|
+
resolved,
|
|
1537
|
+
capabilities: capabilities2,
|
|
1538
|
+
features,
|
|
1539
|
+
dataViews,
|
|
1540
|
+
workflows,
|
|
1541
|
+
policies,
|
|
1542
|
+
theme,
|
|
1543
|
+
themeFallbacks: fallbacks,
|
|
1544
|
+
telemetry,
|
|
1545
|
+
experiments,
|
|
1546
|
+
integrations: resolved.integrations,
|
|
1547
|
+
knowledge: resolved.knowledge,
|
|
1548
|
+
missing
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
function mergeCapabilities(blueprint, tenant) {
|
|
1552
|
+
const enabled = dedupeRefs([...blueprint?.enabled ?? [], ...tenant?.enable ?? []], capabilityKey2);
|
|
1553
|
+
const disabled = dedupeRefs([...blueprint?.disabled ?? [], ...tenant?.disable ?? []], capabilityKey2);
|
|
1554
|
+
const disabledKeys = new Set(disabled.map(capabilityKey2));
|
|
1555
|
+
const filteredEnabled = enabled.filter((ref) => !disabledKeys.has(capabilityKey2(ref)));
|
|
1556
|
+
return { enabled: filteredEnabled, disabled };
|
|
1557
|
+
}
|
|
1558
|
+
function mergeFeatures(blueprint, tenant) {
|
|
1559
|
+
const include = dedupeRefs([...blueprint?.include ?? [], ...tenant?.include ?? []], featureKey);
|
|
1560
|
+
const exclude = dedupeRefs([...blueprint?.exclude ?? [], ...tenant?.exclude ?? []], featureKey);
|
|
1561
|
+
const excludeSet = new Set(exclude.map(featureKey));
|
|
1562
|
+
const filteredInclude = include.filter((ref) => !excludeSet.has(featureKey(ref)));
|
|
1563
|
+
return { include: filteredInclude, exclude };
|
|
1564
|
+
}
|
|
1565
|
+
function mergeMappings(blueprint, overrides) {
|
|
1566
|
+
const merged = { ...blueprint };
|
|
1567
|
+
if (!overrides)
|
|
1568
|
+
return merged;
|
|
1569
|
+
for (const override of overrides) {
|
|
1570
|
+
if (!override)
|
|
1571
|
+
continue;
|
|
1572
|
+
if (!override.pointer) {
|
|
1573
|
+
delete merged[override.slot];
|
|
1574
|
+
} else {
|
|
1575
|
+
merged[override.slot] = override.pointer;
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
return merged;
|
|
1579
|
+
}
|
|
1580
|
+
function mergePolicies(blueprint, additional) {
|
|
1581
|
+
return dedupeRefs([...blueprint, ...additional], policyKey);
|
|
1582
|
+
}
|
|
1583
|
+
function mergeTheme(blueprint, override) {
|
|
1584
|
+
if (!blueprint && !override)
|
|
1585
|
+
return;
|
|
1586
|
+
const primary = override?.primary ?? blueprint?.primary;
|
|
1587
|
+
if (!primary)
|
|
1588
|
+
return;
|
|
1589
|
+
const fallbacks = override?.fallbacks ?? blueprint?.fallbacks ?? [];
|
|
1590
|
+
return { primary, fallbacks };
|
|
1591
|
+
}
|
|
1592
|
+
function mergeTelemetry(blueprint, override) {
|
|
1593
|
+
if (!blueprint && !override)
|
|
1594
|
+
return;
|
|
1595
|
+
const binding = {
|
|
1596
|
+
spec: blueprint?.spec,
|
|
1597
|
+
disabledEvents: blueprint?.disabledEvents ? [...blueprint.disabledEvents] : undefined,
|
|
1598
|
+
samplingOverrides: blueprint?.samplingOverrides ? { ...blueprint.samplingOverrides } : undefined
|
|
1599
|
+
};
|
|
1600
|
+
if (override?.spec !== undefined) {
|
|
1601
|
+
binding.spec = override.spec ?? undefined;
|
|
1602
|
+
}
|
|
1603
|
+
if (override?.disabledEvents) {
|
|
1604
|
+
binding.disabledEvents = dedupeStrings([
|
|
1605
|
+
...binding.disabledEvents ?? [],
|
|
1606
|
+
...override.disabledEvents
|
|
1607
|
+
]);
|
|
1608
|
+
}
|
|
1609
|
+
if (override?.samplingOverrides) {
|
|
1610
|
+
binding.samplingOverrides = {
|
|
1611
|
+
...binding.samplingOverrides ?? {},
|
|
1612
|
+
...override.samplingOverrides
|
|
1613
|
+
};
|
|
1614
|
+
}
|
|
1615
|
+
if (!binding.spec && !binding.disabledEvents?.length) {
|
|
1616
|
+
return;
|
|
1617
|
+
}
|
|
1618
|
+
return binding;
|
|
1619
|
+
}
|
|
1620
|
+
function mergeExperiments(blueprint, tenant) {
|
|
1621
|
+
const defaultActive = blueprint?.active ?? [];
|
|
1622
|
+
const defaultPaused = blueprint?.paused ?? [];
|
|
1623
|
+
const tenantActive = tenant?.active;
|
|
1624
|
+
const tenantPaused = tenant?.paused;
|
|
1625
|
+
const activeSource = tenantActive && tenantActive.length > 0 ? tenantActive : defaultActive;
|
|
1626
|
+
const pausedSource = tenantPaused && tenantPaused.length > 0 ? tenantPaused : defaultPaused;
|
|
1627
|
+
const active = dedupeRefs(activeSource, experimentKey);
|
|
1628
|
+
let paused = dedupeRefs(pausedSource, experimentKey);
|
|
1629
|
+
const activeKeys = new Set(active.map(experimentKey));
|
|
1630
|
+
paused = paused.filter((ref) => !activeKeys.has(experimentKey(ref)));
|
|
1631
|
+
const catalog = dedupeRefs([
|
|
1632
|
+
...defaultActive,
|
|
1633
|
+
...defaultPaused,
|
|
1634
|
+
...tenantActive ?? [],
|
|
1635
|
+
...tenantPaused ?? []
|
|
1636
|
+
], experimentKey);
|
|
1637
|
+
return { catalog, active, paused };
|
|
1638
|
+
}
|
|
1639
|
+
function resolveBranding(defaults, tenant) {
|
|
1640
|
+
const override = tenant.branding;
|
|
1641
|
+
const tenantMeta = tenant.meta;
|
|
1642
|
+
const baseDomain = "app.localhost";
|
|
1643
|
+
const domain = override?.customDomain ?? (override?.subdomain ? `${override.subdomain}.${baseDomain}` : `${tenantMeta.tenantId}.${baseDomain}`);
|
|
1644
|
+
const localePreferenceOrder = [];
|
|
1645
|
+
if (tenant.locales?.defaultLocale) {
|
|
1646
|
+
localePreferenceOrder.push(tenant.locales.defaultLocale);
|
|
1647
|
+
}
|
|
1648
|
+
if (override?.appName) {
|
|
1649
|
+
localePreferenceOrder.push("default", "en");
|
|
1650
|
+
}
|
|
1651
|
+
let appName;
|
|
1652
|
+
if (override?.appName) {
|
|
1653
|
+
for (const key of localePreferenceOrder) {
|
|
1654
|
+
const candidate = override.appName[key];
|
|
1655
|
+
if (candidate) {
|
|
1656
|
+
appName = candidate;
|
|
1657
|
+
break;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
if (!appName) {
|
|
1661
|
+
const [, firstValue] = Object.entries(override.appName)[0] ?? [];
|
|
1662
|
+
if (typeof firstValue === "string") {
|
|
1663
|
+
appName = firstValue;
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
if (!appName) {
|
|
1668
|
+
appName = defaults?.appNameKey ?? tenantMeta.appId;
|
|
1669
|
+
}
|
|
1670
|
+
const assetEntries = new Map;
|
|
1671
|
+
const applyAssets = (assets2) => {
|
|
1672
|
+
if (!assets2)
|
|
1673
|
+
return;
|
|
1674
|
+
for (const asset of assets2) {
|
|
1675
|
+
if (!asset?.type)
|
|
1676
|
+
continue;
|
|
1677
|
+
if ("url" in asset && asset.url) {
|
|
1678
|
+
assetEntries.set(asset.type, asset.url);
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
};
|
|
1682
|
+
applyAssets(defaults?.assets);
|
|
1683
|
+
applyAssets(override?.assets);
|
|
1684
|
+
const assets = {
|
|
1685
|
+
logo: assetEntries.get("logo"),
|
|
1686
|
+
logoDark: assetEntries.get("logo-dark"),
|
|
1687
|
+
favicon: assetEntries.get("favicon"),
|
|
1688
|
+
ogImage: assetEntries.get("og-image")
|
|
1689
|
+
};
|
|
1690
|
+
const colors = {
|
|
1691
|
+
primary: override?.colors?.primary ?? defaults?.colorTokens?.primary ?? "#1f2937",
|
|
1692
|
+
secondary: override?.colors?.secondary ?? defaults?.colorTokens?.secondary ?? "#4b5563"
|
|
1693
|
+
};
|
|
1694
|
+
return {
|
|
1695
|
+
appName,
|
|
1696
|
+
assets,
|
|
1697
|
+
colors,
|
|
1698
|
+
domain
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
function resolveTranslation(catalogPointer, locales, overrides) {
|
|
1702
|
+
const defaultLocale = locales?.defaultLocale ?? "en";
|
|
1703
|
+
const enabled = locales?.enabledLocales ?? [];
|
|
1704
|
+
const supportedLocales = dedupeStrings([defaultLocale, ...enabled]);
|
|
1705
|
+
const entries = overrides?.entries ?? [];
|
|
1706
|
+
return {
|
|
1707
|
+
defaultLocale,
|
|
1708
|
+
supportedLocales,
|
|
1709
|
+
blueprintCatalog: catalogPointer,
|
|
1710
|
+
tenantOverrides: entries
|
|
1711
|
+
};
|
|
1712
|
+
}
|
|
1713
|
+
function mergeFeatureFlags(blueprint, overrides) {
|
|
1714
|
+
const merged = new Map;
|
|
1715
|
+
for (const flag of blueprint) {
|
|
1716
|
+
merged.set(flag.key, { ...flag });
|
|
1717
|
+
}
|
|
1718
|
+
for (const override of overrides) {
|
|
1719
|
+
merged.set(override.key, { ...override });
|
|
1720
|
+
}
|
|
1721
|
+
return [...merged.values()];
|
|
1722
|
+
}
|
|
1723
|
+
function mergeRoutes(blueprint, overrides) {
|
|
1724
|
+
const routes = new Map;
|
|
1725
|
+
for (const route of blueprint) {
|
|
1726
|
+
routes.set(route.path, { ...route });
|
|
1727
|
+
}
|
|
1728
|
+
for (const override of overrides) {
|
|
1729
|
+
const existing = routes.get(override.path) ?? { path: override.path };
|
|
1730
|
+
if (override.label !== undefined) {
|
|
1731
|
+
if (override.label === null)
|
|
1732
|
+
delete existing.label;
|
|
1733
|
+
else
|
|
1734
|
+
existing.label = override.label;
|
|
1735
|
+
}
|
|
1736
|
+
if (override.dataView !== undefined) {
|
|
1737
|
+
if (override.dataView === null)
|
|
1738
|
+
delete existing.dataView;
|
|
1739
|
+
else
|
|
1740
|
+
existing.dataView = override.dataView;
|
|
1741
|
+
}
|
|
1742
|
+
if (override.workflow !== undefined) {
|
|
1743
|
+
if (override.workflow === null)
|
|
1744
|
+
delete existing.workflow;
|
|
1745
|
+
else
|
|
1746
|
+
existing.workflow = override.workflow;
|
|
1747
|
+
}
|
|
1748
|
+
if (override.guard !== undefined) {
|
|
1749
|
+
if (override.guard === null)
|
|
1750
|
+
delete existing.guard;
|
|
1751
|
+
else
|
|
1752
|
+
existing.guard = override.guard;
|
|
1753
|
+
}
|
|
1754
|
+
if (override.featureFlag !== undefined) {
|
|
1755
|
+
if (override.featureFlag === null)
|
|
1756
|
+
delete existing.featureFlag;
|
|
1757
|
+
else
|
|
1758
|
+
existing.featureFlag = override.featureFlag;
|
|
1759
|
+
}
|
|
1760
|
+
if (override.experiment !== undefined) {
|
|
1761
|
+
if (override.experiment === null)
|
|
1762
|
+
delete existing.experiment;
|
|
1763
|
+
else
|
|
1764
|
+
existing.experiment = override.experiment;
|
|
1765
|
+
}
|
|
1766
|
+
routes.set(existing.path, existing);
|
|
1767
|
+
}
|
|
1768
|
+
return [...routes.values()];
|
|
1769
|
+
}
|
|
1770
|
+
function evaluateIntegrationSlots(slots, bindings, connections, specs) {
|
|
1771
|
+
const resolved = [];
|
|
1772
|
+
const missing = [];
|
|
1773
|
+
const missingKeys = new Set;
|
|
1774
|
+
const recordMissing = (entry) => {
|
|
1775
|
+
const key = `${entry.type}:${entry.identifier}`;
|
|
1776
|
+
if (missingKeys.has(key))
|
|
1777
|
+
return;
|
|
1778
|
+
missingKeys.add(key);
|
|
1779
|
+
missing.push(entry);
|
|
1780
|
+
};
|
|
1781
|
+
const slotList = slots ?? [];
|
|
1782
|
+
const slotById = new Map;
|
|
1783
|
+
for (const slot of slotList) {
|
|
1784
|
+
slotById.set(slot.slotId, slot);
|
|
1785
|
+
}
|
|
1786
|
+
const bindingsBySlot = new Map;
|
|
1787
|
+
for (const binding of bindings ?? []) {
|
|
1788
|
+
const slot = slotById.get(binding.slotId);
|
|
1789
|
+
if (!slot) {
|
|
1790
|
+
recordMissing({
|
|
1791
|
+
type: "integrationSlot",
|
|
1792
|
+
identifier: `slot:${binding.slotId}`
|
|
1793
|
+
});
|
|
1794
|
+
continue;
|
|
1795
|
+
}
|
|
1796
|
+
const entries = bindingsBySlot.get(binding.slotId);
|
|
1797
|
+
if (entries)
|
|
1798
|
+
entries.push(binding);
|
|
1799
|
+
else
|
|
1800
|
+
bindingsBySlot.set(binding.slotId, [binding]);
|
|
1801
|
+
}
|
|
1802
|
+
for (const slot of slotList) {
|
|
1803
|
+
const slotBindings = bindingsBySlot.get(slot.slotId) ?? [];
|
|
1804
|
+
if (slot.required && slotBindings.length === 0) {
|
|
1805
|
+
recordMissing({
|
|
1806
|
+
type: "integrationSlot",
|
|
1807
|
+
identifier: `slot:${slot.slotId}`
|
|
1808
|
+
});
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
if (!connections || !specs) {
|
|
1812
|
+
return { resolved, missing };
|
|
1813
|
+
}
|
|
1814
|
+
const connectionById = new Map;
|
|
1815
|
+
for (const connection of connections) {
|
|
1816
|
+
connectionById.set(connection.meta.id, connection);
|
|
1817
|
+
}
|
|
1818
|
+
for (const slot of slotList) {
|
|
1819
|
+
const slotBindings = bindingsBySlot.get(slot.slotId) ?? [];
|
|
1820
|
+
if (slotBindings.length === 0)
|
|
1821
|
+
continue;
|
|
1822
|
+
const orderedBindings = [...slotBindings].sort((a, b) => {
|
|
1823
|
+
const aPriority = a.priority ?? Number.MAX_SAFE_INTEGER;
|
|
1824
|
+
const bPriority = b.priority ?? Number.MAX_SAFE_INTEGER;
|
|
1825
|
+
if (aPriority === bPriority)
|
|
1826
|
+
return 0;
|
|
1827
|
+
return aPriority < bPriority ? -1 : 1;
|
|
1828
|
+
});
|
|
1829
|
+
let slotResolved = false;
|
|
1830
|
+
for (const binding of orderedBindings) {
|
|
1831
|
+
const connection = connectionById.get(binding.connectionId);
|
|
1832
|
+
if (!connection) {
|
|
1833
|
+
recordMissing({
|
|
1834
|
+
type: "integrationConnection",
|
|
1835
|
+
identifier: `connection:${binding.connectionId}`
|
|
1836
|
+
});
|
|
1837
|
+
continue;
|
|
1838
|
+
}
|
|
1839
|
+
const spec = specs.get(connection.meta.integrationKey, connection.meta.integrationVersion);
|
|
1840
|
+
if (!spec) {
|
|
1841
|
+
recordMissing({
|
|
1842
|
+
type: "integrationSpec",
|
|
1843
|
+
identifier: `spec:${connection.meta.integrationKey}.v${connection.meta.integrationVersion}`
|
|
1844
|
+
});
|
|
1845
|
+
continue;
|
|
1846
|
+
}
|
|
1847
|
+
if (spec.meta.category !== slot.requiredCategory) {
|
|
1848
|
+
recordMissing({
|
|
1849
|
+
type: "integrationSpec",
|
|
1850
|
+
identifier: `spec:${spec.meta.key}.category`
|
|
1851
|
+
});
|
|
1852
|
+
continue;
|
|
1853
|
+
}
|
|
1854
|
+
if (!spec.supportedModes.includes(connection.ownershipMode)) {
|
|
1855
|
+
recordMissing({
|
|
1856
|
+
type: "integrationSpec",
|
|
1857
|
+
identifier: `spec:${spec.meta.key}.mode:${connection.ownershipMode}`
|
|
1858
|
+
});
|
|
1859
|
+
continue;
|
|
1860
|
+
}
|
|
1861
|
+
if (slot.allowedModes && slot.allowedModes.length > 0 && !slot.allowedModes.includes(connection.ownershipMode)) {
|
|
1862
|
+
recordMissing({
|
|
1863
|
+
type: "integrationConnection",
|
|
1864
|
+
identifier: `connection:${connection.meta.id}:mode`
|
|
1865
|
+
});
|
|
1866
|
+
continue;
|
|
1867
|
+
}
|
|
1868
|
+
if (slot.requiredCapabilities && !slot.requiredCapabilities.every((requirement) => integrationProvidesCapability(spec, requirement))) {
|
|
1869
|
+
recordMissing({
|
|
1870
|
+
type: "integrationSpec",
|
|
1871
|
+
identifier: `spec:${spec.meta.key}.capabilities`
|
|
1872
|
+
});
|
|
1873
|
+
continue;
|
|
1874
|
+
}
|
|
1875
|
+
resolved.push({
|
|
1876
|
+
slot,
|
|
1877
|
+
binding,
|
|
1878
|
+
connection,
|
|
1879
|
+
spec
|
|
1880
|
+
});
|
|
1881
|
+
slotResolved = true;
|
|
1882
|
+
break;
|
|
1883
|
+
}
|
|
1884
|
+
if (!slotResolved && slot.required) {
|
|
1885
|
+
recordMissing({
|
|
1886
|
+
type: "integrationSlot",
|
|
1887
|
+
identifier: `slot:${slot.slotId}`
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
return { resolved, missing };
|
|
1892
|
+
}
|
|
1893
|
+
function integrationProvidesCapability(spec, required) {
|
|
1894
|
+
return spec.capabilities.provides.some((capability) => {
|
|
1895
|
+
if (capability.key !== required.key)
|
|
1896
|
+
return false;
|
|
1897
|
+
if (required.version == null)
|
|
1898
|
+
return true;
|
|
1899
|
+
return capability.version === required.version;
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
function resolveKnowledgeBindings(bindings, spaces, sources) {
|
|
1903
|
+
if (!bindings?.length || !spaces)
|
|
1904
|
+
return [];
|
|
1905
|
+
const sourceList = sources ?? [];
|
|
1906
|
+
return bindings.map((binding) => {
|
|
1907
|
+
const space = spaces.get(binding.spaceKey, binding.spaceVersion);
|
|
1908
|
+
if (!space)
|
|
1909
|
+
return null;
|
|
1910
|
+
const relevantSources = sourceList.filter((source) => {
|
|
1911
|
+
if (source.meta.spaceKey !== binding.spaceKey)
|
|
1912
|
+
return false;
|
|
1913
|
+
if (binding.spaceVersion != null) {
|
|
1914
|
+
return source.meta.spaceVersion === binding.spaceVersion;
|
|
1915
|
+
}
|
|
1916
|
+
return true;
|
|
1917
|
+
});
|
|
1918
|
+
return {
|
|
1919
|
+
binding,
|
|
1920
|
+
space,
|
|
1921
|
+
sources: relevantSources
|
|
1922
|
+
};
|
|
1923
|
+
}).filter((entry) => entry !== null);
|
|
1924
|
+
}
|
|
1925
|
+
function collectMissingKnowledge(bindings, spaces, sources) {
|
|
1926
|
+
if (!bindings.length || !spaces)
|
|
1927
|
+
return [];
|
|
1928
|
+
const missing = [];
|
|
1929
|
+
const sourceList = sources ?? [];
|
|
1930
|
+
for (const binding of bindings) {
|
|
1931
|
+
const space = spaces.get(binding.spaceKey, binding.spaceVersion);
|
|
1932
|
+
if (!space) {
|
|
1933
|
+
missing.push({
|
|
1934
|
+
type: "knowledgeSpace",
|
|
1935
|
+
identifier: binding.spaceVersion ? `${binding.spaceKey}@${binding.spaceVersion}` : binding.spaceKey
|
|
1936
|
+
});
|
|
1937
|
+
continue;
|
|
1938
|
+
}
|
|
1939
|
+
if (sources) {
|
|
1940
|
+
const relevantSources = sourceList.filter((source) => {
|
|
1941
|
+
if (source.meta.spaceKey !== binding.spaceKey)
|
|
1942
|
+
return false;
|
|
1943
|
+
if (binding.spaceVersion != null) {
|
|
1944
|
+
return source.meta.spaceVersion === binding.spaceVersion;
|
|
1945
|
+
}
|
|
1946
|
+
return true;
|
|
1947
|
+
});
|
|
1948
|
+
if (relevantSources.length === 0) {
|
|
1949
|
+
missing.push({
|
|
1950
|
+
type: "knowledgeSource",
|
|
1951
|
+
identifier: binding.spaceVersion ? `${binding.spaceKey}@${binding.spaceVersion}` : binding.spaceKey
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
return missing;
|
|
1957
|
+
}
|
|
1958
|
+
function resolveCapabilityRefs(refs, registry2, missing) {
|
|
1959
|
+
if (!registry2) {
|
|
1960
|
+
if (refs.length > 0) {
|
|
1961
|
+
for (const ref of refs) {
|
|
1962
|
+
missing.push({
|
|
1963
|
+
type: "capability",
|
|
1964
|
+
identifier: capabilityKey2(ref)
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
return [];
|
|
1969
|
+
}
|
|
1970
|
+
const resolved = [];
|
|
1971
|
+
for (const ref of refs) {
|
|
1972
|
+
const spec = registry2.get(ref.key, ref.version);
|
|
1973
|
+
if (!spec) {
|
|
1974
|
+
missing.push({
|
|
1975
|
+
type: "capability",
|
|
1976
|
+
identifier: capabilityKey2(ref)
|
|
1977
|
+
});
|
|
1978
|
+
continue;
|
|
1979
|
+
}
|
|
1980
|
+
resolved.push(spec);
|
|
1981
|
+
}
|
|
1982
|
+
return resolved;
|
|
1983
|
+
}
|
|
1984
|
+
function resolveFeatureRefs(refs, registry2, missing) {
|
|
1985
|
+
if (!registry2) {
|
|
1986
|
+
if (refs.length > 0) {
|
|
1987
|
+
for (const ref of refs) {
|
|
1988
|
+
missing.push({ type: "feature", identifier: ref.key });
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
return [];
|
|
1992
|
+
}
|
|
1993
|
+
const resolved = [];
|
|
1994
|
+
for (const ref of refs) {
|
|
1995
|
+
const spec = registry2.get(ref.key);
|
|
1996
|
+
if (!spec) {
|
|
1997
|
+
missing.push({ type: "feature", identifier: ref.key });
|
|
1998
|
+
continue;
|
|
1999
|
+
}
|
|
2000
|
+
resolved.push(spec);
|
|
2001
|
+
}
|
|
2002
|
+
return resolved;
|
|
2003
|
+
}
|
|
2004
|
+
function resolvePointerRecord(record, registry2, type, missing) {
|
|
2005
|
+
if (!registry2) {
|
|
2006
|
+
if (Object.keys(record).length > 0) {
|
|
2007
|
+
for (const [slot, pointer] of Object.entries(record)) {
|
|
2008
|
+
missing.push({
|
|
2009
|
+
type,
|
|
2010
|
+
identifier: `${slot} -> ${specPointerKey(pointer)}`
|
|
2011
|
+
});
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
return {};
|
|
2015
|
+
}
|
|
2016
|
+
const resolved = {};
|
|
2017
|
+
for (const [slot, pointer] of Object.entries(record)) {
|
|
2018
|
+
const spec = registry2.get(pointer.key, pointer.version);
|
|
2019
|
+
if (!spec) {
|
|
2020
|
+
missing.push({
|
|
2021
|
+
type,
|
|
2022
|
+
identifier: `${slot} -> ${specPointerKey(pointer)}`
|
|
2023
|
+
});
|
|
2024
|
+
continue;
|
|
2025
|
+
}
|
|
2026
|
+
resolved[slot] = spec;
|
|
2027
|
+
}
|
|
2028
|
+
return resolved;
|
|
2029
|
+
}
|
|
2030
|
+
function resolvePolicies(policies, registry2, missing) {
|
|
2031
|
+
if (!registry2) {
|
|
2032
|
+
if (policies.length > 0) {
|
|
2033
|
+
for (const policy of policies) {
|
|
2034
|
+
missing.push({
|
|
2035
|
+
type: "policy",
|
|
2036
|
+
identifier: policyKey(policy)
|
|
2037
|
+
});
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
return [];
|
|
2041
|
+
}
|
|
2042
|
+
const resolved = [];
|
|
2043
|
+
for (const policy of policies) {
|
|
2044
|
+
const spec = registry2.get(policy.key, policy.version);
|
|
2045
|
+
if (!spec) {
|
|
2046
|
+
missing.push({
|
|
2047
|
+
type: "policy",
|
|
2048
|
+
identifier: policyKey(policy)
|
|
2049
|
+
});
|
|
2050
|
+
continue;
|
|
2051
|
+
}
|
|
2052
|
+
resolved.push(spec);
|
|
2053
|
+
}
|
|
2054
|
+
return resolved;
|
|
2055
|
+
}
|
|
2056
|
+
function resolveThemeBinding(binding, registry2) {
|
|
2057
|
+
const themeMissing = [];
|
|
2058
|
+
if (!binding) {
|
|
2059
|
+
return { theme: undefined, fallbacks: [], themeMissing };
|
|
2060
|
+
}
|
|
2061
|
+
if (!registry2) {
|
|
2062
|
+
themeMissing.push({
|
|
2063
|
+
type: "theme",
|
|
2064
|
+
identifier: `${binding.primary.key}.v${binding.primary.version}`
|
|
2065
|
+
});
|
|
2066
|
+
for (const fallback of binding.fallbacks ?? []) {
|
|
2067
|
+
themeMissing.push({
|
|
2068
|
+
type: "theme",
|
|
2069
|
+
identifier: `${fallback.key}.v${fallback.version}`
|
|
2070
|
+
});
|
|
2071
|
+
}
|
|
2072
|
+
return { theme: undefined, fallbacks: [], themeMissing };
|
|
2073
|
+
}
|
|
2074
|
+
const theme = registry2.get(binding.primary.key, binding.primary.version);
|
|
2075
|
+
if (!theme) {
|
|
2076
|
+
themeMissing.push({
|
|
2077
|
+
type: "theme",
|
|
2078
|
+
identifier: `${binding.primary.key}.v${binding.primary.version}`
|
|
2079
|
+
});
|
|
2080
|
+
}
|
|
2081
|
+
const fallbacks = [];
|
|
2082
|
+
for (const fallback of binding.fallbacks ?? []) {
|
|
2083
|
+
const spec = registry2.get(fallback.key, fallback.version);
|
|
2084
|
+
if (!spec) {
|
|
2085
|
+
themeMissing.push({
|
|
2086
|
+
type: "theme",
|
|
2087
|
+
identifier: `${fallback.key}.v${fallback.version}`
|
|
2088
|
+
});
|
|
2089
|
+
continue;
|
|
2090
|
+
}
|
|
2091
|
+
fallbacks.push(spec);
|
|
2092
|
+
}
|
|
2093
|
+
return { theme: theme ?? undefined, fallbacks, themeMissing };
|
|
2094
|
+
}
|
|
2095
|
+
function resolveTelemetryBinding(binding, registry2) {
|
|
2096
|
+
const telemetryMissing = [];
|
|
2097
|
+
if (!binding?.spec) {
|
|
2098
|
+
return { telemetry: undefined, telemetryMissing };
|
|
2099
|
+
}
|
|
2100
|
+
if (!registry2) {
|
|
2101
|
+
telemetryMissing.push({
|
|
2102
|
+
type: "telemetry",
|
|
2103
|
+
identifier: specPointerKey(binding.spec)
|
|
2104
|
+
});
|
|
2105
|
+
return { telemetry: undefined, telemetryMissing };
|
|
2106
|
+
}
|
|
2107
|
+
const telemetry = registry2.get(binding.spec.key, binding.spec.version);
|
|
2108
|
+
if (!telemetry) {
|
|
2109
|
+
telemetryMissing.push({
|
|
2110
|
+
type: "telemetry",
|
|
2111
|
+
identifier: specPointerKey(binding.spec)
|
|
2112
|
+
});
|
|
2113
|
+
}
|
|
2114
|
+
return { telemetry: telemetry ?? undefined, telemetryMissing };
|
|
2115
|
+
}
|
|
2116
|
+
function resolveExperimentsSpecs(experiments, registry2, missing) {
|
|
2117
|
+
const resolveList = (refs) => {
|
|
2118
|
+
if (refs.length === 0)
|
|
2119
|
+
return [];
|
|
2120
|
+
if (!registry2) {
|
|
2121
|
+
for (const ref of refs) {
|
|
2122
|
+
missing.push({
|
|
2123
|
+
type: "experiment",
|
|
2124
|
+
identifier: experimentKey(ref)
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
return [];
|
|
2128
|
+
}
|
|
2129
|
+
const resolved = [];
|
|
2130
|
+
for (const ref of refs) {
|
|
2131
|
+
const spec = registry2.get(ref.key, ref.version);
|
|
2132
|
+
if (!spec) {
|
|
2133
|
+
missing.push({
|
|
2134
|
+
type: "experiment",
|
|
2135
|
+
identifier: experimentKey(ref)
|
|
2136
|
+
});
|
|
2137
|
+
continue;
|
|
2138
|
+
}
|
|
2139
|
+
resolved.push(spec);
|
|
2140
|
+
}
|
|
2141
|
+
return resolved;
|
|
2142
|
+
};
|
|
2143
|
+
return {
|
|
2144
|
+
active: resolveList(experiments.active),
|
|
2145
|
+
paused: resolveList(experiments.paused)
|
|
2146
|
+
};
|
|
2147
|
+
}
|
|
2148
|
+
function capabilityKey2(ref) {
|
|
2149
|
+
return `${ref.key}${ref.version ? `.v${ref.version}` : ""}`;
|
|
2150
|
+
}
|
|
2151
|
+
function featureKey(ref) {
|
|
2152
|
+
return ref.key;
|
|
2153
|
+
}
|
|
2154
|
+
function specPointerKey(pointer) {
|
|
2155
|
+
return `${pointer.key}${pointer.version ? `.v${pointer.version}` : ""}`;
|
|
2156
|
+
}
|
|
2157
|
+
function policyKey(ref) {
|
|
2158
|
+
return `${ref.key}${ref.version ? `.v${ref.version}` : ""}`;
|
|
2159
|
+
}
|
|
2160
|
+
function experimentKey(ref) {
|
|
2161
|
+
return `${ref.key}${ref.version ? `.v${ref.version}` : ""}`;
|
|
2162
|
+
}
|
|
2163
|
+
function dedupeRefs(refs, keyFn) {
|
|
2164
|
+
const map = new Map;
|
|
2165
|
+
for (const ref of refs) {
|
|
2166
|
+
map.set(keyFn(ref), ref);
|
|
2167
|
+
}
|
|
2168
|
+
return [...map.values()];
|
|
2169
|
+
}
|
|
2170
|
+
function dedupeStrings(values) {
|
|
2171
|
+
return [...new Set(values)];
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
// src/app-config/validation.ts
|
|
2175
|
+
class ValidationRuleRegistry {
|
|
2176
|
+
blueprintRules = [];
|
|
2177
|
+
tenantRules = [];
|
|
2178
|
+
resolvedRules = [];
|
|
2179
|
+
register(rule) {
|
|
2180
|
+
if (rule.scope === "blueprint") {
|
|
2181
|
+
this.blueprintRules.push(rule);
|
|
2182
|
+
} else if (rule.scope === "tenant") {
|
|
2183
|
+
this.tenantRules.push(rule);
|
|
2184
|
+
} else {
|
|
2185
|
+
this.resolvedRules.push(rule);
|
|
2186
|
+
}
|
|
2187
|
+
return this;
|
|
2188
|
+
}
|
|
2189
|
+
validateBlueprint(blueprint, context2) {
|
|
2190
|
+
return dedupeIssues(this.blueprintRules.flatMap((rule) => rule.validate(blueprint, context2)));
|
|
2191
|
+
}
|
|
2192
|
+
validateTenant(blueprint, tenant, context2) {
|
|
2193
|
+
return dedupeIssues(this.tenantRules.flatMap((rule) => rule.validate(blueprint, tenant, context2)));
|
|
2194
|
+
}
|
|
2195
|
+
validateResolved(blueprint, resolved, context2) {
|
|
2196
|
+
return dedupeIssues(this.resolvedRules.flatMap((rule) => rule.validate(blueprint, resolved, context2)));
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
var DOMAIN_REGEX = /^(?!:\/\/)([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.[A-Za-z]{2,}$/;
|
|
2200
|
+
var HTTPS_URL_REGEX = /^https:\/\//i;
|
|
2201
|
+
var ALLOWED_ASSET_EXTENSIONS = {
|
|
2202
|
+
logo: ["png", "svg", "webp"],
|
|
2203
|
+
"logo-dark": ["png", "svg", "webp"],
|
|
2204
|
+
favicon: ["ico", "png", "svg"],
|
|
2205
|
+
"og-image": ["png", "jpg", "jpeg", "webp"]
|
|
2206
|
+
};
|
|
2207
|
+
var EMPTY_CONTEXT = {};
|
|
2208
|
+
var registryInstance;
|
|
2209
|
+
function getRegistry() {
|
|
2210
|
+
if (!registryInstance) {
|
|
2211
|
+
registryInstance = createDefaultRegistry();
|
|
2212
|
+
}
|
|
2213
|
+
return registryInstance;
|
|
2214
|
+
}
|
|
2215
|
+
function validateConfig(blueprint, tenant, context2 = EMPTY_CONTEXT) {
|
|
2216
|
+
const registry2 = getRegistry();
|
|
2217
|
+
const blueprintResult = buildResult(registry2.validateBlueprint(blueprint, context2));
|
|
2218
|
+
const tenantResult = buildResult(registry2.validateTenant(blueprint, tenant, context2));
|
|
2219
|
+
return mergeResults(blueprintResult, tenantResult);
|
|
2220
|
+
}
|
|
2221
|
+
function validateBlueprint(blueprint, context2 = EMPTY_CONTEXT) {
|
|
2222
|
+
const issues = getRegistry().validateBlueprint(blueprint, context2);
|
|
2223
|
+
return buildResult(issues);
|
|
2224
|
+
}
|
|
2225
|
+
function validateTenantConfig(blueprint, tenant, context2 = EMPTY_CONTEXT) {
|
|
2226
|
+
const issues = getRegistry().validateTenant(blueprint, tenant, context2);
|
|
2227
|
+
return buildResult(issues);
|
|
2228
|
+
}
|
|
2229
|
+
function validateResolvedConfig(blueprint, resolved, context2 = EMPTY_CONTEXT) {
|
|
2230
|
+
const issues = getRegistry().validateResolved(blueprint, resolved, context2);
|
|
2231
|
+
return buildResult(issues);
|
|
2232
|
+
}
|
|
2233
|
+
function buildResult(issues) {
|
|
2234
|
+
const errors = issues.filter((issue) => issue.severity === "error");
|
|
2235
|
+
const warnings = issues.filter((issue) => issue.severity === "warning");
|
|
2236
|
+
const info = issues.filter((issue) => issue.severity === "info");
|
|
2237
|
+
return {
|
|
2238
|
+
valid: errors.length === 0,
|
|
2239
|
+
errors,
|
|
2240
|
+
warnings,
|
|
2241
|
+
info
|
|
2242
|
+
};
|
|
2243
|
+
}
|
|
2244
|
+
function mergeResults(...results) {
|
|
2245
|
+
const errors = results.flatMap((result) => result.errors);
|
|
2246
|
+
const warnings = results.flatMap((result) => result.warnings);
|
|
2247
|
+
const info = results.flatMap((result) => result.info);
|
|
2248
|
+
return {
|
|
2249
|
+
valid: errors.length === 0,
|
|
2250
|
+
errors,
|
|
2251
|
+
warnings,
|
|
2252
|
+
info
|
|
2253
|
+
};
|
|
2254
|
+
}
|
|
2255
|
+
function createDefaultRegistry() {
|
|
2256
|
+
return new ValidationRuleRegistry().register(blueprintIntegrationSlotRule).register(blueprintCapabilityRegistryRule).register(tenantCapabilityRule).register(tenantIntegrationBindingRule).register(tenantKnowledgeRule).register(tenantBrandingRule).register(tenantTranslationRule).register(resolvedIntegrationRule).register(resolvedTranslationRule);
|
|
2257
|
+
}
|
|
2258
|
+
var blueprintIntegrationSlotRule = {
|
|
2259
|
+
scope: "blueprint",
|
|
2260
|
+
name: "integration.duplicate-slots",
|
|
2261
|
+
category: "integration",
|
|
2262
|
+
validate(blueprint) {
|
|
2263
|
+
const issues = [];
|
|
2264
|
+
const seen = new Set;
|
|
2265
|
+
for (const slot of blueprint.integrationSlots ?? []) {
|
|
2266
|
+
if (seen.has(slot.slotId)) {
|
|
2267
|
+
issues.push(issue({
|
|
2268
|
+
code: "DUPLICATE_SLOT",
|
|
2269
|
+
severity: "error",
|
|
2270
|
+
path: `integrationSlots.${slot.slotId}`,
|
|
2271
|
+
message: `Duplicate integration slot id "${slot.slotId}".`
|
|
2272
|
+
}));
|
|
2273
|
+
} else {
|
|
2274
|
+
seen.add(slot.slotId);
|
|
2275
|
+
}
|
|
2276
|
+
if (slot.allowedModes && slot.allowedModes.length === 0) {
|
|
2277
|
+
issues.push(issue({
|
|
2278
|
+
code: "EMPTY_ALLOWED_MODES",
|
|
2279
|
+
severity: "warning",
|
|
2280
|
+
path: `integrationSlots.${slot.slotId}.allowedModes`,
|
|
2281
|
+
message: "allowedModes is empty; the slot will accept any supported mode."
|
|
2282
|
+
}));
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
if (blueprint.branding && !blueprint.branding.appNameKey.trim()) {
|
|
2286
|
+
issues.push(issue({
|
|
2287
|
+
code: "MISSING_APP_NAME_KEY",
|
|
2288
|
+
severity: "warning",
|
|
2289
|
+
path: "branding.appNameKey",
|
|
2290
|
+
message: "branding.appNameKey should reference a translation catalog key."
|
|
2291
|
+
}));
|
|
2292
|
+
}
|
|
2293
|
+
return issues;
|
|
2294
|
+
}
|
|
2295
|
+
};
|
|
2296
|
+
var blueprintCapabilityRegistryRule = {
|
|
2297
|
+
scope: "blueprint",
|
|
2298
|
+
name: "capability.registry-check",
|
|
2299
|
+
category: "capability",
|
|
2300
|
+
validate(blueprint, context2) {
|
|
2301
|
+
const issues = [];
|
|
2302
|
+
const registry2 = context2.capabilities;
|
|
2303
|
+
if (!registry2)
|
|
2304
|
+
return issues;
|
|
2305
|
+
const required = blueprint.capabilities?.enabled ?? [];
|
|
2306
|
+
required.forEach((ref, index) => {
|
|
2307
|
+
if (!registry2.get(ref.key, ref.version)) {
|
|
2308
|
+
issues.push(issue({
|
|
2309
|
+
code: "MISSING_CAPABILITY",
|
|
2310
|
+
severity: "error",
|
|
2311
|
+
path: `capabilities.enabled[${index}]`,
|
|
2312
|
+
message: `Capability "${ref.key}@${ref.version}" is not registered.`
|
|
2313
|
+
}));
|
|
2314
|
+
}
|
|
2315
|
+
});
|
|
2316
|
+
return issues;
|
|
2317
|
+
}
|
|
2318
|
+
};
|
|
2319
|
+
var tenantCapabilityRule = {
|
|
2320
|
+
scope: "tenant",
|
|
2321
|
+
name: "capability.required-enabled",
|
|
2322
|
+
category: "capability",
|
|
2323
|
+
validate(blueprint, tenant, context2) {
|
|
2324
|
+
const issues = [];
|
|
2325
|
+
const registry2 = context2.capabilities;
|
|
2326
|
+
const requiredKeys = new Set((blueprint.capabilities?.enabled ?? []).map(capabilityRefKey));
|
|
2327
|
+
const disabled = tenant.capabilities?.disable ?? [];
|
|
2328
|
+
disabled.forEach((ref, index) => {
|
|
2329
|
+
if (requiredKeys.has(capabilityRefKey(ref))) {
|
|
2330
|
+
issues.push(issue({
|
|
2331
|
+
code: "DISABLED_REQUIRED_CAPABILITY",
|
|
2332
|
+
severity: "error",
|
|
2333
|
+
path: `capabilities.disable[${index}]`,
|
|
2334
|
+
message: `Capability "${ref.key}@${ref.version}" is required by the blueprint and cannot be disabled.`
|
|
2335
|
+
}));
|
|
2336
|
+
}
|
|
2337
|
+
});
|
|
2338
|
+
if (registry2) {
|
|
2339
|
+
(tenant.capabilities?.enable ?? []).forEach((ref, index) => {
|
|
2340
|
+
if (!registry2.get(ref.key, ref.version)) {
|
|
2341
|
+
issues.push(issue({
|
|
2342
|
+
code: "UNKNOWN_CAPABILITY_ENABLE",
|
|
2343
|
+
severity: "error",
|
|
2344
|
+
path: `capabilities.enable[${index}]`,
|
|
2345
|
+
message: `Capability "${ref.key}@${ref.version}" is not registered.`
|
|
2346
|
+
}));
|
|
2347
|
+
}
|
|
2348
|
+
});
|
|
2349
|
+
disabled.forEach((ref, index) => {
|
|
2350
|
+
if (!registry2.get(ref.key, ref.version)) {
|
|
2351
|
+
issues.push(issue({
|
|
2352
|
+
code: "UNKNOWN_CAPABILITY_DISABLE",
|
|
2353
|
+
severity: "warning",
|
|
2354
|
+
path: `capabilities.disable[${index}]`,
|
|
2355
|
+
message: `Capability "${ref.key}@${ref.version}" is not registered.`
|
|
2356
|
+
}));
|
|
2357
|
+
}
|
|
2358
|
+
});
|
|
2359
|
+
}
|
|
2360
|
+
return issues;
|
|
2361
|
+
}
|
|
2362
|
+
};
|
|
2363
|
+
var tenantIntegrationBindingRule = {
|
|
2364
|
+
scope: "tenant",
|
|
2365
|
+
name: "integration.slot-binding",
|
|
2366
|
+
category: "integration",
|
|
2367
|
+
validate(blueprint, tenant, context2) {
|
|
2368
|
+
const issues = [];
|
|
2369
|
+
const slots = new Map((blueprint.integrationSlots ?? []).map((slot) => [slot.slotId, slot]));
|
|
2370
|
+
const bindings = tenant.integrations ?? [];
|
|
2371
|
+
const connections = context2.tenantConnections?.reduce((map, connection) => map.set(connection.meta.id, connection), new Map) ?? new Map;
|
|
2372
|
+
const satisfiedSlots = new Set;
|
|
2373
|
+
bindings.forEach((binding) => {
|
|
2374
|
+
const path = `integrations.${binding.slotId}`;
|
|
2375
|
+
const slot = slots.get(binding.slotId);
|
|
2376
|
+
if (!slot) {
|
|
2377
|
+
issues.push(issue({
|
|
2378
|
+
code: "UNKNOWN_SLOT_BINDING",
|
|
2379
|
+
severity: "error",
|
|
2380
|
+
path,
|
|
2381
|
+
message: `Integration slot "${binding.slotId}" is not defined in the blueprint.`
|
|
2382
|
+
}));
|
|
2383
|
+
return;
|
|
2384
|
+
}
|
|
2385
|
+
let slotValid = true;
|
|
2386
|
+
const connection = connections.get(binding.connectionId);
|
|
2387
|
+
if (!connection) {
|
|
2388
|
+
issues.push(issue({
|
|
2389
|
+
code: "MISSING_INTEGRATION_CONNECTION",
|
|
2390
|
+
severity: "error",
|
|
2391
|
+
path,
|
|
2392
|
+
message: `Integration connection "${binding.connectionId}" was not found for tenant "${tenant.meta.tenantId}".`
|
|
2393
|
+
}));
|
|
2394
|
+
slotValid = false;
|
|
2395
|
+
return;
|
|
2396
|
+
}
|
|
2397
|
+
if (connection.meta.tenantId !== tenant.meta.tenantId) {
|
|
2398
|
+
issues.push(issue({
|
|
2399
|
+
code: "FOREIGN_CONNECTION",
|
|
2400
|
+
severity: "error",
|
|
2401
|
+
path,
|
|
2402
|
+
message: `Connection "${binding.connectionId}" belongs to tenant "${connection.meta.tenantId}", not "${tenant.meta.tenantId}".`
|
|
2403
|
+
}));
|
|
2404
|
+
slotValid = false;
|
|
2405
|
+
}
|
|
2406
|
+
if (slot.allowedModes && slot.allowedModes.length > 0) {
|
|
2407
|
+
if (!slot.allowedModes.includes(connection.ownershipMode)) {
|
|
2408
|
+
issues.push(issue({
|
|
2409
|
+
code: "MODE_MISMATCH",
|
|
2410
|
+
severity: "error",
|
|
2411
|
+
path,
|
|
2412
|
+
message: `Slot "${slot.slotId}" only allows modes [${slot.allowedModes.join(", ")}] but connection is "${connection.ownershipMode}".`
|
|
2413
|
+
}));
|
|
2414
|
+
slotValid = false;
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
if (connection.status === "disconnected" || connection.status === "error") {
|
|
2418
|
+
issues.push(issue({
|
|
2419
|
+
code: "CONNECTION_NOT_READY",
|
|
2420
|
+
severity: "error",
|
|
2421
|
+
path,
|
|
2422
|
+
message: `Connection "${connection.meta.label}" is in status "${connection.status}".`
|
|
2423
|
+
}));
|
|
2424
|
+
slotValid = false;
|
|
2425
|
+
} else if (connection.status === "unknown") {
|
|
2426
|
+
issues.push(issue({
|
|
2427
|
+
code: "CONNECTION_STATUS_UNKNOWN",
|
|
2428
|
+
severity: "warning",
|
|
2429
|
+
path,
|
|
2430
|
+
message: `Connection "${connection.meta.label}" has unknown health status.`
|
|
2431
|
+
}));
|
|
2432
|
+
}
|
|
2433
|
+
const spec = lookupIntegrationSpec(context2.integrationSpecs, connection);
|
|
2434
|
+
if (!spec) {
|
|
2435
|
+
issues.push(issue({
|
|
2436
|
+
code: "INTEGRATION_SPEC_NOT_FOUND",
|
|
2437
|
+
severity: "warning",
|
|
2438
|
+
path,
|
|
2439
|
+
message: `Integration spec "${connection.meta.integrationKey}@${connection.meta.integrationVersion}" is not registered.`
|
|
2440
|
+
}));
|
|
2441
|
+
slotValid = false;
|
|
2442
|
+
return;
|
|
2443
|
+
}
|
|
2444
|
+
if (spec.meta.category !== slot.requiredCategory) {
|
|
2445
|
+
issues.push(issue({
|
|
2446
|
+
code: "CATEGORY_MISMATCH",
|
|
2447
|
+
severity: "error",
|
|
2448
|
+
path,
|
|
2449
|
+
message: `Slot "${slot.slotId}" requires category "${slot.requiredCategory}" but connection provides "${spec.meta.category}".`
|
|
2450
|
+
}));
|
|
2451
|
+
slotValid = false;
|
|
2452
|
+
}
|
|
2453
|
+
if (!spec.supportedModes.includes(connection.ownershipMode)) {
|
|
2454
|
+
issues.push(issue({
|
|
2455
|
+
code: "UNSUPPORTED_OWNERSHIP_MODE",
|
|
2456
|
+
severity: "error",
|
|
2457
|
+
path,
|
|
2458
|
+
message: `Integration spec "${spec.meta.key}" does not support ownership mode "${connection.ownershipMode}".`
|
|
2459
|
+
}));
|
|
2460
|
+
slotValid = false;
|
|
2461
|
+
}
|
|
2462
|
+
for (const required of slot.requiredCapabilities ?? []) {
|
|
2463
|
+
if (!integrationProvidesCapability2(spec, required)) {
|
|
2464
|
+
issues.push(issue({
|
|
2465
|
+
code: "CAPABILITY_NOT_PROVIDED",
|
|
2466
|
+
severity: "error",
|
|
2467
|
+
path,
|
|
2468
|
+
message: `Integration "${spec.meta.key}" does not provide required capability "${required.key}@${required.version}".`
|
|
2469
|
+
}));
|
|
2470
|
+
slotValid = false;
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
if (slotValid) {
|
|
2474
|
+
satisfiedSlots.add(slot.slotId);
|
|
2475
|
+
}
|
|
2476
|
+
});
|
|
2477
|
+
for (const slot of slots.values()) {
|
|
2478
|
+
if (slot.required && !satisfiedSlots.has(slot.slotId)) {
|
|
2479
|
+
issues.push(issue({
|
|
2480
|
+
code: "MISSING_REQUIRED_SLOT",
|
|
2481
|
+
severity: "error",
|
|
2482
|
+
path: `integrations.${slot.slotId}`,
|
|
2483
|
+
message: `Required integration slot "${slot.slotId}" is not bound.`
|
|
2484
|
+
}));
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
return issues;
|
|
2488
|
+
}
|
|
2489
|
+
};
|
|
2490
|
+
var tenantKnowledgeRule = {
|
|
2491
|
+
scope: "tenant",
|
|
2492
|
+
name: "knowledge.bindings",
|
|
2493
|
+
category: "knowledge",
|
|
2494
|
+
validate(_blueprint, tenant, context2) {
|
|
2495
|
+
const issues = [];
|
|
2496
|
+
const registry2 = context2.knowledgeSpaces;
|
|
2497
|
+
if (!registry2)
|
|
2498
|
+
return issues;
|
|
2499
|
+
const sources = context2.knowledgeSources ?? [];
|
|
2500
|
+
(tenant.knowledge ?? []).forEach((binding, index) => {
|
|
2501
|
+
const path = `knowledge[${index}]`;
|
|
2502
|
+
const space = registry2.get(binding.spaceKey, binding.spaceVersion);
|
|
2503
|
+
if (!space) {
|
|
2504
|
+
issues.push(issue({
|
|
2505
|
+
code: "UNKNOWN_KNOWLEDGE_SPACE",
|
|
2506
|
+
severity: "error",
|
|
2507
|
+
path: `${path}.spaceKey`,
|
|
2508
|
+
message: `Knowledge space "${binding.spaceKey}" is not registered.`
|
|
2509
|
+
}));
|
|
2510
|
+
return;
|
|
2511
|
+
}
|
|
2512
|
+
const hasSources = sources.some((source) => {
|
|
2513
|
+
if (source.meta.spaceKey !== binding.spaceKey)
|
|
2514
|
+
return false;
|
|
2515
|
+
if (binding.spaceVersion != null) {
|
|
2516
|
+
return source.meta.spaceVersion === binding.spaceVersion;
|
|
2517
|
+
}
|
|
2518
|
+
return true;
|
|
2519
|
+
});
|
|
2520
|
+
if (!hasSources) {
|
|
2521
|
+
issues.push(issue({
|
|
2522
|
+
code: "MISSING_KNOWLEDGE_SOURCES",
|
|
2523
|
+
severity: "error",
|
|
2524
|
+
path,
|
|
2525
|
+
message: `Knowledge space "${binding.spaceKey}" has no configured sources for tenant "${tenant.meta.tenantId}".`
|
|
2526
|
+
}));
|
|
2527
|
+
}
|
|
2528
|
+
if (space.meta.category === "external" || space.meta.category === "ephemeral") {
|
|
2529
|
+
issues.push(issue({
|
|
2530
|
+
code: "LOW_TRUST_KNOWLEDGE",
|
|
2531
|
+
severity: "warning",
|
|
2532
|
+
path,
|
|
2533
|
+
message: `Knowledge space "${binding.spaceKey}" has category "${space.meta.category}". Avoid using it for irreversible or policy decisions.`
|
|
2534
|
+
}));
|
|
2535
|
+
}
|
|
2536
|
+
});
|
|
2537
|
+
return issues;
|
|
2538
|
+
}
|
|
2539
|
+
};
|
|
2540
|
+
var tenantBrandingRule = {
|
|
2541
|
+
scope: "tenant",
|
|
2542
|
+
name: "branding.constraints",
|
|
2543
|
+
category: "branding",
|
|
2544
|
+
validate(_blueprint, tenant, context2) {
|
|
2545
|
+
const issues = [];
|
|
2546
|
+
const branding = tenant.branding;
|
|
2547
|
+
if (!branding)
|
|
2548
|
+
return issues;
|
|
2549
|
+
const domain = branding.customDomain?.trim();
|
|
2550
|
+
if (domain) {
|
|
2551
|
+
if (!DOMAIN_REGEX.test(domain)) {
|
|
2552
|
+
issues.push(issue({
|
|
2553
|
+
code: "INVALID_DOMAIN",
|
|
2554
|
+
severity: "error",
|
|
2555
|
+
path: "branding.customDomain",
|
|
2556
|
+
message: `Custom domain "${domain}" is not a valid hostname.`
|
|
2557
|
+
}));
|
|
2558
|
+
}
|
|
2559
|
+
const conflict = (context2.existingConfigs ?? []).find((config) => {
|
|
2560
|
+
if (config.meta.id === tenant.meta.id)
|
|
2561
|
+
return false;
|
|
2562
|
+
const otherDomain = config.branding?.customDomain?.trim();
|
|
2563
|
+
if (!otherDomain)
|
|
2564
|
+
return false;
|
|
2565
|
+
return otherDomain.toLowerCase() === domain.toLowerCase();
|
|
2566
|
+
});
|
|
2567
|
+
if (conflict) {
|
|
2568
|
+
issues.push(issue({
|
|
2569
|
+
code: "DUPLICATE_DOMAIN",
|
|
2570
|
+
severity: "error",
|
|
2571
|
+
path: "branding.customDomain",
|
|
2572
|
+
message: `Custom domain "${domain}" is already used by tenant "${conflict.meta.tenantId}".`
|
|
2573
|
+
}));
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
(branding.assets ?? []).forEach((asset, index) => {
|
|
2577
|
+
const assetPath = `branding.assets[${index}]`;
|
|
2578
|
+
if (!HTTPS_URL_REGEX.test(asset.url)) {
|
|
2579
|
+
issues.push(issue({
|
|
2580
|
+
code: "INSECURE_ASSET_URL",
|
|
2581
|
+
severity: "error",
|
|
2582
|
+
path: `${assetPath}.url`,
|
|
2583
|
+
message: `Branding asset "${asset.type}" must use an HTTPS URL.`
|
|
2584
|
+
}));
|
|
2585
|
+
}
|
|
2586
|
+
const allowed = ALLOWED_ASSET_EXTENSIONS[asset.type] ?? ALLOWED_ASSET_EXTENSIONS.logo;
|
|
2587
|
+
const extension = extractExtension(asset.url);
|
|
2588
|
+
if (extension && allowed && !allowed.includes(extension)) {
|
|
2589
|
+
issues.push(issue({
|
|
2590
|
+
code: "UNEXPECTED_ASSET_TYPE",
|
|
2591
|
+
severity: "warning",
|
|
2592
|
+
path: `${assetPath}.url`,
|
|
2593
|
+
message: `Asset "${asset.type}" should use one of: ${(allowed ?? []).join(", ")}. Detected "${extension}".`
|
|
2594
|
+
}));
|
|
2595
|
+
}
|
|
2596
|
+
});
|
|
2597
|
+
return issues;
|
|
2598
|
+
}
|
|
2599
|
+
};
|
|
2600
|
+
var tenantTranslationRule = {
|
|
2601
|
+
scope: "tenant",
|
|
2602
|
+
name: "translation.consistency",
|
|
2603
|
+
category: "translation",
|
|
2604
|
+
validate(blueprint, tenant, context2) {
|
|
2605
|
+
const issues = [];
|
|
2606
|
+
const pointer = blueprint.translationCatalog;
|
|
2607
|
+
const catalogs = normalizeCatalogs(context2.translationCatalogs);
|
|
2608
|
+
const blueprintCatalog = pointer ? catalogs.blueprint.find((catalog) => catalog.meta.key === pointer.key && catalog.meta.version === pointer.version) : undefined;
|
|
2609
|
+
if (pointer && !blueprintCatalog) {
|
|
2610
|
+
issues.push(issue({
|
|
2611
|
+
code: "MISSING_BLUEPRINT_CATALOG",
|
|
2612
|
+
severity: "error",
|
|
2613
|
+
path: "translationCatalog",
|
|
2614
|
+
message: `Blueprint translation catalog "${pointer.key}@${pointer.version}" is not loaded in context.`
|
|
2615
|
+
}));
|
|
2616
|
+
}
|
|
2617
|
+
const requiredKeys = new Set;
|
|
2618
|
+
if (blueprint.branding?.appNameKey) {
|
|
2619
|
+
requiredKeys.add(blueprint.branding.appNameKey);
|
|
2620
|
+
if (blueprintCatalog && !hasTranslationEntry(blueprintCatalog.entries, blueprint.branding.appNameKey, blueprintCatalog.defaultLocale)) {
|
|
2621
|
+
issues.push(issue({
|
|
2622
|
+
code: "MISSING_TRANSLATION_KEY",
|
|
2623
|
+
severity: "error",
|
|
2624
|
+
path: "branding.appNameKey",
|
|
2625
|
+
message: `Translation key "${blueprint.branding.appNameKey}" is missing for locale "${blueprintCatalog.defaultLocale}".`
|
|
2626
|
+
}));
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
const tenantLocales = tenant.locales;
|
|
2630
|
+
if (tenantLocales) {
|
|
2631
|
+
const { defaultLocale, enabledLocales } = tenantLocales;
|
|
2632
|
+
if (!enabledLocales.includes(defaultLocale)) {
|
|
2633
|
+
issues.push(issue({
|
|
2634
|
+
code: "LOCALE_NOT_ENABLED",
|
|
2635
|
+
severity: "warning",
|
|
2636
|
+
path: "locales.enabledLocales",
|
|
2637
|
+
message: `enabledLocales does not include defaultLocale "${defaultLocale}".`
|
|
2638
|
+
}));
|
|
2639
|
+
}
|
|
2640
|
+
if (blueprintCatalog) {
|
|
2641
|
+
const supported = new Set(blueprintCatalog.supportedLocales);
|
|
2642
|
+
for (const locale of [defaultLocale, ...enabledLocales]) {
|
|
2643
|
+
if (!supported.has(locale)) {
|
|
2644
|
+
issues.push(issue({
|
|
2645
|
+
code: "UNSUPPORTED_LOCALE",
|
|
2646
|
+
severity: "error",
|
|
2647
|
+
path: "locales.enabledLocales",
|
|
2648
|
+
message: `Locale "${locale}" is not supported by blueprint catalog "${blueprintCatalog.meta.key}".`
|
|
2649
|
+
}));
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
const allowedKeys = new Set;
|
|
2655
|
+
for (const catalog of catalogs.blueprint) {
|
|
2656
|
+
for (const entry of catalog.entries) {
|
|
2657
|
+
allowedKeys.add(entry.key);
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
for (const catalog of catalogs.platform) {
|
|
2661
|
+
for (const entry of catalog.entries) {
|
|
2662
|
+
allowedKeys.add(entry.key);
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
const overrides = tenant.translationOverrides?.entries ?? [];
|
|
2666
|
+
overrides.forEach((entry, index) => {
|
|
2667
|
+
const path = `translationOverrides.entries[${index}]`;
|
|
2668
|
+
if (!allowedKeys.has(entry.key)) {
|
|
2669
|
+
issues.push(issue({
|
|
2670
|
+
code: "UNKNOWN_TRANSLATION_KEY",
|
|
2671
|
+
severity: "error",
|
|
2672
|
+
path,
|
|
2673
|
+
message: `Override references unknown key "${entry.key}".`
|
|
2674
|
+
}));
|
|
2675
|
+
}
|
|
2676
|
+
if (blueprintCatalog) {
|
|
2677
|
+
const supportedLocales = new Set([
|
|
2678
|
+
...blueprintCatalog.supportedLocales,
|
|
2679
|
+
...tenant.locales?.enabledLocales ?? [],
|
|
2680
|
+
tenant.locales?.defaultLocale ?? blueprintCatalog.defaultLocale
|
|
2681
|
+
]);
|
|
2682
|
+
if (!supportedLocales.has(entry.locale)) {
|
|
2683
|
+
issues.push(issue({
|
|
2684
|
+
code: "UNSUPPORTED_LOCALE_OVERRIDE",
|
|
2685
|
+
severity: "error",
|
|
2686
|
+
path,
|
|
2687
|
+
message: `Locale "${entry.locale}" is not enabled for tenant overrides.`
|
|
2688
|
+
}));
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
});
|
|
2692
|
+
return issues;
|
|
2693
|
+
}
|
|
2694
|
+
};
|
|
2695
|
+
var resolvedIntegrationRule = {
|
|
2696
|
+
scope: "resolved",
|
|
2697
|
+
name: "integration.required-slots",
|
|
2698
|
+
category: "integration",
|
|
2699
|
+
validate(blueprint, resolved) {
|
|
2700
|
+
const issues = [];
|
|
2701
|
+
const requiredSlots = (blueprint.integrationSlots ?? []).filter((slot) => slot.required);
|
|
2702
|
+
for (const slot of requiredSlots) {
|
|
2703
|
+
const satisfied = resolved.integrations.some((integration) => integration.slot.slotId === slot.slotId);
|
|
2704
|
+
if (!satisfied) {
|
|
2705
|
+
issues.push(issue({
|
|
2706
|
+
code: "MISSING_REQUIRED_SLOT",
|
|
2707
|
+
severity: "error",
|
|
2708
|
+
path: `integrations.${slot.slotId}`,
|
|
2709
|
+
message: `Resolved config is missing integration slot "${slot.slotId}".`
|
|
2710
|
+
}));
|
|
2711
|
+
}
|
|
2712
|
+
}
|
|
2713
|
+
for (const integration of resolved.integrations) {
|
|
2714
|
+
if (integration.connection.status === "disconnected" || integration.connection.status === "error") {
|
|
2715
|
+
issues.push(issue({
|
|
2716
|
+
code: "CONNECTION_NOT_READY",
|
|
2717
|
+
severity: "error",
|
|
2718
|
+
path: `integrations.${integration.slot.slotId}`,
|
|
2719
|
+
message: `Resolved integration "${integration.slot.slotId}" uses a connection in status "${integration.connection.status}".`
|
|
2720
|
+
}));
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
return issues;
|
|
2724
|
+
}
|
|
2725
|
+
};
|
|
2726
|
+
var resolvedTranslationRule = {
|
|
2727
|
+
scope: "resolved",
|
|
2728
|
+
name: "translation.default-locale",
|
|
2729
|
+
category: "translation",
|
|
2730
|
+
validate(_blueprint, resolved) {
|
|
2731
|
+
const issues = [];
|
|
2732
|
+
const translation = resolved.translation;
|
|
2733
|
+
if (translation && !translation.supportedLocales.includes(translation.defaultLocale)) {
|
|
2734
|
+
issues.push(issue({
|
|
2735
|
+
code: "DEFAULT_LOCALE_NOT_SUPPORTED",
|
|
2736
|
+
severity: "warning",
|
|
2737
|
+
path: "translation.defaultLocale",
|
|
2738
|
+
message: "supportedLocales should include defaultLocale for consistent fallback behaviour."
|
|
2739
|
+
}));
|
|
2740
|
+
}
|
|
2741
|
+
return issues;
|
|
2742
|
+
}
|
|
2743
|
+
};
|
|
2744
|
+
function issue(input) {
|
|
2745
|
+
return input;
|
|
2746
|
+
}
|
|
2747
|
+
function dedupeIssues(issues) {
|
|
2748
|
+
const map = new Map;
|
|
2749
|
+
for (const current of issues) {
|
|
2750
|
+
const key = `${current.code}|${current.path}|${current.severity}`;
|
|
2751
|
+
if (!map.has(key)) {
|
|
2752
|
+
map.set(key, current);
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
return [...map.values()];
|
|
2756
|
+
}
|
|
2757
|
+
function capabilityRefKey(ref) {
|
|
2758
|
+
return `${ref.key}@${ref.version}`;
|
|
2759
|
+
}
|
|
2760
|
+
function integrationProvidesCapability2(spec, required) {
|
|
2761
|
+
return spec.capabilities.provides.some((provided) => provided.key === required.key && provided.version === required.version);
|
|
2762
|
+
}
|
|
2763
|
+
function lookupIntegrationSpec(registry2, connection) {
|
|
2764
|
+
if (!registry2)
|
|
2765
|
+
return;
|
|
2766
|
+
return registry2.get(connection.meta.integrationKey, connection.meta.integrationVersion);
|
|
2767
|
+
}
|
|
2768
|
+
function extractExtension(url) {
|
|
2769
|
+
const [raw] = url.split("?");
|
|
2770
|
+
if (!raw)
|
|
2771
|
+
return;
|
|
2772
|
+
const lastDot = raw.lastIndexOf(".");
|
|
2773
|
+
if (lastDot === -1)
|
|
2774
|
+
return;
|
|
2775
|
+
return raw.slice(lastDot + 1).toLowerCase();
|
|
2776
|
+
}
|
|
2777
|
+
function normalizeCatalogs(catalogs) {
|
|
2778
|
+
if (!catalogs)
|
|
2779
|
+
return { platform: [], blueprint: [] };
|
|
2780
|
+
const platform = catalogs.platform ? Array.isArray(catalogs.platform) ? catalogs.platform : [catalogs.platform] : [];
|
|
2781
|
+
const blueprint = catalogs.blueprint ? Array.isArray(catalogs.blueprint) ? catalogs.blueprint : [catalogs.blueprint] : [];
|
|
2782
|
+
return { platform, blueprint };
|
|
2783
|
+
}
|
|
2784
|
+
function hasTranslationEntry(entries, key, locale) {
|
|
2785
|
+
return entries.some((entry) => entry.key === key && entry.locale === locale);
|
|
2786
|
+
}
|
|
2787
|
+
// src/app-config/lifecycle-contracts.ts
|
|
2788
|
+
import { ScalarTypeEnum as ScalarTypeEnum3, SchemaModel as SchemaModel3 } from "@contractspec/lib.schema";
|
|
2789
|
+
var LifecyclePolicy = {
|
|
2790
|
+
auth: "admin",
|
|
2791
|
+
policies: [{ key: "platform.app-config.manage", version: "1.0.0" }]
|
|
2792
|
+
};
|
|
2793
|
+
var LifecycleReadPolicy = {
|
|
2794
|
+
auth: "admin",
|
|
2795
|
+
policies: [{ key: "platform.app-config.read", version: "1.0.0" }]
|
|
2796
|
+
};
|
|
2797
|
+
var ConfigVersionRecord = new SchemaModel3({
|
|
2798
|
+
name: "ConfigVersionRecord",
|
|
2799
|
+
fields: {
|
|
2800
|
+
meta: { type: ScalarTypeEnum3.JSONObject(), isOptional: false },
|
|
2801
|
+
config: { type: ScalarTypeEnum3.JSONObject(), isOptional: false }
|
|
2802
|
+
}
|
|
2803
|
+
});
|
|
2804
|
+
var ConfigTransitionRecord = new SchemaModel3({
|
|
2805
|
+
name: "ConfigTransitionRecord",
|
|
2806
|
+
fields: {
|
|
2807
|
+
tenantId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
2808
|
+
appId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
2809
|
+
fromStatus: {
|
|
2810
|
+
type: ScalarTypeEnum3.String_unsecure(),
|
|
2811
|
+
isOptional: false
|
|
2812
|
+
},
|
|
2813
|
+
toStatus: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2814
|
+
version: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2815
|
+
timestamp: { type: ScalarTypeEnum3.DateTime(), isOptional: false },
|
|
2816
|
+
actor: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2817
|
+
reason: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true }
|
|
2818
|
+
}
|
|
2819
|
+
});
|
|
2820
|
+
var CreateDraftInput = new SchemaModel3({
|
|
2821
|
+
name: "CreateTenantConfigDraftInput",
|
|
2822
|
+
fields: {
|
|
2823
|
+
tenantId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
2824
|
+
appId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
2825
|
+
blueprintName: {
|
|
2826
|
+
type: ScalarTypeEnum3.String_unsecure(),
|
|
2827
|
+
isOptional: false
|
|
2828
|
+
},
|
|
2829
|
+
blueprintVersion: {
|
|
2830
|
+
type: ScalarTypeEnum3.Int_unsecure(),
|
|
2831
|
+
isOptional: false
|
|
2832
|
+
},
|
|
2833
|
+
environment: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
|
|
2834
|
+
fromVersion: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
|
|
2835
|
+
createdBy: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
|
|
2836
|
+
}
|
|
2837
|
+
});
|
|
2838
|
+
var CreateDraftOutput = new SchemaModel3({
|
|
2839
|
+
name: "CreateTenantConfigDraftOutput",
|
|
2840
|
+
fields: {
|
|
2841
|
+
version: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2842
|
+
status: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2843
|
+
createdAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
|
|
2844
|
+
}
|
|
2845
|
+
});
|
|
2846
|
+
var CreateTenantConfigDraftCommand = defineCommand({
|
|
2847
|
+
meta: {
|
|
2848
|
+
key: "appConfig.lifecycle.createDraft",
|
|
2849
|
+
version: "1.0.0",
|
|
2850
|
+
description: "Creates a new draft tenant config version.",
|
|
2851
|
+
owners: [OwnersEnum.PlatformSigil],
|
|
2852
|
+
tags: [TagsEnum.Hygiene, "app-config"],
|
|
2853
|
+
stability: StabilityEnum.Experimental,
|
|
2854
|
+
goal: "Allow operators to start editing a new tenant config version.",
|
|
2855
|
+
context: "Invoked by the Studio or automation when starting a new configuration run."
|
|
2856
|
+
},
|
|
2857
|
+
io: {
|
|
2858
|
+
input: CreateDraftInput,
|
|
2859
|
+
output: CreateDraftOutput
|
|
2860
|
+
},
|
|
2861
|
+
policy: LifecyclePolicy,
|
|
2862
|
+
sideEffects: {
|
|
2863
|
+
emits: [
|
|
2864
|
+
{
|
|
2865
|
+
ref: ConfigDraftCreatedEvent.meta,
|
|
2866
|
+
when: "after successful draft creation"
|
|
2867
|
+
}
|
|
2868
|
+
]
|
|
2869
|
+
}
|
|
2870
|
+
});
|
|
2871
|
+
var PromotePreviewInput = new SchemaModel3({
|
|
2872
|
+
name: "PromoteTenantConfigPreviewInput",
|
|
2873
|
+
fields: {
|
|
2874
|
+
tenantId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
2875
|
+
appId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
2876
|
+
version: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2877
|
+
promotedBy: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
|
|
2878
|
+
}
|
|
2879
|
+
});
|
|
2880
|
+
var PromotePreviewOutput = new SchemaModel3({
|
|
2881
|
+
name: "PromoteTenantConfigPreviewOutput",
|
|
2882
|
+
fields: {
|
|
2883
|
+
version: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2884
|
+
status: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2885
|
+
warnings: {
|
|
2886
|
+
type: ScalarTypeEnum3.String_unsecure(),
|
|
2887
|
+
isOptional: true,
|
|
2888
|
+
isArray: true
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
});
|
|
2892
|
+
var PromoteTenantConfigToPreviewCommand = defineCommand({
|
|
2893
|
+
meta: {
|
|
2894
|
+
key: "appConfig.lifecycle.promoteToPreview",
|
|
2895
|
+
version: "1.0.0",
|
|
2896
|
+
description: "Promotes a draft tenant config to preview/testing state.",
|
|
2897
|
+
owners: [OwnersEnum.PlatformSigil],
|
|
2898
|
+
tags: [TagsEnum.Hygiene, "app-config"],
|
|
2899
|
+
stability: StabilityEnum.Experimental,
|
|
2900
|
+
goal: "Enable validation and testing of draft configurations.",
|
|
2901
|
+
context: "Called when a draft passes initial checks and should be exposed to preview environments."
|
|
2902
|
+
},
|
|
2903
|
+
io: {
|
|
2904
|
+
input: PromotePreviewInput,
|
|
2905
|
+
output: PromotePreviewOutput
|
|
2906
|
+
},
|
|
2907
|
+
policy: LifecyclePolicy,
|
|
2908
|
+
sideEffects: {
|
|
2909
|
+
emits: [
|
|
2910
|
+
{
|
|
2911
|
+
ref: ConfigPromotedToPreviewEvent.meta,
|
|
2912
|
+
when: "after promotion to preview"
|
|
2913
|
+
}
|
|
2914
|
+
]
|
|
2915
|
+
}
|
|
2916
|
+
});
|
|
2917
|
+
var PublishConfigInput = new SchemaModel3({
|
|
2918
|
+
name: "PublishTenantConfigInput",
|
|
2919
|
+
fields: {
|
|
2920
|
+
tenantId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
2921
|
+
appId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
2922
|
+
version: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2923
|
+
environment: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
|
|
2924
|
+
publishedBy: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2925
|
+
changeSummary: {
|
|
2926
|
+
type: ScalarTypeEnum3.String_unsecure(),
|
|
2927
|
+
isOptional: true
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
});
|
|
2931
|
+
var PublishConfigOutput = new SchemaModel3({
|
|
2932
|
+
name: "PublishTenantConfigOutput",
|
|
2933
|
+
fields: {
|
|
2934
|
+
version: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2935
|
+
status: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2936
|
+
previousVersion: {
|
|
2937
|
+
type: ScalarTypeEnum3.String_unsecure(),
|
|
2938
|
+
isOptional: true
|
|
2939
|
+
},
|
|
2940
|
+
publishedAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
|
|
2941
|
+
}
|
|
2942
|
+
});
|
|
2943
|
+
var PublishTenantConfigCommand = defineCommand({
|
|
2944
|
+
meta: {
|
|
2945
|
+
key: "appConfig.lifecycle.publish",
|
|
2946
|
+
version: "1.0.0",
|
|
2947
|
+
description: "Publishes a preview tenant config to production.",
|
|
2948
|
+
owners: [OwnersEnum.PlatformSigil],
|
|
2949
|
+
tags: [TagsEnum.Hygiene, "app-config"],
|
|
2950
|
+
stability: StabilityEnum.Experimental,
|
|
2951
|
+
goal: "Promote tested configurations to production safely.",
|
|
2952
|
+
context: "Triggered after validation passes and change management approvals are complete."
|
|
2953
|
+
},
|
|
2954
|
+
io: {
|
|
2955
|
+
input: PublishConfigInput,
|
|
2956
|
+
output: PublishConfigOutput
|
|
2957
|
+
},
|
|
2958
|
+
policy: LifecyclePolicy,
|
|
2959
|
+
sideEffects: {
|
|
2960
|
+
emits: [
|
|
2961
|
+
{
|
|
2962
|
+
ref: ConfigPublishedEvent.meta,
|
|
2963
|
+
when: "after publish succeeds"
|
|
2964
|
+
}
|
|
2965
|
+
]
|
|
2966
|
+
}
|
|
2967
|
+
});
|
|
2968
|
+
var RollbackConfigInput = new SchemaModel3({
|
|
2969
|
+
name: "RollbackTenantConfigInput",
|
|
2970
|
+
fields: {
|
|
2971
|
+
tenantId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
2972
|
+
appId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
2973
|
+
toVersion: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2974
|
+
environment: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
|
|
2975
|
+
rolledBackBy: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2976
|
+
reason: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
|
|
2977
|
+
}
|
|
2978
|
+
});
|
|
2979
|
+
var RollbackConfigOutput = new SchemaModel3({
|
|
2980
|
+
name: "RollbackTenantConfigOutput",
|
|
2981
|
+
fields: {
|
|
2982
|
+
newVersion: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2983
|
+
status: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
2984
|
+
rolledBackFrom: { type: ScalarTypeEnum3.Int_unsecure(), isOptional: false }
|
|
2985
|
+
}
|
|
2986
|
+
});
|
|
2987
|
+
var RollbackTenantConfigCommand = defineCommand({
|
|
2988
|
+
meta: {
|
|
2989
|
+
key: "appConfig.lifecycle.rollback",
|
|
2990
|
+
version: "1.0.0",
|
|
2991
|
+
description: "Rolls back to a previously published tenant config version.",
|
|
2992
|
+
owners: [OwnersEnum.PlatformSigil],
|
|
2993
|
+
tags: [TagsEnum.Hygiene, "app-config"],
|
|
2994
|
+
stability: StabilityEnum.Experimental,
|
|
2995
|
+
goal: "Provide rapid recovery when new configs regress production.",
|
|
2996
|
+
context: "Called manually or automatically when monitoring detects regression and a rollback is required."
|
|
2997
|
+
},
|
|
2998
|
+
io: {
|
|
2999
|
+
input: RollbackConfigInput,
|
|
3000
|
+
output: RollbackConfigOutput
|
|
3001
|
+
},
|
|
3002
|
+
policy: LifecyclePolicy,
|
|
3003
|
+
sideEffects: {
|
|
3004
|
+
emits: [
|
|
3005
|
+
{
|
|
3006
|
+
ref: ConfigRolledBackEvent.meta,
|
|
3007
|
+
when: "after rollback completes"
|
|
3008
|
+
}
|
|
3009
|
+
]
|
|
3010
|
+
}
|
|
3011
|
+
});
|
|
3012
|
+
var ListVersionsInput = new SchemaModel3({
|
|
3013
|
+
name: "ListTenantConfigVersionsInput",
|
|
3014
|
+
fields: {
|
|
3015
|
+
tenantId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
3016
|
+
appId: { type: ScalarTypeEnum3.ID(), isOptional: false }
|
|
3017
|
+
}
|
|
3018
|
+
});
|
|
3019
|
+
var ListVersionsOutput = new SchemaModel3({
|
|
3020
|
+
name: "ListTenantConfigVersionsOutput",
|
|
3021
|
+
fields: {
|
|
3022
|
+
versions: { type: ConfigVersionRecord, isOptional: false, isArray: true },
|
|
3023
|
+
transitions: {
|
|
3024
|
+
type: ConfigTransitionRecord,
|
|
3025
|
+
isOptional: true,
|
|
3026
|
+
isArray: true
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
});
|
|
3030
|
+
var ListTenantConfigVersionsQuery = defineQuery({
|
|
3031
|
+
meta: {
|
|
3032
|
+
key: "appConfig.lifecycle.listVersions",
|
|
3033
|
+
version: "1.0.0",
|
|
3034
|
+
description: "Lists all versions of a tenant configuration.",
|
|
3035
|
+
owners: [OwnersEnum.PlatformSigil],
|
|
3036
|
+
tags: ["app-config", TagsEnum.Hygiene],
|
|
3037
|
+
stability: StabilityEnum.Experimental,
|
|
3038
|
+
goal: "Support lifecycle views and change audit tooling.",
|
|
3039
|
+
context: "Used by the Studio to render history timelines and by automation for change tracking."
|
|
3040
|
+
},
|
|
3041
|
+
io: {
|
|
3042
|
+
input: ListVersionsInput,
|
|
3043
|
+
output: ListVersionsOutput
|
|
3044
|
+
},
|
|
3045
|
+
policy: LifecycleReadPolicy
|
|
3046
|
+
});
|
|
3047
|
+
var GetVersionInput = new SchemaModel3({
|
|
3048
|
+
name: "GetTenantConfigVersionInput",
|
|
3049
|
+
fields: {
|
|
3050
|
+
tenantId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
3051
|
+
appId: { type: ScalarTypeEnum3.ID(), isOptional: false },
|
|
3052
|
+
version: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
|
|
3053
|
+
}
|
|
3054
|
+
});
|
|
3055
|
+
var GetVersionOutput = new SchemaModel3({
|
|
3056
|
+
name: "GetTenantConfigVersionOutput",
|
|
3057
|
+
fields: {
|
|
3058
|
+
version: { type: ConfigVersionRecord, isOptional: false }
|
|
3059
|
+
}
|
|
3060
|
+
});
|
|
3061
|
+
var GetTenantConfigVersionQuery = defineQuery({
|
|
3062
|
+
meta: {
|
|
3063
|
+
key: "appConfig.lifecycle.getVersion",
|
|
3064
|
+
version: "1.0.0",
|
|
3065
|
+
description: "Fetches a single tenant config version by id.",
|
|
3066
|
+
owners: [OwnersEnum.PlatformSigil],
|
|
3067
|
+
tags: ["app-config", TagsEnum.Hygiene],
|
|
3068
|
+
stability: StabilityEnum.Experimental,
|
|
3069
|
+
goal: "Allow detail drill-down for lifecycle entries.",
|
|
3070
|
+
context: "Used by automation to fetch config payloads for comparison or export."
|
|
3071
|
+
},
|
|
3072
|
+
io: {
|
|
3073
|
+
input: GetVersionInput,
|
|
3074
|
+
output: GetVersionOutput
|
|
3075
|
+
},
|
|
3076
|
+
policy: LifecycleReadPolicy
|
|
3077
|
+
});
|
|
3078
|
+
var lifecycleContracts = {
|
|
3079
|
+
CreateTenantConfigDraftCommand,
|
|
3080
|
+
PromoteTenantConfigToPreviewCommand,
|
|
3081
|
+
PublishTenantConfigCommand,
|
|
3082
|
+
RollbackTenantConfigCommand,
|
|
3083
|
+
ListTenantConfigVersionsQuery,
|
|
3084
|
+
GetTenantConfigVersionQuery
|
|
3085
|
+
};
|
|
3086
|
+
function registerAppConfigLifecycleContracts(registry2) {
|
|
3087
|
+
return registry2.register(CreateTenantConfigDraftCommand).register(PromoteTenantConfigToPreviewCommand).register(PublishTenantConfigCommand).register(RollbackTenantConfigCommand).register(ListTenantConfigVersionsQuery).register(GetTenantConfigVersionQuery);
|
|
3088
|
+
}
|
|
3089
|
+
export {
|
|
3090
|
+
validateTenantConfig,
|
|
3091
|
+
validateResolvedConfig,
|
|
3092
|
+
validateConfig,
|
|
3093
|
+
validateBlueprint,
|
|
3094
|
+
resolveAppConfig,
|
|
3095
|
+
registerAppConfigLifecycleContracts,
|
|
3096
|
+
makeAppBlueprintKey,
|
|
3097
|
+
lifecycleContracts,
|
|
3098
|
+
defineAppConfig,
|
|
3099
|
+
composeAppConfig,
|
|
3100
|
+
RollbackTenantConfigCommand,
|
|
3101
|
+
PublishTenantConfigCommand,
|
|
3102
|
+
PromoteTenantConfigToPreviewCommand,
|
|
3103
|
+
ListTenantConfigVersionsQuery,
|
|
3104
|
+
GetTenantConfigVersionQuery,
|
|
3105
|
+
CreateTenantConfigDraftCommand,
|
|
3106
|
+
ConfigRolledBackEvent,
|
|
3107
|
+
ConfigPublishedEvent,
|
|
3108
|
+
ConfigPromotedToPreviewEvent,
|
|
3109
|
+
ConfigDraftCreatedEvent,
|
|
3110
|
+
AppConfigFeature,
|
|
3111
|
+
AppConfigCapability,
|
|
3112
|
+
AppBlueprintRegistry
|
|
3113
|
+
};
|