siluzan-tso-cli 1.1.24-beta.4 → 1.1.24
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 -2
- package/dist/index.js +260 -7
- package/dist/skill/AGENTS.md +3 -1
- package/dist/skill/SKILL.md +2 -1
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/assets/website-diagnosis-rules.md +99 -0
- package/dist/skill/references/README.md +2 -0
- package/dist/skill/references/accounts/finance.md +4 -4
- package/dist/skill/references/analytics/account-analytics.md +1 -0
- package/dist/skill/references/analytics/rag.md +1 -1
- package/dist/skill/references/analytics/reporting.md +2 -2
- package/dist/skill/references/analytics/website-diagnosis-guide.md +137 -0
- package/dist/skill/references/core/playbooks.md +21 -1
- package/dist/skill/references/core/setup.md +5 -5
- package/dist/skill/references/core/skill-authoring.md +1 -1
- package/dist/skill/report-templates/README.md +1 -0
- package/dist/skill/report-templates/website-diagnosis-report.html +84 -0
- package/dist/skill/report-templates/website-diagnosis-report.md +65 -0
- 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 报告模板引用以下 CDN:`cdn.tailwindcss.com`、`cdnjs.cloudflare.co
|
|
|
43
43
|
在**用户的目标项目根目录**执行(根据用户使用的助手选择 `--ai`):
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
npm install -g siluzan-tso-cli
|
|
46
|
+
npm install -g siluzan-tso-cli
|
|
47
47
|
siluzan-tso init --ai cursor # 写入 Cursor(默认)
|
|
48
48
|
siluzan-tso init --ai cursor,claude # 同时写入多个平台
|
|
49
49
|
siluzan-tso init --ai all # 写入所有支持的平台
|
|
@@ -51,7 +51,6 @@ siluzan-tso init -d /path/to/skills # 写入自定义目录
|
|
|
51
51
|
siluzan-tso init --force # 强制覆盖已存在文件
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
> **注意**:当前为测试版(1.1.24-beta.4),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-tso-cli`。
|
|
55
54
|
|
|
56
55
|
| 助手 | 建议 `--ai` |
|
|
57
56
|
| ----------------------- | ------------------------------------ |
|
package/dist/index.js
CHANGED
|
@@ -3328,7 +3328,7 @@ var DEFAULT_API_BASE;
|
|
|
3328
3328
|
var init_defaults = __esm({
|
|
3329
3329
|
"src/config/defaults.ts"() {
|
|
3330
3330
|
"use strict";
|
|
3331
|
-
DEFAULT_API_BASE = "https://tso-api
|
|
3331
|
+
DEFAULT_API_BASE = "https://tso-api.siluzan.com";
|
|
3332
3332
|
}
|
|
3333
3333
|
});
|
|
3334
3334
|
|
|
@@ -120957,12 +120957,264 @@ function register24(program2) {
|
|
|
120957
120957
|
|
|
120958
120958
|
// src/commands/diagnostic.ts
|
|
120959
120959
|
function register25(program2) {
|
|
120960
|
-
program2.command("diagnostic").description("
|
|
120961
|
-
console.log("\
|
|
120962
|
-
console.log(
|
|
120963
|
-
|
|
120960
|
+
program2.command("diagnostic").description("\u8BCA\u65AD\u5165\u53E3\u8BF4\u660E\uFF1AGoogle \u5E7F\u544A\u8D26\u6237\u8BCA\u65AD\u9875 vs \u7F51\u7AD9\u8BCA\u65AD CLI").action(() => {
|
|
120961
|
+
console.log("\n\u8BCA\u65AD\u80FD\u529B\u8BF4\u660E\n");
|
|
120962
|
+
console.log(" \u3010Google \u5E7F\u544A\u8D26\u6237\u8BCA\u65AD\u3011");
|
|
120963
|
+
console.log(" \u524D\u7AEF\uFF1A/v3/foreign_trade/tso/tool/AdvertisingDiagnosis");
|
|
120964
|
+
console.log(" \u7528\u9014\uFF1A\u8D26\u6237\u6295\u653E\u5206\u6790\u3001\u5065\u5EB7\u5EA6\u62A5\u544A\uFF08\u975E\u843D\u5730\u9875\u7F51\u7AD9\u8BC4\u5206\uFF09\n");
|
|
120965
|
+
console.log(" \u3010\u7F51\u7AD9\u8BCA\u65AD\u3011\uFF08\u5BF9\u9F50 Aiagent tso_agent getWebsiteDiagnosisData\uFF09");
|
|
120966
|
+
console.log(" CLI \u62C9\u6570\uFF1A");
|
|
120967
|
+
console.log(" siluzan-tso website-diagnosis collect --url <url> --json-out ./snap-web");
|
|
120968
|
+
console.log(" siluzan-tso website-diagnosis performance --url <url> --json-out ./snap-web");
|
|
120969
|
+
console.log(" Skill\uFF1Areferences/analytics/website-diagnosis-guide.md\n");
|
|
120970
|
+
console.log(" \u3010\u8D26\u6237\u5217\u8868 ARIT \u5206\u3011");
|
|
120971
|
+
console.log(" list-accounts \u4F1A\u8865\u5145 ma.diagnoseReports \u4E2D reportSource=ARIT \u7684\u5F97\u5206\uFF1B");
|
|
120972
|
+
console.log(" \u6216\uFF1Awebsite-diagnosis search --ids <websiteDiagnoseId> --json-out ./snap\n");
|
|
120973
|
+
});
|
|
120974
|
+
}
|
|
120975
|
+
|
|
120976
|
+
// src/commands/website-diagnosis/run.ts
|
|
120977
|
+
init_auth();
|
|
120978
|
+
init_cli_json_snapshot();
|
|
120979
|
+
|
|
120980
|
+
// src/commands/website-diagnosis/shared.ts
|
|
120981
|
+
init_dist();
|
|
120982
|
+
function resolveAgentApiBase(tsoApiBaseUrl) {
|
|
120983
|
+
const fromEnv = process.env.SILUZAN_AGENT_BASE?.trim();
|
|
120984
|
+
if (fromEnv) return fromEnv.replace(/\/$/, "");
|
|
120985
|
+
const base = tsoApiBaseUrl ?? "";
|
|
120986
|
+
if (base.includes("-ci") || base.includes("ci.")) {
|
|
120987
|
+
return "https://agent-ci.mysiluzan.com";
|
|
120988
|
+
}
|
|
120989
|
+
return "https://agent.mysiluzan.com";
|
|
120990
|
+
}
|
|
120991
|
+
function normalizeWebsiteUrl(input) {
|
|
120992
|
+
const trimmed = String(input ?? "").trim();
|
|
120993
|
+
if (!trimmed) return "";
|
|
120994
|
+
if (/^https?:\/\//i.test(trimmed)) return trimmed;
|
|
120995
|
+
return `https://${trimmed}`;
|
|
120996
|
+
}
|
|
120997
|
+
function pickDownloadedHtml(settled) {
|
|
120998
|
+
if (!Array.isArray(settled) || settled.length !== 1) {
|
|
120999
|
+
return { ok: false, message: "download-assets \u8FD4\u56DE\u683C\u5F0F\u5F02\u5E38\uFF08\u987B\u4E3A\u5355 URL \u5355\u6761\u7ED3\u679C\uFF09" };
|
|
121000
|
+
}
|
|
121001
|
+
const row = settled[0];
|
|
121002
|
+
if (row.status !== "fulfilled") {
|
|
121003
|
+
return { ok: false, message: "\u7F51\u7AD9 HTML \u4E0B\u8F7D\u5931\u8D25\uFF08\u8BF7\u6C42\u88AB\u62D2\u7EDD\uFF09" };
|
|
121004
|
+
}
|
|
121005
|
+
const value = row.value;
|
|
121006
|
+
if (!value || value.error) {
|
|
121007
|
+
return { ok: false, message: value?.error ?? "\u7F51\u7AD9 HTML \u4E0B\u8F7D\u5931\u8D25" };
|
|
121008
|
+
}
|
|
121009
|
+
if (!value.content || String(value.content).length === 0) {
|
|
121010
|
+
return { ok: false, message: "\u7F51\u7AD9 HTML \u5185\u5BB9\u4E3A\u7A7A" };
|
|
121011
|
+
}
|
|
121012
|
+
return { ok: true, value };
|
|
121013
|
+
}
|
|
121014
|
+
async function fetchWebsiteHtml(config, websiteUrl, verbose) {
|
|
121015
|
+
const base = resolveAgentApiBase(config.apiBaseUrl);
|
|
121016
|
+
const url = `${base}/download-assets`;
|
|
121017
|
+
const bodyStr = JSON.stringify({ urls: [websiteUrl] });
|
|
121018
|
+
const headers = {
|
|
121019
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
121020
|
+
Accept: "application/json, text/plain, */*",
|
|
121021
|
+
"x-client-type": "tso",
|
|
121022
|
+
...config.apiKey ? { "x-api-key": config.apiKey } : { Authorization: `Bearer ${config.authToken}` },
|
|
121023
|
+
"Content-Length": String(Buffer.byteLength(bodyStr, "utf8"))
|
|
121024
|
+
};
|
|
121025
|
+
const res = await rawRequest(url, { method: "POST", headers, body: bodyStr });
|
|
121026
|
+
if (res.status < 200 || res.status >= 300) {
|
|
121027
|
+
const detail = verbose ? `\uFF1A${res.text.slice(0, 300)}` : "";
|
|
121028
|
+
throw new Error(`download-assets HTTP ${res.status}${detail}`);
|
|
121029
|
+
}
|
|
121030
|
+
let settled;
|
|
121031
|
+
try {
|
|
121032
|
+
settled = JSON.parse(res.text);
|
|
121033
|
+
} catch {
|
|
121034
|
+
throw new Error("download-assets \u54CD\u5E94\u4E0D\u662F\u6709\u6548 JSON");
|
|
121035
|
+
}
|
|
121036
|
+
const picked = pickDownloadedHtml(settled);
|
|
121037
|
+
if (!picked.ok) {
|
|
121038
|
+
throw new Error(picked.message);
|
|
121039
|
+
}
|
|
121040
|
+
return picked.value;
|
|
121041
|
+
}
|
|
121042
|
+
|
|
121043
|
+
// src/commands/website-diagnosis/run.ts
|
|
121044
|
+
async function runWebsiteDiagnosisPerformance(opts) {
|
|
121045
|
+
const config = loadConfig(opts.token);
|
|
121046
|
+
const websiteUrl = normalizeWebsiteUrl(opts.url);
|
|
121047
|
+
if (!websiteUrl) {
|
|
121048
|
+
console.error("\n\u274C \u8BF7\u63D0\u4F9B --url\uFF08\u5B8C\u6574 http(s) \u5730\u5740\u6216\u57DF\u540D\uFF09\n");
|
|
121049
|
+
process.exit(1);
|
|
121050
|
+
}
|
|
121051
|
+
let lighthouse = {};
|
|
121052
|
+
let warning;
|
|
121053
|
+
try {
|
|
121054
|
+
lighthouse = await apiFetch2(
|
|
121055
|
+
`${config.apiBaseUrl}/api/WebsiteDiagnosisReports/performance?url=${encodeURIComponent(websiteUrl)}`,
|
|
121056
|
+
config,
|
|
121057
|
+
{},
|
|
121058
|
+
opts.verbose
|
|
120964
121059
|
);
|
|
121060
|
+
} catch (err) {
|
|
121061
|
+
warning = err instanceof Error ? err.message : String(err);
|
|
121062
|
+
lighthouse = {};
|
|
121063
|
+
}
|
|
121064
|
+
const payload = {
|
|
121065
|
+
url: websiteUrl,
|
|
121066
|
+
lighthouse,
|
|
121067
|
+
...warning ? { warning: `Lighthouse \u6027\u80FD\u6570\u636E\u83B7\u53D6\u5931\u8D25: ${warning}` } : {}
|
|
121068
|
+
};
|
|
121069
|
+
if (await emitCliJsonOrSnapshot(
|
|
121070
|
+
{ jsonOut: opts.jsonOut },
|
|
121071
|
+
{
|
|
121072
|
+
section: "website-diagnosis-performance",
|
|
121073
|
+
commandLabel: "website-diagnosis performance",
|
|
121074
|
+
commandHint: websiteUrl,
|
|
121075
|
+
payload
|
|
121076
|
+
}
|
|
121077
|
+
)) {
|
|
121078
|
+
return;
|
|
121079
|
+
}
|
|
121080
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
121081
|
+
if (warning) {
|
|
121082
|
+
console.error(`
|
|
121083
|
+
\u26A0\uFE0F ${warning}
|
|
121084
|
+
`);
|
|
121085
|
+
}
|
|
121086
|
+
}
|
|
121087
|
+
async function runWebsiteDiagnosisSearch(opts) {
|
|
121088
|
+
const config = loadConfig(opts.token);
|
|
121089
|
+
const ids = opts.ids.split(",").map((x) => x.trim()).filter(Boolean);
|
|
121090
|
+
if (ids.length === 0) {
|
|
121091
|
+
console.error("\n\u274C \u8BF7\u63D0\u4F9B --ids\uFF08\u9017\u53F7\u5206\u9694\u7684 websiteDiagnoseId\uFF09\n");
|
|
121092
|
+
process.exit(1);
|
|
121093
|
+
}
|
|
121094
|
+
const items = await apiFetch2(
|
|
121095
|
+
`${config.apiBaseUrl}/query/WebsiteDiagnoseReport/search?ids=${ids.join(",")}`,
|
|
121096
|
+
config,
|
|
121097
|
+
{},
|
|
121098
|
+
opts.verbose
|
|
121099
|
+
);
|
|
121100
|
+
const payload = { ids, items: items ?? [] };
|
|
121101
|
+
if (await emitCliJsonOrSnapshot(
|
|
121102
|
+
{ jsonOut: opts.jsonOut },
|
|
121103
|
+
{
|
|
121104
|
+
section: "website-diagnosis-search",
|
|
121105
|
+
commandLabel: "website-diagnosis search",
|
|
121106
|
+
commandHint: ids.join(","),
|
|
121107
|
+
payload
|
|
121108
|
+
}
|
|
121109
|
+
)) {
|
|
121110
|
+
return;
|
|
121111
|
+
}
|
|
121112
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
121113
|
+
}
|
|
121114
|
+
var HTML_PREVIEW_CHARS = 8e3;
|
|
121115
|
+
async function runWebsiteDiagnosisCollect(opts) {
|
|
121116
|
+
const config = loadConfig(opts.token);
|
|
121117
|
+
const websiteUrl = normalizeWebsiteUrl(opts.url);
|
|
121118
|
+
if (!websiteUrl) {
|
|
121119
|
+
console.error("\n\u274C \u8BF7\u63D0\u4F9B --url\n");
|
|
121120
|
+
process.exit(1);
|
|
121121
|
+
}
|
|
121122
|
+
let lighthouse = {};
|
|
121123
|
+
let lighthouseWarning;
|
|
121124
|
+
try {
|
|
121125
|
+
lighthouse = await apiFetch2(
|
|
121126
|
+
`${config.apiBaseUrl}/api/WebsiteDiagnosisReports/performance?url=${encodeURIComponent(websiteUrl)}`,
|
|
121127
|
+
config,
|
|
121128
|
+
{},
|
|
121129
|
+
opts.verbose
|
|
121130
|
+
);
|
|
121131
|
+
} catch (err) {
|
|
121132
|
+
lighthouseWarning = err instanceof Error ? err.message : String(err);
|
|
121133
|
+
lighthouse = {};
|
|
121134
|
+
}
|
|
121135
|
+
let htmlMeta;
|
|
121136
|
+
let htmlPreview;
|
|
121137
|
+
let htmlFull;
|
|
121138
|
+
let htmlError;
|
|
121139
|
+
if (!opts.skipHtml) {
|
|
121140
|
+
try {
|
|
121141
|
+
const html = await fetchWebsiteHtml(config, websiteUrl, opts.verbose);
|
|
121142
|
+
htmlMeta = {
|
|
121143
|
+
originUrl: html.originUrl,
|
|
121144
|
+
finalUrl: html.finalUrl,
|
|
121145
|
+
mimeType: html.mimeType,
|
|
121146
|
+
contentLength: html.contentLength,
|
|
121147
|
+
downloadTime: html.downloadTime
|
|
121148
|
+
};
|
|
121149
|
+
const content = String(html.content ?? "");
|
|
121150
|
+
htmlPreview = content.slice(0, HTML_PREVIEW_CHARS);
|
|
121151
|
+
if (opts.includeHtml) {
|
|
121152
|
+
htmlFull = content;
|
|
121153
|
+
}
|
|
121154
|
+
} catch (err) {
|
|
121155
|
+
htmlError = err instanceof Error ? err.message : String(err);
|
|
121156
|
+
}
|
|
121157
|
+
}
|
|
121158
|
+
const payload = {
|
|
121159
|
+
url: websiteUrl,
|
|
121160
|
+
collectedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
121161
|
+
lighthouse,
|
|
121162
|
+
...lighthouseWarning ? { lighthouseWarning: `Lighthouse \u6027\u80FD\u6570\u636E\u83B7\u53D6\u5931\u8D25: ${lighthouseWarning}` } : {},
|
|
121163
|
+
html: htmlMeta,
|
|
121164
|
+
htmlPreview,
|
|
121165
|
+
...htmlFull ? { htmlContent: htmlFull } : {},
|
|
121166
|
+
...htmlError ? { htmlError } : {},
|
|
121167
|
+
agentHint: "\u5B8C\u6574 6 \u6A21\u5757\u8BC4\u5206\u62A5\u544A\u9700 Agent \u6309 references/analytics/website-diagnosis-guide.md \u4E0E assets/website-diagnosis-rules.md \u7ED3\u5408\u672C JSON \u751F\u6210\uFF08\u5BF9\u9F50 tso_agent getWebsiteDiagnosisData\uFF09\u3002"
|
|
121168
|
+
};
|
|
121169
|
+
if (await emitCliJsonOrSnapshot(
|
|
121170
|
+
{ jsonOut: opts.jsonOut },
|
|
121171
|
+
{
|
|
121172
|
+
section: "website-diagnosis-collect",
|
|
121173
|
+
commandLabel: "website-diagnosis collect",
|
|
121174
|
+
commandHint: websiteUrl,
|
|
121175
|
+
payload
|
|
121176
|
+
}
|
|
121177
|
+
)) {
|
|
121178
|
+
return;
|
|
121179
|
+
}
|
|
121180
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
121181
|
+
}
|
|
121182
|
+
|
|
121183
|
+
// src/commands/website-diagnosis/register.ts
|
|
121184
|
+
function registerWebsiteDiagnosisCommands(program2) {
|
|
121185
|
+
const root = program2.command("website-diagnosis").description(
|
|
121186
|
+
"\u7F51\u7AD9\u8BCA\u65AD\uFF1ALighthouse \u6027\u80FD\u3001HTML \u91C7\u96C6\uFF08Agent download-assets\uFF09\u3001ARIT \u5386\u53F2\u5F97\u5206\u67E5\u8BE2"
|
|
121187
|
+
);
|
|
121188
|
+
root.command("performance").description("\u62C9\u53D6 Lighthouse \u6027\u80FD\u6570\u636E\uFF08GET WebsiteDiagnosisReports/performance\uFF09").requiredOption("--url <url>", "\u7F51\u7AD9 URL\uFF08\u53EF\u7701\u7565 https://\uFF0C\u81EA\u52A8\u8865\u5168\uFF09").option("--token <token>", "JWT\uFF08\u9ED8\u8BA4\u8BFB config / \u73AF\u5883\u53D8\u91CF\uFF09").option("--verbose", "\u6253\u5370\u8BF7\u6C42\u8BE6\u60C5").option("--json-out <dir>", "\u843D\u76D8 cli-manifest + JSON").action(async (opts) => {
|
|
121189
|
+
await runWebsiteDiagnosisPerformance({
|
|
121190
|
+
url: opts.url,
|
|
121191
|
+
token: opts.token,
|
|
121192
|
+
verbose: opts.verbose,
|
|
121193
|
+
jsonOut: opts.jsonOut
|
|
121194
|
+
});
|
|
120965
121195
|
});
|
|
121196
|
+
root.command("search").description("\u6309 websiteDiagnoseId \u67E5\u8BE2 ARIT \u8BCA\u65AD\u5F97\u5206\uFF08\u4E0E list-accounts \u8865\u5145\u5B57\u6BB5\u540C\u6E90\uFF09").requiredOption("--ids <ids>", "\u9017\u53F7\u5206\u9694\u7684 websiteDiagnoseId").option("--token <token>", "JWT").option("--verbose", "\u6253\u5370\u8BF7\u6C42\u8BE6\u60C5").option("--json-out <dir>", "\u843D\u76D8 cli-manifest + JSON").action(async (opts) => {
|
|
121197
|
+
await runWebsiteDiagnosisSearch({
|
|
121198
|
+
ids: opts.ids,
|
|
121199
|
+
token: opts.token,
|
|
121200
|
+
verbose: opts.verbose,
|
|
121201
|
+
jsonOut: opts.jsonOut
|
|
121202
|
+
});
|
|
121203
|
+
});
|
|
121204
|
+
root.command("collect").description(
|
|
121205
|
+
"\u91C7\u96C6\u8BCA\u65AD\u539F\u6599\uFF1ALighthouse + \u9996\u9875 HTML\uFF08POST Agent /download-assets\uFF09\uFF1B\u4F9B Agent \u6309\u89C4\u5219\u751F\u6210 6 \u6A21\u5757\u62A5\u544A"
|
|
121206
|
+
).requiredOption("--url <url>", "\u7F51\u7AD9 URL").option("--include-html", "\u843D\u76D8\u65F6\u4FDD\u7559\u5B8C\u6574 HTML\uFF08\u4F53\u79EF\u5927\uFF0C\u9ED8\u8BA4\u4EC5 preview\uFF09").option("--skip-html", "\u4EC5\u62C9 Lighthouse\uFF0C\u4E0D\u8BF7\u6C42 download-assets").option("--token <token>", "JWT").option("--verbose", "\u6253\u5370\u8BF7\u6C42\u8BE6\u60C5").option("--json-out <dir>", "\u843D\u76D8 cli-manifest + JSON\uFF08\u63A8\u8350\uFF09").action(
|
|
121207
|
+
async (opts) => {
|
|
121208
|
+
await runWebsiteDiagnosisCollect({
|
|
121209
|
+
url: opts.url,
|
|
121210
|
+
includeHtml: opts.includeHtml,
|
|
121211
|
+
skipHtml: opts.skipHtml,
|
|
121212
|
+
token: opts.token,
|
|
121213
|
+
verbose: opts.verbose,
|
|
121214
|
+
jsonOut: opts.jsonOut
|
|
121215
|
+
});
|
|
121216
|
+
}
|
|
121217
|
+
);
|
|
120966
121218
|
}
|
|
120967
121219
|
|
|
120968
121220
|
// src/index.ts
|
|
@@ -121235,7 +121487,7 @@ function getVersion() {
|
|
|
121235
121487
|
}
|
|
121236
121488
|
var program = new Command();
|
|
121237
121489
|
program.name("siluzan-tso").description(
|
|
121238
|
-
"Siluzan \u5E7F\u544A\u8D26\u6237\u7BA1\u7406\uFF1A\u8D26\u6237\u67E5\u8BE2\u3001\u4F59\u989D\u3001\u6295\u653E\u6570\u636E\u3001\u5F00\u6237\u7533\u8BF7\uFF08Google/TikTok/Yandex/Bing/Kwai\uFF09\u3001\n\u8D26\u53F7\u5206\u4EAB/\u89E3\u7ED1\u3001\u4F18\u5316\u62A5\u544A\u3001Google \u8D26\u6237\u5206\u6790\u7F51\u5173\uFF08google-analysis\uFF09\u3001\u5145\u503C\u8F6C\u8D26\u3001\u5F00\u7968\u3001\u667A\u80FD\u9884\u8B66\u3001Google \u5E7F\u544A\u7BA1\u7406\uFF08\u542B\u5F02\u6B65\u6279\u91CF\uFF09\u3002"
|
|
121490
|
+
"Siluzan \u5E7F\u544A\u8D26\u6237\u7BA1\u7406\uFF1A\u8D26\u6237\u67E5\u8BE2\u3001\u4F59\u989D\u3001\u6295\u653E\u6570\u636E\u3001\u5F00\u6237\u7533\u8BF7\uFF08Google/TikTok/Yandex/Bing/Kwai\uFF09\u3001\n\u8D26\u53F7\u5206\u4EAB/\u89E3\u7ED1\u3001\u4F18\u5316\u62A5\u544A\u3001Google \u8D26\u6237\u5206\u6790\u7F51\u5173\uFF08google-analysis\uFF09\u3001\u7F51\u7AD9\u8BCA\u65AD\uFF08website-diagnosis\uFF09\u3001\u5145\u503C\u8F6C\u8D26\u3001\u5F00\u7968\u3001\u667A\u80FD\u9884\u8B66\u3001Google \u5E7F\u544A\u7BA1\u7406\uFF08\u542B\u5F02\u6B65\u6279\u91CF\uFF09\u3002"
|
|
121239
121491
|
).version(getVersion());
|
|
121240
121492
|
program.option("--commit <text>", "\u5199\u64CD\u4F5C\u8BF4\u660E\uFF1B\u8BB0\u5165\u672C\u673A\u5199\u5BA1\u8BA1 JSONL");
|
|
121241
121493
|
program.hook("preAction", async () => {
|
|
@@ -121278,7 +121530,8 @@ var REGISTRARS = [
|
|
|
121278
121530
|
register22,
|
|
121279
121531
|
register23,
|
|
121280
121532
|
register24,
|
|
121281
|
-
register25
|
|
121533
|
+
register25,
|
|
121534
|
+
registerWebsiteDiagnosisCommands
|
|
121282
121535
|
];
|
|
121283
121536
|
for (const reg of REGISTRARS) reg(program);
|
|
121284
121537
|
function argvHasDeprecatedJsonFlag(argv) {
|
package/dist/skill/AGENTS.md
CHANGED
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
|
|
26
26
|
| ID | 文档 |
|
|
27
27
|
| --- | --- |
|
|
28
|
-
| P1–
|
|
28
|
+
| P1–P8 | `references/core/playbooks.md` |
|
|
29
|
+
| 网站诊断 | `report-templates/website-diagnosis-report.md` |
|
|
29
30
|
| OKKI 周报 | `report-templates/okki-weekly-google-client.md` |
|
|
30
31
|
| 询盘分析 | `report-templates/google-inquiry-analysis.md` |
|
|
31
32
|
|
|
@@ -43,5 +44,6 @@
|
|
|
43
44
|
| `src/commands/open-account/`、`account-manage-register.ts` | accounts |
|
|
44
45
|
| `src/commands/ad/` | google-ads |
|
|
45
46
|
| `src/commands/google-analysis/`、`google-analysis-batch.ts` | analytics |
|
|
47
|
+
| `src/commands/website-diagnosis/` | analytics(网站诊断) |
|
|
46
48
|
| `src/commands/report/` | analytics + report-templates |
|
|
47
49
|
| `src/commands/forewarning/`、`optimize/`、`clue.ts` | operations |
|
package/dist/skill/SKILL.md
CHANGED
|
@@ -55,7 +55,7 @@ Windows:部分 Agent 通过 PowerShell 代执行时可能失败,改在 [Git
|
|
|
55
55
|
| `references/core/` | `agent-conventions.md` | 纪律、tips、playbooks、workflows |
|
|
56
56
|
| `references/accounts/` | `accounts.md` | 列表、余额、MCC/BC、开户、发票 |
|
|
57
57
|
| `references/google-ads/` | `google-ads.md` | CRUD、PMax、campaign-plan;`rules/` 优化 SOP |
|
|
58
|
-
| `references/analytics/` | `account-analytics.md` | google-analysis、facebook-analysis、批处理、拓词、RAG |
|
|
58
|
+
| `references/analytics/` | `account-analytics.md` | google-analysis、facebook-analysis、website-diagnosis、批处理、拓词、RAG |
|
|
59
59
|
| `references/operations/` | `forewarning.md` | 预警、线索、optimize、宿主编排 |
|
|
60
60
|
| `references/core/` | `subagent-orchestration.md` | **可选** subagent 自主委派(P5/P6/P7、长日志) |
|
|
61
61
|
|
|
@@ -83,6 +83,7 @@ Windows:部分 Agent 通过 PowerShell 代执行时可能失败,改在 [Git
|
|
|
83
83
|
| 账户列表 / 余额 / 消耗 / 分享 / MCC / 多账户汇总 | `accounts/accounts.md`;金额加 `accounts/currency.md` |
|
|
84
84
|
| 拉数 / 报告 / 周报 / `google-analysis` | `analytics/account-analytics.md` + `core/tips.md`;多账户加 `analytics/google-analysis-batch.md` |
|
|
85
85
|
| Meta/Facebook 周期或诊断报告 / `facebook-analysis` | `analytics/facebook-analysis-guide.md` + `report-templates/meta-period-report.md`(或 `meta-account-diagnosis-report.md`)+ `core/playbooks.md` P4-FB |
|
|
86
|
+
| 网站诊断 / 落地页评分 / `website-diagnosis` | `analytics/website-diagnosis-guide.md` + `assets/website-diagnosis-rules.md` + `report-templates/website-diagnosis-report.md`(**终稿 HTML**)+ `core/playbooks.md` P8 |
|
|
86
87
|
| Google 新建搜索系列 | `google-ads/google-ads-campaign-plan.md` |
|
|
87
88
|
| Google 广告 CRUD / 拒审 | `google-ads/google-ads.md` |
|
|
88
89
|
| PMax | `assets/pmax-create-template.md` + `google-ads/pmax-api.md` |
|
package/dist/skill/_meta.json
CHANGED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# 网站诊断评分规则(Agent 用)
|
|
2
|
+
|
|
3
|
+
> 源:`Aiagent-Server/agent/tso_agent/data/website_guide.py`。生成 JSON 时须覆盖全部 `m1`–`m6` 板块及各自子项 ID;得分 ∈ [0, fullMarks]。
|
|
4
|
+
|
|
5
|
+
## JSON Schema(摘要)
|
|
6
|
+
|
|
7
|
+
- `url`:被诊断 URL
|
|
8
|
+
- `ratingId`:`s1`–`s5`
|
|
9
|
+
- `coreIssuesIds`:`ci1`–`ci10` 子集
|
|
10
|
+
- `modules[]`:`{ id, score, items[] }`
|
|
11
|
+
- `items[]`:`{ id, score, status, issue, suggestion }`
|
|
12
|
+
- `status` 枚举:`Excellent` | `Good` | `Normal` | `Poor` | `Full` | `NeedImprove` | `Absent`
|
|
13
|
+
- 满分项 `suggestion` 可为空字符串
|
|
14
|
+
|
|
15
|
+
## 评分等级(ratingId)
|
|
16
|
+
|
|
17
|
+
| ID | 等级 | 分数区间 | 说明 |
|
|
18
|
+
| -- | ---- | -------- | ---- |
|
|
19
|
+
| s1 | 优秀 | ≥90 | 可直接投放广告 |
|
|
20
|
+
| s2 | 良好 | 80–89.99 | 小幅优化后可投放 |
|
|
21
|
+
| s3 | 一般 | 70–79.99 | 需要重点优化 |
|
|
22
|
+
| s4 | 较差 | 60–69.99 | 需要大幅改进 |
|
|
23
|
+
| s5 | 不建议投放 | ≤59.99 | 需全面整改 |
|
|
24
|
+
|
|
25
|
+
## 核心问题(coreIssuesIds)
|
|
26
|
+
|
|
27
|
+
| ID | 问题 |
|
|
28
|
+
| -- | ---- |
|
|
29
|
+
| ci1 | 首屏缺乏清晰 CTA |
|
|
30
|
+
| ci2 | 转化跟踪未部署 |
|
|
31
|
+
| ci3 | 移动端显示异常 |
|
|
32
|
+
| ci4 | 页面加载缓慢 |
|
|
33
|
+
| ci5 | 导航栏与清晰度 |
|
|
34
|
+
| ci6 | 表单复杂或缺乏清晰 |
|
|
35
|
+
| ci7 | 类目页与详情页内容不匹配 |
|
|
36
|
+
| ci8 | 网站语言与广告不一致 |
|
|
37
|
+
| ci9 | 缺少社媒分享入口 |
|
|
38
|
+
| ci10 | 品牌风格不统一 |
|
|
39
|
+
|
|
40
|
+
## m1 · 网站内容及结构(9 项)
|
|
41
|
+
|
|
42
|
+
| ID | 诊断项 | 满分 |
|
|
43
|
+
| -- | ------ | ---- |
|
|
44
|
+
| m1i1 | Banner 轮播图 | 5 |
|
|
45
|
+
| m1i2 | 导航栏 | 2 |
|
|
46
|
+
| m1i3 | 首页信息布局 | 4 |
|
|
47
|
+
| m1i4 | 产品类目页 | 2 |
|
|
48
|
+
| m1i5 | 产品详情页 | 4 |
|
|
49
|
+
| m1i6 | 公司介绍页 | 3 |
|
|
50
|
+
| m1i7 | 联系我们页 | 4 |
|
|
51
|
+
| m1i8 | 表单提交流程 | 4 |
|
|
52
|
+
| m1i9 | 社交媒体链接 | 2 |
|
|
53
|
+
|
|
54
|
+
## m2 · 网站性能(5 项)
|
|
55
|
+
|
|
56
|
+
| ID | 诊断项 | 满分 |
|
|
57
|
+
| -- | ------ | ---- |
|
|
58
|
+
| m2i1 | 加载速度(Lighthouse PC/移动) | 8 |
|
|
59
|
+
| m2i2 | HTTPS 安全 | 5 |
|
|
60
|
+
| m2i3 | 404 页面 | 4 |
|
|
61
|
+
| m2i4 | 图片清晰度 | 4 |
|
|
62
|
+
| m2i5 | 移动端适配 | 4 |
|
|
63
|
+
|
|
64
|
+
## m3 · 营销基础与广告落地页(4 项)
|
|
65
|
+
|
|
66
|
+
| ID | 诊断项 | 满分 |
|
|
67
|
+
| -- | ------ | ---- |
|
|
68
|
+
| m3i1 | 企业邮箱 | 6 |
|
|
69
|
+
| m3i2 | 联系电话 | 3 |
|
|
70
|
+
| m3i4 | 语言一致性 | 3 |
|
|
71
|
+
| m3i5 | 地址地图 | 3 |
|
|
72
|
+
|
|
73
|
+
## m4 · 用户体验与转化(5 项)
|
|
74
|
+
|
|
75
|
+
| ID | 诊断项 | 满分 |
|
|
76
|
+
| -- | ------ | ---- |
|
|
77
|
+
| m4i1 | 页面布局 | 3 |
|
|
78
|
+
| m4i2 | CTA 按钮 | 5 |
|
|
79
|
+
| m4i3 | 表单体验 | 3 |
|
|
80
|
+
| m4i4 | 内容可读性 | 3 |
|
|
81
|
+
| m4i5 | 社媒分享可扩展性 | 1 |
|
|
82
|
+
|
|
83
|
+
## m5 · 媒体广告投放辅助(3 项)
|
|
84
|
+
|
|
85
|
+
| ID | 诊断项 | 满分 |
|
|
86
|
+
| -- | ------ | ---- |
|
|
87
|
+
| m5i1 | 落地页速度 | 3 |
|
|
88
|
+
| m5i2 | 询盘转化路径 | 4 |
|
|
89
|
+
| m5i4 | 跟踪与分析 | 3 |
|
|
90
|
+
|
|
91
|
+
## m6 · 社交媒体辅助(3 项)
|
|
92
|
+
|
|
93
|
+
| ID | 诊断项 | 满分 |
|
|
94
|
+
| -- | ------ | ---- |
|
|
95
|
+
| m6i1 | 内容可引用性 | 2 |
|
|
96
|
+
| m6i2 | 内容可分享性 | 2 |
|
|
97
|
+
| m6i3 | 视觉风格统一 | 1 |
|
|
98
|
+
|
|
99
|
+
> 各子项**判断规则**与**评分规则**全文见后端 `website_guide.py`;Agent 须按 HTML/Lighthouse 证据打分,不得照抄示例分。
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
| 文件 | 用途 |
|
|
41
41
|
| ---- | ---- |
|
|
42
42
|
| `analytics/account-analytics.md` | 拉数、数据时效性、诊断模板 |
|
|
43
|
+
| `analytics/website-diagnosis-guide.md` | 网站诊断 CLI、6 模块规则、对齐 tso_agent |
|
|
43
44
|
| `analytics/facebook-analysis-guide.md` | Facebook 字段、与 Google 报告对照、撰写清单 |
|
|
44
45
|
| `analytics/google-analysis-batch.md` | 多账户批处理 run/resume/status |
|
|
45
46
|
| `analytics/reporting.md` | TSO 优化报告生成与推送 |
|
|
@@ -64,6 +65,7 @@
|
|
|
64
65
|
| 文件 | 用途 |
|
|
65
66
|
| ---- | ---- |
|
|
66
67
|
| `campaign-create-template.md` / `.json` | 搜索系列 batch 契约 |
|
|
68
|
+
| `website-diagnosis-rules.md` | 网站诊断评分项与 JSON Schema |
|
|
67
69
|
| `pmax-create-template.md` / `.json` | PMax 新建契约 |
|
|
68
70
|
| `pmax-asset-group-template.json` | PMax 素材组 |
|
|
69
71
|
| `pmax-signals-template.json` | PMax 信号 |
|
|
@@ -131,10 +131,10 @@ siluzan-tso config show
|
|
|
131
131
|
**示例:**
|
|
132
132
|
|
|
133
133
|
```
|
|
134
|
-
- 现金充值(单笔):https://www
|
|
135
|
-
- 现金充值(批量):https://www
|
|
136
|
-
- 月结充值: https://www
|
|
137
|
-
- 丝路赞钱包: https://www
|
|
134
|
+
- 现金充值(单笔):https://www.siluzan.com/recharge/pay
|
|
135
|
+
- 现金充值(批量):https://www.siluzan.com/recharge/pay_batch
|
|
136
|
+
- 月结充值: https://www.siluzan.com/recharge/accountBillingQuota
|
|
137
|
+
- 丝路赞钱包: https://www.siluzan.com/recharge/siluzanWallet
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
---
|
|
@@ -359,6 +359,7 @@ siluzan-tso report bing-audience-merged -a <mediaCustomerId> --json-out ./snap-b
|
|
|
359
359
|
| `meta-period-report.md` | Meta(Facebook)周期报告 |
|
|
360
360
|
| `tiktok-period-report.md` | TikTok 周期报告 |
|
|
361
361
|
| `bing-period-report.md` | Bing 周期报告 |
|
|
362
|
+
| `website-diagnosis-report.md` | 网站/落地页诊断(`website-diagnosis`,见 `website-diagnosis-guide.md` P8) |
|
|
362
363
|
| `README.md` | 索引与规则 |
|
|
363
364
|
|
|
364
365
|
`.html` 文件(`report-template.html`、`report-template-academic.html` 等)为 HTML 路线的样式参考。选其他格式时仍以各 `*.md` 纲要为章节清单。
|
|
@@ -207,8 +207,8 @@ siluzan-tso report list -m Google --json-out ./snap
|
|
|
207
207
|
|
|
208
208
|
# 第二步:查看 webUrl
|
|
209
209
|
siluzan-tso config show
|
|
210
|
-
# webUrl: https://www
|
|
210
|
+
# webUrl: https://www.siluzan.com
|
|
211
211
|
|
|
212
212
|
# 第三步:拼接链接(Google 日报)
|
|
213
|
-
# https://www
|
|
213
|
+
# https://www.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
|
|
214
214
|
```
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# 网站诊断(Website Diagnosis)
|
|
2
|
+
|
|
3
|
+
> 对齐 Aiagent-Server `agent/tso_agent`:`getWebsiteDiagnosisData`(`website_diagnosis_tools.py` + `data/website_guide.py`)。
|
|
4
|
+
> **CLI 负责拉数**;**6 模块 × 29 子项评分**由 Agent 按规则 + 采集数据生成 JSON。
|
|
5
|
+
> **最终交付**:与线上一致,为**一份完整 HTML 报告**(TSO 网页由 Vue `WebsiteAnalysisReport/v3` 渲染;Skill/CLI 场景由 Agent 写出 `website-diagnosis-report.html`)。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 与「广告诊断」区分
|
|
10
|
+
|
|
11
|
+
| 能力 | 入口 | 说明 |
|
|
12
|
+
| ---- | ---- | ---- |
|
|
13
|
+
| **网站诊断** | `website-diagnosis collect` | 落地页/官网内容与性能、营销转化、6 模块评分 |
|
|
14
|
+
| **Google 广告账户诊断** | 前端 `/v3/foreign_trade/tso/tool/AdvertisingDiagnosis` | 账户投放健康度,非网站 HTML 评分 |
|
|
15
|
+
| **ARIT 历史分** | `list-accounts` / `website-diagnosis search` | `ma.diagnoseReports` 中 `reportSource=ARIT` 的 `summaryScore` |
|
|
16
|
+
| **账户周期报告** | `google-analysis` + `google-period-report.md` | 投放数据报告,非网站诊断 |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## CLI 命令
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 推荐:一次采集 Lighthouse + 首页 HTML(供 Agent 写报告)
|
|
24
|
+
siluzan-tso website-diagnosis collect --url https://www.example.com --json-out ./snap-web
|
|
25
|
+
|
|
26
|
+
# 仅 Lighthouse(失败不阻断,payload 含 warning)
|
|
27
|
+
siluzan-tso website-diagnosis performance --url https://www.example.com --json-out ./snap-web
|
|
28
|
+
|
|
29
|
+
# 按 diagnoseId 查 ARIT 得分(ID 来自 list-accounts 的 ma.diagnoseReports)
|
|
30
|
+
siluzan-tso website-diagnosis search --ids <id1,id2> --json-out ./snap-web
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
| 子命令 | HTTP | 基址 |
|
|
34
|
+
| ------ | ---- | ---- |
|
|
35
|
+
| `performance` | `GET /api/WebsiteDiagnosisReports/performance?url=` | TSO `apiBaseUrl` |
|
|
36
|
+
| `collect` | 上式 + `POST /download-assets` body `{ urls: [url] }` | TSO + Agent 网关 |
|
|
37
|
+
| `search` | `GET /query/WebsiteDiagnoseReport/search?ids=` | TSO |
|
|
38
|
+
|
|
39
|
+
**Agent 网关**(与 `TSOWebsiteService` 一致):
|
|
40
|
+
|
|
41
|
+
- 生产:`https://agent.mysiluzan.com`
|
|
42
|
+
- CI:`https://agent-ci.mysiluzan.com`
|
|
43
|
+
- 覆盖:`SILUZAN_AGENT_BASE`
|
|
44
|
+
|
|
45
|
+
请求头:`x-client-type: tso`,鉴权与 TSO 相同(JWT / API Key)。
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Agent 标准流程(P8)
|
|
50
|
+
|
|
51
|
+
1. 确认 `website_url`(须可访问,建议含 `https://`;CLI 可自动补全)。
|
|
52
|
+
2. `website-diagnosis collect --url <url> --json-out ./snap-web`(**必须** `--json-out`)。
|
|
53
|
+
3. Read `assets/website-diagnosis-rules.md`(评分规则与 JSON Schema)。
|
|
54
|
+
4. 用脚本读 `writtenFiles[0]` 的 `lighthouse`、`htmlPreview`(或 `--include-html` 时的 `htmlContent`)生成结构化 `data`(见下节输出契约)。
|
|
55
|
+
5. 按 `report-templates/website-diagnosis-report.md` 生成并交付 **`website-diagnosis-report.html`**(单文件、可浏览器打开);**禁止**只给 Markdown 摘要充当终稿。
|
|
56
|
+
6. **禁止编造**未在采集 HTML/Lighthouse 中出现的指标。Lighthouse 缺失时须在 HTML 中醒目说明。
|
|
57
|
+
|
|
58
|
+
**在 TSO Copilot 网页内**:工具返回 `rendered: true` 时,前端已渲染卡片 +「查看详情」全页 HTML,Agent 只需简短确认,**勿重复贴报告正文**(见 tso_agent `prompt.py`)。
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 输出契约(对齐 `getWebsiteDiagnosisData`)
|
|
63
|
+
|
|
64
|
+
工具成功时 `data` 字段结构(Agent 生成或 Copilot `rendered: true` 时前端已渲染,对话侧勿重复贴全文):
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"url": "https://www.example.com",
|
|
69
|
+
"ratingId": "s1",
|
|
70
|
+
"coreIssuesIds": ["ci1", "ci2"],
|
|
71
|
+
"modules": [
|
|
72
|
+
{
|
|
73
|
+
"id": "m1",
|
|
74
|
+
"score": 0,
|
|
75
|
+
"items": [
|
|
76
|
+
{
|
|
77
|
+
"id": "m1i1",
|
|
78
|
+
"score": 0,
|
|
79
|
+
"status": "Excellent",
|
|
80
|
+
"issue": "…",
|
|
81
|
+
"suggestion": "强烈建议:…"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"analyzedAt": "2026-06-02T12:00:00+00:00"
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
| 字段 | 说明 |
|
|
91
|
+
| ---- | ---- |
|
|
92
|
+
| `ratingId` | `s1` 优秀 … `s5` 不建议投放(见规则文档评分等级) |
|
|
93
|
+
| `coreIssuesIds` | 从 `ci1`–`ci10` 选取适用项 |
|
|
94
|
+
| `modules[].id` | `m1`–`m6` 六板块均须出现 |
|
|
95
|
+
| `items[].suggestion` | 较差/需优化/缺失类 status → **「强烈建议:」** 开头;其余 → **「推荐优化:」** |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 六模块一览(29 子项,ID 与 tso_agent 一致)
|
|
100
|
+
|
|
101
|
+
| ID | 名称 | 子项 ID |
|
|
102
|
+
| -- | ---- | ------- |
|
|
103
|
+
| m1 | 网站内容及结构 | m1i1–m1i9 |
|
|
104
|
+
| m2 | 网站性能 | m2i1–m2i5 |
|
|
105
|
+
| m3 | 营销基础与广告落地页 | m3i1、m3i2、m3i4、m3i5(无 m3i3) |
|
|
106
|
+
| m4 | 用户体验与转化 | m4i1–m4i5 |
|
|
107
|
+
| m5 | 媒体广告投放辅助 | m5i1、m5i2、m5i4(无 m5i3) |
|
|
108
|
+
| m6 | 社交媒体辅助 | m6i1–m6i3 |
|
|
109
|
+
|
|
110
|
+
子项满分、判断规则、评分细则见 **`assets/website-diagnosis-rules.md`**(摘自 `tso_agent/data/website_guide.py`)。
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Lighthouse 字段
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"desktop": { "score", "firstContentfulPaint", "firstMeaningfulPaint", "speedIndex" },
|
|
119
|
+
"mobile": { "score", "firstContentfulPaint", "firstMeaningfulPaint", "speedIndex" }
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 优化策略中的复用
|
|
126
|
+
|
|
127
|
+
`tso_agent` 的 `getOptimizationStrategy` 在 `device_2` 等维度会调用**同一** `WebsiteDiagnosisReports/performance`(需 Google 账户 `final-urls`)。与单次网站诊断独立;见 `operations/optimize.md` 与 Google 账户优化策略话术。
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 相关文档
|
|
132
|
+
|
|
133
|
+
- `report-templates/website-diagnosis-report.md` — 用户可见报告结构
|
|
134
|
+
- `assets/website-diagnosis-rules.md` — 规则与 Schema
|
|
135
|
+
- `references/accounts/accounts.md` — ARIT 与 `list-accounts`
|
|
136
|
+
- `references/core/playbooks.md` — **P8**
|
|
137
|
+
- `references/core/tips.md` — `--json-out` 处理顺序
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 高频任务 Playbook(P1–
|
|
1
|
+
# 高频任务 Playbook(P1–P8)
|
|
2
2
|
|
|
3
3
|
> **开始前**:按 `references/core/agent-conventions.md` § 文档加载纪律,Read 各 Playbook 列出的 references(**不因同对话内刚做过其他 Playbook 而跳过**)。
|
|
4
4
|
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
| P5 | 多账户多维度报告 | `analytics/google-analysis-batch.md`、`analytics/account-analytics.md`、`core/tips.md`;可选 `core/subagent-orchestration.md` |
|
|
13
13
|
| P6 | OKKI 周报 | `report-templates/okki-weekly-google-client.md`(全文)、`analytics/account-analytics.md`、`core/tips.md`;可选 `core/subagent-orchestration.md` |
|
|
14
14
|
| P7 | Google 询盘分析 | `report-templates/google-inquiry-analysis.md`(全文)、`analytics/account-analytics.md`、`core/tips.md`、`analytics/geo-continents.json`;可选 `core/subagent-orchestration.md` |
|
|
15
|
+
| P8 | 网站诊断 | `analytics/website-diagnosis-guide.md`、`assets/website-diagnosis-rules.md`、`report-templates/website-diagnosis-report.md`、`core/tips.md` |
|
|
15
16
|
|
|
16
17
|
---
|
|
17
18
|
|
|
@@ -165,3 +166,22 @@ siluzan-tso accounts-digest -m Google -a id1,id2,... --start <S> --end <D> --jso
|
|
|
165
166
|
4. **先 outline 后脚本** → 聚合脚本读 JSON → 计算 8 Sheet 数据。
|
|
166
167
|
5. **国家 → 大洲映射**:脚本读 `references/analytics/geo-continents.json`;Sheet 4 重点国按 `focusCountries`(详见模板「重点国家配置」节),**禁止**硬编码国家名。
|
|
167
168
|
6. **必产 8 Sheet xlsx**:版式以 `report-templates/google-inquiry-analysis.md` 为准;**只能**由 Agent 执行脚本生成,**禁止**假设 `siluzan-tso … excel` 子命令存在。
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## P8 · 网站诊断
|
|
173
|
+
|
|
174
|
+
> **触发**:用户要对某 URL 做网站/落地页诊断、投放前网站评分,或话术含「网站诊断」「落地页质量」(**非** Google 账户 `AdvertisingDiagnosis`)。
|
|
175
|
+
|
|
176
|
+
1. 确认完整 URL(`https://` 可省略,CLI 自动补全)。
|
|
177
|
+
2. 采集原料(**必须** `--json-out`):
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
siluzan-tso website-diagnosis collect --url <url> --json-out ./snap-web
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
3. Read `assets/website-diagnosis-rules.md`;按 outline → JSON 读 `lighthouse` / `htmlPreview`。
|
|
184
|
+
4. 生成与 tso_agent `getWebsiteDiagnosisData` 同结构的 `data`(6 模块、29 子项、`ratingId`、`coreIssuesIds`)。
|
|
185
|
+
5. 按 `report-templates/website-diagnosis-report.md` 写出 **`website-diagnosis-report.html`**(与线上一致的整页 HTML 结构;版式可参考 `report-templates/website-diagnosis-report.html` 骨架或 `report-template.html`)。
|
|
186
|
+
6. Lighthouse 缺失时在 HTML 中说明;Copilot 网页场景若已 `rendered: true` 则勿重复输出报告正文。
|
|
187
|
+
7. 若用户仅需历史 ARIT 分:`list-accounts` 或 `website-diagnosis search --ids <websiteDiagnoseId>`。
|
|
@@ -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
|
|
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
|
|
67
|
+
API Key 获取入口:`https://www.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
70
|
# 第 1 步:让用户报出手机号后,立刻发码(命令立即返回,不会等待输入)
|
|
@@ -129,9 +129,9 @@ siluzan-tso config show
|
|
|
129
129
|
|
|
130
130
|
```
|
|
131
131
|
构建环境 : production
|
|
132
|
-
apiBaseUrl : https://tso-api
|
|
133
|
-
googleApiUrl : https://googleapi
|
|
134
|
-
webUrl : https://www
|
|
132
|
+
apiBaseUrl : https://tso-api.siluzan.com
|
|
133
|
+
googleApiUrl : https://googleapi.mysiluzan.com
|
|
134
|
+
webUrl : https://www.siluzan.com
|
|
135
135
|
apiKey : abcd****1234
|
|
136
136
|
```
|
|
137
137
|
|
|
@@ -53,7 +53,7 @@ siluzan-tso/ # 安装后目录名
|
|
|
53
53
|
|
|
54
54
|
- 从 SKILL.md **只链接一层**(`references/foo.md`),避免 A→B→C 链式引用。
|
|
55
55
|
- 路径用正斜杠,不用 Windows 反斜杠。
|
|
56
|
-
- 占位符 `https://www
|
|
56
|
+
- 占位符 `https://www.siluzan.com`、`https://tso-api.siluzan.com`、`npm install -g siluzan-tso-cli` 由构建脚本替换,文档中禁止硬编码环境 URL。
|
|
57
57
|
|
|
58
58
|
---
|
|
59
59
|
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
| `bing-period-report.md` | Bing(BingV2)分析报告 |
|
|
25
25
|
| `okki-weekly-google-client.md` | **OKKI 周报**:Google 发客户固定话术 + 精简维度 CLI;**Excel 仅 Agent 脚本**,见 `references/core/playbooks.md` P6 |
|
|
26
26
|
| `google-inquiry-analysis.md` | **Google 询盘分析**:严格 3 个月 + 用户询盘 + 8 Sheet xlsx,见 `references/core/playbooks.md` P7 |
|
|
27
|
+
| `website-diagnosis-report.md` / `.html` | **网站诊断**:终稿为 **HTML**(对齐 TSO `WebsiteAnalysisReport/v3`);配合 `website-diagnosis collect`,见 P8 |
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<!--
|
|
3
|
+
网站诊断报告 HTML 骨架(对齐 siluzan-front-end-v2 WebsiteAnalysisReport/v3)
|
|
4
|
+
|
|
5
|
+
Agent 生成终稿时:
|
|
6
|
+
1. 用 website-diagnosis collect + 规则 JSON 填充各 section
|
|
7
|
+
2. 版式可参考同目录 report-template.html(Tailwind + ECharts CDN)
|
|
8
|
+
3. 勿删除下列 section 结构;可增图表与样式
|
|
9
|
+
-->
|
|
10
|
+
<html lang="zh-CN">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="UTF-8" />
|
|
13
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
14
|
+
<title>网站诊断报告</title>
|
|
15
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
16
|
+
</head>
|
|
17
|
+
<body class="bg-slate-50 text-slate-800">
|
|
18
|
+
<!-- ReportHeader -->
|
|
19
|
+
<header class="bg-white shadow-sm px-6 py-8 max-w-5xl mx-auto mt-6 rounded-lg">
|
|
20
|
+
<h1 class="text-2xl font-bold text-center">网站诊断报告</h1>
|
|
21
|
+
<p class="mt-4 text-sm"><span class="text-slate-500">诊断网址:</span><span id="report-url"></span></p>
|
|
22
|
+
<p class="text-sm"><span class="text-slate-500">诊断时间:</span><span id="report-time"></span></p>
|
|
23
|
+
<p class="text-lg mt-2 font-semibold">
|
|
24
|
+
<span class="text-slate-500">综合得分:</span>
|
|
25
|
+
<span id="report-score" class="text-emerald-600"></span>
|
|
26
|
+
</p>
|
|
27
|
+
</header>
|
|
28
|
+
|
|
29
|
+
<main class="max-w-5xl mx-auto px-4 py-6 space-y-6">
|
|
30
|
+
<!-- HealthOverview -->
|
|
31
|
+
<section id="health-overview" class="bg-white rounded-lg shadow-sm p-6">
|
|
32
|
+
<h2 class="text-lg font-semibold border-b pb-2">健康度总览</h2>
|
|
33
|
+
<div id="health-overview-body" class="mt-4 text-sm"></div>
|
|
34
|
+
</section>
|
|
35
|
+
|
|
36
|
+
<!-- RiskMap -->
|
|
37
|
+
<section id="risk-map" class="bg-white rounded-lg shadow-sm p-6">
|
|
38
|
+
<h2 class="text-lg font-semibold border-b pb-2">核心风险与问题</h2>
|
|
39
|
+
<ul id="core-issues-list" class="mt-4 space-y-3 text-sm"></ul>
|
|
40
|
+
</section>
|
|
41
|
+
|
|
42
|
+
<!-- ModuleDetail (repeat per m1–m6) -->
|
|
43
|
+
<section id="module-details" class="bg-white rounded-lg shadow-sm p-6">
|
|
44
|
+
<h2 class="text-lg font-semibold border-b pb-2">分模块诊断明细</h2>
|
|
45
|
+
<div id="modules-container" class="mt-4 space-y-8"></div>
|
|
46
|
+
</section>
|
|
47
|
+
|
|
48
|
+
<!-- LoadingSpeed -->
|
|
49
|
+
<section id="loading-speed" class="bg-white rounded-lg shadow-sm p-6">
|
|
50
|
+
<h2 class="text-lg font-semibold border-b pb-2">加载速度(Lighthouse)</h2>
|
|
51
|
+
<div id="lighthouse-tables" class="mt-4 overflow-x-auto text-sm"></div>
|
|
52
|
+
</section>
|
|
53
|
+
|
|
54
|
+
<!-- PriorityPlan -->
|
|
55
|
+
<section id="priority-plan" class="bg-white rounded-lg shadow-sm p-6">
|
|
56
|
+
<h2 class="text-lg font-semibold border-b pb-2">优先改进计划</h2>
|
|
57
|
+
<div id="priority-plan-body" class="mt-4 text-sm"></div>
|
|
58
|
+
</section>
|
|
59
|
+
|
|
60
|
+
<!-- LongtermValue -->
|
|
61
|
+
<section id="longterm-value" class="bg-white rounded-lg shadow-sm p-6 mb-8">
|
|
62
|
+
<h2 class="text-lg font-semibold border-b pb-2">投放与长期价值建议</h2>
|
|
63
|
+
<div id="longterm-value-body" class="mt-4 text-sm"></div>
|
|
64
|
+
</section>
|
|
65
|
+
</main>
|
|
66
|
+
|
|
67
|
+
<script>
|
|
68
|
+
// 示例:将 Agent 生成的诊断 JSON 赋给 window.__WEBSITE_DIAGNOSIS__ 后调用 renderReport()
|
|
69
|
+
window.__WEBSITE_DIAGNOSIS__ = window.__WEBSITE_DIAGNOSIS__ || null;
|
|
70
|
+
|
|
71
|
+
function renderReport(data) {
|
|
72
|
+
if (!data) return;
|
|
73
|
+
document.getElementById("report-url").textContent = data.url || "";
|
|
74
|
+
document.getElementById("report-time").textContent = data.analyzedAt || "";
|
|
75
|
+
const score = data.score != null ? data.score : "(待汇总)";
|
|
76
|
+
document.getElementById("report-score").textContent =
|
|
77
|
+
score + " 分 (" + (data.ratingLabel || data.ratingId || "") + ")";
|
|
78
|
+
// TODO: 填充 health-overview、core-issues、modules、lighthouse 等(Agent 生成时写完整逻辑或静态 HTML)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (window.__WEBSITE_DIAGNOSIS__) renderReport(window.__WEBSITE_DIAGNOSIS__);
|
|
82
|
+
</script>
|
|
83
|
+
</body>
|
|
84
|
+
</html>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# 网站诊断报告(交付模板)
|
|
2
|
+
|
|
3
|
+
> **最终交付物:一份可打开的 HTML 文件**(如 `website-diagnosis-report.html`),不是仅 Markdown 摘要。
|
|
4
|
+
> 数据:`website-diagnosis collect` 落盘 JSON + Agent 按 `assets/website-diagnosis-rules.md` 生成的诊断 JSON(与 tso_agent `getWebsiteDiagnosisData` 的 `data` 同结构)。
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 与原业务(TSO 网页 / Copilot)对齐
|
|
9
|
+
|
|
10
|
+
| 环节 | 实现 |
|
|
11
|
+
| ---- | ---- |
|
|
12
|
+
| Agent 工具 | `getWebsiteDiagnosisData` → 返回 JSON + `"rendered": true` |
|
|
13
|
+
| 对话内卡片 | 前端 `AnalysisCard_v3`(摘要:网址、时间、总分) |
|
|
14
|
+
| **完整报告** | 用户点「查看详情」→ `/v3/foreign_trade/tso/websiteAnalysisReport?key=…` → **Vue 整页 HTML**(`WebsiteAnalysisReport/v3`) |
|
|
15
|
+
| 导出 | 报告页内可导出 PDF |
|
|
16
|
+
|
|
17
|
+
**siluzan-tso Skill / 纯 CLI 场景**:无 Vue 运行时,Agent 须**自行生成单文件 HTML**(章节与下表一致),版式可参考 `report-templates/report-template.html` 或 `website-diagnosis-report.html`(骨架)。
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## HTML 章节清单(须全部出现)
|
|
22
|
+
|
|
23
|
+
与前端 `WebsiteAnalysisReport/v3/index.vue` 组件一一对应:
|
|
24
|
+
|
|
25
|
+
| 区块 ID / 组件 | 内容 |
|
|
26
|
+
| -------------- | ---- |
|
|
27
|
+
| `ReportHeader` | 标题「网站诊断报告」、URL、`analyzedAt`、综合得分与等级色 |
|
|
28
|
+
| `HealthOverview` | 总分、行业对比文案、`ratingId` 说明、雷达/概览(可用 ECharts 或静态表) |
|
|
29
|
+
| `RiskMap` | `coreIssuesIds` 展开为风险地图/列表(问题、影响、优先级) |
|
|
30
|
+
| `ModuleDetail` | 6 模块 × 子项:得分、status、issue、suggestion(表格或卡片) |
|
|
31
|
+
| `PriorityPlan` | 高/中/低优先级改进计划(来自核心问题 + 低分子项) |
|
|
32
|
+
| `LoadingSpeed` | `lighthouse` desktop/mobile 指标表;缺失时 callout 说明 |
|
|
33
|
+
| `LongtermValue` | 投放建议、长期优化价值(与 s1–s5 评级一致) |
|
|
34
|
+
|
|
35
|
+
生成前可对 JSON 做与前端相同的聚合逻辑:各模块 `score` = 子项得分之和,总分 = 各模块之和(参见 `siluzan-front-end-v2` → `useWebsiteGuide/utils` → `parseAIResultData`)。
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 样式与文件约定
|
|
40
|
+
|
|
41
|
+
- 单文件 HTML,`lang` 与用户语言一致(默认 `zh-CN`)。
|
|
42
|
+
- 可引用 CDN:Tailwind / ECharts(与 `report-template.html` 相同,见该文件头部说明)。
|
|
43
|
+
- 落盘建议与 `--json-out` 同目录:`website-diagnosis-report.html`。
|
|
44
|
+
- **禁止**只交付 Markdown 或纯 JSON 当作最终报告(JSON 可作为附件或中间产物)。
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 数据字段速查
|
|
49
|
+
|
|
50
|
+
| 字段 | HTML 中的用法 |
|
|
51
|
+
| ---- | ------------- |
|
|
52
|
+
| `url` | 报告头、页脚 |
|
|
53
|
+
| `analyzedAt` | 诊断时间 |
|
|
54
|
+
| `ratingId` | 等级徽章(s1–s5 → 优秀…不建议投放) |
|
|
55
|
+
| `score` | 总分(可由 modules 汇总) |
|
|
56
|
+
| `coreIssuesIds` | RiskMap / 优先改进 |
|
|
57
|
+
| `modules[].id` | m1–m6 分节标题 |
|
|
58
|
+
| `modules[].items[]` | 子项行:诊断项名、得分/满分、issue、suggestion |
|
|
59
|
+
| `lighthouse` / `lighthouseResult` | LoadingSpeed 节(collect payload 为 `lighthouse`) |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 可选附录(非必须单独成章)
|
|
64
|
+
|
|
65
|
+
- 与 Google 账户衔接:引导 `google-analysis` / 广告诊断页(勿混淆两种「诊断」)。
|
|
@@ -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.24
|
|
12
|
+
$PKG_VERSION = '1.1.24'
|
|
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
|
|
15
|
+
$INSTALL_CMD = 'npm install -g siluzan-tso-cli'
|
|
16
|
+
$WEB_BASE = 'https://www.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.24
|
|
12
|
+
readonly PKG_VERSION="1.1.24"
|
|
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
|
|
15
|
+
readonly INSTALL_CMD="npm install -g siluzan-tso-cli"
|
|
16
|
+
readonly WEB_BASE="https://www.siluzan.com"
|
|
17
17
|
|
|
18
18
|
# -- Constants ----------------------------------------------------------------
|
|
19
19
|
readonly NODE_MAJOR_MIN=18
|