@insitue/claude-plugin 0.2.0 → 0.3.1
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/README.md +3 -3
- package/commands/connect.md +15 -1
- package/dist/mcp-server.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -164,13 +164,13 @@ loop. Restart it.
|
|
|
164
164
|
**I want to run the companion myself**
|
|
165
165
|
You can — `npx @insitue/companion@latest dev` in any terminal.
|
|
166
166
|
The MCP server detects an existing companion at
|
|
167
|
-
`.
|
|
167
|
+
`.insitue/session.json` and reuses it instead of spawning its
|
|
168
168
|
own. Use this when you want to see the companion's logs
|
|
169
169
|
directly, or for debugging.
|
|
170
170
|
|
|
171
171
|
**It's still not working**
|
|
172
172
|
Open an issue at <https://github.com/InSitue/insitue/issues>
|
|
173
|
-
with the contents of `.
|
|
173
|
+
with the contents of `.insitue/session.json` and the last ~20
|
|
174
174
|
lines from the `claude` transcript. The MCP server logs
|
|
175
175
|
extensively to stderr; claude surfaces them in the transcript.
|
|
176
176
|
|
|
@@ -180,7 +180,7 @@ extensively to stderr; claude surfaces them in the transcript.
|
|
|
180
180
|
|
|
181
181
|
The plugin is a stdio MCP server that:
|
|
182
182
|
|
|
183
|
-
1. On startup, reads `${CLAUDE_PROJECT_DIR}/.
|
|
183
|
+
1. On startup, reads `${CLAUDE_PROJECT_DIR}/.insitue/session.json`
|
|
184
184
|
to find a running companion. If one's alive, reuse it.
|
|
185
185
|
2. Otherwise spawns `npx -y @insitue/companion@latest dev` as a
|
|
186
186
|
child process, polls for the new `session.json` to appear,
|
package/commands/connect.md
CHANGED
|
@@ -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
|
|
@@ -71,7 +85,7 @@ not need to ask the user to run any extra commands.
|
|
|
71
85
|
|
|
72
86
|
- **`source.file` doesn't exist**: tell the user the path the
|
|
73
87
|
pick resolved to and ask if they're in the right project
|
|
74
|
-
directory. The MCP server reads `.
|
|
88
|
+
directory. The MCP server reads `.insitue/session.json` from
|
|
75
89
|
the cwd `claude` was started in.
|
|
76
90
|
- **The edit doesn't HMR cleanly**: surface the build error in
|
|
77
91
|
chat (run `cat` or relevant logs if you can find them); don't
|
package/dist/mcp-server.js
CHANGED
|
@@ -15,7 +15,7 @@ var NEXT_PICK_MAX_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
|
15
15
|
function findSession(start = process.cwd()) {
|
|
16
16
|
let dir = resolve(start);
|
|
17
17
|
while (true) {
|
|
18
|
-
const candidate = join(dir, ".
|
|
18
|
+
const candidate = join(dir, ".insitue", "session.json");
|
|
19
19
|
if (existsSync(candidate)) {
|
|
20
20
|
try {
|
|
21
21
|
const session2 = JSON.parse(
|
|
@@ -118,7 +118,7 @@ async function probeCompanion(session2) {
|
|
|
118
118
|
{
|
|
119
119
|
host: "127.0.0.1",
|
|
120
120
|
port: session2.port,
|
|
121
|
-
path: "/
|
|
121
|
+
path: "/insitue/handshake",
|
|
122
122
|
method: "GET",
|
|
123
123
|
timeout: 1500
|
|
124
124
|
},
|
|
@@ -209,7 +209,7 @@ process.on("SIGTERM", () => {
|
|
|
209
209
|
});
|
|
210
210
|
var buffer = new PickBuffer();
|
|
211
211
|
function connectToCompanion(session2) {
|
|
212
|
-
const url = `ws://127.0.0.1:${session2.port}/
|
|
212
|
+
const url = `ws://127.0.0.1:${session2.port}/insitue/cli`;
|
|
213
213
|
const ws = new WebSocket(url, {
|
|
214
214
|
headers: { "user-agent": "insitue-claude-plugin" }
|
|
215
215
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insitue/claude-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
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",
|