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.
- package/README.md +46 -488
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,543 +5,101 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/patchwork-os)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
> **You don't have an automation problem. You have a decision problem.**
|
|
9
9
|
|
|
10
|
-
|
|
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
|
-
|
|
12
|
+
Three ideas, one runtime:
|
|
13
13
|
|
|
14
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
+

|
|
37
23
|
|
|
38
24
|
---
|
|
39
25
|
|
|
40
|
-
##
|
|
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
|
|
63
|
-
patchwork start #
|
|
29
|
+
npx patchwork-os@beta init # scaffolds ~/.patchwork, prints your dashboard login
|
|
30
|
+
patchwork start # bridge + dashboard
|
|
64
31
|
```
|
|
65
32
|
|
|
66
|
-
Open
|
|
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
|
-
|
|
35
|
+
Prereqs: Node 22+. macOS, Linux, and native Windows (no WSL).
|
|
69
36
|
|
|
70
|
-
|
|
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 workflow — Morning Brief:
|
|
79
38
|
|
|
80
39
|
```bash
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
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
|
-
|
|
47
|
+
## How it works
|
|
112
48
|
|
|
113
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
75
|
+
## What's here
|
|
438
76
|
|
|
439
|
-
|
|
77
|
+
- **Decision layer** — approval queue · blast-radius action classes · worker trust ramp · kill switch · decision receipts
|
|
440
78
|
|
|
441
|
-
|
|
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
|
-
|
|
83
|
+
- **IDE bridge** — 177 MCP tools · VS Code-family extension · JetBrains plugin · plugins hot-reload (write tools mid-session)
|
|
446
84
|
|
|
447
|
-
|
|
85
|
+
- **Oversight** — web dashboard · mobile push approvals (PWA) · halts/judgments CLI · trace memory across sessions
|
|
448
86
|
|
|
449
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 only — never paths, prompts, file contents, arguments, or anything from `~/.patchwork/`. [Details](docs/privacy-policy.md) & [source](src/analyticsSend.ts).
|
|
508
98
|
|
|
509
|
-
|
|
99
|
+
## Contributing & support
|
|
510
100
|
|
|
511
|
-
|
|
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
|
-
|
|
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.
|
|
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",
|