@apex-inc/mcp-server 0.64.1 → 0.65.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/dist/tool-groups.d.ts.map +1 -1
- package/dist/tool-groups.js +7 -0
- package/dist/tool-groups.js.map +1 -1
- package/dist/tool-shared.d.ts +13 -0
- package/dist/tool-shared.d.ts.map +1 -1
- package/dist/tool-shared.js.map +1 -1
- package/dist/tools/experiments.d.ts +26 -18
- package/dist/tools/experiments.d.ts.map +1 -1
- package/dist/tools/experiments.js +76 -5
- package/dist/tools/experiments.js.map +1 -1
- package/dist/tools/letters.d.ts +99 -3
- package/dist/tools/letters.d.ts.map +1 -1
- package/dist/tools/letters.js +83 -3
- package/dist/tools/letters.js.map +1 -1
- package/dist/tools/measurement.d.ts +6 -2
- package/dist/tools/measurement.d.ts.map +1 -1
- package/dist/tools/measurement.js +40 -14
- package/dist/tools/measurement.js.map +1 -1
- package/dist/tools/people.d.ts +99 -0
- package/dist/tools/people.d.ts.map +1 -0
- package/dist/tools/people.js +245 -0
- package/dist/tools/people.js.map +1 -0
- package/dist/tools.d.ts +240 -23
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +2 -0
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
- package/skills/apex-experimentation/SKILL.md +12 -0
- package/skills/apex-integration-cookbook/SKILL.md +1 -1
- package/skills/apex-setup/SKILL.md +1 -1
package/dist/tools/letters.d.ts
CHANGED
|
@@ -168,6 +168,94 @@ export declare const letterTools: {
|
|
|
168
168
|
}[];
|
|
169
169
|
}>;
|
|
170
170
|
};
|
|
171
|
+
list_email_categories: {
|
|
172
|
+
description: string;
|
|
173
|
+
schema: z.ZodObject<{
|
|
174
|
+
includeArchived: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
+
}, "strip", z.ZodTypeAny, {
|
|
176
|
+
includeArchived?: boolean | undefined;
|
|
177
|
+
}, {
|
|
178
|
+
includeArchived?: boolean | undefined;
|
|
179
|
+
}>;
|
|
180
|
+
handler: (args: {
|
|
181
|
+
includeArchived?: boolean;
|
|
182
|
+
}) => Promise<{
|
|
183
|
+
content: {
|
|
184
|
+
type: "text";
|
|
185
|
+
text: string;
|
|
186
|
+
}[];
|
|
187
|
+
}>;
|
|
188
|
+
};
|
|
189
|
+
create_email_category: {
|
|
190
|
+
description: string;
|
|
191
|
+
schema: z.ZodObject<{
|
|
192
|
+
name: z.ZodString;
|
|
193
|
+
description: z.ZodOptional<z.ZodString>;
|
|
194
|
+
}, "strip", z.ZodTypeAny, {
|
|
195
|
+
name: string;
|
|
196
|
+
description?: string | undefined;
|
|
197
|
+
}, {
|
|
198
|
+
name: string;
|
|
199
|
+
description?: string | undefined;
|
|
200
|
+
}>;
|
|
201
|
+
handler: (args: {
|
|
202
|
+
name: string;
|
|
203
|
+
description?: string;
|
|
204
|
+
}) => Promise<{
|
|
205
|
+
content: {
|
|
206
|
+
type: "text";
|
|
207
|
+
text: string;
|
|
208
|
+
}[];
|
|
209
|
+
}>;
|
|
210
|
+
};
|
|
211
|
+
update_email_category: {
|
|
212
|
+
description: string;
|
|
213
|
+
schema: z.ZodObject<{
|
|
214
|
+
categoryId: z.ZodString;
|
|
215
|
+
name: z.ZodOptional<z.ZodString>;
|
|
216
|
+
description: z.ZodOptional<z.ZodString>;
|
|
217
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
218
|
+
}, "strip", z.ZodTypeAny, {
|
|
219
|
+
categoryId: string;
|
|
220
|
+
name?: string | undefined;
|
|
221
|
+
description?: string | undefined;
|
|
222
|
+
archived?: boolean | undefined;
|
|
223
|
+
}, {
|
|
224
|
+
categoryId: string;
|
|
225
|
+
name?: string | undefined;
|
|
226
|
+
description?: string | undefined;
|
|
227
|
+
archived?: boolean | undefined;
|
|
228
|
+
}>;
|
|
229
|
+
handler: (args: {
|
|
230
|
+
categoryId: string;
|
|
231
|
+
name?: string;
|
|
232
|
+
description?: string;
|
|
233
|
+
archived?: boolean;
|
|
234
|
+
}) => Promise<{
|
|
235
|
+
content: {
|
|
236
|
+
type: "text";
|
|
237
|
+
text: string;
|
|
238
|
+
}[];
|
|
239
|
+
}>;
|
|
240
|
+
};
|
|
241
|
+
archive_email_category: {
|
|
242
|
+
description: string;
|
|
243
|
+
schema: z.ZodObject<{
|
|
244
|
+
categoryId: z.ZodString;
|
|
245
|
+
}, "strip", z.ZodTypeAny, {
|
|
246
|
+
categoryId: string;
|
|
247
|
+
}, {
|
|
248
|
+
categoryId: string;
|
|
249
|
+
}>;
|
|
250
|
+
handler: (args: {
|
|
251
|
+
categoryId: string;
|
|
252
|
+
}) => Promise<{
|
|
253
|
+
content: {
|
|
254
|
+
type: "text";
|
|
255
|
+
text: string;
|
|
256
|
+
}[];
|
|
257
|
+
}>;
|
|
258
|
+
};
|
|
171
259
|
edit_communication: {
|
|
172
260
|
description: string;
|
|
173
261
|
schema: z.ZodObject<{
|
|
@@ -236,12 +324,14 @@ export declare const letterTools: {
|
|
|
236
324
|
audience_bucket: z.ZodOptional<z.ZodEnum<["production", "beta", "dev"]>>;
|
|
237
325
|
intent: z.ZodOptional<z.ZodEnum<["compete", "replace"]>>;
|
|
238
326
|
confirmLiveExperiment: z.ZodOptional<z.ZodBoolean>;
|
|
327
|
+
categoryId: z.ZodOptional<z.ZodString>;
|
|
239
328
|
}, "strip", z.ZodTypeAny, {
|
|
240
329
|
communicationId: string;
|
|
241
330
|
channels?: string[] | undefined;
|
|
242
331
|
status?: "active" | "draft" | "paused" | undefined;
|
|
243
332
|
subject?: string | undefined;
|
|
244
333
|
intent?: "replace" | "compete" | undefined;
|
|
334
|
+
categoryId?: string | undefined;
|
|
245
335
|
slots?: Record<string, string> | undefined;
|
|
246
336
|
blocks?: {
|
|
247
337
|
type: "text" | "heading" | "image" | "button" | "html" | "spacer" | "divider" | "keep";
|
|
@@ -272,6 +362,7 @@ export declare const letterTools: {
|
|
|
272
362
|
status?: "active" | "draft" | "paused" | undefined;
|
|
273
363
|
subject?: string | undefined;
|
|
274
364
|
intent?: "replace" | "compete" | undefined;
|
|
365
|
+
categoryId?: string | undefined;
|
|
275
366
|
slots?: Record<string, string> | undefined;
|
|
276
367
|
blocks?: {
|
|
277
368
|
type: "text" | "heading" | "image" | "button" | "html" | "spacer" | "divider" | "keep";
|
|
@@ -309,6 +400,7 @@ export declare const letterTools: {
|
|
|
309
400
|
audience_bucket?: "production" | "beta" | "dev";
|
|
310
401
|
intent?: "compete" | "replace";
|
|
311
402
|
confirmLiveExperiment?: boolean;
|
|
403
|
+
categoryId?: string;
|
|
312
404
|
}) => Promise<{
|
|
313
405
|
content: {
|
|
314
406
|
type: "text";
|
|
@@ -364,8 +456,8 @@ export declare const letterTools: {
|
|
|
364
456
|
communicationId: string;
|
|
365
457
|
hypothesis?: string | undefined;
|
|
366
458
|
intent?: "replace" | "compete" | undefined;
|
|
367
|
-
beliefId?: string | undefined;
|
|
368
459
|
confidence?: number | undefined;
|
|
460
|
+
beliefId?: string | undefined;
|
|
369
461
|
durationDays?: number | undefined;
|
|
370
462
|
confirmLiveExperiment?: boolean | undefined;
|
|
371
463
|
hostJourneyId?: string | undefined;
|
|
@@ -374,8 +466,8 @@ export declare const letterTools: {
|
|
|
374
466
|
communicationId: string;
|
|
375
467
|
hypothesis?: string | undefined;
|
|
376
468
|
intent?: "replace" | "compete" | undefined;
|
|
377
|
-
beliefId?: string | undefined;
|
|
378
469
|
confidence?: number | undefined;
|
|
470
|
+
beliefId?: string | undefined;
|
|
379
471
|
durationDays?: number | undefined;
|
|
380
472
|
confirmLiveExperiment?: boolean | undefined;
|
|
381
473
|
hostJourneyId?: string | undefined;
|
|
@@ -1119,19 +1211,23 @@ export declare const letterTools: {
|
|
|
1119
1211
|
title: z.ZodOptional<z.ZodString>;
|
|
1120
1212
|
channels: z.ZodOptional<z.ZodArray<z.ZodEnum<["email", "in_app_push", "mobile_push"]>, "many">>;
|
|
1121
1213
|
audience_bucket: z.ZodOptional<z.ZodEnum<["production", "beta", "dev"]>>;
|
|
1214
|
+
categoryId: z.ZodOptional<z.ZodString>;
|
|
1122
1215
|
}, "strip", z.ZodTypeAny, {
|
|
1123
1216
|
channels?: ("email" | "mobile_push" | "in_app_push")[] | undefined;
|
|
1124
1217
|
title?: string | undefined;
|
|
1218
|
+
categoryId?: string | undefined;
|
|
1125
1219
|
audience_bucket?: "production" | "beta" | "dev" | undefined;
|
|
1126
1220
|
}, {
|
|
1127
1221
|
channels?: ("email" | "mobile_push" | "in_app_push")[] | undefined;
|
|
1128
1222
|
title?: string | undefined;
|
|
1223
|
+
categoryId?: string | undefined;
|
|
1129
1224
|
audience_bucket?: "production" | "beta" | "dev" | undefined;
|
|
1130
1225
|
}>;
|
|
1131
|
-
handler: ({ title, channels, audience_bucket }: {
|
|
1226
|
+
handler: ({ title, channels, audience_bucket, categoryId, }: {
|
|
1132
1227
|
title?: string;
|
|
1133
1228
|
channels?: string[];
|
|
1134
1229
|
audience_bucket?: "production" | "beta" | "dev";
|
|
1230
|
+
categoryId?: string;
|
|
1135
1231
|
}) => Promise<{
|
|
1136
1232
|
content: {
|
|
1137
1233
|
type: "text";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"letters.d.ts","sourceRoot":"","sources":["../../src/tools/letters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"letters.d.ts","sourceRoot":"","sources":["../../src/tools/letters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,OAAO,EAAsE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEhI,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,8BAA8B,CAAC;AAoDtC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;wBAeE;YAAE,eAAe,EAAE,MAAM,EAAE,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;wBAgC7B;YACpB,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AAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwCnD;YACpB,IAAI,EAAE,MAAM,CAAC;YACb,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,KAAK,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC;YAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;YACrB,SAAS,CAAC,EAAE,OAAO,CAAC;SACrB;;;;;;;CAcJ,CAAC"}
|
package/dist/tools/letters.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { apiGet, apiPost, apiPatch, apiDelete, getActiveWorkspace, } from "../api-client.js";
|
|
2
|
+
import { apiGet, apiPost, apiPatch, apiDelete, apiDeleteJson, getActiveWorkspace, } from "../api-client.js";
|
|
3
3
|
import { controlGateGuidanceFor } from "../control-gate-guidance.js";
|
|
4
4
|
import { notStartedExplanation, publishedExperimentLine } from "../publish-communication-copy.js";
|
|
5
5
|
import { applyAddJourneyStep } from "../add-journey-step.js";
|
|
@@ -222,6 +222,69 @@ export const letterTools = {
|
|
|
222
222
|
};
|
|
223
223
|
},
|
|
224
224
|
},
|
|
225
|
+
list_email_categories: {
|
|
226
|
+
description: "List optional marketing email categories in the active workspace. Workspaces with zero categories share one unsubscribe list; once categories exist, one-click unsubscribe stops only that category and every published marketing message picks an active category.",
|
|
227
|
+
schema: z.object({
|
|
228
|
+
includeArchived: z.boolean().optional().describe("Include archived categories"),
|
|
229
|
+
}),
|
|
230
|
+
handler: async (args) => {
|
|
231
|
+
const qs = args.includeArchived ? "?includeArchived=true" : "";
|
|
232
|
+
const json = await apiGet(`/api/communications/categories${qs}`);
|
|
233
|
+
return {
|
|
234
|
+
content: [{ type: "text", text: JSON.stringify(json, null, 2) }],
|
|
235
|
+
};
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
create_email_category: {
|
|
239
|
+
description: "Create a marketing email category (e.g. Product updates, Promotions). Once a workspace has at least one active category, recipients see topic toggles instead of internal journey names on the preferences page, and one-click unsubscribe stops only that category.",
|
|
240
|
+
schema: z.object({
|
|
241
|
+
name: z.string().describe("Category display name shown to recipients"),
|
|
242
|
+
description: z
|
|
243
|
+
.string()
|
|
244
|
+
.optional()
|
|
245
|
+
.describe("Short description shown on the preferences page"),
|
|
246
|
+
}),
|
|
247
|
+
handler: async (args) => {
|
|
248
|
+
const json = await apiPost("/api/communications/categories", {
|
|
249
|
+
name: args.name,
|
|
250
|
+
...(args.description !== undefined ? { description: args.description } : {}),
|
|
251
|
+
});
|
|
252
|
+
return {
|
|
253
|
+
content: [{ type: "text", text: JSON.stringify(json, null, 2) }],
|
|
254
|
+
};
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
update_email_category: {
|
|
258
|
+
description: "Rename, edit the description of, or restore an archived marketing email category.",
|
|
259
|
+
schema: z.object({
|
|
260
|
+
categoryId: z.string().describe("The email category ID"),
|
|
261
|
+
name: z.string().optional().describe("New category display name"),
|
|
262
|
+
description: z.string().optional().describe("Updated description (empty string clears it)"),
|
|
263
|
+
archived: z.boolean().optional().describe("Set false to restore an archived category"),
|
|
264
|
+
}),
|
|
265
|
+
handler: async (args) => {
|
|
266
|
+
const json = await apiPatch(`/api/communications/categories/${encodeURIComponent(args.categoryId)}`, {
|
|
267
|
+
...(args.name !== undefined ? { name: args.name } : {}),
|
|
268
|
+
...(args.description !== undefined ? { description: args.description } : {}),
|
|
269
|
+
...(args.archived !== undefined ? { archived: args.archived } : {}),
|
|
270
|
+
});
|
|
271
|
+
return {
|
|
272
|
+
content: [{ type: "text", text: JSON.stringify(json, null, 2) }],
|
|
273
|
+
};
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
archive_email_category: {
|
|
277
|
+
description: "Archive a marketing email category. Archived categories cannot be selected on new marketing sends and are hidden from the preferences page, while existing opt-outs remain honored.",
|
|
278
|
+
schema: z.object({
|
|
279
|
+
categoryId: z.string().describe("The email category ID to archive"),
|
|
280
|
+
}),
|
|
281
|
+
handler: async (args) => {
|
|
282
|
+
const json = await apiDeleteJson(`/api/communications/categories/${encodeURIComponent(args.categoryId)}`);
|
|
283
|
+
return {
|
|
284
|
+
content: [{ type: "text", text: JSON.stringify(json, null, 2) }],
|
|
285
|
+
};
|
|
286
|
+
},
|
|
287
|
+
},
|
|
225
288
|
edit_communication: {
|
|
226
289
|
description: "Update a communication's subject, body, CTA, channels, or status. Pass the communication ID and the fields to update. For blank/builder comms, the headline/body/ctaLabel/ctaUrl slots are synced into the rendered email body — verify with preview_communication.\n\nA communication's Control is protected when it won an experiment or a published journey is sending it. Editing it then requires `intent`: \"compete\" adds your edit as a variant and measures it against the current content (nothing changes for recipients yet); \"replace\" makes your edit what everyone receives and supersedes any prior win. WHEN IN DOUBT, USE \"compete\" — it is recoverable, \"replace\" discards a measured result permanently. The server returns 409 intent_required with both options if you omit it.",
|
|
227
290
|
schema: z.object({
|
|
@@ -251,6 +314,10 @@ export const letterTools = {
|
|
|
251
314
|
.boolean()
|
|
252
315
|
.optional()
|
|
253
316
|
.describe("Edit a communication that is the treatment in a RUNNING experiment. Marks the numbers untrustworthy: we will not call a winner and we will not learn from mixed counts. Only pass true when they picked an out."),
|
|
317
|
+
categoryId: z
|
|
318
|
+
.string()
|
|
319
|
+
.optional()
|
|
320
|
+
.describe("Optional marketing email category ID (`cat_...`). Required before publishing when the workspace defines email categories; pass empty string to clear."),
|
|
254
321
|
}),
|
|
255
322
|
handler: async (args) => {
|
|
256
323
|
const guard = await refuseLiveApexObject({
|
|
@@ -272,6 +339,8 @@ export const letterTools = {
|
|
|
272
339
|
body.intent = args.intent;
|
|
273
340
|
if (args.confirmLiveExperiment)
|
|
274
341
|
body.confirmLiveExperiment = true;
|
|
342
|
+
if (args.categoryId !== undefined)
|
|
343
|
+
body.categoryId = args.categoryId;
|
|
275
344
|
const content = {};
|
|
276
345
|
if (args.subject)
|
|
277
346
|
content.subject = args.subject;
|
|
@@ -1400,12 +1469,23 @@ export const letterTools = {
|
|
|
1400
1469
|
.enum(["production", "beta", "dev"])
|
|
1401
1470
|
.optional()
|
|
1402
1471
|
.describe("Who this send is for. Default production. Never All or Unclassified."),
|
|
1472
|
+
categoryId: z
|
|
1473
|
+
.string()
|
|
1474
|
+
.optional()
|
|
1475
|
+
.describe("Optional marketing email category ID (`cat_...`) from list_email_categories."),
|
|
1403
1476
|
}),
|
|
1404
|
-
handler: async ({ title, channels, audience_bucket }) => {
|
|
1477
|
+
handler: async ({ title, channels, audience_bucket, categoryId, }) => {
|
|
1405
1478
|
try {
|
|
1406
1479
|
const comm = await apiPost("/api/communications/blank", { title, channels });
|
|
1480
|
+
const patch = {};
|
|
1407
1481
|
if (audience_bucket && audience_bucket !== "production") {
|
|
1408
|
-
|
|
1482
|
+
patch.audienceBucket = audience_bucket;
|
|
1483
|
+
}
|
|
1484
|
+
if (categoryId !== undefined && categoryId.trim()) {
|
|
1485
|
+
patch.categoryId = categoryId.trim();
|
|
1486
|
+
}
|
|
1487
|
+
if (Object.keys(patch).length > 0) {
|
|
1488
|
+
await apiPatch(`/api/communications/${comm.id}`, patch);
|
|
1409
1489
|
}
|
|
1410
1490
|
if (!tenantOk(comm.workspaceKey))
|
|
1411
1491
|
return tenantMismatch();
|