@ttmg/cli 0.4.6-agent-beta.2 → 0.4.6-agent-beta.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,10 +1,45 @@
1
1
  ### @ttmg/cli
2
2
 
3
+ Vibe 真实网页授权与上传:`ttmg upload --vibe --web --dir ./game --title "My game" --icon ./avatar.png --format ndjson`。只向用户收集标题和本地头像,并使用游戏目录或代码包;其他应用资料由 CLI 使用既有 PPE 试用默认值补齐,不需要用户填写。网页授权后,CLI 自动继续上传。见 [Vibe 接入说明](vibe-upload.md)。
4
+
5
+ Vibe real web authorization and upload: use `--web` with the title, local icon and game directory or ZIP. Collect only the title and icon from the user; the CLI fills other app metadata with existing PPE trial defaults. Upload continues after browser authorization. See [Vibe integration](vibe-upload.md).
6
+
3
7
  `ttmg` is a command-line tool designed for managing and developing mini-game projects. It supports initialization, development, debugging, and packaging for both H5 and native mini-games.
4
8
  `ttmg` 是一款专为小游戏项目管理与开发设计的命令行工具,支持 H5 小游戏和原生小游戏的初始化、开发调试及打包构建。
5
9
 
6
10
  #### Installation 安装
7
11
 
12
+ `0.4.6-vibe-beta.14` 支持分类查询与可选上传分类参数。Skill 可用 `ttmg game categories --format json` 查询,再向 Vibe 上传传入 `--category Puzzle --subcategory Physics`。两个参数都省略时保留 Other/Other;详见 [分类用法](vibe-upload.md)。
13
+
14
+ `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).
15
+
16
+ For Vibe Web authorization and upload, install the `vibe-beta` release:
17
+ Vibe 网页授权上传安装 `vibe-beta` 版本:
18
+
19
+ ```bash
20
+ npm install -g @ttmg/cli@vibe-beta
21
+ ttmg --version
22
+ ttmg capabilities --format json
23
+ ttmg upload --help
24
+ ```
25
+
26
+ The package includes [vibe-upload.md](vibe-upload.md). Keep the Web upload process running during authorization and read NDJSON until a terminal event. The `beta` and `vibe-beta` tags point to different published versions.
27
+ 安装包包含 [vibe-upload.md](vibe-upload.md)。授权期间保持原 Web 上传进程运行,持续读取 NDJSON,直到收到终态。`beta` 与 `vibe-beta` 指向不同发布版本。
28
+
29
+ For Agent and Monetization workflows, the published beta is:
30
+ Agent、商业化流程的已发布 beta 为:
31
+
32
+ ```bash
33
+ npm install -g @ttmg/cli@0.4.6-agent-beta.3
34
+ ttmg --version
35
+ ttmg capabilities --format json
36
+ ```
37
+
38
+ This version uses `ttmg-pack@0.4.13`. The unversioned installation below uses
39
+ the stable `latest` release and does not select this beta.
40
+ 本版依赖正式版 `ttmg-pack@0.4.13`。下方不指定版本的安装命令使用稳定版
41
+ `latest`,不会安装本次 beta。
42
+
8
43
  The Wasm split binding loads only when preparing or splitting Unity Wasm. A
9
44
  missing platform binding does not block CLI startup or unrelated commands.
10
45
  The split dependency `@anrans001/ttmg-wasmtool@0.3.3` provides Linux x64/arm64
@@ -37,25 +72,21 @@ Keep the upload process running; this command creates no task and reports only
37
72
  Skill 如需手动打开网页授权,读取上传进程 `waiting_authorization` 事件的 `pageUrl`,
38
73
  执行 `ttmg auth open --page-url <pageUrl> --format json`。保持原上传进程运行;
39
74
  新命令在 CLI 所在电脑打开系统浏览器,不新建任务,`open_requested` 不代表授权成功。
40
- 该功能需使用包含新命令的本地构建;已发布旧版不会因此自动增加命令。
75
+ `--web` 已自动打开授权页;上述辅助命令只用于重新打开同一任务的授权页。
41
76
 
42
- The experimental `upload --vibe` local prototype does not require platform login.
43
- Use `ttmg upload --vibe --mock` for the integration trial. No environment setup:
44
- task creation/polling use the built-in PPE lane; authorization and uploads are
45
- simulated. See [Vibe binding/upload](vibe-upload.md) for schema-v2 results.
46
- 实验性 `upload --vibe --mock` 不要求平台登录或环境配置。CLI 内置 PPE 创建/查询任务,
47
- 模拟授权和上传;本次结束于模拟上传完成,不含预览和发布。详见 [Vibe 绑定上传](vibe-upload.md)。
77
+ `ttmg upload --vibe --web` uses real browser authorization and uploads to PPE without a prior platform login or environment setup. `--mock` is a separate demo: task creation/polling are real, but authorization and material uploads are simulated. See [Vibe binding/upload](vibe-upload.md) for schema-v2 results.
78
+ `ttmg upload --vibe --web` 无需预先平台登录或配置环境,使用真实浏览器授权并上传到 PPE。`--mock` 是独立演示:真实创建/查询任务,模拟授权和素材上传。详见 [Vibe 绑定上传](vibe-upload.md)。
48
79
 
49
80
  `--mock` 现在会真实创建 PPE 任务,不再表示全程离线;真实请求失败仍报错。
50
81
  上线时由 CLI 发布版本去掉 PPE 路由,Skill 无需承担环境切换。
51
82
  `--mock` now creates real PPE tasks, not a fully offline run. Real request failures
52
83
  still fail. Production routing is a future CLI release change, not Skill configuration.
53
84
 
54
- 维护者可用 `--app-info ./app-info.json --dry-run` 校验完整应用信息和平台头像要求;文件字段见 [Vibe 绑定上传](vibe-upload.md)。不传此选项时,现有 Mock 输入保持不变。真实上传仍未开放。
55
- Maintainers can add `--app-info ./app-info.json --dry-run` to validate complete metadata and platform icon requirements; see [Vibe binding/upload](vibe-upload.md). Existing Mock inputs remain unchanged without this option. Real upload remains disabled.
85
+ 当前上传只需要标题、头像和游戏目录或代码包,其他应用资料由 CLI 使用既有 PPE 试用默认值补齐。Skill 读取 `inputRequirements`,不向用户索要额外资料;本地预检使用 `--dry-run`。
86
+ Current uploads need only the title, icon and game directory or ZIP. The CLI fills other metadata with existing PPE trial defaults. Read `inputRequirements` and do not request extra fields. Use `--dry-run` for local preparation.
56
87
 
57
- For the existing authenticated platform workflow, log in first; this does not apply to the local Vibe prototype above.
58
- 原有需要平台鉴权的流程仍先登录;上述 Vibe 本地原型不需要此步骤。
88
+ For the existing authenticated platform workflow, log in first; Vibe Web upload uses its own browser authorization.
89
+ 原有需要平台鉴权的流程仍先登录;Vibe Web 上传使用本次任务的浏览器授权。
59
90
 
60
91
  ```
61
92
  ttmg login
@@ -206,9 +237,70 @@ ttmg dev session stop <SESSION_ID> --format json
206
237
 
207
238
  ### Wasm prepare and split / Wasm 准备与分包
208
239
 
240
+ #### Platform collection commands (agent-beta.3) / 平台采集命令
241
+
242
+ Install `0.4.6-agent-beta.3` and check `commands.wasmCollect` in `ttmg capabilities`.
243
+ The CLI uses its own `ttmg login` session; do not pass or read Cookie values in
244
+ Agent prompts, arguments or local HTTP requests. No running DevTool server is required.
245
+
246
+ ```bash
247
+ ttmg wasm prepare --input original.wasm.br --output .ttmg/wasm/prepared --format json
248
+ # Use prepare's input.wasmMd5 for <MD5> and configure the instrumented game
249
+ # to report that same original MD5 and Client Key.
250
+ ttmg wasm collect start --client-key <CLIENT_KEY> --wasm-md5 <MD5> --format json
251
+ # Integrate the prepared copy, scan, clear device storage and play the game.
252
+ ttmg wasm collect export --client-key <CLIENT_KEY> --wasm-md5 <MD5> \
253
+ --input original.wasm.br --output .ttmg/wasm/collection.json --format json
254
+ ttmg wasm split --input original.wasm.br --collection .ttmg/wasm/collection.json --output .ttmg/wasm/split --format json
255
+ ```
256
+
257
+ Run these examples at the game project root. Keep collection and temporary
258
+ artifacts outside the project or under its root `.ttmg`; an ordinary JSON file
259
+ in game assets can be included in future builds and uploads.
260
+ `start` opens or resumes a window and preserves existing IDs by default.
261
+ `--reset` clears platform collection for this game and MD5; it does not clear
262
+ phone storage. On an uncertain start or timeout, retry without `--reset`.
263
+ `export` reads a union snapshot without closing the window. It needs the original
264
+ Wasm, validates the collection MD5 against its file bytes or uncompressed bytes,
265
+ and writes schema 1 with the uncompressed `wasmSha256`, `funcIds` and `bootFuncIds`.
266
+ Read the file at the returned `collection.path`. Existing files are rejected;
267
+ use a new output name for each snapshot. Credentials and raw API responses are
268
+ omitted even with `--verbose`.
269
+
270
+ Only `start` writes platform state. `export` only reads collection and writes a
271
+ local file. Neither command changes Unity files or clears device storage.
272
+ Platform requests default to 30 seconds (`--timeout`, 1–300). Missing or expired
273
+ login returns `WASM_AUTH_REQUIRED`; empty collection returns `WASM_COLLECTION_EMPTY`;
274
+ an unmatched original returns `WASM_COLLECTION_MISMATCH`. No file is published on
275
+ these failures. A nonempty collection does not prove gameplay coverage.
276
+ The commands reuse the existing platform request environment; local fixture
277
+ tests do not establish real platform or device acceptance.
278
+
279
+ 安装 `0.4.6-agent-beta.3`,通过 `ttmg capabilities` 中的 `commands.wasmCollect` 确认支持。
280
+ CLI 内部复用 `ttmg login` 登录态,无需运行 DevTool 本地服务,Agent 不读取或传递 Cookie。
281
+ 按上方命令执行:prepare → 开采集窗口 → 接入插桩副本并扫码、清存储、玩游戏 → export → split。
282
+ `<MD5>` 使用 prepare 返回的 `input.wasmMd5`,插桩游戏须上报相同的原始 MD5 和 Client Key。
283
+
284
+ 示例在游戏工程根目录执行。采集文件和临时产物应放工程外或根目录 `.ttmg` 下;
285
+ 放在普通游戏资源目录的 JSON 会参与后续构建和上传。
286
+ `start` 默认保留已有函数 ID;只有 `--reset` 清空平台上此游戏、此 MD5 的历史采集,
287
+ 不会清理手机存储。超时或不确定是否成功时,不带 `--reset` 重试。
288
+ `export` 读取当前合集快照,不关闭采集窗口;必须提供原始 Wasm,命令校验文件字节或
289
+ 解压后字节的 MD5,再写入 schema 1、解压后原始 `wasmSha256`、`funcIds` 和 `bootFuncIds`。
290
+ 从返回的 `collection.path` 读取文件;已有文件不覆盖,每轮快照使用新文件名。
291
+ 即使开启 `--verbose`,也不输出登录凭证或原始接口响应。
292
+
293
+ 仅 `start` 写平台状态;`export` 只读平台并写本地文件。两者均不写回 Unity 工程或清理手机存储。
294
+ 请求默认超时 30 秒,`--timeout` 范围为 1–300 秒。未登录或登录过期返回 `WASM_AUTH_REQUIRED`,
295
+ 空采集返回 `WASM_COLLECTION_EMPTY`,原始文件不匹配返回 `WASM_COLLECTION_MISMATCH`;
296
+ 这些失败不会生成采集文件。非空结果不等于玩法覆盖完整。
297
+ 命令沿用现有平台请求环境;本地模拟测试不代表真实平台或真机验收。
298
+
299
+ #### Local artifacts / 本地产物
300
+
209
301
  ```bash
210
- ttmg wasm prepare --input original.wasm.br --output prepared --format json
211
- ttmg wasm split --input original.wasm.br --collection collection.json --output split --format json
302
+ ttmg wasm prepare --input original.wasm.br --output .ttmg/wasm/prepared --format json
303
+ ttmg wasm split --input original.wasm.br --collection .ttmg/wasm/collection.json --output .ttmg/wasm/split --format json
212
304
  ```
213
305
 
214
306
  These experimental commands create artifacts in a new directory; they do not