@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 +10 -10
- package/README.md +329 -75
- package/dist/SHA256SUMS +5 -0
- package/dist/wowdata-darwin-amd64 +0 -0
- package/dist/wowdata-darwin-arm64 +0 -0
- package/dist/wowdata-linux-amd64 +0 -0
- package/dist/wowdata-linux-arm64 +0 -0
- package/dist/wowdata-windows-amd64.exe +0 -0
- package/package.json +1 -1
- package/skill/wowdata/SKILL.md +19 -22
- package/skill/wowdata/VERSION +1 -1
- package/skill/wowdata/agents/openai.yaml +3 -3
- package/skill/wowdata/references/clients.yaml +16 -0
- package/skill/wowdata/references/commands.md +81 -20
- package/skill/wowdata/references/errors.md +8 -0
- package/skill/wowdata/references/hotfix.md +14 -0
- package/skill/wowdata/references/sql.md +31 -0
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
|
-
|
|
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
|
+
[](https://www.npmjs.com/package/@follenfang/wowdata)
|
|
10
|
+
[](https://www.npmjs.com/package/@follenfang/wowdata)
|
|
11
|
+
[](https://github.com/Follen/wowdata/actions/workflows/ci.yml)
|
|
12
|
+
[](https://github.com/Follen/wowdata/releases/latest)
|
|
13
|
+
[](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
|
-
|
|
43
|
+
支持 Windows amd64、Linux amd64/arm64、macOS amd64/arm64。安装完成后:
|
|
12
44
|
|
|
13
|
-
|
|
14
|
-
|
|
45
|
+
```bash
|
|
46
|
+
wowdata --version
|
|
47
|
+
wowdata doctor
|
|
48
|
+
wowdata --help
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
npm 会安装:
|
|
15
52
|
|
|
16
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
81
|
+
wowdata spell info --spell-id 123 --profile retail-cn
|
|
42
82
|
```
|
|
43
83
|
|
|
44
|
-
|
|
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
|
|
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.
|
|
59
|
-
2.
|
|
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
|
-
|
|
107
|
+
只有需要提前准备数据时,才显式运行:
|
|
68
108
|
|
|
69
109
|
```bash
|
|
70
|
-
wowdata
|
|
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
|
-
|
|
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
|
|
77
|
-
--source remote \
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
缓存默认上限为
|
|
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
|
|
205
|
+
wowdata update --version 0.0.2
|
|
121
206
|
wowdata uninstall
|
|
122
207
|
wowdata uninstall --keep-data
|
|
123
208
|
```
|
|
124
209
|
|
|
125
|
-
`doctor`
|
|
210
|
+
`doctor` 是只读检查。`uninstall --keep-data` 会删除程序和托管 Skill,但保留 Profile、Build 与缓存。
|
|
126
211
|
|
|
127
|
-
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
168
|
-
|
|
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
|
-
|
|
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)
|
package/dist/SHA256SUMS
ADDED
|
@@ -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
|
package/dist/wowdata-linux-amd64
CHANGED
|
Binary file
|
package/dist/wowdata-linux-arm64
CHANGED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/skill/wowdata/SKILL.md
CHANGED
|
@@ -1,39 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wowdata
|
|
3
|
-
description:
|
|
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
|
-
##
|
|
10
|
+
## Choose the command
|
|
11
11
|
|
|
12
|
-
|
|
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
|
-
|
|
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
|
-
|
|
18
|
+
Resolve the target before reading CASC or DB2 data.
|
|
20
19
|
|
|
21
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
package/skill/wowdata/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.3
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
|
-
display_name: wowdata
|
|
3
|
-
short_description: Query
|
|
4
|
-
default_prompt: Use wowdata
|
|
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.
|
|
3
|
+
Run `wowdata <command> --help` when a flag is uncertain.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
24
|
-
|
|
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.
|