@githumbi/grabby 0.1.2 → 0.2.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/CHANGELOG.md +20 -0
- package/README.md +223 -135
- package/dist/angular/index.js +6 -5
- package/dist/angular/index.js.map +1 -1
- package/dist/cli/index.js +535 -20
- 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,25 @@
|
|
|
1
1
|
# @githumbi/grabby
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0fa0419: `share` no longer fails with "could not create the inbox link (404)" right after setting up a new collector: it waits while the new Worker reaches all of Cloudflare's servers. It also saves its settings as soon as the collector exists, so if a later step fails, running `share` again just works instead of asking for `--rotate-admin`.
|
|
8
|
+
|
|
9
|
+
`share` now also adds the script to Astro sites: the one layout in `src/layouts/` that renders `</body>`, as an `is:inline` tag so Astro leaves it as written.
|
|
10
|
+
|
|
11
|
+
## 0.2.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 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.
|
|
16
|
+
|
|
17
|
+
Also new: `npx @githumbi/grabby inbox` opens the inbox, and `npx @githumbi/grabby alerts --slack <webhook>` posts new feedback to Slack.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 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.
|
|
22
|
+
|
|
3
23
|
## 0.1.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,34 +1,230 @@
|
|
|
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
|
-
<p align="center"><img src="https://raw.githubusercontent.com/githumbi/grabby/main/docs/images/
|
|
6
|
-
|
|
7
|
-
Grabby adds a small toolbar to your app. Click an element, type a comment, and Grabby records where that element lives in your code (component, `file:line`), what it is (a button, a form field, a card…), the few styles that matter, and a screenshot. Collect as many comments as you like, then **Copy all** and paste into Claude, Cursor, Copilot or ChatGPT, or let your agent read them directly over MCP.
|
|
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>
|
|
8
6
|
|
|
9
|
-
|
|
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.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|---|---|---|
|
|
13
|
-
| Who comments | You (and your team) while building | Clients, testers, stakeholders |
|
|
14
|
-
| Where | Your local dev server | Your deployed site (production or staging) |
|
|
15
|
-
| What visitors see | Nothing: it's left out of production builds | Nothing, unless they open your feedback link |
|
|
16
|
-
| Where comments go | Your browser, then **Copy all** or your agent (MCP) | A small collector you host, then `pull` or MCP |
|
|
17
|
-
| Setup | [Install the package](#developer-mode) | [Run a collector and add one script tag](#live-feedback-on-your-deployed-site) |
|
|
9
|
+
Setting it up is one command, and it works with Next.js, Astro, React, Vue, Svelte, Angular and plain HTML sites, wherever they're hosted.
|
|
18
10
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- [
|
|
22
|
-
- [Live feedback on your deployed site](#live-feedback-on-your-deployed-site)
|
|
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)
|
|
23
14
|
- [What gets captured](#what-gets-captured)
|
|
24
15
|
- [Connect your AI agent](#connect-your-ai-agent)
|
|
25
|
-
- [
|
|
26
|
-
- [Configuration](#configuration)
|
|
27
|
-
|
|
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)
|
|
29
|
+
```
|
|
30
|
+
|
|
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.
|
|
34
|
+
|
|
35
|
+
## Get feedback on your live site
|
|
36
|
+
|
|
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
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx @githumbi/grabby share
|
|
47
|
+
```
|
|
48
|
+
|
|
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:
|
|
50
|
+
|
|
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, the layout in `src/layouts/` in Astro, `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`.
|
|
56
|
+
|
|
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
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 2. Deploy your site
|
|
71
|
+
|
|
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
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
That's the last time you need to change your site for Grabby.
|
|
79
|
+
|
|
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_…
|
|
86
|
+
```
|
|
28
87
|
|
|
29
|
-
|
|
88
|
+
Reviewers get a **Comment** button and a short three-step tip:
|
|
30
89
|
|
|
31
|
-
|
|
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**.
|
|
93
|
+
|
|
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 })`.
|
|
95
|
+
|
|
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>
|
|
97
|
+
|
|
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.
|
|
99
|
+
|
|
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>
|
|
101
|
+
|
|
102
|
+
### 4. Read the feedback
|
|
103
|
+
|
|
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
|
|
116
|
+
```
|
|
117
|
+
|
|
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)
|
|
126
|
+
```
|
|
127
|
+
|
|
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".
|
|
129
|
+
|
|
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/…
|
|
134
|
+
```
|
|
135
|
+
|
|
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.
|
|
137
|
+
|
|
138
|
+
### Everyday tasks
|
|
139
|
+
|
|
140
|
+
| To… | Run |
|
|
141
|
+
|---|---|
|
|
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`.
|
|
194
|
+
|
|
195
|
+
## What gets captured
|
|
196
|
+
|
|
197
|
+
Grabby looks at *what kind* of element you clicked and keeps only what matters for it:
|
|
198
|
+
|
|
199
|
+
| Kind | Captured |
|
|
200
|
+
|---|---|
|
|
201
|
+
| **Action**: button, link, tab | label, href path, state (disabled, expanded, selected), custom styles |
|
|
202
|
+
| **Form field** | label, type, placeholder, required/invalid. **Never the value.** |
|
|
203
|
+
| **Text** | text (up to 120 chars), font size, weight, colour, line height |
|
|
204
|
+
| **Media** | alt text (or that it's missing), file name, rendered vs natural size |
|
|
205
|
+
| **Container / card** | heading, a summary of what's inside ("heading, 3× PlanCard, button"), layout styles |
|
|
206
|
+
| **Page section** | page title, viewport, regions and components on the page. No HTML. |
|
|
207
|
+
|
|
208
|
+
Every comment also carries the component, source file and line, up to three of *your* components above it (library frames are skipped), a trimmed HTML preview capped at 300 characters, and a screenshot. Styles are compared against browser defaults, so only the values your code set are reported.
|
|
209
|
+
|
|
210
|
+
The export names the page once, groups comments by file, and skips anything already visible in the preview. **Compact** is one line per comment; **Detailed** adds ancestors, position and all custom styles for tricky layout bugs. Twenty mixed comments fit comfortably under 6k tokens at the default level.
|
|
211
|
+
|
|
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.
|
|
213
|
+
|
|
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.
|
|
224
|
+
|
|
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>
|
|
226
|
+
|
|
227
|
+
### 1. Install for development
|
|
32
228
|
|
|
33
229
|
You need Node 20 or newer. In your project folder, run:
|
|
34
230
|
|
|
@@ -117,10 +313,10 @@ useEffect(() => {
|
|
|
117
313
|
<summary><strong>Any site, no build step</strong></summary>
|
|
118
314
|
|
|
119
315
|
```html
|
|
120
|
-
<script src="https://cdn.jsdelivr.net/npm/@githumbi/grabby
|
|
316
|
+
<script src="https://cdn.jsdelivr.net/npm/@githumbi/grabby@<version>/dist/grabby.global.js" defer></script>
|
|
121
317
|
```
|
|
122
318
|
|
|
123
|
-
Use an exact version,
|
|
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.
|
|
124
320
|
</details>
|
|
125
321
|
|
|
126
322
|
Start your dev server as usual. The Grabby toolbar appears the first time you press the shortcut.
|
|
@@ -168,115 +364,6 @@ That's the whole export: no page dumps, around 150–300 tokens per comment. To
|
|
|
168
364
|
| Esc | Cancel, close the panel, or leave selection mode |
|
|
169
365
|
| ⌘/Ctrl+Enter | Copy & clear, in the Copy dialog |
|
|
170
366
|
|
|
171
|
-
## Live feedback on your deployed site
|
|
172
|
-
|
|
173
|
-
Collect comments from clients, stakeholders or testers on your real site. Ordinary visitors see nothing and download almost nothing (a loader under 500 bytes). Reviewers open a feedback link, and every comment arrives tagged with who left it.
|
|
174
|
-
|
|
175
|
-
You'll set up two things: a small **collector** that receives comments, and one **script tag** on your site.
|
|
176
|
-
|
|
177
|
-
### 1. Run a collector
|
|
178
|
-
|
|
179
|
-
The collector is a small Node server with no database and no native dependencies. It runs anywhere Node 20 or Docker does: your own server, Fly.io, Render, Railway…
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
npx -y @githumbi/grabby-server@0.1.0 init --origin https://your-site.com
|
|
183
|
-
npx -y @githumbi/grabby-server@0.1.0 start --public
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
`init` prints two values. Keep them:
|
|
187
|
-
|
|
188
|
-
- a **project key** (`pk_…`): public, it goes into your site;
|
|
189
|
-
- an **admin token** (`sk_…`): secret, only for you and your agent.
|
|
190
|
-
|
|
191
|
-
Put the collector behind HTTPS (for example `https://feedback.your-site.com`). Deployment guides for Docker, Fly.io, Render and Railway are in [packages/server](packages/server/README.md).
|
|
192
|
-
|
|
193
|
-
### 2. Add Grabby to your site
|
|
194
|
-
|
|
195
|
-
Add this before `</body>`:
|
|
196
|
-
|
|
197
|
-
```html
|
|
198
|
-
<script
|
|
199
|
-
src="https://cdn.jsdelivr.net/npm/@githumbi/grabby@0.1.1/dist/loader.global.js"
|
|
200
|
-
data-mode="live"
|
|
201
|
-
data-server="https://feedback.your-site.com"
|
|
202
|
-
data-project-key="pk_…"
|
|
203
|
-
defer
|
|
204
|
-
></script>
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
For production, also add integrity hashes so a tampered CDN copy can't run. Run `npx @githumbi/grabby init --live --server https://feedback.your-site.com --key pk_… --dry-run` in an empty folder, and it prints this tag with `integrity` (for the loader) and `data-integrity` (for the full build it fetches) filled in. Always use an exact version, never a range like `@0.1`.
|
|
208
|
-
|
|
209
|
-
Using a bundler instead? Install `@githumbi/grabby` as a normal dependency and call:
|
|
210
|
-
|
|
211
|
-
```ts
|
|
212
|
-
import { initGrabbyLive } from '@githumbi/grabby/live';
|
|
213
|
-
|
|
214
|
-
initGrabbyLive({ server: 'https://feedback.your-site.com', projectKey: 'pk_…' });
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### 3. Share the feedback link
|
|
218
|
-
|
|
219
|
-
Send reviewers your page with `?grabby=` and your project key:
|
|
220
|
-
|
|
221
|
-
```text
|
|
222
|
-
https://your-site.com/?grabby=pk_…
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
They get a **Comment** button and a short three-step tip. No account or install needed.
|
|
226
|
-
|
|
227
|
-
<p align="center"><img src="https://raw.githubusercontent.com/githumbi/grabby/main/docs/images/live-welcome.png" alt="A live site opened with the feedback link: the tip explains Comment, click, type, and the toolbar shows a Comment button" width="820"></p>
|
|
228
|
-
|
|
229
|
-
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 })`.
|
|
230
|
-
|
|
231
|
-
<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>
|
|
232
|
-
|
|
233
|
-
Each comment is sent as soon as it's saved. It's kept in the browser first and retried until it reaches your collector, so a bad connection doesn't lose it, and closing the tab with a half-typed or unsent comment brings up the browser's "Leave site?" prompt. The toolbar shows how many were sent. When reviewers are done, **Finish review** shows what reached you; **Done** clears their list for another round.
|
|
234
|
-
|
|
235
|
-
<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>
|
|
236
|
-
|
|
237
|
-
### 4. Pull the feedback into your agent
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
npx -y @githumbi/grabby-server@0.1.0 pull --server https://feedback.your-site.com --token sk_…
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
This prints every open comment, grouped by file and labelled by author, and saves the screenshots to `./.grabby/screenshots/` where your agent can open them:
|
|
244
|
-
|
|
245
|
-
```text
|
|
246
|
-
3. Make this button green so it matches our brand
|
|
247
|
-
- `<button class="cta">Start free trial</button>` (action) Hero
|
|
248
|
-
- styles: bg #111827 · color #fff · size 16px · weight 600 · padding 14px 22px · radius 10px
|
|
249
|
-
- screenshot: .grabby/screenshots/9c1f….webp
|
|
250
|
-
- by Amina (client)
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
The comments are then marked resolved, so the next pull shows only new feedback. Use `--keep` to leave them open or `--delete` to remove them. Or give your agent the collector over MCP (next section) and ask it to "fix the open Grabby comments".
|
|
254
|
-
|
|
255
|
-
## What gets captured
|
|
256
|
-
|
|
257
|
-
Grabby looks at *what kind* of element you clicked and keeps only what matters for it:
|
|
258
|
-
|
|
259
|
-
| Kind | Captured |
|
|
260
|
-
|---|---|
|
|
261
|
-
| **Action**: button, link, tab | label, href path, state (disabled, expanded, selected), custom styles |
|
|
262
|
-
| **Form field** | label, type, placeholder, required/invalid. **Never the value.** |
|
|
263
|
-
| **Text** | text (up to 120 chars), font size, weight, colour, line height |
|
|
264
|
-
| **Media** | alt text (or that it's missing), file name, rendered vs natural size |
|
|
265
|
-
| **Container / card** | heading, a summary of what's inside ("heading, 3× PlanCard, button"), layout styles |
|
|
266
|
-
| **Page section** | page title, viewport, regions and components on the page. No HTML. |
|
|
267
|
-
|
|
268
|
-
Every comment also carries the component, source file and line, up to three of *your* components above it (library frames are skipped), a trimmed HTML preview capped at 300 characters, and a screenshot. Styles are compared against browser defaults, so only the values your code set are reported.
|
|
269
|
-
|
|
270
|
-
The export names the page once, groups comments by file, and skips anything already visible in the preview. **Compact** is one line per comment; **Detailed** adds ancestors, position and all custom styles for tricky layout bugs. Twenty mixed comments fit comfortably under 6k tokens at the default level.
|
|
271
|
-
|
|
272
|
-
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.
|
|
273
|
-
|
|
274
|
-
## Connect your AI agent
|
|
275
|
-
|
|
276
|
-
- **Copy all**: paste into any chat or agent.
|
|
277
|
-
- **MCP**: run `npx @githumbi/grabby add mcp`. Your agent gets `grabby_list_comments`, `grabby_get_comment` (with the screenshot), `grabby_resolve` and `grabby_stats`. Locally it also collects comments: set `initGrabby({ server: 'http://localhost:3456' })`. Against a deployed collector, add `--server <url> --token <sk_…>` to the MCP command.
|
|
278
|
-
- **`pull`**: prints the same export as Copy all, for scripts and terminal agents.
|
|
279
|
-
|
|
280
367
|
## Framework support
|
|
281
368
|
|
|
282
369
|
| Stack | Component names | Source location | Setup |
|
|
@@ -323,9 +410,10 @@ Mark parts of your page:
|
|
|
323
410
|
|
|
324
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.
|
|
325
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.
|
|
326
|
-
- **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`.
|
|
327
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.
|
|
328
|
-
- **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),
|
|
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.
|
|
329
417
|
|
|
330
418
|
Report vulnerabilities privately; see [SECURITY.md](SECURITY.md).
|
|
331
419
|
|
|
@@ -334,7 +422,7 @@ Report vulnerabilities privately; see [SECURITY.md](SECURITY.md).
|
|
|
334
422
|
| | |
|
|
335
423
|
|---|---|
|
|
336
424
|
| [`@githumbi/grabby`](packages/grabby) | The toolbar, framework adapters, build plugin, CLI |
|
|
337
|
-
| [`@githumbi/grabby-server`](packages/server) |
|
|
425
|
+
| [`@githumbi/grabby-server`](packages/server) | The collector (Cloudflare Worker or Node), inbox, alerts, MCP server, `pull` |
|
|
338
426
|
|
|
339
427
|
## Contributing
|
|
340
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
|
}
|