thinkpool-pair 0.7.113 → 0.7.114

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/claude-session.mjs +19 -1
  2. package/package.json +1 -1
@@ -121,6 +121,24 @@ const simplifyBlocks = (blocks = []) => blocks.map((b) => {
121
121
  */
122
122
  const MODES = new Set(['default', 'acceptEdits', 'plan', 'bypassPermissions'])
123
123
 
124
+ // Per-turn salience reminder. The full ThinkPool Code ruleset lives in
125
+ // `appendSystemPrompt` (baked once at session start), but on a long session — heavy
126
+ // tool output, and especially after auto-compaction — the model's attention drifts
127
+ // off a system prompt that sits behind the large host CLAUDE.md. The classic tell:
128
+ // the agent hands the room a host-local path (`open …`, "it's in ~/claude-shots/")
129
+ // or narrates instead of showing, forgetting it's driven from a phone. So we re-state
130
+ // the highest-drift rules as a compact <system-reminder> appended to EVERY user turn,
131
+ // adjacent to where the model's attention actually is — the same trick the host
132
+ // harness uses to keep CLAUDE.md alive. ~120 tokens/turn; changes nothing but salience.
133
+ const TP_ROOM_REMINDER = [
134
+ 'You are Claude in a ThinkPool Code room, driven live from a phone or browser — NOT a local terminal. Keep using the room\'s features.',
135
+ 'ARTIFACTS: never hand the room a local path, a file:// URL, a localhost address, an `open …`/Preview reference, or "it\'s in ~/claude-shots/" — the room cannot see the host. Surface every image by reading the PNG into your turn so it renders inline; for HTML use the $TP_MOCKUP_OUTBOX render helper (inline desktop+mobile card) and/or publish to a GitHub Pages URL and post that link.',
136
+ 'SHOW, don\'t narrate: a picture of the result beats a wall of text on a phone — err toward more screenshots.',
137
+ 'ENSEMBLE: fan parallel work out with spawn_terminal (your own fresh lanes), coordinate via read_terminal / list_sessions; never hijack a busy sibling.',
138
+ 'FLOW / PLANS: write plans as normal chat messages as you form them — the room does not surface plan files or ExitPlanMode text.',
139
+ 'Verify before claiming done — show runtime evidence you produced, not "should work, go test it".',
140
+ ].join(' ')
141
+
124
142
  export function startClaudeSession({ cwd, model, resume, env, mode: initialMode = 'default', onEvent, requestPermission, mcpServers, crossPostGate, crossRoomPostGate, rolePrompt, blockSubagents = false, onSubmitPlan = null, onLaneDone = null, onReviewVerdict = null, reviewGate = null }) {
125
143
  const ac = new AbortController()
126
144
  let input = makeInputStream() // `let`: auto-restart swaps in a fresh stream
@@ -736,7 +754,7 @@ export function startClaudeSession({ cwd, model, resume, env, mode: initialMode
736
754
  runQuery()
737
755
 
738
756
  return {
739
- sendTurn(text) { if (!closed) { turnActive = true; sawSuggestion = false; if (sugTimer) { clearTimeout(sugTimer); sugTimer = null } lastEvtTs = Date.now(); stalledSent = false; input.push(String(text)) } },
757
+ sendTurn(text) { if (!closed) { turnActive = true; sawSuggestion = false; if (sugTimer) { clearTimeout(sugTimer); sugTimer = null } lastEvtTs = Date.now(); stalledSent = false; input.push([{ type: 'text', text: String(text) }, { type: 'text', text: `<system-reminder>\n${TP_ROOM_REMINDER}\n</system-reminder>` }]) } },
740
758
  // Set the permission mode — Claude Code's ⇧⇥ cycle. setPermissionMode is a
741
759
  // streaming control request (drives plan-mode behaviour SDK-side); the local
742
760
  // `mode` drives our PreToolUse auto-approve policy. Echo so the room syncs.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinkpool-pair",
3
- "version": "0.7.113",
3
+ "version": "0.7.114",
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": {