patchwork-os 0.2.0-alpha.2 → 0.2.0-alpha.22
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/dist/approvalHttp.d.ts +11 -2
- package/dist/approvalHttp.js +98 -10
- package/dist/approvalHttp.js.map +1 -1
- package/dist/approvalQueue.d.ts +12 -1
- package/dist/approvalQueue.js +25 -3
- package/dist/approvalQueue.js.map +1 -1
- package/dist/automation.d.ts +20 -0
- package/dist/automation.js +35 -0
- package/dist/automation.js.map +1 -1
- package/dist/bridge.js +145 -23
- package/dist/bridge.js.map +1 -1
- package/dist/bridgeToken.js +57 -19
- package/dist/bridgeToken.js.map +1 -1
- package/dist/claudeDriver.d.ts +3 -1
- package/dist/claudeDriver.js +48 -0
- package/dist/claudeDriver.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 +256 -0
- package/dist/commands/recipe.js +1313 -0
- package/dist/commands/recipe.js.map +1 -0
- package/dist/config.d.ts +15 -2
- package/dist/config.js +94 -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/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 +93 -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/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 +117 -0
- package/dist/connectors/linear.js +239 -0
- package/dist/connectors/linear.js.map +1 -0
- 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 +43 -0
- package/dist/connectors/sentry.js +188 -0
- package/dist/connectors/sentry.js.map +1 -0
- 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/tokenStorage.d.ts +35 -0
- package/dist/connectors/tokenStorage.js +394 -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/claude/api.d.ts +11 -0
- package/dist/drivers/claude/api.js +54 -0
- package/dist/drivers/claude/api.js.map +1 -0
- package/dist/drivers/claude/envSanitizer.d.ts +7 -0
- package/dist/drivers/claude/envSanitizer.js +18 -0
- package/dist/drivers/claude/envSanitizer.js.map +1 -0
- package/dist/drivers/claude/streamParser.d.ts +38 -0
- package/dist/drivers/claude/streamParser.js +34 -0
- package/dist/drivers/claude/streamParser.js.map +1 -0
- package/dist/drivers/claude/subprocess.d.ts +19 -0
- package/dist/drivers/claude/subprocess.js +216 -0
- package/dist/drivers/claude/subprocess.js.map +1 -0
- package/dist/drivers/claude/subprocessSettings.d.ts +9 -0
- package/dist/drivers/claude/subprocessSettings.js +55 -0
- package/dist/drivers/claude/subprocessSettings.js.map +1 -0
- package/dist/drivers/gemini/index.d.ts +18 -0
- package/dist/drivers/gemini/index.js +210 -0
- package/dist/drivers/gemini/index.js.map +1 -0
- package/dist/drivers/grok/index.d.ts +11 -0
- package/dist/drivers/grok/index.js +22 -0
- package/dist/drivers/grok/index.js.map +1 -0
- package/dist/drivers/index.d.ts +23 -0
- package/dist/drivers/index.js +31 -0
- package/dist/drivers/index.js.map +1 -0
- package/dist/drivers/openai/index.d.ts +24 -0
- package/dist/drivers/openai/index.js +110 -0
- package/dist/drivers/openai/index.js.map +1 -0
- package/dist/drivers/types.d.ts +72 -0
- package/dist/drivers/types.js +30 -0
- package/dist/drivers/types.js.map +1 -0
- 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 +543 -37
- 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/recipes/chainedRunner.d.ts +104 -0
- package/dist/recipes/chainedRunner.js +359 -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 +1 -0
- package/dist/recipes/legacyRecipeCompat.js +97 -0
- package/dist/recipes/legacyRecipeCompat.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 +135 -41
- package/dist/recipes/scheduler.js.map +1 -1
- package/dist/recipes/schemaGenerator.d.ts +28 -0
- package/dist/recipes/schemaGenerator.js +484 -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/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/index.d.ts +18 -0
- package/dist/recipes/tools/index.js +21 -0
- package/dist/recipes/tools/index.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/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/yamlRunner.d.ts +79 -0
- package/dist/recipes/yamlRunner.js +612 -346
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/recipesHttp.d.ts +14 -1
- package/dist/recipesHttp.js +21 -4
- 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/server.d.ts +19 -1
- package/dist/server.js +682 -31
- 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/ctxGetTaskContext.d.ts +4 -1
- package/dist/tools/ctxGetTaskContext.js +45 -2
- package/dist/tools/ctxGetTaskContext.js.map +1 -1
- 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/fetchLinearIssue.d.ts +112 -0
- package/dist/tools/fetchLinearIssue.js +129 -0
- package/dist/tools/fetchLinearIssue.js.map +1 -0
- package/dist/tools/fetchSentryIssue.d.ts +143 -0
- package/dist/tools/fetchSentryIssue.js +150 -0
- package/dist/tools/fetchSentryIssue.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 +36 -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/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 +4 -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 +21 -5
- package/templates/recipes/sentry-to-linear.yaml +77 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare function createSlackListChannelsTool(): {
|
|
2
|
+
schema: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
annotations: {
|
|
6
|
+
readOnlyHint: boolean;
|
|
7
|
+
};
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object";
|
|
10
|
+
properties: {
|
|
11
|
+
limit: {
|
|
12
|
+
type: string;
|
|
13
|
+
description: string;
|
|
14
|
+
minimum: number;
|
|
15
|
+
maximum: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
additionalProperties: false;
|
|
19
|
+
};
|
|
20
|
+
outputSchema: {
|
|
21
|
+
type: "object";
|
|
22
|
+
properties: {
|
|
23
|
+
channels: {
|
|
24
|
+
type: string;
|
|
25
|
+
items: {
|
|
26
|
+
type: string;
|
|
27
|
+
properties: {
|
|
28
|
+
id: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
name: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
isMember: {
|
|
35
|
+
type: string;
|
|
36
|
+
};
|
|
37
|
+
isPrivate: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
numMembers: {
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
required: string[];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
slackConnected: {
|
|
48
|
+
type: string;
|
|
49
|
+
};
|
|
50
|
+
error: {
|
|
51
|
+
type: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
required: string[];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
timeoutMs: number;
|
|
58
|
+
handler(args: Record<string, unknown>, signal?: AbortSignal): Promise<{
|
|
59
|
+
content: Array<{
|
|
60
|
+
type: string;
|
|
61
|
+
text: string;
|
|
62
|
+
}>;
|
|
63
|
+
structuredContent: unknown;
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { listChannels, loadTokens } from "../connectors/slack.js";
|
|
2
|
+
import { optionalInt, successStructured } from "./utils.js";
|
|
3
|
+
export function createSlackListChannelsTool() {
|
|
4
|
+
return {
|
|
5
|
+
schema: {
|
|
6
|
+
name: "slackListChannels",
|
|
7
|
+
description: "List public Slack channels the bot has access to. Returns id, name, member count.",
|
|
8
|
+
annotations: { readOnlyHint: true },
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
limit: {
|
|
13
|
+
type: "integer",
|
|
14
|
+
description: "Max channels to return (1–200). Default: 100.",
|
|
15
|
+
minimum: 1,
|
|
16
|
+
maximum: 200,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
},
|
|
21
|
+
outputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
channels: {
|
|
25
|
+
type: "array",
|
|
26
|
+
items: {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: {
|
|
29
|
+
id: { type: "string" },
|
|
30
|
+
name: { type: "string" },
|
|
31
|
+
isMember: { type: "boolean" },
|
|
32
|
+
isPrivate: { type: "boolean" },
|
|
33
|
+
numMembers: { type: "number" },
|
|
34
|
+
},
|
|
35
|
+
required: ["id", "name", "isMember", "isPrivate"],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
slackConnected: { type: "boolean" },
|
|
39
|
+
error: { type: "string" },
|
|
40
|
+
},
|
|
41
|
+
required: ["slackConnected"],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
timeoutMs: 15_000,
|
|
45
|
+
async handler(args, signal) {
|
|
46
|
+
const tokens = loadTokens();
|
|
47
|
+
if (!tokens) {
|
|
48
|
+
return successStructured({
|
|
49
|
+
channels: [],
|
|
50
|
+
slackConnected: false,
|
|
51
|
+
error: "Slack not connected. GET /connections/slack/authorize first.",
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const limit = optionalInt(args, "limit", 1, 200) ?? 100;
|
|
55
|
+
try {
|
|
56
|
+
const channels = await listChannels(limit, signal);
|
|
57
|
+
return successStructured({ channels, slackConnected: true });
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
const notConnected = err instanceof Error && err.message.includes("not connected");
|
|
61
|
+
return successStructured({
|
|
62
|
+
channels: [],
|
|
63
|
+
slackConnected: !notConnected,
|
|
64
|
+
error: err instanceof Error ? err.message : String(err),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=slackListChannels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+
inputSchema: {
|
|
9
|
+
type: "object";
|
|
10
|
+
required: string[];
|
|
11
|
+
properties: {
|
|
12
|
+
channel: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
maxLength: number;
|
|
16
|
+
};
|
|
17
|
+
text: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
maxLength: number;
|
|
21
|
+
};
|
|
22
|
+
threadTs: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
maxLength: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
additionalProperties: false;
|
|
29
|
+
};
|
|
30
|
+
outputSchema: {
|
|
31
|
+
type: "object";
|
|
32
|
+
properties: {
|
|
33
|
+
ts: {
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
channel: {
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
slackConnected: {
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
error: {
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
required: string[];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
timeoutMs: number;
|
|
50
|
+
handler(args: Record<string, unknown>, signal?: AbortSignal): Promise<{
|
|
51
|
+
content: Array<{
|
|
52
|
+
type: string;
|
|
53
|
+
text: string;
|
|
54
|
+
}>;
|
|
55
|
+
structuredContent: unknown;
|
|
56
|
+
}>;
|
|
57
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { loadTokens, postMessage } from "../connectors/slack.js";
|
|
2
|
+
import { optionalString, requireString, successStructured } from "./utils.js";
|
|
3
|
+
export function createSlackPostMessageTool() {
|
|
4
|
+
return {
|
|
5
|
+
schema: {
|
|
6
|
+
name: "slackPostMessage",
|
|
7
|
+
description: "Post a message to a Slack channel. Use channel name (e.g. 'general') or channel ID. " +
|
|
8
|
+
"Optionally reply in a thread by providing threadTs.",
|
|
9
|
+
annotations: { readOnlyHint: false },
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: "object",
|
|
12
|
+
required: ["channel", "text"],
|
|
13
|
+
properties: {
|
|
14
|
+
channel: {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "Channel name (e.g. 'general') or channel ID (e.g. 'C12345').",
|
|
17
|
+
maxLength: 200,
|
|
18
|
+
},
|
|
19
|
+
text: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Message text (Markdown supported via mrkdwn).",
|
|
22
|
+
maxLength: 40000,
|
|
23
|
+
},
|
|
24
|
+
threadTs: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Thread timestamp to reply in. Omit to post as a new message.",
|
|
27
|
+
maxLength: 50,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
additionalProperties: false,
|
|
31
|
+
},
|
|
32
|
+
outputSchema: {
|
|
33
|
+
type: "object",
|
|
34
|
+
properties: {
|
|
35
|
+
ts: { type: "string" },
|
|
36
|
+
channel: { type: "string" },
|
|
37
|
+
slackConnected: { type: "boolean" },
|
|
38
|
+
error: { type: "string" },
|
|
39
|
+
},
|
|
40
|
+
required: ["slackConnected"],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
timeoutMs: 15_000,
|
|
44
|
+
async handler(args, signal) {
|
|
45
|
+
const tokens = loadTokens();
|
|
46
|
+
if (!tokens) {
|
|
47
|
+
return successStructured({
|
|
48
|
+
ts: "",
|
|
49
|
+
channel: "",
|
|
50
|
+
slackConnected: false,
|
|
51
|
+
error: "Slack not connected. GET /connections/slack/authorize first.",
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const channel = requireString(args, "channel", 200);
|
|
55
|
+
const text = requireString(args, "text", 40000);
|
|
56
|
+
const threadTs = optionalString(args, "threadTs", 50);
|
|
57
|
+
try {
|
|
58
|
+
const result = await postMessage(channel, text, threadTs ?? undefined, signal);
|
|
59
|
+
return successStructured({
|
|
60
|
+
ts: result.ts,
|
|
61
|
+
channel: result.channel,
|
|
62
|
+
slackConnected: true,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
const notConnected = err instanceof Error && err.message.includes("not connected");
|
|
67
|
+
return successStructured({
|
|
68
|
+
ts: "",
|
|
69
|
+
channel: "",
|
|
70
|
+
slackConnected: !notConnected,
|
|
71
|
+
error: err instanceof Error ? err.message : String(err),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=slackPostMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slackPostMessage.js","sourceRoot":"","sources":["../../src/tools/slackPostMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE9E,MAAM,UAAU,0BAA0B;IACxC,OAAO;QACL,MAAM,EAAE;YACN,IAAI,EAAE,kBAAkB;YACxB,WAAW,EACT,sFAAsF;gBACtF,qDAAqD;YACvD,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE;YACpC,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;gBAC7B,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,IAAI,EAAE,QAAQ;wBACd,WAAW,EACT,8DAA8D;wBAChE,SAAS,EAAE,GAAG;qBACf;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,+CAA+C;wBAC5D,SAAS,EAAE,KAAK;qBACjB;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EACT,8DAA8D;wBAChE,SAAS,EAAE,EAAE;qBACd;iBACF;gBACD,oBAAoB,EAAE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,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;gBAChE,OAAO,iBAAiB,CAAC;oBACvB,EAAE,EAAE,EAAE;oBACN,OAAO,EAAE,EAAE;oBACX,cAAc,EAAE,CAAC,YAAY;oBAC7B,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 createUpdateLinearIssueTool(): {
|
|
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
|
+
id: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
maxLength: number;
|
|
16
|
+
};
|
|
17
|
+
title: {
|
|
18
|
+
type: string;
|
|
19
|
+
maxLength: number;
|
|
20
|
+
};
|
|
21
|
+
description: {
|
|
22
|
+
type: string;
|
|
23
|
+
maxLength: number;
|
|
24
|
+
};
|
|
25
|
+
priority: {
|
|
26
|
+
type: string;
|
|
27
|
+
description: string;
|
|
28
|
+
minimum: number;
|
|
29
|
+
maximum: number;
|
|
30
|
+
};
|
|
31
|
+
state: {
|
|
32
|
+
type: string;
|
|
33
|
+
description: string;
|
|
34
|
+
maxLength: number;
|
|
35
|
+
};
|
|
36
|
+
assignee: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
maxLength: number;
|
|
40
|
+
};
|
|
41
|
+
labelNames: {
|
|
42
|
+
type: string;
|
|
43
|
+
description: string;
|
|
44
|
+
items: {
|
|
45
|
+
type: string;
|
|
46
|
+
maxLength: number;
|
|
47
|
+
};
|
|
48
|
+
maxItems: number;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
additionalProperties: false;
|
|
52
|
+
};
|
|
53
|
+
outputSchema: {
|
|
54
|
+
type: "object";
|
|
55
|
+
properties: {
|
|
56
|
+
id: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
identifier: {
|
|
60
|
+
type: string;
|
|
61
|
+
};
|
|
62
|
+
title: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
url: {
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
68
|
+
state: {
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
71
|
+
linearConnected: {
|
|
72
|
+
type: string;
|
|
73
|
+
};
|
|
74
|
+
error: {
|
|
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,117 @@
|
|
|
1
|
+
import { loadTokens, updateIssue } from "../connectors/linear.js";
|
|
2
|
+
import { requireString, successStructured } from "./utils.js";
|
|
3
|
+
export function createUpdateLinearIssueTool() {
|
|
4
|
+
return {
|
|
5
|
+
schema: {
|
|
6
|
+
name: "updateLinearIssue",
|
|
7
|
+
description: "Update an existing Linear issue. Pass only the fields you want to change. Requires Linear connector connected.",
|
|
8
|
+
annotations: { readOnlyHint: false },
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object",
|
|
11
|
+
required: ["id"],
|
|
12
|
+
properties: {
|
|
13
|
+
id: {
|
|
14
|
+
type: "string",
|
|
15
|
+
description: "Issue identifier (e.g. 'ENG-42') or URL.",
|
|
16
|
+
maxLength: 200,
|
|
17
|
+
},
|
|
18
|
+
title: { type: "string", maxLength: 500 },
|
|
19
|
+
description: { type: "string", maxLength: 10000 },
|
|
20
|
+
priority: {
|
|
21
|
+
type: "integer",
|
|
22
|
+
description: "0=no priority, 1=urgent, 2=high, 3=medium, 4=low.",
|
|
23
|
+
minimum: 0,
|
|
24
|
+
maximum: 4,
|
|
25
|
+
},
|
|
26
|
+
state: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Workflow state name (e.g. 'In Progress', 'Done').",
|
|
29
|
+
maxLength: 100,
|
|
30
|
+
},
|
|
31
|
+
assignee: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Assignee name or email.",
|
|
34
|
+
maxLength: 200,
|
|
35
|
+
},
|
|
36
|
+
labelNames: {
|
|
37
|
+
type: "array",
|
|
38
|
+
description: "Label names to set (replaces existing labels).",
|
|
39
|
+
items: { type: "string", maxLength: 100 },
|
|
40
|
+
maxItems: 10,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
additionalProperties: false,
|
|
44
|
+
},
|
|
45
|
+
outputSchema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
id: { type: "string" },
|
|
49
|
+
identifier: { type: "string" },
|
|
50
|
+
title: { type: "string" },
|
|
51
|
+
url: { type: "string" },
|
|
52
|
+
state: { type: "string" },
|
|
53
|
+
linearConnected: { type: "boolean" },
|
|
54
|
+
error: { type: "string" },
|
|
55
|
+
},
|
|
56
|
+
required: ["id", "identifier", "title", "url", "linearConnected"],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
timeoutMs: 20_000,
|
|
60
|
+
async handler(args, signal) {
|
|
61
|
+
const tokens = loadTokens();
|
|
62
|
+
if (!tokens) {
|
|
63
|
+
return successStructured({
|
|
64
|
+
id: "",
|
|
65
|
+
identifier: "",
|
|
66
|
+
title: "",
|
|
67
|
+
url: "",
|
|
68
|
+
linearConnected: false,
|
|
69
|
+
error: "Linear not connected. GET /connections/linear/authorize first.",
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const id = requireString(args, "id", 200);
|
|
73
|
+
const labelNames = Array.isArray(args.labelNames)
|
|
74
|
+
? args.labelNames
|
|
75
|
+
.filter((l) => typeof l === "string")
|
|
76
|
+
.map(String)
|
|
77
|
+
: undefined;
|
|
78
|
+
try {
|
|
79
|
+
const issue = await updateIssue({
|
|
80
|
+
id,
|
|
81
|
+
...(typeof args.title === "string" && { title: args.title }),
|
|
82
|
+
...(typeof args.description === "string" && {
|
|
83
|
+
description: args.description,
|
|
84
|
+
}),
|
|
85
|
+
...(typeof args.priority === "number" && {
|
|
86
|
+
priority: args.priority,
|
|
87
|
+
}),
|
|
88
|
+
...(typeof args.state === "string" && { state: args.state }),
|
|
89
|
+
...(typeof args.assignee === "string" && {
|
|
90
|
+
assignee: args.assignee,
|
|
91
|
+
}),
|
|
92
|
+
...(labelNames && labelNames.length > 0 && { labels: labelNames }),
|
|
93
|
+
}, signal);
|
|
94
|
+
return successStructured({
|
|
95
|
+
id: issue.id,
|
|
96
|
+
identifier: issue.identifier,
|
|
97
|
+
title: issue.title,
|
|
98
|
+
url: issue.url,
|
|
99
|
+
state: issue.state?.name ?? "",
|
|
100
|
+
linearConnected: true,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
const notConnected = err instanceof Error && err.message.includes("not connected");
|
|
105
|
+
return successStructured({
|
|
106
|
+
id: "",
|
|
107
|
+
identifier: "",
|
|
108
|
+
title: "",
|
|
109
|
+
url: "",
|
|
110
|
+
linearConnected: !notConnected,
|
|
111
|
+
error: err instanceof Error ? err.message : String(err),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=updateLinearIssue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upd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E,EAAE,EAAE;oBACN,UAAU,EAAE,EAAE;oBACd,KAAK,EAAE,EAAE;oBACT,GAAG,EAAE,EAAE;oBACP,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"}
|
package/dist/transport.d.ts
CHANGED
|
@@ -78,8 +78,12 @@ export declare class McpTransport {
|
|
|
78
78
|
private readonly ajv;
|
|
79
79
|
private readonly schemaValidators;
|
|
80
80
|
private readonly outputValidators;
|
|
81
|
-
/** Cached wire-schema array for tools/list. Invalidated on any tool registration change. */
|
|
81
|
+
/** Cached wire-schema array for tools/list (full mode). Invalidated on any tool registration change. */
|
|
82
82
|
private wireSchemaCache;
|
|
83
|
+
/** Cached wire-schema array for tools/list in lazy mode (inputSchema stripped). */
|
|
84
|
+
private wireSchemaCacheLazy;
|
|
85
|
+
/** When true, tools/list omits inputSchema. Clients must call tools/schema before tools/call. */
|
|
86
|
+
private lazyTools;
|
|
83
87
|
/** Per-session tool-call rate limit (calls/minute). 0 = disabled. */
|
|
84
88
|
private toolRateLimit;
|
|
85
89
|
/**
|
|
@@ -112,6 +116,8 @@ export declare class McpTransport {
|
|
|
112
116
|
* Called at HTTP session initialize time from X-Bridge-Deny-Tools header.
|
|
113
117
|
*/
|
|
114
118
|
setDenyTools(tools: Set<string>): void;
|
|
119
|
+
/** Enable lazy-tools mode: tools/list omits inputSchema; clients use tools/schema to fetch it. */
|
|
120
|
+
setLazyTools(enabled: boolean): void;
|
|
115
121
|
/** Configure per-session tool call rate limiting (calls/minute, 0 = disabled). */
|
|
116
122
|
setToolRateLimit(limit: number): void;
|
|
117
123
|
/**
|