@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,156 @@
|
|
|
1
|
+
import { registerDocBlocks } from "../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/tech/telemetry-ingest.docblock.ts
|
|
4
|
+
const tech_telemetry_ingest_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.telemetry.ingest",
|
|
6
|
+
title: "Telemetry Ingest Endpoint",
|
|
7
|
+
summary: "Server-side telemetry ingestion for ContractSpec clients (VS Code extension, CLI, etc.).",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "internal",
|
|
10
|
+
route: "/docs/tech/telemetry/ingest",
|
|
11
|
+
tags: [
|
|
12
|
+
"telemetry",
|
|
13
|
+
"api",
|
|
14
|
+
"posthog",
|
|
15
|
+
"analytics"
|
|
16
|
+
],
|
|
17
|
+
body: `# Telemetry Ingest Endpoint
|
|
18
|
+
|
|
19
|
+
The ContractSpec API provides a telemetry ingest endpoint for clients to send product analytics events.
|
|
20
|
+
|
|
21
|
+
## Endpoint
|
|
22
|
+
|
|
23
|
+
\`\`\`
|
|
24
|
+
POST /api/telemetry/ingest
|
|
25
|
+
\`\`\`
|
|
26
|
+
|
|
27
|
+
## Request
|
|
28
|
+
|
|
29
|
+
\`\`\`json
|
|
30
|
+
{
|
|
31
|
+
"event": "contractspec.vscode.command_run",
|
|
32
|
+
"distinct_id": "client-uuid",
|
|
33
|
+
"properties": {
|
|
34
|
+
"command": "validate"
|
|
35
|
+
},
|
|
36
|
+
"timestamp": "2024-01-15T10:30:00.000Z"
|
|
37
|
+
}
|
|
38
|
+
\`\`\`
|
|
39
|
+
|
|
40
|
+
### Headers
|
|
41
|
+
|
|
42
|
+
| Header | Description |
|
|
43
|
+
|--------|-------------|
|
|
44
|
+
| \`x-contractspec-client-id\` | Optional client identifier (used as fallback for distinct_id) |
|
|
45
|
+
| \`Content-Type\` | Must be \`application/json\` |
|
|
46
|
+
|
|
47
|
+
### Body
|
|
48
|
+
|
|
49
|
+
| Field | Type | Required | Description |
|
|
50
|
+
|-------|------|----------|-------------|
|
|
51
|
+
| \`event\` | string | Yes | Event name (e.g., \`contractspec.vscode.activated\`) |
|
|
52
|
+
| \`distinct_id\` | string | Yes | Anonymous client identifier |
|
|
53
|
+
| \`properties\` | object | No | Event properties |
|
|
54
|
+
| \`timestamp\` | string | No | ISO 8601 timestamp |
|
|
55
|
+
|
|
56
|
+
## Response
|
|
57
|
+
|
|
58
|
+
\`\`\`json
|
|
59
|
+
{
|
|
60
|
+
"success": true
|
|
61
|
+
}
|
|
62
|
+
\`\`\`
|
|
63
|
+
|
|
64
|
+
## Configuration
|
|
65
|
+
|
|
66
|
+
The endpoint requires \`POSTHOG_PROJECT_KEY\` environment variable to be set. If not configured, events are accepted but not forwarded.
|
|
67
|
+
|
|
68
|
+
| Environment Variable | Description | Default |
|
|
69
|
+
|---------------------|-------------|---------|
|
|
70
|
+
| \`POSTHOG_HOST\` | PostHog host URL | \`https://eu.posthog.com\` |
|
|
71
|
+
| \`POSTHOG_PROJECT_KEY\` | PostHog project API key | (required) |
|
|
72
|
+
|
|
73
|
+
## Privacy
|
|
74
|
+
|
|
75
|
+
- No PII is collected or stored
|
|
76
|
+
- \`distinct_id\` is an anonymous client-generated UUID
|
|
77
|
+
- File paths and source code are never included in events
|
|
78
|
+
- Respects VS Code telemetry settings on the client side
|
|
79
|
+
|
|
80
|
+
## Events
|
|
81
|
+
|
|
82
|
+
### Extension Events
|
|
83
|
+
|
|
84
|
+
| Event | Description | Properties |
|
|
85
|
+
|-------|-------------|------------|
|
|
86
|
+
| \`contractspec.vscode.activated\` | Extension activated | \`version\` |
|
|
87
|
+
| \`contractspec.vscode.command_run\` | Command executed | \`command\` |
|
|
88
|
+
| \`contractspec.vscode.mcp_call\` | MCP call made | \`endpoint\`, \`tool\` |
|
|
89
|
+
|
|
90
|
+
### API Events
|
|
91
|
+
|
|
92
|
+
| Event | Description | Properties |
|
|
93
|
+
|-------|-------------|------------|
|
|
94
|
+
| \`contractspec.api.mcp_request\` | MCP request processed | \`endpoint\`, \`method\`, \`success\`, \`duration_ms\` |
|
|
95
|
+
`
|
|
96
|
+
}, {
|
|
97
|
+
id: "docs.tech.telemetry.hybrid",
|
|
98
|
+
title: "Hybrid Telemetry Model",
|
|
99
|
+
summary: "How ContractSpec clients choose between direct PostHog and API-routed telemetry.",
|
|
100
|
+
kind: "usage",
|
|
101
|
+
visibility: "internal",
|
|
102
|
+
route: "/docs/tech/telemetry/hybrid",
|
|
103
|
+
tags: [
|
|
104
|
+
"telemetry",
|
|
105
|
+
"architecture",
|
|
106
|
+
"posthog"
|
|
107
|
+
],
|
|
108
|
+
body: `# Hybrid Telemetry Model
|
|
109
|
+
|
|
110
|
+
ContractSpec uses a hybrid telemetry model where clients can send events either directly to PostHog or via the API server.
|
|
111
|
+
|
|
112
|
+
## Decision Flow
|
|
113
|
+
|
|
114
|
+
\`\`\`
|
|
115
|
+
Is contractspec.api.baseUrl configured?
|
|
116
|
+
├── Yes → Send via /api/telemetry/ingest
|
|
117
|
+
└── No → Is posthogProjectKey configured?
|
|
118
|
+
├── Yes → Send directly to PostHog
|
|
119
|
+
└── No → Telemetry disabled
|
|
120
|
+
\`\`\`
|
|
121
|
+
|
|
122
|
+
## Benefits
|
|
123
|
+
|
|
124
|
+
### Direct PostHog
|
|
125
|
+
- No server dependency
|
|
126
|
+
- Works offline (with batching)
|
|
127
|
+
- Lower latency
|
|
128
|
+
|
|
129
|
+
### Via API
|
|
130
|
+
- Centralized key management (no client-side keys)
|
|
131
|
+
- Server-side enrichment and validation
|
|
132
|
+
- Rate limiting and abuse prevention
|
|
133
|
+
- Easier migration to other providers
|
|
134
|
+
|
|
135
|
+
## Recommendation
|
|
136
|
+
|
|
137
|
+
- **Development**: Use direct PostHog with a dev project key
|
|
138
|
+
- **Production**: Route via API for better governance
|
|
139
|
+
|
|
140
|
+
## Future: OpenTelemetry
|
|
141
|
+
|
|
142
|
+
The current PostHog implementation is behind a simple interface that can be swapped for OpenTelemetry:
|
|
143
|
+
|
|
144
|
+
\`\`\`typescript
|
|
145
|
+
interface TelemetryClient {
|
|
146
|
+
send(event: TelemetryEvent): Promise<void>;
|
|
147
|
+
}
|
|
148
|
+
\`\`\`
|
|
149
|
+
|
|
150
|
+
This allows future migration without changing client code.
|
|
151
|
+
`
|
|
152
|
+
}];
|
|
153
|
+
registerDocBlocks(tech_telemetry_ingest_DocBlocks);
|
|
154
|
+
|
|
155
|
+
//#endregion
|
|
156
|
+
export { tech_telemetry_ingest_DocBlocks };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { registerDocBlocks } from "../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/tech/vscode-extension.docblock.ts
|
|
4
|
+
const tech_vscode_extension_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.vscode.extension",
|
|
6
|
+
title: "ContractSpec VS Code Extension",
|
|
7
|
+
summary: "VS Code extension for spec-first development with validation, scaffolding, and MCP integration.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/vscode/extension",
|
|
11
|
+
tags: [
|
|
12
|
+
"vscode",
|
|
13
|
+
"extension",
|
|
14
|
+
"tooling",
|
|
15
|
+
"dx"
|
|
16
|
+
],
|
|
17
|
+
body: `# ContractSpec VS Code Extension
|
|
18
|
+
|
|
19
|
+
The ContractSpec VS Code extension provides spec-first development tooling directly in your editor.
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- **Real-time Validation**: Get instant feedback on spec errors and warnings as you save files
|
|
24
|
+
- **Build/Scaffold**: Generate handler and component skeletons from specs (no AI required)
|
|
25
|
+
- **Spec Explorer**: List and navigate all specs in your workspace
|
|
26
|
+
- **Dependency Analysis**: Visualize spec dependencies and detect cycles
|
|
27
|
+
- **MCP Integration**: Search ContractSpec documentation via Model Context Protocol
|
|
28
|
+
- **Snippets**: Code snippets for common ContractSpec patterns
|
|
29
|
+
|
|
30
|
+
## Commands
|
|
31
|
+
|
|
32
|
+
| Command | Description |
|
|
33
|
+
|---------|-------------|
|
|
34
|
+
| \`ContractSpec: Validate Current Spec\` | Validate the currently open spec file |
|
|
35
|
+
| \`ContractSpec: Validate All Specs\` | Validate all spec files in the workspace |
|
|
36
|
+
| \`ContractSpec: Build/Scaffold\` | Generate handler/component from the current spec |
|
|
37
|
+
| \`ContractSpec: List All Specs\` | Show all specs in the workspace |
|
|
38
|
+
| \`ContractSpec: Analyze Dependencies\` | Analyze and visualize spec dependencies |
|
|
39
|
+
| \`ContractSpec: Search Docs (MCP)\` | Search documentation via MCP |
|
|
40
|
+
|
|
41
|
+
## Configuration
|
|
42
|
+
|
|
43
|
+
| Setting | Description | Default |
|
|
44
|
+
|---------|-------------|---------|
|
|
45
|
+
| \`contractspec.api.baseUrl\` | Base URL for ContractSpec API (enables MCP + remote telemetry) | \`""\` |
|
|
46
|
+
| \`contractspec.telemetry.posthogHost\` | PostHog host URL for direct telemetry | \`"https://eu.posthog.com"\` |
|
|
47
|
+
| \`contractspec.telemetry.posthogProjectKey\` | PostHog project key for direct telemetry | \`""\` |
|
|
48
|
+
| \`contractspec.validation.onSave\` | Run validation on save | \`true\` |
|
|
49
|
+
| \`contractspec.validation.onOpen\` | Run validation on open | \`true\` |
|
|
50
|
+
|
|
51
|
+
## Architecture
|
|
52
|
+
|
|
53
|
+
The extension uses:
|
|
54
|
+
- \`@contractspec/module.workspace\` for pure analysis + templates
|
|
55
|
+
- \`@contractspec/bundle.workspace\` for workspace services + adapters
|
|
56
|
+
|
|
57
|
+
This allows the extension to work without requiring the CLI to be installed.
|
|
58
|
+
|
|
59
|
+
## Telemetry
|
|
60
|
+
|
|
61
|
+
The extension uses a hybrid telemetry approach:
|
|
62
|
+
1. If \`contractspec.api.baseUrl\` is configured → send to API \`/api/telemetry/ingest\`
|
|
63
|
+
2. Otherwise → send directly to PostHog (if project key configured)
|
|
64
|
+
|
|
65
|
+
Telemetry respects VS Code's telemetry settings. No file paths, source code, or PII is collected.
|
|
66
|
+
`
|
|
67
|
+
}, {
|
|
68
|
+
id: "docs.tech.vscode.snippets",
|
|
69
|
+
title: "ContractSpec Snippets",
|
|
70
|
+
summary: "Code snippets for common ContractSpec patterns in VS Code.",
|
|
71
|
+
kind: "reference",
|
|
72
|
+
visibility: "public",
|
|
73
|
+
route: "/docs/tech/vscode/snippets",
|
|
74
|
+
tags: [
|
|
75
|
+
"vscode",
|
|
76
|
+
"snippets",
|
|
77
|
+
"dx"
|
|
78
|
+
],
|
|
79
|
+
body: `# ContractSpec Snippets
|
|
80
|
+
|
|
81
|
+
The VS Code extension includes snippets for common ContractSpec patterns.
|
|
82
|
+
|
|
83
|
+
## Available Snippets
|
|
84
|
+
|
|
85
|
+
| Prefix | Description |
|
|
86
|
+
|--------|-------------|
|
|
87
|
+
| \`contractspec-command\` | Create a new command (write operation) |
|
|
88
|
+
| \`contractspec-query\` | Create a new query (read-only operation) |
|
|
89
|
+
| \`contractspec-event\` | Create a new event |
|
|
90
|
+
| \`contractspec-docblock\` | Create a new DocBlock |
|
|
91
|
+
| \`contractspec-telemetry\` | Create a new TelemetrySpec |
|
|
92
|
+
| \`contractspec-presentation\` | Create a new Presentation |
|
|
93
|
+
|
|
94
|
+
## Usage
|
|
95
|
+
|
|
96
|
+
Type the prefix in a TypeScript file and press Tab to expand the snippet. Tab through the placeholders to fill in your values.
|
|
97
|
+
`
|
|
98
|
+
}];
|
|
99
|
+
registerDocBlocks(tech_vscode_extension_DocBlocks);
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
export { tech_vscode_extension_DocBlocks };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { registerDocBlocks } from "./registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/tech-contracts.docs.ts
|
|
4
|
+
const techContractsDocs = [{
|
|
5
|
+
id: "docs.tech.contracts.presentations",
|
|
6
|
+
title: "Presentations — Unified Descriptor & Transform Engine",
|
|
7
|
+
summary: "How PresentationSpec and TransformEngine keep docs/renderers consistent.",
|
|
8
|
+
visibility: "public",
|
|
9
|
+
route: "/docs/tech/contracts/presentations",
|
|
10
|
+
kind: "reference",
|
|
11
|
+
tags: [
|
|
12
|
+
"presentations",
|
|
13
|
+
"docs",
|
|
14
|
+
"mcp"
|
|
15
|
+
],
|
|
16
|
+
body: `## Presentations V2 — Unified Descriptor & Transform Engine
|
|
17
|
+
|
|
18
|
+
### Purpose
|
|
19
|
+
|
|
20
|
+
Unify presentations into one descriptor (\`PresentationSpec\`) that declares a single source (React component key or BlockNote doc) and a list of output targets (react, markdown, application/json, application/xml). A pluggable \`TransformEngine\` renders any target and applies PII redaction.
|
|
21
|
+
|
|
22
|
+
### Types
|
|
23
|
+
|
|
24
|
+
\`\`\`ts
|
|
25
|
+
type PresentationTarget =
|
|
26
|
+
| 'react'
|
|
27
|
+
| 'markdown'
|
|
28
|
+
| 'application/json'
|
|
29
|
+
| 'application/xml';
|
|
30
|
+
|
|
31
|
+
type PresentationSource =
|
|
32
|
+
| {
|
|
33
|
+
type: 'component';
|
|
34
|
+
framework: 'react';
|
|
35
|
+
componentKey: string;
|
|
36
|
+
props?: AnySchemaModel;
|
|
37
|
+
}
|
|
38
|
+
| { type: 'blocknotejs'; docJson: unknown; blockConfig?: unknown };
|
|
39
|
+
|
|
40
|
+
interface PresentationSpec {
|
|
41
|
+
meta: PresentationMeta; // includes partial OwnerShipMeta + description
|
|
42
|
+
policy?: { flags?: string[]; pii?: string[] };
|
|
43
|
+
source: PresentationSource;
|
|
44
|
+
targets: PresentationTarget[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Shared ownership schema (source of truth in @contractspec/lib.contracts/src/ownership.ts)
|
|
48
|
+
interface OwnerShipMeta {
|
|
49
|
+
title: string;
|
|
50
|
+
description: string;
|
|
51
|
+
domain: string;
|
|
52
|
+
owners: Owner[];
|
|
53
|
+
tags: Tag[];
|
|
54
|
+
stability: Stability;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type Stability = 'experimental' | 'beta' | 'stable' | 'deprecated';
|
|
58
|
+
type Owner = string; // curated list available in code (e.g., '@sigil-team', 'team-strit')
|
|
59
|
+
type Tag = string; // curated list available in code (e.g., 'auth', 'spots')
|
|
60
|
+
|
|
61
|
+
// For presentations, meta is a Partial<OwnerShipMeta> plus description, name, version
|
|
62
|
+
interface PresentationMeta extends Partial<OwnerShipMeta> {
|
|
63
|
+
name: string;
|
|
64
|
+
version: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
}
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
### Engine
|
|
70
|
+
|
|
71
|
+
Use \`createDefaultTransformEngine()\` and register custom renderers as needed (e.g., high-fidelity BlockNote → Markdown). The default engine supports markdown/json/xml; a React renderer returns a serializable descriptor the host app renders via a \`componentMap\` or a BlockNote renderer. The canonical source type string is \`blocknotejs\` (not \`blocknote\`).
|
|
72
|
+
|
|
73
|
+
PII paths (JSON-like) are redacted from rendered outputs.
|
|
74
|
+
|
|
75
|
+
### MCP Integration
|
|
76
|
+
|
|
77
|
+
\`createMcpServer\` accepts \`presentationsV2\`. Each descriptor is exposed under \`presentation://<name>/v<version>\` and negotiated variants (\`.md/.json/.xml\`) are rendered by the engine.
|
|
78
|
+
|
|
79
|
+
### Migration
|
|
80
|
+
|
|
81
|
+
- V1 \`PresentationSpec\` remains supported; a back-compat helper converts V1 → V2 when convenient.
|
|
82
|
+
- Prefer V2 for new work.
|
|
83
|
+
|
|
84
|
+
### Examples (Sigil)
|
|
85
|
+
|
|
86
|
+
- \`sigil.auth.webauth_tabs_v2\`: component source (\`componentKey: 'sigil.webauth.tabs'\`), targets \`react/json/xml\`.
|
|
87
|
+
- \`sigil.signup.guide_v2\`: BlockNote doc source, targets \`react/markdown/json/xml\`.
|
|
88
|
+
|
|
89
|
+
### React Rendering
|
|
90
|
+
|
|
91
|
+
Host apps use a \`componentMap\` (e.g., \`'sigil.webauth.tabs' → WebAuthTabs\`) and a BlockNote renderer to turn the React render descriptor into elements.`
|
|
92
|
+
}];
|
|
93
|
+
registerDocBlocks(techContractsDocs);
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
export { techContractsDocs };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Stability } from "../ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/types.d.ts
|
|
4
|
+
type DocVisibility = 'public' | 'internal' | 'mixed';
|
|
5
|
+
interface DocBlockLink {
|
|
6
|
+
label: string;
|
|
7
|
+
href: string;
|
|
8
|
+
}
|
|
9
|
+
type DocKind = 'goal' | 'how' | 'usage' | 'reference' | 'faq' | 'changelog';
|
|
10
|
+
interface DocBlock {
|
|
11
|
+
/** Globally unique identifier (prefer dotted paths like docs.ops.runbook). */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Short, human-readable title. */
|
|
14
|
+
title: string;
|
|
15
|
+
/** Markdown body (LLM- and human-readable). */
|
|
16
|
+
body: string;
|
|
17
|
+
/** Optional one-line summary used for meta.description. */
|
|
18
|
+
summary?: string;
|
|
19
|
+
/** Explicit route (e.g., /docs/ops/anomaly-detection). Falls back to id-derived route. */
|
|
20
|
+
route?: string;
|
|
21
|
+
/** Optional semantic grouping for filtering. */
|
|
22
|
+
kind?: DocKind;
|
|
23
|
+
/** Visibility gate. Defaults to public. */
|
|
24
|
+
visibility?: DocVisibility;
|
|
25
|
+
/** Optional version to allow evolutions without breaking links. Defaults to 1. */
|
|
26
|
+
version?: string;
|
|
27
|
+
/** Tags to aid discovery and filtering. */
|
|
28
|
+
tags?: string[];
|
|
29
|
+
/** Owning teams or individuals. */
|
|
30
|
+
owners?: string[];
|
|
31
|
+
/** Related contract/presentation identifiers. */
|
|
32
|
+
relatedSpecs?: string[];
|
|
33
|
+
/** External references or supporting links. */
|
|
34
|
+
links?: DocBlockLink[];
|
|
35
|
+
/** Domain or bounded context marker. */
|
|
36
|
+
domain?: string;
|
|
37
|
+
/** Stability marker to mirror presentation ownership semantics. */
|
|
38
|
+
stability?: Stability;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { DocBlock, DocBlockLink, DocKind, DocVisibility };
|
|
File without changes
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DocId } from "./docs/registry.js";
|
|
2
|
+
import { OwnerShipMeta } from "./ownership.js";
|
|
3
|
+
import { SpecContractRegistry } from "./registry.js";
|
|
4
|
+
import { AnySchemaModel } from "@contractspec/lib.schema";
|
|
5
|
+
|
|
6
|
+
//#region src/events.d.ts
|
|
7
|
+
interface EventSpecMeta extends Omit<OwnerShipMeta, 'docId'> {
|
|
8
|
+
/** Doc block(s) for this operation. */
|
|
9
|
+
docId?: DocId[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Typed event specification. Declare once, validate payloads at publish time,
|
|
13
|
+
* and guard emissions via the contracts runtime.
|
|
14
|
+
*/
|
|
15
|
+
interface EventSpec<T extends AnySchemaModel> {
|
|
16
|
+
meta: EventSpecMeta;
|
|
17
|
+
/** JSON-like paths to redact from logs/exports. */
|
|
18
|
+
pii?: string[];
|
|
19
|
+
/** Event payload schema from @contractspec/lib.schema. */
|
|
20
|
+
payload: T;
|
|
21
|
+
}
|
|
22
|
+
type AnyEventSpec<T extends AnySchemaModel = AnySchemaModel> = EventSpec<T>;
|
|
23
|
+
/** Identity function to keep type inference when declaring events. */
|
|
24
|
+
declare function defineEvent<T extends AnySchemaModel>(e: EventSpec<T>): EventSpec<T>;
|
|
25
|
+
interface EventEnvelope<T> {
|
|
26
|
+
/** Unique identifier for the published event (UUID recommended). */
|
|
27
|
+
id: string;
|
|
28
|
+
/** ISO timestamp when the event occurred. */
|
|
29
|
+
occurredAt: string;
|
|
30
|
+
/** Optional trace identifier for correlating across services. */
|
|
31
|
+
traceId?: string;
|
|
32
|
+
/** Event name as published (should match spec.name). */
|
|
33
|
+
key: string;
|
|
34
|
+
/** Event version as published (should match spec.version). */
|
|
35
|
+
version: string;
|
|
36
|
+
/** Validated payload. */
|
|
37
|
+
payload: T;
|
|
38
|
+
}
|
|
39
|
+
type EventKey = `${string}.v${string}`;
|
|
40
|
+
/** Build a stable string key for an event name/version pair. */
|
|
41
|
+
declare const eventKey: (key: string, version: string) => EventKey;
|
|
42
|
+
/** In-memory registry for EventSpec. */
|
|
43
|
+
declare class EventRegistry extends SpecContractRegistry<'event', AnyEventSpec> {
|
|
44
|
+
constructor(items?: AnyEventSpec[]);
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { AnyEventSpec, EventEnvelope, EventKey, EventRegistry, EventSpec, EventSpecMeta, defineEvent, eventKey };
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SpecContractRegistry } from "./registry.js";
|
|
2
|
+
import "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/events.ts
|
|
5
|
+
/** Identity function to keep type inference when declaring events. */
|
|
6
|
+
function defineEvent(e) {
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
/** Build a stable string key for an event name/version pair. */
|
|
10
|
+
const eventKey = (key, version) => `${key}.v${version}`;
|
|
11
|
+
/** In-memory registry for EventSpec. */
|
|
12
|
+
var EventRegistry = class extends SpecContractRegistry {
|
|
13
|
+
constructor(items) {
|
|
14
|
+
super("event", items);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { EventRegistry, defineEvent, eventKey };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { registerDocBlocks } from "../../docs/registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/examples/docs/examples.docblock.ts
|
|
4
|
+
const tech_contracts_examples_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.contracts.examples",
|
|
6
|
+
title: "Example Specifications",
|
|
7
|
+
summary: "ExampleSpec defines complete, demonstrable ContractSpec applications.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/contracts/examples",
|
|
11
|
+
tags: [
|
|
12
|
+
"tech",
|
|
13
|
+
"contracts",
|
|
14
|
+
"examples",
|
|
15
|
+
"templates"
|
|
16
|
+
],
|
|
17
|
+
body: `## Example Specifications
|
|
18
|
+
|
|
19
|
+
ExampleSpec is a contract for defining complete, demonstrable ContractSpec applications. Examples integrate with AppBlueprintSpec and FeatureModuleSpec to provide a full application specification.
|
|
20
|
+
|
|
21
|
+
### Overview
|
|
22
|
+
|
|
23
|
+
An \`ExampleSpec\` captures:
|
|
24
|
+
- **Metadata** (via \`ExampleMeta\` extending \`OwnerShipMeta\`): key, version, title, description, ownership, tags, stability
|
|
25
|
+
- **Example-specific fields**: kind, visibility, summary
|
|
26
|
+
- **Surfaces**: where the example can be used (templates, sandbox, studio, MCP)
|
|
27
|
+
- **Entrypoints**: package exports mapping
|
|
28
|
+
- **Blueprint**: optional AppBlueprintSpec or reference
|
|
29
|
+
- **Features**: optional FeatureModuleSpec array or references
|
|
30
|
+
|
|
31
|
+
### Usage
|
|
32
|
+
|
|
33
|
+
\`\`\`typescript
|
|
34
|
+
import type { ExampleSpec } from '@contractspec/lib.contracts';
|
|
35
|
+
import { ExampleRegistry, validateExample } from '@contractspec/lib.contracts';
|
|
36
|
+
|
|
37
|
+
const example: ExampleSpec = {
|
|
38
|
+
meta: {
|
|
39
|
+
key: 'saas-boilerplate',
|
|
40
|
+
version: '1.0.0',
|
|
41
|
+
title: 'SaaS Boilerplate',
|
|
42
|
+
description: 'Multi-tenant SaaS foundation with billing and RBAC.',
|
|
43
|
+
kind: 'template',
|
|
44
|
+
visibility: 'public',
|
|
45
|
+
stability: 'experimental',
|
|
46
|
+
owners: ['@saas-team'],
|
|
47
|
+
tags: ['saas', 'multi-tenant', 'billing'],
|
|
48
|
+
summary: 'Complete SaaS starter.',
|
|
49
|
+
},
|
|
50
|
+
surfaces: {
|
|
51
|
+
templates: true,
|
|
52
|
+
sandbox: { enabled: true, modes: ['playground', 'specs', 'builder'] },
|
|
53
|
+
studio: { enabled: true, installable: true },
|
|
54
|
+
mcp: { enabled: true },
|
|
55
|
+
},
|
|
56
|
+
entrypoints: {
|
|
57
|
+
packageName: '@contractspec/example.saas-boilerplate',
|
|
58
|
+
feature: './saas-boilerplate.feature',
|
|
59
|
+
contracts: './contracts',
|
|
60
|
+
},
|
|
61
|
+
features: [SaasBoilerplateFeature],
|
|
62
|
+
};
|
|
63
|
+
\`\`\`
|
|
64
|
+
|
|
65
|
+
### ExampleRegistry
|
|
66
|
+
|
|
67
|
+
Use \`ExampleRegistry\` to manage examples:
|
|
68
|
+
|
|
69
|
+
\`\`\`typescript
|
|
70
|
+
const registry = new ExampleRegistry();
|
|
71
|
+
registry.register(example);
|
|
72
|
+
|
|
73
|
+
// Query examples
|
|
74
|
+
registry.listByKind('template');
|
|
75
|
+
registry.listByVisibility('public');
|
|
76
|
+
registry.listBySurface('studio');
|
|
77
|
+
registry.listInstallable();
|
|
78
|
+
registry.search('billing');
|
|
79
|
+
\`\`\`
|
|
80
|
+
|
|
81
|
+
### ExampleMeta
|
|
82
|
+
|
|
83
|
+
\`ExampleMeta\` extends \`OwnerShipMeta\` with example-specific fields:
|
|
84
|
+
|
|
85
|
+
| Field | Type | Description |
|
|
86
|
+
|-------|------|-------------|
|
|
87
|
+
| key | string | Unique identifier |
|
|
88
|
+
| version | number | Spec version |
|
|
89
|
+
| title | string? | Human-readable title |
|
|
90
|
+
| description | string | Technical description |
|
|
91
|
+
| kind | ExampleKind | template, workflow, integration, etc. |
|
|
92
|
+
| visibility | ExampleVisibility | public, internal, experimental |
|
|
93
|
+
| stability | Stability | idea, experimental, beta, stable, deprecated |
|
|
94
|
+
| owners | string[] | Owner identifiers |
|
|
95
|
+
| tags | string[] | Discovery tags |
|
|
96
|
+
| summary | string? | Marketing summary |
|
|
97
|
+
|
|
98
|
+
### ExampleKind
|
|
99
|
+
|
|
100
|
+
| Kind | Use Case |
|
|
101
|
+
|------|----------|
|
|
102
|
+
| template | Full application template |
|
|
103
|
+
| workflow | Workflow automation example |
|
|
104
|
+
| integration | Integration showcase |
|
|
105
|
+
| knowledge | Knowledge base example |
|
|
106
|
+
| blueprint | App blueprint example |
|
|
107
|
+
| ui | UI component showcase |
|
|
108
|
+
| script | CLI/script example |
|
|
109
|
+
| library | Library/SDK example |
|
|
110
|
+
|
|
111
|
+
### Surfaces
|
|
112
|
+
|
|
113
|
+
| Surface | Purpose |
|
|
114
|
+
|---------|---------|
|
|
115
|
+
| templates | Available as new project template |
|
|
116
|
+
| sandbox | Interactive playground support |
|
|
117
|
+
| studio | ContractSpec Studio support |
|
|
118
|
+
| mcp | Model Context Protocol support |
|
|
119
|
+
|
|
120
|
+
### Validation
|
|
121
|
+
|
|
122
|
+
\`\`\`typescript
|
|
123
|
+
import { validateExample, validateExamples } from '@contractspec/lib.contracts';
|
|
124
|
+
|
|
125
|
+
const result = validateExample(example);
|
|
126
|
+
if (!result.valid) {
|
|
127
|
+
console.error(result.errors);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Batch validation with duplicate detection
|
|
131
|
+
const batchResult = validateExamples([example1, example2]);
|
|
132
|
+
\`\`\`
|
|
133
|
+
|
|
134
|
+
### Integration with Blueprints and Features
|
|
135
|
+
|
|
136
|
+
Examples can reference or embed blueprints and features:
|
|
137
|
+
|
|
138
|
+
\`\`\`typescript
|
|
139
|
+
const example: ExampleSpec = {
|
|
140
|
+
// ... meta, surfaces, entrypoints
|
|
141
|
+
|
|
142
|
+
// Inline blueprint
|
|
143
|
+
blueprint: myAppBlueprint,
|
|
144
|
+
|
|
145
|
+
// Or reference by pointer
|
|
146
|
+
blueprint: { key: 'core.app', version: '1.0.0' },
|
|
147
|
+
|
|
148
|
+
// Inline features
|
|
149
|
+
features: [MyFeature],
|
|
150
|
+
|
|
151
|
+
// Or reference
|
|
152
|
+
features: [{ key: 'my-feature' }],
|
|
153
|
+
};
|
|
154
|
+
\`\`\`
|
|
155
|
+
|
|
156
|
+
### Related
|
|
157
|
+
|
|
158
|
+
- [App Configuration](file:///docs/tech/contracts/app-config) - AppBlueprintSpec
|
|
159
|
+
- [Features](file:///docs/tech/contracts/features) - FeatureModuleSpec
|
|
160
|
+
`
|
|
161
|
+
}];
|
|
162
|
+
registerDocBlocks(tech_contracts_examples_DocBlocks);
|
|
163
|
+
|
|
164
|
+
//#endregion
|
|
165
|
+
export { tech_contracts_examples_DocBlocks };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExampleDocumentation, ExampleEntrypoints, ExampleKind, ExampleKindEnum, ExampleMcpSupport, ExampleMeta, ExampleSandboxMode, ExampleSandboxModeEnum, ExampleSandboxSupport, ExampleSpec, ExampleStudioSupport, ExampleSurfaces, ExampleVisibility, ExampleVisibilityEnum, isExampleKind, isExampleVisibility, isFeatureRef, isSpecPointer } from "./types.js";
|
|
2
|
+
import { ExampleDocumentationSchema, ExampleEntrypointsSchema, ExampleKindSchema, ExampleMetaSchema, ExampleSandboxModeSchema, ExampleSpecSchema, ExampleSurfacesSchema, ExampleVisibilitySchema, parseExampleDocumentation, parseExampleEntrypoints, parseExampleMeta, parseExampleSpec, parseExampleSurfaces, safeParseExampleSpec } from "./schema.js";
|
|
3
|
+
import { ExampleRegistry } from "./registry.js";
|
|
4
|
+
import { CrossValidationContext, ExampleValidationError, ExampleValidationWarning, ValidateExampleResult, ValidateExamplesResult, validateExample, validateExampleReferences, validateExamples } from "./validation.js";
|
|
5
|
+
|
|
6
|
+
//#region src/examples/index.d.ts
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Helper to define an Example.
|
|
10
|
+
*/
|
|
11
|
+
declare const defineExample: (spec: ExampleSpec) => ExampleSpec;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { type CrossValidationContext, type ExampleDocumentation, ExampleDocumentationSchema, type ExampleEntrypoints, ExampleEntrypointsSchema, type ExampleKind, ExampleKindEnum, ExampleKindSchema, type ExampleMcpSupport, type ExampleMeta, ExampleMetaSchema, ExampleRegistry, type ExampleSandboxMode, ExampleSandboxModeEnum, ExampleSandboxModeSchema, type ExampleSandboxSupport, type ExampleSpec, ExampleSpecSchema, type ExampleStudioSupport, type ExampleSurfaces, ExampleSurfacesSchema, type ExampleValidationError, type ExampleValidationWarning, type ExampleVisibility, ExampleVisibilityEnum, ExampleVisibilitySchema, type ValidateExampleResult, type ValidateExamplesResult, defineExample, isExampleKind, isExampleVisibility, isFeatureRef, isSpecPointer, parseExampleDocumentation, parseExampleEntrypoints, parseExampleMeta, parseExampleSpec, parseExampleSurfaces, safeParseExampleSpec, validateExample, validateExampleReferences, validateExamples };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExampleKindEnum, ExampleSandboxModeEnum, ExampleVisibilityEnum, isExampleKind, isExampleVisibility, isFeatureRef, isSpecPointer } from "./types.js";
|
|
2
|
+
import { ExampleDocumentationSchema, ExampleEntrypointsSchema, ExampleKindSchema, ExampleMetaSchema, ExampleSandboxModeSchema, ExampleSpecSchema, ExampleSurfacesSchema, ExampleVisibilitySchema, parseExampleDocumentation, parseExampleEntrypoints, parseExampleMeta, parseExampleSpec, parseExampleSurfaces, safeParseExampleSpec } from "./schema.js";
|
|
3
|
+
import { ExampleRegistry } from "./registry.js";
|
|
4
|
+
import { validateExample, validateExampleReferences, validateExamples } from "./validation.js";
|
|
5
|
+
|
|
6
|
+
//#region src/examples/index.ts
|
|
7
|
+
/**
|
|
8
|
+
* Helper to define an Example.
|
|
9
|
+
*/
|
|
10
|
+
const defineExample = (spec) => spec;
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ExampleDocumentationSchema, ExampleEntrypointsSchema, ExampleKindEnum, ExampleKindSchema, ExampleMetaSchema, ExampleRegistry, ExampleSandboxModeEnum, ExampleSandboxModeSchema, ExampleSpecSchema, ExampleSurfacesSchema, ExampleVisibilityEnum, ExampleVisibilitySchema, defineExample, isExampleKind, isExampleVisibility, isFeatureRef, isSpecPointer, parseExampleDocumentation, parseExampleEntrypoints, parseExampleMeta, parseExampleSpec, parseExampleSurfaces, safeParseExampleSpec, validateExample, validateExampleReferences, validateExamples };
|