patchwork-os 0.2.0-beta.10.canary.98 → 0.2.0-beta.11
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.md +20 -1
- package/dist/adapters/grok.js +6 -1
- package/dist/adapters/grok.js.map +1 -1
- package/dist/approvalHttp.js +61 -66
- package/dist/approvalHttp.js.map +1 -1
- package/dist/bridge.js +3 -2
- package/dist/bridge.js.map +1 -1
- package/dist/claudeOrchestrator.js +15 -0
- package/dist/claudeOrchestrator.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/patchworkInit.d.ts +7 -0
- package/dist/commands/patchworkInit.js +26 -0
- package/dist/commands/patchworkInit.js.map +1 -1
- package/dist/commands/recipe.d.ts +14 -0
- package/dist/commands/recipe.js +51 -0
- package/dist/commands/recipe.js.map +1 -1
- package/dist/commands/recipeInstall.js +15 -0
- package/dist/commands/recipeInstall.js.map +1 -1
- package/dist/connectors/postgres.d.ts +7 -0
- package/dist/connectors/postgres.js +16 -2
- package/dist/connectors/postgres.js.map +1 -1
- package/dist/connectors/snowflake.js +6 -0
- package/dist/connectors/snowflake.js.map +1 -1
- package/dist/connectors/tokenStorage.d.ts +8 -0
- package/dist/connectors/tokenStorage.js +42 -3
- package/dist/connectors/tokenStorage.js.map +1 -1
- package/dist/drivers/claude/api.js +15 -2
- package/dist/drivers/claude/api.js.map +1 -1
- package/dist/drivers/claude/subprocess.js +1 -29
- package/dist/drivers/claude/subprocess.js.map +1 -1
- package/dist/drivers/gemini/index.js +9 -5
- package/dist/drivers/gemini/index.js.map +1 -1
- package/dist/drivers/openai/index.js +29 -4
- package/dist/drivers/openai/index.js.map +1 -1
- package/dist/drivers/outputCap.d.ts +27 -0
- package/dist/drivers/outputCap.js +50 -0
- package/dist/drivers/outputCap.js.map +1 -0
- package/dist/featureFlags.d.ts +9 -0
- package/dist/featureFlags.js +16 -0
- package/dist/featureFlags.js.map +1 -1
- package/dist/fp/commandDescription.d.ts +6 -0
- package/dist/fp/commandDescription.js +4 -4
- package/dist/fp/commandDescription.js.map +1 -1
- package/dist/fp/policyParser.js +13 -7
- package/dist/fp/policyParser.js.map +1 -1
- package/dist/haltPushDispatch.js +7 -22
- package/dist/haltPushDispatch.js.map +1 -1
- package/dist/index.js +148 -0
- package/dist/index.js.map +1 -1
- package/dist/mcpRoutes.js +1 -1
- package/dist/mcpRoutes.js.map +1 -1
- package/dist/oauth.d.ts +13 -0
- package/dist/oauth.js +34 -1
- package/dist/oauth.js.map +1 -1
- package/dist/recipeOrchestration.js +10 -0
- package/dist/recipeOrchestration.js.map +1 -1
- package/dist/recipeRoutes.d.ts +39 -0
- package/dist/recipeRoutes.js +214 -12
- package/dist/recipeRoutes.js.map +1 -1
- package/dist/recipes/agentExecutor.d.ts +20 -0
- package/dist/recipes/agentExecutor.js +32 -10
- package/dist/recipes/agentExecutor.js.map +1 -1
- package/dist/recipes/chainedRunner.d.ts +41 -2
- package/dist/recipes/chainedRunner.js +134 -6
- package/dist/recipes/chainedRunner.js.map +1 -1
- package/dist/recipes/connectorPreflight.js +30 -0
- package/dist/recipes/connectorPreflight.js.map +1 -1
- package/dist/recipes/haltCategory.d.ts +5 -0
- package/dist/recipes/haltCategory.js +7 -1
- package/dist/recipes/haltCategory.js.map +1 -1
- package/dist/recipes/judgeVerdict.d.ts +10 -0
- package/dist/recipes/judgeVerdict.js +10 -0
- package/dist/recipes/judgeVerdict.js.map +1 -1
- package/dist/recipes/names.d.ts +5 -0
- package/dist/recipes/names.js +10 -5
- package/dist/recipes/names.js.map +1 -1
- package/dist/recipes/parser.js +32 -9
- package/dist/recipes/parser.js.map +1 -1
- package/dist/recipes/pricing/costRouter.d.ts +43 -0
- package/dist/recipes/pricing/costRouter.js +44 -0
- package/dist/recipes/pricing/costRouter.js.map +1 -0
- package/dist/recipes/pricing/priceTable.d.ts +76 -0
- package/dist/recipes/pricing/priceTable.js +144 -0
- package/dist/recipes/pricing/priceTable.js.map +1 -0
- package/dist/recipes/runBudget.d.ts +82 -32
- package/dist/recipes/runBudget.js +182 -49
- package/dist/recipes/runBudget.js.map +1 -1
- package/dist/recipes/schema.d.ts +25 -4
- package/dist/recipes/schemaGenerator.d.ts +9 -0
- package/dist/recipes/schemaGenerator.js +386 -75
- package/dist/recipes/schemaGenerator.js.map +1 -1
- package/dist/recipes/simulation/aggregateRunRisk.d.ts +43 -0
- package/dist/recipes/simulation/aggregateRunRisk.js +117 -0
- package/dist/recipes/simulation/aggregateRunRisk.js.map +1 -0
- package/dist/recipes/simulation/costProjector.d.ts +32 -0
- package/dist/recipes/simulation/costProjector.js +194 -0
- package/dist/recipes/simulation/costProjector.js.map +1 -0
- package/dist/recipes/simulation/sideEffects.d.ts +32 -0
- package/dist/recipes/simulation/sideEffects.js +62 -0
- package/dist/recipes/simulation/sideEffects.js.map +1 -0
- package/dist/recipes/simulation/simulate.d.ts +36 -0
- package/dist/recipes/simulation/simulate.js +264 -0
- package/dist/recipes/simulation/simulate.js.map +1 -0
- package/dist/recipes/simulation/simulateMockedRun.d.ts +52 -0
- package/dist/recipes/simulation/simulateMockedRun.js +72 -0
- package/dist/recipes/simulation/simulateMockedRun.js.map +1 -0
- package/dist/recipes/simulation/synthesizeMockedOutputs.d.ts +31 -0
- package/dist/recipes/simulation/synthesizeMockedOutputs.js +50 -0
- package/dist/recipes/simulation/synthesizeMockedOutputs.js.map +1 -0
- package/dist/recipes/simulation/types.d.ts +198 -0
- package/dist/recipes/simulation/types.js +30 -0
- package/dist/recipes/simulation/types.js.map +1 -0
- package/dist/recipes/stepObservation.d.ts +12 -0
- package/dist/recipes/stepObservation.js +21 -1
- package/dist/recipes/stepObservation.js.map +1 -1
- package/dist/recipes/tools/airtable.d.ts +15 -0
- package/dist/recipes/tools/airtable.js +240 -0
- package/dist/recipes/tools/airtable.js.map +1 -0
- package/dist/recipes/tools/caldiy.d.ts +13 -0
- package/dist/recipes/tools/caldiy.js +214 -0
- package/dist/recipes/tools/caldiy.js.map +1 -0
- package/dist/recipes/tools/circleci.d.ts +10 -0
- package/dist/recipes/tools/circleci.js +204 -0
- package/dist/recipes/tools/circleci.js.map +1 -0
- package/dist/recipes/tools/cloudflare.d.ts +13 -0
- package/dist/recipes/tools/cloudflare.js +211 -0
- package/dist/recipes/tools/cloudflare.js.map +1 -0
- package/dist/recipes/tools/docs.d.ts +18 -0
- package/dist/recipes/tools/docs.js +94 -0
- package/dist/recipes/tools/docs.js.map +1 -0
- package/dist/recipes/tools/elasticsearch.d.ts +11 -0
- package/dist/recipes/tools/elasticsearch.js +156 -0
- package/dist/recipes/tools/elasticsearch.js.map +1 -0
- package/dist/recipes/tools/figma.d.ts +12 -0
- package/dist/recipes/tools/figma.js +194 -0
- package/dist/recipes/tools/figma.js.map +1 -0
- package/dist/recipes/tools/grafana.d.ts +11 -0
- package/dist/recipes/tools/grafana.js +216 -0
- package/dist/recipes/tools/grafana.js.map +1 -0
- package/dist/recipes/tools/http.d.ts +1 -1
- package/dist/recipes/tools/http.js +10 -28
- package/dist/recipes/tools/http.js.map +1 -1
- package/dist/recipes/tools/index.d.ts +26 -0
- package/dist/recipes/tools/index.js +26 -0
- package/dist/recipes/tools/index.js.map +1 -1
- package/dist/recipes/tools/monday.d.ts +22 -0
- package/dist/recipes/tools/monday.js +242 -0
- package/dist/recipes/tools/monday.js.map +1 -0
- package/dist/recipes/tools/obsidian.d.ts +15 -0
- package/dist/recipes/tools/obsidian.js +172 -0
- package/dist/recipes/tools/obsidian.js.map +1 -0
- package/dist/recipes/tools/paystack.d.ts +11 -0
- package/dist/recipes/tools/paystack.js +211 -0
- package/dist/recipes/tools/paystack.js.map +1 -0
- package/dist/recipes/tools/pipedrive.d.ts +16 -0
- package/dist/recipes/tools/pipedrive.js +233 -0
- package/dist/recipes/tools/pipedrive.js.map +1 -0
- package/dist/recipes/tools/postgres.d.ts +15 -0
- package/dist/recipes/tools/postgres.js +185 -0
- package/dist/recipes/tools/postgres.js.map +1 -0
- package/dist/recipes/tools/posthog.d.ts +16 -0
- package/dist/recipes/tools/posthog.js +219 -0
- package/dist/recipes/tools/posthog.js.map +1 -0
- package/dist/recipes/tools/redis.d.ts +9 -0
- package/dist/recipes/tools/redis.js +140 -0
- package/dist/recipes/tools/redis.js.map +1 -0
- package/dist/recipes/tools/resend.d.ts +8 -0
- package/dist/recipes/tools/resend.js +153 -0
- package/dist/recipes/tools/resend.js.map +1 -0
- package/dist/recipes/tools/salesforce.d.ts +16 -0
- package/dist/recipes/tools/salesforce.js +184 -0
- package/dist/recipes/tools/salesforce.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/shopify.d.ts +16 -0
- package/dist/recipes/tools/shopify.js +265 -0
- package/dist/recipes/tools/shopify.js.map +1 -0
- package/dist/recipes/tools/snowflake.d.ts +16 -0
- package/dist/recipes/tools/snowflake.js +173 -0
- package/dist/recipes/tools/snowflake.js.map +1 -0
- package/dist/recipes/tools/stripe.js +13 -12
- package/dist/recipes/tools/stripe.js.map +1 -1
- package/dist/recipes/tools/supabase.d.ts +9 -0
- package/dist/recipes/tools/supabase.js +132 -0
- package/dist/recipes/tools/supabase.js.map +1 -0
- package/dist/recipes/tools/todoist.d.ts +15 -0
- package/dist/recipes/tools/todoist.js +227 -0
- package/dist/recipes/tools/todoist.js.map +1 -0
- package/dist/recipes/tools/twilio.d.ts +11 -0
- package/dist/recipes/tools/twilio.js +180 -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/tools/webflow.d.ts +11 -0
- package/dist/recipes/tools/webflow.js +243 -0
- package/dist/recipes/tools/webflow.js.map +1 -0
- package/dist/recipes/tools/woocommerce.d.ts +18 -0
- package/dist/recipes/tools/woocommerce.js +259 -0
- package/dist/recipes/tools/woocommerce.js.map +1 -0
- package/dist/recipes/tools/wrapConnectorExecute.d.ts +25 -0
- package/dist/recipes/tools/wrapConnectorExecute.js +37 -0
- package/dist/recipes/tools/wrapConnectorExecute.js.map +1 -0
- package/dist/recipes/validation.js +264 -0
- package/dist/recipes/validation.js.map +1 -1
- package/dist/recipes/yamlRunner.d.ts +112 -3
- package/dist/recipes/yamlRunner.js +482 -19
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/runLog.d.ts +46 -0
- package/dist/runLog.js +4 -0
- package/dist/runLog.js.map +1 -1
- package/dist/schemas/recipe.v1.json +217 -11
- package/dist/server.d.ts +3 -0
- package/dist/server.js +4 -0
- package/dist/server.js.map +1 -1
- package/dist/streamableHttp.js +3 -2
- package/dist/streamableHttp.js.map +1 -1
- package/dist/tools/gitWrite.js +5 -1
- package/dist/tools/gitWrite.js.map +1 -1
- package/dist/tools/terminal.js +15 -49
- package/dist/tools/terminal.js.map +1 -1
- package/dist/transport.d.ts +1 -0
- package/dist/transport.js +7 -0
- package/dist/transport.js.map +1 -1
- package/package.json +3 -3
- package/scripts/mcp-stdio-shim.cjs +218 -84
- package/templates/recipes/incident-to-pr.yaml +187 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cal.diy tools — scheduling via the Cal.com-compatible API.
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry. Read tools wrap
|
|
5
|
+
* event types and bookings; the single write tool cancels a booking.
|
|
6
|
+
*
|
|
7
|
+
* Wraps the Cal.diy connector (src/connectors/caldiy.ts):
|
|
8
|
+
* - getEventTypes() → list_event_types (read)
|
|
9
|
+
* - getBookings({status, attendeeEmail,…}) → list_bookings (read)
|
|
10
|
+
* - getBooking(uid) → get_booking (read)
|
|
11
|
+
* - cancelBooking(uid, reason?) → cancel_booking (write)
|
|
12
|
+
*/
|
|
13
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
14
|
+
// ============================================================================
|
|
15
|
+
// caldiy.list_event_types
|
|
16
|
+
// ============================================================================
|
|
17
|
+
registerTool({
|
|
18
|
+
id: "caldiy.list_event_types",
|
|
19
|
+
namespace: "caldiy",
|
|
20
|
+
description: "List the authenticated Cal.diy user's event types (bookable meeting templates).",
|
|
21
|
+
paramsSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
into: CommonSchemas.into,
|
|
25
|
+
},
|
|
26
|
+
required: [],
|
|
27
|
+
},
|
|
28
|
+
outputSchema: {
|
|
29
|
+
type: "array",
|
|
30
|
+
items: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
id: { type: "number" },
|
|
34
|
+
slug: { type: "string" },
|
|
35
|
+
title: { type: "string" },
|
|
36
|
+
description: { type: "string" },
|
|
37
|
+
length: { type: "number" },
|
|
38
|
+
hidden: { type: "boolean" },
|
|
39
|
+
locations: { type: "array" },
|
|
40
|
+
bookingFields: { type: "array" },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
riskDefault: "low",
|
|
45
|
+
isWrite: false,
|
|
46
|
+
isConnector: true,
|
|
47
|
+
execute: async () => {
|
|
48
|
+
const { getCalDiyConnector } = await import("../../connectors/caldiy.js");
|
|
49
|
+
const connector = getCalDiyConnector();
|
|
50
|
+
const result = await connector.getEventTypes();
|
|
51
|
+
return JSON.stringify(result);
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
// ============================================================================
|
|
55
|
+
// caldiy.list_bookings
|
|
56
|
+
// ============================================================================
|
|
57
|
+
registerTool({
|
|
58
|
+
id: "caldiy.list_bookings",
|
|
59
|
+
namespace: "caldiy",
|
|
60
|
+
description: "List Cal.diy bookings, optionally filtered by status, attendee email, or date range.",
|
|
61
|
+
paramsSchema: {
|
|
62
|
+
type: "object",
|
|
63
|
+
properties: {
|
|
64
|
+
status: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "Filter by booking status (e.g. upcoming, past, cancelled, accepted)",
|
|
67
|
+
},
|
|
68
|
+
attendeeEmail: {
|
|
69
|
+
type: "string",
|
|
70
|
+
description: "Filter by attendee email address",
|
|
71
|
+
},
|
|
72
|
+
dateFrom: {
|
|
73
|
+
type: "string",
|
|
74
|
+
description: "Start of date range (ISO 8601)",
|
|
75
|
+
},
|
|
76
|
+
dateTo: {
|
|
77
|
+
type: "string",
|
|
78
|
+
description: "End of date range (ISO 8601)",
|
|
79
|
+
},
|
|
80
|
+
into: CommonSchemas.into,
|
|
81
|
+
},
|
|
82
|
+
required: [],
|
|
83
|
+
},
|
|
84
|
+
outputSchema: {
|
|
85
|
+
type: "array",
|
|
86
|
+
items: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
uid: { type: "string" },
|
|
90
|
+
title: { type: "string" },
|
|
91
|
+
description: { type: "string" },
|
|
92
|
+
start: { type: "string" },
|
|
93
|
+
end: { type: "string" },
|
|
94
|
+
status: { type: "string" },
|
|
95
|
+
attendees: {
|
|
96
|
+
type: "array",
|
|
97
|
+
items: {
|
|
98
|
+
type: "object",
|
|
99
|
+
properties: {
|
|
100
|
+
name: { type: "string" },
|
|
101
|
+
email: { type: "string" },
|
|
102
|
+
timeZone: { type: "string" },
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
eventType: { type: "object" },
|
|
107
|
+
cancelledBy: { type: "string" },
|
|
108
|
+
rescheduledBy: { type: "string" },
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
riskDefault: "low",
|
|
113
|
+
isWrite: false,
|
|
114
|
+
isConnector: true,
|
|
115
|
+
execute: async ({ params }) => {
|
|
116
|
+
const { getCalDiyConnector } = await import("../../connectors/caldiy.js");
|
|
117
|
+
const connector = getCalDiyConnector();
|
|
118
|
+
const result = await connector.getBookings({
|
|
119
|
+
status: typeof params.status === "string" ? params.status : undefined,
|
|
120
|
+
attendeeEmail: typeof params.attendeeEmail === "string"
|
|
121
|
+
? params.attendeeEmail
|
|
122
|
+
: undefined,
|
|
123
|
+
dateFrom: typeof params.dateFrom === "string" ? params.dateFrom : undefined,
|
|
124
|
+
dateTo: typeof params.dateTo === "string" ? params.dateTo : undefined,
|
|
125
|
+
});
|
|
126
|
+
return JSON.stringify(result);
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
// ============================================================================
|
|
130
|
+
// caldiy.get_booking
|
|
131
|
+
// ============================================================================
|
|
132
|
+
registerTool({
|
|
133
|
+
id: "caldiy.get_booking",
|
|
134
|
+
namespace: "caldiy",
|
|
135
|
+
description: "Fetch a single Cal.diy booking by its UID.",
|
|
136
|
+
paramsSchema: {
|
|
137
|
+
type: "object",
|
|
138
|
+
properties: {
|
|
139
|
+
uid: { type: "string", description: "Cal.diy booking UID" },
|
|
140
|
+
into: CommonSchemas.into,
|
|
141
|
+
},
|
|
142
|
+
required: ["uid"],
|
|
143
|
+
},
|
|
144
|
+
outputSchema: {
|
|
145
|
+
type: "object",
|
|
146
|
+
properties: {
|
|
147
|
+
uid: { type: "string" },
|
|
148
|
+
title: { type: "string" },
|
|
149
|
+
description: { type: "string" },
|
|
150
|
+
start: { type: "string" },
|
|
151
|
+
end: { type: "string" },
|
|
152
|
+
status: { type: "string" },
|
|
153
|
+
attendees: {
|
|
154
|
+
type: "array",
|
|
155
|
+
items: {
|
|
156
|
+
type: "object",
|
|
157
|
+
properties: {
|
|
158
|
+
name: { type: "string" },
|
|
159
|
+
email: { type: "string" },
|
|
160
|
+
timeZone: { type: "string" },
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
eventType: { type: "object" },
|
|
165
|
+
cancelledBy: { type: "string" },
|
|
166
|
+
rescheduledBy: { type: "string" },
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
riskDefault: "low",
|
|
170
|
+
isWrite: false,
|
|
171
|
+
isConnector: true,
|
|
172
|
+
execute: async ({ params }) => {
|
|
173
|
+
const { getCalDiyConnector } = await import("../../connectors/caldiy.js");
|
|
174
|
+
const connector = getCalDiyConnector();
|
|
175
|
+
const result = await connector.getBooking(params.uid);
|
|
176
|
+
return JSON.stringify(result);
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
// ============================================================================
|
|
180
|
+
// caldiy.cancel_booking (write-gated)
|
|
181
|
+
// ============================================================================
|
|
182
|
+
registerTool({
|
|
183
|
+
id: "caldiy.cancel_booking",
|
|
184
|
+
namespace: "caldiy",
|
|
185
|
+
description: "Cancel a Cal.diy booking by UID, with an optional reason.",
|
|
186
|
+
paramsSchema: {
|
|
187
|
+
type: "object",
|
|
188
|
+
properties: {
|
|
189
|
+
uid: { type: "string", description: "Cal.diy booking UID (required)" },
|
|
190
|
+
reason: {
|
|
191
|
+
type: "string",
|
|
192
|
+
description: "Optional cancellation reason shown to attendees",
|
|
193
|
+
},
|
|
194
|
+
into: CommonSchemas.into,
|
|
195
|
+
},
|
|
196
|
+
required: ["uid"],
|
|
197
|
+
},
|
|
198
|
+
outputSchema: {
|
|
199
|
+
type: "object",
|
|
200
|
+
properties: {
|
|
201
|
+
uid: { type: "string" },
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
riskDefault: "medium",
|
|
205
|
+
isWrite: true,
|
|
206
|
+
isConnector: true,
|
|
207
|
+
execute: async ({ params }) => {
|
|
208
|
+
const { getCalDiyConnector } = await import("../../connectors/caldiy.js");
|
|
209
|
+
const connector = getCalDiyConnector();
|
|
210
|
+
const result = await connector.cancelBooking(params.uid, typeof params.reason === "string" ? params.reason : undefined);
|
|
211
|
+
return JSON.stringify(result);
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
//# sourceMappingURL=caldiy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caldiy.js","sourceRoot":"","sources":["../../../src/recipes/tools/caldiy.ts"],"names":[],"mappings":"AAAA;;;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IAChC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CircleCI recipe-step tools — read wrappers (list_pipelines, get_workflow,
|
|
3
|
+
* get_job) plus a write (trigger_pipeline).
|
|
4
|
+
*
|
|
5
|
+
* Self-registering tool module for the recipe tool registry. Wraps the
|
|
6
|
+
* CircleCI v2 connector methods 1:1 and JSON-stringifies the raw connector
|
|
7
|
+
* return type back out. Read tools declare `isWrite: false`; trigger_pipeline
|
|
8
|
+
* declares `isWrite: true` so the approval queue gates it appropriately.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CircleCI recipe-step tools — read wrappers (list_pipelines, get_workflow,
|
|
3
|
+
* get_job) plus a write (trigger_pipeline).
|
|
4
|
+
*
|
|
5
|
+
* Self-registering tool module for the recipe tool registry. Wraps the
|
|
6
|
+
* CircleCI v2 connector methods 1:1 and JSON-stringifies the raw connector
|
|
7
|
+
* return type back out. Read tools declare `isWrite: false`; trigger_pipeline
|
|
8
|
+
* declares `isWrite: true` so the approval queue gates it appropriately.
|
|
9
|
+
*/
|
|
10
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
11
|
+
import { wrapConnectorExecute } from "./wrapConnectorExecute.js";
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// circleci.list_pipelines
|
|
14
|
+
// ============================================================================
|
|
15
|
+
registerTool({
|
|
16
|
+
id: "circleci.list_pipelines",
|
|
17
|
+
namespace: "circleci",
|
|
18
|
+
description: "List recent CircleCI pipelines for a project, optionally filtered by branch.",
|
|
19
|
+
paramsSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {
|
|
22
|
+
projectSlug: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "CircleCI project slug, e.g. gh/owner/repo (github/ and bitbucket/ prefixes accepted)",
|
|
25
|
+
},
|
|
26
|
+
branch: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Filter pipelines by VCS branch name",
|
|
29
|
+
},
|
|
30
|
+
into: CommonSchemas.into,
|
|
31
|
+
},
|
|
32
|
+
required: ["projectSlug"],
|
|
33
|
+
},
|
|
34
|
+
outputSchema: {
|
|
35
|
+
type: "array",
|
|
36
|
+
items: {
|
|
37
|
+
type: "object",
|
|
38
|
+
properties: {
|
|
39
|
+
id: { type: "string" },
|
|
40
|
+
project_slug: { type: "string" },
|
|
41
|
+
state: { type: "string" },
|
|
42
|
+
number: { type: "number" },
|
|
43
|
+
trigger: { type: "object" },
|
|
44
|
+
vcs: { type: "object" },
|
|
45
|
+
created_at: { type: "string" },
|
|
46
|
+
updated_at: { type: "string" },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
riskDefault: "low",
|
|
51
|
+
isWrite: false,
|
|
52
|
+
isConnector: true,
|
|
53
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
54
|
+
const { getCircleCIConnector } = await import("../../connectors/circleci.js");
|
|
55
|
+
const connector = getCircleCIConnector();
|
|
56
|
+
const result = await connector.getPipelines(params.projectSlug, typeof params.branch === "string" ? params.branch : undefined);
|
|
57
|
+
return JSON.stringify(result);
|
|
58
|
+
}),
|
|
59
|
+
});
|
|
60
|
+
// ============================================================================
|
|
61
|
+
// circleci.trigger_pipeline (write-gated)
|
|
62
|
+
// ============================================================================
|
|
63
|
+
registerTool({
|
|
64
|
+
id: "circleci.trigger_pipeline",
|
|
65
|
+
namespace: "circleci",
|
|
66
|
+
description: "Trigger a new CircleCI pipeline for a project, optionally on a branch or tag with custom pipeline parameters.",
|
|
67
|
+
paramsSchema: {
|
|
68
|
+
type: "object",
|
|
69
|
+
properties: {
|
|
70
|
+
projectSlug: {
|
|
71
|
+
type: "string",
|
|
72
|
+
description: "CircleCI project slug, e.g. gh/owner/repo (github/ and bitbucket/ prefixes accepted)",
|
|
73
|
+
},
|
|
74
|
+
branch: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "VCS branch to run the pipeline against",
|
|
77
|
+
},
|
|
78
|
+
tag: {
|
|
79
|
+
type: "string",
|
|
80
|
+
description: "VCS tag to run the pipeline against (mutually exclusive with branch)",
|
|
81
|
+
},
|
|
82
|
+
parameters: {
|
|
83
|
+
type: "object",
|
|
84
|
+
description: "Pipeline parameters map (string/boolean/number values) passed to the pipeline",
|
|
85
|
+
},
|
|
86
|
+
into: CommonSchemas.into,
|
|
87
|
+
},
|
|
88
|
+
required: ["projectSlug"],
|
|
89
|
+
},
|
|
90
|
+
outputSchema: {
|
|
91
|
+
type: "object",
|
|
92
|
+
properties: {
|
|
93
|
+
id: { type: "string" },
|
|
94
|
+
state: { type: "string" },
|
|
95
|
+
number: { type: "number" },
|
|
96
|
+
created_at: { type: "string" },
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
riskDefault: "medium",
|
|
100
|
+
isWrite: true,
|
|
101
|
+
isConnector: true,
|
|
102
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
103
|
+
const { getCircleCIConnector } = await import("../../connectors/circleci.js");
|
|
104
|
+
const connector = getCircleCIConnector();
|
|
105
|
+
const result = await connector.triggerPipeline(params.projectSlug, {
|
|
106
|
+
branch: typeof params.branch === "string" ? params.branch : undefined,
|
|
107
|
+
tag: typeof params.tag === "string" ? params.tag : undefined,
|
|
108
|
+
parameters: params.parameters && typeof params.parameters === "object"
|
|
109
|
+
? params.parameters
|
|
110
|
+
: undefined,
|
|
111
|
+
});
|
|
112
|
+
return JSON.stringify(result);
|
|
113
|
+
}),
|
|
114
|
+
});
|
|
115
|
+
// ============================================================================
|
|
116
|
+
// circleci.get_workflow
|
|
117
|
+
// ============================================================================
|
|
118
|
+
registerTool({
|
|
119
|
+
id: "circleci.get_workflow",
|
|
120
|
+
namespace: "circleci",
|
|
121
|
+
description: "Fetch a single CircleCI workflow by its workflow ID.",
|
|
122
|
+
paramsSchema: {
|
|
123
|
+
type: "object",
|
|
124
|
+
properties: {
|
|
125
|
+
id: {
|
|
126
|
+
type: "string",
|
|
127
|
+
description: "CircleCI workflow ID (UUID)",
|
|
128
|
+
},
|
|
129
|
+
into: CommonSchemas.into,
|
|
130
|
+
},
|
|
131
|
+
required: ["id"],
|
|
132
|
+
},
|
|
133
|
+
outputSchema: {
|
|
134
|
+
type: "object",
|
|
135
|
+
properties: {
|
|
136
|
+
id: { type: "string" },
|
|
137
|
+
name: { type: "string" },
|
|
138
|
+
status: { type: "string" },
|
|
139
|
+
pipeline_id: { type: "string" },
|
|
140
|
+
pipeline_number: { type: "number" },
|
|
141
|
+
project_slug: { type: "string" },
|
|
142
|
+
started_by: { type: "string" },
|
|
143
|
+
created_at: { type: "string" },
|
|
144
|
+
stopped_at: { type: ["string", "null"] },
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
riskDefault: "low",
|
|
148
|
+
isWrite: false,
|
|
149
|
+
isConnector: true,
|
|
150
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
151
|
+
const { getCircleCIConnector } = await import("../../connectors/circleci.js");
|
|
152
|
+
const connector = getCircleCIConnector();
|
|
153
|
+
const result = await connector.getWorkflow(params.id);
|
|
154
|
+
return JSON.stringify(result);
|
|
155
|
+
}),
|
|
156
|
+
});
|
|
157
|
+
// ============================================================================
|
|
158
|
+
// circleci.get_job
|
|
159
|
+
// ============================================================================
|
|
160
|
+
registerTool({
|
|
161
|
+
id: "circleci.get_job",
|
|
162
|
+
namespace: "circleci",
|
|
163
|
+
description: "Fetch a single CircleCI job by project slug and job number.",
|
|
164
|
+
paramsSchema: {
|
|
165
|
+
type: "object",
|
|
166
|
+
properties: {
|
|
167
|
+
projectSlug: {
|
|
168
|
+
type: "string",
|
|
169
|
+
description: "CircleCI project slug, e.g. gh/owner/repo (github/ and bitbucket/ prefixes accepted)",
|
|
170
|
+
},
|
|
171
|
+
jobNumber: {
|
|
172
|
+
type: "number",
|
|
173
|
+
description: "The job number within the project",
|
|
174
|
+
},
|
|
175
|
+
into: CommonSchemas.into,
|
|
176
|
+
},
|
|
177
|
+
required: ["projectSlug", "jobNumber"],
|
|
178
|
+
},
|
|
179
|
+
outputSchema: {
|
|
180
|
+
type: "object",
|
|
181
|
+
properties: {
|
|
182
|
+
id: { type: "string" },
|
|
183
|
+
name: { type: "string" },
|
|
184
|
+
status: { type: "string" },
|
|
185
|
+
job_number: { type: "number" },
|
|
186
|
+
type: { type: "string" },
|
|
187
|
+
created_at: { type: "string" },
|
|
188
|
+
started_at: { type: ["string", "null"] },
|
|
189
|
+
stopped_at: { type: ["string", "null"] },
|
|
190
|
+
approval_request_id: { type: "string" },
|
|
191
|
+
dependencies: { type: "array", items: { type: "string" } },
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
riskDefault: "low",
|
|
195
|
+
isWrite: false,
|
|
196
|
+
isConnector: true,
|
|
197
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
198
|
+
const { getCircleCIConnector } = await import("../../connectors/circleci.js");
|
|
199
|
+
const connector = getCircleCIConnector();
|
|
200
|
+
const result = await connector.getJob(params.projectSlug, params.jobNumber);
|
|
201
|
+
return JSON.stringify(result);
|
|
202
|
+
}),
|
|
203
|
+
});
|
|
204
|
+
//# sourceMappingURL=circleci.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circleci.js","sourceRoot":"","sources":["../../../src/recipes/tools/circleci.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,+EAA+E;AAC/E,0BAA0B;AAC1B,+EAA+E;AAE/E,YAAY,CAAC;IACX,EAAE,EAAE,yBAAyB;IAC7B,SAAS,EAAE,UAAU;IACrB,WAAW,EACT,8EAA8E;IAChF,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YAC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EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC1B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC9B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;YACxC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;YACxC,mBAAmB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACvC,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;SAC3D;KACF;IACD,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,oBAAoB,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACjD,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,MAAM,CAC3C,8BAA8B,CAC/B,CAAC;QACF,MAAM,SAAS,GAAG,oBAAoB,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,MAAM,CACnC,MAAM,CAAC,WAAqB,EAC5B,MAAM,CAAC,SAAmB,CAC3B,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloudflare tools — read wrappers (list_zones, list_dns_records,
|
|
3
|
+
* get_zone_analytics) plus a single write (create_dns_record).
|
|
4
|
+
*
|
|
5
|
+
* Self-registering tool module for the recipe tool registry. Each tool mirrors
|
|
6
|
+
* the real connector signature in `src/connectors/cloudflare.ts` and returns
|
|
7
|
+
* `JSON.stringify(result)` of the connector's native return type.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately excludes destructive operations: no delete_dns_record,
|
|
10
|
+
* update_dns_record, or purge_cache. Only create_dns_record is write-gated
|
|
11
|
+
* (`isWrite: true`); the rest declare `isWrite: false`.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloudflare tools — read wrappers (list_zones, list_dns_records,
|
|
3
|
+
* get_zone_analytics) plus a single write (create_dns_record).
|
|
4
|
+
*
|
|
5
|
+
* Self-registering tool module for the recipe tool registry. Each tool mirrors
|
|
6
|
+
* the real connector signature in `src/connectors/cloudflare.ts` and returns
|
|
7
|
+
* `JSON.stringify(result)` of the connector's native return type.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately excludes destructive operations: no delete_dns_record,
|
|
10
|
+
* update_dns_record, or purge_cache. Only create_dns_record is write-gated
|
|
11
|
+
* (`isWrite: true`); the rest declare `isWrite: false`.
|
|
12
|
+
*/
|
|
13
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
14
|
+
import { wrapConnectorExecute } from "./wrapConnectorExecute.js";
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// cloudflare.list_zones
|
|
17
|
+
// ============================================================================
|
|
18
|
+
registerTool({
|
|
19
|
+
id: "cloudflare.list_zones",
|
|
20
|
+
namespace: "cloudflare",
|
|
21
|
+
description: "List Cloudflare zones, optionally filtered by exact zone name (domain).",
|
|
22
|
+
paramsSchema: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
name: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "Filter by exact zone name (e.g. example.com)",
|
|
28
|
+
},
|
|
29
|
+
into: CommonSchemas.into,
|
|
30
|
+
},
|
|
31
|
+
required: [],
|
|
32
|
+
},
|
|
33
|
+
outputSchema: {
|
|
34
|
+
type: "array",
|
|
35
|
+
items: {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
id: { type: "string" },
|
|
39
|
+
name: { type: "string" },
|
|
40
|
+
status: { type: "string" },
|
|
41
|
+
nameservers: { type: "array", items: { type: "string" } },
|
|
42
|
+
plan: { type: "object", properties: { name: { type: "string" } } },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
riskDefault: "low",
|
|
47
|
+
isWrite: false,
|
|
48
|
+
isConnector: true,
|
|
49
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
50
|
+
const { getCloudflareConnector } = await import("../../connectors/cloudflare.js");
|
|
51
|
+
const connector = getCloudflareConnector();
|
|
52
|
+
const result = await connector.listZones(typeof params.name === "string" ? params.name : undefined);
|
|
53
|
+
return JSON.stringify(result);
|
|
54
|
+
}),
|
|
55
|
+
});
|
|
56
|
+
// ============================================================================
|
|
57
|
+
// cloudflare.list_dns_records
|
|
58
|
+
// ============================================================================
|
|
59
|
+
registerTool({
|
|
60
|
+
id: "cloudflare.list_dns_records",
|
|
61
|
+
namespace: "cloudflare",
|
|
62
|
+
description: "List DNS records in a Cloudflare zone, optionally filtered by record type and name.",
|
|
63
|
+
paramsSchema: {
|
|
64
|
+
type: "object",
|
|
65
|
+
properties: {
|
|
66
|
+
zoneId: {
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "Cloudflare zone ID",
|
|
69
|
+
},
|
|
70
|
+
type: {
|
|
71
|
+
type: "string",
|
|
72
|
+
description: "Filter by DNS record type (e.g. A, AAAA, CNAME, TXT, MX)",
|
|
73
|
+
},
|
|
74
|
+
name: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "Filter by record name (e.g. www.example.com)",
|
|
77
|
+
},
|
|
78
|
+
into: CommonSchemas.into,
|
|
79
|
+
},
|
|
80
|
+
required: ["zoneId"],
|
|
81
|
+
},
|
|
82
|
+
outputSchema: {
|
|
83
|
+
type: "array",
|
|
84
|
+
items: {
|
|
85
|
+
type: "object",
|
|
86
|
+
properties: {
|
|
87
|
+
id: { type: "string" },
|
|
88
|
+
type: { type: "string" },
|
|
89
|
+
name: { type: "string" },
|
|
90
|
+
content: { type: "string" },
|
|
91
|
+
ttl: { type: "number" },
|
|
92
|
+
proxied: { type: "boolean" },
|
|
93
|
+
proxiable: { type: "boolean" },
|
|
94
|
+
created_on: { type: "string" },
|
|
95
|
+
modified_on: { type: "string" },
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
riskDefault: "low",
|
|
100
|
+
isWrite: false,
|
|
101
|
+
isConnector: true,
|
|
102
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
103
|
+
const { getCloudflareConnector } = await import("../../connectors/cloudflare.js");
|
|
104
|
+
const connector = getCloudflareConnector();
|
|
105
|
+
const result = await connector.listDnsRecords(params.zoneId, typeof params.type === "string" ? params.type : undefined, typeof params.name === "string" ? params.name : undefined);
|
|
106
|
+
return JSON.stringify(result);
|
|
107
|
+
}),
|
|
108
|
+
});
|
|
109
|
+
// ============================================================================
|
|
110
|
+
// cloudflare.create_dns_record (write-gated)
|
|
111
|
+
// ============================================================================
|
|
112
|
+
registerTool({
|
|
113
|
+
id: "cloudflare.create_dns_record",
|
|
114
|
+
namespace: "cloudflare",
|
|
115
|
+
description: "Create a DNS record in a Cloudflare zone. Requires zoneId, type, name, and content.",
|
|
116
|
+
paramsSchema: {
|
|
117
|
+
type: "object",
|
|
118
|
+
properties: {
|
|
119
|
+
zoneId: {
|
|
120
|
+
type: "string",
|
|
121
|
+
description: "Cloudflare zone ID",
|
|
122
|
+
},
|
|
123
|
+
type: {
|
|
124
|
+
type: "string",
|
|
125
|
+
description: "DNS record type (e.g. A, AAAA, CNAME, TXT, MX)",
|
|
126
|
+
},
|
|
127
|
+
name: {
|
|
128
|
+
type: "string",
|
|
129
|
+
description: "Record name (e.g. www.example.com)",
|
|
130
|
+
},
|
|
131
|
+
content: {
|
|
132
|
+
type: "string",
|
|
133
|
+
description: "Record content (e.g. 192.0.2.1 for an A record)",
|
|
134
|
+
},
|
|
135
|
+
ttl: {
|
|
136
|
+
type: "number",
|
|
137
|
+
description: "Time-to-live in seconds (1 = automatic)",
|
|
138
|
+
},
|
|
139
|
+
proxied: {
|
|
140
|
+
type: "boolean",
|
|
141
|
+
description: "Whether the record is proxied through Cloudflare",
|
|
142
|
+
},
|
|
143
|
+
into: CommonSchemas.into,
|
|
144
|
+
},
|
|
145
|
+
required: ["zoneId", "type", "name", "content"],
|
|
146
|
+
},
|
|
147
|
+
outputSchema: {
|
|
148
|
+
type: "object",
|
|
149
|
+
properties: {
|
|
150
|
+
id: { type: "string" },
|
|
151
|
+
type: { type: "string" },
|
|
152
|
+
name: { type: "string" },
|
|
153
|
+
content: { type: "string" },
|
|
154
|
+
ttl: { type: "number" },
|
|
155
|
+
proxied: { type: "boolean" },
|
|
156
|
+
proxiable: { type: "boolean" },
|
|
157
|
+
created_on: { type: "string" },
|
|
158
|
+
modified_on: { type: "string" },
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
riskDefault: "medium",
|
|
162
|
+
isWrite: true,
|
|
163
|
+
isConnector: true,
|
|
164
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
165
|
+
const { getCloudflareConnector } = await import("../../connectors/cloudflare.js");
|
|
166
|
+
const connector = getCloudflareConnector();
|
|
167
|
+
const result = await connector.createDnsRecord(params.zoneId, params.type, params.name, params.content, typeof params.ttl === "number" ? params.ttl : undefined, typeof params.proxied === "boolean" ? params.proxied : undefined);
|
|
168
|
+
return JSON.stringify(result);
|
|
169
|
+
}),
|
|
170
|
+
});
|
|
171
|
+
// ============================================================================
|
|
172
|
+
// cloudflare.get_zone_analytics
|
|
173
|
+
// ============================================================================
|
|
174
|
+
registerTool({
|
|
175
|
+
id: "cloudflare.get_zone_analytics",
|
|
176
|
+
namespace: "cloudflare",
|
|
177
|
+
description: "Fetch dashboard analytics for a Cloudflare zone over an optional time window.",
|
|
178
|
+
paramsSchema: {
|
|
179
|
+
type: "object",
|
|
180
|
+
properties: {
|
|
181
|
+
zoneId: {
|
|
182
|
+
type: "string",
|
|
183
|
+
description: "Cloudflare zone ID",
|
|
184
|
+
},
|
|
185
|
+
since: {
|
|
186
|
+
type: "string",
|
|
187
|
+
description: "Start of the window (RFC3339 timestamp or relative, e.g. -10080 minutes)",
|
|
188
|
+
},
|
|
189
|
+
until: {
|
|
190
|
+
type: "string",
|
|
191
|
+
description: "End of the window (RFC3339 timestamp or relative)",
|
|
192
|
+
},
|
|
193
|
+
into: CommonSchemas.into,
|
|
194
|
+
},
|
|
195
|
+
required: ["zoneId"],
|
|
196
|
+
},
|
|
197
|
+
outputSchema: {
|
|
198
|
+
type: "object",
|
|
199
|
+
description: "Cloudflare zone analytics dashboard payload (free-form).",
|
|
200
|
+
},
|
|
201
|
+
riskDefault: "low",
|
|
202
|
+
isWrite: false,
|
|
203
|
+
isConnector: true,
|
|
204
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
205
|
+
const { getCloudflareConnector } = await import("../../connectors/cloudflare.js");
|
|
206
|
+
const connector = getCloudflareConnector();
|
|
207
|
+
const result = await connector.getZoneAnalytics(params.zoneId, typeof params.since === "string" ? params.since : undefined, typeof params.until === "string" ? params.until : undefined);
|
|
208
|
+
return JSON.stringify(result);
|
|
209
|
+
}),
|
|
210
|
+
});
|
|
211
|
+
//# sourceMappingURL=cloudflare.js.map
|