@apex-inc/mcp-server 0.51.0 → 0.52.1
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/setup-catchup-tools.d.ts +84 -5
- package/dist/setup-catchup-tools.d.ts.map +1 -1
- package/dist/setup-catchup-tools.js +33 -3
- package/dist/setup-catchup-tools.js.map +1 -1
- package/dist/tool-groups.d.ts.map +1 -1
- package/dist/tool-groups.js +3 -0
- package/dist/tool-groups.js.map +1 -1
- package/dist/tools/apex-campaigns.d.ts +133 -0
- package/dist/tools/apex-campaigns.d.ts.map +1 -0
- package/dist/tools/apex-campaigns.js +165 -0
- package/dist/tools/apex-campaigns.js.map +1 -0
- package/dist/tools/experiments.d.ts.map +1 -1
- package/dist/tools/experiments.js +29 -27
- package/dist/tools/experiments.js.map +1 -1
- package/dist/tools/letters.d.ts +22 -12
- package/dist/tools/letters.d.ts.map +1 -1
- package/dist/tools/letters.js +23 -44
- package/dist/tools/letters.js.map +1 -1
- package/dist/tools.d.ts +229 -17
- 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 +4 -2
- package/skills/apex-growth-intelligence/SKILL.md +17 -0
- package/skills/apex-growth-tracking/SKILL.md +1 -0
- package/skills/apex-integration-cookbook/SKILL.md +10 -0
- package/skills/apex-journeys/SKILL.md +17 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apex Campaigns: one launch's ad platform campaigns (Meta, Google,
|
|
3
|
+
* LinkedIn, TikTok, …) grouped so spend and results read side by side.
|
|
4
|
+
* Same routes as Attribution → Campaigns (`/api/campaigns`).
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
declare const memberSchema: z.ZodObject<{
|
|
8
|
+
platform: z.ZodEnum<["meta-ads", "google-ads", "linkedin-ads", "tiktok-ads", "microsoft-ads", "reddit-ads", "snapchat-ads"]>;
|
|
9
|
+
platform_campaign_id: z.ZodString;
|
|
10
|
+
is_primary: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
platform: "meta-ads" | "google-ads" | "linkedin-ads" | "tiktok-ads" | "reddit-ads" | "snapchat-ads" | "microsoft-ads";
|
|
13
|
+
platform_campaign_id: string;
|
|
14
|
+
is_primary?: boolean | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
platform: "meta-ads" | "google-ads" | "linkedin-ads" | "tiktok-ads" | "reddit-ads" | "snapchat-ads" | "microsoft-ads";
|
|
17
|
+
platform_campaign_id: string;
|
|
18
|
+
is_primary?: boolean | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
type MemberInput = z.infer<typeof memberSchema>;
|
|
21
|
+
export declare const apexCampaignTools: {
|
|
22
|
+
list_apex_campaigns: {
|
|
23
|
+
description: string;
|
|
24
|
+
schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
25
|
+
handler: () => Promise<{
|
|
26
|
+
isError?: boolean | undefined;
|
|
27
|
+
content: {
|
|
28
|
+
type: "text";
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
create_apex_campaign: {
|
|
34
|
+
description: string;
|
|
35
|
+
schema: z.ZodObject<{
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
description: z.ZodOptional<z.ZodString>;
|
|
38
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
39
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
40
|
+
members: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
41
|
+
platform: z.ZodEnum<["meta-ads", "google-ads", "linkedin-ads", "tiktok-ads", "microsoft-ads", "reddit-ads", "snapchat-ads"]>;
|
|
42
|
+
platform_campaign_id: z.ZodString;
|
|
43
|
+
is_primary: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
platform: "meta-ads" | "google-ads" | "linkedin-ads" | "tiktok-ads" | "reddit-ads" | "snapchat-ads" | "microsoft-ads";
|
|
46
|
+
platform_campaign_id: string;
|
|
47
|
+
is_primary?: boolean | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
platform: "meta-ads" | "google-ads" | "linkedin-ads" | "tiktok-ads" | "reddit-ads" | "snapchat-ads" | "microsoft-ads";
|
|
50
|
+
platform_campaign_id: string;
|
|
51
|
+
is_primary?: boolean | undefined;
|
|
52
|
+
}>, "many">>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
name: string;
|
|
55
|
+
description?: string | undefined;
|
|
56
|
+
members?: {
|
|
57
|
+
platform: "meta-ads" | "google-ads" | "linkedin-ads" | "tiktok-ads" | "reddit-ads" | "snapchat-ads" | "microsoft-ads";
|
|
58
|
+
platform_campaign_id: string;
|
|
59
|
+
is_primary?: boolean | undefined;
|
|
60
|
+
}[] | undefined;
|
|
61
|
+
startDate?: string | undefined;
|
|
62
|
+
endDate?: string | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
name: string;
|
|
65
|
+
description?: string | undefined;
|
|
66
|
+
members?: {
|
|
67
|
+
platform: "meta-ads" | "google-ads" | "linkedin-ads" | "tiktok-ads" | "reddit-ads" | "snapchat-ads" | "microsoft-ads";
|
|
68
|
+
platform_campaign_id: string;
|
|
69
|
+
is_primary?: boolean | undefined;
|
|
70
|
+
}[] | undefined;
|
|
71
|
+
startDate?: string | undefined;
|
|
72
|
+
endDate?: string | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
handler: (args: {
|
|
75
|
+
name: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
startDate?: string;
|
|
78
|
+
endDate?: string;
|
|
79
|
+
members?: MemberInput[];
|
|
80
|
+
}) => Promise<{
|
|
81
|
+
isError?: boolean | undefined;
|
|
82
|
+
content: {
|
|
83
|
+
type: "text";
|
|
84
|
+
text: string;
|
|
85
|
+
}[];
|
|
86
|
+
}>;
|
|
87
|
+
};
|
|
88
|
+
add_apex_campaign_member: {
|
|
89
|
+
description: string;
|
|
90
|
+
schema: z.ZodObject<{
|
|
91
|
+
campaignId: z.ZodString;
|
|
92
|
+
members: z.ZodArray<z.ZodObject<{
|
|
93
|
+
platform: z.ZodEnum<["meta-ads", "google-ads", "linkedin-ads", "tiktok-ads", "microsoft-ads", "reddit-ads", "snapchat-ads"]>;
|
|
94
|
+
platform_campaign_id: z.ZodString;
|
|
95
|
+
is_primary: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
platform: "meta-ads" | "google-ads" | "linkedin-ads" | "tiktok-ads" | "reddit-ads" | "snapchat-ads" | "microsoft-ads";
|
|
98
|
+
platform_campaign_id: string;
|
|
99
|
+
is_primary?: boolean | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
platform: "meta-ads" | "google-ads" | "linkedin-ads" | "tiktok-ads" | "reddit-ads" | "snapchat-ads" | "microsoft-ads";
|
|
102
|
+
platform_campaign_id: string;
|
|
103
|
+
is_primary?: boolean | undefined;
|
|
104
|
+
}>, "many">;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
members: {
|
|
107
|
+
platform: "meta-ads" | "google-ads" | "linkedin-ads" | "tiktok-ads" | "reddit-ads" | "snapchat-ads" | "microsoft-ads";
|
|
108
|
+
platform_campaign_id: string;
|
|
109
|
+
is_primary?: boolean | undefined;
|
|
110
|
+
}[];
|
|
111
|
+
campaignId: string;
|
|
112
|
+
}, {
|
|
113
|
+
members: {
|
|
114
|
+
platform: "meta-ads" | "google-ads" | "linkedin-ads" | "tiktok-ads" | "reddit-ads" | "snapchat-ads" | "microsoft-ads";
|
|
115
|
+
platform_campaign_id: string;
|
|
116
|
+
is_primary?: boolean | undefined;
|
|
117
|
+
}[];
|
|
118
|
+
campaignId: string;
|
|
119
|
+
}>;
|
|
120
|
+
handler: (args: {
|
|
121
|
+
campaignId: string;
|
|
122
|
+
members: MemberInput[];
|
|
123
|
+
}) => Promise<{
|
|
124
|
+
isError?: boolean | undefined;
|
|
125
|
+
content: {
|
|
126
|
+
type: "text";
|
|
127
|
+
text: string;
|
|
128
|
+
}[];
|
|
129
|
+
}>;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
export {};
|
|
133
|
+
//# sourceMappingURL=apex-campaigns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apex-campaigns.d.ts","sourceRoot":"","sources":["../../src/tools/apex-campaigns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgCxB,QAAA,MAAM,YAAY;;;;;;;;;;;;EAIhB,CAAC;AAEH,KAAK,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AA0DhD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAuDJ;YACpB,IAAI,EAAE,MAAM,CAAC;YACb,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;SACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAuCqB;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,WAAW,EAAE,CAAA;SAAE;;;;;;;;CAYvE,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apex Campaigns: one launch's ad platform campaigns (Meta, Google,
|
|
3
|
+
* LinkedIn, TikTok, …) grouped so spend and results read side by side.
|
|
4
|
+
* Same routes as Attribution → Campaigns (`/api/campaigns`).
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { apiGet, apiPost } from "../api-client.js";
|
|
8
|
+
import { APEX, errMsg } from "../tool-shared.js";
|
|
9
|
+
const AD_PLATFORMS = [
|
|
10
|
+
"meta-ads",
|
|
11
|
+
"google-ads",
|
|
12
|
+
"linkedin-ads",
|
|
13
|
+
"tiktok-ads",
|
|
14
|
+
"microsoft-ads",
|
|
15
|
+
"reddit-ads",
|
|
16
|
+
"snapchat-ads",
|
|
17
|
+
];
|
|
18
|
+
const memberSchema = z.object({
|
|
19
|
+
platform: z.enum(AD_PLATFORMS).describe("The ad platform the campaign runs on."),
|
|
20
|
+
platform_campaign_id: z.string().min(1).describe("The campaign's id on that platform (from list_apex_campaigns' unlinked list, or the platform's ads manager)."),
|
|
21
|
+
is_primary: z.boolean().optional().describe("Show this one's picture and name on the card. The first one added is primary unless you say otherwise."),
|
|
22
|
+
});
|
|
23
|
+
async function listCampaigns() {
|
|
24
|
+
const res = await apiGet("/api/campaigns");
|
|
25
|
+
return res.data ?? res.campaigns ?? [];
|
|
26
|
+
}
|
|
27
|
+
async function listMembers(campaignId) {
|
|
28
|
+
const res = await apiGet(`/api/campaigns/${encodeURIComponent(campaignId)}/members`);
|
|
29
|
+
return res.data ?? res.members ?? [];
|
|
30
|
+
}
|
|
31
|
+
function text(t, isError = false) {
|
|
32
|
+
return { content: [{ type: "text", text: t }], ...(isError ? { isError: true } : {}) };
|
|
33
|
+
}
|
|
34
|
+
async function addMembers(campaignId, members) {
|
|
35
|
+
const failed = [];
|
|
36
|
+
for (const m of members) {
|
|
37
|
+
try {
|
|
38
|
+
await apiPost(`/api/campaigns/${encodeURIComponent(campaignId)}/members`, {
|
|
39
|
+
integration: m.platform,
|
|
40
|
+
platformCampaignId: m.platform_campaign_id,
|
|
41
|
+
...(m.is_primary !== undefined ? { isPrimary: m.is_primary } : {}),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
failed.push(`${m.platform} ${m.platform_campaign_id}: ${errMsg(err)}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return failed;
|
|
49
|
+
}
|
|
50
|
+
/** Platform campaigns Apex has synced spend for in the last 90 days. */
|
|
51
|
+
async function syncedPlatformCampaigns() {
|
|
52
|
+
const start = new Date(Date.now() - 90 * 86_400_000).toISOString().slice(0, 10);
|
|
53
|
+
const out = [];
|
|
54
|
+
await Promise.all(AD_PLATFORMS.map(async (platform) => {
|
|
55
|
+
try {
|
|
56
|
+
const res = await apiGet(`/api/metrics/${platform}?start=${start}`);
|
|
57
|
+
for (const c of res.campaigns ?? []) {
|
|
58
|
+
if (!c.campaignId)
|
|
59
|
+
continue;
|
|
60
|
+
out.push({ platform, platform_campaign_id: c.campaignId, name: c.campaignName ?? c.campaignId, spend: c.spend ?? 0 });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
// Not connected, or nothing synced.
|
|
65
|
+
}
|
|
66
|
+
}));
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
export const apexCampaignTools = {
|
|
70
|
+
list_apex_campaigns: {
|
|
71
|
+
description: `${APEX} — List the workspace's Apex Campaigns: each one launch's ad platform campaigns grouped so spend and results read side by side (Attribution → Campaigns). Each row lists its platform campaigns. Also lists the platform campaigns Apex has synced spend for in the last 90 days that are in no Apex Campaign yet, with the ids create_apex_campaign and add_apex_campaign_member take.`,
|
|
72
|
+
schema: z.object({}),
|
|
73
|
+
handler: async () => {
|
|
74
|
+
try {
|
|
75
|
+
const campaigns = await listCampaigns();
|
|
76
|
+
const withMembers = await Promise.all(campaigns.map(async (c) => {
|
|
77
|
+
const members = await listMembers(c.id).catch(() => []);
|
|
78
|
+
return { c, members };
|
|
79
|
+
}));
|
|
80
|
+
const linked = new Set(withMembers.flatMap(({ members }) => members.map((m) => `${m.integration}|${m.platformCampaignId}`)));
|
|
81
|
+
const unlinked = (await syncedPlatformCampaigns()).filter((p) => !linked.has(`${p.platform}|${p.platform_campaign_id}`));
|
|
82
|
+
return text(JSON.stringify({
|
|
83
|
+
apex_campaigns: withMembers.map(({ c, members }) => ({
|
|
84
|
+
id: c.id,
|
|
85
|
+
name: c.name,
|
|
86
|
+
description: c.description ?? null,
|
|
87
|
+
start_date: c.startDate ?? null,
|
|
88
|
+
end_date: c.endDate ?? null,
|
|
89
|
+
platform_campaigns: members.map((m) => ({
|
|
90
|
+
platform: m.integration,
|
|
91
|
+
platform_campaign_id: m.platformCampaignId,
|
|
92
|
+
is_primary: m.isPrimary,
|
|
93
|
+
})),
|
|
94
|
+
})),
|
|
95
|
+
unlinked_platform_campaigns: unlinked,
|
|
96
|
+
}, null, 2));
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
return text(`${APEX} ${errMsg(err)}`, true);
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
create_apex_campaign: {
|
|
104
|
+
description: `${APEX} — Create an Apex Campaign: one name for a launch whose ads run on several platforms, so spend, clicks and results show side by side under Attribution → Campaigns. Optionally link its platform campaigns now (platform + the campaign's id there); add more later with add_apex_campaign_member. Name it the same as the Apex Links' campaign so the launch reads as one thing. Workspace admin.`,
|
|
105
|
+
schema: z.object({
|
|
106
|
+
name: z.string().min(1).max(200),
|
|
107
|
+
description: z.string().max(1000).optional(),
|
|
108
|
+
startDate: z.string().optional().describe("YYYY-MM-DD. Optional; without dates the campaign spans its platform campaigns' own dates."),
|
|
109
|
+
endDate: z.string().optional().describe("YYYY-MM-DD."),
|
|
110
|
+
members: z.array(memberSchema).max(50).optional().describe("Platform campaigns to link now."),
|
|
111
|
+
}),
|
|
112
|
+
handler: async (args) => {
|
|
113
|
+
try {
|
|
114
|
+
const campaigns = await listCampaigns();
|
|
115
|
+
const same = campaigns.find((c) => c.name.trim().toLowerCase() === args.name.trim().toLowerCase());
|
|
116
|
+
if (same) {
|
|
117
|
+
return text(`${APEX} An Apex Campaign named "${same.name}" already exists (${same.id}). Link platform campaigns to it with add_apex_campaign_member instead of making a second one.`, true);
|
|
118
|
+
}
|
|
119
|
+
const created = await apiPost("/api/campaigns", {
|
|
120
|
+
name: args.name,
|
|
121
|
+
...(args.description ? { description: args.description } : {}),
|
|
122
|
+
...(args.startDate ? { startDate: args.startDate } : {}),
|
|
123
|
+
...(args.endDate ? { endDate: args.endDate } : {}),
|
|
124
|
+
source: "manual",
|
|
125
|
+
});
|
|
126
|
+
const campaign = (created.data ?? created.campaign);
|
|
127
|
+
const members = args.members ?? [];
|
|
128
|
+
const failed = await addMembers(campaign.id, members);
|
|
129
|
+
const linked = members.length - failed.length;
|
|
130
|
+
const lines = [
|
|
131
|
+
`${APEX} Created the Apex Campaign "${campaign.name}" (${campaign.id})${members.length ? ` with ${linked} platform campaign${linked === 1 ? "" : "s"} linked` : ""}.`,
|
|
132
|
+
];
|
|
133
|
+
if (failed.length)
|
|
134
|
+
lines.push(`Could not link: ${failed.join("; ")}`);
|
|
135
|
+
if (!members.length)
|
|
136
|
+
lines.push("No platform campaigns linked yet. Add them with add_apex_campaign_member once the ads exist.");
|
|
137
|
+
return text(lines.join("\n"), failed.length > 0);
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
return text(`${APEX} ${errMsg(err)}`, true);
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
add_apex_campaign_member: {
|
|
145
|
+
description: `${APEX} — Link platform campaigns to an existing Apex Campaign (from list_apex_campaigns), so their spend and results count toward it. Workspace admin.`,
|
|
146
|
+
schema: z.object({
|
|
147
|
+
campaignId: z.string().min(1),
|
|
148
|
+
members: z.array(memberSchema).min(1).max(50),
|
|
149
|
+
}),
|
|
150
|
+
handler: async (args) => {
|
|
151
|
+
try {
|
|
152
|
+
const failed = await addMembers(args.campaignId, args.members);
|
|
153
|
+
const linked = args.members.length - failed.length;
|
|
154
|
+
const lines = [`${APEX} Linked ${linked} platform campaign${linked === 1 ? "" : "s"} to ${args.campaignId}.`];
|
|
155
|
+
if (failed.length)
|
|
156
|
+
lines.push(`Could not link: ${failed.join("; ")}`);
|
|
157
|
+
return text(lines.join("\n"), failed.length > 0);
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
return text(`${APEX} ${errMsg(err)}`, true);
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=apex-campaigns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apex-campaigns.js","sourceRoot":"","sources":["../../src/tools/apex-campaigns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,YAAY,GAAG;IACnB,UAAU;IACV,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,eAAe;IACf,YAAY;IACZ,cAAc;CACN,CAAC;AAmBX,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IAChF,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,8GAA8G,CAAC;IAChK,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wGAAwG,CAAC;CACtJ,CAAC,CAAC;AAMH,KAAK,UAAU,aAAa;IAC1B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAqC,gBAAgB,CAAC,CAAC;IAC/E,OAAO,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;AACzC,CAAC;AAED,KAAK,UAAU,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AM,CAAC,MAAM;oBAAE,KAAK,CAAC,IAAI,CAAC,mBAAmB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACtE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACnD,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,IAAI,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experiments.d.ts","sourceRoot":"","sources":["../../src/tools/experiments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuDxB,KAAK,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAElE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;
|
|
1
|
+
{"version":3,"file":"experiments.d.ts","sourceRoot":"","sources":["../../src/tools/experiments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuDxB,KAAK,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAElE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB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MAAM,CAAC;YACd,UAAU,EAAE,MAAM,CAAC;YACnB,GAAG,CAAC,EAAE,MAAM,CAAC;SACd;;;;;;;;;;;;;;;;;;;4CA0ByC;YAAE,YAAY,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8B5D;YACpB,YAAY,EAAE,MAAM,CAAC;YACrB,iBAAiB,EAAE,MAAM,CAAC;YAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,aAAa,EAAE,MAAM,CAAC;YACtB,aAAa,EAAE,MAAM,CAAC;YACtB,eAAe,EAAE,MAAM,CAAC;YACxB,YAAY,EAAE,MAAM,CAAC;SACtB;;;;;;;;;;;;;;;;oCA0BiC;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;oCAuBxB;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqCpC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;oCAgBX;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE;;;;;;;CAsC7D,CAAC"}
|
|
@@ -17,6 +17,27 @@ const NETWORK_WORD = {
|
|
|
17
17
|
function textError(text) {
|
|
18
18
|
return { content: [{ type: "text", text: `${APEX} ${text}` }], isError: true };
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* The reason a goal event can't be used in this workspace, or null when it
|
|
22
|
+
* can. Same check the experiments API enforces on create and edit; when the
|
|
23
|
+
* check itself can't be reached, the API's own refusal still applies.
|
|
24
|
+
*/
|
|
25
|
+
async function refuseGoalEvent(event) {
|
|
26
|
+
let check;
|
|
27
|
+
try {
|
|
28
|
+
check = await apiGet(`/api/experiments/goal-check?event=${encodeURIComponent(event)}`);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
if (check.data?.accepted !== false)
|
|
34
|
+
return null;
|
|
35
|
+
const suggestions = check.data.suggestions ?? [];
|
|
36
|
+
return [
|
|
37
|
+
check.error ?? `"${event}" isn't an event this workspace receives or defined.`,
|
|
38
|
+
suggestions.length ? `Closest events here: ${suggestions.join(", ")}.` : "Call list_events to see what this workspace receives.",
|
|
39
|
+
].join(" ");
|
|
40
|
+
}
|
|
20
41
|
async function createAdHoldout(args) {
|
|
21
42
|
if (args.surface && args.surface !== "paid_channel") {
|
|
22
43
|
return textError(`paid_channel only applies to surface "paid_channel" (got "${args.surface}").`);
|
|
@@ -318,7 +339,7 @@ export const experimentTools = {
|
|
|
318
339
|
beliefStatement: z.string().optional().describe("If you don't have a beliefId, pass the assumption statement and Apex will create the belief (and a hypothesis) and link them to this experiment."),
|
|
319
340
|
beliefConfidence: z.number().min(0).max(100).optional().describe("Confidence (0-100%) for the belief created from beliefStatement. Defaults to 50."),
|
|
320
341
|
hypothesisStatement: z.string().optional().describe("Optional hypothesis statement to record alongside a belief created from beliefStatement."),
|
|
321
|
-
primaryMetricEvent: z.string().optional().describe("
|
|
342
|
+
primaryMetricEvent: z.string().optional().describe("Event the experiment optimizes: a standard Apex event (e.g. 'checkout_completed') or any event this workspace receives or defined with define_event (e.g. 'demo_booked'). Checked against this workspace; a name it has never seen is refused with the closest matches. Prefer an OUTCOME event (purchase/signup) over a proxy (email_open) — use list_metrics to see which are DETECTED with volume."),
|
|
322
343
|
primaryMetricType: z.enum(["rate", "count", "revenue", "duration"]).optional().describe("How the goal is measured. 'rate' (default) = did it happen. 'revenue'/'duration' = a continuous value summed per subject (set primaryMetricValueProperty). Use 'revenue' for Stripe/purchase-value goals."),
|
|
323
344
|
primaryMetricValueProperty: z.string().optional().describe("For revenue/duration goals: the event property to sum, e.g. 'value'. Defaults to 'value'."),
|
|
324
345
|
guardrailEvent: z.string().optional().describe("Canonical protective event for an EXTRA guardrail that must not regress (e.g. 'purchase_refunded', 'app_uninstall', 'js_error'). Apex already auto-protects revenue/refunds/errors by default — only pass this to add a test-specific harm signal. Use list_metrics({role:'guardrail'}) to see what's firing. Choose one ORTHOGONAL to the primary goal."),
|
|
@@ -417,31 +438,9 @@ export const experimentTools = {
|
|
|
417
438
|
};
|
|
418
439
|
if (args.primaryMetricEvent) {
|
|
419
440
|
const event = args.primaryMetricEvent.trim();
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
validEvents = Object.keys(spec.data?.events ?? {});
|
|
424
|
-
}
|
|
425
|
-
catch (err) {
|
|
426
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
427
|
-
return {
|
|
428
|
-
content: [{
|
|
429
|
-
type: "text",
|
|
430
|
-
text: `Could not load the event spec to validate primaryMetricEvent "${event}" (${message}). Fix the connection, or omit primaryMetricEvent to create the draft without a conversion goal (you'll set it before starting).`,
|
|
431
|
-
}],
|
|
432
|
-
isError: true,
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
if (validEvents.length && !validEvents.includes(event)) {
|
|
436
|
-
const sample = validEvents.slice(0, 12).join(", ");
|
|
437
|
-
return {
|
|
438
|
-
content: [{
|
|
439
|
-
type: "text",
|
|
440
|
-
text: `"${event}" is not a canonical event in this workspace's event spec. Valid options include: ${sample}${validEvents.length > 12 ? ", …" : ""}. Use get_event_spec for the full list.`,
|
|
441
|
-
}],
|
|
442
|
-
isError: true,
|
|
443
|
-
};
|
|
444
|
-
}
|
|
441
|
+
const refused = await refuseGoalEvent(event);
|
|
442
|
+
if (refused)
|
|
443
|
+
return textError(refused);
|
|
445
444
|
const metricType = args.primaryMetricType ?? "rate";
|
|
446
445
|
const isValue = metricType === "revenue" || metricType === "duration";
|
|
447
446
|
const valueProperty = args.primaryMetricValueProperty ?? "value";
|
|
@@ -1807,7 +1806,7 @@ export const experimentTools = {
|
|
|
1807
1806
|
hypothesis: z.string().optional().describe("Edit the hypothesis — draft only (pre-registration)."),
|
|
1808
1807
|
targetUrl: z.string().optional().describe("Retarget a DRAFT to a URL on the ACTIVE workspace. Same host rules as create_experiment."),
|
|
1809
1808
|
predictionId: z.string().optional().describe("Attach a minted prediction id (from log_prediction) to this draft. Also stamps the prediction onto the experiment's hypothesis when that link is missing. Required before activation."),
|
|
1810
|
-
primaryMetricEvent: z.string().optional().describe("Change the primary metric's
|
|
1809
|
+
primaryMetricEvent: z.string().optional().describe("Change the primary metric's event — draft only. Same check as create_experiment: a standard Apex event, or any event this workspace receives or defined."),
|
|
1811
1810
|
primaryMetricType: z.enum(["rate", "count", "revenue", "duration"]).optional(),
|
|
1812
1811
|
guardrailEvent: z.string().optional().describe("Replace the guardrail with this canonical protective event — draft only."),
|
|
1813
1812
|
minSamplePerArm: z.number().int().min(30).optional().describe("Set the minimum exposed subjects PER ARM before a winner can be claimed (the sample gate; floor 30). Draft only — it's part of the pre-registration and freezes at launch (a running experiment returns experiment_locked; fork to change it)."),
|
|
@@ -1865,6 +1864,9 @@ export const experimentTools = {
|
|
|
1865
1864
|
body.evaluationWindow = ew;
|
|
1866
1865
|
}
|
|
1867
1866
|
if (args.primaryMetricEvent) {
|
|
1867
|
+
const refused = await refuseGoalEvent(args.primaryMetricEvent.trim());
|
|
1868
|
+
if (refused)
|
|
1869
|
+
return textError(refused);
|
|
1868
1870
|
const t = args.primaryMetricType ?? "rate";
|
|
1869
1871
|
const isValue = t === "revenue" || t === "duration";
|
|
1870
1872
|
body.primaryMetric = {
|