@cloud411716/fancy-webnovel 0.1.72 → 0.1.74
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 +5 -19
package/package.json
CHANGED
|
@@ -109,25 +109,10 @@ export async function apply(ctx) {
|
|
|
109
109
|
|
|
110
110
|
notify(session, scan.notify({ type: 'collecting', platform, length }));
|
|
111
111
|
|
|
112
|
-
//
|
|
113
|
-
{
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const timers = [];
|
|
117
|
-
for (let i = 0; i < 5; i++) {
|
|
118
|
-
const t = setTimeout(() => {
|
|
119
|
-
count++;
|
|
120
|
-
s.append('tool/call', {
|
|
121
|
-
callId: `progress-${i}`,
|
|
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
|
+
const tick = setInterval(() => {
|
|
114
|
+
session.append('turn/start', { source: 'fancy-scan' });
|
|
115
|
+
}, 2000);
|
|
131
116
|
|
|
132
117
|
const scriptResult = await spawnScript(
|
|
133
118
|
'node',
|
|
@@ -136,6 +121,7 @@ export async function apply(ctx) {
|
|
|
136
121
|
{ timeout: 120000 }
|
|
137
122
|
);
|
|
138
123
|
|
|
124
|
+
clearInterval(tick);
|
|
139
125
|
if (!scriptResult.ok) {
|
|
140
126
|
const err = (typeof scriptResult.error === 'object' && scriptResult.error !== null)
|
|
141
127
|
? (scriptResult.error.message || JSON.stringify(scriptResult.error))
|