@moda-ai/cli 1.55.39 → 1.55.41
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-bhe95ae8.js → agent-ck6y31n2.js} +8 -8
- package/dist/{cli-qzag917n.js → cli-0xc5htv7.js} +1 -1
- package/dist/{cli-39617gab.js → cli-1z1sx8dg.js} +3 -3
- package/dist/{cli-jmbt1hf9.js → cli-4tg0hkbz.js} +8 -8
- package/dist/{cli-4hkesrkq.js → cli-77ekrx7d.js} +1 -1
- package/dist/{cli-6gtgm2gx.js → cli-7bn406mt.js} +4 -4
- package/dist/{cli-msgp78ag.js → cli-a8nxbtpk.js} +5 -5
- package/dist/{cli-c7vj8tq1.js → cli-azage7s0.js} +5 -5
- package/dist/{cli-2h2nvq6w.js → cli-daqkdnm1.js} +1 -1
- package/dist/{cli-k9se46y4.js → cli-f1jfrqgf.js} +21 -4
- package/dist/{cli-1vqq24qh.js → cli-gt3yq1y5.js} +2 -2
- package/dist/{cli-ptm7pwqg.js → cli-pmzh2qjy.js} +1 -1
- package/dist/{cli-wr6f0kyw.js → cli-t0pb7qbs.js} +1 -0
- package/dist/{cli-jkza0bj6.js → cli-xddtv3yn.js} +1 -1
- package/dist/{cli-as4c1xwm.js → cli-ypqwcf9n.js} +5 -5
- package/dist/cli.js +313 -26
- package/dist/{doctor-3v20hc26.js → doctor-p8sp6cbk.js} +7 -7
- package/dist/{fix-s3zkjt69.js → fix-0r974yge.js} +4 -4
- package/dist/{harness-n4569wbm.js → harness-72ejenza.js} +5 -5
- package/dist/{harness-github-actions-mcy21e4d.js → harness-github-actions-2qc4gg2w.js} +5 -5
- package/dist/{index-2qm3h7v2.js → index-w7v472w4.js} +11 -11
- package/dist/{production-intelligence-z2cad1hv.js → production-intelligence-e5vsc6cw.js} +143 -30
- package/dist/{profile-commands-7ck1tqfv.js → profile-commands-se9947c1.js} +3 -3
- package/dist/{prompt-attribution-dm50am6e.js → prompt-attribution-3987hhqz.js} +5 -5
- package/dist/prompt-source-mcp.js +5 -5
- package/dist/{prompts-ab-9e0dsmce.js → prompts-ab-gmd10n5d.js} +7 -7
- package/dist/{prompts-propose-91qrjpd0.js → prompts-propose-q626zmm4.js} +7 -7
- package/dist/{prompts-p9hhxx0c.js → prompts-ysm9ra72.js} +5 -5
- package/dist/{provision-x4wkyw60.js → provision-cya5rpxa.js} +5 -5
- package/dist/{registry-nq8qsqtv.js → registry-7xz09ry0.js} +3 -3
- package/dist/{skills-rk2pmwx8.js → skills-x6yszxxn.js} +5 -5
- package/dist/{sync-xxbfjcz5.js → sync-trjzvam9.js} +7 -7
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
- package/skills/moda-cli/SKILL.md +8 -4
- package/skills/moda-cli/references/commands.md +1 -0
- package/skills/moda-cli/references/detections.md +29 -0
- package/skills/moda-cli/references/production-intelligence.md +5 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildDoctorReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-a8nxbtpk.js";
|
|
4
4
|
import {
|
|
5
5
|
selectTenantAndCreateKey
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
6
|
+
} from "./cli-1z1sx8dg.js";
|
|
7
|
+
import"./cli-77ekrx7d.js";
|
|
8
8
|
import {
|
|
9
9
|
ConnectCodeError,
|
|
10
10
|
connectWithCode,
|
|
11
11
|
loadAuthSession,
|
|
12
12
|
loadToken,
|
|
13
13
|
login
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-pmzh2qjy.js";
|
|
15
15
|
import {
|
|
16
16
|
bundledSkillsDir,
|
|
17
17
|
installIntegrationSkill,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
agentsMdProblem,
|
|
22
22
|
runSkillSync
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-7bn406mt.js";
|
|
24
24
|
import"./cli-qm5b1vck.js";
|
|
25
25
|
import {
|
|
26
26
|
detectAgents
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
initPrompts,
|
|
34
34
|
runPromptSync
|
|
35
|
-
} from "./cli-
|
|
35
|
+
} from "./cli-4tg0hkbz.js";
|
|
36
36
|
import"./cli-mm48br00.js";
|
|
37
37
|
import {
|
|
38
38
|
codingAgentDisplayName,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
runCodingAgent,
|
|
47
47
|
runHarnessCommand,
|
|
48
48
|
startRemoteAnalyze
|
|
49
|
-
} from "./cli-
|
|
49
|
+
} from "./cli-azage7s0.js";
|
|
50
50
|
import {
|
|
51
51
|
canonicalText,
|
|
52
52
|
renderInitBanner,
|
|
@@ -62,16 +62,16 @@ import"./cli-cesds766.js";
|
|
|
62
62
|
import"./cli-qpq84eee.js";
|
|
63
63
|
import {
|
|
64
64
|
createCommandContext
|
|
65
|
-
} from "./cli-
|
|
66
|
-
import"./cli-
|
|
67
|
-
import"./cli-
|
|
65
|
+
} from "./cli-xddtv3yn.js";
|
|
66
|
+
import"./cli-f1jfrqgf.js";
|
|
67
|
+
import"./cli-0xc5htv7.js";
|
|
68
68
|
import {
|
|
69
69
|
VERSION,
|
|
70
70
|
recordApiRequest,
|
|
71
71
|
resolveIngestUrl,
|
|
72
72
|
resolveModaBaseUrl,
|
|
73
73
|
shellArg
|
|
74
|
-
} from "./cli-
|
|
74
|
+
} from "./cli-t0pb7qbs.js";
|
|
75
75
|
import {
|
|
76
76
|
CliAuthError,
|
|
77
77
|
CliInputError
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
contextTarget,
|
|
7
7
|
frustrationAnchorIndex,
|
|
8
8
|
frustrationsFromEmotions
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-gt3yq1y5.js";
|
|
10
10
|
import {
|
|
11
11
|
renderMarkdownForTerminal,
|
|
12
12
|
shouldColorTerminalOutput,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
callControlAPI,
|
|
18
18
|
callDataAPI
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-0xc5htv7.js";
|
|
20
20
|
import {
|
|
21
21
|
EXIT_DEGRADED,
|
|
22
22
|
EXIT_OK,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
resolveModaBaseUrl,
|
|
27
27
|
safeWriteStderr,
|
|
28
28
|
shellArg
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-t0pb7qbs.js";
|
|
30
30
|
import {
|
|
31
31
|
CliAuthError,
|
|
32
32
|
CliInputError,
|
|
@@ -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)
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
probeApiKey,
|
|
3
3
|
redactApiKey,
|
|
4
4
|
resolveApiKeyCredential
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-77ekrx7d.js";
|
|
6
6
|
import {
|
|
7
7
|
authFetch,
|
|
8
8
|
clearAuthSession,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
loadAuthSession,
|
|
11
11
|
login,
|
|
12
12
|
revokeCliSessionToken
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-pmzh2qjy.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_INGEST_URL,
|
|
16
16
|
EXIT_AUTH_REQUIRED,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
setActiveProfile,
|
|
36
36
|
shellArg,
|
|
37
37
|
upsertProfile
|
|
38
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-t0pb7qbs.js";
|
|
39
39
|
import {
|
|
40
40
|
CliInputError
|
|
41
41
|
} from "./cli-k4tqwah4.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inventoryFiles,
|
|
3
3
|
safePromptEvidencePath
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-azage7s0.js";
|
|
5
5
|
import"./cli-xq45etg1.js";
|
|
6
6
|
import"./cli-97fnztpy.js";
|
|
7
7
|
import"./cli-cesds766.js";
|
|
8
8
|
import {
|
|
9
9
|
require_typescript
|
|
10
10
|
} from "./cli-qpq84eee.js";
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
11
|
+
import"./cli-xddtv3yn.js";
|
|
12
|
+
import"./cli-f1jfrqgf.js";
|
|
13
|
+
import"./cli-0xc5htv7.js";
|
|
14
|
+
import"./cli-t0pb7qbs.js";
|
|
15
15
|
import"./cli-k4tqwah4.js";
|
|
16
16
|
import"./cli-9kfxkxmk.js";
|
|
17
17
|
import"./cli-ns5fcnkz.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
checkPromptMapping,
|
|
4
4
|
discoverHarnessPromptSources,
|
|
5
5
|
safePromptEvidencePath
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-azage7s0.js";
|
|
7
7
|
import"./cli-xq45etg1.js";
|
|
8
8
|
import"./cli-97fnztpy.js";
|
|
9
9
|
import"./cli-cesds766.js";
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
inspectCodeSelectors,
|
|
12
12
|
inspectPythonSelectors
|
|
13
13
|
} from "./cli-qpq84eee.js";
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
14
|
+
import"./cli-xddtv3yn.js";
|
|
15
|
+
import"./cli-f1jfrqgf.js";
|
|
16
|
+
import"./cli-0xc5htv7.js";
|
|
17
|
+
import"./cli-t0pb7qbs.js";
|
|
18
18
|
import"./cli-k4tqwah4.js";
|
|
19
19
|
import"./cli-9kfxkxmk.js";
|
|
20
20
|
import"./cli-ns5fcnkz.js";
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
runPromptAb,
|
|
24
24
|
selectProblemCases,
|
|
25
25
|
waitLabel
|
|
26
|
-
} from "./cli-
|
|
27
|
-
import"./cli-
|
|
28
|
-
import"./cli-
|
|
26
|
+
} from "./cli-ypqwcf9n.js";
|
|
27
|
+
import"./cli-4tg0hkbz.js";
|
|
28
|
+
import"./cli-daqkdnm1.js";
|
|
29
29
|
import"./cli-mm48br00.js";
|
|
30
|
-
import"./cli-
|
|
31
|
-
import"./cli-
|
|
32
|
-
import"./cli-
|
|
33
|
-
import"./cli-
|
|
30
|
+
import"./cli-xddtv3yn.js";
|
|
31
|
+
import"./cli-f1jfrqgf.js";
|
|
32
|
+
import"./cli-0xc5htv7.js";
|
|
33
|
+
import"./cli-t0pb7qbs.js";
|
|
34
34
|
import"./cli-k4tqwah4.js";
|
|
35
35
|
import"./cli-9kfxkxmk.js";
|
|
36
36
|
import"./cli-ns5fcnkz.js";
|
|
@@ -7,20 +7,20 @@ import {
|
|
|
7
7
|
formatVerdict,
|
|
8
8
|
rerunWithYes,
|
|
9
9
|
resolvePromptArmSpec
|
|
10
|
-
} from "./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
10
|
+
} from "./cli-ypqwcf9n.js";
|
|
11
|
+
import"./cli-4tg0hkbz.js";
|
|
12
|
+
import"./cli-daqkdnm1.js";
|
|
13
13
|
import"./cli-mm48br00.js";
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
14
|
+
import"./cli-xddtv3yn.js";
|
|
15
|
+
import"./cli-f1jfrqgf.js";
|
|
16
16
|
import {
|
|
17
17
|
callControlAPI
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-0xc5htv7.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveApiTenantId,
|
|
21
21
|
shellArg,
|
|
22
22
|
validateConfig
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-t0pb7qbs.js";
|
|
24
24
|
import {
|
|
25
25
|
CliInputError
|
|
26
26
|
} from "./cli-k4tqwah4.js";
|
|
@@ -11,14 +11,14 @@ import {
|
|
|
11
11
|
runPromptSync,
|
|
12
12
|
runPromptsCommand,
|
|
13
13
|
writePromptSyncProgress
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-4tg0hkbz.js";
|
|
15
15
|
import {
|
|
16
16
|
promptSourceHashPayload
|
|
17
17
|
} from "./cli-mm48br00.js";
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
18
|
+
import"./cli-xddtv3yn.js";
|
|
19
|
+
import"./cli-f1jfrqgf.js";
|
|
20
|
+
import"./cli-0xc5htv7.js";
|
|
21
|
+
import"./cli-t0pb7qbs.js";
|
|
22
22
|
import"./cli-k4tqwah4.js";
|
|
23
23
|
import"./cli-9kfxkxmk.js";
|
|
24
24
|
import"./cli-ns5fcnkz.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
selectTenantAndCreateKey
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
3
|
+
} from "./cli-1z1sx8dg.js";
|
|
4
|
+
import"./cli-77ekrx7d.js";
|
|
5
5
|
import {
|
|
6
6
|
loadAuthSession
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-pmzh2qjy.js";
|
|
8
8
|
import {
|
|
9
9
|
stringOption
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-xddtv3yn.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveIngestUrl,
|
|
13
13
|
resolveModaBaseUrl
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-t0pb7qbs.js";
|
|
15
15
|
import {
|
|
16
16
|
CliAuthError
|
|
17
17
|
} from "./cli-k4tqwah4.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertFlags
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-f1jfrqgf.js";
|
|
4
4
|
import {
|
|
5
5
|
callControlAPI
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-0xc5htv7.js";
|
|
7
7
|
import {
|
|
8
8
|
explicitOutputMode,
|
|
9
9
|
resolveApiKey
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-t0pb7qbs.js";
|
|
11
11
|
import {
|
|
12
12
|
CliInputError
|
|
13
13
|
} from "./cli-k4tqwah4.js";
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
pullSkills,
|
|
4
4
|
runSkillSync,
|
|
5
5
|
runSkillsCommand
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-7bn406mt.js";
|
|
7
7
|
import"./cli-qm5b1vck.js";
|
|
8
8
|
import"./cli-rjav0vj1.js";
|
|
9
9
|
import"./cli-hcwdz9sd.js";
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
10
|
+
import"./cli-xddtv3yn.js";
|
|
11
|
+
import"./cli-f1jfrqgf.js";
|
|
12
|
+
import"./cli-0xc5htv7.js";
|
|
13
|
+
import"./cli-t0pb7qbs.js";
|
|
14
14
|
import"./cli-k4tqwah4.js";
|
|
15
15
|
import"./cli-ns5fcnkz.js";
|
|
16
16
|
import"./cli-0v6na3yp.js";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runSkillsCommand
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-7bn406mt.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-4tg0hkbz.js";
|
|
10
10
|
import"./cli-mm48br00.js";
|
|
11
11
|
import {
|
|
12
12
|
runHarnessCommand
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-azage7s0.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
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
18
|
+
import"./cli-xddtv3yn.js";
|
|
19
|
+
import"./cli-f1jfrqgf.js";
|
|
20
|
+
import"./cli-0xc5htv7.js";
|
|
21
|
+
import"./cli-t0pb7qbs.js";
|
|
22
22
|
import {
|
|
23
23
|
CliInputError
|
|
24
24
|
} from "./cli-k4tqwah4.js";
|
package/package.json
CHANGED