@waitcher/cli 0.2.32 → 0.2.33

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/dist/cli.mjs CHANGED
@@ -54554,6 +54554,7 @@ var EXIT_CODES = Object.freeze({
54554
54554
  ACCOUNT_SUSPENDED: 7,
54555
54555
  CONFLICT: 8,
54556
54556
  MANAGED_BY_CONFIG: 8,
54557
+ RUNTIME_ENDED: 8,
54557
54558
  QUOTA_EXCEEDED: 6,
54558
54559
  RATE_LIMITED: 6,
54559
54560
  DAILY_SCRIPT_BUDGET: 6,
@@ -58611,7 +58612,7 @@ import { performance as performance4 } from "node:perf_hooks";
58611
58612
  // package.json
58612
58613
  var package_default = {
58613
58614
  name: "@waitcher/cli",
58614
- version: "0.2.32",
58615
+ version: "0.2.33",
58615
58616
  description: "Synthetic monitoring from your repository: deploy HTTP, certificate, TCP, DNS, heartbeat, API, browser, visual, MCP server and coding agent checks from waitcher.json, with AI checks and status pages.",
58616
58617
  license: "SEE LICENSE IN LICENSE.txt",
58617
58618
  author: "S\u0142awomir Radzymi\u0144ski",
@@ -60345,6 +60346,11 @@ var entries = {
60345
60346
  meaning: "The project's runtime generation stops being supported on the date in the message. Until then it builds, deploys and runs as before.",
60346
60347
  fix: "Run waitcher runtime upgrade --file PATH_TO_waitcher.json and follow its steps, or hand the prompt in the runtime docs to a coding agent."
60347
60348
  },
60349
+ RUNTIME_ENDED: {
60350
+ title: "Check paused: its runtime ended",
60351
+ meaning: "The check's runtime generation is no longer supported and it did not pass its preview on the newest, so it is paused. Nothing runs or alerts; its history stays.",
60352
+ fix: "For a check in waitcher.json run waitcher runtime upgrade --file PATH_TO_waitcher.json and follow its steps; for a check made in the web app change it until its preview passes, then Move on its page or waitcher runtime move --id ID."
60353
+ },
60348
60354
  SECRET_MISSING: {
60349
60355
  title: "Secret not set for this environment",
60350
60356
  meaning: "A script lists a CHECK_* name in settings.envNames that has no value in the environment.",
@@ -63214,7 +63220,13 @@ async function upgrade(options) {
63214
63220
  generations: summary2.generations,
63215
63221
  project: { file: path2, name: name5, environment: env ?? null, generation: from, installed },
63216
63222
  target: targetId,
63217
- hosted: hosted.map(({ key, environment, generation }) => ({ key, environment, generation }))
63223
+ // paused: the check's runtime ended, so it neither runs nor alerts until a deploy moves it.
63224
+ hosted: hosted.map(({ monitorId, key, environment, generation }) => ({
63225
+ key,
63226
+ environment,
63227
+ generation,
63228
+ paused: (summary2.ended ?? []).some((e) => e.monitorId === monitorId)
63229
+ }))
63218
63230
  };
63219
63231
  const target = RUNTIME_GENERATIONS.find((g) => g.id === targetId);
63220
63232
  if (!target)
@@ -63232,6 +63244,8 @@ async function upgrade(options) {
63232
63244
  stage: "current",
63233
63245
  steps: ["Nothing to do: this project has no api or browser entries, so it pins no runtime."]
63234
63246
  };
63247
+ const paused = base2.hosted.filter((c) => c.paused);
63248
+ const pausedNote = paused.length ? `Paused because their runtime ended: ${paused.map((c) => `${c.key} (${c.generation}, ${c.environment})`).join(", ")}; they run again once deployed on ${targetId}. ` : "";
63235
63249
  if (from !== targetId) {
63236
63250
  const between = summary2.generations.map((g) => g.id).filter((id4) => (from === null || id4 > from) && id4 <= targetId);
63237
63251
  const changes = await findChanges(
@@ -63253,12 +63267,12 @@ async function upgrade(options) {
63253
63267
  previews,
63254
63268
  install,
63255
63269
  steps: yes ? [
63256
- `The project now pins runtime ${targetId}. Change the scripts as changes[] says${failed.length ? `; previews[] shows ${failed.map((p) => p.key).join(", ")} failed on ${targetId}` : ""}.`,
63270
+ `${pausedNote}The project now pins runtime ${targetId}. Change the scripts as changes[] says${failed.length ? `; previews[] shows ${failed.map((p) => p.key).join(", ")} failed on ${targetId}` : ""}.`,
63257
63271
  `waitcher config validate ${flags} --verify runs every script locally on ${targetId}; fix failures and repeat.`,
63258
63272
  "Show the user the diff and commit package.json, package-lock.json and the script changes.",
63259
63273
  `Then run ${again}; it lists the environments to deploy.`
63260
63274
  ] : [
63261
- `Moving this project from runtime ${from ?? "(none installed)"} to ${targetId}. changes[] lists what changed, the lines of this project each may affect (matches) and a fix${previews.length ? `; previews[] shows how each hosted check did when Waitcher ran it on ${targetId}` : ""}.`,
63275
+ `${pausedNote}Moving this project from runtime ${from ?? "(none installed)"} to ${targetId}. changes[] lists what changed, the lines of this project each may affect (matches) and a fix${previews.length ? `; previews[] shows how each hosted check did when Waitcher ran it on ${targetId}` : ""}.`,
63262
63276
  `Show the user install.steps (npm install runs package install scripts${browser ? "; Chromium is downloaded" : ""}). After the user agrees, run ${again} --yes.`
63263
63277
  ]
63264
63278
  };
@@ -63270,7 +63284,7 @@ async function upgrade(options) {
63270
63284
  ...base2,
63271
63285
  stage: "deploy",
63272
63286
  steps: [
63273
- `The project pins runtime ${targetId}; hosted checks still run another generation in ${environments.join(", ")}: ${behind.map((c) => `${c.key} (${c.generation})`).join(", ")}.`,
63287
+ `${pausedNote}The project pins runtime ${targetId}; hosted checks still run another generation in ${environments.join(", ")}: ${behind.map((c) => `${c.key} (${c.generation})`).join(", ")}.`,
63274
63288
  ...environments.map(
63275
63289
  (e) => `waitcher deploy plan --file ${path2} --env ${e} --verify, show the user the plan (changes with field runtime), then waitcher deploy apply --file ${path2} --env ${e} --based-on BASED_ON`
63276
63290
  ),
@@ -63288,7 +63302,7 @@ async function upgrade(options) {
63288
63302
  }
63289
63303
 
63290
63304
  // ../../skills/waitcher/SKILL.md
63291
- var SKILL_default = "---\nname: waitcher\ndescription: Set up and maintain Waitcher monitoring from a repository with the waitcher CLI. Use to turn a product's critical journeys into HTTP, certificate, TCP, DNS, heartbeat, API, browser, visual or MCP monitors in waitcher.json, verify them locally, deploy them through a reviewed plan, and diagnose failures from real evidence.\n---\n\n# Waitcher\n\nYou operate the waitcher CLI for the user. The repository is the source of truth: `waitcher.json` declares the monitors of one project per environment, test files hold the scripts, and `waitcher deploy` reconciles one environment at a time. Commands print JSON on stdout (`run diagnose` and `run scenarios` need `--json` for it); failures print `{error:{code,message}}` on stderr. Read the exit code, every `issues` entry and every `next` step.\n\nThis skill says what to do and in which order. For exact syntax use the installed CLI, never memory: `waitcher help TOPIC` (for example `help deploy`, `help secret`, `help run`) prints only that part of the help for this CLI version, and `waitcher explain CODE` explains an issue or error code. The user guide at https://waitcher.dev/docs/ explains the same product for people; link the user to a page (CLI install and updates, alerts, access tokens, account) instead of retelling it.\n\n## Rules\n\n- Never put secrets in files, arguments or output. Pipe values to `--value-stdin`.\n- Keep new monitors paused. Pass `--activate-new`, `--prune`, `--adopt` or `--smoke` only when the user agreed to that effect.\n- Show the user the plan's `changes` before `deploy apply`, and apply with `--based-on` from that plan.\n- A local pass is not hosted permission. If capabilities or limits refuse something, report it; never switch accounts or workspaces, raise limits or remove assertions to get a green result.\n- Work in the workspace the user chose. `waitcher auth status` names the active one (personal or a team) and your role; ask before `workspace use`, `--workspace` or any `member` command.\n- An agent's own success claim is not evidence. Verify outcomes through the product's state or real run evidence.\n- Do not turn a whole regression suite into monitors. Pick two to five journeys whose failure the user would act on.\n\n## Workflow\n\n1. **Check the setup.** Run `waitcher doctor` in the repository. Fix `error` checks first; its `next` lists exact commands. Without a session, ask the user to run `waitcher auth login` (CI uses a token).\n2. **Understand the product.** Read the repository: base URLs per environment, existing E2E tests, critical journeys, test accounts and jobs. Ask the user which failures should alert them.\n3. **Start the file.** `waitcher config init --project-name NAME --target https://BASE` when there is no `waitcher.json`. Give each monitor a stable lowercase `key`; changing a key later replaces the monitor and its history.\n4. **Choose types.** `http` for status and content, `certificate` for TLS expiry, `tcp` for a database, mail or SSH port, `dns` for records that must keep their values, `heartbeat` for jobs that report in, `api` for a multi-request invariant, `browser` for a user journey, `mcp` when the product ships a remote MCP server. `waitcher monitor init --type TYPE --file x.json` prints a complete example of any type. Script monitors name their test with `entry`; read [authoring](references/authoring.md) before writing one. They need the pinned runtime next to `waitcher.json`: run `waitcher runtime install`, show the user the steps it lists (npm install runs package install scripts; browser projects download Chromium), and after they agree rerun it with `--yes`. It writes exact pins into `package.json`, updates `.gitignore` and is safe to repeat.\n5. **Validate offline.** `waitcher config validate` resolves every environment and builds every entry. Fix each issue at its `path`. Add `--env NAME --verify` (optionally `--key KEY`) to run the api/browser entries locally without an account; read the run directory it names when one fails.\n6. **Plan.** `waitcher deploy plan --env NAME --verify` runs script monitors locally against that environment, then asks the server. Resolve errors (`SECRET_MISSING`: ask the user for the value and run `waitcher secret set`; `ADOPTION_CANDIDATE`: ask whether the existing monitor is the same check).\n7. **Apply.** After the user accepts the plan: `waitcher deploy apply --env NAME --based-on BASED_ON`, where BASED_ON is the plan's `basedOn` or `none` when it is null (first deploy); the plan's `next` prints the exact command. Add `--smoke` for one hosted run per changed monitor. New monitors stay paused.\n8. **Report.** Give the user the monitor IDs, what each checks, local and hosted results, evidence paths and anything still pending (paused schedules, heartbeat credentials, secrets for other environments). If `waitcher alert policy list` shows no routing, failures will alert nobody: point the user to https://waitcher.dev/docs/alerts.\n\n## Runtime upgrades\n\nChecks run on the runtime generation the project pins; nothing moves them but a deploy. When the user asks to upgrade Waitcher or its runtime, doctor names a newer generation, or you see `RUNTIME_VERSION_ENDING` or `RUNTIME_VERSION_MISMATCH`: run `waitcher runtime upgrade` in the repository and repeat it until `stage` is `current` (`--to ID` targets another supported generation). Each call reports one stage with its `steps`; do them in order. In the `upgrade` stage, `changes[]` names what changed, the lines of this project it may affect (`matches`) and a `fix`, and `previews[]` shows how each hosted check did when Waitcher ran it on the target. Before `--yes` (it installs packages and Chromium) show the user `install.steps` and wait for agreement. Then fix the scripts, run `config validate --env NAME --verify`, show the diff for a commit, and in the `deploy` stage plan and apply each environment it lists. Checks made in the web app (no `waitcher.json`) move with `waitcher runtime move --id MONITOR_ID` once their preview passed. Never upgrade unasked: a supported generation is the user's choice.\n\nFor CI, `waitcher ci init` writes a workflow that plans on pull requests and applies on the main branch. Details of secrets, adoption, rollback and CI are in [deploy](references/deploy.md).\n\n## When something fails\n\n- `waitcher --help` prints a short overview of topics; `waitcher help TOPIC` (or `waitcher GROUP --help`) prints one part with the exit codes; `waitcher help all` is long, avoid it.\n- Exit 2: fix the file or input; exit 3: sign in; exit 4: a check failed (inspect evidence); exit 6: quota, rate or queue limit; exit 7: not permitted; exit 8: conflict or managed by `waitcher.json`; exit 9: not found; exit 10: service unavailable.\n- For a failed run, read [diagnosis](references/diagnosis.md): `waitcher run diagnose --id RUN_ID`, then reproduce locally before changing the test.\n- Never retry a write automatically after an uncertain result; read the current state first.\n\n## References\n\n- [authoring](references/authoring.md): choosing a type, writing API and browser tests, local runs and evidence, single-monitor apply.\n- [deploy](references/deploy.md): waitcher.json details, secrets, adoption, rollback, CI.\n- [diagnosis](references/diagnosis.md): run diagnosis and reproduction.\n- [optional capabilities](references/optional-capabilities.md): visual baselines, browser identities, verified HTTP credentials, invocation budgets, agent checks, public status pages, team workspaces.\n- [AI and agents](references/ai-and-agents.md): agent outcome checks, scenario evidence, AI endpoints and suites, calibration, AI steps in scripts, protected requests.\n- Read the last two only when `waitcher system capabilities` reports the feature and the user needs it.\n";
63305
+ var SKILL_default = "---\nname: waitcher\ndescription: Set up and maintain Waitcher monitoring from a repository with the waitcher CLI. Use to turn a product's critical journeys into HTTP, certificate, TCP, DNS, heartbeat, API, browser, visual or MCP monitors in waitcher.json, verify them locally, deploy them through a reviewed plan, and diagnose failures from real evidence.\n---\n\n# Waitcher\n\nYou operate the waitcher CLI for the user. The repository is the source of truth: `waitcher.json` declares the monitors of one project per environment, test files hold the scripts, and `waitcher deploy` reconciles one environment at a time. Commands print JSON on stdout (`run diagnose` and `run scenarios` need `--json` for it); failures print `{error:{code,message}}` on stderr. Read the exit code, every `issues` entry and every `next` step.\n\nThis skill says what to do and in which order. For exact syntax use the installed CLI, never memory: `waitcher help TOPIC` (for example `help deploy`, `help secret`, `help run`) prints only that part of the help for this CLI version, and `waitcher explain CODE` explains an issue or error code. The user guide at https://waitcher.dev/docs/ explains the same product for people; link the user to a page (CLI install and updates, alerts, access tokens, account) instead of retelling it.\n\n## Rules\n\n- Never put secrets in files, arguments or output. Pipe values to `--value-stdin`.\n- Keep new monitors paused. Pass `--activate-new`, `--prune`, `--adopt` or `--smoke` only when the user agreed to that effect.\n- Show the user the plan's `changes` before `deploy apply`, and apply with `--based-on` from that plan.\n- A local pass is not hosted permission. If capabilities or limits refuse something, report it; never switch accounts or workspaces, raise limits or remove assertions to get a green result.\n- Work in the workspace the user chose. `waitcher auth status` names the active one (personal or a team) and your role; ask before `workspace use`, `--workspace` or any `member` command.\n- An agent's own success claim is not evidence. Verify outcomes through the product's state or real run evidence.\n- Do not turn a whole regression suite into monitors. Pick two to five journeys whose failure the user would act on.\n\n## Workflow\n\n1. **Check the setup.** Run `waitcher doctor` in the repository. Fix `error` checks first; its `next` lists exact commands. Without a session, ask the user to run `waitcher auth login` (CI uses a token).\n2. **Understand the product.** Read the repository: base URLs per environment, existing E2E tests, critical journeys, test accounts and jobs. Ask the user which failures should alert them.\n3. **Start the file.** `waitcher config init --project-name NAME --target https://BASE` when there is no `waitcher.json`. Give each monitor a stable lowercase `key`; changing a key later replaces the monitor and its history.\n4. **Choose types.** `http` for status and content, `certificate` for TLS expiry, `tcp` for a database, mail or SSH port, `dns` for records that must keep their values, `heartbeat` for jobs that report in, `api` for a multi-request invariant, `browser` for a user journey, `mcp` when the product ships a remote MCP server. `waitcher monitor init --type TYPE --file x.json` prints a complete example of any type. Script monitors name their test with `entry`; read [authoring](references/authoring.md) before writing one. They need the pinned runtime next to `waitcher.json`: run `waitcher runtime install`, show the user the steps it lists (npm install runs package install scripts; browser projects download Chromium), and after they agree rerun it with `--yes`. It writes exact pins into `package.json`, updates `.gitignore` and is safe to repeat.\n5. **Validate offline.** `waitcher config validate` resolves every environment and builds every entry. Fix each issue at its `path`. Add `--env NAME --verify` (optionally `--key KEY`) to run the api/browser entries locally without an account; read the run directory it names when one fails.\n6. **Plan.** `waitcher deploy plan --env NAME --verify` runs script monitors locally against that environment, then asks the server. Resolve errors (`SECRET_MISSING`: ask the user for the value and run `waitcher secret set`; `ADOPTION_CANDIDATE`: ask whether the existing monitor is the same check).\n7. **Apply.** After the user accepts the plan: `waitcher deploy apply --env NAME --based-on BASED_ON`, where BASED_ON is the plan's `basedOn` or `none` when it is null (first deploy); the plan's `next` prints the exact command. Add `--smoke` for one hosted run per changed monitor. New monitors stay paused.\n8. **Report.** Give the user the monitor IDs, what each checks, local and hosted results, evidence paths and anything still pending (paused schedules, heartbeat credentials, secrets for other environments). If `waitcher alert policy list` shows no routing, failures will alert nobody: point the user to https://waitcher.dev/docs/alerts.\n\n## Runtime upgrades\n\nChecks run on the runtime generation the project pins; nothing moves them but a deploy. When the user asks to upgrade Waitcher or its runtime, doctor names a newer generation, or you see `RUNTIME_VERSION_ENDING` or `RUNTIME_VERSION_MISMATCH`: run `waitcher runtime upgrade` in the repository and repeat it until `stage` is `current` (`--to ID` targets another supported generation). Each call reports one stage with its `steps`; do them in order. In the `upgrade` stage, `changes[]` names what changed, the lines of this project it may affect (`matches`) and a `fix`, and `previews[]` shows how each hosted check did when Waitcher ran it on the target. Before `--yes` (it installs packages and Chromium) show the user `install.steps` and wait for agreement. Then fix the scripts, run `config validate --env NAME --verify`, show the diff for a commit, and in the `deploy` stage plan and apply each environment it lists. Checks made in the web app (no `waitcher.json`) move with `waitcher runtime move --id MONITOR_ID` once their preview passed. After a generation ends its checks that did not pass their preview are paused (`RUNTIME_ENDED`, `hosted[].paused` in the upgrade output) until the project upgrades and deploys. Never upgrade unasked: a supported generation is the user's choice.\n\nFor CI, `waitcher ci init` writes a workflow that plans on pull requests and applies on the main branch. Details of secrets, adoption, rollback and CI are in [deploy](references/deploy.md).\n\n## When something fails\n\n- `waitcher --help` prints a short overview of topics; `waitcher help TOPIC` (or `waitcher GROUP --help`) prints one part with the exit codes; `waitcher help all` is long, avoid it.\n- Exit 2: fix the file or input; exit 3: sign in; exit 4: a check failed (inspect evidence); exit 6: quota, rate or queue limit; exit 7: not permitted; exit 8: conflict or managed by `waitcher.json`; exit 9: not found; exit 10: service unavailable.\n- For a failed run, read [diagnosis](references/diagnosis.md): `waitcher run diagnose --id RUN_ID`, then reproduce locally before changing the test.\n- Never retry a write automatically after an uncertain result; read the current state first.\n\n## References\n\n- [authoring](references/authoring.md): choosing a type, writing API and browser tests, local runs and evidence, single-monitor apply.\n- [deploy](references/deploy.md): waitcher.json details, secrets, adoption, rollback, CI.\n- [diagnosis](references/diagnosis.md): run diagnosis and reproduction.\n- [optional capabilities](references/optional-capabilities.md): visual baselines, browser identities, verified HTTP credentials, invocation budgets, agent checks, public status pages, team workspaces.\n- [AI and agents](references/ai-and-agents.md): agent outcome checks, scenario evidence, AI endpoints and suites, calibration, AI steps in scripts, protected requests.\n- Read the last two only when `waitcher system capabilities` reports the feature and the user needs it.\n";
63292
63306
 
63293
63307
  // ../../skills/waitcher/references/authoring.md
63294
63308
  var authoring_default = '# Authoring and running monitors\n\nRead when writing or changing a test, choosing a monitor type, or running it locally. For exact syntax run `waitcher help monitor` or `waitcher help run`. AI endpoints, agent outcome checks and model steps are in [ai-and-agents](ai-and-agents.md).\n\n## Choose the type\n\n- `http`: status, body text, a JSON value or latency of one request. No script.\n- `certificate`: TLS expiry and chain. No script.\n- `heartbeat`: a job reports start and success; Waitcher alerts when it does not.\n- `tcp`: a public `HOST:PORT` accepts connections (database, mail, SSH); optional `tcp.banner` the server must send first. No script.\n- `dns`: a name\'s `A`, `AAAA`, `CNAME`, `MX` or `TXT` records hold `dns.expected` (`match`: `includes` or `exact`), asked of public resolvers. In `waitcher.json` a `dns` entry without `target` checks the `baseUrl` host. Details: https://waitcher.dev/docs/network.md.\n- `mcp`: a remote MCP server (Streamable HTTP). Lists tools and checks `mcp.expectTools`; an optional `mcp.toolCall` calls one side-effect-free tool with fixed arguments and JSON-pointer `assertions` on its result. No script. `run local --file mcp.json` runs it without an account; its `mcp-report.json` lists the tool names and `mcp-tool-result.json` holds the called tool\'s answer, so read both before writing `expectTools` and assertions. Personal tool calls need verified `httpAuth` and a 30-minute interval; listing tools needs neither. Never pick a tool that writes data. Details: https://waitcher.dev/docs/mcp.md.\n- `api`: a script with several requests and an invariant between them.\n- `browser`: a script that walks a user journey in Chromium.\n- `visual`: a screenshot of one public page or element compared with a baseline the user approved. No script; see [optional capabilities](optional-capabilities.md#optional-visual-checks).\n\n`waitcher monitor init --type TYPE --file x.json` writes a paused example of every type; `api` and `browser` also write `x.e2e.ts`. Keep scripts focused on the requested behavior and use controlled test identities for actions that change state.\n\n## Scripts in waitcher.json\n\nIn a repository, a script monitor is an entry with `entry` pointing at its test file; one test serves every environment because it reads the base URL at run time.\n\n```json\n{ "key": "checkout", "type": "browser", "entry": "monitoring/checkout.e2e.ts", "timeout": 45 }\n```\n\nRun the entries of one environment locally, without an account:\n\n```sh\nwaitcher config validate --env production --verify\nwaitcher config validate --env production --verify --key checkout\n```\n\nExit 4 with `VERIFY_FAILED` names the failing assertion and the run directory to read. `run local --file` takes a single monitor manifest, not `waitcher.json`.\n\n## Browser journey\n\n```ts\nimport { test } from "@e2e-dev/web";\nimport { expect } from "e2e";\n\ntest("visitor can start a game", async ({ app, browser, screen }) => {\n await app.open("/games/klondike/");\n await expect(browser.locator("main h1")).toContainText("Solitaire");\n await expect(screen.getByRole("button", "New game")).toBeVisible();\n await app.screenshot("game");\n});\n```\n\n- `app.open(path)` resolves against the environment\'s base URL. Browser base URLs have no query or fragment; navigate to those URLs inside the script.\n- Find elements the way a visitor does with the `screen` fixture: `screen.getByRole("button", "New game")`, `screen.getByLabel("Email")`, `screen.getByText("Welcome")`, `screen.getByPlaceholder(...)`, `screen.getByTestId(...)`. Prefer these over CSS selectors.\n- The `browser` fixture navigates and offers CSS `browser.locator("main h1")` plus `expect(browser).toHaveURL(...)`; it has no `getBy*` methods.\n- Assertions come from `e2e`: `toBeVisible()`, `toContainText(...)`, `toHaveText(...)`.\n\n## API script\n\n```ts\nimport { test, expect } from "e2e";\n\ntest("orders API keeps totals consistent", async () => {\n const target = new URL(process.env.TARGET_URL!);\n const response = await fetch(new URL("/api/orders?limit=1", target));\n expect(response.status).toBe(200);\n});\n```\n\nAPI scripts import `test, expect` from `e2e` and read `process.env.TARGET_URL`. Secrets reach them only as `CHECK_*` names listed in `settings.envNames` (see [deploy](deploy.md)). The test runs as trusted local code, not in a sandbox.\n\n## Standalone manifest\n\nWithout `waitcher.json`, a monitor is one JSON file. `monitor init --type browser --file monitor.json` writes it with `scriptFile` next to the test:\n\n```json\n{\n "schemaVersion": 1,\n "name": "Product / key journey",\n "type": "browser",\n "target": "https://example.com/",\n "enabled": false,\n "interval": 1800,\n "timeout": 30,\n "scriptFile": "journey.e2e.ts"\n}\n```\n\n`scriptFile` resolves relative to the manifest; `monitor validate --file monitor.json` checks the actual contract. The platform receives one script per monitor, not the project directory. When the test imports shared helpers, run `monitor build --file monitors/checkout.json --project . --output build/checkout`: it needs installed `esbuild`, bundles code and JSON helpers, keeps only supported framework and Node imports, and writes `monitor.js`, `monitor.json` and `build.json` into a new directory. Unsupported dependencies and module-relative file access fail the build. Verify and apply the built `monitor.json`. The script limit is 50,000 characters and hosted dependencies are fixed.\n\n## Run locally and inspect evidence\n\nThe runtime project needs `e2e` and, for browser tests, `@e2e-dev/web` and Chromium, at the exact versions `waitcher runtime install` prints. `waitcher runtime install --file DIR/waitcher.json [--browser]` lists the npm install and Chromium download; run it with `--yes` once the user agrees. Chromium goes to the Playwright browser cache (`PLAYWRIGHT_BROWSERS_PATH` when set), not the runtime directory.\n\n```sh\nwaitcher run local --file monitor.json --runtime /path/to/runtime\nwaitcher run local --file monitor.json --runtime /path/to/runtime --video\nwaitcher run local --project /path/to/e2e-project --timeout 60\n```\n\n- `--project` runs an existing E2E project with its own config and imports; its `--output` must stay inside that project.\n- Runs are serial, never retried or replayed, and get a fresh directory under `.waitcher/runs/` (`--output DIR` chooses the parent). Traces are always requested; video is opt-in, and tests can override recording, so inspect the returned files.\n- On failure read `.e2e/summary.md` and `.e2e/results/*/trace.md` in the run directory first, then `execution.log` and `report.json`. The `waitcher-*.mjs` files there are runtime support, not your test. Traces are Markdown, not Playwright ZIPs; there is no HAR option, and app logs hold selected console and request failures only.\n- Exit codes: 0 passed, 4 failed or error, 130 interrupted. After an interruption, inspect partial evidence before repeating a possibly completed action.\n- Fix test mistakes while preserving the user\'s assertions; never weaken an assertion just to get green.\n- Evidence can contain private content: keep `.waitcher/`, `.e2e/`, keys and reports out of Git. Local results are not uploaded and are not hosted health evidence.\n\n## Apply one monitor through the API\n\nWhen hosted scripts are allowed and applying configuration is in scope:\n\n```sh\nwaitcher monitor apply --file monitor.json --dry-run\nwaitcher monitor apply --file monitor.json\nwaitcher monitor get --id MONITOR_ID\n```\n\nKeep the monitor paused unless the user requested scheduled execution; applying does not run it. For an authorized single hosted run use `run start --id MONITOR_ID --wait`, then `run status`, `run trace --id RUN_ID` (steps, failed assertion, screenshots, fetch calls) and `artifact get` for evidence. Hosted scripts run under the server\'s execution policy and can differ from a local run.\n\nEdits are complete replacements: `monitor export`, change the file, then `monitor apply --file FILE --id ID --expected-revision N` with the revision from get or export. Use a stable `--request-key` to recover one uncertain create or run; never change the payload under that key or repeat a possibly executed action. Report the exact monitor and run IDs, local evidence path, observed outcome and any difference between local and hosted results.\n';
@@ -54790,6 +54790,7 @@ var EXIT_CODES = Object.freeze({
54790
54790
  ACCOUNT_SUSPENDED: 7,
54791
54791
  CONFLICT: 8,
54792
54792
  MANAGED_BY_CONFIG: 8,
54793
+ RUNTIME_ENDED: 8,
54793
54794
  QUOTA_EXCEEDED: 6,
54794
54795
  RATE_LIMITED: 6,
54795
54796
  DAILY_SCRIPT_BUDGET: 6,
@@ -54876,6 +54877,11 @@ var entries = {
54876
54877
  meaning: "The project's runtime generation stops being supported on the date in the message. Until then it builds, deploys and runs as before.",
54877
54878
  fix: "Run waitcher runtime upgrade --file PATH_TO_waitcher.json and follow its steps, or hand the prompt in the runtime docs to a coding agent."
54878
54879
  },
54880
+ RUNTIME_ENDED: {
54881
+ title: "Check paused: its runtime ended",
54882
+ meaning: "The check's runtime generation is no longer supported and it did not pass its preview on the newest, so it is paused. Nothing runs or alerts; its history stays.",
54883
+ fix: "For a check in waitcher.json run waitcher runtime upgrade --file PATH_TO_waitcher.json and follow its steps; for a check made in the web app change it until its preview passes, then Move on its page or waitcher runtime move --id ID."
54884
+ },
54879
54885
  SECRET_MISSING: {
54880
54886
  title: "Secret not set for this environment",
54881
54887
  meaning: "A script lists a CHECK_* name in settings.envNames that has no value in the environment.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waitcher/cli",
3
- "version": "0.2.32",
3
+ "version": "0.2.33",
4
4
  "description": "Synthetic monitoring from your repository: deploy HTTP, certificate, TCP, DNS, heartbeat, API, browser, visual, MCP server and coding agent checks from waitcher.json, with AI checks and status pages.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Sławomir Radzymiński",