@moda-ai/cli 1.55.46 → 1.55.47
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/cli.js
CHANGED
|
@@ -3000,7 +3000,7 @@ async function runAgentCommand(...args) {
|
|
|
3000
3000
|
return (await import("./agent-aewgndk0.js")).runAgentCommand(...args);
|
|
3001
3001
|
}
|
|
3002
3002
|
async function runProductionCommand(...args) {
|
|
3003
|
-
return (await import("./production-intelligence-
|
|
3003
|
+
return (await import("./production-intelligence-fe5masaa.js")).runProductionCommand(...args);
|
|
3004
3004
|
}
|
|
3005
3005
|
function parseArgs(argv) {
|
|
3006
3006
|
const args = argv.slice(2);
|
|
@@ -487,6 +487,7 @@ async function loadOverviewBriefing(options) {
|
|
|
487
487
|
];
|
|
488
488
|
const findings = findingsFromOverview(overview, options.daysBack, hints, evidenceRefs);
|
|
489
489
|
const topFinding = findings[0] ?? null;
|
|
490
|
+
const signalsRate = overviewSignalsRate(overview);
|
|
490
491
|
const conversations = numberAt(overview, ["conversations", "total"]);
|
|
491
492
|
const recent = recentActivity(overview)[0];
|
|
492
493
|
const dataFlowStatus = conversations > 0 || recent ? "flowing" : "quiet";
|
|
@@ -495,7 +496,7 @@ async function loadOverviewBriefing(options) {
|
|
|
495
496
|
schemaVersion: OVERVIEW_SCHEMA_VERSION,
|
|
496
497
|
generatedAt: new Date().toISOString(),
|
|
497
498
|
daysBack: options.daysBack,
|
|
498
|
-
status: topFinding ? "attention" : dataFlowStatus === "flowing" ? "healthy" : "quiet",
|
|
499
|
+
status: topFinding ? "attention" : signalsRate && signalsRate.ratePct > 0 ? "unknown" : dataFlowStatus === "flowing" ? "healthy" : "quiet",
|
|
499
500
|
dataFlow: {
|
|
500
501
|
status: dataFlowStatus,
|
|
501
502
|
conversations,
|
|
@@ -849,6 +850,17 @@ function findingsFromOverview(overview, daysBack, hints, evidenceRefs) {
|
|
|
849
850
|
}]
|
|
850
851
|
});
|
|
851
852
|
}
|
|
853
|
+
const signalsRate = overviewSignalsRate(overview);
|
|
854
|
+
const signalsEvidenceId = "overview:signals_negative_emotion_rate";
|
|
855
|
+
if (signalsRate) {
|
|
856
|
+
evidenceRefs.push({
|
|
857
|
+
id: signalsEvidenceId,
|
|
858
|
+
kind: "data_api",
|
|
859
|
+
label: `Signals page negative emotion: ${signalsRate.ratePct}% of ${signalsRate.unit}s${signalsCoverageLabel(signalsRate)}`,
|
|
860
|
+
endpoint: `/overview?days_back=${daysBack}`,
|
|
861
|
+
value: valueAt(overview, ["signals_negative_emotion_rate"])
|
|
862
|
+
});
|
|
863
|
+
}
|
|
852
864
|
const frustrationRate = numberAt(overview, ["frustrations", "rate_pct"]);
|
|
853
865
|
const frustrated = numberAt(overview, ["frustrations", "frustrated"]);
|
|
854
866
|
if (frustrated > 0 || frustrationRate >= 10) {
|
|
@@ -856,20 +868,20 @@ function findingsFromOverview(overview, daysBack, hints, evidenceRefs) {
|
|
|
856
868
|
evidenceRefs.push({
|
|
857
869
|
id: evidenceId,
|
|
858
870
|
kind: "data_api",
|
|
859
|
-
label: `${frustrationRate}% frustration
|
|
871
|
+
label: `${frustrationRate}% frustration family, analyzed conversations`,
|
|
860
872
|
endpoint: `/overview?days_back=${daysBack}`,
|
|
861
873
|
value: valueAt(overview, ["frustrations"])
|
|
862
874
|
});
|
|
863
875
|
findings.push({
|
|
864
876
|
id: "finding_overview_frustration",
|
|
865
877
|
kind: "frustration",
|
|
866
|
-
title: `${frustrationRate}%
|
|
878
|
+
title: `${frustrationRate}% frustration family, analyzed conversations`,
|
|
867
879
|
severity: frustrationRate >= 25 ? "high" : "medium",
|
|
868
880
|
confidence: "medium",
|
|
869
881
|
impactScore: 65 + Math.min(frustrationRate, 30),
|
|
870
882
|
rankReason: "Frustration indicates users are getting stuck even when runs may not hard-fail.",
|
|
871
|
-
summary: `Moda classified ${frustrated}
|
|
872
|
-
evidenceRefIds: [evidenceId],
|
|
883
|
+
summary: `Moda classified ${frustrated} conversation(s) with frustration-family detections in the last ${daysBack} day(s).` + (signalsRate ? ` Signals page negative emotion: ${signalsRate.ratePct}% of ${signalsRate.unit}s${signalsRate.unitSource === "fallback_unavailable" ? " (default unit; saved unit unverified)" : signalsRate.unitSource === "default" ? " (default unit)" : ""}${signalsCoverageLabel(signalsRate)}.` : ""),
|
|
884
|
+
evidenceRefIds: [evidenceId, ...signalsRate ? [signalsEvidenceId] : []],
|
|
873
885
|
likelyLocations: defaultLikelyLocations(hints, "prompt"),
|
|
874
886
|
recommendedActions: [{
|
|
875
887
|
id: "action_investigate_frustration",
|
|
@@ -1583,6 +1595,8 @@ function renderOverviewBriefingHuman(briefing) {
|
|
|
1583
1595
|
lines.push(` ${briefing.topFinding.severity.toUpperCase()} ${briefing.topFinding.title}`);
|
|
1584
1596
|
lines.push(` ${briefing.topFinding.summary}`);
|
|
1585
1597
|
lines.push(` Why ranked: ${briefing.topFinding.rankReason}`);
|
|
1598
|
+
} else if (briefing.status === "unknown") {
|
|
1599
|
+
lines.push(" Signals negative emotion is present; production health is unassessed for this unit.");
|
|
1586
1600
|
} else {
|
|
1587
1601
|
lines.push(" No urgent production issue found in the selected window.");
|
|
1588
1602
|
}
|
|
@@ -1923,7 +1937,19 @@ function uniqueEvidenceRefs(refs) {
|
|
|
1923
1937
|
}
|
|
1924
1938
|
return out;
|
|
1925
1939
|
}
|
|
1940
|
+
function signalsCoverageLabel(rate) {
|
|
1941
|
+
return rate.coverageSince ? ` (partial coverage since ${rate.coverageSince})` : "";
|
|
1942
|
+
}
|
|
1943
|
+
function overviewSignalsRate(data) {
|
|
1944
|
+
const signal = asRecord(valueAt(data, ["signals_negative_emotion_rate"]));
|
|
1945
|
+
const ratePct = asNumber(signal?.rate_pct);
|
|
1946
|
+
const unit = asString(signal?.unit);
|
|
1947
|
+
if (signal?.status === "unavailable" || ratePct === null || !Number.isFinite(ratePct) || !unit || !["turn", "task", "conversation"].includes(unit))
|
|
1948
|
+
return null;
|
|
1949
|
+
return { ratePct, unit, unitSource: asString(signal?.unit_source), coverageSince: asString(signal?.coverage_since) };
|
|
1950
|
+
}
|
|
1926
1951
|
function overviewMetrics(data) {
|
|
1952
|
+
const signalsRate = overviewSignalsRate(data);
|
|
1927
1953
|
return {
|
|
1928
1954
|
conversations: valueAt(data, ["conversations", "total"]) ?? 0,
|
|
1929
1955
|
conversationTrendPct: valueAt(data, ["conversations", "trend_pct"]) ?? 0,
|
|
@@ -1933,10 +1959,16 @@ function overviewMetrics(data) {
|
|
|
1933
1959
|
frustrated: valueAt(data, ["frustrations", "frustrated"]) ?? 0,
|
|
1934
1960
|
atRisk: valueAt(data, ["frustrations", "at_risk"]) ?? 0,
|
|
1935
1961
|
frustrationRatePct: valueAt(data, ["frustrations", "rate_pct"]) ?? 0,
|
|
1962
|
+
...signalsRate ? { signalsNegativeEmotionRatePct: signalsRate.ratePct, signalsNegativeEmotionUnit: signalsRate.unit, signalsNegativeEmotionUnitSource: signalsRate.unitSource, signalsNegativeEmotionCoverageSince: signalsRate.coverageSince } : {},
|
|
1936
1963
|
recentActivity: recentActivity(data).length
|
|
1937
1964
|
};
|
|
1938
1965
|
}
|
|
1939
1966
|
function overviewSignalPairs(metrics) {
|
|
1967
|
+
const signalsRate = asNumber(metrics.signalsNegativeEmotionRatePct);
|
|
1968
|
+
const unit = asString(metrics.signalsNegativeEmotionUnit);
|
|
1969
|
+
const source = metrics.signalsNegativeEmotionUnitSource;
|
|
1970
|
+
const coverage = asString(metrics.signalsNegativeEmotionCoverageSince);
|
|
1971
|
+
const unitLabel = `${unit}${source === "fallback_unavailable" ? " (default; saved unit unverified)" : source === "default" ? " (default)" : ""}${signalsCoverageLabel({ coverageSince: coverage })}`;
|
|
1940
1972
|
return [
|
|
1941
1973
|
["Traces", metrics.conversations],
|
|
1942
1974
|
["Tool failures", metrics.toolFailures],
|
|
@@ -1944,7 +1976,8 @@ function overviewSignalPairs(metrics) {
|
|
|
1944
1976
|
["Impacted tools", metrics.impactedTools],
|
|
1945
1977
|
["Frustrated", metrics.frustrated],
|
|
1946
1978
|
["At risk", metrics.atRisk],
|
|
1947
|
-
["Frustration
|
|
1979
|
+
["Frustration family %, analyzed conversations", metrics.frustrationRatePct],
|
|
1980
|
+
...signalsRate !== null && unit ? [[`Signals negative-emotion %, ${unitLabel}`, signalsRate]] : [],
|
|
1948
1981
|
["Recent events", metrics.recentActivity]
|
|
1949
1982
|
];
|
|
1950
1983
|
}
|
package/package.json
CHANGED