@lssm/example.learning-journey-registry 0.0.0-canary-20251217060834 → 0.0.0-canary-20251217072406
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 +402 -57
- package/.turbo/turbo-build.log +401 -56
- package/CHANGELOG.md +14 -12
- package/dist/api.js +170 -1
- package/dist/docs/index.js +1 -1
- package/dist/docs/learning-journey-registry.docblock.js +38 -1
- package/dist/example.js +34 -1
- package/dist/examples/learning-journey-ambient-coach/src/track.js +41 -0
- package/dist/examples/learning-journey-crm-onboarding/dist/track.js +98 -0
- package/dist/examples/learning-journey-duo-drills/src/track.js +65 -0
- package/dist/examples/learning-journey-platform-tour/dist/track.js +105 -0
- package/dist/examples/learning-journey-quest-challenges/src/track.js +35 -0
- package/dist/examples/learning-journey-studio-onboarding/dist/track.js +90 -0
- package/dist/examples/learning-journey-ui-coaching/src/CoachingMiniApp.js +64 -0
- package/dist/examples/learning-journey-ui-coaching/src/components/EngagementMeter.js +107 -0
- package/dist/examples/learning-journey-ui-coaching/src/components/TipCard.js +75 -0
- package/dist/examples/learning-journey-ui-coaching/src/components/TipFeed.js +65 -0
- package/dist/examples/learning-journey-ui-coaching/src/components/index.js +3 -0
- package/dist/examples/learning-journey-ui-coaching/src/docs/index.js +1 -0
- package/dist/examples/learning-journey-ui-coaching/src/docs/learning-journey-ui-coaching.docblock.js +20 -0
- package/dist/examples/learning-journey-ui-coaching/src/index.js +11 -0
- package/dist/examples/learning-journey-ui-coaching/src/views/Overview.js +152 -0
- package/dist/examples/learning-journey-ui-coaching/src/views/Progress.js +117 -0
- package/dist/examples/learning-journey-ui-coaching/src/views/Steps.js +68 -0
- package/dist/examples/learning-journey-ui-coaching/src/views/Timeline.js +112 -0
- package/dist/examples/learning-journey-ui-coaching/src/views/index.js +4 -0
- package/dist/examples/learning-journey-ui-gamified/src/GamifiedMiniApp.js +64 -0
- package/dist/examples/learning-journey-ui-gamified/src/components/DayCalendar.js +32 -0
- package/dist/examples/learning-journey-ui-gamified/src/components/FlashCard.js +79 -0
- package/dist/examples/learning-journey-ui-gamified/src/components/MasteryRing.js +81 -0
- package/dist/examples/learning-journey-ui-gamified/src/components/index.js +3 -0
- package/dist/examples/learning-journey-ui-gamified/src/docs/index.js +1 -0
- package/dist/examples/learning-journey-ui-gamified/src/docs/learning-journey-ui-gamified.docblock.js +20 -0
- package/dist/examples/learning-journey-ui-gamified/src/index.js +11 -0
- package/dist/examples/learning-journey-ui-gamified/src/views/Overview.js +163 -0
- package/dist/examples/learning-journey-ui-gamified/src/views/Progress.js +144 -0
- package/dist/examples/learning-journey-ui-gamified/src/views/Steps.js +55 -0
- package/dist/examples/learning-journey-ui-gamified/src/views/Timeline.js +132 -0
- package/dist/examples/learning-journey-ui-gamified/src/views/index.js +4 -0
- package/dist/examples/learning-journey-ui-onboarding/src/OnboardingMiniApp.js +64 -0
- package/dist/examples/learning-journey-ui-onboarding/src/components/CodeSnippet.js +4 -0
- package/dist/examples/learning-journey-ui-onboarding/src/components/JourneyMap.js +48 -0
- package/dist/examples/learning-journey-ui-onboarding/src/components/StepChecklist.js +79 -0
- package/dist/examples/learning-journey-ui-onboarding/src/components/index.js +3 -0
- package/dist/examples/learning-journey-ui-onboarding/src/docs/index.js +1 -0
- package/dist/examples/learning-journey-ui-onboarding/src/docs/learning-journey-ui-onboarding.docblock.js +20 -0
- package/dist/examples/learning-journey-ui-onboarding/src/index.js +10 -0
- package/dist/examples/learning-journey-ui-onboarding/src/views/Overview.js +180 -0
- package/dist/examples/learning-journey-ui-onboarding/src/views/Progress.js +162 -0
- package/dist/examples/learning-journey-ui-onboarding/src/views/Steps.js +91 -0
- package/dist/examples/learning-journey-ui-onboarding/src/views/Timeline.js +97 -0
- package/dist/examples/learning-journey-ui-onboarding/src/views/index.js +4 -0
- package/dist/examples/learning-journey-ui-shared/src/components/BadgeDisplay.js +44 -0
- package/dist/examples/learning-journey-ui-shared/src/components/StreakCounter.js +45 -0
- package/dist/examples/learning-journey-ui-shared/src/components/ViewTabs.js +48 -0
- package/dist/examples/learning-journey-ui-shared/src/components/XpBar.js +46 -0
- package/dist/examples/learning-journey-ui-shared/src/components/index.js +4 -0
- package/dist/examples/learning-journey-ui-shared/src/docs/index.js +1 -0
- package/dist/examples/learning-journey-ui-shared/src/docs/learning-journey-ui-shared.docblock.js +20 -0
- package/dist/examples/learning-journey-ui-shared/src/hooks/index.js +1 -0
- package/dist/examples/learning-journey-ui-shared/src/hooks/useLearningProgress.js +73 -0
- package/dist/examples/learning-journey-ui-shared/src/index.js +8 -0
- package/dist/index.js +13 -1
- package/dist/learning-journey-registry.feature.js +66 -1
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -76
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -350
- package/dist/libs/contracts/dist/docs/index.js +29 -1
- package/dist/libs/contracts/dist/docs/presentations.js +71 -1
- package/dist/libs/contracts/dist/docs/registry.js +44 -1
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -383
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -68
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -140
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -86
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +21 -2
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -213
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +73 -5
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -1
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -262
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +25 -16
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -1
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +22 -2
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +40 -36
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -1
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -1
- package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +5 -0
- package/dist/libs/design-system/dist/components/atoms/Button.js +33 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +55 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +13 -0
- package/dist/libs/ui-kit-core/dist/utils.js +10 -0
- package/dist/libs/ui-kit-web/dist/ui/card.js +36 -0
- package/dist/libs/ui-kit-web/dist/ui/progress.js +23 -0
- package/dist/libs/ui-kit-web/dist/ui/utils.js +10 -0
- package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +10 -0
- package/dist/presentations/index.js +64 -1
- package/dist/progress-store.js +30 -1
- package/dist/tracks.d.ts +1 -1
- package/dist/tracks.js +47 -1
- package/dist/ui/LearningMiniApp.d.ts +0 -1
- package/dist/ui/LearningMiniApp.js +82 -1
- package/dist/ui/index.js +3 -1
- package/package.json +16 -14
- package/tsconfig.tsbuildinfo +1 -1
package/dist/api.js
CHANGED
|
@@ -1 +1,170 @@
|
|
|
1
|
-
import{learningJourneyTracks
|
|
1
|
+
import { learningJourneyTracks } from "./tracks.js";
|
|
2
|
+
import { getLearnerTracks, getTrackResolver, initProgress } from "./progress-store.js";
|
|
3
|
+
|
|
4
|
+
//#region src/api.ts
|
|
5
|
+
const getTrack = getTrackResolver(learningJourneyTracks);
|
|
6
|
+
const matchesFilter = (filter, payload) => {
|
|
7
|
+
if (!filter) return true;
|
|
8
|
+
if (!payload) return false;
|
|
9
|
+
return Object.entries(filter).every(([key, value]) => payload[key] === value);
|
|
10
|
+
};
|
|
11
|
+
const matchesBaseEvent = (condition, event) => {
|
|
12
|
+
if (condition.eventName !== event.name) return false;
|
|
13
|
+
if (condition.eventVersion !== void 0 && event.version !== void 0) {
|
|
14
|
+
if (condition.eventVersion !== event.version) return false;
|
|
15
|
+
}
|
|
16
|
+
if (condition.sourceModule && event.sourceModule && condition.sourceModule !== event.sourceModule) return false;
|
|
17
|
+
return matchesFilter(condition.payloadFilter, event.payload);
|
|
18
|
+
};
|
|
19
|
+
const matchesCondition = (condition, event, step, trackStartedAt) => {
|
|
20
|
+
if (condition.kind === "count") {
|
|
21
|
+
if (!matchesBaseEvent(condition, event)) return { matched: false };
|
|
22
|
+
const occurrences = (step.occurrences ?? 0) + 1;
|
|
23
|
+
return {
|
|
24
|
+
matched: (condition.withinHours === void 0 || Boolean(trackStartedAt && event.occurredAt && (event.occurredAt.getTime() - trackStartedAt.getTime()) / (1e3 * 60 * 60) <= condition.withinHours)) && occurrences >= condition.atLeast,
|
|
25
|
+
occurrences
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (condition.kind === "time_window") {
|
|
29
|
+
if (!matchesBaseEvent(condition, event)) return { matched: false };
|
|
30
|
+
if (condition.withinHoursOfStart !== void 0 && trackStartedAt && event.occurredAt) {
|
|
31
|
+
if ((event.occurredAt.getTime() - trackStartedAt.getTime()) / (1e3 * 60 * 60) > condition.withinHoursOfStart) return { matched: false };
|
|
32
|
+
}
|
|
33
|
+
return { matched: true };
|
|
34
|
+
}
|
|
35
|
+
if (condition.kind === "srs_mastery") {
|
|
36
|
+
if (event.name !== condition.eventName) return { matched: false };
|
|
37
|
+
const payload = event.payload;
|
|
38
|
+
if (!matchesFilter(condition.payloadFilter, payload)) return { matched: false };
|
|
39
|
+
const skillKey = condition.skillIdField ?? "skillId";
|
|
40
|
+
const masteryKey = condition.masteryField ?? "mastery";
|
|
41
|
+
const skillId = payload?.[skillKey];
|
|
42
|
+
const masteryValue = payload?.[masteryKey];
|
|
43
|
+
if (skillId === void 0 || masteryValue === void 0) return { matched: false };
|
|
44
|
+
if (typeof masteryValue !== "number") return { matched: false };
|
|
45
|
+
if (masteryValue < condition.minimumMastery) return { matched: false };
|
|
46
|
+
const masteryCount = (step.masteryCount ?? 0) + 1;
|
|
47
|
+
return {
|
|
48
|
+
matched: masteryCount >= (condition.requiredCount ?? 1),
|
|
49
|
+
masteryCount
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return { matched: matchesBaseEvent(condition, event) };
|
|
53
|
+
};
|
|
54
|
+
const getAvailability = (availability, startedAt) => {
|
|
55
|
+
if (!availability || !startedAt) return {};
|
|
56
|
+
const baseTime = startedAt.getTime();
|
|
57
|
+
let unlockTime = baseTime;
|
|
58
|
+
if (availability.unlockOnDay !== void 0) unlockTime = baseTime + (availability.unlockOnDay - 1) * 24 * 60 * 60 * 1e3;
|
|
59
|
+
if (availability.unlockAfterHours !== void 0) unlockTime = baseTime + availability.unlockAfterHours * 60 * 60 * 1e3;
|
|
60
|
+
const availableAt = new Date(unlockTime);
|
|
61
|
+
return {
|
|
62
|
+
availableAt,
|
|
63
|
+
dueAt: availability.dueWithinHours !== void 0 ? new Date(availableAt.getTime() + availability.dueWithinHours * 60 * 60 * 1e3) : void 0
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const computeProgressPercent = (steps) => {
|
|
67
|
+
const total = steps.length || 1;
|
|
68
|
+
const done = steps.filter((s) => s.status === "COMPLETED").length;
|
|
69
|
+
return Math.round(done / total * 100);
|
|
70
|
+
};
|
|
71
|
+
const applyTrackCompletionBonuses = (track, progress) => {
|
|
72
|
+
if (progress.isCompleted) return progress;
|
|
73
|
+
const completedAt = /* @__PURE__ */ new Date();
|
|
74
|
+
const startedAt = progress.startedAt ?? completedAt;
|
|
75
|
+
const hoursElapsed = (completedAt.getTime() - startedAt.getTime()) / (1e3 * 60 * 60);
|
|
76
|
+
let xpEarned = progress.xpEarned;
|
|
77
|
+
const { completionRewards, streakRule } = track;
|
|
78
|
+
if (completionRewards?.xpBonus) xpEarned += completionRewards.xpBonus;
|
|
79
|
+
if (streakRule?.hoursWindow !== void 0 && hoursElapsed <= streakRule.hoursWindow && streakRule.bonusXp) xpEarned += streakRule.bonusXp;
|
|
80
|
+
return {
|
|
81
|
+
...progress,
|
|
82
|
+
xpEarned,
|
|
83
|
+
isCompleted: true,
|
|
84
|
+
completedAt,
|
|
85
|
+
lastActivityAt: completedAt
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
const listTracks = (learnerId) => {
|
|
89
|
+
const progressMap = learnerId ? getLearnerTracks(learnerId) : void 0;
|
|
90
|
+
return {
|
|
91
|
+
tracks: learningJourneyTracks,
|
|
92
|
+
progress: learnerId && progressMap ? Array.from(progressMap.values()) : []
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
const getProgress = (trackId, learnerId) => {
|
|
96
|
+
const track = getTrack(trackId);
|
|
97
|
+
if (!track) return void 0;
|
|
98
|
+
const map = getLearnerTracks(learnerId);
|
|
99
|
+
const existing = map.get(trackId) ?? initProgress(learnerId, track);
|
|
100
|
+
map.set(trackId, existing);
|
|
101
|
+
return existing;
|
|
102
|
+
};
|
|
103
|
+
const recordEvent = (event) => {
|
|
104
|
+
const targets = event.trackId !== void 0 ? learningJourneyTracks.filter((t) => t.id === event.trackId) : learningJourneyTracks;
|
|
105
|
+
const updated = [];
|
|
106
|
+
const eventTime = event.occurredAt ?? /* @__PURE__ */ new Date();
|
|
107
|
+
for (const track of targets) {
|
|
108
|
+
const map = getLearnerTracks(event.learnerId);
|
|
109
|
+
const current = map.get(track.id) ?? initProgress(event.learnerId, track);
|
|
110
|
+
const startedAt = current.startedAt ?? eventTime;
|
|
111
|
+
let changed = current.startedAt === void 0;
|
|
112
|
+
const steps = current.steps.map((step) => {
|
|
113
|
+
if (step.status === "COMPLETED") return step;
|
|
114
|
+
const spec = track.steps.find((s) => s.id === step.id);
|
|
115
|
+
if (!spec) return step;
|
|
116
|
+
const { availableAt, dueAt } = getAvailability(spec.availability, startedAt);
|
|
117
|
+
if (availableAt && eventTime < availableAt) return {
|
|
118
|
+
...step,
|
|
119
|
+
availableAt,
|
|
120
|
+
dueAt
|
|
121
|
+
};
|
|
122
|
+
if (dueAt && eventTime > dueAt) return {
|
|
123
|
+
...step,
|
|
124
|
+
availableAt,
|
|
125
|
+
dueAt
|
|
126
|
+
};
|
|
127
|
+
const result = matchesCondition(spec.completion, event, step, startedAt);
|
|
128
|
+
if (result.matched) {
|
|
129
|
+
changed = true;
|
|
130
|
+
return {
|
|
131
|
+
...step,
|
|
132
|
+
status: "COMPLETED",
|
|
133
|
+
xpEarned: spec.xpReward ?? 0,
|
|
134
|
+
completedAt: eventTime,
|
|
135
|
+
triggeringEvent: event.name,
|
|
136
|
+
eventPayload: event.payload,
|
|
137
|
+
occurrences: result.occurrences ?? step.occurrences,
|
|
138
|
+
masteryCount: result.masteryCount ?? step.masteryCount,
|
|
139
|
+
availableAt,
|
|
140
|
+
dueAt
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
if (result.occurrences !== void 0 || result.masteryCount !== void 0) changed = true;
|
|
144
|
+
return {
|
|
145
|
+
...step,
|
|
146
|
+
occurrences: result.occurrences ?? step.occurrences,
|
|
147
|
+
masteryCount: result.masteryCount ?? step.masteryCount,
|
|
148
|
+
availableAt,
|
|
149
|
+
dueAt
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
if (!changed) continue;
|
|
153
|
+
const xpEarned = steps.reduce((sum, s) => sum + s.xpEarned, 0) + (track.totalXp ?? 0);
|
|
154
|
+
let progress = {
|
|
155
|
+
...current,
|
|
156
|
+
steps,
|
|
157
|
+
xpEarned,
|
|
158
|
+
startedAt,
|
|
159
|
+
lastActivityAt: eventTime,
|
|
160
|
+
progress: computeProgressPercent(steps)
|
|
161
|
+
};
|
|
162
|
+
if (steps.every((s) => s.status === "COMPLETED")) progress = applyTrackCompletionBonuses(track, progress);
|
|
163
|
+
map.set(track.id, progress);
|
|
164
|
+
updated.push(progress);
|
|
165
|
+
}
|
|
166
|
+
return updated;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
//#endregion
|
|
170
|
+
export { getProgress, listTracks, recordEvent };
|
package/dist/docs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./learning-journey-registry.docblock.js";
|
|
1
|
+
import "./learning-journey-registry.docblock.js";
|
|
@@ -1 +1,38 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { registerDocBlocks } from "../libs/contracts/dist/docs/registry.js";
|
|
2
|
+
import "../libs/contracts/dist/docs/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/docs/learning-journey-registry.docblock.ts
|
|
5
|
+
registerDocBlocks([{
|
|
6
|
+
id: "docs.learning-journey.registry",
|
|
7
|
+
title: "Learning Journey — Example Track Registry",
|
|
8
|
+
summary: "Aggregates learning journey example tracks (Studio onboarding, Platform tour, CRM first win, Drills, Ambient Coach, Quest challenges).",
|
|
9
|
+
kind: "usage",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/learning-journey/registry",
|
|
12
|
+
tags: [
|
|
13
|
+
"learning",
|
|
14
|
+
"registry",
|
|
15
|
+
"onboarding"
|
|
16
|
+
],
|
|
17
|
+
body: `## Tracks
|
|
18
|
+
- \`studio_getting_started\` (Studio onboarding)
|
|
19
|
+
- \`platform_primitives_tour\` (Platform primitives)
|
|
20
|
+
- \`crm_first_win\` (CRM pipeline onboarding)
|
|
21
|
+
- \`drills_language_basics\` (Drills & SRS)
|
|
22
|
+
- \`money_ambient_coach\`, \`coliving_ambient_coach\` (Ambient tips)
|
|
23
|
+
- \`money_reset_7day\` (Quest/challenge)
|
|
24
|
+
|
|
25
|
+
## Exports
|
|
26
|
+
- \`learningJourneyTracks\` — raw specs
|
|
27
|
+
- \`onboardingTrackCatalog\` — DTOs aligned with onboarding API
|
|
28
|
+
- \`mapTrackSpecToDto\` — helper to map individual tracks
|
|
29
|
+
|
|
30
|
+
## Wiring
|
|
31
|
+
- Use with onboarding API contracts:
|
|
32
|
+
- \`learning.onboarding.listTracks\`
|
|
33
|
+
- \`learning.onboarding.getProgress\`
|
|
34
|
+
- \`learning.onboarding.recordEvent\`
|
|
35
|
+
- Intended for registry/adapters in Studio UI or services that surface tracks.`
|
|
36
|
+
}]);
|
|
37
|
+
|
|
38
|
+
//#endregion
|
package/dist/example.js
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/example.ts
|
|
2
|
+
const example = {
|
|
3
|
+
id: "learning-journey-registry",
|
|
4
|
+
title: "Learning Journey Registry",
|
|
5
|
+
summary: "Registry of learning journey tracks + presentations + UI mini-app bindings.",
|
|
6
|
+
tags: [
|
|
7
|
+
"learning",
|
|
8
|
+
"journey",
|
|
9
|
+
"registry"
|
|
10
|
+
],
|
|
11
|
+
kind: "library",
|
|
12
|
+
visibility: "public",
|
|
13
|
+
docs: { rootDocId: "docs.examples.learning-journey-registry" },
|
|
14
|
+
entrypoints: {
|
|
15
|
+
packageName: "@lssm/example.learning-journey-registry",
|
|
16
|
+
docs: "./docs"
|
|
17
|
+
},
|
|
18
|
+
surfaces: {
|
|
19
|
+
templates: true,
|
|
20
|
+
sandbox: {
|
|
21
|
+
enabled: true,
|
|
22
|
+
modes: ["markdown", "specs"]
|
|
23
|
+
},
|
|
24
|
+
studio: {
|
|
25
|
+
enabled: true,
|
|
26
|
+
installable: true
|
|
27
|
+
},
|
|
28
|
+
mcp: { enabled: true }
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var example_default = example;
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { example_default as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region ../learning-journey-ambient-coach/src/track.ts
|
|
2
|
+
const 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
|
+
const 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
|
+
const 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
|
+
const ambientCoachTracks = [moneyAmbientCoachTrack, colivingAmbientCoachTrack];
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { ambientCoachTracks };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
//#region ../learning-journey-crm-onboarding/dist/track.js
|
|
2
|
+
const crmFirstWinTrack = {
|
|
3
|
+
id: "crm_first_win",
|
|
4
|
+
productId: "crm-pipeline",
|
|
5
|
+
name: "CRM First Win",
|
|
6
|
+
description: "Guide a new CRM user from empty pipeline to first closed-won deal.",
|
|
7
|
+
targetUserSegment: "crm_adopter",
|
|
8
|
+
targetRole: "sales",
|
|
9
|
+
totalXp: 135,
|
|
10
|
+
streakRule: {
|
|
11
|
+
hoursWindow: 72,
|
|
12
|
+
bonusXp: 25
|
|
13
|
+
},
|
|
14
|
+
completionRewards: {
|
|
15
|
+
xpBonus: 25,
|
|
16
|
+
badgeKey: "crm_first_win"
|
|
17
|
+
},
|
|
18
|
+
steps: [
|
|
19
|
+
{
|
|
20
|
+
id: "create_pipeline",
|
|
21
|
+
title: "Create pipeline & stages",
|
|
22
|
+
description: "Create a pipeline with baseline stages.",
|
|
23
|
+
order: 1,
|
|
24
|
+
completion: {
|
|
25
|
+
eventName: "pipeline.created",
|
|
26
|
+
sourceModule: "@lssm/example.crm-pipeline"
|
|
27
|
+
},
|
|
28
|
+
xpReward: 15,
|
|
29
|
+
metadata: { surface: "pipeline" }
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "create_contact_and_company",
|
|
33
|
+
title: "Create contact and company",
|
|
34
|
+
description: "Add your first contact and associated company.",
|
|
35
|
+
order: 2,
|
|
36
|
+
completion: {
|
|
37
|
+
eventName: "contact.created",
|
|
38
|
+
sourceModule: "@lssm/example.crm-pipeline"
|
|
39
|
+
},
|
|
40
|
+
xpReward: 20,
|
|
41
|
+
metadata: { surface: "contacts" }
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "create_first_deal",
|
|
45
|
+
title: "Log first deal",
|
|
46
|
+
description: "Create your first deal in the pipeline.",
|
|
47
|
+
order: 3,
|
|
48
|
+
completion: {
|
|
49
|
+
eventName: "deal.created",
|
|
50
|
+
sourceModule: "@lssm/example.crm-pipeline"
|
|
51
|
+
},
|
|
52
|
+
xpReward: 20,
|
|
53
|
+
metadata: { surface: "deals" }
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "move_deal_in_pipeline",
|
|
57
|
+
title: "Move a deal across stages",
|
|
58
|
+
description: "Move a deal across at least three stages.",
|
|
59
|
+
order: 4,
|
|
60
|
+
completion: {
|
|
61
|
+
eventName: "deal.moved",
|
|
62
|
+
sourceModule: "@lssm/example.crm-pipeline"
|
|
63
|
+
},
|
|
64
|
+
xpReward: 20,
|
|
65
|
+
metadata: { surface: "deals" }
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "close_deal_won",
|
|
69
|
+
title: "Close a deal as won",
|
|
70
|
+
description: "Close a deal as won to hit first revenue.",
|
|
71
|
+
order: 5,
|
|
72
|
+
completion: {
|
|
73
|
+
eventName: "deal.won",
|
|
74
|
+
sourceModule: "@lssm/example.crm-pipeline"
|
|
75
|
+
},
|
|
76
|
+
xpReward: 30,
|
|
77
|
+
metadata: { surface: "deals" }
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "setup_follow_up",
|
|
81
|
+
title: "Create follow-up task",
|
|
82
|
+
description: "Create a follow-up task and notification for a contact or deal.",
|
|
83
|
+
order: 6,
|
|
84
|
+
completion: {
|
|
85
|
+
eventName: "task.completed",
|
|
86
|
+
sourceModule: "@lssm/example.crm-pipeline",
|
|
87
|
+
payloadFilter: { type: "follow_up" }
|
|
88
|
+
},
|
|
89
|
+
xpReward: 30,
|
|
90
|
+
metadata: { surface: "tasks" }
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
metadata: { surfacedIn: ["crm/dashboard", "crm/pipeline"] }
|
|
94
|
+
};
|
|
95
|
+
const crmLearningTracks = [crmFirstWinTrack];
|
|
96
|
+
|
|
97
|
+
//#endregion
|
|
98
|
+
export { crmLearningTracks };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//#region ../learning-journey-duo-drills/src/track.ts
|
|
2
|
+
const drillsLanguageBasicsTrack = {
|
|
3
|
+
id: "drills_language_basics",
|
|
4
|
+
name: "Language Basics Drills",
|
|
5
|
+
description: "Short SRS-driven drills to master a first skill, modeled after Duolingo-style sessions.",
|
|
6
|
+
targetUserSegment: "learner",
|
|
7
|
+
targetRole: "individual",
|
|
8
|
+
totalXp: 50,
|
|
9
|
+
completionRewards: { xpBonus: 25 },
|
|
10
|
+
steps: [
|
|
11
|
+
{
|
|
12
|
+
id: "complete_first_session",
|
|
13
|
+
title: "Complete first drill session",
|
|
14
|
+
description: "Finish a drill session to get started.",
|
|
15
|
+
order: 1,
|
|
16
|
+
completion: {
|
|
17
|
+
kind: "event",
|
|
18
|
+
eventName: "drill.session.completed"
|
|
19
|
+
},
|
|
20
|
+
xpReward: 20,
|
|
21
|
+
metadata: { surface: "drills" }
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "reach_accuracy_threshold",
|
|
25
|
+
title: "Hit high accuracy in sessions",
|
|
26
|
+
description: "Achieve three high-accuracy sessions to build confidence.",
|
|
27
|
+
order: 2,
|
|
28
|
+
completion: {
|
|
29
|
+
kind: "count",
|
|
30
|
+
eventName: "drill.session.completed",
|
|
31
|
+
atLeast: 3,
|
|
32
|
+
payloadFilter: { accuracyBucket: "high" }
|
|
33
|
+
},
|
|
34
|
+
xpReward: 30,
|
|
35
|
+
metadata: {
|
|
36
|
+
metric: "accuracy",
|
|
37
|
+
target: ">=85%"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "unlock_new_skill",
|
|
42
|
+
title: "Master core cards in first skill",
|
|
43
|
+
description: "Reach mastery on at least five cards in the first skill to unlock the next one.",
|
|
44
|
+
order: 3,
|
|
45
|
+
completion: {
|
|
46
|
+
kind: "srs_mastery",
|
|
47
|
+
eventName: "drill.card.mastered",
|
|
48
|
+
minimumMastery: .8,
|
|
49
|
+
requiredCount: 5,
|
|
50
|
+
skillIdField: "skillId",
|
|
51
|
+
masteryField: "mastery",
|
|
52
|
+
payloadFilter: { skillId: "language_basics" }
|
|
53
|
+
},
|
|
54
|
+
xpReward: 40,
|
|
55
|
+
metadata: {
|
|
56
|
+
surface: "srs",
|
|
57
|
+
skill: "language_basics"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
};
|
|
62
|
+
const drillTracks = [drillsLanguageBasicsTrack];
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { drillTracks };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
//#region ../learning-journey-platform-tour/dist/track.js
|
|
2
|
+
const platformPrimitivesTourTrack = {
|
|
3
|
+
id: "platform_primitives_tour",
|
|
4
|
+
productId: "contractspec-platform",
|
|
5
|
+
name: "Platform Primitives Tour",
|
|
6
|
+
description: "Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",
|
|
7
|
+
targetUserSegment: "platform_developer",
|
|
8
|
+
targetRole: "developer",
|
|
9
|
+
totalXp: 140,
|
|
10
|
+
completionRewards: {
|
|
11
|
+
xpBonus: 20,
|
|
12
|
+
badgeKey: "platform_primitives"
|
|
13
|
+
},
|
|
14
|
+
steps: [
|
|
15
|
+
{
|
|
16
|
+
id: "identity_rbac",
|
|
17
|
+
title: "Create org and member",
|
|
18
|
+
description: "Create an org and add at least one member.",
|
|
19
|
+
order: 1,
|
|
20
|
+
completion: {
|
|
21
|
+
eventName: "org.member.added",
|
|
22
|
+
sourceModule: "@lssm/lib.identity-rbac"
|
|
23
|
+
},
|
|
24
|
+
xpReward: 20,
|
|
25
|
+
metadata: { surface: "identity" }
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "event_bus_audit",
|
|
29
|
+
title: "Emit an auditable event",
|
|
30
|
+
description: "Emit an event that lands in the audit log.",
|
|
31
|
+
order: 2,
|
|
32
|
+
completion: {
|
|
33
|
+
eventName: "audit_log.created",
|
|
34
|
+
sourceModule: "@lssm/module.audit-trail"
|
|
35
|
+
},
|
|
36
|
+
xpReward: 20,
|
|
37
|
+
metadata: { surface: "bus+audit" }
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "notifications",
|
|
41
|
+
title: "Send a notification",
|
|
42
|
+
description: "Send yourself a notification and verify delivery.",
|
|
43
|
+
order: 3,
|
|
44
|
+
completion: {
|
|
45
|
+
eventName: "notification.sent",
|
|
46
|
+
sourceModule: "@lssm/module.notifications"
|
|
47
|
+
},
|
|
48
|
+
xpReward: 20,
|
|
49
|
+
metadata: { surface: "notifications" }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "jobs_scheduler",
|
|
53
|
+
title: "Schedule and run a job",
|
|
54
|
+
description: "Schedule a background job and let it run once.",
|
|
55
|
+
order: 4,
|
|
56
|
+
completion: {
|
|
57
|
+
eventName: "job.completed",
|
|
58
|
+
sourceModule: "@lssm/lib.jobs"
|
|
59
|
+
},
|
|
60
|
+
xpReward: 20,
|
|
61
|
+
metadata: { surface: "jobs" }
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "feature_flags",
|
|
65
|
+
title: "Create and toggle a feature flag",
|
|
66
|
+
description: "Create a feature flag and toggle it at least once.",
|
|
67
|
+
order: 5,
|
|
68
|
+
completion: {
|
|
69
|
+
eventName: "flag.toggled",
|
|
70
|
+
sourceModule: "@lssm/lib.feature-flags"
|
|
71
|
+
},
|
|
72
|
+
xpReward: 20,
|
|
73
|
+
metadata: { surface: "feature-flags" }
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "files_attachments",
|
|
77
|
+
title: "Attach a file",
|
|
78
|
+
description: "Upload and attach a file to any entity.",
|
|
79
|
+
order: 6,
|
|
80
|
+
completion: {
|
|
81
|
+
eventName: "attachment.attached",
|
|
82
|
+
sourceModule: "@lssm/lib.files"
|
|
83
|
+
},
|
|
84
|
+
xpReward: 20,
|
|
85
|
+
metadata: { surface: "files" }
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "usage_metering",
|
|
89
|
+
title: "Record usage",
|
|
90
|
+
description: "Emit a usage metric (regeneration, agent run, or similar).",
|
|
91
|
+
order: 7,
|
|
92
|
+
completion: {
|
|
93
|
+
eventName: "usage.recorded",
|
|
94
|
+
sourceModule: "@lssm/lib.metering"
|
|
95
|
+
},
|
|
96
|
+
xpReward: 20,
|
|
97
|
+
metadata: { surface: "metering" }
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
metadata: { surfacedIn: ["studio/learning", "platform/dev-center"] }
|
|
101
|
+
};
|
|
102
|
+
const platformLearningTracks = [platformPrimitivesTourTrack];
|
|
103
|
+
|
|
104
|
+
//#endregion
|
|
105
|
+
export { platformLearningTracks };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region ../learning-journey-quest-challenges/src/track.ts
|
|
2
|
+
const dayStep = (id, day, eventName, description) => ({
|
|
3
|
+
id,
|
|
4
|
+
title: `Day ${day}`,
|
|
5
|
+
description,
|
|
6
|
+
availability: { unlockOnDay: day },
|
|
7
|
+
completion: {
|
|
8
|
+
kind: "time_window",
|
|
9
|
+
eventName,
|
|
10
|
+
withinHoursOfStart: (day + 1) * 24
|
|
11
|
+
},
|
|
12
|
+
xpReward: 15,
|
|
13
|
+
metadata: { day }
|
|
14
|
+
});
|
|
15
|
+
const moneyResetQuestTrack = {
|
|
16
|
+
id: "money_reset_7day",
|
|
17
|
+
name: "7-day Money Reset",
|
|
18
|
+
description: "Time-bound quest to reset personal finances over a focused week.",
|
|
19
|
+
targetUserSegment: "money_user",
|
|
20
|
+
totalXp: 105,
|
|
21
|
+
completionRewards: { xpBonus: 30 },
|
|
22
|
+
steps: [
|
|
23
|
+
dayStep("day1_map_accounts", 1, "accounts.mapped", "Map bank and card accounts."),
|
|
24
|
+
dayStep("day2_categorize_transactions", 2, "transactions.categorized", "Categorize recent transactions."),
|
|
25
|
+
dayStep("day3_define_goals", 3, "goals.created", "Define at least one savings goal."),
|
|
26
|
+
dayStep("day4_setup_recurring_savings", 4, "recurring_rule.created", "Set a recurring savings rule."),
|
|
27
|
+
dayStep("day5_review_subscriptions", 5, "subscription.flagged_or_cancelled", "Review subscriptions and flag or cancel wasteful ones."),
|
|
28
|
+
dayStep("day6_plan_emergency", 6, "emergency_plan.completed", "Draft an emergency plan and target buffer."),
|
|
29
|
+
dayStep("day7_review_commit", 7, "quest.review.completed", "Review week outcomes and commit to the next month.")
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
const questTracks = [moneyResetQuestTrack];
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { questTracks };
|