@contractspec/example.learning-journey-quest-challenges 1.56.1 → 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.
package/dist/index.js CHANGED
@@ -1,5 +1,101 @@
1
- import example_default from "./example.js";
2
- import { moneyResetQuestTrack, questTracks } from "./track.js";
3
- import "./docs/index.js";
1
+ // @bun
2
+ // src/docs/quest-challenges.docblock.ts
3
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
4
+ var questDocBlocks = [
5
+ {
6
+ id: "docs.learning-journey.quest-challenges",
7
+ title: "Learning Journey \u2014 Quest Challenges",
8
+ summary: "Time-bound challenge pattern (7-day money reset) with day unlocks and event-driven completion.",
9
+ kind: "reference",
10
+ visibility: "public",
11
+ route: "/docs/learning-journey/quest-challenges",
12
+ tags: ["learning", "quest", "challenge"],
13
+ body: `## Track
14
+ - **Key**: \`money_reset_7day\`
15
+ - **Duration**: 7 days, steps unlock day by day
4
16
 
5
- export { example_default as example, moneyResetQuestTrack, questTracks };
17
+ ## Steps & Events
18
+ - Day 1 \`day1_map_accounts\` \u2192 event \`accounts.mapped\`
19
+ - Day 2 \`day2_categorize_transactions\` \u2192 event \`transactions.categorized\`
20
+ - Day 3 \`day3_define_goals\` \u2192 event \`goals.created\`
21
+ - Day 4 \`day4_setup_recurring_savings\` \u2192 event \`recurring_rule.created\`
22
+ - Day 5 \`day5_review_subscriptions\` \u2192 event \`subscription.flagged_or_cancelled\`
23
+ - Day 6 \`day6_plan_emergency\` \u2192 event \`emergency_plan.completed\`
24
+ - Day 7 \`day7_review_commit\` \u2192 event \`quest.review.completed\`
25
+
26
+ XP: 15 per day, completion bonus 30 if finished within duration. Optional recap via SRS after completion.
27
+
28
+ ## Usage
29
+ - Exported via \`@contractspec/example.learning-journey-quest-challenges/track\`.
30
+ - Step availability uses \`availability.unlockOnDay\` to gate days.
31
+ - Registry progression handles event matching and XP application.`
32
+ }
33
+ ];
34
+ registerDocBlocks(questDocBlocks);
35
+ // src/example.ts
36
+ import { defineExample } from "@contractspec/lib.contracts";
37
+ var example = defineExample({
38
+ meta: {
39
+ key: "learning-journey-quest-challenges",
40
+ version: "1.0.0",
41
+ title: "Learning Journey \u2014 Quest Challenges",
42
+ description: "Quest/challenge pattern: multi-step goals with progress events, rewards, and streak hooks.",
43
+ kind: "template",
44
+ visibility: "public",
45
+ stability: "experimental",
46
+ owners: ["@platform.core"],
47
+ tags: ["learning", "quests", "challenges"]
48
+ },
49
+ docs: {
50
+ rootDocId: "docs.learning-journey.quest-challenges"
51
+ },
52
+ entrypoints: {
53
+ packageName: "@contractspec/example.learning-journey-quest-challenges",
54
+ docs: "./docs"
55
+ },
56
+ surfaces: {
57
+ templates: true,
58
+ sandbox: { enabled: true, modes: ["playground", "markdown"] },
59
+ studio: { enabled: true, installable: true },
60
+ mcp: { enabled: true }
61
+ }
62
+ });
63
+ var example_default = example;
64
+
65
+ // src/track.ts
66
+ var dayStep = (id, day, eventName, description) => ({
67
+ id,
68
+ title: `Day ${day}`,
69
+ description,
70
+ availability: { unlockOnDay: day },
71
+ completion: {
72
+ kind: "time_window",
73
+ eventName,
74
+ withinHoursOfStart: (day + 1) * 24
75
+ },
76
+ xpReward: 15,
77
+ metadata: { day }
78
+ });
79
+ var moneyResetQuestTrack = {
80
+ id: "money_reset_7day",
81
+ name: "7-day Money Reset",
82
+ description: "Time-bound quest to reset personal finances over a focused week.",
83
+ targetUserSegment: "money_user",
84
+ totalXp: 105,
85
+ completionRewards: { xpBonus: 30 },
86
+ steps: [
87
+ dayStep("day1_map_accounts", 1, "accounts.mapped", "Map bank and card accounts."),
88
+ dayStep("day2_categorize_transactions", 2, "transactions.categorized", "Categorize recent transactions."),
89
+ dayStep("day3_define_goals", 3, "goals.created", "Define at least one savings goal."),
90
+ dayStep("day4_setup_recurring_savings", 4, "recurring_rule.created", "Set a recurring savings rule."),
91
+ dayStep("day5_review_subscriptions", 5, "subscription.flagged_or_cancelled", "Review subscriptions and flag or cancel wasteful ones."),
92
+ dayStep("day6_plan_emergency", 6, "emergency_plan.completed", "Draft an emergency plan and target buffer."),
93
+ dayStep("day7_review_commit", 7, "quest.review.completed", "Review week outcomes and commit to the next month.")
94
+ ]
95
+ };
96
+ var questTracks = [moneyResetQuestTrack];
97
+ export {
98
+ questTracks,
99
+ moneyResetQuestTrack,
100
+ example_default as example
101
+ };
@@ -0,0 +1,33 @@
1
+ // src/docs/quest-challenges.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var questDocBlocks = [
4
+ {
5
+ id: "docs.learning-journey.quest-challenges",
6
+ title: "Learning Journey — Quest Challenges",
7
+ summary: "Time-bound challenge pattern (7-day money reset) with day unlocks and event-driven completion.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/learning-journey/quest-challenges",
11
+ tags: ["learning", "quest", "challenge"],
12
+ body: `## Track
13
+ - **Key**: \`money_reset_7day\`
14
+ - **Duration**: 7 days, steps unlock day by day
15
+
16
+ ## Steps & Events
17
+ - Day 1 \`day1_map_accounts\` → event \`accounts.mapped\`
18
+ - Day 2 \`day2_categorize_transactions\` → event \`transactions.categorized\`
19
+ - Day 3 \`day3_define_goals\` → event \`goals.created\`
20
+ - Day 4 \`day4_setup_recurring_savings\` → event \`recurring_rule.created\`
21
+ - Day 5 \`day5_review_subscriptions\` → event \`subscription.flagged_or_cancelled\`
22
+ - Day 6 \`day6_plan_emergency\` → event \`emergency_plan.completed\`
23
+ - Day 7 \`day7_review_commit\` → event \`quest.review.completed\`
24
+
25
+ XP: 15 per day, completion bonus 30 if finished within duration. Optional recap via SRS after completion.
26
+
27
+ ## Usage
28
+ - Exported via \`@contractspec/example.learning-journey-quest-challenges/track\`.
29
+ - Step availability uses \`availability.unlockOnDay\` to gate days.
30
+ - Registry progression handles event matching and XP application.`
31
+ }
32
+ ];
33
+ registerDocBlocks(questDocBlocks);
@@ -0,0 +1,33 @@
1
+ // src/docs/quest-challenges.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var questDocBlocks = [
4
+ {
5
+ id: "docs.learning-journey.quest-challenges",
6
+ title: "Learning Journey — Quest Challenges",
7
+ summary: "Time-bound challenge pattern (7-day money reset) with day unlocks and event-driven completion.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/learning-journey/quest-challenges",
11
+ tags: ["learning", "quest", "challenge"],
12
+ body: `## Track
13
+ - **Key**: \`money_reset_7day\`
14
+ - **Duration**: 7 days, steps unlock day by day
15
+
16
+ ## Steps & Events
17
+ - Day 1 \`day1_map_accounts\` → event \`accounts.mapped\`
18
+ - Day 2 \`day2_categorize_transactions\` → event \`transactions.categorized\`
19
+ - Day 3 \`day3_define_goals\` → event \`goals.created\`
20
+ - Day 4 \`day4_setup_recurring_savings\` → event \`recurring_rule.created\`
21
+ - Day 5 \`day5_review_subscriptions\` → event \`subscription.flagged_or_cancelled\`
22
+ - Day 6 \`day6_plan_emergency\` → event \`emergency_plan.completed\`
23
+ - Day 7 \`day7_review_commit\` → event \`quest.review.completed\`
24
+
25
+ XP: 15 per day, completion bonus 30 if finished within duration. Optional recap via SRS after completion.
26
+
27
+ ## Usage
28
+ - Exported via \`@contractspec/example.learning-journey-quest-challenges/track\`.
29
+ - Step availability uses \`availability.unlockOnDay\` to gate days.
30
+ - Registry progression handles event matching and XP application.`
31
+ }
32
+ ];
33
+ registerDocBlocks(questDocBlocks);
@@ -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-quest-challenges",
6
+ version: "1.0.0",
7
+ title: "Learning Journey — Quest Challenges",
8
+ description: "Quest/challenge pattern: multi-step goals with progress events, rewards, and streak hooks.",
9
+ kind: "template",
10
+ visibility: "public",
11
+ stability: "experimental",
12
+ owners: ["@platform.core"],
13
+ tags: ["learning", "quests", "challenges"]
14
+ },
15
+ docs: {
16
+ rootDocId: "docs.learning-journey.quest-challenges"
17
+ },
18
+ entrypoints: {
19
+ packageName: "@contractspec/example.learning-journey-quest-challenges",
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,100 @@
1
+ // src/docs/quest-challenges.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var questDocBlocks = [
4
+ {
5
+ id: "docs.learning-journey.quest-challenges",
6
+ title: "Learning Journey — Quest Challenges",
7
+ summary: "Time-bound challenge pattern (7-day money reset) with day unlocks and event-driven completion.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/learning-journey/quest-challenges",
11
+ tags: ["learning", "quest", "challenge"],
12
+ body: `## Track
13
+ - **Key**: \`money_reset_7day\`
14
+ - **Duration**: 7 days, steps unlock day by day
15
+
16
+ ## Steps & Events
17
+ - Day 1 \`day1_map_accounts\` → event \`accounts.mapped\`
18
+ - Day 2 \`day2_categorize_transactions\` → event \`transactions.categorized\`
19
+ - Day 3 \`day3_define_goals\` → event \`goals.created\`
20
+ - Day 4 \`day4_setup_recurring_savings\` → event \`recurring_rule.created\`
21
+ - Day 5 \`day5_review_subscriptions\` → event \`subscription.flagged_or_cancelled\`
22
+ - Day 6 \`day6_plan_emergency\` → event \`emergency_plan.completed\`
23
+ - Day 7 \`day7_review_commit\` → event \`quest.review.completed\`
24
+
25
+ XP: 15 per day, completion bonus 30 if finished within duration. Optional recap via SRS after completion.
26
+
27
+ ## Usage
28
+ - Exported via \`@contractspec/example.learning-journey-quest-challenges/track\`.
29
+ - Step availability uses \`availability.unlockOnDay\` to gate days.
30
+ - Registry progression handles event matching and XP application.`
31
+ }
32
+ ];
33
+ registerDocBlocks(questDocBlocks);
34
+ // src/example.ts
35
+ import { defineExample } from "@contractspec/lib.contracts";
36
+ var example = defineExample({
37
+ meta: {
38
+ key: "learning-journey-quest-challenges",
39
+ version: "1.0.0",
40
+ title: "Learning Journey — Quest Challenges",
41
+ description: "Quest/challenge pattern: multi-step goals with progress events, rewards, and streak hooks.",
42
+ kind: "template",
43
+ visibility: "public",
44
+ stability: "experimental",
45
+ owners: ["@platform.core"],
46
+ tags: ["learning", "quests", "challenges"]
47
+ },
48
+ docs: {
49
+ rootDocId: "docs.learning-journey.quest-challenges"
50
+ },
51
+ entrypoints: {
52
+ packageName: "@contractspec/example.learning-journey-quest-challenges",
53
+ docs: "./docs"
54
+ },
55
+ surfaces: {
56
+ templates: true,
57
+ sandbox: { enabled: true, modes: ["playground", "markdown"] },
58
+ studio: { enabled: true, installable: true },
59
+ mcp: { enabled: true }
60
+ }
61
+ });
62
+ var example_default = example;
63
+
64
+ // src/track.ts
65
+ var dayStep = (id, day, eventName, description) => ({
66
+ id,
67
+ title: `Day ${day}`,
68
+ description,
69
+ availability: { unlockOnDay: day },
70
+ completion: {
71
+ kind: "time_window",
72
+ eventName,
73
+ withinHoursOfStart: (day + 1) * 24
74
+ },
75
+ xpReward: 15,
76
+ metadata: { day }
77
+ });
78
+ var moneyResetQuestTrack = {
79
+ id: "money_reset_7day",
80
+ name: "7-day Money Reset",
81
+ description: "Time-bound quest to reset personal finances over a focused week.",
82
+ targetUserSegment: "money_user",
83
+ totalXp: 105,
84
+ completionRewards: { xpBonus: 30 },
85
+ steps: [
86
+ dayStep("day1_map_accounts", 1, "accounts.mapped", "Map bank and card accounts."),
87
+ dayStep("day2_categorize_transactions", 2, "transactions.categorized", "Categorize recent transactions."),
88
+ dayStep("day3_define_goals", 3, "goals.created", "Define at least one savings goal."),
89
+ dayStep("day4_setup_recurring_savings", 4, "recurring_rule.created", "Set a recurring savings rule."),
90
+ dayStep("day5_review_subscriptions", 5, "subscription.flagged_or_cancelled", "Review subscriptions and flag or cancel wasteful ones."),
91
+ dayStep("day6_plan_emergency", 6, "emergency_plan.completed", "Draft an emergency plan and target buffer."),
92
+ dayStep("day7_review_commit", 7, "quest.review.completed", "Review week outcomes and commit to the next month.")
93
+ ]
94
+ };
95
+ var questTracks = [moneyResetQuestTrack];
96
+ export {
97
+ questTracks,
98
+ moneyResetQuestTrack,
99
+ example_default as example
100
+ };
@@ -0,0 +1,36 @@
1
+ // src/track.ts
2
+ var 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
+ var 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
+ var questTracks = [moneyResetQuestTrack];
33
+ export {
34
+ questTracks,
35
+ moneyResetQuestTrack
36
+ };
package/dist/track.d.ts CHANGED
@@ -1,8 +1,4 @@
1
- import { LearningJourneyTrackSpec } from "@contractspec/module.learning-journey/track-spec";
2
-
3
- //#region src/track.d.ts
4
- declare const moneyResetQuestTrack: LearningJourneyTrackSpec;
5
- declare const questTracks: LearningJourneyTrackSpec[];
6
- //#endregion
7
- export { moneyResetQuestTrack, questTracks };
1
+ import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
2
+ export declare const moneyResetQuestTrack: LearningJourneyTrackSpec;
3
+ export declare const questTracks: LearningJourneyTrackSpec[];
8
4
  //# sourceMappingURL=track.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"track.d.ts","names":[],"sources":["../src/track.ts"],"sourcesContent":[],"mappings":";;;cAqBa,sBAAsB;cAsDtB,aAAa"}
1
+ {"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../src/track.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AAqBjG,eAAO,MAAM,oBAAoB,EAAE,wBAoDlC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,wBAAwB,EAA2B,CAAC"}
package/dist/track.js CHANGED
@@ -1,36 +1,37 @@
1
- //#region 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 }
1
+ // @bun
2
+ // src/track.ts
3
+ var dayStep = (id, day, eventName, description) => ({
4
+ id,
5
+ title: `Day ${day}`,
6
+ description,
7
+ availability: { unlockOnDay: day },
8
+ completion: {
9
+ kind: "time_window",
10
+ eventName,
11
+ withinHoursOfStart: (day + 1) * 24
12
+ },
13
+ xpReward: 15,
14
+ metadata: { day }
14
15
  });
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
- ]
16
+ var moneyResetQuestTrack = {
17
+ id: "money_reset_7day",
18
+ name: "7-day Money Reset",
19
+ description: "Time-bound quest to reset personal finances over a focused week.",
20
+ targetUserSegment: "money_user",
21
+ totalXp: 105,
22
+ completionRewards: { xpBonus: 30 },
23
+ steps: [
24
+ dayStep("day1_map_accounts", 1, "accounts.mapped", "Map bank and card accounts."),
25
+ dayStep("day2_categorize_transactions", 2, "transactions.categorized", "Categorize recent transactions."),
26
+ dayStep("day3_define_goals", 3, "goals.created", "Define at least one savings goal."),
27
+ dayStep("day4_setup_recurring_savings", 4, "recurring_rule.created", "Set a recurring savings rule."),
28
+ dayStep("day5_review_subscriptions", 5, "subscription.flagged_or_cancelled", "Review subscriptions and flag or cancel wasteful ones."),
29
+ dayStep("day6_plan_emergency", 6, "emergency_plan.completed", "Draft an emergency plan and target buffer."),
30
+ dayStep("day7_review_commit", 7, "quest.review.completed", "Review week outcomes and commit to the next month.")
31
+ ]
32
+ };
33
+ var questTracks = [moneyResetQuestTrack];
34
+ export {
35
+ questTracks,
36
+ moneyResetQuestTrack
31
37
  };
32
- const questTracks = [moneyResetQuestTrack];
33
-
34
- //#endregion
35
- export { moneyResetQuestTrack, questTracks };
36
- //# sourceMappingURL=track.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=track.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"track.test.d.ts","sourceRoot":"","sources":["../src/track.test.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,48 +1,85 @@
1
1
  {
2
2
  "name": "@contractspec/example.learning-journey-quest-challenges",
3
- "version": "1.56.1",
3
+ "version": "1.58.0",
4
4
  "description": "Time-bound quest/challenge learning journey example.",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "exports": {
8
- ".": "./dist/index.js",
9
- "./docs": "./dist/docs/index.js",
10
- "./docs/quest-challenges.docblock": "./dist/docs/quest-challenges.docblock.js",
11
- "./example": "./dist/example.js",
12
- "./track": "./dist/track.js",
13
- "./*": "./*"
8
+ ".": "./src/index.ts",
9
+ "./docs": "./src/docs/index.ts",
10
+ "./docs/index": "./src/docs/index.ts",
11
+ "./docs/quest-challenges.docblock": "./src/docs/quest-challenges.docblock.ts",
12
+ "./example": "./src/example.ts",
13
+ "./track": "./src/track.ts"
14
14
  },
15
15
  "scripts": {
16
16
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
17
17
  "publish:pkg:canary": "bun publish:pkg --tag canary",
18
- "build": "bun build:types && bun build:bundle",
19
- "build:bundle": "tsdown",
20
- "build:types": "tsc --noEmit",
21
- "dev": "bun build:bundle --watch",
18
+ "build": "bun run prebuild && bun run build:bundle && bun run build:types",
19
+ "build:bundle": "contractspec-bun-build transpile",
20
+ "build:types": "contractspec-bun-build types",
21
+ "dev": "contractspec-bun-build dev",
22
22
  "clean": "rimraf dist .turbo",
23
23
  "lint": "bun lint:fix",
24
24
  "lint:fix": "eslint src --fix",
25
25
  "lint:check": "eslint src",
26
- "test": "bun test"
26
+ "test": "bun test",
27
+ "prebuild": "contractspec-bun-build prebuild",
28
+ "typecheck": "tsc --noEmit"
27
29
  },
28
30
  "dependencies": {
29
- "@contractspec/module.learning-journey": "1.56.1",
30
- "@contractspec/lib.contracts": "1.56.1"
31
+ "@contractspec/module.learning-journey": "1.58.0",
32
+ "@contractspec/lib.contracts": "1.58.0"
31
33
  },
32
34
  "devDependencies": {
33
- "@contractspec/tool.tsdown": "1.56.1",
34
- "@contractspec/tool.typescript": "1.56.1",
35
- "tsdown": "^0.19.0",
36
- "typescript": "^5.9.3"
35
+ "@contractspec/tool.typescript": "1.58.0",
36
+ "typescript": "^5.9.3",
37
+ "@contractspec/tool.bun": "1.57.0"
37
38
  },
38
39
  "publishConfig": {
39
40
  "exports": {
40
- ".": "./dist/index.js",
41
- "./example": "./dist/example.js",
42
- "./track": "./dist/track.js",
43
- "./docs": "./dist/docs/index.js",
44
- "./docs/quest-challenges.docblock": "./dist/docs/quest-challenges.docblock.js",
45
- "./*": "./*"
41
+ ".": {
42
+ "types": "./dist/index.d.ts",
43
+ "bun": "./dist/index.js",
44
+ "node": "./dist/node/index.mjs",
45
+ "browser": "./dist/browser/index.js",
46
+ "default": "./dist/index.js"
47
+ },
48
+ "./docs": {
49
+ "types": "./dist/docs/index.d.ts",
50
+ "bun": "./dist/docs/index.js",
51
+ "node": "./dist/node/docs/index.mjs",
52
+ "browser": "./dist/browser/docs/index.js",
53
+ "default": "./dist/docs/index.js"
54
+ },
55
+ "./docs/index": {
56
+ "types": "./dist/docs/index.d.ts",
57
+ "bun": "./dist/docs/index.js",
58
+ "node": "./dist/node/docs/index.mjs",
59
+ "browser": "./dist/browser/docs/index.js",
60
+ "default": "./dist/docs/index.js"
61
+ },
62
+ "./docs/quest-challenges.docblock": {
63
+ "types": "./dist/docs/quest-challenges.docblock.d.ts",
64
+ "bun": "./dist/docs/quest-challenges.docblock.js",
65
+ "node": "./dist/node/docs/quest-challenges.docblock.mjs",
66
+ "browser": "./dist/browser/docs/quest-challenges.docblock.js",
67
+ "default": "./dist/docs/quest-challenges.docblock.js"
68
+ },
69
+ "./example": {
70
+ "types": "./dist/example.d.ts",
71
+ "bun": "./dist/example.js",
72
+ "node": "./dist/node/example.mjs",
73
+ "browser": "./dist/browser/example.js",
74
+ "default": "./dist/example.js"
75
+ },
76
+ "./track": {
77
+ "types": "./dist/track.d.ts",
78
+ "bun": "./dist/track.js",
79
+ "node": "./dist/node/track.mjs",
80
+ "browser": "./dist/browser/track.js",
81
+ "default": "./dist/track.js"
82
+ }
46
83
  },
47
84
  "registry": "https://registry.npmjs.org/",
48
85
  "access": "public"
package/tsdown.config.js CHANGED
@@ -1,5 +1,4 @@
1
- import { defineConfig } from 'tsdown';
2
- import { moduleLibrary, withDevExports } from '@contractspec/tool.tsdown';
1
+ import { defineConfig, moduleLibrary, withDevExports } from '@contractspec/tool.bun';
3
2
 
4
3
  export default defineConfig(() => ({
5
4
  ...moduleLibrary,
@@ -1,25 +0,0 @@
1
- $ tsdown
2
- ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
3
- ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/learning-journey-quest-challenges/tsdown.config.js
4
- ℹ entry: src/example.ts, src/index.ts, src/track.ts, src/docs/index.ts, src/docs/quest-challenges.docblock.ts
5
- ℹ target: esnext
6
- ℹ tsconfig: tsconfig.json
7
- ℹ Build start
8
- ℹ Cleaning 16 files
9
- ℹ dist/docs/quest-challenges.docblock.js 1.51 kB │ gzip: 0.78 kB
10
- ℹ dist/track.js 1.44 kB │ gzip: 0.76 kB
11
- ℹ dist/example.js 1.00 kB │ gzip: 0.54 kB
12
- ℹ dist/index.js 0.21 kB │ gzip: 0.13 kB
13
- ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
14
- ℹ dist/track.js.map 2.61 kB │ gzip: 1.15 kB
15
- ℹ dist/docs/quest-challenges.docblock.js.map 1.93 kB │ gzip: 0.95 kB
16
- ℹ dist/example.js.map 1.43 kB │ gzip: 0.74 kB
17
- ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
18
- ℹ dist/track.d.ts.map 0.14 kB │ gzip: 0.13 kB
19
- ℹ dist/track.d.ts 0.33 kB │ gzip: 0.20 kB
20
- ℹ dist/example.d.ts 0.25 kB │ gzip: 0.17 kB
21
- ℹ dist/index.d.ts 0.15 kB │ gzip: 0.10 kB
22
- ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
23
- ℹ dist/docs/quest-challenges.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
24
- ℹ 15 files, total: 11.21 kB
25
- ✔ Build complete in 19289ms
@@ -1 +0,0 @@
1
- {"version":3,"file":"quest-challenges.docblock.js","names":[],"sources":["../../src/docs/quest-challenges.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst questDocBlocks: DocBlock[] = [\n {\n id: 'docs.learning-journey.quest-challenges',\n title: 'Learning Journey — Quest Challenges',\n summary:\n 'Time-bound challenge pattern (7-day money reset) with day unlocks and event-driven completion.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/learning-journey/quest-challenges',\n tags: ['learning', 'quest', 'challenge'],\n body: `## Track\n- **Key**: \\`money_reset_7day\\`\n- **Duration**: 7 days, steps unlock day by day\n\n## Steps & Events\n- Day 1 \\`day1_map_accounts\\` → event \\`accounts.mapped\\`\n- Day 2 \\`day2_categorize_transactions\\` → event \\`transactions.categorized\\`\n- Day 3 \\`day3_define_goals\\` → event \\`goals.created\\`\n- Day 4 \\`day4_setup_recurring_savings\\` → event \\`recurring_rule.created\\`\n- Day 5 \\`day5_review_subscriptions\\` → event \\`subscription.flagged_or_cancelled\\`\n- Day 6 \\`day6_plan_emergency\\` → event \\`emergency_plan.completed\\`\n- Day 7 \\`day7_review_commit\\` → event \\`quest.review.completed\\`\n\nXP: 15 per day, completion bonus 30 if finished within duration. Optional recap via SRS after completion.\n\n## Usage\n- Exported via \\`@contractspec/example.learning-journey-quest-challenges/track\\`.\n- Step availability uses \\`availability.unlockOnDay\\` to gate days.\n- Registry progression handles event matching and XP application.`,\n },\n];\n\nregisterDocBlocks(questDocBlocks);\n"],"mappings":";;;AAmCA,kBAhCmC,CACjC;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAY;EAAS;EAAY;CACxC,MAAM;;;;;;;;;;;;;;;;;;;CAmBP,CACF,CAEgC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["import { defineExample } from '@contractspec/lib.contracts';\n\nconst example = defineExample({\n meta: {\n key: 'learning-journey-quest-challenges',\n version: '1.0.0',\n title: 'Learning Journey — Quest Challenges',\n description:\n 'Quest/challenge pattern: multi-step goals with progress events, rewards, and streak hooks.',\n kind: 'template',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@platform.core'],\n tags: ['learning', 'quests', 'challenges'],\n },\n docs: {\n rootDocId: 'docs.learning-journey.quest-challenges',\n },\n entrypoints: {\n packageName: '@contractspec/example.learning-journey-quest-challenges',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: { enabled: true, modes: ['playground', 'markdown'] },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n});\n\nexport default example;\n"],"mappings":";;;AAEA,MAAM,UAAU,cAAc;CAC5B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAY;GAAU;GAAa;EAC3C;CACD,MAAM,EACJ,WAAW,0CACZ;CACD,aAAa;EACX,aAAa;EACb,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GAAE,SAAS;GAAM,OAAO,CAAC,cAAc,WAAW;GAAE;EAC7D,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF,CAAC;AAEF,sBAAe"}
package/dist/track.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"track.js","names":[],"sources":["../src/track.ts"],"sourcesContent":["import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';\n\nconst dayStep = (\n id: string,\n day: number,\n eventName: string,\n description: string\n): LearningJourneyTrackSpec['steps'][number] => ({\n id,\n title: `Day ${day}`,\n description,\n availability: { unlockOnDay: day },\n completion: {\n kind: 'time_window',\n eventName,\n withinHoursOfStart: (day + 1) * 24, // allow grace through next day\n },\n xpReward: 15,\n metadata: { day },\n});\n\nexport const moneyResetQuestTrack: LearningJourneyTrackSpec = {\n id: 'money_reset_7day',\n name: '7-day Money Reset',\n description:\n 'Time-bound quest to reset personal finances over a focused week.',\n targetUserSegment: 'money_user',\n totalXp: 105,\n completionRewards: { xpBonus: 30 },\n steps: [\n dayStep(\n 'day1_map_accounts',\n 1,\n 'accounts.mapped',\n 'Map bank and card accounts.'\n ),\n dayStep(\n 'day2_categorize_transactions',\n 2,\n 'transactions.categorized',\n 'Categorize recent transactions.'\n ),\n dayStep(\n 'day3_define_goals',\n 3,\n 'goals.created',\n 'Define at least one savings goal.'\n ),\n dayStep(\n 'day4_setup_recurring_savings',\n 4,\n 'recurring_rule.created',\n 'Set a recurring savings rule.'\n ),\n dayStep(\n 'day5_review_subscriptions',\n 5,\n 'subscription.flagged_or_cancelled',\n 'Review subscriptions and flag or cancel wasteful ones.'\n ),\n dayStep(\n 'day6_plan_emergency',\n 6,\n 'emergency_plan.completed',\n 'Draft an emergency plan and target buffer.'\n ),\n dayStep(\n 'day7_review_commit',\n 7,\n 'quest.review.completed',\n 'Review week outcomes and commit to the next month.'\n ),\n ],\n};\n\nexport const questTracks: LearningJourneyTrackSpec[] = [moneyResetQuestTrack];\n"],"mappings":";AAEA,MAAM,WACJ,IACA,KACA,WACA,iBAC+C;CAC/C;CACA,OAAO,OAAO;CACd;CACA,cAAc,EAAE,aAAa,KAAK;CAClC,YAAY;EACV,MAAM;EACN;EACA,qBAAqB,MAAM,KAAK;EACjC;CACD,UAAU;CACV,UAAU,EAAE,KAAK;CAClB;AAED,MAAa,uBAAiD;CAC5D,IAAI;CACJ,MAAM;CACN,aACE;CACF,mBAAmB;CACnB,SAAS;CACT,mBAAmB,EAAE,SAAS,IAAI;CAClC,OAAO;EACL,QACE,qBACA,GACA,mBACA,8BACD;EACD,QACE,gCACA,GACA,4BACA,kCACD;EACD,QACE,qBACA,GACA,iBACA,oCACD;EACD,QACE,gCACA,GACA,0BACA,gCACD;EACD,QACE,6BACA,GACA,qCACA,yDACD;EACD,QACE,uBACA,GACA,4BACA,6CACD;EACD,QACE,sBACA,GACA,0BACA,qDACD;EACF;CACF;AAED,MAAa,cAA0C,CAAC,qBAAqB"}