thinkpool-pair 0.6.17 → 0.6.18
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 +17 -6
- package/package.json +1 -1
package/bridge.mjs
CHANGED
|
@@ -587,16 +587,27 @@ channel
|
|
|
587
587
|
s.log.push(evt); if (s.log.length > STRUCTURED_LOG_MAX) s.log.shift()
|
|
588
588
|
bcast('code-event', { term: payload.term, evt })
|
|
589
589
|
}
|
|
590
|
-
//
|
|
591
|
-
//
|
|
592
|
-
//
|
|
593
|
-
//
|
|
590
|
+
// Session controls (/model, /clear) are NOT agent turns — they change the
|
|
591
|
+
// shared session config. Emitting a `you` line for them strands the reader's
|
|
592
|
+
// inferred "working…" state (no turn → no result to clear it; the old bug).
|
|
593
|
+
// Instead announce a ◆ control line both readers see. /compact + any other
|
|
594
|
+
// slash still flow through as a real, self-terminating turn.
|
|
595
|
+
const ctlLine = (ctlText) => {
|
|
596
|
+
const evt = { kind: 'control', text: ctlText, by: payload.by, cid: payload.cid }
|
|
597
|
+
s.log.push(evt); if (s.log.length > STRUCTURED_LOG_MAX) s.log.shift()
|
|
598
|
+
bcast('code-event', { term: payload.term, evt })
|
|
599
|
+
}
|
|
594
600
|
const mm = text.match(/^\/model\b\s*(\S+)?/)
|
|
595
|
-
if (mm) {
|
|
601
|
+
if (mm) {
|
|
602
|
+
if (mm[1]) { s.session.setModel(mm[1]); ctlLine(`switched model → ${mm[1]}`) }
|
|
603
|
+
else { ctlLine('use /model <name> to switch — e.g. opus, sonnet, haiku') }
|
|
604
|
+
return
|
|
605
|
+
}
|
|
596
606
|
if (/^\/clear\s*$/.test(text)) {
|
|
597
|
-
|
|
607
|
+
s.session.sendTurn(text)
|
|
598
608
|
s.log = []; bcast('code-event', { term: payload.term, evt: { kind: 'clear' } })
|
|
599
609
|
flushSession(room, payload.term, { sessionId: s.session?.sessionId || null, log: [] })
|
|
610
|
+
ctlLine('context cleared. You can continue with these answers in mind.')
|
|
600
611
|
return
|
|
601
612
|
}
|
|
602
613
|
s.session.sendTurn(text)
|