patchwork-os 0.2.0-alpha.8 → 0.2.0-beta.0

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 (581) hide show
  1. package/README.bridge.md +6 -0
  2. package/README.md +315 -35
  3. package/deploy/bootstrap-new-vps.sh +12 -12
  4. package/deploy/bootstrap-vps.sh +187 -0
  5. package/deploy/deploy-dashboard.sh +174 -0
  6. package/deploy/deploy-landing.sh +136 -0
  7. package/dist/activationMetrics.d.ts +67 -0
  8. package/dist/activationMetrics.js +255 -0
  9. package/dist/activationMetrics.js.map +1 -0
  10. package/dist/activityLog.d.ts +49 -0
  11. package/dist/activityLog.js +78 -0
  12. package/dist/activityLog.js.map +1 -1
  13. package/dist/approvalHttp.d.ts +49 -2
  14. package/dist/approvalHttp.js +217 -21
  15. package/dist/approvalHttp.js.map +1 -1
  16. package/dist/approvalInsights.d.ts +49 -0
  17. package/dist/approvalInsights.js +97 -0
  18. package/dist/approvalInsights.js.map +1 -0
  19. package/dist/approvalQueue.d.ts +27 -1
  20. package/dist/approvalQueue.js +123 -3
  21. package/dist/approvalQueue.js.map +1 -1
  22. package/dist/approvalSignals.d.ts +124 -0
  23. package/dist/approvalSignals.js +512 -0
  24. package/dist/approvalSignals.js.map +1 -0
  25. package/dist/automation.d.ts +57 -0
  26. package/dist/automation.js +156 -59
  27. package/dist/automation.js.map +1 -1
  28. package/dist/automationSuggestions.d.ts +79 -0
  29. package/dist/automationSuggestions.js +150 -0
  30. package/dist/automationSuggestions.js.map +1 -0
  31. package/dist/bridge.d.ts +3 -0
  32. package/dist/bridge.js +174 -143
  33. package/dist/bridge.js.map +1 -1
  34. package/dist/bridgeToken.js +57 -19
  35. package/dist/bridgeToken.js.map +1 -1
  36. package/dist/ccPermissions.d.ts +15 -0
  37. package/dist/ccPermissions.js +21 -4
  38. package/dist/ccPermissions.js.map +1 -1
  39. package/dist/claudeDriver.js +74 -16
  40. package/dist/claudeDriver.js.map +1 -1
  41. package/dist/claudeOrchestrator.d.ts +1 -1
  42. package/dist/claudeOrchestrator.js +14 -8
  43. package/dist/claudeOrchestrator.js.map +1 -1
  44. package/dist/commands/dashboard.js +1 -1
  45. package/dist/commands/dashboard.js.map +1 -1
  46. package/dist/commands/launchd.d.ts +2 -0
  47. package/dist/commands/launchd.js +94 -0
  48. package/dist/commands/launchd.js.map +1 -0
  49. package/dist/commands/patchworkInit.d.ts +8 -0
  50. package/dist/commands/patchworkInit.js +77 -11
  51. package/dist/commands/patchworkInit.js.map +1 -1
  52. package/dist/commands/recipe.d.ts +289 -0
  53. package/dist/commands/recipe.js +1359 -0
  54. package/dist/commands/recipe.js.map +1 -0
  55. package/dist/commands/recipeInstall.d.ts +150 -0
  56. package/dist/commands/recipeInstall.js +647 -0
  57. package/dist/commands/recipeInstall.js.map +1 -0
  58. package/dist/commands/tracesExport.d.ts +83 -0
  59. package/dist/commands/tracesExport.js +269 -0
  60. package/dist/commands/tracesExport.js.map +1 -0
  61. package/dist/commands/tracesImport.d.ts +56 -0
  62. package/dist/commands/tracesImport.js +161 -0
  63. package/dist/commands/tracesImport.js.map +1 -0
  64. package/dist/config.d.ts +22 -1
  65. package/dist/config.js +108 -9
  66. package/dist/config.js.map +1 -1
  67. package/dist/connectorRoutes.d.ts +43 -0
  68. package/dist/connectorRoutes.js +1609 -0
  69. package/dist/connectorRoutes.js.map +1 -0
  70. package/dist/connectors/asana.d.ts +198 -0
  71. package/dist/connectors/asana.js +679 -0
  72. package/dist/connectors/asana.js.map +1 -0
  73. package/dist/connectors/baseConnector.d.ts +153 -0
  74. package/dist/connectors/baseConnector.js +336 -0
  75. package/dist/connectors/baseConnector.js.map +1 -0
  76. package/dist/connectors/confluence.d.ts +111 -0
  77. package/dist/connectors/confluence.js +406 -0
  78. package/dist/connectors/confluence.js.map +1 -0
  79. package/dist/connectors/datadog.d.ts +116 -0
  80. package/dist/connectors/datadog.js +385 -0
  81. package/dist/connectors/datadog.js.map +1 -0
  82. package/dist/connectors/discord.d.ts +150 -0
  83. package/dist/connectors/discord.js +543 -0
  84. package/dist/connectors/discord.js.map +1 -0
  85. package/dist/connectors/fixtureLibrary.d.ts +21 -0
  86. package/dist/connectors/fixtureLibrary.js +70 -0
  87. package/dist/connectors/fixtureLibrary.js.map +1 -0
  88. package/dist/connectors/fixtureRecorder.d.ts +1 -0
  89. package/dist/connectors/fixtureRecorder.js +35 -0
  90. package/dist/connectors/fixtureRecorder.js.map +1 -0
  91. package/dist/connectors/github.js +17 -18
  92. package/dist/connectors/github.js.map +1 -1
  93. package/dist/connectors/gitlab.d.ts +180 -0
  94. package/dist/connectors/gitlab.js +582 -0
  95. package/dist/connectors/gitlab.js.map +1 -0
  96. package/dist/connectors/gmail.d.ts +4 -1
  97. package/dist/connectors/gmail.js +157 -27
  98. package/dist/connectors/gmail.js.map +1 -1
  99. package/dist/connectors/googleCalendar.d.ts +4 -1
  100. package/dist/connectors/googleCalendar.js +88 -25
  101. package/dist/connectors/googleCalendar.js.map +1 -1
  102. package/dist/connectors/googleDrive.d.ts +34 -0
  103. package/dist/connectors/googleDrive.js +321 -0
  104. package/dist/connectors/googleDrive.js.map +1 -0
  105. package/dist/connectors/htmlEscape.d.ts +5 -0
  106. package/dist/connectors/htmlEscape.js +13 -0
  107. package/dist/connectors/htmlEscape.js.map +1 -0
  108. package/dist/connectors/hubspot.d.ts +112 -0
  109. package/dist/connectors/hubspot.js +408 -0
  110. package/dist/connectors/hubspot.js.map +1 -0
  111. package/dist/connectors/intercom.d.ts +102 -0
  112. package/dist/connectors/intercom.js +402 -0
  113. package/dist/connectors/intercom.js.map +1 -0
  114. package/dist/connectors/jira.d.ts +98 -0
  115. package/dist/connectors/jira.js +379 -0
  116. package/dist/connectors/jira.js.map +1 -0
  117. package/dist/connectors/linear.js +30 -19
  118. package/dist/connectors/linear.js.map +1 -1
  119. package/dist/connectors/mcpOAuth.d.ts +3 -0
  120. package/dist/connectors/mcpOAuth.js +64 -10
  121. package/dist/connectors/mcpOAuth.js.map +1 -1
  122. package/dist/connectors/mockConnector.d.ts +28 -0
  123. package/dist/connectors/mockConnector.js +81 -0
  124. package/dist/connectors/mockConnector.js.map +1 -0
  125. package/dist/connectors/notion.d.ts +143 -0
  126. package/dist/connectors/notion.js +424 -0
  127. package/dist/connectors/notion.js.map +1 -0
  128. package/dist/connectors/oauthStateStore.d.ts +31 -0
  129. package/dist/connectors/oauthStateStore.js +52 -0
  130. package/dist/connectors/oauthStateStore.js.map +1 -0
  131. package/dist/connectors/pagerduty.d.ts +160 -0
  132. package/dist/connectors/pagerduty.js +464 -0
  133. package/dist/connectors/pagerduty.js.map +1 -0
  134. package/dist/connectors/sentry.js +5 -13
  135. package/dist/connectors/sentry.js.map +1 -1
  136. package/dist/connectors/slack.d.ts +16 -1
  137. package/dist/connectors/slack.js +155 -32
  138. package/dist/connectors/slack.js.map +1 -1
  139. package/dist/connectors/stripe.d.ts +116 -0
  140. package/dist/connectors/stripe.js +379 -0
  141. package/dist/connectors/stripe.js.map +1 -0
  142. package/dist/connectors/tokenStorage.d.ts +35 -0
  143. package/dist/connectors/tokenStorage.js +484 -0
  144. package/dist/connectors/tokenStorage.js.map +1 -0
  145. package/dist/connectors/zendesk.d.ts +104 -0
  146. package/dist/connectors/zendesk.js +442 -0
  147. package/dist/connectors/zendesk.js.map +1 -0
  148. package/dist/cors.d.ts +10 -0
  149. package/dist/cors.js +29 -0
  150. package/dist/cors.js.map +1 -0
  151. package/dist/decisionReplay.d.ts +72 -0
  152. package/dist/decisionReplay.js +92 -0
  153. package/dist/decisionReplay.js.map +1 -0
  154. package/dist/decisionTraceLog.d.ts +6 -0
  155. package/dist/decisionTraceLog.js +54 -2
  156. package/dist/decisionTraceLog.js.map +1 -1
  157. package/dist/drivers/gemini/index.d.ts +5 -1
  158. package/dist/drivers/gemini/index.js +39 -5
  159. package/dist/drivers/gemini/index.js.map +1 -1
  160. package/dist/drivers/index.d.ts +5 -0
  161. package/dist/drivers/index.js +1 -1
  162. package/dist/drivers/index.js.map +1 -1
  163. package/dist/featureFlags.d.ts +79 -0
  164. package/dist/featureFlags.js +208 -0
  165. package/dist/featureFlags.js.map +1 -0
  166. package/dist/fp/automationInterpreter.js +26 -21
  167. package/dist/fp/automationInterpreter.js.map +1 -1
  168. package/dist/fp/automationProgram.d.ts +1 -1
  169. package/dist/fp/automationProgram.js.map +1 -1
  170. package/dist/fp/automationState.js +4 -1
  171. package/dist/fp/automationState.js.map +1 -1
  172. package/dist/fp/policyParser.js +21 -1
  173. package/dist/fp/policyParser.js.map +1 -1
  174. package/dist/inboxRoutes.d.ts +22 -0
  175. package/dist/inboxRoutes.js +114 -0
  176. package/dist/inboxRoutes.js.map +1 -0
  177. package/dist/index.js +1400 -201
  178. package/dist/index.js.map +1 -1
  179. package/dist/installGuard.d.ts +25 -0
  180. package/dist/installGuard.js +48 -0
  181. package/dist/installGuard.js.map +1 -0
  182. package/dist/mcpRoutes.d.ts +37 -0
  183. package/dist/mcpRoutes.js +76 -0
  184. package/dist/mcpRoutes.js.map +1 -0
  185. package/dist/oauth.d.ts +7 -1
  186. package/dist/oauth.js +201 -39
  187. package/dist/oauth.js.map +1 -1
  188. package/dist/oauthRoutes.d.ts +32 -0
  189. package/dist/oauthRoutes.js +124 -0
  190. package/dist/oauthRoutes.js.map +1 -0
  191. package/dist/orchestrator/orchestratorBridge.js +2 -2
  192. package/dist/orchestrator/orchestratorBridge.js.map +1 -1
  193. package/dist/patchworkConfig.d.ts +16 -0
  194. package/dist/patchworkConfig.js +1 -1
  195. package/dist/patchworkConfig.js.map +1 -1
  196. package/dist/pluginLoader.d.ts +28 -0
  197. package/dist/pluginLoader.js +77 -11
  198. package/dist/pluginLoader.js.map +1 -1
  199. package/dist/pluginWatcher.js +8 -3
  200. package/dist/pluginWatcher.js.map +1 -1
  201. package/dist/preToolUseHook.d.ts +12 -0
  202. package/dist/preToolUseHook.js +23 -0
  203. package/dist/preToolUseHook.js.map +1 -1
  204. package/dist/recipeOrchestration.d.ts +121 -0
  205. package/dist/recipeOrchestration.js +955 -0
  206. package/dist/recipeOrchestration.js.map +1 -0
  207. package/dist/recipeRoutes.d.ts +180 -0
  208. package/dist/recipeRoutes.js +1345 -0
  209. package/dist/recipeRoutes.js.map +1 -0
  210. package/dist/recipes/RecipeOrchestrator.d.ts +40 -0
  211. package/dist/recipes/RecipeOrchestrator.js +51 -0
  212. package/dist/recipes/RecipeOrchestrator.js.map +1 -0
  213. package/dist/recipes/agentExecutor.d.ts +29 -0
  214. package/dist/recipes/agentExecutor.js +49 -0
  215. package/dist/recipes/agentExecutor.js.map +1 -0
  216. package/dist/recipes/chainedRunner.d.ts +191 -0
  217. package/dist/recipes/chainedRunner.js +759 -0
  218. package/dist/recipes/chainedRunner.js.map +1 -0
  219. package/dist/recipes/compiler.js +3 -3
  220. package/dist/recipes/compiler.js.map +1 -1
  221. package/dist/recipes/dependencyGraph.d.ts +39 -0
  222. package/dist/recipes/dependencyGraph.js +199 -0
  223. package/dist/recipes/dependencyGraph.js.map +1 -0
  224. package/dist/recipes/disabledMarkers.d.ts +48 -0
  225. package/dist/recipes/disabledMarkers.js +52 -0
  226. package/dist/recipes/disabledMarkers.js.map +1 -0
  227. package/dist/recipes/installer.js +3 -3
  228. package/dist/recipes/installer.js.map +1 -1
  229. package/dist/recipes/legacyRecipeCompat.d.ts +10 -0
  230. package/dist/recipes/legacyRecipeCompat.js +131 -0
  231. package/dist/recipes/legacyRecipeCompat.js.map +1 -0
  232. package/dist/recipes/manifest.d.ts +47 -0
  233. package/dist/recipes/manifest.js +156 -0
  234. package/dist/recipes/manifest.js.map +1 -0
  235. package/dist/recipes/migrationWarnings.d.ts +12 -0
  236. package/dist/recipes/migrationWarnings.js +44 -0
  237. package/dist/recipes/migrationWarnings.js.map +1 -0
  238. package/dist/recipes/migrations/index.d.ts +24 -0
  239. package/dist/recipes/migrations/index.js +55 -0
  240. package/dist/recipes/migrations/index.js.map +1 -0
  241. package/dist/recipes/migrations/types.d.ts +28 -0
  242. package/dist/recipes/migrations/types.js +2 -0
  243. package/dist/recipes/migrations/types.js.map +1 -0
  244. package/dist/recipes/migrations/v1.d.ts +11 -0
  245. package/dist/recipes/migrations/v1.js +18 -0
  246. package/dist/recipes/migrations/v1.js.map +1 -0
  247. package/dist/recipes/names.d.ts +40 -0
  248. package/dist/recipes/names.js +66 -0
  249. package/dist/recipes/names.js.map +1 -0
  250. package/dist/recipes/nestedRecipeStep.d.ts +58 -0
  251. package/dist/recipes/nestedRecipeStep.js +95 -0
  252. package/dist/recipes/nestedRecipeStep.js.map +1 -0
  253. package/dist/recipes/outputRegistry.d.ts +28 -0
  254. package/dist/recipes/outputRegistry.js +52 -0
  255. package/dist/recipes/outputRegistry.js.map +1 -0
  256. package/dist/recipes/parser.js +4 -1
  257. package/dist/recipes/parser.js.map +1 -1
  258. package/dist/recipes/replayRun.d.ts +62 -0
  259. package/dist/recipes/replayRun.js +97 -0
  260. package/dist/recipes/replayRun.js.map +1 -0
  261. package/dist/recipes/resolveRecipePath.d.ts +69 -0
  262. package/dist/recipes/resolveRecipePath.js +202 -0
  263. package/dist/recipes/resolveRecipePath.js.map +1 -0
  264. package/dist/recipes/scheduler.d.ts +23 -7
  265. package/dist/recipes/scheduler.js +225 -45
  266. package/dist/recipes/scheduler.js.map +1 -1
  267. package/dist/recipes/schema.d.ts +17 -2
  268. package/dist/recipes/schemaGenerator.d.ts +28 -0
  269. package/dist/recipes/schemaGenerator.js +565 -0
  270. package/dist/recipes/schemaGenerator.js.map +1 -0
  271. package/dist/recipes/stepObservation.d.ts +44 -0
  272. package/dist/recipes/stepObservation.js +232 -0
  273. package/dist/recipes/stepObservation.js.map +1 -0
  274. package/dist/recipes/templateEngine.d.ts +62 -0
  275. package/dist/recipes/templateEngine.js +201 -0
  276. package/dist/recipes/templateEngine.js.map +1 -0
  277. package/dist/recipes/toolRegistry.d.ts +186 -0
  278. package/dist/recipes/toolRegistry.js +309 -0
  279. package/dist/recipes/toolRegistry.js.map +1 -0
  280. package/dist/recipes/tools/asana.d.ts +16 -0
  281. package/dist/recipes/tools/asana.js +524 -0
  282. package/dist/recipes/tools/asana.js.map +1 -0
  283. package/dist/recipes/tools/calendar.d.ts +6 -0
  284. package/dist/recipes/tools/calendar.js +61 -0
  285. package/dist/recipes/tools/calendar.js.map +1 -0
  286. package/dist/recipes/tools/confluence.d.ts +6 -0
  287. package/dist/recipes/tools/confluence.js +254 -0
  288. package/dist/recipes/tools/confluence.js.map +1 -0
  289. package/dist/recipes/tools/datadog.d.ts +6 -0
  290. package/dist/recipes/tools/datadog.js +239 -0
  291. package/dist/recipes/tools/datadog.js.map +1 -0
  292. package/dist/recipes/tools/diagnostics.d.ts +6 -0
  293. package/dist/recipes/tools/diagnostics.js +36 -0
  294. package/dist/recipes/tools/diagnostics.js.map +1 -0
  295. package/dist/recipes/tools/discord.d.ts +18 -0
  296. package/dist/recipes/tools/discord.js +254 -0
  297. package/dist/recipes/tools/discord.js.map +1 -0
  298. package/dist/recipes/tools/file.d.ts +12 -0
  299. package/dist/recipes/tools/file.js +174 -0
  300. package/dist/recipes/tools/file.js.map +1 -0
  301. package/dist/recipes/tools/git.d.ts +6 -0
  302. package/dist/recipes/tools/git.js +63 -0
  303. package/dist/recipes/tools/git.js.map +1 -0
  304. package/dist/recipes/tools/github.d.ts +6 -0
  305. package/dist/recipes/tools/github.js +116 -0
  306. package/dist/recipes/tools/github.js.map +1 -0
  307. package/dist/recipes/tools/gitlab.d.ts +11 -0
  308. package/dist/recipes/tools/gitlab.js +285 -0
  309. package/dist/recipes/tools/gitlab.js.map +1 -0
  310. package/dist/recipes/tools/gmail.d.ts +6 -0
  311. package/dist/recipes/tools/gmail.js +434 -0
  312. package/dist/recipes/tools/gmail.js.map +1 -0
  313. package/dist/recipes/tools/googleDrive.d.ts +1 -0
  314. package/dist/recipes/tools/googleDrive.js +55 -0
  315. package/dist/recipes/tools/googleDrive.js.map +1 -0
  316. package/dist/recipes/tools/hubspot.d.ts +6 -0
  317. package/dist/recipes/tools/hubspot.js +232 -0
  318. package/dist/recipes/tools/hubspot.js.map +1 -0
  319. package/dist/recipes/tools/index.d.ts +30 -0
  320. package/dist/recipes/tools/index.js +33 -0
  321. package/dist/recipes/tools/index.js.map +1 -0
  322. package/dist/recipes/tools/intercom.d.ts +6 -0
  323. package/dist/recipes/tools/intercom.js +226 -0
  324. package/dist/recipes/tools/intercom.js.map +1 -0
  325. package/dist/recipes/tools/jira.d.ts +14 -0
  326. package/dist/recipes/tools/jira.js +369 -0
  327. package/dist/recipes/tools/jira.js.map +1 -0
  328. package/dist/recipes/tools/linear.d.ts +7 -0
  329. package/dist/recipes/tools/linear.js +307 -0
  330. package/dist/recipes/tools/linear.js.map +1 -0
  331. package/dist/recipes/tools/meetingNotes.d.ts +21 -0
  332. package/dist/recipes/tools/meetingNotes.js +701 -0
  333. package/dist/recipes/tools/meetingNotes.js.map +1 -0
  334. package/dist/recipes/tools/notion.d.ts +6 -0
  335. package/dist/recipes/tools/notion.js +278 -0
  336. package/dist/recipes/tools/notion.js.map +1 -0
  337. package/dist/recipes/tools/pagerduty.d.ts +15 -0
  338. package/dist/recipes/tools/pagerduty.js +451 -0
  339. package/dist/recipes/tools/pagerduty.js.map +1 -0
  340. package/dist/recipes/tools/sentry.d.ts +12 -0
  341. package/dist/recipes/tools/sentry.js +73 -0
  342. package/dist/recipes/tools/sentry.js.map +1 -0
  343. package/dist/recipes/tools/slack.d.ts +6 -0
  344. package/dist/recipes/tools/slack.js +82 -0
  345. package/dist/recipes/tools/slack.js.map +1 -0
  346. package/dist/recipes/tools/stripe.d.ts +6 -0
  347. package/dist/recipes/tools/stripe.js +265 -0
  348. package/dist/recipes/tools/stripe.js.map +1 -0
  349. package/dist/recipes/tools/zendesk.d.ts +6 -0
  350. package/dist/recipes/tools/zendesk.js +245 -0
  351. package/dist/recipes/tools/zendesk.js.map +1 -0
  352. package/dist/recipes/validation.d.ts +13 -0
  353. package/dist/recipes/validation.js +617 -0
  354. package/dist/recipes/validation.js.map +1 -0
  355. package/dist/recipes/yamlRunner.d.ts +116 -1
  356. package/dist/recipes/yamlRunner.js +1000 -401
  357. package/dist/recipes/yamlRunner.js.map +1 -1
  358. package/dist/recipesHttp.d.ts +137 -6
  359. package/dist/recipesHttp.js +941 -29
  360. package/dist/recipesHttp.js.map +1 -1
  361. package/dist/riskTier.js +7 -1
  362. package/dist/riskTier.js.map +1 -1
  363. package/dist/runLog.d.ts +100 -1
  364. package/dist/runLog.js +258 -5
  365. package/dist/runLog.js.map +1 -1
  366. package/dist/schemas/dry-run-plan.v1.json +139 -0
  367. package/dist/schemas/recipe.v1.json +684 -0
  368. package/dist/server.d.ts +121 -8
  369. package/dist/server.js +538 -735
  370. package/dist/server.js.map +1 -1
  371. package/dist/ssrfGuard.d.ts +54 -0
  372. package/dist/ssrfGuard.js +122 -0
  373. package/dist/ssrfGuard.js.map +1 -0
  374. package/dist/streamableHttp.d.ts +39 -1
  375. package/dist/streamableHttp.js +128 -17
  376. package/dist/streamableHttp.js.map +1 -1
  377. package/dist/tokenUsageTracker.d.ts +33 -0
  378. package/dist/tokenUsageTracker.js +146 -0
  379. package/dist/tokenUsageTracker.js.map +1 -0
  380. package/dist/tools/activityLog.d.ts +2 -0
  381. package/dist/tools/addLinearComment.d.ts +1 -0
  382. package/dist/tools/addLinearComment.js +4 -2
  383. package/dist/tools/addLinearComment.js.map +1 -1
  384. package/dist/tools/batchLsp.d.ts +3 -0
  385. package/dist/tools/bridgeDoctor.d.ts +1 -0
  386. package/dist/tools/bridgeDoctor.js +2 -2
  387. package/dist/tools/bridgeDoctor.js.map +1 -1
  388. package/dist/tools/bridgeStatus.d.ts +1 -0
  389. package/dist/tools/cancelClaudeTask.d.ts +2 -0
  390. package/dist/tools/cancelClaudeTask.js +1 -0
  391. package/dist/tools/cancelClaudeTask.js.map +1 -1
  392. package/dist/tools/checkDocumentDirty.d.ts +1 -0
  393. package/dist/tools/clipboard.d.ts +2 -0
  394. package/dist/tools/closeTabs.d.ts +2 -0
  395. package/dist/tools/codeLens.d.ts +1 -0
  396. package/dist/tools/contextBundle.d.ts +1 -0
  397. package/dist/tools/createIssueFromAIComment.d.ts +1 -0
  398. package/dist/tools/createLinearIssue.d.ts +1 -0
  399. package/dist/tools/ctxGetTaskContext.d.ts +1 -0
  400. package/dist/tools/ctxQueryTraces.d.ts +1 -0
  401. package/dist/tools/ctxSaveTrace.d.ts +1 -0
  402. package/dist/tools/debug.d.ts +4 -0
  403. package/dist/tools/decorations.d.ts +2 -0
  404. package/dist/tools/documentLinks.d.ts +1 -0
  405. package/dist/tools/editText.d.ts +1 -0
  406. package/dist/tools/enrichCommit.d.ts +1 -0
  407. package/dist/tools/enrichStackTrace.d.ts +1 -0
  408. package/dist/tools/explainDiagnostic.d.ts +1 -0
  409. package/dist/tools/explainSymbol.d.ts +1 -0
  410. package/dist/tools/fetchCalendarEvents.d.ts +1 -0
  411. package/dist/tools/fetchGithubIssue.d.ts +1 -0
  412. package/dist/tools/fetchGithubPR.d.ts +1 -0
  413. package/dist/tools/fetchLinearIssue.d.ts +1 -0
  414. package/dist/tools/fetchSentryIssue.d.ts +1 -0
  415. package/dist/tools/fetchSlackProfile.d.ts +1 -0
  416. package/dist/tools/fetchSlackProfile.js +4 -1
  417. package/dist/tools/fetchSlackProfile.js.map +1 -1
  418. package/dist/tools/fileOperations.d.ts +3 -0
  419. package/dist/tools/fileWatcher.d.ts +2 -0
  420. package/dist/tools/findFiles.d.ts +1 -0
  421. package/dist/tools/findRelatedTests.d.ts +1 -0
  422. package/dist/tools/fixAllLintErrors.d.ts +1 -0
  423. package/dist/tools/foldingRanges.d.ts +1 -0
  424. package/dist/tools/formatDocument.d.ts +1 -0
  425. package/dist/tools/generateTests.d.ts +1 -0
  426. package/dist/tools/getAIComments.d.ts +1 -0
  427. package/dist/tools/getAnalyticsReport.d.ts +1 -0
  428. package/dist/tools/getArchitectureContext.d.ts +1 -0
  429. package/dist/tools/getBufferContent.d.ts +1 -0
  430. package/dist/tools/getChangeImpact.d.ts +1 -0
  431. package/dist/tools/getClaudeTaskStatus.d.ts +2 -0
  432. package/dist/tools/getClaudeTaskStatus.js +1 -0
  433. package/dist/tools/getClaudeTaskStatus.js.map +1 -1
  434. package/dist/tools/getCodeCoverage.d.ts +1 -0
  435. package/dist/tools/getCommitsForIssue.d.ts +1 -0
  436. package/dist/tools/getConnectorStatus.d.ts +1 -0
  437. package/dist/tools/getCurrentSelection.d.ts +2 -0
  438. package/dist/tools/getDebugState.d.ts +1 -0
  439. package/dist/tools/getDependencyTree.d.ts +1 -0
  440. package/dist/tools/getDiagnostics.d.ts +1 -0
  441. package/dist/tools/getDiffFromHandoff.d.ts +1 -0
  442. package/dist/tools/getDocumentSymbols.d.ts +25 -0
  443. package/dist/tools/getDocumentSymbols.js +74 -8
  444. package/dist/tools/getDocumentSymbols.js.map +1 -1
  445. package/dist/tools/getFileTree.d.ts +1 -0
  446. package/dist/tools/getGitDiff.d.ts +1 -0
  447. package/dist/tools/getGitHotspots.d.ts +1 -0
  448. package/dist/tools/getGitLog.d.ts +1 -0
  449. package/dist/tools/getGitStatus.d.ts +1 -0
  450. package/dist/tools/getImportTree.d.ts +1 -0
  451. package/dist/tools/getImportedSignatures.d.ts +1 -0
  452. package/dist/tools/getOpenEditors.d.ts +1 -0
  453. package/dist/tools/getPRTemplate.d.ts +1 -0
  454. package/dist/tools/getProjectContext.d.ts +1 -0
  455. package/dist/tools/getProjectInfo.d.ts +1 -0
  456. package/dist/tools/getSecurityAdvisories.d.ts +1 -0
  457. package/dist/tools/getSecurityAdvisories.js +10 -1
  458. package/dist/tools/getSecurityAdvisories.js.map +1 -1
  459. package/dist/tools/getSessionUsage.d.ts +4 -0
  460. package/dist/tools/getSessionUsage.js +3 -0
  461. package/dist/tools/getSessionUsage.js.map +1 -1
  462. package/dist/tools/getSymbolHistory.d.ts +1 -0
  463. package/dist/tools/getToolCapabilities.d.ts +1 -0
  464. package/dist/tools/getTypeSignature.d.ts +1 -0
  465. package/dist/tools/getWorkspaceFolders.d.ts +1 -0
  466. package/dist/tools/getWorkspaceSettings.d.ts +1 -0
  467. package/dist/tools/gitHistory.d.ts +2 -0
  468. package/dist/tools/gitWrite.d.ts +11 -0
  469. package/dist/tools/github/actions.d.ts +2 -0
  470. package/dist/tools/github/actions.js +4 -2
  471. package/dist/tools/github/actions.js.map +1 -1
  472. package/dist/tools/github/composite.d.ts +342 -0
  473. package/dist/tools/github/composite.js +343 -0
  474. package/dist/tools/github/composite.js.map +1 -0
  475. package/dist/tools/github/index.d.ts +1 -0
  476. package/dist/tools/github/index.js +1 -0
  477. package/dist/tools/github/index.js.map +1 -1
  478. package/dist/tools/github/issues.d.ts +4 -0
  479. package/dist/tools/github/issues.js +8 -4
  480. package/dist/tools/github/issues.js.map +1 -1
  481. package/dist/tools/github/pr.d.ts +7 -0
  482. package/dist/tools/github/pr.js +50 -12
  483. package/dist/tools/github/pr.js.map +1 -1
  484. package/dist/tools/handoffNote.d.ts +4 -0
  485. package/dist/tools/handoffNote.js +2 -0
  486. package/dist/tools/handoffNote.js.map +1 -1
  487. package/dist/tools/hoverAtCursor.d.ts +1 -0
  488. package/dist/tools/httpClient.d.ts +2 -0
  489. package/dist/tools/index.d.ts +8 -0
  490. package/dist/tools/index.js +47 -8
  491. package/dist/tools/index.js.map +1 -1
  492. package/dist/tools/inlayHints.d.ts +1 -0
  493. package/dist/tools/launchQuickTask.d.ts +2 -0
  494. package/dist/tools/launchQuickTask.js +1 -0
  495. package/dist/tools/launchQuickTask.js.map +1 -1
  496. package/dist/tools/listClaudeTasks.d.ts +2 -0
  497. package/dist/tools/listClaudeTasks.js +1 -0
  498. package/dist/tools/listClaudeTasks.js.map +1 -1
  499. package/dist/tools/listTerminals.d.ts +1 -0
  500. package/dist/tools/lsp.d.ts +14 -0
  501. package/dist/tools/navigateToSymbolByName.d.ts +1 -0
  502. package/dist/tools/openDiff.d.ts +1 -0
  503. package/dist/tools/openFile.d.ts +1 -0
  504. package/dist/tools/openInBrowser.d.ts +1 -0
  505. package/dist/tools/organizeImports.d.ts +1 -0
  506. package/dist/tools/performanceReport.d.ts +1 -0
  507. package/dist/tools/planPersistence.d.ts +5 -0
  508. package/dist/tools/previewEdit.d.ts +1 -0
  509. package/dist/tools/refactorAnalyze.d.ts +1 -0
  510. package/dist/tools/refactorPreview.d.ts +2 -0
  511. package/dist/tools/refactorPreview.js +1 -0
  512. package/dist/tools/refactorPreview.js.map +1 -1
  513. package/dist/tools/replaceBlock.d.ts +1 -0
  514. package/dist/tools/resumeClaudeTask.d.ts +2 -0
  515. package/dist/tools/resumeClaudeTask.js +1 -0
  516. package/dist/tools/resumeClaudeTask.js.map +1 -1
  517. package/dist/tools/runClaudeTask.d.ts +2 -0
  518. package/dist/tools/runClaudeTask.js +1 -0
  519. package/dist/tools/runClaudeTask.js.map +1 -1
  520. package/dist/tools/runCommand.d.ts +1 -0
  521. package/dist/tools/runTests.d.ts +1 -0
  522. package/dist/tools/saveDocument.d.ts +1 -0
  523. package/dist/tools/screenshotAndAnnotate.d.ts +1 -0
  524. package/dist/tools/searchAndReplace.d.ts +1 -0
  525. package/dist/tools/searchTools.d.ts +1 -0
  526. package/dist/tools/searchTools.js +1 -1
  527. package/dist/tools/searchTools.js.map +1 -1
  528. package/dist/tools/searchWorkspace.d.ts +1 -0
  529. package/dist/tools/selectionRanges.d.ts +1 -0
  530. package/dist/tools/semanticTokens.d.ts +1 -0
  531. package/dist/tools/setActiveWorkspaceFolder.d.ts +1 -0
  532. package/dist/tools/signatureHelp.d.ts +1 -0
  533. package/dist/tools/slackListChannels.d.ts +1 -0
  534. package/dist/tools/slackListChannels.js.map +1 -1
  535. package/dist/tools/slackPostMessage.d.ts +1 -0
  536. package/dist/tools/slackPostMessage.js +11 -6
  537. package/dist/tools/slackPostMessage.js.map +1 -1
  538. package/dist/tools/terminal.d.ts +6 -0
  539. package/dist/tools/testTraceToSource.d.ts +1 -0
  540. package/dist/tools/testTraceToSource.js +2 -2
  541. package/dist/tools/testTraceToSource.js.map +1 -1
  542. package/dist/tools/transaction.d.ts +23 -0
  543. package/dist/tools/transaction.js +29 -0
  544. package/dist/tools/transaction.js.map +1 -1
  545. package/dist/tools/typeHierarchy.d.ts +1 -0
  546. package/dist/tools/updateLinearIssue.d.ts +1 -0
  547. package/dist/tools/updateLinearIssue.js +20 -6
  548. package/dist/tools/updateLinearIssue.js.map +1 -1
  549. package/dist/tools/utils.d.ts +2 -0
  550. package/dist/tools/utils.js.map +1 -1
  551. package/dist/tools/vscodeCommands.d.ts +2 -0
  552. package/dist/tools/vscodeTasks.d.ts +2 -0
  553. package/dist/tools/workspaceSettings.d.ts +1 -0
  554. package/dist/traceEncryption.d.ts +46 -0
  555. package/dist/traceEncryption.js +124 -0
  556. package/dist/traceEncryption.js.map +1 -0
  557. package/dist/transport.d.ts +46 -1
  558. package/dist/transport.js +173 -19
  559. package/dist/transport.js.map +1 -1
  560. package/package.json +30 -8
  561. package/scripts/mcp-stdio-shim.cjs +19 -3
  562. package/scripts/start-all.sh +30 -1
  563. package/templates/automation-policies/recipe-authoring.json +25 -0
  564. package/templates/automation-policy.example.json +6 -0
  565. package/templates/co.patchwork-os.bridge.plist +34 -0
  566. package/templates/policies/README.md +72 -0
  567. package/templates/policies/conservative.json +14 -0
  568. package/templates/policies/developer.json +14 -0
  569. package/templates/policies/headless-ci.json +24 -0
  570. package/templates/policies/personal-assistant.json +15 -0
  571. package/templates/policies/regulated-industry.json +18 -0
  572. package/templates/recipes/lint-on-save.yaml +1 -2
  573. package/templates/recipes/morning-brief-slack.yaml +57 -0
  574. package/templates/recipes/morning-brief.yaml +2 -2
  575. package/templates/recipes/project-health-check.yaml +50 -0
  576. package/templates/recipes/webhook/README.md +70 -0
  577. package/templates/recipes/webhook/capture-thought.yaml +26 -0
  578. package/templates/recipes/webhook/customer-escalation.yaml +49 -0
  579. package/templates/recipes/webhook/incident-intake.yaml +46 -0
  580. package/templates/recipes/webhook/meeting-prep.yaml +48 -0
  581. package/templates/recipes/webhook/morning-brief.yaml +57 -0
package/README.bridge.md CHANGED
@@ -40,6 +40,12 @@ claude --ide
40
40
 
41
41
  > **Updating?** Use `npm install -g claude-ide-bridge@latest` — `npm update -g` may lag the registry cache after a new release.
42
42
 
43
+ > **macOS LaunchAgent users:** always install from the registry (`npm install -g patchwork-os`) or
44
+ > from a tarball (`npm pack && npm install -g patchwork-os-*.tgz`).
45
+ > Running `npm install -g .` from a repo checkout creates a symlink — the macOS sandbox
46
+ > cannot follow it, causing EPERM when launchctl starts the bridge.
47
+ > `patchwork-os launchd install` will refuse to proceed and print fix instructions.
48
+
43
49
  After `init`, type `/mcp` in Claude Code to confirm the bridge is connected. Type `/ide` to see open files, diagnostics, and editor state.
44
50
 
45
51
  > **One bridge per workspace.** Each project runs its own bridge instance on its own port. Start a separate `claude-ide-bridge --watch` in each directory.
package/README.md CHANGED
@@ -1,67 +1,347 @@
1
1
  # Patchwork OS
2
2
 
3
- **AI that works while you're away. Runs on your machine. Doesn't lock you in.**
3
+ ### Your personal AI runtime, local-first.
4
+
5
+ > 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.
6
+
7
+ You decide which model. You decide which actions need a human nod. You own the credentials, the logs, and the deployment. Nothing phones home.
8
+
9
+ **Five primitives, one runtime:**
10
+
11
+ - **Tools** — 170+ 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).
12
+ - **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.
13
+ - **Delegation Policy** — three risk tiers, four-source precedence (managed → project-local → project → user). Auto-approve safe, require approval for risky, block dangerous.
14
+ - **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).
15
+ - **OAuth** — turn your runtime into a private personal API. PKCE S256, dynamic client registration, deployable on a VPS in minutes.
16
+
17
+ > **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.
18
+ >
19
+ > **What does this look like in one diagram?** See the [architecture overview](documents/architecture.md).
20
+
21
+ ---
22
+
23
+ The same codebase ships **two ways to use it.** Pick the layer you need.
24
+
25
+ | | What you get | Install | Best for |
26
+ |---|---|---|---|
27
+ | **🔌 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 |
28
+ | **🤖 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 |
29
+
30
+ Same codebase. Bridge is the foundation; Patchwork OS is the optional layer on top. **No vendor lock-in. Runs on your machine.**
31
+
32
+ ---
33
+
34
+ ## 🔌 Claude IDE Bridge — Quick Start
4
35
 
5
36
  ```bash
6
- npx patchwork-os@alpha patchwork-init
37
+ # 1. Install the npm package
38
+ npm install -g patchwork-os
39
+
40
+ # 2. Install the VS Code / Cursor / Windsurf extension
41
+ # Search "Claude IDE Bridge" on OpenVSX, or:
42
+ claude-ide-bridge install-extension
43
+
44
+ # 3. Start the bridge for your workspace
45
+ claude-ide-bridge --workspace .
46
+
47
+ # 4. Connect Claude Code (in another terminal)
48
+ CLAUDE_CODE_IDE_SKIP_VALID_CHECK=true claude --ide
7
49
  ```
8
50
 
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.
51
+ 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.
52
+
53
+ **What the bridge gives Claude:**
54
+
55
+ - Diagnostics, LSP navigation (goto / references / call hierarchy), refactoring with risk analysis
56
+ - Terminal — run commands, read output, wait for async work
57
+ - Git — status, diff, commit, push, blame, checkout, branch list
58
+ - GitHub — open PRs, list issues, post reviews, fetch run logs
59
+ - Debugger — set breakpoints, evaluate expressions, inspect runtime state
60
+ - Files — read, edit by line range, search and replace, capture screenshots
61
+ - Code quality — `auditDependencies`, `detectUnusedCode`, `getCodeCoverage`, `getGitHotspots`
62
+
63
+ The bridge runs without any flags. No recipes, no automation, no dashboard — just the IDE-Claude connection.
64
+
65
+ **Compatible IDEs:** VS Code, Cursor, Windsurf, Google Antigravity. JetBrains IDEs via [companion plugin](#jetbrains-plugin).
66
+
67
+ **Transport layers:**
10
68
 
11
- ## What it does
69
+ | Client | Protocol |
70
+ |---|---|
71
+ | Claude Code CLI | WebSocket `ws://127.0.0.1:<port>` |
72
+ | Claude Desktop | stdio shim → WebSocket |
73
+ | Remote (claude.ai, Codex CLI) | Streamable HTTP + Bearer token |
12
74
 
13
- Patchwork OS watches for things that matter, acts, and asks before anything risky goes out.
75
+ **Tool modes:**
14
76
 
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.
77
+ | Mode | Tools | When to use |
78
+ |---|---|---|
79
+ | Full _(default)_ | ~170 | All git, GitHub, terminal, file ops, orchestration |
80
+ | Slim (`--slim`) | ~60 | LSP + debugger + editor state only |
18
81
 
19
- ## How it works
82
+ Bridge-only docs: [documents/platform-docs.md](documents/platform-docs.md)
20
83
 
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.
84
+ ---
24
85
 
25
- ## After init
86
+ ## 🤖 Patchwork OS — Quick Start
26
87
 
27
88
  ```bash
28
- patchwork-os recipe list # see installed recipes
29
- patchwork-os recipe run daily-status # run one now
30
- patchwork-os # open terminal dashboard
89
+ npx patchwork-os@beta patchwork-init
31
90
  ```
32
91
 
33
- The oversight web UI runs at `http://localhost:3100` when the bridge is active.
92
+ Sets up 5 local recipes, detects Ollama, and opens a terminal dashboard — under 90 seconds.
34
93
 
35
- ## 5 starter recipes (no API key needed)
94
+ ### ☀️ Morning Brief the hero workflow
36
95
 
37
- | Recipe | Trigger | What it does |
38
- |---|---|---|
39
- | `ambient-journal` | git commit | appends one line to `~/.patchwork/journal/` |
40
- | `daily-status` | cron 08:00 | morning brief from yesterday's commits |
41
- | `watch-failing-tests` | test run | drops triage note to inbox on failure |
42
- | `lint-on-save` | file save | surfaces new TS/JS diagnostics to inbox |
43
- | `stale-branches` | cron weekly | lists branches older than 30 days |
96
+ Get an AI digest of your Gmail, calendar, and tasks every morning — or on demand:
97
+
98
+ ```bash
99
+ # First-time setup (connect Gmail + Google Calendar)
100
+ patchwork-os patchwork-init
101
+ patchwork-os connections connect gmail
102
+ patchwork-os connections connect google-calendar
103
+
104
+ # Run it now
105
+ patchwork-os recipe run morning-brief
106
+ ```
107
+
108
+ 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.
109
+
110
+ No connectors yet? Run with `--local` using Ollama — it summarises your clipboard and last-touched files instead.
111
+
112
+ ---
113
+
114
+ ### What it adds on top of the bridge
115
+
116
+ 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.
117
+
118
+ Think of it as a background agent that acts on your behalf — but asks before sending, writing, or modifying anything consequential.
119
+
120
+ - Test suite fails on CI → triage note in your inbox before you wake up
121
+ - Customer email arrives → draft reply in your voice, pending your approval
122
+ - Field-trip permission form flagged → reply drafted to the teacher, waiting for your nod
123
+
124
+ **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.
125
+
126
+ **Models** are yours. Claude, GPT, Gemini, Grok, or local Ollama. Swap at any time. Nothing phones home.
127
+
128
+ **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 analytics.
129
+
130
+ ### Patchwork commands
131
+
132
+ ```bash
133
+ # One-command setup: extension + CLAUDE.md + starter recipes
134
+ patchwork patchwork-init
135
+
136
+ # Explore
137
+ patchwork recipe list # installed recipes
138
+ patchwork recipe run daily-status # run one now
139
+ patchwork recipe run morning-brief --local # run with local Ollama
140
+ patchwork tools list # browse 170+ tools
141
+ patchwork # open terminal dashboard
142
+
143
+ # Web UI — bridge + extension watcher in tmux
144
+ patchwork start-all # then http://localhost:3200
145
+ ```
146
+
147
+ ### Starter recipes
148
+
149
+ The package ships these in `templates/recipes/`. Recipes that need API keys are noted; the rest are zero-config.
150
+
151
+ | Recipe | Trigger | What it does | Needs |
152
+ |---|---|---|---|
153
+ | `ambient-journal` | git commit | Appends one line to `~/.patchwork/journal/` | — |
154
+ | `daily-status` | cron 08:00 | Morning brief from yesterday's commits | — |
155
+ | `lint-on-save` | file save | Surfaces new TS/JS diagnostics to inbox | — |
156
+ | `stale-branches` | cron weekly | Lists branches older than 30 days | — |
157
+ | `watch-failing-tests` | test run | Drops triage note to inbox on failure | — |
158
+ | `project-health-check` | manual | Snapshot of repo health + flagged risks | — |
159
+ | `ctx-loop-test` | manual | Smoke test for context-platform end-to-end | — |
160
+ | `morning-brief` | cron 08:00 | Gmail + Linear + Slack + Calendar digest | Gmail, Linear, Slack, Google Calendar |
161
+ | `morning-brief-slack` | cron 08:00 | Same brief but only posts to Slack | Linear, Slack |
162
+ | `gmail-health-check` | manual | Verify Gmail connector + token state | Gmail |
163
+ | `inbox-triage` | manual | Triage Gmail unread → suggest archive/reply | Gmail |
164
+ | `sentry-to-linear` | manual | Sentry issue → Linear ticket (one-shot) | Sentry, Linear |
165
+
166
+ **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.
167
+
168
+ **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.
169
+
170
+ **Webhook recipe starters** ([`templates/recipes/webhook/`](templates/recipes/webhook/)): five webhook-triggered recipes — capture-thought, morning-brief (on-demand), meeting-prep, incident-intake, customer-escalation. Anything that can POST HTTP can drive these — iPhone Shortcut, Stream Deck, Home Assistant, NFC tag, monitoring tool.
171
+
172
+ ### Automation hooks
44
173
 
45
- All 5 write to `~/.patchwork/inbox/` only. Nothing is sent anywhere without your approval.
174
+ Event-driven hooks trigger Claude tasks automatically. Activate with `--automation --automation-policy <path.json> --claude-driver subprocess`.
46
175
 
47
- ## Roadmap
176
+ Key hooks:
48
177
 
49
- | Phase | Status |
178
+ | Hook | Fires when |
50
179
  |---|---|
51
- | Foundation init, recipes, terminal dashboard | **shipped (W1)** |
52
- | Connectors Gmail, calendar, Slack | W2 |
53
- | Mobile oversight approve from phone | W3 |
54
- | Community recipes + ecosystem | Q3 |
180
+ | `onFileSave` | Matching files saved |
181
+ | `onDiagnosticsStateChange` | Errors appear or clear |
182
+ | `onRecipeSave` | Any `.yaml`/`.yml` saved runs preflight |
183
+ | `onGitCommit` / `onGitPush` / `onGitPull` | Git tools succeed |
184
+ | `onTestRun` | Test run completes (filter: any/failure/pass-after-fail) |
185
+ | `onBranchCheckout` | After branch switch |
186
+ | `onPullRequest` | After `githubCreatePR` succeeds |
187
+ | `onCompaction` | Before/after Claude context compaction |
188
+ | `onTaskCreated` / `onTaskSuccess` | Orchestrator task lifecycle |
55
189
 
56
- ## From source
190
+ 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)
191
+
192
+ ---
193
+
194
+ ## Architecture
195
+
196
+ ```
197
+ patchwork-os (npm package)
198
+
199
+ ├── claude-ide-bridge ← run alone for bridge-only mode
200
+ │ ├── MCP server 170+ tools over WebSocket / HTTP / stdio
201
+ │ ├── VS Code extension LSP, debugger, editor state, live diagnostics
202
+ │ ├── Git / GitHub gitCommit, gitPush, githubCreatePR, …
203
+ │ ├── Terminal runInTerminal, getTerminalOutput, …
204
+ │ └── Code quality auditDependencies, detectUnusedCode, getCodeCoverage
205
+
206
+ └── patchwork ← run for full Patchwork OS layer
207
+ ├── Recipe runner YAML triggers → LLM prompt → action
208
+ ├── Connectors Linear, Sentry, Slack, Google Calendar, +
209
+ ├── Orchestrator Claude subprocess tasks, automation hooks
210
+ ├── Oversight inbox ~/.patchwork/inbox/ — approval queue
211
+ └── Web dashboard http://localhost:3200 — approvals, sessions, analytics
212
+ ```
213
+
214
+ The npm package ships **three CLI binaries** that share the same code:
215
+
216
+ | Binary | Default behavior |
217
+ |---|---|
218
+ | `claude-ide-bridge` | Bridge only — no automation, no recipe runner, no dashboard |
219
+ | `patchwork` | Full Patchwork OS — automation + recipes + dashboard |
220
+ | `patchwork-os` | Alias for `patchwork` |
221
+
222
+ Use whichever fits your mental model.
223
+
224
+ ---
225
+
226
+ ## Tool surface (v0.2.0-beta.0)
227
+
228
+ 170+ MCP tools across 15 categories. Highlights:
229
+
230
+ | Category | Tools |
231
+ |---|---|
232
+ | LSP / Code Intelligence | `getDiagnostics`, `goToDefinition`, `findReferences`, `getCallHierarchy`, `renameSymbol`, `refactorAnalyze`, `explainSymbol`, … (37 tools) |
233
+ | Git | `getGitStatus`, `getGitDiff`, `gitCommit`, `gitPush`, `gitCheckout`, `gitBlame`, … (16 tools) |
234
+ | GitHub | `githubCreatePR`, `githubListPRs`, `githubCreateIssue`, `githubPostPRReview`, … (13 tools) |
235
+ | Terminal | `runInTerminal`, `createTerminal`, `getTerminalOutput`, `waitForTerminalOutput` |
236
+ | File Operations | `editText`, `searchAndReplace`, `searchWorkspace`, `findFiles`, `getFileTree`, … |
237
+ | Debugger | `setDebugBreakpoints`, `startDebugging`, `evaluateInDebugger` |
238
+ | Orchestrator | `runClaudeTask`, `listClaudeTasks`, `getClaudeTaskStatus` |
239
+ | Context Platform | `ctxGetTaskContext`, `ctxQueryTraces`, `ctxSaveTrace`, `enrichStackTrace` |
240
+
241
+ Full reference: [documents/platform-docs.md](documents/platform-docs.md)
242
+
243
+ ---
244
+
245
+ ## Plugin system
246
+
247
+ Extend the tool surface without forking the bridge.
248
+
249
+ ```bash
250
+ # Scaffold a new plugin
251
+ patchwork gen-plugin-stub ./my-plugin --name "org/name" --prefix "myPrefix"
252
+
253
+ # Load at runtime
254
+ claude-ide-bridge --plugin ./my-plugin
255
+ ```
256
+
257
+ 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.
258
+
259
+ Publish to npm with keyword `claude-ide-bridge-plugin` for distribution.
260
+
261
+ Full reference: [documents/plugin-authoring.md](documents/plugin-authoring.md)
262
+
263
+ ---
264
+
265
+ ## JetBrains plugin
266
+
267
+ 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.
268
+
269
+ Use the same bridge from VS Code and JetBrains IDEs simultaneously — IntelliJ IDEA, PyCharm, GoLand, WebStorm, and other IntelliJ-platform editors.
270
+
271
+ Source: [intellij-plugin/](intellij-plugin/)
272
+
273
+ ---
274
+
275
+ ## Remote deployment
276
+
277
+ Run headless on a VPS with full tool support via VS Code Remote-SSH.
278
+
279
+ ```bash
280
+ claude-ide-bridge --bind 0.0.0.0 \
281
+ --issuer-url https://your-domain.com \
282
+ --fixed-token <uuid> \
283
+ --vps
284
+ ```
285
+
286
+ Systemd service and deploy scripts in [`deploy/`](deploy/). Full guide: [docs/remote-access.md](docs/remote-access.md).
287
+
288
+ ---
289
+
290
+ ## What's shipped
291
+
292
+ | Feature | Status |
293
+ |---|---|
294
+ | 170+ MCP tools (LSP, git, tests, debugger, diagnostics) | **shipped** |
295
+ | VS Code / Cursor / Windsurf / Antigravity extension | **shipped** |
296
+ | JetBrains plugin (49 handlers) | **shipped** |
297
+ | `patchwork-init` — one-command setup | **shipped** |
298
+ | Terminal dashboard | **shipped** |
299
+ | Web oversight UI (approvals, sessions, recipes) | **shipped** |
300
+ | Recipe runner (YAML, cron, manual, webhook) | **shipped** |
301
+ | Multi-provider LLM (Claude, Gemini, OpenAI, Grok, Ollama) | **shipped** |
302
+ | Connectors: Linear, Sentry, Slack, Google Calendar, Intercom, HubSpot, Datadog, Stripe | **shipped** |
303
+ | Cross-session memory (traces, handoff notes) | **shipped** |
304
+ | Mobile oversight PWA (push approvals) | **shipped (beta)** |
305
+ | Community recipe marketplace | Q3 2026 |
306
+
307
+ ---
308
+
309
+ ## Install from source
57
310
 
58
311
  ```bash
59
312
  git clone https://github.com/Oolab-labs/patchwork-os
60
313
  cd patchwork-os
61
314
  npm install && npm run build
62
- node dist/index.js patchwork-init
315
+
316
+ # Pack first — do NOT use `npm install -g .`
317
+ # Symlink installs break the macOS LaunchAgent (EPERM at startup)
318
+ npm pack
319
+ npm install -g patchwork-os-*.tgz
320
+ patchwork patchwork-init
63
321
  ```
64
322
 
323
+ ---
324
+
325
+ ## Documentation
326
+
327
+ | Doc | Contents |
328
+ |---|---|
329
+ | [documents/platform-docs.md](documents/platform-docs.md) | Full tool reference (170+ tools), automation hooks, connectors |
330
+ | [documents/prompts-reference.md](documents/prompts-reference.md) | All 72 MCP prompts |
331
+ | [documents/styleguide.md](documents/styleguide.md) | Code conventions, UI patterns |
332
+ | [documents/roadmap.md](documents/roadmap.md) | Development direction |
333
+ | [documents/data-reference.md](documents/data-reference.md) | Data flows, state management, protocol details |
334
+ | [documents/plugin-authoring.md](documents/plugin-authoring.md) | Plugin manifest schema, entrypoint API, distribution |
335
+ | [documents/live-toolsmithing.md](documents/live-toolsmithing.md) | Write tools while the AI is using them — hot-reload narrative + worked example |
336
+ | [documents/triggers.md](documents/triggers.md) | Anything Can Trigger Your AI — iPhone Shortcuts, Stream Deck, Home Assistant, curl, GitHub Actions |
337
+ | [documents/speculative-refactoring.md](documents/speculative-refactoring.md) | Stage multi-file edits, review the diff, commit or discard — honest about commit-phase semantics |
338
+ | [documents/architecture.md](documents/architecture.md) | One-page architecture diagram + how to read it |
339
+ | [documents/comparison.md](documents/comparison.md) | Patchwork vs MCP server / Zapier / hosted assistants / agent frameworks — honest tradeoffs |
340
+ | [docs/adr/](docs/adr/) | Architecture Decision Records |
341
+ | [docs/remote-access.md](docs/remote-access.md) | VPS deployment guide |
342
+
343
+ ---
344
+
65
345
  ## License
66
346
 
67
- MIT © Oolab Labs. Built on the [Claude IDE Bridge](./README.bridge.md).
347
+ 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
@@ -0,0 +1,187 @@
1
+ #!/usr/bin/env bash
2
+ # deploy/bootstrap-vps.sh
3
+ # Full VPS bootstrap for patchworkos.com
4
+ # Run as root on a fresh Ubuntu 24.04 VPS
5
+ # Usage: bash bootstrap-vps.sh
6
+
7
+ set -euo pipefail
8
+
9
+ DOMAIN="patchworkos.com"
10
+ EMAIL="support@gigsecure.co.ke"
11
+ BRIDGE_PORT=3284
12
+ BRIDGE_USER="patchwork"
13
+ BRIDGE_HOME="/opt/patchwork"
14
+ NODE_VERSION="22"
15
+
16
+ # ── Colours ──────────────────────────────────────────────────────────────────
17
+ RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'
18
+ info() { echo -e "${GREEN}[bootstrap]${NC} $*"; }
19
+ warn() { echo -e "${YELLOW}[bootstrap]${NC} $*"; }
20
+ error() { echo -e "${RED}[bootstrap]${NC} $*"; exit 1; }
21
+
22
+ # ── 1. System updates ─────────────────────────────────────────────────────────
23
+ info "Updating system packages..."
24
+ apt-get update -qq
25
+ apt-get upgrade -y -qq
26
+ apt-get install -y -qq curl wget gnupg2 ca-certificates lsb-release \
27
+ nginx certbot python3-certbot-nginx ufw git jq unzip
28
+
29
+ # ── 2. Node.js ────────────────────────────────────────────────────────────────
30
+ info "Installing Node.js ${NODE_VERSION}..."
31
+ curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - >/dev/null
32
+ apt-get install -y -qq nodejs
33
+ node --version
34
+ npm --version
35
+
36
+ # ── 3. Service user ───────────────────────────────────────────────────────────
37
+ info "Creating service user '${BRIDGE_USER}'..."
38
+ id "${BRIDGE_USER}" &>/dev/null || useradd -r -m -d "${BRIDGE_HOME}" -s /bin/bash "${BRIDGE_USER}"
39
+ mkdir -p "${BRIDGE_HOME}"
40
+ chown "${BRIDGE_USER}:${BRIDGE_USER}" "${BRIDGE_HOME}"
41
+
42
+ # ── 4. Install bridge globally ────────────────────────────────────────────────
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)"
49
+ info "Bridge binary: ${BRIDGE_BIN}"
50
+
51
+ # ── 5. Generate fixed token ───────────────────────────────────────────────────
52
+ FIXED_TOKEN="$(uuidgen | tr '[:upper:]' '[:lower:]')"
53
+ info "Generated bridge token (save this!): ${FIXED_TOKEN}"
54
+
55
+ # Persist token to a file readable only by root + patchwork user
56
+ TOKEN_FILE="/etc/patchwork/bridge-token"
57
+ mkdir -p /etc/patchwork
58
+ echo "${FIXED_TOKEN}" > "${TOKEN_FILE}"
59
+ chown root:"${BRIDGE_USER}" "${TOKEN_FILE}"
60
+ chmod 640 "${TOKEN_FILE}"
61
+
62
+ # ── 6. Systemd service ────────────────────────────────────────────────────────
63
+ info "Writing systemd service..."
64
+ cat > /etc/systemd/system/patchwork-bridge.service <<EOF
65
+ [Unit]
66
+ Description=Patchwork OS — Claude IDE Bridge
67
+ After=network-online.target
68
+ Wants=network-online.target
69
+
70
+ [Service]
71
+ Type=simple
72
+ User=${BRIDGE_USER}
73
+ Group=${BRIDGE_USER}
74
+ WorkingDirectory=${BRIDGE_HOME}
75
+ Environment=NODE_ENV=production
76
+ Environment=HOME=${BRIDGE_HOME}
77
+
78
+ ExecStart=${BRIDGE_BIN} \\
79
+ --bind 0.0.0.0 \\
80
+ --port ${BRIDGE_PORT} \\
81
+ --vps \\
82
+ --issuer-url https://${DOMAIN} \\
83
+ --cors-origin https://claude.ai \\
84
+ --cors-origin https://app.patchworkos.com \\
85
+ --fixed-token ${FIXED_TOKEN}
86
+
87
+ Restart=always
88
+ RestartSec=5
89
+ StandardOutput=journal
90
+ StandardError=journal
91
+ SyslogIdentifier=patchwork-bridge
92
+
93
+ # Hardening
94
+ NoNewPrivileges=true
95
+ ProtectSystem=strict
96
+ ProtectHome=read-only
97
+ ReadWritePaths=${BRIDGE_HOME}
98
+ PrivateTmp=true
99
+
100
+ [Install]
101
+ WantedBy=multi-user.target
102
+ EOF
103
+
104
+ systemctl daemon-reload
105
+ systemctl enable patchwork-bridge
106
+
107
+ # ── 7. UFW firewall ───────────────────────────────────────────────────────────
108
+ info "Configuring firewall..."
109
+ ufw --force reset >/dev/null
110
+ ufw default deny incoming >/dev/null
111
+ ufw default allow outgoing >/dev/null
112
+ ufw allow ssh >/dev/null
113
+ ufw allow http >/dev/null
114
+ ufw allow https >/dev/null
115
+ ufw --force enable >/dev/null
116
+ ufw status
117
+
118
+ # ── 8. Nginx config — HTTP only first (certbot needs nginx up to issue cert) ──
119
+ info "Writing nginx config (HTTP only)..."
120
+ cat > /etc/nginx/sites-available/patchworkos <<'NGINX'
121
+ server {
122
+ listen 80;
123
+ listen [::]:80;
124
+ server_name patchworkos.com www.patchworkos.com;
125
+
126
+ location /.well-known/acme-challenge/ { root /var/www/html; }
127
+
128
+ location / {
129
+ proxy_pass http://127.0.0.1:3284;
130
+ proxy_http_version 1.1;
131
+ proxy_set_header Upgrade $http_upgrade;
132
+ proxy_set_header Connection "upgrade";
133
+ proxy_set_header Host $host;
134
+ proxy_set_header X-Real-IP $remote_addr;
135
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
136
+ proxy_set_header X-Forwarded-Proto $scheme;
137
+ proxy_read_timeout 3600s;
138
+ proxy_send_timeout 3600s;
139
+ }
140
+ }
141
+ NGINX
142
+
143
+ ln -sf /etc/nginx/sites-available/patchworkos /etc/nginx/sites-enabled/patchworkos
144
+ rm -f /etc/nginx/sites-enabled/default
145
+
146
+ nginx -t
147
+ systemctl reload nginx
148
+
149
+ # ── 9. TLS certificate ────────────────────────────────────────────────────────
150
+ info "Issuing Let's Encrypt certificate for ${DOMAIN}..."
151
+ certbot --nginx \
152
+ -d "${DOMAIN}" \
153
+ -d "www.${DOMAIN}" \
154
+ --non-interactive \
155
+ --agree-tos \
156
+ --email "${EMAIL}" \
157
+ --redirect
158
+
159
+ # Certbot rewrites the nginx config with SSL — reload to apply
160
+ systemctl reload nginx
161
+
162
+ # ── 10. Start bridge ──────────────────────────────────────────────────────────
163
+ info "Starting bridge service..."
164
+ systemctl start patchwork-bridge
165
+ sleep 3
166
+ systemctl is-active patchwork-bridge && info "Bridge is running." || warn "Bridge may have failed — check: journalctl -u patchwork-bridge -n 50"
167
+
168
+ # ── 11. Print summary ─────────────────────────────────────────────────────────
169
+ echo ""
170
+ echo -e "${GREEN}═══════════════════════════════════════════════════${NC}"
171
+ echo -e "${GREEN} Patchwork OS — VPS bootstrap complete${NC}"
172
+ echo -e "${GREEN}═══════════════════════════════════════════════════${NC}"
173
+ echo ""
174
+ echo " Domain: https://${DOMAIN}"
175
+ echo " Bridge port: ${BRIDGE_PORT} (internal, nginx proxied)"
176
+ echo " Token file: ${TOKEN_FILE}"
177
+ echo " Token: ${FIXED_TOKEN}"
178
+ echo ""
179
+ echo " Service: systemctl status patchwork-bridge"
180
+ echo " Logs: journalctl -u patchwork-bridge -f"
181
+ echo " Nginx logs: tail -f /var/log/nginx/access.log"
182
+ echo ""
183
+ echo -e "${YELLOW} Save the token above — you'll need it to connect Claude Code.${NC}"
184
+ echo ""
185
+ echo " To connect Claude Code remotely:"
186
+ echo " claude mcp add patchwork https://${DOMAIN}/mcp --token ${FIXED_TOKEN}"
187
+ echo ""