siluzan-cso-cli 1.1.30 → 1.1.31-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
@@ -46,7 +46,7 @@
46
46
  在**用户的目标项目根目录**执行(根据用户使用的助手选择 `--ai`):
47
47
 
48
48
  ```bash
49
- npm install -g siluzan-cso-cli
49
+ npm install -g siluzan-cso-cli@beta
50
50
  siluzan-cso init --ai cursor # 写入 Cursor(默认)
51
51
  siluzan-cso init --ai cursor,claude # 同时写入多个平台
52
52
  siluzan-cso init --ai all # 写入所有支持的平台
@@ -54,6 +54,7 @@ siluzan-cso init -d /path/to/skills # 写入自定义目录
54
54
  siluzan-cso init --force # 强制覆盖已存在文件
55
55
  ```
56
56
 
57
+ > **注意**:当前为测试版(1.1.31-beta.2),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-cso-cli`。
57
58
 
58
59
  | 助手 | 建议 `--ai` |
59
60
  | ----------------------- | ------------------------------------ |
package/dist/index.js CHANGED
@@ -3356,11 +3356,11 @@ import { Command } from "commander";
3356
3356
  import { Option } from "commander";
3357
3357
 
3358
3358
  // src/config/defaults.ts
3359
- var BUILD_ENV = "production";
3360
- var DEFAULT_API_BASE = "https://api.siluzan.com";
3361
- var DEFAULT_CSO_BASE = "https://cso.siluzan.com";
3362
- var DEFAULT_WEB_BASE = "https://www.siluzan.com";
3363
- var DEFAULT_AGENT_BASE = "https://agent.mysiluzan.com";
3359
+ var BUILD_ENV = "test";
3360
+ var DEFAULT_API_BASE = "https://api-ci.siluzan.com";
3361
+ var DEFAULT_CSO_BASE = "https://cso-ci.siluzan.com";
3362
+ var DEFAULT_WEB_BASE = "https://www-ci.siluzan.com";
3363
+ var DEFAULT_AGENT_BASE = "https://agent-ci.mysiluzan.com";
3364
3364
 
3365
3365
  // src/commands/init.ts
3366
3366
  import * as fs6 from "fs/promises";
@@ -7812,6 +7812,10 @@ async function runPersonaCreate(options) {
7812
7812
  styleGuide,
7813
7813
  materials: []
7814
7814
  };
7815
+ const platform = (options.platform || "").trim();
7816
+ if (platform) body.mediaType = platform;
7817
+ const knowledgeBaseId = (options.knowledgeBaseId || "").trim();
7818
+ if (knowledgeBaseId) body.knowledgeBaseId = knowledgeBaseId;
7815
7819
  let raw;
7816
7820
  try {
7817
7821
  raw = await apiFetch2(
@@ -8550,12 +8554,17 @@ function registerCsoCommands(program2) {
8550
8554
  ).option(
8551
8555
  "--style-guide-file <path>",
8552
8556
  "\u4ECE\u672C\u5730 markdown \u6587\u4EF6\u8BFB\u53D6 styleGuide\uFF08\u4E0E --style-guide \u4E8C\u9009\u4E00\uFF0C\u957F\u6587\u63A8\u8350\u7528\u6587\u4EF6\uFF09"
8557
+ ).option("--platform <platform>", "\u8FD0\u8425\u5E73\u53F0\uFF08\u53EF\u9009\uFF0C\u5982 douyin / wechat_mp \u7B49\uFF09").option(
8558
+ "--kb-id <id>",
8559
+ "\u9ED8\u8BA4\u77E5\u8BC6\u5E93 id\uFF08\u53EF\u9009\uFF0C\u4ECE\u77E5\u8BC6\u5E93\u521B\u5EFA\u4EBA\u8BBE\u65F6\u4F20\u5165\u5BF9\u5E94\u77E5\u8BC6\u5E93 comid\uFF09"
8553
8560
  ).option("-t, --token <token>", "Token\uFF08\u53EF\u9009\uFF1B\u4F18\u5148\u4E8E ~/.siluzan/config.json\uFF09").option("--verbose", "\u663E\u793A\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F", false).action(
8554
8561
  async (opts) => {
8555
8562
  await runPersonaCreate({
8556
8563
  name: opts.name,
8557
8564
  styleGuide: opts.styleGuide,
8558
8565
  styleGuideFile: opts.styleGuideFile,
8566
+ platform: opts.platform,
8567
+ knowledgeBaseId: opts.kbId,
8559
8568
  token: opts.token,
8560
8569
  verbose: opts.verbose
8561
8570
  });
@@ -2,7 +2,7 @@
2
2
  name: siluzan-cso
3
3
  description: >-
4
4
  丝路赞内容运营平台(CSO)。**凡涉及以下任一类业务,必须先加载并使用本 skill**。
5
- (1) **文案生成与改稿**:选题、爆款拆解、新写成稿(公众号、小红书、**视频口播/字幕/配音/分镜脚本**、博客、改稿润色、评论区回复等)须走 `three-lib-content-workflow/content-writer.workflow.md`;**禁止**直接成稿或聊天润色。
5
+ (1) **文案生成与改稿**:选题、爆款拆解、新写成稿(公众号、小红书、**视频口播/字幕/配音/分镜脚本**、博客、改稿润色、评论区回复等)须走 `three-lib-content-workflow/content-writer.workflow.md`;**单轨 / 多轨**(多轨默认 2 篇、可增减,可主动推断)见 `multi-track.md`;**禁止**直接成稿或聊天润色。
6
6
  **视频脚本 vs 发布 Caption**:口播/字幕/分镜走 content-writer;上传发布框 Caption 走 `overseas-b2b-social-post`。
7
7
  (2) **人设管理**:运营账号人设卡(styleGuide);反推/查询/保存。
8
8
  (3) **发布与运营**(YouTube/TikTok/Instagram/LinkedIn/X/Facebook):OAuth、**账号分组**、发布、任务/重试、upload、**extract-cover**、planning、报表。
@@ -20,7 +20,8 @@ metadata:
20
20
  platforms: YouTube,TikTok,Instagram,LinkedIn,X,Facebook
21
21
  domains: copywriting,persona,publish,account-ops,rag,planning,reporting
22
22
  trigger_keywords: >-
23
- 写文案,写稿,内容创作,出内容,脚本,口播,公众号,博客,外链,引流页,配文,标题,选题,爆款,改稿,润色,审稿,
23
+ 写文案,写稿,内容创作,出内容,脚本,口播,公众号,博客,外链,引流页,配文,标题,选题,爆款,改稿,润色,
24
+ 两版,双版本,多版,多轨,AB稿,对比稿,差异化,各出一版,几个方向,审稿,
24
25
  口语化,保留原意,太生硬,优化表达,帮我改改,优化这段,
25
26
  人设,styleGuide,人设卡,反推人设,persona,三库,
26
27
  发布,publish,上传,upload,封面,extract-cover,截取封面,任务,task,重试,失败,
@@ -82,9 +83,9 @@ Windows 注意:部分 Agent 客户端通过 PowerShell / cmd 代执行命令
82
83
 
83
84
  ## 能力范围
84
85
 
85
- | 业务流程 | 手段 | 说明 |
86
- | -------------- | ------------------------------------------------------- | ------------------------------------ |
87
- | **发布与运营** | 下方 CLI 命令 + `references/*.md` | 上传、发布、任务、报表、账号、规划等 |
86
+ | 业务流程 | 手段 | 说明 |
87
+ | -------------- | ------------------------------------------------------- | ------------------------------------------- |
88
+ | **发布与运营** | 下方 CLI 命令 + `references/*.md` | 上传、发布、任务、报表、账号、规划等 |
88
89
  | **文案生产** | `three-lib-content-workflow/content-writer.workflow.md` | 选题、三库、口播/视频脚本/公众号/成稿、改稿 |
89
90
 
90
91
  两类流程同属 CSO 业务。**海外 B2B 社媒贴文/Caption** 为独立 skill `overseas-b2b-social-post`,不在本包内。
@@ -115,23 +116,23 @@ Windows 注意:部分 Agent 客户端通过 PowerShell / cmd 代执行命令
115
116
 
116
117
  ## 常见业务场景 → 阅读哪个文件
117
118
 
118
- | 用户在做什么 | 先阅读 |
119
- | ----------------------------------------------------------------------------- | ------------------------------------------------------- |
120
- | 首次安装 / 登录 / 更新 | `references/setup.md` |
121
- | 发布视频或图文 | `references/publish.md` |
122
- | 上传素材 | `references/upload.md` |
123
- | 截取视频封面 | `references/extract-cover.md` |
124
- | 文案写完落盘后校验字数 / 检查内部内容泄漏 | `references/validate-content.md` |
125
- | 查发布记录 / 处理失败 | `references/task.md` |
126
- | 查账号数据 / 运营报表 | `references/report.md` |
127
- | 查找账号 ID 或账号详情 | `references/list-accounts.md` |
128
- | 账号 Token 失效 / 重新授权 | `references/authorize.md` |
129
- | 管理账号分组 | `references/account-group.md` |
130
- | AI 内容规划 | `references/planning.md` |
131
- | 需要给用户提供后台页面链接 | `references/web-pages.md` |
132
- | 拉取人设 / styleGuide(写稿前)/ 保存人设 | `references/persona.md` |
133
- | 写稿时检索素材库 RAG 片段(三库拆素材等) | `references/rag.md` |
134
- | 选题 / 三库拆解 / 口播或视频脚本 / 公众号文章 / 改稿润色 / 人设卡 / 反推人设 / 审稿打分 | `three-lib-content-workflow/content-writer.workflow.md` |
119
+ | 用户在做什么 | 先阅读 |
120
+ | ------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
121
+ | 首次安装 / 登录 / 更新 | `references/setup.md` |
122
+ | 发布视频或图文 | `references/publish.md` |
123
+ | 上传素材 | `references/upload.md` |
124
+ | 截取视频封面 | `references/extract-cover.md` |
125
+ | 文案写完落盘后校验字数 / 检查内部内容泄漏 | `references/validate-content.md` |
126
+ | 查发布记录 / 处理失败 | `references/task.md` |
127
+ | 查账号数据 / 运营报表 | `references/report.md` |
128
+ | 查找账号 ID 或账号详情 | `references/list-accounts.md` |
129
+ | 账号 Token 失效 / 重新授权 | `references/authorize.md` |
130
+ | 管理账号分组 | `references/account-group.md` |
131
+ | AI 内容规划 | `references/planning.md` |
132
+ | 需要给用户提供后台页面链接 | `references/web-pages.md` |
133
+ | 拉取人设 / styleGuide(写稿前)/ 保存人设 | `references/persona.md` |
134
+ | 写稿时检索素材库 RAG 片段(三库拆素材等) | `references/rag.md` |
135
+ | 选题 / 三库拆解 / 口播或视频脚本 / 公众号文章 / **单轨或多轨成稿** / 改稿润色 / 人设卡 / 反推人设 / 审稿打分 | `three-lib-content-workflow/content-writer.workflow.md`(多轨 → `multi-track.md`) |
135
136
 
136
137
  ---
137
138
 
@@ -283,6 +284,6 @@ CLI 返回的时间字段(如 `*DateTime` / `*Time` / `createTime` / `publishT
283
284
 
284
285
  > 无对应 CLI 命令的模块,或需要引导用户在网页端查看数据时,查阅 `references/web-pages.md` 获取完整页面清单与链接。
285
286
 
286
- URL 格式:`https://www.siluzan.com/v3/foreign_trade/cso/{页面}`
287
+ URL 格式:`https://www-ci.siluzan.com/v3/foreign_trade/cso/{页面}`
287
288
 
288
289
  常用页面:`task`(任务管理)· `postVideo`(发布页)· `ManageAccounts`(账号管理)· `planning`(AI 内容规划)· `table`(绩效报表)· `Workdata`(作品数据)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "slug": "siluzan-cso",
3
- "version": "1.1.30",
4
- "publishedAt": 1782895422179,
3
+ "version": "1.1.31-beta.2",
4
+ "publishedAt": 1783476515741,
5
5
  "homepage": "https://www.siluzan.com",
6
6
  "source": "https://dev.azure.com/jack4it/Sammamish/_git/siluzan-skill",
7
7
  "requiredBinaries": [
@@ -11,12 +11,12 @@
11
11
 
12
12
  本 Skill 采用 **SKILL 路由 + references 按需加载**;**「按需」= 每个用户任务都要按需,不是整段对话只读一次**。
13
13
 
14
- | 触发 | 动作 |
15
- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
14
+ | 触发 | 动作 |
15
+ | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16
16
  | **任务需锁定企业知识库**(RAG、planning、三库写稿涉及品牌事实等) | **Read** `references/core/knowledge-base-resolution.md`,再读当次域 reference |
17
- | **新的用户任务 / 同对话内换话题**(新账号、新平台、新报表/规划) | 按 `SKILL.md` 命令索引 **重新 Read** 该任务对应的 `references/<域>.md` 后再执行 CLI;**禁止**沿用上一任务的参数记忆——对话会被压缩,「读过」≠ 当前上下文仍含正确字段名与 flags |
18
- | **上下文被压缩 / 记不清字段或命令** | 重读 `SKILL.md` 命令索引 + 当次任务 reference |
19
- | **CLI 返回 400 / 字段对不上** | 回到对应 reference 核对参数名与口径,**勿猜** |
17
+ | **新的用户任务 / 同对话内换话题**(新账号、新平台、新报表/规划) | 按 `SKILL.md` 命令索引 **重新 Read** 该任务对应的 `references/<域>.md` 后再执行 CLI;**禁止**沿用上一任务的参数记忆——对话会被压缩,「读过」≠ 当前上下文仍含正确字段名与 flags |
18
+ | **上下文被压缩 / 记不清字段或命令** | 重读 `SKILL.md` 命令索引 + 当次任务 reference |
19
+ | **CLI 返回 400 / 字段对不上** | 回到对应 reference 核对参数名与口径,**勿猜** |
20
20
 
21
21
  所有 ID、命令 flags、业务数值以**当次 Read 的文档 + 当次 CLI 输出**为准;数值只来自本次 stdout 或脚本读盘结果,不引用对话记忆里的示例值。
22
22
 
@@ -18,10 +18,10 @@ The user has selected a specific enterprise knowledge base for this turn: 「品
18
18
 
19
19
  从该段可解析:
20
20
 
21
- | 字段 | 来源 | 含义 |
22
- | ------ | --------------- | --------------------------------------------------------------------------------------------------------- |
23
- | comid | `comid=…` | 知识库企业目录 ID(与 `rag list` 的 `id`、`planning enterprises` 的 `id` / `folders[].id` **同口径**) |
24
- | 库名 | 「…」中的展示名 | 向用户确认摘要、对话中称呼该库时用 |
21
+ | 字段 | 来源 | 含义 |
22
+ | ----- | --------------- | ------------------------------------------------------------------------------------------------------ |
23
+ | comid | `comid=…` | 知识库企业目录 ID(与 `rag list` 的 `id`、`planning enterprises` 的 `id` / `folders[].id` **同口径**) |
24
+ | 库名 | 「…」中的展示名 | 向用户确认摘要、对话中称呼该库时用 |
25
25
 
26
26
  > **术语**:业务上常叫 comid / 知识库企业 ID / folder id——在本 Skill 中指向**同一 UUID**,只是不同 CLI 命令的参数名不同(见下文映射表)。
27
27
 
@@ -53,24 +53,31 @@ The user has selected a specific enterprise knowledge base for this turn: 「品
53
53
 
54
54
  此时按场景解析:
55
55
 
56
- | 场景 | 命令 | 产出用途 |
57
- | ---------- | ------------------------------------------------------------------------- | ----------------------------------------------------- |
58
- | RAG 检索 | `siluzan-cso rag list --rag-only --json-out ./snap-cso` | 按名称语义匹配 → `--folder-id` |
59
- | 内容规划 | `siluzan-cso planning enterprises [--json-out ./snap-cso]` | 按名称匹配 → `--enterprise-id` + `--enterprise-name` |
56
+ | 场景 | 命令 | 产出用途 |
57
+ | -------- | ---------------------------------------------------------- | ---------------------------------------------------- |
58
+ | RAG 检索 | `siluzan-cso rag list --rag-only --json-out ./snap-cso` | 按名称语义匹配 → `--folder-id` |
59
+ | 内容规划 | `siluzan-cso planning enterprises [--json-out ./snap-cso]` | 按名称匹配 → `--enterprise-id` + `--enterprise-name` |
60
60
 
61
61
  **匹配规则**:语义近似 > 包含关键词;多个近似匹配时让用户选择;**无匹配时如实说明并停止,禁止猜测 ID**(见 `agent-conventions.md`「无结果即停」)。
62
62
 
63
63
  RAG **全库检索**(不传 `--folder-id`)仅当用户意图明确为跨库/公共素材且**未**指定品牌时。
64
64
 
65
+ ### 人设默认知识库(写稿场景兜底)
66
+
67
+ 三库写稿前解析 `--folder-id` 时,若**没有** `<knowledge_base_selection>`、用户本轮也**未**指定知识库,但当前已加载人设的 `knowledgeBaseId` 字段非空 → **默认用它作 `--folder-id`**(该字段即知识库 comid,与本文件其他 ID 同口径),无需再 `rag list`。
68
+
69
+ - 用户本轮明确指定了别的库 / 明确要换库 → 以用户为准,忽略人设默认。
70
+ - 人设 `knowledgeBaseId` 为空 → 回到上方按名称 `rag list` / 全库检索的常规回退。
71
+
65
72
  ---
66
73
 
67
74
  ## 仍须 list / enterprises 的例外
68
75
 
69
- | 情况 | 动作 |
70
- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
71
- | 用户**明确要换**另一家企业/库,与已选不一致 | 重新 `rag list` 或 `planning enterprises` 解析新目标 |
72
- | selection 里只有 `comid=`、无库名,且对话中也取不到展示名 | 只读 `planning enterprises --json-out` 或 `rag list --json-out` **核对名称**(ID 仍用 selection 的 comid,勿重解析 ID) |
73
- | 无 `<knowledge_base_selection>`,用户只给了名称、未给 ID | **必须**走上方「回退」列表命令 |
76
+ | 情况 | 动作 |
77
+ | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
78
+ | 用户**明确要换**另一家企业/库,与已选不一致 | 重新 `rag list` 或 `planning enterprises` 解析新目标 |
79
+ | selection 里只有 `comid=`、无库名,且对话中也取不到展示名 | 只读 `planning enterprises --json-out` 或 `rag list --json-out` **核对名称**(ID 仍用 selection 的 comid,勿重解析 ID) |
80
+ | 无 `<knowledge_base_selection>`,用户只给了名称、未给 ID | **必须**走上方「回退」列表命令 |
74
81
 
75
82
  ---
76
83
 
@@ -78,7 +85,7 @@ RAG **全库检索**(不传 `--folder-id`)仅当用户意图明确为跨库/
78
85
 
79
86
  | 从 selection / list 取得 | RAG(`rag query`) | 规划(`planning generate` / `list` / …) |
80
87
  | ------------------------ | --------------------- | ---------------------------------------- |
81
- | comid(知识库企业 ID) | `--folder-id <comid>` | `--enterprise-id <comid>` |
88
+ | comid(知识库企业 ID) | `--folder-id <comid>` | `--enterprise-id <comid>` |
82
89
  | 库名 / list 的 `name` | 向用户确认摘要时用 | `--enterprise-name` |
83
90
 
84
91
  **禁止混用**:组织 `belong-to-id`、RAG 查询链路上的 `belongToId` / `companyId` **不是** `--enterprise-id` 或 `--folder-id`;规划域细节见 `references/planning.md`「两种企业 ID 勿混用」。
@@ -91,6 +98,9 @@ RAG **全库检索**(不传 `--folder-id`)仅当用户意图明确为跨库/
91
98
  上下文有 <knowledge_base_selection>?
92
99
  ├─ 是 → 取 comid + 库名 → 映射到 --folder-id / --enterprise-id+name → 跳过 list/enterprises
93
100
  │ └─ 用户明确换库?→ 是:走 list/enterprises 解析新目标
94
- └─ 否 → 用户给了可核验 ID?→ 是:直接用
95
- └─ 否:rag list 或 planning enterprises 按名称解析 → 无匹配则停止
101
+ └─ 否 → 用户给了可核验 ID?
102
+ ├─ 是:直接用
103
+ └─ 否 →(写稿场景)当前人设 knowledgeBaseId 非空?
104
+ ├─ 是:用它作 --folder-id
105
+ └─ 否:rag list 或 planning enterprises 按名称解析 → 无匹配则停止
96
106
  ```
@@ -34,7 +34,7 @@ mkdir -p ./snap-cso
34
34
  siluzan-cso list-accounts --media-type YouTube --json-out ./snap-cso
35
35
  node -e "
36
36
  const d = require('./snap-cso/list-accounts-youtube.json');
37
- const rows = Array.isArray(d.items) ? d.items : [];
37
+ const rows = Array.isArray(d.accounts) ? d.accounts : [];
38
38
  rows.forEach((a) => console.log(a.mediaCustomerId, a.mediaCustomerName));
39
39
  "
40
40
  ```
@@ -44,7 +44,7 @@ Windows PowerShell(避免管道传 JSON):
44
44
  ```powershell
45
45
  $SNAP = ".\snap-cso"; New-Item -ItemType Directory -Force -Path $SNAP | Out-Null
46
46
  siluzan-cso list-accounts --media-type YouTube --json-out $SNAP
47
- node -e "const d=require('./snap-cso/list-accounts-youtube.json'); (d.items||[]).forEach(a=>console.log(a.mediaCustomerId, a.mediaCustomerName));"
47
+ node -e "const d=require('./snap-cso/list-accounts-youtube.json'); (d.accounts||[]).forEach(a=>console.log(a.mediaCustomerId, a.mediaCustomerName));"
48
48
  ```
49
49
 
50
50
  ### 2. RAG 检索结果按 score 取 TopN
@@ -56,9 +56,9 @@ const fs = require('fs'), path = require('path');
56
56
  const man = JSON.parse(fs.readFileSync('./snap-cso/cli-manifest.json','utf8'));
57
57
  const art = man.artifacts.find(a => a.section.startsWith('rag-query')) || man.artifacts[0];
58
58
  const d = require(path.join('./snap-cso', art.file));
59
- const hits = d.results || d.items || [];
59
+ const hits = d.output || [];
60
60
  hits.slice().sort((a,b)=>(b.score??0)-(a.score??0)).slice(0,8)
61
- .forEach(h => console.log((h.score??0).toFixed(3), String(h.content||'').slice(0,60)));
61
+ .forEach(h => console.log((h.score??0).toFixed(3), String(h.fields?.content||'').slice(0,60)));
62
62
  "
63
63
  ```
64
64
 
@@ -70,21 +70,34 @@ hits.slice().sort((a,b)=>(b.score??0)-(a.score??0)).slice(0,8)
70
70
  siluzan-cso persona list --json-out ./snap-cso
71
71
  node -e "
72
72
  const d = require('./snap-cso/persona-list.json');
73
- const rows = d.items || d.list || [];
74
- rows.forEach(p => console.log(p.id, p.name, '(styleGuide', String(p.styleGuide||'').length, 'chars)'));
73
+ const rows = d.results || [];
74
+ rows.forEach(p => {
75
+ const len = p.styleGuideChars ?? String(p.styleGuide || '').length;
76
+ console.log(p.id, p.personaName, '(styleGuide', len, 'chars)');
77
+ });
75
78
  "
76
79
  ```
77
80
 
78
- ### 4. 任务列表筛失败项 / 汇总状态
81
+ ### 4. 任务列表筛异常项 / 汇总状态
79
82
 
80
83
  ```bash
81
- siluzan-cso task list --status -1 --json-out ./snap-cso
84
+ siluzan-cso task list --failed-only --json-out ./snap-cso
82
85
  node -e "
83
86
  const d = require('./snap-cso/task-list.json');
84
87
  const list = d.list || [];
85
- const failed = list.filter(t => t.status === 2);
86
- console.log('共', d.total, '任务;本页中止/异常', failed.length, '个');
87
- failed.forEach(t => console.log(' ', t.publishId, t.taskName));
88
+ console.log('共', d.total, '条异常任务');
89
+ list.forEach(t => console.log(' ', t.publishId, t.taskName));
90
+ "
91
+ ```
92
+
93
+ 任务级状态筛选(`0` 执行中 · `1` 已完成 · `2` 已中止)示例:
94
+
95
+ ```bash
96
+ siluzan-cso task list --status 2 --json-out ./snap-cso
97
+ node -e "
98
+ const d = require('./snap-cso/task-list.json');
99
+ console.log('共', d.total, '条已中止任务');
100
+ (d.list || []).forEach(t => console.log(' ', t.publishId, t.taskName));
88
101
  "
89
102
  ```
90
103
 
@@ -94,9 +107,12 @@ failed.forEach(t => console.log(' ', t.publishId, t.taskName));
94
107
  siluzan-cso report fetch --media Douyin --days 7 --json-out ./snap-cso
95
108
  node -e "
96
109
  const fs = require('fs'), path = require('path');
97
- const man = JSON.parse(fs.readFileSync('./snap-cso/cli-manifest.json','utf8'));
98
- const d = require(path.join('./snap-cso', man.artifacts[0].file));
110
+ const manFile = fs.readdirSync('./snap-cso').find(f => f.startsWith('cli-manifest') && f.endsWith('.json'));
111
+ const man = JSON.parse(fs.readFileSync(path.join('./snap-cso', manFile), 'utf8'));
112
+ const art = man.artifacts.find(a => a.section.startsWith('report-fetch')) || man.artifacts[0];
113
+ const d = require(path.join('./snap-cso', art.file));
99
114
  console.log('keys:', Object.keys(d));
115
+ console.log('sections:', Object.keys(d.sections || {}));
100
116
  "
101
117
  ```
102
118
 
@@ -117,7 +133,7 @@ siluzan-cso list-accounts --media-type YouTube --json-out ./snap-cso
117
133
  node -e "
118
134
  const d = require('./snap-cso/list-accounts-youtube.json');
119
135
  console.log('keys:', Object.keys(d));
120
- console.log('itemCount:', (d.items||[]).length, 'sample:', d.items && d.items[0] && Object.keys(d.items[0]));
136
+ console.log('accountCount:', (d.accounts||[]).length, 'sample:', d.accounts && d.accounts[0] && Object.keys(d.accounts[0]));
121
137
  "
122
138
  ```
123
139
 
@@ -3,7 +3,7 @@
3
3
  对应 Web / MarkAI `getPersonas()`、`addPersona()`:
4
4
 
5
5
  - 列表:`POST {csoBaseUrl}/cso/v1/platformdata/GetPersonas`,请求体 `{}`
6
- - 新建:`POST {csoBaseUrl}/cso/v1/platformdata/AddPersona`,请求体 `{ personaName, styleGuide, materials: [] }`
6
+ - 新建:`POST {csoBaseUrl}/cso/v1/platformdata/AddPersona`,请求体 `{ personaName, styleGuide, materials: [] }`(可选带 `mediaType`(运营平台)、`knowledgeBaseId`(默认知识库 id),仅在传入时携带)
7
7
 
8
8
  返回人设含 **`styleGuide`**(Markdown 风格指南)、`materials`、`taskStatus` 等,供文案与三库工作流使用。
9
9
 
@@ -23,7 +23,9 @@ siluzan-cso persona list [选项]
23
23
  | `--unicode` | 表格使用 Unicode 线框 |
24
24
  | `--verbose` | 打印详细错误 |
25
25
 
26
- 终端表格仅展示 `styleGuide` 摘要;需要全文时用 `--json-out` 落盘后脚本读盘(见 `references/core/tips.md`)。
26
+ 终端表格仅展示 `styleGuide` 摘要;需要全文时用 `--json-out` 落盘后脚本读盘。
27
+
28
+ > **【硬规范·执行前必读】调用 `persona list` 前,必须先 Read `references/core/tips.md`(例 #3 为人设专用「`--json-out` 落盘 + `node -e` 读盘」脚本)。** `styleGuide` 通常每条数千字,一律落盘后用脚本读取需要的字段,**禁止**把全文吐到 stdout(会被宿主 bash 工具截断、丢记录、触发翻页死循环)。未读 tips.md、直接对 stdout 处理 `styleGuide` 视为违规。
27
29
 
28
30
  > **⚠️ 列全量列表用 `--json-out` 落盘即可(不再有截断风险)。** `styleGuide` 通常每条数千字,旧 `--json` 直吐到 stdout 动辄数万字符、
29
31
  > 极易被宿主 bash 工具从中间截断丢记录——这正是 `--json` 被移除、改 `--json-out` 落盘的原因。
@@ -33,7 +35,13 @@ siluzan-cso persona list [选项]
33
35
  `--no-style-guide` 模式下每条记录形如(去掉 `styleGuide`,新增 `styleGuideChars`):
34
36
 
35
37
  ```json
36
- { "id": "...", "personaName": "...", "taskStatus": 3, "materials": [], "styleGuideChars": 5837 }
38
+ {
39
+ "id": "...",
40
+ "personaName": "...",
41
+ "taskStatus": 3,
42
+ "materials": [],
43
+ "styleGuideChars": 5837
44
+ }
37
45
  ```
38
46
 
39
47
  ## 命令二:保存人设到平台
@@ -47,9 +55,15 @@ siluzan-cso persona create --name <名称> ( --style-guide <markdown> | --style-
47
55
  | `--name <name>` | **必填**。人设名称,长度上限 60 字符 |
48
56
  | `--style-guide <markdown>` | 直接传入 styleGuide markdown 内容(与 `--style-guide-file` 二选一) |
49
57
  | `--style-guide-file <path>` | 从本地 markdown 文件读取 styleGuide(长文推荐用文件,与 `--style-guide` 二选一) |
58
+ | `--platform <platform>` | 可选。运营平台(如 `douyin` / `wechat_mp` 等),映射到请求体 `mediaType`,仅在传入时携带 |
59
+ | `--kb-id <id>` | 可选。默认知识库 id(从知识库创建人设时传入对应知识库 comid),映射到请求体 `knowledgeBaseId`,仅在传入时携带 |
50
60
  | `-t, --token <token>` | 凭据(可选) |
51
61
  | `--verbose` | 打印详细错误 |
52
62
 
63
+ > `--platform` → CSO `AddPersona` 的 `mediaType`(社媒平台),`--kb-id` → `knowledgeBaseId`(默认知识库 id)。二者均为可选,仅在你显式传值时才带上。
64
+
65
+ > **建卡可选绑库**:非从知识库反推创建人设时,可先 `siluzan-cso rag list` 让用户选一个默认知识库绑定(用户可不绑),保存时带 `--kb-id`;从知识库合成的人设直接用合成所用库的 comid。详见 `three-lib-content-workflow/persona-onboarding.md`。
66
+
53
67
  > `persona create` 为写入命令,仅输出简洁人类可读确认(含新建人设 `id`),不再支持 JSON 输出。
54
68
 
55
69
  > **CLI 不会替你生成 styleGuide**。AI 助手在调用本命令前,应先按
@@ -73,12 +87,16 @@ siluzan-cso persona create --name <名称> ( --style-guide <markdown> | --style-
73
87
  | `personaName` | 人设名称 |
74
88
  | `styleGuide` | 风格指南正文(Markdown) |
75
89
  | `materials` | 参考素材(文件名、URL 等),新建时固定传空数组 |
90
+ | `mediaType` | 运营平台 / 社媒平台(可选,仅新建时透传) |
91
+ | `knowledgeBaseId` | 默认知识库 id(可选,仅新建时透传) |
76
92
  | `taskStatus` | `1` 待生成 · `2` 生成中 · `0`或`3` 生成完成 · `4` 生成失败 |
77
93
  | `createdDateTime` | **UTC** 时间字符串 |
78
94
  | `lastChangedDateTime` | **UTC** 时间字符串 |
79
95
 
80
96
  > 时间字段展示前必须做时区转换,详见 SKILL.md 「时间字段输出约定(全局)」。
81
97
 
98
+ > **`knowledgeBaseId` 的写稿用途**:拿到目标人设后,若其 `knowledgeBaseId` 非空、且用户本轮未另行指定知识库、上下文也无当前已选库,写稿检索默认以该 id 作 `rag query --folder-id`(它就是知识库 comid)。优先级详见 `references/core/knowledge-base-resolution.md`。
99
+
82
100
  ## 与 Skill 的关系
83
101
 
84
102
  编写口播/成稿前应先拿到目标人设的 `styleGuide`,再结合 `three-lib-content-workflow/` 中的 SOP。
@@ -70,10 +70,10 @@
70
70
 
71
71
  业务上都叫「企业 ID」,CLI 里对应**两个不同字段**,混用会导致查不到企业或生成失败。
72
72
 
73
- | 名称 | 出现位置 | 含义 | 用于 |
74
- | ----------------- | ------------------------------------------------------ | -------------------------------------------------------------- | -------------------------------------------------------------------- |
73
+ | 名称 | 出现位置 | 含义 | 用于 |
74
+ | ----------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------- |
75
75
  | **知识库企业 ID** | `<knowledge_base_selection>` 中的 `comid=`;或 `planning enterprises` 的 `id` | 知识库里的企业目录 ID(**comid**) | `planning generate --enterprise-id`、`planning list --enterprise-id` |
76
- | **组织归属 ID** | `planning enterprises --belong-to-id` | 当前登录账号所属组织(类似 RAG 的 `belongToId` / `companyId`) | **仅**查询企业目录时的筛选参数 |
76
+ | **组织归属 ID** | `planning enterprises --belong-to-id` | 当前登录账号所属组织(类似 RAG 的 `belongToId` / `companyId`) | **仅**查询企业目录时的筛选参数 |
77
77
 
78
78
  **需要解析企业时(无 `<knowledge_base_selection>`):**
79
79
 
@@ -198,19 +198,19 @@ siluzan-cso planning export txt --plan-id <planId> -o plan.txt
198
198
 
199
199
  ## 命令速查
200
200
 
201
- | 命令 | 说明 |
202
- | ------------------------------- | --------------------------------------------------------- |
201
+ | 命令 | 说明 |
202
+ | ------------------------------- | ---------------------------------------------------------------- |
203
203
  | `planning enterprises` | 查询企业目录(无 `<knowledge_base_selection>` 时生成前先选企业) |
204
- | `planning content-types` | 查询可用内容类型(post / video) |
205
- | `planning generate` | 创建规划生成任务 |
206
- | `planning watch <taskId>` | 监听生成任务进度(SSE 实时推送) |
207
- | `planning list` | 查询规划任务列表 |
208
- | `planning get <planId>` | 获取规划详情 |
209
- | `planning regenerate <planId>` | 对已有规划重新生成 |
210
- | `planning task cancel <taskId>` | 取消任务 |
211
- | `planning task retry <taskId>` | 重试失败/取消的任务 |
212
- | `planning task delete <taskId>` | 删除任务 |
213
- | `planning export txt` | 导出规划为 TXT(Markdown 表格格式) |
204
+ | `planning content-types` | 查询可用内容类型(post / video) |
205
+ | `planning generate` | 创建规划生成任务 |
206
+ | `planning watch <taskId>` | 监听生成任务进度(SSE 实时推送) |
207
+ | `planning list` | 查询规划任务列表 |
208
+ | `planning get <planId>` | 获取规划详情 |
209
+ | `planning regenerate <planId>` | 对已有规划重新生成 |
210
+ | `planning task cancel <taskId>` | 取消任务 |
211
+ | `planning task retry <taskId>` | 重试失败/取消的任务 |
212
+ | `planning task delete <taskId>` | 删除任务 |
213
+ | `planning export txt` | 导出规划为 TXT(Markdown 表格格式) |
214
214
 
215
215
  ---
216
216
 
@@ -240,8 +240,8 @@ siluzan-cso planning enterprises --belong-to-id <组织归属ID>
240
240
 
241
241
  | 参数 | 必填 | 说明 |
242
242
  | -------------------------------- | ---- | -------------------------------------------------------------------------------------------------------------------------- |
243
- | `--enterprise-id` | ✅ | 知识库企业 ID(`<knowledge_base_selection>` 中的 `comid=`,或 `planning enterprises` 的 `id`;**不是** `--belong-to-id`) |
244
- | `--enterprise-name` | ✅ | 企业名称(`<knowledge_base_selection>` 中的库名,或 `planning enterprises` 的 `name`,须与 `--enterprise-id` 配套) |
243
+ | `--enterprise-id` | ✅ | 知识库企业 ID(`<knowledge_base_selection>` 中的 `comid=`,或 `planning enterprises` 的 `id`;**不是** `--belong-to-id`) |
244
+ | `--enterprise-name` | ✅ | 企业名称(`<knowledge_base_selection>` 中的库名,或 `planning enterprises` 的 `name`,须与 `--enterprise-id` 配套) |
245
245
  | `--year-month` | ✅ | 规划月份,格式 `YYYY-MM` |
246
246
  | `--content-types` | ✅ | 内容类型,支持逗号或空格:`post`(图文)/ `video`(视频) |
247
247
  | `--freq-unit` | — | 发布频率单位:`week` / `month`;与 `--freq-count` **须同时提供**(只传其一 CLI 报错) |
@@ -236,7 +236,7 @@ siluzan-cso publish -c publish-config.json
236
236
 
237
237
  > 查询发布状态、处理失败项 → 参见 `references/task.md`
238
238
 
239
- 前往 CSO 任务管理页面查看进度:`https://www.siluzan.com/v3/foreign_trade/cso/task`
239
+ 前往 CSO 任务管理页面查看进度:`https://www-ci.siluzan.com/v3/foreign_trade/cso/task`
240
240
 
241
241
  ---
242
242
 
@@ -1,6 +1,6 @@
1
1
  # rag:RAG 知识库检索
2
2
 
3
- 知识库管理页面在https://www.siluzan.com/knowledge-base/
3
+ 知识库管理页面在https://www-ci.siluzan.com/knowledge-base/
4
4
 
5
5
  用于写稿、产品知识问答、三库素材提取等场景;凡回答依赖「本企业已入库素材」且不应凭模型记忆编造时,优先走 RAG。
6
6
 
@@ -3,7 +3,7 @@
3
3
  ## 安装 CLI
4
4
 
5
5
  ```bash
6
- npm install -g siluzan-cso-cli
6
+ npm install -g siluzan-cso-cli@beta
7
7
  ```
8
8
 
9
9
  环境要求:Node.js 18+
@@ -46,7 +46,7 @@ siluzan-cso config set --token <Token> # 备用:设置 JWT Token
46
46
 
47
47
  > **⚠️ 不要使用 `config set --token <token>` 的方式。** 该方式会将 Token 明文写入 shell history(`~/.bash_history`、`~/.zsh_history`、PowerShell 历史),存在凭证泄露风险。推荐使用 `siluzan-cso login` 交互式输入。
48
48
 
49
- API Key 获取入口:`https://www.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
49
+ API Key 获取入口:`https://www-ci.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
50
50
 
51
51
  ### 通过手机号 + 验证码登录(对话式 AI 推荐)
52
52
 
@@ -123,8 +123,8 @@ siluzan-cso config show
123
123
 
124
124
  ```
125
125
  构建环境 : production
126
- apiBaseUrl : https://api.siluzan.com
127
- csoBaseUrl : https://cso.siluzan.com
126
+ apiBaseUrl : https://api-ci.siluzan.com
127
+ csoBaseUrl : https://cso-ci.siluzan.com
128
128
  apiKey : abcd****1234
129
129
  ```
130
130
 
@@ -111,4 +111,5 @@ siluzan-cso workflow validate -f draft.md --max 800 --json
111
111
  ## 交叉引用
112
112
 
113
113
  - 成稿创作流程 → `three-lib-content-workflow/content-writer.workflow.md`
114
+ - **多轨成稿** → 各轨成稿各 validate 一次;见 `three-lib-content-workflow/multi-track.md`
114
115
  - 成稿落盘与呈现约定 → 同上「输出」一节