@contractspec/lib.contracts-spec 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/app-config/app-config.capability.d.ts +1 -0
- package/dist/app-config/app-config.capability.js +730 -0
- package/dist/app-config/app-config.contracts.d.ts +239 -0
- package/dist/app-config/app-config.contracts.js +713 -0
- package/dist/app-config/app-config.contracts.test.d.ts +1 -0
- package/dist/app-config/app-config.feature.d.ts +5 -0
- package/dist/app-config/app-config.feature.js +255 -0
- package/dist/app-config/branding.d.ts +52 -0
- package/dist/app-config/branding.js +1 -0
- package/dist/app-config/branding.test.d.ts +1 -0
- package/dist/app-config/docs/app-config.docblock.d.ts +2 -0
- package/dist/app-config/docs/app-config.docblock.js +383 -0
- package/dist/app-config/events.d.ts +115 -0
- package/dist/app-config/events.js +386 -0
- package/dist/app-config/events.test.d.ts +1 -0
- package/dist/app-config/index.d.ts +9 -0
- package/dist/app-config/index.js +2899 -0
- package/dist/app-config/lifecycle-contracts.d.ts +265 -0
- package/dist/app-config/lifecycle-contracts.js +870 -0
- package/dist/app-config/lifecycle-contracts.test.d.ts +1 -0
- package/dist/app-config/lifecycle.d.ts +23 -0
- package/dist/app-config/lifecycle.js +1 -0
- package/dist/app-config/lifecycle.test.d.ts +1 -0
- package/dist/app-config/runtime.d.ts +111 -0
- package/dist/app-config/runtime.js +734 -0
- package/dist/app-config/runtime.test.d.ts +1 -0
- package/dist/app-config/spec.d.ts +169 -0
- package/dist/app-config/spec.js +229 -0
- package/dist/app-config/spec.test.d.ts +1 -0
- package/dist/app-config/validation.d.ts +43 -0
- package/dist/app-config/validation.js +650 -0
- package/dist/app-config/validation.test.d.ts +1 -0
- package/dist/capabilities/capabilities.d.ts +96 -0
- package/dist/capabilities/capabilities.js +217 -0
- package/dist/capabilities/capabilities.test.d.ts +1 -0
- package/dist/capabilities/context.d.ts +110 -0
- package/dist/capabilities/context.js +101 -0
- package/dist/capabilities/context.test.d.ts +1 -0
- package/dist/capabilities/docs/capabilities.docblock.d.ts +2 -0
- package/dist/capabilities/docs/capabilities.docblock.js +353 -0
- package/dist/capabilities/guards.d.ts +121 -0
- package/dist/capabilities/guards.js +177 -0
- package/dist/capabilities/index.d.ts +6 -0
- package/dist/capabilities/index.js +739 -0
- package/dist/capabilities/meeting-recorder.d.ts +5 -0
- package/dist/capabilities/meeting-recorder.js +154 -0
- package/dist/capabilities/openbanking.d.ts +5 -0
- package/dist/capabilities/openbanking.js +166 -0
- package/dist/capabilities/validation.d.ts +79 -0
- package/dist/capabilities/validation.js +185 -0
- package/dist/capabilities/validation.test.d.ts +1 -0
- package/dist/contract-registry/index.d.ts +3 -0
- package/dist/contract-registry/index.js +129 -0
- package/dist/contract-registry/schemas.d.ts +120 -0
- package/dist/contract-registry/schemas.js +129 -0
- package/dist/contract-registry/schemas.test.d.ts +1 -0
- package/dist/contract-registry/types.d.ts +42 -0
- package/dist/contract-registry/types.js +1 -0
- package/dist/data-views/data-views.d.ts +4 -0
- package/dist/data-views/data-views.js +232 -0
- package/dist/data-views/data-views.test.d.ts +1 -0
- package/dist/data-views/docs/data-views.docblock.d.ts +2 -0
- package/dist/data-views/docs/data-views.docblock.js +164 -0
- package/dist/data-views/index.d.ts +4 -0
- package/dist/data-views/index.js +232 -0
- package/dist/data-views/query-generator.d.ts +35 -0
- package/dist/data-views/query-generator.js +89 -0
- package/dist/data-views/registry.d.ts +12 -0
- package/dist/data-views/registry.js +226 -0
- package/dist/data-views/registry.test.d.ts +1 -0
- package/dist/data-views/report/contractVerificationTable.d.ts +4 -0
- package/dist/data-views/report/contractVerificationTable.js +240 -0
- package/dist/data-views/report/contractVerificationTable.test.d.ts +1 -0
- package/dist/data-views/runtime.d.ts +25 -0
- package/dist/data-views/runtime.js +108 -0
- package/dist/data-views/runtime.test.d.ts +1 -0
- package/dist/data-views/spec.d.ts +22 -0
- package/dist/data-views/spec.js +38 -0
- package/dist/data-views/spec.test.d.ts +1 -0
- package/dist/data-views/types.d.ts +152 -0
- package/dist/data-views/types.js +1 -0
- package/dist/data-views/types.test.d.ts +1 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.d.ts +2 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +513 -0
- package/dist/docs/capabilities/documentationSystem.capability.d.ts +1 -0
- package/dist/docs/capabilities/documentationSystem.capability.js +784 -0
- package/dist/docs/capabilities/index.d.ts +1 -0
- package/dist/docs/capabilities/index.js +784 -0
- package/dist/docs/commands/docsGenerate.command.d.ts +88 -0
- package/dist/docs/commands/docsGenerate.command.js +802 -0
- package/dist/docs/commands/docsPublish.command.d.ts +57 -0
- package/dist/docs/commands/docsPublish.command.js +781 -0
- package/dist/docs/commands/index.d.ts +2 -0
- package/dist/docs/commands/index.js +906 -0
- package/dist/docs/constants.d.ts +4 -0
- package/dist/docs/constants.js +78 -0
- package/dist/docs/contracts.d.ts +430 -0
- package/dist/docs/contracts.js +1611 -0
- package/dist/docs/ensure-docblocks.d.ts +1 -0
- package/dist/docs/ensure-docblocks.js +264 -0
- package/dist/docs/events/docsGenerated.event.d.ts +56 -0
- package/dist/docs/events/docsGenerated.event.js +533 -0
- package/dist/docs/events/docsPublished.event.d.ts +64 -0
- package/dist/docs/events/docsPublished.event.js +534 -0
- package/dist/docs/events/index.d.ts +2 -0
- package/dist/docs/events/index.js +567 -0
- package/dist/docs/forms/docsSearch.form.d.ts +16 -0
- package/dist/docs/forms/docsSearch.form.js +676 -0
- package/dist/docs/forms/index.d.ts +1 -0
- package/dist/docs/forms/index.js +676 -0
- package/dist/docs/index.d.ts +40 -0
- package/dist/docs/index.js +4719 -0
- package/dist/docs/meta.docs.d.ts +2 -0
- package/dist/docs/meta.docs.js +176 -0
- package/dist/docs/presentations/docsLayout.presentation.d.ts +2 -0
- package/dist/docs/presentations/docsLayout.presentation.js +527 -0
- package/dist/docs/presentations/docsReferencePage.presentation.d.ts +2 -0
- package/dist/docs/presentations/docsReferencePage.presentation.js +527 -0
- package/dist/docs/presentations/index.d.ts +2 -0
- package/dist/docs/presentations/index.js +555 -0
- package/dist/docs/presentations.d.ts +27 -0
- package/dist/docs/presentations.js +97 -0
- package/dist/docs/presentations.test.d.ts +1 -0
- package/dist/docs/queries/contractReference.query.d.ts +211 -0
- package/dist/docs/queries/contractReference.query.js +752 -0
- package/dist/docs/queries/docsIndex.query.d.ts +266 -0
- package/dist/docs/queries/docsIndex.query.js +752 -0
- package/dist/docs/queries/index.d.ts +2 -0
- package/dist/docs/queries/index.js +827 -0
- package/dist/docs/registry.d.ts +19 -0
- package/dist/docs/registry.js +153 -0
- package/dist/docs/registry.test.d.ts +1 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.d.ts +2 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.js +221 -0
- package/dist/docs/tech/cli.docblock.d.ts +2 -0
- package/dist/docs/tech/cli.docblock.js +291 -0
- package/dist/docs/tech/contracts/README.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/README.docblock.js +164 -0
- package/dist/docs/tech/contracts/migrations.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/migrations.docblock.js +164 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.js +201 -0
- package/dist/docs/tech/contracts/openapi-import.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/openapi-import.docblock.js +207 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +225 -0
- package/dist/docs/tech/contracts/overlays.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/overlays.docblock.js +231 -0
- package/dist/docs/tech/contracts/tests.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/tests.docblock.js +164 -0
- package/dist/docs/tech/contracts/themes.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/themes.docblock.js +257 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +269 -0
- package/dist/docs/tech/docs-system.docblock.d.ts +1 -0
- package/dist/docs/tech/docs-system.docblock.js +264 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.d.ts +2 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.js +376 -0
- package/dist/docs/tech/llm/llm-integration.docblock.d.ts +7 -0
- package/dist/docs/tech/llm/llm-integration.docblock.js +482 -0
- package/dist/docs/tech/mcp-endpoints.docblock.d.ts +2 -0
- package/dist/docs/tech/mcp-endpoints.docblock.js +185 -0
- package/dist/docs/tech/presentation-runtime.docblock.d.ts +2 -0
- package/dist/docs/tech/presentation-runtime.docblock.js +221 -0
- package/dist/docs/tech/report-verification-table.docblock.d.ts +1 -0
- package/dist/docs/tech/report-verification-table.docblock.js +191 -0
- package/dist/docs/tech/report-verification-table.test.d.ts +1 -0
- package/dist/docs/tech/schema/README.docblock.d.ts +2 -0
- package/dist/docs/tech/schema/README.docblock.js +164 -0
- package/dist/docs/tech/studio/learning-events.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/learning-events.docblock.js +190 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.js +227 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.js +226 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.js +200 -0
- package/dist/docs/tech/studio/project-routing.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/project-routing.docblock.js +209 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.js +183 -0
- package/dist/docs/tech/studio/team-invitations.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/team-invitations.docblock.js +228 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.js +189 -0
- package/dist/docs/tech/studio/workspaces.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/workspaces.docblock.js +204 -0
- package/dist/docs/tech/telemetry-ingest.docblock.d.ts +2 -0
- package/dist/docs/tech/telemetry-ingest.docblock.js +305 -0
- package/dist/docs/tech/vscode-extension.docblock.d.ts +2 -0
- package/dist/docs/tech/vscode-extension.docblock.js +241 -0
- package/dist/docs/tech-contracts.docs.d.ts +2 -0
- package/dist/docs/tech-contracts.docs.js +239 -0
- package/dist/docs/types.d.ts +37 -0
- package/dist/docs/types.js +1 -0
- package/dist/docs/views/contractReference.dataView.d.ts +2 -0
- package/dist/docs/views/contractReference.dataView.js +838 -0
- package/dist/docs/views/docsIndex.dataView.d.ts +2 -0
- package/dist/docs/views/docsIndex.dataView.js +832 -0
- package/dist/docs/views/exampleCatalog.dataView.d.ts +2 -0
- package/dist/docs/views/exampleCatalog.dataView.js +816 -0
- package/dist/docs/views/index.d.ts +3 -0
- package/dist/docs/views/index.js +1031 -0
- package/dist/events.d.ts +142 -0
- package/dist/events.js +228 -0
- package/dist/events.test.d.ts +1 -0
- package/dist/examples/define.d.ts +5 -0
- package/dist/examples/define.js +36 -0
- package/dist/examples/docs/examples.docblock.d.ts +2 -0
- package/dist/examples/docs/examples.docblock.js +307 -0
- package/dist/examples/index.d.ts +7 -0
- package/dist/examples/index.js +604 -0
- package/dist/examples/registry.d.ts +38 -0
- package/dist/examples/registry.js +286 -0
- package/dist/examples/registry.test.d.ts +1 -0
- package/dist/examples/schema.d.ts +278 -0
- package/dist/examples/schema.js +166 -0
- package/dist/examples/schema.test.d.ts +1 -0
- package/dist/examples/types.d.ts +162 -0
- package/dist/examples/types.js +77 -0
- package/dist/examples/types.test.d.ts +1 -0
- package/dist/examples/validation.d.ts +61 -0
- package/dist/examples/validation.js +287 -0
- package/dist/examples/validation.test.d.ts +1 -0
- package/dist/experiments/docs/experiments.docblock.d.ts +2 -0
- package/dist/experiments/docs/experiments.docblock.js +291 -0
- package/dist/experiments/evaluator.d.ts +33 -0
- package/dist/experiments/evaluator.js +155 -0
- package/dist/experiments/evaluator.test.d.ts +1 -0
- package/dist/experiments/spec-resolver.d.ts +12 -0
- package/dist/experiments/spec-resolver.js +1 -0
- package/dist/experiments/spec.d.ts +79 -0
- package/dist/experiments/spec.js +227 -0
- package/dist/experiments/spec.test.d.ts +1 -0
- package/dist/features/index.d.ts +5 -0
- package/dist/features/index.js +275 -0
- package/dist/features/install.d.ts +14 -0
- package/dist/features/install.js +95 -0
- package/dist/features/install.test.d.ts +1 -0
- package/dist/features/registry.d.ts +21 -0
- package/dist/features/registry.js +192 -0
- package/dist/features/registry.test.d.ts +1 -0
- package/dist/features/types.d.ts +82 -0
- package/dist/features/types.js +36 -0
- package/dist/features/types.test.d.ts +1 -0
- package/dist/features/validation.d.ts +4 -0
- package/dist/features/validation.js +48 -0
- package/dist/features/validation.test.d.ts +1 -0
- package/dist/features.capabilities.test.d.ts +1 -0
- package/dist/forms/docs/forms.docblock.d.ts +2 -0
- package/dist/forms/docs/forms.docblock.js +164 -0
- package/dist/forms/forms.d.ts +264 -0
- package/dist/forms/forms.js +332 -0
- package/dist/forms/index.d.ts +1 -0
- package/dist/forms/index.js +332 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +2195 -0
- package/dist/install.d.ts +75 -0
- package/dist/install.js +60 -0
- package/dist/integrations/binding.d.ts +14 -0
- package/dist/integrations/binding.js +1 -0
- package/dist/integrations/connection.d.ts +47 -0
- package/dist/integrations/connection.js +1 -0
- package/dist/integrations/docs/integrations.docblock.d.ts +2 -0
- package/dist/integrations/docs/integrations.docblock.js +140 -0
- package/dist/integrations/health.d.ts +17 -0
- package/dist/integrations/health.js +103 -0
- package/dist/integrations/health.test.d.ts +1 -0
- package/dist/integrations/index.d.ts +11 -0
- package/dist/integrations/index.js +3293 -0
- package/dist/integrations/integrations.capability.d.ts +1 -0
- package/dist/integrations/integrations.capability.js +48 -0
- package/dist/integrations/integrations.feature.d.ts +5 -0
- package/dist/integrations/integrations.feature.js +63 -0
- package/dist/integrations/meeting-recorder/contracts/index.d.ts +7 -0
- package/dist/integrations/meeting-recorder/contracts/index.js +504 -0
- package/dist/integrations/meeting-recorder/contracts/meetings.d.ts +451 -0
- package/dist/integrations/meeting-recorder/contracts/meetings.js +249 -0
- package/dist/integrations/meeting-recorder/contracts/transcripts.d.ts +166 -0
- package/dist/integrations/meeting-recorder/contracts/transcripts.js +317 -0
- package/dist/integrations/meeting-recorder/contracts/webhooks.d.ts +85 -0
- package/dist/integrations/meeting-recorder/contracts/webhooks.js +202 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.capability.d.ts +1 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.capability.js +48 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.feature.d.ts +5 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.feature.js +63 -0
- package/dist/integrations/meeting-recorder/models.d.ts +402 -0
- package/dist/integrations/meeting-recorder/models.js +152 -0
- package/dist/integrations/meeting-recorder/telemetry.d.ts +13 -0
- package/dist/integrations/meeting-recorder/telemetry.js +84 -0
- package/dist/integrations/openbanking/contracts/accounts.d.ts +282 -0
- package/dist/integrations/openbanking/contracts/accounts.js +358 -0
- package/dist/integrations/openbanking/contracts/balances.d.ts +158 -0
- package/dist/integrations/openbanking/contracts/balances.js +322 -0
- package/dist/integrations/openbanking/contracts/index.d.ts +7 -0
- package/dist/integrations/openbanking/contracts/index.js +674 -0
- package/dist/integrations/openbanking/contracts/transactions.d.ts +206 -0
- package/dist/integrations/openbanking/contracts/transactions.js +328 -0
- package/dist/integrations/openbanking/guards.d.ts +8 -0
- package/dist/integrations/openbanking/guards.js +72 -0
- package/dist/integrations/openbanking/guards.test.d.ts +1 -0
- package/dist/integrations/openbanking/models.d.ts +223 -0
- package/dist/integrations/openbanking/models.js +140 -0
- package/dist/integrations/openbanking/openbanking.capability.d.ts +1 -0
- package/dist/integrations/openbanking/openbanking.capability.js +48 -0
- package/dist/integrations/openbanking/openbanking.feature.d.ts +5 -0
- package/dist/integrations/openbanking/openbanking.feature.js +65 -0
- package/dist/integrations/openbanking/telemetry.d.ts +12 -0
- package/dist/integrations/openbanking/telemetry.js +81 -0
- package/dist/integrations/operations.d.ts +430 -0
- package/dist/integrations/operations.js +327 -0
- package/dist/integrations/operations.test.d.ts +1 -0
- package/dist/integrations/providers/analytics-reader.d.ts +103 -0
- package/dist/integrations/providers/analytics-reader.js +1 -0
- package/dist/integrations/providers/analytics-writer.d.ts +6 -0
- package/dist/integrations/providers/analytics-writer.js +1 -0
- package/dist/integrations/providers/analytics.d.ts +47 -0
- package/dist/integrations/providers/analytics.js +1 -0
- package/dist/integrations/providers/calendar.d.ts +75 -0
- package/dist/integrations/providers/calendar.js +1 -0
- package/dist/integrations/providers/database.d.ts +12 -0
- package/dist/integrations/providers/database.js +1 -0
- package/dist/integrations/providers/elevenlabs.d.ts +3 -0
- package/dist/integrations/providers/elevenlabs.js +116 -0
- package/dist/integrations/providers/email.d.ts +83 -0
- package/dist/integrations/providers/email.js +1 -0
- package/dist/integrations/providers/embedding.d.ts +21 -0
- package/dist/integrations/providers/embedding.js +1 -0
- package/dist/integrations/providers/fal.d.ts +3 -0
- package/dist/integrations/providers/fal.js +142 -0
- package/dist/integrations/providers/fathom.d.ts +3 -0
- package/dist/integrations/providers/fathom.js +156 -0
- package/dist/integrations/providers/fireflies.d.ts +3 -0
- package/dist/integrations/providers/fireflies.js +136 -0
- package/dist/integrations/providers/gcs-storage.d.ts +3 -0
- package/dist/integrations/providers/gcs-storage.js +127 -0
- package/dist/integrations/providers/gmail.d.ts +3 -0
- package/dist/integrations/providers/gmail.js +139 -0
- package/dist/integrations/providers/google-calendar.d.ts +3 -0
- package/dist/integrations/providers/google-calendar.js +122 -0
- package/dist/integrations/providers/gradium.d.ts +3 -0
- package/dist/integrations/providers/gradium.js +140 -0
- package/dist/integrations/providers/granola.d.ts +3 -0
- package/dist/integrations/providers/granola.js +137 -0
- package/dist/integrations/providers/index.d.ts +38 -0
- package/dist/integrations/providers/index.js +2124 -0
- package/dist/integrations/providers/jira.d.ts +3 -0
- package/dist/integrations/providers/jira.js +138 -0
- package/dist/integrations/providers/linear.d.ts +3 -0
- package/dist/integrations/providers/linear.js +137 -0
- package/dist/integrations/providers/llm.d.ts +79 -0
- package/dist/integrations/providers/llm.js +1 -0
- package/dist/integrations/providers/meeting-recorder.d.ts +129 -0
- package/dist/integrations/providers/meeting-recorder.js +1 -0
- package/dist/integrations/providers/mistral.d.ts +3 -0
- package/dist/integrations/providers/mistral.js +124 -0
- package/dist/integrations/providers/notion.d.ts +3 -0
- package/dist/integrations/providers/notion.js +143 -0
- package/dist/integrations/providers/openbanking.d.ts +125 -0
- package/dist/integrations/providers/openbanking.js +1 -0
- package/dist/integrations/providers/payments.d.ts +106 -0
- package/dist/integrations/providers/payments.js +1 -0
- package/dist/integrations/providers/posthog-llm-telemetry.d.ts +51 -0
- package/dist/integrations/providers/posthog-llm-telemetry.js +206 -0
- package/dist/integrations/providers/posthog.d.ts +3 -0
- package/dist/integrations/providers/posthog.js +136 -0
- package/dist/integrations/providers/postmark.d.ts +3 -0
- package/dist/integrations/providers/postmark.js +128 -0
- package/dist/integrations/providers/powens.d.ts +3 -0
- package/dist/integrations/providers/powens.js +154 -0
- package/dist/integrations/providers/project-management.d.ts +32 -0
- package/dist/integrations/providers/project-management.js +1 -0
- package/dist/integrations/providers/providers.test.d.ts +1 -0
- package/dist/integrations/providers/qdrant.d.ts +3 -0
- package/dist/integrations/providers/qdrant.js +131 -0
- package/dist/integrations/providers/registry.d.ts +6 -0
- package/dist/integrations/providers/registry.js +1908 -0
- package/dist/integrations/providers/sms.d.ts +31 -0
- package/dist/integrations/providers/sms.js +1 -0
- package/dist/integrations/providers/storage.d.ts +57 -0
- package/dist/integrations/providers/storage.js +1 -0
- package/dist/integrations/providers/stripe.d.ts +3 -0
- package/dist/integrations/providers/stripe.js +135 -0
- package/dist/integrations/providers/supabase-postgres.d.ts +3 -0
- package/dist/integrations/providers/supabase-postgres.js +117 -0
- package/dist/integrations/providers/supabase-vector.d.ts +3 -0
- package/dist/integrations/providers/supabase-vector.js +137 -0
- package/dist/integrations/providers/tldv.d.ts +3 -0
- package/dist/integrations/providers/tldv.js +136 -0
- package/dist/integrations/providers/twilio-sms.d.ts +3 -0
- package/dist/integrations/providers/twilio-sms.js +121 -0
- package/dist/integrations/providers/vector-store.d.ts +39 -0
- package/dist/integrations/providers/vector-store.js +1 -0
- package/dist/integrations/providers/voice.d.ts +31 -0
- package/dist/integrations/providers/voice.js +1 -0
- package/dist/integrations/runtime.d.ts +95 -0
- package/dist/integrations/runtime.js +239 -0
- package/dist/integrations/runtime.test.d.ts +1 -0
- package/dist/integrations/secrets/aws-secret-manager.d.ts +28 -0
- package/dist/integrations/secrets/aws-secret-manager.js +376 -0
- package/dist/integrations/secrets/env-secret-provider.d.ts +28 -0
- package/dist/integrations/secrets/env-secret-provider.js +189 -0
- package/dist/integrations/secrets/gcp-secret-manager.d.ts +29 -0
- package/dist/integrations/secrets/gcp-secret-manager.js +377 -0
- package/dist/integrations/secrets/index.d.ts +6 -0
- package/dist/integrations/secrets/index.js +1159 -0
- package/dist/integrations/secrets/manager.d.ts +44 -0
- package/dist/integrations/secrets/manager.js +213 -0
- package/dist/integrations/secrets/provider.d.ts +49 -0
- package/dist/integrations/secrets/provider.js +104 -0
- package/dist/integrations/secrets/provider.test.d.ts +1 -0
- package/dist/integrations/secrets/scaleway-secret-manager.d.ts +35 -0
- package/dist/integrations/secrets/scaleway-secret-manager.js +405 -0
- package/dist/integrations/secrets-types.d.ts +14 -0
- package/dist/integrations/secrets-types.js +1 -0
- package/dist/integrations/spec.d.ts +72 -0
- package/dist/integrations/spec.js +52 -0
- package/dist/integrations/spec.test.d.ts +1 -0
- package/dist/jobs/define-job.d.ts +15 -0
- package/dist/jobs/define-job.js +41 -0
- package/dist/jobs/gcp-cloud-tasks.d.ts +38 -0
- package/dist/jobs/gcp-cloud-tasks.js +103 -0
- package/dist/jobs/gcp-pubsub.d.ts +22 -0
- package/dist/jobs/gcp-pubsub.js +91 -0
- package/dist/jobs/handlers/gmail-sync-handler.d.ts +5 -0
- package/dist/jobs/handlers/gmail-sync-handler.js +40 -0
- package/dist/jobs/handlers/handlers.test.d.ts +1 -0
- package/dist/jobs/handlers/index.d.ts +5 -0
- package/dist/jobs/handlers/index.js +83 -0
- package/dist/jobs/handlers/ping-handler.d.ts +6 -0
- package/dist/jobs/handlers/ping-handler.js +47 -0
- package/dist/jobs/handlers/storage-document-handler.d.ts +8 -0
- package/dist/jobs/handlers/storage-document-handler.js +47 -0
- package/dist/jobs/index.d.ts +2 -0
- package/dist/jobs/index.js +64 -0
- package/dist/jobs/memory-queue.d.ts +14 -0
- package/dist/jobs/memory-queue.js +129 -0
- package/dist/jobs/queue.d.ts +126 -0
- package/dist/jobs/queue.js +55 -0
- package/dist/jobs/queue.test.d.ts +1 -0
- package/dist/jobs/scaleway-sqs-queue.d.ts +27 -0
- package/dist/jobs/scaleway-sqs-queue.js +222 -0
- package/dist/jsonschema.d.ts +39 -0
- package/dist/jsonschema.js +73 -0
- package/dist/jsonschema.test.d.ts +1 -0
- package/dist/knowledge/binding.d.ts +22 -0
- package/dist/knowledge/binding.js +1 -0
- package/dist/knowledge/docs/knowledge.docblock.d.ts +2 -0
- package/dist/knowledge/docs/knowledge.docblock.js +301 -0
- package/dist/knowledge/index.d.ts +4 -0
- package/dist/knowledge/index.js +467 -0
- package/dist/knowledge/ingestion/document-processor.d.ts +22 -0
- package/dist/knowledge/ingestion/document-processor.js +95 -0
- package/dist/knowledge/ingestion/embedding-service.d.ts +8 -0
- package/dist/knowledge/ingestion/embedding-service.js +57 -0
- package/dist/knowledge/ingestion/gmail-adapter.d.ts +14 -0
- package/dist/knowledge/ingestion/gmail-adapter.js +103 -0
- package/dist/knowledge/ingestion/index.d.ts +5 -0
- package/dist/knowledge/ingestion/index.js +252 -0
- package/dist/knowledge/ingestion/ingestion.test.d.ts +1 -0
- package/dist/knowledge/ingestion/storage-adapter.d.ts +11 -0
- package/dist/knowledge/ingestion/storage-adapter.js +62 -0
- package/dist/knowledge/ingestion/vector-indexer.d.ts +14 -0
- package/dist/knowledge/ingestion/vector-indexer.js +63 -0
- package/dist/knowledge/knowledge.capability.d.ts +1 -0
- package/dist/knowledge/knowledge.capability.js +726 -0
- package/dist/knowledge/knowledge.feature.d.ts +5 -0
- package/dist/knowledge/knowledge.feature.js +300 -0
- package/dist/knowledge/operations.d.ts +311 -0
- package/dist/knowledge/operations.js +619 -0
- package/dist/knowledge/operations.test.d.ts +1 -0
- package/dist/knowledge/query/index.d.ts +1 -0
- package/dist/knowledge/query/index.js +110 -0
- package/dist/knowledge/query/service.d.ts +25 -0
- package/dist/knowledge/query/service.js +110 -0
- package/dist/knowledge/query/service.test.d.ts +1 -0
- package/dist/knowledge/runtime.d.ts +28 -0
- package/dist/knowledge/runtime.js +91 -0
- package/dist/knowledge/runtime.test.d.ts +1 -0
- package/dist/knowledge/source.d.ts +29 -0
- package/dist/knowledge/source.js +1 -0
- package/dist/knowledge/spaces/email-threads.d.ts +3 -0
- package/dist/knowledge/spaces/email-threads.js +102 -0
- package/dist/knowledge/spaces/financial-docs.d.ts +3 -0
- package/dist/knowledge/spaces/financial-docs.js +102 -0
- package/dist/knowledge/spaces/financial-overview.d.ts +3 -0
- package/dist/knowledge/spaces/financial-overview.js +102 -0
- package/dist/knowledge/spaces/index.d.ts +6 -0
- package/dist/knowledge/spaces/index.js +273 -0
- package/dist/knowledge/spaces/product-canon.d.ts +3 -0
- package/dist/knowledge/spaces/product-canon.js +102 -0
- package/dist/knowledge/spaces/spaces.test.d.ts +1 -0
- package/dist/knowledge/spaces/support-faq.d.ts +3 -0
- package/dist/knowledge/spaces/support-faq.js +103 -0
- package/dist/knowledge/spaces/uploaded-docs.d.ts +3 -0
- package/dist/knowledge/spaces/uploaded-docs.js +102 -0
- package/dist/knowledge/spec.d.ts +42 -0
- package/dist/knowledge/spec.js +228 -0
- package/dist/knowledge/spec.test.d.ts +1 -0
- package/dist/llm/exporters.d.ts +68 -0
- package/dist/llm/exporters.js +1011 -0
- package/dist/llm/index.d.ts +12 -0
- package/dist/llm/index.js +1465 -0
- package/dist/llm/prompts.d.ts +53 -0
- package/dist/llm/prompts.js +1456 -0
- package/dist/llm/types.d.ts +212 -0
- package/dist/llm/types.js +1 -0
- package/dist/markdown.d.ts +16 -0
- package/dist/markdown.js +529 -0
- package/dist/migrations.d.ts +48 -0
- package/dist/migrations.js +67 -0
- package/dist/migrations.test.d.ts +1 -0
- package/dist/model-registry.d.ts +9 -0
- package/dist/model-registry.js +64 -0
- package/dist/model-registry.test.d.ts +1 -0
- package/dist/node/app-config/app-config.capability.js +730 -0
- package/dist/node/app-config/app-config.contracts.js +713 -0
- package/dist/node/app-config/app-config.feature.js +255 -0
- package/dist/node/app-config/branding.js +0 -0
- package/dist/node/app-config/docs/app-config.docblock.js +383 -0
- package/dist/node/app-config/events.js +386 -0
- package/dist/node/app-config/index.js +2899 -0
- package/dist/node/app-config/lifecycle-contracts.js +870 -0
- package/dist/node/app-config/lifecycle.js +0 -0
- package/dist/node/app-config/runtime.js +734 -0
- package/dist/node/app-config/spec.js +229 -0
- package/dist/node/app-config/validation.js +650 -0
- package/dist/node/capabilities/capabilities.js +217 -0
- package/dist/node/capabilities/context.js +101 -0
- package/dist/node/capabilities/docs/capabilities.docblock.js +353 -0
- package/dist/node/capabilities/guards.js +177 -0
- package/dist/node/capabilities/index.js +739 -0
- package/dist/node/capabilities/meeting-recorder.js +154 -0
- package/dist/node/capabilities/openbanking.js +166 -0
- package/dist/node/capabilities/validation.js +185 -0
- package/dist/node/contract-registry/index.js +129 -0
- package/dist/node/contract-registry/schemas.js +129 -0
- package/dist/node/contract-registry/types.js +0 -0
- package/dist/node/data-views/data-views.js +232 -0
- package/dist/node/data-views/docs/data-views.docblock.js +164 -0
- package/dist/node/data-views/index.js +232 -0
- package/dist/node/data-views/query-generator.js +89 -0
- package/dist/node/data-views/registry.js +226 -0
- package/dist/node/data-views/report/contractVerificationTable.js +240 -0
- package/dist/node/data-views/runtime.js +108 -0
- package/dist/node/data-views/spec.js +38 -0
- package/dist/node/data-views/types.js +0 -0
- package/dist/node/docs/accessibility_wcag_compliance_specs.docblock.js +513 -0
- package/dist/node/docs/capabilities/documentationSystem.capability.js +784 -0
- package/dist/node/docs/capabilities/index.js +784 -0
- package/dist/node/docs/commands/docsGenerate.command.js +802 -0
- package/dist/node/docs/commands/docsPublish.command.js +781 -0
- package/dist/node/docs/commands/index.js +906 -0
- package/dist/node/docs/constants.js +78 -0
- package/dist/node/docs/contracts.js +1611 -0
- package/dist/node/docs/ensure-docblocks.js +264 -0
- package/dist/node/docs/events/docsGenerated.event.js +533 -0
- package/dist/node/docs/events/docsPublished.event.js +534 -0
- package/dist/node/docs/events/index.js +567 -0
- package/dist/node/docs/forms/docsSearch.form.js +676 -0
- package/dist/node/docs/forms/index.js +676 -0
- package/dist/node/docs/index.js +4719 -0
- package/dist/node/docs/meta.docs.js +176 -0
- package/dist/node/docs/presentations/docsLayout.presentation.js +527 -0
- package/dist/node/docs/presentations/docsReferencePage.presentation.js +527 -0
- package/dist/node/docs/presentations/index.js +555 -0
- package/dist/node/docs/presentations.js +97 -0
- package/dist/node/docs/queries/contractReference.query.js +752 -0
- package/dist/node/docs/queries/docsIndex.query.js +752 -0
- package/dist/node/docs/queries/index.js +827 -0
- package/dist/node/docs/registry.js +153 -0
- package/dist/node/docs/tech/auth/better-auth-nextjs.docblock.js +221 -0
- package/dist/node/docs/tech/cli.docblock.js +291 -0
- package/dist/node/docs/tech/contracts/README.docblock.js +164 -0
- package/dist/node/docs/tech/contracts/migrations.docblock.js +164 -0
- package/dist/node/docs/tech/contracts/openapi-export.docblock.js +201 -0
- package/dist/node/docs/tech/contracts/openapi-import.docblock.js +207 -0
- package/dist/node/docs/tech/contracts/ops-to-presentation-linking.docblock.js +225 -0
- package/dist/node/docs/tech/contracts/overlays.docblock.js +231 -0
- package/dist/node/docs/tech/contracts/tests.docblock.js +164 -0
- package/dist/node/docs/tech/contracts/themes.docblock.js +257 -0
- package/dist/node/docs/tech/contracts/vertical-pocket-family-office.docblock.js +269 -0
- package/dist/node/docs/tech/docs-system.docblock.js +264 -0
- package/dist/node/docs/tech/lifecycle-stage-system.docblock.js +376 -0
- package/dist/node/docs/tech/llm/llm-integration.docblock.js +482 -0
- package/dist/node/docs/tech/mcp-endpoints.docblock.js +185 -0
- package/dist/node/docs/tech/presentation-runtime.docblock.js +221 -0
- package/dist/node/docs/tech/report-verification-table.docblock.js +191 -0
- package/dist/node/docs/tech/schema/README.docblock.js +164 -0
- package/dist/node/docs/tech/studio/learning-events.docblock.js +190 -0
- package/dist/node/docs/tech/studio/learning-journeys.docblock.js +227 -0
- package/dist/node/docs/tech/studio/platform-admin-panel.docblock.js +226 -0
- package/dist/node/docs/tech/studio/project-access-teams.docblock.js +200 -0
- package/dist/node/docs/tech/studio/project-routing.docblock.js +209 -0
- package/dist/node/docs/tech/studio/sandbox-unlogged.docblock.js +183 -0
- package/dist/node/docs/tech/studio/team-invitations.docblock.js +228 -0
- package/dist/node/docs/tech/studio/workspace-ops.docblock.js +189 -0
- package/dist/node/docs/tech/studio/workspaces.docblock.js +204 -0
- package/dist/node/docs/tech/telemetry-ingest.docblock.js +305 -0
- package/dist/node/docs/tech/vscode-extension.docblock.js +241 -0
- package/dist/node/docs/tech-contracts.docs.js +239 -0
- package/dist/node/docs/types.js +0 -0
- package/dist/node/docs/views/contractReference.dataView.js +838 -0
- package/dist/node/docs/views/docsIndex.dataView.js +832 -0
- package/dist/node/docs/views/exampleCatalog.dataView.js +816 -0
- package/dist/node/docs/views/index.js +1031 -0
- package/dist/node/events.js +228 -0
- package/dist/node/examples/define.js +36 -0
- package/dist/node/examples/docs/examples.docblock.js +307 -0
- package/dist/node/examples/index.js +604 -0
- package/dist/node/examples/registry.js +286 -0
- package/dist/node/examples/schema.js +166 -0
- package/dist/node/examples/types.js +77 -0
- package/dist/node/examples/validation.js +287 -0
- package/dist/node/experiments/docs/experiments.docblock.js +291 -0
- package/dist/node/experiments/evaluator.js +155 -0
- package/dist/node/experiments/spec-resolver.js +0 -0
- package/dist/node/experiments/spec.js +227 -0
- package/dist/node/features/index.js +275 -0
- package/dist/node/features/install.js +95 -0
- package/dist/node/features/registry.js +192 -0
- package/dist/node/features/types.js +36 -0
- package/dist/node/features/validation.js +48 -0
- package/dist/node/forms/docs/forms.docblock.js +164 -0
- package/dist/node/forms/forms.js +332 -0
- package/dist/node/forms/index.js +332 -0
- package/dist/node/index.js +2195 -0
- package/dist/node/install.js +60 -0
- package/dist/node/integrations/binding.js +0 -0
- package/dist/node/integrations/connection.js +0 -0
- package/dist/node/integrations/docs/integrations.docblock.js +140 -0
- package/dist/node/integrations/health.js +103 -0
- package/dist/node/integrations/index.js +3293 -0
- package/dist/node/integrations/integrations.capability.js +48 -0
- package/dist/node/integrations/integrations.feature.js +63 -0
- package/dist/node/integrations/meeting-recorder/contracts/index.js +504 -0
- package/dist/node/integrations/meeting-recorder/contracts/meetings.js +249 -0
- package/dist/node/integrations/meeting-recorder/contracts/transcripts.js +317 -0
- package/dist/node/integrations/meeting-recorder/contracts/webhooks.js +202 -0
- package/dist/node/integrations/meeting-recorder/meeting-recorder.capability.js +48 -0
- package/dist/node/integrations/meeting-recorder/meeting-recorder.feature.js +63 -0
- package/dist/node/integrations/meeting-recorder/models.js +152 -0
- package/dist/node/integrations/meeting-recorder/telemetry.js +84 -0
- package/dist/node/integrations/openbanking/contracts/accounts.js +358 -0
- package/dist/node/integrations/openbanking/contracts/balances.js +322 -0
- package/dist/node/integrations/openbanking/contracts/index.js +674 -0
- package/dist/node/integrations/openbanking/contracts/transactions.js +328 -0
- package/dist/node/integrations/openbanking/guards.js +72 -0
- package/dist/node/integrations/openbanking/models.js +140 -0
- package/dist/node/integrations/openbanking/openbanking.capability.js +48 -0
- package/dist/node/integrations/openbanking/openbanking.feature.js +65 -0
- package/dist/node/integrations/openbanking/telemetry.js +81 -0
- package/dist/node/integrations/operations.js +327 -0
- package/dist/node/integrations/providers/analytics-reader.js +0 -0
- package/dist/node/integrations/providers/analytics-writer.js +0 -0
- package/dist/node/integrations/providers/analytics.js +0 -0
- package/dist/node/integrations/providers/calendar.js +0 -0
- package/dist/node/integrations/providers/database.js +0 -0
- package/dist/node/integrations/providers/elevenlabs.js +116 -0
- package/dist/node/integrations/providers/email.js +0 -0
- package/dist/node/integrations/providers/embedding.js +0 -0
- package/dist/node/integrations/providers/fal.js +142 -0
- package/dist/node/integrations/providers/fathom.js +156 -0
- package/dist/node/integrations/providers/fireflies.js +136 -0
- package/dist/node/integrations/providers/gcs-storage.js +127 -0
- package/dist/node/integrations/providers/gmail.js +139 -0
- package/dist/node/integrations/providers/google-calendar.js +122 -0
- package/dist/node/integrations/providers/gradium.js +140 -0
- package/dist/node/integrations/providers/granola.js +137 -0
- package/dist/node/integrations/providers/index.js +2124 -0
- package/dist/node/integrations/providers/jira.js +138 -0
- package/dist/node/integrations/providers/linear.js +137 -0
- package/dist/node/integrations/providers/llm.js +0 -0
- package/dist/node/integrations/providers/meeting-recorder.js +0 -0
- package/dist/node/integrations/providers/mistral.js +124 -0
- package/dist/node/integrations/providers/notion.js +143 -0
- package/dist/node/integrations/providers/openbanking.js +0 -0
- package/dist/node/integrations/providers/payments.js +0 -0
- package/dist/node/integrations/providers/posthog-llm-telemetry.js +206 -0
- package/dist/node/integrations/providers/posthog.js +136 -0
- package/dist/node/integrations/providers/postmark.js +128 -0
- package/dist/node/integrations/providers/powens.js +154 -0
- package/dist/node/integrations/providers/project-management.js +0 -0
- package/dist/node/integrations/providers/qdrant.js +131 -0
- package/dist/node/integrations/providers/registry.js +1908 -0
- package/dist/node/integrations/providers/sms.js +0 -0
- package/dist/node/integrations/providers/storage.js +0 -0
- package/dist/node/integrations/providers/stripe.js +135 -0
- package/dist/node/integrations/providers/supabase-postgres.js +117 -0
- package/dist/node/integrations/providers/supabase-vector.js +137 -0
- package/dist/node/integrations/providers/tldv.js +136 -0
- package/dist/node/integrations/providers/twilio-sms.js +121 -0
- package/dist/node/integrations/providers/vector-store.js +0 -0
- package/dist/node/integrations/providers/voice.js +0 -0
- package/dist/node/integrations/runtime.js +239 -0
- package/dist/node/integrations/secrets/aws-secret-manager.js +376 -0
- package/dist/node/integrations/secrets/env-secret-provider.js +189 -0
- package/dist/node/integrations/secrets/gcp-secret-manager.js +377 -0
- package/dist/node/integrations/secrets/index.js +1159 -0
- package/dist/node/integrations/secrets/manager.js +213 -0
- package/dist/node/integrations/secrets/provider.js +104 -0
- package/dist/node/integrations/secrets/scaleway-secret-manager.js +405 -0
- package/dist/node/integrations/secrets-types.js +0 -0
- package/dist/node/integrations/spec.js +52 -0
- package/dist/node/jobs/define-job.js +41 -0
- package/dist/node/jobs/gcp-cloud-tasks.js +103 -0
- package/dist/node/jobs/gcp-pubsub.js +91 -0
- package/dist/node/jobs/handlers/gmail-sync-handler.js +40 -0
- package/dist/node/jobs/handlers/index.js +83 -0
- package/dist/node/jobs/handlers/ping-handler.js +47 -0
- package/dist/node/jobs/handlers/storage-document-handler.js +47 -0
- package/dist/node/jobs/index.js +64 -0
- package/dist/node/jobs/memory-queue.js +129 -0
- package/dist/node/jobs/queue.js +55 -0
- package/dist/node/jobs/scaleway-sqs-queue.js +222 -0
- package/dist/node/jsonschema.js +73 -0
- package/dist/node/knowledge/binding.js +0 -0
- package/dist/node/knowledge/docs/knowledge.docblock.js +301 -0
- package/dist/node/knowledge/index.js +467 -0
- package/dist/node/knowledge/ingestion/document-processor.js +95 -0
- package/dist/node/knowledge/ingestion/embedding-service.js +57 -0
- package/dist/node/knowledge/ingestion/gmail-adapter.js +103 -0
- package/dist/node/knowledge/ingestion/index.js +252 -0
- package/dist/node/knowledge/ingestion/storage-adapter.js +62 -0
- package/dist/node/knowledge/ingestion/vector-indexer.js +63 -0
- package/dist/node/knowledge/knowledge.capability.js +726 -0
- package/dist/node/knowledge/knowledge.feature.js +300 -0
- package/dist/node/knowledge/operations.js +619 -0
- package/dist/node/knowledge/query/index.js +110 -0
- package/dist/node/knowledge/query/service.js +110 -0
- package/dist/node/knowledge/runtime.js +91 -0
- package/dist/node/knowledge/source.js +0 -0
- package/dist/node/knowledge/spaces/email-threads.js +102 -0
- package/dist/node/knowledge/spaces/financial-docs.js +102 -0
- package/dist/node/knowledge/spaces/financial-overview.js +102 -0
- package/dist/node/knowledge/spaces/index.js +273 -0
- package/dist/node/knowledge/spaces/product-canon.js +102 -0
- package/dist/node/knowledge/spaces/support-faq.js +103 -0
- package/dist/node/knowledge/spaces/uploaded-docs.js +102 -0
- package/dist/node/knowledge/spec.js +228 -0
- package/dist/node/llm/exporters.js +1011 -0
- package/dist/node/llm/index.js +1465 -0
- package/dist/node/llm/prompts.js +1456 -0
- package/dist/node/llm/types.js +0 -0
- package/dist/node/markdown.js +529 -0
- package/dist/node/migrations.js +67 -0
- package/dist/node/model-registry.js +64 -0
- package/dist/node/onboarding-base.js +597 -0
- package/dist/node/openapi.js +151 -0
- package/dist/node/operations/index.js +408 -0
- package/dist/node/operations/operation.js +51 -0
- package/dist/node/operations/registry.js +405 -0
- package/dist/node/operations/report/getContractVerificationStatus.js +170 -0
- package/dist/node/operations/report/index.js +305 -0
- package/dist/node/ownership.js +73 -0
- package/dist/node/policy/context.js +206 -0
- package/dist/node/policy/docs/policy.docblock.js +313 -0
- package/dist/node/policy/engine.js +325 -0
- package/dist/node/policy/guards.js +387 -0
- package/dist/node/policy/index.js +1313 -0
- package/dist/node/policy/opa-adapter.js +110 -0
- package/dist/node/policy/registry.js +221 -0
- package/dist/node/policy/spec.js +0 -0
- package/dist/node/policy/validation.js +391 -0
- package/dist/node/presentations/docs/presentations-conventions.docblock.js +171 -0
- package/dist/node/presentations/index.js +227 -0
- package/dist/node/presentations/presentations.js +38 -0
- package/dist/node/presentations/registry.js +221 -0
- package/dist/node/presentations/transform-engine.js +600 -0
- package/dist/node/product-intent/contract-patch-intent.js +68 -0
- package/dist/node/product-intent/contract-spec-patch.js +75 -0
- package/dist/node/product-intent/evidence.js +45 -0
- package/dist/node/product-intent/findings.js +81 -0
- package/dist/node/product-intent/impact-report.js +62 -0
- package/dist/node/product-intent/index.js +742 -0
- package/dist/node/product-intent/insights.js +63 -0
- package/dist/node/product-intent/opportunity-brief.js +106 -0
- package/dist/node/product-intent/problems.js +55 -0
- package/dist/node/product-intent/registry.js +242 -0
- package/dist/node/product-intent/runtime.js +320 -0
- package/dist/node/product-intent/spec.js +425 -0
- package/dist/node/product-intent/task-pack.js +69 -0
- package/dist/node/product-intent/tickets.js +57 -0
- package/dist/node/product-intent/types.js +378 -0
- package/dist/node/product-intent/ui-wireframe.js +73 -0
- package/dist/node/prompt.js +38 -0
- package/dist/node/promptRegistry.js +63 -0
- package/dist/node/regenerator/adapters.js +0 -0
- package/dist/node/regenerator/docs/regenerator.docblock.js +164 -0
- package/dist/node/regenerator/executor.js +157 -0
- package/dist/node/regenerator/index.js +341 -0
- package/dist/node/regenerator/service.js +183 -0
- package/dist/node/regenerator/sinks.js +64 -0
- package/dist/node/regenerator/types.js +0 -0
- package/dist/node/regenerator/utils.js +87 -0
- package/dist/node/registry-utils.js +163 -0
- package/dist/node/registry.js +215 -0
- package/dist/node/resources.js +83 -0
- package/dist/node/schema-to-markdown.js +278 -0
- package/dist/node/serialization/index.js +179 -0
- package/dist/node/serialization/serializers.js +180 -0
- package/dist/node/serialization/types.js +0 -0
- package/dist/node/telemetry/anomaly.js +91 -0
- package/dist/node/telemetry/docs/telemetry.docblock.js +164 -0
- package/dist/node/telemetry/index.js +417 -0
- package/dist/node/telemetry/spec.js +261 -0
- package/dist/node/telemetry/tracker.js +129 -0
- package/dist/node/tests/index.js +231 -0
- package/dist/node/tests/runner.js +189 -0
- package/dist/node/tests/spec.js +74 -0
- package/dist/node/themes.js +225 -0
- package/dist/node/translations/catalog.js +0 -0
- package/dist/node/translations/index.js +533 -0
- package/dist/node/translations/registry.js +170 -0
- package/dist/node/translations/spec.js +36 -0
- package/dist/node/translations/tenant.js +0 -0
- package/dist/node/translations/validation.js +392 -0
- package/dist/node/types.js +0 -0
- package/dist/node/versioning/index.js +274 -0
- package/dist/node/versioning/refs.js +99 -0
- package/dist/node/versioning/types.js +55 -0
- package/dist/node/versioning/utils.js +184 -0
- package/dist/node/workflow/adapters/db-adapter.js +127 -0
- package/dist/node/workflow/adapters/file-adapter.js +38 -0
- package/dist/node/workflow/adapters/index.js +194 -0
- package/dist/node/workflow/adapters/memory-store.js +93 -0
- package/dist/node/workflow/context.js +247 -0
- package/dist/node/workflow/expression.js +157 -0
- package/dist/node/workflow/index.js +1546 -0
- package/dist/node/workflow/overview.docblock.js +164 -0
- package/dist/node/workflow/runner.js +532 -0
- package/dist/node/workflow/sla-monitor.js +84 -0
- package/dist/node/workflow/spec.js +221 -0
- package/dist/node/workflow/state.js +0 -0
- package/dist/node/workflow/validation.js +425 -0
- package/dist/node/workspace-config/contractsrc-schema.js +344 -0
- package/dist/node/workspace-config/contractsrc-types.js +0 -0
- package/dist/node/workspace-config/index.js +325 -0
- package/dist/node/workspace-config/workspace-config.docblock.js +188 -0
- package/dist/onboarding-base.d.ts +131 -0
- package/dist/onboarding-base.js +597 -0
- package/dist/openapi.d.ts +33 -0
- package/dist/openapi.js +151 -0
- package/dist/operations/index.d.ts +2 -0
- package/dist/operations/index.js +408 -0
- package/dist/operations/operation.d.ts +191 -0
- package/dist/operations/operation.js +51 -0
- package/dist/operations/registry.d.ts +58 -0
- package/dist/operations/registry.js +405 -0
- package/dist/operations/report/getContractVerificationStatus.d.ts +68 -0
- package/dist/operations/report/getContractVerificationStatus.js +170 -0
- package/dist/operations/report/getContractVerificationStatus.test.d.ts +1 -0
- package/dist/operations/report/index.d.ts +10 -0
- package/dist/operations/report/index.js +305 -0
- package/dist/operations/report/index.test.d.ts +1 -0
- package/dist/ownership.d.ts +211 -0
- package/dist/ownership.js +73 -0
- package/dist/ownership.test.d.ts +1 -0
- package/dist/policy/context.d.ts +234 -0
- package/dist/policy/context.js +206 -0
- package/dist/policy/context.test.d.ts +1 -0
- package/dist/policy/docs/policy.docblock.d.ts +2 -0
- package/dist/policy/docs/policy.docblock.js +313 -0
- package/dist/policy/engine.d.ts +36 -0
- package/dist/policy/engine.js +325 -0
- package/dist/policy/engine.test.d.ts +1 -0
- package/dist/policy/guards.d.ts +156 -0
- package/dist/policy/guards.js +387 -0
- package/dist/policy/guards.test.d.ts +1 -0
- package/dist/policy/index.d.ts +12 -0
- package/dist/policy/index.js +1313 -0
- package/dist/policy/opa-adapter.d.ts +41 -0
- package/dist/policy/opa-adapter.js +110 -0
- package/dist/policy/opa-adapter.test.d.ts +1 -0
- package/dist/policy/registry.d.ts +5 -0
- package/dist/policy/registry.js +221 -0
- package/dist/policy/spec.d.ts +102 -0
- package/dist/policy/spec.js +1 -0
- package/dist/policy/validation.d.ts +84 -0
- package/dist/policy/validation.js +391 -0
- package/dist/policy/validation.test.d.ts +1 -0
- package/dist/presentations/docs/presentations-conventions.docblock.d.ts +2 -0
- package/dist/presentations/docs/presentations-conventions.docblock.js +171 -0
- package/dist/presentations/index.d.ts +2 -0
- package/dist/presentations/index.js +227 -0
- package/dist/presentations/presentations.d.ts +52 -0
- package/dist/presentations/presentations.js +38 -0
- package/dist/presentations/registry.d.ts +6 -0
- package/dist/presentations/registry.js +221 -0
- package/dist/presentations/transform-engine.d.ts +62 -0
- package/dist/presentations/transform-engine.js +600 -0
- package/dist/presentations/transform-engine.test.d.ts +1 -0
- package/dist/product-intent/contract-patch-intent.d.ts +100 -0
- package/dist/product-intent/contract-patch-intent.js +68 -0
- package/dist/product-intent/contract-spec-patch.d.ts +86 -0
- package/dist/product-intent/contract-spec-patch.js +75 -0
- package/dist/product-intent/evidence.d.ts +14 -0
- package/dist/product-intent/evidence.js +45 -0
- package/dist/product-intent/findings.d.ts +57 -0
- package/dist/product-intent/findings.js +81 -0
- package/dist/product-intent/impact-report.d.ts +57 -0
- package/dist/product-intent/impact-report.js +62 -0
- package/dist/product-intent/index.d.ts +13 -0
- package/dist/product-intent/index.js +742 -0
- package/dist/product-intent/insights.d.ts +62 -0
- package/dist/product-intent/insights.js +63 -0
- package/dist/product-intent/opportunity-brief.d.ts +192 -0
- package/dist/product-intent/opportunity-brief.js +106 -0
- package/dist/product-intent/problems.d.ts +59 -0
- package/dist/product-intent/problems.js +55 -0
- package/dist/product-intent/registry.d.ts +28 -0
- package/dist/product-intent/registry.js +242 -0
- package/dist/product-intent/registry.test.d.ts +1 -0
- package/dist/product-intent/runtime.d.ts +92 -0
- package/dist/product-intent/runtime.js +320 -0
- package/dist/product-intent/runtime.test.d.ts +1 -0
- package/dist/product-intent/spec.d.ts +664 -0
- package/dist/product-intent/spec.js +425 -0
- package/dist/product-intent/task-pack.d.ts +98 -0
- package/dist/product-intent/task-pack.js +69 -0
- package/dist/product-intent/tickets.d.ts +67 -0
- package/dist/product-intent/tickets.js +57 -0
- package/dist/product-intent/types.d.ts +11 -0
- package/dist/product-intent/types.js +378 -0
- package/dist/product-intent/ui-wireframe.d.ts +100 -0
- package/dist/product-intent/ui-wireframe.js +73 -0
- package/dist/prompt.d.ts +49 -0
- package/dist/prompt.js +38 -0
- package/dist/prompt.test.d.ts +1 -0
- package/dist/promptRegistry.d.ts +11 -0
- package/dist/promptRegistry.js +63 -0
- package/dist/promptRegistry.test.d.ts +1 -0
- package/dist/regenerator/adapters.d.ts +15 -0
- package/dist/regenerator/adapters.js +1 -0
- package/dist/regenerator/docs/regenerator.docblock.d.ts +2 -0
- package/dist/regenerator/docs/regenerator.docblock.js +164 -0
- package/dist/regenerator/executor.d.ts +66 -0
- package/dist/regenerator/executor.js +157 -0
- package/dist/regenerator/executor.test.d.ts +1 -0
- package/dist/regenerator/index.d.ts +6 -0
- package/dist/regenerator/index.js +341 -0
- package/dist/regenerator/service.d.ts +29 -0
- package/dist/regenerator/service.js +183 -0
- package/dist/regenerator/service.test.d.ts +1 -0
- package/dist/regenerator/sinks.d.ts +23 -0
- package/dist/regenerator/sinks.js +64 -0
- package/dist/regenerator/sinks.test.d.ts +1 -0
- package/dist/regenerator/types.d.ts +103 -0
- package/dist/regenerator/types.js +1 -0
- package/dist/regenerator/utils.d.ts +6 -0
- package/dist/regenerator/utils.js +87 -0
- package/dist/registry-utils.d.ts +105 -0
- package/dist/registry-utils.js +163 -0
- package/dist/registry-utils.test.d.ts +1 -0
- package/dist/registry.d.ts +27 -0
- package/dist/registry.js +215 -0
- package/dist/resources.d.ts +60 -0
- package/dist/resources.js +83 -0
- package/dist/schema-to-markdown.d.ts +56 -0
- package/dist/schema-to-markdown.js +278 -0
- package/dist/serialization/index.d.ts +10 -0
- package/dist/serialization/index.js +179 -0
- package/dist/serialization/serializers.d.ts +35 -0
- package/dist/serialization/serializers.js +180 -0
- package/dist/serialization/types.d.ts +100 -0
- package/dist/serialization/types.js +1 -0
- package/dist/telemetry/anomaly.d.ts +23 -0
- package/dist/telemetry/anomaly.js +91 -0
- package/dist/telemetry/anomaly.test.d.ts +1 -0
- package/dist/telemetry/docs/telemetry.docblock.d.ts +2 -0
- package/dist/telemetry/docs/telemetry.docblock.js +164 -0
- package/dist/telemetry/index.d.ts +3 -0
- package/dist/telemetry/index.js +417 -0
- package/dist/telemetry/spec.d.ts +87 -0
- package/dist/telemetry/spec.js +261 -0
- package/dist/telemetry/spec.test.d.ts +1 -0
- package/dist/telemetry/tracker.d.ts +48 -0
- package/dist/telemetry/tracker.js +129 -0
- package/dist/telemetry/tracker.test.d.ts +1 -0
- package/dist/tests/index.d.ts +2 -0
- package/dist/tests/index.js +231 -0
- package/dist/tests/runner.d.ts +38 -0
- package/dist/tests/runner.js +189 -0
- package/dist/tests/runner.test.d.ts +1 -0
- package/dist/tests/spec.d.ts +82 -0
- package/dist/tests/spec.js +74 -0
- package/dist/tests/spec.test.d.ts +1 -0
- package/dist/themes.d.ts +50 -0
- package/dist/themes.js +225 -0
- package/dist/themes.test.d.ts +1 -0
- package/dist/translations/catalog.d.ts +25 -0
- package/dist/translations/catalog.js +1 -0
- package/dist/translations/index.d.ts +44 -0
- package/dist/translations/index.js +533 -0
- package/dist/translations/registry.d.ts +172 -0
- package/dist/translations/registry.js +170 -0
- package/dist/translations/registry.test.d.ts +1 -0
- package/dist/translations/spec.d.ts +153 -0
- package/dist/translations/spec.js +36 -0
- package/dist/translations/spec.test.d.ts +1 -0
- package/dist/translations/tenant.d.ts +11 -0
- package/dist/translations/tenant.js +1 -0
- package/dist/translations/validation.d.ts +106 -0
- package/dist/translations/validation.js +392 -0
- package/dist/translations/validation.test.d.ts +1 -0
- package/dist/types.d.ts +212 -0
- package/dist/types.js +1 -0
- package/dist/versioning/index.d.ts +9 -0
- package/dist/versioning/index.js +274 -0
- package/dist/versioning/refs.d.ts +176 -0
- package/dist/versioning/refs.js +99 -0
- package/dist/versioning/refs.test.d.ts +4 -0
- package/dist/versioning/types.d.ts +130 -0
- package/dist/versioning/types.js +55 -0
- package/dist/versioning/utils.d.ts +93 -0
- package/dist/versioning/utils.js +184 -0
- package/dist/versioning/utils.test.d.ts +4 -0
- package/dist/workflow/adapters/db-adapter.d.ts +43 -0
- package/dist/workflow/adapters/db-adapter.js +127 -0
- package/dist/workflow/adapters/file-adapter.d.ts +10 -0
- package/dist/workflow/adapters/file-adapter.js +38 -0
- package/dist/workflow/adapters/index.d.ts +3 -0
- package/dist/workflow/adapters/index.js +194 -0
- package/dist/workflow/adapters/memory-store.d.ts +13 -0
- package/dist/workflow/adapters/memory-store.js +93 -0
- package/dist/workflow/context.d.ts +217 -0
- package/dist/workflow/context.js +247 -0
- package/dist/workflow/context.test.d.ts +1 -0
- package/dist/workflow/expression.d.ts +6 -0
- package/dist/workflow/expression.js +157 -0
- package/dist/workflow/expression.test.d.ts +1 -0
- package/dist/workflow/index.d.ts +13 -0
- package/dist/workflow/index.js +1546 -0
- package/dist/workflow/overview.docblock.d.ts +2 -0
- package/dist/workflow/overview.docblock.js +164 -0
- package/dist/workflow/runner.d.ts +71 -0
- package/dist/workflow/runner.js +532 -0
- package/dist/workflow/runner.test.d.ts +1 -0
- package/dist/workflow/sla-monitor.d.ts +16 -0
- package/dist/workflow/sla-monitor.js +84 -0
- package/dist/workflow/spec.d.ts +81 -0
- package/dist/workflow/spec.js +221 -0
- package/dist/workflow/state.d.ts +31 -0
- package/dist/workflow/state.js +1 -0
- package/dist/workflow/validation.d.ts +87 -0
- package/dist/workflow/validation.js +425 -0
- package/dist/workflow/validation.test.d.ts +1 -0
- package/dist/workspace-config/contractsrc-schema.d.ts +144 -0
- package/dist/workspace-config/contractsrc-schema.js +344 -0
- package/dist/workspace-config/contractsrc-schema.test.d.ts +1 -0
- package/dist/workspace-config/contractsrc-types.d.ts +342 -0
- package/dist/workspace-config/contractsrc-types.js +1 -0
- package/dist/workspace-config/index.d.ts +5 -0
- package/dist/workspace-config/index.js +325 -0
- package/dist/workspace-config/workspace-config.docblock.d.ts +2 -0
- package/dist/workspace-config/workspace-config.docblock.js +188 -0
- package/package.json +4426 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
7
|
+
var __toCommonJS = (from) => {
|
|
8
|
+
var entry = __moduleCache.get(from), desc;
|
|
9
|
+
if (entry)
|
|
10
|
+
return entry;
|
|
11
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
13
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
}));
|
|
17
|
+
__moduleCache.set(from, entry);
|
|
18
|
+
return entry;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, {
|
|
23
|
+
get: all[name],
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
set: (newValue) => all[name] = () => newValue
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
30
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
31
|
+
|
|
32
|
+
// src/docs/presentations.ts
|
|
33
|
+
var DEFAULT_TARGETS = [
|
|
34
|
+
"markdown",
|
|
35
|
+
"react"
|
|
36
|
+
];
|
|
37
|
+
function normalizeRoute(route) {
|
|
38
|
+
if (!route.length)
|
|
39
|
+
return "/";
|
|
40
|
+
const withLeading = route.startsWith("/") ? route : `/${route}`;
|
|
41
|
+
return withLeading === "/" ? "/" : withLeading.replace(/\/+$/, "");
|
|
42
|
+
}
|
|
43
|
+
function deriveRoute(block, routePrefix) {
|
|
44
|
+
if (block.route)
|
|
45
|
+
return normalizeRoute(block.route);
|
|
46
|
+
const prefix = routePrefix ?? "/docs";
|
|
47
|
+
const slug = block.id.replace(/^docs\.?/, "").replace(/\./g, "/").replace(/\/+/g, "/");
|
|
48
|
+
const path = slug.startsWith("/") ? slug : `${prefix}/${slug}`;
|
|
49
|
+
return normalizeRoute(path);
|
|
50
|
+
}
|
|
51
|
+
function buildName(block, namespace) {
|
|
52
|
+
return namespace ? `${namespace}.${block.id}` : block.id;
|
|
53
|
+
}
|
|
54
|
+
function docBlockToPresentationSpec(block, options) {
|
|
55
|
+
const targets = options?.defaultTargets ?? DEFAULT_TARGETS;
|
|
56
|
+
const version = block.version ?? options?.defaultVersion ?? "1.0.0";
|
|
57
|
+
const stability = block.stability ?? options?.defaultStability ?? "stable";
|
|
58
|
+
return {
|
|
59
|
+
meta: {
|
|
60
|
+
key: buildName(block, options?.namespace),
|
|
61
|
+
title: block.title,
|
|
62
|
+
version,
|
|
63
|
+
description: block.summary ?? block.title,
|
|
64
|
+
tags: block.tags || [],
|
|
65
|
+
owners: block.owners || [],
|
|
66
|
+
domain: block.domain || "",
|
|
67
|
+
stability,
|
|
68
|
+
goal: `Documentation of: ${block.summary}`,
|
|
69
|
+
context: `Auto-generated`
|
|
70
|
+
},
|
|
71
|
+
policy: block.visibility && block.visibility !== "public" ? { flags: [block.visibility] } : undefined,
|
|
72
|
+
source: {
|
|
73
|
+
type: "blocknotejs",
|
|
74
|
+
docJson: block.body
|
|
75
|
+
},
|
|
76
|
+
targets
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function docBlocksToPresentationRoutes(blocks, options) {
|
|
80
|
+
return blocks.map((block) => ({
|
|
81
|
+
block,
|
|
82
|
+
route: deriveRoute(block, options?.routePrefix),
|
|
83
|
+
descriptor: docBlockToPresentationSpec(block, options)
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
function docBlocksToPresentationSpecs(blocks, options) {
|
|
87
|
+
return blocks.map((block) => docBlockToPresentationSpec(block, options));
|
|
88
|
+
}
|
|
89
|
+
function mapDocRoutes(routes) {
|
|
90
|
+
return routes.map(({ route, descriptor }) => [route, descriptor]);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// src/docs/registry.ts
|
|
94
|
+
class DocRegistry {
|
|
95
|
+
routes = new Map;
|
|
96
|
+
constructor(blocks = [], options) {
|
|
97
|
+
blocks.forEach((block) => this.register(block, options));
|
|
98
|
+
}
|
|
99
|
+
register(block, options) {
|
|
100
|
+
const [route] = docBlocksToPresentationRoutes([block], options);
|
|
101
|
+
if (route) {
|
|
102
|
+
this.routes.set(block.id, route);
|
|
103
|
+
}
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
list() {
|
|
107
|
+
return [...this.routes.values()];
|
|
108
|
+
}
|
|
109
|
+
get(id) {
|
|
110
|
+
return this.routes.get(id);
|
|
111
|
+
}
|
|
112
|
+
toRouteTuples() {
|
|
113
|
+
return this.list().map(({ route, descriptor }) => [route, descriptor]);
|
|
114
|
+
}
|
|
115
|
+
toPresentationSpecs(options) {
|
|
116
|
+
return this.list().map(({ block }) => docBlockToPresentationSpec(block, options));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
var requiredFields = [
|
|
120
|
+
"id",
|
|
121
|
+
"title",
|
|
122
|
+
"body",
|
|
123
|
+
"kind",
|
|
124
|
+
"visibility",
|
|
125
|
+
"route"
|
|
126
|
+
];
|
|
127
|
+
var defaultDocRegistry = new DocRegistry;
|
|
128
|
+
function registerDocBlocks(blocks) {
|
|
129
|
+
for (const block of blocks) {
|
|
130
|
+
for (const field of requiredFields) {
|
|
131
|
+
if (!block[field]) {
|
|
132
|
+
throw new Error(`DocBlock ${block.id ?? "<missing id>"} missing field ${String(field)}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
defaultDocRegistry.register(block);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function listRegisteredDocBlocks() {
|
|
139
|
+
return defaultDocRegistry.list().map((r) => r.block);
|
|
140
|
+
}
|
|
141
|
+
function docId(id) {
|
|
142
|
+
const found = defaultDocRegistry.get(id);
|
|
143
|
+
if (!found)
|
|
144
|
+
throw new Error(`DocBlock not registered: ${id}`);
|
|
145
|
+
return id;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// src/docs/tech/contracts/README.docblock.ts
|
|
149
|
+
var tech_contracts_README_DocBlocks = [
|
|
150
|
+
{
|
|
151
|
+
id: "docs.tech.contracts.README",
|
|
152
|
+
title: "Contracts: Specs, Registry, Handlers, Adapters",
|
|
153
|
+
summary: "- `packages/lssm/libs/contracts` defines the contracts core (OperationSpecRegistry, OperationSpec, PresentationSpec, install helpers, REST/MCP adapters, ...).",
|
|
154
|
+
kind: "reference",
|
|
155
|
+
visibility: "public",
|
|
156
|
+
route: "/docs/tech/contracts/README",
|
|
157
|
+
tags: ["tech", "contracts", "README"],
|
|
158
|
+
body: "## Contracts: Specs, Registry, Handlers, Adapters\n\n### What lives where\n\n- `packages/lssm/libs/contracts` defines the contracts core (OperationSpecRegistry, OperationSpec, PresentationSpec, install helpers, REST/MCP adapters).\n- `packages/lssm/libs/schema` defines the schema dictionary (`SchemaModel`, `FieldType`) used to describe I/O once and map to multiple targets (zod, GraphQL, JSON Schema).\n- App adapters (e.g. GraphQL) live close to the app. Example: `packages/hcircle/apps/api-coliving/src/graphql/contracts-adapter.ts`.\n\n### npm distribution\n\n- `@contractspec/lib.contracts-spec` (root) keeps the legacy \\\"everything\\\" surface for backward compatibility.\n- `@contractspec/lib.contracts-runtime-client-react` exposes only browser-safe helpers (React renderers, client SDK, drivers). Import from this entry when bundling for the web or React Native to avoid dragging server adapters.\n- `@contractspec/lib.contracts-runtime-server-rest` covers HTTP/MCP adapters, registries, integrations, and other Node-only helpers.\n- `@contractspec/lib.contracts-spec/types` exports the runtime handler context utilities, while `@contractspec/lib.contracts-spec/types/all` re-exports every type alias/interface across the package via `export type` so consumers can import a single module for typings without shipping runtime code.\n- `@contractspec/lib.schema`, `@contractspec/lib.design-system`, `@contractspec/lib.ui-kit`, `@contractspec/lib.ui-kit-web`, `@contractspec/lib.accessibility`, and the presentation runtime packages are published to npm alongside contracts; prefer the scoped packages to keep tree-shaking intact.\n- Bundlers with conditional exports should resolve subpaths first; keep root imports for server-only code paths.\n\n### Core concepts\n\n- **OperationSpec**: immutable description of an operation.\n - `meta`: `{ name, version, kind: 'query' | 'command' }`\n - `io`: `{ input: SchemaModel | zod schema, output: SchemaModel | zod schema }`\n - `policy`: `{ auth?: {...}, rateLimit?: {...}, flags?: string[] }`\n - `transport.gql.field?`: explicit GraphQL field name (otherwise derived via `defaultGqlField`).\n- **OperationSpecRegistry**: registry of specs + handlers. Use `installOp(reg, spec, handler)` to attach a handler.\n- **Handler**: `(ctx, input) => Promise<output>` implementing the operation.\n- **CapabilitySpec**: canonical capability declaration stored in `src/capabilities.ts`. Tracks `meta` (`{ key, version, kind, title, description, domain, owners, tags, stability }`), `provides` surfaces (`operation`, `event`, `workflow`, `presentation`, `resource`), and `requires` which other capabilities must be present. Enforced during `installFeature`.\n- **PolicySpec**: declarative policy rules (`src/policy/spec.ts`) covering ABAC/ReBAC, consent + rate limit requirements, field-level controls, and PII guidance. `PolicyEngine` evaluates refs, while `OPAPolicyAdapter` lets OPA override/augment runtime decisions.\n- **TelemetrySpec**: analytics definitions (`src/telemetry/spec.ts`) describing event semantics, privacy level, retention, sampling, and anomaly detection. `TelemetryTracker` handles redaction/sampling, `TelemetryAnomalyMonitor` raises alerts, and specs integrate with contracts/workflows via `ctx.telemetry`.\n- **TestSpec**: declarative scenario definitions in `src/tests/spec.ts`. `TestRunner` executes fixtures/actions/assertions against a `OperationSpecRegistry`, and the CLI (`contractspec test`) wraps the runner for automation.\n- **ExperimentSpec**: experiment definitions (`src/experiments/spec.ts`) describing variants, allocation strategies, and success metrics. `ExperimentEvaluator` assigns variants (random/sticky/targeted) and integrates with Policy/Telemetry for safe experimentation.\n- **AppBlueprintSpec / TenantAppConfig**: global blueprints and per-tenant overrides (`src/app-config/spec.ts`). `resolveAppConfig()` merges the two into a `ResolvedAppConfig`, while `composeAppConfig()` hydrates the merged view against registries and reports missing references for safe rollout.\n- **RegeneratorService**: background daemon (`src/regenerator/service.ts`) that consumes telemetry/error/behavior signals, evaluates regeneration rules, and produces `SpecChangeProposal`s for Studio review.\n- **DataViewSpec**: declarative data presentation layer in `src/data-views.ts`. Describes entity projections (`fields`, `filters`, `actions`) with `view.kind` (`list`, `table`, `detail`, `grid`), ties to query operations via `source.primary`, and exposes optional presentation-based empty/error states.\n- **ThemeSpec**: design token + component variant definitions in `src/themes.ts`. Supports inheritance (`extends`), tenant/user overrides, and component-specific variant metadata for the design system.\n- **MigrationSpec**: schema/data migration descriptors (`src/migrations.ts`) with ordered step plans, dependency tracking, and pre/post checks to support automated database/content migrations.\n- **WorkflowSpec**: typed definition of multi-step workflows living in `src/workflow/spec.ts`. `WorkflowRegistry` stores versioned specs, and `validateWorkflowSpec()` (in `src/workflow/validation.ts`) checks graph integrity, step references, and reachability.\n\n### Lifecycle\n\n1. Define the spec (I/O via `SchemaModel` or zod) in a vertical lib (e.g. `contracts-coliving`).\n2. Register it: `installOp(registry, spec, handler)` within the app/service.\n3. Expose it via an adapter (REST, GraphQL, MCP). Each adapter maps the I/O to its transport and enforces policy.\n4. Validate at runtime: parse `input` before executing, parse `output` before returning.\n\n### Adapters\n\n- **REST**: see `packages/lssm/libs/contracts/src/server/rest-*`. Binds routes, validates request/response, maps errors/policies.\n- **MCP**: see `packages/lssm/libs/contracts/src/server/provider-mcp.ts` (standalone MCP server) and `packages/lssm/libs/contracts/src/server/rest-next-mcp.ts` (MCP over Next.js route). Provides tools/resources/prompts.\n - Tools + resources are registered from Zod schemas.\n - Resource templates are keyed by full `ResourceMeta.uriTemplate` (e.g. `docs://list`, `docs://doc/{id}`), so multiple templates can share a scheme (`docs://*`) without collisions.\n- **GraphQL (Pothos)**: see `packages/lssm/libs/contracts/src/server/graphql-pothos.ts`. Adds Query/Mutation fields by transforming contract I/O to GraphQL types.\n\n### GraphQL adapter behaviour (summary)\n\n- Field naming: `spec.transport.gql.field` or `<name_with_dots>_v<version>`.\n- Input/Output types from `SchemaModel` (preferred) or fallback zod introspection.\n- Scalars: String/Int/Float/Boolean/Date/JSON; Objects/Arrays/Enums; unions for outputs; input unions => JSON.\n- Policy: auth gate checks GraphQL context; optional feature flag gating.\n- Complexity & tracing: attaches hints and records timings; log includes `{ specName, version }`.\n\n#### Returns mapping and hydration\n\n- `spec.transport.gql.returns` can declare the GraphQL return wrapper: e.g. `\"Spot\"` or `[Spot]`. If omitted, the adapter infers from `io.output` (SchemaModel) or `resourceRef.graphQLType`.\n- Resource outputs: when `io.output` is a `resourceRef(...)` or `transport.gql.resource` is set, the adapter will optionally hydrate via a `ResourceRegistry` using `contracts-adapter-hydration.ts`:\n - Grammar is parsed with `parseReturns()`.\n - Entities are resolved via `hydrateResourceIfNeeded(resources, result, { template, varName, returns })` after handler execution.\n\n### Resource outputs\n\n- Declare resource outputs using `resourceRef(uriTemplate, opts)`.\n- `opts.varName` (default `id`) selects the identifier field returned by the handler for URI substitution.\n- `opts.graphQLType` is the GraphQL return type name (e.g., `Spot`) or list form (e.g., `[Spot]`).\n- `opts.many: true` indicates the handler returns an array of resources. The handler type becomes an array of items that include the identifier field.\n\nExample:\n\n```ts\nio: {\n input: ListThingsInput,\n output: resourceRef('myapp://thing/{id}', { graphQLType: '[Thing]', many: true }),\n}\n```\n\nHandler return (simplified): `{ id: string | number }[]`.\n\n### Errors\n\n- Validation errors → transport 400/GraphQL UserInputError.\n- Policy/auth errors → 401/403 or GraphQL ForbiddenError.\n- Handler errors → mapped to transport error with safe message.\n\n### Versioning & naming\n\n- Keep `meta.version` monotonic. Clients should pin to a versioned field/key.\n- Avoid renaming existing fields; add new fields with new versions.\n\n### Ownership metadata (OwnerShipMeta)\n\nAll contracts, events, features, and presentations reference a shared ownership schema (source of truth in `packages/lssm/libs/contracts/src/ownership.ts`).\n\n- Required fields: `title`, `description`, `domain`, `owners[]`, `tags[]`, `stability`.\n- Curated enums: the library exports suggested constants for owners and tags; free-form strings are still allowed for forward-compatibility.\n- Operations (`spec.ts`): `meta` requires `stability`, `owners`, and `tags` alongside `name`, `version`, `kind`, `description`, `goal`, and `context`.\n- Presentations V2: `meta` is a partial of ownership plus `description`.\n- Events: may specify `ownership` (recommended) for discoverability and docs.\n\n### Quick start\n\n```ts\n// app bootstrap\nconst reg = new OperationSpecRegistry();\ninstallOp(reg, BeginSignupSpec, beginSignupHandler);\nregisterContractsOnBuilder(gqlSchemaBuilder, reg); // GraphQL\n// or: createRestRouter(reg) // REST\n```\n"
|
|
159
|
+
}
|
|
160
|
+
];
|
|
161
|
+
registerDocBlocks(tech_contracts_README_DocBlocks);
|
|
162
|
+
export {
|
|
163
|
+
tech_contracts_README_DocBlocks
|
|
164
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
7
|
+
var __toCommonJS = (from) => {
|
|
8
|
+
var entry = __moduleCache.get(from), desc;
|
|
9
|
+
if (entry)
|
|
10
|
+
return entry;
|
|
11
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
13
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
}));
|
|
17
|
+
__moduleCache.set(from, entry);
|
|
18
|
+
return entry;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, {
|
|
23
|
+
get: all[name],
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
set: (newValue) => all[name] = () => newValue
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
30
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
31
|
+
|
|
32
|
+
// src/docs/presentations.ts
|
|
33
|
+
var DEFAULT_TARGETS = [
|
|
34
|
+
"markdown",
|
|
35
|
+
"react"
|
|
36
|
+
];
|
|
37
|
+
function normalizeRoute(route) {
|
|
38
|
+
if (!route.length)
|
|
39
|
+
return "/";
|
|
40
|
+
const withLeading = route.startsWith("/") ? route : `/${route}`;
|
|
41
|
+
return withLeading === "/" ? "/" : withLeading.replace(/\/+$/, "");
|
|
42
|
+
}
|
|
43
|
+
function deriveRoute(block, routePrefix) {
|
|
44
|
+
if (block.route)
|
|
45
|
+
return normalizeRoute(block.route);
|
|
46
|
+
const prefix = routePrefix ?? "/docs";
|
|
47
|
+
const slug = block.id.replace(/^docs\.?/, "").replace(/\./g, "/").replace(/\/+/g, "/");
|
|
48
|
+
const path = slug.startsWith("/") ? slug : `${prefix}/${slug}`;
|
|
49
|
+
return normalizeRoute(path);
|
|
50
|
+
}
|
|
51
|
+
function buildName(block, namespace) {
|
|
52
|
+
return namespace ? `${namespace}.${block.id}` : block.id;
|
|
53
|
+
}
|
|
54
|
+
function docBlockToPresentationSpec(block, options) {
|
|
55
|
+
const targets = options?.defaultTargets ?? DEFAULT_TARGETS;
|
|
56
|
+
const version = block.version ?? options?.defaultVersion ?? "1.0.0";
|
|
57
|
+
const stability = block.stability ?? options?.defaultStability ?? "stable";
|
|
58
|
+
return {
|
|
59
|
+
meta: {
|
|
60
|
+
key: buildName(block, options?.namespace),
|
|
61
|
+
title: block.title,
|
|
62
|
+
version,
|
|
63
|
+
description: block.summary ?? block.title,
|
|
64
|
+
tags: block.tags || [],
|
|
65
|
+
owners: block.owners || [],
|
|
66
|
+
domain: block.domain || "",
|
|
67
|
+
stability,
|
|
68
|
+
goal: `Documentation of: ${block.summary}`,
|
|
69
|
+
context: `Auto-generated`
|
|
70
|
+
},
|
|
71
|
+
policy: block.visibility && block.visibility !== "public" ? { flags: [block.visibility] } : undefined,
|
|
72
|
+
source: {
|
|
73
|
+
type: "blocknotejs",
|
|
74
|
+
docJson: block.body
|
|
75
|
+
},
|
|
76
|
+
targets
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function docBlocksToPresentationRoutes(blocks, options) {
|
|
80
|
+
return blocks.map((block) => ({
|
|
81
|
+
block,
|
|
82
|
+
route: deriveRoute(block, options?.routePrefix),
|
|
83
|
+
descriptor: docBlockToPresentationSpec(block, options)
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
function docBlocksToPresentationSpecs(blocks, options) {
|
|
87
|
+
return blocks.map((block) => docBlockToPresentationSpec(block, options));
|
|
88
|
+
}
|
|
89
|
+
function mapDocRoutes(routes) {
|
|
90
|
+
return routes.map(({ route, descriptor }) => [route, descriptor]);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// src/docs/registry.ts
|
|
94
|
+
class DocRegistry {
|
|
95
|
+
routes = new Map;
|
|
96
|
+
constructor(blocks = [], options) {
|
|
97
|
+
blocks.forEach((block) => this.register(block, options));
|
|
98
|
+
}
|
|
99
|
+
register(block, options) {
|
|
100
|
+
const [route] = docBlocksToPresentationRoutes([block], options);
|
|
101
|
+
if (route) {
|
|
102
|
+
this.routes.set(block.id, route);
|
|
103
|
+
}
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
list() {
|
|
107
|
+
return [...this.routes.values()];
|
|
108
|
+
}
|
|
109
|
+
get(id) {
|
|
110
|
+
return this.routes.get(id);
|
|
111
|
+
}
|
|
112
|
+
toRouteTuples() {
|
|
113
|
+
return this.list().map(({ route, descriptor }) => [route, descriptor]);
|
|
114
|
+
}
|
|
115
|
+
toPresentationSpecs(options) {
|
|
116
|
+
return this.list().map(({ block }) => docBlockToPresentationSpec(block, options));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
var requiredFields = [
|
|
120
|
+
"id",
|
|
121
|
+
"title",
|
|
122
|
+
"body",
|
|
123
|
+
"kind",
|
|
124
|
+
"visibility",
|
|
125
|
+
"route"
|
|
126
|
+
];
|
|
127
|
+
var defaultDocRegistry = new DocRegistry;
|
|
128
|
+
function registerDocBlocks(blocks) {
|
|
129
|
+
for (const block of blocks) {
|
|
130
|
+
for (const field of requiredFields) {
|
|
131
|
+
if (!block[field]) {
|
|
132
|
+
throw new Error(`DocBlock ${block.id ?? "<missing id>"} missing field ${String(field)}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
defaultDocRegistry.register(block);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function listRegisteredDocBlocks() {
|
|
139
|
+
return defaultDocRegistry.list().map((r) => r.block);
|
|
140
|
+
}
|
|
141
|
+
function docId(id) {
|
|
142
|
+
const found = defaultDocRegistry.get(id);
|
|
143
|
+
if (!found)
|
|
144
|
+
throw new Error(`DocBlock not registered: ${id}`);
|
|
145
|
+
return id;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// src/docs/tech/contracts/migrations.docblock.ts
|
|
149
|
+
var tech_contracts_migrations_DocBlocks = [
|
|
150
|
+
{
|
|
151
|
+
id: "docs.tech.contracts.migrations",
|
|
152
|
+
title: "MigrationSpec Overview",
|
|
153
|
+
summary: "`MigrationSpec` provides a declarative plan for schema/data/validation steps so migrations can be generated, reviewed, and executed safely by tooling. Each spec captures ownership metadata, ordered up/down steps, and optional dependency information. Runtime tooling can consume the spec to run SQL/data scripts with pre/post checks and produce audit logs.",
|
|
154
|
+
kind: "reference",
|
|
155
|
+
visibility: "public",
|
|
156
|
+
route: "/docs/tech/contracts/migrations",
|
|
157
|
+
tags: ["tech", "contracts", "migrations"],
|
|
158
|
+
body: "# MigrationSpec Overview\n\n## Purpose\n\n`MigrationSpec` provides a declarative plan for schema/data/validation steps so migrations can be generated, reviewed, and executed safely by tooling. Each spec captures ownership metadata, ordered up/down steps, and optional dependency information. Runtime tooling can consume the spec to run SQL/data scripts with pre/post checks and produce audit logs.\n\n## Location\n\n- Spec + registry: `packages/libs/contracts/src/migrations.ts`\n- Tests: `packages/.../migrations.test.ts`\n\n## Schema\n\n```ts\nexport interface MigrationSpec {\n meta: MigrationMeta; // ownership metadata + { name, version }\n plan: {\n up: MigrationStep[]; // required forward plan\n down?: MigrationStep[];// optional rollback steps\n };\n dependencies?: string[]; // optional list of migration keys this depends on\n}\n```\n\n- **MigrationStep**\n - `kind`: `'schema' | 'data' | 'validation'`\n - Shared fields: `description?`, `timeoutMs?`, `retries?`, `preChecks?`, `postChecks?`\n - `schema`: `sql` string executed in transactional context\n - `data`: arbitrary `script` (e.g., JS/TS snippet, path to file, instructions)\n - `validation`: `assertion` expression verifying state (e.g., SQL returning boolean)\n- **MigrationCheck** (`preChecks`/`postChecks`)\n - `description`: human context\n - `expression`: expression or SQL snippet to evaluate before/after the step\n- **Dependencies**\n - Array of migration keys (`\"boundedContext.namespace.timestamp_slug\"`) used to ensure the registry executes prerequisites first\n\n## Registry Usage\n\n```ts\nimport { MigrationRegistry } from '@contractspec/lib.contracts-spec/migrations';\nimport { AddUsersMigration } from './migrations/core.db.2025_01_add_users';\n\nconst registry = new MigrationRegistry();\nregistry.register(AddUsersMigration);\n\nconst migration = registry.get('core.db.2025_01_add_users');\nconst all = registry.list(); // sorted by name/version\n```\n\n## Authoring Guidelines\n\n1. Name migrations with timestamped slugs (`domain.db.YYYY_MM_description`) for clarity.\n2. Capture ownership metadata (`owners`, `tags`, `stability`) so tooling can route approvals.\n3. Prefer small, reversible steps. Use `plan.down` when safe; otherwise document fallback.\n4. Use `preChecks`/`postChecks` for critical invariants (row counts, schema existence).\n5. Specify dependencies explicitly to avoid parallel execution hazards.\n6. For large data scripts, use `script` as a pointer (URL, file path) rather than embedding code directly.\n\n## Tooling Roadmap\n\nUpcoming CLI support (Phase 4 plan):\n\n- `contractspec create --type migration` (scaffolds spec skeleton)\n- `contractspec build <migration>` (generate executor harness)\n- `contractspec migrate create/up/down/status` orchestration commands\n\nThe current implementation focuses on the spec/registry foundation so downstream tooling can be layered iteratively.\n\n"
|
|
159
|
+
}
|
|
160
|
+
];
|
|
161
|
+
registerDocBlocks(tech_contracts_migrations_DocBlocks);
|
|
162
|
+
export {
|
|
163
|
+
tech_contracts_migrations_DocBlocks
|
|
164
|
+
};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
7
|
+
var __toCommonJS = (from) => {
|
|
8
|
+
var entry = __moduleCache.get(from), desc;
|
|
9
|
+
if (entry)
|
|
10
|
+
return entry;
|
|
11
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
13
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
}));
|
|
17
|
+
__moduleCache.set(from, entry);
|
|
18
|
+
return entry;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, {
|
|
23
|
+
get: all[name],
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
set: (newValue) => all[name] = () => newValue
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
30
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
31
|
+
|
|
32
|
+
// src/docs/presentations.ts
|
|
33
|
+
var DEFAULT_TARGETS = [
|
|
34
|
+
"markdown",
|
|
35
|
+
"react"
|
|
36
|
+
];
|
|
37
|
+
function normalizeRoute(route) {
|
|
38
|
+
if (!route.length)
|
|
39
|
+
return "/";
|
|
40
|
+
const withLeading = route.startsWith("/") ? route : `/${route}`;
|
|
41
|
+
return withLeading === "/" ? "/" : withLeading.replace(/\/+$/, "");
|
|
42
|
+
}
|
|
43
|
+
function deriveRoute(block, routePrefix) {
|
|
44
|
+
if (block.route)
|
|
45
|
+
return normalizeRoute(block.route);
|
|
46
|
+
const prefix = routePrefix ?? "/docs";
|
|
47
|
+
const slug = block.id.replace(/^docs\.?/, "").replace(/\./g, "/").replace(/\/+/g, "/");
|
|
48
|
+
const path = slug.startsWith("/") ? slug : `${prefix}/${slug}`;
|
|
49
|
+
return normalizeRoute(path);
|
|
50
|
+
}
|
|
51
|
+
function buildName(block, namespace) {
|
|
52
|
+
return namespace ? `${namespace}.${block.id}` : block.id;
|
|
53
|
+
}
|
|
54
|
+
function docBlockToPresentationSpec(block, options) {
|
|
55
|
+
const targets = options?.defaultTargets ?? DEFAULT_TARGETS;
|
|
56
|
+
const version = block.version ?? options?.defaultVersion ?? "1.0.0";
|
|
57
|
+
const stability = block.stability ?? options?.defaultStability ?? "stable";
|
|
58
|
+
return {
|
|
59
|
+
meta: {
|
|
60
|
+
key: buildName(block, options?.namespace),
|
|
61
|
+
title: block.title,
|
|
62
|
+
version,
|
|
63
|
+
description: block.summary ?? block.title,
|
|
64
|
+
tags: block.tags || [],
|
|
65
|
+
owners: block.owners || [],
|
|
66
|
+
domain: block.domain || "",
|
|
67
|
+
stability,
|
|
68
|
+
goal: `Documentation of: ${block.summary}`,
|
|
69
|
+
context: `Auto-generated`
|
|
70
|
+
},
|
|
71
|
+
policy: block.visibility && block.visibility !== "public" ? { flags: [block.visibility] } : undefined,
|
|
72
|
+
source: {
|
|
73
|
+
type: "blocknotejs",
|
|
74
|
+
docJson: block.body
|
|
75
|
+
},
|
|
76
|
+
targets
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function docBlocksToPresentationRoutes(blocks, options) {
|
|
80
|
+
return blocks.map((block) => ({
|
|
81
|
+
block,
|
|
82
|
+
route: deriveRoute(block, options?.routePrefix),
|
|
83
|
+
descriptor: docBlockToPresentationSpec(block, options)
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
function docBlocksToPresentationSpecs(blocks, options) {
|
|
87
|
+
return blocks.map((block) => docBlockToPresentationSpec(block, options));
|
|
88
|
+
}
|
|
89
|
+
function mapDocRoutes(routes) {
|
|
90
|
+
return routes.map(({ route, descriptor }) => [route, descriptor]);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// src/docs/registry.ts
|
|
94
|
+
class DocRegistry {
|
|
95
|
+
routes = new Map;
|
|
96
|
+
constructor(blocks = [], options) {
|
|
97
|
+
blocks.forEach((block) => this.register(block, options));
|
|
98
|
+
}
|
|
99
|
+
register(block, options) {
|
|
100
|
+
const [route] = docBlocksToPresentationRoutes([block], options);
|
|
101
|
+
if (route) {
|
|
102
|
+
this.routes.set(block.id, route);
|
|
103
|
+
}
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
list() {
|
|
107
|
+
return [...this.routes.values()];
|
|
108
|
+
}
|
|
109
|
+
get(id) {
|
|
110
|
+
return this.routes.get(id);
|
|
111
|
+
}
|
|
112
|
+
toRouteTuples() {
|
|
113
|
+
return this.list().map(({ route, descriptor }) => [route, descriptor]);
|
|
114
|
+
}
|
|
115
|
+
toPresentationSpecs(options) {
|
|
116
|
+
return this.list().map(({ block }) => docBlockToPresentationSpec(block, options));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
var requiredFields = [
|
|
120
|
+
"id",
|
|
121
|
+
"title",
|
|
122
|
+
"body",
|
|
123
|
+
"kind",
|
|
124
|
+
"visibility",
|
|
125
|
+
"route"
|
|
126
|
+
];
|
|
127
|
+
var defaultDocRegistry = new DocRegistry;
|
|
128
|
+
function registerDocBlocks(blocks) {
|
|
129
|
+
for (const block of blocks) {
|
|
130
|
+
for (const field of requiredFields) {
|
|
131
|
+
if (!block[field]) {
|
|
132
|
+
throw new Error(`DocBlock ${block.id ?? "<missing id>"} missing field ${String(field)}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
defaultDocRegistry.register(block);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function listRegisteredDocBlocks() {
|
|
139
|
+
return defaultDocRegistry.list().map((r) => r.block);
|
|
140
|
+
}
|
|
141
|
+
function docId(id) {
|
|
142
|
+
const found = defaultDocRegistry.get(id);
|
|
143
|
+
if (!found)
|
|
144
|
+
throw new Error(`DocBlock not registered: ${id}`);
|
|
145
|
+
return id;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// src/docs/tech/contracts/openapi-export.docblock.ts
|
|
149
|
+
var tech_contracts_openapi_export_DocBlocks = [
|
|
150
|
+
{
|
|
151
|
+
id: "docs.tech.contracts.openapi-export",
|
|
152
|
+
title: "OpenAPI export (OpenAPI 3.1) from OperationSpecRegistry",
|
|
153
|
+
summary: "Generate a deterministic OpenAPI document from a OperationSpecRegistry using jsonSchemaForSpec + REST transport metadata.",
|
|
154
|
+
kind: "reference",
|
|
155
|
+
visibility: "public",
|
|
156
|
+
route: "/docs/tech/contracts/openapi-export",
|
|
157
|
+
tags: ["contracts", "openapi", "rest"],
|
|
158
|
+
body: `## OpenAPI export (OpenAPI 3.1) from OperationSpecRegistry
|
|
159
|
+
|
|
160
|
+
### Purpose
|
|
161
|
+
|
|
162
|
+
ContractSpec specs can be exported into an **OpenAPI 3.1** document for tooling (SDK generation, docs, gateways).
|
|
163
|
+
|
|
164
|
+
The export is **spec-first**:
|
|
165
|
+
|
|
166
|
+
- Uses \`jsonSchemaForSpec(spec)\` for input/output JSON Schema (from SchemaModel → zod → JSON Schema)
|
|
167
|
+
- Uses \`spec.transport.rest.method/path\` when present
|
|
168
|
+
- Falls back to deterministic defaults:
|
|
169
|
+
- Method: \`POST\` for commands, \`GET\` for queries
|
|
170
|
+
- Path: \`defaultRestPath(name, version)\` → \`/<dot/name>/v<version>\`
|
|
171
|
+
|
|
172
|
+
### Library API
|
|
173
|
+
|
|
174
|
+
- Function: \`openApiForRegistry(registry, options?)\`
|
|
175
|
+
- Location: \`@contractspec/lib.contracts-spec/openapi\`
|
|
176
|
+
|
|
177
|
+
### CLI
|
|
178
|
+
|
|
179
|
+
Export OpenAPI from a registry module:
|
|
180
|
+
|
|
181
|
+
\`\`\`bash
|
|
182
|
+
contractspec openapi --registry ./src/registry.ts --out ./openapi.json
|
|
183
|
+
\`\`\`
|
|
184
|
+
|
|
185
|
+
The registry module must export one of:
|
|
186
|
+
|
|
187
|
+
- \`registry: OperationSpecRegistry\`
|
|
188
|
+
- \`default(): OperationSpecRegistry | Promise<OperationSpecRegistry>\`
|
|
189
|
+
- \`createRegistry(): OperationSpecRegistry | Promise<OperationSpecRegistry>\`
|
|
190
|
+
|
|
191
|
+
### Notes / limitations (current)
|
|
192
|
+
|
|
193
|
+
- Responses are generated as a basic \`200\` response (plus schemas when available).
|
|
194
|
+
- Query (GET) inputs are currently represented as a JSON request body when an input schema exists.
|
|
195
|
+
- Errors are not yet expanded into OpenAPI responses; that will be added when we standardize error envelopes.`
|
|
196
|
+
}
|
|
197
|
+
];
|
|
198
|
+
registerDocBlocks(tech_contracts_openapi_export_DocBlocks);
|
|
199
|
+
export {
|
|
200
|
+
tech_contracts_openapi_export_DocBlocks
|
|
201
|
+
};
|