@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.
- package/.turbo/turbo-build.log +35 -34
- package/CHANGELOG.md +30 -0
- package/dist/browser/example.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/learning-journey-ambient-coach.feature.js +1 -1
- package/dist/browser/track.js +1 -1
- package/dist/example.d.ts +3 -2
- package/dist/example.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/learning-journey-ambient-coach.feature.js +1 -1
- package/dist/node/example.js +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/learning-journey-ambient-coach.feature.js +1 -1
- package/dist/node/track.js +1 -1
- package/dist/track.d.ts +4 -4
- package/dist/track.js +1 -1
- package/package.json +4 -4
- package/src/example.ts +15 -18
- package/src/index.ts +2 -0
- package/src/learning-journey-ambient-coach.feature.ts +1 -1
- package/src/track.test.ts +15 -43
- package/src/track.ts +18 -10
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
[
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
./
|
|
12
|
-
./
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
./
|
|
22
|
-
./
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
./
|
|
32
|
-
./
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
|
|
2
|
+
[0m[2m[35m$[0m [2m[1mcontractspec-bun-build prebuild[0m
|
|
3
|
+
[0m[2m[35m$[0m [2m[1mbun run build:bundle && bun run build:types[0m
|
|
4
|
+
[0m[2m[35m$[0m [2m[1mcontractspec-bun-build transpile[0m
|
|
5
|
+
[contractspec-bun-build] transpile target=bun root=src entries=6 noBundle=false
|
|
6
|
+
[32mBundled 6 modules in 39ms[0m
|
|
7
|
+
|
|
8
|
+
[34mdocs/ambient-coach.docblock.js[0m 1.13 KB [2m(entry point)[0m
|
|
9
|
+
[34m./index.js[0m 3.71 KB [2m(entry point)[0m
|
|
10
|
+
[34mdocs/index.js[0m 1.13 KB [2m(entry point)[0m
|
|
11
|
+
[34m./example.js[0m 0.74 KB [2m(entry point)[0m
|
|
12
|
+
[34m./learning-journey-ambient-coach.feature.js[0m 488 bytes [2m(entry point)[0m
|
|
13
|
+
[34m./track.js[0m 1.39 KB [2m(entry point)[0m
|
|
14
|
+
|
|
15
|
+
[contractspec-bun-build] transpile target=node root=src entries=6 noBundle=false
|
|
16
|
+
[32mBundled 6 modules in 10ms[0m
|
|
17
|
+
|
|
18
|
+
[34mdocs/ambient-coach.docblock.js[0m 1.12 KB [2m(entry point)[0m
|
|
19
|
+
[34m./index.js[0m 3.69 KB [2m(entry point)[0m
|
|
20
|
+
[34mdocs/index.js[0m 1.12 KB [2m(entry point)[0m
|
|
21
|
+
[34m./example.js[0m 0.73 KB [2m(entry point)[0m
|
|
22
|
+
[34m./learning-journey-ambient-coach.feature.js[0m 480 bytes [2m(entry point)[0m
|
|
23
|
+
[34m./track.js[0m 1.38 KB [2m(entry point)[0m
|
|
24
|
+
|
|
25
|
+
[contractspec-bun-build] transpile target=browser root=src entries=6 noBundle=false
|
|
26
|
+
[32mBundled 6 modules in 19ms[0m
|
|
27
|
+
|
|
28
|
+
[34mdocs/ambient-coach.docblock.js[0m 1.12 KB [2m(entry point)[0m
|
|
29
|
+
[34m./index.js[0m 3.69 KB [2m(entry point)[0m
|
|
30
|
+
[34mdocs/index.js[0m 1.12 KB [2m(entry point)[0m
|
|
31
|
+
[34m./example.js[0m 0.73 KB [2m(entry point)[0m
|
|
32
|
+
[34m./learning-journey-ambient-coach.feature.js[0m 480 bytes [2m(entry point)[0m
|
|
33
|
+
[34m./track.js[0m 1.38 KB [2m(entry point)[0m
|
|
34
|
+
|
|
35
|
+
[0m[2m[35m$[0m [2m[1mcontractspec-bun-build types[0m
|
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
|
package/dist/browser/example.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineExample as
|
|
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};
|
package/dist/browser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerDocBlocks as
|
|
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};
|
package/dist/browser/track.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=(t,n
|
|
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
|
|
2
|
-
export default
|
|
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
|
|
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
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{registerDocBlocks as
|
|
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};
|
package/dist/node/example.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineExample as
|
|
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};
|
package/dist/node/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerDocBlocks as
|
|
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};
|
package/dist/node/track.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=(t,n
|
|
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 {
|
|
2
|
-
export declare const moneyAmbientCoachTrack:
|
|
3
|
-
export declare const colivingAmbientCoachTrack:
|
|
4
|
-
export declare const ambientCoachTracks:
|
|
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
|
|
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
|
+
"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": "
|
|
68
|
-
"@contractspec/lib.contracts-spec": "5.
|
|
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.
|
|
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
|
|
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
|
|
7
|
+
title: 'Learning Journey Ambient Coach',
|
|
8
8
|
description:
|
|
9
|
-
'Ambient
|
|
9
|
+
'Ambient coach learning journey example with contextual tips and follow-up actions.',
|
|
10
10
|
kind: 'template',
|
|
11
|
-
visibility: '
|
|
11
|
+
visibility: 'experimental',
|
|
12
12
|
stability: 'experimental',
|
|
13
|
-
owners: ['@
|
|
14
|
-
tags: ['
|
|
13
|
+
owners: ['@contractspec-core'],
|
|
14
|
+
tags: ['package', 'examples', 'learning-journey-ambient-coach'],
|
|
15
15
|
},
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
27
|
+
export default ExamplesLearningJourneyAmbientCoachExample;
|
|
28
|
+
export { ExamplesLearningJourneyAmbientCoachExample };
|
package/src/index.ts
CHANGED
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
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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(
|
|
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 {
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
79
|
+
export const ambientCoachTracks: JourneyTrackSpec[] = [
|
|
72
80
|
moneyAmbientCoachTrack,
|
|
73
81
|
colivingAmbientCoachTrack,
|
|
74
82
|
];
|