@wayai/cli 0.3.48 → 0.3.49
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 +106 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -343,6 +343,16 @@ var init_api_client = __esm({
|
|
|
343
343
|
if (opts?.limit) params.set("limit", String(opts.limit));
|
|
344
344
|
return this.request("GET", `/api/evals/sessions/${sessionId}/runs?${params.toString()}`);
|
|
345
345
|
}
|
|
346
|
+
/** Delete a single eval session (cascades runs/results/conversations server-side). */
|
|
347
|
+
async deleteEvalSession(hubId, sessionId) {
|
|
348
|
+
const params = new URLSearchParams({ hub_id: hubId });
|
|
349
|
+
return this.request("DELETE", `/api/evals/sessions/${sessionId}?${params.toString()}`);
|
|
350
|
+
}
|
|
351
|
+
/** Delete ALL eval sessions for a hub (each cascades server-side). */
|
|
352
|
+
async deleteAllEvalSessions(hubId) {
|
|
353
|
+
const params = new URLSearchParams({ hub_id: hubId });
|
|
354
|
+
return this.request("DELETE", `/api/evals/sessions?${params.toString()}`);
|
|
355
|
+
}
|
|
346
356
|
async listScenarioSets(hubId) {
|
|
347
357
|
const params = new URLSearchParams({ hub_id: hubId });
|
|
348
358
|
return this.request("GET", `/api/evals/scenario-sets?${params.toString()}`);
|
|
@@ -12200,6 +12210,80 @@ var init_journey_capture = __esm({
|
|
|
12200
12210
|
}
|
|
12201
12211
|
});
|
|
12202
12212
|
|
|
12213
|
+
// src/commands/eval-session-delete.ts
|
|
12214
|
+
var eval_session_delete_exports = {};
|
|
12215
|
+
__export(eval_session_delete_exports, {
|
|
12216
|
+
evalSessionDeleteCommand: () => evalSessionDeleteCommand
|
|
12217
|
+
});
|
|
12218
|
+
async function evalSessionDeleteCommand(args2) {
|
|
12219
|
+
const hubId = resolveActiveHubId(args2);
|
|
12220
|
+
const { config, accessToken } = await requireAuth();
|
|
12221
|
+
requireRepoConfig();
|
|
12222
|
+
const skipConfirm = args2.includes("-y") || args2.includes("--yes");
|
|
12223
|
+
const deleteAll = args2.includes("--all");
|
|
12224
|
+
const sessionId = args2.find((a) => !a.startsWith("-"));
|
|
12225
|
+
if (deleteAll && sessionId) {
|
|
12226
|
+
console.error("Pass either a session id or --all, not both.");
|
|
12227
|
+
process.exit(1);
|
|
12228
|
+
}
|
|
12229
|
+
if (!deleteAll && !sessionId) {
|
|
12230
|
+
console.error("Usage: wayai eval session delete <session_id>");
|
|
12231
|
+
console.error(" wayai eval session delete --all");
|
|
12232
|
+
process.exit(1);
|
|
12233
|
+
}
|
|
12234
|
+
if (sessionId && !UUID_RE.test(sessionId)) {
|
|
12235
|
+
console.error(`Invalid session id: ${sessionId}`);
|
|
12236
|
+
process.exit(1);
|
|
12237
|
+
}
|
|
12238
|
+
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
12239
|
+
if (deleteAll) {
|
|
12240
|
+
if (!skipConfirm) {
|
|
12241
|
+
const confirmed = await confirm(
|
|
12242
|
+
"This will permanently delete ALL eval sessions on this hub and their conversations. Continue?"
|
|
12243
|
+
);
|
|
12244
|
+
if (!confirmed) {
|
|
12245
|
+
console.log("Aborted.");
|
|
12246
|
+
return;
|
|
12247
|
+
}
|
|
12248
|
+
}
|
|
12249
|
+
const result = await client.deleteAllEvalSessions(hubId);
|
|
12250
|
+
console.log(
|
|
12251
|
+
`Deleted ${result.data.deleted_sessions} session(s) and ${result.data.deleted_conversations} eval conversation(s).`
|
|
12252
|
+
);
|
|
12253
|
+
return;
|
|
12254
|
+
}
|
|
12255
|
+
if (!skipConfirm) {
|
|
12256
|
+
const confirmed = await confirm(
|
|
12257
|
+
"This will permanently delete this eval session and its conversations. Continue?"
|
|
12258
|
+
);
|
|
12259
|
+
if (!confirmed) {
|
|
12260
|
+
console.log("Aborted.");
|
|
12261
|
+
return;
|
|
12262
|
+
}
|
|
12263
|
+
}
|
|
12264
|
+
try {
|
|
12265
|
+
const result = await client.deleteEvalSession(hubId, sessionId);
|
|
12266
|
+
const deletedConversations = result.data?.deleted_conversations ?? 0;
|
|
12267
|
+
console.log(`Deleted session ${sessionId} (${deletedConversations} eval conversation(s)).`);
|
|
12268
|
+
} catch (err) {
|
|
12269
|
+
if (err instanceof ApiError && err.status === 404) {
|
|
12270
|
+
console.error(`Eval session not found: ${sessionId}`);
|
|
12271
|
+
process.exit(1);
|
|
12272
|
+
}
|
|
12273
|
+
throw err;
|
|
12274
|
+
}
|
|
12275
|
+
}
|
|
12276
|
+
var init_eval_session_delete = __esm({
|
|
12277
|
+
"src/commands/eval-session-delete.ts"() {
|
|
12278
|
+
"use strict";
|
|
12279
|
+
init_auth();
|
|
12280
|
+
init_repo_config();
|
|
12281
|
+
init_workspace();
|
|
12282
|
+
init_api_client();
|
|
12283
|
+
init_utils();
|
|
12284
|
+
}
|
|
12285
|
+
});
|
|
12286
|
+
|
|
12203
12287
|
// src/commands/eval.ts
|
|
12204
12288
|
var eval_exports = {};
|
|
12205
12289
|
__export(eval_exports, {
|
|
@@ -12229,6 +12313,18 @@ async function evalCommand(args2) {
|
|
|
12229
12313
|
process.exit(1);
|
|
12230
12314
|
return;
|
|
12231
12315
|
}
|
|
12316
|
+
case "session": {
|
|
12317
|
+
const [sessionSub, ...sessionRest] = rest;
|
|
12318
|
+
if (sessionSub === "delete") {
|
|
12319
|
+
const { evalSessionDeleteCommand: evalSessionDeleteCommand2 } = await Promise.resolve().then(() => (init_eval_session_delete(), eval_session_delete_exports));
|
|
12320
|
+
await evalSessionDeleteCommand2(sessionRest);
|
|
12321
|
+
return;
|
|
12322
|
+
}
|
|
12323
|
+
console.error(`Unknown eval session subcommand: ${sessionSub ?? "(none)"}`);
|
|
12324
|
+
printHelp();
|
|
12325
|
+
process.exit(1);
|
|
12326
|
+
return;
|
|
12327
|
+
}
|
|
12232
12328
|
case "help":
|
|
12233
12329
|
case "--help":
|
|
12234
12330
|
case "-h":
|
|
@@ -12252,6 +12348,9 @@ Subcommands:
|
|
|
12252
12348
|
exchange as a scenario YAML in evals/.
|
|
12253
12349
|
journey capture <conversation_id> Capture a real conversation's FULL
|
|
12254
12350
|
transcript as a platform-managed journey.
|
|
12351
|
+
session delete <session_id> Delete one eval session (and its
|
|
12352
|
+
conversations). Destructive, irreversible.
|
|
12353
|
+
session delete --all Delete every eval session on the hub.
|
|
12255
12354
|
|
|
12256
12355
|
Capture flags (scenario):
|
|
12257
12356
|
--set <name> Scenario set folder (created if missing). Default: "Default".
|
|
@@ -12262,10 +12361,16 @@ Journey capture flags:
|
|
|
12262
12361
|
--name <journey_name> Journey name. Default: derived from conversation ID.
|
|
12263
12362
|
--instructions <text> Default evaluator instructions for the journey's steps.
|
|
12264
12363
|
|
|
12364
|
+
Session delete flags:
|
|
12365
|
+
--all Delete ALL sessions on the hub instead of one.
|
|
12366
|
+
-y, --yes Skip the confirmation prompt.
|
|
12367
|
+
|
|
12265
12368
|
Examples:
|
|
12266
12369
|
wayai eval capture 11111111-2222-3333-4444-555555555555
|
|
12267
12370
|
wayai eval capture <conv_id> --set regression-suite --name "Cancel order"
|
|
12268
12371
|
wayai eval journey capture <conv_id> --name "Refund happy path"
|
|
12372
|
+
wayai eval session delete 11111111-2222-3333-4444-555555555555
|
|
12373
|
+
wayai eval session delete --all -y
|
|
12269
12374
|
|
|
12270
12375
|
Authoring evals (create/update/delete) is file-driven \u2014 edit YAML in
|
|
12271
12376
|
evals/ and run \`wayai push\`. Capture commands are for production replay only.
|
|
@@ -17525,6 +17630,7 @@ Commands:
|
|
|
17525
17630
|
run-eval Run all enabled evals and show results
|
|
17526
17631
|
eval-results View results from a completed eval session
|
|
17527
17632
|
eval capture Capture a real conversation as a scenario YAML
|
|
17633
|
+
eval session delete Delete one eval session (\`--all\` for every session on the hub)
|
|
17528
17634
|
sync-skills Sync skills to Anthropic/OpenAI provider connections
|
|
17529
17635
|
sync-mcp Re-discover an MCP connection's tools (refresh stale schemas)
|
|
17530
17636
|
list List organizations and hubs
|