patchwork-os 0.2.0-alpha.34 → 0.2.0-alpha.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/README.md +202 -93
  2. package/deploy/bootstrap-new-vps.sh +12 -12
  3. package/deploy/bootstrap-vps.sh +6 -3
  4. package/deploy/deploy-landing.sh +59 -2
  5. package/dist/activityLog.d.ts +49 -0
  6. package/dist/activityLog.js +78 -0
  7. package/dist/activityLog.js.map +1 -1
  8. package/dist/approvalHttp.d.ts +25 -0
  9. package/dist/approvalHttp.js +74 -18
  10. package/dist/approvalHttp.js.map +1 -1
  11. package/dist/approvalInsights.d.ts +49 -0
  12. package/dist/approvalInsights.js +97 -0
  13. package/dist/approvalInsights.js.map +1 -0
  14. package/dist/approvalQueue.d.ts +11 -0
  15. package/dist/approvalQueue.js +80 -1
  16. package/dist/approvalQueue.js.map +1 -1
  17. package/dist/approvalSignals.d.ts +124 -0
  18. package/dist/approvalSignals.js +512 -0
  19. package/dist/approvalSignals.js.map +1 -0
  20. package/dist/automation.d.ts +37 -0
  21. package/dist/automation.js +105 -61
  22. package/dist/automation.js.map +1 -1
  23. package/dist/automationSuggestions.d.ts +79 -0
  24. package/dist/automationSuggestions.js +150 -0
  25. package/dist/automationSuggestions.js.map +1 -0
  26. package/dist/bridge.js +78 -1
  27. package/dist/bridge.js.map +1 -1
  28. package/dist/ccPermissions.d.ts +15 -0
  29. package/dist/ccPermissions.js +15 -0
  30. package/dist/ccPermissions.js.map +1 -1
  31. package/dist/claudeDriver.js +74 -16
  32. package/dist/claudeDriver.js.map +1 -1
  33. package/dist/commands/patchworkInit.d.ts +8 -0
  34. package/dist/commands/patchworkInit.js +41 -5
  35. package/dist/commands/patchworkInit.js.map +1 -1
  36. package/dist/commands/recipe.d.ts +20 -0
  37. package/dist/commands/recipe.js +212 -6
  38. package/dist/commands/recipe.js.map +1 -1
  39. package/dist/commands/recipeInstall.d.ts +79 -1
  40. package/dist/commands/recipeInstall.js +333 -16
  41. package/dist/commands/recipeInstall.js.map +1 -1
  42. package/dist/commands/tracesExport.d.ts +83 -0
  43. package/dist/commands/tracesExport.js +269 -0
  44. package/dist/commands/tracesExport.js.map +1 -0
  45. package/dist/commands/tracesImport.d.ts +56 -0
  46. package/dist/commands/tracesImport.js +161 -0
  47. package/dist/commands/tracesImport.js.map +1 -0
  48. package/dist/config.d.ts +8 -0
  49. package/dist/config.js +9 -1
  50. package/dist/config.js.map +1 -1
  51. package/dist/connectorRoutes.d.ts +43 -0
  52. package/dist/connectorRoutes.js +1023 -0
  53. package/dist/connectorRoutes.js.map +1 -0
  54. package/dist/connectors/asana.d.ts +198 -0
  55. package/dist/connectors/asana.js +679 -0
  56. package/dist/connectors/asana.js.map +1 -0
  57. package/dist/connectors/baseConnector.d.ts +36 -0
  58. package/dist/connectors/baseConnector.js +151 -28
  59. package/dist/connectors/baseConnector.js.map +1 -1
  60. package/dist/connectors/discord.d.ts +150 -0
  61. package/dist/connectors/discord.js +543 -0
  62. package/dist/connectors/discord.js.map +1 -0
  63. package/dist/connectors/github.js +11 -4
  64. package/dist/connectors/github.js.map +1 -1
  65. package/dist/connectors/gitlab.d.ts +180 -0
  66. package/dist/connectors/gitlab.js +582 -0
  67. package/dist/connectors/gitlab.js.map +1 -0
  68. package/dist/connectors/gmail.js +50 -10
  69. package/dist/connectors/gmail.js.map +1 -1
  70. package/dist/connectors/googleCalendar.js +36 -10
  71. package/dist/connectors/googleCalendar.js.map +1 -1
  72. package/dist/connectors/googleDrive.d.ts +34 -0
  73. package/dist/connectors/googleDrive.js +321 -0
  74. package/dist/connectors/googleDrive.js.map +1 -0
  75. package/dist/connectors/linear.js +23 -4
  76. package/dist/connectors/linear.js.map +1 -1
  77. package/dist/connectors/mcpOAuth.js +26 -2
  78. package/dist/connectors/mcpOAuth.js.map +1 -1
  79. package/dist/connectors/oauthStateStore.d.ts +31 -0
  80. package/dist/connectors/oauthStateStore.js +52 -0
  81. package/dist/connectors/oauthStateStore.js.map +1 -0
  82. package/dist/connectors/pagerduty.d.ts +160 -0
  83. package/dist/connectors/pagerduty.js +464 -0
  84. package/dist/connectors/pagerduty.js.map +1 -0
  85. package/dist/connectors/slack.d.ts +16 -1
  86. package/dist/connectors/slack.js +57 -5
  87. package/dist/connectors/slack.js.map +1 -1
  88. package/dist/connectors/tokenStorage.js +27 -2
  89. package/dist/connectors/tokenStorage.js.map +1 -1
  90. package/dist/connectors/zendesk.js +19 -1
  91. package/dist/connectors/zendesk.js.map +1 -1
  92. package/dist/cors.d.ts +10 -0
  93. package/dist/cors.js +29 -0
  94. package/dist/cors.js.map +1 -0
  95. package/dist/decisionReplay.d.ts +72 -0
  96. package/dist/decisionReplay.js +92 -0
  97. package/dist/decisionReplay.js.map +1 -0
  98. package/dist/decisionTraceLog.d.ts +6 -0
  99. package/dist/decisionTraceLog.js +54 -2
  100. package/dist/decisionTraceLog.js.map +1 -1
  101. package/dist/featureFlags.d.ts +17 -11
  102. package/dist/featureFlags.js +52 -47
  103. package/dist/featureFlags.js.map +1 -1
  104. package/dist/fp/automationInterpreter.js +25 -21
  105. package/dist/fp/automationInterpreter.js.map +1 -1
  106. package/dist/fp/automationState.js +4 -1
  107. package/dist/fp/automationState.js.map +1 -1
  108. package/dist/fp/policyParser.js +4 -1
  109. package/dist/fp/policyParser.js.map +1 -1
  110. package/dist/inboxRoutes.d.ts +22 -0
  111. package/dist/inboxRoutes.js +114 -0
  112. package/dist/inboxRoutes.js.map +1 -0
  113. package/dist/index.js +734 -144
  114. package/dist/index.js.map +1 -1
  115. package/dist/mcpRoutes.d.ts +37 -0
  116. package/dist/mcpRoutes.js +76 -0
  117. package/dist/mcpRoutes.js.map +1 -0
  118. package/dist/oauth.d.ts +3 -0
  119. package/dist/oauth.js +151 -26
  120. package/dist/oauth.js.map +1 -1
  121. package/dist/oauthRoutes.d.ts +32 -0
  122. package/dist/oauthRoutes.js +124 -0
  123. package/dist/oauthRoutes.js.map +1 -0
  124. package/dist/orchestrator/orchestratorBridge.js +2 -2
  125. package/dist/orchestrator/orchestratorBridge.js.map +1 -1
  126. package/dist/patchworkConfig.d.ts +7 -0
  127. package/dist/patchworkConfig.js.map +1 -1
  128. package/dist/pluginLoader.d.ts +12 -0
  129. package/dist/pluginLoader.js +43 -4
  130. package/dist/pluginLoader.js.map +1 -1
  131. package/dist/pluginWatcher.js +8 -3
  132. package/dist/pluginWatcher.js.map +1 -1
  133. package/dist/preToolUseHook.d.ts +12 -0
  134. package/dist/preToolUseHook.js +23 -0
  135. package/dist/preToolUseHook.js.map +1 -1
  136. package/dist/recipeOrchestration.d.ts +8 -0
  137. package/dist/recipeOrchestration.js +320 -39
  138. package/dist/recipeOrchestration.js.map +1 -1
  139. package/dist/recipeRoutes.d.ts +154 -0
  140. package/dist/recipeRoutes.js +1098 -0
  141. package/dist/recipeRoutes.js.map +1 -0
  142. package/dist/recipes/captureForRunlog.d.ts +27 -0
  143. package/dist/recipes/captureForRunlog.js +128 -0
  144. package/dist/recipes/captureForRunlog.js.map +1 -0
  145. package/dist/recipes/chainedRunner.d.ts +54 -3
  146. package/dist/recipes/chainedRunner.js +256 -36
  147. package/dist/recipes/chainedRunner.js.map +1 -1
  148. package/dist/recipes/compiler.js +3 -3
  149. package/dist/recipes/compiler.js.map +1 -1
  150. package/dist/recipes/detectSilentFail.d.ts +34 -0
  151. package/dist/recipes/detectSilentFail.js +105 -0
  152. package/dist/recipes/detectSilentFail.js.map +1 -0
  153. package/dist/recipes/installer.js +3 -3
  154. package/dist/recipes/installer.js.map +1 -1
  155. package/dist/recipes/manifest.js +21 -6
  156. package/dist/recipes/manifest.js.map +1 -1
  157. package/dist/recipes/migrationWarnings.d.ts +12 -0
  158. package/dist/recipes/migrationWarnings.js +44 -0
  159. package/dist/recipes/migrationWarnings.js.map +1 -0
  160. package/dist/recipes/replayRun.d.ts +62 -0
  161. package/dist/recipes/replayRun.js +97 -0
  162. package/dist/recipes/replayRun.js.map +1 -0
  163. package/dist/recipes/resolveRecipePath.d.ts +69 -0
  164. package/dist/recipes/resolveRecipePath.js +202 -0
  165. package/dist/recipes/resolveRecipePath.js.map +1 -0
  166. package/dist/recipes/scheduler.js +102 -11
  167. package/dist/recipes/scheduler.js.map +1 -1
  168. package/dist/recipes/schemaGenerator.js +3 -3
  169. package/dist/recipes/schemaGenerator.js.map +1 -1
  170. package/dist/recipes/toolRegistry.d.ts +5 -0
  171. package/dist/recipes/toolRegistry.js +9 -0
  172. package/dist/recipes/toolRegistry.js.map +1 -1
  173. package/dist/recipes/tools/asana.d.ts +16 -0
  174. package/dist/recipes/tools/asana.js +524 -0
  175. package/dist/recipes/tools/asana.js.map +1 -0
  176. package/dist/recipes/tools/discord.d.ts +18 -0
  177. package/dist/recipes/tools/discord.js +254 -0
  178. package/dist/recipes/tools/discord.js.map +1 -0
  179. package/dist/recipes/tools/file.d.ts +6 -0
  180. package/dist/recipes/tools/file.js +12 -8
  181. package/dist/recipes/tools/file.js.map +1 -1
  182. package/dist/recipes/tools/github.js +29 -4
  183. package/dist/recipes/tools/github.js.map +1 -1
  184. package/dist/recipes/tools/gitlab.d.ts +11 -0
  185. package/dist/recipes/tools/gitlab.js +285 -0
  186. package/dist/recipes/tools/gitlab.js.map +1 -0
  187. package/dist/recipes/tools/gmail.d.ts +1 -1
  188. package/dist/recipes/tools/gmail.js +230 -6
  189. package/dist/recipes/tools/gmail.js.map +1 -1
  190. package/dist/recipes/tools/googleDrive.d.ts +1 -0
  191. package/dist/recipes/tools/googleDrive.js +55 -0
  192. package/dist/recipes/tools/googleDrive.js.map +1 -0
  193. package/dist/recipes/tools/index.d.ts +8 -0
  194. package/dist/recipes/tools/index.js +8 -0
  195. package/dist/recipes/tools/index.js.map +1 -1
  196. package/dist/recipes/tools/jira.d.ts +14 -0
  197. package/dist/recipes/tools/jira.js +369 -0
  198. package/dist/recipes/tools/jira.js.map +1 -0
  199. package/dist/recipes/tools/linear.d.ts +2 -1
  200. package/dist/recipes/tools/linear.js +227 -3
  201. package/dist/recipes/tools/linear.js.map +1 -1
  202. package/dist/recipes/tools/meetingNotes.d.ts +21 -0
  203. package/dist/recipes/tools/meetingNotes.js +701 -0
  204. package/dist/recipes/tools/meetingNotes.js.map +1 -0
  205. package/dist/recipes/tools/pagerduty.d.ts +15 -0
  206. package/dist/recipes/tools/pagerduty.js +451 -0
  207. package/dist/recipes/tools/pagerduty.js.map +1 -0
  208. package/dist/recipes/tools/sentry.d.ts +12 -0
  209. package/dist/recipes/tools/sentry.js +73 -0
  210. package/dist/recipes/tools/sentry.js.map +1 -0
  211. package/dist/recipes/tools/slack.js +15 -5
  212. package/dist/recipes/tools/slack.js.map +1 -1
  213. package/dist/recipes/validation.js +83 -14
  214. package/dist/recipes/validation.js.map +1 -1
  215. package/dist/recipes/yamlRunner.d.ts +30 -2
  216. package/dist/recipes/yamlRunner.js +369 -70
  217. package/dist/recipes/yamlRunner.js.map +1 -1
  218. package/dist/recipesHttp.d.ts +76 -1
  219. package/dist/recipesHttp.js +474 -12
  220. package/dist/recipesHttp.js.map +1 -1
  221. package/dist/runLog.d.ts +78 -2
  222. package/dist/runLog.js +204 -6
  223. package/dist/runLog.js.map +1 -1
  224. package/dist/schemas/dry-run-plan.v1.json +139 -0
  225. package/dist/schemas/recipe.v1.json +684 -0
  226. package/dist/server.d.ts +79 -10
  227. package/dist/server.js +366 -1384
  228. package/dist/server.js.map +1 -1
  229. package/dist/ssrfGuard.d.ts +54 -0
  230. package/dist/ssrfGuard.js +122 -0
  231. package/dist/ssrfGuard.js.map +1 -0
  232. package/dist/streamableHttp.d.ts +39 -1
  233. package/dist/streamableHttp.js +126 -17
  234. package/dist/streamableHttp.js.map +1 -1
  235. package/dist/tools/getDocumentSymbols.d.ts +24 -0
  236. package/dist/tools/getDocumentSymbols.js +74 -8
  237. package/dist/tools/getDocumentSymbols.js.map +1 -1
  238. package/dist/tools/getSecurityAdvisories.js +10 -1
  239. package/dist/tools/getSecurityAdvisories.js.map +1 -1
  240. package/dist/tools/getSessionUsage.d.ts +3 -0
  241. package/dist/tools/getSessionUsage.js +3 -0
  242. package/dist/tools/getSessionUsage.js.map +1 -1
  243. package/dist/tools/index.d.ts +8 -0
  244. package/dist/tools/index.js +32 -2
  245. package/dist/tools/index.js.map +1 -1
  246. package/dist/tools/slackPostMessage.js +1 -1
  247. package/dist/tools/slackPostMessage.js.map +1 -1
  248. package/dist/tools/transaction.d.ts +19 -0
  249. package/dist/tools/transaction.js +29 -0
  250. package/dist/tools/transaction.js.map +1 -1
  251. package/dist/traceEncryption.d.ts +46 -0
  252. package/dist/traceEncryption.js +124 -0
  253. package/dist/traceEncryption.js.map +1 -0
  254. package/dist/transport.d.ts +39 -0
  255. package/dist/transport.js +88 -8
  256. package/dist/transport.js.map +1 -1
  257. package/package.json +22 -5
  258. package/templates/policies/README.md +72 -0
  259. package/templates/policies/conservative.json +14 -0
  260. package/templates/policies/developer.json +14 -0
  261. package/templates/policies/headless-ci.json +24 -0
  262. package/templates/policies/personal-assistant.json +15 -0
  263. package/templates/policies/regulated-industry.json +18 -0
  264. package/templates/recipes/project-health-check.yaml +1 -1
  265. package/templates/recipes/webhook/README.md +70 -0
  266. package/templates/recipes/webhook/capture-thought.yaml +26 -0
  267. package/templates/recipes/webhook/customer-escalation.yaml +49 -0
  268. package/templates/recipes/webhook/incident-intake.yaml +46 -0
  269. package/templates/recipes/webhook/meeting-prep.yaml +48 -0
  270. package/templates/recipes/webhook/morning-brief.yaml +57 -0
@@ -0,0 +1,70 @@
1
+ # Webhook recipe templates
2
+
3
+ > **Anything that can send HTTP can trigger your AI.** iPhone Shortcut, Stream
4
+ > Deck, Home Assistant, NFC tag, cron job, monitoring tool, another service —
5
+ > if it can POST a body, it can drive a Patchwork recipe.
6
+
7
+ Five starter templates demonstrating common webhook-triggered workflows. Each
8
+ file is a copy-and-adjust starting point.
9
+
10
+ ## Templates
11
+
12
+ | File | Purpose | Likely trigger sources |
13
+ |---|---|---|
14
+ | [`capture-thought.yaml`](capture-thought.yaml) | Append a thought to today's journal. | iOS Shortcut + Siri, Stream Deck, NFC tag |
15
+ | [`morning-brief.yaml`](morning-brief.yaml) | On-demand morning digest (vs. the cron version). | iOS Shortcut on first unlock, Apple Watch complication |
16
+ | [`meeting-prep.yaml`](meeting-prep.yaml) | Brief on attendees + context before the next meeting. | Calendar webhook, Apple Calendar event-start automation |
17
+ | [`incident-intake.yaml`](incident-intake.yaml) | Catch-all for monitoring → Linear + Slack alert. | PagerDuty, Sentry, Datadog, uptime checkers |
18
+ | [`customer-escalation.yaml`](customer-escalation.yaml) | Enrich a flagged support ticket with CRM data and post to Slack. | Intercom, Zendesk, HelpScout, Front |
19
+
20
+ ## Install
21
+
22
+ ```sh
23
+ cp templates/recipes/webhook/capture-thought.yaml ~/.patchwork/recipes/
24
+ patchwork stop
25
+ patchwork start
26
+ ```
27
+
28
+ The dashboard's [Recipes page](http://localhost:3000/dashboard/recipes) will
29
+ show the recipe with its full webhook URL + a copyable curl example as soon as
30
+ the bridge picks up the new file.
31
+
32
+ ## Triggering from common sources
33
+
34
+ ### iOS Shortcut
35
+ 1. Shortcuts app → New Shortcut → Add action **Get Contents of URL**
36
+ 2. Method: `POST`. URL: `http://YOUR-MAC.local:3101/hooks/<path>` (or via Tailscale / your reverse proxy if remote)
37
+ 3. Headers: `Content-Type: application/json`
38
+ 4. Request Body → JSON → fill in payload fields the recipe expects
39
+ 5. Add a Siri phrase ("Hey Siri, capture thought")
40
+
41
+ ### Stream Deck
42
+ - Action: **HTTP Request** plugin
43
+ - Method: POST, URL as above, body matching the recipe's payload conventions
44
+
45
+ ### Home Assistant
46
+ - `automation` block → `service: rest_command.<your-name>` → `url: http://patchwork-bridge:3101/hooks/<path>`
47
+
48
+ ### Plain curl
49
+ Each template includes a runnable `curl` example in its docstring — paste it
50
+ into a script, a cron job, or your monitoring tool's webhook config.
51
+
52
+ ## Payload conventions
53
+
54
+ Every recipe references the request body via `{{payload.<field>}}`. The
55
+ convention shown in each template's docstring is suggestive, not mandatory —
56
+ you can change field names freely; the bridge passes the full JSON body
57
+ through.
58
+
59
+ ## Security notes
60
+
61
+ - Webhook endpoints are unauthenticated by default and bound to localhost
62
+ (`127.0.0.1`). Anything that needs the bridge from another machine should
63
+ go through a reverse proxy with auth (Tailscale, Caddy + Basic Auth,
64
+ Cloudflare Tunnel + Access).
65
+ - The receiving recipe's tools still go through your delegation policy — see
66
+ [`templates/policies/`](../../policies/) for tier presets.
67
+ - Don't trust payload contents blindly. The agent step in
68
+ `customer-escalation.yaml` and `meeting-prep.yaml` reads the body but
69
+ doesn't auto-act on it; final actions go through Slack/Linear with their
70
+ own auth scopes.
@@ -0,0 +1,26 @@
1
+ name: capture-thought
2
+ description: |
3
+ Append a thought to your daily journal from anywhere that can POST HTTP.
4
+
5
+ Suggested triggers:
6
+ - iOS Shortcut (Hey Siri, "capture thought") — see docs/triggers
7
+ - Stream Deck button
8
+ - NFC tag near your desk
9
+ - curl from another script
10
+
11
+ Example request:
12
+ curl -X POST http://localhost:3101/hooks/capture-thought \
13
+ -H 'Content-Type: application/json' \
14
+ -d '{"text":"the auth refresh path needs a circuit breaker"}'
15
+
16
+ trigger:
17
+ type: webhook
18
+ path: /capture-thought
19
+
20
+ steps:
21
+ - tool: file.append
22
+ path: ~/.patchwork/journal/{{date}}.md
23
+ content: "- {{time}} {{payload.text}}\n"
24
+
25
+ output:
26
+ path: ~/.patchwork/journal/{{date}}.md
@@ -0,0 +1,49 @@
1
+ name: customer-escalation
2
+ description: |
3
+ When a customer support tool flags a high-priority ticket, enrich it with
4
+ HubSpot CRM data and ping the right Slack channel with full context. The
5
+ human still decides how to respond — this just shaves the lookup time.
6
+
7
+ Suggested triggers:
8
+ - Intercom webhook (conversation.tagged-priority)
9
+ - Zendesk webhook (ticket priority changed)
10
+ - HelpScout / Front custom rule
11
+ - manual paste from CSAT dashboards via curl
12
+
13
+ Payload conventions:
14
+ customer_email the contact email (required — used for HubSpot lookup)
15
+ ticket_url deep link back to the support tool
16
+ summary short description of what they said
17
+
18
+ Example request:
19
+ curl -X POST http://localhost:3101/hooks/customer-escalation \
20
+ -H 'Content-Type: application/json' \
21
+ -d '{"customer_email":"jane@bigco.com","ticket_url":"https://app.intercom.com/conversations/9876","summary":"Says checkout has been broken for 3 days"}'
22
+
23
+ trigger:
24
+ type: webhook
25
+ path: /customer-escalation
26
+
27
+ steps:
28
+ - tool: hubspot.find_contact
29
+ email: "{{payload.customer_email}}"
30
+ into: contact
31
+ - tool: hubspot.list_recent_deals
32
+ contact_id: "{{contact.id}}"
33
+ max: 3
34
+ into: deals
35
+ - agent:
36
+ prompt: |
37
+ Compose a Slack alert for the customer-success team. Keep it under
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.
41
+
42
+ Contact: {{contact}}
43
+ Deals: {{deals}}
44
+ Summary: {{payload.summary}}
45
+ Ticket: {{payload.ticket_url}}
46
+ into: alert
47
+ - tool: slack.post_message
48
+ channel: "#customer-success"
49
+ text: "{{alert}}"
@@ -0,0 +1,46 @@
1
+ name: incident-intake
2
+ description: |
3
+ Convert any external incident signal into a Linear issue + Slack alert.
4
+ Designed as the catch-all webhook your monitoring stack POSTs to so on-call
5
+ has one place to look.
6
+
7
+ Suggested triggers:
8
+ - PagerDuty webhook
9
+ - Sentry alert webhook
10
+ - Datadog monitor
11
+ - GitHub Actions failure
12
+ - external uptime checker
13
+
14
+ Payload conventions (all optional except `title`):
15
+ title short summary, becomes the Linear issue title
16
+ severity "critical" | "high" | "medium" | "low" (default: "high")
17
+ source "pagerduty" | "sentry" | "datadog" | ...
18
+ url deep link back to the source incident page
19
+ body extra detail (markdown ok)
20
+
21
+ Example request:
22
+ curl -X POST http://localhost:3101/hooks/incident-intake \
23
+ -H 'Content-Type: application/json' \
24
+ -d '{"title":"checkout p99 over 2s","severity":"high","source":"datadog","url":"https://app.datadoghq.com/monitor/123"}'
25
+
26
+ trigger:
27
+ type: webhook
28
+ path: /incident-intake
29
+
30
+ steps:
31
+ - tool: linear.create_issue
32
+ title: "[{{payload.severity}}] {{payload.title}}"
33
+ description: |
34
+ Source: {{payload.source}}
35
+ Link: {{payload.url}}
36
+
37
+ {{payload.body}}
38
+ priority: 1
39
+ into: issue
40
+ - tool: slack.post_message
41
+ channel: "#incidents"
42
+ text: |
43
+ :rotating_light: New incident: *{{payload.title}}*
44
+ Severity: {{payload.severity}}
45
+ Source: {{payload.source}} — {{payload.url}}
46
+ Linear: {{issue.url}}
@@ -0,0 +1,48 @@
1
+ name: meeting-prep
2
+ description: |
3
+ Two minutes before any meeting starts, post a brief on the attendees and
4
+ recent context (recent email threads, related Linear issues, last meeting
5
+ notes). Drops the brief into ~/.patchwork/inbox/ and pings you on Slack.
6
+
7
+ Suggested triggers:
8
+ - Calendar webhook ("notify before event") — most reliable
9
+ - Apple Watch / iOS Shortcut tied to a calendar reminder
10
+ - Home Assistant routine fired by Apple Calendar event start
11
+
12
+ Example request (with attendees + topic in payload):
13
+ curl -X POST http://localhost:3101/hooks/meeting-prep \
14
+ -H 'Content-Type: application/json' \
15
+ -d '{"attendees":["alex@example.com","sam@example.com"],"topic":"Q3 planning"}'
16
+
17
+ trigger:
18
+ type: webhook
19
+ path: /meeting-prep
20
+
21
+ steps:
22
+ - tool: gmail.search_threads
23
+ query: "from:({{payload.attendees}}) newer_than:7d"
24
+ max: 10
25
+ into: recent_threads
26
+ - tool: linear.search_issues
27
+ query: "{{payload.topic}}"
28
+ max: 5
29
+ into: related_issues
30
+ - agent:
31
+ prompt: |
32
+ You are about to walk into a meeting. Produce a 10-line briefing.
33
+
34
+ Topic: {{payload.topic}}
35
+ Attendees: {{payload.attendees}}
36
+ Recent email threads with attendees: {{recent_threads}}
37
+ Related Linear issues: {{related_issues}}
38
+
39
+ Output sections: Context, Open questions, Suggested first move.
40
+ into: brief
41
+ - tool: file.write
42
+ path: ~/.patchwork/inbox/meeting-{{date}}-{{time}}.md
43
+ content: |
44
+ # Meeting prep — {{payload.topic}}
45
+ {{brief}}
46
+
47
+ output:
48
+ path: ~/.patchwork/inbox/meeting-{{date}}-{{time}}.md
@@ -0,0 +1,57 @@
1
+ name: morning-brief-webhook
2
+ description: |
3
+ On-demand morning brief — fires the moment you POST. Pair this with an
4
+ iOS Shortcut on your home screen ("Brief me") so you get the digest
5
+ whenever you're ready, not on a fixed cron schedule.
6
+
7
+ For the scheduled (cron) version, see ../morning-brief.yaml.
8
+
9
+ Suggested triggers:
10
+ - iOS Shortcut on first phone unlock
11
+ - Apple Watch complication tap
12
+ - Home Assistant motion sensor at the kitchen counter
13
+ - Stream Deck "morning routine" macro
14
+
15
+ Example request:
16
+ curl -X POST http://localhost:3101/hooks/morning-brief
17
+
18
+ trigger:
19
+ type: webhook
20
+ path: /morning-brief
21
+
22
+ steps:
23
+ - tool: gmail.fetch_unread
24
+ since: 24h
25
+ max: 30
26
+ into: messages
27
+ - tool: github.list_issues
28
+ assignee: "@me"
29
+ max: 10
30
+ into: issues
31
+ - tool: linear.list_issues
32
+ assignee: "@me"
33
+ state: "started,unstarted"
34
+ max: 15
35
+ into: linear_issues
36
+ - tool: calendar.list_events
37
+ days_ahead: 1
38
+ max: 10
39
+ into: calendar
40
+ - agent:
41
+ prompt: |
42
+ Write a 12-line morning brief from this data, in plain English,
43
+ prioritising what needs attention today.
44
+
45
+ Email (unread, 24h): {{messages}}
46
+ GitHub issues (mine): {{issues}}
47
+ Linear (mine): {{linear_issues}}
48
+ Calendar (next 24h): {{calendar}}
49
+ into: brief
50
+ - tool: file.write
51
+ path: ~/.patchwork/inbox/morning-brief-{{date}}.md
52
+ content: |
53
+ # Morning brief — {{date}}
54
+ {{brief}}
55
+
56
+ output:
57
+ path: ~/.patchwork/inbox/morning-brief-{{date}}.md