@insitue/claude-plugin 0.7.3 → 0.7.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.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +5 -0
- package/README.md +15 -3
- package/commands/connect.md +43 -26
- package/commands/login.md +19 -6
- package/dist/{chunk-BZDEEE6O.js → chunk-B2OV76P2.js} +2 -2
- package/dist/cloud/login.js +1 -1
- package/dist/cloud-cli.js +1 -1
- package/dist/mcp-server.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# @insitue/claude-plugin
|
|
2
2
|
|
|
3
|
+
## 0.7.4
|
|
4
|
+
|
|
5
|
+
- **`/insitue:connect` no longer blocks the session.** In poll mode the agent silently re-looped `next_pick` forever, freezing the chat (queued messages never processed). It now polls once then hands control back, drains buffered picks on your next message, and points you at channel mode (`--dangerously-load-development-channels --channels plugin:insitue`) for truly hands-free background picks.
|
|
6
|
+
- **Brand the sign-in success page.** The loopback login success page uses the brand purple gradient heading instead of the off-brand green.
|
|
7
|
+
|
|
3
8
|
## 0.7.3
|
|
4
9
|
|
|
5
10
|
- **Device-flow login for SSH/remote.** `/insitue:login` (+ `authenticate` tool) auto-detects an SSH session and uses a device flow: shows a verification URL + pairing code to approve in any browser; `complete_authentication` polls for the token. `login --device` forces it. Loopback stays the default locally.
|
package/README.md
CHANGED
|
@@ -47,6 +47,15 @@ auto-start the InSitue companion process in the background of
|
|
|
47
47
|
your `claude` session — no separate terminal to babysit. The
|
|
48
48
|
slash command `/insitue:connect` enters the loop.
|
|
49
49
|
|
|
50
|
+
The plugin ships four slash commands:
|
|
51
|
+
|
|
52
|
+
| Command | What it does |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `/insitue:connect` | Enter the pick→edit loop — receive browser picks and act on them. |
|
|
55
|
+
| `/insitue:disconnect` | Leave the loop: close the WS, stop receiving picks, and kill the companion the plugin spawned. |
|
|
56
|
+
| `/insitue:login` | Browser sign-in (PKCE) to InSitue Cloud, then auto-link this repo to its project. |
|
|
57
|
+
| `/insitue:logout` | Revoke the token server-side and clear local credentials. |
|
|
58
|
+
|
|
50
59
|
### 1B. Claude Desktop — one-command setup
|
|
51
60
|
|
|
52
61
|
Claude Desktop doesn't have a plugin marketplace, but it does
|
|
@@ -275,8 +284,8 @@ If your project uses InSitue Cloud, bug reports captured in production land in y
|
|
|
275
284
|
|
|
276
285
|
### Prerequisites
|
|
277
286
|
|
|
278
|
-
1. **Authenticate:** run `insitue login` (from the `@insitue/companion` CLI).
|
|
279
|
-
2. **Link your project:** run `insitue link <projectId>` in your project root. The tools read the linked project from `.insitue/project.json`.
|
|
287
|
+
1. **Authenticate:** run `insitue login` (from the `@insitue/companion` CLI), or `/insitue:login` inside Claude Code. Bare `insitue login` is a tokenless **browser** sign-in via PKCE — it opens your browser, prints an authorize URL + a short code to confirm, and on success prints `✓ Signed in as <login>`. Credentials are saved to `~/.insitue/auth.json`. A token minted this way from inside a repo is **project-scoped** (it can only act on that project's issues). On SSH/remote where no browser or loopback redirect is available, the flow auto-switches to the device flow — or force it with `insitue login --device`. As a CI / headless fallback, paste a Personal Access Token directly with `insitue login --token pat_live_…` (mint PATs at <https://app.insitue.com/app/settings/developer>); PATs are account-wide.
|
|
288
|
+
2. **Link your project:** `insitue login` already best-effort auto-links the current repo to its InSitue project, so this is usually unnecessary. If you need to link manually, run `insitue link` (auto-detects the project from the git remote) or `insitue link <projectId>` in your project root. The tools read the linked project from `.insitue/project.json`.
|
|
280
289
|
|
|
281
290
|
### The loop
|
|
282
291
|
|
|
@@ -352,7 +361,7 @@ The plugin is a stdio MCP server that:
|
|
|
352
361
|
|
|
353
362
|
| Tool | Purpose |
|
|
354
363
|
|---|---|
|
|
355
|
-
| `next_pick` | Long-poll for the next browser pick (default
|
|
364
|
+
| `next_pick` | Long-poll for the next browser pick (default 8 s; max 30 min). |
|
|
356
365
|
| `list_recent_picks` | Up to N buffered picks since the MCP server started. |
|
|
357
366
|
| `start_session` | Returns the operating instructions + current state. Desktop entry point. |
|
|
358
367
|
| `end_session` | Cleanly disconnect: close WS, suppress reconnect, kill spawned companion, drop session file. |
|
|
@@ -364,6 +373,9 @@ The plugin is a stdio MCP server that:
|
|
|
364
373
|
| `claim_cloud_issue` | Claim an issue by `id`; returns note, source `file:line`, page URL, and top console errors. |
|
|
365
374
|
| `resolve_cloud_issue` | Mark an issue resolved; attach `prUrl` and optional `branch`. |
|
|
366
375
|
| `release_cloud_issue` | Return a claimed issue to the open queue. |
|
|
376
|
+
| `authenticate` | Start browser sign-in (PKCE): chooses the device vs loopback flow automatically and returns the authorize URL + code to confirm. |
|
|
377
|
+
| `complete_authentication` | Poll for approval (~5 min), then save credentials and best-effort auto-link the current repo to its project. |
|
|
378
|
+
| `logout` | Revoke the token server-side and clear local credentials. |
|
|
367
379
|
|
|
368
380
|
All file tools resolve paths against the project dir and refuse
|
|
369
381
|
anything that resolves outside it (realpath-checked, so `..` games
|
package/commands/connect.md
CHANGED
|
@@ -64,18 +64,33 @@ your context and skip any id you've already processed.
|
|
|
64
64
|
1. Call `mcp__insitue__list_recent_picks` once. If there are
|
|
65
65
|
any picks the user made before you attached, summarise them
|
|
66
66
|
("you picked X but haven't sent a description yet — make sure
|
|
67
|
-
to click Send in the InSitue panel"). Otherwise
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
to click Send in the InSitue panel"). Otherwise say:
|
|
68
|
+
|
|
69
|
+
> Connected. Pick an element in the browser and I'll act on it
|
|
70
|
+
> here. You can also just type to ask me anything — I'll answer
|
|
71
|
+
> right away, then keep watching.
|
|
72
|
+
>
|
|
73
|
+
> Tip: for hands-free background picks (so I act the moment you
|
|
74
|
+
> pick, without you waiting on me), relaunch with
|
|
75
|
+
> `claude --dangerously-load-development-channels --channels plugin:insitue`.
|
|
76
|
+
|
|
77
|
+
2. **Watch for a pick — ONE poll, then hand control back.** Call
|
|
78
|
+
`mcp__insitue__next_pick` (it long-polls ~8s).
|
|
79
|
+
- On `status: "timeout"` (no pick this window): **STOP. Do NOT
|
|
80
|
+
silently call `next_pick` again.** Parking yourself in back-to-back
|
|
81
|
+
polls FREEZES the session — a tool call can't be interrupted, so the
|
|
82
|
+
user types a message and you never see it (this is the #1 cause of
|
|
83
|
+
"InSitue is blocking me"). Instead, end your turn and hand control
|
|
84
|
+
back with one short line, e.g.:
|
|
85
|
+
|
|
86
|
+
> 👀 Watching. Pick something in the browser, or type anything — I'll
|
|
87
|
+
> grab whatever you picked.
|
|
88
|
+
|
|
89
|
+
Then wait for the user. You resume watching on their next message
|
|
90
|
+
(step 3). In plain poll mode you catch picks when the user next
|
|
91
|
+
interacts — for truly hands-free push *between* messages, they need
|
|
92
|
+
channel mode (the tip in step 1).
|
|
93
|
+
- On `status: "ok"` (a pick arrived):
|
|
79
94
|
- **Always echo the prompt back first.** Before any action,
|
|
80
95
|
diff, or follow-up question, lead with:
|
|
81
96
|
|
|
@@ -105,20 +120,22 @@ your context and skip any id you've already processed.
|
|
|
105
120
|
Don't auto-apply.
|
|
106
121
|
- On approval, write with the Edit tool (Code) or
|
|
107
122
|
`mcp__insitue__apply_edit` (Desktop). Confirm what changed.
|
|
108
|
-
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
`/insitue:connect`
|
|
123
|
+
- Then call `next_pick` once more to catch a rapid follow-up pick.
|
|
124
|
+
When it times out (picks have stopped), fall back to the
|
|
125
|
+
hand-back rule above — yield to the user; do NOT loop forever.
|
|
126
|
+
3. **On each user message: drain picks first, then answer, then resume.**
|
|
127
|
+
Whenever the user sends a message, before responding call `next_pick`
|
|
128
|
+
with a short `timeout_ms` (e.g. `1500`), repeatedly, until it returns
|
|
129
|
+
`status: "timeout"` — handle each pick it returns (de-dupe by `id`).
|
|
130
|
+
This catches anything the user picked while you were idle; picks are
|
|
131
|
+
buffered server-side, so nothing is lost. Then answer the user's
|
|
132
|
+
message fully and do whatever they ask. Then resume watching with a
|
|
133
|
+
single `next_pick` poll (step 2's one-poll-then-hand-back rule).
|
|
134
|
+
|
|
135
|
+
The user's message is ALWAYS the priority. Never tell them to cancel
|
|
136
|
+
or re-run `/insitue:connect` to talk to you, and never narrate the
|
|
137
|
+
watch ("still waiting…", "polling again…") — the browser already shows
|
|
138
|
+
`[insitue] 📥 pick received` the moment a pick lands.
|
|
122
139
|
4. **End the session properly.** When the user says "stop",
|
|
123
140
|
"done", "quit", "thanks", "exit", "disconnect", "stop
|
|
124
141
|
insitue", or anything else that clearly ends the InSitue
|
package/commands/login.md
CHANGED
|
@@ -10,9 +10,13 @@ Cloud issues will become available via the claude-plugin tools once signed in.
|
|
|
10
10
|
|
|
11
11
|
## Your behaviour
|
|
12
12
|
|
|
13
|
-
1. Call `mcp__insitue__authenticate` (no arguments).
|
|
13
|
+
1. Call `mcp__insitue__authenticate` (no arguments). It auto-detects the
|
|
14
|
+
environment: it opens a loopback browser flow locally, and automatically
|
|
15
|
+
switches to the device flow when an SSH session is detected or no loopback
|
|
16
|
+
port is available. Branch on the returned shape:
|
|
14
17
|
|
|
15
|
-
2.
|
|
18
|
+
2. **Loopback flow** — the tool returns
|
|
19
|
+
`{ status: "browser_opened", url, userCode, message }`.
|
|
16
20
|
Show the user:
|
|
17
21
|
|
|
18
22
|
> I've opened your browser to sign in to InSitue. Please:
|
|
@@ -21,11 +25,20 @@ Cloud issues will become available via the claude-plugin tools once signed in.
|
|
|
21
25
|
>
|
|
22
26
|
> (If your browser didn't open, visit this URL manually: `<url>`)
|
|
23
27
|
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
**Device flow** — the tool instead returns a device-flow shape with a
|
|
29
|
+
`verificationUrl` and `userCode` (no loopback redirect). This is what you'll
|
|
30
|
+
get over SSH or when no loopback port is free. Show the user:
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
> To sign in to InSitue, open this URL in any browser:
|
|
33
|
+
> **`<verificationUrl>`**
|
|
34
|
+
>
|
|
35
|
+
> Then confirm the code matches: **`<userCode>`**
|
|
36
|
+
|
|
37
|
+
In both flows, do NOT proceed to step 3 until the user says they've approved
|
|
38
|
+
or you detect they're ready. Wait for the user to confirm.
|
|
39
|
+
|
|
40
|
+
3. Call `mcp__insitue__complete_authentication` (no arguments). This polls
|
|
41
|
+
for the browser approval (up to ~5 minutes) for either flow.
|
|
29
42
|
|
|
30
43
|
4. On `{ status: "ok" }`:
|
|
31
44
|
- If `linked: true`: reply "Signed in as **@`<login>`** and linked to
|
|
@@ -19,8 +19,8 @@ var SUCCESS_HTML = `<!DOCTYPE html>
|
|
|
19
19
|
<head><meta charset="utf-8"><title>InSitue \u2014 signed in</title>
|
|
20
20
|
<style>body{font-family:system-ui,sans-serif;display:flex;align-items:center;justify-content:center;min-height:100vh;margin:0;background:#f9fafb;}
|
|
21
21
|
.card{background:#fff;border-radius:12px;padding:40px 48px;text-align:center;box-shadow:0 1px 4px rgba(0,0,0,.12);}
|
|
22
|
-
h1{font-size:1.4rem;margin:0 0 8px;}p{color:#6b7280;margin:0;}</style></head>
|
|
23
|
-
<body><div class="card"><h1>You're signed in to InSitue
|
|
22
|
+
h1{font-size:1.4rem;margin:0 0 8px;background:linear-gradient(180deg,#6b63ff,#5751e6);-webkit-background-clip:text;background-clip:text;color:transparent;}p{color:#6b7280;margin:0;}</style></head>
|
|
23
|
+
<body><div class="card"><h1>You're signed in to InSitue!</h1>
|
|
24
24
|
<p>You can close this tab and return to your terminal.</p></div></body></html>`;
|
|
25
25
|
var ERROR_HTML = `<!DOCTYPE html>
|
|
26
26
|
<html lang="en">
|
package/dist/cloud/login.js
CHANGED
package/dist/cloud-cli.js
CHANGED
package/dist/mcp-server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insitue/claude-plugin",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.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
|
"keywords": [
|
|
6
6
|
"insitue",
|