patchwork-os 0.2.0-beta.1 → 0.2.0-beta.10.canary.95

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 (652) hide show
  1. package/README.bridge.md +14 -14
  2. package/README.md +201 -34
  3. package/deploy/README.md +1 -1
  4. package/deploy/bootstrap-vps.sh +14 -9
  5. package/deploy/deploy-dashboard.sh +25 -1
  6. package/deploy/macos/README.md +153 -0
  7. package/deploy/macos/com.patchwork.bridge.plist.template +54 -0
  8. package/deploy/macos/com.patchwork.tunnel.plist.template +76 -0
  9. package/deploy/macos/install-mac-bridge.sh +244 -0
  10. package/deploy/macos/uninstall-mac-bridge.sh +22 -0
  11. package/dist/activityLog.d.ts +6 -0
  12. package/dist/activityLog.js +63 -26
  13. package/dist/activityLog.js.map +1 -1
  14. package/dist/adapters/claude.js +22 -16
  15. package/dist/adapters/claude.js.map +1 -1
  16. package/dist/adapters/gemini.js +15 -11
  17. package/dist/adapters/gemini.js.map +1 -1
  18. package/dist/adapters/openai.js +9 -9
  19. package/dist/adapters/openai.js.map +1 -1
  20. package/dist/ajv2020.d.ts +25 -0
  21. package/dist/ajv2020.js +33 -0
  22. package/dist/ajv2020.js.map +1 -0
  23. package/dist/analyticsAggregator.js +1 -1
  24. package/dist/analyticsAggregator.js.map +1 -1
  25. package/dist/analyticsConfig.d.ts +29 -0
  26. package/dist/analyticsConfig.js +102 -0
  27. package/dist/analyticsConfig.js.map +1 -0
  28. package/dist/analyticsPrefs.d.ts +38 -2
  29. package/dist/analyticsPrefs.js +148 -23
  30. package/dist/analyticsPrefs.js.map +1 -1
  31. package/dist/analyticsSend.d.ts +17 -1
  32. package/dist/analyticsSend.js +67 -5
  33. package/dist/analyticsSend.js.map +1 -1
  34. package/dist/approvalHttp.d.ts +14 -0
  35. package/dist/approvalHttp.js +212 -9
  36. package/dist/approvalHttp.js.map +1 -1
  37. package/dist/approvalInsights.js +13 -5
  38. package/dist/approvalInsights.js.map +1 -1
  39. package/dist/approvalQueue.d.ts +97 -3
  40. package/dist/approvalQueue.js +193 -19
  41. package/dist/approvalQueue.js.map +1 -1
  42. package/dist/approvalSignals.js +19 -11
  43. package/dist/approvalSignals.js.map +1 -1
  44. package/dist/automation.d.ts +35 -10
  45. package/dist/automation.js +133 -37
  46. package/dist/automation.js.map +1 -1
  47. package/dist/automationSuggestions.js +10 -8
  48. package/dist/automationSuggestions.js.map +1 -1
  49. package/dist/bridge.d.ts +2 -0
  50. package/dist/bridge.js +202 -25
  51. package/dist/bridge.js.map +1 -1
  52. package/dist/bridgeLockDiscovery.d.ts +27 -1
  53. package/dist/bridgeLockDiscovery.js +38 -11
  54. package/dist/bridgeLockDiscovery.js.map +1 -1
  55. package/dist/bridgeToken.js +3 -2
  56. package/dist/bridgeToken.js.map +1 -1
  57. package/dist/claudeDriver.js +23 -8
  58. package/dist/claudeDriver.js.map +1 -1
  59. package/dist/claudeOrchestrator.d.ts +1 -1
  60. package/dist/claudeOrchestrator.js +87 -44
  61. package/dist/claudeOrchestrator.js.map +1 -1
  62. package/dist/commands/analytics.d.ts +8 -0
  63. package/dist/commands/analytics.js +134 -0
  64. package/dist/commands/analytics.js.map +1 -0
  65. package/dist/commands/auditEnv.d.ts +36 -0
  66. package/dist/commands/auditEnv.js +202 -0
  67. package/dist/commands/auditEnv.js.map +1 -0
  68. package/dist/commands/dashboard.js +8 -1
  69. package/dist/commands/dashboard.js.map +1 -1
  70. package/dist/commands/doctor.d.ts +35 -0
  71. package/dist/commands/doctor.js +51 -0
  72. package/dist/commands/doctor.js.map +1 -0
  73. package/dist/commands/install.js +3 -0
  74. package/dist/commands/install.js.map +1 -1
  75. package/dist/commands/launchd.js +15 -16
  76. package/dist/commands/launchd.js.map +1 -1
  77. package/dist/commands/patchworkInit.d.ts +5 -0
  78. package/dist/commands/patchworkInit.js +89 -7
  79. package/dist/commands/patchworkInit.js.map +1 -1
  80. package/dist/commands/recipe.d.ts +110 -0
  81. package/dist/commands/recipe.js +512 -9
  82. package/dist/commands/recipe.js.map +1 -1
  83. package/dist/commands/recipeInstall.js +11 -4
  84. package/dist/commands/recipeInstall.js.map +1 -1
  85. package/dist/commands/shadowScan.d.ts +34 -0
  86. package/dist/commands/shadowScan.js +142 -0
  87. package/dist/commands/shadowScan.js.map +1 -0
  88. package/dist/commands/task.js +2 -2
  89. package/dist/commands/task.js.map +1 -1
  90. package/dist/commands/tools.d.ts +20 -1
  91. package/dist/commands/tools.js +112 -3
  92. package/dist/commands/tools.js.map +1 -1
  93. package/dist/commands/tracesImport.js +21 -4
  94. package/dist/commands/tracesImport.js.map +1 -1
  95. package/dist/commitIssueLinkLog.d.ts +16 -0
  96. package/dist/commitIssueLinkLog.js +110 -24
  97. package/dist/commitIssueLinkLog.js.map +1 -1
  98. package/dist/companions/registry.js +15 -7
  99. package/dist/companions/registry.js.map +1 -1
  100. package/dist/config.d.ts +47 -3
  101. package/dist/config.js +111 -21
  102. package/dist/config.js.map +1 -1
  103. package/dist/connectorRoutes.js +866 -57
  104. package/dist/connectorRoutes.js.map +1 -1
  105. package/dist/connectors/airtable.d.ts +230 -0
  106. package/dist/connectors/airtable.js +700 -0
  107. package/dist/connectors/airtable.js.map +1 -0
  108. package/dist/connectors/asana.js +13 -9
  109. package/dist/connectors/asana.js.map +1 -1
  110. package/dist/connectors/baseConnector.js +25 -3
  111. package/dist/connectors/baseConnector.js.map +1 -1
  112. package/dist/connectors/caldiy.d.ts +137 -0
  113. package/dist/connectors/caldiy.js +424 -0
  114. package/dist/connectors/caldiy.js.map +1 -0
  115. package/dist/connectors/circleci.d.ts +162 -0
  116. package/dist/connectors/circleci.js +576 -0
  117. package/dist/connectors/circleci.js.map +1 -0
  118. package/dist/connectors/cloudflare.d.ts +132 -0
  119. package/dist/connectors/cloudflare.js +622 -0
  120. package/dist/connectors/cloudflare.js.map +1 -0
  121. package/dist/connectors/confluence.js +35 -0
  122. package/dist/connectors/confluence.js.map +1 -1
  123. package/dist/connectors/connectorRedirectUri.d.ts +30 -0
  124. package/dist/connectors/connectorRedirectUri.js +38 -0
  125. package/dist/connectors/connectorRedirectUri.js.map +1 -0
  126. package/dist/connectors/connectorRegistry.d.ts +63 -0
  127. package/dist/connectors/connectorRegistry.js +354 -0
  128. package/dist/connectors/connectorRegistry.js.map +1 -0
  129. package/dist/connectors/datadog.js +33 -4
  130. package/dist/connectors/datadog.js.map +1 -1
  131. package/dist/connectors/discord.js +14 -10
  132. package/dist/connectors/discord.js.map +1 -1
  133. package/dist/connectors/elasticsearch.d.ts +141 -0
  134. package/dist/connectors/elasticsearch.js +601 -0
  135. package/dist/connectors/elasticsearch.js.map +1 -0
  136. package/dist/connectors/figma.d.ts +130 -0
  137. package/dist/connectors/figma.js +387 -0
  138. package/dist/connectors/figma.js.map +1 -0
  139. package/dist/connectors/github.d.ts +17 -0
  140. package/dist/connectors/github.js +53 -2
  141. package/dist/connectors/github.js.map +1 -1
  142. package/dist/connectors/gitlab.js +12 -6
  143. package/dist/connectors/gitlab.js.map +1 -1
  144. package/dist/connectors/gmail.js +72 -21
  145. package/dist/connectors/gmail.js.map +1 -1
  146. package/dist/connectors/googleCalendar.js +8 -8
  147. package/dist/connectors/googleCalendar.js.map +1 -1
  148. package/dist/connectors/googleDocs.d.ts +103 -0
  149. package/dist/connectors/googleDocs.js +409 -0
  150. package/dist/connectors/googleDocs.js.map +1 -0
  151. package/dist/connectors/googleDrive.d.ts +12 -0
  152. package/dist/connectors/googleDrive.js +35 -8
  153. package/dist/connectors/googleDrive.js.map +1 -1
  154. package/dist/connectors/grafana.d.ts +133 -0
  155. package/dist/connectors/grafana.js +478 -0
  156. package/dist/connectors/grafana.js.map +1 -0
  157. package/dist/connectors/jira.d.ts +25 -0
  158. package/dist/connectors/jira.js +227 -1
  159. package/dist/connectors/jira.js.map +1 -1
  160. package/dist/connectors/linear.js +1 -1
  161. package/dist/connectors/linear.js.map +1 -1
  162. package/dist/connectors/mcpOAuth.js +78 -16
  163. package/dist/connectors/mcpOAuth.js.map +1 -1
  164. package/dist/connectors/monday.d.ts +217 -0
  165. package/dist/connectors/monday.js +655 -0
  166. package/dist/connectors/monday.js.map +1 -0
  167. package/dist/connectors/mongodb.d.ts +139 -0
  168. package/dist/connectors/mongodb.js +455 -0
  169. package/dist/connectors/mongodb.js.map +1 -0
  170. package/dist/connectors/oauthStateStore.d.ts +20 -0
  171. package/dist/connectors/oauthStateStore.js +94 -4
  172. package/dist/connectors/oauthStateStore.js.map +1 -1
  173. package/dist/connectors/obsidian.d.ts +83 -0
  174. package/dist/connectors/obsidian.js +441 -0
  175. package/dist/connectors/obsidian.js.map +1 -0
  176. package/dist/connectors/paystack.d.ts +159 -0
  177. package/dist/connectors/paystack.js +607 -0
  178. package/dist/connectors/paystack.js.map +1 -0
  179. package/dist/connectors/pipedrive.d.ts +189 -0
  180. package/dist/connectors/pipedrive.js +559 -0
  181. package/dist/connectors/pipedrive.js.map +1 -0
  182. package/dist/connectors/postgres.d.ts +127 -0
  183. package/dist/connectors/postgres.js +512 -0
  184. package/dist/connectors/postgres.js.map +1 -0
  185. package/dist/connectors/posthog.d.ts +119 -0
  186. package/dist/connectors/posthog.js +479 -0
  187. package/dist/connectors/posthog.js.map +1 -0
  188. package/dist/connectors/redis.d.ts +140 -0
  189. package/dist/connectors/redis.js +571 -0
  190. package/dist/connectors/redis.js.map +1 -0
  191. package/dist/connectors/resend.d.ts +131 -0
  192. package/dist/connectors/resend.js +529 -0
  193. package/dist/connectors/resend.js.map +1 -0
  194. package/dist/connectors/salesforce.d.ts +136 -0
  195. package/dist/connectors/salesforce.js +603 -0
  196. package/dist/connectors/salesforce.js.map +1 -0
  197. package/dist/connectors/secrets.d.ts +51 -0
  198. package/dist/connectors/secrets.js +102 -0
  199. package/dist/connectors/secrets.js.map +1 -0
  200. package/dist/connectors/sendgrid.d.ts +102 -0
  201. package/dist/connectors/sendgrid.js +423 -0
  202. package/dist/connectors/sendgrid.js.map +1 -0
  203. package/dist/connectors/shopify.d.ts +145 -0
  204. package/dist/connectors/shopify.js +502 -0
  205. package/dist/connectors/shopify.js.map +1 -0
  206. package/dist/connectors/slack.d.ts +1 -1
  207. package/dist/connectors/slack.js +61 -9
  208. package/dist/connectors/slack.js.map +1 -1
  209. package/dist/connectors/snowflake.d.ts +119 -0
  210. package/dist/connectors/snowflake.js +615 -0
  211. package/dist/connectors/snowflake.js.map +1 -0
  212. package/dist/connectors/supabase.d.ts +92 -0
  213. package/dist/connectors/supabase.js +630 -0
  214. package/dist/connectors/supabase.js.map +1 -0
  215. package/dist/connectors/todoist.d.ts +117 -0
  216. package/dist/connectors/todoist.js +485 -0
  217. package/dist/connectors/todoist.js.map +1 -0
  218. package/dist/connectors/tokenStorage.js +56 -14
  219. package/dist/connectors/tokenStorage.js.map +1 -1
  220. package/dist/connectors/twilio.d.ts +118 -0
  221. package/dist/connectors/twilio.js +475 -0
  222. package/dist/connectors/twilio.js.map +1 -0
  223. package/dist/connectors/vercel.d.ts +110 -0
  224. package/dist/connectors/vercel.js +479 -0
  225. package/dist/connectors/vercel.js.map +1 -0
  226. package/dist/connectors/webflow.d.ts +118 -0
  227. package/dist/connectors/webflow.js +393 -0
  228. package/dist/connectors/webflow.js.map +1 -0
  229. package/dist/connectors/woocommerce.d.ts +220 -0
  230. package/dist/connectors/woocommerce.js +464 -0
  231. package/dist/connectors/woocommerce.js.map +1 -0
  232. package/dist/crypto.js +7 -2
  233. package/dist/crypto.js.map +1 -1
  234. package/dist/decisionReplay.js +15 -6
  235. package/dist/decisionReplay.js.map +1 -1
  236. package/dist/decisionTraceLog.d.ts +28 -0
  237. package/dist/decisionTraceLog.js +156 -29
  238. package/dist/decisionTraceLog.js.map +1 -1
  239. package/dist/drivers/claude/api.js +5 -4
  240. package/dist/drivers/claude/api.js.map +1 -1
  241. package/dist/drivers/claude/envSanitizer.d.ts +0 -6
  242. package/dist/drivers/claude/envSanitizer.js +17 -2
  243. package/dist/drivers/claude/envSanitizer.js.map +1 -1
  244. package/dist/drivers/claude/streamParser.js +5 -4
  245. package/dist/drivers/claude/streamParser.js.map +1 -1
  246. package/dist/drivers/claude/subprocess.js +22 -3
  247. package/dist/drivers/claude/subprocess.js.map +1 -1
  248. package/dist/drivers/gemini/index.d.ts +22 -0
  249. package/dist/drivers/gemini/index.js +256 -129
  250. package/dist/drivers/gemini/index.js.map +1 -1
  251. package/dist/drivers/local/index.d.ts +17 -0
  252. package/dist/drivers/local/index.js +99 -0
  253. package/dist/drivers/local/index.js.map +1 -1
  254. package/dist/drivers/openai/index.js +30 -2
  255. package/dist/drivers/openai/index.js.map +1 -1
  256. package/dist/extensionClient.d.ts +37 -4
  257. package/dist/extensionClient.js +58 -16
  258. package/dist/extensionClient.js.map +1 -1
  259. package/dist/featureFlags.d.ts +91 -0
  260. package/dist/featureFlags.js +174 -3
  261. package/dist/featureFlags.js.map +1 -1
  262. package/dist/fileLock.js +21 -12
  263. package/dist/fileLock.js.map +1 -1
  264. package/dist/fileLockSync.d.ts +67 -0
  265. package/dist/fileLockSync.js +126 -0
  266. package/dist/fileLockSync.js.map +1 -0
  267. package/dist/fp/activityAnalytics.js +26 -12
  268. package/dist/fp/activityAnalytics.js.map +1 -1
  269. package/dist/fp/automationInterpreter.d.ts +15 -1
  270. package/dist/fp/automationInterpreter.js +217 -82
  271. package/dist/fp/automationInterpreter.js.map +1 -1
  272. package/dist/fp/automationProgram.d.ts +30 -0
  273. package/dist/fp/automationProgram.js.map +1 -1
  274. package/dist/fp/automationState.d.ts +24 -5
  275. package/dist/fp/automationState.js +56 -9
  276. package/dist/fp/automationState.js.map +1 -1
  277. package/dist/fp/automationUtils.js +1 -1
  278. package/dist/fp/automationUtils.js.map +1 -1
  279. package/dist/fp/commandDescription.js +7 -1
  280. package/dist/fp/commandDescription.js.map +1 -1
  281. package/dist/fp/extensionSnapshot.js +8 -2
  282. package/dist/fp/extensionSnapshot.js.map +1 -1
  283. package/dist/fp/interpreterContext.d.ts +66 -1
  284. package/dist/fp/interpreterContext.js +91 -1
  285. package/dist/fp/interpreterContext.js.map +1 -1
  286. package/dist/fp/policyParser.js +29 -1
  287. package/dist/fp/policyParser.js.map +1 -1
  288. package/dist/fsWatchWithFallback.d.ts +36 -0
  289. package/dist/fsWatchWithFallback.js +128 -0
  290. package/dist/fsWatchWithFallback.js.map +1 -0
  291. package/dist/haltPushDispatch.d.ts +33 -0
  292. package/dist/haltPushDispatch.js +103 -0
  293. package/dist/haltPushDispatch.js.map +1 -0
  294. package/dist/httpBodyValidation.d.ts +41 -0
  295. package/dist/httpBodyValidation.js +45 -0
  296. package/dist/httpBodyValidation.js.map +1 -0
  297. package/dist/inboxRoutes.d.ts +22 -0
  298. package/dist/inboxRoutes.js +61 -1
  299. package/dist/inboxRoutes.js.map +1 -1
  300. package/dist/index.js +1053 -76
  301. package/dist/index.js.map +1 -1
  302. package/dist/installGuard.js +6 -2
  303. package/dist/installGuard.js.map +1 -1
  304. package/dist/lockfile.js +31 -4
  305. package/dist/lockfile.js.map +1 -1
  306. package/dist/oauth.d.ts +9 -0
  307. package/dist/oauth.js +33 -0
  308. package/dist/oauth.js.map +1 -1
  309. package/dist/oauthRoutes.d.ts +1 -1
  310. package/dist/oauthRoutes.js +5 -3
  311. package/dist/oauthRoutes.js.map +1 -1
  312. package/dist/orchestrator/childBridgeRegistry.js +29 -11
  313. package/dist/orchestrator/childBridgeRegistry.js.map +1 -1
  314. package/dist/patchworkConfig.d.ts +44 -1
  315. package/dist/patchworkConfig.js +28 -3
  316. package/dist/patchworkConfig.js.map +1 -1
  317. package/dist/pluginLoader.js +10 -1
  318. package/dist/pluginLoader.js.map +1 -1
  319. package/dist/pluginWatcher.js +12 -14
  320. package/dist/pluginWatcher.js.map +1 -1
  321. package/dist/preToolUseHook.js +3 -2
  322. package/dist/preToolUseHook.js.map +1 -1
  323. package/dist/processTree.d.ts +34 -0
  324. package/dist/processTree.js +105 -0
  325. package/dist/processTree.js.map +1 -0
  326. package/dist/prompts.js +3 -3
  327. package/dist/prompts.js.map +1 -1
  328. package/dist/recipeOrchestration.d.ts +9 -0
  329. package/dist/recipeOrchestration.js +341 -24
  330. package/dist/recipeOrchestration.js.map +1 -1
  331. package/dist/recipeRoutes.d.ts +58 -2
  332. package/dist/recipeRoutes.js +744 -115
  333. package/dist/recipeRoutes.js.map +1 -1
  334. package/dist/recipes/RecipeOrchestrator.d.ts +2 -0
  335. package/dist/recipes/RecipeOrchestrator.js +6 -1
  336. package/dist/recipes/RecipeOrchestrator.js.map +1 -1
  337. package/dist/recipes/agentExecutor.d.ts +25 -5
  338. package/dist/recipes/agentExecutor.js.map +1 -1
  339. package/dist/recipes/chainedRunner.d.ts +2 -0
  340. package/dist/recipes/chainedRunner.js +142 -5
  341. package/dist/recipes/chainedRunner.js.map +1 -1
  342. package/dist/recipes/connectorPreflight.d.ts +66 -0
  343. package/dist/recipes/connectorPreflight.js +169 -0
  344. package/dist/recipes/connectorPreflight.js.map +1 -0
  345. package/dist/recipes/dependencyGraph.js +13 -5
  346. package/dist/recipes/dependencyGraph.js.map +1 -1
  347. package/dist/recipes/githubInstallSource.d.ts +128 -0
  348. package/dist/recipes/githubInstallSource.js +206 -0
  349. package/dist/recipes/githubInstallSource.js.map +1 -0
  350. package/dist/recipes/haltCategory.d.ts +119 -0
  351. package/dist/recipes/haltCategory.js +188 -0
  352. package/dist/recipes/haltCategory.js.map +1 -0
  353. package/dist/recipes/idempotencyKey.d.ts +134 -0
  354. package/dist/recipes/idempotencyKey.js +322 -0
  355. package/dist/recipes/idempotencyKey.js.map +1 -0
  356. package/dist/recipes/installer.js +48 -2
  357. package/dist/recipes/installer.js.map +1 -1
  358. package/dist/recipes/judgeSummary.d.ts +50 -0
  359. package/dist/recipes/judgeSummary.js +47 -0
  360. package/dist/recipes/judgeSummary.js.map +1 -0
  361. package/dist/recipes/judgeVerdict.d.ts +48 -0
  362. package/dist/recipes/judgeVerdict.js +174 -0
  363. package/dist/recipes/judgeVerdict.js.map +1 -0
  364. package/dist/recipes/migrations/index.d.ts +9 -0
  365. package/dist/recipes/migrations/index.js +133 -0
  366. package/dist/recipes/migrations/index.js.map +1 -1
  367. package/dist/recipes/names.d.ts +20 -0
  368. package/dist/recipes/names.js +25 -0
  369. package/dist/recipes/names.js.map +1 -1
  370. package/dist/recipes/parser.js +88 -5
  371. package/dist/recipes/parser.js.map +1 -1
  372. package/dist/recipes/replayRun.js +1 -1
  373. package/dist/recipes/replayRun.js.map +1 -1
  374. package/dist/recipes/runBudget.d.ts +70 -0
  375. package/dist/recipes/runBudget.js +109 -0
  376. package/dist/recipes/runBudget.js.map +1 -0
  377. package/dist/recipes/scheduler.d.ts +30 -0
  378. package/dist/recipes/scheduler.js +69 -19
  379. package/dist/recipes/scheduler.js.map +1 -1
  380. package/dist/recipes/schema.d.ts +36 -0
  381. package/dist/recipes/schemaGenerator.js +103 -5
  382. package/dist/recipes/schemaGenerator.js.map +1 -1
  383. package/dist/recipes/stepObservation.js +9 -0
  384. package/dist/recipes/stepObservation.js.map +1 -1
  385. package/dist/recipes/toolRegistry.js +20 -3
  386. package/dist/recipes/toolRegistry.js.map +1 -1
  387. package/dist/recipes/tools/fanOut.d.ts +20 -0
  388. package/dist/recipes/tools/fanOut.js +199 -0
  389. package/dist/recipes/tools/fanOut.js.map +1 -0
  390. package/dist/recipes/tools/file.js +5 -2
  391. package/dist/recipes/tools/file.js.map +1 -1
  392. package/dist/recipes/tools/github.d.ts +1 -1
  393. package/dist/recipes/tools/github.js +75 -1
  394. package/dist/recipes/tools/github.js.map +1 -1
  395. package/dist/recipes/tools/gmail.js +27 -5
  396. package/dist/recipes/tools/gmail.js.map +1 -1
  397. package/dist/recipes/tools/googleDrive.js +64 -0
  398. package/dist/recipes/tools/googleDrive.js.map +1 -1
  399. package/dist/recipes/tools/http.d.ts +10 -0
  400. package/dist/recipes/tools/http.js +176 -0
  401. package/dist/recipes/tools/http.js.map +1 -0
  402. package/dist/recipes/tools/index.d.ts +2 -0
  403. package/dist/recipes/tools/index.js +2 -0
  404. package/dist/recipes/tools/index.js.map +1 -1
  405. package/dist/recipes/tools/slack.js +1 -1
  406. package/dist/recipes/validation.d.ts +17 -0
  407. package/dist/recipes/validation.js +29 -11
  408. package/dist/recipes/validation.js.map +1 -1
  409. package/dist/recipes/workspaceRoot.d.ts +37 -0
  410. package/dist/recipes/workspaceRoot.js +73 -0
  411. package/dist/recipes/workspaceRoot.js.map +1 -0
  412. package/dist/recipes/yamlPositions.d.ts +56 -0
  413. package/dist/recipes/yamlPositions.js +183 -0
  414. package/dist/recipes/yamlPositions.js.map +1 -0
  415. package/dist/recipes/yamlRunner.d.ts +182 -8
  416. package/dist/recipes/yamlRunner.js +877 -217
  417. package/dist/recipes/yamlRunner.js.map +1 -1
  418. package/dist/recipesHttp.d.ts +19 -3
  419. package/dist/recipesHttp.js +67 -11
  420. package/dist/recipesHttp.js.map +1 -1
  421. package/dist/resources.js +21 -13
  422. package/dist/resources.js.map +1 -1
  423. package/dist/runLog.d.ts +58 -5
  424. package/dist/runLog.js +98 -21
  425. package/dist/runLog.js.map +1 -1
  426. package/dist/sanitizeParsedJson.d.ts +39 -0
  427. package/dist/sanitizeParsedJson.js +55 -0
  428. package/dist/sanitizeParsedJson.js.map +1 -0
  429. package/dist/schemas/recipe.v1.json +885 -196
  430. package/dist/server.d.ts +160 -3
  431. package/dist/server.js +1099 -122
  432. package/dist/server.js.map +1 -1
  433. package/dist/sessionCheckpoint.d.ts +8 -0
  434. package/dist/sessionCheckpoint.js +33 -3
  435. package/dist/sessionCheckpoint.js.map +1 -1
  436. package/dist/ssrfGuard.d.ts +16 -0
  437. package/dist/ssrfGuard.js +87 -4
  438. package/dist/ssrfGuard.js.map +1 -1
  439. package/dist/streamableHttp.d.ts +9 -4
  440. package/dist/streamableHttp.js +76 -20
  441. package/dist/streamableHttp.js.map +1 -1
  442. package/dist/telemetry.js +19 -12
  443. package/dist/telemetry.js.map +1 -1
  444. package/dist/testing/shadowRun.d.ts +52 -0
  445. package/dist/testing/shadowRun.js +71 -0
  446. package/dist/testing/shadowRun.js.map +1 -0
  447. package/dist/tools/batchLsp.d.ts +3 -0
  448. package/dist/tools/bridgeDoctor.d.ts +11 -0
  449. package/dist/tools/bridgeDoctor.js +48 -2
  450. package/dist/tools/bridgeDoctor.js.map +1 -1
  451. package/dist/tools/bridgeStatus.d.ts +0 -12
  452. package/dist/tools/bridgeStatus.js +2 -28
  453. package/dist/tools/bridgeStatus.js.map +1 -1
  454. package/dist/tools/cancelClaudeTask.d.ts +1 -0
  455. package/dist/tools/clipboard.d.ts +2 -0
  456. package/dist/tools/closeTabs.d.ts +1 -0
  457. package/dist/tools/codeLens.d.ts +1 -0
  458. package/dist/tools/createIssueFromAIComment.d.ts +1 -0
  459. package/dist/tools/ctxGetTaskContext.d.ts +9 -0
  460. package/dist/tools/ctxGetTaskContext.js +50 -2
  461. package/dist/tools/ctxGetTaskContext.js.map +1 -1
  462. package/dist/tools/ctxQueryTraces.js +32 -24
  463. package/dist/tools/ctxQueryTraces.js.map +1 -1
  464. package/dist/tools/ctxSaveTrace.d.ts +1 -0
  465. package/dist/tools/debug.d.ts +4 -0
  466. package/dist/tools/decorations.d.ts +2 -0
  467. package/dist/tools/detectUnusedCode.js +9 -7
  468. package/dist/tools/detectUnusedCode.js.map +1 -1
  469. package/dist/tools/documentLinks.d.ts +1 -0
  470. package/dist/tools/editText.d.ts +1 -0
  471. package/dist/tools/editText.js +2 -1
  472. package/dist/tools/editText.js.map +1 -1
  473. package/dist/tools/enrichCommit.d.ts +1 -0
  474. package/dist/tools/enrichStackTrace.js +11 -5
  475. package/dist/tools/enrichStackTrace.js.map +1 -1
  476. package/dist/tools/explainDiagnostic.d.ts +1 -0
  477. package/dist/tools/explainSymbol.d.ts +1 -0
  478. package/dist/tools/fileOperations.d.ts +3 -0
  479. package/dist/tools/fileOperations.js +2 -1
  480. package/dist/tools/fileOperations.js.map +1 -1
  481. package/dist/tools/fileWatcher.d.ts +2 -0
  482. package/dist/tools/fileWatcher.js +8 -2
  483. package/dist/tools/fileWatcher.js.map +1 -1
  484. package/dist/tools/findFiles.d.ts +1 -0
  485. package/dist/tools/fixAllLintErrors.d.ts +1 -0
  486. package/dist/tools/fixAllLintErrors.js +10 -5
  487. package/dist/tools/fixAllLintErrors.js.map +1 -1
  488. package/dist/tools/foldingRanges.d.ts +1 -0
  489. package/dist/tools/formatDocument.d.ts +1 -0
  490. package/dist/tools/formatDocument.js +10 -5
  491. package/dist/tools/formatDocument.js.map +1 -1
  492. package/dist/tools/generateTests.d.ts +1 -0
  493. package/dist/tools/getAIComments.d.ts +1 -0
  494. package/dist/tools/getAnalyticsReport.js +5 -1
  495. package/dist/tools/getAnalyticsReport.js.map +1 -1
  496. package/dist/tools/getBufferContent.d.ts +1 -0
  497. package/dist/tools/getChangeImpact.d.ts +1 -0
  498. package/dist/tools/getChangeImpact.js +23 -14
  499. package/dist/tools/getChangeImpact.js.map +1 -1
  500. package/dist/tools/getClaudeTaskStatus.d.ts +1 -0
  501. package/dist/tools/getCodeCoverage.d.ts +1 -0
  502. package/dist/tools/getCodeCoverage.js +32 -14
  503. package/dist/tools/getCodeCoverage.js.map +1 -1
  504. package/dist/tools/getCommitsForIssue.d.ts +1 -0
  505. package/dist/tools/getDebugState.d.ts +1 -0
  506. package/dist/tools/getDiagnostics.js +32 -29
  507. package/dist/tools/getDiagnostics.js.map +1 -1
  508. package/dist/tools/getDiffFromHandoff.js +8 -2
  509. package/dist/tools/getDiffFromHandoff.js.map +1 -1
  510. package/dist/tools/getDocumentSymbols.d.ts +1 -0
  511. package/dist/tools/getGitHotspots.d.ts +1 -0
  512. package/dist/tools/getImportedSignatures.d.ts +1 -0
  513. package/dist/tools/getImportedSignatures.js +18 -14
  514. package/dist/tools/getImportedSignatures.js.map +1 -1
  515. package/dist/tools/getPRTemplate.d.ts +1 -0
  516. package/dist/tools/getProjectContext.js +23 -10
  517. package/dist/tools/getProjectContext.js.map +1 -1
  518. package/dist/tools/getSymbolHistory.d.ts +1 -0
  519. package/dist/tools/getToolCapabilities.d.ts +10 -5
  520. package/dist/tools/getToolCapabilities.js +79 -202
  521. package/dist/tools/getToolCapabilities.js.map +1 -1
  522. package/dist/tools/getTypeSignature.d.ts +1 -0
  523. package/dist/tools/getWorkspaceSettings.d.ts +1 -0
  524. package/dist/tools/gitWrite.d.ts +11 -0
  525. package/dist/tools/github/actions.d.ts +2 -0
  526. package/dist/tools/github/composite.d.ts +3 -0
  527. package/dist/tools/github/issues.d.ts +4 -0
  528. package/dist/tools/github/pr.d.ts +7 -0
  529. package/dist/tools/handoffNote.d.ts +1 -0
  530. package/dist/tools/handoffNote.js +2 -1
  531. package/dist/tools/handoffNote.js.map +1 -1
  532. package/dist/tools/headless/lspClient.js +3 -0
  533. package/dist/tools/headless/lspClient.js.map +1 -1
  534. package/dist/tools/hoverAtCursor.d.ts +1 -0
  535. package/dist/tools/httpClient.d.ts +2 -0
  536. package/dist/tools/httpClient.js +38 -71
  537. package/dist/tools/httpClient.js.map +1 -1
  538. package/dist/tools/inlayHints.d.ts +1 -0
  539. package/dist/tools/launchQuickTask.d.ts +1 -0
  540. package/dist/tools/listClaudeTasks.d.ts +1 -0
  541. package/dist/tools/listClaudeTasks.js +10 -8
  542. package/dist/tools/listClaudeTasks.js.map +1 -1
  543. package/dist/tools/listTerminals.d.ts +1 -0
  544. package/dist/tools/lsp.d.ts +15 -0
  545. package/dist/tools/lsp.js +17 -0
  546. package/dist/tools/lsp.js.map +1 -1
  547. package/dist/tools/navigateToSymbolByName.d.ts +1 -0
  548. package/dist/tools/openDiff.d.ts +1 -0
  549. package/dist/tools/openDiff.js +4 -1
  550. package/dist/tools/openDiff.js.map +1 -1
  551. package/dist/tools/openFile.d.ts +1 -0
  552. package/dist/tools/openFile.js +4 -1
  553. package/dist/tools/openFile.js.map +1 -1
  554. package/dist/tools/openInBrowser.js +6 -1
  555. package/dist/tools/openInBrowser.js.map +1 -1
  556. package/dist/tools/organizeImports.d.ts +1 -0
  557. package/dist/tools/organizeImports.js +5 -3
  558. package/dist/tools/organizeImports.js.map +1 -1
  559. package/dist/tools/performanceReport.js +5 -3
  560. package/dist/tools/performanceReport.js.map +1 -1
  561. package/dist/tools/planPersistence.d.ts +3 -0
  562. package/dist/tools/planPersistence.js +4 -1
  563. package/dist/tools/planPersistence.js.map +1 -1
  564. package/dist/tools/previewEdit.d.ts +1 -0
  565. package/dist/tools/previewEdit.js +15 -4
  566. package/dist/tools/previewEdit.js.map +1 -1
  567. package/dist/tools/recentTracesDigest.js +54 -11
  568. package/dist/tools/recentTracesDigest.js.map +1 -1
  569. package/dist/tools/refactorAnalyze.d.ts +1 -0
  570. package/dist/tools/refactorExtractFunction.js +4 -1
  571. package/dist/tools/refactorExtractFunction.js.map +1 -1
  572. package/dist/tools/refactorPreview.d.ts +1 -0
  573. package/dist/tools/refactorPreview.js +10 -2
  574. package/dist/tools/refactorPreview.js.map +1 -1
  575. package/dist/tools/replaceBlock.d.ts +1 -0
  576. package/dist/tools/replaceBlock.js +2 -1
  577. package/dist/tools/replaceBlock.js.map +1 -1
  578. package/dist/tools/resumeClaudeTask.d.ts +1 -0
  579. package/dist/tools/runClaudeTask.d.ts +1 -0
  580. package/dist/tools/runTests.js +15 -4
  581. package/dist/tools/runTests.js.map +1 -1
  582. package/dist/tools/screenshot.d.ts +1 -0
  583. package/dist/tools/screenshotAndAnnotate.js +6 -2
  584. package/dist/tools/screenshotAndAnnotate.js.map +1 -1
  585. package/dist/tools/searchAndReplace.d.ts +1 -0
  586. package/dist/tools/searchAndReplace.js +17 -7
  587. package/dist/tools/searchAndReplace.js.map +1 -1
  588. package/dist/tools/searchTools.js +20 -19
  589. package/dist/tools/searchTools.js.map +1 -1
  590. package/dist/tools/searchWorkspace.d.ts +1 -0
  591. package/dist/tools/selectionRanges.d.ts +1 -0
  592. package/dist/tools/semanticTokens.d.ts +1 -0
  593. package/dist/tools/signatureHelp.d.ts +1 -0
  594. package/dist/tools/spawnWorkspace.js +15 -7
  595. package/dist/tools/spawnWorkspace.js.map +1 -1
  596. package/dist/tools/terminal.d.ts +6 -0
  597. package/dist/tools/testRunners/pytest.js +6 -2
  598. package/dist/tools/testRunners/pytest.js.map +1 -1
  599. package/dist/tools/testRunners/vitestJest.js +3 -1
  600. package/dist/tools/testRunners/vitestJest.js.map +1 -1
  601. package/dist/tools/testTraceToSource.d.ts +1 -0
  602. package/dist/tools/transaction.d.ts +4 -0
  603. package/dist/tools/transaction.js +4 -1
  604. package/dist/tools/transaction.js.map +1 -1
  605. package/dist/tools/typeHierarchy.d.ts +1 -0
  606. package/dist/tools/utils.d.ts +18 -0
  607. package/dist/tools/utils.js +103 -18
  608. package/dist/tools/utils.js.map +1 -1
  609. package/dist/tools/vscodeCommands.d.ts +2 -0
  610. package/dist/tools/vscodeTasks.d.ts +2 -0
  611. package/dist/tools/workspaceSettings.d.ts +1 -0
  612. package/dist/transport.d.ts +3 -1
  613. package/dist/transport.js +103 -52
  614. package/dist/transport.js.map +1 -1
  615. package/dist/winShim.d.ts +34 -0
  616. package/dist/winShim.js +94 -0
  617. package/dist/winShim.js.map +1 -0
  618. package/dist/wireHaltPushDispatch.d.ts +38 -0
  619. package/dist/wireHaltPushDispatch.js +71 -0
  620. package/dist/wireHaltPushDispatch.js.map +1 -0
  621. package/dist/writeFileAtomic.d.ts +23 -0
  622. package/dist/writeFileAtomic.js +121 -0
  623. package/dist/writeFileAtomic.js.map +1 -0
  624. package/package.json +23 -7
  625. package/scripts/postinstall.mjs +42 -2
  626. package/scripts/smoke/run-all.mjs +213 -0
  627. package/scripts/start-all.mjs +572 -0
  628. package/scripts/start-all.ps1 +209 -0
  629. package/scripts/start-all.sh +73 -17
  630. package/scripts/start-orchestrator.ps1 +158 -0
  631. package/scripts/start-remote.mjs +122 -0
  632. package/templates/automation-policies/recipe-authoring.json +1 -1
  633. package/templates/automation-policies/security-first.json +1 -1
  634. package/templates/automation-policies/strict-lint.json +1 -1
  635. package/templates/automation-policies/test-driven.json +1 -1
  636. package/templates/automation-policy.example.json +1 -1
  637. package/templates/co.patchwork-os.bridge.plist +2 -2
  638. package/templates/recipes/approval-queue-ui-test.yaml +1 -1
  639. package/templates/recipes/ctx-loop-test.yaml +1 -1
  640. package/templates/recipes/fix-errors-on-save.yaml +71 -0
  641. package/templates/recipes/morning-brief.yaml +5 -2
  642. package/templates/recipes/project-health-check.yaml +4 -1
  643. package/templates/recipes/sentry-to-linear.yaml +72 -38
  644. package/templates/recipes/webhook/apple-watch-health-log.yaml +145 -0
  645. package/templates/recipes/webhook/customer-escalation.yaml +8 -9
  646. package/templates/recipes/webhook/meeting-prep.yaml +11 -5
  647. package/dist/commands/marketplace.d.ts +0 -16
  648. package/dist/commands/marketplace.js +0 -32
  649. package/dist/commands/marketplace.js.map +0 -1
  650. package/dist/recipes/legacyRecipeCompat.d.ts +0 -10
  651. package/dist/recipes/legacyRecipeCompat.js +0 -131
  652. package/dist/recipes/legacyRecipeCompat.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "_comment": "Example automation policy with LSP-aware prompts. Copy to automation-policy.json and adjust as needed.",
3
- "_usage": "Start bridge with: claude-ide-bridge --automation --automation-policy ./automation-policy.json --claude-driver subprocess",
3
+ "_usage": "Start bridge with: claude-ide-bridge --automation --automation-policy ./automation-policy.json --driver subprocess",
4
4
 
5
5
  "onFileChanged": {
6
6
  "enabled": true,
@@ -8,7 +8,7 @@
8
8
  <key>ProgramArguments</key>
9
9
  <array>
10
10
  <string>__BINARY_PATH__</string>
11
- <string>--claude-driver</string>
11
+ <string>--driver</string>
12
12
  <string>subprocess</string>
13
13
  </array>
14
14
  <key>RunAtLoad</key>
@@ -24,7 +24,7 @@
24
24
  <key>HOME</key>
25
25
  <string>__HOME__</string>
26
26
  <key>PATH</key>
27
- <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
27
+ <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
28
28
  </dict>
29
29
  <key>WorkingDirectory</key>
30
30
  <string>__HOME__</string>
@@ -19,7 +19,7 @@ description: |
19
19
  Keyboard — J / K (focus), E / X (decide)
20
20
 
21
21
  PREREQUISITES
22
- 1. Bridge running with --claude-driver subprocess so the agent has MCP
22
+ 1. Bridge running with --driver subprocess so the agent has MCP
23
23
  access to the Playwright server.
24
24
  2. Dashboard reachable at DASHBOARD_URL (defaults to localhost:3000;
25
25
  Patchwork's Next.js dev typically mounts under /dashboard, so the
@@ -5,7 +5,7 @@ description: |
5
5
  appears in the result. Output lands in ~/.patchwork/inbox/ for manual inspection.
6
6
  Run this after deploying a new bridge build to confirm the memory moat is live.
7
7
 
8
- NOTE: requires --claude-driver subprocess and a running bridge with HTTP port
8
+ NOTE: requires --driver subprocess and a running bridge with HTTP port
9
9
  so the agent subprocess has MCP access. Running via `patchwork recipe run`
10
10
  (local yamlRunner) will fail at Step 1 — the local claude -p subprocess has
11
11
  no bridge MCP context. Trigger from the dashboard Recipes page instead.
@@ -0,0 +1,71 @@
1
+ apiVersion: patchwork.sh/v1
2
+ name: fix-errors-on-save
3
+ description: |
4
+ On every save of a .ts/.tsx file, check for TypeScript errors. If errors exist,
5
+ an agent reads the broken code, navigates to the relevant type definitions, and
6
+ applies a minimal targeted fix — without refactoring surrounding code.
7
+
8
+ Requires: bridge running with --driver subprocess so the agent subprocess has
9
+ MCP access to getBufferContent, goToDefinition, getHover, getDiagnostics, editText.
10
+
11
+ trigger:
12
+ type: on_file_save
13
+ glob: "**/*.{ts,tsx}"
14
+
15
+ steps:
16
+ - tool: diagnostics.get
17
+ uri: "{{file}}"
18
+ filter: error
19
+ into: errors
20
+
21
+ - agent:
22
+ prompt: |
23
+ A TypeScript file was just saved: {{file}}
24
+
25
+ Current errors reported by the language server:
26
+ {{errors}}
27
+
28
+ If there are NO errors (empty list above), output nothing (empty string) and stop.
29
+
30
+ Otherwise, fix the errors by following these steps IN ORDER:
31
+
32
+ ## Step 1 — Read the file
33
+ Call getBufferContent for {{file}} to see the current code. Note the line
34
+ numbers of each error.
35
+
36
+ ## Step 2 — Understand the types involved
37
+ For each error, use getHover at the error location to read the type information.
38
+ If the error references a symbol whose definition you need (e.g. "Property X does
39
+ not exist on type Y"), call goToDefinition on that symbol and then getBufferContent
40
+ on the definition file to read the actual shape of the type.
41
+
42
+ ## Step 3 — Apply a minimal fix
43
+ Call editText to fix each error at its exact line. Rules:
44
+ - Fix only what the error points to — do not refactor surrounding code
45
+ - If fixing one error would require restructuring multiple files, stop and report
46
+ why instead of applying a partial fix
47
+ - Prefer adding a missing property/cast over restructuring the type
48
+
49
+ ## Step 4 — Verify
50
+ Call getDiagnostics for {{file}} after your edits. If new errors appeared, revert
51
+ your change with another editText call and report the failure.
52
+
53
+ ## Step 5 — Report
54
+ Output a concise markdown summary:
55
+ ```
56
+ ## fix-errors-on-save — {{file}}
57
+ **Errors found:** <count>
58
+ **Fixed:** <list each fix: "line N: <what was wrong> → <what was done>">
59
+ **Remaining:** <count, or "none">
60
+ **Skipped:** <any errors you couldn't safely fix, and why>
61
+ ```
62
+ driver: claude-code
63
+ model: claude-haiku-4-5-20251001
64
+ into: result
65
+
66
+ # Only append to the inbox when fixes were applied. When no errors exist
67
+ # the agent outputs nothing (empty string) and {{result}} is empty → falsy → skip.
68
+ - tool: file.append
69
+ path: ~/.patchwork/inbox/auto-fixes.md
70
+ content: "{{result}}\n\n"
71
+ when: "{{result}}"
@@ -61,8 +61,11 @@ steps:
61
61
  6. **Linear** — list in-progress and unstarted issues by priority; omit this section entirely if the list is empty or returned an error
62
62
 
63
63
  Be concise. Skip newsletters and automated notifications.
64
- # Use claude (not gemini) — Gemini free tier hits daily quota mid-recipe
65
- driver: claude
64
+ # Use the claude-code driver (subprocess `claude -p`) — runs under
65
+ # your existing Claude Code subscription, no ANTHROPIC_API_KEY
66
+ # required. Switch to `driver: claude` only if you have an API key
67
+ # set and want the Anthropic API path (different billing).
68
+ driver: claude-code
66
69
  into: brief
67
70
  - tool: file.write
68
71
  path: ~/.patchwork/inbox/morning-brief-{{date}}.md
@@ -38,7 +38,10 @@ steps:
38
38
  2. **Issues** — issues needing attention today; omit if empty
39
39
  3. **PRs** — PRs waiting on review or action; omit if empty
40
40
  4. **Health** — one-sentence overall assessment (on track / needs attention / blocked)
41
- driver: claude
41
+ # Use the claude-code driver (subprocess `claude -p`) — runs under
42
+ # your existing Claude Code subscription. Switch to `driver: claude`
43
+ # only if you have ANTHROPIC_API_KEY set and prefer the API path.
44
+ driver: claude-code
42
45
  awaits: [gather]
43
46
  - id: write
44
47
  tool: file.write
@@ -1,77 +1,111 @@
1
+ apiVersion: patchwork.sh/v1
1
2
  name: sentry-to-linear
2
3
  description: |
3
- Fetch a Sentry issue, enrich it with git blame, and create a triage-ready
4
+ Fetch a Sentry issue, enrich its stack trace with git blame (via
5
+ enrichStackTrace built into fetchSentryIssue), and create a triage-ready
4
6
  Linear ticket. Requires both Sentry and Linear connectors connected.
5
7
  Run ad-hoc or trigger via webhook / automation policy.
6
8
 
7
- # Example manual trigger:
8
- # patchwork-os run-recipe sentry-to-linear --var SENTRY_ISSUE_ID=12345678
9
+ # Manual run:
10
+ # patchwork recipe run sentry-to-linear --var SENTRY_ISSUE_ID=12345678
9
11
  #
10
- # Example automation trigger (add to ~/.patchwork/automation-policy.json):
11
- # "onFileSave": { ... } — or fire from a Sentry webhook handler
12
+ # Webhook trigger (convert this recipe to webhook type after install):
13
+ # trigger:
14
+ # type: webhook
15
+ # path: /hooks/sentry-to-linear
16
+ # Then POST from a Sentry alert rule to https://<bridge-url>/hooks/sentry-to-linear
12
17
 
13
18
  trigger:
14
19
  type: manual
15
20
  vars:
16
21
  - name: SENTRY_ISSUE_ID
17
- description: "Sentry issue ID or URL (e.g. '12345678' or 'https://sentry.io/...')"
22
+ description: "Sentry issue ID or URL (e.g. '12345678' or 'https://sentry.io/organizations/my-org/issues/12345678/')"
18
23
  required: true
19
24
  - name: LINEAR_TEAM_KEY
20
- description: "Linear team key to create the issue in (e.g. 'ENG'). Defaults to first team."
25
+ description: "Linear team key (e.g. 'ENG'). Leave blank to use your first team."
21
26
  required: false
22
27
  - name: LINEAR_PRIORITY
23
- description: "Linear priority: 1=urgent, 2=high, 3=medium, 4=low (default: 2)"
28
+ description: "Linear priority: 1=urgent 2=high 3=medium 4=low"
24
29
  required: false
25
30
  default: "2"
26
31
 
27
32
  steps:
28
33
  - agent:
29
34
  prompt: |
30
- You are a triage assistant. Your job is to:
31
- 1. Fetch the Sentry issue using fetchSentryIssue with issueId "{{SENTRY_ISSUE_ID}}"
32
- 2. Create a Linear issue using createLinearIssue with the data you received
35
+ You are a triage assistant. Follow these steps exactly — do not skip any.
33
36
 
34
- For the Linear issue:
35
- - title: Use the Sentry issue title verbatim
36
- - description: Write a structured Markdown body with these sections:
37
- ## Error
38
- (one-line error type + message from the Sentry title)
37
+ ## Step 1 — Fetch Sentry issue with git blame enrichment
39
38
 
40
- ## Stack trace
41
- (the top 5 frames from the stackTrace field, formatted as a code block)
39
+ Call `fetchSentryIssue` with:
40
+ issueId: "{{SENTRY_ISSUE_ID}}"
41
+ maxFrames: 15
42
42
 
43
- ## Suspect commit
44
- (if topSuspect is present: sha, author, date, subject otherwise write "No suspect commit identified")
43
+ `fetchSentryIssue` automatically runs git blame on every stack frame and
44
+ returns `topSuspect` (the commit most likely to have introduced the bug),
45
+ `confidence` (high/medium/low), and per-frame `commit` attribution.
45
46
 
46
- ## Confidence
47
- (the confidence field value + a one-sentence explanation of what it means)
47
+ ## Step 2 — Create the Linear issue
48
48
 
49
- ## Sentry link
50
- (a link back to the Sentry issue construct from the issueId: https://sentry.io/issues/{{SENTRY_ISSUE_ID}}/)
49
+ Call `createLinearIssue` with:
50
+ title: The Sentry issue title verbatim
51
+ teamKey: "{{LINEAR_TEAM_KEY}}" (omit the key entirely if the value is blank)
52
+ priority: {{LINEAR_PRIORITY}} (integer — not a string)
53
+ labelNames: ["bug"]
54
+ description: A Markdown body structured exactly as follows:
51
55
 
52
- - teamKey: "{{LINEAR_TEAM_KEY}}" (pass as-is; if blank the tool picks the first team)
53
- - priority: {{LINEAR_PRIORITY}} (as an integer)
54
- - labelNames: ["bug"]
56
+ ---
57
+ ## Error
58
+ <one-line error type + message from the Sentry title>
55
59
 
56
- After creating the ticket, respond with ONLY a JSON object:
60
+ ## Stack trace
61
+ ```
62
+ <top 10 frames from the stackTrace field>
63
+ ```
64
+
65
+ ## Suspect commit
66
+ <If topSuspect is non-null, format as:>
67
+ - **SHA:** `<sha>`
68
+ - **Author:** <author>
69
+ - **Date:** <date>
70
+ - **Subject:** <subject>
71
+ - **Frames blamed:** <frameCount> of <framesBlamed> workspace frames
72
+ - **Confidence:** <confidence>
73
+
74
+ <If topSuspect is null, write:>
75
+ No suspect commit identified (confidence: <confidence>).
76
+ Git blame ran on <framesBlamed> frames; none resolved to a workspace commit.
77
+
78
+ ## Sentry link
79
+ <full Sentry URL — use issueId to construct: https://sentry.io/issues/{{SENTRY_ISSUE_ID}}/>
80
+ ---
81
+
82
+ ## Step 3 — Respond with JSON
83
+
84
+ After both tool calls succeed, respond with ONLY this JSON object
85
+ (no markdown fences, no extra text):
57
86
  {
58
- "sentryIssueId": "<the issueId from fetchSentryIssue>",
59
- "sentryTitle": "<the title>",
60
- "linearIdentifier": "<e.g. ENG-101>",
61
- "linearUrl": "<the url from createLinearIssue>",
87
+ "sentryIssueId": "<issueId from fetchSentryIssue>",
88
+ "sentryTitle": "<title from fetchSentryIssue>",
89
+ "linearIdentifier": "<identifier from createLinearIssue, e.g. ENG-101>",
90
+ "linearUrl": "<url from createLinearIssue>",
62
91
  "confidence": "<high|medium|low>",
63
- "suspectCommit": "<sha or null>"
92
+ "suspectCommit": "<sha or null>",
93
+ "framesBlamed": <integer>,
94
+ "gitAvailable": <boolean>
64
95
  }
65
96
 
66
- If either tool returns an error (sentryConnected: false or linearConnected: false),
67
- respond with the same JSON shape but set linearUrl to "" and add an "error" key
68
- explaining which connector is not connected.
97
+ If `sentryConnected` is false in the fetchSentryIssue response, stop and respond:
98
+ {"error": "Sentry connector not connected visit /connections to authenticate"}
99
+
100
+ If `linearConnected` is false in the createLinearIssue response, stop and respond:
101
+ {"error": "Linear connector not connected — visit /connections to authenticate"}
69
102
  driver: claude-code
70
103
  model: claude-haiku-4-5-20251001
71
104
  into: result
105
+
72
106
  - tool: file.write
73
- path: ~/.patchwork/inbox/sentry-to-linear-{{date}}.md
107
+ path: ~/.patchwork/inbox/sentry-{{SENTRY_ISSUE_ID}}-{{date}}.md
74
108
  content: |
75
- # Sentry → Linear triage ({{date}})
109
+ # Sentry → Linear: {{SENTRY_ISSUE_ID}} ({{date}})
76
110
 
77
111
  {{result}}
@@ -0,0 +1,145 @@
1
+ apiVersion: patchwork.sh/v1
2
+ name: apple-watch-health-log
3
+ description: |
4
+ Logs Apple Watch sleep duration, quality, and activity rings from an iOS
5
+ Shortcut. Each fire writes a daily journal entry, generates a warm AI Coach
6
+ insight (Fitbit-Gemini style) via Claude, appends the insight to the
7
+ journal, and pushes it to your phone via ntfy.sh. Two conditional nudges
8
+ fire only when the payload looks off:
9
+
10
+ - "Short night" — separate priority-5 push when sleep_hours_under_6 is set
11
+ - "Watch off your wrist" — different topic when move_percent is 0
12
+
13
+ Conditional steps are gated by `when:` and read precomputed boolean fields
14
+ from the iOS Shortcut payload (template substitution can't do arithmetic).
15
+
16
+ Suggested triggers:
17
+ - iOS Shortcut ("Log my watch" — pulls Health stats + POSTs JSON)
18
+ - Stream Deck button for manual end-of-day log
19
+ - NFC tag on your nightstand
20
+ - curl from any device that can POST HTTP
21
+
22
+ Payload conventions (all optional — missing fields render blank):
23
+ sleep_hours numeric, e.g. 7.4
24
+ sleep_quality "deep" | "restful" | "light" | "restless" | free text
25
+ sleep_hours_under_6 "1" if sleep_hours < 6 (Shortcut precomputes)
26
+ move_percent 0-100+ (rings can exceed 100%)
27
+ move_percent_zero "1" if move_percent == 0 (likely watch was off)
28
+ move_calories active kcal burned
29
+ exercise_percent 0-100+
30
+ exercise_min exercise minutes recorded
31
+ stand_percent 0-100+
32
+ notes free-form journal text
33
+
34
+ Setup:
35
+ 1. Replace NTFY_TOPIC, NTFY_NUDGE_TOPIC, and NTFY_ALERT_TOPIC with your
36
+ own unguessable ntfy topics and subscribe to all three in the app.
37
+ 2. Drop this file in ~/.patchwork/recipes/.
38
+ 3. Start the bridge with `--driver subprocess` so /hooks/* is live.
39
+
40
+ Example request:
41
+ curl -X POST http://localhost:3101/hooks/apple-watch-health \
42
+ -H 'Content-Type: application/json' \
43
+ -d '{"sleep_hours":7.4,"sleep_quality":"restful","move_percent":112,"move_calories":645,"exercise_percent":150,"exercise_min":45,"stand_percent":100,"notes":"Closed all three rings."}'
44
+
45
+ trigger:
46
+ type: webhook
47
+ path: /apple-watch-health
48
+
49
+ steps:
50
+ - id: write_journal
51
+ tool: file.append
52
+ path: ~/.patchwork/health-journal/{{date}}.md
53
+ content: |
54
+ ## {{date}} Apple Watch Summary
55
+
56
+ ```
57
+ SLEEP {{payload.sleep_hours}}h {{payload.sleep_quality}}
58
+ MOVE {{payload.move_percent}}% {{payload.move_calories}} kcal
59
+ EXER {{payload.exercise_percent}}% {{payload.exercise_min}} min
60
+ STAND {{payload.stand_percent}}%
61
+ NOTE {{payload.notes}}
62
+ ```
63
+
64
+ ---
65
+
66
+ - id: coach_insight
67
+ agent:
68
+ driver: claude-code
69
+ model: claude-haiku-4-5-20251001
70
+ into: insight
71
+ prompt: |
72
+ Read the Apple Watch numbers below and write a short, warm coaching note in the voice of a friend who knows health data well. The tone should celebrate something specific, name one pattern, and end with one small doable tip for today. No preamble, no markdown headers, no bullets, no sign-off, no emojis. Plain prose, 80-150 words, 2-3 short paragraphs.
73
+
74
+ Hard rules (response is rejected if any are broken):
75
+ - Anchor every compliment in a number from the data. No generic "great job".
76
+ - Never lecture, never list ideal ranges, never use clinical jargon.
77
+ - Never start with "Sure," "Here's," "Of course," or any preamble.
78
+ - End with one concrete tip for today, framed as a tiny win — not a lifestyle overhaul.
79
+
80
+ Tone reference (match the register, not the content):
81
+
82
+ Hey there. Your sleep performance hit 87/100 last night — solid 7 hours 45 minutes with a nice chunk of deep sleep. Recovery is looking strong at 82/100 thanks to that solid HRV of 62 ms. The pattern I notice: when you wrap exercise before 6pm your sleep lands in the high 80s pretty reliably. One small win for today: try wrapping up screens 30 minutes earlier tonight. You've got this.
83
+
84
+ Apple Watch numbers for today:
85
+ Sleep: {{payload.sleep_hours}} hours, {{payload.sleep_quality}}
86
+ Move ring: {{payload.move_percent}}% closed, {{payload.move_calories}} active calories
87
+ Exercise ring: {{payload.exercise_percent}}% closed, {{payload.exercise_min}} minutes
88
+ Stand ring: {{payload.stand_percent}}% closed
89
+ User's notes for the day: {{payload.notes}}
90
+
91
+ Write the coaching note now. Output only the prose, nothing else.
92
+ silentFailDetection: false
93
+
94
+ - id: append_insight
95
+ tool: file.append
96
+ when: "{{insight}}"
97
+ path: ~/.patchwork/health-journal/{{date}}.md
98
+ content: |
99
+ ### Coach's note
100
+
101
+ {{insight}}
102
+
103
+ ---
104
+
105
+ - id: push_to_phone
106
+ tool: http.post
107
+ when: "{{insight}}"
108
+ url: https://ntfy.sh/NTFY_TOPIC
109
+ contentType: text/plain
110
+ headers:
111
+ Title: "{{date}} - the body report"
112
+ Tags: watch,zzz,fire
113
+ body: |
114
+ {{insight}}
115
+
116
+ # Fires only when payload.sleep_hours_under_6 is truthy ("1", "true", etc.)
117
+ - id: short_night_nudge
118
+ tool: http.post
119
+ when: "{{payload.sleep_hours_under_6}}"
120
+ url: https://ntfy.sh/NTFY_NUDGE_TOPIC
121
+ contentType: text/plain
122
+ headers:
123
+ Title: Short night - go easy today
124
+ Tags: sleeping_face,warning
125
+ Priority: "5"
126
+ body: |
127
+ You logged {{payload.sleep_hours}}h ({{payload.sleep_quality}}).
128
+ No PR attempts. Hydrate. Move at half-throttle.
129
+
130
+ # Fires only when payload.move_percent_zero is truthy — likely the watch
131
+ # was off your wrist all day, not that you genuinely moved 0%.
132
+ - id: watch_off_alert
133
+ tool: http.post
134
+ when: "{{payload.move_percent_zero}}"
135
+ url: https://ntfy.sh/NTFY_ALERT_TOPIC
136
+ contentType: text/plain
137
+ headers:
138
+ Title: Watch reported 0% move
139
+ Tags: warning,watch
140
+ body: |
141
+ Move ring at 0% for {{date}}. Battery dead? Forgot the watch?
142
+ Today's journal entry may not reflect actual activity.
143
+
144
+ output:
145
+ path: ~/.patchwork/health-journal/{{date}}.md
@@ -25,22 +25,21 @@ trigger:
25
25
  path: /customer-escalation
26
26
 
27
27
  steps:
28
- - tool: hubspot.find_contact
29
- email: "{{payload.customer_email}}"
28
+ # Look the contact up by email. HubSpot's search API accepts a free-form
29
+ # query string (matches name / email / company) — the email itself is a
30
+ # specific enough literal that we get a one-row hit when the email is on
31
+ # file. If you need stricter matching, post-filter in the agent step.
32
+ - tool: hubspot.searchContacts
33
+ query: "{{payload.customer_email}}"
30
34
  into: contact
31
- - tool: hubspot.list_recent_deals
32
- contact_id: "{{contact.id}}"
33
- max: 3
34
- into: deals
35
35
  - agent:
36
36
  prompt: |
37
37
  Compose a Slack alert for the customer-success team. Keep it under
38
38
  12 lines. Include: customer name + company, tier (from contact.tier
39
- if present), recent deal context, what they said, and the ticket
40
- link. End with a single suggested first move.
39
+ if present), what they said, and the ticket link. End with a single
40
+ suggested first move.
41
41
 
42
42
  Contact: {{contact}}
43
- Deals: {{deals}}
44
43
  Summary: {{payload.summary}}
45
44
  Ticket: {{payload.ticket_url}}
46
45
  into: alert
@@ -19,13 +19,18 @@ trigger:
19
19
  path: /meeting-prep
20
20
 
21
21
  steps:
22
- - tool: gmail.search_threads
22
+ - tool: gmail.search
23
23
  query: "from:({{payload.attendees}}) newer_than:7d"
24
24
  max: 10
25
25
  into: recent_threads
26
- - tool: linear.search_issues
27
- query: "{{payload.topic}}"
28
- max: 5
26
+ # linear.list_issues filters by assignee / team / state — there is no
27
+ # free-text topic search in the connector. We pull the user's own
28
+ # started/unstarted issues and let the agent correlate them to the
29
+ # meeting topic. Lossier than a real search, but useful + works
30
+ # without a Linear MCP setup.
31
+ - tool: linear.list_issues
32
+ state: "started,unstarted"
33
+ max: 10
29
34
  into: related_issues
30
35
  - agent:
31
36
  prompt: |
@@ -34,7 +39,8 @@ steps:
34
39
  Topic: {{payload.topic}}
35
40
  Attendees: {{payload.attendees}}
36
41
  Recent email threads with attendees: {{recent_threads}}
37
- Related Linear issues: {{related_issues}}
42
+ My in-flight Linear issues: {{related_issues}}
43
+ — only mention issues that look related to the topic above.
38
44
 
39
45
  Output sections: Context, Open questions, Suggested first move.
40
46
  into: brief
@@ -1,16 +0,0 @@
1
- /**
2
- * `patchwork marketplace` — DEPRECATED.
3
- *
4
- * This subcommand previously fetched a hand-curated registry of "skills" and
5
- * shelled out to `npm install -g <skill-package>`. As of 0.2.0-beta.0 the
6
- * registry contained only built-in skills that already ship inside the bridge,
7
- * pointed at a stale npm package name (`claude-ide-bridge`, not
8
- * `patchwork-os`), and had zero third-party authors. See issue #279 for the
9
- * decision rationale.
10
- *
11
- * The stub is preserved (rather than removed wholesale) so anyone with tooling
12
- * that calls `patchwork marketplace …` gets a clear migration message instead
13
- * of a "unknown subcommand" error. It will be removed in a future major
14
- * release.
15
- */
16
- export declare function runMarketplace(argv: string[]): Promise<void>;
@@ -1,32 +0,0 @@
1
- /**
2
- * `patchwork marketplace` — DEPRECATED.
3
- *
4
- * This subcommand previously fetched a hand-curated registry of "skills" and
5
- * shelled out to `npm install -g <skill-package>`. As of 0.2.0-beta.0 the
6
- * registry contained only built-in skills that already ship inside the bridge,
7
- * pointed at a stale npm package name (`claude-ide-bridge`, not
8
- * `patchwork-os`), and had zero third-party authors. See issue #279 for the
9
- * decision rationale.
10
- *
11
- * The stub is preserved (rather than removed wholesale) so anyone with tooling
12
- * that calls `patchwork marketplace …` gets a clear migration message instead
13
- * of a "unknown subcommand" error. It will be removed in a future major
14
- * release.
15
- */
16
- const DEPRECATION_MESSAGE = `The 'marketplace' command is deprecated and no longer maintained.
17
-
18
- Built-in skills (tdd-loop, ide-coverage, ide-diagnostics-board, ide-explore,
19
- ide-deps) ship inside the bridge package — no installation needed.
20
-
21
- For community content, use the recipe-bundle install path instead:
22
- patchwork recipe install github:<org>/<repo>
23
-
24
- To discover plugins on npm:
25
- npm search keywords:claude-ide-bridge-plugin
26
-
27
- This subcommand will be removed in a future major release. See issue #279.`;
28
- export async function runMarketplace(argv) {
29
- void argv; // intentionally ignored — every subcommand prints the same notice
30
- console.log(DEPRECATION_MESSAGE);
31
- }
32
- //# sourceMappingURL=marketplace.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"marketplace.js","sourceRoot":"","sources":["../../src/commands/marketplace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,mBAAmB,GAAG;;;;;;;;;;;2EAW+C,CAAC;AAE5E,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAc;IACjD,KAAK,IAAI,CAAC,CAAC,kEAAkE;IAC7E,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AACnC,CAAC"}
@@ -1,10 +0,0 @@
1
- export type WarnFn = (msg: string) => void;
2
- /**
3
- * Default deprecation-warning sink for the runtime/validation/fmt callers.
4
- * Forwards to `console.warn` outside of tests so users see migration
5
- * prompts in CLI output, but stays silent under vitest so the dozens of
6
- * intentional legacy-shape regression fixtures don't flood stderr. Tests
7
- * that need to assert warnings still pass their own `vi.fn()` directly.
8
- */
9
- export declare const defaultDeprecationWarn: WarnFn;
10
- export declare function normalizeRecipeForRuntime(recipe: unknown, warn?: WarnFn): unknown;