@moda-ai/cli 1.23.1 → 1.25.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.
@@ -8,7 +8,7 @@ import {
8
8
  saveProfileConfig,
9
9
  secretFilePathFromRef,
10
10
  writeSecretJsonFile
11
- } from "./cli-mnqa4rp6.js";
11
+ } from "./cli-vc7zddj1.js";
12
12
 
13
13
  // src/auth-storage.ts
14
14
  import { existsSync, readFileSync, rmSync } from "node:fs";
@@ -23,7 +23,7 @@ import {
23
23
  resolveTenantId,
24
24
  shouldInventoryFile,
25
25
  stringOption
26
- } from "./cli-mnqa4rp6.js";
26
+ } from "./cli-vc7zddj1.js";
27
27
 
28
28
  // src/api-client.ts
29
29
  var REQUEST_TIMEOUT_MS = 30000;
@@ -3314,6 +3314,17 @@ async function runHarnessCommand(context) {
3314
3314
  return { exitCode: 0 };
3315
3315
  }
3316
3316
  case "analyze": {
3317
+ const cliAnalyzeEnabled = context.flags["experimental"] === "true" || process.env.MODA_HARNESS_ANALYZE_CLI === "1";
3318
+ if (!cliAnalyzeEnabled) {
3319
+ context.output.writeData({
3320
+ schema: "harness_analyze_disabled.v0.1",
3321
+ status: "disabled",
3322
+ reason: "cli_analyze_gated",
3323
+ message: "Harness analysis now runs automatically via the Moda GitHub App — connect your repo in the Moda dashboard (Settings → Integrations). To run the experimental CLI analyze anyway, pass --experimental or set MODA_HARNESS_ANALYZE_CLI=1."
3324
+ });
3325
+ writeHumanProgress(context, "moda harness analyze is disabled: connect the Moda GitHub App (Settings → Integrations) for automatic analysis, or pass --experimental to run the CLI analyze.");
3326
+ return { exitCode: 1 };
3327
+ }
3317
3328
  await approveScanIfNeeded(scanPlan, {
3318
3329
  context,
3319
3330
  message: "Run Moda Analyst to investigate this project and produce a cited harness report?",
@@ -3327,7 +3338,7 @@ async function runHarnessCommand(context) {
3327
3338
  elapsed_ms: Date.now() - context.startedAt
3328
3339
  });
3329
3340
  if (context.flags["github-actions"] === "true") {
3330
- const { runGithubActionsAnalyze } = await import("./harness-github-actions-7t3cncnt.js");
3341
+ const { runGithubActionsAnalyze } = await import("./harness-github-actions-rjyc9a7z.js");
3331
3342
  const result = await runGithubActionsAnalyze(rootDir, {
3332
3343
  writeReport: (report2) => {
3333
3344
  const normalized = normalizeHarnessReport(report2);
@@ -11,11 +11,11 @@ import {
11
11
  renderStatusHuman,
12
12
  scanHarness,
13
13
  validateHarnessReport
14
- } from "./cli-y55bgg14.js";
14
+ } from "./cli-jntzpem2.js";
15
15
  import {
16
16
  isAuthSessionValid,
17
17
  loadAuthSession
18
- } from "./cli-c4se7a5d.js";
18
+ } from "./cli-8s69sg7f.js";
19
19
  import {
20
20
  CliInputError,
21
21
  createCommandContext,
@@ -31,7 +31,7 @@ import {
31
31
  resolveTenantId,
32
32
  secretFilePathFromRef,
33
33
  validateConfig
34
- } from "./cli-mnqa4rp6.js";
34
+ } from "./cli-vc7zddj1.js";
35
35
 
36
36
  // src/prompts.ts
37
37
  import { execFileSync } from "node:child_process";
@@ -2397,7 +2397,7 @@ function harnessReportStateCheck(cwd) {
2397
2397
  severity: "warning",
2398
2398
  evidence: [{ label: "path", value: HARNESS_REPORT_PATH }],
2399
2399
  remediation: "Run a Moda Analyst pass so the harness graph has cited evidence before cloud sync.",
2400
- nextCommand: "moda harness analyze --summary"
2400
+ nextCommand: "moda harness analyze --experimental --summary"
2401
2401
  };
2402
2402
  }
2403
2403
  try {
@@ -2421,7 +2421,7 @@ function harnessReportStateCheck(cwd) {
2421
2421
  { label: "errors", value: validation.errors.slice(0, 3).join(" | ") || "validation failed" }
2422
2422
  ],
2423
2423
  remediation: "Regenerate or fix the harness report before approving or syncing.",
2424
- nextCommand: "moda harness analyze --summary"
2424
+ nextCommand: "moda harness analyze --experimental --summary"
2425
2425
  };
2426
2426
  }
2427
2427
  const approval = readHarnessReportApproval(cwd);
@@ -2476,7 +2476,7 @@ function harnessReportStateCheck(cwd) {
2476
2476
  { label: "error", value: err instanceof Error ? err.message : String(err) }
2477
2477
  ],
2478
2478
  remediation: "Regenerate the harness report.",
2479
- nextCommand: "moda harness analyze --summary"
2479
+ nextCommand: "moda harness analyze --experimental --summary"
2480
2480
  };
2481
2481
  }
2482
2482
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  authFetch,
3
3
  getCachedLoginContext
4
- } from "./cli-c4se7a5d.js";
4
+ } from "./cli-8s69sg7f.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-mnqa4rp6.js";
18
+ } from "./cli-vc7zddj1.js";
19
19
 
20
20
  // src/init/tenant.ts
21
21
  import { randomUUID } from "node:crypto";
@@ -1560,4 +1560,4 @@ function createCommandContext(input, options = {}) {
1560
1560
  };
1561
1561
  }
1562
1562
 
1563
- export { __require, PROD_BASE_URL, DEFAULT_INGEST_URL, getModaPaths, getModaDir, isLoopbackBaseUrl, assertValidProfileName, loadProfileConfig, saveProfileConfig, getActiveProfile, setActiveProfile, upsertProfile, clearStoredApiKeyCredentials, secretFilePathFromRef, resolveSecretReference, resolveApiKeyFromActiveProfile, resolveTenantIdFromActiveProfile, ensureSecretFilePermissions, writeSecretJsonFile, CliInputError, CliAccessError, CliInputRequiredError, CliAuthError, CliCancellationError, isNetworkLikeError, isApiLikeError, VERSION, loadCliConfig, saveCliConfig, resolveApiKey, embeddedTenantIdFromApiKey, resolveIngestUrl2 as resolveIngestUrl, resolveTenantId, resolveModaBaseUrl, validateConfig, MAX_SCANNED_FILE_BYTES, DEFAULT_MAX_INVENTORY_FILES, DEFAULT_MAX_INVENTORY_TEXT_BYTES, MAX_RECORDED_SKIPS, SKIPPED_DIRS, isSkippedDir, isSkippedPathPrefix, isEvalLikePath, shouldInventoryFile, isTextFile, isSecretishPath, redactDeep, packSnapshot, EXIT_OK, EXIT_ERROR, EXIT_DEGRADED, EXIT_AUTH_REQUIRED, EXIT_INPUT_REQUIRED, EXIT_CANCELLED, AGENT_ERROR_CODES, wasOutputCancelled, safeWriteStdout, safeWriteStderr, resolveOutputMode, createCliOutput, stringOption, createCommandContext };
1563
+ export { __require, PROD_BASE_URL, DEFAULT_INGEST_URL, getModaPaths, getModaDir, isLoopbackBaseUrl, assertValidProfileName, loadProfileConfig, saveProfileConfig, getActiveProfile, setActiveProfile, upsertProfile, clearStoredApiKeyCredentials, secretFilePathFromRef, resolveSecretReference, resolveApiKeyFromActiveProfile, resolveTenantIdFromActiveProfile, ensureSecretFilePermissions, writeSecretJsonFile, CliInputError, CliAccessError, CliInputRequiredError, CliAuthError, CliCancellationError, isNetworkLikeError, isApiLikeError, VERSION, MODA_BASE_URL, loadCliConfig, saveCliConfig, resolveApiKey, embeddedTenantIdFromApiKey, resolveIngestUrl2 as resolveIngestUrl, resolveTenantId, resolveModaBaseUrl, validateConfig, MAX_SCANNED_FILE_BYTES, DEFAULT_MAX_INVENTORY_FILES, DEFAULT_MAX_INVENTORY_TEXT_BYTES, MAX_RECORDED_SKIPS, SKIPPED_DIRS, isSkippedDir, isSkippedPathPrefix, isEvalLikePath, shouldInventoryFile, isTextFile, isSecretishPath, redactDeep, packSnapshot, EXIT_OK, EXIT_ERROR, EXIT_DEGRADED, EXIT_AUTH_REQUIRED, EXIT_INPUT_REQUIRED, EXIT_CANCELLED, AGENT_ERROR_CODES, wasOutputCancelled, safeWriteStdout, safeWriteStderr, resolveOutputMode, createCliOutput, stringOption, createCommandContext };
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  runPromptsCommand,
6
6
  runSkillsCommand,
7
7
  runStatusCommand
8
- } from "./cli-rbftde0m.js";
8
+ } from "./cli-kqvjt12y.js";
9
9
  import {
10
10
  ApiError,
11
11
  HARNESS_REPORT_APPROVAL_PATH,
@@ -26,7 +26,7 @@ import {
26
26
  summarizeHarness,
27
27
  terminalStyles,
28
28
  validateHarnessReport
29
- } from "./cli-y55bgg14.js";
29
+ } from "./cli-jntzpem2.js";
30
30
  import {
31
31
  authFetch,
32
32
  clearAuthSession,
@@ -34,7 +34,7 @@ import {
34
34
  loadAuthSession,
35
35
  login,
36
36
  revokeCliSessionToken
37
- } from "./cli-c4se7a5d.js";
37
+ } from "./cli-8s69sg7f.js";
38
38
  import {
39
39
  AGENT_ERROR_CODES,
40
40
  CliAccessError,
@@ -49,6 +49,7 @@ import {
49
49
  EXIT_ERROR,
50
50
  EXIT_INPUT_REQUIRED,
51
51
  EXIT_OK,
52
+ MODA_BASE_URL,
52
53
  PROD_BASE_URL,
53
54
  VERSION,
54
55
  __require,
@@ -78,7 +79,7 @@ import {
78
79
  validateConfig,
79
80
  wasOutputCancelled,
80
81
  writeSecretJsonFile
81
- } from "./cli-mnqa4rp6.js";
82
+ } from "./cli-vc7zddj1.js";
82
83
 
83
84
  // src/cli.ts
84
85
  import { z as z2 } from "zod";
@@ -130,6 +131,10 @@ var FrustrationsSchema = z.object({
130
131
  var ToolFailuresSchema = z.object({
131
132
  days_back: z.number().min(1).max(90).default(7).optional()
132
133
  });
134
+ var ProblemsSchema = z.object({
135
+ days_back: z.number().min(1).max(90).default(30).optional(),
136
+ limit: z.number().min(1).max(25).default(25).optional()
137
+ });
133
138
  var ToolFailureDetailSchema = z.object({
134
139
  tool_name: z.string(),
135
140
  subtype: z.string().optional(),
@@ -3853,6 +3858,7 @@ Commands:
3853
3858
  frustrations Get user frustration detections
3854
3859
  tool-failures Get tool failure overview
3855
3860
  tool-failure-detail <tool_name> Get per-tool failure detail
3861
+ problems Rank cross-signal Problems by root cause (what to fix first)
3856
3862
  feedback "<note>" Flag wrong/missing data or CLI quirks to the Moda team
3857
3863
 
3858
3864
  Prompt management:
@@ -3969,12 +3975,12 @@ Examples:
3969
3975
  moda profiles list
3970
3976
  moda profiles use staging
3971
3977
  moda config show --profile=prod
3972
- moda harness analyze --summary
3973
- moda harness analyze --remote
3974
- moda harness analyze --analyst=claude --tui
3975
- moda harness analyze --analyst=claude --no-tui
3976
- moda harness analyze --analyst=claude --summary
3977
- moda harness analyze --analyst=local-scan --summary
3978
+ moda harness analyze --experimental --summary
3979
+ moda harness analyze --experimental --remote
3980
+ moda harness analyze --experimental --analyst=claude --tui
3981
+ moda harness analyze --experimental --analyst=claude --no-tui
3982
+ moda harness analyze --experimental --analyst=claude --summary
3983
+ moda harness analyze --experimental --analyst=local-scan --summary
3978
3984
  moda harness pull --sync
3979
3985
  moda harness validate-report
3980
3986
  moda harness approve --yes
@@ -4302,6 +4308,23 @@ async function runCommand(command, positional, flags, positionals = positional ?
4302
4308
  await printWithOptionalWindows(withToolFailureAnchors(data), "examples", params.include_window === true, params.window ?? 1, context.output);
4303
4309
  break;
4304
4310
  }
4311
+ case "problems": {
4312
+ const args = flagsToArgs(flags);
4313
+ const params = ProblemsSchema.parse(args);
4314
+ const query = new URLSearchParams;
4315
+ if (params.days_back)
4316
+ query.set("days_back", params.days_back.toString());
4317
+ if (params.limit)
4318
+ query.set("limit", params.limit.toString());
4319
+ const queryString = query.toString() ? `?${query.toString()}` : "";
4320
+ const data = await callDataAPI(`/problems${queryString}`);
4321
+ const withLink = {
4322
+ ...asRecord(data) ?? {},
4323
+ dashboard_url: `${MODA_BASE_URL}/dashboard/problems`
4324
+ };
4325
+ context.output.writeData(withLink);
4326
+ break;
4327
+ }
4305
4328
  case "feedback": {
4306
4329
  const note = positionals.join(" ").trim();
4307
4330
  if (note === "") {
@@ -4440,7 +4463,7 @@ var commandRegistry = createCommandRegistry([
4440
4463
  resetApiRequestCountBeforeRun: true,
4441
4464
  telemetry: "result",
4442
4465
  handler: async (context) => {
4443
- const { runInit } = await import("./index-t89mvn32.js");
4466
+ const { runInit } = await import("./index-fm9ey3ks.js");
4444
4467
  if (context.outputMode === "agent-stream") {
4445
4468
  context.output.writeEvent({
4446
4469
  event: "started",
@@ -4481,7 +4504,7 @@ var commandRegistry = createCommandRegistry([
4481
4504
  resetApiRequestCountBeforeRun: true,
4482
4505
  telemetry: "result-and-error",
4483
4506
  handler: async (context) => {
4484
- const { runProvision } = await import("./provision-hm1ppwj6.js");
4507
+ const { runProvision } = await import("./provision-dphktm75.js");
4485
4508
  return runProvision(context, {
4486
4509
  resumeCommand: buildResumeCommand("provision", context.rawFlags)
4487
4510
  });
@@ -4594,8 +4617,8 @@ var commandRegistry = createCommandRegistry([
4594
4617
  name: "harness",
4595
4618
  description: "Analyze, validate, approve, sync, delete, and explain the local multi-agent harness graph",
4596
4619
  examples: [
4597
- "moda harness analyze --summary",
4598
- "moda harness analyze --remote",
4620
+ "moda harness analyze --experimental --summary",
4621
+ "moda harness analyze --experimental --remote",
4599
4622
  "moda harness pull --sync",
4600
4623
  "moda harness approve --yes",
4601
4624
  "moda harness sync --from-report .moda/harness-report.json",
@@ -4746,6 +4769,12 @@ var commandRegistry = createCommandRegistry([
4746
4769
  examples: ["moda tool-failure-detail search --include-window"],
4747
4770
  ...dataApiDefaults
4748
4771
  }),
4772
+ legacyCommand({
4773
+ name: "problems",
4774
+ description: "Rank cross-signal Problems by root cause (what to fix first)",
4775
+ examples: ["moda problems", "moda problems --days-back=7 --limit=10"],
4776
+ ...dataApiDefaults
4777
+ }),
4749
4778
  legacyCommand({
4750
4779
  name: "feedback",
4751
4780
  description: "Flag wrong/missing data or CLI quirks to the Moda team",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildSourceSnapshot
3
- } from "./cli-y55bgg14.js";
4
- import"./cli-mnqa4rp6.js";
3
+ } from "./cli-jntzpem2.js";
4
+ import"./cli-vc7zddj1.js";
5
5
 
6
6
  // src/harness-github-actions.ts
7
7
  var DEFAULT_MODA_GITHUB_URL = "https://moda-github.modas.workers.dev";
@@ -9,7 +9,7 @@ import {
9
9
  runPromptSync,
10
10
  runSkillSync,
11
11
  upsertSkillManifestRecord
12
- } from "./cli-rbftde0m.js";
12
+ } from "./cli-kqvjt12y.js";
13
13
  import {
14
14
  codingAgentDisplayName,
15
15
  describeCodingAgentEvent,
@@ -27,14 +27,14 @@ import {
27
27
  runHarnessCommand,
28
28
  startRemoteAnalyze,
29
29
  stripAnsi
30
- } from "./cli-y55bgg14.js";
30
+ } from "./cli-jntzpem2.js";
31
31
  import {
32
32
  selectTenantAndCreateKey
33
- } from "./cli-ysegdrm5.js";
33
+ } from "./cli-tdttb4cv.js";
34
34
  import {
35
35
  loadToken,
36
36
  login
37
- } from "./cli-c4se7a5d.js";
37
+ } from "./cli-8s69sg7f.js";
38
38
  import {
39
39
  CliAuthError,
40
40
  CliInputError,
@@ -42,7 +42,7 @@ import {
42
42
  createCommandContext,
43
43
  resolveIngestUrl,
44
44
  resolveModaBaseUrl
45
- } from "./cli-mnqa4rp6.js";
45
+ } from "./cli-vc7zddj1.js";
46
46
 
47
47
  // src/init/index.ts
48
48
  import { existsSync as existsSync6, mkdirSync as mkdirSync5, readdirSync as readdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "node:fs";
@@ -1792,6 +1792,7 @@ async function runInit(flags, options = {}) {
1792
1792
  const nestedHarnessFlags = (extra) => commandFlags({
1793
1793
  summary: true,
1794
1794
  yes: true,
1795
+ experimental: true,
1795
1796
  json: json || agent,
1796
1797
  agent,
1797
1798
  quiet: true,
@@ -2406,6 +2407,9 @@ function writeHarnessRescanWorkflow(cwd = process.cwd(), paths) {
2406
2407
  " env:",
2407
2408
  " MODA_API_KEY: ${{ secrets.MODA_API_KEY }}",
2408
2409
  " MODA_TENANT_ID: ${{ secrets.MODA_TENANT_ID }}",
2410
+ " # `moda harness analyze` is opt-in (the Moda GitHub App is the default",
2411
+ " # path); this workflow drives the CLI analyze directly, so it opts in.",
2412
+ ' MODA_HARNESS_ANALYZE_CLI: "1"',
2409
2413
  " steps:",
2410
2414
  " - uses: actions/checkout@v4",
2411
2415
  " - uses: actions/setup-node@v4",
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  selectTenantAndCreateKey
3
- } from "./cli-ysegdrm5.js";
3
+ } from "./cli-tdttb4cv.js";
4
4
  import {
5
5
  loadAuthSession
6
- } from "./cli-c4se7a5d.js";
6
+ } from "./cli-8s69sg7f.js";
7
7
  import {
8
8
  CliAuthError,
9
9
  resolveIngestUrl,
10
10
  resolveModaBaseUrl,
11
11
  stringOption
12
- } from "./cli-mnqa4rp6.js";
12
+ } from "./cli-vc7zddj1.js";
13
13
 
14
14
  // src/provision.ts
15
15
  async function runProvision(context, options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moda-ai/cli",
3
- "version": "1.23.1",
3
+ "version": "1.25.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-07-24T21:28:41.121Z",
4
- "cli_version": "1.23.1",
3
+ "bundled_at": "2026-07-28T04:14:38.909Z",
4
+ "cli_version": "1.25.0",
5
5
  "skills": [
6
6
  {
7
7
  "id": "integration-node-anthropic",