patchwork-os 0.2.0-beta.10 → 0.2.0-beta.10.canary.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bridge.js +17 -10
- package/dist/bridge.js.map +1 -1
- package/dist/commands/connect.d.ts +47 -0
- package/dist/commands/connect.js +419 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/recipe.d.ts +45 -4
- package/dist/commands/recipe.js +141 -4
- package/dist/commands/recipe.js.map +1 -1
- package/dist/commands/task.d.ts +25 -0
- package/dist/commands/task.js +61 -41
- package/dist/commands/task.js.map +1 -1
- package/dist/commands/tracesExport.d.ts +15 -1
- package/dist/commands/tracesExport.js +39 -5
- package/dist/commands/tracesExport.js.map +1 -1
- package/dist/connectorRoutes.js +556 -0
- package/dist/connectorRoutes.js.map +1 -1
- package/dist/connectors/connectorRegistry.d.ts +0 -3
- package/dist/connectors/connectorRegistry.js +8 -8
- package/dist/connectors/connectorRegistry.js.map +1 -1
- package/dist/connectors/datadog.js +8 -1
- package/dist/connectors/datadog.js.map +1 -1
- package/dist/connectors/jira.js +7 -2
- package/dist/connectors/jira.js.map +1 -1
- package/dist/connectors/mcpClient.js +37 -23
- package/dist/connectors/mcpClient.js.map +1 -1
- package/dist/connectors/notion.d.ts +1 -1
- package/dist/connectors/notion.js +13 -4
- package/dist/connectors/notion.js.map +1 -1
- package/dist/connectors/redis.js +10 -2
- package/dist/connectors/redis.js.map +1 -1
- package/dist/connectors/snowflake.js +18 -0
- package/dist/connectors/snowflake.js.map +1 -1
- package/dist/decisionReplay.d.ts +8 -6
- package/dist/decisionReplay.js +35 -11
- package/dist/decisionReplay.js.map +1 -1
- package/dist/drivers/claude/api.js +28 -5
- package/dist/drivers/claude/api.js.map +1 -1
- package/dist/drivers/claude/subprocess.js +47 -13
- package/dist/drivers/claude/subprocess.js.map +1 -1
- package/dist/drivers/local/index.d.ts +2 -17
- package/dist/drivers/local/index.js +5 -92
- package/dist/drivers/local/index.js.map +1 -1
- package/dist/fp/automationInterpreter.js +57 -12
- package/dist/fp/automationInterpreter.js.map +1 -1
- package/dist/fp/policyParser.js +5 -1
- package/dist/fp/policyParser.js.map +1 -1
- package/dist/index.js +154 -83
- package/dist/index.js.map +1 -1
- package/dist/localEndpointGuard.d.ts +25 -0
- package/dist/localEndpointGuard.js +101 -0
- package/dist/localEndpointGuard.js.map +1 -0
- package/dist/orchestrator/childBridgeClient.d.ts +5 -0
- package/dist/orchestrator/childBridgeClient.js +28 -1
- package/dist/orchestrator/childBridgeClient.js.map +1 -1
- package/dist/orchestrator/orchestratorBridge.d.ts +33 -0
- package/dist/orchestrator/orchestratorBridge.js +70 -9
- package/dist/orchestrator/orchestratorBridge.js.map +1 -1
- package/dist/recipes/chainedRunner.js +14 -4
- package/dist/recipes/chainedRunner.js.map +1 -1
- package/dist/recipes/compiler.js +9 -5
- package/dist/recipes/compiler.js.map +1 -1
- package/dist/recipes/dependencyGraph.d.ts +9 -0
- package/dist/recipes/dependencyGraph.js +19 -2
- package/dist/recipes/dependencyGraph.js.map +1 -1
- package/dist/recipes/githubInstallSource.d.ts +9 -2
- package/dist/recipes/githubInstallSource.js +36 -6
- package/dist/recipes/githubInstallSource.js.map +1 -1
- package/dist/recipes/idempotencyKey.d.ts +23 -3
- package/dist/recipes/idempotencyKey.js +57 -4
- package/dist/recipes/idempotencyKey.js.map +1 -1
- package/dist/recipes/installer.js +10 -1
- package/dist/recipes/installer.js.map +1 -1
- package/dist/recipes/parser.js +28 -1
- package/dist/recipes/parser.js.map +1 -1
- package/dist/recipes/schema.d.ts +29 -2
- package/dist/recipes/schemaGenerator.js +16 -2
- package/dist/recipes/schemaGenerator.js.map +1 -1
- package/dist/recipes/toolRegistry.js +13 -4
- package/dist/recipes/toolRegistry.js.map +1 -1
- package/dist/recipes/tools/airtable.d.ts +15 -0
- package/dist/recipes/tools/airtable.js +239 -0
- package/dist/recipes/tools/airtable.js.map +1 -0
- package/dist/recipes/tools/index.d.ts +5 -0
- package/dist/recipes/tools/index.js +5 -0
- package/dist/recipes/tools/index.js.map +1 -1
- package/dist/recipes/tools/resend.d.ts +8 -0
- package/dist/recipes/tools/resend.js +152 -0
- package/dist/recipes/tools/resend.js.map +1 -0
- package/dist/recipes/tools/sendgrid.d.ts +9 -0
- package/dist/recipes/tools/sendgrid.js +174 -0
- package/dist/recipes/tools/sendgrid.js.map +1 -0
- package/dist/recipes/tools/twilio.d.ts +11 -0
- package/dist/recipes/tools/twilio.js +179 -0
- package/dist/recipes/tools/twilio.js.map +1 -0
- package/dist/recipes/tools/vercel.d.ts +9 -0
- package/dist/recipes/tools/vercel.js +145 -0
- package/dist/recipes/tools/vercel.js.map +1 -0
- package/dist/recipes/validation.js +112 -0
- package/dist/recipes/validation.js.map +1 -1
- package/dist/recipes/yamlRunner.d.ts +3 -0
- package/dist/recipes/yamlRunner.js +112 -29
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/schemas/recipe.v1.json +2 -2
- package/dist/telemetry.js +20 -9
- package/dist/telemetry.js.map +1 -1
- package/dist/tools/getGitStatus.js +6 -1
- package/dist/tools/getGitStatus.js.map +1 -1
- package/dist/tools/getToolCapabilities.js +39 -4
- package/dist/tools/getToolCapabilities.js.map +1 -1
- package/dist/tools/github/composite.d.ts +1 -1
- package/dist/tools/github/composite.js +7 -7
- package/dist/tools/github/composite.js.map +1 -1
- package/dist/tools/github/pr.d.ts +6 -6
- package/dist/tools/github/pr.js +18 -11
- package/dist/tools/github/pr.js.map +1 -1
- package/dist/tools/index.js +14 -10
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/previewEdit.js +16 -1
- package/dist/tools/previewEdit.js.map +1 -1
- package/dist/tools/searchAndReplace.js +4 -5
- package/dist/tools/searchAndReplace.js.map +1 -1
- package/dist/tools/searchTools.d.ts +26 -0
- package/dist/tools/searchTools.js +42 -2
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/tools/transaction.d.ts +9 -1
- package/dist/tools/transaction.js +59 -4
- package/dist/tools/transaction.js.map +1 -1
- package/dist/tools/utils.d.ts +15 -0
- package/dist/tools/utils.js +19 -0
- package/dist/tools/utils.js.map +1 -1
- package/dist/transport.js +23 -0
- package/dist/transport.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resend tools — transactional email send + read access to sent emails.
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry. Wraps the Resend
|
|
5
|
+
* connector (src/connectors/resend.ts). `send_email` is write-gated; the two
|
|
6
|
+
* read tools surface a single email / a list of emails.
|
|
7
|
+
*/
|
|
8
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// resend.send_email (write-gated)
|
|
11
|
+
// ============================================================================
|
|
12
|
+
registerTool({
|
|
13
|
+
id: "resend.send_email",
|
|
14
|
+
namespace: "resend",
|
|
15
|
+
description: "Send a transactional email via Resend. Requires from, to, subject, and one of html/text.",
|
|
16
|
+
paramsSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
from: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Sender address (must be a verified Resend domain)",
|
|
22
|
+
},
|
|
23
|
+
to: {
|
|
24
|
+
type: ["string", "array"],
|
|
25
|
+
items: { type: "string" },
|
|
26
|
+
description: "Recipient address or array of addresses",
|
|
27
|
+
},
|
|
28
|
+
subject: { type: "string", description: "Email subject line" },
|
|
29
|
+
html: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "HTML body (either html or text is required)",
|
|
32
|
+
},
|
|
33
|
+
text: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Plain-text body (either html or text is required)",
|
|
36
|
+
},
|
|
37
|
+
reply_to: {
|
|
38
|
+
type: ["string", "array"],
|
|
39
|
+
items: { type: "string" },
|
|
40
|
+
description: "Optional reply-to address or array of addresses",
|
|
41
|
+
},
|
|
42
|
+
into: CommonSchemas.into,
|
|
43
|
+
},
|
|
44
|
+
required: ["from", "to", "subject"],
|
|
45
|
+
},
|
|
46
|
+
outputSchema: {
|
|
47
|
+
type: "object",
|
|
48
|
+
properties: {
|
|
49
|
+
id: { type: "string" },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
riskDefault: "medium",
|
|
53
|
+
isWrite: true,
|
|
54
|
+
isConnector: true,
|
|
55
|
+
execute: async ({ params }) => {
|
|
56
|
+
const { getResendConnector } = await import("../../connectors/resend.js");
|
|
57
|
+
const connector = getResendConnector();
|
|
58
|
+
const result = await connector.sendEmail({
|
|
59
|
+
from: params.from,
|
|
60
|
+
to: params.to,
|
|
61
|
+
subject: params.subject,
|
|
62
|
+
html: typeof params.html === "string" ? params.html : undefined,
|
|
63
|
+
text: typeof params.text === "string" ? params.text : undefined,
|
|
64
|
+
replyTo: typeof params.reply_to === "string" || Array.isArray(params.reply_to)
|
|
65
|
+
? params.reply_to
|
|
66
|
+
: undefined,
|
|
67
|
+
});
|
|
68
|
+
return JSON.stringify(result);
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
// ============================================================================
|
|
72
|
+
// resend.list_emails
|
|
73
|
+
// ============================================================================
|
|
74
|
+
registerTool({
|
|
75
|
+
id: "resend.list_emails",
|
|
76
|
+
namespace: "resend",
|
|
77
|
+
description: "List emails sent via Resend, with optional limit/page paging.",
|
|
78
|
+
paramsSchema: {
|
|
79
|
+
type: "object",
|
|
80
|
+
properties: {
|
|
81
|
+
limit: {
|
|
82
|
+
type: "number",
|
|
83
|
+
description: "Max number of emails to return",
|
|
84
|
+
},
|
|
85
|
+
page: {
|
|
86
|
+
type: "number",
|
|
87
|
+
description: "Page number for pagination",
|
|
88
|
+
},
|
|
89
|
+
into: CommonSchemas.into,
|
|
90
|
+
},
|
|
91
|
+
required: [],
|
|
92
|
+
},
|
|
93
|
+
outputSchema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
object: { type: "string" },
|
|
97
|
+
data: { type: "array", items: { type: "object" } },
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
riskDefault: "low",
|
|
101
|
+
isWrite: false,
|
|
102
|
+
isConnector: true,
|
|
103
|
+
execute: async ({ params }) => {
|
|
104
|
+
const { getResendConnector } = await import("../../connectors/resend.js");
|
|
105
|
+
const connector = getResendConnector();
|
|
106
|
+
const result = await connector.listEmails({
|
|
107
|
+
limit: typeof params.limit === "number" ? params.limit : undefined,
|
|
108
|
+
page: typeof params.page === "number" ? params.page : undefined,
|
|
109
|
+
});
|
|
110
|
+
return JSON.stringify(result);
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
// ============================================================================
|
|
114
|
+
// resend.get_email
|
|
115
|
+
// ============================================================================
|
|
116
|
+
registerTool({
|
|
117
|
+
id: "resend.get_email",
|
|
118
|
+
namespace: "resend",
|
|
119
|
+
description: "Fetch a single email sent via Resend by its ID.",
|
|
120
|
+
paramsSchema: {
|
|
121
|
+
type: "object",
|
|
122
|
+
properties: {
|
|
123
|
+
id: { type: "string", description: "Resend email ID" },
|
|
124
|
+
into: CommonSchemas.into,
|
|
125
|
+
},
|
|
126
|
+
required: ["id"],
|
|
127
|
+
},
|
|
128
|
+
outputSchema: {
|
|
129
|
+
type: "object",
|
|
130
|
+
properties: {
|
|
131
|
+
object: { type: "string" },
|
|
132
|
+
id: { type: "string" },
|
|
133
|
+
to: { type: ["string", "array"], items: { type: "string" } },
|
|
134
|
+
from: { type: "string" },
|
|
135
|
+
subject: { type: "string" },
|
|
136
|
+
html: { type: ["string", "null"] },
|
|
137
|
+
text: { type: ["string", "null"] },
|
|
138
|
+
created_at: { type: "string" },
|
|
139
|
+
last_event: { type: "string" },
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
riskDefault: "low",
|
|
143
|
+
isWrite: false,
|
|
144
|
+
isConnector: true,
|
|
145
|
+
execute: async ({ params }) => {
|
|
146
|
+
const { getResendConnector } = await import("../../connectors/resend.js");
|
|
147
|
+
const connector = getResendConnector();
|
|
148
|
+
const result = await connector.getEmail(params.id);
|
|
149
|
+
return JSON.stringify(result);
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=resend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resend.js","sourceRoot":"","sources":["../../../src/recipes/tools/resend.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,+EAA+E;AAC/E,mCAAmC;AACnC,+EAA+E;AAE/E,YAAY,CAAC;IACX,EAAE,EAAE,mBAAmB;IACvB,SAAS,EAAE,QAAQ;IACnB,WAAW,EACT,0FAA0F;IAC5F,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;aACjE;YACD,EAAE,EAAE;gBACF,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;gBACzB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,yCAAyC;aACvD;YACD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;YAC9D,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6CAA6C;aAC3D;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;aACjE;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;gBACzB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,iDAAiD;aAC/D;YACD,IAAI,EAAE,aAAa,CAAC,IAAI;SACzB;QACD,QAAQ,EAAE,CAAC,MAAM,EAAE,IAAI,E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,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SendGrid tools — transactional email send (write) plus read wrappers for
|
|
3
|
+
* dynamic/legacy templates and email stats.
|
|
4
|
+
*
|
|
5
|
+
* Self-registering tool module for the recipe tool registry. Wraps the
|
|
6
|
+
* SendGridConnector (src/connectors/sendgrid.ts) methods `send`,
|
|
7
|
+
* `listTemplates`, and `getStats`.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SendGrid tools — transactional email send (write) plus read wrappers for
|
|
3
|
+
* dynamic/legacy templates and email stats.
|
|
4
|
+
*
|
|
5
|
+
* Self-registering tool module for the recipe tool registry. Wraps the
|
|
6
|
+
* SendGridConnector (src/connectors/sendgrid.ts) methods `send`,
|
|
7
|
+
* `listTemplates`, and `getStats`.
|
|
8
|
+
*/
|
|
9
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// sendgrid.send_email (write-gated)
|
|
12
|
+
// ============================================================================
|
|
13
|
+
registerTool({
|
|
14
|
+
id: "sendgrid.send_email",
|
|
15
|
+
namespace: "sendgrid",
|
|
16
|
+
description: "Send a transactional email via SendGrid. Requires `to`, `subject`, and at " +
|
|
17
|
+
"least one of `text`/`html`. `from` defaults to the connected verified sender.",
|
|
18
|
+
paramsSchema: {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
to: {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "Recipient email address (required)",
|
|
24
|
+
},
|
|
25
|
+
subject: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "Email subject line (required, non-empty)",
|
|
28
|
+
},
|
|
29
|
+
text: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Plain-text body (one of text/html is required)",
|
|
32
|
+
},
|
|
33
|
+
html: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "HTML body (one of text/html is required)",
|
|
36
|
+
},
|
|
37
|
+
from: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Sender email address. Defaults to the connected verified sender (fromEmail).",
|
|
40
|
+
},
|
|
41
|
+
into: CommonSchemas.into,
|
|
42
|
+
},
|
|
43
|
+
required: ["to", "subject"],
|
|
44
|
+
},
|
|
45
|
+
outputSchema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
ok: { type: "boolean" },
|
|
49
|
+
messageId: { type: "string" },
|
|
50
|
+
error: { type: "string" },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
riskDefault: "medium",
|
|
54
|
+
isWrite: true,
|
|
55
|
+
isConnector: true,
|
|
56
|
+
execute: async ({ params }) => {
|
|
57
|
+
const { getSendGridConnector } = await import("../../connectors/sendgrid.js");
|
|
58
|
+
try {
|
|
59
|
+
const connector = getSendGridConnector();
|
|
60
|
+
const result = await connector.send({
|
|
61
|
+
to: params.to,
|
|
62
|
+
subject: params.subject,
|
|
63
|
+
text: typeof params.text === "string" ? params.text : undefined,
|
|
64
|
+
html: typeof params.html === "string" ? params.html : undefined,
|
|
65
|
+
from: typeof params.from === "string" ? params.from : undefined,
|
|
66
|
+
});
|
|
67
|
+
return JSON.stringify({ ok: true, messageId: result.messageId });
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
return JSON.stringify({
|
|
71
|
+
ok: false,
|
|
72
|
+
error: err instanceof Error ? err.message : String(err),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
// ============================================================================
|
|
78
|
+
// sendgrid.list_templates
|
|
79
|
+
// ============================================================================
|
|
80
|
+
registerTool({
|
|
81
|
+
id: "sendgrid.list_templates",
|
|
82
|
+
namespace: "sendgrid",
|
|
83
|
+
description: "List SendGrid email templates, optionally filtered by generation " +
|
|
84
|
+
"(legacy or dynamic).",
|
|
85
|
+
paramsSchema: {
|
|
86
|
+
type: "object",
|
|
87
|
+
properties: {
|
|
88
|
+
limit: {
|
|
89
|
+
type: "number",
|
|
90
|
+
description: "Max number of templates to return (page_size)",
|
|
91
|
+
},
|
|
92
|
+
generations: {
|
|
93
|
+
type: "string",
|
|
94
|
+
enum: ["legacy", "dynamic"],
|
|
95
|
+
description: "Filter by template generation",
|
|
96
|
+
},
|
|
97
|
+
into: CommonSchemas.into,
|
|
98
|
+
},
|
|
99
|
+
required: [],
|
|
100
|
+
},
|
|
101
|
+
outputSchema: {
|
|
102
|
+
type: "object",
|
|
103
|
+
properties: {
|
|
104
|
+
result: { type: "array", items: { type: "object" } },
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
riskDefault: "low",
|
|
108
|
+
isWrite: false,
|
|
109
|
+
isConnector: true,
|
|
110
|
+
execute: async ({ params }) => {
|
|
111
|
+
const { getSendGridConnector } = await import("../../connectors/sendgrid.js");
|
|
112
|
+
const connector = getSendGridConnector();
|
|
113
|
+
const result = await connector.listTemplates({
|
|
114
|
+
limit: typeof params.limit === "number" ? params.limit : undefined,
|
|
115
|
+
generations: params.generations === "legacy" || params.generations === "dynamic"
|
|
116
|
+
? params.generations
|
|
117
|
+
: undefined,
|
|
118
|
+
});
|
|
119
|
+
return JSON.stringify(result);
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
// ============================================================================
|
|
123
|
+
// sendgrid.get_stats
|
|
124
|
+
// ============================================================================
|
|
125
|
+
registerTool({
|
|
126
|
+
id: "sendgrid.get_stats",
|
|
127
|
+
namespace: "sendgrid",
|
|
128
|
+
description: "Fetch SendGrid email statistics for a date range, optionally aggregated " +
|
|
129
|
+
"by day/week/month.",
|
|
130
|
+
paramsSchema: {
|
|
131
|
+
type: "object",
|
|
132
|
+
properties: {
|
|
133
|
+
startDate: {
|
|
134
|
+
type: "string",
|
|
135
|
+
description: "Start date YYYY-MM-DD (required)",
|
|
136
|
+
},
|
|
137
|
+
endDate: {
|
|
138
|
+
type: "string",
|
|
139
|
+
description: "End date YYYY-MM-DD (optional, defaults to today)",
|
|
140
|
+
},
|
|
141
|
+
aggregatedBy: {
|
|
142
|
+
type: "string",
|
|
143
|
+
enum: ["day", "week", "month"],
|
|
144
|
+
description: "Aggregation bucket size",
|
|
145
|
+
},
|
|
146
|
+
into: CommonSchemas.into,
|
|
147
|
+
},
|
|
148
|
+
required: ["startDate"],
|
|
149
|
+
},
|
|
150
|
+
outputSchema: {
|
|
151
|
+
type: "object",
|
|
152
|
+
properties: {
|
|
153
|
+
data: { type: "array", items: { type: "object" } },
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
riskDefault: "low",
|
|
157
|
+
isWrite: false,
|
|
158
|
+
isConnector: true,
|
|
159
|
+
execute: async ({ params }) => {
|
|
160
|
+
const { getSendGridConnector } = await import("../../connectors/sendgrid.js");
|
|
161
|
+
const connector = getSendGridConnector();
|
|
162
|
+
const data = await connector.getStats({
|
|
163
|
+
startDate: params.startDate,
|
|
164
|
+
endDate: typeof params.endDate === "string" ? params.endDate : undefined,
|
|
165
|
+
aggregatedBy: params.aggregatedBy === "day" ||
|
|
166
|
+
params.aggregatedBy === "week" ||
|
|
167
|
+
params.aggregatedBy === "month"
|
|
168
|
+
? params.aggregatedBy
|
|
169
|
+
: undefined,
|
|
170
|
+
});
|
|
171
|
+
return JSON.stringify({ data });
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
//# sourceMappingURL=sendgrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendgrid.js","sourceRoot":"","sources":["../../../src/recipes/tools/sendgrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,+EAA+E;AAC/E,qCAAqC;AACrC,+EAA+E;AAE/E,YAAY,CAAC;IACX,E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|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry. Wraps the
|
|
5
|
+
* `TwilioConnector` methods (`sendSms`, `listMessages`, `getMessage`).
|
|
6
|
+
*
|
|
7
|
+
* `send_sms` is write-gated (isWrite: true) so the approval queue and the
|
|
8
|
+
* write kill-switch gate it. Read tools (`list_messages`, `get_message`) are
|
|
9
|
+
* isWrite: false.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Twilio tools — SMS send + message read access via the Twilio REST API.
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry. Wraps the
|
|
5
|
+
* `TwilioConnector` methods (`sendSms`, `listMessages`, `getMessage`).
|
|
6
|
+
*
|
|
7
|
+
* `send_sms` is write-gated (isWrite: true) so the approval queue and the
|
|
8
|
+
* write kill-switch gate it. Read tools (`list_messages`, `get_message`) are
|
|
9
|
+
* isWrite: false.
|
|
10
|
+
*/
|
|
11
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// twilio.send_sms (write-gated)
|
|
14
|
+
// ============================================================================
|
|
15
|
+
registerTool({
|
|
16
|
+
id: "twilio.send_sms",
|
|
17
|
+
namespace: "twilio",
|
|
18
|
+
description: "Send an SMS via Twilio. 'to' and 'body' are required; 'from' falls back to the connector's defaultFrom. Phone numbers must be E.164 (e.g. +14155551234).",
|
|
19
|
+
paramsSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {
|
|
22
|
+
to: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Destination phone number in E.164 format (+14155551234)",
|
|
25
|
+
},
|
|
26
|
+
body: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "SMS message body text",
|
|
29
|
+
},
|
|
30
|
+
from: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Optional sender phone number in E.164 format; defaults to the connector's configured defaultFrom",
|
|
33
|
+
},
|
|
34
|
+
into: CommonSchemas.into,
|
|
35
|
+
},
|
|
36
|
+
required: ["to", "body"],
|
|
37
|
+
},
|
|
38
|
+
outputSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
sid: { type: "string" },
|
|
42
|
+
account_sid: { type: "string" },
|
|
43
|
+
to: { type: "string" },
|
|
44
|
+
from: { type: "string" },
|
|
45
|
+
body: { type: "string" },
|
|
46
|
+
status: { type: "string" },
|
|
47
|
+
direction: { type: "string" },
|
|
48
|
+
date_sent: { type: ["string", "null"] },
|
|
49
|
+
date_created: { type: "string" },
|
|
50
|
+
date_updated: { type: "string" },
|
|
51
|
+
price: { type: ["string", "null"] },
|
|
52
|
+
price_unit: { type: ["string", "null"] },
|
|
53
|
+
error_code: { type: ["number", "null"] },
|
|
54
|
+
error_message: { type: ["string", "null"] },
|
|
55
|
+
num_segments: { type: "string" },
|
|
56
|
+
num_media: { type: "string" },
|
|
57
|
+
uri: { type: "string" },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
riskDefault: "medium",
|
|
61
|
+
isWrite: true,
|
|
62
|
+
isConnector: true,
|
|
63
|
+
execute: async ({ params }) => {
|
|
64
|
+
const { getTwilioConnector } = await import("../../connectors/twilio.js");
|
|
65
|
+
const connector = getTwilioConnector();
|
|
66
|
+
const result = await connector.sendSms({
|
|
67
|
+
to: params.to,
|
|
68
|
+
body: params.body,
|
|
69
|
+
from: typeof params.from === "string" ? params.from : undefined,
|
|
70
|
+
});
|
|
71
|
+
return JSON.stringify(result);
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
// ============================================================================
|
|
75
|
+
// twilio.list_messages
|
|
76
|
+
// ============================================================================
|
|
77
|
+
registerTool({
|
|
78
|
+
id: "twilio.list_messages",
|
|
79
|
+
namespace: "twilio",
|
|
80
|
+
description: "List Twilio messages, optionally filtered by 'to', 'from', or 'dateSent' (YYYY-MM-DD).",
|
|
81
|
+
paramsSchema: {
|
|
82
|
+
type: "object",
|
|
83
|
+
properties: {
|
|
84
|
+
to: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "Filter by destination phone number (E.164)",
|
|
87
|
+
},
|
|
88
|
+
from: {
|
|
89
|
+
type: "string",
|
|
90
|
+
description: "Filter by sender phone number (E.164)",
|
|
91
|
+
},
|
|
92
|
+
dateSent: {
|
|
93
|
+
type: "string",
|
|
94
|
+
description: "Filter by send date (YYYY-MM-DD)",
|
|
95
|
+
},
|
|
96
|
+
limit: {
|
|
97
|
+
type: "number",
|
|
98
|
+
description: "Max number of messages to return (default 20)",
|
|
99
|
+
default: 20,
|
|
100
|
+
},
|
|
101
|
+
into: CommonSchemas.into,
|
|
102
|
+
},
|
|
103
|
+
required: [],
|
|
104
|
+
},
|
|
105
|
+
outputSchema: {
|
|
106
|
+
type: "object",
|
|
107
|
+
properties: {
|
|
108
|
+
messages: { type: "array", items: { type: "object" } },
|
|
109
|
+
page: { type: "number" },
|
|
110
|
+
page_size: { type: "number" },
|
|
111
|
+
next_page_uri: { type: ["string", "null"] },
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
riskDefault: "low",
|
|
115
|
+
isWrite: false,
|
|
116
|
+
isConnector: true,
|
|
117
|
+
execute: async ({ params }) => {
|
|
118
|
+
const { getTwilioConnector } = await import("../../connectors/twilio.js");
|
|
119
|
+
const connector = getTwilioConnector();
|
|
120
|
+
const result = await connector.listMessages({
|
|
121
|
+
to: typeof params.to === "string" ? params.to : undefined,
|
|
122
|
+
from: typeof params.from === "string" ? params.from : undefined,
|
|
123
|
+
dateSent: typeof params.dateSent === "string" ? params.dateSent : undefined,
|
|
124
|
+
limit: typeof params.limit === "number" ? params.limit : undefined,
|
|
125
|
+
});
|
|
126
|
+
return JSON.stringify(result);
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
// ============================================================================
|
|
130
|
+
// twilio.get_message
|
|
131
|
+
// ============================================================================
|
|
132
|
+
registerTool({
|
|
133
|
+
id: "twilio.get_message",
|
|
134
|
+
namespace: "twilio",
|
|
135
|
+
description: "Fetch a single Twilio message by its message SID (SM...).",
|
|
136
|
+
paramsSchema: {
|
|
137
|
+
type: "object",
|
|
138
|
+
properties: {
|
|
139
|
+
messageSid: {
|
|
140
|
+
type: "string",
|
|
141
|
+
description: "Twilio message SID (SM...)",
|
|
142
|
+
},
|
|
143
|
+
into: CommonSchemas.into,
|
|
144
|
+
},
|
|
145
|
+
required: ["messageSid"],
|
|
146
|
+
},
|
|
147
|
+
outputSchema: {
|
|
148
|
+
type: "object",
|
|
149
|
+
properties: {
|
|
150
|
+
sid: { type: "string" },
|
|
151
|
+
account_sid: { type: "string" },
|
|
152
|
+
to: { type: "string" },
|
|
153
|
+
from: { type: "string" },
|
|
154
|
+
body: { type: "string" },
|
|
155
|
+
status: { type: "string" },
|
|
156
|
+
direction: { type: "string" },
|
|
157
|
+
date_sent: { type: ["string", "null"] },
|
|
158
|
+
date_created: { type: "string" },
|
|
159
|
+
date_updated: { type: "string" },
|
|
160
|
+
price: { type: ["string", "null"] },
|
|
161
|
+
price_unit: { type: ["string", "null"] },
|
|
162
|
+
error_code: { type: ["number", "null"] },
|
|
163
|
+
error_message: { type: ["string", "null"] },
|
|
164
|
+
num_segments: { type: "string" },
|
|
165
|
+
num_media: { type: "string" },
|
|
166
|
+
uri: { type: "string" },
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
riskDefault: "low",
|
|
170
|
+
isWrite: false,
|
|
171
|
+
isConnector: true,
|
|
172
|
+
execute: async ({ params }) => {
|
|
173
|
+
const { getTwilioConnector } = await import("../../connectors/twilio.js");
|
|
174
|
+
const connector = getTwilioConnector();
|
|
175
|
+
const result = await connector.getMessage(params.messageSid);
|
|
176
|
+
return JSON.stringify(result);
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
//# sourceMappingURL=twilio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"twilio.js","sourceRoot":"","sources":["../../../src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vC,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAChC,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAChC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;YACnC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;YACxC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;YACxC,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;YAC3C,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAChC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC7B,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SACxB;KACF;IACD,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5B,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;QAC1E,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,UAAoB,CAAC,CAAC;QACvE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vercel tools — read-only access to deployments and projects.
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry. Read-only set
|
|
5
|
+
* only (v1 safe): no createDeployment / cancelDeployment / env-var mutations.
|
|
6
|
+
* Each tool mirrors the real connector signature in `src/connectors/vercel.ts`
|
|
7
|
+
* and returns `JSON.stringify(result)` of the connector's native return type.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|