@githumbi/grabby 0.1.1 → 0.2.0
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/CHANGELOG.md +18 -0
- package/README.md +285 -111
- package/dist/angular/index.js +6 -5
- package/dist/angular/index.js.map +1 -1
- package/dist/cli/index.js +496 -22
- package/dist/cli/index.js.map +1 -1
- package/dist/core/index.cjs +6 -5
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +6 -5
- package/dist/core/index.js.map +1 -1
- package/dist/grabby.global.js +10 -10
- package/dist/react/index.js +6 -5
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @githumbi/grabby
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 27eec19: New `npx @githumbi/grabby share`: one command from nothing to a feedback link. It sets up a collector in your own free Cloudflare account (or connects one you run, with `--server`), adds the script to your site (including Next.js App Router layouts, automatically), and prints a link for reviewers and a private inbox link for you. Settings are saved in a gitignored `.grabby/config.json`, so re-running is safe and `npx @githumbi/grabby pull` needs no flags.
|
|
8
|
+
|
|
9
|
+
Also new: `npx @githumbi/grabby inbox` opens the inbox, and `npx @githumbi/grabby alerts --slack <webhook>` posts new feedback to Slack.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 27eec19: Unsent comments now keep retrying for 14 days instead of giving up after 20 attempts, so a collector that is down for a while doesn't cost reviewers their feedback.
|
|
14
|
+
|
|
15
|
+
## 0.1.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 561ab50: The CLI's help text and hints now say `npx @githumbi/grabby …` instead of `npx grabby …`. On npm, `grabby` is an unrelated package, so the short form only worked once Grabby was installed in the project.
|
|
20
|
+
|
|
3
21
|
## 0.1.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,123 +1,196 @@
|
|
|
1
1
|
# Grabby
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Let your customers and stakeholders comment on your live website, and hand their feedback straight to your AI coding agent.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<p align="center"><img src="https://raw.githubusercontent.com/githumbi/grabby/main/docs/images/live-welcome.png" alt="A live site opened with a Grabby feedback link: a short tip explains Comment, click, type, and the toolbar shows a Comment button" width="820"></p>
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Send a client, tester or stakeholder a link to your site. They click **Comment**, click anything on the page, and type what should change. No account, no install. Every comment arrives with a screenshot, who left it, the page, and where that element lives in your code (component and `file:line`). You read it all in a private inbox, get a Slack message when new feedback comes in, and pass it to Claude, Cursor, Copilot or ChatGPT with one click, or let your agent read it directly.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
# UI feedback · 2 comments
|
|
11
|
-
localhost:5173 · React · page /pricing · 1440×900 · 2026-09-26
|
|
9
|
+
Setting it up is one command, and it works with Next.js, React, Vue, Svelte, Angular and plain HTML sites, wherever they're hosted.
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
- [Get feedback on your live site](#get-feedback-on-your-live-site): step by step
|
|
12
|
+
- [Read and act on feedback](#4-read-the-feedback)
|
|
13
|
+
- [Troubleshooting](#troubleshooting)
|
|
14
|
+
- [What gets captured](#what-gets-captured)
|
|
15
|
+
- [Connect your AI agent](#connect-your-ai-agent)
|
|
16
|
+
- [Developer mode: comment on your own app while you build](#developer-mode-comment-on-your-own-app-while-you-build)
|
|
17
|
+
- [Framework support](#framework-support) · [Configuration](#configuration) · [Security and privacy](#security-and-privacy)
|
|
18
|
+
|
|
19
|
+
## How it works
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
Reviewer on your site ──comment + screenshot──▶ Collector in your Cloudflare account
|
|
23
|
+
(?grabby= link) (free, always on, permanent address)
|
|
24
|
+
│
|
|
25
|
+
┌────────────────────────────────┼──────────────────────────┐
|
|
26
|
+
▼ ▼ ▼
|
|
27
|
+
Your private inbox Your AI agent Slack (optional)
|
|
28
|
+
(web page, any device) (pull or MCP)
|
|
22
29
|
```
|
|
23
30
|
|
|
24
|
-
|
|
31
|
+
- **Visitors see nothing.** The script is a loader under 500 bytes. The toolbar only appears for someone who opens your feedback link.
|
|
32
|
+
- **Feedback keeps arriving while your computer is off.** The collector runs in your own Cloudflare account, on the free plan, and the comments stay there.
|
|
33
|
+
- **You never touch servers or keys.** `npx @githumbi/grabby share` sets up the collector, edits your site, and saves the settings.
|
|
25
34
|
|
|
26
|
-
|
|
27
|
-
- [Using it](#using-it)
|
|
28
|
-
- [What gets captured](#what-gets-captured)
|
|
29
|
-
- [Feedback on a live site](#feedback-on-a-live-site)
|
|
30
|
-
- [Connect your AI agent](#connect-your-ai-agent)
|
|
31
|
-
- [Framework support](#framework-support)
|
|
32
|
-
- [Configuration](#configuration)
|
|
33
|
-
- [Security and privacy](#security-and-privacy)
|
|
35
|
+
## Get feedback on your live site
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
### Before you start
|
|
38
|
+
|
|
39
|
+
- **Node.js 20 or newer** on your computer (`node -v` shows your version).
|
|
40
|
+
- **Your site's project folder**, and a way to deploy it (Netlify, Vercel, GitHub Pages, your own server… anything works).
|
|
41
|
+
- **A free Cloudflare account.** You don't need one beforehand: the first time, setup opens the sign-up page for you. No credit card.
|
|
42
|
+
|
|
43
|
+
### 1. Run one command in your project folder
|
|
36
44
|
|
|
37
45
|
```bash
|
|
38
|
-
npx grabby
|
|
46
|
+
npx @githumbi/grabby share
|
|
39
47
|
```
|
|
40
48
|
|
|
41
|
-
|
|
49
|
+
It asks for your site's address once (for example `https://my-app.netlify.app`), shows what it's about to do, and asks you to confirm. Then:
|
|
42
50
|
|
|
43
|
-
**
|
|
51
|
+
1. **The first time only, a browser window opens to sign in to Cloudflare.** Sign in (or create a free account) and click **Allow**. You can close that tab afterwards.
|
|
52
|
+
2. **The first time only, if your Cloudflare account is new, the terminal asks you to pick a `workers.dev` subdomain.** Answer `Y` and type a name, such as your name or company. It becomes part of your collector's address: `https://grabby-my-app.<your-name>.workers.dev`.
|
|
53
|
+
3. **It sets up the collector** in your Cloudflare account. This takes about 30 seconds.
|
|
54
|
+
4. **It adds the Grabby script to your site**: `app/layout.tsx` (or `src/app/layout.tsx`) in Next.js, `index.html` in Vite, Angular, SvelteKit and plain HTML sites. If it can't find the right file, it prints the tag for you to paste before `</body>`.
|
|
55
|
+
5. **It saves its settings** in `.grabby/config.json`, which is private and added to `.gitignore`, and lets your AI agent read feedback through `.mcp.json`.
|
|
44
56
|
|
|
45
|
-
|
|
46
|
-
|
|
57
|
+
It finishes with everything you need:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
[grabby] Grabby is ready.
|
|
61
|
+
|
|
62
|
+
1. Commit and deploy your site as usual (app/layout.tsx changed).
|
|
63
|
+
2. Send reviewers this link. They click Comment, pick anything, and type:
|
|
64
|
+
https://my-app.netlify.app/?grabby=pk_…
|
|
65
|
+
3. Read feedback in your private inbox (bookmark it; don't share it):
|
|
66
|
+
https://grabby-my-app.you.workers.dev/inbox#k=ik_…
|
|
67
|
+
or hand it to your AI agent: npx @githumbi/grabby pull
|
|
47
68
|
```
|
|
48
69
|
|
|
49
|
-
|
|
50
|
-
// vite.config.ts
|
|
51
|
-
import grabby from '@githumbi/grabby/plugin';
|
|
70
|
+
### 2. Deploy your site
|
|
52
71
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
Commit the changed files and deploy as you normally do:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
git add . && git commit -m "Add Grabby feedback" && git push
|
|
56
76
|
```
|
|
57
77
|
|
|
58
|
-
|
|
59
|
-
// src/main.tsx (or main.ts)
|
|
60
|
-
import { initGrabby } from '@githumbi/grabby';
|
|
78
|
+
That's the last time you need to change your site for Grabby.
|
|
61
79
|
|
|
62
|
-
|
|
80
|
+
### 3. Send reviewers the feedback link
|
|
81
|
+
|
|
82
|
+
It's your site's address with `?grabby=` and your project key on the end. `share` prints it. Any page works, so you can send people straight to the screen you want feedback on:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
https://my-app.netlify.app/pricing?grabby=pk_…
|
|
63
86
|
```
|
|
64
87
|
|
|
65
|
-
|
|
88
|
+
Reviewers get a **Comment** button and a short three-step tip:
|
|
66
89
|
|
|
67
|
-
|
|
90
|
+
1. Click **Comment**.
|
|
91
|
+
2. Click the part of the page they want to talk about.
|
|
92
|
+
3. Type what should change and press **Enter**.
|
|
68
93
|
|
|
69
|
-
**
|
|
94
|
+
After their first comment, Grabby asks who it's from: a name, or **Post anonymously**. The choice is remembered, and anonymous reviewers still get a stable id, so you can tell "Anonymous 3f9a" from "Anonymous b21c". If your app already knows who's signed in, skip the question with `grabby.identify({ id, name })`.
|
|
70
95
|
|
|
71
|
-
|
|
72
|
-
// app.config.ts
|
|
73
|
-
import { provideGrabby } from '@githumbi/grabby/angular';
|
|
96
|
+
<p align="center"><img src="https://raw.githubusercontent.com/githumbi/grabby/main/docs/images/live-identity.png" alt="After a comment, Grabby asks: Thanks! Who is this from? with a name field, Post anonymously and Post" width="820"></p>
|
|
74
97
|
|
|
75
|
-
|
|
76
|
-
providers: [provideGrabby()],
|
|
77
|
-
};
|
|
78
|
-
```
|
|
98
|
+
Each comment is sent as soon as it's saved. It's kept in the reviewer's browser first and retried for up to two weeks, so a bad connection doesn't lose it, and closing the tab with an unsent comment brings up the browser's "Leave site?" prompt. When they're done, **Finish review** shows what reached you; **Done** clears their list for another round.
|
|
79
99
|
|
|
80
|
-
|
|
100
|
+
<p align="center"><img src="https://raw.githubusercontent.com/githumbi/grabby/main/docs/images/live-finish.png" alt="The Finish review summary: Your comment was sent to the team, with Keep reviewing and Done; the toolbar shows 1 sent" width="820"></p>
|
|
81
101
|
|
|
82
|
-
|
|
102
|
+
### 4. Read the feedback
|
|
83
103
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
**In your inbox.** Open the private link from `share` (or run `npx @githumbi/grabby inbox`). You'll see every comment with:
|
|
105
|
+
|
|
106
|
+
- its screenshot (click to enlarge),
|
|
107
|
+
- who left it, the page and when,
|
|
108
|
+
- the element and where it lives in your code, such as `PlanCard` in `src/PlanCard.tsx:15`.
|
|
109
|
+
|
|
110
|
+
Mark comments **resolved** once they're handled, **delete** them, or click **Copy all for AI** and paste the result into your AI agent. The inbox works on any device, including your phone. Treat the link like a password: anyone with it can read the feedback.
|
|
111
|
+
|
|
112
|
+
**In your AI agent.** Run:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npx @githumbi/grabby pull
|
|
88
116
|
```
|
|
89
117
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
118
|
+
It prints every open comment, grouped by file and labelled by author, saves the screenshots to `./.grabby/screenshots/` where your agent can open them, and marks the comments resolved so the next pull only shows new feedback (add `--keep` to leave them open):
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
3. Make this button green so it matches our brand
|
|
122
|
+
- `<button class="cta">Start free trial</button>` (action) Hero
|
|
123
|
+
- styles: bg #111827 · color #fff · size 16px · weight 600 · padding 14px 22px · radius 10px
|
|
124
|
+
- screenshot: .grabby/screenshots/9c1f….webp
|
|
125
|
+
- by Amina (client)
|
|
96
126
|
```
|
|
97
127
|
|
|
98
|
-
|
|
128
|
+
Or skip the copy and paste: `share` set up MCP, so after restarting your editor you can ask your agent to "fix the open Grabby comments".
|
|
99
129
|
|
|
100
|
-
|
|
101
|
-
|
|
130
|
+
**In Slack.** Create an [incoming webhook](https://api.slack.com/messaging/webhooks) for a channel, then:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npx @githumbi/grabby alerts --slack https://hooks.slack.com/services/…
|
|
102
134
|
```
|
|
103
135
|
|
|
104
|
-
|
|
136
|
+
New feedback is posted within about 20 seconds, one message per burst, each with a link to the comment in your inbox. `--test` sends a test message, `--webhook <url>` sends JSON to any other service, and `--off` stops alerts.
|
|
105
137
|
|
|
106
|
-
|
|
107
|
-
2. Hover to see each element's component and file. Click one. Clicking an icon inside a button selects the button; hold **Shift** to pick the exact inner element.
|
|
108
|
-
3. Type what should change and press **Enter**. Grabby saves it with a screenshot. Nothing is copied yet.
|
|
109
|
-
4. Keep going. The badge counts your comments; the list shows them with thumbnails. Click one to edit it.
|
|
110
|
-
5. **Copy all** opens a preview. Choose a detail level, edit the text if you like, then:
|
|
111
|
-
- **Copy & clear**: copy, and start fresh next time (with Undo, in case).
|
|
112
|
-
- **Copy, keep comments**: copy and keep them.
|
|
138
|
+
### Everyday tasks
|
|
113
139
|
|
|
114
|
-
|
|
|
140
|
+
| To… | Run |
|
|
115
141
|
|---|---|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
142
|
+
| Open your inbox | `npx @githumbi/grabby inbox` |
|
|
143
|
+
| Get open comments for your AI agent | `npx @githumbi/grabby pull` |
|
|
144
|
+
| Accept feedback from another address (staging, custom domain) | `npx @githumbi/grabby share --origin https://staging.my-app.com` |
|
|
145
|
+
| Replace the inbox link (if it was shared by mistake) | `npx @githumbi/grabby share --rotate` |
|
|
146
|
+
| Update the collector after upgrading Grabby | `npx @githumbi/grabby share` |
|
|
147
|
+
| Turn Slack alerts on or off | `npx @githumbi/grabby alerts --slack <webhook>` / `--off` |
|
|
148
|
+
| Set up on a new computer (the settings aren't in git) | `npx @githumbi/grabby share --rotate-admin` |
|
|
149
|
+
|
|
150
|
+
Running `share` again is always safe: it keeps your feedback link, your inbox link and your comments.
|
|
151
|
+
|
|
152
|
+
### Troubleshooting
|
|
153
|
+
|
|
154
|
+
- **Reviewers see "not sent".** The site can't reach the collector. Check that your latest deploy includes the Grabby script, and that the address in the browser matches the one you gave `share`. Staging sites and custom domains each need adding: `share --origin <address>`. Unsent comments are retried for two weeks, so they arrive once it's fixed.
|
|
155
|
+
- **No Comment button appears.** Make sure the link ends in `?grabby=` followed by the key `share` printed, and that the deployed page contains the Grabby `<script>`.
|
|
156
|
+
- **The Cloudflare sign-in didn't open, or you're on a server without a browser.** Create an API token in the Cloudflare dashboard and run `share` with `CLOUDFLARE_API_TOKEN=… npx @githumbi/grabby share`. If you belong to several Cloudflare accounts, also set `CLOUDFLARE_ACCOUNT_ID`.
|
|
157
|
+
- **A company network blocks `*.workers.dev`.** Some corporate networks do. Test from another network, or [run the collector on your own server](#run-the-collector-on-your-own-server-instead) under your company's domain.
|
|
158
|
+
- **`share` couldn't find where to add the script.** It prints the tag instead; see [Adding the script by hand](#adding-the-script-by-hand).
|
|
159
|
+
|
|
160
|
+
### Run the collector on your own server instead
|
|
161
|
+
|
|
162
|
+
Prefer not to use Cloudflare? The collector is also a small Node server with no database. Run it anywhere Node 20 or Docker runs, behind HTTPS:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npx -y @githumbi/grabby-server init --origin https://my-app.com # prints a project key and an admin token
|
|
166
|
+
GRABBY_PUBLIC_KEY=pk_… GRABBY_ADMIN_TOKEN=sk_… GRABBY_ALLOWED_ORIGINS=https://my-app.com \
|
|
167
|
+
GRABBY_PUBLIC_URL=https://feedback.my-app.com npx -y @githumbi/grabby-server start --public
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Then connect your project to it. This adds the script, the inbox link and the settings, the same as above:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
npx @githumbi/grabby share --server https://feedback.my-app.com --token sk_…
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Docker and other options are in [packages/server](packages/server/README.md).
|
|
177
|
+
|
|
178
|
+
### Adding the script by hand
|
|
179
|
+
|
|
180
|
+
`share` prints this tag with your address, key and integrity hashes filled in. Put it before `</body>`:
|
|
181
|
+
|
|
182
|
+
```html
|
|
183
|
+
<script
|
|
184
|
+
src="https://cdn.jsdelivr.net/npm/@githumbi/grabby@<version>/dist/loader.global.js"
|
|
185
|
+
integrity="sha384-…" crossorigin="anonymous" data-integrity="sha384-…"
|
|
186
|
+
data-mode="live"
|
|
187
|
+
data-server="https://grabby-my-app.you.workers.dev"
|
|
188
|
+
data-project-key="pk_…"
|
|
189
|
+
defer
|
|
190
|
+
></script>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
In a Next.js App Router layout, use `<Script … strategy="afterInteractive" />` from `next/script` with the same attributes (`crossOrigin` in JSX). With a bundler you can instead install `@githumbi/grabby` and call `initGrabbyLive({ server, projectKey })` from `@githumbi/grabby/live`.
|
|
121
194
|
|
|
122
195
|
## What gets captured
|
|
123
196
|
|
|
@@ -138,58 +211,158 @@ The export names the page once, groups comments by file, and skips anything alre
|
|
|
138
211
|
|
|
139
212
|
Screenshots are never pasted into the text; they'd crowd out the context window. They stay in the browser (and on your collector, if you use one), and `pull` and MCP give your agent the image file.
|
|
140
213
|
|
|
141
|
-
##
|
|
214
|
+
## Connect your AI agent
|
|
215
|
+
|
|
216
|
+
- **Copy all**: paste into any chat or agent.
|
|
217
|
+
- **MCP**: run `npx @githumbi/grabby add mcp` (`share` does this for you). Your agent gets `grabby_list_comments`, `grabby_get_comment` (with the screenshot), `grabby_resolve` and `grabby_stats`. After `share`, it reads your live site's feedback; otherwise it also collects comments locally: set `initGrabby({ server: 'http://localhost:3456' })`.
|
|
218
|
+
- **`pull`**: prints the same export as Copy all, for scripts and terminal agents.
|
|
219
|
+
- **Inbox**: the private web page from `share`, with **Copy all for AI**.
|
|
220
|
+
|
|
221
|
+
## Developer mode: comment on your own app while you build
|
|
222
|
+
|
|
223
|
+
The same toolbar also works on your local dev server, for you and your team. Comments stay in your browser and go straight to your AI agent, with exact source locations from a small build plugin. Nothing is added to production builds.
|
|
142
224
|
|
|
143
|
-
|
|
225
|
+
<p align="center"><img src="https://raw.githubusercontent.com/githumbi/grabby/main/docs/images/dev-hover.png" alt="Hovering a button in selection mode: Grabby labels it "button .btn in PlanCard, src/PlanCard.tsx:15"" width="820"></p>
|
|
144
226
|
|
|
145
|
-
|
|
227
|
+
### 1. Install for development
|
|
228
|
+
|
|
229
|
+
You need Node 20 or newer. In your project folder, run:
|
|
146
230
|
|
|
147
231
|
```bash
|
|
148
|
-
npx @githumbi/grabby
|
|
149
|
-
npx @githumbi/grabby-server start --public
|
|
232
|
+
npx @githumbi/grabby init
|
|
150
233
|
```
|
|
151
234
|
|
|
152
|
-
`init`
|
|
235
|
+
`init` detects your framework, bundler and package manager, shows exactly which files it will change, and asks before touching anything. Add `--dry-run` to only see the plan.
|
|
153
236
|
|
|
154
|
-
|
|
237
|
+
Prefer to set it up by hand? Install the package as a dev dependency:
|
|
155
238
|
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
src="https://cdn.jsdelivr.net/npm/@githumbi/grabby@0.1.0/dist/loader.global.js"
|
|
159
|
-
data-mode="live"
|
|
160
|
-
data-server="https://feedback.your-site.com"
|
|
161
|
-
data-project-key="pk_…"
|
|
162
|
-
defer
|
|
163
|
-
></script>
|
|
239
|
+
```bash
|
|
240
|
+
npm install -D @githumbi/grabby # or: pnpm add -D @githumbi/grabby · yarn add -D @githumbi/grabby
|
|
164
241
|
```
|
|
165
242
|
|
|
166
|
-
|
|
243
|
+
then follow the steps for your stack:
|
|
244
|
+
|
|
245
|
+
<details>
|
|
246
|
+
<summary><strong>React, Vue, Solid, Preact (Vite)</strong></summary>
|
|
247
|
+
|
|
248
|
+
```ts
|
|
249
|
+
// vite.config.ts
|
|
250
|
+
import grabby from '@githumbi/grabby/plugin';
|
|
167
251
|
|
|
168
|
-
|
|
252
|
+
export default defineConfig({
|
|
253
|
+
plugins: [grabby.vite(), react()], // grabby first
|
|
254
|
+
});
|
|
255
|
+
```
|
|
169
256
|
|
|
170
257
|
```ts
|
|
171
|
-
|
|
258
|
+
// src/main.tsx (or main.ts)
|
|
259
|
+
import { initGrabby } from '@githumbi/grabby';
|
|
172
260
|
|
|
173
|
-
|
|
261
|
+
if (import.meta.env.DEV) initGrabby();
|
|
174
262
|
```
|
|
175
263
|
|
|
176
|
-
|
|
264
|
+
The plugin adds `file:line:col` to every element in development only. Production builds contain neither the stamps nor Grabby. Using webpack, Rspack, Rollup or esbuild? Use `grabby.webpack()`, `grabby.rspack()`, and so on.
|
|
265
|
+
</details>
|
|
177
266
|
|
|
178
|
-
|
|
267
|
+
<details>
|
|
268
|
+
<summary><strong>Svelte / SvelteKit</strong></summary>
|
|
179
269
|
|
|
180
|
-
|
|
270
|
+
No plugin needed, since Svelte's dev build already records locations. Just call `initGrabby()` in development:
|
|
181
271
|
|
|
182
|
-
```
|
|
183
|
-
|
|
272
|
+
```ts
|
|
273
|
+
import { initGrabby } from '@githumbi/grabby';
|
|
274
|
+
|
|
275
|
+
if (import.meta.env.DEV) initGrabby();
|
|
184
276
|
```
|
|
277
|
+
</details>
|
|
185
278
|
|
|
186
|
-
|
|
279
|
+
<details>
|
|
280
|
+
<summary><strong>Angular (17+)</strong></summary>
|
|
187
281
|
|
|
188
|
-
|
|
282
|
+
```ts
|
|
283
|
+
// app.config.ts
|
|
284
|
+
import { provideGrabby } from '@githumbi/grabby/angular';
|
|
189
285
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
286
|
+
export const appConfig: ApplicationConfig = {
|
|
287
|
+
providers: [provideGrabby()],
|
|
288
|
+
};
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
In `angular.json`, swap the builders to `@githumbi/grabby:application` and `@githumbi/grabby:dev-server`. `npx @githumbi/grabby init` does both.
|
|
292
|
+
</details>
|
|
293
|
+
|
|
294
|
+
<details>
|
|
295
|
+
<summary><strong>Next.js</strong></summary>
|
|
296
|
+
|
|
297
|
+
```js
|
|
298
|
+
// next.config.js
|
|
299
|
+
const grabby = require('@githumbi/grabby/plugin').default;
|
|
300
|
+
module.exports = { webpack: (config) => { config.plugins.unshift(grabby.webpack()); return config; } };
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
```tsx
|
|
304
|
+
// a client component in your root layout
|
|
305
|
+
'use client';
|
|
306
|
+
useEffect(() => {
|
|
307
|
+
if (process.env.NODE_ENV === 'development') import('@githumbi/grabby').then((g) => g.initGrabby());
|
|
308
|
+
}, []);
|
|
309
|
+
```
|
|
310
|
+
</details>
|
|
311
|
+
|
|
312
|
+
<details>
|
|
313
|
+
<summary><strong>Any site, no build step</strong></summary>
|
|
314
|
+
|
|
315
|
+
```html
|
|
316
|
+
<script src="https://cdn.jsdelivr.net/npm/@githumbi/grabby@<version>/dist/grabby.global.js" defer></script>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Use an exact version, never a range. Running `npx @githumbi/grabby init --dry-run` in an empty folder prints this tag with the current version and an `integrity` hash, so a tampered CDN copy won't run.
|
|
320
|
+
</details>
|
|
321
|
+
|
|
322
|
+
Start your dev server as usual. The Grabby toolbar appears the first time you press the shortcut.
|
|
323
|
+
|
|
324
|
+
### 2. Leave comments
|
|
325
|
+
|
|
326
|
+
1. Press **Option+G** (Mac) or **Alt+G** (Windows, Linux), or click the hand icon, to enter selection mode.
|
|
327
|
+
2. Hover: every element shows its component and source file, like the picture at the top. Click the one you want to change. Clicking an icon inside a button selects the button; hold **Shift** to pick the exact inner element.
|
|
328
|
+
3. Type what should change and press **Enter**. Grabby saves it with a screenshot.
|
|
329
|
+
|
|
330
|
+
<p align="center"><img src="https://raw.githubusercontent.com/githumbi/grabby/main/docs/images/dev-comment.png" alt="The comment box open next to the Choose Pro button, with a comment typed in" width="820"></p>
|
|
331
|
+
|
|
332
|
+
4. Keep going. The badge on the clock icon counts your comments, and the list shows them with thumbnails, their kind and file. Click one to edit it.
|
|
333
|
+
|
|
334
|
+
<p align="center"><img src="https://raw.githubusercontent.com/githumbi/grabby/main/docs/images/dev-comments.png" alt="The comments list with two comments, each with a thumbnail, its kind (action, field) and source file" width="820"></p>
|
|
335
|
+
|
|
336
|
+
### 3. Hand them to your agent
|
|
337
|
+
|
|
338
|
+
**Copy all** opens a preview of exactly what your agent will get. Pick a detail level, edit the text if you like, then **Copy & clear** (with Undo, just in case) or **Copy, keep comments**, and paste it into your agent.
|
|
339
|
+
|
|
340
|
+
<p align="center"><img src="https://raw.githubusercontent.com/githumbi/grabby/main/docs/images/dev-copy-all.png" alt="The Copy all preview: Compact, Standard and Detailed levels, the export text and a token estimate" width="820"></p>
|
|
341
|
+
|
|
342
|
+
```text
|
|
343
|
+
# UI feedback · 2 comments
|
|
344
|
+
localhost:5173 · React · page /pricing · 1440×900 · 2026-09-26
|
|
345
|
+
|
|
346
|
+
## src/components/PlanCard.tsx · PlanCard
|
|
347
|
+
1. Highlight the Pro plan button
|
|
348
|
+
- `<button class="btn">Choose Pro</button>` (action) line 15
|
|
349
|
+
- styles: bg #2563eb · color #fff · weight 600 · padding 10px 14px · radius 8px
|
|
350
|
+
- inside: App (App.tsx:11)
|
|
351
|
+
2. Stack the cards vertically on mobile
|
|
352
|
+
- `<article class="card">(4 elements)</article>` (container) line 9
|
|
353
|
+
- heading: Starter · contains: heading, p, list, button · size: 225×234
|
|
354
|
+
- layout: padding 20px · bg #fff · radius 12px · border 1px solid #e2e8f0
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
That's the whole export: no page dumps, around 150–300 tokens per comment. To skip copy and paste, let your agent read comments directly: see [Connect your AI agent](#connect-your-ai-agent).
|
|
358
|
+
|
|
359
|
+
| Key | |
|
|
360
|
+
|---|---|
|
|
361
|
+
| Option+G / Alt+G | Toggle selection mode |
|
|
362
|
+
| F | Freeze the page while selecting, to grab menus, tooltips and hover states |
|
|
363
|
+
| Enter / Shift+Enter | Save comment / new line |
|
|
364
|
+
| Esc | Cancel, close the panel, or leave selection mode |
|
|
365
|
+
| ⌘/Ctrl+Enter | Copy & clear, in the Copy dialog |
|
|
193
366
|
|
|
194
367
|
## Framework support
|
|
195
368
|
|
|
@@ -237,9 +410,10 @@ Mark parts of your page:
|
|
|
237
410
|
|
|
238
411
|
- **Form values are never captured.** Neither are hidden inputs, inline event handlers or inline styles. Captured text is scrubbed of email addresses, long numbers (cards, accounts), JWTs and bearer tokens, and routes drop their query string and token-bearing hashes unless you allow a parameter.
|
|
239
412
|
- **The UI is isolated** in a shadow root and built without `innerHTML`, so page CSS can't break it and nothing a user types can run as code. It works under strict CSP (`style-src 'self'`) and Trusted Types.
|
|
240
|
-
- **The collector** stays on localhost unless started with `--public
|
|
413
|
+
- **The collector** stays on localhost unless started with `--public` (or deployed to Cloudflare), and then refuses to work without an admin token, a project key and a list of allowed sites. The public key can only add comments; reading, resolving and deleting need the admin token or the inbox link. Input is validated and size-capped, screenshots are checked by their bytes, only the browser that wrote a comment can attach its screenshot, and requests are rate-limited. Locally, it rejects DNS-rebinding attempts.
|
|
414
|
+
- **The inbox link** carries its token after `#`, which browsers never send to servers or in Referer headers; the page moves it out of the address bar at once. The token can read and resolve comments but not change settings, and `share --rotate` revokes it. The inbox page is built without `innerHTML` and served with a strict Content-Security-Policy. `.grabby/config.json` holds the admin token: it's owner-only and gitignored, and never written to `.mcp.json`.
|
|
241
415
|
- **Comments are user input.** MCP results tell your agent to treat them as data, not instructions. Review what an agent does with feedback from people you don't know.
|
|
242
|
-
- **Supply chain.** Neither package has install scripts. Everything Grabby generates for you is pinned to an exact version: the `.mcp.json` entry and `grabby pull` run one specific `@githumbi/grabby-server` release (re-run `npx grabby add mcp` after upgrading to move it),
|
|
416
|
+
- **Supply chain.** Neither package has install scripts. Everything Grabby generates for you is pinned to an exact version: the `.mcp.json` entry and `grabby pull` run one specific `@githumbi/grabby-server` release (re-run `npx @githumbi/grabby add mcp` after upgrading to move it), the CDN tag from `share` and `init` carries integrity hashes, and `share` deploys the exact Worker file published to npm, using a pinned Wrangler with install scripts off. Releases are built in CI and published with npm trusted publishing and provenance; see [SECURITY.md](SECURITY.md#how-releases-are-protected) for how the repository itself is hardened.
|
|
243
417
|
|
|
244
418
|
Report vulnerabilities privately; see [SECURITY.md](SECURITY.md).
|
|
245
419
|
|
|
@@ -248,7 +422,7 @@ Report vulnerabilities privately; see [SECURITY.md](SECURITY.md).
|
|
|
248
422
|
| | |
|
|
249
423
|
|---|---|
|
|
250
424
|
| [`@githumbi/grabby`](packages/grabby) | The toolbar, framework adapters, build plugin, CLI |
|
|
251
|
-
| [`@githumbi/grabby-server`](packages/server) |
|
|
425
|
+
| [`@githumbi/grabby-server`](packages/server) | The collector (Cloudflare Worker or Node), inbox, alerts, MCP server, `pull` |
|
|
252
426
|
|
|
253
427
|
## Contributing
|
|
254
428
|
|
package/dist/angular/index.js
CHANGED
|
@@ -2960,13 +2960,14 @@ function createCoachMark() {
|
|
|
2960
2960
|
// src/core/sync/outbox.ts
|
|
2961
2961
|
var STORE_KEY = "grabby:v1:outbox";
|
|
2962
2962
|
var BACKOFF = [2e3, 1e4, 3e4, 12e4, 3e5, 6e5];
|
|
2963
|
-
var
|
|
2963
|
+
var GIVE_UP_AFTER_MS = 14 * 24 * 60 * 60 * 1e3;
|
|
2964
2964
|
var KEEPALIVE_MAX = 6e4;
|
|
2965
2965
|
function loadJobs() {
|
|
2966
2966
|
try {
|
|
2967
2967
|
const raw = localStorage.getItem(STORE_KEY);
|
|
2968
2968
|
const jobs = raw ? JSON.parse(raw) : [];
|
|
2969
|
-
|
|
2969
|
+
if (!Array.isArray(jobs)) return [];
|
|
2970
|
+
return jobs.filter((j) => typeof j.id === "string" && (j.kind === "comment" || j.kind === "shot")).map((j) => typeof j.created === "number" ? j : { ...j, created: Date.now() });
|
|
2970
2971
|
} catch {
|
|
2971
2972
|
return [];
|
|
2972
2973
|
}
|
|
@@ -2994,7 +2995,7 @@ function createOutbox(deps) {
|
|
|
2994
2995
|
}
|
|
2995
2996
|
function add(id, kind) {
|
|
2996
2997
|
if (jobs.some((j) => j.id === id && j.kind === kind)) return;
|
|
2997
|
-
jobs.push({ id, kind, attempts: 0, next: 0 });
|
|
2998
|
+
jobs.push({ id, kind, attempts: 0, next: 0, created: Date.now() });
|
|
2998
2999
|
save();
|
|
2999
3000
|
schedule(0);
|
|
3000
3001
|
}
|
|
@@ -3063,14 +3064,14 @@ function createOutbox(deps) {
|
|
|
3063
3064
|
} catch {
|
|
3064
3065
|
outcome = "retry";
|
|
3065
3066
|
}
|
|
3066
|
-
if (outcome === "retry" &&
|
|
3067
|
+
if (outcome === "retry" && Date.now() - job.created < GIVE_UP_AFTER_MS) {
|
|
3067
3068
|
job.attempts += 1;
|
|
3068
3069
|
job.next = Date.now() + BACKOFF[Math.min(job.attempts - 1, BACKOFF.length - 1)];
|
|
3069
3070
|
if (job.kind === "comment") deps.onState(job.id, "pending");
|
|
3070
3071
|
} else {
|
|
3071
3072
|
jobs = jobs.filter((j) => j !== job);
|
|
3072
3073
|
if (job.kind === "comment" && outcome === "done") deps.onState(job.id, "sent");
|
|
3073
|
-
if (job.kind === "comment" && outcome === "retry") deps.onState(job.id, "failed", "
|
|
3074
|
+
if (job.kind === "comment" && outcome === "retry") deps.onState(job.id, "failed", "could not reach the feedback server for 14 days");
|
|
3074
3075
|
}
|
|
3075
3076
|
save();
|
|
3076
3077
|
}
|