@follenfang/wowdata 0.0.2 → 0.0.3

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 CHANGED
@@ -1,23 +1,63 @@
1
1
  # wowdata
2
2
 
3
- `wowdata` 是一个纯 Go 的 World of Warcraft 数据 CLI,用于查询和导出 CASC、DB2、Listfile、图标、法术、副本、物品、生物、装饰物和视频数据。
3
+ <div align="center">
4
+ <strong>World of Warcraft data, from the command line.</strong>
5
+ <br />
6
+ <sub>Query CASC and DB2 data, export game assets, and keep every result scriptable.</sub>
7
+ <br /><br />
4
8
 
5
- ## 安装
9
+ [![npm](https://img.shields.io/npm/v/@follenfang/wowdata?style=flat-square&logo=npm&label=npm)](https://www.npmjs.com/package/@follenfang/wowdata)
10
+ [![downloads](https://img.shields.io/npm/dm/@follenfang/wowdata?style=flat-square&label=downloads)](https://www.npmjs.com/package/@follenfang/wowdata)
11
+ [![CI](https://img.shields.io/github/actions/workflow/status/Follen/wowdata/ci.yml?branch=main&style=flat-square&logo=github&label=CI)](https://github.com/Follen/wowdata/actions/workflows/ci.yml)
12
+ [![release](https://img.shields.io/github/v/release/Follen/wowdata?style=flat-square&logo=github&label=release)](https://github.com/Follen/wowdata/releases/latest)
13
+ [![license](https://img.shields.io/github/license/Follen/wowdata?style=flat-square&label=license)](LICENSE)
14
+
15
+ <br />
16
+ <a href="#readme-zh">中文</a> · <a href="#readme-en">English</a>
17
+ </div>
18
+
19
+ ---
20
+
21
+ <a id="readme-zh"></a>
22
+
23
+ ## 中文
24
+
25
+ `wowdata` 是一个 CLI-only 的魔兽世界数据工具。它直接读取本地客户端或 Blizzard CDN,查询 CASC、DB2、Listfile、法术、物品、生物和地下城手册数据,也能导出 BLP、PNG、WebP 与其他游戏文件。
26
+
27
+ 核心解析器使用 Go。npm 只负责跨平台安装、更新和 Skill 部署,没有隐藏的远端服务,也不需要 MCP。
28
+
29
+ ### 为什么用它
30
+
31
+ - **直接查询**:执行目标命令即可,CLI 会自行判断缓存是否可用、是否需要下载。
32
+ - **结果稳定**:最终结果写入 stdout JSON,下载进度写入 stderr,适合 Shell 和 Agent。
33
+ - **缓存可控**:按 Build 保存不可变快照,支持校验、清理、容量限制和离线复用。
34
+ - **源码可审计**:数据解析在 Go 中完成,npm 生命周期脚本集中在 `npm/`。
35
+ - **原子命令**:CLI 只提供明确的小命令,语义理解和命令组合交给 Skill。
36
+
37
+ ### 安装
6
38
 
7
39
  ```bash
8
40
  npm install -g @follenfang/wowdata
9
41
  ```
10
42
 
11
- npm 会完成两件事:
43
+ 支持 Windows amd64、Linux amd64/arm64、macOS amd64/arm64。安装完成后:
12
44
 
13
- - 把当前平台的 Go CLI 安装到 `~/.wowdata/bin`,并提供全局 `wowdata` 命令。
14
- - 把轻量 Skill 安装到 `~/.agents/skills/wowdata`。Skill 只有说明和 Reference,不包含可执行文件。
45
+ ```bash
46
+ wowdata --version
47
+ wowdata doctor
48
+ wowdata --help
49
+ ```
50
+
51
+ npm 会安装:
15
52
 
16
- 支持 Windows amd64、Linux amd64/arm64、macOS amd64/arm64。
53
+ - `wowdata` CLI `~/.wowdata/bin`,并创建全局命令。
54
+ - `wowdata` Skill 到 `~/.agents/skills/wowdata`。
17
55
 
18
- ## 目标必须明确
56
+ 也可以从 [GitHub Releases](https://github.com/Follen/wowdata/releases/latest) 直接下载单文件程序。
19
57
 
20
- CLI 没有地区、产品、Build 或语言默认值。需要游戏数据的命令必须传完整目标:
58
+ ### 快速开始
59
+
60
+ CLI 不猜地区、产品、Build 或语言。涉及游戏数据时,目标必须明确:
21
61
 
22
62
  ```bash
23
63
  wowdata db2 rows SpellName --id 123 \
@@ -28,7 +68,7 @@ wowdata db2 rows SpellName --id 123 \
28
68
  --locale zhCN
29
69
  ```
30
70
 
31
- 也可以先保存完整 Profile:
71
+ 常用目标可以保存成 Profile:
32
72
 
33
73
  ```bash
34
74
  wowdata profile set retail-cn \
@@ -38,40 +78,78 @@ wowdata profile set retail-cn \
38
78
  --build latest \
39
79
  --locale zhCN
40
80
 
41
- wowdata db2 rows SpellName --id 123 --profile retail-cn
81
+ wowdata spell info --spell-id 123 --profile retail-cn
42
82
  ```
43
83
 
44
- Skill 的规则不同:用户没指定时,Skill 显式传入中国区 `cn`、最新 Build `latest` 和简体中文 `zhCN`;产品没有默认值,无法从用户话语或上下文确定时,Skill 会先询问用户。
84
+ 查看某个区域当前实际提供的产品和 Build
85
+
86
+ ```bash
87
+ wowdata casc products --source remote --region cn
88
+ ```
45
89
 
46
- ## 直接查询
90
+ ### 不需要手动预热
47
91
 
48
- 普通任务直接运行对应原子命令,不需要先执行预热:
92
+ 直接执行查询即可:
49
93
 
50
94
  ```bash
51
- wowdata spell info --spell-id 123 --profile retail-cn
52
95
  wowdata file lookup --file-data-id 134400 --profile retail-cn
53
- wowdata icon export --file-data-id 134400 --format png --output output/icon.png --profile retail-cn
96
+ wowdata icon export --file-data-id 134400 --format png \
97
+ --output output/icon.png --profile retail-cn
54
98
  ```
55
99
 
56
- CLI 会在同一次命令中:
100
+ 每次查询时,CLI 会依次完成:
57
101
 
58
- 1. 解析明确的产品和 Build。
59
- 2. 检查远端内容身份与本地 SHA-256。
102
+ 1. 解析产品与 Build。
103
+ 2. 对比远端内容身份和本地 SHA-256。
60
104
  3. 复用有效缓存,下载缺失或过期内容。
61
- 4. 完成查询并返回最终结果。
105
+ 4. 执行查询并返回最终 JSON。
62
106
 
63
- 准备和下载进度写入 stderr,最终结构化结果写入 stdout JSON。多个独立 CDN 对象和清单默认使用 4 个 worker 并发下载;可以通过 `wowdata cache config --workers N` 调整。
107
+ 只有需要提前准备数据时,才显式运行:
64
108
 
65
- ## 输出和退出码
109
+ ```bash
110
+ wowdata warmup --source remote --region cn \
111
+ --product wow --build latest --locale zhCN
112
+ ```
66
113
 
67
- CLI 可以直接用于 Agent,也可以作为普通 Shell 命令组合:
114
+ 独立 CDN 对象和清单默认使用 4 个 worker 并发下载。
115
+
116
+ ### 命令一览
117
+
118
+ | 领域 | 命令 |
119
+ | --- | --- |
120
+ | CASC | `casc info/products/diagnose` |
121
+ | DB2 | `db2 schema/rows/search/foreign-key/stream` |
122
+ | 文件 | `file lookup/search/extension/get/exists/encoding/export` |
123
+ | 图标 | `icon export` |
124
+ | 法术 | `spell info/auras/summons` |
125
+ | 副本 | `encounter get` |
126
+ | 物品 | `item get/models/geosets/textures` |
127
+ | 生物 | `creature display/model` |
128
+ | 装饰 | `decor list/get` |
129
+ | 视频 | `video demux` |
130
+ | 目标 | `profile list/show/set/remove` |
131
+ | 缓存 | `cache status/verify/prune/clear/config` |
132
+ | 维护 | `doctor/update/uninstall` |
133
+
134
+ 运行 `wowdata <command> --help` 查看参数。
135
+
136
+ ### 输出约定
137
+
138
+ ```json
139
+ {
140
+ "ok": true,
141
+ "command": "icon export",
142
+ "data": {},
143
+ "warnings": []
144
+ }
145
+ ```
68
146
 
69
- - 成功结果为 `"ok": true`,进程退出码为 `0`。
70
- - 业务错误为 `"ok": false`,错误详情仍是 stdout 中的 JSON,进程退出码为 `1`。
71
- - 准备和下载进度只写入 stderr,不会污染 stdout JSON
72
- - 参数拼写错误等尚未进入命令处理器的错误写入 stderr,并返回退出码 `1`。
147
+ - 成功:stdout 返回 `"ok": true`,退出码为 `0`。
148
+ - 业务错误:stdout 返回 `"ok": false` 和结构化错误,退出码为 `1`。
149
+ - 下载、缓存准备等进度只写入 stderr。
150
+ - 参数解析错误写入 stderr,退出码为 `1`。
73
151
 
74
- 因此脚本既可以判断退出码,也可以继续解析结构化错误:
152
+ 普通 Shell 可以直接同时使用退出码和 JSON:
75
153
 
76
154
  ```bash
77
155
  if wowdata db2 rows SpellName --id 133 \
@@ -83,26 +161,7 @@ else
83
161
  fi
84
162
  ```
85
163
 
86
- ## 发现与提前准备
87
-
88
- 查看某个区域当前提供的真实产品和 Build 组合:
89
-
90
- ```bash
91
- wowdata casc products --source remote --region cn
92
- ```
93
-
94
- 需要提前下载时再显式使用 `warmup`:
95
-
96
- ```bash
97
- wowdata warmup \
98
- --source remote \
99
- --region cn \
100
- --product wow \
101
- --build latest \
102
- --locale zhCN
103
- ```
104
-
105
- ## 本地目录
164
+ ### 缓存与本地目录
106
165
 
107
166
  ```text
108
167
  ~/.wowdata/
@@ -110,18 +169,13 @@ wowdata warmup \
110
169
  ├── config/ 用户配置
111
170
  ├── profiles/ 完整数据目标
112
171
  ├── builds/ 不可变 Build 快照
113
- ├── cache/
114
- │ ├── casc/
115
- │ ├── dbd/
116
- │ ├── listfile/
117
- │ ├── tact/
118
- │ └── manifests/
172
+ ├── cache/ CASC、DBD、Listfile、TACT 与清单缓存
119
173
  ├── state/ 安装和最近状态
120
174
  ├── tmp/ 下载临时文件
121
175
  └── locks/ 跨进程下载锁
122
176
  ```
123
177
 
124
- 缓存默认上限为 20GB。每个 Profile 的当前 Build 和上一个 Build 不参与自动清理,更老的 Build 按最久未使用顺序清理。
178
+ 缓存默认上限为 20 GB。当前 Build 和上一个 Build 不参与自动清理,更早的 Build 按最久未使用顺序清理。
125
179
 
126
180
  ```bash
127
181
  wowdata cache status
@@ -131,70 +185,245 @@ wowdata cache clear
131
185
  wowdata cache config --max-gb 30 --workers 6
132
186
  ```
133
187
 
134
- 远端不可用时,CLI 可以使用已经通过完整性校验的离线缓存;缺失、损坏和未完成的缓存不会被使用。
188
+ 远端不可用时,CLI 会复用已经通过完整性校验的缓存;损坏或未完成的内容不会被使用。
189
+
190
+ ### Skill 的默认规则
191
+
192
+ CLI 本身没有目标默认值。随 npm 安装的 Skill 会在用户未指定时明确传入:
193
+
194
+ - 地区:`cn`
195
+ - Build:`latest`
196
+ - 语言:`zhCN`
197
+
198
+ 产品没有默认值。无法从问题或上下文确定产品时,Skill 会先询问。
135
199
 
136
- ## 诊断和维护
200
+ ### 维护
137
201
 
138
202
  ```bash
139
203
  wowdata doctor
140
204
  wowdata update
141
- wowdata update --version 1.2.3
205
+ wowdata update --version 0.0.2
142
206
  wowdata uninstall
143
207
  wowdata uninstall --keep-data
144
208
  ```
145
209
 
146
- `doctor` 只读检查 CLI/npm、目录、Profile、缓存完整性和基础网络,不自动修改数据。
210
+ `doctor` 是只读检查。`uninstall --keep-data` 会删除程序和托管 Skill,但保留 Profile、Build 与缓存。
147
211
 
148
- `uninstall` 默认删除 CLI、托管 Skill 和整个 `~/.wowdata`。使用 `--keep-data` 时保留配置、Profile、Build 和缓存。安装遇到非本包托管的旧 Skill 时会先备份,不会直接覆盖。
212
+ ### 从源码构建
149
213
 
150
- ## 命令
214
+ ```bash
215
+ go test ./... -count=1
216
+ go build -trimpath -o dist/wowdata ./cmd/wowdata
217
+ npm test
218
+ ```
151
219
 
152
- ```text
153
- warmup
154
- db2 schema/rows/search/foreign-key/stream
155
- spell info/auras/summons
156
- encounter get
157
- file lookup/search/extension/get/exists/encoding/export
158
- icon export
159
- casc info/products/diagnose
160
- item get/models/geosets/textures
161
- creature display/model
162
- decor list/get
163
- video demux
164
- profile list/show/set/remove
165
- cache status/verify/prune/clear/config
166
- doctor
167
- update
168
- uninstall
220
+ 推送 `vX.Y.Z` tag 后,GitHub Actions 会运行测试、构建五个平台、生成 `SHA256SUMS`、创建 GitHub Release,并通过 npm Trusted Publisher OIDC 发布带 provenance 的包。
221
+
222
+ ---
223
+
224
+ <a id="readme-en"></a>
225
+
226
+ ## English
227
+
228
+ `wowdata` is a CLI-only toolkit for World of Warcraft data. It reads a local game installation or the Blizzard CDN to query CASC, DB2, listfiles, spells, items, creatures, and encounter data, and exports BLP, PNG, WebP, and other game files.
229
+
230
+ The parser is written in Go. npm is only used for cross-platform installation, updates, and Skill deployment. There is no hosted service and no MCP runtime.
231
+
232
+ ### Why wowdata
233
+
234
+ - **Query directly**: run the command you need; the CLI decides whether cached data can be reused or downloaded.
235
+ - **Stable output**: final results go to stdout as JSON, while preparation progress stays on stderr.
236
+ - **Controlled cache**: immutable Build snapshots with verification, pruning, size limits, and offline reuse.
237
+ - **Auditable source**: data parsing lives in Go, and every npm lifecycle script is visible under `npm/`.
238
+ - **Atomic commands**: the CLI exposes small operations; the Skill handles intent and command composition.
239
+
240
+ ### Install
241
+
242
+ ```bash
243
+ npm install -g @follenfang/wowdata
169
244
  ```
170
245
 
171
- 运行 `wowdata --help` `wowdata <command> --help` 查看完整参数。
246
+ Supported targets: Windows amd64, Linux amd64/arm64, and macOS amd64/arm64.
247
+
248
+ ```bash
249
+ wowdata --version
250
+ wowdata doctor
251
+ wowdata --help
252
+ ```
253
+
254
+ The npm package installs:
255
+
256
+ - The `wowdata` CLI under `~/.wowdata/bin`, with a global command.
257
+ - The `wowdata` Skill under `~/.agents/skills/wowdata`.
172
258
 
173
- ## 从源码构建
259
+ Standalone binaries are also available from [GitHub Releases](https://github.com/Follen/wowdata/releases/latest).
260
+
261
+ ### Quick start
262
+
263
+ The CLI does not guess a region, product, Build, or locale. Data commands require an explicit target:
174
264
 
175
265
  ```bash
176
- go test ./... -count=1
177
- go build -trimpath -o dist/wowdata ./cmd/wowdata
178
- npm test
266
+ wowdata db2 rows SpellName --id 123 \
267
+ --source remote \
268
+ --region cn \
269
+ --product wow \
270
+ --build latest \
271
+ --locale zhCN
179
272
  ```
180
273
 
181
- Go 负责数据解析和命令执行;Node.js 只负责 npm 安装、启动桥接和包生命周期,所有脚本都在 `npm/` 中可审计。
274
+ Save frequently used targets as Profiles:
182
275
 
183
- ## 发布
276
+ ```bash
277
+ wowdata profile set retail-cn \
278
+ --source remote \
279
+ --region cn \
280
+ --product wow \
281
+ --build latest \
282
+ --locale zhCN
184
283
 
185
- 推送语义版本 tag 会触发 GitHub Actions:
284
+ wowdata spell info --spell-id 123 --profile retail-cn
285
+ ```
286
+
287
+ Discover the products and Builds currently available in a region:
186
288
 
187
289
  ```bash
188
- git tag v1.2.3
189
- git push origin v1.2.3
290
+ wowdata casc products --source remote --region cn
291
+ ```
292
+
293
+ ### Warmup is optional
294
+
295
+ Run the query directly:
296
+
297
+ ```bash
298
+ wowdata file lookup --file-data-id 134400 --profile retail-cn
299
+ wowdata icon export --file-data-id 134400 --format png \
300
+ --output output/icon.png --profile retail-cn
190
301
  ```
191
302
 
192
- 工作流会测试 Go npm、构建五个平台、生成 `SHA256SUMS`、创建 GitHub Release,并发布同版本 `@follenfang/wowdata`。
303
+ For each query, the CLI:
304
+
305
+ 1. Resolves the product and Build.
306
+ 2. Compares the remote content identity with the local SHA-256.
307
+ 3. Reuses valid cache entries and downloads missing or stale data.
308
+ 4. Executes the query and returns the final JSON result.
309
+
310
+ Use `warmup` only when data must be prepared ahead of time:
311
+
312
+ ```bash
313
+ wowdata warmup --source remote --region cn \
314
+ --product wow --build latest --locale zhCN
315
+ ```
316
+
317
+ Independent CDN objects and manifests use four download workers by default.
318
+
319
+ ### Command map
320
+
321
+ | Area | Commands |
322
+ | --- | --- |
323
+ | CASC | `casc info/products/diagnose` |
324
+ | DB2 | `db2 schema/rows/search/foreign-key/stream` |
325
+ | Files | `file lookup/search/extension/get/exists/encoding/export` |
326
+ | Icons | `icon export` |
327
+ | Spells | `spell info/auras/summons` |
328
+ | Encounters | `encounter get` |
329
+ | Items | `item get/models/geosets/textures` |
330
+ | Creatures | `creature display/model` |
331
+ | Decor | `decor list/get` |
332
+ | Video | `video demux` |
333
+ | Targets | `profile list/show/set/remove` |
334
+ | Cache | `cache status/verify/prune/clear/config` |
335
+ | Maintenance | `doctor/update/uninstall` |
336
+
337
+ Run `wowdata <command> --help` for complete flags.
338
+
339
+ ### Output contract
340
+
341
+ ```json
342
+ {
343
+ "ok": true,
344
+ "command": "icon export",
345
+ "data": {},
346
+ "warnings": []
347
+ }
348
+ ```
349
+
350
+ - Success: stdout contains `"ok": true`; exit code `0`.
351
+ - Domain error: stdout contains `"ok": false` and a structured error; exit code `1`.
352
+ - Download and cache preparation progress is written only to stderr.
353
+ - Argument parsing errors are written to stderr and return exit code `1`.
354
+
355
+ Shell scripts can rely on both the process status and JSON body:
356
+
357
+ ```bash
358
+ if wowdata db2 rows SpellName --id 133 \
359
+ --source remote --region cn --product wow --build latest --locale zhCN \
360
+ >result.json; then
361
+ jq '.data.rows' result.json
362
+ else
363
+ jq '.error' result.json
364
+ fi
365
+ ```
366
+
367
+ ### Cache layout
368
+
369
+ ```text
370
+ ~/.wowdata/
371
+ ├── bin/ CLI binaries
372
+ ├── config/ User configuration
373
+ ├── profiles/ Complete data targets
374
+ ├── builds/ Immutable Build snapshots
375
+ ├── cache/ CASC, DBD, listfile, TACT, and manifest cache
376
+ ├── state/ Installation and recent state
377
+ ├── tmp/ Incomplete downloads
378
+ └── locks/ Cross-process download locks
379
+ ```
380
+
381
+ The default cache limit is 20 GB. The current and previous Build for each Profile are protected from automatic pruning; older Builds are removed by least-recent use.
382
+
383
+ ```bash
384
+ wowdata cache status
385
+ wowdata cache verify
386
+ wowdata cache prune
387
+ wowdata cache clear
388
+ wowdata cache config --max-gb 30 --workers 6
389
+ ```
390
+
391
+ When the remote source is unavailable, the CLI can reuse cache entries that already passed integrity checks. Corrupt or incomplete entries are never used.
392
+
393
+ ### Skill defaults
394
+
395
+ The CLI itself has no target defaults. When the user does not specify them, the installed Skill explicitly supplies:
396
+
397
+ - Region: `cn`
398
+ - Build: `latest`
399
+ - Locale: `zhCN`
400
+
401
+ There is no default product. If the product cannot be inferred from the request or context, the Skill asks first.
402
+
403
+ ### Maintenance
404
+
405
+ ```bash
406
+ wowdata doctor
407
+ wowdata update
408
+ wowdata update --version 0.0.2
409
+ wowdata uninstall
410
+ wowdata uninstall --keep-data
411
+ ```
412
+
413
+ `doctor` is read-only. `uninstall --keep-data` removes the CLI and managed Skill while preserving Profiles, Builds, and cache data.
414
+
415
+ ### Build from source
416
+
417
+ ```bash
418
+ go test ./... -count=1
419
+ go build -trimpath -o dist/wowdata ./cmd/wowdata
420
+ npm test
421
+ ```
193
422
 
194
- npm 发布使用绑定到 `Follen/wowdata` `release.yml` Trusted Publisher OIDC,不需要在 GitHub Secrets 中保存 `NPM_TOKEN`。发布 job 固定使用 npm `11.18.0`,并生成 npm provenance
423
+ Pushing a `vX.Y.Z` tag runs the test suite, builds five platforms, creates `SHA256SUMS` and a GitHub Release, then publishes the npm package through Trusted Publisher OIDC with provenance.
195
424
 
196
- npm 版本不可覆盖:`0.0.1` 已经发布,后续正式发布从更高的新版本 tag 开始,例如 `v0.0.2`。
425
+ ---
197
426
 
198
427
  ## License
199
428
 
200
- AGPL-3.0-or-later
429
+ [AGPL-3.0-or-later](LICENSE)
package/dist/SHA256SUMS CHANGED
@@ -1,5 +1,5 @@
1
- c518635ebf3dcdf92b39510ec9fb3f25df27e7eb0132b177553bdeae15089452 dist/wowdata-darwin-amd64
2
- 10470811b3fb51abed29d28ff5548f272ce3939556a16321b94ae85d1736f8be dist/wowdata-darwin-arm64
3
- 009d40358915132df84dcdf7e9275f4fef9161a390ccc8b1beaa43763564e8ea dist/wowdata-linux-amd64
4
- 46528408a4ba3ba6b05e0469f7356ae1945386337e0e2305f037a26e2c96e66a dist/wowdata-linux-arm64
5
- 397884735b784690b01188399cf140ea05bf98494478ada7b7c57c2b31ca0d9d dist/wowdata-windows-amd64.exe
1
+ b44b01ae09db0b67e9f06518bdfbc3790ceb71fb4ac4bb4ac04b5be764b4c432 dist/wowdata-darwin-amd64
2
+ c4613d552e8221417015915477fa84e69ed4df7b39a6eaa7403754cbb0daafba dist/wowdata-darwin-arm64
3
+ 0765ff03d04ba2218d7317ece5ec85d7328f7af746a4ab58c33b25156c9bde53 dist/wowdata-linux-amd64
4
+ ca7fc2c9739717be2992fb67de6d569c3eb40f888c6149b2a42a6ae88b9492dc dist/wowdata-linux-arm64
5
+ d0e575e2eea75d8ed8e6a4517b506ea3cb09bc89a6856d515618d4a179970384 dist/wowdata-windows-amd64.exe
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@follenfang/wowdata",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Auditable CLI for querying World of Warcraft CASC and DB2 data",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "type": "commonjs",
@@ -1,55 +1,36 @@
1
1
  ---
2
2
  name: wowdata
3
- description: Query and export World of Warcraft game data with the wowdata CLI, including CASC and DB2 schemas and rows, files, icons, textures, spells, encounters, items, creatures, decor, Builds, profiles, cache, and diagnostics. Use when a user asks to inspect or export WoW data from a local client or CDN, resolve a product/Build/locale target, or diagnose wowdata.
3
+ description: Query and export World of Warcraft data with the wowdata CLI, including local or CDN CASC/DB2 data, read-only SQL atomic queries, independent Hotfix records, files, icons, textures, spells, encounters, items, creatures, decor, Builds, profiles, cache, and diagnostics. Use when a user asks to inspect, search, stream, decode, or export WoW data or diagnose wowdata.
4
4
  ---
5
5
 
6
6
  # wowdata
7
7
 
8
8
  Use the `wowdata` executable from `PATH`. This Skill is CLI-only: do not search for a bundled executable and do not use MCP or another server transport.
9
9
 
10
- ## Resolve The Target
10
+ ## Choose the command
11
11
 
12
- Resolve the target before running a command that reads CASC or DB2 data.
12
+ - Use `sql` for a read-only DB2 query, including joins, subqueries, CTEs, aggregates, ordering, limits, `EXPLAIN`, or `ANALYZE`. Read [sql.md](references/sql.md).
13
+ - Use `hotfix query` for Hotfix records. Hotfix is an independent query system, not a DB2 SQL table. Read [hotfix.md](references/hotfix.md).
14
+ - Use `db2` for schema, rows, search, foreign-key, and stream operations; use domain commands for semantic workflows; use `casc`, `file`, `icon`, `video`, `profile`, `cache`, `doctor`, or `warmup` for their named purposes. Read [commands.md](references/commands.md) when a flag or command shape is unfamiliar, and [tables.yaml](references/tables.yaml) when mapping a semantic request to DB2 tables.
13
15
 
14
- 1. If the user gives a Profile, pass only `--profile <name>`. Do not combine a Profile with target flags.
15
- 2. Resolve the product from the user's words or established conversation context. Read [clients.yaml](references/clients.yaml) for English and Chinese aliases. Product has no default; if it is still missing or ambiguous, ask one short product question and do not run a data command yet. Treat “硬核服” as a server rule, not a product: resolve its classic-era or anniversary product from context, or ask which one.
16
- 3. Preserve every explicit source, path, region, product, Build, and locale value.
17
- 4. When no source or local path is stated, use remote CDN data.
18
- 5. For an otherwise unspecified remote target, pass `--source remote --region cn --build latest --locale zhCN` plus the resolved product.
19
- 6. For `--source local`, require the client `--path` and complete every remaining target field explicitly. Do not replace missing local-client facts with guesses.
16
+ ## Resolve the target
20
17
 
21
- Never rely on CLI target defaults; the CLI intentionally has none. `--build latest` resolves at execution time, so never store a current Build number in this Skill. Read [locales.yaml](references/locales.yaml) when mapping natural-language locale names.
18
+ Resolve the target before reading CASC or DB2 data.
22
19
 
23
- Commands that do not read a game target do not need the full target: `video demux`, `doctor`, `cache`, `profile`, `update`, and `uninstall`. `casc products` uses only source discovery flags such as `--source remote --region cn` or `--source local --path <client>`.
20
+ 1. If the user gives a Profile, pass only `--profile <name>`; do not combine it with target flags.
21
+ 2. Resolve product from the user's words or conversation context. Read [clients.yaml](references/clients.yaml) for aliases. Product has no default; if it remains ambiguous, ask one short product question before running a data command. Treat “硬核服” as a server rule and resolve its actual product from context.
22
+ 3. Preserve every explicit source, path, region, product, Build, and locale. Read [locales.yaml](references/locales.yaml) for locale aliases.
23
+ 4. If no source or local path is stated, use remote CDN. For an otherwise unspecified remote target, pass `--source remote --region cn --build latest --locale zhCN` plus the resolved product.
24
+ 5. For `--source local`, require `--path <client>` and complete the remaining target fields explicitly; never guess missing local-client facts.
24
25
 
25
- ## Run Atomic Commands
26
+ Never rely on CLI target defaults; the CLI intentionally has none. `--build latest` resolves at execution time and must not be hard-coded in this Skill.
26
27
 
27
- Call the business command directly. Do not run `warmup` before an ordinary query. The CLI checks Build identity and cache integrity, downloads missing data, then completes the original query in the same process.
28
+ Commands that do not read a game target do not need the full target: `video demux`, `doctor`, `cache`, `profile`, `update`, and `uninstall`. `casc products` needs only source discovery flags.
28
29
 
29
- - Use `casc products` when the user asks which products or Builds exist.
30
- - Use `warmup` only when the user explicitly asks to download data ahead of time.
31
- - Use `doctor` after an environment, target, cache, or network failure needs diagnosis.
32
- - Read [commands.md](references/commands.md) before composing an unfamiliar command.
33
- - Read [tables.yaml](references/tables.yaml) when translating a semantic request into DB2 tables.
34
- - Never invent a DB2 field name from a natural-language label. If the user requests selected fields without giving exact schema names, run `db2 schema <table>` first, then use names returned by that schema.
35
- - Use `db2 rows`, never the obsolete `query rows` spelling.
36
- - Keep exports at the user-requested path, or in the current workspace when no path is given.
37
- - Do not run `cache clear`, `profile remove`, `update`, or `uninstall` unless the user explicitly requests that action.
30
+ ## Execute and report
38
31
 
39
- ```powershell
40
- wowdata db2 rows SpellName --id 133 --source remote --region cn --product wow --build latest --locale zhCN
41
- wowdata item textures --item-id 19019 --profile retail-cn
42
- wowdata icon export --file-data-id 134400 --format png --output output/icon.png --source remote --region cn --product wow --build latest --locale zhCN
43
- ```
32
+ Call the business command directly. Do not run `warmup` before an ordinary query; the CLI prepares required dependencies in-process. Keep exports at the requested path, or the current workspace when no path is given. Do not run destructive maintenance (`cache clear`, `profile remove`, `update`, `uninstall`) unless explicitly requested.
44
33
 
45
- ## Read Results
34
+ Treat stdout, stderr, and exit status as one contract: progress on stderr is informational; stdout is the result. Exit `0` is success. Exit `1` with JSON stdout is a structured failure—report `error.code` and `error.message`; plain stderr indicates CLI parsing/setup failure. A successful zero-row response is valid; check ID, product, Build, and locale before changing the query.
46
35
 
47
- Treat the streams and exit status as one contract:
48
-
49
- - stderr contains preparation and download progress. If it reports `prepare` or `download`, let the command continue; do not start a separate warmup.
50
- - stdout contains the final JSON. `db2 stream` defaults to JSONL; parse it line by line or pass `--format json` when one JSON document is preferable.
51
- - Exit code `0` corresponds to `"ok": true`.
52
- - Exit code `1` with JSON stdout corresponds to `"ok": false`; report `error.code` and `error.message`. A CLI parsing error may instead be plain stderr.
53
- - An `"ok": true` response with zero rows is a valid empty result. Recheck the ID, product, Build, and locale before trying another query.
54
-
55
- Return the requested result, not download narration. Preserve the product, resolved Build, region, locale, table or ID, and output path/hash when present so the answer remains traceable.
36
+ Preserve the resolved product, Build, region, locale, table/record identifiers, format, and output path/hash when present. Return requested data rather than download narration. See [errors.md](references/errors.md) for recovery decisions.
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "wowdata"
3
- short_description: "Query and export World of Warcraft data with the wowdata CLI"
4
- default_prompt: "Use $wowdata to query or export WoW data with an explicit product and a complete target."
3
+ short_description: "Query WoW data with SQL, Hotfix, and CLI"
4
+ default_prompt: "Use $wowdata to run a targeted WoW DB2 SQL or Hotfix query with an explicit data target."
@@ -0,0 +1,8 @@
1
+ # Failure handling
2
+
3
+ - Structured `{"ok":false,"error":{"code":...,"message":...}}` with exit `1`: report the code/message and retain the target and filters.
4
+ - Plain stderr with a usage/flag error: read the relevant `--help`, correct only the malformed flag, and retry once.
5
+ - Missing/ambiguous product, Build, locale, or local path: resolve from context or ask one concise question; do not guess.
6
+ - Cache/DBD/schema mismatch: run `doctor` or `db2 schema` for the same target; do not silently switch product or Build.
7
+ - Remote prepare/download failure: report provider and target, then retry with the same explicit target or use an explicitly requested local cache/profile. Do not launch a separate warmup unless requested.
8
+ - Empty success: treat as valid; verify identifiers and locale before trying another source.
@@ -0,0 +1,14 @@
1
+ # Independent Hotfix queries
2
+
3
+ Use `wowdata hotfix query`; do not express Hotfix lookups as DB2 SQL. The default source is Wago; select `dbcache` for a local `DBCache.bin` or `raidbots` for a recent snapshot.
4
+
5
+ ```powershell
6
+ wowdata hotfix query --source dbcache --dbcache <DBCache.bin> --product <product> --build <build> --region <id> --locale <locale> --table <table> --record <id> --raw
7
+ wowdata hotfix query --source wago --product wow_classic_titan --build 3.80.2.69137 --region 196 --locale zhCN --table SpellPowerDifficulty --latest --format json
8
+ ```
9
+
10
+ Useful filters: `--table`, `--record`, `--push`, `--status`, `--search`, `--from`, `--to`, `--limit`, `--page`; `--decoded --dbd <definition>` adds decoded fields when the matching DBD is available. `--latest` returns the complete maximum-PushID batch. Output formats are `json`, `jsonl`, and `csv`; `--raw` preserves payloads.
11
+
12
+ Wago `--search` is candidate acceleration, not exact filtering. The adapter must exact-filter product, Build, region, locale, table, record, and status after parsing. A zero candidate page is not proof of a complete miss. Preserve raw status and PushID ordering; report provider, filters, page/coverage, and cache provenance.
13
+
14
+ Prefer local DBCache disk point lookups for immediate local data. Use Wago for remote history/complementary records and Raidbots only for recent snapshots. Do not route Hotfix through the static SQL path.
@@ -0,0 +1,31 @@
1
+ # wowdata-sql-v1 atomic queries
2
+
3
+ Use `wowdata sql` for one read-only, atomic DB2 query. It executes against static DB2 data and emits one structured response; it does not query Hotfix records.
4
+
5
+ ## Input forms
6
+
7
+ Provide exactly one SQL source:
8
+
9
+ ```powershell
10
+ wowdata sql "SELECT ID, Name_lang FROM SpellName WHERE ID = :spell_id" --param spell_id=133 --format json <target>
11
+ Get-Content query.sql -Raw | wowdata sql --stdin --format jsonl <target>
12
+ wowdata sql --file query.sql --format csv <target>
13
+ ```
14
+
15
+ `--param name=value` may be repeated. Parameters are named and should be used instead of interpolating user input. `--format` accepts `json` (default), `jsonl`, or `csv`.
16
+
17
+ ## Supported query shape
18
+
19
+ The engine supports projections and aliases, predicates, `IN`, joins, scalar/subqueries, CTEs including recursive CTEs, grouping/aggregates, ordering, and limits. Use `EXPLAIN` for a plan without row reads and `EXPLAIN ANALYZE` (or `EXPLAIN ANALYZE SELECT ...`) for execution counters and timings:
20
+
21
+ ```sql
22
+ EXPLAIN SELECT ID FROM SpellEffect WHERE SpellID = :spell_id;
23
+ EXPLAIN ANALYZE SELECT se.ID, COUNT(*) AS n
24
+ FROM SpellEffect se WHERE se.SpellID = :spell_id GROUP BY se.ID;
25
+ ```
26
+
27
+ Table and field names must match the resolved Build's DBD schema. Use `wowdata db2 schema <table> <target>` first when uncertain. Keep result sets bounded with predicates and `LIMIT`; use `db2 stream` for a simple full-table stream.
28
+
29
+ ## Target and output rules
30
+
31
+ Append a complete target or `--profile`. Local SQL regression should use `--source local --path <client>` and explicit product/Build/locale/region. SQL has no Hotfix fallback. Report the query source, parameters (redacting secrets), target, format, row count, and plan/timing fields when requested.