pantheon-opencode 2.1.6 → 2.2.0-beta.2
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/AGENTS.global.md +2 -2
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +64 -0
- package/README.md +13 -9
- package/README.pt-BR.md +13 -9
- package/bin/pantheon-init.mjs +1 -1
- package/commands/pantheon-audit.md +4 -5
- package/commands/pantheon-model.md +1 -2
- package/package.json +8 -2
- package/plugin.json +1 -1
- package/prompts/dynamic/agora-generated.txt +2 -2
- package/prompts/dynamic/orchestrate-generated.txt +4 -4
- package/prompts/sketch.prompt.md +1 -1
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +73 -12
- package/scripts/build-plugin.mjs +3 -1
- package/scripts/hooks/format-multi-language.sh +30 -29
- package/scripts/install-mcp.mjs +55 -27
- package/scripts/prune.mjs +124 -2
- package/scripts/setup.mjs +1 -1
- package/scripts/themis_heuristic_scan.py +3 -5
- package/skills-lock.json +1 -1
- package/src/agents/aphrodite.md +1 -1
- package/src/agents/athena.md +6 -14
- package/src/agents/demeter.md +1 -1
- package/src/agents/hermes.md +3 -2
- package/src/agents/iris.md +4 -6
- package/src/agents/prometheus.md +3 -7
- package/src/agents/roster.json +567 -0
- package/src/agents/zeus.md +3 -0
- package/src/instructions/agent-return-format.instructions.md +1 -1
- package/src/instructions/zeus-anti-stall.instructions.md +11 -35
- package/src/instructions/zeus-council-synthesis.instructions.md +17 -49
- package/src/instructions/zeus-timeout-retry.instructions.md +12 -80
- package/src/mcp/mcp_codemap_module.py +6 -5
- package/src/mcp/pantheon-mcp-server.mjs +875 -0
- package/src/pantheon/agent-forge-tool.ts +316 -0
- package/src/pantheon/auto-permissions.ts +31 -1
- package/src/pantheon/codemap-tools.ts +525 -0
- package/src/pantheon/deepwork/plan-tracker.ts +63 -2
- package/src/pantheon/execute-after.ts +21 -0
- package/src/pantheon/hook-engine.ts +2 -1
- package/src/pantheon/native-memory-tools.ts +686 -0
- package/src/pantheon/presets.mjs +15 -0
- package/src/pantheon/step-ledger.ts +259 -0
- package/src/pantheon/swe-eval-harness.ts +211 -0
- package/src/pantheon/tools.ts +62 -7
- package/src/plugin/index.js +2091 -136
- package/src/plugin/index.ts +1 -14
- package/src/plugin.ts +167 -10
- package/src/plugins/tui/dist/tui.d.ts +66 -0
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +1259 -367
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/index.tsx +632 -71
- package/src/plugins/tui/src/pantheon-settings.tsx +78 -14
- package/src/plugins/tui/src/quota-state.ts +190 -0
- package/src/plugins/tui/src/tui-prefs.ts +169 -12
- package/src/routing.yml +3 -0
- package/src/skills/auto-continue/references/auto-continue-details.md +2 -31
- /package/scripts/{setup-v2-config.mjs → setup-config.mjs} +0 -0
|
@@ -5,7 +5,7 @@ import { mkdir, readFile, rename, stat, unlink, writeFile } from "node:fs/promis
|
|
|
5
5
|
import { homedir } from "node:os";
|
|
6
6
|
import { dirname, join } from "node:path";
|
|
7
7
|
import { Plugin } from "@opencode/plugin/tui";
|
|
8
|
-
import { For, Show, createEffect, createMemo, createSignal, on, onCleanup, onMount } from "solid-js";
|
|
8
|
+
import { ErrorBoundary, For, Show, createEffect, createMemo, createSignal, on, onCleanup, onMount } from "solid-js";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
//#region src/context-gauge.ts
|
|
11
11
|
const CONTEXT_BAR_CELLS = 12;
|
|
@@ -1357,6 +1357,160 @@ function buildPresetTab(input, languagePref) {
|
|
|
1357
1357
|
};
|
|
1358
1358
|
}
|
|
1359
1359
|
//#endregion
|
|
1360
|
+
//#region src/quota-state.ts
|
|
1361
|
+
/**
|
|
1362
|
+
* quota-state.ts — the Quotas & Spend tab (inspired by opencode-quota).
|
|
1363
|
+
*
|
|
1364
|
+
* Exposes live model token spending, daily budgets, rate-limits per provider,
|
|
1365
|
+
* and context token telemetry in a dedicated tab in the Pantheon Settings window.
|
|
1366
|
+
*/
|
|
1367
|
+
const DEFAULT_QUOTA_PREFS = {
|
|
1368
|
+
sessionCap: "$5.00",
|
|
1369
|
+
alertThreshold: "enabled",
|
|
1370
|
+
autoCompact: "enabled"
|
|
1371
|
+
};
|
|
1372
|
+
function resolveQuotaPrefsPath() {
|
|
1373
|
+
const xdg = process.env.XDG_CONFIG_HOME;
|
|
1374
|
+
const base = xdg?.startsWith("/") ? xdg : join(homedir(), ".config");
|
|
1375
|
+
return join(base, "opencode", "pantheon-quota.json");
|
|
1376
|
+
}
|
|
1377
|
+
function readQuotaPrefs(filePath = resolveQuotaPrefsPath()) {
|
|
1378
|
+
try {
|
|
1379
|
+
if (!existsSync(filePath)) return { ...DEFAULT_QUOTA_PREFS };
|
|
1380
|
+
const raw = JSON.parse(readFileSync(filePath, "utf8"));
|
|
1381
|
+
return {
|
|
1382
|
+
sessionCap: typeof raw.sessionCap === "string" && [
|
|
1383
|
+
"$1.00",
|
|
1384
|
+
"$2.00",
|
|
1385
|
+
"$5.00",
|
|
1386
|
+
"$10.00",
|
|
1387
|
+
"unlimited"
|
|
1388
|
+
].includes(raw.sessionCap) ? raw.sessionCap : DEFAULT_QUOTA_PREFS.sessionCap,
|
|
1389
|
+
alertThreshold: raw.alertThreshold === "disabled" ? "disabled" : "enabled",
|
|
1390
|
+
autoCompact: raw.autoCompact === "disabled" ? "disabled" : "enabled"
|
|
1391
|
+
};
|
|
1392
|
+
} catch {
|
|
1393
|
+
return { ...DEFAULT_QUOTA_PREFS };
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
function writeQuotaPrefs(prefs, filePath = resolveQuotaPrefsPath()) {
|
|
1397
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
1398
|
+
writeFileSync(filePath, `${JSON.stringify(prefs, null, 2)}\n`, "utf8");
|
|
1399
|
+
}
|
|
1400
|
+
function applyQuotaRow(prefs, id, value) {
|
|
1401
|
+
const next = { ...prefs };
|
|
1402
|
+
if (id === "quota.budget.sessionCap") {
|
|
1403
|
+
if ([
|
|
1404
|
+
"$1.00",
|
|
1405
|
+
"$2.00",
|
|
1406
|
+
"$5.00",
|
|
1407
|
+
"$10.00",
|
|
1408
|
+
"unlimited"
|
|
1409
|
+
].includes(value)) next.sessionCap = value;
|
|
1410
|
+
} else if (id === "quota.budget.alertThreshold") next.alertThreshold = value === "disabled" ? "disabled" : "enabled";
|
|
1411
|
+
else if (id === "quota.compaction.auto") next.autoCompact = value === "disabled" ? "disabled" : "enabled";
|
|
1412
|
+
return next;
|
|
1413
|
+
}
|
|
1414
|
+
function buildQuotaTab(snapshot, languagePref, prefs = readQuotaPrefs()) {
|
|
1415
|
+
const isPt = resolveLanguage(languagePref) === "pt-BR";
|
|
1416
|
+
return {
|
|
1417
|
+
id: "quota",
|
|
1418
|
+
title: isPt ? "Cotas & Gastos" : "Quotas & Spend",
|
|
1419
|
+
groups: [
|
|
1420
|
+
{
|
|
1421
|
+
title: isPt ? "Consumo & Gastos de Sessão" : "Session Spend & Tokens",
|
|
1422
|
+
rows: [
|
|
1423
|
+
{
|
|
1424
|
+
id: "quota.spend.today",
|
|
1425
|
+
name: isPt ? "Gasto hoje (00h-agora)" : "Spend today (00h-now)",
|
|
1426
|
+
value: snapshot?.todaySpend ?? "—",
|
|
1427
|
+
note: isPt ? "Calculado a partir de opencode.db" : "Derived from opencode.db ledger"
|
|
1428
|
+
},
|
|
1429
|
+
{
|
|
1430
|
+
id: "quota.spend.month",
|
|
1431
|
+
name: isPt ? "Gasto acumulado (30d)" : "Spend last 30 days",
|
|
1432
|
+
value: snapshot?.monthSpend ?? "—",
|
|
1433
|
+
note: isPt ? "Janela móvel de 30 dias" : "Rolling 30-day window"
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
id: "quota.spend.session",
|
|
1437
|
+
name: isPt ? "Gasto na sessão ativa" : "Active session spend",
|
|
1438
|
+
value: snapshot?.sessionSpend ?? "—",
|
|
1439
|
+
note: isPt ? "Custo de todas as mensagens do turno" : "Sum of turn assistant messages"
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
id: "quota.tokens.context",
|
|
1443
|
+
name: isPt ? "Tokens de contexto" : "Context tokens",
|
|
1444
|
+
value: snapshot?.sessionTokens ?? "—",
|
|
1445
|
+
note: isPt ? "Tokens consumidos vs janela do modelo" : "Tokens used vs model context limit"
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
id: "quota.tokens.cache",
|
|
1449
|
+
name: isPt ? "Eficiência de cache" : "Prompt cache hit",
|
|
1450
|
+
value: snapshot?.cacheHit ?? "—",
|
|
1451
|
+
note: isPt ? "Desconto de leitura em cache aplicado" : "Cache read discount applied"
|
|
1452
|
+
}
|
|
1453
|
+
]
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
title: isPt ? "Limites & Teto de Orçamento" : "Rate Limits & Budget Caps",
|
|
1457
|
+
rows: [
|
|
1458
|
+
{
|
|
1459
|
+
id: "quota.budget.sessionCap",
|
|
1460
|
+
name: isPt ? "Teto por sessão" : "Session budget cap",
|
|
1461
|
+
value: prefs.sessionCap,
|
|
1462
|
+
cycle: [
|
|
1463
|
+
"$1.00",
|
|
1464
|
+
"$2.00",
|
|
1465
|
+
"$5.00",
|
|
1466
|
+
"$10.00",
|
|
1467
|
+
"unlimited"
|
|
1468
|
+
],
|
|
1469
|
+
note: isPt ? "Avisa ou pausa ao atingir o teto" : "Warns or pauses when session spend reaches cap"
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
id: "quota.budget.alertThreshold",
|
|
1473
|
+
name: isPt ? "Alerta em 80% do teto" : "Alert at 80% of cap",
|
|
1474
|
+
value: prefs.alertThreshold,
|
|
1475
|
+
cycle: ["enabled", "disabled"],
|
|
1476
|
+
note: isPt ? "Emite aviso visual no footer da TUI" : "Shows visual notice in TUI footer"
|
|
1477
|
+
},
|
|
1478
|
+
{
|
|
1479
|
+
id: "quota.compaction.auto",
|
|
1480
|
+
name: isPt ? "Auto-compactar em 80% do contexto" : "Auto-compact at 80% context",
|
|
1481
|
+
value: prefs.autoCompact,
|
|
1482
|
+
cycle: ["enabled", "disabled"],
|
|
1483
|
+
note: isPt ? "Aciona compressão automática de histórico" : "Triggers automatic context compaction"
|
|
1484
|
+
}
|
|
1485
|
+
]
|
|
1486
|
+
},
|
|
1487
|
+
{
|
|
1488
|
+
title: isPt ? "Provedores & Janelas de Cota (Referência)" : "Providers & Quota Windows (Reference)",
|
|
1489
|
+
rows: [
|
|
1490
|
+
{
|
|
1491
|
+
id: "quota.ref.anthropic",
|
|
1492
|
+
name: "Anthropic (Claude 3.7)",
|
|
1493
|
+
value: "Tier 4",
|
|
1494
|
+
note: isPt ? "400k TPM · Reset diário às 00:00 UTC" : "400k TPM · Daily reset at 00:00 UTC"
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
id: "quota.ref.openai",
|
|
1498
|
+
name: "OpenAI (GPT-4o)",
|
|
1499
|
+
value: "Tier 4",
|
|
1500
|
+
note: isPt ? "800k TPM · Reset por janela móvel de 1 min" : "800k TPM · 1-minute rolling window"
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
id: "quota.ref.google",
|
|
1504
|
+
name: "Google (Gemini 2.5)",
|
|
1505
|
+
value: "Pay-as-you-go",
|
|
1506
|
+
note: isPt ? "4M TPM · Alta capacidade com cota flexível" : "4M TPM · High capacity with flexible quota"
|
|
1507
|
+
}
|
|
1508
|
+
]
|
|
1509
|
+
}
|
|
1510
|
+
]
|
|
1511
|
+
};
|
|
1512
|
+
}
|
|
1513
|
+
//#endregion
|
|
1360
1514
|
//#region src/tui-prefs.ts
|
|
1361
1515
|
const PREFS_SYMBOL = Symbol.for("pantheon.tui.prefs.v1");
|
|
1362
1516
|
const DRAFT_PREVIEW_SYMBOL = Symbol.for("pantheon.tui.draft_preview.v1");
|
|
@@ -1391,8 +1545,12 @@ function initTuiPrefs(context) {
|
|
|
1391
1545
|
const handle = context.storage?.store?.("tui-prefs", { initial: DEFAULT_TUI_PREFS });
|
|
1392
1546
|
if (handle !== void 0) {
|
|
1393
1547
|
globalThis[PREFS_SYMBOL] = handle;
|
|
1394
|
-
if (!handle[0]?.layout) handle[1]((draft) => {
|
|
1548
|
+
if (!handle[0]?.layout || typeof handle[0]?.sidebar?.context?.turnCost !== "boolean" || typeof handle[0]?.sidebar?.context?.tokenAnatomy !== "boolean") handle[1]((draft) => {
|
|
1395
1549
|
if (!draft.layout) draft.layout = { ...DEFAULT_TUI_PREFS.layout };
|
|
1550
|
+
if (draft.sidebar?.context) {
|
|
1551
|
+
if (typeof draft.sidebar.context.turnCost !== "boolean") draft.sidebar.context.turnCost = true;
|
|
1552
|
+
if (typeof draft.sidebar.context.tokenAnatomy !== "boolean") draft.sidebar.context.tokenAnatomy = true;
|
|
1553
|
+
}
|
|
1396
1554
|
}).catch(() => {});
|
|
1397
1555
|
}
|
|
1398
1556
|
} catch {}
|
|
@@ -1410,8 +1568,10 @@ function previewTuiPrefs(base, draft) {
|
|
|
1410
1568
|
const effective = {
|
|
1411
1569
|
version: 1,
|
|
1412
1570
|
layout: { ...normalized.layout },
|
|
1571
|
+
...normalized.theme ? { theme: { ...normalized.theme } } : {},
|
|
1413
1572
|
sidebar: {
|
|
1414
1573
|
header: { ...normalized.sidebar.header },
|
|
1574
|
+
...normalized.sidebar.pinnedSessions ? { pinnedSessions: [...normalized.sidebar.pinnedSessions] } : {},
|
|
1415
1575
|
blocks: { ...normalized.sidebar.blocks },
|
|
1416
1576
|
context: { ...normalized.sidebar.context }
|
|
1417
1577
|
},
|
|
@@ -1424,11 +1584,7 @@ function previewTuiPrefs(base, draft) {
|
|
|
1424
1584
|
function savedTuiPrefs() {
|
|
1425
1585
|
const s = stash()?.[0];
|
|
1426
1586
|
if (!s) return DEFAULT_TUI_PREFS;
|
|
1427
|
-
|
|
1428
|
-
...s,
|
|
1429
|
-
layout: DEFAULT_TUI_PREFS.layout
|
|
1430
|
-
};
|
|
1431
|
-
return s;
|
|
1587
|
+
return normalizeTuiPrefs(s);
|
|
1432
1588
|
}
|
|
1433
1589
|
/** The live reactive prefs (read properties inside memos/JSX — tracked).
|
|
1434
1590
|
* When a settings window has an active draft, preview overlays on top
|
|
@@ -1453,9 +1609,9 @@ const GAUGE_STYLES = Object.freeze([
|
|
|
1453
1609
|
]);
|
|
1454
1610
|
const ENABLED_CYCLE = Object.freeze(["enabled", "disabled"]);
|
|
1455
1611
|
const BAR_SHAPES_CYCLE = Object.freeze([
|
|
1612
|
+
"smooth",
|
|
1456
1613
|
"line",
|
|
1457
1614
|
"block",
|
|
1458
|
-
"smooth",
|
|
1459
1615
|
"ascii",
|
|
1460
1616
|
"dots",
|
|
1461
1617
|
"braille"
|
|
@@ -1483,20 +1639,80 @@ const LANGUAGE_CYCLE = Object.freeze([
|
|
|
1483
1639
|
"pt-BR",
|
|
1484
1640
|
"en"
|
|
1485
1641
|
]);
|
|
1642
|
+
const THEME_MODES_CYCLE = Object.freeze([
|
|
1643
|
+
"auto",
|
|
1644
|
+
"dark",
|
|
1645
|
+
"light"
|
|
1646
|
+
]);
|
|
1647
|
+
const ACCENT_COLORS_CYCLE = Object.freeze([
|
|
1648
|
+
"host",
|
|
1649
|
+
"pantheon",
|
|
1650
|
+
"emerald",
|
|
1651
|
+
"cyan",
|
|
1652
|
+
"amber",
|
|
1653
|
+
"purple",
|
|
1654
|
+
"rose"
|
|
1655
|
+
]);
|
|
1656
|
+
const ACCENT_PALETTE = {
|
|
1657
|
+
host: {
|
|
1658
|
+
primary: "#fba970",
|
|
1659
|
+
hover: "#fdba74",
|
|
1660
|
+
muted: "#a1a1aa"
|
|
1661
|
+
},
|
|
1662
|
+
pantheon: {
|
|
1663
|
+
primary: "#fba970",
|
|
1664
|
+
hover: "#fdba74",
|
|
1665
|
+
muted: "#a1a1aa"
|
|
1666
|
+
},
|
|
1667
|
+
emerald: {
|
|
1668
|
+
primary: "#10b981",
|
|
1669
|
+
hover: "#34d399",
|
|
1670
|
+
muted: "#059669"
|
|
1671
|
+
},
|
|
1672
|
+
cyan: {
|
|
1673
|
+
primary: "#06b6d4",
|
|
1674
|
+
hover: "#22d3ee",
|
|
1675
|
+
muted: "#0891b2"
|
|
1676
|
+
},
|
|
1677
|
+
amber: {
|
|
1678
|
+
primary: "#f59e0b",
|
|
1679
|
+
hover: "#fbbf24",
|
|
1680
|
+
muted: "#d97706"
|
|
1681
|
+
},
|
|
1682
|
+
purple: {
|
|
1683
|
+
primary: "#a855f7",
|
|
1684
|
+
hover: "#c084fc",
|
|
1685
|
+
muted: "#9333ea"
|
|
1686
|
+
},
|
|
1687
|
+
rose: {
|
|
1688
|
+
primary: "#f43f5e",
|
|
1689
|
+
hover: "#fb7185",
|
|
1690
|
+
muted: "#e11d48"
|
|
1691
|
+
}
|
|
1692
|
+
};
|
|
1693
|
+
function resolveAccentColor(accent, contextTheme) {
|
|
1694
|
+
if (!accent || accent === "host") return contextTheme?.text?.feedback?.warning?.base ?? contextTheme?.text?.base ?? "#fba970";
|
|
1695
|
+
return ACCENT_PALETTE[accent]?.primary ?? "#fba970";
|
|
1696
|
+
}
|
|
1486
1697
|
const DEFAULT_TUI_PREFS = {
|
|
1487
1698
|
version: 1,
|
|
1488
1699
|
layout: {
|
|
1489
1700
|
preset: "comfortable",
|
|
1490
1701
|
separator: "spaces",
|
|
1491
|
-
settingsView: "
|
|
1702
|
+
settingsView: "docked",
|
|
1492
1703
|
language: "auto"
|
|
1493
1704
|
},
|
|
1705
|
+
theme: {
|
|
1706
|
+
mode: "auto",
|
|
1707
|
+
accent: "host"
|
|
1708
|
+
},
|
|
1494
1709
|
sidebar: {
|
|
1495
1710
|
header: {
|
|
1496
1711
|
version: true,
|
|
1497
1712
|
preset: true,
|
|
1498
1713
|
session: true
|
|
1499
1714
|
},
|
|
1715
|
+
pinnedSessions: [],
|
|
1500
1716
|
blocks: {
|
|
1501
1717
|
context: true,
|
|
1502
1718
|
git: true,
|
|
@@ -1505,14 +1721,16 @@ const DEFAULT_TUI_PREFS = {
|
|
|
1505
1721
|
},
|
|
1506
1722
|
context: {
|
|
1507
1723
|
gauge: "both",
|
|
1508
|
-
barShape: "
|
|
1724
|
+
barShape: "smooth",
|
|
1509
1725
|
barWidth: "standard",
|
|
1510
1726
|
evenMark: false,
|
|
1511
1727
|
tokens: true,
|
|
1512
1728
|
spent: true,
|
|
1513
1729
|
modelUsage: true,
|
|
1514
1730
|
performance: true,
|
|
1515
|
-
localSpend: true
|
|
1731
|
+
localSpend: true,
|
|
1732
|
+
turnCost: true,
|
|
1733
|
+
tokenAnatomy: true
|
|
1516
1734
|
}
|
|
1517
1735
|
},
|
|
1518
1736
|
footer: {
|
|
@@ -1532,6 +1750,9 @@ function normalizeTuiPrefs(raw) {
|
|
|
1532
1750
|
const blocks = typeof sidebar.blocks === "object" && sidebar.blocks !== null ? sidebar.blocks : {};
|
|
1533
1751
|
const context = typeof sidebar.context === "object" && sidebar.context !== null ? sidebar.context : {};
|
|
1534
1752
|
const footer = typeof stored.footer === "object" && stored.footer !== null ? stored.footer : {};
|
|
1753
|
+
const rawTheme = typeof stored.theme === "object" && stored.theme !== null ? stored.theme : {};
|
|
1754
|
+
const themeMode = THEME_MODES_CYCLE.includes(rawTheme.mode) ? rawTheme.mode : DEFAULT_TUI_PREFS.theme?.mode ?? "auto";
|
|
1755
|
+
const themeAccent = ACCENT_COLORS_CYCLE.includes(rawTheme.accent) ? rawTheme.accent : DEFAULT_TUI_PREFS.theme?.accent ?? "host";
|
|
1535
1756
|
const preset = LAYOUT_PRESETS_CYCLE.includes(layout.preset) ? layout.preset : DEFAULT_TUI_PREFS.layout.preset;
|
|
1536
1757
|
const separator = SEPARATOR_STYLES_CYCLE.includes(layout.separator) ? layout.separator : DEFAULT_TUI_PREFS.layout.separator;
|
|
1537
1758
|
const settingsView = SETTINGS_VIEW_MODES.includes(layout.settingsView) ? layout.settingsView : DEFAULT_TUI_PREFS.layout.settingsView;
|
|
@@ -1548,12 +1769,17 @@ function normalizeTuiPrefs(raw) {
|
|
|
1548
1769
|
settingsView,
|
|
1549
1770
|
language
|
|
1550
1771
|
},
|
|
1772
|
+
theme: {
|
|
1773
|
+
mode: themeMode,
|
|
1774
|
+
accent: themeAccent
|
|
1775
|
+
},
|
|
1551
1776
|
sidebar: {
|
|
1552
1777
|
header: {
|
|
1553
1778
|
version: asBool(header.version, true),
|
|
1554
1779
|
preset: asBool(header.preset, true),
|
|
1555
1780
|
session: asBool(header.session, true)
|
|
1556
1781
|
},
|
|
1782
|
+
pinnedSessions: Array.isArray(sidebar.pinnedSessions) ? sidebar.pinnedSessions.filter((s) => typeof s === "string") : [],
|
|
1557
1783
|
blocks: {
|
|
1558
1784
|
context: asBool(blocks.context, true),
|
|
1559
1785
|
git: asBool(blocks.git, true),
|
|
@@ -1569,7 +1795,9 @@ function normalizeTuiPrefs(raw) {
|
|
|
1569
1795
|
spent: asBool(context.spent, true),
|
|
1570
1796
|
modelUsage: asBool(context.modelUsage, true),
|
|
1571
1797
|
performance: asBool(context.performance, true),
|
|
1572
|
-
localSpend: asBool(context.localSpend, true)
|
|
1798
|
+
localSpend: asBool(context.localSpend, true),
|
|
1799
|
+
turnCost: asBool(context.turnCost, true),
|
|
1800
|
+
tokenAnatomy: asBool(context.tokenAnatomy, true)
|
|
1573
1801
|
}
|
|
1574
1802
|
},
|
|
1575
1803
|
footer: {
|
|
@@ -1625,6 +1853,22 @@ function buildTuiTab(prefs, languagePref) {
|
|
|
1625
1853
|
}
|
|
1626
1854
|
]
|
|
1627
1855
|
},
|
|
1856
|
+
{
|
|
1857
|
+
title: isPt ? "Cores & Tema" : "Colors & Theme",
|
|
1858
|
+
rows: [{
|
|
1859
|
+
id: "tui.theme.mode",
|
|
1860
|
+
name: isPt ? "Modo do tema" : "Theme mode",
|
|
1861
|
+
value: tuiRowValue(prefs, "tui.theme.mode") ?? "auto",
|
|
1862
|
+
cycle: THEME_MODES_CYCLE,
|
|
1863
|
+
note: isPt ? "auto (segue o OpenCode) | dark | light" : "auto (follow OpenCode theme) | dark | light"
|
|
1864
|
+
}, {
|
|
1865
|
+
id: "tui.theme.accent",
|
|
1866
|
+
name: isPt ? "Cor de destaque" : "Accent color",
|
|
1867
|
+
value: tuiRowValue(prefs, "tui.theme.accent") ?? "host",
|
|
1868
|
+
cycle: ACCENT_COLORS_CYCLE,
|
|
1869
|
+
note: isPt ? "host (segue tema) | pantheon | emerald | cyan | amber | purple | rose" : "host (follow theme) | pantheon | emerald | cyan | amber | purple | rose"
|
|
1870
|
+
}]
|
|
1871
|
+
},
|
|
1628
1872
|
{
|
|
1629
1873
|
title: isPt ? "Barras & Medidores" : "Bars & Gauges",
|
|
1630
1874
|
rows: [
|
|
@@ -1675,6 +1919,8 @@ function buildTuiTab(prefs, languagePref) {
|
|
|
1675
1919
|
row("tui.sidebar.context.spent", isPt ? "Linha de custo" : "Spent row", prefs.sidebar.context.spent, isPt ? "linha `$… gastos na sessão`" : "the `$… spent in session` line"),
|
|
1676
1920
|
row("tui.sidebar.context.modelUsage", isPt ? "Tabela de uso de modelos" : "Model usage table", prefs.sidebar.context.modelUsage, isPt ? "resumo de chamadas por modelo" : "per-model tokens/USD"),
|
|
1677
1921
|
row("tui.sidebar.context.performance", isPt ? "Linha de desempenho" : "Performance row", prefs.sidebar.context.performance, isPt ? "tokens/segundo e latência" : "cache % + tok/s"),
|
|
1922
|
+
row("tui.sidebar.context.turnCost", isPt ? "Custo do turno" : "Turn cost", prefs.sidebar.context.turnCost, isPt ? "linha `Turn: $… (prev: $…)`" : "the `Turn: $… (prev: $…)` line"),
|
|
1923
|
+
row("tui.sidebar.context.tokenAnatomy", isPt ? "Anatomia de tokens" : "Token anatomy", prefs.sidebar.context.tokenAnatomy, isPt ? "linha `↑in ↓out ✦think`" : "the `↑in ↓out ✦think` line"),
|
|
1678
1924
|
row("tui.sidebar.context.localSpend", isPt ? "Linha de custo local" : "Local spend row", prefs.sidebar.context.localSpend, isPt ? "totais de hoje / 30 dias" : "hoje / 30d totals")
|
|
1679
1925
|
]
|
|
1680
1926
|
},
|
|
@@ -1716,6 +1962,18 @@ function applyTuiRow(draft, id, value) {
|
|
|
1716
1962
|
draft.layout.language = value;
|
|
1717
1963
|
}
|
|
1718
1964
|
return;
|
|
1965
|
+
case "tui.theme.mode":
|
|
1966
|
+
if (THEME_MODES_CYCLE.includes(value)) {
|
|
1967
|
+
if (!draft.theme) draft.theme = { ...DEFAULT_TUI_PREFS.theme };
|
|
1968
|
+
draft.theme.mode = value;
|
|
1969
|
+
}
|
|
1970
|
+
return;
|
|
1971
|
+
case "tui.theme.accent":
|
|
1972
|
+
if (ACCENT_COLORS_CYCLE.includes(value)) {
|
|
1973
|
+
if (!draft.theme) draft.theme = { ...DEFAULT_TUI_PREFS.theme };
|
|
1974
|
+
draft.theme.accent = value;
|
|
1975
|
+
}
|
|
1976
|
+
return;
|
|
1719
1977
|
case "tui.sidebar.context.barShape":
|
|
1720
1978
|
if (BAR_SHAPES_CYCLE.includes(value)) draft.sidebar.context.barShape = value;
|
|
1721
1979
|
return;
|
|
@@ -1764,6 +2022,12 @@ function applyTuiRow(draft, id, value) {
|
|
|
1764
2022
|
case "tui.sidebar.context.localSpend":
|
|
1765
2023
|
draft.sidebar.context.localSpend = enabled;
|
|
1766
2024
|
return;
|
|
2025
|
+
case "tui.sidebar.context.turnCost":
|
|
2026
|
+
draft.sidebar.context.turnCost = enabled;
|
|
2027
|
+
return;
|
|
2028
|
+
case "tui.sidebar.context.tokenAnatomy":
|
|
2029
|
+
draft.sidebar.context.tokenAnatomy = enabled;
|
|
2030
|
+
return;
|
|
1767
2031
|
case "tui.footer.prompt":
|
|
1768
2032
|
draft.footer.prompt = enabled;
|
|
1769
2033
|
return;
|
|
@@ -1779,6 +2043,8 @@ function tuiRowValue(prefs, id) {
|
|
|
1779
2043
|
if (id === "tui.layout.separator") return prefs.layout?.separator ?? DEFAULT_TUI_PREFS.layout.separator;
|
|
1780
2044
|
if (id === "tui.layout.settingsView") return prefs.layout?.settingsView ?? DEFAULT_TUI_PREFS.layout.settingsView ?? "docked";
|
|
1781
2045
|
if (id === "tui.layout.language") return prefs.layout?.language ?? "auto";
|
|
2046
|
+
if (id === "tui.theme.mode") return prefs.theme?.mode ?? DEFAULT_TUI_PREFS.theme?.mode ?? "auto";
|
|
2047
|
+
if (id === "tui.theme.accent") return prefs.theme?.accent ?? DEFAULT_TUI_PREFS.theme?.accent ?? "host";
|
|
1782
2048
|
if (id === "tui.sidebar.context.barShape") return prefs.sidebar.context.barShape;
|
|
1783
2049
|
if (id === "tui.sidebar.context.barWidth") return prefs.sidebar.context.barWidth;
|
|
1784
2050
|
if (id === "tui.sidebar.context.gauge") return prefs.sidebar.context.gauge;
|
|
@@ -1797,6 +2063,8 @@ function tuiRowValue(prefs, id) {
|
|
|
1797
2063
|
case "tui.sidebar.context.modelUsage": return prefs.sidebar.context.modelUsage;
|
|
1798
2064
|
case "tui.sidebar.context.performance": return prefs.sidebar.context.performance;
|
|
1799
2065
|
case "tui.sidebar.context.localSpend": return prefs.sidebar.context.localSpend;
|
|
2066
|
+
case "tui.sidebar.context.turnCost": return prefs.sidebar.context.turnCost;
|
|
2067
|
+
case "tui.sidebar.context.tokenAnatomy": return prefs.sidebar.context.tokenAnatomy;
|
|
1800
2068
|
case "tui.footer.prompt": return prefs.footer.prompt;
|
|
1801
2069
|
case "tui.footer.home": return prefs.footer.home;
|
|
1802
2070
|
default: return;
|
|
@@ -1804,6 +2072,11 @@ function tuiRowValue(prefs, id) {
|
|
|
1804
2072
|
})();
|
|
1805
2073
|
return enabled === void 0 ? void 0 : enabled ? "enabled" : "disabled";
|
|
1806
2074
|
}
|
|
2075
|
+
function isSessionPinned(sessionID) {
|
|
2076
|
+
if (!sessionID) return false;
|
|
2077
|
+
const list = tuiPrefs().sidebar.pinnedSessions;
|
|
2078
|
+
return Array.isArray(list) && list.includes(sessionID);
|
|
2079
|
+
}
|
|
1807
2080
|
//#endregion
|
|
1808
2081
|
//#region src/update-status.ts
|
|
1809
2082
|
/** The running version's channel: a `-beta.N` suffix rides the beta dist-tag. */
|
|
@@ -2061,7 +2334,7 @@ async function readChangelogForBundle(bundleUrl) {
|
|
|
2061
2334
|
}
|
|
2062
2335
|
/** The ambient build-time version, or null outside a tsdown build. */
|
|
2063
2336
|
function embeddedVersion() {
|
|
2064
|
-
return "2.
|
|
2337
|
+
return "2.2.0-beta.2";
|
|
2065
2338
|
}
|
|
2066
2339
|
/**
|
|
2067
2340
|
* Resolve the running Pantheon version for the what's-new window: the plugin
|
|
@@ -2286,7 +2559,7 @@ function persistUpdateCheckState(previous, latest) {
|
|
|
2286
2559
|
} catch {}
|
|
2287
2560
|
}
|
|
2288
2561
|
function resolveRunningVersion() {
|
|
2289
|
-
return "2.
|
|
2562
|
+
return "2.2.0-beta.2";
|
|
2290
2563
|
}
|
|
2291
2564
|
const VALUE_WIDTH = 24;
|
|
2292
2565
|
function SettingsWindow(props) {
|
|
@@ -2560,10 +2833,10 @@ function SettingsWindow(props) {
|
|
|
2560
2833
|
setProp(_el$68, "flexShrink", 0);
|
|
2561
2834
|
insert(_el$68, () => isPt() ? "sem alterações pendentes" : "no staged changes");
|
|
2562
2835
|
effect((_p$) => {
|
|
2563
|
-
var _v$
|
|
2564
|
-
_v$
|
|
2565
|
-
_v$
|
|
2566
|
-
_v$
|
|
2836
|
+
var _v$11 = props.muted, _v$12 = props.muted, _v$13 = props.muted;
|
|
2837
|
+
_v$11 !== _p$.e && (_p$.e = setProp(_el$57, "fg", _v$11, _p$.e));
|
|
2838
|
+
_v$12 !== _p$.t && (_p$.t = setProp(_el$62, "fg", _v$12, _p$.t));
|
|
2839
|
+
_v$13 !== _p$.a && (_p$.a = setProp(_el$68, "fg", _v$13, _p$.a));
|
|
2567
2840
|
return _p$;
|
|
2568
2841
|
}, {
|
|
2569
2842
|
e: void 0,
|
|
@@ -2588,7 +2861,6 @@ function SettingsWindow(props) {
|
|
|
2588
2861
|
setProp(_el$39, "flexShrink", 0);
|
|
2589
2862
|
setProp(_el$39, "rowGap", 1);
|
|
2590
2863
|
insertNode(_el$40, _el$41);
|
|
2591
|
-
setProp(_el$40, "backgroundColor", "#fba970");
|
|
2592
2864
|
setProp(_el$40, "flexShrink", 0);
|
|
2593
2865
|
setProp(_el$40, "onMouseDown", () => props.onSave?.());
|
|
2594
2866
|
setProp(_el$41, "fg", "#000000");
|
|
@@ -2614,15 +2886,17 @@ function SettingsWindow(props) {
|
|
|
2614
2886
|
setProp(_el$51, "flexShrink", 0);
|
|
2615
2887
|
insert(_el$51, () => isPt() ? "alterações não salvas" : "unsaved changes");
|
|
2616
2888
|
effect((_p$) => {
|
|
2617
|
-
var _v$
|
|
2618
|
-
_v$
|
|
2619
|
-
_v$
|
|
2620
|
-
_v$
|
|
2889
|
+
var _v$9 = props.warn ?? "#fba970", _v$0 = props.muted, _v$1 = props.muted, _v$10 = props.warn ?? "#f59e0b";
|
|
2890
|
+
_v$9 !== _p$.e && (_p$.e = setProp(_el$40, "backgroundColor", _v$9, _p$.e));
|
|
2891
|
+
_v$0 !== _p$.t && (_p$.t = setProp(_el$42, "fg", _v$0, _p$.t));
|
|
2892
|
+
_v$1 !== _p$.a && (_p$.a = setProp(_el$46, "fg", _v$1, _p$.a));
|
|
2893
|
+
_v$10 !== _p$.o && (_p$.o = setProp(_el$51, "fg", _v$10, _p$.o));
|
|
2621
2894
|
return _p$;
|
|
2622
2895
|
}, {
|
|
2623
2896
|
e: void 0,
|
|
2624
2897
|
t: void 0,
|
|
2625
|
-
a: void 0
|
|
2898
|
+
a: void 0,
|
|
2899
|
+
o: void 0
|
|
2626
2900
|
});
|
|
2627
2901
|
return _el$39;
|
|
2628
2902
|
}
|
|
@@ -2652,7 +2926,6 @@ function SettingsWindow(props) {
|
|
|
2652
2926
|
setProp(_el$15, "attributes", 1);
|
|
2653
2927
|
insert(_el$15, () => isPt() ? "Deseja salvar as alterações? " : "Keep your changes? ");
|
|
2654
2928
|
insertNode(_el$16, _el$17);
|
|
2655
|
-
setProp(_el$16, "backgroundColor", "#fba970");
|
|
2656
2929
|
setProp(_el$16, "onMouseDown", () => props.onSave?.());
|
|
2657
2930
|
setProp(_el$17, "fg", "#000000");
|
|
2658
2931
|
insert(_el$17, () => isPt() ? " Salvar " : " Save ");
|
|
@@ -2670,26 +2943,28 @@ function SettingsWindow(props) {
|
|
|
2670
2943
|
insert(_el$25, () => isPt() ? " Continuar editando " : " Keep editing ");
|
|
2671
2944
|
insert(_el$26, () => isPt() ? "ctrl+s salvar · d descartar alterações · esc continuar editando" : "ctrl+s save · d discard the changes · esc keep editing");
|
|
2672
2945
|
effect((_p$) => {
|
|
2673
|
-
var _v$ = props.warn ?? "#f59e0b", _v$2 = props.
|
|
2946
|
+
var _v$ = props.warn ?? "#f59e0b", _v$2 = props.warn ?? "#fba970", _v$3 = props.muted, _v$4 = props.muted, _v$5 = props.muted;
|
|
2674
2947
|
_v$ !== _p$.e && (_p$.e = setProp(_el$15, "fg", _v$, _p$.e));
|
|
2675
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$
|
|
2676
|
-
_v$3 !== _p$.a && (_p$.a = setProp(_el$
|
|
2677
|
-
_v$4 !== _p$.o && (_p$.o = setProp(_el$
|
|
2948
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$16, "backgroundColor", _v$2, _p$.t));
|
|
2949
|
+
_v$3 !== _p$.a && (_p$.a = setProp(_el$18, "fg", _v$3, _p$.a));
|
|
2950
|
+
_v$4 !== _p$.o && (_p$.o = setProp(_el$22, "fg", _v$4, _p$.o));
|
|
2951
|
+
_v$5 !== _p$.i && (_p$.i = setProp(_el$26, "fg", _v$5, _p$.i));
|
|
2678
2952
|
return _p$;
|
|
2679
2953
|
}, {
|
|
2680
2954
|
e: void 0,
|
|
2681
2955
|
t: void 0,
|
|
2682
2956
|
a: void 0,
|
|
2683
|
-
o: void 0
|
|
2957
|
+
o: void 0,
|
|
2958
|
+
i: void 0
|
|
2684
2959
|
});
|
|
2685
2960
|
return _el$13;
|
|
2686
2961
|
}
|
|
2687
2962
|
}), null);
|
|
2688
2963
|
effect((_p$) => {
|
|
2689
|
-
var _v$
|
|
2690
|
-
_v$
|
|
2691
|
-
_v$
|
|
2692
|
-
_v$
|
|
2964
|
+
var _v$6 = props.fg, _v$7 = { fg: props.muted }, _v$8 = props.muted;
|
|
2965
|
+
_v$6 !== _p$.e && (_p$.e = setProp(_el$3, "fg", _v$6, _p$.e));
|
|
2966
|
+
_v$7 !== _p$.t && (_p$.t = setProp(_el$6, "style", _v$7, _p$.t));
|
|
2967
|
+
_v$8 !== _p$.a && (_p$.a = setProp(_el$0, "fg", _v$8, _p$.a));
|
|
2693
2968
|
return _p$;
|
|
2694
2969
|
}, {
|
|
2695
2970
|
e: void 0,
|
|
@@ -2769,6 +3044,7 @@ function createWindowController(context, exit) {
|
|
|
2769
3044
|
buildGatesTab(load(), lang),
|
|
2770
3045
|
buildDecisionTab(decision(), process.env, readAuthProviders(), readConfigProviders(), lang),
|
|
2771
3046
|
buildPresetTab(presetInput(), lang),
|
|
3047
|
+
buildQuotaTab(void 0, lang, readQuotaPrefs()),
|
|
2772
3048
|
buildTuiTab(tuiPrefs(), lang),
|
|
2773
3049
|
buildAutonomyTab({
|
|
2774
3050
|
goalLoop: goalLoop(),
|
|
@@ -2776,7 +3052,7 @@ function createWindowController(context, exit) {
|
|
|
2776
3052
|
goalLoopRestartPending: autonomyRestartPending(),
|
|
2777
3053
|
languagePref: lang
|
|
2778
3054
|
}),
|
|
2779
|
-
buildJ1Tab(process.env,
|
|
3055
|
+
buildJ1Tab(process.env, isBehaviorDisabled(mergedOverrides(load()), "gate-j1-risk-gate"), lang),
|
|
2780
3056
|
buildUpdatesTab({
|
|
2781
3057
|
...updatesInput(),
|
|
2782
3058
|
languagePref: lang
|
|
@@ -3018,6 +3294,15 @@ function createWindowController(context, exit) {
|
|
|
3018
3294
|
reason: "tui prefs storage unavailable"
|
|
3019
3295
|
};
|
|
3020
3296
|
}
|
|
3297
|
+
if (id.startsWith("quota.")) try {
|
|
3298
|
+
writeQuotaPrefs(applyQuotaRow(readQuotaPrefs(), id, value));
|
|
3299
|
+
return { ok: true };
|
|
3300
|
+
} catch {
|
|
3301
|
+
return {
|
|
3302
|
+
ok: false,
|
|
3303
|
+
reason: "quota prefs disk write failed"
|
|
3304
|
+
};
|
|
3305
|
+
}
|
|
3021
3306
|
return {
|
|
3022
3307
|
ok: false,
|
|
3023
3308
|
reason: "unknown staged row"
|
|
@@ -3172,7 +3457,8 @@ function SettingsPage(props) {
|
|
|
3172
3457
|
const context = props.context;
|
|
3173
3458
|
const controller = createWindowController(context, () => navigateBack(context, returnRoute !== void 0 ? { returnRoute } : {}));
|
|
3174
3459
|
const theme = context.theme?.text ?? {};
|
|
3175
|
-
const
|
|
3460
|
+
const accent = () => resolveAccentColor(tuiPrefs().theme?.accent, context.theme);
|
|
3461
|
+
const warn = () => accent();
|
|
3176
3462
|
try {
|
|
3177
3463
|
const popMode = context.keymap?.mode?.push?.(ROUTE_MODE);
|
|
3178
3464
|
if (popMode !== void 0) onCleanup(() => popMode());
|
|
@@ -3180,7 +3466,7 @@ function SettingsPage(props) {
|
|
|
3180
3466
|
onCleanup(controller.cleanup);
|
|
3181
3467
|
setBlocking(true);
|
|
3182
3468
|
pageApi = controller.api;
|
|
3183
|
-
|
|
3469
|
+
const window = () => createComponent(SettingsWindow, {
|
|
3184
3470
|
get version() {
|
|
3185
3471
|
return resolveRunningVersion();
|
|
3186
3472
|
},
|
|
@@ -3208,7 +3494,9 @@ function SettingsPage(props) {
|
|
|
3208
3494
|
get muted() {
|
|
3209
3495
|
return theme.muted;
|
|
3210
3496
|
},
|
|
3211
|
-
warn
|
|
3497
|
+
get warn() {
|
|
3498
|
+
return warn();
|
|
3499
|
+
},
|
|
3212
3500
|
onJumpTab: (idx) => controller.api.jumpTab(idx),
|
|
3213
3501
|
onSelectRow: (id) => controller.api.selectById?.(id),
|
|
3214
3502
|
onCycleValue: (id, dir) => controller.api.cycleRowById?.(id, dir),
|
|
@@ -3219,6 +3507,38 @@ function SettingsPage(props) {
|
|
|
3219
3507
|
onDiscard: () => controller.api.discard?.(),
|
|
3220
3508
|
onCancelExit: () => controller.api.cancelExit?.()
|
|
3221
3509
|
});
|
|
3510
|
+
const sidebar = () => props.renderSidebar ? props.renderSidebar(context) : null;
|
|
3511
|
+
return createComponent(Show, {
|
|
3512
|
+
get when() {
|
|
3513
|
+
return sidebar();
|
|
3514
|
+
},
|
|
3515
|
+
get fallback() {
|
|
3516
|
+
return window();
|
|
3517
|
+
},
|
|
3518
|
+
get children() {
|
|
3519
|
+
var _el$69 = createElement("box"), _el$70 = createElement("box"), _el$71 = createElement("box");
|
|
3520
|
+
insertNode(_el$69, _el$70);
|
|
3521
|
+
insertNode(_el$69, _el$71);
|
|
3522
|
+
setProp(_el$69, "flexDirection", "row");
|
|
3523
|
+
setProp(_el$69, "flexGrow", 1);
|
|
3524
|
+
setProp(_el$69, "flexBasis", 0);
|
|
3525
|
+
setProp(_el$69, "minHeight", 0);
|
|
3526
|
+
setProp(_el$69, "width", "100%");
|
|
3527
|
+
setProp(_el$70, "flexDirection", "column");
|
|
3528
|
+
setProp(_el$70, "flexGrow", 1);
|
|
3529
|
+
setProp(_el$70, "flexBasis", 0);
|
|
3530
|
+
setProp(_el$70, "minHeight", 0);
|
|
3531
|
+
setProp(_el$70, "minWidth", 0);
|
|
3532
|
+
insert(_el$70, window);
|
|
3533
|
+
setProp(_el$71, "width", 32);
|
|
3534
|
+
setProp(_el$71, "flexShrink", 0);
|
|
3535
|
+
setProp(_el$71, "border", true);
|
|
3536
|
+
setProp(_el$71, "borderStyle", "single");
|
|
3537
|
+
insert(_el$71, sidebar);
|
|
3538
|
+
effect((_$p) => setProp(_el$71, "borderColor", theme.muted ?? "#333333", _$p));
|
|
3539
|
+
return _el$69;
|
|
3540
|
+
}
|
|
3541
|
+
});
|
|
3222
3542
|
}
|
|
3223
3543
|
function navigateBack(context, data) {
|
|
3224
3544
|
try {
|
|
@@ -3230,7 +3550,8 @@ let dialogDismiss = () => {};
|
|
|
3230
3550
|
function openSettingsDialog(context) {
|
|
3231
3551
|
const controller = createWindowController(context, () => dialogDismiss());
|
|
3232
3552
|
const theme = context.theme?.text ?? {};
|
|
3233
|
-
const
|
|
3553
|
+
const accent = () => resolveAccentColor(tuiPrefs().theme?.accent, context.theme);
|
|
3554
|
+
const warn = () => accent();
|
|
3234
3555
|
controller.cleanup = () => {
|
|
3235
3556
|
pageApi = void 0;
|
|
3236
3557
|
setBlocking(false);
|
|
@@ -3279,7 +3600,9 @@ function openSettingsDialog(context) {
|
|
|
3279
3600
|
get muted() {
|
|
3280
3601
|
return theme.muted;
|
|
3281
3602
|
},
|
|
3282
|
-
warn
|
|
3603
|
+
get warn() {
|
|
3604
|
+
return warn();
|
|
3605
|
+
},
|
|
3283
3606
|
isDialog: true,
|
|
3284
3607
|
get maxHeight() {
|
|
3285
3608
|
return maxHeight();
|
|
@@ -3294,7 +3617,10 @@ function openSettingsDialog(context) {
|
|
|
3294
3617
|
onDiscard: () => controller.api.discard?.(),
|
|
3295
3618
|
onCancelExit: () => controller.api.cancelExit?.()
|
|
3296
3619
|
}), close);
|
|
3297
|
-
context.ui.dialog.set({
|
|
3620
|
+
context.ui.dialog.set({
|
|
3621
|
+
size: "medium",
|
|
3622
|
+
centered: true
|
|
3623
|
+
});
|
|
3298
3624
|
} catch {}
|
|
3299
3625
|
}
|
|
3300
3626
|
const [settingsOpen, setSettingsOpen] = createSignal(false);
|
|
@@ -3387,7 +3713,8 @@ function InSessionSettingsWindow(props) {
|
|
|
3387
3713
|
onCleanup(controller.cleanup);
|
|
3388
3714
|
pageApi = controller.api;
|
|
3389
3715
|
const theme = context.theme?.text ?? {};
|
|
3390
|
-
const
|
|
3716
|
+
const accent = () => resolveAccentColor(tuiPrefs().theme?.accent, context.theme);
|
|
3717
|
+
const warn = () => accent();
|
|
3391
3718
|
return createComponent(SettingsWindow, {
|
|
3392
3719
|
boxRef: (el) => {
|
|
3393
3720
|
windowBox = el;
|
|
@@ -3426,7 +3753,9 @@ function InSessionSettingsWindow(props) {
|
|
|
3426
3753
|
get muted() {
|
|
3427
3754
|
return theme.muted;
|
|
3428
3755
|
},
|
|
3429
|
-
warn
|
|
3756
|
+
get warn() {
|
|
3757
|
+
return warn();
|
|
3758
|
+
},
|
|
3430
3759
|
hasKeyboard,
|
|
3431
3760
|
onJumpTab: (idx) => controller.api.jumpTab(idx),
|
|
3432
3761
|
onSelectRow: (id) => controller.api.selectById?.(id),
|
|
@@ -3444,14 +3773,16 @@ function InSessionSettingsWindow(props) {
|
|
|
3444
3773
|
}
|
|
3445
3774
|
});
|
|
3446
3775
|
}
|
|
3447
|
-
|
|
3776
|
+
let registeredSidebarRenderer;
|
|
3777
|
+
function setupPantheonSettings(context, options) {
|
|
3778
|
+
registeredSidebarRenderer = options?.renderSidebar;
|
|
3448
3779
|
try {
|
|
3449
3780
|
context.ui.router?.register?.({
|
|
3450
3781
|
name: ROUTE_NAME,
|
|
3451
|
-
render: ({ data }) => createComponent(SettingsPage, {
|
|
3782
|
+
render: ({ data }) => createComponent(SettingsPage, mergeProps({
|
|
3452
3783
|
context,
|
|
3453
3784
|
data
|
|
3454
|
-
})
|
|
3785
|
+
}, registeredSidebarRenderer ? { renderSidebar: registeredSidebarRenderer } : {}))
|
|
3455
3786
|
});
|
|
3456
3787
|
routerAvailable = true;
|
|
3457
3788
|
} catch {
|
|
@@ -4761,6 +5092,187 @@ function contextBlockRows(usage, cost, gaugeStyle = "both", barOptions) {
|
|
|
4761
5092
|
spent
|
|
4762
5093
|
};
|
|
4763
5094
|
}
|
|
5095
|
+
/** Custo do último turno do assistente e do turno anterior. Pure. */
|
|
5096
|
+
function latestTurnCost(messages) {
|
|
5097
|
+
if (!Array.isArray(messages) || messages.length === 0) return null;
|
|
5098
|
+
let current = null;
|
|
5099
|
+
let previous = null;
|
|
5100
|
+
let anchor = -1;
|
|
5101
|
+
for (let index = messages.length - 1; index >= 0; index--) {
|
|
5102
|
+
const message = messages[index];
|
|
5103
|
+
if (message?.type !== "assistant") continue;
|
|
5104
|
+
const cost = numberOrNull(message.cost);
|
|
5105
|
+
if (cost !== null && cost >= 0) {
|
|
5106
|
+
current = cost;
|
|
5107
|
+
anchor = index;
|
|
5108
|
+
break;
|
|
5109
|
+
}
|
|
5110
|
+
}
|
|
5111
|
+
if (current === null || anchor === -1) return null;
|
|
5112
|
+
for (let index = anchor - 1; index >= 0; index--) {
|
|
5113
|
+
const message = messages[index];
|
|
5114
|
+
if (message?.type !== "assistant") continue;
|
|
5115
|
+
const cost = numberOrNull(message.cost);
|
|
5116
|
+
if (cost !== null && cost >= 0) {
|
|
5117
|
+
previous = cost;
|
|
5118
|
+
break;
|
|
5119
|
+
}
|
|
5120
|
+
}
|
|
5121
|
+
return {
|
|
5122
|
+
current,
|
|
5123
|
+
previous
|
|
5124
|
+
};
|
|
5125
|
+
}
|
|
5126
|
+
function formatTurnCostUSD(cost) {
|
|
5127
|
+
const value = numberOrNull(cost);
|
|
5128
|
+
if (value === null || value < 0) return null;
|
|
5129
|
+
if (value === 0) return "$0.00";
|
|
5130
|
+
if (value >= 1) return `$${value.toFixed(2)}`;
|
|
5131
|
+
if (value >= .1) return `$${value.toFixed(2)}`;
|
|
5132
|
+
const val3 = value.toFixed(3);
|
|
5133
|
+
if (val3.endsWith("0") && value >= .01) return `$${value.toFixed(2)}`;
|
|
5134
|
+
return `$${val3}`;
|
|
5135
|
+
}
|
|
5136
|
+
function formatTurnCostLine(summary) {
|
|
5137
|
+
if (!summary || summary.current === null || summary.current < 0) return null;
|
|
5138
|
+
const curr = formatTurnCostUSD(summary.current);
|
|
5139
|
+
if (!curr) return null;
|
|
5140
|
+
if (summary.previous !== null && summary.previous >= 0) {
|
|
5141
|
+
const prev = formatTurnCostUSD(summary.previous);
|
|
5142
|
+
if (prev) return `Turn: ${curr} (prev: ${prev})`;
|
|
5143
|
+
}
|
|
5144
|
+
return `Turn: ${curr}`;
|
|
5145
|
+
}
|
|
5146
|
+
/** Extrai desdobramento de tokens (input, output, reasoning/thinking). Pure. */
|
|
5147
|
+
function extractTokenAnatomy(tokens) {
|
|
5148
|
+
if (!tokens || typeof tokens !== "object") return null;
|
|
5149
|
+
const input = Math.max(0, numberOrNull(tokens.input) ?? 0);
|
|
5150
|
+
const output = Math.max(0, numberOrNull(tokens.output) ?? 0);
|
|
5151
|
+
const reasoning = Math.max(0, numberOrNull(tokens.reasoning) ?? numberOrNull(tokens.thinking) ?? 0);
|
|
5152
|
+
if (input === 0 && output === 0 && reasoning === 0) return null;
|
|
5153
|
+
return {
|
|
5154
|
+
input,
|
|
5155
|
+
output,
|
|
5156
|
+
reasoning
|
|
5157
|
+
};
|
|
5158
|
+
}
|
|
5159
|
+
function formatTokenAnatomyLine(anatomy) {
|
|
5160
|
+
if (!anatomy) return null;
|
|
5161
|
+
const parts = [];
|
|
5162
|
+
if (anatomy.input > 0) parts.push(`↑${formatContextWindow(anatomy.input)}`);
|
|
5163
|
+
if (anatomy.output > 0) parts.push(`↓${formatContextWindow(anatomy.output)}`);
|
|
5164
|
+
if (anatomy.reasoning > 0) parts.push(`✦${formatContextWindow(anatomy.reasoning)} think`);
|
|
5165
|
+
return parts.length === 0 ? null : parts.join(" ");
|
|
5166
|
+
}
|
|
5167
|
+
function formatTokenAnatomySplit(anatomy) {
|
|
5168
|
+
if (!anatomy) return null;
|
|
5169
|
+
const inOutParts = [];
|
|
5170
|
+
if (anatomy.input > 0) inOutParts.push(`↑${formatContextWindow(anatomy.input)}`);
|
|
5171
|
+
if (anatomy.output > 0) inOutParts.push(`↓${formatContextWindow(anatomy.output)}`);
|
|
5172
|
+
const inOut = inOutParts.length > 0 ? inOutParts.join(" · ") : null;
|
|
5173
|
+
const think = anatomy.reasoning > 0 ? `✦ ${formatContextWindow(anatomy.reasoning)} think` : null;
|
|
5174
|
+
if (!inOut && !think) return null;
|
|
5175
|
+
return {
|
|
5176
|
+
inOut,
|
|
5177
|
+
think
|
|
5178
|
+
};
|
|
5179
|
+
}
|
|
5180
|
+
/** Conta chamadas de ferramentas e eventuais falhas/erros. Pure. */
|
|
5181
|
+
function countToolCalls(messages) {
|
|
5182
|
+
if (!Array.isArray(messages)) return {
|
|
5183
|
+
total: 0,
|
|
5184
|
+
failures: 0
|
|
5185
|
+
};
|
|
5186
|
+
let total = 0;
|
|
5187
|
+
let failures = 0;
|
|
5188
|
+
for (const message of messages) {
|
|
5189
|
+
if (message?.type !== "assistant" || !Array.isArray(message.content)) continue;
|
|
5190
|
+
for (const part of message.content) {
|
|
5191
|
+
if (part?.type !== "tool") continue;
|
|
5192
|
+
total++;
|
|
5193
|
+
const state = part.state;
|
|
5194
|
+
if (state?.status === "error" || state?.status === "failed" || state?.error !== void 0 || typeof state?.exitCode === "number" && state.exitCode !== 0) failures++;
|
|
5195
|
+
}
|
|
5196
|
+
}
|
|
5197
|
+
return {
|
|
5198
|
+
total,
|
|
5199
|
+
failures
|
|
5200
|
+
};
|
|
5201
|
+
}
|
|
5202
|
+
function formatToolCallLine(summary, locale = "en") {
|
|
5203
|
+
if (!summary || summary.total === 0) return null;
|
|
5204
|
+
const isPt = locale === "pt-BR" || locale === "pt";
|
|
5205
|
+
if (summary.failures > 0) {
|
|
5206
|
+
const errText = isPt ? summary.failures === 1 ? "1 falha" : `${summary.failures} falhas` : `${summary.failures} err`;
|
|
5207
|
+
return `tools: ${summary.total} (${errText})`;
|
|
5208
|
+
}
|
|
5209
|
+
const zeroText = isPt ? "0 falhas" : "0 err";
|
|
5210
|
+
return `tools: ${summary.total} (${zeroText})`;
|
|
5211
|
+
}
|
|
5212
|
+
/** Extrai contagem de compactações e estimativa de tokens podados. Pure. */
|
|
5213
|
+
function extractCompactionInfo(messages) {
|
|
5214
|
+
if (!Array.isArray(messages) || messages.length === 0) return {
|
|
5215
|
+
count: 0,
|
|
5216
|
+
prunedTokens: 0
|
|
5217
|
+
};
|
|
5218
|
+
let count = 0;
|
|
5219
|
+
let prunedTokens = 0;
|
|
5220
|
+
for (let i = 0; i < messages.length; i++) {
|
|
5221
|
+
const msg = messages[i];
|
|
5222
|
+
if (msg?.type === "compaction") {
|
|
5223
|
+
count++;
|
|
5224
|
+
const directPruned = numberOrNull(msg?.pruned) ?? numberOrNull(msg?.tokens?.pruned) ?? numberOrNull(msg?.data?.pruned);
|
|
5225
|
+
if (directPruned !== null && directPruned > 0) prunedTokens += directPruned;
|
|
5226
|
+
else {
|
|
5227
|
+
let beforeSum = 0;
|
|
5228
|
+
for (let j = 0; j < i; j++) {
|
|
5229
|
+
const prev = messages[j];
|
|
5230
|
+
if (prev?.type === "assistant" && prev?.tokens) beforeSum += messageTokensTotal(prev.tokens);
|
|
5231
|
+
}
|
|
5232
|
+
if (beforeSum > 0) prunedTokens = Math.max(prunedTokens, beforeSum);
|
|
5233
|
+
}
|
|
5234
|
+
}
|
|
5235
|
+
}
|
|
5236
|
+
return {
|
|
5237
|
+
count,
|
|
5238
|
+
prunedTokens
|
|
5239
|
+
};
|
|
5240
|
+
}
|
|
5241
|
+
/** Conta quantas vezes a sessão sofreu compactação nativa. Pure. */
|
|
5242
|
+
function countSessionCompactions(messages) {
|
|
5243
|
+
if (!Array.isArray(messages)) return 0;
|
|
5244
|
+
let count = 0;
|
|
5245
|
+
for (const message of messages) if (message?.type === "compaction") count++;
|
|
5246
|
+
return count;
|
|
5247
|
+
}
|
|
5248
|
+
function formatCompactionBadge(info) {
|
|
5249
|
+
if (typeof info === "number") {
|
|
5250
|
+
if (info <= 0) return null;
|
|
5251
|
+
return `${info}x compact`;
|
|
5252
|
+
}
|
|
5253
|
+
if (!info || info.count <= 0) return null;
|
|
5254
|
+
if (info.prunedTokens > 0) return `${info.count}x compact (-${formatContextWindow(info.prunedTokens)})`;
|
|
5255
|
+
return `${info.count}x compact`;
|
|
5256
|
+
}
|
|
5257
|
+
/** Conta mensagens do usuário para mensurar turnos da sessão. Pure. */
|
|
5258
|
+
function countUserTurns(messages) {
|
|
5259
|
+
if (!Array.isArray(messages)) return 0;
|
|
5260
|
+
let count = 0;
|
|
5261
|
+
for (const message of messages) if (message?.type === "user") count++;
|
|
5262
|
+
return count;
|
|
5263
|
+
}
|
|
5264
|
+
function formatTurnsBadge(count, locale = "en") {
|
|
5265
|
+
if (count <= 0) return null;
|
|
5266
|
+
if (locale === "pt-BR" || locale === "pt") return count === 1 ? "↻ 1 turno" : `↻ ${count} turnos`;
|
|
5267
|
+
return `↻ ${count} turn${count === 1 ? "" : "s"}`;
|
|
5268
|
+
}
|
|
5269
|
+
function resolveGateStatus(env = process.env) {
|
|
5270
|
+
const mode = (env.PANTHEON_J1_RISK_SCORE ?? "").trim().toLowerCase();
|
|
5271
|
+
if (mode === "enforce") return "✓ Gate: enforce";
|
|
5272
|
+
if (mode === "warn") return "✓ Gate: warn";
|
|
5273
|
+
if (mode === "shadow" || mode === "1" || mode === "true" || mode === "on") return "✓ Gate: active";
|
|
5274
|
+
return "✓ Gate: shadow";
|
|
5275
|
+
}
|
|
4764
5276
|
/** Column widths for one model row (labels are muted, numbers right-aligned). */
|
|
4765
5277
|
const MODEL_USAGE_MODEL_WIDTH = 12;
|
|
4766
5278
|
const MODEL_USAGE_TOKEN_WIDTH = 6;
|
|
@@ -4938,7 +5450,13 @@ function isTodoStatus(value) {
|
|
|
4938
5450
|
* absent `todos`, an unknown `status` or an empty/missing `content` drops the
|
|
4939
5451
|
* entry instead of throwing; a list with nothing readable yields `[]`. Pure. */
|
|
4940
5452
|
function parseTodoItems(input) {
|
|
4941
|
-
|
|
5453
|
+
let parsed = input;
|
|
5454
|
+
if (typeof input === "string") try {
|
|
5455
|
+
parsed = JSON.parse(input);
|
|
5456
|
+
} catch {
|
|
5457
|
+
return [];
|
|
5458
|
+
}
|
|
5459
|
+
const raw = parsed?.todos;
|
|
4942
5460
|
if (!Array.isArray(raw)) return [];
|
|
4943
5461
|
const items = [];
|
|
4944
5462
|
for (const entry of raw) {
|
|
@@ -6512,7 +7030,7 @@ async function checkForPantheonUpdate(context) {
|
|
|
6512
7030
|
const latest = String((await response.json())?.version ?? "");
|
|
6513
7031
|
if (!latest) return;
|
|
6514
7032
|
const notice = pickUpdateNotice({
|
|
6515
|
-
currentVersion: "2.
|
|
7033
|
+
currentVersion: "2.2.0-beta.2",
|
|
6516
7034
|
latestVersion: latest,
|
|
6517
7035
|
state: readState(),
|
|
6518
7036
|
nowMs: Date.now()
|
|
@@ -7051,10 +7569,47 @@ function createSidebarModel(context, sessionID, gitExec = defaultGitExec) {
|
|
|
7051
7569
|
frame();
|
|
7052
7570
|
return buildDispatchBlock(allDelegations(), Date.now(), frame());
|
|
7053
7571
|
});
|
|
7572
|
+
const turnCost = createMemo(() => latestTurnCost(messages()));
|
|
7573
|
+
const turnCostLine = createMemo(() => formatTurnCostLine(turnCost()));
|
|
7574
|
+
const tokenAnatomy = createMemo(() => {
|
|
7575
|
+
const message = lastAssistantWithTokens(messages(), session()?.revert?.messageID);
|
|
7576
|
+
return message === null ? null : extractTokenAnatomy(message.tokens);
|
|
7577
|
+
});
|
|
7578
|
+
const tokenAnatomyLine = createMemo(() => formatTokenAnatomyLine(tokenAnatomy()));
|
|
7579
|
+
const tokenAnatomySplit = createMemo(() => formatTokenAnatomySplit(tokenAnatomy()));
|
|
7580
|
+
const toolCalls = createMemo(() => countToolCalls(messages()));
|
|
7581
|
+
const toolCallsLine = createMemo(() => formatToolCallLine(toolCalls(), tuiPrefs().layout.language));
|
|
7582
|
+
const compactions = createMemo(() => extractCompactionInfo(messages()));
|
|
7583
|
+
const compactionBadge = createMemo(() => {
|
|
7584
|
+
const badge = formatCompactionBadge(compactions());
|
|
7585
|
+
if (badge) return badge;
|
|
7586
|
+
return "compact";
|
|
7587
|
+
});
|
|
7588
|
+
const userTurns = createMemo(() => countUserTurns(messages()));
|
|
7589
|
+
const turnsBadge = createMemo(() => formatTurnsBadge(userTurns(), tuiPrefs().layout.language));
|
|
7590
|
+
const performanceSplit = createMemo(() => {
|
|
7591
|
+
const perf = performance();
|
|
7592
|
+
if (!perf) return null;
|
|
7593
|
+
let cacheText = null;
|
|
7594
|
+
if (perf.cacheHit !== null) cacheText = `Cache: ${Math.round(perf.cacheHit)}%`;
|
|
7595
|
+
const speedText = perf.tokensPerSecond !== null ? `Speed: ${perf.tokensPerSecond.toFixed(0)} t/s` : null;
|
|
7596
|
+
if (!cacheText && !speedText) return null;
|
|
7597
|
+
return {
|
|
7598
|
+
cache: cacheText,
|
|
7599
|
+
speed: speedText
|
|
7600
|
+
};
|
|
7601
|
+
});
|
|
7602
|
+
const contextRatioLine = createMemo(() => {
|
|
7603
|
+
const usage = contextUsage();
|
|
7604
|
+
if (!usage) return null;
|
|
7605
|
+
return `${formatTokenCount(usage.tokens)} / ${formatContextWindow(usage.limit)}`;
|
|
7606
|
+
});
|
|
7607
|
+
const gateStatus = createMemo(() => resolveGateStatus());
|
|
7608
|
+
const isPinned = createMemo(() => isSessionPinned(activeSessionID()));
|
|
7054
7609
|
const blocks = createMemo(() => {
|
|
7055
7610
|
const prefs = tuiPrefs();
|
|
7056
7611
|
const present = [];
|
|
7057
|
-
if (prefs.sidebar.blocks.context && (contextBlockRows(contextUsage(), cost(), prefs.sidebar.context.gauge) !== null || prefs.sidebar.context.localSpend && contextSpendLine(spend()) !== null)) present.push("context");
|
|
7612
|
+
if (prefs.sidebar.blocks.context && (contextBlockRows(contextUsage(), cost(), prefs.sidebar.context.gauge) !== null || prefs.sidebar.context.localSpend && contextSpendLine(spend()) !== null || prefs.sidebar.context.turnCost && turnCostLine() !== null || prefs.sidebar.context.tokenAnatomy && tokenAnatomyLine() !== null)) present.push("context");
|
|
7058
7613
|
if (prefs.sidebar.blocks.git && (branch() !== null || gitLine() !== null)) present.push("git");
|
|
7059
7614
|
if (prefs.sidebar.blocks.dispatch && dispatch() !== null) present.push("dispatch");
|
|
7060
7615
|
return withBlockSpacers(present);
|
|
@@ -7135,7 +7690,17 @@ function createSidebarModel(context, sessionID, gitExec = defaultGitExec) {
|
|
|
7135
7690
|
todo,
|
|
7136
7691
|
spend,
|
|
7137
7692
|
contextUsage,
|
|
7138
|
-
agentModel
|
|
7693
|
+
agentModel,
|
|
7694
|
+
turnCostLine,
|
|
7695
|
+
tokenAnatomyLine,
|
|
7696
|
+
toolCallsLine,
|
|
7697
|
+
compactionBadge,
|
|
7698
|
+
turnsBadge,
|
|
7699
|
+
tokenAnatomySplit,
|
|
7700
|
+
performanceSplit,
|
|
7701
|
+
contextRatioLine,
|
|
7702
|
+
gateStatus,
|
|
7703
|
+
isPinned
|
|
7139
7704
|
};
|
|
7140
7705
|
}
|
|
7141
7706
|
/** One `Context` row: an optional toned lead segment (the gauge's filled
|
|
@@ -7239,28 +7804,40 @@ function ContextRowView(props) {
|
|
|
7239
7804
|
* stays one line. */
|
|
7240
7805
|
function BlockHeader(props) {
|
|
7241
7806
|
return (() => {
|
|
7242
|
-
var _el$0 = createElement("box"), _el$1 = createElement("
|
|
7807
|
+
var _el$0 = createElement("box"), _el$1 = createElement("box"), _el$10 = createElement("text"), _el$11 = createElement("text");
|
|
7243
7808
|
insertNode(_el$0, _el$1);
|
|
7244
|
-
insertNode(_el$0, _el$10);
|
|
7245
7809
|
setProp(_el$0, "flexDirection", "row");
|
|
7246
|
-
|
|
7247
|
-
setProp(_el$
|
|
7248
|
-
|
|
7249
|
-
|
|
7810
|
+
setProp(_el$0, "justifyContent", "space-between");
|
|
7811
|
+
setProp(_el$0, "width", "100%");
|
|
7812
|
+
insertNode(_el$1, _el$10);
|
|
7813
|
+
insertNode(_el$1, _el$11);
|
|
7814
|
+
setProp(_el$1, "flexDirection", "row");
|
|
7815
|
+
insert(_el$10, () => `${props.icon} `);
|
|
7816
|
+
setProp(_el$11, "attributes", 1);
|
|
7817
|
+
insert(_el$11, () => props.label);
|
|
7818
|
+
insert(_el$1, createComponent(Show, {
|
|
7250
7819
|
get when() {
|
|
7251
7820
|
return props.summary;
|
|
7252
7821
|
},
|
|
7253
7822
|
children: (summary) => (() => {
|
|
7254
|
-
var _el$
|
|
7255
|
-
insert(_el$
|
|
7256
|
-
effect((_$p) => setProp(_el$
|
|
7257
|
-
return _el$
|
|
7823
|
+
var _el$12 = createElement("text");
|
|
7824
|
+
insert(_el$12, () => `${SPEND_LINE_SEPARATOR}${summary()}`);
|
|
7825
|
+
effect((_$p) => setProp(_el$12, "fg", props.muted, _$p));
|
|
7826
|
+
return _el$12;
|
|
7258
7827
|
})()
|
|
7259
7828
|
}), null);
|
|
7829
|
+
insert(_el$0, createComponent(Show, {
|
|
7830
|
+
get when() {
|
|
7831
|
+
return props.right;
|
|
7832
|
+
},
|
|
7833
|
+
get children() {
|
|
7834
|
+
return props.right;
|
|
7835
|
+
}
|
|
7836
|
+
}), null);
|
|
7260
7837
|
effect((_p$) => {
|
|
7261
|
-
var _v$ = props.muted, _v$2 = props.fg;
|
|
7262
|
-
_v$ !== _p$.e && (_p$.e = setProp(_el$
|
|
7263
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$
|
|
7838
|
+
var _v$ = props.iconFg ?? props.muted, _v$2 = props.fg;
|
|
7839
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$10, "fg", _v$, _p$.e));
|
|
7840
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$11, "fg", _v$2, _p$.t));
|
|
7264
7841
|
return _p$;
|
|
7265
7842
|
}, {
|
|
7266
7843
|
e: void 0,
|
|
@@ -7270,10 +7847,41 @@ function BlockHeader(props) {
|
|
|
7270
7847
|
})();
|
|
7271
7848
|
}
|
|
7272
7849
|
function Sidebar(props) {
|
|
7850
|
+
const text = () => props.context.theme?.text?.base ?? "#ffffff";
|
|
7851
|
+
const muted = () => props.context.theme?.text?.muted ?? "#888888";
|
|
7852
|
+
return createComponent(ErrorBoundary, {
|
|
7853
|
+
fallback: (err) => (() => {
|
|
7854
|
+
var _el$13 = createElement("box"), _el$14 = createElement("text"), _el$15 = createElement("text");
|
|
7855
|
+
insertNode(_el$13, _el$14);
|
|
7856
|
+
insertNode(_el$13, _el$15);
|
|
7857
|
+
setProp(_el$13, "flexDirection", "column");
|
|
7858
|
+
setProp(_el$13, "paddingLeft", 1);
|
|
7859
|
+
setProp(_el$13, "paddingRight", 1);
|
|
7860
|
+
setProp(_el$14, "attributes", 1);
|
|
7861
|
+
insert(_el$14, `Pantheon v2.2.0-beta.2`);
|
|
7862
|
+
insert(_el$15, () => `Erro no painel: ${err?.message ?? "desconhecido"}`);
|
|
7863
|
+
effect((_p$) => {
|
|
7864
|
+
var _v$3 = text(), _v$4 = muted();
|
|
7865
|
+
_v$3 !== _p$.e && (_p$.e = setProp(_el$14, "fg", _v$3, _p$.e));
|
|
7866
|
+
_v$4 !== _p$.t && (_p$.t = setProp(_el$15, "fg", _v$4, _p$.t));
|
|
7867
|
+
return _p$;
|
|
7868
|
+
}, {
|
|
7869
|
+
e: void 0,
|
|
7870
|
+
t: void 0
|
|
7871
|
+
});
|
|
7872
|
+
return _el$13;
|
|
7873
|
+
})(),
|
|
7874
|
+
get children() {
|
|
7875
|
+
return createComponent(SidebarInner, props);
|
|
7876
|
+
}
|
|
7877
|
+
});
|
|
7878
|
+
}
|
|
7879
|
+
function SidebarInner(props) {
|
|
7273
7880
|
const { context } = props;
|
|
7274
7881
|
const model = createSidebarModel(context, () => props.sessionID);
|
|
7275
7882
|
const text = () => context.theme.text?.base;
|
|
7276
7883
|
const muted = () => context.theme.text?.muted ?? text();
|
|
7884
|
+
const accent = () => resolveAccentColor(tuiDraftPreview()?.theme?.accent ?? tuiPrefs().theme?.accent, context.theme);
|
|
7277
7885
|
const tone = (value) => context.theme?.text?.feedback?.[value]?.base ?? text();
|
|
7278
7886
|
const open = (sessionID) => () => navigateToSession(context.ui?.router, sessionID);
|
|
7279
7887
|
const block = (key) => model.blocks().find((entry) => entry.key === key);
|
|
@@ -7295,7 +7903,6 @@ function Sidebar(props) {
|
|
|
7295
7903
|
};
|
|
7296
7904
|
};
|
|
7297
7905
|
const spendLine = () => tuiPrefs().sidebar.context.localSpend ? contextSpendLine(model.spend()) : null;
|
|
7298
|
-
const performanceLine = () => tuiPrefs().sidebar.context.performance ? contextPerformanceLine(model.performance()) : null;
|
|
7299
7906
|
const usageRows = () => tuiPrefs().sidebar.context.modelUsage ? modelUsageRows(model.modelUsage().visible) : [];
|
|
7300
7907
|
const gaugeFg = (row) => contextProgressColor(row.tone ?? "warning", context.theme);
|
|
7301
7908
|
const dispatchView = () => model.dispatch();
|
|
@@ -7306,35 +7913,127 @@ function Sidebar(props) {
|
|
|
7306
7913
|
const failedSuffix = () => failedSuffixText(dispatchView()?.failures);
|
|
7307
7914
|
const header = () => tuiPrefs().sidebar.header;
|
|
7308
7915
|
return (() => {
|
|
7309
|
-
var _el$
|
|
7310
|
-
|
|
7311
|
-
setProp(_el$
|
|
7312
|
-
setProp(_el$
|
|
7313
|
-
setProp(_el$
|
|
7314
|
-
|
|
7916
|
+
var _el$16 = createElement("box"), _el$17 = createElement("box"), _el$19 = createElement("box");
|
|
7917
|
+
insertNode(_el$16, _el$17);
|
|
7918
|
+
setProp(_el$16, "flexDirection", "column");
|
|
7919
|
+
setProp(_el$16, "width", "100%");
|
|
7920
|
+
setProp(_el$16, "paddingLeft", 1);
|
|
7921
|
+
setProp(_el$16, "paddingRight", 1);
|
|
7922
|
+
insertNode(_el$17, _el$19);
|
|
7923
|
+
setProp(_el$17, "flexDirection", "row");
|
|
7924
|
+
setProp(_el$17, "justifyContent", "space-between");
|
|
7925
|
+
insert(_el$17, createComponent(Show, {
|
|
7315
7926
|
get when() {
|
|
7316
7927
|
return header().version;
|
|
7317
7928
|
},
|
|
7318
7929
|
get children() {
|
|
7319
|
-
var _el$
|
|
7320
|
-
setProp(_el$
|
|
7321
|
-
insert(_el$
|
|
7322
|
-
effect((_$p) => setProp(_el$
|
|
7323
|
-
return _el$
|
|
7930
|
+
var _el$18 = createElement("text");
|
|
7931
|
+
setProp(_el$18, "attributes", 1);
|
|
7932
|
+
insert(_el$18, `Pantheon v2.2.0-beta.2`);
|
|
7933
|
+
effect((_$p) => setProp(_el$18, "fg", text(), _$p));
|
|
7934
|
+
return _el$18;
|
|
7324
7935
|
}
|
|
7936
|
+
}), _el$19);
|
|
7937
|
+
setProp(_el$19, "flexDirection", "row");
|
|
7938
|
+
insert(_el$19, createComponent(Show, {
|
|
7939
|
+
get when() {
|
|
7940
|
+
return model.turnsBadge();
|
|
7941
|
+
},
|
|
7942
|
+
children: (turns) => (() => {
|
|
7943
|
+
var _el$38 = createElement("text");
|
|
7944
|
+
insert(_el$38, turns);
|
|
7945
|
+
effect((_$p) => setProp(_el$38, "fg", muted(), _$p));
|
|
7946
|
+
return _el$38;
|
|
7947
|
+
})()
|
|
7325
7948
|
}), null);
|
|
7326
|
-
insert(_el$
|
|
7949
|
+
insert(_el$19, createComponent(Show, {
|
|
7327
7950
|
get when() {
|
|
7328
|
-
return
|
|
7951
|
+
return model.isPinned();
|
|
7329
7952
|
},
|
|
7330
7953
|
get children() {
|
|
7331
|
-
var _el$
|
|
7332
|
-
|
|
7333
|
-
effect((_$p) => setProp(_el$
|
|
7334
|
-
return _el$
|
|
7954
|
+
var _el$20 = createElement("text");
|
|
7955
|
+
insertNode(_el$20, createTextNode(` 📌 fixada`));
|
|
7956
|
+
effect((_$p) => setProp(_el$20, "fg", accent(), _$p));
|
|
7957
|
+
return _el$20;
|
|
7958
|
+
}
|
|
7959
|
+
}), null);
|
|
7960
|
+
insert(_el$16, createComponent(Show, {
|
|
7961
|
+
get when() {
|
|
7962
|
+
return header().preset;
|
|
7963
|
+
},
|
|
7964
|
+
children: () => {
|
|
7965
|
+
const badge = () => model.compactionBadge() ? `[${model.compactionBadge()}]` : null;
|
|
7966
|
+
const leftPreset = () => {
|
|
7967
|
+
const b = badge();
|
|
7968
|
+
const maxCols = b ? Math.max(10, 31 - cellWidth(b) - 1) : HEADER_MAX_WIDTH;
|
|
7969
|
+
return truncateLabel(presetHeaderLine(model.preset().name ?? "", model.provider()), maxCols);
|
|
7970
|
+
};
|
|
7971
|
+
let compactInFlight = false;
|
|
7972
|
+
const triggerCompaction = () => {
|
|
7973
|
+
if (compactInFlight) return;
|
|
7974
|
+
compactInFlight = true;
|
|
7975
|
+
try {
|
|
7976
|
+
context.ui?.toast?.show?.({
|
|
7977
|
+
title: "Pantheon",
|
|
7978
|
+
message: "Iniciando compactação de contexto...",
|
|
7979
|
+
variant: "info"
|
|
7980
|
+
});
|
|
7981
|
+
const id = model.activeSessionID();
|
|
7982
|
+
if (id) {
|
|
7983
|
+
const compactCall = context.client?.session?.compact;
|
|
7984
|
+
const commandCall = context.client?.session?.command;
|
|
7985
|
+
const p = typeof compactCall === "function" ? compactCall.call(context.client.session, { sessionID: id }) : typeof commandCall === "function" ? commandCall.call(context.client.session, {
|
|
7986
|
+
sessionID: id,
|
|
7987
|
+
name: "compact",
|
|
7988
|
+
text: ""
|
|
7989
|
+
}) : Promise.reject(/* @__PURE__ */ new Error("compact indisponível"));
|
|
7990
|
+
Promise.resolve(p).then(() => {
|
|
7991
|
+
context.ui?.toast?.show?.({
|
|
7992
|
+
title: "Pantheon",
|
|
7993
|
+
message: "Contexto compactado com sucesso!",
|
|
7994
|
+
variant: "success"
|
|
7995
|
+
});
|
|
7996
|
+
}).catch((err) => {
|
|
7997
|
+
context.ui?.toast?.show?.({
|
|
7998
|
+
title: "Pantheon",
|
|
7999
|
+
message: `Erro na compactação: ${err?.message ?? "falhou"}`,
|
|
8000
|
+
variant: "error"
|
|
8001
|
+
});
|
|
8002
|
+
}).finally(() => {
|
|
8003
|
+
compactInFlight = false;
|
|
8004
|
+
});
|
|
8005
|
+
} else compactInFlight = false;
|
|
8006
|
+
} catch {
|
|
8007
|
+
compactInFlight = false;
|
|
8008
|
+
}
|
|
8009
|
+
};
|
|
8010
|
+
return (() => {
|
|
8011
|
+
var _el$39 = createElement("box"), _el$40 = createElement("text");
|
|
8012
|
+
insertNode(_el$39, _el$40);
|
|
8013
|
+
setProp(_el$39, "flexDirection", "row");
|
|
8014
|
+
setProp(_el$39, "justifyContent", "space-between");
|
|
8015
|
+
insert(_el$40, leftPreset);
|
|
8016
|
+
insert(_el$39, createComponent(Show, {
|
|
8017
|
+
get when() {
|
|
8018
|
+
return badge();
|
|
8019
|
+
},
|
|
8020
|
+
children: (b) => (() => {
|
|
8021
|
+
var _el$41 = createElement("box"), _el$42 = createElement("text");
|
|
8022
|
+
insertNode(_el$41, _el$42);
|
|
8023
|
+
setProp(_el$41, "onMouseDown", triggerCompaction);
|
|
8024
|
+
setProp(_el$41, "flexShrink", 0);
|
|
8025
|
+
setProp(_el$42, "attributes", 1);
|
|
8026
|
+
insert(_el$42, b);
|
|
8027
|
+
effect((_$p) => setProp(_el$42, "fg", accent(), _$p));
|
|
8028
|
+
return _el$41;
|
|
8029
|
+
})()
|
|
8030
|
+
}), null);
|
|
8031
|
+
effect((_$p) => setProp(_el$40, "fg", muted(), _$p));
|
|
8032
|
+
return _el$39;
|
|
8033
|
+
})();
|
|
7335
8034
|
}
|
|
7336
8035
|
}), null);
|
|
7337
|
-
insert(_el$
|
|
8036
|
+
insert(_el$16, createComponent(Show, {
|
|
7338
8037
|
get when() {
|
|
7339
8038
|
return memo(() => !!(header().session && model.activeSessionID() !== ""))() && model.session();
|
|
7340
8039
|
},
|
|
@@ -7345,105 +8044,182 @@ function Sidebar(props) {
|
|
|
7345
8044
|
},
|
|
7346
8045
|
get fallback() {
|
|
7347
8046
|
return (() => {
|
|
7348
|
-
var _el$
|
|
7349
|
-
setProp(_el$
|
|
7350
|
-
return _el$
|
|
8047
|
+
var _el$44 = createElement("box");
|
|
8048
|
+
setProp(_el$44, "height", 0);
|
|
8049
|
+
return _el$44;
|
|
7351
8050
|
})();
|
|
7352
8051
|
},
|
|
7353
8052
|
get children() {
|
|
7354
|
-
var _el$
|
|
7355
|
-
insert(_el$
|
|
7356
|
-
effect((_$p) => setProp(_el$
|
|
7357
|
-
return _el$
|
|
8053
|
+
var _el$43 = createElement("text");
|
|
8054
|
+
insert(_el$43, () => sidebarPlaceholder(props.sessionID));
|
|
8055
|
+
effect((_$p) => setProp(_el$43, "fg", muted(), _$p));
|
|
8056
|
+
return _el$43;
|
|
7358
8057
|
}
|
|
7359
8058
|
});
|
|
7360
8059
|
},
|
|
7361
8060
|
children: (current) => (() => {
|
|
7362
|
-
var _el$
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
8061
|
+
var _el$45 = createElement("box"), _el$46 = createElement("text"), _el$48 = createElement("text"), _el$50 = createElement("text");
|
|
8062
|
+
insertNode(_el$45, _el$46);
|
|
8063
|
+
insertNode(_el$45, _el$48);
|
|
8064
|
+
insertNode(_el$45, _el$50);
|
|
8065
|
+
setProp(_el$45, "flexDirection", "row");
|
|
8066
|
+
insertNode(_el$46, createTextNode(`● `));
|
|
8067
|
+
setProp(_el$46, "fg", "#22c55e");
|
|
8068
|
+
insertNode(_el$48, createTextNode(`Session: `));
|
|
8069
|
+
setProp(_el$50, "attributes", 1);
|
|
8070
|
+
insert(_el$50, () => truncateLabel(current().title || current().id, 18));
|
|
8071
|
+
effect((_p$) => {
|
|
8072
|
+
var _v$7 = muted(), _v$8 = text();
|
|
8073
|
+
_v$7 !== _p$.e && (_p$.e = setProp(_el$48, "fg", _v$7, _p$.e));
|
|
8074
|
+
_v$8 !== _p$.t && (_p$.t = setProp(_el$50, "fg", _v$8, _p$.t));
|
|
8075
|
+
return _p$;
|
|
8076
|
+
}, {
|
|
8077
|
+
e: void 0,
|
|
8078
|
+
t: void 0
|
|
8079
|
+
});
|
|
8080
|
+
return _el$45;
|
|
7366
8081
|
})()
|
|
7367
8082
|
}), null);
|
|
7368
|
-
insert(_el$
|
|
8083
|
+
insert(_el$16, createComponent(Show, {
|
|
7369
8084
|
get when() {
|
|
7370
8085
|
return model.blocks().length > 0;
|
|
7371
8086
|
},
|
|
7372
8087
|
get children() {
|
|
7373
|
-
var _el$
|
|
7374
|
-
setProp(_el$
|
|
7375
|
-
return _el$
|
|
8088
|
+
var _el$22 = createElement("box");
|
|
8089
|
+
setProp(_el$22, "height", 1);
|
|
8090
|
+
return _el$22;
|
|
7376
8091
|
}
|
|
7377
8092
|
}), null);
|
|
7378
|
-
insert(_el$
|
|
8093
|
+
insert(_el$16, createComponent(Show, {
|
|
7379
8094
|
get when() {
|
|
7380
8095
|
return block("context");
|
|
7381
8096
|
},
|
|
7382
8097
|
get children() {
|
|
7383
|
-
var _el$
|
|
7384
|
-
|
|
7385
|
-
|
|
8098
|
+
var _el$23 = createElement("box"), _el$25 = createElement("text"), _el$27 = createElement("box"), _el$28 = createElement("text");
|
|
8099
|
+
insertNode(_el$23, _el$25);
|
|
8100
|
+
insertNode(_el$23, _el$27);
|
|
8101
|
+
setProp(_el$23, "flexDirection", "column");
|
|
8102
|
+
insert(_el$23, createComponent(Show, {
|
|
7386
8103
|
get when() {
|
|
7387
8104
|
return spacer("context");
|
|
7388
8105
|
},
|
|
7389
8106
|
get children() {
|
|
7390
|
-
var _el$
|
|
7391
|
-
setProp(_el$
|
|
7392
|
-
return _el$
|
|
8107
|
+
var _el$24 = createElement("box");
|
|
8108
|
+
setProp(_el$24, "height", 1);
|
|
8109
|
+
return _el$24;
|
|
7393
8110
|
}
|
|
7394
|
-
}),
|
|
7395
|
-
insert(_el$
|
|
8111
|
+
}), _el$25);
|
|
8112
|
+
insert(_el$23, createComponent(BlockHeader, {
|
|
7396
8113
|
get icon() {
|
|
7397
8114
|
return BLOCK_ICONS.context;
|
|
7398
8115
|
},
|
|
8116
|
+
iconFg: "#38bdf8",
|
|
7399
8117
|
label: "Context",
|
|
7400
8118
|
get fg() {
|
|
7401
8119
|
return text();
|
|
7402
8120
|
},
|
|
7403
8121
|
get muted() {
|
|
7404
8122
|
return muted();
|
|
8123
|
+
},
|
|
8124
|
+
get right() {
|
|
8125
|
+
return createComponent(Show, {
|
|
8126
|
+
get when() {
|
|
8127
|
+
return memo(() => !!tuiPrefs().sidebar.context.turnCost)() && model.turnCostLine();
|
|
8128
|
+
},
|
|
8129
|
+
children: (line) => {
|
|
8130
|
+
const display = () => {
|
|
8131
|
+
const l = line();
|
|
8132
|
+
if (cellWidth(l) + 11 > 31) {
|
|
8133
|
+
const cost = model.turnCost();
|
|
8134
|
+
return cost ? `Turn: ${formatTurnCostUSD(cost.current)}` : l;
|
|
8135
|
+
}
|
|
8136
|
+
return l;
|
|
8137
|
+
};
|
|
8138
|
+
return (() => {
|
|
8139
|
+
var _el$51 = createElement("box"), _el$52 = createElement("text"), _el$54 = createElement("text");
|
|
8140
|
+
insertNode(_el$51, _el$52);
|
|
8141
|
+
insertNode(_el$51, _el$54);
|
|
8142
|
+
setProp(_el$51, "flexDirection", "row");
|
|
8143
|
+
insertNode(_el$52, createTextNode(`Turn: `));
|
|
8144
|
+
setProp(_el$54, "fg", "#34d399");
|
|
8145
|
+
setProp(_el$54, "attributes", 1);
|
|
8146
|
+
insert(_el$54, () => display().replace(/^Turn:\s*/, ""));
|
|
8147
|
+
effect((_$p) => setProp(_el$52, "fg", muted(), _$p));
|
|
8148
|
+
return _el$51;
|
|
8149
|
+
})();
|
|
8150
|
+
}
|
|
8151
|
+
});
|
|
7405
8152
|
}
|
|
7406
|
-
}),
|
|
7407
|
-
insert(_el$
|
|
8153
|
+
}), _el$25);
|
|
8154
|
+
insert(_el$23, createComponent(Show, {
|
|
7408
8155
|
get when() {
|
|
7409
8156
|
return contextRows();
|
|
7410
8157
|
},
|
|
7411
8158
|
children: (rows) => (() => {
|
|
7412
|
-
var _el$
|
|
7413
|
-
setProp(_el$
|
|
7414
|
-
insert(_el$
|
|
8159
|
+
var _el$55 = createElement("box");
|
|
8160
|
+
setProp(_el$55, "flexDirection", "column");
|
|
8161
|
+
insert(_el$55, createComponent(Show, {
|
|
7415
8162
|
get when() {
|
|
7416
|
-
return rows().
|
|
8163
|
+
return rows().percent;
|
|
7417
8164
|
},
|
|
7418
|
-
children: (row) =>
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
8165
|
+
children: (row) => (() => {
|
|
8166
|
+
var _el$56 = createElement("box");
|
|
8167
|
+
setProp(_el$56, "flexDirection", "row");
|
|
8168
|
+
setProp(_el$56, "justifyContent", "space-between");
|
|
8169
|
+
insert(_el$56, createComponent(ContextRowView, {
|
|
8170
|
+
get row() {
|
|
8171
|
+
return memo(() => !!model.contextRatioLine())() ? {
|
|
8172
|
+
...row(),
|
|
8173
|
+
suffix: null
|
|
8174
|
+
} : row();
|
|
8175
|
+
},
|
|
8176
|
+
get fg() {
|
|
8177
|
+
return gaugeFg(row());
|
|
8178
|
+
},
|
|
8179
|
+
get muted() {
|
|
8180
|
+
return muted();
|
|
8181
|
+
}
|
|
8182
|
+
}), null);
|
|
8183
|
+
insert(_el$56, createComponent(Show, {
|
|
8184
|
+
get when() {
|
|
8185
|
+
return model.contextRatioLine();
|
|
8186
|
+
},
|
|
8187
|
+
children: (ratio) => {
|
|
8188
|
+
const parts = ratio().split(" / ");
|
|
8189
|
+
return (() => {
|
|
8190
|
+
var _el$57 = createElement("box"), _el$58 = createElement("text"), _el$59 = createElement("text");
|
|
8191
|
+
insertNode(_el$57, _el$58);
|
|
8192
|
+
insertNode(_el$57, _el$59);
|
|
8193
|
+
setProp(_el$57, "flexDirection", "row");
|
|
8194
|
+
setProp(_el$58, "fg", "#f1f5f9");
|
|
8195
|
+
setProp(_el$58, "attributes", 1);
|
|
8196
|
+
insert(_el$58, () => parts[0]);
|
|
8197
|
+
insert(_el$59, () => ` / ${parts[1] ?? ""}`);
|
|
8198
|
+
effect((_$p) => setProp(_el$59, "fg", muted(), _$p));
|
|
8199
|
+
return _el$57;
|
|
8200
|
+
})();
|
|
8201
|
+
}
|
|
8202
|
+
}), null);
|
|
8203
|
+
return _el$56;
|
|
8204
|
+
})()
|
|
7429
8205
|
}), null);
|
|
7430
|
-
insert(_el$
|
|
8206
|
+
insert(_el$55, createComponent(Show, {
|
|
7431
8207
|
get when() {
|
|
7432
|
-
return rows().percent;
|
|
8208
|
+
return memo(() => !!rows().tokens)() && !rows().percent;
|
|
7433
8209
|
},
|
|
7434
8210
|
children: (row) => createComponent(ContextRowView, {
|
|
7435
8211
|
get row() {
|
|
7436
8212
|
return row();
|
|
7437
8213
|
},
|
|
7438
8214
|
get fg() {
|
|
7439
|
-
return
|
|
8215
|
+
return text();
|
|
7440
8216
|
},
|
|
7441
8217
|
get muted() {
|
|
7442
8218
|
return muted();
|
|
7443
8219
|
}
|
|
7444
8220
|
})
|
|
7445
8221
|
}), null);
|
|
7446
|
-
insert(_el$
|
|
8222
|
+
insert(_el$55, createComponent(Show, {
|
|
7447
8223
|
get when() {
|
|
7448
8224
|
return rows().spent;
|
|
7449
8225
|
},
|
|
@@ -7459,76 +8235,187 @@ function Sidebar(props) {
|
|
|
7459
8235
|
}
|
|
7460
8236
|
})
|
|
7461
8237
|
}), null);
|
|
7462
|
-
|
|
8238
|
+
return _el$55;
|
|
8239
|
+
})()
|
|
8240
|
+
}), _el$25);
|
|
8241
|
+
insert(_el$23, createComponent(Show, {
|
|
8242
|
+
get when() {
|
|
8243
|
+
return memo(() => !!tuiPrefs().sidebar.context.tokenAnatomy)() && model.tokenAnatomySplit();
|
|
8244
|
+
},
|
|
8245
|
+
children: (anatomy) => (() => {
|
|
8246
|
+
var _el$60 = createElement("box"), _el$61 = createElement("box"), _el$62 = createElement("text"), _el$64 = createElement("text");
|
|
8247
|
+
insertNode(_el$60, _el$61);
|
|
8248
|
+
setProp(_el$60, "flexDirection", "row");
|
|
8249
|
+
setProp(_el$60, "justifyContent", "space-between");
|
|
8250
|
+
insertNode(_el$61, _el$62);
|
|
8251
|
+
insertNode(_el$61, _el$64);
|
|
8252
|
+
setProp(_el$61, "flexDirection", "row");
|
|
8253
|
+
insertNode(_el$62, createTextNode(`↑`));
|
|
8254
|
+
setProp(_el$62, "fg", "#60a5fa");
|
|
8255
|
+
insert(_el$64, () => anatomy().inOut?.split(" · ")[0]?.replace(/^↑\s*/, "") ?? "");
|
|
8256
|
+
insert(_el$61, createComponent(Show, {
|
|
7463
8257
|
get when() {
|
|
7464
|
-
return
|
|
8258
|
+
return anatomy().inOut?.includes(" · ");
|
|
7465
8259
|
},
|
|
7466
8260
|
get children() {
|
|
7467
|
-
return [
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
var _el$30 = createElement("box");
|
|
7486
|
-
setProp(_el$30, "flexDirection", "column");
|
|
7487
|
-
insert(_el$30, createComponent(For, {
|
|
7488
|
-
get each() {
|
|
7489
|
-
return modelUsageRowLines(row);
|
|
7490
|
-
},
|
|
7491
|
-
children: (line) => (() => {
|
|
7492
|
-
var _el$31 = createElement("text");
|
|
7493
|
-
insert(_el$31, line);
|
|
7494
|
-
effect((_$p) => setProp(_el$31, "fg", text(), _$p));
|
|
7495
|
-
return _el$31;
|
|
8261
|
+
return [
|
|
8262
|
+
(() => {
|
|
8263
|
+
var _el$65 = createElement("text");
|
|
8264
|
+
insertNode(_el$65, createTextNode(` · `));
|
|
8265
|
+
effect((_$p) => setProp(_el$65, "fg", muted(), _$p));
|
|
8266
|
+
return _el$65;
|
|
8267
|
+
})(),
|
|
8268
|
+
(() => {
|
|
8269
|
+
var _el$67 = createElement("text");
|
|
8270
|
+
insertNode(_el$67, createTextNode(`↓`));
|
|
8271
|
+
setProp(_el$67, "fg", "#4ade80");
|
|
8272
|
+
return _el$67;
|
|
8273
|
+
})(),
|
|
8274
|
+
(() => {
|
|
8275
|
+
var _el$69 = createElement("text");
|
|
8276
|
+
insert(_el$69, () => anatomy().inOut?.split(" · ")[1]?.replace(/^↓\s*/, "") ?? "");
|
|
8277
|
+
effect((_$p) => setProp(_el$69, "fg", muted(), _$p));
|
|
8278
|
+
return _el$69;
|
|
7496
8279
|
})()
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
})()
|
|
8280
|
+
];
|
|
8281
|
+
}
|
|
7500
8282
|
}), null);
|
|
7501
|
-
insert(_el$
|
|
8283
|
+
insert(_el$60, createComponent(Show, {
|
|
7502
8284
|
get when() {
|
|
7503
|
-
return
|
|
8285
|
+
return anatomy().think;
|
|
7504
8286
|
},
|
|
7505
|
-
children: (
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
effect((_$p) => setProp(_el$32, "fg", muted(), _$p));
|
|
7513
|
-
return _el$32;
|
|
7514
|
-
})()
|
|
7515
|
-
})
|
|
8287
|
+
children: (think) => (() => {
|
|
8288
|
+
var _el$70 = createElement("text");
|
|
8289
|
+
setProp(_el$70, "fg", "#c084fc");
|
|
8290
|
+
setProp(_el$70, "attributes", 1);
|
|
8291
|
+
insert(_el$70, think);
|
|
8292
|
+
return _el$70;
|
|
8293
|
+
})()
|
|
7516
8294
|
}), null);
|
|
7517
|
-
|
|
8295
|
+
effect((_$p) => setProp(_el$64, "fg", muted(), _$p));
|
|
8296
|
+
return _el$60;
|
|
7518
8297
|
})()
|
|
7519
|
-
}),
|
|
7520
|
-
insert(_el$
|
|
8298
|
+
}), _el$25);
|
|
8299
|
+
insert(_el$23, createComponent(Show, {
|
|
7521
8300
|
get when() {
|
|
7522
|
-
return
|
|
8301
|
+
return memo(() => !!tuiPrefs().sidebar.context.performance)() && model.performanceSplit();
|
|
8302
|
+
},
|
|
8303
|
+
children: (perf) => (() => {
|
|
8304
|
+
var _el$71 = createElement("box"), _el$72 = createElement("box"), _el$73 = createElement("text"), _el$75 = createElement("text"), _el$76 = createElement("box"), _el$77 = createElement("text"), _el$79 = createElement("text");
|
|
8305
|
+
insertNode(_el$71, _el$72);
|
|
8306
|
+
insertNode(_el$71, _el$76);
|
|
8307
|
+
setProp(_el$71, "flexDirection", "row");
|
|
8308
|
+
setProp(_el$71, "justifyContent", "space-between");
|
|
8309
|
+
insertNode(_el$72, _el$73);
|
|
8310
|
+
insertNode(_el$72, _el$75);
|
|
8311
|
+
setProp(_el$72, "flexDirection", "row");
|
|
8312
|
+
insertNode(_el$73, createTextNode(`Cache: `));
|
|
8313
|
+
setProp(_el$75, "fg", "#34d399");
|
|
8314
|
+
insert(_el$75, () => perf().cache?.replace(/^Cache:\s*/, "") ?? "");
|
|
8315
|
+
insertNode(_el$76, _el$77);
|
|
8316
|
+
insertNode(_el$76, _el$79);
|
|
8317
|
+
setProp(_el$76, "flexDirection", "row");
|
|
8318
|
+
insertNode(_el$77, createTextNode(`Speed: `));
|
|
8319
|
+
setProp(_el$79, "fg", "#38bdf8");
|
|
8320
|
+
insert(_el$79, () => perf().speed?.replace(/^Speed:\s*/, "") ?? "");
|
|
8321
|
+
effect((_p$) => {
|
|
8322
|
+
var _v$9 = muted(), _v$0 = muted();
|
|
8323
|
+
_v$9 !== _p$.e && (_p$.e = setProp(_el$73, "fg", _v$9, _p$.e));
|
|
8324
|
+
_v$0 !== _p$.t && (_p$.t = setProp(_el$77, "fg", _v$0, _p$.t));
|
|
8325
|
+
return _p$;
|
|
8326
|
+
}, {
|
|
8327
|
+
e: void 0,
|
|
8328
|
+
t: void 0
|
|
8329
|
+
});
|
|
8330
|
+
return _el$71;
|
|
8331
|
+
})()
|
|
8332
|
+
}), _el$25);
|
|
8333
|
+
insertNode(_el$25, createTextNode(`──────────────────────────────`));
|
|
8334
|
+
setProp(_el$25, "fg", "#374151");
|
|
8335
|
+
insertNode(_el$27, _el$28);
|
|
8336
|
+
setProp(_el$27, "flexDirection", "row");
|
|
8337
|
+
setProp(_el$27, "justifyContent", "space-between");
|
|
8338
|
+
insert(_el$27, createComponent(Show, {
|
|
8339
|
+
get when() {
|
|
8340
|
+
return model.toolCallsLine();
|
|
8341
|
+
},
|
|
8342
|
+
get fallback() {
|
|
8343
|
+
return (() => {
|
|
8344
|
+
var _el$80 = createElement("text");
|
|
8345
|
+
insertNode(_el$80, createTextNode(`tools: 0 (0 err)`));
|
|
8346
|
+
effect((_$p) => setProp(_el$80, "fg", muted(), _$p));
|
|
8347
|
+
return _el$80;
|
|
8348
|
+
})();
|
|
7523
8349
|
},
|
|
7524
8350
|
children: (line) => (() => {
|
|
7525
|
-
var _el$
|
|
7526
|
-
insert(_el$
|
|
7527
|
-
effect((_$p) => setProp(_el$
|
|
7528
|
-
return _el$
|
|
8351
|
+
var _el$82 = createElement("text");
|
|
8352
|
+
insert(_el$82, line);
|
|
8353
|
+
effect((_$p) => setProp(_el$82, "fg", muted(), _$p));
|
|
8354
|
+
return _el$82;
|
|
7529
8355
|
})()
|
|
8356
|
+
}), _el$28);
|
|
8357
|
+
setProp(_el$28, "fg", "#22c55e");
|
|
8358
|
+
setProp(_el$28, "attributes", 1);
|
|
8359
|
+
insert(_el$28, () => model.gateStatus());
|
|
8360
|
+
insert(_el$23, createComponent(Show, {
|
|
8361
|
+
get when() {
|
|
8362
|
+
return memo(() => !!tuiPrefs().sidebar.context.modelUsage)() && usageRows().length > 0;
|
|
8363
|
+
},
|
|
8364
|
+
get children() {
|
|
8365
|
+
return [
|
|
8366
|
+
(() => {
|
|
8367
|
+
var _el$29 = createElement("text");
|
|
8368
|
+
insertNode(_el$29, createTextNode(`Session · reported cost`));
|
|
8369
|
+
effect((_$p) => setProp(_el$29, "fg", muted(), _$p));
|
|
8370
|
+
return _el$29;
|
|
8371
|
+
})(),
|
|
8372
|
+
(() => {
|
|
8373
|
+
var _el$31 = createElement("text");
|
|
8374
|
+
insertNode(_el$31, createTextNode(`Model Tokens USD`));
|
|
8375
|
+
effect((_$p) => setProp(_el$31, "fg", muted(), _$p));
|
|
8376
|
+
return _el$31;
|
|
8377
|
+
})(),
|
|
8378
|
+
createComponent(For, {
|
|
8379
|
+
get each() {
|
|
8380
|
+
return usageRows();
|
|
8381
|
+
},
|
|
8382
|
+
children: (row) => (() => {
|
|
8383
|
+
var _el$83 = createElement("box");
|
|
8384
|
+
setProp(_el$83, "flexDirection", "column");
|
|
8385
|
+
insert(_el$83, createComponent(For, {
|
|
8386
|
+
get each() {
|
|
8387
|
+
return modelUsageRowLines(row);
|
|
8388
|
+
},
|
|
8389
|
+
children: (line) => (() => {
|
|
8390
|
+
var _el$84 = createElement("text");
|
|
8391
|
+
insert(_el$84, line);
|
|
8392
|
+
effect((_$p) => setProp(_el$84, "fg", text(), _$p));
|
|
8393
|
+
return _el$84;
|
|
8394
|
+
})()
|
|
8395
|
+
}));
|
|
8396
|
+
return _el$83;
|
|
8397
|
+
})()
|
|
8398
|
+
}),
|
|
8399
|
+
createComponent(Show, {
|
|
8400
|
+
get when() {
|
|
8401
|
+
return usageHidden();
|
|
8402
|
+
},
|
|
8403
|
+
children: (line) => createComponent(For, {
|
|
8404
|
+
get each() {
|
|
8405
|
+
return sidebarTextLines(line());
|
|
8406
|
+
},
|
|
8407
|
+
children: (part) => (() => {
|
|
8408
|
+
var _el$85 = createElement("text");
|
|
8409
|
+
insert(_el$85, part);
|
|
8410
|
+
effect((_$p) => setProp(_el$85, "fg", muted(), _$p));
|
|
8411
|
+
return _el$85;
|
|
8412
|
+
})()
|
|
8413
|
+
})
|
|
8414
|
+
})
|
|
8415
|
+
];
|
|
8416
|
+
}
|
|
7530
8417
|
}), null);
|
|
7531
|
-
insert(_el$
|
|
8418
|
+
insert(_el$23, createComponent(Show, {
|
|
7532
8419
|
get when() {
|
|
7533
8420
|
return spendLine();
|
|
7534
8421
|
},
|
|
@@ -7537,37 +8424,39 @@ function Sidebar(props) {
|
|
|
7537
8424
|
return contextSpendLines(line());
|
|
7538
8425
|
},
|
|
7539
8426
|
children: (part) => (() => {
|
|
7540
|
-
var _el$
|
|
7541
|
-
insert(_el$
|
|
7542
|
-
effect((_$p) => setProp(_el$
|
|
7543
|
-
return _el$
|
|
8427
|
+
var _el$86 = createElement("text");
|
|
8428
|
+
insert(_el$86, part);
|
|
8429
|
+
effect((_$p) => setProp(_el$86, "fg", muted(), _$p));
|
|
8430
|
+
return _el$86;
|
|
7544
8431
|
})()
|
|
7545
8432
|
})
|
|
7546
8433
|
}), null);
|
|
7547
|
-
return _el$
|
|
8434
|
+
return _el$23;
|
|
7548
8435
|
}
|
|
7549
8436
|
}), null);
|
|
7550
|
-
insert(_el$
|
|
8437
|
+
insert(_el$16, createComponent(Show, {
|
|
7551
8438
|
get when() {
|
|
7552
8439
|
return block("git");
|
|
7553
8440
|
},
|
|
7554
8441
|
get children() {
|
|
7555
|
-
var _el$
|
|
7556
|
-
|
|
7557
|
-
|
|
8442
|
+
var _el$33 = createElement("box"), _el$35 = createElement("box");
|
|
8443
|
+
insertNode(_el$33, _el$35);
|
|
8444
|
+
setProp(_el$33, "flexDirection", "column");
|
|
8445
|
+
insert(_el$33, createComponent(Show, {
|
|
7558
8446
|
get when() {
|
|
7559
8447
|
return spacer("git");
|
|
7560
8448
|
},
|
|
7561
8449
|
get children() {
|
|
7562
|
-
var _el$
|
|
7563
|
-
setProp(_el$
|
|
7564
|
-
return _el$
|
|
8450
|
+
var _el$34 = createElement("box");
|
|
8451
|
+
setProp(_el$34, "height", 1);
|
|
8452
|
+
return _el$34;
|
|
7565
8453
|
}
|
|
7566
|
-
}),
|
|
7567
|
-
insert(_el$
|
|
8454
|
+
}), _el$35);
|
|
8455
|
+
insert(_el$33, createComponent(BlockHeader, {
|
|
7568
8456
|
get icon() {
|
|
7569
8457
|
return BLOCK_ICONS.git;
|
|
7570
8458
|
},
|
|
8459
|
+
iconFg: "#f59e0b",
|
|
7571
8460
|
label: "Git status",
|
|
7572
8461
|
get fg() {
|
|
7573
8462
|
return text();
|
|
@@ -7575,72 +8464,69 @@ function Sidebar(props) {
|
|
|
7575
8464
|
get muted() {
|
|
7576
8465
|
return muted();
|
|
7577
8466
|
}
|
|
7578
|
-
}),
|
|
7579
|
-
|
|
8467
|
+
}), _el$35);
|
|
8468
|
+
setProp(_el$35, "flexDirection", "row");
|
|
8469
|
+
setProp(_el$35, "justifyContent", "space-between");
|
|
8470
|
+
insert(_el$35, createComponent(Show, {
|
|
7580
8471
|
get when() {
|
|
7581
8472
|
return model.branch();
|
|
7582
8473
|
},
|
|
7583
8474
|
children: (value) => (() => {
|
|
7584
|
-
var _el$
|
|
7585
|
-
insertNode(_el$
|
|
7586
|
-
insertNode(_el$
|
|
7587
|
-
setProp(_el$
|
|
7588
|
-
insertNode(_el$
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
return _p$;
|
|
7595
|
-
}, {
|
|
7596
|
-
e: void 0,
|
|
7597
|
-
t: void 0
|
|
7598
|
-
});
|
|
7599
|
-
return _el$35;
|
|
8475
|
+
var _el$87 = createElement("box"), _el$88 = createElement("text"), _el$90 = createElement("text");
|
|
8476
|
+
insertNode(_el$87, _el$88);
|
|
8477
|
+
insertNode(_el$87, _el$90);
|
|
8478
|
+
setProp(_el$87, "flexDirection", "row");
|
|
8479
|
+
insertNode(_el$88, createTextNode(`⎇ `));
|
|
8480
|
+
setProp(_el$88, "fg", "#38bdf8");
|
|
8481
|
+
setProp(_el$90, "attributes", 1);
|
|
8482
|
+
insert(_el$90, () => truncateLabel(value(), 24));
|
|
8483
|
+
effect((_$p) => setProp(_el$90, "fg", text(), _$p));
|
|
8484
|
+
return _el$87;
|
|
7600
8485
|
})()
|
|
7601
8486
|
}), null);
|
|
7602
|
-
insert(_el$
|
|
8487
|
+
insert(_el$35, createComponent(Show, {
|
|
7603
8488
|
get when() {
|
|
7604
8489
|
return model.gitLine();
|
|
7605
8490
|
},
|
|
7606
8491
|
children: (line) => (() => {
|
|
7607
|
-
var _el$
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
return _el$
|
|
8492
|
+
var _el$91 = createElement("text");
|
|
8493
|
+
setProp(_el$91, "fg", "#f59e0b");
|
|
8494
|
+
insert(_el$91, line);
|
|
8495
|
+
return _el$91;
|
|
7611
8496
|
})()
|
|
7612
8497
|
}), null);
|
|
7613
|
-
return _el$
|
|
8498
|
+
return _el$33;
|
|
7614
8499
|
}
|
|
7615
8500
|
}), null);
|
|
7616
|
-
insert(_el$
|
|
8501
|
+
insert(_el$16, createComponent(Show, {
|
|
7617
8502
|
get when() {
|
|
7618
8503
|
return block("dispatch");
|
|
7619
8504
|
},
|
|
7620
8505
|
get children() {
|
|
7621
|
-
var _el$
|
|
7622
|
-
setProp(_el$
|
|
7623
|
-
insert(_el$
|
|
8506
|
+
var _el$36 = createElement("box");
|
|
8507
|
+
setProp(_el$36, "flexDirection", "column");
|
|
8508
|
+
insert(_el$36, createComponent(Show, {
|
|
7624
8509
|
get when() {
|
|
7625
8510
|
return spacer("dispatch");
|
|
7626
8511
|
},
|
|
7627
8512
|
get children() {
|
|
7628
|
-
var _el$
|
|
7629
|
-
setProp(_el$
|
|
7630
|
-
return _el$
|
|
8513
|
+
var _el$37 = createElement("box");
|
|
8514
|
+
setProp(_el$37, "height", 1);
|
|
8515
|
+
return _el$37;
|
|
7631
8516
|
}
|
|
7632
8517
|
}), null);
|
|
7633
|
-
insert(_el$
|
|
8518
|
+
insert(_el$36, createComponent(Show, {
|
|
7634
8519
|
get when() {
|
|
7635
8520
|
return dispatchView();
|
|
7636
8521
|
},
|
|
7637
8522
|
children: (view) => (() => {
|
|
7638
|
-
var _el$
|
|
7639
|
-
setProp(_el$
|
|
7640
|
-
insert(_el$
|
|
8523
|
+
var _el$92 = createElement("box");
|
|
8524
|
+
setProp(_el$92, "flexDirection", "column");
|
|
8525
|
+
insert(_el$92, createComponent(BlockHeader, {
|
|
7641
8526
|
get icon() {
|
|
7642
8527
|
return BLOCK_ICONS.dispatch;
|
|
7643
8528
|
},
|
|
8529
|
+
iconFg: "#c084fc",
|
|
7644
8530
|
label: "Dispatch",
|
|
7645
8531
|
get fg() {
|
|
7646
8532
|
return memo(() => view().runningCount > 0)() ? tone("success") : muted();
|
|
@@ -7652,101 +8538,101 @@ function Sidebar(props) {
|
|
|
7652
8538
|
return dispatchSummary();
|
|
7653
8539
|
}
|
|
7654
8540
|
}), null);
|
|
7655
|
-
insert(_el$
|
|
8541
|
+
insert(_el$92, createComponent(For, {
|
|
7656
8542
|
get each() {
|
|
7657
8543
|
return view().running;
|
|
7658
8544
|
},
|
|
7659
8545
|
children: (row) => (() => {
|
|
7660
|
-
var _el$
|
|
7661
|
-
insertNode(_el$
|
|
7662
|
-
setProp(_el$
|
|
7663
|
-
insert(_el$
|
|
8546
|
+
var _el$94 = createElement("box"), _el$95 = createElement("text");
|
|
8547
|
+
insertNode(_el$94, _el$95);
|
|
8548
|
+
setProp(_el$94, "flexShrink", 0);
|
|
8549
|
+
insert(_el$95, () => row.text);
|
|
7664
8550
|
effect((_p$) => {
|
|
7665
|
-
var _v$
|
|
7666
|
-
_v$
|
|
7667
|
-
_v$
|
|
8551
|
+
var _v$1 = open(row.id), _v$10 = tone("success");
|
|
8552
|
+
_v$1 !== _p$.e && (_p$.e = setProp(_el$94, "onMouseDown", _v$1, _p$.e));
|
|
8553
|
+
_v$10 !== _p$.t && (_p$.t = setProp(_el$95, "fg", _v$10, _p$.t));
|
|
7668
8554
|
return _p$;
|
|
7669
8555
|
}, {
|
|
7670
8556
|
e: void 0,
|
|
7671
8557
|
t: void 0
|
|
7672
8558
|
});
|
|
7673
|
-
return _el$
|
|
8559
|
+
return _el$94;
|
|
7674
8560
|
})()
|
|
7675
8561
|
}), null);
|
|
7676
|
-
insert(_el$
|
|
8562
|
+
insert(_el$92, createComponent(Show, {
|
|
7677
8563
|
get when() {
|
|
7678
8564
|
return view().runningHidden > 0;
|
|
7679
8565
|
},
|
|
7680
8566
|
get children() {
|
|
7681
|
-
var _el$
|
|
7682
|
-
insert(_el$
|
|
7683
|
-
effect((_$p) => setProp(_el$
|
|
7684
|
-
return _el$
|
|
8567
|
+
var _el$93 = createElement("text");
|
|
8568
|
+
insert(_el$93, () => `\u2026 +${view().runningHidden} rodando`);
|
|
8569
|
+
effect((_$p) => setProp(_el$93, "fg", muted(), _$p));
|
|
8570
|
+
return _el$93;
|
|
7685
8571
|
}
|
|
7686
8572
|
}), null);
|
|
7687
|
-
insert(_el$
|
|
8573
|
+
insert(_el$92, createComponent(Show, {
|
|
7688
8574
|
get when() {
|
|
7689
8575
|
return view().summary;
|
|
7690
8576
|
},
|
|
7691
8577
|
children: (line) => (() => {
|
|
7692
|
-
var _el$
|
|
7693
|
-
insertNode(_el$
|
|
7694
|
-
setProp(_el$
|
|
7695
|
-
setProp(_el$
|
|
7696
|
-
insert(_el$
|
|
7697
|
-
insert(_el$
|
|
8578
|
+
var _el$96 = createElement("box"), _el$97 = createElement("text");
|
|
8579
|
+
insertNode(_el$96, _el$97);
|
|
8580
|
+
setProp(_el$96, "flexDirection", "row");
|
|
8581
|
+
setProp(_el$96, "flexShrink", 0);
|
|
8582
|
+
insert(_el$97, line);
|
|
8583
|
+
insert(_el$96, createComponent(Show, {
|
|
7698
8584
|
get when() {
|
|
7699
8585
|
return failedSuffix();
|
|
7700
8586
|
},
|
|
7701
8587
|
children: (suffix) => (() => {
|
|
7702
|
-
var _el$
|
|
7703
|
-
insert(_el$
|
|
7704
|
-
effect((_$p) => setProp(_el$
|
|
7705
|
-
return _el$
|
|
8588
|
+
var _el$98 = createElement("text");
|
|
8589
|
+
insert(_el$98, () => `${SPEND_LINE_SEPARATOR}${suffix()}`);
|
|
8590
|
+
effect((_$p) => setProp(_el$98, "fg", tone("error"), _$p));
|
|
8591
|
+
return _el$98;
|
|
7706
8592
|
})()
|
|
7707
8593
|
}), null);
|
|
7708
|
-
effect((_$p) => setProp(_el$
|
|
7709
|
-
return _el$
|
|
8594
|
+
effect((_$p) => setProp(_el$97, "fg", muted(), _$p));
|
|
8595
|
+
return _el$96;
|
|
7710
8596
|
})()
|
|
7711
8597
|
}), null);
|
|
7712
|
-
insert(_el$
|
|
8598
|
+
insert(_el$92, createComponent(For, {
|
|
7713
8599
|
get each() {
|
|
7714
8600
|
return view().agents;
|
|
7715
8601
|
},
|
|
7716
8602
|
children: (row) => (() => {
|
|
7717
|
-
var _el$
|
|
7718
|
-
insert(_el$
|
|
7719
|
-
effect((_$p) => setProp(_el$
|
|
7720
|
-
return _el$
|
|
8603
|
+
var _el$99 = createElement("text");
|
|
8604
|
+
insert(_el$99, () => childAgentRowText(row));
|
|
8605
|
+
effect((_$p) => setProp(_el$99, "fg", muted(), _$p));
|
|
8606
|
+
return _el$99;
|
|
7721
8607
|
})()
|
|
7722
8608
|
}), null);
|
|
7723
|
-
insert(_el$
|
|
8609
|
+
insert(_el$92, createComponent(Show, {
|
|
7724
8610
|
get when() {
|
|
7725
8611
|
return hiddenChildAgentsText(view().agentsHidden, view().agentsHiddenCost);
|
|
7726
8612
|
},
|
|
7727
8613
|
children: (line) => (() => {
|
|
7728
|
-
var _el$
|
|
7729
|
-
insert(_el$
|
|
7730
|
-
effect((_$p) => setProp(_el$
|
|
7731
|
-
return _el$
|
|
8614
|
+
var _el$100 = createElement("text");
|
|
8615
|
+
insert(_el$100, line);
|
|
8616
|
+
effect((_$p) => setProp(_el$100, "fg", muted(), _$p));
|
|
8617
|
+
return _el$100;
|
|
7732
8618
|
})()
|
|
7733
8619
|
}), null);
|
|
7734
|
-
return _el$
|
|
8620
|
+
return _el$92;
|
|
7735
8621
|
})()
|
|
7736
8622
|
}), null);
|
|
7737
|
-
return _el$
|
|
8623
|
+
return _el$36;
|
|
7738
8624
|
}
|
|
7739
8625
|
}), null);
|
|
7740
8626
|
effect((_p$) => {
|
|
7741
|
-
var _v$
|
|
7742
|
-
_v$
|
|
7743
|
-
_v$
|
|
8627
|
+
var _v$5 = tuiPrefs().layout.preset === "compact" ? 0 : 1, _v$6 = tuiPrefs().layout.preset === "compact" ? 0 : 1;
|
|
8628
|
+
_v$5 !== _p$.e && (_p$.e = setProp(_el$16, "paddingTop", _v$5, _p$.e));
|
|
8629
|
+
_v$6 !== _p$.t && (_p$.t = setProp(_el$16, "paddingBottom", _v$6, _p$.t));
|
|
7744
8630
|
return _p$;
|
|
7745
8631
|
}, {
|
|
7746
8632
|
e: void 0,
|
|
7747
8633
|
t: void 0
|
|
7748
8634
|
});
|
|
7749
|
-
return _el$
|
|
8635
|
+
return _el$16;
|
|
7750
8636
|
})();
|
|
7751
8637
|
}
|
|
7752
8638
|
/** Panel actions that only make sense with a row selected. A panel over an
|
|
@@ -7815,25 +8701,25 @@ function DispatchPanel(props) {
|
|
|
7815
8701
|
return model.visible().rows;
|
|
7816
8702
|
},
|
|
7817
8703
|
children: (row) => (() => {
|
|
7818
|
-
var _el$
|
|
7819
|
-
insertNode(_el$
|
|
7820
|
-
insertNode(_el$
|
|
7821
|
-
setProp(_el$
|
|
7822
|
-
setProp(_el$
|
|
7823
|
-
insert(_el$
|
|
7824
|
-
insert(_el$
|
|
8704
|
+
var _el$101 = createElement("box"), _el$102 = createElement("text"), _el$103 = createElement("text");
|
|
8705
|
+
insertNode(_el$101, _el$102);
|
|
8706
|
+
insertNode(_el$101, _el$103);
|
|
8707
|
+
setProp(_el$101, "flexDirection", "row");
|
|
8708
|
+
setProp(_el$101, "flexShrink", 0);
|
|
8709
|
+
insert(_el$102, () => selected(row.id) ? `▸ ` : " ");
|
|
8710
|
+
insert(_el$103, () => row.text);
|
|
7825
8711
|
effect((_p$) => {
|
|
7826
|
-
var _v$
|
|
7827
|
-
_v$
|
|
7828
|
-
_v$
|
|
7829
|
-
_v$
|
|
8712
|
+
var _v$11 = selected(row.id) ? text() : muted(), _v$12 = rowFg(row.state), _v$13 = selected(row.id) ? 1 : 0;
|
|
8713
|
+
_v$11 !== _p$.e && (_p$.e = setProp(_el$102, "fg", _v$11, _p$.e));
|
|
8714
|
+
_v$12 !== _p$.t && (_p$.t = setProp(_el$103, "fg", _v$12, _p$.t));
|
|
8715
|
+
_v$13 !== _p$.a && (_p$.a = setProp(_el$103, "attributes", _v$13, _p$.a));
|
|
7830
8716
|
return _p$;
|
|
7831
8717
|
}, {
|
|
7832
8718
|
e: void 0,
|
|
7833
8719
|
t: void 0,
|
|
7834
8720
|
a: void 0
|
|
7835
8721
|
});
|
|
7836
|
-
return _el$
|
|
8722
|
+
return _el$101;
|
|
7837
8723
|
})()
|
|
7838
8724
|
});
|
|
7839
8725
|
const detail = () => createComponent(For, {
|
|
@@ -7841,28 +8727,28 @@ function DispatchPanel(props) {
|
|
|
7841
8727
|
return model.detail();
|
|
7842
8728
|
},
|
|
7843
8729
|
children: (line, index) => (() => {
|
|
7844
|
-
var _el$
|
|
7845
|
-
insert(_el$
|
|
7846
|
-
effect((_$p) => setProp(_el$
|
|
7847
|
-
return _el$
|
|
8730
|
+
var _el$104 = createElement("text");
|
|
8731
|
+
insert(_el$104, line);
|
|
8732
|
+
effect((_$p) => setProp(_el$104, "fg", index() === 0 ? text() : muted(), _$p));
|
|
8733
|
+
return _el$104;
|
|
7848
8734
|
})()
|
|
7849
8735
|
});
|
|
7850
8736
|
const empty = () => (() => {
|
|
7851
|
-
var _el$
|
|
7852
|
-
insertNode(_el$
|
|
7853
|
-
effect((_$p) => setProp(_el$
|
|
7854
|
-
return _el$
|
|
8737
|
+
var _el$105 = createElement("text");
|
|
8738
|
+
insertNode(_el$105, createTextNode(`No delegated sessions`));
|
|
8739
|
+
effect((_$p) => setProp(_el$105, "fg", muted(), _$p));
|
|
8740
|
+
return _el$105;
|
|
7855
8741
|
})();
|
|
7856
8742
|
return (() => {
|
|
7857
|
-
var _el$
|
|
7858
|
-
insertNode(_el$
|
|
7859
|
-
insertNode(_el$
|
|
7860
|
-
insertNode(_el$
|
|
7861
|
-
insertNode(_el$
|
|
7862
|
-
setProp(_el$
|
|
7863
|
-
setProp(_el$
|
|
7864
|
-
setProp(_el$
|
|
7865
|
-
insert(_el$
|
|
8743
|
+
var _el$107 = createElement("box"), _el$108 = createElement("text"), _el$109 = createElement("text"), _el$113 = createElement("box"), _el$114 = createElement("text");
|
|
8744
|
+
insertNode(_el$107, _el$108);
|
|
8745
|
+
insertNode(_el$107, _el$109);
|
|
8746
|
+
insertNode(_el$107, _el$113);
|
|
8747
|
+
insertNode(_el$107, _el$114);
|
|
8748
|
+
setProp(_el$107, "flexDirection", "column");
|
|
8749
|
+
setProp(_el$107, "width", "100%");
|
|
8750
|
+
setProp(_el$107, "padding", 1);
|
|
8751
|
+
insert(_el$107, createComponent(DispatchPanelKeymap, {
|
|
7866
8752
|
get context() {
|
|
7867
8753
|
return props.context;
|
|
7868
8754
|
},
|
|
@@ -7870,30 +8756,30 @@ function DispatchPanel(props) {
|
|
|
7870
8756
|
return props.panel;
|
|
7871
8757
|
},
|
|
7872
8758
|
model
|
|
7873
|
-
}), _el$
|
|
7874
|
-
setProp(_el$
|
|
7875
|
-
insert(_el$
|
|
7876
|
-
insert(_el$
|
|
8759
|
+
}), _el$108);
|
|
8760
|
+
setProp(_el$108, "attributes", 1);
|
|
8761
|
+
insert(_el$108, () => model.title());
|
|
8762
|
+
insert(_el$107, createComponent(Show, {
|
|
7877
8763
|
get when() {
|
|
7878
8764
|
return model.header();
|
|
7879
8765
|
},
|
|
7880
8766
|
children: (line) => (() => {
|
|
7881
|
-
var _el$
|
|
7882
|
-
insert(_el$
|
|
7883
|
-
effect((_$p) => setProp(_el$
|
|
7884
|
-
return _el$
|
|
8767
|
+
var _el$115 = createElement("text");
|
|
8768
|
+
insert(_el$115, line);
|
|
8769
|
+
effect((_$p) => setProp(_el$115, "fg", muted(), _$p));
|
|
8770
|
+
return _el$115;
|
|
7885
8771
|
})()
|
|
7886
|
-
}), _el$
|
|
7887
|
-
insert(_el$
|
|
7888
|
-
insert(_el$
|
|
8772
|
+
}), _el$109);
|
|
8773
|
+
insert(_el$109, () => dispatchPanelRule(props.panel.width - 2));
|
|
8774
|
+
insert(_el$107, createComponent(Show, {
|
|
7889
8775
|
get when() {
|
|
7890
8776
|
return model.layout().mode === "wide";
|
|
7891
8777
|
},
|
|
7892
8778
|
get fallback() {
|
|
7893
8779
|
return (() => {
|
|
7894
|
-
var _el$
|
|
7895
|
-
setProp(_el$
|
|
7896
|
-
insert(_el$
|
|
8780
|
+
var _el$116 = createElement("box");
|
|
8781
|
+
setProp(_el$116, "flexDirection", "column");
|
|
8782
|
+
insert(_el$116, createComponent(Show, {
|
|
7897
8783
|
get when() {
|
|
7898
8784
|
return model.rows().length > 0;
|
|
7899
8785
|
},
|
|
@@ -7901,34 +8787,34 @@ function DispatchPanel(props) {
|
|
|
7901
8787
|
return empty();
|
|
7902
8788
|
},
|
|
7903
8789
|
get children() {
|
|
7904
|
-
var _el$
|
|
7905
|
-
setProp(_el$
|
|
7906
|
-
insert(_el$
|
|
7907
|
-
return _el$
|
|
8790
|
+
var _el$117 = createElement("box");
|
|
8791
|
+
setProp(_el$117, "flexDirection", "column");
|
|
8792
|
+
insert(_el$117, rows);
|
|
8793
|
+
return _el$117;
|
|
7908
8794
|
}
|
|
7909
8795
|
}), null);
|
|
7910
|
-
insert(_el$
|
|
8796
|
+
insert(_el$116, createComponent(Show, {
|
|
7911
8797
|
get when() {
|
|
7912
8798
|
return model.selectedID();
|
|
7913
8799
|
},
|
|
7914
8800
|
get children() {
|
|
7915
|
-
var _el$
|
|
7916
|
-
insertNode(_el$
|
|
7917
|
-
setProp(_el$
|
|
7918
|
-
setProp(_el$
|
|
7919
|
-
insert(_el$
|
|
7920
|
-
return _el$
|
|
8801
|
+
var _el$118 = createElement("box"), _el$119 = createElement("box");
|
|
8802
|
+
insertNode(_el$118, _el$119);
|
|
8803
|
+
setProp(_el$118, "flexDirection", "column");
|
|
8804
|
+
setProp(_el$119, "height", 1);
|
|
8805
|
+
insert(_el$118, detail, null);
|
|
8806
|
+
return _el$118;
|
|
7921
8807
|
}
|
|
7922
8808
|
}), null);
|
|
7923
|
-
return _el$
|
|
8809
|
+
return _el$116;
|
|
7924
8810
|
})();
|
|
7925
8811
|
},
|
|
7926
8812
|
get children() {
|
|
7927
|
-
var _el$
|
|
7928
|
-
insertNode(_el$
|
|
7929
|
-
setProp(_el$
|
|
7930
|
-
setProp(_el$
|
|
7931
|
-
insert(_el$
|
|
8813
|
+
var _el$110 = createElement("box"), _el$111 = createElement("box");
|
|
8814
|
+
insertNode(_el$110, _el$111);
|
|
8815
|
+
setProp(_el$110, "flexDirection", "row");
|
|
8816
|
+
setProp(_el$111, "flexDirection", "column");
|
|
8817
|
+
insert(_el$111, createComponent(Show, {
|
|
7932
8818
|
get when() {
|
|
7933
8819
|
return model.rows().length > 0;
|
|
7934
8820
|
},
|
|
@@ -7939,36 +8825,36 @@ function DispatchPanel(props) {
|
|
|
7939
8825
|
return rows();
|
|
7940
8826
|
}
|
|
7941
8827
|
}));
|
|
7942
|
-
insert(_el$
|
|
8828
|
+
insert(_el$110, createComponent(Show, {
|
|
7943
8829
|
get when() {
|
|
7944
8830
|
return model.selectedID();
|
|
7945
8831
|
},
|
|
7946
8832
|
get children() {
|
|
7947
|
-
var _el$
|
|
7948
|
-
setProp(_el$
|
|
7949
|
-
insert(_el$
|
|
7950
|
-
effect((_$p) => setProp(_el$
|
|
7951
|
-
return _el$
|
|
8833
|
+
var _el$112 = createElement("box");
|
|
8834
|
+
setProp(_el$112, "flexDirection", "column");
|
|
8835
|
+
insert(_el$112, detail);
|
|
8836
|
+
effect((_$p) => setProp(_el$112, "width", model.layout().detailWidth, _$p));
|
|
8837
|
+
return _el$112;
|
|
7952
8838
|
}
|
|
7953
8839
|
}), null);
|
|
7954
|
-
effect((_$p) => setProp(_el$
|
|
7955
|
-
return _el$
|
|
8840
|
+
effect((_$p) => setProp(_el$111, "width", model.layout().listWidth, _$p));
|
|
8841
|
+
return _el$110;
|
|
7956
8842
|
}
|
|
7957
|
-
}), _el$
|
|
7958
|
-
setProp(_el$
|
|
7959
|
-
insert(_el$
|
|
8843
|
+
}), _el$113);
|
|
8844
|
+
setProp(_el$113, "height", 1);
|
|
8845
|
+
insert(_el$114, () => model.footer());
|
|
7960
8846
|
effect((_p$) => {
|
|
7961
|
-
var _v$
|
|
7962
|
-
_v$
|
|
7963
|
-
_v$
|
|
7964
|
-
_v$
|
|
8847
|
+
var _v$14 = text(), _v$15 = muted(), _v$16 = muted();
|
|
8848
|
+
_v$14 !== _p$.e && (_p$.e = setProp(_el$108, "fg", _v$14, _p$.e));
|
|
8849
|
+
_v$15 !== _p$.t && (_p$.t = setProp(_el$109, "fg", _v$15, _p$.t));
|
|
8850
|
+
_v$16 !== _p$.a && (_p$.a = setProp(_el$114, "fg", _v$16, _p$.a));
|
|
7965
8851
|
return _p$;
|
|
7966
8852
|
}, {
|
|
7967
8853
|
e: void 0,
|
|
7968
8854
|
t: void 0,
|
|
7969
8855
|
a: void 0
|
|
7970
8856
|
});
|
|
7971
|
-
return _el$
|
|
8857
|
+
return _el$107;
|
|
7972
8858
|
})();
|
|
7973
8859
|
}
|
|
7974
8860
|
/** App-level command claim: the only way into the panel. It registers the
|
|
@@ -8025,10 +8911,10 @@ function HomeStatus(props) {
|
|
|
8025
8911
|
return tuiPrefs().footer.home;
|
|
8026
8912
|
},
|
|
8027
8913
|
get children() {
|
|
8028
|
-
var _el$
|
|
8029
|
-
insert(_el$
|
|
8030
|
-
effect((_$p) => setProp(_el$
|
|
8031
|
-
return _el$
|
|
8914
|
+
var _el$120 = createElement("text");
|
|
8915
|
+
insert(_el$120, () => `Pantheon v2.2.0-beta.2${preset().name ? ` ▸ ${preset().name}` : ""}`);
|
|
8916
|
+
effect((_$p) => setProp(_el$120, "fg", muted(), _$p));
|
|
8917
|
+
return _el$120;
|
|
8032
8918
|
}
|
|
8033
8919
|
});
|
|
8034
8920
|
}
|
|
@@ -8084,10 +8970,10 @@ function PromptFooter(props) {
|
|
|
8084
8970
|
return memo(() => !!tuiPrefs().footer.prompt)() && model.running() > 0;
|
|
8085
8971
|
},
|
|
8086
8972
|
get children() {
|
|
8087
|
-
var _el$
|
|
8088
|
-
insert(_el$
|
|
8089
|
-
effect((_$p) => setProp(_el$
|
|
8090
|
-
return _el$
|
|
8973
|
+
var _el$121 = createElement("text");
|
|
8974
|
+
insert(_el$121, () => `▸${model.preset().name ?? "default"} · ✦${model.running()} ativos`);
|
|
8975
|
+
effect((_$p) => setProp(_el$121, "fg", muted(), _$p));
|
|
8976
|
+
return _el$121;
|
|
8091
8977
|
}
|
|
8092
8978
|
});
|
|
8093
8979
|
}
|
|
@@ -8101,9 +8987,11 @@ const plugin = Plugin.define({
|
|
|
8101
8987
|
warmUpSidebarData(context, resolveLocation(context));
|
|
8102
8988
|
const unregisterSidebar = context.ui.slot({
|
|
8103
8989
|
append: "sidebar.content",
|
|
8104
|
-
render: (
|
|
8990
|
+
render: (slotProps) => createComponent(Sidebar, {
|
|
8105
8991
|
context,
|
|
8106
|
-
sessionID
|
|
8992
|
+
get sessionID() {
|
|
8993
|
+
return slotProps?.sessionID;
|
|
8994
|
+
}
|
|
8107
8995
|
})
|
|
8108
8996
|
});
|
|
8109
8997
|
const unregisterHome = context.ui.slot({
|
|
@@ -8115,9 +9003,11 @@ const plugin = Plugin.define({
|
|
|
8115
9003
|
}, 1e4);
|
|
8116
9004
|
const unregisterPromptFooter = context.ui.slot({
|
|
8117
9005
|
append: "prompt.footer",
|
|
8118
|
-
render: (
|
|
9006
|
+
render: (slotProps) => createComponent(PromptFooter, {
|
|
8119
9007
|
context,
|
|
8120
|
-
sessionID
|
|
9008
|
+
get sessionID() {
|
|
9009
|
+
return slotProps?.sessionID;
|
|
9010
|
+
}
|
|
8121
9011
|
})
|
|
8122
9012
|
});
|
|
8123
9013
|
const unregisterPanel = context.ui.slot({
|
|
@@ -8143,13 +9033,15 @@ const plugin = Plugin.define({
|
|
|
8143
9033
|
render: () => createComponent(PantheonSettingsCommandLayer, { context })
|
|
8144
9034
|
});
|
|
8145
9035
|
try {
|
|
8146
|
-
setupPantheonSettings(context);
|
|
9036
|
+
setupPantheonSettings(context, { renderSidebar: (ctx) => createComponent(Sidebar, { context: ctx }) });
|
|
8147
9037
|
} catch {}
|
|
8148
9038
|
const unregisterSettingsSlot = context.ui.slot({
|
|
8149
9039
|
append: "session.composer.top",
|
|
8150
|
-
render: (
|
|
9040
|
+
render: (slotProps) => createComponent(PantheonSettingsSlot, {
|
|
8151
9041
|
context,
|
|
8152
|
-
sessionID
|
|
9042
|
+
get sessionID() {
|
|
9043
|
+
return slotProps?.sessionID ?? "";
|
|
9044
|
+
}
|
|
8153
9045
|
})
|
|
8154
9046
|
});
|
|
8155
9047
|
maybeShowWhatsNewV2(context);
|
|
@@ -8167,6 +9059,6 @@ const plugin = Plugin.define({
|
|
|
8167
9059
|
}
|
|
8168
9060
|
});
|
|
8169
9061
|
//#endregion
|
|
8170
|
-
export { BLOCK_ICONS, CONTEXT_BAR_CELLS, CONTEXT_BAR_EMPTY_CELL, CONTEXT_BAR_FILLED_CELL, DELEGATION_CHILD_STATUS_GRACE_MS, DISPATCH_AGENT_CEILING, DISPATCH_AGENT_WIDTH, DISPATCH_COST_WIDTH, DISPATCH_COUNT_WIDTH, DISPATCH_DONE_MARKER, DISPATCH_DURATION_WIDTH, DISPATCH_GROUP_COST_WIDTH, DISPATCH_KIND_ORIGIN_LABELS, DISPATCH_MAX_LINES, DISPATCH_MAX_WIDTH, DISPATCH_MIN_AGENT_WIDTH, DISPATCH_MODEL_WIDTH, DISPATCH_PANEL_AGENT_WIDTH, DISPATCH_PANEL_COMMANDS, DISPATCH_PANEL_COST_WIDTH, DISPATCH_PANEL_DASH, DISPATCH_PANEL_DURATION_WIDTH, DISPATCH_PANEL_EMPTY_TEXT, DISPATCH_PANEL_FULLSCREEN_BADGE, DISPATCH_PANEL_HEADER_MARKER, DISPATCH_PANEL_KIND_WIDTH, DISPATCH_PANEL_MIN_AGENT_WIDTH, DISPATCH_PANEL_NAME, DISPATCH_PANEL_PAGE_SIZE, DISPATCH_PANEL_RULE_CHAR, DISPATCH_PANEL_SELECTION_GUTTER, DISPATCH_PANEL_SELECTION_MARKER, DISPATCH_PANEL_TITLE_WIDTH, DISPATCH_PANEL_TOAST, DISPATCH_PANEL_WIDE_MIN_WIDTH, DISPATCH_RUNNING_CEILING, GIT_ARROW_DOWN, GIT_ARROW_UP, GIT_CHANGES_DEBOUNCE_MS, GIT_CLI_DEBOUNCE_MS, GIT_CLI_MAX_BUFFER, GIT_CLI_MIN_INTERVAL_MS, GIT_CLI_TIMEOUT_MS, HEADER_MAX_WIDTH, MODEL_USAGE_COST_WIDTH, MODEL_USAGE_DEBOUNCE_MS, MODEL_USAGE_MESSAGE_LIMIT, MODEL_USAGE_MODEL_WIDTH, MODEL_USAGE_SESSION_LIMIT, MODEL_USAGE_TOKEN_WIDTH, MODEL_USAGE_VISIBLE_CEILING, PRESET_MARKER, SIDEBAR_REFRESH_EVENTS, SIDEBAR_WAITING_LABEL, SPEND_30D_LABEL, SPEND_30D_MS, SPEND_LINE_SEPARATOR, SPEND_PROBE_TOLERANCE_MS, SPEND_PROBE_WINDOW_MS, SPEND_REFRESH_DEBOUNCE_MS, SPEND_TODAY_LABEL, TODO_TEXT_WIDTH, TODO_VISIBLE_CEILING, UNKNOWN_AGENT, agentKey, buildDispatchBlock, cacheHitPercent, ceilingModelUsage, ceilingTodoItems, cellWidth, childAgentRowText, classifyDispatchKind, collectChildAgentUsage, collectDispatch, collectModelUsage, collectSubagentCalls, collectWarmupTargets, completedSummaryText, computeContextUsage, contextBar, contextBarFilled, contextBlockRows, contextPerformanceLine, contextProgressColor, contextSpendLine, contextSpendLines, contextUsageTone, countGitChanges, createDispatchPanelModel, createFooterModel, createSidebarModel, plugin as default, defaultGitExec, delegationStateFromOutcome, delegationStateFromStatus, detectDelegationCompletions, dispatchAgentText, dispatchElapsed, dispatchHeaderSummary, dispatchKindFromAgent, dispatchKindFromPrefix, dispatchKindSuffix, dispatchModelText, dispatchPanelCell, dispatchPanelDetail, dispatchPanelFooter, dispatchPanelHeader, dispatchPanelKeymapLayer, dispatchPanelLayout, dispatchPanelMarker, dispatchPanelRangeText, dispatchPanelRowText, dispatchPanelRows, dispatchPanelRule, dispatchPanelTitle, dispatchPanelWindow, dispatchTokenLine, dispatchTokens, dispatchTotalCost, failedSuffixText, formatContextWindow, formatDispatchCost, formatDispatchDuration, formatGitChanges, formatGitSnapshot, formatSpendUSD, formatSpent, formatTokenCount, formatUsageCost, formatUsageTokens, gitProbeAllowed, hiddenChildAgentsText, hiddenModelUsageText, hiddenTodoText, isTodoStatus, isValidSessionID, lastAssistantWithTokens, latestTodoItems, messageTokensTotal, modelRefID, modelUsageRowLines, modelUsageRowText, modelUsageRows, navigateToSession, openDispatchPanel, orderDispatchEntries, orderTodoItems, padCell, parseGitAheadBehind, parseGitStatusPorcelain, parsePresetOverrides, parseTodoItems, performDispatchPanelAction, presetFromEnv, presetHeaderLine, providerIDFromModels, providerIDFromRef, readGitSnapshot, resetSpendUnit, resolveActiveModelRef, resolveActivePresetForTui, resolveContextLimit, resolveModelContextSnapshot, resolvedSpendUnit, runDispatchPanelCommand, runningChildRowText, shortModelID, shortSessionID, sidebarMoneyLines, sidebarPlaceholder, sidebarTextLines, spendWindows, spinnerFrame, startOfLocalDay, statsCost, statsRangeMatches, toDelegationView, toDispatchEntry, todoRowText, todoTone, transcriptWindow, truncateLabel, turnTokensPerSecond, withBlockSpacers };
|
|
9062
|
+
export { BLOCK_ICONS, CONTEXT_BAR_CELLS, CONTEXT_BAR_EMPTY_CELL, CONTEXT_BAR_FILLED_CELL, DELEGATION_CHILD_STATUS_GRACE_MS, DISPATCH_AGENT_CEILING, DISPATCH_AGENT_WIDTH, DISPATCH_COST_WIDTH, DISPATCH_COUNT_WIDTH, DISPATCH_DONE_MARKER, DISPATCH_DURATION_WIDTH, DISPATCH_GROUP_COST_WIDTH, DISPATCH_KIND_ORIGIN_LABELS, DISPATCH_MAX_LINES, DISPATCH_MAX_WIDTH, DISPATCH_MIN_AGENT_WIDTH, DISPATCH_MODEL_WIDTH, DISPATCH_PANEL_AGENT_WIDTH, DISPATCH_PANEL_COMMANDS, DISPATCH_PANEL_COST_WIDTH, DISPATCH_PANEL_DASH, DISPATCH_PANEL_DURATION_WIDTH, DISPATCH_PANEL_EMPTY_TEXT, DISPATCH_PANEL_FULLSCREEN_BADGE, DISPATCH_PANEL_HEADER_MARKER, DISPATCH_PANEL_KIND_WIDTH, DISPATCH_PANEL_MIN_AGENT_WIDTH, DISPATCH_PANEL_NAME, DISPATCH_PANEL_PAGE_SIZE, DISPATCH_PANEL_RULE_CHAR, DISPATCH_PANEL_SELECTION_GUTTER, DISPATCH_PANEL_SELECTION_MARKER, DISPATCH_PANEL_TITLE_WIDTH, DISPATCH_PANEL_TOAST, DISPATCH_PANEL_WIDE_MIN_WIDTH, DISPATCH_RUNNING_CEILING, GIT_ARROW_DOWN, GIT_ARROW_UP, GIT_CHANGES_DEBOUNCE_MS, GIT_CLI_DEBOUNCE_MS, GIT_CLI_MAX_BUFFER, GIT_CLI_MIN_INTERVAL_MS, GIT_CLI_TIMEOUT_MS, HEADER_MAX_WIDTH, MODEL_USAGE_COST_WIDTH, MODEL_USAGE_DEBOUNCE_MS, MODEL_USAGE_MESSAGE_LIMIT, MODEL_USAGE_MODEL_WIDTH, MODEL_USAGE_SESSION_LIMIT, MODEL_USAGE_TOKEN_WIDTH, MODEL_USAGE_VISIBLE_CEILING, PRESET_MARKER, SIDEBAR_REFRESH_EVENTS, SIDEBAR_WAITING_LABEL, SPEND_30D_LABEL, SPEND_30D_MS, SPEND_LINE_SEPARATOR, SPEND_PROBE_TOLERANCE_MS, SPEND_PROBE_WINDOW_MS, SPEND_REFRESH_DEBOUNCE_MS, SPEND_TODAY_LABEL, TODO_TEXT_WIDTH, TODO_VISIBLE_CEILING, UNKNOWN_AGENT, agentKey, buildDispatchBlock, cacheHitPercent, ceilingModelUsage, ceilingTodoItems, cellWidth, childAgentRowText, classifyDispatchKind, collectChildAgentUsage, collectDispatch, collectModelUsage, collectSubagentCalls, collectWarmupTargets, completedSummaryText, computeContextUsage, contextBar, contextBarFilled, contextBlockRows, contextPerformanceLine, contextProgressColor, contextSpendLine, contextSpendLines, contextUsageTone, countGitChanges, countSessionCompactions, countToolCalls, countUserTurns, createDispatchPanelModel, createFooterModel, createSidebarModel, plugin as default, defaultGitExec, delegationStateFromOutcome, delegationStateFromStatus, detectDelegationCompletions, dispatchAgentText, dispatchElapsed, dispatchHeaderSummary, dispatchKindFromAgent, dispatchKindFromPrefix, dispatchKindSuffix, dispatchModelText, dispatchPanelCell, dispatchPanelDetail, dispatchPanelFooter, dispatchPanelHeader, dispatchPanelKeymapLayer, dispatchPanelLayout, dispatchPanelMarker, dispatchPanelRangeText, dispatchPanelRowText, dispatchPanelRows, dispatchPanelRule, dispatchPanelTitle, dispatchPanelWindow, dispatchTokenLine, dispatchTokens, dispatchTotalCost, extractCompactionInfo, extractTokenAnatomy, failedSuffixText, formatCompactionBadge, formatContextWindow, formatDispatchCost, formatDispatchDuration, formatGitChanges, formatGitSnapshot, formatSpendUSD, formatSpent, formatTokenAnatomyLine, formatTokenAnatomySplit, formatTokenCount, formatToolCallLine, formatTurnCostLine, formatTurnCostUSD, formatTurnsBadge, formatUsageCost, formatUsageTokens, gitProbeAllowed, hiddenChildAgentsText, hiddenModelUsageText, hiddenTodoText, isTodoStatus, isValidSessionID, lastAssistantWithTokens, latestTodoItems, latestTurnCost, messageTokensTotal, modelRefID, modelUsageRowLines, modelUsageRowText, modelUsageRows, navigateToSession, openDispatchPanel, orderDispatchEntries, orderTodoItems, padCell, parseGitAheadBehind, parseGitStatusPorcelain, parsePresetOverrides, parseTodoItems, performDispatchPanelAction, presetFromEnv, presetHeaderLine, providerIDFromModels, providerIDFromRef, readGitSnapshot, resetSpendUnit, resolveActiveModelRef, resolveActivePresetForTui, resolveContextLimit, resolveGateStatus, resolveModelContextSnapshot, resolvedSpendUnit, runDispatchPanelCommand, runningChildRowText, shortModelID, shortSessionID, sidebarMoneyLines, sidebarPlaceholder, sidebarTextLines, spendWindows, spinnerFrame, startOfLocalDay, statsCost, statsRangeMatches, toDelegationView, toDispatchEntry, todoRowText, todoTone, transcriptWindow, truncateLabel, turnTokensPerSecond, withBlockSpacers };
|
|
8171
9063
|
|
|
8172
9064
|
//# sourceMappingURL=tui.js.map
|