@taptap/cli 2026.11.29 → 2026.11.30-beta.1

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.
Files changed (69) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +0 -9
  3. package/README.md +5 -3
  4. package/README.zh.md +5 -3
  5. package/affordance/app.md +13 -0
  6. package/affordance/developer.md +27 -0
  7. package/affordance/game-service.md +87 -0
  8. package/bin/taptap-cli-darwin-amd64 +0 -0
  9. package/bin/taptap-cli-darwin-arm64 +0 -0
  10. package/bin/taptap-cli-linux-amd64 +0 -0
  11. package/bin/taptap-cli-linux-arm64 +0 -0
  12. package/bin/taptap-cli-linux-riscv64 +0 -0
  13. package/bin/taptap-cli-windows-amd64.exe +0 -0
  14. package/bin/taptap-cli-windows-arm64.exe +0 -0
  15. package/checksums.txt +7 -7
  16. package/package.json +1 -1
  17. package/scripts/bot/cli.mjs +41 -23
  18. package/scripts/bot/entry.cjs +9 -0
  19. package/scripts/bot/tap.mjs +34 -6
  20. package/scripts/claude-hooks/dispatch.mjs +1 -1
  21. package/scripts/claude-hooks/dispatch.test.mjs +1 -2
  22. package/scripts/run.js +3 -1
  23. package/skills/index.json +6 -0
  24. package/skills/taptap-app-edit/references/app-edit-audit-and-history.md +0 -2
  25. package/skills/taptap-app-edit/references/app-edit-fields-and-packages.md +0 -4
  26. package/skills/taptap-cli/SKILL.md +6 -4
  27. package/skills/taptap-cli/references/cli-command-patterns.md +3 -8
  28. package/skills/taptap-community-management/SKILL.md +5 -0
  29. package/skills/taptap-community-management/references/forum-feed.md +14 -0
  30. package/skills/taptap-dashboard-stats/SKILL.md +12 -8
  31. package/skills/taptap-dashboard-stats/references/forum-stats-cheatsheet.md +1 -1
  32. package/skills/taptap-dashboard-stats/references/instant-game-overviews.md +17 -0
  33. package/skills/taptap-development/SKILL.md +72 -0
  34. package/skills/taptap-development/references/multiplayer-diagnosis.md +28 -0
  35. package/skills/taptap-development/references/performance-checklist.md +31 -0
  36. package/skills/taptap-game-service/SKILL.md +51 -0
  37. package/skills/taptap-game-service/references/ad-config.md +13 -0
  38. package/skills/taptap-game-service/references/debug-feedback.md +12 -0
  39. package/skills/taptap-game-service/references/leaderboard.md +24 -0
  40. package/skills/taptap-game-service/references/share-template.md +14 -0
  41. package/skills/taptap-identity/SKILL.md +5 -2
  42. package/skills/taptap-identity/references/project-binding.md +16 -0
  43. package/skills/taptap-package-management/SKILL.md +4 -0
  44. package/skills/taptap-package-management/references/h5-directory-upload.md +16 -0
  45. package/skills/taptap-player-feedback/SKILL.md +7 -7
  46. package/skills/taptap-player-feedback/references/review-actions.md +39 -0
  47. package/taptap-suite/SKILL.md +9 -7
  48. package/taptap-suite/references/taptap-app-edit/references/app-edit-audit-and-history.md +0 -2
  49. package/taptap-suite/references/taptap-app-edit/references/app-edit-fields-and-packages.md +0 -4
  50. package/taptap-suite/references/taptap-cli/references/cli-command-patterns.md +3 -8
  51. package/taptap-suite/references/taptap-community-management/SKILL.md +5 -0
  52. package/taptap-suite/references/taptap-community-management/references/forum-feed.md +14 -0
  53. package/taptap-suite/references/taptap-dashboard-stats/SKILL.md +12 -8
  54. package/taptap-suite/references/taptap-dashboard-stats/references/forum-stats-cheatsheet.md +1 -1
  55. package/taptap-suite/references/taptap-dashboard-stats/references/instant-game-overviews.md +17 -0
  56. package/taptap-suite/references/taptap-development/SKILL.md +72 -0
  57. package/taptap-suite/references/taptap-development/references/multiplayer-diagnosis.md +28 -0
  58. package/taptap-suite/references/taptap-development/references/performance-checklist.md +31 -0
  59. package/taptap-suite/references/taptap-game-service/SKILL.md +51 -0
  60. package/taptap-suite/references/taptap-game-service/references/ad-config.md +13 -0
  61. package/taptap-suite/references/taptap-game-service/references/debug-feedback.md +12 -0
  62. package/taptap-suite/references/taptap-game-service/references/leaderboard.md +24 -0
  63. package/taptap-suite/references/taptap-game-service/references/share-template.md +14 -0
  64. package/taptap-suite/references/taptap-identity/SKILL.md +5 -2
  65. package/taptap-suite/references/taptap-identity/references/project-binding.md +16 -0
  66. package/taptap-suite/references/taptap-package-management/SKILL.md +4 -0
  67. package/taptap-suite/references/taptap-package-management/references/h5-directory-upload.md +16 -0
  68. package/taptap-suite/references/taptap-player-feedback/SKILL.md +7 -7
  69. package/taptap-suite/references/taptap-player-feedback/references/review-actions.md +39 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taptap-cli",
3
- "version": "2026.11.29",
3
+ "version": "2026.11.30-beta.1",
4
4
  "description": "TapTap CLI skills —— 应用资料编辑、素材库管理、数据查询、测试计划等能力。供 Claude Code / Codex 等外部 AI 消费。",
5
5
  "author": {
6
6
  "name": "TapTap Frontend Team"
package/CHANGELOG.md CHANGED
@@ -2,15 +2,6 @@
2
2
 
3
3
  All notable TapTap CLI changes are documented here.
4
4
 
5
- ## [v2026.11.29] - 2026-11-29
6
-
7
- ### Fixes
8
-
9
- - Invalid `--data` input now includes a hint for the detected mistake, including a missing `@` before a JSON file path.
10
- - Single-image uploads share a local rate limit across CLI processes using the same configuration directory, credential, endpoint and game. When the gateway returns HTTP 429 with `Retry-After`, subsequent uploads sharing a writable cache wait for that deadline. An unavailable cache still allows the upload to reach the gateway.
11
- - `app list-versions` classifies a permission denial inside an HTTP 200 response as a non-retryable authorization error (exit code 3). Batch callers can pause the affected game and continue checking the others.
12
- - The bundled production Catalog lists the field IDs accepted by `app save-changes`. Preview and submission identify an invalid field by its position in the batch and list the available choices.
13
-
14
5
  ## [v2026.11.27] - 2026-11-27
15
6
 
16
7
  ### Features
package/README.md CHANGED
@@ -123,7 +123,7 @@ see the [Skills CLI guide](https://github.com/vercel-labs/skills).
123
123
 
124
124
  **Step 2 - Login**
125
125
 
126
- > Run the command in the background, give the returned login link to the user, and continue with the returned recovery command.
126
+ > Run the command and send the returned login link to the user.
127
127
 
128
128
  ```bash
129
129
  taptap-cli auth login --no-wait --json
@@ -131,7 +131,7 @@ taptap-cli auth login --no-wait --json
131
131
 
132
132
  **Step 3 - Continue login**
133
133
 
134
- > Immediately execute the returned recovery command in the background. It polls until authorization succeeds or the device code expires.
134
+ > Once the user can see the link, run the returned recovery command. If your agent only shows final replies or cannot keep polling, send the link in a final reply and resume when the user confirms.
135
135
 
136
136
  **Step 4 - Verify**
137
137
 
@@ -145,6 +145,8 @@ taptap-cli auth status
145
145
  | --------------------------------- | ------------------------------------------- |
146
146
  | `taptap-cli` | Discover available capabilities, identify the current operating scope, choose commands, and handle output and errors (the entry point for all business Skills) |
147
147
  | `taptap-suite` | Single aggregated entry skill: routes user intent to bundled `taptap-*` child skills under `references/` (installed via `taptap-cli update --skills-layout suite`) |
148
+ | `taptap-development` | Organize capability integration, performance investigations, troubleshooting, and build checks; read live prerequisites and render client templates |
149
+ | `taptap-game-service` | Manage leaderboards, share templates, ad configuration, and debug feedback by service resource |
148
150
  | `taptap-identity` | Check login status, list developer accounts and games, and resolve developer and game IDs |
149
151
  | [taptap-member](skills/taptap-member/SKILL.md) | Check a member’s access to a game, export the roster, add or remove members, create and assign roles, and inspect permission changes |
150
152
  | `taptap-publish-game` | Create new games, preview creation, and hand off to profile, package, and test-plan workflows |
@@ -207,7 +209,7 @@ Use service commands when you need precise control. Write operations support
207
209
 
208
210
  ```bash
209
211
  taptap-cli package-management list-apk-packages --dev-id <developer-id> --app-id <app-id> --data '{"page":1,"page_size":50}'
210
- taptap-cli dashboard-stats get-dashboard-stats --dev-id <developer-id> --app-id <app-id> --data '{"metric":"download"}'
212
+ taptap-cli dashboard-stats get --dev-id <developer-id> --app-id <app-id> --data '{"metric":"download"}'
211
213
  taptap-cli app submit-app-review --dev-id <developer-id> --app-id <app-id> --data '{"release_schedule":{"kind":"immediate"}}' --idempotency-key <key> --dry-run
212
214
  ```
213
215
 
package/README.zh.md CHANGED
@@ -122,7 +122,7 @@ npx skills add taptap/cli -a universal
122
122
 
123
123
  **第 2 步 — 登录**
124
124
 
125
- > 后台运行命令,将命令返回的登录链接直接提供给用户,并继续执行返回的恢复命令。
125
+ > 运行命令,将返回的登录链接发给用户。
126
126
 
127
127
  ```bash
128
128
  taptap-cli auth login --no-wait --json
@@ -130,7 +130,7 @@ taptap-cli auth login --no-wait --json
130
130
 
131
131
  **第 3 步 — 继续登录**
132
132
 
133
- > 立即在后台执行返回的恢复命令,持续轮询直到授权成功或 device code 过期。
133
+ > 用户已能看见链接时,执行返回的续登命令。如果宿主只显示最终回复或无法保活,先在最终回复中发送链接,等用户确认后续登。
134
134
 
135
135
  **第 4 步 — 验证**
136
136
 
@@ -144,6 +144,8 @@ taptap-cli auth status
144
144
  | --------------------------------- | ------------------------------------------- |
145
145
  | `taptap-cli` | 查找可用功能、判断当前操作范围、选择命令、处理输出和错误(所有业务 Skill 的总入口) |
146
146
  | `taptap-suite` | 聚合入口 skill:按路由表把用户意图分发到收纳的 `taptap-*` 子能力(`taptap-cli update --skills-layout suite` 安装) |
147
+ | `taptap-development` | 按接入、优化、排查和构建目标组织开发辅助;读取真实前置条件并生成客户端模板 |
148
+ | `taptap-game-service` | 按服务资源管理排行榜、分享模板、广告配置和调试反馈 |
147
149
  | `taptap-identity` | 查询登录状态、开发者账号、游戏、开发者账号 ID 和游戏 ID |
148
150
  | [taptap-member](skills/taptap-member/SKILL.md) | 导出成员名册、核对单游戏权限、创建和分配角色、管理成员、查询权限变更 |
149
151
  | `taptap-publish-game` | 新游戏创建、创建预览和创建后的资料/包体/测试计划交接 |
@@ -203,7 +205,7 @@ CLI 为常见任务提供快捷命令,也为精确操作提供服务命令。
203
205
 
204
206
  ```bash
205
207
  taptap-cli package-management list-apk-packages --dev-id <developer-id> --app-id <app-id> --data '{"page":1,"page_size":50}'
206
- taptap-cli dashboard-stats get-dashboard-stats --dev-id <developer-id> --app-id <app-id> --data '{"metric":"download"}'
208
+ taptap-cli dashboard-stats get --dev-id <developer-id> --app-id <app-id> --data '{"metric":"download"}'
207
209
  taptap-cli app submit-app-review --dev-id <developer-id> --app-id <app-id> --data '{"release_schedule":{"kind":"immediate"}}' --idempotency-key <key> --dry-run
208
210
  ```
209
211
 
package/affordance/app.md CHANGED
@@ -238,3 +238,16 @@ Bind an existing TapTap Spark package version to the current game draft.
238
238
  ### Prerequisites
239
239
 
240
240
  - A known developer ID, app ID, and Spark package version
241
+
242
+ ## get-mini-app-info
243
+
244
+ Read the current mini-game identity, draft/published versions, orientation and review status. This is the live source for a mini-game project binding.
245
+
246
+ ### Avoid when
247
+
248
+ - You only need the developer's app list → use [[+list]] or `developer list-developer-apps`
249
+
250
+ ### Tips
251
+
252
+ - `miniapp_id` absent means the mini-game capability is not enabled for this app; do not auto-create or open it from a read.
253
+ - Bind the project once with `app +bind-project`, then `app +current-project --refresh` to confirm live identity.
@@ -0,0 +1,27 @@
1
+ # developer
2
+
3
+ ## create
4
+
5
+ Create the current user's unverified developer identity. This is a write with no scope and no request body.
6
+
7
+ ### Skills
8
+
9
+ - taptap-identity/references/prerequisite-recovery.md
10
+
11
+ ### Prerequisites
12
+
13
+ - The user explicitly wants to create a developer identity; do not create one merely because a list is empty.
14
+
15
+ ### Examples
16
+
17
+ **Preview creating a developer identity**
18
+
19
+ ```bash
20
+ taptap-cli developer create --dry-run --idempotency-key "<key>"
21
+ ```
22
+
23
+ **Create after confirmation**
24
+
25
+ ```bash
26
+ taptap-cli developer create --yes --idempotency-key "<key>"
27
+ ```
@@ -0,0 +1,87 @@
1
+ # game-service
2
+
3
+ ## leaderboard.create
4
+
5
+ Create one leaderboard. The common flow defaults period_type=always, numeric/desc/best, display_limit=100; permanent leaderboards omit period_time.
6
+
7
+ ### Skills
8
+
9
+ - taptap-game-service/references/leaderboard.md
10
+
11
+ ### Avoid when
12
+
13
+ - The user only wants to inspect existing leaderboards → use [[leaderboard.list]]
14
+ - Creation already succeeded and only visibility failed → use [[leaderboard.set-whitelist-only]]
15
+
16
+ ### Examples
17
+
18
+ **Preview creation**
19
+
20
+ ```bash
21
+ taptap-cli game-service leaderboard +create --title "最高分" --publish --dry-run
22
+ ```
23
+
24
+ ## leaderboard.list
25
+
26
+ List leaderboards with page/page_size pagination. Read back after an uncertain create; never take the newest row as proof of this call.
27
+
28
+ ### Tips
29
+
30
+ - `leaderboard_id` is a decimal uint64 string.
31
+ - Use `leaderboard_open_id` for client-facing configuration when returned.
32
+
33
+ ## leaderboard.set-whitelist-only
34
+
35
+ Set one leaderboard's visibility. `whitelist_only=false` publishes it.
36
+
37
+ ### Avoid when
38
+
39
+ - The leaderboard ID is unknown → list first; do not use an example ID.
40
+
41
+ ## share-template.create
42
+
43
+ Create a share template. `contents` is limited to 21 UTF-8 bytes and `remark` to 100 Unicode characters.
44
+
45
+ ### Skills
46
+
47
+ - taptap-game-service/references/share-template.md
48
+
49
+ ## share-template.list
50
+
51
+ List share templates and their real review status. Only `approved` templates may be used by clients.
52
+
53
+ ## share-template.get
54
+
55
+ Read one template by `template_code`, including `audit_reason` for rejected templates.
56
+
57
+ ## ad-config.get
58
+
59
+ Read the current app's advertising eligibility, real ad spaces and selected space.
60
+
61
+ ### Skills
62
+
63
+ - taptap-game-service/references/ad-config.md
64
+
65
+ ### Avoid when
66
+
67
+ - The user wants integration code or a guide → use `development integrate ads --check` or `development template ad-manager`
68
+
69
+ ## debug-feedback.list
70
+
71
+ Read debug feedback without changing its processed state. `marked_processed` must be false.
72
+
73
+ ### Skills
74
+
75
+ - taptap-game-service/references/debug-feedback.md
76
+
77
+ ### Tips
78
+
79
+ - `total` is the filter count, not the remaining unprocessed count.
80
+
81
+ ## debug-feedback.claim
82
+
83
+ Claim and mark one feedback batch. This is a write; retries with the same key return the same batch.
84
+
85
+ ### Avoid when
86
+
87
+ - The user only wants to browse → use [[debug-feedback.list]]
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/checksums.txt CHANGED
@@ -1,7 +1,7 @@
1
- 9b395d23f7208f445cc27dfaac9cbff5e71f0906091400b5445e699267ffc32c bin/taptap-cli-darwin-amd64
2
- 69a6f7bb9294c4de5072e0e29fb9e749d69dc1b342bf096f19bb205f2709d14d bin/taptap-cli-darwin-arm64
3
- 9534e862c32026d80ca3356e85959993288dcece7f3f6f464bdfa01eff9c88e3 bin/taptap-cli-linux-amd64
4
- db2560688d36d4f4761ac56b64ac3049cea82179f19117504417f47fd4a82008 bin/taptap-cli-linux-arm64
5
- fed093e318adf03938dc60ad1d1cf41dd708ea29e98dd03c781479eb5307d0fa bin/taptap-cli-linux-riscv64
6
- 26d7e3f30e4dc8b1fc5d81f2268095b6ce398d504555562e8071cddbf3991267 bin/taptap-cli-windows-amd64.exe
7
- 6b062cbb12c45a1fff1a00a9620e341e99e8b4e2e704ae93f4f281a84d25a1e7 bin/taptap-cli-windows-arm64.exe
1
+ 2bade59b7d2c04b21aa3dc103816225ec5950ffa968bd7b1fa6a49b45d7b6dd5 bin/taptap-cli-darwin-amd64
2
+ 4deb9ff5c16134bb4d8114f03649db4bce0122a584085a8a1c4914f7e48502de bin/taptap-cli-darwin-arm64
3
+ c9235176ef1159bbe08047e994516e2345668f52e016787fe7a3fdaae5be95b1 bin/taptap-cli-linux-amd64
4
+ 79e49506449fc144b77a378ed630318cb0eab4e7a458f7722b8487caf1644292 bin/taptap-cli-linux-arm64
5
+ 970b607160dc4ba8f96b6c00e2158a1915fef7185dec9db7f9b188e4c360895b bin/taptap-cli-linux-riscv64
6
+ 831ce9c999d36ff8bc95d99a8512ce99b97775b86193e5d9b096fc3ee1693ea4 bin/taptap-cli-windows-amd64.exe
7
+ 5183e7f8b3dc34458264660ee88ed189abeda8d1df534a6c6a202e289786fa73 bin/taptap-cli-windows-arm64.exe
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taptap/cli",
3
- "version": "2026.11.29",
3
+ "version": "2026.11.30-beta.1",
4
4
  "description": "TapTap AI Agent CLI",
5
5
  "bin": {
6
6
  "taptap-cli": "scripts/run.js"
@@ -8,7 +8,7 @@ import { realpathSync, statSync } from "node:fs";
8
8
  import { spawn } from "node:child_process";
9
9
  import { setTimeout as delay } from "node:timers/promises";
10
10
  import { store, alive, positive, inboxId, defaultWorkspace } from "./store.mjs";
11
- import { login, loginBinding, assertLoginBinding, tap, nativeCli, servers } from "./tap.mjs";
11
+ import { login, loginBinding, assertLoginBinding, tap, nativeCli, nativeEnvironment, resolveBotProfile, servers } from "./tap.mjs";
12
12
  import { run } from "./process.mjs";
13
13
  import { getAgent } from "./agents/index.mjs";
14
14
  import { selectModel, saveModel } from "./models.mjs";
@@ -59,17 +59,12 @@ async function loadListener() {
59
59
  }
60
60
  }
61
61
 
62
- function config(v, requireBot = true) {
62
+ async function config(v, requireBot = true) {
63
63
  const bot = v.bot;
64
64
  if (requireBot && !positive(bot))
65
65
  throw Error("请选择 --bot 正整数");
66
- const env = v.env || "production",
67
- profile = v.profile || "default";
68
- if (
69
- !Object.hasOwn(servers, env) ||
70
- !/^[A-Za-z0-9][\w.-]{0,63}$/.test(profile)
71
- )
72
- throw Error("环境或 profile 无效");
66
+ const env = v.env || "production";
67
+ if (!Object.hasOwn(servers, env)) throw Error("--env 需要 production 或 rnd");
73
68
  if (env === "rnd" && !v.cli && requireBot === false)
74
69
  throw Error("RND 登录需要 --cli 对应构建");
75
70
  if (isCindyAgent(v.agent) && (v.permissions || v["allow-workspace-write"] || v.codex))
@@ -91,9 +86,10 @@ function config(v, requireBot = true) {
91
86
  throw Error("工作区写入需要 --reply 和 --workspace");
92
87
  if (v["replace-epoch"] && !positive(v["replace-epoch"]))
93
88
  throw Error("epoch 必须是正整数");
89
+ const cli = v.cli && realpathSync(v.cli);
94
90
  return {
95
91
  env,
96
- profile,
92
+ profile: await resolveBotProfile(cli, v.profile),
97
93
  bot,
98
94
  workspace,
99
95
  reply: !!v.reply,
@@ -103,7 +99,7 @@ function config(v, requireBot = true) {
103
99
  model: v.model,
104
100
  replace: v["replace-epoch"],
105
101
  personal: !!v.personal,
106
- cli: v.cli && realpathSync(v.cli),
102
+ cli,
107
103
  agent: v.reply ? getAgent(v.agent).name : undefined,
108
104
  agentOptions:
109
105
  isCindyAgent(v.agent)
@@ -189,19 +185,24 @@ function summary(row) {
189
185
  binding: row.credential ? JSON.parse(row.credential).binding_id : null,
190
186
  };
191
187
  }
192
- export async function main(argv) {
193
- const [cmd, ...args] = argv;
194
- if (!cmd || ["--help", "-h", "help"].includes(cmd) || args.includes("--help"))
188
+ export async function main(args) {
189
+ // Keep a profile starting with "-" attached to its flag, including "--help".
190
+ const argv = [];
191
+ for (let i = 0; i < args.length; i++) {
192
+ if (args[i] === "--profile" && i + 1 < args.length) argv.push("--profile=" + args[++i]);
193
+ else argv.push(args[i]);
194
+ }
195
+ if (!argv.length || argv.includes("--help") || argv.includes("-h") || argv[0] === "help")
195
196
  return console.log(help);
196
197
  // A sidecar credential represents a proxy, not a reusable local account.
197
198
  if (Object.entries(process.env).some(([key, value]) =>
198
199
  key.toUpperCase() === "TAPTAP_CLI_AUTH_PROXY" && value?.trim()))
199
200
  throw Error("机器人需要本机登录的账号,请在 TapTap 授权代理外运行");
200
- if (cmd === "__run") {
201
+ if (argv[0] === "__run") {
201
202
  const listen = await loadListener();
202
203
  const db = store();
203
204
  try {
204
- await listen(db, args[0], args[1]);
205
+ await listen(db, argv[1], argv[2]);
205
206
  } finally {
206
207
  db.close();
207
208
  }
@@ -231,13 +232,17 @@ export async function main(argv) {
231
232
  "personal",
232
233
  "retry-issue",
233
234
  ];
234
- const { values: v } = parseArgs({
235
- args,
235
+ const { values: v, positionals } = parseArgs({
236
+ args: argv,
237
+ allowPositionals: true,
236
238
  options: Object.fromEntries([
237
239
  ...strings.map((k) => [k, { type: "string" }]),
238
240
  ...flags.map((k) => [k, { type: "boolean" }]),
239
241
  ]),
240
242
  });
243
+ const [cmd] = positionals;
244
+ if (!cmd || cmd === "help") return console.log(help);
245
+ if (positionals.length > 1) throw Error("参数过多,请运行 taptap-cli bot --help");
241
246
  if (v["bot-name"] !== undefined &&
242
247
  (cmd !== "connect" || !v.reply || isCindyAgent(v.agent) || v.workspace || !v["bot-name"].trim()))
243
248
  throw Error("--bot-name 仅用于 Codex 的默认项目,请提供机器人昵称");
@@ -277,7 +282,7 @@ export async function main(argv) {
277
282
  return getAgent("codex").login({ executable: v.codex });
278
283
  }
279
284
  if (cmd === "list" || cmd === "login") {
280
- const c = config(v, false);
285
+ const c = await config(v, false);
281
286
  await login(c);
282
287
  if (cmd === "list") {
283
288
  const bots = [];
@@ -287,7 +292,7 @@ export async function main(argv) {
287
292
  return;
288
293
  }
289
294
  if (cmd === "permissions") {
290
- const c = config(v);
295
+ const c = await config(v);
291
296
  await login(c);
292
297
  c.loginBinding = await loginBinding(c);
293
298
  if (v.agent === "cindy-plugin") return output({ agent: v.agent,
@@ -311,7 +316,8 @@ export async function main(argv) {
311
316
  return output(
312
317
  db.prepare("SELECT * FROM instances ORDER BY id").all().map(summary),
313
318
  );
314
- const c = config(v),
319
+ if (!["connect", "events", "stop"].includes(cmd)) throw Error("未知命令,请运行 taptap-cli bot --help");
320
+ const c = await config(v),
315
321
  id = idOf(c);
316
322
  let row = db.prepare("SELECT * FROM instances WHERE id=?").get(id);
317
323
  if (cmd === "events") {
@@ -360,10 +366,22 @@ export async function main(argv) {
360
366
  alive(db.prepare("SELECT pid FROM instances WHERE id=?").get(id)?.pid)
361
367
  )
362
368
  throw Error("实例正在停止,请用 status 查看");
369
+ } else {
370
+ const others = db.prepare("SELECT id, pid FROM instances WHERE id GLOB ? AND id != ? AND pid IS NOT NULL ORDER BY id")
371
+ .all(`${c.env}/*/${c.bot}`, id)
372
+ .filter(instance => alive(instance.pid));
373
+ if (others.length) {
374
+ const commands = others.map(instance => {
375
+ const name = instance.id.split("/")[1];
376
+ const selector = /^[a-z0-9][a-z0-9_.-]*$/i.test(name) ? "--profile " + name :
377
+ "--profile='" + name.replaceAll("'", "'\"'\"'") + "'";
378
+ return `taptap-cli bot stop --bot ${c.bot} --env ${c.env} ${selector}`;
379
+ });
380
+ throw Error(`当前实例 ${id} 未运行。请选择要停止的实例:\n${commands.join("\n")}`);
381
+ }
363
382
  }
364
383
  return output({ instance: id, status: "stopped" });
365
384
  }
366
- if (cmd !== "connect") throw Error("未知命令,请运行 taptap-cli bot --help");
367
385
  if (alive(row?.pid)) {
368
386
  await assertLoginBinding(JSON.parse(row.config));
369
387
  const summary = runningSummary(row, c.agent, c.model, c.cindyPermission ?? c.permissionMode ?? (c.write ? "work" : undefined), c.workspace);
@@ -411,7 +429,7 @@ export async function main(argv) {
411
429
  "community-bot",
412
430
  "create-connection",
413
431
  "--help",
414
- ]);
432
+ ], { env: nativeEnvironment() });
415
433
  if (!check.stdout.includes("--replace-epoch"))
416
434
  throw Error("此 CLI 不支持个人绑定替换,请用 --cli 指定兼容构建");
417
435
  }
@@ -14,3 +14,12 @@ module.exports = async function runBot(args) {
14
14
  process.exitCode = 1;
15
15
  }
16
16
  };
17
+
18
+ // Both npm launchers accept the root --profile before the bot command.
19
+ module.exports.botArguments = function botArguments(args) {
20
+ let index = 0;
21
+ if (args[0] === "--profile") index = 2;
22
+ else if (args[0]?.startsWith("--profile=")) index = 1;
23
+ if (args[index] !== "bot") return null;
24
+ return [...args.slice(0, index), ...args.slice(index + 1)];
25
+ };
@@ -20,9 +20,27 @@ export const servers = {
20
20
  "wss://api.xdrnd.com/community-bot/v2/connect",
21
21
  ],
22
22
  };
23
- export async function tap(config, args, body, timeout) {
24
- const file = config.cli || nativeCli();
25
- accessSync(file);
23
+ export async function resolveBotProfile(cli, override) {
24
+ let profile = override ?? process.env.TAPTAP_CLI_PROFILE;
25
+ if (!profile) {
26
+ const profiles = await runTap({ cli }, [], ["profile", "list"]);
27
+ if (!profiles.length) return "default";
28
+ const selected = profiles.filter(row => row?.effective === true);
29
+ if (selected.length !== 1) throw Error("TapTap CLI profile list 未返回唯一生效的配置");
30
+ profile = selected[0].name;
31
+ }
32
+ // Match the native CLI's ValidateProfileName, including its 64-code-point limit.
33
+ if (typeof profile !== "string" || !profile || [...profile].length > 64 ||
34
+ /[\x00-\x20\x7f/\\"'`$#!&|;(){}\[\]<>?*~]/u.test(profile))
35
+ throw Error("profile 无效,请用 --profile 指定有效的名称");
36
+ return profile;
37
+ }
38
+
39
+ export function tap(config, args, body, timeout) {
40
+ return runTap(config, ["--profile=" + config.profile], args, body, timeout);
41
+ }
42
+
43
+ export function nativeEnvironment() {
26
44
  const env = Object.fromEntries(
27
45
  Object.entries(process.env).filter(
28
46
  ([k]) => !k.toUpperCase().startsWith("TAPTAP_CLI_"),
@@ -34,13 +52,19 @@ export async function tap(config, args, body, timeout) {
34
52
  TAPTAP_CLI_NO_SKILLS_NOTIFIER: "1",
35
53
  TAPTAP_CLI_NO_TELEMETRY: "1",
36
54
  });
55
+ return env;
56
+ }
57
+
58
+ async function runTap(config, selector, args, body, timeout) {
59
+ const file = config.cli || nativeCli();
60
+ accessSync(file);
61
+ const env = nativeEnvironment();
37
62
  if (config.loginBinding && ["create-connection", "get-content", "reply"].includes(args[1]))
38
63
  env.TAPTAP_CLI_BOT_EXPECT_BINDING = config.loginBinding;
39
64
  const result = await run(
40
65
  file,
41
66
  [
42
- "--profile",
43
- config.profile,
67
+ ...selector,
44
68
  ...args,
45
69
  ...(body === undefined ? [] : ["--data", "-"]),
46
70
  ],
@@ -50,6 +74,10 @@ export async function tap(config, args, body, timeout) {
50
74
  try {
51
75
  response = JSON.parse(result.code === 0 ? result.stdout : result.stderr);
52
76
  } catch {}
77
+ if (result.code === 0 && args[0] === "profile" && args[1] === "list") {
78
+ if (!Array.isArray(response)) throw Error("TapTap CLI profile list 返回的不是 JSON 数组");
79
+ return response;
80
+ }
53
81
  if (result.code !== 0 || !response?.ok) {
54
82
  const err = response?.error;
55
83
  const error = Error(
@@ -106,7 +134,7 @@ export async function login(c) {
106
134
  Math.max(1000, d.expires_at * 1000 - Date.now() + 10000),
107
135
  );
108
136
  s = await tap(c, ["auth", "status", "--offline", "--json"]);
109
- if (!s.hasAccessToken || s.accessTokenExpired || s.profile !== c.profile)
137
+ if (!s.hasAccessToken || s.accessTokenExpired)
110
138
  throw Error("账号授权未完成");
111
139
  return s;
112
140
  }
@@ -346,7 +346,7 @@ function handleSessionStart(input, deps) {
346
346
  ? `taptap-cli is available (${probe.version || "version unknown"}; plugin version ${versionMatches ? "matches" : "does not match"}).`
347
347
  : "taptap-cli was not found on PATH; TapTap commands will require environment repair.";
348
348
  const authStatus = probe.auth && probe.auth.status !== "unavailable"
349
- ? `Offline auth: profile ${probe.auth.profile || "default"}, credential ${probe.auth.credentialSource || "none"}, token ${probe.auth.hasAccessToken ? (probe.auth.accessTokenExpired ? "expired" : "present") : "absent"}.`
349
+ ? `Offline auth: credential ${probe.auth.credentialSource || "none"}, token ${probe.auth.hasAccessToken ? (probe.auth.accessTokenExpired ? "expired" : "present") : "absent"}.`
350
350
  : "Offline auth status unavailable.";
351
351
  const embedded = probe.skills?.embedded;
352
352
  const globalSkills = probe.skills?.global_agent_skills;
@@ -196,7 +196,6 @@ test("SessionStart is local, bounded by its caller, and performs no mutation", (
196
196
  available: true,
197
197
  version: "2026.7.22",
198
198
  auth: {
199
- profile: "default",
200
199
  credentialSource: "keychain",
201
200
  hasAccessToken: true,
202
201
  accessTokenExpired: false,
@@ -213,7 +212,7 @@ test("SessionStart is local, bounded by its caller, and performs no mutation", (
213
212
  );
214
213
  assert.equal(probes, 1);
215
214
  assert.equal(startup.hookSpecificOutput.hookEventName, "SessionStart");
216
- assert.match(startup.hookSpecificOutput.additionalContext, /Offline auth/);
215
+ assert.match(startup.hookSpecificOutput.additionalContext, /Offline auth: credential keychain, token present/);
217
216
  assert.match(startup.hookSpecificOutput.additionalContext, /embedded 9/);
218
217
  assert.match(startup.hookSpecificOutput.additionalContext, /No login, update, Skill installation/);
219
218
 
package/scripts/run.js CHANGED
@@ -68,7 +68,9 @@ async function main(args = process.argv.slice(2), dependencies = {}) {
68
68
  const runWizard = dependencies.runWizard ||
69
69
  (() => require("./install-wizard.js").runWizard());
70
70
 
71
- if (args[0] === "bot") return require("./bot/entry.cjs")(args.slice(1));
71
+ const runBot = require("./bot/entry.cjs");
72
+ const botArgs = runBot.botArguments(args);
73
+ if (botArgs) return runBot(botArgs);
72
74
 
73
75
  // Intercept "install" before native-binary dispatch: the JavaScript wizard
74
76
  // is self-contained and does not need the native CLI.
package/skills/index.json CHANGED
@@ -15,6 +15,12 @@
15
15
  {
16
16
  "name": "taptap-dashboard-stats"
17
17
  },
18
+ {
19
+ "name": "taptap-development"
20
+ },
21
+ {
22
+ "name": "taptap-game-service"
23
+ },
18
24
  {
19
25
  "name": "taptap-game-sign"
20
26
  },
@@ -212,8 +212,6 @@ HTTP 200 只表示 HTTP 请求成功。以顶层 `ok` 判断预检是否执行
212
212
 
213
213
  ### H. 版本历史回溯
214
214
 
215
- 多 App 轮询中,某个 App 的 `list-versions` 返回 403 时,只暂停该 App,继续查询其余目标。核对本次 `--dev-id` 与 `--app-id` 的归属,以及调用账号在该 App 的 `apply_update` 权限。修正目标或恢复权限后再查询该 App。
216
-
217
215
  #### H-1. "上一版为什么被拒?" / "刚才那次提审什么结果?"
218
216
 
219
217
  ```bash
@@ -24,8 +24,6 @@ Skill 分析只用于资料准备建议。用户明确要求提审后,展示 `
24
24
 
25
25
  ### 文字字段
26
26
 
27
- 按用户要展示文字的位置选模块。游戏简介读 `basic-info`,首页推荐语读 `profile-promotion`。在该 App 本次 `get-module` 返回的 `fields` 里确认字段和原值,再填入 `changes[].field_id` 和 `expected`。游戏简介使用 `description`,首页推荐语使用 `promotion_text`。
28
-
29
27
  | 用户怎么说 | 处理 |
30
28
  | --- | --- |
31
29
  | “改成 Y” / “就用这段” | 用户已给最终值,直接 `save-changes` 写入,不再包装候选 |
@@ -43,8 +41,6 @@ Skill 分析只用于资料准备建议。用户明确要求提审后,展示 `
43
41
 
44
42
  ### 保存失败与部分完成
45
43
 
46
- - 批量发布时,用 `save-changes --dry-run` 校验字段名。若校验指出某个 `changes[i].field_id` 无效,按提示的合法值修正该项;完整清单可用 `taptap-cli schema app save-changes` 查看。保留已上传的图片回执和视频 ID,修正字段模板并重新预览。确认保存并读回后,再继续该 App 的包体或提审步骤。
47
-
48
44
  - 先区分缺少 `expected`、字段值漂移、字段约束不符与草稿不可编辑;不要把所有 conflict 都归因其他人修改。
49
45
  - conflict 或响应含 `stale` 时,重新读取受影响字段与当前草稿。目标值已经存在则报告“当前值已符合目标”,不重复写,也不声称刚才失败的请求完成了保存。
50
46
  - 409 的 `error_description` 会点名漂移字段的中文名;按 [field map](app-edit-field-map.md) 把它对到 `field_id` 与所属 `module_id`,再用 `get-app-module --data '{"module_id":...}'` 读该模块的 `current_value`,原样回填到对应 change 的 `expected`。同一目标再冲突一次就停止重试,报告观察到的状态,不要原样重发。`expected` 必须等于该字段当前的 `current_value`:字段当前为空时才能传 `null`,字段有值时传 `null` 会被服务端当作「缺 expected」并返回 409,需要按 `get-app-module` 的本次读数原样回填。
@@ -22,9 +22,9 @@ TapTap CLI 总入口,同时承担 TapTap 业务 skill 的共享执行规范。
22
22
 
23
23
  **CRITICAL — `--yes` 只确认执行动作。服务端要求额外核对风险时,展示响应中实际返回的 `blockers` / `warnings`。签署协议前,单独展示协议名称和 URL 并取得用户明确同意,再按对应业务流程签署和回读。不得补造本地 flag 或请求字段。**
24
24
 
25
- **CRITICAL — Agent 登录必须使用 `auth login --no-wait --json` 返回的裸 JSON 契约,并用响应中的完整恢复参数继续轮询。不要只用 `device_code` 重建命令,也不要输出、记录或上报 access token。**
25
+ **CRITICAL — Agent 登录必须使用 `auth login --no-wait --json` 发起授权。不要输出、记录或上报 access token。**
26
26
 
27
- **登录链接交接 — 将 `verification_url` 按两行原样提供给用户:第一行仅写“请完成授权:”,第二行仅写 URL。不要使用 Markdown 链接语法,也不要重复展示 URL。随后立即执行 `taptap-cli auth login --device-code <device_code> --expires-at-unix <data.expires_at> --interval-seconds <data.interval>` 持续轮询,不要等待用户回复;只有运行环境无法保活轮询进程时,才请用户完成授权后通知你。登录成功后向用户只回复“登录成功”。**
27
+ **登录链接交接 — 将 `data.verification_url` 原样发给用户。第一行仅写“请完成授权:”,第二行仅写 URL。如果用户能在工具运行期间看见链接,发送后即可轮询。如果宿主只显示最终回复,或无法保活轮询,先用最终回复交付链接,等用户确认后再续登。续登时把同一回执的 `data.device_code` 填入 `data.hint` 的 `<device_code>`。登录成功后向用户只回复“登录成功”。**
28
28
 
29
29
  ## 快速决策
30
30
 
@@ -42,6 +42,8 @@ TapTap CLI 总入口,同时承担 TapTap 业务 skill 的共享执行规范。
42
42
  | 检索、生成或收录游戏图片素材 | `taptap-asset-library` | 先本地素材后生图;上传执行转 `taptap-materials` |
43
43
  | 查包体库、线上/待处理包、自测入口 | `taptap-package-management` | 先读 overview |
44
44
  | 查下载、PV、转化、订单、评分统计等数据 | `taptap-dashboard-stats` | 先确认指标、维度和时间范围 |
45
+ | 榜单/分享/广告/调试反馈 | `taptap-game-service` | 先读状态再确认写入 |
46
+ | 接入/优化/排查/构建 | `taptap-development` | 先选场景再读证据 |
45
47
  | 查玩家评价正文、差评、官方回复 | `taptap-player-feedback` | 先确认时间范围和评分口径 |
46
48
  | 查论坛帖子、子版块、帖子正文、一级回复和子回复 | `taptap-community-management` | 先确认帖子意图、子版块和时间范围 |
47
49
  | 管理测试计划、资格批次、用户资格、激活码 | `taptap-test-plan` | 先区分状态层级 |
@@ -61,7 +63,7 @@ taptap-cli schema
61
63
  taptap-cli app --help
62
64
  taptap-cli player-feedback --help
63
65
  taptap-cli community-management --help
64
- taptap-cli schema <service> <method>
66
+ taptap-cli schema <service> [resource] <method>
65
67
  taptap-cli feedback '<用户原话摘要>' --trigger user-complaint
66
68
  ```
67
69
 
@@ -69,7 +71,7 @@ taptap-cli feedback '<用户原话摘要>' --trigger user-complaint
69
71
 
70
72
  - 判断请求是否属于 TapTap 开发者后台;不是就不要强行套 CLI。复杂流程和写操作先读 [shared execution](references/shared-execution.md),同一会话已读且内容未变化时直接沿用。
71
73
  - 先区分调用 scope 与目标资源 ID;跨论坛列表的目标 App 使用 `forum_app_id`,调用 scope 仍用已授权 `developer_id` / `app_id`,详见 [业务路由](references/business-routing.md)中的社区管理 skill。缺调用 scope 时转 `taptap-identity`;多候选让用户选择,不猜 ID,也不复用可能过期的历史 ID。交接命令显式带 `--dev-id` 和 `--app-id`。
72
- - 参数不确定时先判断命令类型:服务命令使用 `schema <service> <method>` 查看输入输出;其他命令使用完整命令路径加 `--help`;再按业务主文件和领域 reference 查证,不猜字段或枚举。`config command inspect --argv-json` 只判断命令是否识别、来源、风险和策略,不提供参数说明或完整 contract。
74
+ - 参数不确定时先判断命令类型:服务命令使用 `schema <service> [resource] <method>` 查看输入输出;其他命令使用完整命令路径加 `--help`;再按业务主文件和领域 reference 查证,不猜字段或枚举。`config command inspect --argv-json` 只判断命令是否识别、来源、风险和策略,不提供参数说明或完整 contract。
73
75
  - 优先使用已准入的 `taptap-cli <domain> <verb>`;当前能力缺失时说明 CLI 暂不支持,并给可执行替代路径。
74
76
  - 需要用户转到网页继续时,遵循 [shared execution](references/shared-execution.md) 的人工页面交接规范:已知可靠入口必须首轮提供,URL 单独占一行且只展示一次;不要使用 Markdown 链接包装、追加追踪参数或猜测页面路径。
75
77
  - 写操作先读取最新状态和 `expected`,再 dry-run 或展示影响;`confirmation_required` / exit code 10 是确认门禁,不是普通失败。