@insitue/claude-plugin 0.4.2 → 0.4.4

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "insitue",
3
- "version": "0.4.0",
3
+ "version": "0.4.4",
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
  "mcpServers": {
6
6
  "insitue": {
@@ -437,8 +437,9 @@ if (!session) {
437
437
  );
438
438
  }
439
439
  var attached = false;
440
- async function ensureSubscriberAttached() {
440
+ async function ensureSubscriberAttached(opts = {}) {
441
441
  if (attached) return;
442
+ if (disconnecting && !opts.explicit) return;
442
443
  disconnecting = false;
443
444
  if (!session) {
444
445
  session = await ensureCompanion(projectDir.dir);
@@ -498,6 +499,19 @@ server.registerTool(
498
499
  },
499
500
  async ({ timeout_ms }) => {
500
501
  await ensureSubscriberAttached();
502
+ if (disconnecting) {
503
+ return {
504
+ content: [
505
+ {
506
+ type: "text",
507
+ text: JSON.stringify({
508
+ status: "disconnected",
509
+ message: "InSitue session was disconnected. Run /insitue:connect (Code) or call start_session (Desktop) to reattach."
510
+ })
511
+ }
512
+ ]
513
+ };
514
+ }
501
515
  const ms = timeout_ms ?? NEXT_PICK_DEFAULT_TIMEOUT_MS;
502
516
  const pick = await buffer.next(ms);
503
517
  if (!pick) {
@@ -526,7 +540,7 @@ server.registerTool(
526
540
  }
527
541
  },
528
542
  async ({ limit }) => {
529
- await ensureSubscriberAttached();
543
+ await ensureSubscriberAttached({ explicit: true });
530
544
  const picks = buffer.recent(limit ?? 10);
531
545
  return {
532
546
  content: [
@@ -545,7 +559,7 @@ server.registerTool(
545
559
  inputSchema: {}
546
560
  },
547
561
  async () => {
548
- await ensureSubscriberAttached();
562
+ await ensureSubscriberAttached({ explicit: true });
549
563
  const instructions = loadInstructions();
550
564
  const buffered = buffer.recent(32).length;
551
565
  const status = `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insitue/claude-plugin",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Drive Claude (Code AND Desktop) 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",
@@ -29,6 +29,9 @@
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
+ "engines": {
33
+ "node": ">=24"
34
+ },
32
35
  "scripts": {
33
36
  "build": "tsup src/dispatcher.ts src/mcp-server.ts src/setup-cli.ts --format esm --clean --external @modelcontextprotocol/sdk --external ws --external zod",
34
37
  "dev": "tsup src/dispatcher.ts src/mcp-server.ts src/setup-cli.ts --format esm --watch --external @modelcontextprotocol/sdk --external ws --external zod",