@deepwhale-cn/dsh-douyin-desk 0.2.2 → 0.2.3

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/lib/index.js CHANGED
@@ -26,9 +26,10 @@ import {
26
26
  import path from 'node:path';
27
27
  import { readFileSync } from 'node:fs';
28
28
  import { execFile } from 'node:child_process';
29
+ import { fileURLToPath } from 'node:url';
29
30
 
30
31
  export const name = 'douyin-desk';
31
- export const inject = ['tools', 'webServer', 'llm'];
32
+ export const inject = ['tools', 'webServer', 'llm', 'skills'];
32
33
 
33
34
  const TEXT_OUTPUT = {
34
35
  schema: { type: 'string' },
@@ -154,6 +155,24 @@ export function apply(ctx, config) {
154
155
  if (typeof config.model === 'string' && config.model) MODEL.model = config.model;
155
156
  }
156
157
 
158
+ // ── 技能:让 agent 知道「什么时候用、怎么用」,跟面板互补 ──
159
+ try {
160
+ if (ctx.skills && typeof ctx.skills.register === 'function') {
161
+ const skillPath = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'skill', 'douyin-review.md');
162
+ const content = readFileSync(skillPath, 'utf8');
163
+ ctx.skills.register({
164
+ name: 'douyin-desk',
165
+ source: 'bundled',
166
+ description: '深鲸抖音复盘:同步抖音作品/文案/收藏到本地,做互动复盘、选题、发布包、AI 改写与发布前体检(只读)。',
167
+ whenToUse: '当用户要看抖音数据、复盘作品、从数据里找选题、生成发布包、改写文案或做发布前体检时使用。',
168
+ content,
169
+ });
170
+ }
171
+ } catch (error) {
172
+ // 技能是附加能力,注册失败不影响面板与工具
173
+ ctx.logger?.warn?.(`[douyin-desk] 技能注册失败:${error instanceof Error ? error.message : String(error)}`);
174
+ }
175
+
157
176
  const readJsonBody = async (req) => {
158
177
  const chunks = [];
159
178
  let total = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepwhale-cn/dsh-douyin-desk",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "深鲸抖音复盘:同步账号作品、文案与收藏到本地,做互动复盘、发布节奏分析、文案库与周报;只读,不发布、不互动。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -16,7 +16,8 @@
16
16
  "cordis.patch.yml",
17
17
  "README.md",
18
18
  "LICENSE",
19
- "icon.svg"
19
+ "icon.svg",
20
+ "skill"
20
21
  ],
21
22
  "keywords": [
22
23
  "dsh-plugin",
@@ -0,0 +1,35 @@
1
+ # 深鲸抖音复盘 · 使用技能
2
+
3
+ 当用户要**看抖音数据、复盘作品、找选题、写发布包、检查文案**时用本技能。
4
+ 数据来自官方 `douyin-open-cli`(扫码授权,1 天有效),本插件只读:不发布、不评论、不点赞。
5
+
6
+ ## 先确认状态
7
+
8
+ 调用 `douyin_status`:
9
+ - 未安装 CLI:先让用户按官方指南安装(`~/.local/bin/douyin-open-cli`),不要自己编数据;
10
+ - 未登录/过期:让用户打开「深鲸抖音复盘」面板点「扫码授权」,或终端 `douyin-open-cli auth login`;
11
+ - 已登录:继续。
12
+
13
+ ## 常规流程
14
+
15
+ 1. **同步**:`douyin_sync`(默认 10 页 × 30 条,会顺带同步收藏)。同步是只读的,放心跑。
16
+ 2. **看盘**:`douyin_analyze` 给出作品数、累计互动、近 7 天发布、最常发布时段、上帧增量。
17
+ 3. **列作品**:`douyin_list`(sort=time|digg)拿清单;要正文用 `douyin_text` 取(会缓存)。
18
+ 4. **推选题**:`douyin_ideas` 返回续集/重发/补做/对标四类,每条带数据依据。**不要自己编选题**,先看它给了什么。
19
+ 5. **出发布包**:`douyin_kit`(参数 idea=选题一句话),产出标题、三个开头、结构、话题、封面文字、发布前清单。
20
+ 6. **改文案**:`douyin_rewrite`(mode: hooks/titles/rewrite/topics/script;script 用 idea),产出直接可用的文本。
21
+ 7. **发布前体检**:`douyin_check`(text=文案),按极限词/承诺词/话题数/首句长度打分并给逐条改法。
22
+ 体检有 warn 项就先改再发;这是广告法红线,不是建议。
23
+
24
+ ## 表达口径
25
+
26
+ - 不写"绝对/第一/最"这类词;
27
+ - 数据只说接口实际给的(赞/评/藏/转),**不要编播放量**;
28
+ - 收藏作品官方不返回他人文案,不要声称"读过对标文案";
29
+ - 用户问"能不能帮我发/回评论"——明确说官方暂未开放写接口,我们不做模拟点击。
30
+
31
+ ## 边界
32
+
33
+ - 不要调用任何写接口、不要模拟浏览器操作抖音;
34
+ - 授权过期只需重新扫码,本地已同步的数据不会丢(`~/.douyin-desk/`);
35
+ - 新用户本地为空是正常的,不是故障。