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.
Files changed (2) hide show
  1. package/bridge.mjs +17 -6
  2. 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
- // Most slash commands (/compact, /clear, …) are processed by the SDK when
591
- // sent as a turn. Two need special handling:
592
- // /model <name> is disabled headlessroute to the setModel control.
593
- // /clear also wipes the on-screen transcript (parity with the CLI).
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 turnno 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) { echoYou(); if (mm[1]) s.session.setModel(mm[1]); else s.session.listModels(); return }
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
- echoYou(); s.session.sendTurn(text)
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinkpool-pair",
3
- "version": "0.6.17",
3
+ "version": "0.6.18",
4
4
  "description": "Share a local coding-agent CLI (Claude Code, Codex, Gemini, Aider, …) into a ThinkPool Code room, live.",
5
5
  "type": "module",
6
6
  "bin": {