@moda-ai/cli 1.40.0 → 1.41.0

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.
@@ -5595,7 +5595,7 @@ async function runPromptAb(flags, profileOptions, context) {
5595
5595
  const baselineSource = flags.baseline || flags["baseline-file"] || flags["baseline-key"];
5596
5596
  const candidateSource = flags.candidate || flags["candidate-file"] || flags["candidate-key"];
5597
5597
  if (!baselineSource || !candidateSource) {
5598
- throw new Error("Usage: moda prompts ab --baseline=<file|key> --candidate=<file|key> [--auto-generate [--cases=1-100]|--set-id=ID|--traces=id1,id2 (max 100)] [--seeds=1-10] [--model=<slug>] [--yes] (legacy alias: --conversations=)");
5598
+ throw new Error("Usage: moda prompts ab --baseline=<file|key> --candidate=<file|key> [--auto-generate [--cases=1-100]|--set-id=ID|--traces=id1,id2[@msg_index] (max 100)] [--seeds=1-10] [--model=<slug>] [--yes] (legacy alias: --conversations=)");
5599
5599
  }
5600
5600
  assertArmSourceShape(baselineSource, "baseline");
5601
5601
  assertArmSourceShape(candidateSource, "candidate");
@@ -5877,6 +5877,12 @@ async function ensureReplaySet(plan, flags, tenantId, profileOptions) {
5877
5877
  }
5878
5878
  return generated.id;
5879
5879
  }
5880
+ function parseTraceRef(ref) {
5881
+ const match = /^(.+)@(\d+)$/.exec(ref.trim());
5882
+ if (!match)
5883
+ return { conversationId: ref.trim() };
5884
+ return { conversationId: match[1], startMsgIndex: Number(match[2]) };
5885
+ }
5880
5886
  async function createSetFromConversations(conversationIds, flags, tenantId, profileOptions) {
5881
5887
  const name = (flags.name ?? flags["set-name"] ?? `Prompt A/B ${conversationIds.length} trace(s)`).trim();
5882
5888
  const created = await callControlAPI(`/tenants/${encodeURIComponent(tenantId)}/replay-sets`, {
@@ -5884,7 +5890,8 @@ async function createSetFromConversations(conversationIds, flags, tenantId, prof
5884
5890
  body: JSON.stringify({ name, description: "Created by moda prompts ab" })
5885
5891
  }, profileOptions);
5886
5892
  let position = 0;
5887
- for (const conversationId of conversationIds) {
5893
+ for (const ref of conversationIds) {
5894
+ const { conversationId, startMsgIndex } = parseTraceRef(ref);
5888
5895
  const scenario = await loadScenarioFromConversation(conversationId);
5889
5896
  await callControlAPI(`/tenants/${encodeURIComponent(tenantId)}/replay-sets/${encodeURIComponent(created.id)}/cases`, {
5890
5897
  method: "POST",
@@ -5892,6 +5899,7 @@ async function createSetFromConversations(conversationIds, flags, tenantId, prof
5892
5899
  title: conversationId,
5893
5900
  scenario,
5894
5901
  sourceConversationId: conversationId,
5902
+ ...startMsgIndex !== undefined ? { sourceStartMsgIndex: startMsgIndex } : {},
5895
5903
  successCriteria: [
5896
5904
  "The agent understands the user request",
5897
5905
  "The agent uses tools appropriately when needed",
package/dist/cli.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  runPromptsCommand,
9
9
  runSkillsCommand,
10
10
  runStatusCommand
11
- } from "./cli-w9an3j54.js";
11
+ } from "./cli-pr6s56fc.js";
12
12
  import {
13
13
  ApiError,
14
14
  HARNESS_REPORT_APPROVAL_PATH,
@@ -7296,6 +7296,7 @@ Examples:
7296
7296
  moda prompts sync
7297
7297
  moda prompts promote support.triage --label=prod --version=pver_abc123
7298
7298
  moda prompts ab --baseline=prompts/agent.prompt.md --candidate=prompts/agent-v2.prompt.md --traces=conv_1,conv_2
7299
+ moda prompts ab --baseline=prompts/agent.prompt.md --candidate=prompts/agent-v2.prompt.md --traces=conv_1@412 # replay from msg 412
7299
7300
  moda skills pull
7300
7301
  moda fixes
7301
7302
  moda fix start <problem_id> --wait
@@ -9168,7 +9169,7 @@ var commandRegistry = createCommandRegistry([
9168
9169
  resetApiRequestCountBeforeRun: true,
9169
9170
  telemetry: "result",
9170
9171
  handler: async (context) => {
9171
- const { runInit } = await import("./index-1pb2ftqr.js");
9172
+ const { runInit } = await import("./index-ah6yf5x2.js");
9172
9173
  if (context.outputMode === "agent-stream") {
9173
9174
  context.output.writeEvent({
9174
9175
  event: "started",
@@ -3,7 +3,7 @@ import {
3
3
  initPrompts,
4
4
  runPromptSync,
5
5
  runSkillSync
6
- } from "./cli-w9an3j54.js";
6
+ } from "./cli-pr6s56fc.js";
7
7
  import {
8
8
  codingAgentDisplayName,
9
9
  describeCodingAgentEvent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moda-ai/cli",
3
- "version": "1.40.0",
3
+ "version": "1.41.0",
4
4
  "description": "CLI for Moda - AI agent analytics and observability",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema_version": "moda.skill_index.v1",
3
- "bundled_at": "2026-10-09T00:19:17.944Z",
4
- "cli_version": "1.40.0",
3
+ "bundled_at": "2026-10-09T01:07:28.008Z",
4
+ "cli_version": "1.41.0",
5
5
  "skills": [
6
6
  {
7
7
  "id": "integration-cloudflare-think",
@@ -759,7 +759,9 @@ anything they compute planned playouts (cases × seeds × 2 arms) and print it
759
759
  (`plannedPlayouts`). Above 200, or when an existing set's case count can't be
760
760
  read, they fail (exit 1) with the number and the exact command to re-run with `--yes`.
761
761
  Only add `--yes` when the user has agreed to that spend. Limits: `--cases`
762
- default 5, max 100; `--seeds` default 3, max 10; `--traces` at most 100;
762
+ default 5, max 100; `--seeds` default 3, max 10; `--traces` at most 100
763
+ (`--traces=conv_id@412` replays that trace from msg_index 412, with the
764
+ earlier turns as history);
763
765
  `--model` / `--assistant-model` must be one of `openai/gpt-5.6-luna`,
764
766
  `openai/gpt-4o-mini`, `openai/gpt-4o`, `anthropic/claude-sonnet-4-5`,
765
767
  `anthropic/claude-haiku-4-5`, `google/gemini-2.5-flash`,