mushi-mushi 0.7.2 → 0.7.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/CONTRIBUTING.md +0 -11
- package/README.md +191 -222
- package/dist/index.js +1 -1
- package/package.json +11 -11
package/CONTRIBUTING.md
CHANGED
|
@@ -101,17 +101,6 @@ Releases are fully automated. Maintainers don't run `npm publish` by hand.
|
|
|
101
101
|
|
|
102
102
|
If GitHub's anti-loop protection suppresses the auto re-fire (the squash merge can be attributed to `github-actions[bot]`), trigger the workflow manually: **Actions → release → Run workflow → master**.
|
|
103
103
|
|
|
104
|
-
### Known CI/CD quirks and their automatic safeguards
|
|
105
|
-
|
|
106
|
-
A handful of GitHub-Actions × Changesets edge cases have caused release-pipeline stalls in the past. Each is now caught automatically — keep these in mind when you see the symptom:
|
|
107
|
-
|
|
108
|
-
| Symptom | Root cause | Automatic safeguard |
|
|
109
|
-
| --- | --- | --- |
|
|
110
|
-
| The `Build & Test` required check never registers on the `chore: version packages` PR — the PR stays "Required check missing" forever | `changeset-release/master` is pushed by `github-actions[bot]`. GitHub silently drops the downstream `pull_request` event to prevent bot loops (observed on PR #45, #102, #124). | `ci.yml` now also triggers on `push` to `changeset-release/master`, so `Build & Test` reports against the head commit directly. No empty-commit nudge needed. |
|
|
111
|
-
| Release workflow fails with `No commits between master and changeset-release/master` after merging a PR with a new changeset. | A `.changeset/*.md` file whose YAML frontmatter only targets packages listed in `.changeset/config.json#ignore` (e.g. `@mushi-mushi/server`, `@mushi-mushi/admin`). `changeset version` produces no bumps, the version PR is empty, the next push errors (PR #102 / #121, 2026-05-19). | `pnpm check:changeset-orphans` runs in both `ci.yml` and `release.yml`. PR CI fails with an actionable message naming the orphan file *before* it can reach master. If you legitimately need to record an internal-only change, omit the changeset entirely — the diff lives in git history. |
|
|
112
|
-
| Release workflow's `Audit signatures of installed dependencies` step fails with `npm ETARGET / No matching version found for @mushi-mushi/<pkg>@<ver>` seconds after the publish step succeeded. | npm's registry CDN can take up to ~30s to propagate a freshly-published manifest. The audit step shells out to `npm install` against the just-published version and races the CDN (observed 2026-05-20, run 26149167393). | The audit step retries with exponential backoff (1, 2, 4, 8, 16, 32s — 63s total) before failing. Sigstore signatures are written at publish time, so a one-off audit failure never indicates a corrupted package — `pnpm view <pkg> version` is the ground truth. |
|
|
113
|
-
| Push to `master` after merging a PR doesn't fire the `Release` workflow. | Same anti-loop protection: when a squash merge is attributed to `github-actions[bot]`, GitHub may suppress the downstream `push` trigger. Sporadic — observed twice in the last 60 days. | `release.yml` keeps `workflow_dispatch` as the manual fallback. Recovery: **Actions → Release → Run workflow → master**. The `Build & Verify` job re-runs identically to the auto-fired path. |
|
|
114
|
-
|
|
115
104
|
### Adding a brand-new publishable package
|
|
116
105
|
|
|
117
106
|
Trusted Publisher bindings are configured **per package** on `npmjs.com` and require the package to already exist on the registry. New packages therefore need a one-time bootstrap before OIDC can take over.
|
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# mushi-mushi 🐛
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**Ship a shake-to-report button. Get AI-classified, deduped, ready-to-fix bug reports.**
|
|
6
6
|
|
|
7
|
-
`npx
|
|
7
|
+
One `npx` command. Works with React, Next.js, Vue, Nuxt, Svelte, SvelteKit, Angular, React Native, Expo, Capacitor, and vanilla JS.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/mushi-mushi)
|
|
10
10
|
[](https://www.npmjs.com/package/mushi-mushi)
|
|
@@ -17,127 +17,187 @@
|
|
|
17
17
|
<img src="https://raw.githubusercontent.com/kensaurus/mushi-mushi/master/docs/screenshots/report-detail-dark.png" alt="A real user-felt bug inside the Mushi admin — Plan / Do / Check / Act PDCA receipt across the top, the original user description, LLM classification (Confusing UX · Medium · 78% confidence · component = Dashboard/HeroCTA), environment + performance metrics, and a one-click Dispatch-fix CTA." width="860" />
|
|
18
18
|
</a>
|
|
19
19
|
|
|
20
|
-
<sub>↑ a real user report, classified and
|
|
20
|
+
<sub>↑ a real user report, fully classified and ready to dispatch as a GitHub PR · <a href="https://kensaur.us/mushi-mushi/">open the live demo</a></sub>
|
|
21
21
|
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## What does it actually do? (60 seconds, no jargon)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Your users open your app, something feels broken — a button that doesn't react, a page that takes forever, a layout that folds in half on their phone — and they leave. Your error tracker stays silent because nothing technically _crashed_.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Mushi adds a small **"shake your phone (or click the bug)"** button. The user taps it, scribbles a note, and Mushi captures everything around the moment: a screenshot, the page they were on, what they were trying to do, and the last few seconds of network and console activity. An AI then reads that report, tags it with severity and category in plain English, groups it with similar reports so you see one row per actual bug, and (optionally) hands it off to another AI that opens a draft pull request with a proposed fix. **A human always reviews and merges** — the loop never bypasses you.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Founders, PMs, designers: see the [60-second tour in the GitHub README](https://github.com/kensaurus/mushi-mushi#read-this-first-if-youre-not-a-developer).
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Install in one line
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx mushi-mushi
|
|
40
|
+
```
|
|
36
41
|
|
|
37
|
-
|
|
38
|
-
> — Matthew Syed, *Black Box Thinking* (2015, p. 9)
|
|
42
|
+
The wizard detects your framework, installs the right SDK, writes env vars to `.env.local` (with the right prefix — `NEXT_PUBLIC_`, `NUXT_PUBLIC_`, or `VITE_`), and prints the snippet to paste into your app. **Non-destructive**: never overwrites existing env vars, never edits your source.
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
```tsx
|
|
45
|
+
// After the wizard runs (React example):
|
|
46
|
+
import { MushiProvider } from '@mushi-mushi/react';
|
|
47
|
+
|
|
48
|
+
export function App({ children }) {
|
|
49
|
+
return (
|
|
50
|
+
<MushiProvider config={{ projectId: 'proj_xxx', apiKey: 'mushi_xxx' }}>
|
|
51
|
+
{children}
|
|
52
|
+
</MushiProvider>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
That's it. Your users now have a shake-to-report button (or a floating widget). Reports land in [your admin console](https://kensaur.us/mushi-mushi/), classified by an LLM within seconds.
|
|
42
58
|
|
|
43
59
|
---
|
|
44
60
|
|
|
45
|
-
##
|
|
61
|
+
## What you get
|
|
62
|
+
|
|
63
|
+
- **Shake-to-report widget** — Shadow-DOM, zero CSS conflicts. Ships with screenshot, console ring, network ring, route + intent capture, and an offline queue.
|
|
64
|
+
- **AI-classified reports** — 2-stage pipeline (Haiku fast-filter → Sonnet deep + vision + RAG) tags each report with category, severity, confidence, and the component path. Stage 2 streams partial results to the admin UI as tokens arrive.
|
|
65
|
+
- **Dedup by meaning, not by string** — pgvector knowledge graph collapses duplicate reports across users, routes, and deploys so your queue isn't a noise storm.
|
|
66
|
+
- **Bidirectional inventory (v2)** — opt in to `capture: { discoverInventory: true }` and the SDK quietly observes routes, `data-testid`s, and outbound API paths in production. Claude drafts an `inventory.yaml` of user stories + pages + actions for you to accept — most teams will never hand-author one.
|
|
67
|
+
- **Five pre-release gates (v2)** — `mushi-mushi/no-dead-handler`, `mushi-mushi/no-mock-leak`, inventory drift, agentic-failure detection, synthetic walk health. One composite GitHub status check via the [Mushi Mushi CI Gate Action](https://github.com/kensaurus/mushi-mushi/tree/master/packages/mcp-ci).
|
|
68
|
+
- **Spec-traced fixes (v2.10)** — every dispatched fix carries the inventory `Action` it's meant to repair, the `expected_outcome` contract is rendered into the LLM prompt, a deterministic `validateAgainstSpec` gate fires before the PR opens, and a targeted synthetic probe runs the moment the PR lands.
|
|
69
|
+
- **One-click "Dispatch fix"** — agentic orchestrator opens a GitHub PR with a screenshot diff and a Playwright replay. Sandbox-pluggable (`e2b`, `modal`, `cloudflare`, or your own).
|
|
70
|
+
- **Standards-first integrator** — W3C `traceparent` end-to-end, Standard Webhooks signing on every outbound delivery, RFC-draft `Idempotency-Key` middleware, OAuth 2.0 Dynamic Client Registration, OTLP/HTTP+JSON BYOK exporter. You bring your own observability stack — Mushi never marks up tokens.
|
|
71
|
+
- **Agent-native via MCP + A2A** — MCP Streamable HTTP at `/functions/v1/mcp`, A2A v1.0.0 tasks at `/v1/a2a/tasks` (pull SSE _and_ push notifications), Agent Card discovery, OpenAPI 3.1 spec. Cursor, Claude Code, Copilot, OpenAI Agents SDK, LangGraph, CrewAI all see the same surface.
|
|
46
72
|
|
|
47
|
-
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Who it's for
|
|
48
76
|
|
|
49
|
-
|
|
|
50
|
-
|
|
51
|
-
| **
|
|
52
|
-
| **
|
|
53
|
-
| **
|
|
54
|
-
| **
|
|
55
|
-
| **Fix it** | Assign Jira ticket → sprint → PR → review → deploy. | Click "Dispatch fix" → draft PR opens in minutes → you review and merge. |
|
|
56
|
-
| **Lesson encoded?** | No. It lives in a git commit message. | Yes. Vector-clustered into a named learning rule in `.mushi/lessons.json`. |
|
|
57
|
-
| **Next developer** | Makes the same class of mistake. | PR review gets the rule injected: *"Rule L-0042: never call setState in useEffect for derived values — seen 17 times."* |
|
|
58
|
-
| **Next AI agent** | Guesses from the same blank slate. | Cursor / Claude Code reads the lesson library via MCP before proposing a diff. |
|
|
59
|
-
| **Release accountability** | Nobody knows which user found which bug. | Auto-drafted changelog: *"Fixed by Kenji: Settings back-button counted safe-area inset twice."* |
|
|
77
|
+
| You are… | …and this helps because |
|
|
78
|
+
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
79
|
+
| **A solo dev / small team** shipping a consumer app | You already have Sentry for crashes — but users drop off over _friction_, not exceptions. Mushi captures "this button doesn't do anything". |
|
|
80
|
+
| **A PM or designer** living in the admin | Triage, severity, component ownership, and PR status — all in one dark-mode console. No reading stack traces. |
|
|
81
|
+
| **An AI-native team** already using Cursor / Claude | MCP tools expose the whole loop to your agent. `get_recent_reports`, `classify`, `dispatch_fix` — the same primitives your teammates use. |
|
|
82
|
+
| **An enterprise** needing SOC 2 + residency | Region-pinned data (US / EU / JP / SELF), SAML SSO, audit-log ingest, DSAR workflow, HMAC-signed plugin webhooks. |
|
|
60
83
|
|
|
61
84
|
---
|
|
62
85
|
|
|
63
|
-
##
|
|
86
|
+
## Mushi vs your existing stack
|
|
64
87
|
|
|
65
|
-
|
|
88
|
+
Mushi is a **companion** to Sentry/Datadog, not a replacement. It sees the bugs your crash tracker can't.
|
|
66
89
|
|
|
67
|
-
|
|
90
|
+
| Scenario | Sentry / Datadog | **Mushi Mushi** |
|
|
91
|
+
| --------------------------------------- | :--------------: | :-------------: |
|
|
92
|
+
| Unhandled JS exception | ✅ | ✅ |
|
|
93
|
+
| Button that _looks_ clickable but isn't | — | ✅ |
|
|
94
|
+
| 12-second page load, no error thrown | — | ✅ |
|
|
95
|
+
| User can't find the settings panel | — | ✅ |
|
|
96
|
+
| Layout broken on iPad Safari only | — | ✅ |
|
|
97
|
+
| Form submits but data doesn't save | ~ | ✅ |
|
|
98
|
+
| Feature silently regressed last deploy | ~ | ✅ |
|
|
99
|
+
| LLM-classified + deduped queue | — | ✅ |
|
|
100
|
+
| One-click AI fix → draft GitHub PR | — | ✅ |
|
|
68
101
|
|
|
69
|
-
|
|
70
|
-
- **Catches the invisible.** Dead buttons, 12-second screens, one-device layout bugs — the category of failures that Sentry, Datadog, and Firebase are structurally blind to.
|
|
71
|
-
- **Reports don't pile up.** pgvector dedup collapses the same broken thing across 40 users to one row. Your queue reflects reality, not noise.
|
|
72
|
-
- **The loop closes itself.** Bug → cluster → lesson → PR-review injection → agent memory. The next bug of the same class is stopped before it ships.
|
|
73
|
-
- **Bring your own AI keys.** You pay Anthropic and OpenAI directly, at your rate, with your data agreements. Mushi never marks up tokens or holds your data hostage.
|
|
74
|
-
- **Agent-native from day one.** MCP Streamable HTTP, A2A v1.0.0 tasks, OpenAPI 3.1. Cursor, Claude Code, Copilot, LangGraph, CrewAI all see the same surface the human admin does.
|
|
75
|
-
- **Standards-first.** W3C `traceparent` end-to-end, Standard Webhooks signing, RFC-draft `Idempotency-Key`, OAuth 2.0 Dynamic Client Registration. You bring your existing observability stack — Mushi slots in.
|
|
76
|
-
- **Self-host or cloud.** One Docker Compose file. One Helm chart (138 SQL migrations bundled). No vendor lock-in at the infra level.
|
|
77
|
-
- **Open-source SDK.** Every client package is MIT. Fork it, audit it, sell it — the trademarks are separate from the code.
|
|
102
|
+
> Already have Sentry? Mushi writes breadcrumbs into your existing Sentry session so you can jump from a crash to the user's own words in one click.
|
|
78
103
|
|
|
79
|
-
|
|
104
|
+
---
|
|
80
105
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
106
|
+
## Integrates with
|
|
107
|
+
|
|
108
|
+
**12 outbound plugins** — Mushi sends signals to whatever your team already lives in:
|
|
109
|
+
|
|
110
|
+
<table>
|
|
111
|
+
<tr>
|
|
112
|
+
<td align="center" width="110"><b>GitHub</b><br/><sub>Auto-draft PRs<br/>+ Checks API</sub></td>
|
|
113
|
+
<td align="center" width="110"><b>Sentry</b><br/><sub>Breadcrumb bridge<br/>+ session link</sub></td>
|
|
114
|
+
<td align="center" width="110"><b>Slack</b><br/><sub>Block Kit<br/>+ /mushi cmd</sub></td>
|
|
115
|
+
<td align="center" width="110"><b>Jira</b><br/><sub>OAuth 3LO<br/>bidir sync</sub></td>
|
|
116
|
+
<td align="center" width="110"><b>Linear</b><br/><sub>Issue create<br/>+ status sync</sub></td>
|
|
117
|
+
<td align="center" width="110"><b>PagerDuty</b><br/><sub>Severity-scoped<br/>escalation</sub></td>
|
|
118
|
+
</tr>
|
|
119
|
+
<tr>
|
|
120
|
+
<td align="center" width="110"><b>Discord</b><br/><sub>Embed messages<br/>per channel</sub></td>
|
|
121
|
+
<td align="center" width="110"><b>MS Teams</b><br/><sub>Adaptive cards<br/>+ on-call</sub></td>
|
|
122
|
+
<td align="center" width="110"><b>GitHub Issues</b><br/><sub>Labels<br/>+ assignees</sub></td>
|
|
123
|
+
<td align="center" width="110"><b>Bugsnag</b><br/><sub>Mirror + close<br/>on fix merge</sub></td>
|
|
124
|
+
<td align="center" width="110"><b>Rollbar</b><br/><sub>Mirror + resolve<br/>on fix merge</sub></td>
|
|
125
|
+
<td align="center" width="110"><b>Crashlytics</b><br/><sub>Push reports<br/>+ close</sub></td>
|
|
126
|
+
</tr>
|
|
127
|
+
<tr>
|
|
128
|
+
<td align="center" width="110"><b>Zapier</b><br/><sub>Generic<br/>webhook fan-out</sub></td>
|
|
129
|
+
<td align="center" width="110"><b>Langfuse</b><br/><sub>LLM trace<br/>deeplinks</sub></td>
|
|
130
|
+
<td align="center" width="110"><b>Cursor</b><br/><sub>via MCP<br/>server</sub></td>
|
|
131
|
+
<td align="center" width="110"><b>Claude Code</b><br/><sub>via MCP<br/>server</sub></td>
|
|
132
|
+
<td align="center" width="110"><b>OpenAI Agents</b><br/><sub>via A2A<br/>tasks</sub></td>
|
|
133
|
+
<td align="center" width="110"><b>LangGraph</b><br/><sub>via A2A<br/>+ MCP</sub></td>
|
|
134
|
+
</tr>
|
|
135
|
+
</table>
|
|
136
|
+
|
|
137
|
+
**11 inbound adapters** — Mushi receives alerts from your existing monitoring and turns them into the same triaged report rows as user-felt bugs:
|
|
138
|
+
|
|
139
|
+
> Sentry · Datadog · Bugsnag · Rollbar · Firebase Crashlytics · New Relic · Honeycomb · Grafana Loki · AWS CloudWatch · Opsgenie · Firebase Analytics
|
|
140
|
+
|
|
141
|
+
All of them ship in [`@mushi-mushi/adapters`](https://www.npmjs.com/package/@mushi-mushi/adapters) — drop them into any Node webhook server (Express / Fastify / Hono / serverless function).
|
|
87
142
|
|
|
88
143
|
---
|
|
89
144
|
|
|
90
|
-
##
|
|
145
|
+
## Framework support
|
|
91
146
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
147
|
+
| Framework | Install after wizard (automatic) |
|
|
148
|
+
| ------------------------------- | ------------------------------------------------- |
|
|
149
|
+
| React | `@mushi-mushi/react` |
|
|
150
|
+
| Next.js | `@mushi-mushi/react` |
|
|
151
|
+
| Vue 3 / Nuxt | `@mushi-mushi/vue` + `@mushi-mushi/web` |
|
|
152
|
+
| Svelte / SvelteKit | `@mushi-mushi/svelte` + `@mushi-mushi/web` |
|
|
153
|
+
| Angular 17+ | `@mushi-mushi/angular` + `@mushi-mushi/web` |
|
|
154
|
+
| React Native / Expo | `@mushi-mushi/react-native` |
|
|
155
|
+
| Capacitor / Ionic | `@mushi-mushi/capacitor` |
|
|
156
|
+
| Flutter / Dart | `pub add mushi_mushi` |
|
|
157
|
+
| iOS native (Swift) | Swift Package Manager — early dev |
|
|
158
|
+
| Android native (Kotlin/Java) | Gradle `dev.mushimushi:mushi-android` — early dev |
|
|
159
|
+
| Node (Express / Fastify / Hono) | `@mushi-mushi/node` (server-side error capture) |
|
|
160
|
+
| Vanilla JS | `@mushi-mushi/web` |
|
|
161
|
+
|
|
162
|
+
Prefer to skip the wizard? `npm i @mushi-mushi/react` (or your framework's package) and wire it up by hand.
|
|
95
163
|
|
|
96
|
-
|
|
164
|
+
---
|
|
97
165
|
|
|
98
|
-
|
|
99
|
-
// After the wizard — React / Next.js:
|
|
100
|
-
import { MushiProvider } from '@mushi-mushi/react';
|
|
166
|
+
## How the pipeline works
|
|
101
167
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
168
|
+
```
|
|
169
|
+
User hits widget ──▶ screenshot + console + network + intent
|
|
170
|
+
│
|
|
171
|
+
▼
|
|
172
|
+
Fast-filter (Haiku) ──▶ drops spam, keeps signal
|
|
173
|
+
│
|
|
174
|
+
▼
|
|
175
|
+
Deep classify (Sonnet + vision + RAG) ──▶ category, severity, component
|
|
176
|
+
│
|
|
177
|
+
▼
|
|
178
|
+
Dedup (pgvector) ──▶ groups repeat reports by meaning
|
|
179
|
+
│
|
|
180
|
+
▼
|
|
181
|
+
Judge (weekly) ──▶ scores classifier, retrains prompts
|
|
182
|
+
│
|
|
183
|
+
▼
|
|
184
|
+
"Dispatch fix" ──▶ agent opens a GitHub PR with Playwright replay + visual diff
|
|
109
185
|
```
|
|
110
186
|
|
|
111
|
-
|
|
187
|
+
See the full architecture in the [root README](https://github.com/kensaurus/mushi-mushi#architecture).
|
|
112
188
|
|
|
113
|
-
|
|
114
|
-
<summary><b>Other frameworks</b> — Vue, Svelte, Angular, React Native, Vanilla JS</summary>
|
|
115
|
-
|
|
116
|
-
```ts
|
|
117
|
-
// Vue 3 / Nuxt
|
|
118
|
-
import { MushiPlugin } from '@mushi-mushi/vue';
|
|
119
|
-
app.use(MushiPlugin, { projectId: 'proj_xxx', apiKey: 'mushi_xxx' });
|
|
120
|
-
|
|
121
|
-
// Svelte / SvelteKit
|
|
122
|
-
import { initMushi } from '@mushi-mushi/svelte';
|
|
123
|
-
initMushi({ projectId: 'proj_xxx', apiKey: 'mushi_xxx' });
|
|
124
|
-
|
|
125
|
-
// Angular 17+
|
|
126
|
-
import { provideMushi } from '@mushi-mushi/angular';
|
|
127
|
-
bootstrapApplication(AppComponent, {
|
|
128
|
-
providers: [provideMushi({ projectId: 'proj_xxx', apiKey: 'mushi_xxx' })],
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
// React Native / Expo
|
|
132
|
-
import { MushiProvider } from '@mushi-mushi/react-native';
|
|
133
|
-
<MushiProvider projectId="proj_xxx" apiKey="mushi_xxx"><App /></MushiProvider>;
|
|
134
|
-
|
|
135
|
-
// Vanilla JS / any framework
|
|
136
|
-
import { Mushi } from '@mushi-mushi/web';
|
|
137
|
-
Mushi.init({ projectId: 'proj_xxx', apiKey: 'mushi_xxx' });
|
|
138
|
-
```
|
|
189
|
+
---
|
|
139
190
|
|
|
140
|
-
|
|
191
|
+
## 30-second quick start
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# 1. Drop the wizard in (or one of the equivalents below)
|
|
195
|
+
npx mushi-mushi
|
|
196
|
+
|
|
197
|
+
# equivalents:
|
|
198
|
+
npm create mushi-mushi
|
|
199
|
+
npx @mushi-mushi/cli init
|
|
200
|
+
```
|
|
141
201
|
|
|
142
202
|
<details>
|
|
143
203
|
<summary><b>Flags for CI, monorepos, and self-hosted</b></summary>
|
|
@@ -146,138 +206,71 @@ Mushi.init({ projectId: 'proj_xxx', apiKey: 'mushi_xxx' });
|
|
|
146
206
|
npx mushi-mushi --framework next # skip framework detection
|
|
147
207
|
npx mushi-mushi --project-id proj_xxx --api-key mushi_xxx
|
|
148
208
|
npx mushi-mushi --skip-install # print the install command, don't run it
|
|
209
|
+
npx mushi-mushi --skip-test-report # don't offer to send a test report
|
|
149
210
|
npx mushi-mushi --cwd apps/web # run inside a monorepo sub-package
|
|
150
211
|
npx mushi-mushi --endpoint https://mushi.your-company.com # self-hosted
|
|
151
|
-
npx mushi-mushi -y # accept the detected framework
|
|
212
|
+
npx mushi-mushi -y # accept the detected framework
|
|
213
|
+
npx mushi-mushi -v # print version
|
|
214
|
+
npx mushi-mushi --help
|
|
152
215
|
```
|
|
153
216
|
|
|
154
|
-
The wizard also auto-detects monorepo workspace type (npm / yarn / pnpm workspaces, Turborepo, Nx, Lerna) from your `package.json` and shows the correct workspace-scoped install command.
|
|
155
|
-
|
|
156
217
|
</details>
|
|
157
218
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
## How the loop actually runs
|
|
161
|
-
|
|
162
|
-
```
|
|
163
|
-
1. User taps the widget ──▶ screenshot + route + note + last 5s of console + network
|
|
164
|
-
│
|
|
165
|
-
▼
|
|
166
|
-
2. Fast-filter (Haiku) ──▶ drops spam / test noise, passes real friction
|
|
167
|
-
│
|
|
168
|
-
▼
|
|
169
|
-
3. Deep classify (Sonnet + vision + RAG) ──▶ category, severity, component, root-cause hint
|
|
170
|
-
│
|
|
171
|
-
▼
|
|
172
|
-
4. Dedup (pgvector) ──▶ collapses duplicates across users — 40 reports become 1 row
|
|
173
|
-
│
|
|
174
|
-
▼
|
|
175
|
-
5. Cluster (BIRCH) ──▶ groups similar bugs by meaning; LLM judge scores coherence
|
|
176
|
-
│
|
|
177
|
-
▼
|
|
178
|
-
6. Promote to lesson ──▶ coherent clusters become named rules in .mushi/lessons.json
|
|
179
|
-
│
|
|
180
|
-
▼
|
|
181
|
-
7. Inject into PR review ──▶ `lessons.query` MCP tool sends relevant rules to your agent
|
|
182
|
-
│
|
|
183
|
-
▼
|
|
184
|
-
8. Optional: Dispatch fix ──▶ agent opens a draft GitHub PR · human reviews and merges
|
|
185
|
-
│
|
|
186
|
-
▼
|
|
187
|
-
9. Release credits ──▶ changelog names the user who found the bug · SDK shows toast
|
|
188
|
-
│
|
|
189
|
-
▼
|
|
190
|
-
└────────────── Loop starts stronger than it began ──────────────┘
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
Every iteration of the loop is slightly better than the last. That's cumulative selection — not a metaphor.
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## What you get on day one
|
|
198
|
-
|
|
199
|
-
- **Shake-to-report widget** — Shadow-DOM, zero CSS conflicts. Captures screenshot, console ring, network ring, route + intent, and queues offline automatically.
|
|
200
|
-
- **AI-classified reports** — 2-stage pipeline (Haiku fast-filter → Sonnet deep + vision) streams partial results to the admin UI as tokens arrive. Stage 2 includes RAG over your lesson library so reports of *known* bugs get flagged immediately.
|
|
201
|
-
- **Dedup by meaning, not string** — pgvector knowledge graph collapses duplicates across users, routes, and deploys.
|
|
202
|
-
- **Lesson library** — BIRCH-style clusterer + LLM coherence judge promotes clusters to named learning rules. `mushi sync-lessons` writes `.mushi/lessons.json` to your repo automatically.
|
|
203
|
-
- **Bidirectional inventory (v2)** — opt into `capture: { discoverInventory: true }` and the SDK quietly observes routes, `data-testid`s, and outbound API paths. Claude drafts an `inventory.yaml` of user stories → pages → actions for you to accept.
|
|
204
|
-
- **Five pre-release gates (v2)** — `no-dead-handler`, `no-mock-leak`, inventory drift, agentic-failure detection, synthetic walk health. One composite GitHub check.
|
|
205
|
-
- **Spec-traced fixes (v2.10)** — every dispatched fix carries the inventory `Action` it repairs; `validateAgainstSpec` fires before the PR opens; a targeted synthetic probe runs the moment the PR lands.
|
|
206
|
-
- **One-click "Dispatch fix"** — agentic orchestrator opens a GitHub PR with a Playwright replay and screenshot diff. Sandbox-pluggable (`e2b`, `modal`, `cloudflare`, or your own `SandboxProvider`).
|
|
207
|
-
- **A/B experiments** — `mushi.experiment('hero-copy-v3')` returns sticky variant assignments; CUPED + mSPRT analysis with automatic SRM detection.
|
|
208
|
-
- **Anomaly detection** — STL + Page-Hinkley + isolation-forest detectors on inbound adapter metrics; confirmed regressions auto-open reports and feed back into the lesson library.
|
|
209
|
-
- **Release attribution** — auto-drafted changelogs credit the exact user whose report triggered the fix; SDK shows a toast: *"v1.2.3 shipped — you helped fix the settings back-button."*
|
|
210
|
-
- **PDCA iterate loop** — producer/critic agent loop with selectable personas (Tufte data-density, NN/g heuristic, WCAG a11y, mobile-first). Live progress + draft-PR exit.
|
|
211
|
-
- **Agent-native via MCP + A2A** — MCP Streamable HTTP at `/functions/v1/mcp`, A2A v1.0.0 tasks at `/v1/a2a/tasks`. Cursor, Claude Code, Copilot, OpenAI Agents SDK, LangGraph, and CrewAI all see the same surface.
|
|
212
|
-
|
|
213
|
-
---
|
|
214
|
-
|
|
215
|
-
## Who it's for
|
|
219
|
+
<details>
|
|
220
|
+
<summary><b>Troubleshooting</b></summary>
|
|
216
221
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
| **Enterprise** needing SOC 2 + residency | Region-pinned data (US / EU / JP / SELF), SAML SSO, audit-log ingest, DSAR workflow, HMAC-signed plugin webhooks. |
|
|
222
|
+
- **Wrong framework detected?** Pass `--framework <id>`. Valid values: `next, react, vue, nuxt, svelte, sveltekit, angular, expo, react-native, capacitor, vanilla`.
|
|
223
|
+
- **Monorepo?** `cd` into the package first, or pass `--cwd apps/web`.
|
|
224
|
+
- **Stale `npx` cache?** `npm cache clean --force` or `npx mushi-mushi@latest`.
|
|
225
|
+
- **Non-interactive terminal (CI)?** Pass `--yes --project-id proj_xxx --api-key mushi_xxx`. The wizard exits with a clear error instead of hanging.
|
|
226
|
+
- **Node version too old?** Requires Node ≥ 18. Upgrade at [nodejs.org](https://nodejs.org/).
|
|
227
|
+
- **Full stack traces on error?** `DEBUG=mushi npx mushi-mushi`.
|
|
224
228
|
|
|
225
|
-
|
|
229
|
+
</details>
|
|
226
230
|
|
|
227
|
-
|
|
231
|
+
<details>
|
|
232
|
+
<summary><b>Security notes</b></summary>
|
|
228
233
|
|
|
229
|
-
|
|
234
|
+
- Credentials passed via `--api-key` are visible to other users on the same machine via `ps -ef`. Use the interactive prompt on shared hosts.
|
|
235
|
+
- `~/.mushirc` (the credentials cache) is written with mode `0o600` on Unix; the CLI also tightens the permissions of any existing file on first load.
|
|
236
|
+
- The wizard rejects pasted secrets containing CR/LF/NUL to prevent `.env` injection.
|
|
237
|
+
- All prompts validate format: `proj_[A-Za-z0-9_-]{10,}` and `mushi_[A-Za-z0-9_-]{10,}`.
|
|
238
|
+
- This release ships with [npm provenance](https://docs.npmjs.com/generating-provenance-statements) — verify with `npm audit signatures`.
|
|
230
239
|
|
|
231
|
-
|
|
232
|
-
|---|---|---|
|
|
233
|
-
| Code-thrown errors | Sentry, Crashlytics, Bugsnag, Rollbar | Bugs that don't throw — dead buttons, janky scroll, 12-second screens |
|
|
234
|
-
| System telemetry | Datadog, New Relic, Honeycomb | The user's perspective on what that latency spike *felt* like |
|
|
235
|
-
| Product analytics | Firebase, PostHog, Amplitude | *Why* a funnel step was abandoned, in the user's own words |
|
|
236
|
-
| **User-felt friction** | **nothing → Mushi** | — |
|
|
240
|
+
</details>
|
|
237
241
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
| **Signal origin** | Code throws | Infrastructure metrics | User events | User-felt friction, in the moment |
|
|
241
|
-
| **Lesson encoded?** | No | No | No | Yes — named rule in `.mushi/lessons.json` |
|
|
242
|
-
| **Repeat signal** | Same error = separate issue | Spike repeats = new alert | Funnel drops again | Same broken button → 1 row, forever |
|
|
243
|
-
| **Closes the loop** | Assign a ticket | Write a runbook | A/B test conversion | Draft PR → lesson → future PRs get the rule |
|
|
244
|
-
| **From your IDE** | Paste issue ID into Cursor | — | — | Cursor reads the lesson library + proposes the diff |
|
|
242
|
+
<details>
|
|
243
|
+
<summary><b>Supply-chain & verification (Socket, Bundlephobia, Snyk)</b></summary>
|
|
245
244
|
|
|
246
|
-
|
|
245
|
+
Mushi is a CLI launcher — it spawns one `npm install` and writes one `.env.local` line. Here's what each scanner shows and why:
|
|
247
246
|
|
|
248
|
-
|
|
247
|
+
| Scanner | What it shows | What it actually means |
|
|
248
|
+
| ------------------ | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
249
|
+
| **npm provenance** | ✅ Signed by `kensaurus/mushi-mushi @ master` | Cryptographic Sigstore attestation — `npm audit signatures` will verify this build came from this exact commit on this exact CI workflow. |
|
|
250
|
+
| **Socket.dev** | Score + a few low-signal alerts | Alerts are expected and benign: `child_process.spawn` (used to invoke `npm install`), `process.env` (read `DEBUG`, `npm_config_*`), URL strings (printed in help text). All visible in `src/index.ts` — ~150 LOC, easy to audit. |
|
|
251
|
+
| **Bundlephobia** | ❌ EntryPointError | **Expected.** This is a CLI (`bin` only — no `main`/`module`/`exports`), so there is no importable bundle to measure. Bundlephobia only works for libraries you `import`. |
|
|
252
|
+
| **Snyk Advisor** | Health score (lower right after publish) | Snyk's crawler often lags by 1–2 weeks for new public packages — score corrects itself once it picks up the actual `package.json` (`CONTRIBUTING.md`, `funding`, downloads, repo activity). |
|
|
249
253
|
|
|
250
|
-
|
|
254
|
+
If something looks off to you, [open an issue](https://github.com/kensaurus/mushi-mushi/issues) — the source is 100% public and the CI build is reproducible.
|
|
251
255
|
|
|
252
|
-
|
|
253
|
-
|---|---|
|
|
254
|
-
| React / Next.js | `@mushi-mushi/react` |
|
|
255
|
-
| Vue 3 / Nuxt | `@mushi-mushi/vue` + `@mushi-mushi/web` |
|
|
256
|
-
| Svelte / SvelteKit | `@mushi-mushi/svelte` + `@mushi-mushi/web` |
|
|
257
|
-
| Angular 17+ | `@mushi-mushi/angular` + `@mushi-mushi/web` |
|
|
258
|
-
| React Native / Expo | `@mushi-mushi/react-native` (v0.11.0 — Hermes-compatible) |
|
|
259
|
-
| Capacitor / Ionic | `@mushi-mushi/capacitor` |
|
|
260
|
-
| Flutter / Dart | `pub add mushi_mushi` |
|
|
261
|
-
| iOS native (Swift) | Swift Package Manager |
|
|
262
|
-
| Android (Kotlin/Java) | `dev.mushimushi:mushi-android` |
|
|
263
|
-
| Vanilla JS / any | `@mushi-mushi/web` |
|
|
264
|
-
| Node.js (Express / Fastify / Hono) | `@mushi-mushi/node` |
|
|
256
|
+
</details>
|
|
265
257
|
|
|
266
258
|
---
|
|
267
259
|
|
|
268
260
|
## Power-user CLI
|
|
269
261
|
|
|
270
|
-
`mushi-mushi` is the setup wizard. For
|
|
262
|
+
`mushi-mushi` is just the setup wizard. For day-to-day triage install the full CLI:
|
|
271
263
|
|
|
272
264
|
```bash
|
|
273
265
|
npm i -g @mushi-mushi/cli
|
|
274
266
|
mushi reports list
|
|
275
|
-
mushi reports
|
|
267
|
+
mushi reports show <id>
|
|
268
|
+
mushi reports triage <id> --status acknowledged --severity high
|
|
276
269
|
mushi deploy check # post-deploy smoke check
|
|
277
270
|
mushi status # live pipeline health
|
|
278
271
|
```
|
|
279
272
|
|
|
280
|
-
For the **
|
|
273
|
+
For the **v2 inventory + gates** loop the actionable surface is the GitHub Action — drop one job into your repo and it runs Claude's proposer / the gate suite / the discovery digest on every PR:
|
|
281
274
|
|
|
282
275
|
```yaml
|
|
283
276
|
# .github/workflows/mushi-gates.yml
|
|
@@ -285,50 +278,26 @@ For the **AI agent loop**, add one GitHub Action:
|
|
|
285
278
|
with:
|
|
286
279
|
api-key: ${{ secrets.MUSHI_API_KEY }}
|
|
287
280
|
project-id: ${{ secrets.MUSHI_PROJECT_ID }}
|
|
288
|
-
command: gates
|
|
281
|
+
command: gates # also: propose · discover-api · discovery-status · auth-bootstrap
|
|
289
282
|
```
|
|
290
283
|
|
|
291
|
-
|
|
284
|
+
The same commands are exposed as MCP tools through [`@mushi-mushi/mcp`](https://www.npmjs.com/package/@mushi-mushi/mcp), so Cursor / Claude Code / Copilot can drive the v2 loop without you ever opening a terminal.
|
|
285
|
+
|
|
286
|
+
Or skip the CLI entirely and drive it from your AI agent via [`@mushi-mushi/mcp`](https://www.npmjs.com/package/@mushi-mushi/mcp):
|
|
292
287
|
|
|
293
288
|
```json
|
|
294
289
|
{ "mcpServers": { "mushi": { "command": "npx", "args": ["-y", "@mushi-mushi/mcp"] } } }
|
|
295
290
|
```
|
|
296
291
|
|
|
297
|
-
<details>
|
|
298
|
-
<summary><b>Troubleshooting</b></summary>
|
|
299
|
-
|
|
300
|
-
- **Wrong framework detected?** Pass `--framework <id>`. Valid: `next, react, vue, nuxt, svelte, sveltekit, angular, expo, react-native, capacitor, vanilla`.
|
|
301
|
-
- **Monorepo?** `cd` into your app package first, or pass `--cwd apps/web`. The wizard reads your `package.json` to detect workspace type (npm / yarn / pnpm workspaces, Turborepo, Nx, Lerna) and shows the right install command.
|
|
302
|
-
- **Stale `npx` cache?** `npm cache clean --force` or `npx mushi-mushi@latest`.
|
|
303
|
-
- **Non-interactive terminal (CI)?** Pass `--yes --project-id proj_xxx --api-key mushi_xxx`.
|
|
304
|
-
- **Node version?** Requires Node ≥ 18. Check at [nodejs.org](https://nodejs.org/).
|
|
305
|
-
- **Debug mode:** `DEBUG=mushi npx mushi-mushi`.
|
|
306
|
-
|
|
307
|
-
</details>
|
|
308
|
-
|
|
309
|
-
<details>
|
|
310
|
-
<summary><b>Supply-chain verification (Socket, Provenance, Bundlephobia)</b></summary>
|
|
311
|
-
|
|
312
|
-
| Scanner | What it shows | What it means |
|
|
313
|
-
|---|---|---|
|
|
314
|
-
| **npm provenance** | ✅ Signed by `kensaurus/mushi-mushi @ master` | Cryptographic Sigstore attestation — `npm audit signatures` verifies this build came from this exact commit |
|
|
315
|
-
| **Socket.dev** | Score + a few low-signal alerts | Alerts are benign: `child_process.spawn` (invokes `npm install`), `process.env` (reads `DEBUG`, `npm_config_*`). All visible in `src/index.ts` — ~150 LOC, auditable in minutes |
|
|
316
|
-
| **Bundlephobia** | ❌ EntryPointError | **Expected.** This is a CLI (`bin` only — no `main`/`module`/`exports`). Bundlephobia only measures importable libraries |
|
|
317
|
-
|
|
318
|
-
</details>
|
|
319
|
-
|
|
320
292
|
---
|
|
321
293
|
|
|
322
294
|
## Links
|
|
323
295
|
|
|
324
|
-
- 🌐 **[Live admin demo](https://kensaur.us/mushi-mushi/)** — click
|
|
325
|
-
- 📦 **[GitHub](https://github.com/kensaurus/mushi-mushi)** — source,
|
|
326
|
-
- 📚 **[Docs](https://
|
|
327
|
-
- 🧬 **[Why a closed loop](https://kensaur.us/mushi-mushi/docs/concepts/closed-loop)** — the full Dawkins / Taleb / Syed argument
|
|
296
|
+
- 🌐 **[Live admin demo](https://kensaur.us/mushi-mushi/)** — click around a real dataset
|
|
297
|
+
- 📦 **[GitHub](https://github.com/kensaurus/mushi-mushi)** — source, architecture, self-hosting
|
|
298
|
+
- 📚 **[Docs](https://github.com/kensaurus/mushi-mushi#readme)** — quickstart, concepts, API reference
|
|
328
299
|
- 🐛 **[Report a bug](https://github.com/kensaurus/mushi-mushi/issues)** — eat your own dogfood
|
|
329
300
|
|
|
330
|
-
---
|
|
331
|
-
|
|
332
301
|
## License
|
|
333
302
|
|
|
334
303
|
MIT © [Kenji Sakuramoto](https://github.com/kensaurus). Backend packages (`@mushi-mushi/server`, `agents`, `verify`) are [BSL 1.1](https://github.com/kensaurus/mushi-mushi/blob/master/packages/server/LICENSE) — converts to Apache 2.0 on April 15, 2029.
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { runInit } from "@mushi-mushi/cli/init";
|
|
5
5
|
import { FRAMEWORK_IDS, isFrameworkId } from "@mushi-mushi/cli/detect";
|
|
6
|
-
var VERSION = true ? "0.7.
|
|
6
|
+
var VERSION = true ? "0.7.3" : "0.0.0-dev";
|
|
7
7
|
var MIN_NODE_MAJOR = 18;
|
|
8
8
|
var ISSUES_URL = "https://github.com/kensaurus/mushi-mushi/issues";
|
|
9
9
|
var HELP = `mushi-mushi \u2014 bug-reporting SDK launcher
|
package/package.json
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mushi-mushi",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Ship a shake-to-report button and get AI-classified, deduped, ready-to-fix bug reports — one `npx mushi-mushi` command for React, Next.js, Vue, Nuxt, Svelte, SvelteKit, Angular, React Native, Expo, Capacitor, and vanilla JS. Companion to Sentry: catches the user-felt bugs crash trackers can't see. Wires into GitHub, Slack, Jira, Linear, PagerDuty, Langfuse, and any MCP-compatible AI agent (Cursor, Claude Code, Copilot).",
|
|
6
6
|
"bin": {
|
|
7
7
|
"mushi-mushi": "./dist/index.js"
|
|
8
8
|
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsup",
|
|
11
|
+
"lint": "eslint src/",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"typecheck": "tsc --noEmit"
|
|
14
|
+
},
|
|
9
15
|
"dependencies": {
|
|
10
|
-
"@mushi-mushi/cli": "
|
|
16
|
+
"@mushi-mushi/cli": "workspace:^"
|
|
11
17
|
},
|
|
12
18
|
"devDependencies": {
|
|
19
|
+
"@mushi-mushi/eslint-config": "workspace:*",
|
|
13
20
|
"@types/node": "^22.19.17",
|
|
14
21
|
"eslint": "^10.3.0",
|
|
15
22
|
"tsup": "^8.5.1",
|
|
16
23
|
"typescript": "^6.0.3",
|
|
17
|
-
"vitest": "^4.1.5"
|
|
18
|
-
"@mushi-mushi/eslint-config": "0.0.0"
|
|
24
|
+
"vitest": "^4.1.5"
|
|
19
25
|
},
|
|
20
26
|
"author": "Kenji Sakuramoto",
|
|
21
27
|
"repository": {
|
|
@@ -81,11 +87,5 @@
|
|
|
81
87
|
"type": "module",
|
|
82
88
|
"engines": {
|
|
83
89
|
"node": ">=18"
|
|
84
|
-
},
|
|
85
|
-
"scripts": {
|
|
86
|
-
"build": "tsup",
|
|
87
|
-
"lint": "eslint src/",
|
|
88
|
-
"test": "vitest run",
|
|
89
|
-
"typecheck": "tsc --noEmit"
|
|
90
90
|
}
|
|
91
|
-
}
|
|
91
|
+
}
|