@wayai/cli 0.3.160 → 0.3.161
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/index.js +4 -80
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8117,14 +8117,6 @@ var init_contracts = __esm({
|
|
|
8117
8117
|
* accepts it; this exposes it on the route.
|
|
8118
8118
|
*/
|
|
8119
8119
|
harness_enabled: external_exports.number().int().min(0).max(1).optional(),
|
|
8120
|
-
/**
|
|
8121
|
-
* The ConversationDO `runTurn` TurnState conversion gate (refactor #4 Tier 3,
|
|
8122
|
-
* `turn/` Step A). 0 = off (the RETAINED pre-conversion turn body runs), 1 = on (the
|
|
8123
|
-
* converted `TurnState` body runs). Default-deny, and the reader fails CLOSED — a
|
|
8124
|
-
* platform-config read error also runs the retained body. Both bodies stay compiled in
|
|
8125
|
-
* while this flag is live, so a change to either is a change to both.
|
|
8126
|
-
*/
|
|
8127
|
-
turn_state_enabled: external_exports.number().int().min(0).max(1).optional(),
|
|
8128
8120
|
/**
|
|
8129
8121
|
* Default eval-session retention window in days, used by every hub that sets no
|
|
8130
8122
|
* `eval_retention_days` override. `0` disables eval retention platform-wide.
|
|
@@ -9085,14 +9077,13 @@ var init_api_client = __esm({
|
|
|
9085
9077
|
async adminRepairLegacyOrgGrants(body) {
|
|
9086
9078
|
return this.request("POST", "/api/admin/organizations/repair-legacy-grants", body);
|
|
9087
9079
|
}
|
|
9088
|
-
// Read the platform config (platform-admin gated). Used by
|
|
9089
|
-
//
|
|
9080
|
+
// Read the platform config (platform-admin gated). Used by `wayai admin harness
|
|
9081
|
+
// status` — grep `PlatformGate` in `commands/admin.ts` for the gates it serves.
|
|
9090
9082
|
async adminGetConfig() {
|
|
9091
9083
|
return this.request("GET", "/api/admin/config");
|
|
9092
9084
|
}
|
|
9093
9085
|
// Patch the platform config (platform-admin gated). Used by every `wayai admin
|
|
9094
|
-
// <gate> disable|enable` — `harness` flips `harness_enabled
|
|
9095
|
-
// `turn_state_enabled`.
|
|
9086
|
+
// <gate> disable|enable` — `harness` flips `harness_enabled`.
|
|
9096
9087
|
async adminUpdateConfig(body) {
|
|
9097
9088
|
return this.request("PATCH", "/api/admin/config", body);
|
|
9098
9089
|
}
|
|
@@ -13855,14 +13846,6 @@ var init_dist = __esm({
|
|
|
13855
13846
|
* accepts it; this exposes it on the route.
|
|
13856
13847
|
*/
|
|
13857
13848
|
harness_enabled: external_exports.number().int().min(0).max(1).optional(),
|
|
13858
|
-
/**
|
|
13859
|
-
* The ConversationDO `runTurn` TurnState conversion gate (refactor #4 Tier 3,
|
|
13860
|
-
* `turn/` Step A). 0 = off (the RETAINED pre-conversion turn body runs), 1 = on (the
|
|
13861
|
-
* converted `TurnState` body runs). Default-deny, and the reader fails CLOSED — a
|
|
13862
|
-
* platform-config read error also runs the retained body. Both bodies stay compiled in
|
|
13863
|
-
* while this flag is live, so a change to either is a change to both.
|
|
13864
|
-
*/
|
|
13865
|
-
turn_state_enabled: external_exports.number().int().min(0).max(1).optional(),
|
|
13866
13849
|
/**
|
|
13867
13850
|
* Default eval-session retention window in days, used by every hub that sets no
|
|
13868
13851
|
* `eval_retention_days` override. `0` disables eval retention platform-wide.
|
|
@@ -25854,26 +25837,6 @@ async function adminCommand(args2) {
|
|
|
25854
25837
|
process.exit(1);
|
|
25855
25838
|
}
|
|
25856
25839
|
}
|
|
25857
|
-
if (group === "turn-state") {
|
|
25858
|
-
if (!sub) {
|
|
25859
|
-
printHelp2();
|
|
25860
|
-
process.exit(1);
|
|
25861
|
-
}
|
|
25862
|
-
switch (sub) {
|
|
25863
|
-
case "disable":
|
|
25864
|
-
await runTurnStateToggle(false, flagArgs);
|
|
25865
|
-
return;
|
|
25866
|
-
case "enable":
|
|
25867
|
-
await runTurnStateToggle(true, flagArgs);
|
|
25868
|
-
return;
|
|
25869
|
-
case "status":
|
|
25870
|
-
await runPlatformGateStatus(TURN_STATE_GATE, flagArgs);
|
|
25871
|
-
return;
|
|
25872
|
-
default:
|
|
25873
|
-
printHelp2();
|
|
25874
|
-
process.exit(1);
|
|
25875
|
-
}
|
|
25876
|
-
}
|
|
25877
25840
|
printHelp2();
|
|
25878
25841
|
process.exit(1);
|
|
25879
25842
|
}
|
|
@@ -26504,24 +26467,6 @@ async function runHarnessToggle(enable, flagArgs) {
|
|
|
26504
26467
|
console.log("Next: run `wayai admin harness mass-destroy --all --dry-run` to see what is still live, then reap it.");
|
|
26505
26468
|
}
|
|
26506
26469
|
}
|
|
26507
|
-
async function runTurnStateToggle(enable, flagArgs) {
|
|
26508
|
-
rejectPlatformGateFlags(TURN_STATE_GATE, "enable|disable", flagArgs);
|
|
26509
|
-
const value = await patchPlatformGate(TURN_STATE_GATE, enable);
|
|
26510
|
-
if (value === void 0) {
|
|
26511
|
-
console.error("PATCH /api/admin/config returned no turn_state_enabled value \u2014 the flag state is UNKNOWN.");
|
|
26512
|
-
console.error("Run `wayai admin turn-state status` to read what the platform config now holds.");
|
|
26513
|
-
process.exit(1);
|
|
26514
|
-
}
|
|
26515
|
-
const state = value ? "ENABLED" : "DISABLED";
|
|
26516
|
-
console.log(`TurnState conversion ${state} platform-wide (turn_state_enabled=${value}).`);
|
|
26517
|
-
if (value) {
|
|
26518
|
-
console.log("New turns run the converted TurnState body (runTurnWithState) once the platform-config cache clears \u2014 up to ~60s.");
|
|
26519
|
-
console.log("Roll back with `wayai admin turn-state disable` \u2014 the retained body stays compiled in while this flag is live.");
|
|
26520
|
-
} else {
|
|
26521
|
-
console.log("New turns run the RETAINED pre-conversion body (runTurnRetained) \u2014 the fail-closed default \u2014 once the platform-config cache clears, up to ~60s.");
|
|
26522
|
-
}
|
|
26523
|
-
console.log("Turns already in flight finish on the body they picked at entry.");
|
|
26524
|
-
}
|
|
26525
26470
|
function requireFlagValue(flagArgs, index, flag) {
|
|
26526
26471
|
const v = flagArgs[index];
|
|
26527
26472
|
if (v === void 0 || v === "" || v.startsWith("--")) {
|
|
@@ -26962,10 +26907,6 @@ Usage:
|
|
|
26962
26907
|
wayai admin harness mass-destroy --all | --org <org_id> | --hub <hub_id> [--dry-run] [--yes] [--json]
|
|
26963
26908
|
Reap every live harness sandbox/token/slot in scope (run --dry-run first to see the blast radius)
|
|
26964
26909
|
|
|
26965
|
-
wayai admin turn-state disable Flip the platform turn_state_enabled flag OFF (new turns run the RETAINED pre-conversion body \u2014 the fail-closed default)
|
|
26966
|
-
wayai admin turn-state enable Flip the platform turn_state_enabled flag ON (new turns run the converted TurnState body)
|
|
26967
|
-
wayai admin turn-state status Print the platform turn_state_enabled flag
|
|
26968
|
-
|
|
26969
26910
|
Sources:
|
|
26970
26911
|
do Live DO SQLite (existing conversation, hub config, etc.).
|
|
26971
26912
|
analytics ClickHouse projections (conversation, message, schedule_event).
|
|
@@ -27023,15 +26964,6 @@ Sources:
|
|
|
27023
26964
|
sandbox/token/slot that is live NOW (scope: --hub < --org < --all, prefer
|
|
27024
26965
|
the narrowest). Run \`mass-destroy --dry-run\` first to see the blast
|
|
27025
26966
|
radius. See docs/runbooks/harness-incident-response.md.
|
|
27026
|
-
turn-state The ConversationDO TurnState conversion gate. \`disable\`/\`enable\` flip the
|
|
27027
|
-
single PLATFORM-wide turn_state_enabled flag; \`status\` prints it. That one
|
|
27028
|
-
flag picks which turn body runs: OFF (default-deny, fail-closed \u2014 a
|
|
27029
|
-
platform-config read error lands here too) runs the RETAINED pre-conversion
|
|
27030
|
-
body, ON runs the converted TurnState body. Both stay compiled in while the
|
|
27031
|
-
flag is live, so \`disable\` is the rollback. The turn reads the flag at
|
|
27032
|
-
entry through the platform-config KV cache this write invalidates, so a
|
|
27033
|
-
flip propagates in up to ~60s, and a turn already in flight finishes on the
|
|
27034
|
-
body it picked.
|
|
27035
26967
|
|
|
27036
26968
|
Types (do): ${VALID_TYPES.join(" | ")}
|
|
27037
26969
|
Tables (analytics): ${VALID_ANALYTICS_TABLES.join(" | ")}
|
|
@@ -27061,9 +26993,6 @@ Examples:
|
|
|
27061
26993
|
wayai admin harness mass-destroy --all --dry-run
|
|
27062
26994
|
wayai admin harness mass-destroy --hub <hub-id> --yes
|
|
27063
26995
|
wayai admin harness enable
|
|
27064
|
-
wayai admin turn-state status
|
|
27065
|
-
wayai admin turn-state enable
|
|
27066
|
-
wayai admin turn-state disable
|
|
27067
26996
|
|
|
27068
26997
|
Audit + rate limit:
|
|
27069
26998
|
Every successful read is logged as admin_debug_read (queryable in Grafana
|
|
@@ -27071,7 +27000,7 @@ Audit + rate limit:
|
|
|
27071
27000
|
across all sources. Platform-admin grant required.
|
|
27072
27001
|
`.trim());
|
|
27073
27002
|
}
|
|
27074
|
-
var VALID_TYPES, VALID_ANALYTICS_TABLES, HARNESS_GATE,
|
|
27003
|
+
var VALID_TYPES, VALID_ANALYTICS_TABLES, HARNESS_GATE, VALID_NOTICE_SEVERITIES;
|
|
27075
27004
|
var init_admin = __esm({
|
|
27076
27005
|
"src/commands/admin.ts"() {
|
|
27077
27006
|
"use strict";
|
|
@@ -27091,11 +27020,6 @@ var init_admin = __esm({
|
|
|
27091
27020
|
key: "harness_enabled",
|
|
27092
27021
|
label: "harness rollout gate"
|
|
27093
27022
|
};
|
|
27094
|
-
TURN_STATE_GATE = {
|
|
27095
|
-
group: "turn-state",
|
|
27096
|
-
key: "turn_state_enabled",
|
|
27097
|
-
label: "TurnState conversion gate"
|
|
27098
|
-
};
|
|
27099
27023
|
VALID_NOTICE_SEVERITIES = ["critical", "warn", "info"];
|
|
27100
27024
|
}
|
|
27101
27025
|
});
|