@lssm/example.learning-journey-ui-shared 0.0.0-canary-20251217080011 → 0.0.0-canary-20251219202229
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 +383 -24
- package/.turbo/turbo-build.log +384 -26
- package/CHANGELOG.md +6 -6
- package/LICENSE +21 -0
- package/dist/components/BadgeDisplay.d.ts +12 -0
- package/dist/components/BadgeDisplay.d.ts.map +1 -0
- package/dist/components/BadgeDisplay.js +45 -0
- package/dist/components/BadgeDisplay.js.map +1 -0
- package/dist/components/StreakCounter.d.ts +12 -0
- package/dist/components/StreakCounter.d.ts.map +1 -0
- package/dist/components/StreakCounter.js +46 -0
- package/dist/components/StreakCounter.js.map +1 -0
- package/dist/components/ViewTabs.d.ts +12 -0
- package/dist/components/ViewTabs.d.ts.map +1 -0
- package/dist/components/ViewTabs.js +49 -0
- package/dist/components/ViewTabs.js.map +1 -0
- package/dist/components/XpBar.d.ts +14 -0
- package/dist/components/XpBar.d.ts.map +1 -0
- package/dist/components/XpBar.js +47 -0
- package/dist/components/XpBar.js.map +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +6 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/docs/learning-journey-ui-shared.docblock.d.ts +1 -0
- package/dist/docs/learning-journey-ui-shared.docblock.js +21 -0
- package/dist/docs/learning-journey-ui-shared.docblock.js.map +1 -0
- package/dist/{index.d.mts → example.d.ts} +2 -5
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +35 -0
- package/dist/example.js.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +3 -0
- package/dist/{index-D_7WU_xm.d.mts → hooks/useLearningProgress.d.ts} +3 -2
- package/dist/hooks/useLearningProgress.d.ts.map +1 -0
- package/dist/{hooks-B-tDvppY.mjs → hooks/useLearningProgress.js} +4 -1
- package/dist/hooks/useLearningProgress.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +11 -0
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +17 -0
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/index.js +25 -0
- package/dist/libs/contracts/dist/docs/meta.docs.js +30 -0
- package/dist/libs/contracts/dist/docs/meta.docs.js.map +1 -0
- package/dist/libs/contracts/dist/docs/presentations.js +72 -0
- package/dist/libs/contracts/dist/docs/presentations.js.map +1 -0
- package/dist/libs/contracts/dist/docs/registry.js +45 -0
- package/dist/libs/contracts/dist/docs/registry.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +81 -0
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +58 -0
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +17 -0
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +358 -0
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +38 -0
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +17 -0
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +21 -0
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +49 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +80 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +85 -0
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +46 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +68 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +41 -0
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +70 -0
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +48 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +63 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +156 -0
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +21 -0
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +102 -0
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +21 -0
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js.map +1 -0
- package/dist/libs/contracts/dist/docs/tech-contracts.docs.js +97 -0
- package/dist/libs/contracts/dist/docs/tech-contracts.docs.js.map +1 -0
- package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +6 -0
- package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js.map +1 -0
- package/dist/libs/design-system/dist/components/atoms/Button.js +34 -0
- package/dist/libs/design-system/dist/components/atoms/Button.js.map +1 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +56 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js.map +1 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +14 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js.map +1 -0
- package/dist/libs/ui-kit-web/dist/ui/progress.js +24 -0
- package/dist/libs/ui-kit-web/dist/ui/progress.js.map +1 -0
- package/dist/libs/ui-kit-web/dist/ui/utils.js +11 -0
- package/dist/libs/ui-kit-web/dist/ui/utils.js.map +1 -0
- package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +11 -0
- package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js.map +1 -0
- package/dist/{types-BMAby_Ku.d.mts → types.d.ts} +2 -1
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +0 -0
- package/package.json +23 -16
- package/tsconfig.tsbuildinfo +1 -1
- package/tsdown.config.js +14 -11
- package/dist/components/index.d.mts +0 -2
- package/dist/components/index.mjs +0 -3
- package/dist/components-tyJAN4Ru.mjs +0 -164
- package/dist/hooks/index.d.mts +0 -2
- package/dist/hooks/index.mjs +0 -3
- package/dist/index-EWErSKip.d.mts +0 -34
- package/dist/index.mjs +0 -55
- package/dist/types.d.mts +0 -2
- package/dist/types.mjs +0 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { registerDocBlocks } from "../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js
|
|
4
|
+
const tech_telemetry_ingest_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.telemetry.ingest",
|
|
6
|
+
title: "Telemetry Ingest Endpoint",
|
|
7
|
+
summary: "Server-side telemetry ingestion for ContractSpec clients (VS Code extension, CLI, etc.).",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "internal",
|
|
10
|
+
route: "/docs/tech/telemetry/ingest",
|
|
11
|
+
tags: [
|
|
12
|
+
"telemetry",
|
|
13
|
+
"api",
|
|
14
|
+
"posthog",
|
|
15
|
+
"analytics"
|
|
16
|
+
],
|
|
17
|
+
body: `# Telemetry Ingest Endpoint
|
|
18
|
+
|
|
19
|
+
The ContractSpec API provides a telemetry ingest endpoint for clients to send product analytics events.
|
|
20
|
+
|
|
21
|
+
## Endpoint
|
|
22
|
+
|
|
23
|
+
\`\`\`
|
|
24
|
+
POST /api/telemetry/ingest
|
|
25
|
+
\`\`\`
|
|
26
|
+
|
|
27
|
+
## Request
|
|
28
|
+
|
|
29
|
+
\`\`\`json
|
|
30
|
+
{
|
|
31
|
+
"event": "contractspec.vscode.command_run",
|
|
32
|
+
"distinct_id": "client-uuid",
|
|
33
|
+
"properties": {
|
|
34
|
+
"command": "validate"
|
|
35
|
+
},
|
|
36
|
+
"timestamp": "2024-01-15T10:30:00.000Z"
|
|
37
|
+
}
|
|
38
|
+
\`\`\`
|
|
39
|
+
|
|
40
|
+
### Headers
|
|
41
|
+
|
|
42
|
+
| Header | Description |
|
|
43
|
+
|--------|-------------|
|
|
44
|
+
| \`x-contractspec-client-id\` | Optional client identifier (used as fallback for distinct_id) |
|
|
45
|
+
| \`Content-Type\` | Must be \`application/json\` |
|
|
46
|
+
|
|
47
|
+
### Body
|
|
48
|
+
|
|
49
|
+
| Field | Type | Required | Description |
|
|
50
|
+
|-------|------|----------|-------------|
|
|
51
|
+
| \`event\` | string | Yes | Event name (e.g., \`contractspec.vscode.activated\`) |
|
|
52
|
+
| \`distinct_id\` | string | Yes | Anonymous client identifier |
|
|
53
|
+
| \`properties\` | object | No | Event properties |
|
|
54
|
+
| \`timestamp\` | string | No | ISO 8601 timestamp |
|
|
55
|
+
|
|
56
|
+
## Response
|
|
57
|
+
|
|
58
|
+
\`\`\`json
|
|
59
|
+
{
|
|
60
|
+
"success": true
|
|
61
|
+
}
|
|
62
|
+
\`\`\`
|
|
63
|
+
|
|
64
|
+
## Configuration
|
|
65
|
+
|
|
66
|
+
The endpoint requires \`POSTHOG_PROJECT_KEY\` environment variable to be set. If not configured, events are accepted but not forwarded.
|
|
67
|
+
|
|
68
|
+
| Environment Variable | Description | Default |
|
|
69
|
+
|---------------------|-------------|---------|
|
|
70
|
+
| \`POSTHOG_HOST\` | PostHog host URL | \`https://eu.posthog.com\` |
|
|
71
|
+
| \`POSTHOG_PROJECT_KEY\` | PostHog project API key | (required) |
|
|
72
|
+
|
|
73
|
+
## Privacy
|
|
74
|
+
|
|
75
|
+
- No PII is collected or stored
|
|
76
|
+
- \`distinct_id\` is an anonymous client-generated UUID
|
|
77
|
+
- File paths and source code are never included in events
|
|
78
|
+
- Respects VS Code telemetry settings on the client side
|
|
79
|
+
|
|
80
|
+
## Events
|
|
81
|
+
|
|
82
|
+
### Extension Events
|
|
83
|
+
|
|
84
|
+
| Event | Description | Properties |
|
|
85
|
+
|-------|-------------|------------|
|
|
86
|
+
| \`contractspec.vscode.activated\` | Extension activated | \`version\` |
|
|
87
|
+
| \`contractspec.vscode.command_run\` | Command executed | \`command\` |
|
|
88
|
+
| \`contractspec.vscode.mcp_call\` | MCP call made | \`endpoint\`, \`tool\` |
|
|
89
|
+
|
|
90
|
+
### API Events
|
|
91
|
+
|
|
92
|
+
| Event | Description | Properties |
|
|
93
|
+
|-------|-------------|------------|
|
|
94
|
+
| \`contractspec.api.mcp_request\` | MCP request processed | \`endpoint\`, \`method\`, \`success\`, \`duration_ms\` |
|
|
95
|
+
`
|
|
96
|
+
}, {
|
|
97
|
+
id: "docs.tech.telemetry.hybrid",
|
|
98
|
+
title: "Hybrid Telemetry Model",
|
|
99
|
+
summary: "How ContractSpec clients choose between direct PostHog and API-routed telemetry.",
|
|
100
|
+
kind: "usage",
|
|
101
|
+
visibility: "internal",
|
|
102
|
+
route: "/docs/tech/telemetry/hybrid",
|
|
103
|
+
tags: [
|
|
104
|
+
"telemetry",
|
|
105
|
+
"architecture",
|
|
106
|
+
"posthog"
|
|
107
|
+
],
|
|
108
|
+
body: `# Hybrid Telemetry Model
|
|
109
|
+
|
|
110
|
+
ContractSpec uses a hybrid telemetry model where clients can send events either directly to PostHog or via the API server.
|
|
111
|
+
|
|
112
|
+
## Decision Flow
|
|
113
|
+
|
|
114
|
+
\`\`\`
|
|
115
|
+
Is contractspec.api.baseUrl configured?
|
|
116
|
+
├── Yes → Send via /api/telemetry/ingest
|
|
117
|
+
└── No → Is posthogProjectKey configured?
|
|
118
|
+
├── Yes → Send directly to PostHog
|
|
119
|
+
└── No → Telemetry disabled
|
|
120
|
+
\`\`\`
|
|
121
|
+
|
|
122
|
+
## Benefits
|
|
123
|
+
|
|
124
|
+
### Direct PostHog
|
|
125
|
+
- No server dependency
|
|
126
|
+
- Works offline (with batching)
|
|
127
|
+
- Lower latency
|
|
128
|
+
|
|
129
|
+
### Via API
|
|
130
|
+
- Centralized key management (no client-side keys)
|
|
131
|
+
- Server-side enrichment and validation
|
|
132
|
+
- Rate limiting and abuse prevention
|
|
133
|
+
- Easier migration to other providers
|
|
134
|
+
|
|
135
|
+
## Recommendation
|
|
136
|
+
|
|
137
|
+
- **Development**: Use direct PostHog with a dev project key
|
|
138
|
+
- **Production**: Route via API for better governance
|
|
139
|
+
|
|
140
|
+
## Future: OpenTelemetry
|
|
141
|
+
|
|
142
|
+
The current PostHog implementation is behind a simple interface that can be swapped for OpenTelemetry:
|
|
143
|
+
|
|
144
|
+
\`\`\`typescript
|
|
145
|
+
interface TelemetryClient {
|
|
146
|
+
send(event: TelemetryEvent): Promise<void>;
|
|
147
|
+
}
|
|
148
|
+
\`\`\`
|
|
149
|
+
|
|
150
|
+
This allows future migration without changing client code.
|
|
151
|
+
`
|
|
152
|
+
}];
|
|
153
|
+
registerDocBlocks(tech_telemetry_ingest_DocBlocks);
|
|
154
|
+
|
|
155
|
+
//#endregion
|
|
156
|
+
//# sourceMappingURL=telemetry-ingest.docblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-ingest.docblock.js","names":[],"sources":["../../../../../../../../libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js"],"sourcesContent":["import { registerDocBlocks } from \"../registry.js\";\n\n//#region src/docs/tech/telemetry-ingest.docblock.ts\nconst tech_telemetry_ingest_DocBlocks = [{\n\tid: \"docs.tech.telemetry.ingest\",\n\ttitle: \"Telemetry Ingest Endpoint\",\n\tsummary: \"Server-side telemetry ingestion for ContractSpec clients (VS Code extension, CLI, etc.).\",\n\tkind: \"reference\",\n\tvisibility: \"internal\",\n\troute: \"/docs/tech/telemetry/ingest\",\n\ttags: [\n\t\t\"telemetry\",\n\t\t\"api\",\n\t\t\"posthog\",\n\t\t\"analytics\"\n\t],\n\tbody: `# Telemetry Ingest Endpoint\n\nThe ContractSpec API provides a telemetry ingest endpoint for clients to send product analytics events.\n\n## Endpoint\n\n\\`\\`\\`\nPOST /api/telemetry/ingest\n\\`\\`\\`\n\n## Request\n\n\\`\\`\\`json\n{\n \"event\": \"contractspec.vscode.command_run\",\n \"distinct_id\": \"client-uuid\",\n \"properties\": {\n \"command\": \"validate\"\n },\n \"timestamp\": \"2024-01-15T10:30:00.000Z\"\n}\n\\`\\`\\`\n\n### Headers\n\n| Header | Description |\n|--------|-------------|\n| \\`x-contractspec-client-id\\` | Optional client identifier (used as fallback for distinct_id) |\n| \\`Content-Type\\` | Must be \\`application/json\\` |\n\n### Body\n\n| Field | Type | Required | Description |\n|-------|------|----------|-------------|\n| \\`event\\` | string | Yes | Event name (e.g., \\`contractspec.vscode.activated\\`) |\n| \\`distinct_id\\` | string | Yes | Anonymous client identifier |\n| \\`properties\\` | object | No | Event properties |\n| \\`timestamp\\` | string | No | ISO 8601 timestamp |\n\n## Response\n\n\\`\\`\\`json\n{\n \"success\": true\n}\n\\`\\`\\`\n\n## Configuration\n\nThe endpoint requires \\`POSTHOG_PROJECT_KEY\\` environment variable to be set. If not configured, events are accepted but not forwarded.\n\n| Environment Variable | Description | Default |\n|---------------------|-------------|---------|\n| \\`POSTHOG_HOST\\` | PostHog host URL | \\`https://eu.posthog.com\\` |\n| \\`POSTHOG_PROJECT_KEY\\` | PostHog project API key | (required) |\n\n## Privacy\n\n- No PII is collected or stored\n- \\`distinct_id\\` is an anonymous client-generated UUID\n- File paths and source code are never included in events\n- Respects VS Code telemetry settings on the client side\n\n## Events\n\n### Extension Events\n\n| Event | Description | Properties |\n|-------|-------------|------------|\n| \\`contractspec.vscode.activated\\` | Extension activated | \\`version\\` |\n| \\`contractspec.vscode.command_run\\` | Command executed | \\`command\\` |\n| \\`contractspec.vscode.mcp_call\\` | MCP call made | \\`endpoint\\`, \\`tool\\` |\n\n### API Events\n\n| Event | Description | Properties |\n|-------|-------------|------------|\n| \\`contractspec.api.mcp_request\\` | MCP request processed | \\`endpoint\\`, \\`method\\`, \\`success\\`, \\`duration_ms\\` |\n`\n}, {\n\tid: \"docs.tech.telemetry.hybrid\",\n\ttitle: \"Hybrid Telemetry Model\",\n\tsummary: \"How ContractSpec clients choose between direct PostHog and API-routed telemetry.\",\n\tkind: \"usage\",\n\tvisibility: \"internal\",\n\troute: \"/docs/tech/telemetry/hybrid\",\n\ttags: [\n\t\t\"telemetry\",\n\t\t\"architecture\",\n\t\t\"posthog\"\n\t],\n\tbody: `# Hybrid Telemetry Model\n\nContractSpec uses a hybrid telemetry model where clients can send events either directly to PostHog or via the API server.\n\n## Decision Flow\n\n\\`\\`\\`\nIs contractspec.api.baseUrl configured?\n├── Yes → Send via /api/telemetry/ingest\n└── No → Is posthogProjectKey configured?\n ├── Yes → Send directly to PostHog\n └── No → Telemetry disabled\n\\`\\`\\`\n\n## Benefits\n\n### Direct PostHog\n- No server dependency\n- Works offline (with batching)\n- Lower latency\n\n### Via API\n- Centralized key management (no client-side keys)\n- Server-side enrichment and validation\n- Rate limiting and abuse prevention\n- Easier migration to other providers\n\n## Recommendation\n\n- **Development**: Use direct PostHog with a dev project key\n- **Production**: Route via API for better governance\n\n## Future: OpenTelemetry\n\nThe current PostHog implementation is behind a simple interface that can be swapped for OpenTelemetry:\n\n\\`\\`\\`typescript\ninterface TelemetryClient {\n send(event: TelemetryEvent): Promise<void>;\n}\n\\`\\`\\`\n\nThis allows future migration without changing client code.\n`\n}];\nregisterDocBlocks(tech_telemetry_ingest_DocBlocks);\n\n//#endregion\nexport { tech_telemetry_ingest_DocBlocks };\n//# sourceMappingURL=telemetry-ingest.docblock.js.map"],"mappings":";;;AAGA,MAAM,kCAAkC,CAAC;CACxC,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EACL;EACA;EACA;EACA;EACA;CACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EN,EAAE;CACF,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EACL;EACA;EACA;EACA;CACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CN,CAAC;AACF,kBAAkB,gCAAgC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { registerDocBlocks } from "../../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/dist/docs/tech/templates/runtime.docblock.js
|
|
4
|
+
const tech_templates_runtime_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.templates.runtime",
|
|
6
|
+
title: "ContractSpec Template Runtime (Phase 9)",
|
|
7
|
+
summary: "Phase 9 introduces a full local-first runtime for templates so anyone can preview apps directly in the browser without provisioning any infrastructure.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/templates/runtime",
|
|
11
|
+
tags: [
|
|
12
|
+
"tech",
|
|
13
|
+
"templates",
|
|
14
|
+
"runtime"
|
|
15
|
+
],
|
|
16
|
+
body: "## ContractSpec Template Runtime (Phase 9)\n\nPhase 9 introduces a full local-first runtime for templates so anyone can preview apps directly in the browser without provisioning any infrastructure.\n\n### Building Blocks\n\n- **Local database** – `@lssm/lib.runtime-local` wraps `sql.js` (SQLite WASM) and `IndexedDB` so we can seed demo data, run migrations, and persist state between sessions. Tests point the runtime to `node_modules/sql.js/dist` so CI doesn’t need a browser.\n- **Local GraphQL** – `LocalGraphQLClient` wires Apollo Client + SchemaLink to resolvers for tasks, messaging, and i18n recipes. All `/templates`, `/studio`, and `/sandbox` previews use those resolvers so we never call remote APIs during demos.\n- **Template registry + installer** – `.../templates/registry.ts` stores the catalog (todos, messaging, recipes). `TemplateInstaller` can seed the runtime (`install`) or export a base64 snapshot via the new `saveTemplateToStudio` mutation.\n- **TemplateShell** – Shared UI wrapper that creates a `TemplateRuntimeProvider`, shows `LocalDataIndicator`, and (optionally) surfaces the new `SaveToStudioButton`.\n\n### Runtime Flows\n\n1. `/templates` now opens a modal that renders `TemplateShell` for each template. Users can explore without leaving the marketing site.\n2. `/studio` switches to a tabbed mini-app (Projects, Canvas, Specs, Deploy) to showcase Studio surfaces with mock data. Visitors see a **preview** shell, while authenticated users (Better Auth via Sigil) unlock full persistence, versioning, and deployment controls.\n3. `/sandbox` lets visitors pick a template and mode (Playground, Spec Editor, Visual Builder). The console at the bottom streams runtime events for transparency.\n\n### GraphQL Mutations\n\n- `saveTemplateToStudio(input: SaveTemplateInput!): SaveTemplateResult!` writes a placeholder project + spec so that templates installed from the sandbox appear in Studio. The mutation is intentionally simple right now: it records which template was imported, stores metadata, and returns `{ projectId, status: 'QUEUED' }` for the UI.\n- `saveCanvasDraft(input: SaveCanvasDraftInput!): CanvasVersion!` snapshots the current Visual Builder nodes to a draft version tied to a canvas overlay. Inputs include `canvasId`, arbitrary `nodes` JSON, and an optional `label`. The resolver enforces org/org access before calling `CanvasVersionManager`.\n- `deployCanvasVersion(input: DeployCanvasVersionInput!): CanvasVersion!` promotes a previously saved draft (`versionId`) to the deployed state. The returned object includes `status`, `nodes`, `createdAt`, and `createdBy` for UI timelines.\n- `undoCanvasVersion(input: UndoCanvasInput!): CanvasVersion` rewinds the visual builder to the prior snapshot (returns `null` when history is empty) so Studio’s toolbar can surface “Undo” without shelling out to local storage.\n\n### Studio GraphQL endpoint\n\n- The landing app exposes the Studio schema at `/api/studio/graphql` via Yoga so React Query hooks (`useStudioProjects`, `useCreateStudioProject`, `useDeployStudioProject`, etc.) can talk to the bundle without spinning up a separate server.\n\n### Spec Editor typing\n\n- Studio’s spec editor now preloads Monaco with ambient declarations for `@lssm/lib.contracts` and `zod`, so snippets receive autocomplete and inline errors even before the spec ships to the backend. The helper lives in `presentation/components/studio/organisms/monaco-spec-types.ts` and registers the extra libs once per browser session via `monaco.languages.typescript.typescriptDefaults.addExtraLib`.\n- Compiler options are aligned with our frontend toolchain (ES2020 + React JSX) which means drafts written in the editor behave like the compiled artifacts that flow through Studio pipelines.\n\n### Spec templates\n\n- Selecting a spec type now injects a ready-to-edit scaffold (capability, workflow, policy, dataview, component) so authors start from a canonical layout instead of a blank file. Templates live alongside `SpecEditor.tsx`, and we only overwrite the content when the previous value is empty or when the author explicitly switches types via the dropdown.\n\n### Spec preview\n\n- The validation side panel now embeds a `SpecPreview` widget that shows validation errors alongside transport artifacts (GraphQL schema, REST endpoints, component summaries) once a preview run completes. Tabs let authors toggle between “Validation” and “Artifacts,” mirroring the UX described in the Studio plan.\n\n### Testing\n\n- `src/templates/__tests__/runtime.test.ts` covers todos CRUD, messaging delivery, and recipe locale switching through the local GraphQL API.\n- Studio infrastructure tests live in `src/__tests__/e2e/project-lifecycle.test.ts` and continue to exercise project creation + deploy flows.\n\n### Next Steps\n\nFuture templates can register their React components via `registerTemplateComponents(templateId, components)` so TemplateShell can render them automatically. When new templates are added, remember to:\n\n1. Update the registry entry (schema + tags).\n2. Register components inside `presentation/components/templates`.\n3. Document the template under `docs/templates/`.\n\n\n\n\n\n"
|
|
17
|
+
}];
|
|
18
|
+
registerDocBlocks(tech_templates_runtime_DocBlocks);
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
//# sourceMappingURL=runtime.docblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.docblock.js","names":[],"sources":["../../../../../../../../../libs/contracts/dist/docs/tech/templates/runtime.docblock.js"],"sourcesContent":["import { registerDocBlocks } from \"../../registry.js\";\n\n//#region src/docs/tech/templates/runtime.docblock.ts\nconst tech_templates_runtime_DocBlocks = [{\n\tid: \"docs.tech.templates.runtime\",\n\ttitle: \"ContractSpec Template Runtime (Phase 9)\",\n\tsummary: \"Phase 9 introduces a full local-first runtime for templates so anyone can preview apps directly in the browser without provisioning any infrastructure.\",\n\tkind: \"reference\",\n\tvisibility: \"public\",\n\troute: \"/docs/tech/templates/runtime\",\n\ttags: [\n\t\t\"tech\",\n\t\t\"templates\",\n\t\t\"runtime\"\n\t],\n\tbody: \"## ContractSpec Template Runtime (Phase 9)\\n\\nPhase 9 introduces a full local-first runtime for templates so anyone can preview apps directly in the browser without provisioning any infrastructure.\\n\\n### Building Blocks\\n\\n- **Local database** – `@lssm/lib.runtime-local` wraps `sql.js` (SQLite WASM) and `IndexedDB` so we can seed demo data, run migrations, and persist state between sessions. Tests point the runtime to `node_modules/sql.js/dist` so CI doesn’t need a browser.\\n- **Local GraphQL** – `LocalGraphQLClient` wires Apollo Client + SchemaLink to resolvers for tasks, messaging, and i18n recipes. All `/templates`, `/studio`, and `/sandbox` previews use those resolvers so we never call remote APIs during demos.\\n- **Template registry + installer** – `.../templates/registry.ts` stores the catalog (todos, messaging, recipes). `TemplateInstaller` can seed the runtime (`install`) or export a base64 snapshot via the new `saveTemplateToStudio` mutation.\\n- **TemplateShell** – Shared UI wrapper that creates a `TemplateRuntimeProvider`, shows `LocalDataIndicator`, and (optionally) surfaces the new `SaveToStudioButton`.\\n\\n### Runtime Flows\\n\\n1. `/templates` now opens a modal that renders `TemplateShell` for each template. Users can explore without leaving the marketing site.\\n2. `/studio` switches to a tabbed mini-app (Projects, Canvas, Specs, Deploy) to showcase Studio surfaces with mock data. Visitors see a **preview** shell, while authenticated users (Better Auth via Sigil) unlock full persistence, versioning, and deployment controls.\\n3. `/sandbox` lets visitors pick a template and mode (Playground, Spec Editor, Visual Builder). The console at the bottom streams runtime events for transparency.\\n\\n### GraphQL Mutations\\n\\n- `saveTemplateToStudio(input: SaveTemplateInput!): SaveTemplateResult!` writes a placeholder project + spec so that templates installed from the sandbox appear in Studio. The mutation is intentionally simple right now: it records which template was imported, stores metadata, and returns `{ projectId, status: 'QUEUED' }` for the UI.\\n- `saveCanvasDraft(input: SaveCanvasDraftInput!): CanvasVersion!` snapshots the current Visual Builder nodes to a draft version tied to a canvas overlay. Inputs include `canvasId`, arbitrary `nodes` JSON, and an optional `label`. The resolver enforces org/org access before calling `CanvasVersionManager`.\\n- `deployCanvasVersion(input: DeployCanvasVersionInput!): CanvasVersion!` promotes a previously saved draft (`versionId`) to the deployed state. The returned object includes `status`, `nodes`, `createdAt`, and `createdBy` for UI timelines.\\n- `undoCanvasVersion(input: UndoCanvasInput!): CanvasVersion` rewinds the visual builder to the prior snapshot (returns `null` when history is empty) so Studio’s toolbar can surface “Undo” without shelling out to local storage.\\n\\n### Studio GraphQL endpoint\\n\\n- The landing app exposes the Studio schema at `/api/studio/graphql` via Yoga so React Query hooks (`useStudioProjects`, `useCreateStudioProject`, `useDeployStudioProject`, etc.) can talk to the bundle without spinning up a separate server.\\n\\n### Spec Editor typing\\n\\n- Studio’s spec editor now preloads Monaco with ambient declarations for `@lssm/lib.contracts` and `zod`, so snippets receive autocomplete and inline errors even before the spec ships to the backend. The helper lives in `presentation/components/studio/organisms/monaco-spec-types.ts` and registers the extra libs once per browser session via `monaco.languages.typescript.typescriptDefaults.addExtraLib`.\\n- Compiler options are aligned with our frontend toolchain (ES2020 + React JSX) which means drafts written in the editor behave like the compiled artifacts that flow through Studio pipelines.\\n\\n### Spec templates\\n\\n- Selecting a spec type now injects a ready-to-edit scaffold (capability, workflow, policy, dataview, component) so authors start from a canonical layout instead of a blank file. Templates live alongside `SpecEditor.tsx`, and we only overwrite the content when the previous value is empty or when the author explicitly switches types via the dropdown.\\n\\n### Spec preview\\n\\n- The validation side panel now embeds a `SpecPreview` widget that shows validation errors alongside transport artifacts (GraphQL schema, REST endpoints, component summaries) once a preview run completes. Tabs let authors toggle between “Validation” and “Artifacts,” mirroring the UX described in the Studio plan.\\n\\n### Testing\\n\\n- `src/templates/__tests__/runtime.test.ts` covers todos CRUD, messaging delivery, and recipe locale switching through the local GraphQL API.\\n- Studio infrastructure tests live in `src/__tests__/e2e/project-lifecycle.test.ts` and continue to exercise project creation + deploy flows.\\n\\n### Next Steps\\n\\nFuture templates can register their React components via `registerTemplateComponents(templateId, components)` so TemplateShell can render them automatically. When new templates are added, remember to:\\n\\n1. Update the registry entry (schema + tags).\\n2. Register components inside `presentation/components/templates`.\\n3. Document the template under `docs/templates/`.\\n\\n\\n\\n\\n\\n\"\n}];\nregisterDocBlocks(tech_templates_runtime_DocBlocks);\n\n//#endregion\nexport { tech_templates_runtime_DocBlocks };\n//# sourceMappingURL=runtime.docblock.js.map"],"mappings":";;;AAGA,MAAM,mCAAmC,CAAC;CACzC,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EACL;EACA;EACA;EACA;CACD,MAAM;CACN,CAAC;AACF,kBAAkB,iCAAiC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { registerDocBlocks } from "../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/dist/docs/tech/vscode-extension.docblock.js
|
|
4
|
+
const tech_vscode_extension_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.vscode.extension",
|
|
6
|
+
title: "ContractSpec VS Code Extension",
|
|
7
|
+
summary: "VS Code extension for spec-first development with validation, scaffolding, and MCP integration.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/vscode/extension",
|
|
11
|
+
tags: [
|
|
12
|
+
"vscode",
|
|
13
|
+
"extension",
|
|
14
|
+
"tooling",
|
|
15
|
+
"dx"
|
|
16
|
+
],
|
|
17
|
+
body: `# ContractSpec VS Code Extension
|
|
18
|
+
|
|
19
|
+
The ContractSpec VS Code extension provides spec-first development tooling directly in your editor.
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- **Real-time Validation**: Get instant feedback on spec errors and warnings as you save files
|
|
24
|
+
- **Build/Scaffold**: Generate handler and component skeletons from specs (no AI required)
|
|
25
|
+
- **Spec Explorer**: List and navigate all specs in your workspace
|
|
26
|
+
- **Dependency Analysis**: Visualize spec dependencies and detect cycles
|
|
27
|
+
- **MCP Integration**: Search ContractSpec documentation via Model Context Protocol
|
|
28
|
+
- **Snippets**: Code snippets for common ContractSpec patterns
|
|
29
|
+
|
|
30
|
+
## Commands
|
|
31
|
+
|
|
32
|
+
| Command | Description |
|
|
33
|
+
|---------|-------------|
|
|
34
|
+
| \`ContractSpec: Validate Current Spec\` | Validate the currently open spec file |
|
|
35
|
+
| \`ContractSpec: Validate All Specs\` | Validate all spec files in the workspace |
|
|
36
|
+
| \`ContractSpec: Build/Scaffold\` | Generate handler/component from the current spec |
|
|
37
|
+
| \`ContractSpec: List All Specs\` | Show all specs in the workspace |
|
|
38
|
+
| \`ContractSpec: Analyze Dependencies\` | Analyze and visualize spec dependencies |
|
|
39
|
+
| \`ContractSpec: Search Docs (MCP)\` | Search documentation via MCP |
|
|
40
|
+
|
|
41
|
+
## Configuration
|
|
42
|
+
|
|
43
|
+
| Setting | Description | Default |
|
|
44
|
+
|---------|-------------|---------|
|
|
45
|
+
| \`contractspec.api.baseUrl\` | Base URL for ContractSpec API (enables MCP + remote telemetry) | \`""\` |
|
|
46
|
+
| \`contractspec.telemetry.posthogHost\` | PostHog host URL for direct telemetry | \`"https://eu.posthog.com"\` |
|
|
47
|
+
| \`contractspec.telemetry.posthogProjectKey\` | PostHog project key for direct telemetry | \`""\` |
|
|
48
|
+
| \`contractspec.validation.onSave\` | Run validation on save | \`true\` |
|
|
49
|
+
| \`contractspec.validation.onOpen\` | Run validation on open | \`true\` |
|
|
50
|
+
|
|
51
|
+
## Architecture
|
|
52
|
+
|
|
53
|
+
The extension uses:
|
|
54
|
+
- \`@lssm/module.contractspec-workspace\` for pure analysis + templates
|
|
55
|
+
- \`@lssm/bundle.contractspec-workspace\` for workspace services + adapters
|
|
56
|
+
|
|
57
|
+
This allows the extension to work without requiring the CLI to be installed.
|
|
58
|
+
|
|
59
|
+
## Telemetry
|
|
60
|
+
|
|
61
|
+
The extension uses a hybrid telemetry approach:
|
|
62
|
+
1. If \`contractspec.api.baseUrl\` is configured → send to API \`/api/telemetry/ingest\`
|
|
63
|
+
2. Otherwise → send directly to PostHog (if project key configured)
|
|
64
|
+
|
|
65
|
+
Telemetry respects VS Code's telemetry settings. No file paths, source code, or PII is collected.
|
|
66
|
+
`
|
|
67
|
+
}, {
|
|
68
|
+
id: "docs.tech.vscode.snippets",
|
|
69
|
+
title: "ContractSpec Snippets",
|
|
70
|
+
summary: "Code snippets for common ContractSpec patterns in VS Code.",
|
|
71
|
+
kind: "reference",
|
|
72
|
+
visibility: "public",
|
|
73
|
+
route: "/docs/tech/vscode/snippets",
|
|
74
|
+
tags: [
|
|
75
|
+
"vscode",
|
|
76
|
+
"snippets",
|
|
77
|
+
"dx"
|
|
78
|
+
],
|
|
79
|
+
body: `# ContractSpec Snippets
|
|
80
|
+
|
|
81
|
+
The VS Code extension includes snippets for common ContractSpec patterns.
|
|
82
|
+
|
|
83
|
+
## Available Snippets
|
|
84
|
+
|
|
85
|
+
| Prefix | Description |
|
|
86
|
+
|--------|-------------|
|
|
87
|
+
| \`contractspec-command\` | Create a new command (write operation) |
|
|
88
|
+
| \`contractspec-query\` | Create a new query (read-only operation) |
|
|
89
|
+
| \`contractspec-event\` | Create a new event |
|
|
90
|
+
| \`contractspec-docblock\` | Create a new DocBlock |
|
|
91
|
+
| \`contractspec-telemetry\` | Create a new TelemetrySpec |
|
|
92
|
+
| \`contractspec-presentation\` | Create a new Presentation |
|
|
93
|
+
|
|
94
|
+
## Usage
|
|
95
|
+
|
|
96
|
+
Type the prefix in a TypeScript file and press Tab to expand the snippet. Tab through the placeholders to fill in your values.
|
|
97
|
+
`
|
|
98
|
+
}];
|
|
99
|
+
registerDocBlocks(tech_vscode_extension_DocBlocks);
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
//# sourceMappingURL=vscode-extension.docblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vscode-extension.docblock.js","names":[],"sources":["../../../../../../../../libs/contracts/dist/docs/tech/vscode-extension.docblock.js"],"sourcesContent":["import { registerDocBlocks } from \"../registry.js\";\n\n//#region src/docs/tech/vscode-extension.docblock.ts\nconst tech_vscode_extension_DocBlocks = [{\n\tid: \"docs.tech.vscode.extension\",\n\ttitle: \"ContractSpec VS Code Extension\",\n\tsummary: \"VS Code extension for spec-first development with validation, scaffolding, and MCP integration.\",\n\tkind: \"reference\",\n\tvisibility: \"public\",\n\troute: \"/docs/tech/vscode/extension\",\n\ttags: [\n\t\t\"vscode\",\n\t\t\"extension\",\n\t\t\"tooling\",\n\t\t\"dx\"\n\t],\n\tbody: `# ContractSpec VS Code Extension\n\nThe ContractSpec VS Code extension provides spec-first development tooling directly in your editor.\n\n## Features\n\n- **Real-time Validation**: Get instant feedback on spec errors and warnings as you save files\n- **Build/Scaffold**: Generate handler and component skeletons from specs (no AI required)\n- **Spec Explorer**: List and navigate all specs in your workspace\n- **Dependency Analysis**: Visualize spec dependencies and detect cycles\n- **MCP Integration**: Search ContractSpec documentation via Model Context Protocol\n- **Snippets**: Code snippets for common ContractSpec patterns\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| \\`ContractSpec: Validate Current Spec\\` | Validate the currently open spec file |\n| \\`ContractSpec: Validate All Specs\\` | Validate all spec files in the workspace |\n| \\`ContractSpec: Build/Scaffold\\` | Generate handler/component from the current spec |\n| \\`ContractSpec: List All Specs\\` | Show all specs in the workspace |\n| \\`ContractSpec: Analyze Dependencies\\` | Analyze and visualize spec dependencies |\n| \\`ContractSpec: Search Docs (MCP)\\` | Search documentation via MCP |\n\n## Configuration\n\n| Setting | Description | Default |\n|---------|-------------|---------|\n| \\`contractspec.api.baseUrl\\` | Base URL for ContractSpec API (enables MCP + remote telemetry) | \\`\"\"\\` |\n| \\`contractspec.telemetry.posthogHost\\` | PostHog host URL for direct telemetry | \\`\"https://eu.posthog.com\"\\` |\n| \\`contractspec.telemetry.posthogProjectKey\\` | PostHog project key for direct telemetry | \\`\"\"\\` |\n| \\`contractspec.validation.onSave\\` | Run validation on save | \\`true\\` |\n| \\`contractspec.validation.onOpen\\` | Run validation on open | \\`true\\` |\n\n## Architecture\n\nThe extension uses:\n- \\`@lssm/module.contractspec-workspace\\` for pure analysis + templates\n- \\`@lssm/bundle.contractspec-workspace\\` for workspace services + adapters\n\nThis allows the extension to work without requiring the CLI to be installed.\n\n## Telemetry\n\nThe extension uses a hybrid telemetry approach:\n1. If \\`contractspec.api.baseUrl\\` is configured → send to API \\`/api/telemetry/ingest\\`\n2. Otherwise → send directly to PostHog (if project key configured)\n\nTelemetry respects VS Code's telemetry settings. No file paths, source code, or PII is collected.\n`\n}, {\n\tid: \"docs.tech.vscode.snippets\",\n\ttitle: \"ContractSpec Snippets\",\n\tsummary: \"Code snippets for common ContractSpec patterns in VS Code.\",\n\tkind: \"reference\",\n\tvisibility: \"public\",\n\troute: \"/docs/tech/vscode/snippets\",\n\ttags: [\n\t\t\"vscode\",\n\t\t\"snippets\",\n\t\t\"dx\"\n\t],\n\tbody: `# ContractSpec Snippets\n\nThe VS Code extension includes snippets for common ContractSpec patterns.\n\n## Available Snippets\n\n| Prefix | Description |\n|--------|-------------|\n| \\`contractspec-command\\` | Create a new command (write operation) |\n| \\`contractspec-query\\` | Create a new query (read-only operation) |\n| \\`contractspec-event\\` | Create a new event |\n| \\`contractspec-docblock\\` | Create a new DocBlock |\n| \\`contractspec-telemetry\\` | Create a new TelemetrySpec |\n| \\`contractspec-presentation\\` | Create a new Presentation |\n\n## Usage\n\nType the prefix in a TypeScript file and press Tab to expand the snippet. Tab through the placeholders to fill in your values.\n`\n}];\nregisterDocBlocks(tech_vscode_extension_DocBlocks);\n\n//#endregion\nexport { tech_vscode_extension_DocBlocks };\n//# sourceMappingURL=vscode-extension.docblock.js.map"],"mappings":";;;AAGA,MAAM,kCAAkC,CAAC;CACxC,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EACL;EACA;EACA;EACA;EACA;CACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDN,EAAE;CACF,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EACL;EACA;EACA;EACA;CACD,MAAM;;;;;;;;;;;;;;;;;;;CAmBN,CAAC;AACF,kBAAkB,gCAAgC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { registerDocBlocks } from "../../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/dist/docs/tech/workflows/overview.docblock.js
|
|
4
|
+
const tech_workflows_overview_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.workflows.overview",
|
|
6
|
+
title: "WorkflowSpec Overview",
|
|
7
|
+
summary: "WorkflowSpec provides a declarative, versioned format for long-running flows that mix automation and human review. Specs stay inside `@lssm/lib.contracts` (`src/workflow/spec.ts`) so the same definition powers runtime execution, documentation, and future generation.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/workflows/overview",
|
|
11
|
+
tags: [
|
|
12
|
+
"tech",
|
|
13
|
+
"workflows",
|
|
14
|
+
"overview"
|
|
15
|
+
],
|
|
16
|
+
body: "# WorkflowSpec Overview\n\n## Purpose\n\nWorkflowSpec provides a declarative, versioned format for long-running flows that mix automation and human review. Specs stay inside `@lssm/lib.contracts` (`src/workflow/spec.ts`) so the same definition powers runtime execution, documentation, and future generation.\n\n## Core Types\n\n- `WorkflowMeta`: ownership metadata (`title`, `domain`, `owners`, `tags`, `stability`) plus `name` and `version`.\n- `WorkflowDefinition`:\n - `entryStepId?`: optional explicit entry point (defaults to first step).\n - `steps[]`: ordered list of `Step` descriptors.\n - `transitions[]`: directed edges between steps with optional expressions.\n - `sla?`: aggregated timing hints for the overall flow or per-step budgets.\n - `compensation?`: fallback operations executed when a workflow is rolled back or fails.\n- `Step`:\n - `type`: `human`, `automation`, or `decision`.\n - `action`: references either a `ContractSpec` (`operation`) or `FormSpec` (`form`).\n - Optional `guard`, `timeoutMs`, and retry policy (`maxAttempts`, `backoff`, `delayMs`, `maxDelayMs?`).\n - `requiredIntegrations?`: integration slot ids that must be bound before the step may execute.\n - `requiredCapabilities?`: `CapabilityRef[]` that must be enabled in the resolved app config.\n- `Transition`: `from` → `to` with optional `condition` string (simple data expressions).\n\n## Registry & Validation\n\n- `WorkflowRegistry` (`src/workflow/spec.ts`) stores specs by key `<name>.v<version>` and exposes `register`, `list`, and `get`.\n- `validateWorkflowSpec()` (`src/workflow/validation.ts`) checks:\n - Duplicate step IDs.\n - Unknown `from`/`to` transitions.\n - Empty guards/conditions.\n - Reachability from the entry step.\n - Cycles in the graph.\n - Operation/Form references against provided registries.\n- `assertWorkflowSpecValid()` wraps validation and throws `WorkflowValidationError` when errors remain.\n\n## Runtime\n\n- `WorkflowRunner` (`src/workflow/runner.ts`) executes workflows and coordinates steps.\n - `start(name, version?, initialData?)` returns a `workflowId`.\n - `executeStep(workflowId, input?)` runs the current step (automation or human).\n - `getState(workflowId)` retrieves the latest state snapshot.\n - `cancel(workflowId)` marks the workflow as cancelled.\n - `preFlightCheck(name, version?, resolvedConfig?)` evaluates integration/capability requirements before the workflow starts.\n - Throws `WorkflowPreFlightError` if required integration slots are unbound or required capabilities are disabled.\n- `StateStore` (`src/workflow/state.ts`) abstracts persistence. V1 ships with:\n - `InMemoryStateStore` (`src/workflow/adapters/memory-store.ts`) for tests/dev.\n - Placeholder factories for file/database adapters (`adapters/file-adapter.ts`, `adapters/db-adapter.ts`).\n- Guard evaluation: expression guards run through `evaluateExpression()` (`src/workflow/expression.ts`); custom policy guards can be provided via `guardEvaluator`.\n- Events: the runner emits `workflow.started`, `workflow.step_completed`, `workflow.step_failed`, and `workflow.cancelled` through the optional `eventEmitter`.\n- React bindings (`@lssm/lib.presentation-runtime-react`):\n - `useWorkflow` hook (polls state, exposes `executeStep`, `cancel`, `refresh`).\n - `WorkflowStepper` progress indicator using design-system Stepper.\n - `WorkflowStepRenderer` helper to render human/automation/decision steps with sensible fallbacks.\n\n## Authoring Checklist\n\n1. Reuse existing operations/forms; create new specs when missing.\n2. Prefer explicit `entryStepId` for clarity (especially with decision branches).\n3. Give automation steps an `operation` and human steps a `form` (warnings surface otherwise).\n4. Use short, meaningful step IDs (`submit`, `review`, `finalize`) to simplify analytics.\n5. Keep guard expressions deterministic; complex policy logic should move to PolicySpec (Phase 2).\n\n## Testing\n\n- Add unit tests for new workflows via `assertWorkflowSpecValid`.\n- Use the new Vitest suites (`validation.test.ts`, `expression.test.ts`, `runner.test.ts`) as examples.\n- CLI support will arrive in Phase 1 PR 3 (`contractspec create --type workflow`).\n\n## Tooling\n\n- `contractspec create --type workflow` scaffolds a WorkflowSpec with interactive prompts.\n- `contractspec build <spec.workflow.ts>` generates a runner scaffold (`.runner.ts`) wired to `WorkflowRunner` and the in-memory store.\n- `contractspec validate` understands `.workflow.ts` files and checks core structure (meta, steps, transitions).\n\n## Next Steps (Non-MVP)\n\n- Persistence adapters (database/file) for workflow state (Phase 2).\n- React bindings (`useWorkflow`, `WorkflowStepper`) and presentation-runtime integration (PR 3).\n- Policy engine integration (`guard.type === 'policy'` validated against PolicySpec).\n- Telemetry hooks for step execution metrics.\n\n"
|
|
17
|
+
}];
|
|
18
|
+
registerDocBlocks(tech_workflows_overview_DocBlocks);
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
//# sourceMappingURL=overview.docblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overview.docblock.js","names":[],"sources":["../../../../../../../../../libs/contracts/dist/docs/tech/workflows/overview.docblock.js"],"sourcesContent":["import { registerDocBlocks } from \"../../registry.js\";\n\n//#region src/docs/tech/workflows/overview.docblock.ts\nconst tech_workflows_overview_DocBlocks = [{\n\tid: \"docs.tech.workflows.overview\",\n\ttitle: \"WorkflowSpec Overview\",\n\tsummary: \"WorkflowSpec provides a declarative, versioned format for long-running flows that mix automation and human review. Specs stay inside `@lssm/lib.contracts` (`src/workflow/spec.ts`) so the same definition powers runtime execution, documentation, and future generation.\",\n\tkind: \"reference\",\n\tvisibility: \"public\",\n\troute: \"/docs/tech/workflows/overview\",\n\ttags: [\n\t\t\"tech\",\n\t\t\"workflows\",\n\t\t\"overview\"\n\t],\n\tbody: \"# WorkflowSpec Overview\\n\\n## Purpose\\n\\nWorkflowSpec provides a declarative, versioned format for long-running flows that mix automation and human review. Specs stay inside `@lssm/lib.contracts` (`src/workflow/spec.ts`) so the same definition powers runtime execution, documentation, and future generation.\\n\\n## Core Types\\n\\n- `WorkflowMeta`: ownership metadata (`title`, `domain`, `owners`, `tags`, `stability`) plus `name` and `version`.\\n- `WorkflowDefinition`:\\n - `entryStepId?`: optional explicit entry point (defaults to first step).\\n - `steps[]`: ordered list of `Step` descriptors.\\n - `transitions[]`: directed edges between steps with optional expressions.\\n - `sla?`: aggregated timing hints for the overall flow or per-step budgets.\\n - `compensation?`: fallback operations executed when a workflow is rolled back or fails.\\n- `Step`:\\n - `type`: `human`, `automation`, or `decision`.\\n - `action`: references either a `ContractSpec` (`operation`) or `FormSpec` (`form`).\\n - Optional `guard`, `timeoutMs`, and retry policy (`maxAttempts`, `backoff`, `delayMs`, `maxDelayMs?`).\\n - `requiredIntegrations?`: integration slot ids that must be bound before the step may execute.\\n - `requiredCapabilities?`: `CapabilityRef[]` that must be enabled in the resolved app config.\\n- `Transition`: `from` → `to` with optional `condition` string (simple data expressions).\\n\\n## Registry & Validation\\n\\n- `WorkflowRegistry` (`src/workflow/spec.ts`) stores specs by key `<name>.v<version>` and exposes `register`, `list`, and `get`.\\n- `validateWorkflowSpec()` (`src/workflow/validation.ts`) checks:\\n - Duplicate step IDs.\\n - Unknown `from`/`to` transitions.\\n - Empty guards/conditions.\\n - Reachability from the entry step.\\n - Cycles in the graph.\\n - Operation/Form references against provided registries.\\n- `assertWorkflowSpecValid()` wraps validation and throws `WorkflowValidationError` when errors remain.\\n\\n## Runtime\\n\\n- `WorkflowRunner` (`src/workflow/runner.ts`) executes workflows and coordinates steps.\\n - `start(name, version?, initialData?)` returns a `workflowId`.\\n - `executeStep(workflowId, input?)` runs the current step (automation or human).\\n - `getState(workflowId)` retrieves the latest state snapshot.\\n - `cancel(workflowId)` marks the workflow as cancelled.\\n - `preFlightCheck(name, version?, resolvedConfig?)` evaluates integration/capability requirements before the workflow starts.\\n - Throws `WorkflowPreFlightError` if required integration slots are unbound or required capabilities are disabled.\\n- `StateStore` (`src/workflow/state.ts`) abstracts persistence. V1 ships with:\\n - `InMemoryStateStore` (`src/workflow/adapters/memory-store.ts`) for tests/dev.\\n - Placeholder factories for file/database adapters (`adapters/file-adapter.ts`, `adapters/db-adapter.ts`).\\n- Guard evaluation: expression guards run through `evaluateExpression()` (`src/workflow/expression.ts`); custom policy guards can be provided via `guardEvaluator`.\\n- Events: the runner emits `workflow.started`, `workflow.step_completed`, `workflow.step_failed`, and `workflow.cancelled` through the optional `eventEmitter`.\\n- React bindings (`@lssm/lib.presentation-runtime-react`):\\n - `useWorkflow` hook (polls state, exposes `executeStep`, `cancel`, `refresh`).\\n - `WorkflowStepper` progress indicator using design-system Stepper.\\n - `WorkflowStepRenderer` helper to render human/automation/decision steps with sensible fallbacks.\\n\\n## Authoring Checklist\\n\\n1. Reuse existing operations/forms; create new specs when missing.\\n2. Prefer explicit `entryStepId` for clarity (especially with decision branches).\\n3. Give automation steps an `operation` and human steps a `form` (warnings surface otherwise).\\n4. Use short, meaningful step IDs (`submit`, `review`, `finalize`) to simplify analytics.\\n5. Keep guard expressions deterministic; complex policy logic should move to PolicySpec (Phase 2).\\n\\n## Testing\\n\\n- Add unit tests for new workflows via `assertWorkflowSpecValid`.\\n- Use the new Vitest suites (`validation.test.ts`, `expression.test.ts`, `runner.test.ts`) as examples.\\n- CLI support will arrive in Phase 1 PR 3 (`contractspec create --type workflow`).\\n\\n## Tooling\\n\\n- `contractspec create --type workflow` scaffolds a WorkflowSpec with interactive prompts.\\n- `contractspec build <spec.workflow.ts>` generates a runner scaffold (`.runner.ts`) wired to `WorkflowRunner` and the in-memory store.\\n- `contractspec validate` understands `.workflow.ts` files and checks core structure (meta, steps, transitions).\\n\\n## Next Steps (Non-MVP)\\n\\n- Persistence adapters (database/file) for workflow state (Phase 2).\\n- React bindings (`useWorkflow`, `WorkflowStepper`) and presentation-runtime integration (PR 3).\\n- Policy engine integration (`guard.type === 'policy'` validated against PolicySpec).\\n- Telemetry hooks for step execution metrics.\\n\\n\"\n}];\nregisterDocBlocks(tech_workflows_overview_DocBlocks);\n\n//#endregion\nexport { tech_workflows_overview_DocBlocks };\n//# sourceMappingURL=overview.docblock.js.map"],"mappings":";;;AAGA,MAAM,oCAAoC,CAAC;CAC1C,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EACL;EACA;EACA;EACA;CACD,MAAM;CACN,CAAC;AACF,kBAAkB,kCAAkC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { registerDocBlocks } from "./registry.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/dist/docs/tech-contracts.docs.js
|
|
4
|
+
const techContractsDocs = [{
|
|
5
|
+
id: "docs.tech.contracts.presentations-v2",
|
|
6
|
+
title: "Presentations V2 — Unified Descriptor & Transform Engine",
|
|
7
|
+
summary: "How PresentationDescriptorV2 and TransformEngine keep docs/renderers consistent.",
|
|
8
|
+
visibility: "public",
|
|
9
|
+
route: "/docs/tech/contracts/presentations-v2",
|
|
10
|
+
kind: "reference",
|
|
11
|
+
tags: [
|
|
12
|
+
"presentations",
|
|
13
|
+
"docs",
|
|
14
|
+
"mcp"
|
|
15
|
+
],
|
|
16
|
+
body: `## Presentations V2 — Unified Descriptor & Transform Engine
|
|
17
|
+
|
|
18
|
+
### Purpose
|
|
19
|
+
|
|
20
|
+
Unify presentations into one descriptor (\`PresentationDescriptorV2\`) that declares a single source (React component key or BlockNote doc) and a list of output targets (react, markdown, application/json, application/xml). A pluggable \`TransformEngine\` renders any target and applies PII redaction.
|
|
21
|
+
|
|
22
|
+
### Types
|
|
23
|
+
|
|
24
|
+
\`\`\`ts
|
|
25
|
+
type PresentationTarget =
|
|
26
|
+
| 'react'
|
|
27
|
+
| 'markdown'
|
|
28
|
+
| 'application/json'
|
|
29
|
+
| 'application/xml';
|
|
30
|
+
|
|
31
|
+
type PresentationSource =
|
|
32
|
+
| {
|
|
33
|
+
type: 'component';
|
|
34
|
+
framework: 'react';
|
|
35
|
+
componentKey: string;
|
|
36
|
+
props?: AnySchemaModel;
|
|
37
|
+
}
|
|
38
|
+
| { type: 'blocknotejs'; docJson: unknown; blockConfig?: unknown };
|
|
39
|
+
|
|
40
|
+
interface PresentationDescriptorV2 {
|
|
41
|
+
meta: PresentationV2Meta; // includes partial OwnerShipMeta + description
|
|
42
|
+
policy?: { flags?: string[]; pii?: string[] };
|
|
43
|
+
source: PresentationSource;
|
|
44
|
+
targets: PresentationTarget[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Shared ownership schema (source of truth in @lssm/lib.contracts/src/ownership.ts)
|
|
48
|
+
interface OwnerShipMeta {
|
|
49
|
+
title: string;
|
|
50
|
+
description: string;
|
|
51
|
+
domain: string;
|
|
52
|
+
owners: Owner[];
|
|
53
|
+
tags: Tag[];
|
|
54
|
+
stability: Stability;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type Stability = 'experimental' | 'beta' | 'stable' | 'deprecated';
|
|
58
|
+
type Owner = string; // curated list available in code (e.g., '@sigil-team', 'team-strit')
|
|
59
|
+
type Tag = string; // curated list available in code (e.g., 'auth', 'spots')
|
|
60
|
+
|
|
61
|
+
// For V2 presentations, meta is a Partial<OwnerShipMeta> plus description, name, version
|
|
62
|
+
interface PresentationV2Meta extends Partial<OwnerShipMeta> {
|
|
63
|
+
name: string;
|
|
64
|
+
version: number;
|
|
65
|
+
description?: string;
|
|
66
|
+
}
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
### Engine
|
|
70
|
+
|
|
71
|
+
Use \`createDefaultTransformEngine()\` and register custom renderers as needed (e.g., high-fidelity BlockNote → Markdown). The default engine supports markdown/json/xml; a React renderer returns a serializable descriptor the host app renders via a \`componentMap\` or a BlockNote renderer. The canonical source type string is \`blocknotejs\` (not \`blocknote\`).
|
|
72
|
+
|
|
73
|
+
PII paths (JSON-like) are redacted from rendered outputs.
|
|
74
|
+
|
|
75
|
+
### MCP Integration
|
|
76
|
+
|
|
77
|
+
\`createMcpServer\` accepts \`presentationsV2\`. Each descriptor is exposed under \`presentation://<name>/v<version>\` and negotiated variants (\`.md/.json/.xml\`) are rendered by the engine.
|
|
78
|
+
|
|
79
|
+
### Migration
|
|
80
|
+
|
|
81
|
+
- V1 \`PresentationSpec\` remains supported; a back-compat helper converts V1 → V2 when convenient.
|
|
82
|
+
- Prefer V2 for new work.
|
|
83
|
+
|
|
84
|
+
### Examples (Sigil)
|
|
85
|
+
|
|
86
|
+
- \`sigil.auth.webauth_tabs_v2\`: component source (\`componentKey: 'sigil.webauth.tabs'\`), targets \`react/json/xml\`.
|
|
87
|
+
- \`sigil.signup.guide_v2\`: BlockNote doc source, targets \`react/markdown/json/xml\`.
|
|
88
|
+
|
|
89
|
+
### React Rendering
|
|
90
|
+
|
|
91
|
+
Host apps use a \`componentMap\` (e.g., \`'sigil.webauth.tabs' → WebAuthTabs\`) and a BlockNote renderer to turn the React render descriptor into elements.`
|
|
92
|
+
}];
|
|
93
|
+
registerDocBlocks(techContractsDocs);
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
export { techContractsDocs };
|
|
97
|
+
//# sourceMappingURL=tech-contracts.docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tech-contracts.docs.js","names":[],"sources":["../../../../../../../libs/contracts/dist/docs/tech-contracts.docs.js"],"sourcesContent":["import { registerDocBlocks } from \"./registry.js\";\n\n//#region src/docs/tech-contracts.docs.ts\nconst techContractsDocs = [{\n\tid: \"docs.tech.contracts.presentations-v2\",\n\ttitle: \"Presentations V2 — Unified Descriptor & Transform Engine\",\n\tsummary: \"How PresentationDescriptorV2 and TransformEngine keep docs/renderers consistent.\",\n\tvisibility: \"public\",\n\troute: \"/docs/tech/contracts/presentations-v2\",\n\tkind: \"reference\",\n\ttags: [\n\t\t\"presentations\",\n\t\t\"docs\",\n\t\t\"mcp\"\n\t],\n\tbody: `## Presentations V2 — Unified Descriptor & Transform Engine\n\n### Purpose\n\nUnify presentations into one descriptor (\\`PresentationDescriptorV2\\`) that declares a single source (React component key or BlockNote doc) and a list of output targets (react, markdown, application/json, application/xml). A pluggable \\`TransformEngine\\` renders any target and applies PII redaction.\n\n### Types\n\n\\`\\`\\`ts\ntype PresentationTarget =\n | 'react'\n | 'markdown'\n | 'application/json'\n | 'application/xml';\n\ntype PresentationSource =\n | {\n type: 'component';\n framework: 'react';\n componentKey: string;\n props?: AnySchemaModel;\n }\n | { type: 'blocknotejs'; docJson: unknown; blockConfig?: unknown };\n\ninterface PresentationDescriptorV2 {\n meta: PresentationV2Meta; // includes partial OwnerShipMeta + description\n policy?: { flags?: string[]; pii?: string[] };\n source: PresentationSource;\n targets: PresentationTarget[];\n}\n\n// Shared ownership schema (source of truth in @lssm/lib.contracts/src/ownership.ts)\ninterface OwnerShipMeta {\n title: string;\n description: string;\n domain: string;\n owners: Owner[];\n tags: Tag[];\n stability: Stability;\n}\n\ntype Stability = 'experimental' | 'beta' | 'stable' | 'deprecated';\ntype Owner = string; // curated list available in code (e.g., '@sigil-team', 'team-strit')\ntype Tag = string; // curated list available in code (e.g., 'auth', 'spots')\n\n// For V2 presentations, meta is a Partial<OwnerShipMeta> plus description, name, version\ninterface PresentationV2Meta extends Partial<OwnerShipMeta> {\n name: string;\n version: number;\n description?: string;\n}\n\\`\\`\\`\n\n### Engine\n\nUse \\`createDefaultTransformEngine()\\` and register custom renderers as needed (e.g., high-fidelity BlockNote → Markdown). The default engine supports markdown/json/xml; a React renderer returns a serializable descriptor the host app renders via a \\`componentMap\\` or a BlockNote renderer. The canonical source type string is \\`blocknotejs\\` (not \\`blocknote\\`).\n\nPII paths (JSON-like) are redacted from rendered outputs.\n\n### MCP Integration\n\n\\`createMcpServer\\` accepts \\`presentationsV2\\`. Each descriptor is exposed under \\`presentation://<name>/v<version>\\` and negotiated variants (\\`.md/.json/.xml\\`) are rendered by the engine.\n\n### Migration\n\n- V1 \\`PresentationSpec\\` remains supported; a back-compat helper converts V1 → V2 when convenient.\n- Prefer V2 for new work.\n\n### Examples (Sigil)\n\n- \\`sigil.auth.webauth_tabs_v2\\`: component source (\\`componentKey: 'sigil.webauth.tabs'\\`), targets \\`react/json/xml\\`.\n- \\`sigil.signup.guide_v2\\`: BlockNote doc source, targets \\`react/markdown/json/xml\\`.\n\n### React Rendering\n\nHost apps use a \\`componentMap\\` (e.g., \\`'sigil.webauth.tabs' → WebAuthTabs\\`) and a BlockNote renderer to turn the React render descriptor into elements.`\n}];\nregisterDocBlocks(techContractsDocs);\n\n//#endregion\nexport { techContractsDocs };\n//# sourceMappingURL=tech-contracts.docs.js.map"],"mappings":";;;AAGA,MAAM,oBAAoB,CAAC;CAC1B,IAAI;CACJ,OAAO;CACP,SAAS;CACT,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;EACL;EACA;EACA;EACA;CACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4EN,CAAC;AACF,kBAAkB,kBAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rolldown_runtime.js","names":[],"sources":["../../../../../../../libs/design-system/dist/_virtual/rolldown_runtime.js"],"sourcesContent":["//#region rolldown:runtime\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);\nvar __export = (all, symbols) => {\n\tlet target = {};\n\tfor (var name in all) {\n\t\t__defProp(target, name, {\n\t\t\tget: all[name],\n\t\t\tenumerable: true\n\t\t});\n\t}\n\tif (symbols) {\n\t\t__defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\t}\n\treturn target;\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\t\tkey = keys[i];\n\t\t\tif (!__hasOwnProp.call(to, key) && key !== except) {\n\t\t\t\t__defProp(to, key, {\n\t\t\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __hasOwnProp.call(mod, \"module.exports\") ? mod[\"module.exports\"] : __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n//#endregion\nexport { __esmMin, __export, __toCommonJS };"],"mappings":";AAKA,IAAI,YAAY,IAAI,eAAe,OAAO,MAAM,GAAG,KAAK,EAAE,GAAG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Button as Button$1 } from "../../ui-kit-web/dist/ui/button.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Loader2 } from "lucide-react";
|
|
5
|
+
|
|
6
|
+
//#region ../../libs/design-system/dist/components/atoms/Button.js
|
|
7
|
+
function Button({ children, loading, spinnerPlacement = "start", onPress, onPressIn, onPressOut, onLongPress, onTouchStart, onTouchEnd, onTouchCancel, onMouseDown, onMouseUp, onClick, className, disabled, ...rest }) {
|
|
8
|
+
const isDisabled = Boolean(disabled || loading);
|
|
9
|
+
const content = !rest.asChild ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10
|
+
loading && spinnerPlacement === "start" ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : null,
|
|
11
|
+
children,
|
|
12
|
+
loading && spinnerPlacement === "end" ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : null
|
|
13
|
+
] }) : children;
|
|
14
|
+
return /* @__PURE__ */ jsx(Button$1, {
|
|
15
|
+
...rest,
|
|
16
|
+
className,
|
|
17
|
+
disabled: isDisabled,
|
|
18
|
+
"aria-busy": loading ? true : void 0,
|
|
19
|
+
"aria-disabled": isDisabled ? true : void 0,
|
|
20
|
+
onPress: onPress || onClick,
|
|
21
|
+
onClick: onPress || onClick,
|
|
22
|
+
onMouseDown: onMouseDown || onPressIn,
|
|
23
|
+
onMouseUp: onMouseUp || onPressOut,
|
|
24
|
+
onTouchStart,
|
|
25
|
+
onTouchEnd: onTouchEnd || onPressOut,
|
|
26
|
+
onTouchCancel: onTouchCancel || onPressOut,
|
|
27
|
+
type: rest?.type ?? "button",
|
|
28
|
+
children: content
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Button };
|
|
34
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","names":[],"sources":["../../../../../../../../libs/design-system/dist/components/atoms/Button.js"],"sourcesContent":["import { Button as Button$1 } from \"../../ui-kit-web/dist/ui/button.js\";\nimport \"react\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { Loader2 } from \"lucide-react\";\n\n//#region src/components/atoms/Button.tsx\nfunction Button({ children, loading, spinnerPlacement = \"start\", onPress, onPressIn, onPressOut, onLongPress, onTouchStart, onTouchEnd, onTouchCancel, onMouseDown, onMouseUp, onClick, className, disabled, ...rest }) {\n\tconst isDisabled = Boolean(disabled || loading);\n\tconst content = !rest.asChild ? /* @__PURE__ */ jsxs(Fragment, { children: [\n\t\tloading && spinnerPlacement === \"start\" ? /* @__PURE__ */ jsx(Loader2, { className: \"h-4 w-4 animate-spin\" }) : null,\n\t\tchildren,\n\t\tloading && spinnerPlacement === \"end\" ? /* @__PURE__ */ jsx(Loader2, { className: \"h-4 w-4 animate-spin\" }) : null\n\t] }) : children;\n\treturn /* @__PURE__ */ jsx(Button$1, {\n\t\t...rest,\n\t\tclassName,\n\t\tdisabled: isDisabled,\n\t\t\"aria-busy\": loading ? true : void 0,\n\t\t\"aria-disabled\": isDisabled ? true : void 0,\n\t\tonPress: onPress || onClick,\n\t\tonClick: onPress || onClick,\n\t\tonMouseDown: onMouseDown || onPressIn,\n\t\tonMouseUp: onMouseUp || onPressOut,\n\t\tonTouchStart,\n\t\tonTouchEnd: onTouchEnd || onPressOut,\n\t\tonTouchCancel: onTouchCancel || onPressOut,\n\t\ttype: rest?.type ?? \"button\",\n\t\tchildren: content\n\t});\n}\n\n//#endregion\nexport { Button };\n//# sourceMappingURL=Button.js.map"],"mappings":";;;;;;AAMA,SAAS,OAAO,EAAE,UAAU,SAAS,mBAAmB,SAAS,SAAS,WAAW,YAAY,aAAa,cAAc,YAAY,eAAe,aAAa,WAAW,SAAS,WAAW,UAAU,GAAG,QAAQ;CACvN,MAAM,aAAa,QAAQ,YAAY,QAAQ;CAC/C,MAAM,UAAU,CAAC,KAAK,UAA0B,qBAAK,UAAU,EAAE,UAAU;EAC1E,WAAW,qBAAqB,UAA0B,oBAAI,SAAS,EAAE,WAAW,wBAAwB,CAAC,GAAG;EAChH;EACA,WAAW,qBAAqB,QAAwB,oBAAI,SAAS,EAAE,WAAW,wBAAwB,CAAC,GAAG;EAC9G,EAAE,CAAC,GAAG;AACP,QAAuB,oBAAI,UAAU;EACpC,GAAG;EACH;EACA,UAAU;EACV,aAAa,UAAU,OAAO,KAAK;EACnC,iBAAiB,aAAa,OAAO,KAAK;EAC1C,SAAS,WAAW;EACpB,SAAS,WAAW;EACpB,aAAa,eAAe;EAC5B,WAAW,aAAa;EACxB;EACA,YAAY,cAAc;EAC1B,eAAe,iBAAiB;EAChC,MAAM,MAAM,QAAQ;EACpB,UAAU;EACV,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn, init_utils } from "../ui-kit-core/dist/utils.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
+
|
|
7
|
+
//#region ../../libs/design-system/dist/ui-kit-web/dist/ui/button.js
|
|
8
|
+
init_utils();
|
|
9
|
+
const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
14
|
+
outline: "border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
15
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
16
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
17
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
21
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
22
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
23
|
+
icon: "size-9"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const Button = React$1.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
32
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
33
|
+
"data-slot": "button",
|
|
34
|
+
className: cn(buttonVariants({
|
|
35
|
+
variant,
|
|
36
|
+
size,
|
|
37
|
+
className
|
|
38
|
+
})),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
return /* @__PURE__ */ jsx("button", {
|
|
42
|
+
ref,
|
|
43
|
+
"data-slot": "button",
|
|
44
|
+
className: cn(buttonVariants({
|
|
45
|
+
variant,
|
|
46
|
+
size,
|
|
47
|
+
className
|
|
48
|
+
})),
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
Button.displayName = "Button";
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { Button };
|
|
56
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","names":[],"sources":["../../../../../../../../../libs/design-system/dist/ui-kit-web/dist/ui/button.js"],"sourcesContent":["import { cn, init_utils } from \"../ui-kit-core/dist/utils.js\";\nimport * as React$1 from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { cva } from \"class-variance-authority\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n//#region ../ui-kit-web/dist/ui/button.js\ninit_utils();\nconst buttonVariants = cva(\"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\", {\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n\t\t\tdestructive: \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n\t\t\toutline: \"border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n\t\t\tsecondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n\t\t\tghost: \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n\t\t\tlink: \"text-primary underline-offset-4 hover:underline\"\n\t\t},\n\t\tsize: {\n\t\t\tdefault: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n\t\t\tsm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n\t\t\tlg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n\t\t\ticon: \"size-9\"\n\t\t}\n\t},\n\tdefaultVariants: {\n\t\tvariant: \"default\",\n\t\tsize: \"default\"\n\t}\n});\nconst Button = React$1.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {\n\tif (asChild) return /* @__PURE__ */ jsx(Slot, {\n\t\t\"data-slot\": \"button\",\n\t\tclassName: cn(buttonVariants({\n\t\t\tvariant,\n\t\t\tsize,\n\t\t\tclassName\n\t\t})),\n\t\t...props\n\t});\n\treturn /* @__PURE__ */ jsx(\"button\", {\n\t\tref,\n\t\t\"data-slot\": \"button\",\n\t\tclassName: cn(buttonVariants({\n\t\t\tvariant,\n\t\t\tsize,\n\t\t\tclassName\n\t\t})),\n\t\t...props\n\t});\n});\nButton.displayName = \"Button\";\n\n//#endregion\nexport { Button, buttonVariants };\n//# sourceMappingURL=button.js.map"],"mappings":";;;;;;;AAOA,YAAY;AACZ,MAAM,iBAAiB,IAAI,icAAic;CAC3d,UAAU;EACT,SAAS;GACR,SAAS;GACT,aAAa;GACb,SAAS;GACT,WAAW;GACX,OAAO;GACP,MAAM;GACN;EACD,MAAM;GACL,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,MAAM;GACN;EACD;CACD,iBAAiB;EAChB,SAAS;EACT,MAAM;EACN;CACD,CAAC;AACF,MAAM,SAAS,QAAQ,YAAY,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,SAAS,QAAQ;AACnG,KAAI,QAAS,QAAuB,oBAAI,MAAM;EAC7C,aAAa;EACb,WAAW,GAAG,eAAe;GAC5B;GACA;GACA;GACA,CAAC,CAAC;EACH,GAAG;EACH,CAAC;AACF,QAAuB,oBAAI,UAAU;EACpC;EACA,aAAa;EACb,WAAW,GAAG,eAAe;GAC5B;GACA;GACA;GACA,CAAC,CAAC;EACH,GAAG;EACH,CAAC;EACD;AACF,OAAO,cAAc"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __esmMin } from "../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
|
|
5
|
+
//#region ../../libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return twMerge(clsx(inputs));
|
|
8
|
+
}
|
|
9
|
+
var init_utils = __esmMin((() => {}));
|
|
10
|
+
init_utils();
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { cn, init_utils };
|
|
14
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../../../../../../../../libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js"],"sourcesContent":["import { __esmMin } from \"../../../../_virtual/rolldown_runtime.js\";\nimport { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n//#region ../ui-kit-web/dist/ui-kit-core/dist/utils.js\nfunction cn(...inputs) {\n\treturn twMerge(clsx(inputs));\n}\nvar init_utils = __esmMin((() => {}));\n\n//#endregion\ninit_utils();\nexport { cn, init_utils };\n//# sourceMappingURL=utils.js.map"],"mappings":";;;;;AAKA,SAAS,GAAG,GAAG,QAAQ;AACtB,QAAO,QAAQ,KAAK,OAAO,CAAC;;AAE7B,IAAI,aAAa,gBAAgB,IAAI;AAGrC,YAAY"}
|