@lssm/lib.contracts 0.0.0-canary-20251209233744 → 0.0.0-canary-20251210081515

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.
Files changed (45) hide show
  1. package/dist/app-config/docs/app-config.docblock.js +220 -0
  2. package/dist/capabilities/docs/capabilities.docblock.js +1 -0
  3. package/dist/data-views/docs/data-views.docblock.js +1 -0
  4. package/dist/docs/PUBLISHING.docblock.js +76 -0
  5. package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +350 -0
  6. package/dist/docs/index.js +1 -0
  7. package/dist/docs/meta.docs.js +13 -0
  8. package/dist/docs/presentations.js +1 -0
  9. package/dist/docs/registry.js +1 -0
  10. package/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +383 -0
  11. package/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +68 -0
  12. package/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +140 -0
  13. package/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +86 -0
  14. package/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +1 -0
  15. package/dist/docs/tech/contracts/README.docblock.js +1 -0
  16. package/dist/docs/tech/contracts/create-subscription.docblock.js +1 -0
  17. package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.js +180 -0
  18. package/dist/docs/tech/contracts/migrations.docblock.js +1 -0
  19. package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +62 -0
  20. package/dist/docs/tech/contracts/overlays.docblock.js +68 -0
  21. package/dist/docs/tech/contracts/tests.docblock.js +132 -0
  22. package/dist/docs/tech/contracts/themes.docblock.js +1 -0
  23. package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +106 -0
  24. package/dist/docs/tech/lifecycle-stage-system.docblock.js +213 -0
  25. package/dist/docs/tech/mcp-endpoints.docblock.js +1 -0
  26. package/dist/docs/tech/presentation-runtime.docblock.js +1 -0
  27. package/dist/docs/tech/schema/README.docblock.js +262 -0
  28. package/dist/docs/tech/templates/runtime.docblock.js +1 -0
  29. package/dist/docs/tech/workflows/overview.docblock.js +1 -0
  30. package/dist/docs/tech-contracts.docs.js +76 -0
  31. package/dist/docs/types.js +0 -0
  32. package/dist/experiments/docs/experiments.docblock.js +128 -0
  33. package/dist/forms/docs/forms.docblock.js +1 -0
  34. package/dist/index.js +1 -1
  35. package/dist/integrations/docs/integrations.docblock.js +101 -0
  36. package/dist/knowledge/docs/knowledge.docblock.js +138 -0
  37. package/dist/openbanking/docs/openbanking.docblock.js +109 -0
  38. package/dist/policy/docs/policy.docblock.js +1 -0
  39. package/dist/presentations/docs/presentations-conventions.docblock.js +8 -0
  40. package/dist/regenerator/docs/regenerator.docblock.js +184 -0
  41. package/dist/registry.js +1 -1
  42. package/dist/server/index.js +1 -1
  43. package/dist/telemetry/docs/telemetry.docblock.js +139 -0
  44. package/package.json +81 -4
  45. package/dist/server/graphql-schema-export.js +0 -1
@@ -0,0 +1,76 @@
1
+ const e=[{id:`docs.tech.contracts.presentations-v2`,title:`Presentations V2 — Unified Descriptor & Transform Engine`,summary:`How PresentationDescriptorV2 and TransformEngine keep docs/renderers consistent.`,visibility:`public`,route:`/docs/tech/contracts/presentations-v2`,kind:`reference`,tags:[`presentations`,`docs`,`mcp`],body:`## Presentations V2 — Unified Descriptor & Transform Engine
2
+
3
+ ### Purpose
4
+
5
+ Unify presentations into one descriptor (\`PresentationDescriptorV2\`) that declares a single source (React component key or BlockNote doc) and a list of output targets (react, markdown, application/json, application/xml). A pluggable \`TransformEngine\` renders any target and applies PII redaction.
6
+
7
+ ### Types
8
+
9
+ \`\`\`ts
10
+ type PresentationTarget =
11
+ | 'react'
12
+ | 'markdown'
13
+ | 'application/json'
14
+ | 'application/xml';
15
+
16
+ type PresentationSource =
17
+ | {
18
+ type: 'component';
19
+ framework: 'react';
20
+ componentKey: string;
21
+ props?: AnySchemaModel;
22
+ }
23
+ | { type: 'blocknotejs'; docJson: unknown; blockConfig?: unknown };
24
+
25
+ interface PresentationDescriptorV2 {
26
+ meta: PresentationV2Meta; // includes partial OwnerShipMeta + description
27
+ policy?: { flags?: string[]; pii?: string[] };
28
+ source: PresentationSource;
29
+ targets: PresentationTarget[];
30
+ }
31
+
32
+ // Shared ownership schema (source of truth in @lssm/lib.contracts/src/ownership.ts)
33
+ interface OwnerShipMeta {
34
+ title: string;
35
+ description: string;
36
+ domain: string;
37
+ owners: Owner[];
38
+ tags: Tag[];
39
+ stability: Stability;
40
+ }
41
+
42
+ type Stability = 'experimental' | 'beta' | 'stable' | 'deprecated';
43
+ type Owner = string; // curated list available in code (e.g., '@sigil-team', 'team-strit')
44
+ type Tag = string; // curated list available in code (e.g., 'auth', 'spots')
45
+
46
+ // For V2 presentations, meta is a Partial<OwnerShipMeta> plus description, name, version
47
+ interface PresentationV2Meta extends Partial<OwnerShipMeta> {
48
+ name: string;
49
+ version: number;
50
+ description?: string;
51
+ }
52
+ \`\`\`
53
+
54
+ ### Engine
55
+
56
+ Use \`createDefaultTransformEngine()\` and register custom renderers as needed (e.g., high-fidelity BlockNote → Markdown). The default engine supports markdown/json/xml; a React renderer returns a serializable descriptor the host app renders via a \`componentMap\` or a BlockNote renderer. The canonical source type string is \`blocknotejs\` (not \`blocknote\`).
57
+
58
+ PII paths (JSON-like) are redacted from rendered outputs.
59
+
60
+ ### MCP Integration
61
+
62
+ \`createMcpServer\` accepts \`presentationsV2\`. Each descriptor is exposed under \`presentation://<name>/v<version>\` and negotiated variants (\`.md/.json/.xml\`) are rendered by the engine.
63
+
64
+ ### Migration
65
+
66
+ - V1 \`PresentationSpec\` remains supported; a back-compat helper converts V1 → V2 when convenient.
67
+ - Prefer V2 for new work.
68
+
69
+ ### Examples (Sigil)
70
+
71
+ - \`sigil.auth.webauth_tabs_v2\`: component source (\`componentKey: 'sigil.webauth.tabs'\`), targets \`react/json/xml\`.
72
+ - \`sigil.signup.guide_v2\`: BlockNote doc source, targets \`react/markdown/json/xml\`.
73
+
74
+ ### React Rendering
75
+
76
+ Host apps use a \`componentMap\` (e.g., \`'sigil.webauth.tabs' → WebAuthTabs\`) and a BlockNote renderer to turn the React render descriptor into elements.`}];export{e as techContractsDocs};
File without changes
@@ -0,0 +1,128 @@
1
+ import{registerDocBlocks as e}from"../../docs/registry.js";import"../../registry.js";const t=[{id:`docs.tech.contracts.experiments`,title:`ExperimentSpec & ExperimentEvaluator`,summary:`Use experiments to test alternative workflows, data views, or themes with controlled allocations and measurable outcomes.`,kind:`reference`,visibility:`public`,route:`/docs/tech/contracts/experiments`,tags:[`tech`,`contracts`,`experiments`],body:`# ExperimentSpec & ExperimentEvaluator
2
+
3
+ Use experiments to test alternative workflows, data views, or themes with controlled allocations and measurable outcomes.
4
+
5
+ - Types & registry: \`packages/libs/contracts/src/experiments/spec.ts\`
6
+ - Runtime evaluator: \`packages/libs/contracts/src/experiments/evaluator.ts\`
7
+ - CLI wizard/template: \`contractspec create experiment\`
8
+
9
+ ## Structure
10
+
11
+ \`\`\`ts
12
+ export interface ExperimentSpec {
13
+ meta: ExperimentMeta;
14
+ controlVariant: string;
15
+ variants: ExperimentVariant[];
16
+ allocation: AllocationStrategy;
17
+ successMetrics?: SuccessMetric[];
18
+ }
19
+ \`\`\`
20
+
21
+ - \`variants\`: define UI/behavior overrides (data views, workflows, themes, policies)
22
+ - \`allocation\`:
23
+ - \`random\`: 50/50 or weighted via \`weight\`
24
+ - \`sticky\`: deterministic hash on user/organization/session
25
+ - \`targeted\`: rule-based (policy + expression + optional percentage)
26
+ - \`successMetrics\`: telemetry events + aggregation (count/avg/p95) to track outcomes
27
+
28
+ ### Example
29
+
30
+ \`\`\`ts
31
+ export const OnboardingSplitFormExperiment: ExperimentSpec = {
32
+ meta: {
33
+ name: 'sigil.onboarding.split_form',
34
+ version: 1,
35
+ title: 'Split onboarding form',
36
+ description: 'Compare single vs multi-step onboarding',
37
+ domain: 'onboarding',
38
+ owners: ['@team.onboarding'],
39
+ tags: ['experiment'],
40
+ stability: StabilityEnum.Experimental,
41
+ },
42
+ controlVariant: 'control',
43
+ variants: [
44
+ { id: 'control', name: 'Single-step form' },
45
+ {
46
+ id: 'multi_step',
47
+ name: 'Multi-step form',
48
+ overrides: [
49
+ { type: 'workflow', target: 'sigil.onboarding.workflow.multi_step' },
50
+ ],
51
+ },
52
+ ],
53
+ allocation: {
54
+ type: 'targeted',
55
+ rules: [
56
+ {
57
+ variantId: 'multi_step',
58
+ expression: "context.attributes?.segment === 'vip'",
59
+ },
60
+ ],
61
+ fallback: 'random',
62
+ },
63
+ successMetrics: [
64
+ {
65
+ name: 'Completion rate',
66
+ telemetryEvent: { name: 'sigil.telemetry.onboarding_completed', version: 1 },
67
+ aggregation: 'count',
68
+ },
69
+ ],
70
+ };
71
+ \`\`\`
72
+
73
+ ## Variant evaluation
74
+
75
+ \`\`\`ts
76
+ const evaluator = new ExperimentEvaluator({
77
+ registry: experimentRegistry,
78
+ policyChecker: (policyRef, context) =>
79
+ policyEngine.decide({
80
+ action: 'experiment_targeting',
81
+ subject: { roles: context.flags },
82
+ resource: { type: 'experiment', attributes: { name: context.experiment } },
83
+ policies: [policyRef],
84
+ }).effect === 'allow',
85
+ });
86
+
87
+ const assignment = await evaluator.chooseVariant({
88
+ experiment: 'sigil.onboarding.split_form',
89
+ userId: ctx.userId,
90
+ organizationId: ctx.organizationId,
91
+ attributes: ctx.attributes,
92
+ });
93
+
94
+ if (assignment) {
95
+ // Apply overrides for the chosen variant
96
+ applyExperimentOverrides(assignment.variant);
97
+ }
98
+ \`\`\`
99
+
100
+ - \`random\` uses deterministic hashing (\`salt\` optional) for stable splits
101
+ - \`sticky\` hashes a specified attribute (userId/orgId/sessionId)
102
+ - \`targeted\` evaluates rules in order; each rule can reference a PolicySpec and simple JS expressions (\`context\` input)
103
+
104
+ ## Integrations
105
+
106
+ - **Feature modules**: \`FeatureModuleSpec.experiments\` references experiments owned by a module
107
+ - **DataViewSpec / WorkflowSpec**: \`experiments?: ExperimentRef[]\` indicate which experiments modify the spec
108
+ - **Telemetry**: success metrics reference \`TelemetrySpec\` events to ensure compliant tracking
109
+ - **Policy**: targeting rules call into \`PolicyEngine\` via the evaluator callback to respect privacy/security
110
+
111
+ ## CLI workflow
112
+
113
+ \`\`\`
114
+ contractspec create experiment
115
+ \`\`\`
116
+
117
+ - Prompts for control/variants, allocation strategy, targeting rules, success metrics
118
+ - Outputs a typed \`ExperimentSpec\` file alongside your contracts
119
+
120
+ ## Best practices
121
+
122
+ 1. Keep experiments short-lived; increment \`meta.version\` when changing allocation or variants.
123
+ 2. Always declare a control variant and ensure overrides are reversible.
124
+ 3. Tie success metrics to privacy-reviewed telemetry events.
125
+ 4. Use targeting rules sparingly; combine with PolicySpec to avoid exposing experiments to unauthorized users.
126
+ 5. When an experiment wins, promote the variant to the canonical spec and retire the experiment.
127
+
128
+ `}];e(t);export{t as tech_contracts_experiments_DocBlocks};
@@ -0,0 +1 @@
1
+ import{registerDocBlocks as e}from"../../docs/registry.js";import"../../registry.js";const t=[{id:`docs.tech.contracts.forms`,title:`Contracts: FormSpec`,summary:`This document defines the canonical contracts for declarative forms.`,kind:`reference`,visibility:`public`,route:`/docs/tech/contracts/forms`,tags:[`tech`,`contracts`,`forms`],body:"# Contracts: FormSpec\n\nThis document defines the canonical contracts for declarative forms.\n\n## Overview\n\n- `FormSpec` (in `@lssm/lib.contracts/forms`) declares:\n - `meta` (extends `OwnerShipMeta`) + `key`/`version` for stability.\n - `model` (`@lssm/lib.schema` `SchemaModel`) as the single source of truth.\n - `fields` built from `FieldSpec` kinds: `text`, `textarea`, `select`, `checkbox`, `radio`, `switch`, `group`, `array`.\n - Optional `actions`, `policy.flags`, `constraints` and `renderHints`.\n- Relations DSL provides `visibleWhen`, `enabledWhen`, `requiredWhen` based on predicates.\n- `buildZodWithRelations(spec)` augments the base zod with conditional rules and constraints.\n- React adapter renders with React Hook Form + driver API for UI components (shadcn driver provided).\n\n## Driver API (UI-agnostic)\n\nHost apps supply a driver mapping slots → components:\n\n- Required: `Field`, `FieldLabel`, `FieldDescription`, `FieldError`, `Input`, `Textarea`, `Select`, `Checkbox`, `RadioGroup`, `Switch`, `Button`.\n- Optional: `FieldGroup`, `FieldSet`, `FieldLegend` and input group helpers.\n\nUse `createFormRenderer({ driver })` to obtain a `render(spec)` function.\n\n## Arrays and Groups\n\n- `array` items are rendered with `useFieldArray`, honoring `min`/`max` and add/remove controls.\n- `group` composes nested fields and provides optional legend/description.\n\n## Feature Flags\n\n- Declare `policy.flags` on forms to signal gating. Gate usage at host boundary; avoid scattering flags across individual fields.\n\n## Example\n\nSee `packages/hcircle/apps/web-coliving/src/forms/bug-report.spec.ts` for a concrete form spec and `components/forms/BugReportFormDemo.tsx` for rendering with a minimal shadcn driver mapping.\n"}];e(t);export{t as tech_contracts_forms_DocBlocks};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{CapabilityRegistry as e,capabilityKey as t,defineCapability as n}from"./capabilities.js";import{DataViewRegistry as r,dataViewKey as i}from"./data-views.js";import{defineEvent as a,eventKey as o}from"./events.js";import{FeatureRegistry as s,installFeature as c,validateFeatureTargetsV2 as l}from"./features.js";import{FormRegistry as u,buildZodWithRelations as d,defineFormSpec as f,evalPredicate as p}from"./forms.js";import{schemaToMarkdown as m,schemaToMarkdownDetail as h,schemaToMarkdownList as g,schemaToMarkdownSummary as _,schemaToMarkdownTable as v}from"./schema-to-markdown.js";import{TransformEngine as y,createDefaultTransformEngine as b,registerBasicValidation as x,registerDefaultReactRenderer as S,registerReactToMarkdownRenderer as C}from"./presentations.v2.js";import{createEngineWithDefaults as w,createFeatureModule as T,registerFeature as E,renderFeaturePresentation as D}from"./client/react/feature-render.js";import{createFormRenderer as O}from"./client/react/form-render.js";import{shadcnDriver as k}from"./client/react/drivers/shadcn.js";import{rnReusablesDriver as A}from"./client/react/drivers/rn-reusables.js";import"./client/index.js";import{defaultGqlField as j,defaultMcpTool as M,defaultRestPath as N,jsonSchemaForSpec as P}from"./jsonschema.js";import{registerContractsOnBuilder as F}from"./server/graphql-pothos.js";import{exportContractsToGraphQLSchema as I}from"./server/graphql-schema-export.js";import{PresentationRegistry as L,jsonSchemaForPresentation as R}from"./presentations.js";import{createMcpServer as z}from"./server/provider-mcp.js";import{createFetchHandler as B}from"./server/rest-generic.js";import{elysiaPlugin as V}from"./server/rest-elysia.js";import{expressRouter as H}from"./server/rest-express.js";import{makeNextAppHandler as U}from"./server/rest-next-app.js";import{makeNextPagesHandler as W}from"./server/rest-next-pages.js";import"./server/index.js";import{defineCommand as G,defineQuery as K,isEmitDeclRef as q}from"./spec.js";import{SpecRegistry as J,opKey as Y}from"./registry.js";import{installOp as X,makeEmit as Z,op as Q}from"./install.js";import{definePrompt as $}from"./prompt.js";import{PromptRegistry as ee}from"./promptRegistry.js";import{ResourceRegistry as te,defineResourceTemplate as ne,isResourceRef as re,resourceRef as ie}from"./resources.js";import{toV2FromV1 as ae}from"./presentations.backcompat.js";import{Owners as oe,OwnersEnum as se,StabilityEnum as ce,Tags as le,TagsEnum as ue}from"./ownership.js";import{CompleteOnboardingBaseInput as de,CompleteOnboardingBaseOutput as fe,CompleteOnboardingBaseSpec as pe,DeleteOnboardingDraftBaseSpec as me,DeleteOnboardingDraftOutput as he,GetOnboardingDraftBaseSpec as ge,GetOnboardingDraftOutput as _e,SaveOnboardingDraftBaseSpec as ve,SaveOnboardingDraftInput as ye,SaveOnboardingDraftOutput as be}from"./onboarding-base.js";import{openBankingAccountsReadCapability as xe,openBankingBalancesReadCapability as Se,openBankingTransactionsReadCapability as Ce,registerOpenBankingCapabilities as we}from"./capabilities/openbanking.js";import{PolicyRegistry as Te,makePolicyKey as Ee}from"./policy/spec.js";import{PolicyEngine as De}from"./policy/engine.js";import{OPAPolicyAdapter as Oe,buildOPAInput as ke}from"./policy/opa-adapter.js";import{ThemeRegistry as Ae,makeThemeRef as je}from"./themes.js";import{MigrationRegistry as Me}from"./migrations.js";import{TelemetryRegistry as Ne,makeTelemetryKey as Pe}from"./telemetry/spec.js";import{TelemetryTracker as Fe}from"./telemetry/tracker.js";import{TelemetryAnomalyMonitor as Ie}from"./telemetry/anomaly.js";import"./telemetry/index.js";import{TestRegistry as Le,makeTestKey as Re}from"./tests/spec.js";import{TestRunner as ze}from"./tests/runner.js";import"./tests/index.js";import{ExperimentRegistry as Be,makeExperimentKey as Ve}from"./experiments/spec.js";import{ExperimentEvaluator as He}from"./experiments/evaluator.js";import{AppBlueprintRegistry as Ue,makeAppBlueprintKey as We}from"./app-config/spec.js";import{composeAppConfig as Ge,resolveAppConfig as Ke}from"./app-config/runtime.js";import{IntegrationSpecRegistry as qe,makeIntegrationSpecKey as Je}from"./integrations/spec.js";import{registerStripeIntegration as Ye,stripeIntegrationSpec as Xe}from"./integrations/providers/stripe.js";import{postmarkIntegrationSpec as Ze,registerPostmarkIntegration as Qe}from"./integrations/providers/postmark.js";import{qdrantIntegrationSpec as $e,registerQdrantIntegration as et}from"./integrations/providers/qdrant.js";import{mistralIntegrationSpec as tt,registerMistralIntegration as nt}from"./integrations/providers/mistral.js";import{elevenLabsIntegrationSpec as rt,registerElevenLabsIntegration as it}from"./integrations/providers/elevenlabs.js";import{gmailIntegrationSpec as at,registerGmailIntegration as ot}from"./integrations/providers/gmail.js";import{googleCalendarIntegrationSpec as st,registerGoogleCalendarIntegration as ct}from"./integrations/providers/google-calendar.js";import{registerTwilioSmsIntegration as lt,twilioSmsIntegrationSpec as ut}from"./integrations/providers/twilio-sms.js";import{gcsStorageIntegrationSpec as dt,registerGcsStorageIntegration as ft}from"./integrations/providers/gcs-storage.js";import{powensIntegrationSpec as pt,registerPowensIntegration as mt}from"./integrations/providers/powens.js";import{MistralLLMProvider as ht}from"./integrations/providers/impls/mistral-llm.js";import{MistralEmbeddingProvider as gt}from"./integrations/providers/impls/mistral-embedding.js";import{QdrantVectorProvider as _t}from"./integrations/providers/impls/qdrant-vector.js";import{GmailInboundProvider as vt}from"./integrations/providers/impls/gmail-inbound.js";import{GmailOutboundProvider as yt}from"./integrations/providers/impls/gmail-outbound.js";import{GoogleCalendarProvider as bt}from"./integrations/providers/impls/google-calendar.js";import{ElevenLabsVoiceProvider as xt}from"./integrations/providers/impls/elevenlabs-voice.js";import{GoogleCloudStorageProvider as St}from"./integrations/providers/impls/gcs-storage.js";import{StripePaymentsProvider as Ct}from"./integrations/providers/impls/stripe-payments.js";import{PostmarkEmailProvider as wt}from"./integrations/providers/impls/postmark-email.js";import{TwilioSmsProvider as Tt}from"./integrations/providers/impls/twilio-sms.js";import{PowensClient as Et,PowensClientError as Dt}from"./integrations/providers/impls/powens-client.js";import{PowensOpenBankingProvider as Ot}from"./integrations/providers/impls/powens-openbanking.js";import{IntegrationProviderFactory as kt}from"./integrations/providers/impls/provider-factory.js";import{SecretProviderError as At,normalizeSecretPayload as jt,parseSecretUri as Mt}from"./integrations/secrets/provider.js";import{GcpSecretManagerProvider as Nt}from"./integrations/secrets/gcp-secret-manager.js";import{EnvSecretProvider as Pt}from"./integrations/secrets/env-secret-provider.js";import{SecretProviderManager as Ft}from"./integrations/secrets/manager.js";import{IntegrationCallGuard as It,connectionStatusLabel as Lt,ensureConnectionReady as Rt}from"./integrations/runtime.js";import{IntegrationHealthService as zt}from"./integrations/health.js";import{AccountBalanceRecord as Bt,BankAccountRecord as Vt,BankTransactionRecord as Ht}from"./integrations/openbanking/models.js";import{OPENBANKING_PII_FIELDS as Ut,OPENBANKING_TELEMETRY_EVENTS as Wt,redactOpenBankingTelemetryPayload as Gt}from"./integrations/openbanking/telemetry.js";import{OpenBankingGetAccount as Kt,OpenBankingListAccounts as qt,OpenBankingSyncAccounts as Jt}from"./integrations/openbanking/contracts/accounts.js";import{OpenBankingListTransactions as Yt,OpenBankingSyncTransactions as Xt}from"./integrations/openbanking/contracts/transactions.js";import{OpenBankingGetBalances as Zt,OpenBankingRefreshBalances as Qt}from"./integrations/openbanking/contracts/balances.js";import{registerOpenBankingContracts as $t}from"./integrations/openbanking/contracts/index.js";import{assertPrimaryOpenBankingReady as en,ensurePrimaryOpenBankingIntegration as tn}from"./integrations/openbanking/guards.js";import"./integrations/index.js";import{KnowledgeSpaceRegistry as nn,makeKnowledgeSpaceKey as rn}from"./knowledge/spec.js";import{productCanonKnowledgeSpace as an,registerProductCanonKnowledgeSpace as on}from"./knowledge/spaces/product-canon.js";import{registerSupportFaqKnowledgeSpace as sn,supportFaqKnowledgeSpace as cn}from"./knowledge/spaces/support-faq.js";import{emailThreadsKnowledgeSpace as ln,registerEmailThreadsKnowledgeSpace as un}from"./knowledge/spaces/email-threads.js";import{registerUploadedDocsKnowledgeSpace as dn,uploadedDocsKnowledgeSpace as fn}from"./knowledge/spaces/uploaded-docs.js";import{financialDocsKnowledgeSpace as pn,registerFinancialDocsKnowledgeSpace as mn}from"./knowledge/spaces/financial-docs.js";import{financialOverviewKnowledgeSpace as hn,registerFinancialOverviewKnowledgeSpace as gn}from"./knowledge/spaces/financial-overview.js";import"./knowledge/index.js";import{CreateIntegrationConnection as _n,DeleteIntegrationConnection as vn,ListIntegrationConnections as yn,TestIntegrationConnection as bn,UpdateIntegrationConnection as xn,integrationContracts as Sn,registerIntegrationContracts as Cn}from"./integrations/contracts.js";import{CreateKnowledgeSource as wn,DeleteKnowledgeSource as Tn,ListKnowledgeSources as En,TriggerKnowledgeSourceSync as Dn,UpdateKnowledgeSource as On,knowledgeContracts as kn,registerKnowledgeContracts as An}from"./knowledge/contracts.js";import{behaviorToEnvelope as jn,errorToEnvelope as Mn,telemetryToEnvelope as Nn}from"./regenerator/utils.js";import{RegeneratorService as Pn}from"./regenerator/service.js";import{ProposalExecutor as Fn}from"./regenerator/executor.js";import{ExecutorProposalSink as In}from"./regenerator/sinks.js";import"./regenerator/index.js";import{WorkflowRegistry as Ln}from"./workflow/spec.js";import{WorkflowValidationError as Rn,assertWorkflowSpecValid as zn,validateWorkflowSpec as Bn}from"./workflow/validation.js";import{evaluateExpression as Vn}from"./workflow/expression.js";import{WorkflowPreFlightError as Hn,WorkflowRunner as Un}from"./workflow/runner.js";import{InMemoryStateStore as Wn}from"./workflow/adapters/memory-store.js";import{PrismaStateStore as Gn}from"./workflow/adapters/db-adapter.js";import{createFileStateStore as Kn}from"./workflow/adapters/file-adapter.js";import"./workflow/index.js";import{defineSchemaModel as qn}from"@lssm/lib.schema";export{Bt as AccountBalanceRecord,Ue as AppBlueprintRegistry,Vt as BankAccountRecord,Ht as BankTransactionRecord,e as CapabilityRegistry,de as CompleteOnboardingBaseInput,fe as CompleteOnboardingBaseOutput,pe as CompleteOnboardingBaseSpec,_n as CreateIntegrationConnection,wn as CreateKnowledgeSource,r as DataViewRegistry,vn as DeleteIntegrationConnection,Tn as DeleteKnowledgeSource,me as DeleteOnboardingDraftBaseSpec,he as DeleteOnboardingDraftOutput,xt as ElevenLabsVoiceProvider,Pt as EnvSecretProvider,In as ExecutorProposalSink,He as ExperimentEvaluator,Be as ExperimentRegistry,s as FeatureRegistry,u as FormRegistry,Nt as GcpSecretManagerProvider,ge as GetOnboardingDraftBaseSpec,_e as GetOnboardingDraftOutput,vt as GmailInboundProvider,yt as GmailOutboundProvider,bt as GoogleCalendarProvider,St as GoogleCloudStorageProvider,Wn as InMemoryStateStore,It as IntegrationCallGuard,zt as IntegrationHealthService,kt as IntegrationProviderFactory,qe as IntegrationSpecRegistry,nn as KnowledgeSpaceRegistry,yn as ListIntegrationConnections,En as ListKnowledgeSources,Me as MigrationRegistry,gt as MistralEmbeddingProvider,ht as MistralLLMProvider,Oe as OPAPolicyAdapter,Ut as OPENBANKING_PII_FIELDS,Wt as OPENBANKING_TELEMETRY_EVENTS,Kt as OpenBankingGetAccount,Zt as OpenBankingGetBalances,qt as OpenBankingListAccounts,Yt as OpenBankingListTransactions,Qt as OpenBankingRefreshBalances,Jt as OpenBankingSyncAccounts,Xt as OpenBankingSyncTransactions,oe as Owners,se as OwnersEnum,De as PolicyEngine,Te as PolicyRegistry,wt as PostmarkEmailProvider,Et as PowensClient,Dt as PowensClientError,Ot as PowensOpenBankingProvider,L as PresentationRegistry,Gn as PrismaStateStore,ee as PromptRegistry,Fn as ProposalExecutor,_t as QdrantVectorProvider,Pn as RegeneratorService,te as ResourceRegistry,ve as SaveOnboardingDraftBaseSpec,ye as SaveOnboardingDraftInput,be as SaveOnboardingDraftOutput,At as SecretProviderError,Ft as SecretProviderManager,J as SpecRegistry,ce as StabilityEnum,Ct as StripePaymentsProvider,le as Tags,ue as TagsEnum,Ie as TelemetryAnomalyMonitor,Ne as TelemetryRegistry,Fe as TelemetryTracker,bn as TestIntegrationConnection,Le as TestRegistry,ze as TestRunner,Ae as ThemeRegistry,y as TransformEngine,Dn as TriggerKnowledgeSourceSync,Tt as TwilioSmsProvider,xn as UpdateIntegrationConnection,On as UpdateKnowledgeSource,Hn as WorkflowPreFlightError,Ln as WorkflowRegistry,Un as WorkflowRunner,Rn as WorkflowValidationError,en as assertPrimaryOpenBankingReady,zn as assertWorkflowSpecValid,jn as behaviorToEnvelope,ke as buildOPAInput,d as buildZodWithRelations,t as capabilityKey,Ge as composeAppConfig,Lt as connectionStatusLabel,b as createDefaultTransformEngine,w as createEngineWithDefaults,T as createFeatureModule,B as createFetchHandler,Kn as createFileStateStore,O as createFormRenderer,z as createMcpServer,i as dataViewKey,j as defaultGqlField,M as defaultMcpTool,N as defaultRestPath,n as defineCapability,G as defineCommand,a as defineEvent,f as defineFormSpec,$ as definePrompt,K as defineQuery,ne as defineResourceTemplate,qn as defineSchemaModel,rt as elevenLabsIntegrationSpec,V as elysiaPlugin,ln as emailThreadsKnowledgeSpace,Rt as ensureConnectionReady,tn as ensurePrimaryOpenBankingIntegration,Mn as errorToEnvelope,p as evalPredicate,Vn as evaluateExpression,o as eventKey,I as exportContractsToGraphQLSchema,H as expressRouter,pn as financialDocsKnowledgeSpace,hn as financialOverviewKnowledgeSpace,dt as gcsStorageIntegrationSpec,at as gmailIntegrationSpec,st as googleCalendarIntegrationSpec,c as installFeature,X as installOp,Sn as integrationContracts,q as isEmitDeclRef,re as isResourceRef,R as jsonSchemaForPresentation,P as jsonSchemaForSpec,kn as knowledgeContracts,We as makeAppBlueprintKey,Z as makeEmit,Ve as makeExperimentKey,Je as makeIntegrationSpecKey,rn as makeKnowledgeSpaceKey,U as makeNextAppHandler,W as makeNextPagesHandler,Ee as makePolicyKey,Pe as makeTelemetryKey,Re as makeTestKey,je as makeThemeRef,tt as mistralIntegrationSpec,jt as normalizeSecretPayload,Q as op,Y as opKey,xe as openBankingAccountsReadCapability,Se as openBankingBalancesReadCapability,Ce as openBankingTransactionsReadCapability,Mt as parseSecretUri,Ze as postmarkIntegrationSpec,pt as powensIntegrationSpec,an as productCanonKnowledgeSpace,$e as qdrantIntegrationSpec,Gt as redactOpenBankingTelemetryPayload,x as registerBasicValidation,F as registerContractsOnBuilder,S as registerDefaultReactRenderer,it as registerElevenLabsIntegration,un as registerEmailThreadsKnowledgeSpace,E as registerFeature,mn as registerFinancialDocsKnowledgeSpace,gn as registerFinancialOverviewKnowledgeSpace,ft as registerGcsStorageIntegration,ot as registerGmailIntegration,ct as registerGoogleCalendarIntegration,Cn as registerIntegrationContracts,An as registerKnowledgeContracts,nt as registerMistralIntegration,we as registerOpenBankingCapabilities,$t as registerOpenBankingContracts,Qe as registerPostmarkIntegration,mt as registerPowensIntegration,on as registerProductCanonKnowledgeSpace,et as registerQdrantIntegration,C as registerReactToMarkdownRenderer,Ye as registerStripeIntegration,sn as registerSupportFaqKnowledgeSpace,lt as registerTwilioSmsIntegration,dn as registerUploadedDocsKnowledgeSpace,D as renderFeaturePresentation,Ke as resolveAppConfig,ie as resourceRef,A as rnReusablesDriver,m as schemaToMarkdown,h as schemaToMarkdownDetail,g as schemaToMarkdownList,_ as schemaToMarkdownSummary,v as schemaToMarkdownTable,k as shadcnDriver,Xe as stripeIntegrationSpec,cn as supportFaqKnowledgeSpace,Nn as telemetryToEnvelope,ae as toV2FromV1,ut as twilioSmsIntegrationSpec,fn as uploadedDocsKnowledgeSpace,l as validateFeatureTargetsV2,Bn as validateWorkflowSpec};
1
+ import{CapabilityRegistry as e,capabilityKey as t,defineCapability as n}from"./capabilities.js";import{DataViewRegistry as r,dataViewKey as i}from"./data-views.js";import{defineEvent as a,eventKey as o}from"./events.js";import{FeatureRegistry as s,installFeature as c,validateFeatureTargetsV2 as l}from"./features.js";import{FormRegistry as u,buildZodWithRelations as d,defineFormSpec as f,evalPredicate as p}from"./forms.js";import{schemaToMarkdown as m,schemaToMarkdownDetail as h,schemaToMarkdownList as g,schemaToMarkdownSummary as _,schemaToMarkdownTable as v}from"./schema-to-markdown.js";import{TransformEngine as y,createDefaultTransformEngine as b,registerBasicValidation as x,registerDefaultReactRenderer as S,registerReactToMarkdownRenderer as C}from"./presentations.v2.js";import{createEngineWithDefaults as w,createFeatureModule as T,registerFeature as E,renderFeaturePresentation as D}from"./client/react/feature-render.js";import{createFormRenderer as O}from"./client/react/form-render.js";import{shadcnDriver as k}from"./client/react/drivers/shadcn.js";import{rnReusablesDriver as A}from"./client/react/drivers/rn-reusables.js";import"./client/index.js";import{defaultGqlField as j,defaultMcpTool as M,defaultRestPath as N,jsonSchemaForSpec as P}from"./jsonschema.js";import{registerContractsOnBuilder as F}from"./server/graphql-pothos.js";import{PresentationRegistry as I,jsonSchemaForPresentation as L}from"./presentations.js";import{createMcpServer as R}from"./server/provider-mcp.js";import{createFetchHandler as z}from"./server/rest-generic.js";import{elysiaPlugin as B}from"./server/rest-elysia.js";import{expressRouter as V}from"./server/rest-express.js";import{makeNextAppHandler as H}from"./server/rest-next-app.js";import{makeNextPagesHandler as U}from"./server/rest-next-pages.js";import"./server/index.js";import{defineCommand as W,defineQuery as G,isEmitDeclRef as K}from"./spec.js";import{docBlockToPresentationSpec as q,docBlockToPresentationV2 as J,docBlocksToPresentationRoutes as Y,docBlocksToPresentationSpecs as X,mapDocRoutes as Z}from"./docs/presentations.js";import{DocRegistry as Q,defaultDocRegistry as $,docId as ee,listRegisteredDocBlocks as te,registerDocBlocks as ne}from"./docs/registry.js";import{SpecRegistry as re,opKey as ie}from"./registry.js";import{installOp as ae,makeEmit as oe,op as se}from"./install.js";import{definePrompt as ce}from"./prompt.js";import{PromptRegistry as le}from"./promptRegistry.js";import{ResourceRegistry as ue,defineResourceTemplate as de,isResourceRef as fe,resourceRef as pe}from"./resources.js";import{toV2FromV1 as me}from"./presentations.backcompat.js";import{Owners as he,OwnersEnum as ge,StabilityEnum as _e,Tags as ve,TagsEnum as ye}from"./ownership.js";import{CompleteOnboardingBaseInput as be,CompleteOnboardingBaseOutput as xe,CompleteOnboardingBaseSpec as Se,DeleteOnboardingDraftBaseSpec as Ce,DeleteOnboardingDraftOutput as we,GetOnboardingDraftBaseSpec as Te,GetOnboardingDraftOutput as Ee,SaveOnboardingDraftBaseSpec as De,SaveOnboardingDraftInput as Oe,SaveOnboardingDraftOutput as ke}from"./onboarding-base.js";import{openBankingAccountsReadCapability as Ae,openBankingBalancesReadCapability as je,openBankingTransactionsReadCapability as Me,registerOpenBankingCapabilities as Ne}from"./capabilities/openbanking.js";import{PolicyRegistry as Pe,makePolicyKey as Fe}from"./policy/spec.js";import{PolicyEngine as Ie}from"./policy/engine.js";import{OPAPolicyAdapter as Le,buildOPAInput as Re}from"./policy/opa-adapter.js";import{ThemeRegistry as ze,makeThemeRef as Be}from"./themes.js";import{MigrationRegistry as Ve}from"./migrations.js";import{TelemetryRegistry as He,makeTelemetryKey as Ue}from"./telemetry/spec.js";import{TelemetryTracker as We}from"./telemetry/tracker.js";import{TelemetryAnomalyMonitor as Ge}from"./telemetry/anomaly.js";import"./telemetry/index.js";import{TestRegistry as Ke,makeTestKey as qe}from"./tests/spec.js";import{TestRunner as Je}from"./tests/runner.js";import"./tests/index.js";import{ExperimentRegistry as Ye,makeExperimentKey as Xe}from"./experiments/spec.js";import{ExperimentEvaluator as Ze}from"./experiments/evaluator.js";import{AppBlueprintRegistry as Qe,makeAppBlueprintKey as $e}from"./app-config/spec.js";import{composeAppConfig as et,resolveAppConfig as tt}from"./app-config/runtime.js";import{IntegrationSpecRegistry as nt,makeIntegrationSpecKey as rt}from"./integrations/spec.js";import{registerStripeIntegration as it,stripeIntegrationSpec as at}from"./integrations/providers/stripe.js";import{postmarkIntegrationSpec as ot,registerPostmarkIntegration as st}from"./integrations/providers/postmark.js";import{qdrantIntegrationSpec as ct,registerQdrantIntegration as lt}from"./integrations/providers/qdrant.js";import{mistralIntegrationSpec as ut,registerMistralIntegration as dt}from"./integrations/providers/mistral.js";import{elevenLabsIntegrationSpec as ft,registerElevenLabsIntegration as pt}from"./integrations/providers/elevenlabs.js";import{gmailIntegrationSpec as mt,registerGmailIntegration as ht}from"./integrations/providers/gmail.js";import{googleCalendarIntegrationSpec as gt,registerGoogleCalendarIntegration as _t}from"./integrations/providers/google-calendar.js";import{registerTwilioSmsIntegration as vt,twilioSmsIntegrationSpec as yt}from"./integrations/providers/twilio-sms.js";import{gcsStorageIntegrationSpec as bt,registerGcsStorageIntegration as xt}from"./integrations/providers/gcs-storage.js";import{powensIntegrationSpec as St,registerPowensIntegration as Ct}from"./integrations/providers/powens.js";import{MistralLLMProvider as wt}from"./integrations/providers/impls/mistral-llm.js";import{MistralEmbeddingProvider as Tt}from"./integrations/providers/impls/mistral-embedding.js";import{QdrantVectorProvider as Et}from"./integrations/providers/impls/qdrant-vector.js";import{GmailInboundProvider as Dt}from"./integrations/providers/impls/gmail-inbound.js";import{GmailOutboundProvider as Ot}from"./integrations/providers/impls/gmail-outbound.js";import{GoogleCalendarProvider as kt}from"./integrations/providers/impls/google-calendar.js";import{ElevenLabsVoiceProvider as At}from"./integrations/providers/impls/elevenlabs-voice.js";import{GoogleCloudStorageProvider as jt}from"./integrations/providers/impls/gcs-storage.js";import{StripePaymentsProvider as Mt}from"./integrations/providers/impls/stripe-payments.js";import{PostmarkEmailProvider as Nt}from"./integrations/providers/impls/postmark-email.js";import{TwilioSmsProvider as Pt}from"./integrations/providers/impls/twilio-sms.js";import{PowensClient as Ft,PowensClientError as It}from"./integrations/providers/impls/powens-client.js";import{PowensOpenBankingProvider as Lt}from"./integrations/providers/impls/powens-openbanking.js";import{IntegrationProviderFactory as Rt}from"./integrations/providers/impls/provider-factory.js";import{SecretProviderError as zt,normalizeSecretPayload as Bt,parseSecretUri as Vt}from"./integrations/secrets/provider.js";import{GcpSecretManagerProvider as Ht}from"./integrations/secrets/gcp-secret-manager.js";import{EnvSecretProvider as Ut}from"./integrations/secrets/env-secret-provider.js";import{SecretProviderManager as Wt}from"./integrations/secrets/manager.js";import{IntegrationCallGuard as Gt,connectionStatusLabel as Kt,ensureConnectionReady as qt}from"./integrations/runtime.js";import{IntegrationHealthService as Jt}from"./integrations/health.js";import{AccountBalanceRecord as Yt,BankAccountRecord as Xt,BankTransactionRecord as Zt}from"./integrations/openbanking/models.js";import{OPENBANKING_PII_FIELDS as Qt,OPENBANKING_TELEMETRY_EVENTS as $t,redactOpenBankingTelemetryPayload as en}from"./integrations/openbanking/telemetry.js";import{OpenBankingGetAccount as tn,OpenBankingListAccounts as nn,OpenBankingSyncAccounts as rn}from"./integrations/openbanking/contracts/accounts.js";import{OpenBankingListTransactions as an,OpenBankingSyncTransactions as on}from"./integrations/openbanking/contracts/transactions.js";import{OpenBankingGetBalances as sn,OpenBankingRefreshBalances as cn}from"./integrations/openbanking/contracts/balances.js";import{registerOpenBankingContracts as ln}from"./integrations/openbanking/contracts/index.js";import{assertPrimaryOpenBankingReady as un,ensurePrimaryOpenBankingIntegration as dn}from"./integrations/openbanking/guards.js";import"./integrations/index.js";import{KnowledgeSpaceRegistry as fn,makeKnowledgeSpaceKey as pn}from"./knowledge/spec.js";import{productCanonKnowledgeSpace as mn,registerProductCanonKnowledgeSpace as hn}from"./knowledge/spaces/product-canon.js";import{registerSupportFaqKnowledgeSpace as gn,supportFaqKnowledgeSpace as _n}from"./knowledge/spaces/support-faq.js";import{emailThreadsKnowledgeSpace as vn,registerEmailThreadsKnowledgeSpace as yn}from"./knowledge/spaces/email-threads.js";import{registerUploadedDocsKnowledgeSpace as bn,uploadedDocsKnowledgeSpace as xn}from"./knowledge/spaces/uploaded-docs.js";import{financialDocsKnowledgeSpace as Sn,registerFinancialDocsKnowledgeSpace as Cn}from"./knowledge/spaces/financial-docs.js";import{financialOverviewKnowledgeSpace as wn,registerFinancialOverviewKnowledgeSpace as Tn}from"./knowledge/spaces/financial-overview.js";import"./knowledge/index.js";import{CreateIntegrationConnection as En,DeleteIntegrationConnection as Dn,ListIntegrationConnections as On,TestIntegrationConnection as kn,UpdateIntegrationConnection as An,integrationContracts as jn,registerIntegrationContracts as Mn}from"./integrations/contracts.js";import{CreateKnowledgeSource as Nn,DeleteKnowledgeSource as Pn,ListKnowledgeSources as Fn,TriggerKnowledgeSourceSync as In,UpdateKnowledgeSource as Ln,knowledgeContracts as Rn,registerKnowledgeContracts as zn}from"./knowledge/contracts.js";import{behaviorToEnvelope as Bn,errorToEnvelope as Vn,telemetryToEnvelope as Hn}from"./regenerator/utils.js";import{RegeneratorService as Un}from"./regenerator/service.js";import{ProposalExecutor as Wn}from"./regenerator/executor.js";import{ExecutorProposalSink as Gn}from"./regenerator/sinks.js";import"./regenerator/index.js";import{WorkflowRegistry as Kn}from"./workflow/spec.js";import{WorkflowValidationError as qn,assertWorkflowSpecValid as Jn,validateWorkflowSpec as Yn}from"./workflow/validation.js";import{evaluateExpression as Xn}from"./workflow/expression.js";import{WorkflowPreFlightError as Zn,WorkflowRunner as Qn}from"./workflow/runner.js";import{InMemoryStateStore as $n}from"./workflow/adapters/memory-store.js";import{PrismaStateStore as er}from"./workflow/adapters/db-adapter.js";import{createFileStateStore as tr}from"./workflow/adapters/file-adapter.js";import"./workflow/index.js";import{techContractsDocs as nr}from"./docs/tech-contracts.docs.js";import{metaDocs as rr}from"./docs/meta.docs.js";import"./docs/index.js";import{defineSchemaModel as ir}from"@lssm/lib.schema";export{Yt as AccountBalanceRecord,Qe as AppBlueprintRegistry,Xt as BankAccountRecord,Zt as BankTransactionRecord,e as CapabilityRegistry,be as CompleteOnboardingBaseInput,xe as CompleteOnboardingBaseOutput,Se as CompleteOnboardingBaseSpec,En as CreateIntegrationConnection,Nn as CreateKnowledgeSource,r as DataViewRegistry,Dn as DeleteIntegrationConnection,Pn as DeleteKnowledgeSource,Ce as DeleteOnboardingDraftBaseSpec,we as DeleteOnboardingDraftOutput,Q as DocRegistry,At as ElevenLabsVoiceProvider,Ut as EnvSecretProvider,Gn as ExecutorProposalSink,Ze as ExperimentEvaluator,Ye as ExperimentRegistry,s as FeatureRegistry,u as FormRegistry,Ht as GcpSecretManagerProvider,Te as GetOnboardingDraftBaseSpec,Ee as GetOnboardingDraftOutput,Dt as GmailInboundProvider,Ot as GmailOutboundProvider,kt as GoogleCalendarProvider,jt as GoogleCloudStorageProvider,$n as InMemoryStateStore,Gt as IntegrationCallGuard,Jt as IntegrationHealthService,Rt as IntegrationProviderFactory,nt as IntegrationSpecRegistry,fn as KnowledgeSpaceRegistry,On as ListIntegrationConnections,Fn as ListKnowledgeSources,Ve as MigrationRegistry,Tt as MistralEmbeddingProvider,wt as MistralLLMProvider,Le as OPAPolicyAdapter,Qt as OPENBANKING_PII_FIELDS,$t as OPENBANKING_TELEMETRY_EVENTS,tn as OpenBankingGetAccount,sn as OpenBankingGetBalances,nn as OpenBankingListAccounts,an as OpenBankingListTransactions,cn as OpenBankingRefreshBalances,rn as OpenBankingSyncAccounts,on as OpenBankingSyncTransactions,he as Owners,ge as OwnersEnum,Ie as PolicyEngine,Pe as PolicyRegistry,Nt as PostmarkEmailProvider,Ft as PowensClient,It as PowensClientError,Lt as PowensOpenBankingProvider,I as PresentationRegistry,er as PrismaStateStore,le as PromptRegistry,Wn as ProposalExecutor,Et as QdrantVectorProvider,Un as RegeneratorService,ue as ResourceRegistry,De as SaveOnboardingDraftBaseSpec,Oe as SaveOnboardingDraftInput,ke as SaveOnboardingDraftOutput,zt as SecretProviderError,Wt as SecretProviderManager,re as SpecRegistry,_e as StabilityEnum,Mt as StripePaymentsProvider,ve as Tags,ye as TagsEnum,Ge as TelemetryAnomalyMonitor,He as TelemetryRegistry,We as TelemetryTracker,kn as TestIntegrationConnection,Ke as TestRegistry,Je as TestRunner,ze as ThemeRegistry,y as TransformEngine,In as TriggerKnowledgeSourceSync,Pt as TwilioSmsProvider,An as UpdateIntegrationConnection,Ln as UpdateKnowledgeSource,Zn as WorkflowPreFlightError,Kn as WorkflowRegistry,Qn as WorkflowRunner,qn as WorkflowValidationError,un as assertPrimaryOpenBankingReady,Jn as assertWorkflowSpecValid,Bn as behaviorToEnvelope,Re as buildOPAInput,d as buildZodWithRelations,t as capabilityKey,et as composeAppConfig,Kt as connectionStatusLabel,b as createDefaultTransformEngine,w as createEngineWithDefaults,T as createFeatureModule,z as createFetchHandler,tr as createFileStateStore,O as createFormRenderer,R as createMcpServer,i as dataViewKey,$ as defaultDocRegistry,j as defaultGqlField,M as defaultMcpTool,N as defaultRestPath,n as defineCapability,W as defineCommand,a as defineEvent,f as defineFormSpec,ce as definePrompt,G as defineQuery,de as defineResourceTemplate,ir as defineSchemaModel,q as docBlockToPresentationSpec,J as docBlockToPresentationV2,Y as docBlocksToPresentationRoutes,X as docBlocksToPresentationSpecs,ee as docId,ft as elevenLabsIntegrationSpec,B as elysiaPlugin,vn as emailThreadsKnowledgeSpace,qt as ensureConnectionReady,dn as ensurePrimaryOpenBankingIntegration,Vn as errorToEnvelope,p as evalPredicate,Xn as evaluateExpression,o as eventKey,V as expressRouter,Sn as financialDocsKnowledgeSpace,wn as financialOverviewKnowledgeSpace,bt as gcsStorageIntegrationSpec,mt as gmailIntegrationSpec,gt as googleCalendarIntegrationSpec,c as installFeature,ae as installOp,jn as integrationContracts,K as isEmitDeclRef,fe as isResourceRef,L as jsonSchemaForPresentation,P as jsonSchemaForSpec,Rn as knowledgeContracts,te as listRegisteredDocBlocks,$e as makeAppBlueprintKey,oe as makeEmit,Xe as makeExperimentKey,rt as makeIntegrationSpecKey,pn as makeKnowledgeSpaceKey,H as makeNextAppHandler,U as makeNextPagesHandler,Fe as makePolicyKey,Ue as makeTelemetryKey,qe as makeTestKey,Be as makeThemeRef,Z as mapDocRoutes,rr as metaDocs,ut as mistralIntegrationSpec,Bt as normalizeSecretPayload,se as op,ie as opKey,Ae as openBankingAccountsReadCapability,je as openBankingBalancesReadCapability,Me as openBankingTransactionsReadCapability,Vt as parseSecretUri,ot as postmarkIntegrationSpec,St as powensIntegrationSpec,mn as productCanonKnowledgeSpace,ct as qdrantIntegrationSpec,en as redactOpenBankingTelemetryPayload,x as registerBasicValidation,F as registerContractsOnBuilder,S as registerDefaultReactRenderer,ne as registerDocBlocks,pt as registerElevenLabsIntegration,yn as registerEmailThreadsKnowledgeSpace,E as registerFeature,Cn as registerFinancialDocsKnowledgeSpace,Tn as registerFinancialOverviewKnowledgeSpace,xt as registerGcsStorageIntegration,ht as registerGmailIntegration,_t as registerGoogleCalendarIntegration,Mn as registerIntegrationContracts,zn as registerKnowledgeContracts,dt as registerMistralIntegration,Ne as registerOpenBankingCapabilities,ln as registerOpenBankingContracts,st as registerPostmarkIntegration,Ct as registerPowensIntegration,hn as registerProductCanonKnowledgeSpace,lt as registerQdrantIntegration,C as registerReactToMarkdownRenderer,it as registerStripeIntegration,gn as registerSupportFaqKnowledgeSpace,vt as registerTwilioSmsIntegration,bn as registerUploadedDocsKnowledgeSpace,D as renderFeaturePresentation,tt as resolveAppConfig,pe as resourceRef,A as rnReusablesDriver,m as schemaToMarkdown,h as schemaToMarkdownDetail,g as schemaToMarkdownList,_ as schemaToMarkdownSummary,v as schemaToMarkdownTable,k as shadcnDriver,at as stripeIntegrationSpec,_n as supportFaqKnowledgeSpace,nr as techContractsDocs,Hn as telemetryToEnvelope,me as toV2FromV1,yt as twilioSmsIntegrationSpec,xn as uploadedDocsKnowledgeSpace,l as validateFeatureTargetsV2,Yn as validateWorkflowSpec};
@@ -0,0 +1,101 @@
1
+ import{registerDocBlocks as e}from"../../docs/registry.js";import"../../registry.js";const t=[{id:`docs.tech.contracts.integrations`,title:`ContractSpec Integrations`,summary:`This document describes the integration architecture that powers the`,kind:`reference`,visibility:`public`,route:`/docs/tech/contracts/integrations`,tags:[`tech`,`contracts`,`integrations`],body:`# ContractSpec Integrations
2
+
3
+ This document describes the integration architecture that powers the
4
+ Pocket Family Office vertical and other ContractSpec-based apps. It
5
+ focuses on provider-agnostic contracts, secret management, health
6
+ checking, and runtime guards.
7
+
8
+ ## Core Concepts
9
+
10
+ - **IntegrationSpec** – declarative description of a provider that lists
11
+ supported ownership modes, capability mappings, configuration schema,
12
+ secret schema, health check policy, and documentation metadata.
13
+ - **IntegrationConnection** – tenant/environment binding to a provider
14
+ (\`meta\` + ownership mode + config + \`secretRef\`). Secrets are never
15
+ embedded in specs or configs.
16
+ - **AppIntegrationSlot** – blueprint-level requirement that declares
17
+ which integration categories/capabilities must be satisfied at runtime
18
+ (e.g. \`primaryLLM\`, \`primaryVectorDb\`).
19
+ - **AppIntegrationBinding** – tenant-level slot → connection mapping.
20
+ - **ResolvedIntegration** – runtime view containing slot metadata,
21
+ connection details, and the resolved IntegrationSpec.
22
+
23
+ ## Registered Providers
24
+
25
+ The Pocket Family Office reference registers ten priority providers in
26
+ \`packages/libs/contracts/src/integrations/providers\`:
27
+
28
+ | Category | Provider | Key | Notes |
29
+ | ------------- | ---------------- | --------------------------- | ------------------------------------------------- |
30
+ | payments | Stripe | \`payments.stripe\` | Card + invoice flows, managed or BYOK credentials |
31
+ | email (out) | Postmark | \`email.postmark\` | Transactional email delivery |
32
+ | email (in) | Gmail API | \`email.gmail\` | Thread ingestion (OAuth BYOK or service account) |
33
+ | calendar | Google Calendar | \`calendar.google\` | Event scheduling via service account |
34
+ | vector-db | Qdrant | \`vectordb.qdrant\` | Embedding storage & search |
35
+ | storage | Google Cloud | \`storage.gcs\` | S3-compatible object storage |
36
+ | ai-llm | Mistral | \`ai-llm.mistral\` | Primary chat + embedding provider |
37
+ | ai-voice | ElevenLabs | \`ai-voice.elevenlabs\` | Text-to-speech synthesis |
38
+ | sms | Twilio SMS | \`sms.twilio\` | Urgent and fallback reminders |
39
+ | open-banking | Powens | \`openbanking.powens\` | Read-only account, transaction, and balance sync |
40
+
41
+ Each provider ships with:
42
+
43
+ - Strongly typed adapter interfaces (\`payments.ts\`, \`llm.ts\`, etc.).
44
+ - A concrete SDK-backed implementation under \`providers/impls\`.
45
+ - Unit tests validating adapter behaviour and health checks.
46
+
47
+ ## Secret Management
48
+
49
+ All integrations rely on the \`SecretProvider\` abstraction defined in
50
+ \`integrations/secrets\`. Two providers ship with the contracts library and
51
+ are orchestrated by the \`SecretProviderManager\` composite:
52
+
53
+ - **EnvSecretProvider (\`env-secret-provider.ts\`)** – high-priority,
54
+ read-only overrides backed by environment variables. Supports the
55
+ \`env://VARIABLE_NAME\` scheme as well as overrides for other schemes via
56
+ \`?env=ALIAS\` or derived uppercase keys (e.g.
57
+ \`gcp://.../stripe-secret-key\` → \`PROJECTS_DEMO_SECRETS_STRIPE_SECRET_KEY\`).
58
+ - **GcpSecretManagerProvider (\`gcp-secret-manager.ts\`)** – production
59
+ backend for versioned, auditable secrets stored in Google Cloud Secret
60
+ Manager.
61
+
62
+ The manager attempts providers in priority order (environment first,
63
+ then GCP). Key points:
64
+
65
+ - \`secretRef\` uses a URI scheme (examples: \`env://LOCAL_API_TOKEN\`,
66
+ \`gcp://projects/demo/secrets/stripe-key/versions/latest\`).
67
+ - \`IntegrationCallGuard\` fetches and parses secrets before executing a
68
+ provider adapter.
69
+ - Providers never accept raw secrets in constructors; they expect a map
70
+ of resolved string values from the guard.
71
+ - Local development can rely on \`.env\` files, while staging/production
72
+ reference long-lived GCP secrets without changing the integration
73
+ specs.
74
+
75
+ ## Health Checks & Telemetry
76
+
77
+ - Each IntegrationSpec optionally declares \`healthCheck.method\` and
78
+ timeouts.
79
+ - \`IntegrationCallGuard\` enforces connection status, wraps retries with
80
+ exponential back-off, and emits telemetry events tagged with tenant,
81
+ app, blueprint, config version, and slot id.
82
+ - Validation rules (\`app-config/validation.ts\`) surface issues at
83
+ publish time (slot mismatch, unsupported ownership modes, missing
84
+ capabilities, etc.).
85
+
86
+ ## Runtime Usage
87
+
88
+ 1. Blueprint defines slots (\`primaryLLM\`, \`primaryVectorDb\`, ...).
89
+ 2. Tenant binds connections referencing the integration ids above.
90
+ 3. \`composeAppConfig\` merges blueprint + tenant, resolving specs,
91
+ connections, and knowledge bindings.
92
+ 4. Workflow runner fetches providers via \`IntegrationCallGuard\` and
93
+ executes operations with full guardrails.
94
+
95
+ See \`packages/verticals/pocket-family-office\` for
96
+ examples of how the blueprint, tenant config, and workflows pull these
97
+ pieces together.
98
+
99
+
100
+
101
+ `}];e(t);export{t as tech_contracts_integrations_DocBlocks};
@@ -0,0 +1,138 @@
1
+ import{registerDocBlocks as e}from"../../docs/registry.js";import"../../registry.js";const t=[{id:`docs.tech.contracts.knowledge`,title:`Knowledge Layer`,summary:`The knowledge layer turns unstructured inputs (uploads, email threads,`,kind:`reference`,visibility:`public`,route:`/docs/tech/contracts/knowledge`,tags:[`tech`,`contracts`,`knowledge`],body:`# Knowledge Layer
2
+
3
+ The knowledge layer turns unstructured inputs (uploads, email threads,
4
+ notes) into searchable context for agents and workflows. The Pocket
5
+ Family Office vertical ships a minimal but production-ready stack that
6
+ covers ingestion, indexing, querying, and guardrails.
7
+
8
+ ## Knowledge Spaces
9
+
10
+ Knowledge is organised via \`KnowledgeSpaceSpec\` definitions under
11
+ \`packages/libs/contracts/src/knowledge/spaces\`:
12
+
13
+ - \`knowledge.financial-docs\` – canonical invoices, bills, and contracts.
14
+ - \`knowledge.email-threads\` – operational Gmail threads.
15
+ - \`knowledge.support-faq\` / \`knowledge.product-canon\` – reusable shared
16
+ spaces available to any vertical.
17
+
18
+ Each space defines:
19
+
20
+ - Ownership metadata (domain, owners, stability tags).
21
+ - Retention policy (TTL/archival).
22
+ - Access policy (trust level, automation write permissions).
23
+ - Indexing configuration (embedding model, chunk size, vector DB slot).
24
+
25
+ ## Sources & Bindings
26
+
27
+ - \`KnowledgeSourceConfig\` records tenant-specific connections (bucket,
28
+ Gmail labels, sync cadence). Pocket Family Office provides sample
29
+ configs in \`knowledge/sources.sample.ts\`.
30
+ - \`AppKnowledgeBinding\` associates spaces with workflows/agents and adds
31
+ per-tenant constraints (rate limits, scopes).
32
+
33
+ Validation ensures that:
34
+
35
+ - All referenced spaces exist in the registry.
36
+ - At least one source is configured per binding.
37
+ - External/ephemeral spaces trigger warnings for policy-sensitive flows.
38
+
39
+ ## Ingestion Pipeline
40
+
41
+ Implemented in \`packages/libs/contracts/src/knowledge/ingestion\`:
42
+
43
+ 1. **DocumentProcessor** – pluggable MIME extractors producing
44
+ \`DocumentFragment\`s.
45
+ 2. **EmbeddingService** – batches fragments through an \`EmbeddingProvider\`
46
+ (Mistral in the reference implementation).
47
+ 3. **VectorIndexer** – upserts fragments into a \`VectorStoreProvider\`
48
+ (Qdrant in production, with in-memory implementations for tests).
49
+ 4. **Adapters**
50
+ - \`GmailIngestionAdapter\`: list threads → convert to raw documents →
51
+ index.
52
+ - \`StorageIngestionAdapter\`: fetch object from storage provider →
53
+ index.
54
+
55
+ Background jobs (see \`jobs/\`) orchestrate ingestion via Cloud Tasks /
56
+ Pub/Sub or in-memory workers. Handlers:
57
+
58
+ - \`storage-document-handler\` – resolves storage object + indexes.
59
+ - \`gmail-sync-handler\` – syncs threads based on label/date filters.
60
+
61
+ ## Query Service
62
+
63
+ \`KnowledgeQueryService\` performs retrieval-augmented generation:
64
+
65
+ 1. Embed the user query using the configured provider.
66
+ 2. Search the vector store for top-k matches.
67
+ 3. Compose prompts combining system instructions + contextual snippets.
68
+ 4. Invoke the LLM provider (Mistral) and return the answer plus
69
+ references and token usage.
70
+
71
+ The service is designed for tooling: workflows can execute it directly
72
+ or through custom operations (see \`pfo.summary.generate\` contract).
73
+
74
+ ## Guardrails
75
+
76
+ - Automation can only write to spaces where \`automationWritable\` is true.
77
+ - Canonical spaces default to high trust; external/ephemeral spaces are
78
+ flagged during validation.
79
+ - Telemetry captures query volumes per tenant + space.
80
+
81
+ ## Extending
82
+
83
+ 1. Define a new \`KnowledgeSpaceSpec\` with indexing/retention policies.
84
+ 2. Add sources pointing to storage providers or APIs.
85
+ 3. Register adapters if ingestion requires bespoke logic.
86
+ 4. Reference the space in blueprints (\`AppKnowledgeBinding\`) and update
87
+ workflows/agents accordingly.
88
+
89
+ The Pocket Family Office tests (\`tests/pocket-family-office.test.ts\`)
90
+ show how to wire the ingestion pipeline, index a document, and run an
91
+ end-to-end knowledge query using in-memory providers.
92
+ ## Knowledge Spaces & Guardrails
93
+
94
+ Knowledge surfaces (\`KnowledgeSpaceSpec\`) describe curated corpora that agents and workflows can consult. Tenant bindings (\`AppKnowledgeBinding\`) declare which spaces are active, who can use them, and optional usage constraints.
95
+
96
+ ### Binding recap
97
+
98
+ - \`spaceKey\` / \`spaceVersion\`: pointer to the \`KnowledgeSpaceSpec\`
99
+ - \`scope.workflows\` / \`scope.agents\`: explicit allow-lists for consumers
100
+ - \`constraints.maxTokensPerQuery\` & \`constraints.maxQueriesPerMinute\`: throttling knobs for LLM-backed search
101
+ - \`required\`: mark the binding as blocking (defaults to \`true\`)
102
+
103
+ At runtime, \`ResolvedAppConfig.knowledge\` contains \`ResolvedKnowledge\` entries with the bound space, active sources, and the binding metadata above.
104
+
105
+ ### KnowledgeAccessGuard
106
+
107
+ \`KnowledgeAccessGuard\` (\`@lssm/lib.contracts/knowledge/runtime\`) centralises the access checks that must run before any workflow/agent reads or mutates a knowledge space.
108
+
109
+ \`\`\`ts
110
+ import { KnowledgeAccessGuard } from '@lssm/lib.contracts/knowledge/runtime';
111
+
112
+ const guard = new KnowledgeAccessGuard({
113
+ disallowWriteCategories: ['external', 'ephemeral'], // default
114
+ requireWorkflowBinding: true,
115
+ requireAgentBinding: false,
116
+ });
117
+
118
+ const result = guard.checkAccess(resolvedKnowledge, {
119
+ tenantId,
120
+ appId,
121
+ workflowName: 'order-processing',
122
+ operation: 'read', // or 'write' / 'search'
123
+ }, resolvedAppConfig);
124
+
125
+ if (!result.allowed) {
126
+ throw new Error(result.reason);
127
+ }
128
+ \`\`\`
129
+
130
+ Key behaviours:
131
+
132
+ - **Binding**: rejects access when the space is not present in the resolved tenant config.
133
+ - **Category guardrails**: blocks writes to \`external\` and \`ephemeral\` spaces by default; allows reads but emits warnings for \`ephemeral\`.
134
+ - **Workflow/agent scoping**: when \`requireWorkflowBinding\` or \`requireAgentBinding\` is enabled, only explicitly authorised consumers may access the space.
135
+
136
+ Use the guard inside workflow operations or agent resolvers to guarantee multi-tenant isolation and honour data governance rules.
137
+
138
+ `}];e(t);export{t as tech_contracts_knowledge_DocBlocks};
@@ -0,0 +1,109 @@
1
+ import{registerDocBlocks as e}from"../../docs/registry.js";import"../../registry.js";const t=[{id:`docs.tech.contracts.openbanking`,title:`Open Banking (Powens) Overview`,summary:`The Pocket Family Office vertical now supports read-only open banking capabilities powered by Powens. This doc summarises the contract surfaces, canonical data models, workflows, telemetry, and guardrails introduced to make Powens a first-class integration.`,kind:`reference`,visibility:`public`,route:`/docs/tech/contracts/openbanking`,tags:[`tech`,`contracts`,`openbanking`],body:`# Open Banking (Powens) Overview
2
+
3
+ The Pocket Family Office vertical now supports read-only open banking capabilities powered by Powens. This doc summarises the contract surfaces, canonical data models, workflows, telemetry, and guardrails introduced to make Powens a first-class integration.
4
+
5
+ ## Integration Spec
6
+
7
+ Powens is registered under \`openbanking.powens\` with category \`open-banking\` and currently supports the BYOK ownership mode. The spec exposes three read-only capabilities:
8
+
9
+ - \`openbanking.accounts.read\`
10
+ - \`openbanking.transactions.read\`
11
+ - \`openbanking.balances.read\`
12
+
13
+ Configuration and secrets are separated:
14
+
15
+ | Config Field | Description |
16
+ | --- | --- |
17
+ | \`environment\` | Powens environment (\`sandbox\` \\| \`production\`) |
18
+ | \`baseUrl?\` | Optional API base URL override |
19
+ | \`region?\` | Optional Powens region identifier |
20
+ | \`pollingIntervalMs?\` | Optional custom sync cadence |
21
+
22
+ | Secret Field | Description |
23
+ | --- | --- |
24
+ | \`clientId\` | Powens OAuth client identifier |
25
+ | \`clientSecret\` | Powens OAuth client secret |
26
+ | \`apiKey?\` | Optional supplemental Powens API key |
27
+ | \`webhookSecret?\` | Optional webhook signing secret |
28
+
29
+ ## Canonical Data Models
30
+
31
+ Canonical schemas live in \`@lssm/lib.contracts/integrations/openbanking/models\`:
32
+
33
+ - \`BankAccountRecord\` – account metadata (institution, IBAN/BIC, masked numbers, balances, sync timestamps)
34
+ - \`BankTransactionRecord\` – transaction ledger (amounts, categories, counterparty, status)
35
+ - \`AccountBalanceRecord\` – balance snapshots per account and balance type
36
+
37
+ These schemas power the vertical contracts and workflows, ensuring downstream features never use raw Powens payloads directly.
38
+
39
+ ## Provider Implementation
40
+
41
+ \`PowensOpenBankingProvider\` wraps \`PowensClient\` which handles OAuth token management, request retries, and error mapping. The provider maps Powens payloads to the canonical interfaces exported from \`integrations/providers/openbanking\`.
42
+
43
+ Factory support lives in \`IntegrationProviderFactory.createOpenBankingProvider\`, which validates configuration, loads BYOK secrets, and instantiates the provider.
44
+
45
+ ## Contracts
46
+
47
+ Command/query contracts exist under \`integrations/openbanking/contracts\`:
48
+
49
+ - \`openbanking.accounts.sync\` & \`openbanking.accounts.list\`
50
+ - \`openbanking.transactions.sync\` & \`openbanking.transactions.list\`
51
+ - \`openbanking.balances.refresh\` & \`openbanking.balances.get\`
52
+
53
+ The Pocket Family Office bundle also exposes \`pfo.openbanking.generate-overview\`, which aggregates balances and transactions into a derived knowledge document.
54
+
55
+ ## Workflows
56
+
57
+ New workflow specs (all requiring the \`primaryOpenBanking\` slot) orchestrate the sync flows:
58
+
59
+ - \`pfo.workflow.sync-openbanking-accounts\`
60
+ - \`pfo.workflow.sync-openbanking-transactions\`
61
+ - \`pfo.workflow.refresh-openbanking-balances\`
62
+ - \`pfo.workflow.generate-openbanking-overview\`
63
+
64
+ Each workflow runs against the Powens provider, persists canonical records, and emits telemetry.
65
+
66
+ ## Knowledge & LLM Exposure
67
+
68
+ Raw Powens payloads are never stored in knowledge spaces. Instead, \`knowledge.financial-overview\` captures derived summaries (cashflow, category breakdowns, balance trends) produced by \`pfo.openbanking.generate-overview\`. The space is \`operational\` category with 180-day retention and automation write access.
69
+
70
+ When exposing data to LLMs or analytics:
71
+
72
+ - Use derived summaries only.
73
+ - Redact PII fields using \`redactOpenBankingTelemetryPayload\`.
74
+ - Never emit IBANs, unmasked account numbers, or counterparty detail in telemetry/logs.
75
+
76
+ ## Telemetry
77
+
78
+ Telemetry constants live in \`integrations/openbanking/telemetry\`. Key events:
79
+
80
+ - \`openbanking.accounts.synced\`
81
+ - \`openbanking.transactions.synced\`
82
+ - \`openbanking.balances.refreshed\`
83
+ - \`openbanking.overview.generated\`
84
+
85
+ All events require tenant/app/blueprint/config metadata, and sensitive properties are flagged to avoid accidental leakage.
86
+
87
+ ## Guardrails
88
+
89
+ \`ensurePrimaryOpenBankingIntegration\` verifies \`primaryOpenBanking\` is bound and healthy before workflows proceed. Runtime pre-flight checks already block workflows when the connection is disconnected or in error status.
90
+
91
+ ## Blueprint & Tenant Defaults
92
+
93
+ \`pocketFamilyOfficeBlueprint\` now includes:
94
+
95
+ - \`primaryOpenBanking\` slot (required, BYOK)
96
+ - \`openbanking.*.read\` capabilities enabled by default
97
+ - Workflow bindings for the new sync flows
98
+
99
+ Sample tenant bindings (\`tenant.sample.ts\`) reference \`conn-powens-primary\` and bind the new knowledge space.
100
+
101
+ ---
102
+
103
+ Follow this doc when extending open banking support (e.g., adding payment initiation, additional providers, or expanded analytics) to keep the integration consistent and audited.
104
+
105
+
106
+
107
+
108
+
109
+ `}];e(t);export{t as tech_contracts_openbanking_DocBlocks};