@waitcher/cli 0.2.11 → 0.2.12
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 +131 -54
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -6039,14 +6039,14 @@ var require_connect = __commonJS({
|
|
|
6039
6039
|
const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions);
|
|
6040
6040
|
timeout = timeout == null ? 1e4 : timeout;
|
|
6041
6041
|
allowH2 = allowH2 != null ? allowH2 : true;
|
|
6042
|
-
return function connect2({ hostname:
|
|
6042
|
+
return function connect2({ hostname: hostname4, host, protocol, port, servername, localAddress, httpSocket }, callback) {
|
|
6043
6043
|
let socket;
|
|
6044
6044
|
if (protocol === "https:") {
|
|
6045
6045
|
if (!tls) {
|
|
6046
6046
|
tls = __require("node:tls");
|
|
6047
6047
|
}
|
|
6048
6048
|
servername = servername || options.servername || util.getServerName(host) || null;
|
|
6049
|
-
const sessionKey = servername ||
|
|
6049
|
+
const sessionKey = servername || hostname4;
|
|
6050
6050
|
assert2(sessionKey);
|
|
6051
6051
|
const session = customSession || sessionCache.get(sessionKey) || null;
|
|
6052
6052
|
port = port || 443;
|
|
@@ -6061,7 +6061,7 @@ var require_connect = __commonJS({
|
|
|
6061
6061
|
socket: httpSocket,
|
|
6062
6062
|
// upgrade socket connection
|
|
6063
6063
|
port,
|
|
6064
|
-
host:
|
|
6064
|
+
host: hostname4
|
|
6065
6065
|
});
|
|
6066
6066
|
socket.on("session", function(session2) {
|
|
6067
6067
|
sessionCache.set(sessionKey, session2);
|
|
@@ -6075,16 +6075,16 @@ var require_connect = __commonJS({
|
|
|
6075
6075
|
...options,
|
|
6076
6076
|
localAddress,
|
|
6077
6077
|
port,
|
|
6078
|
-
host:
|
|
6078
|
+
host: hostname4
|
|
6079
6079
|
};
|
|
6080
|
-
const family = net.isIP(
|
|
6081
|
-
if (family !== 0 && servername && servername !==
|
|
6080
|
+
const family = net.isIP(hostname4);
|
|
6081
|
+
if (family !== 0 && servername && servername !== hostname4) {
|
|
6082
6082
|
connectOptions.host = servername;
|
|
6083
6083
|
connectOptions.lookup = (_hostname, lookupOptions, cb) => {
|
|
6084
6084
|
if (lookupOptions.all) {
|
|
6085
|
-
cb(null, [{ address:
|
|
6085
|
+
cb(null, [{ address: hostname4, family }]);
|
|
6086
6086
|
} else {
|
|
6087
|
-
cb(null,
|
|
6087
|
+
cb(null, hostname4, family);
|
|
6088
6088
|
}
|
|
6089
6089
|
};
|
|
6090
6090
|
}
|
|
@@ -6097,7 +6097,7 @@ var require_connect = __commonJS({
|
|
|
6097
6097
|
const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay;
|
|
6098
6098
|
socket.setKeepAlive(true, keepAliveInitialDelay);
|
|
6099
6099
|
}
|
|
6100
|
-
const clearConnectTimeout = util.setupConnectTimeout(new WeakRef(socket), { timeout, hostname:
|
|
6100
|
+
const clearConnectTimeout = util.setupConnectTimeout(new WeakRef(socket), { timeout, hostname: hostname4, port });
|
|
6101
6101
|
socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() {
|
|
6102
6102
|
queueMicrotask(clearConnectTimeout);
|
|
6103
6103
|
if (callback) {
|
|
@@ -6110,7 +6110,7 @@ var require_connect = __commonJS({
|
|
|
6110
6110
|
if (callback) {
|
|
6111
6111
|
const cb = callback;
|
|
6112
6112
|
callback = null;
|
|
6113
|
-
cb(maybeNormalizeConnectError(err, this, { timeout, hostname:
|
|
6113
|
+
cb(maybeNormalizeConnectError(err, this, { timeout, hostname: hostname4, port }));
|
|
6114
6114
|
}
|
|
6115
6115
|
});
|
|
6116
6116
|
return socket;
|
|
@@ -13224,20 +13224,20 @@ var require_client = __commonJS({
|
|
|
13224
13224
|
function connect2(client) {
|
|
13225
13225
|
assert2(!client[kConnecting]);
|
|
13226
13226
|
assert2(!client[kHTTPContext]);
|
|
13227
|
-
let { host, hostname:
|
|
13228
|
-
if (
|
|
13229
|
-
const idx =
|
|
13227
|
+
let { host, hostname: hostname4, protocol, port } = client[kUrl];
|
|
13228
|
+
if (hostname4[0] === "[") {
|
|
13229
|
+
const idx = hostname4.indexOf("]");
|
|
13230
13230
|
assert2(idx !== -1);
|
|
13231
|
-
const ip =
|
|
13231
|
+
const ip = hostname4.substring(1, idx);
|
|
13232
13232
|
assert2(net.isIPv6(ip));
|
|
13233
|
-
|
|
13233
|
+
hostname4 = ip;
|
|
13234
13234
|
}
|
|
13235
13235
|
client[kConnecting] = true;
|
|
13236
13236
|
if (channels.beforeConnect.hasSubscribers) {
|
|
13237
13237
|
channels.beforeConnect.publish({
|
|
13238
13238
|
connectParams: {
|
|
13239
13239
|
host,
|
|
13240
|
-
hostname:
|
|
13240
|
+
hostname: hostname4,
|
|
13241
13241
|
protocol,
|
|
13242
13242
|
port,
|
|
13243
13243
|
version: client[kHTTPContext]?.version,
|
|
@@ -13250,14 +13250,14 @@ var require_client = __commonJS({
|
|
|
13250
13250
|
try {
|
|
13251
13251
|
client[kConnector]({
|
|
13252
13252
|
host,
|
|
13253
|
-
hostname:
|
|
13253
|
+
hostname: hostname4,
|
|
13254
13254
|
protocol,
|
|
13255
13255
|
port,
|
|
13256
13256
|
servername: client[kServerName],
|
|
13257
13257
|
localAddress: client[kLocalAddress]
|
|
13258
13258
|
}, (err, socket) => {
|
|
13259
13259
|
if (err) {
|
|
13260
|
-
handleConnectError(client, err, { host, hostname:
|
|
13260
|
+
handleConnectError(client, err, { host, hostname: hostname4, protocol, port });
|
|
13261
13261
|
client[kResume]();
|
|
13262
13262
|
return;
|
|
13263
13263
|
}
|
|
@@ -13271,7 +13271,7 @@ var require_client = __commonJS({
|
|
|
13271
13271
|
client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket);
|
|
13272
13272
|
} catch (err2) {
|
|
13273
13273
|
socket.destroy().on("error", noop);
|
|
13274
|
-
handleConnectError(client, err2, { host, hostname:
|
|
13274
|
+
handleConnectError(client, err2, { host, hostname: hostname4, protocol, port });
|
|
13275
13275
|
client[kResume]();
|
|
13276
13276
|
return;
|
|
13277
13277
|
}
|
|
@@ -13284,7 +13284,7 @@ var require_client = __commonJS({
|
|
|
13284
13284
|
channels.connected.publish({
|
|
13285
13285
|
connectParams: {
|
|
13286
13286
|
host,
|
|
13287
|
-
hostname:
|
|
13287
|
+
hostname: hostname4,
|
|
13288
13288
|
protocol,
|
|
13289
13289
|
port,
|
|
13290
13290
|
version: client[kHTTPContext]?.version,
|
|
@@ -13299,11 +13299,11 @@ var require_client = __commonJS({
|
|
|
13299
13299
|
client[kResume]();
|
|
13300
13300
|
});
|
|
13301
13301
|
} catch (err) {
|
|
13302
|
-
handleConnectError(client, err, { host, hostname:
|
|
13302
|
+
handleConnectError(client, err, { host, hostname: hostname4, protocol, port });
|
|
13303
13303
|
client[kResume]();
|
|
13304
13304
|
}
|
|
13305
13305
|
}
|
|
13306
|
-
function handleConnectError(client, err, { host, hostname:
|
|
13306
|
+
function handleConnectError(client, err, { host, hostname: hostname4, protocol, port }) {
|
|
13307
13307
|
if (client.destroyed) {
|
|
13308
13308
|
return;
|
|
13309
13309
|
}
|
|
@@ -13312,7 +13312,7 @@ var require_client = __commonJS({
|
|
|
13312
13312
|
channels.connectError.publish({
|
|
13313
13313
|
connectParams: {
|
|
13314
13314
|
host,
|
|
13315
|
-
hostname:
|
|
13315
|
+
hostname: hostname4,
|
|
13316
13316
|
protocol,
|
|
13317
13317
|
port,
|
|
13318
13318
|
version: client[kHTTPContext]?.version,
|
|
@@ -15001,9 +15001,9 @@ var require_socks5_proxy_agent = __commonJS({
|
|
|
15001
15001
|
var kConnectTimeout = /* @__PURE__ */ Symbol("connect timeout");
|
|
15002
15002
|
var kRequestTls = /* @__PURE__ */ Symbol("request tls settings");
|
|
15003
15003
|
var kRequestTlsTimeout = /* @__PURE__ */ Symbol("request tls timeout");
|
|
15004
|
-
function createConnectTimeoutError(
|
|
15004
|
+
function createConnectTimeoutError(hostname4, port, timeout) {
|
|
15005
15005
|
return new ConnectTimeoutError(
|
|
15006
|
-
`Connect Timeout Error (attempted address: ${
|
|
15006
|
+
`Connect Timeout Error (attempted address: ${hostname4}:${port}, timeout: ${timeout}ms)`
|
|
15007
15007
|
);
|
|
15008
15008
|
}
|
|
15009
15009
|
var experimentalWarningEmitted = false;
|
|
@@ -15624,13 +15624,13 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
15624
15624
|
]);
|
|
15625
15625
|
}
|
|
15626
15626
|
#getProxyAgentForUrl(url3) {
|
|
15627
|
-
let { protocol, host:
|
|
15628
|
-
|
|
15629
|
-
if (
|
|
15630
|
-
|
|
15627
|
+
let { protocol, host: hostname4, port } = url3;
|
|
15628
|
+
hostname4 = hostname4.replace(/:\d*$/, "").replace(/^\[(.+)\]$/, "$1").toLowerCase();
|
|
15629
|
+
if (hostname4.length > 1 && hostname4.charCodeAt(hostname4.length - 1) === 46) {
|
|
15630
|
+
hostname4 = hostname4.slice(0, -1);
|
|
15631
15631
|
}
|
|
15632
15632
|
port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0;
|
|
15633
|
-
if (!this.#shouldProxy(
|
|
15633
|
+
if (!this.#shouldProxy(hostname4, port)) {
|
|
15634
15634
|
return this[kNoProxyAgent];
|
|
15635
15635
|
}
|
|
15636
15636
|
if (protocol === "https:") {
|
|
@@ -15638,7 +15638,7 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
15638
15638
|
}
|
|
15639
15639
|
return this[kHttpProxyAgent];
|
|
15640
15640
|
}
|
|
15641
|
-
#shouldProxy(
|
|
15641
|
+
#shouldProxy(hostname4, port) {
|
|
15642
15642
|
if (this.#noProxyChanged) {
|
|
15643
15643
|
this.#parseNoProxy();
|
|
15644
15644
|
}
|
|
@@ -15656,10 +15656,10 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
15656
15656
|
if (entry2.port && entry2.port !== port) {
|
|
15657
15657
|
continue;
|
|
15658
15658
|
}
|
|
15659
|
-
if (!entry2.wildcard &&
|
|
15659
|
+
if (!entry2.wildcard && hostname4 === entry2.hostname) {
|
|
15660
15660
|
return false;
|
|
15661
15661
|
}
|
|
15662
|
-
if (
|
|
15662
|
+
if (hostname4.slice(-(entry2.hostname.length + 1)) === `.${entry2.hostname}`) {
|
|
15663
15663
|
return false;
|
|
15664
15664
|
}
|
|
15665
15665
|
}
|
|
@@ -15674,22 +15674,22 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
15674
15674
|
if (!entry2) {
|
|
15675
15675
|
continue;
|
|
15676
15676
|
}
|
|
15677
|
-
let
|
|
15677
|
+
let hostname4, port;
|
|
15678
15678
|
const ipv6WithPort = entry2.match(/^\[(.+)\]:(\d+)$/);
|
|
15679
15679
|
if (ipv6WithPort) {
|
|
15680
|
-
|
|
15680
|
+
hostname4 = ipv6WithPort[1];
|
|
15681
15681
|
port = Number.parseInt(ipv6WithPort[2], 10);
|
|
15682
15682
|
} else {
|
|
15683
15683
|
const unbracketed = entry2.replace(/^\[(.+)\]$/, "$1");
|
|
15684
15684
|
const colonCount = (unbracketed.match(/:/g) || []).length;
|
|
15685
15685
|
const parsed = colonCount === 1 && unbracketed.match(/^(.+):(\d+)$/);
|
|
15686
|
-
|
|
15686
|
+
hostname4 = parsed ? parsed[1] : unbracketed;
|
|
15687
15687
|
port = parsed ? Number.parseInt(parsed[2], 10) : 0;
|
|
15688
15688
|
}
|
|
15689
15689
|
const wildcard = entry2.charCodeAt(0) === 42;
|
|
15690
15690
|
noProxyEntries.push({
|
|
15691
15691
|
// strip leading dot or asterisk with dot, and any trailing dot
|
|
15692
|
-
hostname:
|
|
15692
|
+
hostname: hostname4.replace(/^\*?\./, "").replace(/^(.+)\.$/, "$1").toLowerCase(),
|
|
15693
15693
|
port,
|
|
15694
15694
|
wildcard
|
|
15695
15695
|
});
|
|
@@ -20390,14 +20390,14 @@ var require_dns = __commonJS({
|
|
|
20390
20390
|
get size() {
|
|
20391
20391
|
return this.#records.size;
|
|
20392
20392
|
}
|
|
20393
|
-
get(
|
|
20394
|
-
return this.#records.get(
|
|
20393
|
+
get(hostname4) {
|
|
20394
|
+
return this.#records.get(hostname4) ?? null;
|
|
20395
20395
|
}
|
|
20396
|
-
set(
|
|
20397
|
-
this.#records.set(
|
|
20396
|
+
set(hostname4, records) {
|
|
20397
|
+
this.#records.set(hostname4, records);
|
|
20398
20398
|
}
|
|
20399
|
-
delete(
|
|
20400
|
-
this.#records.delete(
|
|
20399
|
+
delete(hostname4) {
|
|
20400
|
+
this.#records.delete(hostname4);
|
|
20401
20401
|
}
|
|
20402
20402
|
// Delegate to storage decide can we do more lookups or not
|
|
20403
20403
|
full() {
|
|
@@ -34928,9 +34928,9 @@ var asciiTabOrNewline = /[\t\n\r]/g;
|
|
|
34928
34928
|
function stripTabAndNewline(value2) {
|
|
34929
34929
|
return value2.replace(asciiTabOrNewline, "");
|
|
34930
34930
|
}
|
|
34931
|
-
function urlHostnameOk(url3,
|
|
34932
|
-
|
|
34933
|
-
return
|
|
34931
|
+
function urlHostnameOk(url3, hostname4) {
|
|
34932
|
+
hostname4.lastIndex = 0;
|
|
34933
|
+
return hostname4.test(url3.hostname);
|
|
34934
34934
|
}
|
|
34935
34935
|
function urlProtocolOk(url3, protocol) {
|
|
34936
34936
|
protocol.lastIndex = 0;
|
|
@@ -53231,6 +53231,43 @@ var browserExecutionIdentitySchema = browserIdentityBindingSchema.extend({
|
|
|
53231
53231
|
)
|
|
53232
53232
|
}));
|
|
53233
53233
|
|
|
53234
|
+
// ../../src/contracts/agent.ts
|
|
53235
|
+
var AGENT_LIMITS = Object.freeze({
|
|
53236
|
+
taskChars: 8e3,
|
|
53237
|
+
seconds: { min: 60, max: 600, default: 300 },
|
|
53238
|
+
turns: { min: 1, max: 100, default: 40 },
|
|
53239
|
+
tokens: { min: 1e4, max: 2e6, default: 5e5 },
|
|
53240
|
+
hosts: 10,
|
|
53241
|
+
envNames: 10,
|
|
53242
|
+
// At most four runs a day: every run is a model bill on the customer's key.
|
|
53243
|
+
minInterval: 21600,
|
|
53244
|
+
// A second cold start, for the verifier's fresh microVM.
|
|
53245
|
+
verifierStartSeconds: 60
|
|
53246
|
+
});
|
|
53247
|
+
var hostname3 = external_exports.string().max(253).regex(
|
|
53248
|
+
/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/,
|
|
53249
|
+
"Use a public hostname such as docs.example.com"
|
|
53250
|
+
);
|
|
53251
|
+
var bounded = (limits) => external_exports.number().int().min(limits.min).max(limits.max).default(limits.default);
|
|
53252
|
+
var agentBindingSchema = external_exports.object({
|
|
53253
|
+
runner: external_exports.literal("claude-code").default("claude-code"),
|
|
53254
|
+
connectionId: external_exports.uuid(),
|
|
53255
|
+
configurationRevision: external_exports.number().int().positive(),
|
|
53256
|
+
model: modelNameSchema,
|
|
53257
|
+
task: external_exports.string().trim().min(1).max(AGENT_LIMITS.taskChars),
|
|
53258
|
+
seconds: bounded(AGENT_LIMITS.seconds),
|
|
53259
|
+
turns: bounded(AGENT_LIMITS.turns),
|
|
53260
|
+
tokens: bounded(AGENT_LIMITS.tokens),
|
|
53261
|
+
// Hosts the agent may reach besides the target's and the model's.
|
|
53262
|
+
hosts: external_exports.array(hostname3).max(AGENT_LIMITS.hosts).default([]),
|
|
53263
|
+
// CHECK_* values handed to the agent itself, e.g. a test account's token.
|
|
53264
|
+
envNames: external_exports.array(external_exports.string().regex(/^CHECK_[A-Z0-9_]+$/)).max(AGENT_LIMITS.envNames).default([])
|
|
53265
|
+
}).strict();
|
|
53266
|
+
var agentKeySchema = external_exports.object({
|
|
53267
|
+
key: external_exports.string().min(1).max(1024),
|
|
53268
|
+
model: modelNameSchema
|
|
53269
|
+
}).strict();
|
|
53270
|
+
|
|
53234
53271
|
// ../../src/contracts/monitor.ts
|
|
53235
53272
|
var url2 = external_exports.string().max(2e3).url().refine((value2) => {
|
|
53236
53273
|
try {
|
|
@@ -53266,6 +53303,7 @@ var monitorSchema = external_exports.object({
|
|
|
53266
53303
|
httpAuth: httpAuthSchema.optional(),
|
|
53267
53304
|
protectedRequests: productRequestsPolicySchema.optional(),
|
|
53268
53305
|
browserIdentity: browserIdentityBindingSchema.optional(),
|
|
53306
|
+
agent: agentBindingSchema.optional(),
|
|
53269
53307
|
requestBudget: requestBudgetSchema.optional(),
|
|
53270
53308
|
settings: external_exports.object({
|
|
53271
53309
|
certificateMinDays: external_exports.number().int().min(1).max(90).optional(),
|
|
@@ -53455,6 +53493,29 @@ var monitorSchema = external_exports.object({
|
|
|
53455
53493
|
}
|
|
53456
53494
|
}
|
|
53457
53495
|
}
|
|
53496
|
+
if (m.agent) {
|
|
53497
|
+
if (m.type !== "api" || m.demo || m.ai || m.httpAuth || m.protectedRequests || m.browserIdentity || m.requestBudget)
|
|
53498
|
+
issue3(
|
|
53499
|
+
"An agent check is an API script (the verifier) without other bindings",
|
|
53500
|
+
"agent"
|
|
53501
|
+
);
|
|
53502
|
+
if (m.interval < AGENT_LIMITS.minInterval)
|
|
53503
|
+
issue3(
|
|
53504
|
+
`Agent checks run at most once every ${AGENT_LIMITS.minInterval / 3600} hours`,
|
|
53505
|
+
"interval"
|
|
53506
|
+
);
|
|
53507
|
+
if (m.agent.envNames.some((name5) => !m.settings.envNames.includes(name5)))
|
|
53508
|
+
issue3(
|
|
53509
|
+
"List the agent's CHECK_* names in settings.envNames too",
|
|
53510
|
+
"agent"
|
|
53511
|
+
);
|
|
53512
|
+
try {
|
|
53513
|
+
const u = new URL(m.target);
|
|
53514
|
+
if (u.protocol !== "https:" || u.port && u.port !== "443")
|
|
53515
|
+
issue3("Agent checks need a public HTTPS target on port 443", "target");
|
|
53516
|
+
} catch {
|
|
53517
|
+
}
|
|
53518
|
+
}
|
|
53458
53519
|
if (m.browserIdentity && (m.type !== "browser" || m.httpAuth))
|
|
53459
53520
|
issue3(
|
|
53460
53521
|
"Browser identities require a browser script without HTTP credentials",
|
|
@@ -53504,6 +53565,12 @@ var monitorDefinitionSchema = monitorSchema.safeExtend({
|
|
|
53504
53565
|
path: ["schemaVersion"],
|
|
53505
53566
|
message: "Project context requires schemaVersion 2"
|
|
53506
53567
|
});
|
|
53568
|
+
if (m.agent && m.schemaVersion !== 2)
|
|
53569
|
+
ctx.addIssue({
|
|
53570
|
+
code: "custom",
|
|
53571
|
+
path: ["agent"],
|
|
53572
|
+
message: "Agent checks require schemaVersion 2"
|
|
53573
|
+
});
|
|
53507
53574
|
if (m.ai && m.schemaVersion !== 2)
|
|
53508
53575
|
ctx.addIssue({
|
|
53509
53576
|
code: "custom",
|
|
@@ -55870,6 +55937,8 @@ var ACCOUNT_PLANS = Object.freeze({
|
|
|
55870
55937
|
scriptMonitors: 1,
|
|
55871
55938
|
scriptMinInterval: 7200,
|
|
55872
55939
|
scriptDailyRuns: 12,
|
|
55940
|
+
// Agent checks (docs/AGENT-CHECKS.md), each a script monitor too.
|
|
55941
|
+
agentChecks: 0,
|
|
55873
55942
|
// Days evidence files and run history are kept (docs/STORAGE.md).
|
|
55874
55943
|
artifactDays: 7,
|
|
55875
55944
|
historyDays: 14
|
|
@@ -55881,6 +55950,7 @@ var ACCOUNT_PLANS = Object.freeze({
|
|
|
55881
55950
|
scriptMonitors: 5,
|
|
55882
55951
|
scriptMinInterval: 300,
|
|
55883
55952
|
scriptDailyRuns: 480,
|
|
55953
|
+
agentChecks: 1,
|
|
55884
55954
|
artifactDays: 30,
|
|
55885
55955
|
historyDays: 30
|
|
55886
55956
|
}),
|
|
@@ -55894,6 +55964,7 @@ var ACCOUNT_PLANS = Object.freeze({
|
|
|
55894
55964
|
scriptMonitors: 5,
|
|
55895
55965
|
scriptMinInterval: 300,
|
|
55896
55966
|
scriptDailyRuns: 480,
|
|
55967
|
+
agentChecks: 1,
|
|
55897
55968
|
artifactDays: 30,
|
|
55898
55969
|
historyDays: 30
|
|
55899
55970
|
}),
|
|
@@ -55905,6 +55976,7 @@ var ACCOUNT_PLANS = Object.freeze({
|
|
|
55905
55976
|
scriptMonitors: 25,
|
|
55906
55977
|
scriptMinInterval: 120,
|
|
55907
55978
|
scriptDailyRuns: 2500,
|
|
55979
|
+
agentChecks: 5,
|
|
55908
55980
|
artifactDays: 30,
|
|
55909
55981
|
historyDays: 30
|
|
55910
55982
|
})
|
|
@@ -55916,7 +55988,9 @@ var PRO_PRICES_USD = Object.freeze({ month: 12, year: 120 });
|
|
|
55916
55988
|
var BUSINESS_PRICES_USD = Object.freeze({ month: 49, year: 490 });
|
|
55917
55989
|
var PAID_PLANS = ["pro", "business"];
|
|
55918
55990
|
var billingCheckoutSchema = external_exports.object({
|
|
55919
|
-
|
|
55991
|
+
// Checkout defaults to monthly; a running subscription keeps its own
|
|
55992
|
+
// interval unless one is given.
|
|
55993
|
+
interval: external_exports.enum(["month", "year"]).optional(),
|
|
55920
55994
|
plan: external_exports.enum(PAID_PLANS).default("pro"),
|
|
55921
55995
|
trial: external_exports.boolean().default(false)
|
|
55922
55996
|
}).strict();
|
|
@@ -57494,12 +57568,12 @@ async function certificateCheck(monitor, parentSignal, io = transport, sink = {}
|
|
|
57494
57568
|
]);
|
|
57495
57569
|
try {
|
|
57496
57570
|
signal.throwIfAborted();
|
|
57497
|
-
const url3 = certificateTarget(monitor.target),
|
|
57571
|
+
const url3 = certificateTarget(monitor.target), hostname4 = url3.hostname;
|
|
57498
57572
|
const lookupStarted = performance3.now();
|
|
57499
57573
|
const addresses = await new Promise((resolve18, reject) => {
|
|
57500
57574
|
const abort = () => reject(new Error("Certificate check cancelled or timed out"));
|
|
57501
57575
|
signal.addEventListener("abort", abort, { once: true });
|
|
57502
|
-
io.lookup(
|
|
57576
|
+
io.lookup(hostname4, { all: true, verbatim: true }).then(resolve18, reject).finally(() => signal.removeEventListener("abort", abort));
|
|
57503
57577
|
if (signal.aborted) abort();
|
|
57504
57578
|
});
|
|
57505
57579
|
signal.throwIfAborted();
|
|
@@ -57521,7 +57595,7 @@ async function certificateCheck(monitor, parentSignal, io = transport, sink = {}
|
|
|
57521
57595
|
const socket = io.connect({
|
|
57522
57596
|
host: addresses[0].address,
|
|
57523
57597
|
port: 443,
|
|
57524
|
-
servername:
|
|
57598
|
+
servername: hostname4,
|
|
57525
57599
|
rejectUnauthorized: true,
|
|
57526
57600
|
minVersion: "TLSv1.2"
|
|
57527
57601
|
});
|
|
@@ -57534,7 +57608,7 @@ async function certificateCheck(monitor, parentSignal, io = transport, sink = {}
|
|
|
57534
57608
|
done = true;
|
|
57535
57609
|
sink.trace = certificateTrace(
|
|
57536
57610
|
socket,
|
|
57537
|
-
|
|
57611
|
+
hostname4,
|
|
57538
57612
|
addresses[0].address,
|
|
57539
57613
|
timings,
|
|
57540
57614
|
rejected
|
|
@@ -61153,13 +61227,13 @@ var authoring_default = '# Authoring and running monitors\n\nRead when writing o
|
|
|
61153
61227
|
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";
|
|
61154
61228
|
|
|
61155
61229
|
// ../../skills/waitcher/references/deploy.md
|
|
61156
|
-
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
|
|
61230
|
+
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 follow their plan: checks every 30 minutes on starter, 5 on pro and 1 on business at the shortest; script monitors have a count, a shortest interval and runs a day that the running schedules must fit together (starter: one, every 2 hours or slower). Read `limits.minInterval` and `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`. On a personal account only the first monitor\'s smoke starts (one manual run per 10 minutes); the rest are `skipped`, which is not a failure.\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';
|
|
61157
61231
|
|
|
61158
61232
|
// ../../skills/waitcher/references/diagnosis.md
|
|
61159
61233
|
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";
|
|
61160
61234
|
|
|
61161
61235
|
// ../../skills/waitcher/references/optional-capabilities.md
|
|
61162
|
-
var optional_capabilities_default = "# Optional capabilities\n\nRead only when capabilities report the feature and the user needs it: visual baselines, signed-in browser identities, verified HTTP credentials and invocation budgets. AI endpoints, agent outcome checks, model steps and protected requests are in [ai-and-agents](ai-and-agents.md).\n\n## Optional visual checks\n\nDiscover `features.visual` for authoring and `features.visualReview` for baseline inspection; `features.isolatedVisual` identifies the default-off personal capture lane, independent of script/AI admission. Start with `monitor init --type visual --target https://product.example --file visual.json`, edit the fixed page/element checkpoint, viewport, readiness, masks and thresholds, then `monitor validate --file visual.json` and `monitor apply --file visual.json --dry-run`. Apply paused; an authorized `run start --id ID --wait` is a separate action. Visual monitors accept no script, model binding, session identity or custom request credential. Fixed visual baseline execution is not supported by `run local`; local API/browser script evidence does not establish a visual baseline.\n\nThe first capture needs baseline review; its `missing_baseline` result is missing coverage, not a product failure. Inspect `visual list`, `visual get --id COMPARISON_ID`, `visual heads --id MONITOR_ID`, `visual artifacts --id COMPARISON_ID` and `visual image --id COMPARISON_ID --role candidate|original|diff --file NEW_PRIVATE_PATH`. Review actual images and metrics before an authorized `visual approve --id COMPARISON_ID --expected-revision SELECTED_REVISION`; an initial selection uses 0. Restore only a reviewed retained baseline with `visual restore --id HEAD_ID --baseline-id BASELINE_ID --expected-revision CURRENT_HEAD_REVISION`. Stale decisions conflict: reload instead of retrying or changing revisions blindly. Approval preserves the historical result. Changed capture fingerprints need their own baseline. Foreign-owner/read-only refusals are boundaries, not reasons to switch credentials. Screenshots are private evidence; masks cover selected pixels only. Use actual `visual` and `run` help for current flags and capabilities.\n\n## Optional browser test-account identity\n\nFor a signed-in browser journey, discover hosted `features.browserIdentities` before configuring `identity create/rotate/enable/disable/delete`. Supply bounded cookies/localStorage through a private `--state-file`; metadata is scoped to one verified exact origin, project/environment and explicit expiry. State is write-only and cannot be exported. New identities default disabled; enable explicitly and bind the resulting current `{identityId, revision}` under `browserIdentity` in a version-2 browser manifest with explicit context. Rename, state replacement and enable/disable advance revisions; inspect current metadata and deliberately rebind rather than silently upgrading. After an uncertain write inspect metadata before retrying. No running Chrome profile is imported.\n\nRun the same manifest account-free with `run local --file MONITOR --runtime RUNTIME --browser-identities-file PRIVATE_MAP`. The map is `{schemaVersion:1,identities:[{identityId,revision,projectId,environmentId,origin,expiresAt,stateFile}]}`; state paths resolve relative to the map. Both map/state are private regular JSON files (chmod 600), no symlinks/hard links or inline state. Exact IDs/revision/scope/origin and bounded future expiry must match. Local mappings do not attest hosted target verification or revocation. The optional model map remains separate. Hosted identity-backed runs use the isolated lane for all owners; local code remains trusted. The selected script receives its own session and signed-in page content can reach private evidence or optional AI providers. Never promise pixel/encoded-secret masking. Use dedicated test accounts and inspect coverage errors after expiry/revocation before repeating a possibly completed action.\n\n## Verified HTTP credentials\n\nFor an authenticated HTTP or AI endpoint, use the user's owned verified HTTPS origin and an `httpAuth` reference (`targetId`, `credentialId`, `credentialRevision`). Check `features.httpTargets` before hosted configuration. Create/renew a target challenge with `target create` or `target challenge`, writing it to a new private `--output`; never print the token. The user publishes the supplied proof at `/.well-known/waitcher-verification.txt`, then `target verify` checks it without credentials. Verification expires after 24 hours and must be renewed. An origin excludes paths, query and fragments and is immutable.\n\nUse `target credential create/rotate` with non-secret metadata JSON plus `--credential-file` (mode 600) or `--credential-stdin`. Headers are limited to `Authorization` or `X-Api-Key`; values are complete single-line ASCII header values up to 4096 bytes. For Bearer auth, include the `Bearer ` prefix in the private value. Keys are write-only and encrypted on the server. The monitor and export retain references only. Rotation advances the credential revision; update the monitor binding explicitly. Disabled, expired, foreign or stale bindings fail without forwarding a request. Authenticated redirects are never followed.\n\nFor local execution without the app or account, pass `run local --file monitor.json --http-credentials-file private/http-map.json`. The private map is `{schemaVersion:1,credentials:[{targetId,credentialId,credentialRevision,origin,header,credentialFile}]}` and the referenced private file contains the raw header value. Paths resolve relative to the map. Never inline a key or reuse the CLI's own account cookie/token as a target credential. The local resolver requires exactly matching IDs, revision and canonical origin, and the shared runner enforces the single supported header and redirect policy. Local mapping does not prove that the hosted target is still verified or its key current. Keep the same manifest as the hosted monitor; only local key resolution differs. HTTP local checks need no E2E runtime. Use explicit user authorization for POST fixtures that change state.\n\n## Hosted endpoint invocation budgets\n\nBefore running dedicated AI endpoints or HTTP checks with `httpAuth`, read `account invocations` for the account/monitor UTC-day counters and limits. The manifest accepts `requestBudget: {dailyInvocations: N}` (default 50, maximum 1,000). Configure the owner cap with `account budget --daily-invocations N --expected-revision CURRENT_REVISION` only when authorized; personal accounts cap at 200, administrators at 5,000, and the controller also has a global 5,000 cap. Validate/apply/export do not charge calls.\n\n`INVOCATION_BUDGET_EXHAUSTED` is a coverage error: no request was dispatched and no product incident is created. Do not automatically retry or raise a limit to bypass it. Completed and uncertain dispatched calls consume budget, independent of product success or worker-reported usage. Local execution needs no account, preserves the setting and makes at most one endpoint call per fixture case, but does not enforce or consume the hosted daily ledger. After backup restore, `window.restoreHeld` blocks these checks until the next UTC reset because snapshot counters may be stale; do not bypass the hold by raising caps. These are request counts, separate from model-broker token/call caps and downstream provider spending. Inspect `account invocations` and the current `account` help for the hosted accounting contract.\n";
|
|
61236
|
+
var optional_capabilities_default = "# Optional capabilities\n\nRead only when capabilities report the feature and the user needs it: visual baselines, signed-in browser identities, verified HTTP credentials and invocation budgets. AI endpoints, agent outcome checks, model steps and protected requests are in [ai-and-agents](ai-and-agents.md).\n\n## Optional visual checks\n\nDiscover `features.visual` for authoring and `features.visualReview` for baseline inspection; `features.isolatedVisual` identifies the default-off personal capture lane, independent of script/AI admission. Start with `monitor init --type visual --target https://product.example --file visual.json`, edit the fixed page/element checkpoint, viewport, readiness, masks and thresholds, then `monitor validate --file visual.json` and `monitor apply --file visual.json --dry-run`. Apply paused; an authorized `run start --id ID --wait` is a separate action. Visual monitors accept no script, model binding, session identity or custom request credential. Fixed visual baseline execution is not supported by `run local`; local API/browser script evidence does not establish a visual baseline.\n\nThe first capture needs baseline review; its `missing_baseline` result is missing coverage, not a product failure. Inspect `visual list`, `visual get --id COMPARISON_ID`, `visual heads --id MONITOR_ID`, `visual artifacts --id COMPARISON_ID` and `visual image --id COMPARISON_ID --role candidate|original|diff --file NEW_PRIVATE_PATH`. Review actual images and metrics before an authorized `visual approve --id COMPARISON_ID --expected-revision SELECTED_REVISION`; an initial selection uses 0. Restore only a reviewed retained baseline with `visual restore --id HEAD_ID --baseline-id BASELINE_ID --expected-revision CURRENT_HEAD_REVISION`. Stale decisions conflict: reload instead of retrying or changing revisions blindly. Approval preserves the historical result. Changed capture fingerprints need their own baseline. Foreign-owner/read-only refusals are boundaries, not reasons to switch credentials. Screenshots are private evidence; masks cover selected pixels only. Use actual `visual` and `run` help for current flags and capabilities.\n\n## Optional browser test-account identity\n\nFor a signed-in browser journey, discover hosted `features.browserIdentities` before configuring `identity create/rotate/enable/disable/delete`. Supply bounded cookies/localStorage through a private `--state-file`; metadata is scoped to one verified exact origin, project/environment and explicit expiry. State is write-only and cannot be exported. New identities default disabled; enable explicitly and bind the resulting current `{identityId, revision}` under `browserIdentity` in a version-2 browser manifest with explicit context. Rename, state replacement and enable/disable advance revisions; inspect current metadata and deliberately rebind rather than silently upgrading. After an uncertain write inspect metadata before retrying. No running Chrome profile is imported.\n\nRun the same manifest account-free with `run local --file MONITOR --runtime RUNTIME --browser-identities-file PRIVATE_MAP`. The map is `{schemaVersion:1,identities:[{identityId,revision,projectId,environmentId,origin,expiresAt,stateFile}]}`; state paths resolve relative to the map. Both map/state are private regular JSON files (chmod 600), no symlinks/hard links or inline state. Exact IDs/revision/scope/origin and bounded future expiry must match. Local mappings do not attest hosted target verification or revocation. The optional model map remains separate. Hosted identity-backed runs use the isolated lane for all owners; local code remains trusted. The selected script receives its own session and signed-in page content can reach private evidence or optional AI providers. Never promise pixel/encoded-secret masking. Use dedicated test accounts and inspect coverage errors after expiry/revocation before repeating a possibly completed action.\n\n## Verified HTTP credentials\n\nFor an authenticated HTTP or AI endpoint, use the user's owned verified HTTPS origin and an `httpAuth` reference (`targetId`, `credentialId`, `credentialRevision`). Check `features.httpTargets` before hosted configuration. Create/renew a target challenge with `target create` or `target challenge`, writing it to a new private `--output`; never print the token. The user publishes the supplied proof at `/.well-known/waitcher-verification.txt`, then `target verify` checks it without credentials. Verification expires after 24 hours and must be renewed. An origin excludes paths, query and fragments and is immutable.\n\nUse `target credential create/rotate` with non-secret metadata JSON plus `--credential-file` (mode 600) or `--credential-stdin`. Headers are limited to `Authorization` or `X-Api-Key`; values are complete single-line ASCII header values up to 4096 bytes. For Bearer auth, include the `Bearer ` prefix in the private value. Keys are write-only and encrypted on the server. The monitor and export retain references only. Rotation advances the credential revision; update the monitor binding explicitly. Disabled, expired, foreign or stale bindings fail without forwarding a request. Authenticated redirects are never followed.\n\nFor local execution without the app or account, pass `run local --file monitor.json --http-credentials-file private/http-map.json`. The private map is `{schemaVersion:1,credentials:[{targetId,credentialId,credentialRevision,origin,header,credentialFile}]}` and the referenced private file contains the raw header value. Paths resolve relative to the map. Never inline a key or reuse the CLI's own account cookie/token as a target credential. The local resolver requires exactly matching IDs, revision and canonical origin, and the shared runner enforces the single supported header and redirect policy. Local mapping does not prove that the hosted target is still verified or its key current. Keep the same manifest as the hosted monitor; only local key resolution differs. HTTP local checks need no E2E runtime. Use explicit user authorization for POST fixtures that change state.\n\n## Hosted endpoint invocation budgets\n\nBefore running dedicated AI endpoints or HTTP checks with `httpAuth`, read `account invocations` for the account/monitor UTC-day counters and limits. The manifest accepts `requestBudget: {dailyInvocations: N}` (default 50, maximum 1,000). Configure the owner cap with `account budget --daily-invocations N --expected-revision CURRENT_REVISION` only when authorized; personal accounts cap at 200, administrators at 5,000, and the controller also has a global 5,000 cap. Validate/apply/export do not charge calls.\n\n`INVOCATION_BUDGET_EXHAUSTED` is a coverage error: no request was dispatched and no product incident is created. Do not automatically retry or raise a limit to bypass it. Completed and uncertain dispatched calls consume budget, independent of product success or worker-reported usage. Local execution needs no account, preserves the setting and makes at most one endpoint call per fixture case, but does not enforce or consume the hosted daily ledger. After backup restore, `window.restoreHeld` blocks these checks until the next UTC reset because snapshot counters may be stale; do not bypass the hold by raising caps. These are request counts, separate from model-broker token/call caps and downstream provider spending. Inspect `account invocations` and the current `account` help for the hosted accounting contract.\n\n## Agent checks\n\nWhen `features.agentChecks` is true, an `api` entry may carry an `agent` block: Claude Code works on `task` in a sandbox, then the entry's script verifies the product's state ([guide](https://waitcher.dev/docs/agent-checks.md)). It needs a model connection in the entry's project environment (`connection create`, OpenRouter, the key from a private file) and fields `connectionId`, `configurationRevision`, `model`, `task`, optionally `seconds`, `turns`, `tokens`, `hosts` and `envNames` (a subset of `settings.envNames`). Read `limits.agentChecks` for the plan's count and bounds; the interval is at least 6 hours. Write the task as a user would say it and never put a secret in it. The verifier must reset the test account it checks. Ask before creating a connection: it stores the user's key and every run is billed to it.\n";
|
|
61163
61237
|
|
|
61164
61238
|
// ../../skills/waitcher/agents/openai.yaml
|
|
61165
61239
|
var openai_default = 'interface:\n display_name: "Waitcher"\n short_description: "Deploy monitoring from a repository and inspect evidence"\n default_prompt: "Use $waitcher to set up monitoring for this repository: pick the critical journeys, verify them locally and deploy them paused through a reviewed plan."\n';
|
|
@@ -62246,6 +62320,9 @@ Monitor configuration
|
|
|
62246
62320
|
Structured submit/observe/verify/cleanup results; incomplete coverage is error
|
|
62247
62321
|
No AI binding required; edit paths/fixture for a disposable test namespace
|
|
62248
62322
|
Optional CHECK_* env auth works local/admin only; generated file has none
|
|
62323
|
+
Agent checks: an api definition or waitcher.json entry with an "agent" block runs Claude
|
|
62324
|
+
Code on its task first, then the script verifies the outcome (features.agentChecks;
|
|
62325
|
+
https://waitcher.dev/docs/agent-checks.md).
|
|
62249
62326
|
monitor validate --file PATH Validate locally, including scriptFile
|
|
62250
62327
|
monitor build --file PATH --output NEW_DIR [--project PROJECT]
|
|
62251
62328
|
Bundle project helpers into one portable monitor script
|
|
@@ -62587,7 +62664,7 @@ ${exitCodes}
|
|
|
62587
62664
|
// package.json
|
|
62588
62665
|
var package_default = {
|
|
62589
62666
|
name: "@waitcher/cli",
|
|
62590
|
-
version: "0.2.
|
|
62667
|
+
version: "0.2.12",
|
|
62591
62668
|
description: "Synthetic monitoring from your repository: deploy HTTP, certificate, heartbeat, API and browser monitors from waitcher.json.",
|
|
62592
62669
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
62593
62670
|
author: "S\u0142awomir Radzymi\u0144ski",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waitcher/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
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",
|