@lssm/example.team-hub 0.0.0-canary-20251217060834 → 0.0.0-canary-20251217072406

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 (153) hide show
  1. package/dist/announcement/announcement.contracts.d.ts +16 -16
  2. package/dist/announcement/announcement.contracts.js +33 -1
  3. package/dist/announcement/announcement.schema.d.ts +15 -15
  4. package/dist/announcement/announcement.schema.js +74 -1
  5. package/dist/announcement/index.js +4 -1
  6. package/dist/docs/index.js +1 -1
  7. package/dist/docs/team-hub.docblock.js +61 -5
  8. package/dist/entities/index.d.ts +137 -137
  9. package/dist/entities/index.js +263 -1
  10. package/dist/events.js +162 -1
  11. package/dist/example.js +50 -1
  12. package/dist/handlers/index.js +8 -1
  13. package/dist/index.d.ts +0 -4
  14. package/dist/index.js +14 -1
  15. package/dist/libs/contracts/dist/capabilities/openbanking.js +88 -0
  16. package/dist/libs/contracts/dist/client/index.js +5 -0
  17. package/dist/libs/contracts/dist/client/react/feature-render.js +2 -0
  18. package/dist/libs/contracts/dist/client/react/form-render.js +4 -0
  19. package/dist/libs/contracts/dist/client/react/index.js +4 -0
  20. package/dist/libs/contracts/dist/contract-registry/index.js +1 -0
  21. package/dist/libs/contracts/dist/contract-registry/schemas.js +60 -0
  22. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -0
  23. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -0
  24. package/dist/libs/contracts/dist/docs/index.js +29 -0
  25. package/dist/libs/contracts/dist/docs/presentations.js +71 -0
  26. package/dist/libs/contracts/dist/docs/registry.js +44 -0
  27. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -0
  28. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -0
  29. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -0
  30. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -0
  31. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -0
  32. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +80 -0
  33. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +57 -0
  34. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -0
  35. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +357 -0
  36. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -0
  37. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -0
  38. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -0
  39. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -0
  40. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +79 -0
  41. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +84 -0
  42. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +45 -0
  43. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -0
  44. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +40 -0
  45. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +69 -0
  46. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -0
  47. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +62 -0
  48. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +155 -0
  49. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -0
  50. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +101 -0
  51. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -0
  52. package/dist/libs/contracts/dist/events.js +10 -0
  53. package/dist/libs/contracts/dist/experiments/evaluator.js +1 -0
  54. package/dist/libs/contracts/dist/index.js +71 -0
  55. package/dist/libs/contracts/dist/install.js +2 -0
  56. package/dist/libs/contracts/dist/integrations/contracts.js +377 -0
  57. package/dist/libs/contracts/dist/integrations/index.js +18 -0
  58. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -0
  59. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +159 -0
  60. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -0
  61. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -0
  62. package/dist/libs/contracts/dist/integrations/openbanking/models.js +242 -0
  63. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +13 -0
  64. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -0
  65. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -0
  66. package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -0
  67. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -0
  68. package/dist/libs/contracts/dist/integrations/providers/index.js +11 -0
  69. package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -0
  70. package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -0
  71. package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -0
  72. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -0
  73. package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -0
  74. package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -0
  75. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -0
  76. package/dist/libs/contracts/dist/jsonschema.js +1 -0
  77. package/dist/libs/contracts/dist/knowledge/contracts.js +306 -0
  78. package/dist/libs/contracts/dist/knowledge/index.js +7 -0
  79. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -0
  80. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -0
  81. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -0
  82. package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -0
  83. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -0
  84. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -0
  85. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -0
  86. package/dist/libs/contracts/dist/llm/exporters.js +19 -0
  87. package/dist/libs/contracts/dist/llm/index.js +2 -0
  88. package/dist/libs/contracts/dist/llm/prompts.js +1 -0
  89. package/dist/libs/contracts/dist/onboarding-base.js +196 -0
  90. package/dist/libs/contracts/dist/openapi.js +1 -0
  91. package/dist/libs/contracts/dist/ownership.js +21 -0
  92. package/dist/libs/contracts/dist/presentations.js +1 -0
  93. package/dist/libs/contracts/dist/presentations.v2.js +11 -0
  94. package/dist/libs/contracts/dist/prompt.js +1 -0
  95. package/dist/libs/contracts/dist/promptRegistry.js +1 -0
  96. package/dist/libs/contracts/dist/regenerator/index.js +1 -0
  97. package/dist/libs/contracts/dist/regenerator/service.js +6 -0
  98. package/dist/libs/contracts/dist/registry.js +2 -0
  99. package/dist/libs/contracts/dist/resources.js +1 -0
  100. package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -0
  101. package/dist/libs/contracts/dist/schema/dist/FieldType.js +49 -0
  102. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -0
  103. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +34 -0
  104. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -0
  105. package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -0
  106. package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -0
  107. package/dist/libs/contracts/dist/schema/dist/index.js +6 -0
  108. package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -0
  109. package/dist/libs/contracts/dist/server/index.js +8 -0
  110. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -0
  111. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -0
  112. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -0
  113. package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -0
  114. package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -0
  115. package/dist/libs/contracts/dist/server/provider-mcp.js +1 -0
  116. package/dist/libs/contracts/dist/server/rest-elysia.js +1 -0
  117. package/dist/libs/contracts/dist/server/rest-express.js +1 -0
  118. package/dist/libs/contracts/dist/server/rest-generic.js +1 -0
  119. package/dist/libs/contracts/dist/server/rest-next-app.js +1 -0
  120. package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -0
  121. package/dist/libs/contracts/dist/spec.js +34 -0
  122. package/dist/libs/contracts/dist/telemetry/index.js +1 -0
  123. package/dist/libs/contracts/dist/telemetry/tracker.js +1 -0
  124. package/dist/libs/contracts/dist/tests/index.js +1 -0
  125. package/dist/libs/contracts/dist/tests/runner.js +2 -0
  126. package/dist/libs/contracts/dist/workflow/index.js +1 -0
  127. package/dist/libs/contracts/dist/workflow/runner.js +1 -0
  128. package/dist/libs/schema/dist/EnumType.js +2 -0
  129. package/dist/libs/schema/dist/FieldType.js +49 -0
  130. package/dist/libs/schema/dist/ScalarTypeEnum.js +236 -0
  131. package/dist/libs/schema/dist/SchemaModel.js +39 -0
  132. package/dist/libs/schema/dist/entity/defineEntity.js +236 -0
  133. package/dist/libs/schema/dist/entity/index.js +2 -0
  134. package/dist/libs/schema/dist/entity/types.js +1 -0
  135. package/dist/libs/schema/dist/index.js +6 -0
  136. package/dist/presentations/index.js +12 -1
  137. package/dist/presentations.js +127 -1
  138. package/dist/ritual/index.js +4 -1
  139. package/dist/ritual/ritual.contracts.d.ts +28 -28
  140. package/dist/ritual/ritual.contracts.js +57 -1
  141. package/dist/ritual/ritual.schema.d.ts +20 -20
  142. package/dist/ritual/ritual.schema.js +99 -1
  143. package/dist/space/index.js +4 -1
  144. package/dist/space/space.contracts.d.ts +13 -13
  145. package/dist/space/space.contracts.js +33 -1
  146. package/dist/space/space.schema.d.ts +12 -12
  147. package/dist/space/space.schema.js +62 -1
  148. package/dist/task/index.js +4 -1
  149. package/dist/task/task.contracts.d.ts +60 -60
  150. package/dist/task/task.contracts.js +123 -1
  151. package/dist/task/task.schema.js +95 -1
  152. package/dist/team-hub.feature.js +157 -1
  153. package/package.json +10 -10
@@ -0,0 +1,155 @@
1
+ import { registerDocBlocks } from "../registry.js";
2
+
3
+ //#region ../../libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js
4
+ const tech_telemetry_ingest_DocBlocks = [{
5
+ id: "docs.tech.telemetry.ingest",
6
+ title: "Telemetry Ingest Endpoint",
7
+ summary: "Server-side telemetry ingestion for ContractSpec clients (VS Code extension, CLI, etc.).",
8
+ kind: "reference",
9
+ visibility: "internal",
10
+ route: "/docs/tech/telemetry/ingest",
11
+ tags: [
12
+ "telemetry",
13
+ "api",
14
+ "posthog",
15
+ "analytics"
16
+ ],
17
+ body: `# Telemetry Ingest Endpoint
18
+
19
+ The ContractSpec API provides a telemetry ingest endpoint for clients to send product analytics events.
20
+
21
+ ## Endpoint
22
+
23
+ \`\`\`
24
+ POST /api/telemetry/ingest
25
+ \`\`\`
26
+
27
+ ## Request
28
+
29
+ \`\`\`json
30
+ {
31
+ "event": "contractspec.vscode.command_run",
32
+ "distinct_id": "client-uuid",
33
+ "properties": {
34
+ "command": "validate"
35
+ },
36
+ "timestamp": "2024-01-15T10:30:00.000Z"
37
+ }
38
+ \`\`\`
39
+
40
+ ### Headers
41
+
42
+ | Header | Description |
43
+ |--------|-------------|
44
+ | \`x-contractspec-client-id\` | Optional client identifier (used as fallback for distinct_id) |
45
+ | \`Content-Type\` | Must be \`application/json\` |
46
+
47
+ ### Body
48
+
49
+ | Field | Type | Required | Description |
50
+ |-------|------|----------|-------------|
51
+ | \`event\` | string | Yes | Event name (e.g., \`contractspec.vscode.activated\`) |
52
+ | \`distinct_id\` | string | Yes | Anonymous client identifier |
53
+ | \`properties\` | object | No | Event properties |
54
+ | \`timestamp\` | string | No | ISO 8601 timestamp |
55
+
56
+ ## Response
57
+
58
+ \`\`\`json
59
+ {
60
+ "success": true
61
+ }
62
+ \`\`\`
63
+
64
+ ## Configuration
65
+
66
+ The endpoint requires \`POSTHOG_PROJECT_KEY\` environment variable to be set. If not configured, events are accepted but not forwarded.
67
+
68
+ | Environment Variable | Description | Default |
69
+ |---------------------|-------------|---------|
70
+ | \`POSTHOG_HOST\` | PostHog host URL | \`https://eu.posthog.com\` |
71
+ | \`POSTHOG_PROJECT_KEY\` | PostHog project API key | (required) |
72
+
73
+ ## Privacy
74
+
75
+ - No PII is collected or stored
76
+ - \`distinct_id\` is an anonymous client-generated UUID
77
+ - File paths and source code are never included in events
78
+ - Respects VS Code telemetry settings on the client side
79
+
80
+ ## Events
81
+
82
+ ### Extension Events
83
+
84
+ | Event | Description | Properties |
85
+ |-------|-------------|------------|
86
+ | \`contractspec.vscode.activated\` | Extension activated | \`version\` |
87
+ | \`contractspec.vscode.command_run\` | Command executed | \`command\` |
88
+ | \`contractspec.vscode.mcp_call\` | MCP call made | \`endpoint\`, \`tool\` |
89
+
90
+ ### API Events
91
+
92
+ | Event | Description | Properties |
93
+ |-------|-------------|------------|
94
+ | \`contractspec.api.mcp_request\` | MCP request processed | \`endpoint\`, \`method\`, \`success\`, \`duration_ms\` |
95
+ `
96
+ }, {
97
+ id: "docs.tech.telemetry.hybrid",
98
+ title: "Hybrid Telemetry Model",
99
+ summary: "How ContractSpec clients choose between direct PostHog and API-routed telemetry.",
100
+ kind: "usage",
101
+ visibility: "internal",
102
+ route: "/docs/tech/telemetry/hybrid",
103
+ tags: [
104
+ "telemetry",
105
+ "architecture",
106
+ "posthog"
107
+ ],
108
+ body: `# Hybrid Telemetry Model
109
+
110
+ ContractSpec uses a hybrid telemetry model where clients can send events either directly to PostHog or via the API server.
111
+
112
+ ## Decision Flow
113
+
114
+ \`\`\`
115
+ Is contractspec.api.baseUrl configured?
116
+ ├── Yes → Send via /api/telemetry/ingest
117
+ └── No → Is posthogProjectKey configured?
118
+ ├── Yes → Send directly to PostHog
119
+ └── No → Telemetry disabled
120
+ \`\`\`
121
+
122
+ ## Benefits
123
+
124
+ ### Direct PostHog
125
+ - No server dependency
126
+ - Works offline (with batching)
127
+ - Lower latency
128
+
129
+ ### Via API
130
+ - Centralized key management (no client-side keys)
131
+ - Server-side enrichment and validation
132
+ - Rate limiting and abuse prevention
133
+ - Easier migration to other providers
134
+
135
+ ## Recommendation
136
+
137
+ - **Development**: Use direct PostHog with a dev project key
138
+ - **Production**: Route via API for better governance
139
+
140
+ ## Future: OpenTelemetry
141
+
142
+ The current PostHog implementation is behind a simple interface that can be swapped for OpenTelemetry:
143
+
144
+ \`\`\`typescript
145
+ interface TelemetryClient {
146
+ send(event: TelemetryEvent): Promise<void>;
147
+ }
148
+ \`\`\`
149
+
150
+ This allows future migration without changing client code.
151
+ `
152
+ }];
153
+ registerDocBlocks(tech_telemetry_ingest_DocBlocks);
154
+
155
+ //#endregion
@@ -0,0 +1,20 @@
1
+ import { registerDocBlocks } from "../../registry.js";
2
+
3
+ //#region ../../libs/contracts/dist/docs/tech/templates/runtime.docblock.js
4
+ const tech_templates_runtime_DocBlocks = [{
5
+ id: "docs.tech.templates.runtime",
6
+ title: "ContractSpec Template Runtime (Phase 9)",
7
+ summary: "Phase 9 introduces a full local-first runtime for templates so anyone can preview apps directly in the browser without provisioning any infrastructure.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/tech/templates/runtime",
11
+ tags: [
12
+ "tech",
13
+ "templates",
14
+ "runtime"
15
+ ],
16
+ body: "## ContractSpec Template Runtime (Phase 9)\n\nPhase 9 introduces a full local-first runtime for templates so anyone can preview apps directly in the browser without provisioning any infrastructure.\n\n### Building Blocks\n\n- **Local database** – `@lssm/lib.runtime-local` wraps `sql.js` (SQLite WASM) and `IndexedDB` so we can seed demo data, run migrations, and persist state between sessions. Tests point the runtime to `node_modules/sql.js/dist` so CI doesn’t need a browser.\n- **Local GraphQL** – `LocalGraphQLClient` wires Apollo Client + SchemaLink to resolvers for tasks, messaging, and i18n recipes. All `/templates`, `/studio`, and `/sandbox` previews use those resolvers so we never call remote APIs during demos.\n- **Template registry + installer** – `.../templates/registry.ts` stores the catalog (todos, messaging, recipes). `TemplateInstaller` can seed the runtime (`install`) or export a base64 snapshot via the new `saveTemplateToStudio` mutation.\n- **TemplateShell** – Shared UI wrapper that creates a `TemplateRuntimeProvider`, shows `LocalDataIndicator`, and (optionally) surfaces the new `SaveToStudioButton`.\n\n### Runtime Flows\n\n1. `/templates` now opens a modal that renders `TemplateShell` for each template. Users can explore without leaving the marketing site.\n2. `/studio` switches to a tabbed mini-app (Projects, Canvas, Specs, Deploy) to showcase Studio surfaces with mock data. Visitors see a **preview** shell, while authenticated users (Better Auth via Sigil) unlock full persistence, versioning, and deployment controls.\n3. `/sandbox` lets visitors pick a template and mode (Playground, Spec Editor, Visual Builder). The console at the bottom streams runtime events for transparency.\n\n### GraphQL Mutations\n\n- `saveTemplateToStudio(input: SaveTemplateInput!): SaveTemplateResult!` writes a placeholder project + spec so that templates installed from the sandbox appear in Studio. The mutation is intentionally simple right now: it records which template was imported, stores metadata, and returns `{ projectId, status: 'QUEUED' }` for the UI.\n- `saveCanvasDraft(input: SaveCanvasDraftInput!): CanvasVersion!` snapshots the current Visual Builder nodes to a draft version tied to a canvas overlay. Inputs include `canvasId`, arbitrary `nodes` JSON, and an optional `label`. The resolver enforces org/org access before calling `CanvasVersionManager`.\n- `deployCanvasVersion(input: DeployCanvasVersionInput!): CanvasVersion!` promotes a previously saved draft (`versionId`) to the deployed state. The returned object includes `status`, `nodes`, `createdAt`, and `createdBy` for UI timelines.\n- `undoCanvasVersion(input: UndoCanvasInput!): CanvasVersion` rewinds the visual builder to the prior snapshot (returns `null` when history is empty) so Studio’s toolbar can surface “Undo” without shelling out to local storage.\n\n### Studio GraphQL endpoint\n\n- The landing app exposes the Studio schema at `/api/studio/graphql` via Yoga so React Query hooks (`useStudioProjects`, `useCreateStudioProject`, `useDeployStudioProject`, etc.) can talk to the bundle without spinning up a separate server.\n\n### Spec Editor typing\n\n- Studio’s spec editor now preloads Monaco with ambient declarations for `@lssm/lib.contracts` and `zod`, so snippets receive autocomplete and inline errors even before the spec ships to the backend. The helper lives in `presentation/components/studio/organisms/monaco-spec-types.ts` and registers the extra libs once per browser session via `monaco.languages.typescript.typescriptDefaults.addExtraLib`.\n- Compiler options are aligned with our frontend toolchain (ES2020 + React JSX) which means drafts written in the editor behave like the compiled artifacts that flow through Studio pipelines.\n\n### Spec templates\n\n- Selecting a spec type now injects a ready-to-edit scaffold (capability, workflow, policy, dataview, component) so authors start from a canonical layout instead of a blank file. Templates live alongside `SpecEditor.tsx`, and we only overwrite the content when the previous value is empty or when the author explicitly switches types via the dropdown.\n\n### Spec preview\n\n- The validation side panel now embeds a `SpecPreview` widget that shows validation errors alongside transport artifacts (GraphQL schema, REST endpoints, component summaries) once a preview run completes. Tabs let authors toggle between “Validation” and “Artifacts,” mirroring the UX described in the Studio plan.\n\n### Testing\n\n- `src/templates/__tests__/runtime.test.ts` covers todos CRUD, messaging delivery, and recipe locale switching through the local GraphQL API.\n- Studio infrastructure tests live in `src/__tests__/e2e/project-lifecycle.test.ts` and continue to exercise project creation + deploy flows.\n\n### Next Steps\n\nFuture templates can register their React components via `registerTemplateComponents(templateId, components)` so TemplateShell can render them automatically. When new templates are added, remember to:\n\n1. Update the registry entry (schema + tags).\n2. Register components inside `presentation/components/templates`.\n3. Document the template under `docs/templates/`.\n\n\n\n\n\n"
17
+ }];
18
+ registerDocBlocks(tech_templates_runtime_DocBlocks);
19
+
20
+ //#endregion
@@ -0,0 +1,101 @@
1
+ import { registerDocBlocks } from "../registry.js";
2
+
3
+ //#region ../../libs/contracts/dist/docs/tech/vscode-extension.docblock.js
4
+ const tech_vscode_extension_DocBlocks = [{
5
+ id: "docs.tech.vscode.extension",
6
+ title: "ContractSpec VS Code Extension",
7
+ summary: "VS Code extension for spec-first development with validation, scaffolding, and MCP integration.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/tech/vscode/extension",
11
+ tags: [
12
+ "vscode",
13
+ "extension",
14
+ "tooling",
15
+ "dx"
16
+ ],
17
+ body: `# ContractSpec VS Code Extension
18
+
19
+ The ContractSpec VS Code extension provides spec-first development tooling directly in your editor.
20
+
21
+ ## Features
22
+
23
+ - **Real-time Validation**: Get instant feedback on spec errors and warnings as you save files
24
+ - **Build/Scaffold**: Generate handler and component skeletons from specs (no AI required)
25
+ - **Spec Explorer**: List and navigate all specs in your workspace
26
+ - **Dependency Analysis**: Visualize spec dependencies and detect cycles
27
+ - **MCP Integration**: Search ContractSpec documentation via Model Context Protocol
28
+ - **Snippets**: Code snippets for common ContractSpec patterns
29
+
30
+ ## Commands
31
+
32
+ | Command | Description |
33
+ |---------|-------------|
34
+ | \`ContractSpec: Validate Current Spec\` | Validate the currently open spec file |
35
+ | \`ContractSpec: Validate All Specs\` | Validate all spec files in the workspace |
36
+ | \`ContractSpec: Build/Scaffold\` | Generate handler/component from the current spec |
37
+ | \`ContractSpec: List All Specs\` | Show all specs in the workspace |
38
+ | \`ContractSpec: Analyze Dependencies\` | Analyze and visualize spec dependencies |
39
+ | \`ContractSpec: Search Docs (MCP)\` | Search documentation via MCP |
40
+
41
+ ## Configuration
42
+
43
+ | Setting | Description | Default |
44
+ |---------|-------------|---------|
45
+ | \`contractspec.api.baseUrl\` | Base URL for ContractSpec API (enables MCP + remote telemetry) | \`""\` |
46
+ | \`contractspec.telemetry.posthogHost\` | PostHog host URL for direct telemetry | \`"https://eu.posthog.com"\` |
47
+ | \`contractspec.telemetry.posthogProjectKey\` | PostHog project key for direct telemetry | \`""\` |
48
+ | \`contractspec.validation.onSave\` | Run validation on save | \`true\` |
49
+ | \`contractspec.validation.onOpen\` | Run validation on open | \`true\` |
50
+
51
+ ## Architecture
52
+
53
+ The extension uses:
54
+ - \`@lssm/module.contractspec-workspace\` for pure analysis + templates
55
+ - \`@lssm/bundle.contractspec-workspace\` for workspace services + adapters
56
+
57
+ This allows the extension to work without requiring the CLI to be installed.
58
+
59
+ ## Telemetry
60
+
61
+ The extension uses a hybrid telemetry approach:
62
+ 1. If \`contractspec.api.baseUrl\` is configured → send to API \`/api/telemetry/ingest\`
63
+ 2. Otherwise → send directly to PostHog (if project key configured)
64
+
65
+ Telemetry respects VS Code's telemetry settings. No file paths, source code, or PII is collected.
66
+ `
67
+ }, {
68
+ id: "docs.tech.vscode.snippets",
69
+ title: "ContractSpec Snippets",
70
+ summary: "Code snippets for common ContractSpec patterns in VS Code.",
71
+ kind: "reference",
72
+ visibility: "public",
73
+ route: "/docs/tech/vscode/snippets",
74
+ tags: [
75
+ "vscode",
76
+ "snippets",
77
+ "dx"
78
+ ],
79
+ body: `# ContractSpec Snippets
80
+
81
+ The VS Code extension includes snippets for common ContractSpec patterns.
82
+
83
+ ## Available Snippets
84
+
85
+ | Prefix | Description |
86
+ |--------|-------------|
87
+ | \`contractspec-command\` | Create a new command (write operation) |
88
+ | \`contractspec-query\` | Create a new query (read-only operation) |
89
+ | \`contractspec-event\` | Create a new event |
90
+ | \`contractspec-docblock\` | Create a new DocBlock |
91
+ | \`contractspec-telemetry\` | Create a new TelemetrySpec |
92
+ | \`contractspec-presentation\` | Create a new Presentation |
93
+
94
+ ## Usage
95
+
96
+ Type the prefix in a TypeScript file and press Tab to expand the snippet. Tab through the placeholders to fill in your values.
97
+ `
98
+ }];
99
+ registerDocBlocks(tech_vscode_extension_DocBlocks);
100
+
101
+ //#endregion
@@ -0,0 +1,20 @@
1
+ import { registerDocBlocks } from "../../registry.js";
2
+
3
+ //#region ../../libs/contracts/dist/docs/tech/workflows/overview.docblock.js
4
+ const tech_workflows_overview_DocBlocks = [{
5
+ id: "docs.tech.workflows.overview",
6
+ title: "WorkflowSpec Overview",
7
+ summary: "WorkflowSpec provides a declarative, versioned format for long-running flows that mix automation and human review. Specs stay inside `@lssm/lib.contracts` (`src/workflow/spec.ts`) so the same definition powers runtime execution, documentation, and future generation.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/tech/workflows/overview",
11
+ tags: [
12
+ "tech",
13
+ "workflows",
14
+ "overview"
15
+ ],
16
+ body: "# WorkflowSpec Overview\n\n## Purpose\n\nWorkflowSpec provides a declarative, versioned format for long-running flows that mix automation and human review. Specs stay inside `@lssm/lib.contracts` (`src/workflow/spec.ts`) so the same definition powers runtime execution, documentation, and future generation.\n\n## Core Types\n\n- `WorkflowMeta`: ownership metadata (`title`, `domain`, `owners`, `tags`, `stability`) plus `name` and `version`.\n- `WorkflowDefinition`:\n - `entryStepId?`: optional explicit entry point (defaults to first step).\n - `steps[]`: ordered list of `Step` descriptors.\n - `transitions[]`: directed edges between steps with optional expressions.\n - `sla?`: aggregated timing hints for the overall flow or per-step budgets.\n - `compensation?`: fallback operations executed when a workflow is rolled back or fails.\n- `Step`:\n - `type`: `human`, `automation`, or `decision`.\n - `action`: references either a `ContractSpec` (`operation`) or `FormSpec` (`form`).\n - Optional `guard`, `timeoutMs`, and retry policy (`maxAttempts`, `backoff`, `delayMs`, `maxDelayMs?`).\n - `requiredIntegrations?`: integration slot ids that must be bound before the step may execute.\n - `requiredCapabilities?`: `CapabilityRef[]` that must be enabled in the resolved app config.\n- `Transition`: `from` → `to` with optional `condition` string (simple data expressions).\n\n## Registry & Validation\n\n- `WorkflowRegistry` (`src/workflow/spec.ts`) stores specs by key `<name>.v<version>` and exposes `register`, `list`, and `get`.\n- `validateWorkflowSpec()` (`src/workflow/validation.ts`) checks:\n - Duplicate step IDs.\n - Unknown `from`/`to` transitions.\n - Empty guards/conditions.\n - Reachability from the entry step.\n - Cycles in the graph.\n - Operation/Form references against provided registries.\n- `assertWorkflowSpecValid()` wraps validation and throws `WorkflowValidationError` when errors remain.\n\n## Runtime\n\n- `WorkflowRunner` (`src/workflow/runner.ts`) executes workflows and coordinates steps.\n - `start(name, version?, initialData?)` returns a `workflowId`.\n - `executeStep(workflowId, input?)` runs the current step (automation or human).\n - `getState(workflowId)` retrieves the latest state snapshot.\n - `cancel(workflowId)` marks the workflow as cancelled.\n - `preFlightCheck(name, version?, resolvedConfig?)` evaluates integration/capability requirements before the workflow starts.\n - Throws `WorkflowPreFlightError` if required integration slots are unbound or required capabilities are disabled.\n- `StateStore` (`src/workflow/state.ts`) abstracts persistence. V1 ships with:\n - `InMemoryStateStore` (`src/workflow/adapters/memory-store.ts`) for tests/dev.\n - Placeholder factories for file/database adapters (`adapters/file-adapter.ts`, `adapters/db-adapter.ts`).\n- Guard evaluation: expression guards run through `evaluateExpression()` (`src/workflow/expression.ts`); custom policy guards can be provided via `guardEvaluator`.\n- Events: the runner emits `workflow.started`, `workflow.step_completed`, `workflow.step_failed`, and `workflow.cancelled` through the optional `eventEmitter`.\n- React bindings (`@lssm/lib.presentation-runtime-react`):\n - `useWorkflow` hook (polls state, exposes `executeStep`, `cancel`, `refresh`).\n - `WorkflowStepper` progress indicator using design-system Stepper.\n - `WorkflowStepRenderer` helper to render human/automation/decision steps with sensible fallbacks.\n\n## Authoring Checklist\n\n1. Reuse existing operations/forms; create new specs when missing.\n2. Prefer explicit `entryStepId` for clarity (especially with decision branches).\n3. Give automation steps an `operation` and human steps a `form` (warnings surface otherwise).\n4. Use short, meaningful step IDs (`submit`, `review`, `finalize`) to simplify analytics.\n5. Keep guard expressions deterministic; complex policy logic should move to PolicySpec (Phase 2).\n\n## Testing\n\n- Add unit tests for new workflows via `assertWorkflowSpecValid`.\n- Use the new Vitest suites (`validation.test.ts`, `expression.test.ts`, `runner.test.ts`) as examples.\n- CLI support will arrive in Phase 1 PR 3 (`contractspec create --type workflow`).\n\n## Tooling\n\n- `contractspec create --type workflow` scaffolds a WorkflowSpec with interactive prompts.\n- `contractspec build <spec.workflow.ts>` generates a runner scaffold (`.runner.ts`) wired to `WorkflowRunner` and the in-memory store.\n- `contractspec validate` understands `.workflow.ts` files and checks core structure (meta, steps, transitions).\n\n## Next Steps (Non-MVP)\n\n- Persistence adapters (database/file) for workflow state (Phase 2).\n- React bindings (`useWorkflow`, `WorkflowStepper`) and presentation-runtime integration (PR 3).\n- Policy engine integration (`guard.type === 'policy'` validated against PolicySpec).\n- Telemetry hooks for step execution metrics.\n\n"
17
+ }];
18
+ registerDocBlocks(tech_workflows_overview_DocBlocks);
19
+
20
+ //#endregion
@@ -0,0 +1,10 @@
1
+ import "./schema/dist/index.js";
2
+
3
+ //#region ../../libs/contracts/dist/events.js
4
+ /** Identity function to keep type inference when declaring events. */
5
+ function defineEvent(e) {
6
+ return e;
7
+ }
8
+
9
+ //#endregion
10
+ export { defineEvent };
@@ -0,0 +1 @@
1
+ import "node:crypto";
@@ -0,0 +1,71 @@
1
+ import "./schema/dist/SchemaModel.js";
2
+ import "./schema/dist/index.js";
3
+ import { defineEvent } from "./events.js";
4
+ import "./presentations.v2.js";
5
+ import "./client/react/feature-render.js";
6
+ import "./client/react/form-render.js";
7
+ import "./client/index.js";
8
+ import "./jsonschema.js";
9
+ import "./server/graphql-pothos.js";
10
+ import "./presentations.js";
11
+ import "./server/mcp/createMcpServer.js";
12
+ import "./server/rest-generic.js";
13
+ import "./server/rest-elysia.js";
14
+ import "./server/rest-express.js";
15
+ import "./server/rest-next-app.js";
16
+ import "./server/rest-next-pages.js";
17
+ import "./server/index.js";
18
+ import { defineCommand, defineQuery } from "./spec.js";
19
+ import { docBlockToPresentationSpec, docBlockToPresentationV2, docBlocksToPresentationRoutes } from "./docs/presentations.js";
20
+ import { DocRegistry, defaultDocRegistry, registerDocBlocks } from "./docs/registry.js";
21
+ import "./registry.js";
22
+ import { OwnersEnum, StabilityEnum } from "./ownership.js";
23
+ import { ContractRegistryFileSchema, ContractRegistryItemSchema, ContractRegistryItemTypeSchema } from "./contract-registry/schemas.js";
24
+ import "./contract-registry/index.js";
25
+ import "./install.js";
26
+ import "./openapi.js";
27
+ import "./prompt.js";
28
+ import "./promptRegistry.js";
29
+ import "./resources.js";
30
+ import { CompleteOnboardingBaseInput, CompleteOnboardingBaseOutput, DeleteOnboardingDraftOutput, GetOnboardingDraftOutput, SaveOnboardingDraftInput, SaveOnboardingDraftOutput } from "./onboarding-base.js";
31
+ import "./capabilities/openbanking.js";
32
+ import "./telemetry/tracker.js";
33
+ import "./telemetry/index.js";
34
+ import "./tests/runner.js";
35
+ import "./tests/index.js";
36
+ import "./experiments/evaluator.js";
37
+ import "./integrations/providers/stripe.js";
38
+ import "./integrations/providers/postmark.js";
39
+ import "./integrations/providers/qdrant.js";
40
+ import "./integrations/providers/mistral.js";
41
+ import "./integrations/providers/elevenlabs.js";
42
+ import "./integrations/providers/gmail.js";
43
+ import "./integrations/providers/google-calendar.js";
44
+ import "./integrations/providers/twilio-sms.js";
45
+ import "./integrations/providers/gcs-storage.js";
46
+ import "./integrations/providers/powens.js";
47
+ import "./integrations/providers/registry.js";
48
+ import { AccountBalanceRecord, BankAccountRecord, BankTransactionRecord } from "./integrations/openbanking/models.js";
49
+ import { OPENBANKING_TELEMETRY_EVENTS } from "./integrations/openbanking/telemetry.js";
50
+ import "./integrations/openbanking/contracts/accounts.js";
51
+ import "./integrations/openbanking/contracts/transactions.js";
52
+ import "./integrations/openbanking/contracts/balances.js";
53
+ import "./integrations/openbanking/contracts/index.js";
54
+ import "./integrations/index.js";
55
+ import "./knowledge/spaces/product-canon.js";
56
+ import "./knowledge/spaces/support-faq.js";
57
+ import "./knowledge/spaces/email-threads.js";
58
+ import "./knowledge/spaces/uploaded-docs.js";
59
+ import "./knowledge/spaces/financial-docs.js";
60
+ import "./knowledge/spaces/financial-overview.js";
61
+ import "./knowledge/index.js";
62
+ import "./integrations/contracts.js";
63
+ import "./knowledge/contracts.js";
64
+ import "./regenerator/service.js";
65
+ import "./regenerator/index.js";
66
+ import "./workflow/runner.js";
67
+ import "./workflow/index.js";
68
+ import "./docs/index.js";
69
+ import "./llm/exporters.js";
70
+ import "./llm/prompts.js";
71
+ import "./llm/index.js";
@@ -0,0 +1,2 @@
1
+ import "./registry.js";
2
+ import "zod";