patchwork-os 0.2.0-alpha.3 → 0.2.0-alpha.5
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.
- package/dist/bridge.js +23 -10
- package/dist/bridge.js.map +1 -1
- package/dist/connectors/github.d.ts +58 -8
- package/dist/connectors/github.js +321 -84
- package/dist/connectors/github.js.map +1 -1
- package/dist/connectors/gmail.js +7 -0
- package/dist/connectors/gmail.js.map +1 -1
- package/dist/connectors/googleCalendar.d.ts +57 -0
- package/dist/connectors/googleCalendar.js +308 -0
- package/dist/connectors/googleCalendar.js.map +1 -0
- package/dist/connectors/linear.d.ts +52 -19
- package/dist/connectors/linear.js +167 -129
- package/dist/connectors/linear.js.map +1 -1
- package/dist/connectors/mcpClient.d.ts +56 -0
- package/dist/connectors/mcpClient.js +189 -0
- package/dist/connectors/mcpClient.js.map +1 -0
- package/dist/connectors/mcpOAuth.d.ts +73 -0
- package/dist/connectors/mcpOAuth.js +338 -0
- package/dist/connectors/mcpOAuth.js.map +1 -0
- package/dist/connectors/sentry.d.ts +17 -21
- package/dist/connectors/sentry.js +124 -131
- package/dist/connectors/sentry.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/recipes/yamlRunner.js +32 -42
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/recipesHttp.d.ts +13 -1
- package/dist/recipesHttp.js +9 -1
- package/dist/recipesHttp.js.map +1 -1
- package/dist/server.d.ts +3 -1
- package/dist/server.js +220 -49
- package/dist/server.js.map +1 -1
- package/dist/tools/createLinearIssue.d.ts +84 -0
- package/dist/tools/createLinearIssue.js +146 -0
- package/dist/tools/createLinearIssue.js.map +1 -0
- package/dist/tools/fetchCalendarEvents.d.ts +94 -0
- package/dist/tools/fetchCalendarEvents.js +97 -0
- package/dist/tools/fetchCalendarEvents.js.map +1 -0
- package/dist/tools/fetchGithubIssue.d.ts +80 -0
- package/dist/tools/fetchGithubIssue.js +84 -0
- package/dist/tools/fetchGithubIssue.js.map +1 -0
- package/dist/tools/fetchGithubPR.d.ts +89 -0
- package/dist/tools/fetchGithubPR.js +96 -0
- package/dist/tools/fetchGithubPR.js.map +1 -0
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/start-all.sh +56 -19
- package/templates/recipes/ctx-loop-test.yaml +75 -0
- package/templates/recipes/morning-brief.yaml +12 -4
- package/templates/recipes/sentry-to-linear.yaml +77 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: sentry-to-linear
|
|
2
|
+
description: |
|
|
3
|
+
Fetch a Sentry issue, enrich it with git blame, and create a triage-ready
|
|
4
|
+
Linear ticket. Requires both Sentry and Linear connectors connected.
|
|
5
|
+
Run ad-hoc or trigger via webhook / automation policy.
|
|
6
|
+
|
|
7
|
+
# Example manual trigger:
|
|
8
|
+
# patchwork-os run-recipe sentry-to-linear --var SENTRY_ISSUE_ID=12345678
|
|
9
|
+
#
|
|
10
|
+
# Example automation trigger (add to ~/.patchwork/automation-policy.json):
|
|
11
|
+
# "onFileSave": { ... } — or fire from a Sentry webhook handler
|
|
12
|
+
|
|
13
|
+
trigger:
|
|
14
|
+
type: manual
|
|
15
|
+
vars:
|
|
16
|
+
- name: SENTRY_ISSUE_ID
|
|
17
|
+
description: "Sentry issue ID or URL (e.g. '12345678' or 'https://sentry.io/...')"
|
|
18
|
+
required: true
|
|
19
|
+
- name: LINEAR_TEAM_KEY
|
|
20
|
+
description: "Linear team key to create the issue in (e.g. 'ENG'). Defaults to first team."
|
|
21
|
+
required: false
|
|
22
|
+
- name: LINEAR_PRIORITY
|
|
23
|
+
description: "Linear priority: 1=urgent, 2=high, 3=medium, 4=low (default: 2)"
|
|
24
|
+
required: false
|
|
25
|
+
default: "2"
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- agent:
|
|
29
|
+
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
|
|
33
|
+
|
|
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)
|
|
39
|
+
|
|
40
|
+
## Stack trace
|
|
41
|
+
(the top 5 frames from the stackTrace field, formatted as a code block)
|
|
42
|
+
|
|
43
|
+
## Suspect commit
|
|
44
|
+
(if topSuspect is present: sha, author, date, subject — otherwise write "No suspect commit identified")
|
|
45
|
+
|
|
46
|
+
## Confidence
|
|
47
|
+
(the confidence field value + a one-sentence explanation of what it means)
|
|
48
|
+
|
|
49
|
+
## Sentry link
|
|
50
|
+
(a link back to the Sentry issue — construct from the issueId: https://sentry.io/issues/{{SENTRY_ISSUE_ID}}/)
|
|
51
|
+
|
|
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"]
|
|
55
|
+
|
|
56
|
+
After creating the ticket, respond with ONLY a JSON object:
|
|
57
|
+
{
|
|
58
|
+
"sentryIssueId": "<the issueId from fetchSentryIssue>",
|
|
59
|
+
"sentryTitle": "<the title>",
|
|
60
|
+
"linearIdentifier": "<e.g. ENG-101>",
|
|
61
|
+
"linearUrl": "<the url from createLinearIssue>",
|
|
62
|
+
"confidence": "<high|medium|low>",
|
|
63
|
+
"suspectCommit": "<sha or null>"
|
|
64
|
+
}
|
|
65
|
+
|
|
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.
|
|
69
|
+
driver: claude-code
|
|
70
|
+
model: claude-haiku-4-5-20251001
|
|
71
|
+
into: result
|
|
72
|
+
- tool: file.write
|
|
73
|
+
path: ~/.patchwork/inbox/sentry-to-linear-{{date}}.md
|
|
74
|
+
content: |
|
|
75
|
+
# Sentry → Linear triage ({{date}})
|
|
76
|
+
|
|
77
|
+
{{result}}
|