@apex-inc/mcp-server 0.9.10 → 0.9.12
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.map +1 -1
- package/dist/api-client.js +4 -2
- package/dist/api-client.js.map +1 -1
- package/dist/auth.d.ts +8 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +22 -5
- package/dist/auth.js.map +1 -1
- package/dist/experiment-copy.d.ts +16 -0
- package/dist/experiment-copy.d.ts.map +1 -0
- package/dist/experiment-copy.js +23 -0
- package/dist/experiment-copy.js.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts +104 -0
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +181 -7
- package/dist/prompts.js.map +1 -1
- package/dist/tools.d.ts +370 -6
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +492 -47
- package/dist/tools.js.map +1 -1
- package/guardrails/apex-experiment-guardrails.mdc +20 -0
- package/guardrails/brand-truth.md +34 -0
- package/guardrails/brand-voice.md +22 -0
- package/guardrails/experiment-rules.md +21 -0
- package/guardrails/lexicon.md +16 -0
- package/package.json +6 -3
- package/skills/apex-experimentation/SKILL.md +21 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Lexicon — word-level rules
|
|
2
|
+
|
|
3
|
+
> Word choices the agent should prefer, avoid, or qualify. Replace every `TODO`.
|
|
4
|
+
|
|
5
|
+
## Preferred words
|
|
6
|
+
<!-- Vocabulary that sounds like you. -->
|
|
7
|
+
- TODO
|
|
8
|
+
|
|
9
|
+
## Banned words
|
|
10
|
+
<!-- e.g. "guaranteed", "best", "#1", "cheap", unqualified "free". -->
|
|
11
|
+
- TODO
|
|
12
|
+
|
|
13
|
+
## Words that require a qualifier
|
|
14
|
+
<!-- e.g. "free shipping" → must state the condition from brand-truth.md.
|
|
15
|
+
Any discount → must cite the real offer from brand-truth.md. -->
|
|
16
|
+
- TODO
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apex-inc/mcp-server",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.12",
|
|
4
4
|
"description": "MCP server for Apex — currently in private beta.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"build": "tsc",
|
|
13
13
|
"dev": "tsc --watch",
|
|
14
14
|
"start": "node dist/index.js",
|
|
15
|
+
"test": "vitest run",
|
|
15
16
|
"prepublishOnly": "npm run build"
|
|
16
17
|
},
|
|
17
18
|
"keywords": [
|
|
@@ -20,7 +21,8 @@
|
|
|
20
21
|
],
|
|
21
22
|
"files": [
|
|
22
23
|
"dist",
|
|
23
|
-
"skills"
|
|
24
|
+
"skills",
|
|
25
|
+
"guardrails"
|
|
24
26
|
],
|
|
25
27
|
"license": "MIT",
|
|
26
28
|
"publishConfig": {
|
|
@@ -35,6 +37,7 @@
|
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
39
|
"@types/node": "^20",
|
|
38
|
-
"typescript": "^5"
|
|
40
|
+
"typescript": "^5",
|
|
41
|
+
"vitest": "^3.2.0"
|
|
39
42
|
}
|
|
40
43
|
}
|
|
@@ -7,6 +7,10 @@ description: Design, instrument, and analyze A/B experiments with Apex — SDK a
|
|
|
7
7
|
|
|
8
8
|
Apex treats experiments as part of a scientific loop: **beliefs → hypotheses → predictions → experiments → outcomes → updated beliefs**. Your job is to suggest experiments when product or code changes could be validated with data, and to wire instrumentation correctly.
|
|
9
9
|
|
|
10
|
+
## Grounded experiments — never invent claims
|
|
11
|
+
|
|
12
|
+
Before writing ANY experiment variant copy, read the merchant's guardrail files if present: `.apex/brand-truth.md` (the facts you may claim), `.apex/brand-voice.md` (tone), `.apex/lexicon.md` (word rules). **Every factual claim in variant copy MUST trace to a line in `.apex/brand-truth.md` — cite which line.** If a claim isn't backed there, ASK the user; do not invent it. (Real incident, 2026-06-15: an agent wrote "Free shipping on every order" for an app that charges $8 under $100 — an ungrounded claim that would have invalidated the test.) If the files are missing, scaffold them via **Apex → Set up Apex → Intelligence → "Set up experiment guardrails"** and ask the owner to fill in the facts first.
|
|
13
|
+
|
|
10
14
|
## When to suggest an experiment
|
|
11
15
|
|
|
12
16
|
Proactively offer Apex when you see:
|
|
@@ -27,6 +31,23 @@ Proactively offer Apex when you see:
|
|
|
27
31
|
|
|
28
32
|
Prefer **SDK mode** when the user is in an app codebase. Prefer **snippet mode** only when they explicitly use the marketing snippet and cannot deploy code.
|
|
29
33
|
|
|
34
|
+
## Web vs mobile surface — classify by the PROPERTY, not the SDK
|
|
35
|
+
|
|
36
|
+
`create_experiment` takes a `surface` argument that sets the dashboard's data-source label (**Website** vs **Mobile app**). Choose it by **which property the experiment runs in**, not by which SDK resolves it:
|
|
37
|
+
|
|
38
|
+
- If the repo is a **mobile app** (has `capacitor.config.*` or `@apex-inc/capacitor-plugin`, or is React-Native/native), use `surface: "mobile"` for **all** its experiments — *even ones you implement with `useApexVariant` in the app's web layer*. They belong to the app, not a website. A mobile app should never show experiments under "Website".
|
|
39
|
+
- Use `surface: "web"` only for an actual website / web app with its own hostname.
|
|
40
|
+
|
|
41
|
+
(Web variants resolve with `useApexVariant` from `@apex-inc/react`; mobile variants resolve with `Apex.getVariant()` from `@apex-inc/capacitor-plugin` — but the *resolver* doesn't decide the source, the *property* does.)
|
|
42
|
+
|
|
43
|
+
## Visual / style variants — don't ship two identical arms
|
|
44
|
+
|
|
45
|
+
When the variable under test is **visual** (color, size, spacing, layout) rather than copy:
|
|
46
|
+
|
|
47
|
+
- **Always visually diff the arms.** A style variant that renders identical to control measures nothing. Screenshot both arms and look before activating — the screenshot pipeline exists partly to catch this. (Real incident, 2026-06-15: both arms shipped green because a class override silently lost.)
|
|
48
|
+
- **Class overrides are a trap without tailwind-merge.** Plain `className` concatenation keeps BOTH classes (e.g. `bg-primary` + `bg-black`) and the original usually wins, so the "variant" renders like control. Use an inline `style={{...}}` override or a class with guaranteed precedence.
|
|
49
|
+
- **One variable per test.** Change only the thing under test; keep everything else identical to control.
|
|
50
|
+
|
|
30
51
|
## Connecting from your IDE (no API key needed)
|
|
31
52
|
|
|
32
53
|
Apex MCP uses an **OAuth device flow** — you don't paste an API key. On the
|