@ttmg/cli 0.4.6-vibe-beta.9 → 0.4.6-vibe-beta.10
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 +4 -4
- package/dist/index.js +30 -17
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/scripts/verify-agent-contract.js +2 -0
- package/dist/scripts/vibe-upload-smoke.js +18 -1
- package/package.json +1 -1
- package/vibe-upload.md +12 -34
package/dist/package.json
CHANGED
|
@@ -385,6 +385,8 @@ assert.notEqual(
|
|
|
385
385
|
);
|
|
386
386
|
|
|
387
387
|
const uploadHelp = runCli(['upload', '--help']);
|
|
388
|
+
assert.doesNotMatch(uploadHelp.stdout, /--app-info/);
|
|
389
|
+
assert.match(uploadHelp.stdout.replace(/\s+/g, ' '), /only title and icon|只收集标题和头像/);
|
|
388
390
|
assertExit(uploadHelp, 0, 'upload help');
|
|
389
391
|
assert.match(uploadHelp.stdout, /--preview\b/);
|
|
390
392
|
assert.match(uploadHelp.stdout, /--serve-preview-page\b/);
|
|
@@ -99,7 +99,15 @@ function events(result) {
|
|
|
99
99
|
return result.stdout
|
|
100
100
|
.trim()
|
|
101
101
|
.split('\n')
|
|
102
|
-
.map(line =>
|
|
102
|
+
.map(line => {
|
|
103
|
+
const event = JSON.parse(line);
|
|
104
|
+
if (event.mode === 'vibe') {
|
|
105
|
+
assert.deepEqual(event.inputRequirements.requiredUserInputs, ['title', 'icon']);
|
|
106
|
+
assert.equal(event.inputRequirements.requestAdditionalMetadata, false);
|
|
107
|
+
assert.equal(event.inputRequirements.additionalMetadataSource, 'platform-defaults');
|
|
108
|
+
}
|
|
109
|
+
return event;
|
|
110
|
+
});
|
|
103
111
|
}
|
|
104
112
|
async function main() {
|
|
105
113
|
// Exercise the built worker IPC and new command without creating a platform task.
|
|
@@ -183,6 +191,8 @@ async function main() {
|
|
|
183
191
|
assert.equal(info.import_token, 'process-test-secret');
|
|
184
192
|
assert.equal(info.app_info.icon_uri, 'web-icon-receipt');
|
|
185
193
|
assert.equal(info.app_info.app_name, input[input.indexOf('--title') + 1]);
|
|
194
|
+
assert.deepEqual(Object.keys(info.app_info).sort(), ['app_name', 'icon_uri'],
|
|
195
|
+
'Default uploads must leave other metadata to platform defaults');
|
|
186
196
|
} else {
|
|
187
197
|
assert.match(req.headers['content-type'], /^multipart\/form-data; boundary=/);
|
|
188
198
|
assert.match(body.toString(), /name="task_id"\r\n\r\n7684370037737553941\r\n/);
|
|
@@ -219,6 +229,13 @@ async function main() {
|
|
|
219
229
|
|
|
220
230
|
let bindingHtml;
|
|
221
231
|
const appInfoPath = path.join(temp, 'app-info.json');
|
|
232
|
+
const invalidLegacy = await run([...input, '--app-info', appInfoPath, '--dry-run', '--format', 'json']);
|
|
233
|
+
assert.equal(invalidLegacy.code, 1);
|
|
234
|
+
const legacyFailure = events(invalidLegacy)[0];
|
|
235
|
+
assert.equal(legacyFailure.errorCode, 'VIBE_INVALID_APP_INFO');
|
|
236
|
+
assert.equal(legacyFailure.platformWrite, false);
|
|
237
|
+
assert.match(legacyFailure.message, /Remove --app-info|移除 --app-info/);
|
|
238
|
+
assert.doesNotMatch(legacyFailure.message, /are required|需要简介/);
|
|
222
239
|
fs.writeFileSync(appInfoPath, JSON.stringify({
|
|
223
240
|
description: 'Process contract fixture', category: 'Casual', subcategory: 'Puzzle',
|
|
224
241
|
terms_of_service: 'https://example.invalid/terms', privacy_policy: 'https://example.invalid/privacy',
|
package/package.json
CHANGED
package/vibe-upload.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## 中文
|
|
4
4
|
|
|
5
|
-
本次范围:本地准备 → 授权绑定 → 上传头像 → 提交应用信息 → 上传代码包 → 上传完成。不包含预览、审核或正式发布。`--web` 使用真实 PPE 授权和上传;`--mock`
|
|
5
|
+
本次范围:本地准备 → 授权绑定 → 上传头像 → 提交应用信息 → 上传代码包 → 上传完成。不包含预览、审核或正式发布。`--web` 使用真实 PPE 授权和上传;`--mock` 的授权与素材上传仍为模拟。网页授权后自动上传的修复已在 `0.4.6-vibe-beta.9` 发布;用户输入要求已在 `0.4.6-vibe-beta.10` 修正。
|
|
6
6
|
|
|
7
7
|
### 博华如何接入
|
|
8
8
|
|
|
@@ -26,24 +26,11 @@ ttmg upload --vibe --dir ./game --title "星环守卫" --icon ./avatar.png --dry
|
|
|
26
26
|
|
|
27
27
|
已有 ZIP 时,用 `--package ./game.zip` 替换 `--dir ./game`。名称和头像必须由开发者提供;演示脚本中的临时样本不作为产品默认素材。
|
|
28
28
|
|
|
29
|
-
###
|
|
29
|
+
### 用户需要提供什么
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
**只收集游戏标题和本地头像,并使用当前游戏目录或代码包。** 描述、分类、服务条款、隐私政策、版权确认及其他应用资料由平台默认处理,Skill 不向用户索要,也不生成资料表单或自行补值。
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
ttmg upload --vibe --package ./game.zip --title "测试游戏" --icon ./avatar.png --app-info ./app-info.json --dry-run --format json
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
JSON 文件为以下字段组成的对象,最大 64 KiB;名称由 `--title` 提供,头像 URI 由上传接口返回,不在文件中填写。
|
|
38
|
-
|
|
39
|
-
| 字段 | 要求 |
|
|
40
|
-
| --- | --- |
|
|
41
|
-
| description、category、subcategory | 必填非空字符串;分类与子分类应使用平台分类表中的配对值,本地暂不校验分类枚举 |
|
|
42
|
-
| terms_of_service、privacy_policy | 必填 HTTP(S) 链接,不含用户名和密码;须使用游戏自己的真实条款与隐私链接 |
|
|
43
|
-
| copyright_confirmation | 必须显式为 true;只有用户已确认版权时才填写,Skill 不得代为默认确认 |
|
|
44
|
-
| apple_team_id、contact_email、region、min_sdk_version | 可选字符串;填写邮箱时检查基本格式 |
|
|
45
|
-
|
|
46
|
-
提供该文件后,创建任务前检查名称最多 30 个字符,以及头像为 PNG/JPEG、1024×1024、最大 5 MiB。头像仅做文件头预检,完整解码由后端校验。错误分别返回 `VIBE_INVALID_APP_INFO`、`VIBE_TITLE_TOO_LONG`、`VIBE_PLATFORM_ICON_INVALID`,`nextAction=fix_input`。JSON 不接受额外字段,内容不会进入结构化输出;修改后重新运行 dry-run。
|
|
33
|
+
能力查询和上传事件均返回 `inputRequirements`:`requiredUserInputs=["title","icon"]`、`additionalMetadataSource="platform-defaults"`、`requestAdditionalMetadata=false`。`--app-info` 仅兼容旧调用,当前流程不使用。
|
|
47
34
|
|
|
48
35
|
### Skill 读取什么
|
|
49
36
|
|
|
@@ -166,7 +153,9 @@ TTMG_VIBE_BACKEND=local-http TTMG_VIBE_API=http://127.0.0.1:3100 ttmg upload --v
|
|
|
166
153
|
|
|
167
154
|
### Skill entry
|
|
168
155
|
|
|
169
|
-
Scope: local preparation → authorization binding → avatar upload → app-info submission → package upload → **upload complete**. No preview, review or production release. `--web` uses real PPE authorization and uploads; `--mock` still simulates authorization and material uploads.
|
|
156
|
+
Scope: local preparation → authorization binding → avatar upload → app-info submission → package upload → **upload complete**. No preview, review or production release. `--web` uses real PPE authorization and uploads; `--mock` still simulates authorization and material uploads.
|
|
157
|
+
|
|
158
|
+
Automatic upload was fixed in `0.4.6-vibe-beta.9`; the user-input clarification ships in `0.4.6-vibe-beta.10`.
|
|
170
159
|
|
|
171
160
|
Keep the existing --mock command; no environment setup is required:
|
|
172
161
|
|
|
@@ -178,24 +167,13 @@ Use `--package ./game.zip` instead of --dir for a prepared ZIP. Use `--dry-run -
|
|
|
178
167
|
|
|
179
168
|
The Skill gathers the title and user-selected local icon in conversation. It does not call backend APIs, store credentials, poll services, or introduce a metadata form. The CLI internally connects working steps to PPE and simulates the remaining steps. Removing PPE at production launch is a CLI release change, not a Skill configuration step.
|
|
180
169
|
|
|
181
|
-
###
|
|
182
|
-
|
|
183
|
-
Use `--app-info ./app-info.json` to supply complete app information. The CLI submits it with the developer's title and the uploaded icon URI; it does not invent legal URLs or copyright consent. The existing --mock entry is unchanged.
|
|
184
|
-
|
|
185
|
-
```sh
|
|
186
|
-
ttmg upload --vibe --package ./game.zip --title "Test game" --icon ./avatar.png --app-info ./app-info.json --dry-run --format json
|
|
187
|
-
```
|
|
170
|
+
### User inputs
|
|
188
171
|
|
|
189
|
-
|
|
172
|
+
**Collect only the game title and local icon, using the current game directory or ZIP.** The platform defaults all other app metadata. Do not request extra fields, add a form or invent values.
|
|
190
173
|
|
|
191
|
-
|
|
192
|
-
| --- | --- |
|
|
193
|
-
| description, category, subcategory | Required nonempty strings; use a valid platform category/subcategory pair. Local enum validation is not implemented yet |
|
|
194
|
-
| terms_of_service, privacy_policy | Required HTTP(S) URLs without embedded credentials; provide the game's actual legal links |
|
|
195
|
-
| copyright_confirmation | Explicit true only after the user confirms ownership; the Skill must not infer consent |
|
|
196
|
-
| apple_team_id, contact_email, region, min_sdk_version | Optional strings; email receives a basic syntax check |
|
|
174
|
+
Capabilities and upload events include `inputRequirements` with `requiredUserInputs=["title","icon"]`, `additionalMetadataSource="platform-defaults"` and `requestAdditionalMetadata=false`.
|
|
197
175
|
|
|
198
|
-
|
|
176
|
+
The `--app-info` option remains for legacy callers only; the current workflow does not use it.
|
|
199
177
|
|
|
200
178
|
Source checked on 2026-09-14: BFF enforces these icon limits and a 100 MiB Native ZIP/uncompressed-size limit. Full local ZIP-content/uncompressed-size validation is not implemented. Gateway transport, TOS access, phone OAuth and upload receipts still require real integration testing.
|
|
201
179
|
|
|
@@ -277,7 +255,7 @@ The five endpoint contracts are listed in the table above. Mock and loopback HTT
|
|
|
277
255
|
|
|
278
256
|
A business-success response requires error_info.code=0. Package completion additionally requires package_uri and a valid non-failure status; no polling until SUCCEEDED. No platform Cookies or redirects are used. Configure TTMG_VIBE_BACKEND=local-http plus TTMG_VIBE_API=http://127.0.0.1:3100, or pass --vibe-api explicitly; this option rejects remote hosts.
|
|
279
257
|
|
|
280
|
-
For internal PPE integration, set TTMG_VIBE_BACKEND=ppe and TTMG_VIBE_PPE=ppe_op_vc without changing the Skill command. This uses real creation/polling on developers.tiktok.com and encodes the QR as aweme://webview?url=<encodeURIComponent(landing_url)>. The phone must use the same lane. OAuth is not bypassed or simulated. After authorization, the CLI uploads the icon, submits
|
|
258
|
+
For internal PPE integration, set TTMG_VIBE_BACKEND=ppe and TTMG_VIBE_PPE=ppe_op_vc without changing the Skill command. This uses real creation/polling on developers.tiktok.com and encodes the QR as aweme://webview?url=<encodeURIComponent(landing_url)>. The phone must use the same lane. OAuth is not bypassed or simulated. After authorization, the CLI uploads the icon, submits the title and icon URI, and uploads the package. Other app metadata uses platform defaults. The regular --web entry configures PPE internally and opens the system browser.
|
|
281
259
|
|
|
282
260
|
The normal --mock trial internally uses ppe_op_vc without environment variables. Task creation, QR and three polls are real; authorization, icon, app-info and package uploads are simulated with separate in-memory credentials. This changes --mock from an offline run into a PPE integration trial: platformWrite becomes true when task creation is attempted, while simulation remains true. No real material-upload endpoint is called, and real request failures still fail. --mock-scenario controls only simulated steps. Offline unit/process tests use injected transports, not a separate developer configuration.
|
|
283
261
|
|