pantheon-opencode 1.6.1 → 1.6.2-beta.10
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 +11 -11
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +179 -0
- package/README.md +268 -20
- package/README.pt-BR.md +34 -11
- package/bin/pantheon-init.mjs +301 -32
- package/package.json +13 -4
- package/plugin.json +1 -1
- package/prompts/README.md +58 -0
- package/prompts/debug-issue.prompt.md +46 -0
- package/prompts/dynamic/agora-generated.txt +38 -0
- package/prompts/dynamic/orchestrate-generated.txt +51 -0
- package/prompts/focus.prompt.md +42 -0
- package/prompts/implement-feature.prompt.md +39 -0
- package/prompts/optimize-database.prompt.md +58 -0
- package/prompts/orchestrate-with-zeus.prompt.md +441 -0
- package/prompts/plan-architecture.prompt.md +59 -0
- package/prompts/quick-discovery-large-codebase.prompt.md +294 -0
- package/prompts/quick-plan-large-feature.prompt.md +197 -0
- package/prompts/semantic-summarize.md +50 -0
- package/prompts/sketch.prompt.md +91 -0
- package/prompts/subtask.prompt.md +131 -0
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +1 -1
- package/scripts/decision-router-budget.mjs +780 -0
- package/scripts/decision-router-v2-budget.mjs +218 -0
- package/scripts/decision-router-v2-egress.mjs +272 -0
- package/scripts/decision-router.mjs +758 -0
- package/scripts/docs-check-changelog.mjs +5 -3
- package/scripts/doctor.mjs +213 -45
- package/scripts/install/agents-md.mjs +2 -1
- package/scripts/install/component-selection.mjs +9 -4
- package/scripts/install/config-migration.mjs +344 -393
- package/scripts/install/config-paths.mjs +15 -0
- package/scripts/install/decision-layer-preview.mjs +376 -0
- package/scripts/install/decision-router-config.mjs +560 -0
- package/scripts/install/health-check.mjs +20 -11
- package/scripts/install/interactive.mjs +103 -14
- package/scripts/install/interrupt.mjs +4 -3
- package/scripts/install/mcp-permissions.mjs +164 -0
- package/scripts/install/migrate.mjs +123 -72
- package/scripts/install/opencode-version.mjs +31 -13
- package/scripts/install/opencode-wildcard.mjs +106 -0
- package/scripts/install/opencode.mjs +411 -184
- package/scripts/install/plan-artifact.mjs +12 -1
- package/scripts/install/plan.mjs +8 -1
- package/scripts/install/plugin.mjs +18 -1
- package/scripts/install/state.mjs +12 -0
- package/scripts/install/strings.mjs +22 -0
- package/scripts/install/v2-capabilities.mjs +5 -6
- package/scripts/install/venv.mjs +34 -17
- package/scripts/mcp_resources.py +11 -9
- package/scripts/package-evidence.mjs +1 -0
- package/scripts/release-notes.mjs +30 -7
- package/scripts/restore.mjs +22 -10
- package/scripts/sandbox-env.sh +174 -0
- package/scripts/setup-v2-config.mjs +1703 -0
- package/scripts/setup.mjs +415 -0
- package/scripts/sync-tui.mjs +9 -1
- package/scripts/test-opencode-v2-sandbox.sh +448 -157
- package/scripts/update-skills-lock.mjs +30 -0
- package/scripts/versioning.mjs +41 -5
- package/skills-lock.json +10 -10
- package/src/agents/aphrodite.md +11 -3
- package/src/agents/apollo.md +6 -0
- package/src/agents/athena.md +7 -1
- package/src/agents/demeter.md +6 -2
- package/src/agents/gaia.md +5 -0
- package/src/agents/hephaestus.md +7 -2
- package/src/agents/hermes.md +14 -13
- package/src/agents/iris.md +6 -2
- package/src/agents/mnemosyne.md +21 -50
- package/src/agents/nyx.md +6 -2
- package/src/agents/prometheus.md +5 -1
- package/src/agents/talos.md +10 -1
- package/src/agents/themis.md +5 -1
- package/src/agents/zeus.md +61 -65
- package/src/instructions/agent-return-format.instructions.md +1 -1
- package/src/instructions/memory-protocol.instructions.md +3 -3
- package/src/instructions/test-economy.instructions.md +6 -6
- package/src/mcp/eval_store.py +11 -4
- package/src/mcp/mcp_resources.py +11 -9
- package/src/mcp/memory_mcp.py +293 -150
- package/src/mcp/pantheon_vision.py +37 -36
- package/src/pantheon/cost-command.ts +30 -133
- package/src/pantheon/jev-decision-tool.ts +347 -0
- package/src/pantheon/jev-decisions.ts +625 -0
- package/src/pantheon/local-decision-agents.ts +170 -0
- package/src/pantheon/local-decision-budget.ts +1046 -0
- package/src/pantheon/local-decision-egress-gate.ts +144 -0
- package/src/pantheon/local-decision-prompt.ts +256 -0
- package/src/pantheon/local-decision-provider-matrix.ts +44 -0
- package/src/pantheon/local-decision-router.ts +225 -0
- package/src/pantheon/local-decision-skills.ts +281 -0
- package/src/pantheon/local-decision-tool.ts +160 -0
- package/src/pantheon/local-decision-turn.ts +101 -0
- package/src/pantheon/local-decision-usage-evidence.internal.ts +168 -0
- package/src/pantheon/local-orchestration.ts +322 -0
- package/src/pantheon/model-pricing.ts +1 -536
- package/src/pantheon/pantheon-decision-catalog.ts +101 -0
- package/src/pantheon/v2-decision-budget.ts +456 -0
- package/src/pantheon/v2-decision-contracts.ts +300 -0
- package/src/pantheon/v2-decision-egress.ts +203 -0
- package/src/pantheon/v2-decision-events.ts +180 -0
- package/src/pantheon/v2-decision-heuristic.ts +121 -0
- package/src/pantheon/v2-decision-points/p1-agent.ts +91 -0
- package/src/pantheon/v2-decision-points/p10-claims.ts +243 -0
- package/src/pantheon/v2-decision-points/p11-catalog.ts +220 -0
- package/src/pantheon/v2-decision-points/p2-skill.ts +83 -0
- package/src/pantheon/v2-decision-points/p3-complexity.ts +108 -0
- package/src/pantheon/v2-decision-points/p4-memory.ts +137 -0
- package/src/pantheon/v2-decision-points/p5-themis-verify.ts +190 -0
- package/src/pantheon/v2-decision-points/p6-council.ts +161 -0
- package/src/pantheon/v2-decision-points/p7-loop.ts +263 -0
- package/src/pantheon/v2-decision-points/p8-guardrail.ts +367 -0
- package/src/pantheon/v2-decision-points/p9-memory-compaction.ts +304 -0
- package/src/pantheon/v2-decision-points.ts +242 -0
- package/src/pantheon/v2-decision-policy.ts +166 -0
- package/src/pantheon/v2-decision-premises.ts +146 -0
- package/src/pantheon/v2-decision-prompt-surface.ts +115 -0
- package/src/pantheon/v2-decision-rank.ts +91 -0
- package/src/pantheon/v2-decision-registry.ts +391 -0
- package/src/pantheon/v2-decision-resource-ids.ts +127 -0
- package/src/pantheon/v2-decision-shadow.ts +123 -0
- package/src/pantheon/v2-decision-telemetry.ts +214 -0
- package/src/pantheon/v2-decision-verify.ts +51 -0
- package/src/pantheon/v2-hook-engine.ts +307 -0
- package/src/pantheon/v2-native-decisions.ts +365 -0
- package/src/pantheon/v2-shell-hooks.ts +66 -2
- package/src/pantheon/v2-tools.ts +38 -15
- package/src/pantheon/v2-vision.ts +34 -29
- package/src/pantheon/vision.ts +43 -10
- package/src/plugin-v2.ts +449 -79
- package/src/plugin.ts +4 -0
- package/src/plugins/tui/THIRD_PARTY_NOTICES.md +24 -0
- package/src/plugins/tui/dist/server-v2.d.ts +22 -0
- package/src/plugins/tui/dist/server-v2.d.ts.map +1 -0
- package/src/plugins/tui/dist/server-v2.js +26 -0
- package/src/plugins/tui/dist/server-v2.js.map +1 -0
- package/src/plugins/tui/dist/tui-v2.d.ts +54 -51
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui-v2.js +762 -529
- package/src/plugins/tui/dist/tui-v2.js.map +1 -1
- package/src/plugins/tui/dist/tui.js +1 -1
- package/src/plugins/tui/index-v2.ts +3 -6
- package/src/plugins/tui/package-lock.json +17 -2
- package/src/plugins/tui/package.json +6 -3
- package/src/plugins/tui/src/context-gauge.ts +59 -0
- package/src/plugins/tui/src/cost-data.ts +607 -0
- package/src/plugins/tui/src/index-v2.tsx +360 -242
- package/src/plugins/tui/src/model-pricing.ts +536 -0
- package/src/plugins/tui/src/model-usage-limits.ts +4 -0
- package/src/plugins/tui/src/server-v2.ts +21 -0
- package/src/plugins/tui/src/sidebar-width.ts +129 -0
- package/src/plugins/tui/tsconfig.typecheck.json +1 -1
- package/src/plugins/tui/tsdown.config.ts +34 -5
- package/src/routing.yml +72 -13
- package/src/skills/README.md +4 -0
- package/src/skills/agent-coordination/SKILL.md +0 -3
- package/src/skills/artifact-management/SKILL.md +0 -3
- package/src/skills/auto-continue/SKILL.md +0 -3
- package/src/skills/code-review-checklist/SKILL.md +0 -3
- package/src/skills/context-compression/SKILL.md +0 -3
- package/src/skills/memory-bank/SKILL.md +6 -28
- package/src/skills/session-goal/SKILL.md +0 -3
- package/src/skills/simplify/SKILL.md +5 -4
- package/src/skills/tdd-with-agents/SKILL.md +0 -3
- package/src/skills/visual-review-pipeline/SKILL.md +0 -1
- package/src/pantheon/memory-context.ts +0 -1017
|
@@ -5,6 +5,181 @@ import { join } from "node:path";
|
|
|
5
5
|
import { For, Show, createEffect, createMemo, createSignal, on, onCleanup, onMount } from "solid-js";
|
|
6
6
|
import { execFile } from "node:child_process";
|
|
7
7
|
import { Plugin } from "@opencode/plugin/tui";
|
|
8
|
+
//#region src/context-gauge.ts
|
|
9
|
+
const CONTEXT_BAR_CELLS = 12;
|
|
10
|
+
const CONTEXT_BAR_FILLED_CELL = "▰";
|
|
11
|
+
const CONTEXT_BAR_EMPTY_CELL = "▱";
|
|
12
|
+
function numberOrNull$1(value) {
|
|
13
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
14
|
+
}
|
|
15
|
+
function contextUsageTone(percent) {
|
|
16
|
+
if (percent > 90) return "error";
|
|
17
|
+
if (percent > 50) return "warning";
|
|
18
|
+
if (percent > 25) return "success";
|
|
19
|
+
return "info";
|
|
20
|
+
}
|
|
21
|
+
function formatTokenCount(tokens) {
|
|
22
|
+
const value = numberOrNull$1(tokens);
|
|
23
|
+
if (value === null || value < 0) return null;
|
|
24
|
+
return Math.round(value).toLocaleString("en-US");
|
|
25
|
+
}
|
|
26
|
+
function formatContextWindow(limit) {
|
|
27
|
+
const value = numberOrNull$1(limit);
|
|
28
|
+
if (value === null || value <= 0) return null;
|
|
29
|
+
if (value >= 1e6) return `${(value / 1e6).toFixed(1)}M`;
|
|
30
|
+
if (value >= 1e3) return `${Math.floor(value / 1e3)}K`;
|
|
31
|
+
return `${Math.floor(value)}`;
|
|
32
|
+
}
|
|
33
|
+
function contextBarFilled(percent, cells = 12) {
|
|
34
|
+
const total = Math.max(1, Math.floor(cells));
|
|
35
|
+
const filled = Math.round(percent / 100 * total);
|
|
36
|
+
if (!Number.isFinite(filled)) return 0;
|
|
37
|
+
return Math.min(total, Math.max(0, filled));
|
|
38
|
+
}
|
|
39
|
+
function contextBar(percent, cells = 12) {
|
|
40
|
+
const value = numberOrNull$1(percent);
|
|
41
|
+
if (value === null) return null;
|
|
42
|
+
const total = Math.max(1, Math.floor(cells));
|
|
43
|
+
const filled = contextBarFilled(value, total);
|
|
44
|
+
return {
|
|
45
|
+
filled: "▰".repeat(filled),
|
|
46
|
+
empty: "▱".repeat(total - filled)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function formatSpent(cost) {
|
|
50
|
+
const value = numberOrNull$1(cost);
|
|
51
|
+
if (value === null || value < 0) return null;
|
|
52
|
+
return `$${value.toFixed(2)}`;
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/model-usage-limits.ts
|
|
56
|
+
/** Shared bounds for cached recent model-usage aggregation. */
|
|
57
|
+
const MODEL_USAGE_VISIBLE_CEILING = 3;
|
|
58
|
+
const MODEL_USAGE_MESSAGE_LIMIT = 400;
|
|
59
|
+
const MODEL_USAGE_SESSION_LIMIT = 8;
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/sidebar-width.ts
|
|
62
|
+
const GRAPHEMES = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
63
|
+
/** A grapheme the host draws two cells wide: emoji presentation, an extended
|
|
64
|
+
* pictograph (a bare `❤` counts too, exactly as the host's `emoji-regex`
|
|
65
|
+
* does) and a regional-indicator pair (a flag). */
|
|
66
|
+
const EMOJI_GLYPH = /\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{Regional_Indicator}/u;
|
|
67
|
+
/** VS16 asks for emoji presentation; without it `1` is one cell, with it the
|
|
68
|
+
* keycap sequence is drawn as one two-cell glyph. */
|
|
69
|
+
const EMOJI_PRESENTATION_SELECTOR = "️";
|
|
70
|
+
/** Unicode default-ignorable code points carry no width of their own. */
|
|
71
|
+
const IGNORABLE_GLYPH = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
72
|
+
/** East Asian Wide/Fullwidth ranges — two cells, never the ambiguous width
|
|
73
|
+
* (the host measures ambiguous as narrow, so `▸`/`✓`/`—` stay one cell).
|
|
74
|
+
* Generated from the host's own measurement (`string-width` over every code
|
|
75
|
+
* point, emoji excluded), so this table can be regenerated verbatim when the
|
|
76
|
+
* host upgrades its Unicode data instead of being hand-edited. */
|
|
77
|
+
const CELL_WIDE_RANGES = [
|
|
78
|
+
[4352, 4446],
|
|
79
|
+
[9001, 9002],
|
|
80
|
+
[9776, 9783],
|
|
81
|
+
[9866, 9871],
|
|
82
|
+
[11904, 11929],
|
|
83
|
+
[11931, 12019],
|
|
84
|
+
[12032, 12245],
|
|
85
|
+
[12272, 12335],
|
|
86
|
+
[12337, 12348],
|
|
87
|
+
[12350, 12350],
|
|
88
|
+
[12353, 12438],
|
|
89
|
+
[12441, 12543],
|
|
90
|
+
[12549, 12591],
|
|
91
|
+
[12593, 12643],
|
|
92
|
+
[12645, 12686],
|
|
93
|
+
[12688, 12773],
|
|
94
|
+
[12783, 12830],
|
|
95
|
+
[12832, 12871],
|
|
96
|
+
[12880, 12950],
|
|
97
|
+
[12952, 12952],
|
|
98
|
+
[12954, 42124],
|
|
99
|
+
[42128, 42182],
|
|
100
|
+
[43360, 43388],
|
|
101
|
+
[44032, 55203],
|
|
102
|
+
[63744, 64255],
|
|
103
|
+
[65040, 65049],
|
|
104
|
+
[65072, 65106],
|
|
105
|
+
[65108, 65126],
|
|
106
|
+
[65128, 65131],
|
|
107
|
+
[65281, 65376],
|
|
108
|
+
[65504, 65510],
|
|
109
|
+
[94176, 94180],
|
|
110
|
+
[94192, 94198],
|
|
111
|
+
[94208, 101594],
|
|
112
|
+
[101631, 101664],
|
|
113
|
+
[101760, 101874],
|
|
114
|
+
[101888, 102801],
|
|
115
|
+
[102816, 102866],
|
|
116
|
+
[110576, 110579],
|
|
117
|
+
[110581, 110587],
|
|
118
|
+
[110589, 110590],
|
|
119
|
+
[110592, 110888],
|
|
120
|
+
[110898, 110898],
|
|
121
|
+
[110928, 110930],
|
|
122
|
+
[110933, 110933],
|
|
123
|
+
[110948, 110952],
|
|
124
|
+
[110960, 111355],
|
|
125
|
+
[119552, 119638],
|
|
126
|
+
[119648, 119670],
|
|
127
|
+
[127488, 127488],
|
|
128
|
+
[127504, 127513],
|
|
129
|
+
[127515, 127534],
|
|
130
|
+
[127536, 127537],
|
|
131
|
+
[127547, 127547],
|
|
132
|
+
[127552, 127560],
|
|
133
|
+
[127584, 127589],
|
|
134
|
+
[131072, 196605],
|
|
135
|
+
[196608, 262141]
|
|
136
|
+
];
|
|
137
|
+
/** One code point the terminal draws no cell for: control characters, the
|
|
138
|
+
* zero-width joiners/marks, combining marks and variation selectors. */
|
|
139
|
+
function isZeroWidthCodePoint(code, glyph) {
|
|
140
|
+
if (code <= 31 || code >= 127 && code <= 159) return true;
|
|
141
|
+
if (code >= 8203 && code <= 8207) return true;
|
|
142
|
+
if (code === 65279) return true;
|
|
143
|
+
if (code >= 768 && code <= 879) return true;
|
|
144
|
+
if (code >= 6832 && code <= 6911) return true;
|
|
145
|
+
if (code >= 7616 && code <= 7679) return true;
|
|
146
|
+
if (code >= 8400 && code <= 8447) return true;
|
|
147
|
+
if (code >= 65024 && code <= 65039) return true;
|
|
148
|
+
if (code >= 65056 && code <= 65071) return true;
|
|
149
|
+
if (code >= 917760 && code <= 917999) return true;
|
|
150
|
+
if (code >= 55296 && code <= 57343) return true;
|
|
151
|
+
return IGNORABLE_GLYPH.test(glyph);
|
|
152
|
+
}
|
|
153
|
+
function isWideCodePoint(code) {
|
|
154
|
+
for (const [low, high] of CELL_WIDE_RANGES) {
|
|
155
|
+
if (code < low) return false;
|
|
156
|
+
if (code <= high) return true;
|
|
157
|
+
}
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
/** Cells one grapheme occupies. */
|
|
161
|
+
function graphemeWidth(segment) {
|
|
162
|
+
if (EMOJI_GLYPH.test(segment)) return 2;
|
|
163
|
+
if (segment.length > 1 && segment.includes(EMOJI_PRESENTATION_SELECTOR)) return 2;
|
|
164
|
+
let width = 0;
|
|
165
|
+
for (const glyph of segment) {
|
|
166
|
+
const code = glyph.codePointAt(0) ?? 0;
|
|
167
|
+
if (isZeroWidthCodePoint(code, glyph)) continue;
|
|
168
|
+
width += isWideCodePoint(code) ? 2 : 1;
|
|
169
|
+
}
|
|
170
|
+
return width;
|
|
171
|
+
}
|
|
172
|
+
/** Terminal cells `value` occupies — the unit every column in this plugin is
|
|
173
|
+
* measured in. Mirrors the host (that is how `@opentui/core` sizes a text
|
|
174
|
+
* run): emoji count as two cells, East Asian Wide/Fullwidth as two, East
|
|
175
|
+
* Asian Ambiguous as one, combining marks and variation selectors as none.
|
|
176
|
+
* Pure. */
|
|
177
|
+
function cellWidth(value) {
|
|
178
|
+
let width = 0;
|
|
179
|
+
for (const { segment } of GRAPHEMES.segment(value)) width += graphemeWidth(segment);
|
|
180
|
+
return width;
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
8
183
|
//#region src/index-v2.tsx
|
|
9
184
|
/** @jsxImportSource @opentui/solid */
|
|
10
185
|
const SINGLETON = Symbol.for("pantheon.tui.v2.loaded");
|
|
@@ -211,6 +386,130 @@ function resolveContextLimit(models, ref) {
|
|
|
211
386
|
}
|
|
212
387
|
return null;
|
|
213
388
|
}
|
|
389
|
+
function asRecord(value) {
|
|
390
|
+
return typeof value === "object" && value !== null ? value : void 0;
|
|
391
|
+
}
|
|
392
|
+
function modelID(ref) {
|
|
393
|
+
const record = asRecord(ref);
|
|
394
|
+
const id = typeof ref === "string" ? ref : record?.id ?? record?.modelID;
|
|
395
|
+
return typeof id === "string" && id.trim() !== "" ? id : null;
|
|
396
|
+
}
|
|
397
|
+
function messageModelRef(message) {
|
|
398
|
+
return message.model ?? message;
|
|
399
|
+
}
|
|
400
|
+
function modelProvider(ref, models) {
|
|
401
|
+
const direct = asRecord(ref)?.providerID;
|
|
402
|
+
if (typeof direct === "string" && direct.trim() !== "") return direct.trim();
|
|
403
|
+
const id = modelID(ref);
|
|
404
|
+
if (id === null) return null;
|
|
405
|
+
const segment = id.slice(id.lastIndexOf("/") + 1);
|
|
406
|
+
const providers = /* @__PURE__ */ new Set();
|
|
407
|
+
for (const candidate of models) {
|
|
408
|
+
const item = asRecord(candidate);
|
|
409
|
+
if (!item) continue;
|
|
410
|
+
if (item.id !== id && item.modelID !== id && item.id !== segment && item.modelID !== segment) continue;
|
|
411
|
+
if (typeof item.providerID === "string" && item.providerID.trim() !== "") providers.add(item.providerID.trim());
|
|
412
|
+
}
|
|
413
|
+
const explicitProvider = id.includes("/") ? id.slice(0, id.indexOf("/")) : null;
|
|
414
|
+
if (explicitProvider && providers.has(explicitProvider)) return explicitProvider;
|
|
415
|
+
return providers.size === 1 ? [...providers][0] ?? null : null;
|
|
416
|
+
}
|
|
417
|
+
function modelIdentity(ref, models) {
|
|
418
|
+
const id = modelID(ref);
|
|
419
|
+
if (id === null) return null;
|
|
420
|
+
const providerID = modelProvider(ref, models);
|
|
421
|
+
const segment = id.slice(id.lastIndexOf("/") + 1);
|
|
422
|
+
return {
|
|
423
|
+
key: `${providerID ?? ""}\u0000${id}`,
|
|
424
|
+
id,
|
|
425
|
+
providerID,
|
|
426
|
+
label: segment || id
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
function tokenCount(message) {
|
|
430
|
+
const tokens = asRecord(message.tokens);
|
|
431
|
+
if (!tokens) return null;
|
|
432
|
+
const cache = asRecord(tokens.cache);
|
|
433
|
+
const reported = [
|
|
434
|
+
tokens.input,
|
|
435
|
+
tokens.output,
|
|
436
|
+
tokens.reasoning,
|
|
437
|
+
cache?.read,
|
|
438
|
+
cache?.write
|
|
439
|
+
].filter((value) => typeof value === "number" && Number.isFinite(value) && value >= 0);
|
|
440
|
+
return reported.length === 0 ? null : reported.reduce((sum, value) => sum + value, 0);
|
|
441
|
+
}
|
|
442
|
+
function contextLimit(ref, models) {
|
|
443
|
+
const id = modelID(ref);
|
|
444
|
+
if (id === null) return null;
|
|
445
|
+
const providerID = modelProvider(ref, models);
|
|
446
|
+
if (providerID === null) return null;
|
|
447
|
+
const segment = id.slice(id.lastIndexOf("/") + 1);
|
|
448
|
+
const matches = models.filter((value) => {
|
|
449
|
+
const model = asRecord(value);
|
|
450
|
+
if (!model) return false;
|
|
451
|
+
return (model.id === id || model.modelID === id || model.id === segment || model.modelID === segment) && model.providerID === providerID;
|
|
452
|
+
});
|
|
453
|
+
const limits = /* @__PURE__ */ new Set();
|
|
454
|
+
for (const candidate of matches) {
|
|
455
|
+
const limit = asRecord(asRecord(candidate)?.limit)?.context;
|
|
456
|
+
if (typeof limit === "number" && Number.isFinite(limit) && limit > 0) limits.add(limit);
|
|
457
|
+
}
|
|
458
|
+
return limits.size === 1 ? [...limits][0] ?? null : null;
|
|
459
|
+
}
|
|
460
|
+
function liveTranscriptWindow(messages, revertMessageID) {
|
|
461
|
+
let end = messages.length;
|
|
462
|
+
if (revertMessageID) {
|
|
463
|
+
const boundary = messages.findIndex((message) => asRecord(message)?.id === revertMessageID);
|
|
464
|
+
if (boundary >= 0) end = boundary;
|
|
465
|
+
}
|
|
466
|
+
let start = 0;
|
|
467
|
+
for (let index = end - 1; index >= 0; index -= 1) if (asRecord(messages[index])?.type === "compaction") {
|
|
468
|
+
start = index + 1;
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
return {
|
|
472
|
+
start,
|
|
473
|
+
end
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
function latestContext(messages, modelRef, models, revertMessageID) {
|
|
477
|
+
const target = modelIdentity(modelRef, models);
|
|
478
|
+
if (target === null || target.providerID === null) return null;
|
|
479
|
+
const limit = contextLimit(modelRef, models);
|
|
480
|
+
if (limit === null || limit <= 0) return null;
|
|
481
|
+
const { start, end } = liveTranscriptWindow(messages, revertMessageID);
|
|
482
|
+
for (let index = end - 1; index >= start; index -= 1) {
|
|
483
|
+
const message = asRecord(messages[index]);
|
|
484
|
+
if (message?.type !== "assistant") continue;
|
|
485
|
+
const identity = modelIdentity(messageModelRef(message), models);
|
|
486
|
+
if (identity?.id !== target.id || identity.providerID !== target.providerID) continue;
|
|
487
|
+
const tokens = tokenCount(message);
|
|
488
|
+
if (tokens === null || tokens <= 0) continue;
|
|
489
|
+
return {
|
|
490
|
+
tokens,
|
|
491
|
+
percent: Math.round(tokens / limit * 100),
|
|
492
|
+
limit
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
return null;
|
|
496
|
+
}
|
|
497
|
+
/** Snapshot for one exact model identity in the bounded active transcript. */
|
|
498
|
+
function resolveModelContextSnapshot(messages, modelRef, models, revertMessageID) {
|
|
499
|
+
return latestContext(messages.slice(-400), modelRef, models, revertMessageID);
|
|
500
|
+
}
|
|
501
|
+
/** Select the pinned chat model before transcript or configured-agent fallbacks. */
|
|
502
|
+
function resolveActiveModelRef(sessionModel, activeMessages, fallbackModel = null) {
|
|
503
|
+
if (modelID(sessionModel) !== null) return sessionModel;
|
|
504
|
+
const firstMessage = Math.max(0, activeMessages.length - 400);
|
|
505
|
+
for (let index = activeMessages.length - 1; index >= firstMessage; index -= 1) {
|
|
506
|
+
const message = asRecord(activeMessages[index]);
|
|
507
|
+
if (message?.type !== "assistant") continue;
|
|
508
|
+
const ref = messageModelRef(message);
|
|
509
|
+
if (modelID(ref) !== null) return ref;
|
|
510
|
+
}
|
|
511
|
+
return modelID(fallbackModel) === null ? null : fallbackModel;
|
|
512
|
+
}
|
|
214
513
|
/** Native token total: input + output + reasoning + cache read + cache write. */
|
|
215
514
|
function messageTokensTotal(tokens) {
|
|
216
515
|
const cacheRead = numberOrNull(tokens?.cache?.read) ?? 0;
|
|
@@ -260,17 +559,6 @@ function computeContextUsage(messages, contextLimit, revertMessageID) {
|
|
|
260
559
|
}
|
|
261
560
|
return null;
|
|
262
561
|
}
|
|
263
|
-
/** Semantic tone for a context percentage, inclusive at the top of each band:
|
|
264
|
-
* info (blue) up to 25%, success (green) up to 50%, warning (yellow) up to
|
|
265
|
-
* 90%, error (red) above it. Four explicit stages, each backed by a feedback
|
|
266
|
-
* token, so the gauge follows the active theme. Pure. */
|
|
267
|
-
function contextUsageTone(percent) {
|
|
268
|
-
if (percent > 90) return "error";
|
|
269
|
-
if (percent > 50) return "warning";
|
|
270
|
-
if (percent > 25) return "success";
|
|
271
|
-
return "info";
|
|
272
|
-
}
|
|
273
|
-
/** The gauge's four stages, one per theme feedback token. */
|
|
274
562
|
/** Color for one gauge stage. Filled cells and the percent value both come from
|
|
275
563
|
* this one call, so the bar and its number can never disagree. `theme` is the
|
|
276
564
|
* host's resolved theme (loosely typed at runtime); a missing token falls back
|
|
@@ -362,58 +650,6 @@ function turnTokensPerSecond(messages, position) {
|
|
|
362
650
|
}
|
|
363
651
|
/** Last-message telemetry the Context block renders in muted text. Both halves
|
|
364
652
|
* are optional; the block renders no line when neither is available. */
|
|
365
|
-
/** Thousands-separated token total: `55320` → `55,320` (en-US, matching the
|
|
366
|
-
* native block this one replaces). Null for a missing/invalid value. Pure. */
|
|
367
|
-
function formatTokenCount(tokens) {
|
|
368
|
-
const value = numberOrNull(tokens);
|
|
369
|
-
if (value === null || value < 0) return null;
|
|
370
|
-
return Math.round(value).toLocaleString("en-US");
|
|
371
|
-
}
|
|
372
|
-
/** Context-window label: `1_000_000` → `1.0M`, `200_000` → `200K`,
|
|
373
|
-
* `128_000` → `128K`, `32_768` → `32K`. Sub-million limits truncate to whole K
|
|
374
|
-
* so the printed window never overstates the model's capacity. Pure. */
|
|
375
|
-
function formatContextWindow(limit) {
|
|
376
|
-
const value = numberOrNull(limit);
|
|
377
|
-
if (value === null || value <= 0) return null;
|
|
378
|
-
if (value >= 1e6) return `${(value / 1e6).toFixed(1)}M`;
|
|
379
|
-
if (value >= 1e3) return `${Math.floor(value / 1e3)}K`;
|
|
380
|
-
return `${Math.floor(value)}`;
|
|
381
|
-
}
|
|
382
|
-
/** Cells in the Context gauge: always rendered in full, so the bar never
|
|
383
|
-
* changes width between refreshes. With the space, the percent and the
|
|
384
|
-
* `of <window>` tail (at most 9 columns) the line stays inside 34 columns. */
|
|
385
|
-
const CONTEXT_BAR_CELLS = 12;
|
|
386
|
-
/** Filled cell (U+25B0) and empty cell (U+25B1), both single-width. */
|
|
387
|
-
const CONTEXT_BAR_FILLED_CELL = "▰";
|
|
388
|
-
const CONTEXT_BAR_EMPTY_CELL = "▱";
|
|
389
|
-
/** Filled cells for a percentage: rounded, clamped to `0..cells`, so 0% is an
|
|
390
|
-
* empty bar and anything at or above 100% is a full one. Pure. */
|
|
391
|
-
function contextBarFilled(percent, cells = 12) {
|
|
392
|
-
const total = Math.max(1, Math.floor(cells));
|
|
393
|
-
const filled = Math.round(percent / 100 * total);
|
|
394
|
-
if (!Number.isFinite(filled)) return 0;
|
|
395
|
-
return Math.min(total, Math.max(0, filled));
|
|
396
|
-
}
|
|
397
|
-
/** The gauge split into its toned half (filled cells) and its muted half (empty
|
|
398
|
-
* cells), so the caller colors each side. Null when the percentage is missing:
|
|
399
|
-
* the Context block then keeps its tokens + cost rows and renders no bar. Pure. */
|
|
400
|
-
function contextBar(percent, cells = 12) {
|
|
401
|
-
const value = numberOrNull(percent);
|
|
402
|
-
if (value === null) return null;
|
|
403
|
-
const total = Math.max(1, Math.floor(cells));
|
|
404
|
-
const filled = contextBarFilled(value, total);
|
|
405
|
-
return {
|
|
406
|
-
filled: "▰".repeat(filled),
|
|
407
|
-
empty: "▱".repeat(total - filled)
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
/** USD spent with two decimals (`$0.18`), the native block's format. Null for
|
|
411
|
-
* a missing/negative value. Pure. */
|
|
412
|
-
function formatSpent(cost) {
|
|
413
|
-
const value = numberOrNull(cost);
|
|
414
|
-
if (value === null || value < 0) return null;
|
|
415
|
-
return `$${value.toFixed(2)}`;
|
|
416
|
-
}
|
|
417
653
|
/** One rendered context row. `lead` and `tail` carry the gauge bar when the row
|
|
418
654
|
* has one (`lead` is toned with the value, `tail` is muted), so the 12 cells
|
|
419
655
|
* stay contiguous while the empty half still reads as background. */
|
|
@@ -430,7 +666,7 @@ function contextBlockRows(usage, cost) {
|
|
|
430
666
|
lead: null,
|
|
431
667
|
value: spentValue,
|
|
432
668
|
tail: null,
|
|
433
|
-
suffix: "
|
|
669
|
+
suffix: " gasto na sessão",
|
|
434
670
|
tone: null
|
|
435
671
|
};
|
|
436
672
|
if (usage === null) return spent === null ? null : {
|
|
@@ -463,12 +699,6 @@ function contextBlockRows(usage, cost) {
|
|
|
463
699
|
spent
|
|
464
700
|
};
|
|
465
701
|
}
|
|
466
|
-
/** Models rendered in the Context block before the aggregate `… +N` line. */
|
|
467
|
-
const MODEL_USAGE_VISIBLE_CEILING = 3;
|
|
468
|
-
/** Newest messages read per session — bounds the O(n) walk on long sessions. */
|
|
469
|
-
const MODEL_USAGE_MESSAGE_LIMIT = 400;
|
|
470
|
-
/** Sessions read per family (root + delegations) for the aggregate. */
|
|
471
|
-
const MODEL_USAGE_SESSION_LIMIT = 8;
|
|
472
702
|
/** Column widths for one model row (labels are muted, numbers right-aligned). */
|
|
473
703
|
const MODEL_USAGE_MODEL_WIDTH = 12;
|
|
474
704
|
const MODEL_USAGE_TOKEN_WIDTH = 6;
|
|
@@ -490,15 +720,15 @@ function collectModelUsage(messages) {
|
|
|
490
720
|
const model = shortModelID(message.model, 12);
|
|
491
721
|
if (id === null || model === null) continue;
|
|
492
722
|
const key = `${typeof message.model?.providerID === "string" ? message.model.providerID : ""}\u0000${id}`;
|
|
493
|
-
const
|
|
723
|
+
const tokensTotal = message.tokens ? messageTokensTotal(message.tokens) : 0;
|
|
494
724
|
const cost = numberOrNull(message.cost) ?? 0;
|
|
495
725
|
const current = totals.get(key);
|
|
496
726
|
if (current) {
|
|
497
|
-
current.tokens += Math.max(0,
|
|
727
|
+
current.tokens += Math.max(0, tokensTotal);
|
|
498
728
|
current.cost += Math.max(0, cost);
|
|
499
729
|
} else totals.set(key, {
|
|
500
730
|
model,
|
|
501
|
-
tokens: Math.max(0,
|
|
731
|
+
tokens: Math.max(0, tokensTotal),
|
|
502
732
|
cost: Math.max(0, cost)
|
|
503
733
|
});
|
|
504
734
|
}
|
|
@@ -549,6 +779,59 @@ function modelUsageRows(rows) {
|
|
|
549
779
|
function modelUsageRowText(row) {
|
|
550
780
|
return `${row.model.padEnd(12)} ${row.tokens.padStart(6)} ${row.cost.padStart(8)}`;
|
|
551
781
|
}
|
|
782
|
+
/** Wrap on grapheme boundaries, measuring terminal cells rather than code units.
|
|
783
|
+
* (Body moved verbatim from the removed quota module's `quotaTextLines`.) */
|
|
784
|
+
function wrapTextLines(text, width, indent) {
|
|
785
|
+
const max = Number.isFinite(width) ? Math.max(0, Math.floor(width)) : 0;
|
|
786
|
+
if (max < 1) return [];
|
|
787
|
+
const padding = " ".repeat(Math.min(Math.max(0, indent), Math.max(0, max - 2)));
|
|
788
|
+
const lines = [];
|
|
789
|
+
let line = padding;
|
|
790
|
+
const segmenter = new Intl.Segmenter();
|
|
791
|
+
for (const word of text.trim().split(/\s+/)) {
|
|
792
|
+
if (!word) continue;
|
|
793
|
+
if (line.trim() && cellWidth(line) + 1 + cellWidth(word) > max) {
|
|
794
|
+
lines.push(line.trimEnd());
|
|
795
|
+
line = padding;
|
|
796
|
+
}
|
|
797
|
+
if (line.trim()) line += " ";
|
|
798
|
+
for (const { segment } of segmenter.segment(word)) {
|
|
799
|
+
const glyphWidth = cellWidth(segment);
|
|
800
|
+
if (glyphWidth > max) continue;
|
|
801
|
+
if (cellWidth(line) + glyphWidth > max) {
|
|
802
|
+
if (line.trim()) lines.push(line.trimEnd());
|
|
803
|
+
line = glyphWidth + cellWidth(padding) <= max ? padding : "";
|
|
804
|
+
}
|
|
805
|
+
line += segment;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
if (line.trim()) lines.push(line.trimEnd());
|
|
809
|
+
return lines;
|
|
810
|
+
}
|
|
811
|
+
/** Wrap sidebar text by terminal cells, preserving the complete values. */
|
|
812
|
+
function sidebarTextLines(value) {
|
|
813
|
+
return wrapTextLines(value, 34, 0);
|
|
814
|
+
}
|
|
815
|
+
/** Align a monetary value when it fits, otherwise preserve it on a new line. */
|
|
816
|
+
function sidebarMoneyLines(label, value) {
|
|
817
|
+
const gap = 34 - cellWidth(label) - cellWidth(value);
|
|
818
|
+
return gap >= 1 ? [`${label}${" ".repeat(gap)}${value}`] : [...sidebarTextLines(label), ...sidebarTextLines(value)];
|
|
819
|
+
}
|
|
820
|
+
/** Keep the existing OpenCode periods together when possible. */
|
|
821
|
+
function contextSpendLines(value) {
|
|
822
|
+
const match = /^(.*\S)\s+(<?\$\S+)$/.exec(value);
|
|
823
|
+
return match?.[1] && match[2] && cellWidth(value) <= 34 ? sidebarMoneyLines(match[1], match[2]) : sidebarTextLines(value);
|
|
824
|
+
}
|
|
825
|
+
/** Keep ordinary rows aligned; give oversized values their own lines. */
|
|
826
|
+
function modelUsageRowLines(row) {
|
|
827
|
+
const single = modelUsageRowText(row);
|
|
828
|
+
if (cellWidth(single) <= 34) return [single];
|
|
829
|
+
return [
|
|
830
|
+
...sidebarTextLines(row.model),
|
|
831
|
+
...sidebarTextLines(`Tokens ${row.tokens}`),
|
|
832
|
+
...sidebarTextLines(`USD ${row.cost}`)
|
|
833
|
+
];
|
|
834
|
+
}
|
|
552
835
|
/** Muted aggregate line for the models beyond the cap (`… +2 $0.03`). Null
|
|
553
836
|
* when every model fits. Pure. */
|
|
554
837
|
function hiddenModelUsageText(hidden, hiddenCost) {
|
|
@@ -912,10 +1195,10 @@ function statsRangeMatches(range, sent, scale) {
|
|
|
912
1195
|
const asMilliseconds = Math.abs(from - sent.from * scale) <= 12e4 && Math.abs(to - sent.to * scale) <= 12e4;
|
|
913
1196
|
return sameUnit || asMilliseconds;
|
|
914
1197
|
}
|
|
915
|
-
/** The `Context` block's last line:
|
|
916
|
-
* (`hoje $0.42 · 30d $9.80`). A window without a
|
|
917
|
-
* no usable window at all yields null so the
|
|
918
|
-
* dropped. Pure. */
|
|
1198
|
+
/** The `Context` block's last line: OpenCode stats source and both spend windows
|
|
1199
|
+
* on one muted row (`OpenCode · hoje $0.42 · 30d $9.80`). A window without a
|
|
1200
|
+
* usable amount is omitted, and no usable window at all yields null so the
|
|
1201
|
+
* line (and not the block) is dropped. Pure. */
|
|
919
1202
|
function contextSpendLine(totals) {
|
|
920
1203
|
if (totals === null) return null;
|
|
921
1204
|
const parts = [];
|
|
@@ -923,130 +1206,10 @@ function contextSpendLine(totals) {
|
|
|
923
1206
|
if (today !== null) parts.push(`${SPEND_TODAY_LABEL} ${today}`);
|
|
924
1207
|
const thirtyDays = formatSpendUSD(totals.thirtyDays);
|
|
925
1208
|
if (thirtyDays !== null) parts.push(`30d ${thirtyDays}`);
|
|
926
|
-
return parts.length === 0 ? null : parts.join(SPEND_LINE_SEPARATOR)
|
|
1209
|
+
return parts.length === 0 ? null : `OpenCode${SPEND_LINE_SEPARATOR}${parts.join(SPEND_LINE_SEPARATOR)}`;
|
|
927
1210
|
}
|
|
928
1211
|
/** Grapheme iterator: a cut never splits a surrogate pair, a combining mark
|
|
929
1212
|
* from its base or a ZWJ emoji sequence, so truncation stays cell-exact. */
|
|
930
|
-
const GRAPHEMES = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
931
|
-
/** A grapheme the host draws two cells wide: emoji presentation, an extended
|
|
932
|
-
* pictograph (a bare `❤` counts too, exactly as the host's `emoji-regex`
|
|
933
|
-
* does) and a regional-indicator pair (a flag). */
|
|
934
|
-
const EMOJI_GLYPH = /\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{Regional_Indicator}/u;
|
|
935
|
-
/** VS16 asks for emoji presentation; without it `1` is one cell, with it the
|
|
936
|
-
* keycap sequence is drawn as one two-cell glyph. */
|
|
937
|
-
const EMOJI_PRESENTATION_SELECTOR = "️";
|
|
938
|
-
/** Unicode default-ignorable code points carry no width of their own. */
|
|
939
|
-
const IGNORABLE_GLYPH = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
940
|
-
/** East Asian Wide/Fullwidth ranges — two cells, never the ambiguous width
|
|
941
|
-
* (the host measures ambiguous as narrow, so `▸`/`✓`/`—` stay one cell).
|
|
942
|
-
* Generated from the host's own measurement (`string-width` over every code
|
|
943
|
-
* point, emoji excluded), so this table can be regenerated verbatim when the
|
|
944
|
-
* host upgrades its Unicode data instead of being hand-edited. */
|
|
945
|
-
const CELL_WIDE_RANGES = [
|
|
946
|
-
[4352, 4446],
|
|
947
|
-
[9001, 9002],
|
|
948
|
-
[9776, 9783],
|
|
949
|
-
[9866, 9871],
|
|
950
|
-
[11904, 11929],
|
|
951
|
-
[11931, 12019],
|
|
952
|
-
[12032, 12245],
|
|
953
|
-
[12272, 12335],
|
|
954
|
-
[12337, 12348],
|
|
955
|
-
[12350, 12350],
|
|
956
|
-
[12353, 12438],
|
|
957
|
-
[12441, 12543],
|
|
958
|
-
[12549, 12591],
|
|
959
|
-
[12593, 12643],
|
|
960
|
-
[12645, 12686],
|
|
961
|
-
[12688, 12773],
|
|
962
|
-
[12783, 12830],
|
|
963
|
-
[12832, 12871],
|
|
964
|
-
[12880, 12950],
|
|
965
|
-
[12952, 12952],
|
|
966
|
-
[12954, 42124],
|
|
967
|
-
[42128, 42182],
|
|
968
|
-
[43360, 43388],
|
|
969
|
-
[44032, 55203],
|
|
970
|
-
[63744, 64255],
|
|
971
|
-
[65040, 65049],
|
|
972
|
-
[65072, 65106],
|
|
973
|
-
[65108, 65126],
|
|
974
|
-
[65128, 65131],
|
|
975
|
-
[65281, 65376],
|
|
976
|
-
[65504, 65510],
|
|
977
|
-
[94176, 94180],
|
|
978
|
-
[94192, 94198],
|
|
979
|
-
[94208, 101594],
|
|
980
|
-
[101631, 101664],
|
|
981
|
-
[101760, 101874],
|
|
982
|
-
[101888, 102801],
|
|
983
|
-
[102816, 102866],
|
|
984
|
-
[110576, 110579],
|
|
985
|
-
[110581, 110587],
|
|
986
|
-
[110589, 110590],
|
|
987
|
-
[110592, 110888],
|
|
988
|
-
[110898, 110898],
|
|
989
|
-
[110928, 110930],
|
|
990
|
-
[110933, 110933],
|
|
991
|
-
[110948, 110952],
|
|
992
|
-
[110960, 111355],
|
|
993
|
-
[119552, 119638],
|
|
994
|
-
[119648, 119670],
|
|
995
|
-
[127488, 127488],
|
|
996
|
-
[127504, 127513],
|
|
997
|
-
[127515, 127534],
|
|
998
|
-
[127536, 127537],
|
|
999
|
-
[127547, 127547],
|
|
1000
|
-
[127552, 127560],
|
|
1001
|
-
[127584, 127589],
|
|
1002
|
-
[131072, 196605],
|
|
1003
|
-
[196608, 262141]
|
|
1004
|
-
];
|
|
1005
|
-
/** One code point the terminal draws no cell for: control characters, the
|
|
1006
|
-
* zero-width joiners/marks, combining marks and variation selectors. */
|
|
1007
|
-
function isZeroWidthCodePoint(code, glyph) {
|
|
1008
|
-
if (code <= 31 || code >= 127 && code <= 159) return true;
|
|
1009
|
-
if (code >= 8203 && code <= 8207) return true;
|
|
1010
|
-
if (code === 65279) return true;
|
|
1011
|
-
if (code >= 768 && code <= 879) return true;
|
|
1012
|
-
if (code >= 6832 && code <= 6911) return true;
|
|
1013
|
-
if (code >= 7616 && code <= 7679) return true;
|
|
1014
|
-
if (code >= 8400 && code <= 8447) return true;
|
|
1015
|
-
if (code >= 65024 && code <= 65039) return true;
|
|
1016
|
-
if (code >= 65056 && code <= 65071) return true;
|
|
1017
|
-
if (code >= 917760 && code <= 917999) return true;
|
|
1018
|
-
if (code >= 55296 && code <= 57343) return true;
|
|
1019
|
-
return IGNORABLE_GLYPH.test(glyph);
|
|
1020
|
-
}
|
|
1021
|
-
function isWideCodePoint(code) {
|
|
1022
|
-
for (const [low, high] of CELL_WIDE_RANGES) {
|
|
1023
|
-
if (code < low) return false;
|
|
1024
|
-
if (code <= high) return true;
|
|
1025
|
-
}
|
|
1026
|
-
return false;
|
|
1027
|
-
}
|
|
1028
|
-
/** Cells one grapheme occupies. */
|
|
1029
|
-
function graphemeWidth(segment) {
|
|
1030
|
-
if (EMOJI_GLYPH.test(segment)) return 2;
|
|
1031
|
-
if (segment.length > 1 && segment.includes(EMOJI_PRESENTATION_SELECTOR)) return 2;
|
|
1032
|
-
let width = 0;
|
|
1033
|
-
for (const glyph of segment) {
|
|
1034
|
-
const code = glyph.codePointAt(0) ?? 0;
|
|
1035
|
-
if (isZeroWidthCodePoint(code, glyph)) continue;
|
|
1036
|
-
width += isWideCodePoint(code) ? 2 : 1;
|
|
1037
|
-
}
|
|
1038
|
-
return width;
|
|
1039
|
-
}
|
|
1040
|
-
/** Terminal cells `value` occupies — the unit every column in this plugin is
|
|
1041
|
-
* measured in. Mirrors the host (that is how `@opentui/core` sizes a text
|
|
1042
|
-
* run): emoji count as two cells, East Asian Wide/Fullwidth as two, East
|
|
1043
|
-
* Asian Ambiguous as one, combining marks and variation selectors as none.
|
|
1044
|
-
* Pure. */
|
|
1045
|
-
function cellWidth(value) {
|
|
1046
|
-
let width = 0;
|
|
1047
|
-
for (const { segment } of GRAPHEMES.segment(value)) width += graphemeWidth(segment);
|
|
1048
|
-
return width;
|
|
1049
|
-
}
|
|
1050
1213
|
/** Clamp a free-form label to `max` terminal cells without wrapping. The width
|
|
1051
1214
|
* is measured in display cells, never in UTF-16 code units: a CJK or emoji
|
|
1052
1215
|
* label used to overflow the column it was cut for (`計画の移行` is 5 code
|
|
@@ -1084,9 +1247,9 @@ const HEADER_MAX_WIDTH = 34;
|
|
|
1084
1247
|
function presetHeaderLine(presetName, providerID) {
|
|
1085
1248
|
const base = `▸ ${presetName.trim() === "" ? "default" : presetName.trim()}`;
|
|
1086
1249
|
const provider = providerID === null ? "" : providerID.trim();
|
|
1087
|
-
if (provider === "") return truncateLabel(base,
|
|
1088
|
-
const room =
|
|
1089
|
-
if (room < 2) return truncateLabel(base,
|
|
1250
|
+
if (provider === "") return truncateLabel(base, HEADER_MAX_WIDTH);
|
|
1251
|
+
const room = HEADER_MAX_WIDTH - `${base} · `.length;
|
|
1252
|
+
if (room < 2) return truncateLabel(base, HEADER_MAX_WIDTH);
|
|
1090
1253
|
return `${base} · ${truncateLabel(provider, room)}`;
|
|
1091
1254
|
}
|
|
1092
1255
|
/** One classification plus the evidence that produced it. */
|
|
@@ -2731,18 +2894,17 @@ function createSidebarModel(context, sessionID, gitExec = defaultGitExec) {
|
|
|
2731
2894
|
}
|
|
2732
2895
|
});
|
|
2733
2896
|
const contextUsage = createMemo(() => {
|
|
2734
|
-
const list = messages();
|
|
2897
|
+
const list = messages().slice(-400);
|
|
2735
2898
|
if (list.length === 0) return null;
|
|
2736
2899
|
const refs = modelRefs();
|
|
2737
|
-
const ref =
|
|
2738
|
-
|
|
2900
|
+
const ref = resolveActiveModelRef(refs.sessionRef, list, refs.agentRef);
|
|
2901
|
+
if (ref === null) return null;
|
|
2902
|
+
let models = [];
|
|
2739
2903
|
try {
|
|
2740
|
-
const
|
|
2741
|
-
|
|
2742
|
-
} catch {
|
|
2743
|
-
|
|
2744
|
-
}
|
|
2745
|
-
return computeContextUsage(list, limit, session()?.revert?.messageID);
|
|
2904
|
+
const result = context.data.location?.model?.list?.(location);
|
|
2905
|
+
if (Array.isArray(result)) models = result;
|
|
2906
|
+
} catch {}
|
|
2907
|
+
return resolveModelContextSnapshot(list, ref, models, session()?.revert?.messageID);
|
|
2746
2908
|
});
|
|
2747
2909
|
const cachePerformance = createMemo(() => {
|
|
2748
2910
|
const message = lastAssistantWithTokens(messages(), session()?.revert?.messageID);
|
|
@@ -2874,47 +3036,96 @@ function createSidebarModel(context, sessionID, gitExec = defaultGitExec) {
|
|
|
2874
3036
|
* cells), the value, the muted gauge tail (empty cells) and the muted unit
|
|
2875
3037
|
* suffix (`tokens` / `of 200K` / `spent`). */
|
|
2876
3038
|
function ContextRowView(props) {
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
3039
|
+
const fullWidth = () => cellWidth(`${props.row.lead ?? ""}${props.row.tail ?? ""}${props.row.value}${props.row.suffix ?? ""}`);
|
|
3040
|
+
return createComponent(Show, {
|
|
3041
|
+
get when() {
|
|
3042
|
+
return props.row.suffix !== " gasto na sessão";
|
|
3043
|
+
},
|
|
3044
|
+
get fallback() {
|
|
3045
|
+
return (() => {
|
|
3046
|
+
var _el$3 = createElement("box");
|
|
3047
|
+
setProp(_el$3, "flexDirection", "column");
|
|
3048
|
+
insert(_el$3, createComponent(For, {
|
|
3049
|
+
get each() {
|
|
3050
|
+
return sidebarMoneyLines("gasto na sessão", props.row.value);
|
|
3051
|
+
},
|
|
3052
|
+
children: (line) => (() => {
|
|
3053
|
+
var _el$4 = createElement("text");
|
|
3054
|
+
insert(_el$4, line);
|
|
3055
|
+
effect((_$p) => setProp(_el$4, "fg", props.fg, _$p));
|
|
3056
|
+
return _el$4;
|
|
3057
|
+
})()
|
|
3058
|
+
}));
|
|
2889
3059
|
return _el$3;
|
|
2890
|
-
})()
|
|
2891
|
-
}
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
3060
|
+
})();
|
|
3061
|
+
},
|
|
3062
|
+
get children() {
|
|
3063
|
+
return createComponent(Show, {
|
|
3064
|
+
get when() {
|
|
3065
|
+
return fullWidth() <= 34;
|
|
3066
|
+
},
|
|
3067
|
+
get fallback() {
|
|
3068
|
+
return (() => {
|
|
3069
|
+
var _el$5 = createElement("box");
|
|
3070
|
+
setProp(_el$5, "flexDirection", "column");
|
|
3071
|
+
insert(_el$5, createComponent(For, {
|
|
3072
|
+
get each() {
|
|
3073
|
+
return sidebarTextLines(`${props.row.value.trim()}${props.row.suffix ?? ""}`);
|
|
3074
|
+
},
|
|
3075
|
+
children: (line) => (() => {
|
|
3076
|
+
var _el$6 = createElement("text");
|
|
3077
|
+
insert(_el$6, line);
|
|
3078
|
+
effect((_$p) => setProp(_el$6, "fg", props.fg, _$p));
|
|
3079
|
+
return _el$6;
|
|
3080
|
+
})()
|
|
3081
|
+
}));
|
|
3082
|
+
return _el$5;
|
|
3083
|
+
})();
|
|
3084
|
+
},
|
|
3085
|
+
get children() {
|
|
3086
|
+
var _el$ = createElement("box"), _el$2 = createElement("text");
|
|
3087
|
+
insertNode(_el$, _el$2);
|
|
3088
|
+
setProp(_el$, "flexDirection", "row");
|
|
3089
|
+
insert(_el$, createComponent(Show, {
|
|
3090
|
+
get when() {
|
|
3091
|
+
return props.row.lead;
|
|
3092
|
+
},
|
|
3093
|
+
children: (lead) => (() => {
|
|
3094
|
+
var _el$7 = createElement("text");
|
|
3095
|
+
insert(_el$7, lead);
|
|
3096
|
+
effect((_$p) => setProp(_el$7, "fg", props.fg, _$p));
|
|
3097
|
+
return _el$7;
|
|
3098
|
+
})()
|
|
3099
|
+
}), _el$2);
|
|
3100
|
+
insert(_el$, createComponent(Show, {
|
|
3101
|
+
get when() {
|
|
3102
|
+
return props.row.tail;
|
|
3103
|
+
},
|
|
3104
|
+
children: (tail) => (() => {
|
|
3105
|
+
var _el$8 = createElement("text");
|
|
3106
|
+
insert(_el$8, tail);
|
|
3107
|
+
effect((_$p) => setProp(_el$8, "fg", props.muted, _$p));
|
|
3108
|
+
return _el$8;
|
|
3109
|
+
})()
|
|
3110
|
+
}), _el$2);
|
|
3111
|
+
insert(_el$2, () => props.row.value);
|
|
3112
|
+
insert(_el$, createComponent(Show, {
|
|
3113
|
+
get when() {
|
|
3114
|
+
return props.row.suffix;
|
|
3115
|
+
},
|
|
3116
|
+
children: (suffix) => (() => {
|
|
3117
|
+
var _el$9 = createElement("text");
|
|
3118
|
+
insert(_el$9, suffix);
|
|
3119
|
+
effect((_$p) => setProp(_el$9, "fg", props.muted, _$p));
|
|
3120
|
+
return _el$9;
|
|
3121
|
+
})()
|
|
3122
|
+
}), null);
|
|
3123
|
+
effect((_$p) => setProp(_el$2, "fg", props.fg, _$p));
|
|
3124
|
+
return _el$;
|
|
3125
|
+
}
|
|
3126
|
+
});
|
|
3127
|
+
}
|
|
3128
|
+
});
|
|
2918
3129
|
}
|
|
2919
3130
|
/** Block title: a muted single-width glyph, then the bold label. The fixed
|
|
2920
3131
|
* header at the top of the sidebar deliberately renders no icon. `summary` is
|
|
@@ -2922,34 +3133,34 @@ function ContextRowView(props) {
|
|
|
2922
3133
|
* stays one line. */
|
|
2923
3134
|
function BlockHeader(props) {
|
|
2924
3135
|
return (() => {
|
|
2925
|
-
var _el$
|
|
2926
|
-
insertNode(_el$
|
|
2927
|
-
insertNode(_el$
|
|
2928
|
-
setProp(_el$
|
|
2929
|
-
insert(_el$
|
|
2930
|
-
setProp(_el$
|
|
2931
|
-
insert(_el$
|
|
2932
|
-
insert(_el$
|
|
3136
|
+
var _el$0 = createElement("box"), _el$1 = createElement("text"), _el$10 = createElement("text");
|
|
3137
|
+
insertNode(_el$0, _el$1);
|
|
3138
|
+
insertNode(_el$0, _el$10);
|
|
3139
|
+
setProp(_el$0, "flexDirection", "row");
|
|
3140
|
+
insert(_el$1, () => `${props.icon} `);
|
|
3141
|
+
setProp(_el$10, "attributes", 1);
|
|
3142
|
+
insert(_el$10, () => props.label);
|
|
3143
|
+
insert(_el$0, createComponent(Show, {
|
|
2933
3144
|
get when() {
|
|
2934
3145
|
return props.summary;
|
|
2935
3146
|
},
|
|
2936
3147
|
children: (summary) => (() => {
|
|
2937
|
-
var _el$
|
|
2938
|
-
insert(_el$
|
|
2939
|
-
effect((_$p) => setProp(_el$
|
|
2940
|
-
return _el$
|
|
3148
|
+
var _el$11 = createElement("text");
|
|
3149
|
+
insert(_el$11, () => `${SPEND_LINE_SEPARATOR}${summary()}`);
|
|
3150
|
+
effect((_$p) => setProp(_el$11, "fg", props.muted, _$p));
|
|
3151
|
+
return _el$11;
|
|
2941
3152
|
})()
|
|
2942
3153
|
}), null);
|
|
2943
3154
|
effect((_p$) => {
|
|
2944
3155
|
var _v$ = props.muted, _v$2 = props.fg;
|
|
2945
|
-
_v$ !== _p$.e && (_p$.e = setProp(_el$
|
|
2946
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$
|
|
3156
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$1, "fg", _v$, _p$.e));
|
|
3157
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$10, "fg", _v$2, _p$.t));
|
|
2947
3158
|
return _p$;
|
|
2948
3159
|
}, {
|
|
2949
3160
|
e: void 0,
|
|
2950
3161
|
t: void 0
|
|
2951
3162
|
});
|
|
2952
|
-
return _el$
|
|
3163
|
+
return _el$0;
|
|
2953
3164
|
})();
|
|
2954
3165
|
}
|
|
2955
3166
|
function Sidebar(props) {
|
|
@@ -2979,62 +3190,62 @@ function Sidebar(props) {
|
|
|
2979
3190
|
};
|
|
2980
3191
|
const failedSuffix = () => failedSuffixText(dispatchView()?.failures);
|
|
2981
3192
|
return (() => {
|
|
2982
|
-
var _el$
|
|
2983
|
-
insertNode(_el$
|
|
2984
|
-
insertNode(_el$
|
|
2985
|
-
setProp(_el$
|
|
2986
|
-
setProp(_el$
|
|
2987
|
-
setProp(_el$
|
|
2988
|
-
setProp(_el$
|
|
2989
|
-
insert(_el$
|
|
2990
|
-
insert(_el$
|
|
2991
|
-
insert(_el$
|
|
3193
|
+
var _el$12 = createElement("box"), _el$13 = createElement("text"), _el$14 = createElement("text");
|
|
3194
|
+
insertNode(_el$12, _el$13);
|
|
3195
|
+
insertNode(_el$12, _el$14);
|
|
3196
|
+
setProp(_el$12, "flexDirection", "column");
|
|
3197
|
+
setProp(_el$12, "width", "100%");
|
|
3198
|
+
setProp(_el$12, "padding", 1);
|
|
3199
|
+
setProp(_el$13, "attributes", 1);
|
|
3200
|
+
insert(_el$13, `Pantheon v1.6.2-beta.10`);
|
|
3201
|
+
insert(_el$14, () => presetHeaderLine(model.preset().name ?? "", model.provider()));
|
|
3202
|
+
insert(_el$12, createComponent(Show, {
|
|
2992
3203
|
get when() {
|
|
2993
3204
|
return memo(() => model.activeSessionID() !== "")() && model.session();
|
|
2994
3205
|
},
|
|
2995
3206
|
get fallback() {
|
|
2996
3207
|
return (() => {
|
|
2997
|
-
var _el$
|
|
2998
|
-
insert(_el$
|
|
2999
|
-
effect((_$p) => setProp(_el$
|
|
3000
|
-
return _el$
|
|
3208
|
+
var _el$25 = createElement("text");
|
|
3209
|
+
insert(_el$25, () => sidebarPlaceholder(props.sessionID));
|
|
3210
|
+
effect((_$p) => setProp(_el$25, "fg", muted(), _$p));
|
|
3211
|
+
return _el$25;
|
|
3001
3212
|
})();
|
|
3002
3213
|
},
|
|
3003
3214
|
children: (current) => (() => {
|
|
3004
|
-
var _el$
|
|
3005
|
-
insert(_el$
|
|
3006
|
-
effect((_$p) => setProp(_el$
|
|
3007
|
-
return _el$
|
|
3215
|
+
var _el$26 = createElement("text");
|
|
3216
|
+
insert(_el$26, () => `Sessão: ${truncateLabel(current().title || current().id)}`);
|
|
3217
|
+
effect((_$p) => setProp(_el$26, "fg", text(), _$p));
|
|
3218
|
+
return _el$26;
|
|
3008
3219
|
})()
|
|
3009
3220
|
}), null);
|
|
3010
|
-
insert(_el$
|
|
3221
|
+
insert(_el$12, createComponent(Show, {
|
|
3011
3222
|
get when() {
|
|
3012
3223
|
return model.blocks().length > 0;
|
|
3013
3224
|
},
|
|
3014
3225
|
get children() {
|
|
3015
|
-
var _el$
|
|
3016
|
-
setProp(_el$
|
|
3017
|
-
return _el$
|
|
3226
|
+
var _el$15 = createElement("box");
|
|
3227
|
+
setProp(_el$15, "height", 1);
|
|
3228
|
+
return _el$15;
|
|
3018
3229
|
}
|
|
3019
3230
|
}), null);
|
|
3020
|
-
insert(_el$
|
|
3231
|
+
insert(_el$12, createComponent(Show, {
|
|
3021
3232
|
get when() {
|
|
3022
3233
|
return block("context");
|
|
3023
3234
|
},
|
|
3024
3235
|
get children() {
|
|
3025
|
-
var _el$
|
|
3026
|
-
setProp(_el$
|
|
3027
|
-
insert(_el$
|
|
3236
|
+
var _el$16 = createElement("box");
|
|
3237
|
+
setProp(_el$16, "flexDirection", "column");
|
|
3238
|
+
insert(_el$16, createComponent(Show, {
|
|
3028
3239
|
get when() {
|
|
3029
3240
|
return spacer("context");
|
|
3030
3241
|
},
|
|
3031
3242
|
get children() {
|
|
3032
|
-
var _el$
|
|
3033
|
-
setProp(_el$
|
|
3034
|
-
return _el$
|
|
3243
|
+
var _el$17 = createElement("box");
|
|
3244
|
+
setProp(_el$17, "height", 1);
|
|
3245
|
+
return _el$17;
|
|
3035
3246
|
}
|
|
3036
3247
|
}), null);
|
|
3037
|
-
insert(_el$
|
|
3248
|
+
insert(_el$16, createComponent(BlockHeader, {
|
|
3038
3249
|
get icon() {
|
|
3039
3250
|
return BLOCK_ICONS.context;
|
|
3040
3251
|
},
|
|
@@ -3046,14 +3257,14 @@ function Sidebar(props) {
|
|
|
3046
3257
|
return muted();
|
|
3047
3258
|
}
|
|
3048
3259
|
}), null);
|
|
3049
|
-
insert(_el$
|
|
3260
|
+
insert(_el$16, createComponent(Show, {
|
|
3050
3261
|
get when() {
|
|
3051
3262
|
return contextRows();
|
|
3052
3263
|
},
|
|
3053
3264
|
children: (rows) => (() => {
|
|
3054
|
-
var _el$
|
|
3055
|
-
setProp(_el$
|
|
3056
|
-
insert(_el$
|
|
3265
|
+
var _el$27 = createElement("box");
|
|
3266
|
+
setProp(_el$27, "flexDirection", "column");
|
|
3267
|
+
insert(_el$27, createComponent(Show, {
|
|
3057
3268
|
get when() {
|
|
3058
3269
|
return rows().tokens;
|
|
3059
3270
|
},
|
|
@@ -3069,7 +3280,7 @@ function Sidebar(props) {
|
|
|
3069
3280
|
}
|
|
3070
3281
|
})
|
|
3071
3282
|
}), null);
|
|
3072
|
-
insert(_el$
|
|
3283
|
+
insert(_el$27, createComponent(Show, {
|
|
3073
3284
|
get when() {
|
|
3074
3285
|
return rows().percent;
|
|
3075
3286
|
},
|
|
@@ -3085,7 +3296,7 @@ function Sidebar(props) {
|
|
|
3085
3296
|
}
|
|
3086
3297
|
})
|
|
3087
3298
|
}), null);
|
|
3088
|
-
insert(_el$
|
|
3299
|
+
insert(_el$27, createComponent(Show, {
|
|
3089
3300
|
get when() {
|
|
3090
3301
|
return rows().spent;
|
|
3091
3302
|
},
|
|
@@ -3101,90 +3312,112 @@ function Sidebar(props) {
|
|
|
3101
3312
|
}
|
|
3102
3313
|
})
|
|
3103
3314
|
}), null);
|
|
3104
|
-
insert(_el$
|
|
3315
|
+
insert(_el$27, createComponent(Show, {
|
|
3316
|
+
get when() {
|
|
3317
|
+
return usageRows().length > 0;
|
|
3318
|
+
},
|
|
3319
|
+
get children() {
|
|
3320
|
+
return [(() => {
|
|
3321
|
+
var _el$28 = createElement("text");
|
|
3322
|
+
insertNode(_el$28, createTextNode(`Sessão · custo reportado`));
|
|
3323
|
+
effect((_$p) => setProp(_el$28, "fg", muted(), _$p));
|
|
3324
|
+
return _el$28;
|
|
3325
|
+
})(), (() => {
|
|
3326
|
+
var _el$30 = createElement("text");
|
|
3327
|
+
insertNode(_el$30, createTextNode(`Modelo Tokens USD`));
|
|
3328
|
+
effect((_$p) => setProp(_el$30, "fg", muted(), _$p));
|
|
3329
|
+
return _el$30;
|
|
3330
|
+
})()];
|
|
3331
|
+
}
|
|
3332
|
+
}), null);
|
|
3333
|
+
insert(_el$27, createComponent(For, {
|
|
3105
3334
|
get each() {
|
|
3106
3335
|
return usageRows();
|
|
3107
3336
|
},
|
|
3108
3337
|
children: (row) => (() => {
|
|
3109
|
-
var _el$
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
}, {
|
|
3124
|
-
e: void 0,
|
|
3125
|
-
t: void 0,
|
|
3126
|
-
a: void 0
|
|
3127
|
-
});
|
|
3128
|
-
return _el$24;
|
|
3338
|
+
var _el$32 = createElement("box");
|
|
3339
|
+
setProp(_el$32, "flexDirection", "column");
|
|
3340
|
+
insert(_el$32, createComponent(For, {
|
|
3341
|
+
get each() {
|
|
3342
|
+
return modelUsageRowLines(row);
|
|
3343
|
+
},
|
|
3344
|
+
children: (line) => (() => {
|
|
3345
|
+
var _el$33 = createElement("text");
|
|
3346
|
+
insert(_el$33, line);
|
|
3347
|
+
effect((_$p) => setProp(_el$33, "fg", text(), _$p));
|
|
3348
|
+
return _el$33;
|
|
3349
|
+
})()
|
|
3350
|
+
}));
|
|
3351
|
+
return _el$32;
|
|
3129
3352
|
})()
|
|
3130
3353
|
}), null);
|
|
3131
|
-
insert(_el$
|
|
3354
|
+
insert(_el$27, createComponent(Show, {
|
|
3132
3355
|
get when() {
|
|
3133
3356
|
return usageHidden();
|
|
3134
3357
|
},
|
|
3135
|
-
children: (line) => (
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3358
|
+
children: (line) => createComponent(For, {
|
|
3359
|
+
get each() {
|
|
3360
|
+
return sidebarTextLines(line());
|
|
3361
|
+
},
|
|
3362
|
+
children: (part) => (() => {
|
|
3363
|
+
var _el$34 = createElement("text");
|
|
3364
|
+
insert(_el$34, part);
|
|
3365
|
+
effect((_$p) => setProp(_el$34, "fg", muted(), _$p));
|
|
3366
|
+
return _el$34;
|
|
3367
|
+
})()
|
|
3368
|
+
})
|
|
3141
3369
|
}), null);
|
|
3142
|
-
return _el$
|
|
3370
|
+
return _el$27;
|
|
3143
3371
|
})()
|
|
3144
3372
|
}), null);
|
|
3145
|
-
insert(_el$
|
|
3373
|
+
insert(_el$16, createComponent(Show, {
|
|
3146
3374
|
get when() {
|
|
3147
3375
|
return performanceLine();
|
|
3148
3376
|
},
|
|
3149
3377
|
children: (line) => (() => {
|
|
3150
|
-
var _el$
|
|
3151
|
-
insert(_el$
|
|
3152
|
-
effect((_$p) => setProp(_el$
|
|
3153
|
-
return _el$
|
|
3378
|
+
var _el$35 = createElement("text");
|
|
3379
|
+
insert(_el$35, line);
|
|
3380
|
+
effect((_$p) => setProp(_el$35, "fg", muted(), _$p));
|
|
3381
|
+
return _el$35;
|
|
3154
3382
|
})()
|
|
3155
3383
|
}), null);
|
|
3156
|
-
insert(_el$
|
|
3384
|
+
insert(_el$16, createComponent(Show, {
|
|
3157
3385
|
get when() {
|
|
3158
3386
|
return spendLine();
|
|
3159
3387
|
},
|
|
3160
|
-
children: (line) => (
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3388
|
+
children: (line) => createComponent(For, {
|
|
3389
|
+
get each() {
|
|
3390
|
+
return contextSpendLines(line());
|
|
3391
|
+
},
|
|
3392
|
+
children: (part) => (() => {
|
|
3393
|
+
var _el$36 = createElement("text");
|
|
3394
|
+
insert(_el$36, part);
|
|
3395
|
+
effect((_$p) => setProp(_el$36, "fg", muted(), _$p));
|
|
3396
|
+
return _el$36;
|
|
3397
|
+
})()
|
|
3398
|
+
})
|
|
3166
3399
|
}), null);
|
|
3167
|
-
return _el$
|
|
3400
|
+
return _el$16;
|
|
3168
3401
|
}
|
|
3169
3402
|
}), null);
|
|
3170
|
-
insert(_el$
|
|
3403
|
+
insert(_el$12, createComponent(Show, {
|
|
3171
3404
|
get when() {
|
|
3172
3405
|
return block("git");
|
|
3173
3406
|
},
|
|
3174
3407
|
get children() {
|
|
3175
|
-
var _el$
|
|
3176
|
-
setProp(_el$
|
|
3177
|
-
insert(_el$
|
|
3408
|
+
var _el$18 = createElement("box");
|
|
3409
|
+
setProp(_el$18, "flexDirection", "column");
|
|
3410
|
+
insert(_el$18, createComponent(Show, {
|
|
3178
3411
|
get when() {
|
|
3179
3412
|
return spacer("git");
|
|
3180
3413
|
},
|
|
3181
3414
|
get children() {
|
|
3182
|
-
var _el$
|
|
3183
|
-
setProp(_el$
|
|
3184
|
-
return _el$
|
|
3415
|
+
var _el$19 = createElement("box");
|
|
3416
|
+
setProp(_el$19, "height", 1);
|
|
3417
|
+
return _el$19;
|
|
3185
3418
|
}
|
|
3186
3419
|
}), null);
|
|
3187
|
-
insert(_el$
|
|
3420
|
+
insert(_el$18, createComponent(BlockHeader, {
|
|
3188
3421
|
get icon() {
|
|
3189
3422
|
return BLOCK_ICONS.git;
|
|
3190
3423
|
},
|
|
@@ -3196,68 +3429,68 @@ function Sidebar(props) {
|
|
|
3196
3429
|
return muted();
|
|
3197
3430
|
}
|
|
3198
3431
|
}), null);
|
|
3199
|
-
insert(_el$
|
|
3432
|
+
insert(_el$18, createComponent(Show, {
|
|
3200
3433
|
get when() {
|
|
3201
3434
|
return model.branch();
|
|
3202
3435
|
},
|
|
3203
3436
|
children: (value) => (() => {
|
|
3204
|
-
var _el$
|
|
3205
|
-
insertNode(_el$
|
|
3206
|
-
insertNode(_el$
|
|
3207
|
-
setProp(_el$
|
|
3208
|
-
insertNode(_el$
|
|
3209
|
-
insert(_el$
|
|
3437
|
+
var _el$37 = createElement("box"), _el$38 = createElement("text"), _el$40 = createElement("text");
|
|
3438
|
+
insertNode(_el$37, _el$38);
|
|
3439
|
+
insertNode(_el$37, _el$40);
|
|
3440
|
+
setProp(_el$37, "flexDirection", "row");
|
|
3441
|
+
insertNode(_el$38, createTextNode(`⎇ `));
|
|
3442
|
+
insert(_el$40, () => truncateLabel(value(), 32));
|
|
3210
3443
|
effect((_p$) => {
|
|
3211
|
-
var _v$
|
|
3212
|
-
_v$
|
|
3213
|
-
_v$
|
|
3444
|
+
var _v$5 = muted(), _v$6 = text();
|
|
3445
|
+
_v$5 !== _p$.e && (_p$.e = setProp(_el$38, "fg", _v$5, _p$.e));
|
|
3446
|
+
_v$6 !== _p$.t && (_p$.t = setProp(_el$40, "fg", _v$6, _p$.t));
|
|
3214
3447
|
return _p$;
|
|
3215
3448
|
}, {
|
|
3216
3449
|
e: void 0,
|
|
3217
3450
|
t: void 0
|
|
3218
3451
|
});
|
|
3219
|
-
return _el$
|
|
3452
|
+
return _el$37;
|
|
3220
3453
|
})()
|
|
3221
3454
|
}), null);
|
|
3222
|
-
insert(_el$
|
|
3455
|
+
insert(_el$18, createComponent(Show, {
|
|
3223
3456
|
get when() {
|
|
3224
3457
|
return model.gitLine();
|
|
3225
3458
|
},
|
|
3226
3459
|
children: (line) => (() => {
|
|
3227
|
-
var _el$
|
|
3228
|
-
insert(_el$
|
|
3229
|
-
effect((_$p) => setProp(_el$
|
|
3230
|
-
return _el$
|
|
3460
|
+
var _el$41 = createElement("text");
|
|
3461
|
+
insert(_el$41, line);
|
|
3462
|
+
effect((_$p) => setProp(_el$41, "fg", text(), _$p));
|
|
3463
|
+
return _el$41;
|
|
3231
3464
|
})()
|
|
3232
3465
|
}), null);
|
|
3233
|
-
return _el$
|
|
3466
|
+
return _el$18;
|
|
3234
3467
|
}
|
|
3235
3468
|
}), null);
|
|
3236
|
-
insert(_el$
|
|
3469
|
+
insert(_el$12, createComponent(Show, {
|
|
3237
3470
|
get when() {
|
|
3238
3471
|
return block("todo");
|
|
3239
3472
|
},
|
|
3240
3473
|
get children() {
|
|
3241
|
-
var _el$
|
|
3242
|
-
setProp(_el$
|
|
3243
|
-
insert(_el$
|
|
3474
|
+
var _el$20 = createElement("box");
|
|
3475
|
+
setProp(_el$20, "flexDirection", "column");
|
|
3476
|
+
insert(_el$20, createComponent(Show, {
|
|
3244
3477
|
get when() {
|
|
3245
3478
|
return spacer("todo");
|
|
3246
3479
|
},
|
|
3247
3480
|
get children() {
|
|
3248
|
-
var _el$
|
|
3249
|
-
setProp(_el$
|
|
3250
|
-
return _el$
|
|
3481
|
+
var _el$21 = createElement("box");
|
|
3482
|
+
setProp(_el$21, "height", 1);
|
|
3483
|
+
return _el$21;
|
|
3251
3484
|
}
|
|
3252
3485
|
}), null);
|
|
3253
|
-
insert(_el$
|
|
3486
|
+
insert(_el$20, createComponent(Show, {
|
|
3254
3487
|
get when() {
|
|
3255
3488
|
return model.todo().visible.length > 0;
|
|
3256
3489
|
},
|
|
3257
3490
|
get children() {
|
|
3258
|
-
var _el$
|
|
3259
|
-
setProp(_el$
|
|
3260
|
-
insert(_el$
|
|
3491
|
+
var _el$22 = createElement("box");
|
|
3492
|
+
setProp(_el$22, "flexDirection", "column");
|
|
3493
|
+
insert(_el$22, createComponent(BlockHeader, {
|
|
3261
3494
|
get icon() {
|
|
3262
3495
|
return BLOCK_ICONS.todo;
|
|
3263
3496
|
},
|
|
@@ -3269,59 +3502,59 @@ function Sidebar(props) {
|
|
|
3269
3502
|
return muted();
|
|
3270
3503
|
}
|
|
3271
3504
|
}), null);
|
|
3272
|
-
insert(_el$
|
|
3505
|
+
insert(_el$22, createComponent(For, {
|
|
3273
3506
|
get each() {
|
|
3274
3507
|
return model.todo().visible;
|
|
3275
3508
|
},
|
|
3276
3509
|
children: (item) => (() => {
|
|
3277
|
-
var _el$
|
|
3278
|
-
insert(_el$
|
|
3279
|
-
effect((_$p) => setProp(_el$
|
|
3280
|
-
return _el$
|
|
3510
|
+
var _el$42 = createElement("text");
|
|
3511
|
+
insert(_el$42, () => todoRowText(item));
|
|
3512
|
+
effect((_$p) => setProp(_el$42, "fg", todoFg(item.status), _$p));
|
|
3513
|
+
return _el$42;
|
|
3281
3514
|
})()
|
|
3282
3515
|
}), null);
|
|
3283
|
-
insert(_el$
|
|
3516
|
+
insert(_el$22, createComponent(Show, {
|
|
3284
3517
|
get when() {
|
|
3285
3518
|
return hiddenTodoText(model.todo().hidden);
|
|
3286
3519
|
},
|
|
3287
3520
|
children: (line) => (() => {
|
|
3288
|
-
var _el$
|
|
3289
|
-
insert(_el$
|
|
3290
|
-
effect((_$p) => setProp(_el$
|
|
3291
|
-
return _el$
|
|
3521
|
+
var _el$43 = createElement("text");
|
|
3522
|
+
insert(_el$43, line);
|
|
3523
|
+
effect((_$p) => setProp(_el$43, "fg", muted(), _$p));
|
|
3524
|
+
return _el$43;
|
|
3292
3525
|
})()
|
|
3293
3526
|
}), null);
|
|
3294
|
-
return _el$
|
|
3527
|
+
return _el$22;
|
|
3295
3528
|
}
|
|
3296
3529
|
}), null);
|
|
3297
|
-
return _el$
|
|
3530
|
+
return _el$20;
|
|
3298
3531
|
}
|
|
3299
3532
|
}), null);
|
|
3300
|
-
insert(_el$
|
|
3533
|
+
insert(_el$12, createComponent(Show, {
|
|
3301
3534
|
get when() {
|
|
3302
3535
|
return block("dispatch");
|
|
3303
3536
|
},
|
|
3304
3537
|
get children() {
|
|
3305
|
-
var _el$
|
|
3306
|
-
setProp(_el$
|
|
3307
|
-
insert(_el$
|
|
3538
|
+
var _el$23 = createElement("box");
|
|
3539
|
+
setProp(_el$23, "flexDirection", "column");
|
|
3540
|
+
insert(_el$23, createComponent(Show, {
|
|
3308
3541
|
get when() {
|
|
3309
3542
|
return spacer("dispatch");
|
|
3310
3543
|
},
|
|
3311
3544
|
get children() {
|
|
3312
|
-
var _el$
|
|
3313
|
-
setProp(_el$
|
|
3314
|
-
return _el$
|
|
3545
|
+
var _el$24 = createElement("box");
|
|
3546
|
+
setProp(_el$24, "height", 1);
|
|
3547
|
+
return _el$24;
|
|
3315
3548
|
}
|
|
3316
3549
|
}), null);
|
|
3317
|
-
insert(_el$
|
|
3550
|
+
insert(_el$23, createComponent(Show, {
|
|
3318
3551
|
get when() {
|
|
3319
3552
|
return dispatchView();
|
|
3320
3553
|
},
|
|
3321
3554
|
children: (view) => (() => {
|
|
3322
|
-
var _el$
|
|
3323
|
-
setProp(_el$
|
|
3324
|
-
insert(_el$
|
|
3555
|
+
var _el$44 = createElement("box");
|
|
3556
|
+
setProp(_el$44, "flexDirection", "column");
|
|
3557
|
+
insert(_el$44, createComponent(BlockHeader, {
|
|
3325
3558
|
get icon() {
|
|
3326
3559
|
return BLOCK_ICONS.dispatch;
|
|
3327
3560
|
},
|
|
@@ -3336,101 +3569,101 @@ function Sidebar(props) {
|
|
|
3336
3569
|
return dispatchSummary();
|
|
3337
3570
|
}
|
|
3338
3571
|
}), null);
|
|
3339
|
-
insert(_el$
|
|
3572
|
+
insert(_el$44, createComponent(For, {
|
|
3340
3573
|
get each() {
|
|
3341
3574
|
return view().running;
|
|
3342
3575
|
},
|
|
3343
3576
|
children: (row) => (() => {
|
|
3344
|
-
var _el$
|
|
3345
|
-
insertNode(_el$
|
|
3346
|
-
setProp(_el$
|
|
3347
|
-
insert(_el$
|
|
3577
|
+
var _el$46 = createElement("box"), _el$47 = createElement("text");
|
|
3578
|
+
insertNode(_el$46, _el$47);
|
|
3579
|
+
setProp(_el$46, "flexShrink", 0);
|
|
3580
|
+
insert(_el$47, () => row.text);
|
|
3348
3581
|
effect((_p$) => {
|
|
3349
|
-
var _v$
|
|
3350
|
-
_v$
|
|
3351
|
-
_v$
|
|
3582
|
+
var _v$7 = open(row.id), _v$8 = tone("success");
|
|
3583
|
+
_v$7 !== _p$.e && (_p$.e = setProp(_el$46, "onMouseDown", _v$7, _p$.e));
|
|
3584
|
+
_v$8 !== _p$.t && (_p$.t = setProp(_el$47, "fg", _v$8, _p$.t));
|
|
3352
3585
|
return _p$;
|
|
3353
3586
|
}, {
|
|
3354
3587
|
e: void 0,
|
|
3355
3588
|
t: void 0
|
|
3356
3589
|
});
|
|
3357
|
-
return _el$
|
|
3590
|
+
return _el$46;
|
|
3358
3591
|
})()
|
|
3359
3592
|
}), null);
|
|
3360
|
-
insert(_el$
|
|
3593
|
+
insert(_el$44, createComponent(Show, {
|
|
3361
3594
|
get when() {
|
|
3362
3595
|
return view().runningHidden > 0;
|
|
3363
3596
|
},
|
|
3364
3597
|
get children() {
|
|
3365
|
-
var _el$
|
|
3366
|
-
insert(_el$
|
|
3367
|
-
effect((_$p) => setProp(_el$
|
|
3368
|
-
return _el$
|
|
3598
|
+
var _el$45 = createElement("text");
|
|
3599
|
+
insert(_el$45, () => `\u2026 +${view().runningHidden} rodando`);
|
|
3600
|
+
effect((_$p) => setProp(_el$45, "fg", muted(), _$p));
|
|
3601
|
+
return _el$45;
|
|
3369
3602
|
}
|
|
3370
3603
|
}), null);
|
|
3371
|
-
insert(_el$
|
|
3604
|
+
insert(_el$44, createComponent(Show, {
|
|
3372
3605
|
get when() {
|
|
3373
3606
|
return view().summary;
|
|
3374
3607
|
},
|
|
3375
3608
|
children: (line) => (() => {
|
|
3376
|
-
var _el$
|
|
3377
|
-
insertNode(_el$
|
|
3378
|
-
setProp(_el$
|
|
3379
|
-
setProp(_el$
|
|
3380
|
-
insert(_el$
|
|
3381
|
-
insert(_el$
|
|
3609
|
+
var _el$48 = createElement("box"), _el$49 = createElement("text");
|
|
3610
|
+
insertNode(_el$48, _el$49);
|
|
3611
|
+
setProp(_el$48, "flexDirection", "row");
|
|
3612
|
+
setProp(_el$48, "flexShrink", 0);
|
|
3613
|
+
insert(_el$49, line);
|
|
3614
|
+
insert(_el$48, createComponent(Show, {
|
|
3382
3615
|
get when() {
|
|
3383
3616
|
return failedSuffix();
|
|
3384
3617
|
},
|
|
3385
3618
|
children: (suffix) => (() => {
|
|
3386
|
-
var _el$
|
|
3387
|
-
insert(_el$
|
|
3388
|
-
effect((_$p) => setProp(_el$
|
|
3389
|
-
return _el$
|
|
3619
|
+
var _el$50 = createElement("text");
|
|
3620
|
+
insert(_el$50, () => `${SPEND_LINE_SEPARATOR}${suffix()}`);
|
|
3621
|
+
effect((_$p) => setProp(_el$50, "fg", tone("error"), _$p));
|
|
3622
|
+
return _el$50;
|
|
3390
3623
|
})()
|
|
3391
3624
|
}), null);
|
|
3392
|
-
effect((_$p) => setProp(_el$
|
|
3393
|
-
return _el$
|
|
3625
|
+
effect((_$p) => setProp(_el$49, "fg", muted(), _$p));
|
|
3626
|
+
return _el$48;
|
|
3394
3627
|
})()
|
|
3395
3628
|
}), null);
|
|
3396
|
-
insert(_el$
|
|
3629
|
+
insert(_el$44, createComponent(For, {
|
|
3397
3630
|
get each() {
|
|
3398
3631
|
return view().agents;
|
|
3399
3632
|
},
|
|
3400
3633
|
children: (row) => (() => {
|
|
3401
|
-
var _el$
|
|
3402
|
-
insert(_el$
|
|
3403
|
-
effect((_$p) => setProp(_el$
|
|
3404
|
-
return _el$
|
|
3634
|
+
var _el$51 = createElement("text");
|
|
3635
|
+
insert(_el$51, () => childAgentRowText(row));
|
|
3636
|
+
effect((_$p) => setProp(_el$51, "fg", muted(), _$p));
|
|
3637
|
+
return _el$51;
|
|
3405
3638
|
})()
|
|
3406
3639
|
}), null);
|
|
3407
|
-
insert(_el$
|
|
3640
|
+
insert(_el$44, createComponent(Show, {
|
|
3408
3641
|
get when() {
|
|
3409
3642
|
return hiddenChildAgentsText(view().agentsHidden, view().agentsHiddenCost);
|
|
3410
3643
|
},
|
|
3411
3644
|
children: (line) => (() => {
|
|
3412
|
-
var _el$
|
|
3413
|
-
insert(_el$
|
|
3414
|
-
effect((_$p) => setProp(_el$
|
|
3415
|
-
return _el$
|
|
3645
|
+
var _el$52 = createElement("text");
|
|
3646
|
+
insert(_el$52, line);
|
|
3647
|
+
effect((_$p) => setProp(_el$52, "fg", muted(), _$p));
|
|
3648
|
+
return _el$52;
|
|
3416
3649
|
})()
|
|
3417
3650
|
}), null);
|
|
3418
|
-
return _el$
|
|
3651
|
+
return _el$44;
|
|
3419
3652
|
})()
|
|
3420
3653
|
}), null);
|
|
3421
|
-
return _el$
|
|
3654
|
+
return _el$23;
|
|
3422
3655
|
}
|
|
3423
3656
|
}), null);
|
|
3424
3657
|
effect((_p$) => {
|
|
3425
3658
|
var _v$3 = text(), _v$4 = muted();
|
|
3426
|
-
_v$3 !== _p$.e && (_p$.e = setProp(_el$
|
|
3427
|
-
_v$4 !== _p$.t && (_p$.t = setProp(_el$
|
|
3659
|
+
_v$3 !== _p$.e && (_p$.e = setProp(_el$13, "fg", _v$3, _p$.e));
|
|
3660
|
+
_v$4 !== _p$.t && (_p$.t = setProp(_el$14, "fg", _v$4, _p$.t));
|
|
3428
3661
|
return _p$;
|
|
3429
3662
|
}, {
|
|
3430
3663
|
e: void 0,
|
|
3431
3664
|
t: void 0
|
|
3432
3665
|
});
|
|
3433
|
-
return _el$
|
|
3666
|
+
return _el$12;
|
|
3434
3667
|
})();
|
|
3435
3668
|
}
|
|
3436
3669
|
/** Panel actions that only make sense with a row selected. A panel over an
|
|
@@ -3499,25 +3732,25 @@ function DispatchPanel(props) {
|
|
|
3499
3732
|
return model.visible().rows;
|
|
3500
3733
|
},
|
|
3501
3734
|
children: (row) => (() => {
|
|
3502
|
-
var _el$
|
|
3503
|
-
insertNode(_el$
|
|
3504
|
-
insertNode(_el$
|
|
3505
|
-
setProp(_el$
|
|
3506
|
-
setProp(_el$
|
|
3507
|
-
insert(_el$
|
|
3508
|
-
insert(_el$
|
|
3735
|
+
var _el$53 = createElement("box"), _el$54 = createElement("text"), _el$55 = createElement("text");
|
|
3736
|
+
insertNode(_el$53, _el$54);
|
|
3737
|
+
insertNode(_el$53, _el$55);
|
|
3738
|
+
setProp(_el$53, "flexDirection", "row");
|
|
3739
|
+
setProp(_el$53, "flexShrink", 0);
|
|
3740
|
+
insert(_el$54, () => selected(row.id) ? `▸ ` : " ");
|
|
3741
|
+
insert(_el$55, () => row.text);
|
|
3509
3742
|
effect((_p$) => {
|
|
3510
|
-
var _v$
|
|
3511
|
-
_v$
|
|
3512
|
-
_v$
|
|
3513
|
-
_v$
|
|
3743
|
+
var _v$9 = selected(row.id) ? text() : muted(), _v$0 = rowFg(row.state), _v$1 = selected(row.id) ? 1 : 0;
|
|
3744
|
+
_v$9 !== _p$.e && (_p$.e = setProp(_el$54, "fg", _v$9, _p$.e));
|
|
3745
|
+
_v$0 !== _p$.t && (_p$.t = setProp(_el$55, "fg", _v$0, _p$.t));
|
|
3746
|
+
_v$1 !== _p$.a && (_p$.a = setProp(_el$55, "attributes", _v$1, _p$.a));
|
|
3514
3747
|
return _p$;
|
|
3515
3748
|
}, {
|
|
3516
3749
|
e: void 0,
|
|
3517
3750
|
t: void 0,
|
|
3518
3751
|
a: void 0
|
|
3519
3752
|
});
|
|
3520
|
-
return _el$
|
|
3753
|
+
return _el$53;
|
|
3521
3754
|
})()
|
|
3522
3755
|
});
|
|
3523
3756
|
const detail = () => createComponent(For, {
|
|
@@ -3525,28 +3758,28 @@ function DispatchPanel(props) {
|
|
|
3525
3758
|
return model.detail();
|
|
3526
3759
|
},
|
|
3527
3760
|
children: (line, index) => (() => {
|
|
3528
|
-
var _el$
|
|
3529
|
-
insert(_el$
|
|
3530
|
-
effect((_$p) => setProp(_el$
|
|
3531
|
-
return _el$
|
|
3761
|
+
var _el$56 = createElement("text");
|
|
3762
|
+
insert(_el$56, line);
|
|
3763
|
+
effect((_$p) => setProp(_el$56, "fg", index() === 0 ? text() : muted(), _$p));
|
|
3764
|
+
return _el$56;
|
|
3532
3765
|
})()
|
|
3533
3766
|
});
|
|
3534
3767
|
const empty = () => (() => {
|
|
3535
|
-
var _el$
|
|
3536
|
-
insertNode(_el$
|
|
3537
|
-
effect((_$p) => setProp(_el$
|
|
3538
|
-
return _el$
|
|
3768
|
+
var _el$57 = createElement("text");
|
|
3769
|
+
insertNode(_el$57, createTextNode(`Nenhuma sessão delegada`));
|
|
3770
|
+
effect((_$p) => setProp(_el$57, "fg", muted(), _$p));
|
|
3771
|
+
return _el$57;
|
|
3539
3772
|
})();
|
|
3540
3773
|
return (() => {
|
|
3541
|
-
var _el$
|
|
3542
|
-
insertNode(_el$
|
|
3543
|
-
insertNode(_el$
|
|
3544
|
-
insertNode(_el$
|
|
3545
|
-
insertNode(_el$
|
|
3546
|
-
setProp(_el$
|
|
3547
|
-
setProp(_el$
|
|
3548
|
-
setProp(_el$
|
|
3549
|
-
insert(_el$
|
|
3774
|
+
var _el$59 = createElement("box"), _el$60 = createElement("text"), _el$61 = createElement("text"), _el$65 = createElement("box"), _el$66 = createElement("text");
|
|
3775
|
+
insertNode(_el$59, _el$60);
|
|
3776
|
+
insertNode(_el$59, _el$61);
|
|
3777
|
+
insertNode(_el$59, _el$65);
|
|
3778
|
+
insertNode(_el$59, _el$66);
|
|
3779
|
+
setProp(_el$59, "flexDirection", "column");
|
|
3780
|
+
setProp(_el$59, "width", "100%");
|
|
3781
|
+
setProp(_el$59, "padding", 1);
|
|
3782
|
+
insert(_el$59, createComponent(DispatchPanelKeymap, {
|
|
3550
3783
|
get context() {
|
|
3551
3784
|
return props.context;
|
|
3552
3785
|
},
|
|
@@ -3554,30 +3787,30 @@ function DispatchPanel(props) {
|
|
|
3554
3787
|
return props.panel;
|
|
3555
3788
|
},
|
|
3556
3789
|
model
|
|
3557
|
-
}), _el$
|
|
3558
|
-
setProp(_el$
|
|
3559
|
-
insert(_el$
|
|
3560
|
-
insert(_el$
|
|
3790
|
+
}), _el$60);
|
|
3791
|
+
setProp(_el$60, "attributes", 1);
|
|
3792
|
+
insert(_el$60, () => model.title());
|
|
3793
|
+
insert(_el$59, createComponent(Show, {
|
|
3561
3794
|
get when() {
|
|
3562
3795
|
return model.header();
|
|
3563
3796
|
},
|
|
3564
3797
|
children: (line) => (() => {
|
|
3565
|
-
var _el$
|
|
3566
|
-
insert(_el$
|
|
3567
|
-
effect((_$p) => setProp(_el$
|
|
3568
|
-
return _el$
|
|
3798
|
+
var _el$67 = createElement("text");
|
|
3799
|
+
insert(_el$67, line);
|
|
3800
|
+
effect((_$p) => setProp(_el$67, "fg", muted(), _$p));
|
|
3801
|
+
return _el$67;
|
|
3569
3802
|
})()
|
|
3570
|
-
}), _el$
|
|
3571
|
-
insert(_el$
|
|
3572
|
-
insert(_el$
|
|
3803
|
+
}), _el$61);
|
|
3804
|
+
insert(_el$61, () => dispatchPanelRule(props.panel.width - 2));
|
|
3805
|
+
insert(_el$59, createComponent(Show, {
|
|
3573
3806
|
get when() {
|
|
3574
3807
|
return model.layout().mode === "wide";
|
|
3575
3808
|
},
|
|
3576
3809
|
get fallback() {
|
|
3577
3810
|
return (() => {
|
|
3578
|
-
var _el$
|
|
3579
|
-
setProp(_el$
|
|
3580
|
-
insert(_el$
|
|
3811
|
+
var _el$68 = createElement("box");
|
|
3812
|
+
setProp(_el$68, "flexDirection", "column");
|
|
3813
|
+
insert(_el$68, createComponent(Show, {
|
|
3581
3814
|
get when() {
|
|
3582
3815
|
return model.rows().length > 0;
|
|
3583
3816
|
},
|
|
@@ -3585,34 +3818,34 @@ function DispatchPanel(props) {
|
|
|
3585
3818
|
return empty();
|
|
3586
3819
|
},
|
|
3587
3820
|
get children() {
|
|
3588
|
-
var _el$
|
|
3589
|
-
setProp(_el$
|
|
3590
|
-
insert(_el$
|
|
3591
|
-
return _el$
|
|
3821
|
+
var _el$69 = createElement("box");
|
|
3822
|
+
setProp(_el$69, "flexDirection", "column");
|
|
3823
|
+
insert(_el$69, rows);
|
|
3824
|
+
return _el$69;
|
|
3592
3825
|
}
|
|
3593
3826
|
}), null);
|
|
3594
|
-
insert(_el$
|
|
3827
|
+
insert(_el$68, createComponent(Show, {
|
|
3595
3828
|
get when() {
|
|
3596
3829
|
return model.selectedID();
|
|
3597
3830
|
},
|
|
3598
3831
|
get children() {
|
|
3599
|
-
var _el$
|
|
3600
|
-
insertNode(_el$
|
|
3601
|
-
setProp(_el$
|
|
3602
|
-
setProp(_el$
|
|
3603
|
-
insert(_el$
|
|
3604
|
-
return _el$
|
|
3832
|
+
var _el$70 = createElement("box"), _el$71 = createElement("box");
|
|
3833
|
+
insertNode(_el$70, _el$71);
|
|
3834
|
+
setProp(_el$70, "flexDirection", "column");
|
|
3835
|
+
setProp(_el$71, "height", 1);
|
|
3836
|
+
insert(_el$70, detail, null);
|
|
3837
|
+
return _el$70;
|
|
3605
3838
|
}
|
|
3606
3839
|
}), null);
|
|
3607
|
-
return _el$
|
|
3840
|
+
return _el$68;
|
|
3608
3841
|
})();
|
|
3609
3842
|
},
|
|
3610
3843
|
get children() {
|
|
3611
|
-
var _el$
|
|
3612
|
-
insertNode(_el$
|
|
3613
|
-
setProp(_el$
|
|
3614
|
-
setProp(_el$
|
|
3615
|
-
insert(_el$
|
|
3844
|
+
var _el$62 = createElement("box"), _el$63 = createElement("box");
|
|
3845
|
+
insertNode(_el$62, _el$63);
|
|
3846
|
+
setProp(_el$62, "flexDirection", "row");
|
|
3847
|
+
setProp(_el$63, "flexDirection", "column");
|
|
3848
|
+
insert(_el$63, createComponent(Show, {
|
|
3616
3849
|
get when() {
|
|
3617
3850
|
return model.rows().length > 0;
|
|
3618
3851
|
},
|
|
@@ -3623,36 +3856,36 @@ function DispatchPanel(props) {
|
|
|
3623
3856
|
return rows();
|
|
3624
3857
|
}
|
|
3625
3858
|
}));
|
|
3626
|
-
insert(_el$
|
|
3859
|
+
insert(_el$62, createComponent(Show, {
|
|
3627
3860
|
get when() {
|
|
3628
3861
|
return model.selectedID();
|
|
3629
3862
|
},
|
|
3630
3863
|
get children() {
|
|
3631
|
-
var _el$
|
|
3632
|
-
setProp(_el$
|
|
3633
|
-
insert(_el$
|
|
3634
|
-
effect((_$p) => setProp(_el$
|
|
3635
|
-
return _el$
|
|
3864
|
+
var _el$64 = createElement("box");
|
|
3865
|
+
setProp(_el$64, "flexDirection", "column");
|
|
3866
|
+
insert(_el$64, detail);
|
|
3867
|
+
effect((_$p) => setProp(_el$64, "width", model.layout().detailWidth, _$p));
|
|
3868
|
+
return _el$64;
|
|
3636
3869
|
}
|
|
3637
3870
|
}), null);
|
|
3638
|
-
effect((_$p) => setProp(_el$
|
|
3639
|
-
return _el$
|
|
3871
|
+
effect((_$p) => setProp(_el$63, "width", model.layout().listWidth, _$p));
|
|
3872
|
+
return _el$62;
|
|
3640
3873
|
}
|
|
3641
|
-
}), _el$
|
|
3642
|
-
setProp(_el$
|
|
3643
|
-
insert(_el$
|
|
3874
|
+
}), _el$65);
|
|
3875
|
+
setProp(_el$65, "height", 1);
|
|
3876
|
+
insert(_el$66, () => model.footer());
|
|
3644
3877
|
effect((_p$) => {
|
|
3645
|
-
var _v$
|
|
3646
|
-
_v$
|
|
3647
|
-
_v$
|
|
3648
|
-
_v$
|
|
3878
|
+
var _v$10 = text(), _v$11 = muted(), _v$12 = muted();
|
|
3879
|
+
_v$10 !== _p$.e && (_p$.e = setProp(_el$60, "fg", _v$10, _p$.e));
|
|
3880
|
+
_v$11 !== _p$.t && (_p$.t = setProp(_el$61, "fg", _v$11, _p$.t));
|
|
3881
|
+
_v$12 !== _p$.a && (_p$.a = setProp(_el$66, "fg", _v$12, _p$.a));
|
|
3649
3882
|
return _p$;
|
|
3650
3883
|
}, {
|
|
3651
3884
|
e: void 0,
|
|
3652
3885
|
t: void 0,
|
|
3653
3886
|
a: void 0
|
|
3654
3887
|
});
|
|
3655
|
-
return _el$
|
|
3888
|
+
return _el$59;
|
|
3656
3889
|
})();
|
|
3657
3890
|
}
|
|
3658
3891
|
/** App-level command claim: the only way into the panel. It registers the
|
|
@@ -3684,10 +3917,10 @@ function HomeStatus(props) {
|
|
|
3684
3917
|
const preset = useActivePreset(props.context).preset;
|
|
3685
3918
|
const muted = () => props.context.theme?.text?.muted ?? props.context.theme?.text?.base;
|
|
3686
3919
|
return (() => {
|
|
3687
|
-
var _el$
|
|
3688
|
-
insert(_el$
|
|
3689
|
-
effect((_$p) => setProp(_el$
|
|
3690
|
-
return _el$
|
|
3920
|
+
var _el$72 = createElement("text");
|
|
3921
|
+
insert(_el$72, () => `Pantheon v1.6.2-beta.10${preset().name ? ` ▸ ${preset().name}` : ""}`);
|
|
3922
|
+
effect((_$p) => setProp(_el$72, "fg", muted(), _$p));
|
|
3923
|
+
return _el$72;
|
|
3691
3924
|
})();
|
|
3692
3925
|
}
|
|
3693
3926
|
/** Lean footer model: only the preset label and the live delegation count. It
|
|
@@ -3742,10 +3975,10 @@ function PromptFooter(props) {
|
|
|
3742
3975
|
return model.running() > 0;
|
|
3743
3976
|
},
|
|
3744
3977
|
get children() {
|
|
3745
|
-
var _el$
|
|
3746
|
-
insert(_el$
|
|
3747
|
-
effect((_$p) => setProp(_el$
|
|
3748
|
-
return _el$
|
|
3978
|
+
var _el$73 = createElement("text");
|
|
3979
|
+
insert(_el$73, () => `▸${model.preset().name ?? "default"} · ✦${model.running()} ativos`);
|
|
3980
|
+
effect((_$p) => setProp(_el$73, "fg", muted(), _$p));
|
|
3981
|
+
return _el$73;
|
|
3749
3982
|
}
|
|
3750
3983
|
});
|
|
3751
3984
|
}
|
|
@@ -3803,6 +4036,6 @@ const plugin = Plugin.define({
|
|
|
3803
4036
|
}
|
|
3804
4037
|
});
|
|
3805
4038
|
//#endregion
|
|
3806
|
-
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, 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, modelUsageRowText, modelUsageRows, navigateToSession, openDispatchPanel, orderDispatchEntries, orderTodoItems, padCell, parseGitAheadBehind, parseGitStatusPorcelain, parsePresetOverrides, parseTodoItems, performDispatchPanelAction, presetFromEnv, presetHeaderLine, providerIDFromModels, providerIDFromRef, readGitSnapshot, resetSpendUnit, resolveActivePresetForTui, resolveContextLimit, resolvedSpendUnit, runDispatchPanelCommand, runningChildRowText, shortModelID, shortSessionID, sidebarPlaceholder, spendWindows, spinnerFrame, startOfLocalDay, statsCost, statsRangeMatches, toDelegationView, toDispatchEntry, todoRowText, todoTone, transcriptWindow, truncateLabel, turnTokensPerSecond, withBlockSpacers };
|
|
4039
|
+
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 };
|
|
3807
4040
|
|
|
3808
4041
|
//# sourceMappingURL=tui-v2.js.map
|