@cloud411716/fancy-webnovel 0.3.4 → 0.3.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud411716/fancy-webnovel",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -79,6 +79,7 @@ export async function apply(ctx) {
79
79
  // ---------- 串行采集 ----------
80
80
  let allFiles = [];
81
81
  let failed = 0;
82
+ let lastReceipt = null;
82
83
 
83
84
  for (const rank of unique) {
84
85
  const stop = startActivity(session);
@@ -119,20 +120,27 @@ export async function apply(ctx) {
119
120
  failed++;
120
121
  continue;
121
122
  }
122
- const files = receipt.scan_files || [];
123
- allFiles = allFiles.concat(files);
124
-
125
- // 逐个文件追加到 topic_decision
126
- const topicFile = receipt.topic_decision || '';
127
- if (topicFile) {
128
- notify(session, scan.notify({ type: 'handover', platform, files, topicFile, projectRoot }));
129
- const prompt = scan.llmAnalysisPrompt({ platform, date: receipt.date || '', files, topicFile, projectRoot });
130
- llmFollowup(invocation, prompt);
131
- }
123
+ lastReceipt = receipt;
124
+ allFiles = allFiles.concat(receipt.scan_files || []);
132
125
  }
133
126
 
134
- if (failed > 0 && allFiles.length === 0) {
135
- return { kind: 'success', text: '' };
127
+ // ---------- 全部采集完成后统一输出 ----------
128
+ if (allFiles.length > 0 && lastReceipt) {
129
+ notify(session, scan.notify({
130
+ type: 'handover',
131
+ platform,
132
+ files: allFiles,
133
+ topicFile: lastReceipt.topic_decision || '',
134
+ projectRoot,
135
+ }));
136
+ const prompt = scan.llmAnalysisPrompt({
137
+ platform,
138
+ date: lastReceipt.date || '',
139
+ files: allFiles,
140
+ topicFile: lastReceipt.topic_decision || '',
141
+ projectRoot,
142
+ });
143
+ llmFollowup(invocation, prompt);
136
144
  }
137
145
 
138
146
  return { kind: 'success', text: '' };