@jevitate/cli 0.1.0 → 0.3.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/README.md +23 -0
- package/dist/ai-cli.d.ts +31 -11
- package/dist/ai-cli.js +131 -88
- package/dist/ai-cli.js.map +1 -1
- package/dist/author-journey-cli.d.ts +4 -0
- package/dist/author-journey-cli.js +111 -0
- package/dist/author-journey-cli.js.map +1 -0
- package/dist/bin.js +60349 -16477
- package/dist/bin.js.map +1 -1
- package/dist/browser-run-options.d.ts +89 -0
- package/dist/browser-run-options.js +175 -0
- package/dist/browser-run-options.js.map +1 -0
- package/dist/build-info.generated.d.ts +2 -0
- package/dist/build-info.generated.js +10 -0
- package/dist/build-info.generated.js.map +1 -0
- package/dist/campaign-api.d.ts +151 -0
- package/dist/campaign-api.js +446 -0
- package/dist/campaign-api.js.map +1 -0
- package/dist/campaign-cli.d.ts +6 -0
- package/dist/campaign-cli.js +66 -0
- package/dist/campaign-cli.js.map +1 -0
- package/dist/check-api.d.ts +5 -0
- package/dist/check-api.js +234 -0
- package/dist/check-api.js.map +1 -0
- package/dist/check-budget.d.ts +26 -0
- package/dist/check-budget.js +90 -0
- package/dist/check-budget.js.map +1 -0
- package/dist/check-cli.d.ts +31 -0
- package/dist/check-cli.js +109 -0
- package/dist/check-cli.js.map +1 -0
- package/dist/check-execute.d.ts +29 -0
- package/dist/check-execute.js +420 -0
- package/dist/check-execute.js.map +1 -0
- package/dist/check-plan.d.ts +118 -0
- package/dist/check-plan.js +516 -0
- package/dist/check-plan.js.map +1 -0
- package/dist/check-suite.d.ts +184 -0
- package/dist/check-suite.js +540 -0
- package/dist/check-suite.js.map +1 -0
- package/dist/check-types.d.ts +181 -0
- package/dist/check-types.js +35 -0
- package/dist/check-types.js.map +1 -0
- package/dist/cli-args.d.ts +26 -0
- package/dist/cli-args.js +50 -0
- package/dist/cli-args.js.map +1 -0
- package/dist/cli-output.d.ts +106 -0
- package/dist/cli-output.js +563 -0
- package/dist/cli-output.js.map +1 -0
- package/dist/cli-reference.d.ts +3 -0
- package/dist/cli-reference.js +81 -0
- package/dist/cli-reference.js.map +1 -0
- package/dist/cli-refusal.d.ts +12 -0
- package/dist/cli-refusal.js +52 -0
- package/dist/cli-refusal.js.map +1 -0
- package/dist/cli-shared.d.ts +340 -0
- package/dist/cli-shared.js +537 -0
- package/dist/cli-shared.js.map +1 -0
- package/dist/cli-surface.d.ts +33 -0
- package/dist/cli-surface.js +48 -0
- package/dist/cli-surface.js.map +1 -0
- package/dist/conversation-options.d.ts +15 -0
- package/dist/conversation-options.js +10 -0
- package/dist/conversation-options.js.map +1 -0
- package/dist/credentials-file.d.ts +15 -0
- package/dist/credentials-file.js +56 -0
- package/dist/credentials-file.js.map +1 -0
- package/dist/data-dir.d.ts +1 -1
- package/dist/data-dir.js +1 -1
- package/dist/defect-evidence.d.ts +141 -0
- package/dist/defect-evidence.js +505 -0
- package/dist/defect-evidence.js.map +1 -0
- package/dist/demo-aspect-api.d.ts +209 -0
- package/dist/demo-aspect-api.js +398 -0
- package/dist/demo-aspect-api.js.map +1 -0
- package/dist/demo-aspect-cli.d.ts +3 -0
- package/dist/demo-aspect-cli.js +243 -0
- package/dist/demo-aspect-cli.js.map +1 -0
- package/dist/demo-capture.d.ts +142 -0
- package/dist/demo-capture.js +537 -0
- package/dist/demo-capture.js.map +1 -0
- package/dist/engine.d.ts +35 -0
- package/dist/engine.js +25 -0
- package/dist/engine.js.map +1 -0
- package/dist/environments.d.ts +155 -0
- package/dist/environments.js +364 -0
- package/dist/environments.js.map +1 -0
- package/dist/exit-codes.d.ts +46 -0
- package/dist/exit-codes.js +91 -0
- package/dist/exit-codes.js.map +1 -0
- package/dist/explore-adversarial.d.ts +144 -0
- package/dist/explore-adversarial.js +227 -0
- package/dist/explore-adversarial.js.map +1 -0
- package/dist/explore-api.d.ts +7 -187
- package/dist/explore-api.js +7 -301
- package/dist/explore-api.js.map +1 -1
- package/dist/explore-author.d.ts +79 -0
- package/dist/explore-author.js +86 -0
- package/dist/explore-author.js.map +1 -0
- package/dist/explore-cli.d.ts +7 -0
- package/dist/explore-cli.js +1199 -0
- package/dist/explore-cli.js.map +1 -0
- package/dist/explore-coverage.d.ts +173 -0
- package/dist/explore-coverage.js +246 -0
- package/dist/explore-coverage.js.map +1 -0
- package/dist/explore-feature.d.ts +125 -0
- package/dist/explore-feature.js +218 -0
- package/dist/explore-feature.js.map +1 -0
- package/dist/explore-goal.d.ts +271 -0
- package/dist/explore-goal.js +417 -0
- package/dist/explore-goal.js.map +1 -0
- package/dist/explore-shared.d.ts +177 -0
- package/dist/explore-shared.js +149 -0
- package/dist/explore-shared.js.map +1 -0
- package/dist/explore-specs.d.ts +53 -0
- package/dist/explore-specs.js +333 -0
- package/dist/explore-specs.js.map +1 -0
- package/dist/findings-filing.d.ts +64 -0
- package/dist/findings-filing.js +108 -0
- package/dist/findings-filing.js.map +1 -0
- package/dist/fixture-auth.d.ts +63 -0
- package/dist/fixture-auth.js +95 -0
- package/dist/fixture-auth.js.map +1 -0
- package/dist/fixture-cli.d.ts +99 -0
- package/dist/fixture-cli.js +292 -0
- package/dist/fixture-cli.js.map +1 -0
- package/dist/github-issue-filer.d.ts +62 -0
- package/dist/github-issue-filer.js +189 -0
- package/dist/github-issue-filer.js.map +1 -0
- package/dist/host-health-run.d.ts +25 -0
- package/dist/host-health-run.js +33 -0
- package/dist/host-health-run.js.map +1 -0
- package/dist/http-5xx-outcome.d.ts +6 -0
- package/dist/http-5xx-outcome.js +39 -0
- package/dist/http-5xx-outcome.js.map +1 -0
- package/dist/inbox-cli.d.ts +7 -0
- package/dist/inbox-cli.js +197 -0
- package/dist/inbox-cli.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/init-cli.d.ts +4 -0
- package/dist/init-cli.js +156 -0
- package/dist/init-cli.js.map +1 -0
- package/dist/init-keys.d.ts +30 -2
- package/dist/init-keys.js +19 -5
- package/dist/init-keys.js.map +1 -1
- package/dist/init-next-steps.d.ts +35 -0
- package/dist/init-next-steps.js +79 -0
- package/dist/init-next-steps.js.map +1 -0
- package/dist/invariants-file.d.ts +34 -0
- package/dist/invariants-file.js +68 -0
- package/dist/invariants-file.js.map +1 -0
- package/dist/invariants-validate.d.ts +30 -0
- package/dist/invariants-validate.js +105 -0
- package/dist/invariants-validate.js.map +1 -0
- package/dist/journey-annotate-api.d.ts +76 -0
- package/dist/journey-annotate-api.js +269 -0
- package/dist/journey-annotate-api.js.map +1 -0
- package/dist/journey-annotate-cli.d.ts +9 -0
- package/dist/journey-annotate-cli.js +181 -0
- package/dist/journey-annotate-cli.js.map +1 -0
- package/dist/journey-api.d.ts +104 -2
- package/dist/journey-api.js +163 -20
- package/dist/journey-api.js.map +1 -1
- package/dist/journey-cli.d.ts +4 -0
- package/dist/journey-cli.js +411 -0
- package/dist/journey-cli.js.map +1 -0
- package/dist/journey-demo-api.d.ts +114 -0
- package/dist/journey-demo-api.js +405 -0
- package/dist/journey-demo-api.js.map +1 -0
- package/dist/journey-demo-cli.d.ts +10 -0
- package/dist/journey-demo-cli.js +158 -0
- package/dist/journey-demo-cli.js.map +1 -0
- package/dist/journey-prefix.d.ts +194 -0
- package/dist/journey-prefix.js +279 -0
- package/dist/journey-prefix.js.map +1 -0
- package/dist/key-report.d.ts +49 -0
- package/dist/key-report.js +101 -0
- package/dist/key-report.js.map +1 -0
- package/dist/kill-signal.d.ts +193 -0
- package/dist/kill-signal.js +283 -0
- package/dist/kill-signal.js.map +1 -0
- package/dist/launch-armed.d.ts +37 -0
- package/dist/launch-armed.js +31 -0
- package/dist/launch-armed.js.map +1 -0
- package/dist/ledger-api.d.ts +106 -0
- package/dist/ledger-api.js +239 -0
- package/dist/ledger-api.js.map +1 -0
- package/dist/ledger-cli.d.ts +18 -0
- package/dist/ledger-cli.js +107 -0
- package/dist/ledger-cli.js.map +1 -0
- package/dist/load-api.d.ts +29 -11
- package/dist/load-api.js +23 -15
- package/dist/load-api.js.map +1 -1
- package/dist/load-cli.d.ts +4 -0
- package/dist/load-cli.js +97 -0
- package/dist/load-cli.js.map +1 -0
- package/dist/log-correlation.d.ts +200 -0
- package/dist/log-correlation.js +394 -0
- package/dist/log-correlation.js.map +1 -0
- package/dist/log-lines.d.ts +131 -0
- package/dist/log-lines.js +389 -0
- package/dist/log-lines.js.map +1 -0
- package/dist/log-sources.d.ts +71 -0
- package/dist/log-sources.js +236 -0
- package/dist/log-sources.js.map +1 -0
- package/dist/log-trace.d.ts +80 -0
- package/dist/log-trace.js +210 -0
- package/dist/log-trace.js.map +1 -0
- package/dist/logs-cli.d.ts +3 -0
- package/dist/logs-cli.js +51 -0
- package/dist/logs-cli.js.map +1 -0
- package/dist/logs-retention.d.ts +28 -0
- package/dist/logs-retention.js +85 -0
- package/dist/logs-retention.js.map +1 -0
- package/dist/masked-input.d.ts +22 -0
- package/dist/masked-input.js +99 -0
- package/dist/masked-input.js.map +1 -0
- package/dist/mcp-api.d.ts +91 -1
- package/dist/mcp-api.js +514 -18
- package/dist/mcp-api.js.map +1 -1
- package/dist/mcp-args.d.ts +50 -0
- package/dist/mcp-args.js +164 -0
- package/dist/mcp-args.js.map +1 -0
- package/dist/mcp-cli-bridge.d.ts +34 -0
- package/dist/mcp-cli-bridge.js +62 -0
- package/dist/mcp-cli-bridge.js.map +1 -0
- package/dist/mcp-cli-runner.d.ts +29 -0
- package/dist/mcp-cli-runner.js +44 -0
- package/dist/mcp-cli-runner.js.map +1 -0
- package/dist/mcp-cli-tools.d.ts +129 -0
- package/dist/mcp-cli-tools.js +737 -0
- package/dist/mcp-cli-tools.js.map +1 -0
- package/dist/mcp-paths.d.ts +28 -0
- package/dist/mcp-paths.js +76 -0
- package/dist/mcp-paths.js.map +1 -0
- package/dist/mission-actors.d.ts +40 -0
- package/dist/mission-actors.js +72 -0
- package/dist/mission-actors.js.map +1 -0
- package/dist/mission-api.d.ts +35 -0
- package/dist/mission-api.js +60 -3
- package/dist/mission-api.js.map +1 -1
- package/dist/mission-cli.d.ts +4 -0
- package/dist/mission-cli.js +248 -0
- package/dist/mission-cli.js.map +1 -0
- package/dist/mission-exit.d.ts +22 -0
- package/dist/mission-exit.js +26 -0
- package/dist/mission-exit.js.map +1 -0
- package/dist/mission-fixtures.d.ts +234 -0
- package/dist/mission-fixtures.js +862 -0
- package/dist/mission-fixtures.js.map +1 -0
- package/dist/mission-journal.d.ts +60 -0
- package/dist/mission-journal.js +115 -0
- package/dist/mission-journal.js.map +1 -0
- package/dist/mission-queue-cli.d.ts +10 -0
- package/dist/mission-queue-cli.js +198 -0
- package/dist/mission-queue-cli.js.map +1 -0
- package/dist/mission-queue-runner.d.ts +126 -0
- package/dist/mission-queue-runner.js +406 -0
- package/dist/mission-queue-runner.js.map +1 -0
- package/dist/multi-run-cli.d.ts +37 -0
- package/dist/multi-run-cli.js +116 -0
- package/dist/multi-run-cli.js.map +1 -0
- package/dist/multi-run.d.ts +339 -0
- package/dist/multi-run.js +619 -0
- package/dist/multi-run.js.map +1 -0
- package/dist/openrouter-call.d.ts +22 -0
- package/dist/openrouter-call.js +64 -0
- package/dist/openrouter-call.js.map +1 -0
- package/dist/profile-cli.d.ts +4 -0
- package/dist/profile-cli.js +57 -0
- package/dist/profile-cli.js.map +1 -0
- package/dist/program.d.ts +3 -75
- package/dist/program.js +123 -1921
- package/dist/program.js.map +1 -1
- package/dist/project-dir.d.ts +96 -0
- package/dist/project-dir.js +221 -0
- package/dist/project-dir.js.map +1 -0
- package/dist/record-api.d.ts +13 -7
- package/dist/record-api.js +44 -30
- package/dist/record-api.js.map +1 -1
- package/dist/record-cli.d.ts +4 -0
- package/dist/record-cli.js +76 -0
- package/dist/record-cli.js.map +1 -0
- package/dist/recording-cli.d.ts +4 -0
- package/dist/recording-cli.js +248 -0
- package/dist/recording-cli.js.map +1 -0
- package/dist/regression-api.d.ts +107 -0
- package/dist/regression-api.js +387 -6
- package/dist/regression-api.js.map +1 -1
- package/dist/regression-cli.d.ts +4 -0
- package/dist/regression-cli.js +284 -0
- package/dist/regression-cli.js.map +1 -0
- package/dist/report-api.d.ts +146 -0
- package/dist/report-api.js +431 -0
- package/dist/report-api.js.map +1 -0
- package/dist/report-cli.d.ts +12 -0
- package/dist/report-cli.js +147 -0
- package/dist/report-cli.js.map +1 -0
- package/dist/resource-preflight.d.ts +87 -0
- package/dist/resource-preflight.js +160 -0
- package/dist/resource-preflight.js.map +1 -0
- package/dist/result-schema.d.ts +22 -0
- package/dist/result-schema.js +28 -0
- package/dist/result-schema.js.map +1 -0
- package/dist/run-index.d.ts +29 -0
- package/dist/run-index.js +70 -0
- package/dist/run-index.js.map +1 -0
- package/dist/run-key-preflight.d.ts +42 -0
- package/dist/run-key-preflight.js +82 -0
- package/dist/run-key-preflight.js.map +1 -0
- package/dist/run-screenshots.d.ts +123 -0
- package/dist/run-screenshots.js +235 -0
- package/dist/run-screenshots.js.map +1 -0
- package/dist/runtime-env.d.ts +8 -0
- package/dist/runtime-env.js +23 -0
- package/dist/runtime-env.js.map +1 -0
- package/dist/secret-args.d.ts +23 -0
- package/dist/secret-args.js +45 -0
- package/dist/secret-args.js.map +1 -0
- package/dist/serve-cli.d.ts +4 -0
- package/dist/serve-cli.js +95 -0
- package/dist/serve-cli.js.map +1 -0
- package/dist/server-log-verify.d.ts +36 -0
- package/dist/server-log-verify.js +120 -0
- package/dist/server-log-verify.js.map +1 -0
- package/dist/session-check.d.ts +14 -0
- package/dist/session-check.js +44 -0
- package/dist/session-check.js.map +1 -0
- package/dist/site-cli.d.ts +4 -0
- package/dist/site-cli.js +127 -0
- package/dist/site-cli.js.map +1 -0
- package/dist/site-gate-cli.d.ts +28 -0
- package/dist/site-gate-cli.js +59 -0
- package/dist/site-gate-cli.js.map +1 -0
- package/dist/source-api.js +20 -4
- package/dist/source-api.js.map +1 -1
- package/dist/source-cli.d.ts +4 -0
- package/dist/source-cli.js +284 -0
- package/dist/source-cli.js.map +1 -0
- package/dist/source-run-api.d.ts +27 -1
- package/dist/source-run-api.js +22 -11
- package/dist/source-run-api.js.map +1 -1
- package/dist/storage-state-snapshot.d.ts +50 -0
- package/dist/storage-state-snapshot.js +87 -0
- package/dist/storage-state-snapshot.js.map +1 -0
- package/dist/suite-explore-options.d.ts +321 -0
- package/dist/suite-explore-options.js +162 -0
- package/dist/suite-explore-options.js.map +1 -0
- package/dist/target-config.d.ts +115 -0
- package/dist/target-config.js +225 -0
- package/dist/target-config.js.map +1 -0
- package/dist/transcript-file.d.ts +12 -0
- package/dist/transcript-file.js +23 -0
- package/dist/transcript-file.js.map +1 -0
- package/dist/type-fixture-file.d.ts +9 -0
- package/dist/type-fixture-file.js +48 -0
- package/dist/type-fixture-file.js.map +1 -0
- package/dist/ui-api.d.ts +3 -0
- package/dist/ui-api.js +11 -4
- package/dist/ui-api.js.map +1 -1
- package/dist/usability-capture.d.ts +43 -0
- package/dist/usability-capture.js +327 -0
- package/dist/usability-capture.js.map +1 -0
- package/dist/usage-config.d.ts +36 -0
- package/dist/usage-config.js +114 -0
- package/dist/usage-config.js.map +1 -0
- package/dist/ux-api.d.ts +3 -75
- package/dist/ux-api.js +3 -220
- package/dist/ux-api.js.map +1 -1
- package/dist/ux-claim-probe.d.ts +45 -0
- package/dist/ux-claim-probe.js +386 -0
- package/dist/ux-claim-probe.js.map +1 -0
- package/dist/ux-cli.d.ts +4 -0
- package/dist/ux-cli.js +109 -0
- package/dist/ux-cli.js.map +1 -0
- package/dist/ux-config.d.ts +29 -0
- package/dist/ux-config.js +103 -0
- package/dist/ux-config.js.map +1 -0
- package/dist/ux-evidence.d.ts +54 -0
- package/dist/ux-evidence.js +197 -0
- package/dist/ux-evidence.js.map +1 -0
- package/dist/ux-product.d.ts +14 -0
- package/dist/ux-product.js +39 -0
- package/dist/ux-product.js.map +1 -0
- package/dist/ux-review.d.ts +116 -0
- package/dist/ux-review.js +171 -0
- package/dist/ux-review.js.map +1 -0
- package/dist/ux-usability.d.ts +263 -0
- package/dist/ux-usability.js +580 -0
- package/dist/ux-usability.js.map +1 -0
- package/dist/verify-fix-api.d.ts +194 -0
- package/dist/verify-fix-api.js +506 -0
- package/dist/verify-fix-api.js.map +1 -0
- package/dist/verify-fix-cli.d.ts +4 -0
- package/dist/verify-fix-cli.js +115 -0
- package/dist/verify-fix-cli.js.map +1 -0
- package/package.json +23 -18
- package/skills/jevitate-ci-check/SKILL.md +77 -0
- package/skills/jevitate-demo/SKILL.md +61 -0
- package/skills/jevitate-explore/SKILL.md +96 -87
- package/skills/jevitate-getting-started/SKILL.md +89 -0
- package/skills/jevitate-load-test/SKILL.md +11 -2
- package/skills/jevitate-mission-scope/SKILL.md +19 -11
- package/skills/jevitate-record/SKILL.md +23 -5
- package/skills/jevitate-run-journey/SKILL.md +61 -17
- package/skills/jevitate-sources/SKILL.md +57 -14
- package/skills/jevitate-test-campaign/SKILL.md +203 -0
- package/skills/jevitate-ux-review/SKILL.md +106 -16
- package/skills/jevitate-verify-fix/SKILL.md +76 -0
package/dist/ux-api.js
CHANGED
|
@@ -8,224 +8,7 @@
|
|
|
8
8
|
// This is the ONLY place @jevitate/ux meets @jevitate/explore — the dep
|
|
9
9
|
// direction stays ux ⟂ explore (both are consumed here, neither imports the
|
|
10
10
|
// other). Findings are advisory; a UX finding never gates a run.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import { PlaywrightBrowserPort } from "@jevitate/playwright";
|
|
15
|
-
import { CastActor, BrowseTheWeb } from "@jevitate/screenplay";
|
|
16
|
-
import { explore, assertAuthorizedExploreTarget, } from "@jevitate/explore";
|
|
17
|
-
import { UxAnalyzer, a11yChecks, buildReport, loadV1Rubric, } from "@jevitate/ux";
|
|
18
|
-
import { resolveDataDir } from "./data-dir.js";
|
|
19
|
-
const DEFAULT_JUDGMENT_BUDGET = 40;
|
|
20
|
-
function emptyBehavior() {
|
|
21
|
-
return { noProgress: false, backtracks: 0, formReentry: 0, dwellMs: 0, errors: 0 };
|
|
22
|
-
}
|
|
23
|
-
/** explore's live `Control` → ux `Control` (same shape by design; drop `stability`). */
|
|
24
|
-
function toUxControl(c) {
|
|
25
|
-
return {
|
|
26
|
-
index: c.index,
|
|
27
|
-
role: c.role,
|
|
28
|
-
name: c.name,
|
|
29
|
-
tag: c.tag,
|
|
30
|
-
inputType: c.inputType,
|
|
31
|
-
enabled: c.enabled,
|
|
32
|
-
summary: c.summary,
|
|
33
|
-
descriptor: c.descriptor,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
/** a11y facts computable from a live snapshot's controls (honest subset). */
|
|
37
|
-
function a11yFactsFromControls(controls) {
|
|
38
|
-
return {
|
|
39
|
-
controls: controls.map((c) => ({
|
|
40
|
-
controlRef: `control:${c.index}`,
|
|
41
|
-
accessibleName: c.name.trim().length > 0 ? c.name : null,
|
|
42
|
-
focusOrder: c.index,
|
|
43
|
-
targetSize: null,
|
|
44
|
-
contrastRatio: null,
|
|
45
|
-
})),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
/** A live Snapshot (+ extracted page text) → one screen's UxEvidence. */
|
|
49
|
-
export function snapshotToEvidence(snap, visibleText, appContext, job, history) {
|
|
50
|
-
const controls = snap.controls.map(toUxControl);
|
|
51
|
-
return {
|
|
52
|
-
screenId: snap.signature,
|
|
53
|
-
url: snap.url,
|
|
54
|
-
controls,
|
|
55
|
-
visibleText,
|
|
56
|
-
appContext,
|
|
57
|
-
...(job !== undefined ? { job } : {}),
|
|
58
|
-
history,
|
|
59
|
-
behavior: emptyBehavior(),
|
|
60
|
-
a11yFacts: a11yFactsFromControls(controls),
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
function descriptorSummary(d) {
|
|
64
|
-
const parts = [d.role, d.name ?? d.testId ?? d.text].filter((s) => !!s);
|
|
65
|
-
return parts.join(" ") || "control";
|
|
66
|
-
}
|
|
67
|
-
function stepTarget(step) {
|
|
68
|
-
if ("target" in step && step.target)
|
|
69
|
-
return step.target;
|
|
70
|
-
return undefined;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* A saved Recording → per-page UxEvidence. A Recording is deterministic and
|
|
74
|
-
* thin: it carries the CONTROLS the user touched (via each step's descriptor)
|
|
75
|
-
* and the page url, but NOT the full visible text or a11y geometry. So offline
|
|
76
|
-
* analysis is honestly partial — items needing `visibleText`/`a11yFacts` Skip,
|
|
77
|
-
* and coverage reports it. (The live mode carries the rich per-screen snapshot.)
|
|
78
|
-
*/
|
|
79
|
-
export function recordingToEvidence(recording, appContext, job) {
|
|
80
|
-
const screens = [];
|
|
81
|
-
const history = [];
|
|
82
|
-
for (let i = 0; i < recording.pages.length; i++) {
|
|
83
|
-
const page = recording.pages[i];
|
|
84
|
-
const controls = [];
|
|
85
|
-
let idx = 0;
|
|
86
|
-
const seen = new Set();
|
|
87
|
-
for (const rs of page.steps) {
|
|
88
|
-
const d = stepTarget(rs.step);
|
|
89
|
-
if (!d)
|
|
90
|
-
continue;
|
|
91
|
-
const key = JSON.stringify(d);
|
|
92
|
-
if (seen.has(key))
|
|
93
|
-
continue;
|
|
94
|
-
seen.add(key);
|
|
95
|
-
controls.push({
|
|
96
|
-
index: idx++,
|
|
97
|
-
role: d.role ?? "",
|
|
98
|
-
name: d.name ?? d.testId ?? d.text ?? "",
|
|
99
|
-
tag: "",
|
|
100
|
-
inputType: null,
|
|
101
|
-
enabled: true,
|
|
102
|
-
summary: descriptorSummary(d),
|
|
103
|
-
descriptor: d,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
const screenId = `${page.url}#${i}`;
|
|
107
|
-
screens.push({
|
|
108
|
-
screenId,
|
|
109
|
-
url: page.url,
|
|
110
|
-
controls,
|
|
111
|
-
visibleText: "",
|
|
112
|
-
appContext,
|
|
113
|
-
...(job !== undefined ? { job } : {}),
|
|
114
|
-
history: [...history],
|
|
115
|
-
behavior: emptyBehavior(),
|
|
116
|
-
a11yFacts: { controls: [] },
|
|
117
|
-
});
|
|
118
|
-
history.push({ screenId, url: page.url });
|
|
119
|
-
}
|
|
120
|
-
return screens;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Offline UX review. FAIL-FAST: an analyzer `failed` outcome throws
|
|
124
|
-
* `UxAnalysisFailedError` (the CLI maps it to a non-zero fail envelope) — never
|
|
125
|
-
* a fabricated "clean" report.
|
|
126
|
-
*/
|
|
127
|
-
export async function runUxReview(opts) {
|
|
128
|
-
const analyzer = new UxAnalyzer({ judge: opts.judge, a11yChecker: a11yChecks });
|
|
129
|
-
const screens = recordingToEvidence(opts.recording, opts.appContext, opts.appContext.job);
|
|
130
|
-
const outcome = await analyzer.analyze({
|
|
131
|
-
screens,
|
|
132
|
-
rubric: loadV1Rubric(),
|
|
133
|
-
appContext: opts.appContext,
|
|
134
|
-
secrets: opts.secrets,
|
|
135
|
-
judgmentBudget: opts.judgmentBudget ?? DEFAULT_JUDGMENT_BUDGET,
|
|
136
|
-
});
|
|
137
|
-
if (outcome.kind === "failed") {
|
|
138
|
-
throw new UxAnalysisFailedError(outcome.reason, outcome.screenId, outcome.rubricItemId);
|
|
139
|
-
}
|
|
140
|
-
const report = buildReport(outcome);
|
|
141
|
-
const outDir = opts.outDir ?? resolveDataDir(["ux-reports"]);
|
|
142
|
-
await mkdir(outDir, { recursive: true });
|
|
143
|
-
const iso = (opts.nowIso ?? (() => new Date().toISOString()))();
|
|
144
|
-
const reportPath = join(outDir, `ux-${iso.replace(/[:.]/g, "-")}.json`);
|
|
145
|
-
await writeFile(reportPath, `${JSON.stringify(report, null, 2)}\n`, "utf8");
|
|
146
|
-
return { report, reportPath };
|
|
147
|
-
}
|
|
148
|
-
export class UxAnalysisFailedError extends Error {
|
|
149
|
-
screenId;
|
|
150
|
-
rubricItemId;
|
|
151
|
-
code = "E_UX_ANALYSIS";
|
|
152
|
-
constructor(reason, screenId, rubricItemId) {
|
|
153
|
-
super(`UX analysis failed: ${reason}${screenId ? ` (screen ${screenId})` : ""}`);
|
|
154
|
-
this.screenId = screenId;
|
|
155
|
-
this.rubricItemId = rubricItemId;
|
|
156
|
-
this.name = "UxAnalysisFailedError";
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Live usability mission. Guardrail #1 authorizes BEFORE opening a browser.
|
|
161
|
-
* Reuses explore()'s loop (goal = the job) and, via the additive onSnapshot
|
|
162
|
-
* hook, collects one screen's evidence per observation — then analyzes ONCE
|
|
163
|
-
* after the run. A UX finding NEVER gates the loop (the hook's result is
|
|
164
|
-
* ignored by explore). The temp profile dir is always removed.
|
|
165
|
-
*/
|
|
166
|
-
export async function runUsabilityMission(opts) {
|
|
167
|
-
const origin = assertAuthorizedExploreTarget(opts.url, opts.allowlist);
|
|
168
|
-
const portFactory = opts.browserPortFactory ?? (() => new PlaywrightBrowserPort());
|
|
169
|
-
const port = portFactory();
|
|
170
|
-
const profileDir = await mkdtemp(join(tmpdir(), "jevitate-usability-"));
|
|
171
|
-
const session = await port.open({
|
|
172
|
-
profileDir,
|
|
173
|
-
headless: true,
|
|
174
|
-
allowedOrigins: [...opts.allowlist],
|
|
175
|
-
baseUrl: origin,
|
|
176
|
-
});
|
|
177
|
-
const collected = [];
|
|
178
|
-
const history = [];
|
|
179
|
-
const extract = opts.extractText ??
|
|
180
|
-
(async (s) => s.page.evaluate(() => (typeof document !== "undefined" && document.body ? document.body.innerText : "")));
|
|
181
|
-
try {
|
|
182
|
-
const actor = CastActor.named("usability-mission").whoCan(new BrowseTheWeb(session, [...opts.allowlist]));
|
|
183
|
-
const run = await explore({
|
|
184
|
-
actor,
|
|
185
|
-
judge: opts.judge,
|
|
186
|
-
gen: opts.gen,
|
|
187
|
-
goal: opts.job,
|
|
188
|
-
allowlist: opts.allowlist,
|
|
189
|
-
startUrl: opts.url,
|
|
190
|
-
bounds: opts.bounds,
|
|
191
|
-
secrets: opts.secrets,
|
|
192
|
-
site: origin,
|
|
193
|
-
missionContext: "usability review: pursue the stated job as a plausible first-time user, using only what is on screen",
|
|
194
|
-
onSnapshot: async (snap) => {
|
|
195
|
-
let visibleText = "";
|
|
196
|
-
try {
|
|
197
|
-
visibleText = await extract(session);
|
|
198
|
-
}
|
|
199
|
-
catch {
|
|
200
|
-
visibleText = ""; // best-effort; the analyzer Skips visibleText items honestly
|
|
201
|
-
}
|
|
202
|
-
const ev = snapshotToEvidence(snap, visibleText, opts.appContext, opts.job, [...history]);
|
|
203
|
-
collected.push(ev);
|
|
204
|
-
history.push({ screenId: ev.screenId, url: ev.url });
|
|
205
|
-
},
|
|
206
|
-
});
|
|
207
|
-
const analyzer = new UxAnalyzer({ judge: opts.judge, a11yChecker: a11yChecks });
|
|
208
|
-
const outcome = await analyzer.analyze({
|
|
209
|
-
screens: collected,
|
|
210
|
-
rubric: loadV1Rubric(),
|
|
211
|
-
appContext: opts.appContext,
|
|
212
|
-
secrets: opts.secrets,
|
|
213
|
-
judgmentBudget: opts.judgmentBudget ?? DEFAULT_JUDGMENT_BUDGET,
|
|
214
|
-
});
|
|
215
|
-
if (outcome.kind === "failed") {
|
|
216
|
-
throw new UxAnalysisFailedError(outcome.reason, outcome.screenId, outcome.rubricItemId);
|
|
217
|
-
}
|
|
218
|
-
const report = buildReport(outcome);
|
|
219
|
-
const outDir = opts.outDir ?? resolveDataDir(["ux-reports"]);
|
|
220
|
-
await mkdir(outDir, { recursive: true });
|
|
221
|
-
const iso = (opts.nowIso ?? (() => new Date().toISOString()))();
|
|
222
|
-
const reportPath = join(outDir, `usability-${iso.replace(/[:.]/g, "-")}.json`);
|
|
223
|
-
await writeFile(reportPath, `${JSON.stringify(report, null, 2)}\n`, "utf8");
|
|
224
|
-
return { report, reportPath, stop: run.stop, screensObserved: collected.length };
|
|
225
|
-
}
|
|
226
|
-
finally {
|
|
227
|
-
await session.close();
|
|
228
|
-
await rm(profileDir, { recursive: true, force: true });
|
|
229
|
-
}
|
|
230
|
-
}
|
|
11
|
+
export { UsabilityInvariantsUnsupportedError, runUsabilityMission } from "./ux-usability.js";
|
|
12
|
+
export { UxAnalysisFailedError, discoverRecordingSidecars, loadRecordingSidecars, runUxReview } from "./ux-review.js";
|
|
13
|
+
export { captureFromTranscript, extractTypedValues, recordingToEvidence, snapshotToEvidence } from "./ux-evidence.js";
|
|
231
14
|
//# sourceMappingURL=ux-api.js.map
|
package/dist/ux-api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ux-api.js","sourceRoot":"","sources":["../src/ux-api.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,8EAA8E;AAC9E,iEAAiE;AACjE,yEAAyE;AACzE,2EAA2E;AAC3E,+EAA+E;AAC/E,EAAE;AACF,wEAAwE;AACxE,4EAA4E;AAC5E,iEAAiE;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"ux-api.js","sourceRoot":"","sources":["../src/ux-api.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,8EAA8E;AAC9E,iEAAiE;AACjE,yEAAyE;AACzE,2EAA2E;AAC3E,+EAA+E;AAC/E,EAAE;AACF,wEAAwE;AACxE,4EAA4E;AAC5E,iEAAiE;AACjE,OAAO,EAAmE,mCAAmC,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC9J,OAAO,EAAgG,qBAAqB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACpN,OAAO,EAAmC,qBAAqB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Page } from "playwright";
|
|
2
|
+
import { type SafetyConfig } from "@jevitate/explore";
|
|
3
|
+
import { type Control, type GuardProbe, type UxEvidence, type UxFinding } from "@jevitate/ux";
|
|
4
|
+
/** At most this many controls are probed per run; the rest are recorded as not probed (unverifiable). */
|
|
5
|
+
export declare const MAX_GUARD_PROBES = 25;
|
|
6
|
+
/** Why nothing was clicked without the opt-in. */
|
|
7
|
+
export declare const PROBE_OPT_IN_REASON = "not probed: clicking destructive controls is opt-in (--probe-guards)";
|
|
8
|
+
/** The fail-safe destructive-request classifier, shared with the find-out guard (#270): one vocabulary. */
|
|
9
|
+
export declare function looksDestructive(url: string, body?: string | null, method?: string): boolean;
|
|
10
|
+
export interface ProbeTarget {
|
|
11
|
+
readonly screen: UxEvidence;
|
|
12
|
+
readonly control: Control;
|
|
13
|
+
/** Redacted `role "name"`. */
|
|
14
|
+
readonly label: string;
|
|
15
|
+
/** controlKey over the REDACTED role/name (what the claim pipeline matches on). */
|
|
16
|
+
readonly key: string;
|
|
17
|
+
readonly route: string;
|
|
18
|
+
}
|
|
19
|
+
/** The destructive controls to probe (one per route × control) and the ones a `--deny` pattern refuses. */
|
|
20
|
+
export declare function planGuardProbes(screens: readonly UxEvidence[], secrets: readonly string[], safety?: SafetyConfig): {
|
|
21
|
+
readonly targets: ProbeTarget[];
|
|
22
|
+
readonly refused: GuardProbe[];
|
|
23
|
+
};
|
|
24
|
+
/** The opt-out record: every planned target is `skipped` (its guard claim: unverifiable). */
|
|
25
|
+
export declare function skippedProbes(targets: readonly ProbeTarget[]): GuardProbe[];
|
|
26
|
+
/**
|
|
27
|
+
* Probes each target, each on a fresh page in `runPage`'s context (call only with the opt-in).
|
|
28
|
+
* Never throws per target; a target that cannot be probed safely is `refused`/`failed`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function runGuardProbes(runPage: Page, targets: readonly ProbeTarget[], opts: {
|
|
31
|
+
readonly allowlist: readonly string[];
|
|
32
|
+
readonly secrets: readonly string[];
|
|
33
|
+
}): Promise<GuardProbe[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Cropped, masked, boxed screenshots for the verified claim findings (`finding.screenshot`). Best
|
|
36
|
+
* effort per finding: one that cannot be located or masked has none. Fails CLOSED on masking: if
|
|
37
|
+
* the pixel mask cannot be installed or proven, no screenshot is written.
|
|
38
|
+
*/
|
|
39
|
+
export declare function captureFindingShots(page: Page, findings: readonly UxFinding[], screens: ReadonlyMap<string, UxEvidence>, opts: {
|
|
40
|
+
readonly dir: string;
|
|
41
|
+
readonly allowlist: readonly string[];
|
|
42
|
+
readonly secrets: readonly string[];
|
|
43
|
+
}): Promise<UxFinding[]>;
|
|
44
|
+
/** Opens the dedicated probe page in the run's context; closing it deletes its video, if any. */
|
|
45
|
+
export declare function withProbePage<T>(runPage: Page, fn: (page: Page) => Promise<T>): Promise<T>;
|