@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,65 @@
|
|
|
1
|
+
//#region src/knowledge/query/service.ts
|
|
2
|
+
var KnowledgeQueryService = class {
|
|
3
|
+
embeddings;
|
|
4
|
+
vectorStore;
|
|
5
|
+
llm;
|
|
6
|
+
config;
|
|
7
|
+
constructor(embeddings, vectorStore, llm, config) {
|
|
8
|
+
this.embeddings = embeddings;
|
|
9
|
+
this.vectorStore = vectorStore;
|
|
10
|
+
this.llm = llm;
|
|
11
|
+
this.config = config;
|
|
12
|
+
}
|
|
13
|
+
async query(question) {
|
|
14
|
+
const embedding = await this.embeddings.embedQuery(question);
|
|
15
|
+
const results = await this.vectorStore.search({
|
|
16
|
+
collection: this.config.collection,
|
|
17
|
+
vector: embedding.vector,
|
|
18
|
+
topK: this.config.topK ?? 5,
|
|
19
|
+
namespace: this.config.namespace,
|
|
20
|
+
filter: void 0
|
|
21
|
+
});
|
|
22
|
+
const context = buildContext(results);
|
|
23
|
+
const messages = this.buildMessages(question, context);
|
|
24
|
+
const response = await this.llm.chat(messages);
|
|
25
|
+
return {
|
|
26
|
+
answer: response.message.content.map((part) => "text" in part ? part.text : "").join(""),
|
|
27
|
+
references: results.map((result) => ({
|
|
28
|
+
...result,
|
|
29
|
+
text: extractText(result)
|
|
30
|
+
})),
|
|
31
|
+
usage: response.usage
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
buildMessages(question, context) {
|
|
35
|
+
return [{
|
|
36
|
+
role: "system",
|
|
37
|
+
content: [{
|
|
38
|
+
type: "text",
|
|
39
|
+
text: this.config.systemPrompt ?? "You are a knowledge assistant that answers questions using the provided context. Cite relevant sources if possible."
|
|
40
|
+
}]
|
|
41
|
+
}, {
|
|
42
|
+
role: "user",
|
|
43
|
+
content: [{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: `Question:\n${question}\n\nContext:\n${context}`
|
|
46
|
+
}]
|
|
47
|
+
}];
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function buildContext(results) {
|
|
51
|
+
if (results.length === 0) return "No relevant documents found.";
|
|
52
|
+
return results.map((result, index) => {
|
|
53
|
+
const text = extractText(result);
|
|
54
|
+
return `Source ${index + 1} (score: ${result.score.toFixed(3)}):\n${text}`;
|
|
55
|
+
}).join("\n\n");
|
|
56
|
+
}
|
|
57
|
+
function extractText(result) {
|
|
58
|
+
const payload = result.payload ?? {};
|
|
59
|
+
if (typeof payload.text === "string") return payload.text;
|
|
60
|
+
if (typeof payload.content === "string") return payload.content;
|
|
61
|
+
return JSON.stringify(payload);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { KnowledgeQueryService };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { KnowledgeCategory } from "./spec.js";
|
|
2
|
+
import { ResolvedAppConfig, ResolvedKnowledge } from "../app-config/runtime.js";
|
|
3
|
+
|
|
4
|
+
//#region src/knowledge/runtime.d.ts
|
|
5
|
+
interface KnowledgeAccessContext {
|
|
6
|
+
tenantId: string;
|
|
7
|
+
appId: string;
|
|
8
|
+
environment?: string;
|
|
9
|
+
workflowName?: string;
|
|
10
|
+
agentName?: string;
|
|
11
|
+
operation: 'read' | 'write' | 'search';
|
|
12
|
+
}
|
|
13
|
+
interface KnowledgeAccessResult {
|
|
14
|
+
allowed: boolean;
|
|
15
|
+
reason?: string;
|
|
16
|
+
severity?: 'error' | 'warning';
|
|
17
|
+
}
|
|
18
|
+
interface KnowledgeAccessGuardOptions {
|
|
19
|
+
disallowWriteCategories?: KnowledgeCategory[];
|
|
20
|
+
requireWorkflowBinding?: boolean;
|
|
21
|
+
requireAgentBinding?: boolean;
|
|
22
|
+
}
|
|
23
|
+
declare class KnowledgeAccessGuard {
|
|
24
|
+
private readonly disallowedWrite;
|
|
25
|
+
private readonly requireWorkflowBinding;
|
|
26
|
+
private readonly requireAgentBinding;
|
|
27
|
+
constructor(options?: KnowledgeAccessGuardOptions);
|
|
28
|
+
checkAccess(spaceBinding: ResolvedKnowledge, context: KnowledgeAccessContext, appConfig: ResolvedAppConfig): KnowledgeAccessResult;
|
|
29
|
+
private isSpaceBound;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { KnowledgeAccessContext, KnowledgeAccessGuard, KnowledgeAccessGuardOptions, KnowledgeAccessResult };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//#region src/knowledge/runtime.ts
|
|
2
|
+
const DEFAULT_DISALLOWED_WRITE = ["external", "ephemeral"];
|
|
3
|
+
var KnowledgeAccessGuard = class {
|
|
4
|
+
disallowedWrite;
|
|
5
|
+
requireWorkflowBinding;
|
|
6
|
+
requireAgentBinding;
|
|
7
|
+
constructor(options = {}) {
|
|
8
|
+
this.disallowedWrite = new Set(options.disallowWriteCategories ?? DEFAULT_DISALLOWED_WRITE);
|
|
9
|
+
this.requireWorkflowBinding = options.requireWorkflowBinding ?? true;
|
|
10
|
+
this.requireAgentBinding = options.requireAgentBinding ?? false;
|
|
11
|
+
}
|
|
12
|
+
checkAccess(spaceBinding, context, appConfig) {
|
|
13
|
+
const { binding, space } = spaceBinding;
|
|
14
|
+
if (binding.required !== false && !this.isSpaceBound(spaceBinding, appConfig)) return {
|
|
15
|
+
allowed: false,
|
|
16
|
+
reason: `Knowledge space "${space.meta.key}" is not bound in the resolved app config.`
|
|
17
|
+
};
|
|
18
|
+
if (context.operation === "write" && this.disallowedWrite.has(space.meta.category)) return {
|
|
19
|
+
allowed: false,
|
|
20
|
+
reason: `Knowledge space "${space.meta.key}" is category "${space.meta.category}" and is read-only.`
|
|
21
|
+
};
|
|
22
|
+
if (this.requireWorkflowBinding && context.workflowName) {
|
|
23
|
+
const allowedWorkflows = binding.scope?.workflows;
|
|
24
|
+
if (allowedWorkflows && !allowedWorkflows.includes(context.workflowName)) return {
|
|
25
|
+
allowed: false,
|
|
26
|
+
reason: `Workflow "${context.workflowName}" is not authorized to access knowledge space "${space.meta.key}".`
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
if (this.requireAgentBinding && context.agentName) {
|
|
30
|
+
const allowedAgents = binding.scope?.agents;
|
|
31
|
+
if (allowedAgents && !allowedAgents.includes(context.agentName)) return {
|
|
32
|
+
allowed: false,
|
|
33
|
+
reason: `Agent "${context.agentName}" is not authorized to access knowledge space "${space.meta.key}".`
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (space.meta.category === "ephemeral") return {
|
|
37
|
+
allowed: true,
|
|
38
|
+
severity: "warning",
|
|
39
|
+
reason: `Knowledge space "${space.meta.key}" is ephemeral; results may be transient.`
|
|
40
|
+
};
|
|
41
|
+
return { allowed: true };
|
|
42
|
+
}
|
|
43
|
+
isSpaceBound(resolved, appConfig) {
|
|
44
|
+
return appConfig.knowledge.some((entry) => entry.space.meta.key === resolved.space.meta.key && (resolved.space.meta.version == null || entry.space.meta.version === resolved.space.meta.version));
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { KnowledgeAccessGuard };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/knowledge/source.d.ts
|
|
2
|
+
type KnowledgeSourceType = 'notion' | 'url' | 'file_upload' | 'email' | 'api' | 'manual';
|
|
3
|
+
interface KnowledgeSourceMeta {
|
|
4
|
+
id: string;
|
|
5
|
+
tenantId: string;
|
|
6
|
+
spaceKey: string;
|
|
7
|
+
spaceVersion: string;
|
|
8
|
+
label: string;
|
|
9
|
+
sourceType: KnowledgeSourceType;
|
|
10
|
+
createdAt: string | Date;
|
|
11
|
+
updatedAt: string | Date;
|
|
12
|
+
}
|
|
13
|
+
interface KnowledgeSourceConfig {
|
|
14
|
+
meta: KnowledgeSourceMeta;
|
|
15
|
+
/** Source-specific configuration (URLs, credentials, filters). */
|
|
16
|
+
config: Record<string, unknown>;
|
|
17
|
+
/** Sync schedule (cron or interval). */
|
|
18
|
+
syncSchedule?: {
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
cron?: string;
|
|
21
|
+
intervalMs?: number;
|
|
22
|
+
};
|
|
23
|
+
/** Last sync status. */
|
|
24
|
+
lastSync?: {
|
|
25
|
+
timestamp: Date;
|
|
26
|
+
success: boolean;
|
|
27
|
+
itemsProcessed?: number;
|
|
28
|
+
error?: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { KnowledgeSourceConfig, KnowledgeSourceMeta, KnowledgeSourceType };
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KnowledgeSpaceRegistry, KnowledgeSpaceSpec } from "../spec.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/email-threads.d.ts
|
|
4
|
+
declare const emailThreadsKnowledgeSpace: KnowledgeSpaceSpec;
|
|
5
|
+
declare function registerEmailThreadsKnowledgeSpace(registry: KnowledgeSpaceRegistry): KnowledgeSpaceRegistry;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { emailThreadsKnowledgeSpace, registerEmailThreadsKnowledgeSpace };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { StabilityEnum } from "../../ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/email-threads.ts
|
|
4
|
+
const emailThreadsKnowledgeSpace = {
|
|
5
|
+
meta: {
|
|
6
|
+
key: "knowledge.email-threads",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
category: "operational",
|
|
9
|
+
title: "Operational Email Threads",
|
|
10
|
+
description: "Indexed copies of operational email threads used for support, onboarding, and workflows.",
|
|
11
|
+
domain: "operations",
|
|
12
|
+
owners: ["platform.operations"],
|
|
13
|
+
tags: ["email", "operations"],
|
|
14
|
+
stability: StabilityEnum.Beta
|
|
15
|
+
},
|
|
16
|
+
retention: { ttlDays: 365 },
|
|
17
|
+
access: {
|
|
18
|
+
policy: {
|
|
19
|
+
key: "knowledge.access.email-threads",
|
|
20
|
+
version: "1.0.0"
|
|
21
|
+
},
|
|
22
|
+
trustLevel: "medium",
|
|
23
|
+
automationWritable: true
|
|
24
|
+
},
|
|
25
|
+
indexing: {
|
|
26
|
+
embeddingModel: "mistral-embed",
|
|
27
|
+
chunkSize: 600,
|
|
28
|
+
vectorDbIntegration: "vectordb.qdrant"
|
|
29
|
+
},
|
|
30
|
+
description: "Operational email threads synchronized from Gmail to support automations and contextual assistance."
|
|
31
|
+
};
|
|
32
|
+
function registerEmailThreadsKnowledgeSpace(registry) {
|
|
33
|
+
return registry.register(emailThreadsKnowledgeSpace);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { emailThreadsKnowledgeSpace, registerEmailThreadsKnowledgeSpace };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KnowledgeSpaceRegistry, KnowledgeSpaceSpec } from "../spec.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/financial-docs.d.ts
|
|
4
|
+
declare const financialDocsKnowledgeSpace: KnowledgeSpaceSpec;
|
|
5
|
+
declare function registerFinancialDocsKnowledgeSpace(registry: KnowledgeSpaceRegistry): KnowledgeSpaceRegistry;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { financialDocsKnowledgeSpace, registerFinancialDocsKnowledgeSpace };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { StabilityEnum } from "../../ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/financial-docs.ts
|
|
4
|
+
const financialDocsKnowledgeSpace = {
|
|
5
|
+
meta: {
|
|
6
|
+
key: "knowledge.financial-docs",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
category: "canonical",
|
|
9
|
+
title: "Household Financial Documents",
|
|
10
|
+
description: "Invoices, bills, and contracts powering Pocket Family Office financial automation.",
|
|
11
|
+
domain: "finance",
|
|
12
|
+
owners: ["platform.finance"],
|
|
13
|
+
tags: ["finance", "documents"],
|
|
14
|
+
stability: StabilityEnum.Beta
|
|
15
|
+
},
|
|
16
|
+
retention: { ttlDays: null },
|
|
17
|
+
access: {
|
|
18
|
+
policy: {
|
|
19
|
+
key: "knowledge.access.financial-docs",
|
|
20
|
+
version: "1.0.0"
|
|
21
|
+
},
|
|
22
|
+
trustLevel: "high",
|
|
23
|
+
automationWritable: true
|
|
24
|
+
},
|
|
25
|
+
indexing: {
|
|
26
|
+
embeddingModel: "mistral-embed",
|
|
27
|
+
chunkSize: 700,
|
|
28
|
+
vectorDbIntegration: "vectordb.qdrant"
|
|
29
|
+
},
|
|
30
|
+
description: "Normalized financial documents enabling bill pay automation, reminders, and summaries."
|
|
31
|
+
};
|
|
32
|
+
function registerFinancialDocsKnowledgeSpace(registry) {
|
|
33
|
+
return registry.register(financialDocsKnowledgeSpace);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { financialDocsKnowledgeSpace, registerFinancialDocsKnowledgeSpace };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KnowledgeSpaceRegistry, KnowledgeSpaceSpec } from "../spec.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/financial-overview.d.ts
|
|
4
|
+
declare const financialOverviewKnowledgeSpace: KnowledgeSpaceSpec;
|
|
5
|
+
declare function registerFinancialOverviewKnowledgeSpace(registry: KnowledgeSpaceRegistry): KnowledgeSpaceRegistry;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { financialOverviewKnowledgeSpace, registerFinancialOverviewKnowledgeSpace };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { StabilityEnum } from "../../ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/financial-overview.ts
|
|
4
|
+
const financialOverviewKnowledgeSpace = {
|
|
5
|
+
meta: {
|
|
6
|
+
key: "knowledge.financial-overview",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
category: "operational",
|
|
9
|
+
title: "Derived Financial Summaries",
|
|
10
|
+
description: "Aggregated cashflow summaries, category breakdowns, and balance trends derived from open banking data.",
|
|
11
|
+
domain: "finance",
|
|
12
|
+
owners: ["platform.finance"],
|
|
13
|
+
tags: [
|
|
14
|
+
"open-banking",
|
|
15
|
+
"summaries",
|
|
16
|
+
"cashflow"
|
|
17
|
+
],
|
|
18
|
+
stability: StabilityEnum.Experimental
|
|
19
|
+
},
|
|
20
|
+
retention: { ttlDays: 180 },
|
|
21
|
+
access: {
|
|
22
|
+
policy: {
|
|
23
|
+
key: "knowledge.access.financial-overview",
|
|
24
|
+
version: "1.0.0"
|
|
25
|
+
},
|
|
26
|
+
trustLevel: "medium",
|
|
27
|
+
automationWritable: true
|
|
28
|
+
},
|
|
29
|
+
indexing: {
|
|
30
|
+
embeddingModel: "mistral-embed",
|
|
31
|
+
chunkSize: 600,
|
|
32
|
+
vectorDbIntegration: "vectordb.qdrant"
|
|
33
|
+
},
|
|
34
|
+
description: "Derived knowledge space containing weekly/monthly cashflow rollups and account health summaries. Raw transactions are excluded to respect privacy guardrails."
|
|
35
|
+
};
|
|
36
|
+
function registerFinancialOverviewKnowledgeSpace(registry) {
|
|
37
|
+
return registry.register(financialOverviewKnowledgeSpace);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { financialOverviewKnowledgeSpace, registerFinancialOverviewKnowledgeSpace };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { productCanonKnowledgeSpace, registerProductCanonKnowledgeSpace } from "./product-canon.js";
|
|
2
|
+
import { registerSupportFaqKnowledgeSpace, supportFaqKnowledgeSpace } from "./support-faq.js";
|
|
3
|
+
import { emailThreadsKnowledgeSpace, registerEmailThreadsKnowledgeSpace } from "./email-threads.js";
|
|
4
|
+
import { registerUploadedDocsKnowledgeSpace, uploadedDocsKnowledgeSpace } from "./uploaded-docs.js";
|
|
5
|
+
import { financialDocsKnowledgeSpace, registerFinancialDocsKnowledgeSpace } from "./financial-docs.js";
|
|
6
|
+
import { financialOverviewKnowledgeSpace, registerFinancialOverviewKnowledgeSpace } from "./financial-overview.js";
|
|
7
|
+
export { emailThreadsKnowledgeSpace, financialDocsKnowledgeSpace, financialOverviewKnowledgeSpace, productCanonKnowledgeSpace, registerEmailThreadsKnowledgeSpace, registerFinancialDocsKnowledgeSpace, registerFinancialOverviewKnowledgeSpace, registerProductCanonKnowledgeSpace, registerSupportFaqKnowledgeSpace, registerUploadedDocsKnowledgeSpace, supportFaqKnowledgeSpace, uploadedDocsKnowledgeSpace };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { productCanonKnowledgeSpace, registerProductCanonKnowledgeSpace } from "./product-canon.js";
|
|
2
|
+
import { registerSupportFaqKnowledgeSpace, supportFaqKnowledgeSpace } from "./support-faq.js";
|
|
3
|
+
import { emailThreadsKnowledgeSpace, registerEmailThreadsKnowledgeSpace } from "./email-threads.js";
|
|
4
|
+
import { registerUploadedDocsKnowledgeSpace, uploadedDocsKnowledgeSpace } from "./uploaded-docs.js";
|
|
5
|
+
import { financialDocsKnowledgeSpace, registerFinancialDocsKnowledgeSpace } from "./financial-docs.js";
|
|
6
|
+
import { financialOverviewKnowledgeSpace, registerFinancialOverviewKnowledgeSpace } from "./financial-overview.js";
|
|
7
|
+
|
|
8
|
+
export { emailThreadsKnowledgeSpace, financialDocsKnowledgeSpace, financialOverviewKnowledgeSpace, productCanonKnowledgeSpace, registerEmailThreadsKnowledgeSpace, registerFinancialDocsKnowledgeSpace, registerFinancialOverviewKnowledgeSpace, registerProductCanonKnowledgeSpace, registerSupportFaqKnowledgeSpace, registerUploadedDocsKnowledgeSpace, supportFaqKnowledgeSpace, uploadedDocsKnowledgeSpace };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KnowledgeSpaceRegistry, KnowledgeSpaceSpec } from "../spec.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/product-canon.d.ts
|
|
4
|
+
declare const productCanonKnowledgeSpace: KnowledgeSpaceSpec;
|
|
5
|
+
declare function registerProductCanonKnowledgeSpace(registry: KnowledgeSpaceRegistry): KnowledgeSpaceRegistry;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { productCanonKnowledgeSpace, registerProductCanonKnowledgeSpace };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { StabilityEnum } from "../../ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/product-canon.ts
|
|
4
|
+
const productCanonKnowledgeSpace = {
|
|
5
|
+
meta: {
|
|
6
|
+
key: "knowledge.product-canon",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
category: "canonical",
|
|
9
|
+
title: "Product Canon Knowledge Space",
|
|
10
|
+
description: "Authoritative product knowledge covering strategy, roadmap, and delivery canon.",
|
|
11
|
+
domain: "product",
|
|
12
|
+
owners: ["platform.product"],
|
|
13
|
+
tags: ["knowledge", "product"],
|
|
14
|
+
stability: StabilityEnum.Stable
|
|
15
|
+
},
|
|
16
|
+
retention: { ttlDays: null },
|
|
17
|
+
access: {
|
|
18
|
+
policy: {
|
|
19
|
+
key: "knowledge.access.product-canon",
|
|
20
|
+
version: "1.0.0"
|
|
21
|
+
},
|
|
22
|
+
trustLevel: "high",
|
|
23
|
+
automationWritable: false
|
|
24
|
+
},
|
|
25
|
+
indexing: {
|
|
26
|
+
embeddingModel: "text-embedding-3-large",
|
|
27
|
+
chunkSize: 800,
|
|
28
|
+
vectorDbIntegration: "vectordb.qdrant"
|
|
29
|
+
},
|
|
30
|
+
description: "Single source of truth for product canon, principles, and strategic narratives."
|
|
31
|
+
};
|
|
32
|
+
function registerProductCanonKnowledgeSpace(registry) {
|
|
33
|
+
return registry.register(productCanonKnowledgeSpace);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { productCanonKnowledgeSpace, registerProductCanonKnowledgeSpace };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KnowledgeSpaceRegistry, KnowledgeSpaceSpec } from "../spec.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/support-faq.d.ts
|
|
4
|
+
declare const supportFaqKnowledgeSpace: KnowledgeSpaceSpec;
|
|
5
|
+
declare function registerSupportFaqKnowledgeSpace(registry: KnowledgeSpaceRegistry): KnowledgeSpaceRegistry;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { registerSupportFaqKnowledgeSpace, supportFaqKnowledgeSpace };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { StabilityEnum } from "../../ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/support-faq.ts
|
|
4
|
+
const supportFaqKnowledgeSpace = {
|
|
5
|
+
meta: {
|
|
6
|
+
key: "knowledge.support-faq",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
category: "operational",
|
|
9
|
+
title: "Support & Success FAQ",
|
|
10
|
+
description: "Operational knowledge base for customer support and success.",
|
|
11
|
+
domain: "support",
|
|
12
|
+
owners: ["platform.support"],
|
|
13
|
+
tags: ["knowledge", "support"],
|
|
14
|
+
stability: StabilityEnum.Beta
|
|
15
|
+
},
|
|
16
|
+
retention: {
|
|
17
|
+
ttlDays: 365,
|
|
18
|
+
archiveAfterDays: 180
|
|
19
|
+
},
|
|
20
|
+
access: {
|
|
21
|
+
policy: {
|
|
22
|
+
key: "knowledge.access.support",
|
|
23
|
+
version: "1.0.0"
|
|
24
|
+
},
|
|
25
|
+
trustLevel: "medium",
|
|
26
|
+
automationWritable: true
|
|
27
|
+
},
|
|
28
|
+
indexing: {
|
|
29
|
+
embeddingModel: "text-embedding-3-small",
|
|
30
|
+
chunkSize: 700,
|
|
31
|
+
vectorDbIntegration: "vectordb.qdrant"
|
|
32
|
+
},
|
|
33
|
+
description: "Operational FAQs, runbooks, and customer success playbooks augmented with automation updates."
|
|
34
|
+
};
|
|
35
|
+
function registerSupportFaqKnowledgeSpace(registry) {
|
|
36
|
+
return registry.register(supportFaqKnowledgeSpace);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { registerSupportFaqKnowledgeSpace, supportFaqKnowledgeSpace };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KnowledgeSpaceRegistry, KnowledgeSpaceSpec } from "../spec.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/uploaded-docs.d.ts
|
|
4
|
+
declare const uploadedDocsKnowledgeSpace: KnowledgeSpaceSpec;
|
|
5
|
+
declare function registerUploadedDocsKnowledgeSpace(registry: KnowledgeSpaceRegistry): KnowledgeSpaceRegistry;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { registerUploadedDocsKnowledgeSpace, uploadedDocsKnowledgeSpace };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { StabilityEnum } from "../../ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spaces/uploaded-docs.ts
|
|
4
|
+
const uploadedDocsKnowledgeSpace = {
|
|
5
|
+
meta: {
|
|
6
|
+
key: "knowledge.uploaded-docs",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
category: "external",
|
|
9
|
+
title: "Uploaded Knowledge Assets",
|
|
10
|
+
description: "Documents uploaded by households, including invoices, contracts, and reference files.",
|
|
11
|
+
domain: "operations",
|
|
12
|
+
owners: ["platform.operations"],
|
|
13
|
+
tags: ["documents", "storage"],
|
|
14
|
+
stability: StabilityEnum.Beta
|
|
15
|
+
},
|
|
16
|
+
retention: { ttlDays: null },
|
|
17
|
+
access: {
|
|
18
|
+
policy: {
|
|
19
|
+
key: "knowledge.access.uploaded-docs",
|
|
20
|
+
version: "1.0.0"
|
|
21
|
+
},
|
|
22
|
+
trustLevel: "medium",
|
|
23
|
+
automationWritable: true
|
|
24
|
+
},
|
|
25
|
+
indexing: {
|
|
26
|
+
embeddingModel: "mistral-embed",
|
|
27
|
+
chunkSize: 900,
|
|
28
|
+
vectorDbIntegration: "vectordb.qdrant"
|
|
29
|
+
},
|
|
30
|
+
description: "User-provided documents normalized and embedded for retrieval augmented workflows."
|
|
31
|
+
};
|
|
32
|
+
function registerUploadedDocsKnowledgeSpace(registry) {
|
|
33
|
+
return registry.register(uploadedDocsKnowledgeSpace);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { registerUploadedDocsKnowledgeSpace, uploadedDocsKnowledgeSpace };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { OwnerShipMeta } from "../ownership.js";
|
|
2
|
+
import { PolicyRef } from "../policy/spec.js";
|
|
3
|
+
import { SpecContractRegistry } from "../registry.js";
|
|
4
|
+
|
|
5
|
+
//#region src/knowledge/spec.d.ts
|
|
6
|
+
type KnowledgeCategory = 'canonical' | 'operational' | 'external' | 'ephemeral';
|
|
7
|
+
interface KnowledgeSpaceMeta extends OwnerShipMeta {
|
|
8
|
+
category: KnowledgeCategory;
|
|
9
|
+
}
|
|
10
|
+
interface KnowledgeRetentionPolicy {
|
|
11
|
+
/** TTL in days (null = indefinite). */
|
|
12
|
+
ttlDays?: number | null;
|
|
13
|
+
/** Auto-archive after inactivity. */
|
|
14
|
+
archiveAfterDays?: number;
|
|
15
|
+
}
|
|
16
|
+
interface KnowledgeAccessPolicy {
|
|
17
|
+
/** Which PolicySpec governs access. */
|
|
18
|
+
policy?: PolicyRef;
|
|
19
|
+
/** Trust level for agent/workflow consumption. */
|
|
20
|
+
trustLevel: 'high' | 'medium' | 'low';
|
|
21
|
+
/** Can this space be mutated by automation? */
|
|
22
|
+
automationWritable: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface KnowledgeIndexingConfig {
|
|
25
|
+
embeddingModel?: string;
|
|
26
|
+
chunkSize?: number;
|
|
27
|
+
vectorDbIntegration?: string;
|
|
28
|
+
}
|
|
29
|
+
interface KnowledgeSpaceSpec {
|
|
30
|
+
meta: KnowledgeSpaceMeta;
|
|
31
|
+
/** Retention and cleanup rules. */
|
|
32
|
+
retention: KnowledgeRetentionPolicy;
|
|
33
|
+
/** Access control and trust. */
|
|
34
|
+
access: KnowledgeAccessPolicy;
|
|
35
|
+
/** Optional embedding/indexing config. */
|
|
36
|
+
indexing?: KnowledgeIndexingConfig;
|
|
37
|
+
/** Documentation. */
|
|
38
|
+
description?: string;
|
|
39
|
+
}
|
|
40
|
+
declare class KnowledgeSpaceRegistry extends SpecContractRegistry<'knowledge-space', KnowledgeSpaceSpec> {
|
|
41
|
+
constructor(items?: KnowledgeSpaceSpec[]);
|
|
42
|
+
getByCategory(category: KnowledgeCategory): KnowledgeSpaceSpec[];
|
|
43
|
+
}
|
|
44
|
+
declare function makeKnowledgeSpaceKey(meta: KnowledgeSpaceMeta): string;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { KnowledgeAccessPolicy, KnowledgeCategory, KnowledgeIndexingConfig, KnowledgeRetentionPolicy, KnowledgeSpaceMeta, KnowledgeSpaceRegistry, KnowledgeSpaceSpec, makeKnowledgeSpaceKey };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SpecContractRegistry } from "../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/knowledge/spec.ts
|
|
4
|
+
var KnowledgeSpaceRegistry = class extends SpecContractRegistry {
|
|
5
|
+
constructor(items) {
|
|
6
|
+
super("knowledge-space", items);
|
|
7
|
+
}
|
|
8
|
+
getByCategory(category) {
|
|
9
|
+
return this.list().filter((spec) => spec.meta.category === category);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
function makeKnowledgeSpaceKey(meta) {
|
|
13
|
+
return `${meta.key}.v${meta.version}`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { KnowledgeSpaceRegistry, makeKnowledgeSpaceKey };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { DocBlock } from "../docs/types.js";
|
|
2
|
+
import { PresentationSpec } from "../presentations/presentations.js";
|
|
3
|
+
import { AnyOperationSpec } from "../operations/operation.js";
|
|
4
|
+
import { OperationSpecRegistry } from "../operations/registry.js";
|
|
5
|
+
import "../operations/index.js";
|
|
6
|
+
import { FeatureModuleSpec } from "../features/types.js";
|
|
7
|
+
import { PresentationRegistry } from "../presentations/registry.js";
|
|
8
|
+
import "../presentations/index.js";
|
|
9
|
+
import "../features/index.js";
|
|
10
|
+
import { EventSpec } from "../events.js";
|
|
11
|
+
import { FeatureExportOptions, FeatureExportResult, SpecExportOptions, SpecExportResult } from "./types.js";
|
|
12
|
+
import { AnySchemaModel } from "@contractspec/lib.schema";
|
|
13
|
+
|
|
14
|
+
//#region src/llm/exporters.d.ts
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Export a single spec to context-focused markdown.
|
|
18
|
+
* Includes: goal, context, description, acceptance scenarios.
|
|
19
|
+
* Best for: Understanding what the spec does, providing context to LLMs.
|
|
20
|
+
*/
|
|
21
|
+
declare function operationSpecToContextMarkdown(spec: AnyOperationSpec): string;
|
|
22
|
+
/**
|
|
23
|
+
* Export a single spec to full markdown with all details.
|
|
24
|
+
* Includes: all fields, I/O schemas, policy, events, examples.
|
|
25
|
+
* Best for: Complete documentation, implementation reference.
|
|
26
|
+
*/
|
|
27
|
+
declare function operationSpecToFullMarkdown(spec: AnyOperationSpec, options?: Partial<SpecExportOptions>): string;
|
|
28
|
+
/**
|
|
29
|
+
* Export a single spec as an actionable agent prompt.
|
|
30
|
+
* Includes: instructions, full spec, expected output format.
|
|
31
|
+
* Best for: Directly feeding to coding agents for implementation.
|
|
32
|
+
*/
|
|
33
|
+
declare function operationSpecToAgentPrompt(spec: AnyOperationSpec, options?: {
|
|
34
|
+
taskType?: 'implement' | 'test' | 'refactor' | 'review';
|
|
35
|
+
existingCode?: string;
|
|
36
|
+
}): string;
|
|
37
|
+
/**
|
|
38
|
+
* Export a feature module to markdown.
|
|
39
|
+
* Includes all related specs, events, and presentations.
|
|
40
|
+
*/
|
|
41
|
+
declare function featureToMarkdown(feature: FeatureModuleSpec, deps?: {
|
|
42
|
+
specs?: OperationSpecRegistry;
|
|
43
|
+
presentations?: PresentationRegistry;
|
|
44
|
+
}, options?: Partial<FeatureExportOptions>): string;
|
|
45
|
+
/**
|
|
46
|
+
* Export a presentation descriptor to markdown.
|
|
47
|
+
*/
|
|
48
|
+
declare function presentationToMarkdown(presentation: PresentationSpec): string;
|
|
49
|
+
/**
|
|
50
|
+
* Export an event spec to markdown.
|
|
51
|
+
*/
|
|
52
|
+
declare function eventToMarkdown(event: EventSpec<AnySchemaModel>): string;
|
|
53
|
+
/**
|
|
54
|
+
* Export a DocBlock to markdown (already markdown, but formatted consistently).
|
|
55
|
+
*/
|
|
56
|
+
declare function docBlockToMarkdown(doc: DocBlock): string;
|
|
57
|
+
/**
|
|
58
|
+
* Export a spec with a specific format.
|
|
59
|
+
* Convenience function that wraps the format-specific functions.
|
|
60
|
+
*/
|
|
61
|
+
declare function exportSpec(spec: AnyOperationSpec, options?: Partial<SpecExportOptions>): SpecExportResult;
|
|
62
|
+
/**
|
|
63
|
+
* Export a feature with a specific format.
|
|
64
|
+
*/
|
|
65
|
+
declare function exportFeature(feature: FeatureModuleSpec, deps?: {
|
|
66
|
+
specs?: OperationSpecRegistry;
|
|
67
|
+
presentations?: PresentationRegistry;
|
|
68
|
+
}, options?: Partial<FeatureExportOptions>): FeatureExportResult;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { docBlockToMarkdown, eventToMarkdown, exportFeature, exportSpec, featureToMarkdown, operationSpecToAgentPrompt, operationSpecToContextMarkdown, operationSpecToFullMarkdown, presentationToMarkdown };
|