patchwork-os 0.2.0-alpha.2 → 0.2.0-alpha.21

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 (154) hide show
  1. package/README.bridge.md +6 -0
  2. package/README.md +13 -2
  3. package/dist/approvalHttp.d.ts +11 -2
  4. package/dist/approvalHttp.js +92 -9
  5. package/dist/approvalHttp.js.map +1 -1
  6. package/dist/approvalQueue.d.ts +12 -1
  7. package/dist/approvalQueue.js +25 -3
  8. package/dist/approvalQueue.js.map +1 -1
  9. package/dist/bridge.js +127 -23
  10. package/dist/bridge.js.map +1 -1
  11. package/dist/claudeDriver.d.ts +3 -1
  12. package/dist/claudeDriver.js +48 -0
  13. package/dist/claudeDriver.js.map +1 -1
  14. package/dist/claudeOrchestrator.d.ts +1 -1
  15. package/dist/claudeOrchestrator.js +14 -8
  16. package/dist/claudeOrchestrator.js.map +1 -1
  17. package/dist/commands/launchd.d.ts +2 -0
  18. package/dist/commands/launchd.js +94 -0
  19. package/dist/commands/launchd.js.map +1 -0
  20. package/dist/config.d.ts +7 -2
  21. package/dist/config.js +85 -8
  22. package/dist/config.js.map +1 -1
  23. package/dist/connectors/github.d.ts +58 -8
  24. package/dist/connectors/github.js +321 -84
  25. package/dist/connectors/github.js.map +1 -1
  26. package/dist/connectors/gmail.d.ts +4 -1
  27. package/dist/connectors/gmail.js +77 -16
  28. package/dist/connectors/gmail.js.map +1 -1
  29. package/dist/connectors/googleCalendar.d.ts +60 -0
  30. package/dist/connectors/googleCalendar.js +329 -0
  31. package/dist/connectors/googleCalendar.js.map +1 -0
  32. package/dist/connectors/linear.d.ts +117 -0
  33. package/dist/connectors/linear.js +248 -0
  34. package/dist/connectors/linear.js.map +1 -0
  35. package/dist/connectors/mcpClient.d.ts +56 -0
  36. package/dist/connectors/mcpClient.js +189 -0
  37. package/dist/connectors/mcpClient.js.map +1 -0
  38. package/dist/connectors/mcpOAuth.d.ts +83 -0
  39. package/dist/connectors/mcpOAuth.js +363 -0
  40. package/dist/connectors/mcpOAuth.js.map +1 -0
  41. package/dist/connectors/sentry.d.ts +43 -0
  42. package/dist/connectors/sentry.js +197 -0
  43. package/dist/connectors/sentry.js.map +1 -0
  44. package/dist/connectors/slack.d.ts +50 -0
  45. package/dist/connectors/slack.js +289 -0
  46. package/dist/connectors/slack.js.map +1 -0
  47. package/dist/drivers/claude/api.d.ts +11 -0
  48. package/dist/drivers/claude/api.js +54 -0
  49. package/dist/drivers/claude/api.js.map +1 -0
  50. package/dist/drivers/claude/envSanitizer.d.ts +7 -0
  51. package/dist/drivers/claude/envSanitizer.js +18 -0
  52. package/dist/drivers/claude/envSanitizer.js.map +1 -0
  53. package/dist/drivers/claude/streamParser.d.ts +38 -0
  54. package/dist/drivers/claude/streamParser.js +34 -0
  55. package/dist/drivers/claude/streamParser.js.map +1 -0
  56. package/dist/drivers/claude/subprocess.d.ts +19 -0
  57. package/dist/drivers/claude/subprocess.js +216 -0
  58. package/dist/drivers/claude/subprocess.js.map +1 -0
  59. package/dist/drivers/claude/subprocessSettings.d.ts +9 -0
  60. package/dist/drivers/claude/subprocessSettings.js +55 -0
  61. package/dist/drivers/claude/subprocessSettings.js.map +1 -0
  62. package/dist/drivers/gemini/index.d.ts +18 -0
  63. package/dist/drivers/gemini/index.js +210 -0
  64. package/dist/drivers/gemini/index.js.map +1 -0
  65. package/dist/drivers/grok/index.d.ts +11 -0
  66. package/dist/drivers/grok/index.js +22 -0
  67. package/dist/drivers/grok/index.js.map +1 -0
  68. package/dist/drivers/index.d.ts +23 -0
  69. package/dist/drivers/index.js +31 -0
  70. package/dist/drivers/index.js.map +1 -0
  71. package/dist/drivers/openai/index.d.ts +24 -0
  72. package/dist/drivers/openai/index.js +110 -0
  73. package/dist/drivers/openai/index.js.map +1 -0
  74. package/dist/drivers/types.d.ts +72 -0
  75. package/dist/drivers/types.js +30 -0
  76. package/dist/drivers/types.js.map +1 -0
  77. package/dist/index.js +35 -1
  78. package/dist/index.js.map +1 -1
  79. package/dist/installGuard.d.ts +25 -0
  80. package/dist/installGuard.js +48 -0
  81. package/dist/installGuard.js.map +1 -0
  82. package/dist/patchworkConfig.d.ts +9 -0
  83. package/dist/patchworkConfig.js.map +1 -1
  84. package/dist/recipes/scheduler.d.ts +23 -7
  85. package/dist/recipes/scheduler.js +135 -41
  86. package/dist/recipes/scheduler.js.map +1 -1
  87. package/dist/recipes/yamlRunner.d.ts +15 -0
  88. package/dist/recipes/yamlRunner.js +325 -26
  89. package/dist/recipes/yamlRunner.js.map +1 -1
  90. package/dist/recipesHttp.d.ts +14 -1
  91. package/dist/recipesHttp.js +21 -4
  92. package/dist/recipesHttp.js.map +1 -1
  93. package/dist/runLog.d.ts +5 -0
  94. package/dist/runLog.js +51 -1
  95. package/dist/runLog.js.map +1 -1
  96. package/dist/server.d.ts +15 -1
  97. package/dist/server.js +458 -31
  98. package/dist/server.js.map +1 -1
  99. package/dist/tools/addLinearComment.d.ts +55 -0
  100. package/dist/tools/addLinearComment.js +72 -0
  101. package/dist/tools/addLinearComment.js.map +1 -0
  102. package/dist/tools/bridgeDoctor.js +2 -2
  103. package/dist/tools/bridgeDoctor.js.map +1 -1
  104. package/dist/tools/createLinearIssue.d.ts +84 -0
  105. package/dist/tools/createLinearIssue.js +146 -0
  106. package/dist/tools/createLinearIssue.js.map +1 -0
  107. package/dist/tools/ctxGetTaskContext.d.ts +4 -1
  108. package/dist/tools/ctxGetTaskContext.js +45 -2
  109. package/dist/tools/ctxGetTaskContext.js.map +1 -1
  110. package/dist/tools/fetchCalendarEvents.d.ts +94 -0
  111. package/dist/tools/fetchCalendarEvents.js +97 -0
  112. package/dist/tools/fetchCalendarEvents.js.map +1 -0
  113. package/dist/tools/fetchGithubIssue.d.ts +80 -0
  114. package/dist/tools/fetchGithubIssue.js +84 -0
  115. package/dist/tools/fetchGithubIssue.js.map +1 -0
  116. package/dist/tools/fetchGithubPR.d.ts +89 -0
  117. package/dist/tools/fetchGithubPR.js +96 -0
  118. package/dist/tools/fetchGithubPR.js.map +1 -0
  119. package/dist/tools/fetchLinearIssue.d.ts +112 -0
  120. package/dist/tools/fetchLinearIssue.js +129 -0
  121. package/dist/tools/fetchLinearIssue.js.map +1 -0
  122. package/dist/tools/fetchSentryIssue.d.ts +143 -0
  123. package/dist/tools/fetchSentryIssue.js +150 -0
  124. package/dist/tools/fetchSentryIssue.js.map +1 -0
  125. package/dist/tools/fetchSlackProfile.d.ts +43 -0
  126. package/dist/tools/fetchSlackProfile.js +46 -0
  127. package/dist/tools/fetchSlackProfile.js.map +1 -0
  128. package/dist/tools/getConnectorStatus.d.ts +58 -0
  129. package/dist/tools/getConnectorStatus.js +56 -0
  130. package/dist/tools/getConnectorStatus.js.map +1 -0
  131. package/dist/tools/github/index.d.ts +1 -1
  132. package/dist/tools/github/index.js +1 -1
  133. package/dist/tools/github/index.js.map +1 -1
  134. package/dist/tools/github/pr.d.ts +122 -0
  135. package/dist/tools/github/pr.js +183 -0
  136. package/dist/tools/github/pr.js.map +1 -1
  137. package/dist/tools/index.js +27 -1
  138. package/dist/tools/index.js.map +1 -1
  139. package/dist/tools/slackListChannels.d.ts +65 -0
  140. package/dist/tools/slackListChannels.js +70 -0
  141. package/dist/tools/slackListChannels.js.map +1 -0
  142. package/dist/tools/slackPostMessage.d.ts +57 -0
  143. package/dist/tools/slackPostMessage.js +77 -0
  144. package/dist/tools/slackPostMessage.js.map +1 -0
  145. package/dist/tools/updateLinearIssue.d.ts +89 -0
  146. package/dist/tools/updateLinearIssue.js +117 -0
  147. package/dist/tools/updateLinearIssue.js.map +1 -0
  148. package/package.json +4 -2
  149. package/scripts/start-all.sh +56 -19
  150. package/templates/co.patchwork-os.bridge.plist +34 -0
  151. package/templates/recipes/ctx-loop-test.yaml +75 -0
  152. package/templates/recipes/morning-brief-slack.yaml +57 -0
  153. package/templates/recipes/morning-brief.yaml +21 -5
  154. package/templates/recipes/sentry-to-linear.yaml +77 -0
@@ -0,0 +1,84 @@
1
+ import { fetchGitHubIssue } from "../connectors/github.js";
2
+ import { requireString, successStructured } from "./utils.js";
3
+ export function createFetchGithubIssueTool() {
4
+ return {
5
+ schema: {
6
+ name: "fetchGithubIssue",
7
+ description: "Fetch a GitHub issue by URL or owner/repo#number ref. Returns title, body, state, labels, assignees, and author. Requires GitHub connector connected.",
8
+ annotations: { readOnlyHint: true },
9
+ inputSchema: {
10
+ type: "object",
11
+ required: ["issueRef"],
12
+ properties: {
13
+ issueRef: {
14
+ type: "string",
15
+ description: "GitHub issue URL (https://github.com/owner/repo/issues/42) or short ref (owner/repo#42).",
16
+ maxLength: 500,
17
+ },
18
+ },
19
+ additionalProperties: false,
20
+ },
21
+ outputSchema: {
22
+ type: "object",
23
+ properties: {
24
+ number: { type: "integer" },
25
+ title: { type: "string" },
26
+ body: { type: "string" },
27
+ state: { type: "string" },
28
+ url: { type: "string" },
29
+ repo: { type: "string" },
30
+ author: { type: "string" },
31
+ labels: { type: "array", items: { type: "string" } },
32
+ assignees: { type: "array", items: { type: "string" } },
33
+ createdAt: { type: "string" },
34
+ updatedAt: { type: "string" },
35
+ comments: { type: "integer" },
36
+ githubConnected: { type: "boolean" },
37
+ },
38
+ required: [
39
+ "number",
40
+ "title",
41
+ "body",
42
+ "state",
43
+ "url",
44
+ "repo",
45
+ "author",
46
+ "labels",
47
+ "assignees",
48
+ "createdAt",
49
+ "updatedAt",
50
+ "comments",
51
+ "githubConnected",
52
+ ],
53
+ },
54
+ },
55
+ timeoutMs: 15_000,
56
+ async handler(args, signal) {
57
+ const issueRef = requireString(args, "issueRef", 500);
58
+ try {
59
+ const issue = await fetchGitHubIssue(issueRef, signal);
60
+ return successStructured({ ...issue, githubConnected: true });
61
+ }
62
+ catch (err) {
63
+ const notConnected = err instanceof Error && err.message.includes("not connected");
64
+ return successStructured({
65
+ number: 0,
66
+ title: "",
67
+ body: "",
68
+ state: "",
69
+ url: "",
70
+ repo: "",
71
+ author: "",
72
+ labels: [],
73
+ assignees: [],
74
+ createdAt: "",
75
+ updatedAt: "",
76
+ comments: 0,
77
+ githubConnected: !notConnected,
78
+ error: err instanceof Error ? err.message : String(err),
79
+ });
80
+ }
81
+ },
82
+ };
83
+ }
84
+ //# sourceMappingURL=fetchGithubIssue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchGithubIssue.js","sourceRoot":"","sources":["../../src/tools/fetchGithubIssue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,UAAU,0BAA0B;IACxC,OAAO;QACL,MAAM,EAAE;YACN,IAAI,EAAE,kBAAkB;YACxB,WAAW,EACT,uJAAuJ;YACzJ,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;YACnC,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,QAAQ,EAAE,CAAC,UAAU,CAAC;gBACtB,UAAU,EAAE;oBACV,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EACT,0FAA0F;wBAC5F,SAAS,EAAE,GAAG;qBACf;iBACF;gBACD,oBAAoB,EAAE,KAAc;aACrC;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACvB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACxB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC1B,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK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oBACV,MAAM,EAAE,EAAE;oBACV,SAAS,EAAE,EAAE;oBACb,SAAS,EAAE,EAAE;oBACb,SAAS,EAAE,EAAE;oBACb,QAAQ,EAAE,CAAC;oBACX,eAAe,EAAE,CAAC,YAAY;oBAC9B,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;iBACxD,CAAC,CAAC;YACL,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,89 @@
1
+ export declare function createFetchGithubPRTool(): {
2
+ schema: {
3
+ name: string;
4
+ description: string;
5
+ annotations: {
6
+ readOnlyHint: boolean;
7
+ };
8
+ inputSchema: {
9
+ type: "object";
10
+ required: string[];
11
+ properties: {
12
+ prRef: {
13
+ type: string;
14
+ description: string;
15
+ maxLength: number;
16
+ };
17
+ };
18
+ additionalProperties: false;
19
+ };
20
+ outputSchema: {
21
+ type: "object";
22
+ properties: {
23
+ number: {
24
+ type: string;
25
+ };
26
+ title: {
27
+ type: string;
28
+ };
29
+ body: {
30
+ type: string;
31
+ };
32
+ state: {
33
+ type: string;
34
+ };
35
+ url: {
36
+ type: string;
37
+ };
38
+ repo: {
39
+ type: string;
40
+ };
41
+ author: {
42
+ type: string;
43
+ };
44
+ isDraft: {
45
+ type: string;
46
+ };
47
+ reviewDecision: {
48
+ type: string;
49
+ };
50
+ labels: {
51
+ type: string;
52
+ items: {
53
+ type: string;
54
+ };
55
+ };
56
+ headBranch: {
57
+ type: string;
58
+ };
59
+ baseBranch: {
60
+ type: string;
61
+ };
62
+ createdAt: {
63
+ type: string;
64
+ };
65
+ updatedAt: {
66
+ type: string;
67
+ };
68
+ additions: {
69
+ type: string;
70
+ };
71
+ deletions: {
72
+ type: string;
73
+ };
74
+ githubConnected: {
75
+ type: string;
76
+ };
77
+ };
78
+ required: string[];
79
+ };
80
+ };
81
+ timeoutMs: number;
82
+ handler(args: Record<string, unknown>, signal?: AbortSignal): Promise<{
83
+ content: Array<{
84
+ type: string;
85
+ text: string;
86
+ }>;
87
+ structuredContent: unknown;
88
+ }>;
89
+ };
@@ -0,0 +1,96 @@
1
+ import { fetchGitHubPR } from "../connectors/github.js";
2
+ import { requireString, successStructured } from "./utils.js";
3
+ export function createFetchGithubPRTool() {
4
+ return {
5
+ schema: {
6
+ name: "fetchGithubPR",
7
+ description: "Fetch a GitHub pull request by URL or owner/repo#number ref. Returns title, body, state, branches, labels, review decision, and diff stats. Requires GitHub connector connected.",
8
+ annotations: { readOnlyHint: true },
9
+ inputSchema: {
10
+ type: "object",
11
+ required: ["prRef"],
12
+ properties: {
13
+ prRef: {
14
+ type: "string",
15
+ description: "GitHub PR URL (https://github.com/owner/repo/pull/42) or short ref (owner/repo#42).",
16
+ maxLength: 500,
17
+ },
18
+ },
19
+ additionalProperties: false,
20
+ },
21
+ outputSchema: {
22
+ type: "object",
23
+ properties: {
24
+ number: { type: "integer" },
25
+ title: { type: "string" },
26
+ body: { type: "string" },
27
+ state: { type: "string" },
28
+ url: { type: "string" },
29
+ repo: { type: "string" },
30
+ author: { type: "string" },
31
+ isDraft: { type: "boolean" },
32
+ reviewDecision: { type: "string" },
33
+ labels: { type: "array", items: { type: "string" } },
34
+ headBranch: { type: "string" },
35
+ baseBranch: { type: "string" },
36
+ createdAt: { type: "string" },
37
+ updatedAt: { type: "string" },
38
+ additions: { type: "integer" },
39
+ deletions: { type: "integer" },
40
+ githubConnected: { type: "boolean" },
41
+ },
42
+ required: [
43
+ "number",
44
+ "title",
45
+ "body",
46
+ "state",
47
+ "url",
48
+ "repo",
49
+ "author",
50
+ "isDraft",
51
+ "reviewDecision",
52
+ "labels",
53
+ "headBranch",
54
+ "baseBranch",
55
+ "createdAt",
56
+ "updatedAt",
57
+ "additions",
58
+ "deletions",
59
+ "githubConnected",
60
+ ],
61
+ },
62
+ },
63
+ timeoutMs: 15_000,
64
+ async handler(args, signal) {
65
+ const prRef = requireString(args, "prRef", 500);
66
+ try {
67
+ const pr = await fetchGitHubPR(prRef, signal);
68
+ return successStructured({ ...pr, githubConnected: true });
69
+ }
70
+ catch (err) {
71
+ const notConnected = err instanceof Error && err.message.includes("not connected");
72
+ return successStructured({
73
+ number: 0,
74
+ title: "",
75
+ body: "",
76
+ state: "",
77
+ url: "",
78
+ repo: "",
79
+ author: "",
80
+ isDraft: false,
81
+ reviewDecision: "",
82
+ labels: [],
83
+ headBranch: "",
84
+ baseBranch: "",
85
+ createdAt: "",
86
+ updatedAt: "",
87
+ additions: 0,
88
+ deletions: 0,
89
+ githubConnected: !notConnected,
90
+ error: err instanceof Error ? err.message : String(err),
91
+ });
92
+ }
93
+ },
94
+ };
95
+ }
96
+ //# sourceMappingURL=fetchGithubPR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchGithubPR.js","sourceRoot":"","sources":["../../src/tools/fetchGithubPR.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,MAAM,EAAE;YACN,IAAI,EAAE,eAAe;YACrB,WAAW,EACT,kLAAkL;YACpL,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;YACnC,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,QAAQ,EAAE,CAAC,OAAO,CAAC;gBACnB,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EACT,qFAAqF;wBACvF,SAAS,EAAE,GAAG;qBACf;iBACF;gBACD,oBAAoB,EAAE,KAAc;aACrC;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,QA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C;YAChD,IAAI,CAAC;gBACH,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBAC9C,OAAO,iBAAiB,CAAC,EAAE,GAAG,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7D,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,YAAY,GAChB,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;gBAChE,OAAO,iBAAiB,CAAC;oBACvB,MAAM,EAAE,CAAC;oBACT,KAAK,EAAE,EAAE;oBACT,IAAI,EAAE,EAAE;oBACR,KAAK,EAAE,EAAE;oBACT,GAAG,EAAE,EAAE;oBACP,IAAI,EAAE,EAAE;oBACR,MAAM,EAAE,EAAE;oBACV,OAAO,EAAE,KAAK;oBACd,cAAc,EAAE,EAAE;oBAClB,MAAM,EAAE,EAAE;oBACV,UAAU,EAAE,EAAE;oBACd,UAAU,EAAE,EAAE;oBACd,SAAS,EAAE,EAAE;oBACb,SAAS,EAAE,EAAE;oBACb,SAAS,EAAE,CAAC;oBACZ,SAAS,EAAE,CAAC;oBACZ,eAAe,EAAE,CAAC,YAAY;oBAC9B,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;iBACxD,CAAC,CAAC;YACL,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * fetchLinearIssue — fetch a Linear issue by ID or URL.
3
+ *
4
+ * Returns title, description, state, assignee, labels, priority, and URL
5
+ * in a single call. Requires Linear connector to be connected.
6
+ */
7
+ export declare function createFetchLinearIssueTool(): {
8
+ schema: {
9
+ name: string;
10
+ description: string;
11
+ annotations: {
12
+ readOnlyHint: boolean;
13
+ };
14
+ inputSchema: {
15
+ type: "object";
16
+ required: string[];
17
+ properties: {
18
+ issueId: {
19
+ type: string;
20
+ description: string;
21
+ maxLength: number;
22
+ };
23
+ };
24
+ additionalProperties: false;
25
+ };
26
+ outputSchema: {
27
+ type: "object";
28
+ properties: {
29
+ id: {
30
+ type: string;
31
+ };
32
+ identifier: {
33
+ type: string;
34
+ };
35
+ title: {
36
+ type: string;
37
+ };
38
+ description: {
39
+ type: string[];
40
+ };
41
+ state: {
42
+ type: string;
43
+ properties: {
44
+ name: {
45
+ type: string;
46
+ };
47
+ type: {
48
+ type: string;
49
+ };
50
+ };
51
+ required: string[];
52
+ };
53
+ assignee: {
54
+ type: string[];
55
+ properties: {
56
+ name: {
57
+ type: string;
58
+ };
59
+ email: {
60
+ type: string;
61
+ };
62
+ };
63
+ };
64
+ priority: {
65
+ type: string;
66
+ };
67
+ priorityLabel: {
68
+ type: string;
69
+ };
70
+ url: {
71
+ type: string;
72
+ };
73
+ team: {
74
+ type: string;
75
+ properties: {
76
+ name: {
77
+ type: string;
78
+ };
79
+ key: {
80
+ type: string;
81
+ };
82
+ };
83
+ required: string[];
84
+ };
85
+ labels: {
86
+ type: string;
87
+ items: {
88
+ type: string;
89
+ };
90
+ };
91
+ createdAt: {
92
+ type: string;
93
+ };
94
+ updatedAt: {
95
+ type: string;
96
+ };
97
+ linearConnected: {
98
+ type: string;
99
+ };
100
+ };
101
+ required: string[];
102
+ };
103
+ };
104
+ timeoutMs: number;
105
+ handler(args: Record<string, unknown>, signal?: AbortSignal): Promise<{
106
+ content: Array<{
107
+ type: string;
108
+ text: string;
109
+ }>;
110
+ structuredContent: unknown;
111
+ }>;
112
+ };
@@ -0,0 +1,129 @@
1
+ import { fetchIssue } from "../connectors/linear.js";
2
+ import { requireString, successStructured } from "./utils.js";
3
+ /**
4
+ * fetchLinearIssue — fetch a Linear issue by ID or URL.
5
+ *
6
+ * Returns title, description, state, assignee, labels, priority, and URL
7
+ * in a single call. Requires Linear connector to be connected.
8
+ */
9
+ export function createFetchLinearIssueTool() {
10
+ return {
11
+ schema: {
12
+ name: "fetchLinearIssue",
13
+ description: "Fetch a Linear issue by identifier or URL. Returns title, description, state, assignee, labels, and priority. Requires Linear connector connected.",
14
+ annotations: { readOnlyHint: true },
15
+ inputSchema: {
16
+ type: "object",
17
+ required: ["issueId"],
18
+ properties: {
19
+ issueId: {
20
+ type: "string",
21
+ description: "Linear issue identifier (e.g. 'LIN-42', 'TEAM-123') or full issue URL.",
22
+ maxLength: 500,
23
+ },
24
+ },
25
+ additionalProperties: false,
26
+ },
27
+ outputSchema: {
28
+ type: "object",
29
+ properties: {
30
+ id: { type: "string" },
31
+ identifier: { type: "string" },
32
+ title: { type: "string" },
33
+ description: { type: ["string", "null"] },
34
+ state: {
35
+ type: "object",
36
+ properties: {
37
+ name: { type: "string" },
38
+ type: { type: "string" },
39
+ },
40
+ required: ["name", "type"],
41
+ },
42
+ assignee: {
43
+ type: ["object", "null"],
44
+ properties: {
45
+ name: { type: "string" },
46
+ email: { type: "string" },
47
+ },
48
+ },
49
+ priority: { type: "integer" },
50
+ priorityLabel: { type: "string" },
51
+ url: { type: "string" },
52
+ team: {
53
+ type: "object",
54
+ properties: {
55
+ name: { type: "string" },
56
+ key: { type: "string" },
57
+ },
58
+ required: ["name", "key"],
59
+ },
60
+ labels: {
61
+ type: "array",
62
+ items: { type: "string" },
63
+ },
64
+ createdAt: { type: "string" },
65
+ updatedAt: { type: "string" },
66
+ linearConnected: { type: "boolean" },
67
+ },
68
+ required: [
69
+ "id",
70
+ "identifier",
71
+ "title",
72
+ "state",
73
+ "priority",
74
+ "priorityLabel",
75
+ "url",
76
+ "team",
77
+ "labels",
78
+ "createdAt",
79
+ "updatedAt",
80
+ "linearConnected",
81
+ ],
82
+ },
83
+ },
84
+ timeoutMs: 15_000,
85
+ async handler(args, signal) {
86
+ const issueId = requireString(args, "issueId", 500);
87
+ try {
88
+ const issue = await fetchIssue(issueId, signal);
89
+ return successStructured({
90
+ id: issue.id,
91
+ identifier: issue.identifier,
92
+ title: issue.title,
93
+ description: issue.description ?? null,
94
+ state: issue.state,
95
+ assignee: issue.assignee ?? null,
96
+ priority: issue.priority,
97
+ priorityLabel: issue.priorityLabel,
98
+ url: issue.url,
99
+ team: issue.team,
100
+ labels: issue.labels.nodes.map((l) => l.name),
101
+ createdAt: issue.createdAt,
102
+ updatedAt: issue.updatedAt,
103
+ linearConnected: true,
104
+ });
105
+ }
106
+ catch (err) {
107
+ const notConnected = err instanceof Error && err.message.includes("not connected");
108
+ return successStructured({
109
+ id: "",
110
+ identifier: issueId,
111
+ title: "",
112
+ description: null,
113
+ state: { name: "", type: "" },
114
+ assignee: null,
115
+ priority: 0,
116
+ priorityLabel: "",
117
+ url: "",
118
+ team: { name: "", key: "" },
119
+ labels: [],
120
+ createdAt: "",
121
+ updatedAt: "",
122
+ linearConnected: !notConnected,
123
+ error: err instanceof Error ? err.message : String(err),
124
+ });
125
+ }
126
+ },
127
+ };
128
+ }
129
+ //# sourceMappingURL=fetchLinearIssue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchLinearIssue.js","sourceRoot":"","sources":["../../src/tools/fetchLinearIssue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO;QACL,MAAM,EAAE;YACN,IAAI,EAAE,kBAAkB;YACxB,WAAW,EACT,oJAAoJ;YACtJ,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;YACnC,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,IAAI,EAAE,QAAQ;wBACd,WAAW,EACT,wEAAwE;wBAC1E,SAAS,EAAE,GAAG;qBACf;iBACF;gBACD,oBAAoB,EAAE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AAC,CAAC;YACL,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,YAAY,GAChB,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;gBAChE,OAAO,iBAAiB,CAAC;oBACvB,EAAE,EAAE,EAAE;oBACN,UAAU,EAAE,OAAO;oBACnB,KAAK,EAAE,EAAE;oBACT,WAAW,EAAE,IAAI;oBACjB,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;oBAC7B,QAAQ,EAAE,IAAI;oBACd,QAAQ,EAAE,CAAC;oBACX,aAAa,EAAE,EAAE;oBACjB,GAAG,EAAE,EAAE;oBACP,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;oBAC3B,MAAM,EAAE,EAAE;oBACV,SAAS,EAAE,EAAE;oBACb,SAAS,EAAE,EAAE;oBACb,eAAe,EAAE,CAAC,YAAY;oBAC9B,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;iBACxD,CAAC,CAAC;YACL,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,143 @@
1
+ /**
2
+ * fetchSentryIssue — fetch a Sentry issue/event and enrich its stack trace
3
+ * with git blame data in one call.
4
+ *
5
+ * Combines:
6
+ * 1. Sentry API fetch → raw stack trace text
7
+ * 2. enrichStackTrace → per-frame commit attribution + top suspect
8
+ *
9
+ * Requires Sentry connector to be connected (POST /connections/sentry/connect).
10
+ */
11
+ export declare function createFetchSentryIssueTool(workspace: string): {
12
+ schema: {
13
+ name: string;
14
+ description: string;
15
+ annotations: {
16
+ readOnlyHint: boolean;
17
+ };
18
+ inputSchema: {
19
+ type: "object";
20
+ required: string[];
21
+ properties: {
22
+ issueId: {
23
+ type: string;
24
+ description: string;
25
+ maxLength: number;
26
+ };
27
+ maxFrames: {
28
+ type: string;
29
+ minimum: number;
30
+ maximum: number;
31
+ description: string;
32
+ };
33
+ };
34
+ additionalProperties: false;
35
+ };
36
+ outputSchema: {
37
+ type: "object";
38
+ properties: {
39
+ issueId: {
40
+ type: string;
41
+ };
42
+ title: {
43
+ type: string;
44
+ };
45
+ stackTrace: {
46
+ type: string;
47
+ };
48
+ frames: {
49
+ type: string;
50
+ items: {
51
+ type: string;
52
+ properties: {
53
+ file: {
54
+ type: string;
55
+ };
56
+ line: {
57
+ type: string;
58
+ };
59
+ column: {
60
+ type: string[];
61
+ };
62
+ function: {
63
+ type: string[];
64
+ };
65
+ language: {
66
+ type: string;
67
+ };
68
+ inWorkspace: {
69
+ type: string;
70
+ };
71
+ resolvedPath: {
72
+ type: string[];
73
+ };
74
+ commit: {
75
+ type: string[];
76
+ properties: {
77
+ sha: {
78
+ type: string;
79
+ };
80
+ author: {
81
+ type: string;
82
+ };
83
+ date: {
84
+ type: string;
85
+ };
86
+ subject: {
87
+ type: string;
88
+ };
89
+ };
90
+ };
91
+ };
92
+ required: string[];
93
+ };
94
+ };
95
+ topSuspect: {
96
+ type: string[];
97
+ properties: {
98
+ sha: {
99
+ type: string;
100
+ };
101
+ author: {
102
+ type: string;
103
+ };
104
+ date: {
105
+ type: string;
106
+ };
107
+ subject: {
108
+ type: string;
109
+ };
110
+ frameCount: {
111
+ type: string;
112
+ };
113
+ };
114
+ };
115
+ confidence: {
116
+ type: string;
117
+ enum: string[];
118
+ };
119
+ framesParsed: {
120
+ type: string;
121
+ };
122
+ framesBlamed: {
123
+ type: string;
124
+ };
125
+ gitAvailable: {
126
+ type: string;
127
+ };
128
+ sentryConnected: {
129
+ type: string;
130
+ };
131
+ };
132
+ required: string[];
133
+ };
134
+ };
135
+ timeoutMs: number;
136
+ handler(args: Record<string, unknown>, signal?: AbortSignal): Promise<{
137
+ content: Array<{
138
+ type: string;
139
+ text: string;
140
+ }>;
141
+ structuredContent: unknown;
142
+ }>;
143
+ };