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
package/src/plugin.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { createGuardPathResolver } from './pantheon/guard-path.ts'
|
|
|
22
22
|
import { createReadEnhancer } from './pantheon/hashline/read-enhancer.ts'
|
|
23
23
|
import { createHashlineEditTool } from './pantheon/hashline/tool.ts'
|
|
24
24
|
import { createIdleDispatcher } from './pantheon/idle-continuation.ts'
|
|
25
|
+
import { createLocalDecisionTool } from './pantheon/local-decision-tool.ts'
|
|
25
26
|
import { createPantheonLogger } from './pantheon/logger.ts'
|
|
26
27
|
import { createModelCommand } from './pantheon/model-command.ts'
|
|
27
28
|
import { pantheonPluginOnce } from './pantheon/plugin-once.ts'
|
|
@@ -369,6 +370,7 @@ const plugin: Plugin = async (input: PluginInput) => {
|
|
|
369
370
|
// opencode.db read-only via the single node:sqlite backend. Fully wired.
|
|
370
371
|
const costCommand = createCostCommand()
|
|
371
372
|
const modelCommand = createModelCommand()
|
|
373
|
+
const localDecisionTool = createLocalDecisionTool()
|
|
372
374
|
|
|
373
375
|
return {
|
|
374
376
|
config: async (config: PluginConfig) => {
|
|
@@ -436,6 +438,8 @@ const plugin: Plugin = async (input: PluginInput) => {
|
|
|
436
438
|
pantheon_cost: costCommand.pantheon_cost,
|
|
437
439
|
// Deterministic /pantheon-model management of top-level model fields.
|
|
438
440
|
pantheon_model: modelCommand.pantheon_model,
|
|
441
|
+
// Local advisory routing; execute() requires the host's Zeus agent context.
|
|
442
|
+
pantheon_local_decision: localDecisionTool,
|
|
439
443
|
},
|
|
440
444
|
'chat.message': async (hookInput, output) => {
|
|
441
445
|
await vision.chatMessage(hookInput, output)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
The `dist/tui-v2.js` bundle includes tree-shaken code and the OpenIcon glyph
|
|
4
|
+
table from `@profullstack/hqtui` 0.11.1, licensed under the MIT License.
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2026 HQTUI contributors
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
SOFTWARE.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/server-v2.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* No-op server stub for the OpenCode V2 plugin loader.
|
|
4
|
+
*
|
|
5
|
+
* The OpenCode plugin host requires every plugin (TUI included) to expose a
|
|
6
|
+
* `server()` entry via `exports["./server"]` (or package.json `main`) — for the
|
|
7
|
+
* V2 copy this root `index-v2.ts` re-export resolves to this compiled entry —
|
|
8
|
+
* and it loads that server half only from a `config.plugins` entry (see
|
|
9
|
+
* `scripts/install/opencode.mjs`). When the entry is missing the host fails to
|
|
10
|
+
* attach the plugin's server half and the TUI runtime never wires the reactive
|
|
11
|
+
* channel — the initial JSX mounts but effects/refresh/events stay dead (the
|
|
12
|
+
* "mudo panel" symptom; same contract as the V1 `server.ts` stub).
|
|
13
|
+
*
|
|
14
|
+
* This stub satisfies the loader contract. The native quota RPC that used to
|
|
15
|
+
* live here was removed in 1.6.2 — provider quota/usage visibility is now the
|
|
16
|
+
* community plugin's job (`@slkiser/opencode-quota`,
|
|
17
|
+
* docs/tui-v2-quota-providers.md) — and pantheon-tui has no other background
|
|
18
|
+
* server work of its own.
|
|
19
|
+
*/
|
|
20
|
+
export default function server(): {};
|
|
21
|
+
//#endregion
|
|
22
|
+
//# sourceMappingURL=server-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-v2.d.ts","names":[],"sources":["../src/server-v2.ts"],"mappings":";;;;;;;;;;;;;;;;;;;wBAkBwB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/server-v2.ts
|
|
2
|
+
/**
|
|
3
|
+
* No-op server stub for the OpenCode V2 plugin loader.
|
|
4
|
+
*
|
|
5
|
+
* The OpenCode plugin host requires every plugin (TUI included) to expose a
|
|
6
|
+
* `server()` entry via `exports["./server"]` (or package.json `main`) — for the
|
|
7
|
+
* V2 copy this root `index-v2.ts` re-export resolves to this compiled entry —
|
|
8
|
+
* and it loads that server half only from a `config.plugins` entry (see
|
|
9
|
+
* `scripts/install/opencode.mjs`). When the entry is missing the host fails to
|
|
10
|
+
* attach the plugin's server half and the TUI runtime never wires the reactive
|
|
11
|
+
* channel — the initial JSX mounts but effects/refresh/events stay dead (the
|
|
12
|
+
* "mudo panel" symptom; same contract as the V1 `server.ts` stub).
|
|
13
|
+
*
|
|
14
|
+
* This stub satisfies the loader contract. The native quota RPC that used to
|
|
15
|
+
* live here was removed in 1.6.2 — provider quota/usage visibility is now the
|
|
16
|
+
* community plugin's job (`@slkiser/opencode-quota`,
|
|
17
|
+
* docs/tui-v2-quota-providers.md) — and pantheon-tui has no other background
|
|
18
|
+
* server work of its own.
|
|
19
|
+
*/
|
|
20
|
+
function server() {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { server as default };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=server-v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-v2.js","names":[],"sources":["../src/server-v2.ts"],"sourcesContent":["/**\n * No-op server stub for the OpenCode V2 plugin loader.\n *\n * The OpenCode plugin host requires every plugin (TUI included) to expose a\n * `server()` entry via `exports[\"./server\"]` (or package.json `main`) — for the\n * V2 copy this root `index-v2.ts` re-export resolves to this compiled entry —\n * and it loads that server half only from a `config.plugins` entry (see\n * `scripts/install/opencode.mjs`). When the entry is missing the host fails to\n * attach the plugin's server half and the TUI runtime never wires the reactive\n * channel — the initial JSX mounts but effects/refresh/events stay dead (the\n * \"mudo panel\" symptom; same contract as the V1 `server.ts` stub).\n *\n * This stub satisfies the loader contract. The native quota RPC that used to\n * live here was removed in 1.6.2 — provider quota/usage visibility is now the\n * community plugin's job (`@slkiser/opencode-quota`,\n * docs/tui-v2-quota-providers.md) — and pantheon-tui has no other background\n * server work of its own.\n */\nexport default function server() {\n return {}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAwB,SAAS;CAC/B,OAAO,CAAC;AACV"}
|
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
import { Accessor } from "solid-js";
|
|
2
2
|
import { Context, KeymapLayer, PanelInput } from "@opencode/plugin/tui/context";
|
|
3
|
+
//#region src/context-gauge.d.ts
|
|
4
|
+
/** Shared, data-only formatting and visual helpers for compact context gauges. */
|
|
5
|
+
type ContextProgressTone = 'info' | 'success' | 'warning' | 'error';
|
|
6
|
+
export declare const CONTEXT_BAR_CELLS = 12;
|
|
7
|
+
export declare const CONTEXT_BAR_FILLED_CELL = "▰";
|
|
8
|
+
export declare const CONTEXT_BAR_EMPTY_CELL = "▱";
|
|
9
|
+
export declare function contextUsageTone(percent: number): ContextProgressTone;
|
|
10
|
+
export declare function formatTokenCount(tokens: number | null | undefined): string | null;
|
|
11
|
+
export declare function formatContextWindow(limit: number | null | undefined): string | null;
|
|
12
|
+
export declare function contextBarFilled(percent: number, cells?: number): number;
|
|
13
|
+
export declare function contextBar(percent: number | null | undefined, cells?: number): {
|
|
14
|
+
filled: string;
|
|
15
|
+
empty: string;
|
|
16
|
+
} | null;
|
|
17
|
+
export declare function formatSpent(cost: number | null | undefined): string | null;
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/model-usage-limits.d.ts
|
|
20
|
+
/** Shared bounds for cached recent model-usage aggregation. */
|
|
21
|
+
export declare const MODEL_USAGE_VISIBLE_CEILING = 3;
|
|
22
|
+
export declare const MODEL_USAGE_MESSAGE_LIMIT = 400;
|
|
23
|
+
export declare const MODEL_USAGE_SESSION_LIMIT = 8;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/sidebar-width.d.ts
|
|
26
|
+
/** Terminal cells `value` occupies — the unit every column in this plugin is
|
|
27
|
+
* measured in. Mirrors the host (that is how `@opentui/core` sizes a text
|
|
28
|
+
* run): emoji count as two cells, East Asian Wide/Fullwidth as two, East
|
|
29
|
+
* Asian Ambiguous as one, combining marks and variation selectors as none.
|
|
30
|
+
* Pure. */
|
|
31
|
+
export declare function cellWidth(value: string): number;
|
|
32
|
+
//#endregion
|
|
3
33
|
//#region src/index-v2.d.ts
|
|
4
34
|
/** Sidebar body shown while the host has not published a session yet. */
|
|
5
35
|
export declare const SIDEBAR_WAITING_LABEL = "Aguardando sessão…";
|
|
@@ -68,6 +98,15 @@ export declare function providerIDFromModels(models: unknown, ref: unknown): str
|
|
|
68
98
|
* provider-qualified id, then the bare id (the host's `id`/`modelID` fields).
|
|
69
99
|
* Absent/ambiguous models degrade to null so the gauge is simply omitted. */
|
|
70
100
|
export declare function resolveContextLimit(models: readonly any[], ref: unknown): number | null;
|
|
101
|
+
export type ModelContextSnapshot = {
|
|
102
|
+
tokens: number;
|
|
103
|
+
percent: number;
|
|
104
|
+
limit: number;
|
|
105
|
+
};
|
|
106
|
+
/** Snapshot for one exact model identity in the bounded active transcript. */
|
|
107
|
+
export declare function resolveModelContextSnapshot(messages: readonly unknown[], modelRef: unknown, models: readonly unknown[], revertMessageID?: string | null): ModelContextSnapshot | null;
|
|
108
|
+
/** Select the pinned chat model before transcript or configured-agent fallbacks. */
|
|
109
|
+
export declare function resolveActiveModelRef(sessionModel: unknown, activeMessages: readonly unknown[], fallbackModel?: unknown): unknown;
|
|
71
110
|
/** Native token total: input + output + reasoning + cache read + cache write. */
|
|
72
111
|
export declare function messageTokensTotal(tokens: any): number;
|
|
73
112
|
export type ContextUsage = {
|
|
@@ -89,13 +128,6 @@ export declare function transcriptWindow(messages: readonly any[], revertMessage
|
|
|
89
128
|
* window wins. Null when there is no limit or no such message — the caller
|
|
90
129
|
* then omits the block. */
|
|
91
130
|
export declare function computeContextUsage(messages: readonly any[], contextLimit: number | null | undefined, revertMessageID?: string | null): ContextUsage | null;
|
|
92
|
-
/** Semantic tone for a context percentage, inclusive at the top of each band:
|
|
93
|
-
* info (blue) up to 25%, success (green) up to 50%, warning (yellow) up to
|
|
94
|
-
* 90%, error (red) above it. Four explicit stages, each backed by a feedback
|
|
95
|
-
* token, so the gauge follows the active theme. Pure. */
|
|
96
|
-
export declare function contextUsageTone(percent: number): ContextProgressTone;
|
|
97
|
-
/** The gauge's four stages, one per theme feedback token. */
|
|
98
|
-
export type ContextProgressTone = 'info' | 'success' | 'warning' | 'error';
|
|
99
131
|
/** Color for one gauge stage. Filled cells and the percent value both come from
|
|
100
132
|
* this one call, so the bar and its number can never disagree. `theme` is the
|
|
101
133
|
* host's resolved theme (loosely typed at runtime); a missing token falls back
|
|
@@ -137,33 +169,6 @@ export type ContextPerformance = {
|
|
|
137
169
|
cacheHit: number | null;
|
|
138
170
|
tokensPerSecond: number | null;
|
|
139
171
|
};
|
|
140
|
-
/** Thousands-separated token total: `55320` → `55,320` (en-US, matching the
|
|
141
|
-
* native block this one replaces). Null for a missing/invalid value. Pure. */
|
|
142
|
-
export declare function formatTokenCount(tokens: number | null | undefined): string | null;
|
|
143
|
-
/** Context-window label: `1_000_000` → `1.0M`, `200_000` → `200K`,
|
|
144
|
-
* `128_000` → `128K`, `32_768` → `32K`. Sub-million limits truncate to whole K
|
|
145
|
-
* so the printed window never overstates the model's capacity. Pure. */
|
|
146
|
-
export declare function formatContextWindow(limit: number | null | undefined): string | null;
|
|
147
|
-
/** Cells in the Context gauge: always rendered in full, so the bar never
|
|
148
|
-
* changes width between refreshes. With the space, the percent and the
|
|
149
|
-
* `of <window>` tail (at most 9 columns) the line stays inside 34 columns. */
|
|
150
|
-
export declare const CONTEXT_BAR_CELLS = 12;
|
|
151
|
-
/** Filled cell (U+25B0) and empty cell (U+25B1), both single-width. */
|
|
152
|
-
export declare const CONTEXT_BAR_FILLED_CELL = "▰";
|
|
153
|
-
export declare const CONTEXT_BAR_EMPTY_CELL = "▱";
|
|
154
|
-
/** Filled cells for a percentage: rounded, clamped to `0..cells`, so 0% is an
|
|
155
|
-
* empty bar and anything at or above 100% is a full one. Pure. */
|
|
156
|
-
export declare function contextBarFilled(percent: number, cells?: number): number;
|
|
157
|
-
/** The gauge split into its toned half (filled cells) and its muted half (empty
|
|
158
|
-
* cells), so the caller colors each side. Null when the percentage is missing:
|
|
159
|
-
* the Context block then keeps its tokens + cost rows and renders no bar. Pure. */
|
|
160
|
-
export declare function contextBar(percent: number | null | undefined, cells?: number): {
|
|
161
|
-
filled: string;
|
|
162
|
-
empty: string;
|
|
163
|
-
} | null;
|
|
164
|
-
/** USD spent with two decimals (`$0.18`), the native block's format. Null for
|
|
165
|
-
* a missing/negative value. Pure. */
|
|
166
|
-
export declare function formatSpent(cost: number | null | undefined): string | null;
|
|
167
172
|
/** One rendered context row. `lead` and `tail` carry the gauge bar when the row
|
|
168
173
|
* has one (`lead` is toned with the value, `tail` is muted), so the 12 cells
|
|
169
174
|
* stay contiguous while the empty half still reads as background. */
|
|
@@ -187,12 +192,6 @@ export type ContextBlockRows = {
|
|
|
187
192
|
* unavailable (never `undefined%`). A block with neither tokens nor cost
|
|
188
193
|
* yields null. Pure. */
|
|
189
194
|
export declare function contextBlockRows(usage: ContextUsage | null, cost: number | null | undefined): ContextBlockRows | null;
|
|
190
|
-
/** Models rendered in the Context block before the aggregate `… +N` line. */
|
|
191
|
-
export declare const MODEL_USAGE_VISIBLE_CEILING = 3;
|
|
192
|
-
/** Newest messages read per session — bounds the O(n) walk on long sessions. */
|
|
193
|
-
export declare const MODEL_USAGE_MESSAGE_LIMIT = 400;
|
|
194
|
-
/** Sessions read per family (root + delegations) for the aggregate. */
|
|
195
|
-
export declare const MODEL_USAGE_SESSION_LIMIT = 8;
|
|
196
195
|
/** Column widths for one model row (labels are muted, numbers right-aligned). */
|
|
197
196
|
export declare const MODEL_USAGE_MODEL_WIDTH = 12;
|
|
198
197
|
export declare const MODEL_USAGE_TOKEN_WIDTH = 6;
|
|
@@ -238,6 +237,14 @@ export type ModelUsageRow = {
|
|
|
238
237
|
export declare function modelUsageRows(rows: readonly ModelUsage[]): ModelUsageRow[];
|
|
239
238
|
/** Exact single-line text of a model row, with numbers right-aligned. Pure. */
|
|
240
239
|
export declare function modelUsageRowText(row: ModelUsageRow): string;
|
|
240
|
+
/** Wrap sidebar text by terminal cells, preserving the complete values. */
|
|
241
|
+
export declare function sidebarTextLines(value: string): string[];
|
|
242
|
+
/** Align a monetary value when it fits, otherwise preserve it on a new line. */
|
|
243
|
+
export declare function sidebarMoneyLines(label: string, value: string): string[];
|
|
244
|
+
/** Keep the existing OpenCode periods together when possible. */
|
|
245
|
+
export declare function contextSpendLines(value: string): string[];
|
|
246
|
+
/** Keep ordinary rows aligned; give oversized values their own lines. */
|
|
247
|
+
export declare function modelUsageRowLines(row: ModelUsageRow): string[];
|
|
241
248
|
/** Muted aggregate line for the models beyond the cap (`… +2 $0.03`). Null
|
|
242
249
|
* when every model fits. Pure. */
|
|
243
250
|
export declare function hiddenModelUsageText(hidden: number, hiddenCost: number): string | null;
|
|
@@ -429,17 +436,13 @@ export declare function statsRangeMatches(range: unknown, sent: {
|
|
|
429
436
|
from: number;
|
|
430
437
|
to: number;
|
|
431
438
|
}, scale: number): boolean;
|
|
432
|
-
/** The `Context` block's last line:
|
|
433
|
-
* (`hoje $0.42 · 30d $9.80`). A window without a
|
|
434
|
-
* no usable window at all yields null so the
|
|
435
|
-
* dropped. Pure. */
|
|
439
|
+
/** The `Context` block's last line: OpenCode stats source and both spend windows
|
|
440
|
+
* on one muted row (`OpenCode · hoje $0.42 · 30d $9.80`). A window without a
|
|
441
|
+
* usable amount is omitted, and no usable window at all yields null so the
|
|
442
|
+
* line (and not the block) is dropped. Pure. */
|
|
436
443
|
export declare function contextSpendLine(totals: SpendTotals | null): string | null;
|
|
437
|
-
/**
|
|
438
|
-
*
|
|
439
|
-
* run): emoji count as two cells, East Asian Wide/Fullwidth as two, East
|
|
440
|
-
* Asian Ambiguous as one, combining marks and variation selectors as none.
|
|
441
|
-
* Pure. */
|
|
442
|
-
export declare function cellWidth(value: string): number;
|
|
444
|
+
/** Grapheme iterator: a cut never splits a surrogate pair, a combining mark
|
|
445
|
+
* from its base or a ZWJ emoji sequence, so truncation stays cell-exact. */
|
|
443
446
|
/** Clamp a free-form label to `max` terminal cells without wrapping. The width
|
|
444
447
|
* is measured in display cells, never in UTF-16 code units: a CJK or emoji
|
|
445
448
|
* label used to overflow the column it was cut for (`計画の移行` is 5 code
|
|
@@ -1032,5 +1035,5 @@ declare const plugin: {
|
|
|
1032
1035
|
setup(context: Context): (() => void) | undefined;
|
|
1033
1036
|
};
|
|
1034
1037
|
//#endregion
|
|
1035
|
-
export { plugin as default };
|
|
1038
|
+
export { type ContextProgressTone, plugin as default };
|
|
1036
1039
|
//# sourceMappingURL=tui-v2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui-v2.d.ts","names":[],"sources":["../src/index-v2.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"tui-v2.d.ts","names":[],"sources":["../src/context-gauge.ts","../src/model-usage-limits.ts","../src/sidebar-width.ts","../src/index-v2.tsx"],"mappings":";;;;KAEY;qBAEC;qBACA;qBACA;wBAMG,iBAAiB,kBAAkB;wBAOnC,iBAAiB;wBAMjB,oBAAoB;wBAQpB,iBAAiB,iBAAiB;wBAOlC,WACd,oCACA;EACG;EAAgB;;wBAWL,YAAY;;;;qBCrDf;qBACA;qBACA;;;;;;;;wBCyHG,UAAU;;;;qBClEb;;;;qBAMA;;;qBAGA;qBACA;;YAED,mBAAmB,WAAW;;;;;;;;;;qBAU7B;YAmBD;EAAe;EAAqB;;;YAGpC;EAAuB;EAAgB;;;YAEvC;EAAoB,QAAQ,eAAe;;;YAE3C;EAAuB,MAAM;EAAY,WAAW;;;;wBAQhD,qBAAqB,iBAAiB;;wBAqDtC,cAAc,KAAK,qCAAqC;;;wBAUlD,0BACpB,KAAK,oCACL,cACC,QAAQ;;;wBAeK,iBAAiB,cAAc;;;wBAgB/B,WAAW;;;wBAWX,aAAa,cAAc;;;wBAU3B,kBAAkB;;;wBAQlB,qBAAqB,iBAAiB;;;;wBAmBtC,oBAAoB,wBAAwB;YAwChD;EAAyB;EAAgB;EAAiB;;;wBAuItD,4BACd,8BACA,mBACA,4BACA,kCACC;;wBAUa,sBACd,uBACA,oCACA;;wBAgBc,mBAAmB;YAYvB;EAAiB;EAAgB;EAAiB;;;;;;;wBAO9C,iBACd,0BACA;EACG;EAAe;;;;;;wBAsBJ,oBACd,0BACA,yCACA,kCACC;;;;;wBAqBa,qBAAqB,OAAO,qBAAqB;;;;;wBAQjD,uBACd,aAAa;;;;;wB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