@insitue/claude-plugin 0.4.2 → 0.4.3
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/dist/mcp-server.js +17 -3
- package/package.json +1 -1
package/dist/mcp-server.js
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "0.4.3",
|
|
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",
|