@contractspec/example.learning-patterns 3.7.5 → 3.7.7
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 +3 -3
- package/AGENTS.md +49 -21
- package/CHANGELOG.md +9 -0
- package/README.md +61 -3
- package/dist/browser/index.js +62 -61
- package/dist/browser/tracks/index.js +42 -42
- package/dist/index.d.ts +2 -2
- package/dist/index.js +62 -61
- package/dist/node/index.js +62 -61
- package/dist/node/tracks/index.js +42 -42
- package/dist/tracks/index.d.ts +1 -1
- package/dist/tracks/index.js +42 -42
- package/package.json +7 -7
- package/src/docs/learning-patterns.docblock.ts +22 -22
- package/src/events.ts +10 -10
- package/src/example.ts +25 -25
- package/src/index.ts +2 -2
- package/src/learning-patterns.feature.ts +16 -16
- package/src/learning-patterns.test.ts +216 -218
- package/src/tracks/ambient-coach.ts +36 -36
- package/src/tracks/drills.ts +44 -44
- package/src/tracks/index.ts +1 -1
- package/src/tracks/quests.ts +37 -37
- package/tsconfig.json +7 -17
- package/tsdown.config.js +7 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -3,7 +3,7 @@ $ bun run prebuild && bun run build:bundle && bun run build:types
|
|
|
3
3
|
$ contractspec-bun-build prebuild
|
|
4
4
|
$ contractspec-bun-build transpile
|
|
5
5
|
[contractspec-bun-build] transpile target=bun root=src entries=10 noBundle=false
|
|
6
|
-
Bundled 10 modules in
|
|
6
|
+
Bundled 10 modules in 47ms
|
|
7
7
|
|
|
8
8
|
docs/index.js 1.15 KB (entry point)
|
|
9
9
|
./index.js 6.53 KB (entry point)
|
|
@@ -17,7 +17,7 @@ Bundled 10 modules in 27ms
|
|
|
17
17
|
./events.js 496 bytes (entry point)
|
|
18
18
|
|
|
19
19
|
[contractspec-bun-build] transpile target=node root=src entries=10 noBundle=false
|
|
20
|
-
Bundled 10 modules in
|
|
20
|
+
Bundled 10 modules in 30ms
|
|
21
21
|
|
|
22
22
|
docs/index.js 1.14 KB (entry point)
|
|
23
23
|
./index.js 6.52 KB (entry point)
|
|
@@ -31,7 +31,7 @@ Bundled 10 modules in 12ms
|
|
|
31
31
|
./events.js 488 bytes (entry point)
|
|
32
32
|
|
|
33
33
|
[contractspec-bun-build] transpile target=browser root=src entries=10 noBundle=false
|
|
34
|
-
Bundled 10 modules in
|
|
34
|
+
Bundled 10 modules in 35ms
|
|
35
35
|
|
|
36
36
|
docs/index.js 1.14 KB (entry point)
|
|
37
37
|
./index.js 6.52 KB (entry point)
|
package/AGENTS.md
CHANGED
|
@@ -1,30 +1,58 @@
|
|
|
1
|
-
# AI Agent Guide
|
|
1
|
+
# AI Agent Guide — `@contractspec/example.learning-patterns`
|
|
2
2
|
|
|
3
3
|
Scope: `packages/examples/learning-patterns/*`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Example: drills + ambient coach + quests learning patterns, powered by Learning Journey (event-driven, deterministic).
|
|
6
6
|
|
|
7
7
|
## Quick Context
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
9
|
+
- Layer: `example`.
|
|
10
|
+
- Package visibility: published package.
|
|
11
|
+
- Primary consumers are example explorers, template authors, and documentation readers.
|
|
12
|
+
- Related packages: `@contractspec/lib.contracts-spec`, `@contractspec/module.learning-journey`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
13
|
+
|
|
14
|
+
## Architecture
|
|
15
|
+
|
|
16
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
17
|
+
- `src/events.ts` is package-level event definitions.
|
|
18
|
+
- `src/example.ts` is the runnable example entrypoint.
|
|
19
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
20
|
+
- `src/learning-patterns.feature.ts` defines a feature entrypoint.
|
|
21
|
+
- `src/learning-patterns.test.ts` is part of the package's public or composition surface.
|
|
22
|
+
- `src/tracks` is part of the package's public or composition surface.
|
|
23
|
+
|
|
24
|
+
## Public Surface
|
|
25
|
+
|
|
26
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
27
|
+
- Export `./docs` resolves through `./src/docs/index.ts`.
|
|
28
|
+
- Export `./docs/learning-patterns.docblock` resolves through `./src/docs/learning-patterns.docblock.ts`.
|
|
29
|
+
- Export `./events` resolves through `./src/events.ts`.
|
|
30
|
+
- Export `./example` resolves through `./src/example.ts`.
|
|
31
|
+
- Export `./learning-patterns.feature` resolves through `./src/learning-patterns.feature.ts`.
|
|
32
|
+
- Export `./tracks` resolves through `./src/tracks/index.ts`.
|
|
33
|
+
- Export `./tracks/ambient-coach` resolves through `./src/tracks/ambient-coach.ts`.
|
|
34
|
+
- Export `./tracks/drills` resolves through `./src/tracks/drills.ts`.
|
|
35
|
+
- Export `./tracks/quests` resolves through `./src/tracks/quests.ts`.
|
|
36
|
+
|
|
37
|
+
## Guardrails
|
|
38
|
+
|
|
39
|
+
- Keep the example package demonstrative, buildable, and aligned with the exported feature surface.
|
|
40
|
+
- Do not add hidden production assumptions that are not actually implemented in the example.
|
|
41
|
+
- Changes here can affect downstream packages such as `@contractspec/lib.contracts-spec`, `@contractspec/module.learning-journey`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
42
|
+
- Changes here can affect downstream packages such as `@contractspec/lib.contracts-spec`, `@contractspec/module.learning-journey`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
24
43
|
|
|
25
44
|
## Local Commands
|
|
26
45
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
46
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
47
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
48
|
+
- `bun run test` — bun test
|
|
49
|
+
- `bun run lint` — bun lint:fix
|
|
50
|
+
- `bun run lint:check` — biome check .
|
|
51
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
52
|
+
- `bun run typecheck` — tsc --noEmit
|
|
53
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
54
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
55
|
+
- `bun run clean` — rimraf dist .turbo
|
|
56
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
57
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
58
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @contractspec/example.learning-patterns
|
|
2
2
|
|
|
3
|
+
## 3.7.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix: release manifest
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @contractspec/module.learning-journey@3.7.6
|
|
10
|
+
- @contractspec/lib.contracts-spec@3.7.6
|
|
11
|
+
|
|
3
12
|
## 3.7.5
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,15 +1,73 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @contractspec/example.learning-patterns
|
|
2
2
|
|
|
3
|
-
Website: https://contractspec.io
|
|
3
|
+
Website: https://contractspec.io
|
|
4
4
|
|
|
5
|
+
**Example: drills + ambient coach + quests learning patterns, powered by Learning Journey (event-driven, deterministic).**
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
## What This Demonstrates
|
|
7
8
|
|
|
9
|
+
- Three distinct learning track patterns: drills, ambient-coach, quests.
|
|
10
|
+
- Event-driven track progression.
|
|
11
|
+
- Deterministic state transitions via the Learning Journey module.
|
|
12
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
13
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
8
14
|
|
|
15
|
+
## Running Locally
|
|
9
16
|
|
|
17
|
+
From `packages/examples/learning-patterns`:
|
|
18
|
+
- `bun run dev`
|
|
19
|
+
- `bun run build`
|
|
20
|
+
- `bun run test`
|
|
21
|
+
- `bun run typecheck`
|
|
10
22
|
|
|
23
|
+
## Usage
|
|
11
24
|
|
|
25
|
+
Use `@contractspec/example.learning-patterns` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
|
|
12
26
|
|
|
27
|
+
## Architecture
|
|
13
28
|
|
|
29
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
30
|
+
- `src/events.ts` is package-level event definitions.
|
|
31
|
+
- `src/example.ts` is the runnable example entrypoint.
|
|
32
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
33
|
+
- `src/learning-patterns.feature.ts` defines a feature entrypoint.
|
|
34
|
+
- `src/learning-patterns.test.ts` is part of the package's public or composition surface.
|
|
35
|
+
- `src/tracks` is part of the package's public or composition surface.
|
|
14
36
|
|
|
37
|
+
## Public Entry Points
|
|
15
38
|
|
|
39
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
40
|
+
- Export `./docs` resolves through `./src/docs/index.ts`.
|
|
41
|
+
- Export `./docs/learning-patterns.docblock` resolves through `./src/docs/learning-patterns.docblock.ts`.
|
|
42
|
+
- Export `./events` resolves through `./src/events.ts`.
|
|
43
|
+
- Export `./example` resolves through `./src/example.ts`.
|
|
44
|
+
- Export `./learning-patterns.feature` resolves through `./src/learning-patterns.feature.ts`.
|
|
45
|
+
- Export `./tracks` resolves through `./src/tracks/index.ts`.
|
|
46
|
+
- Export `./tracks/ambient-coach` resolves through `./src/tracks/ambient-coach.ts`.
|
|
47
|
+
- Export `./tracks/drills` resolves through `./src/tracks/drills.ts`.
|
|
48
|
+
- Export `./tracks/quests` resolves through `./src/tracks/quests.ts`.
|
|
49
|
+
|
|
50
|
+
## Local Commands
|
|
51
|
+
|
|
52
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
53
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
54
|
+
- `bun run test` — bun test
|
|
55
|
+
- `bun run lint` — bun lint:fix
|
|
56
|
+
- `bun run lint:check` — biome check .
|
|
57
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
58
|
+
- `bun run typecheck` — tsc --noEmit
|
|
59
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
60
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
61
|
+
- `bun run clean` — rimraf dist .turbo
|
|
62
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
63
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
64
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
|
65
|
+
|
|
66
|
+
## Recent Updates
|
|
67
|
+
|
|
68
|
+
- Replace eslint+prettier by biomejs to optimize speed.
|
|
69
|
+
- Missing contract layers.
|
|
70
|
+
|
|
71
|
+
## Notes
|
|
72
|
+
|
|
73
|
+
- Works alongside `@contractspec/lib.contracts-spec`, `@contractspec/module.learning-journey`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
package/dist/browser/index.js
CHANGED
|
@@ -77,6 +77,68 @@ var example = defineExample({
|
|
|
77
77
|
});
|
|
78
78
|
var example_default = example;
|
|
79
79
|
|
|
80
|
+
// src/learning-patterns.feature.ts
|
|
81
|
+
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
82
|
+
var LearningPatternsFeature = defineFeature({
|
|
83
|
+
meta: {
|
|
84
|
+
key: "learning-patterns",
|
|
85
|
+
version: "1.0.0",
|
|
86
|
+
title: "Learning Patterns",
|
|
87
|
+
description: "Learning archetypes (drills, ambient-coach, quests) via event-driven track specs",
|
|
88
|
+
domain: "learning-journey",
|
|
89
|
+
owners: ["@examples"],
|
|
90
|
+
tags: ["learning", "patterns", "archetypes", "tracks"],
|
|
91
|
+
stability: "experimental"
|
|
92
|
+
},
|
|
93
|
+
telemetry: [{ key: "learning-patterns.telemetry", version: "1.0.0" }],
|
|
94
|
+
docs: [
|
|
95
|
+
"docs.examples.learning-patterns.goal",
|
|
96
|
+
"docs.examples.learning-patterns.reference"
|
|
97
|
+
]
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// src/tracks/ambient-coach.ts
|
|
101
|
+
var ambientCoachTrack = {
|
|
102
|
+
id: "learning_patterns_ambient_coach_basics",
|
|
103
|
+
name: "Ambient Coach Basics",
|
|
104
|
+
description: "Contextual tips triggered by behavior events.",
|
|
105
|
+
targetUserSegment: "learner",
|
|
106
|
+
targetRole: "individual",
|
|
107
|
+
totalXp: 30,
|
|
108
|
+
steps: [
|
|
109
|
+
{
|
|
110
|
+
id: "tip_shown",
|
|
111
|
+
title: "See a contextual tip",
|
|
112
|
+
order: 1,
|
|
113
|
+
completion: { kind: "event", eventName: LEARNING_EVENTS.COACH_TIP_SHOWN },
|
|
114
|
+
xpReward: 10
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "tip_acknowledged",
|
|
118
|
+
title: "Acknowledge a tip",
|
|
119
|
+
order: 2,
|
|
120
|
+
completion: {
|
|
121
|
+
kind: "event",
|
|
122
|
+
eventName: LEARNING_EVENTS.COACH_TIP_ACKNOWLEDGED
|
|
123
|
+
},
|
|
124
|
+
xpReward: 10
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: "tip_action_taken",
|
|
128
|
+
title: "Take an action from a tip",
|
|
129
|
+
order: 3,
|
|
130
|
+
completion: {
|
|
131
|
+
kind: "event",
|
|
132
|
+
eventName: LEARNING_EVENTS.COACH_TIP_ACTION_TAKEN
|
|
133
|
+
},
|
|
134
|
+
xpReward: 10
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
};
|
|
138
|
+
var ambientCoachTracks = [
|
|
139
|
+
ambientCoachTrack
|
|
140
|
+
];
|
|
141
|
+
|
|
80
142
|
// src/tracks/drills.ts
|
|
81
143
|
var drillsTrack = {
|
|
82
144
|
id: "learning_patterns_drills_basics",
|
|
@@ -126,48 +188,6 @@ var drillsTrack = {
|
|
|
126
188
|
};
|
|
127
189
|
var drillTracks = [drillsTrack];
|
|
128
190
|
|
|
129
|
-
// src/tracks/ambient-coach.ts
|
|
130
|
-
var ambientCoachTrack = {
|
|
131
|
-
id: "learning_patterns_ambient_coach_basics",
|
|
132
|
-
name: "Ambient Coach Basics",
|
|
133
|
-
description: "Contextual tips triggered by behavior events.",
|
|
134
|
-
targetUserSegment: "learner",
|
|
135
|
-
targetRole: "individual",
|
|
136
|
-
totalXp: 30,
|
|
137
|
-
steps: [
|
|
138
|
-
{
|
|
139
|
-
id: "tip_shown",
|
|
140
|
-
title: "See a contextual tip",
|
|
141
|
-
order: 1,
|
|
142
|
-
completion: { kind: "event", eventName: LEARNING_EVENTS.COACH_TIP_SHOWN },
|
|
143
|
-
xpReward: 10
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
id: "tip_acknowledged",
|
|
147
|
-
title: "Acknowledge a tip",
|
|
148
|
-
order: 2,
|
|
149
|
-
completion: {
|
|
150
|
-
kind: "event",
|
|
151
|
-
eventName: LEARNING_EVENTS.COACH_TIP_ACKNOWLEDGED
|
|
152
|
-
},
|
|
153
|
-
xpReward: 10
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
id: "tip_action_taken",
|
|
157
|
-
title: "Take an action from a tip",
|
|
158
|
-
order: 3,
|
|
159
|
-
completion: {
|
|
160
|
-
kind: "event",
|
|
161
|
-
eventName: LEARNING_EVENTS.COACH_TIP_ACTION_TAKEN
|
|
162
|
-
},
|
|
163
|
-
xpReward: 10
|
|
164
|
-
}
|
|
165
|
-
]
|
|
166
|
-
};
|
|
167
|
-
var ambientCoachTracks = [
|
|
168
|
-
ambientCoachTrack
|
|
169
|
-
];
|
|
170
|
-
|
|
171
191
|
// src/tracks/quests.ts
|
|
172
192
|
var questTrack = {
|
|
173
193
|
id: "learning_patterns_quest_7day",
|
|
@@ -209,25 +229,6 @@ var questTrack = {
|
|
|
209
229
|
]
|
|
210
230
|
};
|
|
211
231
|
var questTracks = [questTrack];
|
|
212
|
-
// src/learning-patterns.feature.ts
|
|
213
|
-
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
214
|
-
var LearningPatternsFeature = defineFeature({
|
|
215
|
-
meta: {
|
|
216
|
-
key: "learning-patterns",
|
|
217
|
-
version: "1.0.0",
|
|
218
|
-
title: "Learning Patterns",
|
|
219
|
-
description: "Learning archetypes (drills, ambient-coach, quests) via event-driven track specs",
|
|
220
|
-
domain: "learning-journey",
|
|
221
|
-
owners: ["@examples"],
|
|
222
|
-
tags: ["learning", "patterns", "archetypes", "tracks"],
|
|
223
|
-
stability: "experimental"
|
|
224
|
-
},
|
|
225
|
-
telemetry: [{ key: "learning-patterns.telemetry", version: "1.0.0" }],
|
|
226
|
-
docs: [
|
|
227
|
-
"docs.examples.learning-patterns.goal",
|
|
228
|
-
"docs.examples.learning-patterns.reference"
|
|
229
|
-
]
|
|
230
|
-
});
|
|
231
232
|
export {
|
|
232
233
|
questTracks,
|
|
233
234
|
questTrack,
|
|
@@ -11,6 +11,48 @@ var LEARNING_EVENTS = {
|
|
|
11
11
|
QUEST_STEP_COMPLETED: "quest.step.completed"
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
// src/tracks/ambient-coach.ts
|
|
15
|
+
var ambientCoachTrack = {
|
|
16
|
+
id: "learning_patterns_ambient_coach_basics",
|
|
17
|
+
name: "Ambient Coach Basics",
|
|
18
|
+
description: "Contextual tips triggered by behavior events.",
|
|
19
|
+
targetUserSegment: "learner",
|
|
20
|
+
targetRole: "individual",
|
|
21
|
+
totalXp: 30,
|
|
22
|
+
steps: [
|
|
23
|
+
{
|
|
24
|
+
id: "tip_shown",
|
|
25
|
+
title: "See a contextual tip",
|
|
26
|
+
order: 1,
|
|
27
|
+
completion: { kind: "event", eventName: LEARNING_EVENTS.COACH_TIP_SHOWN },
|
|
28
|
+
xpReward: 10
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "tip_acknowledged",
|
|
32
|
+
title: "Acknowledge a tip",
|
|
33
|
+
order: 2,
|
|
34
|
+
completion: {
|
|
35
|
+
kind: "event",
|
|
36
|
+
eventName: LEARNING_EVENTS.COACH_TIP_ACKNOWLEDGED
|
|
37
|
+
},
|
|
38
|
+
xpReward: 10
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "tip_action_taken",
|
|
42
|
+
title: "Take an action from a tip",
|
|
43
|
+
order: 3,
|
|
44
|
+
completion: {
|
|
45
|
+
kind: "event",
|
|
46
|
+
eventName: LEARNING_EVENTS.COACH_TIP_ACTION_TAKEN
|
|
47
|
+
},
|
|
48
|
+
xpReward: 10
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
var ambientCoachTracks = [
|
|
53
|
+
ambientCoachTrack
|
|
54
|
+
];
|
|
55
|
+
|
|
14
56
|
// src/tracks/drills.ts
|
|
15
57
|
var drillsTrack = {
|
|
16
58
|
id: "learning_patterns_drills_basics",
|
|
@@ -60,48 +102,6 @@ var drillsTrack = {
|
|
|
60
102
|
};
|
|
61
103
|
var drillTracks = [drillsTrack];
|
|
62
104
|
|
|
63
|
-
// src/tracks/ambient-coach.ts
|
|
64
|
-
var ambientCoachTrack = {
|
|
65
|
-
id: "learning_patterns_ambient_coach_basics",
|
|
66
|
-
name: "Ambient Coach Basics",
|
|
67
|
-
description: "Contextual tips triggered by behavior events.",
|
|
68
|
-
targetUserSegment: "learner",
|
|
69
|
-
targetRole: "individual",
|
|
70
|
-
totalXp: 30,
|
|
71
|
-
steps: [
|
|
72
|
-
{
|
|
73
|
-
id: "tip_shown",
|
|
74
|
-
title: "See a contextual tip",
|
|
75
|
-
order: 1,
|
|
76
|
-
completion: { kind: "event", eventName: LEARNING_EVENTS.COACH_TIP_SHOWN },
|
|
77
|
-
xpReward: 10
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: "tip_acknowledged",
|
|
81
|
-
title: "Acknowledge a tip",
|
|
82
|
-
order: 2,
|
|
83
|
-
completion: {
|
|
84
|
-
kind: "event",
|
|
85
|
-
eventName: LEARNING_EVENTS.COACH_TIP_ACKNOWLEDGED
|
|
86
|
-
},
|
|
87
|
-
xpReward: 10
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: "tip_action_taken",
|
|
91
|
-
title: "Take an action from a tip",
|
|
92
|
-
order: 3,
|
|
93
|
-
completion: {
|
|
94
|
-
kind: "event",
|
|
95
|
-
eventName: LEARNING_EVENTS.COACH_TIP_ACTION_TAKEN
|
|
96
|
-
},
|
|
97
|
-
xpReward: 10
|
|
98
|
-
}
|
|
99
|
-
]
|
|
100
|
-
};
|
|
101
|
-
var ambientCoachTracks = [
|
|
102
|
-
ambientCoachTrack
|
|
103
|
-
];
|
|
104
|
-
|
|
105
105
|
// src/tracks/quests.ts
|
|
106
106
|
var questTrack = {
|
|
107
107
|
id: "learning_patterns_quest_7day",
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Domain-agnostic learning archetypes implemented as Learning Journey tracks.
|
|
5
5
|
*/
|
|
6
6
|
export * from './events';
|
|
7
|
-
export * from './tracks';
|
|
8
|
-
export * from './learning-patterns.feature';
|
|
9
7
|
export { default as example } from './example';
|
|
8
|
+
export * from './learning-patterns.feature';
|
|
9
|
+
export * from './tracks';
|
|
10
10
|
import './docs';
|
package/dist/index.js
CHANGED
|
@@ -78,6 +78,68 @@ var example = defineExample({
|
|
|
78
78
|
});
|
|
79
79
|
var example_default = example;
|
|
80
80
|
|
|
81
|
+
// src/learning-patterns.feature.ts
|
|
82
|
+
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
83
|
+
var LearningPatternsFeature = defineFeature({
|
|
84
|
+
meta: {
|
|
85
|
+
key: "learning-patterns",
|
|
86
|
+
version: "1.0.0",
|
|
87
|
+
title: "Learning Patterns",
|
|
88
|
+
description: "Learning archetypes (drills, ambient-coach, quests) via event-driven track specs",
|
|
89
|
+
domain: "learning-journey",
|
|
90
|
+
owners: ["@examples"],
|
|
91
|
+
tags: ["learning", "patterns", "archetypes", "tracks"],
|
|
92
|
+
stability: "experimental"
|
|
93
|
+
},
|
|
94
|
+
telemetry: [{ key: "learning-patterns.telemetry", version: "1.0.0" }],
|
|
95
|
+
docs: [
|
|
96
|
+
"docs.examples.learning-patterns.goal",
|
|
97
|
+
"docs.examples.learning-patterns.reference"
|
|
98
|
+
]
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// src/tracks/ambient-coach.ts
|
|
102
|
+
var ambientCoachTrack = {
|
|
103
|
+
id: "learning_patterns_ambient_coach_basics",
|
|
104
|
+
name: "Ambient Coach Basics",
|
|
105
|
+
description: "Contextual tips triggered by behavior events.",
|
|
106
|
+
targetUserSegment: "learner",
|
|
107
|
+
targetRole: "individual",
|
|
108
|
+
totalXp: 30,
|
|
109
|
+
steps: [
|
|
110
|
+
{
|
|
111
|
+
id: "tip_shown",
|
|
112
|
+
title: "See a contextual tip",
|
|
113
|
+
order: 1,
|
|
114
|
+
completion: { kind: "event", eventName: LEARNING_EVENTS.COACH_TIP_SHOWN },
|
|
115
|
+
xpReward: 10
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "tip_acknowledged",
|
|
119
|
+
title: "Acknowledge a tip",
|
|
120
|
+
order: 2,
|
|
121
|
+
completion: {
|
|
122
|
+
kind: "event",
|
|
123
|
+
eventName: LEARNING_EVENTS.COACH_TIP_ACKNOWLEDGED
|
|
124
|
+
},
|
|
125
|
+
xpReward: 10
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: "tip_action_taken",
|
|
129
|
+
title: "Take an action from a tip",
|
|
130
|
+
order: 3,
|
|
131
|
+
completion: {
|
|
132
|
+
kind: "event",
|
|
133
|
+
eventName: LEARNING_EVENTS.COACH_TIP_ACTION_TAKEN
|
|
134
|
+
},
|
|
135
|
+
xpReward: 10
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
};
|
|
139
|
+
var ambientCoachTracks = [
|
|
140
|
+
ambientCoachTrack
|
|
141
|
+
];
|
|
142
|
+
|
|
81
143
|
// src/tracks/drills.ts
|
|
82
144
|
var drillsTrack = {
|
|
83
145
|
id: "learning_patterns_drills_basics",
|
|
@@ -127,48 +189,6 @@ var drillsTrack = {
|
|
|
127
189
|
};
|
|
128
190
|
var drillTracks = [drillsTrack];
|
|
129
191
|
|
|
130
|
-
// src/tracks/ambient-coach.ts
|
|
131
|
-
var ambientCoachTrack = {
|
|
132
|
-
id: "learning_patterns_ambient_coach_basics",
|
|
133
|
-
name: "Ambient Coach Basics",
|
|
134
|
-
description: "Contextual tips triggered by behavior events.",
|
|
135
|
-
targetUserSegment: "learner",
|
|
136
|
-
targetRole: "individual",
|
|
137
|
-
totalXp: 30,
|
|
138
|
-
steps: [
|
|
139
|
-
{
|
|
140
|
-
id: "tip_shown",
|
|
141
|
-
title: "See a contextual tip",
|
|
142
|
-
order: 1,
|
|
143
|
-
completion: { kind: "event", eventName: LEARNING_EVENTS.COACH_TIP_SHOWN },
|
|
144
|
-
xpReward: 10
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
id: "tip_acknowledged",
|
|
148
|
-
title: "Acknowledge a tip",
|
|
149
|
-
order: 2,
|
|
150
|
-
completion: {
|
|
151
|
-
kind: "event",
|
|
152
|
-
eventName: LEARNING_EVENTS.COACH_TIP_ACKNOWLEDGED
|
|
153
|
-
},
|
|
154
|
-
xpReward: 10
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
id: "tip_action_taken",
|
|
158
|
-
title: "Take an action from a tip",
|
|
159
|
-
order: 3,
|
|
160
|
-
completion: {
|
|
161
|
-
kind: "event",
|
|
162
|
-
eventName: LEARNING_EVENTS.COACH_TIP_ACTION_TAKEN
|
|
163
|
-
},
|
|
164
|
-
xpReward: 10
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
};
|
|
168
|
-
var ambientCoachTracks = [
|
|
169
|
-
ambientCoachTrack
|
|
170
|
-
];
|
|
171
|
-
|
|
172
192
|
// src/tracks/quests.ts
|
|
173
193
|
var questTrack = {
|
|
174
194
|
id: "learning_patterns_quest_7day",
|
|
@@ -210,25 +230,6 @@ var questTrack = {
|
|
|
210
230
|
]
|
|
211
231
|
};
|
|
212
232
|
var questTracks = [questTrack];
|
|
213
|
-
// src/learning-patterns.feature.ts
|
|
214
|
-
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
215
|
-
var LearningPatternsFeature = defineFeature({
|
|
216
|
-
meta: {
|
|
217
|
-
key: "learning-patterns",
|
|
218
|
-
version: "1.0.0",
|
|
219
|
-
title: "Learning Patterns",
|
|
220
|
-
description: "Learning archetypes (drills, ambient-coach, quests) via event-driven track specs",
|
|
221
|
-
domain: "learning-journey",
|
|
222
|
-
owners: ["@examples"],
|
|
223
|
-
tags: ["learning", "patterns", "archetypes", "tracks"],
|
|
224
|
-
stability: "experimental"
|
|
225
|
-
},
|
|
226
|
-
telemetry: [{ key: "learning-patterns.telemetry", version: "1.0.0" }],
|
|
227
|
-
docs: [
|
|
228
|
-
"docs.examples.learning-patterns.goal",
|
|
229
|
-
"docs.examples.learning-patterns.reference"
|
|
230
|
-
]
|
|
231
|
-
});
|
|
232
233
|
export {
|
|
233
234
|
questTracks,
|
|
234
235
|
questTrack,
|