@apex-inc/mcp-server 0.68.0 → 0.70.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/api-client.d.ts +15 -0
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +30 -0
- package/dist/api-client.js.map +1 -1
- package/dist/letter-blocks.d.ts +2 -2
- package/dist/setup-catchup-tools.d.ts +40 -12
- package/dist/setup-catchup-tools.d.ts.map +1 -1
- package/dist/setup-catchup-tools.js +72 -13
- package/dist/setup-catchup-tools.js.map +1 -1
- package/dist/smoke-tools.d.ts.map +1 -1
- package/dist/smoke-tools.js +13 -0
- package/dist/smoke-tools.js.map +1 -1
- package/dist/tool-groups.d.ts.map +1 -1
- package/dist/tool-groups.js +1 -0
- package/dist/tool-groups.js.map +1 -1
- package/dist/tools/letters.d.ts +28 -20
- package/dist/tools/letters.d.ts.map +1 -1
- package/dist/tools/letters.js +45 -29
- package/dist/tools/letters.js.map +1 -1
- package/dist/tools/measurement.d.ts +37 -2
- package/dist/tools/measurement.d.ts.map +1 -1
- package/dist/tools/measurement.js +87 -11
- package/dist/tools/measurement.js.map +1 -1
- package/dist/tools/partners.d.ts +12 -4
- package/dist/tools/partners.d.ts.map +1 -1
- package/dist/tools/partners.js +27 -5
- package/dist/tools/partners.js.map +1 -1
- package/dist/tools.d.ts +119 -38
- package/dist/tools.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/apex-growth-tracking/SKILL.md +1 -1
- package/skills/apex-integration-cookbook/SKILL.md +6 -5
- package/skills/apex-setup/SKILL.md +4 -1
|
@@ -293,6 +293,7 @@ export declare const measurementTools: {
|
|
|
293
293
|
description: z.ZodOptional<z.ZodString>;
|
|
294
294
|
template: z.ZodOptional<z.ZodString>;
|
|
295
295
|
position: z.ZodOptional<z.ZodNumber>;
|
|
296
|
+
funnelRole: z.ZodOptional<z.ZodEnum<["stage", "off_ramp", "return", "milestone"]>>;
|
|
296
297
|
}, "strip", z.ZodTypeAny, {
|
|
297
298
|
name: string;
|
|
298
299
|
sources: {
|
|
@@ -312,6 +313,7 @@ export declare const measurementTools: {
|
|
|
312
313
|
template?: string | undefined;
|
|
313
314
|
category?: "other" | "engagement" | "referral" | "purchase" | "lead" | "qualified_lead" | "activation" | "signup" | "subscribe" | "add_to_cart" | "expansion" | "completion" | "retention" | "advocacy" | "churn" | undefined;
|
|
314
315
|
entityScope?: "account" | "person" | undefined;
|
|
316
|
+
funnelRole?: "milestone" | "stage" | "off_ramp" | "return" | undefined;
|
|
315
317
|
}, {
|
|
316
318
|
name: string;
|
|
317
319
|
sources: {
|
|
@@ -331,6 +333,7 @@ export declare const measurementTools: {
|
|
|
331
333
|
template?: string | undefined;
|
|
332
334
|
category?: "other" | "engagement" | "referral" | "purchase" | "lead" | "qualified_lead" | "activation" | "signup" | "subscribe" | "add_to_cart" | "expansion" | "completion" | "retention" | "advocacy" | "churn" | undefined;
|
|
333
335
|
entityScope?: "account" | "person" | undefined;
|
|
336
|
+
funnelRole?: "milestone" | "stage" | "off_ramp" | "return" | undefined;
|
|
334
337
|
}>;
|
|
335
338
|
handler: (args: {
|
|
336
339
|
name: string;
|
|
@@ -340,6 +343,7 @@ export declare const measurementTools: {
|
|
|
340
343
|
description?: string;
|
|
341
344
|
template?: string;
|
|
342
345
|
position?: number;
|
|
346
|
+
funnelRole?: "stage" | "off_ramp" | "return" | "milestone";
|
|
343
347
|
}) => Promise<{
|
|
344
348
|
isError?: boolean | undefined;
|
|
345
349
|
content: {
|
|
@@ -399,6 +403,7 @@ export declare const measurementTools: {
|
|
|
399
403
|
entityScope: z.ZodOptional<z.ZodEnum<["person", "account"]>>;
|
|
400
404
|
description: z.ZodOptional<z.ZodString>;
|
|
401
405
|
position: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
406
|
+
funnelRole: z.ZodOptional<z.ZodNullable<z.ZodEnum<["stage", "off_ramp", "return", "milestone"]>>>;
|
|
402
407
|
isCurrentGoal: z.ZodOptional<z.ZodLiteral<true>>;
|
|
403
408
|
}, "strip", z.ZodTypeAny, {
|
|
404
409
|
keyEventId: string;
|
|
@@ -419,6 +424,7 @@ export declare const measurementTools: {
|
|
|
419
424
|
}[] | undefined;
|
|
420
425
|
category?: "other" | "engagement" | "referral" | "purchase" | "lead" | "qualified_lead" | "activation" | "signup" | "subscribe" | "add_to_cart" | "expansion" | "completion" | "retention" | "advocacy" | "churn" | undefined;
|
|
421
426
|
entityScope?: "account" | "person" | undefined;
|
|
427
|
+
funnelRole?: "milestone" | "stage" | "off_ramp" | "return" | null | undefined;
|
|
422
428
|
isCurrentGoal?: true | undefined;
|
|
423
429
|
}, {
|
|
424
430
|
keyEventId: string;
|
|
@@ -439,6 +445,7 @@ export declare const measurementTools: {
|
|
|
439
445
|
}[] | undefined;
|
|
440
446
|
category?: "other" | "engagement" | "referral" | "purchase" | "lead" | "qualified_lead" | "activation" | "signup" | "subscribe" | "add_to_cart" | "expansion" | "completion" | "retention" | "advocacy" | "churn" | undefined;
|
|
441
447
|
entityScope?: "account" | "person" | undefined;
|
|
448
|
+
funnelRole?: "milestone" | "stage" | "off_ramp" | "return" | null | undefined;
|
|
442
449
|
isCurrentGoal?: true | undefined;
|
|
443
450
|
}>;
|
|
444
451
|
handler: (args: {
|
|
@@ -449,6 +456,7 @@ export declare const measurementTools: {
|
|
|
449
456
|
entityScope?: string;
|
|
450
457
|
description?: string;
|
|
451
458
|
position?: number | null;
|
|
459
|
+
funnelRole?: "stage" | "off_ramp" | "return" | "milestone" | null;
|
|
452
460
|
isCurrentGoal?: true;
|
|
453
461
|
}) => Promise<{
|
|
454
462
|
isError?: boolean | undefined;
|
|
@@ -663,22 +671,26 @@ export declare const measurementTools: {
|
|
|
663
671
|
suggestionId: z.ZodString;
|
|
664
672
|
name: z.ZodOptional<z.ZodString>;
|
|
665
673
|
events: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
674
|
+
keepRestOpen: z.ZodOptional<z.ZodBoolean>;
|
|
666
675
|
keepKeyEventId: z.ZodOptional<z.ZodString>;
|
|
667
676
|
}, "strip", z.ZodTypeAny, {
|
|
668
677
|
suggestionId: string;
|
|
669
678
|
name?: string | undefined;
|
|
670
679
|
events?: string[] | undefined;
|
|
680
|
+
keepRestOpen?: boolean | undefined;
|
|
671
681
|
keepKeyEventId?: string | undefined;
|
|
672
682
|
}, {
|
|
673
683
|
suggestionId: string;
|
|
674
684
|
name?: string | undefined;
|
|
675
685
|
events?: string[] | undefined;
|
|
686
|
+
keepRestOpen?: boolean | undefined;
|
|
676
687
|
keepKeyEventId?: string | undefined;
|
|
677
688
|
}>;
|
|
678
689
|
handler: (args: {
|
|
679
690
|
suggestionId: string;
|
|
680
691
|
name?: string;
|
|
681
692
|
events?: string[];
|
|
693
|
+
keepRestOpen?: boolean;
|
|
682
694
|
keepKeyEventId?: string;
|
|
683
695
|
}) => Promise<{
|
|
684
696
|
isError?: boolean | undefined;
|
|
@@ -689,6 +701,29 @@ export declare const measurementTools: {
|
|
|
689
701
|
}>;
|
|
690
702
|
};
|
|
691
703
|
dismiss_key_event_suggestion: {
|
|
704
|
+
description: string;
|
|
705
|
+
schema: z.ZodObject<{
|
|
706
|
+
suggestionId: z.ZodString;
|
|
707
|
+
events: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
708
|
+
}, "strip", z.ZodTypeAny, {
|
|
709
|
+
suggestionId: string;
|
|
710
|
+
events?: string[] | undefined;
|
|
711
|
+
}, {
|
|
712
|
+
suggestionId: string;
|
|
713
|
+
events?: string[] | undefined;
|
|
714
|
+
}>;
|
|
715
|
+
handler: ({ suggestionId, events }: {
|
|
716
|
+
suggestionId: string;
|
|
717
|
+
events?: string[];
|
|
718
|
+
}) => Promise<{
|
|
719
|
+
isError?: boolean | undefined;
|
|
720
|
+
content: {
|
|
721
|
+
type: "text";
|
|
722
|
+
text: string;
|
|
723
|
+
}[];
|
|
724
|
+
}>;
|
|
725
|
+
};
|
|
726
|
+
undo_key_event_suggestion: {
|
|
692
727
|
description: string;
|
|
693
728
|
schema: z.ZodObject<{
|
|
694
729
|
suggestionId: z.ZodString;
|
|
@@ -1045,8 +1080,8 @@ export declare const measurementTools: {
|
|
|
1045
1080
|
}, "strip", z.ZodTypeAny, {
|
|
1046
1081
|
type: string;
|
|
1047
1082
|
email?: string | undefined;
|
|
1048
|
-
environment?: "production" | "beta" | "dev" | undefined;
|
|
1049
1083
|
data?: Record<string, unknown> | undefined;
|
|
1084
|
+
environment?: "production" | "beta" | "dev" | undefined;
|
|
1050
1085
|
visitorId?: string | undefined;
|
|
1051
1086
|
consent?: "denied" | "granted" | undefined;
|
|
1052
1087
|
country?: string | undefined;
|
|
@@ -1056,8 +1091,8 @@ export declare const measurementTools: {
|
|
|
1056
1091
|
}, {
|
|
1057
1092
|
type: string;
|
|
1058
1093
|
email?: string | undefined;
|
|
1059
|
-
environment?: "production" | "beta" | "dev" | undefined;
|
|
1060
1094
|
data?: Record<string, unknown> | undefined;
|
|
1095
|
+
environment?: "production" | "beta" | "dev" | undefined;
|
|
1061
1096
|
visitorId?: string | undefined;
|
|
1062
1097
|
consent?: "denied" | "granted" | undefined;
|
|
1063
1098
|
country?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measurement.d.ts","sourceRoot":"","sources":["../../src/tools/measurement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyCxB,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYxB,CAAC;AAEH,KAAK,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"measurement.d.ts","sourceRoot":"","sources":["../../src/tools/measurement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyCxB,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;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,EAAE,MAAM,CAAC;YACnB,SAAS,CAAC,EAAE,OAAO,CAAC;SACrB;;;;;;;;;;;;;;;;oCA8BiC;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;wBA2BpC;YACpB,MAAM,EAAE,MAAM,CAAC;YACf,MAAM,EAAE,MAAM,CAAC;YACf,QAAQ,EAAE,MAAM,CAAC;YACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;SAC7B;;;;;;;CAyBJ,CAAC"}
|
|
@@ -57,9 +57,17 @@ async function revenueOverlapNoteFor(category) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
function keyEventLine(k, i) {
|
|
60
|
+
const roleTag = k.funnelRole === "off_ramp"
|
|
61
|
+
? "off-ramp"
|
|
62
|
+
: k.funnelRole === "return"
|
|
63
|
+
? "win-back"
|
|
64
|
+
: k.funnelRole === "milestone"
|
|
65
|
+
? "milestone"
|
|
66
|
+
: null;
|
|
60
67
|
const tags = [
|
|
61
68
|
k.archivedAt ? `archived ${k.archivedAt.slice(0, 10)}` : null,
|
|
62
69
|
k.isCurrentGoal && !k.archivedAt ? "main goal" : null,
|
|
70
|
+
roleTag,
|
|
63
71
|
k.entityScope === "account" ? "counts companies" : null,
|
|
64
72
|
k.definitionVersion > 1 ? `v${k.definitionVersion}` : null,
|
|
65
73
|
].filter(Boolean);
|
|
@@ -102,9 +110,10 @@ function keyEventSuggestionLines(s, nameOf) {
|
|
|
102
110
|
: s.events.length > 1
|
|
103
111
|
? `Make "${s.name}" a key event, reached by ${s.events.join(", ")}`
|
|
104
112
|
: `Make "${s.name}" a key event, reached by ${s.events[0]}`;
|
|
113
|
+
const autoNote = s.autoSetup ? " Ready for automatic setup." : "";
|
|
105
114
|
return [
|
|
106
115
|
` ${what}`,
|
|
107
|
-
` suggestion_id ${s.id}. ${sureWords(s.confidence)} (${Math.round(s.confidence * 100)}%)
|
|
116
|
+
` suggestion_id ${s.id}. ${sureWords(s.confidence)} (${Math.round(s.confidence * 100)}%).${autoNote}`,
|
|
108
117
|
...s.evidence.map((e) => ` • ${e.detail}`),
|
|
109
118
|
];
|
|
110
119
|
}
|
|
@@ -631,6 +640,10 @@ export const measurementTools = {
|
|
|
631
640
|
description: z.string().max(1000).optional(),
|
|
632
641
|
template: z.string().max(100).optional().describe("The template it follows, e.g. lead_captured."),
|
|
633
642
|
position: z.number().int().min(0).max(999).optional().describe("Optional explicit funnel rank (0 = earliest step). Omit to use automatic funnel order."),
|
|
643
|
+
funnelRole: z
|
|
644
|
+
.enum(["stage", "off_ramp", "return", "milestone"])
|
|
645
|
+
.optional()
|
|
646
|
+
.describe("Role in the workspace funnel & contact lifecycle: stage (advances contact lifecycle), off_ramp (churn/lost), return (win-back), or milestone (does not change stage)."),
|
|
634
647
|
}),
|
|
635
648
|
handler: async (args) => {
|
|
636
649
|
try {
|
|
@@ -642,6 +655,7 @@ export const measurementTools = {
|
|
|
642
655
|
...(args.description ? { description: args.description } : {}),
|
|
643
656
|
...(args.template ? { template: args.template } : {}),
|
|
644
657
|
...(typeof args.position === "number" ? { position: args.position } : {}),
|
|
658
|
+
...(args.funnelRole ? { funnel_role: args.funnelRole } : {}),
|
|
645
659
|
});
|
|
646
660
|
const k = res.data?.keyEvent;
|
|
647
661
|
const note = await revenueOverlapNoteFor(k?.category ?? args.category);
|
|
@@ -665,6 +679,11 @@ export const measurementTools = {
|
|
|
665
679
|
entityScope: z.enum(["person", "account"]).optional(),
|
|
666
680
|
description: z.string().max(1000).optional(),
|
|
667
681
|
position: z.number().int().min(0).max(999).nullable().optional().describe("Explicit funnel rank (0 = earliest), or null to reset to automatic order."),
|
|
682
|
+
funnelRole: z
|
|
683
|
+
.enum(["stage", "off_ramp", "return", "milestone"])
|
|
684
|
+
.nullable()
|
|
685
|
+
.optional()
|
|
686
|
+
.describe("Role in the workspace funnel & contact lifecycle, or null to reset to category default."),
|
|
668
687
|
isCurrentGoal: z.literal(true).optional().describe("Make it the workspace's main goal, in place of the one before."),
|
|
669
688
|
}),
|
|
670
689
|
handler: async (args) => {
|
|
@@ -676,6 +695,7 @@ export const measurementTools = {
|
|
|
676
695
|
...(args.entityScope ? { entity_scope: args.entityScope } : {}),
|
|
677
696
|
...(args.description !== undefined ? { description: args.description } : {}),
|
|
678
697
|
...(args.position !== undefined ? { position: args.position } : {}),
|
|
698
|
+
...(args.funnelRole !== undefined ? { funnel_role: args.funnelRole } : {}),
|
|
679
699
|
...(args.isCurrentGoal ? { is_current_goal: true } : {}),
|
|
680
700
|
});
|
|
681
701
|
const k = res.data?.keyEvent;
|
|
@@ -929,7 +949,7 @@ export const measurementTools = {
|
|
|
929
949
|
},
|
|
930
950
|
},
|
|
931
951
|
suggest_key_events: {
|
|
932
|
-
description: `${APEX} — What Apex suggests about key events, from the events it hears: events that mean the same moment and should count as one key event, a single event that is a standard moment (order_placed is a purchase) with no key event for it yet, events to add to a key event the workspace has, and two key events that count the same thing.
|
|
952
|
+
description: `${APEX} — What Apex suggests about key events, from the events it hears: events that mean the same moment and should count as one key event, a single event that is a standard moment (order_placed is a purchase) with no key event for it yet, events to add to a key event the workspace has, and two key events that count the same thing. Also lists key events Apex already set up automatically (each with its suggestion_id so the owner can undo it) and previously declined suggestions. Show the owner the suggestion and the why, then accept_key_event_suggestion, dismiss_key_event_suggestion, or undo_key_event_suggestion on their answer. Never accept on your own.`,
|
|
933
953
|
schema: z.object({}),
|
|
934
954
|
handler: async () => {
|
|
935
955
|
try {
|
|
@@ -938,15 +958,42 @@ export const measurementTools = {
|
|
|
938
958
|
if (!d)
|
|
939
959
|
return text(`${APEX} Couldn't read the suggestions.`, true);
|
|
940
960
|
const nameOf = new Map(d.keyEvents.map((k) => [k.id, k.name]));
|
|
941
|
-
|
|
961
|
+
const setUpByApex = d.keyEvents.flatMap((k) => (k.origins ?? [])
|
|
962
|
+
.filter((o) => o.by === "apex")
|
|
963
|
+
.map((o) => ({ keyEvent: k, origin: o })));
|
|
964
|
+
const declined = d.declined ?? [];
|
|
965
|
+
if (d.suggestions.length === 0 && setUpByApex.length === 0 && declined.length === 0) {
|
|
942
966
|
const uncounted = d.events.filter((e) => e.keyEventIds.length === 0).length;
|
|
943
967
|
return text(d.events.length === 0
|
|
944
968
|
? `${APEX} No suggestions. Apex hasn't heard an event from this workspace yet.`
|
|
945
969
|
: `${APEX} No suggestions right now. Apex hears ${d.events.length} event${d.events.length === 1 ? "" : "s"}, ${uncounted} not counted by any key event, and isn't sure enough to group any. Make one by hand with create_key_event.`);
|
|
946
970
|
}
|
|
947
|
-
const lines = [
|
|
948
|
-
|
|
949
|
-
lines.push(
|
|
971
|
+
const lines = [];
|
|
972
|
+
if (d.suggestions.length > 0) {
|
|
973
|
+
lines.push(`${APEX} ${d.suggestions.length} suggestion${d.suggestions.length === 1 ? "" : "s"}`, `${"═".repeat(40)}`);
|
|
974
|
+
for (const s of d.suggestions)
|
|
975
|
+
lines.push(...keyEventSuggestionLines(s, nameOf), "");
|
|
976
|
+
}
|
|
977
|
+
else {
|
|
978
|
+
const uncounted = d.events.filter((e) => e.keyEventIds.length === 0).length;
|
|
979
|
+
lines.push(`${APEX} No open suggestions right now (${d.events.length} heard event${d.events.length === 1 ? "" : "s"}, ${uncounted} not counted by any key event).`, "");
|
|
980
|
+
}
|
|
981
|
+
if (setUpByApex.length > 0) {
|
|
982
|
+
lines.push(`Set up by Apex (${setUpByApex.length}) — call undo_key_event_suggestion to take any back:`);
|
|
983
|
+
for (const { keyEvent, origin } of setUpByApex) {
|
|
984
|
+
const evText = origin.events.length > 0 ? ` (${origin.events.join(", ")})` : "";
|
|
985
|
+
const why = origin.reasons[0] ? ` — ${origin.reasons[0]}` : "";
|
|
986
|
+
lines.push(` • ${keyEvent.name} [${keyEvent.id}]${evText} — suggestion_id ${origin.suggestionId}${why}`);
|
|
987
|
+
}
|
|
988
|
+
lines.push("");
|
|
989
|
+
}
|
|
990
|
+
if (declined.length > 0) {
|
|
991
|
+
lines.push(`Previously declined (${declined.length}) — call undo_key_event_suggestion to ask again:`);
|
|
992
|
+
for (const s of declined) {
|
|
993
|
+
lines.push(` • ${s.name} (${s.events.join(", ")}) — suggestion_id ${s.id}`);
|
|
994
|
+
}
|
|
995
|
+
lines.push("");
|
|
996
|
+
}
|
|
950
997
|
lines.push(`Review them on ${appUrl("/dashboard/key-events")}.`);
|
|
951
998
|
return text(lines.join("\n"));
|
|
952
999
|
}
|
|
@@ -956,11 +1003,12 @@ export const measurementTools = {
|
|
|
956
1003
|
},
|
|
957
1004
|
},
|
|
958
1005
|
accept_key_event_suggestion: {
|
|
959
|
-
description: `${APEX} — Take one suggestion from suggest_key_events, after the owner said yes: makes the key event, adds the events to the one they have, or merges the two. A merge deletes nothing; the key event merged away keeps counting for anything that names it. name calls it something else. events keeps only some of the suggested events;
|
|
1006
|
+
description: `${APEX} — Take one suggestion from suggest_key_events, after the owner said yes: makes the key event, adds the events to the one they have, or merges the two. A merge deletes nothing; the key event merged away keeps counting for anything that names it. name calls it something else. events keeps only some of the suggested events; pass keep_rest_open: true to leave the other suggested events as an open question instead of saying no to them. For a merge, keep_key_event_id picks which key event keeps its name; leave it out and the first one the suggestion names is kept (the one in use, then the one the owner named, then a funnel step). Workspace admin.`,
|
|
960
1007
|
schema: z.object({
|
|
961
1008
|
suggestionId: z.string().min(1).describe("From suggest_key_events."),
|
|
962
1009
|
name: z.string().min(1).max(120).optional().describe("Call the key event something else."),
|
|
963
1010
|
events: z.array(z.string().min(1)).min(1).max(20).optional().describe("Keep only these of the suggested events."),
|
|
1011
|
+
keepRestOpen: z.boolean().optional().describe("When passing events, set true to leave the rest as an open question instead of declining them."),
|
|
964
1012
|
keepKeyEventId: z.string().min(1).optional().describe("For a merge: the id of the key event that keeps its name. One of the ids the suggestion names."),
|
|
965
1013
|
}),
|
|
966
1014
|
handler: async (args) => {
|
|
@@ -968,6 +1016,7 @@ export const measurementTools = {
|
|
|
968
1016
|
const res = await apiPost(`/api/key-events/suggestions/${encodeURIComponent(args.suggestionId)}/accept`, {
|
|
969
1017
|
...(args.name ? { name: args.name } : {}),
|
|
970
1018
|
...(args.events ? { events: args.events } : {}),
|
|
1019
|
+
...(args.keepRestOpen !== undefined ? { keep_rest_open: args.keepRestOpen } : {}),
|
|
971
1020
|
...(args.keepKeyEventId ? { keep_key_event_id: args.keepKeyEventId } : {}),
|
|
972
1021
|
});
|
|
973
1022
|
const k = res.data?.keyEvent;
|
|
@@ -981,12 +1030,39 @@ export const measurementTools = {
|
|
|
981
1030
|
},
|
|
982
1031
|
},
|
|
983
1032
|
dismiss_key_event_suggestion: {
|
|
984
|
-
description: `${APEX} — Say no to one suggestion from suggest_key_events, after the owner said no. Apex will not suggest it again and learns from the answer. Workspace admin.`,
|
|
985
|
-
schema: z.object({
|
|
1033
|
+
description: `${APEX} — Say no to one suggestion from suggest_key_events, after the owner said no. Apex will not suggest it again and learns from the answer. Pass events on an add-to-key-event suggestion to say no to only those events while leaving the rest as an open question. Workspace admin.`,
|
|
1034
|
+
schema: z.object({
|
|
1035
|
+
suggestionId: z.string().min(1).describe("From suggest_key_events."),
|
|
1036
|
+
events: z.array(z.string().min(1)).min(1).max(20).optional().describe("On an extend_key_event suggestion, decline only these events and leave the rest open."),
|
|
1037
|
+
}),
|
|
1038
|
+
handler: async ({ suggestionId, events }) => {
|
|
1039
|
+
try {
|
|
1040
|
+
await apiPost(`/api/key-events/suggestions/${encodeURIComponent(suggestionId)}/dismiss`, events ? { events } : {});
|
|
1041
|
+
return text(events
|
|
1042
|
+
? `${APEX} Left out ${events.join(", ")}. The remaining events stay open.`
|
|
1043
|
+
: `${APEX} Dismissed. Apex won't suggest it again.`);
|
|
1044
|
+
}
|
|
1045
|
+
catch (err) {
|
|
1046
|
+
return text(`${APEX} ${errMsg(err)}`, true);
|
|
1047
|
+
}
|
|
1048
|
+
},
|
|
1049
|
+
},
|
|
1050
|
+
undo_key_event_suggestion: {
|
|
1051
|
+
description: `${APEX} — Take back an answer to a key event suggestion — accepted by the owner, set up automatically by Apex, or dismissed. Turns it back into an open question and stops Apex from setting it up automatically again. Refuses (409) if the key event it created is currently used by a journey, segment, active test, or ad platform send. Workspace admin.`,
|
|
1052
|
+
schema: z.object({
|
|
1053
|
+
suggestionId: z.string().min(1).describe("From suggest_key_events (including Set up by Apex or Previously declined)."),
|
|
1054
|
+
}),
|
|
986
1055
|
handler: async ({ suggestionId }) => {
|
|
987
1056
|
try {
|
|
988
|
-
await apiPost(`/api/key-events/suggestions/${encodeURIComponent(suggestionId)}/
|
|
989
|
-
|
|
1057
|
+
const res = await apiPost(`/api/key-events/suggestions/${encodeURIComponent(suggestionId)}/undo`, {});
|
|
1058
|
+
const k = res.data?.keyEvent;
|
|
1059
|
+
if (!k) {
|
|
1060
|
+
return text(`${APEX} Undone. The key event was removed and the suggestion is back as an open question (Apex won't auto-set it up again).`);
|
|
1061
|
+
}
|
|
1062
|
+
return text([
|
|
1063
|
+
`${APEX} Undone. The suggestion is back as an open question. The key event now reads:`,
|
|
1064
|
+
keyEventLine(k, 0),
|
|
1065
|
+
].join("\n"));
|
|
990
1066
|
}
|
|
991
1067
|
catch (err) {
|
|
992
1068
|
return text(`${APEX} ${errMsg(err)}`, true);
|