@lssm/example.analytics-dashboard 0.0.0-canary-20251217060804 → 0.0.0-canary-20251217062139

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 (138) hide show
  1. package/dist/dashboard/dashboard.contracts.d.ts +131 -131
  2. package/dist/dashboard/dashboard.contracts.js +5 -5
  3. package/dist/dashboard/dashboard.enum.d.ts +4 -4
  4. package/dist/dashboard/dashboard.enum.js +5 -4
  5. package/dist/dashboard/dashboard.schema.d.ts +79 -79
  6. package/dist/dashboard/dashboard.schema.js +44 -42
  7. package/dist/docs/analytics-dashboard.docblock.js +3 -2
  8. package/dist/events.d.ts +40 -40
  9. package/dist/events.js +27 -24
  10. package/dist/index.d.ts +0 -1
  11. package/dist/libs/contracts/dist/capabilities/openbanking.js +84 -0
  12. package/dist/libs/contracts/dist/client/index.js +5 -0
  13. package/dist/libs/contracts/dist/client/react/feature-render.js +2 -0
  14. package/dist/libs/contracts/dist/client/react/form-render.js +4 -0
  15. package/dist/libs/contracts/dist/client/react/index.js +4 -0
  16. package/dist/libs/contracts/dist/contract-registry/index.js +1 -0
  17. package/dist/libs/contracts/dist/contract-registry/schemas.js +57 -0
  18. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +91 -0
  19. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +365 -0
  20. package/dist/libs/contracts/dist/docs/index.js +29 -0
  21. package/dist/libs/contracts/dist/docs/presentations.js +67 -0
  22. package/dist/libs/contracts/dist/docs/registry.js +42 -0
  23. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +398 -0
  24. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +83 -0
  25. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +155 -0
  26. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +101 -0
  27. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -0
  28. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +80 -0
  29. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +57 -0
  30. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +228 -0
  31. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +357 -0
  32. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +21 -0
  33. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -0
  34. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +281 -0
  35. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +22 -0
  36. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +79 -0
  37. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +84 -0
  38. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +57 -0
  39. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +22 -0
  40. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +40 -0
  41. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +86 -0
  42. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +22 -0
  43. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +62 -0
  44. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +155 -0
  45. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -0
  46. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +101 -0
  47. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -0
  48. package/dist/libs/contracts/dist/events.js +9 -0
  49. package/dist/libs/contracts/dist/experiments/evaluator.js +1 -0
  50. package/dist/libs/contracts/dist/index.js +71 -0
  51. package/dist/libs/contracts/dist/install.js +2 -0
  52. package/dist/libs/contracts/dist/integrations/contracts.js +371 -0
  53. package/dist/libs/contracts/dist/integrations/index.js +18 -0
  54. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +225 -0
  55. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +157 -0
  56. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -0
  57. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +208 -0
  58. package/dist/libs/contracts/dist/integrations/openbanking/models.js +240 -0
  59. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +24 -0
  60. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -0
  61. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -0
  62. package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -0
  63. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -0
  64. package/dist/libs/contracts/dist/integrations/providers/index.js +11 -0
  65. package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -0
  66. package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -0
  67. package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -0
  68. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -0
  69. package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -0
  70. package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -0
  71. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -0
  72. package/dist/libs/contracts/dist/jsonschema.js +1 -0
  73. package/dist/libs/contracts/dist/knowledge/contracts.js +299 -0
  74. package/dist/libs/contracts/dist/knowledge/index.js +7 -0
  75. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -0
  76. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -0
  77. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -0
  78. package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -0
  79. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -0
  80. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -0
  81. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -0
  82. package/dist/libs/contracts/dist/llm/exporters.js +18 -0
  83. package/dist/libs/contracts/dist/llm/index.js +2 -0
  84. package/dist/libs/contracts/dist/llm/prompts.js +1 -0
  85. package/dist/libs/contracts/dist/onboarding-base.js +179 -0
  86. package/dist/libs/contracts/dist/openapi.js +1 -0
  87. package/dist/libs/contracts/dist/ownership.js +36 -0
  88. package/dist/libs/contracts/dist/presentations.js +1 -0
  89. package/dist/libs/contracts/dist/presentations.v2.js +7 -0
  90. package/dist/libs/contracts/dist/prompt.js +1 -0
  91. package/dist/libs/contracts/dist/promptRegistry.js +1 -0
  92. package/dist/libs/contracts/dist/regenerator/index.js +1 -0
  93. package/dist/libs/contracts/dist/regenerator/service.js +1 -0
  94. package/dist/libs/contracts/dist/registry.js +2 -0
  95. package/dist/libs/contracts/dist/resources.js +1 -0
  96. package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -0
  97. package/dist/libs/contracts/dist/schema/dist/FieldType.js +39 -0
  98. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +222 -0
  99. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +23 -0
  100. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -0
  101. package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -0
  102. package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -0
  103. package/dist/libs/contracts/dist/schema/dist/index.js +6 -0
  104. package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -0
  105. package/dist/libs/contracts/dist/server/index.js +8 -0
  106. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -0
  107. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -0
  108. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -0
  109. package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -0
  110. package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -0
  111. package/dist/libs/contracts/dist/server/provider-mcp.js +1 -0
  112. package/dist/libs/contracts/dist/server/rest-elysia.js +1 -0
  113. package/dist/libs/contracts/dist/server/rest-express.js +1 -0
  114. package/dist/libs/contracts/dist/server/rest-generic.js +1 -0
  115. package/dist/libs/contracts/dist/server/rest-next-app.js +1 -0
  116. package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -0
  117. package/dist/libs/contracts/dist/spec.js +25 -0
  118. package/dist/libs/contracts/dist/telemetry/index.js +1 -0
  119. package/dist/libs/contracts/dist/telemetry/tracker.js +1 -0
  120. package/dist/libs/contracts/dist/tests/index.js +1 -0
  121. package/dist/libs/contracts/dist/tests/runner.js +2 -0
  122. package/dist/libs/contracts/dist/workflow/index.js +1 -0
  123. package/dist/libs/contracts/dist/workflow/runner.js +1 -0
  124. package/dist/libs/schema/dist/EnumType.js +40 -0
  125. package/dist/libs/schema/dist/FieldType.js +39 -0
  126. package/dist/libs/schema/dist/ScalarTypeEnum.js +222 -0
  127. package/dist/libs/schema/dist/SchemaModel.js +24 -0
  128. package/dist/libs/schema/dist/entity/defineEntity.js +1 -0
  129. package/dist/libs/schema/dist/entity/index.js +2 -0
  130. package/dist/libs/schema/dist/entity/types.js +1 -0
  131. package/dist/libs/schema/dist/index.js +6 -0
  132. package/dist/query/query.contracts.d.ts +45 -45
  133. package/dist/query/query.contracts.js +3 -3
  134. package/dist/query/query.enum.d.ts +2 -2
  135. package/dist/query/query.enum.js +3 -2
  136. package/dist/query/query.schema.d.ts +34 -34
  137. package/dist/query/query.schema.js +34 -32
  138. package/package.json +10 -10
@@ -0,0 +1,357 @@
1
+ import { a } from "../../registry.js";
2
+
3
+ //#region ../../libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js
4
+ const t = [
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
20
+
21
+ ContractSpec provides first-class LLM integration to bridge specifications and AI coding agents.
22
+
23
+ ## Core Features
24
+
25
+ ### 1. Multi-Format Export
26
+
27
+ Export specs to markdown in formats optimized for LLM consumption:
28
+
29
+ - **Context format**: Summary for understanding (goal, context, acceptance criteria)
30
+ - **Full format**: Complete spec with all details (I/O schemas, policy, events)
31
+ - **Prompt format**: Actionable prompt with implementation instructions
32
+
33
+ ### 2. Implementation Guidance
34
+
35
+ Generate agent-specific implementation plans:
36
+
37
+ - **Claude Code**: Extended thinking mode with structured prompts
38
+ - **Cursor CLI**: Background/composer mode with .mdc rules generation
39
+ - **Generic MCP**: Standard format for any MCP-compatible agent
40
+
41
+ ### 3. Tiered Verification
42
+
43
+ Verify implementations against specs:
44
+
45
+ - **Tier 1 (Structure)**: Types, exports, imports validation
46
+ - **Tier 2 (Behavior)**: Scenario coverage, error handling, events
47
+ - **Tier 3 (AI Review)**: Semantic compliance analysis via LLM
48
+
49
+ ## Access Points
50
+
51
+ | Surface | Commands/Tools |
52
+ |---------|---------------|
53
+ | CLI | \`contractspec llm export\`, \`guide\`, \`verify\`, \`copy\` |
54
+ | MCP | \`llm.export\`, \`llm.guide\`, \`llm.verify\` tools |
55
+ | VSCode | Export to LLM, Generate Guide, Verify, Copy commands |
56
+
57
+ ## Quick Start
58
+
59
+ ### CLI Usage
60
+
61
+ \`\`\`bash
62
+ # Export spec as markdown
63
+ contractspec llm export path/to/my.spec.ts --format full
64
+
65
+ # Generate implementation guide
66
+ contractspec llm guide path/to/my.spec.ts --agent claude-code
67
+
68
+ # Verify implementation
69
+ contractspec llm verify path/to/my.spec.ts path/to/impl.ts --tier 2
70
+
71
+ # Copy spec to clipboard
72
+ contractspec llm copy path/to/my.spec.ts --format context
73
+ \`\`\`
74
+
75
+ ### MCP Usage
76
+
77
+ \`\`\`
78
+ # Export spec
79
+ llm.export { specPath: "path/to/my.spec.ts", format: "full" }
80
+
81
+ # Generate guide
82
+ llm.guide { specPath: "path/to/my.spec.ts", agent: "cursor-cli" }
83
+
84
+ # Verify implementation
85
+ llm.verify { specPath: "path/to/my.spec.ts", implementationPath: "path/to/impl.ts", tier: "2" }
86
+ \`\`\`
87
+
88
+ ### Programmatic Usage
89
+
90
+ \`\`\`typescript
91
+ import { specToFullMarkdown, specToAgentPrompt } from '@lssm/lib.contracts/llm';
92
+ import { createAgentGuideService, createVerifyService } from '@lssm/bundle.contractspec-workspace';
93
+
94
+ // Export
95
+ const markdown = specToFullMarkdown(mySpec);
96
+
97
+ // Generate guide
98
+ const guideService = createAgentGuideService({ defaultAgent: 'claude-code' });
99
+ const guide = guideService.generateGuide(mySpec);
100
+
101
+ // Verify
102
+ const verifyService = createVerifyService();
103
+ const result = await verifyService.verify(mySpec, implementationCode, {
104
+ tiers: ['structure', 'behavior']
105
+ });
106
+ \`\`\`
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
122
+
123
+ ContractSpec provides three export formats optimized for different LLM use cases.
124
+
125
+ ## Context Format
126
+
127
+ Best for: Understanding what a spec does, providing background to LLMs.
128
+
129
+ Includes:
130
+ - Spec name, version, type
131
+ - Goal and context
132
+ - Description
133
+ - Acceptance scenarios
134
+
135
+ Example:
136
+
137
+ \`\`\`markdown
138
+ # users.createUser (v1)
139
+
140
+ > Create a new user account with email verification.
141
+
142
+ **Type:** command | **Stability:** stable
143
+
144
+ ## Goal
145
+ Create a new user in the system and trigger email verification.
146
+
147
+ ## Context
148
+ Part of the user onboarding flow. Called after signup form submission.
149
+
150
+ ## Acceptance Criteria
151
+ ### Happy path
152
+ **Given:** Valid email and password
153
+ **When:** User submits registration
154
+ **Then:** Account is created, verification email is sent
155
+ \`\`\`
156
+
157
+ ## Full Format
158
+
159
+ Best for: Complete documentation, implementation reference.
160
+
161
+ Includes everything:
162
+ - All metadata
163
+ - JSON schemas for I/O
164
+ - Error definitions
165
+ - Policy (auth, rate limits, PII)
166
+ - Events emitted
167
+ - Examples
168
+ - Transport configuration
169
+
170
+ ## Prompt Format
171
+
172
+ Best for: Feeding directly to coding agents.
173
+
174
+ Includes:
175
+ - Task header with clear instructions
176
+ - Full spec context
177
+ - Implementation requirements
178
+ - Task-specific guidance (implement/test/refactor/review)
179
+ - Expected output format
180
+
181
+ The prompt format adapts based on task type:
182
+ - **implement**: Full implementation with tests
183
+ - **test**: Test generation for existing code
184
+ - **refactor**: Refactoring while maintaining behavior
185
+ - **review**: Code review against spec
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
203
+
204
+ ContractSpec provides specialized adapters for different AI coding agents.
205
+
206
+ ## Claude Code Adapter
207
+
208
+ Optimized for Anthropic Claude's extended thinking and code generation.
209
+
210
+ Features:
211
+ - Structured markdown with clear sections
212
+ - Checklists for steps and verification
213
+ - Icons for file operations (📝 create, ✏️ modify)
214
+ - System prompt for ContractSpec context
215
+
216
+ Usage:
217
+ \`\`\`typescript
218
+ const guideService = createAgentGuideService({ defaultAgent: 'claude-code' });
219
+ const result = guideService.generateGuide(spec, { agent: 'claude-code' });
220
+ // result.prompt.systemPrompt - Claude system context
221
+ // result.prompt.taskPrompt - Task-specific instructions
222
+ \`\`\`
223
+
224
+ ## Cursor CLI Adapter
225
+
226
+ Optimized for Cursor's background/composer mode.
227
+
228
+ Features:
229
+ - Compact format for context efficiency
230
+ - .mdc cursor rules generation
231
+ - Integration with Cursor's file system
232
+ - Concise step lists
233
+
234
+ Generate Cursor Rules:
235
+ \`\`\`typescript
236
+ const cursorRules = guideService.generateAgentConfig(spec, 'cursor-cli');
237
+ // Save to .cursor/rules/my-spec.mdc
238
+ \`\`\`
239
+
240
+ ## Generic MCP Adapter
241
+
242
+ Works with any MCP-compatible agent (Cline, Aider, etc.).
243
+
244
+ Features:
245
+ - Standard markdown format
246
+ - Table-based metadata
247
+ - JSON resource format support
248
+ - Prompt message format
249
+
250
+ The generic adapter is the default and works across all agents.
251
+
252
+ ## Choosing an Adapter
253
+
254
+ | Agent | Best For | Key Features |
255
+ |-------|----------|--------------|
256
+ | Claude Code | Complex implementations | Extended thinking, detailed steps |
257
+ | Cursor CLI | IDE-integrated work | Cursor rules, compact format |
258
+ | Generic MCP | Any MCP agent | Universal compatibility |
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
275
+
276
+ ContractSpec provides tiered verification to check if implementations comply with specs.
277
+
278
+ ## Verification Tiers
279
+
280
+ ### Tier 1: Structure (Fast)
281
+
282
+ Checks TypeScript structure against spec requirements:
283
+
284
+ | Check | What it validates |
285
+ |-------|------------------|
286
+ | Handler export | Function is properly exported |
287
+ | Contracts import | Imports from @lssm/lib.contracts |
288
+ | Schema import | Imports from @lssm/lib.schema |
289
+ | No \`any\` type | TypeScript strict compliance |
290
+ | Error handling | Error codes are referenced |
291
+ | Event emission | Event patterns exist |
292
+ | Input validation | Validation patterns used |
293
+ | Async patterns | Async/await for commands |
294
+
295
+ ### Tier 2: Behavior (Comprehensive)
296
+
297
+ Checks implementation coverage of spec behaviors:
298
+
299
+ | Check | What it validates |
300
+ |-------|------------------|
301
+ | Scenario coverage | Acceptance scenarios implemented |
302
+ | Example coverage | Example I/O values referenced |
303
+ | Error cases | All error conditions handled |
304
+ | Event conditions | Events emitted correctly |
305
+ | Idempotency | Idempotent patterns (if required) |
306
+
307
+ ### Tier 3: AI Review (Deep)
308
+
309
+ Uses LLM for semantic analysis:
310
+
311
+ - Does the implementation fulfill the spec's intent?
312
+ - Are edge cases properly handled?
313
+ - Is the code quality acceptable?
314
+ - Are there any subtle violations?
315
+
316
+ Requires AI API key configuration.
317
+
318
+ ## Running Verification
319
+
320
+ \`\`\`typescript
321
+ const verifyService = createVerifyService({
322
+ aiApiKey: process.env.ANTHROPIC_API_KEY, // Optional, for Tier 3
323
+ aiProvider: 'anthropic',
324
+ });
325
+
326
+ const result = await verifyService.verify(spec, implementationCode, {
327
+ tiers: ['structure', 'behavior'],
328
+ failFast: false,
329
+ includeSuggestions: true,
330
+ });
331
+
332
+ console.log(result.passed); // true/false
333
+ console.log(result.score); // 0-100
334
+ console.log(result.summary); // Human-readable summary
335
+ \`\`\`
336
+
337
+ ## Verification Report
338
+
339
+ The report includes:
340
+
341
+ - **passed**: Overall compliance
342
+ - **score**: 0-100 score
343
+ - **issues**: Array of problems found
344
+ - **suggestions**: Recommended fixes
345
+ - **coverage**: Metrics on scenario/error/field coverage
346
+
347
+ Each issue has:
348
+ - **severity**: error, warning, or info
349
+ - **category**: type, export, import, scenario, error_handling, semantic
350
+ - **message**: Description of the issue
351
+ - **suggestion**: How to fix it
352
+ `
353
+ }
354
+ ];
355
+ a(t);
356
+
357
+ //#endregion
@@ -0,0 +1,21 @@
1
+ import { a } from "../registry.js";
2
+
3
+ //#region ../../libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js
4
+ const t = [{
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\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"
18
+ }];
19
+ a(t);
20
+
21
+ //#endregion
@@ -0,0 +1,16 @@
1
+ import { a } from "../registry.js";
2
+
3
+ //#region ../../libs/contracts/dist/docs/tech/presentation-runtime.docblock.js
4
+ const t = [{
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
+ a(t);
15
+
16
+ //#endregion
@@ -0,0 +1,281 @@
1
+ import { a } from "../../registry.js";
2
+
3
+ //#region ../../libs/contracts/dist/docs/tech/schema/README.docblock.js
4
+ const t = [{
5
+ id: `docs.tech.schema.README`,
6
+ title: `Multi‑File Prisma Schema Conventions (per database)`,
7
+ summary: `We adopt Prisma multi‑file schema (GA ≥ v6.7) to organize each database’s models by domain and to import core LSSM module schemas locally.`,
8
+ kind: `reference`,
9
+ visibility: `public`,
10
+ route: `/docs/tech/schema/README`,
11
+ tags: [
12
+ `tech`,
13
+ `schema`,
14
+ `README`
15
+ ],
16
+ body: `# Multi‑File Prisma Schema Conventions (per database)
17
+
18
+ We adopt Prisma multi‑file schema (GA ≥ v6.7) to organize each database’s models by domain and to import core LSSM module schemas locally.
19
+
20
+ Canonical layout per DB:
21
+
22
+ \`\`\`
23
+ prisma/
24
+ schema/
25
+ main.prisma # datasource + generators only
26
+ imported/
27
+ lssm_sigil/*.prisma # imported models/enums only (no datasource/generator)
28
+ lssm_content/*.prisma # idem
29
+ <domain>/*.prisma # vertical‑specific models split by bounded context
30
+ \`\`\`
31
+
32
+ Notes:
33
+
34
+ - Imported files contain only \`model\` and \`enum\` blocks (strip \`datasource\`/\`generator\`).
35
+ - Preserve \`@@schema("…")\` annotations to keep tables in their Postgres schemas; we now explicitly list schemas in \`main.prisma\` to avoid P1012: \`schemas = ["public","lssm_sigil","lssm_content","lssm_featureflags","lssm_ops","lssm_planning","lssm_quill","lssm_geoterro"]\`.
36
+ - Use \`@lssm/app.cli-database\` CLI: \`database import|check|generate|migrate:*|seed\` to manage a single DB; \`@lssm/app.cli-databases\` orchestrates multiple DBs.
37
+
38
+ ## Typed merger config
39
+
40
+ - Define imported module list once per DB with a typed config:
41
+
42
+ \`\`\`ts
43
+ // prisma-merger.config.ts
44
+ import { defineMergedPrismaConfig } from '@lssm/app.cli-database';
45
+
46
+ export default defineMergedPrismaConfig({
47
+ modules: [
48
+ '@lssm/app.cli-database-sigil',
49
+ '@lssm/app.cli-database-content',
50
+ // ...
51
+ ],
52
+ });
53
+ \`\`\`
54
+
55
+ - Then run \`database import --target .\` (no need to pass \`--modules\`).
56
+
57
+ ## Prisma Config (prisma.config.ts)
58
+
59
+ We use Prisma Config per official docs to point Prisma to the multi-file schema folder and migrations:
60
+
61
+ \`\`\`ts
62
+ // prisma.config.ts
63
+ import path from 'node:path';
64
+ import { defineConfig } from 'prisma/config';
65
+
66
+ export default defineConfig({
67
+ schema: path.join('prisma', 'schema'),
68
+ migrations: { path: path.join('prisma', 'migrations') },
69
+ });
70
+ \`\`\`
71
+
72
+ Reference: Prisma blog – Organize Your Prisma Schema into Multiple Files: https://www.prisma.io/blog/organize-your-prisma-schema-with-multi-file-support
73
+
74
+ ---
75
+
76
+ # LSSM Auth (Sigil) – Models & Integration
77
+
78
+ This document tracks the identity models and integration points used by the LSSM Sigil module.
79
+
80
+ ## Models (Prisma \`lssm_sigil\`)
81
+
82
+ - \`User\` – core identity with email, optional phone, role, passkeys, apiKeys
83
+ - \`Session\` – session tokens and metadata; includes \`activeOrganizationId\`
84
+ - \`Account\` – external providers (password, OAuth)
85
+ - \`Organization\` – tenant boundary; includes \`type\` additional field
86
+ - \`Member\`, \`Invitation\`, \`Team\`, \`TeamMember\` – org/teams
87
+ - \`Role\`, \`Permission\`, \`PolicyBinding\` – RBAC
88
+ - \`ApiKey\`, \`Passkey\` – programmable access and WebAuthn
89
+ - \`SsoProvider\` – OIDC/SAML provider configuration (org- or user-scoped)
90
+ - \`OAuthApplication\`, \`OAuthAccessToken\`, \`OAuthConsent\` – first/third-party OAuth
91
+
92
+ These mirror STRIT additions so Better Auth advanced plugins (admin, organization, apiKey, passkey, genericOAuth) work uniformly across apps.
93
+
94
+ ## Better Auth (server)
95
+
96
+ Enabled methods:
97
+
98
+ - Email & password
99
+ - Phone OTP (Telnyx)
100
+ - Passkey (WebAuthn)
101
+ - API keys
102
+ - Organizations & Teams
103
+ - Generic OAuth (FranceConnect+ via OIDC with JWE/JWS using JOSE)
104
+
105
+ Server config lives at \`packages/lssm/modules/sigil/src/application/services/auth.ts\`.
106
+
107
+ ## Clients (Expo / React)
108
+
109
+ Client config lives at \`packages/lssm/modules/sigil/src/presentation/providers/auth/expo.ts\` with plugins for admin, passkey, apiKey, organization, phone, genericOAuth.
110
+
111
+ ## Environment Variables
112
+
113
+ Telnyx (phone OTP):
114
+
115
+ - \`TELNYX_API_KEY\`
116
+ - \`TELNYX_MESSAGING_PROFILE_ID\`
117
+ - \`TELNYX_FROM_NUMBER\`
118
+
119
+ FranceConnect+ (prefer LSSM*… but STRIT*… fallbacks are supported):
120
+
121
+ - \`LSSM_FRANCECONNECTPLUS_DISCOVERY_URL\`
122
+ - \`LSSM_FRANCECONNECTPLUS_CLIENT_ID\`
123
+ - \`LSSM_FRANCECONNECTPLUS_CLIENT_SECRET\`
124
+ - \`LSSM_FRANCECONNECTPLUS_ENC_PRIVATE_KEY_PEM\` (PKCS8; RSA-OAEP-256)
125
+
126
+ Generic:
127
+
128
+ - \`API_URL_IDENTITIES\` – base URL for Better Auth server
129
+ - \`BETTER_AUTH_SECRET\` – server secret
130
+
131
+ Keep this in sync with code changes to avoid drift.
132
+
133
+ ## HCircle domain splits and auth removal
134
+
135
+ - Auth/identity models are not defined locally anymore. They come from \`@lssm/app.cli-database-sigil\` under the \`lssm_sigil\` schema.
136
+ - \`packages/hcircle/libs/database-coliving/prisma/schema/domain/\` is split by domain; newsletter/waiting list lives in \`newsletter.prisma\` and uses \`@@map("waiting_list")\`.
137
+ - To avoid collisions with module names, the local event models were renamed to \`SocialEvent\`, \`SocialEventAttendee\`, and \`SocialEventRecurrence\` with \`@@map\` pointing to existing table names.
138
+
139
+ ---
140
+
141
+ ## Vertical profiles (current)
142
+
143
+ ### STRIT
144
+
145
+ - prisma-merger modules:
146
+ - \`@lssm/app.cli-database-sigil\`, \`@lssm/app.cli-database-content\`, \`@lssm/app.cli-database-ops\`, \`@lssm/app.cli-database-planning\`, \`@lssm/app.cli-database-quill\`, \`@lssm/app.cli-database-geoterro\`
147
+ - main.prisma schemas:
148
+ - \`schemas = ["public","lssm_sigil","lssm_content","lssm_ops","lssm_planning","lssm_quill","lssm_geoterro"]\`
149
+ - domain splits (\`packages/strit/libs/database/prisma/schema/domain/\`):
150
+ - \`bookings.prisma\` (Booking, StritDocument + links to Content \`File\` and Sigil \`Organization\`)
151
+ - \`commerce.prisma\` (Wholesale models; \`sellerId\` linked to Sigil \`Organization\`)
152
+ - \`files.prisma\` (PublicFile, PublicFileAccessLog; \`ownerId\`→Organization, \`uploadedBy\`→User)
153
+ - \`geo.prisma\` (PublicCountry, PublicAddress, City; links to Spots/Series)
154
+ - \`spots.prisma\`, \`urbanism.prisma\`, \`analytics.prisma\`, \`onboarding.prisma\`, \`referrals.prisma\`, \`subscriptions.prisma\`, \`content.prisma\`
155
+ - auth models are imported from Sigil (no local auth tables).
156
+ - Back-relations for \`Organization\` (e.g., \`files\`, seller relations) are declared in the Sigil module to avoid scattering.
157
+
158
+ ### ARTISANOS
159
+
160
+ - prisma-merger modules:
161
+ - \`@lssm/app.cli-database-sigil\`, \`@lssm/app.cli-database-content\`, \`@lssm/app.cli-database-featureflags\`, \`@lssm/app.cli-database-ops\`, \`@lssm/app.cli-database-planning\`, \`@lssm/app.cli-database-quill\`, \`@lssm/app.cli-database-geoterro\`
162
+ - main.prisma schemas:
163
+ - \`schemas = ["public","lssm_sigil","lssm_content","lssm_featureflags","lssm_ops","lssm_planning","lssm_quill","lssm_geoterro"]\`
164
+ - domain splits (\`packages/artisanos/libs/database-artisan/prisma/schema/domain/\`):
165
+ - \`sales.prisma\` (Client, Quote, QuoteTemplate, Invoice, FollowUps)
166
+ - \`subsidies.prisma\` (SubsidyProgram, AidApplication, SupportingDocument)
167
+ - \`projects.prisma\` (Project, ProjectPlanningSettings)
168
+ - \`crm.prisma\` (OrganizationProfessionalProfile, OrganizationCertification)
169
+ - \`professions.prisma\`, \`products.prisma\`, \`templates.prisma\`, \`analytics.prisma\`, \`onboarding.prisma\`, \`referrals.prisma\`, \`subscriptions.prisma\`, \`files.prisma\`
170
+ - auth/organization/team models are provided by Sigil; local legacy copies were removed.
171
+ - Where names collide with Content, local models are prefixed (e.g., \`PublicFile\`) and use \`@@map\` to keep existing table names where applicable.
172
+
173
+ ## Schema Dictionary: \`@lssm/lib.schema\`
174
+
175
+ ### Purpose
176
+
177
+ Describe operation I/O once and generate:
178
+
179
+ - zod (runtime validation)
180
+ - GraphQL (Pothos types/refs)
181
+ - JSON Schema (via \`zod-to-json-schema\` or native descriptors)
182
+
183
+ ### Primitives
184
+
185
+ - **FieldType<T>**: describes a scalar or composite field and carries:
186
+ - \`zod\` schema for validation
187
+ - optional JSON Schema descriptor
188
+ - optional GraphQL scalar reference/name
189
+ - **SchemaModel**: named object model composed of fields. Exposes helpers:
190
+ - \`getZod(): z.ZodObject<ZodShapeFromFields<Fields>> | z.ZodArray<z.ZodObject<...>>\`
191
+ - Preserves each field's schema, optionality, and array-ness
192
+ - Top-level lists are supported via \`config.isArray: true\`
193
+ - \`getJsonSchema(): JSONSchema7\` (export for docs, MCP, forms)
194
+ - \`getPothosInput()\` (GraphQL input object name)
195
+
196
+ ### Conventions
197
+
198
+ - Name models with PascalCase; suffix with \`Input\`/\`Result\` when ambiguous.
199
+ - Use explicit enums for multi-value constants; reuse the same enum across input/output.
200
+ - Define domain enums via \`defineEnum('Name', [...])\` in the relevant domain package (e.g., \`packages/strit/libs/contracts-strit/src/enums/\`), not in \`ScalarTypeEnum\`.
201
+ - Reference those enums in \`SchemaModel\` fields directly (they expose \`getZod\`, \`getPothos\`, \`getJsonSchema\`).
202
+
203
+ #### Example (STRIT)
204
+
205
+ \`\`\`ts
206
+ // packages/strit/libs/contracts-strit/src/enums/recurrence.ts
207
+ import { defineEnum } from '@lssm/lib.schema';
208
+ export const SpotEnum = {
209
+ Weekday: () =>
210
+ defineEnum('Weekday', ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'] as const),
211
+ RecurrenceFrequency: () =>
212
+ defineEnum('RecurrenceFrequency', [
213
+ 'DAILY',
214
+ 'WEEKLY',
215
+ 'MONTHLY',
216
+ 'YEARLY',
217
+ ] as const),
218
+ } as const;
219
+ \`\`\`
220
+
221
+ \`\`\`ts
222
+ // usage in contracts
223
+ frequency: { type: SpotEnum.RecurrenceFrequency(), isOptional: false },
224
+ byWeekday: { type: SpotEnum.Weekday(), isOptional: true, isArray: true },
225
+ \`\`\`
226
+
227
+ - Use \`Date\` type for temporal values and ensure ISO strings in JSON transports where needed.
228
+
229
+ ### Mapping rules (summary)
230
+
231
+ - Strings → GraphQL \`String\`
232
+ - Numbers → \`Int\` if safe 32-bit integer else \`Float\`
233
+ - Booleans → \`Boolean\`
234
+ - Dates → custom \`Date\` scalar
235
+ - Arrays<T> → list of mapped T (set \`isArray: true\` on the field)
236
+ - Top-level arrays → set \`isArray: true\` on the model config
237
+ - Objects → input/output object types with stable field order
238
+ - Unions → supported for output; input unions map to JSON (structural input is not supported by GraphQL)
239
+
240
+ ### JSON Schema export
241
+
242
+ Prefer \`getZod()\` + \`zod-to-json-schema\` for consistency. For advanced cases, provide a custom \`getJsonSchema()\` on the model.
243
+
244
+ ### Example
245
+
246
+ \`\`\`ts
247
+ import { ScalarTypeEnum, SchemaModel } from '@lssm/lib.schema';
248
+
249
+ // Nested model
250
+ const Weekday = new SchemaModel({
251
+ name: 'Weekday',
252
+ fields: {
253
+ value: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
254
+ },
255
+ });
256
+
257
+ // Parent model with array field and nested object
258
+ const Rule = new SchemaModel({
259
+ name: 'Rule',
260
+ fields: {
261
+ timezone: { type: ScalarTypeEnum.TimeZone(), isOptional: false },
262
+ byWeekday: { type: Weekday, isOptional: true, isArray: true },
263
+ },
264
+ });
265
+
266
+ const CreateThingInput = new SchemaModel({
267
+ name: 'CreateThingInput',
268
+ fields: {
269
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
270
+ rule: { type: Rule, isOptional: false },
271
+ },
272
+ });
273
+
274
+ // zod
275
+ const z = CreateThingInput.getZod();
276
+ \`\`\`
277
+ `
278
+ }];
279
+ a(t);
280
+
281
+ //#endregion