@moda-ai/cli 1.55.40 → 1.55.42
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.
- package/dist/{agent-ck6y31n2.js → agent-86hghww1.js} +4 -4
- package/dist/{cli-f1jfrqgf.js → cli-4sy4tytm.js} +218 -15
- package/dist/{cli-4tg0hkbz.js → cli-he8csgsr.js} +6 -6
- package/dist/{cli-ypqwcf9n.js → cli-hjm9151g.js} +2 -2
- package/dist/{cli-7bn406mt.js → cli-mxfyq5nq.js} +1 -1
- package/dist/{cli-a8nxbtpk.js → cli-srwzar82.js} +2 -2
- package/dist/{cli-azage7s0.js → cli-vwpbspr5.js} +2 -2
- package/dist/cli.js +172 -37
- package/dist/{doctor-p8sp6cbk.js → doctor-c05njdv8.js} +3 -3
- package/dist/{fix-0r974yge.js → fix-aghp304m.js} +1 -1
- package/dist/{harness-github-actions-2qc4gg2w.js → harness-github-actions-112503xs.js} +2 -2
- package/dist/{harness-72ejenza.js → harness-vabp33ak.js} +2 -2
- package/dist/{index-w7v472w4.js → index-dtxvvcq2.js} +5 -5
- package/dist/{production-intelligence-hs2sm8t5.js → production-intelligence-e5vsc6cw.js} +140 -27
- package/dist/{prompt-attribution-3987hhqz.js → prompt-attribution-pbns1ya3.js} +2 -2
- package/dist/prompt-source-mcp.js +2 -2
- package/dist/{prompts-ab-gmd10n5d.js → prompts-ab-f5qrvpkt.js} +3 -3
- package/dist/{prompts-propose-q626zmm4.js → prompts-propose-jg2j41wx.js} +3 -3
- package/dist/{prompts-ysm9ra72.js → prompts-qppk0mhp.js} +2 -2
- package/dist/{registry-7xz09ry0.js → registry-8a1940sr.js} +1 -1
- package/dist/{skills-x6yszxxn.js → skills-sh93b156.js} +2 -2
- package/dist/{sync-trjzvam9.js → sync-0pp1c8hs.js} +4 -4
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
- package/skills/moda-cli/SKILL.md +4 -3
- package/skills/moda-cli/references/commands.md +4 -1
- package/skills/moda-cli/references/dashboard-parity.md +4 -2
- package/skills/moda-cli/references/production-intelligence.md +5 -1
|
@@ -452,6 +452,7 @@ async function runProductionCommand(context) {
|
|
|
452
452
|
if (context.command === "investigate") {
|
|
453
453
|
const investigation = await investigateProduction({
|
|
454
454
|
daysBack,
|
|
455
|
+
daysBackGiven: context.flags["days-back"] !== undefined,
|
|
455
456
|
cwd: context.cwd,
|
|
456
457
|
conversationId: context.flags.trace ?? context.flags.conversation,
|
|
457
458
|
toolName: context.flags.tool
|
|
@@ -553,14 +554,16 @@ async function investigateProduction(options) {
|
|
|
553
554
|
const overviewEndpoint = `/overview?days_back=${options.daysBack}`;
|
|
554
555
|
const toolEndpoint = options.toolName ? `/tool-failures/${encodeURIComponent(options.toolName)}?days_back=${options.daysBack}&limit=5` : `/tool-failures?days_back=${options.daysBack}`;
|
|
555
556
|
const frustrationsEndpoint = `${investigateFrustrationsEndpoint(options.daysBack)}${options.conversationId ? `&conversation_id=${encodeURIComponent(options.conversationId)}` : ""}`;
|
|
556
|
-
const problemsEndpoint = `/problems?days_back=${options.daysBack}&limit=${INVESTIGATION_PROBLEM_LIMIT}`;
|
|
557
557
|
const skipped = { data: null, status: "ok" };
|
|
558
|
-
const
|
|
558
|
+
const noProblems = { result: skipped, view: null, endpoint: "", warnings: [] };
|
|
559
|
+
const [overview, tools, frustrations, problemsRead] = await Promise.all([
|
|
559
560
|
safeData(overviewEndpoint),
|
|
560
561
|
safeData(toolEndpoint),
|
|
561
562
|
options.failureOnly ? Promise.resolve(skipped) : safeData(frustrationsEndpoint),
|
|
562
|
-
options.failureOnly ? Promise.resolve(
|
|
563
|
+
options.failureOnly ? Promise.resolve(noProblems) : loadInvestigationProblems(options.daysBack, options.daysBackGiven === true)
|
|
563
564
|
]);
|
|
565
|
+
const problems = problemsRead.result;
|
|
566
|
+
warnings.push(...problemsRead.warnings);
|
|
564
567
|
const sources = options.failureOnly ? { overview, tools } : { overview, tools, frustrations, problems };
|
|
565
568
|
for (const [key, result] of Object.entries(sources)) {
|
|
566
569
|
sourceStatus[key] = result.status;
|
|
@@ -586,14 +589,14 @@ async function investigateProduction(options) {
|
|
|
586
589
|
findings.push(...toolFailureFindings(tools.data, options.daysBack, hints, evidenceRefs, options.toolName));
|
|
587
590
|
if (!options.failureOnly) {
|
|
588
591
|
findings.push(...frustrationFindings(frustrations.data, options.daysBack, evidenceRefs));
|
|
589
|
-
findings.push(...problemFindings(problems.data, options.daysBack, evidenceRefs));
|
|
592
|
+
findings.push(...problemFindings(problems.data, problemsRead, options.daysBack, evidenceRefs));
|
|
590
593
|
}
|
|
591
594
|
if (findings.length === 0) {
|
|
592
595
|
findings.push(failedSources.length > 0 ? incompleteDataFinding(failedSources, Object.keys(sources).length) : insufficientDataFinding(overview.data, evidenceRefs));
|
|
593
596
|
}
|
|
594
|
-
findings
|
|
597
|
+
sortFindingsKeepingProblemOrder(findings);
|
|
595
598
|
const boundedFindings = capFindings(findings, 8, INVESTIGATION_PROBLEM_SLOTS);
|
|
596
|
-
const nextCommands = nextCommandsForFindings(boundedFindings, options.daysBack,
|
|
599
|
+
const nextCommands = nextCommandsForFindings(boundedFindings, options.daysBack, problemsRead.view?.command);
|
|
597
600
|
const summary = summarizeInvestigation(boundedFindings);
|
|
598
601
|
if (failedSources.length > 0) {
|
|
599
602
|
summary.text = `Incomplete: could not load ${failedSources.join(", ")}, so findings cover only ${Object.keys(sources).filter((key) => !failedSources.includes(key)).join(", ")}. ${summary.text}`;
|
|
@@ -618,6 +621,7 @@ async function investigateProduction(options) {
|
|
|
618
621
|
nextCommands,
|
|
619
622
|
warnings,
|
|
620
623
|
sourceStatus,
|
|
624
|
+
...problemsRead.view ? { problemsView: problemsRead.view } : {},
|
|
621
625
|
degraded: failedSources.length > 0,
|
|
622
626
|
failedSources
|
|
623
627
|
};
|
|
@@ -648,6 +652,7 @@ async function askModa(options) {
|
|
|
648
652
|
}
|
|
649
653
|
const investigation = await investigateProduction({
|
|
650
654
|
daysBack: options.daysBack,
|
|
655
|
+
daysBackGiven: options.daysBackGiven,
|
|
651
656
|
cwd: options.cwd,
|
|
652
657
|
question: options.question
|
|
653
658
|
});
|
|
@@ -727,6 +732,7 @@ async function askModaForContext(context, question, daysBack) {
|
|
|
727
732
|
return askModa({
|
|
728
733
|
question,
|
|
729
734
|
daysBack,
|
|
735
|
+
daysBackGiven: context.flags["days-back"] !== undefined,
|
|
730
736
|
cwd: context.cwd,
|
|
731
737
|
profile: context.profile,
|
|
732
738
|
onNetworkRetry: context.verbose ? () => safeWriteStderr(`[moda] network hiccup reaching Moda Cloud; retrying the buffered ask once…
|
|
@@ -975,8 +981,67 @@ function frustrationEvidenceIds(row, anchorIndex) {
|
|
|
975
981
|
ids.msg_index = anchorIndex;
|
|
976
982
|
return ids;
|
|
977
983
|
}
|
|
978
|
-
function
|
|
984
|
+
function windowLength(hours) {
|
|
985
|
+
return hours >= 48 && hours % 24 === 0 ? `${hours / 24} days` : `${hours} hours`;
|
|
986
|
+
}
|
|
987
|
+
async function loadInvestigationProblems(daysBack, daysBackGiven) {
|
|
988
|
+
const dreamEndpoint = `/problems/dream?${daysBackGiven ? `days_back=${daysBack}&` : ""}limit=${INVESTIGATION_PROBLEM_LIMIT}`;
|
|
989
|
+
const dream = await safeData(dreamEndpoint);
|
|
990
|
+
const dreamData = asRecord(dream.data);
|
|
991
|
+
if (dream.status === "ok" && dreamData?.available === true) {
|
|
992
|
+
const windowHours2 = asNumber(asRecord(dreamData.run)?.window_hours);
|
|
993
|
+
return {
|
|
994
|
+
result: dream,
|
|
995
|
+
endpoint: dreamEndpoint,
|
|
996
|
+
warnings: [],
|
|
997
|
+
view: {
|
|
998
|
+
view: "dream",
|
|
999
|
+
window: daysBackGiven ? `the last ${daysBack} day(s)` : windowHours2 !== null ? `the dream run's window (${windowLength(windowHours2)}), the dashboard's default range` : "the dream run's window, the dashboard's default range",
|
|
1000
|
+
command: `moda problems list --view=dream${daysBackGiven ? ` --days-back=${daysBack}` : ""}`
|
|
1001
|
+
}
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
if (dream.status === "unavailable" && isAuthFailure(dream.error)) {
|
|
1005
|
+
return { result: dream, endpoint: dreamEndpoint, view: null, warnings: [] };
|
|
1006
|
+
}
|
|
1007
|
+
const bookEndpoint = `/problems?days_back=${daysBack}&limit=${INVESTIGATION_PROBLEM_LIMIT}`;
|
|
1008
|
+
const book = await safeData(bookEndpoint);
|
|
1009
|
+
const windowHours = asNumber(asRecord(asRecord(book.data)?.summary)?.window_hours);
|
|
1010
|
+
return {
|
|
1011
|
+
result: book,
|
|
1012
|
+
endpoint: bookEndpoint,
|
|
1013
|
+
warnings: dream.status === "unavailable" ? [`Could not check whether this tenant's dashboard shows the dream grouping (${dream.warning ?? dreamEndpoint}); the Problems below are the Book's ranked list, which may differ from the dashboard's.`] : [],
|
|
1014
|
+
view: {
|
|
1015
|
+
view: "book",
|
|
1016
|
+
window: windowHours !== null && windowHours < daysBack * 24 ? `the last ${windowLength(windowHours)} (the Book's serving window within the last ${daysBack} day(s))` : `the last ${daysBack} day(s)`,
|
|
1017
|
+
command: `moda problems list --view=book --days-back=${daysBack}`
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
1021
|
+
function problemRows(data, view) {
|
|
979
1022
|
const record = asRecord(data);
|
|
1023
|
+
if (view === "dream") {
|
|
1024
|
+
const items = Array.isArray(record?.problems) ? record.problems : [];
|
|
1025
|
+
return items.flatMap((item) => {
|
|
1026
|
+
const row = asRecord(item);
|
|
1027
|
+
const id = asString(row?.problem_id);
|
|
1028
|
+
if (!row || !id)
|
|
1029
|
+
return [];
|
|
1030
|
+
const incidents = numberValue(row.incidents);
|
|
1031
|
+
const tier = asString(asRecord(row.severity)?.tier);
|
|
1032
|
+
return [{
|
|
1033
|
+
id,
|
|
1034
|
+
name: asString(row.name) || id,
|
|
1035
|
+
cause: asString(row.cause_statement) || undefined,
|
|
1036
|
+
lifecycle: asString(row.lifecycle) ?? "open",
|
|
1037
|
+
trust: "dream",
|
|
1038
|
+
affectedConversations: incidents,
|
|
1039
|
+
...tier ? { severityTier: tier } : {},
|
|
1040
|
+
users: numberValue(row.users),
|
|
1041
|
+
incidents
|
|
1042
|
+
}];
|
|
1043
|
+
}).slice(0, INVESTIGATION_PROBLEM_LIMIT);
|
|
1044
|
+
}
|
|
980
1045
|
const rows = [];
|
|
981
1046
|
const push = (items, trust) => {
|
|
982
1047
|
if (!Array.isArray(items))
|
|
@@ -996,8 +1061,7 @@ function problemRows(data) {
|
|
|
996
1061
|
lifecycle,
|
|
997
1062
|
trust,
|
|
998
1063
|
verification: asString(row.verification_status) ?? undefined,
|
|
999
|
-
affectedConversations: numberValue(row.affected_conversations) || numberValue(asRecord(row.evidence_support)?.attribution_count)
|
|
1000
|
-
raw: row
|
|
1064
|
+
affectedConversations: numberValue(row.affected_conversations) || numberValue(asRecord(row.evidence_support)?.attribution_count)
|
|
1001
1065
|
});
|
|
1002
1066
|
}
|
|
1003
1067
|
};
|
|
@@ -1006,38 +1070,74 @@ function problemRows(data) {
|
|
|
1006
1070
|
push(record?.emerging, "emerging");
|
|
1007
1071
|
return rows.slice(0, INVESTIGATION_PROBLEM_LIMIT);
|
|
1008
1072
|
}
|
|
1009
|
-
function
|
|
1010
|
-
|
|
1073
|
+
function dreamSeverity(tier) {
|
|
1074
|
+
if (tier === "P0" || tier === "P1")
|
|
1075
|
+
return "critical";
|
|
1076
|
+
if (tier === "P3")
|
|
1077
|
+
return "medium";
|
|
1078
|
+
return "high";
|
|
1079
|
+
}
|
|
1080
|
+
function problemFindings(data, read, daysBack, evidenceRefs) {
|
|
1081
|
+
if (!read.view)
|
|
1082
|
+
return [];
|
|
1083
|
+
const view = read.view;
|
|
1084
|
+
return problemRows(data, view.view).map((problem, index) => {
|
|
1011
1085
|
const evidenceId = `problem:${problem.id}`;
|
|
1012
|
-
const
|
|
1013
|
-
const
|
|
1086
|
+
const dream = problem.trust === "dream";
|
|
1087
|
+
const trusted = problem.trust === "trusted" || dream;
|
|
1088
|
+
const trustNote = dream ? `dream grouping${problem.severityTier ? `, ${problem.severityTier}` : ""}` : problem.trust === "trusted" ? "verified" : problem.trust === "emerging" ? "emerging, not yet ranked" : `untrusted (${problem.verification ?? "unverified"})`;
|
|
1014
1089
|
evidenceRefs.push({
|
|
1015
1090
|
id: evidenceId,
|
|
1016
1091
|
kind: "problem",
|
|
1017
1092
|
label: `Problem "${problem.name}" (${trustNote})`,
|
|
1018
|
-
endpoint:
|
|
1019
|
-
value:
|
|
1093
|
+
endpoint: read.endpoint,
|
|
1094
|
+
value: dream ? {
|
|
1095
|
+
problem_id: problem.id,
|
|
1096
|
+
view: "dream",
|
|
1097
|
+
rank: index + 1,
|
|
1098
|
+
lifecycle: problem.lifecycle,
|
|
1099
|
+
severity_tier: problem.severityTier ?? null,
|
|
1100
|
+
users: problem.users ?? 0,
|
|
1101
|
+
incidents: problem.incidents ?? 0
|
|
1102
|
+
} : {
|
|
1103
|
+
problem_id: problem.id,
|
|
1104
|
+
view: "book",
|
|
1105
|
+
rank: index + 1,
|
|
1106
|
+
lifecycle: problem.lifecycle,
|
|
1107
|
+
trust: problem.trust,
|
|
1108
|
+
affected_conversations: problem.affectedConversations
|
|
1109
|
+
}
|
|
1020
1110
|
});
|
|
1021
1111
|
const affected = problem.affectedConversations;
|
|
1112
|
+
const id = shellArg(problem.id);
|
|
1113
|
+
const dossier = {
|
|
1114
|
+
id: `action_problem_${slug(problem.id)}`,
|
|
1115
|
+
title: `Open the Problem dossier for ${problem.name}.`,
|
|
1116
|
+
rationale: "The dossier has the cause, evidence, affected traces and verification state.",
|
|
1117
|
+
command: `moda problems get ${id}`,
|
|
1118
|
+
mutability: "read",
|
|
1119
|
+
requiresApproval: false
|
|
1120
|
+
};
|
|
1121
|
+
const days = view.command.includes("--days-back=") ? ` --days-back=${daysBack}` : "";
|
|
1022
1122
|
return {
|
|
1023
1123
|
id: `finding_problem_${slug(problem.id)}`,
|
|
1024
1124
|
kind: "problem",
|
|
1025
1125
|
title: `Problem: ${problem.name}`,
|
|
1026
|
-
severity: trusted ? affected >= 10 ? "critical" : "high" : "medium",
|
|
1126
|
+
severity: dream ? dreamSeverity(problem.severityTier) : trusted ? affected >= 10 ? "critical" : "high" : "medium",
|
|
1027
1127
|
confidence: trusted ? "high" : "low",
|
|
1028
|
-
impactScore: (trusted ? 100 : 60) + Math.min(affected, 25) - index,
|
|
1029
|
-
rankReason: trusted ? `Rank #${index + 1} verified Problem in
|
|
1030
|
-
summary: problem.cause ? `${problem.cause}${problem.lifecycle !== "open" ? ` (${problem.lifecycle})` : ""}` : `Problem ${problem.id} is ${problem.lifecycle} in
|
|
1128
|
+
impactScore: (trusted ? 100 : 60) + Math.min(dream ? problem.users ?? 0 : affected, 25) - index,
|
|
1129
|
+
rankReason: dream ? `Rank #${index + 1} in the dream grouping the dashboard shows (\`${view.command}\`)${problem.severityTier ? `, severity ${problem.severityTier}` : ""}: ${problem.users ?? 0} user(s), ${problem.incidents ?? 0} incident(s) in ${view.window}.` : trusted ? `Rank #${index + 1} verified Problem in the Book (\`${view.command}\`)${affected > 0 ? `, affecting ${affected} trace(s)` : ""}.` : `Listed in the Book (\`${view.command}\`) as ${trustNote}; treat the cause as a hypothesis.`,
|
|
1130
|
+
summary: problem.cause ? `${problem.cause}${problem.lifecycle !== "open" ? ` (${problem.lifecycle})` : ""}` : `Problem ${problem.id} is ${problem.lifecycle} in ${view.window}.`,
|
|
1031
1131
|
evidenceRefIds: [evidenceId],
|
|
1032
1132
|
likelyLocations: [],
|
|
1033
|
-
recommendedActions: [{
|
|
1034
|
-
id: `
|
|
1035
|
-
title: `Open
|
|
1036
|
-
rationale: "The
|
|
1037
|
-
command: `moda problems get ${
|
|
1133
|
+
recommendedActions: dream ? [dossier, {
|
|
1134
|
+
id: `action_problem_dream_${slug(problem.id)}`,
|
|
1135
|
+
title: `Open ${problem.name} as the dashboard shows it.`,
|
|
1136
|
+
rationale: "The dream page has its definition, severity and most serious incidents (dream ids are Book ids).",
|
|
1137
|
+
command: `moda problems get ${id} --view=dream${days}`,
|
|
1038
1138
|
mutability: "read",
|
|
1039
1139
|
requiresApproval: false
|
|
1040
|
-
}]
|
|
1140
|
+
}] : [dossier]
|
|
1041
1141
|
};
|
|
1042
1142
|
});
|
|
1043
1143
|
}
|
|
@@ -1477,6 +1577,10 @@ function renderInvestigationHuman(investigation) {
|
|
|
1477
1577
|
const lines = [];
|
|
1478
1578
|
lines.push("Moda investigation");
|
|
1479
1579
|
lines.push(`Window: last ${investigation.daysBack} day(s)`);
|
|
1580
|
+
if (investigation.problemsView) {
|
|
1581
|
+
const { view, window, command } = investigation.problemsView;
|
|
1582
|
+
lines.push(`Problems: ${view === "dream" ? "the dream grouping the dashboard shows" : "the Book's ranked list"}, counts over ${window} (${command})`);
|
|
1583
|
+
}
|
|
1480
1584
|
lines.push("");
|
|
1481
1585
|
lines.push(investigation.summary.text);
|
|
1482
1586
|
for (const finding of investigation.findings) {
|
|
@@ -1734,11 +1838,11 @@ function summarizeInvestigation(findings) {
|
|
|
1734
1838
|
confidence: top.confidence
|
|
1735
1839
|
};
|
|
1736
1840
|
}
|
|
1737
|
-
function nextCommandsForFindings(findings, daysBack,
|
|
1841
|
+
function nextCommandsForFindings(findings, daysBack, problemsCommand) {
|
|
1738
1842
|
const limit = 8;
|
|
1739
1843
|
const primary = [...new Set(findings.map((finding) => finding.recommendedActions[0]?.command).filter(Boolean))];
|
|
1740
1844
|
const generic = [
|
|
1741
|
-
...
|
|
1845
|
+
...problemsCommand ? [problemsCommand] : [],
|
|
1742
1846
|
`moda overview --days-back=${daysBack}`,
|
|
1743
1847
|
"moda doctor --online"
|
|
1744
1848
|
];
|
|
@@ -1764,6 +1868,15 @@ function capFindings(sorted, limit, problemSlots) {
|
|
|
1764
1868
|
const kept = new Set([...reserved, ...others]);
|
|
1765
1869
|
return sorted.filter((finding) => kept.has(finding));
|
|
1766
1870
|
}
|
|
1871
|
+
function sortFindingsKeepingProblemOrder(findings) {
|
|
1872
|
+
const listOrder = findings.filter((finding) => finding.kind === "problem");
|
|
1873
|
+
findings.sort(compareFindings);
|
|
1874
|
+
let next = 0;
|
|
1875
|
+
for (let i = 0;i < findings.length; i += 1) {
|
|
1876
|
+
if (findings[i].kind === "problem")
|
|
1877
|
+
findings[i] = listOrder[next++];
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1767
1880
|
function compareFindings(a, b) {
|
|
1768
1881
|
const severityDelta = severityWeight(b.severity) - severityWeight(a.severity);
|
|
1769
1882
|
if (severityDelta !== 0)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inventoryFiles,
|
|
3
3
|
safePromptEvidencePath
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-vwpbspr5.js";
|
|
5
5
|
import"./cli-xq45etg1.js";
|
|
6
6
|
import"./cli-97fnztpy.js";
|
|
7
7
|
import"./cli-cesds766.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
require_typescript
|
|
10
10
|
} from "./cli-qpq84eee.js";
|
|
11
11
|
import"./cli-xddtv3yn.js";
|
|
12
|
-
import"./cli-
|
|
12
|
+
import"./cli-4sy4tytm.js";
|
|
13
13
|
import"./cli-0xc5htv7.js";
|
|
14
14
|
import"./cli-t0pb7qbs.js";
|
|
15
15
|
import"./cli-k4tqwah4.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
checkPromptMapping,
|
|
4
4
|
discoverHarnessPromptSources,
|
|
5
5
|
safePromptEvidencePath
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-vwpbspr5.js";
|
|
7
7
|
import"./cli-xq45etg1.js";
|
|
8
8
|
import"./cli-97fnztpy.js";
|
|
9
9
|
import"./cli-cesds766.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
inspectPythonSelectors
|
|
13
13
|
} from "./cli-qpq84eee.js";
|
|
14
14
|
import"./cli-xddtv3yn.js";
|
|
15
|
-
import"./cli-
|
|
15
|
+
import"./cli-4sy4tytm.js";
|
|
16
16
|
import"./cli-0xc5htv7.js";
|
|
17
17
|
import"./cli-t0pb7qbs.js";
|
|
18
18
|
import"./cli-k4tqwah4.js";
|
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
runPromptAb,
|
|
24
24
|
selectProblemCases,
|
|
25
25
|
waitLabel
|
|
26
|
-
} from "./cli-
|
|
27
|
-
import"./cli-
|
|
26
|
+
} from "./cli-hjm9151g.js";
|
|
27
|
+
import"./cli-he8csgsr.js";
|
|
28
28
|
import"./cli-daqkdnm1.js";
|
|
29
29
|
import"./cli-mm48br00.js";
|
|
30
30
|
import"./cli-xddtv3yn.js";
|
|
31
|
-
import"./cli-
|
|
31
|
+
import"./cli-4sy4tytm.js";
|
|
32
32
|
import"./cli-0xc5htv7.js";
|
|
33
33
|
import"./cli-t0pb7qbs.js";
|
|
34
34
|
import"./cli-k4tqwah4.js";
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
formatVerdict,
|
|
8
8
|
rerunWithYes,
|
|
9
9
|
resolvePromptArmSpec
|
|
10
|
-
} from "./cli-
|
|
11
|
-
import"./cli-
|
|
10
|
+
} from "./cli-hjm9151g.js";
|
|
11
|
+
import"./cli-he8csgsr.js";
|
|
12
12
|
import"./cli-daqkdnm1.js";
|
|
13
13
|
import"./cli-mm48br00.js";
|
|
14
14
|
import"./cli-xddtv3yn.js";
|
|
15
|
-
import"./cli-
|
|
15
|
+
import"./cli-4sy4tytm.js";
|
|
16
16
|
import {
|
|
17
17
|
callControlAPI
|
|
18
18
|
} from "./cli-0xc5htv7.js";
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
runPromptSync,
|
|
12
12
|
runPromptsCommand,
|
|
13
13
|
writePromptSyncProgress
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-he8csgsr.js";
|
|
15
15
|
import {
|
|
16
16
|
promptSourceHashPayload
|
|
17
17
|
} from "./cli-mm48br00.js";
|
|
18
18
|
import"./cli-xddtv3yn.js";
|
|
19
|
-
import"./cli-
|
|
19
|
+
import"./cli-4sy4tytm.js";
|
|
20
20
|
import"./cli-0xc5htv7.js";
|
|
21
21
|
import"./cli-t0pb7qbs.js";
|
|
22
22
|
import"./cli-k4tqwah4.js";
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
pullSkills,
|
|
4
4
|
runSkillSync,
|
|
5
5
|
runSkillsCommand
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-mxfyq5nq.js";
|
|
7
7
|
import"./cli-qm5b1vck.js";
|
|
8
8
|
import"./cli-rjav0vj1.js";
|
|
9
9
|
import"./cli-hcwdz9sd.js";
|
|
10
10
|
import"./cli-xddtv3yn.js";
|
|
11
|
-
import"./cli-
|
|
11
|
+
import"./cli-4sy4tytm.js";
|
|
12
12
|
import"./cli-0xc5htv7.js";
|
|
13
13
|
import"./cli-t0pb7qbs.js";
|
|
14
14
|
import"./cli-k4tqwah4.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runSkillsCommand
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-mxfyq5nq.js";
|
|
4
4
|
import"./cli-qm5b1vck.js";
|
|
5
5
|
import"./cli-rjav0vj1.js";
|
|
6
6
|
import"./cli-hcwdz9sd.js";
|
|
7
7
|
import {
|
|
8
8
|
runPromptsCommand
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-he8csgsr.js";
|
|
10
10
|
import"./cli-mm48br00.js";
|
|
11
11
|
import {
|
|
12
12
|
runHarnessCommand
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-vwpbspr5.js";
|
|
14
14
|
import"./cli-xq45etg1.js";
|
|
15
15
|
import"./cli-97fnztpy.js";
|
|
16
16
|
import"./cli-cesds766.js";
|
|
17
17
|
import"./cli-qpq84eee.js";
|
|
18
18
|
import"./cli-xddtv3yn.js";
|
|
19
|
-
import"./cli-
|
|
19
|
+
import"./cli-4sy4tytm.js";
|
|
20
20
|
import"./cli-0xc5htv7.js";
|
|
21
21
|
import"./cli-t0pb7qbs.js";
|
|
22
22
|
import {
|
package/package.json
CHANGED
package/skills/moda-cli/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: moda-cli
|
|
3
|
-
version: 3.0.
|
|
3
|
+
version: 3.0.8
|
|
4
4
|
description: Investigate a production AI agent with the Moda CLI (`moda`) - find where something happened in real traces (traces search, then traces get), check agent health, rank what to fix (investigate, problems), and dig into tool failures, user frustration, and hallucinations. Also prompt registry sync/promote, replays, custom signals, and false-positive marking. Use when the user mentions Moda, production traces or conversations of their agent, agent failures, or asks what to fix.
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -60,7 +60,7 @@ Details: `references/output-protocol.md`.
|
|
|
60
60
|
| Where did X happen / traces about Y | `moda traces search "<words>"` (`--mode=keyword` for ids, error codes, exact strings; `--include-tool-io` for tool inputs/outputs) | `moda traces get <conversation_id> --msg-index=<message_index> --window=3` |
|
|
61
61
|
| Search returned nothing | Read `.warnings` (degraded mode, reason). Try a shorter phrase, `--mode=keyword`, a wider `--time-range` | `moda traces --search="<words>"` |
|
|
62
62
|
| Is the agent healthy? | `moda overview --days-back=7` | `moda investigate` |
|
|
63
|
-
| What to fix first? | `moda investigate` or `moda problems list` (free; the same list the dashboard shows) | `moda problems get <problem_id>` (`--view=dream` on a dream-grouped tenant), then `--evidence` / `--traces` |
|
|
63
|
+
| What to fix first? | `moda investigate` or `moda problems list` (free; both rank the same list the dashboard shows, `data.problemsView` names it) | `moda problems get <problem_id>` (`--view=dream` on a dream-grouped tenant), then `--evidence` / `--traces` |
|
|
64
64
|
| Why is tool T failing? | `moda detections tools` | `moda detections tools <T>` (use each row's `anchor`) |
|
|
65
65
|
| How often is tool T called / what is its schema? | `moda tools list` (every tool: calls, failed calls, success rate; `--sort=failure_rate`) | `moda tools get <T>` (registered schema, observed payload fields, usage over time, top failure categories) |
|
|
66
66
|
| What frustrates users? | `moda detections list --family=frustration --limit=10` | `moda traces get <anchor.conversation_id> --msg-index=<anchor.msg_index>` |
|
|
@@ -72,6 +72,7 @@ Details: `references/output-protocol.md`.
|
|
|
72
72
|
| Read one whole trace | `moda traces get <id> --all` (pages of up to 500 messages) | `moda traces spans <id>` for raw spans |
|
|
73
73
|
| Read several traces or turns | `moda traces get <id1>@<msg_index> <id2>@<msg_index> ...` (up to 25; or one per line via `--ids-from=-`) | Same for `moda traces spans <id1> <id2> ...` |
|
|
74
74
|
| One user's experience | `moda users`, `moda user <user_id>` | `moda traces search "<words>" --user-id=<id>` |
|
|
75
|
+
| Is this only hurting <segment> (enterprise, new users, ...)? | `moda cohorts list` (the ref of a built-in or saved cohort), then `moda problems list --sort=users --cohort=<ref>` and the same command without `--cohort` | `moda detections list --family=frustration --cohort=<ref>` vs no `--cohort` (totals count traces); `moda cohorts compare <ref> builtin:power_users` for size, health and failure mix |
|
|
75
76
|
| Topic mix | `moda clusters` | `moda cluster-traces <node_id>` |
|
|
76
77
|
| What the agent believed at a turn | `moda traces state <id> --snapshot --msg-index=<n>` | |
|
|
77
78
|
| A synthesized answer | `moda ask "<question>"` only when the user asks: each call is a paid agent run (up to about 200k tokens) | Exit 3 means degraded |
|
|
@@ -89,7 +90,7 @@ names the closest values. `moda <noun> <verb> --help` shows which.
|
|
|
89
90
|
|
|
90
91
|
## Fixing a Problem
|
|
91
92
|
|
|
92
|
-
1. `moda investigate` or `moda problems` to pick one; note its `problem_id`.
|
|
93
|
+
1. `moda investigate` or `moda problems list` to pick one (both show the dashboard's Problems in its order); note its `problem_id`.
|
|
93
94
|
2. `moda problems get <problem_id> --evidence` and open two or three anchors with
|
|
94
95
|
`moda traces get <id> --msg-index=<n>` before deciding on a cause.
|
|
95
96
|
3. Make the change in code; cite the problem id and trace ids in the commit or PR.
|
|
@@ -54,7 +54,10 @@ Loaded on demand from the moda-cli skill. This table can lag the CLI: `moda <com
|
|
|
54
54
|
| `moda prompts sync` | Upload changed prompt versions and update lockfile |
|
|
55
55
|
| `moda prompts promote <key>` | Move a remote prompt label |
|
|
56
56
|
| `moda registry template\|validate\|push\|status\|coverage\|log\|show\|prompt` | Register prompts, skills, tools, and agent wiring from one agent-written manifest (`--file`, `--dry-run`, `--live`, `--message`, `--days`); every push is a commit in the Registry history; no repo scan |
|
|
57
|
-
| `moda users` / `moda user <id>` | End users with health/activity (`--page-size=N`, alias `--limit=N`; `--page=N
|
|
57
|
+
| `moda users` / `moda user <id>` | End users with health/activity (`--page-size=N`, alias `--limit=N`; `--page=N`; `--cohort=builtin:<key>\|<saved id>`); one user's profile |
|
|
58
|
+
| `moda cohorts list\|get\|fields\|preview\|compare` | User cohorts (built-in and saved): refs and definitions, the definition fields, a member count and sample for an unsaved definition (`--file`/`--definition`), two cohorts side by side (`--days=7\|30\|90`) |
|
|
59
|
+
| `moda cohorts create\|update` | Write: save a cohort (`--name`, `--file`/`--definition`, `--description`, `--pinned`, `--color`) or edit a saved one (`<cohort_id>`, same flags plus `--note`); both take `--dry-run` |
|
|
60
|
+
| `--cohort=<ref>` | Scope `problems list`, `traces list`, `detections list` (emotion/frustration/hallucination per trace, laziness, custom_signal hits), `detections tools` and `clusters` to one cohort (`builtin:<key>` or a saved id from `moda cohorts list`). The summary names the cohort; a warning means the server did not confirm the scope |
|
|
58
61
|
| `moda problems reopen <pid>` | Reopen a Problem marked fixed |
|
|
59
62
|
| `moda signals <create\|update\|activate\|pause\|delete\|examples\|refine\|revise\|proposals\|accept\|reject\|search\|preview>` | Manage custom signals (writes take `--dry-run`; LLM-backed ones are rate-limited per key) |
|
|
60
63
|
| `moda prompts list\|show\|proposals\|usage\|replay-runs\|decide` | Read the prompt registry; merge/reject proposals |
|
|
@@ -5,7 +5,7 @@ Loaded on demand from the moda-cli skill.
|
|
|
5
5
|
### 10. Everything the dashboard does, from the CLI
|
|
6
6
|
|
|
7
7
|
Every command below needs only an API key, and the tenant comes from the key.
|
|
8
|
-
Writes listed here accept `--dry-run`: it validates the call, prints the exact request (method, endpoint, body) and sends nothing, and its `next_commands` entry is the command that sends it for real (`mutability: write`, `requires_approval: true`). That covers `problems feedback|reopen|link`, `review`, `feedback` and the `signals` writes. `prompts promote|ab|propose` refuse `--dry-run` before sending anything, so run them only when you mean it.
|
|
8
|
+
Writes listed here accept `--dry-run`: it validates the call, prints the exact request (method, endpoint, body) and sends nothing, and its `next_commands` entry is the command that sends it for real (`mutability: write`, `requires_approval: true`). That covers `problems feedback|reopen|link`, `review`, `feedback`, `cohorts create|update` and the `signals` writes. `prompts promote|ab|propose` refuse `--dry-run` before sending anything, so run them only when you mean it.
|
|
9
9
|
|
|
10
10
|
| Dashboard | CLI |
|
|
11
11
|
|---|---|
|
|
@@ -14,7 +14,9 @@ Writes listed here accept `--dry-run`: it validates the call, prints the exact r
|
|
|
14
14
|
| Traces list: Processed, Use case confidence, Indexed columns | `moda traces` rows: `processing_status`, `error_message`, `membership_score`, `indexed_at`; `moda traces get <id>`: `trace_state` |
|
|
15
15
|
| Signals tabs: per-trace list, filters, sort | `moda detections list --family=<f> --group-by=trace` plus `--trajectory --elicitor --signal --status --search --sort --order` (emotion), `--rule --source` (hallucination) |
|
|
16
16
|
| Settings: which detectors run | `moda overview` → `detectors` (read-only; switching one is dashboard-only) |
|
|
17
|
-
| Users page / user profile | `moda users [--window --cohort --sort --order --health-status]`, `moda user <id>` |
|
|
17
|
+
| Users page / user profile | `moda users [--window --cohort --sort --order --health-status]`, `moda user <id>` (`--cohort` takes `builtin:<key>`, a saved cohort id, or a bare built-in key) |
|
|
18
|
+
| Cohort selector on Problems, Traces, Signals tabs, custom signals, Topics | `--cohort=builtin:<key>\|<saved id>` on `problems list`, `traces list`, `detections list` (emotion, frustration and hallucination read the per-trace list; laziness; custom_signal `--signal-id`), `detections tools`, `clusters` (`--time-range=all\|3d\|7d\|30d`, also with `--search`). Output says which cohort scoped it (summary line and `cohort` in the data). `traces search` has no cohort scope |
|
|
19
|
+
| Cohort builder: list, fields, preview, compare, save, edit | `moda cohorts list [--include-archived]`, `get <ref>`, `fields`, `preview --file=<definition.json>`, `compare <a> <b> [--days=7\|30\|90]`, `create --name --file [--dry-run]`, `update <cohort_id> [--name --file --note] [--dry-run]` (archiving is dashboard-only) |
|
|
18
20
|
| Tool catalog: every tool, its schema and usage | `moda tools list [--sort=calls\|failure_rate\|failures\|traces\|last_seen --search --direction --offset]`, `moda tools get <tool_name>` |
|
|
19
21
|
| Problems list (dream grouping or Book, as the page decides): sort, cohort, page | `moda problems list [--sort=users --cohort=builtin:<key> --offset=N --list-version=V]`; `--view=book\|dream` forces one |
|
|
20
22
|
| Problem page (dream view): severity, incidents with verdicts | `moda problems get <problem_id> --view=dream [--offset=N]` |
|
|
@@ -55,7 +55,11 @@ Data API fallback. Abbreviated envelope:
|
|
|
55
55
|
narrows the tool-failure evidence to one tool, and `--trace` (legacy alias
|
|
56
56
|
`--conversation`) scopes only the frustration evidence (overview, tool
|
|
57
57
|
failures and Problems stay tenant-wide). Its findings include the top 1–3
|
|
58
|
-
Problems
|
|
58
|
+
Problems of the list `moda problems list` shows (the dream grouping when the
|
|
59
|
+
dashboard shows one, otherwise the Book), in the same order, with
|
|
60
|
+
`moda problems get <id>` as the next command. `data.problemsView` names the
|
|
61
|
+
view, the window its counts cover, and the `moda problems list` command that
|
|
62
|
+
lists the same Problems.
|
|
59
63
|
`moda failures` is the tool-failures-only view.
|
|
60
64
|
|
|
61
65
|
After reporting the top behavioral failure and the harness layer it routes to
|