getcompetitive 4.6.0 → 6.0.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/README.md +22 -62
- package/dist/prompts.js +19 -19
- package/dist/prompts.js.map +1 -1
- package/dist/server.js +2 -24
- package/dist/server.js.map +1 -1
- package/dist/tools/compound.js +181 -0
- package/dist/tools/compound.js.map +1 -0
- package/dist/tools/levels.js +158 -0
- package/dist/tools/levels.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,8 +17,8 @@ Smogon-tier and archetype surface that used to sit alongside it is gone.
|
|
|
17
17
|
|
|
18
18
|
## What it provides
|
|
19
19
|
|
|
20
|
-
- **
|
|
21
|
-
- **Six workflow prompts** — `/team-doctor`, `/matchup-prep`, `/build-around`, `/tournament-prep`, `/learn-my-team`, `/meta-report` — server-provided templates that chain the
|
|
20
|
+
- **8 compound tools**: `lookup`, `calculate`, `analyze_team`, `optimize_team`, `prepare_matchup`, `analyze_battle`, `analyze_meta`, `team_io` — intent-level entrypoints that dispatch on a `mode`, so the model picks an intent and the server does the orchestration
|
|
21
|
+
- **Six workflow prompts** — `/team-doctor`, `/matchup-prep`, `/build-around`, `/tournament-prep`, `/learn-my-team`, `/meta-report` — server-provided templates that chain the eight tools, so compound workflows stay discoverable without widening the surface
|
|
22
22
|
- **Structured, agent-first definitions** — every tool declares MCP annotations and an output schema, returns `structuredContent` alongside JSON text, and documents all of its parameters; the deterministic half of the [TDQS](https://tdqs.dev) checklist is linted in CI
|
|
23
23
|
- Full **Pokémon Showdown** dataset — species, alternate forms, stats, moves, items, abilities, natures, learnsets, types
|
|
24
24
|
- **Battle math** from Smogon's calculator — stat calculation and full damage calculation (weather, terrain, boosts, items)
|
|
@@ -30,59 +30,18 @@ Built on [`@pkmn/dex`](https://github.com/pkmn/EPOKe) (Showdown data) and
|
|
|
30
30
|
|
|
31
31
|
## Tools
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
| Tool | Purpose |
|
|
35
|
-
| --- | --- |
|
|
36
|
-
| `get_pokemon` | Types, base stats, BST, abilities, forms, weight, gender, evolutions |
|
|
37
|
-
| `list_forms` | All forms of a species (alternate, cosmetic, battle-only) |
|
|
38
|
-
| `get_sprites` | Sprite URLs for a whole team in one call (artwork or icon), from a committed PokéAPI id table — URLs only, the server does no network I/O |
|
|
39
|
-
| `search_dex` | Fuzzy name search across species / moves / items / abilities / natures |
|
|
40
|
-
| `get_move` | Type, category, power, accuracy, PP, priority, target, secondary effects |
|
|
41
|
-
| `get_item` | Effect, flags, mega stone, Z-move, Fling, boosts |
|
|
42
|
-
| `get_ability` | Effect description, flags |
|
|
43
|
-
| `get_nature` | Boosts / lowers which stat |
|
|
44
|
-
| `get_learnset` | All learnable moves grouped by method (level-up, TM, egg, tutor, event) |
|
|
45
|
-
| `get_type` | Defensive weaknesses, resistances, immunities |
|
|
46
|
-
| `get_type_matchup` | Matchup multiplier, offensive coverage, or defensive chart (defender can be a species) |
|
|
47
|
-
|
|
48
|
-
### Team analysis
|
|
49
|
-
| Tool | Purpose |
|
|
50
|
-
| --- | --- |
|
|
51
|
-
| `analyze_team` | Team synergy: stacked defensive weaknesses, offensive coverage gaps, speed placement, a heuristic score, and — with a regulation — coverage against the meta's real sets, with battle-math `answerClass` verdicts from the shared MatchupEvaluator |
|
|
52
|
-
|
|
53
|
-
### Team workflows
|
|
54
|
-
| Tool | Purpose |
|
|
55
|
-
| --- | --- |
|
|
56
|
-
| `parse_team` | Turn a Showdown/Pokepaste block (or a `species @ item \| ability \| nature \| EVs \| moves` one-liner) into the canonical team every tool takes; unknown names become warnings, not errors |
|
|
57
|
-
| `format_team` | Render a canonical team back into paste text, round-tripping through `parse_team` |
|
|
58
|
-
| `diagnose_team` | "Fix my team": weaknesses with evidence — battle-math matchup verdicts included when sets are known — then concrete spread, move, item and member changes, each backed by exact math or usage data |
|
|
59
|
-
| `prepare_matchup` | "Prepare me": their likely sets by usage, speed races with margins, key damage rolls, an exhaustively scored bring-four with alternates, scored lead pairings, and win/loss conditions |
|
|
60
|
-
| `analyze_replay` | Post-match read of a battle log: teams, KOs with causes, observed Speed order, damage percentages, and a type-coverage read |
|
|
61
|
-
| `infer_set` | Reverse constraint solving: battle observations (who moved first, damage dealt/taken) narrow the opponent's likely set, ranked against the meta |
|
|
62
|
-
| `optimize_team` | Fill open team slots against constraints — cover these types, answer these threats — with reasons for every recommendation |
|
|
63
|
-
|
|
64
|
-
### Meta (usage-derived)
|
|
65
|
-
| Tool | Purpose |
|
|
66
|
-
| --- | --- |
|
|
67
|
-
| `list_threats` | Most-used Pokemon of a regulation, ranked by measured usage (role, tier, usage share) with the sample and sources behind it |
|
|
68
|
-
| `compare_meta` | What is changing: last 7 days of usage vs the 7 before, per species and per two-species core, from a committed build-time aggregation |
|
|
69
|
-
| `get_set` | Most-played set for one or several species (item, ability, nature, EVs, 4 moves), with the Mega form and ability where relevant; covers each regulation's ranked species, which `list_threats` lists |
|
|
70
|
-
|
|
71
|
-
### Regulations (Pokémon Champions / VGC)
|
|
72
|
-
| Tool | Purpose |
|
|
73
|
-
| --- | --- |
|
|
74
|
-
| `list_regulations` | Official Regulation Sets with dates, status, roster size, and how many species have usage-derived sets |
|
|
75
|
-
| `get_regulation` | Full set rules: battle rules, clauses, Mega rules, and roster sizes; the name rosters come back with `includeRoster` |
|
|
76
|
-
| `check_legality` | Validate a team against a set: illegal species, Species/Item Clause, illegal moves, team size, Mega eligibility |
|
|
33
|
+
Eight compound tools; each dispatches on a `mode` field where the name alone is ambiguous, and each accepts `detail: "compact" | "evidence" | "debug"` — compact by default, so responses carry conclusions and the numbers needed to reason, and you ask for ranges, benchmarks and provenance only when the reasoning needs them.
|
|
77
34
|
|
|
78
|
-
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
35
|
+
| Tool | Purpose | Modes |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| `lookup` | One data lookup | species, forms, search, move, item, ability, nature, learnset, type, matchup, sprites |
|
|
38
|
+
| `calculate` | One battle calc | stats, damage, matchups, speed, optimize_evs |
|
|
39
|
+
| `analyze_team` | Team analysis | synergy, diagnose |
|
|
40
|
+
| `optimize_team` | Fill open team slots against constraints | — |
|
|
41
|
+
| `prepare_matchup` | Pre-game dossier: likely sets, speed races, damage rolls, exhaustive bring-four with alternates, scored leads, win/loss conditions | — |
|
|
42
|
+
| `analyze_battle` | Post-game and scouting | replay, infer |
|
|
43
|
+
| `analyze_meta` | The meta, measured | threats, compare, set |
|
|
44
|
+
| `team_io` | Team import/export and validation | parse, format, legality, regulation, regulations |
|
|
86
45
|
|
|
87
46
|
## Install
|
|
88
47
|
|
|
@@ -179,14 +138,15 @@ npm test # builds and drives every tool over real MCP stdio, plus the HTTP ent
|
|
|
179
138
|
|
|
180
139
|
## Example queries
|
|
181
140
|
|
|
182
|
-
- `
|
|
183
|
-
- `
|
|
184
|
-
- `
|
|
185
|
-
- `
|
|
186
|
-
- `
|
|
187
|
-
- `analyze_team` `{ "team": [ { "species": "Garchomp", "moves": ["Earthquake", "Dragon Claw", "Rock Slide"] } ], "regulation": "m-c" }`
|
|
188
|
-
- `
|
|
189
|
-
- `
|
|
141
|
+
- `lookup` `{ "mode": "species", "species": "Ogerpon-Wellspring" }`
|
|
142
|
+
- `lookup` `{ "mode": "matchup", "attacker": "Ice", "defender": "Garchomp" }` → 4x super effective
|
|
143
|
+
- `calculate` `{ "mode": "stats", "species": "Garchomp", "level": 50, "nature": "Jolly", "evs": { "atk": 252, "spe": 252 } }`
|
|
144
|
+
- `calculate` `{ "mode": "damage", "attacker": { "species": "Garchomp", "level": 50, "nature": "Jolly", "evs": { "atk": 252, "spe": 252 }, "item": "Choice Band" }, "defender": { "species": "Corviknight", "level": 50, "nature": "Impish", "evs": { "hp": 252, "def": 252 } }, "move": "Dragon Claw" }`
|
|
145
|
+
- `team_io` `{ "mode": "legality", "regulation": "m-c", "team": [ { "species": "Garchomp", "item": "Choice Band" } ] }`
|
|
146
|
+
- `analyze_team` `{ "mode": "synergy", "team": [ { "species": "Garchomp", "moves": ["Earthquake", "Dragon Claw", "Rock Slide"] } ], "regulation": "m-c" }`
|
|
147
|
+
- `analyze_team` `{ "mode": "synergy", "team": [...], "regulation": "m-c", "detail": "evidence" }` → adds the per-type tables; `"debug"` adds the `engine` provenance block
|
|
148
|
+
- `team_io` `{ "mode": "parse", "text": "Garchomp @ Choice Scarf | Rough Skin | Jolly | 252 Atk / 252 Spe | Earthquake / Dragon Claw" }`
|
|
149
|
+
- `analyze_team` `{ "mode": "diagnose", "team": [ { "species": "Garchomp", "nature": "Jolly", "evs": { "atk": 252, "spe": 252 } } ], "goal": "improve against the current meta" }`
|
|
190
150
|
- `prepare_matchup` `{ "team": [ { "species": "Garchomp" } ], "opponent": ["Sneasler", "Salamence-Mega", "Gholdengo"] }`
|
|
191
151
|
|
|
192
152
|
## Data freshness
|
package/dist/prompts.js
CHANGED
|
@@ -15,7 +15,7 @@ const teamArg = z
|
|
|
15
15
|
.string()
|
|
16
16
|
.optional()
|
|
17
17
|
.describe('The team as paste text (Showdown format, or plain lines); omitted, the workflow asks for it.');
|
|
18
|
-
const goalArg = z.string().optional().describe('What the player wants out of the change, carried into
|
|
18
|
+
const goalArg = z.string().optional().describe('What the player wants out of the change, carried into analyze_team mode "diagnose".');
|
|
19
19
|
export function registerPrompts(server) {
|
|
20
20
|
server.registerPrompt('team-doctor', {
|
|
21
21
|
title: 'Team Doctor',
|
|
@@ -32,10 +32,10 @@ export function registerPrompts(server) {
|
|
|
32
32
|
${args.team ? `Their team (paste text):\n\n${args.team}\n` : 'Ask the user to paste their team first.'}
|
|
33
33
|
|
|
34
34
|
Then, in order:
|
|
35
|
-
1. Run
|
|
36
|
-
2. Run
|
|
37
|
-
3. Walk through the problems with their evidence, then the candidate changes with their math. Say plainly which changes are exact (spread, move) and which are typing-only heuristics (member swaps) —
|
|
38
|
-
4. If you propose a changed team, run
|
|
35
|
+
1. Run team_io with mode "parse" on the paste (with the regulation) and surface every warning it returns — a name that did not resolve is a fixable typo, not a dead end.
|
|
36
|
+
2. Run analyze_team with mode "synergy" with mode "diagnose" on the parsed team, passing the goal and any members the user wants kept.
|
|
37
|
+
3. Walk through the problems with their evidence, then the candidate changes with their math. Say plainly which changes are exact (spread, move) and which are typing-only heuristics (member swaps) — analyze_team with mode "synergy" with mode "diagnose" labels the confidence, repeat it.
|
|
38
|
+
4. If you propose a changed team, run team_io with mode "format" on it so the user can copy the paste straight into the game.
|
|
39
39
|
|
|
40
40
|
Every claim must come from the tools\u2019 output. You explain; getcompetitive proves.`,
|
|
41
41
|
},
|
|
@@ -64,7 +64,7 @@ ${args.team ? `Their team:\n\n${args.team}\n` : 'Ask the user for their team fir
|
|
|
64
64
|
${args.opponent ? `What they know about the opponent:\n\n${args.opponent}\n` : 'Ask the user what they know about the opponent (species at minimum).'}
|
|
65
65
|
|
|
66
66
|
Then, in order:
|
|
67
|
-
1.
|
|
67
|
+
1. team_io with mode "parse" on any paste text. If the opponent is just species names, that is fine — pass them to prepare_matchup as the opponent array; it estimates what it cannot know and says so.
|
|
68
68
|
2. Run prepare_matchup with the team, the opponent, and ${args.regulation ?? 'the current regulation'}.
|
|
69
69
|
3. Deliver the dossier in plain language: their likely sets ordered by usage, the speed races that matter, the key damage rolls (quote the description lines), the recommended bring-four and why, leads to open with and watch for, win/loss conditions, and which of the user\u2019s members to preserve.
|
|
70
70
|
4. End with the matchupConfidence read and what it can and cannot see.
|
|
@@ -93,10 +93,10 @@ Every number comes from prepare_matchup\u2019s output — you explain; getcompet
|
|
|
93
93
|
text: `Act as a Pokémon Champions teambuilder. Build a team around ${args.core ?? 'the species the user names (ask them first)'} for ${args.regulation ?? 'the current regulation set'}.
|
|
94
94
|
|
|
95
95
|
Workflow:
|
|
96
|
-
1.
|
|
97
|
-
2. Run analyze_team on the partial team to see the defensive weaknesses and the types nothing hits super-effectively — those are the gaps the remaining slots must fill.
|
|
98
|
-
3. Run
|
|
99
|
-
4. Assemble six members, run
|
|
96
|
+
1. analyze_meta with mode "set" on the core species (batched if several) so the core is built from what the meta actually plays.
|
|
97
|
+
2. Run analyze_team with mode "synergy" on the partial team to see the defensive weaknesses and the types nothing hits super-effectively — those are the gaps the remaining slots must fill.
|
|
98
|
+
3. Run analyze_team with mode "diagnose" on the partial team and mine its candidate changes (member swaps and move changes) for gap-filling partners; prefer partners the meta has usage data for (analyze_meta with mode "threats"), and say when a pick is typing-only.
|
|
99
|
+
4. Assemble six members, run team_io with mode "legality" against the regulation, then team_io with mode "format" the finished squad so the user can paste it.
|
|
100
100
|
|
|
101
101
|
Explain each pick with its evidence (coverage, speed, or usage). You design; getcompetitive proves the picks.`,
|
|
102
102
|
},
|
|
@@ -116,11 +116,11 @@ Explain each pick with its evidence (coverage, speed, or usage). You design; get
|
|
|
116
116
|
text: `Act as a Pokémon Champions tournament coach. Prepare the user for an event under ${args.regulation ?? 'the current regulation set'}.
|
|
117
117
|
|
|
118
118
|
Workflow:
|
|
119
|
-
1.
|
|
120
|
-
2.
|
|
119
|
+
1. team_io with mode "regulation" for the rules that shape the format: clauses, timers, bring 4 of 6, Mega rules. (Skip includeRoster unless a full legal list is actually wanted.)
|
|
120
|
+
2. analyze_meta with mode "threats" for the regulation and analyze_meta with mode "set" (batched) on the top threats so their real sets are in front of you.
|
|
121
121
|
3. Produce a tournament-prep briefing: the meta snapshot (top threats with usage, tier bands), what each top threat does, and a preparation checklist — answers for the top threats, a speed plan, and a bring-four habit.
|
|
122
122
|
|
|
123
|
-
Numbers only from the tools; the sample size and sourceAsOf from
|
|
123
|
+
Numbers only from the tools; the sample size and sourceAsOf from analyze_meta with mode "threats" are part of the briefing, not an afterthought.`,
|
|
124
124
|
},
|
|
125
125
|
},
|
|
126
126
|
],
|
|
@@ -139,10 +139,10 @@ Numbers only from the tools; the sample size and sourceAsOf from list_threats ar
|
|
|
139
139
|
${args.team ? `Their team:\n\n${args.team}\n` : 'Ask the user to paste their team first.'}
|
|
140
140
|
|
|
141
141
|
Workflow:
|
|
142
|
-
1.
|
|
143
|
-
2. analyze_team for the synergy read: stacked weaknesses, coverage gaps, speed placement, and the score.
|
|
144
|
-
3.
|
|
145
|
-
4. For each member:
|
|
142
|
+
1. team_io with mode "parse" on the paste.
|
|
143
|
+
2. analyze_team with mode "synergy" for the synergy read: stacked weaknesses, coverage gaps, speed placement, and the score.
|
|
144
|
+
3. analyze_team with mode "synergy" with mode "diagnose" for what it would change, so the guide includes the holes.
|
|
145
|
+
4. For each member: analyze_meta with mode "set" if the species is ranked (batched across the team), else lookup with mode "species" plus lookup with mode "learnset" highlights.
|
|
146
146
|
|
|
147
147
|
Deliver a team guide: each member\u2019s role, the pairs and synergies between them, the holes a future change should fill, and a one-paragraph game plan. Every factual claim cites a tool\u2019s output.`,
|
|
148
148
|
},
|
|
@@ -162,8 +162,8 @@ Deliver a team guide: each member\u2019s role, the pairs and synergies between t
|
|
|
162
162
|
text: `Act as a Pokémon Champions metagame reporter. Produce the meta report for ${args.regulation ?? 'the current regulation set'}.
|
|
163
163
|
|
|
164
164
|
Workflow:
|
|
165
|
-
1.
|
|
166
|
-
2.
|
|
165
|
+
1. analyze_meta with mode "threats" for the usage ranking, tiers and the sample behind it.
|
|
166
|
+
2. analyze_meta with mode "set" (batched) on the top five threats for their real sets.
|
|
167
167
|
3. Write the report: the tier bands with usage shares, each top threat\u2019s standard set and what it does, and a closing read of what the meta rewards. State the list\u2019s sourceAsOf and sample size so the reader knows how current the numbers are.
|
|
168
168
|
|
|
169
169
|
The report is data journalism: every figure quoted comes from the tools, and the data date travels with it.`,
|
package/dist/prompts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,aAAa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E;KAC1C,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACf,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,6EACJ,IAAI,CAAC,UAAU,IAAI,4BACrB;;;;;;;4GAOgG;iBACjG;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -5,37 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { readFileSync } from 'node:fs';
|
|
7
7
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
8
|
-
import { registerDataTools } from './tools/data.js';
|
|
9
|
-
import { registerCalcTools } from './tools/calc.js';
|
|
10
|
-
import { registerRegulationTools } from './tools/regulations.js';
|
|
11
|
-
import { registerAnalyzeTools } from './tools/analyze.js';
|
|
12
|
-
import { registerMetaTools } from './tools/meta.js';
|
|
13
|
-
import { registerTeamTools } from './tools/team.js';
|
|
14
|
-
import { registerDoctorTool } from './tools/doctor.js';
|
|
15
|
-
import { registerMatchupTool } from './tools/matchup.js';
|
|
16
|
-
import { registerSpritesTool } from './tools/sprites.js';
|
|
17
|
-
import { registerReplayTool } from './tools/replay.js';
|
|
18
|
-
import { registerInferTool } from './tools/infer.js';
|
|
19
|
-
import { registerOptimizeTeamTool } from './tools/optimize.js';
|
|
20
8
|
import { registerPrompts } from './prompts.js';
|
|
9
|
+
import { registerCompoundTools } from './tools/compound.js';
|
|
21
10
|
export const VERSION = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
|
|
22
11
|
export function buildServer() {
|
|
23
12
|
const server = new McpServer({
|
|
24
13
|
name: 'getcompetitive',
|
|
25
14
|
version: VERSION,
|
|
26
15
|
});
|
|
27
|
-
|
|
28
|
-
registerCalcTools(server);
|
|
29
|
-
registerRegulationTools(server);
|
|
30
|
-
registerAnalyzeTools(server);
|
|
31
|
-
registerMetaTools(server);
|
|
32
|
-
registerTeamTools(server);
|
|
33
|
-
registerDoctorTool(server);
|
|
34
|
-
registerMatchupTool(server);
|
|
35
|
-
registerSpritesTool(server);
|
|
36
|
-
registerReplayTool(server);
|
|
37
|
-
registerInferTool(server);
|
|
38
|
-
registerOptimizeTeamTool(server);
|
|
16
|
+
registerCompoundTools(server);
|
|
39
17
|
registerPrompts(server);
|
|
40
18
|
return server;
|
|
41
19
|
}
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,OAAO,GAClB,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAC7E,CAAC,OAAO,CAAC;AAEV,MAAM,UAAU,WAAW;IACzB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,eAAe,CAAC,MAAM,CAAC,CAAC;IAExB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The compound surface: eight intent-level tools over the full engine.
|
|
3
|
+
*
|
|
4
|
+
* Every specialized tool's schema and handler are registered onto a throwaway
|
|
5
|
+
* capture server — so the 30 underlying definitions stay exactly where they
|
|
6
|
+
* are, validated as before — and this module re-exposes them as eight
|
|
7
|
+
* entrypoints, each dispatching on a `mode` field (or, for single-purpose
|
|
8
|
+
* tools, taking the absorbed tool's arguments directly). The model picks an
|
|
9
|
+
* intent; the server does the orchestration.
|
|
10
|
+
*
|
|
11
|
+
* lookup one data lookup (species/forms/search/move/item/
|
|
12
|
+
* ability/nature/learnset/type/
|
|
13
|
+
* matchup/sprites)
|
|
14
|
+
* calculate one battle calc (stats/damage/matchups/speed/
|
|
15
|
+
* optimize_evs)
|
|
16
|
+
* analyze_team team analysis (synergy/diagnose)
|
|
17
|
+
* optimize_team fill team slots
|
|
18
|
+
* prepare_matchup pre-game dossier
|
|
19
|
+
* analyze_battle post-game / scouting (replay/infer)
|
|
20
|
+
* analyze_meta the meta (threats/compare/set)
|
|
21
|
+
* team_io team import/export (parse/format/legality/
|
|
22
|
+
* regulation/regulations)
|
|
23
|
+
*/
|
|
24
|
+
import { z } from 'zod';
|
|
25
|
+
import { getObjectShape } from '@modelcontextprotocol/sdk/server/zod-compat.js';
|
|
26
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
27
|
+
import { registerDataTools } from './data.js';
|
|
28
|
+
import { registerCalcTools } from './calc.js';
|
|
29
|
+
import { registerRegulationTools } from './regulations.js';
|
|
30
|
+
import { registerAnalyzeTools } from './analyze.js';
|
|
31
|
+
import { registerMetaTools } from './meta.js';
|
|
32
|
+
import { registerTeamTools } from './team.js';
|
|
33
|
+
import { registerDoctorTool } from './doctor.js';
|
|
34
|
+
import { registerMatchupTool } from './matchup.js';
|
|
35
|
+
import { registerSpritesTool } from './sprites.js';
|
|
36
|
+
import { registerReplayTool } from './replay.js';
|
|
37
|
+
import { registerInferTool } from './infer.js';
|
|
38
|
+
import { registerOptimizeTeamTool } from './optimize.js';
|
|
39
|
+
import { READ_ONLY_ANNOTATIONS } from '../result.js';
|
|
40
|
+
import { detailArg, applyLevel, LEVEL_SPECS } from './levels.js';
|
|
41
|
+
/** mode -> underlying tool name, per compound entrypoint. */
|
|
42
|
+
const COMPOUND = {
|
|
43
|
+
lookup: {
|
|
44
|
+
species: 'get_pokemon',
|
|
45
|
+
forms: 'list_forms',
|
|
46
|
+
search: 'search_dex',
|
|
47
|
+
move: 'get_move',
|
|
48
|
+
item: 'get_item',
|
|
49
|
+
ability: 'get_ability',
|
|
50
|
+
nature: 'get_nature',
|
|
51
|
+
learnset: 'get_learnset',
|
|
52
|
+
type: 'get_type',
|
|
53
|
+
matchup: 'get_type_matchup',
|
|
54
|
+
sprites: 'get_sprites',
|
|
55
|
+
},
|
|
56
|
+
calculate: {
|
|
57
|
+
stats: 'calculate_stats',
|
|
58
|
+
damage: 'calculate_damage',
|
|
59
|
+
matchups: 'calculate_matchups',
|
|
60
|
+
speed: 'check_speed',
|
|
61
|
+
optimize_evs: 'optimize_evs',
|
|
62
|
+
},
|
|
63
|
+
analyze_team: {
|
|
64
|
+
synergy: 'analyze_team',
|
|
65
|
+
diagnose: 'diagnose_team',
|
|
66
|
+
},
|
|
67
|
+
analyze_battle: {
|
|
68
|
+
replay: 'analyze_replay',
|
|
69
|
+
infer: 'infer_set',
|
|
70
|
+
},
|
|
71
|
+
analyze_meta: {
|
|
72
|
+
threats: 'list_threats',
|
|
73
|
+
compare: 'compare_meta',
|
|
74
|
+
set: 'get_set',
|
|
75
|
+
},
|
|
76
|
+
team_io: {
|
|
77
|
+
parse: 'parse_team',
|
|
78
|
+
format: 'format_team',
|
|
79
|
+
legality: 'check_legality',
|
|
80
|
+
regulation: 'get_regulation',
|
|
81
|
+
regulations: 'list_regulations',
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
/** Single-purpose compounds take the absorbed tool's arguments directly. */
|
|
85
|
+
const PLAIN = {
|
|
86
|
+
optimize_team: 'optimize_team',
|
|
87
|
+
prepare_matchup: 'prepare_matchup',
|
|
88
|
+
};
|
|
89
|
+
const DESCRIPTIONS = {
|
|
90
|
+
lookup: 'One data lookup, dispatching on `mode`: "species" for one Pok\u00e9mon\u2019s profile, "forms" for its forms, "search" for a fuzzy name search across the dataset, "move"/"item"/"ability"/"nature"/"learnset" for those records, "type" for a type\u2019s defensive profile, "matchup" for one type multiplier, and "sprites" for a whole team\u2019s sprite URLs in one call. Each mode carries the same documented fields the dedicated lookup tools had; pick the mode that names the thing being looked up and pass its arguments. Read-only and offline over the bundled dataset.',
|
|
91
|
+
calculate: 'One battle calculation, dispatching on `mode`: "stats" for a final stat table, "damage" for a full single-attack simulation, "matchups" to test one attacker against many defenders, "speed" to place a Speed stat against a regulation roster, and "optimize_evs" to derive a minimal spread from goals (survive, outspeed, KO). Each mode carries the same documented fields the dedicated calc tools had. Read-only and offline; deterministic.',
|
|
92
|
+
analyze_team: 'Team analysis, dispatching on `mode`: "synergy" for the type-synergy read (stacked weaknesses, coverage gaps, speed placement, heuristic score, and battle-math `answerClass` verdicts against the meta when a regulation and moves are supplied), "diagnose" for the coaching read ("fix my team": problems with evidence, then concrete spread/move/item/member changes). Each mode carries the same documented fields the dedicated tools had. Read-only and offline.',
|
|
93
|
+
analyze_battle: 'Battle analysis, dispatching on `mode`: "replay" turns a Showdown-format battle log into a deterministic post-match read (teams, KOs, observed Speed order, damage percentages, type read), "infer" runs reverse constraint solving on battle observations to narrow an opponent\u2019s set. Each mode carries the same documented fields the dedicated tools had. Read-only and offline.',
|
|
94
|
+
analyze_meta: 'Meta intelligence, dispatching on `mode`: "threats" for the usage-ranked threat list, "compare" for the two-window usage deltas and emerging cores, "set" for one species\u2019 most-played standard set (batched). Each mode carries the same documented fields the dedicated tools had. Read-only and offline; usage-derived from measured tournament data.',
|
|
95
|
+
team_io: 'Team import/export and validation, dispatching on `mode`: "parse" turns pasted text into the canonical team shape, "format" renders a canonical team back into paste text, "legality" checks a team against a regulation\u2019s rules, "regulation" reads one regulation\u2019s rules (rosters optional), "regulations" lists them all. Each mode carries the same documented fields the dedicated tools had. Read-only and offline.',
|
|
96
|
+
};
|
|
97
|
+
function capture() {
|
|
98
|
+
const server = new McpServer({ name: 'capture', version: '0' });
|
|
99
|
+
registerDataTools(server);
|
|
100
|
+
registerCalcTools(server);
|
|
101
|
+
registerRegulationTools(server);
|
|
102
|
+
registerAnalyzeTools(server);
|
|
103
|
+
registerMetaTools(server);
|
|
104
|
+
registerTeamTools(server);
|
|
105
|
+
registerDoctorTool(server);
|
|
106
|
+
registerMatchupTool(server);
|
|
107
|
+
registerSpritesTool(server);
|
|
108
|
+
registerReplayTool(server);
|
|
109
|
+
registerInferTool(server);
|
|
110
|
+
registerOptimizeTeamTool(server);
|
|
111
|
+
const registeredTools = server._registeredTools;
|
|
112
|
+
return registeredTools;
|
|
113
|
+
}
|
|
114
|
+
export function registerCompoundTools(server) {
|
|
115
|
+
const defs = capture();
|
|
116
|
+
for (const [plainName, target] of Object.entries(PLAIN)) {
|
|
117
|
+
const def = defs[target];
|
|
118
|
+
server.registerTool(plainName, {
|
|
119
|
+
title: def.title,
|
|
120
|
+
description: def.description,
|
|
121
|
+
inputSchema: z.object({ detail: detailArg, ...getObjectShape(def.inputSchema) }),
|
|
122
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
123
|
+
}, async (args) => {
|
|
124
|
+
const parsed = args;
|
|
125
|
+
const result = await def.handler(parsed);
|
|
126
|
+
if (result.structuredContent && def.outputSchema) {
|
|
127
|
+
const check = def.outputSchema.safeParse(result.structuredContent);
|
|
128
|
+
if (!check.success) {
|
|
129
|
+
throw new Error(`produced output outside its schema: ${JSON.stringify(check.error).slice(0, 200)}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (result.structuredContent && !result.isError) {
|
|
133
|
+
const shaped = applyLevel(LEVEL_SPECS[target], result.structuredContent, parsed.detail, target);
|
|
134
|
+
if (shaped !== result.structuredContent) {
|
|
135
|
+
return { content: [{ type: 'text', text: JSON.stringify(shaped, null, 2) }], structuredContent: shaped };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return result;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
for (const [name, modes] of Object.entries(COMPOUND)) {
|
|
142
|
+
const modeNames = Object.keys(modes);
|
|
143
|
+
const variants = modeNames.map((mode) => z.object({
|
|
144
|
+
mode: z.literal(mode).describe(`Run ${modes[mode]}'s operation.`),
|
|
145
|
+
detail: detailArg,
|
|
146
|
+
...getObjectShape(defs[modes[mode]].inputSchema),
|
|
147
|
+
}));
|
|
148
|
+
const inputSchema = z.union(variants);
|
|
149
|
+
server.registerTool(name, {
|
|
150
|
+
title: name
|
|
151
|
+
.split('_')
|
|
152
|
+
.map((w) => w[0].toUpperCase() + w.slice(1))
|
|
153
|
+
.join(' '),
|
|
154
|
+
description: DESCRIPTIONS[name],
|
|
155
|
+
inputSchema,
|
|
156
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
157
|
+
}, async (args) => {
|
|
158
|
+
const parsed = args;
|
|
159
|
+
const def = defs[modes[parsed.mode]];
|
|
160
|
+
const result = await def.handler(parsed);
|
|
161
|
+
// The captured mode schema validates the result exactly as the dedicated
|
|
162
|
+
// tool's output schema did. It is applied here rather than as a compound
|
|
163
|
+
// outputSchema: the SDK's compat layer routes zod-v4 schemas through its
|
|
164
|
+
// bundled mini-zod, which cannot parse a union of mixed-instance objects.
|
|
165
|
+
if (result.structuredContent && def.outputSchema) {
|
|
166
|
+
const check = def.outputSchema.safeParse(result.structuredContent);
|
|
167
|
+
if (!check.success) {
|
|
168
|
+
throw new Error(`mode ${parsed.mode} produced output outside its schema: ${JSON.stringify(check.error).slice(0, 200)}`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (result.structuredContent && !result.isError) {
|
|
172
|
+
const shaped = applyLevel(LEVEL_SPECS[modes[parsed.mode]], result.structuredContent, parsed.detail, parsed.mode);
|
|
173
|
+
if (shaped !== result.structuredContent) {
|
|
174
|
+
return { content: [{ type: 'text', text: JSON.stringify(shaped, null, 2) }], structuredContent: shaped };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return result;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=compound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compound.js","sourceRoot":"","sources":["../../src/tools/compound.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OA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CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;oBACnB,MAAM,IAAI,KAAK,CAAC,QAAQ,MAAM,CAAC,IAAI,wCAAwC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;gBAC1H,CAAC;YACH,CAAC;YACD,IAAI,MAAM,CAAC,iBAAiB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBAChD,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;gBACjH,IAAI,MAAM,KAAK,MAAM,CAAC,iBAAiB,EAAE,CAAC;oBACxC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;gBAC3G,CAAC;YACH,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response levels: compact (default), evidence, debug — the token-efficiency
|
|
3
|
+
* half of the north star. Every compound tool accepts `detail`; the compound
|
|
4
|
+
* layer filters each mode's result through a declarative field-tier spec, so
|
|
5
|
+
* the engines themselves stay untouched.
|
|
6
|
+
*
|
|
7
|
+
* Tier semantics:
|
|
8
|
+
* compact conclusions and the numbers needed to reason (default)
|
|
9
|
+
* evidence compact plus ranges, benchmarks, assumptions and per-row detail
|
|
10
|
+
* debug everything, plus an `engine` block with the data version
|
|
11
|
+
*
|
|
12
|
+
* A mode with no spec returns its full payload at every level — its data is
|
|
13
|
+
* already the answer (species lookups, regulations, pastes). Specs exist only
|
|
14
|
+
* where compaction pays: the heavy analysis outputs.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
import { readFileSync } from 'node:fs';
|
|
18
|
+
export const detailArg = z
|
|
19
|
+
.enum(['compact', 'evidence', 'debug'])
|
|
20
|
+
.optional()
|
|
21
|
+
.describe('How much detail to return: "compact" (default) gives conclusions and the numbers needed to reason; "evidence" adds ranges, benchmarks and per-row detail; "debug" adds provenance and every intermediate. Ask for more only when the reasoning actually needs it — model context is the expensive resource.');
|
|
22
|
+
const VERSION = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8')).version;
|
|
23
|
+
function pickFields(source, keep) {
|
|
24
|
+
const out = {};
|
|
25
|
+
for (const k of keep)
|
|
26
|
+
if (k in source)
|
|
27
|
+
out[k] = source[k];
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
30
|
+
/** Apply a keep-list at `path` into a value, projecting array elements along the way. */
|
|
31
|
+
function projectInto(value, path, keep) {
|
|
32
|
+
if (Array.isArray(value)) {
|
|
33
|
+
return value.map((row) => (row && typeof row === 'object' ? projectInto(row, path, keep) : row));
|
|
34
|
+
}
|
|
35
|
+
if (value && typeof value === 'object') {
|
|
36
|
+
const obj = value;
|
|
37
|
+
if (path.length === 0)
|
|
38
|
+
return pickFields(obj, keep);
|
|
39
|
+
const [head, ...rest] = path;
|
|
40
|
+
const next = obj[head];
|
|
41
|
+
if (next === undefined)
|
|
42
|
+
return obj;
|
|
43
|
+
return { ...obj, [head]: projectInto(next, rest, keep) };
|
|
44
|
+
}
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Filter one mode's payload to the requested level. `data` is the inner
|
|
49
|
+
* tool's structuredContent; the returned object becomes the response, with
|
|
50
|
+
* the text regenerated by the caller.
|
|
51
|
+
*/
|
|
52
|
+
export function applyLevel(spec, data, detail, mode) {
|
|
53
|
+
const level = detail ?? 'compact';
|
|
54
|
+
if (!spec || level === 'debug') {
|
|
55
|
+
if (level === 'debug')
|
|
56
|
+
return { ...data, engine: { version: VERSION, mode } };
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
const allowed = new Set([...(spec.compact ?? []), ...(level === 'evidence' ? (spec.evidence ?? []) : [])]);
|
|
60
|
+
const elementPaths = spec.elements ?? {};
|
|
61
|
+
const trimElements = level === 'compact';
|
|
62
|
+
const out = {};
|
|
63
|
+
for (const [key, value] of Object.entries(data)) {
|
|
64
|
+
if (!allowed.has(key))
|
|
65
|
+
continue;
|
|
66
|
+
let projected = value;
|
|
67
|
+
if (trimElements) {
|
|
68
|
+
for (const [path, keep] of Object.entries(elementPaths)) {
|
|
69
|
+
if (path === key)
|
|
70
|
+
projected = projectInto(projected, [], keep);
|
|
71
|
+
else if (path.startsWith(`${key}.`))
|
|
72
|
+
projected = projectInto(projected, path.slice(key.length + 1).split('.'), keep);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
out[key] = projected;
|
|
76
|
+
}
|
|
77
|
+
return out;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Field tiers per mode. Unlisted fields are debug-tier. Modes absent here
|
|
81
|
+
* return their full payload at every level.
|
|
82
|
+
*/
|
|
83
|
+
export const LEVEL_SPECS = {
|
|
84
|
+
analyze_team: {
|
|
85
|
+
compact: ['atRiskTypes', 'score', 'speed', 'threatCoverage', 'bringFour'],
|
|
86
|
+
evidence: ['team', 'defensiveWeaknesses', 'offensiveCoverage', 'unknownMoves'],
|
|
87
|
+
elements: {
|
|
88
|
+
'threatCoverage.threats': ['species', 'usage', 'hitMultiplier', 'answerClass', 'answerBy'],
|
|
89
|
+
'threatCoverage.unanswered': ['species'],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
diagnose_team: {
|
|
93
|
+
compact: ['problems', 'candidateChanges'],
|
|
94
|
+
evidence: ['regulation', 'goal', 'unknownMoves', 'note'],
|
|
95
|
+
elements: {
|
|
96
|
+
problems: ['statement', 'severity'],
|
|
97
|
+
candidateChanges: ['kind', 'change', 'confidence'],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
prepare_matchup: {
|
|
101
|
+
compact: ['regulation', 'opponent', 'recommendedBringFour', 'matchupConfidence', 'winConditions', 'lossConditions', 'pokemonToPreserve'],
|
|
102
|
+
evidence: ['likelySets', 'speedTiers', 'relevantDamageCalcs', 'possibleLeads', 'dangerousOpponentLeads', 'note'],
|
|
103
|
+
elements: {
|
|
104
|
+
'recommendedBringFour.picks': ['species', 'score'],
|
|
105
|
+
'recommendedBringFour.leftBehind': ['species'],
|
|
106
|
+
'recommendedBringFour.alternates': ['species'],
|
|
107
|
+
'matchupConfidence': ['score'],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
infer_set: {
|
|
111
|
+
compact: ['priorSets', 'survivingSets', 'candidates'],
|
|
112
|
+
evidence: ['constraints', 'regulation', 'note'],
|
|
113
|
+
elements: {
|
|
114
|
+
candidates: ['item', 'ability', 'nature', 'speed', 'probability'],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
analyze_replay: {
|
|
118
|
+
compact: ['players', 'winner', 'turns', 'teams', 'kos', 'typeRead'],
|
|
119
|
+
evidence: ['teamSize', 'speedConstraints', 'damageEvents', 'unresolvedSpecies', 'note'],
|
|
120
|
+
elements: {
|
|
121
|
+
kos: ['turn', 'move', 'attacker', 'defender'],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
calculate_damage: {
|
|
125
|
+
compact: ['move', 'damageRange', 'koChance', 'description'],
|
|
126
|
+
evidence: ['attacker', 'defender', 'field'],
|
|
127
|
+
},
|
|
128
|
+
calculate_matchups: {
|
|
129
|
+
compact: ['attacker', 'attackerSpeed', 'move'],
|
|
130
|
+
evidence: [],
|
|
131
|
+
elements: {
|
|
132
|
+
matchups: ['defender', 'bestMove', 'damageRange', 'koChance', 'immune'],
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
check_speed: {
|
|
136
|
+
compact: ['species', 'level', 'nature', 'finalSpeed', 'modifiers'],
|
|
137
|
+
evidence: ['baseSpe', 'evSpe', 'ivSpe', 'comparison'],
|
|
138
|
+
},
|
|
139
|
+
parse_team: {
|
|
140
|
+
compact: [],
|
|
141
|
+
evidence: ['warnings', 'note'],
|
|
142
|
+
elements: {
|
|
143
|
+
team: ['species', 'item', 'ability', 'nature', 'evs', 'championsPoints', 'moves'],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
check_legality: {
|
|
147
|
+
compact: ['regulation', 'valid', 'violations'],
|
|
148
|
+
evidence: ['status', 'teamSize', 'members', 'mega'],
|
|
149
|
+
},
|
|
150
|
+
optimize_team: {
|
|
151
|
+
compact: ['regulation', 'constraints', 'recommendations'],
|
|
152
|
+
evidence: ['note'],
|
|
153
|
+
elements: {
|
|
154
|
+
'recommendations': ['members', 'score', 'reasons'],
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=levels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"levels.js","sourceRoot":"","sources":["../../src/tools/levels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC;KACvB,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;KACtC,QAAQ,EAAE;KACV,QAAQ,CACP,6SAA6S,CAC9S,CAAC;AAWJ,MAAM,OAAO,GAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAyB,CAAC,OAAO,CAAC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