patchwork-os 0.2.0-beta.10 → 0.2.0-beta.10.canary.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/bridge.js +17 -10
  2. package/dist/bridge.js.map +1 -1
  3. package/dist/commands/connect.d.ts +47 -0
  4. package/dist/commands/connect.js +419 -0
  5. package/dist/commands/connect.js.map +1 -0
  6. package/dist/commands/recipe.d.ts +45 -4
  7. package/dist/commands/recipe.js +141 -4
  8. package/dist/commands/recipe.js.map +1 -1
  9. package/dist/commands/task.d.ts +25 -0
  10. package/dist/commands/task.js +61 -41
  11. package/dist/commands/task.js.map +1 -1
  12. package/dist/commands/tracesExport.d.ts +15 -1
  13. package/dist/commands/tracesExport.js +39 -5
  14. package/dist/commands/tracesExport.js.map +1 -1
  15. package/dist/connectorRoutes.js +556 -0
  16. package/dist/connectorRoutes.js.map +1 -1
  17. package/dist/connectors/connectorRegistry.d.ts +0 -3
  18. package/dist/connectors/connectorRegistry.js +8 -8
  19. package/dist/connectors/connectorRegistry.js.map +1 -1
  20. package/dist/connectors/datadog.js +8 -1
  21. package/dist/connectors/datadog.js.map +1 -1
  22. package/dist/connectors/jira.js +7 -2
  23. package/dist/connectors/jira.js.map +1 -1
  24. package/dist/connectors/mcpClient.js +37 -23
  25. package/dist/connectors/mcpClient.js.map +1 -1
  26. package/dist/connectors/notion.d.ts +1 -1
  27. package/dist/connectors/notion.js +13 -4
  28. package/dist/connectors/notion.js.map +1 -1
  29. package/dist/connectors/redis.js +10 -2
  30. package/dist/connectors/redis.js.map +1 -1
  31. package/dist/connectors/snowflake.js +18 -0
  32. package/dist/connectors/snowflake.js.map +1 -1
  33. package/dist/decisionReplay.d.ts +8 -6
  34. package/dist/decisionReplay.js +35 -11
  35. package/dist/decisionReplay.js.map +1 -1
  36. package/dist/drivers/claude/api.js +28 -5
  37. package/dist/drivers/claude/api.js.map +1 -1
  38. package/dist/drivers/claude/subprocess.js +47 -13
  39. package/dist/drivers/claude/subprocess.js.map +1 -1
  40. package/dist/drivers/local/index.d.ts +2 -17
  41. package/dist/drivers/local/index.js +5 -92
  42. package/dist/drivers/local/index.js.map +1 -1
  43. package/dist/fp/automationInterpreter.js +57 -12
  44. package/dist/fp/automationInterpreter.js.map +1 -1
  45. package/dist/fp/policyParser.js +5 -1
  46. package/dist/fp/policyParser.js.map +1 -1
  47. package/dist/index.js +154 -83
  48. package/dist/index.js.map +1 -1
  49. package/dist/localEndpointGuard.d.ts +25 -0
  50. package/dist/localEndpointGuard.js +101 -0
  51. package/dist/localEndpointGuard.js.map +1 -0
  52. package/dist/orchestrator/childBridgeClient.d.ts +5 -0
  53. package/dist/orchestrator/childBridgeClient.js +28 -1
  54. package/dist/orchestrator/childBridgeClient.js.map +1 -1
  55. package/dist/orchestrator/orchestratorBridge.d.ts +33 -0
  56. package/dist/orchestrator/orchestratorBridge.js +70 -9
  57. package/dist/orchestrator/orchestratorBridge.js.map +1 -1
  58. package/dist/recipes/chainedRunner.js +14 -4
  59. package/dist/recipes/chainedRunner.js.map +1 -1
  60. package/dist/recipes/compiler.js +9 -5
  61. package/dist/recipes/compiler.js.map +1 -1
  62. package/dist/recipes/dependencyGraph.d.ts +9 -0
  63. package/dist/recipes/dependencyGraph.js +19 -2
  64. package/dist/recipes/dependencyGraph.js.map +1 -1
  65. package/dist/recipes/githubInstallSource.d.ts +9 -2
  66. package/dist/recipes/githubInstallSource.js +36 -6
  67. package/dist/recipes/githubInstallSource.js.map +1 -1
  68. package/dist/recipes/idempotencyKey.d.ts +23 -3
  69. package/dist/recipes/idempotencyKey.js +57 -4
  70. package/dist/recipes/idempotencyKey.js.map +1 -1
  71. package/dist/recipes/installer.js +10 -1
  72. package/dist/recipes/installer.js.map +1 -1
  73. package/dist/recipes/parser.js +28 -1
  74. package/dist/recipes/parser.js.map +1 -1
  75. package/dist/recipes/schema.d.ts +29 -2
  76. package/dist/recipes/schemaGenerator.js +16 -2
  77. package/dist/recipes/schemaGenerator.js.map +1 -1
  78. package/dist/recipes/toolRegistry.js +13 -4
  79. package/dist/recipes/toolRegistry.js.map +1 -1
  80. package/dist/recipes/tools/airtable.d.ts +15 -0
  81. package/dist/recipes/tools/airtable.js +239 -0
  82. package/dist/recipes/tools/airtable.js.map +1 -0
  83. package/dist/recipes/tools/circleci.d.ts +10 -0
  84. package/dist/recipes/tools/circleci.js +203 -0
  85. package/dist/recipes/tools/circleci.js.map +1 -0
  86. package/dist/recipes/tools/grafana.d.ts +11 -0
  87. package/dist/recipes/tools/grafana.js +215 -0
  88. package/dist/recipes/tools/grafana.js.map +1 -0
  89. package/dist/recipes/tools/index.d.ts +11 -0
  90. package/dist/recipes/tools/index.js +11 -0
  91. package/dist/recipes/tools/index.js.map +1 -1
  92. package/dist/recipes/tools/pipedrive.d.ts +16 -0
  93. package/dist/recipes/tools/pipedrive.js +233 -0
  94. package/dist/recipes/tools/pipedrive.js.map +1 -0
  95. package/dist/recipes/tools/posthog.d.ts +16 -0
  96. package/dist/recipes/tools/posthog.js +218 -0
  97. package/dist/recipes/tools/posthog.js.map +1 -0
  98. package/dist/recipes/tools/resend.d.ts +8 -0
  99. package/dist/recipes/tools/resend.js +152 -0
  100. package/dist/recipes/tools/resend.js.map +1 -0
  101. package/dist/recipes/tools/sendgrid.d.ts +9 -0
  102. package/dist/recipes/tools/sendgrid.js +174 -0
  103. package/dist/recipes/tools/sendgrid.js.map +1 -0
  104. package/dist/recipes/tools/shopify.d.ts +16 -0
  105. package/dist/recipes/tools/shopify.js +265 -0
  106. package/dist/recipes/tools/shopify.js.map +1 -0
  107. package/dist/recipes/tools/todoist.d.ts +15 -0
  108. package/dist/recipes/tools/todoist.js +227 -0
  109. package/dist/recipes/tools/todoist.js.map +1 -0
  110. package/dist/recipes/tools/twilio.d.ts +11 -0
  111. package/dist/recipes/tools/twilio.js +179 -0
  112. package/dist/recipes/tools/twilio.js.map +1 -0
  113. package/dist/recipes/tools/vercel.d.ts +9 -0
  114. package/dist/recipes/tools/vercel.js +145 -0
  115. package/dist/recipes/tools/vercel.js.map +1 -0
  116. package/dist/recipes/validation.js +112 -0
  117. package/dist/recipes/validation.js.map +1 -1
  118. package/dist/recipes/yamlRunner.d.ts +3 -0
  119. package/dist/recipes/yamlRunner.js +112 -29
  120. package/dist/recipes/yamlRunner.js.map +1 -1
  121. package/dist/schemas/recipe.v1.json +2 -2
  122. package/dist/telemetry.js +20 -9
  123. package/dist/telemetry.js.map +1 -1
  124. package/dist/tools/getGitStatus.js +6 -1
  125. package/dist/tools/getGitStatus.js.map +1 -1
  126. package/dist/tools/getToolCapabilities.js +39 -4
  127. package/dist/tools/getToolCapabilities.js.map +1 -1
  128. package/dist/tools/github/composite.d.ts +1 -1
  129. package/dist/tools/github/composite.js +7 -7
  130. package/dist/tools/github/composite.js.map +1 -1
  131. package/dist/tools/github/pr.d.ts +6 -6
  132. package/dist/tools/github/pr.js +18 -11
  133. package/dist/tools/github/pr.js.map +1 -1
  134. package/dist/tools/index.js +14 -10
  135. package/dist/tools/index.js.map +1 -1
  136. package/dist/tools/previewEdit.js +16 -1
  137. package/dist/tools/previewEdit.js.map +1 -1
  138. package/dist/tools/searchAndReplace.js +4 -5
  139. package/dist/tools/searchAndReplace.js.map +1 -1
  140. package/dist/tools/searchTools.d.ts +26 -0
  141. package/dist/tools/searchTools.js +42 -2
  142. package/dist/tools/searchTools.js.map +1 -1
  143. package/dist/tools/transaction.d.ts +9 -1
  144. package/dist/tools/transaction.js +59 -4
  145. package/dist/tools/transaction.js.map +1 -1
  146. package/dist/tools/utils.d.ts +15 -0
  147. package/dist/tools/utils.js +19 -0
  148. package/dist/tools/utils.js.map +1 -1
  149. package/dist/transport.js +23 -0
  150. package/dist/transport.js.map +1 -1
  151. package/package.json +1 -1
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Todoist tools — list/create/close tasks and list projects via the Todoist
3
+ * REST API v2 connector.
4
+ *
5
+ * Self-registering tool module for the recipe tool registry. Mirrors the
6
+ * positional signatures of `TodoistConnector` (src/connectors/todoist.ts):
7
+ * - getTasks(projectId?, filter?, limit?) → TodoistTask[]
8
+ * - createTask(content, projectId?, description?, dueString?, priority?, labels?) → TodoistTask
9
+ * - closeTask(id) → void
10
+ * - getProjects() → TodoistProject[]
11
+ *
12
+ * Read tools declare `isWrite: false`; mutating tools declare `isWrite: true`
13
+ * so the approval queue / kill-switch gate them appropriately.
14
+ */
15
+ import { CommonSchemas, registerTool } from "../toolRegistry.js";
16
+ // ============================================================================
17
+ // todoist.list_tasks
18
+ // ============================================================================
19
+ registerTool({
20
+ id: "todoist.list_tasks",
21
+ namespace: "todoist",
22
+ description: "List active Todoist tasks, optionally filtered by project, a Todoist filter query, or a result limit.",
23
+ paramsSchema: {
24
+ type: "object",
25
+ properties: {
26
+ projectId: {
27
+ type: "string",
28
+ description: "Filter to tasks in this Todoist project id",
29
+ },
30
+ filter: {
31
+ type: "string",
32
+ description: "Todoist filter query (e.g. 'today | overdue', 'p1 & #Work')",
33
+ },
34
+ limit: {
35
+ type: "number",
36
+ description: "Max number of tasks to return",
37
+ },
38
+ into: CommonSchemas.into,
39
+ },
40
+ required: [],
41
+ },
42
+ outputSchema: {
43
+ type: "array",
44
+ items: {
45
+ type: "object",
46
+ properties: {
47
+ id: { type: "string" },
48
+ content: { type: "string" },
49
+ description: { type: "string" },
50
+ project_id: { type: "string" },
51
+ section_id: { type: ["string", "null"] },
52
+ parent_id: { type: ["string", "null"] },
53
+ order: { type: "number" },
54
+ priority: { type: "number" },
55
+ due: { type: ["object", "null"] },
56
+ labels: { type: "array", items: { type: "string" } },
57
+ is_completed: { type: "boolean" },
58
+ created_at: { type: "string" },
59
+ url: { type: "string" },
60
+ assignee_id: { type: ["string", "null"] },
61
+ assigner_id: { type: ["string", "null"] },
62
+ comment_count: { type: "number" },
63
+ creator_id: { type: "string" },
64
+ },
65
+ },
66
+ },
67
+ riskDefault: "low",
68
+ isWrite: false,
69
+ isConnector: true,
70
+ execute: async ({ params }) => {
71
+ const { getTodoistConnector } = await import("../../connectors/todoist.js");
72
+ const connector = getTodoistConnector();
73
+ const result = await connector.getTasks(typeof params.projectId === "string" ? params.projectId : undefined, typeof params.filter === "string" ? params.filter : undefined, typeof params.limit === "number" ? params.limit : undefined);
74
+ return JSON.stringify(result);
75
+ },
76
+ });
77
+ // ============================================================================
78
+ // todoist.create_task (write-gated)
79
+ // ============================================================================
80
+ registerTool({
81
+ id: "todoist.create_task",
82
+ namespace: "todoist",
83
+ description: "Create a new Todoist task with the given content, optionally placed in a project, described, due-dated, prioritised, or labelled.",
84
+ paramsSchema: {
85
+ type: "object",
86
+ properties: {
87
+ content: {
88
+ type: "string",
89
+ description: "Task content / title (required)",
90
+ },
91
+ projectId: {
92
+ type: "string",
93
+ description: "Optional project id to create the task in",
94
+ },
95
+ description: {
96
+ type: "string",
97
+ description: "Optional task description / notes",
98
+ },
99
+ dueString: {
100
+ type: "string",
101
+ description: "Optional natural-language due date (e.g. 'tomorrow at 5pm')",
102
+ },
103
+ priority: {
104
+ type: "number",
105
+ description: "Optional priority 1 (normal) to 4 (urgent)",
106
+ },
107
+ labels: {
108
+ type: "array",
109
+ items: { type: "string" },
110
+ description: "Optional list of label names",
111
+ },
112
+ into: CommonSchemas.into,
113
+ },
114
+ required: ["content"],
115
+ },
116
+ outputSchema: {
117
+ type: "object",
118
+ properties: {
119
+ id: { type: "string" },
120
+ content: { type: "string" },
121
+ description: { type: "string" },
122
+ project_id: { type: "string" },
123
+ section_id: { type: ["string", "null"] },
124
+ parent_id: { type: ["string", "null"] },
125
+ order: { type: "number" },
126
+ priority: { type: "number" },
127
+ due: { type: ["object", "null"] },
128
+ labels: { type: "array", items: { type: "string" } },
129
+ is_completed: { type: "boolean" },
130
+ created_at: { type: "string" },
131
+ url: { type: "string" },
132
+ comment_count: { type: "number" },
133
+ creator_id: { type: "string" },
134
+ },
135
+ },
136
+ riskDefault: "medium",
137
+ isWrite: true,
138
+ isConnector: true,
139
+ execute: async ({ params }) => {
140
+ const { getTodoistConnector } = await import("../../connectors/todoist.js");
141
+ const connector = getTodoistConnector();
142
+ const result = await connector.createTask(params.content, typeof params.projectId === "string" ? params.projectId : undefined, typeof params.description === "string" ? params.description : undefined, typeof params.dueString === "string" ? params.dueString : undefined, typeof params.priority === "number" ? params.priority : undefined, Array.isArray(params.labels) ? params.labels : undefined);
143
+ return JSON.stringify(result);
144
+ },
145
+ });
146
+ // ============================================================================
147
+ // todoist.close_task (write-gated)
148
+ // ============================================================================
149
+ registerTool({
150
+ id: "todoist.close_task",
151
+ namespace: "todoist",
152
+ description: "Close (complete) a Todoist task by id. Recurring tasks advance to their next occurrence.",
153
+ paramsSchema: {
154
+ type: "object",
155
+ properties: {
156
+ id: {
157
+ type: "string",
158
+ description: "Todoist task id to close (required)",
159
+ },
160
+ into: CommonSchemas.into,
161
+ },
162
+ required: ["id"],
163
+ },
164
+ outputSchema: {
165
+ type: "object",
166
+ properties: {
167
+ ok: { type: "boolean" },
168
+ id: { type: "string" },
169
+ },
170
+ },
171
+ riskDefault: "medium",
172
+ isWrite: true,
173
+ isConnector: true,
174
+ execute: async ({ params }) => {
175
+ const { getTodoistConnector } = await import("../../connectors/todoist.js");
176
+ const connector = getTodoistConnector();
177
+ const id = params.id;
178
+ await connector.closeTask(id);
179
+ // closeTask resolves to void; surface a small structured ack so the tool
180
+ // satisfies the `string | null` execute contract and downstream
181
+ // `{{steps.x.ok}}` references stay coherent.
182
+ return JSON.stringify({ ok: true, id });
183
+ },
184
+ });
185
+ // ============================================================================
186
+ // todoist.list_projects
187
+ // ============================================================================
188
+ registerTool({
189
+ id: "todoist.list_projects",
190
+ namespace: "todoist",
191
+ description: "List all Todoist projects for the authenticated account.",
192
+ paramsSchema: {
193
+ type: "object",
194
+ properties: {
195
+ into: CommonSchemas.into,
196
+ },
197
+ required: [],
198
+ },
199
+ outputSchema: {
200
+ type: "array",
201
+ items: {
202
+ type: "object",
203
+ properties: {
204
+ id: { type: "string" },
205
+ name: { type: "string" },
206
+ color: { type: "string" },
207
+ parent_id: { type: ["string", "null"] },
208
+ order: { type: "number" },
209
+ is_favorite: { type: "boolean" },
210
+ is_inbox_project: { type: "boolean" },
211
+ is_team_inbox: { type: "boolean" },
212
+ is_shared: { type: "boolean" },
213
+ url: { type: "string" },
214
+ },
215
+ },
216
+ },
217
+ riskDefault: "low",
218
+ isWrite: false,
219
+ isConnector: true,
220
+ execute: async () => {
221
+ const { getTodoistConnector } = await import("../../connectors/todoist.js");
222
+ const connector = getTodoistConnector();
223
+ const result = await connector.getProjects();
224
+ return JSON.stringify(result);
225
+ },
226
+ });
227
+ //# sourceMappingURL=todoist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"todoist.js","sourceRoot":"","sources":["../../../src/recipes/tools/todoist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,YAAY,CAAC;IACX,EAAE,EAAE,oBAAoB;IACxB,SAAS,EAAE,SAAS;IACpB,WAAW,EACT,uGAAuG;IACzG,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4CAA4C;aAC1D;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,6DAA6D;aAChE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+BAA+B;aAC7C;YACD,IAAI,EAAE,aAAa,CAAC,IAAI;SACzB;QACD,QAAQ,EAAE,EAAE;KACb;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,OAAO;QACb,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACtB,OA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EAAE;gBACrC,aAAa,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gBAClC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC9B,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aACxB;SACF;KACF;IACD,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK,IAAI,EAAE;QAClB,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;QAC5E,MAAM,SAAS,GAAG,mBAAmB,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,WAAW,EAAE,CAAC;QAC7C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
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
+ 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/recipes/tools/twilio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,+EAA+E;AAC/E,iCAAiC;AACjC,+EAA+E;AAE/E,YAAY,CAAC;IACX,EAAE,EAAE,iBAAiB;IACrB,SAAS,EAAE,QAAQ;IACnB,WAAW,EACT,0JAA0J;IAC5J,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,EAAE,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yDAAyD;aACvE;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uBAAuB;aACrC;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,kGAAkG;aACrG;YACD,IAAI,EAAE,aAAa,CAAC,IAAI;SACzB;QACD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;KACzB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACvB,WAAW,EAAE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C1E,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 {};
@@ -0,0 +1,145 @@
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
+ import { CommonSchemas, registerTool } from "../toolRegistry.js";
10
+ // ============================================================================
11
+ // vercel.list_deployments
12
+ // ============================================================================
13
+ registerTool({
14
+ id: "vercel.list_deployments",
15
+ namespace: "vercel",
16
+ description: "List Vercel deployments, optionally filtered by project ID and state.",
17
+ paramsSchema: {
18
+ type: "object",
19
+ properties: {
20
+ projectId: {
21
+ type: "string",
22
+ description: "Filter by Vercel project ID",
23
+ },
24
+ limit: {
25
+ type: "number",
26
+ description: "Max number of deployments to return",
27
+ },
28
+ state: {
29
+ type: "string",
30
+ description: "Filter by deployment state (BUILDING, ERROR, INITIALIZING, QUEUED, READY, CANCELED)",
31
+ },
32
+ into: CommonSchemas.into,
33
+ },
34
+ required: [],
35
+ },
36
+ outputSchema: {
37
+ type: "array",
38
+ items: {
39
+ type: "object",
40
+ properties: {
41
+ id: { type: "string" },
42
+ uid: { type: "string" },
43
+ name: { type: "string" },
44
+ url: { type: "string" },
45
+ state: { type: "string" },
46
+ createdAt: { type: "number" },
47
+ target: { type: ["string", "null"] },
48
+ },
49
+ },
50
+ },
51
+ riskDefault: "low",
52
+ isWrite: false,
53
+ isConnector: true,
54
+ execute: async ({ params }) => {
55
+ const { getVercelConnector } = await import("../../connectors/vercel.js");
56
+ const connector = getVercelConnector();
57
+ const result = await connector.listDeployments({
58
+ projectId: typeof params.projectId === "string" ? params.projectId : undefined,
59
+ limit: typeof params.limit === "number" ? params.limit : undefined,
60
+ state: typeof params.state === "string" ? params.state : undefined,
61
+ });
62
+ return JSON.stringify(result);
63
+ },
64
+ });
65
+ // ============================================================================
66
+ // vercel.get_deployment
67
+ // ============================================================================
68
+ registerTool({
69
+ id: "vercel.get_deployment",
70
+ namespace: "vercel",
71
+ description: "Fetch a single Vercel deployment by ID.",
72
+ paramsSchema: {
73
+ type: "object",
74
+ properties: {
75
+ id: { type: "string", description: "Vercel deployment ID" },
76
+ into: CommonSchemas.into,
77
+ },
78
+ required: ["id"],
79
+ },
80
+ outputSchema: {
81
+ type: "object",
82
+ properties: {
83
+ id: { type: "string" },
84
+ uid: { type: "string" },
85
+ name: { type: "string" },
86
+ url: { type: "string" },
87
+ state: { type: "string" },
88
+ createdAt: { type: "number" },
89
+ target: { type: ["string", "null"] },
90
+ },
91
+ },
92
+ riskDefault: "low",
93
+ isWrite: false,
94
+ isConnector: true,
95
+ execute: async ({ params }) => {
96
+ const { getVercelConnector } = await import("../../connectors/vercel.js");
97
+ const connector = getVercelConnector();
98
+ const result = await connector.getDeployment(params.id);
99
+ return JSON.stringify(result);
100
+ },
101
+ });
102
+ // ============================================================================
103
+ // vercel.list_projects
104
+ // ============================================================================
105
+ registerTool({
106
+ id: "vercel.list_projects",
107
+ namespace: "vercel",
108
+ description: "List Vercel projects.",
109
+ paramsSchema: {
110
+ type: "object",
111
+ properties: {
112
+ limit: {
113
+ type: "number",
114
+ description: "Max number of projects to return",
115
+ },
116
+ into: CommonSchemas.into,
117
+ },
118
+ required: [],
119
+ },
120
+ outputSchema: {
121
+ type: "array",
122
+ items: {
123
+ type: "object",
124
+ properties: {
125
+ id: { type: "string" },
126
+ name: { type: "string" },
127
+ framework: { type: ["string", "null"] },
128
+ link: { type: "object" },
129
+ latestDeployments: { type: "array", items: { type: "object" } },
130
+ },
131
+ },
132
+ },
133
+ riskDefault: "low",
134
+ isWrite: false,
135
+ isConnector: true,
136
+ execute: async ({ params }) => {
137
+ const { getVercelConnector } = await import("../../connectors/vercel.js");
138
+ const connector = getVercelConnector();
139
+ const result = await connector.listProjects({
140
+ limit: typeof params.limit === "number" ? params.limit : undefined,
141
+ });
142
+ return JSON.stringify(result);
143
+ },
144
+ });
145
+ //# sourceMappingURL=vercel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vercel.js","sourceRoot":"","sources":["../../../src/recipes/tools/vercel.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,+EAA+E;AAC/E,0BAA0B;AAC1B,+EAA+E;AAE/E,YAAY,CAAC;IACX,EAAE,EAAE,yBAAyB;IAC7B,SAAS,EAAE,QAAQ;IACnB,WAAW,EACT,uEAAuE;IACzE,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6BAA6B;aAC3C;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qCAAqC;aACnD;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,qFAAqF;aACxF;YACD,IAAI,EAAE,aAAa,CAAC,IAAI;SACzB;QACD,QAAQ,EAAE,EAAE;KACb;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,OAAO;QACb,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ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