@contractspec/example.learning-journey-ambient-coach 1.57.0 → 1.58.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.
@@ -1,31 +1,32 @@
1
- $ bun build:types && bun build:bundle
2
- $ tsc --noEmit
3
- $ tsdown
4
- ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
5
- ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/learning-journey-ambient-coach/tsdown.config.js
6
- ℹ entry: src/example.ts, src/index.ts, src/track.ts, src/docs/ambient-coach.docblock.ts, src/docs/index.ts
7
- ℹ target: esnext
8
- ℹ tsconfig: tsconfig.json
9
- ℹ Build start
10
- ℹ dist/track.js 1.63 kB │ gzip: 0.72 kB
11
- ℹ dist/docs/ambient-coach.docblock.js 1.27 kB │ gzip: 0.71 kB
12
- ℹ dist/example.js 0.94 kB │ gzip: 0.52 kB
13
- ℹ dist/index.js 0.25 kB │ gzip: 0.13 kB
14
- ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
15
- ℹ dist/track.js.map 2.67 kB │ gzip: 1.06 kB
16
- ℹ dist/docs/ambient-coach.docblock.js.map 1.68 kB │ gzip: 0.88 kB
17
- ℹ dist/example.js.map 1.40 kB │ gzip: 0.71 kB
18
- ℹ dist/track.d.ts.map 0.17 kB │ gzip: 0.14 kB
19
- ℹ dist/example.d.ts.map 0.13 kB │ gzip: 0.13 kB
20
- ℹ dist/track.d.ts 0.44 kB │ gzip: 0.21 kB
21
- ℹ dist/example.d.ts 0.25 kB │ gzip: 0.17 kB
22
- ℹ dist/index.d.ts 0.23 kB │ gzip: 0.12 kB
23
- ℹ dist/docs/ambient-coach.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
24
- ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
25
- ℹ 15 files, total: 11.13 kB
26
- [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugins. Here is a breakdown:
27
- - rolldown-plugin-dts:generate (74%)
28
- - tsdown:external (25%)
29
- See https://rolldown.rs/options/checks#plugintimings for more details.
1
+ $ contractspec-bun-build prebuild
2
+ $ bun run prebuild && bun run build:bundle && bun run build:types
3
+ $ contractspec-bun-build prebuild
4
+ $ contractspec-bun-build transpile
5
+ [contractspec-bun-build] transpile target=bun root=src entries=5
6
+ Bundled 5 modules in 43ms
30
7
 
31
- ✔ Build complete in 19590ms
8
+ docs/ambient-coach.docblock.js 1.28 KB (entry point)
9
+ ./index.js 3.84 KB (entry point)
10
+ docs/index.js 1.28 KB (entry point)
11
+ ./example.js 0.95 KB (entry point)
12
+ ./track.js 1.63 KB (entry point)
13
+
14
+ [contractspec-bun-build] transpile target=node root=src entries=5
15
+ Bundled 5 modules in 18ms
16
+
17
+ docs/ambient-coach.docblock.js 1.27 KB (entry point)
18
+ ./index.js 3.82 KB (entry point)
19
+ docs/index.js 1.27 KB (entry point)
20
+ ./example.js 0.94 KB (entry point)
21
+ ./track.js 1.61 KB (entry point)
22
+
23
+ [contractspec-bun-build] transpile target=browser root=src entries=5
24
+ Bundled 5 modules in 22ms
25
+
26
+ docs/ambient-coach.docblock.js 1.27 KB (entry point)
27
+ ./index.js 3.82 KB (entry point)
28
+ docs/index.js 1.27 KB (entry point)
29
+ ./example.js 0.94 KB (entry point)
30
+ ./track.js 1.61 KB (entry point)
31
+
32
+ $ contractspec-bun-build types
@@ -0,0 +1 @@
1
+ $ contractspec-bun-build prebuild
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @contractspec/example.learning-journey-ambient-coach
2
2
 
3
+ ## 1.58.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d1f0fd0: chore: Migrate non-app package builds from tsdown to shared Bun tooling, add `@contractspec/tool.bun`, and standardize `prebuild`/`build`/`typecheck` with platform-aware exports and `tsc` declaration emission into `dist`.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [d1f0fd0]
12
+ - Updated dependencies [4355a9e]
13
+ - @contractspec/module.learning-journey@1.58.0
14
+ - @contractspec/lib.contracts@1.58.0
15
+
3
16
  ## 1.57.0
4
17
 
5
18
  ### Minor Changes
@@ -0,0 +1,29 @@
1
+ // src/docs/ambient-coach.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var ambientCoachDocBlocks = [
4
+ {
5
+ id: "docs.learning-journey.ambient-coach",
6
+ title: "Learning Journey — Ambient Coach",
7
+ summary: "Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/learning-journey/ambient-coach",
11
+ tags: ["learning", "coach", "tips"],
12
+ body: `## Tracks
13
+ - \`money_ambient_coach\`: cash buffer too high, no savings goal, irregular savings
14
+ - \`coliving_ambient_coach\`: noise late evening, guest frequency high, shared space conflicts
15
+
16
+ ## Steps & Events
17
+ - Trigger tip: \`coach.tip.triggered\` (payload includes \`tipId\`)
18
+ - Show tip (optional UI emission): \`coach.tip.shown\`
19
+ - Complete when acknowledged or follow-up action taken:
20
+ - \`coach.tip.acknowledged\`
21
+ - \`coach.tip.follow_up_action_taken\`
22
+
23
+ ## Usage
24
+ - Tracks export from \`@contractspec/example.learning-journey-ambient-coach/track\`.
25
+ - Registry progression is event-driven; payload filters can scope tips per category.
26
+ - XP/engagement can be awarded on completion of each tip step.`
27
+ }
28
+ ];
29
+ registerDocBlocks(ambientCoachDocBlocks);
@@ -0,0 +1,29 @@
1
+ // src/docs/ambient-coach.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var ambientCoachDocBlocks = [
4
+ {
5
+ id: "docs.learning-journey.ambient-coach",
6
+ title: "Learning Journey — Ambient Coach",
7
+ summary: "Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/learning-journey/ambient-coach",
11
+ tags: ["learning", "coach", "tips"],
12
+ body: `## Tracks
13
+ - \`money_ambient_coach\`: cash buffer too high, no savings goal, irregular savings
14
+ - \`coliving_ambient_coach\`: noise late evening, guest frequency high, shared space conflicts
15
+
16
+ ## Steps & Events
17
+ - Trigger tip: \`coach.tip.triggered\` (payload includes \`tipId\`)
18
+ - Show tip (optional UI emission): \`coach.tip.shown\`
19
+ - Complete when acknowledged or follow-up action taken:
20
+ - \`coach.tip.acknowledged\`
21
+ - \`coach.tip.follow_up_action_taken\`
22
+
23
+ ## Usage
24
+ - Tracks export from \`@contractspec/example.learning-journey-ambient-coach/track\`.
25
+ - Registry progression is event-driven; payload filters can scope tips per category.
26
+ - XP/engagement can be awarded on completion of each tip step.`
27
+ }
28
+ ];
29
+ registerDocBlocks(ambientCoachDocBlocks);
@@ -0,0 +1,32 @@
1
+ // src/example.ts
2
+ import { defineExample } from "@contractspec/lib.contracts";
3
+ var example = defineExample({
4
+ meta: {
5
+ key: "learning-journey-ambient-coach",
6
+ version: "1.0.0",
7
+ title: "Learning Journey — Ambient Coach",
8
+ description: "Ambient coaching pattern: lightweight nudges driven by context and recent progress.",
9
+ kind: "template",
10
+ visibility: "public",
11
+ stability: "experimental",
12
+ owners: ["@platform.core"],
13
+ tags: ["learning", "coaching", "ambient"]
14
+ },
15
+ docs: {
16
+ rootDocId: "docs.learning-journey.ambient-coach"
17
+ },
18
+ entrypoints: {
19
+ packageName: "@contractspec/example.learning-journey-ambient-coach",
20
+ docs: "./docs"
21
+ },
22
+ surfaces: {
23
+ templates: true,
24
+ sandbox: { enabled: true, modes: ["playground", "markdown"] },
25
+ studio: { enabled: true, installable: true },
26
+ mcp: { enabled: true }
27
+ }
28
+ });
29
+ var example_default = example;
30
+ export {
31
+ example_default as default
32
+ };
@@ -0,0 +1,106 @@
1
+ // src/docs/ambient-coach.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var ambientCoachDocBlocks = [
4
+ {
5
+ id: "docs.learning-journey.ambient-coach",
6
+ title: "Learning Journey — Ambient Coach",
7
+ summary: "Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/learning-journey/ambient-coach",
11
+ tags: ["learning", "coach", "tips"],
12
+ body: `## Tracks
13
+ - \`money_ambient_coach\`: cash buffer too high, no savings goal, irregular savings
14
+ - \`coliving_ambient_coach\`: noise late evening, guest frequency high, shared space conflicts
15
+
16
+ ## Steps & Events
17
+ - Trigger tip: \`coach.tip.triggered\` (payload includes \`tipId\`)
18
+ - Show tip (optional UI emission): \`coach.tip.shown\`
19
+ - Complete when acknowledged or follow-up action taken:
20
+ - \`coach.tip.acknowledged\`
21
+ - \`coach.tip.follow_up_action_taken\`
22
+
23
+ ## Usage
24
+ - Tracks export from \`@contractspec/example.learning-journey-ambient-coach/track\`.
25
+ - Registry progression is event-driven; payload filters can scope tips per category.
26
+ - XP/engagement can be awarded on completion of each tip step.`
27
+ }
28
+ ];
29
+ registerDocBlocks(ambientCoachDocBlocks);
30
+ // src/example.ts
31
+ import { defineExample } from "@contractspec/lib.contracts";
32
+ var example = defineExample({
33
+ meta: {
34
+ key: "learning-journey-ambient-coach",
35
+ version: "1.0.0",
36
+ title: "Learning Journey — Ambient Coach",
37
+ description: "Ambient coaching pattern: lightweight nudges driven by context and recent progress.",
38
+ kind: "template",
39
+ visibility: "public",
40
+ stability: "experimental",
41
+ owners: ["@platform.core"],
42
+ tags: ["learning", "coaching", "ambient"]
43
+ },
44
+ docs: {
45
+ rootDocId: "docs.learning-journey.ambient-coach"
46
+ },
47
+ entrypoints: {
48
+ packageName: "@contractspec/example.learning-journey-ambient-coach",
49
+ docs: "./docs"
50
+ },
51
+ surfaces: {
52
+ templates: true,
53
+ sandbox: { enabled: true, modes: ["playground", "markdown"] },
54
+ studio: { enabled: true, installable: true },
55
+ mcp: { enabled: true }
56
+ }
57
+ });
58
+ var example_default = example;
59
+
60
+ // src/track.ts
61
+ var makeTipStep = (id, tipId, description) => ({
62
+ id,
63
+ title: `Resolve tip: ${tipId}`,
64
+ description,
65
+ completion: {
66
+ kind: "event",
67
+ eventName: "coach.tip.follow_up_action_taken",
68
+ payloadFilter: { tipId }
69
+ },
70
+ xpReward: 20,
71
+ metadata: { tipId }
72
+ });
73
+ var moneyAmbientCoachTrack = {
74
+ id: "money_ambient_coach",
75
+ name: "Ambient Coach — Money",
76
+ description: "Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",
77
+ targetUserSegment: "money_user",
78
+ totalXp: 60,
79
+ steps: [
80
+ makeTipStep("cash_buffer_too_high", "cash_buffer_too_high", "Suggest sweeping excess cash into goals."),
81
+ makeTipStep("no_savings_goal", "no_savings_goal", "Prompt setting a first savings goal."),
82
+ makeTipStep("irregular_savings", "irregular_savings", "Recommend recurring saves after irregular deposits.")
83
+ ]
84
+ };
85
+ var colivingAmbientCoachTrack = {
86
+ id: "coliving_ambient_coach",
87
+ name: "Ambient Coach — Coliving",
88
+ description: "Contextual tips for healthy coliving habits.",
89
+ targetUserSegment: "coliving",
90
+ totalXp: 60,
91
+ steps: [
92
+ makeTipStep("noise_late_evening", "noise_late_evening", "Suggest updating quiet hours to reduce evening noise."),
93
+ makeTipStep("guest_frequency_high", "guest_frequency_high", "Set guest frequency expectations for the house."),
94
+ makeTipStep("shared_space_conflicts", "shared_space_conflicts", "Offer a shared-space checklist to reduce conflicts.")
95
+ ]
96
+ };
97
+ var ambientCoachTracks = [
98
+ moneyAmbientCoachTrack,
99
+ colivingAmbientCoachTrack
100
+ ];
101
+ export {
102
+ moneyAmbientCoachTrack,
103
+ example_default as example,
104
+ colivingAmbientCoachTrack,
105
+ ambientCoachTracks
106
+ };
@@ -0,0 +1,46 @@
1
+ // src/track.ts
2
+ var makeTipStep = (id, tipId, description) => ({
3
+ id,
4
+ title: `Resolve tip: ${tipId}`,
5
+ description,
6
+ completion: {
7
+ kind: "event",
8
+ eventName: "coach.tip.follow_up_action_taken",
9
+ payloadFilter: { tipId }
10
+ },
11
+ xpReward: 20,
12
+ metadata: { tipId }
13
+ });
14
+ var moneyAmbientCoachTrack = {
15
+ id: "money_ambient_coach",
16
+ name: "Ambient Coach — Money",
17
+ description: "Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",
18
+ targetUserSegment: "money_user",
19
+ totalXp: 60,
20
+ steps: [
21
+ makeTipStep("cash_buffer_too_high", "cash_buffer_too_high", "Suggest sweeping excess cash into goals."),
22
+ makeTipStep("no_savings_goal", "no_savings_goal", "Prompt setting a first savings goal."),
23
+ makeTipStep("irregular_savings", "irregular_savings", "Recommend recurring saves after irregular deposits.")
24
+ ]
25
+ };
26
+ var colivingAmbientCoachTrack = {
27
+ id: "coliving_ambient_coach",
28
+ name: "Ambient Coach — Coliving",
29
+ description: "Contextual tips for healthy coliving habits.",
30
+ targetUserSegment: "coliving",
31
+ totalXp: 60,
32
+ steps: [
33
+ makeTipStep("noise_late_evening", "noise_late_evening", "Suggest updating quiet hours to reduce evening noise."),
34
+ makeTipStep("guest_frequency_high", "guest_frequency_high", "Set guest frequency expectations for the house."),
35
+ makeTipStep("shared_space_conflicts", "shared_space_conflicts", "Offer a shared-space checklist to reduce conflicts.")
36
+ ]
37
+ };
38
+ var ambientCoachTracks = [
39
+ moneyAmbientCoachTrack,
40
+ colivingAmbientCoachTrack
41
+ ];
42
+ export {
43
+ moneyAmbientCoachTrack,
44
+ colivingAmbientCoachTrack,
45
+ ambientCoachTracks
46
+ };
@@ -1 +1,2 @@
1
- export { };
1
+ export {};
2
+ //# sourceMappingURL=ambient-coach.docblock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ambient-coach.docblock.d.ts","sourceRoot":"","sources":["../../src/docs/ambient-coach.docblock.ts"],"names":[],"mappings":""}
@@ -1,19 +1,16 @@
1
+ // @bun
2
+ // src/docs/ambient-coach.docblock.ts
1
3
  import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
2
-
3
- //#region src/docs/ambient-coach.docblock.ts
4
- registerDocBlocks([{
5
- id: "docs.learning-journey.ambient-coach",
6
- title: "Learning Journey Ambient Coach",
7
- summary: "Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",
8
- kind: "reference",
9
- visibility: "public",
10
- route: "/docs/learning-journey/ambient-coach",
11
- tags: [
12
- "learning",
13
- "coach",
14
- "tips"
15
- ],
16
- body: `## Tracks
4
+ var ambientCoachDocBlocks = [
5
+ {
6
+ id: "docs.learning-journey.ambient-coach",
7
+ title: "Learning Journey \u2014 Ambient Coach",
8
+ summary: "Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",
9
+ kind: "reference",
10
+ visibility: "public",
11
+ route: "/docs/learning-journey/ambient-coach",
12
+ tags: ["learning", "coach", "tips"],
13
+ body: `## Tracks
17
14
  - \`money_ambient_coach\`: cash buffer too high, no savings goal, irregular savings
18
15
  - \`coliving_ambient_coach\`: noise late evening, guest frequency high, shared space conflicts
19
16
 
@@ -28,7 +25,6 @@ registerDocBlocks([{
28
25
  - Tracks export from \`@contractspec/example.learning-journey-ambient-coach/track\`.
29
26
  - Registry progression is event-driven; payload filters can scope tips per category.
30
27
  - XP/engagement can be awarded on completion of each tip step.`
31
- }]);
32
-
33
- //#endregion
34
- //# sourceMappingURL=ambient-coach.docblock.js.map
28
+ }
29
+ ];
30
+ registerDocBlocks(ambientCoachDocBlocks);
@@ -1 +1,2 @@
1
- export { };
1
+ import './ambient-coach.docblock';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC"}
@@ -1 +1,30 @@
1
- import "./ambient-coach.docblock.js";
1
+ // @bun
2
+ // src/docs/ambient-coach.docblock.ts
3
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
4
+ var ambientCoachDocBlocks = [
5
+ {
6
+ id: "docs.learning-journey.ambient-coach",
7
+ title: "Learning Journey \u2014 Ambient Coach",
8
+ summary: "Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",
9
+ kind: "reference",
10
+ visibility: "public",
11
+ route: "/docs/learning-journey/ambient-coach",
12
+ tags: ["learning", "coach", "tips"],
13
+ body: `## Tracks
14
+ - \`money_ambient_coach\`: cash buffer too high, no savings goal, irregular savings
15
+ - \`coliving_ambient_coach\`: noise late evening, guest frequency high, shared space conflicts
16
+
17
+ ## Steps & Events
18
+ - Trigger tip: \`coach.tip.triggered\` (payload includes \`tipId\`)
19
+ - Show tip (optional UI emission): \`coach.tip.shown\`
20
+ - Complete when acknowledged or follow-up action taken:
21
+ - \`coach.tip.acknowledged\`
22
+ - \`coach.tip.follow_up_action_taken\`
23
+
24
+ ## Usage
25
+ - Tracks export from \`@contractspec/example.learning-journey-ambient-coach/track\`.
26
+ - Registry progression is event-driven; payload filters can scope tips per category.
27
+ - XP/engagement can be awarded on completion of each tip step.`
28
+ }
29
+ ];
30
+ registerDocBlocks(ambientCoachDocBlocks);
package/dist/example.d.ts CHANGED
@@ -1,7 +1,3 @@
1
- import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
-
3
- //#region src/example.d.ts
4
- declare const example: _contractspec_lib_contracts0.ExampleSpec;
5
- //#endregion
6
- export { example as default };
1
+ declare const example: import("@contractspec/lib.contracts").ExampleSpec;
2
+ export default example;
7
3
  //# sourceMappingURL=example.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"mappings":";;;cAEM,OAAA,EA0BJ,4BAAA,CA1BW,WAAA"}
1
+ {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,OAAO,mDA0BX,CAAC;AAEH,eAAe,OAAO,CAAC"}
package/dist/example.js CHANGED
@@ -1,41 +1,33 @@
1
+ // @bun
2
+ // src/example.ts
1
3
  import { defineExample } from "@contractspec/lib.contracts";
2
-
3
- //#region src/example.ts
4
- const example = defineExample({
5
- meta: {
6
- key: "learning-journey-ambient-coach",
7
- version: "1.0.0",
8
- title: "Learning Journey — Ambient Coach",
9
- description: "Ambient coaching pattern: lightweight nudges driven by context and recent progress.",
10
- kind: "template",
11
- visibility: "public",
12
- stability: "experimental",
13
- owners: ["@platform.core"],
14
- tags: [
15
- "learning",
16
- "coaching",
17
- "ambient"
18
- ]
19
- },
20
- docs: { rootDocId: "docs.learning-journey.ambient-coach" },
21
- entrypoints: {
22
- packageName: "@contractspec/example.learning-journey-ambient-coach",
23
- docs: "./docs"
24
- },
25
- surfaces: {
26
- templates: true,
27
- sandbox: {
28
- enabled: true,
29
- modes: ["playground", "markdown"]
30
- },
31
- studio: {
32
- enabled: true,
33
- installable: true
34
- },
35
- mcp: { enabled: true }
36
- }
4
+ var example = defineExample({
5
+ meta: {
6
+ key: "learning-journey-ambient-coach",
7
+ version: "1.0.0",
8
+ title: "Learning Journey \u2014 Ambient Coach",
9
+ description: "Ambient coaching pattern: lightweight nudges driven by context and recent progress.",
10
+ kind: "template",
11
+ visibility: "public",
12
+ stability: "experimental",
13
+ owners: ["@platform.core"],
14
+ tags: ["learning", "coaching", "ambient"]
15
+ },
16
+ docs: {
17
+ rootDocId: "docs.learning-journey.ambient-coach"
18
+ },
19
+ entrypoints: {
20
+ 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
+ }
37
29
  });
38
-
39
- //#endregion
40
- export { example as default };
41
- //# sourceMappingURL=example.js.map
30
+ var example_default = example;
31
+ export {
32
+ example_default as default
33
+ };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- import example from "./example.js";
2
- import { ambientCoachTracks, colivingAmbientCoachTrack, moneyAmbientCoachTrack } from "./track.js";
3
- export { ambientCoachTracks, colivingAmbientCoachTrack, example, moneyAmbientCoachTrack };
1
+ export * from './track';
2
+ export { default as example } from './example';
3
+ import './docs';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,QAAQ,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,107 @@
1
- import example from "./example.js";
2
- import { ambientCoachTracks, colivingAmbientCoachTrack, moneyAmbientCoachTrack } from "./track.js";
3
- import "./docs/index.js";
1
+ // @bun
2
+ // src/docs/ambient-coach.docblock.ts
3
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
4
+ var ambientCoachDocBlocks = [
5
+ {
6
+ id: "docs.learning-journey.ambient-coach",
7
+ title: "Learning Journey \u2014 Ambient Coach",
8
+ summary: "Context-aware coaching pattern that triggers tips, shows them, and marks completion when users act or acknowledge.",
9
+ kind: "reference",
10
+ visibility: "public",
11
+ route: "/docs/learning-journey/ambient-coach",
12
+ tags: ["learning", "coach", "tips"],
13
+ body: `## Tracks
14
+ - \`money_ambient_coach\`: cash buffer too high, no savings goal, irregular savings
15
+ - \`coliving_ambient_coach\`: noise late evening, guest frequency high, shared space conflicts
4
16
 
5
- export { ambientCoachTracks, colivingAmbientCoachTrack, example, moneyAmbientCoachTrack };
17
+ ## Steps & Events
18
+ - Trigger tip: \`coach.tip.triggered\` (payload includes \`tipId\`)
19
+ - Show tip (optional UI emission): \`coach.tip.shown\`
20
+ - Complete when acknowledged or follow-up action taken:
21
+ - \`coach.tip.acknowledged\`
22
+ - \`coach.tip.follow_up_action_taken\`
23
+
24
+ ## Usage
25
+ - Tracks export from \`@contractspec/example.learning-journey-ambient-coach/track\`.
26
+ - Registry progression is event-driven; payload filters can scope tips per category.
27
+ - XP/engagement can be awarded on completion of each tip step.`
28
+ }
29
+ ];
30
+ registerDocBlocks(ambientCoachDocBlocks);
31
+ // src/example.ts
32
+ import { defineExample } from "@contractspec/lib.contracts";
33
+ var example = defineExample({
34
+ meta: {
35
+ key: "learning-journey-ambient-coach",
36
+ version: "1.0.0",
37
+ title: "Learning Journey \u2014 Ambient Coach",
38
+ description: "Ambient coaching pattern: lightweight nudges driven by context and recent progress.",
39
+ kind: "template",
40
+ visibility: "public",
41
+ stability: "experimental",
42
+ owners: ["@platform.core"],
43
+ tags: ["learning", "coaching", "ambient"]
44
+ },
45
+ docs: {
46
+ rootDocId: "docs.learning-journey.ambient-coach"
47
+ },
48
+ entrypoints: {
49
+ packageName: "@contractspec/example.learning-journey-ambient-coach",
50
+ docs: "./docs"
51
+ },
52
+ surfaces: {
53
+ templates: true,
54
+ sandbox: { enabled: true, modes: ["playground", "markdown"] },
55
+ studio: { enabled: true, installable: true },
56
+ mcp: { enabled: true }
57
+ }
58
+ });
59
+ var example_default = example;
60
+
61
+ // src/track.ts
62
+ var makeTipStep = (id, tipId, description) => ({
63
+ id,
64
+ title: `Resolve tip: ${tipId}`,
65
+ description,
66
+ completion: {
67
+ kind: "event",
68
+ eventName: "coach.tip.follow_up_action_taken",
69
+ payloadFilter: { tipId }
70
+ },
71
+ xpReward: 20,
72
+ metadata: { tipId }
73
+ });
74
+ var moneyAmbientCoachTrack = {
75
+ id: "money_ambient_coach",
76
+ name: "Ambient Coach \u2014 Money",
77
+ description: "Subtle coaching for money patterns (cash buffer, goals, saving rhythm).",
78
+ targetUserSegment: "money_user",
79
+ totalXp: 60,
80
+ steps: [
81
+ makeTipStep("cash_buffer_too_high", "cash_buffer_too_high", "Suggest sweeping excess cash into goals."),
82
+ makeTipStep("no_savings_goal", "no_savings_goal", "Prompt setting a first savings goal."),
83
+ makeTipStep("irregular_savings", "irregular_savings", "Recommend recurring saves after irregular deposits.")
84
+ ]
85
+ };
86
+ var colivingAmbientCoachTrack = {
87
+ id: "coliving_ambient_coach",
88
+ name: "Ambient Coach \u2014 Coliving",
89
+ description: "Contextual tips for healthy coliving habits.",
90
+ targetUserSegment: "coliving",
91
+ totalXp: 60,
92
+ steps: [
93
+ makeTipStep("noise_late_evening", "noise_late_evening", "Suggest updating quiet hours to reduce evening noise."),
94
+ makeTipStep("guest_frequency_high", "guest_frequency_high", "Set guest frequency expectations for the house."),
95
+ makeTipStep("shared_space_conflicts", "shared_space_conflicts", "Offer a shared-space checklist to reduce conflicts.")
96
+ ]
97
+ };
98
+ var ambientCoachTracks = [
99
+ moneyAmbientCoachTrack,
100
+ colivingAmbientCoachTrack
101
+ ];
102
+ export {
103
+ moneyAmbientCoachTrack,
104
+ example_default as example,
105
+ colivingAmbientCoachTrack,
106
+ ambientCoachTracks
107
+ };