level-up-mcp-server-cn 0.4.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/.claude/projects/c--Users-klexi-OneDrive-Desktop-Levelup-level-up-mcp-server/memory/project_testing_service.md +11 -0
- package/.claude/settings.local.json +10 -0
- package/.env.example +19 -0
- package/CLAUDE.md +222 -0
- package/CODE_REVIEW.md +282 -0
- package/LICENSE +64 -0
- package/README.md +198 -0
- package/dist/constants.d.ts +33 -0
- package/dist/constants.js +78 -0
- package/dist/constants.js.map +1 -0
- package/dist/data/quest-seeds.d.ts +18 -0
- package/dist/data/quest-seeds.js +380 -0
- package/dist/data/quest-seeds.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +260 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/common.d.ts +33 -0
- package/dist/schemas/common.js +96 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/services/dispatcher.d.ts +27 -0
- package/dist/services/dispatcher.js +47 -0
- package/dist/services/dispatcher.js.map +1 -0
- package/dist/services/errors.d.ts +56 -0
- package/dist/services/errors.js +99 -0
- package/dist/services/errors.js.map +1 -0
- package/dist/services/format.d.ts +74 -0
- package/dist/services/format.js +144 -0
- package/dist/services/format.js.map +1 -0
- package/dist/services/ownership.d.ts +19 -0
- package/dist/services/ownership.js +79 -0
- package/dist/services/ownership.js.map +1 -0
- package/dist/services/quality-gate.d.ts +45 -0
- package/dist/services/quality-gate.js +131 -0
- package/dist/services/quality-gate.js.map +1 -0
- package/dist/services/rate-limit.d.ts +12 -0
- package/dist/services/rate-limit.js +49 -0
- package/dist/services/rate-limit.js.map +1 -0
- package/dist/services/register.d.ts +49 -0
- package/dist/services/register.js +63 -0
- package/dist/services/register.js.map +1 -0
- package/dist/services/supabase.d.ts +10 -0
- package/dist/services/supabase.js +79 -0
- package/dist/services/supabase.js.map +1 -0
- package/dist/tools/achievements.d.ts +6 -0
- package/dist/tools/achievements.js +242 -0
- package/dist/tools/achievements.js.map +1 -0
- package/dist/tools/admin.d.ts +16 -0
- package/dist/tools/admin.js +328 -0
- package/dist/tools/admin.js.map +1 -0
- package/dist/tools/agents.d.ts +3 -0
- package/dist/tools/agents.js +400 -0
- package/dist/tools/agents.js.map +1 -0
- package/dist/tools/bootstrap.d.ts +17 -0
- package/dist/tools/bootstrap.js +565 -0
- package/dist/tools/bootstrap.js.map +1 -0
- package/dist/tools/dispatchers/admin.d.ts +3 -0
- package/dist/tools/dispatchers/admin.js +50 -0
- package/dist/tools/dispatchers/admin.js.map +1 -0
- package/dist/tools/dispatchers/eval.d.ts +3 -0
- package/dist/tools/dispatchers/eval.js +40 -0
- package/dist/tools/dispatchers/eval.js.map +1 -0
- package/dist/tools/dispatchers/quests.d.ts +3 -0
- package/dist/tools/dispatchers/quests.js +60 -0
- package/dist/tools/dispatchers/quests.js.map +1 -0
- package/dist/tools/dispatchers/session.d.ts +3 -0
- package/dist/tools/dispatchers/session.js +38 -0
- package/dist/tools/dispatchers/session.js.map +1 -0
- package/dist/tools/dispatchers/skills.d.ts +3 -0
- package/dist/tools/dispatchers/skills.js +49 -0
- package/dist/tools/dispatchers/skills.js.map +1 -0
- package/dist/tools/dispatchers/tasks.d.ts +3 -0
- package/dist/tools/dispatchers/tasks.js +53 -0
- package/dist/tools/dispatchers/tasks.js.map +1 -0
- package/dist/tools/dispatchers/users.d.ts +3 -0
- package/dist/tools/dispatchers/users.js +65 -0
- package/dist/tools/dispatchers/users.js.map +1 -0
- package/dist/tools/dispatchers/xp.d.ts +3 -0
- package/dist/tools/dispatchers/xp.js +51 -0
- package/dist/tools/dispatchers/xp.js.map +1 -0
- package/dist/tools/growth-plan.d.ts +5 -0
- package/dist/tools/growth-plan.js +791 -0
- package/dist/tools/growth-plan.js.map +1 -0
- package/dist/tools/leaderboards.d.ts +10 -0
- package/dist/tools/leaderboards.js +279 -0
- package/dist/tools/leaderboards.js.map +1 -0
- package/dist/tools/leveling.d.ts +24 -0
- package/dist/tools/leveling.js +356 -0
- package/dist/tools/leveling.js.map +1 -0
- package/dist/tools/metrics.d.ts +3 -0
- package/dist/tools/metrics.js +247 -0
- package/dist/tools/metrics.js.map +1 -0
- package/dist/tools/quests.d.ts +5 -0
- package/dist/tools/quests.js +586 -0
- package/dist/tools/quests.js.map +1 -0
- package/dist/tools/ratings.d.ts +11 -0
- package/dist/tools/ratings.js +564 -0
- package/dist/tools/ratings.js.map +1 -0
- package/dist/tools/skills.d.ts +66 -0
- package/dist/tools/skills.js +1112 -0
- package/dist/tools/skills.js.map +1 -0
- package/dist/tools/system.d.ts +31 -0
- package/dist/tools/system.js +605 -0
- package/dist/tools/system.js.map +1 -0
- package/dist/tools/tasks.d.ts +73 -0
- package/dist/tools/tasks.js +1572 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/users.d.ts +97 -0
- package/dist/tools/users.js +1306 -0
- package/dist/tools/users.js.map +1 -0
- package/dist/tools/xp.d.ts +38 -0
- package/dist/tools/xp.js +670 -0
- package/dist/tools/xp.js.map +1 -0
- package/dist/types.d.ts +178 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/docs/recommended-skillsets.md +622 -0
- package/docs/skills-and-abilities-review.md +672 -0
- package/docs/v0.3-roadmap.md +191 -0
- package/package.json +35 -0
- package/sql/agent_pending_installs.sql +28 -0
- package/sql/award_class_xp.sql +81 -0
- package/supabase/.temp/cli-latest +1 -0
- package/supabase/.temp/gotrue-version +1 -0
- package/supabase/.temp/pooler-url +1 -0
- package/supabase/.temp/postgres-version +1 -0
- package/supabase/.temp/project-ref +1 -0
- package/supabase/.temp/rest-version +1 -0
- package/supabase/.temp/storage-migration +1 -0
- package/supabase/.temp/storage-version +1 -0
- package/supabase/migrations/20260314000000_anon_rls_policies.sql +311 -0
- package/supabase/migrations/20260314000001_ownership_rpcs.sql +382 -0
- package/supabase/migrations/20260314000002_evidence_and_growth_plan.sql +97 -0
- package/supabase/migrations/20260317000000_seed_quests.sql +62 -0
- package/supabase/migrations/20260317000001_star_cooldown_and_fixes.sql +16 -0
- package/supabase/migrations/20260318000000_restore_rank_names.sql +25 -0
- package/supabase/migrations/20260320000000_chinese_rank_names.sql +24 -0
- package/vitest.config.ts +11 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Quest seed data — 35 quests across 6 categories
|
|
3
|
+
// ============================================================
|
|
4
|
+
export const QUEST_SEEDS = [
|
|
5
|
+
// ── Onboarding Track (sequential) ──────────────────────────
|
|
6
|
+
{
|
|
7
|
+
title: "First Steps",
|
|
8
|
+
description: "注册您的升级档案,开始追踪经验值和进度。",
|
|
9
|
+
quest_type: "default",
|
|
10
|
+
target_type: "user",
|
|
11
|
+
category: "onboarding",
|
|
12
|
+
base_xp_reward: 5,
|
|
13
|
+
requirements: { type: "registration", target: 1 },
|
|
14
|
+
safe_for_autonomous: true,
|
|
15
|
+
order: 1,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: "Equip Your Agent",
|
|
19
|
+
description: "Add 3 skills to your agent. Skills improve task quality and reduce leveling costs.",
|
|
20
|
+
quest_type: "default",
|
|
21
|
+
target_type: "both",
|
|
22
|
+
category: "onboarding",
|
|
23
|
+
base_xp_reward: 15,
|
|
24
|
+
requirements: { type: "skill_count", target: 3 },
|
|
25
|
+
safe_for_autonomous: true,
|
|
26
|
+
order: 2,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: "Tool Collector",
|
|
30
|
+
description: "Install 3 MCP tools. Each install awards +20 XP and unlocks new skill categories.",
|
|
31
|
+
quest_type: "default",
|
|
32
|
+
target_type: "both",
|
|
33
|
+
category: "onboarding",
|
|
34
|
+
base_xp_reward: 20,
|
|
35
|
+
requirements: { type: "mcp_install", target: 3 },
|
|
36
|
+
safe_for_autonomous: true,
|
|
37
|
+
order: 3,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: "First Delivery",
|
|
41
|
+
description: "Complete your first task with evidence. This is where real XP starts flowing.",
|
|
42
|
+
quest_type: "default",
|
|
43
|
+
target_type: "both",
|
|
44
|
+
category: "onboarding",
|
|
45
|
+
base_xp_reward: 15,
|
|
46
|
+
requirements: { type: "task_count", target: 1, filter: { status: "completed" } },
|
|
47
|
+
safe_for_autonomous: true,
|
|
48
|
+
order: 4,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
title: "Quality Work",
|
|
52
|
+
description: "Complete a task with a quality score above 3.5. Evidence and proper difficulty help.",
|
|
53
|
+
quest_type: "default",
|
|
54
|
+
target_type: "both",
|
|
55
|
+
category: "onboarding",
|
|
56
|
+
base_xp_reward: 20,
|
|
57
|
+
requirements: { type: "quality_score", target: 3.5 },
|
|
58
|
+
safe_for_autonomous: true,
|
|
59
|
+
order: 5,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: "Evidence Keeper",
|
|
63
|
+
description: "Complete a standard or higher task with strong evidence (URL, code output, or platform reference).",
|
|
64
|
+
quest_type: "default",
|
|
65
|
+
target_type: "both",
|
|
66
|
+
category: "onboarding",
|
|
67
|
+
base_xp_reward: 15,
|
|
68
|
+
requirements: { type: "evidence_quality", target: 1, filter: { quality: "strong" } },
|
|
69
|
+
safe_for_autonomous: true,
|
|
70
|
+
order: 6,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
title: "Rising Star",
|
|
74
|
+
description: "Reach Level 5. You're no longer a beginner — complex tasks are now unlocked.",
|
|
75
|
+
quest_type: "default",
|
|
76
|
+
target_type: "agent",
|
|
77
|
+
category: "onboarding",
|
|
78
|
+
base_xp_reward: 30,
|
|
79
|
+
requirements: { type: "level", target: 5 },
|
|
80
|
+
safe_for_autonomous: true,
|
|
81
|
+
order: 7,
|
|
82
|
+
},
|
|
83
|
+
// ── Skill Development Track (unlocks at level 3) ───────────
|
|
84
|
+
{
|
|
85
|
+
title: "Code Warrior",
|
|
86
|
+
description: "Complete 5 coding tasks (Bug Fix, Feature Build, or Code Review).",
|
|
87
|
+
quest_type: "default",
|
|
88
|
+
target_type: "both",
|
|
89
|
+
category: "skill",
|
|
90
|
+
base_xp_reward: 25,
|
|
91
|
+
requirements: { type: "task_count", target: 5, filter: { task_types: ["Bug Fix", "Feature Build", "Code Review"] } },
|
|
92
|
+
min_user_level: 3,
|
|
93
|
+
safe_for_autonomous: true,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
title: "Wordsmith",
|
|
97
|
+
description: "Complete 5 writing tasks (Documentation, Email Draft, or Blog Post).",
|
|
98
|
+
quest_type: "default",
|
|
99
|
+
target_type: "both",
|
|
100
|
+
category: "skill",
|
|
101
|
+
base_xp_reward: 25,
|
|
102
|
+
requirements: { type: "task_count", target: 5, filter: { task_types: ["Process Documentation", "Email Draft", "Content Writing"] } },
|
|
103
|
+
min_user_level: 3,
|
|
104
|
+
safe_for_autonomous: true,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: "Researcher",
|
|
108
|
+
description: "Complete 3 research tasks (Research Report or Competitive Analysis).",
|
|
109
|
+
quest_type: "default",
|
|
110
|
+
target_type: "both",
|
|
111
|
+
category: "skill",
|
|
112
|
+
base_xp_reward: 20,
|
|
113
|
+
requirements: { type: "task_count", target: 3, filter: { task_types: ["Research Report", "Competitive Analysis"] } },
|
|
114
|
+
min_user_level: 3,
|
|
115
|
+
safe_for_autonomous: true,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
title: "Ops Master",
|
|
119
|
+
description: "Complete 3 infrastructure tasks (Deployment or Pipeline Build).",
|
|
120
|
+
quest_type: "default",
|
|
121
|
+
target_type: "both",
|
|
122
|
+
category: "skill",
|
|
123
|
+
base_xp_reward: 30,
|
|
124
|
+
requirements: { type: "task_count", target: 3, filter: { task_types: ["Deployment", "Pipeline Build"] } },
|
|
125
|
+
min_user_level: 3,
|
|
126
|
+
safe_for_autonomous: true,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
title: "Multi-Talented",
|
|
130
|
+
description: "Have 5+ skills on your agent at proficiency 2 or higher.",
|
|
131
|
+
quest_type: "default",
|
|
132
|
+
target_type: "agent",
|
|
133
|
+
category: "skill",
|
|
134
|
+
base_xp_reward: 25,
|
|
135
|
+
requirements: { type: "skill_proficiency_count", target: 5, filter: { min_proficiency: 2 } },
|
|
136
|
+
min_user_level: 3,
|
|
137
|
+
safe_for_autonomous: true,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
title: "Specialist",
|
|
141
|
+
description: "Reach proficiency 5 in any single skill. Deep expertise pays off.",
|
|
142
|
+
quest_type: "default",
|
|
143
|
+
target_type: "agent",
|
|
144
|
+
category: "skill",
|
|
145
|
+
base_xp_reward: 35,
|
|
146
|
+
requirements: { type: "skill_proficiency_max", target: 5 },
|
|
147
|
+
min_user_level: 3,
|
|
148
|
+
safe_for_autonomous: true,
|
|
149
|
+
},
|
|
150
|
+
// ── Automation Track (unlocks at level 5) ──────────────────
|
|
151
|
+
{
|
|
152
|
+
title: "Hands Off",
|
|
153
|
+
description: "Complete a task with agent_solo performer type. Let the agent fly solo.",
|
|
154
|
+
quest_type: "default",
|
|
155
|
+
target_type: "agent",
|
|
156
|
+
category: "automation",
|
|
157
|
+
base_xp_reward: 20,
|
|
158
|
+
requirements: { type: "performer_type", target: 1, filter: { performer_type: "agent_solo" } },
|
|
159
|
+
min_user_level: 5,
|
|
160
|
+
safe_for_autonomous: true,
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
title: "Dynamic Duo",
|
|
164
|
+
description: "Complete 10 tasks together as user_with_agent. Teamwork makes the dream work.",
|
|
165
|
+
quest_type: "default",
|
|
166
|
+
target_type: "both",
|
|
167
|
+
category: "automation",
|
|
168
|
+
base_xp_reward: 30,
|
|
169
|
+
requirements: { type: "performer_type", target: 10, filter: { performer_type: "user_with_agent" } },
|
|
170
|
+
min_user_level: 5,
|
|
171
|
+
safe_for_autonomous: true,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
title: "Orchestrator",
|
|
175
|
+
description: "Complete a task with orchestrated performer type involving multiple agents.",
|
|
176
|
+
quest_type: "default",
|
|
177
|
+
target_type: "both",
|
|
178
|
+
category: "automation",
|
|
179
|
+
base_xp_reward: 50,
|
|
180
|
+
requirements: { type: "performer_type", target: 1, filter: { performer_type: "orchestrated" } },
|
|
181
|
+
min_user_level: 5,
|
|
182
|
+
safe_for_autonomous: false,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
title: "Deployer",
|
|
186
|
+
description: "Complete a task with output_type 'deployed'. Ship something live.",
|
|
187
|
+
quest_type: "default",
|
|
188
|
+
target_type: "both",
|
|
189
|
+
category: "automation",
|
|
190
|
+
base_xp_reward: 40,
|
|
191
|
+
requirements: { type: "output_type", target: 1, filter: { output_type: "deployed" } },
|
|
192
|
+
min_user_level: 5,
|
|
193
|
+
safe_for_autonomous: true,
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
title: "Chain Reaction",
|
|
197
|
+
description: "Complete 3 different task types in a single day. Variety is the spice of XP.",
|
|
198
|
+
quest_type: "default",
|
|
199
|
+
target_type: "both",
|
|
200
|
+
category: "automation",
|
|
201
|
+
base_xp_reward: 25,
|
|
202
|
+
requirements: { type: "daily_task_diversity", target: 3 },
|
|
203
|
+
min_user_level: 5,
|
|
204
|
+
safe_for_autonomous: true,
|
|
205
|
+
},
|
|
206
|
+
// ── Weekly Challenges (recurring) ──────────────────────────
|
|
207
|
+
{
|
|
208
|
+
title: "Productive Week",
|
|
209
|
+
description: "Complete 5 tasks in 7 days. Consistency beats intensity.",
|
|
210
|
+
quest_type: "recurring",
|
|
211
|
+
target_type: "both",
|
|
212
|
+
category: "weekly",
|
|
213
|
+
base_xp_reward: 25,
|
|
214
|
+
requirements: { type: "task_count", target: 5, filter: { period: "week" } },
|
|
215
|
+
safe_for_autonomous: true,
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
title: "Skill Builder",
|
|
219
|
+
description: "Increase any skill proficiency by 1 level this week.",
|
|
220
|
+
quest_type: "recurring",
|
|
221
|
+
target_type: "agent",
|
|
222
|
+
category: "weekly",
|
|
223
|
+
base_xp_reward: 15,
|
|
224
|
+
requirements: { type: "skill_proficiency_gain", target: 1, filter: { period: "week" } },
|
|
225
|
+
safe_for_autonomous: true,
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
title: "Streak Keeper",
|
|
229
|
+
description: "Complete at least 1 task per day for 5 consecutive days.",
|
|
230
|
+
quest_type: "recurring",
|
|
231
|
+
target_type: "both",
|
|
232
|
+
category: "weekly",
|
|
233
|
+
base_xp_reward: 30,
|
|
234
|
+
requirements: { type: "streak", target: 5 },
|
|
235
|
+
safe_for_autonomous: true,
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
title: "Diversity Bonus",
|
|
239
|
+
description: "Complete 3 different task types this week. Breadth earns bonus XP.",
|
|
240
|
+
quest_type: "recurring",
|
|
241
|
+
target_type: "both",
|
|
242
|
+
category: "weekly",
|
|
243
|
+
base_xp_reward: 20,
|
|
244
|
+
requirements: { type: "weekly_task_diversity", target: 3 },
|
|
245
|
+
safe_for_autonomous: true,
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
title: "High Standards",
|
|
249
|
+
description: "Achieve an average quality score above 4.0 across all tasks this week.",
|
|
250
|
+
quest_type: "recurring",
|
|
251
|
+
target_type: "both",
|
|
252
|
+
category: "weekly",
|
|
253
|
+
base_xp_reward: 25,
|
|
254
|
+
requirements: { type: "quality_score_avg", target: 4.0, filter: { period: "week" } },
|
|
255
|
+
safe_for_autonomous: true,
|
|
256
|
+
},
|
|
257
|
+
// ── Achievement Quests (one-off milestones) ────────────────
|
|
258
|
+
{
|
|
259
|
+
title: "Century",
|
|
260
|
+
description: "Earn 100 total XP. Your first major milestone.",
|
|
261
|
+
quest_type: "one_off",
|
|
262
|
+
target_type: "both",
|
|
263
|
+
category: "achievement",
|
|
264
|
+
base_xp_reward: 10,
|
|
265
|
+
requirements: { type: "total_xp", target: 100 },
|
|
266
|
+
safe_for_autonomous: true,
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
title: "Rank D Achiever",
|
|
270
|
+
description: "Reach Rank D — Pathfinder. You're finding your way.",
|
|
271
|
+
quest_type: "one_off",
|
|
272
|
+
target_type: "agent",
|
|
273
|
+
category: "achievement",
|
|
274
|
+
base_xp_reward: 20,
|
|
275
|
+
requirements: { type: "rank", target: 1, filter: { rank: "D" } },
|
|
276
|
+
safe_for_autonomous: true,
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
title: "Rank C Achiever",
|
|
280
|
+
description: "Reach Rank C — Enlightened. Real expertise recognized.",
|
|
281
|
+
quest_type: "one_off",
|
|
282
|
+
target_type: "agent",
|
|
283
|
+
category: "achievement",
|
|
284
|
+
base_xp_reward: 40,
|
|
285
|
+
requirements: { type: "rank", target: 1, filter: { rank: "C" } },
|
|
286
|
+
safe_for_autonomous: true,
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
title: "Half Century Tasks",
|
|
290
|
+
description: "Complete 50 tasks total. Dedication pays off.",
|
|
291
|
+
quest_type: "one_off",
|
|
292
|
+
target_type: "both",
|
|
293
|
+
category: "achievement",
|
|
294
|
+
base_xp_reward: 30,
|
|
295
|
+
requirements: { type: "task_count", target: 50 },
|
|
296
|
+
safe_for_autonomous: true,
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
title: "Century Tasks",
|
|
300
|
+
description: "Complete 100 tasks total. You're a machine (or working with one).",
|
|
301
|
+
quest_type: "one_off",
|
|
302
|
+
target_type: "both",
|
|
303
|
+
category: "achievement",
|
|
304
|
+
base_xp_reward: 50,
|
|
305
|
+
requirements: { type: "task_count", target: 100 },
|
|
306
|
+
safe_for_autonomous: true,
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
title: "Integrity Champion",
|
|
310
|
+
description: "Maintain integrity score above 80 for 30 consecutive days.",
|
|
311
|
+
quest_type: "one_off",
|
|
312
|
+
target_type: "agent",
|
|
313
|
+
category: "achievement",
|
|
314
|
+
base_xp_reward: 40,
|
|
315
|
+
requirements: { type: "integrity_duration", target: 30, filter: { min_score: 80 } },
|
|
316
|
+
safe_for_autonomous: true,
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
title: "Community Builder",
|
|
320
|
+
description: "Have your work reviewed by another agent. Collaboration earns respect.",
|
|
321
|
+
quest_type: "one_off",
|
|
322
|
+
target_type: "both",
|
|
323
|
+
category: "achievement",
|
|
324
|
+
base_xp_reward: 25,
|
|
325
|
+
requirements: { type: "peer_review", target: 1 },
|
|
326
|
+
safe_for_autonomous: false,
|
|
327
|
+
},
|
|
328
|
+
// ── Exploration Quests (discover features) ─────────────────
|
|
329
|
+
{
|
|
330
|
+
title: "Growth Minded",
|
|
331
|
+
description: "Check your growth plan to see the path to the next rank.",
|
|
332
|
+
quest_type: "one_off",
|
|
333
|
+
target_type: "both",
|
|
334
|
+
category: "exploration",
|
|
335
|
+
base_xp_reward: 5,
|
|
336
|
+
requirements: { type: "tool_call", target: 1, filter: { tool: "levelup_get_growth_plan" } },
|
|
337
|
+
safe_for_autonomous: true,
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
title: "Skill Browser",
|
|
341
|
+
description: "Browse recommended skillsets for 3 or more ability categories.",
|
|
342
|
+
quest_type: "one_off",
|
|
343
|
+
target_type: "both",
|
|
344
|
+
category: "exploration",
|
|
345
|
+
base_xp_reward: 10,
|
|
346
|
+
requirements: { type: "tool_call", target: 3, filter: { tool: "levelup_browse_skillsets" } },
|
|
347
|
+
safe_for_autonomous: true,
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
title: "Leaderboard Climber",
|
|
351
|
+
description: "Check the leaderboard to see where you stand.",
|
|
352
|
+
quest_type: "one_off",
|
|
353
|
+
target_type: "both",
|
|
354
|
+
category: "exploration",
|
|
355
|
+
base_xp_reward: 5,
|
|
356
|
+
requirements: { type: "tool_call", target: 1, filter: { tool: "levelup_get_leaderboard" } },
|
|
357
|
+
safe_for_autonomous: true,
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
title: "Self Aware",
|
|
361
|
+
description: "Submit an agent self-evaluation after completing a task.",
|
|
362
|
+
quest_type: "one_off",
|
|
363
|
+
target_type: "agent",
|
|
364
|
+
category: "exploration",
|
|
365
|
+
base_xp_reward: 10,
|
|
366
|
+
requirements: { type: "tool_call", target: 1, filter: { tool: "levelup_submit_agent_evaluation" } },
|
|
367
|
+
safe_for_autonomous: true,
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
title: "Profile Complete",
|
|
371
|
+
description: "Set a vanity handle and link an identity to your profile.",
|
|
372
|
+
quest_type: "one_off",
|
|
373
|
+
target_type: "user",
|
|
374
|
+
category: "exploration",
|
|
375
|
+
base_xp_reward: 10,
|
|
376
|
+
requirements: { type: "profile_complete", target: 1 },
|
|
377
|
+
safe_for_autonomous: true,
|
|
378
|
+
},
|
|
379
|
+
];
|
|
380
|
+
//# sourceMappingURL=quest-seeds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quest-seeds.js","sourceRoot":"","sources":["../../src/data/quest-seeds.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,kDAAkD;AAClD,+DAA+D;AAmB/D,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,8DAA8D;IAC9D;QACE,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,sBAAsB;QACnC,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,YAAY;QACtB,cAAc,EAAE,CAAC;QACjB,YAAY,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,EAAE;QACjD,mBAAmB,EAAE,IAAI;QACzB,KAAK,EAAE,CAAC;KACT;IACD;QACE,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,oFAAoF;QACjG,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,MAAM;QAC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,0DAA0D;QACvE,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,aAAa;QACvB,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,iCAAiC,EAAE,EAAE;QACnG,mBAAmB,EAAE,IAAI;KAC1B;IACD;QACE,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,2DAA2D;QACxE,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,aAAa;QACvB,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,EAAE;QACrD,mBAAmB,EAAE,IAAI;KAC1B;CACF,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// ============================================================
|
|
3
|
+
// index.ts — Main entry point for the Level-Up MCP server
|
|
4
|
+
// ============================================================
|
|
5
|
+
// This is the file that runs when you start the server. It:
|
|
6
|
+
// 1. Validates environment variables
|
|
7
|
+
// 2. Creates the MCP server instance
|
|
8
|
+
// 3. Registers all tools (from each section)
|
|
9
|
+
// 4. Connects to a transport (stdio or HTTP)
|
|
10
|
+
//
|
|
11
|
+
// HOW TO RUN:
|
|
12
|
+
// # Build first (TypeScript → JavaScript)
|
|
13
|
+
// npm run build
|
|
14
|
+
//
|
|
15
|
+
// # Run with stdio transport (for local testing, Claude Desktop, etc.)
|
|
16
|
+
// SUPABASE_URL=... SUPABASE_SERVICE_KEY=... npm start
|
|
17
|
+
//
|
|
18
|
+
// # Run with HTTP transport (for remote access)
|
|
19
|
+
// SUPABASE_URL=... SUPABASE_SERVICE_KEY=... TRANSPORT=http npm run start:http
|
|
20
|
+
//
|
|
21
|
+
// WHAT ARE TRANSPORTS?
|
|
22
|
+
// Transports are how the MCP server communicates with clients.
|
|
23
|
+
//
|
|
24
|
+
// stdio (Standard Input/Output):
|
|
25
|
+
// - The server reads messages from stdin and writes to stdout
|
|
26
|
+
// - Used when the server runs as a subprocess (e.g., Claude Desktop
|
|
27
|
+
// launches it and pipes messages back and forth)
|
|
28
|
+
// - Simple, no network needed, great for local development
|
|
29
|
+
//
|
|
30
|
+
// HTTP (Streamable HTTP):
|
|
31
|
+
// - The server listens on a port and accepts HTTP POST requests
|
|
32
|
+
// - Used when the server runs remotely (e.g., on a VPS)
|
|
33
|
+
// - Clients send JSON-RPC over HTTP, server responds
|
|
34
|
+
// ============================================================
|
|
35
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
36
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
37
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
38
|
+
import express from "express";
|
|
39
|
+
import { SERVER_NAME, SERVER_VERSION } from "./constants.js";
|
|
40
|
+
import { validateEnv, supabase } from "./services/supabase.js";
|
|
41
|
+
// Legacy tool registration (75 individual tools)
|
|
42
|
+
import { registerUserTools } from "./tools/users.js";
|
|
43
|
+
import { registerAgentTools } from "./tools/agents.js";
|
|
44
|
+
import { registerSkillTools } from "./tools/skills.js";
|
|
45
|
+
import { registerTaskTools } from "./tools/tasks.js";
|
|
46
|
+
import { registerXpTools } from "./tools/xp.js";
|
|
47
|
+
import { registerLeaderboardTools } from "./tools/leaderboards.js";
|
|
48
|
+
import { registerLevelingTools } from "./tools/leveling.js";
|
|
49
|
+
import { registerAchievementTools } from "./tools/achievements.js";
|
|
50
|
+
import { registerRatingTools } from "./tools/ratings.js";
|
|
51
|
+
import { registerMetricsTools } from "./tools/metrics.js";
|
|
52
|
+
import { registerQuestTools } from "./tools/quests.js";
|
|
53
|
+
import { registerAdminTools } from "./tools/admin.js";
|
|
54
|
+
import { registerSystemTools } from "./tools/system.js";
|
|
55
|
+
import { registerGrowthPlanTools } from "./tools/growth-plan.js";
|
|
56
|
+
import { registerBootstrapTools } from "./tools/bootstrap.js";
|
|
57
|
+
// Category dispatchers (8 tools replacing 75 — 93% token reduction)
|
|
58
|
+
import { registerSessionDispatcher } from "./tools/dispatchers/session.js";
|
|
59
|
+
import { registerTasksDispatcher } from "./tools/dispatchers/tasks.js";
|
|
60
|
+
import { registerSkillsDispatcher } from "./tools/dispatchers/skills.js";
|
|
61
|
+
import { registerUsersDispatcher } from "./tools/dispatchers/users.js";
|
|
62
|
+
import { registerXpDispatcher } from "./tools/dispatchers/xp.js";
|
|
63
|
+
import { registerEvalDispatcher } from "./tools/dispatchers/eval.js";
|
|
64
|
+
import { registerAdminDispatcher } from "./tools/dispatchers/admin.js";
|
|
65
|
+
import { registerQuestsDispatcher } from "./tools/dispatchers/quests.js";
|
|
66
|
+
// ---------- Step 1: Validate environment ----------
|
|
67
|
+
validateEnv();
|
|
68
|
+
// Log identity env vars for debugging
|
|
69
|
+
if (process.env.LEVELUP_USER_ID) {
|
|
70
|
+
console.error(` ✅ LEVELUP_USER_ID: ${process.env.LEVELUP_USER_ID.slice(0, 8)}...`);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
console.error(" ℹ️ LEVELUP_USER_ID 未设置(whoami 将需要手动识别身份)");
|
|
74
|
+
}
|
|
75
|
+
if (process.env.LEVELUP_AGENT_ID) {
|
|
76
|
+
console.error(` ✅ LEVELUP_AGENT_ID: ${process.env.LEVELUP_AGENT_ID.slice(0, 8)}...`);
|
|
77
|
+
}
|
|
78
|
+
// ---------- Step 2: Create the MCP server ----------
|
|
79
|
+
// McpServer is the core class from the MCP SDK. It manages
|
|
80
|
+
// tool registration, message routing, and protocol handling.
|
|
81
|
+
const server = new McpServer({
|
|
82
|
+
name: SERVER_NAME,
|
|
83
|
+
version: SERVER_VERSION,
|
|
84
|
+
});
|
|
85
|
+
// ---------- Step 3: Register all tools ----------
|
|
86
|
+
console.error(`\n🎮 升级 MCP 服务器 v${SERVER_VERSION}`);
|
|
87
|
+
console.error(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);
|
|
88
|
+
// Tool mode: "compact" (8 dispatchers, ~800 tokens) or "legacy" (75 tools, ~10,800 tokens)
|
|
89
|
+
// Set LEVELUP_TOOL_MODE=legacy to use individual tools (backward compat)
|
|
90
|
+
const toolMode = process.env.LEVELUP_TOOL_MODE || "compact";
|
|
91
|
+
if (toolMode === "legacy") {
|
|
92
|
+
console.error(`\n ⚙️ 工具模式:传统模式(75个独立工具)`);
|
|
93
|
+
registerUserTools(server);
|
|
94
|
+
registerAgentTools(server);
|
|
95
|
+
registerSkillTools(server);
|
|
96
|
+
registerTaskTools(server);
|
|
97
|
+
registerRatingTools(server);
|
|
98
|
+
if (process.env.LEVELUP_QUESTS_ENABLED !== "false") {
|
|
99
|
+
registerQuestTools(server);
|
|
100
|
+
}
|
|
101
|
+
registerMetricsTools(server);
|
|
102
|
+
registerXpTools(server);
|
|
103
|
+
registerLeaderboardTools(server);
|
|
104
|
+
registerLevelingTools(server);
|
|
105
|
+
registerAchievementTools(server);
|
|
106
|
+
registerAdminTools(server);
|
|
107
|
+
registerSystemTools(server);
|
|
108
|
+
registerGrowthPlanTools(server);
|
|
109
|
+
registerBootstrapTools(server);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
console.error(`\n ⚡ 工具模式:精简模式(8个分类调度器)`);
|
|
113
|
+
registerSessionDispatcher(server);
|
|
114
|
+
registerTasksDispatcher(server);
|
|
115
|
+
registerSkillsDispatcher(server);
|
|
116
|
+
registerUsersDispatcher(server);
|
|
117
|
+
registerXpDispatcher(server);
|
|
118
|
+
registerEvalDispatcher(server);
|
|
119
|
+
registerAdminDispatcher(server);
|
|
120
|
+
if (process.env.LEVELUP_QUESTS_ENABLED !== "false") {
|
|
121
|
+
registerQuestsDispatcher(server);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
console.error(`\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);
|
|
125
|
+
// ---------- Step 3.5: MCP Prompts (auto-announce) ----------
|
|
126
|
+
server.prompt("levelup-start", "开始您的 升级会话 — 加载个人资料、同步MCP服务器并检查待处理操作。", () => ({
|
|
127
|
+
messages: [
|
|
128
|
+
{
|
|
129
|
+
role: "user",
|
|
130
|
+
content: {
|
|
131
|
+
type: "text",
|
|
132
|
+
text: `开始我的 升级会话。调用 levelup_bootstrap 加载我的个人资料和会话状态。然后执行响应中的所有 auto_actions(报告已安装的MCP、检查待处理安装)。`,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
}));
|
|
137
|
+
console.error(` 📋 MCP 提示词 "levelup-start" 已注册`);
|
|
138
|
+
// ---------- Step 3.6: Validate xp_config entries ----------
|
|
139
|
+
const REQUIRED_XP_CONFIG_KEYS = [
|
|
140
|
+
"task_cooldown_base_minutes",
|
|
141
|
+
"failed_task_xp_pct",
|
|
142
|
+
"agent_star_cooldown_hours",
|
|
143
|
+
"evidence_xp_multiplier",
|
|
144
|
+
];
|
|
145
|
+
(async () => {
|
|
146
|
+
try {
|
|
147
|
+
const { data: configs } = await supabase
|
|
148
|
+
.from("xp_config").select("config_key")
|
|
149
|
+
.in("config_key", REQUIRED_XP_CONFIG_KEYS);
|
|
150
|
+
const foundKeys = new Set((configs || []).map((c) => c.config_key));
|
|
151
|
+
const missing = REQUIRED_XP_CONFIG_KEYS.filter((k) => !foundKeys.has(k));
|
|
152
|
+
if (missing.length > 0) {
|
|
153
|
+
console.error(`\n⚠️ 缺少 xp_config 条目(相关功能将使用默认值):`);
|
|
154
|
+
for (const key of missing) {
|
|
155
|
+
console.error(` - ${key}`);
|
|
156
|
+
}
|
|
157
|
+
console.error(` 请在 xp_config 表中添加这些条目以获得完整功能。\n`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
console.error(`⚠️ 无法验证 xp_config 表(数据库可能无法访问)。`);
|
|
162
|
+
}
|
|
163
|
+
})();
|
|
164
|
+
// ---------- Step 4: Connect transport ----------
|
|
165
|
+
/**
|
|
166
|
+
* Run in stdio mode (default).
|
|
167
|
+
*
|
|
168
|
+
* The server communicates via standard input/output streams.
|
|
169
|
+
* This is what Claude Desktop and other local MCP clients use.
|
|
170
|
+
*/
|
|
171
|
+
async function runStdio() {
|
|
172
|
+
console.error(`\n🔌 传输方式:stdio`);
|
|
173
|
+
console.error(` 已准备就绪,等待 stdin/stdout 连接\n`);
|
|
174
|
+
const transport = new StdioServerTransport();
|
|
175
|
+
await server.connect(transport);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Run in HTTP mode.
|
|
179
|
+
*
|
|
180
|
+
* The server starts an Express web server and listens for
|
|
181
|
+
* MCP messages as HTTP POST requests to /mcp.
|
|
182
|
+
*
|
|
183
|
+
* StreamableHTTPServerTransport options:
|
|
184
|
+
* - sessionIdGenerator: undefined → stateless (each request
|
|
185
|
+
* is independent, which is simpler and scales better)
|
|
186
|
+
* - enableJsonResponse: true → respond with JSON instead of
|
|
187
|
+
* streaming (simpler for most clients)
|
|
188
|
+
*/
|
|
189
|
+
async function runHTTP() {
|
|
190
|
+
const app = express();
|
|
191
|
+
app.use(express.json());
|
|
192
|
+
// Security headers
|
|
193
|
+
app.use((_req, res, next) => {
|
|
194
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
195
|
+
res.setHeader("X-Frame-Options", "DENY");
|
|
196
|
+
res.setHeader("Referrer-Policy", "no-referrer");
|
|
197
|
+
next();
|
|
198
|
+
});
|
|
199
|
+
// CORS — restrict to configured origin (or localhost in dev)
|
|
200
|
+
const allowedOrigin = process.env.CORS_ORIGIN || "http://localhost:3000";
|
|
201
|
+
app.use((req, res, next) => {
|
|
202
|
+
const origin = req.headers.origin;
|
|
203
|
+
if (origin === allowedOrigin) {
|
|
204
|
+
res.setHeader("Access-Control-Allow-Origin", origin);
|
|
205
|
+
res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
|
206
|
+
res.setHeader("Access-Control-Allow-Headers", "Content-Type, Accept");
|
|
207
|
+
}
|
|
208
|
+
if (req.method === "OPTIONS") {
|
|
209
|
+
res.sendStatus(204);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
next();
|
|
213
|
+
});
|
|
214
|
+
// Health check endpoint — useful for monitoring
|
|
215
|
+
app.get("/health", (_req, res) => {
|
|
216
|
+
res.json({
|
|
217
|
+
status: "ok",
|
|
218
|
+
server: SERVER_NAME,
|
|
219
|
+
version: SERVER_VERSION,
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
// MCP endpoint — this is where clients send tool calls
|
|
223
|
+
app.post("/mcp", async (req, res) => {
|
|
224
|
+
// Create a fresh transport for each request (stateless)
|
|
225
|
+
const transport = new StreamableHTTPServerTransport({
|
|
226
|
+
sessionIdGenerator: undefined,
|
|
227
|
+
enableJsonResponse: true,
|
|
228
|
+
});
|
|
229
|
+
// Clean up when the connection closes
|
|
230
|
+
res.on("close", () => transport.close());
|
|
231
|
+
// Connect this transport to our server and handle the request
|
|
232
|
+
await server.connect(transport);
|
|
233
|
+
await transport.handleRequest(req, res, req.body);
|
|
234
|
+
});
|
|
235
|
+
const port = parseInt(process.env.PORT || "3000", 10);
|
|
236
|
+
if (isNaN(port) || port < 1 || port > 65535) {
|
|
237
|
+
console.error(`❌ 无效端口:"${process.env.PORT}"。必须是 1 到 65535 之间的数字。`);
|
|
238
|
+
process.exit(1);
|
|
239
|
+
}
|
|
240
|
+
app.listen(port, () => {
|
|
241
|
+
console.error(`\n🔌 传输方式:HTTP`);
|
|
242
|
+
console.error(` MCP 接口:http://localhost:${port}/mcp`);
|
|
243
|
+
console.error(` 健康检查:http://localhost:${port}/health\n`);
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
// ---------- Choose transport and start ----------
|
|
247
|
+
const transport = process.env.TRANSPORT || "stdio";
|
|
248
|
+
if (transport === "http") {
|
|
249
|
+
runHTTP().catch((error) => {
|
|
250
|
+
console.error("❌ HTTP 服务器错误:", error);
|
|
251
|
+
process.exit(1);
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
runStdio().catch((error) => {
|
|
256
|
+
console.error("❌ stdio 服务器错误:", error);
|
|
257
|
+
process.exit(1);
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=index.js.map
|