@moda-ai/cli 1.55.22 → 1.55.24

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 (40) hide show
  1. package/dist/{agent-mj622k8s.js → agent-b4tdzy9q.js} +8 -9
  2. package/dist/{cli-9x9adrtj.js → cli-0wr3483h.js} +1 -1
  3. package/dist/{cli-a5c9te95.js → cli-7xc585hc.js} +5 -5
  4. package/dist/{cli-rqk6f6n6.js → cli-9btx12wp.js} +24 -5
  5. package/dist/cli-9hc5bg2r.js +61 -0
  6. package/dist/{cli-cehskjde.js → cli-dn91fb56.js} +13 -15
  7. package/dist/{cli-5ke3xe6y.js → cli-dve50x7p.js} +258 -28
  8. package/dist/{cli-569hj0bj.js → cli-qvg26twp.js} +5 -4
  9. package/dist/{cli-033n2mpb.js → cli-qycsmxev.js} +6 -9
  10. package/dist/{cli-0ef72tqx.js → cli-rt26sbz7.js} +14 -14
  11. package/dist/{cli-pc5cw7mx.js → cli-vg88mg20.js} +5 -5
  12. package/dist/{cli-wf7gfa1e.js → cli-y2ty9vtv.js} +8 -10
  13. package/dist/cli.js +1310 -346
  14. package/dist/{doctor-mx6jf435.js → doctor-3r19ry92.js} +8 -9
  15. package/dist/{fix-9fmy6p2x.js → fix-exvxzvtz.js} +6 -7
  16. package/dist/{harness-github-actions-c826bfxs.js → harness-github-actions-atc5bbkj.js} +5 -6
  17. package/dist/{harness-xvg6ws6x.js → harness-vzy7n7ea.js} +5 -6
  18. package/dist/{index-1wbjz3jc.js → index-e1pf1qz2.js} +17 -17
  19. package/dist/{production-intelligence-dbe9dmc5.js → production-intelligence-c8e0xw3n.js} +17 -16
  20. package/dist/{profile-commands-kmmd9y86.js → profile-commands-6e2dgv72.js} +7 -48
  21. package/dist/prompt-source-mcp.js +5 -6
  22. package/dist/{prompts-1tkhrxkq.js → prompts-cvzt994j.js} +6 -7
  23. package/dist/{provision-wzttap58.js → provision-q86phh4a.js} +5 -4
  24. package/dist/{registry-atqyb5fa.js → registry-s2vdsfw8.js} +3 -4
  25. package/dist/{skills-gejdvjak.js → skills-tadh1jss.js} +5 -6
  26. package/dist/{sync-57ercmh9.js → sync-g8wtecz1.js} +7 -8
  27. package/package.json +1 -1
  28. package/skills/integration/index.json +2 -2
  29. package/skills/moda-cli/SKILL.md +31 -29
  30. package/skills/moda-cli/references/commands.md +22 -22
  31. package/skills/moda-cli/references/dashboard-parity.md +4 -4
  32. package/skills/moda-cli/references/detections.md +10 -10
  33. package/skills/moda-cli/references/feedback.md +2 -2
  34. package/skills/moda-cli/references/output-protocol.md +2 -2
  35. package/skills/moda-cli/references/production-intelligence.md +10 -10
  36. package/skills/moda-cli/references/recipes.md +14 -14
  37. package/skills/moda-cli/references/search-and-traces.md +32 -32
  38. package/skills/moda-cli/references/signals-and-false-positives.md +29 -29
  39. package/skills/moda-cli/references/troubleshooting.md +4 -4
  40. package/dist/cli-7ea02wca.js +0 -30
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  buildDoctorReport
3
- } from "./cli-pc5cw7mx.js";
4
- import"./cli-9x9adrtj.js";
5
- import"./cli-wf7gfa1e.js";
3
+ } from "./cli-vg88mg20.js";
4
+ import"./cli-0wr3483h.js";
5
+ import"./cli-y2ty9vtv.js";
6
6
  import"./cli-mm48br00.js";
7
7
  import {
8
8
  HARNESS_REPORT_APPROVAL_PATH,
@@ -14,19 +14,18 @@ import {
14
14
  readHarnessSyncState,
15
15
  summarizeHarness,
16
16
  validateHarnessReport
17
- } from "./cli-a5c9te95.js";
17
+ } from "./cli-7xc585hc.js";
18
18
  import"./cli-97fnztpy.js";
19
- import"./cli-569hj0bj.js";
20
- import"./cli-cehskjde.js";
21
- import"./cli-rqk6f6n6.js";
22
- import"./cli-7ea02wca.js";
19
+ import"./cli-qvg26twp.js";
20
+ import"./cli-dn91fb56.js";
21
+ import"./cli-9btx12wp.js";
23
22
  import {
24
23
  CliInputError,
25
24
  resolveApiKey,
26
25
  resolveIngestUrl,
27
26
  resolveModaBaseUrl,
28
27
  resolveTenantId
29
- } from "./cli-5ke3xe6y.js";
28
+ } from "./cli-dve50x7p.js";
30
29
  import"./cli-0v6na3yp.js";
31
30
 
32
31
  // src/agent.ts
@@ -8,7 +8,7 @@ import {
8
8
  saveProfileConfig,
9
9
  secretFilePathFromRef,
10
10
  writeSecretJsonFile
11
- } from "./cli-5ke3xe6y.js";
11
+ } from "./cli-dve50x7p.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-569hj0bj.js";
7
+ } from "./cli-qvg26twp.js";
8
8
  import {
9
9
  assertFlags,
10
10
  assertPositionals,
11
11
  requireTenant
12
- } from "./cli-cehskjde.js";
12
+ } from "./cli-dn91fb56.js";
13
13
  import {
14
14
  ApiError,
15
15
  callControlAPI
16
- } from "./cli-rqk6f6n6.js";
16
+ } from "./cli-9btx12wp.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-5ke3xe6y.js";
42
+ } from "./cli-dve50x7p.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-c826bfxs.js");
195874
+ const { runGithubActionsAnalyze } = await import("./harness-github-actions-atc5bbkj.js");
195875
195875
  const result = await runGithubActionsAnalyze(rootDir, {
195876
195876
  writeReport: (report2) => {
195877
195877
  const normalized = normalizeHarnessReport(report2);
@@ -1,11 +1,9 @@
1
1
  import {
2
- apiKeyHeaders
3
- } from "./cli-7ea02wca.js";
4
- import {
2
+ apiKeyHeaders,
5
3
  recordApiRequest,
6
4
  resolveApiKey,
7
5
  resolveModaBaseUrl
8
- } from "./cli-5ke3xe6y.js";
6
+ } from "./cli-dve50x7p.js";
9
7
 
10
8
  // src/api-client.ts
11
9
  var REQUEST_TIMEOUT_MS = 30000;
@@ -87,7 +85,28 @@ function isRetryable(status) {
87
85
  }
88
86
  async function callDataAPI(endpoint, init = { method: "GET" }, requestOptions = {}) {
89
87
  const url = `${resolveModaBaseUrl()}/api/v1/data${endpoint}`;
90
- return callModaAPI(url, init, {}, requestOptions);
88
+ try {
89
+ return await callModaAPI(url, init, {}, requestOptions);
90
+ } catch (error) {
91
+ const fallback = withoutIncludeContext(endpoint);
92
+ if (fallback === endpoint || !isUnknownIncludeContextError(error))
93
+ throw error;
94
+ return callModaAPI(`${resolveModaBaseUrl()}/api/v1/data${fallback}`, init, {}, requestOptions);
95
+ }
96
+ }
97
+ function withoutIncludeContext(endpoint) {
98
+ const [path, query] = endpoint.split("?", 2);
99
+ if (query === undefined)
100
+ return endpoint;
101
+ const params = new URLSearchParams(query);
102
+ if (!params.has("include_context"))
103
+ return endpoint;
104
+ params.delete("include_context");
105
+ const rest = params.toString();
106
+ return rest ? `${path}?${rest}` : path;
107
+ }
108
+ function isUnknownIncludeContextError(error) {
109
+ return error instanceof ApiError && error.statusCode === 400 && /property include_context should not exist/i.test(error.responseBody ?? "");
91
110
  }
92
111
  async function callControlAPI(endpoint, options = {}, profileOptions = {}, requestOptions = {}) {
93
112
  const url = `${resolveModaBaseUrl(profileOptions)}/api${endpoint}`;
@@ -0,0 +1,61 @@
1
+ import {
2
+ apiKeyHeaders,
3
+ embeddedTenantIdFromApiKey,
4
+ recordApiRequest,
5
+ resolveApiKey,
6
+ resolveApiKeyFromActiveProfile,
7
+ resolveModaBaseUrl
8
+ } from "./cli-dve50x7p.js";
9
+
10
+ // src/api-key-auth.ts
11
+ var PROBE_TIMEOUT_MS = 1e4;
12
+ function resolveApiKeyCredential(options = {}) {
13
+ const key = resolveApiKey(options);
14
+ if (!key)
15
+ return;
16
+ const env = options.env ?? process.env;
17
+ const source = env.MODA_API_KEY === key ? "env" : resolveApiKeyFromActiveProfile(options) === key ? "profile" : "config";
18
+ return { key, source, tenantId: embeddedTenantIdFromApiKey(key) };
19
+ }
20
+ function redactApiKey(key) {
21
+ if (key.length <= 12)
22
+ return "<redacted>";
23
+ return `${key.slice(0, 8)}...${key.slice(-4)}`;
24
+ }
25
+ async function fetchApiKeyProbe(baseUrl, headers, timeoutMs) {
26
+ const probe = (path) => {
27
+ recordApiRequest();
28
+ return fetch(`${baseUrl}/api/v1/data/${path}`, {
29
+ method: "GET",
30
+ headers,
31
+ signal: AbortSignal.timeout(timeoutMs)
32
+ });
33
+ };
34
+ const response = await probe("whoami");
35
+ if (response.status !== 404)
36
+ return response;
37
+ return probe("overview");
38
+ }
39
+ async function probeApiKey(key, options = {}) {
40
+ let response;
41
+ try {
42
+ response = await fetchApiKeyProbe(resolveModaBaseUrl(options), apiKeyHeaders(key, options), PROBE_TIMEOUT_MS);
43
+ } catch (error) {
44
+ const reason = error instanceof Error ? error.message : String(error);
45
+ return { outcome: "unreachable", reason };
46
+ }
47
+ if (response.status === 401 || response.status === 403) {
48
+ return { outcome: "rejected", status: response.status };
49
+ }
50
+ if (response.status !== 200) {
51
+ return { outcome: "unreachable", reason: `HTTP ${response.status}` };
52
+ }
53
+ try {
54
+ await response.json();
55
+ } catch {
56
+ return { outcome: "unreachable", reason: "non-JSON response from the Data API" };
57
+ }
58
+ return { outcome: "live" };
59
+ }
60
+
61
+ export { resolveApiKeyCredential, redactApiKey, fetchApiKeyProbe, probeApiKey };
@@ -2,18 +2,16 @@ import {
2
2
  ApiError,
3
3
  callControlAPI,
4
4
  callDataAPI
5
- } from "./cli-rqk6f6n6.js";
6
- import {
7
- isPlatformApiKey,
8
- setPlatformTenantOverride
9
- } from "./cli-7ea02wca.js";
5
+ } from "./cli-9btx12wp.js";
10
6
  import {
11
7
  CliAccessError,
12
8
  CliInputError,
13
9
  embeddedTenantIdFromApiKey,
10
+ isPlatformApiKey,
14
11
  resolveApiKey,
15
- resolveApiTenantId
16
- } from "./cli-5ke3xe6y.js";
12
+ resolveApiTenantId,
13
+ setPlatformTenantOverride
14
+ } from "./cli-dve50x7p.js";
17
15
 
18
16
  // src/schemas.ts
19
17
  import { z } from "zod";
@@ -211,7 +209,7 @@ var FalsePositiveSchema = z.object({
211
209
  conversation_id: z.string().min(1).max(255).optional().describe("Trace ID (required for problem-detection and custom-signal)"),
212
210
  attribution_id: z.string().regex(UUID_RE, "Attribution id must be a UUID").optional().describe("Detection UUID (required for problem-detection)"),
213
211
  family: z.string().regex(/^[a-z_]{1,64}$/, "Family must be a lowercase emotion family").optional().describe("Emotion family of the quote (quote kind)"),
214
- turn: z.preprocess((v) => typeof v === "string" && /^\d+$/.test(v.trim()) ? Number(v) : v, z.number().int().min(0).optional()).describe("Turn of the quote (quote kind; from moda emotions)"),
212
+ turn: z.preprocess((v) => typeof v === "string" && /^\d+$/.test(v.trim()) ? Number(v) : v, z.number().int().min(0).optional()).describe("Turn of the quote (quote kind; from moda detections list --family=emotion)"),
215
213
  quote: z.string().min(1).max(4000).optional().describe("The quoted user text (quote kind)"),
216
214
  tool: z.string().min(1).max(255).optional().describe("Failing tool name (tool kind)"),
217
215
  tool_use_id: z.string().min(1).max(255).optional().describe("Tool call id (tool kind; or pass --msg-index)"),
@@ -232,11 +230,11 @@ var FalsePositiveSchema = z.object({
232
230
  need(v.attribution_id, "--attribution-id is required for problem-detection");
233
231
  }
234
232
  if (v.kind === "quote") {
235
- need(v.family && v.turn !== undefined && v.quote, "--family, --turn and --quote are required for quote (copy them from moda emotions)");
233
+ need(v.family && v.turn !== undefined && v.quote, "--family, --turn and --quote are required for quote (copy them from moda detections list --family=emotion)");
236
234
  }
237
235
  if (v.kind === "tool") {
238
236
  need(v.tool, "--tool is required for tool (the failing tool name)");
239
- need(v.tool_use_id || v.msg_index !== undefined, "--tool-use-id or --msg-index is required for tool (from moda tool-failure-detail)");
237
+ need(v.tool_use_id || v.msg_index !== undefined, "--tool-use-id or --msg-index is required for tool (from moda detections tools)");
240
238
  }
241
239
  if (v.kind === "custom-signal") {
242
240
  need(v.conversation_id, "--conversation-id is required for custom-signal");
@@ -308,7 +306,7 @@ var TailSchema = z.object({
308
306
  full_scan: boolFlag().describe("Emotions: scan the whole window, not the top-scoring prefix (many more requests)")
309
307
  });
310
308
  var ToolFailureDetailSchema = z.object({
311
- tool_name: z.string().describe("Tool name (from moda tool-failures)"),
309
+ tool_name: z.string().describe("Tool name (from moda detections tools)"),
312
310
  subtype: z.string().optional().describe("Only this failure subtype"),
313
311
  days_back: daysBackFlag(7),
314
312
  limit: z.number().min(1).max(20).default(5).optional().describe("Maximum examples to return"),
@@ -499,7 +497,7 @@ var MISROUTE_WORDS = /attribut|misrout|false[\s_-]?positive|wrong[\s_-]?(?:probl
499
497
  function dedicatedCommandHint(category, rawCategory) {
500
498
  if (!MISROUTE_CATEGORIES.has(category) && !(rawCategory && MISROUTE_WORDS.test(rawCategory)))
501
499
  return;
502
- return "Feedback is read by the Moda team but does not change the problem. To act on it directly, use " + "`moda problem-feedback <problem_id> --action=flag_attribution --attribution-id=<uuid> --reason=TEXT` (a trace wrongly " + "attributed to a problem), `moda false-positive <kind> <target> --reason=TEXT` (a detection that should not " + "have fired), or `moda fix dismiss <fix_id> --reason=TEXT` (a fix aimed at the wrong problem).";
500
+ return "Feedback is read by the Moda team but does not change the problem. To act on it directly, use " + "`moda problems feedback <problem_id> --action=flag_attribution --attribution-id=<uuid> --reason=TEXT` (a trace wrongly " + "attributed to a problem), `moda review <kind> <target> --reason=TEXT` (a detection that should not " + "have fired), or `moda fix dismiss <fix_id> --reason=TEXT` (a fix aimed at the wrong problem).";
503
501
  }
504
502
 
505
503
  // src/command-flags.ts
@@ -1000,9 +998,9 @@ async function runUserCommand(context) {
1000
998
  }
1001
999
  async function runProblemReopenCommand(context) {
1002
1000
  assertFlags("problem-reopen", context.flags, specFlagNames(COMMAND_FLAG_SPECS["problem-reopen"]));
1003
- assertPositionals("problem-reopen", context.positionals, 1, "moda problem-reopen <problem_id> [--reason=TEXT]");
1001
+ assertPositionals("problem-reopen", context.positionals, 1, "moda problems reopen <problem_id> [--reason=TEXT]");
1004
1002
  const problemId = context.positionals[0];
1005
- const usage = "Usage: moda problem-reopen <problem_id> [--reason=TEXT]";
1003
+ const usage = "Usage: moda problems reopen <problem_id> [--reason=TEXT]";
1006
1004
  if (!problemId || !UUID_RE2.test(problemId))
1007
1005
  throw new CliInputError("<problem_id> (UUID) is required.", usage);
1008
1006
  const reason = context.flags.reason;
@@ -1299,4 +1297,4 @@ function unknownSignalsSubcommandError(sub, args = []) {
1299
1297
  ${SIGNAL_USAGE}`);
1300
1298
  }
1301
1299
 
1302
- export { ProblemsRemainderSchema, UUID_RE, ProblemImpactSchema, PROBLEM_FEEDBACK_ACTIONS, ProblemFeedbackSchema, ProblemLinearFileSchema, SIGNAL_LABELS, SignalLabelSchema, DETECTION_VERDICTS, DetectionReviewSchema, FALSE_POSITIVE_KINDS, FalsePositiveSchema, StepScoresSchema, AuditSchema, FEEDBACK_USAGE, isFeedbackRefFlag, buildFeedbackRequest, COMMAND_FLAG_SPECS, flagSpecFor, kebabFlag, schemaShape, specFlagKeys, specFlagNames, describeSpecFlags, closestMatches, renderFlagHelp, subcommandHelpFlags, manifestFlagFields, requireTenant, assertFlags, assertPositionals, runUsersCommand, runUserCommand, runProblemReopenCommand, runSignalsManagementCommand, SIGNALS_MANAGEMENT_SUBCOMMANDS, unknownSignalsSubcommandError };
1300
+ export { ProblemsRemainderSchema, UUID_RE, ProblemImpactSchema, PROBLEM_FEEDBACK_ACTIONS, ProblemFeedbackSchema, ProblemLinearFileSchema, SignalLabelSchema, DETECTION_VERDICTS, DetectionReviewSchema, FALSE_POSITIVE_KINDS, FalsePositiveSchema, EMOTION_FAMILIES, LAZINESS_FAMILIES, StepScoresSchema, AuditSchema, FEEDBACK_USAGE, isFeedbackRefFlag, buildFeedbackRequest, COMMAND_FLAG_SPECS, flagSpecFor, kebabFlag, schemaShape, specFlagKeys, specFlagNames, describeSpecFlags, closestMatches, renderFlagHelp, subcommandHelpFlags, manifestFlagFields, requireTenant, assertFlags, assertPositionals, runUsersCommand, runUserCommand, runProblemReopenCommand, runSignalsManagementCommand, SIGNALS_MANAGEMENT_SUBCOMMANDS, unknownSignalsSubcommandError };