cascade-ai 0.12.19 → 0.12.21
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.cjs +222 -142
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +222 -142
- package/dist/cli.js.map +1 -1
- package/dist/desktop-core.cjs +10 -8
- package/dist/index.cjs +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -58,7 +58,7 @@ var __export = (target, all) => {
|
|
|
58
58
|
var CASCADE_VERSION, CASCADE_CONFIG_FILE, CASCADE_DB_FILE, CASCADE_DASHBOARD_SECRET_FILE, GLOBAL_CONFIG_DIR, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, DEFAULT_DASHBOARD_PORT, DEFAULT_CONTEXT_LIMIT, DEFAULT_AUTO_SUMMARIZE_AT, MODELS, T1_MODEL_PRIORITY, T2_MODEL_PRIORITY, T3_MODEL_PRIORITY, VISION_MODEL_PRIORITY, COMPLEXITY_T2_COUNT, THEME_NAMES, DEFAULT_THEME, OLLAMA_BASE_URL, LM_STUDIO_BASE_URL, AZURE_BASE_URL_TEMPLATE, TOOL_NAMES, DEFAULT_APPROVAL_REQUIRED;
|
|
59
59
|
var init_constants = __esm({
|
|
60
60
|
"src/constants.ts"() {
|
|
61
|
-
CASCADE_VERSION = "0.12.
|
|
61
|
+
CASCADE_VERSION = "0.12.21";
|
|
62
62
|
CASCADE_CONFIG_FILE = ".cascade/config.json";
|
|
63
63
|
CASCADE_DB_FILE = ".cascade/memory.db";
|
|
64
64
|
CASCADE_DASHBOARD_SECRET_FILE = ".cascade/dashboard-secret";
|
|
@@ -1165,8 +1165,7 @@ var init_gemini = __esm({
|
|
|
1165
1165
|
}
|
|
1166
1166
|
});
|
|
1167
1167
|
function preferIpv4Host(url) {
|
|
1168
|
-
|
|
1169
|
-
return url.replace(/^(https?:\/\/)localhost(?=[:/]|$)/i, "$1127.0.0.1");
|
|
1168
|
+
return url;
|
|
1170
1169
|
}
|
|
1171
1170
|
async function nodeHttpFetch(input, init = {}, redirectCount = 0) {
|
|
1172
1171
|
const urlStr = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
@@ -1471,7 +1470,7 @@ var init_openai_compatible = __esm({
|
|
|
1471
1470
|
init_net();
|
|
1472
1471
|
OpenAICompatibleProvider = class extends OpenAIProvider {
|
|
1473
1472
|
constructor(config, model) {
|
|
1474
|
-
super(config, model);
|
|
1473
|
+
super({ ...config, apiKey: config.apiKey ?? "not-required" }, model);
|
|
1475
1474
|
this.client = new OpenAI({
|
|
1476
1475
|
apiKey: config.apiKey ?? "not-required",
|
|
1477
1476
|
baseURL: preferIpv4Host(config.baseUrl),
|
|
@@ -4115,10 +4114,10 @@ var CascadeRouter = class _CascadeRouter extends EventEmitter {
|
|
|
4115
4114
|
if (availableProviders.has("ollama")) {
|
|
4116
4115
|
await this.discoverOllamaModels(ollamaCfg);
|
|
4117
4116
|
}
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
);
|
|
4117
|
+
const ocConfigs = config.providers.filter((p) => p.type === "openai-compatible" && p.baseUrl);
|
|
4118
|
+
if (ocConfigs.length > 0) {
|
|
4119
|
+
const results = await Promise.all(ocConfigs.map((cfg) => this.discoverOpenAICompatibleModels(cfg)));
|
|
4120
|
+
if (results.some(Boolean)) this.selector.markProviderAvailable("openai-compatible");
|
|
4122
4121
|
}
|
|
4123
4122
|
for (const tier of ["T1", "T2", "T3"]) {
|
|
4124
4123
|
const override = tier === "T1" ? config.models.t1 : tier === "T2" ? config.models.t2 : config.models.t3;
|
|
@@ -4589,6 +4588,7 @@ var CascadeRouter = class _CascadeRouter extends EventEmitter {
|
|
|
4589
4588
|
} catch {
|
|
4590
4589
|
}
|
|
4591
4590
|
}
|
|
4591
|
+
/** Returns true when at least one real model was discovered from the endpoint. */
|
|
4592
4592
|
async discoverOpenAICompatibleModels(cfg) {
|
|
4593
4593
|
try {
|
|
4594
4594
|
const seed = {
|
|
@@ -4608,8 +4608,10 @@ var CascadeRouter = class _CascadeRouter extends EventEmitter {
|
|
|
4608
4608
|
for (const m of models) {
|
|
4609
4609
|
this.selector.addDynamicModel(m);
|
|
4610
4610
|
}
|
|
4611
|
+
return models.length > 0;
|
|
4611
4612
|
} catch (err) {
|
|
4612
4613
|
console.warn("[router] OpenAI-compatible model discovery failed:", err instanceof Error ? err.message : err);
|
|
4614
|
+
return false;
|
|
4613
4615
|
}
|
|
4614
4616
|
}
|
|
4615
4617
|
ensureProvider(model, configs) {
|
|
@@ -10967,135 +10969,126 @@ init_ollama();
|
|
|
10967
10969
|
init_openai_compatible();
|
|
10968
10970
|
|
|
10969
10971
|
// src/cli/themes/index.ts
|
|
10970
|
-
|
|
10971
|
-
name
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
|
|
11015
|
-
|
|
11016
|
-
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11025
|
-
|
|
11026
|
-
|
|
11027
|
-
|
|
11028
|
-
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
10972
|
+
function defineTheme(name, colors) {
|
|
10973
|
+
return { name, colors };
|
|
10974
|
+
}
|
|
10975
|
+
var midnightTheme = defineTheme("midnight", {
|
|
10976
|
+
primary: "#8B7CF9",
|
|
10977
|
+
secondary: "#B7AEFF",
|
|
10978
|
+
accent: "#42D3E7",
|
|
10979
|
+
success: "#3DDC97",
|
|
10980
|
+
warning: "#F7B84B",
|
|
10981
|
+
error: "#FF6685",
|
|
10982
|
+
info: "#67A8FF",
|
|
10983
|
+
muted: "#7C819B",
|
|
10984
|
+
background: "#080A12",
|
|
10985
|
+
foreground: "#EDF0FA",
|
|
10986
|
+
border: "#292D42",
|
|
10987
|
+
t1Color: "#F7B84B",
|
|
10988
|
+
t2Color: "#A98BFF",
|
|
10989
|
+
t3Color: "#42D3E7"
|
|
10990
|
+
});
|
|
10991
|
+
var auroraTheme = defineTheme("aurora", {
|
|
10992
|
+
primary: "#6F8CFF",
|
|
10993
|
+
secondary: "#A78BFA",
|
|
10994
|
+
accent: "#45E0B8",
|
|
10995
|
+
success: "#45E0B8",
|
|
10996
|
+
warning: "#FFD166",
|
|
10997
|
+
error: "#FF6B8A",
|
|
10998
|
+
info: "#6FB7FF",
|
|
10999
|
+
muted: "#7890A8",
|
|
11000
|
+
background: "#071019",
|
|
11001
|
+
foreground: "#EAF7F5",
|
|
11002
|
+
border: "#20384A",
|
|
11003
|
+
t1Color: "#FFD166",
|
|
11004
|
+
t2Color: "#8B9CFF",
|
|
11005
|
+
t3Color: "#45E0B8"
|
|
11006
|
+
});
|
|
11007
|
+
var emberTheme = defineTheme("ember", {
|
|
11008
|
+
primary: "#FF8A5B",
|
|
11009
|
+
secondary: "#FFB36B",
|
|
11010
|
+
accent: "#F7C75B",
|
|
11011
|
+
success: "#72D69A",
|
|
11012
|
+
warning: "#F7C75B",
|
|
11013
|
+
error: "#FF647C",
|
|
11014
|
+
info: "#73B7FF",
|
|
11015
|
+
muted: "#9A8078",
|
|
11016
|
+
background: "#120C0B",
|
|
11017
|
+
foreground: "#FFF1E9",
|
|
11018
|
+
border: "#463027",
|
|
11019
|
+
t1Color: "#F7C75B",
|
|
11020
|
+
t2Color: "#FF8A5B",
|
|
11021
|
+
t3Color: "#72D69A"
|
|
11022
|
+
});
|
|
11023
|
+
var tideTheme = defineTheme("tide", {
|
|
11024
|
+
primary: "#4DA8FF",
|
|
11025
|
+
secondary: "#65C7F7",
|
|
11026
|
+
accent: "#51E1D4",
|
|
11027
|
+
success: "#63D9A5",
|
|
11028
|
+
warning: "#F2C879",
|
|
11029
|
+
error: "#F0718B",
|
|
11030
|
+
info: "#4DA8FF",
|
|
11031
|
+
muted: "#71899C",
|
|
11032
|
+
background: "#061017",
|
|
11033
|
+
foreground: "#E8F5FA",
|
|
11034
|
+
border: "#1C3947",
|
|
11035
|
+
t1Color: "#F2C879",
|
|
11036
|
+
t2Color: "#65A8F7",
|
|
11037
|
+
t3Color: "#51E1D4"
|
|
11038
|
+
});
|
|
11039
|
+
var bloomTheme = defineTheme("bloom", {
|
|
11040
|
+
primary: "#C084FC",
|
|
11041
|
+
secondary: "#F08BB4",
|
|
11042
|
+
accent: "#7DD3FC",
|
|
11043
|
+
success: "#6EE7B7",
|
|
11044
|
+
warning: "#FBCB78",
|
|
11045
|
+
error: "#FB7185",
|
|
11046
|
+
info: "#7DD3FC",
|
|
11047
|
+
muted: "#9B83A8",
|
|
11048
|
+
background: "#140D19",
|
|
11049
|
+
foreground: "#F8EEFC",
|
|
11050
|
+
border: "#412B4D",
|
|
11051
|
+
t1Color: "#FBCB78",
|
|
11052
|
+
t2Color: "#C084FC",
|
|
11053
|
+
t3Color: "#7DD3FC"
|
|
11054
|
+
});
|
|
11055
|
+
var daybreakTheme = defineTheme("daybreak", {
|
|
11056
|
+
primary: "#6857D9",
|
|
11057
|
+
secondary: "#826AE6",
|
|
11058
|
+
accent: "#087F91",
|
|
11059
|
+
success: "#087A55",
|
|
11060
|
+
warning: "#A86408",
|
|
11061
|
+
error: "#C83253",
|
|
11062
|
+
info: "#2563A8",
|
|
11063
|
+
muted: "#667085",
|
|
11064
|
+
background: "#F7F7FB",
|
|
11065
|
+
foreground: "#202336",
|
|
11066
|
+
border: "#D9DCE8",
|
|
11067
|
+
t1Color: "#A86408",
|
|
11068
|
+
t2Color: "#6857D9",
|
|
11069
|
+
t3Color: "#087F91"
|
|
11070
|
+
});
|
|
11071
|
+
var canonicalThemes = {
|
|
11072
|
+
midnight: midnightTheme,
|
|
11073
|
+
aurora: auroraTheme,
|
|
11074
|
+
ember: emberTheme,
|
|
11075
|
+
tide: tideTheme,
|
|
11076
|
+
bloom: bloomTheme,
|
|
11077
|
+
daybreak: daybreakTheme
|
|
11069
11078
|
};
|
|
11070
|
-
var
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
warning: "#CB4B16",
|
|
11078
|
-
error: "#DC322F",
|
|
11079
|
-
info: "#268BD2",
|
|
11080
|
-
muted: "#657B83",
|
|
11081
|
-
background: "#002B36",
|
|
11082
|
-
foreground: "#839496",
|
|
11083
|
-
border: "#073642",
|
|
11084
|
-
t1Color: "#268BD2",
|
|
11085
|
-
t2Color: "#2AA198",
|
|
11086
|
-
t3Color: "#859900"
|
|
11087
|
-
}
|
|
11079
|
+
var THEME_ALIASES = {
|
|
11080
|
+
cascade: "midnight",
|
|
11081
|
+
dark: "aurora",
|
|
11082
|
+
light: "daybreak",
|
|
11083
|
+
dracula: "bloom",
|
|
11084
|
+
nord: "tide",
|
|
11085
|
+
solarized: "ember"
|
|
11088
11086
|
};
|
|
11089
|
-
|
|
11090
|
-
["
|
|
11091
|
-
|
|
11092
|
-
["light", lightTheme],
|
|
11093
|
-
["dracula", draculaTheme],
|
|
11094
|
-
["nord", nordTheme],
|
|
11095
|
-
["solarized", solarizedTheme]
|
|
11096
|
-
]);
|
|
11087
|
+
function resolveThemeName(name) {
|
|
11088
|
+
return (name in canonicalThemes ? name : THEME_ALIASES[name]) || "midnight";
|
|
11089
|
+
}
|
|
11097
11090
|
function getTheme(name) {
|
|
11098
|
-
return
|
|
11091
|
+
return canonicalThemes[resolveThemeName(name)] ?? midnightTheme;
|
|
11099
11092
|
}
|
|
11100
11093
|
|
|
11101
11094
|
// src/cli/slash/index.ts
|
|
@@ -11349,6 +11342,13 @@ var FIXED_CHROME_ROWS = 1 + // StatusBar
|
|
|
11349
11342
|
3;
|
|
11350
11343
|
var STREAM_TAIL_ROWS = 9;
|
|
11351
11344
|
var SLASH_PANEL_ROWS = 11;
|
|
11345
|
+
function computeAdaptiveLayoutMode(columns, rows) {
|
|
11346
|
+
const safeColumns = Number.isFinite(columns) && columns > 0 ? columns : 100;
|
|
11347
|
+
const safeRows = Number.isFinite(rows) && rows > 0 ? rows : 40;
|
|
11348
|
+
if (safeColumns < 80 || safeRows < 24) return "narrow";
|
|
11349
|
+
if (safeColumns < 120 || safeRows < 32) return "medium";
|
|
11350
|
+
return "wide";
|
|
11351
|
+
}
|
|
11352
11352
|
var TREE_ROWS_FULL = 10;
|
|
11353
11353
|
var TREE_ROWS_COMPACT = 4;
|
|
11354
11354
|
var TIMELINE_ROWS = 4;
|
|
@@ -11608,7 +11608,7 @@ function formatTokens(n) {
|
|
|
11608
11608
|
var StatusBar = React2.memo(StatusBarInternal);
|
|
11609
11609
|
function HintBarInternal({ theme, isExecuting }) {
|
|
11610
11610
|
if (isExecuting) return null;
|
|
11611
|
-
return /* @__PURE__ */ jsx(Box, { paddingLeft: 1, children: /* @__PURE__ */ jsx(Text, { color: theme.colors.accent, dimColor: true, children: "/
|
|
11611
|
+
return /* @__PURE__ */ jsx(Box, { paddingLeft: 1, children: /* @__PURE__ */ jsx(Text, { color: theme.colors.accent, dimColor: true, children: "/ commands \xB7 \u2191\u2193 history \xB7 Esc cancel \xB7 Ctrl+C exit" }) });
|
|
11612
11612
|
}
|
|
11613
11613
|
var HintBar = React2.memo(HintBarInternal);
|
|
11614
11614
|
function ApprovalPrompt({ request, theme, onDecision }) {
|
|
@@ -11932,6 +11932,53 @@ function CostTracker({
|
|
|
11932
11932
|
] })
|
|
11933
11933
|
] });
|
|
11934
11934
|
}
|
|
11935
|
+
function CompactStatus({ theme, activeT2Count, activeT3Count, currentAction, activeTool, isStreaming }) {
|
|
11936
|
+
const activeCount = activeT2Count + activeT3Count;
|
|
11937
|
+
const isActive = isStreaming || activeCount > 0;
|
|
11938
|
+
const rightHint = isActive ? /* @__PURE__ */ jsxs(Text, { color: theme.colors.muted, children: [
|
|
11939
|
+
"T2:",
|
|
11940
|
+
/* @__PURE__ */ jsx(Text, { color: theme.colors.accent, children: activeT2Count }),
|
|
11941
|
+
" T3:",
|
|
11942
|
+
/* @__PURE__ */ jsx(Text, { color: theme.colors.accent, children: activeT3Count })
|
|
11943
|
+
] }) : /* @__PURE__ */ jsxs(Text, { color: theme.colors.muted, children: [
|
|
11944
|
+
"[",
|
|
11945
|
+
/* @__PURE__ */ jsx(Text, { color: theme.colors.accent, bold: true, children: "tree" }),
|
|
11946
|
+
"]"
|
|
11947
|
+
] });
|
|
11948
|
+
return /* @__PURE__ */ jsxs(Box, { paddingX: 1, borderStyle: "single", borderTop: false, borderLeft: false, borderRight: false, borderColor: theme.colors.border, children: [
|
|
11949
|
+
/* @__PURE__ */ jsx(Box, { flexGrow: 1, children: isActive ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11950
|
+
/* @__PURE__ */ jsxs(Text, { color: theme.colors.accent, bold: true, children: [
|
|
11951
|
+
/* @__PURE__ */ jsx(Spinner, { type: "hamburger" }),
|
|
11952
|
+
" "
|
|
11953
|
+
] }),
|
|
11954
|
+
activeTool ? (
|
|
11955
|
+
// Show active tool prominently
|
|
11956
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11957
|
+
/* @__PURE__ */ jsxs(Text, { color: "yellow", bold: true, children: [
|
|
11958
|
+
"\u2699 ",
|
|
11959
|
+
activeTool
|
|
11960
|
+
] }),
|
|
11961
|
+
currentAction && !currentAction.startsWith("Using tool:") && /* @__PURE__ */ jsxs(Text, { color: theme.colors.muted, children: [
|
|
11962
|
+
" \u2503 ",
|
|
11963
|
+
currentAction.length > 60 ? currentAction.slice(0, 57) + "..." : currentAction
|
|
11964
|
+
] })
|
|
11965
|
+
] })
|
|
11966
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11967
|
+
/* @__PURE__ */ jsx(Text, { color: theme.colors.accent, bold: true, children: activeCount > 0 ? `WORKING: ${activeCount} AGENTS` : "ORCHESTRATING" }),
|
|
11968
|
+
currentAction && /* @__PURE__ */ jsxs(Text, { color: theme.colors.muted, children: [
|
|
11969
|
+
" \u2503 ",
|
|
11970
|
+
currentAction.length > 80 ? currentAction.slice(0, 77) + "..." : currentAction
|
|
11971
|
+
] })
|
|
11972
|
+
] })
|
|
11973
|
+
] }) : /* @__PURE__ */ jsxs(Box, { children: [
|
|
11974
|
+
/* @__PURE__ */ jsx(Text, { color: theme.colors.muted, children: "\u25CF SYSTEM IDLE " }),
|
|
11975
|
+
/* @__PURE__ */ jsx(Text, { color: theme.colors.muted, children: "\u2503 Press " }),
|
|
11976
|
+
/* @__PURE__ */ jsx(Text, { color: theme.colors.accent, bold: true, children: "/" }),
|
|
11977
|
+
/* @__PURE__ */ jsx(Text, { color: theme.colors.muted, children: " for command palette" })
|
|
11978
|
+
] }) }),
|
|
11979
|
+
/* @__PURE__ */ jsx(Box, { children: rightHint })
|
|
11980
|
+
] });
|
|
11981
|
+
}
|
|
11935
11982
|
function ChatMessage({ role, content, theme, timestamp, isStreaming }) {
|
|
11936
11983
|
const { label, color, prefix } = getRoleStyle(role, theme);
|
|
11937
11984
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginY: 1, children: [
|
|
@@ -12236,6 +12283,19 @@ function tailLines(text, n) {
|
|
|
12236
12283
|
const lines = text.split("\n");
|
|
12237
12284
|
return lines.slice(-8);
|
|
12238
12285
|
}
|
|
12286
|
+
function activeTierSummary(root) {
|
|
12287
|
+
const summary = { t2: 0, t3: 0 };
|
|
12288
|
+
const visit = (node) => {
|
|
12289
|
+
if (node.status === "ACTIVE") {
|
|
12290
|
+
if (node.role === "T2") summary.t2 += 1;
|
|
12291
|
+
if (node.role === "T3") summary.t3 += 1;
|
|
12292
|
+
summary.action ??= node.currentAction;
|
|
12293
|
+
}
|
|
12294
|
+
node.children?.forEach(visit);
|
|
12295
|
+
};
|
|
12296
|
+
if (root) visit(root);
|
|
12297
|
+
return summary;
|
|
12298
|
+
}
|
|
12239
12299
|
function WelcomeBanner({ theme, config, workspacePath, sessionId }) {
|
|
12240
12300
|
const t1 = config.models?.t1 ?? "auto";
|
|
12241
12301
|
const t2 = config.models?.t2 ?? "auto";
|
|
@@ -13133,13 +13193,15 @@ ${lastUser.content}`;
|
|
|
13133
13193
|
};
|
|
13134
13194
|
}, [stdout]);
|
|
13135
13195
|
const width = termSize.columns;
|
|
13196
|
+
const adaptiveMode = computeAdaptiveLayoutMode(termSize.columns, termSize.rows);
|
|
13136
13197
|
const budgetOpts = {
|
|
13137
13198
|
isTypingCommand,
|
|
13138
|
-
showCost: state.showCost,
|
|
13139
|
-
showDetails: state.showDetails,
|
|
13140
|
-
showComms: state.showComms && state.peerEvents.length > 0
|
|
13199
|
+
showCost: state.showCost && adaptiveMode !== "narrow",
|
|
13200
|
+
showDetails: state.showDetails && adaptiveMode === "wide",
|
|
13201
|
+
showComms: state.showComms && state.peerEvents.length > 0 && adaptiveMode === "wide"
|
|
13141
13202
|
};
|
|
13142
13203
|
const liveBudget = computeLiveAreaBudget(termSize.rows, budgetOpts);
|
|
13204
|
+
const tierSummary = activeTierSummary(state.agentTree);
|
|
13143
13205
|
const transcriptRows = altScreen ? computeTranscriptRows(termSize.rows, liveBudget, { ...budgetOpts, treeVisible: state.agentTree != null }) : 0;
|
|
13144
13206
|
const transcriptLines = altScreen ? flattenTranscript(state.messages) : [];
|
|
13145
13207
|
const transcript = altScreen ? windowTranscript(transcriptLines, historyOffset, transcriptRows) : null;
|
|
@@ -13229,10 +13291,28 @@ ${lastUser.content}`;
|
|
|
13229
13291
|
onClose: () => setIsShowingModels(false)
|
|
13230
13292
|
}
|
|
13231
13293
|
) }),
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13294
|
+
adaptiveMode === "narrow" && state.agentTree ? /* @__PURE__ */ jsx(
|
|
13295
|
+
CompactStatus,
|
|
13296
|
+
{
|
|
13297
|
+
theme,
|
|
13298
|
+
activeT2Count: tierSummary.t2,
|
|
13299
|
+
activeT3Count: tierSummary.t3,
|
|
13300
|
+
currentAction: tierSummary.action ?? state.agentTree.currentAction,
|
|
13301
|
+
activeTool: state.activeTool,
|
|
13302
|
+
isStreaming: state.isStreaming
|
|
13303
|
+
}
|
|
13304
|
+
) : /* @__PURE__ */ jsx(
|
|
13305
|
+
AgentTree,
|
|
13306
|
+
{
|
|
13307
|
+
root: state.agentTree,
|
|
13308
|
+
theme,
|
|
13309
|
+
scrollOffset: treeScrollOffset,
|
|
13310
|
+
maxRows: adaptiveMode === "medium" ? Math.min(4, liveBudget.treeMaxRows) : liveBudget.treeMaxRows
|
|
13311
|
+
}
|
|
13312
|
+
),
|
|
13313
|
+
adaptiveMode === "wide" && state.showComms && liveBudget.commsMaxEvents > 0 && /* @__PURE__ */ jsx(PeerFeed, { events: state.peerEvents, theme, maxRows: liveBudget.commsMaxEvents }),
|
|
13314
|
+
adaptiveMode === "wide" && state.showDetails && liveBudget.showTimeline && /* @__PURE__ */ jsx(TimelinePanel, { nodes: [...treeNodesRef.current.values()], theme, currentIndex: timelineIndex, onChangeIndex: setTimelineIndex }),
|
|
13315
|
+
adaptiveMode !== "narrow" && state.showCost && /* @__PURE__ */ jsx(CostTracker, { theme, totalTokens: state.totalTokens, totalCostUsd: state.totalCostUsd, callsByProvider: state.callsByProvider, callsByTier: state.callsByTier, costByTier: state.costByTier, tokensByTier: state.tokensByTier, compact: liveBudget.costCompact, savedUsd: state.savedUsd, savedPct: state.savedPct }),
|
|
13236
13316
|
liveBudget.collapsed && (state.showCost || state.showDetails || state.agentTree != null) && /* @__PURE__ */ jsx(Text, { color: theme.colors.muted, dimColor: true, children: " \u25B8 panels collapsed (small terminal)" }),
|
|
13237
13317
|
state.approvalRequest && /* @__PURE__ */ jsx(ApprovalPrompt, { request: state.approvalRequest, theme, onDecision: (decision) => {
|
|
13238
13318
|
dispatch({ type: "SET_APPROVAL", request: null });
|