@contractspec/example.learning-journey-ambient-coach 3.7.19 → 4.0.1

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.
@@ -1,34 +1,35 @@
1
- $ contractspec-bun-build prebuild
2
- $ bun run build:bundle && bun run build:types
3
- $ contractspec-bun-build transpile
4
- [contractspec-bun-build] transpile target=bun root=src entries=6 noBundle=false
5
- Bundled 6 modules in 17ms
6
-
7
- docs/ambient-coach.docblock.js 1.13 KB (entry point)
8
- ./index.js 3.53 KB (entry point)
9
- docs/index.js 1.13 KB (entry point)
10
- ./example.js 0.72 KB (entry point)
11
- ./learning-journey-ambient-coach.feature.js 479 bytes (entry point)
12
- ./track.js 1.25 KB (entry point)
13
-
14
- [contractspec-bun-build] transpile target=node root=src entries=6 noBundle=false
15
- Bundled 6 modules in 48ms
16
-
17
- docs/ambient-coach.docblock.js 1.12 KB (entry point)
18
- ./index.js 3.51 KB (entry point)
19
- docs/index.js 1.12 KB (entry point)
20
- ./example.js 0.71 KB (entry point)
21
- ./learning-journey-ambient-coach.feature.js 471 bytes (entry point)
22
- ./track.js 1.23 KB (entry point)
23
-
24
- [contractspec-bun-build] transpile target=browser root=src entries=6 noBundle=false
25
- Bundled 6 modules in 32ms
26
-
27
- docs/ambient-coach.docblock.js 1.12 KB (entry point)
28
- ./index.js 3.51 KB (entry point)
29
- docs/index.js 1.12 KB (entry point)
30
- ./example.js 0.71 KB (entry point)
31
- ./learning-journey-ambient-coach.feature.js 471 bytes (entry point)
32
- ./track.js 1.23 KB (entry point)
33
-
34
- $ contractspec-bun-build types
1
+
2
+ $ contractspec-bun-build prebuild
3
+ $ bun run build:bundle && bun run build:types
4
+ $ contractspec-bun-build transpile
5
+ [contractspec-bun-build] transpile target=bun root=src entries=6 noBundle=false
6
+ Bundled 6 modules in 39ms
7
+
8
+ docs/ambient-coach.docblock.js 1.13 KB (entry point)
9
+ ./index.js 3.71 KB (entry point)
10
+ docs/index.js 1.13 KB (entry point)
11
+ ./example.js 0.74 KB (entry point)
12
+ ./learning-journey-ambient-coach.feature.js 488 bytes (entry point)
13
+ ./track.js 1.39 KB (entry point)
14
+
15
+ [contractspec-bun-build] transpile target=node root=src entries=6 noBundle=false
16
+ Bundled 6 modules in 10ms
17
+
18
+ docs/ambient-coach.docblock.js 1.12 KB (entry point)
19
+ ./index.js 3.69 KB (entry point)
20
+ docs/index.js 1.12 KB (entry point)
21
+ ./example.js 0.73 KB (entry point)
22
+ ./learning-journey-ambient-coach.feature.js 480 bytes (entry point)
23
+ ./track.js 1.38 KB (entry point)
24
+
25
+ [contractspec-bun-build] transpile target=browser root=src entries=6 noBundle=false
26
+ Bundled 6 modules in 19ms
27
+
28
+ docs/ambient-coach.docblock.js 1.12 KB (entry point)
29
+ ./index.js 3.69 KB (entry point)
30
+ docs/index.js 1.12 KB (entry point)
31
+ ./example.js 0.73 KB (entry point)
32
+ ./learning-journey-ambient-coach.feature.js 480 bytes (entry point)
33
+ ./track.js 1.38 KB (entry point)
34
+
35
+ $ contractspec-bun-build types
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @contractspec/example.learning-journey-ambient-coach
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: auto-bump internal dependents
8
+ - Updated dependencies because of chore: auto-bump internal dependents
9
+ - Updated dependencies because of Add FormSpec layout hints, semantic field rendering, and portable text/textarea input-group addons.
10
+ - Updated dependencies because of Add ThemeSpec light/dark modes and a design-system Tailwind bridge for CSS variables, presets, CSS text, and OKLCH color pass-through.
11
+ - Updated dependencies because of Add a canonical typed result system for ContractSpec success and failure propagation across operations, workflows, jobs, server adapters, MCP, GraphQL, and React clients.
12
+ - @contractspec/module.learning-journey@4.0.1
13
+ - @contractspec/lib.contracts-spec@5.5.0
14
+
15
+ ## 4.0.0
16
+
17
+ ### Major Changes
18
+
19
+ - Redesign the learning system around the adaptive journey runtime and repair shared learning sandbox presentation wiring.
20
+ - 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)
21
+ - 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.
22
+
23
+ ### Patch Changes
24
+
25
+ - 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.
26
+ - 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.
27
+ - 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.
28
+ - Updated dependencies because of Persist canonical knowledge payload text during indexing and align the retrieval/query docs with the corrected behavior.
29
+ - Updated dependencies because of Redesign the learning system around the adaptive journey runtime and repair shared learning sandbox presentation wiring.
30
+ - @contractspec/lib.contracts-spec@5.4.0
31
+ - @contractspec/module.learning-journey@4.0.0
32
+
3
33
  ## 3.7.19
4
34
 
5
35
  ### Patch Changes
@@ -1 +1 @@
1
- import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({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}}}),q=h;export{q as default};
1
+ import{defineExample as j}from"@contractspec/lib.contracts-spec/examples";var k=j({meta:{key:"examples.learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey Ambient Coach",description:"Ambient coach learning journey example with contextual tips and follow-up actions.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-ambient-coach"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach"}}),w=k;export{w as default,k as ExamplesLearningJourneyAmbientCoachExample};
@@ -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 o}from"@contractspec/lib.contracts-spec/docs";var r=[{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."}];o(r);import{defineExample as a}from"@contractspec/lib.contracts-spec/examples";var g=a({meta:{key:"examples.learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey Ambient Coach",description:"Ambient coach learning journey example with contextual tips and follow-up actions.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-ambient-coach"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach"}}),c=g;import{defineFeature as _}from"@contractspec/lib.contracts-spec/features";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,t,s,n)=>({id:i,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}}),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,g as ExamplesLearningJourneyAmbientCoachExample};
@@ -1 +1 @@
1
- import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({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"]});export{j as LearningJourneyAmbientCoachFeature};
1
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec/features";var j=g({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"]});export{j 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/example.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- declare const example: import("@contractspec/lib.contracts-spec").ExampleSpec;
2
- export default example;
1
+ declare const ExamplesLearningJourneyAmbientCoachExample: import("@contractspec/lib.contracts-spec").ExampleSpec;
2
+ export default ExamplesLearningJourneyAmbientCoachExample;
3
+ export { ExamplesLearningJourneyAmbientCoachExample };
package/dist/example.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({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}}}),q=h;export{q as default};
2
+ import{defineExample as j}from"@contractspec/lib.contracts-spec/examples";var k=j({meta:{key:"examples.learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey Ambient Coach",description:"Ambient coach learning journey example with contextual tips and follow-up actions.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-ambient-coach"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach"}}),w=k;export{w as default,k as ExamplesLearningJourneyAmbientCoachExample};
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export { default as example } from './example';
2
2
  export * from './learning-journey-ambient-coach.feature';
3
3
  export * from './track';
4
4
  import './docs';
5
+ export * from './example';
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 o}from"@contractspec/lib.contracts-spec/docs";var r=[{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."}];o(r);import{defineExample as a}from"@contractspec/lib.contracts-spec/examples";var g=a({meta:{key:"examples.learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey Ambient Coach",description:"Ambient coach learning journey example with contextual tips and follow-up actions.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-ambient-coach"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach"}}),c=g;import{defineFeature as _}from"@contractspec/lib.contracts-spec/features";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,t,s,n)=>({id:i,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}}),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,g as ExamplesLearningJourneyAmbientCoachExample};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({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"]});export{j as LearningJourneyAmbientCoachFeature};
2
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec/features";var j=g({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"]});export{j as LearningJourneyAmbientCoachFeature};
@@ -1 +1 @@
1
- import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({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}}}),q=h;export{q as default};
1
+ import{defineExample as j}from"@contractspec/lib.contracts-spec/examples";var k=j({meta:{key:"examples.learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey Ambient Coach",description:"Ambient coach learning journey example with contextual tips and follow-up actions.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-ambient-coach"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach"}}),w=k;export{w as default,k as ExamplesLearningJourneyAmbientCoachExample};
@@ -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 o}from"@contractspec/lib.contracts-spec/docs";var r=[{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."}];o(r);import{defineExample as a}from"@contractspec/lib.contracts-spec/examples";var g=a({meta:{key:"examples.learning-journey-ambient-coach",version:"1.0.0",title:"Learning Journey Ambient Coach",description:"Ambient coach learning journey example with contextual tips and follow-up actions.",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","learning-journey-ambient-coach"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.learning-journey-ambient-coach"}}),c=g;import{defineFeature as _}from"@contractspec/lib.contracts-spec/features";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,t,s,n)=>({id:i,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}}),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,g as ExamplesLearningJourneyAmbientCoachExample};
@@ -1 +1 @@
1
- import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({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"]});export{j as LearningJourneyAmbientCoachFeature};
1
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec/features";var j=g({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"]});export{j 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.19",
3
+ "version": "4.0.1",
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,13 +64,13 @@
64
64
  "typecheck": "tsc --noEmit"
65
65
  },
66
66
  "dependencies": {
67
- "@contractspec/module.learning-journey": "3.7.18",
68
- "@contractspec/lib.contracts-spec": "5.3.0"
67
+ "@contractspec/module.learning-journey": "4.0.1",
68
+ "@contractspec/lib.contracts-spec": "5.5.0"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@contractspec/tool.typescript": "3.7.13",
72
72
  "typescript": "^5.9.3",
73
- "@contractspec/tool.bun": "3.7.14"
73
+ "@contractspec/tool.bun": "3.7.15"
74
74
  },
75
75
  "publishConfig": {
76
76
  "exports": {
package/src/example.ts CHANGED
@@ -1,31 +1,28 @@
1
- import { defineExample } from '@contractspec/lib.contracts-spec';
1
+ import { defineExample } from '@contractspec/lib.contracts-spec/examples';
2
2
 
3
- const example = defineExample({
3
+ const ExamplesLearningJourneyAmbientCoachExample = defineExample({
4
4
  meta: {
5
- key: 'learning-journey-ambient-coach',
5
+ key: 'examples.learning-journey-ambient-coach',
6
6
  version: '1.0.0',
7
- title: 'Learning Journey Ambient Coach',
7
+ title: 'Learning Journey Ambient Coach',
8
8
  description:
9
- 'Ambient coaching pattern: lightweight nudges driven by context and recent progress.',
9
+ 'Ambient coach learning journey example with contextual tips and follow-up actions.',
10
10
  kind: 'template',
11
- visibility: 'public',
11
+ visibility: 'experimental',
12
12
  stability: 'experimental',
13
- owners: ['@platform.core'],
14
- tags: ['learning', 'coaching', 'ambient'],
13
+ owners: ['@contractspec-core'],
14
+ tags: ['package', 'examples', 'learning-journey-ambient-coach'],
15
15
  },
16
- docs: {
17
- rootDocId: 'docs.learning-journey.ambient-coach',
16
+ surfaces: {
17
+ templates: true,
18
+ sandbox: { enabled: true, modes: ['playground', 'specs'] },
19
+ studio: { enabled: false, installable: false },
20
+ mcp: { enabled: false },
18
21
  },
19
22
  entrypoints: {
20
23
  packageName: '@contractspec/example.learning-journey-ambient-coach',
21
- docs: './docs',
22
- },
23
- surfaces: {
24
- templates: true,
25
- sandbox: { enabled: true, modes: ['playground', 'markdown'] },
26
- studio: { enabled: true, installable: true },
27
- mcp: { enabled: true },
28
24
  },
29
25
  });
30
26
 
31
- export default example;
27
+ export default ExamplesLearningJourneyAmbientCoachExample;
28
+ export { ExamplesLearningJourneyAmbientCoachExample };
package/src/index.ts CHANGED
@@ -2,3 +2,5 @@ export { default as example } from './example';
2
2
  export * from './learning-journey-ambient-coach.feature';
3
3
  export * from './track';
4
4
  import './docs';
5
+
6
+ export * from './example';
@@ -1,4 +1,4 @@
1
- import { defineFeature } from '@contractspec/lib.contracts-spec';
1
+ import { defineFeature } from '@contractspec/lib.contracts-spec/features';
2
2
 
3
3
  export const LearningJourneyAmbientCoachFeature = defineFeature({
4
4
  meta: {
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
  ];