thinkpool-pair 0.6.23 → 0.6.25

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 CHANGED
@@ -184,9 +184,10 @@ const forceContinue = ownArgs.includes('--continue')
184
184
  const forceFresh = ownArgs.includes('--fresh')
185
185
 
186
186
  // One yes/no on the bridge's stderr (same channel as the agent picker).
187
- const askYesNo = (q) => new Promise((resolve) => {
187
+ // defaultYes=true bare Enter means yes; false → Enter means no (opt-in).
188
+ const askYesNo = (q, defaultYes = true) => new Promise((resolve) => {
188
189
  const rl = readline.createInterface({ input: process.stdin, output: process.stderr })
189
- rl.question(q, (ans) => { rl.close(); resolve(!/^n/i.test(String(ans).trim())) })
190
+ rl.question(q, (ans) => { rl.close(); const a = String(ans).trim(); resolve(defaultYes ? !/^n/i.test(a) : /^y/i.test(a)) })
190
191
  })
191
192
 
192
193
  let attachedCmd = null, attachedArgs = [], continuing = false
@@ -227,10 +228,12 @@ if (process.stdin.isTTY && !headless && process.env.THINKPOOL_PAIR_AUTOUPDATE !=
227
228
  let declined = false
228
229
  try { declined = fs.existsSync(declineFile) } catch { /* noop */ }
229
230
  if (!declined) {
230
- const yes = await askYesNo(`\n Keep this bridge running with auto-updates (survives reboot, no terminal to babysit)?\n Install it as a background service? [Y/n] `)
231
+ // Default NO a bare Enter keeps it foreground (the expected "I ran it in
232
+ // my terminal" behaviour); installing a background daemon is deliberate opt-in.
233
+ const yes = await askYesNo(`\n Run as a background service instead? It survives reboot + auto-updates,\n but runs detached — you'd stop it with 'uninstall-service', not Ctrl-C.\n Install background service? [y/N] `, false)
231
234
  if (yes) {
232
235
  svc.installService(room, attachedCmd ? [attachedCmd, ...attachedArgs] : [])
233
- process.stderr.write(` ◆ the background service is handling room ${room} now — you can close this terminal.\n\n`)
236
+ process.stderr.write(`\n ◆ the background service is handling room ${room} now — you can close this terminal.\n ◆ STOP IT with: npx thinkpool-pair@latest uninstall-service ${room}\n (closing the terminal does NOT stop it — it's detached under launchd/systemd.)\n\n`)
234
237
  process.exit(0) // hand off to the supervised service (no double bridge)
235
238
  }
236
239
  try { fs.mkdirSync(path.dirname(declineFile), { recursive: true }); fs.writeFileSync(declineFile, new Date().toISOString()) } catch { /* noop */ }
@@ -213,6 +213,14 @@ export function startClaudeSession({ cwd, model, resume, onEvent, requestPermiss
213
213
  abortController: ac,
214
214
  permissionMode: 'default',
215
215
  hooks: { PreToolUse: [{ hooks: [preTool] }] },
216
+ // Load the host's REAL Claude environment — user + project + local settings —
217
+ // so custom slash commands (.claude/commands/*.md), CLAUDE.md and agents work
218
+ // in the room exactly as in the user's own CLI. The Agent SDK isolates by
219
+ // default (no filesystem settings), which is why a custom /command came back
220
+ // "isn't available in this environment"; we opt in explicitly so it holds
221
+ // across SDK versions. The room's PreToolUse gate still runs and stays
222
+ // authoritative (hooks fire regardless of any loaded permission rules).
223
+ settingSources: ['user', 'project', 'local'],
216
224
  // Needed for live thinking-token progress (SDKThinkingTokensMessage) to
217
225
  // flow during a turn. We ignore the fine-grained stream_event partials in
218
226
  // the loop; only the coarse thinking_tokens system message is surfaced.
@@ -237,7 +245,10 @@ export function startClaudeSession({ cwd, model, resume, onEvent, requestPermiss
237
245
  break
238
246
  }
239
247
  if (m.session_id) sessionId = m.session_id
240
- emit({ kind: 'system', sessionId, model: m.model || model || null })
248
+ // m.slash_commands (init message) the commands this session really
249
+ // supports: built-ins + the host's custom .claude/commands. Surfaced
250
+ // so the room composer's autocomplete lists what ACTUALLY exists.
251
+ emit({ kind: 'system', sessionId, model: m.model || model || null, commands: Array.isArray(m.slash_commands) ? m.slash_commands : undefined })
241
252
  break
242
253
  case 'assistant':
243
254
  // Stamp tool-call start times so tool_result can report a duration.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinkpool-pair",
3
- "version": "0.6.23",
3
+ "version": "0.6.25",
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": {