@pluswithai/cli 0.0.0-stage → 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pluswithai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,130 @@
1
- # Temporary Holding Version
1
+ # @pluswithai/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Run your [Pluswithai](https://pluswithai.com) tests from CI and the terminal.
4
+ It starts the runs, waits for them and exits non-zero when one fails.
5
+
6
+ - No runtime dependencies. Node 18.3 or later.
7
+ - Readable CI logs, a GitHub step summary, failure annotations and JUnit XML.
8
+ - Your API key is only read from the environment, and it is never printed.
9
+
10
+ ## Quick start
11
+
12
+ 1. In the app, open **API keys** in the sidebar, choose **Create key**, then pick **CI**.
13
+ 2. Export the key, then run your project's tests:
14
+
15
+ ```sh
16
+ export PLUSWITHAI_API_KEY=pwai_…
17
+ npx @pluswithai/cli run --project shop
18
+ ```
19
+
20
+ ```
21
+ Started 2 runs in shop. Waiting for results…
22
+ ✓ tests/home.spec.ts passed 8.4s
23
+ ✗ tests/checkout.spec.ts failed 21.0s
24
+ Pluswithai · shop: 1 passed, 1 failed
25
+ ✗ tests/checkout.spec.ts failed 21.0s
26
+ Details: https://pluswithai.com/app?project=shop
27
+ ```
28
+
29
+ ## GitHub Actions
30
+
31
+ Store the key as the repository secret `PLUSWITHAI_API_KEY`:
32
+
33
+ ```yaml
34
+ name: Pluswithai tests
35
+ on: [push, workflow_dispatch]
36
+
37
+ jobs:
38
+ e2e:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/setup-node@v4
42
+ with:
43
+ node-version: 22
44
+ - run: npx -y @pluswithai/cli run --project shop --junit reports/pluswithai.xml
45
+ env:
46
+ PLUSWITHAI_API_KEY: ${{ secrets.PLUSWITHAI_API_KEY }}
47
+ ```
48
+
49
+ Inside GitHub Actions, the CLI also:
50
+
51
+ - writes a table of the results to the job's summary page (turn it off with `--no-summary`);
52
+ - adds an error annotation for every failed test.
53
+
54
+ ## Commands
55
+
56
+ | Command | What it does |
57
+ |---|---|
58
+ | `pluswithai run --project <name>` | Start runs, wait for them, exit with their verdict |
59
+ | `pluswithai projects` | List your projects |
60
+ | `pluswithai tests --project <name>` | List a project's test files |
61
+ | `pluswithai runs --project <name>` | Show recent runs (`--limit`, 1–100) |
62
+ | `pluswithai whoami` | Check that the key works |
63
+ | `pluswithai mcp` | Serve Pluswithai's MCP tools over stdio, for AI agents |
64
+
65
+ Every command takes `--help`, and every command except `mcp` takes `--json`.
66
+
67
+ ## AI agents (MCP)
68
+
69
+ Pluswithai is also an MCP server. With it, an agent like Claude Code, Cursor or Codex can run your tests, read the failures, push new tests and schedule them.
70
+
71
+ Clients that support remote MCP servers connect straight to `https://api.pluswithai.com/mcp`. Claude.ai and ChatGPT sign in with OAuth, so you don't copy a key. Clients that only start local servers can use this CLI as a stdio bridge:
72
+
73
+ ```json
74
+ {
75
+ "mcpServers": {
76
+ "pluswithai": {
77
+ "command": "npx",
78
+ "args": ["-y", "@pluswithai/cli", "mcp"],
79
+ "env": { "PLUSWITHAI_API_KEY": "pwai_…" }
80
+ }
81
+ }
82
+ }
83
+ ```
84
+
85
+ Use a key with **Agent** access to get every tool. Logs go to stderr; stdout carries only the protocol.
86
+
87
+ ### `run` options
88
+
89
+ | Option | Default | |
90
+ |---|---|---|
91
+ | `-p, --project <name>` | — | Required |
92
+ | `-t, --test <file>` | every test file | Repeat it to run several files |
93
+ | `--region <id>` | the project's region | Where the browser runs |
94
+ | `--timeout <seconds>` | 1800 | Stop waiting after this long, counted from when the runs start |
95
+ | `--interval <seconds>` | 5 | Time between status checks |
96
+ | `--junit <path>` | — | Also write a JUnit XML report |
97
+ | `--no-summary` | — | Skip the GitHub step summary |
98
+
99
+ ### Environment
100
+
101
+ | Variable | |
102
+ |---|---|
103
+ | `PLUSWITHAI_API_KEY` | Required. There is no `--api-key` flag, because flags end up in your shell history. |
104
+ | `PLUSWITHAI_API_URL` | Default `https://api.pluswithai.com` (or `--api-url`) |
105
+ | `PLUSWITHAI_APP_URL` | Default `https://pluswithai.com`, used for links (or `--app-url`) |
106
+
107
+ ## Exit codes
108
+
109
+ | Code | Meaning |
110
+ |---|---|
111
+ | 0 | Every run passed |
112
+ | 1 | A run failed: your test or your app |
113
+ | 2 | Usage or configuration error |
114
+ | 3 | Pluswithai or network error, or a run ended in `error` |
115
+ | 4 | Timed out waiting for results |
116
+
117
+ If several apply, the CLI reports the first one in this order: a failed run, then an error, then the timeout.
118
+
119
+ ## Development
120
+
121
+ ```sh
122
+ npm install
123
+ npm test # builds, runs unit + end-to-end tests, enforces 100% coverage
124
+ ```
125
+
126
+ The design is documented in [SPEC.md](SPEC.md).
127
+
128
+ ## License
129
+
130
+ MIT
package/dist/args.js ADDED
@@ -0,0 +1,202 @@
1
+ /**
2
+ * argv → command (SPEC.md §2). Pure: no environment, no I/O. Built on
3
+ * node:util parseArgs so the CLI keeps zero runtime dependencies.
4
+ */
5
+ import { parseArgs } from "node:util";
6
+ const COMMANDS = ["run", "projects", "tests", "runs", "whoami", "mcp"];
7
+ export class UsageError extends Error {
8
+ topic;
9
+ constructor(message, topic) {
10
+ super(message);
11
+ this.topic = topic;
12
+ this.name = "UsageError";
13
+ }
14
+ }
15
+ const GLOBAL = {
16
+ "api-url": { type: "string" },
17
+ "app-url": { type: "string" },
18
+ json: { type: "boolean" },
19
+ help: { type: "boolean", short: "h" },
20
+ };
21
+ const PROJECT = { project: { type: "string", short: "p" } };
22
+ const OPTIONS = {
23
+ run: {
24
+ ...GLOBAL,
25
+ ...PROJECT,
26
+ test: { type: "string", short: "t", multiple: true },
27
+ region: { type: "string" },
28
+ timeout: { type: "string" },
29
+ interval: { type: "string" },
30
+ junit: { type: "string" },
31
+ "no-summary": { type: "boolean" },
32
+ },
33
+ projects: GLOBAL,
34
+ tests: { ...GLOBAL, ...PROJECT },
35
+ runs: { ...GLOBAL, ...PROJECT, limit: { type: "string" } },
36
+ whoami: GLOBAL,
37
+ mcp: { "api-url": GLOBAL["api-url"], help: GLOBAL.help },
38
+ };
39
+ const isCommand = (value) => COMMANDS.includes(value);
40
+ function seconds(value, fallback, flag, topic) {
41
+ if (value === undefined)
42
+ return fallback;
43
+ const n = Number(value);
44
+ if (!Number.isFinite(n) || n <= 0)
45
+ throw new UsageError(`${flag} must be a positive number of seconds.`, topic);
46
+ return n;
47
+ }
48
+ export function parseCommand(argv) {
49
+ const [first, ...rest] = argv;
50
+ if (first === undefined || first === "--help" || first === "-h")
51
+ return { kind: "help" };
52
+ if (first === "--version" || first === "-v")
53
+ return { kind: "version" };
54
+ if (first === "help") {
55
+ if (rest[0] === undefined)
56
+ return { kind: "help" };
57
+ if (!isCommand(rest[0]))
58
+ throw new UsageError(`Unknown command "${rest[0]}". Run pluswithai --help.`);
59
+ return { kind: "help", topic: rest[0] };
60
+ }
61
+ if (!isCommand(first))
62
+ throw new UsageError(`Unknown command "${first}". Run pluswithai --help.`);
63
+ const topic = first;
64
+ if (rest.some((a) => a === "--api-key" || a.startsWith("--api-key="))) {
65
+ throw new UsageError("There is no --api-key flag: set PLUSWITHAI_API_KEY in the environment instead.", topic);
66
+ }
67
+ let values;
68
+ try {
69
+ ({ values } = parseArgs({ args: rest, options: OPTIONS[topic], strict: true, allowPositionals: false }));
70
+ }
71
+ catch (e) {
72
+ throw new UsageError(e.message, topic);
73
+ }
74
+ if (values.help)
75
+ return { kind: "help", topic };
76
+ const global = {};
77
+ if (typeof values["api-url"] === "string")
78
+ global.apiUrl = values["api-url"];
79
+ if (typeof values["app-url"] === "string")
80
+ global.appUrl = values["app-url"];
81
+ const json = values.json === true;
82
+ const project = typeof values.project === "string" ? values.project : undefined;
83
+ const needProject = () => {
84
+ if (!project)
85
+ throw new UsageError("Missing --project <name>.", topic);
86
+ return project;
87
+ };
88
+ switch (topic) {
89
+ case "run":
90
+ return {
91
+ kind: "run",
92
+ global,
93
+ project: needProject(),
94
+ tests: values.test ?? [],
95
+ region: values.region,
96
+ timeoutSec: seconds(values.timeout, 1800, "--timeout", topic),
97
+ intervalSec: seconds(values.interval, 5, "--interval", topic),
98
+ junit: values.junit,
99
+ json,
100
+ summary: values["no-summary"] !== true,
101
+ };
102
+ case "projects":
103
+ return { kind: "projects", global, json };
104
+ case "tests":
105
+ return { kind: "tests", global, project: needProject(), json };
106
+ case "runs": {
107
+ const raw = values.limit;
108
+ const limit = raw === undefined ? 10 : Number(raw);
109
+ if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
110
+ throw new UsageError("--limit must be a whole number from 1 to 100.", topic);
111
+ }
112
+ return { kind: "runs", global, project: needProject(), limit, json };
113
+ }
114
+ case "whoami":
115
+ return { kind: "whoami", global, json };
116
+ case "mcp":
117
+ return { kind: "mcp", global };
118
+ }
119
+ }
120
+ const GLOBAL_HELP = `Global options:
121
+ --api-url <url> API base URL (env PLUSWITHAI_API_URL, default https://api.pluswithai.com)
122
+ --app-url <url> App URL for links (env PLUSWITHAI_APP_URL, default https://pluswithai.com)
123
+ --json Machine-readable output
124
+ -h, --help Show help`;
125
+ const HELP = {
126
+ run: `Usage: pluswithai run --project <name> [options]
127
+
128
+ Start runs, wait for them and exit with their verdict.
129
+
130
+ Options:
131
+ -p, --project <name> Project to run (required)
132
+ -t, --test <file> Test file to run; repeat for several (default: every test file)
133
+ --region <id> Run region (default: the project's)
134
+ --timeout <seconds> Give up waiting after this long (default 1800)
135
+ --interval <seconds> Time between status checks (default 5)
136
+ --junit <path> Also write a JUnit XML report
137
+ --no-summary Do not write the GitHub step summary
138
+
139
+ ${GLOBAL_HELP}
140
+
141
+ Exit codes:
142
+ 0 every run passed 1 a run failed
143
+ 2 usage or configuration 3 Pluswithai or network error
144
+ 4 timed out waiting`,
145
+ projects: `Usage: pluswithai projects [--json]
146
+
147
+ List the projects of the account.
148
+
149
+ ${GLOBAL_HELP}`,
150
+ tests: `Usage: pluswithai tests --project <name> [--json]
151
+
152
+ List a project's test files.
153
+
154
+ ${GLOBAL_HELP}`,
155
+ runs: `Usage: pluswithai runs --project <name> [--limit <n>] [--json]
156
+
157
+ Show a project's recent runs.
158
+
159
+ Options:
160
+ -p, --project <name> Project (required)
161
+ --limit <n> How many (1–100, default 10)
162
+
163
+ ${GLOBAL_HELP}`,
164
+ mcp: `Usage: pluswithai mcp [--api-url <url>]
165
+
166
+ Run a local MCP server over stdio that relays to Pluswithai's MCP endpoint,
167
+ for agents that only start local servers. Configure your client with:
168
+
169
+ { "command": "npx", "args": ["-y", "@pluswithai/cli", "mcp"],
170
+ "env": { "PLUSWITHAI_API_KEY": "pwai_…" } }
171
+
172
+ Use a key with Agent access to get every tool. Logs go to stderr.
173
+
174
+ Options:
175
+ --api-url <url> API base URL (env PLUSWITHAI_API_URL)
176
+ -h, --help Show help`,
177
+ whoami: `Usage: pluswithai whoami [--json]
178
+
179
+ Check that the API key works and show which account it belongs to.
180
+
181
+ ${GLOBAL_HELP}`,
182
+ };
183
+ export function helpText(topic) {
184
+ if (topic)
185
+ return HELP[topic];
186
+ return `Usage: pluswithai <command> [options]
187
+
188
+ Run Pluswithai tests from CI and the terminal.
189
+
190
+ Commands:
191
+ run Start runs, wait for the results, exit non-zero on failure
192
+ projects List your projects
193
+ tests List a project's test files
194
+ runs Show a project's recent runs
195
+ whoami Check the API key
196
+ mcp Serve Pluswithai's MCP tools over stdio (for AI agents)
197
+
198
+ Authentication:
199
+ Set PLUSWITHAI_API_KEY to a key from the app's API keys page.
200
+
201
+ Run "pluswithai <command> --help" for a command's options.`;
202
+ }
package/dist/bin.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { main } from "./main.js";
3
+ import { nodeDeps } from "./node-deps.js";
4
+ // exitCode, not exit(): lets stdout/stderr flush before the process ends.
5
+ process.exitCode = await main(nodeDeps(process));
package/dist/client.js ADDED
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Client for the public Pluswithai REST API (https://pluswithai.com/docs/integrations-and-api) over
3
+ * an injected fetch. Every failure becomes an ApiError whose message is safe
4
+ * to print: the API key is redacted from it.
5
+ */
6
+ import { redact } from "./config.js";
7
+ import { VERSION } from "./version.js";
8
+ export class ApiError extends Error {
9
+ status;
10
+ transient;
11
+ retryAfterSeconds;
12
+ constructor(message,
13
+ /** HTTP status, or 0 when the request never got an answer. */
14
+ status,
15
+ /** Worth retrying: network failures, 429 and 5xx. */
16
+ transient, retryAfterSeconds) {
17
+ super(message);
18
+ this.status = status;
19
+ this.transient = transient;
20
+ this.retryAfterSeconds = retryAfterSeconds;
21
+ this.name = "ApiError";
22
+ }
23
+ }
24
+ const REQUEST_TIMEOUT_MS = 30_000;
25
+ const MAX_ERROR_TEXT = 200;
26
+ export class Client {
27
+ opts;
28
+ constructor(opts) {
29
+ this.opts = opts;
30
+ }
31
+ me() {
32
+ return this.request("GET", "/me");
33
+ }
34
+ async projects() {
35
+ return (await this.request("GET", "/projects")).projects;
36
+ }
37
+ async testFiles(project) {
38
+ return (await this.request("GET", `/projects/${encodeURIComponent(project)}/test-files`)).files;
39
+ }
40
+ async runs(project, limit) {
41
+ return (await this.request("GET", `/projects/${encodeURIComponent(project)}/runs?limit=${limit}`)).runs;
42
+ }
43
+ async run(project, id) {
44
+ const path = `/projects/${encodeURIComponent(project)}/runs/${encodeURIComponent(id)}`;
45
+ return (await this.request("GET", path)).run;
46
+ }
47
+ async startRun(project, tests, region) {
48
+ const body = region ? { tests, region } : { tests };
49
+ return (await this.request("POST", `/projects/${encodeURIComponent(project)}/run-tests`, body)).results;
50
+ }
51
+ async request(method, path, body) {
52
+ const host = new URL(this.opts.apiUrl).host;
53
+ const headers = {
54
+ Authorization: `Bearer ${this.opts.apiKey}`,
55
+ Accept: "application/json",
56
+ "User-Agent": `pluswithai-cli/${VERSION}`,
57
+ };
58
+ if (body !== undefined)
59
+ headers["Content-Type"] = "application/json";
60
+ // Unbound on purpose: some fetch implementations reject a foreign `this`.
61
+ const doFetch = this.opts.fetch;
62
+ let res;
63
+ try {
64
+ res = await doFetch(`${this.opts.apiUrl}${path}`, {
65
+ method,
66
+ headers,
67
+ body: body === undefined ? undefined : JSON.stringify(body),
68
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
69
+ });
70
+ }
71
+ catch (e) {
72
+ const name = e?.name;
73
+ const reason = name === "TimeoutError" || name === "AbortError" ? "timed out" : e instanceof Error ? e.message : String(e);
74
+ throw new ApiError(this.clean(`Could not reach ${host}: ${reason}`), 0, true);
75
+ }
76
+ const text = await res.text();
77
+ if (!res.ok) {
78
+ let message = "";
79
+ let retryAfter;
80
+ try {
81
+ const parsed = JSON.parse(text);
82
+ if (typeof parsed.error === "string")
83
+ message = parsed.error;
84
+ if (typeof parsed.retryAfterSeconds === "number")
85
+ retryAfter = parsed.retryAfterSeconds;
86
+ }
87
+ catch {
88
+ message = text.trim();
89
+ }
90
+ if (retryAfter === undefined) {
91
+ const header = Number(res.headers.get("Retry-After"));
92
+ if (Number.isFinite(header) && header > 0)
93
+ retryAfter = header;
94
+ }
95
+ message = (message || res.statusText || "Request failed").slice(0, MAX_ERROR_TEXT);
96
+ const transient = res.status === 429 || res.status >= 500;
97
+ throw new ApiError(this.clean(`${res.status} ${message}`), res.status, transient, retryAfter);
98
+ }
99
+ try {
100
+ return JSON.parse(text);
101
+ }
102
+ catch {
103
+ throw new ApiError(`${res.status} Unexpected response from the API`, res.status, false);
104
+ }
105
+ }
106
+ clean(message) {
107
+ return redact(message, this.opts.apiKey);
108
+ }
109
+ }
package/dist/config.js ADDED
@@ -0,0 +1,39 @@
1
+ export const DEFAULT_API_URL = "https://api.pluswithai.com";
2
+ export const DEFAULT_APP_URL = "https://pluswithai.com";
3
+ export class ConfigError extends Error {
4
+ constructor(message) {
5
+ super(message);
6
+ this.name = "ConfigError";
7
+ }
8
+ }
9
+ function httpUrl(value, flag) {
10
+ let url;
11
+ try {
12
+ url = new URL(value);
13
+ }
14
+ catch {
15
+ throw new ConfigError(`${flag} must be an http(s) URL.`);
16
+ }
17
+ if (url.protocol !== "https:" && url.protocol !== "http:")
18
+ throw new ConfigError(`${flag} must be an http(s) URL.`);
19
+ return value.replace(/\/+$/, "");
20
+ }
21
+ export function resolveConfig(flags, env) {
22
+ const apiKey = (env.PLUSWITHAI_API_KEY ?? "").trim();
23
+ if (!apiKey) {
24
+ throw new ConfigError("PLUSWITHAI_API_KEY is not set. Create a key on the app's API keys page and export it.");
25
+ }
26
+ if (!apiKey.startsWith("pwai_")) {
27
+ throw new ConfigError("PLUSWITHAI_API_KEY does not look like a Pluswithai key (they start with pwai_).");
28
+ }
29
+ return {
30
+ apiKey,
31
+ apiUrl: httpUrl(flags.apiUrl ?? env.PLUSWITHAI_API_URL ?? DEFAULT_API_URL, "--api-url"),
32
+ appUrl: httpUrl(flags.appUrl ?? env.PLUSWITHAI_APP_URL ?? DEFAULT_APP_URL, "--app-url"),
33
+ };
34
+ }
35
+ /** Removes the key — and anything shaped like a Pluswithai key — from text about to be printed. */
36
+ export function redact(text, key) {
37
+ const out = key ? text.split(key).join("pwai_…") : text;
38
+ return out.replace(/pwai_[A-Za-z0-9_-]{16,}/g, "pwai_…");
39
+ }
package/dist/main.js ADDED
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Wires args, config, client, run and report together and turns every
3
+ * outcome into an exit code (SPEC.md §3). All I/O arrives through MainDeps,
4
+ * so this whole file is tested without a network or a real process.
5
+ */
6
+ import { helpText, parseCommand } from "./args.js";
7
+ import { ApiError, Client } from "./client.js";
8
+ import { redact, resolveConfig } from "./config.js";
9
+ import { annotations, junitXml, markdownSummary, progressLine, projectsText, runJson, runsText, startedLine, summaryText, testsText, whoamiText, } from "./report.js";
10
+ import { executeRun, NoTestsError } from "./run.js";
11
+ import { runMcpProxy } from "./mcp-proxy.js";
12
+ import { VERSION } from "./version.js";
13
+ export const EXIT = { ok: 0, failed: 1, usage: 2, api: 3, timeout: 4 };
14
+ const line = (text) => `${text}\n`;
15
+ const describe = (e) => (e instanceof Error ? e.message : String(e));
16
+ export async function main(deps) {
17
+ let command;
18
+ try {
19
+ command = parseCommand(deps.argv);
20
+ }
21
+ catch (e) {
22
+ const err = e;
23
+ deps.stderr(line(`error: ${err.message}`));
24
+ deps.stderr(line(`Run "pluswithai ${err.topic ? `${err.topic} ` : ""}--help" for usage.`));
25
+ return EXIT.usage;
26
+ }
27
+ if (command.kind === "help") {
28
+ deps.stdout(line(helpText(command.topic)));
29
+ return EXIT.ok;
30
+ }
31
+ if (command.kind === "version") {
32
+ deps.stdout(line(VERSION));
33
+ return EXIT.ok;
34
+ }
35
+ let config;
36
+ try {
37
+ config = resolveConfig(command.global, deps.env);
38
+ }
39
+ catch (e) {
40
+ deps.stderr(line(`error: ${e.message}`));
41
+ return EXIT.usage;
42
+ }
43
+ const client = new Client({ apiUrl: config.apiUrl, apiKey: config.apiKey, fetch: deps.fetch });
44
+ const print = (json, value, text) => deps.stdout(line(json ? JSON.stringify(value, null, 2) : text));
45
+ try {
46
+ switch (command.kind) {
47
+ case "whoami": {
48
+ const me = await client.me();
49
+ print(command.json, me, whoamiText(me, config.apiUrl));
50
+ return EXIT.ok;
51
+ }
52
+ case "projects": {
53
+ const projects = await client.projects();
54
+ print(command.json, projects, projectsText(projects, config.appUrl));
55
+ return EXIT.ok;
56
+ }
57
+ case "tests": {
58
+ const files = await client.testFiles(command.project);
59
+ print(command.json, files, testsText(command.project, files));
60
+ return EXIT.ok;
61
+ }
62
+ case "runs": {
63
+ const runs = await client.runs(command.project, command.limit);
64
+ print(command.json, runs, runsText(command.project, runs));
65
+ return EXIT.ok;
66
+ }
67
+ case "run":
68
+ return await runCommand(deps, config, client, command);
69
+ case "mcp":
70
+ deps.stderr(line(`Pluswithai MCP proxy → ${config.apiUrl}/mcp`));
71
+ return await runMcpProxy({
72
+ apiUrl: config.apiUrl,
73
+ apiKey: config.apiKey,
74
+ fetch: deps.fetch,
75
+ write: (text) => deps.stdout(line(text)),
76
+ log: (text) => deps.stderr(line(text)),
77
+ lines: deps.stdinLines(),
78
+ });
79
+ }
80
+ }
81
+ catch (e) {
82
+ if (e instanceof NoTestsError) {
83
+ deps.stderr(line(`error: ${e.message}`));
84
+ return EXIT.usage;
85
+ }
86
+ if (e instanceof ApiError) {
87
+ deps.stderr(line(`error: ${e.message}`));
88
+ const hint = hintFor(e, command);
89
+ if (hint)
90
+ deps.stderr(line(hint));
91
+ return EXIT.api;
92
+ }
93
+ deps.stderr(line(`unexpected error: ${redact(describe(e), config.apiKey)}`));
94
+ return EXIT.api;
95
+ }
96
+ }
97
+ function hintFor(e, command) {
98
+ if (e.status === 401)
99
+ return "Check PLUSWITHAI_API_KEY (create one on the app's API keys page).";
100
+ if (e.status === 403 && command.kind === "run")
101
+ return "Starting runs needs a key with CI (read + run) access.";
102
+ if (e.status === 404 && "project" in command)
103
+ return `Check the project name "${command.project}" (pluswithai projects lists them).`;
104
+ return null;
105
+ }
106
+ async function runCommand(deps, config, client, command) {
107
+ const outcome = await executeRun({
108
+ client,
109
+ sleep: deps.sleep,
110
+ now: deps.now,
111
+ onStarted: (runs) => deps.stderr(line(startedLine(command.project, runs.length))),
112
+ onFinished: (r) => deps.stderr(line(progressLine(r))),
113
+ onNotice: (message) => deps.stderr(line(message)),
114
+ }, {
115
+ project: command.project,
116
+ tests: command.tests,
117
+ region: command.region,
118
+ timeoutMs: command.timeoutSec * 1000,
119
+ intervalMs: command.intervalSec * 1000,
120
+ });
121
+ if (command.json)
122
+ deps.stdout(line(JSON.stringify(runJson(outcome, command.project, config.appUrl), null, 2)));
123
+ else
124
+ deps.stdout(line(summaryText(outcome, command.project, config.appUrl)));
125
+ if (deps.env.GITHUB_ACTIONS === "true")
126
+ for (const a of annotations(outcome))
127
+ deps.stdout(line(a));
128
+ const summaryPath = deps.env.GITHUB_STEP_SUMMARY;
129
+ if (command.summary && summaryPath) {
130
+ await deps
131
+ .appendFile(summaryPath, markdownSummary(outcome, command.project, config.appUrl))
132
+ .catch((e) => deps.stderr(line(`warning: could not write the GitHub step summary: ${describe(e)}`)));
133
+ }
134
+ if (command.junit) {
135
+ const path = command.junit;
136
+ await deps.writeFile(path, junitXml(outcome, command.project)).then(() => deps.stderr(line(`JUnit report written to ${path}`)), (e) => deps.stderr(line(`warning: could not write the JUnit report to ${path}: ${describe(e)}`)));
137
+ }
138
+ return outcome.exitCode;
139
+ }
@@ -0,0 +1,109 @@
1
+ /**
2
+ * `pluswithai mcp`: a stdio MCP server that relays every JSON-RPC message
3
+ * to the remote Pluswithai MCP endpoint (https://pluswithai.com/docs/ai-agents-mcp). The tools, their
4
+ * validation and their permissions live on the server; this file only moves
5
+ * messages, so it never goes out of date with them.
6
+ *
7
+ * stdout is the protocol: one JSON message per line, nothing else. Logs go
8
+ * to stderr. Requests are relayed concurrently, so a long run_tests never
9
+ * holds up a ping.
10
+ */
11
+ import { redact } from "./config.js";
12
+ import { VERSION } from "./version.js";
13
+ /** Ours, not the spec's: -32000..-32099 is reserved for implementation errors. */
14
+ const UPSTREAM_ERROR = -32001;
15
+ export function createMcpProxy(deps) {
16
+ const endpoint = `${deps.apiUrl}/mcp`;
17
+ const host = new URL(deps.apiUrl).host;
18
+ let protocolVersion = null;
19
+ const emit = (message) => deps.write(JSON.stringify(message));
20
+ /** Every request id in the outgoing message (a batch has several; notifications none). */
21
+ const idsOf = (payload) => (Array.isArray(payload) ? payload : [payload]).filter((m) => m.id !== undefined && m.id !== null).map((m) => m.id);
22
+ const fail = (payload, message) => {
23
+ const clean = redact(message, deps.apiKey);
24
+ const ids = idsOf(payload);
25
+ if (ids.length === 0)
26
+ deps.log(clean);
27
+ for (const id of ids)
28
+ emit({ jsonrpc: "2.0", id, error: { code: UPSTREAM_ERROR, message: clean } });
29
+ };
30
+ const deliver = (message) => {
31
+ if (typeof message.result?.protocolVersion === "string")
32
+ protocolVersion = message.result.protocolVersion;
33
+ emit(message);
34
+ };
35
+ async function handleLine(line) {
36
+ if (!line.trim())
37
+ return;
38
+ let payload;
39
+ try {
40
+ payload = JSON.parse(line);
41
+ }
42
+ catch {
43
+ emit({ jsonrpc: "2.0", id: null, error: { code: -32700, message: "Parse error: the line is not JSON" } });
44
+ return;
45
+ }
46
+ const headers = {
47
+ Authorization: `Bearer ${deps.apiKey}`,
48
+ "Content-Type": "application/json",
49
+ Accept: "application/json, text/event-stream",
50
+ "User-Agent": `pluswithai-cli/${VERSION} (mcp)`,
51
+ };
52
+ if (protocolVersion)
53
+ headers["MCP-Protocol-Version"] = protocolVersion;
54
+ const doFetch = deps.fetch;
55
+ let res;
56
+ try {
57
+ res = await doFetch(endpoint, { method: "POST", headers, body: line });
58
+ }
59
+ catch (e) {
60
+ fail(payload, `Pluswithai: Could not reach ${host}: ${e instanceof Error ? e.message : String(e)}`);
61
+ return;
62
+ }
63
+ if (res.status === 202)
64
+ return;
65
+ const text = await res.text();
66
+ if (!res.ok) {
67
+ let detail = "";
68
+ try {
69
+ const body = JSON.parse(text);
70
+ detail = typeof body.error_description === "string" ? body.error_description : typeof body.error === "string" ? body.error : "";
71
+ }
72
+ catch {
73
+ detail = "";
74
+ }
75
+ const hint = res.status === 401 ? ". Check PLUSWITHAI_API_KEY." : "";
76
+ fail(payload, `Pluswithai: ${res.status} ${detail || res.statusText || "request failed"}${hint}`);
77
+ return;
78
+ }
79
+ if ((res.headers.get("Content-Type") ?? "").includes("text/event-stream")) {
80
+ for (const raw of text.split("\n")) {
81
+ if (raw.startsWith("data:"))
82
+ deliver(JSON.parse(raw.slice(5).trim()));
83
+ }
84
+ return;
85
+ }
86
+ let body;
87
+ try {
88
+ body = JSON.parse(text);
89
+ }
90
+ catch {
91
+ fail(payload, `Pluswithai: Unexpected response from ${host}`);
92
+ return;
93
+ }
94
+ for (const message of Array.isArray(body) ? body : [body])
95
+ deliver(message);
96
+ }
97
+ return { handleLine };
98
+ }
99
+ /** Relays every line until stdin closes, then waits for the answers still in flight. */
100
+ export async function runMcpProxy(deps) {
101
+ const proxy = createMcpProxy(deps);
102
+ const inFlight = new Set();
103
+ for await (const line of deps.lines) {
104
+ const p = proxy.handleLine(line).finally(() => inFlight.delete(p));
105
+ inFlight.add(p);
106
+ }
107
+ await Promise.all(inFlight);
108
+ return 0;
109
+ }
@@ -0,0 +1,25 @@
1
+ /** The real process behind MainDeps: Node's fetch, streams, clock and files. */
2
+ import { appendFile, mkdir, writeFile } from "node:fs/promises";
3
+ import { dirname } from "node:path";
4
+ import { createInterface } from "node:readline";
5
+ export function nodeDeps(proc) {
6
+ return {
7
+ argv: proc.argv.slice(2),
8
+ env: proc.env,
9
+ // Unbound on purpose: Node's fetch must not be called as a method of another object.
10
+ fetch: (input, init) => fetch(input, init),
11
+ stdout: (text) => { process.stdout.write(text); },
12
+ stderr: (text) => { process.stderr.write(text); },
13
+ sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
14
+ now: () => Date.now(),
15
+ writeFile: async (path, data) => {
16
+ await mkdir(dirname(path), { recursive: true });
17
+ await writeFile(path, data, "utf8");
18
+ },
19
+ stdinLines: () => createInterface({ input: proc.stdin ?? process.stdin, crlfDelay: Infinity }),
20
+ appendFile: async (path, data) => {
21
+ await mkdir(dirname(path), { recursive: true });
22
+ await appendFile(path, data, "utf8");
23
+ },
24
+ };
25
+ }
package/dist/report.js ADDED
@@ -0,0 +1,182 @@
1
+ import { DEFAULT_APP_URL } from "./config.js";
2
+ export function formatDuration(ms) {
3
+ if (ms < 60_000)
4
+ return `${(ms / 1000).toFixed(1)}s`;
5
+ const total = Math.round(ms / 1000);
6
+ return `${Math.floor(total / 60)}m ${total % 60}s`;
7
+ }
8
+ export function appLink(appUrl, project) {
9
+ return `${appUrl}/app?project=${encodeURIComponent(project)}`;
10
+ }
11
+ const fileOf = (r) => r.testFiles.join(", ");
12
+ const SYMBOL = { passed: "✓", failed: "✗", error: "!", queued: "·", running: "·" };
13
+ export function progressLine(r) {
14
+ const status = `${r.status}${r.timedOut ? " (timed out)" : ""}`;
15
+ return `${SYMBOL[r.status]} ${fileOf(r)} ${status} ${formatDuration(r.duration)}`;
16
+ }
17
+ export function startedLine(project, count) {
18
+ return `Started ${count} run${count === 1 ? "" : "s"} in ${project}. Waiting for results…`;
19
+ }
20
+ function counts(outcome) {
21
+ const of = (s) => outcome.results.filter((r) => r.status === s).length;
22
+ return { passed: of("passed"), failed: of("failed"), error: of("error"), pending: outcome.pending.length };
23
+ }
24
+ function countsLine(outcome) {
25
+ const c = counts(outcome);
26
+ return [`${c.passed} passed`, c.failed ? `${c.failed} failed` : "", c.error ? `${c.error} error` : ""].filter(Boolean).join(", ");
27
+ }
28
+ const plural = (n, word) => `${n} ${word}${n === 1 ? "" : "s"}`;
29
+ export function summaryText(outcome, project, appUrl) {
30
+ const lines = [`Pluswithai · ${project}: ${countsLine(outcome)}`];
31
+ for (const r of outcome.results)
32
+ if (r.status !== "passed")
33
+ lines.push(` ${progressLine(r)}`);
34
+ if (outcome.pending.length) {
35
+ lines.push(`Timed out waiting for ${plural(outcome.pending.length, "run")}: ${outcome.pending.map(fileOf).join(", ")}`);
36
+ }
37
+ lines.push(`Details: ${appLink(appUrl, project)}`);
38
+ return lines.join("\n");
39
+ }
40
+ // ── GitHub ───────────────────────────────────────────────────────────────
41
+ const MD_STATUS = { passed: "✅ passed", failed: "❌ failed", error: "⚠️ error" };
42
+ const mdCell = (text) => text.replace(/\|/g, "\\|");
43
+ export function markdownSummary(outcome, project, appUrl) {
44
+ const broken = outcome.results.some((r) => r.status !== "passed");
45
+ const icon = broken ? "❌" : outcome.timedOut ? "⏱️" : "✅";
46
+ const rows = [
47
+ ...outcome.results.map((r) => `| \`${mdCell(fileOf(r))}\` | ${MD_STATUS[r.status]} | ${formatDuration(r.duration)} |`),
48
+ ...outcome.pending.map((r) => `| \`${mdCell(fileOf(r))}\` | ⏱️ still running | — |`),
49
+ ];
50
+ return [
51
+ `### ${icon} Pluswithai · ${project}`,
52
+ "",
53
+ countsLine(outcome),
54
+ "",
55
+ "| Test | Status | Duration |",
56
+ "|---|---|---|",
57
+ ...rows,
58
+ "",
59
+ `[Open in Pluswithai](${appLink(appUrl, project)})`,
60
+ "",
61
+ ].join("\n");
62
+ }
63
+ const MAX_EXCERPT_LINES = 12;
64
+ const MAX_EXCERPT_CHARS = 1000;
65
+ /**
66
+ * Playwright's first failure block ("1) file:line › title", the assertion,
67
+ * the code frame) without the run banner before it or the attachment list
68
+ * after it; else from the first "Error:" line; else the start of the text.
69
+ */
70
+ function excerpt(r) {
71
+ const text = r.stdout.trim() || r.stderr.trim();
72
+ const lines = text.split("\n");
73
+ let start = lines.findIndex((l) => /^\s*\d+\) /.test(l));
74
+ if (start === -1)
75
+ start = lines.findIndex((l) => /\w*Error:/.test(l));
76
+ if (start === -1)
77
+ start = 0;
78
+ let end = lines.findIndex((l, i) => i > start && /^\s*(attachment #\d+|\d+ (failed|passed|flaky|skipped)\b)/.test(l));
79
+ if (end === -1)
80
+ end = lines.length;
81
+ return lines.slice(start, Math.min(end, start + MAX_EXCERPT_LINES)).join("\n").trim().slice(0, MAX_EXCERPT_CHARS);
82
+ }
83
+ // GitHub workflow-command escaping (as in @actions/core).
84
+ const escapeData = (s) => s.replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A");
85
+ const escapeProperty = (s) => escapeData(s).replace(/:/g, "%3A").replace(/,/g, "%2C");
86
+ export function annotations(outcome) {
87
+ return outcome.results
88
+ .filter((r) => r.status !== "passed")
89
+ .map((r) => {
90
+ const message = excerpt(r) || "The run failed. Open it in Pluswithai for the video and trace.";
91
+ return `::error title=${escapeProperty(`Pluswithai · ${fileOf(r)} ${r.status}`)}::${escapeData(message)}`;
92
+ });
93
+ }
94
+ // ── JUnit ────────────────────────────────────────────────────────────────
95
+ const MAX_JUNIT_OUTPUT = 4000;
96
+ const xml = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
97
+ const secs = (ms) => (ms / 1000).toFixed(3);
98
+ export function junitXml(outcome, project) {
99
+ const c = counts(outcome);
100
+ const total = outcome.results.reduce((sum, r) => sum + r.duration, 0);
101
+ const cases = [
102
+ ...outcome.results.map((r) => {
103
+ const open = `<testcase name="${xml(fileOf(r))}" classname="${xml(project)}" time="${secs(r.duration)}"`;
104
+ if (r.status === "passed")
105
+ return `${open}/>`;
106
+ const tag = r.status === "failed" ? "failure" : "error";
107
+ const output = `${r.stdout}\n${r.stderr}`.trim().slice(-MAX_JUNIT_OUTPUT);
108
+ return `${open}><${tag} message="${r.status}">${xml(output)}</${tag}></testcase>`;
109
+ }),
110
+ ...outcome.pending.map((r) => `<testcase name="${xml(fileOf(r))}" classname="${xml(project)}" time="0.000"><skipped message="Timed out waiting for the result"/></testcase>`),
111
+ ];
112
+ return [
113
+ '<?xml version="1.0" encoding="UTF-8"?>',
114
+ "<testsuites>",
115
+ `<testsuite name="${xml(`Pluswithai · ${project}`)}" tests="${outcome.results.length + c.pending}" failures="${c.failed}" errors="${c.error}" skipped="${c.pending}" time="${secs(total)}">`,
116
+ ...cases,
117
+ "</testsuite>",
118
+ "</testsuites>",
119
+ "",
120
+ ].join("\n");
121
+ }
122
+ // ── JSON ─────────────────────────────────────────────────────────────────
123
+ export function runJson(outcome, project, appUrl) {
124
+ return {
125
+ project,
126
+ url: appLink(appUrl, project),
127
+ passed: outcome.exitCode === 0,
128
+ exitCode: outcome.exitCode,
129
+ timedOut: outcome.timedOut,
130
+ counts: counts(outcome),
131
+ results: outcome.results.map((r) => ({
132
+ id: r.id,
133
+ file: fileOf(r),
134
+ status: r.status,
135
+ durationMs: r.duration,
136
+ timedOut: r.timedOut === true,
137
+ })),
138
+ pending: outcome.pending.map((r) => ({ id: r.id, file: fileOf(r), status: r.status })),
139
+ };
140
+ }
141
+ // ── Read commands ────────────────────────────────────────────────────────
142
+ export function table(rows) {
143
+ const widths = [];
144
+ for (const row of rows)
145
+ row.forEach((cell, i) => { widths[i] = Math.max(widths[i] ?? 0, cell.length); });
146
+ return rows
147
+ .map((row) => row.map((cell, i) => (i === row.length - 1 ? cell : cell.padEnd(widths[i]))).join(" "))
148
+ .join("\n");
149
+ }
150
+ export function projectsText(projects, appUrl = DEFAULT_APP_URL) {
151
+ if (projects.length === 0)
152
+ return `No projects yet. Create one at ${appUrl}/app`;
153
+ return table([
154
+ ["NAME", "TITLE", "URL", "CREATED"],
155
+ ...projects.map((p) => [p.name, p.displayName || "-", p.url, p.createdAt ? p.createdAt.slice(0, 10) : "-"]),
156
+ ]);
157
+ }
158
+ export function testsText(project, files) {
159
+ return files.length === 0 ? `No test files in ${project}.` : files.join("\n");
160
+ }
161
+ const startedAt = (ms) => {
162
+ const iso = new Date(ms).toISOString();
163
+ return `${iso.slice(0, 10)} ${iso.slice(11, 16)}Z`;
164
+ };
165
+ export function runsText(project, runs) {
166
+ if (runs.length === 0)
167
+ return `No runs yet in ${project}.`;
168
+ return table([
169
+ ["ID", "STATUS", "TESTS", "DURATION", "TRIGGER", "STARTED"],
170
+ ...runs.map((r) => [
171
+ r.id,
172
+ r.status,
173
+ r.testFiles.length === 1 ? r.testFiles[0] : `${r.testFiles.length} files`,
174
+ formatDuration(r.duration),
175
+ r.scheduled ? "scheduled" : "manual",
176
+ startedAt(r.timestamp),
177
+ ]),
178
+ ]);
179
+ }
180
+ export function whoamiText(me, apiUrl) {
181
+ return `Authenticated with an API key as account ${me.userId}${me.email ? ` (${me.email})` : ""}\nAPI: ${apiUrl}`;
182
+ }
package/dist/run.js ADDED
@@ -0,0 +1,82 @@
1
+ /**
2
+ * `pluswithai run`: start → poll → verdict (SPEC.md §2.1, §3). Time and
3
+ * sleeping are injected so the whole loop runs instantly under test.
4
+ */
5
+ import { ApiError } from "./client.js";
6
+ export const MAX_START_RETRIES = 3;
7
+ export const MAX_POLL_FAILURES = 3;
8
+ export const DEFAULT_RETRY_AFTER_SECONDS = 10;
9
+ export const MAX_RETRY_AFTER_SECONDS = 60;
10
+ export class NoTestsError extends Error {
11
+ constructor(project) {
12
+ super(`Project "${project}" has no test files to run.`);
13
+ this.name = "NoTestsError";
14
+ }
15
+ }
16
+ const isFinal = (r) => r.status === "passed" || r.status === "failed" || r.status === "error";
17
+ /** failed (1) beats error (3) beats timeout (4) beats success (0). */
18
+ export function exitCodeFor(results, timedOut) {
19
+ if (results.some((r) => r.status === "failed"))
20
+ return 1;
21
+ if (results.some((r) => r.status === "error"))
22
+ return 3;
23
+ return timedOut ? 4 : 0;
24
+ }
25
+ async function start(deps, opts, tests) {
26
+ for (let attempt = 0;; attempt++) {
27
+ try {
28
+ return await deps.client.startRun(opts.project, tests, opts.region);
29
+ }
30
+ catch (e) {
31
+ if (!(e instanceof ApiError) || e.status !== 429 || attempt >= MAX_START_RETRIES)
32
+ throw e;
33
+ const wait = Math.min(e.retryAfterSeconds ?? DEFAULT_RETRY_AFTER_SECONDS, MAX_RETRY_AFTER_SECONDS);
34
+ deps.onNotice?.(`${e.message}; retrying in ${wait}s`);
35
+ await deps.sleep(wait * 1000);
36
+ }
37
+ }
38
+ }
39
+ export async function executeRun(deps, opts) {
40
+ const tests = opts.tests.length > 0 ? opts.tests : await deps.client.testFiles(opts.project);
41
+ if (tests.length === 0)
42
+ throw new NoTestsError(opts.project);
43
+ const started = await start(deps, opts, tests);
44
+ // Counted from here, not from the call: waiting out a 429 is not time
45
+ // the runs had to finish in.
46
+ const deadline = deps.now() + opts.timeoutMs;
47
+ deps.onStarted?.(started);
48
+ const latest = new Map(started.map((r) => [r.id, r]));
49
+ for (const r of started)
50
+ if (isFinal(r))
51
+ deps.onFinished?.(r);
52
+ let failures = 0;
53
+ let timedOut = false;
54
+ while ([...latest.values()].some((r) => !isFinal(r))) {
55
+ if (deps.now() >= deadline) {
56
+ timedOut = true;
57
+ break;
58
+ }
59
+ await deps.sleep(opts.intervalMs);
60
+ for (const r of [...latest.values()].filter((x) => !isFinal(x))) {
61
+ try {
62
+ const fresh = await deps.client.run(opts.project, r.id);
63
+ failures = 0;
64
+ latest.set(r.id, fresh);
65
+ if (isFinal(fresh))
66
+ deps.onFinished?.(fresh);
67
+ }
68
+ catch (e) {
69
+ if (!(e instanceof ApiError) || !e.transient)
70
+ throw e;
71
+ failures += 1;
72
+ if (failures > MAX_POLL_FAILURES)
73
+ throw e;
74
+ deps.onNotice?.(`Checking ${r.testFiles.join(", ")} failed (${e.message}); retrying`);
75
+ }
76
+ }
77
+ }
78
+ const all = [...latest.values()];
79
+ const results = all.filter(isFinal);
80
+ const pending = all.filter((r) => !isFinal(r));
81
+ return { results, pending, timedOut, exitCode: exitCodeFor(results, timedOut) };
82
+ }
@@ -0,0 +1,2 @@
1
+ /** Kept equal to package.json's version by test/node-deps.test.ts. */
2
+ export const VERSION = "0.2.0";
package/package.json CHANGED
@@ -1,6 +1,49 @@
1
1
  {
2
2
  "name": "@pluswithai/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Run Pluswithai tests from CI and the terminal.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/pluswithai/cli.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/pluswithai/cli/issues"
12
+ },
13
+ "type": "module",
14
+ "bin": {
15
+ "pluswithai": "dist/bin.js"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "engines": {
23
+ "node": ">=18.3"
24
+ },
25
+ "scripts": {
26
+ "build": "tsc -p tsconfig.build.json",
27
+ "typecheck": "tsc --noEmit -p .",
28
+ "test": "npm run build && vitest run --coverage",
29
+ "test:watch": "vitest"
30
+ },
31
+ "keywords": [
32
+ "pluswithai",
33
+ "playwright",
34
+ "e2e",
35
+ "testing",
36
+ "ci",
37
+ "qa"
38
+ ],
39
+ "homepage": "https://pluswithai.com/docs/integrations-and-api",
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "devDependencies": {
44
+ "@types/node": "^20.19.43",
45
+ "@vitest/coverage-v8": "^4.1.11",
46
+ "typescript": "^5.9.3",
47
+ "vitest": "^4.1.11"
48
+ }
49
+ }