@lssm/example.learning-journey-studio-onboarding 0.0.0-canary-20251217062139 → 0.0.0-canary-20251217060834
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$bundle.log +28 -185
- package/.turbo/turbo-build.log +29 -22
- package/CHANGELOG.md +4 -4
- package/dist/contracts/index.js +1 -1
- package/dist/docs/studio-onboarding.docblock.js +1 -1
- package/package.json +6 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -1
- package/dist/libs/contracts/dist/client/index.js +0 -1
- package/dist/libs/contracts/dist/client/react/feature-render.js +0 -1
- package/dist/libs/contracts/dist/client/react/form-render.js +0 -1
- package/dist/libs/contracts/dist/client/react/index.js +0 -1
- package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -1
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -76
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -350
- package/dist/libs/contracts/dist/docs/index.js +0 -1
- package/dist/libs/contracts/dist/docs/presentations.js +0 -1
- package/dist/libs/contracts/dist/docs/registry.js +0 -1
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -383
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -68
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -140
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -86
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -1
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -58
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -38
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -213
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -289
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -1
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -1
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -262
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -57
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -63
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -36
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -65
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -41
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -122
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -1
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -68
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -1
- package/dist/libs/contracts/dist/events.js +0 -1
- package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/libs/contracts/dist/index.js +0 -1
- package/dist/libs/contracts/dist/install.js +0 -1
- package/dist/libs/contracts/dist/integrations/contracts.js +0 -1
- package/dist/libs/contracts/dist/integrations/index.js +0 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -1
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -1
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/index.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -1
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -1
- package/dist/libs/contracts/dist/jsonschema.js +0 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js +0 -1
- package/dist/libs/contracts/dist/knowledge/index.js +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -1
- package/dist/libs/contracts/dist/llm/exporters.js +0 -1
- package/dist/libs/contracts/dist/llm/index.js +0 -1
- package/dist/libs/contracts/dist/llm/prompts.js +0 -1
- package/dist/libs/contracts/dist/onboarding-base.js +0 -1
- package/dist/libs/contracts/dist/openapi.js +0 -1
- package/dist/libs/contracts/dist/ownership.js +0 -1
- package/dist/libs/contracts/dist/presentations.js +0 -1
- package/dist/libs/contracts/dist/presentations.v2.js +0 -1
- package/dist/libs/contracts/dist/prompt.js +0 -1
- package/dist/libs/contracts/dist/promptRegistry.js +0 -1
- package/dist/libs/contracts/dist/regenerator/index.js +0 -1
- package/dist/libs/contracts/dist/regenerator/service.js +0 -1
- package/dist/libs/contracts/dist/registry.js +0 -1
- package/dist/libs/contracts/dist/resources.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +0 -1
- package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -1
- package/dist/libs/contracts/dist/server/index.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/libs/contracts/dist/server/rest-express.js +0 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/libs/contracts/dist/spec.js +0 -1
- package/dist/libs/contracts/dist/telemetry/index.js +0 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/libs/contracts/dist/tests/index.js +0 -1
- package/dist/libs/contracts/dist/tests/runner.js +0 -1
- package/dist/libs/contracts/dist/workflow/index.js +0 -1
- package/dist/libs/contracts/dist/workflow/runner.js +0 -1
- package/dist/libs/schema/dist/EnumType.js +0 -1
- package/dist/libs/schema/dist/FieldType.js +0 -1
- package/dist/libs/schema/dist/ScalarTypeEnum.js +0 -1
- package/dist/libs/schema/dist/SchemaModel.js +0 -1
- package/dist/libs/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/schema/dist/entity/index.js +0 -1
- package/dist/libs/schema/dist/entity/types.js +0 -1
- package/dist/libs/schema/dist/index.js +0 -1
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import{a as e}from"../../registry.js";e([{id:`docs.tech.auth.better-auth-nextjs`,title:`Better Auth + Next.js integration (ContractSpec)`,summary:`How ContractSpec wires Better Auth into Next.js (server config, client singleton, and proxy cookie-only redirects).`,kind:`reference`,visibility:`public`,route:`/docs/tech/auth/better-auth-nextjs`,tags:[`auth`,`better-auth`,`nextjs`,`cookies`,`proxy`,`hmr`],body:`# Better Auth + Next.js integration (ContractSpec)
|
|
2
|
-
|
|
3
|
-
This repo uses Better Auth as the primary auth layer (sessions, organizations, teams, API keys, and OAuth).
|
|
4
|
-
|
|
5
|
-
## Server config (Better Auth)
|
|
6
|
-
|
|
7
|
-
- Source: \`packages/bundles/contractspec-studio/src/application/services/auth.ts\`
|
|
8
|
-
- Important: \`nextCookies()\` must be the **last** plugin in the Better Auth plugin list so \`Set-Cookie\` is applied correctly in Next.js environments.
|
|
9
|
-
|
|
10
|
-
## Better Auth Admin plugin
|
|
11
|
-
|
|
12
|
-
ContractSpec Studio enables the Better Auth **Admin plugin** to support platform-admin user operations (list users, impersonation, etc.).
|
|
13
|
-
|
|
14
|
-
- Server: \`admin()\` plugin in \`packages/bundles/contractspec-studio/src/application/services/auth.ts\`
|
|
15
|
-
- Client: \`adminClient()\` in \`packages/bundles/contractspec-studio/src/presentation/providers/auth/client.ts\`
|
|
16
|
-
|
|
17
|
-
### PLATFORM_ADMIN ⇒ Better Auth admin role
|
|
18
|
-
|
|
19
|
-
Better Auth Admin endpoints authorize via \`user.role\`. ContractSpec enforces an org-driven rule:
|
|
20
|
-
|
|
21
|
-
- If the **active organization** has \`type = PLATFORM_ADMIN\`, the signed-in user is ensured to have \`User.role\` containing \`admin\`.
|
|
22
|
-
- This is applied in the session creation hook and re-checked in \`assertsPlatformAdmin()\`.
|
|
23
|
-
|
|
24
|
-
This keeps admin enablement deterministic and avoids manual role backfills.
|
|
25
|
-
|
|
26
|
-
## Client config (React web + Expo)
|
|
27
|
-
|
|
28
|
-
To avoid duplicate background refresh/polling loops in dev (Fast Refresh/HMR), the Better Auth client is implemented as a singleton cached on \`globalThis\`.
|
|
29
|
-
|
|
30
|
-
- Web client: \`packages/bundles/contractspec-studio/src/presentation/providers/auth/client.ts\`
|
|
31
|
-
- Native client: \`packages/bundles/contractspec-studio/src/presentation/providers/auth/client.native.ts\`
|
|
32
|
-
|
|
33
|
-
Import guidance:
|
|
34
|
-
|
|
35
|
-
- If you only need the context/hook, prefer importing from \`@lssm/bundle.contractspec-studio/presentation/providers/auth\`.
|
|
36
|
-
- If you explicitly need the Better Auth client instance (e.g. admin impersonation, direct API calls), import from \`@lssm/bundle.contractspec-studio/presentation/providers/auth/client\`.
|
|
37
|
-
|
|
38
|
-
## Public routes (login / signup)
|
|
39
|
-
|
|
40
|
-
Public auth pages should avoid eager \`authClient\` initialization.
|
|
41
|
-
|
|
42
|
-
Pattern used:
|
|
43
|
-
|
|
44
|
-
- In the submit handler, dynamically import \`@lssm/bundle.contractspec-studio/presentation/providers/auth/index.web\` and call \`authClient.signIn.*\` / \`authClient.signUp.*\`.
|
|
45
|
-
|
|
46
|
-
This prevents session refresh behavior from starting just because a public page rendered.
|
|
47
|
-
|
|
48
|
-
## Next.js proxy auth (web-landing)
|
|
49
|
-
|
|
50
|
-
The Next.js proxy/middleware is used for **redirect decisions only**. It must not perform DB-backed session reads on every request.
|
|
51
|
-
|
|
52
|
-
- Source: \`packages/apps/web-landing/src/proxy.ts\`
|
|
53
|
-
- Approach: cookie-only checks via Better Auth cookies helpers:
|
|
54
|
-
- \`getSessionCookie(request)\`
|
|
55
|
-
- \`getCookieCache(request)\`
|
|
56
|
-
|
|
57
|
-
These checks are intentionally optimistic and should only gate routing. Full authorization must still be enforced on server-side actions/routes and GraphQL resolvers.
|
|
58
|
-
`}]);
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import{a as e}from"../../registry.js";e([{id:`docs.tech.contracts.openapi-export`,title:`OpenAPI export (OpenAPI 3.1) from SpecRegistry`,summary:`Generate a deterministic OpenAPI document from a SpecRegistry using jsonSchemaForSpec + REST transport metadata.`,kind:`reference`,visibility:`public`,route:`/docs/tech/contracts/openapi-export`,tags:[`contracts`,`openapi`,`rest`],body:`## OpenAPI export (OpenAPI 3.1) from SpecRegistry
|
|
2
|
-
|
|
3
|
-
### Purpose
|
|
4
|
-
|
|
5
|
-
ContractSpec specs can be exported into an **OpenAPI 3.1** document for tooling (SDK generation, docs, gateways).
|
|
6
|
-
|
|
7
|
-
The export is **spec-first**:
|
|
8
|
-
|
|
9
|
-
- Uses \`jsonSchemaForSpec(spec)\` for input/output JSON Schema (from SchemaModel → zod → JSON Schema)
|
|
10
|
-
- Uses \`spec.transport.rest.method/path\` when present
|
|
11
|
-
- Falls back to deterministic defaults:
|
|
12
|
-
- Method: \`POST\` for commands, \`GET\` for queries
|
|
13
|
-
- Path: \`defaultRestPath(name, version)\` → \`/<dot/name>/v<version>\`
|
|
14
|
-
|
|
15
|
-
### Library API
|
|
16
|
-
|
|
17
|
-
- Function: \`openApiForRegistry(registry, options?)\`
|
|
18
|
-
- Location: \`@lssm/lib.contracts/openapi\`
|
|
19
|
-
|
|
20
|
-
### CLI
|
|
21
|
-
|
|
22
|
-
Export OpenAPI from a registry module:
|
|
23
|
-
|
|
24
|
-
\`\`\`bash
|
|
25
|
-
contractspec openapi --registry ./src/registry.ts --out ./openapi.json
|
|
26
|
-
\`\`\`
|
|
27
|
-
|
|
28
|
-
The registry module must export one of:
|
|
29
|
-
|
|
30
|
-
- \`registry: SpecRegistry\`
|
|
31
|
-
- \`default(): SpecRegistry | Promise<SpecRegistry>\`
|
|
32
|
-
- \`createRegistry(): SpecRegistry | Promise<SpecRegistry>\`
|
|
33
|
-
|
|
34
|
-
### Notes / limitations (current)
|
|
35
|
-
|
|
36
|
-
- Responses are generated as a basic \`200\` response (plus schemas when available).
|
|
37
|
-
- Query (GET) inputs are currently represented as a JSON request body when an input schema exists.
|
|
38
|
-
- Errors are not yet expanded into OpenAPI responses; that will be added when we standardize error envelopes.`}]);
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import{a as e}from"../registry.js";e([{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
|
-
`}]);
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import{a as e}from"../../registry.js";e([{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
|
|
2
|
-
|
|
3
|
-
ContractSpec provides first-class LLM integration to bridge specifications and AI coding agents.
|
|
4
|
-
|
|
5
|
-
## Core Features
|
|
6
|
-
|
|
7
|
-
### 1. Multi-Format Export
|
|
8
|
-
|
|
9
|
-
Export specs to markdown in formats optimized for LLM consumption:
|
|
10
|
-
|
|
11
|
-
- **Context format**: Summary for understanding (goal, context, acceptance criteria)
|
|
12
|
-
- **Full format**: Complete spec with all details (I/O schemas, policy, events)
|
|
13
|
-
- **Prompt format**: Actionable prompt with implementation instructions
|
|
14
|
-
|
|
15
|
-
### 2. Implementation Guidance
|
|
16
|
-
|
|
17
|
-
Generate agent-specific implementation plans:
|
|
18
|
-
|
|
19
|
-
- **Claude Code**: Extended thinking mode with structured prompts
|
|
20
|
-
- **Cursor CLI**: Background/composer mode with .mdc rules generation
|
|
21
|
-
- **Generic MCP**: Standard format for any MCP-compatible agent
|
|
22
|
-
|
|
23
|
-
### 3. Tiered Verification
|
|
24
|
-
|
|
25
|
-
Verify implementations against specs:
|
|
26
|
-
|
|
27
|
-
- **Tier 1 (Structure)**: Types, exports, imports validation
|
|
28
|
-
- **Tier 2 (Behavior)**: Scenario coverage, error handling, events
|
|
29
|
-
- **Tier 3 (AI Review)**: Semantic compliance analysis via LLM
|
|
30
|
-
|
|
31
|
-
## Access Points
|
|
32
|
-
|
|
33
|
-
| Surface | Commands/Tools |
|
|
34
|
-
|---------|---------------|
|
|
35
|
-
| CLI | \`contractspec llm export\`, \`guide\`, \`verify\`, \`copy\` |
|
|
36
|
-
| MCP | \`llm.export\`, \`llm.guide\`, \`llm.verify\` tools |
|
|
37
|
-
| VSCode | Export to LLM, Generate Guide, Verify, Copy commands |
|
|
38
|
-
|
|
39
|
-
## Quick Start
|
|
40
|
-
|
|
41
|
-
### CLI Usage
|
|
42
|
-
|
|
43
|
-
\`\`\`bash
|
|
44
|
-
# Export spec as markdown
|
|
45
|
-
contractspec llm export path/to/my.spec.ts --format full
|
|
46
|
-
|
|
47
|
-
# Generate implementation guide
|
|
48
|
-
contractspec llm guide path/to/my.spec.ts --agent claude-code
|
|
49
|
-
|
|
50
|
-
# Verify implementation
|
|
51
|
-
contractspec llm verify path/to/my.spec.ts path/to/impl.ts --tier 2
|
|
52
|
-
|
|
53
|
-
# Copy spec to clipboard
|
|
54
|
-
contractspec llm copy path/to/my.spec.ts --format context
|
|
55
|
-
\`\`\`
|
|
56
|
-
|
|
57
|
-
### MCP Usage
|
|
58
|
-
|
|
59
|
-
\`\`\`
|
|
60
|
-
# Export spec
|
|
61
|
-
llm.export { specPath: "path/to/my.spec.ts", format: "full" }
|
|
62
|
-
|
|
63
|
-
# Generate guide
|
|
64
|
-
llm.guide { specPath: "path/to/my.spec.ts", agent: "cursor-cli" }
|
|
65
|
-
|
|
66
|
-
# Verify implementation
|
|
67
|
-
llm.verify { specPath: "path/to/my.spec.ts", implementationPath: "path/to/impl.ts", tier: "2" }
|
|
68
|
-
\`\`\`
|
|
69
|
-
|
|
70
|
-
### Programmatic Usage
|
|
71
|
-
|
|
72
|
-
\`\`\`typescript
|
|
73
|
-
import { specToFullMarkdown, specToAgentPrompt } from '@lssm/lib.contracts/llm';
|
|
74
|
-
import { createAgentGuideService, createVerifyService } from '@lssm/bundle.contractspec-workspace';
|
|
75
|
-
|
|
76
|
-
// Export
|
|
77
|
-
const markdown = specToFullMarkdown(mySpec);
|
|
78
|
-
|
|
79
|
-
// Generate guide
|
|
80
|
-
const guideService = createAgentGuideService({ defaultAgent: 'claude-code' });
|
|
81
|
-
const guide = guideService.generateGuide(mySpec);
|
|
82
|
-
|
|
83
|
-
// Verify
|
|
84
|
-
const verifyService = createVerifyService();
|
|
85
|
-
const result = await verifyService.verify(mySpec, implementationCode, {
|
|
86
|
-
tiers: ['structure', 'behavior']
|
|
87
|
-
});
|
|
88
|
-
\`\`\`
|
|
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
|
|
90
|
-
|
|
91
|
-
ContractSpec provides three export formats optimized for different LLM use cases.
|
|
92
|
-
|
|
93
|
-
## Context Format
|
|
94
|
-
|
|
95
|
-
Best for: Understanding what a spec does, providing background to LLMs.
|
|
96
|
-
|
|
97
|
-
Includes:
|
|
98
|
-
- Spec name, version, type
|
|
99
|
-
- Goal and context
|
|
100
|
-
- Description
|
|
101
|
-
- Acceptance scenarios
|
|
102
|
-
|
|
103
|
-
Example:
|
|
104
|
-
|
|
105
|
-
\`\`\`markdown
|
|
106
|
-
# users.createUser (v1)
|
|
107
|
-
|
|
108
|
-
> Create a new user account with email verification.
|
|
109
|
-
|
|
110
|
-
**Type:** command | **Stability:** stable
|
|
111
|
-
|
|
112
|
-
## Goal
|
|
113
|
-
Create a new user in the system and trigger email verification.
|
|
114
|
-
|
|
115
|
-
## Context
|
|
116
|
-
Part of the user onboarding flow. Called after signup form submission.
|
|
117
|
-
|
|
118
|
-
## Acceptance Criteria
|
|
119
|
-
### Happy path
|
|
120
|
-
**Given:** Valid email and password
|
|
121
|
-
**When:** User submits registration
|
|
122
|
-
**Then:** Account is created, verification email is sent
|
|
123
|
-
\`\`\`
|
|
124
|
-
|
|
125
|
-
## Full Format
|
|
126
|
-
|
|
127
|
-
Best for: Complete documentation, implementation reference.
|
|
128
|
-
|
|
129
|
-
Includes everything:
|
|
130
|
-
- All metadata
|
|
131
|
-
- JSON schemas for I/O
|
|
132
|
-
- Error definitions
|
|
133
|
-
- Policy (auth, rate limits, PII)
|
|
134
|
-
- Events emitted
|
|
135
|
-
- Examples
|
|
136
|
-
- Transport configuration
|
|
137
|
-
|
|
138
|
-
## Prompt Format
|
|
139
|
-
|
|
140
|
-
Best for: Feeding directly to coding agents.
|
|
141
|
-
|
|
142
|
-
Includes:
|
|
143
|
-
- Task header with clear instructions
|
|
144
|
-
- Full spec context
|
|
145
|
-
- Implementation requirements
|
|
146
|
-
- Task-specific guidance (implement/test/refactor/review)
|
|
147
|
-
- Expected output format
|
|
148
|
-
|
|
149
|
-
The prompt format adapts based on task type:
|
|
150
|
-
- **implement**: Full implementation with tests
|
|
151
|
-
- **test**: Test generation for existing code
|
|
152
|
-
- **refactor**: Refactoring while maintaining behavior
|
|
153
|
-
- **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
|
|
155
|
-
|
|
156
|
-
ContractSpec provides specialized adapters for different AI coding agents.
|
|
157
|
-
|
|
158
|
-
## Claude Code Adapter
|
|
159
|
-
|
|
160
|
-
Optimized for Anthropic Claude's extended thinking and code generation.
|
|
161
|
-
|
|
162
|
-
Features:
|
|
163
|
-
- Structured markdown with clear sections
|
|
164
|
-
- Checklists for steps and verification
|
|
165
|
-
- Icons for file operations (📝 create, ✏️ modify)
|
|
166
|
-
- System prompt for ContractSpec context
|
|
167
|
-
|
|
168
|
-
Usage:
|
|
169
|
-
\`\`\`typescript
|
|
170
|
-
const guideService = createAgentGuideService({ defaultAgent: 'claude-code' });
|
|
171
|
-
const result = guideService.generateGuide(spec, { agent: 'claude-code' });
|
|
172
|
-
// result.prompt.systemPrompt - Claude system context
|
|
173
|
-
// result.prompt.taskPrompt - Task-specific instructions
|
|
174
|
-
\`\`\`
|
|
175
|
-
|
|
176
|
-
## Cursor CLI Adapter
|
|
177
|
-
|
|
178
|
-
Optimized for Cursor's background/composer mode.
|
|
179
|
-
|
|
180
|
-
Features:
|
|
181
|
-
- Compact format for context efficiency
|
|
182
|
-
- .mdc cursor rules generation
|
|
183
|
-
- Integration with Cursor's file system
|
|
184
|
-
- Concise step lists
|
|
185
|
-
|
|
186
|
-
Generate Cursor Rules:
|
|
187
|
-
\`\`\`typescript
|
|
188
|
-
const cursorRules = guideService.generateAgentConfig(spec, 'cursor-cli');
|
|
189
|
-
// Save to .cursor/rules/my-spec.mdc
|
|
190
|
-
\`\`\`
|
|
191
|
-
|
|
192
|
-
## Generic MCP Adapter
|
|
193
|
-
|
|
194
|
-
Works with any MCP-compatible agent (Cline, Aider, etc.).
|
|
195
|
-
|
|
196
|
-
Features:
|
|
197
|
-
- Standard markdown format
|
|
198
|
-
- Table-based metadata
|
|
199
|
-
- JSON resource format support
|
|
200
|
-
- Prompt message format
|
|
201
|
-
|
|
202
|
-
The generic adapter is the default and works across all agents.
|
|
203
|
-
|
|
204
|
-
## Choosing an Adapter
|
|
205
|
-
|
|
206
|
-
| Agent | Best For | Key Features |
|
|
207
|
-
|-------|----------|--------------|
|
|
208
|
-
| Claude Code | Complex implementations | Extended thinking, detailed steps |
|
|
209
|
-
| Cursor CLI | IDE-integrated work | Cursor rules, compact format |
|
|
210
|
-
| 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
|
|
212
|
-
|
|
213
|
-
ContractSpec provides tiered verification to check if implementations comply with specs.
|
|
214
|
-
|
|
215
|
-
## Verification Tiers
|
|
216
|
-
|
|
217
|
-
### Tier 1: Structure (Fast)
|
|
218
|
-
|
|
219
|
-
Checks TypeScript structure against spec requirements:
|
|
220
|
-
|
|
221
|
-
| Check | What it validates |
|
|
222
|
-
|-------|------------------|
|
|
223
|
-
| Handler export | Function is properly exported |
|
|
224
|
-
| Contracts import | Imports from @lssm/lib.contracts |
|
|
225
|
-
| Schema import | Imports from @lssm/lib.schema |
|
|
226
|
-
| No \`any\` type | TypeScript strict compliance |
|
|
227
|
-
| Error handling | Error codes are referenced |
|
|
228
|
-
| Event emission | Event patterns exist |
|
|
229
|
-
| Input validation | Validation patterns used |
|
|
230
|
-
| Async patterns | Async/await for commands |
|
|
231
|
-
|
|
232
|
-
### Tier 2: Behavior (Comprehensive)
|
|
233
|
-
|
|
234
|
-
Checks implementation coverage of spec behaviors:
|
|
235
|
-
|
|
236
|
-
| Check | What it validates |
|
|
237
|
-
|-------|------------------|
|
|
238
|
-
| Scenario coverage | Acceptance scenarios implemented |
|
|
239
|
-
| Example coverage | Example I/O values referenced |
|
|
240
|
-
| Error cases | All error conditions handled |
|
|
241
|
-
| Event conditions | Events emitted correctly |
|
|
242
|
-
| Idempotency | Idempotent patterns (if required) |
|
|
243
|
-
|
|
244
|
-
### Tier 3: AI Review (Deep)
|
|
245
|
-
|
|
246
|
-
Uses LLM for semantic analysis:
|
|
247
|
-
|
|
248
|
-
- Does the implementation fulfill the spec's intent?
|
|
249
|
-
- Are edge cases properly handled?
|
|
250
|
-
- Is the code quality acceptable?
|
|
251
|
-
- Are there any subtle violations?
|
|
252
|
-
|
|
253
|
-
Requires AI API key configuration.
|
|
254
|
-
|
|
255
|
-
## Running Verification
|
|
256
|
-
|
|
257
|
-
\`\`\`typescript
|
|
258
|
-
const verifyService = createVerifyService({
|
|
259
|
-
aiApiKey: process.env.ANTHROPIC_API_KEY, // Optional, for Tier 3
|
|
260
|
-
aiProvider: 'anthropic',
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
const result = await verifyService.verify(spec, implementationCode, {
|
|
264
|
-
tiers: ['structure', 'behavior'],
|
|
265
|
-
failFast: false,
|
|
266
|
-
includeSuggestions: true,
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
console.log(result.passed); // true/false
|
|
270
|
-
console.log(result.score); // 0-100
|
|
271
|
-
console.log(result.summary); // Human-readable summary
|
|
272
|
-
\`\`\`
|
|
273
|
-
|
|
274
|
-
## Verification Report
|
|
275
|
-
|
|
276
|
-
The report includes:
|
|
277
|
-
|
|
278
|
-
- **passed**: Overall compliance
|
|
279
|
-
- **score**: 0-100 score
|
|
280
|
-
- **issues**: Array of problems found
|
|
281
|
-
- **suggestions**: Recommended fixes
|
|
282
|
-
- **coverage**: Metrics on scenario/error/field coverage
|
|
283
|
-
|
|
284
|
-
Each issue has:
|
|
285
|
-
- **severity**: error, warning, or info
|
|
286
|
-
- **category**: type, export, import, scenario, error_handling, semantic
|
|
287
|
-
- **message**: Description of the issue
|
|
288
|
-
- **suggestion**: How to fix it
|
|
289
|
-
`}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"../registry.js";e([{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"}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"../registry.js";e([{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"}]);
|