siluzan-tso-cli 1.0.0-beta.47 → 1.0.0-beta.48
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 +1 -1
- package/dist/index.js +11 -6
- package/dist/skill/SKILL.md +4 -2
- package/dist/skill/_meta.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ siluzan-tso init -d /path/to/skills # 写入自定义目录
|
|
|
20
20
|
siluzan-tso init --force # 强制覆盖已存在文件
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
> **注意**:当前为测试版(1.0.0-beta.
|
|
23
|
+
> **注意**:当前为测试版(1.0.0-beta.48),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-tso-cli`。
|
|
24
24
|
|
|
25
25
|
| 助手 | 建议 `--ai` |
|
|
26
26
|
|------|-------------|
|
package/dist/index.js
CHANGED
|
@@ -7468,13 +7468,13 @@ async function runAdGeoList(opts) {
|
|
|
7468
7468
|
const config = loadConfig(opts.token);
|
|
7469
7469
|
const googleApiUrl = requireGoogleApi(config);
|
|
7470
7470
|
let url;
|
|
7471
|
+
const params = new URLSearchParams();
|
|
7471
7472
|
if (opts.mode === "report") {
|
|
7472
|
-
const params = new URLSearchParams();
|
|
7473
|
-
params.set("startDate", toGoogleDate(opts.startDate, -30));
|
|
7474
|
-
params.set("endDate", toGoogleDate(opts.endDate, 0));
|
|
7475
7473
|
url = `${googleApiUrl}/geotargetmanagement/v2/list/${opts.account}?${params}`;
|
|
7476
7474
|
} else {
|
|
7477
|
-
|
|
7475
|
+
params.set("startDate", toGoogleDate(opts.startDate, -30));
|
|
7476
|
+
params.set("endDate", toGoogleDate(opts.endDate, 0));
|
|
7477
|
+
url = `${googleApiUrl}/campaignmanagement/v2/${opts.mode}locations/${opts.account}?${params}`;
|
|
7478
7478
|
}
|
|
7479
7479
|
let data;
|
|
7480
7480
|
try {
|
|
@@ -7486,7 +7486,11 @@ async function runAdGeoList(opts) {
|
|
|
7486
7486
|
process.exit(1);
|
|
7487
7487
|
}
|
|
7488
7488
|
const rawData = data.data;
|
|
7489
|
-
|
|
7489
|
+
let items = Array.isArray(rawData) ? rawData : rawData?.countries ?? [];
|
|
7490
|
+
if (opts.campaignId) {
|
|
7491
|
+
const targetId = opts.campaignId;
|
|
7492
|
+
items = items.filter((item) => String(item["campaignId"] ?? "") === targetId);
|
|
7493
|
+
}
|
|
7490
7494
|
const modeLabel = { targeted: "\u5DF2\u5B9A\u4F4D", excluded: "\u5DF2\u6392\u9664", report: "\u6D88\u8017\u62A5\u544A" }[opts.mode];
|
|
7491
7495
|
const n = items.length;
|
|
7492
7496
|
if (opts.json) {
|
|
@@ -11023,7 +11027,7 @@ geoCmd.command("search").description("\u641C\u7D22\u53EF\u7528\u7684\u5730\u7406
|
|
|
11023
11027
|
verbose: opts.verbose
|
|
11024
11028
|
});
|
|
11025
11029
|
});
|
|
11026
|
-
geoCmd.command("list").description("\u67E5\u8BE2\u5730\u7406\u4F4D\u7F6E\u5B9A\u5411\u5217\u8868\uFF08targeted = \u5DF2\u5B9A\u4F4D\uFF1Bexcluded = \u5DF2\u6392\u9664\uFF1Breport = \u6D88\u8017\u62A5\u544A\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--mode <mode>", "\u5217\u8868\u7C7B\u578B\uFF1Atargeted | excluded | report\uFF08\u9ED8\u8BA4 targeted\uFF09", "targeted").option("--
|
|
11030
|
+
geoCmd.command("list").description("\u67E5\u8BE2\u5730\u7406\u4F4D\u7F6E\u5B9A\u5411\u5217\u8868\uFF08targeted = \u5DF2\u5B9A\u4F4D\uFF1Bexcluded = \u5DF2\u6392\u9664\uFF1Breport = \u6D88\u8017\u62A5\u544A\uFF0C\u53EF\u9009\u6309\u5E7F\u544A\u7CFB\u5217\u8FC7\u6EE4\uFF09").requiredOption("-a, --account <id>", "Google \u8D26\u6237 mediaCustomerId").option("--mode <mode>", "\u5217\u8868\u7C7B\u578B\uFF1Atargeted | excluded | report\uFF08\u9ED8\u8BA4 targeted\uFF09", "targeted").option("--campaign-id <id>", "\u53EF\u9009\uFF1A\u6309\u5E7F\u544A\u7CFB\u5217 ID \u8FC7\u6EE4\u7ED3\u679C\uFF08\u6765\u81EA ad campaigns\uFF09").option("--start <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4 30 \u5929\u524D\uFF0C\u6240\u6709\u6A21\u5F0F\u751F\u6548\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u9ED8\u8BA4\u4ECA\u5929\uFF0C\u6240\u6709\u6A21\u5F0F\u751F\u6548\uFF09").option("-t, --token <token>", "Auth Token").option("--json", "JSON \u683C\u5F0F\u8F93\u51FA", false).option("--verbose", "\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(async (opts) => {
|
|
11027
11031
|
if (!["targeted", "excluded", "report"].includes(opts.mode)) {
|
|
11028
11032
|
console.error("\n\u274C --mode \u53EA\u63A5\u53D7 targeted | excluded | report\n");
|
|
11029
11033
|
process.exit(1);
|
|
@@ -11032,6 +11036,7 @@ geoCmd.command("list").description("\u67E5\u8BE2\u5730\u7406\u4F4D\u7F6E\u5B9A\u
|
|
|
11032
11036
|
token: opts.token,
|
|
11033
11037
|
account: opts.account,
|
|
11034
11038
|
mode: opts.mode,
|
|
11039
|
+
campaignId: opts.campaignId,
|
|
11035
11040
|
startDate: opts.start,
|
|
11036
11041
|
endDate: opts.end,
|
|
11037
11042
|
json: opts.json,
|
package/dist/skill/SKILL.md
CHANGED
|
@@ -21,6 +21,8 @@ description: >-
|
|
|
21
21
|
|
|
22
22
|
# Siluzan TSO Skill
|
|
23
23
|
|
|
24
|
+
在使用本skill输出的任何内容中,包括但不限于报告,计划,总结,严禁让用户执行本skill提供的命令行。(setup.md)中的命令除外
|
|
25
|
+
|
|
24
26
|
## 文档索引
|
|
25
27
|
实现用户要求时,请先阅读以下对应功能的文档
|
|
26
28
|
| 文档 | 内容 |
|
|
@@ -80,12 +82,12 @@ CLI 命令执行后可能在输出末尾出现以下两种标记,Agent 必须
|
|
|
80
82
|
- **使用 --json 处理数据**:需对返回数据做计算或筛选时,加 `--json`,再用 `node -e` 过滤提取(见 `references/tips.md`)。
|
|
81
83
|
- **不要猜测账户 ID**:`entityId` ≠ `mediaCustomerId`,两者均来自 `list-accounts`。
|
|
82
84
|
- **媒体类型区分大小写**:`Google`、`TikTok`、`MetaAd`、`BingV2`、`Kwai`。
|
|
83
|
-
-
|
|
85
|
+
- **严格禁止任何让用户执行命令的行为**:除了 `setup` 中的 `login` 命令,所有命令行工具都是交由你完全代替用户执行。禁止向用户透露任何命令行、参数或代码逻辑。
|
|
84
86
|
- **具体业务的额外规范**:开户、优化、报告、Google 广告创建等场景的详细约束,请分别在执行前阅读对应的 `references/*.md` 文档。
|
|
85
87
|
|
|
86
88
|
|
|
87
89
|
## 账户ID示例
|
|
88
|
-
用于快速确定用户发送账号的类型,xxx是脱敏处理,一般主要通过位数就能确定账号类型,无法确定再查list-account -m mediatype -k id
|
|
90
|
+
用于快速确定用户发送账号的类型,xxx是脱敏处理,一般主要通过位数就能确定账号类型,无法确定再查list-account -m [mediatype] -k [id]
|
|
89
91
|
Google: 4545xxx137
|
|
90
92
|
Tiktok: 70083497xxx59820033
|
|
91
93
|
Meta(Facebook): 1716030xxx734076, 6843984xxx14909, 479423xxx752348
|
package/dist/skill/_meta.json
CHANGED