siluzan-tso-cli 1.1.41 → 1.1.42-beta.2

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.42-beta.2),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-tso-cli`。
54
55
 
55
56
  | 助手 | 建议 `--ai` |
56
57
  | ----------------------- | ------------------------------------ |
package/dist/index.js CHANGED
@@ -2300,8 +2300,7 @@ function buildSiluzanClientIdentityHeaders() {
2300
2300
  "X-Siluzan-Client": client,
2301
2301
  "X-Siluzan-Runtime": runtime,
2302
2302
  "X-Siluzan-Skill-Version": version,
2303
- // 暂时不发送 X-Company-Source-Type:本次发版临时需求,待后端确认后恢复
2304
- // "X-Company-Source-Type": SILUZAN_AGENT_COMPANY_SOURCE_TYPE,
2303
+ "X-Company-Source-Type": SILUZAN_AGENT_COMPANY_SOURCE_TYPE,
2305
2304
  "User-Agent": `${client}/${version}`
2306
2305
  };
2307
2306
  }
@@ -3888,7 +3887,7 @@ async function issueApiKeyWithPhoneCode(opts) {
3888
3887
  });
3889
3888
  return apiKey;
3890
3889
  }
3891
- var import_semver, SILUZAN_DIR, CONFIG_FILE, inProcessLockChain, ALLOWED_HOSTNAME_SUFFIXES, EXACT_ID_FIELD_NAMES, _clientProduct, _resolveVersion, DEFAULT_TIMEOUT_MS, MAX_RESPONSE_BYTES, httpsAgent, httpAgent, PERF_PREFIX, DEFAULT_DETAIL_MAX, VERBOSE_DETAIL_MAX, ASCII_TABLE_CHARS, CLI_SNAPSHOT_MANIFEST_FILE, SCHEMA_VERSION, FALLBACK_FIELD_GUIDE_REFS, _cliPackage, _resolveCliVersion, _fieldGuideRefs, OUTLINE_AGENT_HINT, TS_LIKE_ARRAY_SAMPLE_MAX, MAX_INVOCATION_CHARS, currentInvocation, MAX_COMMIT_CHARS, WRITE_AUDIT_AGENT_AUTO_COMMIT, cliCommitOverride, WRITE_AUDIT_SCHEMA_VERSION, MUTATING, BEIJING_TZ, AUDIT_LOG_FILENAME_RE, DEFAULT_MAX_FILE_MB, MIN_SEGMENT_BYTES, MAX_SEGMENT_BYTES, DEFAULT_RETENTION_DAYS, MIN_RETENTION_DAYS, MAX_RETENTION_DAYS, PRUNE_THROTTLE_MS, lastPruneAtMs, MAX_BODY_CHARS, MAX_ERROR_CHARS, DEFAULT_FIND_AUDIT_MAX_DAYS, MAX_SNAPSHOT_FILE_BYTES, API_KEY_SERVICE_VALUES;
3890
+ var import_semver, SILUZAN_DIR, CONFIG_FILE, inProcessLockChain, ALLOWED_HOSTNAME_SUFFIXES, EXACT_ID_FIELD_NAMES, SILUZAN_AGENT_COMPANY_SOURCE_TYPE, _clientProduct, _resolveVersion, DEFAULT_TIMEOUT_MS, MAX_RESPONSE_BYTES, httpsAgent, httpAgent, PERF_PREFIX, DEFAULT_DETAIL_MAX, VERBOSE_DETAIL_MAX, ASCII_TABLE_CHARS, CLI_SNAPSHOT_MANIFEST_FILE, SCHEMA_VERSION, FALLBACK_FIELD_GUIDE_REFS, _cliPackage, _resolveCliVersion, _fieldGuideRefs, OUTLINE_AGENT_HINT, TS_LIKE_ARRAY_SAMPLE_MAX, MAX_INVOCATION_CHARS, currentInvocation, MAX_COMMIT_CHARS, WRITE_AUDIT_AGENT_AUTO_COMMIT, cliCommitOverride, WRITE_AUDIT_SCHEMA_VERSION, MUTATING, BEIJING_TZ, AUDIT_LOG_FILENAME_RE, DEFAULT_MAX_FILE_MB, MIN_SEGMENT_BYTES, MAX_SEGMENT_BYTES, DEFAULT_RETENTION_DAYS, MIN_RETENTION_DAYS, MAX_RETENTION_DAYS, PRUNE_THROTTLE_MS, lastPruneAtMs, MAX_BODY_CHARS, MAX_ERROR_CHARS, DEFAULT_FIND_AUDIT_MAX_DAYS, MAX_SNAPSHOT_FILE_BYTES, API_KEY_SERVICE_VALUES;
3892
3891
  var init_dist = __esm({
3893
3892
  "../common/dist/index.js"() {
3894
3893
  "use strict";
@@ -3934,6 +3933,7 @@ var init_dist = __esm({
3934
3933
  "lastChangedBy",
3935
3934
  "userId"
3936
3935
  ]);
3936
+ SILUZAN_AGENT_COMPANY_SOURCE_TYPE = "Ctaiad";
3937
3937
  _clientProduct = "siluzan-cli";
3938
3938
  DEFAULT_TIMEOUT_MS = 10 * 60 * 1e3;
3939
3939
  MAX_RESPONSE_BYTES = 50 * 1024 * 1024;
@@ -4011,7 +4011,7 @@ var DEFAULT_API_BASE;
4011
4011
  var init_defaults = __esm({
4012
4012
  "src/config/defaults.ts"() {
4013
4013
  "use strict";
4014
- DEFAULT_API_BASE = "https://tso-api.siluzan.com";
4014
+ DEFAULT_API_BASE = "https://tso-api-ci.siluzan.com";
4015
4015
  }
4016
4016
  });
4017
4017
 
@@ -4484,56 +4484,6 @@ var init_currency_display = __esm({
4484
4484
  }
4485
4485
  });
4486
4486
 
4487
- // src/utils/media-customer-id.ts
4488
- function stripMediaCustomerIdDecorators(raw) {
4489
- return raw.trim().replace(/[\s-]+/g, "");
4490
- }
4491
- function looksLikeNumericMediaCustomerId(raw) {
4492
- return /^\d+$/.test(stripMediaCustomerIdDecorators(raw));
4493
- }
4494
- function normalizeNumericMediaCustomerId(raw) {
4495
- if (!looksLikeNumericMediaCustomerId(raw)) return null;
4496
- return stripMediaCustomerIdDecorators(raw);
4497
- }
4498
- function looksLikeEntityIdUuid(raw) {
4499
- return ENTITY_ID_UUID_RE.test(raw.trim());
4500
- }
4501
- function warnIfAccountIdsLookLikeEntityId(ids, command) {
4502
- const bad = ids.map((id) => id.trim()).filter((id) => id && looksLikeEntityIdUuid(id));
4503
- if (bad.length === 0) return;
4504
- console.error(
4505
- `
4506
- \u26A0\uFE0F ${command} \u7684 -a/--accounts \u6536\u5230\u7591\u4F3C entityId/UUID\uFF1A${bad.join(", ")}
4507
- \u672C\u547D\u4EE4\u9700\u8981 mediaCustomerId\uFF08list-accounts \u7684 ma.mediaCustomerId\uFF1BYandex \u5F62\u5982 porg-\u2026\uFF09\u3002
4508
- \u8BF7\u5148 list-accounts -m <\u5A92\u4F53> -k <\u5A92\u4F53\u8D26\u6237\u53F7> \u6838\u5BF9\u540E\u518D\u91CD\u8BD5\uFF1B\u52FF\u636E\u6B64\u76F4\u63A5 reauth\u3002
4509
- `
4510
- );
4511
- }
4512
- function parseNumericMediaCustomerIds(input) {
4513
- if (!input || !input.trim()) return [];
4514
- const seen = /* @__PURE__ */ new Set();
4515
- const out = [];
4516
- for (const raw of input.split(",")) {
4517
- const piece = raw.trim();
4518
- if (!piece) continue;
4519
- const id = normalizeNumericMediaCustomerId(piece);
4520
- if (!id) {
4521
- throw new Error(`mediaCustomerId \u5FC5\u987B\u4E3A\u7EAF\u6570\u5B57\uFF08\u53EF\u542B\u8FDE\u5B57\u7B26\uFF09\uFF1A${piece}`);
4522
- }
4523
- if (seen.has(id)) continue;
4524
- seen.add(id);
4525
- out.push(id);
4526
- }
4527
- return out;
4528
- }
4529
- var ENTITY_ID_UUID_RE;
4530
- var init_media_customer_id = __esm({
4531
- "src/utils/media-customer-id.ts"() {
4532
- "use strict";
4533
- ENTITY_ID_UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
4534
- }
4535
- });
4536
-
4537
4487
  // src/utils/balance.ts
4538
4488
  function fmt(d) {
4539
4489
  return d.toISOString().slice(0, 10);
@@ -4840,6 +4790,56 @@ var init_balance = __esm({
4840
4790
  }
4841
4791
  });
4842
4792
 
4793
+ // src/utils/media-customer-id.ts
4794
+ function stripMediaCustomerIdDecorators(raw) {
4795
+ return raw.trim().replace(/[\s-]+/g, "");
4796
+ }
4797
+ function looksLikeNumericMediaCustomerId(raw) {
4798
+ return /^\d+$/.test(stripMediaCustomerIdDecorators(raw));
4799
+ }
4800
+ function normalizeNumericMediaCustomerId(raw) {
4801
+ if (!looksLikeNumericMediaCustomerId(raw)) return null;
4802
+ return stripMediaCustomerIdDecorators(raw);
4803
+ }
4804
+ function looksLikeEntityIdUuid(raw) {
4805
+ return ENTITY_ID_UUID_RE.test(raw.trim());
4806
+ }
4807
+ function warnIfAccountIdsLookLikeEntityId(ids, command) {
4808
+ const bad = ids.map((id) => id.trim()).filter((id) => id && looksLikeEntityIdUuid(id));
4809
+ if (bad.length === 0) return;
4810
+ console.error(
4811
+ `
4812
+ \u26A0\uFE0F ${command} \u7684 -a/--accounts \u6536\u5230\u7591\u4F3C entityId/UUID\uFF1A${bad.join(", ")}
4813
+ \u672C\u547D\u4EE4\u9700\u8981 mediaCustomerId\uFF08list-accounts \u7684 ma.mediaCustomerId\uFF1BYandex \u5F62\u5982 porg-\u2026\uFF09\u3002
4814
+ \u8BF7\u5148 list-accounts -m <\u5A92\u4F53> -k <\u5A92\u4F53\u8D26\u6237\u53F7> \u6838\u5BF9\u540E\u518D\u91CD\u8BD5\uFF1B\u52FF\u636E\u6B64\u76F4\u63A5 reauth\u3002
4815
+ `
4816
+ );
4817
+ }
4818
+ function parseNumericMediaCustomerIds(input) {
4819
+ if (!input || !input.trim()) return [];
4820
+ const seen = /* @__PURE__ */ new Set();
4821
+ const out = [];
4822
+ for (const raw of input.split(",")) {
4823
+ const piece = raw.trim();
4824
+ if (!piece) continue;
4825
+ const id = normalizeNumericMediaCustomerId(piece);
4826
+ if (!id) {
4827
+ throw new Error(`mediaCustomerId \u5FC5\u987B\u4E3A\u7EAF\u6570\u5B57\uFF08\u53EF\u542B\u8FDE\u5B57\u7B26\uFF09\uFF1A${piece}`);
4828
+ }
4829
+ if (seen.has(id)) continue;
4830
+ seen.add(id);
4831
+ out.push(id);
4832
+ }
4833
+ return out;
4834
+ }
4835
+ var ENTITY_ID_UUID_RE;
4836
+ var init_media_customer_id = __esm({
4837
+ "src/utils/media-customer-id.ts"() {
4838
+ "use strict";
4839
+ ENTITY_ID_UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
4840
+ }
4841
+ });
4842
+
4843
4843
  // src/utils/media-account-batch.ts
4844
4844
  function mediaAccountDataBatchSize(media) {
4845
4845
  switch (media) {
@@ -105715,6 +105715,12 @@ var VALID_MEDIA_TYPES = [
105715
105715
  "BingV2",
105716
105716
  "Kwai"
105717
105717
  ];
105718
+ function applyListAccountsSearchKeyword(params, keyword) {
105719
+ const kw = (keyword ?? "").trim();
105720
+ if (kw) {
105721
+ params.set("keyword", kw);
105722
+ }
105723
+ }
105718
105724
  var PLATFORM_CONFIG = {
105719
105725
  Google: {
105720
105726
  path: "/query/media-account/",
@@ -105936,6 +105942,8 @@ var COL_GOOGLE = [
105936
105942
  { key: "arit", header: "Arit" },
105937
105943
  { key: "platformStatus", header: "\u8D26\u6237\u72B6\u6001" },
105938
105944
  { key: "authStatus", header: "\u6388\u6743\u72B6\u6001" },
105945
+ /** 对应 JSON `ma.scopeActivatedSources`(有未过期记录=已激活) */
105946
+ { key: "packageStatus", header: "\u5957\u9910\u6FC0\u6D3B" },
105939
105947
  { key: "createdAt", header: "\u6388\u6743/\u5F00\u6237\u65F6\u95F4" },
105940
105948
  { key: "shared", header: "\u5206\u4EAB" }
105941
105949
  ];
@@ -105976,6 +105984,18 @@ function formatMetaAuthType(mediaAccountType) {
105976
105984
  function formatOAuthAuthStatus(ma) {
105977
105985
  return ma.invalidOAuthToken ? "\u26A0\uFE0F \u5931\u6548" : "\u2705 \u6B63\u5E38";
105978
105986
  }
105987
+ function formatScopeActivatedStatus(ma, nowMs = Date.now()) {
105988
+ const sources = ma.scopeActivatedSources;
105989
+ if (!Array.isArray(sources) || sources.length === 0) {
105990
+ return "\u672A\u6FC0\u6D3B";
105991
+ }
105992
+ const hasActive = sources.some((s) => {
105993
+ if (!s?.expireAt) return true;
105994
+ const exp = Date.parse(s.expireAt);
105995
+ return Number.isNaN(exp) || exp > nowMs;
105996
+ });
105997
+ return hasActive ? "\u2705 \u5DF2\u6FC0\u6D3B" : "\u672A\u6FC0\u6D3B";
105998
+ }
105979
105999
  function formatMetaAuditStatus(ma) {
105980
106000
  const ms = ma.mediaAccountState ?? "";
105981
106001
  if (ms !== "Approved" && ms !== "Linked") {
@@ -106113,6 +106133,7 @@ function printGoogleTable(items2, tableOpts) {
106113
106133
  arit: String(ma.aritScore ?? "-"),
106114
106134
  platformStatus,
106115
106135
  authStatus: formatOAuthAuthStatus(ma),
106136
+ packageStatus: formatScopeActivatedStatus(ma),
106116
106137
  createdAt: fmtDate(ma.createdDateTime),
106117
106138
  shared: sharedCount
106118
106139
  };
@@ -106173,7 +106194,6 @@ function wrapListJson(params) {
106173
106194
  }
106174
106195
 
106175
106196
  // src/commands/list-accounts/main.ts
106176
- init_media_customer_id();
106177
106197
  async function runListAccounts(opts) {
106178
106198
  let config = loadConfig(opts.token);
106179
106199
  if (opts.refreshDp) {
@@ -106203,14 +106223,7 @@ async function runListAccounts(opts) {
106203
106223
  if (platformCfg.responseType === "array" && opts.status && opts.status !== "all") {
106204
106224
  params.set("status", opts.status);
106205
106225
  }
106206
- if (opts.keyword) {
106207
- const numericId = normalizeNumericMediaCustomerId(opts.keyword);
106208
- if (numericId) {
106209
- params.set(platformCfg.idSearchParam, numericId);
106210
- } else {
106211
- params.set("mediaCustomerName", opts.keyword.trim());
106212
- }
106213
- }
106226
+ applyListAccountsSearchKeyword(params, opts.keyword);
106214
106227
  const url = `${config.apiBaseUrl}${platformCfg.path}?${params}`;
106215
106228
  if (platformCfg.responseType === "array") {
106216
106229
  try {
@@ -106244,9 +106257,7 @@ async function runListAccounts(opts) {
106244
106257
  }
106245
106258
  } else {
106246
106259
  const params = new URLSearchParams();
106247
- if (opts.keyword) {
106248
- params.set("keyword", normalizeNumericMediaCustomerId(opts.keyword) ?? opts.keyword.trim());
106249
- }
106260
+ applyListAccountsSearchKeyword(params, opts.keyword);
106250
106261
  if (opts.status && opts.status !== "all") params.set("status", opts.status);
106251
106262
  params.set("pageNo", String(page));
106252
106263
  params.set("pageSize", String(pageSize));
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "slug": "siluzan-tso",
3
- "version": "1.1.41",
4
- "publishedAt": 1785727642749
3
+ "version": "1.1.42-beta.2",
4
+ "publishedAt": 1785748063884
5
5
  }
@@ -177,8 +177,9 @@ siluzan-tso stats -m <媒体类型> [选项]
177
177
 
178
178
  1. 用户若已给出账户号(如 Yandex `porg-kqquuxx6`),`-a` **必须原样用该 mediaCustomerId**;先 `list-accounts -m <媒体> -k <mediaCustomerId>` 核验存在即可。
179
179
  2. **禁止**把 `ma.entityId`、`externalMediaAccountTokenId` 或会话里其它 UUID 传给 `-a`(会空结果,verbose 常打出被吞的 `HTTP 403`,**不等于** OAuth 过期)。
180
- 3. 仅当 `list-accounts` 显示 `invalidOAuthToken=true`(或授权状态列为失效),且用户确认后,才走 `account reauth --id <entityId> --i-confirm --commit "…"`(见 `accounts-permissions.md`)。
181
- 4. `list-accounts` 显示 `Linked` + `hasToken:1` + `invalidOAuthToken:false` 时,**禁止**因 stats 空结果自行 `reauth`/解绑。
180
+ 3. Google:若 `list-accounts` 显示套餐**未激活**(`scopeActivatedSources` 为空),`balance` 等可能无数据——向用户说明需先激活套餐;**禁止**用非 CLI / 自拼请求等方式绕过。
181
+ 4. 仅当 `list-accounts` 显示 `invalidOAuthToken=true`(或授权状态列为失效),且用户确认后,才走 `account reauth --id <entityId> --i-confirm --commit "…"`(见 `accounts-permissions.md`)。
182
+ 5. `list-accounts` 显示 `Linked` + `hasToken:1` + `invalidOAuthToken=false` 且套餐已激活时,**禁止**因 stats/balance 空结果自行 `reauth`/解绑。
182
183
 
183
184
  **示例:**
184
185
 
@@ -17,7 +17,7 @@ siluzan-tso list-accounts [选项]
17
17
  | 选项 | 说明 |
18
18
  | ----------------------- | -------------------------------------------------------------------------------- | ---------------------- |
19
19
  | `-m, --media <type>` | 媒体类型(留空查全部):`Google \| TikTok \| Yandex \| MetaAd \| BingV2 \| Kwai` |
20
- | `-k, --keyword <text>` | 按账户名称或 ID 搜索 |
20
+ | `-k, --keyword <text>` | 统一模糊搜索:账户名称 **或** ID(含 Google CID 带横杠);透传 Sammamish `keyword` |
21
21
  | `-s, --status <status>` | 账户状态:`normal \| invalid \| all`(默认 all) |
22
22
  | `-p, --page <n>` | 页码(默认 1) |
23
23
  | `--page-size <n>` | 每页数量(默认 20) |
@@ -81,9 +81,12 @@ siluzan-tso list-accounts -m Google --page 2 --page-size 999 --json-out ./snap-p
81
81
  | `ma.mediaCustomerName` | 账户名称(表格「账户名称」) |
82
82
  | `ma.mediaAccountState` 等 | 平台开户/审核态(如 Approved / Linked);**不是** OAuth 是否可用 |
83
83
  | **`ma.invalidOAuthToken`** | **OAuth 是否失效**:`true`=失效,`false`=正常。**表格必有「授权状态」列**(✅ 正常 / ⚠️ 失效),与此字段一一对应;判失效、筛 `-s invalid`、走 `reauth` 均看它 |
84
+ | **`ma.scopeActivatedSources`** | **套餐是否已购买/激活**:非空且存在未过期条目(看 `expireAt`)= 已激活;空数组或全部过期 = 未激活。**Google 表格有「套餐激活」列**(✅ 已激活 / 未激活)。未激活时部分读接口(如 `balance`)可能无数据,引导用户先激活套餐;**勿**尝试非 CLI 途径取数 |
84
85
  | `ma.TTADInfo.status` 等 | 媒体侧投放/审核细态(TikTok 表格「审核状态」等);**勿**当成 OAuth 授权状态 |
85
86
 
86
87
  > **Agent**:用户问「哪些授权失效 / OAuth 状态」时,读盘看 `items[].ma.invalidOAuthToken`,表格看「授权状态」列;**不要**用 `mediaAccountState` 或审核状态列代替。
88
+ > 用户问「哪些买了套餐 / 是否激活套餐」时,读盘看 `items[].ma.scopeActivatedSources`,Google 表格看「套餐激活」列;**不要**用 `mediaAccountState` 或授权状态代替。
89
+ > **Google 单户**:若套餐**已激活**,可用 `account check-access -a <mediaCustomerId>` 再确认网关侧授权是否可用(`reauth_required` / `no_permission` 等);**未激活时不要用 check-access 判断授权过期**(仍可能 `accessible`)。见 `accounts-permissions.md` § check-access。
87
90
 
88
91
  ---
89
92
 
@@ -164,7 +167,7 @@ siluzan-tso account-history --start 2026-03-01 --end 2026-03-31 --json-out ./sna
164
167
  | 状态 | 含义 | 下一步操作 |
165
168
  | ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
166
169
  | `Pending` | 审核中 | 等待,可反复运行此命令轮询;审核周期因媒体而异 |
167
- | `Approved` | 审核通过 | 运行 `list-accounts -m <媒体>` 确认账户已出现;引导用户充值激活(`config show` 取 `webUrl`,按 `finance.md` 打开对应媒体充值页;例如 Google 为 `https://www.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google`;Kwai、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`;Kwai、Yandex 当前没有对应充值界面) |
168
171
  | `Rejected` | 被拒 | 查看 `--json-out` 落盘中的 `reason` 字段了解拒绝原因;修改资料后重新提交;若原因不明,引导用户联系丝路赞客服 |
169
172
 
170
173
  ---
@@ -33,9 +33,23 @@ siluzan-tso account me --check-phone 15130150466 --json-out ./snap-me
33
33
 
34
34
  ### check-access — Google 账户访问权限校验
35
35
 
36
- 校验当前丝路赞凭据是否对指定 **Google** 广告账户有访问权限**403 通常表示该 Google 账户不在当前丝路赞账号下**(或未分享给你),应在拉数/诊断前调用,避免误用他户 ID。
36
+ 校验当前丝路赞凭据是否对指定 **Google** 广告账户有访问权限。应在拉数/诊断前调用,避免误用他户 ID。
37
+
38
+ **前提(查授权是否过期时)**:须先确认该户 **套餐已激活**(`list-accounts` 的 `ma.scopeActivatedSources` 有未过期条目,或 Google 表格「套餐激活」= ✅ 已激活)。在已激活前提下,可用本命令检查授权是否可用:
39
+
40
+ | 结果 | 含义(套餐已激活时) |
41
+ | ---- | -------------------- |
42
+ | `accessible`(200 / `true`) | 授权可用,可继续拉数/操作 |
43
+ | `reauth_required`(200 / `false`) | 已绑定但 Google OAuth 不可用 → 走重授权 |
44
+ | `no_permission`(403 / 账户 ID) | 网关不可访问;可与 `list-accounts` 的 `invalidOAuthToken` 交叉确认是否授权失效或不在本账号下 |
45
+
46
+ **未激活套餐时不要用本命令判断授权过期**:未激活户仍可能返回 `accessible`,无法据此下结论。套餐状态见 `accounts-list.md` 的 `scopeActivatedSources`。
37
47
 
38
48
  ```bash
49
+ # 1) 先确认套餐已激活
50
+ siluzan-tso list-accounts -m Google -k <mediaCustomerId> --json-out ./snap
51
+
52
+ # 2) 已激活后再查网关访问 / 授权是否可用
39
53
  siluzan-tso account check-access -a <mediaCustomerId>
40
54
  siluzan-tso account check-access -a 4256317784 --json-out ./snap-access
41
55
  ```
@@ -44,11 +58,11 @@ siluzan-tso account check-access -a 4256317784 --json-out ./snap-access
44
58
  | ---- | --------------- | ---------------------------- | --------------------------------------------- |
45
59
  | 200 | `true` | 可访问 | `accessible`(exit 0) |
46
60
  | 200 | `false` | 已绑定但 Google OAuth 不可用 | `reauth_required` → Agent 优先 `present_reauth`;备选 `account reauth` |
47
- | 403 | 账户 ID | 无权限(多不在本账号下) | `no_permission`(exit 1) |
61
+ | 403 | 账户 ID | 无权限(多不在本账号下;授权失效时也可能出现) | `no_permission`(exit 1) |
48
62
  | 403 | `token不能为空` | 未绑定 Google 媒体 | `google_not_bound` → Agent 优先平台授权;备选 `account auth -m Google` |
49
63
  | 401 | 空 | 丝路赞 Token 失效 | `siluzan_token_invalid` → 重新 login |
50
64
 
51
- > 与 `list-accounts -k` 互补:`list-accounts` 查「是否出现在账户列表」;本接口查「Google 网关是否允许当前凭据访问该 mediaCustomerId」。
65
+ > 与 `list-accounts -k` 互补:`list-accounts` 查「是否在列表 / 套餐是否激活 / `invalidOAuthToken`」;本接口查「Google 网关是否允许当前凭据访问该 mediaCustomerId」。列表批量筛失效仍优先看 `invalidOAuthToken`;单户深查在**已激活**后用本命令。
52
66
 
53
67
  ---
54
68
 
@@ -472,7 +486,7 @@ siluzan-tso account email-deauth -c <mediaCustomerId> --invitation-id <id> --res
472
486
 
473
487
  | 功能 | 媒体 | 网页路径 |
474
488
  | --------------------------------------- | ------ | ------------------------------------------------- |
475
- | **账户激活**(邀请他人激活 / 充值激活) | Google | `https://www.siluzan.com/v3/foreign_trade/tso/manageAccounts` |
489
+ | **账户激活**(邀请他人激活 / 充值激活) | Google | `https://www-ci.siluzan.com/v3/foreign_trade/tso/manageAccounts` |
476
490
 
477
491
  **Agent 建议话术**:
478
492
 
@@ -481,5 +495,5 @@ siluzan-tso account email-deauth -c <mediaCustomerId> --invitation-id <id> --res
481
495
  siluzan-tso config show # 查看 webUrl 字段
482
496
 
483
497
  # 账户激活(Google)→ 引导至账户管理页
484
- # https://www.siluzan.com/v3/foreign_trade/tso/manageAccounts
498
+ # https://www-ci.siluzan.com/v3/foreign_trade/tso/manageAccounts
485
499
  ```
@@ -127,7 +127,7 @@ siluzan-tso config show
127
127
 
128
128
  ### 充值页链接(按媒体 × 类型)
129
129
 
130
- 链接模式:`https://www.siluzan.com/v3/foreign_trade/tso/recharge/<page>?mediaType=<mediaType>`;丝路赞钱包:`https://www.siluzan.com/v3/foreign_trade/tso/recharge/siluzanWallet`(无媒体参数)。
130
+ 链接模式:`https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/<page>?mediaType=<mediaType>`;丝路赞钱包:`https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/siluzanWallet`(无媒体参数)。
131
131
 
132
132
  | 充值类型 | `<page>` | 支持媒体(`mediaType` 参数) |
133
133
  | ------------------------- | --------------------- | ------------------------------------------- |
@@ -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
 
@@ -63,7 +63,7 @@ siluzan-tso open-account google-wizard
63
63
 
64
64
  ```bash
65
65
  siluzan-tso account-history -m Google
66
- # 审核通过后:config show → https://www.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google
66
+ # 审核通过后:config show → https://www-ci.siluzan.com/v3/foreign_trade/tso/recharge/pay?mediaType=Google
67
67
  ```
68
68
 
69
69
  ---
@@ -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
  ```
@@ -126,7 +126,8 @@
126
126
 
127
127
  - **账户状态 ≠ 系列状态**:`stats` / `balance` / `list-accounts` 的 `status` 只表示账户是否可用;系列状态必须来自 `ad campaigns`。
128
128
  - **数据时效性**:涉及「今天/当天/今日消耗」「实时消耗排行」前,必读 `references/analytics/account-analytics.md` 顶部「数据时效性」表。TikTok / Yandex / BingV2 / Kwai 是 `accountsoverview` 同步昨天数据,**不能查今天**。
129
- - **先查账户再操作**(拉数 / 改账户 / 报告 / **创建广告**):`list-accounts -m [mediaType] -k [mediaCustomerId]`;用户给出的 `mediaCustomerId` 必须 `-k` 核验,无结果则告知用户并停止,**禁止**翻页 grep 自行换 ID(会导致报告错户);拉数、脚本、报告文件名全链路用同一 ID(以 stdout `accountId` 为准)。**Google 额外建议**:`list-accounts` 命中后、拉数前可 `account check-access -a <mediaCustomerId>` 校验 Google 网关访问权限;`no_permission`(403)通常表示账户不在当前丝路赞账号下。
129
+ - **先查账户再操作**(拉数 / 改账户 / 报告 / **创建广告**):`list-accounts -m [mediaType] -k [mediaCustomerId]`;用户给出的 `mediaCustomerId` 必须 `-k` 核验,无结果则告知用户并停止,**禁止**翻页 grep 自行换 ID(会导致报告错户);拉数、脚本、报告文件名全链路用同一 ID(以 stdout `accountId` 为准)。**Google 额外建议**:`list-accounts` 命中后,若 `scopeActivatedSources` 显示套餐**已激活**,拉数前可用 `account check-access -a <mediaCustomerId>` 检查授权是否仍可用(`reauth_required` / `no_permission`);**未激活套餐时勿用 check-access 判断授权过期**。`no_permission`(403)也可能表示账户不在当前丝路赞账号下。详见 `accounts-permissions.md`。
130
+ - **一律走 CLI,禁止自拼网关请求**:查余额 / 拉数 / 写操作只用 `siluzan-tso …`。**禁止**用 curl、自写脚本或改请求头直连 TSO/Google 网关「另辟蹊径」取数;`balance` 等无数据时按 CLI/`list-accounts` 字段向用户说明(如套餐未激活、授权失效),**禁止**尝试任何绕过平台门禁的取数方式。
130
131
  - **W3 仅出方案例外(覆盖上条)**:用户只要「投放方案 / 规划 / 表格 / 先别创建·开户·投钱」,或未给账户且未要求创建/发布时——**禁止**把「请先提供 Google 广告账户」当作第一步;按 `google-ads-campaign-plan.md` §「仅出方案 vs 创建」交付 JSON+Markdown(`account`=`[PENDING_ACCOUNT]`),跳过 `list-accounts` / `geo resolve` / `campaign-validate` / `campaign-create`。用户确认要创建后再要账户并续跑创建流水线。
131
132
  - **不猜测账户 ID**:`entityId`(UUID,仅 delink/share/reauth/账单)≠ `mediaCustomerId`(`stats`/`balance`/`accounts-digest`/`ad` 的 `-a`)。两者均来自 `list-accounts` 的 `ma.*`。用户已给出媒体账户号时(Google 数字 CID、**Yandex `porg-…`**、Meta `act_…` 等)→ `-a` **原样使用**,再用 `-k` 核验;**禁止**改成 `entityId` / tokenId / 会话里其它 UUID。**禁止**把 `entityId` 传给 `stats -a` / `balance -a` / `accounts-digest -a`。
132
133
  - **媒体类型区分大小写**:`Google`、`TikTok`、`Yandex`、`MetaAd`、`BingV2`、`Kwai`。
@@ -257,7 +258,7 @@
257
258
 
258
259
  - **400**:参数错误,查看对应 reference 或 `-h`
259
260
  - **401 / OAuth 失效**:仅当 `list-accounts` 的 `invalidOAuthToken=true`(或表格「授权状态」为失效)且用户确认后——Siluzan Agent **优先**用平台重新授权工具(如 `present_reauth`);备选 `account reauth -m <媒体> --id <entityId> --i-confirm --commit "…"`(内置 delink→OAuth,见 W9 / `accounts-permissions.md`)。走 CLI 时**必须把完整授权 URL 贴给用户**,禁止只说「链接已生成」。解绑后若列表已无该户,恢复用平台授权工具或 `account auth -m <媒体>`。**丝路赞登录凭据失效** → `send-login-code` + `login --phone --code`,见 `references/core/setup.md`
260
- - **403(拉数空结果)**:`stats`/`balance`/`accounts-digest` 在 `--verbose` 下打出 `[fetchOverviewMap] 异常被吞:HTTP 403` `items=[]` 时,**优先怀疑 `-a` 传错 ID**(把 `entityId`/tokenId/UUID 当成了 mediaCustomerId;Yandex 正确形如 `porg-…`)。处理:`list-accounts -m <媒体> -k <用户给出的账户号>`,用返回的 `ma.mediaCustomerId` 重试。**禁止**把此类 403 直接当成 OAuth 过期并自行 `reauth`(账户仍显示 `Linked` + `invalidOAuthToken=false` 时尤其禁止解绑)。
261
+ - **403(拉数空结果)**:`stats`/`balance`/`accounts-digest` 在 `--verbose` 下打出异常被吞的 `HTTP 403` 且无数据时:① **优先核验 `-a` 是否为 `ma.mediaCustomerId`**(勿传 `entityId`/UUID;Yandex 形如 `porg-…`);② Google 再看套餐是否激活(`scopeActivatedSources`),未激活则说明需先激活,**禁止**非 CLI 绕过取数;③ **禁止**在 `invalidOAuthToken=false` 时把 403 当成 OAuth 过期并自行 `reauth`。
261
262
  - **500**:服务可能正在部署/升级,建议反馈 Siluzan 相关人员
262
263
 
263
264
  ---
@@ -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
  ---
@@ -63,7 +63,7 @@ siluzan-tso config set --api-key <Key> # 或 config 直接写入
63
63
  siluzan-tso config set --token <Token> # 备用:设置 JWT Token
64
64
  ```
65
65
 
66
- API Key 获取入口:`https://www.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
66
+ API Key 获取入口:`https://www-ci.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
67
67
 
68
68
  ```bash
69
69
  # 第 1 步:让用户报出手机号后,立刻发码(命令立即返回,不会等待输入)
@@ -126,9 +126,9 @@ siluzan-tso config show
126
126
 
127
127
  ```
128
128
  构建环境 : production
129
- apiBaseUrl : https://tso-api.siluzan.com
130
- googleApiUrl : https://googleapi.mysiluzan.com
131
- webUrl : https://www.siluzan.com
129
+ apiBaseUrl : https://tso-api-ci.siluzan.com
130
+ googleApiUrl : https://googleapi-ci.mysiluzan.com
131
+ webUrl : https://www-ci.siluzan.com
132
132
  apiKey : abcd****1234
133
133
  ```
134
134
 
@@ -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
 
@@ -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.41'
12
+ $PKG_VERSION = '1.1.42-beta.2'
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.41"
12
+ readonly PKG_VERSION="1.1.42-beta.2"
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siluzan-tso-cli",
3
- "version": "1.1.41",
3
+ "version": "1.1.42-beta.2",
4
4
  "description": "Siluzan 广告账户管理 CLI — 查询账户、余额、消耗数据,管理绑定关系与充值。",
5
5
  "keywords": [
6
6
  "ad-account",