@contractspec/lib.contracts 0.0.0-canary-20260113162409
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/_virtual/rolldown_runtime.js +37 -0
- package/dist/app-config/app-config.capability.d.ts +7 -0
- package/dist/app-config/app-config.capability.js +23 -0
- package/dist/app-config/app-config.feature.d.ts +11 -0
- package/dist/app-config/app-config.feature.js +61 -0
- package/dist/app-config/branding.d.ts +55 -0
- package/dist/app-config/branding.js +0 -0
- package/dist/app-config/contracts.d.ts +245 -0
- package/dist/app-config/contracts.js +395 -0
- package/dist/app-config/docs/app-config.docblock.d.ts +6 -0
- package/dist/app-config/docs/app-config.docblock.js +21 -0
- package/dist/app-config/events.d.ts +122 -0
- package/dist/app-config/events.js +174 -0
- package/dist/app-config/index.d.ts +10 -0
- package/dist/app-config/index.js +9 -0
- package/dist/app-config/lifecycle-contracts.d.ts +273 -0
- package/dist/app-config/lifecycle-contracts.js +440 -0
- package/dist/app-config/lifecycle.d.ts +27 -0
- package/dist/app-config/lifecycle.js +0 -0
- package/dist/app-config/runtime.d.ts +120 -0
- package/dist/app-config/runtime.js +617 -0
- package/dist/app-config/spec.d.ts +175 -0
- package/dist/app-config/spec.js +19 -0
- package/dist/app-config/validation.d.ts +49 -0
- package/dist/app-config/validation.js +538 -0
- package/dist/capabilities/capabilities.d.ts +41 -0
- package/dist/capabilities/capabilities.js +48 -0
- package/dist/capabilities/docs/capabilities.docblock.d.ts +6 -0
- package/dist/capabilities/docs/capabilities.docblock.js +21 -0
- package/dist/capabilities/index.d.ts +3 -0
- package/dist/capabilities/index.js +4 -0
- package/dist/capabilities/openbanking.d.ts +10 -0
- package/dist/capabilities/openbanking.js +92 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +9 -0
- package/dist/client/react/drivers/rn-reusables.d.ts +22 -0
- package/dist/client/react/drivers/rn-reusables.js +21 -0
- package/dist/client/react/drivers/shadcn.d.ts +12 -0
- package/dist/client/react/drivers/shadcn.js +11 -0
- package/dist/client/react/feature-render.d.ts +23 -0
- package/dist/client/react/feature-render.js +44 -0
- package/dist/client/react/form-render.d.ts +92 -0
- package/dist/client/react/form-render.js +301 -0
- package/dist/client/react/index.d.ts +5 -0
- package/dist/client/react/index.js +8 -0
- package/dist/contract-registry/index.d.ts +3 -0
- package/dist/contract-registry/index.js +3 -0
- package/dist/contract-registry/schemas.d.ts +124 -0
- package/dist/contract-registry/schemas.js +61 -0
- package/dist/contract-registry/types.d.ts +46 -0
- package/dist/contract-registry/types.js +0 -0
- package/dist/data-views/data-views.d.ts +5 -0
- package/dist/data-views/data-views.js +5 -0
- package/dist/data-views/docs/data-views.docblock.d.ts +6 -0
- package/dist/data-views/docs/data-views.docblock.js +21 -0
- package/dist/data-views/index.d.ts +4 -0
- package/dist/data-views/index.js +4 -0
- package/dist/data-views/query-generator.d.ts +40 -0
- package/dist/data-views/query-generator.js +48 -0
- package/dist/data-views/registry.d.ts +17 -0
- package/dist/data-views/registry.js +20 -0
- package/dist/data-views/runtime.d.ts +32 -0
- package/dist/data-views/runtime.js +68 -0
- package/dist/data-views/spec.d.ts +32 -0
- package/dist/data-views/spec.js +10 -0
- package/dist/data-views/types.d.ts +157 -0
- package/dist/data-views/types.js +0 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.d.ts +6 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +17 -0
- package/dist/docs/index.d.ts +6 -0
- package/dist/docs/index.js +30 -0
- package/dist/docs/meta.docs.d.ts +6 -0
- package/dist/docs/meta.docs.js +29 -0
- package/dist/docs/presentations.d.ts +31 -0
- package/dist/docs/presentations.js +57 -0
- package/dist/docs/registry.d.ts +23 -0
- package/dist/docs/registry.js +51 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.d.ts +6 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.js +81 -0
- package/dist/docs/tech/cli.docblock.d.ts +6 -0
- package/dist/docs/tech/cli.docblock.js +138 -0
- package/dist/docs/tech/contracts/README.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/README.docblock.js +21 -0
- package/dist/docs/tech/contracts/migrations.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/migrations.docblock.js +21 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.js +58 -0
- package/dist/docs/tech/contracts/openapi-import.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/openapi-import.docblock.js +65 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +21 -0
- package/dist/docs/tech/contracts/overlays.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/overlays.docblock.js +21 -0
- package/dist/docs/tech/contracts/tests.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/tests.docblock.js +21 -0
- package/dist/docs/tech/contracts/themes.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/themes.docblock.js +21 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +126 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.d.ts +6 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.js +17 -0
- package/dist/docs/tech/llm/llm-integration.docblock.d.ts +7 -0
- package/dist/docs/tech/llm/llm-integration.docblock.js +358 -0
- package/dist/docs/tech/mcp-endpoints.docblock.d.ts +6 -0
- package/dist/docs/tech/mcp-endpoints.docblock.js +38 -0
- package/dist/docs/tech/presentation-runtime.docblock.d.ts +6 -0
- package/dist/docs/tech/presentation-runtime.docblock.js +17 -0
- package/dist/docs/tech/schema/README.docblock.d.ts +6 -0
- package/dist/docs/tech/schema/README.docblock.js +21 -0
- package/dist/docs/tech/studio/learning-events.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/learning-events.docblock.js +49 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.js +80 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.js +85 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.js +48 -0
- package/dist/docs/tech/studio/project-routing.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/project-routing.docblock.js +68 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.js +41 -0
- package/dist/docs/tech/studio/team-invitations.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/team-invitations.docblock.js +70 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.js +48 -0
- package/dist/docs/tech/studio/workspaces.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/workspaces.docblock.js +63 -0
- package/dist/docs/tech/telemetry-ingest.docblock.d.ts +6 -0
- package/dist/docs/tech/telemetry-ingest.docblock.js +156 -0
- package/dist/docs/tech/vscode-extension.docblock.d.ts +6 -0
- package/dist/docs/tech/vscode-extension.docblock.js +102 -0
- package/dist/docs/tech-contracts.docs.d.ts +6 -0
- package/dist/docs/tech-contracts.docs.js +96 -0
- package/dist/docs/types.d.ts +41 -0
- package/dist/docs/types.js +0 -0
- package/dist/events.d.ts +47 -0
- package/dist/events.js +19 -0
- package/dist/examples/docs/examples.docblock.d.ts +6 -0
- package/dist/examples/docs/examples.docblock.js +165 -0
- package/dist/examples/index.d.ts +13 -0
- package/dist/examples/index.js +13 -0
- package/dist/examples/registry.d.ts +43 -0
- package/dist/examples/registry.js +88 -0
- package/dist/examples/schema.d.ts +282 -0
- package/dist/examples/schema.js +125 -0
- package/dist/examples/types.d.ts +167 -0
- package/dist/examples/types.js +43 -0
- package/dist/examples/validation.d.ts +65 -0
- package/dist/examples/validation.js +144 -0
- package/dist/experiments/docs/experiments.docblock.d.ts +6 -0
- package/dist/experiments/docs/experiments.docblock.js +21 -0
- package/dist/experiments/evaluator.d.ts +37 -0
- package/dist/experiments/evaluator.js +101 -0
- package/dist/experiments/spec-resolver.d.ts +17 -0
- package/dist/experiments/spec-resolver.js +0 -0
- package/dist/experiments/spec.d.ts +80 -0
- package/dist/experiments/spec.js +15 -0
- package/dist/features/index.d.ts +13 -0
- package/dist/features/index.js +12 -0
- package/dist/features/install.d.ts +22 -0
- package/dist/features/install.js +36 -0
- package/dist/features/registry.d.ts +26 -0
- package/dist/features/registry.js +49 -0
- package/dist/features/types.d.ts +88 -0
- package/dist/features/types.js +0 -0
- package/dist/features/validation.d.ts +8 -0
- package/dist/features/validation.js +14 -0
- package/dist/forms/docs/forms.docblock.d.ts +6 -0
- package/dist/forms/docs/forms.docblock.js +21 -0
- package/dist/forms/forms.d.ts +266 -0
- package/dist/forms/forms.js +143 -0
- package/dist/forms/index.d.ts +2 -0
- package/dist/forms/index.js +3 -0
- package/dist/index.d.ts +154 -0
- package/dist/index.js +132 -0
- package/dist/install.d.ts +77 -0
- package/dist/install.js +40 -0
- package/dist/integrations/binding.d.ts +17 -0
- package/dist/integrations/binding.js +0 -0
- package/dist/integrations/connection.d.ts +51 -0
- package/dist/integrations/connection.js +0 -0
- package/dist/integrations/docs/integrations.docblock.d.ts +6 -0
- package/dist/integrations/docs/integrations.docblock.js +94 -0
- package/dist/integrations/health.d.ts +21 -0
- package/dist/integrations/health.js +69 -0
- package/dist/integrations/index.d.ts +34 -0
- package/dist/integrations/index.js +23 -0
- package/dist/integrations/integrations.capability.d.ts +7 -0
- package/dist/integrations/integrations.capability.js +17 -0
- package/dist/integrations/integrations.feature.d.ts +11 -0
- package/dist/integrations/integrations.feature.js +67 -0
- package/dist/integrations/openbanking/contracts/accounts.d.ts +289 -0
- package/dist/integrations/openbanking/contracts/accounts.js +236 -0
- package/dist/integrations/openbanking/contracts/balances.d.ts +165 -0
- package/dist/integrations/openbanking/contracts/balances.js +166 -0
- package/dist/integrations/openbanking/contracts/index.d.ts +10 -0
- package/dist/integrations/openbanking/contracts/index.js +12 -0
- package/dist/integrations/openbanking/contracts/transactions.d.ts +213 -0
- package/dist/integrations/openbanking/contracts/transactions.js +217 -0
- package/dist/integrations/openbanking/guards.d.ts +12 -0
- package/dist/integrations/openbanking/guards.js +33 -0
- package/dist/integrations/openbanking/models.d.ts +228 -0
- package/dist/integrations/openbanking/models.js +240 -0
- package/dist/integrations/openbanking/openbanking.capability.d.ts +7 -0
- package/dist/integrations/openbanking/openbanking.capability.js +21 -0
- package/dist/integrations/openbanking/openbanking.feature.d.ts +11 -0
- package/dist/integrations/openbanking/openbanking.feature.js +76 -0
- package/dist/integrations/openbanking/telemetry.d.ts +15 -0
- package/dist/integrations/openbanking/telemetry.js +39 -0
- package/dist/integrations/operations.d.ts +437 -0
- package/dist/integrations/operations.js +392 -0
- package/dist/integrations/providers/calendar.d.ts +78 -0
- package/dist/integrations/providers/calendar.js +0 -0
- package/dist/integrations/providers/elevenlabs.d.ts +8 -0
- package/dist/integrations/providers/elevenlabs.js +56 -0
- package/dist/integrations/providers/email.d.ts +86 -0
- package/dist/integrations/providers/email.js +0 -0
- package/dist/integrations/providers/embedding.d.ts +24 -0
- package/dist/integrations/providers/embedding.js +0 -0
- package/dist/integrations/providers/gcs-storage.d.ts +8 -0
- package/dist/integrations/providers/gcs-storage.js +79 -0
- package/dist/integrations/providers/gmail.d.ts +8 -0
- package/dist/integrations/providers/gmail.js +91 -0
- package/dist/integrations/providers/google-calendar.d.ts +8 -0
- package/dist/integrations/providers/google-calendar.js +70 -0
- package/dist/integrations/providers/impls/elevenlabs-voice.d.ts +20 -0
- package/dist/integrations/providers/impls/elevenlabs-voice.js +95 -0
- package/dist/integrations/providers/impls/gcs-storage.d.ts +24 -0
- package/dist/integrations/providers/impls/gcs-storage.js +88 -0
- package/dist/integrations/providers/impls/gmail-inbound.d.ts +26 -0
- package/dist/integrations/providers/impls/gmail-inbound.js +200 -0
- package/dist/integrations/providers/impls/gmail-outbound.d.ts +18 -0
- package/dist/integrations/providers/impls/gmail-outbound.js +105 -0
- package/dist/integrations/providers/impls/google-calendar.d.ts +23 -0
- package/dist/integrations/providers/impls/google-calendar.js +154 -0
- package/dist/integrations/providers/impls/index.d.ts +15 -0
- package/dist/integrations/providers/impls/index.js +16 -0
- package/dist/integrations/providers/impls/mistral-embedding.d.ts +23 -0
- package/dist/integrations/providers/impls/mistral-embedding.js +41 -0
- package/dist/integrations/providers/impls/mistral-llm.d.ts +31 -0
- package/dist/integrations/providers/impls/mistral-llm.js +247 -0
- package/dist/integrations/providers/impls/postmark-email.d.ts +19 -0
- package/dist/integrations/providers/impls/postmark-email.js +55 -0
- package/dist/integrations/providers/impls/powens-client.d.ts +124 -0
- package/dist/integrations/providers/impls/powens-client.js +171 -0
- package/dist/integrations/providers/impls/powens-openbanking.d.ts +27 -0
- package/dist/integrations/providers/impls/powens-openbanking.js +218 -0
- package/dist/integrations/providers/impls/provider-factory.d.ts +26 -0
- package/dist/integrations/providers/impls/provider-factory.js +146 -0
- package/dist/integrations/providers/impls/qdrant-vector.d.ts +24 -0
- package/dist/integrations/providers/impls/qdrant-vector.js +69 -0
- package/dist/integrations/providers/impls/stripe-payments.d.ts +28 -0
- package/dist/integrations/providers/impls/stripe-payments.js +202 -0
- package/dist/integrations/providers/impls/twilio-sms.d.ts +20 -0
- package/dist/integrations/providers/impls/twilio-sms.js +58 -0
- package/dist/integrations/providers/index.d.ts +22 -0
- package/dist/integrations/providers/index.js +13 -0
- package/dist/integrations/providers/llm.d.ts +82 -0
- package/dist/integrations/providers/llm.js +0 -0
- package/dist/integrations/providers/mistral.d.ts +8 -0
- package/dist/integrations/providers/mistral.js +72 -0
- package/dist/integrations/providers/openbanking.d.ts +128 -0
- package/dist/integrations/providers/openbanking.js +0 -0
- package/dist/integrations/providers/payments.d.ts +109 -0
- package/dist/integrations/providers/payments.js +0 -0
- package/dist/integrations/providers/postmark.d.ts +8 -0
- package/dist/integrations/providers/postmark.js +72 -0
- package/dist/integrations/providers/powens.d.ts +8 -0
- package/dist/integrations/providers/powens.js +120 -0
- package/dist/integrations/providers/qdrant.d.ts +8 -0
- package/dist/integrations/providers/qdrant.js +77 -0
- package/dist/integrations/providers/registry.d.ts +11 -0
- package/dist/integrations/providers/registry.js +34 -0
- package/dist/integrations/providers/sms.d.ts +34 -0
- package/dist/integrations/providers/sms.js +0 -0
- package/dist/integrations/providers/storage.d.ts +60 -0
- package/dist/integrations/providers/storage.js +0 -0
- package/dist/integrations/providers/stripe.d.ts +8 -0
- package/dist/integrations/providers/stripe.js +87 -0
- package/dist/integrations/providers/twilio-sms.d.ts +8 -0
- package/dist/integrations/providers/twilio-sms.js +65 -0
- package/dist/integrations/providers/vector-store.d.ts +43 -0
- package/dist/integrations/providers/vector-store.js +0 -0
- package/dist/integrations/providers/voice.d.ts +34 -0
- package/dist/integrations/providers/voice.js +0 -0
- package/dist/integrations/runtime.d.ts +99 -0
- package/dist/integrations/runtime.js +186 -0
- package/dist/integrations/secrets/aws-secret-manager.d.ts +31 -0
- package/dist/integrations/secrets/aws-secret-manager.js +231 -0
- package/dist/integrations/secrets/env-secret-provider.d.ts +31 -0
- package/dist/integrations/secrets/env-secret-provider.js +81 -0
- package/dist/integrations/secrets/gcp-secret-manager.d.ts +32 -0
- package/dist/integrations/secrets/gcp-secret-manager.js +229 -0
- package/dist/integrations/secrets/index.d.ts +7 -0
- package/dist/integrations/secrets/index.js +8 -0
- package/dist/integrations/secrets/manager.d.ts +47 -0
- package/dist/integrations/secrets/manager.js +103 -0
- package/dist/integrations/secrets/provider.d.ts +52 -0
- package/dist/integrations/secrets/provider.js +58 -0
- package/dist/integrations/secrets/scaleway-secret-manager.d.ts +38 -0
- package/dist/integrations/secrets/scaleway-secret-manager.js +247 -0
- package/dist/integrations/secrets-types.d.ts +17 -0
- package/dist/integrations/secrets-types.js +0 -0
- package/dist/integrations/spec.d.ts +77 -0
- package/dist/integrations/spec.js +22 -0
- package/dist/jobs/define-job.d.ts +18 -0
- package/dist/jobs/define-job.js +16 -0
- package/dist/jobs/gcp-cloud-tasks.d.ts +41 -0
- package/dist/jobs/gcp-cloud-tasks.js +53 -0
- package/dist/jobs/gcp-pubsub.d.ts +25 -0
- package/dist/jobs/gcp-pubsub.js +39 -0
- package/dist/jobs/handlers/gmail-sync-handler.d.ts +9 -0
- package/dist/jobs/handlers/gmail-sync-handler.js +9 -0
- package/dist/jobs/handlers/index.d.ts +9 -0
- package/dist/jobs/handlers/index.js +12 -0
- package/dist/jobs/handlers/ping-handler.d.ts +10 -0
- package/dist/jobs/handlers/ping-handler.js +15 -0
- package/dist/jobs/handlers/storage-document-handler.d.ts +12 -0
- package/dist/jobs/handlers/storage-document-handler.js +14 -0
- package/dist/jobs/index.d.ts +3 -0
- package/dist/jobs/index.js +4 -0
- package/dist/jobs/memory-queue.d.ts +18 -0
- package/dist/jobs/memory-queue.js +71 -0
- package/dist/jobs/queue.d.ts +131 -0
- package/dist/jobs/queue.js +33 -0
- package/dist/jobs/scaleway-sqs-queue.d.ts +30 -0
- package/dist/jobs/scaleway-sqs-queue.js +153 -0
- package/dist/jsonschema.d.ts +42 -0
- package/dist/jsonschema.js +51 -0
- package/dist/knowledge/binding.d.ts +25 -0
- package/dist/knowledge/binding.js +0 -0
- package/dist/knowledge/docs/knowledge.docblock.d.ts +6 -0
- package/dist/knowledge/docs/knowledge.docblock.js +21 -0
- package/dist/knowledge/index.d.ts +11 -0
- package/dist/knowledge/index.js +10 -0
- package/dist/knowledge/ingestion/document-processor.d.ts +24 -0
- package/dist/knowledge/ingestion/document-processor.js +54 -0
- package/dist/knowledge/ingestion/embedding-service.d.ts +12 -0
- package/dist/knowledge/ingestion/embedding-service.js +25 -0
- package/dist/knowledge/ingestion/gmail-adapter.d.ts +18 -0
- package/dist/knowledge/ingestion/gmail-adapter.js +51 -0
- package/dist/knowledge/ingestion/index.d.ts +6 -0
- package/dist/knowledge/ingestion/index.js +7 -0
- package/dist/knowledge/ingestion/storage-adapter.d.ts +15 -0
- package/dist/knowledge/ingestion/storage-adapter.js +26 -0
- package/dist/knowledge/ingestion/vector-indexer.d.ts +18 -0
- package/dist/knowledge/ingestion/vector-indexer.js +32 -0
- package/dist/knowledge/knowledge.capability.d.ts +7 -0
- package/dist/knowledge/knowledge.capability.js +21 -0
- package/dist/knowledge/knowledge.feature.d.ts +11 -0
- package/dist/knowledge/knowledge.feature.js +68 -0
- package/dist/knowledge/operations.d.ts +318 -0
- package/dist/knowledge/operations.js +321 -0
- package/dist/knowledge/query/index.d.ts +2 -0
- package/dist/knowledge/query/index.js +3 -0
- package/dist/knowledge/query/service.d.ts +29 -0
- package/dist/knowledge/query/service.js +65 -0
- package/dist/knowledge/runtime.d.ts +32 -0
- package/dist/knowledge/runtime.js +49 -0
- package/dist/knowledge/source.d.ts +32 -0
- package/dist/knowledge/source.js +0 -0
- package/dist/knowledge/spaces/email-threads.d.ts +7 -0
- package/dist/knowledge/spaces/email-threads.js +37 -0
- package/dist/knowledge/spaces/financial-docs.d.ts +7 -0
- package/dist/knowledge/spaces/financial-docs.js +37 -0
- package/dist/knowledge/spaces/financial-overview.d.ts +7 -0
- package/dist/knowledge/spaces/financial-overview.js +41 -0
- package/dist/knowledge/spaces/index.d.ts +7 -0
- package/dist/knowledge/spaces/index.js +8 -0
- package/dist/knowledge/spaces/product-canon.d.ts +7 -0
- package/dist/knowledge/spaces/product-canon.js +37 -0
- package/dist/knowledge/spaces/support-faq.d.ts +7 -0
- package/dist/knowledge/spaces/support-faq.js +40 -0
- package/dist/knowledge/spaces/uploaded-docs.d.ts +7 -0
- package/dist/knowledge/spaces/uploaded-docs.js +37 -0
- package/dist/knowledge/spec.d.ts +46 -0
- package/dist/knowledge/spec.js +17 -0
- package/dist/llm/exporters.d.ts +70 -0
- package/dist/llm/exporters.js +542 -0
- package/dist/llm/index.d.ts +4 -0
- package/dist/llm/index.js +4 -0
- package/dist/llm/prompts.d.ts +52 -0
- package/dist/llm/prompts.js +410 -0
- package/dist/llm/types.d.ts +215 -0
- package/dist/llm/types.js +0 -0
- package/dist/markdown.d.ts +22 -0
- package/dist/markdown.js +119 -0
- package/dist/migrations.d.ts +52 -0
- package/dist/migrations.js +31 -0
- package/dist/model-registry.d.ts +13 -0
- package/dist/model-registry.js +33 -0
- package/dist/onboarding-base.d.ts +138 -0
- package/dist/onboarding-base.js +195 -0
- package/dist/openapi.d.ts +31 -0
- package/dist/openapi.js +82 -0
- package/dist/operations/index.d.ts +3 -0
- package/dist/operations/index.js +4 -0
- package/dist/operations/operation.d.ts +186 -0
- package/dist/operations/operation.js +35 -0
- package/dist/operations/registry.d.ts +54 -0
- package/dist/operations/registry.js +176 -0
- package/dist/ownership.d.ts +84 -0
- package/dist/ownership.js +38 -0
- package/dist/policy/docs/policy.docblock.d.ts +6 -0
- package/dist/policy/docs/policy.docblock.js +21 -0
- package/dist/policy/engine.d.ts +40 -0
- package/dist/policy/engine.js +225 -0
- package/dist/policy/index.d.ts +5 -0
- package/dist/policy/index.js +5 -0
- package/dist/policy/opa-adapter.d.ts +45 -0
- package/dist/policy/opa-adapter.js +71 -0
- package/dist/policy/registry.d.ts +9 -0
- package/dist/policy/registry.js +11 -0
- package/dist/policy/spec.d.ts +103 -0
- package/dist/policy/spec.js +0 -0
- package/dist/presentations/docs/presentations-conventions.docblock.d.ts +6 -0
- package/dist/presentations/docs/presentations-conventions.docblock.js +21 -0
- package/dist/presentations/index.d.ts +4 -0
- package/dist/presentations/index.js +5 -0
- package/dist/presentations/presentations.d.ts +50 -0
- package/dist/presentations/presentations.js +7 -0
- package/dist/presentations/registry.d.ts +10 -0
- package/dist/presentations/registry.js +12 -0
- package/dist/presentations/transform-engine.d.ts +66 -0
- package/dist/presentations/transform-engine.js +282 -0
- package/dist/prompt.d.ts +53 -0
- package/dist/prompt.js +10 -0
- package/dist/promptRegistry.d.ts +15 -0
- package/dist/promptRegistry.js +31 -0
- package/dist/regenerator/adapters.d.ts +19 -0
- package/dist/regenerator/adapters.js +0 -0
- package/dist/regenerator/docs/regenerator.docblock.d.ts +6 -0
- package/dist/regenerator/docs/regenerator.docblock.js +21 -0
- package/dist/regenerator/executor.d.ts +70 -0
- package/dist/regenerator/executor.js +86 -0
- package/dist/regenerator/index.d.ts +7 -0
- package/dist/regenerator/index.js +6 -0
- package/dist/regenerator/service.d.ts +33 -0
- package/dist/regenerator/service.js +93 -0
- package/dist/regenerator/sinks.d.ts +26 -0
- package/dist/regenerator/sinks.js +32 -0
- package/dist/regenerator/types.d.ts +107 -0
- package/dist/regenerator/types.js +0 -0
- package/dist/regenerator/utils.d.ts +9 -0
- package/dist/regenerator/utils.js +51 -0
- package/dist/registry-utils.d.ts +106 -0
- package/dist/registry-utils.js +122 -0
- package/dist/registry.d.ts +32 -0
- package/dist/registry.js +61 -0
- package/dist/resources.d.ts +64 -0
- package/dist/resources.js +50 -0
- package/dist/schema-to-markdown.d.ts +54 -0
- package/dist/schema-to-markdown.js +217 -0
- package/dist/server/contracts-adapter-hydration.d.ts +15 -0
- package/dist/server/contracts-adapter-hydration.js +41 -0
- package/dist/server/contracts-adapter-input.d.ts +9 -0
- package/dist/server/contracts-adapter-input.js +83 -0
- package/dist/server/graphql-pothos.d.ts +31 -0
- package/dist/server/graphql-pothos.js +134 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.js +10 -0
- package/dist/server/mcp/createMcpServer.d.ts +15 -0
- package/dist/server/mcp/createMcpServer.js +27 -0
- package/dist/server/mcp/mcpTypes.d.ts +27 -0
- package/dist/server/mcp/mcpTypes.js +0 -0
- package/dist/server/mcp/registerPresentations.d.ts +7 -0
- package/dist/server/mcp/registerPresentations.js +54 -0
- package/dist/server/mcp/registerPrompts.d.ts +8 -0
- package/dist/server/mcp/registerPrompts.js +41 -0
- package/dist/server/mcp/registerResources.d.ts +8 -0
- package/dist/server/mcp/registerResources.js +35 -0
- package/dist/server/mcp/registerTools.d.ts +8 -0
- package/dist/server/mcp/registerTools.js +22 -0
- package/dist/server/provider-mcp.d.ts +2 -0
- package/dist/server/provider-mcp.js +3 -0
- package/dist/server/rest-elysia.d.ts +40 -0
- package/dist/server/rest-elysia.js +20 -0
- package/dist/server/rest-express.d.ts +16 -0
- package/dist/server/rest-express.js +36 -0
- package/dist/server/rest-generic.d.ts +32 -0
- package/dist/server/rest-generic.js +124 -0
- package/dist/server/rest-next-app.d.ts +35 -0
- package/dist/server/rest-next-app.js +38 -0
- package/dist/server/rest-next-mcp.d.ts +11 -0
- package/dist/server/rest-next-mcp.js +45 -0
- package/dist/server/rest-next-pages.d.ts +9 -0
- package/dist/server/rest-next-pages.js +22 -0
- package/dist/telemetry/anomaly.d.ts +27 -0
- package/dist/telemetry/anomaly.js +48 -0
- package/dist/telemetry/docs/telemetry.docblock.d.ts +6 -0
- package/dist/telemetry/docs/telemetry.docblock.js +21 -0
- package/dist/telemetry/index.d.ts +4 -0
- package/dist/telemetry/index.js +5 -0
- package/dist/telemetry/spec.d.ts +91 -0
- package/dist/telemetry/spec.js +42 -0
- package/dist/telemetry/tracker.d.ts +51 -0
- package/dist/telemetry/tracker.js +76 -0
- package/dist/tests/index.d.ts +3 -0
- package/dist/tests/index.js +4 -0
- package/dist/tests/runner.d.ts +43 -0
- package/dist/tests/runner.js +150 -0
- package/dist/tests/spec.d.ts +82 -0
- package/dist/tests/spec.js +34 -0
- package/dist/themes.d.ts +51 -0
- package/dist/themes.js +17 -0
- package/dist/translations/catalog.d.ts +28 -0
- package/dist/translations/catalog.js +0 -0
- package/dist/translations/tenant.d.ts +15 -0
- package/dist/translations/tenant.js +0 -0
- package/dist/types.d.ts +92 -0
- package/dist/types.js +0 -0
- package/dist/versioning/index.d.ts +3 -0
- package/dist/versioning/index.js +4 -0
- package/dist/versioning/types.d.ts +127 -0
- package/dist/versioning/types.js +24 -0
- package/dist/versioning/utils.d.ts +95 -0
- package/dist/versioning/utils.js +180 -0
- package/dist/workflow/adapters/db-adapter.d.ts +46 -0
- package/dist/workflow/adapters/db-adapter.js +83 -0
- package/dist/workflow/adapters/file-adapter.d.ts +14 -0
- package/dist/workflow/adapters/file-adapter.js +11 -0
- package/dist/workflow/adapters/index.d.ts +4 -0
- package/dist/workflow/adapters/index.js +5 -0
- package/dist/workflow/adapters/memory-store.d.ts +18 -0
- package/dist/workflow/adapters/memory-store.js +58 -0
- package/dist/workflow/expression.d.ts +9 -0
- package/dist/workflow/expression.js +99 -0
- package/dist/workflow/index.d.ts +17 -0
- package/dist/workflow/index.js +16 -0
- package/dist/workflow/overview.docblock.d.ts +6 -0
- package/dist/workflow/overview.docblock.js +21 -0
- package/dist/workflow/runner.d.ts +77 -0
- package/dist/workflow/runner.js +337 -0
- package/dist/workflow/sla-monitor.d.ts +20 -0
- package/dist/workflow/sla-monitor.js +47 -0
- package/dist/workflow/spec.d.ts +93 -0
- package/dist/workflow/spec.js +11 -0
- package/dist/workflow/state.d.ts +35 -0
- package/dist/workflow/state.js +0 -0
- package/dist/workflow/validation.d.ts +29 -0
- package/dist/workflow/validation.js +176 -0
- package/dist/workspace-config/contractsrc-schema.d.ts +1162 -0
- package/dist/workspace-config/contractsrc-schema.js +421 -0
- package/dist/workspace-config/index.d.ts +2 -0
- package/dist/workspace-config/index.js +3 -0
- package/dist/workspace-config/workspace-config.docblock.d.ts +6 -0
- package/dist/workspace-config/workspace-config.docblock.js +45 -0
- package/package.json +618 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { DocBlock } from "../docs/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/versioning/types.d.ts
|
|
4
|
+
|
|
5
|
+
/** Version bump type based on semantic versioning */
|
|
6
|
+
type VersionBumpType = 'patch' | 'minor' | 'major';
|
|
7
|
+
/** Semantic version components */
|
|
8
|
+
interface SemanticVersion {
|
|
9
|
+
major: number;
|
|
10
|
+
minor: number;
|
|
11
|
+
patch: number;
|
|
12
|
+
prerelease?: string;
|
|
13
|
+
build?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Type of change for changelog entries */
|
|
16
|
+
type ChangeType = 'added' | 'changed' | 'fixed' | 'removed' | 'deprecated' | 'breaking' | 'security';
|
|
17
|
+
/** Individual change entry */
|
|
18
|
+
interface ChangeEntry {
|
|
19
|
+
/** Type of change */
|
|
20
|
+
type: ChangeType;
|
|
21
|
+
/** Human-readable description of the change */
|
|
22
|
+
description: string;
|
|
23
|
+
/** Schema/code path changed (e.g., "io.input.email", "meta.stability") */
|
|
24
|
+
path?: string;
|
|
25
|
+
/** Related issue/ticket reference (e.g., "GH-123", "JIRA-456") */
|
|
26
|
+
issueRef?: string;
|
|
27
|
+
/** Git commit SHA for traceability */
|
|
28
|
+
commitSha?: string;
|
|
29
|
+
/** Author of the change */
|
|
30
|
+
author?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Changelog entry for a specific version */
|
|
33
|
+
interface ChangelogEntry {
|
|
34
|
+
/** Version number (semver format) */
|
|
35
|
+
version: string;
|
|
36
|
+
/** Release date (ISO 8601 format) */
|
|
37
|
+
date: string;
|
|
38
|
+
/** Type of version bump that led to this version */
|
|
39
|
+
bumpType: VersionBumpType;
|
|
40
|
+
/** List of changes in this version */
|
|
41
|
+
changes: ChangeEntry[];
|
|
42
|
+
/** Breaking changes (subset for emphasis) */
|
|
43
|
+
breakingChanges?: ChangeEntry[];
|
|
44
|
+
/** Deprecation notices */
|
|
45
|
+
deprecations?: ChangeEntry[];
|
|
46
|
+
/** Contributors to this version */
|
|
47
|
+
contributors?: string[];
|
|
48
|
+
/** Release notes summary */
|
|
49
|
+
summary?: string;
|
|
50
|
+
}
|
|
51
|
+
/** DocBlock extension for per-spec changelogs */
|
|
52
|
+
interface ChangelogDocBlock extends DocBlock {
|
|
53
|
+
/** Changelog-specific kind */
|
|
54
|
+
kind: 'changelog';
|
|
55
|
+
/** Related spec key (e.g., "auth.beginSignup") */
|
|
56
|
+
specKey: string;
|
|
57
|
+
/** Current spec version */
|
|
58
|
+
specVersion: string;
|
|
59
|
+
/** Changelog entries for this spec */
|
|
60
|
+
entries: ChangelogEntry[];
|
|
61
|
+
}
|
|
62
|
+
/** Result of version analysis for a single spec */
|
|
63
|
+
interface VersionAnalysis {
|
|
64
|
+
/** Path to the spec file */
|
|
65
|
+
specPath: string;
|
|
66
|
+
/** Spec key (e.g., "auth.login") */
|
|
67
|
+
specKey: string;
|
|
68
|
+
/** Current version in the spec */
|
|
69
|
+
currentVersion: string;
|
|
70
|
+
/** Suggested new version based on changes */
|
|
71
|
+
suggestedVersion: string;
|
|
72
|
+
/** Suggested bump type */
|
|
73
|
+
bumpType: VersionBumpType;
|
|
74
|
+
/** Detected changes requiring version bump */
|
|
75
|
+
changes: ChangeEntry[];
|
|
76
|
+
/** Whether breaking changes were detected */
|
|
77
|
+
hasBreaking: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** Aggregated version analysis result */
|
|
80
|
+
interface VersionAnalysisResult {
|
|
81
|
+
/** Individual spec analyses */
|
|
82
|
+
analyses: VersionAnalysis[];
|
|
83
|
+
/** Total specs analyzed */
|
|
84
|
+
totalSpecs: number;
|
|
85
|
+
/** Specs needing version bump */
|
|
86
|
+
specsNeedingBump: number;
|
|
87
|
+
/** Total breaking changes across all specs */
|
|
88
|
+
totalBreaking: number;
|
|
89
|
+
/** Git baseline used for comparison */
|
|
90
|
+
baseline?: string;
|
|
91
|
+
}
|
|
92
|
+
/** Result of changelog generation */
|
|
93
|
+
interface ChangelogResult {
|
|
94
|
+
/** Per-spec DocBlock entries */
|
|
95
|
+
specChangelogs: ChangelogDocBlock[];
|
|
96
|
+
/** Library-level markdown by package path */
|
|
97
|
+
libraryMarkdown: Map<string, string>;
|
|
98
|
+
/** Monorepo-level markdown */
|
|
99
|
+
monorepoMarkdown: string;
|
|
100
|
+
/** JSON format for programmatic use */
|
|
101
|
+
json: ChangelogJsonExport;
|
|
102
|
+
}
|
|
103
|
+
/** JSON export format for changelogs */
|
|
104
|
+
interface ChangelogJsonExport {
|
|
105
|
+
generatedAt: string;
|
|
106
|
+
baseline?: string;
|
|
107
|
+
specs: {
|
|
108
|
+
key: string;
|
|
109
|
+
version: string;
|
|
110
|
+
path: string;
|
|
111
|
+
entries: ChangelogEntry[];
|
|
112
|
+
}[];
|
|
113
|
+
libraries: {
|
|
114
|
+
name: string;
|
|
115
|
+
path: string;
|
|
116
|
+
version: string;
|
|
117
|
+
entries: ChangelogEntry[];
|
|
118
|
+
}[];
|
|
119
|
+
}
|
|
120
|
+
/** Check if a DocBlock is a ChangelogDocBlock */
|
|
121
|
+
declare function isChangelogDocBlock(doc: DocBlock): doc is ChangelogDocBlock;
|
|
122
|
+
/** Check if a string is a valid VersionBumpType */
|
|
123
|
+
declare function isVersionBumpType(value: unknown): value is VersionBumpType;
|
|
124
|
+
/** Check if a string is a valid ChangeType */
|
|
125
|
+
declare function isChangeType(value: unknown): value is ChangeType;
|
|
126
|
+
//#endregion
|
|
127
|
+
export { ChangeEntry, ChangeType, ChangelogDocBlock, ChangelogEntry, ChangelogJsonExport, ChangelogResult, SemanticVersion, VersionAnalysis, VersionAnalysisResult, VersionBumpType, isChangeType, isChangelogDocBlock, isVersionBumpType };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/versioning/types.ts
|
|
2
|
+
/** Check if a DocBlock is a ChangelogDocBlock */
|
|
3
|
+
function isChangelogDocBlock(doc) {
|
|
4
|
+
return doc.kind === "changelog" && "specKey" in doc && "entries" in doc;
|
|
5
|
+
}
|
|
6
|
+
/** Check if a string is a valid VersionBumpType */
|
|
7
|
+
function isVersionBumpType(value) {
|
|
8
|
+
return value === "patch" || value === "minor" || value === "major";
|
|
9
|
+
}
|
|
10
|
+
/** Check if a string is a valid ChangeType */
|
|
11
|
+
function isChangeType(value) {
|
|
12
|
+
return typeof value === "string" && [
|
|
13
|
+
"added",
|
|
14
|
+
"changed",
|
|
15
|
+
"fixed",
|
|
16
|
+
"removed",
|
|
17
|
+
"deprecated",
|
|
18
|
+
"breaking",
|
|
19
|
+
"security"
|
|
20
|
+
].includes(value);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { isChangeType, isChangelogDocBlock, isVersionBumpType };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { SemanticVersion, VersionBumpType } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/versioning/utils.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Parse a semantic version string into components.
|
|
7
|
+
*
|
|
8
|
+
* @param version - Version string (e.g., "1.2.3", "1.0.0-alpha.1")
|
|
9
|
+
* @returns Parsed SemanticVersion or null if invalid
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* parseVersion("1.2.3") // { major: 1, minor: 2, patch: 3 }
|
|
13
|
+
* parseVersion("2.0.0-beta.1") // { major: 2, minor: 0, patch: 0, prerelease: "beta.1" }
|
|
14
|
+
*/
|
|
15
|
+
declare function parseVersion(version: string): SemanticVersion | null;
|
|
16
|
+
/**
|
|
17
|
+
* Strictly parse a version, throwing on invalid input.
|
|
18
|
+
*
|
|
19
|
+
* @throws Error if version is not valid semver
|
|
20
|
+
*/
|
|
21
|
+
declare function parseVersionStrict(version: string): SemanticVersion;
|
|
22
|
+
/**
|
|
23
|
+
* Format a SemanticVersion back to string.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* formatVersion({ major: 1, minor: 2, patch: 3 }) // "1.2.3"
|
|
27
|
+
* formatVersion({ major: 2, minor: 0, patch: 0, prerelease: "beta.1" }) // "2.0.0-beta.1"
|
|
28
|
+
*/
|
|
29
|
+
declare function formatVersion(version: SemanticVersion): string;
|
|
30
|
+
/**
|
|
31
|
+
* Compare two version strings.
|
|
32
|
+
*
|
|
33
|
+
* @returns -1 if a < b, 0 if a === b, 1 if a > b
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* compareVersions("1.0.0", "2.0.0") // -1
|
|
37
|
+
* compareVersions("1.2.3", "1.2.3") // 0
|
|
38
|
+
* compareVersions("2.0.0", "1.9.9") // 1
|
|
39
|
+
*/
|
|
40
|
+
declare function compareVersions(a: string, b: string): -1 | 0 | 1;
|
|
41
|
+
/**
|
|
42
|
+
* Check if version a is greater than version b.
|
|
43
|
+
*/
|
|
44
|
+
declare function isVersionGreater(a: string, b: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Check if version a is less than version b.
|
|
47
|
+
*/
|
|
48
|
+
declare function isVersionLess(a: string, b: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Check if two versions are equal.
|
|
51
|
+
*/
|
|
52
|
+
declare function isVersionEqual(a: string, b: string): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Bump a version by the specified type.
|
|
55
|
+
*
|
|
56
|
+
* @param current - Current version string
|
|
57
|
+
* @param bumpType - Type of bump: 'patch', 'minor', or 'major'
|
|
58
|
+
* @returns New version string
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* bumpVersion("1.2.3", "patch") // "1.2.4"
|
|
62
|
+
* bumpVersion("1.2.3", "minor") // "1.3.0"
|
|
63
|
+
* bumpVersion("1.2.3", "major") // "2.0.0"
|
|
64
|
+
*/
|
|
65
|
+
declare function bumpVersion(current: string, bumpType: VersionBumpType): string;
|
|
66
|
+
/**
|
|
67
|
+
* Determine the appropriate version bump type based on change impact.
|
|
68
|
+
*
|
|
69
|
+
* - Breaking changes → major
|
|
70
|
+
* - Non-breaking additions/changes → minor
|
|
71
|
+
* - Fixes only → patch
|
|
72
|
+
*
|
|
73
|
+
* @param hasBreaking - Whether breaking changes were detected
|
|
74
|
+
* @param hasNonBreaking - Whether non-breaking changes (additions, changes) were detected
|
|
75
|
+
* @returns Appropriate bump type
|
|
76
|
+
*/
|
|
77
|
+
declare function determineBumpType(hasBreaking: boolean, hasNonBreaking: boolean): VersionBumpType;
|
|
78
|
+
/**
|
|
79
|
+
* Get sort priority for bump types (higher = more significant).
|
|
80
|
+
*/
|
|
81
|
+
declare function getBumpTypePriority(bumpType: VersionBumpType): number;
|
|
82
|
+
/**
|
|
83
|
+
* Get the most significant bump type from a list.
|
|
84
|
+
*/
|
|
85
|
+
declare function getMaxBumpType(bumpTypes: VersionBumpType[]): VersionBumpType | null;
|
|
86
|
+
/**
|
|
87
|
+
* Check if a string is a valid semantic version.
|
|
88
|
+
*/
|
|
89
|
+
declare function isValidVersion(version: string): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Validate a version string, returning validation errors.
|
|
92
|
+
*/
|
|
93
|
+
declare function validateVersion(version: string): string[];
|
|
94
|
+
//#endregion
|
|
95
|
+
export { bumpVersion, compareVersions, determineBumpType, formatVersion, getBumpTypePriority, getMaxBumpType, isValidVersion, isVersionEqual, isVersionGreater, isVersionLess, parseVersion, parseVersionStrict, validateVersion };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
//#region src/versioning/utils.ts
|
|
2
|
+
/** Regex for parsing semantic versions */
|
|
3
|
+
const SEMVER_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*))?(?:\+([a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*))?$/;
|
|
4
|
+
/**
|
|
5
|
+
* Parse a semantic version string into components.
|
|
6
|
+
*
|
|
7
|
+
* @param version - Version string (e.g., "1.2.3", "1.0.0-alpha.1")
|
|
8
|
+
* @returns Parsed SemanticVersion or null if invalid
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* parseVersion("1.2.3") // { major: 1, minor: 2, patch: 3 }
|
|
12
|
+
* parseVersion("2.0.0-beta.1") // { major: 2, minor: 0, patch: 0, prerelease: "beta.1" }
|
|
13
|
+
*/
|
|
14
|
+
function parseVersion(version) {
|
|
15
|
+
const match = version.trim().match(SEMVER_REGEX);
|
|
16
|
+
if (!match) return null;
|
|
17
|
+
const majorStr = match[1];
|
|
18
|
+
const minorStr = match[2];
|
|
19
|
+
const patchStr = match[3];
|
|
20
|
+
const prerelease = match[4];
|
|
21
|
+
const build = match[5];
|
|
22
|
+
if (!majorStr || !minorStr || !patchStr) return null;
|
|
23
|
+
return {
|
|
24
|
+
major: parseInt(majorStr, 10),
|
|
25
|
+
minor: parseInt(minorStr, 10),
|
|
26
|
+
patch: parseInt(patchStr, 10),
|
|
27
|
+
...prerelease && { prerelease },
|
|
28
|
+
...build && { build }
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Strictly parse a version, throwing on invalid input.
|
|
33
|
+
*
|
|
34
|
+
* @throws Error if version is not valid semver
|
|
35
|
+
*/
|
|
36
|
+
function parseVersionStrict(version) {
|
|
37
|
+
const parsed = parseVersion(version);
|
|
38
|
+
if (!parsed) throw new Error(`Invalid semantic version: "${version}"`);
|
|
39
|
+
return parsed;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Format a SemanticVersion back to string.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* formatVersion({ major: 1, minor: 2, patch: 3 }) // "1.2.3"
|
|
46
|
+
* formatVersion({ major: 2, minor: 0, patch: 0, prerelease: "beta.1" }) // "2.0.0-beta.1"
|
|
47
|
+
*/
|
|
48
|
+
function formatVersion(version) {
|
|
49
|
+
let result = `${version.major}.${version.minor}.${version.patch}`;
|
|
50
|
+
if (version.prerelease) result += `-${version.prerelease}`;
|
|
51
|
+
if (version.build) result += `+${version.build}`;
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Compare two version strings.
|
|
56
|
+
*
|
|
57
|
+
* @returns -1 if a < b, 0 if a === b, 1 if a > b
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* compareVersions("1.0.0", "2.0.0") // -1
|
|
61
|
+
* compareVersions("1.2.3", "1.2.3") // 0
|
|
62
|
+
* compareVersions("2.0.0", "1.9.9") // 1
|
|
63
|
+
*/
|
|
64
|
+
function compareVersions(a, b) {
|
|
65
|
+
const versionA = parseVersionStrict(a);
|
|
66
|
+
const versionB = parseVersionStrict(b);
|
|
67
|
+
if (versionA.major !== versionB.major) return versionA.major > versionB.major ? 1 : -1;
|
|
68
|
+
if (versionA.minor !== versionB.minor) return versionA.minor > versionB.minor ? 1 : -1;
|
|
69
|
+
if (versionA.patch !== versionB.patch) return versionA.patch > versionB.patch ? 1 : -1;
|
|
70
|
+
if (versionA.prerelease && !versionB.prerelease) return -1;
|
|
71
|
+
if (!versionA.prerelease && versionB.prerelease) return 1;
|
|
72
|
+
if (versionA.prerelease && versionB.prerelease) return versionA.prerelease < versionB.prerelease ? -1 : versionA.prerelease > versionB.prerelease ? 1 : 0;
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Check if version a is greater than version b.
|
|
77
|
+
*/
|
|
78
|
+
function isVersionGreater(a, b) {
|
|
79
|
+
return compareVersions(a, b) === 1;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Check if version a is less than version b.
|
|
83
|
+
*/
|
|
84
|
+
function isVersionLess(a, b) {
|
|
85
|
+
return compareVersions(a, b) === -1;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Check if two versions are equal.
|
|
89
|
+
*/
|
|
90
|
+
function isVersionEqual(a, b) {
|
|
91
|
+
return compareVersions(a, b) === 0;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Bump a version by the specified type.
|
|
95
|
+
*
|
|
96
|
+
* @param current - Current version string
|
|
97
|
+
* @param bumpType - Type of bump: 'patch', 'minor', or 'major'
|
|
98
|
+
* @returns New version string
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* bumpVersion("1.2.3", "patch") // "1.2.4"
|
|
102
|
+
* bumpVersion("1.2.3", "minor") // "1.3.0"
|
|
103
|
+
* bumpVersion("1.2.3", "major") // "2.0.0"
|
|
104
|
+
*/
|
|
105
|
+
function bumpVersion(current, bumpType) {
|
|
106
|
+
const version = parseVersionStrict(current);
|
|
107
|
+
switch (bumpType) {
|
|
108
|
+
case "major": return formatVersion({
|
|
109
|
+
major: version.major + 1,
|
|
110
|
+
minor: 0,
|
|
111
|
+
patch: 0
|
|
112
|
+
});
|
|
113
|
+
case "minor": return formatVersion({
|
|
114
|
+
major: version.major,
|
|
115
|
+
minor: version.minor + 1,
|
|
116
|
+
patch: 0
|
|
117
|
+
});
|
|
118
|
+
case "patch": return formatVersion({
|
|
119
|
+
major: version.major,
|
|
120
|
+
minor: version.minor,
|
|
121
|
+
patch: version.patch + 1
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Determine the appropriate version bump type based on change impact.
|
|
127
|
+
*
|
|
128
|
+
* - Breaking changes → major
|
|
129
|
+
* - Non-breaking additions/changes → minor
|
|
130
|
+
* - Fixes only → patch
|
|
131
|
+
*
|
|
132
|
+
* @param hasBreaking - Whether breaking changes were detected
|
|
133
|
+
* @param hasNonBreaking - Whether non-breaking changes (additions, changes) were detected
|
|
134
|
+
* @returns Appropriate bump type
|
|
135
|
+
*/
|
|
136
|
+
function determineBumpType(hasBreaking, hasNonBreaking) {
|
|
137
|
+
if (hasBreaking) return "major";
|
|
138
|
+
if (hasNonBreaking) return "minor";
|
|
139
|
+
return "patch";
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get sort priority for bump types (higher = more significant).
|
|
143
|
+
*/
|
|
144
|
+
function getBumpTypePriority(bumpType) {
|
|
145
|
+
switch (bumpType) {
|
|
146
|
+
case "major": return 3;
|
|
147
|
+
case "minor": return 2;
|
|
148
|
+
case "patch": return 1;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get the most significant bump type from a list.
|
|
153
|
+
*/
|
|
154
|
+
function getMaxBumpType(bumpTypes) {
|
|
155
|
+
if (bumpTypes.length === 0) return null;
|
|
156
|
+
return bumpTypes.reduce((max, current) => getBumpTypePriority(current) > getBumpTypePriority(max) ? current : max);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Check if a string is a valid semantic version.
|
|
160
|
+
*/
|
|
161
|
+
function isValidVersion(version) {
|
|
162
|
+
return parseVersion(version) !== null;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Validate a version string, returning validation errors.
|
|
166
|
+
*/
|
|
167
|
+
function validateVersion(version) {
|
|
168
|
+
const errors = [];
|
|
169
|
+
if (!version || typeof version !== "string") {
|
|
170
|
+
errors.push("Version must be a non-empty string");
|
|
171
|
+
return errors;
|
|
172
|
+
}
|
|
173
|
+
const trimmed = version.trim();
|
|
174
|
+
if (trimmed !== version) errors.push("Version should not have leading or trailing whitespace");
|
|
175
|
+
if (!parseVersion(trimmed)) errors.push(`Invalid semantic version format: "${version}". Expected format: MAJOR.MINOR.PATCH[-prerelease][+build]`);
|
|
176
|
+
return errors;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
//#endregion
|
|
180
|
+
export { bumpVersion, compareVersions, determineBumpType, formatVersion, getBumpTypePriority, getMaxBumpType, isValidVersion, isVersionEqual, isVersionGreater, isVersionLess, parseVersion, parseVersionStrict, validateVersion };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { StateStore, WorkflowState, WorkflowStateFilters } from "../state.js";
|
|
2
|
+
|
|
3
|
+
//#region src/workflow/adapters/db-adapter.d.ts
|
|
4
|
+
interface WorkflowStateRecord {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
status: string;
|
|
9
|
+
currentStep: string;
|
|
10
|
+
data: unknown;
|
|
11
|
+
history: unknown[];
|
|
12
|
+
retryCounts: Record<string, number>;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
}
|
|
16
|
+
interface PrismaClientLike {
|
|
17
|
+
workflowState: {
|
|
18
|
+
create: (args: {
|
|
19
|
+
data: Record<string, unknown>;
|
|
20
|
+
}) => Promise<WorkflowStateRecord>;
|
|
21
|
+
findUnique: (args: {
|
|
22
|
+
where: {
|
|
23
|
+
id: string;
|
|
24
|
+
};
|
|
25
|
+
}) => Promise<WorkflowStateRecord | null>;
|
|
26
|
+
update: (args: {
|
|
27
|
+
where: {
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
30
|
+
data: Record<string, unknown>;
|
|
31
|
+
}) => Promise<WorkflowStateRecord>;
|
|
32
|
+
findMany: (args: {
|
|
33
|
+
where?: Record<string, unknown>;
|
|
34
|
+
}) => Promise<WorkflowStateRecord[]>;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
declare class PrismaStateStore implements StateStore {
|
|
38
|
+
private readonly prisma;
|
|
39
|
+
constructor(prisma: PrismaClientLike);
|
|
40
|
+
create(state: WorkflowState): Promise<void>;
|
|
41
|
+
get(workflowId: string): Promise<WorkflowState | undefined>;
|
|
42
|
+
update(workflowId: string, updater: (current: WorkflowState) => WorkflowState): Promise<WorkflowState>;
|
|
43
|
+
list(filters?: WorkflowStateFilters): Promise<WorkflowState[]>;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { PrismaStateStore };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//#region src/workflow/adapters/db-adapter.ts
|
|
2
|
+
var PrismaStateStore = class {
|
|
3
|
+
constructor(prisma) {
|
|
4
|
+
this.prisma = prisma;
|
|
5
|
+
}
|
|
6
|
+
async create(state) {
|
|
7
|
+
await this.prisma.workflowState.create({ data: {
|
|
8
|
+
id: state.workflowId,
|
|
9
|
+
name: state.workflowName,
|
|
10
|
+
version: state.workflowVersion,
|
|
11
|
+
status: state.status,
|
|
12
|
+
currentStep: state.currentStep,
|
|
13
|
+
data: state.data,
|
|
14
|
+
history: state.history,
|
|
15
|
+
retryCounts: state.retryCounts ?? {},
|
|
16
|
+
createdAt: state.createdAt,
|
|
17
|
+
updatedAt: state.updatedAt
|
|
18
|
+
} });
|
|
19
|
+
}
|
|
20
|
+
async get(workflowId) {
|
|
21
|
+
const record = await this.prisma.workflowState.findUnique({ where: { id: workflowId } });
|
|
22
|
+
if (!record) return void 0;
|
|
23
|
+
return {
|
|
24
|
+
workflowId: record.id,
|
|
25
|
+
workflowName: record.name,
|
|
26
|
+
workflowVersion: record.version,
|
|
27
|
+
currentStep: record.currentStep,
|
|
28
|
+
data: record.data,
|
|
29
|
+
history: record.history,
|
|
30
|
+
retryCounts: record.retryCounts,
|
|
31
|
+
status: record.status,
|
|
32
|
+
createdAt: record.createdAt,
|
|
33
|
+
updatedAt: record.updatedAt
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
async update(workflowId, updater) {
|
|
37
|
+
const current = await this.get(workflowId);
|
|
38
|
+
if (!current) throw new Error(`Workflow ${workflowId} not found`);
|
|
39
|
+
const next = updater(current);
|
|
40
|
+
const updated = await this.prisma.workflowState.update({
|
|
41
|
+
where: { id: workflowId },
|
|
42
|
+
data: {
|
|
43
|
+
status: next.status,
|
|
44
|
+
currentStep: next.currentStep,
|
|
45
|
+
data: next.data,
|
|
46
|
+
history: next.history,
|
|
47
|
+
retryCounts: next.retryCounts,
|
|
48
|
+
updatedAt: next.updatedAt
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
workflowId: updated.id,
|
|
53
|
+
workflowName: updated.name,
|
|
54
|
+
workflowVersion: updated.version,
|
|
55
|
+
currentStep: updated.currentStep,
|
|
56
|
+
data: updated.data,
|
|
57
|
+
history: updated.history,
|
|
58
|
+
retryCounts: updated.retryCounts,
|
|
59
|
+
status: updated.status,
|
|
60
|
+
createdAt: updated.createdAt,
|
|
61
|
+
updatedAt: updated.updatedAt
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async list(filters) {
|
|
65
|
+
const where = {};
|
|
66
|
+
if (filters?.status) where.status = filters.status;
|
|
67
|
+
return (await this.prisma.workflowState.findMany({ where })).map((record) => ({
|
|
68
|
+
workflowId: record.id,
|
|
69
|
+
workflowName: record.name,
|
|
70
|
+
workflowVersion: record.version,
|
|
71
|
+
currentStep: record.currentStep,
|
|
72
|
+
data: record.data,
|
|
73
|
+
history: record.history,
|
|
74
|
+
retryCounts: record.retryCounts,
|
|
75
|
+
status: record.status,
|
|
76
|
+
createdAt: record.createdAt,
|
|
77
|
+
updatedAt: record.updatedAt
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
export { PrismaStateStore };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StateStore } from "../state.js";
|
|
2
|
+
|
|
3
|
+
//#region src/workflow/adapters/file-adapter.d.ts
|
|
4
|
+
interface FileStateStoreOptions {
|
|
5
|
+
/** Absolute or relative path to the persistence file. */
|
|
6
|
+
filePath: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Placeholder for a file-backed state store adapter.
|
|
10
|
+
* Implementations should manage locking/concurrency and JSON serialization.
|
|
11
|
+
*/
|
|
12
|
+
declare function createFileStateStore(_options: FileStateStoreOptions): StateStore;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { FileStateStoreOptions, createFileStateStore };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/workflow/adapters/file-adapter.ts
|
|
2
|
+
/**
|
|
3
|
+
* Placeholder for a file-backed state store adapter.
|
|
4
|
+
* Implementations should manage locking/concurrency and JSON serialization.
|
|
5
|
+
*/
|
|
6
|
+
function createFileStateStore(_options) {
|
|
7
|
+
throw new Error("File-backed state store adapter not implemented. Provide a custom adapter that satisfies StateStore.");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { createFileStateStore };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InMemoryStateStore } from "./memory-store.js";
|
|
2
|
+
import { PrismaStateStore } from "./db-adapter.js";
|
|
3
|
+
import { FileStateStoreOptions, createFileStateStore } from "./file-adapter.js";
|
|
4
|
+
export { FileStateStoreOptions, InMemoryStateStore, PrismaStateStore, createFileStateStore };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StateStore, WorkflowState, WorkflowStateFilters } from "../state.js";
|
|
2
|
+
|
|
3
|
+
//#region src/workflow/adapters/memory-store.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Naive in-memory state store. Suitable for tests and single-node development
|
|
7
|
+
* environments. Swap with a database-backed adapter in production.
|
|
8
|
+
*/
|
|
9
|
+
declare class InMemoryStateStore implements StateStore {
|
|
10
|
+
private readonly items;
|
|
11
|
+
create(state: WorkflowState): Promise<void>;
|
|
12
|
+
get(workflowId: string): Promise<WorkflowState | undefined>;
|
|
13
|
+
update(workflowId: string, updater: (current: WorkflowState) => WorkflowState): Promise<WorkflowState>;
|
|
14
|
+
list(filters?: WorkflowStateFilters): Promise<WorkflowState[]>;
|
|
15
|
+
clear(): void;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { InMemoryStateStore };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//#region src/workflow/adapters/memory-store.ts
|
|
2
|
+
function cloneState(state) {
|
|
3
|
+
return {
|
|
4
|
+
...state,
|
|
5
|
+
data: deepCopy(state.data),
|
|
6
|
+
history: state.history.map((execution) => ({
|
|
7
|
+
...execution,
|
|
8
|
+
input: deepCopy(execution.input),
|
|
9
|
+
output: deepCopy(execution.output),
|
|
10
|
+
startedAt: new Date(execution.startedAt),
|
|
11
|
+
completedAt: execution.completedAt ? new Date(execution.completedAt) : void 0
|
|
12
|
+
})),
|
|
13
|
+
createdAt: new Date(state.createdAt),
|
|
14
|
+
updatedAt: new Date(state.updatedAt)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Naive in-memory state store. Suitable for tests and single-node development
|
|
19
|
+
* environments. Swap with a database-backed adapter in production.
|
|
20
|
+
*/
|
|
21
|
+
var InMemoryStateStore = class {
|
|
22
|
+
items = /* @__PURE__ */ new Map();
|
|
23
|
+
async create(state) {
|
|
24
|
+
if (this.items.has(state.workflowId)) throw new Error(`Workflow state already exists: ${state.workflowId}`);
|
|
25
|
+
this.items.set(state.workflowId, cloneState(state));
|
|
26
|
+
}
|
|
27
|
+
async get(workflowId) {
|
|
28
|
+
const state = this.items.get(workflowId);
|
|
29
|
+
return state ? cloneState(state) : void 0;
|
|
30
|
+
}
|
|
31
|
+
async update(workflowId, updater) {
|
|
32
|
+
const current = this.items.get(workflowId);
|
|
33
|
+
if (!current) throw new Error(`Workflow state not found for ${workflowId}`);
|
|
34
|
+
const next = cloneState(updater(cloneState(current)));
|
|
35
|
+
this.items.set(workflowId, next);
|
|
36
|
+
return cloneState(next);
|
|
37
|
+
}
|
|
38
|
+
async list(filters) {
|
|
39
|
+
const all = [...this.items.values()];
|
|
40
|
+
return (filters?.status ? all.filter((state) => state.status === filters.status) : all).map(cloneState);
|
|
41
|
+
}
|
|
42
|
+
clear() {
|
|
43
|
+
this.items.clear();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
function deepCopy(value) {
|
|
47
|
+
if (value instanceof Date) return new Date(value.getTime());
|
|
48
|
+
if (Array.isArray(value)) return value.map((item) => deepCopy(item));
|
|
49
|
+
if (value && typeof value === "object") {
|
|
50
|
+
const result = {};
|
|
51
|
+
for (const [key, val] of Object.entries(value)) result[key] = deepCopy(val);
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { InMemoryStateStore };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/workflow/expression.d.ts
|
|
2
|
+
interface ExpressionContext {
|
|
3
|
+
data: Record<string, unknown>;
|
|
4
|
+
input?: unknown;
|
|
5
|
+
output?: unknown;
|
|
6
|
+
}
|
|
7
|
+
declare function evaluateExpression(expression: string | undefined, ctx: ExpressionContext): boolean;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ExpressionContext, evaluateExpression };
|