@contractspec/lib.contracts 1.44.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/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/_virtual/rolldown_runtime.js +37 -0
- package/dist/app-config/app-config.feature.d.ts +12 -0
- package/dist/app-config/app-config.feature.js +54 -0
- package/dist/app-config/branding.d.ts +55 -0
- package/dist/app-config/branding.js +0 -0
- package/dist/app-config/contracts.d.ts +245 -0
- package/dist/app-config/contracts.js +395 -0
- package/dist/app-config/docs/app-config.docblock.d.ts +6 -0
- package/dist/app-config/docs/app-config.docblock.js +21 -0
- package/dist/app-config/events.d.ts +122 -0
- package/dist/app-config/events.js +174 -0
- package/dist/app-config/index.d.ts +9 -0
- package/dist/app-config/index.js +8 -0
- package/dist/app-config/lifecycle-contracts.d.ts +273 -0
- package/dist/app-config/lifecycle-contracts.js +440 -0
- package/dist/app-config/lifecycle.d.ts +27 -0
- package/dist/app-config/lifecycle.js +0 -0
- package/dist/app-config/runtime.d.ts +120 -0
- package/dist/app-config/runtime.js +617 -0
- package/dist/app-config/spec.d.ts +173 -0
- package/dist/app-config/spec.js +36 -0
- package/dist/app-config/validation.d.ts +49 -0
- package/dist/app-config/validation.js +538 -0
- package/dist/capabilities/capabilities.d.ts +48 -0
- package/dist/capabilities/capabilities.js +50 -0
- package/dist/capabilities/docs/capabilities.docblock.d.ts +6 -0
- package/dist/capabilities/docs/capabilities.docblock.js +21 -0
- package/dist/capabilities/index.d.ts +3 -0
- package/dist/capabilities/index.js +4 -0
- package/dist/capabilities/openbanking.d.ts +10 -0
- package/dist/capabilities/openbanking.js +92 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +9 -0
- package/dist/client/react/drivers/rn-reusables.d.ts +22 -0
- package/dist/client/react/drivers/rn-reusables.js +21 -0
- package/dist/client/react/drivers/shadcn.d.ts +12 -0
- package/dist/client/react/drivers/shadcn.js +11 -0
- package/dist/client/react/feature-render.d.ts +23 -0
- package/dist/client/react/feature-render.js +44 -0
- package/dist/client/react/form-render.d.ts +92 -0
- package/dist/client/react/form-render.js +298 -0
- package/dist/client/react/index.d.ts +5 -0
- package/dist/client/react/index.js +8 -0
- package/dist/contract-registry/index.d.ts +3 -0
- package/dist/contract-registry/index.js +3 -0
- package/dist/contract-registry/schemas.d.ts +124 -0
- package/dist/contract-registry/schemas.js +61 -0
- package/dist/contract-registry/types.d.ts +46 -0
- package/dist/contract-registry/types.js +0 -0
- package/dist/data-views/data-views.d.ts +5 -0
- package/dist/data-views/data-views.js +4 -0
- package/dist/data-views/docs/data-views.docblock.d.ts +6 -0
- package/dist/data-views/docs/data-views.docblock.js +21 -0
- package/dist/data-views/index.d.ts +4 -0
- package/dist/data-views/index.js +4 -0
- package/dist/data-views/query-generator.d.ts +40 -0
- package/dist/data-views/query-generator.js +48 -0
- package/dist/data-views/registry.d.ts +51 -0
- package/dist/data-views/registry.js +82 -0
- package/dist/data-views/runtime.d.ts +28 -0
- package/dist/data-views/runtime.js +39 -0
- package/dist/data-views/spec.d.ts +32 -0
- package/dist/data-views/spec.js +10 -0
- package/dist/data-views/types.d.ts +157 -0
- package/dist/data-views/types.js +0 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.d.ts +6 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +17 -0
- package/dist/docs/index.d.ts +6 -0
- package/dist/docs/index.js +29 -0
- package/dist/docs/meta.docs.d.ts +6 -0
- package/dist/docs/meta.docs.js +29 -0
- package/dist/docs/presentations.d.ts +33 -0
- package/dist/docs/presentations.js +64 -0
- package/dist/docs/registry.d.ts +23 -0
- package/dist/docs/registry.js +51 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.d.ts +6 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.js +81 -0
- package/dist/docs/tech/contracts/README.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/README.docblock.js +21 -0
- package/dist/docs/tech/contracts/create-subscription.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/create-subscription.docblock.js +21 -0
- package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.js +21 -0
- package/dist/docs/tech/contracts/migrations.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/migrations.docblock.js +21 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.js +58 -0
- package/dist/docs/tech/contracts/openapi-import.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/openapi-import.docblock.js +65 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +21 -0
- package/dist/docs/tech/contracts/overlays.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/overlays.docblock.js +21 -0
- package/dist/docs/tech/contracts/tests.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/tests.docblock.js +21 -0
- package/dist/docs/tech/contracts/themes.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/themes.docblock.js +21 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +21 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.d.ts +6 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.js +17 -0
- package/dist/docs/tech/llm/llm-integration.docblock.d.ts +7 -0
- package/dist/docs/tech/llm/llm-integration.docblock.js +358 -0
- package/dist/docs/tech/mcp-endpoints.docblock.d.ts +6 -0
- package/dist/docs/tech/mcp-endpoints.docblock.js +38 -0
- package/dist/docs/tech/presentation-runtime.docblock.d.ts +6 -0
- package/dist/docs/tech/presentation-runtime.docblock.js +17 -0
- package/dist/docs/tech/schema/README.docblock.d.ts +6 -0
- package/dist/docs/tech/schema/README.docblock.js +21 -0
- package/dist/docs/tech/studio/learning-events.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/learning-events.docblock.js +49 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.js +80 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.js +85 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.js +46 -0
- package/dist/docs/tech/studio/project-routing.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/project-routing.docblock.js +68 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.js +41 -0
- package/dist/docs/tech/studio/team-invitations.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/team-invitations.docblock.js +70 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.js +48 -0
- package/dist/docs/tech/studio/workspaces.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/workspaces.docblock.js +63 -0
- package/dist/docs/tech/telemetry-ingest.docblock.d.ts +6 -0
- package/dist/docs/tech/telemetry-ingest.docblock.js +156 -0
- package/dist/docs/tech/templates/runtime.docblock.d.ts +6 -0
- package/dist/docs/tech/templates/runtime.docblock.js +21 -0
- package/dist/docs/tech/vscode-extension.docblock.d.ts +6 -0
- package/dist/docs/tech/vscode-extension.docblock.js +102 -0
- package/dist/docs/tech-contracts.docs.d.ts +6 -0
- package/dist/docs/tech-contracts.docs.js +96 -0
- package/dist/docs/types.d.ts +41 -0
- package/dist/docs/types.js +0 -0
- package/dist/events.d.ts +47 -0
- package/dist/events.js +19 -0
- package/dist/experiments/docs/experiments.docblock.d.ts +6 -0
- package/dist/experiments/docs/experiments.docblock.js +21 -0
- package/dist/experiments/evaluator.d.ts +37 -0
- package/dist/experiments/evaluator.js +101 -0
- package/dist/experiments/spec-resolver.d.ts +17 -0
- package/dist/experiments/spec-resolver.js +0 -0
- package/dist/experiments/spec.d.ts +82 -0
- package/dist/experiments/spec.js +33 -0
- package/dist/features/index.d.ts +5 -0
- package/dist/features/index.js +5 -0
- package/dist/features/install.d.ts +22 -0
- package/dist/features/install.js +36 -0
- package/dist/features/registry.d.ts +26 -0
- package/dist/features/registry.js +49 -0
- package/dist/features/types.d.ts +88 -0
- package/dist/features/types.js +0 -0
- package/dist/features/validation.d.ts +8 -0
- package/dist/features/validation.js +14 -0
- package/dist/forms/docs/forms.docblock.d.ts +6 -0
- package/dist/forms/docs/forms.docblock.js +21 -0
- package/dist/forms/forms.d.ts +266 -0
- package/dist/forms/forms.js +146 -0
- package/dist/forms/index.d.ts +2 -0
- package/dist/forms/index.js +3 -0
- package/dist/index.d.ts +147 -0
- package/dist/index.js +121 -0
- package/dist/install.d.ts +77 -0
- package/dist/install.js +40 -0
- package/dist/integrations/binding.d.ts +17 -0
- package/dist/integrations/binding.js +0 -0
- package/dist/integrations/connection.d.ts +51 -0
- package/dist/integrations/connection.js +0 -0
- package/dist/integrations/docs/integrations.docblock.d.ts +6 -0
- package/dist/integrations/docs/integrations.docblock.js +94 -0
- package/dist/integrations/health.d.ts +21 -0
- package/dist/integrations/health.js +69 -0
- package/dist/integrations/index.d.ts +34 -0
- package/dist/integrations/index.js +23 -0
- package/dist/integrations/integrations.feature.d.ts +12 -0
- package/dist/integrations/integrations.feature.js +60 -0
- package/dist/integrations/openbanking/contracts/accounts.d.ts +289 -0
- package/dist/integrations/openbanking/contracts/accounts.js +236 -0
- package/dist/integrations/openbanking/contracts/balances.d.ts +165 -0
- package/dist/integrations/openbanking/contracts/balances.js +166 -0
- package/dist/integrations/openbanking/contracts/index.d.ts +10 -0
- package/dist/integrations/openbanking/contracts/index.js +12 -0
- package/dist/integrations/openbanking/contracts/transactions.d.ts +213 -0
- package/dist/integrations/openbanking/contracts/transactions.js +217 -0
- package/dist/integrations/openbanking/guards.d.ts +12 -0
- package/dist/integrations/openbanking/guards.js +33 -0
- package/dist/integrations/openbanking/models.d.ts +228 -0
- package/dist/integrations/openbanking/models.js +240 -0
- package/dist/integrations/openbanking/openbanking.feature.d.ts +12 -0
- package/dist/integrations/openbanking/openbanking.feature.js +69 -0
- package/dist/integrations/openbanking/telemetry.d.ts +15 -0
- package/dist/integrations/openbanking/telemetry.js +39 -0
- package/dist/integrations/operations.d.ts +437 -0
- package/dist/integrations/operations.js +392 -0
- package/dist/integrations/providers/calendar.d.ts +78 -0
- package/dist/integrations/providers/calendar.js +0 -0
- package/dist/integrations/providers/elevenlabs.d.ts +7 -0
- package/dist/integrations/providers/elevenlabs.js +55 -0
- package/dist/integrations/providers/email.d.ts +86 -0
- package/dist/integrations/providers/email.js +0 -0
- package/dist/integrations/providers/embedding.d.ts +24 -0
- package/dist/integrations/providers/embedding.js +0 -0
- package/dist/integrations/providers/gcs-storage.d.ts +7 -0
- package/dist/integrations/providers/gcs-storage.js +78 -0
- package/dist/integrations/providers/gmail.d.ts +7 -0
- package/dist/integrations/providers/gmail.js +90 -0
- package/dist/integrations/providers/google-calendar.d.ts +7 -0
- package/dist/integrations/providers/google-calendar.js +69 -0
- package/dist/integrations/providers/impls/elevenlabs-voice.d.ts +20 -0
- package/dist/integrations/providers/impls/elevenlabs-voice.js +95 -0
- package/dist/integrations/providers/impls/gcs-storage.d.ts +24 -0
- package/dist/integrations/providers/impls/gcs-storage.js +88 -0
- package/dist/integrations/providers/impls/gmail-inbound.d.ts +26 -0
- package/dist/integrations/providers/impls/gmail-inbound.js +200 -0
- package/dist/integrations/providers/impls/gmail-outbound.d.ts +18 -0
- package/dist/integrations/providers/impls/gmail-outbound.js +105 -0
- package/dist/integrations/providers/impls/google-calendar.d.ts +23 -0
- package/dist/integrations/providers/impls/google-calendar.js +154 -0
- package/dist/integrations/providers/impls/index.d.ts +15 -0
- package/dist/integrations/providers/impls/index.js +16 -0
- package/dist/integrations/providers/impls/mistral-embedding.d.ts +23 -0
- package/dist/integrations/providers/impls/mistral-embedding.js +41 -0
- package/dist/integrations/providers/impls/mistral-llm.d.ts +31 -0
- package/dist/integrations/providers/impls/mistral-llm.js +247 -0
- package/dist/integrations/providers/impls/postmark-email.d.ts +19 -0
- package/dist/integrations/providers/impls/postmark-email.js +55 -0
- package/dist/integrations/providers/impls/powens-client.d.ts +124 -0
- package/dist/integrations/providers/impls/powens-client.js +171 -0
- package/dist/integrations/providers/impls/powens-openbanking.d.ts +27 -0
- package/dist/integrations/providers/impls/powens-openbanking.js +218 -0
- package/dist/integrations/providers/impls/provider-factory.d.ts +26 -0
- package/dist/integrations/providers/impls/provider-factory.js +145 -0
- package/dist/integrations/providers/impls/qdrant-vector.d.ts +24 -0
- package/dist/integrations/providers/impls/qdrant-vector.js +69 -0
- package/dist/integrations/providers/impls/stripe-payments.d.ts +28 -0
- package/dist/integrations/providers/impls/stripe-payments.js +202 -0
- package/dist/integrations/providers/impls/twilio-sms.d.ts +20 -0
- package/dist/integrations/providers/impls/twilio-sms.js +58 -0
- package/dist/integrations/providers/index.d.ts +22 -0
- package/dist/integrations/providers/index.js +13 -0
- package/dist/integrations/providers/llm.d.ts +82 -0
- package/dist/integrations/providers/llm.js +0 -0
- package/dist/integrations/providers/mistral.d.ts +7 -0
- package/dist/integrations/providers/mistral.js +71 -0
- package/dist/integrations/providers/openbanking.d.ts +128 -0
- package/dist/integrations/providers/openbanking.js +0 -0
- package/dist/integrations/providers/payments.d.ts +109 -0
- package/dist/integrations/providers/payments.js +0 -0
- package/dist/integrations/providers/postmark.d.ts +7 -0
- package/dist/integrations/providers/postmark.js +71 -0
- package/dist/integrations/providers/powens.d.ts +7 -0
- package/dist/integrations/providers/powens.js +119 -0
- package/dist/integrations/providers/qdrant.d.ts +7 -0
- package/dist/integrations/providers/qdrant.js +76 -0
- package/dist/integrations/providers/registry.d.ts +11 -0
- package/dist/integrations/providers/registry.js +34 -0
- package/dist/integrations/providers/sms.d.ts +34 -0
- package/dist/integrations/providers/sms.js +0 -0
- package/dist/integrations/providers/storage.d.ts +60 -0
- package/dist/integrations/providers/storage.js +0 -0
- package/dist/integrations/providers/stripe.d.ts +7 -0
- package/dist/integrations/providers/stripe.js +86 -0
- package/dist/integrations/providers/twilio-sms.d.ts +7 -0
- package/dist/integrations/providers/twilio-sms.js +64 -0
- package/dist/integrations/providers/vector-store.d.ts +43 -0
- package/dist/integrations/providers/vector-store.js +0 -0
- package/dist/integrations/providers/voice.d.ts +34 -0
- package/dist/integrations/providers/voice.js +0 -0
- package/dist/integrations/runtime.d.ts +99 -0
- package/dist/integrations/runtime.js +186 -0
- package/dist/integrations/secrets/aws-secret-manager.d.ts +31 -0
- package/dist/integrations/secrets/aws-secret-manager.js +231 -0
- package/dist/integrations/secrets/env-secret-provider.d.ts +31 -0
- package/dist/integrations/secrets/env-secret-provider.js +81 -0
- package/dist/integrations/secrets/gcp-secret-manager.d.ts +32 -0
- package/dist/integrations/secrets/gcp-secret-manager.js +229 -0
- package/dist/integrations/secrets/index.d.ts +7 -0
- package/dist/integrations/secrets/index.js +8 -0
- package/dist/integrations/secrets/manager.d.ts +47 -0
- package/dist/integrations/secrets/manager.js +103 -0
- package/dist/integrations/secrets/provider.d.ts +52 -0
- package/dist/integrations/secrets/provider.js +58 -0
- package/dist/integrations/secrets/scaleway-secret-manager.d.ts +38 -0
- package/dist/integrations/secrets/scaleway-secret-manager.js +247 -0
- package/dist/integrations/secrets-types.d.ts +17 -0
- package/dist/integrations/secrets-types.js +0 -0
- package/dist/integrations/spec.d.ts +75 -0
- package/dist/integrations/spec.js +39 -0
- package/dist/jobs/define-job.d.ts +18 -0
- package/dist/jobs/define-job.js +16 -0
- package/dist/jobs/gcp-cloud-tasks.d.ts +41 -0
- package/dist/jobs/gcp-cloud-tasks.js +53 -0
- package/dist/jobs/gcp-pubsub.d.ts +25 -0
- package/dist/jobs/gcp-pubsub.js +39 -0
- package/dist/jobs/handlers/gmail-sync-handler.d.ts +9 -0
- package/dist/jobs/handlers/gmail-sync-handler.js +9 -0
- package/dist/jobs/handlers/index.d.ts +9 -0
- package/dist/jobs/handlers/index.js +12 -0
- package/dist/jobs/handlers/ping-handler.d.ts +10 -0
- package/dist/jobs/handlers/ping-handler.js +15 -0
- package/dist/jobs/handlers/storage-document-handler.d.ts +12 -0
- package/dist/jobs/handlers/storage-document-handler.js +14 -0
- package/dist/jobs/index.d.ts +3 -0
- package/dist/jobs/index.js +4 -0
- package/dist/jobs/memory-queue.d.ts +18 -0
- package/dist/jobs/memory-queue.js +71 -0
- package/dist/jobs/queue.d.ts +131 -0
- package/dist/jobs/queue.js +33 -0
- package/dist/jobs/scaleway-sqs-queue.d.ts +30 -0
- package/dist/jobs/scaleway-sqs-queue.js +153 -0
- package/dist/jsonschema.d.ts +27 -0
- package/dist/jsonschema.js +32 -0
- package/dist/knowledge/binding.d.ts +25 -0
- package/dist/knowledge/binding.js +0 -0
- package/dist/knowledge/docs/knowledge.docblock.d.ts +6 -0
- package/dist/knowledge/docs/knowledge.docblock.js +21 -0
- package/dist/knowledge/index.d.ts +11 -0
- package/dist/knowledge/index.js +10 -0
- package/dist/knowledge/ingestion/document-processor.d.ts +24 -0
- package/dist/knowledge/ingestion/document-processor.js +54 -0
- package/dist/knowledge/ingestion/embedding-service.d.ts +12 -0
- package/dist/knowledge/ingestion/embedding-service.js +25 -0
- package/dist/knowledge/ingestion/gmail-adapter.d.ts +18 -0
- package/dist/knowledge/ingestion/gmail-adapter.js +51 -0
- package/dist/knowledge/ingestion/index.d.ts +6 -0
- package/dist/knowledge/ingestion/index.js +7 -0
- package/dist/knowledge/ingestion/storage-adapter.d.ts +15 -0
- package/dist/knowledge/ingestion/storage-adapter.js +26 -0
- package/dist/knowledge/ingestion/vector-indexer.d.ts +18 -0
- package/dist/knowledge/ingestion/vector-indexer.js +32 -0
- package/dist/knowledge/knowledge.feature.d.ts +12 -0
- package/dist/knowledge/knowledge.feature.js +61 -0
- package/dist/knowledge/operations.d.ts +318 -0
- package/dist/knowledge/operations.js +321 -0
- package/dist/knowledge/query/index.d.ts +2 -0
- package/dist/knowledge/query/index.js +3 -0
- package/dist/knowledge/query/service.d.ts +29 -0
- package/dist/knowledge/query/service.js +65 -0
- package/dist/knowledge/runtime.d.ts +32 -0
- package/dist/knowledge/runtime.js +49 -0
- package/dist/knowledge/source.d.ts +32 -0
- package/dist/knowledge/source.js +0 -0
- package/dist/knowledge/spaces/email-threads.d.ts +7 -0
- package/dist/knowledge/spaces/email-threads.js +37 -0
- package/dist/knowledge/spaces/financial-docs.d.ts +7 -0
- package/dist/knowledge/spaces/financial-docs.js +37 -0
- package/dist/knowledge/spaces/financial-overview.d.ts +7 -0
- package/dist/knowledge/spaces/financial-overview.js +41 -0
- package/dist/knowledge/spaces/index.d.ts +7 -0
- package/dist/knowledge/spaces/index.js +8 -0
- package/dist/knowledge/spaces/product-canon.d.ts +7 -0
- package/dist/knowledge/spaces/product-canon.js +37 -0
- package/dist/knowledge/spaces/support-faq.d.ts +7 -0
- package/dist/knowledge/spaces/support-faq.js +40 -0
- package/dist/knowledge/spaces/uploaded-docs.d.ts +7 -0
- package/dist/knowledge/spaces/uploaded-docs.js +37 -0
- package/dist/knowledge/spec.d.ts +48 -0
- package/dist/knowledge/spec.js +39 -0
- package/dist/llm/exporters.d.ts +70 -0
- package/dist/llm/exporters.js +542 -0
- package/dist/llm/index.d.ts +4 -0
- package/dist/llm/index.js +4 -0
- package/dist/llm/prompts.d.ts +52 -0
- package/dist/llm/prompts.js +410 -0
- package/dist/llm/types.d.ts +215 -0
- package/dist/llm/types.js +0 -0
- package/dist/markdown.d.ts +22 -0
- package/dist/markdown.js +119 -0
- package/dist/migrations.d.ts +52 -0
- package/dist/migrations.js +33 -0
- package/dist/model-registry.d.ts +13 -0
- package/dist/model-registry.js +33 -0
- package/dist/onboarding-base.d.ts +138 -0
- package/dist/onboarding-base.js +195 -0
- package/dist/openapi.d.ts +31 -0
- package/dist/openapi.js +75 -0
- package/dist/operations/index.d.ts +3 -0
- package/dist/operations/index.js +4 -0
- package/dist/operations/operation.d.ts +186 -0
- package/dist/operations/operation.js +35 -0
- package/dist/operations/registry.d.ts +103 -0
- package/dist/operations/registry.js +252 -0
- package/dist/ownership.d.ts +84 -0
- package/dist/ownership.js +38 -0
- package/dist/policy/docs/policy.docblock.d.ts +6 -0
- package/dist/policy/docs/policy.docblock.js +21 -0
- package/dist/policy/engine.d.ts +40 -0
- package/dist/policy/engine.js +223 -0
- package/dist/policy/index.d.ts +5 -0
- package/dist/policy/index.js +5 -0
- package/dist/policy/opa-adapter.d.ts +45 -0
- package/dist/policy/opa-adapter.js +71 -0
- package/dist/policy/registry.d.ts +9 -0
- package/dist/policy/registry.js +11 -0
- package/dist/policy/spec.d.ts +103 -0
- package/dist/policy/spec.js +0 -0
- package/dist/presentations/docs/presentations-conventions.docblock.d.ts +6 -0
- package/dist/presentations/docs/presentations-conventions.docblock.js +21 -0
- package/dist/presentations/index.d.ts +4 -0
- package/dist/presentations/index.js +5 -0
- package/dist/presentations/presentations.d.ts +50 -0
- package/dist/presentations/presentations.js +7 -0
- package/dist/presentations/registry.d.ts +10 -0
- package/dist/presentations/registry.js +12 -0
- package/dist/presentations/transform-engine.d.ts +66 -0
- package/dist/presentations/transform-engine.js +282 -0
- package/dist/prompt.d.ts +60 -0
- package/dist/prompt.js +10 -0
- package/dist/promptRegistry.d.ts +15 -0
- package/dist/promptRegistry.js +34 -0
- package/dist/regenerator/adapters.d.ts +19 -0
- package/dist/regenerator/adapters.js +0 -0
- package/dist/regenerator/docs/regenerator.docblock.d.ts +6 -0
- package/dist/regenerator/docs/regenerator.docblock.js +21 -0
- package/dist/regenerator/executor.d.ts +70 -0
- package/dist/regenerator/executor.js +86 -0
- package/dist/regenerator/index.d.ts +7 -0
- package/dist/regenerator/index.js +6 -0
- package/dist/regenerator/service.d.ts +33 -0
- package/dist/regenerator/service.js +93 -0
- package/dist/regenerator/sinks.d.ts +26 -0
- package/dist/regenerator/sinks.js +32 -0
- package/dist/regenerator/types.d.ts +107 -0
- package/dist/regenerator/types.js +0 -0
- package/dist/regenerator/utils.d.ts +9 -0
- package/dist/regenerator/utils.js +51 -0
- package/dist/registry-utils.d.ts +106 -0
- package/dist/registry-utils.js +122 -0
- package/dist/registry.d.ts +31 -0
- package/dist/registry.js +61 -0
- package/dist/resources.d.ts +64 -0
- package/dist/resources.js +50 -0
- package/dist/schema-to-markdown.d.ts +54 -0
- package/dist/schema-to-markdown.js +217 -0
- package/dist/server/contracts-adapter-hydration.d.ts +15 -0
- package/dist/server/contracts-adapter-hydration.js +41 -0
- package/dist/server/contracts-adapter-input.d.ts +9 -0
- package/dist/server/contracts-adapter-input.js +83 -0
- package/dist/server/graphql-pothos.d.ts +31 -0
- package/dist/server/graphql-pothos.js +134 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.js +10 -0
- package/dist/server/mcp/createMcpServer.d.ts +15 -0
- package/dist/server/mcp/createMcpServer.js +27 -0
- package/dist/server/mcp/mcpTypes.d.ts +27 -0
- package/dist/server/mcp/mcpTypes.js +0 -0
- package/dist/server/mcp/registerPresentations.d.ts +7 -0
- package/dist/server/mcp/registerPresentations.js +63 -0
- package/dist/server/mcp/registerPrompts.d.ts +8 -0
- package/dist/server/mcp/registerPrompts.js +37 -0
- package/dist/server/mcp/registerResources.d.ts +8 -0
- package/dist/server/mcp/registerResources.js +35 -0
- package/dist/server/mcp/registerTools.d.ts +8 -0
- package/dist/server/mcp/registerTools.js +22 -0
- package/dist/server/provider-mcp.d.ts +2 -0
- package/dist/server/provider-mcp.js +3 -0
- package/dist/server/rest-elysia.d.ts +40 -0
- package/dist/server/rest-elysia.js +20 -0
- package/dist/server/rest-express.d.ts +16 -0
- package/dist/server/rest-express.js +36 -0
- package/dist/server/rest-generic.d.ts +32 -0
- package/dist/server/rest-generic.js +124 -0
- package/dist/server/rest-next-app.d.ts +35 -0
- package/dist/server/rest-next-app.js +38 -0
- package/dist/server/rest-next-mcp.d.ts +11 -0
- package/dist/server/rest-next-mcp.js +45 -0
- package/dist/server/rest-next-pages.d.ts +9 -0
- package/dist/server/rest-next-pages.js +22 -0
- package/dist/telemetry/anomaly.d.ts +27 -0
- package/dist/telemetry/anomaly.js +48 -0
- package/dist/telemetry/docs/telemetry.docblock.d.ts +6 -0
- package/dist/telemetry/docs/telemetry.docblock.js +21 -0
- package/dist/telemetry/index.d.ts +4 -0
- package/dist/telemetry/index.js +5 -0
- package/dist/telemetry/spec.d.ts +91 -0
- package/dist/telemetry/spec.js +69 -0
- package/dist/telemetry/tracker.d.ts +51 -0
- package/dist/telemetry/tracker.js +76 -0
- package/dist/tests/index.d.ts +3 -0
- package/dist/tests/index.js +4 -0
- package/dist/tests/runner.d.ts +43 -0
- package/dist/tests/runner.js +150 -0
- package/dist/tests/spec.d.ts +81 -0
- package/dist/tests/spec.js +33 -0
- package/dist/themes.d.ts +53 -0
- package/dist/themes.js +39 -0
- package/dist/translations/catalog.d.ts +28 -0
- package/dist/translations/catalog.js +0 -0
- package/dist/translations/tenant.d.ts +15 -0
- package/dist/translations/tenant.js +0 -0
- package/dist/types.d.ts +92 -0
- package/dist/types.js +0 -0
- package/dist/workflow/adapters/db-adapter.d.ts +46 -0
- package/dist/workflow/adapters/db-adapter.js +83 -0
- package/dist/workflow/adapters/file-adapter.d.ts +14 -0
- package/dist/workflow/adapters/file-adapter.js +11 -0
- package/dist/workflow/adapters/index.d.ts +4 -0
- package/dist/workflow/adapters/index.js +5 -0
- package/dist/workflow/adapters/memory-store.d.ts +18 -0
- package/dist/workflow/adapters/memory-store.js +58 -0
- package/dist/workflow/expression.d.ts +9 -0
- package/dist/workflow/expression.js +99 -0
- package/dist/workflow/index.d.ts +10 -0
- package/dist/workflow/index.js +9 -0
- package/dist/workflow/overview.docblock.d.ts +6 -0
- package/dist/workflow/overview.docblock.js +21 -0
- package/dist/workflow/runner.d.ts +75 -0
- package/dist/workflow/runner.js +337 -0
- package/dist/workflow/sla-monitor.d.ts +20 -0
- package/dist/workflow/sla-monitor.js +47 -0
- package/dist/workflow/spec.d.ts +106 -0
- package/dist/workflow/spec.js +55 -0
- package/dist/workflow/state.d.ts +35 -0
- package/dist/workflow/state.js +0 -0
- package/dist/workflow/validation.d.ts +29 -0
- package/dist/workflow/validation.js +176 -0
- package/dist/workspace-config/contractsrc-schema.d.ts +862 -0
- package/dist/workspace-config/contractsrc-schema.js +281 -0
- package/dist/workspace-config/index.d.ts +2 -0
- package/dist/workspace-config/index.js +3 -0
- package/dist/workspace-config/workspace-config.docblock.d.ts +6 -0
- package/dist/workspace-config/workspace-config.docblock.js +45 -0
- package/package.json +598 -0
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
//#region src/app-config/runtime.ts
|
|
2
|
+
function resolveAppConfig(blueprint, tenant, deps = {}) {
|
|
3
|
+
const capabilities = mergeCapabilities(blueprint.capabilities, tenant.capabilities);
|
|
4
|
+
const features = mergeFeatures(blueprint.features, tenant.features);
|
|
5
|
+
const dataViews = mergeMappings(blueprint.dataViews ?? {}, tenant.dataViewOverrides);
|
|
6
|
+
const workflows = mergeMappings(blueprint.workflows ?? {}, tenant.workflowOverrides);
|
|
7
|
+
const policies = mergePolicies(blueprint.policies ?? [], tenant.additionalPolicies ?? []);
|
|
8
|
+
const theme = mergeTheme(blueprint.theme, tenant.themeOverride);
|
|
9
|
+
const telemetry = mergeTelemetry(blueprint.telemetry, tenant.telemetryOverride);
|
|
10
|
+
const experiments = mergeExperiments(blueprint.experiments, tenant.experiments);
|
|
11
|
+
const featureFlags = mergeFeatureFlags(blueprint.featureFlags ?? [], tenant.featureFlags ?? []);
|
|
12
|
+
const routes = mergeRoutes(blueprint.routes ?? [], tenant.routeOverrides ?? []);
|
|
13
|
+
const { resolved: integrations } = evaluateIntegrationSlots(blueprint.integrationSlots, tenant.integrations, deps.integrationConnections, deps.integrationSpecs);
|
|
14
|
+
const knowledge = resolveKnowledgeBindings(tenant.knowledge, deps.knowledgeSpaces, deps.knowledgeSources);
|
|
15
|
+
const branding = resolveBranding(blueprint.branding, tenant);
|
|
16
|
+
const translation = resolveTranslation(blueprint.translationCatalog, tenant.locales, tenant.translationOverrides);
|
|
17
|
+
return {
|
|
18
|
+
appId: blueprint.meta.appId,
|
|
19
|
+
tenantId: tenant.meta.tenantId,
|
|
20
|
+
environment: tenant.meta.environment,
|
|
21
|
+
blueprintName: blueprint.meta.key,
|
|
22
|
+
blueprintVersion: blueprint.meta.version,
|
|
23
|
+
configVersion: tenant.meta.version,
|
|
24
|
+
capabilities,
|
|
25
|
+
features,
|
|
26
|
+
dataViews,
|
|
27
|
+
workflows,
|
|
28
|
+
policies,
|
|
29
|
+
theme,
|
|
30
|
+
telemetry,
|
|
31
|
+
experiments,
|
|
32
|
+
featureFlags,
|
|
33
|
+
routes,
|
|
34
|
+
integrations,
|
|
35
|
+
knowledge,
|
|
36
|
+
translation,
|
|
37
|
+
branding,
|
|
38
|
+
notes: tenant.notes ?? blueprint.notes
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function composeAppConfig(blueprint, tenant, deps, options = {}) {
|
|
42
|
+
const resolved = resolveAppConfig(blueprint, tenant, deps);
|
|
43
|
+
const missing = [];
|
|
44
|
+
const integrationEvaluation = evaluateIntegrationSlots(blueprint.integrationSlots, tenant.integrations, deps.integrationConnections, deps.integrationSpecs);
|
|
45
|
+
resolved.integrations = integrationEvaluation.resolved;
|
|
46
|
+
missing.push(...integrationEvaluation.missing);
|
|
47
|
+
missing.push(...collectMissingKnowledge(tenant.knowledge ?? [], deps.knowledgeSpaces, deps.knowledgeSources));
|
|
48
|
+
const capabilities = resolveCapabilityRefs(resolved.capabilities.enabled, deps.capabilities, missing);
|
|
49
|
+
const features = resolveFeatureRefs(resolved.features.include, deps.features, missing);
|
|
50
|
+
const dataViews = resolvePointerRecord(resolved.dataViews, deps.dataViews, "dataView", missing);
|
|
51
|
+
const workflows = resolvePointerRecord(resolved.workflows, deps.workflows, "workflow", missing);
|
|
52
|
+
const policies = resolvePolicies(resolved.policies, deps.policies, missing);
|
|
53
|
+
const { theme, fallbacks, themeMissing } = resolveThemeBinding(resolved.theme, deps.themes);
|
|
54
|
+
missing.push(...themeMissing);
|
|
55
|
+
const { telemetry, telemetryMissing } = resolveTelemetryBinding(resolved.telemetry, deps.telemetry);
|
|
56
|
+
missing.push(...telemetryMissing);
|
|
57
|
+
const experiments = resolveExperimentsSpecs(resolved.experiments, deps.experiments, missing);
|
|
58
|
+
if (options.strict && missing.length > 0) {
|
|
59
|
+
const reasons = missing.map((item) => `${item.type}:${item.identifier}`).join(", ");
|
|
60
|
+
throw new Error(`composeAppConfig: missing references -> ${reasons}`);
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
resolved,
|
|
64
|
+
capabilities,
|
|
65
|
+
features,
|
|
66
|
+
dataViews,
|
|
67
|
+
workflows,
|
|
68
|
+
policies,
|
|
69
|
+
theme,
|
|
70
|
+
themeFallbacks: fallbacks,
|
|
71
|
+
telemetry,
|
|
72
|
+
experiments,
|
|
73
|
+
integrations: resolved.integrations,
|
|
74
|
+
knowledge: resolved.knowledge,
|
|
75
|
+
missing
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function mergeCapabilities(blueprint, tenant) {
|
|
79
|
+
const enabled = dedupeRefs([...blueprint?.enabled ?? [], ...tenant?.enable ?? []], capabilityKey);
|
|
80
|
+
const disabled = dedupeRefs([...blueprint?.disabled ?? [], ...tenant?.disable ?? []], capabilityKey);
|
|
81
|
+
const disabledKeys = new Set(disabled.map(capabilityKey));
|
|
82
|
+
return {
|
|
83
|
+
enabled: enabled.filter((ref) => !disabledKeys.has(capabilityKey(ref))),
|
|
84
|
+
disabled
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function mergeFeatures(blueprint, tenant) {
|
|
88
|
+
const include = dedupeRefs([...blueprint?.include ?? [], ...tenant?.include ?? []], featureKey);
|
|
89
|
+
const exclude = dedupeRefs([...blueprint?.exclude ?? [], ...tenant?.exclude ?? []], featureKey);
|
|
90
|
+
const excludeSet = new Set(exclude.map(featureKey));
|
|
91
|
+
return {
|
|
92
|
+
include: include.filter((ref) => !excludeSet.has(featureKey(ref))),
|
|
93
|
+
exclude
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function mergeMappings(blueprint, overrides) {
|
|
97
|
+
const merged = { ...blueprint };
|
|
98
|
+
if (!overrides) return merged;
|
|
99
|
+
for (const override of overrides) {
|
|
100
|
+
if (!override) continue;
|
|
101
|
+
if (!override.pointer) delete merged[override.slot];
|
|
102
|
+
else merged[override.slot] = override.pointer;
|
|
103
|
+
}
|
|
104
|
+
return merged;
|
|
105
|
+
}
|
|
106
|
+
function mergePolicies(blueprint, additional) {
|
|
107
|
+
return dedupeRefs([...blueprint, ...additional], policyKey);
|
|
108
|
+
}
|
|
109
|
+
function mergeTheme(blueprint, override) {
|
|
110
|
+
if (!blueprint && !override) return void 0;
|
|
111
|
+
const primary = override?.primary ?? blueprint?.primary;
|
|
112
|
+
if (!primary) return void 0;
|
|
113
|
+
return {
|
|
114
|
+
primary,
|
|
115
|
+
fallbacks: override?.fallbacks ?? blueprint?.fallbacks ?? []
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function mergeTelemetry(blueprint, override) {
|
|
119
|
+
if (!blueprint && !override) return void 0;
|
|
120
|
+
const binding = {
|
|
121
|
+
spec: blueprint?.spec,
|
|
122
|
+
disabledEvents: blueprint?.disabledEvents ? [...blueprint.disabledEvents] : void 0,
|
|
123
|
+
samplingOverrides: blueprint?.samplingOverrides ? { ...blueprint.samplingOverrides } : void 0
|
|
124
|
+
};
|
|
125
|
+
if (override?.spec !== void 0) binding.spec = override.spec ?? void 0;
|
|
126
|
+
if (override?.disabledEvents) binding.disabledEvents = dedupeStrings([...binding.disabledEvents ?? [], ...override.disabledEvents]);
|
|
127
|
+
if (override?.samplingOverrides) binding.samplingOverrides = {
|
|
128
|
+
...binding.samplingOverrides ?? {},
|
|
129
|
+
...override.samplingOverrides
|
|
130
|
+
};
|
|
131
|
+
if (!binding.spec && !binding.disabledEvents?.length) return;
|
|
132
|
+
return binding;
|
|
133
|
+
}
|
|
134
|
+
function mergeExperiments(blueprint, tenant) {
|
|
135
|
+
const defaultActive = blueprint?.active ?? [];
|
|
136
|
+
const defaultPaused = blueprint?.paused ?? [];
|
|
137
|
+
const tenantActive = tenant?.active;
|
|
138
|
+
const tenantPaused = tenant?.paused;
|
|
139
|
+
const activeSource = tenantActive && tenantActive.length > 0 ? tenantActive : defaultActive;
|
|
140
|
+
const pausedSource = tenantPaused && tenantPaused.length > 0 ? tenantPaused : defaultPaused;
|
|
141
|
+
const active = dedupeRefs(activeSource, experimentKey);
|
|
142
|
+
let paused = dedupeRefs(pausedSource, experimentKey);
|
|
143
|
+
const activeKeys = new Set(active.map(experimentKey));
|
|
144
|
+
paused = paused.filter((ref) => !activeKeys.has(experimentKey(ref)));
|
|
145
|
+
return {
|
|
146
|
+
catalog: dedupeRefs([
|
|
147
|
+
...defaultActive,
|
|
148
|
+
...defaultPaused,
|
|
149
|
+
...tenantActive ?? [],
|
|
150
|
+
...tenantPaused ?? []
|
|
151
|
+
], experimentKey),
|
|
152
|
+
active,
|
|
153
|
+
paused
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function resolveBranding(defaults, tenant) {
|
|
157
|
+
const override = tenant.branding;
|
|
158
|
+
const tenantMeta = tenant.meta;
|
|
159
|
+
const baseDomain = "app.localhost";
|
|
160
|
+
const domain = override?.customDomain ?? (override?.subdomain ? `${override.subdomain}.${baseDomain}` : `${tenantMeta.tenantId}.${baseDomain}`);
|
|
161
|
+
const localePreferenceOrder = [];
|
|
162
|
+
if (tenant.locales?.defaultLocale) localePreferenceOrder.push(tenant.locales.defaultLocale);
|
|
163
|
+
if (override?.appName) localePreferenceOrder.push("default", "en");
|
|
164
|
+
let appName;
|
|
165
|
+
if (override?.appName) {
|
|
166
|
+
for (const key of localePreferenceOrder) {
|
|
167
|
+
const candidate = override.appName[key];
|
|
168
|
+
if (candidate) {
|
|
169
|
+
appName = candidate;
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (!appName) {
|
|
174
|
+
const [, firstValue] = Object.entries(override.appName)[0] ?? [];
|
|
175
|
+
if (typeof firstValue === "string") appName = firstValue;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (!appName) appName = defaults?.appNameKey ?? tenantMeta.appId;
|
|
179
|
+
const assetEntries = /* @__PURE__ */ new Map();
|
|
180
|
+
const applyAssets = (assets$1) => {
|
|
181
|
+
if (!assets$1) return;
|
|
182
|
+
for (const asset of assets$1) {
|
|
183
|
+
if (!asset?.type) continue;
|
|
184
|
+
if ("url" in asset && asset.url) assetEntries.set(asset.type, asset.url);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
applyAssets(defaults?.assets);
|
|
188
|
+
applyAssets(override?.assets);
|
|
189
|
+
const assets = {
|
|
190
|
+
logo: assetEntries.get("logo"),
|
|
191
|
+
logoDark: assetEntries.get("logo-dark"),
|
|
192
|
+
favicon: assetEntries.get("favicon"),
|
|
193
|
+
ogImage: assetEntries.get("og-image")
|
|
194
|
+
};
|
|
195
|
+
const colors = {
|
|
196
|
+
primary: override?.colors?.primary ?? defaults?.colorTokens?.primary ?? "#1f2937",
|
|
197
|
+
secondary: override?.colors?.secondary ?? defaults?.colorTokens?.secondary ?? "#4b5563"
|
|
198
|
+
};
|
|
199
|
+
return {
|
|
200
|
+
appName,
|
|
201
|
+
assets,
|
|
202
|
+
colors,
|
|
203
|
+
domain
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function resolveTranslation(catalogPointer, locales, overrides) {
|
|
207
|
+
const defaultLocale = locales?.defaultLocale ?? "en";
|
|
208
|
+
return {
|
|
209
|
+
defaultLocale,
|
|
210
|
+
supportedLocales: dedupeStrings([defaultLocale, ...locales?.enabledLocales ?? []]),
|
|
211
|
+
blueprintCatalog: catalogPointer,
|
|
212
|
+
tenantOverrides: overrides?.entries ?? []
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
function mergeFeatureFlags(blueprint, overrides) {
|
|
216
|
+
const merged = /* @__PURE__ */ new Map();
|
|
217
|
+
for (const flag of blueprint) merged.set(flag.key, { ...flag });
|
|
218
|
+
for (const override of overrides) merged.set(override.key, { ...override });
|
|
219
|
+
return [...merged.values()];
|
|
220
|
+
}
|
|
221
|
+
function mergeRoutes(blueprint, overrides) {
|
|
222
|
+
const routes = /* @__PURE__ */ new Map();
|
|
223
|
+
for (const route of blueprint) routes.set(route.path, { ...route });
|
|
224
|
+
for (const override of overrides) {
|
|
225
|
+
const existing = routes.get(override.path) ?? { path: override.path };
|
|
226
|
+
if (override.label !== void 0) if (override.label === null) delete existing.label;
|
|
227
|
+
else existing.label = override.label;
|
|
228
|
+
if (override.dataView !== void 0) if (override.dataView === null) delete existing.dataView;
|
|
229
|
+
else existing.dataView = override.dataView;
|
|
230
|
+
if (override.workflow !== void 0) if (override.workflow === null) delete existing.workflow;
|
|
231
|
+
else existing.workflow = override.workflow;
|
|
232
|
+
if (override.guard !== void 0) if (override.guard === null) delete existing.guard;
|
|
233
|
+
else existing.guard = override.guard;
|
|
234
|
+
if (override.featureFlag !== void 0) if (override.featureFlag === null) delete existing.featureFlag;
|
|
235
|
+
else existing.featureFlag = override.featureFlag;
|
|
236
|
+
if (override.experiment !== void 0) if (override.experiment === null) delete existing.experiment;
|
|
237
|
+
else existing.experiment = override.experiment;
|
|
238
|
+
routes.set(existing.path, existing);
|
|
239
|
+
}
|
|
240
|
+
return [...routes.values()];
|
|
241
|
+
}
|
|
242
|
+
function evaluateIntegrationSlots(slots, bindings, connections, specs) {
|
|
243
|
+
const resolved = [];
|
|
244
|
+
const missing = [];
|
|
245
|
+
const missingKeys = /* @__PURE__ */ new Set();
|
|
246
|
+
const recordMissing = (entry) => {
|
|
247
|
+
const key = `${entry.type}:${entry.identifier}`;
|
|
248
|
+
if (missingKeys.has(key)) return;
|
|
249
|
+
missingKeys.add(key);
|
|
250
|
+
missing.push(entry);
|
|
251
|
+
};
|
|
252
|
+
const slotList = slots ?? [];
|
|
253
|
+
const slotById = /* @__PURE__ */ new Map();
|
|
254
|
+
for (const slot of slotList) slotById.set(slot.slotId, slot);
|
|
255
|
+
const bindingsBySlot = /* @__PURE__ */ new Map();
|
|
256
|
+
for (const binding of bindings ?? []) {
|
|
257
|
+
if (!slotById.get(binding.slotId)) {
|
|
258
|
+
recordMissing({
|
|
259
|
+
type: "integrationSlot",
|
|
260
|
+
identifier: `slot:${binding.slotId}`
|
|
261
|
+
});
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
const entries = bindingsBySlot.get(binding.slotId);
|
|
265
|
+
if (entries) entries.push(binding);
|
|
266
|
+
else bindingsBySlot.set(binding.slotId, [binding]);
|
|
267
|
+
}
|
|
268
|
+
for (const slot of slotList) {
|
|
269
|
+
const slotBindings = bindingsBySlot.get(slot.slotId) ?? [];
|
|
270
|
+
if (slot.required && slotBindings.length === 0) recordMissing({
|
|
271
|
+
type: "integrationSlot",
|
|
272
|
+
identifier: `slot:${slot.slotId}`
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
if (!connections || !specs) return {
|
|
276
|
+
resolved,
|
|
277
|
+
missing
|
|
278
|
+
};
|
|
279
|
+
const connectionById = /* @__PURE__ */ new Map();
|
|
280
|
+
for (const connection of connections) connectionById.set(connection.meta.id, connection);
|
|
281
|
+
for (const slot of slotList) {
|
|
282
|
+
const slotBindings = bindingsBySlot.get(slot.slotId) ?? [];
|
|
283
|
+
if (slotBindings.length === 0) continue;
|
|
284
|
+
const orderedBindings = [...slotBindings].sort((a, b) => {
|
|
285
|
+
const aPriority = a.priority ?? Number.MAX_SAFE_INTEGER;
|
|
286
|
+
const bPriority = b.priority ?? Number.MAX_SAFE_INTEGER;
|
|
287
|
+
if (aPriority === bPriority) return 0;
|
|
288
|
+
return aPriority < bPriority ? -1 : 1;
|
|
289
|
+
});
|
|
290
|
+
let slotResolved = false;
|
|
291
|
+
for (const binding of orderedBindings) {
|
|
292
|
+
const connection = connectionById.get(binding.connectionId);
|
|
293
|
+
if (!connection) {
|
|
294
|
+
recordMissing({
|
|
295
|
+
type: "integrationConnection",
|
|
296
|
+
identifier: `connection:${binding.connectionId}`
|
|
297
|
+
});
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
const spec = specs.get(connection.meta.integrationKey, connection.meta.integrationVersion);
|
|
301
|
+
if (!spec) {
|
|
302
|
+
recordMissing({
|
|
303
|
+
type: "integrationSpec",
|
|
304
|
+
identifier: `spec:${connection.meta.integrationKey}.v${connection.meta.integrationVersion}`
|
|
305
|
+
});
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
if (spec.meta.category !== slot.requiredCategory) {
|
|
309
|
+
recordMissing({
|
|
310
|
+
type: "integrationSpec",
|
|
311
|
+
identifier: `spec:${spec.meta.key}.category`
|
|
312
|
+
});
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
if (!spec.supportedModes.includes(connection.ownershipMode)) {
|
|
316
|
+
recordMissing({
|
|
317
|
+
type: "integrationSpec",
|
|
318
|
+
identifier: `spec:${spec.meta.key}.mode:${connection.ownershipMode}`
|
|
319
|
+
});
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
if (slot.allowedModes && slot.allowedModes.length > 0 && !slot.allowedModes.includes(connection.ownershipMode)) {
|
|
323
|
+
recordMissing({
|
|
324
|
+
type: "integrationConnection",
|
|
325
|
+
identifier: `connection:${connection.meta.id}:mode`
|
|
326
|
+
});
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
if (slot.requiredCapabilities && !slot.requiredCapabilities.every((requirement) => integrationProvidesCapability(spec, requirement))) {
|
|
330
|
+
recordMissing({
|
|
331
|
+
type: "integrationSpec",
|
|
332
|
+
identifier: `spec:${spec.meta.key}.capabilities`
|
|
333
|
+
});
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
resolved.push({
|
|
337
|
+
slot,
|
|
338
|
+
binding,
|
|
339
|
+
connection,
|
|
340
|
+
spec
|
|
341
|
+
});
|
|
342
|
+
slotResolved = true;
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
if (!slotResolved && slot.required) recordMissing({
|
|
346
|
+
type: "integrationSlot",
|
|
347
|
+
identifier: `slot:${slot.slotId}`
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
resolved,
|
|
352
|
+
missing
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
function integrationProvidesCapability(spec, required) {
|
|
356
|
+
return spec.capabilities.provides.some((capability) => {
|
|
357
|
+
if (capability.key !== required.key) return false;
|
|
358
|
+
if (required.version == null) return true;
|
|
359
|
+
return capability.version === required.version;
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
function resolveKnowledgeBindings(bindings, spaces, sources) {
|
|
363
|
+
if (!bindings?.length || !spaces) return [];
|
|
364
|
+
const sourceList = sources ?? [];
|
|
365
|
+
return bindings.map((binding) => {
|
|
366
|
+
const space = spaces.get(binding.spaceKey, binding.spaceVersion);
|
|
367
|
+
if (!space) return null;
|
|
368
|
+
return {
|
|
369
|
+
binding,
|
|
370
|
+
space,
|
|
371
|
+
sources: sourceList.filter((source) => {
|
|
372
|
+
if (source.meta.spaceKey !== binding.spaceKey) return false;
|
|
373
|
+
if (binding.spaceVersion != null) return source.meta.spaceVersion === binding.spaceVersion;
|
|
374
|
+
return true;
|
|
375
|
+
})
|
|
376
|
+
};
|
|
377
|
+
}).filter((entry) => entry !== null);
|
|
378
|
+
}
|
|
379
|
+
function collectMissingKnowledge(bindings, spaces, sources) {
|
|
380
|
+
if (!bindings.length || !spaces) return [];
|
|
381
|
+
const missing = [];
|
|
382
|
+
const sourceList = sources ?? [];
|
|
383
|
+
for (const binding of bindings) {
|
|
384
|
+
if (!spaces.get(binding.spaceKey, binding.spaceVersion)) {
|
|
385
|
+
missing.push({
|
|
386
|
+
type: "knowledgeSpace",
|
|
387
|
+
identifier: binding.spaceVersion ? `${binding.spaceKey}@${binding.spaceVersion}` : binding.spaceKey
|
|
388
|
+
});
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
if (sources) {
|
|
392
|
+
if (sourceList.filter((source) => {
|
|
393
|
+
if (source.meta.spaceKey !== binding.spaceKey) return false;
|
|
394
|
+
if (binding.spaceVersion != null) return source.meta.spaceVersion === binding.spaceVersion;
|
|
395
|
+
return true;
|
|
396
|
+
}).length === 0) missing.push({
|
|
397
|
+
type: "knowledgeSource",
|
|
398
|
+
identifier: binding.spaceVersion ? `${binding.spaceKey}@${binding.spaceVersion}` : binding.spaceKey
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return missing;
|
|
403
|
+
}
|
|
404
|
+
function resolveCapabilityRefs(refs, registry, missing) {
|
|
405
|
+
if (!registry) {
|
|
406
|
+
if (refs.length > 0) for (const ref of refs) missing.push({
|
|
407
|
+
type: "capability",
|
|
408
|
+
identifier: capabilityKey(ref)
|
|
409
|
+
});
|
|
410
|
+
return [];
|
|
411
|
+
}
|
|
412
|
+
const resolved = [];
|
|
413
|
+
for (const ref of refs) {
|
|
414
|
+
const spec = registry.get(ref.key, ref.version);
|
|
415
|
+
if (!spec) {
|
|
416
|
+
missing.push({
|
|
417
|
+
type: "capability",
|
|
418
|
+
identifier: capabilityKey(ref)
|
|
419
|
+
});
|
|
420
|
+
continue;
|
|
421
|
+
}
|
|
422
|
+
resolved.push(spec);
|
|
423
|
+
}
|
|
424
|
+
return resolved;
|
|
425
|
+
}
|
|
426
|
+
function resolveFeatureRefs(refs, registry, missing) {
|
|
427
|
+
if (!registry) {
|
|
428
|
+
if (refs.length > 0) for (const ref of refs) missing.push({
|
|
429
|
+
type: "feature",
|
|
430
|
+
identifier: ref.key
|
|
431
|
+
});
|
|
432
|
+
return [];
|
|
433
|
+
}
|
|
434
|
+
const resolved = [];
|
|
435
|
+
for (const ref of refs) {
|
|
436
|
+
const spec = registry.get(ref.key);
|
|
437
|
+
if (!spec) {
|
|
438
|
+
missing.push({
|
|
439
|
+
type: "feature",
|
|
440
|
+
identifier: ref.key
|
|
441
|
+
});
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
resolved.push(spec);
|
|
445
|
+
}
|
|
446
|
+
return resolved;
|
|
447
|
+
}
|
|
448
|
+
function resolvePointerRecord(record, registry, type, missing) {
|
|
449
|
+
if (!registry) {
|
|
450
|
+
if (Object.keys(record).length > 0) for (const [slot, pointer] of Object.entries(record)) missing.push({
|
|
451
|
+
type,
|
|
452
|
+
identifier: `${slot} -> ${specPointerKey(pointer)}`
|
|
453
|
+
});
|
|
454
|
+
return {};
|
|
455
|
+
}
|
|
456
|
+
const resolved = {};
|
|
457
|
+
for (const [slot, pointer] of Object.entries(record)) {
|
|
458
|
+
const spec = registry.get(pointer.key, pointer.version);
|
|
459
|
+
if (!spec) {
|
|
460
|
+
missing.push({
|
|
461
|
+
type,
|
|
462
|
+
identifier: `${slot} -> ${specPointerKey(pointer)}`
|
|
463
|
+
});
|
|
464
|
+
continue;
|
|
465
|
+
}
|
|
466
|
+
resolved[slot] = spec;
|
|
467
|
+
}
|
|
468
|
+
return resolved;
|
|
469
|
+
}
|
|
470
|
+
function resolvePolicies(policies, registry, missing) {
|
|
471
|
+
if (!registry) {
|
|
472
|
+
if (policies.length > 0) for (const policy of policies) missing.push({
|
|
473
|
+
type: "policy",
|
|
474
|
+
identifier: policyKey(policy)
|
|
475
|
+
});
|
|
476
|
+
return [];
|
|
477
|
+
}
|
|
478
|
+
const resolved = [];
|
|
479
|
+
for (const policy of policies) {
|
|
480
|
+
const spec = registry.get(policy.key, policy.version);
|
|
481
|
+
if (!spec) {
|
|
482
|
+
missing.push({
|
|
483
|
+
type: "policy",
|
|
484
|
+
identifier: policyKey(policy)
|
|
485
|
+
});
|
|
486
|
+
continue;
|
|
487
|
+
}
|
|
488
|
+
resolved.push(spec);
|
|
489
|
+
}
|
|
490
|
+
return resolved;
|
|
491
|
+
}
|
|
492
|
+
function resolveThemeBinding(binding, registry) {
|
|
493
|
+
const themeMissing = [];
|
|
494
|
+
if (!binding) return {
|
|
495
|
+
theme: void 0,
|
|
496
|
+
fallbacks: [],
|
|
497
|
+
themeMissing
|
|
498
|
+
};
|
|
499
|
+
if (!registry) {
|
|
500
|
+
themeMissing.push({
|
|
501
|
+
type: "theme",
|
|
502
|
+
identifier: `${binding.primary.key}.v${binding.primary.version}`
|
|
503
|
+
});
|
|
504
|
+
for (const fallback of binding.fallbacks ?? []) themeMissing.push({
|
|
505
|
+
type: "theme",
|
|
506
|
+
identifier: `${fallback.key}.v${fallback.version}`
|
|
507
|
+
});
|
|
508
|
+
return {
|
|
509
|
+
theme: void 0,
|
|
510
|
+
fallbacks: [],
|
|
511
|
+
themeMissing
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
const theme = registry.get(binding.primary.key, binding.primary.version);
|
|
515
|
+
if (!theme) themeMissing.push({
|
|
516
|
+
type: "theme",
|
|
517
|
+
identifier: `${binding.primary.key}.v${binding.primary.version}`
|
|
518
|
+
});
|
|
519
|
+
const fallbacks = [];
|
|
520
|
+
for (const fallback of binding.fallbacks ?? []) {
|
|
521
|
+
const spec = registry.get(fallback.key, fallback.version);
|
|
522
|
+
if (!spec) {
|
|
523
|
+
themeMissing.push({
|
|
524
|
+
type: "theme",
|
|
525
|
+
identifier: `${fallback.key}.v${fallback.version}`
|
|
526
|
+
});
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
fallbacks.push(spec);
|
|
530
|
+
}
|
|
531
|
+
return {
|
|
532
|
+
theme: theme ?? void 0,
|
|
533
|
+
fallbacks,
|
|
534
|
+
themeMissing
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
function resolveTelemetryBinding(binding, registry) {
|
|
538
|
+
const telemetryMissing = [];
|
|
539
|
+
if (!binding?.spec) return {
|
|
540
|
+
telemetry: void 0,
|
|
541
|
+
telemetryMissing
|
|
542
|
+
};
|
|
543
|
+
if (!registry) {
|
|
544
|
+
telemetryMissing.push({
|
|
545
|
+
type: "telemetry",
|
|
546
|
+
identifier: specPointerKey(binding.spec)
|
|
547
|
+
});
|
|
548
|
+
return {
|
|
549
|
+
telemetry: void 0,
|
|
550
|
+
telemetryMissing
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
const telemetry = registry.get(binding.spec.key, binding.spec.version);
|
|
554
|
+
if (!telemetry) telemetryMissing.push({
|
|
555
|
+
type: "telemetry",
|
|
556
|
+
identifier: specPointerKey(binding.spec)
|
|
557
|
+
});
|
|
558
|
+
return {
|
|
559
|
+
telemetry: telemetry ?? void 0,
|
|
560
|
+
telemetryMissing
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
function resolveExperimentsSpecs(experiments, registry, missing) {
|
|
564
|
+
const resolveList = (refs) => {
|
|
565
|
+
if (refs.length === 0) return [];
|
|
566
|
+
if (!registry) {
|
|
567
|
+
for (const ref of refs) missing.push({
|
|
568
|
+
type: "experiment",
|
|
569
|
+
identifier: experimentKey(ref)
|
|
570
|
+
});
|
|
571
|
+
return [];
|
|
572
|
+
}
|
|
573
|
+
const resolved = [];
|
|
574
|
+
for (const ref of refs) {
|
|
575
|
+
const spec = registry.get(ref.key, ref.version);
|
|
576
|
+
if (!spec) {
|
|
577
|
+
missing.push({
|
|
578
|
+
type: "experiment",
|
|
579
|
+
identifier: experimentKey(ref)
|
|
580
|
+
});
|
|
581
|
+
continue;
|
|
582
|
+
}
|
|
583
|
+
resolved.push(spec);
|
|
584
|
+
}
|
|
585
|
+
return resolved;
|
|
586
|
+
};
|
|
587
|
+
return {
|
|
588
|
+
active: resolveList(experiments.active),
|
|
589
|
+
paused: resolveList(experiments.paused)
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
function capabilityKey(ref) {
|
|
593
|
+
return `${ref.key}${ref.version ? `.v${ref.version}` : ""}`;
|
|
594
|
+
}
|
|
595
|
+
function featureKey(ref) {
|
|
596
|
+
return ref.key;
|
|
597
|
+
}
|
|
598
|
+
function specPointerKey(pointer) {
|
|
599
|
+
return `${pointer.key}${pointer.version ? `.v${pointer.version}` : ""}`;
|
|
600
|
+
}
|
|
601
|
+
function policyKey(ref) {
|
|
602
|
+
return `${ref.key}${ref.version ? `.v${ref.version}` : ""}`;
|
|
603
|
+
}
|
|
604
|
+
function experimentKey(ref) {
|
|
605
|
+
return `${ref.key}${ref.version ? `.v${ref.version}` : ""}`;
|
|
606
|
+
}
|
|
607
|
+
function dedupeRefs(refs, keyFn) {
|
|
608
|
+
const map = /* @__PURE__ */ new Map();
|
|
609
|
+
for (const ref of refs) map.set(keyFn(ref), ref);
|
|
610
|
+
return [...map.values()];
|
|
611
|
+
}
|
|
612
|
+
function dedupeStrings(values) {
|
|
613
|
+
return [...new Set(values)];
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
//#endregion
|
|
617
|
+
export { composeAppConfig, resolveAppConfig };
|