@moda-ai/cli 1.43.0 → 1.43.2

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.
@@ -25,7 +25,7 @@ import {
25
25
  resolveTenantId,
26
26
  shouldInventoryFile,
27
27
  stringOption
28
- } from "./cli-rp912ypf.js";
28
+ } from "./cli-8c60k2p4.js";
29
29
  import {
30
30
  __commonJS,
31
31
  __require,
@@ -184813,7 +184813,7 @@ async function runHarnessCommand(context) {
184813
184813
  throw new CliInputError("Focused remote prompt analysis is not supported yet.", "Use local --analyst=claude|codex|cursor|local-scan, or drop --concern for a full remote report.");
184814
184814
  }
184815
184815
  if (context.flags["github-actions"] === "true") {
184816
- const { runGithubActionsAnalyze } = await import("./harness-github-actions-1qt4sgxd.js");
184816
+ const { runGithubActionsAnalyze } = await import("./harness-github-actions-pg0azf3h.js");
184817
184817
  const result = await runGithubActionsAnalyze(rootDir, {
184818
184818
  writeReport: (report2) => {
184819
184819
  const normalized = normalizeHarnessReport(report2);
@@ -1213,7 +1213,7 @@ function createCliOutput(options) {
1213
1213
  if (options.quiet || state.terminal)
1214
1214
  return;
1215
1215
  const agentError = errorToAgentError(error);
1216
- const envelope = createAgentErrorEnvelope(options.command || "unknown", agentError, state.runId);
1216
+ const envelope = createAgentErrorEnvelope(options.command || "unknown", agentError, state.runId, errorWarnings(error));
1217
1217
  if (options.mode === "agent-stream") {
1218
1218
  ensureStarted();
1219
1219
  if (error instanceof CliInputRequiredError) {
@@ -1315,11 +1315,16 @@ function agentEnvelopeFits(command, data, options = {}) {
1315
1315
  const envelope = createAgentEnvelope({ command, status: "ok", data, ...options });
1316
1316
  return !envelope.truncation && Buffer.byteLength(JSON.stringify(envelope), "utf8") <= maxBytes;
1317
1317
  }
1318
- function createAgentErrorEnvelope(command, error, runId) {
1318
+ function errorWarnings(error) {
1319
+ const warnings = error?.warnings;
1320
+ return Array.isArray(warnings) && warnings.length ? warnings.filter((w) => typeof w === "string") : undefined;
1321
+ }
1322
+ function createAgentErrorEnvelope(command, error, runId, warnings) {
1319
1323
  return createAgentEnvelope({
1320
1324
  command,
1321
1325
  status: "error",
1322
1326
  data: null,
1327
+ warnings: warnings ?? [],
1323
1328
  meta: runId ? { run_id: runId } : undefined,
1324
1329
  summary: {
1325
1330
  text: error.message,
@@ -13,7 +13,7 @@ import {
13
13
  resolvePromptSource,
14
14
  safePromptEvidencePath,
15
15
  scanHarness
16
- } from "./cli-xsmsjny3.js";
16
+ } from "./cli-5tsqk3jt.js";
17
17
  import {
18
18
  SKILL_SOURCE_HARNESS,
19
19
  SKILL_SOURCE_INTEGRATION_BUNDLED,
@@ -26,9 +26,11 @@ import {
26
26
  import {
27
27
  isAuthSessionValid,
28
28
  loadAuthSession
29
- } from "./cli-dyeywy9d.js";
29
+ } from "./cli-rycpwqzm.js";
30
30
  import {
31
31
  CliInputError,
32
+ EXIT_ERROR,
33
+ EXIT_OK,
32
34
  createCommandContext,
33
35
  ensureSecretFilePermissions,
34
36
  getActiveProfile,
@@ -43,7 +45,7 @@ import {
43
45
  resolveTenantId,
44
46
  secretFilePathFromRef,
45
47
  validateConfig
46
- } from "./cli-rp912ypf.js";
48
+ } from "./cli-8c60k2p4.js";
47
49
  import {
48
50
  __commonJS,
49
51
  __require,
@@ -5638,62 +5640,73 @@ async function runPromptAb(flags, profileOptions, context) {
5638
5640
  `);
5639
5641
  }
5640
5642
  const writeOptions = warnings.length ? { warnings } : undefined;
5641
- const enqueue = await callControlAPI(`/tenants/${encodeURIComponent(tenantId)}/replay-sets/${encodeURIComponent(replaySetId)}/run`, {
5642
- method: "POST",
5643
- body: JSON.stringify({
5644
- promptArms,
5645
- seedsPerCase,
5646
- assistantModel: assistantModel || undefined,
5647
- promotePrimary: flags.promote === "true" && flags["no-promote"] !== "true",
5648
- ...plan.kind === "existing" ? replayCasePin(plan.caseIds) : {}
5649
- })
5650
- }, profileOptions, { timeoutMs: 120000, retries: 0 });
5651
- if (context.outputMode === "human")
5652
- warnIfQueued(enqueue);
5653
- const noWait = flags.wait === "false" || flags["no-wait"] === "true";
5654
- if (noWait) {
5655
- context.output.writeData({
5643
+ try {
5644
+ const enqueue = await callControlAPI(`/tenants/${encodeURIComponent(tenantId)}/replay-sets/${encodeURIComponent(replaySetId)}/run`, {
5645
+ method: "POST",
5646
+ body: JSON.stringify({
5647
+ promptArms,
5648
+ seedsPerCase,
5649
+ assistantModel: assistantModel || undefined,
5650
+ promotePrimary: flags.promote === "true" && flags["no-promote"] !== "true",
5651
+ ...plan.kind === "existing" ? replayCasePin(plan.caseIds) : {}
5652
+ })
5653
+ }, profileOptions, { timeoutMs: 120000, retries: 0 });
5654
+ if (context.outputMode === "human")
5655
+ warnIfQueued(enqueue);
5656
+ const noWait = flags.wait === "false" || flags["no-wait"] === "true";
5657
+ if (noWait) {
5658
+ context.output.writeData({
5659
+ replaySetId,
5660
+ ...caseSources ? { caseSources } : {},
5661
+ ...warnings.length ? { warnings } : {},
5662
+ runId: enqueue.runId,
5663
+ status: enqueue.status,
5664
+ message: enqueue.message ?? "Replay comparison queued",
5665
+ plannedPlayouts
5666
+ }, writeOptions);
5667
+ return EXIT_OK;
5668
+ }
5669
+ const deadline = Date.now() + timeoutMs;
5670
+ let latest = null;
5671
+ while (Date.now() < deadline) {
5672
+ latest = await fetchLatestRun(tenantId, replaySetId, enqueue.runId, profileOptions);
5673
+ const status = latest.run?.status ?? "";
5674
+ const runId = latest.run?.runId ?? "";
5675
+ if (TERMINAL_RUN_STATUSES.has(status) && runId === enqueue.runId) {
5676
+ break;
5677
+ }
5678
+ if (context.outputMode === "human") {
5679
+ process.stderr.write(`Waiting for replay run (${waitLabel(latest.run)})...
5680
+ `);
5681
+ }
5682
+ await sleep(pollIntervalMs);
5683
+ }
5684
+ if (!latest?.run || latest.run.runId !== enqueue.runId || !TERMINAL_RUN_STATUSES.has(latest.run.status)) {
5685
+ throw new Error(`Timed out after ${timeoutMs}ms waiting for replay run ${enqueue.runId} to finish`);
5686
+ }
5687
+ const result = {
5656
5688
  replaySetId,
5657
5689
  ...caseSources ? { caseSources } : {},
5658
- runId: enqueue.runId,
5659
- status: enqueue.status,
5660
- message: enqueue.message ?? "Replay comparison queued",
5661
- plannedPlayouts
5662
- }, writeOptions);
5663
- return;
5664
- }
5665
- const deadline = Date.now() + timeoutMs;
5666
- let latest = null;
5667
- while (Date.now() < deadline) {
5668
- latest = await fetchLatestRun(tenantId, replaySetId, enqueue.runId, profileOptions);
5669
- const status = latest.run?.status ?? "";
5670
- const runId = latest.run?.runId ?? "";
5671
- if (TERMINAL_RUN_STATUSES.has(status) && runId === enqueue.runId) {
5672
- break;
5673
- }
5690
+ ...warnings.length ? { warnings } : {},
5691
+ plannedPlayouts,
5692
+ runId: latest.run.runId,
5693
+ status: latest.run.status,
5694
+ verdict: formatVerdict(latest),
5695
+ run: { ...latest.run },
5696
+ cases: latest.cases.map((row) => ({ ...row }))
5697
+ };
5674
5698
  if (context.outputMode === "human") {
5675
- process.stderr.write(`Waiting for replay run (${waitLabel(latest.run)})...
5676
- `);
5699
+ printHumanVerdict(result);
5677
5700
  }
5678
- await sleep(pollIntervalMs);
5679
- }
5680
- if (!latest?.run || latest.run.runId !== enqueue.runId || !TERMINAL_RUN_STATUSES.has(latest.run.status)) {
5681
- throw new Error(`Timed out after ${timeoutMs}ms waiting for replay run ${enqueue.runId} to finish`);
5682
- }
5683
- const result = {
5684
- replaySetId,
5685
- ...caseSources ? { caseSources } : {},
5686
- plannedPlayouts,
5687
- runId: latest.run.runId,
5688
- status: latest.run.status,
5689
- verdict: formatVerdict(latest),
5690
- run: { ...latest.run },
5691
- cases: latest.cases.map((row) => ({ ...row }))
5692
- };
5693
- if (context.outputMode === "human") {
5694
- printHumanVerdict(result);
5701
+ const failed = result.status === "error";
5702
+ context.output.writeData(result, { ...writeOptions, ...failed ? { status: "error" } : {} });
5703
+ return failed ? EXIT_ERROR : EXIT_OK;
5704
+ } catch (error) {
5705
+ if (warnings.length && error && typeof error === "object") {
5706
+ Object.assign(error, { warnings });
5707
+ }
5708
+ throw error;
5695
5709
  }
5696
- context.output.writeData(result, writeOptions);
5697
5710
  }
5698
5711
  function warnIfQueued(enqueue) {
5699
5712
  const { runsAhead, maxActiveRuns } = enqueue;
@@ -5955,7 +5968,7 @@ async function createSetFromTraces(conversationIds, flags, tenantId, profileOpti
5955
5968
  }
5956
5969
  const warnings = [];
5957
5970
  if (fallback.length) {
5958
- const why = unavailable ? `Moda could not distill these traces (${unavailable.slice(0, 200)})` : "Moda could not distill a scenario for these traces";
5971
+ const why = unavailable ? `Moda could not distill these traces (${unavailable.slice(0, 600)})` : "Moda could not distill a scenario for these traces";
5959
5972
  warnings.push(`${why}, so ${fallback.length} of ${traces.length} case(s) use only the opening user message and three generic ` + `success criteria, which long traces pass easily: ${fallback.slice(0, 10).join(", ")}${fallback.length > 10 ? ", …" : ""}. ` + "Edit their scenario/criteria in the dashboard, or pass --set-id with a curated set.");
5960
5973
  }
5961
5974
  return { setId: set.id, caseSources: { distilled, fallback }, warnings };
@@ -6599,8 +6612,7 @@ async function runPromptsCommand(input, legacyFlags, legacyProfileOptions) {
6599
6612
  await promotePrompt(positionals, flags, profileOptions, context);
6600
6613
  break;
6601
6614
  case "ab":
6602
- await runPromptAb(flags, profileOptions, context);
6603
- break;
6615
+ return runPromptAb(flags, profileOptions, context);
6604
6616
  case "propose":
6605
6617
  await runPromptPropose(positionals, flags, profileOptions, context);
6606
6618
  break;
@@ -6615,6 +6627,7 @@ async function runPromptsCommand(input, legacyFlags, legacyProfileOptions) {
6615
6627
  default:
6616
6628
  throw new Error(`Unknown prompts command '${subcommand}'. Use init, status, diff, sync, promote, ab, propose, list, show, proposals, usage, replay-runs, or decide.`);
6617
6629
  }
6630
+ return 0;
6618
6631
  }
6619
6632
  async function initPrompts(options = {}) {
6620
6633
  const cwd = process.cwd();
@@ -6698,7 +6711,7 @@ async function runPromptSyncExclusive(flags, profileOptions, options) {
6698
6711
  const analyzedDefinitions = new Map;
6699
6712
  if (flags["no-analyze"] !== "true") {
6700
6713
  options.onProgress?.("Analyzing prompt sources before sync.");
6701
- const { analyzeHarnessPrompts } = await import("./harness-191xt7bq.js");
6714
+ const { analyzeHarnessPrompts } = await import("./harness-sqngqjrd.js");
6702
6715
  const result = await analyzeHarnessPrompts({
6703
6716
  rootDir: process.cwd(),
6704
6717
  existing: established.flatMap((prompt) => prompt.sourceDefinition ? [prompt.sourceDefinition.source] : []),
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  authFetch,
3
3
  getCachedLoginContext
4
- } from "./cli-dyeywy9d.js";
4
+ } from "./cli-rycpwqzm.js";
5
5
  import {
6
6
  CliAccessError,
7
7
  CliInputError,
@@ -15,7 +15,7 @@ import {
15
15
  resolveTenantIdFromActiveProfile,
16
16
  saveCliConfig,
17
17
  writeSecretJsonFile
18
- } from "./cli-rp912ypf.js";
18
+ } from "./cli-8c60k2p4.js";
19
19
 
20
20
  // src/init/tenant.ts
21
21
  import { randomUUID } from "node:crypto";
@@ -7,7 +7,7 @@ import {
7
7
  saveProfileConfig,
8
8
  secretFilePathFromRef,
9
9
  writeSecretJsonFile
10
- } from "./cli-rp912ypf.js";
10
+ } from "./cli-8c60k2p4.js";
11
11
  import {
12
12
  __require
13
13
  } from "./cli-0v6na3yp.js";
package/dist/cli.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  runPromptsCommand,
9
9
  runSkillsCommand,
10
10
  runStatusCommand
11
- } from "./cli-ecrx32mm.js";
11
+ } from "./cli-ewerh7e2.js";
12
12
  import {
13
13
  ApiError,
14
14
  HARNESS_REPORT_APPROVAL_PATH,
@@ -37,7 +37,7 @@ import {
37
37
  terminalStyles,
38
38
  unknownSignalsSubcommandError,
39
39
  validateHarnessReport
40
- } from "./cli-xsmsjny3.js";
40
+ } from "./cli-5tsqk3jt.js";
41
41
  import"./cli-ssfq84k5.js";
42
42
  import {
43
43
  authFetch,
@@ -46,7 +46,7 @@ import {
46
46
  loadAuthSession,
47
47
  login,
48
48
  revokeCliSessionToken
49
- } from "./cli-dyeywy9d.js";
49
+ } from "./cli-rycpwqzm.js";
50
50
  import {
51
51
  AGENT_ERROR_CODES,
52
52
  CliAccessError,
@@ -95,7 +95,7 @@ import {
95
95
  validateConfig,
96
96
  wasOutputCancelled,
97
97
  writeSecretJsonFile
98
- } from "./cli-rp912ypf.js";
98
+ } from "./cli-8c60k2p4.js";
99
99
  import {
100
100
  __require
101
101
  } from "./cli-0v6na3yp.js";
@@ -8330,8 +8330,7 @@ async function runCommand(command, positional, flags, positionals = positional ?
8330
8330
  assertHandParsedFlags(command, flags, positionals);
8331
8331
  switch (command) {
8332
8332
  case "prompts": {
8333
- await runPromptsCommand(context);
8334
- break;
8333
+ return runPromptsCommand(context);
8335
8334
  }
8336
8335
  case "overview": {
8337
8336
  const args = flagsToArgs(flags);
@@ -9375,7 +9374,7 @@ var commandRegistry = createCommandRegistry([
9375
9374
  resetApiRequestCountBeforeRun: true,
9376
9375
  telemetry: "result",
9377
9376
  handler: async (context) => {
9378
- const { runInit } = await import("./index-r1egcg99.js");
9377
+ const { runInit } = await import("./index-n8vtc24p.js");
9379
9378
  if (context.outputMode === "agent-stream") {
9380
9379
  context.output.writeEvent({
9381
9380
  event: "started",
@@ -9416,7 +9415,7 @@ var commandRegistry = createCommandRegistry([
9416
9415
  resetApiRequestCountBeforeRun: true,
9417
9416
  telemetry: "result-and-error",
9418
9417
  handler: async (context) => {
9419
- const { runProvision } = await import("./provision-gabtks29.js");
9418
+ const { runProvision } = await import("./provision-02wqtkvm.js");
9420
9419
  return runProvision(context, {
9421
9420
  resumeCommand: buildResumeCommand("provision", context.rawFlags)
9422
9421
  });
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildSourceSnapshot
3
- } from "./cli-xsmsjny3.js";
4
- import"./cli-rp912ypf.js";
3
+ } from "./cli-5tsqk3jt.js";
4
+ import"./cli-8c60k2p4.js";
5
5
  import"./cli-0v6na3yp.js";
6
6
 
7
7
  // src/harness-github-actions.ts
@@ -42,8 +42,8 @@ import {
42
42
  writeHarnessAnalyzeResult,
43
43
  writeHarnessArtifacts,
44
44
  writeHumanProgress
45
- } from "./cli-xsmsjny3.js";
46
- import"./cli-rp912ypf.js";
45
+ } from "./cli-5tsqk3jt.js";
46
+ import"./cli-8c60k2p4.js";
47
47
  import"./cli-0v6na3yp.js";
48
48
  export {
49
49
  writeHumanProgress,
@@ -3,7 +3,7 @@ import {
3
3
  initPrompts,
4
4
  runPromptSync,
5
5
  runSkillSync
6
- } from "./cli-ecrx32mm.js";
6
+ } from "./cli-ewerh7e2.js";
7
7
  import {
8
8
  codingAgentDisplayName,
9
9
  describeCodingAgentEvent,
@@ -22,7 +22,7 @@ import {
22
22
  runHarnessCommand,
23
23
  startRemoteAnalyze,
24
24
  stripAnsi
25
- } from "./cli-xsmsjny3.js";
25
+ } from "./cli-5tsqk3jt.js";
26
26
  import {
27
27
  bundledSkillsDir,
28
28
  installIntegrationSkill,
@@ -34,14 +34,14 @@ import {
34
34
  } from "./cli-ssfq84k5.js";
35
35
  import {
36
36
  selectTenantAndCreateKey
37
- } from "./cli-yy8fwg1a.js";
37
+ } from "./cli-j2fapt3g.js";
38
38
  import {
39
39
  ConnectCodeError,
40
40
  connectWithCode,
41
41
  loadAuthSession,
42
42
  loadToken,
43
43
  login
44
- } from "./cli-dyeywy9d.js";
44
+ } from "./cli-rycpwqzm.js";
45
45
  import {
46
46
  CliAuthError,
47
47
  CliInputError,
@@ -49,7 +49,7 @@ import {
49
49
  createCommandContext,
50
50
  resolveIngestUrl,
51
51
  resolveModaBaseUrl
52
- } from "./cli-rp912ypf.js";
52
+ } from "./cli-8c60k2p4.js";
53
53
  import"./cli-0v6na3yp.js";
54
54
 
55
55
  // src/init/index.ts
@@ -5,8 +5,8 @@ import {
5
5
  inspectCodeSelectors,
6
6
  inspectPythonSelectors,
7
7
  safePromptEvidencePath
8
- } from "./cli-xsmsjny3.js";
9
- import"./cli-rp912ypf.js";
8
+ } from "./cli-5tsqk3jt.js";
9
+ import"./cli-8c60k2p4.js";
10
10
  import {
11
11
  __commonJS,
12
12
  __toESM
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  selectTenantAndCreateKey
3
- } from "./cli-yy8fwg1a.js";
3
+ } from "./cli-j2fapt3g.js";
4
4
  import {
5
5
  loadAuthSession
6
- } from "./cli-dyeywy9d.js";
6
+ } from "./cli-rycpwqzm.js";
7
7
  import {
8
8
  CliAuthError,
9
9
  resolveIngestUrl,
10
10
  resolveModaBaseUrl,
11
11
  stringOption
12
- } from "./cli-rp912ypf.js";
12
+ } from "./cli-8c60k2p4.js";
13
13
  import"./cli-0v6na3yp.js";
14
14
 
15
15
  // src/provision.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moda-ai/cli",
3
- "version": "1.43.0",
3
+ "version": "1.43.2",
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-09T02:13:14.110Z",
4
- "cli_version": "1.43.0",
3
+ "bundled_at": "2026-10-09T06:24:13.025Z",
4
+ "cli_version": "1.43.2",
5
5
  "skills": [
6
6
  {
7
7
  "id": "integration-cloudflare-think",