@contractspec/example.learning-patterns 0.0.0-canary-20260113162409
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$colon$bundle.log +39 -0
- package/.turbo/turbo-build.log +40 -0
- package/CHANGELOG.md +322 -0
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/docs/learning-patterns.docblock.d.ts +1 -0
- package/dist/docs/learning-patterns.docblock.js +31 -0
- package/dist/docs/learning-patterns.docblock.js.map +1 -0
- package/dist/events.d.ts +16 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +16 -0
- package/dist/events.js.map +1 -0
- package/dist/example.d.ts +7 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +42 -0
- package/dist/example.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +9 -0
- package/dist/tracks/ambient-coach.d.ts +8 -0
- package/dist/tracks/ambient-coach.d.ts.map +1 -0
- package/dist/tracks/ambient-coach.js +48 -0
- package/dist/tracks/ambient-coach.js.map +1 -0
- package/dist/tracks/drills.d.ts +8 -0
- package/dist/tracks/drills.d.ts.map +1 -0
- package/dist/tracks/drills.js +54 -0
- package/dist/tracks/drills.js.map +1 -0
- package/dist/tracks/index.d.ts +4 -0
- package/dist/tracks/index.js +5 -0
- package/dist/tracks/quests.d.ts +8 -0
- package/dist/tracks/quests.d.ts.map +1 -0
- package/dist/tracks/quests.js +56 -0
- package/dist/tracks/quests.js.map +1 -0
- package/example.ts +1 -0
- package/package.json +65 -0
- package/src/docs/index.ts +1 -0
- package/src/docs/learning-patterns.docblock.ts +30 -0
- package/src/events.ts +16 -0
- package/src/example.ts +31 -0
- package/src/index.ts +10 -0
- package/src/learning-patterns.test.ts +256 -0
- package/src/tracks/ambient-coach.ts +44 -0
- package/src/tracks/drills.ts +51 -0
- package/src/tracks/index.ts +3 -0
- package/src/tracks/quests.ts +44 -0
- package/tsconfig.json +19 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsdown.config.js +7 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
|
|
2
|
+
import { LEARNING_EVENTS } from '../events';
|
|
3
|
+
|
|
4
|
+
export const ambientCoachTrack: LearningJourneyTrackSpec = {
|
|
5
|
+
id: 'learning_patterns_ambient_coach_basics',
|
|
6
|
+
name: 'Ambient Coach Basics',
|
|
7
|
+
description: 'Contextual tips triggered by behavior events.',
|
|
8
|
+
targetUserSegment: 'learner',
|
|
9
|
+
targetRole: 'individual',
|
|
10
|
+
totalXp: 30,
|
|
11
|
+
steps: [
|
|
12
|
+
{
|
|
13
|
+
id: 'tip_shown',
|
|
14
|
+
title: 'See a contextual tip',
|
|
15
|
+
order: 1,
|
|
16
|
+
completion: { kind: 'event', eventName: LEARNING_EVENTS.COACH_TIP_SHOWN },
|
|
17
|
+
xpReward: 10,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'tip_acknowledged',
|
|
21
|
+
title: 'Acknowledge a tip',
|
|
22
|
+
order: 2,
|
|
23
|
+
completion: {
|
|
24
|
+
kind: 'event',
|
|
25
|
+
eventName: LEARNING_EVENTS.COACH_TIP_ACKNOWLEDGED,
|
|
26
|
+
},
|
|
27
|
+
xpReward: 10,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'tip_action_taken',
|
|
31
|
+
title: 'Take an action from a tip',
|
|
32
|
+
order: 3,
|
|
33
|
+
completion: {
|
|
34
|
+
kind: 'event',
|
|
35
|
+
eventName: LEARNING_EVENTS.COACH_TIP_ACTION_TAKEN,
|
|
36
|
+
},
|
|
37
|
+
xpReward: 10,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const ambientCoachTracks: LearningJourneyTrackSpec[] = [
|
|
43
|
+
ambientCoachTrack,
|
|
44
|
+
];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
|
|
2
|
+
import { LEARNING_EVENTS } from '../events';
|
|
3
|
+
|
|
4
|
+
export const drillsTrack: LearningJourneyTrackSpec = {
|
|
5
|
+
id: 'learning_patterns_drills_basics',
|
|
6
|
+
name: 'Drills Basics',
|
|
7
|
+
description: 'Short drill sessions with an SRS-style mastery step.',
|
|
8
|
+
targetUserSegment: 'learner',
|
|
9
|
+
targetRole: 'individual',
|
|
10
|
+
totalXp: 50,
|
|
11
|
+
steps: [
|
|
12
|
+
{
|
|
13
|
+
id: 'complete_first_session',
|
|
14
|
+
title: 'Complete your first session',
|
|
15
|
+
order: 1,
|
|
16
|
+
completion: {
|
|
17
|
+
kind: 'event',
|
|
18
|
+
eventName: LEARNING_EVENTS.DRILL_SESSION_COMPLETED,
|
|
19
|
+
},
|
|
20
|
+
xpReward: 10,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'hit_accuracy_threshold',
|
|
24
|
+
title: 'Hit high accuracy 3 times',
|
|
25
|
+
order: 2,
|
|
26
|
+
completion: {
|
|
27
|
+
kind: 'count',
|
|
28
|
+
eventName: LEARNING_EVENTS.DRILL_SESSION_COMPLETED,
|
|
29
|
+
atLeast: 3,
|
|
30
|
+
payloadFilter: { accuracyBucket: 'high' },
|
|
31
|
+
},
|
|
32
|
+
xpReward: 20,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'master_cards',
|
|
36
|
+
title: 'Master 5 cards',
|
|
37
|
+
order: 3,
|
|
38
|
+
completion: {
|
|
39
|
+
kind: 'srs_mastery',
|
|
40
|
+
eventName: LEARNING_EVENTS.DRILL_CARD_MASTERED,
|
|
41
|
+
minimumMastery: 0.8,
|
|
42
|
+
requiredCount: 5,
|
|
43
|
+
skillIdField: 'skillId',
|
|
44
|
+
masteryField: 'mastery',
|
|
45
|
+
},
|
|
46
|
+
xpReward: 20,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const drillTracks: LearningJourneyTrackSpec[] = [drillsTrack];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
|
|
2
|
+
import { LEARNING_EVENTS } from '../events';
|
|
3
|
+
|
|
4
|
+
export const questTrack: LearningJourneyTrackSpec = {
|
|
5
|
+
id: 'learning_patterns_quest_7day',
|
|
6
|
+
name: 'Quest (7-day)',
|
|
7
|
+
description: 'Time-bounded quest with day unlocks.',
|
|
8
|
+
targetUserSegment: 'learner',
|
|
9
|
+
targetRole: 'individual',
|
|
10
|
+
totalXp: 70,
|
|
11
|
+
steps: [
|
|
12
|
+
{
|
|
13
|
+
id: 'day1_start',
|
|
14
|
+
title: 'Start the quest',
|
|
15
|
+
order: 1,
|
|
16
|
+
completion: { kind: 'event', eventName: LEARNING_EVENTS.QUEST_STARTED },
|
|
17
|
+
xpReward: 10,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'day1_complete',
|
|
21
|
+
title: 'Complete day 1 step',
|
|
22
|
+
order: 2,
|
|
23
|
+
completion: {
|
|
24
|
+
kind: 'event',
|
|
25
|
+
eventName: LEARNING_EVENTS.QUEST_STEP_COMPLETED,
|
|
26
|
+
},
|
|
27
|
+
availability: { unlockOnDay: 1, dueWithinHours: 48 },
|
|
28
|
+
xpReward: 10,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'day2_complete',
|
|
32
|
+
title: 'Complete day 2 step',
|
|
33
|
+
order: 3,
|
|
34
|
+
completion: {
|
|
35
|
+
kind: 'event',
|
|
36
|
+
eventName: LEARNING_EVENTS.QUEST_STEP_COMPLETED,
|
|
37
|
+
},
|
|
38
|
+
availability: { unlockOnDay: 2, dueWithinHours: 48 },
|
|
39
|
+
xpReward: 10,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const questTracks: LearningJourneyTrackSpec[] = [questTrack];
|
package/tsconfig.json
ADDED