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,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostHog tools — capture product-analytics events (write) plus read wrappers
|
|
3
|
+
* for insights, HogQL queries, and raw events.
|
|
4
|
+
*
|
|
5
|
+
* Self-registering tool module for the recipe tool registry. Mirrors the
|
|
6
|
+
* connector method signatures in src/connectors/posthog.ts:
|
|
7
|
+
* - captureEvent(distinctId, event, properties?, timestamp?)
|
|
8
|
+
* - getInsights(projectId, limit?)
|
|
9
|
+
* - queryInsight(projectId, query)
|
|
10
|
+
* - getEvents(projectId, params)
|
|
11
|
+
*
|
|
12
|
+
* `capture_event` is the only mutating tool — it POSTs to /capture/ and so
|
|
13
|
+
* declares isWrite: true so the approval queue / kill-switch gate it. The
|
|
14
|
+
* remaining tools are read-only.
|
|
15
|
+
*/
|
|
16
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
17
|
+
import { wrapConnectorExecute } from "./wrapConnectorExecute.js";
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// posthog.capture_event (write-gated)
|
|
20
|
+
// ============================================================================
|
|
21
|
+
registerTool({
|
|
22
|
+
id: "posthog.capture_event",
|
|
23
|
+
namespace: "posthog",
|
|
24
|
+
description: "Capture a PostHog product-analytics event for a distinct id. Requires a project API key on the connection.",
|
|
25
|
+
paramsSchema: {
|
|
26
|
+
type: "object",
|
|
27
|
+
properties: {
|
|
28
|
+
distinctId: {
|
|
29
|
+
type: "string",
|
|
30
|
+
description: "Distinct id of the person the event is attributed to",
|
|
31
|
+
},
|
|
32
|
+
event: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "Event name (e.g. 'signed_up', '$pageview')",
|
|
35
|
+
},
|
|
36
|
+
properties: {
|
|
37
|
+
type: "object",
|
|
38
|
+
description: "Optional event property bag",
|
|
39
|
+
additionalProperties: true,
|
|
40
|
+
},
|
|
41
|
+
timestamp: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "Optional ISO 8601 timestamp for the event",
|
|
44
|
+
},
|
|
45
|
+
into: CommonSchemas.into,
|
|
46
|
+
},
|
|
47
|
+
required: ["distinctId", "event"],
|
|
48
|
+
},
|
|
49
|
+
outputSchema: {
|
|
50
|
+
type: "object",
|
|
51
|
+
properties: {
|
|
52
|
+
status: { type: "string" },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
riskDefault: "medium",
|
|
56
|
+
isWrite: true,
|
|
57
|
+
isConnector: true,
|
|
58
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
59
|
+
const { getPostHogConnector } = await import("../../connectors/posthog.js");
|
|
60
|
+
const connector = getPostHogConnector();
|
|
61
|
+
const result = await connector.captureEvent(params.distinctId, params.event, typeof params.properties === "object" && params.properties !== null
|
|
62
|
+
? params.properties
|
|
63
|
+
: undefined, typeof params.timestamp === "string" ? params.timestamp : undefined);
|
|
64
|
+
return JSON.stringify(result);
|
|
65
|
+
}),
|
|
66
|
+
});
|
|
67
|
+
// ============================================================================
|
|
68
|
+
// posthog.list_insights
|
|
69
|
+
// ============================================================================
|
|
70
|
+
registerTool({
|
|
71
|
+
id: "posthog.list_insights",
|
|
72
|
+
namespace: "posthog",
|
|
73
|
+
description: "List PostHog insights for a project, optionally limited.",
|
|
74
|
+
paramsSchema: {
|
|
75
|
+
type: "object",
|
|
76
|
+
properties: {
|
|
77
|
+
projectId: {
|
|
78
|
+
type: ["string", "number"],
|
|
79
|
+
description: "PostHog project id",
|
|
80
|
+
},
|
|
81
|
+
limit: {
|
|
82
|
+
type: "number",
|
|
83
|
+
description: "Max number of insights to return",
|
|
84
|
+
},
|
|
85
|
+
into: CommonSchemas.into,
|
|
86
|
+
},
|
|
87
|
+
required: ["projectId"],
|
|
88
|
+
},
|
|
89
|
+
outputSchema: {
|
|
90
|
+
type: "array",
|
|
91
|
+
items: {
|
|
92
|
+
type: "object",
|
|
93
|
+
properties: {
|
|
94
|
+
id: { type: ["string", "number"] },
|
|
95
|
+
name: { type: "string" },
|
|
96
|
+
description: { type: "string" },
|
|
97
|
+
filters: { type: "object" },
|
|
98
|
+
result: {},
|
|
99
|
+
last_modified_at: { type: "string" },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
riskDefault: "low",
|
|
104
|
+
isWrite: false,
|
|
105
|
+
isConnector: true,
|
|
106
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
107
|
+
const { getPostHogConnector } = await import("../../connectors/posthog.js");
|
|
108
|
+
const connector = getPostHogConnector();
|
|
109
|
+
const result = await connector.getInsights(params.projectId, typeof params.limit === "number" ? params.limit : undefined);
|
|
110
|
+
return JSON.stringify(result);
|
|
111
|
+
}),
|
|
112
|
+
});
|
|
113
|
+
// ============================================================================
|
|
114
|
+
// posthog.query_insight
|
|
115
|
+
// ============================================================================
|
|
116
|
+
registerTool({
|
|
117
|
+
id: "posthog.query_insight",
|
|
118
|
+
namespace: "posthog",
|
|
119
|
+
description: "Run a HogQL / structured query against a PostHog project and return the raw query result.",
|
|
120
|
+
paramsSchema: {
|
|
121
|
+
type: "object",
|
|
122
|
+
properties: {
|
|
123
|
+
projectId: {
|
|
124
|
+
type: ["string", "number"],
|
|
125
|
+
description: "PostHog project id",
|
|
126
|
+
},
|
|
127
|
+
query: {
|
|
128
|
+
type: "object",
|
|
129
|
+
description: "PostHog query object (e.g. { kind: 'HogQLQuery', query: 'SELECT ...' })",
|
|
130
|
+
additionalProperties: true,
|
|
131
|
+
},
|
|
132
|
+
into: CommonSchemas.into,
|
|
133
|
+
},
|
|
134
|
+
required: ["projectId", "query"],
|
|
135
|
+
},
|
|
136
|
+
outputSchema: {
|
|
137
|
+
type: "object",
|
|
138
|
+
description: "Raw PostHog query response (shape varies by query kind)",
|
|
139
|
+
additionalProperties: true,
|
|
140
|
+
},
|
|
141
|
+
riskDefault: "low",
|
|
142
|
+
isWrite: false,
|
|
143
|
+
isConnector: true,
|
|
144
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
145
|
+
const { getPostHogConnector } = await import("../../connectors/posthog.js");
|
|
146
|
+
const connector = getPostHogConnector();
|
|
147
|
+
const result = await connector.queryInsight(params.projectId, params.query);
|
|
148
|
+
return JSON.stringify(result);
|
|
149
|
+
}),
|
|
150
|
+
});
|
|
151
|
+
// ============================================================================
|
|
152
|
+
// posthog.list_events
|
|
153
|
+
// ============================================================================
|
|
154
|
+
registerTool({
|
|
155
|
+
id: "posthog.list_events",
|
|
156
|
+
namespace: "posthog",
|
|
157
|
+
description: "List raw PostHog events for a project, optionally filtered by event name, person, and time window.",
|
|
158
|
+
paramsSchema: {
|
|
159
|
+
type: "object",
|
|
160
|
+
properties: {
|
|
161
|
+
projectId: {
|
|
162
|
+
type: ["string", "number"],
|
|
163
|
+
description: "PostHog project id",
|
|
164
|
+
},
|
|
165
|
+
event: {
|
|
166
|
+
type: "string",
|
|
167
|
+
description: "Filter by event name",
|
|
168
|
+
},
|
|
169
|
+
personId: {
|
|
170
|
+
type: "string",
|
|
171
|
+
description: "Filter by person id",
|
|
172
|
+
},
|
|
173
|
+
after: {
|
|
174
|
+
type: "string",
|
|
175
|
+
description: "ISO 8601 timestamp — only events after this time",
|
|
176
|
+
},
|
|
177
|
+
before: {
|
|
178
|
+
type: "string",
|
|
179
|
+
description: "ISO 8601 timestamp — only events before this time",
|
|
180
|
+
},
|
|
181
|
+
limit: {
|
|
182
|
+
type: "number",
|
|
183
|
+
description: "Max number of events to return",
|
|
184
|
+
},
|
|
185
|
+
into: CommonSchemas.into,
|
|
186
|
+
},
|
|
187
|
+
required: ["projectId"],
|
|
188
|
+
},
|
|
189
|
+
outputSchema: {
|
|
190
|
+
type: "array",
|
|
191
|
+
items: {
|
|
192
|
+
type: "object",
|
|
193
|
+
properties: {
|
|
194
|
+
id: { type: "string" },
|
|
195
|
+
distinct_id: { type: "string" },
|
|
196
|
+
event: { type: "string" },
|
|
197
|
+
properties: { type: "object" },
|
|
198
|
+
timestamp: { type: "string" },
|
|
199
|
+
person: { type: "object" },
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
riskDefault: "low",
|
|
204
|
+
isWrite: false,
|
|
205
|
+
isConnector: true,
|
|
206
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
207
|
+
const { getPostHogConnector } = await import("../../connectors/posthog.js");
|
|
208
|
+
const connector = getPostHogConnector();
|
|
209
|
+
const result = await connector.getEvents(params.projectId, {
|
|
210
|
+
event: typeof params.event === "string" ? params.event : undefined,
|
|
211
|
+
personId: typeof params.personId === "string" ? params.personId : undefined,
|
|
212
|
+
after: typeof params.after === "string" ? params.after : undefined,
|
|
213
|
+
before: typeof params.before === "string" ? params.before : undefined,
|
|
214
|
+
limit: typeof params.limit === "number" ? params.limit : undefined,
|
|
215
|
+
});
|
|
216
|
+
return JSON.stringify(result);
|
|
217
|
+
}),
|
|
218
|
+
});
|
|
219
|
+
//# sourceMappingURL=posthog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posthog.js","sourceRoot":"","sources":["../../../src/recipes/tools/posthog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,+EAA+E;AAC/E,uCAAuC;AACvC,+EAA+E;AAE/E,YAAY,CAAC;IACX,EAAE,EAAE,uBAAuB;IAC3B,SAAS,EAAE,SAAS;IACpB,WAAW,EACT,4GAA4G;IAC9G,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sDAAsD;aACpE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4CAA4C;aAC1D;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6BAA6B;gBAC1C,oBAAoB,EAAE,IAAI;aAC3B;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2CAA2C;aACzD;YACD,IAAI,EAAE,aAAa,CAAC,IAAI;SACzB;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC;KAClC;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC3B;KACF;IACD,WAAW,EAAE,QAAQ;IACrB,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,oBAAoB,CAAC,KAAK,EAAE,EAAE,MAAM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CAAC,CAAC,CAAC,SAAS;YAClE,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YACrE,KAAK,EAAE,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;SACnE,CACF,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redis tools — read-only access to keys, hashes, and server info.
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry. Every tool here
|
|
5
|
+
* wraps a read command on the Redis connector (which is itself read-only — it
|
|
6
|
+
* exposes no SET/DEL/FLUSHDB/CONFIG mutators). Tools declare `isWrite: false`
|
|
7
|
+
* so the approval queue treats them as low-risk reads.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redis tools — read-only access to keys, hashes, and server info.
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry. Every tool here
|
|
5
|
+
* wraps a read command on the Redis connector (which is itself read-only — it
|
|
6
|
+
* exposes no SET/DEL/FLUSHDB/CONFIG mutators). Tools declare `isWrite: false`
|
|
7
|
+
* so the approval queue treats them as low-risk reads.
|
|
8
|
+
*/
|
|
9
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// redis.get
|
|
12
|
+
// ============================================================================
|
|
13
|
+
registerTool({
|
|
14
|
+
id: "redis.get",
|
|
15
|
+
namespace: "redis",
|
|
16
|
+
description: "Read the string value at a Redis key (GET). Returns null if the key does not exist.",
|
|
17
|
+
paramsSchema: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
key: { type: "string", description: "Redis key to read" },
|
|
21
|
+
into: CommonSchemas.into,
|
|
22
|
+
},
|
|
23
|
+
required: ["key"],
|
|
24
|
+
},
|
|
25
|
+
outputSchema: {
|
|
26
|
+
type: ["string", "null"],
|
|
27
|
+
description: "The string value at the key, or null if absent",
|
|
28
|
+
},
|
|
29
|
+
riskDefault: "low",
|
|
30
|
+
isWrite: false,
|
|
31
|
+
isConnector: true,
|
|
32
|
+
execute: async ({ params }) => {
|
|
33
|
+
const { getRedisConnector } = await import("../../connectors/redis.js");
|
|
34
|
+
const connector = getRedisConnector();
|
|
35
|
+
const result = await connector.get(params.key);
|
|
36
|
+
return JSON.stringify(result);
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// redis.keys
|
|
41
|
+
// ============================================================================
|
|
42
|
+
registerTool({
|
|
43
|
+
id: "redis.keys",
|
|
44
|
+
namespace: "redis",
|
|
45
|
+
description: "List Redis keys matching a glob pattern (SCAN-based; never blocks the server). Capped by limit.",
|
|
46
|
+
paramsSchema: {
|
|
47
|
+
type: "object",
|
|
48
|
+
properties: {
|
|
49
|
+
pattern: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Glob pattern to match keys (e.g. 'user:*')",
|
|
52
|
+
},
|
|
53
|
+
limit: {
|
|
54
|
+
type: "number",
|
|
55
|
+
description: "Max number of keys to return (default 100, max 10000)",
|
|
56
|
+
default: 100,
|
|
57
|
+
},
|
|
58
|
+
into: CommonSchemas.into,
|
|
59
|
+
},
|
|
60
|
+
required: ["pattern"],
|
|
61
|
+
},
|
|
62
|
+
outputSchema: {
|
|
63
|
+
type: "array",
|
|
64
|
+
items: { type: "string" },
|
|
65
|
+
description: "Matching keys",
|
|
66
|
+
},
|
|
67
|
+
riskDefault: "low",
|
|
68
|
+
isWrite: false,
|
|
69
|
+
isConnector: true,
|
|
70
|
+
execute: async ({ params }) => {
|
|
71
|
+
const { getRedisConnector } = await import("../../connectors/redis.js");
|
|
72
|
+
const connector = getRedisConnector();
|
|
73
|
+
const result = await connector.keys(params.pattern, typeof params.limit === "number" ? params.limit : undefined);
|
|
74
|
+
return JSON.stringify(result);
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
// ============================================================================
|
|
78
|
+
// redis.hgetall
|
|
79
|
+
// ============================================================================
|
|
80
|
+
registerTool({
|
|
81
|
+
id: "redis.hgetall",
|
|
82
|
+
namespace: "redis",
|
|
83
|
+
description: "Read all fields and values of a Redis hash (HGETALL). Returns an empty object if the key does not exist.",
|
|
84
|
+
paramsSchema: {
|
|
85
|
+
type: "object",
|
|
86
|
+
properties: {
|
|
87
|
+
key: { type: "string", description: "Redis hash key to read" },
|
|
88
|
+
into: CommonSchemas.into,
|
|
89
|
+
},
|
|
90
|
+
required: ["key"],
|
|
91
|
+
},
|
|
92
|
+
outputSchema: {
|
|
93
|
+
type: "object",
|
|
94
|
+
additionalProperties: { type: "string" },
|
|
95
|
+
description: "Field/value map of the hash",
|
|
96
|
+
},
|
|
97
|
+
riskDefault: "low",
|
|
98
|
+
isWrite: false,
|
|
99
|
+
isConnector: true,
|
|
100
|
+
execute: async ({ params }) => {
|
|
101
|
+
const { getRedisConnector } = await import("../../connectors/redis.js");
|
|
102
|
+
const connector = getRedisConnector();
|
|
103
|
+
const result = await connector.hgetall(params.key);
|
|
104
|
+
return JSON.stringify(result);
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
// ============================================================================
|
|
108
|
+
// redis.info
|
|
109
|
+
// ============================================================================
|
|
110
|
+
registerTool({
|
|
111
|
+
id: "redis.info",
|
|
112
|
+
namespace: "redis",
|
|
113
|
+
description: "Read Redis server info (INFO), parsed into a flat key/value map. Optionally scoped to a single section (e.g. 'memory', 'replication').",
|
|
114
|
+
paramsSchema: {
|
|
115
|
+
type: "object",
|
|
116
|
+
properties: {
|
|
117
|
+
section: {
|
|
118
|
+
type: "string",
|
|
119
|
+
description: "Optional INFO section to scope to (e.g. 'server', 'memory', 'replication')",
|
|
120
|
+
},
|
|
121
|
+
into: CommonSchemas.into,
|
|
122
|
+
},
|
|
123
|
+
required: [],
|
|
124
|
+
},
|
|
125
|
+
outputSchema: {
|
|
126
|
+
type: "object",
|
|
127
|
+
additionalProperties: { type: "string" },
|
|
128
|
+
description: "Parsed INFO key/value pairs",
|
|
129
|
+
},
|
|
130
|
+
riskDefault: "low",
|
|
131
|
+
isWrite: false,
|
|
132
|
+
isConnector: true,
|
|
133
|
+
execute: async ({ params }) => {
|
|
134
|
+
const { getRedisConnector } = await import("../../connectors/redis.js");
|
|
135
|
+
const connector = getRedisConnector();
|
|
136
|
+
const result = await connector.info(typeof params.section === "string" ? params.section : undefined);
|
|
137
|
+
return JSON.stringify(result);
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
//# sourceMappingURL=redis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis.js","sourceRoot":"","sources":["../../../src/recipes/tools/redis.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,YAAY,CAAC;IACX,EAAE,EAAE,WAAW;IACf,SAAS,EAAE,OAAO;IAClB,WAAW,EACT,qFAAqF;IACvF,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE;YACzD,IAAI,EAAE,aAAa,CAAC,IAAI;SACzB;QACD,QAAQ,EAAE,CAAC,KAAK,CAAC;KAClB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;QACxB,WAAW,EAAE,gDAAgD;KAC9D;IACD,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KA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,SAAS,EAAE,OAAO;IAClB,WAAW,EACT,wIAAwI;IAC1I,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,4EAA4E;aAC/E;YACD,IAAI,EAAE,aAAa,CAAC,IAAI;SACzB;QACD,QAAQ,EAAE,EAAE;KACb;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxC,WAAW,EAAE,6BAA6B;KAC3C;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,iBAAiB,EAAE,GAAG,MAAM,MAAM,CAAC,2BAA2B,CAAC,CAAC;QACxE,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,CACjC,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAChE,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
export {};
|
|
@@ -0,0 +1,153 @@
|
|
|
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
|
+
import { wrapConnectorExecute } from "./wrapConnectorExecute.js";
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// resend.send_email (write-gated)
|
|
12
|
+
// ============================================================================
|
|
13
|
+
registerTool({
|
|
14
|
+
id: "resend.send_email",
|
|
15
|
+
namespace: "resend",
|
|
16
|
+
description: "Send a transactional email via Resend. Requires from, to, subject, and one of html/text.",
|
|
17
|
+
paramsSchema: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
from: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Sender address (must be a verified Resend domain)",
|
|
23
|
+
},
|
|
24
|
+
to: {
|
|
25
|
+
type: ["string", "array"],
|
|
26
|
+
items: { type: "string" },
|
|
27
|
+
description: "Recipient address or array of addresses",
|
|
28
|
+
},
|
|
29
|
+
subject: { type: "string", description: "Email subject line" },
|
|
30
|
+
html: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "HTML body (either html or text is required)",
|
|
33
|
+
},
|
|
34
|
+
text: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Plain-text body (either html or text is required)",
|
|
37
|
+
},
|
|
38
|
+
reply_to: {
|
|
39
|
+
type: ["string", "array"],
|
|
40
|
+
items: { type: "string" },
|
|
41
|
+
description: "Optional reply-to address or array of addresses",
|
|
42
|
+
},
|
|
43
|
+
into: CommonSchemas.into,
|
|
44
|
+
},
|
|
45
|
+
required: ["from", "to", "subject"],
|
|
46
|
+
},
|
|
47
|
+
outputSchema: {
|
|
48
|
+
type: "object",
|
|
49
|
+
properties: {
|
|
50
|
+
id: { type: "string" },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
riskDefault: "medium",
|
|
54
|
+
isWrite: true,
|
|
55
|
+
isConnector: true,
|
|
56
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
57
|
+
const { getResendConnector } = await import("../../connectors/resend.js");
|
|
58
|
+
const connector = getResendConnector();
|
|
59
|
+
const result = await connector.sendEmail({
|
|
60
|
+
from: params.from,
|
|
61
|
+
to: params.to,
|
|
62
|
+
subject: params.subject,
|
|
63
|
+
html: typeof params.html === "string" ? params.html : undefined,
|
|
64
|
+
text: typeof params.text === "string" ? params.text : undefined,
|
|
65
|
+
replyTo: typeof params.reply_to === "string" || Array.isArray(params.reply_to)
|
|
66
|
+
? params.reply_to
|
|
67
|
+
: undefined,
|
|
68
|
+
});
|
|
69
|
+
return JSON.stringify(result);
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
72
|
+
// ============================================================================
|
|
73
|
+
// resend.list_emails
|
|
74
|
+
// ============================================================================
|
|
75
|
+
registerTool({
|
|
76
|
+
id: "resend.list_emails",
|
|
77
|
+
namespace: "resend",
|
|
78
|
+
description: "List emails sent via Resend, with optional limit/page paging.",
|
|
79
|
+
paramsSchema: {
|
|
80
|
+
type: "object",
|
|
81
|
+
properties: {
|
|
82
|
+
limit: {
|
|
83
|
+
type: "number",
|
|
84
|
+
description: "Max number of emails to return",
|
|
85
|
+
},
|
|
86
|
+
page: {
|
|
87
|
+
type: "number",
|
|
88
|
+
description: "Page number for pagination",
|
|
89
|
+
},
|
|
90
|
+
into: CommonSchemas.into,
|
|
91
|
+
},
|
|
92
|
+
required: [],
|
|
93
|
+
},
|
|
94
|
+
outputSchema: {
|
|
95
|
+
type: "object",
|
|
96
|
+
properties: {
|
|
97
|
+
object: { type: "string" },
|
|
98
|
+
data: { type: "array", items: { type: "object" } },
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
riskDefault: "low",
|
|
102
|
+
isWrite: false,
|
|
103
|
+
isConnector: true,
|
|
104
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
105
|
+
const { getResendConnector } = await import("../../connectors/resend.js");
|
|
106
|
+
const connector = getResendConnector();
|
|
107
|
+
const result = await connector.listEmails({
|
|
108
|
+
limit: typeof params.limit === "number" ? params.limit : undefined,
|
|
109
|
+
page: typeof params.page === "number" ? params.page : undefined,
|
|
110
|
+
});
|
|
111
|
+
return JSON.stringify(result);
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
// ============================================================================
|
|
115
|
+
// resend.get_email
|
|
116
|
+
// ============================================================================
|
|
117
|
+
registerTool({
|
|
118
|
+
id: "resend.get_email",
|
|
119
|
+
namespace: "resend",
|
|
120
|
+
description: "Fetch a single email sent via Resend by its ID.",
|
|
121
|
+
paramsSchema: {
|
|
122
|
+
type: "object",
|
|
123
|
+
properties: {
|
|
124
|
+
id: { type: "string", description: "Resend email ID" },
|
|
125
|
+
into: CommonSchemas.into,
|
|
126
|
+
},
|
|
127
|
+
required: ["id"],
|
|
128
|
+
},
|
|
129
|
+
outputSchema: {
|
|
130
|
+
type: "object",
|
|
131
|
+
properties: {
|
|
132
|
+
object: { type: "string" },
|
|
133
|
+
id: { type: "string" },
|
|
134
|
+
to: { type: ["string", "array"], items: { type: "string" } },
|
|
135
|
+
from: { type: "string" },
|
|
136
|
+
subject: { type: "string" },
|
|
137
|
+
html: { type: ["string", "null"] },
|
|
138
|
+
text: { type: ["string", "null"] },
|
|
139
|
+
created_at: { type: "string" },
|
|
140
|
+
last_event: { type: "string" },
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
riskDefault: "low",
|
|
144
|
+
isWrite: false,
|
|
145
|
+
isConnector: true,
|
|
146
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
147
|
+
const { getResendConnector } = await import("../../connectors/resend.js");
|
|
148
|
+
const connector = getResendConnector();
|
|
149
|
+
const result = await connector.getEmail(params.id);
|
|
150
|
+
return JSON.stringify(result);
|
|
151
|
+
}),
|
|
152
|
+
});
|
|
153
|
+
//# sourceMappingURL=resend.js.map
|
|
@@ -0,0 +1 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AC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Salesforce recipe-step tools — read wrappers (query, search, get_object)
|
|
3
|
+
* plus a write-gated create_record.
|
|
4
|
+
*
|
|
5
|
+
* Self-registering tool module for the recipe tool registry. Unlike the
|
|
6
|
+
* class-plus-accessor connectors, src/connectors/salesforce.ts exports a set
|
|
7
|
+
* of standalone async functions (module-function pattern) — there is no
|
|
8
|
+
* getSalesforceConnector(). Each tool dynamically imports the function it wraps
|
|
9
|
+
* and JSON-stringifies the raw connector return value back out.
|
|
10
|
+
*
|
|
11
|
+
* Read tools (`query`, `searchSosl`, `getObject`) declare `isWrite: false`;
|
|
12
|
+
* `create_record` declares `isWrite: true` so the approval queue gates the
|
|
13
|
+
* mutation. The connector itself enforces SELECT-only SOQL and FIND-only SOSL,
|
|
14
|
+
* and validates sObject / record-id shapes before issuing the call.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|