@contractspec/lib.contracts 0.0.0-canary-20260113162409
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.capability.d.ts +7 -0
- package/dist/app-config/app-config.capability.js +23 -0
- package/dist/app-config/app-config.feature.d.ts +11 -0
- package/dist/app-config/app-config.feature.js +61 -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 +10 -0
- package/dist/app-config/index.js +9 -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 +175 -0
- package/dist/app-config/spec.js +19 -0
- package/dist/app-config/validation.d.ts +49 -0
- package/dist/app-config/validation.js +538 -0
- package/dist/capabilities/capabilities.d.ts +41 -0
- package/dist/capabilities/capabilities.js +48 -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 +301 -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 +5 -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 +17 -0
- package/dist/data-views/registry.js +20 -0
- package/dist/data-views/runtime.d.ts +32 -0
- package/dist/data-views/runtime.js +68 -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 +30 -0
- package/dist/docs/meta.docs.d.ts +6 -0
- package/dist/docs/meta.docs.js +29 -0
- package/dist/docs/presentations.d.ts +31 -0
- package/dist/docs/presentations.js +57 -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/cli.docblock.d.ts +6 -0
- package/dist/docs/tech/cli.docblock.js +138 -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/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 +126 -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 +48 -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/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/examples/docs/examples.docblock.d.ts +6 -0
- package/dist/examples/docs/examples.docblock.js +165 -0
- package/dist/examples/index.d.ts +13 -0
- package/dist/examples/index.js +13 -0
- package/dist/examples/registry.d.ts +43 -0
- package/dist/examples/registry.js +88 -0
- package/dist/examples/schema.d.ts +282 -0
- package/dist/examples/schema.js +125 -0
- package/dist/examples/types.d.ts +167 -0
- package/dist/examples/types.js +43 -0
- package/dist/examples/validation.d.ts +65 -0
- package/dist/examples/validation.js +144 -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 +80 -0
- package/dist/experiments/spec.js +15 -0
- package/dist/features/index.d.ts +13 -0
- package/dist/features/index.js +12 -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 +143 -0
- package/dist/forms/index.d.ts +2 -0
- package/dist/forms/index.js +3 -0
- package/dist/index.d.ts +154 -0
- package/dist/index.js +132 -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.capability.d.ts +7 -0
- package/dist/integrations/integrations.capability.js +17 -0
- package/dist/integrations/integrations.feature.d.ts +11 -0
- package/dist/integrations/integrations.feature.js +67 -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.capability.d.ts +7 -0
- package/dist/integrations/openbanking/openbanking.capability.js +21 -0
- package/dist/integrations/openbanking/openbanking.feature.d.ts +11 -0
- package/dist/integrations/openbanking/openbanking.feature.js +76 -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 +8 -0
- package/dist/integrations/providers/elevenlabs.js +56 -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 +8 -0
- package/dist/integrations/providers/gcs-storage.js +79 -0
- package/dist/integrations/providers/gmail.d.ts +8 -0
- package/dist/integrations/providers/gmail.js +91 -0
- package/dist/integrations/providers/google-calendar.d.ts +8 -0
- package/dist/integrations/providers/google-calendar.js +70 -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 +146 -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 +8 -0
- package/dist/integrations/providers/mistral.js +72 -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 +8 -0
- package/dist/integrations/providers/postmark.js +72 -0
- package/dist/integrations/providers/powens.d.ts +8 -0
- package/dist/integrations/providers/powens.js +120 -0
- package/dist/integrations/providers/qdrant.d.ts +8 -0
- package/dist/integrations/providers/qdrant.js +77 -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 +8 -0
- package/dist/integrations/providers/stripe.js +87 -0
- package/dist/integrations/providers/twilio-sms.d.ts +8 -0
- package/dist/integrations/providers/twilio-sms.js +65 -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 +77 -0
- package/dist/integrations/spec.js +22 -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 +42 -0
- package/dist/jsonschema.js +51 -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.capability.d.ts +7 -0
- package/dist/knowledge/knowledge.capability.js +21 -0
- package/dist/knowledge/knowledge.feature.d.ts +11 -0
- package/dist/knowledge/knowledge.feature.js +68 -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 +46 -0
- package/dist/knowledge/spec.js +17 -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 +31 -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 +82 -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 +54 -0
- package/dist/operations/registry.js +176 -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 +225 -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 +53 -0
- package/dist/prompt.js +10 -0
- package/dist/promptRegistry.d.ts +15 -0
- package/dist/promptRegistry.js +31 -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 +32 -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 +54 -0
- package/dist/server/mcp/registerPrompts.d.ts +8 -0
- package/dist/server/mcp/registerPrompts.js +41 -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 +42 -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 +82 -0
- package/dist/tests/spec.js +34 -0
- package/dist/themes.d.ts +51 -0
- package/dist/themes.js +17 -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/versioning/index.d.ts +3 -0
- package/dist/versioning/index.js +4 -0
- package/dist/versioning/types.d.ts +127 -0
- package/dist/versioning/types.js +24 -0
- package/dist/versioning/utils.d.ts +95 -0
- package/dist/versioning/utils.js +180 -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 +17 -0
- package/dist/workflow/index.js +16 -0
- package/dist/workflow/overview.docblock.d.ts +6 -0
- package/dist/workflow/overview.docblock.js +21 -0
- package/dist/workflow/runner.d.ts +77 -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 +93 -0
- package/dist/workflow/spec.js +11 -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 +1162 -0
- package/dist/workspace-config/contractsrc-schema.js +421 -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 +618 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { randomUUID } from "crypto";
|
|
2
|
+
|
|
3
|
+
//#region src/telemetry/tracker.ts
|
|
4
|
+
const maskValue = (value) => {
|
|
5
|
+
if (value == null) return value;
|
|
6
|
+
if (typeof value === "string") return "REDACTED";
|
|
7
|
+
if (typeof value === "number") return 0;
|
|
8
|
+
if (typeof value === "boolean") return false;
|
|
9
|
+
if (Array.isArray(value)) return value.map(() => "REDACTED");
|
|
10
|
+
if (typeof value === "object") return Object.fromEntries(Object.keys(value).map((key) => [key, "REDACTED"]));
|
|
11
|
+
return "REDACTED";
|
|
12
|
+
};
|
|
13
|
+
var TelemetryTracker = class {
|
|
14
|
+
providers = /* @__PURE__ */ new Map();
|
|
15
|
+
registry;
|
|
16
|
+
anomalyMonitor;
|
|
17
|
+
random;
|
|
18
|
+
clock;
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.registry = options.registry;
|
|
21
|
+
this.anomalyMonitor = options.anomalyMonitor;
|
|
22
|
+
this.random = options.random ?? Math.random;
|
|
23
|
+
this.clock = options.clock ?? (() => /* @__PURE__ */ new Date());
|
|
24
|
+
for (const provider of options.providers ?? []) this.providers.set(provider.id, provider);
|
|
25
|
+
}
|
|
26
|
+
registerProvider(provider) {
|
|
27
|
+
this.providers.set(provider.id, provider);
|
|
28
|
+
}
|
|
29
|
+
unregisterProvider(providerId) {
|
|
30
|
+
this.providers.delete(providerId);
|
|
31
|
+
}
|
|
32
|
+
async track(name, version, properties, context = {}) {
|
|
33
|
+
const definition = this.registry.findEventDef(name, version);
|
|
34
|
+
if (!definition) return false;
|
|
35
|
+
const spec = this.registry.getSpecForEvent(definition.key, definition.version);
|
|
36
|
+
if (!spec) return false;
|
|
37
|
+
if (!this.shouldSample(definition.sampling ?? spec.config?.defaultSamplingRate)) return false;
|
|
38
|
+
const redactedProperties = this.redactProperties(definition, properties);
|
|
39
|
+
const dispatch = {
|
|
40
|
+
id: randomUUID(),
|
|
41
|
+
name: definition.key,
|
|
42
|
+
version: definition.version,
|
|
43
|
+
occurredAt: this.clock().toISOString(),
|
|
44
|
+
properties: redactedProperties,
|
|
45
|
+
privacy: definition.privacy,
|
|
46
|
+
context,
|
|
47
|
+
tags: definition.tags,
|
|
48
|
+
spec,
|
|
49
|
+
definition
|
|
50
|
+
};
|
|
51
|
+
await Promise.all([...this.providers.values()].map((provider) => provider.send(dispatch)));
|
|
52
|
+
this.anomalyMonitor?.observe(dispatch);
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
shouldSample(sampling) {
|
|
56
|
+
if (typeof sampling === "number") return this.random() < sampling;
|
|
57
|
+
if (!sampling) return true;
|
|
58
|
+
return this.random() < sampling.rate;
|
|
59
|
+
}
|
|
60
|
+
redactProperties(definition, properties) {
|
|
61
|
+
const result = {};
|
|
62
|
+
for (const [key, value] of Object.entries(properties)) {
|
|
63
|
+
const def = definition.properties[key];
|
|
64
|
+
if (!def) {
|
|
65
|
+
result[key] = value;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (def.redact || def.pii || definition.privacy === "sensitive") result[key] = maskValue(value);
|
|
69
|
+
else result[key] = value;
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { TelemetryTracker };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Action, Assertion, CoverageRequirement, ExpectErrorAssertion, ExpectEventsAssertion, ExpectOutputAssertion, ExpectedEvent, Fixture, OperationTargetRef, TestRegistry, TestScenario, TestSpec, TestSpecMeta, TestSpecRef, TestTarget, WorkflowTargetRef, defineTestSpec, makeTestKey } from "./spec.js";
|
|
2
|
+
import { AssertionResult, ScenarioRunResult, TestRunResult, TestRunner, TestRunnerConfig } from "./runner.js";
|
|
3
|
+
export { Action, Assertion, AssertionResult, CoverageRequirement, ExpectErrorAssertion, ExpectEventsAssertion, ExpectOutputAssertion, ExpectedEvent, Fixture, OperationTargetRef, ScenarioRunResult, TestRegistry, TestRunResult, TestRunner, TestRunnerConfig, TestScenario, TestSpec, TestSpecMeta, TestSpecRef, TestTarget, WorkflowTargetRef, defineTestSpec, makeTestKey };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Assertion, TestScenario, TestSpec } from "./spec.js";
|
|
2
|
+
import { OperationSpecRegistry } from "../operations/registry.js";
|
|
3
|
+
import { HandlerCtx } from "../types.js";
|
|
4
|
+
import "../index.js";
|
|
5
|
+
|
|
6
|
+
//#region src/tests/runner.d.ts
|
|
7
|
+
interface ScenarioRunResult {
|
|
8
|
+
scenario: TestScenario;
|
|
9
|
+
status: 'passed' | 'failed';
|
|
10
|
+
error?: Error;
|
|
11
|
+
assertionResults: AssertionResult[];
|
|
12
|
+
}
|
|
13
|
+
interface AssertionResult {
|
|
14
|
+
assertion: Assertion;
|
|
15
|
+
status: 'passed' | 'failed';
|
|
16
|
+
message?: string;
|
|
17
|
+
}
|
|
18
|
+
interface TestRunResult {
|
|
19
|
+
spec: TestSpec;
|
|
20
|
+
scenarios: ScenarioRunResult[];
|
|
21
|
+
passed: number;
|
|
22
|
+
failed: number;
|
|
23
|
+
}
|
|
24
|
+
interface TestRunnerConfig {
|
|
25
|
+
registry: OperationSpecRegistry;
|
|
26
|
+
createContext?: () => HandlerCtx | Promise<HandlerCtx>;
|
|
27
|
+
beforeEach?: (scenario: TestScenario) => void | Promise<void>;
|
|
28
|
+
afterEach?: (scenario: TestScenario, result: ScenarioRunResult) => void | Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
declare class TestRunner {
|
|
31
|
+
private readonly config;
|
|
32
|
+
constructor(config: TestRunnerConfig);
|
|
33
|
+
run(spec: TestSpec): Promise<TestRunResult>;
|
|
34
|
+
private runScenario;
|
|
35
|
+
private createContext;
|
|
36
|
+
private executeOperation;
|
|
37
|
+
private evaluateAssertion;
|
|
38
|
+
private evaluateOutputAssertion;
|
|
39
|
+
private evaluateErrorAssertion;
|
|
40
|
+
private evaluateEventsAssertion;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { AssertionResult, ScenarioRunResult, TestRunResult, TestRunner, TestRunnerConfig };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import "../index.js";
|
|
2
|
+
import { deepStrictEqual } from "assert";
|
|
3
|
+
|
|
4
|
+
//#region src/tests/runner.ts
|
|
5
|
+
var TestRunner = class {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
}
|
|
9
|
+
async run(spec) {
|
|
10
|
+
const scenarios = [];
|
|
11
|
+
let passed = 0;
|
|
12
|
+
let failed = 0;
|
|
13
|
+
for (const scenario of spec.scenarios) {
|
|
14
|
+
await this.config.beforeEach?.(scenario);
|
|
15
|
+
const result = await this.runScenario(spec, scenario);
|
|
16
|
+
scenarios.push(result);
|
|
17
|
+
if (result.status === "passed") passed += 1;
|
|
18
|
+
else failed += 1;
|
|
19
|
+
await this.config.afterEach?.(scenario, result);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
spec,
|
|
23
|
+
scenarios,
|
|
24
|
+
passed,
|
|
25
|
+
failed
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async runScenario(spec, scenario) {
|
|
29
|
+
const assertionResults = [];
|
|
30
|
+
try {
|
|
31
|
+
const context = await this.createContext();
|
|
32
|
+
const fixtures = [...spec.fixtures ?? [], ...scenario.given ?? []];
|
|
33
|
+
const events = [];
|
|
34
|
+
for (const fixture of fixtures) await this.executeOperation(fixture, context, events);
|
|
35
|
+
const actionResult = await this.executeOperation(scenario.when, context, events);
|
|
36
|
+
const assertions = scenario.then ?? [];
|
|
37
|
+
for (const assertion of assertions) {
|
|
38
|
+
const assertionResult = this.evaluateAssertion(assertion, actionResult, events);
|
|
39
|
+
assertionResults.push(assertionResult);
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
scenario,
|
|
43
|
+
status: assertionResults.some((assertion) => assertion.status === "failed") ? "failed" : "passed",
|
|
44
|
+
assertionResults
|
|
45
|
+
};
|
|
46
|
+
} catch (error) {
|
|
47
|
+
return {
|
|
48
|
+
scenario,
|
|
49
|
+
status: "failed",
|
|
50
|
+
error,
|
|
51
|
+
assertionResults
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async createContext() {
|
|
56
|
+
return { ...await this.config.createContext?.() ?? {} };
|
|
57
|
+
}
|
|
58
|
+
async executeOperation(action, baseCtx, recordedEvents) {
|
|
59
|
+
const ctx = {
|
|
60
|
+
...baseCtx,
|
|
61
|
+
eventPublisher: async (event) => {
|
|
62
|
+
recordedEvents.push({
|
|
63
|
+
key: event.key,
|
|
64
|
+
version: event.version,
|
|
65
|
+
payload: event.payload
|
|
66
|
+
});
|
|
67
|
+
await baseCtx.eventPublisher?.(event);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
try {
|
|
71
|
+
return {
|
|
72
|
+
output: await this.config.registry.execute(action.operation.key, action.operation.version, action.input ?? null, ctx),
|
|
73
|
+
events: recordedEvents
|
|
74
|
+
};
|
|
75
|
+
} catch (error) {
|
|
76
|
+
return {
|
|
77
|
+
error,
|
|
78
|
+
events: recordedEvents
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
evaluateAssertion(assertion, result, events) {
|
|
83
|
+
switch (assertion.type) {
|
|
84
|
+
case "expectOutput": return this.evaluateOutputAssertion(assertion, result);
|
|
85
|
+
case "expectError": return this.evaluateErrorAssertion(assertion, result);
|
|
86
|
+
case "expectEvents": return this.evaluateEventsAssertion(assertion, events);
|
|
87
|
+
default: return {
|
|
88
|
+
assertion,
|
|
89
|
+
status: "failed",
|
|
90
|
+
message: `Unknown assertion type ${assertion.type}`
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
evaluateOutputAssertion(assertion, result) {
|
|
95
|
+
if (result.error) return {
|
|
96
|
+
assertion,
|
|
97
|
+
status: "failed",
|
|
98
|
+
message: `Expected output but operation threw error: ${result.error.message}`
|
|
99
|
+
};
|
|
100
|
+
try {
|
|
101
|
+
deepStrictEqual(result.output, assertion.match);
|
|
102
|
+
return {
|
|
103
|
+
assertion,
|
|
104
|
+
status: "passed"
|
|
105
|
+
};
|
|
106
|
+
} catch (error) {
|
|
107
|
+
return {
|
|
108
|
+
assertion,
|
|
109
|
+
status: "failed",
|
|
110
|
+
message: error instanceof Error ? error.message : "Output assertion failed"
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
evaluateErrorAssertion(assertion, result) {
|
|
115
|
+
if (!result.error) return {
|
|
116
|
+
assertion,
|
|
117
|
+
status: "failed",
|
|
118
|
+
message: "Expected an error but operation completed successfully"
|
|
119
|
+
};
|
|
120
|
+
if (assertion.messageIncludes && !result.error.message.includes(assertion.messageIncludes)) return {
|
|
121
|
+
assertion,
|
|
122
|
+
status: "failed",
|
|
123
|
+
message: `Error message "${result.error.message}" did not include expected substring "${assertion.messageIncludes}"`
|
|
124
|
+
};
|
|
125
|
+
return {
|
|
126
|
+
assertion,
|
|
127
|
+
status: "passed"
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
evaluateEventsAssertion(assertion, events) {
|
|
131
|
+
const failures = [];
|
|
132
|
+
for (const expected of assertion.events) {
|
|
133
|
+
const count = events.filter((event) => event.key === expected.key && event.version === expected.version).length;
|
|
134
|
+
if (typeof expected.min === "number" && count < expected.min || typeof expected.max === "number" && count > expected.max) failures.push(`Event ${expected.key}.v${expected.version} occurred ${count} times (expected ${expected.min ?? 0} - ${expected.max ?? "∞"})`);
|
|
135
|
+
else if (typeof expected.min === "undefined" && typeof expected.max === "undefined" && count === 0) failures.push(`Event ${expected.key}.v${expected.version} did not occur`);
|
|
136
|
+
}
|
|
137
|
+
if (failures.length > 0) return {
|
|
138
|
+
assertion,
|
|
139
|
+
status: "failed",
|
|
140
|
+
message: failures.join("; ")
|
|
141
|
+
};
|
|
142
|
+
return {
|
|
143
|
+
assertion,
|
|
144
|
+
status: "passed"
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
//#endregion
|
|
150
|
+
export { TestRunner };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { OwnerShipMeta } from "../ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region src/tests/spec.d.ts
|
|
4
|
+
interface OperationTargetRef {
|
|
5
|
+
key: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
}
|
|
8
|
+
interface WorkflowTargetRef {
|
|
9
|
+
key: string;
|
|
10
|
+
version?: string;
|
|
11
|
+
}
|
|
12
|
+
type TestTarget = {
|
|
13
|
+
type: 'operation';
|
|
14
|
+
operation: OperationTargetRef;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'workflow';
|
|
17
|
+
workflow: WorkflowTargetRef;
|
|
18
|
+
};
|
|
19
|
+
interface Fixture {
|
|
20
|
+
description?: string;
|
|
21
|
+
operation: OperationTargetRef;
|
|
22
|
+
input?: unknown;
|
|
23
|
+
}
|
|
24
|
+
interface Action {
|
|
25
|
+
operation: OperationTargetRef;
|
|
26
|
+
input?: unknown;
|
|
27
|
+
}
|
|
28
|
+
interface ExpectOutputAssertion {
|
|
29
|
+
type: 'expectOutput';
|
|
30
|
+
match: unknown;
|
|
31
|
+
}
|
|
32
|
+
interface ExpectErrorAssertion {
|
|
33
|
+
type: 'expectError';
|
|
34
|
+
messageIncludes?: string;
|
|
35
|
+
}
|
|
36
|
+
interface ExpectedEvent {
|
|
37
|
+
key: string;
|
|
38
|
+
version: string;
|
|
39
|
+
min?: number;
|
|
40
|
+
max?: number;
|
|
41
|
+
}
|
|
42
|
+
interface ExpectEventsAssertion {
|
|
43
|
+
type: 'expectEvents';
|
|
44
|
+
events: ExpectedEvent[];
|
|
45
|
+
}
|
|
46
|
+
type Assertion = ExpectOutputAssertion | ExpectErrorAssertion | ExpectEventsAssertion;
|
|
47
|
+
interface TestScenario {
|
|
48
|
+
key: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
given?: Fixture[];
|
|
51
|
+
when: Action;
|
|
52
|
+
then?: Assertion[];
|
|
53
|
+
}
|
|
54
|
+
interface CoverageRequirement {
|
|
55
|
+
statements?: number;
|
|
56
|
+
branches?: number;
|
|
57
|
+
functions?: number;
|
|
58
|
+
lines?: number;
|
|
59
|
+
mutations?: number;
|
|
60
|
+
}
|
|
61
|
+
type TestSpecMeta = OwnerShipMeta;
|
|
62
|
+
interface TestSpec {
|
|
63
|
+
meta: TestSpecMeta;
|
|
64
|
+
target: TestTarget;
|
|
65
|
+
fixtures?: Fixture[];
|
|
66
|
+
scenarios: TestScenario[];
|
|
67
|
+
coverage?: CoverageRequirement;
|
|
68
|
+
}
|
|
69
|
+
interface TestSpecRef {
|
|
70
|
+
key: string;
|
|
71
|
+
version?: string;
|
|
72
|
+
}
|
|
73
|
+
declare class TestRegistry {
|
|
74
|
+
private readonly items;
|
|
75
|
+
register(spec: TestSpec): this;
|
|
76
|
+
list(): TestSpec[];
|
|
77
|
+
get(name: string, version?: string): TestSpec | undefined;
|
|
78
|
+
}
|
|
79
|
+
declare function makeTestKey(meta: TestSpecMeta): string;
|
|
80
|
+
declare function defineTestSpec(spec: TestSpec): TestSpec;
|
|
81
|
+
//#endregion
|
|
82
|
+
export { Action, Assertion, CoverageRequirement, ExpectErrorAssertion, ExpectEventsAssertion, ExpectOutputAssertion, ExpectedEvent, Fixture, OperationTargetRef, TestRegistry, TestScenario, TestSpec, TestSpecMeta, TestSpecRef, TestTarget, WorkflowTargetRef, defineTestSpec, makeTestKey };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { compareVersions } from "compare-versions";
|
|
2
|
+
|
|
3
|
+
//#region src/tests/spec.ts
|
|
4
|
+
const testKey = (meta) => `${meta.key}.v${meta.version}`;
|
|
5
|
+
var TestRegistry = class {
|
|
6
|
+
items = /* @__PURE__ */ new Map();
|
|
7
|
+
register(spec) {
|
|
8
|
+
const key = testKey(spec.meta);
|
|
9
|
+
if (this.items.has(key)) throw new Error(`Duplicate TestSpec registration for ${key}`);
|
|
10
|
+
this.items.set(key, spec);
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
list() {
|
|
14
|
+
return [...this.items.values()];
|
|
15
|
+
}
|
|
16
|
+
get(name, version) {
|
|
17
|
+
if (version != null) return this.items.get(`${name}.v${version}`);
|
|
18
|
+
let latest;
|
|
19
|
+
for (const spec of this.items.values()) {
|
|
20
|
+
if (spec.meta.key !== name) continue;
|
|
21
|
+
if (!latest || compareVersions(spec.meta.version, latest.meta.version) > 0) latest = spec;
|
|
22
|
+
}
|
|
23
|
+
return latest;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
function makeTestKey(meta) {
|
|
27
|
+
return testKey(meta);
|
|
28
|
+
}
|
|
29
|
+
function defineTestSpec(spec) {
|
|
30
|
+
return spec;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { TestRegistry, defineTestSpec, makeTestKey };
|
package/dist/themes.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OwnerShipMeta } from "./ownership.js";
|
|
2
|
+
import { SpecContractRegistry } from "./registry.js";
|
|
3
|
+
|
|
4
|
+
//#region src/themes.d.ts
|
|
5
|
+
type ThemeScope = 'global' | 'tenant' | 'user';
|
|
6
|
+
interface ThemeToken<T> {
|
|
7
|
+
value: T;
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
interface ThemeTokens {
|
|
11
|
+
colors?: Record<string, ThemeToken<string>>;
|
|
12
|
+
radii?: Record<string, ThemeToken<number>>;
|
|
13
|
+
space?: Record<string, ThemeToken<number>>;
|
|
14
|
+
typography?: Record<string, ThemeToken<number>>;
|
|
15
|
+
shadows?: Record<string, ThemeToken<string>>;
|
|
16
|
+
motion?: Record<string, ThemeToken<string>>;
|
|
17
|
+
}
|
|
18
|
+
interface ComponentVariantDefinition {
|
|
19
|
+
props?: Record<string, unknown>;
|
|
20
|
+
tokens?: ThemeTokens;
|
|
21
|
+
}
|
|
22
|
+
interface ComponentVariantSpec {
|
|
23
|
+
component: string;
|
|
24
|
+
variants: Record<string, ComponentVariantDefinition>;
|
|
25
|
+
}
|
|
26
|
+
interface ThemeOverride {
|
|
27
|
+
scope: ThemeScope;
|
|
28
|
+
target: string;
|
|
29
|
+
tokens?: ThemeTokens;
|
|
30
|
+
components?: ComponentVariantSpec[];
|
|
31
|
+
}
|
|
32
|
+
interface ThemeMeta extends OwnerShipMeta {
|
|
33
|
+
extends?: ThemeRef;
|
|
34
|
+
scopes?: ThemeScope[];
|
|
35
|
+
}
|
|
36
|
+
interface ThemeSpec {
|
|
37
|
+
meta: ThemeMeta;
|
|
38
|
+
tokens: ThemeTokens;
|
|
39
|
+
components?: ComponentVariantSpec[];
|
|
40
|
+
overrides?: ThemeOverride[];
|
|
41
|
+
}
|
|
42
|
+
interface ThemeRef {
|
|
43
|
+
key: string;
|
|
44
|
+
version: string;
|
|
45
|
+
}
|
|
46
|
+
declare class ThemeRegistry extends SpecContractRegistry<'theme', ThemeSpec> {
|
|
47
|
+
constructor(items?: ThemeSpec[]);
|
|
48
|
+
}
|
|
49
|
+
declare function makeThemeRef(spec: ThemeSpec): ThemeRef;
|
|
50
|
+
//#endregion
|
|
51
|
+
export { ComponentVariantDefinition, ComponentVariantSpec, ThemeMeta, ThemeOverride, ThemeRef, ThemeRegistry, ThemeScope, ThemeSpec, ThemeToken, ThemeTokens, makeThemeRef };
|
package/dist/themes.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SpecContractRegistry } from "./registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/themes.ts
|
|
4
|
+
var ThemeRegistry = class extends SpecContractRegistry {
|
|
5
|
+
constructor(items) {
|
|
6
|
+
super("theme", items);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
function makeThemeRef(spec) {
|
|
10
|
+
return {
|
|
11
|
+
key: spec.meta.key,
|
|
12
|
+
version: spec.meta.version
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { ThemeRegistry, makeThemeRef };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/translations/catalog.d.ts
|
|
2
|
+
type Locale = string;
|
|
3
|
+
type MessageKey = string;
|
|
4
|
+
interface TranslationEntry {
|
|
5
|
+
key: MessageKey;
|
|
6
|
+
locale: Locale;
|
|
7
|
+
value: string;
|
|
8
|
+
context?: string;
|
|
9
|
+
}
|
|
10
|
+
interface TranslationCatalogMeta {
|
|
11
|
+
key: string;
|
|
12
|
+
version: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
interface PlatformTranslationCatalog {
|
|
16
|
+
meta: TranslationCatalogMeta;
|
|
17
|
+
defaultLocale: Locale;
|
|
18
|
+
supportedLocales: Locale[];
|
|
19
|
+
entries: TranslationEntry[];
|
|
20
|
+
}
|
|
21
|
+
interface BlueprintTranslationCatalog {
|
|
22
|
+
meta: TranslationCatalogMeta;
|
|
23
|
+
defaultLocale: Locale;
|
|
24
|
+
supportedLocales: Locale[];
|
|
25
|
+
entries: TranslationEntry[];
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { BlueprintTranslationCatalog, Locale, MessageKey, PlatformTranslationCatalog, TranslationCatalogMeta, TranslationEntry };
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Locale, TranslationEntry } from "./catalog.js";
|
|
2
|
+
|
|
3
|
+
//#region src/translations/tenant.d.ts
|
|
4
|
+
interface TenantTranslationOverride {
|
|
5
|
+
tenantId: string;
|
|
6
|
+
appId: string;
|
|
7
|
+
blueprintName: string;
|
|
8
|
+
blueprintVersion: number;
|
|
9
|
+
entries: TranslationEntry[];
|
|
10
|
+
defaultLocale?: Locale;
|
|
11
|
+
enabledLocales?: Locale[];
|
|
12
|
+
updatedAt?: string;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { TenantTranslationOverride };
|
|
File without changes
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ConsentDefinition, PolicySpec, RateLimitDefinition } from "./policy/spec.js";
|
|
2
|
+
import { TelemetryTracker } from "./telemetry/tracker.js";
|
|
3
|
+
import "./telemetry/index.js";
|
|
4
|
+
import { ResolvedBranding } from "./app-config/branding.js";
|
|
5
|
+
import { Locale, MessageKey } from "./translations/catalog.js";
|
|
6
|
+
import { ResolvedAppConfig, ResolvedIntegration, ResolvedKnowledge, ResolvedTranslation } from "./app-config/runtime.js";
|
|
7
|
+
import { SecretProvider } from "./integrations/secrets/provider.js";
|
|
8
|
+
import { SpecVariantResolver } from "./experiments/spec-resolver.js";
|
|
9
|
+
import { EventRegistry } from "./events.js";
|
|
10
|
+
|
|
11
|
+
//#region src/types.d.ts
|
|
12
|
+
/**
|
|
13
|
+
* Common runtime types: execution context, policy decision & event emission.
|
|
14
|
+
*/
|
|
15
|
+
type Actor = 'anonymous' | 'user' | 'admin';
|
|
16
|
+
type Channel = 'web' | 'mobile' | 'job' | 'agent';
|
|
17
|
+
type ContractSpecType = 'app-config' | 'agent' | 'operation' | 'example' | 'event' | 'presentation' | 'capability' | 'integration' | 'data-view' | 'feature' | 'workflow' | 'policy' | 'theme' | 'telemetry' | 'experiment' | 'knowledge-space';
|
|
18
|
+
interface FieldLevelDecision {
|
|
19
|
+
field: string;
|
|
20
|
+
effect: 'allow' | 'deny';
|
|
21
|
+
reason?: string;
|
|
22
|
+
}
|
|
23
|
+
interface PolicyDecision {
|
|
24
|
+
effect: 'allow' | 'deny';
|
|
25
|
+
reason?: string;
|
|
26
|
+
rateLimit?: Pick<RateLimitDefinition, 'rpm' | 'key' | 'windowSeconds' | 'burst'>;
|
|
27
|
+
escalate?: 'human_review' | null;
|
|
28
|
+
fieldDecisions?: FieldLevelDecision[];
|
|
29
|
+
pii?: PolicySpec['pii'];
|
|
30
|
+
requiredConsents?: ConsentDefinition[];
|
|
31
|
+
evaluatedBy?: 'engine' | 'opa';
|
|
32
|
+
}
|
|
33
|
+
interface PolicyDeciderInput {
|
|
34
|
+
service: string;
|
|
35
|
+
command: string;
|
|
36
|
+
version: string;
|
|
37
|
+
actor: Actor;
|
|
38
|
+
channel?: Channel;
|
|
39
|
+
roles?: string[];
|
|
40
|
+
organizationId?: string | null;
|
|
41
|
+
userId?: string | null;
|
|
42
|
+
flags?: string[];
|
|
43
|
+
}
|
|
44
|
+
type PolicyDecider = (input: PolicyDeciderInput) => Promise<PolicyDecision>;
|
|
45
|
+
type RateLimiter = (key: string, cost: number, rpm: number) => Promise<void>;
|
|
46
|
+
type TranslationResolver = (key: MessageKey, locale?: Locale) => Promise<string | null> | string | null;
|
|
47
|
+
/** Outbox/bus event publisher (after validation & guarding) */
|
|
48
|
+
type EventPublisher = (envelope: {
|
|
49
|
+
key: string;
|
|
50
|
+
version: string;
|
|
51
|
+
payload: unknown;
|
|
52
|
+
traceId?: string;
|
|
53
|
+
}) => Promise<void>;
|
|
54
|
+
interface HandlerCtx {
|
|
55
|
+
traceId?: string;
|
|
56
|
+
idemKey?: string;
|
|
57
|
+
organizationId?: string | null;
|
|
58
|
+
userId?: string | null;
|
|
59
|
+
actor?: Actor;
|
|
60
|
+
channel?: Channel;
|
|
61
|
+
roles?: string[];
|
|
62
|
+
/** Policy engine hook (policy.yaml) */
|
|
63
|
+
decide?: PolicyDecider;
|
|
64
|
+
/** Rate limiter (e.g., Redis) */
|
|
65
|
+
rateLimit?: RateLimiter;
|
|
66
|
+
/** Telemetry tracker */
|
|
67
|
+
telemetry?: TelemetryTracker;
|
|
68
|
+
/** Event publisher (outbox+bus) */
|
|
69
|
+
eventPublisher?: EventPublisher;
|
|
70
|
+
/** Secret provider for secure credentials */
|
|
71
|
+
secretProvider?: SecretProvider;
|
|
72
|
+
/** Internal pipe: filled by executor to enforce declared events */
|
|
73
|
+
__emitGuard__?: (key: string, version: string, payload: unknown) => Promise<void>;
|
|
74
|
+
/** Resolved application configuration for the current execution context */
|
|
75
|
+
appConfig?: ResolvedAppConfig;
|
|
76
|
+
/** Resolved integration connections available to this execution */
|
|
77
|
+
integrations?: ResolvedIntegration[];
|
|
78
|
+
/** Resolved knowledge spaces available to this execution */
|
|
79
|
+
knowledge?: ResolvedKnowledge[];
|
|
80
|
+
/** Resolved branding context */
|
|
81
|
+
branding?: ResolvedBranding;
|
|
82
|
+
/** Translation context */
|
|
83
|
+
translation?: {
|
|
84
|
+
config: ResolvedTranslation;
|
|
85
|
+
resolve?: TranslationResolver;
|
|
86
|
+
};
|
|
87
|
+
/** Optional spec variant resolver for experiments */
|
|
88
|
+
specVariantResolver?: SpecVariantResolver;
|
|
89
|
+
eventSpecResolver?: EventRegistry;
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { Actor, Channel, ContractSpecType, EventPublisher, FieldLevelDecision, HandlerCtx, PolicyDecider, PolicyDeciderInput, PolicyDecision, RateLimiter, TranslationResolver };
|
package/dist/types.js
ADDED
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ChangeEntry, ChangeType, ChangelogDocBlock, ChangelogEntry, ChangelogJsonExport, ChangelogResult, SemanticVersion, VersionAnalysis, VersionAnalysisResult, VersionBumpType, isChangeType, isChangelogDocBlock, isVersionBumpType } from "./types.js";
|
|
2
|
+
import { bumpVersion, compareVersions, determineBumpType, formatVersion, getBumpTypePriority, getMaxBumpType, isValidVersion, isVersionEqual, isVersionGreater, isVersionLess, parseVersion, parseVersionStrict, validateVersion } from "./utils.js";
|
|
3
|
+
export { ChangeEntry, ChangeType, ChangelogDocBlock, ChangelogEntry, ChangelogJsonExport, ChangelogResult, SemanticVersion, VersionAnalysis, VersionAnalysisResult, VersionBumpType, bumpVersion, compareVersions, determineBumpType, formatVersion, getBumpTypePriority, getMaxBumpType, isChangeType, isChangelogDocBlock, isValidVersion, isVersionBumpType, isVersionEqual, isVersionGreater, isVersionLess, parseVersion, parseVersionStrict, validateVersion };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { isChangeType, isChangelogDocBlock, isVersionBumpType } from "./types.js";
|
|
2
|
+
import { bumpVersion, compareVersions, determineBumpType, formatVersion, getBumpTypePriority, getMaxBumpType, isValidVersion, isVersionEqual, isVersionGreater, isVersionLess, parseVersion, parseVersionStrict, validateVersion } from "./utils.js";
|
|
3
|
+
|
|
4
|
+
export { bumpVersion, compareVersions, determineBumpType, formatVersion, getBumpTypePriority, getMaxBumpType, isChangeType, isChangelogDocBlock, isValidVersion, isVersionBumpType, isVersionEqual, isVersionGreater, isVersionLess, parseVersion, parseVersionStrict, validateVersion };
|