thinkpool-pair 0.7.269 → 0.7.270

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
@@ -2665,10 +2665,16 @@ function openStructured({ id, runtime = 'claude', model, models, effort, resume,
2665
2665
  // turn (human prompt, dispatch, or cascade task), the runtime calls this
2666
2666
  // while still cold; subsequent turns reuse the persisted worktree.
2667
2667
  prepareCwd: (!cwd && !flowSessionId && !flowTaskKey) ? () => {
2668
- if (entry.managedWorktree?.dir) return entry.managedWorktree.dir
2669
2668
  try {
2670
- entry.managedWorktree = createManagedLaneWorktree({ terminalId: id, cwd: process.cwd() })
2669
+ if (!entry.managedWorktree?.dir) {
2670
+ entry.managedWorktree = createManagedLaneWorktree({ terminalId: id, cwd: process.cwd() })
2671
+ }
2671
2672
  entry.cwd = entry.managedWorktree.dir
2673
+ // ViewportManager is created while an ordinary terminal is still cold,
2674
+ // before this lazy worktree exists. Rebind it in the same handoff that
2675
+ // moves the agent runtime, or preview_start serves the bridge checkout's
2676
+ // stale dist instead of this lane's build.
2677
+ entry.viewport.setWorkspaceRoot(entry.cwd)
2672
2678
  try { entry.flush?.() } catch { /* first turn may precede flush wiring */ }
2673
2679
  return entry.cwd
2674
2680
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinkpool-pair",
3
- "version": "0.7.269",
3
+ "version": "0.7.270",
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": {
package/viewport.mjs CHANGED
@@ -313,6 +313,12 @@ export class ViewportManager {
313
313
  this.root = null
314
314
  }
315
315
 
316
+ setWorkspaceRoot(workspaceRoot) {
317
+ if (!workspaceRoot) throw new Error('A lane workspace is required.')
318
+ this.workspaceRoot = path.resolve(workspaceRoot)
319
+ return this.workspaceRoot
320
+ }
321
+
316
322
  async start({ root = 'dist' } = {}) {
317
323
  const resolved = await resolveContainedRoot(this.workspaceRoot, root)
318
324
  await this.stop()