@reticlehq/server 3.9.0 → 3.10.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/SKILL.md +13 -12
- package/dist/command/cli/adhoc-suite.js +2 -0
- package/dist/command/cli/adhoc-verdict.d.ts +2 -43
- package/dist/command/cli/adhoc-verdict.js +50 -187
- package/dist/command/cli/answers/mcp-connection-hint.d.ts +2 -0
- package/dist/command/cli/answers/mcp-connection-hint.js +6 -0
- package/dist/command/cli/cli-doctor.js +1 -1
- package/dist/command/cli/cli-flow-commands.js +2 -9
- package/dist/command/cli/cli-kill.js +1 -1
- package/dist/command/cli/cli-parse-compare.d.ts +22 -0
- package/dist/command/cli/cli-parse-compare.js +75 -0
- package/dist/command/cli/cli-parse-grade.d.ts +36 -0
- package/dist/command/cli/cli-parse-grade.js +75 -0
- package/dist/command/cli/cli-parse-grammar.d.ts +2 -0
- package/dist/command/cli/cli-parse-grammar.js +18 -20
- package/dist/command/cli/cli-parse-verify.d.ts +10 -0
- package/dist/command/cli/cli-parse-verify.js +63 -14
- package/dist/command/cli/cli-parse.d.ts +17 -15
- package/dist/command/cli/cli-parse.js +44 -27
- package/dist/command/cli/cli-update-commands.d.ts +1 -1
- package/dist/command/cli/cli-update-commands.js +29 -20
- package/dist/command/cli/cli-usage.js +58 -29
- package/dist/command/cli/cli-verify.d.ts +11 -2
- package/dist/command/cli/cli-verify.js +27 -8
- package/dist/command/cli/cloud-cli.js +2 -119
- package/dist/command/cli/daemon-link/daemon-client.d.ts +45 -0
- package/dist/command/cli/daemon-link/daemon-client.js +205 -0
- package/dist/command/cli/doctor/doctor-daemon-line.js +6 -3
- package/dist/command/cli/doctor-repairs.js +1 -1
- package/dist/command/cli/ensure-daemon.d.ts +26 -0
- package/dist/command/cli/ensure-daemon.js +57 -0
- package/dist/command/cli/finished-run/grade-command.d.ts +23 -0
- package/dist/command/cli/finished-run/grade-command.js +180 -0
- package/dist/command/cli/lifecycle/daemon-lifecycle.d.ts +1 -1
- package/dist/command/cli/lifecycle/daemon-lifecycle.js +1 -1
- package/dist/command/cli/ports/port-holder.d.ts +9 -0
- package/dist/command/cli/ports/port-holder.js +27 -3
- package/dist/command/cli/status/status-lines.d.ts +1 -0
- package/dist/command/cli/status/status-lines.js +22 -0
- package/dist/command/cli/status-fields.d.ts +5 -1
- package/dist/command/cli/status-fields.js +7 -3
- package/dist/command/cli/two-builds/compare-command.d.ts +48 -0
- package/dist/command/cli/two-builds/compare-command.js +314 -0
- package/dist/command/cli/verify-against.d.ts +61 -0
- package/dist/command/cli/verify-against.js +187 -0
- package/dist/command/cli/verify-no-session.d.ts +2 -0
- package/dist/command/cli/verify-no-session.js +13 -0
- package/dist/command/cli/verify-results.d.ts +35 -2
- package/dist/command/cli/verify-results.js +76 -10
- package/dist/command/cli.js +46 -41
- package/dist/command/daemon/daemon-resolve.d.ts +8 -1
- package/dist/command/daemon/daemon-resolve.js +27 -1
- package/dist/command/daemon/daemon.d.ts +12 -1
- package/dist/command/daemon/daemon.js +35 -4
- package/dist/command/daemon/lifetime/death-cause.js +21 -2
- package/dist/command/daemon/lifetime/heartbeat.js +7 -2
- package/dist/command/daemon/lifetime/startup-failure.d.ts +29 -0
- package/dist/command/daemon/lifetime/startup-failure.js +62 -0
- package/dist/command/setup/bringup/dev-server-files.d.ts +9 -0
- package/dist/command/setup/bringup/dev-server-files.js +17 -0
- package/dist/command/setup/bringup/static-page-server.d.ts +14 -2
- package/dist/command/setup/bringup/static-page-server.js +43 -9
- package/dist/command/setup/init/init-runtime.js +6 -0
- package/dist/command/setup/node-effects.d.ts +3 -2
- package/dist/command/setup/node-effects.js +9 -3
- package/dist/command/setup/remaining-steps.d.ts +8 -0
- package/dist/command/setup/remaining-steps.js +10 -0
- package/dist/command/setup/run-setup.d.ts +2 -0
- package/dist/command/setup/run-setup.js +9 -1
- package/dist/command/setup/setup-command.js +6 -3
- package/dist/command/update/updater.js +6 -0
- package/dist/command/version/version-skew.js +1 -1
- package/dist/features/compare/action-plan.d.ts +260 -0
- package/dist/features/compare/action-plan.js +543 -0
- package/dist/features/compare/behaviour-compare.d.ts +24 -0
- package/dist/features/compare/behaviour-compare.js +85 -0
- package/dist/features/compare/behaviour-diff.d.ts +97 -0
- package/dist/features/compare/behaviour-diff.js +202 -0
- package/dist/features/compare/behaviour-report.d.ts +40 -0
- package/dist/features/compare/behaviour-report.js +128 -0
- package/dist/features/compare/build-readings.d.ts +106 -0
- package/dist/features/compare/build-readings.js +250 -0
- package/dist/features/compare/compare-diff.d.ts +62 -0
- package/dist/features/compare/compare-diff.js +177 -0
- package/dist/features/compare/compare-report-html.d.ts +6 -0
- package/dist/features/compare/compare-report-html.js +102 -0
- package/dist/features/compare/compare-report.d.ts +15 -0
- package/dist/features/compare/compare-report.js +73 -0
- package/dist/features/compare/compare-run.d.ts +60 -0
- package/dist/features/compare/compare-run.js +123 -0
- package/dist/features/compare/outside/effect-lines.d.ts +26 -0
- package/dist/features/compare/outside/effect-lines.js +103 -0
- package/dist/features/compare/outside/state-sources.d.ts +76 -0
- package/dist/features/compare/outside/state-sources.js +164 -0
- package/dist/features/compare/outside/value-dictionary.d.ts +51 -0
- package/dist/features/compare/outside/value-dictionary.js +227 -0
- package/dist/features/compare/visible-content.d.ts +20 -0
- package/dist/features/compare/visible-content.js +125 -0
- package/dist/features/crawl/crawl-empty.js +2 -1
- package/dist/features/crawl/crawl-exhaustive.d.ts +55 -0
- package/dist/features/crawl/crawl-exhaustive.js +138 -0
- package/dist/features/crawl/crawl-tools.d.ts +9 -2
- package/dist/features/crawl/crawl-tools.js +28 -12
- package/dist/features/crawl/crawl.d.ts +8 -9
- package/dist/features/crawl/crawl.js +61 -65
- package/dist/features/exhaust/app-coverage.d.ts +5 -1
- package/dist/features/exhaust/app-coverage.js +3 -1
- package/dist/features/exhaust/code-coverage.js +8 -4
- package/dist/features/exhaust/edge-cases.d.ts +133 -0
- package/dist/features/exhaust/edge-cases.js +310 -0
- package/dist/features/exhaust/edges/edge-drive.d.ts +42 -0
- package/dist/features/exhaust/edges/edge-drive.js +364 -0
- package/dist/features/exhaust/edges/edge-run.d.ts +59 -0
- package/dist/features/exhaust/edges/edge-run.js +169 -0
- package/dist/features/exhaust/explorer.d.ts +87 -14
- package/dist/features/exhaust/explorer.js +159 -25
- package/dist/features/exhaust/failure-branches.d.ts +5 -0
- package/dist/features/exhaust/failure-branches.js +29 -11
- package/dist/features/exhaust/invariants.d.ts +112 -0
- package/dist/features/exhaust/invariants.js +188 -0
- package/dist/features/exhaust/ledger.d.ts +68 -0
- package/dist/features/exhaust/ledger.js +121 -13
- package/dist/features/exhaust/session-fold.d.ts +10 -0
- package/dist/features/exhaust/session-fold.js +46 -3
- package/dist/features/exhaust/session-port.d.ts +3 -1
- package/dist/features/exhaust/session-port.js +97 -28
- package/dist/features/grade/grade-answer.d.ts +99 -0
- package/dist/features/grade/grade-answer.js +112 -0
- package/dist/features/grade/grade-noise.d.ts +27 -0
- package/dist/features/grade/grade-noise.js +55 -0
- package/dist/features/grade/grade-renumber.d.ts +12 -0
- package/dist/features/grade/grade-renumber.js +86 -0
- package/dist/features/grade/grade-state.d.ts +50 -0
- package/dist/features/grade/grade-state.js +93 -0
- package/dist/features/grade/grade-suggest.d.ts +33 -0
- package/dist/features/grade/grade-suggest.js +98 -0
- package/dist/features/visual/visual-tools.js +66 -19
- package/dist/index.js +7 -4
- package/dist/judgement/capsule/causal-summary.js +9 -2
- package/dist/judgement/runs/artifact/replay-mapping.d.ts +13 -1
- package/dist/judgement/runs/artifact/replay-mapping.js +1 -1
- package/dist/judgement/runs/reticle-runner.js +16 -2
- package/dist/judgement/runs/runner-port.d.ts +2 -0
- package/dist/judgement/runs/runner-port.js +23 -5
- package/dist/language/flows/affected-tools.d.ts +1 -1
- package/dist/language/flows/affected-tools.js +49 -30
- package/dist/language/flows/change/git-changed.d.ts +2 -1
- package/dist/language/flows/change/git-changed.js +19 -2
- package/dist/language/flows/fields/flow-secret-field.d.ts +1 -13
- package/dist/language/flows/fields/flow-secret-field.js +77 -21
- package/dist/language/flows/flow-anchor.d.ts +60 -2
- package/dist/language/flows/flow-anchor.js +125 -20
- package/dist/language/flows/flow-classify.d.ts +20 -0
- package/dist/language/flows/flow-classify.js +90 -12
- package/dist/language/flows/flow-cross-step.d.ts +7 -1
- package/dist/language/flows/flow-cross-step.js +25 -1
- package/dist/language/flows/flow-journey.d.ts +38 -4
- package/dist/language/flows/flow-journey.js +138 -8
- package/dist/language/flows/flow-replay-run.d.ts +0 -16
- package/dist/language/flows/flow-replay-run.js +76 -14
- package/dist/language/flows/flow-replay-types.d.ts +4 -2
- package/dist/language/flows/flow-replay.d.ts +19 -1
- package/dist/language/flows/flow-replay.js +169 -52
- package/dist/language/flows/flow-replayable.js +7 -1
- package/dist/language/flows/flow-start-path.d.ts +34 -5
- package/dist/language/flows/flow-start-path.js +202 -15
- package/dist/language/flows/flow-step-runners.d.ts +14 -13
- package/dist/language/flows/flow-step-runners.js +184 -109
- package/dist/language/flows/flow-store-for-session.d.ts +26 -25
- package/dist/language/flows/flow-store-for-session.js +44 -0
- package/dist/language/flows/flow-tools.js +46 -33
- package/dist/language/flows/flows.js +176 -76
- package/dist/language/flows/recording/tape/recordings.d.ts +19 -3
- package/dist/language/flows/recording/tape/recordings.js +71 -5
- package/dist/language/flows/replay.d.ts +19 -5
- package/dist/language/flows/replay.js +99 -7
- package/dist/language/flows/steps/page-steps.d.ts +68 -0
- package/dist/language/flows/steps/page-steps.js +198 -0
- package/dist/language/flows/suite/sequential-run.d.ts +68 -0
- package/dist/language/flows/suite/sequential-run.js +96 -0
- package/dist/language/flows/verify-change-tools.js +26 -15
- package/dist/memory/cloud/background-sync.d.ts +13 -0
- package/dist/memory/cloud/background-sync.js +24 -3
- package/dist/memory/cloud/sync-daemon.js +26 -27
- package/dist/memory/journal/attach-journal.js +2 -1
- package/dist/memory/journal/drive-flow.d.ts +7 -0
- package/dist/memory/journal/drive-flow.js +44 -13
- package/dist/memory/journal/journal-recorder.d.ts +4 -2
- package/dist/memory/journal/session-journal.d.ts +7 -0
- package/dist/memory/journal/session-journal.js +58 -10
- package/dist/memory/project/root-claims.d.ts +9 -0
- package/dist/memory/project/root-claims.js +9 -4
- package/dist/portal/input/download-capture.d.ts +7 -0
- package/dist/portal/input/download-capture.js +92 -0
- package/dist/portal/input/network-detail.d.ts +6 -0
- package/dist/portal/input/network-detail.js +12 -1
- package/dist/portal/input/network-mock-tools.js +49 -13
- package/dist/portal/input/network-mock.d.ts +8 -0
- package/dist/portal/input/network-mock.js +28 -9
- package/dist/portal/input/page-capture.d.ts +24 -0
- package/dist/portal/input/page-capture.js +33 -0
- package/dist/portal/input/real-input.d.ts +22 -20
- package/dist/portal/input/real-input.js +41 -31
- package/dist/portal/input/viewport-tools.d.ts +8 -0
- package/dist/portal/input/viewport-tools.js +75 -18
- package/dist/portal/pool/browser-pool.d.ts +11 -29
- package/dist/portal/pool/browser-pool.js +35 -17
- package/dist/portal/pool/context-permissions.d.ts +17 -3
- package/dist/portal/pool/context-permissions.js +36 -5
- package/dist/portal/pool/determinism.d.ts +52 -0
- package/dist/portal/pool/determinism.js +259 -0
- package/dist/portal/pool/lease-emulation.d.ts +34 -1
- package/dist/portal/pool/lease-emulation.js +18 -0
- package/dist/portal/pool/lease-marker-stamp.d.ts +6 -0
- package/dist/portal/pool/lease-marker-stamp.js +15 -1
- package/dist/portal/pool/lease-page-error.d.ts +44 -17
- package/dist/portal/pool/lease-page-error.js +147 -5
- package/dist/portal/pool/page-error-journal.d.ts +7 -1
- package/dist/portal/pool/page-error-journal.js +27 -0
- package/dist/portal/pool/playwright-launcher.js +51 -8
- package/dist/portal/pool/pool-contract.d.ts +27 -1
- package/dist/portal/pool/pool-lease.d.ts +36 -1
- package/dist/portal/pool/zero-install.d.ts +8 -0
- package/dist/portal/pool/zero-install.js +23 -1
- package/dist/portal/session/dev-server/dev-command.d.ts +7 -6
- package/dist/portal/session/dev-server/dev-command.js +61 -15
- package/dist/portal/session/dev-server/dev-server-probe.d.ts +7 -0
- package/dist/portal/session/dev-server/dev-server-probe.js +9 -0
- package/dist/portal/session/dev-server/project-ports.d.ts +21 -0
- package/dist/portal/session/dev-server/project-ports.js +62 -0
- package/dist/portal/session/facts/departed-network.d.ts +66 -0
- package/dist/portal/session/facts/departed-network.js +142 -0
- package/dist/portal/session/no-session-diagnosis.d.ts +9 -0
- package/dist/portal/session/no-session-diagnosis.js +67 -25
- package/dist/portal/session/no-session-next-action.d.ts +2 -0
- package/dist/portal/session/no-session-next-action.js +12 -3
- package/dist/portal/session/no-session-watch.d.ts +6 -0
- package/dist/portal/session/no-session-watch.js +38 -3
- package/dist/portal/session/serving-directory.d.ts +10 -0
- package/dist/portal/session/serving-directory.js +39 -8
- package/dist/portal/session/session-manager.d.ts +10 -0
- package/dist/portal/session/session-manager.js +174 -63
- package/dist/start-wiring.d.ts +2 -1
- package/dist/start-wiring.js +2 -1
- package/dist/surface/mcp/mcp.js +3 -2
- package/dist/surface/mcp/shared-params.d.ts +2 -0
- package/dist/surface/mcp/shared-params.js +31 -0
- package/dist/surface/tools/act/act-observation.d.ts +40 -2
- package/dist/surface/tools/act/act-observation.js +118 -12
- package/dist/surface/tools/act/act-preflight.js +1 -1
- package/dist/surface/tools/act/act-sequence-retry.d.ts +23 -2
- package/dist/surface/tools/act/act-sequence-retry.js +61 -5
- package/dist/surface/tools/act/after-match.d.ts +4 -1
- package/dist/surface/tools/act/after-match.js +8 -1
- package/dist/surface/tools/act/already-true.js +1 -1
- package/dist/surface/tools/act/navigation/reload-result.d.ts +12 -1
- package/dist/surface/tools/act/navigation/reload-result.js +25 -2
- package/dist/surface/tools/act/resolve-target.d.ts +15 -1
- package/dist/surface/tools/act/resolve-target.js +24 -1
- package/dist/surface/tools/act/sequence-grade.d.ts +12 -0
- package/dist/surface/tools/act/sequence-grade.js +37 -26
- package/dist/surface/tools/act/settle-in-flight.js +27 -15
- package/dist/surface/tools/act-command.d.ts +23 -0
- package/dist/surface/tools/act-command.js +50 -0
- package/dist/surface/tools/act-sequence-tool.js +78 -50
- package/dist/surface/tools/act-tools.d.ts +1 -13
- package/dist/surface/tools/act-tools.js +74 -86
- package/dist/surface/tools/agent/build-staleness.d.ts +1 -1
- package/dist/surface/tools/agent/build-staleness.js +1 -1
- package/dist/surface/tools/assert/assert-verdict.js +16 -37
- package/dist/surface/tools/browser-tools.js +12 -6
- package/dist/surface/tools/compare-tools.d.ts +11 -0
- package/dist/surface/tools/compare-tools.js +94 -0
- package/dist/surface/tools/coverage-tools.js +1 -1
- package/dist/surface/tools/dynamic-tools.js +9 -2
- package/dist/surface/tools/error-recovery.d.ts +12 -1
- package/dist/surface/tools/error-recovery.js +91 -21
- package/dist/surface/tools/explore-tools.js +1 -1
- package/dist/surface/tools/invoke-tool.js +3 -2
- package/dist/surface/tools/lease-coverage-tools.d.ts +49 -0
- package/dist/surface/tools/lease-coverage-tools.js +128 -0
- package/dist/surface/tools/lease-hint.d.ts +35 -1
- package/dist/surface/tools/lease-hint.js +42 -0
- package/dist/surface/tools/lease-readiness.d.ts +26 -0
- package/dist/surface/tools/lease-readiness.js +79 -0
- package/dist/surface/tools/lease-seed.d.ts +14 -1
- package/dist/surface/tools/lease-seed.js +35 -3
- package/dist/surface/tools/lease-tools.d.ts +3 -41
- package/dist/surface/tools/lease-tools.js +62 -110
- package/dist/surface/tools/lease-url-identity.d.ts +46 -0
- package/dist/surface/tools/lease-url-identity.js +97 -0
- package/dist/surface/tools/merge-tools.js +99 -2
- package/dist/surface/tools/merged-name-redirect.js +5 -1
- package/dist/surface/tools/observe-tools.js +15 -9
- package/dist/surface/tools/read/console-pre-attach.d.ts +19 -0
- package/dist/surface/tools/read/console-pre-attach.js +23 -0
- package/dist/surface/tools/read-tools.js +33 -30
- package/dist/surface/tools/real-input-attempt.d.ts +0 -8
- package/dist/surface/tools/real-input-attempt.js +143 -28
- package/dist/surface/tools/session-ports.d.ts +14 -0
- package/dist/surface/tools/session-ports.js +53 -0
- package/dist/surface/tools/tool-kit.d.ts +6 -0
- package/dist/surface/tools/tool-kit.js +2 -3
- package/dist/surface/tools/tool-surface.js +0 -1
- package/dist/surface/tools/tools.js +28 -5
- package/dist/surface/tools/type-spelling.d.ts +13 -0
- package/dist/surface/tools/type-spelling.js +36 -0
- package/dist/telemetry/agent-client.d.ts +6 -0
- package/dist/telemetry/agent-client.js +10 -0
- package/dist/telemetry/argument-shape.js +1 -0
- package/dist/telemetry/tool-refused.d.ts +6 -3
- package/dist/telemetry/tool-refused.js +8 -3
- package/docs/actions.mdx +3 -3
- package/docs/agent-cheatsheet.md +1 -1
- package/docs/capabilities.mdx +61 -1
- package/docs/cli/affected.mdx +9 -7
- package/docs/cli/cloud.mdx +3 -3
- package/docs/cli/compare.mdx +94 -0
- package/docs/cli/doctor.mdx +1 -1
- package/docs/cli/grade.mdx +97 -0
- package/docs/cli/license.mdx +9 -7
- package/docs/cli/restart.mdx +7 -5
- package/docs/cli/rollback.mdx +5 -5
- package/docs/cli/stop.mdx +3 -3
- package/docs/cli/update.mdx +2 -2
- package/docs/cli/verify.mdx +23 -1
- package/docs/cli.mdx +33 -23
- package/docs/deploy-checks.md +1 -1
- package/docs/desktop.mdx +1 -1
- package/docs/enterprise.md +2 -2
- package/docs/environment.mdx +1 -1
- package/docs/flows.md +11 -1
- package/docs/frameworks.mdx +9 -9
- package/docs/getting-started.md +1 -1
- package/docs/install-manual.mdx +1 -1
- package/docs/license-activation.mdx +3 -3
- package/docs/packages/tauri.mdx +1 -1
- package/docs/packages.mdx +1 -1
- package/docs/predicates.mdx +1 -1
- package/docs/quickstart.mdx +68 -49
- package/docs/skill-setup.md +1 -1
- package/docs/skill.md +14 -13
- package/docs/telemetry.md +2 -2
- package/docs/tools/navigate.mdx +1 -1
- package/docs/tools/verify.mdx +4 -1
- package/docs/troubleshooting.mdx +1 -1
- package/docs/usage.md +17 -14
- package/package.json +13 -13
- package/dist/features/exhaust/exhaust-run.d.ts +0 -33
- package/dist/features/exhaust/exhaust-run.js +0 -82
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { execFile } from 'node:child_process';
|
|
2
2
|
import { NodePlatform } from '../../machine/platform.js';
|
|
3
|
+
import { PLUGIN_SERVER_DIR } from '../../telemetry/agent-client.js';
|
|
3
4
|
import { existsSync } from 'node:fs';
|
|
4
5
|
import { platform } from 'node:os';
|
|
5
6
|
import { dirname, join } from 'node:path';
|
|
@@ -63,6 +64,11 @@ function detectExecutionKind() {
|
|
|
63
64
|
export function classifyExecutionKind(script) {
|
|
64
65
|
if (script.includes('/_npx/') || script.includes('\\_npx\\'))
|
|
65
66
|
return ExecutionKind.NPX;
|
|
67
|
+
// The Claude Code plugin's copy sits in a `node_modules`, but it is not the project's. It is pinned
|
|
68
|
+
// to the plugin version, so treat it as npx: a restart picks the version, and nothing is installed.
|
|
69
|
+
if (script.includes(`/${PLUGIN_SERVER_DIR}/`) || script.includes(`\\${PLUGIN_SERVER_DIR}\\`)) {
|
|
70
|
+
return ExecutionKind.NPX;
|
|
71
|
+
}
|
|
66
72
|
const globalSignals = [
|
|
67
73
|
'/lib/node_modules/',
|
|
68
74
|
'\\npm\\node_modules\\',
|
|
@@ -61,7 +61,7 @@ function namesWeDoNotKnow(peer, self) {
|
|
|
61
61
|
export const SKEW_CONVERGE = "To put every piece on one version, update the CLI and the app SDK (`reticle update` in the app's " +
|
|
62
62
|
'folder does both), then restart the MCP host.';
|
|
63
63
|
/** The fix for two builds of one version. */
|
|
64
|
-
const SAME_VERSION_FIX = 'Both say the same version, so one of them is an older build of it: run `reticle restart`, then ' +
|
|
64
|
+
const SAME_VERSION_FIX = 'Both say the same version, so one of them is an older build of it: run `reticle serve --restart`, then ' +
|
|
65
65
|
'reload the page so it loads the SDK the dev server serves now.';
|
|
66
66
|
function versionPhrase(peer, self) {
|
|
67
67
|
return peer.version === undefined
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The action plan `reticle compare` drives on each build. Pure: it reads trees and returns steps.
|
|
3
|
+
*
|
|
4
|
+
* The plan is made on the reference, breadth first, with no model and no settings:
|
|
5
|
+
* - the start page, and a wait on the start page;
|
|
6
|
+
* - the start page with each value of each url parameter the app's scripts read
|
|
7
|
+
* (`?scenario=deferred`), up to `MAX_URL_ROOTS`. Each is a start page of its own, with its own
|
|
8
|
+
* wait, and opening it does not count toward the depth;
|
|
9
|
+
* - every single action on every control: click each button, tab, checkbox and option; fill each
|
|
10
|
+
* text field with two values chosen by the shape of its value, one edge value of that shape, and
|
|
11
|
+
* the values the app's scripts compare the field's name with (`value-dictionary.ts`); select each
|
|
12
|
+
* option of a combobox;
|
|
13
|
+
* - a click on each distinct visible text that has no control role (`- text`, `- generic`), up to
|
|
14
|
+
* `MAX_TEXT_PROBES`. A text probe stays in the plan only when it changes the screen on the
|
|
15
|
+
* reference: much of the web is a clickable element with no role;
|
|
16
|
+
* - a press of each common key (`DEFAULT_KEYS`) and of each key the app's scripts compare a key
|
|
17
|
+
* event with or name in a shortcut, up to `MAX_KEYS`, each on the start page. A key goes to the
|
|
18
|
+
* first element of the page and bubbles to the document. Escape again after each sequence that
|
|
19
|
+
* made controls appear: what opened must close;
|
|
20
|
+
* - each request the app makes fails (`FaultKind`), up to `MAX_FAULT_REQUESTS` requests. A request
|
|
21
|
+
* the start page makes on load fails three ways before the page loads. A request an action made
|
|
22
|
+
* fails two ways (server, network), and the action's sequence is done again under the fault.
|
|
23
|
+
* Files the page is built from are not requests the app makes;
|
|
24
|
+
* - each click again, followed by a wait, so behaviour on a timer can show. Also each path of two or
|
|
25
|
+
* more steps that reached a new screen, followed by a wait. The wait stays in the plan only when
|
|
26
|
+
* the reference showed delayed activity there: a call still pending, a page that kept changing
|
|
27
|
+
* while it settled, or a change during the wait;
|
|
28
|
+
* - each single action again under each option of each combobox (a mode, a variant);
|
|
29
|
+
* - after each sequence, one level deeper into the controls its last action made appear (a menu, a
|
|
30
|
+
* dialog): controls that were not on the page before that action;
|
|
31
|
+
* - on a page with two or more fields: fill every field with its own value, then press each button,
|
|
32
|
+
* also a button that is disabled until the fields are filled. When such a press brings new
|
|
33
|
+
* fields (the next step of a form, a dialog), fill those and press again, past the depth limit
|
|
34
|
+
* up to `MAX_CHAIN` steps. A form step and its own buttons (new with its fields, or disabled
|
|
35
|
+
* until they are filled) are planned first, so the cap does not starve them.
|
|
36
|
+
* Only this shows a build that takes the start time for the end time.
|
|
37
|
+
*
|
|
38
|
+
* The plan explores screens, not paths. Many paths reach one screen, and each path costs a load on
|
|
39
|
+
* every build. A path of two or more steps that ends on a screen already reached is kept for at most
|
|
40
|
+
* `MAX_PATHS_PER_SCREEN` paths, and nothing is planned after it. A single action is always kept.
|
|
41
|
+
*
|
|
42
|
+
* A control is targeted by its test id when it has one, else by its role and name. Controls with the
|
|
43
|
+
* same target are numbered in page order, so "fill every field" fills eight fields, not one field
|
|
44
|
+
* eight times. Every sequence starts from a fresh load of the start page.
|
|
45
|
+
*/
|
|
46
|
+
import { type ValueDictionary } from './outside/value-dictionary.js';
|
|
47
|
+
/** A control on the page, by identity. `nth` counts the controls with the same identity before it. */
|
|
48
|
+
export interface Target {
|
|
49
|
+
testid?: string;
|
|
50
|
+
role?: string;
|
|
51
|
+
name?: string;
|
|
52
|
+
/** Visible text with no control role: a text probe, clicked by its text. */
|
|
53
|
+
text?: string;
|
|
54
|
+
nth: number;
|
|
55
|
+
}
|
|
56
|
+
export type PlanStep = {
|
|
57
|
+
action: 'click';
|
|
58
|
+
target: Target;
|
|
59
|
+
} | {
|
|
60
|
+
action: 'fill';
|
|
61
|
+
target: Target;
|
|
62
|
+
value: string;
|
|
63
|
+
} | {
|
|
64
|
+
action: 'select';
|
|
65
|
+
target: Target;
|
|
66
|
+
value: string;
|
|
67
|
+
} | {
|
|
68
|
+
action: 'wait';
|
|
69
|
+
ms: number;
|
|
70
|
+
}
|
|
71
|
+
/** Open the start page with this query, such as `?scenario=deferred`: a start page of its own. */
|
|
72
|
+
| {
|
|
73
|
+
action: 'goto';
|
|
74
|
+
query: string;
|
|
75
|
+
}
|
|
76
|
+
/** Press a key on the first element of the page. It bubbles to the document's key listeners. */
|
|
77
|
+
| {
|
|
78
|
+
action: 'press';
|
|
79
|
+
key: string;
|
|
80
|
+
}
|
|
81
|
+
/** Make one request fail, then load the start page again. The steps after it see the fault. */
|
|
82
|
+
| {
|
|
83
|
+
action: 'fault';
|
|
84
|
+
method: string;
|
|
85
|
+
path: string;
|
|
86
|
+
fault: FaultKind;
|
|
87
|
+
} | {
|
|
88
|
+
action: 'fillall';
|
|
89
|
+
fields: readonly {
|
|
90
|
+
target: Target;
|
|
91
|
+
value: string;
|
|
92
|
+
}[];
|
|
93
|
+
};
|
|
94
|
+
export type Sequence = readonly PlanStep[];
|
|
95
|
+
/**
|
|
96
|
+
* How a request fails. A failed answer is an input too: the error state, the retry button and the
|
|
97
|
+
* empty list exist only when a request fails.
|
|
98
|
+
*/
|
|
99
|
+
export declare const FaultKind: {
|
|
100
|
+
/** The server failed. */
|
|
101
|
+
readonly SERVER: "500";
|
|
102
|
+
/** The network failed. */
|
|
103
|
+
readonly ABORT: "abort";
|
|
104
|
+
/** The server answered with nothing. */
|
|
105
|
+
readonly EMPTY: "empty";
|
|
106
|
+
};
|
|
107
|
+
export type FaultKind = (typeof FaultKind)[keyof typeof FaultKind];
|
|
108
|
+
export declare const ControlKind: {
|
|
109
|
+
readonly CLICK: "click";
|
|
110
|
+
readonly FILL: "fill";
|
|
111
|
+
readonly SELECT: "select";
|
|
112
|
+
};
|
|
113
|
+
export type ControlKind = (typeof ControlKind)[keyof typeof ControlKind];
|
|
114
|
+
export interface PlanControl {
|
|
115
|
+
kind: ControlKind;
|
|
116
|
+
target: Target;
|
|
117
|
+
ref?: string;
|
|
118
|
+
/** The field's value now. Empty for a control that is not a field. */
|
|
119
|
+
value: string;
|
|
120
|
+
/** The option labels of a combobox. */
|
|
121
|
+
options: string[];
|
|
122
|
+
disabled: boolean;
|
|
123
|
+
}
|
|
124
|
+
/** The most sequences in one plan. Each costs one fresh load on every build. */
|
|
125
|
+
export declare const MAX_SEQUENCES = 220;
|
|
126
|
+
/**
|
|
127
|
+
* A form chain goes on past `MAX_DEPTH` up to this many steps: fill every field, press a button, and
|
|
128
|
+
* when the press brought new fields, fill those and press again. A wizard's later steps and a
|
|
129
|
+
* dialog's submit sit there.
|
|
130
|
+
*/
|
|
131
|
+
export declare const MAX_CHAIN = 8;
|
|
132
|
+
/**
|
|
133
|
+
* The most text probes in one plan. Much of the web is a clickable element with no role (an
|
|
134
|
+
* accordion header, a table row), so visible text is clicked too.
|
|
135
|
+
*/
|
|
136
|
+
export declare const MAX_TEXT_PROBES = 40;
|
|
137
|
+
/** The most start pages opened by a url parameter value, in one plan. */
|
|
138
|
+
export declare const MAX_URL_ROOTS = 12;
|
|
139
|
+
/** The most values of one url parameter opened as start pages. */
|
|
140
|
+
export declare const MAX_VALUES_PER_PARAM = 8;
|
|
141
|
+
/**
|
|
142
|
+
* The most paths of two or more steps kept to one screen. A path to a screen already reached is not
|
|
143
|
+
* explored further. A single action is always kept: it is a check on the candidate even when it
|
|
144
|
+
* changes nothing on the reference.
|
|
145
|
+
*/
|
|
146
|
+
export declare const MAX_PATHS_PER_SCREEN = 2;
|
|
147
|
+
/**
|
|
148
|
+
* The keys a person presses on any page: close, confirm, move focus, move in a list. Each is a check
|
|
149
|
+
* also where it changes nothing on the reference: a build that answers to the wrong key shows it.
|
|
150
|
+
*/
|
|
151
|
+
export declare const DEFAULT_KEYS: readonly ["Escape", "Enter", "Tab", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight", "Home", "End"];
|
|
152
|
+
/** The most keys pressed on the start page, common keys first. */
|
|
153
|
+
export declare const MAX_KEYS = 24;
|
|
154
|
+
/** The most requests made to fail, in the order the plan first sees them. */
|
|
155
|
+
export declare const MAX_FAULT_REQUESTS = 8;
|
|
156
|
+
/** The wait after a click: a slideshow advances, a countdown ends, a delivery settles. */
|
|
157
|
+
export declare const WAIT_AFTER_CLICK_MS = 4000;
|
|
158
|
+
/** Long text with markup characters and a non-ASCII mark: a build that breaks only on such input. */
|
|
159
|
+
export declare const EDGE_TEXT: string;
|
|
160
|
+
/** The identity of a target, with its number. */
|
|
161
|
+
export declare const targetKey: (t: Target) => string;
|
|
162
|
+
/** The target as a person reads it: `button "Save"`, `[testid=save]`, `button "Open" #2`. */
|
|
163
|
+
export declare const targetLabel: (t: Target) => string;
|
|
164
|
+
/** The controls of a tree, numbered by page order. Options are kept on their combobox. */
|
|
165
|
+
export declare function planControls(tree: string): PlanControl[];
|
|
166
|
+
/**
|
|
167
|
+
* A click on each distinct visible text that has no control role, in page order, up to
|
|
168
|
+
* `MAX_TEXT_PROBES`. `dropped` counts the texts past the cap.
|
|
169
|
+
*/
|
|
170
|
+
export declare function textProbes(tree: string): {
|
|
171
|
+
steps: PlanStep[];
|
|
172
|
+
dropped: number;
|
|
173
|
+
};
|
|
174
|
+
/** The ref of the first element of the page, where a key press goes. */
|
|
175
|
+
export declare const firstRef: (tree: string) => string | undefined;
|
|
176
|
+
/** The ref of `target` on this tree, or undefined when the tree has no such control. */
|
|
177
|
+
export declare function refFor(tree: string, target: Target): string | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Values for a field, by the shape of its value: two that differ from it and from each other, so a
|
|
180
|
+
* build that mixes up two fields shows a difference, and one edge value of that shape.
|
|
181
|
+
*/
|
|
182
|
+
export declare function valuesFor(value: string): readonly string[];
|
|
183
|
+
/** The single actions on one control. None on a disabled control. */
|
|
184
|
+
export declare function actionsOf(control: PlanControl, dictionary?: ValueDictionary): PlanStep[];
|
|
185
|
+
export declare function stepLabel(step: PlanStep): string;
|
|
186
|
+
/** One key for one sequence, the same on every build. */
|
|
187
|
+
export declare const sequenceKey: (seq: Sequence) => string;
|
|
188
|
+
/** What a probe of one sequence saw. */
|
|
189
|
+
export interface Probe {
|
|
190
|
+
/** The settled tree after the last step. */
|
|
191
|
+
tree: string;
|
|
192
|
+
/** For a sequence that ends in a wait: whether the reference showed delayed activity there. */
|
|
193
|
+
active: boolean;
|
|
194
|
+
/** What the app did since the first action, as effect lines: the requests the plan can fail. */
|
|
195
|
+
effects?: readonly string[];
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* What the plan left out because of a cap, so a caller can see that the plan is not every action.
|
|
199
|
+
* Each count is zero when nothing was left out.
|
|
200
|
+
*/
|
|
201
|
+
export type PlanDropped = {
|
|
202
|
+
/** Sequences not tried, because the plan reached `MAX_SEQUENCES`. */
|
|
203
|
+
sequences: number;
|
|
204
|
+
/** Visible texts not clicked, past `MAX_TEXT_PROBES`. */
|
|
205
|
+
textProbes: number;
|
|
206
|
+
/** Url parameter values not opened, past `MAX_VALUES_PER_PARAM` or `MAX_URL_ROOTS`. */
|
|
207
|
+
urlRoots: number;
|
|
208
|
+
/** Paths of two or more steps to a screen that `MAX_PATHS_PER_SCREEN` paths already reached. */
|
|
209
|
+
sameScreenPaths: number;
|
|
210
|
+
/** Keys not pressed, past `MAX_KEYS`. */
|
|
211
|
+
keys: number;
|
|
212
|
+
/** Requests not made to fail, past `MAX_FAULT_REQUESTS`. */
|
|
213
|
+
faultRequests: number;
|
|
214
|
+
};
|
|
215
|
+
export declare const NOTHING_DROPPED: PlanDropped;
|
|
216
|
+
export interface Plan {
|
|
217
|
+
sequences: Sequence[];
|
|
218
|
+
dropped: PlanDropped;
|
|
219
|
+
}
|
|
220
|
+
/** What the app's scripts tell the plan (`value-dictionary.ts`). Each part can be left out. */
|
|
221
|
+
export interface PlanHints {
|
|
222
|
+
dictionary?: ValueDictionary;
|
|
223
|
+
/** The values each url parameter is compared with. */
|
|
224
|
+
urlParams?: ReadonlyMap<string, readonly string[]>;
|
|
225
|
+
/** The keys the app listens for. */
|
|
226
|
+
keys?: readonly string[];
|
|
227
|
+
/** The effect lines of the start page's load: the requests it makes on load. */
|
|
228
|
+
loadEffects?: readonly string[];
|
|
229
|
+
}
|
|
230
|
+
/** The requests the app made, from effect lines, without the files the page is built from. */
|
|
231
|
+
export declare function requestsIn(lines: readonly string[]): {
|
|
232
|
+
method: string;
|
|
233
|
+
path: string;
|
|
234
|
+
}[];
|
|
235
|
+
/**
|
|
236
|
+
* A start page for each value of each url parameter, up to `MAX_VALUES_PER_PARAM` for one
|
|
237
|
+
* parameter and `MAX_URL_ROOTS` in all. `dropped` counts the values past the caps.
|
|
238
|
+
*/
|
|
239
|
+
export declare function urlRoots(params: ReadonlyMap<string, readonly string[]>): {
|
|
240
|
+
steps: PlanStep[];
|
|
241
|
+
dropped: number;
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* A press of each common key, then of each key the app listens for, up to `MAX_KEYS`. `dropped`
|
|
245
|
+
* counts the keys past the cap.
|
|
246
|
+
*/
|
|
247
|
+
export declare function keyPresses(appKeys: readonly string[]): {
|
|
248
|
+
steps: PlanStep[];
|
|
249
|
+
dropped: number;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Make the plan on the reference. `probe` drives one sequence from a fresh load, or answers
|
|
253
|
+
* undefined when a step could not be done.
|
|
254
|
+
*/
|
|
255
|
+
export declare function buildPlan(startTree: string, probe: (seq: Sequence) => Promise<Probe | undefined>, hints?: PlanHints): Promise<Plan>;
|
|
256
|
+
/**
|
|
257
|
+
* The sequences to drive: those that are not the start of another planned sequence. The page is
|
|
258
|
+
* read after every step of a run, so a run also reads each planned sequence it starts with.
|
|
259
|
+
*/
|
|
260
|
+
export declare function longestRuns(plan: readonly Sequence[]): Sequence[];
|