siluzan-tso-cli 1.1.53 → 1.1.54-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 +2 -1
- package/dist/index.js +83 -34
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/references/accounts/accounts-list.md +3 -2
- package/dist/skill/references/accounts/accounts-permissions.md +2 -2
- package/dist/skill/references/accounts/finance.md +1 -1
- package/dist/skill/references/accounts/open-account-by-media.md +1 -1
- package/dist/skill/references/accounts/open-account-google-ui.md +1 -1
- package/dist/skill/references/analytics/rag.md +1 -1
- package/dist/skill/references/analytics/reporting.md +5 -5
- package/dist/skill/references/core/setup.md +5 -5
- package/dist/skill/references/google-ads/google-ads-write.md +1 -1
- package/dist/skill/references/misc/tso-home.md +2 -2
- package/dist/skill/scripts/install.ps1 +3 -3
- package/dist/skill/scripts/install.sh +3 -3
- package/package.json +1 -1
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.54-beta.2),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-tso-cli`。
|
|
54
55
|
|
|
55
56
|
| 助手 | 建议 `--ai` |
|
|
56
57
|
| ----------------------- | ------------------------------------ |
|
package/dist/index.js
CHANGED
|
@@ -3092,7 +3092,8 @@ async function emitCliJsonOrSnapshot(opts, params) {
|
|
|
3092
3092
|
commandHint: params.commandHint,
|
|
3093
3093
|
idSuffix: params.idSuffix
|
|
3094
3094
|
});
|
|
3095
|
-
|
|
3095
|
+
const line = params.summaryExtras ? { ...summary, ...params.summaryExtras } : summary;
|
|
3096
|
+
console.log(JSON.stringify(line));
|
|
3096
3097
|
return true;
|
|
3097
3098
|
}
|
|
3098
3099
|
return false;
|
|
@@ -4026,7 +4027,7 @@ var DEFAULT_API_BASE;
|
|
|
4026
4027
|
var init_defaults = __esm({
|
|
4027
4028
|
"src/config/defaults.ts"() {
|
|
4028
4029
|
"use strict";
|
|
4029
|
-
DEFAULT_API_BASE = "https://tso-api.siluzan.com";
|
|
4030
|
+
DEFAULT_API_BASE = "https://tso-api-ci.siluzan.com";
|
|
4030
4031
|
}
|
|
4031
4032
|
});
|
|
4032
4033
|
|
|
@@ -4398,6 +4399,16 @@ var init_fetch_wrapper = __esm({
|
|
|
4398
4399
|
});
|
|
4399
4400
|
|
|
4400
4401
|
// src/utils/auth.ts
|
|
4402
|
+
function requireWhitelistedBase(label, raw) {
|
|
4403
|
+
const trimmed = raw.trim().replace(/\/$/, "");
|
|
4404
|
+
const err = validateBaseUrl(trimmed);
|
|
4405
|
+
if (err) {
|
|
4406
|
+
console.error(`
|
|
4407
|
+
\u274C ${label} \u4E0D\u5408\u6CD5\uFF1A${err}`);
|
|
4408
|
+
process.exit(1);
|
|
4409
|
+
}
|
|
4410
|
+
return trimmed;
|
|
4411
|
+
}
|
|
4401
4412
|
function loadConfig(tokenArg) {
|
|
4402
4413
|
const shared = readSharedConfig();
|
|
4403
4414
|
const { authToken, apiKey } = resolveSiluzanCredentials({
|
|
@@ -4408,27 +4419,18 @@ function loadConfig(tokenArg) {
|
|
|
4408
4419
|
if (!apiKey && !authToken) {
|
|
4409
4420
|
printAuthMissingHelp("siluzan-tso");
|
|
4410
4421
|
}
|
|
4411
|
-
const apiBaseUrl =
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
const
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
process.exit(1);
|
|
4424
|
-
}
|
|
4425
|
-
const csoBaseUrl = process.env.SILUZAN_CSO_BASE ?? deriveCsoApiBaseUrl(apiBaseUrl);
|
|
4426
|
-
const csoErr = validateBaseUrl(csoBaseUrl);
|
|
4427
|
-
if (csoErr) {
|
|
4428
|
-
console.error(`
|
|
4429
|
-
\u274C csoBaseUrl \u4E0D\u5408\u6CD5\uFF1A${csoErr}`);
|
|
4430
|
-
process.exit(1);
|
|
4431
|
-
}
|
|
4422
|
+
const apiBaseUrl = requireWhitelistedBase(
|
|
4423
|
+
"tsoApiBaseUrl",
|
|
4424
|
+
process.env.SILUZAN_TSO_API_BASE ?? DEFAULT_API_BASE
|
|
4425
|
+
);
|
|
4426
|
+
const googleApiUrl = requireWhitelistedBase(
|
|
4427
|
+
"googleApiUrl",
|
|
4428
|
+
process.env.SILUZAN_GOOGLE_API ?? deriveGoogleApiUrl(apiBaseUrl)
|
|
4429
|
+
);
|
|
4430
|
+
const csoBaseUrl = requireWhitelistedBase(
|
|
4431
|
+
"csoBaseUrl",
|
|
4432
|
+
process.env.SILUZAN_CSO_BASE ?? deriveCsoApiBaseUrl(apiBaseUrl)
|
|
4433
|
+
);
|
|
4432
4434
|
return {
|
|
4433
4435
|
apiBaseUrl,
|
|
4434
4436
|
authToken,
|
|
@@ -4437,9 +4439,15 @@ function loadConfig(tokenArg) {
|
|
|
4437
4439
|
mainApiUrl: deriveMainApiUrl(apiBaseUrl),
|
|
4438
4440
|
tiktokApiUrl: deriveTiktokApiUrl(apiBaseUrl),
|
|
4439
4441
|
facebookApiUrl: deriveFacebookApiUrl(apiBaseUrl),
|
|
4440
|
-
yandexApiUrl:
|
|
4442
|
+
yandexApiUrl: requireWhitelistedBase(
|
|
4443
|
+
"yandexApiUrl",
|
|
4444
|
+
process.env.SILUZAN_YANDEX_API ?? deriveYandexApiUrl(apiBaseUrl)
|
|
4445
|
+
),
|
|
4441
4446
|
chatGptApiUrl: deriveChatGptApiUrl(apiBaseUrl),
|
|
4442
|
-
youtubeApiUrl:
|
|
4447
|
+
youtubeApiUrl: requireWhitelistedBase(
|
|
4448
|
+
"youtubeApiUrl",
|
|
4449
|
+
process.env.SILUZAN_YOUTUBE_API ?? deriveYouTubeApiUrl(apiBaseUrl)
|
|
4450
|
+
),
|
|
4443
4451
|
csoBaseUrl,
|
|
4444
4452
|
dataPermission: process.env.SILUZAN_DATA_PERMISSION ?? shared.dataPermission
|
|
4445
4453
|
};
|
|
@@ -106032,6 +106040,13 @@ import { Command as Command6 } from "commander";
|
|
|
106032
106040
|
|
|
106033
106041
|
// src/commands/login/urls.ts
|
|
106034
106042
|
init_defaults();
|
|
106043
|
+
init_auth();
|
|
106044
|
+
function requireTsoApiBase() {
|
|
106045
|
+
return requireWhitelistedBase(
|
|
106046
|
+
"tsoApiBaseUrl",
|
|
106047
|
+
process.env.SILUZAN_TSO_API_BASE ?? DEFAULT_API_BASE
|
|
106048
|
+
);
|
|
106049
|
+
}
|
|
106035
106050
|
function deriveWebBaseUrl(tsoApiBase) {
|
|
106036
106051
|
try {
|
|
106037
106052
|
const u = new URL(tsoApiBase);
|
|
@@ -106045,7 +106060,6 @@ var WEB_BASE_URL = deriveWebBaseUrl(DEFAULT_API_BASE);
|
|
|
106045
106060
|
var API_KEY_MANAGEMENT_URL = `${WEB_BASE_URL}/v3/foreign_trade/settings/apiKeyManagement`;
|
|
106046
106061
|
|
|
106047
106062
|
// src/commands/login/send-code.ts
|
|
106048
|
-
init_defaults();
|
|
106049
106063
|
init_dist();
|
|
106050
106064
|
|
|
106051
106065
|
// src/commands/login/helpers.ts
|
|
@@ -106138,7 +106152,7 @@ function normalizeBearerTokenInput(raw) {
|
|
|
106138
106152
|
async function runSendLoginCode(opts) {
|
|
106139
106153
|
if (skipAuthSetupInAgentEnv("siluzan-tso send-login-code")) return;
|
|
106140
106154
|
const phone = validateAndNormalizePhone(opts.phone);
|
|
106141
|
-
const tsoApiBase =
|
|
106155
|
+
const tsoApiBase = requireTsoApiBase();
|
|
106142
106156
|
const ssoBaseUrl = deriveSsoBaseUrl(tsoApiBase);
|
|
106143
106157
|
console.log("\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550");
|
|
106144
106158
|
console.log(" Siluzan \u53D1\u9001\u767B\u5F55\u77ED\u4FE1\u9A8C\u8BC1\u7801");
|
|
@@ -106162,7 +106176,6 @@ async function runSendLoginCode(opts) {
|
|
|
106162
106176
|
}
|
|
106163
106177
|
|
|
106164
106178
|
// src/commands/login/phone-flow.ts
|
|
106165
|
-
init_defaults();
|
|
106166
106179
|
init_dist();
|
|
106167
106180
|
async function executePhoneLoginWithVerifiedCode(phone, code, opts) {
|
|
106168
106181
|
let allowedServices;
|
|
@@ -106178,7 +106191,7 @@ async function executePhoneLoginWithVerifiedCode(phone, code, opts) {
|
|
|
106178
106191
|
if (opts.validDays !== void 0 && opts.expiresAt !== void 0) {
|
|
106179
106192
|
console.warn("\u26A0\uFE0F --valid-days \u4E0E --expires-at \u540C\u65F6\u4F20\u5165\uFF0C\u5C06\u4EE5 --expires-at \u4E3A\u51C6\u3002");
|
|
106180
106193
|
}
|
|
106181
|
-
const tsoApiBase =
|
|
106194
|
+
const tsoApiBase = requireTsoApiBase();
|
|
106182
106195
|
const ssoBaseUrl = deriveSsoBaseUrl(tsoApiBase);
|
|
106183
106196
|
const csoBaseUrl = deriveCsoApiBaseUrl(tsoApiBase);
|
|
106184
106197
|
const apiKeyName = opts.name ?? defaultApiKeyName();
|
|
@@ -106186,7 +106199,6 @@ async function executePhoneLoginWithVerifiedCode(phone, code, opts) {
|
|
|
106186
106199
|
console.log(" Siluzan \u767B\u5F55\uFF08\u624B\u673A\u53F7 + \u77ED\u4FE1\u9A8C\u8BC1\u7801\uFF09");
|
|
106187
106200
|
console.log("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n");
|
|
106188
106201
|
console.log(` \u624B\u673A\u53F7 : ${phone}`);
|
|
106189
|
-
console.log(` \u9A8C\u8BC1\u7801 : ${code}`);
|
|
106190
106202
|
console.log(` \u670D\u52A1\u8303\u56F4 : ${allowedServices.join(", ")}`);
|
|
106191
106203
|
if (opts.expiresAt) {
|
|
106192
106204
|
console.log(` \u8FC7\u671F\u65F6\u95F4 : ${opts.expiresAt}`);
|
|
@@ -106265,7 +106277,6 @@ async function runPhoneLogin(opts) {
|
|
|
106265
106277
|
}
|
|
106266
106278
|
|
|
106267
106279
|
// src/commands/login/interactive.ts
|
|
106268
|
-
init_defaults();
|
|
106269
106280
|
init_dist();
|
|
106270
106281
|
import * as readline from "readline";
|
|
106271
106282
|
async function runInteractiveJwtLogin() {
|
|
@@ -106376,7 +106387,7 @@ async function runInteractivePhoneLogin(menuOpts) {
|
|
|
106376
106387
|
try {
|
|
106377
106388
|
const phoneRaw = await prompt("\n\u8BF7\u8F93\u5165\u624B\u673A\u53F7\uFF08\u5927\u9646\u53F7\u7801\uFF0C\u53EF\u5E26 +86\uFF09\uFF1A");
|
|
106378
106389
|
const phone = validateAndNormalizePhone(phoneRaw);
|
|
106379
|
-
const tsoApiBase =
|
|
106390
|
+
const tsoApiBase = requireTsoApiBase();
|
|
106380
106391
|
const ssoBaseUrl = deriveSsoBaseUrl(tsoApiBase);
|
|
106381
106392
|
console.log("\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550");
|
|
106382
106393
|
console.log(" \u53D1\u9001\u767B\u5F55\u77ED\u4FE1\u9A8C\u8BC1\u7801");
|
|
@@ -107502,6 +107513,10 @@ function isScopeActivationBypassed(headers) {
|
|
|
107502
107513
|
const v = raw?.trim().toLowerCase();
|
|
107503
107514
|
return v === "1" || v === "true" || v === "yes";
|
|
107504
107515
|
}
|
|
107516
|
+
function scopeActivationBypassFields(bypassed) {
|
|
107517
|
+
if (!bypassed) return {};
|
|
107518
|
+
return { scopeActivationBypassed: true };
|
|
107519
|
+
}
|
|
107505
107520
|
function shouldExposeScopeActivatedSources(bypassed = false) {
|
|
107506
107521
|
if (bypassed) return false;
|
|
107507
107522
|
return resolveCompanySourceType() === "Ctaiad";
|
|
@@ -108098,6 +108113,7 @@ async function runListAccounts(opts) {
|
|
|
108098
108113
|
})();
|
|
108099
108114
|
const incompletePageWarning = total !== void 0 && items3.length < total ? "\u672C\u9875\u4E0D\u5B8C\u6574\uFF08itemCount < total\uFF09\u3002\u7981\u6B62\u636E\u6B64\u5224\u5B9A\u8D26\u6237\u672A\u7ED1\u5B9A\u6216\u672A\u6388\u6743\u3002\u7528\u6237\u7ED9\u4E86\u8D26\u6237\u53F7\u65F6\u5FC5\u987B list-accounts -m <\u5A92\u4F53> -k <\u7528\u6237\u539F\u6837ID>\uFF08Google CID \u5E26\u6A2A\u6760\u4E5F\u53EF\uFF0CCLI \u4F1A\u53BB\u8FDE\u5B57\u7B26\uFF09\u3002\u5217\u5168\u90E8\u987B --page-size 999\u3002" : null;
|
|
108100
108115
|
const combinedWarning = [oauthFailWarning, incompletePageWarning].filter(Boolean).join("\n") || null;
|
|
108116
|
+
const bypassFields = scopeActivationBypassFields(scopeActivationBypassed);
|
|
108101
108117
|
const listPayload = {
|
|
108102
108118
|
...wrapListJson({
|
|
108103
108119
|
page,
|
|
@@ -108105,6 +108121,7 @@ async function runListAccounts(opts) {
|
|
|
108105
108121
|
total: total ?? null,
|
|
108106
108122
|
items: items3
|
|
108107
108123
|
}),
|
|
108124
|
+
...bypassFields,
|
|
108108
108125
|
...combinedWarning ? { warning: combinedWarning } : {}
|
|
108109
108126
|
};
|
|
108110
108127
|
if (await emitCliJsonOrSnapshot(opts, {
|
|
@@ -108112,7 +108129,9 @@ async function runListAccounts(opts) {
|
|
|
108112
108129
|
commandLabel: "list-accounts",
|
|
108113
108130
|
commandHint: opts.media,
|
|
108114
108131
|
payload: listPayload,
|
|
108115
|
-
idSuffix: opts.media ?? "unknown"
|
|
108132
|
+
idSuffix: opts.media ?? "unknown",
|
|
108133
|
+
// 摘要里带同一标志。Agent 禁止把业务 JSON 贴进对话,只解析这一行 stdout。
|
|
108134
|
+
summaryExtras: bypassFields
|
|
108116
108135
|
})) {
|
|
108117
108136
|
return;
|
|
108118
108137
|
}
|
|
@@ -113758,6 +113777,24 @@ async function runAdKeywordDelete(opts) {
|
|
|
113758
113777
|
\u2705 \u5173\u952E\u8BCD ${opts.id} \u5DF2\u5220\u9664
|
|
113759
113778
|
`);
|
|
113760
113779
|
}
|
|
113780
|
+
function findKeywordEditMismatches(requested, returned, changed) {
|
|
113781
|
+
const mismatches = [];
|
|
113782
|
+
const str3 = (v) => typeof v === "string" ? v.trim() : "";
|
|
113783
|
+
if (changed.finalUrl !== void 0 && str3(returned["finalURL"]) !== str3(requested["finalURL"])) {
|
|
113784
|
+
mismatches.push(
|
|
113785
|
+
`finalURL\uFF1A\u671F\u671B ${str3(requested["finalURL"]) || "(\u7A7A)"}\uFF0C\u5B9E\u9645 ${str3(returned["finalURL"]) || "(\u7A7A)"}`
|
|
113786
|
+
);
|
|
113787
|
+
}
|
|
113788
|
+
if (changed.maxCpc !== void 0 && typeof returned["maxCPC"] === "number" && returned["maxCPC"] !== Number(requested["maxCPC"])) {
|
|
113789
|
+
mismatches.push(
|
|
113790
|
+
`maxCPC\uFF08\u5206\uFF09\uFF1A\u671F\u671B ${String(requested["maxCPC"])}\uFF0C\u5B9E\u9645 ${String(returned["maxCPC"])}`
|
|
113791
|
+
);
|
|
113792
|
+
}
|
|
113793
|
+
if (changed.status !== void 0 && typeof returned["userStatusV2"] === "string" && str3(returned["userStatusV2"]).toLowerCase() !== changed.status.toLowerCase()) {
|
|
113794
|
+
mismatches.push(`userStatusV2\uFF1A\u671F\u671B ${changed.status}\uFF0C\u5B9E\u9645 ${str3(returned["userStatusV2"])}`);
|
|
113795
|
+
}
|
|
113796
|
+
return mismatches;
|
|
113797
|
+
}
|
|
113761
113798
|
async function runAdKeywordEdit(opts) {
|
|
113762
113799
|
opts = withResolvedAdAccount(opts);
|
|
113763
113800
|
const config = await ensureDataPermission(loadConfig(opts.token));
|
|
@@ -113814,6 +113851,17 @@ async function runAdKeywordEdit(opts) {
|
|
|
113814
113851
|
`
|
|
113815
113852
|
);
|
|
113816
113853
|
}
|
|
113854
|
+
const mismatches = first ? findKeywordEditMismatches(body, first, opts) : [];
|
|
113855
|
+
if (mismatches.length > 0) {
|
|
113856
|
+
console.error(
|
|
113857
|
+
`
|
|
113858
|
+
\u274C \u7F51\u5173\u8FD4\u56DE\u6210\u529F\uFF0C\u4F46\u4EE5\u4E0B\u5B57\u6BB5\u672A\u751F\u6548\uFF1A
|
|
113859
|
+
${mismatches.map((m) => ` - ${m}`).join("\n")}
|
|
113860
|
+
\u8BF7\u52FF\u6539\u7528\u300C\u5220\u9664\u540E\u91CD\u5EFA\u300D\u7ED5\u8FC7\uFF08\u4F1A\u4E22\u5931\u5173\u952E\u8BCD id \u4E0E\u5386\u53F2\u6570\u636E\uFF09\uFF0C\u8BF7\u53CD\u9988\u5E73\u53F0\u6392\u67E5\u3002
|
|
113861
|
+
`
|
|
113862
|
+
);
|
|
113863
|
+
process.exit(1);
|
|
113864
|
+
}
|
|
113817
113865
|
} catch (err) {
|
|
113818
113866
|
console.error(`
|
|
113819
113867
|
\u274C \u7F16\u8F91\u5173\u952E\u8BCD\u5931\u8D25\uFF1A${err instanceof Error ? err.message : String(err)}
|
|
@@ -131215,9 +131263,10 @@ function attachLandingPageMeta(lighthouse, resolved) {
|
|
|
131215
131263
|
|
|
131216
131264
|
// src/commands/website-diagnosis/shared.ts
|
|
131217
131265
|
init_dist();
|
|
131266
|
+
init_auth();
|
|
131218
131267
|
function resolveAgentApiBase(tsoApiBaseUrl) {
|
|
131219
131268
|
const fromEnv = process.env.SILUZAN_AGENT_BASE?.trim();
|
|
131220
|
-
if (fromEnv) return
|
|
131269
|
+
if (fromEnv) return requireWhitelistedBase("SILUZAN_AGENT_BASE", fromEnv);
|
|
131221
131270
|
const base = tsoApiBaseUrl ?? "";
|
|
131222
131271
|
if (base.includes("-ci") || base.includes("ci.")) {
|
|
131223
131272
|
return "https://agent-ci.mysiluzan.com";
|
package/dist/skill/_meta.json
CHANGED
|
@@ -81,11 +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
|
+
| `scopeActivationBypassed`(可选,JSON 顶层,不在 `items` 里) | 只在命中时出现,值为 true:当前企业已跳过按户开通。继续取数或报表,不要调用 `present_activate`,也不要按户判断套餐。表格不加列、不加行。没有这个字段不等于未开通 |
|
|
84
85
|
| **`ma.scopeActivatedSources`**(可选) | **仅当本次 `list-accounts` 输出中出现该字段时才可读**:非空且存在未过期条目(看 `expireAt`)= 已激活;空数组或全部过期 = 未激活。出现时 Google 表格才有「套餐激活」列。**若 JSON/表格中无此字段/列:禁止向用户谈套餐是否激活,禁止臆造未激活/已激活** |
|
|
85
86
|
| `ma.TTADInfo.status` 等 | 媒体侧投放/审核细态(TikTok 表格「审核状态」等);**勿**当成 OAuth 授权状态 |
|
|
86
87
|
|
|
87
88
|
> **Agent**:用户问「哪些授权失效 / OAuth 状态」时,读盘看 `items[].ma.invalidOAuthToken`,表格看「授权状态」列;**不要**用 `mediaAccountState` 或审核状态列代替。
|
|
88
|
-
> 用户问「哪些买了套餐 /
|
|
89
|
+
> 用户问「哪些买了套餐 / 是否激活套餐」,或准备出激活卡时:先看 JSON 顶层 `scopeActivationBypassed`。值为 true 则该公司不用按户开通,继续原来的取数或报表,不要调用 `present_activate`。否则**仅当**输出含 `ma.scopeActivatedSources`(或 Google 表格有「套餐激活」列)才可据此回答;没有有效 CTAIAD 条目才是未开通。字段缺失时不要猜,直接取数;只有接口正文出现「未开通套餐」才出激活卡。单独一个「开通」是开户,不是激活卡。
|
|
89
90
|
> **Google 单户**:若输出中能确认套餐**已激活**,可用 `account check-access -a <mediaCustomerId>` 再确认网关侧授权是否可用;若输出无激活字段,仍可直接跑 `check-access`(以返回 `status` 为准),**不要**先编造「未激活」。见 `accounts-permissions.md` § check-access。
|
|
90
91
|
|
|
91
92
|
---
|
|
@@ -167,7 +168,7 @@ siluzan-tso account-history --start 2026-03-01 --end 2026-03-31 --json-out ./sna
|
|
|
167
168
|
| 状态 | 含义 | 下一步操作 |
|
|
168
169
|
| ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
169
170
|
| `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 当前没有对应充值界面) |
|
|
171
|
+
| `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
172
|
| `Rejected` | 被拒 | 查看 `--json-out` 落盘中的 `reason` 字段了解拒绝原因;修改资料后重新提交;若原因不明,引导用户联系丝路赞客服 |
|
|
172
173
|
|
|
173
174
|
---
|
|
@@ -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
|
---
|
|
@@ -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
|
```
|
|
@@ -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
|
|
|
@@ -324,7 +324,7 @@ siluzan-tso ad keyword-delete -a <accountId> --id <keywordId> --adgroup-id <adGr
|
|
|
324
324
|
|
|
325
325
|
## ad keyword-edit — 搜索关键词编辑
|
|
326
326
|
|
|
327
|
-
先用 `ad keywords --json-out ./snap`
|
|
327
|
+
先用 `ad keywords --json-out ./snap` 取完整对象,再提交修改。只改 `--final-url` / `--max-cpc` / `--status` 时原地更新,`id` 与历史数据保留;改 `--text` / `--match-type`(Google 侧词面与匹配类型不可变)会新建并删除旧词,`id` 变化时 CLI 会提示。若回执显示字段未生效,CLI 报错退出:**不要**自行改用 `keyword-delete` + `keyword-create` 重建(丢失 id 与历史数据),应反馈平台。
|
|
328
328
|
|
|
329
329
|
```bash
|
|
330
330
|
siluzan-tso ad keyword-edit \
|
|
@@ -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.
|
|
12
|
+
$PKG_VERSION = '1.1.54-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.
|
|
12
|
+
readonly PKG_VERSION="1.1.54-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
|