@ttmg/cli 0.4.6-vibe-beta.5 → 0.4.6-vibe-beta.7

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
@@ -21,8 +21,24 @@ npm install @ttmg/cli --save-dev
21
21
 
22
22
  #### Login 登录
23
23
 
24
- Before running any `ttmg` commands, please log in with your TikTok account. Once logged in, the tool will automatically use your account for project initialization, development, debugging, and packaging.
25
- 在首次使用 `ttmg` 命令前,请先登录你的 TikTok 账号。登录后,工具会自动使用该账号进行项目初始化、开发调试和打包构建。
24
+ For the beta.7 trial, run `ttmg upload --vibe --mock` without environment setup.
25
+ Task creation/polling use the built-in PPE lane; authorization and uploads remain
26
+ simulated. Unlike beta.6, this is not offline: backend access is required and task
27
+ creation is a real platform write. See [Vibe binding/upload](vibe-upload.md).
28
+ beta.7 试用直接运行 `ttmg upload --vibe --mock`,不用登录或配置环境变量。
29
+ 创建/查询任务走 CLI 内置 PPE,授权/上传继续模拟;与 beta.6 不同,不再是全程离线。
30
+ 需要后端可访问,会创建真实任务,不上传游戏、不预览、不审核或发布。
31
+
32
+ ```sh
33
+ npm install -g @ttmg/cli@0.4.6-vibe-beta.7
34
+ ttmg upload --vibe --mock --dir ./game --title "My game" --icon ./avatar.png --format ndjson
35
+ ```
36
+
37
+ PPE routing will be removed in a production release without Skill environment setup.
38
+ 上线时由 CLI 去掉 PPE 路由,不让 Skill 配置或切换环境。
39
+
40
+ For the existing authenticated platform workflow, log in first; this does not apply to the local Vibe prototype above.
41
+ 原有需要平台鉴权的流程仍先登录;上述 Vibe 本地原型不需要此步骤。
26
42
 
27
43
  ```
28
44
  ttmg login
@@ -98,6 +114,36 @@ ttmg dev --client-key <client-key> --events ndjson --no-open
98
114
  ttmg dev --client-key <client-key> --events ndjson --no-open --timeout 120
99
115
  ```
100
116
 
117
+ For an Agent-owned iOS client-preview session, opt in explicitly. TikTok must
118
+ still be opened by a human scanning the generated QR code. The resident `ttmg
119
+ dev` process then owns the Runtime Debug WebSocket and performs client setup,
120
+ package upload, and metadata delivery without opening the browser IDE.
121
+ Agent 真机预览需显式开启;仍由用户使用 TikTok 扫描生成的二维码。扫码后,常驻
122
+ `ttmg dev` 进程会独占 Runtime Debug WebSocket,并在不打开浏览器 IDE 的情况下完成
123
+ 客户端初始化、包上传和 meta 下发。
124
+
125
+ ```
126
+ ttmg dev --mode client-preview --client-key <client-key> --events ndjson --no-open --timeout 600
127
+ ```
128
+
129
+ The lifecycle includes `READY_FOR_SCAN`, `DEVICE_DISCOVERED`,
130
+ `RUNTIME_AUTHENTICATED`, `UPLOAD_START`, `UPLOAD_READY`, and `PREVIEW_READY`.
131
+ The initial integration scope is iOS `native_runtime` and `structured_trace`,
132
+ while the V1 record schema preserves open `source`, `kind`, and extension
133
+ fields for Android and future runtimes. Runtime credentials remain in the
134
+ owner process memory and are never written to the session manifest or event
135
+ files.
136
+ 生命周期依次包含 `READY_FOR_SCAN`、`DEVICE_DISCOVERED`、
137
+ `RUNTIME_AUTHENTICATED`、`UPLOAD_START`、`UPLOAD_READY` 和 `PREVIEW_READY`。
138
+
139
+ 真机预览模式会串行编译,并将每次成功编译的文件与包元数据保存为配套的临时快照。
140
+ 上传期间再次编译时,当前部署完成后会继续部署最新的一版;中间待部署版本可被合并。
141
+ `PREVIEW_READY` 只在一版实际上传和 meta 请求完成后输出。旧快照在替换或 session
142
+ 关闭时清理;普通浏览器 `ttmg dev` 的编译与上传流程不变。
143
+ 首期接入范围仍是 iOS `native_runtime` 与 `structured_trace`,但 V1 记录模型会
144
+ 保留开放的 `source`、`kind` 和扩展字段,可兼容 Android 与后续 Runtime。
145
+ Runtime 凭据仅保存在 owner 进程内存中,不会写入 manifest 或事件文件。
146
+
101
147
  The command writes `manifest.json`, `events.ndjson`, `actions.ndjson`,
102
148
  `screenshots/`, `summary.json`, and `launch.png` under
103
149
  `.ttmg/sessions/<session-id>/` by default. `launch.rawUrl` and
@@ -106,12 +152,14 @@ and client connection events. Compile events also include the normalized
106
152
  project diagnostics produced by the existing checker. The existing runtime
107
153
  `reportScene({ sceneId: 9999 })` signal is forwarded to the CLI as a
108
154
  `GAME_READY` lifecycle event; a stopped session is only marked `passed` after
109
- that evidence is observed. Device launch, runtime logs, screenshots, and
110
- actions remain unavailable and are reported as `false` capabilities. The
155
+ that evidence is observed. Device launch and remote actions remain unavailable.
156
+ Runtime logs and screenshots expose an experimental iOS/V1 protocol surface,
157
+ but remain reported as unverified (`false`) top-level capabilities until
158
+ real-device acceptance. The
111
159
  manifest keeps `gameReady=false` until this path completes real-device
112
160
  verification, while `gameReadyProtocol=true` only declares local protocol
113
161
  support.
114
- 命令默认在 `.ttmg/sessions/<session-id>/` 写入 `manifest.json`、`events.ndjson`、`actions.ndjson`、`screenshots/`、`summary.json` 和 `launch.png`,其中 `launch.rawUrl` 与 `launch.qrPayload` 完全一致。本 beta 会把现有运行时 `reportScene({ sceneId: 9999 })` 信号旁路转发为 CLI 的 `GAME_READY` 生命周期事件;会话只有观察到该证据后才把 `summary.json` 写为 `passed`。设备直开、运行时日志、截图和操作仍返回 `false`,不伪造已支持状态。真实设备联调完成前,manifest 保持 `gameReady=false`,仅用 `gameReadyProtocol=true` 表示本地协议已经接通。
162
+ 命令默认在 `.ttmg/sessions/<session-id>/` 写入 `manifest.json`、`events.ndjson`、`actions.ndjson`、`screenshots/`、`summary.json` 和 `launch.png`,其中 `launch.rawUrl` 与 `launch.qrPayload` 完全一致。本 beta 会把现有运行时 `reportScene({ sceneId: 9999 })` 信号旁路转发为 CLI 的 `GAME_READY` 生命周期事件;会话只有观察到该证据后才把 `summary.json` 写为 `passed`。设备直开和远程操作仍不可用;运行时日志与截图已提供实验性的 iOS/V1 协议入口,但真实设备验收完成前,顶层 capabilities 仍保持 `false`,不伪造已完成状态。真实设备联调完成前,manifest 保持 `gameReady=false`,仅用 `gameReadyProtocol=true` 表示本地协议已经接通。
115
163
  编译事件会同时包含现有检查器产生的标准化项目诊断,Agent 不需要再从拼接后的错误文本反推问题位置。
116
164
 
117
165
  Structured sessions can be discovered, inspected, and safely stopped from a
@@ -126,6 +174,41 @@ ttmg dev session events <session-id> --after <seq> --limit <count> --format json
126
174
  ttmg dev session stop <session-id> --format json
127
175
  ```
128
176
 
177
+ While a client-preview owner is running, another CLI process can read a bounded
178
+ snapshot, follow logs for a bounded interval, or request a screenshot. Runtime
179
+ cursor values are decimal strings and must not be parsed as JavaScript numbers.
180
+ Logs remain in bounded memory and are not copied into `events.ndjson` or a log
181
+ file. Screenshot stdout contains metadata only; the binary is written to disk
182
+ without overwriting an existing explicit destination.
183
+ 真机预览 owner 运行期间,另一个 CLI 进程可读取有界日志快照、在有界时间内 follow,
184
+ 或请求截图。Runtime cursor 是十进制字符串,不应转换为 JavaScript Number。日志只在
185
+ 有界内存中保留,不写入 `events.ndjson` 或额外日志文件;截图 stdout 只返回元数据,
186
+ 图片写入磁盘,且不会覆盖显式指定的已有文件。
187
+
188
+ `--follow` 先订阅再请求一次受 `--limit` 限制的历史快照,缓存请求期间到达的实时
189
+ 日志并排序去重后继续输出;不会自动分页全部历史(`hasMore` 表示仍有历史可补拉)。
190
+ 过渡缓存限制为 10000 条/10 MiB,超限返回明确错误,可从最后收到的 cursor 重试;
191
+ 等待初始快照也计入 follow 超时。中文和 emoji 的跨 IPC 分块传输保持完整。
192
+
193
+ Runtime Session 切换(例如重新扫码)会使正在运行的 `--follow` 以
194
+ `RUNTIME_SESSION_MISMATCH` 结束,包括仍在等待初始快照的监听。新会话就绪后,
195
+ 用同一个 CLI session-id 重新执行命令,但不要复用旧 Runtime 的 `--after`/`--until`
196
+ 游标;同一 Runtime Session 的普通断线重连不会终止 follow。
197
+
198
+ ```
199
+ ttmg dev session logs <session-id> --after <cursor> --until <cursor> --limit 200 --format json
200
+ ttmg dev session logs <session-id> --after <cursor> --follow --timeout 30 --format ndjson
201
+ ttmg dev session screenshot <session-id> --image-format jpeg --quality 0.8 --output <path> --format json
202
+ ```
203
+
204
+ If an older client does not advertise Runtime Debug V1, the original preview
205
+ flow remains compatible, while the new session commands return
206
+ `RUNTIME_DEBUG_UNSUPPORTED`. If the owner process has exited, they return
207
+ `DEV_SESSION_NOT_RUNNING`; logs are never reconstructed from disk.
208
+ 旧客户端未声明 Runtime Debug V1 时,原预览链路保持兼容,新 session 命令返回
209
+ `RUNTIME_DEBUG_UNSUPPORTED`。owner 退出后返回 `DEV_SESSION_NOT_RUNNING`,不会从
210
+ 磁盘伪造历史日志。
211
+
129
212
  #### Project Check 项目检查
130
213
 
131
214
  Run the existing project, package-size, subpackage, path, and API checks without