@koda-sl/baker-cli 0.485.0 → 0.486.0
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 +12 -0
- package/dist/{chunk-ADSNY4KZ.js → chunk-DVA4DOBH.js} +2 -2
- package/dist/{chunk-CM6FCSWN.js → chunk-LCMIAWUZ.js} +3 -1
- package/dist/chunk-LCMIAWUZ.js.map +1 -0
- package/dist/cli.js +4 -4
- package/dist/{create-B3QMYSIX.js → create-RBZJ27B2.js} +3 -3
- package/dist/{delete-S4VKH7IS.js → delete-EJG3MRM2.js} +3 -3
- package/dist/{get-MGDY5JYZ.js → get-ZI6RB6K5.js} +3 -3
- package/dist/{list-SZH6TH74.js → list-VY4UTTRG.js} +3 -3
- package/dist/{mcp-T6SAG4XB.js → mcp-MTFBVKLX.js} +279 -28
- package/dist/mcp-MTFBVKLX.js.map +1 -0
- package/dist/{run-HCJKCEOL.js → run-IKGW7UPB.js} +3 -3
- package/dist/{scheduled-agents-MFLMG34I.js → scheduled-agents-MUCDCONT.js} +10 -10
- package/dist/{schema-EFR7NGJG.js → schema-YT2DBX6T.js} +2 -2
- package/dist/{targets-NI7TR4GV.js → targets-SF4AOFZ3.js} +3 -3
- package/dist/{triggers-WYFM7PAH.js → triggers-PJ3UJAHM.js} +3 -3
- package/dist/{unstage-MCM6EZWK.js → unstage-NPQ5JQ6S.js} +3 -3
- package/dist/{update-GUIP6G3N.js → update-77YN5JEJ.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-CM6FCSWN.js.map +0 -1
- package/dist/mcp-T6SAG4XB.js.map +0 -1
- /package/dist/{chunk-ADSNY4KZ.js.map → chunk-DVA4DOBH.js.map} +0 -0
- /package/dist/{create-B3QMYSIX.js.map → create-RBZJ27B2.js.map} +0 -0
- /package/dist/{delete-S4VKH7IS.js.map → delete-EJG3MRM2.js.map} +0 -0
- /package/dist/{get-MGDY5JYZ.js.map → get-ZI6RB6K5.js.map} +0 -0
- /package/dist/{list-SZH6TH74.js.map → list-VY4UTTRG.js.map} +0 -0
- /package/dist/{run-HCJKCEOL.js.map → run-IKGW7UPB.js.map} +0 -0
- /package/dist/{scheduled-agents-MFLMG34I.js.map → scheduled-agents-MUCDCONT.js.map} +0 -0
- /package/dist/{schema-EFR7NGJG.js.map → schema-YT2DBX6T.js.map} +0 -0
- /package/dist/{targets-NI7TR4GV.js.map → targets-SF4AOFZ3.js.map} +0 -0
- /package/dist/{triggers-WYFM7PAH.js.map → triggers-PJ3UJAHM.js.map} +0 -0
- /package/dist/{unstage-MCM6EZWK.js.map → unstage-NPQ5JQ6S.js.map} +0 -0
- /package/dist/{update-GUIP6G3N.js.map → update-77YN5JEJ.js.map} +0 -0
|
@@ -47,7 +47,7 @@ var mcpCatalogResponseSchema = z.object({
|
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
// src/commands/mcp/index.ts
|
|
50
|
-
import { defineCommand } from "citty";
|
|
50
|
+
import { defineCommand as defineCommand2 } from "citty";
|
|
51
51
|
|
|
52
52
|
// src/commands/mcp/catalog.ts
|
|
53
53
|
var PREFER_VENDOR_HINT = 'The vendor\'s own MCP server comes before any app here. If you have not yet, WebSearch "<vendor> MCP server" and WebFetch its official docs for the remote https address and how it signs in, then ask for it with request_connection `{ server: { name, url, auth, keyHeader } }`. Only when the vendor has none, ask for an app from this catalog with request_connection `{ app: "<slug>", reason }` \u2014 the user connects it in the chat and its tools load right after, in this same turn.';
|
|
@@ -71,6 +71,250 @@ function catalogHints(apps, { platforms = [] } = {}) {
|
|
|
71
71
|
return hints;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
// ../api/src/mcp-tools.ts
|
|
75
|
+
import { z as z2 } from "zod";
|
|
76
|
+
var MCP_TOOLS_DEFAULT_LIMIT = 10;
|
|
77
|
+
var MCP_TOOL_DESCRIPTION_MAX = 200;
|
|
78
|
+
var mcpToolSlugSchema = z2.string().trim().min(1, "Provide --tool").max(120).regex(/^[A-Za-z0-9_]+$/, "A tool is named like GMAIL_FETCH_EMAILS \u2014 find one with `baker mcp tools --search`").transform((slug) => slug.toUpperCase());
|
|
79
|
+
var mcpAppSlugSchema = z2.string().trim().min(1).max(60).regex(/^[a-z0-9_-]+$/i, "Name the app as `baker mcp connected` lists it, e.g. gmail").transform((slug) => slug.toLowerCase());
|
|
80
|
+
var mcpToolsRequestSchema = z2.object({
|
|
81
|
+
search: z2.string().trim().min(1).max(200).optional(),
|
|
82
|
+
app: mcpAppSlugSchema.optional(),
|
|
83
|
+
limit: z2.coerce.number().int().min(1).max(50).default(MCP_TOOLS_DEFAULT_LIMIT)
|
|
84
|
+
}).refine((request) => request.search !== void 0 || request.app !== void 0, {
|
|
85
|
+
message: "Provide --search, --app, or both"
|
|
86
|
+
});
|
|
87
|
+
var mcpToolSummarySchema = z2.object({
|
|
88
|
+
tool: z2.string(),
|
|
89
|
+
app: z2.string(),
|
|
90
|
+
name: z2.string(),
|
|
91
|
+
description: z2.string().max(MCP_TOOL_DESCRIPTION_MAX),
|
|
92
|
+
/** Only read-only tools run through `baker mcp execute`. */
|
|
93
|
+
readOnly: z2.boolean()
|
|
94
|
+
});
|
|
95
|
+
var mcpToolsResponseSchema = z2.object({
|
|
96
|
+
tools: z2.array(mcpToolSummarySchema),
|
|
97
|
+
/** The connected apps the search ran over. */
|
|
98
|
+
apps: z2.array(z2.string())
|
|
99
|
+
});
|
|
100
|
+
var mcpToolRequestSchema = z2.object({
|
|
101
|
+
tool: mcpToolSlugSchema,
|
|
102
|
+
full: z2.boolean().default(false)
|
|
103
|
+
});
|
|
104
|
+
var mcpToolInputSchema = z2.object({
|
|
105
|
+
name: z2.string(),
|
|
106
|
+
type: z2.string(),
|
|
107
|
+
required: z2.boolean(),
|
|
108
|
+
description: z2.string().optional(),
|
|
109
|
+
enum: z2.array(z2.unknown()).optional(),
|
|
110
|
+
default: z2.unknown().optional()
|
|
111
|
+
});
|
|
112
|
+
var mcpToolResponseSchema = z2.object({
|
|
113
|
+
tool: z2.string(),
|
|
114
|
+
app: z2.string(),
|
|
115
|
+
name: z2.string(),
|
|
116
|
+
description: z2.string(),
|
|
117
|
+
readOnly: z2.boolean(),
|
|
118
|
+
inputs: z2.array(mcpToolInputSchema),
|
|
119
|
+
/** The raw JSON schemas, with `--full` only. */
|
|
120
|
+
inputSchema: z2.unknown().optional(),
|
|
121
|
+
outputSchema: z2.unknown().optional()
|
|
122
|
+
});
|
|
123
|
+
var mcpExecuteRequestSchema = z2.object({
|
|
124
|
+
tool: mcpToolSlugSchema,
|
|
125
|
+
arguments: z2.record(z2.string(), z2.unknown()).default({}),
|
|
126
|
+
actingUserId: z2.string().optional()
|
|
127
|
+
});
|
|
128
|
+
var mcpExecuteResponseSchema = z2.object({
|
|
129
|
+
tool: z2.string(),
|
|
130
|
+
app: z2.string(),
|
|
131
|
+
/** Whose connection answered: `company` is the one a published Report reads. */
|
|
132
|
+
scope: z2.enum(["user", "user_org", "company", "org"]),
|
|
133
|
+
account: z2.string().nullable(),
|
|
134
|
+
/** What the tool returned, as the app returned it. */
|
|
135
|
+
data: z2.unknown()
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// src/commands/mcp/execute.ts
|
|
139
|
+
import { defineCommand } from "citty";
|
|
140
|
+
var EXECUTE_TIMEOUT_MS = 12e4;
|
|
141
|
+
function fail(err) {
|
|
142
|
+
if (err instanceof ApiError) {
|
|
143
|
+
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
144
|
+
process.exit(1);
|
|
145
|
+
}
|
|
146
|
+
writeJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
147
|
+
process.exit(1);
|
|
148
|
+
}
|
|
149
|
+
function invalid(message) {
|
|
150
|
+
return fail(new ApiError("VALIDATION_ERROR", message));
|
|
151
|
+
}
|
|
152
|
+
function actingUserId() {
|
|
153
|
+
return getEnv().BAKER_ACTING_USER_ID;
|
|
154
|
+
}
|
|
155
|
+
function executeHints(ran) {
|
|
156
|
+
const hints = [];
|
|
157
|
+
if (ran.scope !== "company") {
|
|
158
|
+
hints.push(
|
|
159
|
+
`This answer came from a ${ran.scope === "org" ? "connection shared by the organization" : "connection of the person sending this message"}. A published report reads only apps connected for the whole company, so ${ran.tool} will answer "not connected" there: ask the user to connect ${ran.app} for the whole company before building a report on it.`
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
hints.push(
|
|
163
|
+
`In a report endpoint: runReportBaker(event, ["mcp", "execute", "--tool", "${ran.tool}", "--data", JSON.stringify(args)]) \u2014 return only the fields the page shows.`
|
|
164
|
+
);
|
|
165
|
+
return hints;
|
|
166
|
+
}
|
|
167
|
+
var toolsArgs = {
|
|
168
|
+
search: {
|
|
169
|
+
type: "string",
|
|
170
|
+
description: 'What the tool should do, e.g. "fetch emails", "read sheet rows"',
|
|
171
|
+
required: false
|
|
172
|
+
},
|
|
173
|
+
app: {
|
|
174
|
+
type: "string",
|
|
175
|
+
description: "Only this connected app, as `baker mcp connected` lists it (gmail)",
|
|
176
|
+
required: false
|
|
177
|
+
},
|
|
178
|
+
limit: { type: "string", description: "Max tools to return, 1-50 (default 10)", required: false }
|
|
179
|
+
};
|
|
180
|
+
registerSchema({
|
|
181
|
+
command: "mcp.tools",
|
|
182
|
+
description: 'Find a connected app\'s tools to run with `baker mcp execute`. Searches the apps this chat reaches (or --app). Each tool: tool (slug), app, name, description, readOnly (only read-only tools run). Example: baker mcp tools --app googlesheets --search "read rows"',
|
|
183
|
+
args: toolsArgs
|
|
184
|
+
});
|
|
185
|
+
var toolsCommand = defineCommand({
|
|
186
|
+
meta: {
|
|
187
|
+
name: "tools",
|
|
188
|
+
description: `Find a connected app's tools to run from the command line with \`baker mcp execute\`.
|
|
189
|
+
|
|
190
|
+
Start here:
|
|
191
|
+
baker mcp tools --search "fetch unread emails" # across every connected app
|
|
192
|
+
baker mcp tools --app googlesheets --search "read rows"
|
|
193
|
+
baker mcp tools --app hubspot --limit 20 # an app's tools, no search
|
|
194
|
+
|
|
195
|
+
Each tool: tool (the slug execute takes), app, name, description, readOnly.
|
|
196
|
+
Only readOnly tools run through execute; a tool that changes things is the chat's own mcp__composio_* tool.`
|
|
197
|
+
},
|
|
198
|
+
args: toolsArgs,
|
|
199
|
+
run: async ({ args }) => {
|
|
200
|
+
const parsed = mcpToolsRequestSchema.safeParse({ search: args.search, app: args.app, limit: args.limit });
|
|
201
|
+
if (!parsed.success) {
|
|
202
|
+
invalid(parsed.error.issues[0]?.message ?? "Invalid arguments");
|
|
203
|
+
}
|
|
204
|
+
try {
|
|
205
|
+
const user = actingUserId();
|
|
206
|
+
const data = await apiGet("/api/mcp/tools", {
|
|
207
|
+
...parsed.data.search ? { search: parsed.data.search } : {},
|
|
208
|
+
...parsed.data.app ? { app: parsed.data.app } : {},
|
|
209
|
+
limit: String(parsed.data.limit),
|
|
210
|
+
...user ? { actingUserId: user } : {}
|
|
211
|
+
});
|
|
212
|
+
const hints = data.apps.length === 0 ? [
|
|
213
|
+
"No app is connected here. Check `baker mcp connected`; connect one with request_connection, from the chat."
|
|
214
|
+
] : [
|
|
215
|
+
"Run one with `baker mcp execute --tool <TOOL> --get-schema` first to see its inputs, then `--data '<json>'`.",
|
|
216
|
+
...data.tools.some((tool) => !tool.readOnly) ? [
|
|
217
|
+
"readOnly: false tools cannot run through execute \u2014 they change things; use the chat's mcp__composio_* tool."
|
|
218
|
+
] : []
|
|
219
|
+
];
|
|
220
|
+
writeJson({ ok: true, data, hints });
|
|
221
|
+
} catch (err) {
|
|
222
|
+
fail(err);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
var executeArgs = {
|
|
227
|
+
tool: { type: "string", description: "Tool slug from `baker mcp tools`, e.g. GMAIL_FETCH_EMAILS", required: true },
|
|
228
|
+
data: {
|
|
229
|
+
type: "string",
|
|
230
|
+
description: `The tool's arguments as a JSON object, e.g. '{"max_results":10}'`,
|
|
231
|
+
required: false
|
|
232
|
+
},
|
|
233
|
+
"get-schema": { type: "boolean", description: "Show the tool's inputs instead of running it", required: false },
|
|
234
|
+
full: {
|
|
235
|
+
type: "boolean",
|
|
236
|
+
description: "With --get-schema: the raw input and output JSON schemas too",
|
|
237
|
+
required: false
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
registerSchema({
|
|
241
|
+
command: "mcp.execute",
|
|
242
|
+
description: `Run one read-only tool of a connected app and print what it returned as JSON \u2014 for a report's data endpoint, a script, or keeping the answer. \`--get-schema\` shows its inputs first. A published report reaches only apps connected for the whole company. Example: baker mcp execute --tool GOOGLESHEETS_BATCH_GET --data '{"spreadsheet_id":"\u2026","ranges":["A1:D50"]}'`,
|
|
243
|
+
args: executeArgs
|
|
244
|
+
});
|
|
245
|
+
function parseData(raw) {
|
|
246
|
+
if (raw === void 0 || raw === "") {
|
|
247
|
+
return {};
|
|
248
|
+
}
|
|
249
|
+
let value;
|
|
250
|
+
try {
|
|
251
|
+
value = JSON.parse(String(raw));
|
|
252
|
+
} catch {
|
|
253
|
+
invalid(`--data must be a JSON object, e.g. '{"max_results":10}' (keys and strings in double quotes).`);
|
|
254
|
+
}
|
|
255
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
256
|
+
invalid(`--data must be a JSON object, e.g. '{"max_results":10}'.`);
|
|
257
|
+
}
|
|
258
|
+
return value;
|
|
259
|
+
}
|
|
260
|
+
var executeCommand = defineCommand({
|
|
261
|
+
meta: {
|
|
262
|
+
name: "execute",
|
|
263
|
+
description: `Run one read-only tool of a connected app; prints what it returned as JSON.
|
|
264
|
+
|
|
265
|
+
The same tools as the chat's mcp__composio_* servers, answered on stdout so a report's data endpoint,
|
|
266
|
+
a script or a file can keep it. Find the tool with \`baker mcp tools\`, read its inputs, then run it:
|
|
267
|
+
baker mcp execute --tool GOOGLESHEETS_BATCH_GET --get-schema
|
|
268
|
+
baker mcp execute --tool GOOGLESHEETS_BATCH_GET --data '{"spreadsheet_id":"1AbC\u2026","ranges":["Sheet1!A1:D50"]}'
|
|
269
|
+
baker mcp execute --tool GMAIL_FETCH_EMAILS --data '{"query":"is:unread newer_than:7d","max_results":20}' > /tmp/inbox.json
|
|
270
|
+
|
|
271
|
+
Reads only: a tool that changes things (send, create, update) is refused \u2014 use the chat's own tool for it.
|
|
272
|
+
A published report runs as nobody, so it reaches only apps connected for the whole company; a
|
|
273
|
+
person's own connection answers in their chat and nowhere else.`
|
|
274
|
+
},
|
|
275
|
+
args: executeArgs,
|
|
276
|
+
run: async ({ args }) => {
|
|
277
|
+
if (args["get-schema"]) {
|
|
278
|
+
const parsed2 = mcpToolRequestSchema.safeParse({ tool: args.tool, full: args.full === true });
|
|
279
|
+
if (!parsed2.success) {
|
|
280
|
+
invalid(parsed2.error.issues[0]?.message ?? "Invalid arguments");
|
|
281
|
+
}
|
|
282
|
+
try {
|
|
283
|
+
const data = await apiGet("/api/mcp/tool", {
|
|
284
|
+
tool: parsed2.data.tool,
|
|
285
|
+
...parsed2.data.full ? { full: "true" } : {}
|
|
286
|
+
});
|
|
287
|
+
writeJson({
|
|
288
|
+
ok: true,
|
|
289
|
+
data,
|
|
290
|
+
hints: data.readOnly ? [`Run it: baker mcp execute --tool ${data.tool} --data '<json object of the inputs above>'`] : [
|
|
291
|
+
`${data.tool} changes things, so execute refuses it. In a chat, use the app's own mcp__composio_* tool.`
|
|
292
|
+
]
|
|
293
|
+
});
|
|
294
|
+
} catch (err) {
|
|
295
|
+
fail(err);
|
|
296
|
+
}
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const parsed = mcpExecuteRequestSchema.safeParse({
|
|
300
|
+
tool: args.tool,
|
|
301
|
+
arguments: parseData(args.data),
|
|
302
|
+
actingUserId: actingUserId()
|
|
303
|
+
});
|
|
304
|
+
if (!parsed.success) {
|
|
305
|
+
invalid(parsed.error.issues[0]?.message ?? "Invalid arguments");
|
|
306
|
+
}
|
|
307
|
+
try {
|
|
308
|
+
const data = await apiPost("/api/mcp/execute", parsed.data, {
|
|
309
|
+
timeoutMs: EXECUTE_TIMEOUT_MS
|
|
310
|
+
});
|
|
311
|
+
writeJson({ ok: true, data, hints: executeHints(data) });
|
|
312
|
+
} catch (err) {
|
|
313
|
+
fail(err);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
|
|
74
318
|
// src/commands/mcp/platforms.ts
|
|
75
319
|
function readsKey(label) {
|
|
76
320
|
const [first = "", ...rest] = label.split(" ");
|
|
@@ -93,7 +337,7 @@ function parseScope(raw) {
|
|
|
93
337
|
}
|
|
94
338
|
return scope;
|
|
95
339
|
}
|
|
96
|
-
function
|
|
340
|
+
function actingUserId2() {
|
|
97
341
|
return getEnv().BAKER_ACTING_USER_ID;
|
|
98
342
|
}
|
|
99
343
|
function customEntry(server) {
|
|
@@ -124,7 +368,7 @@ function parseHeaders(raw, rawArgs) {
|
|
|
124
368
|
}
|
|
125
369
|
return Object.keys(headers).length > 0 ? headers : void 0;
|
|
126
370
|
}
|
|
127
|
-
function
|
|
371
|
+
function fail2(err) {
|
|
128
372
|
if (err instanceof ApiError) {
|
|
129
373
|
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
130
374
|
process.exit(1);
|
|
@@ -138,7 +382,7 @@ registerSchema({
|
|
|
138
382
|
description: "List everything this chat can reach: managed integrations (Attio, Slack, Gmail, Google Sheets, \u2026), custom MCP servers, and the platforms the company signed in to (HubSpot, Google Ads, GA4, Search Console, Tag Manager) which you read through their own `baker` commands. Start here when the user mentions an external tool or platform.",
|
|
139
383
|
args: {}
|
|
140
384
|
});
|
|
141
|
-
var connectedCommand =
|
|
385
|
+
var connectedCommand = defineCommand2({
|
|
142
386
|
meta: {
|
|
143
387
|
name: "connected",
|
|
144
388
|
description: `Everything this chat can reach \u2014 managed integrations, custom MCP servers, and connected platforms.
|
|
@@ -150,7 +394,7 @@ A tool or platform the user names that is NOT listed anywhere here is simply not
|
|
|
150
394
|
},
|
|
151
395
|
run: async () => {
|
|
152
396
|
try {
|
|
153
|
-
const user =
|
|
397
|
+
const user = actingUserId2();
|
|
154
398
|
const data = await apiGet("/api/mcp/connected", user ? { actingUserId: user } : void 0);
|
|
155
399
|
const managed = data.managed.map((c) => ({
|
|
156
400
|
toolkit: c.toolkitSlug,
|
|
@@ -185,7 +429,7 @@ A tool or platform the user names that is NOT listed anywhere here is simply not
|
|
|
185
429
|
hints
|
|
186
430
|
});
|
|
187
431
|
} catch (err) {
|
|
188
|
-
|
|
432
|
+
fail2(err);
|
|
189
433
|
}
|
|
190
434
|
}
|
|
191
435
|
});
|
|
@@ -198,7 +442,7 @@ registerSchema({
|
|
|
198
442
|
description: "Search the managed apps you can ask the user to connect when a vendor has no MCP server of its own. Each app says how the user connects it (sign-in | key) and whether this chat already reaches it. Example: baker mcp catalog --search notion",
|
|
199
443
|
args: catalogArgs
|
|
200
444
|
});
|
|
201
|
-
var catalogCommand =
|
|
445
|
+
var catalogCommand = defineCommand2({
|
|
202
446
|
meta: {
|
|
203
447
|
name: "catalog",
|
|
204
448
|
description: `Managed apps you can ask the user to connect when a vendor has no MCP server of its own.
|
|
@@ -221,7 +465,7 @@ Prefer the vendor's own MCP server when it publishes one; a catalog app is the f
|
|
|
221
465
|
process.exit(1);
|
|
222
466
|
}
|
|
223
467
|
try {
|
|
224
|
-
const user =
|
|
468
|
+
const user = actingUserId2();
|
|
225
469
|
const data = await apiGet("/api/mcp/catalog", {
|
|
226
470
|
search: parsed.data.search,
|
|
227
471
|
limit: String(parsed.data.limit),
|
|
@@ -236,7 +480,7 @@ Prefer the vendor's own MCP server when it publishes one; a catalog app is the f
|
|
|
236
480
|
hints: catalogHints(data.apps, { platforms: data.platforms ?? [] })
|
|
237
481
|
});
|
|
238
482
|
} catch (err) {
|
|
239
|
-
|
|
483
|
+
fail2(err);
|
|
240
484
|
}
|
|
241
485
|
}
|
|
242
486
|
});
|
|
@@ -245,11 +489,11 @@ registerSchema({
|
|
|
245
489
|
description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
|
|
246
490
|
args: {}
|
|
247
491
|
});
|
|
248
|
-
var listCommand =
|
|
492
|
+
var listCommand = defineCommand2({
|
|
249
493
|
meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
|
|
250
494
|
run: async () => {
|
|
251
495
|
try {
|
|
252
|
-
const user =
|
|
496
|
+
const user = actingUserId2();
|
|
253
497
|
const data = await apiGet(
|
|
254
498
|
"/api/mcp/custom",
|
|
255
499
|
user ? { actingUserId: user } : void 0
|
|
@@ -264,7 +508,7 @@ var listCommand = defineCommand({
|
|
|
264
508
|
} : {}
|
|
265
509
|
});
|
|
266
510
|
} catch (err) {
|
|
267
|
-
|
|
511
|
+
fail2(err);
|
|
268
512
|
}
|
|
269
513
|
}
|
|
270
514
|
});
|
|
@@ -282,7 +526,7 @@ registerSchema({
|
|
|
282
526
|
header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
|
|
283
527
|
}
|
|
284
528
|
});
|
|
285
|
-
var addCommand =
|
|
529
|
+
var addCommand = defineCommand2({
|
|
286
530
|
meta: {
|
|
287
531
|
name: "add",
|
|
288
532
|
description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
|
|
@@ -309,7 +553,7 @@ Examples:
|
|
|
309
553
|
run: async ({ args, rawArgs }) => {
|
|
310
554
|
try {
|
|
311
555
|
const scope = parseScope(args.scope);
|
|
312
|
-
const user =
|
|
556
|
+
const user = actingUserId2();
|
|
313
557
|
const headers = parseHeaders(args.header, rawArgs);
|
|
314
558
|
const data = await apiPost("/api/mcp/custom", {
|
|
315
559
|
name: args.name,
|
|
@@ -327,7 +571,7 @@ Examples:
|
|
|
327
571
|
]
|
|
328
572
|
});
|
|
329
573
|
} catch (err) {
|
|
330
|
-
|
|
574
|
+
fail2(err);
|
|
331
575
|
}
|
|
332
576
|
}
|
|
333
577
|
});
|
|
@@ -336,7 +580,7 @@ registerSchema({
|
|
|
336
580
|
description: "Remove a company custom MCP server by name.",
|
|
337
581
|
args: { name: { type: "string", description: "Server name to remove", required: true } }
|
|
338
582
|
});
|
|
339
|
-
var removeCommand =
|
|
583
|
+
var removeCommand = defineCommand2({
|
|
340
584
|
meta: {
|
|
341
585
|
name: "remove",
|
|
342
586
|
description: `Remove a company custom MCP server by name.
|
|
@@ -347,14 +591,14 @@ Example:
|
|
|
347
591
|
args: { name: { type: "string", description: "Server name to remove", required: true } },
|
|
348
592
|
run: async ({ args }) => {
|
|
349
593
|
try {
|
|
350
|
-
const user =
|
|
594
|
+
const user = actingUserId2();
|
|
351
595
|
const data = await apiPost("/api/mcp/custom/remove", {
|
|
352
596
|
name: args.name,
|
|
353
597
|
...user ? { actingUserId: user } : {}
|
|
354
598
|
});
|
|
355
599
|
writeJson({ ok: true, data });
|
|
356
600
|
} catch (err) {
|
|
357
|
-
|
|
601
|
+
fail2(err);
|
|
358
602
|
}
|
|
359
603
|
}
|
|
360
604
|
});
|
|
@@ -366,7 +610,7 @@ registerSchema({
|
|
|
366
610
|
description: "Check a custom MCP server now (the dashboard's 'Check now') and store the result. Use after the user fixed its address or sign-in, or when its tools failed this turn.",
|
|
367
611
|
args: serverNameArgs
|
|
368
612
|
});
|
|
369
|
-
var verifyCommand =
|
|
613
|
+
var verifyCommand = defineCommand2({
|
|
370
614
|
meta: {
|
|
371
615
|
name: "verify",
|
|
372
616
|
description: `Check a custom MCP server now and store the result.
|
|
@@ -376,9 +620,9 @@ Example:
|
|
|
376
620
|
},
|
|
377
621
|
args: serverNameArgs,
|
|
378
622
|
run: async ({ args }) => {
|
|
379
|
-
const parsed = customMcpServerNameRequestSchema.safeParse({ name: args.name, actingUserId:
|
|
623
|
+
const parsed = customMcpServerNameRequestSchema.safeParse({ name: args.name, actingUserId: actingUserId2() });
|
|
380
624
|
if (!parsed.success) {
|
|
381
|
-
|
|
625
|
+
fail2(new ApiError("VALIDATION_ERROR", parsed.error.issues[0]?.message ?? "Invalid arguments"));
|
|
382
626
|
}
|
|
383
627
|
try {
|
|
384
628
|
const data = await apiPost("/api/mcp/custom/verify", parsed.data);
|
|
@@ -390,7 +634,7 @@ Example:
|
|
|
390
634
|
]
|
|
391
635
|
});
|
|
392
636
|
} catch (err) {
|
|
393
|
-
|
|
637
|
+
fail2(err);
|
|
394
638
|
}
|
|
395
639
|
}
|
|
396
640
|
});
|
|
@@ -399,7 +643,7 @@ registerSchema({
|
|
|
399
643
|
description: "Switch a custom MCP server off so its tools stop loading; its address and sign-in are kept. Turning it back on is done by a person in the dashboard, never by the agent.",
|
|
400
644
|
args: serverNameArgs
|
|
401
645
|
});
|
|
402
|
-
var disableCommand =
|
|
646
|
+
var disableCommand = defineCommand2({
|
|
403
647
|
meta: {
|
|
404
648
|
name: "disable",
|
|
405
649
|
description: `Switch a custom MCP server off (its tools stop loading). Only a person can turn it back on, in the dashboard.
|
|
@@ -409,9 +653,9 @@ Example:
|
|
|
409
653
|
},
|
|
410
654
|
args: serverNameArgs,
|
|
411
655
|
run: async ({ args }) => {
|
|
412
|
-
const parsed = customMcpServerNameRequestSchema.safeParse({ name: args.name, actingUserId:
|
|
656
|
+
const parsed = customMcpServerNameRequestSchema.safeParse({ name: args.name, actingUserId: actingUserId2() });
|
|
413
657
|
if (!parsed.success) {
|
|
414
|
-
|
|
658
|
+
fail2(new ApiError("VALIDATION_ERROR", parsed.error.issues[0]?.message ?? "Invalid arguments"));
|
|
415
659
|
}
|
|
416
660
|
try {
|
|
417
661
|
const data = await apiPost("/api/mcp/custom/disable", parsed.data);
|
|
@@ -423,11 +667,11 @@ Example:
|
|
|
423
667
|
]
|
|
424
668
|
});
|
|
425
669
|
} catch (err) {
|
|
426
|
-
|
|
670
|
+
fail2(err);
|
|
427
671
|
}
|
|
428
672
|
}
|
|
429
673
|
});
|
|
430
|
-
var mcpCommand =
|
|
674
|
+
var mcpCommand = defineCommand2({
|
|
431
675
|
meta: {
|
|
432
676
|
name: "mcp",
|
|
433
677
|
description: `Third-party tools for this company \u2014 see what's connected, register custom HTTPS MCP endpoints.
|
|
@@ -439,6 +683,11 @@ Start here:
|
|
|
439
683
|
baker mcp connected # everything this chat can reach: managed integrations, custom servers, connected platforms
|
|
440
684
|
baker mcp catalog --search notion # managed apps you can connect when a vendor has no MCP server of its own
|
|
441
685
|
|
|
686
|
+
Run a connected app's read-only tool from the command line (JSON on stdout \u2014 for reports and scripts):
|
|
687
|
+
baker mcp tools --app googlesheets --search "read rows"
|
|
688
|
+
baker mcp execute --tool GOOGLESHEETS_BATCH_GET --get-schema
|
|
689
|
+
baker mcp execute --tool GOOGLESHEETS_BATCH_GET --data '{"spreadsheet_id":"\u2026","ranges":["A1:D50"]}'
|
|
690
|
+
|
|
442
691
|
Examples:
|
|
443
692
|
baker mcp add --name weather --url https://mcp.example.com/mcp
|
|
444
693
|
baker mcp add --name acme --url https://acme.dev/mcp --header "Authorization: Bearer sk-\u2026"
|
|
@@ -450,6 +699,8 @@ Full guide: __tooling__/docs/tools/baker/mcp.md`
|
|
|
450
699
|
subCommands: {
|
|
451
700
|
connected: connectedCommand,
|
|
452
701
|
catalog: catalogCommand,
|
|
702
|
+
tools: toolsCommand,
|
|
703
|
+
execute: executeCommand,
|
|
453
704
|
list: listCommand,
|
|
454
705
|
add: addCommand,
|
|
455
706
|
remove: removeCommand,
|
|
@@ -460,4 +711,4 @@ Full guide: __tooling__/docs/tools/baker/mcp.md`
|
|
|
460
711
|
export {
|
|
461
712
|
mcpCommand
|
|
462
713
|
};
|
|
463
|
-
//# sourceMappingURL=mcp-
|
|
714
|
+
//# sourceMappingURL=mcp-MTFBVKLX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../api/src/mcp-catalog.ts","../src/commands/mcp/index.ts","../src/commands/mcp/catalog.ts","../../api/src/mcp-tools.ts","../src/commands/mcp/execute.ts","../src/commands/mcp/platforms.ts"],"sourcesContent":["/**\n * Contract for `GET /api/mcp/catalog` — searching the managed-app catalog the\n * sandbox agent can ask the user to connect when a vendor publishes no MCP\n * server of its own.\n *\n * `connect` mirrors `ToolkitConnectMode` in `convex/composio/types.ts`, folded\n * to what the user will be asked for: a sign-in or a key. Apps that need no\n * sign-in are left out — Composio refuses to connect them.\n */\nimport { z } from \"zod\";\n\nexport const MCP_CATALOG_DEFAULT_LIMIT = 8;\nexport const MCP_CATALOG_DESCRIPTION_MAX = 160;\n\nexport const mcpCatalogRequestSchema = z.object({\n search: z.string().trim().min(1, \"Provide --search\").max(100),\n limit: z.coerce.number().int().min(1).max(20).default(MCP_CATALOG_DEFAULT_LIMIT),\n});\nexport type McpCatalogRequest = z.infer<typeof mcpCatalogRequestSchema>;\n\nexport const mcpCatalogConnectSchema = z.enum([\"sign-in\", \"key\"]);\nexport type McpCatalogConnect = z.infer<typeof mcpCatalogConnectSchema>;\n\nexport const mcpCatalogEntrySchema = z.object({\n /** The toolkit slug — what request_connection `{ app }` takes. */\n app: z.string(),\n name: z.string(),\n description: z.string().max(MCP_CATALOG_DESCRIPTION_MAX),\n connect: mcpCatalogConnectSchema,\n connected: z.boolean(),\n});\nexport type McpCatalogEntry = z.infer<typeof mcpCatalogEntrySchema>;\n\nexport const mcpCatalogResponseSchema = z.object({\n apps: z.array(mcpCatalogEntrySchema),\n /** Baker's own connections this search matched — ask for these with `{ platform }`, never a managed copy. */\n platforms: z.array(z.string()).optional(),\n});\nexport type McpCatalogResponse = z.infer<typeof mcpCatalogResponseSchema>;\n","import {\n type CustomMcpDisableResponse,\n type CustomMcpVerifyResponse,\n customMcpServerNameRequestSchema,\n} from \"@baker/api\";\nimport { type McpCatalogResponse, mcpCatalogRequestSchema } from \"@baker/api/mcp-catalog\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiGet, apiPost } from \"../../client.ts\";\nimport { getEnv } from \"../../env.ts\";\nimport { repeatedValues } from \"../../lib/repeatedFlags.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { catalogHints } from \"./catalog.ts\";\nimport { executeCommand, toolsCommand } from \"./execute.ts\";\nimport { type ConnectedPlatform, platformEntry } from \"./platforms.ts\";\n\nconst SCOPES = [\"user\", \"user_org\", \"company\", \"org\"] as const;\ntype Scope = (typeof SCOPES)[number];\n\nfunction parseScope(raw: unknown): Scope {\n const scope = raw === undefined ? \"company\" : String(raw);\n if (!(SCOPES as readonly string[]).includes(scope)) {\n throw new ApiError(\"VALIDATION_ERROR\", `Invalid --scope \"${scope}\". Use user | user_org | company | org.`);\n }\n return scope as Scope;\n}\n\n/** The turn's message sender, injected by the bridge — required only for user scope. */\nfunction actingUserId(): string | undefined {\n return getEnv().BAKER_ACTING_USER_ID;\n}\n\ntype CustomMcpServer = {\n _id: string;\n scope: \"user\" | \"user_org\" | \"company\" | \"org\";\n name: string;\n url: string;\n headerKeys: string[];\n enabled: boolean;\n /** Absent until the address has been checked; `ok: false` means it serves no tools. */\n health?: { ok: boolean; message?: string; suggestedUrl?: string; transient?: boolean; checkedAt: number };\n createdAt: number;\n};\n\n/**\n * What to report for one custom server. `problem` is the whole point: a server can\n * be signed in, enabled and still serve nothing (wrong address), and reporting it\n * as plain \"connected\" is how an agent ends up promising tools it does not have.\n * A `transient` failure is reported separately — the tool may well answer, so\n * declaring it broken would be its own kind of lie.\n */\nfunction customEntry(server: CustomMcpServer): Record<string, unknown> {\n const failed = server.health && !server.health.ok;\n const problem = server.health?.message ?? \"This server's address is not serving tools.\";\n return {\n name: server.name,\n scope: server.scope,\n enabled: server.enabled,\n ...(failed && !server.health?.transient ? { usable: false, problem } : {}),\n ...(failed && server.health?.transient ? { lastCheck: \"failed\", problem } : {}),\n ...(failed && server.health?.suggestedUrl ? { suggestedAddress: server.health.suggestedUrl } : {}),\n };\n}\n\n/** The hint an unusable server earns — the agent must not offer its tools or invent a reason. */\nconst BROKEN_SERVER_HINT =\n \"A server marked usable=false will NOT answer: its tools are absent from this turn. Say plainly that the tool is not working and relay `problem`; never claim its tools are loading, coming next message, or temporarily unavailable. `problem` names what a person has to fix — the address, the sign-in, or the key the server was added with — so pass on that fix and no other: never tell the user to reconnect a server whose `problem` is its address or its key. The user makes the fix in the dashboard (Brain → Integrations → More apps). If `suggestedAddress` is present, that is the address to use.\";\n\n/** The hint for a server whose last check failed for a reason that may already have passed. */\nconst LAST_CHECK_FAILED_HINT =\n \"A server with lastCheck=failed was unreachable or erroring when it was last checked — that may already have passed, and its tools ARE loaded this turn. Try the tool; if it works, say nothing about the check. If it fails, report `problem` as what happened rather than guessing.\";\n\n/** Turn repeated `--header \"K: V\"` (or `K=V`) flags into a headers record. */\n/** `--header` is repeatable, so its values come off the command line — citty keeps only the last. */\nfunction parseHeaders(raw: unknown, rawArgs?: readonly string[]): Record<string, string> | undefined {\n const list = repeatedValues(rawArgs, \"header\", raw);\n const headers: Record<string, string> = {};\n for (const entry of list) {\n const text = String(entry);\n const sep = text.indexOf(\":\") >= 0 && (text.indexOf(\":\") < text.indexOf(\"=\") || text.indexOf(\"=\") < 0) ? \":\" : \"=\";\n const at = text.indexOf(sep);\n if (at <= 0) {\n throw new ApiError(\"VALIDATION_ERROR\", `Invalid header \"${text}\". Use \"Key: Value\".`);\n }\n headers[text.slice(0, at).trim()] = text.slice(at + 1).trim();\n }\n return Object.keys(headers).length > 0 ? headers : undefined;\n}\n\nfunction fail(err: unknown): never {\n if (err instanceof ApiError) {\n writeJson({ ok: false, error: { code: err.code, message: err.message } });\n process.exit(1);\n }\n writeJson({ ok: false, error: { code: \"NETWORK_ERROR\", message: \"Unexpected error\" } });\n process.exit(1);\n}\n\ntype ManagedConnection = {\n toolkitSlug: string;\n scope: \"user\" | \"user_org\" | \"company\" | \"org\";\n status: string;\n accountLabel: string | null;\n readOnly: boolean;\n};\n\ntype ConnectedResponse = {\n managed: ManagedConnection[];\n custom: CustomMcpServer[];\n platforms: ConnectedPlatform[];\n};\n\n/** The one thing an agent must not do with this list: infer a platform's state from the MCP half. */\nconst PLATFORMS_HINT =\n \"`platforms` are connected accounts you reach through `baker` commands (HubSpot, Google Ads, GA4, Search Console, Tag Manager, …), NOT mcp__* tools — there is no tool to call for them. A platform listed here IS connected: never tell the user to connect it, and never conclude it is missing because it has no mcp__* entry. Read what it holds with its own command family (`baker hubspot …`, `baker ads google …`, `baker ga4 …`, and so on).\";\n\nregisterSchema({\n command: \"mcp.connected\",\n description:\n \"List everything this chat can reach: managed integrations (Attio, Slack, Gmail, Google Sheets, …), custom MCP servers, and the platforms the company signed in to (HubSpot, Google Ads, GA4, Search Console, Tag Manager) which you read through their own `baker` commands. Start here when the user mentions an external tool or platform.\",\n args: {},\n});\n\nconst connectedCommand = defineCommand({\n meta: {\n name: \"connected\",\n description: `Everything this chat can reach — managed integrations, custom MCP servers, and connected platforms.\n\nManaged tools ride the composio servers (mcp__composio_<scope>__*); custom servers expose mcp__<name>__*.\nPlatforms (HubSpot, Google Ads, GA4, …) have no mcp__* tools at all — you read them with their own\n\\`baker\\` command family, and one listed here is connected and ready to use.\nA tool or platform the user names that is NOT listed anywhere here is simply not connected yet.`,\n },\n run: async () => {\n try {\n const user = actingUserId();\n const data = await apiGet<ConnectedResponse>(\"/api/mcp/connected\", user ? { actingUserId: user } : undefined);\n const managed = data.managed.map((c) => ({\n toolkit: c.toolkitSlug,\n scope: c.scope,\n ...(c.status !== \"ACTIVE\" ? { status: c.status } : {}),\n ...(c.accountLabel ? { account: c.accountLabel } : {}),\n ...(c.readOnly ? { readOnly: true } : {}),\n }));\n const custom = data.custom.map(customEntry);\n const platforms = (data.platforms ?? []).map(platformEntry);\n const hints: string[] = [];\n if (platforms.length > 0) {\n hints.push(PLATFORMS_HINT);\n }\n if (data.custom.some((s) => s.health && !s.health.ok && !s.health.transient)) {\n hints.push(BROKEN_SERVER_HINT);\n }\n if (data.custom.some((s) => s.health && !s.health.ok && s.health.transient)) {\n hints.push(LAST_CHECK_FAILED_HINT);\n }\n if ([...data.managed, ...data.custom].some((e) => e.scope === \"user\" || e.scope === \"user_org\")) {\n hints.push(\n \"user/user_org entries are personal: they belong to the current message sender and load only in their turns — other users in this chat won't have them.\",\n );\n }\n hints.push(\n \"Not listed anywhere = not connected — connect it from the chat with request_connection, never by sending the user to the dashboard: a Baker platform (HubSpot, Google Ads, GA4, …) → { platform }; anything else → the vendor's own MCP server FIRST: use the address the user gave you, or WebSearch '<vendor> MCP server' and WebFetch its official docs for the remote https address and how it signs in, then { server: { name, url, auth, keyHeader } }; only when the vendor has none → `baker mcp catalog --search <name>`, then { app }. Research before you ask the user anything. What they connect loads into this same turn.\",\n );\n writeJson({\n ok: true,\n data: { managed, custom, platforms },\n hints,\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst catalogArgs = {\n search: { type: \"string\", description: \"App or vendor name, e.g. notion, clarity, pipedrive\", required: true },\n limit: { type: \"string\", description: \"Max apps to return, 1-20 (default 8)\", required: false },\n} as const;\n\nregisterSchema({\n command: \"mcp.catalog\",\n description:\n \"Search the managed apps you can ask the user to connect when a vendor has no MCP server of its own. Each app says how the user connects it (sign-in | key) and whether this chat already reaches it. Example: baker mcp catalog --search notion\",\n args: catalogArgs,\n});\n\nconst catalogCommand = defineCommand({\n meta: {\n name: \"catalog\",\n description: `Managed apps you can ask the user to connect when a vendor has no MCP server of its own.\n\nFor a tool \\`baker mcp connected\\` does not list whose vendor has no official remote MCP server:\n baker mcp catalog --search notion\n baker mcp catalog --search \"microsoft clarity\" --limit 3\n\nEach app: app (slug for request_connection), name, description, connect (sign-in | key), connected.\nPrefer the vendor's own MCP server when it publishes one; a catalog app is the fallback.`,\n },\n args: catalogArgs,\n run: async ({ args }) => {\n const parsed = mcpCatalogRequestSchema.safeParse({ search: args.search, limit: args.limit });\n if (!parsed.success) {\n writeJson({\n ok: false,\n error: { code: \"VALIDATION_ERROR\", message: parsed.error.issues[0]?.message ?? \"Invalid arguments\" },\n });\n process.exit(1);\n }\n try {\n const user = actingUserId();\n const data = await apiGet<McpCatalogResponse>(\"/api/mcp/catalog\", {\n search: parsed.data.search,\n limit: String(parsed.data.limit),\n ...(user ? { actingUserId: user } : {}),\n });\n writeJson({\n ok: true,\n data: {\n apps: data.apps,\n ...(data.platforms?.length ? { platforms: data.platforms } : {}),\n },\n hints: catalogHints(data.apps, { platforms: data.platforms ?? [] }),\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nregisterSchema({\n command: \"mcp.list\",\n description: \"List the custom MCP servers this company's chats see (org + company + your own user scope).\",\n args: {},\n});\n\nconst listCommand = defineCommand({\n meta: { name: \"list\", description: \"List custom MCP servers visible to this company's chats.\" },\n run: async () => {\n try {\n const user = actingUserId();\n const data = await apiGet<{ servers: CustomMcpServer[] }>(\n \"/api/mcp/custom\",\n user ? { actingUserId: user } : undefined,\n );\n writeJson({\n ok: true,\n // Detail view: the full row (address included) plus the usability verdict.\n // `health` itself is folded into `usable`/`problem` by `customEntry`.\n data: data.servers.map((server) => ({ ...server, health: undefined, ...customEntry(server) })),\n ...(data.servers.some((s) => s.health && !s.health.ok)\n ? {\n hints: data.servers.some((s) => s.health && !s.health.ok && !s.health.transient)\n ? [BROKEN_SERVER_HINT]\n : [LAST_CHECK_FAILED_HINT],\n }\n : {}),\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nregisterSchema({\n command: \"mcp.add\",\n description:\n \"Register a custom MCP server. Tools appear as mcp__<name>__* on the next message. URL must be HTTPS. Scope: company (default, all chats) | org (org admin key) | user (only the current sender).\",\n args: {\n name: { type: \"string\", description: \"Server name → tools appear as mcp__<name>__*\", required: true },\n url: {\n type: \"string\",\n description: \"Full HTTPS MCP endpoint (commonly ends in /mcp, not just the domain)\",\n required: true,\n },\n scope: { type: \"string\", description: \"user | user_org | company | org (default company)\", required: false },\n header: { type: \"string\", description: 'Auth header \"Key: Value\" (repeatable)', required: false },\n },\n});\n\nconst addCommand = defineCommand({\n meta: {\n name: \"add\",\n description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.\nFor a server the USER asks for, use request_connection { server } instead: they confirm who can use it,\ntype any key into the card (never the chat), and its tools load in this same turn.\n\nScope: company (default — every chat in the company) | org (all companies in the org; needs an admin key) | user (only the current message sender).\n\nExamples:\n baker mcp add --name weather --url https://mcp.example.com/mcp\n baker mcp add --name acme --url https://acme.dev/mcp --header \"Authorization: Bearer sk-…\"\n baker mcp add --name mine --url https://my.dev/mcp --scope user`,\n },\n args: {\n name: { type: \"string\", description: \"Server name (mcp__<name>__*)\", required: true },\n url: {\n type: \"string\",\n description: \"Full HTTPS MCP endpoint (commonly ends in /mcp, not just the domain)\",\n required: true,\n },\n scope: { type: \"string\", description: \"user | user_org | company | org (default company)\", required: false },\n header: { type: \"string\", description: 'Auth header \"Key: Value\" (repeatable)', required: false },\n },\n run: async ({ args, rawArgs }) => {\n try {\n const scope = parseScope(args.scope);\n const user = actingUserId();\n const headers = parseHeaders(args.header, rawArgs);\n const data = await apiPost<{ name: string }>(\"/api/mcp/custom\", {\n name: args.name as string,\n url: args.url as string,\n scope,\n ...(user ? { actingUserId: user } : {}),\n ...(headers ? { headers } : {}),\n });\n writeJson({\n ok: true,\n data,\n hints: [\n \"The address must be the full MCP endpoint (commonly ending in /mcp), not just the domain — a domain on its own usually answers sign-in and then serves no tools.\",\n \"The address is checked in the background. Run `baker mcp connected` on the next message to confirm it serves tools before promising the user anything.\",\n ],\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nregisterSchema({\n command: \"mcp.remove\",\n description: \"Remove a company custom MCP server by name.\",\n args: { name: { type: \"string\", description: \"Server name to remove\", required: true } },\n});\n\nconst removeCommand = defineCommand({\n meta: {\n name: \"remove\",\n description: `Remove a company custom MCP server by name.\n\nExample:\n baker mcp remove --name weather`,\n },\n args: { name: { type: \"string\", description: \"Server name to remove\", required: true } },\n run: async ({ args }) => {\n try {\n const user = actingUserId();\n const data = await apiPost<{ removed: boolean }>(\"/api/mcp/custom/remove\", {\n name: args.name as string,\n ...(user ? { actingUserId: user } : {}),\n });\n writeJson({ ok: true, data });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst serverNameArgs = {\n name: { type: \"string\", description: \"Custom server name, as `baker mcp list` shows it\", required: true },\n} as const;\n\nregisterSchema({\n command: \"mcp.verify\",\n description:\n \"Check a custom MCP server now (the dashboard's 'Check now') and store the result. Use after the user fixed its address or sign-in, or when its tools failed this turn.\",\n args: serverNameArgs,\n});\n\nconst verifyCommand = defineCommand({\n meta: {\n name: \"verify\",\n description: `Check a custom MCP server now and store the result.\n\nExample:\n baker mcp verify --name weather`,\n },\n args: serverNameArgs,\n run: async ({ args }) => {\n const parsed = customMcpServerNameRequestSchema.safeParse({ name: args.name, actingUserId: actingUserId() });\n if (!parsed.success) {\n fail(new ApiError(\"VALIDATION_ERROR\", parsed.error.issues[0]?.message ?? \"Invalid arguments\"));\n }\n try {\n const data = await apiPost<CustomMcpVerifyResponse>(\"/api/mcp/custom/verify\", parsed.data);\n writeJson({\n ok: true,\n data,\n hints: [\n data.ok\n ? \"The server answers and serves tools. Its tools load on the next message.\"\n : data.transient\n ? LAST_CHECK_FAILED_HINT\n : BROKEN_SERVER_HINT,\n ],\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nregisterSchema({\n command: \"mcp.disable\",\n description:\n \"Switch a custom MCP server off so its tools stop loading; its address and sign-in are kept. Turning it back on is done by a person in the dashboard, never by the agent.\",\n args: serverNameArgs,\n});\n\nconst disableCommand = defineCommand({\n meta: {\n name: \"disable\",\n description: `Switch a custom MCP server off (its tools stop loading). Only a person can turn it back on, in the dashboard.\n\nExample:\n baker mcp disable --name weather`,\n },\n args: serverNameArgs,\n run: async ({ args }) => {\n const parsed = customMcpServerNameRequestSchema.safeParse({ name: args.name, actingUserId: actingUserId() });\n if (!parsed.success) {\n fail(new ApiError(\"VALIDATION_ERROR\", parsed.error.issues[0]?.message ?? \"Invalid arguments\"));\n }\n try {\n const data = await apiPost<CustomMcpDisableResponse>(\"/api/mcp/custom/disable\", parsed.data);\n writeJson({\n ok: true,\n data,\n hints: [\n \"Its tools stop loading from the next message, and this applies right away — publishing or discarding this chat does not undo it. Tell the user they can turn it back on in Brain → Integrations → More apps.\",\n ],\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nexport const mcpCommand = defineCommand({\n meta: {\n name: \"mcp\",\n description: `Third-party tools for this company — see what's connected, register custom HTTPS MCP endpoints.\n\nTools from a registered server appear as mcp__<name>__* on the next message.\nManaged here are **company-scoped** servers; user- and org-scoped servers are managed in the dashboard.\n\nStart here:\n baker mcp connected # everything this chat can reach: managed integrations, custom servers, connected platforms\n baker mcp catalog --search notion # managed apps you can connect when a vendor has no MCP server of its own\n\nRun a connected app's read-only tool from the command line (JSON on stdout — for reports and scripts):\n baker mcp tools --app googlesheets --search \"read rows\"\n baker mcp execute --tool GOOGLESHEETS_BATCH_GET --get-schema\n baker mcp execute --tool GOOGLESHEETS_BATCH_GET --data '{\"spreadsheet_id\":\"…\",\"ranges\":[\"A1:D50\"]}'\n\nExamples:\n baker mcp add --name weather --url https://mcp.example.com/mcp\n baker mcp add --name acme --url https://acme.dev/mcp --header \"Authorization: Bearer sk-…\"\n baker mcp remove --name weather\n baker mcp verify --name weather # check it now after the user fixed it\n baker mcp disable --name weather # stop its tools loading (only a person turns it back on)\nFull guide: __tooling__/docs/tools/baker/mcp.md`,\n },\n subCommands: {\n connected: connectedCommand,\n catalog: catalogCommand,\n tools: toolsCommand,\n execute: executeCommand,\n list: listCommand,\n add: addCommand,\n remove: removeCommand,\n verify: verifyCommand,\n disable: disableCommand,\n },\n});\n","/**\n * What `baker mcp catalog` tells the agent to do next with the managed apps it\n * found — the fallback when a vendor publishes no MCP server of its own.\n */\nimport type { McpCatalogEntry } from \"@baker/api/mcp-catalog\";\n\nconst PREFER_VENDOR_HINT =\n 'The vendor\\'s own MCP server comes before any app here. If you have not yet, WebSearch \"<vendor> MCP server\" and WebFetch its official docs for the remote https address and how it signs in, then ask for it with request_connection `{ server: { name, url, auth, keyHeader } }`. Only when the vendor has none, ask for an app from this catalog with request_connection `{ app: \"<slug>\", reason }` — the user connects it in the chat and its tools load right after, in this same turn.';\n\nconst ALREADY_CONNECTED_HINT =\n \"An app marked connected is already reachable — use its mcp__composio_* tools; do not ask again.\";\n\nconst NO_MATCH_HINT =\n \"Nothing in the catalog matches. WebSearch for the vendor's official remote MCP server (its docs, its developer site) before telling the user it can't be connected — if one exists, ask for it with request_connection `{ server }`. Only when the web shows no official remote server either, say plainly this tool can't be connected yet and offer a Task.\";\n\n/** Baker's own connection always wins over a catalog app or anyone's MCP server for the same tool. */\nfunction firstPartyHint(platforms: readonly string[]): string {\n const asks = platforms.map((p) => `request_connection \\`{ platform: \"${p}\" }\\``).join(\" or \");\n return `This is one of Baker's own connections — ask for it with ${asks}. It is the one Baker's commands, staging and publish work with, so never connect it as a catalog app or as an MCP server, even one the vendor publishes or the user names. If it is already connected, read it with its own baker command family instead.`;\n}\n\n/** What the agent should do next with a catalog answer. */\nexport function catalogHints(\n apps: readonly McpCatalogEntry[],\n { platforms = [] }: { platforms?: readonly string[] } = {},\n): string[] {\n if (platforms.length > 0) {\n return [firstPartyHint(platforms)];\n }\n const hints = [PREFER_VENDOR_HINT];\n if (apps.some((a) => a.connected)) {\n hints.push(ALREADY_CONNECTED_HINT);\n }\n if (apps.length === 0) {\n hints.push(NO_MATCH_HINT);\n }\n return hints;\n}\n","/**\n * Contract for running a connected app's tools from the `baker` CLI —\n * `GET /api/mcp/tools` (find one), `GET /api/mcp/tool` (its inputs) and\n * `POST /api/mcp/execute` (run it).\n *\n * The same tools the chat reaches as `mcp__composio_*`, but answered as JSON on\n * stdout, so a Report's data endpoint can call one through `runBaker` and a\n * script can keep what it returned. Only tools the app marks read-only run here:\n * a published Report runs them for whoever opens it, and a chat stages every\n * change it makes until Publish.\n */\nimport { z } from \"zod\";\n\nexport const MCP_TOOLS_DEFAULT_LIMIT = 10;\nexport const MCP_TOOL_DESCRIPTION_MAX = 200;\n\n/** A Composio tool slug: `GMAIL_FETCH_EMAILS`, `GOOGLESHEETS_BATCH_GET`. */\nexport const mcpToolSlugSchema = z\n .string()\n .trim()\n .min(1, \"Provide --tool\")\n .max(120)\n .regex(/^[A-Za-z0-9_]+$/, \"A tool is named like GMAIL_FETCH_EMAILS — find one with `baker mcp tools --search`\")\n .transform((slug) => slug.toUpperCase());\n\n/** A toolkit slug as `baker mcp connected` lists it: `gmail`, `googlesheets`. */\nexport const mcpAppSlugSchema = z\n .string()\n .trim()\n .min(1)\n .max(60)\n .regex(/^[a-z0-9_-]+$/i, \"Name the app as `baker mcp connected` lists it, e.g. gmail\")\n .transform((slug) => slug.toLowerCase());\n\nexport const mcpToolsRequestSchema = z\n .object({\n search: z.string().trim().min(1).max(200).optional(),\n app: mcpAppSlugSchema.optional(),\n limit: z.coerce.number().int().min(1).max(50).default(MCP_TOOLS_DEFAULT_LIMIT),\n })\n .refine((request) => request.search !== undefined || request.app !== undefined, {\n message: \"Provide --search, --app, or both\",\n });\nexport type McpToolsRequest = z.infer<typeof mcpToolsRequestSchema>;\n\nexport const mcpToolSummarySchema = z.object({\n tool: z.string(),\n app: z.string(),\n name: z.string(),\n description: z.string().max(MCP_TOOL_DESCRIPTION_MAX),\n /** Only read-only tools run through `baker mcp execute`. */\n readOnly: z.boolean(),\n});\nexport type McpToolSummary = z.infer<typeof mcpToolSummarySchema>;\n\nexport const mcpToolsResponseSchema = z.object({\n tools: z.array(mcpToolSummarySchema),\n /** The connected apps the search ran over. */\n apps: z.array(z.string()),\n});\nexport type McpToolsResponse = z.infer<typeof mcpToolsResponseSchema>;\n\nexport const mcpToolRequestSchema = z.object({\n tool: mcpToolSlugSchema,\n full: z.boolean().default(false),\n});\n\n/** One input, folded to what the agent needs to fill it. */\nexport const mcpToolInputSchema = z.object({\n name: z.string(),\n type: z.string(),\n required: z.boolean(),\n description: z.string().optional(),\n enum: z.array(z.unknown()).optional(),\n default: z.unknown().optional(),\n});\nexport type McpToolInput = z.infer<typeof mcpToolInputSchema>;\n\nexport const mcpToolResponseSchema = z.object({\n tool: z.string(),\n app: z.string(),\n name: z.string(),\n description: z.string(),\n readOnly: z.boolean(),\n inputs: z.array(mcpToolInputSchema),\n /** The raw JSON schemas, with `--full` only. */\n inputSchema: z.unknown().optional(),\n outputSchema: z.unknown().optional(),\n});\nexport type McpToolResponse = z.infer<typeof mcpToolResponseSchema>;\n\nexport const mcpExecuteRequestSchema = z.object({\n tool: mcpToolSlugSchema,\n arguments: z.record(z.string(), z.unknown()).default({}),\n actingUserId: z.string().optional(),\n});\nexport type McpExecuteRequest = z.infer<typeof mcpExecuteRequestSchema>;\n\nexport const mcpExecuteResponseSchema = z.object({\n tool: z.string(),\n app: z.string(),\n /** Whose connection answered: `company` is the one a published Report reads. */\n scope: z.enum([\"user\", \"user_org\", \"company\", \"org\"]),\n account: z.string().nullable(),\n /** What the tool returned, as the app returned it. */\n data: z.unknown(),\n});\nexport type McpExecuteResponse = z.infer<typeof mcpExecuteResponseSchema>;\n","/**\n * `baker mcp tools` and `baker mcp execute`: a connected app's tools run from\n * the command line, so what they return is JSON on stdout — for a Report's data\n * endpoint (`runReportBaker`), a script, or a file — instead of a tool result\n * only the chat sees. The same tools as `mcp__composio_*`, reads only.\n */\nimport {\n type McpExecuteResponse,\n type McpToolResponse,\n type McpToolsResponse,\n mcpExecuteRequestSchema,\n mcpToolRequestSchema,\n mcpToolsRequestSchema,\n} from \"@baker/api/mcp-tools\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiGet, apiPost } from \"../../client.ts\";\nimport { getEnv } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\n\n/** A tool's run gets as long as a report gives one `baker` call, less its own margin. */\nconst EXECUTE_TIMEOUT_MS = 120_000;\n\nfunction fail(err: unknown): never {\n if (err instanceof ApiError) {\n writeJson({ ok: false, error: { code: err.code, message: err.message } });\n process.exit(1);\n }\n writeJson({ ok: false, error: { code: \"NETWORK_ERROR\", message: \"Unexpected error\" } });\n process.exit(1);\n}\n\nfunction invalid(message: string): never {\n return fail(new ApiError(\"VALIDATION_ERROR\", message));\n}\n\n/** The turn's message sender, injected by the bridge; the backend vouches for it, and a report has none. */\nfunction actingUserId(): string | undefined {\n return getEnv().BAKER_ACTING_USER_ID;\n}\n\n/** What to tell the agent after a run: above all, whether a published report will read the same thing. */\nexport function executeHints(ran: Pick<McpExecuteResponse, \"tool\" | \"app\" | \"scope\">): string[] {\n const hints: string[] = [];\n if (ran.scope !== \"company\") {\n hints.push(\n `This answer came from a ${ran.scope === \"org\" ? \"connection shared by the organization\" : \"connection of the person sending this message\"}. A published report reads only apps connected for the whole company, so ${ran.tool} will answer \"not connected\" there: ask the user to connect ${ran.app} for the whole company before building a report on it.`,\n );\n }\n hints.push(\n `In a report endpoint: runReportBaker(event, [\"mcp\", \"execute\", \"--tool\", \"${ran.tool}\", \"--data\", JSON.stringify(args)]) — return only the fields the page shows.`,\n );\n return hints;\n}\n\nconst toolsArgs = {\n search: {\n type: \"string\",\n description: 'What the tool should do, e.g. \"fetch emails\", \"read sheet rows\"',\n required: false,\n },\n app: {\n type: \"string\",\n description: \"Only this connected app, as `baker mcp connected` lists it (gmail)\",\n required: false,\n },\n limit: { type: \"string\", description: \"Max tools to return, 1-50 (default 10)\", required: false },\n} as const;\n\nregisterSchema({\n command: \"mcp.tools\",\n description:\n 'Find a connected app\\'s tools to run with `baker mcp execute`. Searches the apps this chat reaches (or --app). Each tool: tool (slug), app, name, description, readOnly (only read-only tools run). Example: baker mcp tools --app googlesheets --search \"read rows\"',\n args: toolsArgs,\n});\n\nexport const toolsCommand = defineCommand({\n meta: {\n name: \"tools\",\n description: `Find a connected app's tools to run from the command line with \\`baker mcp execute\\`.\n\nStart here:\n baker mcp tools --search \"fetch unread emails\" # across every connected app\n baker mcp tools --app googlesheets --search \"read rows\"\n baker mcp tools --app hubspot --limit 20 # an app's tools, no search\n\nEach tool: tool (the slug execute takes), app, name, description, readOnly.\nOnly readOnly tools run through execute; a tool that changes things is the chat's own mcp__composio_* tool.`,\n },\n args: toolsArgs,\n run: async ({ args }) => {\n const parsed = mcpToolsRequestSchema.safeParse({ search: args.search, app: args.app, limit: args.limit });\n if (!parsed.success) {\n invalid(parsed.error.issues[0]?.message ?? \"Invalid arguments\");\n }\n try {\n const user = actingUserId();\n const data = await apiGet<McpToolsResponse>(\"/api/mcp/tools\", {\n ...(parsed.data.search ? { search: parsed.data.search } : {}),\n ...(parsed.data.app ? { app: parsed.data.app } : {}),\n limit: String(parsed.data.limit),\n ...(user ? { actingUserId: user } : {}),\n });\n const hints =\n data.apps.length === 0\n ? [\n \"No app is connected here. Check `baker mcp connected`; connect one with request_connection, from the chat.\",\n ]\n : [\n \"Run one with `baker mcp execute --tool <TOOL> --get-schema` first to see its inputs, then `--data '<json>'`.\",\n ...(data.tools.some((tool) => !tool.readOnly)\n ? [\n \"readOnly: false tools cannot run through execute — they change things; use the chat's mcp__composio_* tool.\",\n ]\n : []),\n ];\n writeJson({ ok: true, data, hints });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst executeArgs = {\n tool: { type: \"string\", description: \"Tool slug from `baker mcp tools`, e.g. GMAIL_FETCH_EMAILS\", required: true },\n data: {\n type: \"string\",\n description: \"The tool's arguments as a JSON object, e.g. '{\\\"max_results\\\":10}'\",\n required: false,\n },\n \"get-schema\": { type: \"boolean\", description: \"Show the tool's inputs instead of running it\", required: false },\n full: {\n type: \"boolean\",\n description: \"With --get-schema: the raw input and output JSON schemas too\",\n required: false,\n },\n} as const;\n\nregisterSchema({\n command: \"mcp.execute\",\n description:\n 'Run one read-only tool of a connected app and print what it returned as JSON — for a report\\'s data endpoint, a script, or keeping the answer. `--get-schema` shows its inputs first. A published report reaches only apps connected for the whole company. Example: baker mcp execute --tool GOOGLESHEETS_BATCH_GET --data \\'{\"spreadsheet_id\":\"…\",\"ranges\":[\"A1:D50\"]}\\'',\n args: executeArgs,\n});\n\nfunction parseData(raw: unknown): Record<string, unknown> {\n if (raw === undefined || raw === \"\") {\n return {};\n }\n let value: unknown;\n try {\n value = JSON.parse(String(raw));\n } catch {\n invalid(`--data must be a JSON object, e.g. '{\"max_results\":10}' (keys and strings in double quotes).`);\n }\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n invalid(`--data must be a JSON object, e.g. '{\"max_results\":10}'.`);\n }\n return value as Record<string, unknown>;\n}\n\nexport const executeCommand = defineCommand({\n meta: {\n name: \"execute\",\n description: `Run one read-only tool of a connected app; prints what it returned as JSON.\n\nThe same tools as the chat's mcp__composio_* servers, answered on stdout so a report's data endpoint,\na script or a file can keep it. Find the tool with \\`baker mcp tools\\`, read its inputs, then run it:\n baker mcp execute --tool GOOGLESHEETS_BATCH_GET --get-schema\n baker mcp execute --tool GOOGLESHEETS_BATCH_GET --data '{\"spreadsheet_id\":\"1AbC…\",\"ranges\":[\"Sheet1!A1:D50\"]}'\n baker mcp execute --tool GMAIL_FETCH_EMAILS --data '{\"query\":\"is:unread newer_than:7d\",\"max_results\":20}' > /tmp/inbox.json\n\nReads only: a tool that changes things (send, create, update) is refused — use the chat's own tool for it.\nA published report runs as nobody, so it reaches only apps connected for the whole company; a\nperson's own connection answers in their chat and nowhere else.`,\n },\n args: executeArgs,\n run: async ({ args }) => {\n if (args[\"get-schema\"]) {\n const parsed = mcpToolRequestSchema.safeParse({ tool: args.tool, full: args.full === true });\n if (!parsed.success) {\n invalid(parsed.error.issues[0]?.message ?? \"Invalid arguments\");\n }\n try {\n const data = await apiGet<McpToolResponse>(\"/api/mcp/tool\", {\n tool: parsed.data.tool,\n ...(parsed.data.full ? { full: \"true\" } : {}),\n });\n writeJson({\n ok: true,\n data,\n hints: data.readOnly\n ? [`Run it: baker mcp execute --tool ${data.tool} --data '<json object of the inputs above>'`]\n : [\n `${data.tool} changes things, so execute refuses it. In a chat, use the app's own mcp__composio_* tool.`,\n ],\n });\n } catch (err) {\n fail(err);\n }\n return;\n }\n const parsed = mcpExecuteRequestSchema.safeParse({\n tool: args.tool,\n arguments: parseData(args.data),\n actingUserId: actingUserId(),\n });\n if (!parsed.success) {\n invalid(parsed.error.issues[0]?.message ?? \"Invalid arguments\");\n }\n try {\n const data = await apiPost<McpExecuteResponse>(\"/api/mcp/execute\", parsed.data, {\n timeoutMs: EXECUTE_TIMEOUT_MS,\n });\n writeJson({ ok: true, data, hints: executeHints(data) });\n } catch (err) {\n fail(err);\n }\n },\n});\n","/**\n * How a connected platform reads back to the agent.\n *\n * A platform (HubSpot, Google Ads, GA4, …) is an account the company signed in\n * to, reached through its own `baker` command family rather than an `mcp__*`\n * tool. It rides `mcp connected` because that is the one answer to \"what can\n * this chat reach\" — and because an agent that only saw the tool half had no\n * way to tell a working HubSpot connection from a missing one.\n */\n\nexport interface ConnectedPlatform {\n type: string;\n label: string;\n account: string | null;\n reads: string[];\n readsLabel: string | null;\n}\n\n/** \"Ad Accounts\" -> `adAccounts`, \"Properties\" -> `properties`. */\nfunction readsKey(label: string): string {\n const [first = \"\", ...rest] = label.split(\" \");\n return [first.toLowerCase(), ...rest].join(\"\");\n}\n\n/**\n * One platform as the agent sees it. The resources are keyed by the platform's\n * own word for them — `properties` for GA4, `containers` for Tag Manager,\n * `adAccounts` for the ad platforms — so what the agent reads back matches what\n * the user sees in the dashboard.\n */\nexport function platformEntry(platform: ConnectedPlatform): Record<string, unknown> {\n return {\n platform: platform.label,\n ...(platform.account ? { account: platform.account } : {}),\n ...(platform.readsLabel && platform.reads.length > 0 ? { [readsKey(platform.readsLabel)]: platform.reads } : {}),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAS,SAAS;AAEX,IAAM,4BAA4B;AAClC,IAAM,8BAA8B;AAEpC,IAAM,0BAA0B,EAAE,OAAO;AAAA,EAC9C,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,kBAAkB,EAAE,IAAI,GAAG;AAAA,EAC5D,OAAO,EAAE,OAAO,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,QAAQ,yBAAyB;AACjF,CAAC;AAGM,IAAM,0BAA0B,EAAE,KAAK,CAAC,WAAW,KAAK,CAAC;AAGzD,IAAM,wBAAwB,EAAE,OAAO;AAAA;AAAA,EAE5C,KAAK,EAAE,OAAO;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R,CAAC;AAED,IAAM,iBAAiBC,eAAc;AAAA,EACnC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA;AAAA;AAAA;AAAA,EAIf;AAAA,EACA,MAAM;AAAA,EACN,KAAK,OAAO,EAAE,KAAK,MAAM;AACvB,UAAM,SAAS,iCAAiC,UAAU,EAAE,MAAM,KAAK,MAAM,cAAcF,cAAa,EAAE,CAAC;AAC3G,QAAI,CAAC,OAAO,SAAS;AACnB,MAAAC,MAAK,IAAI,SAAS,oBAAoB,OAAO,MAAM,OAAO,CAAC,GAAG,WAAW,mBAAmB,CAAC;AAAA,IAC/F;AACA,QAAI;AACF,YAAM,OAAO,MAAM,QAAkC,2BAA2B,OAAO,IAAI;AAC3F,gBAAU;AAAA,QACR,IAAI;AAAA,QACJ;AAAA,QACA,OAAO;AAAA,UACL;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,SAAS,KAAK;AACZ,MAAAA,MAAK,GAAG;AAAA,IACV;AAAA,EACF;AACF,CAAC;AAEM,IAAM,aAAaC,eAAc;AAAA,EACtC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBf;AAAA,EACA,aAAa;AAAA,IACX,WAAW;AAAA,IACX,SAAS;AAAA,IACT,OAAO;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,IACN,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AACF,CAAC;","names":["defineCommand","z","parsed","actingUserId","fail","defineCommand"]}
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
failApi,
|
|
3
3
|
failValidation,
|
|
4
4
|
isTempScheduledAgentId
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-DVA4DOBH.js";
|
|
6
|
+
import "./chunk-LCMIAWUZ.js";
|
|
7
7
|
import "./chunk-FRK7SSEH.js";
|
|
8
8
|
import "./chunk-GXDLWBOY.js";
|
|
9
9
|
import "./chunk-GIWHHCD6.js";
|
|
@@ -63,4 +63,4 @@ var runCommand = defineCommand({
|
|
|
63
63
|
export {
|
|
64
64
|
runCommand
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=run-
|
|
66
|
+
//# sourceMappingURL=run-IKGW7UPB.js.map
|