sedum-cli 0.1.0-alpha.18 → 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 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,15 +1,22 @@
1
1
  import {
2
2
  discoverRunTests
3
- } from "./chunk-6ILFLNDI.js";
3
+ } from "./chunk-QVCT63FH.js";
4
4
  import {
5
5
  createCliProvider
6
6
  } from "./chunk-N5CTUO2A.js";
7
+ import {
8
+ providerDiagnostic
9
+ } from "./chunk-CGDXQY2Y.js";
10
+ import {
11
+ AffectedSelectionError,
12
+ MAX_DIFF_BYTES,
13
+ gitRead
14
+ } from "./chunk-NIUOM3FA.js";
7
15
  import {
8
16
  affectedPathIgnored,
9
17
  loadProjectConfig,
10
- providerDiagnostic,
11
18
  validAffectedGlob
12
- } from "./chunk-KZF4NZ6M.js";
19
+ } from "./chunk-J7CLCLHW.js";
13
20
 
14
21
  // src/affected-selection.ts
15
22
  import { realpath } from "fs/promises";
@@ -23,53 +30,6 @@ import {
23
30
 
24
31
  // src/affected-git.ts
25
32
  import path from "path";
26
-
27
- // src/affected-git-read.ts
28
- import { spawn } from "child_process";
29
- import { isUtf8 } from "buffer";
30
- var MAX_DIFF_BYTES = 16 * 1024 * 1024;
31
- var AffectedSelectionError = class extends Error {
32
- };
33
- function gitRead(cwd, args, signal, limit = MAX_DIFF_BYTES) {
34
- return new Promise((resolve, reject) => {
35
- const child = spawn("git", args, {
36
- cwd,
37
- stdio: ["ignore", "pipe", "ignore"],
38
- env: { ...process.env, GIT_OPTIONAL_LOCKS: "0" },
39
- ...signal ? { signal } : {}
40
- });
41
- const buffers = [];
42
- let bytes = 0;
43
- let exceeded = false;
44
- child.stdout.on("data", (buffer) => {
45
- bytes += buffer.length;
46
- if (bytes > limit) {
47
- exceeded = true;
48
- child.kill();
49
- } else buffers.push(buffer);
50
- });
51
- child.on("error", reject);
52
- child.on("close", (code) => {
53
- if (exceeded)
54
- reject(
55
- new AffectedSelectionError(
56
- "Retained Git input exceeds the 16 MiB guard. Run the full suite; input was not truncated."
57
- )
58
- );
59
- else if (code !== 0) reject(new Error("Git read failed"));
60
- else resolve(Buffer.concat(buffers));
61
- });
62
- }).then(decodeGitOutput);
63
- }
64
- function decodeGitOutput(output) {
65
- if (!isUtf8(output))
66
- throw new AffectedSelectionError(
67
- "Git input is not valid UTF-8. Run the full suite."
68
- );
69
- return output.toString("utf8");
70
- }
71
-
72
- // src/affected-git.ts
73
33
  async function assertAffectedSnapshot({
74
34
  root,
75
35
  head,