@jkwd/inbase 0.1.11 → 0.1.13

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/bin/session.mjs CHANGED
@@ -30,15 +30,31 @@ function printAck(kind, detail) {
30
30
  console.log(`VISUAL_CODER_ACK ${kind}: ${detail}`)
31
31
  }
32
32
 
33
- function createManifestGate(manifestPath) {
33
+ export function createManifestGate(manifestPath, watch = fs.watch) {
34
34
  const dir = path.dirname(manifestPath)
35
35
  let wake = () => {}
36
36
  let watcher = null
37
+
38
+ const dropWatcher = () => {
39
+ try {
40
+ watcher?.close()
41
+ } catch {
42
+ // Already closed after an error, or never opened.
43
+ }
44
+ watcher = null
45
+ }
46
+
37
47
  try {
38
- watcher = fs.watch(dir, () => wake())
48
+ watcher = watch(dir, () => wake())
49
+ watcher?.on?.('error', () => {
50
+ // EMFILE and sandbox limits must not crash wait-for-approval. Poll instead.
51
+ dropWatcher()
52
+ wake()
53
+ })
39
54
  } catch {
40
- watcher = null
55
+ dropWatcher()
41
56
  }
57
+
42
58
  return {
43
59
  wait(ms) {
44
60
  return new Promise((resolve) => {
@@ -50,7 +66,7 @@ function createManifestGate(manifestPath) {
50
66
  })
51
67
  },
52
68
  close() {
53
- watcher?.close()
69
+ dropWatcher()
54
70
  },
55
71
  }
56
72
  }
@@ -163,7 +179,7 @@ export async function attachSession(args) {
163
179
  console.log(`VISUAL_CODER_SESSION ${manifest.sessionId}`)
164
180
  printAck('attached', manifest.name || manifest.sessionId)
165
181
  console.log(
166
- `VISUAL_CODER_ATTACHED Attached to the focused visualizer session ${manifest.name || manifest.sessionId} (${manifest.phase}). Use --session ${manifest.sessionId} for every later command. Run inbase wait-for-blueprint --session ${manifest.sessionId} to read the optional blueprint and instruction; it does not wait.`,
182
+ `VISUAL_CODER_ATTACHED Attached to the next waiting visualizer session ${manifest.name || manifest.sessionId} (${manifest.phase}). Use --session ${manifest.sessionId} for every later command. Run inbase wait-for-blueprint --session ${manifest.sessionId} to read the optional blueprint and instruction; it does not wait.`,
167
183
  )
168
184
  }
169
185
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jkwd/inbase",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "A first-person 3D map of a codebase, with a visual coding workflow for Cursor.",
5
5
  "license": "MIT",
6
6
  "author": "Joris Kuijper",
@@ -1,12 +1,12 @@
1
1
  ---
2
- description: Attach this chat to the focused Inbase visualizer session
2
+ description: Attach this chat to the next waiting Inbase visualizer session
3
3
  ---
4
4
 
5
5
  The user invoked `/inbase`. This is how a chat joins the visualizer session that **Setup LLM session** already created.
6
6
 
7
7
  Do **not** ask for a session id. Do **not** run `inbase start-session`. Do **not** print the "direct chat interaction not allowed" message.
8
8
 
9
- 1. Attach to the focused visualizer session:
9
+ 1. Attach to the next waiting visualizer session (newest first; skip sessions that already have an LLM):
10
10
 
11
11
  ```bash
12
12
  npx inbase attach
@@ -57,7 +57,8 @@ If this chat is not yet attached, run:
57
57
  npx inbase attach
58
58
  ```
59
59
 
60
- That attaches this chat to the session currently focused in the map. No id is
60
+ That attaches this chat to the next waiting visualizer session (newest first).
61
+ Already-attached sessions are skipped. Window focus does not matter. No id is
61
62
  passed in; read `VISUAL_CODER_SESSION` from the output and use that
62
63
  `--session` value for every later command. Then continue from
63
64
  `wait-for-blueprint` below. Do **not** run `start-session`. Do **not** wait
@@ -144,11 +145,13 @@ npx inbase report-plan \
144
145
  npx inbase wait-for-approval --session "<session-id>"
145
146
  ```
146
147
 
147
- Do not edit project files until this prints `VISUAL_CODER_ACK execute` /
148
- `VISUAL_CODER_EXECUTE`. If Step by step is off, this returns immediately for
149
- each remaining step. First reply in chat acknowledging the ack, then re-read
150
- this session's `blueprint.json`; the user can place files and islands on any
151
- step.
148
+ Describe this tool call as `inbase wait-for-approval`, not "waiting for the
149
+ user to invoke". The command keeps running until they invoke; when it
150
+ returns, they already did. Do not edit project files until this prints
151
+ `VISUAL_CODER_ACK execute` / `VISUAL_CODER_EXECUTE`. If Step by step is off,
152
+ this returns immediately for each remaining step. First reply in chat
153
+ acknowledging the ack, then re-read this session's `blueprint.json`; the
154
+ user can place files and islands on any step.
152
155
  9. Implement only the invoked step by editing the live project files (Write,
153
156
  StrReplace, Delete). Paths are the same ids as `codebase.json`. Then record
154
157
  the step — Inbase diffs the working tree against the snapshot taken at