@follenfang/wowdata 0.0.1 → 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/LICENSE CHANGED
@@ -1,10 +1,10 @@
1
- GNU AFFERO GENERAL PUBLIC LICENSE
2
- Version 3, 19 November 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
6
-
7
- wowdata is licensed under the GNU Affero General Public License version 3 or any later version.
8
-
9
- Full license text:
10
- https://www.gnu.org/licenses/agpl-3.0.txt
1
+ GNU AFFERO GENERAL PUBLIC LICENSE
2
+ Version 3, 19 November 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
6
+
7
+ wowdata is licensed under the GNU Affero General Public License version 3 or any later version.
8
+
9
+ Full license text:
10
+ https://www.gnu.org/licenses/agpl-3.0.txt
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,50 +78,90 @@ 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. 完成查询并返回最终结果。
62
-
63
- 准备和下载进度写入 stderr,最终结构化结果写入 stdout JSON。多个独立 CDN 对象和清单默认使用 4 个 worker 并发下载;可以通过 `wowdata cache config --workers N` 调整。
64
-
65
- ## 发现与提前准备
105
+ 4. 执行查询并返回最终 JSON。
66
106
 
67
- 查看某个区域当前提供的真实产品和 Build 组合:
107
+ 只有需要提前准备数据时,才显式运行:
68
108
 
69
109
  ```bash
70
- wowdata casc products --source remote --region cn
110
+ wowdata warmup --source remote --region cn \
111
+ --product wow --build latest --locale zhCN
112
+ ```
113
+
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
+ }
71
145
  ```
72
146
 
73
- 需要提前下载时再显式使用 `warmup`:
147
+ - 成功:stdout 返回 `"ok": true`,退出码为 `0`。
148
+ - 业务错误:stdout 返回 `"ok": false` 和结构化错误,退出码为 `1`。
149
+ - 下载、缓存准备等进度只写入 stderr。
150
+ - 参数解析错误写入 stderr,退出码为 `1`。
151
+
152
+ 普通 Shell 可以直接同时使用退出码和 JSON:
74
153
 
75
154
  ```bash
76
- wowdata warmup \
77
- --source remote \
78
- --region cn \
79
- --product wow \
80
- --build latest \
81
- --locale zhCN
155
+ if wowdata db2 rows SpellName --id 133 \
156
+ --source remote --region cn --product wow --build latest --locale zhCN \
157
+ >result.json; then
158
+ jq '.data.rows' result.json
159
+ else
160
+ jq '.error' result.json
161
+ fi
82
162
  ```
83
163
 
84
- ## 本地目录
164
+ ### 缓存与本地目录
85
165
 
86
166
  ```text
87
167
  ~/.wowdata/
@@ -89,18 +169,13 @@ wowdata warmup \
89
169
  ├── config/ 用户配置
90
170
  ├── profiles/ 完整数据目标
91
171
  ├── builds/ 不可变 Build 快照
92
- ├── cache/
93
- │ ├── casc/
94
- │ ├── dbd/
95
- │ ├── listfile/
96
- │ ├── tact/
97
- │ └── manifests/
172
+ ├── cache/ CASC、DBD、Listfile、TACT 与清单缓存
98
173
  ├── state/ 安装和最近状态
99
174
  ├── tmp/ 下载临时文件
100
175
  └── locks/ 跨进程下载锁
101
176
  ```
102
177
 
103
- 缓存默认上限为 20GB。每个 Profile 的当前 Build 和上一个 Build 不参与自动清理,更老的 Build 按最久未使用顺序清理。
178
+ 缓存默认上限为 20 GB。当前 Build 和上一个 Build 不参与自动清理,更早的 Build 按最久未使用顺序清理。
104
179
 
105
180
  ```bash
106
181
  wowdata cache status
@@ -110,66 +185,245 @@ wowdata cache clear
110
185
  wowdata cache config --max-gb 30 --workers 6
111
186
  ```
112
187
 
113
- 远端不可用时,CLI 可以使用已经通过完整性校验的离线缓存;缺失、损坏和未完成的缓存不会被使用。
188
+ 远端不可用时,CLI 会复用已经通过完整性校验的缓存;损坏或未完成的内容不会被使用。
189
+
190
+ ### Skill 的默认规则
191
+
192
+ CLI 本身没有目标默认值。随 npm 安装的 Skill 会在用户未指定时明确传入:
193
+
194
+ - 地区:`cn`
195
+ - Build:`latest`
196
+ - 语言:`zhCN`
114
197
 
115
- ## 诊断和维护
198
+ 产品没有默认值。无法从问题或上下文确定产品时,Skill 会先询问。
199
+
200
+ ### 维护
116
201
 
117
202
  ```bash
118
203
  wowdata doctor
119
204
  wowdata update
120
- wowdata update --version 1.2.3
205
+ wowdata update --version 0.0.2
121
206
  wowdata uninstall
122
207
  wowdata uninstall --keep-data
123
208
  ```
124
209
 
125
- `doctor` 只读检查 CLI/npm、目录、Profile、缓存完整性和基础网络,不自动修改数据。
210
+ `doctor` 是只读检查。`uninstall --keep-data` 会删除程序和托管 Skill,但保留 Profile、Build 与缓存。
126
211
 
127
- `uninstall` 默认删除 CLI、托管 Skill 和整个 `~/.wowdata`。使用 `--keep-data` 时保留配置、Profile、Build 和缓存。安装遇到非本包托管的旧 Skill 时会先备份,不会直接覆盖。
212
+ ### 从源码构建
128
213
 
129
- ## 命令
214
+ ```bash
215
+ go test ./... -count=1
216
+ go build -trimpath -o dist/wowdata ./cmd/wowdata
217
+ npm test
218
+ ```
130
219
 
131
- ```text
132
- warmup
133
- db2 schema/rows/search/foreign-key/stream
134
- spell info/auras/summons
135
- encounter get
136
- file lookup/search/extension/get/exists/encoding/export
137
- icon export
138
- casc info/products/diagnose
139
- item get/models/geosets/textures
140
- creature display/model
141
- decor list/get
142
- video demux
143
- profile list/show/set/remove
144
- cache status/verify/prune/clear/config
145
- doctor
146
- update
147
- 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
148
244
  ```
149
245
 
150
- 运行 `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`.
258
+
259
+ Standalone binaries are also available from [GitHub Releases](https://github.com/Follen/wowdata/releases/latest).
260
+
261
+ ### Quick start
151
262
 
152
- ## 从源码构建
263
+ The CLI does not guess a region, product, Build, or locale. Data commands require an explicit target:
153
264
 
154
265
  ```bash
155
- go test ./... -count=1
156
- go build -trimpath -o dist/wowdata ./cmd/wowdata
157
- npm test
266
+ wowdata db2 rows SpellName --id 123 \
267
+ --source remote \
268
+ --region cn \
269
+ --product wow \
270
+ --build latest \
271
+ --locale zhCN
272
+ ```
273
+
274
+ Save frequently used targets as Profiles:
275
+
276
+ ```bash
277
+ wowdata profile set retail-cn \
278
+ --source remote \
279
+ --region cn \
280
+ --product wow \
281
+ --build latest \
282
+ --locale zhCN
283
+
284
+ wowdata spell info --spell-id 123 --profile retail-cn
285
+ ```
286
+
287
+ Discover the products and Builds currently available in a region:
288
+
289
+ ```bash
290
+ wowdata casc products --source remote --region cn
158
291
  ```
159
292
 
160
- Go 负责数据解析和命令执行;Node.js 只负责 npm 安装、启动桥接和包生命周期,所有脚本都在 `npm/` 中可审计。
293
+ ### Warmup is optional
294
+
295
+ Run the query directly:
161
296
 
162
- ## 发布
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
301
+ ```
163
302
 
164
- 推送语义版本 tag 会触发 GitHub Actions:
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:
165
311
 
166
312
  ```bash
167
- git tag v1.2.3
168
- git push origin v1.2.3
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
+ }
169
348
  ```
170
349
 
171
- 工作流会测试 Go npm、构建五个平台、生成 `SHA256SUMS`、创建 GitHub Release,并发布同版本 `@follenfang/wowdata`。
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
+ ```
422
+
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.
424
+
425
+ ---
172
426
 
173
427
  ## License
174
428
 
175
- AGPL-3.0-or-later
429
+ [AGPL-3.0-or-later](LICENSE)
@@ -0,0 +1,5 @@
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.1",
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,39 +1,36 @@
1
1
  ---
2
2
  name: wowdata
3
- description: Use the wowdata CLI for World of Warcraft CASC, DB2, file, icon, spell, encounter, item, creature, decor, video, Build, cache, and diagnostic tasks.
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
- CLI only. Run `wowdata` from PATH. Do not look for a bundled executable and do not use any server transport.
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
- ## Target Contract
10
+ ## Choose the command
11
11
 
12
- Every data command must receive a complete target or an explicit `--profile`.
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. Preserve source, path, region, product, Build, and locale when the user states them.
15
- 2. For an unspecified remote region, Build, or locale, explicitly pass `--source remote --region cn --build latest --locale zhCN`.
16
- 3. Product has no default. Resolve it from the user's words or the current conversation only when there is one unambiguous product. Otherwise ask the user which product they mean before running the CLI.
17
- 4. Never rely on CLI defaults. The CLI intentionally has none.
16
+ ## Resolve the target
18
17
 
19
- Read [clients.yaml](references/clients.yaml) for stable product aliases and [locales.yaml](references/locales.yaml) for language aliases. Do not store a current Build number in this Skill.
18
+ Resolve the target before reading CASC or DB2 data.
20
19
 
21
- ## Atomic Use
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.
22
25
 
23
- Call the business command directly. The CLI checks Build identity and cache integrity, downloads missing data, reports preparation on stderr, then returns the final JSON on stdout. Do not run `warmup` before ordinary queries.
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.
24
27
 
25
- Use `casc products` only when the user asks which combinations exist. Use `warmup` only when the user explicitly asks to download data ahead of time. Use `doctor` when a command reports an environment, cache, target, or network problem.
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.
26
29
 
27
- ```powershell
28
- wowdata db2 rows SpellName --id 123 --source remote --region cn --product wow --build latest --locale zhCN
29
- wowdata spell info --spell-id 123 --source remote --region cn --product wow_classic --build latest --locale zhCN
30
- wowdata icon export --file-data-id 134400 --format png --output output/icon.png --source remote --region cn --product wow --build latest --locale zhCN
31
- wowdata casc products --source remote --region cn
32
- wowdata doctor
33
- ```
30
+ ## Execute and report
34
31
 
35
- Read [commands.md](references/commands.md) before composing unfamiliar commands and [tables.yaml](references/tables.yaml) when mapping a semantic task to DB2 tables. Keep exported files in the user's requested directory or the current workspace.
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.
36
33
 
37
- ## Output
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.
38
35
 
39
- Preparation and download progress is stderr. The final structured result is stdout JSON. Preserve product, resolved Build, region, locale, table, fileDataID, output path, and diagnostics in the answer so the result stays 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.1
1
+ 0.0.3
@@ -1,4 +1,4 @@
1
1
  interface:
2
- display_name: wowdata
3
- short_description: Query and export World of Warcraft data through the wowdata CLI.
4
- default_prompt: Use wowdata atomic CLI commands with a complete explicit target. Default remote region/build/locale to cn/latest/zhCN in the Skill, and ask when product is unclear.
2
+ display_name: "wowdata"
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."
@@ -2,12 +2,28 @@ schema: wowdata.clients.v1
2
2
  clients:
3
3
  retail: wow
4
4
  ptr: wowt
5
+ 正式服测试服: wowt
6
+ "正式服 PTR": wowt
5
7
  ptr2: wowxptr
6
8
  beta: wow_beta
7
9
  classic: wow_classic
10
+ 怀旧服: wow_classic
8
11
  classic-ptr: wow_classic_ptr
12
+ "怀旧服 PTR": wow_classic_ptr
13
+ 怀旧服测试服: wow_classic_ptr
9
14
  classic-beta: wow_classic_beta
10
15
  classic-era: wow_classic_era
16
+ 怀中怀: wow_classic_era
17
+ "60级": wow_classic_era
18
+ 香草服: wow_classic_era
11
19
  classic-era-ptr: wow_classic_era_ptr
12
20
  classic-anniversary: wow_anniversary
13
21
  classic-titan: wow_classic_titan
22
+ 泰坦服: wow_classic_titan
23
+ 泰坦重铸: wow_classic_titan
24
+ 时光服: wow_classic_titan
25
+ contextualAliases:
26
+ 硬核服:
27
+ type: realm-rule
28
+ products: [wow_classic_era, wow_anniversary]
29
+ instruction: Do not treat as a product. Resolve the underlying classic-era or anniversary product from context; ask which one when unclear.
@@ -1,24 +1,85 @@
1
1
  # Command Reference
2
2
 
3
- Run `wowdata <command> --help` when a flag is uncertain. Every data command needs either `--profile <name>` or a complete target.
3
+ Run `wowdata <command> --help` when a flag is uncertain.
4
4
 
5
- | Intent | Atomic command |
5
+ For commands that read CASC or DB2, append either:
6
+
7
+ ```text
8
+ --profile <name>
9
+ ```
10
+
11
+ or a complete target:
12
+
13
+ ```text
14
+ --source remote --region <region> --product <product> --build <latest|version|build-id|config-key> --locale <locale>
15
+ ```
16
+
17
+ Use `--source local --path <client>` plus explicit region, product, Build, and locale for a local client.
18
+
19
+ ## Discovery And Preparation
20
+
21
+ | Intent | Command |
22
+ | --- | --- |
23
+ | List remote product/Build/locale combinations | `casc products --source remote --region <region>` |
24
+ | List local client combinations | `casc products --source local --path <client>` |
25
+ | Inspect resolved CASC and Build state | `casc info <target>` |
26
+ | Diagnose CDN, root, encoding, archive, cache, and TACT state | `casc diagnose <target>` |
27
+ | Download ahead of time | `warmup <target>` |
28
+
29
+ Ordinary queries prepare their own dependencies. Do not call `warmup` as a prerequisite.
30
+
31
+ ## DB2 And Domain Queries
32
+
33
+ | Intent | Command |
6
34
  | --- | --- |
7
- | Discover products and Builds | `casc products` |
8
- | Prepare data ahead of time | `warmup` |
9
- | DB2 schema, rows, text search, relations, stream | `db2 schema/rows/search/foreign-key/stream` |
10
- | Spell details, auras, summons | `spell info/auras/summons` |
11
- | Encounter tree | `encounter get` |
12
- | File lookup, search, type, fetch, existence, encoding, export | `file lookup/search/extension/get/exists/encoding/export` |
13
- | Export BLP icon | `icon export` |
14
- | Build and CASC state | `casc info/products/diagnose` |
15
- | Item data and assets | `item get/models/geosets/textures` |
16
- | Creature display and model | `creature display/model` |
17
- | Decor data | `decor list/get` |
18
- | Video container | `video demux` |
19
- | Named complete targets | `profile list/show/set/remove` |
20
- | Cache lifecycle | `cache status/verify/prune/clear/config` |
21
- | Installation diagnosis | `doctor` |
22
- | Package maintenance | `update`, `uninstall` |
23
-
24
- Do not use the obsolete `query rows` spelling. The command is `db2 rows`.
35
+ | Inspect table fields and row count | `db2 schema <table> <target>` |
36
+ | Read rows by ID | `db2 rows <table> --id <id[,id...]> [--fields <field,...>] <target>` |
37
+ | Read multiple IDs | `db2 rows <table> --ids <id,...> <target>` |
38
+ | Filter rows | `db2 rows <table> --filter <field=value> [--limit N] <target>` |
39
+ | Search localized or text fields | `db2 search <table> --field <field> --query <text> [--limit N] <target>` |
40
+ | Follow a numeric relation | `db2 foreign-key <table> --field <field> --value <id> <target>` |
41
+ | Stream a large table | `db2 stream <table> [--fields <field,...>] [--filter <field=value>] [--limit N] [--format jsonl|json] <target>` |
42
+ | Inspect spell relationships | `spell info --spell-id <id> [--max-depth N] <target>` |
43
+ | Detect spell aura behavior | `spell auras --spell-id <id> <target>` |
44
+ | Detect summoned NPCs | `spell summons --spell-id <id> [--npc-id <id>] <target>` |
45
+ | Read an encounter section tree | `encounter get --journal-encounter-id <id> <target>` |
46
+ | Read item metadata | `item get --item-id <id> <target>` |
47
+ | Read item model and texture IDs | `item models --item-id <id> [--race-id N] [--gender 0|1] <target>` |
48
+ | Read item geosets | `item geosets --item-id <id> <target>` |
49
+ | Read item textures | `item textures --item-id <id> <target>` |
50
+ | Read a creature display | `creature display (--display-id <id>|--file-data-id <id>) <target>` |
51
+ | Find displays for a creature model | `creature model --file-data-id <id> <target>` |
52
+ | List decor | `decor list [--limit N] <target>` |
53
+ | Read decor | `decor get (--id <id>|--model-file-data-id <id>) <target>` |
54
+
55
+ Never translate a semantic label such as "name", "description", or "model" directly into a guessed DB2 field. When exact field names are not supplied, run `db2 schema` first and use the returned names. Then use `--fields` to keep large row responses focused.
56
+
57
+ ## Files And Media
58
+
59
+ | Intent | Command |
60
+ | --- | --- |
61
+ | Resolve a fileDataID | `file lookup --file-data-id <id> <target>` |
62
+ | Search names in the listfile | `file search --query <text> [--limit N] <target>` |
63
+ | List by extension | `file extension --extension <ext> [--limit N] <target>` |
64
+ | Read file size and hash | `file get (--file-data-id <id>|--filename <name>) <target>` |
65
+ | Read or write a raw file | `file get (--file-data-id <id>|--filename <name>) --output <path> <target>` |
66
+ | Test existence | `file exists (--file-data-id <id>|--filename <name>) <target>` |
67
+ | Inspect content/encoding keys | `file encoding --file-data-id <id> <target>` |
68
+ | Export a raw file | `file export (--file-data-id <id>|--filename <name>) --output <path> <target>` |
69
+ | Decode a BLP texture | `icon export --file-data-id <id> --format png|webp --output <path> [--mipmap N] [--mask N] <target>` |
70
+ | Inspect a local VP9 AVI container | `video demux --input <file> [--output <directory>]` |
71
+
72
+ `file get` without `--output` returns metadata, not raw bytes in JSON. Use `file export` or `file get --output` when the user needs an artifact.
73
+
74
+ ## Profiles, Cache, And Maintenance
75
+
76
+ | Intent | Command |
77
+ | --- | --- |
78
+ | Manage complete targets | `profile list`, `profile show <name>`, `profile set <name> <target>`, `profile remove <name>` |
79
+ | Inspect or verify cache | `cache status`, `cache verify` |
80
+ | Manage cache | `cache prune`, `cache clear`, `cache config [--max-gb N] [--workers N]` |
81
+ | Diagnose installation | `doctor` |
82
+ | Update package | `update [--version latest|x.y.z]` |
83
+ | Uninstall | `uninstall [--keep-data]` |
84
+
85
+ Profile flags and explicit target flags are mutually exclusive. Treat cache clearing, Profile removal, update, and uninstall as explicit user actions.
@@ -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.