@apex-inc/mcp-server 0.28.0 → 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/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.js +2 -2
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
- package/skills/apex-adoption/SKILL.md +22 -3
- package/skills/apex-experimentation/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,27 @@ Add to `.cursor/mcp.json` (or your MCP client's equivalent):
|
|
|
40
40
|
| `APEX_API_KEY` | Yes | API key generated in your Apex dashboard |
|
|
41
41
|
| `APEX_PROJECT_KEY` | No | Defaults to your first workspace |
|
|
42
42
|
|
|
43
|
+
## Screenshot CLI
|
|
44
|
+
|
|
45
|
+
Playwright runs on **their** machine, then the picture uploads. Apex cannot sign into their product.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Experiment arm (public or localhost)
|
|
49
|
+
npx @apex-inc/mcp-server screenshot \
|
|
50
|
+
--experiment <id> --variant control --url https://example.com --preview
|
|
51
|
+
|
|
52
|
+
# Milestone still — signed-in product
|
|
53
|
+
npx playwright codegen --save-storage .apex/auth.json https://app.theirproduct.com
|
|
54
|
+
npx @apex-inc/mcp-server screenshot \
|
|
55
|
+
--milestone <id> --state not_yet --url https://app.theirproduct.com/reports \
|
|
56
|
+
--storage-state .apex/auth.json
|
|
57
|
+
npx @apex-inc/mcp-server screenshot \
|
|
58
|
+
--milestone <id> --state done --url https://app.theirproduct.com/reports \
|
|
59
|
+
--storage-state .apex/auth.json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`--storage-state` is a login file on this machine. Apex never receives it — only the picture. Install Playwright once: `npm i -D playwright && npx playwright install chromium`.
|
|
63
|
+
|
|
43
64
|
## License
|
|
44
65
|
|
|
45
66
|
MIT — see [LICENSE](./LICENSE)
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,8 @@ import { sendStartupPing, discoverContext } from "./api-client.js";
|
|
|
9
9
|
import { MCP_SERVER_VERSION } from "./version.js";
|
|
10
10
|
import { advertiseShape, restoreArgs, normalizeInbound } from "./param-casing.js";
|
|
11
11
|
// Subcommand dispatch: `npx @apex-inc/mcp-server screenshot <opts>` runs the
|
|
12
|
-
// Playwright capture flow
|
|
12
|
+
// Playwright capture flow (experiment arm or Milestone still) and exits,
|
|
13
|
+
// instead of starting the stdio server.
|
|
13
14
|
// The default (no subcommand) behavior stays: start the MCP server.
|
|
14
15
|
if (process.argv[2] === "screenshot") {
|
|
15
16
|
const { runScreenshotCli } = await import("./screenshot-cli.js");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAElF,6EAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EA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AAK,QAAQ,EACtC,CAAC;gBACD,MAAM,GAAG,GAAI,eAAoF,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACjH,IAAI,GAAG,EAAE,CAAC;oBACR,CAAC,CAAC,MAAM,CAAC,SAAS,GAAG,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC9E,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,2CAA2C;QAC7C,CAAC;QACD,OAAO,cAAc,EAAE,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC,CAAC;IACF,4EAA4E;IAC5E,2EAA2E;IAC3E,0EAA0E;IAC1E,+DAA+D;IAC/D,MAAM,UAAU,GAAG,MAAM,eAAe,EAAE,CAAC;IAC3C,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,UAAU,UAAU,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,eAAe,EAAE,CAAC;AACpB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,CAAC;IACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/screenshot-cli.d.ts
CHANGED
|
@@ -2,9 +2,14 @@
|
|
|
2
2
|
* `screenshot` CLI subcommand for the Apex MCP server.
|
|
3
3
|
*
|
|
4
4
|
* Invoked as `npx @apex-inc/mcp-server screenshot <opts>` (dispatched from
|
|
5
|
-
* index.ts when `process.argv[2] === "screenshot"`).
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* index.ts when `process.argv[2] === "screenshot"`). Playwright runs on
|
|
6
|
+
* THEIR machine, then the picture uploads:
|
|
7
|
+
*
|
|
8
|
+
* Experiment — POST /api/experiments/{id}/assets (source: "agent")
|
|
9
|
+
* Milestone — POST /api/adoption/milestones/{id}/assets (source: "agent")
|
|
10
|
+
*
|
|
11
|
+
* Signed-in product pages need `--storage-state` (a Playwright login file
|
|
12
|
+
* on this machine). Apex never receives that file — only the picture.
|
|
8
13
|
*
|
|
9
14
|
* Playwright is a LAZY / OPTIONAL dependency: it lives in optionalDependencies,
|
|
10
15
|
* is never imported at the top level, and is resolved with a runtime
|
|
@@ -12,5 +17,32 @@
|
|
|
12
17
|
* install hint and exit 1. Because it's only imported dynamically (and typed
|
|
13
18
|
* with a minimal local interface below), tsc builds cleanly without the package.
|
|
14
19
|
*/
|
|
20
|
+
export type ScreenshotViewport = "desktop" | "tablet" | "mobile";
|
|
21
|
+
type ScreenshotShared = {
|
|
22
|
+
url: string;
|
|
23
|
+
viewport: ScreenshotViewport;
|
|
24
|
+
fullPage: boolean;
|
|
25
|
+
wait?: number;
|
|
26
|
+
storageState?: string;
|
|
27
|
+
headed: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type ExperimentScreenshotOptions = ScreenshotShared & {
|
|
30
|
+
kind: "experiment";
|
|
31
|
+
experiment: string;
|
|
32
|
+
variant: string;
|
|
33
|
+
preview: boolean;
|
|
34
|
+
commit?: string;
|
|
35
|
+
};
|
|
36
|
+
export type MilestoneScreenshotOptions = ScreenshotShared & {
|
|
37
|
+
kind: "milestone";
|
|
38
|
+
milestone: string;
|
|
39
|
+
state: "not_yet" | "done";
|
|
40
|
+
};
|
|
41
|
+
export type ScreenshotOptions = ExperimentScreenshotOptions | MilestoneScreenshotOptions;
|
|
42
|
+
/** Login file stays on this machine. A URL would send someone else's cookies at a fetch. */
|
|
43
|
+
export declare function assertLocalStorageState(filePath: string): string;
|
|
44
|
+
/** Parse `--flag value` and `--bool` style argv into a typed options bag. */
|
|
45
|
+
export declare function parseScreenshotArgs(argv: string[]): ScreenshotOptions;
|
|
15
46
|
export declare function runScreenshotCli(argv: string[]): Promise<void>;
|
|
47
|
+
export {};
|
|
16
48
|
//# sourceMappingURL=screenshot-cli.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot-cli.d.ts","sourceRoot":"","sources":["../src/screenshot-cli.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"screenshot-cli.d.ts","sourceRoot":"","sources":["../src/screenshot-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAyDH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjE,KAAK,gBAAgB,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,GAAG;IAC3D,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,GAAG;IAC1D,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB,2BAA2B,GAC3B,0BAA0B,CAAC;AAM/B,4FAA4F;AAC5F,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAehE;AAUD,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,iBAAiB,CA2GrE;AAmCD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAiGpE"}
|
package/dist/screenshot-cli.js
CHANGED
|
@@ -2,9 +2,14 @@
|
|
|
2
2
|
* `screenshot` CLI subcommand for the Apex MCP server.
|
|
3
3
|
*
|
|
4
4
|
* Invoked as `npx @apex-inc/mcp-server screenshot <opts>` (dispatched from
|
|
5
|
-
* index.ts when `process.argv[2] === "screenshot"`).
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* index.ts when `process.argv[2] === "screenshot"`). Playwright runs on
|
|
6
|
+
* THEIR machine, then the picture uploads:
|
|
7
|
+
*
|
|
8
|
+
* Experiment — POST /api/experiments/{id}/assets (source: "agent")
|
|
9
|
+
* Milestone — POST /api/adoption/milestones/{id}/assets (source: "agent")
|
|
10
|
+
*
|
|
11
|
+
* Signed-in product pages need `--storage-state` (a Playwright login file
|
|
12
|
+
* on this machine). Apex never receives that file — only the picture.
|
|
8
13
|
*
|
|
9
14
|
* Playwright is a LAZY / OPTIONAL dependency: it lives in optionalDependencies,
|
|
10
15
|
* is never imported at the top level, and is resolved with a runtime
|
|
@@ -23,8 +28,36 @@ const VIEWPORT_HEIGHTS = {
|
|
|
23
28
|
tablet: 1112,
|
|
24
29
|
mobile: 844,
|
|
25
30
|
};
|
|
31
|
+
const USAGE = `Usage:
|
|
32
|
+
apex-mcp screenshot --experiment <id> --variant <key> --url <url>
|
|
33
|
+
[--viewport desktop|tablet|mobile] [--full-page] [--preview]
|
|
34
|
+
[--commit <sha>] [--wait <ms>] [--storage-state <file>] [--headed]
|
|
35
|
+
apex-mcp screenshot --milestone <id> --state not_yet|done --url <url>
|
|
36
|
+
[--viewport desktop|tablet|mobile] [--full-page]
|
|
37
|
+
[--wait <ms>] [--storage-state <file>] [--headed]
|
|
38
|
+
|
|
39
|
+
Signed-in pages: save a login file on this machine
|
|
40
|
+
(npx playwright codegen --save-storage .apex/auth.json <url>),
|
|
41
|
+
then pass --storage-state .apex/auth.json. Apex never receives that file.`;
|
|
42
|
+
/** Login file stays on this machine. A URL would send someone else's cookies at a fetch. */
|
|
43
|
+
export function assertLocalStorageState(filePath) {
|
|
44
|
+
const trimmed = filePath.trim();
|
|
45
|
+
if (trimmed.length === 0) {
|
|
46
|
+
throw new Error("Missing --storage-state path.");
|
|
47
|
+
}
|
|
48
|
+
if (/^https?:\/\//i.test(trimmed) ||
|
|
49
|
+
/^file:/i.test(trimmed) ||
|
|
50
|
+
trimmed.startsWith("//")) {
|
|
51
|
+
throw new Error("--storage-state must be a login file on this machine. Do not pass a URL. Apex never receives that file — only the picture.");
|
|
52
|
+
}
|
|
53
|
+
return trimmed;
|
|
54
|
+
}
|
|
55
|
+
function flagString(opts, name) {
|
|
56
|
+
const v = opts[name];
|
|
57
|
+
return typeof v === "string" && v.length > 0 ? v : undefined;
|
|
58
|
+
}
|
|
26
59
|
/** Parse `--flag value` and `--bool` style argv into a typed options bag. */
|
|
27
|
-
function
|
|
60
|
+
export function parseScreenshotArgs(argv) {
|
|
28
61
|
const opts = {};
|
|
29
62
|
for (let i = 0; i < argv.length; i++) {
|
|
30
63
|
const arg = argv[i];
|
|
@@ -32,8 +65,7 @@ function parseArgs(argv) {
|
|
|
32
65
|
continue;
|
|
33
66
|
const flag = arg.slice(2);
|
|
34
67
|
const next = argv[i + 1];
|
|
35
|
-
|
|
36
|
-
if (flag === "full-page" || flag === "preview") {
|
|
68
|
+
if (flag === "full-page" || flag === "preview" || flag === "headed") {
|
|
37
69
|
opts[flag] = true;
|
|
38
70
|
continue;
|
|
39
71
|
}
|
|
@@ -46,35 +78,73 @@ function parseArgs(argv) {
|
|
|
46
78
|
}
|
|
47
79
|
}
|
|
48
80
|
const required = (name) => {
|
|
49
|
-
const v = opts
|
|
50
|
-
if (
|
|
51
|
-
throw new Error(`Missing required flag --${name}
|
|
52
|
-
` apex-mcp screenshot --experiment <id> --variant <key> --url <url> ` +
|
|
53
|
-
`[--viewport desktop|tablet|mobile] [--full-page] [--preview] ` +
|
|
54
|
-
`[--commit <sha>] [--wait <ms>]`);
|
|
81
|
+
const v = flagString(opts, name);
|
|
82
|
+
if (!v) {
|
|
83
|
+
throw new Error(`Missing required flag --${name}.\n${USAGE}`);
|
|
55
84
|
}
|
|
56
85
|
return v;
|
|
57
86
|
};
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
87
|
+
const experiment = flagString(opts, "experiment");
|
|
88
|
+
const milestone = flagString(opts, "milestone");
|
|
89
|
+
if (experiment && milestone) {
|
|
90
|
+
throw new Error("Pass --experiment or --milestone, not both.\n" + USAGE);
|
|
61
91
|
}
|
|
92
|
+
if (!experiment && !milestone) {
|
|
93
|
+
throw new Error("Pass --experiment <id> --variant <key> or --milestone <id> --state not_yet|done.\n" +
|
|
94
|
+
USAGE);
|
|
95
|
+
}
|
|
96
|
+
const viewportRaw = flagString(opts, "viewport") ?? "desktop";
|
|
97
|
+
if (!(viewportRaw in VIEWPORT_WIDTHS)) {
|
|
98
|
+
throw new Error(`Invalid --viewport "${viewportRaw}". Must be one of: desktop, tablet, mobile.`);
|
|
99
|
+
}
|
|
100
|
+
const viewport = viewportRaw;
|
|
62
101
|
let wait;
|
|
63
|
-
|
|
64
|
-
|
|
102
|
+
const waitRaw = flagString(opts, "wait");
|
|
103
|
+
if (waitRaw !== undefined) {
|
|
104
|
+
wait = Number(waitRaw);
|
|
65
105
|
if (!Number.isFinite(wait) || wait < 0) {
|
|
66
|
-
throw new Error(`Invalid --wait "${
|
|
106
|
+
throw new Error(`Invalid --wait "${waitRaw}". Must be a non-negative number of ms.`);
|
|
67
107
|
}
|
|
68
108
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
109
|
+
const storageRaw = flagString(opts, "storage-state");
|
|
110
|
+
const storageState = storageRaw
|
|
111
|
+
? assertLocalStorageState(storageRaw)
|
|
112
|
+
: undefined;
|
|
113
|
+
const shared = {
|
|
72
114
|
url: required("url"),
|
|
73
115
|
viewport,
|
|
74
116
|
fullPage: opts["full-page"] === true,
|
|
75
|
-
preview: opts.preview === true,
|
|
76
|
-
commit: typeof opts.commit === "string" ? opts.commit : undefined,
|
|
77
117
|
wait,
|
|
118
|
+
storageState,
|
|
119
|
+
headed: opts.headed === true,
|
|
120
|
+
};
|
|
121
|
+
if (milestone) {
|
|
122
|
+
if (opts.preview === true) {
|
|
123
|
+
throw new Error("--preview is for experiment arms only. For a Milestone, sit the empty or finished URL.\n" +
|
|
124
|
+
USAGE);
|
|
125
|
+
}
|
|
126
|
+
if (flagString(opts, "variant") || flagString(opts, "commit")) {
|
|
127
|
+
throw new Error("--variant and --commit are for experiments. A Milestone uses --state not_yet|done.\n" +
|
|
128
|
+
USAGE);
|
|
129
|
+
}
|
|
130
|
+
const state = required("state");
|
|
131
|
+
if (state !== "not_yet" && state !== "done") {
|
|
132
|
+
throw new Error(`Invalid --state "${state}". Must be not_yet (empty screen) or done (finished).`);
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
kind: "milestone",
|
|
136
|
+
milestone,
|
|
137
|
+
state,
|
|
138
|
+
...shared,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
kind: "experiment",
|
|
143
|
+
experiment: experiment,
|
|
144
|
+
variant: required("variant"),
|
|
145
|
+
preview: opts.preview === true,
|
|
146
|
+
commit: flagString(opts, "commit"),
|
|
147
|
+
...shared,
|
|
78
148
|
};
|
|
79
149
|
}
|
|
80
150
|
/** Lazily load Playwright; print an actionable hint + exit 1 if it's missing. */
|
|
@@ -107,20 +177,22 @@ function applyPreview(url, exp, variant) {
|
|
|
107
177
|
export async function runScreenshotCli(argv) {
|
|
108
178
|
let opts;
|
|
109
179
|
try {
|
|
110
|
-
opts =
|
|
180
|
+
opts = parseScreenshotArgs(argv);
|
|
111
181
|
}
|
|
112
182
|
catch (err) {
|
|
113
183
|
console.error(err.message);
|
|
114
184
|
process.exit(1);
|
|
185
|
+
return;
|
|
115
186
|
}
|
|
116
|
-
const targetUrl = opts.preview
|
|
187
|
+
const targetUrl = opts.kind === "experiment" && opts.preview
|
|
117
188
|
? applyPreview(opts.url, opts.experiment, opts.variant)
|
|
118
189
|
: opts.url;
|
|
119
190
|
const { chromium } = await loadPlaywright();
|
|
120
191
|
let browser;
|
|
121
192
|
try {
|
|
122
|
-
browser = await chromium.launch({ headless:
|
|
123
|
-
const
|
|
193
|
+
browser = await chromium.launch({ headless: !opts.headed });
|
|
194
|
+
const context = await browser.newContext(opts.storageState ? { storageState: opts.storageState } : {});
|
|
195
|
+
const page = await context.newPage();
|
|
124
196
|
await page.setViewportSize({
|
|
125
197
|
width: VIEWPORT_WIDTHS[opts.viewport],
|
|
126
198
|
height: VIEWPORT_HEIGHTS[opts.viewport],
|
|
@@ -133,20 +205,36 @@ export async function runScreenshotCli(argv) {
|
|
|
133
205
|
const buffer = await page.screenshot({ fullPage: opts.fullPage, type: "png" });
|
|
134
206
|
const imageBase64 = Buffer.from(buffer).toString("base64");
|
|
135
207
|
console.error("[apex] Uploading screenshot to Apex…");
|
|
136
|
-
const res =
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
208
|
+
const res = opts.kind === "experiment"
|
|
209
|
+
? await apiPost(`/api/experiments/${encodeURIComponent(opts.experiment)}/assets`, {
|
|
210
|
+
variantKey: opts.variant,
|
|
211
|
+
source: "agent",
|
|
212
|
+
viewport: opts.viewport,
|
|
213
|
+
imageBase64,
|
|
214
|
+
format: "png",
|
|
215
|
+
label: `Captured by CLI (${opts.viewport})`,
|
|
216
|
+
...(opts.commit ? { commitSha: opts.commit } : {}),
|
|
217
|
+
})
|
|
218
|
+
: await apiPost(`/api/adoption/milestones/${encodeURIComponent(opts.milestone)}/assets`, {
|
|
219
|
+
state: opts.state,
|
|
220
|
+
source: "agent",
|
|
221
|
+
viewport: opts.viewport,
|
|
222
|
+
imageBase64,
|
|
223
|
+
format: "png",
|
|
224
|
+
label: `Captured by CLI (${opts.viewport})`,
|
|
225
|
+
});
|
|
145
226
|
const assetUrl = res?.data?.url;
|
|
146
227
|
if (assetUrl) {
|
|
147
228
|
console.log(assetUrl);
|
|
148
|
-
|
|
149
|
-
"
|
|
229
|
+
if (opts.kind === "experiment") {
|
|
230
|
+
console.error("[apex] Done. This screenshot now appears on the experiment's dashboard " +
|
|
231
|
+
"card and in its screenshot gallery.");
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
console.error(opts.state === "done"
|
|
235
|
+
? "[apex] Done. That finished screen is now on the Milestone."
|
|
236
|
+
: "[apex] Done. That empty screen is now on the Milestone.");
|
|
237
|
+
}
|
|
150
238
|
}
|
|
151
239
|
else {
|
|
152
240
|
console.error("[apex] Upload succeeded but the response did not include an asset URL.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot-cli.js","sourceRoot":"","sources":["../src/screenshot-cli.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"screenshot-cli.js","sourceRoot":"","sources":["../src/screenshot-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,eAAe,GAA2B;IAC9C,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;CACZ,CAAC;AAEF,MAAM,gBAAgB,GAA2B;IAC/C,OAAO,EAAE,GAAG;IACZ,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,GAAG;CACZ,CAAC;AAEF,MAAM,KAAK,GACT;;;;;;;;;;4EAU0E,CAAC;AA+D7E,4FAA4F;AAC5F,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAChC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,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B,IAAI,CAAC,QAAQ,GAAG;aAC5C,CACF,CAAC;QAER,MAAM,QAAQ,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC;QAChC,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACtB,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;gBAC/B,OAAO,CAAC,KAAK,CACX,yEAAyE;oBACvE,qCAAqC,CACxC,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CACX,IAAI,CAAC,KAAK,KAAK,MAAM;oBACnB,CAAC,CAAC,4DAA4D;oBAC9D,CAAC,CAAC,yDAAyD,CAC9D,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CACX,wEAAwE,CACzE,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,6BAA8B,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACrE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;YAAS,CAAC;QACT,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;YACxB,CAAC;YAAC,MAAM,CAAC;gBACP,iBAAiB;YACnB,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/tools.js
CHANGED
|
@@ -5658,7 +5658,7 @@ _Suggest the next step the user should tackle based on what's incomplete in the
|
|
|
5658
5658
|
},
|
|
5659
5659
|
},
|
|
5660
5660
|
attach_adoption_milestone_still: {
|
|
5661
|
-
description: `${APEX} — Attach a still of the empty screen (not_yet) or the finished screen (done) to a Milestone. Same two pictures the shop uploads. Pass imageBase64 or a public url. A Milestone is NOT a Target.`,
|
|
5661
|
+
description: `${APEX} — Attach a still of the empty screen (not_yet) or the finished screen (done) to a Milestone. Same two pictures the shop uploads. Pass imageBase64 or a public url. For a signed-in product page, capture on their machine with \`npx @apex-inc/mcp-server screenshot --milestone … --state not_yet|done --url … --storage-state <login file>\` — do not use hosted recapture. A Milestone is NOT a Target.`,
|
|
5662
5662
|
schema: z.object({
|
|
5663
5663
|
milestoneId: z.string().describe("The Milestone to attach the still to"),
|
|
5664
5664
|
state: z.enum(["not_yet", "done"]).describe("not_yet = empty screen; done = finished screen"),
|
|
@@ -5702,7 +5702,7 @@ _Suggest the next step the user should tackle based on what's incomplete in the
|
|
|
5702
5702
|
},
|
|
5703
5703
|
},
|
|
5704
5704
|
recapture_adoption_milestone_stills: {
|
|
5705
|
-
description: `${APEX} — Capture the Not yet and Done stills from public pages on a named workspace host. Not localhost. A login wall fails honestly and writes nothing
|
|
5705
|
+
description: `${APEX} — Capture the Not yet and Done stills from public pages on a named workspace host. Not localhost. A login wall fails honestly and writes nothing. For a signed-in product page, sit it on their machine: \`npx @apex-inc/mcp-server screenshot --milestone … --storage-state <login file>\`. Same two pictures the shop uploads.`,
|
|
5706
5706
|
schema: z.object({
|
|
5707
5707
|
milestoneId: z.string().describe("The Milestone to capture stills for"),
|
|
5708
5708
|
notYetUrl: z.string().url().optional().describe("Public https URL of the empty screen."),
|