@contractspec/example.learning-journey-quest-challenges 1.57.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +31 -30
- package/.turbo/turbo-prebuild.log +1 -0
- package/CHANGELOG.md +13 -0
- package/dist/browser/docs/index.js +33 -0
- package/dist/browser/docs/quest-challenges.docblock.js +33 -0
- package/dist/browser/example.js +32 -0
- package/dist/browser/index.js +100 -0
- package/dist/browser/track.js +36 -0
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +34 -1
- package/dist/docs/quest-challenges.docblock.d.ts +2 -1
- package/dist/docs/quest-challenges.docblock.d.ts.map +1 -0
- package/dist/docs/quest-challenges.docblock.js +22 -26
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +31 -39
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +100 -4
- package/dist/node/docs/index.js +33 -0
- package/dist/node/docs/quest-challenges.docblock.js +33 -0
- package/dist/node/example.js +32 -0
- package/dist/node/index.js +100 -0
- package/dist/node/track.js +36 -0
- package/dist/track.d.ts +3 -7
- package/dist/track.d.ts.map +1 -1
- package/dist/track.js +35 -34
- package/dist/track.test.d.ts +2 -0
- package/dist/track.test.d.ts.map +1 -0
- package/package.json +61 -24
- package/tsdown.config.js +1 -2
- package/.turbo/turbo-build$colon$bundle.log +0 -30
- package/dist/docs/quest-challenges.docblock.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/track.js.map +0 -1
- package/tsconfig.tsbuildinfo +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
$ bun
|
|
2
|
-
$
|
|
3
|
-
$
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[34mℹ[39m target: [34mesnext[39m
|
|
8
|
-
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
|
-
[34mℹ[39m Build start
|
|
10
|
-
[34mℹ[39m [2mdist/[22m[1mdocs/quest-challenges.docblock.js[22m [2m1.51 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
11
|
-
[34mℹ[39m [2mdist/[22m[1mtrack.js[22m [2m1.44 kB[22m [2m│ gzip: 0.76 kB[22m
|
|
12
|
-
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m0.96 kB[22m [2m│ gzip: 0.53 kB[22m
|
|
13
|
-
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m0.18 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
14
|
-
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.04 kB[22m [2m│ gzip: 0.06 kB[22m
|
|
15
|
-
[34mℹ[39m [2mdist/[22mtrack.js.map [2m2.61 kB[22m [2m│ gzip: 1.15 kB[22m
|
|
16
|
-
[34mℹ[39m [2mdist/[22mdocs/quest-challenges.docblock.js.map [2m1.93 kB[22m [2m│ gzip: 0.95 kB[22m
|
|
17
|
-
[34mℹ[39m [2mdist/[22mexample.js.map [2m1.42 kB[22m [2m│ gzip: 0.73 kB[22m
|
|
18
|
-
[34mℹ[39m [2mdist/[22mtrack.d.ts.map [2m0.14 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
19
|
-
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.13 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
20
|
-
[34mℹ[39m [2mdist/[22m[32m[1mtrack.d.ts[22m[39m [2m0.33 kB[22m [2m│ gzip: 0.20 kB[22m
|
|
21
|
-
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m0.25 kB[22m [2m│ gzip: 0.17 kB[22m
|
|
22
|
-
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.15 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
23
|
-
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
24
|
-
[34mℹ[39m [2mdist/[22m[32m[1mdocs/quest-challenges.docblock.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
25
|
-
[34mℹ[39m 15 files, total: 11.13 kB
|
|
26
|
-
[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugins. Here is a breakdown:
|
|
27
|
-
- rolldown-plugin-dts:generate (59%)
|
|
28
|
-
- tsdown:external (40%)
|
|
29
|
-
See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
1
|
+
$ contractspec-bun-build prebuild
|
|
2
|
+
$ bun run prebuild && bun run build:bundle && bun run build:types
|
|
3
|
+
$ contractspec-bun-build prebuild
|
|
4
|
+
$ contractspec-bun-build transpile
|
|
5
|
+
[contractspec-bun-build] transpile target=bun root=src entries=5
|
|
6
|
+
Bundled 5 modules in 20ms
|
|
30
7
|
|
|
31
|
-
|
|
8
|
+
docs/index.js 1.53 KB (entry point)
|
|
9
|
+
./index.js 3.91 KB (entry point)
|
|
10
|
+
docs/quest-challenges.docblock.js 1.53 KB (entry point)
|
|
11
|
+
./example.js 0.97 KB (entry point)
|
|
12
|
+
./track.js 1.43 KB (entry point)
|
|
13
|
+
|
|
14
|
+
[contractspec-bun-build] transpile target=node root=src entries=5
|
|
15
|
+
Bundled 5 modules in 7ms
|
|
16
|
+
|
|
17
|
+
docs/index.js 1.50 KB (entry point)
|
|
18
|
+
./index.js 3.87 KB (entry point)
|
|
19
|
+
docs/quest-challenges.docblock.js 1.50 KB (entry point)
|
|
20
|
+
./example.js 0.96 KB (entry point)
|
|
21
|
+
./track.js 1.42 KB (entry point)
|
|
22
|
+
|
|
23
|
+
[contractspec-bun-build] transpile target=browser root=src entries=5
|
|
24
|
+
Bundled 5 modules in 19ms
|
|
25
|
+
|
|
26
|
+
docs/index.js 1.50 KB (entry point)
|
|
27
|
+
./index.js 3.87 KB (entry point)
|
|
28
|
+
docs/quest-challenges.docblock.js 1.50 KB (entry point)
|
|
29
|
+
./example.js 0.96 KB (entry point)
|
|
30
|
+
./track.js 1.42 KB (entry point)
|
|
31
|
+
|
|
32
|
+
$ contractspec-bun-build types
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$ contractspec-bun-build prebuild
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @contractspec/example.learning-journey-quest-challenges
|
|
2
2
|
|
|
3
|
+
## 1.58.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d1f0fd0: chore: Migrate non-app package builds from tsdown to shared Bun tooling, add `@contractspec/tool.bun`, and standardize `prebuild`/`build`/`typecheck` with platform-aware exports and `tsc` declaration emission into `dist`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [d1f0fd0]
|
|
12
|
+
- Updated dependencies [4355a9e]
|
|
13
|
+
- @contractspec/module.learning-journey@1.58.0
|
|
14
|
+
- @contractspec/lib.contracts@1.58.0
|
|
15
|
+
|
|
3
16
|
## 1.57.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -0,0 +1,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/docs/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import './quest-challenges.docblock';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC"}
|
package/dist/docs/index.js
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
|
|
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
|
|
16
|
+
|
|
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);
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=quest-challenges.docblock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quest-challenges.docblock.d.ts","sourceRoot":"","sources":["../../src/docs/quest-challenges.docblock.ts"],"names":[],"mappings":""}
|
|
@@ -1,30 +1,27 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/docs/quest-challenges.docblock.ts
|
|
1
3
|
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"learning",
|
|
13
|
-
"quest",
|
|
14
|
-
"challenge"
|
|
15
|
-
],
|
|
16
|
-
body: `## Track
|
|
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
|
|
17
14
|
- **Key**: \`money_reset_7day\`
|
|
18
15
|
- **Duration**: 7 days, steps unlock day by day
|
|
19
16
|
|
|
20
17
|
## Steps & Events
|
|
21
|
-
- Day 1 \`day1_map_accounts\`
|
|
22
|
-
- Day 2 \`day2_categorize_transactions\`
|
|
23
|
-
- Day 3 \`day3_define_goals\`
|
|
24
|
-
- Day 4 \`day4_setup_recurring_savings\`
|
|
25
|
-
- Day 5 \`day5_review_subscriptions\`
|
|
26
|
-
- Day 6 \`day6_plan_emergency\`
|
|
27
|
-
- Day 7 \`day7_review_commit\`
|
|
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\`
|
|
28
25
|
|
|
29
26
|
XP: 15 per day, completion bonus 30 if finished within duration. Optional recap via SRS after completion.
|
|
30
27
|
|
|
@@ -32,7 +29,6 @@ XP: 15 per day, completion bonus 30 if finished within duration. Optional recap
|
|
|
32
29
|
- Exported via \`@contractspec/example.learning-journey-quest-challenges/track\`.
|
|
33
30
|
- Step availability uses \`availability.unlockOnDay\` to gate days.
|
|
34
31
|
- Registry progression handles event matching and XP application.`
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=quest-challenges.docblock.js.map
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
registerDocBlocks(questDocBlocks);
|
package/dist/example.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//#region src/example.d.ts
|
|
4
|
-
declare const example: _contractspec_lib_contracts0.ExampleSpec;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { example as default };
|
|
1
|
+
declare const example: import("@contractspec/lib.contracts").ExampleSpec;
|
|
2
|
+
export default example;
|
|
7
3
|
//# sourceMappingURL=example.d.ts.map
|
package/dist/example.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","
|
|
1
|
+
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,OAAO,mDA0BX,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
package/dist/example.js
CHANGED
|
@@ -1,41 +1,33 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/example.ts
|
|
1
3
|
import { defineExample } from "@contractspec/lib.contracts";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
sandbox: {
|
|
28
|
-
enabled: true,
|
|
29
|
-
modes: ["playground", "markdown"]
|
|
30
|
-
},
|
|
31
|
-
studio: {
|
|
32
|
-
enabled: true,
|
|
33
|
-
installable: true
|
|
34
|
-
},
|
|
35
|
-
mcp: { enabled: true }
|
|
36
|
-
}
|
|
4
|
+
var example = defineExample({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "learning-journey-quest-challenges",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
title: "Learning Journey \u2014 Quest Challenges",
|
|
9
|
+
description: "Quest/challenge pattern: multi-step goals with progress events, rewards, and streak hooks.",
|
|
10
|
+
kind: "template",
|
|
11
|
+
visibility: "public",
|
|
12
|
+
stability: "experimental",
|
|
13
|
+
owners: ["@platform.core"],
|
|
14
|
+
tags: ["learning", "quests", "challenges"]
|
|
15
|
+
},
|
|
16
|
+
docs: {
|
|
17
|
+
rootDocId: "docs.learning-journey.quest-challenges"
|
|
18
|
+
},
|
|
19
|
+
entrypoints: {
|
|
20
|
+
packageName: "@contractspec/example.learning-journey-quest-challenges",
|
|
21
|
+
docs: "./docs"
|
|
22
|
+
},
|
|
23
|
+
surfaces: {
|
|
24
|
+
templates: true,
|
|
25
|
+
sandbox: { enabled: true, modes: ["playground", "markdown"] },
|
|
26
|
+
studio: { enabled: true, installable: true },
|
|
27
|
+
mcp: { enabled: true }
|
|
28
|
+
}
|
|
37
29
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
var example_default = example;
|
|
31
|
+
export {
|
|
32
|
+
example_default as default
|
|
33
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export * from './track';
|
|
2
|
+
export { default as example } from './example';
|
|
3
|
+
import './docs';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import "
|
|
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
|
-
|
|
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
|
+
};
|