neoctl 0.2.12 → 0.2.13
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/repl/index.js
CHANGED
|
@@ -4036,8 +4036,23 @@ function previewTextLines(text, maxLines, label) {
|
|
|
4036
4036
|
return [...preview, dimAnsi(`showing first ${maxLines} of ${lines.length} ${label} lines`)];
|
|
4037
4037
|
}
|
|
4038
4038
|
function previewGenericString(text) {
|
|
4039
|
+
const persisted = formatPersistedOutputString(text);
|
|
4040
|
+
if (persisted)
|
|
4041
|
+
return persisted;
|
|
4039
4042
|
return previewTextLines(text, FALLBACK_PREVIEW_LINES, "output").join("\n");
|
|
4040
4043
|
}
|
|
4044
|
+
function formatPersistedOutputString(text) {
|
|
4045
|
+
if (!text.startsWith("<persisted-output>"))
|
|
4046
|
+
return undefined;
|
|
4047
|
+
const savedPath = /^Output too large \(([^)]+)\)\. Full output saved to:\s*(.+)$/m.exec(text)?.[2]?.trim();
|
|
4048
|
+
const preview = /Preview \(first \d+ chars\):\n([\s\S]*?)\n(?:\.\.\.\n)?<\/persisted-output>/m.exec(text)?.[1]?.trimEnd();
|
|
4049
|
+
const lines = ["output persisted"];
|
|
4050
|
+
if (savedPath)
|
|
4051
|
+
lines.push(`${dimAnsi("saved to")} ${savedPath}`);
|
|
4052
|
+
if (preview)
|
|
4053
|
+
lines.push("", dimAnsi("preview"), ...previewTextLines(preview, PERSISTED_OUTPUT_PREVIEW_LINES, "preview"));
|
|
4054
|
+
return lines.join("\n");
|
|
4055
|
+
}
|
|
4041
4056
|
function formatCommandPreview(command) {
|
|
4042
4057
|
const normalized = command.replace(/\r\n/g, "\n").trimEnd();
|
|
4043
4058
|
const lines = normalized.split("\n");
|
|
@@ -4728,6 +4743,7 @@ const GREP_MATCH_PREVIEW_COUNT = 20;
|
|
|
4728
4743
|
const GREP_CONTEXT_PREVIEW_LINES = 2;
|
|
4729
4744
|
const LIST_ENTRY_PREVIEW_COUNT = 12;
|
|
4730
4745
|
const FALLBACK_PREVIEW_LINES = 40;
|
|
4746
|
+
const PERSISTED_OUTPUT_PREVIEW_LINES = 24;
|
|
4731
4747
|
const LOW_VALUE_FALLBACK_FIELDS = new Set(["ok", "summary", "metadata", "transportTruncation"]);
|
|
4732
4748
|
function fixed(value, width, align = "right") {
|
|
4733
4749
|
const stripped = stripAnsi(value);
|