sentinelayer-cli 0.16.0 → 0.17.0
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/package.json +1 -1
- package/src/commands/session.js +22 -2
package/package.json
CHANGED
package/src/commands/session.js
CHANGED
|
@@ -913,13 +913,33 @@ function checkpointSequenceRange(checkpoint = {}) {
|
|
|
913
913
|
return "anchor pending";
|
|
914
914
|
}
|
|
915
915
|
|
|
916
|
-
function
|
|
916
|
+
function checkpointGradeLabel(checkpoint = {}) {
|
|
917
|
+
const grade = normalizeString(checkpoint.grade || checkpoint.gradeLetter || checkpoint.grade_letter).toUpperCase();
|
|
918
|
+
if (!["A", "B", "C", "D", "F"].includes(grade)) {
|
|
919
|
+
return "";
|
|
920
|
+
}
|
|
921
|
+
const score = Number(checkpoint.gradeScore ?? checkpoint.grade_score);
|
|
922
|
+
const scoreLabel = Number.isFinite(score) ? ` ${Math.max(0, Math.min(100, Math.floor(score)))}/100` : "";
|
|
923
|
+
const rawReasons = Array.isArray(checkpoint.gradeReasons)
|
|
924
|
+
? checkpoint.gradeReasons
|
|
925
|
+
: Array.isArray(checkpoint.grade_reasons)
|
|
926
|
+
? checkpoint.grade_reasons
|
|
927
|
+
: [];
|
|
928
|
+
const reasons = rawReasons
|
|
929
|
+
.map((reason) => normalizeString(reason?.message || reason?.code || reason))
|
|
930
|
+
.filter(Boolean)
|
|
931
|
+
.slice(0, 2);
|
|
932
|
+
const reasonLabel = reasons.length ? `: ${reasons.join("; ")}` : "";
|
|
933
|
+
return ` grade ${grade}${scoreLabel}${reasonLabel}`;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
export function formatCheckpointLine(checkpoint = {}) {
|
|
917
937
|
const id = normalizeString(checkpoint.checkpointId) || "checkpoint";
|
|
918
938
|
const kind = normalizeString(checkpoint.kind) || "summary";
|
|
919
939
|
const title = normalizeString(checkpoint.title) || "Untitled checkpoint";
|
|
920
940
|
const byline = normalizeString(checkpoint.createdByAgentId || checkpoint.createdBy);
|
|
921
941
|
const by = byline ? ` by ${byline}` : "";
|
|
922
|
-
return `${checkpointSequenceRange(checkpoint)} ${id} [${kind}] ${title}${by}`;
|
|
942
|
+
return `${checkpointSequenceRange(checkpoint)} ${id} [${kind}] ${title}${by}${checkpointGradeLabel(checkpoint)}`;
|
|
923
943
|
}
|
|
924
944
|
|
|
925
945
|
async function readCheckpointSummaryOption(options = {}, { targetPath } = {}) {
|