@apex-inc/mcp-server 0.27.5 → 0.28.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/README.md +21 -0
- package/dist/add-journey-step.d.ts +29 -0
- package/dist/add-journey-step.d.ts.map +1 -0
- package/dist/add-journey-step.js +128 -0
- package/dist/add-journey-step.js.map +1 -0
- package/dist/adoption-compose.d.ts +7 -0
- package/dist/adoption-compose.d.ts.map +1 -1
- package/dist/adoption-compose.js +1 -0
- package/dist/adoption-compose.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/screenshot-cli.d.ts +35 -3
- package/dist/screenshot-cli.d.ts.map +1 -1
- package/dist/screenshot-cli.js +126 -38
- package/dist/screenshot-cli.js.map +1 -1
- package/dist/tools.d.ts +179 -26
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +182 -47
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
- package/skills/apex-adoption/SKILL.md +122 -81
- package/skills/apex-experimentation/SKILL.md +1 -1
package/package.json
CHANGED
|
@@ -1,108 +1,149 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: apex-adoption
|
|
3
|
-
description: Help users set up
|
|
3
|
+
description: Help users set up Apex Adoption — one Milestone per feature, one Adaptive Journey when they want letters (Nudge and/or Celebration), hours or days, unique Communications, and two stills. Use when they mention product adoption, activation letters, "people who haven't tried X", or feature adoption. A Milestone is NOT a Target.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Apex Adoption (MCP)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Adoption tracks whether each person has finished a Milestone. If they want letters, Apex stamps **one Adaptive Journey**:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
Trigger: signed up (or the anchor)
|
|
12
|
+
Wait until they finish
|
|
13
|
+
on event → Celebration Send → Exit (or Exit if no letter)
|
|
14
|
+
on deadline → Nudge Send → Exit (or Exit if just-track)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Just-track is a Milestone only. No Adaptive Journey. `scaffold: "none"`.
|
|
18
|
+
|
|
19
|
+
Do **not** clone two templates. Do **not** create a second live Adaptive Journey for the same Milestone.
|
|
20
|
+
|
|
21
|
+
## Words
|
|
22
|
+
|
|
23
|
+
- **Milestone** — they finished one thing. Not a Target (that is an aggregate number by a date).
|
|
24
|
+
- **Nudge** — the letter when they have not finished yet.
|
|
25
|
+
- **Celebration** — the letter when they finish.
|
|
26
|
+
- **Adaptive Journey** — the graph those letters ride.
|
|
27
|
+
- **Communication** — the letter on a Send.
|
|
28
|
+
- **Segment** — a saved Customers rule, only if they check save.
|
|
29
|
+
- **Not yet / Done** — picture labels, not objects.
|
|
30
|
+
|
|
31
|
+
Do not say reminder, congratulations, clock, or watch list as names they see.
|
|
9
32
|
|
|
10
33
|
## Core idea
|
|
11
34
|
|
|
12
|
-
- A
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- Milestones can be given a sequence **order** (which one accounts reach first). Ordering the full set unlocks the account-view "Path" funnel (a step-by-step drop-off chart). Unordered milestones are treated as independent (order-agnostic coverage).
|
|
35
|
+
- A Milestone is per person, per feature. Event (`report_run`) or trait (`plan = pro`).
|
|
36
|
+
- Hours or days from signup (or the anchor). `0` is right away. 1 hour is not right away.
|
|
37
|
+
- New Milestones default to **from now on** (`enroll_mode: "future"`). Do not publish a short clock on everyone already here (`enroll_mode: "all"`).
|
|
38
|
+
- Each Send gets its **own** Communication. Never reuse `comm-adoption-nudge` or `comm-adoption-celebration`.
|
|
39
|
+
- Extra Nudges are more hours or days on the deadline arm (duration Wait + Send). One lift for the protocol.
|
|
40
|
+
- Completing the Milestone stops leftover Nudges (exit rule on the done event).
|
|
41
|
+
- Celebration Send is holdout-exempt. Nudge honors holdout, opt-out, and the Nudge cap.
|
|
42
|
+
- Already finished when the Wait starts → event arm. Do not sit to the deadline and Nudge.
|
|
21
43
|
|
|
22
|
-
Name live hosts (`list_workspace_environments` / `set_workspace_environments` or Foundations) before you trust Production
|
|
44
|
+
Name live hosts (`list_workspace_environments` / `set_workspace_environments` or Foundations) before you trust Production numbers. Unmatched hosts stay Unclassified.
|
|
23
45
|
|
|
24
46
|
## When to Activate
|
|
25
47
|
|
|
26
|
-
- "Nudge
|
|
27
|
-
- "Which features are people not
|
|
28
|
-
- "Set up
|
|
48
|
+
- "Nudge people who signed up but never ran their first report."
|
|
49
|
+
- "Which features are people not finishing?"
|
|
50
|
+
- "Set up activation letters."
|
|
29
51
|
|
|
30
52
|
## Tool Map
|
|
31
53
|
|
|
32
54
|
| Tool | When to use |
|
|
33
55
|
|---|---|
|
|
34
|
-
| `list_adoption_milestones` | See the
|
|
35
|
-
| `get_adoption_milestone` | Inspect one
|
|
36
|
-
| `create_adoption_milestone` | Define a
|
|
37
|
-
| `compose_adoption_milestone` | Create a
|
|
38
|
-
| `update_adoption_milestone` | Change priority / order /
|
|
39
|
-
| `reorder_adoption_milestones` |
|
|
40
|
-
| `delete_adoption_milestone` | Remove a
|
|
41
|
-
| `get_adoption_metrics` |
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
56
|
+
| `list_adoption_milestones` | See the current Milestones |
|
|
57
|
+
| `get_adoption_milestone` | Inspect one |
|
|
58
|
+
| `create_adoption_milestone` | Define a Milestone (just-track unless they compose) |
|
|
59
|
+
| `compose_adoption_milestone` | Create a Milestone and stamp **one** Adaptive Journey |
|
|
60
|
+
| `update_adoption_milestone` | Change priority / order / hours or days / on-off |
|
|
61
|
+
| `reorder_adoption_milestones` | Sequence for the Path funnel |
|
|
62
|
+
| `delete_adoption_milestone` | Remove a Milestone |
|
|
63
|
+
| `get_adoption_metrics` | Funnel + one lift number |
|
|
64
|
+
| `attach_adoption_milestone_still` | Attach Not yet or Done |
|
|
65
|
+
| `list_adoption_milestone_stills` | List those two pictures |
|
|
66
|
+
| `recapture_adoption_milestone_stills` | Capture from public pages on a named host |
|
|
67
|
+
| `edit_communication` / `set_journey_send` | Write the letter on an existing Send |
|
|
68
|
+
| `publish_journey` | Go live after preview |
|
|
69
|
+
| `add_journey_step` | Hand-built Adaptive Journey only. Prefer compose. |
|
|
70
|
+
|
|
71
|
+
Read-only summary: `apex://adoption`.
|
|
72
|
+
|
|
73
|
+
## Compose
|
|
74
|
+
|
|
75
|
+
`compose_adoption_milestone` with `scaffold`:
|
|
76
|
+
|
|
77
|
+
- `both` (default) — Nudge + Celebration
|
|
78
|
+
- `nudge` — deadline letter only
|
|
79
|
+
- `celebration` — finish letter only
|
|
80
|
+
- `none` — just-track
|
|
81
|
+
|
|
82
|
+
Returns one `journey_id` (also `nudge_journey_id` for old callers) and each Send as `{ role, step_id, comm_id }`. `celebration_journey_id` is null on new rows.
|
|
83
|
+
|
|
84
|
+
Params: `action_label`, `gap_hours` or `gap_days`, `nudge_clocks` (each hours or days), `save_not_yet_segment`, `save_done_segment`, `enroll_mode`.
|
|
85
|
+
|
|
86
|
+
Preview each Communication, then `publish_journey`. Leave the Milestone off until they confirm.
|
|
87
|
+
|
|
88
|
+
Do not `add_journey_step` send on a compose-built path. Point the existing Send with `set_journey_send`.
|
|
89
|
+
|
|
90
|
+
## Stills
|
|
91
|
+
|
|
92
|
+
Two pictures: **Not yet** (empty screen) and **Done** (finished). Shop or agent attaches. No Apex default stills. Apex cannot sign into their product.
|
|
93
|
+
|
|
94
|
+
**Public page** (anyone can open it):
|
|
95
|
+
|
|
96
|
+
- Capture on the card, or `recapture_adoption_milestone_stills` on a **named workspace host**. Not localhost. A login wall writes nothing.
|
|
97
|
+
- Or the CLI without a login file.
|
|
98
|
+
|
|
99
|
+
**Signed-in product** (almost every SaaS moment) — Playwright on THEIR machine:
|
|
100
|
+
|
|
101
|
+
1. Save a login file they already have from their tests, or:
|
|
102
|
+
`npx playwright codegen --save-storage .apex/auth.json https://app.theirproduct.com`
|
|
103
|
+
2. Sit both screens:
|
|
104
|
+
```
|
|
105
|
+
npx @apex-inc/mcp-server screenshot --milestone <id> --state not_yet --url https://app.theirproduct.com/reports --storage-state .apex/auth.json
|
|
106
|
+
npx @apex-inc/mcp-server screenshot --milestone <id> --state done --url https://app.theirproduct.com/reports --storage-state .apex/auth.json
|
|
107
|
+
```
|
|
108
|
+
3. Do not send the login file to Apex. Only the picture uploads.
|
|
109
|
+
4. If they already have a PNG, `attach_adoption_milestone_still`.
|
|
110
|
+
|
|
111
|
+
Do not use hosted recapture for a login wall.
|
|
112
|
+
|
|
113
|
+
## Hand-built Adaptive Journey
|
|
114
|
+
|
|
115
|
+
Only when they are not using compose:
|
|
116
|
+
|
|
117
|
+
1. `create_journey` → `set_journey_trigger`
|
|
118
|
+
2. `add_journey_step` `kind=wait` `mode=until_event` `trigger_contract_id` `deadline_iso`
|
|
119
|
+
3. `add_journey_step` `kind=send` `arm=event` or `arm=deadline`
|
|
120
|
+
4. `set_journey_send` if the Send already exists
|
|
79
121
|
|
|
80
122
|
## Tool Invocation Order
|
|
81
123
|
|
|
82
|
-
### "Nudge
|
|
83
|
-
1. `list_adoption_milestones`
|
|
84
|
-
2. `
|
|
85
|
-
3.
|
|
86
|
-
|
|
124
|
+
### "Nudge people who haven't run their first report"
|
|
125
|
+
1. `list_adoption_milestones`
|
|
126
|
+
2. `compose_adoption_milestone` with `scaffold: "nudge"`, `enroll_mode: "future"`, hours or days. Leave `active` off.
|
|
127
|
+
3. Preview the Communication. `publish_journey`. Then turn the Milestone on.
|
|
128
|
+
|
|
129
|
+
### "Celebrate when they start their first experiment"
|
|
130
|
+
1. `compose_adoption_milestone` `scaffold: "celebration"` (or `both` if they also want a Nudge).
|
|
131
|
+
2. Preview. Publish. Do not scaffold a Celebration on an event that already has a published operator letter — pass `scaffold: "nudge"`.
|
|
87
132
|
|
|
88
|
-
### "
|
|
89
|
-
1. `compose_adoption_milestone`
|
|
90
|
-
2. Tell the user the celebration journey is a **draft**. Preview with `preview_communication`, then `publish_journey` (dry-run first).
|
|
91
|
-
3. Turning the milestone on is separate from publishing the journey; both must be live for the celebration to send.
|
|
133
|
+
### "Just track — no letter"
|
|
134
|
+
1. `compose_adoption_milestone` `scaffold: "none"`.
|
|
92
135
|
|
|
93
|
-
### "
|
|
94
|
-
|
|
95
|
-
2. The response carries `nudge_journey_id`, `celebration_journey_id`, and `warnings`. Preview the letter with `preview_communication`, then `publish_journey` (dry-run first). Do not activate until the letter is previewed and the journey is published.
|
|
96
|
-
3. Do not scaffold a celebration on an event that already has a published operator letter (experiment started, domain verified, etc.) — pass `scaffold: "nudge"`.
|
|
97
|
-
4. Turn the milestone on (`update_adoption_milestone` `active: true`) once its nudge is published, so it can measure lift vs the holdout.
|
|
136
|
+
### "Save not-yet as a Segment"
|
|
137
|
+
Pass `save_not_yet_segment: true` (and/or `save_done_segment`) on compose. Names: `Not yet: {name}` / `Done: {name}`. Completing drops them from not-yet. The Adaptive Journey watch list stays private if they do not check this.
|
|
98
138
|
|
|
99
|
-
### "Put
|
|
100
|
-
|
|
101
|
-
2. `reorder_adoption_milestones` with `orderedIds` in the intended sequence (activation before depth).
|
|
102
|
-
3. Tell the user the account view's "Path" funnel is now unlocked — it shows drop-off between consecutive milestones. Without a full order it stays on the order-agnostic "Coverage" view.
|
|
139
|
+
### "Put pictures on a Milestone"
|
|
140
|
+
Public page → `recapture_adoption_milestone_stills`. Signed-in page → CLI with `--storage-state` (recipe under Stills). Already have a PNG → `attach_adoption_milestone_still`.
|
|
103
141
|
|
|
104
142
|
## Guardrails
|
|
105
143
|
|
|
106
|
-
- Milestones start OFF.
|
|
107
|
-
- Never call
|
|
108
|
-
-
|
|
144
|
+
- Milestones start OFF.
|
|
145
|
+
- Never call a Milestone a Target or a goal.
|
|
146
|
+
- Unique Communications. Never reuse the shared catalog letter ids.
|
|
147
|
+
- Do not publish a short clock on everyone already here.
|
|
148
|
+
- Do not publish Website is talking / Send from your own domain / Started your first experiment / Connected your first integration unless they ask — those are Apex's own product drafts.
|
|
149
|
+
- Capture fail never writes a still.
|
|
@@ -69,7 +69,7 @@ Interactive flows: MCP prompts `new-experiment` and `experiment-review` orchestr
|
|
|
69
69
|
|
|
70
70
|
## Screenshots, exposure & the wiring gate
|
|
71
71
|
|
|
72
|
-
- **Screenshots are first-class.** SDK / Cursor experiments author the variant in local code. Apex does **not** auto-capture a public URL on create — that page does not have the unpublished variant, and a guessed host (a sibling workspace's brand domain) shows the wrong site on both arms. Capture both arms on localhost with `?_apex_preview=control|variant_a&_apex_exp=<id>`, then `attach_experiment_asset({ experimentId, variantKey, imageBase64 })
|
|
72
|
+
- **Screenshots are first-class.** SDK / Cursor experiments author the variant in local code. Apex does **not** auto-capture a public URL on create — that page does not have the unpublished variant, and a guessed host (a sibling workspace's brand domain) shows the wrong site on both arms. Capture both arms on localhost with `?_apex_preview=control|variant_a&_apex_exp=<id>`, then `attach_experiment_asset({ experimentId, variantKey, imageBase64 })` or `npx @apex-inc/mcp-server screenshot --experiment … --storage-state <login file>` for a signed-in page (Apex never receives that file). After deploy, `recapture_experiment_screenshots` refreshes the live host. Snippet/DOM experiments created in the dashboard still auto-capture a public URL whose variant already lives there.
|
|
73
73
|
- **Target URL is this workspace.** `target_url` must be a host named on the **active** workspace (`list_workspace_environments` + the workspace site). If the merchant already named a workspace, switch to it — do not ask which workspace again. If they have multiple hosts on that workspace, ask which URL. Never guess `apex.inc` or any other workspace's domain.
|
|
74
74
|
- **Mobile/Capacitor experiments capture on-device.** When the experiment runs on an authed in-app screen (servers can't reach it), tell the dev to call `Apex.captureVariantScreenshot({ experimentId, variantKey })` on the variant's screen, keyed to the resolved variant in a `useEffect`, in a debug build (`Apex.initialize({ ..., debug: true })`). It no-ops in production and lands the shot on the dashboard card + gallery like web/agent captures.
|
|
75
75
|
- **Exposure auto-fires.** When a variant resolves via `useApexVariant` (web) or `Apex.getVariant()` (mobile), the SDK fires the canonical `experiment_exposure` event — the denominator for results. You don't fire it manually.
|