@cloud411716/fancy-webnovel 0.1.72 → 0.1.73
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 +1 -1
- package/plugins/fancy-scan/index.js +11 -19
package/package.json
CHANGED
|
@@ -109,25 +109,16 @@ export async function apply(ctx) {
|
|
|
109
109
|
|
|
110
110
|
notify(session, scan.notify({ type: 'collecting', platform, length }));
|
|
111
111
|
|
|
112
|
-
//
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
name: 'fancy-scan/progress',
|
|
123
|
-
arguments: JSON.stringify({ platform, length, step: count }),
|
|
124
|
-
});
|
|
125
|
-
notify(session, `[TEST] tool/call #${count} 发送于采集阶段`);
|
|
126
|
-
}, i * 800);
|
|
127
|
-
timers.push(t);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
// ─── TEST 结束 ───────────────────────────────────────────────────────
|
|
112
|
+
// 采集过程中持续更新 status bar
|
|
113
|
+
let step = 0;
|
|
114
|
+
const tick = setInterval(() => {
|
|
115
|
+
step++;
|
|
116
|
+
session.append('tool/call', {
|
|
117
|
+
callId: `progress-${step}`,
|
|
118
|
+
name: 'fancy-scan/progress',
|
|
119
|
+
arguments: JSON.stringify({ platform, length, step }),
|
|
120
|
+
});
|
|
121
|
+
}, 2000);
|
|
131
122
|
|
|
132
123
|
const scriptResult = await spawnScript(
|
|
133
124
|
'node',
|
|
@@ -136,6 +127,7 @@ export async function apply(ctx) {
|
|
|
136
127
|
{ timeout: 120000 }
|
|
137
128
|
);
|
|
138
129
|
|
|
130
|
+
clearInterval(tick);
|
|
139
131
|
if (!scriptResult.ok) {
|
|
140
132
|
const err = (typeof scriptResult.error === 'object' && scriptResult.error !== null)
|
|
141
133
|
? (scriptResult.error.message || JSON.stringify(scriptResult.error))
|