@lssm/lib.contracts 0.0.0-canary-20251217062943 → 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 (237) hide show
  1. package/dist/app-config/app-config.feature.js +53 -1
  2. package/dist/app-config/contracts.d.ts +50 -50
  3. package/dist/app-config/contracts.js +396 -1
  4. package/dist/app-config/docs/app-config.docblock.js +22 -220
  5. package/dist/app-config/events.js +168 -1
  6. package/dist/app-config/index.js +8 -1
  7. package/dist/app-config/lifecycle-contracts.js +441 -1
  8. package/dist/app-config/runtime.js +617 -1
  9. package/dist/app-config/spec.js +36 -1
  10. package/dist/app-config/validation.js +538 -1
  11. package/dist/capabilities/docs/capabilities.docblock.js +22 -1
  12. package/dist/capabilities/openbanking.js +92 -1
  13. package/dist/capabilities.js +50 -1
  14. package/dist/client/index.js +9 -1
  15. package/dist/client/react/drivers/rn-reusables.js +21 -1
  16. package/dist/client/react/drivers/shadcn.js +11 -1
  17. package/dist/client/react/feature-render.js +43 -1
  18. package/dist/client/react/form-render.js +298 -1
  19. package/dist/client/react/index.js +8 -1
  20. package/dist/contract-registry/index.js +3 -1
  21. package/dist/contract-registry/schemas.js +61 -1
  22. package/dist/contracts-adapter-hydration.js +41 -1
  23. package/dist/contracts-adapter-input.js +77 -1
  24. package/dist/data-views/docs/data-views.docblock.js +22 -1
  25. package/dist/data-views/query-generator.js +48 -1
  26. package/dist/data-views/runtime.js +39 -1
  27. package/dist/data-views.js +35 -1
  28. package/dist/docs/PUBLISHING.docblock.js +17 -76
  29. package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +17 -350
  30. package/dist/docs/index.js +33 -1
  31. package/dist/docs/meta.docs.js +15 -2
  32. package/dist/docs/presentations.js +77 -1
  33. package/dist/docs/registry.js +51 -1
  34. package/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +17 -383
  35. package/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +17 -68
  36. package/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +17 -140
  37. package/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +17 -86
  38. package/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +17 -1
  39. package/dist/docs/tech/auth/better-auth-nextjs.docblock.js +25 -2
  40. package/dist/docs/tech/contracts/README.docblock.js +21 -1
  41. package/dist/docs/tech/contracts/create-subscription.docblock.js +21 -1
  42. package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.js +21 -180
  43. package/dist/docs/tech/contracts/migrations.docblock.js +21 -1
  44. package/dist/docs/tech/contracts/openapi-export.docblock.js +22 -2
  45. package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +19 -60
  46. package/dist/docs/tech/contracts/overlays.docblock.js +21 -68
  47. package/dist/docs/tech/contracts/tests.docblock.js +21 -132
  48. package/dist/docs/tech/contracts/themes.docblock.js +21 -1
  49. package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +21 -106
  50. package/dist/docs/tech/lifecycle-stage-system.docblock.js +17 -213
  51. package/dist/docs/tech/llm/llm-integration.docblock.js +74 -5
  52. package/dist/docs/tech/mcp-endpoints.docblock.js +38 -1
  53. package/dist/docs/tech/presentation-runtime.docblock.js +17 -1
  54. package/dist/docs/tech/schema/README.docblock.js +21 -262
  55. package/dist/docs/tech/studio/learning-events.docblock.js +49 -1
  56. package/dist/docs/tech/studio/learning-journeys.docblock.js +25 -2
  57. package/dist/docs/tech/studio/platform-admin-panel.docblock.js +24 -2
  58. package/dist/docs/tech/studio/project-access-teams.docblock.js +26 -16
  59. package/dist/docs/tech/studio/project-routing.docblock.js +68 -1
  60. package/dist/docs/tech/studio/sandbox-unlogged.docblock.js +23 -2
  61. package/dist/docs/tech/studio/team-invitations.docblock.js +41 -36
  62. package/dist/docs/tech/studio/workspace-ops.docblock.js +48 -1
  63. package/dist/docs/tech/studio/workspaces.docblock.js +24 -2
  64. package/dist/docs/tech/telemetry-ingest.docblock.js +37 -3
  65. package/dist/docs/tech/templates/runtime.docblock.js +21 -1
  66. package/dist/docs/tech/vscode-extension.docblock.js +37 -3
  67. package/dist/docs/tech/workflows/overview.docblock.js +21 -1
  68. package/dist/docs/tech-contracts.docs.js +19 -2
  69. package/dist/events.js +12 -1
  70. package/dist/experiments/docs/experiments.docblock.js +22 -128
  71. package/dist/experiments/evaluator.js +101 -1
  72. package/dist/experiments/spec.js +33 -1
  73. package/dist/features.js +68 -1
  74. package/dist/forms/docs/forms.docblock.js +22 -1
  75. package/dist/forms.js +119 -1
  76. package/dist/index.js +107 -1
  77. package/dist/install.js +40 -1
  78. package/dist/integrations/contracts.d.ts +102 -102
  79. package/dist/integrations/contracts.js +388 -1
  80. package/dist/integrations/docs/integrations.docblock.js +95 -1
  81. package/dist/integrations/health.js +69 -1
  82. package/dist/integrations/index.js +23 -1
  83. package/dist/integrations/openbanking/contracts/accounts.d.ts +66 -66
  84. package/dist/integrations/openbanking/contracts/accounts.js +237 -1
  85. package/dist/integrations/openbanking/contracts/balances.d.ts +34 -34
  86. package/dist/integrations/openbanking/contracts/balances.js +167 -1
  87. package/dist/integrations/openbanking/contracts/index.js +12 -1
  88. package/dist/integrations/openbanking/contracts/transactions.d.ts +48 -48
  89. package/dist/integrations/openbanking/contracts/transactions.js +218 -1
  90. package/dist/integrations/openbanking/guards.js +32 -1
  91. package/dist/integrations/openbanking/models.d.ts +55 -55
  92. package/dist/integrations/openbanking/models.js +242 -1
  93. package/dist/integrations/openbanking/openbanking.feature.js +68 -1
  94. package/dist/integrations/openbanking/telemetry.js +39 -1
  95. package/dist/integrations/providers/elevenlabs.js +56 -1
  96. package/dist/integrations/providers/gcs-storage.js +79 -1
  97. package/dist/integrations/providers/gmail.js +91 -1
  98. package/dist/integrations/providers/google-calendar.js +70 -1
  99. package/dist/integrations/providers/impls/elevenlabs-voice.js +95 -1
  100. package/dist/integrations/providers/impls/gcs-storage.js +88 -1
  101. package/dist/integrations/providers/impls/gmail-inbound.js +200 -1
  102. package/dist/integrations/providers/impls/gmail-outbound.js +104 -5
  103. package/dist/integrations/providers/impls/google-calendar.js +154 -1
  104. package/dist/integrations/providers/impls/index.js +16 -1
  105. package/dist/integrations/providers/impls/mistral-embedding.js +41 -1
  106. package/dist/integrations/providers/impls/mistral-llm.js +247 -1
  107. package/dist/integrations/providers/impls/postmark-email.js +55 -1
  108. package/dist/integrations/providers/impls/powens-client.js +171 -1
  109. package/dist/integrations/providers/impls/powens-openbanking.js +218 -1
  110. package/dist/integrations/providers/impls/provider-factory.js +142 -1
  111. package/dist/integrations/providers/impls/qdrant-vector.js +69 -1
  112. package/dist/integrations/providers/impls/stripe-payments.js +202 -1
  113. package/dist/integrations/providers/impls/twilio-sms.js +58 -1
  114. package/dist/integrations/providers/index.js +13 -1
  115. package/dist/integrations/providers/mistral.js +72 -1
  116. package/dist/integrations/providers/postmark.js +72 -1
  117. package/dist/integrations/providers/powens.js +120 -1
  118. package/dist/integrations/providers/qdrant.js +77 -1
  119. package/dist/integrations/providers/registry.js +34 -1
  120. package/dist/integrations/providers/stripe.js +87 -1
  121. package/dist/integrations/providers/twilio-sms.js +65 -1
  122. package/dist/integrations/runtime.js +186 -1
  123. package/dist/integrations/secrets/aws-secret-manager.js +231 -1
  124. package/dist/integrations/secrets/env-secret-provider.js +81 -1
  125. package/dist/integrations/secrets/gcp-secret-manager.js +229 -1
  126. package/dist/integrations/secrets/index.js +8 -1
  127. package/dist/integrations/secrets/manager.js +103 -1
  128. package/dist/integrations/secrets/provider.js +58 -1
  129. package/dist/integrations/secrets/scaleway-secret-manager.js +247 -1
  130. package/dist/integrations/spec.js +39 -1
  131. package/dist/jobs/define-job.js +16 -1
  132. package/dist/jobs/gcp-cloud-tasks.js +53 -1
  133. package/dist/jobs/gcp-pubsub.js +39 -1
  134. package/dist/jobs/handlers/gmail-sync-handler.js +9 -1
  135. package/dist/jobs/handlers/index.js +12 -1
  136. package/dist/jobs/handlers/ping-handler.js +15 -1
  137. package/dist/jobs/handlers/storage-document-handler.js +14 -1
  138. package/dist/jobs/index.js +4 -1
  139. package/dist/jobs/memory-queue.js +71 -1
  140. package/dist/jobs/queue.js +33 -1
  141. package/dist/jobs/scaleway-sqs-queue.js +153 -1
  142. package/dist/jsonschema.d.ts +3 -3
  143. package/dist/jsonschema.js +32 -1
  144. package/dist/knowledge/contracts.d.ts +66 -66
  145. package/dist/knowledge/contracts.js +317 -1
  146. package/dist/knowledge/docs/knowledge.docblock.js +22 -138
  147. package/dist/knowledge/index.js +10 -1
  148. package/dist/knowledge/ingestion/document-processor.js +54 -1
  149. package/dist/knowledge/ingestion/embedding-service.js +25 -1
  150. package/dist/knowledge/ingestion/gmail-adapter.js +50 -5
  151. package/dist/knowledge/ingestion/index.js +7 -1
  152. package/dist/knowledge/ingestion/storage-adapter.js +26 -1
  153. package/dist/knowledge/ingestion/vector-indexer.js +32 -1
  154. package/dist/knowledge/query/index.js +3 -1
  155. package/dist/knowledge/query/service.js +64 -2
  156. package/dist/knowledge/runtime.js +49 -1
  157. package/dist/knowledge/spaces/email-threads.js +38 -1
  158. package/dist/knowledge/spaces/financial-docs.js +38 -1
  159. package/dist/knowledge/spaces/financial-overview.js +42 -1
  160. package/dist/knowledge/spaces/index.js +8 -1
  161. package/dist/knowledge/spaces/product-canon.js +38 -1
  162. package/dist/knowledge/spaces/support-faq.js +41 -1
  163. package/dist/knowledge/spaces/uploaded-docs.js +38 -1
  164. package/dist/knowledge/spec.js +39 -1
  165. package/dist/llm/exporters.js +541 -8
  166. package/dist/llm/index.js +4 -1
  167. package/dist/llm/prompts.js +246 -56
  168. package/dist/markdown.js +116 -3
  169. package/dist/migrations.js +33 -1
  170. package/dist/onboarding-base.d.ts +29 -29
  171. package/dist/onboarding-base.js +196 -1
  172. package/dist/openapi.js +75 -1
  173. package/dist/openbanking/docs/openbanking.docblock.js +22 -109
  174. package/dist/ownership.js +40 -1
  175. package/dist/policy/docs/policy.docblock.js +22 -1
  176. package/dist/policy/engine.js +223 -1
  177. package/dist/policy/opa-adapter.js +71 -1
  178. package/dist/policy/spec.js +33 -1
  179. package/dist/presentations/docs/presentations-conventions.docblock.js +21 -7
  180. package/dist/presentations.backcompat.js +47 -1
  181. package/dist/presentations.d.ts +3 -3
  182. package/dist/presentations.js +66 -1
  183. package/dist/presentations.v2.js +278 -6
  184. package/dist/prompt.js +10 -1
  185. package/dist/promptRegistry.js +34 -1
  186. package/dist/regenerator/docs/regenerator.docblock.js +22 -184
  187. package/dist/regenerator/executor.js +86 -1
  188. package/dist/regenerator/index.js +6 -1
  189. package/dist/regenerator/service.js +92 -1
  190. package/dist/regenerator/sinks.js +32 -1
  191. package/dist/regenerator/utils.js +51 -1
  192. package/dist/registry.js +208 -1
  193. package/dist/resources.js +47 -1
  194. package/dist/schema/dist/EnumType.js +2 -1
  195. package/dist/schema/dist/FieldType.js +49 -1
  196. package/dist/schema/dist/ScalarTypeEnum.js +236 -1
  197. package/dist/schema/dist/SchemaModel.js +39 -1
  198. package/dist/schema/dist/entity/defineEntity.js +1 -1
  199. package/dist/schema/dist/entity/index.js +2 -1
  200. package/dist/schema/dist/entity/types.js +1 -1
  201. package/dist/schema/dist/index.js +6 -1
  202. package/dist/schema-to-markdown.js +214 -10
  203. package/dist/server/graphql-pothos.js +128 -1
  204. package/dist/server/index.js +10 -1
  205. package/dist/server/mcp/createMcpServer.js +28 -1
  206. package/dist/server/mcp/registerPresentations.js +151 -1
  207. package/dist/server/mcp/registerPrompts.js +36 -2
  208. package/dist/server/mcp/registerResources.js +35 -1
  209. package/dist/server/mcp/registerTools.js +22 -1
  210. package/dist/server/provider-mcp.js +3 -1
  211. package/dist/server/rest-elysia.js +20 -1
  212. package/dist/server/rest-express.js +39 -1
  213. package/dist/server/rest-generic.js +125 -1
  214. package/dist/server/rest-next-app.js +38 -1
  215. package/dist/server/rest-next-mcp.js +45 -1
  216. package/dist/server/rest-next-pages.js +25 -1
  217. package/dist/spec.js +35 -1
  218. package/dist/telemetry/anomaly.js +48 -1
  219. package/dist/telemetry/docs/telemetry.docblock.js +22 -139
  220. package/dist/telemetry/index.js +5 -1
  221. package/dist/telemetry/spec.js +69 -1
  222. package/dist/telemetry/tracker.js +76 -1
  223. package/dist/tests/index.js +4 -1
  224. package/dist/tests/runner.js +150 -1
  225. package/dist/tests/spec.js +33 -1
  226. package/dist/themes.js +39 -1
  227. package/dist/workflow/adapters/db-adapter.js +83 -1
  228. package/dist/workflow/adapters/file-adapter.js +11 -1
  229. package/dist/workflow/adapters/index.js +5 -1
  230. package/dist/workflow/adapters/memory-store.js +58 -1
  231. package/dist/workflow/expression.js +98 -1
  232. package/dist/workflow/index.js +9 -1
  233. package/dist/workflow/runner.js +337 -1
  234. package/dist/workflow/sla-monitor.js +47 -1
  235. package/dist/workflow/spec.js +32 -1
  236. package/dist/workflow/validation.js +175 -1
  237. package/package.json +11 -4
@@ -1,213 +1,17 @@
1
- import{registerDocBlocks as e}from"../registry.js";const t=[{id:`docs.tech.lifecycle-stage-system`,title:`ContractSpec Lifecycle Stage System – Technical Design`,summary:`This document describes how ContractSpec implements lifecycle detection and guidance. It covers architecture, module boundaries, scoring heuristics, and integration points so libraries, modules, bundles, and Studio surfaces stay synchronized.`,kind:`reference`,visibility:`public`,route:`/docs/tech/lifecycle-stage-system`,tags:[`tech`,`lifecycle-stage-system`],body:`## ContractSpec Lifecycle Stage System – Technical Design
2
-
3
- This document describes how ContractSpec implements lifecycle detection and guidance. It covers architecture, module boundaries, scoring heuristics, and integration points so libraries, modules, bundles, and Studio surfaces stay synchronized.
4
-
5
- ---
6
-
7
- ### 1. Architecture Overview
8
-
9
- \`\`\`
10
- ┌──────────────────────┐
11
- @lssm/lib.lifecycle │ Types, enums, helpers (pure data)
12
- └───────────┬──────────┘
13
-
14
- ┌───────────▼──────────┐ ┌───────────────────────────┐
15
- │ modules/lifecycle- │ │ modules/lifecycle-advisor │
16
- │ core (detection) │ │ (guidance & ceremonies) │
17
- └───────────┬──────────┘ └───────────┬───────────────┘
18
- │ │
19
- ├────────────┬──────────────┤
20
- ▼ ▼ ▼
21
- Adapters: analytics, intent, questionnaires
22
-
23
- ┌───────────▼──────────┐
24
- │ bundles/lifecycle- │ Managed service for Studio
25
- │ managed │ (REST handlers, AI agent) │
26
- └───────────┬──────────┘
27
-
28
- ContractSpec Studio surfaces
29
- (web/mobile APIs, CLI, docs)
30
- \`\`\`
31
-
32
- - **Libraries** provide shared vocabulary.
33
- - **Modules** encapsulate logic, accepting adapters to avoid environment-specific code.
34
- - **Bundles** compose modules, register agents/events, and expose APIs for Studio.
35
- - **Apps** (web-landing, future Studio views) consume bundle APIs; they do not reimplement logic. For web-landing we now resolve \`@lssm/bundle.contractspec-studio\` and \`@lssm/lib.database-contractspec-studio\` directly from their \`packages/.../src\` folders via \`tsconfig\` path aliases so Prisma stays on the server build and Turbopack no longer pulls the prebundled \`dist\` artifacts into client chunks.
36
-
37
- ---
38
-
39
- ### 2. Core Library (\`@lssm/lib.lifecycle\`)
40
-
41
- - Stage enum (0–6) with metadata (\`question\`, \`signals\`, \`traps\`).
42
- - Axes types (\`ProductPhase\`, \`CompanyPhase\`, \`CapitalPhase\`).
43
- - \`LifecycleSignal\` (source, metric, value, timestamp).
44
- - \`LifecycleMetricSnapshot\` (aggregated numbers).
45
- - \`LifecycleMilestone\`, \`LifecycleAction\`, \`LifecycleAssessment\` interfaces.
46
- - Utility helpers:
47
- - \`formatStageSummary(stage, assessment)\`
48
- - \`rankStageCandidates(scores)\`
49
-
50
- The library exports **no runtime dependencies** so it can be imported from apps, modules, and bundles alike.
51
-
52
- ---
53
-
54
- ### 3. Lifecycle Core Module
55
-
56
- **Location:** \`packages/modules/lifecycle-core/\`
57
-
58
- #### Components
59
- 1. **StageSignalCollector**
60
- - Accepts adapter interfaces:
61
- - \`AnalyticsAdapter\` (pulls metrics from \`@lssm/lib.analytics\` or fixture streams).
62
- - \`IntentAdapter\` (hooks into \`@lssm/lib.observability\` intent detectors or logs).
63
- - \`QuestionnaireAdapter\` (loads JSON questionnaires and responses).
64
- - Produces normalized \`LifecycleSignal[]\`.
65
-
66
- 2. **StageScorer**
67
- - Weighted scoring model:
68
- - Base weight per stage (reflecting expected maturity).
69
- - Feature weights (retention, revenue, team size, qualitative feedback).
70
- - Confidence computed via variance of contributing signals.
71
- - Supports pluggable scoring matrices via JSON config.
72
- - Accepts sparse metric snapshots; the orchestrator sanitizes metrics to numeric-only records before persisting assessments so downstream analytics stay consistent.
73
-
74
- 3. **LifecycleOrchestrator**
75
- - Coordinates collectors + scorer.
76
- - Returns \`LifecycleAssessment\` with:
77
- - \`stage\`, \`confidence\`, \`axisSnapshot\`, \`signalsUsed\`.
78
- - Recommended focus areas (high-level categories only).
79
- - Emits events (internally) when stage confidence crosses thresholds (consumed later by bundle).
80
-
81
- 4. **LifecycleMilestonePlanner**
82
- - Loads \`milestones-catalog.json\` (no DB).
83
- - Filters upcoming milestones per stage + axis.
84
- - Tracks completion using provided IDs (caller persists).
85
-
86
- #### Data Files
87
- - \`configs/stage-weights.json\`
88
- - \`configs/milestones-catalog.json\`
89
- - \`questionnaires/stage-readiness.json\`
90
-
91
- #### Extension Hooks
92
- - All adapters exported as TypeScript interfaces.
93
- - Implementations for analytics/intent can live in bundles or apps without modifying module code.
94
-
95
- ---
96
-
97
- ### 4. Lifecycle Advisor Module
98
-
99
- **Location:** \`packages/modules/lifecycle-advisor/\`
100
-
101
- #### Components
102
- 1. **LifecycleRecommendationEngine**
103
- - Consumes \`LifecycleAssessment\`.
104
- - Maps gaps to \`LifecycleAction[]\` using rule tables (\`stage-playbooks.ts\`).
105
- - Supports override hooks for customer-specific rules.
106
-
107
- 2. **ContractSpecLibraryRecommender**
108
- - Maintains mapping from stage → recommended libraries/modules/bundles.
109
- - Returns prioritized list with rationale and adoption prerequisites.
110
-
111
- 3. **LifecycleCeremonyDesigner**
112
- - Provides textual/structural data for ceremonies (title, copy, animation cues, soundtrack references).
113
- - Ensures low-tech friendly instructions (clear copy, undo guidance).
114
-
115
- 4. **AI Hooks**
116
- - Defines prompt templates and tool manifests for lifecycle advisor agents (consumed by bundles).
117
- - Keeps actual LLM integration outside module.
118
-
119
- ---
120
-
121
- ### 5. Managed Bundle (\`lifecycle-managed\`)
122
-
123
- **Responsibilities**
124
- - Wire modules together.
125
- - Provide HTTP/GraphQL handlers (exact transport optional).
126
- - Register LifecycleAdvisorAgent via \`@lssm/lib.ai-agent\`.
127
- - LifecycleAdvisorAgent meta: domain \`operations\`, owners \`team-lifecycle\`, stability \`experimental\`, tags \`guide/lifecycle/ops\` so ops tooling can route incidents quickly.
128
- - Emit lifecycle events through \`@lssm/lib.bus\` + \`@lssm/lib.analytics\`.
129
- - Integrate with \`contractspec-studio\` packages:
130
- - Use Studio contracts for authentication/tenant context (without accessing tenant DBs).
131
- - Store assessments in Studio-managed storage abstractions (in-memory or file-based for now).
132
-
133
- **APIs**
134
- - \`POST /lifecycle/assessments\`: Accepts metrics + optional questionnaire answers. Returns \`LifecycleAssessment\`.
135
- - \`GET /lifecycle/playbooks/:stage\`: Returns stage playbook + ceremonies.
136
- - \`POST /lifecycle/advise\`: Invokes LifecycleAdvisorAgent with context.
137
-
138
- **Events**
139
- - \`LifecycleAssessmentCreated\`
140
- - \`LifecycleStageChanged\`
141
- - \`LifecycleGuidanceConsumed\`
142
-
143
- ---
144
-
145
- ### 6. Library Enhancements
146
-
147
- | Library | Enhancement |
148
- | --- | --- |
149
- | \`@lssm/lib.analytics\` | Lifecycle metric collectors, helper to emit stage events, adapter implementation used by \`StageSignalCollector\`. |
150
- | \`@lssm/lib.evolution\` | Accepts \`LifecycleContext\` when ranking spec anomalies/suggestions. |
151
- | \`@lssm/lib.growth\` | Stage-specific experiment templates + guardrails referencing lifecycle enums. |
152
- | \`@lssm/lib.observability\` | Lifecycle KPI pipeline definitions (drift detection, regression alerts). |
153
-
154
- Each enhancement must import stage types from \`@lssm/lib.lifecycle\`.
155
-
156
- ---
157
-
158
- ### 7. Feature Flags & Progressive Delivery
159
-
160
- - Add new flags in progressive-delivery library:
161
- - \`LIFECYCLE_DETECTION_ALPHA\`
162
- - \`LIFECYCLE_ADVISOR_ALPHA\`
163
- - \`LIFECYCLE_MANAGED_SERVICE\`
164
- - Bundles/modules should check flags before enabling workflows.
165
- - Flags referenced in docs + Studio UI to avoid accidental exposure.
166
-
167
- ---
168
-
169
- ### 8. Analytics & Telemetry
170
-
171
- - Events defined in analytics library; consumed by bundle/app:
172
- - \`lifecycle_assessment_run\`
173
- - \`lifecycle_stage_changed\`
174
- - \`lifecycle_guidance_consumed\`
175
- - Observability pipeline includes:
176
- - Composite lifecycle health metric (weighted sum of KPIs).
177
- - Drift detection comparing stage predictions over time.
178
- - Alert manager recipes for regression (e.g., PMF drop).
179
-
180
- ---
181
-
182
- ### 9. Testing Strategy
183
-
184
- 1. **Unit**
185
- - StageScorer weight matrix.
186
- - RecommendationEngine mapping.
187
- - Library recommender stage coverage.
188
-
189
- 2. **Contract**
190
- - Adapters: ensure mock adapters satisfy interfaces.
191
- - Bundles: ensure HTTP handlers respect request/response contracts even without persistence.
192
-
193
- 3. **Integration**
194
- - CLI example runs detection + guidance end-to-end on fixture data.
195
- - Dashboard example renders assessments, verifying JSON structures remain stable.
196
-
197
- ---
198
-
199
- ### 10. Implementation Checklist
200
-
201
- - [ ] Documentation (product, tech, ops, user).
202
- - [ ] Library creation (\`@lssm/lib.lifecycle\`).
203
- - [ ] Modules (\`lifecycle-core\`, \`lifecycle-advisor\`).
204
- - [ ] Bundle (\`lifecycle-managed\`) + Studio wiring.
205
- - [ ] Library enhancements (analytics/evolution/growth/observability).
206
- - [ ] Examples (CLI + dashboard).
207
- - [ ] Feature flags + telemetry.
208
- - [ ] Automated tests + fixtures.
209
-
210
- Keep this document in sync as modules evolve. When adding new stages or axes, update \`@lssm/lib.lifecycle\` first, then cascade to adapters, then refresh docs + Studio copy.*** End Patch*** End Patch
211
-
212
-
213
- `}];e(t);export{t as tech_lifecycle_stage_system_DocBlocks};
1
+ import { registerDocBlocks } from "../registry.js";
2
+
3
+ //#region src/docs/tech/lifecycle-stage-system.docblock.ts
4
+ const tech_lifecycle_stage_system_DocBlocks = [{
5
+ id: "docs.tech.lifecycle-stage-system",
6
+ title: "ContractSpec Lifecycle Stage System – Technical Design",
7
+ summary: "This document describes how ContractSpec implements lifecycle detection and guidance. It covers architecture, module boundaries, scoring heuristics, and integration points so libraries, modules, bundles, and Studio surfaces stay synchronized.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/tech/lifecycle-stage-system",
11
+ tags: ["tech", "lifecycle-stage-system"],
12
+ body: "## ContractSpec Lifecycle Stage System – Technical Design\n\nThis document describes how ContractSpec implements lifecycle detection and guidance. It covers architecture, module boundaries, scoring heuristics, and integration points so libraries, modules, bundles, and Studio surfaces stay synchronized.\n\n---\n\n### 1. Architecture Overview\n\n```\n┌──────────────────────┐\n│ @lssm/lib.lifecycle │ Types, enums, helpers (pure data)\n└───────────┬──────────┘\n │\n┌───────────▼──────────┐ ┌───────────────────────────┐\n│ modules/lifecycle- │ │ modules/lifecycle-advisor │\n│ core (detection) │ │ (guidance & ceremonies) │\n└───────────┬──────────┘ └───────────┬───────────────┘\n │ │\n ├────────────┬──────────────┤\n ▼ ▼ ▼\n Adapters: analytics, intent, questionnaires\n │\n┌───────────▼──────────┐\n│ bundles/lifecycle- │ Managed service for Studio\n│ managed │ (REST handlers, AI agent) │\n└───────────┬──────────┘\n │\n ContractSpec Studio surfaces\n (web/mobile APIs, CLI, docs)\n```\n\n- **Libraries** provide shared vocabulary.\n- **Modules** encapsulate logic, accepting adapters to avoid environment-specific code.\n- **Bundles** compose modules, register agents/events, and expose APIs for Studio.\n- **Apps** (web-landing, future Studio views) consume bundle APIs; they do not reimplement logic. For web-landing we now resolve `@lssm/bundle.contractspec-studio` and `@lssm/lib.database-contractspec-studio` directly from their `packages/.../src` folders via `tsconfig` path aliases so Prisma stays on the server build and Turbopack no longer pulls the prebundled `dist` artifacts into client chunks.\n\n---\n\n### 2. Core Library (`@lssm/lib.lifecycle`)\n\n- Stage enum (0–6) with metadata (`question`, `signals`, `traps`).\n- Axes types (`ProductPhase`, `CompanyPhase`, `CapitalPhase`).\n- `LifecycleSignal` (source, metric, value, timestamp).\n- `LifecycleMetricSnapshot` (aggregated numbers).\n- `LifecycleMilestone`, `LifecycleAction`, `LifecycleAssessment` interfaces.\n- Utility helpers:\n - `formatStageSummary(stage, assessment)`\n - `rankStageCandidates(scores)`\n\nThe library exports **no runtime dependencies** so it can be imported from apps, modules, and bundles alike.\n\n---\n\n### 3. Lifecycle Core Module\n\n**Location:** `packages/modules/lifecycle-core/`\n\n#### Components\n1. **StageSignalCollector**\n - Accepts adapter interfaces:\n - `AnalyticsAdapter` (pulls metrics from `@lssm/lib.analytics` or fixture streams).\n - `IntentAdapter` (hooks into `@lssm/lib.observability` intent detectors or logs).\n - `QuestionnaireAdapter` (loads JSON questionnaires and responses).\n - Produces normalized `LifecycleSignal[]`.\n\n2. **StageScorer**\n - Weighted scoring model:\n - Base weight per stage (reflecting expected maturity).\n - Feature weights (retention, revenue, team size, qualitative feedback).\n - Confidence computed via variance of contributing signals.\n - Supports pluggable scoring matrices via JSON config.\n - Accepts sparse metric snapshots; the orchestrator sanitizes metrics to numeric-only records before persisting assessments so downstream analytics stay consistent.\n\n3. **LifecycleOrchestrator**\n - Coordinates collectors + scorer.\n - Returns `LifecycleAssessment` with:\n - `stage`, `confidence`, `axisSnapshot`, `signalsUsed`.\n - Recommended focus areas (high-level categories only).\n - Emits events (internally) when stage confidence crosses thresholds (consumed later by bundle).\n\n4. **LifecycleMilestonePlanner**\n - Loads `milestones-catalog.json` (no DB).\n - Filters upcoming milestones per stage + axis.\n - Tracks completion using provided IDs (caller persists).\n\n#### Data Files\n- `configs/stage-weights.json`\n- `configs/milestones-catalog.json`\n- `questionnaires/stage-readiness.json`\n\n#### Extension Hooks\n- All adapters exported as TypeScript interfaces.\n- Implementations for analytics/intent can live in bundles or apps without modifying module code.\n\n---\n\n### 4. Lifecycle Advisor Module\n\n**Location:** `packages/modules/lifecycle-advisor/`\n\n#### Components\n1. **LifecycleRecommendationEngine**\n - Consumes `LifecycleAssessment`.\n - Maps gaps to `LifecycleAction[]` using rule tables (`stage-playbooks.ts`).\n - Supports override hooks for customer-specific rules.\n\n2. **ContractSpecLibraryRecommender**\n - Maintains mapping from stage → recommended libraries/modules/bundles.\n - Returns prioritized list with rationale and adoption prerequisites.\n\n3. **LifecycleCeremonyDesigner**\n - Provides textual/structural data for ceremonies (title, copy, animation cues, soundtrack references).\n - Ensures low-tech friendly instructions (clear copy, undo guidance).\n\n4. **AI Hooks**\n - Defines prompt templates and tool manifests for lifecycle advisor agents (consumed by bundles).\n - Keeps actual LLM integration outside module.\n\n---\n\n### 5. Managed Bundle (`lifecycle-managed`)\n\n**Responsibilities**\n- Wire modules together.\n- Provide HTTP/GraphQL handlers (exact transport optional).\n- Register LifecycleAdvisorAgent via `@lssm/lib.ai-agent`.\n- LifecycleAdvisorAgent meta: domain `operations`, owners `team-lifecycle`, stability `experimental`, tags `guide/lifecycle/ops` so ops tooling can route incidents quickly.\n- Emit lifecycle events through `@lssm/lib.bus` + `@lssm/lib.analytics`.\n- Integrate with `contractspec-studio` packages:\n - Use Studio contracts for authentication/tenant context (without accessing tenant DBs).\n - Store assessments in Studio-managed storage abstractions (in-memory or file-based for now).\n\n**APIs**\n- `POST /lifecycle/assessments`: Accepts metrics + optional questionnaire answers. Returns `LifecycleAssessment`.\n- `GET /lifecycle/playbooks/:stage`: Returns stage playbook + ceremonies.\n- `POST /lifecycle/advise`: Invokes LifecycleAdvisorAgent with context.\n\n**Events**\n- `LifecycleAssessmentCreated`\n- `LifecycleStageChanged`\n- `LifecycleGuidanceConsumed`\n\n---\n\n### 6. Library Enhancements\n\n| Library | Enhancement |\n| --- | --- |\n| `@lssm/lib.analytics` | Lifecycle metric collectors, helper to emit stage events, adapter implementation used by `StageSignalCollector`. |\n| `@lssm/lib.evolution` | Accepts `LifecycleContext` when ranking spec anomalies/suggestions. |\n| `@lssm/lib.growth` | Stage-specific experiment templates + guardrails referencing lifecycle enums. |\n| `@lssm/lib.observability` | Lifecycle KPI pipeline definitions (drift detection, regression alerts). |\n\nEach enhancement must import stage types from `@lssm/lib.lifecycle`.\n\n---\n\n### 7. Feature Flags & Progressive Delivery\n\n- Add new flags in progressive-delivery library:\n - `LIFECYCLE_DETECTION_ALPHA`\n - `LIFECYCLE_ADVISOR_ALPHA`\n - `LIFECYCLE_MANAGED_SERVICE`\n- Bundles/modules should check flags before enabling workflows.\n- Flags referenced in docs + Studio UI to avoid accidental exposure.\n\n---\n\n### 8. Analytics & Telemetry\n\n- Events defined in analytics library; consumed by bundle/app:\n - `lifecycle_assessment_run`\n - `lifecycle_stage_changed`\n - `lifecycle_guidance_consumed`\n- Observability pipeline includes:\n - Composite lifecycle health metric (weighted sum of KPIs).\n - Drift detection comparing stage predictions over time.\n - Alert manager recipes for regression (e.g., PMF drop).\n\n---\n\n### 9. Testing Strategy\n\n1. **Unit**\n - StageScorer weight matrix.\n - RecommendationEngine mapping.\n - Library recommender stage coverage.\n\n2. **Contract**\n - Adapters: ensure mock adapters satisfy interfaces.\n - Bundles: ensure HTTP handlers respect request/response contracts even without persistence.\n\n3. **Integration**\n - CLI example runs detection + guidance end-to-end on fixture data.\n - Dashboard example renders assessments, verifying JSON structures remain stable.\n\n---\n\n### 10. Implementation Checklist\n\n- [ ] Documentation (product, tech, ops, user).\n- [ ] Library creation (`@lssm/lib.lifecycle`).\n- [ ] Modules (`lifecycle-core`, `lifecycle-advisor`).\n- [ ] Bundle (`lifecycle-managed`) + Studio wiring.\n- [ ] Library enhancements (analytics/evolution/growth/observability).\n- [ ] Examples (CLI + dashboard).\n- [ ] Feature flags + telemetry.\n- [ ] Automated tests + fixtures.\n\nKeep this document in sync as modules evolve. When adding new stages or axes, update `@lssm/lib.lifecycle` first, then cascade to adapters, then refresh docs + Studio copy.*** End Patch*** End Patch\n\n\n"
13
+ }];
14
+ registerDocBlocks(tech_lifecycle_stage_system_DocBlocks);
15
+
16
+ //#endregion
17
+ export { tech_lifecycle_stage_system_DocBlocks };
@@ -1,4 +1,22 @@
1
- import{registerDocBlocks as e}from"../../registry.js";const t=[{id:`docs.tech.llm.overview`,title:`LLM Integration Overview`,summary:`Export specs to LLM-friendly formats, generate implementation guides, and verify implementations.`,kind:`reference`,visibility:`public`,route:`/docs/tech/llm/overview`,tags:[`llm`,`ai`,`export`,`guide`,`verify`],body:`# LLM Integration
1
+ import { registerDocBlocks } from "../../registry.js";
2
+
3
+ //#region src/docs/tech/llm/llm-integration.docblock.ts
4
+ const tech_llm_integration_DocBlocks = [
5
+ {
6
+ id: "docs.tech.llm.overview",
7
+ title: "LLM Integration Overview",
8
+ summary: "Export specs to LLM-friendly formats, generate implementation guides, and verify implementations.",
9
+ kind: "reference",
10
+ visibility: "public",
11
+ route: "/docs/tech/llm/overview",
12
+ tags: [
13
+ "llm",
14
+ "ai",
15
+ "export",
16
+ "guide",
17
+ "verify"
18
+ ],
19
+ body: `# LLM Integration
2
20
 
3
21
  ContractSpec provides first-class LLM integration to bridge specifications and AI coding agents.
4
22
 
@@ -86,7 +104,21 @@ const result = await verifyService.verify(mySpec, implementationCode, {
86
104
  tiers: ['structure', 'behavior']
87
105
  });
88
106
  \`\`\`
89
- `},{id:`docs.tech.llm.export-formats`,title:`LLM Export Formats`,summary:`Detailed explanation of the three export formats for LLM consumption.`,kind:`reference`,visibility:`public`,route:`/docs/tech/llm/export-formats`,tags:[`llm`,`export`,`markdown`],body:`# LLM Export Formats
107
+ `
108
+ },
109
+ {
110
+ id: "docs.tech.llm.export-formats",
111
+ title: "LLM Export Formats",
112
+ summary: "Detailed explanation of the three export formats for LLM consumption.",
113
+ kind: "reference",
114
+ visibility: "public",
115
+ route: "/docs/tech/llm/export-formats",
116
+ tags: [
117
+ "llm",
118
+ "export",
119
+ "markdown"
120
+ ],
121
+ body: `# LLM Export Formats
90
122
 
91
123
  ContractSpec provides three export formats optimized for different LLM use cases.
92
124
 
@@ -151,7 +183,23 @@ The prompt format adapts based on task type:
151
183
  - **test**: Test generation for existing code
152
184
  - **refactor**: Refactoring while maintaining behavior
153
185
  - **review**: Code review against spec
154
- `},{id:`docs.tech.llm.agent-adapters`,title:`Agent Adapters`,summary:`Adapters for different AI coding agents (Claude, Cursor, MCP).`,kind:`reference`,visibility:`public`,route:`/docs/tech/llm/agent-adapters`,tags:[`llm`,`agents`,`claude`,`cursor`,`mcp`],body:`# Agent Adapters
186
+ `
187
+ },
188
+ {
189
+ id: "docs.tech.llm.agent-adapters",
190
+ title: "Agent Adapters",
191
+ summary: "Adapters for different AI coding agents (Claude, Cursor, MCP).",
192
+ kind: "reference",
193
+ visibility: "public",
194
+ route: "/docs/tech/llm/agent-adapters",
195
+ tags: [
196
+ "llm",
197
+ "agents",
198
+ "claude",
199
+ "cursor",
200
+ "mcp"
201
+ ],
202
+ body: `# Agent Adapters
155
203
 
156
204
  ContractSpec provides specialized adapters for different AI coding agents.
157
205
 
@@ -208,7 +256,22 @@ The generic adapter is the default and works across all agents.
208
256
  | Claude Code | Complex implementations | Extended thinking, detailed steps |
209
257
  | Cursor CLI | IDE-integrated work | Cursor rules, compact format |
210
258
  | Generic MCP | Any MCP agent | Universal compatibility |
211
- `},{id:`docs.tech.llm.verification`,title:`Implementation Verification`,summary:`Tiered verification of implementations against specifications.`,kind:`reference`,visibility:`public`,route:`/docs/tech/llm/verification`,tags:[`llm`,`verify`,`validation`,`testing`],body:`# Implementation Verification
259
+ `
260
+ },
261
+ {
262
+ id: "docs.tech.llm.verification",
263
+ title: "Implementation Verification",
264
+ summary: "Tiered verification of implementations against specifications.",
265
+ kind: "reference",
266
+ visibility: "public",
267
+ route: "/docs/tech/llm/verification",
268
+ tags: [
269
+ "llm",
270
+ "verify",
271
+ "validation",
272
+ "testing"
273
+ ],
274
+ body: `# Implementation Verification
212
275
 
213
276
  ContractSpec provides tiered verification to check if implementations comply with specs.
214
277
 
@@ -286,4 +349,10 @@ Each issue has:
286
349
  - **category**: type, export, import, scenario, error_handling, semantic
287
350
  - **message**: Description of the issue
288
351
  - **suggestion**: How to fix it
289
- `}];e(t);export{t as tech_llm_integration_DocBlocks};
352
+ `
353
+ }
354
+ ];
355
+ registerDocBlocks(tech_llm_integration_DocBlocks);
356
+
357
+ //#endregion
358
+ export { tech_llm_integration_DocBlocks };
@@ -1 +1,38 @@
1
- import{registerDocBlocks as e}from"../registry.js";const t=[{id:`docs.tech.mcp.endpoints`,title:`ContractSpec MCP endpoints`,summary:`Dedicated MCP servers for docs, CLI usage, and internal development.`,kind:`reference`,visibility:`mixed`,route:`/docs/tech/mcp/endpoints`,tags:[`mcp`,`docs`,`cli`,`internal`],body:"# ContractSpec MCP endpoints\n\nThree dedicated MCP servers keep AI agents efficient and scoped:\n\n- **Docs MCP**: `/api/mcp/docs` — exposes DocBlocks as resources + presentations. Tool: `docs.search`.\n- **CLI MCP**: `/api/mcp/cli` — surfaces CLI quickstart/reference/README and suggests commands. Tool: `cli.suggestCommand`.\n- **Internal MCP**: `/api/mcp/internal` — internal routing hints, playbook, and example registry access. Tool: `internal.describe`.\n\n### Usage notes\n- Transports are HTTP POST (streamable HTTP); SSE is disabled.\n- Resources are namespaced (`docs://*`, `cli://*`, `internal://*`) and are read-only.\n- Internal MCP also exposes the examples registry via `examples://*` resources:\n - `examples://list?q=<query>`\n - `examples://example/<id>`\n- Prompts mirror each surface (navigator, usage, bootstrap) for quick agent onboarding.\n- GraphQL remains at `/graphql`; health at `/health`.\n"}];e(t);export{t as tech_mcp_endpoints_DocBlocks};
1
+ import { registerDocBlocks } from "../registry.js";
2
+
3
+ //#region src/docs/tech/mcp-endpoints.docblock.ts
4
+ const tech_mcp_endpoints_DocBlocks = [{
5
+ id: "docs.tech.mcp.endpoints",
6
+ title: "ContractSpec MCP endpoints",
7
+ summary: "Dedicated MCP servers for docs, CLI usage, and internal development.",
8
+ kind: "reference",
9
+ visibility: "mixed",
10
+ route: "/docs/tech/mcp/endpoints",
11
+ tags: [
12
+ "mcp",
13
+ "docs",
14
+ "cli",
15
+ "internal"
16
+ ],
17
+ body: `# ContractSpec MCP endpoints
18
+
19
+ Three dedicated MCP servers keep AI agents efficient and scoped:
20
+
21
+ - **Docs MCP**: \`/api/mcp/docs\` — exposes DocBlocks as resources + presentations. Tool: \`docs.search\`.
22
+ - **CLI MCP**: \`/api/mcp/cli\` — surfaces CLI quickstart/reference/README and suggests commands. Tool: \`cli.suggestCommand\`.
23
+ - **Internal MCP**: \`/api/mcp/internal\` — internal routing hints, playbook, and example registry access. Tool: \`internal.describe\`.
24
+
25
+ ### Usage notes
26
+ - Transports are HTTP POST (streamable HTTP); SSE is disabled.
27
+ - Resources are namespaced (\`docs://*\`, \`cli://*\`, \`internal://*\`) and are read-only.
28
+ - Internal MCP also exposes the examples registry via \`examples://*\` resources:
29
+ - \`examples://list?q=<query>\`
30
+ - \`examples://example/<id>\`
31
+ - Prompts mirror each surface (navigator, usage, bootstrap) for quick agent onboarding.
32
+ - GraphQL remains at \`/graphql\`; health at \`/health\`.
33
+ `
34
+ }];
35
+ registerDocBlocks(tech_mcp_endpoints_DocBlocks);
36
+
37
+ //#endregion
38
+ export { tech_mcp_endpoints_DocBlocks };
@@ -1 +1,17 @@
1
- import{registerDocBlocks as e}from"../registry.js";const t=[{id:`docs.tech.presentation-runtime`,title:`Presentation Runtime`,summary:`Cross-platform runtime for list pages and presentation flows.`,kind:`reference`,visibility:`public`,route:`/docs/tech/presentation-runtime`,tags:[`tech`,`presentation-runtime`],body:"## Presentation Runtime\n\nCross-platform runtime for list pages and presentation flows.\n\n### Packages\n\n- `@lssm/lib.presentation-runtime-core`: shared types and config helpers\n- `@lssm/lib.presentation-runtime-react`: React hooks (web/native-compatible API)\n- `@lssm/lib.presentation-runtime-react-native`: Native entrypoint (re-exports React API for now)\n\n### Next.js config helper\n\n```ts\n// next.config.mjs\nimport { withPresentationNextAliases } from '@lssm/lib.presentation-runtime-core/next';\n\nconst nextConfig = {\n webpack: (config) => withPresentationNextAliases(config),\n};\n\nexport default nextConfig;\n```\n\n### Metro config helper\n\n```js\n// metro.config.js (CJS)\nconst { getDefaultConfig } = require('expo/metro-config');\nconst {\n withPresentationMetroAliases,\n} = require('@lssm/lib.presentation-runtime-core/src/metro.cjs');\n\nconst projectRoot = __dirname;\nconst config = getDefaultConfig(projectRoot);\n\nmodule.exports = withPresentationMetroAliases(config);\n```\n\n### React hooks\n\n- `useListCoordinator`: URL + RHF + derived variables (no fetching)\n- `usePresentationController`: Same plus `fetcher` integration\n- `DataViewRenderer` (design-system): render `DataViewSpec` projections (`list`, `table`, `detail`, `grid`) using shared UI atoms\n\nBoth accept a `useUrlState` adapter. On web, use `useListUrlState` (design-system) or a Next adapter.\n\n### KYC molecules (bundle)\n\n- `ComplianceBadge` in `@lssm/bundle.strit/presentation/components/kyc` renders a status badge for KYC/compliance snapshots. It accepts a `state` (missing_core | incomplete | complete | expiring | unknown) and optional localized `labels`. Prefer consuming apps to pass translated labels (e.g., via `useT('appPlatformAdmin')`).\n\n### Markdown routes and llms.txt\n\n- Each web app exposes `/llms` (and `/llms.txt`, `/llms.md`) via rewrites. See [llmstxt.org](https://llmstxt.org/).\n- Catch‑all markdown handler lives at `app/[...slug].md/route.ts`. It resolves a page descriptor from `app/.presentations.manifest.json` and renders via the `presentations.v2` engine (target: `markdown`).\n- Per‑page companion convention: add `app/<route>/ai.ts` exporting a `PresentationDescriptorV2`.\n- Build‑time tool: `tools/generate-presentations-manifest.mjs <app-root>` populates the manifest.\n- CI check: `pnpm llms:check` verifies coverage (% of pages with descriptors) and fails if below threshold.\n"}];e(t);export{t as tech_presentation_runtime_DocBlocks};
1
+ import { registerDocBlocks } from "../registry.js";
2
+
3
+ //#region src/docs/tech/presentation-runtime.docblock.ts
4
+ const tech_presentation_runtime_DocBlocks = [{
5
+ id: "docs.tech.presentation-runtime",
6
+ title: "Presentation Runtime",
7
+ summary: "Cross-platform runtime for list pages and presentation flows.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/tech/presentation-runtime",
11
+ tags: ["tech", "presentation-runtime"],
12
+ body: "## Presentation Runtime\n\nCross-platform runtime for list pages and presentation flows.\n\n### Packages\n\n- `@lssm/lib.presentation-runtime-core`: shared types and config helpers\n- `@lssm/lib.presentation-runtime-react`: React hooks (web/native-compatible API)\n- `@lssm/lib.presentation-runtime-react-native`: Native entrypoint (re-exports React API for now)\n\n### Next.js config helper\n\n```ts\n// next.config.mjs\nimport { withPresentationNextAliases } from '@lssm/lib.presentation-runtime-core/next';\n\nconst nextConfig = {\n webpack: (config) => withPresentationNextAliases(config),\n};\n\nexport default nextConfig;\n```\n\n### Metro config helper\n\n```js\n// metro.config.js (CJS)\nconst { getDefaultConfig } = require('expo/metro-config');\nconst {\n withPresentationMetroAliases,\n} = require('@lssm/lib.presentation-runtime-core/src/metro.cjs');\n\nconst projectRoot = __dirname;\nconst config = getDefaultConfig(projectRoot);\n\nmodule.exports = withPresentationMetroAliases(config);\n```\n\n### React hooks\n\n- `useListCoordinator`: URL + RHF + derived variables (no fetching)\n- `usePresentationController`: Same plus `fetcher` integration\n- `DataViewRenderer` (design-system): render `DataViewSpec` projections (`list`, `table`, `detail`, `grid`) using shared UI atoms\n\nBoth accept a `useUrlState` adapter. On web, use `useListUrlState` (design-system) or a Next adapter.\n\n### KYC molecules (bundle)\n\n- `ComplianceBadge` in `@lssm/bundle.strit/presentation/components/kyc` renders a status badge for KYC/compliance snapshots. It accepts a `state` (missing_core | incomplete | complete | expiring | unknown) and optional localized `labels`. Prefer consuming apps to pass translated labels (e.g., via `useT('appPlatformAdmin')`).\n\n### Markdown routes and llms.txt\n\n- Each web app exposes `/llms` (and `/llms.txt`, `/llms.md`) via rewrites. See [llmstxt.org](https://llmstxt.org/).\n- Catch‑all markdown handler lives at `app/[...slug].md/route.ts`. It resolves a page descriptor from `app/.presentations.manifest.json` and renders via the `presentations.v2` engine (target: `markdown`).\n- Per‑page companion convention: add `app/<route>/ai.ts` exporting a `PresentationDescriptorV2`.\n- Build‑time tool: `tools/generate-presentations-manifest.mjs <app-root>` populates the manifest.\n- CI check: `pnpm llms:check` verifies coverage (% of pages with descriptors) and fails if below threshold.\n"
13
+ }];
14
+ registerDocBlocks(tech_presentation_runtime_DocBlocks);
15
+
16
+ //#endregion
17
+ export { tech_presentation_runtime_DocBlocks };