@waitcher/cli 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +49 -6
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -53877,11 +53877,13 @@ var EXIT_CODES = Object.freeze({
|
|
|
53877
53877
|
VALIDATION_ERROR: 2,
|
|
53878
53878
|
UNSUPPORTED_VERSION: 2,
|
|
53879
53879
|
FORBIDDEN: 7,
|
|
53880
|
+
ACCOUNT_SUSPENDED: 7,
|
|
53880
53881
|
CONFLICT: 8,
|
|
53881
53882
|
MANAGED_BY_CONFIG: 8,
|
|
53882
53883
|
QUOTA_EXCEEDED: 6,
|
|
53883
53884
|
RATE_LIMITED: 6,
|
|
53884
53885
|
DAILY_SCRIPT_BUDGET: 6,
|
|
53886
|
+
RUNNER_DAILY_BUDGET: 6,
|
|
53885
53887
|
QUEUE_FULL: 6,
|
|
53886
53888
|
NOT_FOUND: 9,
|
|
53887
53889
|
SERVICE_UNAVAILABLE: 10
|
|
@@ -57948,9 +57950,15 @@ const agents={default:{model:connect(${JSON.stringify(dispatch.model)}),${dispat
|
|
|
57948
57950
|
).href;
|
|
57949
57951
|
const browserImports = m.type === "browser" && !network ? `import{protectedBrowserProvider,${options.browserIdentityFile ? "browserIdentitySecrets" : "browserExecutable"}}from ${JSON.stringify(browserClient)};import{chromium}from'playwright-core';${options.browserIdentityFile ? `const identitySecrets=await browserIdentitySecrets(${JSON.stringify(options.browserIdentityFile)});` : "const browserOverride=await browserExecutable();"}` : "";
|
|
57950
57952
|
const identityImports = options.browserIdentityFile ? network ? `import {browserIdentitySecrets} from ${JSON.stringify(pathToFileURL(options.isolationWebFile ?? resolve8(root, "dist/isolated-web.mjs")).href)};const identitySecrets=await browserIdentitySecrets(${JSON.stringify(options.browserIdentityFile)});` : "" : "";
|
|
57953
|
+
const envNames = m.settings.envNames ?? [];
|
|
57954
|
+
const checkSecrets = envNames.length ? `const checkSecrets=Object.fromEntries(${JSON.stringify(envNames)}.flatMap(n=>{const v=process.env[n];return v&&[...v].length>=6?[[n,v]]:[]}));` : "";
|
|
57955
|
+
const secrets = [
|
|
57956
|
+
...envNames.length ? ["...checkSecrets"] : [],
|
|
57957
|
+
...options.browserIdentityFile ? ["...identitySecrets"] : []
|
|
57958
|
+
];
|
|
57951
57959
|
const source = `${isolationImports}${browserImports}${identityImports}${m.type === "browser" && !network ? "import {web} from '@e2e-dev/web';" : ""}
|
|
57952
|
-
${modelSource}
|
|
57953
|
-
export default {...${JSON.stringify(config2)},targets:${targets}${dispatch ? ",agents" : ""}${
|
|
57960
|
+
${modelSource}${checkSecrets}
|
|
57961
|
+
export default {...${JSON.stringify(config2)},targets:${targets}${dispatch ? ",agents" : ""}${secrets.length ? `,secrets:{${secrets.join(",")}}` : ""}};`;
|
|
57954
57962
|
await writeFile2(join5(dir, "e2e.config.ts"), source);
|
|
57955
57963
|
if (network)
|
|
57956
57964
|
await writeFile2(
|
|
@@ -58021,7 +58029,7 @@ try {
|
|
|
58021
58029
|
env.WAITCHER_REQUEST_RESOURCE_ID = requestDispatch.resourceId;
|
|
58022
58030
|
}
|
|
58023
58031
|
const environment = options.environment ?? process.env;
|
|
58024
|
-
for (const name5 of
|
|
58032
|
+
for (const name5 of envNames)
|
|
58025
58033
|
if (environment[name5]) env[name5] = environment[name5];
|
|
58026
58034
|
const p = await (options.execute ?? child)(
|
|
58027
58035
|
process.execPath,
|
|
@@ -58522,6 +58530,16 @@ var entries = {
|
|
|
58522
58530
|
meaning: "The account has used its script runs for today (UTC), scheduled and manual together.",
|
|
58523
58531
|
fix: "Wait until after midnight UTC; scheduled runs over the limit are recorded as missed. Never loop."
|
|
58524
58532
|
},
|
|
58533
|
+
RUNNER_DAILY_BUDGET: {
|
|
58534
|
+
title: "Hosted script runs used",
|
|
58535
|
+
meaning: "The cloud runner's runs for today (UTC) are used, by all accounts or by free accounts' share.",
|
|
58536
|
+
fix: "Wait until after midnight UTC; scheduled runs are recorded as missed. Never loop."
|
|
58537
|
+
},
|
|
58538
|
+
ACCOUNT_SUSPENDED: {
|
|
58539
|
+
title: "Account suspended",
|
|
58540
|
+
meaning: "The administrator stopped every check of this account; its data stays and can be exported or deleted.",
|
|
58541
|
+
fix: "Contact the address on the terms page. Retrying does not help."
|
|
58542
|
+
},
|
|
58525
58543
|
QUEUE_FULL: {
|
|
58526
58544
|
title: "Execution queue full",
|
|
58527
58545
|
meaning: "The run was not queued and is not saved for later.",
|
|
@@ -61062,7 +61080,7 @@ var authoring_default = '# Authoring and running monitors\n\nRead when writing o
|
|
|
61062
61080
|
var ai_and_agents_default = "# AI endpoints, agent outcomes and model steps\n\nRead only when `waitcher system capabilities` reports the feature and the user needs it. Deterministic HTTP, API and browser monitors need none of this; see [authoring](authoring.md).\n\n## Agent outcome checks\n\nFor hosted scripts using `#waitcher/scenario`, first confirm `features.scenarioEvidence` through `system capabilities`, alongside script admission. Older servers may not provide this helper. Do not silently remove required scenario checks to make an unsupported run pass. Capability discovery is separate from native security, capacity and production release acceptance.\n\nFor an agent that changes application state, start with `monitor init --template agent-outcome --file outcome.json --target https://product.example/api/`. It creates a paused ordinary API script, with no model binding or paid-provider requirement. Adapt its fixed `agent/tasks` submission and `notes/{runId}` resource paths, disposable test namespace and exact expected fields. It submits one action, ignores claims of success and response-provided URLs, then independently reads the known resource at most three times. A fresh per-run random `id` and `correlationId` must both match, alongside the expected result. Action transport errors are never automatically retried. Cleanup runs in `finally` only after an independent read proves the resource belongs to this run; cleanup failures fail the test. If ownership or the action result is uncertain, it records cleanup as unverified and leaves state untouched. Reconcile possible late actions before repeating a mutating test. This pattern verifies the chosen outcome, not the agent's overall quality or the correctness of its explanation.\n\nThe starter uses the optional `#waitcher/scenario` helper with required submit/action, observe, verify and cleanup phases. `createScenario({id, phases})` returns `phase(id, callback)`, `assert(boolean)` and `incomplete(reason)`. Call signals only inside an active phase. Every scenario needs a required verify phase, and an executed verify phase must call `scenario.assert` at least once; an empty verification cannot establish pass. `assert(false)` records a business failure even if caught; ordinary callback exceptions and `incomplete(\"CLEANUP_UNVERIFIED\")` record coverage errors. Inspect `.e2e/waitcher-scenarios.json` in the private evidence: required phases that never ran or remain in flight also prevent a pass. Coverage error takes precedence while retaining failed verification facts. A false agent claim can therefore produce a failed verify phase and an overall error when cleanup remains uncertain. The helper does not automatically classify arbitrary E2E assertions or infer agent/tool traces. Use stable non-secret scenario/phase IDs, avoid raw response values in assertions, and do not use report labels as secret storage.\n\nUse the unchanged file with `monitor validate`, account-free `run local --file outcome.json --runtime YOUR_PINNED_RUNTIME`, and the existing API-script editor or `monitor apply --file outcome.json --dry-run`. Keep it paused after applying. Project authors can extract the script into `scriptFile`, keep helper imports and use `monitor build` to create one portable script; `#waitcher/scenario` stays external and is supplied by the manifest runner. The complete CLI includes `scenario-runtime.mjs`; keep package companions together. Standalone `--project` needs its own helper integration. The starter's default is credential-free. Optional local/trusted-administrator bearer tokens use `CHECK_AGENT_ACTION_TOKEN`, `CHECK_RESOURCE_READ_TOKEN` and `CHECK_RESOURCE_CLEANUP_TOKEN`, explicitly listed in `settings.envNames` and supplied outside the manifest. Hosted personal scripts receive `CHECK_*` values only from their project environment's secrets (`waitcher secret set`), never from the server's environment; do not work around that boundary. Do not log credentials or response bodies, and do not promise complete trace masking for arbitrary custom environment values. Local success does not establish hosted admission or isolation.\n\n## Scenario evidence\n\nInspect readable scenario evidence with `waitcher run scenarios --id RUN_ID`, or use `waitcher run scenarios --directory PRIVATE_RUN_DIR` for account-free local inspection without a server/runtime. Add `--json` for the exact shared report DTO. Do not combine selectors or pass `--server` for local inspection. Inspection of failed/error runs succeeds; execution exit codes remain unchanged. Keep authoritative run status separate from evidence availability: empty valid reports verify no business outcome, and pending/not-recorded/expired/invalid reports cannot establish a pass. Local evidence is checked against its recorded inventory and checksum; never edit it to manufacture a successful outcome.\n\n## AI product endpoints\n\nFor a single AI product endpoint, prefer a declarative `type: \"ai\"` fixture over an E2E script. Run `monitor init --type ai --target https://product.example/ai --file ai.json`, replace the sample request and response checks with the product contract, then `monitor validate --file ai.json`. JSON-pointer assertions support exact equality, type, existence and literal case-sensitive contains/not-contains/contains-any/contains-all checks; an optional bounded response schema checks structure. `run local --file ai.json` uses the same one-POST adapter without an account, model connection, provider key or E2E runtime. It only reaches public HTTPS endpoints and supports optional verified `httpAuth` references as described below; arbitrary custom headers and account-session inheritance are forbidden. Inspect the structured per-assertion report and distinguish transport coverage errors from product assertion failures. Applying the same file to hosted monitoring requires `features.aiEndpoints`; personal admission also requires a currently verified `httpAuth` binding; keep it paused unless scheduling is authorized. This verifies a chosen fixture, not general agent quality or a calibrated semantic judge.\n\nFor a small set of representative prompts against the same endpoint, use `aiEndpoint.adapter: \"json-http-suite-v1\"` and `cases` with 1\u20135 objects containing a stable unique `id`, readable `name`, positive `revision` (default 1), literal JSON-object `fixture`, and assertions and/or response schema. The suite `invocationBudget` equals its case count and is filled in when omitted. Validate offline and run the unchanged manifest locally before applying it; hosted capability `features.aiEndpointSuites` must be available. Cases run serially under one total monitor timeout. Assertion failures permit later cases; a transport/deadline error stops them as `not-run`. Inspect every case and coverage summary, not only the overall status. The controller reserves the full case count before any hosted request, and partial/uncertain runs retain that conservative allowance. Reported attempted requests can therefore be fewer than charged units. Deterministic suites do not provide semantic grading; do not describe text matching as semantic correctness. Single fixtures and each suite case can opt into literal variables with variables:{name:\"string\"} and exact {{name}} placeholders inside fixture string values. Without variables, braces remain literal. Use at most 16 names, ASCII letter followed by letters/digits/underscores (64 characters); prototype-related names are refused. Each value fits 4 KiB UTF-8, maps and rendered fixtures 16 KiB and complete configurations 64 KiB. No expressions, environment lookup, key/URL/assertion/rubric interpolation, matrix expansion or recursive replacement is supported. Missing/malformed placeholders reject before requests. Use non-secret data. Validate locally and preview before applying: exports keep authored maps while enqueue freezes rendered literal requests. Release comparisons use effective rendered bodies, so a changed variable value can be a changed policy even with the same case revision.\n\nFor optional semantic endpoint grading, use `json-http-graded-suite-v1`, portable schemaVersion 2 and explicit context (even the default project/environment). Set the top-level `judge` connectionId/configurationRevision/model/budget and add a rubric to each selected case: stable id/revision, criteria, outputPath, threshold and optional reference examples. Keep target credentials separate from judge keys. Hosted use requires `features.endpointJudges`; local use accepts the same private `--connections-file` map without an account, UI or E2E runtime. Only the selected output and rubric criteria/examples reach the judge. Known echoed managed product keys are refused before grading. Inspect score, verdict, rubric hash and private model-usage.json: malformed/unavailable/unknown/over-budget grading is inconclusive coverage and cannot pass or recover a product incident. There are no retries or fallback models. Every report currently marks calibration unverified; labelled reference examples do not prove accuracy. Keep calibration, pricing and release acceptance distinct from a controlled protocol pass.\n\nTo measure a rubric against labelled examples, use `monitor calibrate --id ID --file REQUEST_JSON` for a saved hosted monitor, then `monitor calibrations --id ID` or `monitor calibration --id ID --calibration-id ID` to inspect retained measurements. The request contains `caseId`, `dataset` and optional `repeats`. For account-free local measurement, use `run calibrate --file MONITOR --case-id CASE --dataset DATASET --connections-file PRIVATE_MAP`; `--dataset` is the dataset object alone. Use 2\u20134 fictional labelled outputs and 1\u20133 repeats, within the saved judge call/token budget and a total 30-second ceiling. Calibration calls only the judge, not the product endpoint, and creates no health runs, incidents or recovery. Keep known keys out of dataset/rubric identifiers, object keys and content as well as prompts. Inspect agreement over valid evaluated decisions, disagreement, repeat instability and technical coverage errors separately. A valid expected inconclusive can agree; a provider error cannot. Inspect private model usage for actual reservations. Exit 4 means disagreement, instability or coverage failure; never erase those results to obtain a green check. A small successful sample applies only to its exact dataset/rubric/model identity and does not establish general accuracy or automatically change the monitor\u2019s unverified calibration label.\n\nFor release regressions, use `project compare --id PROJECT_ID --deployment-id DEPLOYMENT_ID` and follow the opaque `next` cursor with `--before`. AI rows include case-level comparisons from frozen queued definitions and retained structured reports. Inspect each case classification and compatibility reasons. A different fixture, assertion, rubric, judge model or policy identity cannot establish a product regression; do not compare numeric scores across changed policies. Missing/invalid reports and unexecuted cases are coverage gaps. Follow the owned run references for evidence. Last passing and first failure are useful only for the matching case policy; a pass from another case or rubric is not a reproduction baseline. Display-name changes and JSON object key order do not change the evaluation policy. Comparison is read-only and never schedules another paid request.\n\n## AI steps in browser and API scripts\n\nFor personal AI-assisted browser journeys, require both `features.ai` and `features.isolatedAi` alongside script admission. Keep the `ai` model connection binding optional; deterministic scripts need no model or provider key. Hosted personal runs always use server-owned isolated policy and an explicitly model-capable isolated worker. An older worker, withdrawn capability or missing connection is a coverage failure, never a reason to switch accounts or execute through a trusted lane. Use the same version-2 manifest locally with a private connection map before applying it paused. Only attempt-scoped broker authority enters the disposable runtime; upstream keys stay controller-side. Screenshots, page content and prompts used by AI steps reach the selected provider. Inspect native assertions plus authoritative model usage/error evidence; catching an SDK error does not make a run healthy. No browser login-state import or stored application credentials are supported by this capability. API scripts have no built-in screen observation engine: do not call screen-based agent.assert/waitFor/extract on API data. In manifest mode, import {assertGrade, grade} from \"#waitcher/ai\" and pass {data: selectedJsonOrText, rubric: criteria, threshold: 0.8}. The optional judgeModel grades the selected data, otherwise model is used. Keep expected facts in versioned fixtures; send no credentials or unnecessary response fields. Selected JSON is limited to 8 KiB and rubric to 2 KiB. grade returns {verdict,score}; assertGrade throws on non-pass. Any failure, valid inconclusive or technical grading error remains authoritative even when caught or ignored. Inspect private waitcher-data-grades.json alongside model usage and the native report. No retries/fallbacks occur. The alias survives monitor build and is supplied by run local --file and hosted script execution; standalone --project needs its own integration. Deterministic scripts need no binding; fixed endpoint fixtures can use the declarative graded adapter instead.\n\nFor an existing project's custom model setup, use `--project`. A schemaVersion 2 manifest with an `ai` binding can also run unchanged locally using `--connections-file /private/connections.json`, without login. The private map has schemaVersion 1 and a connections array; each record contains id, configurationRevision, provider openrouter, projectId, environmentId, allowed models and credentialFile. Credential paths resolve relative to the map. IDs/revisions/models and explicit manifest scope must match. Keep both map and key files private (chmod 600); inline keys, provider URLs and symlinks are refused. The selected runtime also needs ai@7.0.107. The complete CLI package ships model-client.mjs and notices; copying only cli.mjs is insufficient for bound AI execution.\n\nThe local manifest runner keeps the provider key in its parent and passes a temporary loopback grant to the test. It uses the hosted transport and per-run budget/outcome rules, but no hosted account/day ledger. Read model-usage.json as well as the native report: caught provider/budget failures may leave a native passed test while Waitcher correctly records error. Unknown usage stays reserved, SDK retries count separately, and local success does not verify hosted enablement or key freshness. Provider keys are not forwarded to the child, and literal temporary broker tokens are redacted from normal text evidence; trusted local code can read its filesystem and is not a sandbox. Traces default on, video stays opt-in.\n\nIn the project's `e2e.config.ts`, construct the chosen provider's AI SDK model under `agents.default.model`, following the installed framework's types. The provider reads its local key; a key alone does not configure a model. Never copy a user's provider key into a monitor manifest or use an operator's account key.\n\nMix exact assertions with selected `agent.act`, `agent.assert`, `agent.waitFor` and schema-bound `agent.extract` calls. AI operations may transmit screen content to the provider and incur cost; preserve the user's provider/call authorization. Step-level `maxModelCalls` is not a whole-run spending limit. Hosted connection/broker/budget support is separate and must be discovered from actual capabilities rather than assumed from a local run.\n\n## Protected product requests\n\nFor protected product operations, use monitor init --template protected-agent-outcome --request-policy-file POLICY.json --project-id UUID --environment-id UUID --file monitor.json. The public policy contains connections with id, canonical HTTPS origin and httpAuth references (targetId, credentialId, credentialRevision); operations with id, connection, method, path, optional static body, responsePointers and maxCalls; and budget.calls. Paths are fixed absolute paths with at most one whole {resourceId} UUID segment. Static JSON bodies may use only exact string leaves {{resourceId}}. Callers cannot choose URLs, methods, headers, bodies, query parameters or UUIDs. GET permits at most three calls, POST and DELETE one; DELETE requires the UUID path and POST must use the run identity. Limits are four connections, eight operations and eight total calls.\n\nThe protected starter requires submit POST, observe GET (three reads), cleanup DELETE, a five-call budget and response pointers /id, /correlationId, /title, /completed. Configure the static submission body to create a note with the parent-generated UUID in both id and correlationId, title Waitcher outcome check, and completed true. The optional #waitcher/requests SDK exposes requestOperation and requestResourceId. Responses contain status and a data map keyed by configured JSON pointers. The script never trusts the agent reply as proof of resulting state, never retries the action, and only cleans up independently proven run-owned state.\n\nLocal execution uses the existing --http-credentials-file private map: schemaVersion 1 and credentials entries with targetId, credentialId, credentialRevision, origin, header and credentialFile. Header is Authorization or X-Api-Key; its raw value stays in a separate private regular file. Map and key files require mode600 and exact reference/revision/origin matches. Keys stay in the CLI parent, never script, manifest, CLI arguments or custom environment. No account, app or AI provider is required locally. Keep request-runtime.mjs with the complete CLI package. For source projects use scriptFile, monitor build, then run local --file; standalone project mode does not inject the protected helper. Hosted use requires explicit capability and isolated execution even for administrators. Combined AI or browser-state bindings need their independent authority. Inspect request-usage.json, scenario and native reports. Caught budget errors, uncertain dispatch and unfinished calls cannot establish a healthy result; never replay mutations automatically.\n\nScenario request associations are optional recorded evidence. The request helper automatically records each issued request UUID on its originating phase. In a verify phase, call `scenario.referenceRequest(response.requestId)` for a request from an earlier completed observe phase in the same scenario; use the validated response envelope UUID, never an ID from response data. The protected starter references its last independent observation before asserting the business state. Read associations with `run scenarios`; `run diagnose` joins them to this run's request records and labels each ID `matched`, `not-found` or `unavailable`. These are script-reported phase associations. A matching controller row proves accounting correspondence, not the correctness of a phase or business outcome. Local matches remain local helper reports. Older evidence without association fields is not recorded, rather than an empty verified list. UNKNOWN requests remain charged and incomplete; no association authorizes mutation replay.\n";
|
|
61063
61081
|
|
|
61064
61082
|
// ../../skills/waitcher/references/deploy.md
|
|
61065
|
-
var deploy_default = '# Repository deploys\n\nRead when the user keeps monitors in a repository with `waitcher.json`. The core workflow is in SKILL.md; this file holds the details. `waitcher doctor` confirms that the server supports deploys.\n\n## The file\n\n```json\n{\n "schemaVersion": 1,\n "project": "Shop",\n "environments": {\n "production": { "baseUrl": "https://shop.example" },\n "staging": { "baseUrl": "https://staging.shop.example" }\n },\n "defaults": { "interval": 1800, "timeout": 15 },\n "monitors": [\n { "key": "home", "type": "http", "path": "/", "settings": { "contains": "Shop" } },\n { "key": "tls", "type": "certificate" },\n { "key": "checkout", "type": "browser", "entry": "monitoring/checkout.e2e.ts", "timeout": 45 },\n { "key": "orders-api", "type": "api", "entry": "monitoring/orders.e2e.ts",\n "settings": { "envNames": ["CHECK_ORDERS_TOKEN"] } },\n { "key": "nightly-export", "type": "heartbeat", "environments": ["production"],\n "heartbeat": { "graceSeconds": 300, "completionSeconds": 900 } }\n ]\n}\n```\n\n- `config init` starts with two example monitors (`home`: HTTP 200 on `/`; `tls`: certificate expiry). Keep, change or remove them.\n- Environment names match case-insensitively: `production` in the file is the project\'s default `Production` environment.\n- HTTP `settings`: `method`, `expectedStatus`, `contains`, `jsonPath` with `jsonValue`, `maxLatency` (ms), `headers`, `body`; certificates: `certificateMinDays` (default 14). `waitcher monitor init --type TYPE --file x.json` writes a complete example of any type.\n- A 30-minute interval suits HTTP, certificate and browser checks alike; certificates rarely need more often. Personal accounts cannot go below 30 minutes, and script monitors follow the account plan (starter: one, every 2 hours or slower); read `limits.isolatedScripts` in `system capabilities` before planning.\n- Entries are ordinary monitor definitions plus `key`, optional `environments` and optional `path` (resolved against `baseUrl`). Script and certificate targets default to `baseUrl`; heartbeats use the key as their label.\n- Never set `enabled`, `script`, `scriptFile`, `schemaVersion`, `context` or `demo` in entries.\n- Script tests read `process.env.TARGET_URL` (API) or call `app.open("/")` (browser), so one test serves every environment.\n- The directory holding `waitcher.json` must have `e2e@0.21.1`, `@e2e-dev/web@0.15.1` (browser) and `esbuild@0.28.2` installed exactly; `waitcher runtime install` sets them up and later upgrades them (ask before `--yes`). Do not let dependency bots move these three packages. Tests may import project files and JSON; other packages fail with `BUILD_FAILED` naming the import. Replace them with project code, `fetch` or JSON data; do not vendor a dependency to get past the limit. A built script must fit 50,000 characters.\n\n## Plan and apply\n\n- `config validate --env NAME --verify [--key KEY]` runs that environment\'s script entries locally without an account. `deploy plan --env NAME [--verify]` changes nothing. `changes` lists `create`, `adopt`, `update` (with `fields`), `unchanged`, `delete`, `orphaned` and `invalid` per key.\n- `deploy apply --env NAME --based-on BASED_ON` applies the whole environment or nothing. `ok:false` exits 2 and writes nothing. A stale `--based-on` is `CONFLICT`: plan again and show the new plan.\n- The repository owns definitions; the server owns pause and resume. Managed monitors refuse edits through `monitor apply` or the web (`MANAGED_BY_CONFIG`); change the file instead.\n- Undeclared monitors stay as `orphaned` warnings. `--prune` deletes them and their history; use it only with the user\'s consent.\n- Deploy versions come from the Git commit (`-dirty` when `waitcher.json` has uncommitted changes). A configuration deploy is not a product release: runs show `context.deployment` only for markers recorded with `waitcher deployment record`.\n- `--smoke` runs each created, adopted or updated monitor once on the server after apply. A failed smoke leaves the deploy applied and exits 4; follow `next` to `run diagnose`.\n\n## Secrets\n\nScripts list `CHECK_*` names in `settings.envNames`. Values live per project environment on the server:\n\n```sh\nprintf %s "$VALUE" | waitcher secret set --env staging --name CHECK_ORDERS_TOKEN --value-stdin\nwaitcher secret list --env staging\n```\n\nAsk the user for each value, or tell them the command to run themselves. Never echo, log or commit it. A plan reports `SECRET_MISSING` with the missing names. `--verify` runs with your local environment, so export the same `CHECK_*` variables locally (never in files) or skip `--verify` for that monitor and rely on `--smoke`.\n\n## Adopting existing monitors\n\nWhen a plan warns `ADOPTION_CANDIDATE`, an existing unmanaged monitor looks like the entry. Show it to the user (`waitcher monitor get --id ID`). If it is the same check, plan and apply with `--adopt KEY=MONITOR_ID`: it keeps its ID, history and pause state and takes the file\'s definition. Otherwise ignore the warning; apply creates a separate monitor.\n\n## Rollback\n\n`waitcher deploy list --project-id ID` shows deploys; `restorable:true` marks the latest 10 per environment. `waitcher deploy rollback --id DEPLOY_ID --dry-run` shows the plan, then run it with `--based-on`. Secrets are not rolled back. Tell the user to revert the repository too, or the next apply reintroduces the change.\n\n## CI\n\n`waitcher ci init [--env production] [--file waitcher.json]` writes `.github/workflows/waitcher.yml`: plan on pull requests, apply on pushes to the main branch. It installs the CLI from the server with a checksum and signs in with the `WAITCHER_TOKEN` repository secret. Create that token with read and write permissions (add run for `--smoke`) and `"projectId"` set to the project\'s ID (from `deploy plan`\'s `project.id`) using `waitcher token create`, so CI cannot touch other projects, and let the user store it with `gh secret set WAITCHER_TOKEN`. Set the `WAITCHER_SERVER` repository variable for a non-default server.\n';
|
|
61083
|
+
var deploy_default = '# Repository deploys\n\nRead when the user keeps monitors in a repository with `waitcher.json`. The core workflow is in SKILL.md; this file holds the details. `waitcher doctor` confirms that the server supports deploys.\n\n## The file\n\n```json\n{\n "schemaVersion": 1,\n "project": "Shop",\n "environments": {\n "production": { "baseUrl": "https://shop.example" },\n "staging": { "baseUrl": "https://staging.shop.example" }\n },\n "defaults": { "interval": 1800, "timeout": 15 },\n "monitors": [\n { "key": "home", "type": "http", "path": "/", "settings": { "contains": "Shop" } },\n { "key": "tls", "type": "certificate" },\n { "key": "checkout", "type": "browser", "entry": "monitoring/checkout.e2e.ts", "timeout": 45 },\n { "key": "orders-api", "type": "api", "entry": "monitoring/orders.e2e.ts",\n "settings": { "envNames": ["CHECK_ORDERS_TOKEN"] } },\n { "key": "nightly-export", "type": "heartbeat", "environments": ["production"],\n "heartbeat": { "graceSeconds": 300, "completionSeconds": 900 } }\n ]\n}\n```\n\n- `config init` starts with two example monitors (`home`: HTTP 200 on `/`; `tls`: certificate expiry). Keep, change or remove them.\n- Environment names match case-insensitively: `production` in the file is the project\'s default `Production` environment.\n- HTTP `settings`: `method`, `expectedStatus`, `contains`, `jsonPath` with `jsonValue`, `maxLatency` (ms), `headers`, `body`; certificates: `certificateMinDays` (default 14). `waitcher monitor init --type TYPE --file x.json` writes a complete example of any type.\n- A 30-minute interval suits HTTP, certificate and browser checks alike; certificates rarely need more often. Personal accounts cannot go below 30 minutes, and script monitors follow the account plan (starter: one, every 2 hours or slower); read `limits.isolatedScripts` in `system capabilities` before planning.\n- Entries are ordinary monitor definitions plus `key`, optional `environments` and optional `path` (resolved against `baseUrl`). Script and certificate targets default to `baseUrl`; heartbeats use the key as their label.\n- Never set `enabled`, `script`, `scriptFile`, `schemaVersion`, `context` or `demo` in entries.\n- Script tests read `process.env.TARGET_URL` (API) or call `app.open("/")` (browser), so one test serves every environment.\n- The directory holding `waitcher.json` must have `e2e@0.21.1`, `@e2e-dev/web@0.15.1` (browser) and `esbuild@0.28.2` installed exactly; `waitcher runtime install` sets them up and later upgrades them (ask before `--yes`). Do not let dependency bots move these three packages. Tests may import project files and JSON; other packages fail with `BUILD_FAILED` naming the import. Replace them with project code, `fetch` or JSON data; do not vendor a dependency to get past the limit. A built script must fit 50,000 characters.\n\n## Plan and apply\n\n- `config validate --env NAME --verify [--key KEY]` runs that environment\'s script entries locally without an account. `deploy plan --env NAME [--verify]` changes nothing. `changes` lists `create`, `adopt`, `update` (with `fields`), `unchanged`, `delete`, `orphaned` and `invalid` per key.\n- `deploy apply --env NAME --based-on BASED_ON` applies the whole environment or nothing. `ok:false` exits 2 and writes nothing. A stale `--based-on` is `CONFLICT`: plan again and show the new plan.\n- The repository owns definitions; the server owns pause and resume. Managed monitors refuse edits through `monitor apply` or the web (`MANAGED_BY_CONFIG`); change the file instead.\n- Undeclared monitors stay as `orphaned` warnings. `--prune` deletes them and their history; use it only with the user\'s consent.\n- Deploy versions come from the Git commit (`-dirty` when `waitcher.json` has uncommitted changes). A configuration deploy is not a product release: runs show `context.deployment` only for markers recorded with `waitcher deployment record`.\n- `--smoke` runs each created, adopted or updated monitor once on the server after apply. A failed smoke leaves the deploy applied and exits 4; follow `next` to `run diagnose`.\n\n## Secrets\n\nScripts list `CHECK_*` names in `settings.envNames`. Values live per project environment on the server:\n\n```sh\nprintf %s "$VALUE" | waitcher secret set --env staging --name CHECK_ORDERS_TOKEN --value-stdin\nwaitcher secret list --env staging\n```\n\nAsk the user for each value, or tell them the command to run themselves. Never echo, log or commit it. A plan reports `SECRET_MISSING` with the missing names. `--verify` runs with your local environment, so export the same `CHECK_*` variables locally (never in files) or skip `--verify` for that monitor and rely on `--smoke`.\n\nListed values of at least 6 characters appear as `<secret:CHECK_NAME>` in reports, traces and logs; screenshots, video and transformed values are not masked. For a password or token typed into a page, prefer `fill(secrets.get("CHECK_NAME"))` (`import { secrets } from "e2e"`) over `process.env`: the value stays out of the test code and the run refuses `app.screenshot()` after that fill, so take screenshots before it or drop them. Read `process.env.CHECK_NAME` for values the script sends itself, such as API headers. Never log a value or assert on it.\n\n## Adopting existing monitors\n\nWhen a plan warns `ADOPTION_CANDIDATE`, an existing unmanaged monitor looks like the entry. Show it to the user (`waitcher monitor get --id ID`). If it is the same check, plan and apply with `--adopt KEY=MONITOR_ID`: it keeps its ID, history and pause state and takes the file\'s definition. Otherwise ignore the warning; apply creates a separate monitor.\n\n## Rollback\n\n`waitcher deploy list --project-id ID` shows deploys; `restorable:true` marks the latest 10 per environment. `waitcher deploy rollback --id DEPLOY_ID --dry-run` shows the plan, then run it with `--based-on`. Secrets are not rolled back. Tell the user to revert the repository too, or the next apply reintroduces the change.\n\n## CI\n\n`waitcher ci init [--env production] [--file waitcher.json]` writes `.github/workflows/waitcher.yml`: plan on pull requests, apply on pushes to the main branch. It installs the CLI from the server with a checksum and signs in with the `WAITCHER_TOKEN` repository secret. Create that token with read and write permissions (add run for `--smoke`) and `"projectId"` set to the project\'s ID (from `deploy plan`\'s `project.id`) using `waitcher token create`, so CI cannot touch other projects, and let the user store it with `gh secret set WAITCHER_TOKEN`. Set the `WAITCHER_SERVER` repository variable for a non-default server.\n';
|
|
61066
61084
|
|
|
61067
61085
|
// ../../skills/waitcher/references/diagnosis.md
|
|
61068
61086
|
var diagnosis_default = "# Diagnosing failures\n\nRead when a local, smoke or scheduled run failed or errored.\n\n## Diagnose and reproduce a retained run\n\nConfirm `features.runDiagnosis` for hosted support. Use `run diagnose --id RUN_ID` for a readable hosted packet, or add `--json` for the shared structured report. Use `run diagnose --directory PRIVATE_RUN_DIRECTORY` without an account to inspect indexed local evidence. Hosted request states come from the controller ledger; local helper observations are explicitly local and do not attest hosted accounting. A known response does not prove task success, and an unknown action may have taken effect. Do not automatically repeat a mutation because its result is unknown.\n\nA historical pass is useful only when the frozen verification policy matches. Changed scripts, targets, deadlines or protected-operation policies cannot supply a matching reference. History searches are bounded; unavailable or truncated history is not proof that the product never passed. Stored artifact checksums are metadata; inspect the actual artifact when needed. Scenario evidence is checked against its recorded checksum before display.\n\nFor a completed supported hosted script, `run reproduce --id RUN_ID --output NEW_DIRECTORY` prepares its frozen configuration in a new private folder. It never executes the test or retrieves the current edited monitor. Inspect `monitor.json` and `provenance.json`, then deliberately run `run local --file NEW_DIRECTORY/monitor.json --output FRESH_RUN_DIRECTORY` with the matching installed runtime, optionally `--runtime PROJECT`. Reproduction is a fresh run with separate provenance and does not replace the original evidence.\n\nManaged product credentials, AI keys and browser sessions are not exported. Supply existing private local mappings with `--http-credentials-file`, `--connections-file` and `--browser-identities-file` where required. Authored scripts and literal configuration can themselves be sensitive, so keep the reproduction private. Operator-injected headers, bodies or environment state make this initial portable preparation unavailable rather than silently changing the test. Older local runs without an indexed frozen manifest remain inspectable but cannot establish a captured reproduction policy.\n";
|
|
@@ -62069,6 +62087,10 @@ Capabilities
|
|
|
62069
62087
|
system plans Administrator: plan profiles and accounts not on starter
|
|
62070
62088
|
system plan --owner clerk:USER_ID --plan starter|pilot
|
|
62071
62089
|
Administrator: assign a plan; takes effect immediately
|
|
62090
|
+
system suspensions Administrator: accounts whose checks are suspended
|
|
62091
|
+
system suspend --owner clerk:USER_ID --reason TEXT
|
|
62092
|
+
Administrator: stop every check of one account; data stays
|
|
62093
|
+
system unsuspend --owner clerk:USER_ID Administrator: lift a suspension
|
|
62072
62094
|
|
|
62073
62095
|
Projects and environments
|
|
62074
62096
|
project list
|
|
@@ -62486,7 +62508,7 @@ ${exitCodes}
|
|
|
62486
62508
|
// package.json
|
|
62487
62509
|
var package_default = {
|
|
62488
62510
|
name: "@waitcher/cli",
|
|
62489
|
-
version: "0.2.
|
|
62511
|
+
version: "0.2.7",
|
|
62490
62512
|
description: "Synthetic monitoring from your repository: deploy HTTP, certificate, heartbeat, API and browser monitors from waitcher.json.",
|
|
62491
62513
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
62492
62514
|
author: "S\u0142awomir Radzymi\u0144ski",
|
|
@@ -62624,6 +62646,7 @@ async function main() {
|
|
|
62624
62646
|
"monitor-id": { type: "string" },
|
|
62625
62647
|
owner: { type: "string" },
|
|
62626
62648
|
plan: { type: "string" },
|
|
62649
|
+
reason: { type: "string" },
|
|
62627
62650
|
"run-id": { type: "string" },
|
|
62628
62651
|
"case-id": { type: "string" },
|
|
62629
62652
|
dataset: { type: "string" },
|
|
@@ -62869,6 +62892,9 @@ async function main() {
|
|
|
62869
62892
|
"system diagnostics": [],
|
|
62870
62893
|
"system plans": [],
|
|
62871
62894
|
"system plan": ["owner", "plan"],
|
|
62895
|
+
"system suspensions": [],
|
|
62896
|
+
"system suspend": ["owner", "reason"],
|
|
62897
|
+
"system unsuspend": ["owner"],
|
|
62872
62898
|
"artifact get": ["id", "path", "file"],
|
|
62873
62899
|
"auth logout": [],
|
|
62874
62900
|
"monitor init": [
|
|
@@ -64649,6 +64675,8 @@ async function main() {
|
|
|
64649
64675
|
} else if (command === "system diagnostics")
|
|
64650
64676
|
result2 = await api("system/diagnostics");
|
|
64651
64677
|
else if (command === "system plans") result2 = await api("system/plans");
|
|
64678
|
+
else if (command === "system suspensions")
|
|
64679
|
+
result2 = await api("system/suspensions");
|
|
64652
64680
|
else if (command === "account billing") result2 = await api("billing");
|
|
64653
64681
|
else if (command === "account upgrade" || command === "account billing-portal") {
|
|
64654
64682
|
const { url: url3 } = await api(
|
|
@@ -64675,6 +64703,17 @@ async function main() {
|
|
|
64675
64703
|
method: "PUT",
|
|
64676
64704
|
body: { plan }
|
|
64677
64705
|
});
|
|
64706
|
+
} else if (command === "system suspend" || command === "system unsuspend") {
|
|
64707
|
+
const owner = String(v.owner ?? "");
|
|
64708
|
+
if (!/^clerk:user_[A-Za-z0-9]{8,64}$/.test(owner))
|
|
64709
|
+
usage2("--owner must be an account owner like clerk:user_ID");
|
|
64710
|
+
const suspend = command === "system suspend";
|
|
64711
|
+
if (suspend && String(v.reason ?? "").trim().length < 3)
|
|
64712
|
+
usage2("--reason must say why, in 3 to 200 characters");
|
|
64713
|
+
result2 = await api(`system/suspensions/${encodeURIComponent(owner)}`, {
|
|
64714
|
+
method: suspend ? "PUT" : "DELETE",
|
|
64715
|
+
...suspend ? { body: { reason: String(v.reason) } } : {}
|
|
64716
|
+
});
|
|
64678
64717
|
} else if (command === "system capabilities")
|
|
64679
64718
|
result2 = await api("capabilities");
|
|
64680
64719
|
else if (command === "auth status") {
|
|
@@ -64684,7 +64723,11 @@ async function main() {
|
|
|
64684
64723
|
mode: session.kind === "automation" ? "automation" : session.kind === "oauth" ? "oauth" : "admin_password",
|
|
64685
64724
|
authorization: data.authorization,
|
|
64686
64725
|
account: data.account,
|
|
64687
|
-
...data.owner ? {
|
|
64726
|
+
...data.owner ? {
|
|
64727
|
+
owner: data.owner,
|
|
64728
|
+
plan: data.limits?.plan,
|
|
64729
|
+
...data.suspended ? { suspended: data.suspended } : {}
|
|
64730
|
+
} : {},
|
|
64688
64731
|
server,
|
|
64689
64732
|
probe: data.probe,
|
|
64690
64733
|
expiresAt: new Date(session.expiresAt).toISOString()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waitcher/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Synthetic monitoring from your repository: deploy HTTP, certificate, heartbeat, API and browser monitors from waitcher.json.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Sławomir Radzymiński",
|