@moda-ai/cli 1.55.36 → 1.55.38

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 (38) hide show
  1. package/dist/{agent-g07tg64w.js → agent-9r58v0bc.js} +8 -8
  2. package/dist/{cli-e23g9ywa.js → cli-3n040fp2.js} +1 -1
  3. package/dist/{cli-k007ztbs.js → cli-93926afn.js} +4 -4
  4. package/dist/{cli-97jew729.js → cli-9g5kzsg6.js} +1 -1
  5. package/dist/{cli-dr6x0zv7.js → cli-b7nyw498.js} +1 -1
  6. package/dist/{cli-6j8h2ave.js → cli-dmnayt2r.js} +8 -8
  7. package/dist/{cli-fwpqghgc.js → cli-n311b8g0.js} +112 -2
  8. package/dist/{cli-602yx84w.js → cli-nh23q6ay.js} +5 -5
  9. package/dist/{cli-99p2jh28.js → cli-rcjhfts4.js} +24 -10
  10. package/dist/{cli-9bgnvth2.js → cli-sk1p71wr.js} +1 -1
  11. package/dist/{cli-x9cwat4a.js → cli-skvvwp2q.js} +5 -5
  12. package/dist/{cli-9bgk5jeh.js → cli-tdcx8yz9.js} +3 -3
  13. package/dist/{cli-n2hng3gv.js → cli-xheg54qc.js} +80 -7
  14. package/dist/{cli-yz8xcpyk.js → cli-xk630wjq.js} +1 -1
  15. package/dist/{cli-5fstvkva.js → cli-xtyszvq1.js} +5 -5
  16. package/dist/cli.js +319 -39
  17. package/dist/{doctor-tvre7zvk.js → doctor-xq5bjvpq.js} +7 -7
  18. package/dist/{fix-w5z02wt4.js → fix-kvszavm1.js} +4 -4
  19. package/dist/{harness-github-actions-6gdrpn4m.js → harness-github-actions-drbkcb8d.js} +5 -5
  20. package/dist/{harness-6vwehf47.js → harness-qatnwxrz.js} +5 -5
  21. package/dist/{index-75vcntpe.js → index-y5jnz2t2.js} +11 -11
  22. package/dist/{production-intelligence-7wb1djy2.js → production-intelligence-j55vaw6t.js} +61 -4
  23. package/dist/{profile-commands-h8evz9x0.js → profile-commands-skdxe17v.js} +3 -3
  24. package/dist/{prompt-attribution-t0eq8gn8.js → prompt-attribution-zq38actx.js} +5 -5
  25. package/dist/prompt-source-mcp.js +5 -5
  26. package/dist/{prompts-ab-t7xptf0c.js → prompts-ab-yd2dawe3.js} +7 -7
  27. package/dist/{prompts-b8qx3mrv.js → prompts-cwqn8a57.js} +5 -5
  28. package/dist/{prompts-propose-8feadk2t.js → prompts-propose-11dj9ked.js} +7 -7
  29. package/dist/{provision-y5bdbh4y.js → provision-ghca9d54.js} +5 -5
  30. package/dist/{registry-ctnn8e26.js → registry-76sngjw6.js} +3 -3
  31. package/dist/{skills-96z55tj4.js → skills-btn9r48v.js} +5 -5
  32. package/dist/{sync-drz7req6.js → sync-ye7nxeen.js} +7 -7
  33. package/package.json +1 -1
  34. package/skills/integration/index.json +2 -2
  35. package/skills/moda-cli/SKILL.md +5 -2
  36. package/skills/moda-cli/references/commands.md +3 -0
  37. package/skills/moda-cli/references/dashboard-parity.md +4 -0
  38. package/skills/moda-cli/references/detections.md +93 -0
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  buildDoctorReport
3
- } from "./cli-5fstvkva.js";
4
- import"./cli-9bgnvth2.js";
5
- import"./cli-6j8h2ave.js";
3
+ } from "./cli-xtyszvq1.js";
4
+ import"./cli-sk1p71wr.js";
5
+ import"./cli-dmnayt2r.js";
6
6
  import"./cli-mm48br00.js";
7
7
  import {
8
8
  readHarnessSyncState
@@ -15,15 +15,15 @@ import {
15
15
  readHarnessReport,
16
16
  validateHarnessReport
17
17
  } from "./cli-cesds766.js";
18
- import"./cli-dr6x0zv7.js";
19
- import"./cli-n2hng3gv.js";
20
- import"./cli-e23g9ywa.js";
18
+ import"./cli-b7nyw498.js";
19
+ import"./cli-xheg54qc.js";
20
+ import"./cli-3n040fp2.js";
21
21
  import {
22
22
  resolveApiKey,
23
23
  resolveIngestUrl,
24
24
  resolveModaBaseUrl,
25
25
  resolveTenantId
26
- } from "./cli-99p2jh28.js";
26
+ } from "./cli-rcjhfts4.js";
27
27
  import {
28
28
  CliInputError
29
29
  } from "./cli-k4tqwah4.js";
@@ -94,7 +94,7 @@ async function buildAgentContext(context) {
94
94
  const graph = readHarnessGraphIfPresent(context.cwd);
95
95
  const reportState = readHarnessReportState(context.cwd);
96
96
  const syncState = readHarnessSyncState(context.cwd);
97
- const harness = graph ? await import("./harness-6vwehf47.js") : undefined;
97
+ const harness = graph ? await import("./harness-qatnwxrz.js") : undefined;
98
98
  const topFindings = doctor.checks.filter((check) => check.status === "fail" || check.status === "warning").slice(0, 12).map(checkToFinding);
99
99
  const evidenceRefs = [
100
100
  ...doctor.checks.map(checkToEvidenceRef),
@@ -3,7 +3,7 @@ import {
3
3
  recordApiRequest,
4
4
  resolveApiKey,
5
5
  resolveModaBaseUrl
6
- } from "./cli-99p2jh28.js";
6
+ } from "./cli-rcjhfts4.js";
7
7
 
8
8
  // src/api-client.ts
9
9
  var REQUEST_TIMEOUT_MS = 30000;
@@ -13,22 +13,22 @@ import {
13
13
  } from "./cli-hcwdz9sd.js";
14
14
  import {
15
15
  createCommandContext
16
- } from "./cli-dr6x0zv7.js";
16
+ } from "./cli-b7nyw498.js";
17
17
  import {
18
18
  assertFlags,
19
19
  assertPositionals,
20
20
  writeDryRun
21
- } from "./cli-n2hng3gv.js";
21
+ } from "./cli-xheg54qc.js";
22
22
  import {
23
23
  callControlAPI
24
- } from "./cli-e23g9ywa.js";
24
+ } from "./cli-3n040fp2.js";
25
25
  import {
26
26
  recordApiRequest,
27
27
  resolveApiKey,
28
28
  resolveIngestUrl,
29
29
  resolveTenantId,
30
30
  shellArg
31
- } from "./cli-99p2jh28.js";
31
+ } from "./cli-rcjhfts4.js";
32
32
  import {
33
33
  CliInputError
34
34
  } from "./cli-k4tqwah4.js";
@@ -5,7 +5,7 @@ import {
5
5
  resolveApiKey,
6
6
  resolveApiKeyFromActiveProfile,
7
7
  resolveModaBaseUrl
8
- } from "./cli-99p2jh28.js";
8
+ } from "./cli-rcjhfts4.js";
9
9
 
10
10
  // src/api-key-auth.ts
11
11
  var PROBE_TIMEOUT_MS = 1e4;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createCliOutput,
3
3
  outputModeFromFlags
4
- } from "./cli-99p2jh28.js";
4
+ } from "./cli-rcjhfts4.js";
5
5
 
6
6
  // src/boolean-words.ts
7
7
  var BOOLEAN_TRUE_WORDS = new Set(["true", "yes", "1", "on"]);
@@ -4,14 +4,14 @@ import {
4
4
  } from "./cli-mm48br00.js";
5
5
  import {
6
6
  createCommandContext
7
- } from "./cli-dr6x0zv7.js";
7
+ } from "./cli-b7nyw498.js";
8
8
  import {
9
9
  assertFlags,
10
10
  assertPositionals
11
- } from "./cli-n2hng3gv.js";
11
+ } from "./cli-xheg54qc.js";
12
12
  import {
13
13
  callControlAPI
14
- } from "./cli-e23g9ywa.js";
14
+ } from "./cli-3n040fp2.js";
15
15
  import {
16
16
  CliInputError
17
17
  } from "./cli-k4tqwah4.js";
@@ -5725,9 +5725,9 @@ async function runPromptsCommand(input, legacyFlags, legacyProfileOptions) {
5725
5725
  await promotePrompt(positionals, flags, profileOptions, context);
5726
5726
  break;
5727
5727
  case "ab":
5728
- return (await import("./prompts-ab-t7xptf0c.js")).runPromptAb(flags, profileOptions, context);
5728
+ return (await import("./prompts-ab-yd2dawe3.js")).runPromptAb(flags, profileOptions, context);
5729
5729
  case "propose":
5730
- await (await import("./prompts-propose-8feadk2t.js")).runPromptPropose(positionals, flags, profileOptions, context);
5730
+ await (await import("./prompts-propose-11dj9ked.js")).runPromptPropose(positionals, flags, profileOptions, context);
5731
5731
  break;
5732
5732
  case "list":
5733
5733
  case "show":
@@ -5830,7 +5830,7 @@ async function runPromptSyncExclusive(flags, profileOptions, options) {
5830
5830
  const analyzedDefinitions = new Map;
5831
5831
  if (flags["no-analyze"] !== "true") {
5832
5832
  options.onProgress?.("Analyzing prompt sources before sync.");
5833
- const { analyzeHarnessPrompts } = await import("./harness-6vwehf47.js");
5833
+ const { analyzeHarnessPrompts } = await import("./harness-qatnwxrz.js");
5834
5834
  const result = await analyzeHarnessPrompts({
5835
5835
  rootDir: process.cwd(),
5836
5836
  existing: established.flatMap((prompt) => prompt.sourceDefinition ? [prompt.sourceDefinition.source] : []),
@@ -5858,7 +5858,7 @@ async function runPromptSyncExclusive(flags, profileOptions, options) {
5858
5858
  const mergedSources = mergePromptSources(manifest.sources, extraSources);
5859
5859
  const manifestUpdate = stableJson(mergedSources) === stableJson(mergePromptSources(manifest.sources, [])) ? undefined : $stringify({ version: 2, prompt_paths: manifest.promptPaths, sources: mergedSources });
5860
5860
  const prompts = await discoverPrompts(extraSources);
5861
- const { checkPromptAttribution } = await import("./prompt-attribution-t0eq8gn8.js");
5861
+ const { checkPromptAttribution } = await import("./prompt-attribution-zq38actx.js");
5862
5862
  const attribution = checkPromptAttribution(process.cwd(), prompts.map((prompt) => prompt.key));
5863
5863
  const brokenAttribution = attribution.references.filter((reference) => reference.status === "missing");
5864
5864
  if (brokenAttribution.length) {
@@ -6164,7 +6164,7 @@ async function migratePromptManifest(options = {}) {
6164
6164
  let addedSources = [];
6165
6165
  let pendingSources = [];
6166
6166
  if (options.discover) {
6167
- const { analyzeHarnessPrompts } = await import("./harness-6vwehf47.js");
6167
+ const { analyzeHarnessPrompts } = await import("./harness-qatnwxrz.js");
6168
6168
  const result = await analyzeHarnessPrompts({
6169
6169
  rootDir: root,
6170
6170
  existing: manifest.sources,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  shellArg
3
- } from "./cli-99p2jh28.js";
3
+ } from "./cli-rcjhfts4.js";
4
4
  import {
5
5
  CliInputError
6
6
  } from "./cli-k4tqwah4.js";
@@ -422,6 +422,116 @@ function compactProblemDossier(response, problemId) {
422
422
  }
423
423
  return { data, nextCommands };
424
424
  }
425
+ function toolFailureExamplesCommand(toolName, daysBack, subtype) {
426
+ return `moda detections tools ${shellArg(toolName)}${subtype ? ` --subtype=${shellArg(subtype)}` : ""} --days-back=${daysBack}`;
427
+ }
428
+ function toolCatalogGetCommand(toolName, daysBack) {
429
+ return `moda tools get ${shellArg(toolName)} --days-back=${daysBack}`;
430
+ }
431
+ var TOOL_CATALOG_AGENT_LIMITS = {
432
+ valuesPerField: 3,
433
+ valueChars: 80,
434
+ fields: 20,
435
+ inputChars: 200,
436
+ examplesPerClass: 2,
437
+ recentCalls: 5
438
+ };
439
+ function traceGetCommand(conversationId, msgIndex) {
440
+ return `moda traces get ${shellArg(contextTarget(conversationId))} --msg-index=${msgIndex} --window=${TOOL_FAILURE_CONTEXT_RADIUS}`;
441
+ }
442
+ function shapeToolCatalogDetail(response, opts) {
443
+ const toolName = asString(response.tool_name) ?? "";
444
+ let shortened = 0;
445
+ const cut = (value, max) => {
446
+ if (!opts.shorten || typeof value !== "string" || value.length <= max)
447
+ return value;
448
+ shortened += 1;
449
+ return `${value.slice(0, max)}…`;
450
+ };
451
+ const failureBlock = asRecord(response.failure_categories);
452
+ const categories = Array.isArray(failureBlock?.categories) ? failureBlock.categories.map((item) => {
453
+ const row = asRecord(item);
454
+ if (!row)
455
+ return item;
456
+ const latest = asRecord(row.latest_failure);
457
+ const conversationId = asString(latest?.conversation_id);
458
+ const msgIndex = asNumber(latest?.msg_index);
459
+ const category = asString(row.category);
460
+ return {
461
+ ...row,
462
+ sample_error: cut(row.sample_error, TOOL_CATALOG_AGENT_LIMITS.inputChars),
463
+ ...conversationId && msgIndex !== null ? { context_command: traceGetCommand(conversationId, msgIndex) } : {},
464
+ ...category ? { examples_command: toolFailureExamplesCommand(toolName, opts.daysBack, category) } : {}
465
+ };
466
+ }) : undefined;
467
+ const definition = asRecord(response.definition);
468
+ const allObserved = Array.isArray(definition?.observed_fields) ? definition.observed_fields : undefined;
469
+ const keptObserved = allObserved && opts.shorten && allObserved.length > TOOL_CATALOG_AGENT_LIMITS.fields ? allObserved.slice(0, TOOL_CATALOG_AGENT_LIMITS.fields) : allObserved;
470
+ if (keptObserved && allObserved && keptObserved.length < allObserved.length)
471
+ shortened += 1;
472
+ const observed = keptObserved ? keptObserved.map((item) => {
473
+ const field = asRecord(item);
474
+ if (!field || !opts.shorten || !Array.isArray(field.common_values))
475
+ return item;
476
+ const values = field.common_values;
477
+ const over = values.length > TOOL_CATALOG_AGENT_LIMITS.valuesPerField;
478
+ if (over)
479
+ shortened += 1;
480
+ return {
481
+ ...field,
482
+ common_values: values.slice(0, TOOL_CATALOG_AGENT_LIMITS.valuesPerField).map((entry) => {
483
+ const value = asRecord(entry);
484
+ return value ? { ...value, value: cut(value.value, TOOL_CATALOG_AGENT_LIMITS.valueChars) } : entry;
485
+ }),
486
+ ...over ? { common_values_total: values.length } : {}
487
+ };
488
+ }) : undefined;
489
+ const toolClasses = Array.isArray(response.tool_classes) ? response.tool_classes.map((item) => {
490
+ const row = asRecord(item);
491
+ if (!row || !opts.shorten)
492
+ return item;
493
+ const examples = Array.isArray(row.example_inputs) ? row.example_inputs : [];
494
+ if (examples.length > TOOL_CATALOG_AGENT_LIMITS.examplesPerClass)
495
+ shortened += 1;
496
+ return {
497
+ ...row,
498
+ sample_input: cut(row.sample_input, TOOL_CATALOG_AGENT_LIMITS.inputChars),
499
+ example_inputs: examples.slice(0, TOOL_CATALOG_AGENT_LIMITS.examplesPerClass).map((example) => cut(example, TOOL_CATALOG_AGENT_LIMITS.inputChars))
500
+ };
501
+ }) : undefined;
502
+ const allRecent = Array.isArray(response.recent_calls) ? response.recent_calls : undefined;
503
+ if (allRecent && opts.shorten && allRecent.length > TOOL_CATALOG_AGENT_LIMITS.recentCalls)
504
+ shortened += 1;
505
+ const recent = allRecent ? (opts.shorten ? allRecent.slice(0, TOOL_CATALOG_AGENT_LIMITS.recentCalls) : allRecent).map((item) => {
506
+ const row = asRecord(item);
507
+ if (!row)
508
+ return item;
509
+ const conversationId = asString(row.conversation_id);
510
+ const msgIndex = asNumber(row.msg_index);
511
+ return {
512
+ ...row,
513
+ inputs: cut(row.inputs, TOOL_CATALOG_AGENT_LIMITS.inputChars),
514
+ ...conversationId && msgIndex !== null ? { context_command: traceGetCommand(conversationId, msgIndex) } : {}
515
+ };
516
+ }) : undefined;
517
+ return {
518
+ data: {
519
+ ...response,
520
+ ...definition ? {
521
+ definition: {
522
+ ...definition,
523
+ ...observed ? { observed_fields: observed } : {},
524
+ ...allObserved && observed && observed.length < allObserved.length ? { observed_fields_total: allObserved.length } : {}
525
+ }
526
+ } : {},
527
+ ...toolClasses ? { tool_classes: toolClasses } : {},
528
+ ...failureBlock ? { failure_categories: { ...failureBlock, ...categories ? { categories } : {} } } : {},
529
+ ...recent ? { recent_calls: recent } : {},
530
+ ...allRecent && recent && recent.length < allRecent.length ? { recent_calls_total: allRecent.length } : {}
531
+ },
532
+ shortened
533
+ };
534
+ }
425
535
 
426
536
  // src/intelligence-schema.ts
427
537
  var INTELLIGENCE_SCHEMA_VERSION = "moda.intelligence.v1";
@@ -566,4 +676,4 @@ var MODA_INTELLIGENCE_V1_JSON_SCHEMA = {
566
676
  }
567
677
  };
568
678
 
569
- export { BATCH_MAX_TARGETS, BATCH_CONCURRENCY, parseBatchTarget, collectBatchTargets, mapWithConcurrency, contextTarget, asRecord, asString, asNumber, frustrationAnchorIndex, frustrationsFromEmotions, withFrustrationAnchors, trimToolFailureConversations, withToolFailureAnchors, embeddedWindowSize, withoutDetectionWindows, compactProblemDossier, INTELLIGENCE_SCHEMA_VERSION, MODA_INTELLIGENCE_V1_JSON_SCHEMA };
679
+ export { BATCH_MAX_TARGETS, BATCH_CONCURRENCY, parseBatchTarget, collectBatchTargets, mapWithConcurrency, contextTarget, asRecord, asString, asNumber, frustrationAnchorIndex, frustrationsFromEmotions, withFrustrationAnchors, trimToolFailureConversations, withToolFailureAnchors, embeddedWindowSize, withoutDetectionWindows, compactProblemDossier, toolFailureExamplesCommand, toolCatalogGetCommand, shapeToolCatalogDetail, INTELLIGENCE_SCHEMA_VERSION, MODA_INTELLIGENCE_V1_JSON_SCHEMA };
@@ -4,19 +4,19 @@ import {
4
4
  parsePromptFileForAb,
5
5
  readPromptLock,
6
6
  runPromptSync
7
- } from "./cli-6j8h2ave.js";
7
+ } from "./cli-dmnayt2r.js";
8
8
  import {
9
9
  DEFAULT_POLL_INTERVAL_MS,
10
10
  DEFAULT_WAIT_TIMEOUT_MS,
11
11
  fetchLatestRun
12
- } from "./cli-yz8xcpyk.js";
12
+ } from "./cli-xk630wjq.js";
13
13
  import {
14
14
  UUID_RE
15
- } from "./cli-n2hng3gv.js";
15
+ } from "./cli-xheg54qc.js";
16
16
  import {
17
17
  callControlAPI,
18
18
  callDataAPI
19
- } from "./cli-e23g9ywa.js";
19
+ } from "./cli-3n040fp2.js";
20
20
  import {
21
21
  EXIT_ERROR,
22
22
  EXIT_OK,
@@ -24,7 +24,7 @@ import {
24
24
  setPlatformTenantOverride,
25
25
  shellArg,
26
26
  validateConfig
27
- } from "./cli-99p2jh28.js";
27
+ } from "./cli-rcjhfts4.js";
28
28
  import {
29
29
  CliInputError
30
30
  } from "./cli-k4tqwah4.js";
@@ -1277,7 +1277,7 @@ function createAgentEnvelope(options) {
1277
1277
  findings: text.findings,
1278
1278
  evidence_refs: text.evidence_refs,
1279
1279
  recommended_actions: text.recommended_actions,
1280
- next_commands: [...text.next_commands, ...canonicalSuggestions(bounded.nextCommands ?? [])],
1280
+ next_commands: [...withoutSupersededPaging(text.next_commands, bounded.supersededPaging), ...canonicalSuggestions(bounded.nextCommands ?? [])],
1281
1281
  artifacts: [
1282
1282
  ...options.artifacts ?? [],
1283
1283
  ...bounded.fullOutputPath ? [{ kind: "full_output", path: bounded.fullOutputPath, description: "Complete command output (the same JSON --json prints); data in this envelope was bounded." }] : [],
@@ -1921,16 +1921,18 @@ function continuationCommand(invocation, overrides) {
1921
1921
  }
1922
1922
  var PAGED_LIST_BY_COMMAND = {
1923
1923
  "tool-failure-detail": "examples",
1924
- emotions: "detections",
1925
- frustrations: "frustrations",
1924
+ "tool-catalog": "tools",
1925
+ emotions: ["detections", "traces"],
1926
+ frustrations: ["frustrations", "traces"],
1926
1927
  laziness: "conversations",
1927
1928
  "problems remainder": "groups",
1928
1929
  "problem remainder": "groups"
1929
1930
  };
1930
- function pagedListFor(invocation) {
1931
+ function pagedListsFor(invocation) {
1931
1932
  const { command, positionals } = invocation.routedAs ?? invocation;
1932
1933
  const subcommand = positionals[0];
1933
- return (subcommand !== undefined ? PAGED_LIST_BY_COMMAND[`${command} ${subcommand}`] : undefined) ?? PAGED_LIST_BY_COMMAND[command];
1934
+ const paged = (subcommand !== undefined ? PAGED_LIST_BY_COMMAND[`${command} ${subcommand}`] : undefined) ?? PAGED_LIST_BY_COMMAND[command];
1935
+ return paged === undefined ? [] : typeof paged === "string" ? [paged] : paged;
1934
1936
  }
1935
1937
  var MAX_PAGE_OFFSET = 1e4;
1936
1938
  function rewritePagination(list, isTopLevel, invocation) {
@@ -1945,8 +1947,8 @@ function rewritePagination(list, isTopLevel, invocation) {
1945
1947
  const listKey = list.path.split(".").pop() ?? list.path;
1946
1948
  const arrayKeys = Object.keys(parent).filter((key) => Array.isArray(parent[key]));
1947
1949
  if (arrayKeys.length > 1) {
1948
- const paged = invocation ? pagedListFor(invocation) : undefined;
1949
- if (paged === undefined || paged !== listKey)
1950
+ const paged = invocation ? pagedListsFor(invocation) : [];
1951
+ if (!paged.includes(listKey))
1950
1952
  return;
1951
1953
  }
1952
1954
  if (typeof pagination.returned === "number" ? pagination.returned !== originalLength : typeof pagination.limit === "number" && originalLength > pagination.limit) {
@@ -1990,7 +1992,8 @@ function rewritePagination(list, isTopLevel, invocation) {
1990
1992
  purpose: `Fetch the ${omitted} row(s) of this page that were left out to fit the agent byte limit.`,
1991
1993
  mutability: "read",
1992
1994
  requires_approval: false
1993
- }
1995
+ },
1996
+ supersedes: "offset"
1994
1997
  };
1995
1998
  }
1996
1999
  if (hadCursor || "next_cursor" in pagination || "cursor" in invocation.flags) {
@@ -2002,7 +2005,8 @@ function rewritePagination(list, isTopLevel, invocation) {
2002
2005
  purpose: `Re-read this page at --limit=${kept} (what fits) to get a next_cursor that starts at the first omitted row.`,
2003
2006
  mutability: "read",
2004
2007
  requires_approval: false
2005
- }
2008
+ },
2009
+ supersedes: "cursor"
2006
2010
  };
2007
2011
  }
2008
2012
  return { note: `${where} holds ${kept} of ${originalLength} row(s)` };
@@ -2080,6 +2084,7 @@ function boundForAgent(data, maxBytes = agentMaxOutputBytes(), options = {}) {
2080
2084
  const root = asRecord(bounded);
2081
2085
  const notes = [];
2082
2086
  const nextCommands = [];
2087
+ const supersededPaging = new Set;
2083
2088
  for (const list of droppedLists.values()) {
2084
2089
  const rewritten = rewritePagination(list, root !== undefined && list.parent === root, options.invocation);
2085
2090
  if (!rewritten)
@@ -2087,6 +2092,8 @@ function boundForAgent(data, maxBytes = agentMaxOutputBytes(), options = {}) {
2087
2092
  notes.push(rewritten.note);
2088
2093
  if (rewritten.nextCommand)
2089
2094
  nextCommands.push(rewritten.nextCommand);
2095
+ if (rewritten.supersedes)
2096
+ supersededPaging.add(rewritten.supersedes);
2090
2097
  }
2091
2098
  const omittedTotal = dropped.reduce((sum, [, count]) => sum + count, 0);
2092
2099
  const actions = [
@@ -2112,9 +2119,16 @@ function boundForAgent(data, maxBytes = agentMaxOutputBytes(), options = {}) {
2112
2119
  }
2113
2120
  },
2114
2121
  fullOutputPath,
2115
- ...nextCommands.length > 0 ? { nextCommands } : {}
2122
+ ...nextCommands.length > 0 ? { nextCommands } : {},
2123
+ ...supersededPaging.size > 0 ? { supersededPaging: [...supersededPaging] } : {}
2116
2124
  };
2117
2125
  }
2126
+ function withoutSupersededPaging(commands, superseded) {
2127
+ if (!superseded || superseded.length === 0)
2128
+ return commands;
2129
+ const flags = superseded.map((flag) => new RegExp(`(^|\\s)--${flag}=`));
2130
+ return commands.filter((next) => !flags.some((flag) => flag.test(next.command)));
2131
+ }
2118
2132
  function asRecord(value) {
2119
2133
  return value && typeof value === "object" && !Array.isArray(value) ? value : undefined;
2120
2134
  }
@@ -6,7 +6,7 @@ import {
6
6
  saveProfileConfig,
7
7
  secretFilePathFromRef,
8
8
  writeSecretJsonFile
9
- } from "./cli-99p2jh28.js";
9
+ } from "./cli-rcjhfts4.js";
10
10
  import {
11
11
  CliAuthError,
12
12
  CliInputError
@@ -44,16 +44,16 @@ import {
44
44
  import {
45
45
  createCommandContext,
46
46
  stringOption
47
- } from "./cli-dr6x0zv7.js";
47
+ } from "./cli-b7nyw498.js";
48
48
  import {
49
49
  assertFlags,
50
50
  assertPositionals,
51
51
  requireTenant
52
- } from "./cli-n2hng3gv.js";
52
+ } from "./cli-xheg54qc.js";
53
53
  import {
54
54
  ApiError,
55
55
  callControlAPI
56
- } from "./cli-e23g9ywa.js";
56
+ } from "./cli-3n040fp2.js";
57
57
  import {
58
58
  embeddedTenantIdFromApiKey,
59
59
  getActiveProfile,
@@ -63,7 +63,7 @@ import {
63
63
  resolveModaBaseUrl,
64
64
  resolveTenantId,
65
65
  shellArg
66
- } from "./cli-99p2jh28.js";
66
+ } from "./cli-rcjhfts4.js";
67
67
  import {
68
68
  CliInputError,
69
69
  CliInputRequiredError
@@ -14048,7 +14048,7 @@ async function runHarnessCommand(context) {
14048
14048
  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.");
14049
14049
  }
14050
14050
  if (context.flags["github-actions"] === "true") {
14051
- const { runGithubActionsAnalyze } = await import("./harness-github-actions-6gdrpn4m.js");
14051
+ const { runGithubActionsAnalyze } = await import("./harness-github-actions-drbkcb8d.js");
14052
14052
  const result = await runGithubActionsAnalyze(rootDir, {
14053
14053
  writeReport: (report2) => {
14054
14054
  const normalized = normalizeHarnessReport(report2);
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  fetchApiKeyProbe
3
- } from "./cli-97jew729.js";
3
+ } from "./cli-9g5kzsg6.js";
4
4
  import {
5
5
  authFetch,
6
6
  getCachedLoginContext
7
- } from "./cli-9bgnvth2.js";
7
+ } from "./cli-sk1p71wr.js";
8
8
  import {
9
9
  embeddedTenantIdFromApiKey,
10
10
  getModaDir,
@@ -15,7 +15,7 @@ import {
15
15
  resolveTenantIdFromActiveProfile,
16
16
  saveCliConfig,
17
17
  writeSecretJsonFile
18
- } from "./cli-99p2jh28.js";
18
+ } from "./cli-rcjhfts4.js";
19
19
  import {
20
20
  CliAccessError,
21
21
  CliInputError,
@@ -2,7 +2,7 @@ import {
2
2
  ApiError,
3
3
  callControlAPI,
4
4
  callDataAPI
5
- } from "./cli-e23g9ywa.js";
5
+ } from "./cli-3n040fp2.js";
6
6
  import {
7
7
  continuationCommand,
8
8
  embeddedTenantIdFromApiKey,
@@ -11,7 +11,7 @@ import {
11
11
  resolveApiTenantId,
12
12
  setPlatformTenantOverride,
13
13
  shellArg
14
- } from "./cli-99p2jh28.js";
14
+ } from "./cli-rcjhfts4.js";
15
15
  import {
16
16
  CliAccessError,
17
17
  CliInputError
@@ -89,6 +89,48 @@ var ContextSchema = z.object({
89
89
  max_messages: z.number().int().min(1).max(5000).optional().describe("With --all: maximum messages to read (default 500)"),
90
90
  ids_from: z.string().min(1).optional().describe("Read several targets (<id> or <id>@<msg_index>), one per line, from a file or - for stdin (batch mode, up to 25)")
91
91
  });
92
+ var EMOTION_SIGNALS = [
93
+ "exasperation",
94
+ "anger",
95
+ "profanity",
96
+ "insult",
97
+ "sarcasm",
98
+ "escalation_request",
99
+ "disapprove",
100
+ "disappointment",
101
+ "resignation",
102
+ "self_blame",
103
+ "personal_distress",
104
+ "confusion",
105
+ "urgency",
106
+ "distrust",
107
+ "gratitude",
108
+ "satisfaction",
109
+ "delight"
110
+ ];
111
+ var EMOTION_ELICITORS = ["bot", "external", "self", "ambiguous"];
112
+ var EMOTION_TRAJECTORIES = ["none", "building", "peak", "resolved", "sustained"];
113
+ var EMOTION_TRACE_SORTS = ["score", "risk_score", "detected_at", "message_count"];
114
+ var HALLUCINATION_SOURCES = ["rule", "classifier", "gpu", "judge", "human"];
115
+ var HALLUCINATION_TRACE_SORTS = ["contradicted_count", "verified_count", "last_detected_at"];
116
+ var LAZINESS_TRACE_SORTS = ["detections_count", "strong_count", "last_detected_at"];
117
+ var SORT_ORDERS = ["asc", "desc"];
118
+ var emotionSignalsFlag = () => z.string().trim().min(1).refine((value) => value.split(",").every((signal) => EMOTION_SIGNALS.includes(signal.trim())), { message: `must be one or more of ${EMOTION_SIGNALS.join(", ")}, comma-separated` }).optional().describe(`Only traces expressing any of these signals, comma-separated (${EMOTION_SIGNALS.join(", ")}); needs --group-by=trace`);
119
+ var emotionTraceFilters = {
120
+ group_by: z.enum(["detection", "trace"]).optional().describe("detection (default): one row per trace and family. trace: one row per trace, totals count traces as the dashboard does"),
121
+ search: z.string().trim().min(1).max(200).optional().describe("Trace ID or primary-cause substring; needs --group-by=trace"),
122
+ status: z.enum(["all", "detected"]).optional().describe("all: any detected family. detected: a negative-family detection; needs --group-by=trace"),
123
+ elicitor: z.enum(EMOTION_ELICITORS).optional().describe("Who elicited the emotion; needs --group-by=trace"),
124
+ trajectory: z.enum(EMOTION_TRAJECTORIES).optional().describe("How the emotion moved over the trace; needs --group-by=trace"),
125
+ signal: emotionSignalsFlag(),
126
+ sort: z.enum(EMOTION_TRACE_SORTS).optional().describe("Trace order (default score); needs --group-by=trace"),
127
+ order: z.enum(SORT_ORDERS).optional().describe("Sort direction (default desc); needs --group-by=trace")
128
+ };
129
+ var TRACE_GRAIN_FLAGS = {
130
+ emotions: ["search", "status", "elicitor", "trajectory", "signal", "sort", "order"],
131
+ frustrations: ["search", "status", "elicitor", "trajectory", "signal", "sort", "order"],
132
+ hallucinations: ["search", "status", "rule", "source", "sort", "order"]
133
+ };
92
134
  var FrustrationsSchema = z.object({
93
135
  days_back: daysBackFlag(7),
94
136
  limit: z.number().int().min(1).max(20).default(10).optional().describe("Maximum detections to return"),
@@ -96,7 +138,8 @@ var FrustrationsSchema = z.object({
96
138
  include_window: boolFlag().describe("Attach the surrounding messages to each detection (agent output omits them by default)"),
97
139
  window: z.number().int().min(1).max(5).default(1).optional().describe("Messages on each side with --include-window"),
98
140
  user_id: z.string().min(1).max(256).optional().describe("Scope everything to one end user"),
99
- conversation_id: z.string().min(1).max(256).optional().describe("Scope everything to one trace ID")
141
+ conversation_id: z.string().min(1).max(256).optional().describe("Scope everything to one trace ID"),
142
+ ...emotionTraceFilters
100
143
  });
101
144
  var ToolFailuresSchema = z.object({
102
145
  days_back: daysBackFlag(7)
@@ -260,14 +303,22 @@ var EmotionsSchema = z.object({
260
303
  family: z.enum(EMOTION_FAMILIES).optional().describe("Only this family in the detections list (summary covers all)"),
261
304
  user_id: z.string().min(1).max(256).optional().describe("Scope everything to one end user"),
262
305
  conversation_id: z.string().min(1).max(256).optional().describe("Scope everything to one trace ID"),
263
- include_window: boolFlag().describe("Keep each detection's conversation context (agent output omits it by default)")
306
+ include_window: boolFlag().describe("Keep each detection's conversation context (agent output omits it by default)"),
307
+ ...emotionTraceFilters
264
308
  });
265
309
  var HallucinationsSchema = z.object({
266
310
  days_back: daysBackFlag(7),
267
311
  limit: z.number().int().min(1).max(20).default(10).optional().describe("Maximum detections to return"),
268
312
  offset: z.number().int().min(0).max(1e4).optional().describe("Number of detections to skip"),
269
313
  conversation_id: z.string().max(200).optional().describe("Scope summary and list to one trace ID"),
270
- kind: z.enum(["contradicted", "verified"]).optional().describe("Only this kind in the detections list")
314
+ kind: z.enum(["contradicted", "verified"]).optional().describe("Only this kind in the detections list"),
315
+ group_by: z.enum(["message", "trace"]).optional().describe("message (default): one row per scored message. trace: one row per trace, totals count traces as the dashboard does"),
316
+ search: z.string().trim().min(1).max(200).optional().describe("Trace ID substring; needs --group-by=trace"),
317
+ status: z.enum(["contradicted", "all"]).optional().describe("contradicted (default): traces with a contradiction. all: also verified-only traces; needs --group-by=trace"),
318
+ rule: z.string().trim().min(1).max(200).optional().describe("One rule_id from summary.rule_breakdown; scopes the summary too; needs --group-by=trace"),
319
+ source: z.enum(HALLUCINATION_SOURCES).optional().describe("Only detections from this source; needs --group-by=trace"),
320
+ sort: z.enum(HALLUCINATION_TRACE_SORTS).optional().describe("Trace order (default contradicted_count); needs --group-by=trace"),
321
+ order: z.enum(SORT_ORDERS).optional().describe("Sort direction (default desc); needs --group-by=trace")
271
322
  });
272
323
  var LAZINESS_FAMILIES = [
273
324
  "omission_comment",
@@ -295,7 +346,12 @@ var LazinessSchema = z.object({
295
346
  limit: z.number().int().min(1).max(50).default(10).optional().describe("Maximum detections to return"),
296
347
  offset: z.number().int().min(0).max(1e4).optional().describe("Number of detections to skip"),
297
348
  conversation_id: z.string().max(200).optional().describe("One trace's detections"),
298
- family: z.enum(LAZINESS_FAMILIES).optional().describe("Only this laziness family")
349
+ family: z.enum(LAZINESS_FAMILIES).optional().describe("Only this laziness family"),
350
+ group_by: z.enum(["trace"]).optional().describe("Accepted for symmetry: laziness rows are always one per trace"),
351
+ search: z.string().trim().min(1).max(200).optional().describe("Trace ID substring"),
352
+ status: z.enum(["all", "strong"]).optional().describe("all (default), or strong: traces with a high-confidence detection"),
353
+ sort: z.enum(LAZINESS_TRACE_SORTS).optional().describe("Trace order (default detections_count)"),
354
+ order: z.enum(SORT_ORDERS).optional().describe("Sort direction (default desc)")
299
355
  });
300
356
  var StepScoresSchema = z.object({
301
357
  conversation_id: z.string().min(1).describe("Trace ID")
@@ -319,6 +375,21 @@ var ToolFailureDetailSchema = z.object({
319
375
  compact: boolFlag().describe("Drop each example's embedded messages (same as --include-window=false)"),
320
376
  window: z.number().int().min(1).max(5).default(1).optional().describe("Messages on each side of the anchor")
321
377
  });
378
+ var TOOL_CATALOG_SORTS = ["calls", "failure_rate", "failures", "traces", "last_seen"];
379
+ var TOOL_EFFECT_DIRECTIONS = ["read", "write", "send", "spawn", "compute", "unknown"];
380
+ var ToolCatalogSchema = z.object({
381
+ days_back: daysBackFlag(7),
382
+ sort: z.enum(TOOL_CATALOG_SORTS).default("calls").optional().describe("Sort order, descending (failures = failed calls, traces = traces that called the tool)"),
383
+ search: z.string().min(1).max(200).optional().describe("Only tools whose name contains this text"),
384
+ direction: z.enum(TOOL_EFFECT_DIRECTIONS).optional().describe("Only tools with this effect direction"),
385
+ limit: z.number().int().min(1).max(200).default(25).optional().describe("Maximum tools to return"),
386
+ offset: z.number().int().min(0).max(1e4).default(0).optional().describe("Number of tools to skip")
387
+ });
388
+ var ToolCatalogDetailSchema = z.object({
389
+ tool_name: z.string().min(1).max(255).describe("Tool name (from moda tools list)"),
390
+ days_back: daysBackFlag(7),
391
+ full: boolFlag().describe("Every observed field and value, recent call and full input (agent output caps them)")
392
+ });
322
393
  var AuditSchema = z.object({
323
394
  id: z.string().min(1).describe("Trace ID or OTLP trace_id"),
324
395
  kind: z.enum(["auto", "trace", "conversation"]).default("auto").optional().describe("How to read the id (auto tries trace, then conversation)"),
@@ -568,6 +639,8 @@ var COMMAND_FLAG_SPECS = {
568
639
  frustrations: { schema: FrustrationsSchema },
569
640
  "tool-failures": { schema: ToolFailuresSchema },
570
641
  "tool-failure-detail": { schema: ToolFailureDetailSchema, positionals: [{ name: "tool_name", key: "tool_name", required: true }] },
642
+ "tool-catalog": { schema: ToolCatalogSchema },
643
+ "tool-catalog-detail": { schema: ToolCatalogDetailSchema, positionals: [{ name: "tool_name", key: "tool_name", required: true }] },
571
644
  problems: {
572
645
  schema: ProblemsSchema,
573
646
  subcommands: { remainder: { schema: ProblemsRemainderSchema } }
@@ -1342,4 +1415,4 @@ function unknownSignalsSubcommandError(sub, args = []) {
1342
1415
  ${SIGNAL_USAGE}`);
1343
1416
  }
1344
1417
 
1345
- 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, writeDryRun, COMMAND_FLAG_SPECS, flagSpecFor, kebabFlag, schemaShape, describeField, specFlagKeys, specFlagNames, describeSpecFlags, closestMatches, usageLine, renderFlagHelp, subcommandHelpFlags, manifestFlagFields, requireTenant, assertFlags, assertPositionals, runUsersCommand, runUserCommand, runProblemReopenCommand, runSignalsManagementCommand, SIGNALS_MANAGEMENT_SUBCOMMANDS, unknownSignalsSubcommandError };
1418
+ export { TRACE_GRAIN_FLAGS, 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, writeDryRun, COMMAND_FLAG_SPECS, flagSpecFor, kebabFlag, schemaShape, describeField, specFlagKeys, specFlagNames, describeSpecFlags, closestMatches, usageLine, renderFlagHelp, subcommandHelpFlags, manifestFlagFields, requireTenant, assertFlags, assertPositionals, runUsersCommand, runUserCommand, runProblemReopenCommand, runSignalsManagementCommand, SIGNALS_MANAGEMENT_SUBCOMMANDS, unknownSignalsSubcommandError };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  callControlAPI
3
- } from "./cli-e23g9ywa.js";
3
+ } from "./cli-3n040fp2.js";
4
4
 
5
5
  // src/replay-runs.ts
6
6
  var DEFAULT_POLL_INTERVAL_MS = 15000;