screw-bugs 0.1.6 → 0.1.8
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 +86 -16
- package/dist/browser-playwright/launch.d.ts +4 -2
- package/dist/browser-playwright/launch.js +8 -1
- package/dist/browser-playwright/page.d.ts +2 -2
- package/dist/browser-playwright/page.js +15 -2
- package/dist/browser-playwright/still.d.ts +12 -0
- package/dist/browser-playwright/still.js +51 -0
- package/dist/build-info.json +3 -3
- package/dist/cli/app.d.ts +1 -1
- package/dist/cli/commands.js +57 -12
- package/dist/cli/mcp.d.ts +11 -4
- package/dist/cli/mcp.js +86 -23
- package/dist/cli/operations.d.ts +30 -2
- package/dist/cli/operations.js +126 -20
- package/dist/cli/report-links.js +2 -2
- package/dist/cli/report-server.d.ts +41 -9
- package/dist/cli/report-server.js +139 -23
- package/dist/cli/share.d.ts +71 -4
- package/dist/cli/share.js +549 -118
- package/dist/cli/sign-in.d.ts +22 -10
- package/dist/cli/sign-in.js +23 -23
- package/dist/core/engine.js +67 -17
- package/dist/core/liveness.js +3 -1
- package/dist/core/services.d.ts +30 -5
- package/dist/core/share.d.ts +31 -0
- package/dist/core/share.js +139 -0
- package/dist/core/steps.d.ts +5 -0
- package/dist/core/steps.js +15 -1
- package/dist/core/video.d.ts +31 -0
- package/dist/core/video.js +132 -0
- package/dist/report/html.d.ts +4 -2
- package/dist/report/html.js +45 -13
- package/dist/report/icons.d.ts +3 -0
- package/dist/report/icons.js +5 -1
- package/dist/report/index.d.ts +3 -1
- package/dist/report/index.js +3 -1
- package/dist/report/live.d.ts +7 -0
- package/dist/report/live.js +135 -0
- package/dist/report/menu-bar.d.ts +3 -3
- package/dist/report/menu-bar.js +4 -4
- package/dist/report/player.d.ts +3 -3
- package/dist/report/player.js +3 -3
- package/dist/report/share-page.d.ts +48 -0
- package/dist/report/share-page.js +291 -0
- package/dist/report/styles.d.ts +2 -0
- package/dist/report/styles.js +2 -2
- package/dist/report/view.d.ts +16 -5
- package/dist/report/view.js +60 -24
- package/dist/report/walkthrough.d.ts +7 -3
- package/dist/report/walkthrough.js +21 -8
- package/dist/schema/accounts.js +10 -1
- package/dist/schema/evidence.d.ts +30 -8
- package/dist/schema/evidence.js +17 -4
- package/dist/schema/findings.js +1 -1
- package/dist/schema/job.d.ts +205 -65
- package/dist/schema/job.js +63 -11
- package/dist/schema/ledger.d.ts +88 -16
- package/dist/schema/ledger.js +36 -0
- package/dist/schema/share.d.ts +17 -0
- package/dist/schema/share.js +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -125,7 +125,18 @@ Without a write-up the report still renders from the run alone.
|
|
|
125
125
|
|
|
126
126
|
`run_status` takes a `jobId` and an optional `waitSeconds` (0–60, default 0): if the run is still
|
|
127
127
|
queued or running, it waits up to that long for the run to end before replying. It rereads the
|
|
128
|
-
ledger, so it also works for runs started by another process.
|
|
128
|
+
ledger, so it also works for runs started by another process. While the run is still going, the
|
|
129
|
+
reply says which case and step it is on, then gives the run folder, `ledger.json` and its live page
|
|
130
|
+
(see [Following a run](#following-a-run)):
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
Job 20261029-104857-3f9a01c2 is running case 2 of 3 (reply-maya), step 4 (click): 0 passed, 1 failed, 0 blocked, 1 not verified; follow it as it runs in live.html (the URL below).
|
|
134
|
+
/path/to/project/.screw-bugs/runs/20261029-104857-3f9a01c2
|
|
135
|
+
/path/to/project/.screw-bugs/runs/20261029-104857-3f9a01c2/ledger.json
|
|
136
|
+
http://127.0.0.1:41234/20261029-104857-3f9a01c2/live.html
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Once the run has ended, its reply is
|
|
129
140
|
the counts, then a compact evidence pack: two lines per case (cases that did not pass first), the
|
|
130
141
|
status and reason, then the deciding step and when it ran, the screenshot IDs, the timecodes (ms
|
|
131
142
|
into the session video) a write-up may use, where the page was, HTTP errors, the visible text
|
|
@@ -326,6 +337,7 @@ Chromium: this catches responsive layout and touch problems, not Safari-only bug
|
|
|
326
337
|
| `goto` | `url` | Open a URL; paths resolve against the job URL. HTTP 400+ fails. |
|
|
327
338
|
| `reload` | | Reload the page; judged like `goto` |
|
|
328
339
|
| `click` | `target` | Click an element; a page it opens with HTTP 400+ fails |
|
|
340
|
+
| `hover` | `target` | Move the pointer over an element, for controls shown on hover |
|
|
329
341
|
| `fill` | `target`, `value` | Replace the value of an input |
|
|
330
342
|
| `upload` | `target`, `files` | Choose files for a file input (see [Uploads](#uploads)) |
|
|
331
343
|
| `press` | `key` | Press a key, such as `Enter`; a page it opens with 400+ fails |
|
|
@@ -711,7 +723,16 @@ When the account has no saved session for the job URL's origin, nothing starts.
|
|
|
711
723
|
reply gives a link to the live view (`http://127.0.0.1:<port>/<token>/`); open it, sign in as that
|
|
712
724
|
user (OAuth redirects and codes by email or an app work; passkeys and security keys do not, since
|
|
713
725
|
they need your own device), press **Save sign-in**, then
|
|
714
|
-
have your agent start the job again.
|
|
726
|
+
have your agent start the job again. `start_run` also takes an optional `waitSeconds` (0–600,
|
|
727
|
+
default 0): with it, the call waits up to that long for you to press **Save sign-in** and then
|
|
728
|
+
starts the run, so nobody has to tell the agent you are done. Since the link reaches you only in a
|
|
729
|
+
reply, an agent calls once without `waitSeconds` to get the link and show it to you, then again
|
|
730
|
+
with `waitSeconds` to wait. The wait counts from the call, opening the sign-in included; when it
|
|
731
|
+
runs out, a save already in progress gets up to 5 seconds to finish, then the call looks for a saved session once more and otherwise gives the same link again.
|
|
732
|
+
The live view opens the app at once, so when the account is not in `.screw-bugs/accounts.json`
|
|
733
|
+
yet, agents first get the app running and what that user needs to sign in (the user itself, in a
|
|
734
|
+
local database), then start the job before the rest of their preparation (seeding test data), so
|
|
735
|
+
you can sign in meanwhile. From the CLI, `screw-bugs run` exits with code 9
|
|
715
736
|
(`SignInNeeded`) and prints the command that opens the live view:
|
|
716
737
|
|
|
717
738
|
```sh
|
|
@@ -720,9 +741,10 @@ npx screw-bugs accounts sign-in trial-user --url http://localhost:3000 --about "
|
|
|
720
741
|
|
|
721
742
|
- **On another device.** The live view listens on 127.0.0.1, so by default it opens only on this
|
|
722
743
|
machine (in your coding tool's browser, for example). To sign in from your phone or another
|
|
723
|
-
computer on your network or tailnet, set `SCREW_BUGS_SIGN_IN_HOST`
|
|
724
|
-
|
|
725
|
-
|
|
744
|
+
computer on your network or tailnet, set `SCREW_BUGS_SIGN_IN_HOST` as `SCREW_BUGS_REPORT_HOST`
|
|
745
|
+
(below): this machine's full MagicDNS name or its Tailscale IP (`tailscale ip -4`). The link
|
|
746
|
+
then uses what you set, and with a name the IP it resolves to works too. It never listens on
|
|
747
|
+
every interface. The link holds a random token and works only while that
|
|
726
748
|
sign-in is open; it closes when you save or cancel, after 15 minutes without use, or when the
|
|
727
749
|
MCP server or the command stops.
|
|
728
750
|
- **Keeping it current.** A session is saved for one origin; a job on another origin (staging
|
|
@@ -754,7 +776,8 @@ npx screw-bugs accounts sign-in trial-user --url http://localhost:3000 --about "
|
|
|
754
776
|
| `report <job-id> --serve [--port N]` | Serve the report at a `http://127.0.0.1` URL |
|
|
755
777
|
| `walkthrough <job-id> [--serve]` | Write (or serve) the run's video walkthrough |
|
|
756
778
|
| `findings <job-id> <file\|->` | Submit an agent's write-up of an ended run |
|
|
757
|
-
| `
|
|
779
|
+
| `schema <job\|findings>` | Print the JSON Schema of a job or write-up |
|
|
780
|
+
| `share <job-id>` | Share a report through Screw Bugs Cloud |
|
|
758
781
|
| `runs` | List recent runs |
|
|
759
782
|
| `analytics` | Show whether analytics are on (off by default) |
|
|
760
783
|
|
|
@@ -765,12 +788,14 @@ Runs go to `.screw-bugs/runs/<job-id>/` in your project: `job.json`, `ledger.jso
|
|
|
765
788
|
reason of every case, and when each case and step ran in the video), `evidence/` (screenshots, each
|
|
766
789
|
with a `.json` file of the page state at that moment), `video/` (one video per session),
|
|
767
790
|
`evidence.json` (the evidence pack), `findings.json` and `annotated/` (once an agent submitted a
|
|
768
|
-
write-up), `
|
|
769
|
-
`
|
|
791
|
+
write-up), `live.html` (see [Following a run](#following-a-run)), `report.html` (or
|
|
792
|
+
`report-interrupted.html`; see [Report](#report)) and `walkthrough.html` (see
|
|
793
|
+
[Walkthrough](#walkthrough)). The folder
|
|
770
794
|
ignores itself in git.
|
|
771
795
|
|
|
772
796
|
Besides screenshot steps and the page when a case stopped, a case gets a screenshot at each step
|
|
773
|
-
that acts on or finds an element: before a click, after a fill
|
|
797
|
+
that acts on or finds an element: before a click, after a fill or a hover (showing what the hover
|
|
798
|
+
revealed), and when expected text appears,
|
|
774
799
|
with the box of that element; and after each `waitFor` and `scroll`, of what is in view. Each
|
|
775
800
|
screenshot's `.json` holds the elements of the page and of the frames visible on it (at most 8
|
|
776
801
|
frames and 150 elements each, 400 in all frames together), with their boxes on the image. Video problems (no recording possible, an empty or cut-short file)
|
|
@@ -795,6 +820,23 @@ only once the heartbeat is 10 minutes old. They never write or remove `report.ht
|
|
|
795
820
|
itself writes that. If the process comes back anyway, its `report.html` takes precedence, and it
|
|
796
821
|
deletes the interrupted report once it has written its own.
|
|
797
822
|
|
|
823
|
+
### Following a run
|
|
824
|
+
|
|
825
|
+
While a run is going, it writes `live.html` into its folder: a page to watch it on, with the
|
|
826
|
+
counts, every case (passed, failed, blocked, running or pending) and the case and step it is on.
|
|
827
|
+
The run writes it when it starts and again with every write of `ledger.json` (when a case ends,
|
|
828
|
+
and every 5 seconds with its heartbeat), and the page reloads itself every 3 seconds. `ledger.json`
|
|
829
|
+
keeps where the run is as `progress` (`{ "case": 2, "step": 4, "kind": "click" }`), saved with
|
|
830
|
+
those writes, so it may be a few seconds behind. When the run ends, its last write of `live.html`
|
|
831
|
+
stops the reloading and links `report.html` (and `walkthrough.html`). If the run's process dies,
|
|
832
|
+
the page's "last updated" time stops moving; `status` and `run_status` then report the run as
|
|
833
|
+
errored and give its interrupted report, as above.
|
|
834
|
+
|
|
835
|
+
`run_status` and `status` give its URL while the run is going (its path when there is no URL, see
|
|
836
|
+
[Viewing reports](#viewing-reports); with `--json`, `livePath` and `liveUrl`), and say which case
|
|
837
|
+
and step the run is on in their first sentence. `live.html` is never the report: the
|
|
838
|
+
report rules below do not change.
|
|
839
|
+
|
|
798
840
|
### Report
|
|
799
841
|
|
|
800
842
|
Every run that ends, finished or errored, writes `report.html` into its folder. One page, one
|
|
@@ -857,7 +899,7 @@ reports](#viewing-reports)).
|
|
|
857
899
|
With `report.html`, the run writes `walkthrough.html`: a page to click through what the run did. The
|
|
858
900
|
video in a browser window (a phone, for a run on a phone, with the script beside it on a wide
|
|
859
901
|
screen) with the page's address at each moment, controls under it (speed, "Skip inactive" to jump
|
|
860
|
-
over stretches where
|
|
902
|
+
over stretches where nothing happened, the cursor overlay, fullscreen), and below it the script: every
|
|
861
903
|
step of every case in run order, grouped by case (its title and status), each with its timecode
|
|
862
904
|
and the step in words (`0:01.5 Fill the field labelled "Note" with "this is a new line"`). As the
|
|
863
905
|
video plays, the step playing now is the script's top row, highlighted (without motion when the
|
|
@@ -894,7 +936,11 @@ apart from a page zoomed in and moved, so a phone click there records only its t
|
|
|
894
936
|
On a desktop, where only pinch zoom moves the page, every browser records the point. Only
|
|
895
937
|
those count, because a page cannot make them trusted itself. It can make trusted edits
|
|
896
938
|
(`document.execCommand`), so typing into a field, and files set on a file input directly, have no
|
|
897
|
-
time or point of their own: their label shows while the step plays. A
|
|
939
|
+
time or point of their own: their label shows while the step plays. A `hover` has none either:
|
|
940
|
+
when a page moves or scrolls under a mouse that stands still, the browser itself sends trusted
|
|
941
|
+
mouse events, so no mouse move proves where or when a hover moved it. Its label shows while the
|
|
942
|
+
step plays, and the cursor is hidden from then until the next click (also after a hover that
|
|
943
|
+
failed, which may have moved the mouse all the same), never left where the mouse no longer is. A step whose input was not
|
|
898
944
|
seen, such as a click inside an iframe, gets no cursor point and no ripple, never a guessed one,
|
|
899
945
|
and its label shows while the step plays. With reduced
|
|
900
946
|
motion the cursor jumps instead of gliding and there is no ripple. **Show cursor** under the video
|
|
@@ -932,12 +978,13 @@ Browsers built into coding tools, such as Cursor's browser or the browser pane o
|
|
|
932
978
|
desktop app, cannot open `file://` pages, but they can open `http://127.0.0.1`. Use a URL instead:
|
|
933
979
|
|
|
934
980
|
- From an agent, `run_status` (and `submit_findings`) give the report's URL (and the
|
|
935
|
-
walkthrough's) in place of its path. The MCP server starts a small local server for this the first time it has a report to give,
|
|
981
|
+
walkthrough's, or while the run is going, its `live.html`'s) in place of its path. The MCP server starts a small local server for this the first time it has a report to give,
|
|
936
982
|
and keeps it for as long as it runs; one per MCP server. `SCREW_BUGS_SERVE=0` turns it off, and
|
|
937
983
|
replies then give the paths.
|
|
938
984
|
- From a terminal (or an agent using the CLI), `run`, `status`, `report`, `walkthrough` and
|
|
939
985
|
`findings` print the report's and walkthrough's URLs in place of their paths (with `--json`,
|
|
940
|
-
`reportUrl` and `walkthroughUrl` beside `reportPath` and `walkthroughPath`)
|
|
986
|
+
`reportUrl` and `walkthroughUrl` beside `reportPath` and `walkthroughPath`), and `status` that of
|
|
987
|
+
a running run's `live.html` (`liveUrl` beside `livePath`). They use the
|
|
941
988
|
project's report server when one is up (an MCP server's, say); otherwise they start one in the
|
|
942
989
|
background, which keeps serving after the command ends and stops on its own after 30 minutes
|
|
943
990
|
without a request (an MCP server of the project then takes its port over). A command waits at
|
|
@@ -946,6 +993,19 @@ desktop app, cannot open `file://` pages, but they can open `http://127.0.0.1`.
|
|
|
946
993
|
- From a terminal, `screw-bugs report <job-id> --serve` (or `walkthrough <job-id> --serve`) writes
|
|
947
994
|
the report as `report` does, prints its URL (or the walkthrough's) and serves until Ctrl+C (which exits with 130, like any interrupted command). With
|
|
948
995
|
`--json` it prints `{ "url": "...", "ok": true, "path": "...", "reused": false }`.
|
|
996
|
+
- **On another device.** The report server listens on 127.0.0.1, so by default its links open only
|
|
997
|
+
on this machine. To open reports from your phone or another computer on your network or
|
|
998
|
+
tailnet, set `SCREW_BUGS_REPORT_HOST` in the MCP server's environment (or the shell that runs
|
|
999
|
+
the commands) to this machine's full MagicDNS name (`pop-os.tail1234.ts.net`, from `tailscale
|
|
1000
|
+
status --self`) or its Tailscale IP (`tailscale ip -4`). Links then use what you set. The
|
|
1001
|
+
server listens only on the one address that resolves to, never on every interface, and answers
|
|
1002
|
+
requests addressed to the name you set or to that address, so `http://100.x.y.z:…` works with
|
|
1003
|
+
the name set (but a bare `http://pop-os:…` only when you set `pop-os`). A name is looked up each
|
|
1004
|
+
time a server starts. The short name (`pop-os`) works too, but what it resolves to depends on
|
|
1005
|
+
this machine's DNS setup: without Tailscale's DNS it can resolve to a LAN address (opening
|
|
1006
|
+
reports to your LAN) or to loopback, which is refused (many Linux systems map the machine's own
|
|
1007
|
+
name to 127.0.1.1). Check with `getent hosts pop-os`. The Share button works there with a
|
|
1008
|
+
pairing code (see Sharing below).
|
|
949
1009
|
|
|
950
1010
|
**Ports.** Each project gets its own port in 41000–41999, the same one every time: a hash of the
|
|
951
1011
|
real path of its `.screw-bugs/runs` folder picks it. So a report link keeps working across MCP
|
|
@@ -999,8 +1059,8 @@ The one other thing they answer is the Share button's routes, under `/.screw-bug
|
|
|
999
1059
|
|
|
1000
1060
|
### Sharing
|
|
1001
1061
|
|
|
1002
|
-
A report or walkthrough opened through the report server (its `http
|
|
1003
|
-
**Share** button that puts the run on
|
|
1062
|
+
A report or walkthrough opened through the report server (its `http://` URL) has a
|
|
1063
|
+
**Share** button that puts the run on Screw Bugs Cloud: a link anyone can open for 7 days. Opened
|
|
1004
1064
|
from disk, or on Cloud itself, the page has no server to share it, so the button is not there.
|
|
1005
1065
|
|
|
1006
1066
|
1. Share sends the browser to `screwbugs.dev`, which signs you in with GitHub and shows what will
|
|
@@ -1010,8 +1070,18 @@ from disk, or on Cloud itself, the page has no server to share it, so the button
|
|
|
1010
1070
|
its progress, then sends the browser to the share's page on Cloud: its link, when it expires,
|
|
1011
1071
|
and a button to delete it.
|
|
1012
1072
|
|
|
1073
|
+
Opened from another device (with `SCREW_BUGS_REPORT_HOST`, above), Cloud cannot send the browser
|
|
1074
|
+
back to this machine, so Share works as `stripe login` does: the report server asks Cloud for a
|
|
1075
|
+
share request and shows a pairing code with a link to `screwbugs.dev`. Type the code there and
|
|
1076
|
+
confirm; meanwhile the server asks Cloud for the ticket every couple of seconds, gets it once you
|
|
1077
|
+
confirmed, and uploads as above, and the page with the code moves on to the share. Only that page
|
|
1078
|
+
shows the code, so a share link someone else sends you cannot upload into your account.
|
|
1079
|
+
|
|
1013
1080
|
Only a person can share: it takes a click in the report and a confirmation on Cloud. The share
|
|
1014
|
-
starts only from a click in a page of the same server
|
|
1081
|
+
starts only from a click in a page of the same server. Where the browser does not say where a
|
|
1082
|
+
click came from (it says so only to 127.0.0.1 and localhost), Share first asks "Share this run on
|
|
1083
|
+
Screw Bugs Cloud?", and only that page's button, posted from the same server, starts it. The
|
|
1084
|
+
share's pages never show inside another site's page, the ticket goes only to the Cloud the
|
|
1015
1085
|
server was set up with, and a ticket works once, for the share it was made for. The `share`
|
|
1016
1086
|
command is not implemented; there is no agent or CLI path.
|
|
1017
1087
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Effect, FileSystem, Layer, Path } from 'effect';
|
|
2
|
+
import { ChildProcessSpawner } from 'effect/process';
|
|
2
3
|
import { Browser } from '../core/index.js';
|
|
3
4
|
/**
|
|
4
5
|
* Launches the installed Chrome, else Edge, else Playwright's downloaded Chromium. Needs the
|
|
5
|
-
* platform (`FileSystem`, `Path`) to find Playwright's ffmpeg
|
|
6
|
+
* platform (`FileSystem`, `Path`) to find Playwright's ffmpeg, and `ChildProcessSpawner` to run it
|
|
7
|
+
* over saved videos (`stillVideo`).
|
|
6
8
|
*/
|
|
7
|
-
export declare const BrowserPlaywright: Layer.Layer<Browser, never, FileSystem.FileSystem | Path.Path>;
|
|
9
|
+
export declare const BrowserPlaywright: Layer.Layer<Browser, never, ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem | Path.Path>;
|
|
8
10
|
/**
|
|
9
11
|
* Downloads the Chromium build that matches the bundled Playwright. Pinned to our version so the
|
|
10
12
|
* browser revision is the one we look for.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Effect, FileSystem, Layer, Path, Schema } from 'effect';
|
|
2
|
+
import { ChildProcessSpawner } from 'effect/process';
|
|
2
3
|
import { chromium } from 'playwright-core';
|
|
3
4
|
import { Browser, BrowserNotFound } from '../core/index.js';
|
|
4
5
|
import { annotateAll } from './annotate.js';
|
|
6
|
+
import { stillVideo } from './still.js';
|
|
5
7
|
import { signInBrowser } from './sign-in.js';
|
|
6
8
|
import { deviceLabel, newSession } from './page.js';
|
|
7
9
|
/** Order matters: prefer what the user already has installed. */
|
|
@@ -50,11 +52,13 @@ const open = (options) => launchAny(options.headed).pipe(Effect.map(({ candidate
|
|
|
50
52
|
})));
|
|
51
53
|
/**
|
|
52
54
|
* Launches the installed Chrome, else Edge, else Playwright's downloaded Chromium. Needs the
|
|
53
|
-
* platform (`FileSystem`, `Path`) to find Playwright's ffmpeg
|
|
55
|
+
* platform (`FileSystem`, `Path`) to find Playwright's ffmpeg, and `ChildProcessSpawner` to run it
|
|
56
|
+
* over saved videos (`stillVideo`).
|
|
54
57
|
*/
|
|
55
58
|
export const BrowserPlaywright = Layer.effect(Browser, Effect.gen(function* () {
|
|
56
59
|
const fs = yield* FileSystem.FileSystem;
|
|
57
60
|
const path = yield* Path.Path;
|
|
61
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
58
62
|
const videoSupport = Effect.gen(function* () {
|
|
59
63
|
const lookup = yield* findFfmpeg;
|
|
60
64
|
if (lookup.found)
|
|
@@ -64,6 +68,9 @@ export const BrowserPlaywright = Layer.effect(Browser, Effect.gen(function* () {
|
|
|
64
68
|
return {
|
|
65
69
|
detect: Effect.scoped(open({ headed: false })).pipe(Effect.map((session) => session.info)),
|
|
66
70
|
videoSupport,
|
|
71
|
+
stillVideo: (file) => findFfmpeg.pipe(Effect.flatMap((lookup) => lookup.found && lookup.path !== undefined
|
|
72
|
+
? stillVideo(lookup.path, file)
|
|
73
|
+
: Effect.succeed(undefined)), Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path), Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner)),
|
|
67
74
|
open,
|
|
68
75
|
deviceLabel,
|
|
69
76
|
annotate: (jobs) => Effect.scoped(launchAny(false).pipe(Effect.flatMap(({ browser }) => annotateAll(browser, jobs)))),
|
|
@@ -13,8 +13,8 @@ export declare const NAVIGATION_TIMEOUT_MS = 15000;
|
|
|
13
13
|
export declare const EXPECT_TIMEOUT_MS = 5000;
|
|
14
14
|
export declare const SCREENSHOT_TIMEOUT_MS = 10000;
|
|
15
15
|
/**
|
|
16
|
-
* How long a click or key press waits after it is dispatched, so that a navigation it
|
|
17
|
-
* starts while it is still the current step, such as a form that the Enter key submits.
|
|
16
|
+
* How long a click, hover or key press waits after it is dispatched, so that a navigation it
|
|
17
|
+
* causes starts while it is still the current step, such as a form that the Enter key submits.
|
|
18
18
|
*/
|
|
19
19
|
export declare const NAVIGATION_START_MS = 250;
|
|
20
20
|
/**
|
|
@@ -17,8 +17,8 @@ export const NAVIGATION_TIMEOUT_MS = DEFAULT_LOAD_MS;
|
|
|
17
17
|
export const EXPECT_TIMEOUT_MS = DEFAULT_WAIT_MS;
|
|
18
18
|
export const SCREENSHOT_TIMEOUT_MS = 10_000;
|
|
19
19
|
/**
|
|
20
|
-
* How long a click or key press waits after it is dispatched, so that a navigation it
|
|
21
|
-
* starts while it is still the current step, such as a form that the Enter key submits.
|
|
20
|
+
* How long a click, hover or key press waits after it is dispatched, so that a navigation it
|
|
21
|
+
* causes starts while it is still the current step, such as a form that the Enter key submits.
|
|
22
22
|
*/
|
|
23
23
|
export const NAVIGATION_START_MS = 250;
|
|
24
24
|
const seconds = (ms) => `${ms / 1000} s`;
|
|
@@ -1317,6 +1317,19 @@ drawn) => {
|
|
|
1317
1317
|
: firstLine(error)));
|
|
1318
1318
|
return yield* tracedAfterPause(began, dispatched, true);
|
|
1319
1319
|
}),
|
|
1320
|
+
hover: (target, wait) => Effect.gen(function* () {
|
|
1321
|
+
const timeout = wait?.timeoutMs ?? ACTION_TIMEOUT_MS;
|
|
1322
|
+
const locator = yield* element(target, timeout);
|
|
1323
|
+
// Not watched: a page can make trusted mouse moves happen itself (see
|
|
1324
|
+
// `StepAction.atMs`), so a hover records no time or point.
|
|
1325
|
+
yield* attempt(() => locator.hover({ timeout }), (error) => isTimeout(error)
|
|
1326
|
+
? `The element was found but the mouse could not be moved over it within ${seconds(timeout)}.`
|
|
1327
|
+
: firstLine(error));
|
|
1328
|
+
// As after a click: a navigation the hover starts (a `mouseenter` handler's) starts while
|
|
1329
|
+
// it is still the current step, so its load is judged as the hover's.
|
|
1330
|
+
yield* Effect.sleep(NAVIGATION_START_MS);
|
|
1331
|
+
return {};
|
|
1332
|
+
}),
|
|
1320
1333
|
fill: (target, value, wait) => Effect.gen(function* () {
|
|
1321
1334
|
const timeout = wait?.timeoutMs ?? ACTION_TIMEOUT_MS;
|
|
1322
1335
|
const locator = yield* element(target, timeout);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Effect, FileSystem, Path } from 'effect';
|
|
2
|
+
import { ChildProcessSpawner } from 'effect/process';
|
|
3
|
+
import type { StillStretch } from '../schema/index.js';
|
|
4
|
+
/** How long measuring one video may take before it is given up (the run waits for it). */
|
|
5
|
+
export declare const STILL_TIMEOUT = "2 minutes";
|
|
6
|
+
/**
|
|
7
|
+
* Where the video at `file` stands still: Playwright's ffmpeg (at `ffmpeg`, the one that recorded it) writes it
|
|
8
|
+
* as small grey PNG frames into a temporary folder, removed afterwards, and `stillStretches`
|
|
9
|
+
* compares them. Undefined when ffmpeg fails, takes longer than `STILL_TIMEOUT`, or
|
|
10
|
+
* writes frames that cannot be read. Never changes the video.
|
|
11
|
+
*/
|
|
12
|
+
export declare const stillVideo: (ffmpeg: string, file: string) => Effect.Effect<ReadonlyArray<StillStretch> | undefined, never, FileSystem.FileSystem | Path.Path | ChildProcessSpawner.ChildProcessSpawner>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { inflateSync } from 'node:zlib';
|
|
2
|
+
import { Effect, FileSystem, Path } from 'effect';
|
|
3
|
+
import { ChildProcess, ChildProcessSpawner } from 'effect/process';
|
|
4
|
+
import { grayPng, STILL_FPS, STILL_WIDTH, stillStretches } from '../core/index.js';
|
|
5
|
+
/** How long measuring one video may take before it is given up (the run waits for it). */
|
|
6
|
+
export const STILL_TIMEOUT = '2 minutes';
|
|
7
|
+
/**
|
|
8
|
+
* Boundary: zlib has no Effect service, and PNG frames are zlib-compressed. Only ever given the
|
|
9
|
+
* small frames ffmpeg wrote for `stillVideo`.
|
|
10
|
+
*/
|
|
11
|
+
const inflate = (data) => inflateSync(data);
|
|
12
|
+
/**
|
|
13
|
+
* Where the video at `file` stands still: Playwright's ffmpeg (at `ffmpeg`, the one that recorded it) writes it
|
|
14
|
+
* as small grey PNG frames into a temporary folder, removed afterwards, and `stillStretches`
|
|
15
|
+
* compares them. Undefined when ffmpeg fails, takes longer than `STILL_TIMEOUT`, or
|
|
16
|
+
* writes frames that cannot be read. Never changes the video.
|
|
17
|
+
*/
|
|
18
|
+
export const stillVideo = (ffmpeg, file) => Effect.scoped(Effect.gen(function* () {
|
|
19
|
+
const fs = yield* FileSystem.FileSystem;
|
|
20
|
+
const path = yield* Path.Path;
|
|
21
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
22
|
+
const dir = yield* fs.makeTempDirectoryScoped({ prefix: 'screw-bugs-still-' });
|
|
23
|
+
const code = yield* spawner.exitCode(ChildProcess.make(ffmpeg, [
|
|
24
|
+
'-hide_banner',
|
|
25
|
+
'-loglevel',
|
|
26
|
+
'error',
|
|
27
|
+
'-nostdin',
|
|
28
|
+
'-i',
|
|
29
|
+
file,
|
|
30
|
+
'-vf',
|
|
31
|
+
`scale=${STILL_WIDTH}:-2`,
|
|
32
|
+
'-r',
|
|
33
|
+
String(STILL_FPS),
|
|
34
|
+
'-pix_fmt',
|
|
35
|
+
'gray',
|
|
36
|
+
'-f',
|
|
37
|
+
'image2',
|
|
38
|
+
path.join(dir, 'f%06d.png'),
|
|
39
|
+
], { stdin: 'ignore', stdout: 'ignore', stderr: 'ignore' }));
|
|
40
|
+
if (code !== 0)
|
|
41
|
+
return undefined;
|
|
42
|
+
const names = (yield* fs.readDirectory(dir)).filter((n) => n.endsWith('.png')).toSorted();
|
|
43
|
+
const frames = [];
|
|
44
|
+
for (const name of names) {
|
|
45
|
+
const image = grayPng(yield* fs.readFile(path.join(dir, name)), inflate);
|
|
46
|
+
if (image === undefined)
|
|
47
|
+
return undefined;
|
|
48
|
+
frames.push(image);
|
|
49
|
+
}
|
|
50
|
+
return frames.length === 0 ? undefined : stillStretches(frames, 1000 / STILL_FPS);
|
|
51
|
+
})).pipe(Effect.timeout(STILL_TIMEOUT), Effect.orElseSucceed(() => undefined));
|
package/dist/build-info.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "2026-11-
|
|
3
|
-
"builtAt": "2026-11-
|
|
4
|
-
"commit": "
|
|
2
|
+
"id": "2026-11-18T08:05:09.559Z-50a8fd73",
|
|
3
|
+
"builtAt": "2026-11-18T08:05:09.559Z",
|
|
4
|
+
"commit": "70dceb4f143198bbc0cd7186dde36323422809db"
|
|
5
5
|
}
|
package/dist/cli/app.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare const appLayer: (projectRoot: string) => Layer.Layer<Operations |
|
|
|
18
18
|
* What the detached report server (`serveDetached`) shares runs with: the engine of the project whose
|
|
19
19
|
* folder is `projectRoot`.
|
|
20
20
|
*/
|
|
21
|
-
export declare const detachedShareLayer: (projectRoot: string) => Layer.Layer<ShareSource, never, import("effect/FileSystem").FileSystem | Path.Path>;
|
|
21
|
+
export declare const detachedShareLayer: (projectRoot: string) => Layer.Layer<ShareSource, never, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/FileSystem").FileSystem | Path.Path>;
|
|
22
22
|
/**
|
|
23
23
|
* Runs the CLI and resolves to the process exit code. A due update check started with it gets
|
|
24
24
|
* the rest of its time after the command has written everything; it never changes the code.
|
package/dist/cli/commands.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Console, Data, Duration, Effect, Option, Path } from 'effect';
|
|
1
|
+
import { Console, Data, Duration, Effect, Option, Path, Schema } from 'effect';
|
|
2
2
|
import { Argument, Command, Flag } from 'effect/cli';
|
|
3
|
-
import { judgedLedger, summaryOf, } from '../schema/index.js';
|
|
3
|
+
import { Findings, JobSpec, judgedLedger, summaryOf, } from '../schema/index.js';
|
|
4
4
|
import { renderPrSummary } from '../report/index.js';
|
|
5
5
|
import { readFindingsFile, readSpecFile } from './config.js';
|
|
6
6
|
import { analyticsEnabled, isCi, isNonInteractive } from './environment.js';
|
|
@@ -96,7 +96,7 @@ const caseResults = (ledger) => ledger.cases.map((c) => ({
|
|
|
96
96
|
}));
|
|
97
97
|
const run = Command.make('run', {
|
|
98
98
|
json,
|
|
99
|
-
spec: Flag.String('spec').pipe(Flag.withDescription('JSON file with the job: url,
|
|
99
|
+
spec: Flag.String('spec').pipe(Flag.withDescription('JSON file with the job: {"version":1,"url":"http://localhost:3000","cases":[{"id":"home-loads","title":"Home page loads","steps":[{"action":"goto","url":"/"},{"action":"expectText","text":"Welcome"}]}]}. `screw-bugs schema job` prints its full JSON Schema: every field and step'), Flag.optional),
|
|
100
100
|
url: Flag.String('url').pipe(Flag.withDescription('URL of the app to test (overrides the URL in --spec)'), Flag.optional),
|
|
101
101
|
device: Flag.ChoiceWithValue('device', [
|
|
102
102
|
['desktop', 'desktop'],
|
|
@@ -165,10 +165,15 @@ const oneLine = (text, max = 100) => {
|
|
|
165
165
|
return flat.length <= max ? flat : `${flat.slice(0, max - 1).trimEnd()}…`;
|
|
166
166
|
};
|
|
167
167
|
const status = Command.make('status', { json, jobId: Argument.String('job-id') }, (flags) => handle(flags.json)(Effect.gen(function* () {
|
|
168
|
-
const { ledger, judged, job, runDir, reportPath, walkthroughPath, evidence, evidencePath } = yield* (yield* Operations).runStatus(flags.jobId);
|
|
168
|
+
const { ledger, judged, job, runDir, reportPath, walkthroughPath, livePath, evidence, evidencePath, } = yield* (yield* Operations).runStatus(flags.jobId);
|
|
169
169
|
const { instructions, title } = job.spec;
|
|
170
170
|
const summary = summaryOf(job.spec);
|
|
171
171
|
const links = yield* pageLinks({ reportPath, walkthroughPath });
|
|
172
|
+
// While the run is going: the page to follow it on.
|
|
173
|
+
const live = yield* pageLink(livePath);
|
|
174
|
+
// A queued or running run gives its ledger.json after its folder, as run_status does.
|
|
175
|
+
const going = ledger.state === 'queued' || ledger.state === 'running';
|
|
176
|
+
const ledgerPath = going ? (yield* Path.Path).join(runDir, 'ledger.json') : undefined;
|
|
172
177
|
yield* flags.json
|
|
173
178
|
? printJson({
|
|
174
179
|
ok: true,
|
|
@@ -183,25 +188,29 @@ const status = Command.make('status', { json, jobId: Argument.String('job-id') }
|
|
|
183
188
|
reportPath,
|
|
184
189
|
walkthroughPath,
|
|
185
190
|
...urlFields(links),
|
|
191
|
+
livePath,
|
|
192
|
+
liveUrl: live?.url,
|
|
186
193
|
})
|
|
187
194
|
: Console.log([
|
|
188
195
|
...(title?.trim() ? [`Title: ${oneLine(title)}`] : []),
|
|
189
196
|
`Summary: ${oneLine(summary.text)}`,
|
|
190
197
|
...(instructions?.trim() ? [`Asked: ${oneLine(instructions)}`] : []),
|
|
191
|
-
countsSentence(judged, links.walkthrough?.kind),
|
|
198
|
+
countsSentence(judged, links.walkthrough?.kind, live?.kind),
|
|
192
199
|
...(ledger.error ? [ledger.error] : []),
|
|
193
200
|
...formatEvidence(judged, evidence),
|
|
194
201
|
runDir,
|
|
202
|
+
...(ledgerPath ? [ledgerPath] : []),
|
|
195
203
|
...(evidencePath ? [evidencePath] : []),
|
|
196
204
|
...(links.report ? [links.report.link] : []),
|
|
197
205
|
...(links.walkthrough ? [links.walkthrough.link] : []),
|
|
206
|
+
...(live ? [live.link] : []),
|
|
198
207
|
].join('\n'));
|
|
199
208
|
}))).pipe(Command.withDescription('Show the state and case results of a run'));
|
|
200
209
|
const portFlag = Flag.Int('port').pipe(Flag.withDescription("Port for --serve, which fails if it is taken (default: the project's port in 41000-41999, else a free one)"), Flag.optional);
|
|
201
210
|
/**
|
|
202
|
-
* Serves the run folders on 127.0.0.1 (the project's port, see
|
|
203
|
-
* the URL of `path`, a page in a run folder; runs until Ctrl+C,
|
|
204
|
-
* already serves them. `report --serve` and `walkthrough --serve` share it.
|
|
211
|
+
* Serves the run folders on 127.0.0.1 or `SCREW_BUGS_REPORT_HOST` (the project's port, see
|
|
212
|
+
* `startReportServer`) and prints the URL of `path`, a page in a run folder; runs until Ctrl+C,
|
|
213
|
+
* unless another screw-bugs process already serves them. `report --serve` and `walkthrough --serve` share it.
|
|
205
214
|
*/
|
|
206
215
|
const serve = (path, portOption, asJson,
|
|
207
216
|
/** More `--json` fields, such as `report`'s `cases`. */
|
|
@@ -238,7 +247,7 @@ const report = Command.make('report', {
|
|
|
238
247
|
['html', 'html'],
|
|
239
248
|
['markdown', 'markdown'],
|
|
240
249
|
]).pipe(Flag.withDescription('html prints the path of the report; markdown prints a pull request summary'), Flag.withDefault('html')),
|
|
241
|
-
serve: Flag.Boolean('serve').pipe(Flag.withDescription('Serve the run folders on 127.0.0.1 and print the report URL, for browsers that cannot open files (such as those built into coding tools); runs until Ctrl+C'), Flag.withDefault(false)),
|
|
250
|
+
serve: Flag.Boolean('serve').pipe(Flag.withDescription('Serve the run folders on 127.0.0.1 (or SCREW_BUGS_REPORT_HOST) and print the report URL, for browsers that cannot open files (such as those built into coding tools); runs until Ctrl+C'), Flag.withDefault(false)),
|
|
242
251
|
port: portFlag,
|
|
243
252
|
}, (flags) => handle(flags.json)(Effect.gen(function* () {
|
|
244
253
|
const { path, bundle, walkthroughPath } = yield* (yield* Operations).report(flags.jobId);
|
|
@@ -269,7 +278,7 @@ const report = Command.make('report', {
|
|
|
269
278
|
const walkthrough = Command.make('walkthrough', {
|
|
270
279
|
json,
|
|
271
280
|
jobId: Argument.String('job-id'),
|
|
272
|
-
serve: Flag.Boolean('serve').pipe(Flag.withDescription('Serve the run folders on 127.0.0.1 and print the walkthrough URL, as report --serve does; runs until Ctrl+C'), Flag.withDefault(false)),
|
|
281
|
+
serve: Flag.Boolean('serve').pipe(Flag.withDescription('Serve the run folders on 127.0.0.1 (or SCREW_BUGS_REPORT_HOST) and print the walkthrough URL, as report --serve does; runs until Ctrl+C'), Flag.withDefault(false)),
|
|
273
282
|
port: portFlag,
|
|
274
283
|
}, (flags) => handle(flags.json)(Effect.gen(function* () {
|
|
275
284
|
const { path, reportPath } = yield* (yield* Operations).walkthrough(flags.jobId);
|
|
@@ -303,7 +312,7 @@ const findings = Command.make('findings', { json, jobId: Argument.String('job-id
|
|
|
303
312
|
...(links.walkthrough ? [links.walkthrough.link] : []),
|
|
304
313
|
...result.annotated,
|
|
305
314
|
].join('\n'));
|
|
306
|
-
}))).pipe(Command.withDescription("Submit an agent's write-up of an ended run (a JSON file, or - for standard input); it is checked, saved and shown in the report (exit 6 if it does not fit the run)"));
|
|
315
|
+
}))).pipe(Command.withDescription("Submit an agent's write-up of an ended run (a JSON file, or - for standard input; `screw-bugs schema findings` prints its JSON Schema); it is checked, saved and shown in the report (exit 6 if it does not fit the run)"));
|
|
307
316
|
const init = Command.make('init', {
|
|
308
317
|
json,
|
|
309
318
|
url: Flag.String('url').pipe(Flag.withDescription('Default URL to test (baseUrl), used when run gets no URL'), Flag.optional),
|
|
@@ -488,6 +497,41 @@ const accountRemove = Command.make('remove', { json, label: Argument.String('lab
|
|
|
488
497
|
: Console.log(`Removed test account ${flags.label} and its session.`);
|
|
489
498
|
}))).pipe(Command.withDescription('Remove a test account and its saved session'));
|
|
490
499
|
const accounts = accountsList.pipe(Command.withDescription('List the test accounts runs can start signed in as; sign in to one, or remove one'), Command.withSubcommands([accountSignIn, accountRemove]));
|
|
500
|
+
/**
|
|
501
|
+
* A `--spec` file as `run` reads it: `run` fills in `version` itself, and the URL may come from
|
|
502
|
+
* `--url` or `baseUrl` in screw-bugs.json instead, so neither is required here.
|
|
503
|
+
*/
|
|
504
|
+
const SpecFile = Schema.Struct({
|
|
505
|
+
...JobSpec.fields,
|
|
506
|
+
version: Schema.optionalKey(JobSpec.fields.version),
|
|
507
|
+
url: Schema.optionalKey(JobSpec.fields.url.annotate({
|
|
508
|
+
description: 'http or https URL of the app to test. Optional here when run gets --url, or screw-bugs.json has baseUrl.',
|
|
509
|
+
})),
|
|
510
|
+
});
|
|
511
|
+
/** The JSON files a caller writes for the CLI, by the name `schema` takes. */
|
|
512
|
+
const FILE_SCHEMAS = {
|
|
513
|
+
job: SpecFile.annotate({
|
|
514
|
+
description: 'A job for `screw-bugs run --spec`. Checked when it runs, beyond this schema: case IDs are ' +
|
|
515
|
+
'unique, also ignoring case; url is http or https; upload paths stay inside the project; ' +
|
|
516
|
+
'lengths count UTF-16 code units, as JavaScript does, so an emoji can count as 2. An error ' +
|
|
517
|
+
'names the field to fix.',
|
|
518
|
+
}),
|
|
519
|
+
findings: Findings.annotate({
|
|
520
|
+
description: 'A write-up for `screw-bugs findings`. Checked against the run when it is submitted, beyond ' +
|
|
521
|
+
'this schema: case IDs, screenshot IDs and timecodes must be ones run_status gave; ' +
|
|
522
|
+
'lengths count UTF-16 code units, as JavaScript does, so an emoji can count as 2. An error ' +
|
|
523
|
+
'lists what to fix.',
|
|
524
|
+
}),
|
|
525
|
+
};
|
|
526
|
+
const schema = Command.make('schema', {
|
|
527
|
+
json,
|
|
528
|
+
file: Argument.Literals('job|findings', ['job', 'findings']),
|
|
529
|
+
},
|
|
530
|
+
// Always JSON, on one line (it is long, and read mostly by agents): --json is accepted like
|
|
531
|
+
// every command's, and changes nothing.
|
|
532
|
+
(flags) => Console.log(JSON.stringify(Schema.toStandardJSONSchemaV1(FILE_SCHEMAS[flags.file])['~standard'].jsonSchema.input({
|
|
533
|
+
target: 'draft-2020-12',
|
|
534
|
+
})))).pipe(Command.withDescription('Print the JSON Schema of a file you write: job (for run --spec) or findings (for findings)'));
|
|
491
535
|
const mcp = Command.make('mcp', {}, () => serveMcp).pipe(Command.withDescription('Serve the screw-bugs MCP server over stdio, for coding agents'));
|
|
492
536
|
const analytics = Command.make('analytics', { json, setting: Argument.String('on|off').pipe(Argument.optional) }, (flags) => handle(flags.json)(Effect.gen(function* () {
|
|
493
537
|
if (Option.isSome(flags.setting))
|
|
@@ -509,7 +553,8 @@ export const root = Command.make('screw-bugs').pipe(Command.withDescription('Loc
|
|
|
509
553
|
report,
|
|
510
554
|
walkthrough,
|
|
511
555
|
findings,
|
|
512
|
-
|
|
556
|
+
schema,
|
|
557
|
+
stub('share', 'Share a report through Screw Bugs Cloud'),
|
|
513
558
|
runs,
|
|
514
559
|
analytics,
|
|
515
560
|
]));
|
package/dist/cli/mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/server';
|
|
2
|
-
import { Effect, Path } from 'effect';
|
|
2
|
+
import { Duration, Effect, Path } from 'effect';
|
|
3
3
|
import { type CaseLedger, type DoctorReport, type EvidencePack, type JudgedLedger } from '../schema/index.js';
|
|
4
4
|
import { type FindingsResult, Operations } from './operations.js';
|
|
5
5
|
import { PackageInfo } from './package-info.js';
|
|
@@ -9,6 +9,8 @@ export type ShownLedger = CaseLedger | JudgedLedger;
|
|
|
9
9
|
/**
|
|
10
10
|
* `Job … is finished: 3 passed, 2 failed (1 by the agent's review), 0 blocked, 0 not verified.`
|
|
11
11
|
* The counts are the statuses results show: a case the agent's findings mark failed is failed.
|
|
12
|
+
* A running job also says where it is (`progressText`): `Job … is running case 2 of 3
|
|
13
|
+
* (reply-maya), step 4 (click): …`.
|
|
12
14
|
*/
|
|
13
15
|
export declare const formatLedger: (ledger: ShownLedger) => string;
|
|
14
16
|
/** A run counts as passed only when it finished and every case passed. */
|
|
@@ -26,18 +28,23 @@ export declare const formatEvidence: (ledger: ShownLedger, pack: EvidencePack) =
|
|
|
26
28
|
export declare const formatNotPassing: (ledger: ShownLedger) => ReadonlyArray<string>;
|
|
27
29
|
/** How a reply gives the walkthrough: its URL, or its path when there is no URL. */
|
|
28
30
|
export type WalkthroughLink = 'url' | 'path';
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The counts sentence, saying where to watch the run: in its walkthrough, when it has one, or
|
|
33
|
+
* while it is going, in its `live.html` (`live`).
|
|
34
|
+
*/
|
|
35
|
+
export declare const countsSentence: (ledger: ShownLedger, walkthrough: WalkthroughLink | undefined, live?: WalkthroughLink) => string;
|
|
31
36
|
/**
|
|
32
37
|
* A status reply: the counts (and where to watch the run, when it has a walkthrough), then the
|
|
33
38
|
* evidence pack (see `formatEvidence`).
|
|
34
39
|
*/
|
|
35
|
-
export declare const formatStatus: (ledger: ShownLedger, pack?: EvidencePack, walkthrough?: WalkthroughLink) => string;
|
|
40
|
+
export declare const formatStatus: (ledger: ShownLedger, pack?: EvidencePack, walkthrough?: WalkthroughLink, live?: WalkthroughLink) => string;
|
|
36
41
|
/**
|
|
37
42
|
* The reply to saved findings: one sentence (naming the walkthrough as the place to watch the run,
|
|
38
43
|
* when the reply gives it), maybe one about highlights, then the paths.
|
|
39
44
|
*/
|
|
40
45
|
export declare const formatFindings: (result: FindingsResult, walkthrough?: WalkthroughLink) => string;
|
|
46
|
+
/** How often `start_run` sends progress while it waits for a sign-in. */
|
|
47
|
+
export declare const SIGN_IN_PROGRESS_INTERVAL: Duration.Duration;
|
|
41
48
|
/** The MCP server: exactly five tools, each a thin call into `Operations`. */
|
|
42
49
|
export declare const makeMcpServer: Effect.Effect<McpServer, never, Operations | PackageInfo | Path.Path>;
|
|
43
50
|
/** Serves MCP over stdio until the client disconnects. Nothing else may write to stdout. */
|