@cloud411716/fancy-webnovel 4.11.0 → 4.11.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/docs/douyin-plugin.md +2 -0
- package/package.json +1 -1
- package/plugins/fancy-douyin/index.js +11 -10
package/docs/douyin-plugin.md
CHANGED
|
@@ -144,6 +144,8 @@ FANCY_DOUYIN_SUBAGENTS=0 # 关闭子 Agent,回退单 Agent 串行
|
|
|
144
144
|
|
|
145
145
|
子 Agent 不操作 Chrome,不修改 `crawled.json`,不运行 `import.js`,也不直接写素材数据库;数据库导入和采集状态只由父进程串行处理,避免并发覆盖。
|
|
146
146
|
|
|
147
|
+
子 Agent 是独立的新会话,不继承父 Agent 当前对话。因此 `.tmp` 临时文件规则和“不要删除测试文件/不要执行 rm”的约束会直接写进子 Agent 任务提示,而不是依赖父对话。
|
|
148
|
+
|
|
147
149
|
## 素材格式
|
|
148
150
|
|
|
149
151
|
每篇作品的 LLM 输出写到:
|
package/package.json
CHANGED
|
@@ -692,6 +692,10 @@ function subagentTaskPrompt(job, root, materialTools) {
|
|
|
692
692
|
'你是 fancy-douyin 的分析子 Agent,只处理下面这一篇作品。',
|
|
693
693
|
'不要扫描账号,不要启动或操作 Chrome,不要修改 crawled.json,不要运行 import.js 或直接写素材数据库。',
|
|
694
694
|
'只读取给定文件,按提示词提取素材,写入目标 JSONL,运行 validate.js 后结束。',
|
|
695
|
+
'如果需要创建测试文件,放在当前项目的 `.tmp` 目录下(绝对路径:`' + path.join(root, '.tmp') + '`),并且测试后不需要删除测试文件。',
|
|
696
|
+
'禁止执行 rm、rmdir、find -delete、git clean 等删除命令,也不要删除已有文件。',
|
|
697
|
+
'',
|
|
698
|
+
'以下是本作品的完整分析提示词,必须逐条遵守(包括提取规则、字段要求、清单逐条规则、同风格扩写和校验命令):',
|
|
695
699
|
'',
|
|
696
700
|
analysisPromptForJob(job, root, materialTools),
|
|
697
701
|
].join('\n');
|
|
@@ -964,8 +968,8 @@ async function runCrawl(ctx, invocation, session, taskList) {
|
|
|
964
968
|
let aborted = false;
|
|
965
969
|
|
|
966
970
|
const progressText = () => queue
|
|
967
|
-
?
|
|
968
|
-
:
|
|
971
|
+
? `分析素材(子 Agent 并行:${queueStats.finished}/${queueStats.queued},并发 ${subagentWorkers})`
|
|
972
|
+
: `分析素材(${queueStats.finished}/${jobs.length})`;
|
|
969
973
|
|
|
970
974
|
const jobRecord = (job, extra = {}) => ({
|
|
971
975
|
account_url: job.accountUrl,
|
|
@@ -1064,6 +1068,7 @@ async function runCrawl(ctx, invocation, session, taskList) {
|
|
|
1064
1068
|
}
|
|
1065
1069
|
if (queue) {
|
|
1066
1070
|
queueStats.queued += 1;
|
|
1071
|
+
if (taskList.index < 4) taskList.advance(4);
|
|
1067
1072
|
queue.push(job);
|
|
1068
1073
|
taskList.progress(progressText());
|
|
1069
1074
|
} else {
|
|
@@ -1104,10 +1109,6 @@ async function runCrawl(ctx, invocation, session, taskList) {
|
|
|
1104
1109
|
workerPromises = queue
|
|
1105
1110
|
? Array.from({ length: subagentWorkers }, () => runWorker())
|
|
1106
1111
|
: [];
|
|
1107
|
-
if (queue) {
|
|
1108
|
-
taskList.progress(progressText());
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
1112
|
outer:
|
|
1112
1113
|
for (const account of accounts) {
|
|
1113
1114
|
if (abortRequested(invocation)) { aborted = true; break; }
|
|
@@ -1188,7 +1189,7 @@ async function runCrawl(ctx, invocation, session, taskList) {
|
|
|
1188
1189
|
foundNotes += notes.length;
|
|
1189
1190
|
foundVideos += videos.length;
|
|
1190
1191
|
foundArticles += articles.length;
|
|
1191
|
-
taskList.advance(3);
|
|
1192
|
+
if (taskList.index < 3) taskList.advance(3);
|
|
1192
1193
|
|
|
1193
1194
|
for (const card of notes) {
|
|
1194
1195
|
if (abortRequested(invocation)) { aborted = true; break outer; }
|
|
@@ -1430,8 +1431,8 @@ async function runCrawl(ctx, invocation, session, taskList) {
|
|
|
1430
1431
|
|
|
1431
1432
|
processedWorks += 1;
|
|
1432
1433
|
video.account_url = account.url;
|
|
1433
|
-
taskList.advance(4);
|
|
1434
|
-
taskList.progress(
|
|
1434
|
+
if (taskList.index < 4) taskList.advance(4);
|
|
1435
|
+
taskList.progress(`分析素材(视频前 5 秒筛选:${video.title || videoId})`);
|
|
1435
1436
|
const relevance = await analyzeVideoRelevance(ctx, invocation, session, {
|
|
1436
1437
|
root,
|
|
1437
1438
|
accountUrl: account.url,
|
|
@@ -1705,7 +1706,7 @@ function douyinTaskTitles(invocation) {
|
|
|
1705
1706
|
'LLM 能力自检(图片 / 视频)',
|
|
1706
1707
|
'扫描账号主页',
|
|
1707
1708
|
'采集图文 / 视频 / 文章作品',
|
|
1708
|
-
'
|
|
1709
|
+
'分析素材',
|
|
1709
1710
|
'写入素材库',
|
|
1710
1711
|
];
|
|
1711
1712
|
}
|