thinkpool-pair 0.6.24 → 0.6.26
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 +5 -1
- package/claude-session.mjs +12 -1
- package/package.json +1 -1
package/bridge.mjs
CHANGED
|
@@ -330,7 +330,7 @@ const announce = () =>
|
|
|
330
330
|
...[...terms.entries()].map(([id, t]) => ({ id, cmd: t.cmd, alive: true, cols: t.term.cols, rows: t.term.rows })),
|
|
331
331
|
// Structured sessions advertise kind:'structured' so the web renders the
|
|
332
332
|
// reader (not xterm) and drives them with code-turn / code-perm.
|
|
333
|
-
...[...sessions.entries()].map(([id, s]) => ({ id, cmd: s.cmd, kind: 'structured', alive: true })),
|
|
333
|
+
...[...sessions.entries()].map(([id, s]) => ({ id, cmd: s.cmd, kind: 'structured', alive: true, commands: s.commands })),
|
|
334
334
|
],
|
|
335
335
|
})
|
|
336
336
|
|
|
@@ -469,6 +469,10 @@ function openStructured({ id, model, resume, log }) {
|
|
|
469
469
|
// (the client merges the replayed log with persisted human lines). Used
|
|
470
470
|
// for ordering only — agent timestamps are never displayed.
|
|
471
471
|
if (typeof evt.ts !== 'number') evt.ts = Date.now()
|
|
472
|
+
// The init system event carries the session's slash command list. Stash it
|
|
473
|
+
// on the entry so the ANNOUNCE can hand it to clients that connect/reload
|
|
474
|
+
// AFTER init (the one-time code-event would miss them), then re-announce.
|
|
475
|
+
if (evt.kind === 'system' && Array.isArray(evt.commands) && evt.commands.length && !entry.commands) { entry.commands = evt.commands; announce() }
|
|
472
476
|
// Chrome events (mode / usage / clear) are transient state, not transcript —
|
|
473
477
|
// broadcast + print them, but keep them out of the persisted/replayed log.
|
|
474
478
|
const chrome = evt.kind === 'mode' || evt.kind === 'usage' || evt.kind === 'clear'
|
package/claude-session.mjs
CHANGED
|
@@ -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
|
-
|
|
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.
|