patchwork-os 0.2.0-beta.13.canary.330 → 0.2.0-beta.13.canary.332

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.
Files changed (2) hide show
  1. package/README.md +46 -488
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,543 +5,101 @@
5
5
  [![npm downloads](https://img.shields.io/npm/dm/patchwork-os.svg)](https://www.npmjs.com/package/patchwork-os)
6
6
  [![license](https://img.shields.io/npm/l/patchwork-os.svg)](LICENSE)
7
7
 
8
- ### Your personal AI runtime, local-first.
8
+ > **You don't have an automation problem. You have a decision problem.**
9
9
 
10
- **You decide which model. You decide which actions need a human nod. You own the credentials, the logs, and the deployment.** Nothing phones home unless you [opt in to anonymous analytics](#telemetry).
10
+ Every AI-agent horror story ends the same way: an action nobody stopped to question. Patchwork OS is the layer between the agent's impulse and the action a local-first runtime where your AI can automate real work across your editor, GitHub, Slack, Gmail, and 45+ services, while **anything consequential stops and asks you first**.
11
11
 
12
- ![Patchwork OS dashboard — connected bridge, live telemetry, and a 45-recipe library](docs/images/dashboard-overview.png)
12
+ Three ideas, one runtime:
13
13
 
14
- > Patchwork OS is a local-first personal AI runtime: pluggable model providers, hot-reloadable tools, YAML recipes, a delegation policy with approval queue, and a durable trace memory all running on your machine, all under your policy.
14
+ - **Ask before acting.** Every action is classified by blast radius can it be undone, and how much breaks if it's wrong? Reversible things flow freely. Risky things wait in an approval queue with the evidence attached: what exactly will run, why it fired, and what happens if it's wrong.
15
15
 
16
- ## Contents
16
+ - **Trust is earned, never assumed.** Workers — named agents with jobs — start supervised and earn independence from their track record, per action type. Good at filing issues ≠ allowed to push code. One bad high-stakes action outweighs a hundred trivial successes. You set the ceiling; the math never raises it for them.
17
17
 
18
- - [Two ways to use it](#the-same-codebase-ships-two-ways-to-use-it)
19
- - [Dashboard only — no editor required](#dashboard-only--no-code-editor-required)
20
- - [Claude IDE Bridge — quick start](#-claude-ide-bridge--quick-start)
21
- - [Windows](#windows)
22
- - [Architecture](#architecture)
23
- - [Telemetry](#telemetry)
24
- - [Contributing & support](#support)
18
+ - **Every decision leaves a receipt.** What was done, why it was allowed, and how it turned out — durable, replayable, explainable via `patchwork judgments`, the dashboard's traces page, and `patchwork gate explain`. When you approve something, you find out later whether you were right.
25
19
 
26
- **Five primitives, one runtime:**
20
+ All of it runs on your machine: your model (Claude, GPT, Gemini, Grok, or local Ollama), your credentials, your logs. Nothing phones home unless you opt in to [anonymous analytics](#telemetry).
27
21
 
28
- - **Tools** — 177 built-in (LSP, git, terminal, debugger, files) plus any plugin you write. Plugins hot-reload — Claude can author a tool mid-session and call it on the next turn. See [Live Toolsmithing](documents/live-toolsmithing.md).
29
- - **Recipes** — YAML automations triggered by cron, file save, git commit, test run, or webhook. Anything that can POST a JSON payload can fire a recipe.
30
- - **Delegation Policy** — three risk tiers, four-source precedence (managed → project-local → project → user). Auto-approve safe, require approval for risky, block dangerous.
31
- - **Trace memory** — every approval, every recipe run, every enrichment is durable JSONL. Past decisions are surfaced into future sessions automatically. Bundle and back up with [`patchwork traces export`](src/commands/tracesExport.ts).
32
- - **OAuth** — turn your runtime into a private personal API. PKCE S256, dynamic client registration, deployable on a VPS in minutes.
33
-
34
- > **Why not [an MCP server / Zapier / a hosted assistant / a local agent framework]?** See [the comparison page](documents/comparison.md) for the honest tradeoff against each.
35
- >
36
- > **What does this look like in one diagram?** See the [architecture overview](documents/architecture.md).
22
+ ![Patchwork OS dashboard](docs/images/dashboard-overview.png)
37
23
 
38
24
  ---
39
25
 
40
- ## The same codebase ships two ways to use it
41
-
42
- Pick the layer you need.
43
-
44
- | | What you get | Install | Best for |
45
- |---|---|---|---|
46
- | **🔌 Claude IDE Bridge** | MCP bridge connecting Claude Code to your IDE. 177 tools — diagnostics, LSP, debugger, terminal, git, GitHub, file ops. | `npm i -g patchwork-os` then run `claude-ide-bridge` | Anyone who wants Claude Code to see and act on their editor state |
47
- | **🤖 Patchwork OS** | Everything in the bridge **plus** YAML recipes, approval queue, oversight dashboard, mobile push approvals, multi-model providers, JetBrains companion. | Same package, run `patchwork init` | Power users running automation, agent workflows, or background tasks |
48
-
49
- Same codebase. Bridge is the foundation; Patchwork OS is the optional layer on top. **No vendor lock-in. Runs on your machine.**
50
-
51
- ---
52
-
53
- ## Dashboard Only — No Code Editor Required
54
-
55
- > You do not need VS Code, Windsurf, Cursor, or Claude Code CLI to use the Patchwork dashboard.
56
-
57
- The dashboard is a standalone Next.js app that communicates with the bridge over HTTP. No editor extension required.
58
-
59
- **Prereqs:** [Node.js 22+](https://nodejs.org) · tmux on macOS/Linux (`brew install tmux` / `apt install tmux`) — auto-detected, falls back to background mode if absent. **Windows:** natively supported — no WSL required.
26
+ ## 90-second start (no editor required)
60
27
 
61
28
  ```bash
62
- npx patchwork-os@beta init # scaffolds ~/.patchwork and generates a dashboard login (no install needed)
63
- patchwork start # launches bridge + dashboard (auto-detects tmux; falls back to background mode if absent)
29
+ npx patchwork-os@beta init # scaffolds ~/.patchwork, prints your dashboard login
30
+ patchwork start # bridge + dashboard
64
31
  ```
65
32
 
66
- Open **http://localhost:3200** that's it. `npx patchwork-os@beta init` auto-generates a dashboard password and saves it to `~/.patchwork/.env` it prints the password at the end of setup, save it for your first login.
33
+ Open http://localhost:3200. From the browser: run and schedule YAML recipes, connect services (Gmail, Calendar, Slack, GitHub…), review what your agents drafted, and approve or refuse anything that wants to leave the machine.
67
34
 
68
- **What you get:** run and schedule YAML recipes, connect external services (Gmail, Calendar, Slack), review AI drafts in the approval queue, read your AI inbox — all from the browser. No coding required.
35
+ Prereqs: Node 22+. macOS, Linux, and native Windows (no WSL).
69
36
 
70
- > **Want IDE features too?** See [Claude IDE Bridge Quick Start](#-claude-ide-bridge--quick-start) below to add LSP, debugger, and editor tools on top.
71
-
72
- ---
73
-
74
- ## 🔌 Claude IDE Bridge — Quick Start
75
-
76
- > Developers only — skip to [Dashboard Only](#dashboard-only--no-code-editor-required) above if you just want the web dashboard.
77
-
78
- **Prerequisites:** a supported code editor — **VS Code, Cursor, Windsurf, or Google Antigravity** (or JetBrains via the [companion plugin](#jetbrains-plugin)) — plus Node.js 22+ and the [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code). The bridge's LSP, debugger, and editor-state tools run through the editor extension; without one you're limited to the headless CLI subset.
37
+ The hero workflowMorning Brief:
79
38
 
80
39
  ```bash
81
- # 1. Install the npm package
82
- npm install -g patchwork-os
83
-
84
- # 2. Install the VS Code / Cursor / Windsurf extension
85
- # Search "Claude IDE Bridge" on OpenVSX, or:
86
- claude-ide-bridge install-extension
87
-
88
- # 3. Start the bridge for your workspace
89
- claude-ide-bridge --workspace .
90
-
91
- # 4. Connect Claude Code (in another terminal)
92
- claude --ide
40
+ patchwork connections connect gmail
41
+ patchwork connections connect google-calendar
42
+ patchwork recipe run morning-brief
93
43
  ```
94
44
 
95
- > **First time `claude --ide` says it can't find an IDE?** Claude Code's `--ide`
96
- > flag runs an in-terminal IDE-detection check; a standalone bridge launched from
97
- > a plain terminal trips it, so you need to set `CLAUDE_CODE_IDE_SKIP_VALID_CHECK=true`.
98
- > `patchwork init` writes this into your `~/.claude/settings.json` for you (so a
99
- > plain `claude --ide` just works). If you're only running the bridge (no `init`),
100
- > add it once yourself — Claude Code applies its `env` block to every session:
101
- >
102
- > ```json
103
- > // ~/.claude/settings.json
104
- > { "env": { "CLAUDE_CODE_IDE_SKIP_VALID_CHECK": "true" } }
105
- > ```
106
- >
107
- > Or prefix it for a single run: `CLAUDE_CODE_IDE_SKIP_VALID_CHECK=true claude --ide`.
108
-
109
- Type `/ide` in Claude Code to confirm the connection. That's it — Claude now sees your diagnostics, open files, and editor state, and can call 177 tools to act on them.
45
+ Every morning: a digest of your email, calendar, and overnight agent activity lands in your inbox as Markdown, with any drafted replies waiting for your approval — never auto-sent. No connectors yet? `--local` runs it against Ollama with your clipboard and recent files.
110
46
 
111
- > If this saves you a config file or a debug session, drop a star — it's the only signal I get that it's helping.
47
+ ## How it works
112
48
 
113
- **What the bridge gives Claude:**
49
+ Recipes are plain YAML: a trigger (cron, file save, git commit, test run, or any webhook — iPhone Shortcut, Stream Deck, Home Assistant) plus steps. Share them like dotfiles, install them from the marketplace, or let the dashboard generate one from a sentence.
114
50
 
115
- - Diagnostics, LSP navigation (goto / references / call hierarchy), refactoring with risk analysis
116
- - Terminal — run commands, read output, wait for async work
117
- - Git — status, diff, commit, push, blame, checkout, branch list
118
- - GitHub — open PRs, list issues, post reviews, fetch run logs
119
- - Debugger — set breakpoints, evaluate expressions, inspect runtime state
120
- - Files — read, edit by line range, search and replace, capture screenshots
121
- - Code quality — `auditDependencies`, `detectUnusedCode`, `getCodeCoverage`, `getGitHotspots`
51
+ Workers are recipes with an identity and a track record. A worker that triages failing CI starts by only proposing ("this looks like a real break — file an issue?"). Confirm its filings were real and it earns a longer leash — for that job only. It can be demoted in one bad day. You can cap any worker permanently with one line of YAML.
122
52
 
123
- The bridge runs without any flags. No recipes, no automation, no dashboard just the IDE-Claude connection.
53
+ The queue is where impulse meets judgment. Requests arrive sorted by blast radius with evidence inline. `patchwork panic` stops all automation instantly.
124
54
 
125
- **Compatible IDEs:** VS Code, Cursor, Windsurf, Google Antigravity. JetBrains IDEs via [companion plugin](#jetbrains-plugin).
126
-
127
- **Transport layers:**
128
-
129
- | Client | Protocol |
130
- |---|---|
131
- | Claude Code CLI | WebSocket `ws://127.0.0.1:<port>` |
132
- | Claude Desktop, Grok Build (Grok CLI) | stdio shim → WebSocket |
133
- | Gemini CLI, Codex CLI, claude.ai | Streamable HTTP + Bearer token |
134
-
135
- **Connecting Gemini CLI:**
136
-
137
- ```bash
138
- # Get the auth token from the bridge's lock file
139
- patchwork-os print-token
140
-
141
- # Add the bridge as an MCP server
142
- gemini mcp add patchwork http://127.0.0.1:<port>/mcp \
143
- --header "Authorization: Bearer <token>"
144
55
  ```
145
-
146
- The bridge auto-responds to the GET probe Gemini sends before initializing, so it shows as **Connected** immediately.
147
-
148
- **Connecting Grok Build (Grok CLI):**
149
-
150
- Grok Build connects over the same **stdio shim** as Claude Desktop. Add this block to `~/.grok/config.toml` (the `--workspace` arg is the important part):
151
-
152
- ```toml
153
- [mcp_servers.patchwork]
154
- command = "claude-ide-bridge"
155
- args = ["shim", "--workspace", "/absolute/path/to/your/project"]
156
- enabled = true
56
+ trigger → recipe/worker → [reversible? → run]
57
+ [risky? → approval queue your yes receipt]
157
58
  ```
158
59
 
159
- Three gotchas that look like bugs but aren't:
160
-
161
- - **`--workspace` is required.** Without it the shim picks the newest bridge lock across *all* workspaces — in a multi-bridge setup (orchestrator, leftover dev bridges) that can be the wrong or a dead bridge, so tools act on the wrong project or hang. Always pin it to your project path.
162
- - **`grok mcp doctor` hangs — don't use it.** The shim is a long-lived relay that stays open for the session, so `doctor` waits forever for it to exit. Verify with the in-TUI **`/mcps`** instead, or run `claude-ide-bridge shim --ping` (one-shot: connects, lists tools, exits).
163
- - **The approval gate can park tool calls.** If `~/.patchwork/config.json` has `"approvalGate": "all"` (or `"high"`), tool calls queue for human approval in the dashboard and look like they're hanging to Grok. Set it to `"high"` (gate only risky writes) or `"off"`, or approve in the dashboard at `localhost:3000`.
60
+ ### Also in the box: the Claude IDE Bridge
164
61
 
165
- Grok Build can also connect over Streamable HTTP + Bearer (same as Gemini, above) if you'd rather not use the shim.
166
-
167
- **Tool modes:**
168
-
169
- | Mode | Tools | When to use |
170
- |---|---|---|
171
- | Full _(default)_ | 177 | All git, GitHub, terminal, file ops, orchestration |
172
- | Slim (`--slim`) | ~60 | LSP + debugger + editor state only |
173
-
174
- Bridge-only docs: [documents/platform-docs.md](documents/platform-docs.md)
175
-
176
- ---
177
-
178
- ## Windows
179
-
180
- The bridge, VS Code extension, and orchestrator all run **natively on Windows — no WSL required**. Install the same way (`npm install -g patchwork-os`), then start the bridge with `npm run start:bridge` or the full stack with `npm run start-all:node` (cross-platform) / `npm run start-all:win` (PowerShell-native).
181
-
182
- A few bash+tmux entry points (`patchwork start`, `npm run remote`) still need WSL2 or Git Bash. Credential storage uses Windows DPAPI.
183
-
184
- **Full setup, the orchestrator flag reference, and the native-Windows limitations table:** [docs/windows.md](docs/windows.md).
185
-
186
- ---
187
-
188
- ## 🤖 Patchwork OS — Quick Start
62
+ The foundation layer is a standalone MCP bridge that gives Claude Code eyes and hands in your editor — 177 tools: diagnostics, LSP navigation, refactoring with risk analysis, debugger, terminal, git/GitHub, file ops.
189
63
 
190
64
  ```bash
191
- npx patchwork-os@beta init
192
- ```
193
-
194
- Sets up 5 local recipes, detects Ollama, and opens a terminal dashboard — under 90 seconds.
195
-
196
- ### ☀️ Morning Brief — the hero workflow
197
-
198
- Get an AI digest of your Gmail, calendar, and tasks every morning — or on demand:
199
-
200
- ```bash
201
- # First-time setup (connect Gmail + Google Calendar)
202
- patchwork-os init
203
- patchwork-os connections connect gmail
204
- patchwork-os connections connect google-calendar
205
-
206
- # Run it now
207
- patchwork-os recipe run morning-brief
208
- ```
209
-
210
- The brief lands in `~/.patchwork/inbox/` as a Markdown file. Open the dashboard (`http://localhost:3200`) to read it, approve any drafted replies, or let it auto-send at 08:00 via the built-in cron trigger.
211
-
212
- No connectors yet? Run with `--local` using Ollama — it summarises your clipboard and last-touched files instead.
213
-
214
- ---
215
-
216
- ### What it adds on top of the bridge
217
-
218
- Patchwork OS is a local automation platform that watches your workspace for events, runs AI-powered recipes in response, and routes anything risky through an approval queue before it goes anywhere.
219
-
220
- Think of it as a background agent that acts on your behalf — but asks before sending, writing, or modifying anything consequential.
221
-
222
- - Test suite fails on CI → triage note in your inbox before you wake up
223
- - Customer email arrives → draft reply in your voice, pending your approval
224
- - Field-trip permission form flagged → reply drafted to the teacher, waiting for your nod
225
-
226
- **Recipes** are plain YAML files. They declare a trigger (cron, file save, git commit, test run, webhook) and an action (run a prompt, write to inbox, call a connector). No code required. Share them like dotfiles.
227
-
228
- **Models** are yours. Claude, GPT, Gemini, Grok, or local Ollama. Swap at any time. Nothing phones home unless you opt in (see [Telemetry](#telemetry)).
229
-
230
- **Oversight** is non-negotiable. Every write or external action lands in `~/.patchwork/inbox/` for approval. The web UI at `http://localhost:3200` shows pending approvals, live sessions, recipe run history, and local analytics (the dashboard's analytics panel is computed entirely from on-disk logs — it does not transmit anything).
231
-
232
- ### Patchwork commands
233
-
234
- Grouped by what they do. Full list: `patchwork --help`.
235
-
236
- **Setup**
237
-
238
- ```bash
239
- npx patchwork-os@beta init # one-command first-time setup (no install needed)
240
- patchwork install-extension # install the VS Code / Cursor / Windsurf extension
241
- patchwork gen-claude-md # generate a starter CLAUDE.md for this workspace
242
- patchwork gen-plugin-stub ./my-plugin --name "org/name" --prefix "myPrefix"
243
- ```
244
-
245
- **Runtime**
246
-
247
- ```bash
248
- patchwork start # bridge + dashboard (auto-detects tmux)
249
- patchwork start-all # bridge + extension watcher in tmux
250
- patchwork dashboard # launch dashboard standalone
251
- patchwork shim # stdio shim for Claude Desktop
252
- patchwork status # one-shot health check
253
- patchwork print-token # auth token from the active lock file
254
- ```
255
-
256
- **Recipes & tasks**
257
-
258
- ```bash
259
- patchwork recipe list # installed recipes
260
- patchwork recipe run daily-status # run one now
261
- patchwork recipe new my-recipe --interactive
262
- patchwork start-task "<description>" # enqueue a free-form Claude task
263
- patchwork quick-task fixErrors # context-aware preset task
264
- patchwork continue-handoff # resume from stored handoff note
265
- patchwork suggest # AI-suggest a recipe for a goal
266
- ```
267
-
268
- **Ops & insight**
269
-
270
- ```bash
271
- patchwork halts --window overnight # morning summary of recent recipe halts
272
- patchwork judgments # review recent approval / decision traces
273
- patchwork traces export # bundle durable trace memory for backup
274
- patchwork launchd # macOS LaunchAgent management
275
- patchwork notify <Event> # bridge ←→ Claude Code hook wiring
276
- ```
277
-
278
- **Safety**
279
-
280
- ```bash
281
- patchwork kill-switch engage # stop all background automation immediately
282
- patchwork kill-switch status # is the kill-switch active?
283
- patchwork kill-switch release # resume automation
284
- patchwork panic # alias for `kill-switch engage`
285
- ```
286
-
287
- ### Starter recipes
288
-
289
- The package ships these in `templates/recipes/`. Recipes that need API keys are noted; the rest are zero-config.
290
-
291
- | Recipe | Trigger | What it does | Needs |
292
- |---|---|---|---|
293
- | `ambient-journal` | git commit | Appends one line to `~/.patchwork/journal/` | — |
294
- | `daily-status` | cron 08:00 | Morning brief from yesterday's commits | — |
295
- | `lint-on-save` | file save | Surfaces new TS/JS diagnostics to inbox | — |
296
- | `stale-branches` | cron weekly | Lists branches older than 30 days | — |
297
- | `watch-failing-tests` | test run | Drops triage note to inbox on failure | — |
298
- | `project-health-check` | manual | Snapshot of repo health + flagged risks | — |
299
- | `ctx-loop-test` | manual | Smoke test for context-platform end-to-end | — |
300
- | `morning-brief` | cron 08:00 | Gmail + Linear + Slack + Calendar digest | Gmail, Linear, Slack, Google Calendar |
301
- | `morning-brief-slack` | cron 08:00 | Same brief but only posts to Slack | Linear, Slack |
302
- | `gmail-health-check` | manual | Verify Gmail connector + token state | Gmail |
303
- | `inbox-triage` | manual | Triage Gmail unread → suggest archive/reply | Gmail |
304
- | `sentry-to-linear` | manual | Sentry issue → Linear ticket (one-shot) | Sentry, Linear |
305
-
306
- **Connectors available** (all writes governed by your delegation policy): Slack, GitHub, Linear, Gmail, Google Calendar, Google Drive, Sentry, Notion, Confluence, Datadog, HubSpot, Intercom, Stripe, Zendesk, Jira, PagerDuty, Discord, Asana, GitLab.
307
-
308
- **Delegation policy presets** ([`templates/policies/`](templates/policies/)): five persona starters — conservative, developer, headless-CI, regulated-industry, personal-assistant. Copy one into `~/.patchwork/config.json` and restart.
309
-
310
- **Webhook recipe starters** ([`templates/recipes/webhook/`](templates/recipes/webhook/)): six webhook-triggered recipes — capture-thought, morning-brief (on-demand), meeting-prep, incident-intake, customer-escalation, apple-watch-health-log. Anything that can POST HTTP can drive these — iPhone Shortcut, Stream Deck, Home Assistant, NFC tag, monitoring tool.
311
-
312
- ### Automation hooks
313
-
314
- Event-driven hooks trigger Claude tasks automatically. Activate with `--automation --automation-policy <path.json> --driver subprocess`.
315
-
316
- Key hooks:
317
-
318
- | Hook | Fires when |
319
- |---|---|
320
- | `onFileSave` | Matching files saved |
321
- | `onDiagnosticsStateChange` | Errors appear or clear |
322
- | `onRecipeSave` | Any `.yaml`/`.yml` saved — runs preflight |
323
- | `onGitCommit` / `onGitPush` / `onGitPull` | Git tools succeed |
324
- | `onTestRun` | Test run completes (filter: any/failure/pass-after-fail) |
325
- | `onBranchCheckout` | After branch switch |
326
- | `onPullRequest` | After `githubCreatePR` succeeds |
327
- | `onCompaction` | Before/after Claude context compaction |
328
- | `onTaskCreated` / `onTaskSuccess` | Orchestrator task lifecycle |
329
-
330
- All hooks support inline prompts, named prompt references, and a minimum 5s cooldown. Full reference: [documents/platform-docs.md → Automation Hooks](documents/platform-docs.md)
331
-
332
- ---
333
-
334
- ## More features
335
-
336
- ### 🖥️ Cowork (computer-use handoff)
337
-
338
- Hand a task off to Claude's computer-use sandbox without losing IDE context. Run `/mcp__bridge__cowork` in a regular Claude chat to snapshot editor state, then open Cowork — it reads the handoff note for instant continuity. Cowork runs in an isolated git worktree. See [docs/cowork.md](docs/cowork.md).
339
-
340
- ### 🔐 OAuth 2.0 — turn your runtime into a personal API
341
-
342
- Start the bridge with `--issuer-url https://your-domain.com` to expose a full OAuth 2.0 surface: PKCE S256, dynamic client registration (RFC 7591), `/oauth/authorize` approval page, opaque 24h access tokens. Connect claude.ai, Codex CLI, or any MCP client over Streamable HTTP. See [docs/remote-access.md](docs/remote-access.md).
343
-
344
- ### 🛑 Kill-switch — stop everything, now
345
-
346
- `patchwork kill-switch engage` (or the `patchwork panic` alias) halts all running automation, recipes, and orchestrator tasks immediately. `patchwork kill-switch status` reports state; `release` resumes. Designed for the moment you realise an agent is doing the wrong thing.
347
-
348
- ### 🪟 Native Windows support
349
-
350
- Bridge, VS Code extension, smoke harness, and CI are all green on native Windows — no WSL required. See [Windows](#windows) above.
351
-
352
- ### ☀️ Morning summary
353
-
354
- `patchwork halts --window overnight` prints a one-screen digest of recipe halts (categorised, 5 most recent reasons). Pair with `patchwork judgments` to review what Claude decided overnight before approving anything.
355
-
356
- ### 🛒 Recipe marketplace — install + submit from the dashboard
357
-
358
- Browse the curated registry at [github.com/patchworkos/recipes](https://github.com/patchworkos/recipes) at **`/marketplace`** in the dashboard. One-click install if the bridge is running, with risk + connector preview before fetch.
359
-
360
- Contributing a recipe? **`/marketplace/submit`** is a full in-app submission flow: starter YAML presets (manual / scheduled / webhook), live `recipe.json` manifest preview, auto-save draft in `sessionStorage`, lint via the bridge before submit, and a "Submit to GitHub" button that opens a prefilled create-file PR on the registry repo. GitHub auto-forks for users without push access — no extra accounts needed.
361
-
362
- ---
363
-
364
- ## Architecture
365
-
366
- ```
367
- patchwork-os (npm package)
368
-
369
- ├── claude-ide-bridge ← run alone for bridge-only mode
370
- │ ├── MCP server 177 tools over WebSocket / HTTP / stdio
371
- │ ├── VS Code extension LSP, debugger, editor state, live diagnostics
372
- │ ├── Git / GitHub gitCommit, gitPush, githubCreatePR, …
373
- │ ├── Terminal runInTerminal, getTerminalOutput, …
374
- │ └── Code quality auditDependencies, detectUnusedCode, getCodeCoverage
375
-
376
- └── patchwork ← run for full Patchwork OS layer
377
- ├── Recipe runner YAML triggers → LLM prompt → action
378
- ├── Connectors Linear, Sentry, Slack, Google Calendar, +
379
- ├── Orchestrator Claude subprocess tasks, automation hooks
380
- ├── Oversight inbox ~/.patchwork/inbox/ — approval queue
381
- └── Web dashboard http://localhost:3200 — approvals, sessions, analytics
382
- ```
383
-
384
- The npm package ships **three CLI binaries** that share the same code:
385
-
386
- | Binary | Default behavior |
387
- |---|---|
388
- | `claude-ide-bridge` | Bridge only — no automation, no recipe runner, no dashboard |
389
- | `patchwork` | Full Patchwork OS — automation + recipes + dashboard |
390
- | `patchwork-os` | Alias for `patchwork` |
391
-
392
- Use whichever fits your mental model.
393
-
394
- ---
395
-
396
- ## Tool surface
397
-
398
- 177 MCP tools across 15 categories. Highlights:
399
-
400
- | Category | Tools |
401
- |---|---|
402
- | LSP / Code Intelligence | `getDiagnostics`, `goToDefinition`, `findReferences`, `getCallHierarchy`, `renameSymbol`, `refactorAnalyze`, `explainSymbol`, … (34 tools) |
403
- | Git | `getGitStatus`, `getGitDiff`, `gitCommit`, `gitPush`, `gitCheckout`, `gitBlame`, … (16 tools) |
404
- | GitHub | `githubCreatePR`, `githubListPRs`, `githubCreateIssue`, `githubPostPRReview`, … (13 tools) |
405
- | Terminal | `runInTerminal`, `createTerminal`, `getTerminalOutput`, `waitForTerminalOutput` |
406
- | File Operations | `editText`, `searchAndReplace`, `searchWorkspace`, `findFiles`, `getFileTree`, … |
407
- | Debugger | `setDebugBreakpoints`, `startDebugging`, `evaluateInDebugger` |
408
- | Orchestrator | `runClaudeTask`, `listClaudeTasks`, `getClaudeTaskStatus` |
409
- | Context Platform | `ctxGetTaskContext`, `ctxQueryTraces`, `ctxSaveTrace`, `enrichStackTrace` |
410
-
411
- Full reference: [documents/platform-docs.md](documents/platform-docs.md)
412
-
413
- ---
414
-
415
- ## Plugin system
416
-
417
- Extend the tool surface without forking the bridge.
418
-
419
- ```bash
420
- # Scaffold a new plugin
421
- patchwork gen-plugin-stub ./my-plugin --name "org/name" --prefix "myPrefix"
422
-
423
- # Load at runtime
424
- claude-ide-bridge --plugin ./my-plugin
65
+ npm install -g patchwork-os
66
+ claude-ide-bridge install-extension # VS Code / Cursor / Windsurf / Antigravity
67
+ claude-ide-bridge --workspace .
68
+ claude --ide # in another terminal
425
69
  ```
426
70
 
427
- Plugins register MCP tools in-process. With `--plugin-watch`, the bridge reloads them on save Claude can write a tool *during* a session and use it on the next turn. See [documents/live-toolsmithing.md](documents/live-toolsmithing.md) for the worked walkthrough and [examples/plugins/sqlite-library/](examples/plugins/sqlite-library/) for a runnable example.
428
-
429
- Publish to npm with keyword `claude-ide-bridge-plugin` for distribution.
430
-
431
- Full reference: [documents/plugin-authoring.md](documents/plugin-authoring.md)
432
-
433
- ---
71
+ JetBrains via a companion plugin. Claude Desktop, Gemini CLI, Codex CLI, Grok Build, and claude.ai connect over stdio or HTTP. Use the bridge alone forever if that's all you need; the runtime is an optional layer on top.
434
72
 
435
- ## JetBrains plugin
73
+ `claude --ide` can't find an IDE? Set `CLAUDE_CODE_IDE_SKIP_VALID_CHECK=true` (`patchwork init` does this for you).
436
74
 
437
- Companion IntelliJ plugin (v1.0.0) on the JetBrains Marketplace. Covers 49 handlers: core tools, PSI-based LSP (goto, references, hover, rename, symbols, format), XDebugger integration, and code style tools.
75
+ ## What's here
438
76
 
439
- Use the same bridge from VS Code and JetBrains IDEs simultaneously IntelliJ IDEA, PyCharm, GoLand, WebStorm, and other IntelliJ-platform editors.
77
+ - **Decision layer** approval queue · blast-radius action classes · worker trust ramp · kill switch · decision receipts
440
78
 
441
- Source: [intellij-plugin/](intellij-plugin/)
79
+ - **Automation** — YAML recipes · cron/file/git/test/webhook triggers · event hooks · multi-model (Claude, GPT, Gemini, Grok, Ollama)
442
80
 
443
- ---
81
+ - **Connectors** — 45+, all writes governed by your policy: GitHub, Slack, Gmail, Calendar, Drive, Linear, Jira, Sentry, Notion, Stripe, PagerDuty, Datadog, …
444
82
 
445
- ## Remote deployment
83
+ - **IDE bridge** — 177 MCP tools · VS Code-family extension · JetBrains plugin · plugins hot-reload (write tools mid-session)
446
84
 
447
- Run headless on a VPS with full tool support via VS Code Remote-SSH.
85
+ - **Oversight** web dashboard · mobile push approvals (PWA) · halts/judgments CLI · trace memory across sessions
448
86
 
449
- ```bash
450
- claude-ide-bridge --bind 0.0.0.0 \
451
- --issuer-url https://your-domain.com \
452
- --fixed-token <uuid> \
453
- --vps
454
- ```
87
+ - **Deployment** — your laptop · headless VPS with OAuth 2.0 ([guide](docs/remote-access.md)) · native Windows
455
88
 
456
- Systemd service and deploy scripts in [`deploy/`](deploy/). Full guide: [docs/remote-access.md](docs/remote-access.md).
89
+ Why not Zapier / an MCP server / a hosted assistant? Honest tradeoffs: [documents/comparison.md](documents/comparison.md).
457
90
 
458
- ---
91
+ ## Docs
459
92
 
460
- ## What's shipped
461
-
462
- | Feature | Status |
463
- |---|---|
464
- | 177 MCP tools (LSP, git, tests, debugger, diagnostics) | **shipped** |
465
- | VS Code / Cursor / Windsurf / Antigravity extension | **shipped** |
466
- | JetBrains plugin (49 handlers) | **shipped** |
467
- | `patchwork init` — one-command setup | **shipped** |
468
- | Terminal dashboard | **shipped** |
469
- | Web oversight UI (approvals, sessions, recipes) | **shipped** |
470
- | Recipe runner (YAML, cron, manual, webhook) | **shipped** |
471
- | Multi-provider LLM (Claude, Gemini, OpenAI, Grok, Ollama) | **shipped** |
472
- | Connectors: Linear, Sentry, Slack, Google Calendar, Intercom, HubSpot, Datadog, Stripe | **shipped** |
473
- | Cross-session memory (traces, handoff notes) | **shipped** |
474
- | Mobile oversight PWA (push approvals) | **shipped** |
475
- | Community recipe bundles (`patchwork recipe install github:<org>/<repo>`) | **shipped** |
476
- | Community recipe registry / discovery UI | TBD |
477
-
478
- ---
479
-
480
- ## Install from source
481
-
482
- ```bash
483
- git clone https://github.com/Oolab-labs/patchwork-os
484
- cd patchwork-os
485
- npm install && npm run build
486
-
487
- # Pack first — do NOT use `npm install -g .`
488
- # Symlink installs break the macOS LaunchAgent (EPERM at startup)
489
- npm pack
490
- npm install -g patchwork-os-*.tgz
491
- patchwork init
492
- ```
493
-
494
- ---
93
+ [Platform reference](documents/platform-docs.md) · [Recipes & triggers](documents/triggers.md) · [Worker autonomy](docs/worker-autonomy-policy-gate.md) · [Plugin authoring](documents/plugin-authoring.md) · [Architecture](documents/architecture.md) · [Windows](docs/windows.md) · [ADRs](docs/adr)
495
94
 
496
95
  ## Telemetry
497
96
 
498
- Patchwork ships an **opt-in** anonymous usage summary. It is **disabled by default**the bridge sends nothing unless you explicitly turn it on.
499
-
500
- **If you opt in**, on bridge shutdown an aggregate summary is POSTed to `https://analytics.claude-ide-bridge.dev/v1/usage`:
501
-
502
- - Total session count and total tool-call count (no per-call payloads)
503
- - Tool name → call count + median/p95 latency, capped at the top-N tools
504
- - Bridge version, Node version, OS family (`darwin` / `linux` / `win32`)
505
- - A per-install random salt (regenerated at any time by deleting `~/.claude/ide/analytics-salt`) used to coalesce repeated installs from the same machine without sending machine identifiers
506
-
507
- **What is never sent:** workspace paths, file contents, prompts, tool arguments, tool output, project names, git history, credentials, IPs (transport-level only, dropped server-side), or anything from `~/.patchwork/`.
97
+ Off by default; nothing is sent unless you opt in. If you do: aggregate counts and latencies onlynever paths, prompts, file contents, arguments, or anything from `~/.patchwork/`. [Details](docs/privacy-policy.md) & [source](src/analyticsSend.ts).
508
98
 
509
- **How to opt in:** set `analyticsEnabled: true` in the dashboard's Settings panel, or write `{"enabled": true, "decidedAt": "<iso>"}` to `~/.claude/ide/analytics.json` (mode 0600).
99
+ ## Contributing & support
510
100
 
511
- **How to opt out / stay out:** do nothing. Default state is `null` (no preference) which behaves as opt-out. To explicitly opt out and silence future prompts, write `{"enabled": false, ...}` to the same file.
512
-
513
- **Source:** [src/analyticsSend.ts](src/analyticsSend.ts), [src/analyticsAggregator.ts](src/analyticsAggregator.ts), [src/analyticsPrefs.ts](src/analyticsPrefs.ts) — endpoint is hardcoded (not runtime-configurable, by design, to prevent redirect attacks).
514
-
515
- ---
516
-
517
- ## Documentation
518
-
519
- | Doc | Contents |
520
- |---|---|
521
- | [documents/platform-docs.md](documents/platform-docs.md) | Full tool reference (177 tools), automation hooks, connectors |
522
- | [documents/prompts-reference.md](documents/prompts-reference.md) | All 36 MCP prompts |
523
- | [documents/styleguide.md](documents/styleguide.md) | Code conventions, UI patterns |
524
- | [documents/roadmap.md](documents/roadmap.md) | Development direction |
525
- | [documents/data-reference.md](documents/data-reference.md) | Data flows, state management, protocol details |
526
- | [documents/plugin-authoring.md](documents/plugin-authoring.md) | Plugin manifest schema, entrypoint API, distribution |
527
- | [documents/live-toolsmithing.md](documents/live-toolsmithing.md) | Write tools while the AI is using them — hot-reload narrative + worked example |
528
- | [documents/triggers.md](documents/triggers.md) | Anything Can Trigger Your AI — iPhone Shortcuts, Stream Deck, Home Assistant, curl, GitHub Actions |
529
- | [documents/speculative-refactoring.md](documents/speculative-refactoring.md) | Stage multi-file edits, review the diff, commit or discard — honest about commit-phase semantics |
530
- | [documents/architecture.md](documents/architecture.md) | One-page architecture diagram + how to read it |
531
- | [documents/comparison.md](documents/comparison.md) | Patchwork vs MCP server / Zapier / hosted assistants / agent frameworks — honest tradeoffs |
532
- | [docs/adr/](docs/adr/) | Architecture Decision Records |
533
- | [docs/remote-access.md](docs/remote-access.md) | VPS deployment guide |
534
-
535
- ---
536
-
537
- ## Support
538
-
539
- - **Bugs & feature requests:** [GitHub Issues](https://github.com/Oolab-labs/patchwork-os/issues)
540
- - **Questions & community:** [GitHub Discussions](https://github.com/Oolab-labs/patchwork-os/discussions)
541
- - **Contributing:** see [CONTRIBUTING.md](CONTRIBUTING.md)
542
-
543
- ---
101
+ [Issues](https://github.com/Oolab-labs/patchwork-os/issues) · [Discussions](https://github.com/Oolab-labs/patchwork-os/discussions) · [CONTRIBUTING.md](CONTRIBUTING.md)
544
102
 
545
- ## License
103
+ If this saved you a config file or a blown deploy, a star is the only signal I get that it's helping.
546
104
 
547
105
  MIT © Oolab Labs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchwork-os",
3
- "version": "0.2.0-beta.13.canary.330",
3
+ "version": "0.2.0-beta.13.canary.332",
4
4
  "description": "Your personal AI runtime, local-first. Patchwork OS gives any AI model a consistent set of tools, YAML recipes, a delegation policy with approval queue, and a durable trace memory — all on your machine, all under your policy.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",