@xiangyixie/dsh-superagent 0.14.4 → 0.14.6

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.
Binary file
Binary file
Binary file
package/lib/console.js CHANGED
@@ -287,7 +287,10 @@ export function createConsole({ port, stateRoot, host, version, log = () => {} }
287
287
  records: tidied,
288
288
  })}\n`
289
289
  const tmp = `${timelinePath}.${process.pid}.tmp`
290
- return fsp.writeFile(tmp, body, 'utf8')
290
+ // The state directory may not exist yet when a stop flushes the timeline
291
+ // during startup, so create it instead of failing the flush with ENOENT.
292
+ return fsp.mkdir(path.dirname(timelinePath), { recursive: true })
293
+ .then(() => fsp.writeFile(tmp, body, 'utf8'))
291
294
  .then(() => replaceTimeline(tmp))
292
295
  .catch(error => log(`console: cannot save ${timelinePath}: ${messageOf(error)}`))
293
296
  }
@@ -676,7 +679,14 @@ export function createConsole({ port, stateRoot, host, version, log = () => {} }
676
679
  clients.delete(res)
677
680
  // With nobody watching there is no reason to keep the follow loop alive.
678
681
  // The transcript stays cached so a reconnect can rebuild the page.
679
- if (clients.size === 0) detach()
682
+ if (clients.size === 0) {
683
+ detach()
684
+ // A decision can no longer arrive: settle every pending question
685
+ // cancelled now instead of leaving the tool call parked until the
686
+ // ten-minute deadline. Cancellation is the fail-closed outcome, so a
687
+ // closed page or a dropped stream never approves anything.
688
+ for (const entry of [...approvals.values()]) entry.settle('cancelled')
689
+ }
680
690
  }
681
691
  req.on('close', cleanup)
682
692
  res.on('close', cleanup)
package/lib/doctor.js CHANGED
@@ -41,6 +41,7 @@ export const TOOL_NAMES = [
41
41
  'superagent_schedule',
42
42
  'superagent_goal',
43
43
  'superagent_audit',
44
+ 'superagent_help',
44
45
  ]
45
46
 
46
47
  /** Files npm always includes, whether or not `files` lists them. */