@lssm/example.learning-journey-ui-coaching 0.0.0-canary-20251216033905 → 0.0.0-canary-20251216062412

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.
@@ -6,7 +6,7 @@ $ tsdown
6
6
  ℹ target: esnext
7
7
  ℹ tsconfig: tsconfig.json
8
8
  ℹ Build start
9
- ℹ dist/index.mjs 123.78 kB │ gzip: 41.01 kB
9
+ ℹ dist/index.mjs 133.25 kB │ gzip: 44.05 kB
10
10
  ℹ dist/views/index.mjs  0.20 kB │ gzip: 0.15 kB
11
11
  ℹ dist/components/index.mjs  0.17 kB │ gzip: 0.14 kB
12
12
  ℹ dist/views-BTGcWRSz.mjs  16.11 kB │ gzip: 2.79 kB
@@ -15,8 +15,8 @@ $ tsdown
15
15
  ℹ dist/index.d.mts  1.75 kB │ gzip: 0.70 kB
16
16
  ℹ dist/views/index.d.mts  0.16 kB │ gzip: 0.13 kB
17
17
  ℹ dist/components/index.d.mts  0.14 kB │ gzip: 0.11 kB
18
- ℹ dist/index-BH0UbqIy.d.mts  1.16 kB │ gzip: 0.44 kB
19
- ℹ dist/index-BjhNDTSh.d.mts  0.94 kB │ gzip: 0.34 kB
20
- ℹ 11 files, total: 152.77 kB
21
- ✔ Build complete in 9293ms
18
+ ℹ dist/index-CYYCjq6y.d.mts  1.16 kB │ gzip: 0.44 kB
19
+ ℹ dist/index-Cpg19PUU.d.mts  0.94 kB │ gzip: 0.34 kB
20
+ ℹ 11 files, total: 162.24 kB
21
+ ✔ Build complete in 9332ms
22
22
  $ tsc --noEmit
package/CHANGELOG.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # @lssm/example.learning-journey-ui-coaching
2
2
 
3
- ## 0.0.0-canary-20251216033905
3
+ ## 0.0.0-canary-20251216062412
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies [3086383]
8
- - @lssm/lib.design-system@0.0.0-canary-20251216033905
9
- - @lssm/lib.ui-kit-web@0.0.0-canary-20251216033905
10
- - @lssm/example.learning-journey-crm-onboarding@0.0.0-canary-20251216033905
11
- - @lssm/example.learning-journey-ui-shared@0.0.0-canary-20251216033905
12
- - @lssm/example.learning-journey-ambient-coach@0.0.0-canary-20251216033905
13
- - @lssm/module.learning-journey@0.0.0-canary-20251216033905
8
+ - @lssm/lib.design-system@0.0.0-canary-20251216062412
9
+ - @lssm/lib.ui-kit-web@0.0.0-canary-20251216062412
10
+ - @lssm/example.learning-journey-crm-onboarding@0.0.0-canary-20251216062412
11
+ - @lssm/example.learning-journey-ui-shared@0.0.0-canary-20251216062412
12
+ - @lssm/example.learning-journey-ambient-coach@0.0.0-canary-20251216062412
13
+ - @lssm/module.learning-journey@0.0.0-canary-20251216062412
@@ -1,2 +1,2 @@
1
- import { n as EngagementMeter, r as TipCard, t as TipFeed } from "../index-BH0UbqIy.mjs";
1
+ import { n as EngagementMeter, r as TipCard, t as TipFeed } from "../index-CYYCjq6y.mjs";
2
2
  export { EngagementMeter, TipCard, TipFeed };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
2
2
  import { LearningJourneyStepSpec } from "@lssm/module.learning-journey/track-spec";
3
3
 
4
4
  //#region src/components/TipCard.d.ts
@@ -15,7 +15,7 @@ declare function TipCard({
15
15
  isCurrent,
16
16
  onComplete,
17
17
  onDismiss
18
- }: TipCardProps): react_jsx_runtime0.JSX.Element;
18
+ }: TipCardProps): react_jsx_runtime4.JSX.Element;
19
19
  //#endregion
20
20
  //#region src/components/EngagementMeter.d.ts
21
21
  interface EngagementMeterProps {
@@ -29,7 +29,7 @@ declare function EngagementMeter({
29
29
  actioned,
30
30
  pending,
31
31
  streak
32
- }: EngagementMeterProps): react_jsx_runtime0.JSX.Element;
32
+ }: EngagementMeterProps): react_jsx_runtime4.JSX.Element;
33
33
  //#endregion
34
34
  //#region src/components/TipFeed.d.ts
35
35
  interface TipFeedItem {
@@ -42,6 +42,6 @@ interface TipFeedProps {
42
42
  }
43
43
  declare function TipFeed({
44
44
  items
45
- }: TipFeedProps): react_jsx_runtime0.JSX.Element;
45
+ }: TipFeedProps): react_jsx_runtime4.JSX.Element;
46
46
  //#endregion
47
47
  export { EngagementMeter as n, TipCard as r, TipFeed as t };
@@ -1,5 +1,5 @@
1
1
  import { LearningViewProps } from "@lssm/example.learning-journey-ui-shared";
2
- import * as react_jsx_runtime4 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/views/Overview.d.ts
5
5
  interface CoachingOverviewProps extends LearningViewProps {
@@ -10,25 +10,25 @@ declare function Overview({
10
10
  progress,
11
11
  onStepComplete,
12
12
  onStart
13
- }: CoachingOverviewProps): react_jsx_runtime4.JSX.Element;
13
+ }: CoachingOverviewProps): react_jsx_runtime0.JSX.Element;
14
14
  //#endregion
15
15
  //#region src/views/Steps.d.ts
16
16
  declare function Steps({
17
17
  track,
18
18
  progress,
19
19
  onStepComplete
20
- }: LearningViewProps): react_jsx_runtime4.JSX.Element;
20
+ }: LearningViewProps): react_jsx_runtime0.JSX.Element;
21
21
  //#endregion
22
22
  //#region src/views/Progress.d.ts
23
23
  declare function ProgressView({
24
24
  track,
25
25
  progress
26
- }: LearningViewProps): react_jsx_runtime4.JSX.Element;
26
+ }: LearningViewProps): react_jsx_runtime0.JSX.Element;
27
27
  //#endregion
28
28
  //#region src/views/Timeline.d.ts
29
29
  declare function Timeline({
30
30
  track,
31
31
  progress
32
- }: LearningViewProps): react_jsx_runtime4.JSX.Element;
32
+ }: LearningViewProps): react_jsx_runtime0.JSX.Element;
33
33
  //#endregion
34
34
  export { Overview as i, ProgressView as n, Steps as r, Timeline as t };
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { n as EngagementMeter, r as TipCard, t as TipFeed } from "./index-BH0UbqIy.mjs";
2
- import { i as Overview, n as ProgressView, r as Steps, t as Timeline } from "./index-BjhNDTSh.mjs";
1
+ import { n as EngagementMeter, r as TipCard, t as TipFeed } from "./index-CYYCjq6y.mjs";
2
+ import { i as Overview, n as ProgressView, r as Steps, t as Timeline } from "./index-Cpg19PUU.mjs";
3
3
  import { LearningMiniAppProps } from "@lssm/example.learning-journey-ui-shared";
4
- import * as react_jsx_runtime2 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
5
5
 
6
6
  //#region src/CoachingMiniApp.d.ts
7
7
  type CoachingMiniAppProps = Omit<LearningMiniAppProps, 'progress'> & {
@@ -13,7 +13,7 @@ declare function CoachingMiniApp({
13
13
  onStepComplete: externalOnStepComplete,
14
14
  onViewChange,
15
15
  initialView
16
- }: CoachingMiniAppProps): react_jsx_runtime2.JSX.Element;
16
+ }: CoachingMiniAppProps): react_jsx_runtime6.JSX.Element;
17
17
  //#endregion
18
18
  //#region src/example.d.ts
19
19
  declare const example: {
package/dist/index.mjs CHANGED
@@ -1322,6 +1322,361 @@ Acceptance rules:
1322
1322
  }];
1323
1323
  registerDocBlocks(tech_studio_team_invitations_DocBlocks);
1324
1324
 
1325
+ //#endregion
1326
+ //#region ../../libs/contracts/src/docs/tech/llm/llm-integration.docblock.ts
1327
+ const tech_llm_integration_DocBlocks = [
1328
+ {
1329
+ id: "docs.tech.llm.overview",
1330
+ title: "LLM Integration Overview",
1331
+ summary: "Export specs to LLM-friendly formats, generate implementation guides, and verify implementations.",
1332
+ kind: "reference",
1333
+ visibility: "public",
1334
+ route: "/docs/tech/llm/overview",
1335
+ tags: [
1336
+ "llm",
1337
+ "ai",
1338
+ "export",
1339
+ "guide",
1340
+ "verify"
1341
+ ],
1342
+ body: `# LLM Integration
1343
+
1344
+ ContractSpec provides first-class LLM integration to bridge specifications and AI coding agents.
1345
+
1346
+ ## Core Features
1347
+
1348
+ ### 1. Multi-Format Export
1349
+
1350
+ Export specs to markdown in formats optimized for LLM consumption:
1351
+
1352
+ - **Context format**: Summary for understanding (goal, context, acceptance criteria)
1353
+ - **Full format**: Complete spec with all details (I/O schemas, policy, events)
1354
+ - **Prompt format**: Actionable prompt with implementation instructions
1355
+
1356
+ ### 2. Implementation Guidance
1357
+
1358
+ Generate agent-specific implementation plans:
1359
+
1360
+ - **Claude Code**: Extended thinking mode with structured prompts
1361
+ - **Cursor CLI**: Background/composer mode with .mdc rules generation
1362
+ - **Generic MCP**: Standard format for any MCP-compatible agent
1363
+
1364
+ ### 3. Tiered Verification
1365
+
1366
+ Verify implementations against specs:
1367
+
1368
+ - **Tier 1 (Structure)**: Types, exports, imports validation
1369
+ - **Tier 2 (Behavior)**: Scenario coverage, error handling, events
1370
+ - **Tier 3 (AI Review)**: Semantic compliance analysis via LLM
1371
+
1372
+ ## Access Points
1373
+
1374
+ | Surface | Commands/Tools |
1375
+ |---------|---------------|
1376
+ | CLI | \`contractspec llm export\`, \`guide\`, \`verify\`, \`copy\` |
1377
+ | MCP | \`llm.export\`, \`llm.guide\`, \`llm.verify\` tools |
1378
+ | VSCode | Export to LLM, Generate Guide, Verify, Copy commands |
1379
+
1380
+ ## Quick Start
1381
+
1382
+ ### CLI Usage
1383
+
1384
+ \`\`\`bash
1385
+ # Export spec as markdown
1386
+ contractspec llm export path/to/my.spec.ts --format full
1387
+
1388
+ # Generate implementation guide
1389
+ contractspec llm guide path/to/my.spec.ts --agent claude-code
1390
+
1391
+ # Verify implementation
1392
+ contractspec llm verify path/to/my.spec.ts path/to/impl.ts --tier 2
1393
+
1394
+ # Copy spec to clipboard
1395
+ contractspec llm copy path/to/my.spec.ts --format context
1396
+ \`\`\`
1397
+
1398
+ ### MCP Usage
1399
+
1400
+ \`\`\`
1401
+ # Export spec
1402
+ llm.export { specPath: "path/to/my.spec.ts", format: "full" }
1403
+
1404
+ # Generate guide
1405
+ llm.guide { specPath: "path/to/my.spec.ts", agent: "cursor-cli" }
1406
+
1407
+ # Verify implementation
1408
+ llm.verify { specPath: "path/to/my.spec.ts", implementationPath: "path/to/impl.ts", tier: "2" }
1409
+ \`\`\`
1410
+
1411
+ ### Programmatic Usage
1412
+
1413
+ \`\`\`typescript
1414
+ import { specToFullMarkdown, specToAgentPrompt } from '@lssm/lib.contracts/llm';
1415
+ import { createAgentGuideService, createVerifyService } from '@lssm/bundle.contractspec-workspace';
1416
+
1417
+ // Export
1418
+ const markdown = specToFullMarkdown(mySpec);
1419
+
1420
+ // Generate guide
1421
+ const guideService = createAgentGuideService({ defaultAgent: 'claude-code' });
1422
+ const guide = guideService.generateGuide(mySpec);
1423
+
1424
+ // Verify
1425
+ const verifyService = createVerifyService();
1426
+ const result = await verifyService.verify(mySpec, implementationCode, {
1427
+ tiers: ['structure', 'behavior']
1428
+ });
1429
+ \`\`\`
1430
+ `
1431
+ },
1432
+ {
1433
+ id: "docs.tech.llm.export-formats",
1434
+ title: "LLM Export Formats",
1435
+ summary: "Detailed explanation of the three export formats for LLM consumption.",
1436
+ kind: "reference",
1437
+ visibility: "public",
1438
+ route: "/docs/tech/llm/export-formats",
1439
+ tags: [
1440
+ "llm",
1441
+ "export",
1442
+ "markdown"
1443
+ ],
1444
+ body: `# LLM Export Formats
1445
+
1446
+ ContractSpec provides three export formats optimized for different LLM use cases.
1447
+
1448
+ ## Context Format
1449
+
1450
+ Best for: Understanding what a spec does, providing background to LLMs.
1451
+
1452
+ Includes:
1453
+ - Spec name, version, type
1454
+ - Goal and context
1455
+ - Description
1456
+ - Acceptance scenarios
1457
+
1458
+ Example:
1459
+
1460
+ \`\`\`markdown
1461
+ # users.createUser (v1)
1462
+
1463
+ > Create a new user account with email verification.
1464
+
1465
+ **Type:** command | **Stability:** stable
1466
+
1467
+ ## Goal
1468
+ Create a new user in the system and trigger email verification.
1469
+
1470
+ ## Context
1471
+ Part of the user onboarding flow. Called after signup form submission.
1472
+
1473
+ ## Acceptance Criteria
1474
+ ### Happy path
1475
+ **Given:** Valid email and password
1476
+ **When:** User submits registration
1477
+ **Then:** Account is created, verification email is sent
1478
+ \`\`\`
1479
+
1480
+ ## Full Format
1481
+
1482
+ Best for: Complete documentation, implementation reference.
1483
+
1484
+ Includes everything:
1485
+ - All metadata
1486
+ - JSON schemas for I/O
1487
+ - Error definitions
1488
+ - Policy (auth, rate limits, PII)
1489
+ - Events emitted
1490
+ - Examples
1491
+ - Transport configuration
1492
+
1493
+ ## Prompt Format
1494
+
1495
+ Best for: Feeding directly to coding agents.
1496
+
1497
+ Includes:
1498
+ - Task header with clear instructions
1499
+ - Full spec context
1500
+ - Implementation requirements
1501
+ - Task-specific guidance (implement/test/refactor/review)
1502
+ - Expected output format
1503
+
1504
+ The prompt format adapts based on task type:
1505
+ - **implement**: Full implementation with tests
1506
+ - **test**: Test generation for existing code
1507
+ - **refactor**: Refactoring while maintaining behavior
1508
+ - **review**: Code review against spec
1509
+ `
1510
+ },
1511
+ {
1512
+ id: "docs.tech.llm.agent-adapters",
1513
+ title: "Agent Adapters",
1514
+ summary: "Adapters for different AI coding agents (Claude, Cursor, MCP).",
1515
+ kind: "reference",
1516
+ visibility: "public",
1517
+ route: "/docs/tech/llm/agent-adapters",
1518
+ tags: [
1519
+ "llm",
1520
+ "agents",
1521
+ "claude",
1522
+ "cursor",
1523
+ "mcp"
1524
+ ],
1525
+ body: `# Agent Adapters
1526
+
1527
+ ContractSpec provides specialized adapters for different AI coding agents.
1528
+
1529
+ ## Claude Code Adapter
1530
+
1531
+ Optimized for Anthropic Claude's extended thinking and code generation.
1532
+
1533
+ Features:
1534
+ - Structured markdown with clear sections
1535
+ - Checklists for steps and verification
1536
+ - Icons for file operations (📝 create, ✏️ modify)
1537
+ - System prompt for ContractSpec context
1538
+
1539
+ Usage:
1540
+ \`\`\`typescript
1541
+ const guideService = createAgentGuideService({ defaultAgent: 'claude-code' });
1542
+ const result = guideService.generateGuide(spec, { agent: 'claude-code' });
1543
+ // result.prompt.systemPrompt - Claude system context
1544
+ // result.prompt.taskPrompt - Task-specific instructions
1545
+ \`\`\`
1546
+
1547
+ ## Cursor CLI Adapter
1548
+
1549
+ Optimized for Cursor's background/composer mode.
1550
+
1551
+ Features:
1552
+ - Compact format for context efficiency
1553
+ - .mdc cursor rules generation
1554
+ - Integration with Cursor's file system
1555
+ - Concise step lists
1556
+
1557
+ Generate Cursor Rules:
1558
+ \`\`\`typescript
1559
+ const cursorRules = guideService.generateAgentConfig(spec, 'cursor-cli');
1560
+ // Save to .cursor/rules/my-spec.mdc
1561
+ \`\`\`
1562
+
1563
+ ## Generic MCP Adapter
1564
+
1565
+ Works with any MCP-compatible agent (Cline, Aider, etc.).
1566
+
1567
+ Features:
1568
+ - Standard markdown format
1569
+ - Table-based metadata
1570
+ - JSON resource format support
1571
+ - Prompt message format
1572
+
1573
+ The generic adapter is the default and works across all agents.
1574
+
1575
+ ## Choosing an Adapter
1576
+
1577
+ | Agent | Best For | Key Features |
1578
+ |-------|----------|--------------|
1579
+ | Claude Code | Complex implementations | Extended thinking, detailed steps |
1580
+ | Cursor CLI | IDE-integrated work | Cursor rules, compact format |
1581
+ | Generic MCP | Any MCP agent | Universal compatibility |
1582
+ `
1583
+ },
1584
+ {
1585
+ id: "docs.tech.llm.verification",
1586
+ title: "Implementation Verification",
1587
+ summary: "Tiered verification of implementations against specifications.",
1588
+ kind: "reference",
1589
+ visibility: "public",
1590
+ route: "/docs/tech/llm/verification",
1591
+ tags: [
1592
+ "llm",
1593
+ "verify",
1594
+ "validation",
1595
+ "testing"
1596
+ ],
1597
+ body: `# Implementation Verification
1598
+
1599
+ ContractSpec provides tiered verification to check if implementations comply with specs.
1600
+
1601
+ ## Verification Tiers
1602
+
1603
+ ### Tier 1: Structure (Fast)
1604
+
1605
+ Checks TypeScript structure against spec requirements:
1606
+
1607
+ | Check | What it validates |
1608
+ |-------|------------------|
1609
+ | Handler export | Function is properly exported |
1610
+ | Contracts import | Imports from @lssm/lib.contracts |
1611
+ | Schema import | Imports from @lssm/lib.schema |
1612
+ | No \`any\` type | TypeScript strict compliance |
1613
+ | Error handling | Error codes are referenced |
1614
+ | Event emission | Event patterns exist |
1615
+ | Input validation | Validation patterns used |
1616
+ | Async patterns | Async/await for commands |
1617
+
1618
+ ### Tier 2: Behavior (Comprehensive)
1619
+
1620
+ Checks implementation coverage of spec behaviors:
1621
+
1622
+ | Check | What it validates |
1623
+ |-------|------------------|
1624
+ | Scenario coverage | Acceptance scenarios implemented |
1625
+ | Example coverage | Example I/O values referenced |
1626
+ | Error cases | All error conditions handled |
1627
+ | Event conditions | Events emitted correctly |
1628
+ | Idempotency | Idempotent patterns (if required) |
1629
+
1630
+ ### Tier 3: AI Review (Deep)
1631
+
1632
+ Uses LLM for semantic analysis:
1633
+
1634
+ - Does the implementation fulfill the spec's intent?
1635
+ - Are edge cases properly handled?
1636
+ - Is the code quality acceptable?
1637
+ - Are there any subtle violations?
1638
+
1639
+ Requires AI API key configuration.
1640
+
1641
+ ## Running Verification
1642
+
1643
+ \`\`\`typescript
1644
+ const verifyService = createVerifyService({
1645
+ aiApiKey: process.env.ANTHROPIC_API_KEY, // Optional, for Tier 3
1646
+ aiProvider: 'anthropic',
1647
+ });
1648
+
1649
+ const result = await verifyService.verify(spec, implementationCode, {
1650
+ tiers: ['structure', 'behavior'],
1651
+ failFast: false,
1652
+ includeSuggestions: true,
1653
+ });
1654
+
1655
+ console.log(result.passed); // true/false
1656
+ console.log(result.score); // 0-100
1657
+ console.log(result.summary); // Human-readable summary
1658
+ \`\`\`
1659
+
1660
+ ## Verification Report
1661
+
1662
+ The report includes:
1663
+
1664
+ - **passed**: Overall compliance
1665
+ - **score**: 0-100 score
1666
+ - **issues**: Array of problems found
1667
+ - **suggestions**: Recommended fixes
1668
+ - **coverage**: Metrics on scenario/error/field coverage
1669
+
1670
+ Each issue has:
1671
+ - **severity**: error, warning, or info
1672
+ - **category**: type, export, import, scenario, error_handling, semantic
1673
+ - **message**: Description of the issue
1674
+ - **suggestion**: How to fix it
1675
+ `
1676
+ }
1677
+ ];
1678
+ registerDocBlocks(tech_llm_integration_DocBlocks);
1679
+
1325
1680
  //#endregion
1326
1681
  //#region src/docs/learning-journey-ui-coaching.docblock.ts
1327
1682
  registerDocBlocks([{
@@ -1,2 +1,2 @@
1
- import { i as Overview, n as ProgressView, r as Steps, t as Timeline } from "../index-BjhNDTSh.mjs";
1
+ import { i as Overview, n as ProgressView, r as Steps, t as Timeline } from "../index-Cpg19PUU.mjs";
2
2
  export { Overview, ProgressView as Progress, Steps, Timeline };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/example.learning-journey-ui-coaching",
3
- "version": "0.0.0-canary-20251216033905",
3
+ "version": "0.0.0-canary-20251216062412",
4
4
  "description": "Contextual coaching UI with tip cards and engagement tracking.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",