screw-bugs 0.1.5 → 0.1.7
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 +23 -6
- package/dist/browser-playwright/launch.d.ts +4 -2
- package/dist/browser-playwright/launch.js +8 -1
- 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 +45 -20
- package/dist/cli/mcp.d.ts +13 -7
- package/dist/cli/mcp.js +55 -12
- package/dist/cli/operations.d.ts +12 -2
- package/dist/cli/operations.js +20 -2
- package/dist/cli/share.js +10 -10
- package/dist/core/engine.js +22 -7
- package/dist/core/services.d.ts +6 -1
- package/dist/core/video.d.ts +31 -0
- package/dist/core/video.js +132 -0
- package/dist/report/html.d.ts +1 -1
- package/dist/report/html.js +38 -11
- package/dist/report/menu-bar.js +1 -1
- package/dist/report/player.d.ts +18 -2
- package/dist/report/player.js +54 -5
- package/dist/report/pr-summary.d.ts +1 -1
- package/dist/report/pr-summary.js +13 -4
- package/dist/report/sign-in.d.ts +1 -1
- package/dist/report/sign-in.js +37 -8
- package/dist/report/styles.js +8 -0
- package/dist/report/view.d.ts +25 -5
- package/dist/report/view.js +74 -30
- package/dist/report/walkthrough.d.ts +5 -3
- package/dist/report/walkthrough.js +29 -12
- package/dist/schema/evidence.d.ts +15 -0
- package/dist/schema/evidence.js +8 -0
- package/dist/schema/findings.d.ts +2 -0
- package/dist/schema/findings.js +8 -2
- package/dist/schema/ledger.d.ts +38 -0
- package/dist/schema/ledger.js +24 -0
- package/package.json +1 -1
package/dist/schema/ledger.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
|
+
import { Findings } from './findings.js';
|
|
2
3
|
import { type JobRecord } from './job.js';
|
|
4
|
+
import { CaseStatus } from './status.js';
|
|
3
5
|
/**
|
|
4
6
|
* `run_status` cuts each listed reason to this many characters. A reason with a hint about where
|
|
5
7
|
* else its text or element is (see `withHint` in core) is kept within it, so the hint shows.
|
|
@@ -320,6 +322,10 @@ export declare const CaseLedger: Schema.Struct<{
|
|
|
320
322
|
readonly video: Schema.optionalKey<Schema.String>;
|
|
321
323
|
readonly videoDurationMs: Schema.optionalKey<Schema.Number>;
|
|
322
324
|
readonly videoProblem: Schema.optionalKey<Schema.String>;
|
|
325
|
+
readonly still: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
326
|
+
readonly fromMs: Schema.Number;
|
|
327
|
+
readonly toMs: Schema.Number;
|
|
328
|
+
}>>>;
|
|
323
329
|
}>>>;
|
|
324
330
|
/** The screw-bugs version that ran the job. */
|
|
325
331
|
readonly version: Schema.optionalKey<Schema.String>;
|
|
@@ -839,6 +845,10 @@ export declare const ReportBundle: Schema.Struct<{
|
|
|
839
845
|
readonly video: Schema.optionalKey<Schema.String>;
|
|
840
846
|
readonly videoDurationMs: Schema.optionalKey<Schema.Number>;
|
|
841
847
|
readonly videoProblem: Schema.optionalKey<Schema.String>;
|
|
848
|
+
readonly still: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
849
|
+
readonly fromMs: Schema.Number;
|
|
850
|
+
readonly toMs: Schema.Number;
|
|
851
|
+
}>>>;
|
|
842
852
|
}>>>;
|
|
843
853
|
/** The screw-bugs version that ran the job. */
|
|
844
854
|
readonly version: Schema.optionalKey<Schema.String>;
|
|
@@ -889,6 +899,7 @@ export declare const ReportBundle: Schema.Struct<{
|
|
|
889
899
|
readonly did: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
890
900
|
readonly worked: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
891
901
|
readonly didnt: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
902
|
+
readonly failed: Schema.optionalKey<Schema.String>;
|
|
892
903
|
readonly highlights: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
893
904
|
readonly shot: Schema.NonEmptyString;
|
|
894
905
|
readonly target: Schema.Struct<{
|
|
@@ -1020,3 +1031,30 @@ export declare const findingsRevision: (text: string) => string;
|
|
|
1020
1031
|
* the screw-bugs version building it (`generator`); undefined leaves that out.
|
|
1021
1032
|
*/
|
|
1022
1033
|
export declare const reportBundleOf: (job: JobRecord, ledger: CaseLedger, writeUp?: Pick<ReportBundle, 'findings' | 'marks' | 'annotated' | 'elements' | 'urls'>, version?: string) => ReportBundle;
|
|
1034
|
+
/**
|
|
1035
|
+
* The cases the agent's findings mark failed (`CaseFindings.failed`), by case ID, with what is
|
|
1036
|
+
* wrong. Empty without findings.
|
|
1037
|
+
*/
|
|
1038
|
+
export declare const agentFailures: (findings: Findings | undefined) => ReadonlyMap<string, string>;
|
|
1039
|
+
/** A case as results show it: its status there, and what the run's code decided. */
|
|
1040
|
+
export type JudgedCase = CaseEntry & {
|
|
1041
|
+
/** The status the run's code gave it, as `ledger.json` keeps it. */
|
|
1042
|
+
readonly checkStatus: CaseStatus;
|
|
1043
|
+
/** What is wrong, when the agent's findings mark it failed (then `status` is `failed`). */
|
|
1044
|
+
readonly agentFailed?: string;
|
|
1045
|
+
};
|
|
1046
|
+
/**
|
|
1047
|
+
* A case's status as results show it: `failed` when the agent's findings mark it failed, else the
|
|
1048
|
+
* code's. Findings can only turn a case into a failure, never make one pass.
|
|
1049
|
+
*/
|
|
1050
|
+
export declare const judgedCase: (entry: CaseEntry, failures: ReadonlyMap<string, string>) => JudgedCase;
|
|
1051
|
+
/** A ledger whose cases have their statuses as results show them (see `judgedLedger`). */
|
|
1052
|
+
export type JudgedLedger = Omit<CaseLedger, 'cases'> & {
|
|
1053
|
+
readonly cases: ReadonlyArray<JudgedCase>;
|
|
1054
|
+
};
|
|
1055
|
+
/**
|
|
1056
|
+
* The ledger as everything that shows results reads it (reports, replies, the CLI): each case's
|
|
1057
|
+
* status after the agent's findings (`judgedCase`). `ledger.json` and `evidence.json` keep the
|
|
1058
|
+
* code's statuses.
|
|
1059
|
+
*/
|
|
1060
|
+
export declare const judgedLedger: (ledger: CaseLedger, findings: Findings | undefined) => JudgedLedger;
|
package/dist/schema/ledger.js
CHANGED
|
@@ -223,3 +223,27 @@ export const reportBundleOf = (job, ledger, writeUp = {}, version) => ({
|
|
|
223
223
|
...(ledger.browser !== undefined ? { browser: ledger.browser } : {}),
|
|
224
224
|
files: { ledger: runFiles.ledger, html: runFiles.html, evidenceDir: runFiles.evidenceDir },
|
|
225
225
|
});
|
|
226
|
+
/**
|
|
227
|
+
* The cases the agent's findings mark failed (`CaseFindings.failed`), by case ID, with what is
|
|
228
|
+
* wrong. Empty without findings.
|
|
229
|
+
*/
|
|
230
|
+
export const agentFailures = (findings) => new Map((findings?.cases ?? []).flatMap((c) => c.failed !== undefined && c.failed.trim() !== '' ? [[c.id, c.failed.trim()]] : []));
|
|
231
|
+
/**
|
|
232
|
+
* A case's status as results show it: `failed` when the agent's findings mark it failed, else the
|
|
233
|
+
* code's. Findings can only turn a case into a failure, never make one pass.
|
|
234
|
+
*/
|
|
235
|
+
export const judgedCase = (entry, failures) => {
|
|
236
|
+
const agentFailed = failures.get(entry.id);
|
|
237
|
+
return agentFailed === undefined
|
|
238
|
+
? { ...entry, checkStatus: entry.status }
|
|
239
|
+
: { ...entry, status: 'failed', checkStatus: entry.status, agentFailed };
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* The ledger as everything that shows results reads it (reports, replies, the CLI): each case's
|
|
243
|
+
* status after the agent's findings (`judgedCase`). `ledger.json` and `evidence.json` keep the
|
|
244
|
+
* code's statuses.
|
|
245
|
+
*/
|
|
246
|
+
export const judgedLedger = (ledger, findings) => {
|
|
247
|
+
const failures = agentFailures(findings);
|
|
248
|
+
return { ...ledger, cases: ledger.cases.map((entry) => judgedCase(entry, failures)) };
|
|
249
|
+
};
|