@moda-ai/cli 1.55.18 → 1.55.20

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.
Files changed (47) hide show
  1. package/dist/{agent-cha3kg9d.js → agent-mj622k8s.js} +9 -9
  2. package/dist/{cli-1exddmc0.js → cli-033n2mpb.js} +2 -2
  3. package/dist/{cli-c5c6f0yw.js → cli-38p87ykc.js} +1 -1
  4. package/dist/{cli-av3dqgj5.js → cli-4j8nffsm.js} +10 -6
  5. package/dist/{cli-5hq827jt.js → cli-569hj0bj.js} +1 -1
  6. package/dist/{cli-3ezzeqcy.js → cli-5ke3xe6y.js} +47 -3
  7. package/dist/{cli-eazeanvt.js → cli-7ea02wca.js} +1 -1
  8. package/dist/{cli-qmjnh4z9.js → cli-9x9adrtj.js} +1 -1
  9. package/dist/{cli-a1mv0ypm.js → cli-a5c9te95.js} +5 -5
  10. package/dist/cli-cehskjde.js +1302 -0
  11. package/dist/{cli-5q1gyvxn.js → cli-pc5cw7mx.js} +5 -5
  12. package/dist/{cli-c8p69n55.js → cli-rqk6f6n6.js} +2 -2
  13. package/dist/{cli-ssfq84k5.js → cli-sf0g0fjg.js} +133 -18
  14. package/dist/{cli-0e8bfvn7.js → cli-wf7gfa1e.js} +8 -8
  15. package/dist/cli.js +331 -930
  16. package/dist/{doctor-kg0yq1wf.js → doctor-mx6jf435.js} +9 -9
  17. package/dist/{fix-q8er8egx.js → fix-9fmy6p2x.js} +7 -7
  18. package/dist/{harness-github-actions-ver6cprq.js → harness-github-actions-c826bfxs.js} +6 -6
  19. package/dist/{harness-v9s0k9s7.js → harness-xvg6ws6x.js} +6 -6
  20. package/dist/{index-7zqa7t5c.js → index-ewqbpnwz.js} +13 -13
  21. package/dist/{production-intelligence-k36jsvqx.js → production-intelligence-dbe9dmc5.js} +3 -3
  22. package/dist/{profile-commands-88sdwzbg.js → profile-commands-kmmd9y86.js} +3 -3
  23. package/dist/prompt-source-mcp.js +6 -6
  24. package/dist/{prompts-2r756vtd.js → prompts-1tkhrxkq.js} +7 -7
  25. package/dist/{provision-n3r7yway.js → provision-wzttap58.js} +4 -4
  26. package/dist/{registry-5v63ga01.js → registry-atqyb5fa.js} +4 -4
  27. package/dist/skills-br82cpt7.js +19 -0
  28. package/dist/{skills-bundled-mdmhzfsr.js → skills-bundled-r9a2vs07.js} +2 -2
  29. package/dist/{sync-r4tncne4.js → sync-25vn78je.js} +9 -9
  30. package/package.json +1 -1
  31. package/skills/integration/index.json +2 -2
  32. package/skills/moda-cli/SKILL.md +114 -1434
  33. package/skills/moda-cli/references/auth.md +176 -0
  34. package/skills/moda-cli/references/commands.md +74 -0
  35. package/skills/moda-cli/references/dashboard-parity.md +29 -0
  36. package/skills/moda-cli/references/detections.md +79 -0
  37. package/skills/moda-cli/references/feedback.md +45 -0
  38. package/skills/moda-cli/references/output-protocol.md +260 -0
  39. package/skills/moda-cli/references/production-intelligence.md +96 -0
  40. package/skills/moda-cli/references/prompts.md +104 -0
  41. package/skills/moda-cli/references/recipes.md +74 -0
  42. package/skills/moda-cli/references/replays-and-registry.md +173 -0
  43. package/skills/moda-cli/references/search-and-traces.md +180 -0
  44. package/skills/moda-cli/references/signals-and-false-positives.md +79 -0
  45. package/skills/moda-cli/references/troubleshooting.md +65 -0
  46. package/dist/cli-kg0kz05e.js +0 -496
  47. package/dist/skills-fed17et3.js +0 -19
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  buildDoctorReport
3
- } from "./cli-5q1gyvxn.js";
4
- import"./cli-qmjnh4z9.js";
5
- import"./cli-0e8bfvn7.js";
3
+ } from "./cli-pc5cw7mx.js";
4
+ import"./cli-9x9adrtj.js";
5
+ import"./cli-wf7gfa1e.js";
6
6
  import"./cli-mm48br00.js";
7
7
  import {
8
8
  HARNESS_REPORT_APPROVAL_PATH,
@@ -14,19 +14,19 @@ import {
14
14
  readHarnessSyncState,
15
15
  summarizeHarness,
16
16
  validateHarnessReport
17
- } from "./cli-a1mv0ypm.js";
17
+ } from "./cli-a5c9te95.js";
18
18
  import"./cli-97fnztpy.js";
19
- import"./cli-5hq827jt.js";
20
- import"./cli-kg0kz05e.js";
21
- import"./cli-c8p69n55.js";
22
- import"./cli-eazeanvt.js";
19
+ import"./cli-569hj0bj.js";
20
+ import"./cli-cehskjde.js";
21
+ import"./cli-rqk6f6n6.js";
22
+ import"./cli-7ea02wca.js";
23
23
  import {
24
24
  CliInputError,
25
25
  resolveApiKey,
26
26
  resolveIngestUrl,
27
27
  resolveModaBaseUrl,
28
28
  resolveTenantId
29
- } from "./cli-3ezzeqcy.js";
29
+ } from "./cli-5ke3xe6y.js";
30
30
  import"./cli-0v6na3yp.js";
31
31
 
32
32
  // src/agent.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  authFetch,
3
3
  getCachedLoginContext
4
- } from "./cli-qmjnh4z9.js";
4
+ } from "./cli-9x9adrtj.js";
5
5
  import {
6
6
  CliAccessError,
7
7
  CliInputError,
@@ -16,7 +16,7 @@ import {
16
16
  resolveTenantIdFromActiveProfile,
17
17
  saveCliConfig,
18
18
  writeSecretJsonFile
19
- } from "./cli-3ezzeqcy.js";
19
+ } from "./cli-5ke3xe6y.js";
20
20
 
21
21
  // src/init/tenant.ts
22
22
  import { randomUUID } from "node:crypto";
@@ -5,7 +5,7 @@ import {
5
5
  packageAssetPath,
6
6
  readSkillsManifest,
7
7
  upsertSkillManifestRecord
8
- } from "./cli-ssfq84k5.js";
8
+ } from "./cli-sf0g0fjg.js";
9
9
 
10
10
  // src/skills-bundled.ts
11
11
  import { createHash } from "node:crypto";
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  createCommandContext
3
- } from "./cli-5hq827jt.js";
3
+ } from "./cli-569hj0bj.js";
4
4
  import {
5
5
  assertFlags,
6
6
  assertPositionals
7
- } from "./cli-kg0kz05e.js";
7
+ } from "./cli-cehskjde.js";
8
8
  import {
9
9
  callControlAPI
10
- } from "./cli-c8p69n55.js";
10
+ } from "./cli-rqk6f6n6.js";
11
11
  import {
12
12
  CliInputError,
13
13
  recordApiRequest,
14
14
  resolveApiKey,
15
15
  resolveIngestUrl,
16
16
  resolveTenantId
17
- } from "./cli-3ezzeqcy.js";
17
+ } from "./cli-5ke3xe6y.js";
18
18
  import {
19
19
  SKILL_SOURCE_HARNESS,
20
20
  SKILL_SOURCE_INTEGRATION_BUNDLED,
@@ -23,7 +23,7 @@ import {
23
23
  pruneManagedSkillPaths,
24
24
  readSkillsManifest,
25
25
  writeSkillsManifest
26
- } from "./cli-ssfq84k5.js";
26
+ } from "./cli-sf0g0fjg.js";
27
27
  import {
28
28
  __require
29
29
  } from "./cli-0v6na3yp.js";
@@ -53,7 +53,11 @@ function renderFixesBlock() {
53
53
  "## Fixing production issues with Moda (managed block — edits inside are overwritten by moda-cli)",
54
54
  "",
55
55
  "Moda supplies the production evidence; you propose and make the fix yourself.",
56
+ "The `moda` CLI needs `MODA_API_KEY` (or `npx -y -p @moda-ai/cli moda ...` when",
57
+ "not installed); `moda <command> --help` lists its flags.",
56
58
  "",
59
+ '- Find where something happened in production: `moda search "<words>"`, then',
60
+ " `moda context <conversation_id> --msg-index=<message_index>` to read the turn.",
57
61
  "- Find what to fix: `moda investigate` ranks tool failures, user frustrations,",
58
62
  " and top Problems with evidence; `moda problems` ranks cross-signal Problems",
59
63
  " by root cause; `moda failures` lists tool failures only.",
@@ -862,7 +866,7 @@ function sha256(input) {
862
866
  return createHash("sha256").update(input).digest("hex");
863
867
  }
864
868
  async function runSkillsInstall(context, ids) {
865
- const { installIntegrationSkill, readBundledIndex, readBundledSkillMd } = await import("./skills-bundled-mdmhzfsr.js");
869
+ const { installIntegrationSkill, readBundledIndex, readBundledSkillMd } = await import("./skills-bundled-r9a2vs07.js");
866
870
  const index = readBundledIndex();
867
871
  if (context.flags.list === "true" || ids.length === 0) {
868
872
  if (!index) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createCliOutput,
3
3
  outputModeFromFlags
4
- } from "./cli-3ezzeqcy.js";
4
+ } from "./cli-5ke3xe6y.js";
5
5
 
6
6
  // src/command-context.ts
7
7
  function flagEnabled(flags, key) {
@@ -535,13 +535,24 @@ function writeSecretJsonFile(path, value) {
535
535
  class CliInputError extends Error {
536
536
  usage;
537
537
  reason;
538
- constructor(message, usage, reason) {
538
+ details;
539
+ constructor(message, usage, reason, details) {
539
540
  super(message);
540
541
  this.usage = usage;
541
542
  this.reason = reason;
543
+ this.details = details;
542
544
  this.name = "CliInputError";
543
545
  }
544
546
  }
547
+ var inputDetails = new WeakMap;
548
+ function attachInputDetails(error, details) {
549
+ inputDetails.set(error, details);
550
+ }
551
+ function inputDetailsOf(error) {
552
+ if (error instanceof CliInputError && error.details)
553
+ return error.details;
554
+ return error !== null && typeof error === "object" ? inputDetails.get(error) : undefined;
555
+ }
545
556
 
546
557
  class CliAccessError extends Error {
547
558
  guidance;
@@ -2030,6 +2041,35 @@ function formatValidationMessage(error) {
2030
2041
  });
2031
2042
  return `Validation error — ${[...new Set(parts)].join("; ")}`;
2032
2043
  }
2044
+ function zodIssueDetails(error) {
2045
+ const issues = error.issues;
2046
+ if (error.name !== "ZodError" || !Array.isArray(issues) || issues.length === 0)
2047
+ return;
2048
+ const issue = issues[0];
2049
+ const key = Array.isArray(issue.path) && typeof issue.path[0] === "string" ? issue.path[0] : undefined;
2050
+ const details = {};
2051
+ if (key)
2052
+ details.field = `--${key.replace(/_/g, "-")}`;
2053
+ if (issue.code === "invalid_enum_value" && Array.isArray(issue.options)) {
2054
+ details.allowed = issue.options.map(String);
2055
+ }
2056
+ if (issue.type === "number" && (issue.code === "too_small" || issue.code === "too_big")) {
2057
+ const bound = Number(issue.code === "too_small" ? issue.minimum : issue.maximum);
2058
+ if (Number.isFinite(bound))
2059
+ details.range = issue.code === "too_small" ? { min: bound } : { max: bound };
2060
+ }
2061
+ return Object.keys(details).length > 0 ? details : undefined;
2062
+ }
2063
+ function inputDetailFields(details) {
2064
+ if (!details)
2065
+ return {};
2066
+ return {
2067
+ ...details.field ? { field: details.field } : {},
2068
+ ...details.allowed?.length ? { allowed: details.allowed } : {},
2069
+ ...details.range && (details.range.min !== undefined || details.range.max !== undefined) ? { range: details.range } : {},
2070
+ ...details.didYouMean?.length ? { did_you_mean: details.didYouMean } : {}
2071
+ };
2072
+ }
2033
2073
  var API_KEY_RECOVERY = "Set MODA_API_KEY=moda_sk_... in the environment, or save one with `moda auth login --api-key` (reads MODA_API_KEY or --api-key-stdin). Keys: https://moda.dev/settings";
2034
2074
  function serverErrorMessage(error) {
2035
2075
  const body = error.responseBody;
@@ -2094,11 +2134,15 @@ function errorToAgentError(error) {
2094
2134
  }
2095
2135
  if (error instanceof Error) {
2096
2136
  if (error instanceof CliInputError || error.name === "ZodError") {
2137
+ const details = inputDetailsOf(error) ?? zodIssueDetails(error);
2138
+ const fromUsage = "usage" in error && typeof error.usage === "string" ? extractSuggestedCommands(error.usage) : undefined;
2139
+ const suggested = [...new Set([...details?.suggestedCommands ?? [], ...fromUsage ?? []])];
2097
2140
  return {
2098
2141
  code: "input_error",
2099
2142
  message: formatValidationMessage(error),
2100
2143
  cause: "usage" in error && typeof error.usage === "string" ? error.usage : undefined,
2101
- suggested_commands: "usage" in error && typeof error.usage === "string" ? extractSuggestedCommands(error.usage) : undefined,
2144
+ suggested_commands: suggested.length > 0 ? suggested : undefined,
2145
+ ...inputDetailFields(details),
2102
2146
  blocking: true
2103
2147
  };
2104
2148
  }
@@ -2578,4 +2622,4 @@ function extractSuggestedCommands(text) {
2578
2622
  return commands.length > 0 ? commands : undefined;
2579
2623
  }
2580
2624
 
2581
- export { PROD_BASE_URL, DEFAULT_INGEST_URL, getModaPaths, getModaDir, isLoopbackBaseUrl, describeBaseUrlSource, loadProfileConfig, saveProfileConfig, getActiveProfile, setActiveProfile, upsertProfile, clearStoredApiKeyCredentials, secretFilePathFromRef, resolveSecretReference, resolveApiKeyFromActiveProfile, resolveTenantIdFromActiveProfile, ensureSecretFilePermissions, writeSecretJsonFile, CliInputError, CliAccessError, CliInputRequiredError, CliAuthError, CliNotFoundError, CliCancellationError, isNetworkLikeError, isApiLikeError, apiErrorStatus, VERSION, MODA_BASE_URL, loadCliConfig, saveCliConfig, resolveApiKey, embeddedTenantIdFromApiKey, resolveIngestUrl2 as resolveIngestUrl, resolveTenantId, resolveApiTenantId, resolveModaBaseUrl, validateConfig, recordApiRequest, getApiRequestCount, resetApiRequestCount, BATCH_MAX_TARGETS, BATCH_CONCURRENCY, parseBatchTarget, collectBatchTargets, mapWithConcurrency, contextTarget, asRecord, asString, asNumber, frustrationAnchorIndex, frustrationsFromEmotions, withFrustrationAnchors, shellWord, trimToolFailureConversations, withToolFailureAnchors, embeddedWindowSize, withoutDetectionWindows, compactProblemDossier, MAX_SCANNED_FILE_BYTES, DEFAULT_MAX_INVENTORY_FILES, DEFAULT_MAX_INVENTORY_TEXT_BYTES, MAX_RECORDED_SKIPS, SKIPPED_DIRS, isSkippedDir, isSkippedPathPrefix, isEvalLikePath, shouldInventoryFile, isTextFile, isSecretishPath, SECRET_KEYS, redactDeep, redactString, packSnapshot, setAgentUpdateNotice, EXIT_OK, EXIT_ERROR, EXIT_DEGRADED, EXIT_AUTH_REQUIRED, EXIT_INPUT_REQUIRED, EXIT_CANCELLED, AGENT_ERROR_CODES, wasOutputCancelled, safeWriteStdout, safeWriteStderr, explicitOutputMode, outputModeFromFlags, resolveOutputMode, createCliOutput, agentEnvelopeFits, errorToAgentError, agentMaxOutputBytes };
2625
+ export { PROD_BASE_URL, DEFAULT_INGEST_URL, getModaPaths, getModaDir, isLoopbackBaseUrl, describeBaseUrlSource, loadProfileConfig, saveProfileConfig, getActiveProfile, setActiveProfile, upsertProfile, clearStoredApiKeyCredentials, secretFilePathFromRef, resolveSecretReference, resolveApiKeyFromActiveProfile, resolveTenantIdFromActiveProfile, ensureSecretFilePermissions, writeSecretJsonFile, CliInputError, attachInputDetails, CliAccessError, CliInputRequiredError, CliAuthError, CliNotFoundError, CliCancellationError, isNetworkLikeError, isApiLikeError, apiErrorStatus, VERSION, MODA_BASE_URL, loadCliConfig, saveCliConfig, resolveApiKey, embeddedTenantIdFromApiKey, resolveIngestUrl2 as resolveIngestUrl, resolveTenantId, resolveApiTenantId, resolveModaBaseUrl, validateConfig, recordApiRequest, getApiRequestCount, resetApiRequestCount, BATCH_MAX_TARGETS, BATCH_CONCURRENCY, parseBatchTarget, collectBatchTargets, mapWithConcurrency, contextTarget, asRecord, asString, asNumber, frustrationAnchorIndex, frustrationsFromEmotions, withFrustrationAnchors, shellWord, trimToolFailureConversations, withToolFailureAnchors, embeddedWindowSize, withoutDetectionWindows, compactProblemDossier, MAX_SCANNED_FILE_BYTES, DEFAULT_MAX_INVENTORY_FILES, DEFAULT_MAX_INVENTORY_TEXT_BYTES, MAX_RECORDED_SKIPS, SKIPPED_DIRS, isSkippedDir, isSkippedPathPrefix, isEvalLikePath, shouldInventoryFile, isTextFile, isSecretishPath, SECRET_KEYS, redactDeep, redactString, packSnapshot, setAgentUpdateNotice, EXIT_OK, EXIT_ERROR, EXIT_DEGRADED, EXIT_AUTH_REQUIRED, EXIT_INPUT_REQUIRED, EXIT_CANCELLED, AGENT_ERROR_CODES, wasOutputCancelled, safeWriteStdout, safeWriteStderr, explicitOutputMode, outputModeFromFlags, resolveOutputMode, createCliOutput, agentEnvelopeFits, errorToAgentError, agentMaxOutputBytes };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveTenantId
3
- } from "./cli-3ezzeqcy.js";
3
+ } from "./cli-5ke3xe6y.js";
4
4
 
5
5
  // src/api-key-headers.ts
6
6
  var PLATFORM_API_KEY_PREFIX = "moda_pk_";
@@ -8,7 +8,7 @@ import {
8
8
  saveProfileConfig,
9
9
  secretFilePathFromRef,
10
10
  writeSecretJsonFile
11
- } from "./cli-3ezzeqcy.js";
11
+ } from "./cli-5ke3xe6y.js";
12
12
  import {
13
13
  __require
14
14
  } from "./cli-0v6na3yp.js";
@@ -4,16 +4,16 @@ import {
4
4
  import {
5
5
  createCommandContext,
6
6
  stringOption
7
- } from "./cli-5hq827jt.js";
7
+ } from "./cli-569hj0bj.js";
8
8
  import {
9
9
  assertFlags,
10
10
  assertPositionals,
11
11
  requireTenant
12
- } from "./cli-kg0kz05e.js";
12
+ } from "./cli-cehskjde.js";
13
13
  import {
14
14
  ApiError,
15
15
  callControlAPI
16
- } from "./cli-c8p69n55.js";
16
+ } from "./cli-rqk6f6n6.js";
17
17
  import {
18
18
  CliInputError,
19
19
  CliInputRequiredError,
@@ -39,7 +39,7 @@ import {
39
39
  resolveModaBaseUrl,
40
40
  resolveTenantId,
41
41
  shouldInventoryFile
42
- } from "./cli-3ezzeqcy.js";
42
+ } from "./cli-5ke3xe6y.js";
43
43
  import {
44
44
  __commonJS,
45
45
  __require,
@@ -195871,7 +195871,7 @@ async function runHarnessCommand(context) {
195871
195871
  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.");
195872
195872
  }
195873
195873
  if (context.flags["github-actions"] === "true") {
195874
- const { runGithubActionsAnalyze } = await import("./harness-github-actions-ver6cprq.js");
195874
+ const { runGithubActionsAnalyze } = await import("./harness-github-actions-c826bfxs.js");
195875
195875
  const result = await runGithubActionsAnalyze(rootDir, {
195876
195876
  writeReport: (report2) => {
195877
195877
  const normalized = normalizeHarnessReport(report2);