@wayai/cli 0.3.48 → 0.3.50

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 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()}`);
@@ -11980,6 +11990,12 @@ async function showRunDetails(client, hubId, sessionId, evalNameFilter, jsonOutp
11980
11990
  const scoresStr = Object.entries(run.scores).map(([key, val]) => `${key}: ${Math.round(val * 100)}%`).join(", ");
11981
11991
  console.log(` Scores: ${scoresStr}`);
11982
11992
  }
11993
+ const obsParts = [];
11994
+ if (run.response_message_id) obsParts.push(`evaluated=${run.response_message_id}`);
11995
+ if (run.evaluator_message_id) obsParts.push(`evaluator=${run.evaluator_message_id}`);
11996
+ if (obsParts.length > 0 && run.conversation_id) {
11997
+ console.log(` Observability: conversation=${run.conversation_id} ${obsParts.join(" ")}`);
11998
+ }
11983
11999
  console.log("");
11984
12000
  }
11985
12001
  if (!anyComment) {
@@ -12200,6 +12216,80 @@ var init_journey_capture = __esm({
12200
12216
  }
12201
12217
  });
12202
12218
 
12219
+ // src/commands/eval-session-delete.ts
12220
+ var eval_session_delete_exports = {};
12221
+ __export(eval_session_delete_exports, {
12222
+ evalSessionDeleteCommand: () => evalSessionDeleteCommand
12223
+ });
12224
+ async function evalSessionDeleteCommand(args2) {
12225
+ const hubId = resolveActiveHubId(args2);
12226
+ const { config, accessToken } = await requireAuth();
12227
+ requireRepoConfig();
12228
+ const skipConfirm = args2.includes("-y") || args2.includes("--yes");
12229
+ const deleteAll = args2.includes("--all");
12230
+ const sessionId = args2.find((a) => !a.startsWith("-"));
12231
+ if (deleteAll && sessionId) {
12232
+ console.error("Pass either a session id or --all, not both.");
12233
+ process.exit(1);
12234
+ }
12235
+ if (!deleteAll && !sessionId) {
12236
+ console.error("Usage: wayai eval session delete <session_id>");
12237
+ console.error(" wayai eval session delete --all");
12238
+ process.exit(1);
12239
+ }
12240
+ if (sessionId && !UUID_RE.test(sessionId)) {
12241
+ console.error(`Invalid session id: ${sessionId}`);
12242
+ process.exit(1);
12243
+ }
12244
+ const client = new ApiClient({ apiUrl: config.api_url, accessToken });
12245
+ if (deleteAll) {
12246
+ if (!skipConfirm) {
12247
+ const confirmed = await confirm(
12248
+ "This will permanently delete ALL eval sessions on this hub and their conversations. Continue?"
12249
+ );
12250
+ if (!confirmed) {
12251
+ console.log("Aborted.");
12252
+ return;
12253
+ }
12254
+ }
12255
+ const result = await client.deleteAllEvalSessions(hubId);
12256
+ console.log(
12257
+ `Deleted ${result.data.deleted_sessions} session(s) and ${result.data.deleted_conversations} eval conversation(s).`
12258
+ );
12259
+ return;
12260
+ }
12261
+ if (!skipConfirm) {
12262
+ const confirmed = await confirm(
12263
+ "This will permanently delete this eval session and its conversations. Continue?"
12264
+ );
12265
+ if (!confirmed) {
12266
+ console.log("Aborted.");
12267
+ return;
12268
+ }
12269
+ }
12270
+ try {
12271
+ const result = await client.deleteEvalSession(hubId, sessionId);
12272
+ const deletedConversations = result.data?.deleted_conversations ?? 0;
12273
+ console.log(`Deleted session ${sessionId} (${deletedConversations} eval conversation(s)).`);
12274
+ } catch (err) {
12275
+ if (err instanceof ApiError && err.status === 404) {
12276
+ console.error(`Eval session not found: ${sessionId}`);
12277
+ process.exit(1);
12278
+ }
12279
+ throw err;
12280
+ }
12281
+ }
12282
+ var init_eval_session_delete = __esm({
12283
+ "src/commands/eval-session-delete.ts"() {
12284
+ "use strict";
12285
+ init_auth();
12286
+ init_repo_config();
12287
+ init_workspace();
12288
+ init_api_client();
12289
+ init_utils();
12290
+ }
12291
+ });
12292
+
12203
12293
  // src/commands/eval.ts
12204
12294
  var eval_exports = {};
12205
12295
  __export(eval_exports, {
@@ -12229,6 +12319,18 @@ async function evalCommand(args2) {
12229
12319
  process.exit(1);
12230
12320
  return;
12231
12321
  }
12322
+ case "session": {
12323
+ const [sessionSub, ...sessionRest] = rest;
12324
+ if (sessionSub === "delete") {
12325
+ const { evalSessionDeleteCommand: evalSessionDeleteCommand2 } = await Promise.resolve().then(() => (init_eval_session_delete(), eval_session_delete_exports));
12326
+ await evalSessionDeleteCommand2(sessionRest);
12327
+ return;
12328
+ }
12329
+ console.error(`Unknown eval session subcommand: ${sessionSub ?? "(none)"}`);
12330
+ printHelp();
12331
+ process.exit(1);
12332
+ return;
12333
+ }
12232
12334
  case "help":
12233
12335
  case "--help":
12234
12336
  case "-h":
@@ -12252,6 +12354,9 @@ Subcommands:
12252
12354
  exchange as a scenario YAML in evals/.
12253
12355
  journey capture <conversation_id> Capture a real conversation's FULL
12254
12356
  transcript as a platform-managed journey.
12357
+ session delete <session_id> Delete one eval session (and its
12358
+ conversations). Destructive, irreversible.
12359
+ session delete --all Delete every eval session on the hub.
12255
12360
 
12256
12361
  Capture flags (scenario):
12257
12362
  --set <name> Scenario set folder (created if missing). Default: "Default".
@@ -12262,10 +12367,16 @@ Journey capture flags:
12262
12367
  --name <journey_name> Journey name. Default: derived from conversation ID.
12263
12368
  --instructions <text> Default evaluator instructions for the journey's steps.
12264
12369
 
12370
+ Session delete flags:
12371
+ --all Delete ALL sessions on the hub instead of one.
12372
+ -y, --yes Skip the confirmation prompt.
12373
+
12265
12374
  Examples:
12266
12375
  wayai eval capture 11111111-2222-3333-4444-555555555555
12267
12376
  wayai eval capture <conv_id> --set regression-suite --name "Cancel order"
12268
12377
  wayai eval journey capture <conv_id> --name "Refund happy path"
12378
+ wayai eval session delete 11111111-2222-3333-4444-555555555555
12379
+ wayai eval session delete --all -y
12269
12380
 
12270
12381
  Authoring evals (create/update/delete) is file-driven \u2014 edit YAML in
12271
12382
  evals/ and run \`wayai push\`. Capture commands are for production replay only.
@@ -17525,6 +17636,7 @@ Commands:
17525
17636
  run-eval Run all enabled evals and show results
17526
17637
  eval-results View results from a completed eval session
17527
17638
  eval capture Capture a real conversation as a scenario YAML
17639
+ eval session delete Delete one eval session (\`--all\` for every session on the hub)
17528
17640
  sync-skills Sync skills to Anthropic/OpenAI provider connections
17529
17641
  sync-mcp Re-discover an MCP connection's tools (refresh stale schemas)
17530
17642
  list List organizations and hubs