siluzan-tso-cli 1.1.44 → 1.1.45-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 +1001 -118
- package/dist/skill/SKILL.md +1 -0
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/references/README.md +1 -0
- package/dist/skill/references/accounts/accounts-balance-stats.md +3 -3
- package/dist/skill/references/accounts/accounts-list.md +1 -1
- 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/account-analytics.md +44 -1
- package/dist/skill/references/analytics/rag.md +1 -1
- package/dist/skill/references/analytics/reporting.md +5 -5
- package/dist/skill/references/core/playbooks.md +1 -1
- package/dist/skill/references/core/setup.md +5 -5
- package/dist/skill/references/misc/tso-home.md +2 -2
- package/dist/skill/references/operations/hosted-automation-monitoring-json.md +1 -1
- package/dist/skill/references/report-templates/README.md +2 -0
- package/dist/skill/references/report-templates/REPORT-WORKFLOW.md +6 -4
- package/dist/skill/references/report-templates/yandex-period-report-excel.md +123 -0
- package/dist/skill/references/report-templates/yandex-period-report.md +121 -0
- package/dist/skill/report-templates/README.md +2 -0
- package/dist/skill/report-templates/REPORT-WORKFLOW.md +6 -4
- package/dist/skill/report-templates/yandex-period-report-excel.md +123 -0
- package/dist/skill/report-templates/yandex-period-report.html +968 -0
- package/dist/skill/report-templates/yandex-period-report.md +121 -0
- package/dist/skill/scripts/install.ps1 +3 -3
- package/dist/skill/scripts/install.sh +3 -3
- package/package.json +3 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Yandex Direct — 账户分析报告(模板纲要)
|
|
2
|
+
|
|
3
|
+
> 统计区间:`{startDate}` ~ `{endDate}`(**不能晚于今天**;省略默认近 7 天含今天)
|
|
4
|
+
> 账户:`{mediaCustomerId}`(如 `porg-xxx`,与 `list-accounts -m Yandex` 一致)
|
|
5
|
+
> **默认交付物**:一份可打开的 **HTML 文件**(`yandex-period-report.html`,样式对齐开发样例)。
|
|
6
|
+
> 用户**未指定格式**时一律走下方 **标准四步流程**;**禁止** Agent 手写/拼接 HTML。
|
|
7
|
+
> **用户明确要求 Excel / xlsx** 时:拉数步骤不变,改为 Agent 脚本写 `.xlsx`;**不要**调用 `yandex-analysis render`;禁止假设存在内置 excel 子命令。见 `yandex-period-report-excel.md`。
|
|
8
|
+
|
|
9
|
+
数据块(YandexAPI `/yandex-analysis` 8 维 + 本地周聚合):总览、按日、Search 网络、系列、关键词、搜索词、地域、设备;周报由 `daily` 本地聚合(后端无独立 weekly)。
|
|
10
|
+
|
|
11
|
+
| CLI `--sections` | 落盘形状(CI 实测) | 报告 `tables.*` / KPI |
|
|
12
|
+
| ---------------- | -------------------------------------------------------- | ---------------------------------------------------------- |
|
|
13
|
+
| `overview` | 对象:`account` / `currency` / `balance` / `totals` … | → `meta` + `kpis`(余额、日均、续航天数) |
|
|
14
|
+
| `daily` | `{ account, startDate, endDate, items: DayRow[] }` | → `tables.daily[]`;并聚合 → `tables.weekly[]` |
|
|
15
|
+
| `search` | `{ …, items: SearchRow[] }` | → `tables.search[]` |
|
|
16
|
+
| `campaigns` | `{ …, items: CampaignRow[] }`(默认 limit=100) | → `tables.campaigns[]` |
|
|
17
|
+
| `keywords` | `{ …, items: KeywordRow[] }` | → `tables.keywords[]` |
|
|
18
|
+
| `search-terms` | `{ …, items: SearchTermRow[] }`(**仅近 180 天**) | → `tables.searchTerms[]` |
|
|
19
|
+
| `geo` | `{ …, items: GeoRow[] }` | → `tables.geo[]` |
|
|
20
|
+
| `devices` | `{ …, items: DeviceRow[] }` | → `tables.devices[]` |
|
|
21
|
+
|
|
22
|
+
> 金额已为账户币种小数;`ctr` / `conversionRate` 为 **0~1 小数**。写叙事前先读各维 `*.outline.txt`。
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 标准四步流程(默认 · 交付 HTML)
|
|
27
|
+
|
|
28
|
+
| 步骤 | 执行者 | 动作 |
|
|
29
|
+
| ---------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| **1. 拉数** | Agent 调 CLI | `yandex-analysis -a <porg-xxx> --start <s> --end <e> --json-out ./snap-yandex`(全 8 维或 `--sections` 指定子集) |
|
|
31
|
+
| **2. 分析** | Agent | 用 **node/python 脚本**读落盘 JSON(勿用 Read 打开业务 `*.json`),对照 outline 完成聚合与洞察 |
|
|
32
|
+
| **3. 写 JSON** | Agent | 撰写 `yandex-period-report.json`:仅 `meta.accountId` + `narrative`(8 个分析章节)为必填;`kpis`/`tables` 可省略由 `--snapshot-dir` 合并 |
|
|
33
|
+
| **4. 渲染 HTML** | CLI | `yandex-analysis render` — **校验 narrative 8 个分析章节必含字段**,缺项报错不生成 HTML;**禁止** Agent 手写/拼接 HTML |
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# 步骤 1
|
|
37
|
+
siluzan-tso yandex-analysis -a <porg-xxx> --start <s> --end <e> --json-out ./snap-yandex
|
|
38
|
+
|
|
39
|
+
# 步骤 4(步骤 2~3 完成后)
|
|
40
|
+
siluzan-tso yandex-analysis render \
|
|
41
|
+
--data ./yandex-period-report.json \
|
|
42
|
+
--snapshot-dir ./snap-yandex \
|
|
43
|
+
--out ./yandex-period-report.html
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### `yandex-period-report.json` 顶层结构
|
|
47
|
+
|
|
48
|
+
- `meta`:`accountId`(必填)/ `accountName` / `currency` / `region` / `startDate` / `endDate` / `platform`;可省略由 `--snapshot-dir` 从 overview 补空。
|
|
49
|
+
- `kpis`:`spend` / `impressions` / `clicks` / `conversions` / `ctr` / `averageCpc` / `costPerConversion` / `conversionRate` / `roi` / `balance` / `avgDailySpend` / `activeDays` / `runwayDays` / `balanceAsOf`;可省略。
|
|
50
|
+
- `tables`(可省略,由 `--snapshot-dir` 映射):
|
|
51
|
+
- `daily[]`:`{date, spend, impressions, clicks, ctr, averageCpc, conversions, …}`
|
|
52
|
+
- `weekly[]`:`{weekLabel, startDate, endDate, days, spend, impressions, clicks, ctr, averageCpc, conversions, costPerConversion}`(CLI 由 daily 聚合)
|
|
53
|
+
- `search[]`:`{network, spend, …}`
|
|
54
|
+
- `campaigns[]`:`{campaignId, campaignName, status, state, campaignType, budget, strategy, …metrics}`
|
|
55
|
+
- `keywords[]`:`{keyword, campaignName, criteriaType, network, …metrics}`
|
|
56
|
+
- `searchTerms[]`:`{searchQuery, matchedKeyword, campaignName, …metrics}`
|
|
57
|
+
- `geo[]`:`{locationName, targetingLocationName, network, …metrics}`
|
|
58
|
+
- `devices[]`:`{device, network, …metrics}`
|
|
59
|
+
- `narrative`(**Agent 必填**):
|
|
60
|
+
- `executiveSummary[]`:≥1 段执行摘要
|
|
61
|
+
- `sections.{overview,search,campaigns,keywords,searchTerms,geo,devices,daily}`:每个维度各 `{analysis[](≥1,含数字依据), suggestions[](≥1)}`
|
|
62
|
+
- `recommendations[]`:≥3 条跨维度优化建议(可用 `{priority,text,anchor}`,anchor 对齐样例锚点如 `#keyword` / `#query`)
|
|
63
|
+
|
|
64
|
+
### 快照合并范围(`--snapshot-dir`)
|
|
65
|
+
|
|
66
|
+
`render` 传 `--snapshot-dir` 时,CLI 自动补全:
|
|
67
|
+
|
|
68
|
+
1. `meta`(仅补空字段)
|
|
69
|
+
2. **`kpis` / `tables.*` 一律以 CLI 快照覆盖**(有对应 section 时)
|
|
70
|
+
3. `tables.weekly` 由 `daily.items` 本地 ISO 周聚合
|
|
71
|
+
|
|
72
|
+
Agent 只需撰写 `narrative`;**禁止手写 HTML**,也**禁止**自填 `kpis`/`tables` 数值。
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 日期规则(必读)
|
|
77
|
+
|
|
78
|
+
- `--start` / `--end` 须**同传或同省略**;**不能晚于今天**;省略=近 7 天(含今天)。
|
|
79
|
+
- **search-terms** 仅支持近 **180 天**;超窗网关/CLI 拒绝——拉长区间时对该维用 `--exclude search-terms` 或缩短区间。
|
|
80
|
+
- 用户说「X 月 / 月报」且该月已结束:`--start` 当月 1 日、`--end` 当月最后一天。
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 拉数(一次目录)
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
mkdir -p ./snap-yandex
|
|
88
|
+
|
|
89
|
+
siluzan-tso list-accounts -m Yandex -k <porg-xxx> --json-out ./snap-yandex
|
|
90
|
+
|
|
91
|
+
siluzan-tso yandex-analysis -a <porg-xxx> --start <S> --end <E> --json-out ./snap-yandex
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- 写脚本前先读各 `yandex-*-<id>.outline.txt`(或 stdout 摘要里的 outline),再脚本读 `.json`。
|
|
95
|
+
- `search` / `campaigns` / `keywords` / `geo` / `devices` 在 Direct 侧过滤 `AdNetworkType=SEARCH`。
|
|
96
|
+
- **无**学习期 / 关键词翻译等专用接口——相关洞察仅能基于现有字段与叙事,勿编造后端字段。
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## HTML 章节与锚点(对齐开发样例)
|
|
101
|
+
|
|
102
|
+
| 锚点 | 章节 | 数据 / 叙事来源 |
|
|
103
|
+
| ----------- | -------------- | ---------------------------------------------------- |
|
|
104
|
+
| `#overview` | 账户总览 | `kpis` + `tables.weekly` + 每日折叠 + `sections.overview` |
|
|
105
|
+
| `#next` | 后续优化动作 | `narrative.recommendations` |
|
|
106
|
+
| `#search` | Search 网络 | `tables.search` + `sections.search` |
|
|
107
|
+
| `#campaign` | Campaign | `tables.campaigns` + `sections.campaigns` |
|
|
108
|
+
| `#keyword` | 关键词 | `tables.keywords` + `sections.keywords` |
|
|
109
|
+
| `#query` | 搜索词 | `tables.searchTerms` + `sections.searchTerms` |
|
|
110
|
+
| `#geo` | 地域 | `tables.geo` + `sections.geo` |
|
|
111
|
+
| `#device` | 设备 | `tables.devices` + `sections.devices` |
|
|
112
|
+
| `#daily` | 日报表 | `tables.daily` + `sections.daily` |
|
|
113
|
+
| `#weekly` | 周报表 | `tables.weekly`(同 daily 叙事) |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 相关文档
|
|
118
|
+
|
|
119
|
+
- `yandex-period-report-excel.md` — 用户要 xlsx 时
|
|
120
|
+
- `references/analytics/account-analytics.md` — `yandex-analysis` 命令与日期
|
|
121
|
+
- `references/core/agent-conventions.md` — 落盘读盘与交付自检
|
|
@@ -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.45-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.45-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.
|
|
3
|
+
"version": "1.1.45-beta.2",
|
|
4
4
|
"description": "Siluzan 广告账户管理 CLI — 查询账户、余额、消耗数据,管理绑定关系与充值。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ad-account",
|
|
@@ -63,12 +63,14 @@
|
|
|
63
63
|
"networkEndpoints": [
|
|
64
64
|
"tso-api.siluzan.com",
|
|
65
65
|
"googleapi.mysiluzan.com",
|
|
66
|
+
"yandexapi.mysiluzan.com",
|
|
66
67
|
"www.siluzan.com",
|
|
67
68
|
"o605862.ingest.us.sentry.io",
|
|
68
69
|
"registry.npmjs.org"
|
|
69
70
|
],
|
|
70
71
|
"optionalEnvVars": [
|
|
71
72
|
"SILUZAN_GOOGLE_API",
|
|
73
|
+
"SILUZAN_YANDEX_API",
|
|
72
74
|
"SILUZAN_API_KEY"
|
|
73
75
|
]
|
|
74
76
|
},
|