@insitue/claude-plugin 0.3.2 → 0.3.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/commands/connect.md +12 -2
- package/dist/mcp-server.js +12 -4
- package/package.json +1 -1
package/commands/connect.md
CHANGED
|
@@ -21,7 +21,11 @@ not need to ask the user to run any extra commands.
|
|
|
21
21
|
to click Send in the InSitue panel"). Otherwise just say
|
|
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
|
+
(~25s default — short on purpose so the chat stays responsive
|
|
25
|
+
to other questions the user might type while you wait). When
|
|
26
|
+
it returns with `status: "timeout"`, **call it again immediately
|
|
27
|
+
without announcing it** — the timeout is just a heartbeat, not
|
|
28
|
+
news. When it returns with `status: "ok"`:
|
|
25
29
|
- **Always echo the prompt back first.** Before any action,
|
|
26
30
|
diff, or follow-up question, lead with:
|
|
27
31
|
|
|
@@ -54,7 +58,13 @@ not need to ask the user to run any extra commands.
|
|
|
54
58
|
- Loop back to `next_pick`.
|
|
55
59
|
3. If `next_pick` returns `status: "timeout"`, the user simply
|
|
56
60
|
hasn't picked anything yet. Stay quiet and call `next_pick`
|
|
57
|
-
again.
|
|
61
|
+
again. **Do not narrate the loop** — no "still waiting…", no
|
|
62
|
+
"polling again…". The user sees `[insitue] 📥 pick received`
|
|
63
|
+
on stderr the moment their pick lands; that's the
|
|
64
|
+
confirmation, not your narration. If the user types another
|
|
65
|
+
question while you're between calls, answer it first (since
|
|
66
|
+
the chat is responsive), then resume the loop with
|
|
67
|
+
`next_pick`.
|
|
58
68
|
4. If a pick comes back with `target` starting with
|
|
59
69
|
`[insitue]` (e.g. "companion disconnected"), tell the user
|
|
60
70
|
what happened in one sentence and call `next_pick` again —
|
package/dist/mcp-server.js
CHANGED
|
@@ -10,7 +10,7 @@ import { dirname, join, resolve } from "path";
|
|
|
10
10
|
import WebSocket from "ws";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
var MAX_BUFFERED_PICKS = 32;
|
|
13
|
-
var NEXT_PICK_DEFAULT_TIMEOUT_MS =
|
|
13
|
+
var NEXT_PICK_DEFAULT_TIMEOUT_MS = 25 * 1e3;
|
|
14
14
|
var NEXT_PICK_MAX_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
15
15
|
function findSession(start = process.cwd()) {
|
|
16
16
|
let dir = resolve(start);
|
|
@@ -54,7 +54,8 @@ function summariseBundle(raw) {
|
|
|
54
54
|
selector: t?.selector ?? null,
|
|
55
55
|
userNote: raw.bundle.userNote ?? null,
|
|
56
56
|
url: raw.bundle.runtime?.url ?? null,
|
|
57
|
-
componentStack
|
|
57
|
+
componentStack,
|
|
58
|
+
...t?.cmsSource ? { cmsSource: t.cmsSource } : {}
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
61
|
var PickBuffer = class {
|
|
@@ -239,8 +240,15 @@ function connectToCompanion(session2) {
|
|
|
239
240
|
}
|
|
240
241
|
if (tag === "broadcast-capture") {
|
|
241
242
|
try {
|
|
242
|
-
|
|
243
|
-
|
|
243
|
+
const summary = summariseBundle(
|
|
244
|
+
m
|
|
245
|
+
);
|
|
246
|
+
buffer.push(summary);
|
|
247
|
+
const note = summary.userNote ? summary.userNote.length > 60 ? `${summary.userNote.slice(0, 57)}\u2026` : summary.userNote : "(no description)";
|
|
248
|
+
const where = summary.source ? `${summary.source.file}:${summary.source.line}` : summary.target;
|
|
249
|
+
process.stderr.write(
|
|
250
|
+
`[insitue] \u{1F4E5} pick received \u2014 "${note}" @ ${where}
|
|
251
|
+
`
|
|
244
252
|
);
|
|
245
253
|
} catch (err) {
|
|
246
254
|
process.stderr.write(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insitue/claude-plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
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",
|