hearthstone-oracle 0.1.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/LICENSE +21 -0
- package/README.md +73 -0
- package/dist/data/db.d.ts +49 -0
- package/dist/data/db.d.ts.map +1 -0
- package/dist/data/db.js +109 -0
- package/dist/data/db.js.map +1 -0
- package/dist/data/hearthstone.d.ts +40 -0
- package/dist/data/hearthstone.d.ts.map +1 -0
- package/dist/data/hearthstone.js +58 -0
- package/dist/data/hearthstone.js.map +1 -0
- package/dist/data/pipeline.d.ts +36 -0
- package/dist/data/pipeline.d.ts.map +1 -0
- package/dist/data/pipeline.js +90 -0
- package/dist/data/pipeline.js.map +1 -0
- package/dist/data/schema.sql +111 -0
- package/dist/data/strategy-seed.d.ts +3 -0
- package/dist/data/strategy-seed.d.ts.map +1 -0
- package/dist/data/strategy-seed.js +512 -0
- package/dist/data/strategy-seed.js.map +1 -0
- package/dist/format.d.ts +63 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +331 -0
- package/dist/format.js.map +1 -0
- package/dist/knowledge/archetype-classifier.d.ts +19 -0
- package/dist/knowledge/archetype-classifier.d.ts.map +1 -0
- package/dist/knowledge/archetype-classifier.js +232 -0
- package/dist/knowledge/archetype-classifier.js.map +1 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +269 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/analyze-deck.d.ts +45 -0
- package/dist/tools/analyze-deck.d.ts.map +1 -0
- package/dist/tools/analyze-deck.js +159 -0
- package/dist/tools/analyze-deck.js.map +1 -0
- package/dist/tools/decode-deck.d.ts +30 -0
- package/dist/tools/decode-deck.d.ts.map +1 -0
- package/dist/tools/decode-deck.js +127 -0
- package/dist/tools/decode-deck.js.map +1 -0
- package/dist/tools/explain-concept.d.ts +26 -0
- package/dist/tools/explain-concept.d.ts.map +1 -0
- package/dist/tools/explain-concept.js +34 -0
- package/dist/tools/explain-concept.js.map +1 -0
- package/dist/tools/get-archetype.d.ts +29 -0
- package/dist/tools/get-archetype.d.ts.map +1 -0
- package/dist/tools/get-archetype.js +47 -0
- package/dist/tools/get-archetype.js.map +1 -0
- package/dist/tools/get-card.d.ts +13 -0
- package/dist/tools/get-card.d.ts.map +1 -0
- package/dist/tools/get-card.js +71 -0
- package/dist/tools/get-card.js.map +1 -0
- package/dist/tools/get-class-identity.d.ts +43 -0
- package/dist/tools/get-class-identity.d.ts.map +1 -0
- package/dist/tools/get-class-identity.js +69 -0
- package/dist/tools/get-class-identity.js.map +1 -0
- package/dist/tools/get-keyword.d.ts +30 -0
- package/dist/tools/get-keyword.d.ts.map +1 -0
- package/dist/tools/get-keyword.js +88 -0
- package/dist/tools/get-keyword.js.map +1 -0
- package/dist/tools/get-matchup.d.ts +32 -0
- package/dist/tools/get-matchup.d.ts.map +1 -0
- package/dist/tools/get-matchup.js +41 -0
- package/dist/tools/get-matchup.js.map +1 -0
- package/dist/tools/search-cards.d.ts +43 -0
- package/dist/tools/search-cards.d.ts.map +1 -0
- package/dist/tools/search-cards.js +167 -0
- package/dist/tools/search-cards.js.map +1 -0
- package/package.json +50 -0
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { GetKeywordResult } from './tools/get-keyword.js';
|
|
2
|
+
import type { DecodeDeckResult } from './tools/decode-deck.js';
|
|
3
|
+
import type { GetArchetypeResult } from './tools/get-archetype.js';
|
|
4
|
+
import type { GetClassIdentityResult } from './tools/get-class-identity.js';
|
|
5
|
+
import type { GetMatchupResult } from './tools/get-matchup.js';
|
|
6
|
+
import type { ExplainConceptResult } from './tools/explain-concept.js';
|
|
7
|
+
import type { AnalyzeDeckResult } from './tools/analyze-deck.js';
|
|
8
|
+
export interface CardSummary {
|
|
9
|
+
name: string;
|
|
10
|
+
mana_cost: number | null;
|
|
11
|
+
type: string | null;
|
|
12
|
+
player_class: string | null;
|
|
13
|
+
rarity: string | null;
|
|
14
|
+
text: string | null;
|
|
15
|
+
attack: number | null;
|
|
16
|
+
health: number | null;
|
|
17
|
+
keywords: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface SearchCardsResult {
|
|
20
|
+
cards: CardSummary[];
|
|
21
|
+
total: number;
|
|
22
|
+
}
|
|
23
|
+
export interface CardDetail {
|
|
24
|
+
id: string;
|
|
25
|
+
card_id: string | null;
|
|
26
|
+
name: string;
|
|
27
|
+
mana_cost: number | null;
|
|
28
|
+
type: string | null;
|
|
29
|
+
card_set: string | null;
|
|
30
|
+
set_name: string | null;
|
|
31
|
+
player_class: string | null;
|
|
32
|
+
rarity: string | null;
|
|
33
|
+
attack: number | null;
|
|
34
|
+
health: number | null;
|
|
35
|
+
durability: number | null;
|
|
36
|
+
armor: number | null;
|
|
37
|
+
text: string | null;
|
|
38
|
+
flavor: string | null;
|
|
39
|
+
artist: string | null;
|
|
40
|
+
collectible: number;
|
|
41
|
+
elite: number;
|
|
42
|
+
race: string | null;
|
|
43
|
+
spell_school: string | null;
|
|
44
|
+
keywords: string[];
|
|
45
|
+
}
|
|
46
|
+
export type GetCardResult = {
|
|
47
|
+
found: true;
|
|
48
|
+
card: CardDetail;
|
|
49
|
+
} | {
|
|
50
|
+
found: false;
|
|
51
|
+
message: string;
|
|
52
|
+
suggestions?: string[];
|
|
53
|
+
};
|
|
54
|
+
export declare function formatSearchCards(result: SearchCardsResult): string;
|
|
55
|
+
export declare function formatGetCard(result: GetCardResult): string;
|
|
56
|
+
export declare function formatGetKeyword(result: GetKeywordResult): string;
|
|
57
|
+
export declare function formatDecodeDeck(result: DecodeDeckResult): string;
|
|
58
|
+
export declare function formatGetArchetype(result: GetArchetypeResult): string;
|
|
59
|
+
export declare function formatGetClassIdentity(result: GetClassIdentityResult): string;
|
|
60
|
+
export declare function formatGetMatchup(result: GetMatchupResult): string;
|
|
61
|
+
export declare function formatExplainConcept(result: ExplainConceptResult): string;
|
|
62
|
+
export declare function formatAnalyzeDeck(result: AnalyzeDeck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E;AAID,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAsD7E;AAID,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAwBjE;AAID,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAoBzE;AAID,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CA4DnE"}
|
package/dist/format.js
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
// --- Formatters ---
|
|
2
|
+
export function formatSearchCards(result) {
|
|
3
|
+
if (result.cards.length === 0) {
|
|
4
|
+
return 'No cards found matching your search criteria.';
|
|
5
|
+
}
|
|
6
|
+
const lines = [`Found ${result.total} card(s):\n`];
|
|
7
|
+
for (const card of result.cards) {
|
|
8
|
+
lines.push(`- **${card.name}** (${card.mana_cost ?? '?'} mana) — ${card.type ?? 'Unknown'} [${card.player_class ?? 'NEUTRAL'}]`);
|
|
9
|
+
if (card.text) {
|
|
10
|
+
// Show first line only as preview
|
|
11
|
+
const preview = card.text.split('\n')[0];
|
|
12
|
+
lines.push(` ${preview}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return lines.join('\n');
|
|
16
|
+
}
|
|
17
|
+
export function formatGetCard(result) {
|
|
18
|
+
if (!result.found) {
|
|
19
|
+
let msg = result.message;
|
|
20
|
+
if (result.suggestions && result.suggestions.length > 0) {
|
|
21
|
+
msg += '\n\nDid you mean:\n';
|
|
22
|
+
msg += result.suggestions.map(s => `- ${s}`).join('\n');
|
|
23
|
+
}
|
|
24
|
+
return msg;
|
|
25
|
+
}
|
|
26
|
+
const card = result.card;
|
|
27
|
+
const lines = [];
|
|
28
|
+
// Header
|
|
29
|
+
lines.push(`# ${card.name} {${card.mana_cost ?? '?'} mana}`);
|
|
30
|
+
// Type line
|
|
31
|
+
const typeParts = [];
|
|
32
|
+
if (card.rarity)
|
|
33
|
+
typeParts.push(card.rarity);
|
|
34
|
+
if (card.type)
|
|
35
|
+
typeParts.push(card.type);
|
|
36
|
+
if (card.race)
|
|
37
|
+
typeParts.push(`(${card.race})`);
|
|
38
|
+
if (card.player_class)
|
|
39
|
+
typeParts.push(`[${card.player_class}]`);
|
|
40
|
+
lines.push(typeParts.join(' '));
|
|
41
|
+
// Set
|
|
42
|
+
if (card.card_set || card.set_name) {
|
|
43
|
+
lines.push(`Set: ${card.set_name ?? card.card_set}`);
|
|
44
|
+
}
|
|
45
|
+
// Text
|
|
46
|
+
if (card.text) {
|
|
47
|
+
lines.push('');
|
|
48
|
+
lines.push(card.text);
|
|
49
|
+
}
|
|
50
|
+
// Stats
|
|
51
|
+
if (card.type === 'MINION' && card.attack != null && card.health != null) {
|
|
52
|
+
lines.push('');
|
|
53
|
+
lines.push(`${card.attack}/${card.health}`);
|
|
54
|
+
}
|
|
55
|
+
else if (card.type === 'WEAPON' && card.attack != null && card.durability != null) {
|
|
56
|
+
lines.push('');
|
|
57
|
+
lines.push(`${card.attack}/${card.durability}`);
|
|
58
|
+
}
|
|
59
|
+
else if (card.type === 'HERO' && card.armor != null) {
|
|
60
|
+
lines.push('');
|
|
61
|
+
lines.push(`Armor: ${card.armor}`);
|
|
62
|
+
}
|
|
63
|
+
// Keywords
|
|
64
|
+
if (card.keywords.length > 0) {
|
|
65
|
+
lines.push(`Keywords: ${card.keywords.join(', ')}`);
|
|
66
|
+
}
|
|
67
|
+
// Spell school
|
|
68
|
+
if (card.spell_school) {
|
|
69
|
+
lines.push(`Spell School: ${card.spell_school}`);
|
|
70
|
+
}
|
|
71
|
+
// Flavor
|
|
72
|
+
if (card.flavor) {
|
|
73
|
+
lines.push('');
|
|
74
|
+
lines.push(`*${card.flavor}*`);
|
|
75
|
+
}
|
|
76
|
+
return lines.join('\n');
|
|
77
|
+
}
|
|
78
|
+
// --- get_keyword formatter ---
|
|
79
|
+
export function formatGetKeyword(result) {
|
|
80
|
+
if (!result.found) {
|
|
81
|
+
let msg = result.message;
|
|
82
|
+
if (result.suggestions && result.suggestions.length > 0) {
|
|
83
|
+
msg += '\n\nDid you mean:\n';
|
|
84
|
+
msg += result.suggestions.map((s) => `- ${s}`).join('\n');
|
|
85
|
+
}
|
|
86
|
+
return msg;
|
|
87
|
+
}
|
|
88
|
+
const lines = [];
|
|
89
|
+
lines.push(`# ${result.keyword.name}`);
|
|
90
|
+
lines.push(result.keyword.description);
|
|
91
|
+
if (result.keyword.related_keywords.length > 0) {
|
|
92
|
+
lines.push(`Related: ${result.keyword.related_keywords.join(', ')}`);
|
|
93
|
+
}
|
|
94
|
+
if (result.cards.length > 0) {
|
|
95
|
+
lines.push('');
|
|
96
|
+
lines.push(`## Cards with ${result.keyword.name} (${result.cards.length})`);
|
|
97
|
+
for (const card of result.cards) {
|
|
98
|
+
lines.push(`- **${card.name}** (${card.mana_cost ?? '?'} mana) — ${card.type ?? 'Unknown'} [${card.player_class ?? 'NEUTRAL'}]`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return lines.join('\n');
|
|
102
|
+
}
|
|
103
|
+
// --- decode_deck formatter ---
|
|
104
|
+
export function formatDecodeDeck(result) {
|
|
105
|
+
if (!result.success) {
|
|
106
|
+
return result.message;
|
|
107
|
+
}
|
|
108
|
+
const lines = [];
|
|
109
|
+
lines.push(`# Deck: ${result.hero_class} (${result.format})`);
|
|
110
|
+
lines.push(`Total cards: ${result.total_cards}`);
|
|
111
|
+
lines.push('');
|
|
112
|
+
// Cards list
|
|
113
|
+
lines.push('## Cards');
|
|
114
|
+
for (const { card, count } of result.cards) {
|
|
115
|
+
lines.push(`- ${count}x **${card.name}** (${card.mana_cost ?? '?'} mana) — ${card.type ?? 'Unknown'}`);
|
|
116
|
+
}
|
|
117
|
+
// Mana Curve
|
|
118
|
+
lines.push('');
|
|
119
|
+
lines.push('## Mana Curve');
|
|
120
|
+
const buckets = ['0', '1', '2', '3', '4', '5', '6', '7+'];
|
|
121
|
+
for (const bucket of buckets) {
|
|
122
|
+
const count = result.mana_curve[bucket] ?? 0;
|
|
123
|
+
if (count > 0) {
|
|
124
|
+
lines.push(`${bucket}: ${'#'.repeat(count)} (${count})`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// Type Distribution
|
|
128
|
+
lines.push('');
|
|
129
|
+
lines.push('## Type Distribution');
|
|
130
|
+
for (const [type, count] of Object.entries(result.type_distribution)) {
|
|
131
|
+
lines.push(`- ${type}: ${count}`);
|
|
132
|
+
}
|
|
133
|
+
return lines.join('\n');
|
|
134
|
+
}
|
|
135
|
+
// --- get_archetype formatter ---
|
|
136
|
+
export function formatGetArchetype(result) {
|
|
137
|
+
if (!result.found) {
|
|
138
|
+
let msg = result.message;
|
|
139
|
+
if (result.suggestions && result.suggestions.length > 0) {
|
|
140
|
+
msg += '\n\nDid you mean:\n';
|
|
141
|
+
msg += result.suggestions.map((s) => `- ${s}`).join('\n');
|
|
142
|
+
}
|
|
143
|
+
return msg;
|
|
144
|
+
}
|
|
145
|
+
const a = result.archetype;
|
|
146
|
+
const lines = [];
|
|
147
|
+
lines.push(`# ${a.name}`);
|
|
148
|
+
lines.push('');
|
|
149
|
+
lines.push(`## Description`);
|
|
150
|
+
lines.push(a.description);
|
|
151
|
+
lines.push('');
|
|
152
|
+
lines.push(`## Gameplan`);
|
|
153
|
+
lines.push(a.gameplan);
|
|
154
|
+
lines.push('');
|
|
155
|
+
lines.push(`## Win Conditions`);
|
|
156
|
+
for (const wc of a.win_conditions) {
|
|
157
|
+
lines.push(`- ${wc}`);
|
|
158
|
+
}
|
|
159
|
+
lines.push('');
|
|
160
|
+
lines.push(`## Strengths`);
|
|
161
|
+
for (const s of a.strengths) {
|
|
162
|
+
lines.push(`- ${s}`);
|
|
163
|
+
}
|
|
164
|
+
lines.push('');
|
|
165
|
+
lines.push(`## Weaknesses`);
|
|
166
|
+
for (const w of a.weaknesses) {
|
|
167
|
+
lines.push(`- ${w}`);
|
|
168
|
+
}
|
|
169
|
+
if (a.example_decks.length > 0) {
|
|
170
|
+
lines.push('');
|
|
171
|
+
lines.push(`## Example Decks`);
|
|
172
|
+
for (const ed of a.example_decks) {
|
|
173
|
+
lines.push(`- ${ed}`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return lines.join('\n');
|
|
177
|
+
}
|
|
178
|
+
// --- get_class_identity formatter ---
|
|
179
|
+
export function formatGetClassIdentity(result) {
|
|
180
|
+
if (!result.found) {
|
|
181
|
+
let msg = result.message;
|
|
182
|
+
if (result.suggestions && result.suggestions.length > 0) {
|
|
183
|
+
msg += '\n\nDid you mean:\n';
|
|
184
|
+
msg += result.suggestions.map((s) => `- ${s}`).join('\n');
|
|
185
|
+
}
|
|
186
|
+
return msg;
|
|
187
|
+
}
|
|
188
|
+
if ('overview' in result && result.overview) {
|
|
189
|
+
const lines = [];
|
|
190
|
+
lines.push('# Hearthstone Classes');
|
|
191
|
+
lines.push('');
|
|
192
|
+
for (const cls of result.classes) {
|
|
193
|
+
lines.push(`- **${cls.class}** (${cls.hero_power_name}) — ${cls.identity}`);
|
|
194
|
+
}
|
|
195
|
+
return lines.join('\n');
|
|
196
|
+
}
|
|
197
|
+
const id = result.identity;
|
|
198
|
+
const lines = [];
|
|
199
|
+
lines.push(`# ${id.class}`);
|
|
200
|
+
lines.push('');
|
|
201
|
+
lines.push(`## Strategic Identity`);
|
|
202
|
+
lines.push(id.identity);
|
|
203
|
+
lines.push('');
|
|
204
|
+
lines.push(`## Hero Power: ${id.hero_power_name} (${id.hero_power_cost} mana)`);
|
|
205
|
+
lines.push(id.hero_power_effect);
|
|
206
|
+
lines.push('');
|
|
207
|
+
lines.push(`**Implications:** ${id.hero_power_implications}`);
|
|
208
|
+
lines.push('');
|
|
209
|
+
lines.push(`## Strengths`);
|
|
210
|
+
for (const s of id.strengths) {
|
|
211
|
+
lines.push(`- ${s}`);
|
|
212
|
+
}
|
|
213
|
+
lines.push('');
|
|
214
|
+
lines.push(`## Weaknesses`);
|
|
215
|
+
for (const w of id.weaknesses) {
|
|
216
|
+
lines.push(`- ${w}`);
|
|
217
|
+
}
|
|
218
|
+
lines.push('');
|
|
219
|
+
lines.push(`## Game Phases`);
|
|
220
|
+
lines.push(`**Early Game:** ${id.early_game}`);
|
|
221
|
+
lines.push(`**Mid Game:** ${id.mid_game}`);
|
|
222
|
+
lines.push(`**Late Game:** ${id.late_game}`);
|
|
223
|
+
if (id.historical_archetypes.length > 0) {
|
|
224
|
+
lines.push('');
|
|
225
|
+
lines.push(`## Historical Archetypes`);
|
|
226
|
+
for (const arch of id.historical_archetypes) {
|
|
227
|
+
lines.push(`- ${arch}`);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return lines.join('\n');
|
|
231
|
+
}
|
|
232
|
+
// --- get_matchup formatter ---
|
|
233
|
+
export function formatGetMatchup(result) {
|
|
234
|
+
if (!result.found) {
|
|
235
|
+
let msg = result.message;
|
|
236
|
+
if (result.suggestions && result.suggestions.length > 0) {
|
|
237
|
+
msg += '\n\nAvailable archetypes:\n';
|
|
238
|
+
msg += result.suggestions.map((s) => `- ${s}`).join('\n');
|
|
239
|
+
}
|
|
240
|
+
return msg;
|
|
241
|
+
}
|
|
242
|
+
const m = result.matchup;
|
|
243
|
+
const lines = [];
|
|
244
|
+
lines.push(`## ${m.archetype_a} vs ${m.archetype_b}`);
|
|
245
|
+
lines.push('');
|
|
246
|
+
lines.push(`**Favoured:** ${m.favoured}`);
|
|
247
|
+
lines.push('');
|
|
248
|
+
lines.push(`**Reasoning:** ${m.reasoning}`);
|
|
249
|
+
lines.push('');
|
|
250
|
+
lines.push(`**Key Tension:** ${m.key_tension}`);
|
|
251
|
+
lines.push('');
|
|
252
|
+
lines.push(`**${m.archetype_a} should prioritise:** ${m.archetype_a_priority}`);
|
|
253
|
+
lines.push('');
|
|
254
|
+
lines.push(`**${m.archetype_b} should prioritise:** ${m.archetype_b_priority}`);
|
|
255
|
+
return lines.join('\n');
|
|
256
|
+
}
|
|
257
|
+
// --- explain_concept formatter ---
|
|
258
|
+
export function formatExplainConcept(result) {
|
|
259
|
+
if (!result.found) {
|
|
260
|
+
let msg = result.message;
|
|
261
|
+
if (result.suggestions && result.suggestions.length > 0) {
|
|
262
|
+
msg += '\n\nDid you mean:\n';
|
|
263
|
+
msg += result.suggestions.map((s) => `- ${s}`).join('\n');
|
|
264
|
+
}
|
|
265
|
+
return msg;
|
|
266
|
+
}
|
|
267
|
+
const c = result.concept;
|
|
268
|
+
const lines = [];
|
|
269
|
+
lines.push(`## ${c.name}`);
|
|
270
|
+
lines.push('');
|
|
271
|
+
lines.push(`**Category:** ${c.category}`);
|
|
272
|
+
lines.push('');
|
|
273
|
+
lines.push(c.description);
|
|
274
|
+
lines.push('');
|
|
275
|
+
lines.push(`**In Hearthstone:** ${c.hearthstone_application}`);
|
|
276
|
+
return lines.join('\n');
|
|
277
|
+
}
|
|
278
|
+
// --- analyze_deck formatter ---
|
|
279
|
+
export function formatAnalyzeDeck(result) {
|
|
280
|
+
if (!result.success) {
|
|
281
|
+
return result.message;
|
|
282
|
+
}
|
|
283
|
+
const lines = [];
|
|
284
|
+
// Header
|
|
285
|
+
lines.push('# Deck Analysis');
|
|
286
|
+
lines.push('');
|
|
287
|
+
lines.push(`**Class:** ${result.deck.hero_class} | **Format:** ${result.deck.format} | **Cards:** ${result.deck.total_cards}`);
|
|
288
|
+
lines.push('');
|
|
289
|
+
// Archetype classification
|
|
290
|
+
const confidencePct = Math.round(result.classification.confidence * 100);
|
|
291
|
+
lines.push(`## Archetype: ${result.classification.archetype.charAt(0).toUpperCase() + result.classification.archetype.slice(1)} (${confidencePct}% confidence)`);
|
|
292
|
+
lines.push(result.classification.reasoning);
|
|
293
|
+
lines.push('');
|
|
294
|
+
// Gameplan (from archetype_info)
|
|
295
|
+
if (result.archetype_info) {
|
|
296
|
+
lines.push('## Gameplan');
|
|
297
|
+
lines.push(result.archetype_info.gameplan);
|
|
298
|
+
lines.push('');
|
|
299
|
+
lines.push('## Strengths');
|
|
300
|
+
for (const s of result.archetype_info.strengths) {
|
|
301
|
+
lines.push(`- ${s}`);
|
|
302
|
+
}
|
|
303
|
+
lines.push('');
|
|
304
|
+
lines.push('## Weaknesses');
|
|
305
|
+
for (const w of result.archetype_info.weaknesses) {
|
|
306
|
+
lines.push(`- ${w}`);
|
|
307
|
+
}
|
|
308
|
+
lines.push('');
|
|
309
|
+
}
|
|
310
|
+
// Mana Curve
|
|
311
|
+
lines.push('## Mana Curve');
|
|
312
|
+
const buckets = ['0', '1', '2', '3', '4', '5', '6', '7+'];
|
|
313
|
+
for (const bucket of buckets) {
|
|
314
|
+
const count = result.deck.mana_curve[bucket] ?? 0;
|
|
315
|
+
if (count > 0) {
|
|
316
|
+
const bar = '\u2588'.repeat(count);
|
|
317
|
+
lines.push(`${bucket}: ${bar} ${count}`);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
lines.push('');
|
|
321
|
+
// Matchup Expectations
|
|
322
|
+
if (result.matchups && result.matchups.length > 0) {
|
|
323
|
+
lines.push('## Matchup Expectations');
|
|
324
|
+
for (const m of result.matchups) {
|
|
325
|
+
lines.push(`- vs ${m.vs_archetype}: ${m.favoured} \u2014 ${m.key_tension}`);
|
|
326
|
+
}
|
|
327
|
+
lines.push('');
|
|
328
|
+
}
|
|
329
|
+
return lines.join('\n');
|
|
330
|
+
}
|
|
331
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAuDA,qBAAqB;AAErB,MAAM,UAAU,iBAAiB,CAAC,MAAyB;IACzD,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,+CAA+C,CAAC;IACzD,CAAC;IAED,MAAM,KAAK,GAAa,CAAC,SAAS,MAAM,CAAC,KAAK,aAAa,CAAC,CAAC;IAC7D,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,C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EAAE,CAAC;QAClD,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QACtC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,QAAQ,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAC9E,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface DeckProfile {
|
|
2
|
+
avg_cost: number;
|
|
3
|
+
cards: Array<{
|
|
4
|
+
mana_cost: number | null;
|
|
5
|
+
type: string | null;
|
|
6
|
+
text: string | null;
|
|
7
|
+
keywords: string | null;
|
|
8
|
+
}>;
|
|
9
|
+
total_cards: number;
|
|
10
|
+
mana_curve: Record<string, number>;
|
|
11
|
+
type_distribution: Record<string, number>;
|
|
12
|
+
}
|
|
13
|
+
export interface ClassificationResult {
|
|
14
|
+
archetype: string;
|
|
15
|
+
confidence: number;
|
|
16
|
+
reasoning: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function classifyArchetype(profile: DeckProfile): ClassificationResult;
|
|
19
|
+
//# sourceMappingURL=archetype-classifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archetype-classifier.d.ts","sourceRoot":"","sources":["../../src/knowledge/archetype-classifier.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAC9G,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAmQD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,oBAAoB,CAqC5E"}
|