siluzan-tso-cli 1.1.51 → 1.1.52-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.
package/README.md CHANGED
@@ -43,7 +43,7 @@ HTML 报告模板外部资源:**ECharts** 统一使用 `https://staticpn.siluz
43
43
  在**用户的目标项目根目录**执行(根据用户使用的助手选择 `--ai`):
44
44
 
45
45
  ```bash
46
- npm install -g siluzan-tso-cli
46
+ npm install -g siluzan-tso-cli@beta
47
47
  siluzan-tso init --ai cursor # 写入 Cursor(默认)
48
48
  siluzan-tso init --ai cursor,claude # 同时写入多个平台
49
49
  siluzan-tso init --ai all # 写入所有支持的平台
@@ -51,6 +51,7 @@ siluzan-tso init -d /path/to/skills # 写入自定义目录
51
51
  siluzan-tso init --force # 强制覆盖已存在文件
52
52
  ```
53
53
 
54
+ > **注意**:当前为测试版(1.1.52-beta.1),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-tso-cli`。
54
55
 
55
56
  | 助手 | 建议 `--ai` |
56
57
  | ----------------------- | ------------------------------------ |
package/dist/index.js CHANGED
@@ -4018,7 +4018,7 @@ var DEFAULT_API_BASE;
4018
4018
  var init_defaults = __esm({
4019
4019
  "src/config/defaults.ts"() {
4020
4020
  "use strict";
4021
- DEFAULT_API_BASE = "https://tso-api.siluzan.com";
4021
+ DEFAULT_API_BASE = "https://tso-api-ci.siluzan.com";
4022
4022
  }
4023
4023
  });
4024
4024
 
@@ -102895,8 +102895,11 @@ function okkiGeoInteractionCount(row) {
102895
102895
  }
102896
102896
  function summarizeOkkiDeviceSpend(rows) {
102897
102897
  const acc = { desktop: 0, mobile: 0, tablet: 0, other: 0 };
102898
+ const conv = { desktop: 0, mobile: 0, tablet: 0, other: 0 };
102898
102899
  for (const row of rows) {
102899
- acc[classifyDeviceKind(row.deviceType)] += num2(row.spend);
102900
+ const kind = classifyDeviceKind(row.deviceType);
102901
+ acc[kind] += num2(row.spend);
102902
+ conv[kind] += num2(row.conversions);
102900
102903
  }
102901
102904
  const desktop = round22(acc.desktop);
102902
102905
  const mobile = round22(acc.mobile);
@@ -102912,9 +102915,74 @@ function summarizeOkkiDeviceSpend(rows) {
102912
102915
  desktopShare: share(desktop, total),
102913
102916
  mobileShare: share(mobile, total),
102914
102917
  desktopLeads: desktop > mobile,
102915
- mobileLeads: mobile > desktop
102918
+ mobileLeads: mobile > desktop,
102919
+ desktopConversions: conv.desktop,
102920
+ mobileConversions: conv.mobile,
102921
+ tabletConversions: conv.tablet,
102922
+ otherConversions: conv.other
102916
102923
  };
102917
102924
  }
102925
+ function pct1(shareValue) {
102926
+ return `${(shareValue * 100).toFixed(1)}%`;
102927
+ }
102928
+ function deviceSpendLine(label, spend, shareValue, conversions) {
102929
+ return `${label}\uFF1A\u6D88\u8017\xA5${spend.toFixed(2)}\uFF08\u5360\u6BD4${pct1(shareValue)}\uFF09\uFF0C\u8F6C\u5316${conversions}\u6B21`;
102930
+ }
102931
+ function formatOkkiDeviceFactsNarrative(facts) {
102932
+ const sheetSummary = [
102933
+ deviceSpendLine("Desktop", facts.desktop, facts.desktopShare, facts.desktopConversions),
102934
+ deviceSpendLine("Mobile", facts.mobile, facts.mobileShare, facts.mobileConversions)
102935
+ ];
102936
+ if (facts.tablet > 0) {
102937
+ sheetSummary.push(
102938
+ deviceSpendLine("Tablet", facts.tablet, share(facts.tablet, facts.total), facts.tabletConversions)
102939
+ );
102940
+ }
102941
+ const desktopLeads = facts.desktop >= facts.mobile;
102942
+ const leadLabel = desktopLeads ? "\u684C\u9762\u7AEF" : "\u79FB\u52A8\u7AEF";
102943
+ const leadSpend = desktopLeads ? facts.desktop : facts.mobile;
102944
+ const leadShare = desktopLeads ? facts.desktopShare : facts.mobileShare;
102945
+ return {
102946
+ overview: `\u8BBE\u5907\u5206\u5E03\uFF1A${sheetSummary.join("\uFF1B")}`,
102947
+ summary: `\u684C\u9762\u7AEF\u6D88\u8017\xA5${facts.desktop.toFixed(2)}\uFF0C\u79FB\u52A8\u7AEF\u6D88\u8017\xA5${facts.mobile.toFixed(2)}`,
102948
+ sheetSummary,
102949
+ spendSuggestion: `${leadLabel}\u6D88\u8017\xA5${leadSpend.toFixed(2)}\uFF08\u5360\u6BD4${pct1(leadShare)}\uFF09\uFF0C\u4E3A\u4E3B\u8981\u6D88\u8017\u8BBE\u5907\uFF0C\u5EFA\u8BAE\u5173\u6CE8\u8BE5\u7AEF\u843D\u5730\u9875\u4E0E\u51FA\u4EF7\u7CFB\u6570`
102950
+ };
102951
+ }
102952
+ function mentionsOkkiDeviceSpendClaim(text2) {
102953
+ const t = text2.replace(/\s+/g, "");
102954
+ return /消耗¥/.test(t) || /占比/.test(t) || /为主要消耗/.test(t);
102955
+ }
102956
+ function ensureNarrative(data) {
102957
+ if (!data.narrative || typeof data.narrative !== "object") data.narrative = {};
102958
+ return data.narrative;
102959
+ }
102960
+ function asMutableRecord(value) {
102961
+ return value && typeof value === "object" && !Array.isArray(value) ? value : {};
102962
+ }
102963
+ function applyOkkiDeviceFactsToNarrative(data) {
102964
+ const facts = data.facts?.devices;
102965
+ if (!facts || !(facts.total > 0)) return;
102966
+ const lines = formatOkkiDeviceFactsNarrative(facts);
102967
+ const narrative = ensureNarrative(data);
102968
+ const sheetAnalysis = asMutableRecord(narrative.sheetAnalysis);
102969
+ const sheetDevices = asMutableRecord(sheetAnalysis.devices);
102970
+ const extraSheet = stringList(sheetDevices.suggestions).filter((item) => !mentionsOkkiDeviceSpendClaim(item));
102971
+ sheetAnalysis.devices = {
102972
+ summary: lines.sheetSummary,
102973
+ suggestions: [lines.spendSuggestion, ...extraSheet]
102974
+ };
102975
+ narrative.sheetAnalysis = sheetAnalysis;
102976
+ const review = asMutableRecord(narrative.review);
102977
+ const reviewDevices = asMutableRecord(review.devices);
102978
+ const extraReview = typeof reviewDevices.suggestion === "string" && !mentionsOkkiDeviceSpendClaim(reviewDevices.suggestion) ? reviewDevices.suggestion.trim() : "";
102979
+ review.devices = {
102980
+ overview: lines.overview,
102981
+ summary: lines.summary,
102982
+ suggestion: extraReview ? `${lines.spendSuggestion}\uFF1B${extraReview}` : lines.spendSuggestion
102983
+ };
102984
+ narrative.review = review;
102985
+ }
102918
102986
  function narrativeClaimsMobileSpendLeads(text2) {
102919
102987
  const t = text2.replace(/\s+/g, "");
102920
102988
  if (!t.includes("\u79FB\u52A8")) return false;
@@ -103554,7 +103622,7 @@ async function mergeOkkiSnapshotIntoReport(payload, snapshotDir) {
103554
103622
  const averageDailyCost = num4(overviewRecord.averageDailyCost);
103555
103623
  if (averageDailyCost != null) kpis.averageDailyCost = round24(averageDailyCost);
103556
103624
  }
103557
- return {
103625
+ const merged = {
103558
103626
  ...payload,
103559
103627
  meta,
103560
103628
  kpis,
@@ -103570,6 +103638,8 @@ async function mergeOkkiSnapshotIntoReport(payload, snapshotDir) {
103570
103638
  },
103571
103639
  snapshot: { sections: snapshotPresent }
103572
103640
  };
103641
+ applyOkkiDeviceFactsToNarrative(merged);
103642
+ return merged;
103573
103643
  }
103574
103644
  var init_okki_merge_snapshot = __esm({
103575
103645
  "src/commands/google-analysis/okki-merge-snapshot.ts"() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "slug": "siluzan-tso",
3
- "version": "1.1.51",
4
- "publishedAt": 1789373840577
3
+ "version": "1.1.52-beta.1",
4
+ "publishedAt": 1789440572594
5
5
  }
@@ -167,7 +167,7 @@ siluzan-tso account-history --start 2026-03-01 --end 2026-03-31 --json-out ./sna
167
167
  | 状态 | 含义 | 下一步操作 |
168
168
  | ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
169
169
  | `Pending` | 审核中 | 等待,可反复运行此命令轮询;审核周期因媒体而异 |
170
- | `Approved` | 审核通过 | 运行 `list-accounts -m <媒体>` 确认账户已出现;引导用户充值激活(`config show` 取 `webUrl`,按 `finance.md` 打开对应媒体充值页;例如 Google 为 `https://www.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google`;Yandex 当前没有对应充值界面) |
170
+ | `Approved` | 审核通过 | 运行 `list-accounts -m <媒体>` 确认账户已出现;引导用户充值激活(`config show` 取 `webUrl`,按 `finance.md` 打开对应媒体充值页;例如 Google 为 `https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google`;Yandex 当前没有对应充值界面) |
171
171
  | `Rejected` | 被拒 | 查看 `--json-out` 落盘中的 `reason` 字段了解拒绝原因;修改资料后重新提交;若原因不明,引导用户联系丝路赞客服 |
172
172
 
173
173
  ---
@@ -490,7 +490,7 @@ siluzan-tso account email-deauth -c <mediaCustomerId> --invitation-id <id> --res
490
490
 
491
491
  | 功能 | 媒体 | 网页路径 |
492
492
  | --------------------------------------- | ------ | ------------------------------------------------- |
493
- | **账户激活**(邀请他人激活 / 充值激活) | Google | `https://www.siluzan.com/v3/foreign_trade/tso/manageAccounts` |
493
+ | **账户激活**(邀请他人激活 / 充值激活) | Google | `https://www-ci.siluzan.com/v3/foreign_trade/tso/manageAccounts` |
494
494
 
495
495
  **Agent 建议话术**:
496
496
 
@@ -499,5 +499,5 @@ siluzan-tso account email-deauth -c <mediaCustomerId> --invitation-id <id> --res
499
499
  siluzan-tso config show # 查看 webUrl 字段
500
500
 
501
501
  # 账户激活(Google)→ 引导至账户管理页
502
- # https://www.siluzan.com/v3/foreign_trade/tso/manageAccounts
502
+ # https://www-ci.siluzan.com/v3/foreign_trade/tso/manageAccounts
503
503
  ```
@@ -126,7 +126,7 @@ siluzan-tso config show
126
126
 
127
127
  ### 充值页链接(按媒体 × 类型)
128
128
 
129
- 链接模式:`https://www.siluzan.com/v3/foreign_trade/tso/recharge/<page>?mediaType=<mediaType>`;丝路赞钱包:`https://www.siluzan.com/v3/foreign_trade/tso/recharge/siluzanWallet`(无媒体参数)。
129
+ 链接模式:`https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/<page>?mediaType=<mediaType>`;丝路赞钱包:`https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/siluzanWallet`(无媒体参数)。
130
130
 
131
131
  | 充值类型 | `<page>` | 支持媒体(`mediaType` 参数) |
132
132
  | ------------------------- | --------------------- | ------------------------------------------- |
@@ -1,6 +1,6 @@
1
1
  # 各媒体开户
2
2
 
3
- > 网页链接:`https://www.siluzan.com/v3/foreign_trade/tso/accountOpeningHistory?tso=%2Fv3umijs%2Ftso%2FaccountOpeningHistory`
3
+ > 网页链接:`https://www-ci.siluzan.com/v3/foreign_trade/tso/accountOpeningHistory?tso=%2Fv3umijs%2Ftso%2FaccountOpeningHistory`
4
4
  > 多命令串联见 `references/core/workflows.md` § 流程一。
5
5
 
6
6
  ## Contents
@@ -65,7 +65,7 @@ siluzan-tso open-account google-wizard
65
65
 
66
66
  ```bash
67
67
  siluzan-tso account-history -m Google
68
- # 审核通过后:config show → https://www.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google
68
+ # 审核通过后:config show → https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google
69
69
  ```
70
70
 
71
71
  ---
@@ -130,7 +130,7 @@ siluzan-tso google-analysis -a <id> --exclude materials,gold-account --json-out
130
130
  | `geo-matched` | 相符地理位置(Matched locations,`user_location_view`)账户级按国家/地区汇总 |
131
131
  | `campaign-geo` | 广告系列维度地理(可选 `--cost-greater` / `--click-greater` / `--conversions-greater` 与网关一致) |
132
132
  | `campaign-geo-matched` | 相符地理位置(Matched locations)系列级明细(可选同上阈值参数) |
133
- | `campaign-device` | 广告系列维度设备(行可含系列/组)。出价调整展示用 `bidModifierDisplay`(对齐 Google 后台:未设置=`—`,`0.6`=`-40%`);`bidModifier` 仍是倍率,禁止自行换成正百分比 |
133
+ | `campaign-device` | 广告系列维度设备(行可含系列/组)。`deviceType` 字面量多为 **`Desktop` / `Mobile` / `Tablet`**(Title Case)或中文「计算机 / 移动设备」,**不是** `DESKTOP`/`MOBILE`。出价调整展示用 `bidModifierDisplay`(对齐 Google 后台:未设置=`—`,`0.6`=`-40%`);`bidModifier` 仍是倍率,禁止自行换成正百分比 |
134
134
  | `audience` | 受众;可选 `--audience-type` |
135
135
  | `asset-images` | 图片素材 |
136
136
  | `videos` | 视频 |
@@ -1,6 +1,6 @@
1
1
  # rag:知识库检索(TSO 广告投放辅助)
2
2
 
3
- 知识库管理页面在 https://www.siluzan.com/knowledge-base/
3
+ 知识库管理页面在 https://www-ci.siluzan.com/knowledge-base/
4
4
 
5
5
  为 **广告投放、账户分析、拓词、诊断报告** 等 TSO 业务提供**企业已入库**的产品、行业、客户背景事实依据。
6
6
 
@@ -190,9 +190,9 @@ siluzan-tso report push receive-emails -m Google [--json-out ./snap]
190
190
 
191
191
  | 媒体 | 报告类型 | URL 模板 |
192
192
  | ------ | ---------------- | ----------------------------------------------------------- |
193
- | Google | 日报(Daily) | `https://www.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
194
- | Google | 小时报(Hourly) | `https://www.siluzan.com/media-report/hour/{entityId}?culture=zh-CN` |
195
- | TikTok | 日报 | `https://www.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
193
+ | Google | 日报(Daily) | `https://www-ci.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
194
+ | Google | 小时报(Hourly) | `https://www-ci.siluzan.com/media-report/hour/{entityId}?culture=zh-CN` |
195
+ | TikTok | 日报 | `https://www-ci.siluzan.com/media-report/publish/{entityId}?culture=zh-CN` |
196
196
 
197
197
  `entityId` 来自 `siluzan-tso report list --json-out ./snap` 中每条记录的 `entityId` 字段。
198
198
 
@@ -205,8 +205,8 @@ siluzan-tso report list -m Google --json-out ./snap
205
205
 
206
206
  # 第二步:查看 webUrl
207
207
  siluzan-tso config show
208
- # webUrl: https://www.siluzan.com
208
+ # webUrl: https://www-ci.siluzan.com
209
209
 
210
210
  # 第三步:拼接链接(Google 日报)
211
- # https://www.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
211
+ # https://www-ci.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
212
212
  ```
@@ -135,7 +135,7 @@
135
135
  1. (可选)Read `subagent-orchestration.md` § P6 决定是否分阶段委派。
136
136
  2. 确认 `mediaCustomerId` 与 `--start` / `--end`。
137
137
  3. 同一 `--json-out` 目录执行模板命令组合:`stats`、`balance`、`google-analysis --sections overview,campaigns,keywords,search-terms,campaign-device,campaign-geo-matched`。
138
- 4. 脚本读盘 → 只写 `okki-weekly-report.json` 的 `meta` + `narrative`(5 Sheet 表末分析 + 账户 Sheet 固定 5 维数据复盘;表为空也须写)。
138
+ 4. 脚本读盘 → 只写 `okki-weekly-report.json` 的 `meta` + `narrative`(5 Sheet 表末分析 + 账户 Sheet 固定 5 维数据复盘;表为空也须写)。`deviceType` 是 `Desktop`/`Mobile`,禁止 `.get("DESKTOP")`;设备消耗/占比由 `okki-render` 覆盖。
139
139
  5. `google-analysis okki-render --data ./okki-weekly-report.json --snapshot-dir ./snap-okki --out <xlsx>`。缺分析 / 缺 5 维复盘 / 缺 `campaign-device` 或 `campaign-geo-matched` 会拒绝出文件;按 stderr 补 JSON 后重跑。**禁止** Agent 手写 xlsx。
140
140
  6. 按 `okki-weekly-google-client.md` **默认客户话术**填数交付(用户另有话术/增删条目时从其自定义);数值与 xlsx 一致。
141
141
  - **产物**:`okki-render` 写出的 `.xlsx` 路径(缺文件 = 未完成)+ 对话内客户话术;**不**按 P4 默认 8 维追加。仅用户明确「只要话术 / 不要文件」时才省略 xlsx。
@@ -10,7 +10,7 @@
10
10
  ## 安装 CLI
11
11
 
12
12
  ```bash
13
- npm install -g siluzan-tso-cli
13
+ npm install -g siluzan-tso-cli@beta
14
14
  ```
15
15
 
16
16
  ---
@@ -64,7 +64,7 @@ siluzan-tso config set --api-key <Key> # 或 config 直接写入
64
64
  siluzan-tso config set --token <Token> # 备用:设置 JWT Token
65
65
  ```
66
66
 
67
- API Key 获取入口:`https://www.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
67
+ API Key 获取入口:`https://www-ci.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
68
68
 
69
69
  ```bash
70
70
  # 第 1 步:让用户报出手机号后,立刻发码(命令立即返回,不会等待输入)
@@ -127,9 +127,9 @@ siluzan-tso config show
127
127
 
128
128
  ```
129
129
  构建环境 : production
130
- apiBaseUrl : https://tso-api.siluzan.com
131
- googleApiUrl : https://googleapi.mysiluzan.com
132
- webUrl : https://www.siluzan.com
130
+ apiBaseUrl : https://tso-api-ci.siluzan.com
131
+ googleApiUrl : https://googleapi-ci.mysiluzan.com
132
+ webUrl : https://www-ci.siluzan.com
133
133
  apiKey : abcd****1234
134
134
  ```
135
135
 
@@ -6,7 +6,7 @@
6
6
  siluzan-tso config show # 取 webUrl
7
7
  ```
8
8
 
9
- 首页地址:`https://www.siluzan.com/v3/foreign_trade/tso/home`
9
+ 首页地址:`https://www-ci.siluzan.com/v3/foreign_trade/tso/home`
10
10
 
11
11
  ---
12
12
 
@@ -25,7 +25,7 @@ siluzan-tso config show # 取 webUrl
25
25
 
26
26
  ## 推荐话术
27
27
 
28
- 1. **「和首页一样的总览」** → 打开 `https://www.siluzan.com/v3/foreign_trade/tso/home`。
28
+ 1. **「和首页一样的总览」** → 打开 `https://www-ci.siluzan.com/v3/foreign_trade/tso/home`。
29
29
  2. **「某个 Google 账户昨天花了多少」** → `list-accounts -m Google` + `stats -m Google -a <id>`。
30
30
  3. **「有待充值账户」** → 说明聚合数据在首页;CLI 可 `list-accounts` + `balance` 逐户排查,或引导充值页。
31
31
 
@@ -60,7 +60,8 @@ siluzan-tso google-analysis okki-render \
60
60
  - `sheetAnalysis.{campaigns,keywords,searchTerms,devices,geo}`:每个 Sheet 各 `{summary[](≥1), suggestions[](≥1)}`。**表为空也必须写**(例如「本周期无搜索词,暂无加词/否词建议」)。
61
61
  - `review.{account,keywords,searchTerms,devices,geo}`:账户 Sheet「数据复盘」固定 5 维,每维 `{overview, summary, suggestion}` 均非空。
62
62
  - `tables` / `kpis`:Agent 可省略;**render 以快照覆盖**。设备/国家只认 `campaign-device` / `campaign-geo-matched`。
63
- - `facts.devices`:render 合并后写入(桌面/移动/平板**费用合计**与占比)。写设备分析必须抄这组数;桌面费用 移动却写「移动端为主要消耗 / 占比高」会**拒绝出 xlsx**。
63
+ - `facts.devices`:render 合并快照后写入(桌面/移动/平板**费用合计**、转化次数与占比)。**设备消耗 / 占比 / 谁是主力由 CLI 按这组数覆盖** `narrative.review.devices` 与 `sheetAnalysis.devices` 里带金额的句子;Agent 不必自己二次取值,只写不含金额的运营建议(落地页、出价系数)。
64
+ - `campaign-device` 的 `deviceType` 字面量是 **`Desktop` / `Mobile` / `Tablet`**(Title Case)或中文「计算机 / 移动设备 / 平板」。脚本按大小写不敏感分类(`includes("desktop")`),**禁止** `totals.get("DESKTOP")` / `.get("MOBILE")`(键对不上会得到 0,写出「消耗¥0」)。
64
65
 
65
66
  **禁止**:自己写 Node/Python 出 xlsx、用 Markdown 表代替、跳过 `okki-render`。`okki-render` 失败时按 stderr 缺项补 JSON 后重跑,不得改用手写表。
66
67
 
@@ -87,7 +88,7 @@ siluzan-tso google-analysis -a <mediaCustomerId> --start <S> --end <E> --json-ou
87
88
 
88
89
  - `stats`:区间消耗 / 曝光 / 点击 / 转化 / CTR / CPC,与账户级周报摘要对齐;金额用 `*Display` 或文档规定的展示字段。
89
90
  - `balance`:**当前**余额(非历史快照),话术写「截至查询时点」。
90
- - 「设备」「国家」两 Sheet **必须**用 **`campaign-device` / `campaign-geo-matched`**(按系列/组拆行),**不要**用账户级 `devices` / `geographic`,也**不要**用 `campaign-geo`(定向地理位置,与 OKKI「地理位置报告」口径不一致)。落盘文件名为 `campaign-device-<id>.json`、`campaign-geo-matched-<id>.json`。跨系列汇总在脚本中做。
91
+ - 「设备」「国家」两 Sheet **必须**用 **`campaign-device` / `campaign-geo-matched`**(按系列/组拆行),**不要**用账户级 `devices` / `geographic`,也**不要**用 `campaign-geo`(定向地理位置,与 OKKI「地理位置报告」口径不一致)。落盘文件名为 `campaign-device-<id>.json`、`campaign-geo-matched-<id>.json`。跨系列汇总在脚本中做:按 `deviceType` **分类累加**(`Desktop`/`desktop`/`计算机` 都算桌面),不要用全大写枚举当字典键。设备金额句交给 `okki-render` 覆盖,脚本不必再写进 `narrative`。
91
92
  - 可选:`campaign-geo-matched` 支持 `--cost-greater` / `--click-greater` / `--conversions-greater`(见 `references/analytics/account-analytics.md`)。
92
93
  - TopN、占比、洞察在写 `narrative` 前由脚本对 JSON 完成,禁止心算。
93
94
  - 写 JSON 前先读各 `<section>-<id>.outline.txt` 再读 `.json`。
@@ -168,7 +169,7 @@ siluzan-tso google-analysis -a <mediaCustomerId> --start <S> --end <E> --json-ou
168
169
  总结:
169
170
  建议:
170
171
 
171
- 文案写入 `narrative.review`(每维 `overview` / `summary` / `suggestion`),由 `okki-render` 画到账户 Sheet 底部;缺任一维会拒绝出文件。**不得编造**表中不存在的数字。
172
+ 文案写入 `narrative.review`(每维 `overview` / `summary` / `suggestion`),由 `okki-render` 画到账户 Sheet 底部;缺任一维会拒绝出文件。**不得编造**表中不存在的数字。设备维的消耗/占比句由 CLI 按 `facts.devices` 覆盖,Agent 写错键也不会把 ¥0 画进 Excel。
172
173
 
173
174
  ---
174
175
 
@@ -204,7 +205,7 @@ siluzan-tso google-analysis -a <mediaCustomerId> --start <S> --end <E> --json-ou
204
205
  | R2 | 统计区间 |
205
206
  | R3(A→M,13 列) | `设备` \| `级别` \| `广告系列` \| `出价调整` \| `展示次数` \| `点击次数` \| `点击率` \| `平均每次点击费用` \| `费用` \| `所有转化次数` \| `转化次数` \| `每次转化费用` \| `转化率` |
206
207
  | R4… | `campaign-device-*.json`(`items[]`):`deviceType`→设备;`campaignName` / `adGroupName`→「广告系列」等;`allConversions`→「所有转化次数」;`conversions`→「转化次数」;`ctr` / `conversionRate` 直接写入;**出价调整**:写 `bidModifierDisplay`(与 Google 后台一致:未设置=`—`,`0.6`=`-40%`)。禁止把倍率当正百分比,禁止把未设置的 `0` 写成 `-100%`;**级别**列按运营约定(如填 `广告系列` 或 `账户`,全文一致) |
207
- | 表末「分析」 | **总结**:各设备(Mobile/Desktop/Tablet 等)消耗与转化占比、系列×设备高消耗组合、移动端 vs 桌面 CPA/CPC 差异。**占比必须抄 `facts.devices`(按费用合计,不是行数/展示)**;桌面费用 移动时禁止写「移动端为主要消耗 / 移动端占比高」。**建议**:设备出价系数调整或系列预算倾斜(须引用设备类型与表中费用/转化),1~3 |
208
+ | 表末「分析」 | **总结 / 金额建议由 `okki-render` `facts.devices` 覆盖**(费用合计,不是行数/展示;`deviceType` `Desktop`/`Mobile`,不是 `DESKTOP`/`MOBILE`)。Agent 只需补不含金额的运营建议(出价系数、落地页、系列倾斜)。系列×设备高消耗组合、CPA/CPC 差异仍可写在建议里,不要自己重算消耗占比 |
208
209
 
209
210
  ---
210
211
 
@@ -60,7 +60,8 @@ siluzan-tso google-analysis okki-render \
60
60
  - `sheetAnalysis.{campaigns,keywords,searchTerms,devices,geo}`:每个 Sheet 各 `{summary[](≥1), suggestions[](≥1)}`。**表为空也必须写**(例如「本周期无搜索词,暂无加词/否词建议」)。
61
61
  - `review.{account,keywords,searchTerms,devices,geo}`:账户 Sheet「数据复盘」固定 5 维,每维 `{overview, summary, suggestion}` 均非空。
62
62
  - `tables` / `kpis`:Agent 可省略;**render 以快照覆盖**。设备/国家只认 `campaign-device` / `campaign-geo-matched`。
63
- - `facts.devices`:render 合并后写入(桌面/移动/平板**费用合计**与占比)。写设备分析必须抄这组数;桌面费用 移动却写「移动端为主要消耗 / 占比高」会**拒绝出 xlsx**。
63
+ - `facts.devices`:render 合并快照后写入(桌面/移动/平板**费用合计**、转化次数与占比)。**设备消耗 / 占比 / 谁是主力由 CLI 按这组数覆盖** `narrative.review.devices` 与 `sheetAnalysis.devices` 里带金额的句子;Agent 不必自己二次取值,只写不含金额的运营建议(落地页、出价系数)。
64
+ - `campaign-device` 的 `deviceType` 字面量是 **`Desktop` / `Mobile` / `Tablet`**(Title Case)或中文「计算机 / 移动设备 / 平板」。脚本按大小写不敏感分类(`includes("desktop")`),**禁止** `totals.get("DESKTOP")` / `.get("MOBILE")`(键对不上会得到 0,写出「消耗¥0」)。
64
65
 
65
66
  **禁止**:自己写 Node/Python 出 xlsx、用 Markdown 表代替、跳过 `okki-render`。`okki-render` 失败时按 stderr 缺项补 JSON 后重跑,不得改用手写表。
66
67
 
@@ -87,7 +88,7 @@ siluzan-tso google-analysis -a <mediaCustomerId> --start <S> --end <E> --json-ou
87
88
 
88
89
  - `stats`:区间消耗 / 曝光 / 点击 / 转化 / CTR / CPC,与账户级周报摘要对齐;金额用 `*Display` 或文档规定的展示字段。
89
90
  - `balance`:**当前**余额(非历史快照),话术写「截至查询时点」。
90
- - 「设备」「国家」两 Sheet **必须**用 **`campaign-device` / `campaign-geo-matched`**(按系列/组拆行),**不要**用账户级 `devices` / `geographic`,也**不要**用 `campaign-geo`(定向地理位置,与 OKKI「地理位置报告」口径不一致)。落盘文件名为 `campaign-device-<id>.json`、`campaign-geo-matched-<id>.json`。跨系列汇总在脚本中做。
91
+ - 「设备」「国家」两 Sheet **必须**用 **`campaign-device` / `campaign-geo-matched`**(按系列/组拆行),**不要**用账户级 `devices` / `geographic`,也**不要**用 `campaign-geo`(定向地理位置,与 OKKI「地理位置报告」口径不一致)。落盘文件名为 `campaign-device-<id>.json`、`campaign-geo-matched-<id>.json`。跨系列汇总在脚本中做:按 `deviceType` **分类累加**(`Desktop`/`desktop`/`计算机` 都算桌面),不要用全大写枚举当字典键。设备金额句交给 `okki-render` 覆盖,脚本不必再写进 `narrative`。
91
92
  - 可选:`campaign-geo-matched` 支持 `--cost-greater` / `--click-greater` / `--conversions-greater`(见 `references/analytics/account-analytics.md`)。
92
93
  - TopN、占比、洞察在写 `narrative` 前由脚本对 JSON 完成,禁止心算。
93
94
  - 写 JSON 前先读各 `<section>-<id>.outline.txt` 再读 `.json`。
@@ -168,7 +169,7 @@ siluzan-tso google-analysis -a <mediaCustomerId> --start <S> --end <E> --json-ou
168
169
  总结:
169
170
  建议:
170
171
 
171
- 文案写入 `narrative.review`(每维 `overview` / `summary` / `suggestion`),由 `okki-render` 画到账户 Sheet 底部;缺任一维会拒绝出文件。**不得编造**表中不存在的数字。
172
+ 文案写入 `narrative.review`(每维 `overview` / `summary` / `suggestion`),由 `okki-render` 画到账户 Sheet 底部;缺任一维会拒绝出文件。**不得编造**表中不存在的数字。设备维的消耗/占比句由 CLI 按 `facts.devices` 覆盖,Agent 写错键也不会把 ¥0 画进 Excel。
172
173
 
173
174
  ---
174
175
 
@@ -204,7 +205,7 @@ siluzan-tso google-analysis -a <mediaCustomerId> --start <S> --end <E> --json-ou
204
205
  | R2 | 统计区间 |
205
206
  | R3(A→M,13 列) | `设备` \| `级别` \| `广告系列` \| `出价调整` \| `展示次数` \| `点击次数` \| `点击率` \| `平均每次点击费用` \| `费用` \| `所有转化次数` \| `转化次数` \| `每次转化费用` \| `转化率` |
206
207
  | R4… | `campaign-device-*.json`(`items[]`):`deviceType`→设备;`campaignName` / `adGroupName`→「广告系列」等;`allConversions`→「所有转化次数」;`conversions`→「转化次数」;`ctr` / `conversionRate` 直接写入;**出价调整**:写 `bidModifierDisplay`(与 Google 后台一致:未设置=`—`,`0.6`=`-40%`)。禁止把倍率当正百分比,禁止把未设置的 `0` 写成 `-100%`;**级别**列按运营约定(如填 `广告系列` 或 `账户`,全文一致) |
207
- | 表末「分析」 | **总结**:各设备(Mobile/Desktop/Tablet 等)消耗与转化占比、系列×设备高消耗组合、移动端 vs 桌面 CPA/CPC 差异。**占比必须抄 `facts.devices`(按费用合计,不是行数/展示)**;桌面费用 移动时禁止写「移动端为主要消耗 / 移动端占比高」。**建议**:设备出价系数调整或系列预算倾斜(须引用设备类型与表中费用/转化),1~3 |
208
+ | 表末「分析」 | **总结 / 金额建议由 `okki-render` `facts.devices` 覆盖**(费用合计,不是行数/展示;`deviceType` `Desktop`/`Mobile`,不是 `DESKTOP`/`MOBILE`)。Agent 只需补不含金额的运营建议(出价系数、落地页、系列倾斜)。系列×设备高消耗组合、CPA/CPC 差异仍可写在建议里,不要自己重算消耗占比 |
208
209
 
209
210
  ---
210
211
 
@@ -9,11 +9,11 @@ $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.51'
12
+ $PKG_VERSION = '1.1.52-beta.1'
13
13
  $CLI_BIN = 'siluzan-tso'
14
14
  $SKILL_LABEL = 'Siluzan TSO'
15
- $INSTALL_CMD = 'npm install -g siluzan-tso-cli'
16
- $WEB_BASE = 'https://www.siluzan.com'
15
+ $INSTALL_CMD = 'npm install -g siluzan-tso-cli@beta'
16
+ $WEB_BASE = 'https://www-ci.siluzan.com'
17
17
 
18
18
  # -- Constants ----------------------------------------------------------------
19
19
  $NODE_MAJOR_MIN = 18
@@ -9,11 +9,11 @@ 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.51"
12
+ readonly PKG_VERSION="1.1.52-beta.1"
13
13
  readonly CLI_BIN="siluzan-tso"
14
14
  readonly SKILL_LABEL="Siluzan TSO"
15
- readonly INSTALL_CMD="npm install -g siluzan-tso-cli"
16
- readonly WEB_BASE="https://www.siluzan.com"
15
+ readonly INSTALL_CMD="npm install -g siluzan-tso-cli@beta"
16
+ readonly WEB_BASE="https://www-ci.siluzan.com"
17
17
 
18
18
  # -- Constants ----------------------------------------------------------------
19
19
  readonly NODE_MAJOR_MIN=18
@@ -46,7 +46,7 @@ siluzan-tso google-analysis -a <mediaCustomerId> --start <S> --end <E> --json-ou
46
46
  **任务**:
47
47
 
48
48
  1. Read `report-templates/okki-weekly-google-client.md` 中 **§标准四步流程** 与 **§对外客户话术**(默认 7 条模板;主 Agent 若指定自定义话术则从其指示)。
49
- 2. 按 `assets/okki-weekly-report.schema.json` 写 `okki-weekly-report.json`:只填 `meta` + `narrative.sheetAnalysis`(5 Sheet,各 summary≥1 / suggestions≥1)+ `narrative.review`(固定 5 维:账户/关键词/搜索字词/设备/国家,每维 overview+summary+suggestion)。表为空也须写分析。
49
+ 2. 按 `assets/okki-weekly-report.schema.json` 写 `okki-weekly-report.json`:只填 `meta` + `narrative.sheetAnalysis`(5 Sheet,各 summary≥1 / suggestions≥1)+ `narrative.review`(固定 5 维:账户/关键词/搜索字词/设备/国家,每维 overview+summary+suggestion)。表为空也须写分析。`campaign-device` 的 `deviceType` 是 `Desktop`/`Mobile`/`Tablet`(不是 `DESKTOP`/`MOBILE`);设备消耗/占比由 `okki-render` 按快照覆盖,脚本不要用大写键二次取值,也不要把 ¥0 写进设备维。
50
50
  3. 执行:
51
51
  ```bash
52
52
  siluzan-tso google-analysis okki-render \
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siluzan-tso-cli",
3
- "version": "1.1.51",
3
+ "version": "1.1.52-beta.1",
4
4
  "description": "Siluzan 广告账户管理 CLI — 查询账户、余额、消耗数据,管理绑定关系与充值。",
5
5
  "keywords": [
6
6
  "ad-account",