@lssm/example.learning-journey-registry 0.0.0-canary-20251212230121 → 0.0.0-canary-20251213172311
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.log +10 -6
- package/CHANGELOG.md +12 -12
- package/dist/example.js +1 -0
- package/dist/index.js +1 -1
- package/dist/libs/contracts/src/docs/index.js +1 -1
- package/dist/libs/contracts/src/docs/tech/contracts/openapi-export.docblock.js +38 -0
- package/dist/libs/contracts/src/docs/tech/mcp-endpoints.docblock.js +1 -1
- package/dist/libs/contracts/src/docs/tech/telemetry-ingest.docblock.js +122 -0
- package/dist/libs/contracts/src/docs/tech/vscode-extension.docblock.js +68 -0
- package/dist/tracks.js +1 -1
- package/example.ts +1 -0
- package/package.json +9 -7
- package/src/example.ts +26 -0
- package/src/index.ts +1 -0
- package/src/tracks.ts +6 -6
- package/src/ui/LearningMiniApp.tsx +0 -1
- package/src/ui/index.ts +0 -1
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -2,7 +2,7 @@ $ bun build:bundle && bun build:types
|
|
|
2
2
|
$ tsdown
|
|
3
3
|
[34mℹ[39m tsdown [2mv0.17.0[22m powered by rolldown [2mv1.0.0-beta.53[22m
|
|
4
4
|
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/learning-journey-registry/tsdown.config.js[24m
|
|
5
|
-
[34mℹ[39m entry: [34msrc/api-types.ts, src/api.ts, src/index.ts, src/progress-store.ts, src/tracks.ts, src/docs/index.ts, src/docs/learning-journey-registry.docblock.ts, src/presentations/index.ts, src/ui/LearningMiniApp.tsx, src/ui/index.ts[39m
|
|
5
|
+
[34mℹ[39m entry: [34msrc/api-types.ts, src/api.ts, src/example.ts, src/index.ts, src/progress-store.ts, src/tracks.ts, src/docs/index.ts, src/docs/learning-journey-registry.docblock.ts, src/presentations/index.ts, src/ui/LearningMiniApp.tsx, src/ui/index.ts[39m
|
|
6
6
|
[34mℹ[39m target: [34mesnext[39m
|
|
7
7
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
8
8
|
[34mℹ[39m Build start
|
|
@@ -10,8 +10,9 @@ $ tsdown
|
|
|
10
10
|
[34mℹ[39m [2mdist/[22m[1mui/LearningMiniApp.js[22m [2m 1.88 kB[22m [2m│ gzip: 0.70 kB[22m
|
|
11
11
|
[34mℹ[39m [2mdist/[22m[1mtracks.js[22m [2m 1.30 kB[22m [2m│ gzip: 0.50 kB[22m
|
|
12
12
|
[34mℹ[39m [2mdist/[22m[1mdocs/learning-journey-registry.docblock.js[22m [2m 1.21 kB[22m [2m│ gzip: 0.63 kB[22m
|
|
13
|
-
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m 1.
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m 1.10 kB[22m [2m│ gzip: 0.38 kB[22m
|
|
14
14
|
[34mℹ[39m [2mdist/[22m[1mpresentations/index.js[22m [2m 0.99 kB[22m [2m│ gzip: 0.39 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m 0.52 kB[22m [2m│ gzip: 0.32 kB[22m
|
|
15
16
|
[34mℹ[39m [2mdist/[22m[1mprogress-store.js[22m [2m 0.43 kB[22m [2m│ gzip: 0.29 kB[22m
|
|
16
17
|
[34mℹ[39m [2mdist/[22m[1mui/index.js[22m [2m 0.19 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
17
18
|
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m 0.05 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
@@ -24,14 +25,17 @@ $ tsdown
|
|
|
24
25
|
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/tech/templates/runtime.docblock.js [2m 5.63 kB[22m [2m│ gzip: 2.58 kB[22m
|
|
25
26
|
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/tech/workflows/overview.docblock.js [2m 5.44 kB[22m [2m│ gzip: 2.26 kB[22m
|
|
26
27
|
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js [2m 4.37 kB[22m [2m│ gzip: 2.06 kB[22m
|
|
28
|
+
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/tech/telemetry-ingest.docblock.js [2m 3.90 kB[22m [2m│ gzip: 1.70 kB[22m
|
|
29
|
+
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/tech/vscode-extension.docblock.js [2m 3.60 kB[22m [2m│ gzip: 1.39 kB[22m
|
|
27
30
|
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/PUBLISHING.docblock.js [2m 3.43 kB[22m [2m│ gzip: 1.59 kB[22m
|
|
28
31
|
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js [2m 3.00 kB[22m [2m│ gzip: 1.53 kB[22m
|
|
29
32
|
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js [2m 2.83 kB[22m [2m│ gzip: 1.41 kB[22m
|
|
30
33
|
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/tech/presentation-runtime.docblock.js [2m 2.75 kB[22m [2m│ gzip: 1.30 kB[22m
|
|
34
|
+
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/tech/contracts/openapi-export.docblock.js [2m 1.72 kB[22m [2m│ gzip: 0.90 kB[22m
|
|
35
|
+
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/tech/mcp-endpoints.docblock.js [2m 1.24 kB[22m [2m│ gzip: 0.68 kB[22m
|
|
31
36
|
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/presentations.js [2m 1.23 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
32
|
-
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/
|
|
33
|
-
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/index.js [2m 0.85 kB[22m [2m│ gzip: 0.35 kB[22m
|
|
37
|
+
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/index.js [2m 0.99 kB[22m [2m│ gzip: 0.39 kB[22m
|
|
34
38
|
[34mℹ[39m [2mdist/[22mlibs/contracts/src/docs/registry.js [2m 0.74 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
35
|
-
[34mℹ[39m
|
|
36
|
-
[32m✔[39m Build complete in [
|
|
39
|
+
[34mℹ[39m 30 files, total: 103.69 kB
|
|
40
|
+
[32m✔[39m Build complete in [32m48ms[39m
|
|
37
41
|
$ tsc --noEmit
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# @lssm/example.learning-journey-registry
|
|
2
2
|
|
|
3
|
-
## 0.0.0-canary-
|
|
3
|
+
## 0.0.0-canary-20251213172311
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- @lssm/example.learning-journey
|
|
8
|
-
- @lssm/example.learning-journey-ui-coaching@0.0.0-canary-
|
|
9
|
-
- @lssm/example.learning-journey-ui-gamified@0.0.0-canary-
|
|
10
|
-
- @lssm/example.learning-journey-ui-onboarding@0.0.0-canary-
|
|
11
|
-
- @lssm/example.learning-journey-ui-shared@0.0.0-canary-
|
|
12
|
-
- @lssm/example.learning-journey
|
|
13
|
-
- @lssm/example.learning-journey
|
|
14
|
-
- @lssm/example.learning-journey
|
|
15
|
-
- @lssm/example.learning-journey
|
|
16
|
-
- @lssm/example.learning-journey
|
|
17
|
-
- @lssm/module.learning-journey@0.0.0-canary-
|
|
7
|
+
- @lssm/example.learning-journey-crm-onboarding@0.0.0-canary-20251213172311
|
|
8
|
+
- @lssm/example.learning-journey-ui-coaching@0.0.0-canary-20251213172311
|
|
9
|
+
- @lssm/example.learning-journey-ui-gamified@0.0.0-canary-20251213172311
|
|
10
|
+
- @lssm/example.learning-journey-ui-onboarding@0.0.0-canary-20251213172311
|
|
11
|
+
- @lssm/example.learning-journey-ui-shared@0.0.0-canary-20251213172311
|
|
12
|
+
- @lssm/example.learning-journey-ambient-coach@0.0.0-canary-20251213172311
|
|
13
|
+
- @lssm/example.learning-journey-duo-drills@0.0.0-canary-20251213172311
|
|
14
|
+
- @lssm/example.learning-journey-platform-tour@0.0.0-canary-20251213172311
|
|
15
|
+
- @lssm/example.learning-journey-quest-challenges@0.0.0-canary-20251213172311
|
|
16
|
+
- @lssm/example.learning-journey-studio-onboarding@0.0.0-canary-20251213172311
|
|
17
|
+
- @lssm/module.learning-journey@0.0.0-canary-20251213172311
|
package/dist/example.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={id:`learning-journey-registry`,title:`Learning Journey Registry`,summary:`Registry of learning journey tracks + presentations + UI mini-app bindings.`,tags:[`learning`,`journey`,`registry`],kind:`library`,visibility:`public`,docs:{rootDocId:`docs.examples.learning-journey-registry`},entrypoints:{packageName:`@lssm/example.learning-journey-registry`,docs:`./docs`},surfaces:{templates:!0,sandbox:{enabled:!0,modes:[`markdown`,`specs`]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}};export{e as default};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{crmLearningTracks as e,learningJourneyTracks as t,mapStep as n,mapTrackSpecToDto as r,onboardingTrackCatalog as i,platformLearningTracks as a,studioLearningTracks as o}from"./tracks.js";import{getProgress as s,listTracks as c,recordEvent as l}from"./api.js";import"./docs/index.js";import{LearningTrackDetailPresentation as
|
|
1
|
+
import{crmLearningTracks as e,learningJourneyTracks as t,mapStep as n,mapTrackSpecToDto as r,onboardingTrackCatalog as i,platformLearningTracks as a,studioLearningTracks as o}from"./tracks.js";import{getProgress as s,listTracks as c,recordEvent as l}from"./api.js";import u from"./example.js";import"./docs/index.js";import{LearningTrackDetailPresentation as d,LearningTrackListPresentation as f,LearningTrackProgressWidgetPresentation as p,learningJourneyPresentations as m}from"./presentations/index.js";import{LearningMiniApp as h,getLearningTemplateIds as g,isLearningTemplate as _}from"./ui/LearningMiniApp.js";import"./ui/index.js";export{h as LearningMiniApp,d as LearningTrackDetailPresentation,f as LearningTrackListPresentation,p as LearningTrackProgressWidgetPresentation,e as crmLearningTracks,u as example,g as getLearningTemplateIds,s as getProgress,_ as isLearningTemplate,m as learningJourneyPresentations,t as learningJourneyTracks,c as listTracks,n as mapStep,r as mapTrackSpecToDto,i as onboardingTrackCatalog,a as platformLearningTracks,l as recordEvent,o as studioLearningTracks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{docBlockToPresentationSpec as e,docBlockToPresentationV2 as t,docBlocksToPresentationRoutes as n}from"./presentations.js";import{DocRegistry as r,defaultDocRegistry as i,registerDocBlocks as a}from"./registry.js";import"./PUBLISHING.docblock.js";import"./accessibility_wcag_compliance_specs.docblock.js";import"./tech/PHASE_1_QUICKSTART.docblock.js";import"./tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js";import"./tech/PHASE_3_AUTO_EVOLUTION.docblock.js";import"./tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js";import"./tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js";import"./tech/lifecycle-stage-system.docblock.js";import"./tech/presentation-runtime.docblock.js";import"./tech/schema/README.docblock.js";import"./tech/templates/runtime.docblock.js";import"./tech/workflows/overview.docblock.js";import"./tech/mcp-endpoints.docblock.js";
|
|
1
|
+
import{docBlockToPresentationSpec as e,docBlockToPresentationV2 as t,docBlocksToPresentationRoutes as n}from"./presentations.js";import{DocRegistry as r,defaultDocRegistry as i,registerDocBlocks as a}from"./registry.js";import"./PUBLISHING.docblock.js";import"./accessibility_wcag_compliance_specs.docblock.js";import"./tech/PHASE_1_QUICKSTART.docblock.js";import"./tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js";import"./tech/PHASE_3_AUTO_EVOLUTION.docblock.js";import"./tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js";import"./tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js";import"./tech/lifecycle-stage-system.docblock.js";import"./tech/presentation-runtime.docblock.js";import"./tech/schema/README.docblock.js";import"./tech/templates/runtime.docblock.js";import"./tech/workflows/overview.docblock.js";import"./tech/mcp-endpoints.docblock.js";import"./tech/vscode-extension.docblock.js";import"./tech/telemetry-ingest.docblock.js";import"./tech/contracts/openapi-export.docblock.js";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import{registerDocBlocks 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 +1 @@
|
|
|
1
|
-
import{registerDocBlocks 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 and
|
|
1
|
+
import{registerDocBlocks 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"}]);
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import{registerDocBlocks as e}from"../registry.js";e([{id:`docs.tech.telemetry.ingest`,title:`Telemetry Ingest Endpoint`,summary:`Server-side telemetry ingestion for ContractSpec clients (VS Code extension, CLI, etc.).`,kind:`reference`,visibility:`internal`,route:`/docs/tech/telemetry/ingest`,tags:[`telemetry`,`api`,`posthog`,`analytics`],body:`# Telemetry Ingest Endpoint
|
|
2
|
+
|
|
3
|
+
The ContractSpec API provides a telemetry ingest endpoint for clients to send product analytics events.
|
|
4
|
+
|
|
5
|
+
## Endpoint
|
|
6
|
+
|
|
7
|
+
\`\`\`
|
|
8
|
+
POST /api/telemetry/ingest
|
|
9
|
+
\`\`\`
|
|
10
|
+
|
|
11
|
+
## Request
|
|
12
|
+
|
|
13
|
+
\`\`\`json
|
|
14
|
+
{
|
|
15
|
+
"event": "contractspec.vscode.command_run",
|
|
16
|
+
"distinct_id": "client-uuid",
|
|
17
|
+
"properties": {
|
|
18
|
+
"command": "validate"
|
|
19
|
+
},
|
|
20
|
+
"timestamp": "2024-01-15T10:30:00.000Z"
|
|
21
|
+
}
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
### Headers
|
|
25
|
+
|
|
26
|
+
| Header | Description |
|
|
27
|
+
|--------|-------------|
|
|
28
|
+
| \`x-contractspec-client-id\` | Optional client identifier (used as fallback for distinct_id) |
|
|
29
|
+
| \`Content-Type\` | Must be \`application/json\` |
|
|
30
|
+
|
|
31
|
+
### Body
|
|
32
|
+
|
|
33
|
+
| Field | Type | Required | Description |
|
|
34
|
+
|-------|------|----------|-------------|
|
|
35
|
+
| \`event\` | string | Yes | Event name (e.g., \`contractspec.vscode.activated\`) |
|
|
36
|
+
| \`distinct_id\` | string | Yes | Anonymous client identifier |
|
|
37
|
+
| \`properties\` | object | No | Event properties |
|
|
38
|
+
| \`timestamp\` | string | No | ISO 8601 timestamp |
|
|
39
|
+
|
|
40
|
+
## Response
|
|
41
|
+
|
|
42
|
+
\`\`\`json
|
|
43
|
+
{
|
|
44
|
+
"success": true
|
|
45
|
+
}
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
## Configuration
|
|
49
|
+
|
|
50
|
+
The endpoint requires \`POSTHOG_PROJECT_KEY\` environment variable to be set. If not configured, events are accepted but not forwarded.
|
|
51
|
+
|
|
52
|
+
| Environment Variable | Description | Default |
|
|
53
|
+
|---------------------|-------------|---------|
|
|
54
|
+
| \`POSTHOG_HOST\` | PostHog host URL | \`https://eu.posthog.com\` |
|
|
55
|
+
| \`POSTHOG_PROJECT_KEY\` | PostHog project API key | (required) |
|
|
56
|
+
|
|
57
|
+
## Privacy
|
|
58
|
+
|
|
59
|
+
- No PII is collected or stored
|
|
60
|
+
- \`distinct_id\` is an anonymous client-generated UUID
|
|
61
|
+
- File paths and source code are never included in events
|
|
62
|
+
- Respects VS Code telemetry settings on the client side
|
|
63
|
+
|
|
64
|
+
## Events
|
|
65
|
+
|
|
66
|
+
### Extension Events
|
|
67
|
+
|
|
68
|
+
| Event | Description | Properties |
|
|
69
|
+
|-------|-------------|------------|
|
|
70
|
+
| \`contractspec.vscode.activated\` | Extension activated | \`version\` |
|
|
71
|
+
| \`contractspec.vscode.command_run\` | Command executed | \`command\` |
|
|
72
|
+
| \`contractspec.vscode.mcp_call\` | MCP call made | \`endpoint\`, \`tool\` |
|
|
73
|
+
|
|
74
|
+
### API Events
|
|
75
|
+
|
|
76
|
+
| Event | Description | Properties |
|
|
77
|
+
|-------|-------------|------------|
|
|
78
|
+
| \`contractspec.api.mcp_request\` | MCP request processed | \`endpoint\`, \`method\`, \`success\`, \`duration_ms\` |
|
|
79
|
+
`},{id:`docs.tech.telemetry.hybrid`,title:`Hybrid Telemetry Model`,summary:`How ContractSpec clients choose between direct PostHog and API-routed telemetry.`,kind:`usage`,visibility:`internal`,route:`/docs/tech/telemetry/hybrid`,tags:[`telemetry`,`architecture`,`posthog`],body:`# Hybrid Telemetry Model
|
|
80
|
+
|
|
81
|
+
ContractSpec uses a hybrid telemetry model where clients can send events either directly to PostHog or via the API server.
|
|
82
|
+
|
|
83
|
+
## Decision Flow
|
|
84
|
+
|
|
85
|
+
\`\`\`
|
|
86
|
+
Is contractspec.api.baseUrl configured?
|
|
87
|
+
├── Yes → Send via /api/telemetry/ingest
|
|
88
|
+
└── No → Is posthogProjectKey configured?
|
|
89
|
+
├── Yes → Send directly to PostHog
|
|
90
|
+
└── No → Telemetry disabled
|
|
91
|
+
\`\`\`
|
|
92
|
+
|
|
93
|
+
## Benefits
|
|
94
|
+
|
|
95
|
+
### Direct PostHog
|
|
96
|
+
- No server dependency
|
|
97
|
+
- Works offline (with batching)
|
|
98
|
+
- Lower latency
|
|
99
|
+
|
|
100
|
+
### Via API
|
|
101
|
+
- Centralized key management (no client-side keys)
|
|
102
|
+
- Server-side enrichment and validation
|
|
103
|
+
- Rate limiting and abuse prevention
|
|
104
|
+
- Easier migration to other providers
|
|
105
|
+
|
|
106
|
+
## Recommendation
|
|
107
|
+
|
|
108
|
+
- **Development**: Use direct PostHog with a dev project key
|
|
109
|
+
- **Production**: Route via API for better governance
|
|
110
|
+
|
|
111
|
+
## Future: OpenTelemetry
|
|
112
|
+
|
|
113
|
+
The current PostHog implementation is behind a simple interface that can be swapped for OpenTelemetry:
|
|
114
|
+
|
|
115
|
+
\`\`\`typescript
|
|
116
|
+
interface TelemetryClient {
|
|
117
|
+
send(event: TelemetryEvent): Promise<void>;
|
|
118
|
+
}
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
This allows future migration without changing client code.
|
|
122
|
+
`}]);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import{registerDocBlocks as e}from"../registry.js";e([{id:`docs.tech.vscode.extension`,title:`ContractSpec VS Code Extension`,summary:`VS Code extension for spec-first development with validation, scaffolding, and MCP integration.`,kind:`reference`,visibility:`public`,route:`/docs/tech/vscode/extension`,tags:[`vscode`,`extension`,`tooling`,`dx`],body:`# ContractSpec VS Code Extension
|
|
2
|
+
|
|
3
|
+
The ContractSpec VS Code extension provides spec-first development tooling directly in your editor.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Real-time Validation**: Get instant feedback on spec errors and warnings as you save files
|
|
8
|
+
- **Build/Scaffold**: Generate handler and component skeletons from specs (no AI required)
|
|
9
|
+
- **Spec Explorer**: List and navigate all specs in your workspace
|
|
10
|
+
- **Dependency Analysis**: Visualize spec dependencies and detect cycles
|
|
11
|
+
- **MCP Integration**: Search ContractSpec documentation via Model Context Protocol
|
|
12
|
+
- **Snippets**: Code snippets for common ContractSpec patterns
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
|
|
16
|
+
| Command | Description |
|
|
17
|
+
|---------|-------------|
|
|
18
|
+
| \`ContractSpec: Validate Current Spec\` | Validate the currently open spec file |
|
|
19
|
+
| \`ContractSpec: Validate All Specs\` | Validate all spec files in the workspace |
|
|
20
|
+
| \`ContractSpec: Build/Scaffold\` | Generate handler/component from the current spec |
|
|
21
|
+
| \`ContractSpec: List All Specs\` | Show all specs in the workspace |
|
|
22
|
+
| \`ContractSpec: Analyze Dependencies\` | Analyze and visualize spec dependencies |
|
|
23
|
+
| \`ContractSpec: Search Docs (MCP)\` | Search documentation via MCP |
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
| Setting | Description | Default |
|
|
28
|
+
|---------|-------------|---------|
|
|
29
|
+
| \`contractspec.api.baseUrl\` | Base URL for ContractSpec API (enables MCP + remote telemetry) | \`""\` |
|
|
30
|
+
| \`contractspec.telemetry.posthogHost\` | PostHog host URL for direct telemetry | \`"https://eu.posthog.com"\` |
|
|
31
|
+
| \`contractspec.telemetry.posthogProjectKey\` | PostHog project key for direct telemetry | \`""\` |
|
|
32
|
+
| \`contractspec.validation.onSave\` | Run validation on save | \`true\` |
|
|
33
|
+
| \`contractspec.validation.onOpen\` | Run validation on open | \`true\` |
|
|
34
|
+
|
|
35
|
+
## Architecture
|
|
36
|
+
|
|
37
|
+
The extension uses:
|
|
38
|
+
- \`@lssm/module.contractspec-workspace\` for pure analysis + templates
|
|
39
|
+
- \`@lssm/bundle.contractspec-workspace\` for workspace services + adapters
|
|
40
|
+
|
|
41
|
+
This allows the extension to work without requiring the CLI to be installed.
|
|
42
|
+
|
|
43
|
+
## Telemetry
|
|
44
|
+
|
|
45
|
+
The extension uses a hybrid telemetry approach:
|
|
46
|
+
1. If \`contractspec.api.baseUrl\` is configured → send to API \`/api/telemetry/ingest\`
|
|
47
|
+
2. Otherwise → send directly to PostHog (if project key configured)
|
|
48
|
+
|
|
49
|
+
Telemetry respects VS Code's telemetry settings. No file paths, source code, or PII is collected.
|
|
50
|
+
`},{id:`docs.tech.vscode.snippets`,title:`ContractSpec Snippets`,summary:`Code snippets for common ContractSpec patterns in VS Code.`,kind:`reference`,visibility:`public`,route:`/docs/tech/vscode/snippets`,tags:[`vscode`,`snippets`,`dx`],body:`# ContractSpec Snippets
|
|
51
|
+
|
|
52
|
+
The VS Code extension includes snippets for common ContractSpec patterns.
|
|
53
|
+
|
|
54
|
+
## Available Snippets
|
|
55
|
+
|
|
56
|
+
| Prefix | Description |
|
|
57
|
+
|--------|-------------|
|
|
58
|
+
| \`contractspec-command\` | Create a new command (write operation) |
|
|
59
|
+
| \`contractspec-query\` | Create a new query (read-only operation) |
|
|
60
|
+
| \`contractspec-event\` | Create a new event |
|
|
61
|
+
| \`contractspec-docblock\` | Create a new DocBlock |
|
|
62
|
+
| \`contractspec-telemetry\` | Create a new TelemetrySpec |
|
|
63
|
+
| \`contractspec-presentation\` | Create a new Presentation |
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
Type the prefix in a TypeScript file and press Tab to expand the snippet. Tab through the placeholders to fill in your values.
|
|
68
|
+
`}]);
|
package/dist/tracks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{crmLearningTracks as e}from"@lssm/example.learning-journey
|
|
1
|
+
import{crmLearningTracks as e}from"@lssm/example.learning-journey-crm-onboarding/track";import{drillTracks as t}from"@lssm/example.learning-journey-duo-drills/track";import{ambientCoachTracks as n}from"@lssm/example.learning-journey-ambient-coach/track";import{questTracks as r}from"@lssm/example.learning-journey-quest-challenges/track";import{platformLearningTracks as i}from"@lssm/example.learning-journey-platform-tour/track";import{studioLearningTracks as a}from"@lssm/example.learning-journey-studio-onboarding/track";const o=e=>({id:e.id,title:e.title,description:e.description,completionEvent:e.completion.eventName,completionCondition:e.completion,xpReward:e.xpReward,isRequired:e.isRequired,canSkip:e.canSkip,actionUrl:e.actionUrl,actionLabel:e.actionLabel,availability:e.availability,metadata:e.metadata}),s=e=>({id:e.id,name:e.name,description:e.description,productId:e.productId,targetUserSegment:e.targetUserSegment,targetRole:e.targetRole,totalXp:e.totalXp,streakRule:e.streakRule,completionRewards:e.completionRewards,steps:e.steps.map(o),metadata:e.metadata}),c=[...a,...i,...e,...t,...n,...r],l=c.map(s);export{e as crmLearningTracks,c as learningJourneyTracks,o as mapStep,s as mapTrackSpecToDto,l as onboardingTrackCatalog,i as platformLearningTracks,a as studioLearningTracks};
|
package/example.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './src/example';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/example.learning-journey-registry",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251213172311",
|
|
4
4
|
"description": "Registry that aggregates learning journey example tracks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"./api-types": "./src/api-types.ts",
|
|
12
12
|
"./docs": "./src/docs/index.ts",
|
|
13
13
|
"./docs/learning-journey-registry.docblock": "./src/docs/learning-journey-registry.docblock.ts",
|
|
14
|
+
"./example": "./src/example.ts",
|
|
14
15
|
"./presentations": "./src/presentations/index.ts",
|
|
15
16
|
"./progress-store": "./src/progress-store.ts",
|
|
16
17
|
"./tracks": "./src/tracks.ts",
|
|
@@ -30,12 +31,12 @@
|
|
|
30
31
|
"lint:check": "eslint src"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@lssm/example.learning-journey
|
|
34
|
-
"@lssm/example.learning-journey
|
|
35
|
-
"@lssm/example.learning-journey
|
|
36
|
-
"@lssm/example.learning-journey
|
|
37
|
-
"@lssm/example.learning-journey
|
|
38
|
-
"@lssm/example.learning-journey
|
|
34
|
+
"@lssm/example.learning-journey-ambient-coach": "workspace:*",
|
|
35
|
+
"@lssm/example.learning-journey-duo-drills": "workspace:*",
|
|
36
|
+
"@lssm/example.learning-journey-crm-onboarding": "workspace:*",
|
|
37
|
+
"@lssm/example.learning-journey-platform-tour": "workspace:*",
|
|
38
|
+
"@lssm/example.learning-journey-quest-challenges": "workspace:*",
|
|
39
|
+
"@lssm/example.learning-journey-studio-onboarding": "workspace:*",
|
|
39
40
|
"@lssm/example.learning-journey-ui-shared": "workspace:*",
|
|
40
41
|
"@lssm/example.learning-journey-ui-gamified": "workspace:*",
|
|
41
42
|
"@lssm/example.learning-journey-ui-onboarding": "workspace:*",
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
"./api-types": "./dist/api-types.js",
|
|
62
63
|
"./docs": "./dist/docs/index.js",
|
|
63
64
|
"./docs/learning-journey-registry.docblock": "./dist/docs/learning-journey-registry.docblock.js",
|
|
65
|
+
"./example": "./dist/example.js",
|
|
64
66
|
"./presentations": "./dist/presentations/index.js",
|
|
65
67
|
"./progress-store": "./dist/progress-store.js",
|
|
66
68
|
"./tracks": "./dist/tracks.js",
|
package/src/example.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const example = {
|
|
2
|
+
id: 'learning-journey-registry',
|
|
3
|
+
title: 'Learning Journey Registry',
|
|
4
|
+
summary:
|
|
5
|
+
'Registry of learning journey tracks + presentations + UI mini-app bindings.',
|
|
6
|
+
tags: ['learning', 'journey', 'registry'],
|
|
7
|
+
kind: 'library',
|
|
8
|
+
visibility: 'public',
|
|
9
|
+
docs: {
|
|
10
|
+
rootDocId: 'docs.examples.learning-journey-registry',
|
|
11
|
+
},
|
|
12
|
+
entrypoints: {
|
|
13
|
+
packageName: '@lssm/example.learning-journey-registry',
|
|
14
|
+
docs: './docs',
|
|
15
|
+
},
|
|
16
|
+
surfaces: {
|
|
17
|
+
templates: true,
|
|
18
|
+
sandbox: { enabled: true, modes: ['markdown', 'specs'] },
|
|
19
|
+
studio: { enabled: true, installable: true },
|
|
20
|
+
mcp: { enabled: true },
|
|
21
|
+
},
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
24
|
+
export default example;
|
|
25
|
+
|
|
26
|
+
|
package/src/index.ts
CHANGED
package/src/tracks.ts
CHANGED
|
@@ -4,12 +4,12 @@ import type {
|
|
|
4
4
|
StepAvailabilitySpec,
|
|
5
5
|
StepCompletionConditionSpec,
|
|
6
6
|
} from '@lssm/module.learning-journey/track-spec';
|
|
7
|
-
import { crmLearningTracks } from '@lssm/example.learning-journey
|
|
8
|
-
import { drillTracks } from '@lssm/example.learning-journey
|
|
9
|
-
import { ambientCoachTracks } from '@lssm/example.learning-journey
|
|
10
|
-
import { questTracks } from '@lssm/example.learning-journey
|
|
11
|
-
import { platformLearningTracks } from '@lssm/example.learning-journey
|
|
12
|
-
import { studioLearningTracks } from '@lssm/example.learning-journey
|
|
7
|
+
import { crmLearningTracks } from '@lssm/example.learning-journey-crm-onboarding/track';
|
|
8
|
+
import { drillTracks } from '@lssm/example.learning-journey-duo-drills/track';
|
|
9
|
+
import { ambientCoachTracks } from '@lssm/example.learning-journey-ambient-coach/track';
|
|
10
|
+
import { questTracks } from '@lssm/example.learning-journey-quest-challenges/track';
|
|
11
|
+
import { platformLearningTracks } from '@lssm/example.learning-journey-platform-tour/track';
|
|
12
|
+
import { studioLearningTracks } from '@lssm/example.learning-journey-studio-onboarding/track';
|
|
13
13
|
|
|
14
14
|
export interface OnboardingStepDto {
|
|
15
15
|
id: string;
|
package/src/ui/index.ts
CHANGED