@lssm/lib.contracts 0.0.0-canary-20251217063201 → 0.0.0-canary-20251217073102
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/dist/app-config/app-config.feature.js +53 -1
- package/dist/app-config/contracts.d.ts +50 -50
- package/dist/app-config/contracts.js +396 -1
- package/dist/app-config/docs/app-config.docblock.js +22 -220
- package/dist/app-config/events.d.ts +27 -27
- package/dist/app-config/events.js +168 -1
- package/dist/app-config/index.js +8 -1
- package/dist/app-config/lifecycle-contracts.d.ts +80 -80
- package/dist/app-config/lifecycle-contracts.js +441 -1
- package/dist/app-config/runtime.js +617 -1
- package/dist/app-config/spec.js +36 -1
- package/dist/app-config/validation.js +538 -1
- package/dist/capabilities/docs/capabilities.docblock.js +22 -1
- package/dist/capabilities/openbanking.js +92 -1
- package/dist/capabilities.js +50 -1
- package/dist/client/index.js +9 -1
- package/dist/client/react/drivers/rn-reusables.js +21 -1
- package/dist/client/react/drivers/shadcn.js +11 -1
- package/dist/client/react/feature-render.js +43 -1
- package/dist/client/react/form-render.js +298 -1
- package/dist/client/react/index.js +8 -1
- package/dist/contract-registry/index.js +3 -1
- package/dist/contract-registry/schemas.js +61 -1
- package/dist/contracts-adapter-hydration.js +41 -1
- package/dist/contracts-adapter-input.js +77 -1
- package/dist/data-views/docs/data-views.docblock.js +22 -1
- package/dist/data-views/query-generator.js +48 -1
- package/dist/data-views/runtime.js +39 -1
- package/dist/data-views.js +35 -1
- package/dist/docs/PUBLISHING.docblock.js +17 -76
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +17 -350
- package/dist/docs/index.js +33 -1
- package/dist/docs/meta.docs.js +15 -2
- package/dist/docs/presentations.js +77 -1
- package/dist/docs/registry.js +51 -1
- package/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +17 -383
- package/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +17 -68
- package/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +17 -140
- package/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +17 -86
- package/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +17 -1
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.js +25 -2
- package/dist/docs/tech/contracts/README.docblock.js +21 -1
- package/dist/docs/tech/contracts/create-subscription.docblock.js +21 -1
- package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.js +21 -180
- package/dist/docs/tech/contracts/migrations.docblock.js +21 -1
- package/dist/docs/tech/contracts/openapi-export.docblock.js +22 -2
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +19 -60
- package/dist/docs/tech/contracts/overlays.docblock.js +21 -68
- package/dist/docs/tech/contracts/tests.docblock.js +21 -132
- package/dist/docs/tech/contracts/themes.docblock.js +21 -1
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +21 -106
- package/dist/docs/tech/lifecycle-stage-system.docblock.js +17 -213
- package/dist/docs/tech/llm/llm-integration.docblock.js +74 -5
- package/dist/docs/tech/mcp-endpoints.docblock.js +38 -1
- package/dist/docs/tech/presentation-runtime.docblock.js +17 -1
- package/dist/docs/tech/schema/README.docblock.js +21 -262
- package/dist/docs/tech/studio/learning-events.docblock.js +49 -1
- package/dist/docs/tech/studio/learning-journeys.docblock.js +25 -2
- package/dist/docs/tech/studio/platform-admin-panel.docblock.js +24 -2
- package/dist/docs/tech/studio/project-access-teams.docblock.js +26 -16
- package/dist/docs/tech/studio/project-routing.docblock.js +68 -1
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.js +23 -2
- package/dist/docs/tech/studio/team-invitations.docblock.js +41 -36
- package/dist/docs/tech/studio/workspace-ops.docblock.js +48 -1
- package/dist/docs/tech/studio/workspaces.docblock.js +24 -2
- package/dist/docs/tech/telemetry-ingest.docblock.js +37 -3
- package/dist/docs/tech/templates/runtime.docblock.js +21 -1
- package/dist/docs/tech/vscode-extension.docblock.js +37 -3
- package/dist/docs/tech/workflows/overview.docblock.js +21 -1
- package/dist/docs/tech-contracts.docs.js +19 -2
- package/dist/events.js +12 -1
- package/dist/experiments/docs/experiments.docblock.js +22 -128
- package/dist/experiments/evaluator.js +101 -1
- package/dist/experiments/spec.js +33 -1
- package/dist/features.js +68 -1
- package/dist/forms/docs/forms.docblock.js +22 -1
- package/dist/forms.js +119 -1
- package/dist/index.js +107 -1
- package/dist/install.js +40 -1
- package/dist/integrations/contracts.d.ts +102 -102
- package/dist/integrations/contracts.js +388 -1
- package/dist/integrations/docs/integrations.docblock.js +95 -1
- package/dist/integrations/health.js +69 -1
- package/dist/integrations/index.js +23 -1
- package/dist/integrations/openbanking/contracts/accounts.d.ts +66 -66
- package/dist/integrations/openbanking/contracts/accounts.js +237 -1
- package/dist/integrations/openbanking/contracts/balances.d.ts +34 -34
- package/dist/integrations/openbanking/contracts/balances.js +167 -1
- package/dist/integrations/openbanking/contracts/index.js +12 -1
- package/dist/integrations/openbanking/contracts/transactions.d.ts +48 -48
- package/dist/integrations/openbanking/contracts/transactions.js +218 -1
- package/dist/integrations/openbanking/guards.js +32 -1
- package/dist/integrations/openbanking/models.d.ts +55 -55
- package/dist/integrations/openbanking/models.js +242 -1
- package/dist/integrations/openbanking/openbanking.feature.js +68 -1
- package/dist/integrations/openbanking/telemetry.js +39 -1
- package/dist/integrations/providers/elevenlabs.js +56 -1
- package/dist/integrations/providers/gcs-storage.js +79 -1
- package/dist/integrations/providers/gmail.js +91 -1
- package/dist/integrations/providers/google-calendar.js +70 -1
- package/dist/integrations/providers/impls/elevenlabs-voice.js +95 -1
- package/dist/integrations/providers/impls/gcs-storage.js +88 -1
- package/dist/integrations/providers/impls/gmail-inbound.js +200 -1
- package/dist/integrations/providers/impls/gmail-outbound.js +104 -5
- package/dist/integrations/providers/impls/google-calendar.js +154 -1
- package/dist/integrations/providers/impls/index.js +16 -1
- package/dist/integrations/providers/impls/mistral-embedding.js +41 -1
- package/dist/integrations/providers/impls/mistral-llm.js +247 -1
- package/dist/integrations/providers/impls/postmark-email.js +55 -1
- package/dist/integrations/providers/impls/powens-client.js +171 -1
- package/dist/integrations/providers/impls/powens-openbanking.js +218 -1
- package/dist/integrations/providers/impls/provider-factory.js +142 -1
- package/dist/integrations/providers/impls/qdrant-vector.js +69 -1
- package/dist/integrations/providers/impls/stripe-payments.js +202 -1
- package/dist/integrations/providers/impls/twilio-sms.js +58 -1
- package/dist/integrations/providers/index.js +13 -1
- package/dist/integrations/providers/mistral.js +72 -1
- package/dist/integrations/providers/postmark.js +72 -1
- package/dist/integrations/providers/powens.js +120 -1
- package/dist/integrations/providers/qdrant.js +77 -1
- package/dist/integrations/providers/registry.js +34 -1
- package/dist/integrations/providers/stripe.js +87 -1
- package/dist/integrations/providers/twilio-sms.js +65 -1
- package/dist/integrations/runtime.js +186 -1
- package/dist/integrations/secrets/aws-secret-manager.js +231 -1
- package/dist/integrations/secrets/env-secret-provider.js +81 -1
- package/dist/integrations/secrets/gcp-secret-manager.js +229 -1
- package/dist/integrations/secrets/index.js +8 -1
- package/dist/integrations/secrets/manager.js +103 -1
- package/dist/integrations/secrets/provider.js +58 -1
- package/dist/integrations/secrets/scaleway-secret-manager.js +247 -1
- package/dist/integrations/spec.js +39 -1
- package/dist/jobs/define-job.js +16 -1
- package/dist/jobs/gcp-cloud-tasks.js +53 -1
- package/dist/jobs/gcp-pubsub.js +39 -1
- package/dist/jobs/handlers/gmail-sync-handler.js +9 -1
- package/dist/jobs/handlers/index.js +12 -1
- package/dist/jobs/handlers/ping-handler.js +15 -1
- package/dist/jobs/handlers/storage-document-handler.js +14 -1
- package/dist/jobs/index.js +4 -1
- package/dist/jobs/memory-queue.js +71 -1
- package/dist/jobs/queue.js +33 -1
- package/dist/jobs/scaleway-sqs-queue.js +153 -1
- package/dist/jsonschema.d.ts +3 -3
- package/dist/jsonschema.js +32 -1
- package/dist/knowledge/contracts.d.ts +66 -66
- package/dist/knowledge/contracts.js +317 -1
- package/dist/knowledge/docs/knowledge.docblock.js +22 -138
- package/dist/knowledge/index.js +10 -1
- package/dist/knowledge/ingestion/document-processor.js +54 -1
- package/dist/knowledge/ingestion/embedding-service.js +25 -1
- package/dist/knowledge/ingestion/gmail-adapter.js +50 -5
- package/dist/knowledge/ingestion/index.js +7 -1
- package/dist/knowledge/ingestion/storage-adapter.js +26 -1
- package/dist/knowledge/ingestion/vector-indexer.js +32 -1
- package/dist/knowledge/query/index.js +3 -1
- package/dist/knowledge/query/service.js +64 -2
- package/dist/knowledge/runtime.js +49 -1
- package/dist/knowledge/spaces/email-threads.js +38 -1
- package/dist/knowledge/spaces/financial-docs.js +38 -1
- package/dist/knowledge/spaces/financial-overview.js +42 -1
- package/dist/knowledge/spaces/index.js +8 -1
- package/dist/knowledge/spaces/product-canon.js +38 -1
- package/dist/knowledge/spaces/support-faq.js +41 -1
- package/dist/knowledge/spaces/uploaded-docs.js +38 -1
- package/dist/knowledge/spec.js +39 -1
- package/dist/llm/exporters.js +541 -8
- package/dist/llm/index.js +4 -1
- package/dist/llm/prompts.js +246 -56
- package/dist/markdown.js +116 -3
- package/dist/migrations.js +33 -1
- package/dist/onboarding-base.d.ts +29 -29
- package/dist/onboarding-base.js +196 -1
- package/dist/openapi.js +75 -1
- package/dist/openbanking/docs/openbanking.docblock.js +22 -109
- package/dist/ownership.js +40 -1
- package/dist/policy/docs/policy.docblock.js +22 -1
- package/dist/policy/engine.js +223 -1
- package/dist/policy/opa-adapter.js +71 -1
- package/dist/policy/spec.js +33 -1
- package/dist/presentations/docs/presentations-conventions.docblock.js +21 -7
- package/dist/presentations.backcompat.js +47 -1
- package/dist/presentations.d.ts +3 -3
- package/dist/presentations.js +66 -1
- package/dist/presentations.v2.js +278 -6
- package/dist/prompt.js +10 -1
- package/dist/promptRegistry.js +34 -1
- package/dist/regenerator/docs/regenerator.docblock.js +22 -184
- package/dist/regenerator/executor.js +86 -1
- package/dist/regenerator/index.js +6 -1
- package/dist/regenerator/service.js +92 -1
- package/dist/regenerator/sinks.js +32 -1
- package/dist/regenerator/utils.js +51 -1
- package/dist/registry.js +208 -1
- package/dist/resources.js +47 -1
- package/dist/schema/dist/EnumType.js +2 -1
- package/dist/schema/dist/FieldType.js +49 -1
- package/dist/schema/dist/ScalarTypeEnum.js +236 -1
- package/dist/schema/dist/SchemaModel.js +39 -1
- package/dist/schema/dist/entity/defineEntity.js +1 -1
- package/dist/schema/dist/entity/index.js +2 -1
- package/dist/schema/dist/entity/types.js +1 -1
- package/dist/schema/dist/index.js +6 -1
- package/dist/schema-to-markdown.js +214 -10
- package/dist/server/graphql-pothos.js +128 -1
- package/dist/server/index.js +10 -1
- package/dist/server/mcp/createMcpServer.js +28 -1
- package/dist/server/mcp/registerPresentations.js +151 -1
- package/dist/server/mcp/registerPrompts.js +36 -2
- package/dist/server/mcp/registerResources.js +35 -1
- package/dist/server/mcp/registerTools.js +22 -1
- package/dist/server/provider-mcp.js +3 -1
- package/dist/server/rest-elysia.js +20 -1
- package/dist/server/rest-express.js +39 -1
- package/dist/server/rest-generic.js +125 -1
- package/dist/server/rest-next-app.js +38 -1
- package/dist/server/rest-next-mcp.js +45 -1
- package/dist/server/rest-next-pages.js +25 -1
- package/dist/spec.js +35 -1
- package/dist/telemetry/anomaly.js +48 -1
- package/dist/telemetry/docs/telemetry.docblock.js +22 -139
- package/dist/telemetry/index.js +5 -1
- package/dist/telemetry/spec.js +69 -1
- package/dist/telemetry/tracker.js +76 -1
- package/dist/tests/index.js +4 -1
- package/dist/tests/runner.js +150 -1
- package/dist/tests/spec.js +33 -1
- package/dist/themes.js +39 -1
- package/dist/workflow/adapters/db-adapter.js +83 -1
- package/dist/workflow/adapters/file-adapter.js +11 -1
- package/dist/workflow/adapters/index.js +5 -1
- package/dist/workflow/adapters/memory-store.js +58 -1
- package/dist/workflow/expression.js +98 -1
- package/dist/workflow/index.js +9 -1
- package/dist/workflow/runner.js +337 -1
- package/dist/workflow/sla-monitor.js +47 -1
- package/dist/workflow/spec.js +32 -1
- package/dist/workflow/validation.js +175 -1
- package/package.json +11 -4
|
@@ -1,62 +1,21 @@
|
|
|
1
|
-
import{registerDocBlocks
|
|
1
|
+
import { registerDocBlocks } from "../../registry.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
//#region src/docs/tech/contracts/ops-to-presentation-linking.docblock.ts
|
|
4
|
+
const tech_contracts_ops_to_presentation_linking_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.contracts.ops-to-presentation-linking",
|
|
6
|
+
title: "Ops ↔ Presentation linking (V2)",
|
|
7
|
+
summary: "This document explains how operations (ContractSpec) are linked to Presentations (PresentationDescriptorV2) via Feature modules.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/contracts/ops-to-presentation-linking",
|
|
11
|
+
tags: [
|
|
12
|
+
"tech",
|
|
13
|
+
"contracts",
|
|
14
|
+
"ops-to-presentation-linking"
|
|
15
|
+
],
|
|
16
|
+
body: "### Ops ↔ Presentation linking (V2)\n\nThis document explains how operations (ContractSpec) are linked to Presentations (PresentationDescriptorV2) via Feature modules.\n\n- Location: `@lssm/lib.contracts/src/features.ts`\n- Field: `FeatureModuleSpec.opToPresentation?: { op: { name; version }; pres: { name; version } }[]`\n- Validation: `installFeature()` validates that linked ops exist in `SpecRegistry` and linked presentations exist in the registry, and that declared targets are present.\n\nExample:\n\n```ts\nimport type { SpecRegistry } from '@lssm/lib.contracts/src/registry';\nimport { FeatureRegistry, createFeatureModule } from '@lssm/lib.contracts';\n\nexport function buildFeaturesWithOps(ops: SpecRegistry) {\n const features = new FeatureRegistry();\n features.register(\n createFeatureModule(\n {\n key: 'myapp.widgets.linkage',\n title: 'Widgets (linked)',\n description: 'Links create/update ops to UI presentations',\n domain: 'widgets',\n tags: ['widgets', 'linkage'],\n stability: 'beta',\n },\n {\n operations: [\n { name: 'widgets.create', version: 1 },\n { name: 'widgets.update', version: 1 },\n ],\n presentations: [{ name: 'myapp.widgets.editor.page', version: 1 }],\n opToPresentation: [\n {\n op: { name: 'widgets.create', version: 1 },\n pres: { name: 'myapp.widgets.editor.page', version: 1 },\n },\n {\n op: { name: 'widgets.update', version: 1 },\n pres: { name: 'myapp.widgets.editor.page', version: 1 },\n },\n ],\n presentationsTargets: [\n {\n name: 'myapp.widgets.editor.page',\n version: 1,\n targets: ['react', 'markdown'],\n },\n ],\n }\n )\n );\n return { features };\n}\n```\n\nNotes\n\n- This enables traceability: the UI flow that realizes an op is discoverable via the feature catalog.\n- Presentations can target multiple outputs (`react`, `markdown`, `application/json`, `application/xml`).\n- Use `renderFeaturePresentation()` to render a descriptor to a given target with a component map.\n"
|
|
17
|
+
}];
|
|
18
|
+
registerDocBlocks(tech_contracts_ops_to_presentation_linking_DocBlocks);
|
|
4
19
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- Validation: \`installFeature()\` validates that linked ops exist in \`SpecRegistry\` and linked presentations exist in the registry, and that declared targets are present.
|
|
8
|
-
|
|
9
|
-
Example:
|
|
10
|
-
|
|
11
|
-
\`\`\`ts
|
|
12
|
-
import type { SpecRegistry } from '@lssm/lib.contracts/src/registry';
|
|
13
|
-
import { FeatureRegistry, createFeatureModule } from '@lssm/lib.contracts';
|
|
14
|
-
|
|
15
|
-
export function buildFeaturesWithOps(ops: SpecRegistry) {
|
|
16
|
-
const features = new FeatureRegistry();
|
|
17
|
-
features.register(
|
|
18
|
-
createFeatureModule(
|
|
19
|
-
{
|
|
20
|
-
key: 'myapp.widgets.linkage',
|
|
21
|
-
title: 'Widgets (linked)',
|
|
22
|
-
description: 'Links create/update ops to UI presentations',
|
|
23
|
-
domain: 'widgets',
|
|
24
|
-
tags: ['widgets', 'linkage'],
|
|
25
|
-
stability: 'beta',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
operations: [
|
|
29
|
-
{ name: 'widgets.create', version: 1 },
|
|
30
|
-
{ name: 'widgets.update', version: 1 },
|
|
31
|
-
],
|
|
32
|
-
presentations: [{ name: 'myapp.widgets.editor.page', version: 1 }],
|
|
33
|
-
opToPresentation: [
|
|
34
|
-
{
|
|
35
|
-
op: { name: 'widgets.create', version: 1 },
|
|
36
|
-
pres: { name: 'myapp.widgets.editor.page', version: 1 },
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
op: { name: 'widgets.update', version: 1 },
|
|
40
|
-
pres: { name: 'myapp.widgets.editor.page', version: 1 },
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
presentationsTargets: [
|
|
44
|
-
{
|
|
45
|
-
name: 'myapp.widgets.editor.page',
|
|
46
|
-
version: 1,
|
|
47
|
-
targets: ['react', 'markdown'],
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
}
|
|
51
|
-
)
|
|
52
|
-
);
|
|
53
|
-
return { features };
|
|
54
|
-
}
|
|
55
|
-
\`\`\`
|
|
56
|
-
|
|
57
|
-
Notes
|
|
58
|
-
|
|
59
|
-
- This enables traceability: the UI flow that realizes an op is discoverable via the feature catalog.
|
|
60
|
-
- Presentations can target multiple outputs (\`react\`, \`markdown\`, \`application/json\`, \`application/xml\`).
|
|
61
|
-
- Use \`renderFeaturePresentation()\` to render a descriptor to a given target with a component map.
|
|
62
|
-
`}];e(t);export{t as tech_contracts_ops_to_presentation_linking_DocBlocks};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { tech_contracts_ops_to_presentation_linking_DocBlocks };
|
|
@@ -1,68 +1,21 @@
|
|
|
1
|
-
import{registerDocBlocks
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
tenantId?: string
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
\`\`\`
|
|
24
|
-
|
|
25
|
-
Supported modifications:
|
|
26
|
-
|
|
27
|
-
- \`hideField\`
|
|
28
|
-
- \`renameLabel\`
|
|
29
|
-
- \`reorderFields\`
|
|
30
|
-
- \`setDefault\`
|
|
31
|
-
- \`addHelpText\`
|
|
32
|
-
- \`makeRequired\`
|
|
33
|
-
|
|
34
|
-
## Signing
|
|
35
|
-
|
|
36
|
-
Overlays must be signed. Use the signer helper:
|
|
37
|
-
|
|
38
|
-
\`\`\`ts
|
|
39
|
-
import { signOverlay } from '@lssm/lib.overlay-engine/signer';
|
|
40
|
-
|
|
41
|
-
const signed = await signOverlay(overlay, privateKeyPem);
|
|
42
|
-
registry.register(signed);
|
|
43
|
-
\`\`\`
|
|
44
|
-
|
|
45
|
-
Keys are stored in \`OverlaySigningKey\` (Prisma) and referenced by the \`Overlay\` model for auditing.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
`}];e(t);export{t as tech_contracts_overlays_DocBlocks};
|
|
1
|
+
import { registerDocBlocks } from "../../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/tech/contracts/overlays.docblock.ts
|
|
4
|
+
const tech_contracts_overlays_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.contracts.overlays",
|
|
6
|
+
title: "OverlaySpec Implementation",
|
|
7
|
+
summary: "OverlaySpecs allow tenants/users to adapt presentation without duplicating code. Implementation lives in `@lssm/lib.overlay-engine`.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/contracts/overlays",
|
|
11
|
+
tags: [
|
|
12
|
+
"tech",
|
|
13
|
+
"contracts",
|
|
14
|
+
"overlays"
|
|
15
|
+
],
|
|
16
|
+
body: "# OverlaySpec Implementation\n\nOverlaySpecs allow tenants/users to adapt presentation without duplicating code. Implementation lives in `@lssm/lib.overlay-engine`.\n\n## Structure\n\n```ts\ninterface OverlaySpec {\n overlayId: string;\n version: string;\n appliesTo: {\n capability?: string;\n workflow?: string;\n dataView?: string;\n presentation?: string;\n tenantId?: string;\n userId?: string;\n role?: string;\n device?: string;\n };\n modifications: OverlayModification[];\n}\n```\n\nSupported modifications:\n\n- `hideField`\n- `renameLabel`\n- `reorderFields`\n- `setDefault`\n- `addHelpText`\n- `makeRequired`\n\n## Signing\n\nOverlays must be signed. Use the signer helper:\n\n```ts\nimport { signOverlay } from '@lssm/lib.overlay-engine/signer';\n\nconst signed = await signOverlay(overlay, privateKeyPem);\nregistry.register(signed);\n```\n\nKeys are stored in `OverlaySigningKey` (Prisma) and referenced by the `Overlay` model for auditing.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
|
17
|
+
}];
|
|
18
|
+
registerDocBlocks(tech_contracts_overlays_DocBlocks);
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { tech_contracts_overlays_DocBlocks };
|
|
@@ -1,132 +1,21 @@
|
|
|
1
|
-
import{registerDocBlocks
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
scenarios: TestScenario[]
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- \`Action\`: operation input that the scenario exercises
|
|
23
|
-
- \`Assertion\`:
|
|
24
|
-
- \`expectOutput\` \`{ match }\` deep-equals the handler output
|
|
25
|
-
- \`expectError\` \`{ messageIncludes? }\` ensures an error was thrown
|
|
26
|
-
- \`expectEvents\` \`{ events: [{ name, version, min?, max? }] }\` checks emitted events
|
|
27
|
-
|
|
28
|
-
### Example
|
|
29
|
-
|
|
30
|
-
\`\`\`ts
|
|
31
|
-
import { defineCommand, type TestSpec } from '@lssm/lib.contracts';
|
|
32
|
-
|
|
33
|
-
export const AddNumbersSpec = defineCommand({
|
|
34
|
-
meta: { name: 'math.add', version: 1, /* … */ },
|
|
35
|
-
io: {
|
|
36
|
-
input: AddNumbersInput,
|
|
37
|
-
output: AddNumbersOutput,
|
|
38
|
-
},
|
|
39
|
-
policy: { auth: 'user' },
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
export const MathAddTests: TestSpec = {
|
|
43
|
-
meta: {
|
|
44
|
-
name: 'math.add.tests',
|
|
45
|
-
version: 1,
|
|
46
|
-
title: 'Math add scenarios',
|
|
47
|
-
owners: ['@team.math'],
|
|
48
|
-
tags: ['math'],
|
|
49
|
-
stability: StabilityEnum.Experimental,
|
|
50
|
-
},
|
|
51
|
-
target: { type: 'contract', operation: { name: 'math.add' } },
|
|
52
|
-
scenarios: [
|
|
53
|
-
{
|
|
54
|
-
name: 'adds positive numbers',
|
|
55
|
-
when: {
|
|
56
|
-
operation: { name: 'math.add' },
|
|
57
|
-
input: { a: 2, b: 3 },
|
|
58
|
-
},
|
|
59
|
-
then: [
|
|
60
|
-
{ type: 'expectOutput', match: { sum: 5 } },
|
|
61
|
-
{
|
|
62
|
-
type: 'expectEvents',
|
|
63
|
-
events: [{ name: 'math.sum_calculated', version: 1, min: 1 }],
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
};
|
|
69
|
-
\`\`\`
|
|
70
|
-
|
|
71
|
-
### Running tests
|
|
72
|
-
|
|
73
|
-
1. Register the contract handlers in a \`SpecRegistry\`:
|
|
74
|
-
|
|
75
|
-
\`\`\`ts
|
|
76
|
-
export function createRegistry() {
|
|
77
|
-
const registry = new SpecRegistry();
|
|
78
|
-
registry.register(AddNumbersSpec);
|
|
79
|
-
registry.bind(AddNumbersSpec, addNumbersHandler);
|
|
80
|
-
return registry;
|
|
81
|
-
}
|
|
82
|
-
\`\`\`
|
|
83
|
-
|
|
84
|
-
2. Run the CLI:
|
|
85
|
-
|
|
86
|
-
\`\`\`
|
|
87
|
-
contractspec test apps/math/tests/math.add.tests.ts \\
|
|
88
|
-
--registry apps/math/tests/registry.ts
|
|
89
|
-
\`\`\`
|
|
90
|
-
|
|
91
|
-
- The CLI loads the TestSpec, instantiates the registry (via the provided module), and executes each scenario via \`TestRunner\`.
|
|
92
|
-
- \`--json\` outputs machine-readable results.
|
|
93
|
-
|
|
94
|
-
### Programmatic usage
|
|
95
|
-
|
|
96
|
-
\`\`\`ts
|
|
97
|
-
const runner = new TestRunner({
|
|
98
|
-
registry,
|
|
99
|
-
createContext: () => ({ actor: 'user', organizationId: 'tenant-1' }),
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
const result = await runner.run(MathAddTests);
|
|
103
|
-
console.log(result.passed, result.failed);
|
|
104
|
-
\`\`\`
|
|
105
|
-
|
|
106
|
-
- \`createContext\` can supply default \`HandlerCtx\` values.
|
|
107
|
-
- \`beforeEach\` / \`afterEach\` hooks let you seed databases or reset state.
|
|
108
|
-
|
|
109
|
-
### Best practices
|
|
110
|
-
|
|
111
|
-
- Keep fixtures idempotent so scenarios can run in parallel in the future.
|
|
112
|
-
- Use \`expectEvents\` to guard analytics/telemetry expectations.
|
|
113
|
-
- Add specs to \`TestRegistry\` for discovery and documentation.
|
|
114
|
-
- \`coverage\` captures desired coverage metrics (enforced by future tooling).
|
|
115
|
-
- Pair TestSpec files with CI using \`contractspec test --json\` and fail builds when \`failed > 0\`.
|
|
116
|
-
|
|
117
|
-
### Mocking with Bun's \`vi\`
|
|
118
|
-
|
|
119
|
-
- Pass a single function type to \`vi.fn<TFunction>()\` so calls retain typed arguments:
|
|
120
|
-
|
|
121
|
-
\`\`\`ts
|
|
122
|
-
const handler = vi.fn<typeof fetch>();
|
|
123
|
-
const fetchImpl: typeof fetch = ((...args) => handler(...args)) as typeof fetch;
|
|
124
|
-
Object.defineProperty(fetchImpl, 'preconnect', {
|
|
125
|
-
value: vi.fn<typeof fetch.preconnect>(),
|
|
126
|
-
});
|
|
127
|
-
\`\`\`
|
|
128
|
-
|
|
129
|
-
- When you need to inspect calls, use the typed mock (\`handler.mock.calls\`) rather than casting to \`any\`.
|
|
130
|
-
- Narrow optional request data defensively (e.g., check for headers before reading them) so tests remain type-safe under strict \`tsconfig\` settings.
|
|
131
|
-
|
|
132
|
-
`}];e(t);export{t as tech_contracts_tests_DocBlocks};
|
|
1
|
+
import { registerDocBlocks } from "../../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/tech/contracts/tests.docblock.ts
|
|
4
|
+
const tech_contracts_tests_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.contracts.tests",
|
|
6
|
+
title: "TestSpec & TestRunner",
|
|
7
|
+
summary: "Use `TestSpec` to describe end-to-end scenarios for contracts and workflows. Specs live alongside your contracts and exercise the same SpecRegistry handlers the app uses.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/contracts/tests",
|
|
11
|
+
tags: [
|
|
12
|
+
"tech",
|
|
13
|
+
"contracts",
|
|
14
|
+
"tests"
|
|
15
|
+
],
|
|
16
|
+
body: "## TestSpec & TestRunner\n\nUse `TestSpec` to describe end-to-end scenarios for contracts and workflows. Specs live alongside your contracts and exercise the same SpecRegistry handlers the app uses.\n\n- Types & registry: `packages/libs/contracts/src/tests/spec.ts`\n- Runtime runner: `packages/libs/contracts/src/tests/runner.ts`\n- CLI: `contractspec test`\n\n### Structure\n\n```ts\nexport interface TestSpec {\n meta: TestSpecMeta;\n target: TestTarget; // contract or workflow\n fixtures?: Fixture[]; // optional shared setup before each scenario\n scenarios: TestScenario[];\n coverage?: CoverageRequirement;\n}\n```\n\n- `Fixture`: run an operation before the scenario (`operation`, optional `input`)\n- `Action`: operation input that the scenario exercises\n- `Assertion`:\n - `expectOutput` `{ match }` deep-equals the handler output\n - `expectError` `{ messageIncludes? }` ensures an error was thrown\n - `expectEvents` `{ events: [{ name, version, min?, max? }] }` checks emitted events\n\n### Example\n\n```ts\nimport { defineCommand, type TestSpec } from '@lssm/lib.contracts';\n\nexport const AddNumbersSpec = defineCommand({\n meta: { name: 'math.add', version: 1, /* … */ },\n io: {\n input: AddNumbersInput,\n output: AddNumbersOutput,\n },\n policy: { auth: 'user' },\n});\n\nexport const MathAddTests: TestSpec = {\n meta: {\n name: 'math.add.tests',\n version: 1,\n title: 'Math add scenarios',\n owners: ['@team.math'],\n tags: ['math'],\n stability: StabilityEnum.Experimental,\n },\n target: { type: 'contract', operation: { name: 'math.add' } },\n scenarios: [\n {\n name: 'adds positive numbers',\n when: {\n operation: { name: 'math.add' },\n input: { a: 2, b: 3 },\n },\n then: [\n { type: 'expectOutput', match: { sum: 5 } },\n {\n type: 'expectEvents',\n events: [{ name: 'math.sum_calculated', version: 1, min: 1 }],\n },\n ],\n },\n ],\n};\n```\n\n### Running tests\n\n1. Register the contract handlers in a `SpecRegistry`:\n\n```ts\nexport function createRegistry() {\n const registry = new SpecRegistry();\n registry.register(AddNumbersSpec);\n registry.bind(AddNumbersSpec, addNumbersHandler);\n return registry;\n}\n```\n\n2. Run the CLI:\n\n```\ncontractspec test apps/math/tests/math.add.tests.ts \\\n --registry apps/math/tests/registry.ts\n```\n\n- The CLI loads the TestSpec, instantiates the registry (via the provided module), and executes each scenario via `TestRunner`.\n- `--json` outputs machine-readable results.\n\n### Programmatic usage\n\n```ts\nconst runner = new TestRunner({\n registry,\n createContext: () => ({ actor: 'user', organizationId: 'tenant-1' }),\n});\n\nconst result = await runner.run(MathAddTests);\nconsole.log(result.passed, result.failed);\n```\n\n- `createContext` can supply default `HandlerCtx` values.\n- `beforeEach` / `afterEach` hooks let you seed databases or reset state.\n\n### Best practices\n\n- Keep fixtures idempotent so scenarios can run in parallel in the future.\n- Use `expectEvents` to guard analytics/telemetry expectations.\n- Add specs to `TestRegistry` for discovery and documentation.\n- `coverage` captures desired coverage metrics (enforced by future tooling).\n- Pair TestSpec files with CI using `contractspec test --json` and fail builds when `failed > 0`.\n\n### Mocking with Bun's `vi`\n\n- Pass a single function type to `vi.fn<TFunction>()` so calls retain typed arguments:\n\n```ts\nconst handler = vi.fn<typeof fetch>();\nconst fetchImpl: typeof fetch = ((...args) => handler(...args)) as typeof fetch;\nObject.defineProperty(fetchImpl, 'preconnect', {\n value: vi.fn<typeof fetch.preconnect>(),\n});\n```\n\n- When you need to inspect calls, use the typed mock (`handler.mock.calls`) rather than casting to `any`.\n- Narrow optional request data defensively (e.g., check for headers before reading them) so tests remain type-safe under strict `tsconfig` settings.\n\n"
|
|
17
|
+
}];
|
|
18
|
+
registerDocBlocks(tech_contracts_tests_DocBlocks);
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { tech_contracts_tests_DocBlocks };
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
import{registerDocBlocks
|
|
1
|
+
import { registerDocBlocks } from "../../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/tech/contracts/themes.docblock.ts
|
|
4
|
+
const tech_contracts_themes_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.contracts.themes",
|
|
6
|
+
title: "ThemeSpec Overview",
|
|
7
|
+
summary: "`ThemeSpec` defines a structured, versioned source of truth for design tokens, component variants, and scoped overrides. Use it to describe how tenants or individual users should experience the design system without hand-maintaining ad-hoc theme files. Specs live in `@lssm/lib.contracts`, making them accessible to generators, docs, and runtime tooling.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/contracts/themes",
|
|
11
|
+
tags: [
|
|
12
|
+
"tech",
|
|
13
|
+
"contracts",
|
|
14
|
+
"themes"
|
|
15
|
+
],
|
|
16
|
+
body: "# ThemeSpec Overview\n\n## Purpose\n\n`ThemeSpec` defines a structured, versioned source of truth for design tokens, component variants, and scoped overrides. Use it to describe how tenants or individual users should experience the design system without hand-maintaining ad-hoc theme files. Specs live in `@lssm/lib.contracts`, making them accessible to generators, docs, and runtime tooling.\n\n## Location\n\n- Types & registry: `packages/libs/contracts/src/themes.ts`\n- Design tokens bridge: `packages/libs/design-system/src/theme/*`\n\n## Schema\n\n```ts\nexport interface ThemeSpec {\n meta: ThemeMeta; // ownership metadata + { name, version, extends?, scopes? }\n tokens: ThemeTokens; // design tokens grouped by colors, radii, space, etc.\n components?: ComponentVariantSpec[]; // per-component variant configuration\n overrides?: ThemeOverride[]; // scoped tenant/user overrides\n}\n```\n\n- **ThemeMeta**\n - `name`: fully-qualified identifier (e.g., `design.pastel`)\n - `version`: increment when tokens/variants change in a breaking way\n - `extends?`: optional `{ name, version }` pointer to a base theme\n - `scopes?`: default scopes where the theme applies (`global`, `tenant`, `user`)\n- **ThemeTokens**\n - `colors`, `radii`, `space`, `typography`, `shadows`, `motion`\n - Each entry is a map of `{ value: T; description?: string }`\n- **ComponentVariantSpec**\n - `component`: design-system component key (e.g., `Button`, `NavMain`)\n - `variants`: map of variant names → `{ props?, tokens? }`\n- **ThemeOverride**\n - `scope`: `'global' | 'tenant' | 'user'`\n - `target`: identifier (e.g., `tenant:artisanos`, `user:123`)\n - `tokens?` / `components?`: partial token/variant overrides for the target\n\n## Registry Usage\n\n```ts\nimport { ThemeRegistry } from '@lssm/lib.contracts/themes';\nimport { PastelTheme } from './themes/design.pastel';\n\nconst themes = new ThemeRegistry();\nthemes.register(PastelTheme);\n\nconst theme = themes.get('design.pastel');\nconst tenantVariant = themes\n .get('design.pastel')\n ?.overrides?.find((o) => o.target === 'tenant:artisanos');\n```\n\nThe registry guarantees `name + version` uniqueness and exposes `list()` for discovery tooling.\n\n## Rendering\n\nThe design system consumes specs (via adapters you provide) to build runtime tokens. A simple adapter might:\n\n1. Resolve the base theme + applicable overrides.\n2. Merge token maps using `ThemeTokens`.\n3. Feed the result into `mapTokensForPlatform` in `@lssm/lib.design-system`.\n\n```ts\nimport { ThemeRegistry } from '@lssm/lib.contracts/themes';\nimport { mapTokensForPlatform } from '@lssm/lib.design-system';\n\nfunction resolveTokens(registry: ThemeRegistry, ref: ThemeRef, ctx: { tenant?: string; user?: string }) {\n const spec = registry.get(ref.name, ref.version);\n if (!spec) throw new Error('Theme not found');\n\n const tokens = deepMerge(spec.tokens, collectOverrides(spec.overrides, ctx));\n return mapTokensForPlatform(tokens);\n}\n```\n\n## Authoring Guidelines\n\n1. Keep token names aligned with the design-system defaults (`background`, `mutedForeground`, etc.).\n2. Use `extends` to create layered themes (base brand → tenant tweaks → user-level overrides).\n3. Document variants with `description` to help designers and automation understand intent.\n4. Prefer scoped overrides (`tenant:foo`) instead of duplicating the entire theme per tenant.\n5. When tokens influence multiple components, capture them in `tokens` and keep `components` for API-level variant wiring.\n\n## CLI (Future Work)\n\nThe `contractspec` CLI does not yet scaffold theme specs. Planned additions:\n\n- `contractspec create --type theme`\n- `contractspec build <theme.theme.ts>` → generate design-system adapters\n\nFor now, author specs manually and register them alongside contract bundles.\n\n"
|
|
17
|
+
}];
|
|
18
|
+
registerDocBlocks(tech_contracts_themes_DocBlocks);
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { tech_contracts_themes_DocBlocks };
|
|
@@ -1,106 +1,21 @@
|
|
|
1
|
-
import{registerDocBlocks
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## Blueprint Overview
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- \`primaryVectorDb\` → Qdrant
|
|
23
|
-
- \`primaryStorage\` → Google Cloud Storage
|
|
24
|
-
- \`primaryOpenBanking\` → Powens BYOK project for account aggregation
|
|
25
|
-
- \`emailInbound\` / \`emailOutbound\` → Gmail + Postmark
|
|
26
|
-
- \`calendarScheduling\` → Google Calendar
|
|
27
|
-
- \`voicePlayback\` → ElevenLabs (optional)
|
|
28
|
-
- \`smsNotifications\` → Twilio (optional)
|
|
29
|
-
- \`paymentsProcessing\` → Stripe (optional)
|
|
30
|
-
- **Workflows**
|
|
31
|
-
- \`process-uploaded-document\`
|
|
32
|
-
- \`upcoming-payments-reminder\`
|
|
33
|
-
- \`generate-financial-summary\`
|
|
34
|
-
- \`ingest-email-threads\`
|
|
35
|
-
- \`sync-openbanking-accounts\`
|
|
36
|
-
- \`sync-openbanking-transactions\`
|
|
37
|
-
- \`refresh-openbanking-balances\`
|
|
38
|
-
- \`generate-openbanking-overview\`
|
|
39
|
-
- **Policies/Telemetry** – references tenant policy specs and
|
|
40
|
-
\`pfo.telemetry\` for observability.
|
|
41
|
-
|
|
42
|
-
## Tenant Sample
|
|
43
|
-
|
|
44
|
-
\`tenant.sample.ts\` binds each slot to sample connections defined in
|
|
45
|
-
\`connections/samples.ts\`. Key details:
|
|
46
|
-
|
|
47
|
-
- Uses Google Cloud Secret Manager URIs for all credentials.
|
|
48
|
-
- Enables knowledge spaces \`knowledge.financial-docs\` and
|
|
49
|
-
\`knowledge.email-threads\`, plus the derived summaries space
|
|
50
|
-
\`knowledge.financial-overview\` populated by open banking workflows.
|
|
51
|
-
- Keeps \`voicePlayback\` and \`paymentsProcessing\` optional so tenants can
|
|
52
|
-
enable them incrementally.
|
|
53
|
-
|
|
54
|
-
## Contracts
|
|
55
|
-
|
|
56
|
-
\`contracts/index.ts\` defines command/query specs that power the
|
|
57
|
-
workflows:
|
|
58
|
-
|
|
59
|
-
- \`pfo.documents.upload\` – store object + enqueue ingestion.
|
|
60
|
-
- \`pfo.reminders.schedule-payment\` – send email/SMS/calendar reminders.
|
|
61
|
-
- \`pfo.summary.generate\` – run RAG over knowledge spaces.
|
|
62
|
-
- \`pfo.summary.dispatch\` – deliver summaries via email / voice.
|
|
63
|
-
- \`pfo.email.sync-threads\` – ingest Gmail threads.
|
|
64
|
-
|
|
65
|
-
## Workflows
|
|
66
|
-
|
|
67
|
-
- **Process Uploaded Document**
|
|
68
|
-
1. Upload to storage / queue ingestion.
|
|
69
|
-
2. Optional human review step.
|
|
70
|
-
- **Upcoming Payments Reminder**
|
|
71
|
-
1. Human review (confirm due date / channel).
|
|
72
|
-
2. Automation schedules reminders (email/SMS/calendar).
|
|
73
|
-
- **Generate Financial Summary**
|
|
74
|
-
1. Run RAG to produce Markdown summary.
|
|
75
|
-
2. Dispatch summary (email + optional ElevenLabs voice note).
|
|
76
|
-
- **Ingest Email Threads**
|
|
77
|
-
1. Sync Gmail threads into knowledge space.
|
|
78
|
-
2. Triage step for operators when nothing new is ingested.
|
|
79
|
-
|
|
80
|
-
## Knowledge & Jobs
|
|
81
|
-
|
|
82
|
-
- Knowledge spaces registered via
|
|
83
|
-
\`registerFinancialDocsKnowledgeSpace\` and
|
|
84
|
-
\`registerEmailThreadsKnowledgeSpace\`.
|
|
85
|
-
- Ingestion adapters (\`GmailIngestionAdapter\`, \`StorageIngestionAdapter\`)
|
|
86
|
-
and job handlers (\`createGmailSyncHandler\`,
|
|
87
|
-
\`createStorageDocumentHandler\`) wire Gmail labels & GCS prefixes into
|
|
88
|
-
Qdrant.
|
|
89
|
-
- \`KnowledgeQueryService\` provides summarisation + references for the
|
|
90
|
-
summary generation workflow.
|
|
91
|
-
|
|
92
|
-
## Tests & Usage
|
|
93
|
-
|
|
94
|
-
\`tests/pocket-family-office.test.ts\` exercises:
|
|
95
|
-
|
|
96
|
-
- Blueprint validation + config composition.
|
|
97
|
-
- In-memory ingestion of a sample invoice.
|
|
98
|
-
- Retrieval augmented generation producing a summary with references.
|
|
99
|
-
|
|
100
|
-
Use these files as scaffolding for new tenants or as a template for the
|
|
101
|
-
hackathon deliverable. Replace the sample connection metadata with
|
|
102
|
-
tenant-specific IDs/secret references before deploying.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
`}];e(t);export{t as tech_contracts_vertical_pocket_family_office_DocBlocks};
|
|
1
|
+
import { registerDocBlocks } from "../../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/tech/contracts/vertical-pocket-family-office.docblock.ts
|
|
4
|
+
const tech_contracts_vertical_pocket_family_office_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.contracts.vertical-pocket-family-office",
|
|
6
|
+
title: "Pocket Family Office Vertical",
|
|
7
|
+
summary: "Pocket Family Office is a ContractSpec reference vertical that",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/contracts/vertical-pocket-family-office",
|
|
11
|
+
tags: [
|
|
12
|
+
"tech",
|
|
13
|
+
"contracts",
|
|
14
|
+
"vertical-pocket-family-office"
|
|
15
|
+
],
|
|
16
|
+
body: "# Pocket Family Office Vertical\n\nPocket Family Office is a ContractSpec reference vertical that\ndemonstrates finance automation atop the integration and knowledge\nlayers. It is optimised for the hackathon stack (Google Cloud, Mistral,\nQdrant, ElevenLabs) while remaining provider-agnostic.\n\n## Goals\n\n- Ingest household financial documents (uploads + Gmail threads).\n- Generate AI summaries and optionally deliver them as voice notes.\n- Schedule multi-channel reminders for upcoming bills.\n- Showcase spec-first composition of integrations, knowledge spaces, and\n workflows.\n\n## Blueprint Overview\n\nSource: `packages/verticals/pocket-family-office/blueprint.ts`\n\n- **Integration slots**\n - `primaryLLM` → Mistral chat/embeddings\n - `primaryVectorDb` → Qdrant\n - `primaryStorage` → Google Cloud Storage\n - `primaryOpenBanking` → Powens BYOK project for account aggregation\n - `emailInbound` / `emailOutbound` → Gmail + Postmark\n - `calendarScheduling` → Google Calendar\n - `voicePlayback` → ElevenLabs (optional)\n - `smsNotifications` → Twilio (optional)\n - `paymentsProcessing` → Stripe (optional)\n- **Workflows**\n - `process-uploaded-document`\n - `upcoming-payments-reminder`\n - `generate-financial-summary`\n - `ingest-email-threads`\n - `sync-openbanking-accounts`\n - `sync-openbanking-transactions`\n - `refresh-openbanking-balances`\n - `generate-openbanking-overview`\n- **Policies/Telemetry** – references tenant policy specs and\n `pfo.telemetry` for observability.\n\n## Tenant Sample\n\n`tenant.sample.ts` binds each slot to sample connections defined in\n`connections/samples.ts`. Key details:\n\n- Uses Google Cloud Secret Manager URIs for all credentials.\n- Enables knowledge spaces `knowledge.financial-docs` and\n `knowledge.email-threads`, plus the derived summaries space\n `knowledge.financial-overview` populated by open banking workflows.\n- Keeps `voicePlayback` and `paymentsProcessing` optional so tenants can\n enable them incrementally.\n\n## Contracts\n\n`contracts/index.ts` defines command/query specs that power the\nworkflows:\n\n- `pfo.documents.upload` – store object + enqueue ingestion.\n- `pfo.reminders.schedule-payment` – send email/SMS/calendar reminders.\n- `pfo.summary.generate` – run RAG over knowledge spaces.\n- `pfo.summary.dispatch` – deliver summaries via email / voice.\n- `pfo.email.sync-threads` – ingest Gmail threads.\n\n## Workflows\n\n- **Process Uploaded Document**\n 1. Upload to storage / queue ingestion.\n 2. Optional human review step.\n- **Upcoming Payments Reminder**\n 1. Human review (confirm due date / channel).\n 2. Automation schedules reminders (email/SMS/calendar).\n- **Generate Financial Summary**\n 1. Run RAG to produce Markdown summary.\n 2. Dispatch summary (email + optional ElevenLabs voice note).\n- **Ingest Email Threads**\n 1. Sync Gmail threads into knowledge space.\n 2. Triage step for operators when nothing new is ingested.\n\n## Knowledge & Jobs\n\n- Knowledge spaces registered via\n `registerFinancialDocsKnowledgeSpace` and\n `registerEmailThreadsKnowledgeSpace`.\n- Ingestion adapters (`GmailIngestionAdapter`, `StorageIngestionAdapter`)\n and job handlers (`createGmailSyncHandler`,\n `createStorageDocumentHandler`) wire Gmail labels & GCS prefixes into\n Qdrant.\n- `KnowledgeQueryService` provides summarisation + references for the\n summary generation workflow.\n\n## Tests & Usage\n\n`tests/pocket-family-office.test.ts` exercises:\n\n- Blueprint validation + config composition.\n- In-memory ingestion of a sample invoice.\n- Retrieval augmented generation producing a summary with references.\n\nUse these files as scaffolding for new tenants or as a template for the\nhackathon deliverable. Replace the sample connection metadata with\ntenant-specific IDs/secret references before deploying.\n\n\n\n"
|
|
17
|
+
}];
|
|
18
|
+
registerDocBlocks(tech_contracts_vertical_pocket_family_office_DocBlocks);
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { tech_contracts_vertical_pocket_family_office_DocBlocks };
|