thinkpool-pair 0.7.297 → 0.7.298
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/bridge.mjs +18 -2
- package/package.json +1 -1
package/bridge.mjs
CHANGED
|
@@ -1497,9 +1497,25 @@ function pumpDesign(term) {
|
|
|
1497
1497
|
by: next.by,
|
|
1498
1498
|
design: true,
|
|
1499
1499
|
}
|
|
1500
|
+
// Design bypasses the ordinary `code-turn` handler, so it must perform the
|
|
1501
|
+
// same lifecycle handshake itself. Open the revision BEFORE logging the human
|
|
1502
|
+
// line: its stamped `turnRev` lets every room client reconcile stale
|
|
1503
|
+
// `busy:false` immediately, without waiting several seconds for first model
|
|
1504
|
+
// output. A rejected dispatch gets a real terminal boundary below.
|
|
1505
|
+
syncStructuredTurn(lane)
|
|
1506
|
+
let accepted = false
|
|
1507
|
+
try {
|
|
1508
|
+
accepted = lane.session.sendTurn(designPrompt({ record: next.record, request: next.request, by: next.by, restore: !!next.restoreRecord, priorRecord: next.restoreRecord })) !== false
|
|
1509
|
+
} catch { accepted = false }
|
|
1510
|
+
if (accepted) beginStructuredTurn(lane)
|
|
1500
1511
|
stampEvent(visible); pushLog(lane, visible); bcast('code-event', { term, evt: visible })
|
|
1501
|
-
|
|
1502
|
-
|
|
1512
|
+
if (!accepted) {
|
|
1513
|
+
syncStructuredTurn(lane)
|
|
1514
|
+
const failed = { kind: 'error', message: 'The producing lane could not start the edit.', recoverable: true }
|
|
1515
|
+
pushLog(lane, failed); bcast('code-event', { term, evt: failed })
|
|
1516
|
+
finishDesign(term, 'failed', { message: 'The producing lane could not start the edit.' })
|
|
1517
|
+
}
|
|
1518
|
+
announce()
|
|
1503
1519
|
}
|
|
1504
1520
|
// Push one manifest file into the room, attributed to `term`. The owner is
|
|
1505
1521
|
// resolved by the WATCHER, not guessed here — each session/terminal writes to
|