@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud411716/fancy-webnovel",
3
- "version": "0.1.72",
3
+ "version": "0.1.73",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -109,25 +109,16 @@ export async function apply(ctx) {
109
109
 
110
110
  notify(session, scan.notify({ type: 'collecting', platform, length }));
111
111
 
112
- // ─── TEST: 在采集过程中持续发送 tool/call 事件 ───────────────────────
113
- {
114
- const s = invocation.agent.session;
115
- let count = 0;
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
+ 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))