@contractspec/example.learning-journey-ambient-coach 3.7.18 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,33 +2,33 @@ $ contractspec-bun-build prebuild
2
2
  $ bun run build:bundle && bun run build:types
3
3
  $ contractspec-bun-build transpile
4
4
  [contractspec-bun-build] transpile target=bun root=src entries=6 noBundle=false
5
- Bundled 6 modules in 12ms
5
+ Bundled 6 modules in 23ms
6
6
 
7
7
  docs/ambient-coach.docblock.js 1.13 KB (entry point)
8
- ./index.js 3.53 KB (entry point)
8
+ ./index.js 3.68 KB (entry point)
9
9
  docs/index.js 1.13 KB (entry point)
10
10
  ./example.js 0.72 KB (entry point)
11
11
  ./learning-journey-ambient-coach.feature.js 479 bytes (entry point)
12
- ./track.js 1.25 KB (entry point)
12
+ ./track.js 1.39 KB (entry point)
13
13
 
14
14
  [contractspec-bun-build] transpile target=node root=src entries=6 noBundle=false
15
- Bundled 6 modules in 16ms
15
+ Bundled 6 modules in 56ms
16
16
 
17
17
  docs/ambient-coach.docblock.js 1.12 KB (entry point)
18
- ./index.js 3.51 KB (entry point)
18
+ ./index.js 3.66 KB (entry point)
19
19
  docs/index.js 1.12 KB (entry point)
20
20
  ./example.js 0.71 KB (entry point)
21
21
  ./learning-journey-ambient-coach.feature.js 471 bytes (entry point)
22
- ./track.js 1.23 KB (entry point)
22
+ ./track.js 1.38 KB (entry point)
23
23
 
24
24
  [contractspec-bun-build] transpile target=browser root=src entries=6 noBundle=false
25
- Bundled 6 modules in 21ms
25
+ Bundled 6 modules in 28ms
26
26
 
27
27
  docs/ambient-coach.docblock.js 1.12 KB (entry point)
28
- ./index.js 3.51 KB (entry point)
28
+ ./index.js 3.66 KB (entry point)
29
29
  docs/index.js 1.12 KB (entry point)
30
30
  ./example.js 0.71 KB (entry point)
31
31
  ./learning-journey-ambient-coach.feature.js 471 bytes (entry point)
32
- ./track.js 1.23 KB (entry point)
32
+ ./track.js 1.38 KB (entry point)
33
33
 
34
34
  $ contractspec-bun-build types
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @contractspec/example.learning-journey-ambient-coach
2
2
 
3
+ ## 4.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Redesign the learning system around the adaptive journey runtime and repair shared learning sandbox presentation wiring.
8
+ - Packages: @contractspec/module.learning-journey (major), @contractspec/module.examples (patch), @contractspec/example.learning-journey-ambient-coach (major), @contractspec/example.learning-journey-crm-onboarding (major), @contractspec/example.learning-journey-duo-drills (major), @contractspec/example.learning-journey-platform-tour (major), @contractspec/example.learning-journey-quest-challenges (major), @contractspec/example.learning-journey-registry (major), @contractspec/example.learning-journey-studio-onboarding (major), @contractspec/example.learning-journey-ui-coaching (major), @contractspec/example.learning-journey-ui-gamified (major), @contractspec/example.learning-journey-ui-onboarding (major), @contractspec/example.learning-journey-ui-shared (major), @contractspec/example.learning-patterns (major)
9
+ - Migration: Replace the old onboarding-centric learning contracts and local example progress logic with the canonical adaptive `learning.journey.*` runtime.; Use the shared learning registry mapping/data helpers so supported learning sandbox templates resolve the shared presentation set consistently.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies because of Add a family-aware ContractSpec Adoption Engine, expand contract authoring targets across CLI and VS Code tooling, and refresh release-facing schema and policy artifacts for downstream workspaces.
14
+ - Updated dependencies because of Improve app-config, theme, and feature authoring with explicit validation APIs, first-class theme discovery and scaffolding, and key-based app-config generation across contracts, workspace tooling, and the CLI.
15
+ - Updated dependencies because of Refresh root, package, website, and LLM-facing docs so Connect, Builder, release capsules, and the current contracts-spec export surface stay aligned.
16
+ - Updated dependencies because of Persist canonical knowledge payload text during indexing and align the retrieval/query docs with the corrected behavior.
17
+ - Updated dependencies because of Redesign the learning system around the adaptive journey runtime and repair shared learning sandbox presentation wiring.
18
+ - @contractspec/lib.contracts-spec@5.4.0
19
+ - @contractspec/module.learning-journey@4.0.0
20
+
21
+ ## 3.7.19
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies because of Expand ContractSpec authoring with preset-driven workspace setup, shell completion, packaged workspace schema artifacts, and richer form and UI surfaces across the CLI, editors, and shared runtimes.
26
+ - @contractspec/lib.contracts-spec@5.3.0
27
+ - @contractspec/module.learning-journey@3.7.18
28
+
3
29
  ## 3.7.18
4
30
 
5
31
  ### Patch Changes
@@ -1 +1 @@
1
- import{registerDocBlocks as a}from"@contractspec/lib.contracts-spec/docs";var o=[{id:"docs.learning-journey.ambient-coach",title:"Learning Journey — Ambient Coach",summary:"Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",kind:"reference",visibility:"public",route:"/docs/learning-journey/ambient-coach",tags:["learning","coach","tips"],body:"## Tracks\n- `money_ambient_coach`: cash buffer too high, no savings goal, irregular savings\n- `coliving_ambient_coach`: noise late evening, guest frequency high, shared space conflicts\n\n## Steps & Events\n- Trigger tip: `coach.tip.triggered` (payload includes `tipId`)\n- Show tip (optional UI emission): `coach.tip.shown`\n- Complete when acknowledged or follow-up action taken:\n - `coach.tip.acknowledged`\n - `coach.tip.follow_up_action_taken`\n\n## Usage\n- Tracks export from `@contractspec/example.learning-journey-ambient-coach/track`.\n- Registry progression is event-driven; payload filters can scope tips per category.\n- XP/engagement can be awarded on completion of each tip step."}];a(o);import{defineExample as r}from"@contractspec/lib.contracts-spec";var s=r({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey — Ambient Coach",description:"Ambient coaching pattern: lightweight nudges driven by context and recent progress.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","coaching","ambient"]},docs:{rootDocId:"docs.learning-journey.ambient-coach"},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),g=s;import{defineFeature as c}from"@contractspec/lib.contracts-spec";var v=c({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey: Ambient Coach",description:"Contextual coaching track with ambient tips and follow-up actions",domain:"learning-journey",owners:["@examples"],tags:["learning","coaching","ambient","journey"],stability:"experimental"},docs:["docs.learning-journey.ambient-coach"]});var e=(t,n,i)=>({id:t,title:`Resolve tip: ${n}`,description:i,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:n}},xpReward:20,metadata:{tipId:n}}),_={id:"money_ambient_coach",name:"Ambient Coach — Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal."),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.")]},h={id:"coliving_ambient_coach",name:"Ambient Coach — Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house."),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.")]},S=[_,h];export{_ as moneyAmbientCoachTrack,g as example,h as colivingAmbientCoachTrack,S as ambientCoachTracks,v as LearningJourneyAmbientCoachFeature};
1
+ import{registerDocBlocks as s}from"@contractspec/lib.contracts-spec/docs";var a=[{id:"docs.learning-journey.ambient-coach",title:"Learning Journey — Ambient Coach",summary:"Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",kind:"reference",visibility:"public",route:"/docs/learning-journey/ambient-coach",tags:["learning","coach","tips"],body:"## Tracks\n- `money_ambient_coach`: cash buffer too high, no savings goal, irregular savings\n- `coliving_ambient_coach`: noise late evening, guest frequency high, shared space conflicts\n\n## Steps & Events\n- Trigger tip: `coach.tip.triggered` (payload includes `tipId`)\n- Show tip (optional UI emission): `coach.tip.shown`\n- Complete when acknowledged or follow-up action taken:\n - `coach.tip.acknowledged`\n - `coach.tip.follow_up_action_taken`\n\n## Usage\n- Tracks export from `@contractspec/example.learning-journey-ambient-coach/track`.\n- Registry progression is event-driven; payload filters can scope tips per category.\n- XP/engagement can be awarded on completion of each tip step."}];s(a);import{defineExample as r}from"@contractspec/lib.contracts-spec";var g=r({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey — Ambient Coach",description:"Ambient coaching pattern: lightweight nudges driven by context and recent progress.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","coaching","ambient"]},docs:{rootDocId:"docs.learning-journey.ambient-coach"},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),c=g;import{defineFeature as _}from"@contractspec/lib.contracts-spec";var y=_({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey: Ambient Coach",description:"Contextual coaching track with ambient tips and follow-up actions",domain:"learning-journey",owners:["@examples"],tags:["learning","coaching","ambient","journey"],stability:"experimental"},docs:["docs.learning-journey.ambient-coach"]});var e=(i,n,o,t)=>({id:i,title:`Resolve tip: ${n}`,description:o,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:n}},prerequisites:t?[{kind:"step_completed",stepId:t}]:void 0,xpReward:20,metadata:{tipId:n}}),h={id:"money_ambient_coach",name:"Ambient Coach — Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal.","cash_buffer_too_high"),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.","no_savings_goal")]},u={id:"coliving_ambient_coach",name:"Ambient Coach — Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house.","noise_late_evening"),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.","guest_frequency_high")]},k=[h,u];export{h as moneyAmbientCoachTrack,c as example,u as colivingAmbientCoachTrack,k as ambientCoachTracks,y as LearningJourneyAmbientCoachFeature};
@@ -1 +1 @@
1
- var e=(t,n,a)=>({id:t,title:`Resolve tip: ${n}`,description:a,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:n}},xpReward:20,metadata:{tipId:n}}),o={id:"money_ambient_coach",name:"Ambient Coach — Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal."),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.")]},i={id:"coliving_ambient_coach",name:"Ambient Coach — Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house."),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.")]},r=[o,i];export{o as moneyAmbientCoachTrack,i as colivingAmbientCoachTrack,r as ambientCoachTracks};
1
+ var e=(o,t,s,n)=>({id:o,title:`Resolve tip: ${t}`,description:s,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:t}},prerequisites:n?[{kind:"step_completed",stepId:n}]:void 0,xpReward:20,metadata:{tipId:t}}),a={id:"money_ambient_coach",name:"Ambient Coach — Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal.","cash_buffer_too_high"),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.","no_savings_goal")]},i={id:"coliving_ambient_coach",name:"Ambient Coach — Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house.","noise_late_evening"),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.","guest_frequency_high")]},r=[a,i];export{a as moneyAmbientCoachTrack,i as colivingAmbientCoachTrack,r as ambientCoachTracks};
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{registerDocBlocks as a}from"@contractspec/lib.contracts-spec/docs";var o=[{id:"docs.learning-journey.ambient-coach",title:"Learning Journey \u2014 Ambient Coach",summary:"Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",kind:"reference",visibility:"public",route:"/docs/learning-journey/ambient-coach",tags:["learning","coach","tips"],body:"## Tracks\n- `money_ambient_coach`: cash buffer too high, no savings goal, irregular savings\n- `coliving_ambient_coach`: noise late evening, guest frequency high, shared space conflicts\n\n## Steps & Events\n- Trigger tip: `coach.tip.triggered` (payload includes `tipId`)\n- Show tip (optional UI emission): `coach.tip.shown`\n- Complete when acknowledged or follow-up action taken:\n - `coach.tip.acknowledged`\n - `coach.tip.follow_up_action_taken`\n\n## Usage\n- Tracks export from `@contractspec/example.learning-journey-ambient-coach/track`.\n- Registry progression is event-driven; payload filters can scope tips per category.\n- XP/engagement can be awarded on completion of each tip step."}];a(o);import{defineExample as r}from"@contractspec/lib.contracts-spec";var s=r({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey \u2014 Ambient Coach",description:"Ambient coaching pattern: lightweight nudges driven by context and recent progress.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","coaching","ambient"]},docs:{rootDocId:"docs.learning-journey.ambient-coach"},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),g=s;import{defineFeature as c}from"@contractspec/lib.contracts-spec";var v=c({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey: Ambient Coach",description:"Contextual coaching track with ambient tips and follow-up actions",domain:"learning-journey",owners:["@examples"],tags:["learning","coaching","ambient","journey"],stability:"experimental"},docs:["docs.learning-journey.ambient-coach"]});var e=(t,n,i)=>({id:t,title:`Resolve tip: ${n}`,description:i,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:n}},xpReward:20,metadata:{tipId:n}}),_={id:"money_ambient_coach",name:"Ambient Coach \u2014 Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal."),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.")]},h={id:"coliving_ambient_coach",name:"Ambient Coach \u2014 Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house."),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.")]},S=[_,h];export{_ as moneyAmbientCoachTrack,g as example,h as colivingAmbientCoachTrack,S as ambientCoachTracks,v as LearningJourneyAmbientCoachFeature};
2
+ import{registerDocBlocks as s}from"@contractspec/lib.contracts-spec/docs";var a=[{id:"docs.learning-journey.ambient-coach",title:"Learning Journey \u2014 Ambient Coach",summary:"Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",kind:"reference",visibility:"public",route:"/docs/learning-journey/ambient-coach",tags:["learning","coach","tips"],body:"## Tracks\n- `money_ambient_coach`: cash buffer too high, no savings goal, irregular savings\n- `coliving_ambient_coach`: noise late evening, guest frequency high, shared space conflicts\n\n## Steps & Events\n- Trigger tip: `coach.tip.triggered` (payload includes `tipId`)\n- Show tip (optional UI emission): `coach.tip.shown`\n- Complete when acknowledged or follow-up action taken:\n - `coach.tip.acknowledged`\n - `coach.tip.follow_up_action_taken`\n\n## Usage\n- Tracks export from `@contractspec/example.learning-journey-ambient-coach/track`.\n- Registry progression is event-driven; payload filters can scope tips per category.\n- XP/engagement can be awarded on completion of each tip step."}];s(a);import{defineExample as r}from"@contractspec/lib.contracts-spec";var g=r({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey \u2014 Ambient Coach",description:"Ambient coaching pattern: lightweight nudges driven by context and recent progress.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","coaching","ambient"]},docs:{rootDocId:"docs.learning-journey.ambient-coach"},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),c=g;import{defineFeature as _}from"@contractspec/lib.contracts-spec";var y=_({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey: Ambient Coach",description:"Contextual coaching track with ambient tips and follow-up actions",domain:"learning-journey",owners:["@examples"],tags:["learning","coaching","ambient","journey"],stability:"experimental"},docs:["docs.learning-journey.ambient-coach"]});var e=(i,n,o,t)=>({id:i,title:`Resolve tip: ${n}`,description:o,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:n}},prerequisites:t?[{kind:"step_completed",stepId:t}]:void 0,xpReward:20,metadata:{tipId:n}}),h={id:"money_ambient_coach",name:"Ambient Coach \u2014 Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal.","cash_buffer_too_high"),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.","no_savings_goal")]},u={id:"coliving_ambient_coach",name:"Ambient Coach \u2014 Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house.","noise_late_evening"),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.","guest_frequency_high")]},k=[h,u];export{h as moneyAmbientCoachTrack,c as example,u as colivingAmbientCoachTrack,k as ambientCoachTracks,y as LearningJourneyAmbientCoachFeature};
@@ -1 +1 @@
1
- import{registerDocBlocks as a}from"@contractspec/lib.contracts-spec/docs";var o=[{id:"docs.learning-journey.ambient-coach",title:"Learning Journey — Ambient Coach",summary:"Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",kind:"reference",visibility:"public",route:"/docs/learning-journey/ambient-coach",tags:["learning","coach","tips"],body:"## Tracks\n- `money_ambient_coach`: cash buffer too high, no savings goal, irregular savings\n- `coliving_ambient_coach`: noise late evening, guest frequency high, shared space conflicts\n\n## Steps & Events\n- Trigger tip: `coach.tip.triggered` (payload includes `tipId`)\n- Show tip (optional UI emission): `coach.tip.shown`\n- Complete when acknowledged or follow-up action taken:\n - `coach.tip.acknowledged`\n - `coach.tip.follow_up_action_taken`\n\n## Usage\n- Tracks export from `@contractspec/example.learning-journey-ambient-coach/track`.\n- Registry progression is event-driven; payload filters can scope tips per category.\n- XP/engagement can be awarded on completion of each tip step."}];a(o);import{defineExample as r}from"@contractspec/lib.contracts-spec";var s=r({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey — Ambient Coach",description:"Ambient coaching pattern: lightweight nudges driven by context and recent progress.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","coaching","ambient"]},docs:{rootDocId:"docs.learning-journey.ambient-coach"},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),g=s;import{defineFeature as c}from"@contractspec/lib.contracts-spec";var v=c({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey: Ambient Coach",description:"Contextual coaching track with ambient tips and follow-up actions",domain:"learning-journey",owners:["@examples"],tags:["learning","coaching","ambient","journey"],stability:"experimental"},docs:["docs.learning-journey.ambient-coach"]});var e=(t,n,i)=>({id:t,title:`Resolve tip: ${n}`,description:i,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:n}},xpReward:20,metadata:{tipId:n}}),_={id:"money_ambient_coach",name:"Ambient Coach — Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal."),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.")]},h={id:"coliving_ambient_coach",name:"Ambient Coach — Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house."),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.")]},S=[_,h];export{_ as moneyAmbientCoachTrack,g as example,h as colivingAmbientCoachTrack,S as ambientCoachTracks,v as LearningJourneyAmbientCoachFeature};
1
+ import{registerDocBlocks as s}from"@contractspec/lib.contracts-spec/docs";var a=[{id:"docs.learning-journey.ambient-coach",title:"Learning Journey — Ambient Coach",summary:"Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",kind:"reference",visibility:"public",route:"/docs/learning-journey/ambient-coach",tags:["learning","coach","tips"],body:"## Tracks\n- `money_ambient_coach`: cash buffer too high, no savings goal, irregular savings\n- `coliving_ambient_coach`: noise late evening, guest frequency high, shared space conflicts\n\n## Steps & Events\n- Trigger tip: `coach.tip.triggered` (payload includes `tipId`)\n- Show tip (optional UI emission): `coach.tip.shown`\n- Complete when acknowledged or follow-up action taken:\n - `coach.tip.acknowledged`\n - `coach.tip.follow_up_action_taken`\n\n## Usage\n- Tracks export from `@contractspec/example.learning-journey-ambient-coach/track`.\n- Registry progression is event-driven; payload filters can scope tips per category.\n- XP/engagement can be awarded on completion of each tip step."}];s(a);import{defineExample as r}from"@contractspec/lib.contracts-spec";var g=r({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey — Ambient Coach",description:"Ambient coaching pattern: lightweight nudges driven by context and recent progress.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","coaching","ambient"]},docs:{rootDocId:"docs.learning-journey.ambient-coach"},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),c=g;import{defineFeature as _}from"@contractspec/lib.contracts-spec";var y=_({meta:{key:"learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey: Ambient Coach",description:"Contextual coaching track with ambient tips and follow-up actions",domain:"learning-journey",owners:["@examples"],tags:["learning","coaching","ambient","journey"],stability:"experimental"},docs:["docs.learning-journey.ambient-coach"]});var e=(i,n,o,t)=>({id:i,title:`Resolve tip: ${n}`,description:o,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:n}},prerequisites:t?[{kind:"step_completed",stepId:t}]:void 0,xpReward:20,metadata:{tipId:n}}),h={id:"money_ambient_coach",name:"Ambient Coach — Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal.","cash_buffer_too_high"),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.","no_savings_goal")]},u={id:"coliving_ambient_coach",name:"Ambient Coach — Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house.","noise_late_evening"),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.","guest_frequency_high")]},k=[h,u];export{h as moneyAmbientCoachTrack,c as example,u as colivingAmbientCoachTrack,k as ambientCoachTracks,y as LearningJourneyAmbientCoachFeature};
@@ -1 +1 @@
1
- var e=(t,n,a)=>({id:t,title:`Resolve tip: ${n}`,description:a,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:n}},xpReward:20,metadata:{tipId:n}}),o={id:"money_ambient_coach",name:"Ambient Coach — Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal."),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.")]},i={id:"coliving_ambient_coach",name:"Ambient Coach — Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house."),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.")]},r=[o,i];export{o as moneyAmbientCoachTrack,i as colivingAmbientCoachTrack,r as ambientCoachTracks};
1
+ var e=(o,t,s,n)=>({id:o,title:`Resolve tip: ${t}`,description:s,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:t}},prerequisites:n?[{kind:"step_completed",stepId:n}]:void 0,xpReward:20,metadata:{tipId:t}}),a={id:"money_ambient_coach",name:"Ambient Coach — Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal.","cash_buffer_too_high"),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.","no_savings_goal")]},i={id:"coliving_ambient_coach",name:"Ambient Coach — Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house.","noise_late_evening"),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.","guest_frequency_high")]},r=[a,i];export{a as moneyAmbientCoachTrack,i as colivingAmbientCoachTrack,r as ambientCoachTracks};
package/dist/track.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
2
- export declare const moneyAmbientCoachTrack: LearningJourneyTrackSpec;
3
- export declare const colivingAmbientCoachTrack: LearningJourneyTrackSpec;
4
- export declare const ambientCoachTracks: LearningJourneyTrackSpec[];
1
+ import type { JourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
2
+ export declare const moneyAmbientCoachTrack: JourneyTrackSpec;
3
+ export declare const colivingAmbientCoachTrack: JourneyTrackSpec;
4
+ export declare const ambientCoachTracks: JourneyTrackSpec[];
package/dist/track.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- var e=(t,n,a)=>({id:t,title:`Resolve tip: ${n}`,description:a,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:n}},xpReward:20,metadata:{tipId:n}}),o={id:"money_ambient_coach",name:"Ambient Coach \u2014 Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal."),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.")]},i={id:"coliving_ambient_coach",name:"Ambient Coach \u2014 Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house."),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.")]},r=[o,i];export{o as moneyAmbientCoachTrack,i as colivingAmbientCoachTrack,r as ambientCoachTracks};
2
+ var e=(o,t,s,n)=>({id:o,title:`Resolve tip: ${t}`,description:s,completion:{kind:"event",eventName:"coach.tip.follow_up_action_taken",payloadFilter:{tipId:t}},prerequisites:n?[{kind:"step_completed",stepId:n}]:void 0,xpReward:20,metadata:{tipId:t}}),a={id:"money_ambient_coach",name:"Ambient Coach \u2014 Money",description:"Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",targetUserSegment:"money_user",totalXp:60,steps:[e("cash_buffer_too_high","cash_buffer_too_high","Suggest sweeping excess cash into goals."),e("no_savings_goal","no_savings_goal","Prompt setting a first savings goal.","cash_buffer_too_high"),e("irregular_savings","irregular_savings","Recommend recurring saves after irregular deposits.","no_savings_goal")]},i={id:"coliving_ambient_coach",name:"Ambient Coach \u2014 Coliving",description:"Contextual tips for healthy coliving habits.",targetUserSegment:"coliving",totalXp:60,steps:[e("noise_late_evening","noise_late_evening","Suggest updating quiet hours to reduce evening noise."),e("guest_frequency_high","guest_frequency_high","Set guest frequency expectations for the house.","noise_late_evening"),e("shared_space_conflicts","shared_space_conflicts","Offer a shared-space checklist to reduce conflicts.","guest_frequency_high")]},r=[a,i];export{a as moneyAmbientCoachTrack,i as colivingAmbientCoachTrack,r as ambientCoachTracks};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.learning-journey-ambient-coach",
3
- "version": "3.7.18",
3
+ "version": "4.0.0",
4
4
  "description": "Ambient coach learning journey example with contextual tips and follow-up actions.",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -64,8 +64,8 @@
64
64
  "typecheck": "tsc --noEmit"
65
65
  },
66
66
  "dependencies": {
67
- "@contractspec/module.learning-journey": "3.7.17",
68
- "@contractspec/lib.contracts-spec": "5.2.0"
67
+ "@contractspec/module.learning-journey": "4.0.0",
68
+ "@contractspec/lib.contracts-spec": "5.4.0"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@contractspec/tool.typescript": "3.7.13",
package/src/track.test.ts CHANGED
@@ -1,57 +1,29 @@
1
1
  import { describe, expect, it } from 'bun:test';
2
-
2
+ import {
3
+ createJourneyProgressState,
4
+ projectJourneyProgress,
5
+ recordJourneyEvent,
6
+ } from '@contractspec/module.learning-journey/runtime';
3
7
  import { moneyAmbientCoachTrack } from './track';
4
8
 
5
- interface TestEvent {
6
- name: string;
7
- payload?: Record<string, unknown>;
8
- }
9
-
10
- const matchesFilter = (
11
- filter: Record<string, unknown> | undefined,
12
- payload: Record<string, unknown> | undefined
13
- ) => {
14
- if (!filter) return true;
15
- if (!payload) return false;
16
- return Object.entries(filter).every(([key, value]) => payload[key] === value);
17
- };
18
-
19
9
  describe('ambient coach track', () => {
20
- it('completes steps when tips are acted upon', () => {
10
+ it('completes sequential contextual tips through the canonical runtime', () => {
21
11
  const tipIds = [
22
12
  'cash_buffer_too_high',
23
13
  'no_savings_goal',
24
14
  'irregular_savings',
25
15
  ];
26
16
 
27
- const events: TestEvent[] = tipIds.flatMap((tipId) => [
28
- { name: 'coach.tip.triggered', payload: { tipId } },
29
- { name: 'coach.tip.follow_up_action_taken', payload: { tipId } },
30
- ]);
31
-
32
- const progress = moneyAmbientCoachTrack.steps.map((step) => ({
33
- id: step.id,
34
- status: 'PENDING' as 'PENDING' | 'COMPLETED',
35
- }));
36
-
37
- events.forEach((event) => {
38
- moneyAmbientCoachTrack.steps.forEach((stepSpec, index) => {
39
- const step = progress[index];
40
- if (!step || step.status === 'COMPLETED') return;
41
- if (stepSpec.completion.kind !== 'event') return;
42
- if (stepSpec.completion.eventName !== event.name) return;
43
- if (
44
- !matchesFilter(
45
- stepSpec.completion.payloadFilter,
46
- event.payload as Record<string, unknown> | undefined
47
- )
48
- ) {
49
- return;
50
- }
51
- step.status = 'COMPLETED';
17
+ let state = createJourneyProgressState(moneyAmbientCoachTrack);
18
+ for (const tipId of tipIds) {
19
+ state = recordJourneyEvent(moneyAmbientCoachTrack, state, {
20
+ name: 'coach.tip.follow_up_action_taken',
21
+ payload: { tipId },
52
22
  });
53
- });
23
+ }
54
24
 
55
- expect(progress.every((s) => s.status === 'COMPLETED')).toBeTrue();
25
+ expect(
26
+ projectJourneyProgress(moneyAmbientCoachTrack, state).isCompleted
27
+ ).toBeTrue();
56
28
  });
57
29
  });
package/src/track.ts CHANGED
@@ -1,10 +1,11 @@
1
- import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
1
+ import type { JourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
2
2
 
3
3
  const makeTipStep = (
4
4
  id: string,
5
5
  tipId: string,
6
- description: string
7
- ): LearningJourneyTrackSpec['steps'][number] => ({
6
+ description: string,
7
+ previousStepId?: string
8
+ ): JourneyTrackSpec['steps'][number] => ({
8
9
  id,
9
10
  title: `Resolve tip: ${tipId}`,
10
11
  description,
@@ -13,11 +14,14 @@ const makeTipStep = (
13
14
  eventName: 'coach.tip.follow_up_action_taken',
14
15
  payloadFilter: { tipId },
15
16
  },
17
+ prerequisites: previousStepId
18
+ ? [{ kind: 'step_completed', stepId: previousStepId }]
19
+ : undefined,
16
20
  xpReward: 20,
17
21
  metadata: { tipId },
18
22
  });
19
23
 
20
- export const moneyAmbientCoachTrack: LearningJourneyTrackSpec = {
24
+ export const moneyAmbientCoachTrack: JourneyTrackSpec = {
21
25
  id: 'money_ambient_coach',
22
26
  name: 'Ambient Coach — Money',
23
27
  description:
@@ -33,17 +37,19 @@ export const moneyAmbientCoachTrack: LearningJourneyTrackSpec = {
33
37
  makeTipStep(
34
38
  'no_savings_goal',
35
39
  'no_savings_goal',
36
- 'Prompt setting a first savings goal.'
40
+ 'Prompt setting a first savings goal.',
41
+ 'cash_buffer_too_high'
37
42
  ),
38
43
  makeTipStep(
39
44
  'irregular_savings',
40
45
  'irregular_savings',
41
- 'Recommend recurring saves after irregular deposits.'
46
+ 'Recommend recurring saves after irregular deposits.',
47
+ 'no_savings_goal'
42
48
  ),
43
49
  ],
44
50
  };
45
51
 
46
- export const colivingAmbientCoachTrack: LearningJourneyTrackSpec = {
52
+ export const colivingAmbientCoachTrack: JourneyTrackSpec = {
47
53
  id: 'coliving_ambient_coach',
48
54
  name: 'Ambient Coach — Coliving',
49
55
  description: 'Contextual tips for healthy coliving habits.',
@@ -58,17 +64,19 @@ export const colivingAmbientCoachTrack: LearningJourneyTrackSpec = {
58
64
  makeTipStep(
59
65
  'guest_frequency_high',
60
66
  'guest_frequency_high',
61
- 'Set guest frequency expectations for the house.'
67
+ 'Set guest frequency expectations for the house.',
68
+ 'noise_late_evening'
62
69
  ),
63
70
  makeTipStep(
64
71
  'shared_space_conflicts',
65
72
  'shared_space_conflicts',
66
- 'Offer a shared-space checklist to reduce conflicts.'
73
+ 'Offer a shared-space checklist to reduce conflicts.',
74
+ 'guest_frequency_high'
67
75
  ),
68
76
  ],
69
77
  };
70
78
 
71
- export const ambientCoachTracks: LearningJourneyTrackSpec[] = [
79
+ export const ambientCoachTracks: JourneyTrackSpec[] = [
72
80
  moneyAmbientCoachTrack,
73
81
  colivingAmbientCoachTrack,
74
82
  ];