@insitue/claude-plugin 0.3.0 → 0.3.2

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.
@@ -22,6 +22,20 @@ not need to ask the user to run any extra commands.
22
22
  "Connected. Pick something in the browser when you're ready."
23
23
  2. Enter the loop: call `mcp__insitue__next_pick`. It long-polls
24
24
  (~5 min default). When it returns with `status: "ok"`:
25
+ - **Always echo the prompt back first.** Before any action,
26
+ diff, or follow-up question, lead with:
27
+
28
+ > **You asked:** [verbatim `pick.userNote`]
29
+ > (Source: `pick.source.file:pick.source.line` ·
30
+ > `pick.confidence`)
31
+
32
+ The CLI transcript only shows your output, not the prompt
33
+ the user typed in the browser panel. Without the echo, the
34
+ user has to mentally pair every response with what they
35
+ asked — confusing during multi-pick sessions and impossible
36
+ when reviewing the log later. Echo verbatim; don't
37
+ paraphrase. If `userNote` is empty, ask what to change at
38
+ the picked component instead (see below).
25
39
  - **`pick.userNote`** is the user's instruction. Treat it as
26
40
  the prompt.
27
41
  - **`pick.source.file:line`** is where to act. Read the file
@@ -265,7 +265,11 @@ if (!session) {
265
265
  process.stderr.write(
266
266
  "[insitue-mcp] no companion available \u2014 `next_pick` will time out.\n"
267
267
  );
268
- } else {
268
+ }
269
+ var attached = false;
270
+ function ensureSubscriberAttached() {
271
+ if (attached || !session) return;
272
+ attached = true;
269
273
  connectToCompanion(session);
270
274
  }
271
275
  var server = new McpServer({
@@ -283,6 +287,7 @@ server.registerTool(
283
287
  }
284
288
  },
285
289
  async ({ timeout_ms }) => {
290
+ ensureSubscriberAttached();
286
291
  const ms = timeout_ms ?? NEXT_PICK_DEFAULT_TIMEOUT_MS;
287
292
  const pick = await buffer.next(ms);
288
293
  if (!pick) {
@@ -311,6 +316,7 @@ server.registerTool(
311
316
  }
312
317
  },
313
318
  async ({ limit }) => {
319
+ ensureSubscriberAttached();
314
320
  const picks = buffer.recent(limit ?? 10);
315
321
  return {
316
322
  content: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insitue/claude-plugin",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Drive a Claude Code session from the InSitue browser overlay — pick an element in your app, claude reads the file and proposes the edit.",
5
5
  "license": "MIT",
6
6
  "type": "module",