sedum-cli 0.1.0-alpha.17 → 0.1.0-alpha.20
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 +65 -0
- package/dist/{affected-selection-KRK5HRF4.js → affected-selection-NTBVWIK5.js} +8 -50
- package/dist/auth-command-TSTYIWGX.js +634 -0
- package/dist/{chunk-GJ5QI7JQ.js → chunk-CGDXQY2Y.js} +1 -1
- package/dist/{chunk-F4RD4S4P.js → chunk-DXNJ3PGB.js} +41 -17
- package/dist/{chunk-ACDJLEMS.js → chunk-FOGLJA3Z.js} +56 -24
- package/dist/{chunk-OKZ6VJKA.js → chunk-J7CLCLHW.js} +266 -151
- package/dist/chunk-JYWNBHN7.js +109 -0
- package/dist/{chunk-A7HBQLEM.js → chunk-KMWECJ4D.js} +158 -64
- package/dist/chunk-NIUOM3FA.js +50 -0
- package/dist/{chunk-ZAACPFCW.js → chunk-QVCT63FH.js} +1 -1
- package/dist/cli.js +10 -4
- package/dist/cloud-command-YYQ47FTU.js +329 -0
- package/dist/cloud-upload-IGNNU5WX.js +243 -0
- package/dist/{doctor-command-KIGPIDQA.js → doctor-command-OFMURNPN.js} +5 -3
- package/dist/{explore-command-NRRJADY4.js → explore-command-KMS6UAPM.js} +3 -2
- package/dist/index.d.ts +16 -0
- package/dist/index.js +5 -4
- package/dist/{init-command-DEEVMROG.js → init-command-IXR3YUQW.js} +3 -3
- package/dist/{run-command-EVUWZI4F.js → run-command-WYSLSLYM.js} +10 -7
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -8,6 +8,46 @@ Sedum is an open-source (MIT) browser end-to-end test runner built on Playwright
|
|
|
8
8
|
|
|
9
9
|
> **Status: pre-alpha.** The test format may change before 1.0, and Windows is experimental. Linux and macOS are verified.
|
|
10
10
|
|
|
11
|
+
## Cloud account login
|
|
12
|
+
|
|
13
|
+
Account sessions are separate from CI/project upload and read tokens. Login does
|
|
14
|
+
not configure or change automatic uploads, provider keys, or environment variables.
|
|
15
|
+
No hosted instance is assumed: supply your own Cloud origin.
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npx sedum auth login --url https://your-cloud.example --no-browser
|
|
19
|
+
npx sedum auth status
|
|
20
|
+
npx sedum auth logout
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Omit `--no-browser` to open the system browser best effort. The activation URL
|
|
24
|
+
and human code are always printed; use them on another machine for SSH/headless
|
|
25
|
+
login. Ctrl-C cancels waiting. URLs must use HTTPS, except HTTP on localhost,
|
|
26
|
+
127.0.0.1 or ::1 for local development. Redirects are refused. `--url` overrides
|
|
27
|
+
`SEDUM_CLOUD_URL`, which overrides the previously selected origin.
|
|
28
|
+
|
|
29
|
+
`login` and `status` select a sole organization/project automatically. With
|
|
30
|
+
multiple choices use the terminal menu or `--organization <ID-or-name>` and
|
|
31
|
+
`--project <ID-or-name>`; names must be unambiguous. Noninteractive commands fail
|
|
32
|
+
instead of prompting. Login is still saved if the account has no projects or a
|
|
33
|
+
selection needs clarification. Create/join the organization and create a project
|
|
34
|
+
in Cloud, then rerun `auth status`. Status fetches live membership and refreshes
|
|
35
|
+
expired access tokens, rotating the refresh secret. Session lifetime is enforced
|
|
36
|
+
by Cloud (maximum 30 days); login again when refresh is rejected.
|
|
37
|
+
|
|
38
|
+
Credentials are stored per origin in the platform user config directory:
|
|
39
|
+
`$XDG_CONFIG_HOME/sedum/auth.json` or `~/.config/sedum/auth.json` (Windows:
|
|
40
|
+
`%APPDATA%/sedum/auth.json`). **Limitation:** this fallback is not an OS keychain;
|
|
41
|
+
secrets are plaintext, protected by owner-only directory/file permissions on
|
|
42
|
+
POSIX. Windows inherits user-directory ACLs; ensure other users cannot read it.
|
|
43
|
+
Keep this directory outside your checkout; never copy it into `.env` or Git.
|
|
44
|
+
Selected origin and IDs are separate fields from session secrets. Writes are
|
|
45
|
+
atomic and auth commands take an exclusive lock, including during refresh, to
|
|
46
|
+
prevent concurrent refresh rotation. After a crash, remove `auth.lock` only once
|
|
47
|
+
you have confirmed no other auth command is running. Symlink credential paths
|
|
48
|
+
and unsafe POSIX permissions are refused. Offline logout removes local secrets
|
|
49
|
+
but warns if server revocation could not be confirmed.
|
|
50
|
+
|
|
11
51
|
## Try it
|
|
12
52
|
|
|
13
53
|
You need Node.js 20.19 or newer and credentials for TypeSafe Jev (the default) or Cloudflare Clef.
|
|
@@ -53,6 +93,31 @@ Between steps you can use Playwright's `page` and `expect`, any test-data librar
|
|
|
53
93
|
- **No black box.** Prompts, scoring, and caching are in the repository.
|
|
54
94
|
- **Made for coding agents.** `npx sedum run --reporter markdown` writes a failure report that Claude Code or Cursor can read and fix from.
|
|
55
95
|
|
|
96
|
+
## Read Cloud results
|
|
97
|
+
|
|
98
|
+
After `npx sedum auth login --url https://your-cloud.example`, read recent results
|
|
99
|
+
without a browser or interactive prompt:
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
npx sedum runs list --since 7d --json
|
|
103
|
+
npx sedum runs show <cloud-run-uuid> --json
|
|
104
|
+
npx sedum runs show <cloud-run-uuid> --report --json
|
|
105
|
+
npx sedum tests history --test-id checkout --since 7d --json
|
|
106
|
+
npx sedum tests stats --sort flaky-runs --json
|
|
107
|
+
npx sedum tests stats --sort duration-regression --compare previous --json
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Reads use current membership and saved project choices; override with
|
|
111
|
+
`--url`, `--organization`, and `--project` (ID or unambiguous name). They do not
|
|
112
|
+
change saved choices. Reports are opt-in, list/history return one page, and stats
|
|
113
|
+
are bounded, fully computed rankings. See the CLI reference for metric definitions,
|
|
114
|
+
time windows, pagination, comparisons, and filters.
|
|
115
|
+
|
|
116
|
+
For agent-guided investigation and test gardening, install the portable
|
|
117
|
+
`investigating-sedum-tests` skill in Claude Code or Codex. See the
|
|
118
|
+
[skill installation guide](https://github.com/sedum-dev/sedum/blob/main/docs/agent-skills.md)
|
|
119
|
+
for a one-command install, manual copying, and example prompts. No MCP server is required.
|
|
120
|
+
|
|
56
121
|
## Documentation
|
|
57
122
|
|
|
58
123
|
- [Full README and quickstart](https://github.com/sedum-dev/sedum#readme)
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
discoverRunTests
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QVCT63FH.js";
|
|
4
4
|
import {
|
|
5
5
|
createCliProvider
|
|
6
6
|
} from "./chunk-N5CTUO2A.js";
|
|
7
7
|
import {
|
|
8
8
|
providerDiagnostic
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CGDXQY2Y.js";
|
|
10
|
+
import {
|
|
11
|
+
AffectedSelectionError,
|
|
12
|
+
MAX_DIFF_BYTES,
|
|
13
|
+
gitRead
|
|
14
|
+
} from "./chunk-NIUOM3FA.js";
|
|
10
15
|
import {
|
|
11
16
|
affectedPathIgnored,
|
|
12
17
|
loadProjectConfig,
|
|
13
18
|
validAffectedGlob
|
|
14
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-J7CLCLHW.js";
|
|
15
20
|
|
|
16
21
|
// src/affected-selection.ts
|
|
17
22
|
import { realpath } from "fs/promises";
|
|
@@ -25,53 +30,6 @@ import {
|
|
|
25
30
|
|
|
26
31
|
// src/affected-git.ts
|
|
27
32
|
import path from "path";
|
|
28
|
-
|
|
29
|
-
// src/affected-git-read.ts
|
|
30
|
-
import { spawn } from "child_process";
|
|
31
|
-
import { isUtf8 } from "buffer";
|
|
32
|
-
var MAX_DIFF_BYTES = 16 * 1024 * 1024;
|
|
33
|
-
var AffectedSelectionError = class extends Error {
|
|
34
|
-
};
|
|
35
|
-
function gitRead(cwd, args, signal, limit = MAX_DIFF_BYTES) {
|
|
36
|
-
return new Promise((resolve, reject) => {
|
|
37
|
-
const child = spawn("git", args, {
|
|
38
|
-
cwd,
|
|
39
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
40
|
-
env: { ...process.env, GIT_OPTIONAL_LOCKS: "0" },
|
|
41
|
-
...signal ? { signal } : {}
|
|
42
|
-
});
|
|
43
|
-
const buffers = [];
|
|
44
|
-
let bytes = 0;
|
|
45
|
-
let exceeded = false;
|
|
46
|
-
child.stdout.on("data", (buffer) => {
|
|
47
|
-
bytes += buffer.length;
|
|
48
|
-
if (bytes > limit) {
|
|
49
|
-
exceeded = true;
|
|
50
|
-
child.kill();
|
|
51
|
-
} else buffers.push(buffer);
|
|
52
|
-
});
|
|
53
|
-
child.on("error", reject);
|
|
54
|
-
child.on("close", (code) => {
|
|
55
|
-
if (exceeded)
|
|
56
|
-
reject(
|
|
57
|
-
new AffectedSelectionError(
|
|
58
|
-
"Retained Git input exceeds the 16 MiB guard. Run the full suite; input was not truncated."
|
|
59
|
-
)
|
|
60
|
-
);
|
|
61
|
-
else if (code !== 0) reject(new Error("Git read failed"));
|
|
62
|
-
else resolve(Buffer.concat(buffers));
|
|
63
|
-
});
|
|
64
|
-
}).then(decodeGitOutput);
|
|
65
|
-
}
|
|
66
|
-
function decodeGitOutput(output) {
|
|
67
|
-
if (!isUtf8(output))
|
|
68
|
-
throw new AffectedSelectionError(
|
|
69
|
-
"Git input is not valid UTF-8. Run the full suite."
|
|
70
|
-
);
|
|
71
|
-
return output.toString("utf8");
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// src/affected-git.ts
|
|
75
33
|
async function assertAffectedSnapshot({
|
|
76
34
|
root,
|
|
77
35
|
head,
|