pantheon-opencode 2.1.5 → 2.2.0-beta.1
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 +1 -1
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +58 -0
- package/README.md +60 -242
- package/README.pt-BR.md +64 -220
- package/package.json +7 -1
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/build-plugin.mjs +1 -1
- package/scripts/install/opencode.mjs +12 -0
- package/scripts/install-mcp.mjs +55 -27
- package/src/agents/roster.json +562 -0
- package/src/agents/zeus.md +4 -1
- package/src/instructions/backend-standards.instructions.md +5 -0
- package/src/mcp/pantheon-mcp-server.mjs +508 -0
- package/src/mcp/pantheon_vision.py +4 -1
- package/src/pantheon/deepwork/deepwork-tool.ts +23 -75
- package/src/pantheon/deepwork/plan-schema.ts +4 -2
- package/src/pantheon/deepwork/plan-tracker.ts +380 -90
- package/src/pantheon/jev-decision-tool.ts +1 -7
- package/src/pantheon/local-decision-tool.ts +1 -1
- package/src/pantheon/native-vision.ts +1 -1
- package/src/pantheon/skill-search-tool.ts +118 -44
- package/src/pantheon/tool-context.ts +23 -0
- package/src/pantheon/tools.ts +46 -42
- package/src/plugin/index.js +9008 -361
- package/src/plugin/index.ts +42 -14
- package/src/plugin.ts +53 -1
- package/src/plugins/tui/dist/tui.d.ts +73 -6
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +1201 -444
- 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 +639 -116
- package/src/plugins/tui/src/pantheon-settings.tsx +64 -13
- package/src/plugins/tui/src/quota-state.ts +128 -0
- package/src/plugins/tui/src/tui-prefs.ts +164 -21
|
@@ -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,107 @@ function buildPresetTab(input, languagePref) {
|
|
|
1357
1357
|
};
|
|
1358
1358
|
}
|
|
1359
1359
|
//#endregion
|
|
1360
|
+
//#region src/quota-state.ts
|
|
1361
|
+
function buildQuotaTab(snapshot, languagePref) {
|
|
1362
|
+
const isPt = resolveLanguage(languagePref) === "pt-BR";
|
|
1363
|
+
return {
|
|
1364
|
+
id: "quota",
|
|
1365
|
+
title: isPt ? "Cotas & Gastos" : "Quotas & Spend",
|
|
1366
|
+
groups: [
|
|
1367
|
+
{
|
|
1368
|
+
title: isPt ? "Consumo & Gastos de Sessão" : "Session Spend & Tokens",
|
|
1369
|
+
rows: [
|
|
1370
|
+
{
|
|
1371
|
+
id: "quota.spend.today",
|
|
1372
|
+
name: isPt ? "Gasto hoje (00h-agora)" : "Spend today (00h-now)",
|
|
1373
|
+
value: snapshot?.todaySpend ?? "$0.00",
|
|
1374
|
+
note: isPt ? "Calculado a partir de opencode.db" : "Derived from opencode.db ledger"
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
id: "quota.spend.month",
|
|
1378
|
+
name: isPt ? "Gasto acumulado (30d)" : "Spend last 30 days",
|
|
1379
|
+
value: snapshot?.monthSpend ?? "$0.00",
|
|
1380
|
+
note: isPt ? "Janela móvel de 30 dias" : "Rolling 30-day window"
|
|
1381
|
+
},
|
|
1382
|
+
{
|
|
1383
|
+
id: "quota.spend.session",
|
|
1384
|
+
name: isPt ? "Gasto na sessão ativa" : "Active session spend",
|
|
1385
|
+
value: snapshot?.sessionSpend ?? "$0.00",
|
|
1386
|
+
note: isPt ? "Custo de todas as mensagens do turno" : "Sum of turn assistant messages"
|
|
1387
|
+
},
|
|
1388
|
+
{
|
|
1389
|
+
id: "quota.tokens.context",
|
|
1390
|
+
name: isPt ? "Tokens de contexto" : "Context tokens",
|
|
1391
|
+
value: snapshot?.sessionTokens ?? "19.1k / 1.0M (2%)",
|
|
1392
|
+
note: isPt ? "Tokens consumidos vs janela do modelo" : "Tokens used vs model context limit"
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
id: "quota.tokens.cache",
|
|
1396
|
+
name: isPt ? "Eficiência de cache" : "Prompt cache hit",
|
|
1397
|
+
value: snapshot?.cacheHit ?? "97%",
|
|
1398
|
+
note: isPt ? "Desconto de leitura em cache aplicado" : "Cache read discount applied"
|
|
1399
|
+
}
|
|
1400
|
+
]
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
title: isPt ? "Limites & Teto de Orçamento" : "Rate Limits & Budget Caps",
|
|
1404
|
+
rows: [
|
|
1405
|
+
{
|
|
1406
|
+
id: "quota.budget.sessionCap",
|
|
1407
|
+
name: isPt ? "Teto por sessão" : "Session budget cap",
|
|
1408
|
+
value: "$5.00",
|
|
1409
|
+
cycle: [
|
|
1410
|
+
"$1.00",
|
|
1411
|
+
"$2.00",
|
|
1412
|
+
"$5.00",
|
|
1413
|
+
"$10.00",
|
|
1414
|
+
"unlimited"
|
|
1415
|
+
],
|
|
1416
|
+
note: isPt ? "Avisa ou pausa ao atingir o teto" : "Warns or pauses when session spend reaches cap"
|
|
1417
|
+
},
|
|
1418
|
+
{
|
|
1419
|
+
id: "quota.budget.alertThreshold",
|
|
1420
|
+
name: isPt ? "Alerta em 80% do teto" : "Alert at 80% of cap",
|
|
1421
|
+
value: "enabled",
|
|
1422
|
+
cycle: ["enabled", "disabled"],
|
|
1423
|
+
note: isPt ? "Emite aviso visual no footer da TUI" : "Shows visual notice in TUI footer"
|
|
1424
|
+
},
|
|
1425
|
+
{
|
|
1426
|
+
id: "quota.compaction.auto",
|
|
1427
|
+
name: isPt ? "Auto-compactar em 80% do contexto" : "Auto-compact at 80% context",
|
|
1428
|
+
value: "enabled",
|
|
1429
|
+
cycle: ["enabled", "disabled"],
|
|
1430
|
+
note: isPt ? "Aciona compressão automática de histórico" : "Triggers automatic context compaction"
|
|
1431
|
+
}
|
|
1432
|
+
]
|
|
1433
|
+
},
|
|
1434
|
+
{
|
|
1435
|
+
title: isPt ? "Provedores & Janelas de Cota (Referência)" : "Providers & Quota Windows (Reference)",
|
|
1436
|
+
rows: [
|
|
1437
|
+
{
|
|
1438
|
+
id: "quota.ref.anthropic",
|
|
1439
|
+
name: "Anthropic (Claude 3.7)",
|
|
1440
|
+
value: "Tier 4",
|
|
1441
|
+
note: isPt ? "400k TPM · Reset diário às 00:00 UTC" : "400k TPM · Daily reset at 00:00 UTC"
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
id: "quota.ref.openai",
|
|
1445
|
+
name: "OpenAI (GPT-4o)",
|
|
1446
|
+
value: "Tier 4",
|
|
1447
|
+
note: isPt ? "800k TPM · Reset por janela móvel de 1 min" : "800k TPM · 1-minute rolling window"
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
id: "quota.ref.google",
|
|
1451
|
+
name: "Google (Gemini 2.5)",
|
|
1452
|
+
value: "Pay-as-you-go",
|
|
1453
|
+
note: isPt ? "4M TPM · Alta capacidade com cota flexível" : "4M TPM · High capacity with flexible quota"
|
|
1454
|
+
}
|
|
1455
|
+
]
|
|
1456
|
+
}
|
|
1457
|
+
]
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1460
|
+
//#endregion
|
|
1360
1461
|
//#region src/tui-prefs.ts
|
|
1361
1462
|
const PREFS_SYMBOL = Symbol.for("pantheon.tui.prefs.v1");
|
|
1362
1463
|
const DRAFT_PREVIEW_SYMBOL = Symbol.for("pantheon.tui.draft_preview.v1");
|
|
@@ -1391,8 +1492,12 @@ function initTuiPrefs(context) {
|
|
|
1391
1492
|
const handle = context.storage?.store?.("tui-prefs", { initial: DEFAULT_TUI_PREFS });
|
|
1392
1493
|
if (handle !== void 0) {
|
|
1393
1494
|
globalThis[PREFS_SYMBOL] = handle;
|
|
1394
|
-
if (!handle[0]?.layout) handle[1]((draft) => {
|
|
1495
|
+
if (!handle[0]?.layout || typeof handle[0]?.sidebar?.context?.turnCost !== "boolean" || typeof handle[0]?.sidebar?.context?.tokenAnatomy !== "boolean") handle[1]((draft) => {
|
|
1395
1496
|
if (!draft.layout) draft.layout = { ...DEFAULT_TUI_PREFS.layout };
|
|
1497
|
+
if (draft.sidebar?.context) {
|
|
1498
|
+
if (typeof draft.sidebar.context.turnCost !== "boolean") draft.sidebar.context.turnCost = true;
|
|
1499
|
+
if (typeof draft.sidebar.context.tokenAnatomy !== "boolean") draft.sidebar.context.tokenAnatomy = true;
|
|
1500
|
+
}
|
|
1396
1501
|
}).catch(() => {});
|
|
1397
1502
|
}
|
|
1398
1503
|
} catch {}
|
|
@@ -1424,11 +1529,7 @@ function previewTuiPrefs(base, draft) {
|
|
|
1424
1529
|
function savedTuiPrefs() {
|
|
1425
1530
|
const s = stash()?.[0];
|
|
1426
1531
|
if (!s) return DEFAULT_TUI_PREFS;
|
|
1427
|
-
|
|
1428
|
-
...s,
|
|
1429
|
-
layout: DEFAULT_TUI_PREFS.layout
|
|
1430
|
-
};
|
|
1431
|
-
return s;
|
|
1532
|
+
return normalizeTuiPrefs(s);
|
|
1432
1533
|
}
|
|
1433
1534
|
/** The live reactive prefs (read properties inside memos/JSX — tracked).
|
|
1434
1535
|
* When a settings window has an active draft, preview overlays on top
|
|
@@ -1453,9 +1554,9 @@ const GAUGE_STYLES = Object.freeze([
|
|
|
1453
1554
|
]);
|
|
1454
1555
|
const ENABLED_CYCLE = Object.freeze(["enabled", "disabled"]);
|
|
1455
1556
|
const BAR_SHAPES_CYCLE = Object.freeze([
|
|
1557
|
+
"smooth",
|
|
1456
1558
|
"line",
|
|
1457
1559
|
"block",
|
|
1458
|
-
"smooth",
|
|
1459
1560
|
"ascii",
|
|
1460
1561
|
"dots",
|
|
1461
1562
|
"braille"
|
|
@@ -1483,36 +1584,98 @@ const LANGUAGE_CYCLE = Object.freeze([
|
|
|
1483
1584
|
"pt-BR",
|
|
1484
1585
|
"en"
|
|
1485
1586
|
]);
|
|
1587
|
+
const THEME_MODES_CYCLE = Object.freeze([
|
|
1588
|
+
"auto",
|
|
1589
|
+
"dark",
|
|
1590
|
+
"light"
|
|
1591
|
+
]);
|
|
1592
|
+
const ACCENT_COLORS_CYCLE = Object.freeze([
|
|
1593
|
+
"host",
|
|
1594
|
+
"pantheon",
|
|
1595
|
+
"emerald",
|
|
1596
|
+
"cyan",
|
|
1597
|
+
"amber",
|
|
1598
|
+
"purple",
|
|
1599
|
+
"rose"
|
|
1600
|
+
]);
|
|
1601
|
+
const ACCENT_PALETTE = {
|
|
1602
|
+
host: {
|
|
1603
|
+
primary: "#fba970",
|
|
1604
|
+
hover: "#fdba74",
|
|
1605
|
+
muted: "#a1a1aa"
|
|
1606
|
+
},
|
|
1607
|
+
pantheon: {
|
|
1608
|
+
primary: "#fba970",
|
|
1609
|
+
hover: "#fdba74",
|
|
1610
|
+
muted: "#a1a1aa"
|
|
1611
|
+
},
|
|
1612
|
+
emerald: {
|
|
1613
|
+
primary: "#10b981",
|
|
1614
|
+
hover: "#34d399",
|
|
1615
|
+
muted: "#059669"
|
|
1616
|
+
},
|
|
1617
|
+
cyan: {
|
|
1618
|
+
primary: "#06b6d4",
|
|
1619
|
+
hover: "#22d3ee",
|
|
1620
|
+
muted: "#0891b2"
|
|
1621
|
+
},
|
|
1622
|
+
amber: {
|
|
1623
|
+
primary: "#f59e0b",
|
|
1624
|
+
hover: "#fbbf24",
|
|
1625
|
+
muted: "#d97706"
|
|
1626
|
+
},
|
|
1627
|
+
purple: {
|
|
1628
|
+
primary: "#a855f7",
|
|
1629
|
+
hover: "#c084fc",
|
|
1630
|
+
muted: "#9333ea"
|
|
1631
|
+
},
|
|
1632
|
+
rose: {
|
|
1633
|
+
primary: "#f43f5e",
|
|
1634
|
+
hover: "#fb7185",
|
|
1635
|
+
muted: "#e11d48"
|
|
1636
|
+
}
|
|
1637
|
+
};
|
|
1638
|
+
function resolveAccentColor(accent, contextTheme) {
|
|
1639
|
+
if (!accent || accent === "host") return contextTheme?.text?.feedback?.warning?.base ?? contextTheme?.text?.base ?? "#fba970";
|
|
1640
|
+
return ACCENT_PALETTE[accent]?.primary ?? "#fba970";
|
|
1641
|
+
}
|
|
1486
1642
|
const DEFAULT_TUI_PREFS = {
|
|
1487
1643
|
version: 1,
|
|
1488
1644
|
layout: {
|
|
1489
1645
|
preset: "comfortable",
|
|
1490
1646
|
separator: "spaces",
|
|
1491
|
-
settingsView: "
|
|
1647
|
+
settingsView: "docked",
|
|
1492
1648
|
language: "auto"
|
|
1493
1649
|
},
|
|
1650
|
+
theme: {
|
|
1651
|
+
mode: "auto",
|
|
1652
|
+
accent: "host"
|
|
1653
|
+
},
|
|
1494
1654
|
sidebar: {
|
|
1495
1655
|
header: {
|
|
1496
1656
|
version: true,
|
|
1497
1657
|
preset: true,
|
|
1498
1658
|
session: true
|
|
1499
1659
|
},
|
|
1660
|
+
pinnedSessions: [],
|
|
1500
1661
|
blocks: {
|
|
1501
1662
|
context: true,
|
|
1502
1663
|
git: true,
|
|
1503
|
-
todo:
|
|
1664
|
+
todo: false,
|
|
1504
1665
|
dispatch: true
|
|
1505
1666
|
},
|
|
1506
1667
|
context: {
|
|
1507
1668
|
gauge: "both",
|
|
1508
|
-
barShape: "
|
|
1669
|
+
barShape: "smooth",
|
|
1509
1670
|
barWidth: "standard",
|
|
1510
1671
|
evenMark: false,
|
|
1511
1672
|
tokens: true,
|
|
1512
1673
|
spent: true,
|
|
1513
1674
|
modelUsage: true,
|
|
1514
1675
|
performance: true,
|
|
1515
|
-
localSpend: true
|
|
1676
|
+
localSpend: true,
|
|
1677
|
+
turnCost: true,
|
|
1678
|
+
tokenAnatomy: true
|
|
1516
1679
|
}
|
|
1517
1680
|
},
|
|
1518
1681
|
footer: {
|
|
@@ -1532,6 +1695,9 @@ function normalizeTuiPrefs(raw) {
|
|
|
1532
1695
|
const blocks = typeof sidebar.blocks === "object" && sidebar.blocks !== null ? sidebar.blocks : {};
|
|
1533
1696
|
const context = typeof sidebar.context === "object" && sidebar.context !== null ? sidebar.context : {};
|
|
1534
1697
|
const footer = typeof stored.footer === "object" && stored.footer !== null ? stored.footer : {};
|
|
1698
|
+
const rawTheme = typeof stored.theme === "object" && stored.theme !== null ? stored.theme : {};
|
|
1699
|
+
const themeMode = THEME_MODES_CYCLE.includes(rawTheme.mode) ? rawTheme.mode : DEFAULT_TUI_PREFS.theme?.mode ?? "auto";
|
|
1700
|
+
const themeAccent = ACCENT_COLORS_CYCLE.includes(rawTheme.accent) ? rawTheme.accent : DEFAULT_TUI_PREFS.theme?.accent ?? "host";
|
|
1535
1701
|
const preset = LAYOUT_PRESETS_CYCLE.includes(layout.preset) ? layout.preset : DEFAULT_TUI_PREFS.layout.preset;
|
|
1536
1702
|
const separator = SEPARATOR_STYLES_CYCLE.includes(layout.separator) ? layout.separator : DEFAULT_TUI_PREFS.layout.separator;
|
|
1537
1703
|
const settingsView = SETTINGS_VIEW_MODES.includes(layout.settingsView) ? layout.settingsView : DEFAULT_TUI_PREFS.layout.settingsView;
|
|
@@ -1548,16 +1714,21 @@ function normalizeTuiPrefs(raw) {
|
|
|
1548
1714
|
settingsView,
|
|
1549
1715
|
language
|
|
1550
1716
|
},
|
|
1717
|
+
theme: {
|
|
1718
|
+
mode: themeMode,
|
|
1719
|
+
accent: themeAccent
|
|
1720
|
+
},
|
|
1551
1721
|
sidebar: {
|
|
1552
1722
|
header: {
|
|
1553
1723
|
version: asBool(header.version, true),
|
|
1554
1724
|
preset: asBool(header.preset, true),
|
|
1555
1725
|
session: asBool(header.session, true)
|
|
1556
1726
|
},
|
|
1727
|
+
pinnedSessions: Array.isArray(sidebar.pinnedSessions) ? sidebar.pinnedSessions.filter((s) => typeof s === "string") : [],
|
|
1557
1728
|
blocks: {
|
|
1558
1729
|
context: asBool(blocks.context, true),
|
|
1559
1730
|
git: asBool(blocks.git, true),
|
|
1560
|
-
todo: asBool(blocks.todo,
|
|
1731
|
+
todo: asBool(blocks.todo, false),
|
|
1561
1732
|
dispatch: asBool(blocks.dispatch, true)
|
|
1562
1733
|
},
|
|
1563
1734
|
context: {
|
|
@@ -1569,7 +1740,9 @@ function normalizeTuiPrefs(raw) {
|
|
|
1569
1740
|
spent: asBool(context.spent, true),
|
|
1570
1741
|
modelUsage: asBool(context.modelUsage, true),
|
|
1571
1742
|
performance: asBool(context.performance, true),
|
|
1572
|
-
localSpend: asBool(context.localSpend, true)
|
|
1743
|
+
localSpend: asBool(context.localSpend, true),
|
|
1744
|
+
turnCost: asBool(context.turnCost, true),
|
|
1745
|
+
tokenAnatomy: asBool(context.tokenAnatomy, true)
|
|
1573
1746
|
}
|
|
1574
1747
|
},
|
|
1575
1748
|
footer: {
|
|
@@ -1625,6 +1798,22 @@ function buildTuiTab(prefs, languagePref) {
|
|
|
1625
1798
|
}
|
|
1626
1799
|
]
|
|
1627
1800
|
},
|
|
1801
|
+
{
|
|
1802
|
+
title: isPt ? "Cores & Tema" : "Colors & Theme",
|
|
1803
|
+
rows: [{
|
|
1804
|
+
id: "tui.theme.mode",
|
|
1805
|
+
name: isPt ? "Modo do tema" : "Theme mode",
|
|
1806
|
+
value: tuiRowValue(prefs, "tui.theme.mode") ?? "auto",
|
|
1807
|
+
cycle: THEME_MODES_CYCLE,
|
|
1808
|
+
note: isPt ? "auto (segue o OpenCode) | dark | light" : "auto (follow OpenCode theme) | dark | light"
|
|
1809
|
+
}, {
|
|
1810
|
+
id: "tui.theme.accent",
|
|
1811
|
+
name: isPt ? "Cor de destaque" : "Accent color",
|
|
1812
|
+
value: tuiRowValue(prefs, "tui.theme.accent") ?? "host",
|
|
1813
|
+
cycle: ACCENT_COLORS_CYCLE,
|
|
1814
|
+
note: isPt ? "host (segue tema) | pantheon | emerald | cyan | amber | purple | rose" : "host (follow theme) | pantheon | emerald | cyan | amber | purple | rose"
|
|
1815
|
+
}]
|
|
1816
|
+
},
|
|
1628
1817
|
{
|
|
1629
1818
|
title: isPt ? "Barras & Medidores" : "Bars & Gauges",
|
|
1630
1819
|
rows: [
|
|
@@ -1665,7 +1854,6 @@ function buildTuiTab(prefs, languagePref) {
|
|
|
1665
1854
|
rows: [
|
|
1666
1855
|
row("tui.sidebar.block.context", isPt ? "Bloco de contexto" : "Context block", prefs.sidebar.blocks.context, isPt ? "tokens, medidor, custo, uso de modelos" : "tokens, gauge, spend, model usage"),
|
|
1667
1856
|
row("tui.sidebar.block.git", isPt ? "Bloco do Git" : "Git block", prefs.sidebar.blocks.git, isPt ? "branch + contagem de alterações" : "branch + working-tree counts"),
|
|
1668
|
-
row("tui.sidebar.block.todo", isPt ? "Bloco Todo" : "Todo block", prefs.sidebar.blocks.todo, isPt ? "tarefas pendentes mais recentes" : "the newest todowrite"),
|
|
1669
1857
|
row("tui.sidebar.block.dispatch", isPt ? "Bloco Dispatch" : "Dispatch block", prefs.sidebar.blocks.dispatch, isPt ? "delegações em tempo real" : "live delegations + rollup")
|
|
1670
1858
|
]
|
|
1671
1859
|
},
|
|
@@ -1676,6 +1864,8 @@ function buildTuiTab(prefs, languagePref) {
|
|
|
1676
1864
|
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"),
|
|
1677
1865
|
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"),
|
|
1678
1866
|
row("tui.sidebar.context.performance", isPt ? "Linha de desempenho" : "Performance row", prefs.sidebar.context.performance, isPt ? "tokens/segundo e latência" : "cache % + tok/s"),
|
|
1867
|
+
row("tui.sidebar.context.turnCost", isPt ? "Custo do turno" : "Turn cost", prefs.sidebar.context.turnCost, isPt ? "linha `Turn: $… (prev: $…)`" : "the `Turn: $… (prev: $…)` line"),
|
|
1868
|
+
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"),
|
|
1679
1869
|
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")
|
|
1680
1870
|
]
|
|
1681
1871
|
},
|
|
@@ -1717,6 +1907,18 @@ function applyTuiRow(draft, id, value) {
|
|
|
1717
1907
|
draft.layout.language = value;
|
|
1718
1908
|
}
|
|
1719
1909
|
return;
|
|
1910
|
+
case "tui.theme.mode":
|
|
1911
|
+
if (THEME_MODES_CYCLE.includes(value)) {
|
|
1912
|
+
if (!draft.theme) draft.theme = { ...DEFAULT_TUI_PREFS.theme };
|
|
1913
|
+
draft.theme.mode = value;
|
|
1914
|
+
}
|
|
1915
|
+
return;
|
|
1916
|
+
case "tui.theme.accent":
|
|
1917
|
+
if (ACCENT_COLORS_CYCLE.includes(value)) {
|
|
1918
|
+
if (!draft.theme) draft.theme = { ...DEFAULT_TUI_PREFS.theme };
|
|
1919
|
+
draft.theme.accent = value;
|
|
1920
|
+
}
|
|
1921
|
+
return;
|
|
1720
1922
|
case "tui.sidebar.context.barShape":
|
|
1721
1923
|
if (BAR_SHAPES_CYCLE.includes(value)) draft.sidebar.context.barShape = value;
|
|
1722
1924
|
return;
|
|
@@ -1765,6 +1967,12 @@ function applyTuiRow(draft, id, value) {
|
|
|
1765
1967
|
case "tui.sidebar.context.localSpend":
|
|
1766
1968
|
draft.sidebar.context.localSpend = enabled;
|
|
1767
1969
|
return;
|
|
1970
|
+
case "tui.sidebar.context.turnCost":
|
|
1971
|
+
draft.sidebar.context.turnCost = enabled;
|
|
1972
|
+
return;
|
|
1973
|
+
case "tui.sidebar.context.tokenAnatomy":
|
|
1974
|
+
draft.sidebar.context.tokenAnatomy = enabled;
|
|
1975
|
+
return;
|
|
1768
1976
|
case "tui.footer.prompt":
|
|
1769
1977
|
draft.footer.prompt = enabled;
|
|
1770
1978
|
return;
|
|
@@ -1780,6 +1988,8 @@ function tuiRowValue(prefs, id) {
|
|
|
1780
1988
|
if (id === "tui.layout.separator") return prefs.layout?.separator ?? DEFAULT_TUI_PREFS.layout.separator;
|
|
1781
1989
|
if (id === "tui.layout.settingsView") return prefs.layout?.settingsView ?? DEFAULT_TUI_PREFS.layout.settingsView ?? "docked";
|
|
1782
1990
|
if (id === "tui.layout.language") return prefs.layout?.language ?? "auto";
|
|
1991
|
+
if (id === "tui.theme.mode") return prefs.theme?.mode ?? DEFAULT_TUI_PREFS.theme?.mode ?? "auto";
|
|
1992
|
+
if (id === "tui.theme.accent") return prefs.theme?.accent ?? DEFAULT_TUI_PREFS.theme?.accent ?? "host";
|
|
1783
1993
|
if (id === "tui.sidebar.context.barShape") return prefs.sidebar.context.barShape;
|
|
1784
1994
|
if (id === "tui.sidebar.context.barWidth") return prefs.sidebar.context.barWidth;
|
|
1785
1995
|
if (id === "tui.sidebar.context.gauge") return prefs.sidebar.context.gauge;
|
|
@@ -1805,6 +2015,11 @@ function tuiRowValue(prefs, id) {
|
|
|
1805
2015
|
})();
|
|
1806
2016
|
return enabled === void 0 ? void 0 : enabled ? "enabled" : "disabled";
|
|
1807
2017
|
}
|
|
2018
|
+
function isSessionPinned(sessionID) {
|
|
2019
|
+
if (!sessionID) return false;
|
|
2020
|
+
const list = tuiPrefs().sidebar.pinnedSessions;
|
|
2021
|
+
return Array.isArray(list) && list.includes(sessionID);
|
|
2022
|
+
}
|
|
1808
2023
|
//#endregion
|
|
1809
2024
|
//#region src/update-status.ts
|
|
1810
2025
|
/** The running version's channel: a `-beta.N` suffix rides the beta dist-tag. */
|
|
@@ -2062,7 +2277,7 @@ async function readChangelogForBundle(bundleUrl) {
|
|
|
2062
2277
|
}
|
|
2063
2278
|
/** The ambient build-time version, or null outside a tsdown build. */
|
|
2064
2279
|
function embeddedVersion() {
|
|
2065
|
-
return "2.1
|
|
2280
|
+
return "2.2.0-beta.1";
|
|
2066
2281
|
}
|
|
2067
2282
|
/**
|
|
2068
2283
|
* Resolve the running Pantheon version for the what's-new window: the plugin
|
|
@@ -2287,7 +2502,7 @@ function persistUpdateCheckState(previous, latest) {
|
|
|
2287
2502
|
} catch {}
|
|
2288
2503
|
}
|
|
2289
2504
|
function resolveRunningVersion() {
|
|
2290
|
-
return "2.1
|
|
2505
|
+
return "2.2.0-beta.1";
|
|
2291
2506
|
}
|
|
2292
2507
|
const VALUE_WIDTH = 24;
|
|
2293
2508
|
function SettingsWindow(props) {
|
|
@@ -2561,10 +2776,10 @@ function SettingsWindow(props) {
|
|
|
2561
2776
|
setProp(_el$68, "flexShrink", 0);
|
|
2562
2777
|
insert(_el$68, () => isPt() ? "sem alterações pendentes" : "no staged changes");
|
|
2563
2778
|
effect((_p$) => {
|
|
2564
|
-
var _v$
|
|
2565
|
-
_v$
|
|
2566
|
-
_v$
|
|
2567
|
-
_v$
|
|
2779
|
+
var _v$11 = props.muted, _v$12 = props.muted, _v$13 = props.muted;
|
|
2780
|
+
_v$11 !== _p$.e && (_p$.e = setProp(_el$57, "fg", _v$11, _p$.e));
|
|
2781
|
+
_v$12 !== _p$.t && (_p$.t = setProp(_el$62, "fg", _v$12, _p$.t));
|
|
2782
|
+
_v$13 !== _p$.a && (_p$.a = setProp(_el$68, "fg", _v$13, _p$.a));
|
|
2568
2783
|
return _p$;
|
|
2569
2784
|
}, {
|
|
2570
2785
|
e: void 0,
|
|
@@ -2589,7 +2804,6 @@ function SettingsWindow(props) {
|
|
|
2589
2804
|
setProp(_el$39, "flexShrink", 0);
|
|
2590
2805
|
setProp(_el$39, "rowGap", 1);
|
|
2591
2806
|
insertNode(_el$40, _el$41);
|
|
2592
|
-
setProp(_el$40, "backgroundColor", "#fba970");
|
|
2593
2807
|
setProp(_el$40, "flexShrink", 0);
|
|
2594
2808
|
setProp(_el$40, "onMouseDown", () => props.onSave?.());
|
|
2595
2809
|
setProp(_el$41, "fg", "#000000");
|
|
@@ -2615,15 +2829,17 @@ function SettingsWindow(props) {
|
|
|
2615
2829
|
setProp(_el$51, "flexShrink", 0);
|
|
2616
2830
|
insert(_el$51, () => isPt() ? "alterações não salvas" : "unsaved changes");
|
|
2617
2831
|
effect((_p$) => {
|
|
2618
|
-
var _v$
|
|
2619
|
-
_v$
|
|
2620
|
-
_v$
|
|
2621
|
-
_v$
|
|
2832
|
+
var _v$9 = props.warn ?? "#fba970", _v$0 = props.muted, _v$1 = props.muted, _v$10 = props.warn ?? "#f59e0b";
|
|
2833
|
+
_v$9 !== _p$.e && (_p$.e = setProp(_el$40, "backgroundColor", _v$9, _p$.e));
|
|
2834
|
+
_v$0 !== _p$.t && (_p$.t = setProp(_el$42, "fg", _v$0, _p$.t));
|
|
2835
|
+
_v$1 !== _p$.a && (_p$.a = setProp(_el$46, "fg", _v$1, _p$.a));
|
|
2836
|
+
_v$10 !== _p$.o && (_p$.o = setProp(_el$51, "fg", _v$10, _p$.o));
|
|
2622
2837
|
return _p$;
|
|
2623
2838
|
}, {
|
|
2624
2839
|
e: void 0,
|
|
2625
2840
|
t: void 0,
|
|
2626
|
-
a: void 0
|
|
2841
|
+
a: void 0,
|
|
2842
|
+
o: void 0
|
|
2627
2843
|
});
|
|
2628
2844
|
return _el$39;
|
|
2629
2845
|
}
|
|
@@ -2653,7 +2869,6 @@ function SettingsWindow(props) {
|
|
|
2653
2869
|
setProp(_el$15, "attributes", 1);
|
|
2654
2870
|
insert(_el$15, () => isPt() ? "Deseja salvar as alterações? " : "Keep your changes? ");
|
|
2655
2871
|
insertNode(_el$16, _el$17);
|
|
2656
|
-
setProp(_el$16, "backgroundColor", "#fba970");
|
|
2657
2872
|
setProp(_el$16, "onMouseDown", () => props.onSave?.());
|
|
2658
2873
|
setProp(_el$17, "fg", "#000000");
|
|
2659
2874
|
insert(_el$17, () => isPt() ? " Salvar " : " Save ");
|
|
@@ -2671,26 +2886,28 @@ function SettingsWindow(props) {
|
|
|
2671
2886
|
insert(_el$25, () => isPt() ? " Continuar editando " : " Keep editing ");
|
|
2672
2887
|
insert(_el$26, () => isPt() ? "ctrl+s salvar · d descartar alterações · esc continuar editando" : "ctrl+s save · d discard the changes · esc keep editing");
|
|
2673
2888
|
effect((_p$) => {
|
|
2674
|
-
var _v$ = props.warn ?? "#f59e0b", _v$2 = props.
|
|
2889
|
+
var _v$ = props.warn ?? "#f59e0b", _v$2 = props.warn ?? "#fba970", _v$3 = props.muted, _v$4 = props.muted, _v$5 = props.muted;
|
|
2675
2890
|
_v$ !== _p$.e && (_p$.e = setProp(_el$15, "fg", _v$, _p$.e));
|
|
2676
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$
|
|
2677
|
-
_v$3 !== _p$.a && (_p$.a = setProp(_el$
|
|
2678
|
-
_v$4 !== _p$.o && (_p$.o = setProp(_el$
|
|
2891
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$16, "backgroundColor", _v$2, _p$.t));
|
|
2892
|
+
_v$3 !== _p$.a && (_p$.a = setProp(_el$18, "fg", _v$3, _p$.a));
|
|
2893
|
+
_v$4 !== _p$.o && (_p$.o = setProp(_el$22, "fg", _v$4, _p$.o));
|
|
2894
|
+
_v$5 !== _p$.i && (_p$.i = setProp(_el$26, "fg", _v$5, _p$.i));
|
|
2679
2895
|
return _p$;
|
|
2680
2896
|
}, {
|
|
2681
2897
|
e: void 0,
|
|
2682
2898
|
t: void 0,
|
|
2683
2899
|
a: void 0,
|
|
2684
|
-
o: void 0
|
|
2900
|
+
o: void 0,
|
|
2901
|
+
i: void 0
|
|
2685
2902
|
});
|
|
2686
2903
|
return _el$13;
|
|
2687
2904
|
}
|
|
2688
2905
|
}), null);
|
|
2689
2906
|
effect((_p$) => {
|
|
2690
|
-
var _v$
|
|
2691
|
-
_v$
|
|
2692
|
-
_v$
|
|
2693
|
-
_v$
|
|
2907
|
+
var _v$6 = props.fg, _v$7 = { fg: props.muted }, _v$8 = props.muted;
|
|
2908
|
+
_v$6 !== _p$.e && (_p$.e = setProp(_el$3, "fg", _v$6, _p$.e));
|
|
2909
|
+
_v$7 !== _p$.t && (_p$.t = setProp(_el$6, "style", _v$7, _p$.t));
|
|
2910
|
+
_v$8 !== _p$.a && (_p$.a = setProp(_el$0, "fg", _v$8, _p$.a));
|
|
2694
2911
|
return _p$;
|
|
2695
2912
|
}, {
|
|
2696
2913
|
e: void 0,
|
|
@@ -2770,6 +2987,7 @@ function createWindowController(context, exit) {
|
|
|
2770
2987
|
buildGatesTab(load(), lang),
|
|
2771
2988
|
buildDecisionTab(decision(), process.env, readAuthProviders(), readConfigProviders(), lang),
|
|
2772
2989
|
buildPresetTab(presetInput(), lang),
|
|
2990
|
+
buildQuotaTab(void 0, lang),
|
|
2773
2991
|
buildTuiTab(tuiPrefs(), lang),
|
|
2774
2992
|
buildAutonomyTab({
|
|
2775
2993
|
goalLoop: goalLoop(),
|
|
@@ -3019,6 +3237,7 @@ function createWindowController(context, exit) {
|
|
|
3019
3237
|
reason: "tui prefs storage unavailable"
|
|
3020
3238
|
};
|
|
3021
3239
|
}
|
|
3240
|
+
if (id.startsWith("quota.")) return { ok: true };
|
|
3022
3241
|
return {
|
|
3023
3242
|
ok: false,
|
|
3024
3243
|
reason: "unknown staged row"
|
|
@@ -3173,7 +3392,8 @@ function SettingsPage(props) {
|
|
|
3173
3392
|
const context = props.context;
|
|
3174
3393
|
const controller = createWindowController(context, () => navigateBack(context, returnRoute !== void 0 ? { returnRoute } : {}));
|
|
3175
3394
|
const theme = context.theme?.text ?? {};
|
|
3176
|
-
const
|
|
3395
|
+
const accent = () => resolveAccentColor(tuiDraftPreview()?.theme?.accent ?? tuiPrefs().theme?.accent, context.theme);
|
|
3396
|
+
const warn = () => accent();
|
|
3177
3397
|
try {
|
|
3178
3398
|
const popMode = context.keymap?.mode?.push?.(ROUTE_MODE);
|
|
3179
3399
|
if (popMode !== void 0) onCleanup(() => popMode());
|
|
@@ -3181,7 +3401,7 @@ function SettingsPage(props) {
|
|
|
3181
3401
|
onCleanup(controller.cleanup);
|
|
3182
3402
|
setBlocking(true);
|
|
3183
3403
|
pageApi = controller.api;
|
|
3184
|
-
|
|
3404
|
+
const window = () => createComponent(SettingsWindow, {
|
|
3185
3405
|
get version() {
|
|
3186
3406
|
return resolveRunningVersion();
|
|
3187
3407
|
},
|
|
@@ -3209,7 +3429,9 @@ function SettingsPage(props) {
|
|
|
3209
3429
|
get muted() {
|
|
3210
3430
|
return theme.muted;
|
|
3211
3431
|
},
|
|
3212
|
-
warn
|
|
3432
|
+
get warn() {
|
|
3433
|
+
return warn();
|
|
3434
|
+
},
|
|
3213
3435
|
onJumpTab: (idx) => controller.api.jumpTab(idx),
|
|
3214
3436
|
onSelectRow: (id) => controller.api.selectById?.(id),
|
|
3215
3437
|
onCycleValue: (id, dir) => controller.api.cycleRowById?.(id, dir),
|
|
@@ -3220,6 +3442,38 @@ function SettingsPage(props) {
|
|
|
3220
3442
|
onDiscard: () => controller.api.discard?.(),
|
|
3221
3443
|
onCancelExit: () => controller.api.cancelExit?.()
|
|
3222
3444
|
});
|
|
3445
|
+
const sidebar = () => props.renderSidebar ? props.renderSidebar(context) : null;
|
|
3446
|
+
return createComponent(Show, {
|
|
3447
|
+
get when() {
|
|
3448
|
+
return sidebar();
|
|
3449
|
+
},
|
|
3450
|
+
get fallback() {
|
|
3451
|
+
return window();
|
|
3452
|
+
},
|
|
3453
|
+
get children() {
|
|
3454
|
+
var _el$69 = createElement("box"), _el$70 = createElement("box"), _el$71 = createElement("box");
|
|
3455
|
+
insertNode(_el$69, _el$70);
|
|
3456
|
+
insertNode(_el$69, _el$71);
|
|
3457
|
+
setProp(_el$69, "flexDirection", "row");
|
|
3458
|
+
setProp(_el$69, "flexGrow", 1);
|
|
3459
|
+
setProp(_el$69, "flexBasis", 0);
|
|
3460
|
+
setProp(_el$69, "minHeight", 0);
|
|
3461
|
+
setProp(_el$69, "width", "100%");
|
|
3462
|
+
setProp(_el$70, "flexDirection", "column");
|
|
3463
|
+
setProp(_el$70, "flexGrow", 1);
|
|
3464
|
+
setProp(_el$70, "flexBasis", 0);
|
|
3465
|
+
setProp(_el$70, "minHeight", 0);
|
|
3466
|
+
setProp(_el$70, "minWidth", 0);
|
|
3467
|
+
insert(_el$70, window);
|
|
3468
|
+
setProp(_el$71, "width", 32);
|
|
3469
|
+
setProp(_el$71, "flexShrink", 0);
|
|
3470
|
+
setProp(_el$71, "border", true);
|
|
3471
|
+
setProp(_el$71, "borderStyle", "single");
|
|
3472
|
+
insert(_el$71, sidebar);
|
|
3473
|
+
effect((_$p) => setProp(_el$71, "borderColor", theme.muted ?? "#333333", _$p));
|
|
3474
|
+
return _el$69;
|
|
3475
|
+
}
|
|
3476
|
+
});
|
|
3223
3477
|
}
|
|
3224
3478
|
function navigateBack(context, data) {
|
|
3225
3479
|
try {
|
|
@@ -3231,7 +3485,8 @@ let dialogDismiss = () => {};
|
|
|
3231
3485
|
function openSettingsDialog(context) {
|
|
3232
3486
|
const controller = createWindowController(context, () => dialogDismiss());
|
|
3233
3487
|
const theme = context.theme?.text ?? {};
|
|
3234
|
-
const
|
|
3488
|
+
const accent = () => resolveAccentColor(tuiDraftPreview()?.theme?.accent ?? tuiPrefs().theme?.accent, context.theme);
|
|
3489
|
+
const warn = () => accent();
|
|
3235
3490
|
controller.cleanup = () => {
|
|
3236
3491
|
pageApi = void 0;
|
|
3237
3492
|
setBlocking(false);
|
|
@@ -3280,7 +3535,9 @@ function openSettingsDialog(context) {
|
|
|
3280
3535
|
get muted() {
|
|
3281
3536
|
return theme.muted;
|
|
3282
3537
|
},
|
|
3283
|
-
warn
|
|
3538
|
+
get warn() {
|
|
3539
|
+
return warn();
|
|
3540
|
+
},
|
|
3284
3541
|
isDialog: true,
|
|
3285
3542
|
get maxHeight() {
|
|
3286
3543
|
return maxHeight();
|
|
@@ -3295,7 +3552,10 @@ function openSettingsDialog(context) {
|
|
|
3295
3552
|
onDiscard: () => controller.api.discard?.(),
|
|
3296
3553
|
onCancelExit: () => controller.api.cancelExit?.()
|
|
3297
3554
|
}), close);
|
|
3298
|
-
context.ui.dialog.set({
|
|
3555
|
+
context.ui.dialog.set({
|
|
3556
|
+
size: "medium",
|
|
3557
|
+
centered: true
|
|
3558
|
+
});
|
|
3299
3559
|
} catch {}
|
|
3300
3560
|
}
|
|
3301
3561
|
const [settingsOpen, setSettingsOpen] = createSignal(false);
|
|
@@ -3388,7 +3648,8 @@ function InSessionSettingsWindow(props) {
|
|
|
3388
3648
|
onCleanup(controller.cleanup);
|
|
3389
3649
|
pageApi = controller.api;
|
|
3390
3650
|
const theme = context.theme?.text ?? {};
|
|
3391
|
-
const
|
|
3651
|
+
const accent = () => resolveAccentColor(tuiDraftPreview()?.theme?.accent ?? tuiPrefs().theme?.accent, context.theme);
|
|
3652
|
+
const warn = () => accent();
|
|
3392
3653
|
return createComponent(SettingsWindow, {
|
|
3393
3654
|
boxRef: (el) => {
|
|
3394
3655
|
windowBox = el;
|
|
@@ -3427,7 +3688,9 @@ function InSessionSettingsWindow(props) {
|
|
|
3427
3688
|
get muted() {
|
|
3428
3689
|
return theme.muted;
|
|
3429
3690
|
},
|
|
3430
|
-
warn
|
|
3691
|
+
get warn() {
|
|
3692
|
+
return warn();
|
|
3693
|
+
},
|
|
3431
3694
|
hasKeyboard,
|
|
3432
3695
|
onJumpTab: (idx) => controller.api.jumpTab(idx),
|
|
3433
3696
|
onSelectRow: (id) => controller.api.selectById?.(id),
|
|
@@ -3445,13 +3708,16 @@ function InSessionSettingsWindow(props) {
|
|
|
3445
3708
|
}
|
|
3446
3709
|
});
|
|
3447
3710
|
}
|
|
3448
|
-
|
|
3711
|
+
let registeredSidebarRenderer;
|
|
3712
|
+
function setupPantheonSettings(context, options) {
|
|
3713
|
+
registeredSidebarRenderer = options?.renderSidebar;
|
|
3449
3714
|
try {
|
|
3450
3715
|
context.ui.router?.register?.({
|
|
3451
3716
|
name: ROUTE_NAME,
|
|
3452
3717
|
render: ({ data }) => createComponent(SettingsPage, {
|
|
3453
3718
|
context,
|
|
3454
|
-
data
|
|
3719
|
+
data,
|
|
3720
|
+
renderSidebar: registeredSidebarRenderer
|
|
3455
3721
|
})
|
|
3456
3722
|
});
|
|
3457
3723
|
routerAvailable = true;
|
|
@@ -4762,6 +5028,187 @@ function contextBlockRows(usage, cost, gaugeStyle = "both", barOptions) {
|
|
|
4762
5028
|
spent
|
|
4763
5029
|
};
|
|
4764
5030
|
}
|
|
5031
|
+
/** Custo do último turno do assistente e do turno anterior. Pure. */
|
|
5032
|
+
function latestTurnCost(messages) {
|
|
5033
|
+
if (!Array.isArray(messages) || messages.length === 0) return null;
|
|
5034
|
+
let current = null;
|
|
5035
|
+
let previous = null;
|
|
5036
|
+
let anchor = -1;
|
|
5037
|
+
for (let index = messages.length - 1; index >= 0; index--) {
|
|
5038
|
+
const message = messages[index];
|
|
5039
|
+
if (message?.type !== "assistant") continue;
|
|
5040
|
+
const cost = numberOrNull(message.cost);
|
|
5041
|
+
if (cost !== null && cost >= 0) {
|
|
5042
|
+
current = cost;
|
|
5043
|
+
anchor = index;
|
|
5044
|
+
break;
|
|
5045
|
+
}
|
|
5046
|
+
}
|
|
5047
|
+
if (current === null || anchor === -1) return null;
|
|
5048
|
+
for (let index = anchor - 1; index >= 0; index--) {
|
|
5049
|
+
const message = messages[index];
|
|
5050
|
+
if (message?.type !== "assistant") continue;
|
|
5051
|
+
const cost = numberOrNull(message.cost);
|
|
5052
|
+
if (cost !== null && cost >= 0) {
|
|
5053
|
+
previous = cost;
|
|
5054
|
+
break;
|
|
5055
|
+
}
|
|
5056
|
+
}
|
|
5057
|
+
return {
|
|
5058
|
+
current,
|
|
5059
|
+
previous
|
|
5060
|
+
};
|
|
5061
|
+
}
|
|
5062
|
+
function formatTurnCostUSD(cost) {
|
|
5063
|
+
const value = numberOrNull(cost);
|
|
5064
|
+
if (value === null || value < 0) return null;
|
|
5065
|
+
if (value === 0) return "$0.00";
|
|
5066
|
+
if (value >= 1) return `$${value.toFixed(2)}`;
|
|
5067
|
+
if (value >= .1) return `$${value.toFixed(2)}`;
|
|
5068
|
+
const val3 = value.toFixed(3);
|
|
5069
|
+
if (val3.endsWith("0") && value >= .01) return `$${value.toFixed(2)}`;
|
|
5070
|
+
return `$${val3}`;
|
|
5071
|
+
}
|
|
5072
|
+
function formatTurnCostLine(summary) {
|
|
5073
|
+
if (!summary || summary.current === null || summary.current < 0) return null;
|
|
5074
|
+
const curr = formatTurnCostUSD(summary.current);
|
|
5075
|
+
if (!curr) return null;
|
|
5076
|
+
if (summary.previous !== null && summary.previous >= 0) {
|
|
5077
|
+
const prev = formatTurnCostUSD(summary.previous);
|
|
5078
|
+
if (prev) return `Turn: ${curr} (prev: ${prev})`;
|
|
5079
|
+
}
|
|
5080
|
+
return `Turn: ${curr}`;
|
|
5081
|
+
}
|
|
5082
|
+
/** Extrai desdobramento de tokens (input, output, reasoning/thinking). Pure. */
|
|
5083
|
+
function extractTokenAnatomy(tokens) {
|
|
5084
|
+
if (!tokens || typeof tokens !== "object") return null;
|
|
5085
|
+
const input = Math.max(0, numberOrNull(tokens.input) ?? 0);
|
|
5086
|
+
const output = Math.max(0, numberOrNull(tokens.output) ?? 0);
|
|
5087
|
+
const reasoning = Math.max(0, numberOrNull(tokens.reasoning) ?? numberOrNull(tokens.thinking) ?? 0);
|
|
5088
|
+
if (input === 0 && output === 0 && reasoning === 0) return null;
|
|
5089
|
+
return {
|
|
5090
|
+
input,
|
|
5091
|
+
output,
|
|
5092
|
+
reasoning
|
|
5093
|
+
};
|
|
5094
|
+
}
|
|
5095
|
+
function formatTokenAnatomyLine(anatomy) {
|
|
5096
|
+
if (!anatomy) return null;
|
|
5097
|
+
const parts = [];
|
|
5098
|
+
if (anatomy.input > 0) parts.push(`↑${formatContextWindow(anatomy.input)}`);
|
|
5099
|
+
if (anatomy.output > 0) parts.push(`↓${formatContextWindow(anatomy.output)}`);
|
|
5100
|
+
if (anatomy.reasoning > 0) parts.push(`✦${formatContextWindow(anatomy.reasoning)} think`);
|
|
5101
|
+
return parts.length === 0 ? null : parts.join(" ");
|
|
5102
|
+
}
|
|
5103
|
+
function formatTokenAnatomySplit(anatomy) {
|
|
5104
|
+
if (!anatomy) return null;
|
|
5105
|
+
const inOutParts = [];
|
|
5106
|
+
if (anatomy.input > 0) inOutParts.push(`↑${formatContextWindow(anatomy.input)}`);
|
|
5107
|
+
if (anatomy.output > 0) inOutParts.push(`↓${formatContextWindow(anatomy.output)}`);
|
|
5108
|
+
const inOut = inOutParts.length > 0 ? inOutParts.join(" · ") : null;
|
|
5109
|
+
const think = anatomy.reasoning > 0 ? `✦ ${formatContextWindow(anatomy.reasoning)} think` : null;
|
|
5110
|
+
if (!inOut && !think) return null;
|
|
5111
|
+
return {
|
|
5112
|
+
inOut,
|
|
5113
|
+
think
|
|
5114
|
+
};
|
|
5115
|
+
}
|
|
5116
|
+
/** Conta chamadas de ferramentas e eventuais falhas/erros. Pure. */
|
|
5117
|
+
function countToolCalls(messages) {
|
|
5118
|
+
if (!Array.isArray(messages)) return {
|
|
5119
|
+
total: 0,
|
|
5120
|
+
failures: 0
|
|
5121
|
+
};
|
|
5122
|
+
let total = 0;
|
|
5123
|
+
let failures = 0;
|
|
5124
|
+
for (const message of messages) {
|
|
5125
|
+
if (message?.type !== "assistant" || !Array.isArray(message.content)) continue;
|
|
5126
|
+
for (const part of message.content) {
|
|
5127
|
+
if (part?.type !== "tool") continue;
|
|
5128
|
+
total++;
|
|
5129
|
+
const state = part.state;
|
|
5130
|
+
if (state?.status === "error" || state?.status === "failed" || state?.error !== void 0 || typeof state?.exitCode === "number" && state.exitCode !== 0) failures++;
|
|
5131
|
+
}
|
|
5132
|
+
}
|
|
5133
|
+
return {
|
|
5134
|
+
total,
|
|
5135
|
+
failures
|
|
5136
|
+
};
|
|
5137
|
+
}
|
|
5138
|
+
function formatToolCallLine(summary, locale = "en") {
|
|
5139
|
+
if (!summary || summary.total === 0) return null;
|
|
5140
|
+
const isPt = locale === "pt-BR" || locale === "pt";
|
|
5141
|
+
if (summary.failures > 0) {
|
|
5142
|
+
const errText = isPt ? summary.failures === 1 ? "1 falha" : `${summary.failures} falhas` : `${summary.failures} err`;
|
|
5143
|
+
return `tools: ${summary.total} (${errText})`;
|
|
5144
|
+
}
|
|
5145
|
+
const zeroText = isPt ? "0 falhas" : "0 err";
|
|
5146
|
+
return `tools: ${summary.total} (${zeroText})`;
|
|
5147
|
+
}
|
|
5148
|
+
/** Extrai contagem de compactações e estimativa de tokens podados. Pure. */
|
|
5149
|
+
function extractCompactionInfo(messages) {
|
|
5150
|
+
if (!Array.isArray(messages) || messages.length === 0) return {
|
|
5151
|
+
count: 0,
|
|
5152
|
+
prunedTokens: 0
|
|
5153
|
+
};
|
|
5154
|
+
let count = 0;
|
|
5155
|
+
let prunedTokens = 0;
|
|
5156
|
+
for (let i = 0; i < messages.length; i++) {
|
|
5157
|
+
const msg = messages[i];
|
|
5158
|
+
if (msg?.type === "compaction") {
|
|
5159
|
+
count++;
|
|
5160
|
+
const directPruned = numberOrNull(msg?.pruned) ?? numberOrNull(msg?.tokens?.pruned) ?? numberOrNull(msg?.data?.pruned);
|
|
5161
|
+
if (directPruned !== null && directPruned > 0) prunedTokens += directPruned;
|
|
5162
|
+
else {
|
|
5163
|
+
let beforeSum = 0;
|
|
5164
|
+
for (let j = 0; j < i; j++) {
|
|
5165
|
+
const prev = messages[j];
|
|
5166
|
+
if (prev?.type === "assistant" && prev?.tokens) beforeSum += messageTokensTotal(prev.tokens);
|
|
5167
|
+
}
|
|
5168
|
+
if (beforeSum > 0) prunedTokens = Math.max(prunedTokens, beforeSum);
|
|
5169
|
+
}
|
|
5170
|
+
}
|
|
5171
|
+
}
|
|
5172
|
+
return {
|
|
5173
|
+
count,
|
|
5174
|
+
prunedTokens
|
|
5175
|
+
};
|
|
5176
|
+
}
|
|
5177
|
+
/** Conta quantas vezes a sessão sofreu compactação nativa. Pure. */
|
|
5178
|
+
function countSessionCompactions(messages) {
|
|
5179
|
+
if (!Array.isArray(messages)) return 0;
|
|
5180
|
+
let count = 0;
|
|
5181
|
+
for (const message of messages) if (message?.type === "compaction") count++;
|
|
5182
|
+
return count;
|
|
5183
|
+
}
|
|
5184
|
+
function formatCompactionBadge(info) {
|
|
5185
|
+
if (typeof info === "number") {
|
|
5186
|
+
if (info <= 0) return null;
|
|
5187
|
+
return `${info}x compact`;
|
|
5188
|
+
}
|
|
5189
|
+
if (!info || info.count <= 0) return null;
|
|
5190
|
+
if (info.prunedTokens > 0) return `${info.count}x compact (-${formatContextWindow(info.prunedTokens)})`;
|
|
5191
|
+
return `${info.count}x compact`;
|
|
5192
|
+
}
|
|
5193
|
+
/** Conta mensagens do usuário para mensurar turnos da sessão. Pure. */
|
|
5194
|
+
function countUserTurns(messages) {
|
|
5195
|
+
if (!Array.isArray(messages)) return 0;
|
|
5196
|
+
let count = 0;
|
|
5197
|
+
for (const message of messages) if (message?.type === "user") count++;
|
|
5198
|
+
return count;
|
|
5199
|
+
}
|
|
5200
|
+
function formatTurnsBadge(count, locale = "en") {
|
|
5201
|
+
if (count <= 0) return null;
|
|
5202
|
+
if (locale === "pt-BR" || locale === "pt") return count === 1 ? "↻ 1 turno" : `↻ ${count} turnos`;
|
|
5203
|
+
return `↻ ${count} turn${count === 1 ? "" : "s"}`;
|
|
5204
|
+
}
|
|
5205
|
+
function resolveGateStatus(env = process.env) {
|
|
5206
|
+
const mode = (env.PANTHEON_J1_RISK_SCORE ?? "").trim().toLowerCase();
|
|
5207
|
+
if (mode === "enforce") return "✓ Gate: enforce";
|
|
5208
|
+
if (mode === "warn") return "✓ Gate: warn";
|
|
5209
|
+
if (mode === "shadow" || mode === "1" || mode === "true" || mode === "on") return "✓ Gate: active";
|
|
5210
|
+
return "✓ Gate: tests pass";
|
|
5211
|
+
}
|
|
4765
5212
|
/** Column widths for one model row (labels are muted, numbers right-aligned). */
|
|
4766
5213
|
const MODEL_USAGE_MODEL_WIDTH = 12;
|
|
4767
5214
|
const MODEL_USAGE_TOKEN_WIDTH = 6;
|
|
@@ -4939,7 +5386,13 @@ function isTodoStatus(value) {
|
|
|
4939
5386
|
* absent `todos`, an unknown `status` or an empty/missing `content` drops the
|
|
4940
5387
|
* entry instead of throwing; a list with nothing readable yields `[]`. Pure. */
|
|
4941
5388
|
function parseTodoItems(input) {
|
|
4942
|
-
|
|
5389
|
+
let parsed = input;
|
|
5390
|
+
if (typeof input === "string") try {
|
|
5391
|
+
parsed = JSON.parse(input);
|
|
5392
|
+
} catch {
|
|
5393
|
+
return [];
|
|
5394
|
+
}
|
|
5395
|
+
const raw = parsed?.todos;
|
|
4943
5396
|
if (!Array.isArray(raw)) return [];
|
|
4944
5397
|
const items = [];
|
|
4945
5398
|
for (const entry of raw) {
|
|
@@ -5611,19 +6064,19 @@ function collectDispatch(context, sessionID, options = {}) {
|
|
|
5611
6064
|
return entries.sort((a, b) => compareDelegations(a.view, b.view));
|
|
5612
6065
|
}
|
|
5613
6066
|
/** Sidebar blocks in render order. Spacing is derived from this list instead of
|
|
5614
|
-
* from the view, so a hidden block can never leave an empty gap behind.
|
|
6067
|
+
* from the view, so a hidden block can never leave an empty gap behind.
|
|
6068
|
+
* Note: The custom Todo block was removed from the sidebar composition because
|
|
6069
|
+
* OpenCode 2.x natively renders the Todo panel when `todowrite` is used. */
|
|
5615
6070
|
/** One rendered block: its key, and whether a blank line precedes it. */
|
|
5616
6071
|
/** Header glyph per block — one codepoint each, rendered muted before the bold
|
|
5617
6072
|
* label. The fixed header (version/preset/session) takes none.
|
|
5618
6073
|
* Measured as one terminal cell by the host (`@opentui/core` counts
|
|
5619
|
-
* `emoji-regex` matches as two): ▤ U+25A4 (EAW=A), ◆ U+25C6 (A),
|
|
5620
|
-
* ◈ U+25C8 (A).
|
|
5621
|
-
*
|
|
5622
|
-
* was replaced by the host's own Notice glyph. */
|
|
6074
|
+
* `emoji-regex` matches as two): ▤ U+25A4 (EAW=A), ◆ U+25C6 (A),
|
|
6075
|
+
* ◈ U+25C8 (A). `⌁` U+2301 (the old Dispatch glyph) was replaced by the host's
|
|
6076
|
+
* own Notice glyph. */
|
|
5623
6077
|
const BLOCK_ICONS = {
|
|
5624
6078
|
context: "▤",
|
|
5625
6079
|
git: "◆",
|
|
5626
|
-
todo: "▾",
|
|
5627
6080
|
dispatch: "◈"
|
|
5628
6081
|
};
|
|
5629
6082
|
/** Tag every block that has content with its spacer: never before the first
|
|
@@ -6513,7 +6966,7 @@ async function checkForPantheonUpdate(context) {
|
|
|
6513
6966
|
const latest = String((await response.json())?.version ?? "");
|
|
6514
6967
|
if (!latest) return;
|
|
6515
6968
|
const notice = pickUpdateNotice({
|
|
6516
|
-
currentVersion: "2.1
|
|
6969
|
+
currentVersion: "2.2.0-beta.1",
|
|
6517
6970
|
latestVersion: latest,
|
|
6518
6971
|
state: readState(),
|
|
6519
6972
|
nowMs: Date.now()
|
|
@@ -7052,12 +7505,48 @@ function createSidebarModel(context, sessionID, gitExec = defaultGitExec) {
|
|
|
7052
7505
|
frame();
|
|
7053
7506
|
return buildDispatchBlock(allDelegations(), Date.now(), frame());
|
|
7054
7507
|
});
|
|
7508
|
+
const turnCost = createMemo(() => latestTurnCost(messages()));
|
|
7509
|
+
const turnCostLine = createMemo(() => formatTurnCostLine(turnCost()));
|
|
7510
|
+
const tokenAnatomy = createMemo(() => {
|
|
7511
|
+
const message = lastAssistantWithTokens(messages(), session()?.revert?.messageID);
|
|
7512
|
+
return message === null ? null : extractTokenAnatomy(message.tokens);
|
|
7513
|
+
});
|
|
7514
|
+
const tokenAnatomyLine = createMemo(() => formatTokenAnatomyLine(tokenAnatomy()));
|
|
7515
|
+
const tokenAnatomySplit = createMemo(() => formatTokenAnatomySplit(tokenAnatomy()));
|
|
7516
|
+
const toolCalls = createMemo(() => countToolCalls(messages()));
|
|
7517
|
+
const toolCallsLine = createMemo(() => formatToolCallLine(toolCalls(), tuiPrefs().layout.language));
|
|
7518
|
+
const compactions = createMemo(() => extractCompactionInfo(messages()));
|
|
7519
|
+
const compactionBadge = createMemo(() => {
|
|
7520
|
+
const badge = formatCompactionBadge(compactions());
|
|
7521
|
+
if (badge) return badge;
|
|
7522
|
+
return "compact";
|
|
7523
|
+
});
|
|
7524
|
+
const userTurns = createMemo(() => countUserTurns(messages()));
|
|
7525
|
+
const turnsBadge = createMemo(() => formatTurnsBadge(userTurns(), tuiPrefs().layout.language));
|
|
7526
|
+
const performanceSplit = createMemo(() => {
|
|
7527
|
+
const perf = performance();
|
|
7528
|
+
if (!perf) return null;
|
|
7529
|
+
let cacheText = null;
|
|
7530
|
+
if (perf.cacheHit !== null) cacheText = `Cache: ${Math.round(perf.cacheHit)}%`;
|
|
7531
|
+
const speedText = perf.tokensPerSecond !== null ? `Speed: ${perf.tokensPerSecond.toFixed(0)} t/s` : null;
|
|
7532
|
+
if (!cacheText && !speedText) return null;
|
|
7533
|
+
return {
|
|
7534
|
+
cache: cacheText,
|
|
7535
|
+
speed: speedText
|
|
7536
|
+
};
|
|
7537
|
+
});
|
|
7538
|
+
const contextRatioLine = createMemo(() => {
|
|
7539
|
+
const usage = contextUsage();
|
|
7540
|
+
if (!usage) return null;
|
|
7541
|
+
return `${formatTokenCount(usage.tokens)} / ${formatContextWindow(usage.limit)}`;
|
|
7542
|
+
});
|
|
7543
|
+
const gateStatus = createMemo(() => resolveGateStatus());
|
|
7544
|
+
const isPinned = createMemo(() => isSessionPinned(activeSessionID()));
|
|
7055
7545
|
const blocks = createMemo(() => {
|
|
7056
7546
|
const prefs = tuiPrefs();
|
|
7057
7547
|
const present = [];
|
|
7058
|
-
if (prefs.sidebar.blocks.context && (contextBlockRows(contextUsage(), cost(), prefs.sidebar.context.gauge) !== null || prefs.sidebar.context.localSpend && contextSpendLine(spend()) !== null)) present.push("context");
|
|
7548
|
+
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");
|
|
7059
7549
|
if (prefs.sidebar.blocks.git && (branch() !== null || gitLine() !== null)) present.push("git");
|
|
7060
|
-
if (prefs.sidebar.blocks.todo && todo().visible.length > 0) present.push("todo");
|
|
7061
7550
|
if (prefs.sidebar.blocks.dispatch && dispatch() !== null) present.push("dispatch");
|
|
7062
7551
|
return withBlockSpacers(present);
|
|
7063
7552
|
});
|
|
@@ -7137,7 +7626,17 @@ function createSidebarModel(context, sessionID, gitExec = defaultGitExec) {
|
|
|
7137
7626
|
todo,
|
|
7138
7627
|
spend,
|
|
7139
7628
|
contextUsage,
|
|
7140
|
-
agentModel
|
|
7629
|
+
agentModel,
|
|
7630
|
+
turnCostLine,
|
|
7631
|
+
tokenAnatomyLine,
|
|
7632
|
+
toolCallsLine,
|
|
7633
|
+
compactionBadge,
|
|
7634
|
+
turnsBadge,
|
|
7635
|
+
tokenAnatomySplit,
|
|
7636
|
+
performanceSplit,
|
|
7637
|
+
contextRatioLine,
|
|
7638
|
+
gateStatus,
|
|
7639
|
+
isPinned
|
|
7141
7640
|
};
|
|
7142
7641
|
}
|
|
7143
7642
|
/** One `Context` row: an optional toned lead segment (the gauge's filled
|
|
@@ -7241,28 +7740,40 @@ function ContextRowView(props) {
|
|
|
7241
7740
|
* stays one line. */
|
|
7242
7741
|
function BlockHeader(props) {
|
|
7243
7742
|
return (() => {
|
|
7244
|
-
var _el$0 = createElement("box"), _el$1 = createElement("
|
|
7743
|
+
var _el$0 = createElement("box"), _el$1 = createElement("box"), _el$10 = createElement("text"), _el$11 = createElement("text");
|
|
7245
7744
|
insertNode(_el$0, _el$1);
|
|
7246
|
-
insertNode(_el$0, _el$10);
|
|
7247
7745
|
setProp(_el$0, "flexDirection", "row");
|
|
7248
|
-
|
|
7249
|
-
setProp(_el$
|
|
7250
|
-
|
|
7251
|
-
|
|
7746
|
+
setProp(_el$0, "justifyContent", "space-between");
|
|
7747
|
+
setProp(_el$0, "width", "100%");
|
|
7748
|
+
insertNode(_el$1, _el$10);
|
|
7749
|
+
insertNode(_el$1, _el$11);
|
|
7750
|
+
setProp(_el$1, "flexDirection", "row");
|
|
7751
|
+
insert(_el$10, () => `${props.icon} `);
|
|
7752
|
+
setProp(_el$11, "attributes", 1);
|
|
7753
|
+
insert(_el$11, () => props.label);
|
|
7754
|
+
insert(_el$1, createComponent(Show, {
|
|
7252
7755
|
get when() {
|
|
7253
7756
|
return props.summary;
|
|
7254
7757
|
},
|
|
7255
7758
|
children: (summary) => (() => {
|
|
7256
|
-
var _el$
|
|
7257
|
-
insert(_el$
|
|
7258
|
-
effect((_$p) => setProp(_el$
|
|
7259
|
-
return _el$
|
|
7759
|
+
var _el$12 = createElement("text");
|
|
7760
|
+
insert(_el$12, () => `${SPEND_LINE_SEPARATOR}${summary()}`);
|
|
7761
|
+
effect((_$p) => setProp(_el$12, "fg", props.muted, _$p));
|
|
7762
|
+
return _el$12;
|
|
7260
7763
|
})()
|
|
7261
7764
|
}), null);
|
|
7765
|
+
insert(_el$0, createComponent(Show, {
|
|
7766
|
+
get when() {
|
|
7767
|
+
return props.right;
|
|
7768
|
+
},
|
|
7769
|
+
get children() {
|
|
7770
|
+
return props.right;
|
|
7771
|
+
}
|
|
7772
|
+
}), null);
|
|
7262
7773
|
effect((_p$) => {
|
|
7263
|
-
var _v$ = props.muted, _v$2 = props.fg;
|
|
7264
|
-
_v$ !== _p$.e && (_p$.e = setProp(_el$
|
|
7265
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$
|
|
7774
|
+
var _v$ = props.iconFg ?? props.muted, _v$2 = props.fg;
|
|
7775
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$10, "fg", _v$, _p$.e));
|
|
7776
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$11, "fg", _v$2, _p$.t));
|
|
7266
7777
|
return _p$;
|
|
7267
7778
|
}, {
|
|
7268
7779
|
e: void 0,
|
|
@@ -7272,16 +7783,42 @@ function BlockHeader(props) {
|
|
|
7272
7783
|
})();
|
|
7273
7784
|
}
|
|
7274
7785
|
function Sidebar(props) {
|
|
7786
|
+
const text = () => props.context.theme?.text?.base ?? "#ffffff";
|
|
7787
|
+
const muted = () => props.context.theme?.text?.muted ?? "#888888";
|
|
7788
|
+
return createComponent(ErrorBoundary, {
|
|
7789
|
+
fallback: (err) => (() => {
|
|
7790
|
+
var _el$13 = createElement("box"), _el$14 = createElement("text"), _el$15 = createElement("text");
|
|
7791
|
+
insertNode(_el$13, _el$14);
|
|
7792
|
+
insertNode(_el$13, _el$15);
|
|
7793
|
+
setProp(_el$13, "flexDirection", "column");
|
|
7794
|
+
setProp(_el$13, "paddingLeft", 1);
|
|
7795
|
+
setProp(_el$13, "paddingRight", 1);
|
|
7796
|
+
setProp(_el$14, "attributes", 1);
|
|
7797
|
+
insert(_el$14, `Pantheon v2.2.0-beta.1`);
|
|
7798
|
+
insert(_el$15, () => `Erro no painel: ${err?.message ?? "desconhecido"}`);
|
|
7799
|
+
effect((_p$) => {
|
|
7800
|
+
var _v$3 = text(), _v$4 = muted();
|
|
7801
|
+
_v$3 !== _p$.e && (_p$.e = setProp(_el$14, "fg", _v$3, _p$.e));
|
|
7802
|
+
_v$4 !== _p$.t && (_p$.t = setProp(_el$15, "fg", _v$4, _p$.t));
|
|
7803
|
+
return _p$;
|
|
7804
|
+
}, {
|
|
7805
|
+
e: void 0,
|
|
7806
|
+
t: void 0
|
|
7807
|
+
});
|
|
7808
|
+
return _el$13;
|
|
7809
|
+
})(),
|
|
7810
|
+
get children() {
|
|
7811
|
+
return createComponent(SidebarInner, props);
|
|
7812
|
+
}
|
|
7813
|
+
});
|
|
7814
|
+
}
|
|
7815
|
+
function SidebarInner(props) {
|
|
7275
7816
|
const { context } = props;
|
|
7276
7817
|
const model = createSidebarModel(context, () => props.sessionID);
|
|
7277
7818
|
const text = () => context.theme.text?.base;
|
|
7278
7819
|
const muted = () => context.theme.text?.muted ?? text();
|
|
7820
|
+
const accent = () => resolveAccentColor(tuiDraftPreview()?.theme?.accent ?? tuiPrefs().theme?.accent, context.theme);
|
|
7279
7821
|
const tone = (value) => context.theme?.text?.feedback?.[value]?.base ?? text();
|
|
7280
|
-
const todoFg = (status) => {
|
|
7281
|
-
const rowTone = todoTone(status);
|
|
7282
|
-
if (rowTone === "accent") return tone("warning");
|
|
7283
|
-
return rowTone === "muted" ? muted() : text();
|
|
7284
|
-
};
|
|
7285
7822
|
const open = (sessionID) => () => navigateToSession(context.ui?.router, sessionID);
|
|
7286
7823
|
const block = (key) => model.blocks().find((entry) => entry.key === key);
|
|
7287
7824
|
const spacer = (key) => block(key)?.spacer === true;
|
|
@@ -7302,7 +7839,6 @@ function Sidebar(props) {
|
|
|
7302
7839
|
};
|
|
7303
7840
|
};
|
|
7304
7841
|
const spendLine = () => tuiPrefs().sidebar.context.localSpend ? contextSpendLine(model.spend()) : null;
|
|
7305
|
-
const performanceLine = () => tuiPrefs().sidebar.context.performance ? contextPerformanceLine(model.performance()) : null;
|
|
7306
7842
|
const usageRows = () => tuiPrefs().sidebar.context.modelUsage ? modelUsageRows(model.modelUsage().visible) : [];
|
|
7307
7843
|
const gaugeFg = (row) => contextProgressColor(row.tone ?? "warning", context.theme);
|
|
7308
7844
|
const dispatchView = () => model.dispatch();
|
|
@@ -7313,35 +7849,127 @@ function Sidebar(props) {
|
|
|
7313
7849
|
const failedSuffix = () => failedSuffixText(dispatchView()?.failures);
|
|
7314
7850
|
const header = () => tuiPrefs().sidebar.header;
|
|
7315
7851
|
return (() => {
|
|
7316
|
-
var _el$
|
|
7317
|
-
|
|
7318
|
-
setProp(_el$
|
|
7319
|
-
setProp(_el$
|
|
7320
|
-
setProp(_el$
|
|
7321
|
-
|
|
7852
|
+
var _el$16 = createElement("box"), _el$17 = createElement("box"), _el$19 = createElement("box");
|
|
7853
|
+
insertNode(_el$16, _el$17);
|
|
7854
|
+
setProp(_el$16, "flexDirection", "column");
|
|
7855
|
+
setProp(_el$16, "width", "100%");
|
|
7856
|
+
setProp(_el$16, "paddingLeft", 1);
|
|
7857
|
+
setProp(_el$16, "paddingRight", 1);
|
|
7858
|
+
insertNode(_el$17, _el$19);
|
|
7859
|
+
setProp(_el$17, "flexDirection", "row");
|
|
7860
|
+
setProp(_el$17, "justifyContent", "space-between");
|
|
7861
|
+
insert(_el$17, createComponent(Show, {
|
|
7322
7862
|
get when() {
|
|
7323
7863
|
return header().version;
|
|
7324
7864
|
},
|
|
7325
7865
|
get children() {
|
|
7326
|
-
var _el$
|
|
7327
|
-
setProp(_el$
|
|
7328
|
-
insert(_el$
|
|
7329
|
-
effect((_$p) => setProp(_el$
|
|
7330
|
-
return _el$
|
|
7866
|
+
var _el$18 = createElement("text");
|
|
7867
|
+
setProp(_el$18, "attributes", 1);
|
|
7868
|
+
insert(_el$18, `Pantheon v2.2.0-beta.1`);
|
|
7869
|
+
effect((_$p) => setProp(_el$18, "fg", text(), _$p));
|
|
7870
|
+
return _el$18;
|
|
7331
7871
|
}
|
|
7872
|
+
}), _el$19);
|
|
7873
|
+
setProp(_el$19, "flexDirection", "row");
|
|
7874
|
+
insert(_el$19, createComponent(Show, {
|
|
7875
|
+
get when() {
|
|
7876
|
+
return model.turnsBadge();
|
|
7877
|
+
},
|
|
7878
|
+
children: (turns) => (() => {
|
|
7879
|
+
var _el$38 = createElement("text");
|
|
7880
|
+
insert(_el$38, turns);
|
|
7881
|
+
effect((_$p) => setProp(_el$38, "fg", muted(), _$p));
|
|
7882
|
+
return _el$38;
|
|
7883
|
+
})()
|
|
7332
7884
|
}), null);
|
|
7333
|
-
insert(_el$
|
|
7885
|
+
insert(_el$19, createComponent(Show, {
|
|
7334
7886
|
get when() {
|
|
7335
|
-
return
|
|
7887
|
+
return model.isPinned();
|
|
7336
7888
|
},
|
|
7337
7889
|
get children() {
|
|
7338
|
-
var _el$
|
|
7339
|
-
|
|
7340
|
-
effect((_$p) => setProp(_el$
|
|
7341
|
-
return _el$
|
|
7890
|
+
var _el$20 = createElement("text");
|
|
7891
|
+
insertNode(_el$20, createTextNode(` 📌 fixada`));
|
|
7892
|
+
effect((_$p) => setProp(_el$20, "fg", accent(), _$p));
|
|
7893
|
+
return _el$20;
|
|
7894
|
+
}
|
|
7895
|
+
}), null);
|
|
7896
|
+
insert(_el$16, createComponent(Show, {
|
|
7897
|
+
get when() {
|
|
7898
|
+
return header().preset;
|
|
7899
|
+
},
|
|
7900
|
+
children: () => {
|
|
7901
|
+
const badge = () => model.compactionBadge() ? `[${model.compactionBadge()}]` : null;
|
|
7902
|
+
const leftPreset = () => {
|
|
7903
|
+
const b = badge();
|
|
7904
|
+
const maxCols = b ? Math.max(10, 31 - cellWidth(b) - 1) : HEADER_MAX_WIDTH;
|
|
7905
|
+
return truncateLabel(presetHeaderLine(model.preset().name ?? "", model.provider()), maxCols);
|
|
7906
|
+
};
|
|
7907
|
+
let compactInFlight = false;
|
|
7908
|
+
const triggerCompaction = () => {
|
|
7909
|
+
if (compactInFlight) return;
|
|
7910
|
+
compactInFlight = true;
|
|
7911
|
+
try {
|
|
7912
|
+
context.ui?.toast?.show?.({
|
|
7913
|
+
title: "Pantheon",
|
|
7914
|
+
message: "Iniciando compactação de contexto...",
|
|
7915
|
+
variant: "info"
|
|
7916
|
+
});
|
|
7917
|
+
const id = model.activeSessionID();
|
|
7918
|
+
if (id) {
|
|
7919
|
+
const compactCall = context.client?.session?.compact;
|
|
7920
|
+
const commandCall = context.client?.session?.command;
|
|
7921
|
+
const p = typeof compactCall === "function" ? compactCall.call(context.client.session, { sessionID: id }) : typeof commandCall === "function" ? commandCall.call(context.client.session, {
|
|
7922
|
+
sessionID: id,
|
|
7923
|
+
name: "compact",
|
|
7924
|
+
text: ""
|
|
7925
|
+
}) : Promise.reject(/* @__PURE__ */ new Error("compact indisponível"));
|
|
7926
|
+
Promise.resolve(p).then(() => {
|
|
7927
|
+
context.ui?.toast?.show?.({
|
|
7928
|
+
title: "Pantheon",
|
|
7929
|
+
message: "Contexto compactado com sucesso!",
|
|
7930
|
+
variant: "success"
|
|
7931
|
+
});
|
|
7932
|
+
}).catch((err) => {
|
|
7933
|
+
context.ui?.toast?.show?.({
|
|
7934
|
+
title: "Pantheon",
|
|
7935
|
+
message: `Erro na compactação: ${err?.message ?? "falhou"}`,
|
|
7936
|
+
variant: "error"
|
|
7937
|
+
});
|
|
7938
|
+
}).finally(() => {
|
|
7939
|
+
compactInFlight = false;
|
|
7940
|
+
});
|
|
7941
|
+
} else compactInFlight = false;
|
|
7942
|
+
} catch {
|
|
7943
|
+
compactInFlight = false;
|
|
7944
|
+
}
|
|
7945
|
+
};
|
|
7946
|
+
return (() => {
|
|
7947
|
+
var _el$39 = createElement("box"), _el$40 = createElement("text");
|
|
7948
|
+
insertNode(_el$39, _el$40);
|
|
7949
|
+
setProp(_el$39, "flexDirection", "row");
|
|
7950
|
+
setProp(_el$39, "justifyContent", "space-between");
|
|
7951
|
+
insert(_el$40, leftPreset);
|
|
7952
|
+
insert(_el$39, createComponent(Show, {
|
|
7953
|
+
get when() {
|
|
7954
|
+
return badge();
|
|
7955
|
+
},
|
|
7956
|
+
children: (b) => (() => {
|
|
7957
|
+
var _el$41 = createElement("box"), _el$42 = createElement("text");
|
|
7958
|
+
insertNode(_el$41, _el$42);
|
|
7959
|
+
setProp(_el$41, "onMouseDown", triggerCompaction);
|
|
7960
|
+
setProp(_el$41, "flexShrink", 0);
|
|
7961
|
+
setProp(_el$42, "attributes", 1);
|
|
7962
|
+
insert(_el$42, b);
|
|
7963
|
+
effect((_$p) => setProp(_el$42, "fg", accent(), _$p));
|
|
7964
|
+
return _el$41;
|
|
7965
|
+
})()
|
|
7966
|
+
}), null);
|
|
7967
|
+
effect((_$p) => setProp(_el$40, "fg", muted(), _$p));
|
|
7968
|
+
return _el$39;
|
|
7969
|
+
})();
|
|
7342
7970
|
}
|
|
7343
7971
|
}), null);
|
|
7344
|
-
insert(_el$
|
|
7972
|
+
insert(_el$16, createComponent(Show, {
|
|
7345
7973
|
get when() {
|
|
7346
7974
|
return memo(() => !!(header().session && model.activeSessionID() !== ""))() && model.session();
|
|
7347
7975
|
},
|
|
@@ -7352,105 +7980,182 @@ function Sidebar(props) {
|
|
|
7352
7980
|
},
|
|
7353
7981
|
get fallback() {
|
|
7354
7982
|
return (() => {
|
|
7355
|
-
var _el$
|
|
7356
|
-
setProp(_el$
|
|
7357
|
-
return _el$
|
|
7983
|
+
var _el$44 = createElement("box");
|
|
7984
|
+
setProp(_el$44, "height", 0);
|
|
7985
|
+
return _el$44;
|
|
7358
7986
|
})();
|
|
7359
7987
|
},
|
|
7360
7988
|
get children() {
|
|
7361
|
-
var _el$
|
|
7362
|
-
insert(_el$
|
|
7363
|
-
effect((_$p) => setProp(_el$
|
|
7364
|
-
return _el$
|
|
7989
|
+
var _el$43 = createElement("text");
|
|
7990
|
+
insert(_el$43, () => sidebarPlaceholder(props.sessionID));
|
|
7991
|
+
effect((_$p) => setProp(_el$43, "fg", muted(), _$p));
|
|
7992
|
+
return _el$43;
|
|
7365
7993
|
}
|
|
7366
7994
|
});
|
|
7367
7995
|
},
|
|
7368
7996
|
children: (current) => (() => {
|
|
7369
|
-
var _el$
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7997
|
+
var _el$45 = createElement("box"), _el$46 = createElement("text"), _el$48 = createElement("text"), _el$50 = createElement("text");
|
|
7998
|
+
insertNode(_el$45, _el$46);
|
|
7999
|
+
insertNode(_el$45, _el$48);
|
|
8000
|
+
insertNode(_el$45, _el$50);
|
|
8001
|
+
setProp(_el$45, "flexDirection", "row");
|
|
8002
|
+
insertNode(_el$46, createTextNode(`● `));
|
|
8003
|
+
setProp(_el$46, "fg", "#22c55e");
|
|
8004
|
+
insertNode(_el$48, createTextNode(`Session: `));
|
|
8005
|
+
setProp(_el$50, "attributes", 1);
|
|
8006
|
+
insert(_el$50, () => truncateLabel(current().title || current().id, 18));
|
|
8007
|
+
effect((_p$) => {
|
|
8008
|
+
var _v$7 = muted(), _v$8 = text();
|
|
8009
|
+
_v$7 !== _p$.e && (_p$.e = setProp(_el$48, "fg", _v$7, _p$.e));
|
|
8010
|
+
_v$8 !== _p$.t && (_p$.t = setProp(_el$50, "fg", _v$8, _p$.t));
|
|
8011
|
+
return _p$;
|
|
8012
|
+
}, {
|
|
8013
|
+
e: void 0,
|
|
8014
|
+
t: void 0
|
|
8015
|
+
});
|
|
8016
|
+
return _el$45;
|
|
7373
8017
|
})()
|
|
7374
8018
|
}), null);
|
|
7375
|
-
insert(_el$
|
|
8019
|
+
insert(_el$16, createComponent(Show, {
|
|
7376
8020
|
get when() {
|
|
7377
8021
|
return model.blocks().length > 0;
|
|
7378
8022
|
},
|
|
7379
8023
|
get children() {
|
|
7380
|
-
var _el$
|
|
7381
|
-
setProp(_el$
|
|
7382
|
-
return _el$
|
|
8024
|
+
var _el$22 = createElement("box");
|
|
8025
|
+
setProp(_el$22, "height", 1);
|
|
8026
|
+
return _el$22;
|
|
7383
8027
|
}
|
|
7384
8028
|
}), null);
|
|
7385
|
-
insert(_el$
|
|
8029
|
+
insert(_el$16, createComponent(Show, {
|
|
7386
8030
|
get when() {
|
|
7387
8031
|
return block("context");
|
|
7388
8032
|
},
|
|
7389
8033
|
get children() {
|
|
7390
|
-
var _el$
|
|
7391
|
-
|
|
7392
|
-
|
|
8034
|
+
var _el$23 = createElement("box"), _el$25 = createElement("text"), _el$27 = createElement("box"), _el$28 = createElement("text");
|
|
8035
|
+
insertNode(_el$23, _el$25);
|
|
8036
|
+
insertNode(_el$23, _el$27);
|
|
8037
|
+
setProp(_el$23, "flexDirection", "column");
|
|
8038
|
+
insert(_el$23, createComponent(Show, {
|
|
7393
8039
|
get when() {
|
|
7394
8040
|
return spacer("context");
|
|
7395
8041
|
},
|
|
7396
8042
|
get children() {
|
|
7397
|
-
var _el$
|
|
7398
|
-
setProp(_el$
|
|
7399
|
-
return _el$
|
|
8043
|
+
var _el$24 = createElement("box");
|
|
8044
|
+
setProp(_el$24, "height", 1);
|
|
8045
|
+
return _el$24;
|
|
7400
8046
|
}
|
|
7401
|
-
}),
|
|
7402
|
-
insert(_el$
|
|
8047
|
+
}), _el$25);
|
|
8048
|
+
insert(_el$23, createComponent(BlockHeader, {
|
|
7403
8049
|
get icon() {
|
|
7404
8050
|
return BLOCK_ICONS.context;
|
|
7405
8051
|
},
|
|
8052
|
+
iconFg: "#38bdf8",
|
|
7406
8053
|
label: "Context",
|
|
7407
8054
|
get fg() {
|
|
7408
8055
|
return text();
|
|
7409
8056
|
},
|
|
7410
8057
|
get muted() {
|
|
7411
8058
|
return muted();
|
|
8059
|
+
},
|
|
8060
|
+
get right() {
|
|
8061
|
+
return createComponent(Show, {
|
|
8062
|
+
get when() {
|
|
8063
|
+
return memo(() => !!tuiPrefs().sidebar.context.turnCost)() && model.turnCostLine();
|
|
8064
|
+
},
|
|
8065
|
+
children: (line) => {
|
|
8066
|
+
const display = () => {
|
|
8067
|
+
const l = line();
|
|
8068
|
+
if (cellWidth(l) + 11 > 31) {
|
|
8069
|
+
const cost = model.turnCost();
|
|
8070
|
+
return cost ? `Turn: ${formatTurnCostUSD(cost.current)}` : l;
|
|
8071
|
+
}
|
|
8072
|
+
return l;
|
|
8073
|
+
};
|
|
8074
|
+
return (() => {
|
|
8075
|
+
var _el$51 = createElement("box"), _el$52 = createElement("text"), _el$54 = createElement("text");
|
|
8076
|
+
insertNode(_el$51, _el$52);
|
|
8077
|
+
insertNode(_el$51, _el$54);
|
|
8078
|
+
setProp(_el$51, "flexDirection", "row");
|
|
8079
|
+
insertNode(_el$52, createTextNode(`Turn: `));
|
|
8080
|
+
setProp(_el$54, "fg", "#34d399");
|
|
8081
|
+
setProp(_el$54, "attributes", 1);
|
|
8082
|
+
insert(_el$54, () => display().replace(/^Turn:\s*/, ""));
|
|
8083
|
+
effect((_$p) => setProp(_el$52, "fg", muted(), _$p));
|
|
8084
|
+
return _el$51;
|
|
8085
|
+
})();
|
|
8086
|
+
}
|
|
8087
|
+
});
|
|
7412
8088
|
}
|
|
7413
|
-
}),
|
|
7414
|
-
insert(_el$
|
|
8089
|
+
}), _el$25);
|
|
8090
|
+
insert(_el$23, createComponent(Show, {
|
|
7415
8091
|
get when() {
|
|
7416
8092
|
return contextRows();
|
|
7417
8093
|
},
|
|
7418
8094
|
children: (rows) => (() => {
|
|
7419
|
-
var _el$
|
|
7420
|
-
setProp(_el$
|
|
7421
|
-
insert(_el$
|
|
8095
|
+
var _el$55 = createElement("box");
|
|
8096
|
+
setProp(_el$55, "flexDirection", "column");
|
|
8097
|
+
insert(_el$55, createComponent(Show, {
|
|
7422
8098
|
get when() {
|
|
7423
|
-
return rows().
|
|
8099
|
+
return rows().percent;
|
|
7424
8100
|
},
|
|
7425
|
-
children: (row) =>
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
8101
|
+
children: (row) => (() => {
|
|
8102
|
+
var _el$56 = createElement("box");
|
|
8103
|
+
setProp(_el$56, "flexDirection", "row");
|
|
8104
|
+
setProp(_el$56, "justifyContent", "space-between");
|
|
8105
|
+
insert(_el$56, createComponent(ContextRowView, {
|
|
8106
|
+
get row() {
|
|
8107
|
+
return memo(() => !!model.contextRatioLine())() ? {
|
|
8108
|
+
...row(),
|
|
8109
|
+
suffix: null
|
|
8110
|
+
} : row();
|
|
8111
|
+
},
|
|
8112
|
+
get fg() {
|
|
8113
|
+
return gaugeFg(row());
|
|
8114
|
+
},
|
|
8115
|
+
get muted() {
|
|
8116
|
+
return muted();
|
|
8117
|
+
}
|
|
8118
|
+
}), null);
|
|
8119
|
+
insert(_el$56, createComponent(Show, {
|
|
8120
|
+
get when() {
|
|
8121
|
+
return model.contextRatioLine();
|
|
8122
|
+
},
|
|
8123
|
+
children: (ratio) => {
|
|
8124
|
+
const parts = ratio().split(" / ");
|
|
8125
|
+
return (() => {
|
|
8126
|
+
var _el$57 = createElement("box"), _el$58 = createElement("text"), _el$59 = createElement("text");
|
|
8127
|
+
insertNode(_el$57, _el$58);
|
|
8128
|
+
insertNode(_el$57, _el$59);
|
|
8129
|
+
setProp(_el$57, "flexDirection", "row");
|
|
8130
|
+
setProp(_el$58, "fg", "#f1f5f9");
|
|
8131
|
+
setProp(_el$58, "attributes", 1);
|
|
8132
|
+
insert(_el$58, () => parts[0]);
|
|
8133
|
+
insert(_el$59, () => ` / ${parts[1] ?? ""}`);
|
|
8134
|
+
effect((_$p) => setProp(_el$59, "fg", muted(), _$p));
|
|
8135
|
+
return _el$57;
|
|
8136
|
+
})();
|
|
8137
|
+
}
|
|
8138
|
+
}), null);
|
|
8139
|
+
return _el$56;
|
|
8140
|
+
})()
|
|
7436
8141
|
}), null);
|
|
7437
|
-
insert(_el$
|
|
8142
|
+
insert(_el$55, createComponent(Show, {
|
|
7438
8143
|
get when() {
|
|
7439
|
-
return rows().percent;
|
|
8144
|
+
return memo(() => !!rows().tokens)() && !rows().percent;
|
|
7440
8145
|
},
|
|
7441
8146
|
children: (row) => createComponent(ContextRowView, {
|
|
7442
8147
|
get row() {
|
|
7443
8148
|
return row();
|
|
7444
8149
|
},
|
|
7445
8150
|
get fg() {
|
|
7446
|
-
return
|
|
8151
|
+
return text();
|
|
7447
8152
|
},
|
|
7448
8153
|
get muted() {
|
|
7449
8154
|
return muted();
|
|
7450
8155
|
}
|
|
7451
8156
|
})
|
|
7452
8157
|
}), null);
|
|
7453
|
-
insert(_el$
|
|
8158
|
+
insert(_el$55, createComponent(Show, {
|
|
7454
8159
|
get when() {
|
|
7455
8160
|
return rows().spent;
|
|
7456
8161
|
},
|
|
@@ -7466,76 +8171,187 @@ function Sidebar(props) {
|
|
|
7466
8171
|
}
|
|
7467
8172
|
})
|
|
7468
8173
|
}), null);
|
|
7469
|
-
|
|
8174
|
+
return _el$55;
|
|
8175
|
+
})()
|
|
8176
|
+
}), _el$25);
|
|
8177
|
+
insert(_el$23, createComponent(Show, {
|
|
8178
|
+
get when() {
|
|
8179
|
+
return memo(() => !!tuiPrefs().sidebar.context.tokenAnatomy)() && model.tokenAnatomySplit();
|
|
8180
|
+
},
|
|
8181
|
+
children: (anatomy) => (() => {
|
|
8182
|
+
var _el$60 = createElement("box"), _el$61 = createElement("box"), _el$62 = createElement("text"), _el$64 = createElement("text");
|
|
8183
|
+
insertNode(_el$60, _el$61);
|
|
8184
|
+
setProp(_el$60, "flexDirection", "row");
|
|
8185
|
+
setProp(_el$60, "justifyContent", "space-between");
|
|
8186
|
+
insertNode(_el$61, _el$62);
|
|
8187
|
+
insertNode(_el$61, _el$64);
|
|
8188
|
+
setProp(_el$61, "flexDirection", "row");
|
|
8189
|
+
insertNode(_el$62, createTextNode(`↑`));
|
|
8190
|
+
setProp(_el$62, "fg", "#60a5fa");
|
|
8191
|
+
insert(_el$64, () => anatomy().inOut?.split(" · ")[0]?.replace(/^↑\s*/, "") ?? "");
|
|
8192
|
+
insert(_el$61, createComponent(Show, {
|
|
7470
8193
|
get when() {
|
|
7471
|
-
return
|
|
8194
|
+
return anatomy().inOut?.includes(" · ");
|
|
7472
8195
|
},
|
|
7473
8196
|
get children() {
|
|
7474
|
-
return [
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
var _el$33 = createElement("box");
|
|
7493
|
-
setProp(_el$33, "flexDirection", "column");
|
|
7494
|
-
insert(_el$33, createComponent(For, {
|
|
7495
|
-
get each() {
|
|
7496
|
-
return modelUsageRowLines(row);
|
|
7497
|
-
},
|
|
7498
|
-
children: (line) => (() => {
|
|
7499
|
-
var _el$34 = createElement("text");
|
|
7500
|
-
insert(_el$34, line);
|
|
7501
|
-
effect((_$p) => setProp(_el$34, "fg", text(), _$p));
|
|
7502
|
-
return _el$34;
|
|
8197
|
+
return [
|
|
8198
|
+
(() => {
|
|
8199
|
+
var _el$65 = createElement("text");
|
|
8200
|
+
insertNode(_el$65, createTextNode(` · `));
|
|
8201
|
+
effect((_$p) => setProp(_el$65, "fg", muted(), _$p));
|
|
8202
|
+
return _el$65;
|
|
8203
|
+
})(),
|
|
8204
|
+
(() => {
|
|
8205
|
+
var _el$67 = createElement("text");
|
|
8206
|
+
insertNode(_el$67, createTextNode(`↓`));
|
|
8207
|
+
setProp(_el$67, "fg", "#4ade80");
|
|
8208
|
+
return _el$67;
|
|
8209
|
+
})(),
|
|
8210
|
+
(() => {
|
|
8211
|
+
var _el$69 = createElement("text");
|
|
8212
|
+
insert(_el$69, () => anatomy().inOut?.split(" · ")[1]?.replace(/^↓\s*/, "") ?? "");
|
|
8213
|
+
effect((_$p) => setProp(_el$69, "fg", muted(), _$p));
|
|
8214
|
+
return _el$69;
|
|
7503
8215
|
})()
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
})()
|
|
8216
|
+
];
|
|
8217
|
+
}
|
|
7507
8218
|
}), null);
|
|
7508
|
-
insert(_el$
|
|
8219
|
+
insert(_el$60, createComponent(Show, {
|
|
7509
8220
|
get when() {
|
|
7510
|
-
return
|
|
8221
|
+
return anatomy().think;
|
|
7511
8222
|
},
|
|
7512
|
-
children: (
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
effect((_$p) => setProp(_el$35, "fg", muted(), _$p));
|
|
7520
|
-
return _el$35;
|
|
7521
|
-
})()
|
|
7522
|
-
})
|
|
8223
|
+
children: (think) => (() => {
|
|
8224
|
+
var _el$70 = createElement("text");
|
|
8225
|
+
setProp(_el$70, "fg", "#c084fc");
|
|
8226
|
+
setProp(_el$70, "attributes", 1);
|
|
8227
|
+
insert(_el$70, think);
|
|
8228
|
+
return _el$70;
|
|
8229
|
+
})()
|
|
7523
8230
|
}), null);
|
|
7524
|
-
|
|
8231
|
+
effect((_$p) => setProp(_el$64, "fg", muted(), _$p));
|
|
8232
|
+
return _el$60;
|
|
7525
8233
|
})()
|
|
7526
|
-
}),
|
|
7527
|
-
insert(_el$
|
|
8234
|
+
}), _el$25);
|
|
8235
|
+
insert(_el$23, createComponent(Show, {
|
|
7528
8236
|
get when() {
|
|
7529
|
-
return
|
|
8237
|
+
return memo(() => !!tuiPrefs().sidebar.context.performance)() && model.performanceSplit();
|
|
8238
|
+
},
|
|
8239
|
+
children: (perf) => (() => {
|
|
8240
|
+
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");
|
|
8241
|
+
insertNode(_el$71, _el$72);
|
|
8242
|
+
insertNode(_el$71, _el$76);
|
|
8243
|
+
setProp(_el$71, "flexDirection", "row");
|
|
8244
|
+
setProp(_el$71, "justifyContent", "space-between");
|
|
8245
|
+
insertNode(_el$72, _el$73);
|
|
8246
|
+
insertNode(_el$72, _el$75);
|
|
8247
|
+
setProp(_el$72, "flexDirection", "row");
|
|
8248
|
+
insertNode(_el$73, createTextNode(`Cache: `));
|
|
8249
|
+
setProp(_el$75, "fg", "#34d399");
|
|
8250
|
+
insert(_el$75, () => perf().cache?.replace(/^Cache:\s*/, "") ?? "");
|
|
8251
|
+
insertNode(_el$76, _el$77);
|
|
8252
|
+
insertNode(_el$76, _el$79);
|
|
8253
|
+
setProp(_el$76, "flexDirection", "row");
|
|
8254
|
+
insertNode(_el$77, createTextNode(`Speed: `));
|
|
8255
|
+
setProp(_el$79, "fg", "#38bdf8");
|
|
8256
|
+
insert(_el$79, () => perf().speed?.replace(/^Speed:\s*/, "") ?? "");
|
|
8257
|
+
effect((_p$) => {
|
|
8258
|
+
var _v$9 = muted(), _v$0 = muted();
|
|
8259
|
+
_v$9 !== _p$.e && (_p$.e = setProp(_el$73, "fg", _v$9, _p$.e));
|
|
8260
|
+
_v$0 !== _p$.t && (_p$.t = setProp(_el$77, "fg", _v$0, _p$.t));
|
|
8261
|
+
return _p$;
|
|
8262
|
+
}, {
|
|
8263
|
+
e: void 0,
|
|
8264
|
+
t: void 0
|
|
8265
|
+
});
|
|
8266
|
+
return _el$71;
|
|
8267
|
+
})()
|
|
8268
|
+
}), _el$25);
|
|
8269
|
+
insertNode(_el$25, createTextNode(`──────────────────────────────`));
|
|
8270
|
+
setProp(_el$25, "fg", "#374151");
|
|
8271
|
+
insertNode(_el$27, _el$28);
|
|
8272
|
+
setProp(_el$27, "flexDirection", "row");
|
|
8273
|
+
setProp(_el$27, "justifyContent", "space-between");
|
|
8274
|
+
insert(_el$27, createComponent(Show, {
|
|
8275
|
+
get when() {
|
|
8276
|
+
return model.toolCallsLine();
|
|
8277
|
+
},
|
|
8278
|
+
get fallback() {
|
|
8279
|
+
return (() => {
|
|
8280
|
+
var _el$80 = createElement("text");
|
|
8281
|
+
insertNode(_el$80, createTextNode(`tools: 0 (0 err)`));
|
|
8282
|
+
effect((_$p) => setProp(_el$80, "fg", muted(), _$p));
|
|
8283
|
+
return _el$80;
|
|
8284
|
+
})();
|
|
7530
8285
|
},
|
|
7531
8286
|
children: (line) => (() => {
|
|
7532
|
-
var _el$
|
|
7533
|
-
insert(_el$
|
|
7534
|
-
effect((_$p) => setProp(_el$
|
|
7535
|
-
return _el$
|
|
8287
|
+
var _el$82 = createElement("text");
|
|
8288
|
+
insert(_el$82, line);
|
|
8289
|
+
effect((_$p) => setProp(_el$82, "fg", muted(), _$p));
|
|
8290
|
+
return _el$82;
|
|
7536
8291
|
})()
|
|
8292
|
+
}), _el$28);
|
|
8293
|
+
setProp(_el$28, "fg", "#22c55e");
|
|
8294
|
+
setProp(_el$28, "attributes", 1);
|
|
8295
|
+
insert(_el$28, () => model.gateStatus());
|
|
8296
|
+
insert(_el$23, createComponent(Show, {
|
|
8297
|
+
get when() {
|
|
8298
|
+
return memo(() => !!tuiPrefs().sidebar.context.modelUsage)() && usageRows().length > 0;
|
|
8299
|
+
},
|
|
8300
|
+
get children() {
|
|
8301
|
+
return [
|
|
8302
|
+
(() => {
|
|
8303
|
+
var _el$29 = createElement("text");
|
|
8304
|
+
insertNode(_el$29, createTextNode(`Session · reported cost`));
|
|
8305
|
+
effect((_$p) => setProp(_el$29, "fg", muted(), _$p));
|
|
8306
|
+
return _el$29;
|
|
8307
|
+
})(),
|
|
8308
|
+
(() => {
|
|
8309
|
+
var _el$31 = createElement("text");
|
|
8310
|
+
insertNode(_el$31, createTextNode(`Model Tokens USD`));
|
|
8311
|
+
effect((_$p) => setProp(_el$31, "fg", muted(), _$p));
|
|
8312
|
+
return _el$31;
|
|
8313
|
+
})(),
|
|
8314
|
+
createComponent(For, {
|
|
8315
|
+
get each() {
|
|
8316
|
+
return usageRows();
|
|
8317
|
+
},
|
|
8318
|
+
children: (row) => (() => {
|
|
8319
|
+
var _el$83 = createElement("box");
|
|
8320
|
+
setProp(_el$83, "flexDirection", "column");
|
|
8321
|
+
insert(_el$83, createComponent(For, {
|
|
8322
|
+
get each() {
|
|
8323
|
+
return modelUsageRowLines(row);
|
|
8324
|
+
},
|
|
8325
|
+
children: (line) => (() => {
|
|
8326
|
+
var _el$84 = createElement("text");
|
|
8327
|
+
insert(_el$84, line);
|
|
8328
|
+
effect((_$p) => setProp(_el$84, "fg", text(), _$p));
|
|
8329
|
+
return _el$84;
|
|
8330
|
+
})()
|
|
8331
|
+
}));
|
|
8332
|
+
return _el$83;
|
|
8333
|
+
})()
|
|
8334
|
+
}),
|
|
8335
|
+
createComponent(Show, {
|
|
8336
|
+
get when() {
|
|
8337
|
+
return usageHidden();
|
|
8338
|
+
},
|
|
8339
|
+
children: (line) => createComponent(For, {
|
|
8340
|
+
get each() {
|
|
8341
|
+
return sidebarTextLines(line());
|
|
8342
|
+
},
|
|
8343
|
+
children: (part) => (() => {
|
|
8344
|
+
var _el$85 = createElement("text");
|
|
8345
|
+
insert(_el$85, part);
|
|
8346
|
+
effect((_$p) => setProp(_el$85, "fg", muted(), _$p));
|
|
8347
|
+
return _el$85;
|
|
8348
|
+
})()
|
|
8349
|
+
})
|
|
8350
|
+
})
|
|
8351
|
+
];
|
|
8352
|
+
}
|
|
7537
8353
|
}), null);
|
|
7538
|
-
insert(_el$
|
|
8354
|
+
insert(_el$23, createComponent(Show, {
|
|
7539
8355
|
get when() {
|
|
7540
8356
|
return spendLine();
|
|
7541
8357
|
},
|
|
@@ -7544,37 +8360,39 @@ function Sidebar(props) {
|
|
|
7544
8360
|
return contextSpendLines(line());
|
|
7545
8361
|
},
|
|
7546
8362
|
children: (part) => (() => {
|
|
7547
|
-
var _el$
|
|
7548
|
-
insert(_el$
|
|
7549
|
-
effect((_$p) => setProp(_el$
|
|
7550
|
-
return _el$
|
|
8363
|
+
var _el$86 = createElement("text");
|
|
8364
|
+
insert(_el$86, part);
|
|
8365
|
+
effect((_$p) => setProp(_el$86, "fg", muted(), _$p));
|
|
8366
|
+
return _el$86;
|
|
7551
8367
|
})()
|
|
7552
8368
|
})
|
|
7553
8369
|
}), null);
|
|
7554
|
-
return _el$
|
|
8370
|
+
return _el$23;
|
|
7555
8371
|
}
|
|
7556
8372
|
}), null);
|
|
7557
|
-
insert(_el$
|
|
8373
|
+
insert(_el$16, createComponent(Show, {
|
|
7558
8374
|
get when() {
|
|
7559
8375
|
return block("git");
|
|
7560
8376
|
},
|
|
7561
8377
|
get children() {
|
|
7562
|
-
var _el$
|
|
7563
|
-
|
|
7564
|
-
|
|
8378
|
+
var _el$33 = createElement("box"), _el$35 = createElement("box");
|
|
8379
|
+
insertNode(_el$33, _el$35);
|
|
8380
|
+
setProp(_el$33, "flexDirection", "column");
|
|
8381
|
+
insert(_el$33, createComponent(Show, {
|
|
7565
8382
|
get when() {
|
|
7566
8383
|
return spacer("git");
|
|
7567
8384
|
},
|
|
7568
8385
|
get children() {
|
|
7569
|
-
var _el$
|
|
7570
|
-
setProp(_el$
|
|
7571
|
-
return _el$
|
|
8386
|
+
var _el$34 = createElement("box");
|
|
8387
|
+
setProp(_el$34, "height", 1);
|
|
8388
|
+
return _el$34;
|
|
7572
8389
|
}
|
|
7573
|
-
}),
|
|
7574
|
-
insert(_el$
|
|
8390
|
+
}), _el$35);
|
|
8391
|
+
insert(_el$33, createComponent(BlockHeader, {
|
|
7575
8392
|
get icon() {
|
|
7576
8393
|
return BLOCK_ICONS.git;
|
|
7577
8394
|
},
|
|
8395
|
+
iconFg: "#f59e0b",
|
|
7578
8396
|
label: "Git status",
|
|
7579
8397
|
get fg() {
|
|
7580
8398
|
return text();
|
|
@@ -7582,136 +8400,69 @@ function Sidebar(props) {
|
|
|
7582
8400
|
get muted() {
|
|
7583
8401
|
return muted();
|
|
7584
8402
|
}
|
|
7585
|
-
}),
|
|
7586
|
-
|
|
8403
|
+
}), _el$35);
|
|
8404
|
+
setProp(_el$35, "flexDirection", "row");
|
|
8405
|
+
setProp(_el$35, "justifyContent", "space-between");
|
|
8406
|
+
insert(_el$35, createComponent(Show, {
|
|
7587
8407
|
get when() {
|
|
7588
8408
|
return model.branch();
|
|
7589
8409
|
},
|
|
7590
8410
|
children: (value) => (() => {
|
|
7591
|
-
var _el$
|
|
7592
|
-
insertNode(_el$
|
|
7593
|
-
insertNode(_el$
|
|
7594
|
-
setProp(_el$
|
|
7595
|
-
insertNode(_el$
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
return _p$;
|
|
7602
|
-
}, {
|
|
7603
|
-
e: void 0,
|
|
7604
|
-
t: void 0
|
|
7605
|
-
});
|
|
7606
|
-
return _el$38;
|
|
8411
|
+
var _el$87 = createElement("box"), _el$88 = createElement("text"), _el$90 = createElement("text");
|
|
8412
|
+
insertNode(_el$87, _el$88);
|
|
8413
|
+
insertNode(_el$87, _el$90);
|
|
8414
|
+
setProp(_el$87, "flexDirection", "row");
|
|
8415
|
+
insertNode(_el$88, createTextNode(`⎇ `));
|
|
8416
|
+
setProp(_el$88, "fg", "#38bdf8");
|
|
8417
|
+
setProp(_el$90, "attributes", 1);
|
|
8418
|
+
insert(_el$90, () => truncateLabel(value(), 24));
|
|
8419
|
+
effect((_$p) => setProp(_el$90, "fg", text(), _$p));
|
|
8420
|
+
return _el$87;
|
|
7607
8421
|
})()
|
|
7608
8422
|
}), null);
|
|
7609
|
-
insert(_el$
|
|
8423
|
+
insert(_el$35, createComponent(Show, {
|
|
7610
8424
|
get when() {
|
|
7611
8425
|
return model.gitLine();
|
|
7612
8426
|
},
|
|
7613
8427
|
children: (line) => (() => {
|
|
7614
|
-
var _el$
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
return _el$
|
|
8428
|
+
var _el$91 = createElement("text");
|
|
8429
|
+
setProp(_el$91, "fg", "#f59e0b");
|
|
8430
|
+
insert(_el$91, line);
|
|
8431
|
+
return _el$91;
|
|
7618
8432
|
})()
|
|
7619
8433
|
}), null);
|
|
7620
|
-
return _el$
|
|
7621
|
-
}
|
|
7622
|
-
}), null);
|
|
7623
|
-
insert(_el$12, createComponent(Show, {
|
|
7624
|
-
get when() {
|
|
7625
|
-
return block("todo");
|
|
7626
|
-
},
|
|
7627
|
-
get children() {
|
|
7628
|
-
var _el$20 = createElement("box");
|
|
7629
|
-
setProp(_el$20, "flexDirection", "column");
|
|
7630
|
-
insert(_el$20, createComponent(Show, {
|
|
7631
|
-
get when() {
|
|
7632
|
-
return spacer("todo");
|
|
7633
|
-
},
|
|
7634
|
-
get children() {
|
|
7635
|
-
var _el$21 = createElement("box");
|
|
7636
|
-
setProp(_el$21, "height", 1);
|
|
7637
|
-
return _el$21;
|
|
7638
|
-
}
|
|
7639
|
-
}), null);
|
|
7640
|
-
insert(_el$20, createComponent(Show, {
|
|
7641
|
-
get when() {
|
|
7642
|
-
return model.todo().visible.length > 0;
|
|
7643
|
-
},
|
|
7644
|
-
get children() {
|
|
7645
|
-
var _el$22 = createElement("box");
|
|
7646
|
-
setProp(_el$22, "flexDirection", "column");
|
|
7647
|
-
insert(_el$22, createComponent(BlockHeader, {
|
|
7648
|
-
get icon() {
|
|
7649
|
-
return BLOCK_ICONS.todo;
|
|
7650
|
-
},
|
|
7651
|
-
label: "Todo",
|
|
7652
|
-
get fg() {
|
|
7653
|
-
return tone("warning");
|
|
7654
|
-
},
|
|
7655
|
-
get muted() {
|
|
7656
|
-
return muted();
|
|
7657
|
-
}
|
|
7658
|
-
}), null);
|
|
7659
|
-
insert(_el$22, createComponent(For, {
|
|
7660
|
-
get each() {
|
|
7661
|
-
return model.todo().visible;
|
|
7662
|
-
},
|
|
7663
|
-
children: (item) => (() => {
|
|
7664
|
-
var _el$43 = createElement("text");
|
|
7665
|
-
insert(_el$43, () => todoRowText(item));
|
|
7666
|
-
effect((_$p) => setProp(_el$43, "fg", todoFg(item.status), _$p));
|
|
7667
|
-
return _el$43;
|
|
7668
|
-
})()
|
|
7669
|
-
}), null);
|
|
7670
|
-
insert(_el$22, createComponent(Show, {
|
|
7671
|
-
get when() {
|
|
7672
|
-
return hiddenTodoText(model.todo().hidden);
|
|
7673
|
-
},
|
|
7674
|
-
children: (line) => (() => {
|
|
7675
|
-
var _el$44 = createElement("text");
|
|
7676
|
-
insert(_el$44, line);
|
|
7677
|
-
effect((_$p) => setProp(_el$44, "fg", muted(), _$p));
|
|
7678
|
-
return _el$44;
|
|
7679
|
-
})()
|
|
7680
|
-
}), null);
|
|
7681
|
-
return _el$22;
|
|
7682
|
-
}
|
|
7683
|
-
}), null);
|
|
7684
|
-
return _el$20;
|
|
8434
|
+
return _el$33;
|
|
7685
8435
|
}
|
|
7686
8436
|
}), null);
|
|
7687
|
-
insert(_el$
|
|
8437
|
+
insert(_el$16, createComponent(Show, {
|
|
7688
8438
|
get when() {
|
|
7689
8439
|
return block("dispatch");
|
|
7690
8440
|
},
|
|
7691
8441
|
get children() {
|
|
7692
|
-
var _el$
|
|
7693
|
-
setProp(_el$
|
|
7694
|
-
insert(_el$
|
|
8442
|
+
var _el$36 = createElement("box");
|
|
8443
|
+
setProp(_el$36, "flexDirection", "column");
|
|
8444
|
+
insert(_el$36, createComponent(Show, {
|
|
7695
8445
|
get when() {
|
|
7696
8446
|
return spacer("dispatch");
|
|
7697
8447
|
},
|
|
7698
8448
|
get children() {
|
|
7699
|
-
var _el$
|
|
7700
|
-
setProp(_el$
|
|
7701
|
-
return _el$
|
|
8449
|
+
var _el$37 = createElement("box");
|
|
8450
|
+
setProp(_el$37, "height", 1);
|
|
8451
|
+
return _el$37;
|
|
7702
8452
|
}
|
|
7703
8453
|
}), null);
|
|
7704
|
-
insert(_el$
|
|
8454
|
+
insert(_el$36, createComponent(Show, {
|
|
7705
8455
|
get when() {
|
|
7706
8456
|
return dispatchView();
|
|
7707
8457
|
},
|
|
7708
8458
|
children: (view) => (() => {
|
|
7709
|
-
var _el$
|
|
7710
|
-
setProp(_el$
|
|
7711
|
-
insert(_el$
|
|
8459
|
+
var _el$92 = createElement("box");
|
|
8460
|
+
setProp(_el$92, "flexDirection", "column");
|
|
8461
|
+
insert(_el$92, createComponent(BlockHeader, {
|
|
7712
8462
|
get icon() {
|
|
7713
8463
|
return BLOCK_ICONS.dispatch;
|
|
7714
8464
|
},
|
|
8465
|
+
iconFg: "#c084fc",
|
|
7715
8466
|
label: "Dispatch",
|
|
7716
8467
|
get fg() {
|
|
7717
8468
|
return memo(() => view().runningCount > 0)() ? tone("success") : muted();
|
|
@@ -7723,101 +8474,101 @@ function Sidebar(props) {
|
|
|
7723
8474
|
return dispatchSummary();
|
|
7724
8475
|
}
|
|
7725
8476
|
}), null);
|
|
7726
|
-
insert(_el$
|
|
8477
|
+
insert(_el$92, createComponent(For, {
|
|
7727
8478
|
get each() {
|
|
7728
8479
|
return view().running;
|
|
7729
8480
|
},
|
|
7730
8481
|
children: (row) => (() => {
|
|
7731
|
-
var _el$
|
|
7732
|
-
insertNode(_el$
|
|
7733
|
-
setProp(_el$
|
|
7734
|
-
insert(_el$
|
|
8482
|
+
var _el$94 = createElement("box"), _el$95 = createElement("text");
|
|
8483
|
+
insertNode(_el$94, _el$95);
|
|
8484
|
+
setProp(_el$94, "flexShrink", 0);
|
|
8485
|
+
insert(_el$95, () => row.text);
|
|
7735
8486
|
effect((_p$) => {
|
|
7736
|
-
var _v$
|
|
7737
|
-
_v$
|
|
7738
|
-
_v$
|
|
8487
|
+
var _v$1 = open(row.id), _v$10 = tone("success");
|
|
8488
|
+
_v$1 !== _p$.e && (_p$.e = setProp(_el$94, "onMouseDown", _v$1, _p$.e));
|
|
8489
|
+
_v$10 !== _p$.t && (_p$.t = setProp(_el$95, "fg", _v$10, _p$.t));
|
|
7739
8490
|
return _p$;
|
|
7740
8491
|
}, {
|
|
7741
8492
|
e: void 0,
|
|
7742
8493
|
t: void 0
|
|
7743
8494
|
});
|
|
7744
|
-
return _el$
|
|
8495
|
+
return _el$94;
|
|
7745
8496
|
})()
|
|
7746
8497
|
}), null);
|
|
7747
|
-
insert(_el$
|
|
8498
|
+
insert(_el$92, createComponent(Show, {
|
|
7748
8499
|
get when() {
|
|
7749
8500
|
return view().runningHidden > 0;
|
|
7750
8501
|
},
|
|
7751
8502
|
get children() {
|
|
7752
|
-
var _el$
|
|
7753
|
-
insert(_el$
|
|
7754
|
-
effect((_$p) => setProp(_el$
|
|
7755
|
-
return _el$
|
|
8503
|
+
var _el$93 = createElement("text");
|
|
8504
|
+
insert(_el$93, () => `\u2026 +${view().runningHidden} rodando`);
|
|
8505
|
+
effect((_$p) => setProp(_el$93, "fg", muted(), _$p));
|
|
8506
|
+
return _el$93;
|
|
7756
8507
|
}
|
|
7757
8508
|
}), null);
|
|
7758
|
-
insert(_el$
|
|
8509
|
+
insert(_el$92, createComponent(Show, {
|
|
7759
8510
|
get when() {
|
|
7760
8511
|
return view().summary;
|
|
7761
8512
|
},
|
|
7762
8513
|
children: (line) => (() => {
|
|
7763
|
-
var _el$
|
|
7764
|
-
insertNode(_el$
|
|
7765
|
-
setProp(_el$
|
|
7766
|
-
setProp(_el$
|
|
7767
|
-
insert(_el$
|
|
7768
|
-
insert(_el$
|
|
8514
|
+
var _el$96 = createElement("box"), _el$97 = createElement("text");
|
|
8515
|
+
insertNode(_el$96, _el$97);
|
|
8516
|
+
setProp(_el$96, "flexDirection", "row");
|
|
8517
|
+
setProp(_el$96, "flexShrink", 0);
|
|
8518
|
+
insert(_el$97, line);
|
|
8519
|
+
insert(_el$96, createComponent(Show, {
|
|
7769
8520
|
get when() {
|
|
7770
8521
|
return failedSuffix();
|
|
7771
8522
|
},
|
|
7772
8523
|
children: (suffix) => (() => {
|
|
7773
|
-
var _el$
|
|
7774
|
-
insert(_el$
|
|
7775
|
-
effect((_$p) => setProp(_el$
|
|
7776
|
-
return _el$
|
|
8524
|
+
var _el$98 = createElement("text");
|
|
8525
|
+
insert(_el$98, () => `${SPEND_LINE_SEPARATOR}${suffix()}`);
|
|
8526
|
+
effect((_$p) => setProp(_el$98, "fg", tone("error"), _$p));
|
|
8527
|
+
return _el$98;
|
|
7777
8528
|
})()
|
|
7778
8529
|
}), null);
|
|
7779
|
-
effect((_$p) => setProp(_el$
|
|
7780
|
-
return _el$
|
|
8530
|
+
effect((_$p) => setProp(_el$97, "fg", muted(), _$p));
|
|
8531
|
+
return _el$96;
|
|
7781
8532
|
})()
|
|
7782
8533
|
}), null);
|
|
7783
|
-
insert(_el$
|
|
8534
|
+
insert(_el$92, createComponent(For, {
|
|
7784
8535
|
get each() {
|
|
7785
8536
|
return view().agents;
|
|
7786
8537
|
},
|
|
7787
8538
|
children: (row) => (() => {
|
|
7788
|
-
var _el$
|
|
7789
|
-
insert(_el$
|
|
7790
|
-
effect((_$p) => setProp(_el$
|
|
7791
|
-
return _el$
|
|
8539
|
+
var _el$99 = createElement("text");
|
|
8540
|
+
insert(_el$99, () => childAgentRowText(row));
|
|
8541
|
+
effect((_$p) => setProp(_el$99, "fg", muted(), _$p));
|
|
8542
|
+
return _el$99;
|
|
7792
8543
|
})()
|
|
7793
8544
|
}), null);
|
|
7794
|
-
insert(_el$
|
|
8545
|
+
insert(_el$92, createComponent(Show, {
|
|
7795
8546
|
get when() {
|
|
7796
8547
|
return hiddenChildAgentsText(view().agentsHidden, view().agentsHiddenCost);
|
|
7797
8548
|
},
|
|
7798
8549
|
children: (line) => (() => {
|
|
7799
|
-
var _el$
|
|
7800
|
-
insert(_el$
|
|
7801
|
-
effect((_$p) => setProp(_el$
|
|
7802
|
-
return _el$
|
|
8550
|
+
var _el$100 = createElement("text");
|
|
8551
|
+
insert(_el$100, line);
|
|
8552
|
+
effect((_$p) => setProp(_el$100, "fg", muted(), _$p));
|
|
8553
|
+
return _el$100;
|
|
7803
8554
|
})()
|
|
7804
8555
|
}), null);
|
|
7805
|
-
return _el$
|
|
8556
|
+
return _el$92;
|
|
7806
8557
|
})()
|
|
7807
8558
|
}), null);
|
|
7808
|
-
return _el$
|
|
8559
|
+
return _el$36;
|
|
7809
8560
|
}
|
|
7810
8561
|
}), null);
|
|
7811
8562
|
effect((_p$) => {
|
|
7812
|
-
var _v$
|
|
7813
|
-
_v$
|
|
7814
|
-
_v$
|
|
8563
|
+
var _v$5 = tuiPrefs().layout.preset === "compact" ? 0 : 1, _v$6 = tuiPrefs().layout.preset === "compact" ? 0 : 1;
|
|
8564
|
+
_v$5 !== _p$.e && (_p$.e = setProp(_el$16, "paddingTop", _v$5, _p$.e));
|
|
8565
|
+
_v$6 !== _p$.t && (_p$.t = setProp(_el$16, "paddingBottom", _v$6, _p$.t));
|
|
7815
8566
|
return _p$;
|
|
7816
8567
|
}, {
|
|
7817
8568
|
e: void 0,
|
|
7818
8569
|
t: void 0
|
|
7819
8570
|
});
|
|
7820
|
-
return _el$
|
|
8571
|
+
return _el$16;
|
|
7821
8572
|
})();
|
|
7822
8573
|
}
|
|
7823
8574
|
/** Panel actions that only make sense with a row selected. A panel over an
|
|
@@ -7886,25 +8637,25 @@ function DispatchPanel(props) {
|
|
|
7886
8637
|
return model.visible().rows;
|
|
7887
8638
|
},
|
|
7888
8639
|
children: (row) => (() => {
|
|
7889
|
-
var _el$
|
|
7890
|
-
insertNode(_el$
|
|
7891
|
-
insertNode(_el$
|
|
7892
|
-
setProp(_el$
|
|
7893
|
-
setProp(_el$
|
|
7894
|
-
insert(_el$
|
|
7895
|
-
insert(_el$
|
|
8640
|
+
var _el$101 = createElement("box"), _el$102 = createElement("text"), _el$103 = createElement("text");
|
|
8641
|
+
insertNode(_el$101, _el$102);
|
|
8642
|
+
insertNode(_el$101, _el$103);
|
|
8643
|
+
setProp(_el$101, "flexDirection", "row");
|
|
8644
|
+
setProp(_el$101, "flexShrink", 0);
|
|
8645
|
+
insert(_el$102, () => selected(row.id) ? `▸ ` : " ");
|
|
8646
|
+
insert(_el$103, () => row.text);
|
|
7896
8647
|
effect((_p$) => {
|
|
7897
|
-
var _v$
|
|
7898
|
-
_v$
|
|
7899
|
-
_v$
|
|
7900
|
-
_v$
|
|
8648
|
+
var _v$11 = selected(row.id) ? text() : muted(), _v$12 = rowFg(row.state), _v$13 = selected(row.id) ? 1 : 0;
|
|
8649
|
+
_v$11 !== _p$.e && (_p$.e = setProp(_el$102, "fg", _v$11, _p$.e));
|
|
8650
|
+
_v$12 !== _p$.t && (_p$.t = setProp(_el$103, "fg", _v$12, _p$.t));
|
|
8651
|
+
_v$13 !== _p$.a && (_p$.a = setProp(_el$103, "attributes", _v$13, _p$.a));
|
|
7901
8652
|
return _p$;
|
|
7902
8653
|
}, {
|
|
7903
8654
|
e: void 0,
|
|
7904
8655
|
t: void 0,
|
|
7905
8656
|
a: void 0
|
|
7906
8657
|
});
|
|
7907
|
-
return _el$
|
|
8658
|
+
return _el$101;
|
|
7908
8659
|
})()
|
|
7909
8660
|
});
|
|
7910
8661
|
const detail = () => createComponent(For, {
|
|
@@ -7912,28 +8663,28 @@ function DispatchPanel(props) {
|
|
|
7912
8663
|
return model.detail();
|
|
7913
8664
|
},
|
|
7914
8665
|
children: (line, index) => (() => {
|
|
7915
|
-
var _el$
|
|
7916
|
-
insert(_el$
|
|
7917
|
-
effect((_$p) => setProp(_el$
|
|
7918
|
-
return _el$
|
|
8666
|
+
var _el$104 = createElement("text");
|
|
8667
|
+
insert(_el$104, line);
|
|
8668
|
+
effect((_$p) => setProp(_el$104, "fg", index() === 0 ? text() : muted(), _$p));
|
|
8669
|
+
return _el$104;
|
|
7919
8670
|
})()
|
|
7920
8671
|
});
|
|
7921
8672
|
const empty = () => (() => {
|
|
7922
|
-
var _el$
|
|
7923
|
-
insertNode(_el$
|
|
7924
|
-
effect((_$p) => setProp(_el$
|
|
7925
|
-
return _el$
|
|
8673
|
+
var _el$105 = createElement("text");
|
|
8674
|
+
insertNode(_el$105, createTextNode(`No delegated sessions`));
|
|
8675
|
+
effect((_$p) => setProp(_el$105, "fg", muted(), _$p));
|
|
8676
|
+
return _el$105;
|
|
7926
8677
|
})();
|
|
7927
8678
|
return (() => {
|
|
7928
|
-
var _el$
|
|
7929
|
-
insertNode(_el$
|
|
7930
|
-
insertNode(_el$
|
|
7931
|
-
insertNode(_el$
|
|
7932
|
-
insertNode(_el$
|
|
7933
|
-
setProp(_el$
|
|
7934
|
-
setProp(_el$
|
|
7935
|
-
setProp(_el$
|
|
7936
|
-
insert(_el$
|
|
8679
|
+
var _el$107 = createElement("box"), _el$108 = createElement("text"), _el$109 = createElement("text"), _el$113 = createElement("box"), _el$114 = createElement("text");
|
|
8680
|
+
insertNode(_el$107, _el$108);
|
|
8681
|
+
insertNode(_el$107, _el$109);
|
|
8682
|
+
insertNode(_el$107, _el$113);
|
|
8683
|
+
insertNode(_el$107, _el$114);
|
|
8684
|
+
setProp(_el$107, "flexDirection", "column");
|
|
8685
|
+
setProp(_el$107, "width", "100%");
|
|
8686
|
+
setProp(_el$107, "padding", 1);
|
|
8687
|
+
insert(_el$107, createComponent(DispatchPanelKeymap, {
|
|
7937
8688
|
get context() {
|
|
7938
8689
|
return props.context;
|
|
7939
8690
|
},
|
|
@@ -7941,30 +8692,30 @@ function DispatchPanel(props) {
|
|
|
7941
8692
|
return props.panel;
|
|
7942
8693
|
},
|
|
7943
8694
|
model
|
|
7944
|
-
}), _el$
|
|
7945
|
-
setProp(_el$
|
|
7946
|
-
insert(_el$
|
|
7947
|
-
insert(_el$
|
|
8695
|
+
}), _el$108);
|
|
8696
|
+
setProp(_el$108, "attributes", 1);
|
|
8697
|
+
insert(_el$108, () => model.title());
|
|
8698
|
+
insert(_el$107, createComponent(Show, {
|
|
7948
8699
|
get when() {
|
|
7949
8700
|
return model.header();
|
|
7950
8701
|
},
|
|
7951
8702
|
children: (line) => (() => {
|
|
7952
|
-
var _el$
|
|
7953
|
-
insert(_el$
|
|
7954
|
-
effect((_$p) => setProp(_el$
|
|
7955
|
-
return _el$
|
|
8703
|
+
var _el$115 = createElement("text");
|
|
8704
|
+
insert(_el$115, line);
|
|
8705
|
+
effect((_$p) => setProp(_el$115, "fg", muted(), _$p));
|
|
8706
|
+
return _el$115;
|
|
7956
8707
|
})()
|
|
7957
|
-
}), _el$
|
|
7958
|
-
insert(_el$
|
|
7959
|
-
insert(_el$
|
|
8708
|
+
}), _el$109);
|
|
8709
|
+
insert(_el$109, () => dispatchPanelRule(props.panel.width - 2));
|
|
8710
|
+
insert(_el$107, createComponent(Show, {
|
|
7960
8711
|
get when() {
|
|
7961
8712
|
return model.layout().mode === "wide";
|
|
7962
8713
|
},
|
|
7963
8714
|
get fallback() {
|
|
7964
8715
|
return (() => {
|
|
7965
|
-
var _el$
|
|
7966
|
-
setProp(_el$
|
|
7967
|
-
insert(_el$
|
|
8716
|
+
var _el$116 = createElement("box");
|
|
8717
|
+
setProp(_el$116, "flexDirection", "column");
|
|
8718
|
+
insert(_el$116, createComponent(Show, {
|
|
7968
8719
|
get when() {
|
|
7969
8720
|
return model.rows().length > 0;
|
|
7970
8721
|
},
|
|
@@ -7972,34 +8723,34 @@ function DispatchPanel(props) {
|
|
|
7972
8723
|
return empty();
|
|
7973
8724
|
},
|
|
7974
8725
|
get children() {
|
|
7975
|
-
var _el$
|
|
7976
|
-
setProp(_el$
|
|
7977
|
-
insert(_el$
|
|
7978
|
-
return _el$
|
|
8726
|
+
var _el$117 = createElement("box");
|
|
8727
|
+
setProp(_el$117, "flexDirection", "column");
|
|
8728
|
+
insert(_el$117, rows);
|
|
8729
|
+
return _el$117;
|
|
7979
8730
|
}
|
|
7980
8731
|
}), null);
|
|
7981
|
-
insert(_el$
|
|
8732
|
+
insert(_el$116, createComponent(Show, {
|
|
7982
8733
|
get when() {
|
|
7983
8734
|
return model.selectedID();
|
|
7984
8735
|
},
|
|
7985
8736
|
get children() {
|
|
7986
|
-
var _el$
|
|
7987
|
-
insertNode(_el$
|
|
7988
|
-
setProp(_el$
|
|
7989
|
-
setProp(_el$
|
|
7990
|
-
insert(_el$
|
|
7991
|
-
return _el$
|
|
8737
|
+
var _el$118 = createElement("box"), _el$119 = createElement("box");
|
|
8738
|
+
insertNode(_el$118, _el$119);
|
|
8739
|
+
setProp(_el$118, "flexDirection", "column");
|
|
8740
|
+
setProp(_el$119, "height", 1);
|
|
8741
|
+
insert(_el$118, detail, null);
|
|
8742
|
+
return _el$118;
|
|
7992
8743
|
}
|
|
7993
8744
|
}), null);
|
|
7994
|
-
return _el$
|
|
8745
|
+
return _el$116;
|
|
7995
8746
|
})();
|
|
7996
8747
|
},
|
|
7997
8748
|
get children() {
|
|
7998
|
-
var _el$
|
|
7999
|
-
insertNode(_el$
|
|
8000
|
-
setProp(_el$
|
|
8001
|
-
setProp(_el$
|
|
8002
|
-
insert(_el$
|
|
8749
|
+
var _el$110 = createElement("box"), _el$111 = createElement("box");
|
|
8750
|
+
insertNode(_el$110, _el$111);
|
|
8751
|
+
setProp(_el$110, "flexDirection", "row");
|
|
8752
|
+
setProp(_el$111, "flexDirection", "column");
|
|
8753
|
+
insert(_el$111, createComponent(Show, {
|
|
8003
8754
|
get when() {
|
|
8004
8755
|
return model.rows().length > 0;
|
|
8005
8756
|
},
|
|
@@ -8010,36 +8761,36 @@ function DispatchPanel(props) {
|
|
|
8010
8761
|
return rows();
|
|
8011
8762
|
}
|
|
8012
8763
|
}));
|
|
8013
|
-
insert(_el$
|
|
8764
|
+
insert(_el$110, createComponent(Show, {
|
|
8014
8765
|
get when() {
|
|
8015
8766
|
return model.selectedID();
|
|
8016
8767
|
},
|
|
8017
8768
|
get children() {
|
|
8018
|
-
var _el$
|
|
8019
|
-
setProp(_el$
|
|
8020
|
-
insert(_el$
|
|
8021
|
-
effect((_$p) => setProp(_el$
|
|
8022
|
-
return _el$
|
|
8769
|
+
var _el$112 = createElement("box");
|
|
8770
|
+
setProp(_el$112, "flexDirection", "column");
|
|
8771
|
+
insert(_el$112, detail);
|
|
8772
|
+
effect((_$p) => setProp(_el$112, "width", model.layout().detailWidth, _$p));
|
|
8773
|
+
return _el$112;
|
|
8023
8774
|
}
|
|
8024
8775
|
}), null);
|
|
8025
|
-
effect((_$p) => setProp(_el$
|
|
8026
|
-
return _el$
|
|
8776
|
+
effect((_$p) => setProp(_el$111, "width", model.layout().listWidth, _$p));
|
|
8777
|
+
return _el$110;
|
|
8027
8778
|
}
|
|
8028
|
-
}), _el$
|
|
8029
|
-
setProp(_el$
|
|
8030
|
-
insert(_el$
|
|
8779
|
+
}), _el$113);
|
|
8780
|
+
setProp(_el$113, "height", 1);
|
|
8781
|
+
insert(_el$114, () => model.footer());
|
|
8031
8782
|
effect((_p$) => {
|
|
8032
|
-
var _v$
|
|
8033
|
-
_v$
|
|
8034
|
-
_v$
|
|
8035
|
-
_v$
|
|
8783
|
+
var _v$14 = text(), _v$15 = muted(), _v$16 = muted();
|
|
8784
|
+
_v$14 !== _p$.e && (_p$.e = setProp(_el$108, "fg", _v$14, _p$.e));
|
|
8785
|
+
_v$15 !== _p$.t && (_p$.t = setProp(_el$109, "fg", _v$15, _p$.t));
|
|
8786
|
+
_v$16 !== _p$.a && (_p$.a = setProp(_el$114, "fg", _v$16, _p$.a));
|
|
8036
8787
|
return _p$;
|
|
8037
8788
|
}, {
|
|
8038
8789
|
e: void 0,
|
|
8039
8790
|
t: void 0,
|
|
8040
8791
|
a: void 0
|
|
8041
8792
|
});
|
|
8042
|
-
return _el$
|
|
8793
|
+
return _el$107;
|
|
8043
8794
|
})();
|
|
8044
8795
|
}
|
|
8045
8796
|
/** App-level command claim: the only way into the panel. It registers the
|
|
@@ -8096,10 +8847,10 @@ function HomeStatus(props) {
|
|
|
8096
8847
|
return tuiPrefs().footer.home;
|
|
8097
8848
|
},
|
|
8098
8849
|
get children() {
|
|
8099
|
-
var _el$
|
|
8100
|
-
insert(_el$
|
|
8101
|
-
effect((_$p) => setProp(_el$
|
|
8102
|
-
return _el$
|
|
8850
|
+
var _el$120 = createElement("text");
|
|
8851
|
+
insert(_el$120, () => `Pantheon v2.2.0-beta.1${preset().name ? ` ▸ ${preset().name}` : ""}`);
|
|
8852
|
+
effect((_$p) => setProp(_el$120, "fg", muted(), _$p));
|
|
8853
|
+
return _el$120;
|
|
8103
8854
|
}
|
|
8104
8855
|
});
|
|
8105
8856
|
}
|
|
@@ -8155,10 +8906,10 @@ function PromptFooter(props) {
|
|
|
8155
8906
|
return memo(() => !!tuiPrefs().footer.prompt)() && model.running() > 0;
|
|
8156
8907
|
},
|
|
8157
8908
|
get children() {
|
|
8158
|
-
var _el$
|
|
8159
|
-
insert(_el$
|
|
8160
|
-
effect((_$p) => setProp(_el$
|
|
8161
|
-
return _el$
|
|
8909
|
+
var _el$121 = createElement("text");
|
|
8910
|
+
insert(_el$121, () => `▸${model.preset().name ?? "default"} · ✦${model.running()} ativos`);
|
|
8911
|
+
effect((_$p) => setProp(_el$121, "fg", muted(), _$p));
|
|
8912
|
+
return _el$121;
|
|
8162
8913
|
}
|
|
8163
8914
|
});
|
|
8164
8915
|
}
|
|
@@ -8172,9 +8923,11 @@ const plugin = Plugin.define({
|
|
|
8172
8923
|
warmUpSidebarData(context, resolveLocation(context));
|
|
8173
8924
|
const unregisterSidebar = context.ui.slot({
|
|
8174
8925
|
append: "sidebar.content",
|
|
8175
|
-
render: (
|
|
8926
|
+
render: (slotProps) => createComponent(Sidebar, {
|
|
8176
8927
|
context,
|
|
8177
|
-
sessionID
|
|
8928
|
+
get sessionID() {
|
|
8929
|
+
return slotProps?.sessionID;
|
|
8930
|
+
}
|
|
8178
8931
|
})
|
|
8179
8932
|
});
|
|
8180
8933
|
const unregisterHome = context.ui.slot({
|
|
@@ -8186,9 +8939,11 @@ const plugin = Plugin.define({
|
|
|
8186
8939
|
}, 1e4);
|
|
8187
8940
|
const unregisterPromptFooter = context.ui.slot({
|
|
8188
8941
|
append: "prompt.footer",
|
|
8189
|
-
render: (
|
|
8942
|
+
render: (slotProps) => createComponent(PromptFooter, {
|
|
8190
8943
|
context,
|
|
8191
|
-
sessionID
|
|
8944
|
+
get sessionID() {
|
|
8945
|
+
return slotProps?.sessionID;
|
|
8946
|
+
}
|
|
8192
8947
|
})
|
|
8193
8948
|
});
|
|
8194
8949
|
const unregisterPanel = context.ui.slot({
|
|
@@ -8214,13 +8969,15 @@ const plugin = Plugin.define({
|
|
|
8214
8969
|
render: () => createComponent(PantheonSettingsCommandLayer, { context })
|
|
8215
8970
|
});
|
|
8216
8971
|
try {
|
|
8217
|
-
setupPantheonSettings(context);
|
|
8972
|
+
setupPantheonSettings(context, { renderSidebar: (ctx) => createComponent(Sidebar, { context: ctx }) });
|
|
8218
8973
|
} catch {}
|
|
8219
8974
|
const unregisterSettingsSlot = context.ui.slot({
|
|
8220
8975
|
append: "session.composer.top",
|
|
8221
|
-
render: (
|
|
8976
|
+
render: (slotProps) => createComponent(PantheonSettingsSlot, {
|
|
8222
8977
|
context,
|
|
8223
|
-
sessionID
|
|
8978
|
+
get sessionID() {
|
|
8979
|
+
return slotProps?.sessionID ?? "";
|
|
8980
|
+
}
|
|
8224
8981
|
})
|
|
8225
8982
|
});
|
|
8226
8983
|
maybeShowWhatsNewV2(context);
|
|
@@ -8238,6 +8995,6 @@ const plugin = Plugin.define({
|
|
|
8238
8995
|
}
|
|
8239
8996
|
});
|
|
8240
8997
|
//#endregion
|
|
8241
|
-
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 };
|
|
8998
|
+
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 };
|
|
8242
8999
|
|
|
8243
9000
|
//# sourceMappingURL=tui.js.map
|