patchwork-os 0.2.0-alpha.33 → 0.2.0-alpha.35

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 (270) hide show
  1. package/README.md +248 -48
  2. package/deploy/bootstrap-new-vps.sh +12 -12
  3. package/deploy/bootstrap-vps.sh +6 -3
  4. package/deploy/deploy-landing.sh +59 -2
  5. package/dist/bridge.js +35 -1
  6. package/dist/bridge.js.map +1 -1
  7. package/dist/commands/recipe.d.ts +11 -0
  8. package/dist/commands/recipe.js +32 -3
  9. package/dist/commands/recipe.js.map +1 -1
  10. package/dist/commands/recipeInstall.d.ts +79 -1
  11. package/dist/commands/recipeInstall.js +241 -13
  12. package/dist/commands/recipeInstall.js.map +1 -1
  13. package/dist/connectors/asana.d.ts +198 -0
  14. package/dist/connectors/asana.js +680 -0
  15. package/dist/connectors/asana.js.map +1 -0
  16. package/dist/connectors/baseConnector.d.ts +16 -0
  17. package/dist/connectors/baseConnector.js +107 -25
  18. package/dist/connectors/baseConnector.js.map +1 -1
  19. package/dist/connectors/discord.d.ts +150 -0
  20. package/dist/connectors/discord.js +544 -0
  21. package/dist/connectors/discord.js.map +1 -0
  22. package/dist/connectors/github.js +15 -7
  23. package/dist/connectors/github.js.map +1 -1
  24. package/dist/connectors/gitlab.d.ts +180 -0
  25. package/dist/connectors/gitlab.js +582 -0
  26. package/dist/connectors/gitlab.js.map +1 -0
  27. package/dist/connectors/gmail.js +45 -0
  28. package/dist/connectors/gmail.js.map +1 -1
  29. package/dist/connectors/googleDrive.d.ts +34 -0
  30. package/dist/connectors/googleDrive.js +305 -0
  31. package/dist/connectors/googleDrive.js.map +1 -0
  32. package/dist/connectors/htmlEscape.d.ts +5 -0
  33. package/dist/connectors/htmlEscape.js +13 -0
  34. package/dist/connectors/htmlEscape.js.map +1 -0
  35. package/dist/connectors/linear.js +26 -6
  36. package/dist/connectors/linear.js.map +1 -1
  37. package/dist/connectors/mcpOAuth.d.ts +2 -0
  38. package/dist/connectors/mcpOAuth.js +8 -4
  39. package/dist/connectors/mcpOAuth.js.map +1 -1
  40. package/dist/connectors/pagerduty.d.ts +160 -0
  41. package/dist/connectors/pagerduty.js +464 -0
  42. package/dist/connectors/pagerduty.js.map +1 -0
  43. package/dist/connectors/sentry.js +3 -2
  44. package/dist/connectors/sentry.js.map +1 -1
  45. package/dist/connectors/slack.d.ts +1 -1
  46. package/dist/connectors/slack.js +7 -4
  47. package/dist/connectors/slack.js.map +1 -1
  48. package/dist/featureFlags.d.ts +17 -11
  49. package/dist/featureFlags.js +52 -47
  50. package/dist/featureFlags.js.map +1 -1
  51. package/dist/index.js +262 -129
  52. package/dist/index.js.map +1 -1
  53. package/dist/oauth.js +3 -2
  54. package/dist/oauth.js.map +1 -1
  55. package/dist/recipeOrchestration.d.ts +7 -0
  56. package/dist/recipeOrchestration.js +154 -28
  57. package/dist/recipeOrchestration.js.map +1 -1
  58. package/dist/recipes/agentExecutor.d.ts +1 -0
  59. package/dist/recipes/agentExecutor.js +7 -0
  60. package/dist/recipes/agentExecutor.js.map +1 -1
  61. package/dist/recipes/captureForRunlog.d.ts +27 -0
  62. package/dist/recipes/captureForRunlog.js +128 -0
  63. package/dist/recipes/captureForRunlog.js.map +1 -0
  64. package/dist/recipes/chainedRunner.d.ts +39 -3
  65. package/dist/recipes/chainedRunner.js +183 -28
  66. package/dist/recipes/chainedRunner.js.map +1 -1
  67. package/dist/recipes/detectSilentFail.d.ts +34 -0
  68. package/dist/recipes/detectSilentFail.js +105 -0
  69. package/dist/recipes/detectSilentFail.js.map +1 -0
  70. package/dist/recipes/legacyRecipeCompat.d.ts +8 -0
  71. package/dist/recipes/legacyRecipeCompat.js +20 -1
  72. package/dist/recipes/legacyRecipeCompat.js.map +1 -1
  73. package/dist/recipes/manifest.js +21 -6
  74. package/dist/recipes/manifest.js.map +1 -1
  75. package/dist/recipes/migrations/index.d.ts +24 -0
  76. package/dist/recipes/migrations/index.js +55 -0
  77. package/dist/recipes/migrations/index.js.map +1 -0
  78. package/dist/recipes/migrations/types.d.ts +28 -0
  79. package/dist/recipes/migrations/types.js +2 -0
  80. package/dist/recipes/migrations/types.js.map +1 -0
  81. package/dist/recipes/migrations/v1.d.ts +11 -0
  82. package/dist/recipes/migrations/v1.js +18 -0
  83. package/dist/recipes/migrations/v1.js.map +1 -0
  84. package/dist/recipes/replayRun.d.ts +62 -0
  85. package/dist/recipes/replayRun.js +97 -0
  86. package/dist/recipes/replayRun.js.map +1 -0
  87. package/dist/recipes/scheduler.js +102 -11
  88. package/dist/recipes/scheduler.js.map +1 -1
  89. package/dist/recipes/schemaGenerator.js +3 -3
  90. package/dist/recipes/schemaGenerator.js.map +1 -1
  91. package/dist/recipes/templateEngine.js +8 -1
  92. package/dist/recipes/templateEngine.js.map +1 -1
  93. package/dist/recipes/toolRegistry.d.ts +5 -0
  94. package/dist/recipes/toolRegistry.js +9 -0
  95. package/dist/recipes/toolRegistry.js.map +1 -1
  96. package/dist/recipes/tools/asana.d.ts +16 -0
  97. package/dist/recipes/tools/asana.js +524 -0
  98. package/dist/recipes/tools/asana.js.map +1 -0
  99. package/dist/recipes/tools/discord.d.ts +18 -0
  100. package/dist/recipes/tools/discord.js +254 -0
  101. package/dist/recipes/tools/discord.js.map +1 -0
  102. package/dist/recipes/tools/github.js +29 -4
  103. package/dist/recipes/tools/github.js.map +1 -1
  104. package/dist/recipes/tools/gitlab.d.ts +11 -0
  105. package/dist/recipes/tools/gitlab.js +285 -0
  106. package/dist/recipes/tools/gitlab.js.map +1 -0
  107. package/dist/recipes/tools/gmail.d.ts +1 -1
  108. package/dist/recipes/tools/gmail.js +230 -6
  109. package/dist/recipes/tools/gmail.js.map +1 -1
  110. package/dist/recipes/tools/googleDrive.d.ts +1 -0
  111. package/dist/recipes/tools/googleDrive.js +55 -0
  112. package/dist/recipes/tools/googleDrive.js.map +1 -0
  113. package/dist/recipes/tools/index.d.ts +6 -0
  114. package/dist/recipes/tools/index.js +6 -0
  115. package/dist/recipes/tools/index.js.map +1 -1
  116. package/dist/recipes/tools/linear.d.ts +2 -1
  117. package/dist/recipes/tools/linear.js +222 -1
  118. package/dist/recipes/tools/linear.js.map +1 -1
  119. package/dist/recipes/tools/meetingNotes.d.ts +21 -0
  120. package/dist/recipes/tools/meetingNotes.js +701 -0
  121. package/dist/recipes/tools/meetingNotes.js.map +1 -0
  122. package/dist/recipes/tools/pagerduty.d.ts +15 -0
  123. package/dist/recipes/tools/pagerduty.js +451 -0
  124. package/dist/recipes/tools/pagerduty.js.map +1 -0
  125. package/dist/recipes/tools/slack.js +8 -2
  126. package/dist/recipes/tools/slack.js.map +1 -1
  127. package/dist/recipes/validation.js +54 -15
  128. package/dist/recipes/validation.js.map +1 -1
  129. package/dist/recipes/yamlRunner.d.ts +23 -2
  130. package/dist/recipes/yamlRunner.js +265 -60
  131. package/dist/recipes/yamlRunner.js.map +1 -1
  132. package/dist/recipesHttp.d.ts +60 -0
  133. package/dist/recipesHttp.js +418 -3
  134. package/dist/recipesHttp.js.map +1 -1
  135. package/dist/runLog.d.ts +64 -2
  136. package/dist/runLog.js +116 -2
  137. package/dist/runLog.js.map +1 -1
  138. package/dist/server.d.ts +21 -0
  139. package/dist/server.js +387 -8
  140. package/dist/server.js.map +1 -1
  141. package/dist/streamableHttp.d.ts +31 -1
  142. package/dist/streamableHttp.js +20 -2
  143. package/dist/streamableHttp.js.map +1 -1
  144. package/dist/tools/activityLog.d.ts +2 -0
  145. package/dist/tools/addLinearComment.d.ts +1 -0
  146. package/dist/tools/batchLsp.d.ts +3 -0
  147. package/dist/tools/bridgeDoctor.d.ts +1 -0
  148. package/dist/tools/bridgeStatus.d.ts +1 -0
  149. package/dist/tools/cancelClaudeTask.d.ts +1 -0
  150. package/dist/tools/checkDocumentDirty.d.ts +1 -0
  151. package/dist/tools/clipboard.d.ts +2 -0
  152. package/dist/tools/closeTabs.d.ts +2 -0
  153. package/dist/tools/codeLens.d.ts +1 -0
  154. package/dist/tools/contextBundle.d.ts +1 -0
  155. package/dist/tools/createIssueFromAIComment.d.ts +1 -0
  156. package/dist/tools/createLinearIssue.d.ts +1 -0
  157. package/dist/tools/ctxGetTaskContext.d.ts +1 -0
  158. package/dist/tools/ctxQueryTraces.d.ts +1 -0
  159. package/dist/tools/ctxSaveTrace.d.ts +1 -0
  160. package/dist/tools/debug.d.ts +4 -0
  161. package/dist/tools/decorations.d.ts +2 -0
  162. package/dist/tools/documentLinks.d.ts +1 -0
  163. package/dist/tools/editText.d.ts +1 -0
  164. package/dist/tools/enrichCommit.d.ts +1 -0
  165. package/dist/tools/enrichStackTrace.d.ts +1 -0
  166. package/dist/tools/explainDiagnostic.d.ts +1 -0
  167. package/dist/tools/explainSymbol.d.ts +1 -0
  168. package/dist/tools/fetchCalendarEvents.d.ts +1 -0
  169. package/dist/tools/fetchGithubIssue.d.ts +1 -0
  170. package/dist/tools/fetchGithubPR.d.ts +1 -0
  171. package/dist/tools/fetchLinearIssue.d.ts +1 -0
  172. package/dist/tools/fetchSentryIssue.d.ts +1 -0
  173. package/dist/tools/fetchSlackProfile.d.ts +1 -0
  174. package/dist/tools/fileOperations.d.ts +3 -0
  175. package/dist/tools/fileWatcher.d.ts +2 -0
  176. package/dist/tools/findFiles.d.ts +1 -0
  177. package/dist/tools/findRelatedTests.d.ts +1 -0
  178. package/dist/tools/fixAllLintErrors.d.ts +1 -0
  179. package/dist/tools/foldingRanges.d.ts +1 -0
  180. package/dist/tools/formatDocument.d.ts +1 -0
  181. package/dist/tools/generateTests.d.ts +1 -0
  182. package/dist/tools/getAIComments.d.ts +1 -0
  183. package/dist/tools/getAnalyticsReport.d.ts +1 -0
  184. package/dist/tools/getArchitectureContext.d.ts +1 -0
  185. package/dist/tools/getBufferContent.d.ts +1 -0
  186. package/dist/tools/getChangeImpact.d.ts +1 -0
  187. package/dist/tools/getClaudeTaskStatus.d.ts +1 -0
  188. package/dist/tools/getCodeCoverage.d.ts +1 -0
  189. package/dist/tools/getCommitsForIssue.d.ts +1 -0
  190. package/dist/tools/getConnectorStatus.d.ts +1 -0
  191. package/dist/tools/getCurrentSelection.d.ts +2 -0
  192. package/dist/tools/getDebugState.d.ts +1 -0
  193. package/dist/tools/getDependencyTree.d.ts +1 -0
  194. package/dist/tools/getDiagnostics.d.ts +1 -0
  195. package/dist/tools/getDiffFromHandoff.d.ts +1 -0
  196. package/dist/tools/getDocumentSymbols.d.ts +1 -0
  197. package/dist/tools/getFileTree.d.ts +1 -0
  198. package/dist/tools/getGitDiff.d.ts +1 -0
  199. package/dist/tools/getGitHotspots.d.ts +1 -0
  200. package/dist/tools/getGitLog.d.ts +1 -0
  201. package/dist/tools/getGitStatus.d.ts +1 -0
  202. package/dist/tools/getImportTree.d.ts +1 -0
  203. package/dist/tools/getImportedSignatures.d.ts +1 -0
  204. package/dist/tools/getOpenEditors.d.ts +1 -0
  205. package/dist/tools/getPRTemplate.d.ts +1 -0
  206. package/dist/tools/getProjectContext.d.ts +1 -0
  207. package/dist/tools/getProjectInfo.d.ts +1 -0
  208. package/dist/tools/getSecurityAdvisories.d.ts +1 -0
  209. package/dist/tools/getSessionUsage.d.ts +1 -0
  210. package/dist/tools/getSymbolHistory.d.ts +1 -0
  211. package/dist/tools/getToolCapabilities.d.ts +1 -0
  212. package/dist/tools/getTypeSignature.d.ts +1 -0
  213. package/dist/tools/getWorkspaceFolders.d.ts +1 -0
  214. package/dist/tools/getWorkspaceSettings.d.ts +1 -0
  215. package/dist/tools/gitHistory.d.ts +2 -0
  216. package/dist/tools/gitWrite.d.ts +11 -0
  217. package/dist/tools/github/actions.d.ts +2 -0
  218. package/dist/tools/github/composite.d.ts +3 -0
  219. package/dist/tools/github/issues.d.ts +4 -0
  220. package/dist/tools/github/pr.d.ts +7 -0
  221. package/dist/tools/handoffNote.d.ts +2 -0
  222. package/dist/tools/hoverAtCursor.d.ts +1 -0
  223. package/dist/tools/httpClient.d.ts +2 -0
  224. package/dist/tools/inlayHints.d.ts +1 -0
  225. package/dist/tools/launchQuickTask.d.ts +1 -0
  226. package/dist/tools/listClaudeTasks.d.ts +1 -0
  227. package/dist/tools/listTerminals.d.ts +1 -0
  228. package/dist/tools/lsp.d.ts +14 -0
  229. package/dist/tools/navigateToSymbolByName.d.ts +1 -0
  230. package/dist/tools/openDiff.d.ts +1 -0
  231. package/dist/tools/openFile.d.ts +1 -0
  232. package/dist/tools/openInBrowser.d.ts +1 -0
  233. package/dist/tools/organizeImports.d.ts +1 -0
  234. package/dist/tools/performanceReport.d.ts +1 -0
  235. package/dist/tools/planPersistence.d.ts +5 -0
  236. package/dist/tools/previewEdit.d.ts +1 -0
  237. package/dist/tools/refactorAnalyze.d.ts +1 -0
  238. package/dist/tools/refactorPreview.d.ts +1 -0
  239. package/dist/tools/replaceBlock.d.ts +1 -0
  240. package/dist/tools/resumeClaudeTask.d.ts +1 -0
  241. package/dist/tools/runClaudeTask.d.ts +1 -0
  242. package/dist/tools/runCommand.d.ts +1 -0
  243. package/dist/tools/runTests.d.ts +1 -0
  244. package/dist/tools/saveDocument.d.ts +1 -0
  245. package/dist/tools/screenshotAndAnnotate.d.ts +1 -0
  246. package/dist/tools/searchAndReplace.d.ts +1 -0
  247. package/dist/tools/searchTools.d.ts +1 -0
  248. package/dist/tools/searchWorkspace.d.ts +1 -0
  249. package/dist/tools/selectionRanges.d.ts +1 -0
  250. package/dist/tools/semanticTokens.d.ts +1 -0
  251. package/dist/tools/setActiveWorkspaceFolder.d.ts +1 -0
  252. package/dist/tools/signatureHelp.d.ts +1 -0
  253. package/dist/tools/slackListChannels.d.ts +1 -0
  254. package/dist/tools/slackPostMessage.d.ts +1 -0
  255. package/dist/tools/slackPostMessage.js +1 -1
  256. package/dist/tools/slackPostMessage.js.map +1 -1
  257. package/dist/tools/terminal.d.ts +6 -0
  258. package/dist/tools/testTraceToSource.d.ts +1 -0
  259. package/dist/tools/transaction.d.ts +4 -0
  260. package/dist/tools/typeHierarchy.d.ts +1 -0
  261. package/dist/tools/updateLinearIssue.d.ts +1 -0
  262. package/dist/tools/utils.d.ts +2 -0
  263. package/dist/tools/utils.js.map +1 -1
  264. package/dist/tools/vscodeCommands.d.ts +2 -0
  265. package/dist/tools/vscodeTasks.d.ts +2 -0
  266. package/dist/tools/workspaceSettings.d.ts +1 -0
  267. package/package.json +20 -4
  268. package/templates/recipes/project-health-check.yaml +1 -1
  269. package/dist/schemas/dry-run-plan.v1.json +0 -139
  270. package/dist/schemas/recipe.v1.json +0 -684
package/README.md CHANGED
@@ -1,92 +1,292 @@
1
- # Patchwork OS
1
+ # Claude IDE Bridge & Patchwork OS
2
2
 
3
- **AI that works while you're away. Runs on your machine. Doesn't lock you in.**
3
+ **One npm package. Two products.** Pick the layer you need.
4
+
5
+ | | What you get | Install | Best for |
6
+ |---|---|---|---|
7
+ | **🔌 Claude IDE Bridge** | MCP bridge connecting Claude Code to your IDE. 170+ 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 |
8
+ | **🤖 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 patchwork-init` | Power users running automation, agent workflows, or background tasks |
9
+
10
+ Same codebase. Bridge is the foundation; Patchwork OS is the optional layer on top. **No vendor lock-in. Runs on your machine.**
11
+
12
+ ---
13
+
14
+ ## 🔌 Claude IDE Bridge — Quick Start
15
+
16
+ ```bash
17
+ # 1. Install the npm package
18
+ npm install -g patchwork-os
19
+
20
+ # 2. Install the VS Code / Cursor / Windsurf extension
21
+ # Search "Claude IDE Bridge" on OpenVSX, or:
22
+ claude-ide-bridge install-extension
23
+
24
+ # 3. Start the bridge for your workspace
25
+ claude-ide-bridge --workspace .
26
+
27
+ # 4. Connect Claude Code (in another terminal)
28
+ CLAUDE_CODE_IDE_SKIP_VALID_CHECK=true claude --ide
29
+ ```
30
+
31
+ 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 170+ tools to act on them.
32
+
33
+ **What the bridge gives Claude:**
34
+
35
+ - Diagnostics, LSP navigation (goto / references / call hierarchy), refactoring with risk analysis
36
+ - Terminal — run commands, read output, wait for async work
37
+ - Git — status, diff, commit, push, blame, checkout, branch list
38
+ - GitHub — open PRs, list issues, post reviews, fetch run logs
39
+ - Debugger — set breakpoints, evaluate expressions, inspect runtime state
40
+ - Files — read, edit by line range, search and replace, capture screenshots
41
+ - Code quality — `auditDependencies`, `detectUnusedCode`, `getCodeCoverage`, `getGitHotspots`
42
+
43
+ The bridge runs without any flags. No recipes, no automation, no dashboard — just the IDE-Claude connection.
44
+
45
+ **Compatible IDEs:** VS Code, Cursor, Windsurf, Google Antigravity. JetBrains IDEs via [companion plugin](#jetbrains-plugin).
46
+
47
+ **Transport layers:**
48
+
49
+ | Client | Protocol |
50
+ |---|---|
51
+ | Claude Code CLI | WebSocket `ws://127.0.0.1:<port>` |
52
+ | Claude Desktop | stdio shim → WebSocket |
53
+ | Remote (claude.ai, Codex CLI) | Streamable HTTP + Bearer token |
54
+
55
+ **Tool modes:**
56
+
57
+ | Mode | Tools | When to use |
58
+ |---|---|---|
59
+ | Full _(default)_ | ~170 | All git, GitHub, terminal, file ops, orchestration |
60
+ | Slim (`--slim`) | ~60 | LSP + debugger + editor state only |
61
+
62
+ Bridge-only docs: [documents/platform-docs.md](documents/platform-docs.md)
63
+
64
+ ---
65
+
66
+ ## 🤖 Patchwork OS — Quick Start
4
67
 
5
68
  ```bash
6
69
  npx patchwork-os@alpha patchwork-init
7
70
  ```
8
71
 
9
- That one command sets up 5 local recipes, detects Ollama, and drops a terminal dashboard at your fingertips — under 90 seconds on a warm npm cache.
72
+ Sets up 5 local recipes, detects Ollama, and opens a terminal dashboard — under 90 seconds.
73
+
74
+ ### What it adds on top of the bridge
10
75
 
11
- ## What it does
76
+ 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.
12
77
 
13
- Patchwork OS watches for things that matter, acts, and asks before anything risky goes out.
78
+ Think of it as a background agent that acts on your behalf — but asks before sending, writing, or modifying anything consequential.
14
79
 
15
- - **A developer's overnight.** Tests fail on a push a one-paragraph triage note lands in your inbox. You wake up knowing where to look.
16
- - **A small business's inbox.** New customer questions triaged, follow-ups drafted in your voice. Nothing sends without your nod.
17
- - **A parent's morning.** Field-trip form flagged, reply drafted to the teacher done before the first coffee.
80
+ - Test suite fails on CI → triage note in your inbox before you wake up
81
+ - Customer email arrives draft reply in your voice, pending your approval
82
+ - Field-trip permission form flagged reply drafted to the teacher, waiting for your nod
18
83
 
19
- ## How it works
84
+ **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.
20
85
 
21
- - **Recipes** plain YAML files describe what to watch and what to do. Share them like dotfiles. No code required.
22
- - **Your models, your keys** — Claude, GPT, Gemini, Grok, or local Ollama. Swap anytime. Nothing phones home.
23
- - **Oversight first** — everything risky lands in `~/.patchwork/inbox/` for your approval before it goes anywhere.
86
+ **Models** are yours. Claude, GPT, Gemini, Grok, or local Ollama. Swap at any time. Nothing phones home.
24
87
 
25
- ## After init
88
+ **Oversight** is non-negotiable. Every write or external action lands in `~/.patchwork/inbox/` for approval. The web UI at `http://localhost:3100` shows pending approvals, live sessions, recipe run history, and analytics.
89
+
90
+ ### Patchwork commands
26
91
 
27
92
  ```bash
28
- patchwork-os recipe list # see installed recipes
29
- patchwork-os recipe run daily-status # run one now
30
- patchwork-os recipe run morning-brief --local # run with local LLM
31
- patchwork-os tools list # browse all 140+ tools
32
- patchwork-os # open terminal dashboard
93
+ # One-command setup: extension + CLAUDE.md + starter recipes
94
+ patchwork patchwork-init
95
+
96
+ # Explore
97
+ patchwork recipe list # installed recipes
98
+ patchwork recipe run daily-status # run one now
99
+ patchwork recipe run morning-brief --local # run with local Ollama
100
+ patchwork tools list # browse 170+ tools
101
+ patchwork # open terminal dashboard
102
+
103
+ # Web UI — bridge + extension watcher in tmux
104
+ patchwork start-all # then http://localhost:3100
33
105
  ```
34
106
 
35
- The oversight web UI runs at `http://localhost:3100` when the bridge is active. The dashboard shows live sessions, pending approvals, recent recipe runs, and analytics.
107
+ ### Starter recipes
36
108
 
37
- ## Starter recipes (no external API keys needed)
109
+ No external API keys needed for these:
38
110
 
39
111
  | Recipe | Trigger | What it does |
40
112
  |---|---|---|
41
- | `ambient-journal` | git commit | appends one line to `~/.patchwork/journal/` |
42
- | `daily-status` | cron 08:00 | morning brief from yesterday's commits |
43
- | `watch-failing-tests` | test run | drops triage note to inbox on failure |
44
- | `lint-on-save` | file save | surfaces new TS/JS diagnostics to inbox |
45
- | `stale-branches` | cron weekly | lists branches older than 30 days |
46
- | `morning-brief` | cron 08:00 | commits + Linear issues + Calendar events |
113
+ | `ambient-journal` | git commit | Appends one line to `~/.patchwork/journal/` |
114
+ | `daily-status` | cron 08:00 | Morning brief from yesterday's commits |
115
+ | `watch-failing-tests` | test run | Drops triage note to inbox on failure |
116
+ | `lint-on-save` | file save | Surfaces new TS/JS diagnostics to inbox |
117
+ | `stale-branches` | cron weekly | Lists branches older than 30 days |
118
+ | `morning-brief` | cron 08:00 | Commits + Linear issues + Calendar events |
47
119
  | `sentry-to-linear` | manual | Sentry issue → Linear ticket (one-shot) |
120
+ | `google-meet-debrief` | manual | Meeting notes → Linear + Slack |
121
+
122
+ Connectors (Linear, Sentry, Slack, Google Calendar, Intercom, HubSpot, Datadog, Stripe) require API keys and approval-gated writes.
123
+
124
+ ### Automation hooks
48
125
 
49
- Local recipes write to `~/.patchwork/inbox/` only. Connectors (Linear, Sentry, etc.) require API keys and approval-gated writes.
126
+ Event-driven hooks trigger Claude tasks automatically. Activate with `--automation --automation-policy <path.json> --claude-driver subprocess`.
50
127
 
51
- ## What's working today
128
+ Key hooks:
129
+
130
+ | Hook | Fires when |
131
+ |---|---|
132
+ | `onFileSave` | Matching files saved |
133
+ | `onDiagnosticsStateChange` | Errors appear or clear |
134
+ | `onRecipeSave` | Any `.yaml`/`.yml` saved — runs preflight |
135
+ | `onGitCommit` / `onGitPush` / `onGitPull` | Git tools succeed |
136
+ | `onTestRun` | Test run completes (filter: any/failure/pass-after-fail) |
137
+ | `onBranchCheckout` | After branch switch |
138
+ | `onPullRequest` | After `githubCreatePR` succeeds |
139
+ | `onCompaction` | Before/after Claude context compaction |
140
+ | `onTaskCreated` / `onTaskSuccess` | Orchestrator task lifecycle |
141
+
142
+ 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)
143
+
144
+ ---
145
+
146
+ ## Architecture
147
+
148
+ ```
149
+ patchwork-os (npm package)
150
+
151
+ ├── claude-ide-bridge ← run alone for bridge-only mode
152
+ │ ├── MCP server 170+ tools over WebSocket / HTTP / stdio
153
+ │ ├── VS Code extension LSP, debugger, editor state, live diagnostics
154
+ │ ├── Git / GitHub gitCommit, gitPush, githubCreatePR, …
155
+ │ ├── Terminal runInTerminal, getTerminalOutput, …
156
+ │ └── Code quality auditDependencies, detectUnusedCode, getCodeCoverage
157
+
158
+ └── patchwork ← run for full Patchwork OS layer
159
+ ├── Recipe runner YAML triggers → LLM prompt → action
160
+ ├── Connectors Linear, Sentry, Slack, Google Calendar, +
161
+ ├── Orchestrator Claude subprocess tasks, automation hooks
162
+ ├── Oversight inbox ~/.patchwork/inbox/ — approval queue
163
+ └── Web dashboard http://localhost:3100 — approvals, sessions, analytics
164
+ ```
165
+
166
+ The npm package ships **three CLI binaries** that share the same code:
167
+
168
+ | Binary | Default behavior |
169
+ |---|---|
170
+ | `claude-ide-bridge` | Bridge only — no automation, no recipe runner, no dashboard |
171
+ | `patchwork` | Full Patchwork OS — automation + recipes + dashboard |
172
+ | `patchwork-os` | Alias for `patchwork` |
173
+
174
+ Use whichever fits your mental model.
175
+
176
+ ---
177
+
178
+ ## Tool surface (v0.2.0-alpha.35)
179
+
180
+ 170+ MCP tools across 15 categories. Highlights:
181
+
182
+ | Category | Tools |
183
+ |---|---|
184
+ | LSP / Code Intelligence | `getDiagnostics`, `goToDefinition`, `findReferences`, `getCallHierarchy`, `renameSymbol`, `refactorAnalyze`, `explainSymbol`, … (37 tools) |
185
+ | Git | `getGitStatus`, `getGitDiff`, `gitCommit`, `gitPush`, `gitCheckout`, `gitBlame`, … (16 tools) |
186
+ | GitHub | `githubCreatePR`, `githubListPRs`, `githubCreateIssue`, `githubPostPRReview`, … (13 tools) |
187
+ | Terminal | `runInTerminal`, `createTerminal`, `getTerminalOutput`, `waitForTerminalOutput` |
188
+ | File Operations | `editText`, `searchAndReplace`, `searchWorkspace`, `findFiles`, `getFileTree`, … |
189
+ | Debugger | `setDebugBreakpoints`, `startDebugging`, `evaluateInDebugger` |
190
+ | Orchestrator | `runClaudeTask`, `listClaudeTasks`, `getClaudeTaskStatus` |
191
+ | Context Platform | `ctxGetTaskContext`, `ctxQueryTraces`, `ctxSaveTrace`, `enrichStackTrace` |
192
+
193
+ Full reference: [documents/platform-docs.md](documents/platform-docs.md)
194
+
195
+ ---
196
+
197
+ ## Plugin system
198
+
199
+ Extend the tool surface without forking the bridge.
200
+
201
+ ```bash
202
+ # Scaffold a new plugin
203
+ patchwork gen-plugin-stub ./my-plugin --name "org/name" --prefix "myPrefix"
204
+
205
+ # Load at runtime
206
+ claude-ide-bridge --plugin ./my-plugin
207
+ ```
208
+
209
+ Plugins register MCP tools in-process. Publish to npm with keyword `claude-ide-bridge-plugin`.
210
+
211
+ Full reference: [documents/plugin-authoring.md](documents/plugin-authoring.md)
212
+
213
+ ---
214
+
215
+ ## JetBrains plugin
216
+
217
+ 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.
218
+
219
+ Use the same bridge from VS Code and JetBrains IDEs simultaneously — IntelliJ IDEA, PyCharm, GoLand, WebStorm, and other IntelliJ-platform editors.
220
+
221
+ Source: [intellij-plugin/](intellij-plugin/)
222
+
223
+ ---
224
+
225
+ ## Remote deployment
226
+
227
+ Run headless on a VPS with full tool support via VS Code Remote-SSH.
228
+
229
+ ```bash
230
+ claude-ide-bridge --bind 0.0.0.0 \
231
+ --issuer-url https://your-domain.com \
232
+ --fixed-token <uuid> \
233
+ --vps
234
+ ```
235
+
236
+ Systemd service and deploy scripts in [`deploy/`](deploy/). Full guide: [docs/remote-access.md](docs/remote-access.md).
237
+
238
+ ---
239
+
240
+ ## What's shipped
52
241
 
53
242
  | Feature | Status |
54
243
  |---|---|
244
+ | 170+ MCP tools (LSP, git, tests, debugger, diagnostics) | **shipped** |
245
+ | VS Code / Cursor / Windsurf / Antigravity extension | **shipped** |
246
+ | JetBrains plugin (49 handlers) | **shipped** |
55
247
  | `patchwork-init` — one-command setup | **shipped** |
56
- | Terminal dashboard (`patchwork-os`) | **shipped** |
248
+ | Terminal dashboard | **shipped** |
57
249
  | Web oversight UI (approvals, sessions, recipes) | **shipped** |
58
250
  | Recipe runner (YAML, cron, manual, webhook) | **shipped** |
59
251
  | Multi-provider LLM (Claude, Gemini, OpenAI, Grok, Ollama) | **shipped** |
60
- | Linear connector (read + approval-gated write) | **shipped** |
61
- | Sentry connector (fetch issues, stack traces) | **shipped** |
62
- | Google Calendar connector (read-only) | **shipped** |
63
- | Slack connector (post messages, list channels) | **shipped** |
64
- | 140+ MCP tools (LSP, git, tests, diagnostics) | **shipped** |
252
+ | Connectors: Linear, Sentry, Slack, Google Calendar, Intercom, HubSpot, Datadog, Stripe | **shipped** |
65
253
  | Cross-session memory (traces, handoff notes) | **shipped** |
66
- | Gmail connector | W2 |
67
- | Mobile oversight PWA | W3 |
68
- | Community recipe marketplace | Q3 |
254
+ | Mobile oversight PWA (push approvals) | **shipped (alpha)** |
255
+ | Community recipe marketplace | Q3 2026 |
69
256
 
70
- ## Install
257
+ ---
71
258
 
72
- **From the registry (recommended):**
73
- ```bash
74
- npm install -g patchwork-os
75
- patchwork-os patchwork-init
76
- ```
259
+ ## Install from source
77
260
 
78
- **From a local build (development / CI):**
79
261
  ```bash
80
262
  git clone https://github.com/Oolab-labs/patchwork-os
81
263
  cd patchwork-os
82
264
  npm install && npm run build
83
- # Use npm pack to create a real copy — do NOT use `npm install -g .`
84
- # That creates a symlink which breaks the macOS LaunchAgent (EPERM at startup).
265
+
266
+ # Pack first do NOT use `npm install -g .`
267
+ # Symlink installs break the macOS LaunchAgent (EPERM at startup)
85
268
  npm pack
86
269
  npm install -g patchwork-os-*.tgz
87
- patchwork-os patchwork-init
270
+ patchwork patchwork-init
88
271
  ```
89
272
 
273
+ ---
274
+
275
+ ## Documentation
276
+
277
+ | Doc | Contents |
278
+ |---|---|
279
+ | [documents/platform-docs.md](documents/platform-docs.md) | Full tool reference (170+ tools), automation hooks, connectors |
280
+ | [documents/prompts-reference.md](documents/prompts-reference.md) | All 72 MCP prompts |
281
+ | [documents/styleguide.md](documents/styleguide.md) | Code conventions, UI patterns |
282
+ | [documents/roadmap.md](documents/roadmap.md) | Development direction |
283
+ | [documents/data-reference.md](documents/data-reference.md) | Data flows, state management, protocol details |
284
+ | [documents/plugin-authoring.md](documents/plugin-authoring.md) | Plugin manifest schema, entrypoint API, distribution |
285
+ | [docs/adr/](docs/adr/) | Architecture Decision Records |
286
+ | [docs/remote-access.md](docs/remote-access.md) | VPS deployment guide |
287
+
288
+ ---
289
+
90
290
  ## License
91
291
 
92
- MIT © Oolab Labs. Built on the [Claude IDE Bridge](./README.bridge.md).
292
+ MIT © Oolab Labs
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
  # deploy/bootstrap-new-vps.sh
3
- # Full fresh-server setup for claude-ide-bridge on a NEW VPS.
3
+ # Full fresh-server setup for patchwork-os on a NEW VPS.
4
4
  # Handles everything from Node.js install to running HTTPS service.
5
5
  #
6
6
  # Usage (run as root on a fresh Ubuntu 22.04/24.04 VPS):
7
- # curl -fsSL https://raw.githubusercontent.com/Oolab-labs/claude-ide-bridge/main/deploy/bootstrap-new-vps.sh | \
7
+ # curl -fsSL https://raw.githubusercontent.com/Oolab-labs/patchwork-os/main/deploy/bootstrap-new-vps.sh | \
8
8
  # DOMAIN=bridge.example.com bash
9
9
  #
10
10
  # Or after cloning:
@@ -14,9 +14,9 @@
14
14
  # DOMAIN Subdomain for the bridge (e.g. bridge.example.com)
15
15
  #
16
16
  # Optional environment variables:
17
- # REPO_URL Git repo URL (default: https://github.com/Oolab-labs/claude-ide-bridge)
18
- # INSTALL_DIR Where to clone the repo (default: /opt/claude-ide-bridge)
19
- # SERVICE_USER System user to run bridge (default: claude-bridge)
17
+ # REPO_URL Git repo URL (default: https://github.com/Oolab-labs/patchwork-os)
18
+ # INSTALL_DIR Where to clone the repo (default: /opt/patchwork-os)
19
+ # SERVICE_USER System user to run bridge (default: patchwork)
20
20
  # PORT Bridge port (default: 9000)
21
21
  # BRANCH Git branch to clone (default: main)
22
22
  # SKIP_CERTBOT Set to 1 to skip TLS cert (useful if DNS not yet set)
@@ -25,13 +25,13 @@ set -euo pipefail
25
25
 
26
26
  # ── Config ────────────────────────────────────────────────────────────────────
27
27
  DOMAIN="${DOMAIN:-}"
28
- REPO_URL="${REPO_URL:-https://github.com/Oolab-labs/claude-ide-bridge}"
29
- INSTALL_DIR="${INSTALL_DIR:-/opt/claude-ide-bridge}"
30
- SERVICE_USER="${SERVICE_USER:-claude-bridge}"
28
+ REPO_URL="${REPO_URL:-https://github.com/Oolab-labs/patchwork-os}"
29
+ INSTALL_DIR="${INSTALL_DIR:-/opt/patchwork-os}"
30
+ SERVICE_USER="${SERVICE_USER:-patchwork}"
31
31
  PORT="${PORT:-9000}"
32
32
  BRANCH="${BRANCH:-main}"
33
33
  SKIP_CERTBOT="${SKIP_CERTBOT:-0}"
34
- SERVICE_NAME="claude-ide-bridge"
34
+ SERVICE_NAME="patchwork-os"
35
35
 
36
36
  RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'
37
37
  info() { echo -e "${GREEN}✓${NC} $*"; }
@@ -163,8 +163,8 @@ section "Systemd service"
163
163
  # Generate service file from template (parameterised for this install)
164
164
  cat > "/etc/systemd/system/${SERVICE_NAME}.service" <<SERVICE
165
165
  [Unit]
166
- Description=Claude IDE Bridge MCP Server
167
- Documentation=https://github.com/Oolab-labs/claude-ide-bridge
166
+ Description=Patchwork OS bridge
167
+ Documentation=https://github.com/Oolab-labs/patchwork-os
168
168
  After=network.target
169
169
  StartLimitIntervalSec=120
170
170
  StartLimitBurst=5
@@ -193,7 +193,7 @@ RestartSec=5
193
193
 
194
194
  StandardOutput=journal
195
195
  StandardError=journal
196
- SyslogIdentifier=claude-ide-bridge
196
+ SyslogIdentifier=patchwork-os
197
197
 
198
198
  NoNewPrivileges=true
199
199
  PrivateTmp=true
@@ -40,9 +40,12 @@ mkdir -p "${BRIDGE_HOME}"
40
40
  chown "${BRIDGE_USER}:${BRIDGE_USER}" "${BRIDGE_HOME}"
41
41
 
42
42
  # ── 4. Install bridge globally ────────────────────────────────────────────────
43
- info "Installing claude-ide-bridge from npm..."
44
- npm install -g claude-ide-bridge 2>&1 | tail -5
45
- BRIDGE_BIN="$(which claude-ide-bridge)"
43
+ info "Installing patchwork-os from npm..."
44
+ npm install -g patchwork-os@alpha 2>&1 | tail -5
45
+ # `patchwork-os` ships three bin aliases: `patchwork` (preferred),
46
+ # `patchwork-os`, and the legacy `claude-ide-bridge`. Use the canonical
47
+ # `patchwork` name for the systemd unit + nginx config below.
48
+ BRIDGE_BIN="$(which patchwork)"
46
49
  info "Bridge binary: ${BRIDGE_BIN}"
47
50
 
48
51
  # ── 5. Generate fixed token ───────────────────────────────────────────────────
@@ -9,9 +9,16 @@ NGINX_CONF="/etc/nginx/sites-available/patchworkos"
9
9
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
10
  REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
11
11
 
12
- echo "==> Copying landing page to VPS..."
12
+ echo "==> Copying landing page + assets to VPS..."
13
13
  ssh "$VPS" "mkdir -p $LANDING_DIR"
14
- scp "$REPO_ROOT/landing/index.html" "$VPS:$LANDING_DIR/index.html"
14
+ # index.html plus the favicon + manifest browsers probe at apex. Without
15
+ # these the browser console fills with /favicon.svg and /manifest.json
16
+ # 401s on every page load (nginx falls through to the dashboard middleware
17
+ # for paths that don't have an explicit `location`).
18
+ scp "$REPO_ROOT/landing/index.html" "$VPS:$LANDING_DIR/index.html"
19
+ scp "$REPO_ROOT/landing/favicon.ico" "$VPS:$LANDING_DIR/favicon.ico"
20
+ scp "$REPO_ROOT/landing/favicon.svg" "$VPS:$LANDING_DIR/favicon.svg"
21
+ scp "$REPO_ROOT/landing/manifest.json" "$VPS:$LANDING_DIR/manifest.json"
15
22
 
16
23
  echo "==> Updating nginx to serve landing page at root..."
17
24
  ssh "$VPS" bash <<'REMOTE'
@@ -70,6 +77,56 @@ else
70
77
  echo "nginx: landing location already present, skipping"
71
78
  fi
72
79
 
80
+ # Independent idempotency block for the apex asset locations — these were
81
+ # added after the original landing block, so existing installs miss them.
82
+ if ! grep -q "location = /favicon.ico" "$NGINX_CONF"; then
83
+ python3 - "$NGINX_CONF" <<'PYEOF'
84
+ import sys
85
+
86
+ path = sys.argv[1]
87
+ with open(path) as f:
88
+ content = f.read()
89
+
90
+ asset_blocks = """
91
+ # Apex assets — favicon + PWA manifest browsers probe at root
92
+ location = /favicon.ico {
93
+ root /var/www/patchwork-landing;
94
+ try_files /favicon.ico =404;
95
+ access_log off;
96
+ }
97
+ location = /favicon.svg {
98
+ root /var/www/patchwork-landing;
99
+ try_files /favicon.svg =404;
100
+ access_log off;
101
+ }
102
+ location = /manifest.json {
103
+ root /var/www/patchwork-landing;
104
+ try_files /manifest.json =404;
105
+ access_log off;
106
+ }
107
+ """
108
+
109
+ # Insert immediately after the existing `location = /` block
110
+ marker = ' location = / {'
111
+ idx = content.find(marker)
112
+ if idx == -1:
113
+ print("WARN: could not find `location = /` to anchor; appending to end", flush=True)
114
+ idx = content.rfind('\n}')
115
+ new_content = content[:idx] + asset_blocks + content[idx:]
116
+ else:
117
+ # find end of the location = / block
118
+ end = content.find(' }', idx)
119
+ end = content.find('\n', end) + 1 if end != -1 else idx
120
+ new_content = content[:end] + asset_blocks + content[end:]
121
+
122
+ with open(path, 'w') as f:
123
+ f.write(new_content)
124
+ print("nginx: apex asset location blocks inserted")
125
+ PYEOF
126
+ else
127
+ echo "nginx: apex asset locations already present, skipping"
128
+ fi
129
+
73
130
  nginx -t && systemctl reload nginx
74
131
  echo "nginx reloaded"
75
132
  REMOTE
package/dist/bridge.js CHANGED
@@ -16,6 +16,7 @@ import { CommitIssueLinkLog } from "./commitIssueLinkLog.js";
16
16
  import { DecisionTraceLog } from "./decisionTraceLog.js";
17
17
  import { createDriver } from "./drivers/index.js";
18
18
  import { ExtensionClient } from "./extensionClient.js";
19
+ import { lockKillSwitchEnv } from "./featureFlags.js";
19
20
  import { FileLock } from "./fileLock.js";
20
21
  import { buildEnforcementReminder } from "./instructionsUtils.js";
21
22
  import { LockFileManager } from "./lockfile.js";
@@ -683,7 +684,11 @@ export class Bridge {
683
684
  async start() {
684
685
  // 0. Initialize OpenTelemetry (no-op when OTEL_EXPORTER_OTLP_ENDPOINT is unset)
685
686
  initTelemetry();
686
- // 0a. Auto-repair .claude/rules/bridge-tools.md if stale (present but missing the
687
+ // 0a. Snapshot env-derived kill-switch flags. After this, plugins or
688
+ // recipe steps mutating `process.env.PATCHWORK_FLAG_*` cannot disable an
689
+ // active emergency stop. Closes MED-2 from the 2026-04-28 audit.
690
+ lockKillSwitchEnv();
691
+ // 0b. Auto-repair .claude/rules/bridge-tools.md if stale (present but missing the
687
692
  // current version sentinel). Older package versions write stale files that may
688
693
  // lack new tool substitution rules. Repair is silent on success; falls back to
689
694
  // warn-only if the template is missing or the write fails.
@@ -792,6 +797,7 @@ export class Bridge {
792
797
  getOrchestrator: () => this.orchestrator,
793
798
  recipeOrchestrator: this.recipeOrchestrator,
794
799
  recipeRunLog: this.recipeRunLog,
800
+ activityLog: this.activityLog,
795
801
  workdir: this.config.workspace,
796
802
  logger: this.logger,
797
803
  });
@@ -1078,6 +1084,9 @@ export class Bridge {
1078
1084
  automationEnabled: this.config.automationEnabled,
1079
1085
  port: this.port,
1080
1086
  webhookUrl: this.server.approvalWebhookUrl ?? null,
1087
+ pushServiceUrl: this.server.pushServiceUrl ?? null,
1088
+ pushServiceToken: this.server.pushServiceToken ? "***" : null,
1089
+ pushServiceBaseUrl: this.server.pushServiceBaseUrl ?? null,
1081
1090
  },
1082
1091
  };
1083
1092
  };
@@ -1164,6 +1173,31 @@ export class Bridge {
1164
1173
  : null, async () => {
1165
1174
  await this.refreshRecentTracesDigest();
1166
1175
  return this.buildInstructions();
1176
+ },
1177
+ // Tail-end deps so `registerAllTools` registers the same tool set
1178
+ // on Streamable-HTTP sessions as on WebSocket. Without this object,
1179
+ // `ctxSaveTrace`, `ctxQueryTraces`, and any tool gated on the
1180
+ // remaining deps silently failed to register over Streamable HTTP
1181
+ // (caught dogfooding `ctx-loop-test` from a remote MCP client).
1182
+ {
1183
+ automationHooks: this.automationHooks,
1184
+ getDisconnectInfo: () => ({
1185
+ at: this.lastDisconnectAt,
1186
+ code: this.lastDisconnectCode,
1187
+ reason: this.lastDisconnectReason,
1188
+ }),
1189
+ onContextCacheUpdated: (generatedAt) => {
1190
+ this._lastContextCachedAt = generatedAt;
1191
+ this._emitLiveState();
1192
+ },
1193
+ getExtensionDisconnectCount: () => this.extensionDisconnectCount,
1194
+ ...(this.commitIssueLinkLog && {
1195
+ commitIssueLinkLog: this.commitIssueLinkLog,
1196
+ }),
1197
+ ...(this.recipeRunLog && { recipeRunLog: this.recipeRunLog }),
1198
+ ...(this.decisionTraceLog && {
1199
+ decisionTraceLog: this.decisionTraceLog,
1200
+ }),
1167
1201
  });
1168
1202
  this.server.httpMcpHandler = (req, res) => this.httpMcpHandler?.handle(req, res) ?? Promise.resolve();
1169
1203
  // 3. Check for stale lock files