@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.
- package/CHANGELOG.md +43 -0
- package/README.en.md +1754 -1878
- package/README.md +1161 -1220
- package/README.zh.md +1173 -1232
- package/docs/images/approval-card.png +0 -0
- package/docs/images/console-summary.png +0 -0
- package/docs/images/console-task-lines.png +0 -0
- package/docs/images/sidebar-entry.png +0 -0
- package/lib/console.js +12 -2
- package/lib/doctor.js +1 -0
- package/lib/index.js +211 -220
- package/package.json +3 -2
|
Binary file
|
|
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
|
-
|
|
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)
|
|
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)
|