@apex-inc/mcp-server 0.78.0 → 0.79.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 +8 -0
- package/dist/api-client.d.ts +2 -4
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +30 -2
- package/dist/api-client.js.map +1 -1
- package/dist/hosted.d.ts +6 -0
- package/dist/hosted.d.ts.map +1 -1
- package/dist/hosted.js +18 -0
- package/dist/hosted.js.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/letter-blocks.d.ts.map +1 -1
- package/dist/letter-blocks.js +13 -22
- package/dist/letter-blocks.js.map +1 -1
- package/dist/request-context.d.ts +2 -0
- package/dist/request-context.d.ts.map +1 -1
- package/dist/request-context.js.map +1 -1
- package/dist/server-factory.d.ts +13 -0
- package/dist/server-factory.d.ts.map +1 -1
- package/dist/server-factory.js +426 -62
- package/dist/server-factory.js.map +1 -1
- package/dist/setup-catchup-tools.d.ts.map +1 -1
- package/dist/setup-catchup-tools.js +18 -63
- package/dist/setup-catchup-tools.js.map +1 -1
- package/dist/tool-mode.d.ts +48 -0
- package/dist/tool-mode.d.ts.map +1 -0
- package/dist/tool-mode.js +189 -0
- package/dist/tool-mode.js.map +1 -0
- package/dist/tool-shared.d.ts +7 -0
- package/dist/tool-shared.d.ts.map +1 -1
- package/dist/tool-shared.js +35 -4
- package/dist/tool-shared.js.map +1 -1
- package/dist/tools/apex-campaigns.d.ts +4 -0
- package/dist/tools/apex-campaigns.d.ts.map +1 -1
- package/dist/tools/apex-campaigns.js +4 -1
- package/dist/tools/apex-campaigns.js.map +1 -1
- package/dist/tools/experiments.js +53 -53
- package/dist/tools/experiments.js.map +1 -1
- package/dist/tools/letters.d.ts.map +1 -1
- package/dist/tools/letters.js +13 -34
- package/dist/tools/letters.js.map +1 -1
- package/dist/tools/measurement.d.ts.map +1 -1
- package/dist/tools/measurement.js +14 -14
- package/dist/tools/measurement.js.map +1 -1
- package/dist/tools.d.ts +4 -0
- package/dist/tools.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/apex-setup/SKILL.md +1 -0
|
@@ -9,8 +9,8 @@ import { apexBaseUrl } from "../base-url.js";
|
|
|
9
9
|
import { fetchLiveTestHits, formatLiveTestStop, isFileStop, isObjectStop, } from "../live-test-guard.js";
|
|
10
10
|
import { hasConflictAdvisory, renderConflictAdvisory, } from "../conflict-advisory.js";
|
|
11
11
|
import { appUrl, APEX, controlPctOf, daysRunningOf, experimentTimingLabel, predictionLines, findVariant, missingScreenshotLines, formatArmLine, titleCaseEvent, assertTargetUrlForActiveWorkspace, errMsg, resolveCreateSurface, } from "../tool-shared.js";
|
|
12
|
-
const STARTING_CONFIDENCE_HELP = "
|
|
13
|
-
const NEW_BECAUSE_HELP = "
|
|
12
|
+
const STARTING_CONFIDENCE_HELP = "Omit unless backed by prior test/data (untested claims start at 50%).";
|
|
13
|
+
const NEW_BECAUSE_HELP = "One sentence on how this differs from related beliefs (only after Apex returned matches).";
|
|
14
14
|
const NETWORK_WORD = {
|
|
15
15
|
meta: "Meta",
|
|
16
16
|
google: "Google",
|
|
@@ -45,7 +45,7 @@ const KEY_EVENT_GOAL_PARAM = {
|
|
|
45
45
|
primaryMetricKeyEventId: z
|
|
46
46
|
.string()
|
|
47
47
|
.optional()
|
|
48
|
-
.describe("
|
|
48
|
+
.describe("Key event id (from list_key_events) to judge the test on; pass this OR primary_metric_event, never both."),
|
|
49
49
|
};
|
|
50
50
|
/** The key event a goal names, read from the active workspace, or why it can't be read. */
|
|
51
51
|
async function readKeyEventGoal(id) {
|
|
@@ -79,11 +79,11 @@ const FORM_GOAL_PARAMS = {
|
|
|
79
79
|
primaryMetricFormPage: z
|
|
80
80
|
.string()
|
|
81
81
|
.optional()
|
|
82
|
-
.describe("With primary_metric_event
|
|
82
|
+
.describe("With primary_metric_event='form_submit': count only forms on this path/URL."),
|
|
83
83
|
primaryMetricFormId: z
|
|
84
84
|
.string()
|
|
85
85
|
.optional()
|
|
86
|
-
.describe("With primary_metric_event
|
|
86
|
+
.describe("With primary_metric_event='form_submit': count only this HTML form id."),
|
|
87
87
|
};
|
|
88
88
|
/** The page-and-form narrowing for a form goal, or why it was refused. */
|
|
89
89
|
function formGoalOf(args) {
|
|
@@ -434,49 +434,49 @@ export const experimentTools = {
|
|
|
434
434
|
},
|
|
435
435
|
},
|
|
436
436
|
create_experiment: {
|
|
437
|
-
description: `${APEX} — Create an experiment
|
|
437
|
+
description: `${APEX} — Create an experiment draft and implementation recipe (useApexVariant). Call with preview=true first.`,
|
|
438
438
|
schema: z.object({
|
|
439
439
|
name: z.string().describe("Experiment name"),
|
|
440
|
-
targetUrl: z.string().optional().describe("
|
|
441
|
-
controlContent: z.string().optional().describe("
|
|
442
|
-
variantContent: z.string().optional().describe("
|
|
443
|
-
targetComponent: z.string().optional().describe("
|
|
444
|
-
targetAnchor: z.string().optional().describe("Section anchor/ID
|
|
445
|
-
trafficSplit: z.number().min(1).max(99).optional().describe("
|
|
446
|
-
beliefId: z.string().optional().describe("
|
|
447
|
-
hypothesisId: z.string().optional().describe("
|
|
448
|
-
predictionId: z.string().optional().describe("
|
|
449
|
-
beliefStatement: z.string().optional().describe("
|
|
450
|
-
beliefConfidence: z.number().min(0).max(100).optional().describe(`
|
|
451
|
-
newBecause: z.string().optional().describe(`With beliefStatement
|
|
452
|
-
hypothesisStatement: z.string().optional().describe("Optional hypothesis
|
|
453
|
-
primaryMetricEvent: z.string().optional().describe("
|
|
454
|
-
primaryMetricType: z.enum(["rate", "count", "revenue", "duration"]).optional().describe("
|
|
455
|
-
primaryMetricValueProperty: z.string().optional().describe("
|
|
440
|
+
targetUrl: z.string().optional().describe("Registered host URL on the active workspace (include #anchor if needed). Required for web/mobile."),
|
|
441
|
+
controlContent: z.string().optional().describe("Current control content (required for web/mobile)."),
|
|
442
|
+
variantContent: z.string().optional().describe("New variant content (required for web/mobile)."),
|
|
443
|
+
targetComponent: z.string().optional().describe("Target component or file path"),
|
|
444
|
+
targetAnchor: z.string().optional().describe("Section anchor/ID (e.g. 'pricing', 'hero')"),
|
|
445
|
+
trafficSplit: z.number().min(1).max(99).optional().describe("Control traffic % (default 50)"),
|
|
446
|
+
beliefId: z.string().optional().describe("Existing assumption id"),
|
|
447
|
+
hypothesisId: z.string().optional().describe("Existing hypothesis id"),
|
|
448
|
+
predictionId: z.string().optional().describe("Existing prediction id"),
|
|
449
|
+
beliefStatement: z.string().optional().describe("Create and link a new belief + hypothesis if no beliefId"),
|
|
450
|
+
beliefConfidence: z.number().min(0).max(100).optional().describe(`With beliefStatement: ${STARTING_CONFIDENCE_HELP}`),
|
|
451
|
+
newBecause: z.string().optional().describe(`With beliefStatement: ${NEW_BECAUSE_HELP}`),
|
|
452
|
+
hypothesisStatement: z.string().optional().describe("Optional hypothesis alongside beliefStatement"),
|
|
453
|
+
primaryMetricEvent: z.string().optional().describe("Goal event (standard or workspace event from list_metrics). Prefer outcome over proxy."),
|
|
454
|
+
primaryMetricType: z.enum(["rate", "count", "revenue", "duration"]).optional().describe("Goal type: rate (default), count, revenue, or duration."),
|
|
455
|
+
primaryMetricValueProperty: z.string().optional().describe("Property to sum for revenue/duration goals (default 'value')."),
|
|
456
456
|
...KEY_EVENT_GOAL_PARAM,
|
|
457
457
|
...FORM_GOAL_PARAMS,
|
|
458
|
-
guardrailEvent: z.string().optional().describe("
|
|
459
|
-
guardrailType: z.enum(["rate", "revenue", "duration"]).optional().describe("
|
|
460
|
-
guardrailThreshold: z.number().optional().describe("
|
|
461
|
-
predictionMagnitude: z.string().optional().describe("
|
|
462
|
-
surface: z.enum(["web", "mobile", "paid_channel"]).optional().describe("
|
|
458
|
+
guardrailEvent: z.string().optional().describe("Optional extra protective event (Apex already auto-protects revenue/refunds/errors)."),
|
|
459
|
+
guardrailType: z.enum(["rate", "revenue", "duration"]).optional().describe("Guardrail type: rate (default), revenue, or duration."),
|
|
460
|
+
guardrailThreshold: z.number().optional().describe("Relative harm threshold (default 0.25 = +25%)."),
|
|
461
|
+
predictionMagnitude: z.string().optional().describe("Expected lift (e.g. '10% lift'). Required before activation."),
|
|
462
|
+
surface: z.enum(["web", "mobile", "paid_channel"]).optional().describe("Property: 'web', 'mobile', or 'paid_channel' (Ad holdout). Auto-detected when omitted."),
|
|
463
463
|
paid_channel: z
|
|
464
464
|
.object({
|
|
465
|
-
network: z.enum(["meta", "google", "tiktok", "linkedin"]).describe("Ad network
|
|
466
|
-
ad_account_id: z.string().optional().describe("
|
|
467
|
-
ad_set_ids: z.array(z.string()).min(1).describe("Ad set
|
|
468
|
-
holdout_percent: z.number().min(0.05).max(0.5).describe("
|
|
469
|
-
attach_mode: z.enum(["apex", "manual"]).optional().describe("'apex'
|
|
470
|
-
washout_days: z.number().int().min(0).max(30).optional().describe("
|
|
471
|
-
population_segment_id: z.string().optional().describe("Optional Segment id narrowing
|
|
465
|
+
network: z.enum(["meta", "google", "tiktok", "linkedin"]).describe("Ad network (Meta or Google)."),
|
|
466
|
+
ad_account_id: z.string().optional().describe("Ad account id (omit for connected default)."),
|
|
467
|
+
ad_set_ids: z.array(z.string()).min(1).describe("Ad set / Google campaign ids (max 20, frozen at create)."),
|
|
468
|
+
holdout_percent: z.number().min(0.05).max(0.5).describe("Held-back share, 0.05-0.5 (e.g. 0.2)."),
|
|
469
|
+
attach_mode: z.enum(["apex", "manual"]).optional().describe("'apex' (Meta default) or 'manual' (Google default)."),
|
|
470
|
+
washout_days: z.number().int().min(0).max(30).optional().describe("Washout days before counting (default 3)."),
|
|
471
|
+
population_segment_id: z.string().optional().describe("Optional Segment id narrowing population."),
|
|
472
472
|
})
|
|
473
473
|
.optional()
|
|
474
|
-
.describe("Ad holdout
|
|
475
|
-
dataSourceId: z.string().optional().describe("Optional
|
|
476
|
-
randomizationUnit: z.enum(["device", "visitor", "person", "account", "org"]).optional().describe("
|
|
477
|
-
minSamplePerArm: z.number().int().min(30).optional().describe("
|
|
478
|
-
runtimeDays: z.number().int().min(1).max(365).optional().describe("
|
|
479
|
-
preview: z.boolean().optional().describe("
|
|
474
|
+
.describe("Ad holdout config (required for surface='paid_channel')."),
|
|
475
|
+
dataSourceId: z.string().optional().describe("Optional Data Source id (usually inferred from surface)."),
|
|
476
|
+
randomizationUnit: z.enum(["device", "visitor", "person", "account", "org"]).optional().describe("Bucketing unit (default 'visitor')."),
|
|
477
|
+
minSamplePerArm: z.number().int().min(30).optional().describe("Min exposed subjects per arm (default 50, floor 30; frozen at launch)."),
|
|
478
|
+
runtimeDays: z.number().int().min(1).max(365).optional().describe("Max runtime in days (default 14; frozen at launch)."),
|
|
479
|
+
preview: z.boolean().optional().describe("Preview without creating (default true)."),
|
|
480
480
|
}),
|
|
481
481
|
handler: async (args) => {
|
|
482
482
|
// Mobile Measurement P3a — an Ad holdout is not a code change. No page,
|
|
@@ -2118,23 +2118,23 @@ export const experimentTools = {
|
|
|
2118
2118
|
},
|
|
2119
2119
|
},
|
|
2120
2120
|
update_experiment: {
|
|
2121
|
-
description: `${APEX} — Edit an
|
|
2121
|
+
description: `${APEX} — Edit an existing experiment. Drafts are editable; running experiments freeze pre-registration and bucketing (use fork_experiment instead).`,
|
|
2122
2122
|
schema: z.object({
|
|
2123
|
-
experimentId: z.string().describe("
|
|
2124
|
-
name: z.string().optional().describe("Rename (
|
|
2125
|
-
surface: z.enum(["web", "mobile", "paid_channel"]).optional().describe("
|
|
2126
|
-
hypothesis: z.string().optional().describe("
|
|
2127
|
-
beliefId: z.string().min(1).optional().describe("Re-link
|
|
2128
|
-
targetUrl: z.string().optional().describe("Retarget
|
|
2129
|
-
predictionId: z.string().optional().describe("Attach a
|
|
2130
|
-
primaryMetricEvent: z.string().optional().describe("
|
|
2123
|
+
experimentId: z.string().describe("Experiment id"),
|
|
2124
|
+
name: z.string().optional().describe("Rename (editable anytime)"),
|
|
2125
|
+
surface: z.enum(["web", "mobile", "paid_channel"]).optional().describe("Surface (draft with 0 exposures only)"),
|
|
2126
|
+
hypothesis: z.string().optional().describe("Hypothesis (draft only)"),
|
|
2127
|
+
beliefId: z.string().min(1).optional().describe("Re-link to another belief id (draft only)"),
|
|
2128
|
+
targetUrl: z.string().optional().describe("Retarget draft to a registered workspace URL"),
|
|
2129
|
+
predictionId: z.string().optional().describe("Attach a prediction id from log_prediction (required before activation)"),
|
|
2130
|
+
primaryMetricEvent: z.string().optional().describe("Primary goal event (draft only)"),
|
|
2131
2131
|
primaryMetricType: z.enum(["rate", "count", "revenue", "duration"]).optional(),
|
|
2132
2132
|
...KEY_EVENT_GOAL_PARAM,
|
|
2133
2133
|
...FORM_GOAL_PARAMS,
|
|
2134
|
-
guardrailEvent: z.string().optional().describe("
|
|
2135
|
-
minSamplePerArm: z.number().int().min(30).optional().describe("
|
|
2136
|
-
runtimeDays: z.number().int().min(1).max(365).optional().describe("
|
|
2137
|
-
allocation: z.enum(["even", "adaptive"]).optional().describe("Journey message
|
|
2134
|
+
guardrailEvent: z.string().optional().describe("Extra protective guardrail event (draft only)"),
|
|
2135
|
+
minSamplePerArm: z.number().int().min(30).optional().describe("Min exposed subjects per arm (floor 30; draft only)"),
|
|
2136
|
+
runtimeDays: z.number().int().min(1).max(365).optional().describe("Max runtime in days (draft only)"),
|
|
2137
|
+
allocation: z.enum(["even", "adaptive"]).optional().describe("Journey message test split (draft only): 'even' (default) or 'adaptive'. Ask the owner before changing."),
|
|
2138
2138
|
}),
|
|
2139
2139
|
handler: async (args) => {
|
|
2140
2140
|
if (args.targetUrl) {
|