patchwork-os 0.2.0-alpha.3 → 0.2.0-alpha.31
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/README.bridge.md +6 -0
- package/README.md +40 -15
- package/deploy/bootstrap-vps.sh +184 -0
- package/deploy/deploy-dashboard.sh +174 -0
- package/deploy/deploy-landing.sh +79 -0
- package/dist/activationMetrics.d.ts +67 -0
- package/dist/activationMetrics.js +255 -0
- package/dist/activationMetrics.js.map +1 -0
- package/dist/approvalHttp.d.ts +24 -2
- package/dist/approvalHttp.js +150 -10
- package/dist/approvalHttp.js.map +1 -1
- package/dist/approvalQueue.d.ts +16 -1
- package/dist/approvalQueue.js +44 -3
- package/dist/approvalQueue.js.map +1 -1
- package/dist/automation.d.ts +20 -0
- package/dist/automation.js +54 -1
- package/dist/automation.js.map +1 -1
- package/dist/bridge.d.ts +2 -0
- package/dist/bridge.js +55 -130
- package/dist/bridge.js.map +1 -1
- package/dist/bridgeToken.js +57 -19
- package/dist/bridgeToken.js.map +1 -1
- package/dist/ccPermissions.js +6 -4
- package/dist/ccPermissions.js.map +1 -1
- package/dist/claudeOrchestrator.d.ts +1 -1
- package/dist/claudeOrchestrator.js +14 -8
- package/dist/claudeOrchestrator.js.map +1 -1
- package/dist/commands/launchd.d.ts +2 -0
- package/dist/commands/launchd.js +94 -0
- package/dist/commands/launchd.js.map +1 -0
- package/dist/commands/recipe.d.ts +258 -0
- package/dist/commands/recipe.js +1130 -0
- package/dist/commands/recipe.js.map +1 -0
- package/dist/commands/recipeInstall.d.ts +72 -0
- package/dist/commands/recipeInstall.js +339 -0
- package/dist/commands/recipeInstall.js.map +1 -0
- package/dist/config.d.ts +14 -1
- package/dist/config.js +99 -8
- package/dist/config.js.map +1 -1
- package/dist/connectors/baseConnector.d.ts +117 -0
- package/dist/connectors/baseConnector.js +213 -0
- package/dist/connectors/baseConnector.js.map +1 -0
- package/dist/connectors/confluence.d.ts +111 -0
- package/dist/connectors/confluence.js +406 -0
- package/dist/connectors/confluence.js.map +1 -0
- package/dist/connectors/datadog.d.ts +116 -0
- package/dist/connectors/datadog.js +385 -0
- package/dist/connectors/datadog.js.map +1 -0
- package/dist/connectors/fixtureLibrary.d.ts +21 -0
- package/dist/connectors/fixtureLibrary.js +70 -0
- package/dist/connectors/fixtureLibrary.js.map +1 -0
- package/dist/connectors/fixtureRecorder.d.ts +1 -0
- package/dist/connectors/fixtureRecorder.js +35 -0
- package/dist/connectors/fixtureRecorder.js.map +1 -0
- package/dist/connectors/github.d.ts +58 -8
- package/dist/connectors/github.js +312 -84
- package/dist/connectors/github.js.map +1 -1
- package/dist/connectors/gmail.d.ts +4 -1
- package/dist/connectors/gmail.js +79 -16
- package/dist/connectors/gmail.js.map +1 -1
- package/dist/connectors/googleCalendar.d.ts +60 -0
- package/dist/connectors/googleCalendar.js +345 -0
- package/dist/connectors/googleCalendar.js.map +1 -0
- package/dist/connectors/hubspot.d.ts +112 -0
- package/dist/connectors/hubspot.js +408 -0
- package/dist/connectors/hubspot.js.map +1 -0
- package/dist/connectors/intercom.d.ts +102 -0
- package/dist/connectors/intercom.js +402 -0
- package/dist/connectors/intercom.js.map +1 -0
- package/dist/connectors/jira.d.ts +98 -0
- package/dist/connectors/jira.js +379 -0
- package/dist/connectors/jira.js.map +1 -0
- package/dist/connectors/linear.d.ts +69 -19
- package/dist/connectors/linear.js +170 -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 +84 -0
- package/dist/connectors/mcpOAuth.js +389 -0
- package/dist/connectors/mcpOAuth.js.map +1 -0
- package/dist/connectors/mockConnector.d.ts +28 -0
- package/dist/connectors/mockConnector.js +81 -0
- package/dist/connectors/mockConnector.js.map +1 -0
- package/dist/connectors/notion.d.ts +143 -0
- package/dist/connectors/notion.js +424 -0
- package/dist/connectors/notion.js.map +1 -0
- package/dist/connectors/sentry.d.ts +17 -21
- package/dist/connectors/sentry.js +115 -131
- package/dist/connectors/sentry.js.map +1 -1
- package/dist/connectors/slack.d.ts +50 -0
- package/dist/connectors/slack.js +324 -0
- package/dist/connectors/slack.js.map +1 -0
- package/dist/connectors/stripe.d.ts +116 -0
- package/dist/connectors/stripe.js +379 -0
- package/dist/connectors/stripe.js.map +1 -0
- package/dist/connectors/tokenStorage.d.ts +35 -0
- package/dist/connectors/tokenStorage.js +459 -0
- package/dist/connectors/tokenStorage.js.map +1 -0
- package/dist/connectors/zendesk.d.ts +104 -0
- package/dist/connectors/zendesk.js +424 -0
- package/dist/connectors/zendesk.js.map +1 -0
- package/dist/drivers/gemini/index.d.ts +5 -1
- package/dist/drivers/gemini/index.js +39 -5
- package/dist/drivers/gemini/index.js.map +1 -1
- package/dist/drivers/index.d.ts +5 -0
- package/dist/drivers/index.js +1 -1
- package/dist/drivers/index.js.map +1 -1
- package/dist/featureFlags.d.ts +73 -0
- package/dist/featureFlags.js +203 -0
- package/dist/featureFlags.js.map +1 -0
- package/dist/fp/automationInterpreter.js +1 -0
- package/dist/fp/automationInterpreter.js.map +1 -1
- package/dist/fp/automationProgram.d.ts +1 -1
- package/dist/fp/automationProgram.js.map +1 -1
- package/dist/fp/policyParser.js +17 -0
- package/dist/fp/policyParser.js.map +1 -1
- package/dist/index.js +621 -61
- package/dist/index.js.map +1 -1
- package/dist/installGuard.d.ts +25 -0
- package/dist/installGuard.js +48 -0
- package/dist/installGuard.js.map +1 -0
- package/dist/oauth.d.ts +4 -1
- package/dist/oauth.js +50 -14
- package/dist/oauth.js.map +1 -1
- package/dist/patchworkConfig.d.ts +9 -0
- package/dist/patchworkConfig.js.map +1 -1
- package/dist/recipeOrchestration.d.ts +53 -0
- package/dist/recipeOrchestration.js +272 -0
- package/dist/recipeOrchestration.js.map +1 -0
- package/dist/recipes/RecipeOrchestrator.d.ts +40 -0
- package/dist/recipes/RecipeOrchestrator.js +51 -0
- package/dist/recipes/RecipeOrchestrator.js.map +1 -0
- package/dist/recipes/agentExecutor.d.ts +28 -0
- package/dist/recipes/agentExecutor.js +42 -0
- package/dist/recipes/agentExecutor.js.map +1 -0
- package/dist/recipes/chainedRunner.d.ts +140 -0
- package/dist/recipes/chainedRunner.js +539 -0
- package/dist/recipes/chainedRunner.js.map +1 -0
- package/dist/recipes/dependencyGraph.d.ts +39 -0
- package/dist/recipes/dependencyGraph.js +199 -0
- package/dist/recipes/dependencyGraph.js.map +1 -0
- package/dist/recipes/legacyRecipeCompat.d.ts +2 -0
- package/dist/recipes/legacyRecipeCompat.js +112 -0
- package/dist/recipes/legacyRecipeCompat.js.map +1 -0
- package/dist/recipes/manifest.d.ts +47 -0
- package/dist/recipes/manifest.js +141 -0
- package/dist/recipes/manifest.js.map +1 -0
- package/dist/recipes/nestedRecipeStep.d.ts +58 -0
- package/dist/recipes/nestedRecipeStep.js +95 -0
- package/dist/recipes/nestedRecipeStep.js.map +1 -0
- package/dist/recipes/outputRegistry.d.ts +28 -0
- package/dist/recipes/outputRegistry.js +52 -0
- package/dist/recipes/outputRegistry.js.map +1 -0
- package/dist/recipes/scheduler.d.ts +23 -7
- package/dist/recipes/scheduler.js +131 -41
- package/dist/recipes/scheduler.js.map +1 -1
- package/dist/recipes/schema.d.ts +17 -2
- package/dist/recipes/schemaGenerator.d.ts +28 -0
- package/dist/recipes/schemaGenerator.js +565 -0
- package/dist/recipes/schemaGenerator.js.map +1 -0
- package/dist/recipes/templateEngine.d.ts +62 -0
- package/dist/recipes/templateEngine.js +182 -0
- package/dist/recipes/templateEngine.js.map +1 -0
- package/dist/recipes/toolRegistry.d.ts +181 -0
- package/dist/recipes/toolRegistry.js +300 -0
- package/dist/recipes/toolRegistry.js.map +1 -0
- package/dist/recipes/tools/calendar.d.ts +6 -0
- package/dist/recipes/tools/calendar.js +61 -0
- package/dist/recipes/tools/calendar.js.map +1 -0
- package/dist/recipes/tools/confluence.d.ts +6 -0
- package/dist/recipes/tools/confluence.js +254 -0
- package/dist/recipes/tools/confluence.js.map +1 -0
- package/dist/recipes/tools/datadog.d.ts +6 -0
- package/dist/recipes/tools/datadog.js +239 -0
- package/dist/recipes/tools/datadog.js.map +1 -0
- package/dist/recipes/tools/diagnostics.d.ts +6 -0
- package/dist/recipes/tools/diagnostics.js +36 -0
- package/dist/recipes/tools/diagnostics.js.map +1 -0
- package/dist/recipes/tools/file.d.ts +6 -0
- package/dist/recipes/tools/file.js +170 -0
- package/dist/recipes/tools/file.js.map +1 -0
- package/dist/recipes/tools/git.d.ts +6 -0
- package/dist/recipes/tools/git.js +63 -0
- package/dist/recipes/tools/git.js.map +1 -0
- package/dist/recipes/tools/github.d.ts +6 -0
- package/dist/recipes/tools/github.js +91 -0
- package/dist/recipes/tools/github.js.map +1 -0
- package/dist/recipes/tools/gmail.d.ts +6 -0
- package/dist/recipes/tools/gmail.js +210 -0
- package/dist/recipes/tools/gmail.js.map +1 -0
- package/dist/recipes/tools/hubspot.d.ts +6 -0
- package/dist/recipes/tools/hubspot.js +232 -0
- package/dist/recipes/tools/hubspot.js.map +1 -0
- package/dist/recipes/tools/index.d.ts +22 -0
- package/dist/recipes/tools/index.js +25 -0
- package/dist/recipes/tools/index.js.map +1 -0
- package/dist/recipes/tools/intercom.d.ts +6 -0
- package/dist/recipes/tools/intercom.js +226 -0
- package/dist/recipes/tools/intercom.js.map +1 -0
- package/dist/recipes/tools/linear.d.ts +6 -0
- package/dist/recipes/tools/linear.js +83 -0
- package/dist/recipes/tools/linear.js.map +1 -0
- package/dist/recipes/tools/notion.d.ts +6 -0
- package/dist/recipes/tools/notion.js +278 -0
- package/dist/recipes/tools/notion.js.map +1 -0
- package/dist/recipes/tools/slack.d.ts +6 -0
- package/dist/recipes/tools/slack.js +72 -0
- package/dist/recipes/tools/slack.js.map +1 -0
- package/dist/recipes/tools/stripe.d.ts +6 -0
- package/dist/recipes/tools/stripe.js +265 -0
- package/dist/recipes/tools/stripe.js.map +1 -0
- package/dist/recipes/tools/zendesk.d.ts +6 -0
- package/dist/recipes/tools/zendesk.js +245 -0
- package/dist/recipes/tools/zendesk.js.map +1 -0
- package/dist/recipes/validation.d.ts +13 -0
- package/dist/recipes/validation.js +433 -0
- package/dist/recipes/validation.js.map +1 -0
- package/dist/recipes/yamlRunner.d.ts +87 -0
- package/dist/recipes/yamlRunner.js +693 -409
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/recipesHttp.d.ts +34 -6
- package/dist/recipesHttp.js +285 -15
- package/dist/recipesHttp.js.map +1 -1
- package/dist/riskTier.js +1 -0
- package/dist/riskTier.js.map +1 -1
- package/dist/runLog.d.ts +23 -0
- package/dist/runLog.js +56 -1
- package/dist/runLog.js.map +1 -1
- package/dist/schemas/dry-run-plan.v1.json +139 -0
- package/dist/schemas/recipe.v1.json +684 -0
- package/dist/server.d.ts +32 -1
- package/dist/server.js +980 -97
- package/dist/server.js.map +1 -1
- package/dist/streamableHttp.js +2 -0
- package/dist/streamableHttp.js.map +1 -1
- package/dist/tools/addLinearComment.d.ts +55 -0
- package/dist/tools/addLinearComment.js +72 -0
- package/dist/tools/addLinearComment.js.map +1 -0
- package/dist/tools/bridgeDoctor.js +2 -2
- package/dist/tools/bridgeDoctor.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/fetchSlackProfile.d.ts +43 -0
- package/dist/tools/fetchSlackProfile.js +46 -0
- package/dist/tools/fetchSlackProfile.js.map +1 -0
- package/dist/tools/getConnectorStatus.d.ts +58 -0
- package/dist/tools/getConnectorStatus.js +56 -0
- package/dist/tools/getConnectorStatus.js.map +1 -0
- package/dist/tools/github/actions.js +4 -2
- package/dist/tools/github/actions.js.map +1 -1
- package/dist/tools/github/composite.d.ts +339 -0
- package/dist/tools/github/composite.js +343 -0
- package/dist/tools/github/composite.js.map +1 -0
- package/dist/tools/github/index.d.ts +2 -1
- package/dist/tools/github/index.js +2 -1
- package/dist/tools/github/index.js.map +1 -1
- package/dist/tools/github/issues.js +8 -4
- package/dist/tools/github/issues.js.map +1 -1
- package/dist/tools/github/pr.d.ts +122 -0
- package/dist/tools/github/pr.js +195 -5
- package/dist/tools/github/pr.js.map +1 -1
- package/dist/tools/index.js +32 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/searchTools.js +1 -1
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/tools/slackListChannels.d.ts +65 -0
- package/dist/tools/slackListChannels.js +70 -0
- package/dist/tools/slackListChannels.js.map +1 -0
- package/dist/tools/slackPostMessage.d.ts +57 -0
- package/dist/tools/slackPostMessage.js +77 -0
- package/dist/tools/slackPostMessage.js.map +1 -0
- package/dist/tools/testTraceToSource.js +2 -2
- package/dist/tools/testTraceToSource.js.map +1 -1
- package/dist/tools/updateLinearIssue.d.ts +89 -0
- package/dist/tools/updateLinearIssue.js +117 -0
- package/dist/tools/updateLinearIssue.js.map +1 -0
- package/dist/transport.d.ts +7 -1
- package/dist/transport.js +85 -11
- package/dist/transport.js.map +1 -1
- package/package.json +5 -2
- package/scripts/start-all.sh +56 -19
- package/templates/automation-policies/recipe-authoring.json +25 -0
- package/templates/automation-policy.example.json +6 -0
- package/templates/co.patchwork-os.bridge.plist +34 -0
- package/templates/recipes/ctx-loop-test.yaml +75 -0
- package/templates/recipes/lint-on-save.yaml +1 -2
- package/templates/recipes/morning-brief-slack.yaml +57 -0
- package/templates/recipes/morning-brief.yaml +14 -6
- package/templates/recipes/project-health-check.yaml +50 -0
- package/templates/recipes/sentry-to-linear.yaml +77 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import type { PullRequestCallbackResult } from "./pr.js";
|
|
2
|
+
export declare function createGithubPRTool(workspace: string, onPullRequest?: (result: PullRequestCallbackResult) => void, _defaultRepo?: string | null): {
|
|
3
|
+
schema: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
annotations: {
|
|
7
|
+
openWorldHint: boolean;
|
|
8
|
+
};
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object";
|
|
11
|
+
required: string[];
|
|
12
|
+
properties: {
|
|
13
|
+
operation: {
|
|
14
|
+
type: string;
|
|
15
|
+
enum: string[];
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
title: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
body: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
base: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
draft: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
assignee: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
number: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
prNumber: {
|
|
43
|
+
type: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
repo: {
|
|
47
|
+
type: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
state: {
|
|
51
|
+
type: string;
|
|
52
|
+
enum: string[];
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
limit: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
author: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
comments: {
|
|
64
|
+
type: string;
|
|
65
|
+
description: string;
|
|
66
|
+
items: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
event: {
|
|
71
|
+
type: string;
|
|
72
|
+
enum: string[];
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
mergeMethod: {
|
|
76
|
+
type: string;
|
|
77
|
+
enum: string[];
|
|
78
|
+
description: string;
|
|
79
|
+
};
|
|
80
|
+
commitTitle: {
|
|
81
|
+
type: string;
|
|
82
|
+
description: string;
|
|
83
|
+
};
|
|
84
|
+
commitMessage: {
|
|
85
|
+
type: string;
|
|
86
|
+
description: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
additionalProperties: false;
|
|
90
|
+
};
|
|
91
|
+
outputSchema: {
|
|
92
|
+
type: string;
|
|
93
|
+
description: string;
|
|
94
|
+
properties: {
|
|
95
|
+
url: {
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
number: {
|
|
99
|
+
type: string[];
|
|
100
|
+
};
|
|
101
|
+
title: {
|
|
102
|
+
type: string;
|
|
103
|
+
};
|
|
104
|
+
prs: {
|
|
105
|
+
type: string;
|
|
106
|
+
};
|
|
107
|
+
count: {
|
|
108
|
+
type: string;
|
|
109
|
+
};
|
|
110
|
+
state: {
|
|
111
|
+
type: string;
|
|
112
|
+
};
|
|
113
|
+
body: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
diff: {
|
|
117
|
+
type: string;
|
|
118
|
+
};
|
|
119
|
+
truncated: {
|
|
120
|
+
type: string;
|
|
121
|
+
};
|
|
122
|
+
reviewId: {
|
|
123
|
+
type: string[];
|
|
124
|
+
};
|
|
125
|
+
commentsPosted: {
|
|
126
|
+
type: string;
|
|
127
|
+
};
|
|
128
|
+
event: {
|
|
129
|
+
type: string;
|
|
130
|
+
};
|
|
131
|
+
merged: {
|
|
132
|
+
type: string;
|
|
133
|
+
};
|
|
134
|
+
sha: {
|
|
135
|
+
type: string;
|
|
136
|
+
};
|
|
137
|
+
message: {
|
|
138
|
+
type: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
handler: (args: Record<string, unknown>, signal?: AbortSignal) => Promise<{
|
|
144
|
+
content: Array<{
|
|
145
|
+
type: string;
|
|
146
|
+
text: string;
|
|
147
|
+
}>;
|
|
148
|
+
structuredContent: unknown;
|
|
149
|
+
} | {
|
|
150
|
+
content: Array<{
|
|
151
|
+
type: string;
|
|
152
|
+
text: string;
|
|
153
|
+
}>;
|
|
154
|
+
isError: true;
|
|
155
|
+
}>;
|
|
156
|
+
};
|
|
157
|
+
export declare function createGithubIssueTool(workspace: string): {
|
|
158
|
+
schema: {
|
|
159
|
+
name: string;
|
|
160
|
+
description: string;
|
|
161
|
+
annotations: {
|
|
162
|
+
openWorldHint: boolean;
|
|
163
|
+
};
|
|
164
|
+
inputSchema: {
|
|
165
|
+
type: "object";
|
|
166
|
+
required: string[];
|
|
167
|
+
properties: {
|
|
168
|
+
operation: {
|
|
169
|
+
type: string;
|
|
170
|
+
enum: string[];
|
|
171
|
+
description: string;
|
|
172
|
+
};
|
|
173
|
+
number: {
|
|
174
|
+
type: string;
|
|
175
|
+
description: string;
|
|
176
|
+
};
|
|
177
|
+
title: {
|
|
178
|
+
type: string;
|
|
179
|
+
description: string;
|
|
180
|
+
};
|
|
181
|
+
body: {
|
|
182
|
+
type: string;
|
|
183
|
+
description: string;
|
|
184
|
+
};
|
|
185
|
+
assignee: {
|
|
186
|
+
type: string;
|
|
187
|
+
description: string;
|
|
188
|
+
};
|
|
189
|
+
label: {
|
|
190
|
+
type: string;
|
|
191
|
+
description: string;
|
|
192
|
+
};
|
|
193
|
+
milestone: {
|
|
194
|
+
type: string;
|
|
195
|
+
description: string;
|
|
196
|
+
};
|
|
197
|
+
state: {
|
|
198
|
+
type: string;
|
|
199
|
+
enum: string[];
|
|
200
|
+
description: string;
|
|
201
|
+
};
|
|
202
|
+
limit: {
|
|
203
|
+
type: string;
|
|
204
|
+
description: string;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
additionalProperties: false;
|
|
208
|
+
};
|
|
209
|
+
outputSchema: {
|
|
210
|
+
type: string;
|
|
211
|
+
description: string;
|
|
212
|
+
properties: {
|
|
213
|
+
issues: {
|
|
214
|
+
type: string;
|
|
215
|
+
};
|
|
216
|
+
count: {
|
|
217
|
+
type: string;
|
|
218
|
+
};
|
|
219
|
+
number: {
|
|
220
|
+
type: string;
|
|
221
|
+
};
|
|
222
|
+
title: {
|
|
223
|
+
type: string;
|
|
224
|
+
};
|
|
225
|
+
state: {
|
|
226
|
+
type: string;
|
|
227
|
+
};
|
|
228
|
+
url: {
|
|
229
|
+
type: string;
|
|
230
|
+
};
|
|
231
|
+
body: {
|
|
232
|
+
type: string[];
|
|
233
|
+
};
|
|
234
|
+
issueNumber: {
|
|
235
|
+
type: string;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
handler: (args: Record<string, unknown>, signal?: AbortSignal) => Promise<{
|
|
241
|
+
content: Array<{
|
|
242
|
+
type: string;
|
|
243
|
+
text: string;
|
|
244
|
+
}>;
|
|
245
|
+
structuredContent: unknown;
|
|
246
|
+
} | {
|
|
247
|
+
content: Array<{
|
|
248
|
+
type: string;
|
|
249
|
+
text: string;
|
|
250
|
+
}>;
|
|
251
|
+
isError: true;
|
|
252
|
+
}>;
|
|
253
|
+
};
|
|
254
|
+
export declare function createGithubActionsTool(workspace: string, defaultRepo?: string | null): {
|
|
255
|
+
schema: {
|
|
256
|
+
name: string;
|
|
257
|
+
description: string;
|
|
258
|
+
annotations: {
|
|
259
|
+
readOnlyHint: boolean;
|
|
260
|
+
openWorldHint: boolean;
|
|
261
|
+
};
|
|
262
|
+
inputSchema: {
|
|
263
|
+
type: "object";
|
|
264
|
+
required: string[];
|
|
265
|
+
properties: {
|
|
266
|
+
operation: {
|
|
267
|
+
type: string;
|
|
268
|
+
enum: string[];
|
|
269
|
+
description: string;
|
|
270
|
+
};
|
|
271
|
+
branch: {
|
|
272
|
+
type: string;
|
|
273
|
+
description: string;
|
|
274
|
+
};
|
|
275
|
+
workflow: {
|
|
276
|
+
type: string;
|
|
277
|
+
description: string;
|
|
278
|
+
};
|
|
279
|
+
status: {
|
|
280
|
+
type: string;
|
|
281
|
+
description: string;
|
|
282
|
+
};
|
|
283
|
+
limit: {
|
|
284
|
+
type: string;
|
|
285
|
+
description: string;
|
|
286
|
+
};
|
|
287
|
+
runId: {
|
|
288
|
+
type: string;
|
|
289
|
+
description: string;
|
|
290
|
+
};
|
|
291
|
+
failedOnly: {
|
|
292
|
+
type: string;
|
|
293
|
+
description: string;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
additionalProperties: false;
|
|
297
|
+
};
|
|
298
|
+
outputSchema: {
|
|
299
|
+
type: string;
|
|
300
|
+
description: string;
|
|
301
|
+
properties: {
|
|
302
|
+
runs: {
|
|
303
|
+
type: string;
|
|
304
|
+
};
|
|
305
|
+
count: {
|
|
306
|
+
type: string;
|
|
307
|
+
};
|
|
308
|
+
runId: {
|
|
309
|
+
type: string;
|
|
310
|
+
};
|
|
311
|
+
failedOnly: {
|
|
312
|
+
type: string;
|
|
313
|
+
};
|
|
314
|
+
logs: {
|
|
315
|
+
type: string;
|
|
316
|
+
};
|
|
317
|
+
truncated: {
|
|
318
|
+
type: string;
|
|
319
|
+
};
|
|
320
|
+
note: {
|
|
321
|
+
type: string;
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
handler: (args: Record<string, unknown>, signal?: AbortSignal) => Promise<{
|
|
327
|
+
content: Array<{
|
|
328
|
+
type: string;
|
|
329
|
+
text: string;
|
|
330
|
+
}>;
|
|
331
|
+
structuredContent: unknown;
|
|
332
|
+
} | {
|
|
333
|
+
content: Array<{
|
|
334
|
+
type: string;
|
|
335
|
+
text: string;
|
|
336
|
+
}>;
|
|
337
|
+
isError: true;
|
|
338
|
+
}>;
|
|
339
|
+
};
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { error } from "../utils.js";
|
|
2
|
+
import { createGithubGetRunLogsTool, createGithubListRunsTool, } from "./actions.js";
|
|
3
|
+
import { createGithubCommentIssueTool, createGithubCreateIssueTool, createGithubGetIssueTool, createGithubListIssuesTool, } from "./issues.js";
|
|
4
|
+
import { createGithubApprovePRTool, createGithubCreatePRTool, createGithubGetPRDiffTool, createGithubListPRsTool, createGithubMergePRTool, createGithubPostPRReviewTool, createGithubViewPRTool, } from "./pr.js";
|
|
5
|
+
export function createGithubPRTool(workspace, onPullRequest, _defaultRepo = null) {
|
|
6
|
+
const createPR = createGithubCreatePRTool(workspace, onPullRequest);
|
|
7
|
+
const viewPR = createGithubViewPRTool(workspace);
|
|
8
|
+
const listPRs = createGithubListPRsTool(workspace);
|
|
9
|
+
const getDiff = createGithubGetPRDiffTool(workspace);
|
|
10
|
+
const postReview = createGithubPostPRReviewTool(workspace);
|
|
11
|
+
const approvePR = createGithubApprovePRTool(workspace);
|
|
12
|
+
const mergePR = createGithubMergePRTool(workspace);
|
|
13
|
+
return {
|
|
14
|
+
schema: {
|
|
15
|
+
name: "githubPR",
|
|
16
|
+
description: "Composite GitHub pull request tool. Dispatches to the appropriate operation based on 'operation' field.\n" +
|
|
17
|
+
"Operations:\n" +
|
|
18
|
+
" create — Create a PR (title required; optional: body, base, draft, assignee)\n" +
|
|
19
|
+
" view — View PR details (optional: number — omit for current branch)\n" +
|
|
20
|
+
" list — List PRs (optional: state, limit, author)\n" +
|
|
21
|
+
" getDiff — Fetch full diff + metadata (prNumber required; optional: repo)\n" +
|
|
22
|
+
" postReview — Post a code review COMMENT or REQUEST_CHANGES (prNumber, body required; optional: comments, event, repo)\n" +
|
|
23
|
+
" approve — Approve a PR (prNumber required; optional: body, repo)\n" +
|
|
24
|
+
" merge — Merge a PR (prNumber required; optional: mergeMethod, commitTitle, commitMessage, repo)",
|
|
25
|
+
annotations: { openWorldHint: true },
|
|
26
|
+
inputSchema: {
|
|
27
|
+
type: "object",
|
|
28
|
+
required: ["operation"],
|
|
29
|
+
properties: {
|
|
30
|
+
operation: {
|
|
31
|
+
type: "string",
|
|
32
|
+
enum: [
|
|
33
|
+
"create",
|
|
34
|
+
"view",
|
|
35
|
+
"list",
|
|
36
|
+
"getDiff",
|
|
37
|
+
"postReview",
|
|
38
|
+
"approve",
|
|
39
|
+
"merge",
|
|
40
|
+
],
|
|
41
|
+
description: "Which PR operation to perform",
|
|
42
|
+
},
|
|
43
|
+
// create
|
|
44
|
+
title: { type: "string", description: "PR title (create)" },
|
|
45
|
+
body: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "PR body / review body (create, postReview, approve)",
|
|
48
|
+
},
|
|
49
|
+
base: { type: "string", description: "Base branch (create)" },
|
|
50
|
+
draft: {
|
|
51
|
+
type: "boolean",
|
|
52
|
+
description: "Draft PR flag (create)",
|
|
53
|
+
},
|
|
54
|
+
assignee: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Assignee username (create)",
|
|
57
|
+
},
|
|
58
|
+
// view / approve / merge / getDiff / postReview
|
|
59
|
+
number: {
|
|
60
|
+
type: "integer",
|
|
61
|
+
description: "PR number (view — omit for current branch)",
|
|
62
|
+
},
|
|
63
|
+
prNumber: {
|
|
64
|
+
type: "integer",
|
|
65
|
+
description: "PR number (getDiff, postReview, approve, merge)",
|
|
66
|
+
},
|
|
67
|
+
repo: {
|
|
68
|
+
type: "string",
|
|
69
|
+
description: "owner/repo override (getDiff, postReview, approve, merge)",
|
|
70
|
+
},
|
|
71
|
+
// list
|
|
72
|
+
state: {
|
|
73
|
+
type: "string",
|
|
74
|
+
enum: ["open", "closed", "merged", "all"],
|
|
75
|
+
description: "PR state filter (list)",
|
|
76
|
+
},
|
|
77
|
+
limit: {
|
|
78
|
+
type: "integer",
|
|
79
|
+
description: "Max results (list)",
|
|
80
|
+
},
|
|
81
|
+
author: {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "Filter by author (list)",
|
|
84
|
+
},
|
|
85
|
+
// postReview
|
|
86
|
+
comments: {
|
|
87
|
+
type: "array",
|
|
88
|
+
description: "Inline review comments (postReview)",
|
|
89
|
+
items: { type: "object" },
|
|
90
|
+
},
|
|
91
|
+
event: {
|
|
92
|
+
type: "string",
|
|
93
|
+
enum: ["COMMENT", "REQUEST_CHANGES"],
|
|
94
|
+
description: "Review event type (postReview)",
|
|
95
|
+
},
|
|
96
|
+
// merge
|
|
97
|
+
mergeMethod: {
|
|
98
|
+
type: "string",
|
|
99
|
+
enum: ["merge", "squash", "rebase"],
|
|
100
|
+
description: "Merge strategy (merge)",
|
|
101
|
+
},
|
|
102
|
+
commitTitle: {
|
|
103
|
+
type: "string",
|
|
104
|
+
description: "Merge commit title (merge)",
|
|
105
|
+
},
|
|
106
|
+
commitMessage: {
|
|
107
|
+
type: "string",
|
|
108
|
+
description: "Merge commit message (merge)",
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
additionalProperties: false,
|
|
112
|
+
},
|
|
113
|
+
outputSchema: {
|
|
114
|
+
type: "object",
|
|
115
|
+
description: "Result shape varies by operation — see individual tool outputSchemas",
|
|
116
|
+
properties: {
|
|
117
|
+
// create
|
|
118
|
+
url: { type: "string" },
|
|
119
|
+
number: { type: ["integer", "null"] },
|
|
120
|
+
title: { type: "string" },
|
|
121
|
+
// list
|
|
122
|
+
prs: { type: "array" },
|
|
123
|
+
count: { type: "integer" },
|
|
124
|
+
// view
|
|
125
|
+
state: { type: "string" },
|
|
126
|
+
body: { type: "string" },
|
|
127
|
+
// getDiff
|
|
128
|
+
diff: { type: "string" },
|
|
129
|
+
truncated: { type: "boolean" },
|
|
130
|
+
// postReview / approve
|
|
131
|
+
reviewId: { type: ["integer", "null"] },
|
|
132
|
+
commentsPosted: { type: "integer" },
|
|
133
|
+
event: { type: "string" },
|
|
134
|
+
// merge
|
|
135
|
+
merged: { type: "boolean" },
|
|
136
|
+
sha: { type: "string" },
|
|
137
|
+
message: { type: "string" },
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
handler: async (args, signal) => {
|
|
142
|
+
const operation = args.operation;
|
|
143
|
+
const rest = { ...args };
|
|
144
|
+
delete rest.operation;
|
|
145
|
+
switch (operation) {
|
|
146
|
+
case "create":
|
|
147
|
+
return createPR.handler(rest, signal);
|
|
148
|
+
case "view":
|
|
149
|
+
return viewPR.handler(rest, signal);
|
|
150
|
+
case "list":
|
|
151
|
+
return listPRs.handler(rest, signal);
|
|
152
|
+
case "getDiff":
|
|
153
|
+
return getDiff.handler(rest, signal);
|
|
154
|
+
case "postReview":
|
|
155
|
+
return postReview.handler(rest, signal);
|
|
156
|
+
case "approve":
|
|
157
|
+
return approvePR.handler(rest, signal);
|
|
158
|
+
case "merge":
|
|
159
|
+
return mergePR.handler(rest, signal);
|
|
160
|
+
default:
|
|
161
|
+
return error(`Unknown operation "${operation}". Must be one of: create, view, list, getDiff, postReview, approve, merge.`);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
export function createGithubIssueTool(workspace) {
|
|
167
|
+
const listIssues = createGithubListIssuesTool(workspace);
|
|
168
|
+
const getIssue = createGithubGetIssueTool(workspace);
|
|
169
|
+
const createIssue = createGithubCreateIssueTool(workspace);
|
|
170
|
+
const commentIssue = createGithubCommentIssueTool(workspace);
|
|
171
|
+
return {
|
|
172
|
+
schema: {
|
|
173
|
+
name: "githubIssue",
|
|
174
|
+
description: "Composite GitHub issue tool. Dispatches to the appropriate operation based on 'operation' field.\n" +
|
|
175
|
+
"Operations:\n" +
|
|
176
|
+
" list — List issues (optional: state, limit, assignee, label, milestone)\n" +
|
|
177
|
+
" get — View full issue details (number required)\n" +
|
|
178
|
+
" create — Create a new issue (title required; optional: body, assignee, label, milestone)\n" +
|
|
179
|
+
" comment — Add a comment to an issue (number, body required)",
|
|
180
|
+
annotations: { openWorldHint: true },
|
|
181
|
+
inputSchema: {
|
|
182
|
+
type: "object",
|
|
183
|
+
required: ["operation"],
|
|
184
|
+
properties: {
|
|
185
|
+
operation: {
|
|
186
|
+
type: "string",
|
|
187
|
+
enum: ["list", "get", "create", "comment"],
|
|
188
|
+
description: "Which issue operation to perform",
|
|
189
|
+
},
|
|
190
|
+
// get / comment
|
|
191
|
+
number: {
|
|
192
|
+
type: "integer",
|
|
193
|
+
description: "Issue number (get, comment)",
|
|
194
|
+
},
|
|
195
|
+
// create
|
|
196
|
+
title: { type: "string", description: "Issue title (create)" },
|
|
197
|
+
body: {
|
|
198
|
+
type: "string",
|
|
199
|
+
description: "Issue body or comment body (create, comment)",
|
|
200
|
+
},
|
|
201
|
+
assignee: {
|
|
202
|
+
type: "string",
|
|
203
|
+
description: "Assignee username (create, list)",
|
|
204
|
+
},
|
|
205
|
+
label: {
|
|
206
|
+
type: "string",
|
|
207
|
+
description: "Label filter or label to apply (list, create)",
|
|
208
|
+
},
|
|
209
|
+
milestone: {
|
|
210
|
+
type: "string",
|
|
211
|
+
description: "Milestone filter or title (list, create)",
|
|
212
|
+
},
|
|
213
|
+
// list
|
|
214
|
+
state: {
|
|
215
|
+
type: "string",
|
|
216
|
+
enum: ["open", "closed", "all"],
|
|
217
|
+
description: "Issue state filter (list)",
|
|
218
|
+
},
|
|
219
|
+
limit: {
|
|
220
|
+
type: "integer",
|
|
221
|
+
description: "Max results (list)",
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
additionalProperties: false,
|
|
225
|
+
},
|
|
226
|
+
outputSchema: {
|
|
227
|
+
type: "object",
|
|
228
|
+
description: "Result shape varies by operation",
|
|
229
|
+
properties: {
|
|
230
|
+
// list
|
|
231
|
+
issues: { type: "array" },
|
|
232
|
+
count: { type: "integer" },
|
|
233
|
+
// get
|
|
234
|
+
number: { type: "integer" },
|
|
235
|
+
title: { type: "string" },
|
|
236
|
+
state: { type: "string" },
|
|
237
|
+
url: { type: "string" },
|
|
238
|
+
body: { type: ["string", "null"] },
|
|
239
|
+
// comment
|
|
240
|
+
issueNumber: { type: "integer" },
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
handler: async (args, signal) => {
|
|
245
|
+
const operation = args.operation;
|
|
246
|
+
const rest = { ...args };
|
|
247
|
+
delete rest.operation;
|
|
248
|
+
switch (operation) {
|
|
249
|
+
case "list":
|
|
250
|
+
return listIssues.handler(rest, signal);
|
|
251
|
+
case "get":
|
|
252
|
+
return getIssue.handler(rest, signal);
|
|
253
|
+
case "create":
|
|
254
|
+
return createIssue.handler(rest, signal);
|
|
255
|
+
case "comment":
|
|
256
|
+
return commentIssue.handler(rest, signal);
|
|
257
|
+
default:
|
|
258
|
+
return error(`Unknown operation "${operation}". Must be one of: list, get, create, comment.`);
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
export function createGithubActionsTool(workspace, defaultRepo = null) {
|
|
264
|
+
const listRuns = createGithubListRunsTool(workspace, defaultRepo);
|
|
265
|
+
const getRunLogs = createGithubGetRunLogsTool(workspace, defaultRepo);
|
|
266
|
+
return {
|
|
267
|
+
schema: {
|
|
268
|
+
name: "githubActions",
|
|
269
|
+
description: "Composite GitHub Actions tool. Dispatches to the appropriate operation based on 'operation' field.\n" +
|
|
270
|
+
"Operations:\n" +
|
|
271
|
+
" listRuns — List workflow runs (optional: branch, workflow, status, limit)\n" +
|
|
272
|
+
" getRunLogs — Fetch run logs (runId required; optional: failedOnly)",
|
|
273
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
274
|
+
inputSchema: {
|
|
275
|
+
type: "object",
|
|
276
|
+
required: ["operation"],
|
|
277
|
+
properties: {
|
|
278
|
+
operation: {
|
|
279
|
+
type: "string",
|
|
280
|
+
enum: ["listRuns", "getRunLogs"],
|
|
281
|
+
description: "Which Actions operation to perform",
|
|
282
|
+
},
|
|
283
|
+
// listRuns
|
|
284
|
+
branch: {
|
|
285
|
+
type: "string",
|
|
286
|
+
description: "Filter by branch (listRuns)",
|
|
287
|
+
},
|
|
288
|
+
workflow: {
|
|
289
|
+
type: "string",
|
|
290
|
+
description: "Filter by workflow file or name (listRuns)",
|
|
291
|
+
},
|
|
292
|
+
status: {
|
|
293
|
+
type: "string",
|
|
294
|
+
description: "Filter by status (listRuns)",
|
|
295
|
+
},
|
|
296
|
+
limit: {
|
|
297
|
+
type: "integer",
|
|
298
|
+
description: "Max results (listRuns)",
|
|
299
|
+
},
|
|
300
|
+
// getRunLogs
|
|
301
|
+
runId: {
|
|
302
|
+
type: "integer",
|
|
303
|
+
description: "Workflow run databaseId (getRunLogs)",
|
|
304
|
+
},
|
|
305
|
+
failedOnly: {
|
|
306
|
+
type: "boolean",
|
|
307
|
+
description: "Only failed step logs (getRunLogs, default: true)",
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
additionalProperties: false,
|
|
311
|
+
},
|
|
312
|
+
outputSchema: {
|
|
313
|
+
type: "object",
|
|
314
|
+
description: "Result shape varies by operation",
|
|
315
|
+
properties: {
|
|
316
|
+
// listRuns
|
|
317
|
+
runs: { type: "array" },
|
|
318
|
+
count: { type: "integer" },
|
|
319
|
+
// getRunLogs
|
|
320
|
+
runId: { type: "integer" },
|
|
321
|
+
failedOnly: { type: "boolean" },
|
|
322
|
+
logs: { type: "string" },
|
|
323
|
+
truncated: { type: "boolean" },
|
|
324
|
+
note: { type: "string" },
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
handler: async (args, signal) => {
|
|
329
|
+
const operation = args.operation;
|
|
330
|
+
const rest = { ...args };
|
|
331
|
+
delete rest.operation;
|
|
332
|
+
switch (operation) {
|
|
333
|
+
case "listRuns":
|
|
334
|
+
return listRuns.handler(rest, signal);
|
|
335
|
+
case "getRunLogs":
|
|
336
|
+
return getRunLogs.handler(rest, signal);
|
|
337
|
+
default:
|
|
338
|
+
return error(`Unknown operation "${operation}". Must be one of: listRuns, getRunLogs.`);
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
//# sourceMappingURL=composite.js.map
|