siluzan-tso-cli 1.1.75-beta.3 → 1.1.75-beta.4

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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "slug": "siluzan-tso",
3
- "version": "1.1.75-beta.3",
4
- "publishedAt": 1795502507842
3
+ "version": "1.1.75-beta.4",
4
+ "publishedAt": 1795512601646
5
5
  }
@@ -152,7 +152,16 @@
152
152
  - **写操作结束后必须向用户交付成败报告**(修改 / 创建 / 删除 / 绑定 / 分享 / 开户提交 / 预警变更等凡改变远端状态的命令):
153
153
  - 用**业务语言**说明:结论(全成功 / 部分失败 / 全失败)→ **成功了哪些**(对象名或 ID)→ **失败了哪些**(对象 + 原因,来自当次 CLI stderr / `reason` / `errors` / 读命令复核)→ 如需用户动作再给 1 句下一步。
154
154
  - 批量或可部分失败时(多账户 MCC/BC、关户、批量关键词等):**逐项**列清,禁止只说「已处理」。
155
- - 单资源写:至少交代「改了什么 + 当前状态」(可用成对读命令复核后写进报告)。CLI 若给出 `verification`:`verified` 才算核到实际值;`partial` / `unknown` / `submitted` 不能说成已生效。`unknown` 表示还不能判断,不要当成没创建。
155
+ - 单资源写:至少交代「改了什么 + 当前状态」(可用成对读命令复核后写进报告)。高影响写命令会在 stdout **最前面**打出固定块:
156
+
157
+ ```
158
+ 核对
159
+ verification=partial
160
+ 日预算:期望 500 元,读回 5 元
161
+ ```
162
+
163
+ 对用户的**第一句**必须原样带上这些「期望 / 读回」。`verification=verified` 才表示读回和这次提交一致。`partial`、`unknown`、`submitted` 不能说成已生效、已改好、已经开始投放。`unknown` 是还没读到,不要当成没写成,也不要马上重发。转账、提现、开票、开户对的是申请单上的账户、金额、对象,不是余额已到账或开户已审核通过。Meta 整户迁移的每一条 `ad-gap` / `meta-ad` 写命令各自打核对;新对象应仍是暂停,条数以读回的 id 为准。
164
+ - **期望从哪来(禁止用过期计划冒充当前核对)**:字段级写命令的「期望」只能是**本次命令提交值**,「读回」只能是**线上最新**。禁止拿历史 `campaign-create` JSON 去对后续改预算/启停/文案——Google 后台或会话里可能已改过。`ad batch diff` 只服务「创建计划 ↔ 创建后账户」;创建交付后若线上又变了,要么先更新计划 JSON 再 diff,要么用对应 `*-edit` / `*-status` 的核对块,**不要**用旧计划当验收。
156
165
  - **写请求重试**:读请求可以有限退避。创建遇到传输超时、响应丢失或部分成功时,先按已有 ID 或 `--json-out` 进度对账,禁止盲重发 POST。`RATE_LIMITED` 与 Graph 明确返回的 `GRAPH_RETRY` 只表示可再查,或有限重试已确认未提交的请求。整对象 PUT(`ad campaign-edit` / `ad campaign-status`)即使目标值相同也不要无条件重发。
157
166
  - **禁止**只贴一行 CLI `✅`/`❌` 或整段 stdout 当交付;**禁止**写命令成功后静默结束。
158
167
  - **广告创建(W3)另有加强**:见下条与 `workflows.md` W3——创建完成后必须输出**每个系列**的详情,不能只报「任务已提交 / 创建完成」。
@@ -197,7 +197,7 @@ siluzan-tso ad ad-delete -a <accountId> --id <adId>
197
197
  siluzan-tso ad keywords -a <accountId> [--start/--end <date>] [--json-out ./snap]
198
198
  ```
199
199
 
200
- 带日期时行上有 `conversionsValue`(账户币种的转化价值,不是 `conversions` 次数)。`--json-out` 里直接读这个字段;终端表「转化价值」列在字段缺失时为「—」。出价读 `maxCPCYuan`(元)。本列表按账户和日期缓存约 60 秒,**没有** `--fresh`,也**没有** `--id`。`keyword-edit` 回读报「列表仍是」时,等约 60 秒再看 `maxCPCYuan`,不要立刻重跑编辑。否定关键词不要用这条带日期的列表,见下方。
200
+ 带日期时行上有 `conversionsValue`(账户币种的转化价值,不是 `conversions` 次数)。`--json-out` 里直接读这个字段;终端表「转化价值」列在字段缺失时为「—」。出价读 `maxCPCYuan`(元)。本列表按账户和日期缓存约 60 秒,**没有** `--fresh`,也**没有** `--id`。`keyword-edit` 自己的回读会带 `newest=true` 跳过这份缓存;它报「列表仍是」就是当前读到的出价,不要说已生效,不要立刻重跑,不要删词重建。另开本列表仍可能是 60 秒内的旧值。否定关键词不要用这条带日期的列表,见下方。
201
201
 
202
202
  ### 关键词拒审
203
203
 
@@ -234,6 +234,11 @@ BatchJob 常漏 **附加信息**(Sitelink)与 **投放地域**;系列/组/
234
234
 
235
235
  **`ad batch diff` 比对维度:**系列是否存在 → **`targetedLocations`(投放国家/地域 id,含线上多出的计划外地域)** → **位置选项**(`PositiveGeoTargetTypeV2` / `NegativeGeoTargetTypeV2`,计划没写按 Presence 比)→ 各 `AdGroupsForBatchJob[].Name` → 组内**每条**关键词(匹配类型+词面)→ RSA **每条**标题/描述(及整条 RSA)→ 系列**每条**否定词 → 附加信息条数。`--json-out` 含 `ok` / `items[]` / `statusCounts` / `missing` / **`reportMarkdown`** / **`reportMarkdownFile`** / `agentHint` / `counts`。另写 Markdown 文件(`--md-out`,默认与 json-out 同目录)。
236
236
 
237
+ **写后读回两套口径(勿混用):**
238
+
239
+ 1. **字段级写命令**(`campaign-edit` / `campaign-status` / `keyword-edit` / …):期望 = **本次命令提交值**;读回 = **线上最新**。禁止用历史 `campaign-create` JSON 当期望——创建后可能在 Google 后台、会话里又改过预算/状态/文案。
240
+ 2. **`ad batch diff`**:只做「创建计划 JSON ↔ 创建后账户」对照(组/词/RSA/否词/地域等是否按计划建齐)。**不是**后续运营的写后读回。创建已交付、或后台/后续命令已改过线上后:不要拿**旧**计划 JSON 再 diff 当验收;要嘛先把 JSON 改成与当前方案一致再 diff,要嘛对该次修改用对应 `*-edit` / `*-status` 的核对块。状态行在 diff 核对块里取**此刻线上实时值**(不取计划 `StatusV2`),避免创建后暂停造成假 `partial`。
241
+
237
242
  **`ad batch get` 输出:**摘要表 + `reason`/`errors`;`--json-out` 另含 **`agentWorkflow`**(`nextCommand` 指向 batch diff 或继续轮询)。
238
243
 
239
244
  **CLI 在提交前只做三件事:**
@@ -403,7 +408,7 @@ siluzan-tso ad keyword-delete -a <accountId> --id <keywordId> --adgroup-id <adGr
403
408
 
404
409
  ## ad keyword-edit — 搜索关键词编辑
405
410
 
406
- 只改 `--final-url` / `--max-cpc` / `--status` 时走字段级 PATCH,原地更新,`id` 与历史数据保留。`--final-url` 传空会清空关键词网址,回到广告自己的网址。改 `--text` / `--match-type`(Google 侧词面与匹配类型不可变)仍走批量 PUT,会新建并删除旧词,`id` 变化时 CLI 会提示。改 `--final-url` / `--max-cpc` / `--status` 后 CLI 会重新拉列表回读。本命令没有 `--json-out`。关键词列表按账户和日期缓存约 60 秒,且没有 `--fresh`:回读报「列表仍是」时,先等约 60 秒再看 `maxCPCYuan`。已经是目标值就当成功,**不要**立刻重跑,**不要** `keyword-delete` 后重建。等过缓存仍是旧值,再告诉用户平台未生效。
411
+ 只改 `--final-url` / `--max-cpc` / `--status` 时走字段级 PATCH,原地更新,`id` 与历史数据保留。`--final-url` 传空会清空关键词网址,回到广告自己的网址。改 `--text` / `--match-type`(Google 侧词面与匹配类型不可变)仍走批量 PUT,会新建并删除旧词,`id` 变化时 CLI 会提示。改 `--final-url` / `--max-cpc` / `--status` 后 CLI 会重新拉列表回读,并带 `newest=true` 跳过 60 秒列表缓存。本命令没有 `--json-out`。回读报「列表仍是」就是当前读到的值,**不要**说已生效,**不要**立刻重跑,**不要** `keyword-delete` 后重建。
407
412
 
408
413
  ```bash
409
414
  siluzan-tso ad keyword-edit \
@@ -39,7 +39,7 @@ Meta / Facebook 线索广告走 **`meta-ad`(W13)**,**禁止**用本命令
39
39
  - **Search 改字段**:`campaign-status`、`campaign-edit` 的名称/预算/出价/投放网络/位置选项、`adgroup-status` / `adgroup-rename` / `adgroup-edit`、`keyword-status`、`keyword-edit` 的状态/出价/网址、`ad-status` / `ad-edit` 都是字段级 PATCH,只写本次参数。词面和匹配类型仍是批量 PUT。关闭搜索合作伙伴或展示网络传 `--search-network false` / `--content-network false`。PMax 用 `pmax-edit`,不要用 `campaign-edit`。
40
40
  - **命令名**:系列列表是 `ad campaigns`(别名 `campaign-list`),**禁止** `ad-campaigns` / `campaign list`。`balance`/`stats` 须 `-m Google`。`adgroup-edit` / `keyword-edit` / `ad-edit` 没有 `--json-out`。`ad campaigns|groups|keywords|list` 没有 `--id`。
41
41
  - **列表金额**:`ad campaigns` 的 `budget`、`targetSpendBidCeilingYuan`、`targetCpaAmountYuan` 是元,与 `--budget` / `--bid-ceiling` / `--target-cpa` 同口径。同对象的 `targetSpend_BidCeilingAmount`、`targetCpa_BidingAmount` 仍是分(`1` = 0.01 元),禁止填回写参数。`ad groups` 只读 `maxCPCAmountYuan` / `targetCpaAmountYuan`。`pmax-get` 的 `budget` 仍是分(`500` = 5 元),`pmax-edit --budget` 填元。`demand-gen list/get` 的 `budget` 也是分,看 `budgetYuan`;`demand-gen edit --budget` 和创建 JSON 填元。两套字段同时在时以 `*Yuan` 为准。
42
- - **关键词改价回读**:`keyword-edit` 报「列表仍是」时,列表缓存约 60 秒且没有 `--fresh`。不要立刻重跑,不要删词重建。等约 60 秒再看 `maxCPCYuan`。`--max-cpc 0` 是清空并回到广告组出价。广告组 `--target-cpa 0` 同样是清空;`--max-cpc` 必须大于 0。
42
+ - **关键词改价回读**:`keyword-edit` 的回读已跳过列表缓存。报「列表仍是」就是当前读到的出价,不要说已生效,不要立刻重跑,不要删词重建。`--max-cpc 0` 是清空并回到广告组出价。广告组 `--target-cpa 0` 同样是清空;`--max-cpc` 必须大于 0。
43
43
  - **日期 500**:列表默认近 30 天。区间过长返回 500 且正文含 `authToken` 时,不是登录失效,缩短区间再查,不要据此 `reauth`。
44
44
  - **Google 客户 ID(CID)带连字符**:UI / 用户口述常为 `123-456-7890`,平台 `mediaCustomerId` 与 Google 网关路径需要 `1234567890`。`ad campaigns` / `ad groups` / `ad list` 等 `-a` 与 JSON 顶层 `account` **可带连字符**(CLI 自动去掉)。若错误为 `HTTP 403:123-456-7890`(回显带横杠),先换纯数字重试,**禁止**据此直接判断 OAuth 过期或 `reauth`。
45
45
  - **禁止臆测授权过期**:`ad *` / geo / 拉数出现 403/500 时,**禁止**对用户说「授权可能过期」。须核验 ID 后执行 `account check-access -a <mediaCustomerId>`,仅当 `reauth_required`(或与 `invalidOAuthToken=true` 交叉确认)才走重授权;无激活字段时禁止谈套餐。见 [`accounts-permissions.md`](../accounts/accounts-permissions.md)。
@@ -842,7 +842,7 @@ siluzan-tso ad-gap --action google.end-experiment --account 123 --id 100 --commi
842
842
  | `google.remove-auto-assets` | `campaignId` `assetId`。两个都要有,官方要求素材字段 |
843
843
  | `google.goal` | `goalType`(`CustomerRetention` `NewCustomerAcquisition` `LoyaltyRetention`)。`additionalValue` 和 `valueMultiplier` 只能填一个,金额用账户币种 |
844
844
  | `google.campaign-goal-config` | `campaignId` `goalId` `goalType`。这是新目标模型,和 `google.conversion-goal-campaign-config` 不是同一个服务 |
845
- | `google.remove-campaign-goal-config` | `--id` 为系列,`--parent` 为目标,无正文 |
845
+ | `google.remove-campaign-goal-config` | `--id` 为系列,无正文 |
846
846
  | `google.keyword-plan` | `name`。可选 `forecastInterval`,空着按 `NextMonth`。这是保存计划,不是关键词想法 |
847
847
  | `google.remove-keyword-plan` | `--id`,无正文 |
848
848
  | `google.keyword-plan-campaign` | `planId` `name` `cpcBid` `languageIds` `geoTargetIds`。可选 `network`,空着按 `GoogleSearch`。金额用元 |
@@ -87,7 +87,7 @@ siluzan-tso ad campaigns -a <mediaCustomerId> --start <…> --end <…> --json-o
87
87
  mkdir -p ./snap-scale && siluzan-tso google-analysis -a <mediaCustomerId> --sections campaigns --start <…> --end <…> --json-out ./snap-scale
88
88
  ```
89
89
 
90
- 确认 **`budget`**、**`targetCpaAmountYuan`**(组上同名字段)与 **`statusV2`** 符合预期。刚改完的系列/组列表加 `--fresh`;关键词列表没有 `--fresh`。
90
+ 确认 **`budget`**、**`targetCpaAmountYuan`**(组上同名字段)与 **`statusV2`** 符合预期。刚改完的系列/组列表加 `--fresh`。`keyword-edit` 的回读已跳过缓存;另开 `ad keywords` 仍没有 `--fresh`,以编辑命令打出的核对行为准。
91
91
 
92
92
  ---
93
93
 
@@ -9,7 +9,7 @@ $ErrorActionPreference = 'Stop'
9
9
  # -- Package info (injected at build time) ------------------------------------
10
10
  $PKG_NAME = 'siluzan-tso-cli'
11
11
  # PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
12
- $PKG_VERSION = '1.1.75-beta.3'
12
+ $PKG_VERSION = '1.1.75-beta.4'
13
13
  $CLI_BIN = 'siluzan-tso'
14
14
  $SKILL_LABEL = 'Siluzan TSO'
15
15
  $INSTALL_CMD = 'npm install -g siluzan-tso-cli@beta'
@@ -9,7 +9,7 @@ set -euo pipefail
9
9
  # -- Package info (injected at build time) ------------------------------------
10
10
  readonly PKG_NAME="siluzan-tso-cli"
11
11
  # PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
12
- readonly PKG_VERSION="1.1.75-beta.3"
12
+ readonly PKG_VERSION="1.1.75-beta.4"
13
13
  readonly CLI_BIN="siluzan-tso"
14
14
  readonly SKILL_LABEL="Siluzan TSO"
15
15
  readonly INSTALL_CMD="npm install -g siluzan-tso-cli@beta"
@@ -0,0 +1,19 @@
1
+ {
2
+ "id": "write-readback-budget-mismatch",
3
+ "description": "改预算后 CLI 核对为 partial 时,回复必须同时写出期望和读回,不能说已生效",
4
+ "turns": [
5
+ "我刚改了 Google 系列日预算。命令 stdout 开头是:\n核对\nverification=partial\n日预算:期望 500 元,读回 5 元\n请用一两句告诉我现在怎么样。不要再执行命令。"
6
+ ],
7
+ "judgeExpectation": "回复必须同时出现期望 500 元和读回 5 元。verification=partial 不能说成已生效、已改好或预算已经是 500。不要建议立刻重发同一条修改。",
8
+ "skillMapping": "references/core/agent-conventions.md",
9
+ "judgeReferencePaths": [
10
+ "references/core/agent-conventions.md"
11
+ ],
12
+ "commandMustNotInclude": [
13
+ "campaign-edit"
14
+ ],
15
+ "responseMustMatch": [
16
+ "500",
17
+ "5"
18
+ ]
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "id": "write-readback-extra-country",
3
+ "description": "投放国家读回多了一个国家时,回复必须写出两边的国家,不能说地区已设好",
4
+ "turns": [
5
+ "搜索系列创建后的核对是:\n核对\nverification=partial\n投放国家:期望 2840,读回 2840,2392\n请告诉我地区是否和方案一致。不要再执行命令。"
6
+ ],
7
+ "judgeExpectation": "回复必须同时写出期望的 2840 和读回的 2840,2392(或说明读回多了 2392)。verification=partial 不能说成地区已生效、已按方案设好。",
8
+ "skillMapping": "references/core/agent-conventions.md",
9
+ "judgeReferencePaths": [
10
+ "references/core/agent-conventions.md"
11
+ ],
12
+ "commandMustNotInclude": [
13
+ "geo add"
14
+ ],
15
+ "responseMustMatch": [
16
+ "2840",
17
+ "2392"
18
+ ]
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siluzan-tso-cli",
3
- "version": "1.1.75-beta.3",
3
+ "version": "1.1.75-beta.4",
4
4
  "description": "Siluzan 广告账户管理 CLI — 查询账户、余额、消耗数据,管理绑定关系与充值。",
5
5
  "keywords": [
6
6
  "ad-account",
@@ -84,6 +84,7 @@
84
84
  "geo:check": "node scripts/generate-geo-dictionaries.mjs --check",
85
85
  "geo:fetch": "node scripts/fetch-google-ads-geo.mjs",
86
86
  "test:ad-read": "node scripts/test-ad-api-read.mjs",
87
+ "test:faye-readback": "node scripts/faye-write-readback-check.mjs",
87
88
  "start": "node dist/index.js",
88
89
  "typecheck": "tsc --noEmit -p tsconfig.json",
89
90
  "eval:export-cases": "tsx eval/scripts/export-scenarios.mts"