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

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 (701) 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 +219 -35
  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/connect.d.ts +47 -0
  69. package/dist/commands/connect.js +419 -0
  70. package/dist/commands/connect.js.map +1 -0
  71. package/dist/commands/dashboard.js +8 -1
  72. package/dist/commands/dashboard.js.map +1 -1
  73. package/dist/commands/doctor.d.ts +35 -0
  74. package/dist/commands/doctor.js +51 -0
  75. package/dist/commands/doctor.js.map +1 -0
  76. package/dist/commands/install.js +3 -0
  77. package/dist/commands/install.js.map +1 -1
  78. package/dist/commands/launchd.js +15 -16
  79. package/dist/commands/launchd.js.map +1 -1
  80. package/dist/commands/patchworkInit.d.ts +5 -0
  81. package/dist/commands/patchworkInit.js +89 -7
  82. package/dist/commands/patchworkInit.js.map +1 -1
  83. package/dist/commands/recipe.d.ts +151 -0
  84. package/dist/commands/recipe.js +649 -9
  85. package/dist/commands/recipe.js.map +1 -1
  86. package/dist/commands/recipeInstall.js +11 -4
  87. package/dist/commands/recipeInstall.js.map +1 -1
  88. package/dist/commands/shadowScan.d.ts +34 -0
  89. package/dist/commands/shadowScan.js +142 -0
  90. package/dist/commands/shadowScan.js.map +1 -0
  91. package/dist/commands/task.d.ts +25 -0
  92. package/dist/commands/task.js +62 -42
  93. package/dist/commands/task.js.map +1 -1
  94. package/dist/commands/tools.d.ts +20 -1
  95. package/dist/commands/tools.js +112 -3
  96. package/dist/commands/tools.js.map +1 -1
  97. package/dist/commands/tracesExport.d.ts +15 -1
  98. package/dist/commands/tracesExport.js +39 -5
  99. package/dist/commands/tracesExport.js.map +1 -1
  100. package/dist/commands/tracesImport.js +21 -4
  101. package/dist/commands/tracesImport.js.map +1 -1
  102. package/dist/commitIssueLinkLog.d.ts +16 -0
  103. package/dist/commitIssueLinkLog.js +110 -24
  104. package/dist/commitIssueLinkLog.js.map +1 -1
  105. package/dist/companions/registry.js +15 -7
  106. package/dist/companions/registry.js.map +1 -1
  107. package/dist/config.d.ts +47 -3
  108. package/dist/config.js +111 -21
  109. package/dist/config.js.map +1 -1
  110. package/dist/connectorRoutes.js +1422 -57
  111. package/dist/connectorRoutes.js.map +1 -1
  112. package/dist/connectors/airtable.d.ts +230 -0
  113. package/dist/connectors/airtable.js +700 -0
  114. package/dist/connectors/airtable.js.map +1 -0
  115. package/dist/connectors/asana.js +13 -9
  116. package/dist/connectors/asana.js.map +1 -1
  117. package/dist/connectors/baseConnector.js +25 -3
  118. package/dist/connectors/baseConnector.js.map +1 -1
  119. package/dist/connectors/caldiy.d.ts +137 -0
  120. package/dist/connectors/caldiy.js +424 -0
  121. package/dist/connectors/caldiy.js.map +1 -0
  122. package/dist/connectors/circleci.d.ts +162 -0
  123. package/dist/connectors/circleci.js +576 -0
  124. package/dist/connectors/circleci.js.map +1 -0
  125. package/dist/connectors/cloudflare.d.ts +132 -0
  126. package/dist/connectors/cloudflare.js +622 -0
  127. package/dist/connectors/cloudflare.js.map +1 -0
  128. package/dist/connectors/confluence.js +35 -0
  129. package/dist/connectors/confluence.js.map +1 -1
  130. package/dist/connectors/connectorRedirectUri.d.ts +30 -0
  131. package/dist/connectors/connectorRedirectUri.js +38 -0
  132. package/dist/connectors/connectorRedirectUri.js.map +1 -0
  133. package/dist/connectors/connectorRegistry.d.ts +60 -0
  134. package/dist/connectors/connectorRegistry.js +354 -0
  135. package/dist/connectors/connectorRegistry.js.map +1 -0
  136. package/dist/connectors/datadog.js +41 -5
  137. package/dist/connectors/datadog.js.map +1 -1
  138. package/dist/connectors/discord.js +14 -10
  139. package/dist/connectors/discord.js.map +1 -1
  140. package/dist/connectors/elasticsearch.d.ts +141 -0
  141. package/dist/connectors/elasticsearch.js +601 -0
  142. package/dist/connectors/elasticsearch.js.map +1 -0
  143. package/dist/connectors/figma.d.ts +130 -0
  144. package/dist/connectors/figma.js +387 -0
  145. package/dist/connectors/figma.js.map +1 -0
  146. package/dist/connectors/github.d.ts +17 -0
  147. package/dist/connectors/github.js +53 -2
  148. package/dist/connectors/github.js.map +1 -1
  149. package/dist/connectors/gitlab.js +12 -6
  150. package/dist/connectors/gitlab.js.map +1 -1
  151. package/dist/connectors/gmail.js +72 -21
  152. package/dist/connectors/gmail.js.map +1 -1
  153. package/dist/connectors/googleCalendar.js +8 -8
  154. package/dist/connectors/googleCalendar.js.map +1 -1
  155. package/dist/connectors/googleDocs.d.ts +103 -0
  156. package/dist/connectors/googleDocs.js +409 -0
  157. package/dist/connectors/googleDocs.js.map +1 -0
  158. package/dist/connectors/googleDrive.d.ts +12 -0
  159. package/dist/connectors/googleDrive.js +35 -8
  160. package/dist/connectors/googleDrive.js.map +1 -1
  161. package/dist/connectors/grafana.d.ts +133 -0
  162. package/dist/connectors/grafana.js +478 -0
  163. package/dist/connectors/grafana.js.map +1 -0
  164. package/dist/connectors/jira.d.ts +25 -0
  165. package/dist/connectors/jira.js +234 -3
  166. package/dist/connectors/jira.js.map +1 -1
  167. package/dist/connectors/linear.js +1 -1
  168. package/dist/connectors/linear.js.map +1 -1
  169. package/dist/connectors/mcpClient.js +37 -23
  170. package/dist/connectors/mcpClient.js.map +1 -1
  171. package/dist/connectors/mcpOAuth.js +78 -16
  172. package/dist/connectors/mcpOAuth.js.map +1 -1
  173. package/dist/connectors/monday.d.ts +217 -0
  174. package/dist/connectors/monday.js +655 -0
  175. package/dist/connectors/monday.js.map +1 -0
  176. package/dist/connectors/mongodb.d.ts +139 -0
  177. package/dist/connectors/mongodb.js +455 -0
  178. package/dist/connectors/mongodb.js.map +1 -0
  179. package/dist/connectors/notion.d.ts +1 -1
  180. package/dist/connectors/notion.js +13 -4
  181. package/dist/connectors/notion.js.map +1 -1
  182. package/dist/connectors/oauthStateStore.d.ts +20 -0
  183. package/dist/connectors/oauthStateStore.js +94 -4
  184. package/dist/connectors/oauthStateStore.js.map +1 -1
  185. package/dist/connectors/obsidian.d.ts +83 -0
  186. package/dist/connectors/obsidian.js +441 -0
  187. package/dist/connectors/obsidian.js.map +1 -0
  188. package/dist/connectors/paystack.d.ts +159 -0
  189. package/dist/connectors/paystack.js +607 -0
  190. package/dist/connectors/paystack.js.map +1 -0
  191. package/dist/connectors/pipedrive.d.ts +189 -0
  192. package/dist/connectors/pipedrive.js +559 -0
  193. package/dist/connectors/pipedrive.js.map +1 -0
  194. package/dist/connectors/postgres.d.ts +127 -0
  195. package/dist/connectors/postgres.js +512 -0
  196. package/dist/connectors/postgres.js.map +1 -0
  197. package/dist/connectors/posthog.d.ts +119 -0
  198. package/dist/connectors/posthog.js +479 -0
  199. package/dist/connectors/posthog.js.map +1 -0
  200. package/dist/connectors/redis.d.ts +140 -0
  201. package/dist/connectors/redis.js +579 -0
  202. package/dist/connectors/redis.js.map +1 -0
  203. package/dist/connectors/resend.d.ts +131 -0
  204. package/dist/connectors/resend.js +529 -0
  205. package/dist/connectors/resend.js.map +1 -0
  206. package/dist/connectors/salesforce.d.ts +136 -0
  207. package/dist/connectors/salesforce.js +603 -0
  208. package/dist/connectors/salesforce.js.map +1 -0
  209. package/dist/connectors/secrets.d.ts +51 -0
  210. package/dist/connectors/secrets.js +102 -0
  211. package/dist/connectors/secrets.js.map +1 -0
  212. package/dist/connectors/sendgrid.d.ts +102 -0
  213. package/dist/connectors/sendgrid.js +423 -0
  214. package/dist/connectors/sendgrid.js.map +1 -0
  215. package/dist/connectors/shopify.d.ts +145 -0
  216. package/dist/connectors/shopify.js +502 -0
  217. package/dist/connectors/shopify.js.map +1 -0
  218. package/dist/connectors/slack.d.ts +1 -1
  219. package/dist/connectors/slack.js +61 -9
  220. package/dist/connectors/slack.js.map +1 -1
  221. package/dist/connectors/snowflake.d.ts +119 -0
  222. package/dist/connectors/snowflake.js +633 -0
  223. package/dist/connectors/snowflake.js.map +1 -0
  224. package/dist/connectors/supabase.d.ts +92 -0
  225. package/dist/connectors/supabase.js +630 -0
  226. package/dist/connectors/supabase.js.map +1 -0
  227. package/dist/connectors/todoist.d.ts +117 -0
  228. package/dist/connectors/todoist.js +485 -0
  229. package/dist/connectors/todoist.js.map +1 -0
  230. package/dist/connectors/tokenStorage.js +56 -14
  231. package/dist/connectors/tokenStorage.js.map +1 -1
  232. package/dist/connectors/twilio.d.ts +118 -0
  233. package/dist/connectors/twilio.js +475 -0
  234. package/dist/connectors/twilio.js.map +1 -0
  235. package/dist/connectors/vercel.d.ts +110 -0
  236. package/dist/connectors/vercel.js +479 -0
  237. package/dist/connectors/vercel.js.map +1 -0
  238. package/dist/connectors/webflow.d.ts +118 -0
  239. package/dist/connectors/webflow.js +393 -0
  240. package/dist/connectors/webflow.js.map +1 -0
  241. package/dist/connectors/woocommerce.d.ts +220 -0
  242. package/dist/connectors/woocommerce.js +464 -0
  243. package/dist/connectors/woocommerce.js.map +1 -0
  244. package/dist/crypto.js +7 -2
  245. package/dist/crypto.js.map +1 -1
  246. package/dist/decisionReplay.d.ts +8 -6
  247. package/dist/decisionReplay.js +50 -17
  248. package/dist/decisionReplay.js.map +1 -1
  249. package/dist/decisionTraceLog.d.ts +28 -0
  250. package/dist/decisionTraceLog.js +156 -29
  251. package/dist/decisionTraceLog.js.map +1 -1
  252. package/dist/drivers/claude/api.js +33 -9
  253. package/dist/drivers/claude/api.js.map +1 -1
  254. package/dist/drivers/claude/envSanitizer.d.ts +0 -6
  255. package/dist/drivers/claude/envSanitizer.js +17 -2
  256. package/dist/drivers/claude/envSanitizer.js.map +1 -1
  257. package/dist/drivers/claude/streamParser.js +5 -4
  258. package/dist/drivers/claude/streamParser.js.map +1 -1
  259. package/dist/drivers/claude/subprocess.js +69 -16
  260. package/dist/drivers/claude/subprocess.js.map +1 -1
  261. package/dist/drivers/gemini/index.d.ts +22 -0
  262. package/dist/drivers/gemini/index.js +256 -129
  263. package/dist/drivers/gemini/index.js.map +1 -1
  264. package/dist/drivers/local/index.d.ts +2 -0
  265. package/dist/drivers/local/index.js +12 -0
  266. package/dist/drivers/local/index.js.map +1 -1
  267. package/dist/drivers/openai/index.js +30 -2
  268. package/dist/drivers/openai/index.js.map +1 -1
  269. package/dist/extensionClient.d.ts +37 -4
  270. package/dist/extensionClient.js +58 -16
  271. package/dist/extensionClient.js.map +1 -1
  272. package/dist/featureFlags.d.ts +91 -0
  273. package/dist/featureFlags.js +174 -3
  274. package/dist/featureFlags.js.map +1 -1
  275. package/dist/fileLock.js +21 -12
  276. package/dist/fileLock.js.map +1 -1
  277. package/dist/fileLockSync.d.ts +67 -0
  278. package/dist/fileLockSync.js +126 -0
  279. package/dist/fileLockSync.js.map +1 -0
  280. package/dist/fp/activityAnalytics.js +26 -12
  281. package/dist/fp/activityAnalytics.js.map +1 -1
  282. package/dist/fp/automationInterpreter.d.ts +15 -1
  283. package/dist/fp/automationInterpreter.js +267 -87
  284. package/dist/fp/automationInterpreter.js.map +1 -1
  285. package/dist/fp/automationProgram.d.ts +30 -0
  286. package/dist/fp/automationProgram.js.map +1 -1
  287. package/dist/fp/automationState.d.ts +24 -5
  288. package/dist/fp/automationState.js +56 -9
  289. package/dist/fp/automationState.js.map +1 -1
  290. package/dist/fp/automationUtils.js +1 -1
  291. package/dist/fp/automationUtils.js.map +1 -1
  292. package/dist/fp/commandDescription.js +7 -1
  293. package/dist/fp/commandDescription.js.map +1 -1
  294. package/dist/fp/extensionSnapshot.js +8 -2
  295. package/dist/fp/extensionSnapshot.js.map +1 -1
  296. package/dist/fp/interpreterContext.d.ts +66 -1
  297. package/dist/fp/interpreterContext.js +91 -1
  298. package/dist/fp/interpreterContext.js.map +1 -1
  299. package/dist/fp/policyParser.js +34 -2
  300. package/dist/fp/policyParser.js.map +1 -1
  301. package/dist/fsWatchWithFallback.d.ts +36 -0
  302. package/dist/fsWatchWithFallback.js +128 -0
  303. package/dist/fsWatchWithFallback.js.map +1 -0
  304. package/dist/haltPushDispatch.d.ts +33 -0
  305. package/dist/haltPushDispatch.js +103 -0
  306. package/dist/haltPushDispatch.js.map +1 -0
  307. package/dist/httpBodyValidation.d.ts +41 -0
  308. package/dist/httpBodyValidation.js +45 -0
  309. package/dist/httpBodyValidation.js.map +1 -0
  310. package/dist/inboxRoutes.d.ts +22 -0
  311. package/dist/inboxRoutes.js +61 -1
  312. package/dist/inboxRoutes.js.map +1 -1
  313. package/dist/index.js +1206 -158
  314. package/dist/index.js.map +1 -1
  315. package/dist/installGuard.js +6 -2
  316. package/dist/installGuard.js.map +1 -1
  317. package/dist/localEndpointGuard.d.ts +25 -0
  318. package/dist/localEndpointGuard.js +101 -0
  319. package/dist/localEndpointGuard.js.map +1 -0
  320. package/dist/lockfile.js +31 -4
  321. package/dist/lockfile.js.map +1 -1
  322. package/dist/oauth.d.ts +9 -0
  323. package/dist/oauth.js +33 -0
  324. package/dist/oauth.js.map +1 -1
  325. package/dist/oauthRoutes.d.ts +1 -1
  326. package/dist/oauthRoutes.js +5 -3
  327. package/dist/oauthRoutes.js.map +1 -1
  328. package/dist/orchestrator/childBridgeClient.d.ts +5 -0
  329. package/dist/orchestrator/childBridgeClient.js +28 -1
  330. package/dist/orchestrator/childBridgeClient.js.map +1 -1
  331. package/dist/orchestrator/childBridgeRegistry.js +29 -11
  332. package/dist/orchestrator/childBridgeRegistry.js.map +1 -1
  333. package/dist/orchestrator/orchestratorBridge.d.ts +33 -0
  334. package/dist/orchestrator/orchestratorBridge.js +70 -9
  335. package/dist/orchestrator/orchestratorBridge.js.map +1 -1
  336. package/dist/patchworkConfig.d.ts +44 -1
  337. package/dist/patchworkConfig.js +28 -3
  338. package/dist/patchworkConfig.js.map +1 -1
  339. package/dist/pluginLoader.js +10 -1
  340. package/dist/pluginLoader.js.map +1 -1
  341. package/dist/pluginWatcher.js +12 -14
  342. package/dist/pluginWatcher.js.map +1 -1
  343. package/dist/preToolUseHook.js +3 -2
  344. package/dist/preToolUseHook.js.map +1 -1
  345. package/dist/processTree.d.ts +34 -0
  346. package/dist/processTree.js +105 -0
  347. package/dist/processTree.js.map +1 -0
  348. package/dist/prompts.js +3 -3
  349. package/dist/prompts.js.map +1 -1
  350. package/dist/recipeOrchestration.d.ts +9 -0
  351. package/dist/recipeOrchestration.js +341 -24
  352. package/dist/recipeOrchestration.js.map +1 -1
  353. package/dist/recipeRoutes.d.ts +58 -2
  354. package/dist/recipeRoutes.js +744 -115
  355. package/dist/recipeRoutes.js.map +1 -1
  356. package/dist/recipes/RecipeOrchestrator.d.ts +2 -0
  357. package/dist/recipes/RecipeOrchestrator.js +6 -1
  358. package/dist/recipes/RecipeOrchestrator.js.map +1 -1
  359. package/dist/recipes/agentExecutor.d.ts +25 -5
  360. package/dist/recipes/agentExecutor.js.map +1 -1
  361. package/dist/recipes/chainedRunner.d.ts +2 -0
  362. package/dist/recipes/chainedRunner.js +156 -9
  363. package/dist/recipes/chainedRunner.js.map +1 -1
  364. package/dist/recipes/compiler.js +9 -5
  365. package/dist/recipes/compiler.js.map +1 -1
  366. package/dist/recipes/connectorPreflight.d.ts +66 -0
  367. package/dist/recipes/connectorPreflight.js +169 -0
  368. package/dist/recipes/connectorPreflight.js.map +1 -0
  369. package/dist/recipes/dependencyGraph.d.ts +9 -0
  370. package/dist/recipes/dependencyGraph.js +32 -7
  371. package/dist/recipes/dependencyGraph.js.map +1 -1
  372. package/dist/recipes/githubInstallSource.d.ts +135 -0
  373. package/dist/recipes/githubInstallSource.js +236 -0
  374. package/dist/recipes/githubInstallSource.js.map +1 -0
  375. package/dist/recipes/haltCategory.d.ts +119 -0
  376. package/dist/recipes/haltCategory.js +188 -0
  377. package/dist/recipes/haltCategory.js.map +1 -0
  378. package/dist/recipes/idempotencyKey.d.ts +154 -0
  379. package/dist/recipes/idempotencyKey.js +375 -0
  380. package/dist/recipes/idempotencyKey.js.map +1 -0
  381. package/dist/recipes/installer.js +58 -3
  382. package/dist/recipes/installer.js.map +1 -1
  383. package/dist/recipes/judgeSummary.d.ts +50 -0
  384. package/dist/recipes/judgeSummary.js +47 -0
  385. package/dist/recipes/judgeSummary.js.map +1 -0
  386. package/dist/recipes/judgeVerdict.d.ts +48 -0
  387. package/dist/recipes/judgeVerdict.js +174 -0
  388. package/dist/recipes/judgeVerdict.js.map +1 -0
  389. package/dist/recipes/migrations/index.d.ts +9 -0
  390. package/dist/recipes/migrations/index.js +133 -0
  391. package/dist/recipes/migrations/index.js.map +1 -1
  392. package/dist/recipes/names.d.ts +20 -0
  393. package/dist/recipes/names.js +25 -0
  394. package/dist/recipes/names.js.map +1 -1
  395. package/dist/recipes/parser.js +116 -6
  396. package/dist/recipes/parser.js.map +1 -1
  397. package/dist/recipes/replayRun.js +1 -1
  398. package/dist/recipes/replayRun.js.map +1 -1
  399. package/dist/recipes/runBudget.d.ts +70 -0
  400. package/dist/recipes/runBudget.js +109 -0
  401. package/dist/recipes/runBudget.js.map +1 -0
  402. package/dist/recipes/scheduler.d.ts +30 -0
  403. package/dist/recipes/scheduler.js +69 -19
  404. package/dist/recipes/scheduler.js.map +1 -1
  405. package/dist/recipes/schema.d.ts +65 -2
  406. package/dist/recipes/schemaGenerator.js +119 -7
  407. package/dist/recipes/schemaGenerator.js.map +1 -1
  408. package/dist/recipes/stepObservation.js +9 -0
  409. package/dist/recipes/stepObservation.js.map +1 -1
  410. package/dist/recipes/toolRegistry.js +33 -7
  411. package/dist/recipes/toolRegistry.js.map +1 -1
  412. package/dist/recipes/tools/airtable.d.ts +15 -0
  413. package/dist/recipes/tools/airtable.js +239 -0
  414. package/dist/recipes/tools/airtable.js.map +1 -0
  415. package/dist/recipes/tools/fanOut.d.ts +20 -0
  416. package/dist/recipes/tools/fanOut.js +199 -0
  417. package/dist/recipes/tools/fanOut.js.map +1 -0
  418. package/dist/recipes/tools/file.js +5 -2
  419. package/dist/recipes/tools/file.js.map +1 -1
  420. package/dist/recipes/tools/github.d.ts +1 -1
  421. package/dist/recipes/tools/github.js +75 -1
  422. package/dist/recipes/tools/github.js.map +1 -1
  423. package/dist/recipes/tools/gmail.js +27 -5
  424. package/dist/recipes/tools/gmail.js.map +1 -1
  425. package/dist/recipes/tools/googleDrive.js +64 -0
  426. package/dist/recipes/tools/googleDrive.js.map +1 -1
  427. package/dist/recipes/tools/http.d.ts +10 -0
  428. package/dist/recipes/tools/http.js +176 -0
  429. package/dist/recipes/tools/http.js.map +1 -0
  430. package/dist/recipes/tools/index.d.ts +7 -0
  431. package/dist/recipes/tools/index.js +7 -0
  432. package/dist/recipes/tools/index.js.map +1 -1
  433. package/dist/recipes/tools/resend.d.ts +8 -0
  434. package/dist/recipes/tools/resend.js +152 -0
  435. package/dist/recipes/tools/resend.js.map +1 -0
  436. package/dist/recipes/tools/sendgrid.d.ts +9 -0
  437. package/dist/recipes/tools/sendgrid.js +174 -0
  438. package/dist/recipes/tools/sendgrid.js.map +1 -0
  439. package/dist/recipes/tools/slack.js +1 -1
  440. package/dist/recipes/tools/twilio.d.ts +11 -0
  441. package/dist/recipes/tools/twilio.js +179 -0
  442. package/dist/recipes/tools/twilio.js.map +1 -0
  443. package/dist/recipes/tools/vercel.d.ts +9 -0
  444. package/dist/recipes/tools/vercel.js +145 -0
  445. package/dist/recipes/tools/vercel.js.map +1 -0
  446. package/dist/recipes/validation.d.ts +17 -0
  447. package/dist/recipes/validation.js +141 -11
  448. package/dist/recipes/validation.js.map +1 -1
  449. package/dist/recipes/workspaceRoot.d.ts +37 -0
  450. package/dist/recipes/workspaceRoot.js +73 -0
  451. package/dist/recipes/workspaceRoot.js.map +1 -0
  452. package/dist/recipes/yamlPositions.d.ts +56 -0
  453. package/dist/recipes/yamlPositions.js +183 -0
  454. package/dist/recipes/yamlPositions.js.map +1 -0
  455. package/dist/recipes/yamlRunner.d.ts +185 -8
  456. package/dist/recipes/yamlRunner.js +967 -224
  457. package/dist/recipes/yamlRunner.js.map +1 -1
  458. package/dist/recipesHttp.d.ts +19 -3
  459. package/dist/recipesHttp.js +67 -11
  460. package/dist/recipesHttp.js.map +1 -1
  461. package/dist/resources.js +21 -13
  462. package/dist/resources.js.map +1 -1
  463. package/dist/runLog.d.ts +58 -5
  464. package/dist/runLog.js +98 -21
  465. package/dist/runLog.js.map +1 -1
  466. package/dist/sanitizeParsedJson.d.ts +39 -0
  467. package/dist/sanitizeParsedJson.js +55 -0
  468. package/dist/sanitizeParsedJson.js.map +1 -0
  469. package/dist/schemas/recipe.v1.json +887 -198
  470. package/dist/server.d.ts +160 -3
  471. package/dist/server.js +1099 -122
  472. package/dist/server.js.map +1 -1
  473. package/dist/sessionCheckpoint.d.ts +8 -0
  474. package/dist/sessionCheckpoint.js +33 -3
  475. package/dist/sessionCheckpoint.js.map +1 -1
  476. package/dist/ssrfGuard.d.ts +16 -0
  477. package/dist/ssrfGuard.js +87 -4
  478. package/dist/ssrfGuard.js.map +1 -1
  479. package/dist/streamableHttp.d.ts +9 -4
  480. package/dist/streamableHttp.js +76 -20
  481. package/dist/streamableHttp.js.map +1 -1
  482. package/dist/telemetry.js +37 -19
  483. package/dist/telemetry.js.map +1 -1
  484. package/dist/testing/shadowRun.d.ts +52 -0
  485. package/dist/testing/shadowRun.js +71 -0
  486. package/dist/testing/shadowRun.js.map +1 -0
  487. package/dist/tools/batchLsp.d.ts +3 -0
  488. package/dist/tools/bridgeDoctor.d.ts +11 -0
  489. package/dist/tools/bridgeDoctor.js +48 -2
  490. package/dist/tools/bridgeDoctor.js.map +1 -1
  491. package/dist/tools/bridgeStatus.d.ts +0 -12
  492. package/dist/tools/bridgeStatus.js +2 -28
  493. package/dist/tools/bridgeStatus.js.map +1 -1
  494. package/dist/tools/cancelClaudeTask.d.ts +1 -0
  495. package/dist/tools/clipboard.d.ts +2 -0
  496. package/dist/tools/closeTabs.d.ts +1 -0
  497. package/dist/tools/codeLens.d.ts +1 -0
  498. package/dist/tools/createIssueFromAIComment.d.ts +1 -0
  499. package/dist/tools/ctxGetTaskContext.d.ts +9 -0
  500. package/dist/tools/ctxGetTaskContext.js +50 -2
  501. package/dist/tools/ctxGetTaskContext.js.map +1 -1
  502. package/dist/tools/ctxQueryTraces.js +32 -24
  503. package/dist/tools/ctxQueryTraces.js.map +1 -1
  504. package/dist/tools/ctxSaveTrace.d.ts +1 -0
  505. package/dist/tools/debug.d.ts +4 -0
  506. package/dist/tools/decorations.d.ts +2 -0
  507. package/dist/tools/detectUnusedCode.js +9 -7
  508. package/dist/tools/detectUnusedCode.js.map +1 -1
  509. package/dist/tools/documentLinks.d.ts +1 -0
  510. package/dist/tools/editText.d.ts +1 -0
  511. package/dist/tools/editText.js +2 -1
  512. package/dist/tools/editText.js.map +1 -1
  513. package/dist/tools/enrichCommit.d.ts +1 -0
  514. package/dist/tools/enrichStackTrace.js +11 -5
  515. package/dist/tools/enrichStackTrace.js.map +1 -1
  516. package/dist/tools/explainDiagnostic.d.ts +1 -0
  517. package/dist/tools/explainSymbol.d.ts +1 -0
  518. package/dist/tools/fileOperations.d.ts +3 -0
  519. package/dist/tools/fileOperations.js +2 -1
  520. package/dist/tools/fileOperations.js.map +1 -1
  521. package/dist/tools/fileWatcher.d.ts +2 -0
  522. package/dist/tools/fileWatcher.js +8 -2
  523. package/dist/tools/fileWatcher.js.map +1 -1
  524. package/dist/tools/findFiles.d.ts +1 -0
  525. package/dist/tools/fixAllLintErrors.d.ts +1 -0
  526. package/dist/tools/fixAllLintErrors.js +10 -5
  527. package/dist/tools/fixAllLintErrors.js.map +1 -1
  528. package/dist/tools/foldingRanges.d.ts +1 -0
  529. package/dist/tools/formatDocument.d.ts +1 -0
  530. package/dist/tools/formatDocument.js +10 -5
  531. package/dist/tools/formatDocument.js.map +1 -1
  532. package/dist/tools/generateTests.d.ts +1 -0
  533. package/dist/tools/getAIComments.d.ts +1 -0
  534. package/dist/tools/getAnalyticsReport.js +5 -1
  535. package/dist/tools/getAnalyticsReport.js.map +1 -1
  536. package/dist/tools/getBufferContent.d.ts +1 -0
  537. package/dist/tools/getChangeImpact.d.ts +1 -0
  538. package/dist/tools/getChangeImpact.js +23 -14
  539. package/dist/tools/getChangeImpact.js.map +1 -1
  540. package/dist/tools/getClaudeTaskStatus.d.ts +1 -0
  541. package/dist/tools/getCodeCoverage.d.ts +1 -0
  542. package/dist/tools/getCodeCoverage.js +32 -14
  543. package/dist/tools/getCodeCoverage.js.map +1 -1
  544. package/dist/tools/getCommitsForIssue.d.ts +1 -0
  545. package/dist/tools/getDebugState.d.ts +1 -0
  546. package/dist/tools/getDiagnostics.js +32 -29
  547. package/dist/tools/getDiagnostics.js.map +1 -1
  548. package/dist/tools/getDiffFromHandoff.js +8 -2
  549. package/dist/tools/getDiffFromHandoff.js.map +1 -1
  550. package/dist/tools/getDocumentSymbols.d.ts +1 -0
  551. package/dist/tools/getGitHotspots.d.ts +1 -0
  552. package/dist/tools/getGitStatus.js +6 -1
  553. package/dist/tools/getGitStatus.js.map +1 -1
  554. package/dist/tools/getImportedSignatures.d.ts +1 -0
  555. package/dist/tools/getImportedSignatures.js +18 -14
  556. package/dist/tools/getImportedSignatures.js.map +1 -1
  557. package/dist/tools/getPRTemplate.d.ts +1 -0
  558. package/dist/tools/getProjectContext.js +23 -10
  559. package/dist/tools/getProjectContext.js.map +1 -1
  560. package/dist/tools/getSymbolHistory.d.ts +1 -0
  561. package/dist/tools/getToolCapabilities.d.ts +10 -5
  562. package/dist/tools/getToolCapabilities.js +116 -204
  563. package/dist/tools/getToolCapabilities.js.map +1 -1
  564. package/dist/tools/getTypeSignature.d.ts +1 -0
  565. package/dist/tools/getWorkspaceSettings.d.ts +1 -0
  566. package/dist/tools/gitWrite.d.ts +11 -0
  567. package/dist/tools/github/actions.d.ts +2 -0
  568. package/dist/tools/github/composite.d.ts +4 -1
  569. package/dist/tools/github/composite.js +7 -7
  570. package/dist/tools/github/composite.js.map +1 -1
  571. package/dist/tools/github/issues.d.ts +4 -0
  572. package/dist/tools/github/pr.d.ts +13 -6
  573. package/dist/tools/github/pr.js +18 -11
  574. package/dist/tools/github/pr.js.map +1 -1
  575. package/dist/tools/handoffNote.d.ts +1 -0
  576. package/dist/tools/handoffNote.js +2 -1
  577. package/dist/tools/handoffNote.js.map +1 -1
  578. package/dist/tools/headless/lspClient.js +3 -0
  579. package/dist/tools/headless/lspClient.js.map +1 -1
  580. package/dist/tools/hoverAtCursor.d.ts +1 -0
  581. package/dist/tools/httpClient.d.ts +2 -0
  582. package/dist/tools/httpClient.js +38 -71
  583. package/dist/tools/httpClient.js.map +1 -1
  584. package/dist/tools/index.js +14 -10
  585. package/dist/tools/index.js.map +1 -1
  586. package/dist/tools/inlayHints.d.ts +1 -0
  587. package/dist/tools/launchQuickTask.d.ts +1 -0
  588. package/dist/tools/listClaudeTasks.d.ts +1 -0
  589. package/dist/tools/listClaudeTasks.js +10 -8
  590. package/dist/tools/listClaudeTasks.js.map +1 -1
  591. package/dist/tools/listTerminals.d.ts +1 -0
  592. package/dist/tools/lsp.d.ts +15 -0
  593. package/dist/tools/lsp.js +17 -0
  594. package/dist/tools/lsp.js.map +1 -1
  595. package/dist/tools/navigateToSymbolByName.d.ts +1 -0
  596. package/dist/tools/openDiff.d.ts +1 -0
  597. package/dist/tools/openDiff.js +4 -1
  598. package/dist/tools/openDiff.js.map +1 -1
  599. package/dist/tools/openFile.d.ts +1 -0
  600. package/dist/tools/openFile.js +4 -1
  601. package/dist/tools/openFile.js.map +1 -1
  602. package/dist/tools/openInBrowser.js +6 -1
  603. package/dist/tools/openInBrowser.js.map +1 -1
  604. package/dist/tools/organizeImports.d.ts +1 -0
  605. package/dist/tools/organizeImports.js +5 -3
  606. package/dist/tools/organizeImports.js.map +1 -1
  607. package/dist/tools/performanceReport.js +5 -3
  608. package/dist/tools/performanceReport.js.map +1 -1
  609. package/dist/tools/planPersistence.d.ts +3 -0
  610. package/dist/tools/planPersistence.js +4 -1
  611. package/dist/tools/planPersistence.js.map +1 -1
  612. package/dist/tools/previewEdit.d.ts +1 -0
  613. package/dist/tools/previewEdit.js +31 -5
  614. package/dist/tools/previewEdit.js.map +1 -1
  615. package/dist/tools/recentTracesDigest.js +54 -11
  616. package/dist/tools/recentTracesDigest.js.map +1 -1
  617. package/dist/tools/refactorAnalyze.d.ts +1 -0
  618. package/dist/tools/refactorExtractFunction.js +4 -1
  619. package/dist/tools/refactorExtractFunction.js.map +1 -1
  620. package/dist/tools/refactorPreview.d.ts +1 -0
  621. package/dist/tools/refactorPreview.js +10 -2
  622. package/dist/tools/refactorPreview.js.map +1 -1
  623. package/dist/tools/replaceBlock.d.ts +1 -0
  624. package/dist/tools/replaceBlock.js +2 -1
  625. package/dist/tools/replaceBlock.js.map +1 -1
  626. package/dist/tools/resumeClaudeTask.d.ts +1 -0
  627. package/dist/tools/runClaudeTask.d.ts +1 -0
  628. package/dist/tools/runTests.js +15 -4
  629. package/dist/tools/runTests.js.map +1 -1
  630. package/dist/tools/screenshot.d.ts +1 -0
  631. package/dist/tools/screenshotAndAnnotate.js +6 -2
  632. package/dist/tools/screenshotAndAnnotate.js.map +1 -1
  633. package/dist/tools/searchAndReplace.d.ts +1 -0
  634. package/dist/tools/searchAndReplace.js +21 -12
  635. package/dist/tools/searchAndReplace.js.map +1 -1
  636. package/dist/tools/searchTools.d.ts +26 -0
  637. package/dist/tools/searchTools.js +62 -21
  638. package/dist/tools/searchTools.js.map +1 -1
  639. package/dist/tools/searchWorkspace.d.ts +1 -0
  640. package/dist/tools/selectionRanges.d.ts +1 -0
  641. package/dist/tools/semanticTokens.d.ts +1 -0
  642. package/dist/tools/signatureHelp.d.ts +1 -0
  643. package/dist/tools/spawnWorkspace.js +15 -7
  644. package/dist/tools/spawnWorkspace.js.map +1 -1
  645. package/dist/tools/terminal.d.ts +6 -0
  646. package/dist/tools/testRunners/pytest.js +6 -2
  647. package/dist/tools/testRunners/pytest.js.map +1 -1
  648. package/dist/tools/testRunners/vitestJest.js +3 -1
  649. package/dist/tools/testRunners/vitestJest.js.map +1 -1
  650. package/dist/tools/testTraceToSource.d.ts +1 -0
  651. package/dist/tools/transaction.d.ts +13 -1
  652. package/dist/tools/transaction.js +63 -5
  653. package/dist/tools/transaction.js.map +1 -1
  654. package/dist/tools/typeHierarchy.d.ts +1 -0
  655. package/dist/tools/utils.d.ts +33 -0
  656. package/dist/tools/utils.js +122 -18
  657. package/dist/tools/utils.js.map +1 -1
  658. package/dist/tools/vscodeCommands.d.ts +2 -0
  659. package/dist/tools/vscodeTasks.d.ts +2 -0
  660. package/dist/tools/workspaceSettings.d.ts +1 -0
  661. package/dist/transport.d.ts +3 -1
  662. package/dist/transport.js +126 -52
  663. package/dist/transport.js.map +1 -1
  664. package/dist/winShim.d.ts +34 -0
  665. package/dist/winShim.js +94 -0
  666. package/dist/winShim.js.map +1 -0
  667. package/dist/wireHaltPushDispatch.d.ts +38 -0
  668. package/dist/wireHaltPushDispatch.js +71 -0
  669. package/dist/wireHaltPushDispatch.js.map +1 -0
  670. package/dist/writeFileAtomic.d.ts +23 -0
  671. package/dist/writeFileAtomic.js +121 -0
  672. package/dist/writeFileAtomic.js.map +1 -0
  673. package/package.json +23 -7
  674. package/scripts/postinstall.mjs +42 -2
  675. package/scripts/smoke/run-all.mjs +213 -0
  676. package/scripts/start-all.mjs +572 -0
  677. package/scripts/start-all.ps1 +209 -0
  678. package/scripts/start-all.sh +73 -17
  679. package/scripts/start-orchestrator.ps1 +158 -0
  680. package/scripts/start-remote.mjs +122 -0
  681. package/templates/automation-policies/recipe-authoring.json +1 -1
  682. package/templates/automation-policies/security-first.json +1 -1
  683. package/templates/automation-policies/strict-lint.json +1 -1
  684. package/templates/automation-policies/test-driven.json +1 -1
  685. package/templates/automation-policy.example.json +1 -1
  686. package/templates/co.patchwork-os.bridge.plist +2 -2
  687. package/templates/recipes/approval-queue-ui-test.yaml +1 -1
  688. package/templates/recipes/ctx-loop-test.yaml +1 -1
  689. package/templates/recipes/fix-errors-on-save.yaml +71 -0
  690. package/templates/recipes/morning-brief.yaml +5 -2
  691. package/templates/recipes/project-health-check.yaml +4 -1
  692. package/templates/recipes/sentry-to-linear.yaml +72 -38
  693. package/templates/recipes/webhook/apple-watch-health-log.yaml +145 -0
  694. package/templates/recipes/webhook/customer-escalation.yaml +8 -9
  695. package/templates/recipes/webhook/meeting-prep.yaml +11 -5
  696. package/dist/commands/marketplace.d.ts +0 -16
  697. package/dist/commands/marketplace.js +0 -32
  698. package/dist/commands/marketplace.js.map +0 -1
  699. package/dist/recipes/legacyRecipeCompat.d.ts +0 -10
  700. package/dist/recipes/legacyRecipeCompat.js +0 -131
  701. package/dist/recipes/legacyRecipeCompat.js.map +0 -1
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Judge-verdict aggregation — PR3b.
3
+ *
4
+ * Parallel to haltCategory.summariseHalts: walks a window of runs and
5
+ * counts judge-step verdicts (`approve` / `request_changes` /
6
+ * `unparseable`). Surfaces through:
7
+ *
8
+ * - `/metrics` as `bridge_recipe_judgments{verdict="..."}` gauge
9
+ * - (later) dashboard panel + session-start digest in PR3c
10
+ *
11
+ * Augment-only invariant (see judgeVerdict.ts): a `request_changes`
12
+ * verdict never appears as a HaltCategory and never causes
13
+ * `status: "error"`. This module is the *separate* channel that makes
14
+ * cold-eyes review visible without re-introducing gate semantics.
15
+ */
16
+ import type { JudgeVerdict, JudgeVerdictKind } from "./judgeVerdict.js";
17
+ export interface JudgeSummary {
18
+ /** Total step results scanned that carry a `judgeVerdict`. */
19
+ total: number;
20
+ /** Per-verdict counts; verdicts with zero hits are omitted. */
21
+ byVerdict: Partial<Record<JudgeVerdictKind, number>>;
22
+ /** Most recent 5 verdicts (with first reason) for UI surfacing. */
23
+ recent: Array<{
24
+ verdict: JudgeVerdictKind;
25
+ firstReason?: string;
26
+ runSeq: number;
27
+ stepId: string;
28
+ }>;
29
+ }
30
+ interface JudgeSummaryInputRun {
31
+ seq: number;
32
+ stepResults?: Array<{
33
+ id: string;
34
+ judgeVerdict?: JudgeVerdict;
35
+ }>;
36
+ }
37
+ /**
38
+ * Aggregate judge verdicts across a set of runs. Runs are expected to
39
+ * be sorted newest-first so `recent` reflects the most recent
40
+ * verdicts.
41
+ */
42
+ export declare function summariseJudgments(runs: JudgeSummaryInputRun[]): JudgeSummary;
43
+ /**
44
+ * Format a `JudgeSummary` as Prometheus text-exposition lines for the
45
+ * `bridge_recipe_judgments{verdict="..."} N` gauge. Returns an empty
46
+ * array when the summary is empty (no HELP/TYPE block so Prom scrapers
47
+ * don't see an orphan declaration).
48
+ */
49
+ export declare function judgeSummaryToPrometheus(summary: JudgeSummary): string[];
50
+ export {};
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Aggregate judge verdicts across a set of runs. Runs are expected to
3
+ * be sorted newest-first so `recent` reflects the most recent
4
+ * verdicts.
5
+ */
6
+ export function summariseJudgments(runs) {
7
+ const byVerdict = {};
8
+ const recent = [];
9
+ let total = 0;
10
+ for (const run of runs) {
11
+ for (const step of run.stepResults ?? []) {
12
+ const v = step.judgeVerdict;
13
+ if (!v)
14
+ continue;
15
+ total++;
16
+ byVerdict[v.verdict] = (byVerdict[v.verdict] ?? 0) + 1;
17
+ if (recent.length < 5) {
18
+ recent.push({
19
+ verdict: v.verdict,
20
+ ...(v.reasons[0] !== undefined && { firstReason: v.reasons[0] }),
21
+ runSeq: run.seq,
22
+ stepId: step.id,
23
+ });
24
+ }
25
+ }
26
+ }
27
+ return { total, byVerdict, recent };
28
+ }
29
+ /**
30
+ * Format a `JudgeSummary` as Prometheus text-exposition lines for the
31
+ * `bridge_recipe_judgments{verdict="..."} N` gauge. Returns an empty
32
+ * array when the summary is empty (no HELP/TYPE block so Prom scrapers
33
+ * don't see an orphan declaration).
34
+ */
35
+ export function judgeSummaryToPrometheus(summary) {
36
+ if (summary.total === 0)
37
+ return [];
38
+ const lines = [
39
+ "# HELP bridge_recipe_judgments Recipe judge-step verdicts in the in-memory run-log window, by verdict",
40
+ "# TYPE bridge_recipe_judgments gauge",
41
+ ];
42
+ for (const [verdict, count] of Object.entries(summary.byVerdict)) {
43
+ lines.push(`bridge_recipe_judgments{verdict="${verdict}"} ${count}`);
44
+ }
45
+ return lines;
46
+ }
47
+ //# sourceMappingURL=judgeSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judgeSummary.js","sourceRoot":"","sources":["../../src/recipes/judgeSummary.ts"],"names":[],"mappings":"AAuCA;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAA4B;IAC7D,MAAM,SAAS,GAA8C,EAAE,CAAC;IAChE,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC;YACzC,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;YAC5B,IAAI,CAAC,CAAC;gBAAE,SAAS;YACjB,KAAK,EAAE,CAAC;YACR,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YACvD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACtB,MAAM,CAAC,IAAI,CAAC;oBACV,OAAO,EAAE,CAAC,CAAC,OAAO;oBAClB,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;oBAChE,MAAM,EAAE,GAAG,CAAC,GAAG;oBACf,MAAM,EAAE,IAAI,CAAC,EAAE;iBAChB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAqB;IAC5D,IAAI,OAAO,CAAC,KAAK,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,MAAM,KAAK,GAAa;QACtB,uGAAuG;QACvG,sCAAsC;KACvC,CAAC;IACF,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACjE,KAAK,CAAC,IAAI,CAAC,oCAAoC,OAAO,MAAM,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Judge verdict — PR3a.
3
+ *
4
+ * Parses a free-form agent response into a structured `JudgeVerdict`.
5
+ * The judge prompt convention asks the model to end its response with
6
+ * a JSON object of the form:
7
+ *
8
+ * {"verdict": "approve" | "request_changes",
9
+ * "reasons": ["..."],
10
+ * "fixList": ["..."]}
11
+ *
12
+ * The parser walks back from the end of the string, finds the last
13
+ * JSON object, and validates its shape. On any failure we record the
14
+ * verdict as `unparseable` and keep the raw text — the runner *never*
15
+ * throws on a malformed judge response.
16
+ *
17
+ * **Augment-only invariant** — see the file-level comment in
18
+ * yamlRunner.ts. The verdict shape is intentionally separate from
19
+ * `StepResult.status`: a `request_changes` verdict produces
20
+ * `status: "ok"` with a stashed verdict, never `status: "error"`.
21
+ * That separation is what prevents the judge step from quietly
22
+ * becoming a gate.
23
+ */
24
+ export type JudgeVerdictKind = "approve" | "request_changes" | "unparseable";
25
+ export interface JudgeVerdict {
26
+ verdict: JudgeVerdictKind;
27
+ /** Short bullet points; empty when unparseable. */
28
+ reasons: string[];
29
+ /** Optional fix-list when `verdict: "request_changes"`. */
30
+ fixList?: string[];
31
+ /** Original model text when parsing failed (or for audit). */
32
+ raw?: string;
33
+ }
34
+ /**
35
+ * Append to the judge prompt to elicit the structured tail. Kept short
36
+ * so it doesn't crowd out the user-provided prompt body.
37
+ */
38
+ export declare const JUDGE_PROMPT_SUFFIX = "\n\nYou are a cold-eyes reviewer. Respond with a brief assessment, then end\nwith a single JSON object on its own line:\n\n{\"verdict\": \"approve\" | \"request_changes\", \"reasons\": [\"...\"], \"fixList\": [\"...\"]}\n\nThe \"fixList\" is optional and only relevant when requesting changes.\nOutput only the JSON object as the final line.";
39
+ /**
40
+ * Build the artefact-injection block for a judge step that has a
41
+ * `reviews: <stepId>` reference. Returns an empty string when no
42
+ * artefact is available; the judge then sees the prompt as-is.
43
+ */
44
+ export declare function buildJudgeArtefactBlock(artefact: unknown): string;
45
+ /**
46
+ * Parse an agent response into a `JudgeVerdict`. Never throws.
47
+ */
48
+ export declare function parseJudgeVerdict(text: string): JudgeVerdict;
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Judge verdict — PR3a.
3
+ *
4
+ * Parses a free-form agent response into a structured `JudgeVerdict`.
5
+ * The judge prompt convention asks the model to end its response with
6
+ * a JSON object of the form:
7
+ *
8
+ * {"verdict": "approve" | "request_changes",
9
+ * "reasons": ["..."],
10
+ * "fixList": ["..."]}
11
+ *
12
+ * The parser walks back from the end of the string, finds the last
13
+ * JSON object, and validates its shape. On any failure we record the
14
+ * verdict as `unparseable` and keep the raw text — the runner *never*
15
+ * throws on a malformed judge response.
16
+ *
17
+ * **Augment-only invariant** — see the file-level comment in
18
+ * yamlRunner.ts. The verdict shape is intentionally separate from
19
+ * `StepResult.status`: a `request_changes` verdict produces
20
+ * `status: "ok"` with a stashed verdict, never `status: "error"`.
21
+ * That separation is what prevents the judge step from quietly
22
+ * becoming a gate.
23
+ */
24
+ /**
25
+ * Append to the judge prompt to elicit the structured tail. Kept short
26
+ * so it doesn't crowd out the user-provided prompt body.
27
+ */
28
+ export const JUDGE_PROMPT_SUFFIX = `
29
+
30
+ You are a cold-eyes reviewer. Respond with a brief assessment, then end
31
+ with a single JSON object on its own line:
32
+
33
+ {"verdict": "approve" | "request_changes", "reasons": ["..."], "fixList": ["..."]}
34
+
35
+ The "fixList" is optional and only relevant when requesting changes.
36
+ Output only the JSON object as the final line.`;
37
+ /**
38
+ * Build the artefact-injection block for a judge step that has a
39
+ * `reviews: <stepId>` reference. Returns an empty string when no
40
+ * artefact is available; the judge then sees the prompt as-is.
41
+ */
42
+ export function buildJudgeArtefactBlock(artefact) {
43
+ if (artefact === undefined || artefact === null)
44
+ return "";
45
+ let body;
46
+ if (typeof artefact === "string") {
47
+ body = artefact;
48
+ }
49
+ else {
50
+ try {
51
+ body = JSON.stringify(artefact, null, 2);
52
+ // `JSON.stringify` returns `undefined` for functions / symbols /
53
+ // top-level BigInt — the artefact block becomes
54
+ // `<artefact>\nundefined\n</artefact>` which is misleading. Fall
55
+ // back to a marker so downstream readers can spot the gap.
56
+ if (body === undefined)
57
+ body = "[unserialisable artefact]";
58
+ }
59
+ catch {
60
+ // Circular references, BigInt inside the object graph, or any
61
+ // toJSON throwing. The judge step must never propagate this out
62
+ // of the prompt builder — augment-only invariant.
63
+ body = "[unserialisable artefact]";
64
+ }
65
+ }
66
+ return `\n\n<artefact>\n${body}\n</artefact>`;
67
+ }
68
+ /**
69
+ * Walk `text` forward and emit `[start, endInclusive]` ranges for every
70
+ * balanced top-level `{...}` block, respecting JSON string syntax so a
71
+ * `}` inside a string doesn't offset the brace depth.
72
+ *
73
+ * The original implementation walked back from `lastIndexOf("}")` and
74
+ * counted braces literally. A judge response of the shape
75
+ * `Consider this snippet: { x: "} oops" }` would be miscounted — the
76
+ * `}` inside the string would close depth too early and the candidate
77
+ * slice would JSON.parse-fail, returning `unparseable` for an
78
+ * otherwise-legitimate verdict trailer.
79
+ */
80
+ function findBalancedObjectRanges(text) {
81
+ const ranges = [];
82
+ let depth = 0;
83
+ let start = -1;
84
+ let inString = false;
85
+ let escaped = false;
86
+ for (let i = 0; i < text.length; i++) {
87
+ const ch = text[i];
88
+ if (inString) {
89
+ if (escaped) {
90
+ escaped = false;
91
+ }
92
+ else if (ch === "\\") {
93
+ escaped = true;
94
+ }
95
+ else if (ch === '"') {
96
+ inString = false;
97
+ }
98
+ continue;
99
+ }
100
+ if (ch === '"') {
101
+ inString = true;
102
+ continue;
103
+ }
104
+ if (ch === "{") {
105
+ if (depth === 0)
106
+ start = i;
107
+ depth++;
108
+ }
109
+ else if (ch === "}") {
110
+ depth--;
111
+ if (depth === 0 && start !== -1) {
112
+ ranges.push([start, i]);
113
+ start = -1;
114
+ }
115
+ if (depth < 0) {
116
+ // Stray closing brace — reset so we don't underflow.
117
+ depth = 0;
118
+ start = -1;
119
+ }
120
+ }
121
+ }
122
+ return ranges;
123
+ }
124
+ /**
125
+ * Parse an agent response into a `JudgeVerdict`. Never throws.
126
+ */
127
+ export function parseJudgeVerdict(text) {
128
+ const trimmed = text.trim();
129
+ if (trimmed.length === 0) {
130
+ return {
131
+ verdict: "unparseable",
132
+ reasons: [],
133
+ raw: text,
134
+ };
135
+ }
136
+ // Collect every balanced `{...}` range, then try them last-to-first
137
+ // so the JSON tail wins over an in-prose snippet earlier in the
138
+ // response.
139
+ const ranges = findBalancedObjectRanges(trimmed);
140
+ for (let i = ranges.length - 1; i >= 0; i--) {
141
+ const range = ranges[i];
142
+ if (!range)
143
+ continue;
144
+ const [s, e] = range;
145
+ const candidate = trimmed.slice(s, e + 1);
146
+ let parsed;
147
+ try {
148
+ parsed = JSON.parse(candidate);
149
+ }
150
+ catch {
151
+ continue;
152
+ }
153
+ if (!parsed || typeof parsed !== "object")
154
+ continue;
155
+ const obj = parsed;
156
+ const verdictRaw = obj.verdict;
157
+ if (verdictRaw !== "approve" && verdictRaw !== "request_changes") {
158
+ continue;
159
+ }
160
+ const reasons = Array.isArray(obj.reasons)
161
+ ? obj.reasons.filter((r) => typeof r === "string")
162
+ : [];
163
+ const fixList = Array.isArray(obj.fixList)
164
+ ? obj.fixList.filter((r) => typeof r === "string")
165
+ : undefined;
166
+ return {
167
+ verdict: verdictRaw,
168
+ reasons,
169
+ ...(fixList && fixList.length > 0 && { fixList }),
170
+ };
171
+ }
172
+ return { verdict: "unparseable", reasons: [], raw: text };
173
+ }
174
+ //# sourceMappingURL=judgeVerdict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judgeVerdict.js","sourceRoot":"","sources":["../../src/recipes/judgeVerdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAcH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;+CAQY,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAiB;IACvD,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAC3D,IAAI,IAAY,CAAC;IACjB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAI,GAAG,QAAQ,CAAC;IAClB,CAAC;SAAM,CAAC;QACN,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACzC,iEAAiE;YACjE,gDAAgD;YAChD,iEAAiE;YACjE,2DAA2D;YAC3D,IAAI,IAAI,KAAK,SAAS;gBAAE,IAAI,GAAG,2BAA2B,CAAC;QAC7D,CAAC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QAAQ;YAAE,SAAS;QACpD,MAAM,GAAG,GAAG,MAAiC,CAAC;QAC9C,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC;QAC/B,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,iBAAiB,EAAE,CAAC;YACjE,SAAS;QACX,CAAC;QACD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;YACxC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;YAC/D,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;YACxC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;YAC/D,CAAC,CAAC,SAAS,CAAC;QACd,OAAO;YACL,OAAO,EAAE,UAAU;YACnB,OAAO;YACP,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC;SAClD,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAC5D,CAAC"}
@@ -1,6 +1,14 @@
1
1
  import type { WarnFn } from "./types.js";
2
2
  export type { RecipeMigration, WarnFn } from "./types.js";
3
3
  export { v1Migration } from "./v1.js";
4
+ /**
5
+ * Default deprecation-warning sink for the runtime/validation/fmt callers.
6
+ * Forwards to `console.warn` outside of tests so users see migration
7
+ * prompts in CLI output, but stays silent under vitest so the dozens of
8
+ * intentional legacy-shape regression fixtures don't flood stderr. Tests
9
+ * that need to assert warnings still pass their own `vi.fn()` directly.
10
+ */
11
+ export declare const defaultDeprecationWarn: WarnFn;
4
12
  /** apiVersion produced by the most recent migration. */
5
13
  export declare const CURRENT_API_VERSION = "patchwork.sh/v1";
6
14
  export interface MigrationResult {
@@ -22,3 +30,4 @@ export interface MigrationResult {
22
30
  * through unchanged so downstream schema lint can flag it).
23
31
  */
24
32
  export declare function migrateRecipeToCurrent(recipe: unknown, warn?: WarnFn): MigrationResult;
33
+ export declare function normalizeRecipeForRuntime(recipe: unknown, warn?: WarnFn): unknown;
@@ -1,5 +1,17 @@
1
1
  import { v1Migration } from "./v1.js";
2
2
  export { v1Migration } from "./v1.js";
3
+ /**
4
+ * Default deprecation-warning sink for the runtime/validation/fmt callers.
5
+ * Forwards to `console.warn` outside of tests so users see migration
6
+ * prompts in CLI output, but stays silent under vitest so the dozens of
7
+ * intentional legacy-shape regression fixtures don't flood stderr. Tests
8
+ * that need to assert warnings still pass their own `vi.fn()` directly.
9
+ */
10
+ export const defaultDeprecationWarn = (msg) => {
11
+ if (process.env.VITEST || process.env.NODE_ENV === "test")
12
+ return;
13
+ console.warn(msg);
14
+ };
3
15
  /** apiVersion produced by the most recent migration. */
4
16
  export const CURRENT_API_VERSION = "patchwork.sh/v1";
5
17
  /**
@@ -52,4 +64,125 @@ export function migrateRecipeToCurrent(recipe, warn) {
52
64
  }
53
65
  return { recipe: current, applied };
54
66
  }
67
+ // ---------------------------------------------------------------------------
68
+ // Field-level legacy normalisation (formerly legacyRecipeCompat.ts)
69
+ //
70
+ // These functions accept recipes in any historical shape and produce the
71
+ // current canonical shape. They run alongside the apiVersion migration
72
+ // chain above.
73
+ // ---------------------------------------------------------------------------
74
+ export function normalizeRecipeForRuntime(recipe, warn) {
75
+ if (!isRecord(recipe)) {
76
+ return recipe;
77
+ }
78
+ // Apply apiVersion migrations first so downstream field-level
79
+ // legacy compat operates on a recipe stamped with the current
80
+ // apiVersion (and so the deprecation warning for missing
81
+ // apiVersion fires once per call).
82
+ const migrated = migrateRecipeToCurrent(recipe, warn).recipe;
83
+ const source = isRecord(migrated) ? migrated : recipe;
84
+ const normalized = {
85
+ ...source,
86
+ };
87
+ if (isRecord(normalized.trigger)) {
88
+ normalized.trigger = normalizeLegacyTriggerForRuntime(normalized.trigger, warn);
89
+ }
90
+ if (Array.isArray(normalized.steps)) {
91
+ normalized.steps = normalized.steps.map((step) => normalizeLegacyRuntimeStep(step, warn));
92
+ }
93
+ return normalized;
94
+ }
95
+ function normalizeLegacyTriggerForRuntime(trigger, warn) {
96
+ const normalized = { ...trigger };
97
+ if (normalized.type === "cron" &&
98
+ typeof normalized.schedule === "string" &&
99
+ typeof normalized.at !== "string") {
100
+ warn?.("Deprecated recipe field: trigger.schedule — rename to trigger.at (will be removed in a future major version)");
101
+ normalized.at = normalized.schedule;
102
+ }
103
+ delete normalized.schedule;
104
+ return normalized;
105
+ }
106
+ function normalizeLegacyRuntimeStep(step, warn) {
107
+ if (!isRecord(step)) {
108
+ return step;
109
+ }
110
+ const normalized = {};
111
+ for (const [key, value] of Object.entries(step)) {
112
+ if (key === "params" || key === "output" || key === "prompt") {
113
+ continue;
114
+ }
115
+ if (key === "agent" && typeof value === "boolean") {
116
+ continue;
117
+ }
118
+ if (key === "parallel" && Array.isArray(value)) {
119
+ normalized.parallel = value.map((entry) => normalizeLegacyRuntimeStep(entry, warn));
120
+ continue;
121
+ }
122
+ if (key === "branch" && Array.isArray(value)) {
123
+ normalized.branch = value.map((entry) => normalizeLegacyBranchEntry(entry, warn));
124
+ continue;
125
+ }
126
+ normalized[key] = value;
127
+ }
128
+ if (step.agent === true || isRecord(step.agent)) {
129
+ const agentConfig = isRecord(step.agent)
130
+ ? { ...step.agent }
131
+ : {};
132
+ if (typeof step.prompt === "string" &&
133
+ typeof agentConfig.prompt !== "string") {
134
+ warn?.("Deprecated recipe step field: prompt at step level — move to step.agent.prompt (will be removed in a future major version)");
135
+ agentConfig.prompt = step.prompt;
136
+ }
137
+ if (typeof step.output === "string" &&
138
+ typeof agentConfig.into !== "string") {
139
+ warn?.("Deprecated recipe step field: output — use step.agent.into instead (will be removed in a future major version)");
140
+ agentConfig.into = step.output;
141
+ }
142
+ if (step.agent === true) {
143
+ warn?.("Deprecated recipe step field: agent: true — use agent: { prompt, into } object instead (will be removed in a future major version)");
144
+ }
145
+ normalized.agent = agentConfig;
146
+ return normalized;
147
+ }
148
+ if (isRecord(step.params)) {
149
+ warn?.("Deprecated recipe step field: params — inline fields directly on the step (will be removed in a future major version)");
150
+ Object.assign(normalized, step.params);
151
+ }
152
+ if (typeof normalized.recipe !== "string" &&
153
+ typeof normalized.chain === "string") {
154
+ warn?.("Deprecated recipe step field: chain — rename to recipe (will be removed in a future major version)");
155
+ normalized.recipe = normalized.chain;
156
+ }
157
+ delete normalized.chain;
158
+ if (typeof normalized.into !== "string" && typeof step.output === "string") {
159
+ warn?.("Deprecated recipe step field: output — rename to into (will be removed in a future major version)");
160
+ normalized.into = step.output;
161
+ }
162
+ if (normalized.tool === "file.append" &&
163
+ typeof normalized.content !== "string" &&
164
+ typeof normalized.line === "string") {
165
+ warn?.("Deprecated recipe step field: line (file.append) — rename to content (will be removed in a future major version)");
166
+ normalized.content = normalized.line;
167
+ delete normalized.line;
168
+ }
169
+ return normalized;
170
+ }
171
+ function normalizeLegacyBranchEntry(entry, warn) {
172
+ if (!isRecord(entry)) {
173
+ return entry;
174
+ }
175
+ const normalized = {};
176
+ for (const [key, value] of Object.entries(entry)) {
177
+ if (key === "otherwise" && isRecord(value)) {
178
+ normalized.otherwise = normalizeLegacyRuntimeStep(value, warn);
179
+ continue;
180
+ }
181
+ normalized[key] = value;
182
+ }
183
+ if (Object.hasOwn(normalized, "otherwise")) {
184
+ return normalized;
185
+ }
186
+ return normalizeLegacyRuntimeStep(entry, warn);
187
+ }
55
188
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/recipes/migrations/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,OAAO,EAAE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,KAAK,EAAE,IAAI,CAAC,CAAC;AACjD,CAAC"}
@@ -21,6 +21,26 @@
21
21
  * regex (which disagreed with the schema by also allowing `_`).
22
22
  */
23
23
  export declare const RECIPE_NAME_RE: RegExp;
24
+ /**
25
+ * Strip a registry scope from a recipe name.
26
+ *
27
+ * Marketplace registry recipes carry a *scoped* name in their
28
+ * `recipe.json` (`@patchworkos/sprint-review-prep`) but the bridge
29
+ * stores recipes on disk under the bare, unscoped kebab slug. The
30
+ * recipe YAML `name:` should be the bare slug, but registry data
31
+ * historically shipped the scoped form there too — which fails the
32
+ * `RECIPE_NAME_RE` kebab check at install time.
33
+ *
34
+ * This normalizes either shape to the last `/`-delimited segment:
35
+ * - `@patchworkos/sprint-review-prep` → `sprint-review-prep`
36
+ * - `patchworkos/sprint-review-prep` → `sprint-review-prep`
37
+ * - `sprint-review-prep` → `sprint-review-prep` (unchanged)
38
+ *
39
+ * Only the `@scope/` prefix is forgiven — the resulting slug is still
40
+ * validated by `RECIPE_NAME_RE` downstream, so a genuinely-invalid
41
+ * name (`@bad/UPPER`, `../escape`, empty) still fails.
42
+ */
43
+ export declare function stripRecipeScope(name: string): string;
24
44
  /**
25
45
  * Canonical variable-name regex (for `trigger.vars[].name` and
26
46
  * `trigger.inputs[].name`). Mirrors the runtime template-reference
@@ -21,6 +21,31 @@
21
21
  * regex (which disagreed with the schema by also allowing `_`).
22
22
  */
23
23
  export const RECIPE_NAME_RE = /^[a-z0-9][a-z0-9-]{0,63}$/;
24
+ /**
25
+ * Strip a registry scope from a recipe name.
26
+ *
27
+ * Marketplace registry recipes carry a *scoped* name in their
28
+ * `recipe.json` (`@patchworkos/sprint-review-prep`) but the bridge
29
+ * stores recipes on disk under the bare, unscoped kebab slug. The
30
+ * recipe YAML `name:` should be the bare slug, but registry data
31
+ * historically shipped the scoped form there too — which fails the
32
+ * `RECIPE_NAME_RE` kebab check at install time.
33
+ *
34
+ * This normalizes either shape to the last `/`-delimited segment:
35
+ * - `@patchworkos/sprint-review-prep` → `sprint-review-prep`
36
+ * - `patchworkos/sprint-review-prep` → `sprint-review-prep`
37
+ * - `sprint-review-prep` → `sprint-review-prep` (unchanged)
38
+ *
39
+ * Only the `@scope/` prefix is forgiven — the resulting slug is still
40
+ * validated by `RECIPE_NAME_RE` downstream, so a genuinely-invalid
41
+ * name (`@bad/UPPER`, `../escape`, empty) still fails.
42
+ */
43
+ export function stripRecipeScope(name) {
44
+ if (typeof name !== "string" || !name.includes("/"))
45
+ return name;
46
+ const segments = name.split("/");
47
+ return segments[segments.length - 1] ?? name;
48
+ }
24
49
  /**
25
50
  * Canonical variable-name regex (for `trigger.vars[].name` and
26
51
  * `trigger.inputs[].name`). Mirrors the runtime template-reference
@@ -1 +1 @@
1
- {"version":3,"file":"names.js","sourceRoot":"","sources":["../../src/recipes/names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,+BAA+B,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IAC7D,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,MAAM;IACN,SAAS;IACT,QAAQ;IACR,SAAS;IACT,iBAAiB;IACjB,WAAW;IACX,cAAc;IACd,MAAM;IACN,UAAU;IACV,eAAe;IACf,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,UAAU;IACV,OAAO;CACR,CAAC,CAAC"}
1
+ {"version":3,"file":"names.js","sourceRoot":"","sources":["../../src/recipes/names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAE1D;;;;;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