open-agents-ai 0.103.89 → 0.103.91
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/index.js +131 -114
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -45830,6 +45830,26 @@ async function collectGpuMetrics() {
|
|
|
45830
45830
|
return noGpu;
|
|
45831
45831
|
}
|
|
45832
45832
|
}
|
|
45833
|
+
function getInstantSnapshot() {
|
|
45834
|
+
const cr = collectCpuRam();
|
|
45835
|
+
return {
|
|
45836
|
+
source: "local",
|
|
45837
|
+
hardware: {
|
|
45838
|
+
cpuUtil: cr.cpuUtil,
|
|
45839
|
+
cpuCores: cr.cpuCores,
|
|
45840
|
+
cpuModel: cr.cpuModel,
|
|
45841
|
+
gpuUtil: -1,
|
|
45842
|
+
gpuName: "",
|
|
45843
|
+
vramUtil: -1,
|
|
45844
|
+
vramUsedMB: 0,
|
|
45845
|
+
vramTotalMB: 0,
|
|
45846
|
+
memUtil: cr.memUtil,
|
|
45847
|
+
memUsedGB: cr.memUsedGB,
|
|
45848
|
+
memTotalGB: cr.memTotalGB
|
|
45849
|
+
},
|
|
45850
|
+
network: { rxBytesPerSec: 0, txBytesPerSec: 0 }
|
|
45851
|
+
};
|
|
45852
|
+
}
|
|
45833
45853
|
function collectCpuRam() {
|
|
45834
45854
|
const [l1] = loadavg2();
|
|
45835
45855
|
const cores = cpus2().length;
|
|
@@ -46587,13 +46607,13 @@ var init_status_bar = __esm({
|
|
|
46587
46607
|
poll();
|
|
46588
46608
|
this._remoteMetricsTimer = setInterval(poll, 1e4);
|
|
46589
46609
|
}
|
|
46590
|
-
/** Stop polling remote metrics */
|
|
46610
|
+
/** Stop polling remote metrics and switch back to local */
|
|
46591
46611
|
stopRemoteMetricsPolling() {
|
|
46592
46612
|
if (this._remoteMetricsTimer) {
|
|
46593
46613
|
clearInterval(this._remoteMetricsTimer);
|
|
46594
46614
|
this._remoteMetricsTimer = null;
|
|
46595
46615
|
}
|
|
46596
|
-
this.
|
|
46616
|
+
this.startLocalMetrics();
|
|
46597
46617
|
}
|
|
46598
46618
|
/** Update token metrics from a token_usage event */
|
|
46599
46619
|
updateMetrics(update) {
|
|
@@ -46843,58 +46863,68 @@ var init_status_bar = __esm({
|
|
|
46843
46863
|
const pipe = pastel2(60, " \u2502 ");
|
|
46844
46864
|
const pipeW = 3;
|
|
46845
46865
|
const sections = [];
|
|
46866
|
+
const compactOrder = [];
|
|
46867
|
+
let modelSectionIdx = -1;
|
|
46868
|
+
let versionSectionIdx = -1;
|
|
46846
46869
|
const tokInRaw = m.promptTokens > 0 ? m.promptTokens : Math.max(m.estimatedContextTokens, 0);
|
|
46847
|
-
const tokInPrefix = m.promptTokens > 0 ? "" : "~";
|
|
46848
|
-
const tokInExpanded = pastel2(117, "In: ") + c2.bold(tokInPrefix + tokInRaw.toLocaleString());
|
|
46849
|
-
const tokInCompact = pastel2(117, "I:") + c2.bold(tokInPrefix + _StatusBar.compactNum(tokInRaw));
|
|
46850
|
-
sections.push({
|
|
46851
|
-
expanded: tokInExpanded,
|
|
46852
|
-
compact: tokInCompact,
|
|
46853
|
-
expandedW: 4 + (tokInPrefix + tokInRaw.toLocaleString()).length,
|
|
46854
|
-
compactW: 2 + (tokInPrefix + _StatusBar.compactNum(tokInRaw)).length,
|
|
46855
|
-
empty: false
|
|
46856
|
-
});
|
|
46857
46870
|
const effectiveOut = this.effectiveCompletionTokens;
|
|
46858
46871
|
const tokOutRaw = effectiveOut > 0 ? effectiveOut : Math.ceil(m.totalTokens > 0 ? m.totalTokens - m.promptTokens : m.estimatedContextTokens * 0.3);
|
|
46859
|
-
const
|
|
46860
|
-
const
|
|
46861
|
-
const
|
|
46862
|
-
|
|
46863
|
-
|
|
46864
|
-
|
|
46865
|
-
|
|
46866
|
-
|
|
46867
|
-
|
|
46868
|
-
|
|
46869
|
-
|
|
46870
|
-
|
|
46871
|
-
|
|
46872
|
-
|
|
46873
|
-
|
|
46874
|
-
|
|
46875
|
-
|
|
46876
|
-
|
|
46877
|
-
|
|
46878
|
-
|
|
46879
|
-
|
|
46880
|
-
|
|
46881
|
-
const
|
|
46882
|
-
|
|
46883
|
-
|
|
46884
|
-
|
|
46885
|
-
|
|
46886
|
-
|
|
46887
|
-
|
|
46888
|
-
|
|
46889
|
-
|
|
46872
|
+
const tokOutVal = Math.max(0, tokOutRaw);
|
|
46873
|
+
const tokExpanded = pastel2(117, "\u2191") + c2.bold(tokInRaw.toLocaleString()) + " " + pastel2(151, "\u2193") + c2.bold(tokOutVal.toLocaleString());
|
|
46874
|
+
const tokCompact = pastel2(117, "\u2191") + c2.bold(_StatusBar.compactNum(tokInRaw)) + " " + pastel2(151, "\u2193") + c2.bold(_StatusBar.compactNum(tokOutVal));
|
|
46875
|
+
const tokExpW = 1 + tokInRaw.toLocaleString().length + 1 + 1 + tokOutVal.toLocaleString().length;
|
|
46876
|
+
const tokCompW = 1 + _StatusBar.compactNum(tokInRaw).length + 1 + 1 + _StatusBar.compactNum(tokOutVal).length;
|
|
46877
|
+
sections.push({ expanded: tokExpanded, compact: tokCompact, expandedW: tokExpW, compactW: tokCompW, empty: false });
|
|
46878
|
+
{
|
|
46879
|
+
const ctxUsed = m.estimatedContextTokens;
|
|
46880
|
+
const ctxTotal = m.contextWindowSize;
|
|
46881
|
+
let ctxSuffix = "";
|
|
46882
|
+
let ctxSuffixW = 0;
|
|
46883
|
+
let ctxCompSuffix = "";
|
|
46884
|
+
let ctxCompSuffixW = 0;
|
|
46885
|
+
if (ctxTotal > 0) {
|
|
46886
|
+
const ctxPct = Math.max(0, Math.min(100, Math.round((1 - ctxUsed / ctxTotal) * 100)));
|
|
46887
|
+
const ctxColor = ctxPct > 50 ? c2.green : ctxPct > 20 ? c2.yellow : c2.red;
|
|
46888
|
+
const ctxSizeStr = _StatusBar.compactNum(ctxTotal);
|
|
46889
|
+
ctxSuffix = " " + ctxColor(`${ctxPct}%`) + c2.dim(` ${ctxSizeStr}`);
|
|
46890
|
+
ctxSuffixW = 1 + `${ctxPct}%`.length + 1 + ctxSizeStr.length;
|
|
46891
|
+
ctxCompSuffix = " " + ctxColor(`${ctxPct}%`);
|
|
46892
|
+
ctxCompSuffixW = 1 + `${ctxPct}%`.length;
|
|
46893
|
+
}
|
|
46894
|
+
const capParts = [];
|
|
46895
|
+
if (this._caps.vision)
|
|
46896
|
+
capParts.push("\u{1F441}");
|
|
46897
|
+
if (this._caps.toolUse)
|
|
46898
|
+
capParts.push("\u{1F527}");
|
|
46899
|
+
if (this._caps.thinking)
|
|
46900
|
+
capParts.push("\u{1F9E0}");
|
|
46901
|
+
const capsStr = capParts.length > 0 ? " " + capParts.join(" ") : "";
|
|
46902
|
+
const capsVisW = capParts.length > 0 ? 1 + capParts.length * 2 + (capParts.length - 1) : 0;
|
|
46903
|
+
if (this._modelName) {
|
|
46904
|
+
const paramMatch = this._modelName.match(/(\d+\.?\d*[bBmM])/);
|
|
46905
|
+
const paramStr = paramMatch ? paramMatch[1] : this._modelName.split(":")[0]?.split("/").pop() ?? this._modelName;
|
|
46906
|
+
const modelExpanded = pastel2(146, this._modelName) + (capsStr ? " " + pastel2(183, capParts.join(" ")) : "") + ctxSuffix;
|
|
46907
|
+
const modelCompact = (capParts.length > 0 ? pastel2(183, capParts.join(" ")) : pastel2(146, paramStr)) + ctxCompSuffix;
|
|
46908
|
+
const expW = this._modelName.length + capsVisW + ctxSuffixW;
|
|
46909
|
+
const compW = (capParts.length > 0 ? capParts.length * 2 + (capParts.length - 1) : paramStr.length) + ctxCompSuffixW;
|
|
46910
|
+
modelSectionIdx = sections.length;
|
|
46911
|
+
sections.push({ expanded: modelExpanded, compact: modelCompact, expandedW: expW, compactW: compW, empty: false });
|
|
46912
|
+
} else if (capParts.length > 0) {
|
|
46913
|
+
const capsOnly = pastel2(183, capParts.join(" ")) + ctxCompSuffix;
|
|
46914
|
+
const capsOnlyW = capParts.length * 2 + (capParts.length - 1) + ctxCompSuffixW;
|
|
46915
|
+
sections.push({ expanded: capsOnly, compact: capsOnly, expandedW: capsOnlyW, compactW: capsOnlyW, empty: false });
|
|
46916
|
+
} else if (ctxTotal > 0) {
|
|
46917
|
+
sections.push({ expanded: ctxSuffix.trimStart(), compact: ctxCompSuffix.trimStart(), expandedW: ctxSuffixW - 1, compactW: ctxCompSuffixW - 1, empty: false });
|
|
46918
|
+
}
|
|
46919
|
+
}
|
|
46890
46920
|
if (this._snr) {
|
|
46891
46921
|
const snrPct = Math.round(this._snr.ratio * 100);
|
|
46892
46922
|
const snrColor = snrPct >= 70 ? c2.green : snrPct >= 40 ? c2.yellow : c2.red;
|
|
46893
46923
|
const dPrimeStr = this._snr.dPrime.toFixed(1);
|
|
46894
46924
|
const capStr = this._snr.capacityWarning ? c2.red(" !CAP") : "";
|
|
46895
|
-
const snrExpanded = pastel2(183, "SNR
|
|
46925
|
+
const snrExpanded = pastel2(183, "SNR ") + snrColor(c2.bold(`${snrPct}%`)) + c2.dim(` d'${dPrimeStr}`) + capStr;
|
|
46896
46926
|
const snrCompact = snrColor(`${snrPct}%`);
|
|
46897
|
-
const expW =
|
|
46927
|
+
const expW = 4 + `${snrPct}%`.length + 3 + dPrimeStr.length + (this._snr.capacityWarning ? 5 : 0);
|
|
46898
46928
|
sections.push({ expanded: snrExpanded, compact: snrCompact, expandedW: expW, compactW: `${snrPct}%`.length, empty: false });
|
|
46899
46929
|
}
|
|
46900
46930
|
if (this._emotion) {
|
|
@@ -46904,9 +46934,7 @@ var init_status_bar = __esm({
|
|
|
46904
46934
|
expanded: emotionExpanded,
|
|
46905
46935
|
compact: emotionCompact,
|
|
46906
46936
|
expandedW: 2 + 1 + this._emotion.label.length,
|
|
46907
|
-
// emoji(2) + space + label
|
|
46908
46937
|
compactW: 2,
|
|
46909
|
-
// just emoji
|
|
46910
46938
|
empty: false
|
|
46911
46939
|
});
|
|
46912
46940
|
}
|
|
@@ -46915,63 +46943,28 @@ var init_status_bar = __esm({
|
|
|
46915
46943
|
if (ratio > 0) {
|
|
46916
46944
|
const ratioStr = ratio >= 10 ? `${Math.round(ratio)}x` : `${ratio.toFixed(1)}x`;
|
|
46917
46945
|
const ratioColor = ratio >= 2 ? c2.green : ratio >= 1 ? c2.yellow : c2.red;
|
|
46918
|
-
const speedExpanded = pastel2(218, "Exp
|
|
46946
|
+
const speedExpanded = pastel2(218, "Exp ") + ratioColor(c2.bold(ratioStr));
|
|
46919
46947
|
sections.push({
|
|
46920
46948
|
expanded: speedExpanded,
|
|
46921
46949
|
compact: speedExpanded,
|
|
46922
|
-
expandedW:
|
|
46923
|
-
compactW:
|
|
46950
|
+
expandedW: 4 + ratioStr.length,
|
|
46951
|
+
compactW: 4 + ratioStr.length,
|
|
46924
46952
|
empty: false
|
|
46925
46953
|
});
|
|
46926
46954
|
}
|
|
46927
46955
|
}
|
|
46928
46956
|
if (m.hasPricing && m.estimatedCost !== void 0) {
|
|
46929
46957
|
const costStr = m.estimatedCost < 0.01 ? `$${m.estimatedCost.toFixed(4)}` : m.estimatedCost < 1 ? `$${m.estimatedCost.toFixed(3)}` : `$${m.estimatedCost.toFixed(2)}`;
|
|
46930
|
-
const costExpanded = pastel2(222, "Cost
|
|
46931
|
-
const costCompact =
|
|
46958
|
+
const costExpanded = pastel2(222, "Cost ") + c2.bold(costStr);
|
|
46959
|
+
const costCompact = c2.bold(costStr);
|
|
46932
46960
|
sections.push({
|
|
46933
46961
|
expanded: costExpanded,
|
|
46934
46962
|
compact: costCompact,
|
|
46935
|
-
expandedW:
|
|
46963
|
+
expandedW: 5 + costStr.length,
|
|
46936
46964
|
compactW: costStr.length,
|
|
46937
46965
|
empty: false
|
|
46938
46966
|
});
|
|
46939
46967
|
}
|
|
46940
|
-
if (this._modelName) {
|
|
46941
|
-
const capParts = [];
|
|
46942
|
-
if (this._caps.vision)
|
|
46943
|
-
capParts.push("\u{1F441}");
|
|
46944
|
-
if (this._caps.toolUse)
|
|
46945
|
-
capParts.push("\u{1F527}");
|
|
46946
|
-
if (this._caps.thinking)
|
|
46947
|
-
capParts.push("\u{1F9E0}");
|
|
46948
|
-
const capsStr = capParts.length > 0 ? " " + capParts.join(" ") : "";
|
|
46949
|
-
const capsVisW = capParts.length > 0 ? 1 + capParts.length * 2 + (capParts.length - 1) : 0;
|
|
46950
|
-
const paramMatch = this._modelName.match(/(\d+\.?\d*[bBmM])/);
|
|
46951
|
-
const paramStr = paramMatch ? paramMatch[1] : this._modelName.split(":")[0]?.split("/").pop() ?? this._modelName;
|
|
46952
|
-
const modelExpanded = pastel2(146, this._modelName) + (capsStr ? pastel2(60, " ") + pastel2(183, capParts.join(" ")) : "");
|
|
46953
|
-
const modelCompact = pastel2(146, paramStr) + (capsStr ? pastel2(60, " ") + pastel2(183, capParts.join(" ")) : "");
|
|
46954
|
-
sections.push({
|
|
46955
|
-
expanded: modelExpanded,
|
|
46956
|
-
compact: modelCompact,
|
|
46957
|
-
expandedW: this._modelName.length + capsVisW,
|
|
46958
|
-
compactW: paramStr.length + capsVisW,
|
|
46959
|
-
empty: false
|
|
46960
|
-
});
|
|
46961
|
-
} else {
|
|
46962
|
-
const capParts = [];
|
|
46963
|
-
if (this._caps.vision)
|
|
46964
|
-
capParts.push("\u{1F441}");
|
|
46965
|
-
if (this._caps.toolUse)
|
|
46966
|
-
capParts.push("\u{1F527}");
|
|
46967
|
-
if (this._caps.thinking)
|
|
46968
|
-
capParts.push("\u{1F9E0}");
|
|
46969
|
-
if (capParts.length > 0) {
|
|
46970
|
-
const capsStr = pastel2(183, capParts.join(" "));
|
|
46971
|
-
const capsVisW = capParts.length * 2 + (capParts.length - 1);
|
|
46972
|
-
sections.push({ expanded: capsStr, compact: capsStr, expandedW: capsVisW, compactW: capsVisW, empty: false });
|
|
46973
|
-
}
|
|
46974
|
-
}
|
|
46975
46968
|
if (this._expose) {
|
|
46976
46969
|
const INTERNAL_CAPS = /* @__PURE__ */ new Set(["system_metrics", "__list_capabilities"]);
|
|
46977
46970
|
const statusEmoji = this._expose.activeConnections > 0 ? this._exposeBlinkOn ? "\u{1F7E2}" : "\u26AB" : this._expose.status === "active" ? "\u{1F7E2}" : this._expose.status === "error" ? "\u{1F534}" : "\u{1F7E0}";
|
|
@@ -46992,13 +46985,12 @@ var init_status_bar = __esm({
|
|
|
46992
46985
|
expanded: exposeExpanded,
|
|
46993
46986
|
compact: exposeCompact,
|
|
46994
46987
|
expandedW: 2 + expFullStr.length,
|
|
46995
|
-
// emoji(2) + text
|
|
46996
46988
|
compactW: 2 + expCompStr.length,
|
|
46997
46989
|
empty: false
|
|
46998
46990
|
});
|
|
46999
46991
|
}
|
|
47000
|
-
|
|
47001
|
-
const um = this._unifiedMetrics;
|
|
46992
|
+
{
|
|
46993
|
+
const um = this._unifiedMetrics ?? getInstantSnapshot();
|
|
47002
46994
|
const rm2 = um.hardware;
|
|
47003
46995
|
const isLocal = um.source === "local";
|
|
47004
46996
|
const srcTag = isLocal ? pastel2(120, "L") : pastel2(117, "R");
|
|
@@ -47010,39 +47002,41 @@ var init_status_bar = __esm({
|
|
|
47010
47002
|
if (rm2.cpuUtil >= 0) {
|
|
47011
47003
|
const cpuColor = rm2.cpuUtil > 80 ? c2.red : rm2.cpuUtil > 50 ? c2.yellow : c2.green;
|
|
47012
47004
|
const cpuCoresInfo = rm2.cpuCores > 0 ? ` (${rm2.cpuCores}c` + (rm2.cpuModel ? " " + rm2.cpuModel.replace(/\s+/g, " ").slice(0, 30) : "") + ")" : "";
|
|
47013
|
-
hwExpStr += `CPU
|
|
47014
|
-
hwCompStr += `CPU
|
|
47005
|
+
hwExpStr += `CPU ${cpuColor(rm2.cpuUtil + "%")}${c2.dim(cpuCoresInfo)}`;
|
|
47006
|
+
hwCompStr += `CPU ${cpuColor(rm2.cpuUtil + "%")}`;
|
|
47015
47007
|
hwExpW += 4 + `${rm2.cpuUtil}%`.length + cpuCoresInfo.length;
|
|
47016
47008
|
hwCompW += 4 + `${rm2.cpuUtil}%`.length;
|
|
47017
47009
|
}
|
|
47018
47010
|
if (rm2.memUtil >= 0) {
|
|
47019
47011
|
const memColor = rm2.memUtil > 80 ? c2.red : rm2.memUtil > 50 ? c2.yellow : c2.green;
|
|
47020
47012
|
const memDetail = rm2.memTotalGB > 0 ? ` (${rm2.memUsedGB}/${rm2.memTotalGB}GB)` : "";
|
|
47021
|
-
hwExpStr += ` RAM
|
|
47022
|
-
hwCompStr += ` RAM
|
|
47013
|
+
hwExpStr += ` RAM ${memColor(rm2.memUtil + "%")}${c2.dim(memDetail)}`;
|
|
47014
|
+
hwCompStr += ` RAM ${memColor(rm2.memUtil + "%")}`;
|
|
47023
47015
|
hwExpW += 5 + `${rm2.memUtil}%`.length + memDetail.length;
|
|
47024
47016
|
hwCompW += 5 + `${rm2.memUtil}%`.length;
|
|
47025
47017
|
}
|
|
47026
47018
|
if (rm2.gpuUtil >= 0) {
|
|
47027
47019
|
const gpuColor = rm2.gpuUtil > 80 ? c2.red : rm2.gpuUtil > 50 ? c2.yellow : c2.green;
|
|
47028
47020
|
const gpuNameShort = rm2.gpuName ? ` (${rm2.gpuName.slice(0, 20)})` : "";
|
|
47029
|
-
hwExpStr += ` GPU
|
|
47030
|
-
hwCompStr += ` GPU
|
|
47021
|
+
hwExpStr += ` GPU ${gpuColor(rm2.gpuUtil + "%")}${c2.dim(gpuNameShort)}`;
|
|
47022
|
+
hwCompStr += ` GPU ${gpuColor(rm2.gpuUtil + "%")}`;
|
|
47031
47023
|
hwExpW += 5 + `${rm2.gpuUtil}%`.length + gpuNameShort.length;
|
|
47032
47024
|
hwCompW += 5 + `${rm2.gpuUtil}%`.length;
|
|
47033
47025
|
}
|
|
47034
47026
|
if (rm2.vramUtil >= 0) {
|
|
47035
47027
|
const vramColor = rm2.vramUtil > 80 ? c2.red : rm2.vramUtil > 50 ? c2.yellow : c2.green;
|
|
47036
47028
|
const vramDetail = rm2.vramTotalMB > 0 ? ` (${rm2.vramUsedMB}/${rm2.vramTotalMB}MB)` : "";
|
|
47037
|
-
hwExpStr += ` VRAM
|
|
47029
|
+
hwExpStr += ` VRAM ${vramColor(rm2.vramUtil + "%")}${c2.dim(vramDetail)}`;
|
|
47030
|
+
hwCompStr += ` VRAM ${vramColor(rm2.vramUtil + "%")}`;
|
|
47038
47031
|
hwExpW += 6 + `${rm2.vramUtil}%`.length + vramDetail.length;
|
|
47032
|
+
hwCompW += 6 + `${rm2.vramUtil}%`.length;
|
|
47039
47033
|
}
|
|
47040
47034
|
const net = um.network;
|
|
47041
47035
|
const rxStr = formatRate(net.rxBytesPerSec);
|
|
47042
47036
|
const txStr = formatRate(net.txBytesPerSec);
|
|
47043
|
-
const netExpStr = ` ${
|
|
47044
|
-
const netCompStr =
|
|
47045
|
-
const netW =
|
|
47037
|
+
const netExpStr = ` ${pastel2(116, "\u2193" + rxStr)} ${pastel2(218, "\u2191" + txStr)}`;
|
|
47038
|
+
const netCompStr = netExpStr;
|
|
47039
|
+
const netW = 1 + 1 + rxStr.length + 1 + 1 + txStr.length;
|
|
47046
47040
|
const sysExpanded = srcTag + " " + hwExpStr + netExpStr;
|
|
47047
47041
|
const sysCompact = srcTag + " " + hwCompStr + netCompStr;
|
|
47048
47042
|
sections.push({
|
|
@@ -47061,34 +47055,54 @@ var init_status_bar = __esm({
|
|
|
47061
47055
|
sections.push({ expanded: recStr, compact: recStr, expandedW: recW, compactW: recW, empty: false });
|
|
47062
47056
|
}
|
|
47063
47057
|
if (this._version) {
|
|
47064
|
-
|
|
47065
|
-
const
|
|
47058
|
+
versionSectionIdx = sections.length;
|
|
47059
|
+
const vStr = pastel2(245, "v" + this._version);
|
|
47066
47060
|
const vW = 1 + this._version.length;
|
|
47067
|
-
sections.push({ expanded:
|
|
47061
|
+
sections.push({ expanded: vStr, compact: vStr, expandedW: vW, compactW: vW, empty: false });
|
|
47068
47062
|
}
|
|
47069
47063
|
const activeIndices = sections.map((s, i) => !s.empty ? i : -1).filter((i) => i >= 0);
|
|
47070
47064
|
const isCompact = new Array(sections.length).fill(false);
|
|
47065
|
+
const isHidden = new Array(sections.length).fill(false);
|
|
47066
|
+
if (modelSectionIdx >= 0)
|
|
47067
|
+
compactOrder.push(modelSectionIdx);
|
|
47068
|
+
if (versionSectionIdx >= 0)
|
|
47069
|
+
compactOrder.push(versionSectionIdx);
|
|
47070
|
+
for (let j = activeIndices.length - 1; j >= 0; j--) {
|
|
47071
|
+
const idx = activeIndices[j];
|
|
47072
|
+
if (idx !== modelSectionIdx && idx !== versionSectionIdx) {
|
|
47073
|
+
compactOrder.push(idx);
|
|
47074
|
+
}
|
|
47075
|
+
}
|
|
47071
47076
|
const calcTotalWidth = () => {
|
|
47072
47077
|
let w = 1;
|
|
47073
|
-
|
|
47074
|
-
|
|
47078
|
+
let first2 = true;
|
|
47079
|
+
for (const idx of activeIndices) {
|
|
47080
|
+
if (isHidden[idx])
|
|
47081
|
+
continue;
|
|
47075
47082
|
const sec = sections[idx];
|
|
47076
|
-
if (
|
|
47083
|
+
if (!first2)
|
|
47077
47084
|
w += pipeW;
|
|
47085
|
+
first2 = false;
|
|
47078
47086
|
w += isCompact[idx] ? sec.compactW : sec.expandedW;
|
|
47079
47087
|
}
|
|
47080
47088
|
return w;
|
|
47081
47089
|
};
|
|
47082
47090
|
let totalW = calcTotalWidth();
|
|
47083
|
-
for (
|
|
47084
|
-
|
|
47091
|
+
for (const idx of compactOrder) {
|
|
47092
|
+
if (totalW <= termWidth)
|
|
47093
|
+
break;
|
|
47085
47094
|
if (!isCompact[idx] && sections[idx].compactW < sections[idx].expandedW) {
|
|
47086
47095
|
isCompact[idx] = true;
|
|
47087
47096
|
totalW = calcTotalWidth();
|
|
47088
47097
|
}
|
|
47089
47098
|
}
|
|
47090
|
-
|
|
47091
|
-
|
|
47099
|
+
if (totalW > termWidth && versionSectionIdx >= 0 && !isHidden[versionSectionIdx]) {
|
|
47100
|
+
isHidden[versionSectionIdx] = true;
|
|
47101
|
+
totalW = calcTotalWidth();
|
|
47102
|
+
}
|
|
47103
|
+
for (const idx of activeIndices) {
|
|
47104
|
+
if (isHidden[idx])
|
|
47105
|
+
continue;
|
|
47092
47106
|
if (isCompact[idx]) {
|
|
47093
47107
|
const savings = sections[idx].expandedW - sections[idx].compactW;
|
|
47094
47108
|
if (totalW + savings <= termWidth) {
|
|
@@ -47100,10 +47114,13 @@ var init_status_bar = __esm({
|
|
|
47100
47114
|
}
|
|
47101
47115
|
}
|
|
47102
47116
|
let result = " ";
|
|
47103
|
-
|
|
47104
|
-
|
|
47105
|
-
if (
|
|
47117
|
+
let first = true;
|
|
47118
|
+
for (const idx of activeIndices) {
|
|
47119
|
+
if (isHidden[idx])
|
|
47120
|
+
continue;
|
|
47121
|
+
if (!first)
|
|
47106
47122
|
result += pipe;
|
|
47123
|
+
first = false;
|
|
47107
47124
|
result += isCompact[idx] ? sections[idx].compact : sections[idx].expanded;
|
|
47108
47125
|
}
|
|
47109
47126
|
return result;
|
package/package.json
CHANGED