@lssm/example.team-hub 0.0.0-canary-20251217080011 → 1.41.0

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 (166) hide show
  1. package/dist/announcement/announcement.contracts.js +1 -33
  2. package/dist/announcement/announcement.schema.js +1 -74
  3. package/dist/announcement/index.js +1 -4
  4. package/dist/docs/index.js +1 -1
  5. package/dist/docs/team-hub.docblock.js +5 -61
  6. package/dist/entities/index.js +1 -263
  7. package/dist/events.js +1 -162
  8. package/dist/example.js +1 -50
  9. package/dist/handlers/index.js +1 -8
  10. package/dist/index.js +1 -14
  11. package/dist/presentations/index.js +1 -12
  12. package/dist/presentations.js +1 -127
  13. package/dist/ritual/index.js +1 -4
  14. package/dist/ritual/ritual.contracts.js +1 -57
  15. package/dist/ritual/ritual.schema.js +1 -99
  16. package/dist/space/index.js +1 -4
  17. package/dist/space/space.contracts.js +1 -33
  18. package/dist/space/space.schema.js +1 -62
  19. package/dist/task/index.js +1 -4
  20. package/dist/task/task.contracts.js +1 -123
  21. package/dist/task/task.schema.js +1 -95
  22. package/dist/team-hub.feature.js +1 -157
  23. package/package.json +31 -32
  24. package/dist/announcement/announcement.contracts.d.ts +0 -60
  25. package/dist/announcement/announcement.schema.d.ts +0 -63
  26. package/dist/announcement/index.d.ts +0 -3
  27. package/dist/docs/index.d.ts +0 -1
  28. package/dist/docs/team-hub.docblock.d.ts +0 -1
  29. package/dist/entities/index.d.ts +0 -149
  30. package/dist/events.d.ts +0 -288
  31. package/dist/example.d.ts +0 -39
  32. package/dist/handlers/index.d.ts +0 -7
  33. package/dist/index.d.ts +0 -9
  34. package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
  35. package/dist/libs/contracts/dist/client/index.js +0 -5
  36. package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
  37. package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
  38. package/dist/libs/contracts/dist/client/react/index.js +0 -4
  39. package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
  40. package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
  41. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  42. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
  43. package/dist/libs/contracts/dist/docs/index.js +0 -29
  44. package/dist/libs/contracts/dist/docs/presentations.js +0 -71
  45. package/dist/libs/contracts/dist/docs/registry.js +0 -44
  46. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  47. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  48. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  49. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  50. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  51. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
  52. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
  53. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
  54. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
  55. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
  56. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
  57. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
  58. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
  59. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
  60. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
  61. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
  62. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
  63. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
  64. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
  65. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
  66. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
  67. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
  68. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
  69. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
  70. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
  71. package/dist/libs/contracts/dist/events.js +0 -10
  72. package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
  73. package/dist/libs/contracts/dist/index.js +0 -71
  74. package/dist/libs/contracts/dist/install.js +0 -2
  75. package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
  76. package/dist/libs/contracts/dist/integrations/index.js +0 -18
  77. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  78. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  79. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  80. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  81. package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
  82. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
  83. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
  84. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
  85. package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
  86. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
  87. package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
  88. package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
  89. package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
  90. package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
  91. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
  92. package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
  93. package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
  94. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
  95. package/dist/libs/contracts/dist/jsonschema.js +0 -1
  96. package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
  97. package/dist/libs/contracts/dist/knowledge/index.js +0 -7
  98. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
  99. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
  100. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
  101. package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
  102. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
  103. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
  104. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
  105. package/dist/libs/contracts/dist/llm/exporters.js +0 -19
  106. package/dist/libs/contracts/dist/llm/index.js +0 -2
  107. package/dist/libs/contracts/dist/llm/prompts.js +0 -1
  108. package/dist/libs/contracts/dist/onboarding-base.js +0 -196
  109. package/dist/libs/contracts/dist/openapi.js +0 -1
  110. package/dist/libs/contracts/dist/ownership.js +0 -21
  111. package/dist/libs/contracts/dist/presentations.js +0 -1
  112. package/dist/libs/contracts/dist/presentations.v2.js +0 -11
  113. package/dist/libs/contracts/dist/prompt.js +0 -1
  114. package/dist/libs/contracts/dist/promptRegistry.js +0 -1
  115. package/dist/libs/contracts/dist/regenerator/index.js +0 -1
  116. package/dist/libs/contracts/dist/regenerator/service.js +0 -6
  117. package/dist/libs/contracts/dist/registry.js +0 -2
  118. package/dist/libs/contracts/dist/resources.js +0 -1
  119. package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
  120. package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
  121. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  122. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
  123. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  124. package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
  125. package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
  126. package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
  127. package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
  128. package/dist/libs/contracts/dist/server/index.js +0 -8
  129. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
  130. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
  131. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
  132. package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
  133. package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
  134. package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
  135. package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
  136. package/dist/libs/contracts/dist/server/rest-express.js +0 -1
  137. package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
  138. package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
  139. package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
  140. package/dist/libs/contracts/dist/spec.js +0 -34
  141. package/dist/libs/contracts/dist/telemetry/index.js +0 -1
  142. package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
  143. package/dist/libs/contracts/dist/tests/index.js +0 -1
  144. package/dist/libs/contracts/dist/tests/runner.js +0 -2
  145. package/dist/libs/contracts/dist/workflow/index.js +0 -1
  146. package/dist/libs/contracts/dist/workflow/runner.js +0 -1
  147. package/dist/libs/schema/dist/EnumType.js +0 -2
  148. package/dist/libs/schema/dist/FieldType.js +0 -49
  149. package/dist/libs/schema/dist/ScalarTypeEnum.js +0 -236
  150. package/dist/libs/schema/dist/SchemaModel.js +0 -39
  151. package/dist/libs/schema/dist/entity/defineEntity.js +0 -236
  152. package/dist/libs/schema/dist/entity/index.js +0 -2
  153. package/dist/libs/schema/dist/entity/types.js +0 -1
  154. package/dist/libs/schema/dist/index.js +0 -6
  155. package/dist/presentations/index.d.ts +0 -4
  156. package/dist/presentations.d.ts +0 -11
  157. package/dist/ritual/index.d.ts +0 -3
  158. package/dist/ritual/ritual.contracts.d.ts +0 -106
  159. package/dist/ritual/ritual.schema.d.ts +0 -84
  160. package/dist/space/index.d.ts +0 -3
  161. package/dist/space/space.contracts.d.ts +0 -48
  162. package/dist/space/space.schema.d.ts +0 -51
  163. package/dist/task/index.d.ts +0 -3
  164. package/dist/task/task.contracts.d.ts +0 -229
  165. package/dist/task/task.schema.d.ts +0 -80
  166. package/dist/team-hub.feature.d.ts +0 -6
@@ -1,357 +0,0 @@
1
- import { registerDocBlocks } from "../../registry.js";
2
-
3
- //#region ../../libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js
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
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
- registerDocBlocks(tech_llm_integration_DocBlocks);
356
-
357
- //#endregion
@@ -1,37 +0,0 @@
1
- import { registerDocBlocks } from "../registry.js";
2
-
3
- //#region ../../libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js
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
@@ -1,16 +0,0 @@
1
- import { registerDocBlocks } from "../registry.js";
2
-
3
- //#region ../../libs/contracts/dist/docs/tech/presentation-runtime.docblock.js
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
@@ -1,20 +0,0 @@
1
- import { registerDocBlocks } from "../../registry.js";
2
-
3
- //#region ../../libs/contracts/dist/docs/tech/schema/README.docblock.js
4
- const tech_schema_README_DocBlocks = [{
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)\n\nWe adopt Prisma multi‑file schema (GA ≥ v6.7) to organize each database’s models by domain and to import core LSSM module schemas locally.\n\nCanonical layout per DB:\n\n```\nprisma/\n schema/\n main.prisma # datasource + generators only\n imported/\n lssm_sigil/*.prisma # imported models/enums only (no datasource/generator)\n lssm_content/*.prisma # idem\n <domain>/*.prisma # vertical‑specific models split by bounded context\n```\n\nNotes:\n\n- Imported files contain only `model` and `enum` blocks (strip `datasource`/`generator`).\n- 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\"]`.\n- Use `@lssm/app.cli-database` CLI: `database import|check|generate|migrate:*|seed` to manage a single DB; `@lssm/app.cli-databases` orchestrates multiple DBs.\n\n## Typed merger config\n\n- Define imported module list once per DB with a typed config:\n\n```ts\n// prisma-merger.config.ts\nimport { defineMergedPrismaConfig } from '@lssm/app.cli-database';\n\nexport default defineMergedPrismaConfig({\n modules: [\n '@lssm/app.cli-database-sigil',\n '@lssm/app.cli-database-content',\n // ...\n ],\n});\n```\n\n- Then run `database import --target .` (no need to pass `--modules`).\n\n## Prisma Config (prisma.config.ts)\n\nWe use Prisma Config per official docs to point Prisma to the multi-file schema folder and migrations:\n\n```ts\n// prisma.config.ts\nimport path from 'node:path';\nimport { defineConfig } from 'prisma/config';\n\nexport default defineConfig({\n schema: path.join('prisma', 'schema'),\n migrations: { path: path.join('prisma', 'migrations') },\n});\n```\n\nReference: Prisma blog – Organize Your Prisma Schema into Multiple Files: https://www.prisma.io/blog/organize-your-prisma-schema-with-multi-file-support\n\n---\n\n# LSSM Auth (Sigil) – Models & Integration\n\nThis document tracks the identity models and integration points used by the LSSM Sigil module.\n\n## Models (Prisma `lssm_sigil`)\n\n- `User` – core identity with email, optional phone, role, passkeys, apiKeys\n- `Session` – session tokens and metadata; includes `activeOrganizationId`\n- `Account` – external providers (password, OAuth)\n- `Organization` – tenant boundary; includes `type` additional field\n- `Member`, `Invitation`, `Team`, `TeamMember` – org/teams\n- `Role`, `Permission`, `PolicyBinding` – RBAC\n- `ApiKey`, `Passkey` – programmable access and WebAuthn\n- `SsoProvider` – OIDC/SAML provider configuration (org- or user-scoped)\n- `OAuthApplication`, `OAuthAccessToken`, `OAuthConsent` – first/third-party OAuth\n\nThese mirror STRIT additions so Better Auth advanced plugins (admin, organization, apiKey, passkey, genericOAuth) work uniformly across apps.\n\n## Better Auth (server)\n\nEnabled methods:\n\n- Email & password\n- Phone OTP (Telnyx)\n- Passkey (WebAuthn)\n- API keys\n- Organizations & Teams\n- Generic OAuth (FranceConnect+ via OIDC with JWE/JWS using JOSE)\n\nServer config lives at `packages/lssm/modules/sigil/src/application/services/auth.ts`.\n\n## Clients (Expo / React)\n\nClient config lives at `packages/lssm/modules/sigil/src/presentation/providers/auth/expo.ts` with plugins for admin, passkey, apiKey, organization, phone, genericOAuth.\n\n## Environment Variables\n\nTelnyx (phone OTP):\n\n- `TELNYX_API_KEY`\n- `TELNYX_MESSAGING_PROFILE_ID`\n- `TELNYX_FROM_NUMBER`\n\nFranceConnect+ (prefer LSSM*… but STRIT*… fallbacks are supported):\n\n- `LSSM_FRANCECONNECTPLUS_DISCOVERY_URL`\n- `LSSM_FRANCECONNECTPLUS_CLIENT_ID`\n- `LSSM_FRANCECONNECTPLUS_CLIENT_SECRET`\n- `LSSM_FRANCECONNECTPLUS_ENC_PRIVATE_KEY_PEM` (PKCS8; RSA-OAEP-256)\n\nGeneric:\n\n- `API_URL_IDENTITIES` – base URL for Better Auth server\n- `BETTER_AUTH_SECRET` – server secret\n\nKeep this in sync with code changes to avoid drift.\n\n## HCircle domain splits and auth removal\n\n- Auth/identity models are not defined locally anymore. They come from `@lssm/app.cli-database-sigil` under the `lssm_sigil` schema.\n- `packages/hcircle/libs/database-coliving/prisma/schema/domain/` is split by domain; newsletter/waiting list lives in `newsletter.prisma` and uses `@@map(\"waiting_list\")`.\n- To avoid collisions with module names, the local event models were renamed to `SocialEvent`, `SocialEventAttendee`, and `SocialEventRecurrence` with `@@map` pointing to existing table names.\n\n---\n\n## Vertical profiles (current)\n\n### STRIT\n\n- prisma-merger modules:\n - `@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`\n- main.prisma schemas:\n - `schemas = [\"public\",\"lssm_sigil\",\"lssm_content\",\"lssm_ops\",\"lssm_planning\",\"lssm_quill\",\"lssm_geoterro\"]`\n- domain splits (`packages/strit/libs/database/prisma/schema/domain/`):\n - `bookings.prisma` (Booking, StritDocument + links to Content `File` and Sigil `Organization`)\n - `commerce.prisma` (Wholesale models; `sellerId` linked to Sigil `Organization`)\n - `files.prisma` (PublicFile, PublicFileAccessLog; `ownerId`→Organization, `uploadedBy`→User)\n - `geo.prisma` (PublicCountry, PublicAddress, City; links to Spots/Series)\n - `spots.prisma`, `urbanism.prisma`, `analytics.prisma`, `onboarding.prisma`, `referrals.prisma`, `subscriptions.prisma`, `content.prisma`\n- auth models are imported from Sigil (no local auth tables).\n- Back-relations for `Organization` (e.g., `files`, seller relations) are declared in the Sigil module to avoid scattering.\n\n### ARTISANOS\n\n- prisma-merger modules:\n - `@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`\n- main.prisma schemas:\n - `schemas = [\"public\",\"lssm_sigil\",\"lssm_content\",\"lssm_featureflags\",\"lssm_ops\",\"lssm_planning\",\"lssm_quill\",\"lssm_geoterro\"]`\n- domain splits (`packages/artisanos/libs/database-artisan/prisma/schema/domain/`):\n - `sales.prisma` (Client, Quote, QuoteTemplate, Invoice, FollowUps)\n - `subsidies.prisma` (SubsidyProgram, AidApplication, SupportingDocument)\n - `projects.prisma` (Project, ProjectPlanningSettings)\n - `crm.prisma` (OrganizationProfessionalProfile, OrganizationCertification)\n - `professions.prisma`, `products.prisma`, `templates.prisma`, `analytics.prisma`, `onboarding.prisma`, `referrals.prisma`, `subscriptions.prisma`, `files.prisma`\n- auth/organization/team models are provided by Sigil; local legacy copies were removed.\n- Where names collide with Content, local models are prefixed (e.g., `PublicFile`) and use `@@map` to keep existing table names where applicable.\n\n## Schema Dictionary: `@lssm/lib.schema`\n\n### Purpose\n\nDescribe operation I/O once and generate:\n\n- zod (runtime validation)\n- GraphQL (Pothos types/refs)\n- JSON Schema (via `zod-to-json-schema` or native descriptors)\n\n### Primitives\n\n- **FieldType<T>**: describes a scalar or composite field and carries:\n - `zod` schema for validation\n - optional JSON Schema descriptor\n - optional GraphQL scalar reference/name\n- **SchemaModel**: named object model composed of fields. Exposes helpers:\n - `getZod(): z.ZodObject<ZodShapeFromFields<Fields>> | z.ZodArray<z.ZodObject<...>>`\n - Preserves each field's schema, optionality, and array-ness\n - Top-level lists are supported via `config.isArray: true`\n - `getJsonSchema(): JSONSchema7` (export for docs, MCP, forms)\n - `getPothosInput()` (GraphQL input object name)\n\n### Conventions\n\n- Name models with PascalCase; suffix with `Input`/`Result` when ambiguous.\n- Use explicit enums for multi-value constants; reuse the same enum across input/output.\n- Define domain enums via `defineEnum('Name', [...])` in the relevant domain package (e.g., `packages/strit/libs/contracts-strit/src/enums/`), not in `ScalarTypeEnum`.\n- Reference those enums in `SchemaModel` fields directly (they expose `getZod`, `getPothos`, `getJsonSchema`).\n\n#### Example (STRIT)\n\n```ts\n// packages/strit/libs/contracts-strit/src/enums/recurrence.ts\nimport { defineEnum } from '@lssm/lib.schema';\nexport const SpotEnum = {\n Weekday: () =>\n defineEnum('Weekday', ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'] as const),\n RecurrenceFrequency: () =>\n defineEnum('RecurrenceFrequency', [\n 'DAILY',\n 'WEEKLY',\n 'MONTHLY',\n 'YEARLY',\n ] as const),\n} as const;\n```\n\n```ts\n// usage in contracts\nfrequency: { type: SpotEnum.RecurrenceFrequency(), isOptional: false },\nbyWeekday: { type: SpotEnum.Weekday(), isOptional: true, isArray: true },\n```\n\n- Use `Date` type for temporal values and ensure ISO strings in JSON transports where needed.\n\n### Mapping rules (summary)\n\n- Strings → GraphQL `String`\n- Numbers → `Int` if safe 32-bit integer else `Float`\n- Booleans → `Boolean`\n- Dates → custom `Date` scalar\n- Arrays<T> → list of mapped T (set `isArray: true` on the field)\n- Top-level arrays → set `isArray: true` on the model config\n- Objects → input/output object types with stable field order\n- Unions → supported for output; input unions map to JSON (structural input is not supported by GraphQL)\n\n### JSON Schema export\n\nPrefer `getZod()` + `zod-to-json-schema` for consistency. For advanced cases, provide a custom `getJsonSchema()` on the model.\n\n### Example\n\n```ts\nimport { ScalarTypeEnum, SchemaModel } from '@lssm/lib.schema';\n\n// Nested model\nconst Weekday = new SchemaModel({\n name: 'Weekday',\n fields: {\n value: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\n// Parent model with array field and nested object\nconst Rule = new SchemaModel({\n name: 'Rule',\n fields: {\n timezone: { type: ScalarTypeEnum.TimeZone(), isOptional: false },\n byWeekday: { type: Weekday, isOptional: true, isArray: true },\n },\n});\n\nconst CreateThingInput = new SchemaModel({\n name: 'CreateThingInput',\n fields: {\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n rule: { type: Rule, isOptional: false },\n },\n});\n\n// zod\nconst z = CreateThingInput.getZod();\n```\n"
17
- }];
18
- registerDocBlocks(tech_schema_README_DocBlocks);
19
-
20
- //#endregion
@@ -1,48 +0,0 @@
1
- import { registerDocBlocks } from "../../registry.js";
2
-
3
- //#region ../../libs/contracts/dist/docs/tech/studio/learning-events.docblock.js
4
- const tech_studio_learning_events_DocBlocks = [{
5
- id: "docs.tech.studio.learning-events",
6
- title: "Studio Learning Events",
7
- summary: "Studio persists learning/activity events to the database; Sandbox keeps learning local-first and unlogged.",
8
- kind: "reference",
9
- visibility: "public",
10
- route: "/docs/tech/studio/learning-events",
11
- tags: [
12
- "studio",
13
- "learning",
14
- "events",
15
- "analytics",
16
- "sandbox"
17
- ],
18
- body: `# Studio Learning Events
19
-
20
- Studio emits lightweight **learning/activity events** to support onboarding, ambient coaching, and learning journeys.
21
-
22
- ## Persistence model
23
-
24
- - **Studio**: events are persisted to the database in \`StudioLearningEvent\` and are organization-scoped (optionally project-scoped).
25
- - **Sandbox**: events remain **local-only** (unlogged); they must never be sent to backend services.
26
-
27
- ## GraphQL API
28
-
29
- - \`recordLearningEvent(input: { name, projectId?, payload? })\`
30
- - \`myLearningEvents(projectId?, limit?)\`
31
- - \`myOnboardingTracks(productId?, includeProgress?)\`
32
- - \`myOnboardingProgress(trackKey)\`
33
- - \`dismissOnboardingTrack(trackKey)\`
34
-
35
- ## Common event names (convention)
36
-
37
- - \`module.navigated\` — user navigated to a Studio module (payload at minimum: \`{ moduleId }\`).
38
- - \`studio.template.instantiated\` — created a new Studio project (starter template). Payload commonly includes \`{ templateId, projectSlug }\`.
39
- - \`spec.changed\` — created or updated a Studio spec. Payload may include \`{ action: 'create' | 'update', specId?, specType? }\`.
40
- - \`regeneration.completed\` — finished a “regen/deploy” action (currently emitted on successful Studio deploy actions).
41
- - \`studio.evolution.applied\` — completed an Evolution session (payload commonly includes \`{ evolutionSessionId }\`).
42
-
43
- These events are intentionally minimal and must avoid PII/secrets in payloads.
44
- `
45
- }];
46
- registerDocBlocks(tech_studio_learning_events_DocBlocks);
47
-
48
- //#endregion
@@ -1,79 +0,0 @@
1
- import { registerDocBlocks } from "../../registry.js";
2
-
3
- //#region ../../libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js
4
- const tech_studio_learning_journeys_DocBlocks = [{
5
- id: "docs.tech.studio.learning-journeys",
6
- title: "Studio learning journeys (onboarding + coach)",
7
- summary: "DB-backed learning journeys tracked per organization: seeded tracks/steps, event-driven progress, XP/streaks, and a Studio coach surface.",
8
- kind: "reference",
9
- visibility: "public",
10
- route: "/docs/tech/studio/learning-journeys",
11
- tags: [
12
- "studio",
13
- "learning",
14
- "onboarding",
15
- "journey",
16
- "graphql",
17
- "database"
18
- ],
19
- body: `# Studio learning journeys
20
-
21
- Studio supports **DB-backed learning journeys** (onboarding tracks + ambient coach tips) that are advanced by **recorded learning events**.
22
-
23
- > See also: \`/docs/tech/studio/learning-events\` for event naming + payload guardrails.
24
-
25
- ## Scope (multi-tenancy)
26
-
27
- - Progress is tracked **per organization** (tenant/workspace), via a \`Learner\` record keyed by \`(userId, organizationId)\`.
28
- - Learning events are stored as \`StudioLearningEvent\` under the Studio DB schema, scoped to an organization (optionally a project).
29
-
30
- ## Persistence model (Prisma)
31
-
32
- Learning journey progress lives in the \`lssm_learning\` schema:
33
-
34
- - \`Learner\` — one per \`(userId, organizationId)\`
35
- - \`OnboardingTrack\` — seeded track definitions (trackKey, name, metadata)
36
- - \`OnboardingStep\` — seeded step definitions (stepKey, completionCondition, xpReward, metadata)
37
- - \`OnboardingProgress\` — learner × track progress (progress %, xpEarned, completedAt, dismissedAt)
38
- - \`OnboardingStepCompletion\` — append-only completion records (stepKey, status, xpEarned, completedAt)
39
-
40
- ## Track definition source (spec-first)
41
-
42
- - Canonical track specs live in \`@lssm/example.learning-journey-registry\`.
43
- - The Studio API seeds/updates the DB definitions via an idempotent “ensure tracks” routine.
44
- - The DB is kept aligned with track specs (stale steps are removed) to prevent drift and unblock completion.
45
-
46
- ## Progress advancement (event-driven)
47
-
48
- 1) UI records an event via GraphQL \`recordLearningEvent\`
49
- 2) Backend creates \`StudioLearningEvent\`
50
- 3) Backend advances onboarding by matching the new event against step completion conditions
51
- 4) Backend persists step completions and recomputes:
52
- - \`progress\` percentage
53
- - \`xpEarned\` (including streak/completion bonuses when configured)
54
- - track completion state (\`completedAt\`)
55
-
56
- ## GraphQL API (Studio)
57
-
58
- - \`myOnboardingTracks(productId?, includeProgress?)\`
59
- - returns all tracks + optional progress for the current learner
60
- - \`myOnboardingProgress(trackKey)\`
61
- - returns progress + step completion list for a single track
62
- - \`dismissOnboardingTrack(trackKey)\`
63
- - marks a track dismissed for the learner (prevents auto-coach)
64
-
65
- ## UI routes/surfaces (web)
66
-
67
- - \`/studio/learning\` — learning hub (track list + progress widget)
68
- - \`/studio/learning/{trackKey}\` — track detail (steps + map)
69
- - Studio shell mounts a **coach sheet** that can auto-open for incomplete, non-dismissed onboarding.
70
-
71
- ## Security + data hygiene
72
-
73
- - Do not put secrets/PII in \`payload\` fields of learning events.
74
- - Prefer shallow payload filters (small, stable keys).
75
- `
76
- }];
77
- registerDocBlocks(tech_studio_learning_journeys_DocBlocks);
78
-
79
- //#endregion
@@ -1,84 +0,0 @@
1
- import { registerDocBlocks } from "../../registry.js";
2
-
3
- //#region ../../libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js
4
- const tech_studio_platform_admin_panel_DocBlocks = [{
5
- id: "docs.tech.studio.platform-admin-panel",
6
- title: "Studio Platform Admin Panel",
7
- summary: "How PLATFORM_ADMIN organizations manage tenant orgs and integration connections without session switching.",
8
- kind: "reference",
9
- visibility: "public",
10
- route: "/docs/tech/studio/platform-admin-panel",
11
- tags: [
12
- "studio",
13
- "admin",
14
- "multi-tenancy",
15
- "integrations",
16
- "better-auth"
17
- ],
18
- body: `# Studio Platform Admin Panel
19
-
20
- ContractSpec Studio exposes a dedicated **Platform Admin Panel** for users whose **active organization** has:
21
-
22
- - \`Organization.type = PLATFORM_ADMIN\`
23
-
24
- The UI route is:
25
-
26
- - \`/studio/admin\`
27
-
28
- ## Authorization model (no org switching)
29
-
30
- Platform admins **remain in their own organization**. Cross-tenant actions are always explicit and scoped:
31
-
32
- - Admin operations require an explicit \`targetOrganizationId\`.
33
- - No session / activeOrganizationId switching is performed as part of admin operations.
34
-
35
- ## Integrations management
36
-
37
- The admin panel manages the full ContractSpec Integrations system:
38
-
39
- - Lists all shipped \`IntegrationSpec\` entries (registry built via \`createDefaultIntegrationSpecRegistry()\`).
40
- - CRUD \`IntegrationConnection\` records for a selected tenant org.
41
-
42
- ### Secrets (reference-only + write-only)
43
-
44
- The admin UI supports two modes:
45
-
46
- - **Reference-only (BYOK)**: store only \`secretProvider\` + \`secretRef\`.
47
- - **Write-only provisioning/rotation**: paste a raw secret payload; server writes to the selected backend and stores the resulting reference. The secret value is **never returned or displayed**.
48
-
49
- Supported backends:
50
-
51
- - Env overrides (\`env://...\`)
52
- - Google Cloud Secret Manager (\`gcp://...\`)
53
- - AWS Secrets Manager (\`aws://secretsmanager/...\`)
54
- - Scaleway Secret Manager (\`scw://secret-manager/...\`)
55
-
56
- ## Better Auth Admin plugin
57
-
58
- The panel uses the Better Auth **Admin plugin** for user operations (list users, impersonation):
59
-
60
- - Client calls use \`authClient.admin.*\`.
61
- - Server-side, ContractSpec enforces that users in a PLATFORM_ADMIN active org have \`User.role\` containing \`admin\` so Better Auth Admin endpoints authorize.
62
-
63
- ## GraphQL surface
64
-
65
- The platform-admin GraphQL operations are guarded by the active org type and include:
66
-
67
- - \`platformAdminOrganizations(search, limit, offset)\`
68
- - \`platformAdminIntegrationSpecs\`
69
- - \`platformAdminIntegrationConnections(input: { targetOrganizationId, category?, status? })\`
70
- - \`platformAdminIntegrationConnectionCreate(input)\`
71
- - \`platformAdminIntegrationConnectionUpdate(input)\`
72
- - \`platformAdminIntegrationConnectionDelete(targetOrganizationId, connectionId)\`
73
-
74
- ## Key implementation files
75
-
76
- - Auth + role enforcement: \`packages/bundles/contractspec-studio/src/application/services/auth.ts\`
77
- - Admin GraphQL module: \`packages/bundles/contractspec-studio/src/infrastructure/graphql/modules/platform-admin.ts\`
78
- - Integrations admin service: \`packages/bundles/contractspec-studio/src/modules/platform-integrations/index.ts\`
79
- - Web route: \`packages/apps/web-landing/src/app/(app-customer)/studio/admin/*\`
80
- `
81
- }];
82
- registerDocBlocks(tech_studio_platform_admin_panel_DocBlocks);
83
-
84
- //#endregion