@ttmg/cli 0.4.6-vibe-beta.13 → 0.4.6-vibe-beta.15
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 +72 -3
- package/dist/index.js +905 -12
- package/dist/index.js.map +1 -1
- package/dist/package.json +5 -4
- package/dist/scripts/verify-agent-contract.js +22 -0
- package/dist/scripts/vibe-upload-smoke.js +86 -3
- package/dist/scripts/wasm-collect-smoke.js +78 -0
- package/dist/scripts/wasm-collect-test-preload.cjs +13 -0
- package/package.json +5 -4
- package/vibe-upload.md +107 -9
package/README.md
CHANGED
|
@@ -9,6 +9,14 @@ Vibe real web authorization and upload: use `--web` with the title, local icon a
|
|
|
9
9
|
|
|
10
10
|
#### Installation 安装
|
|
11
11
|
|
|
12
|
+
`0.4.6-vibe-beta.15`:Vibe 上传支持 Skill 传入 `--description "游戏描述"`。省略时默认使用 `Discover the fun of TikTok Mini Games.`;旧 `--app-info` 文件中的描述继续保留。详见 [Quick Start 与描述参数](vibe-upload.md)。
|
|
13
|
+
|
|
14
|
+
`0.4.6-vibe-beta.15`: Vibe upload accepts `--description "Game description"` from a Skill. When omitted, it uses `Discover the fun of TikTok Mini Games.` or preserves the description from a legacy `--app-info` file. See [Quick Start and description usage](vibe-upload.md).
|
|
15
|
+
|
|
16
|
+
`0.4.6-vibe-beta.14` 支持分类查询与可选上传分类参数。Skill 可用 `ttmg game categories --format json` 查询,再向 Vibe 上传传入 `--category Puzzle --subcategory Physics`。两个参数都省略时保留 Other/Other;详见 [分类用法](vibe-upload.md)。
|
|
17
|
+
|
|
18
|
+
`0.4.6-vibe-beta.14` supports category discovery and optional upload classification. Query `ttmg game categories --format json`, then pass `--category Puzzle --subcategory Physics` to Vibe upload. Omitting both preserves Other/Other. See [category usage](vibe-upload.md).
|
|
19
|
+
|
|
12
20
|
For Vibe Web authorization and upload, install the `vibe-beta` release:
|
|
13
21
|
Vibe 网页授权上传安装 `vibe-beta` 版本:
|
|
14
22
|
|
|
@@ -26,7 +34,7 @@ For Agent and Monetization workflows, the published beta is:
|
|
|
26
34
|
Agent、商业化流程的已发布 beta 为:
|
|
27
35
|
|
|
28
36
|
```bash
|
|
29
|
-
npm install -g @ttmg/cli@0.4.6-agent-beta.
|
|
37
|
+
npm install -g @ttmg/cli@0.4.6-agent-beta.3
|
|
30
38
|
ttmg --version
|
|
31
39
|
ttmg capabilities --format json
|
|
32
40
|
```
|
|
@@ -233,9 +241,70 @@ ttmg dev session stop <SESSION_ID> --format json
|
|
|
233
241
|
|
|
234
242
|
### Wasm prepare and split / Wasm 准备与分包
|
|
235
243
|
|
|
244
|
+
#### Platform collection commands (agent-beta.3) / 平台采集命令
|
|
245
|
+
|
|
246
|
+
Install `0.4.6-agent-beta.3` and check `commands.wasmCollect` in `ttmg capabilities`.
|
|
247
|
+
The CLI uses its own `ttmg login` session; do not pass or read Cookie values in
|
|
248
|
+
Agent prompts, arguments or local HTTP requests. No running DevTool server is required.
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
ttmg wasm prepare --input original.wasm.br --output .ttmg/wasm/prepared --format json
|
|
252
|
+
# Use prepare's input.wasmMd5 for <MD5> and configure the instrumented game
|
|
253
|
+
# to report that same original MD5 and Client Key.
|
|
254
|
+
ttmg wasm collect start --client-key <CLIENT_KEY> --wasm-md5 <MD5> --format json
|
|
255
|
+
# Integrate the prepared copy, scan, clear device storage and play the game.
|
|
256
|
+
ttmg wasm collect export --client-key <CLIENT_KEY> --wasm-md5 <MD5> \
|
|
257
|
+
--input original.wasm.br --output .ttmg/wasm/collection.json --format json
|
|
258
|
+
ttmg wasm split --input original.wasm.br --collection .ttmg/wasm/collection.json --output .ttmg/wasm/split --format json
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Run these examples at the game project root. Keep collection and temporary
|
|
262
|
+
artifacts outside the project or under its root `.ttmg`; an ordinary JSON file
|
|
263
|
+
in game assets can be included in future builds and uploads.
|
|
264
|
+
`start` opens or resumes a window and preserves existing IDs by default.
|
|
265
|
+
`--reset` clears platform collection for this game and MD5; it does not clear
|
|
266
|
+
phone storage. On an uncertain start or timeout, retry without `--reset`.
|
|
267
|
+
`export` reads a union snapshot without closing the window. It needs the original
|
|
268
|
+
Wasm, validates the collection MD5 against its file bytes or uncompressed bytes,
|
|
269
|
+
and writes schema 1 with the uncompressed `wasmSha256`, `funcIds` and `bootFuncIds`.
|
|
270
|
+
Read the file at the returned `collection.path`. Existing files are rejected;
|
|
271
|
+
use a new output name for each snapshot. Credentials and raw API responses are
|
|
272
|
+
omitted even with `--verbose`.
|
|
273
|
+
|
|
274
|
+
Only `start` writes platform state. `export` only reads collection and writes a
|
|
275
|
+
local file. Neither command changes Unity files or clears device storage.
|
|
276
|
+
Platform requests default to 30 seconds (`--timeout`, 1–300). Missing or expired
|
|
277
|
+
login returns `WASM_AUTH_REQUIRED`; empty collection returns `WASM_COLLECTION_EMPTY`;
|
|
278
|
+
an unmatched original returns `WASM_COLLECTION_MISMATCH`. No file is published on
|
|
279
|
+
these failures. A nonempty collection does not prove gameplay coverage.
|
|
280
|
+
The commands reuse the existing platform request environment; local fixture
|
|
281
|
+
tests do not establish real platform or device acceptance.
|
|
282
|
+
|
|
283
|
+
安装 `0.4.6-agent-beta.3`,通过 `ttmg capabilities` 中的 `commands.wasmCollect` 确认支持。
|
|
284
|
+
CLI 内部复用 `ttmg login` 登录态,无需运行 DevTool 本地服务,Agent 不读取或传递 Cookie。
|
|
285
|
+
按上方命令执行:prepare → 开采集窗口 → 接入插桩副本并扫码、清存储、玩游戏 → export → split。
|
|
286
|
+
`<MD5>` 使用 prepare 返回的 `input.wasmMd5`,插桩游戏须上报相同的原始 MD5 和 Client Key。
|
|
287
|
+
|
|
288
|
+
示例在游戏工程根目录执行。采集文件和临时产物应放工程外或根目录 `.ttmg` 下;
|
|
289
|
+
放在普通游戏资源目录的 JSON 会参与后续构建和上传。
|
|
290
|
+
`start` 默认保留已有函数 ID;只有 `--reset` 清空平台上此游戏、此 MD5 的历史采集,
|
|
291
|
+
不会清理手机存储。超时或不确定是否成功时,不带 `--reset` 重试。
|
|
292
|
+
`export` 读取当前合集快照,不关闭采集窗口;必须提供原始 Wasm,命令校验文件字节或
|
|
293
|
+
解压后字节的 MD5,再写入 schema 1、解压后原始 `wasmSha256`、`funcIds` 和 `bootFuncIds`。
|
|
294
|
+
从返回的 `collection.path` 读取文件;已有文件不覆盖,每轮快照使用新文件名。
|
|
295
|
+
即使开启 `--verbose`,也不输出登录凭证或原始接口响应。
|
|
296
|
+
|
|
297
|
+
仅 `start` 写平台状态;`export` 只读平台并写本地文件。两者均不写回 Unity 工程或清理手机存储。
|
|
298
|
+
请求默认超时 30 秒,`--timeout` 范围为 1–300 秒。未登录或登录过期返回 `WASM_AUTH_REQUIRED`,
|
|
299
|
+
空采集返回 `WASM_COLLECTION_EMPTY`,原始文件不匹配返回 `WASM_COLLECTION_MISMATCH`;
|
|
300
|
+
这些失败不会生成采集文件。非空结果不等于玩法覆盖完整。
|
|
301
|
+
命令沿用现有平台请求环境;本地模拟测试不代表真实平台或真机验收。
|
|
302
|
+
|
|
303
|
+
#### Local artifacts / 本地产物
|
|
304
|
+
|
|
236
305
|
```bash
|
|
237
|
-
ttmg wasm prepare --input original.wasm.br --output prepared --format json
|
|
238
|
-
ttmg wasm split --input original.wasm.br --collection collection.json --output split --format json
|
|
306
|
+
ttmg wasm prepare --input original.wasm.br --output .ttmg/wasm/prepared --format json
|
|
307
|
+
ttmg wasm split --input original.wasm.br --collection .ttmg/wasm/collection.json --output .ttmg/wasm/split --format json
|
|
239
308
|
```
|
|
240
309
|
|
|
241
310
|
These experimental commands create artifacts in a new directory; they do not
|