@moda-ai/cli 1.43.0 → 1.43.1

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.
@@ -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,7 +26,7 @@ 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
32
  createCommandContext,
@@ -43,7 +43,7 @@ import {
43
43
  resolveTenantId,
44
44
  secretFilePathFromRef,
45
45
  validateConfig
46
- } from "./cli-rp912ypf.js";
46
+ } from "./cli-8c60k2p4.js";
47
47
  import {
48
48
  __commonJS,
49
49
  __require,
@@ -5638,62 +5638,71 @@ async function runPromptAb(flags, profileOptions, context) {
5638
5638
  `);
5639
5639
  }
5640
5640
  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({
5641
+ try {
5642
+ const enqueue = await callControlAPI(`/tenants/${encodeURIComponent(tenantId)}/replay-sets/${encodeURIComponent(replaySetId)}/run`, {
5643
+ method: "POST",
5644
+ body: JSON.stringify({
5645
+ promptArms,
5646
+ seedsPerCase,
5647
+ assistantModel: assistantModel || undefined,
5648
+ promotePrimary: flags.promote === "true" && flags["no-promote"] !== "true",
5649
+ ...plan.kind === "existing" ? replayCasePin(plan.caseIds) : {}
5650
+ })
5651
+ }, profileOptions, { timeoutMs: 120000, retries: 0 });
5652
+ if (context.outputMode === "human")
5653
+ warnIfQueued(enqueue);
5654
+ const noWait = flags.wait === "false" || flags["no-wait"] === "true";
5655
+ if (noWait) {
5656
+ context.output.writeData({
5657
+ replaySetId,
5658
+ ...caseSources ? { caseSources } : {},
5659
+ ...warnings.length ? { warnings } : {},
5660
+ runId: enqueue.runId,
5661
+ status: enqueue.status,
5662
+ message: enqueue.message ?? "Replay comparison queued",
5663
+ plannedPlayouts
5664
+ }, writeOptions);
5665
+ return;
5666
+ }
5667
+ const deadline = Date.now() + timeoutMs;
5668
+ let latest = null;
5669
+ while (Date.now() < deadline) {
5670
+ latest = await fetchLatestRun(tenantId, replaySetId, enqueue.runId, profileOptions);
5671
+ const status = latest.run?.status ?? "";
5672
+ const runId = latest.run?.runId ?? "";
5673
+ if (TERMINAL_RUN_STATUSES.has(status) && runId === enqueue.runId) {
5674
+ break;
5675
+ }
5676
+ if (context.outputMode === "human") {
5677
+ process.stderr.write(`Waiting for replay run (${waitLabel(latest.run)})...
5678
+ `);
5679
+ }
5680
+ await sleep(pollIntervalMs);
5681
+ }
5682
+ if (!latest?.run || latest.run.runId !== enqueue.runId || !TERMINAL_RUN_STATUSES.has(latest.run.status)) {
5683
+ throw new Error(`Timed out after ${timeoutMs}ms waiting for replay run ${enqueue.runId} to finish`);
5684
+ }
5685
+ const result = {
5656
5686
  replaySetId,
5657
5687
  ...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
- }
5688
+ ...warnings.length ? { warnings } : {},
5689
+ plannedPlayouts,
5690
+ runId: latest.run.runId,
5691
+ status: latest.run.status,
5692
+ verdict: formatVerdict(latest),
5693
+ run: { ...latest.run },
5694
+ cases: latest.cases.map((row) => ({ ...row }))
5695
+ };
5674
5696
  if (context.outputMode === "human") {
5675
- process.stderr.write(`Waiting for replay run (${waitLabel(latest.run)})...
5676
- `);
5697
+ printHumanVerdict(result);
5677
5698
  }
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);
5699
+ context.output.writeData(result, writeOptions);
5700
+ } catch (error) {
5701
+ if (warnings.length && error && typeof error === "object") {
5702
+ Object.assign(error, { warnings });
5703
+ }
5704
+ throw error;
5695
5705
  }
5696
- context.output.writeData(result, writeOptions);
5697
5706
  }
5698
5707
  function warnIfQueued(enqueue) {
5699
5708
  const { runsAhead, maxActiveRuns } = enqueue;
@@ -5955,7 +5964,7 @@ async function createSetFromTraces(conversationIds, flags, tenantId, profileOpti
5955
5964
  }
5956
5965
  const warnings = [];
5957
5966
  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";
5967
+ const why = unavailable ? `Moda could not distill these traces (${unavailable.slice(0, 600)})` : "Moda could not distill a scenario for these traces";
5959
5968
  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
5969
  }
5961
5970
  return { setId: set.id, caseSources: { distilled, fallback }, warnings };
@@ -6698,7 +6707,7 @@ async function runPromptSyncExclusive(flags, profileOptions, options) {
6698
6707
  const analyzedDefinitions = new Map;
6699
6708
  if (flags["no-analyze"] !== "true") {
6700
6709
  options.onProgress?.("Analyzing prompt sources before sync.");
6701
- const { analyzeHarnessPrompts } = await import("./harness-191xt7bq.js");
6710
+ const { analyzeHarnessPrompts } = await import("./harness-sqngqjrd.js");
6702
6711
  const result = await analyzeHarnessPrompts({
6703
6712
  rootDir: process.cwd(),
6704
6713
  existing: established.flatMap((prompt) => prompt.sourceDefinition ? [prompt.sourceDefinition.source] : []),
@@ -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,
@@ -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-141ca3yv.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";
@@ -9375,7 +9375,7 @@ var commandRegistry = createCommandRegistry([
9375
9375
  resetApiRequestCountBeforeRun: true,
9376
9376
  telemetry: "result",
9377
9377
  handler: async (context) => {
9378
- const { runInit } = await import("./index-r1egcg99.js");
9378
+ const { runInit } = await import("./index-cnfwmzew.js");
9379
9379
  if (context.outputMode === "agent-stream") {
9380
9380
  context.output.writeEvent({
9381
9381
  event: "started",
@@ -9416,7 +9416,7 @@ var commandRegistry = createCommandRegistry([
9416
9416
  resetApiRequestCountBeforeRun: true,
9417
9417
  telemetry: "result-and-error",
9418
9418
  handler: async (context) => {
9419
- const { runProvision } = await import("./provision-gabtks29.js");
9419
+ const { runProvision } = await import("./provision-02wqtkvm.js");
9420
9420
  return runProvision(context, {
9421
9421
  resumeCommand: buildResumeCommand("provision", context.rawFlags)
9422
9422
  });
@@ -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-141ca3yv.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.1",
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-09T03:57:10.818Z",
4
+ "cli_version": "1.43.1",
5
5
  "skills": [
6
6
  {
7
7
  "id": "integration-cloudflare-think",