pantheon-opencode 2.1.6 → 2.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.global.md +2 -2
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +64 -0
- package/README.md +13 -9
- package/README.pt-BR.md +13 -9
- package/bin/pantheon-init.mjs +1 -1
- package/commands/pantheon-audit.md +4 -5
- package/commands/pantheon-model.md +1 -2
- package/package.json +8 -2
- package/plugin.json +1 -1
- package/prompts/dynamic/agora-generated.txt +2 -2
- package/prompts/dynamic/orchestrate-generated.txt +4 -4
- package/prompts/sketch.prompt.md +1 -1
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +73 -12
- package/scripts/build-plugin.mjs +3 -1
- package/scripts/hooks/format-multi-language.sh +30 -29
- package/scripts/install-mcp.mjs +55 -27
- package/scripts/prune.mjs +124 -2
- package/scripts/setup.mjs +1 -1
- package/scripts/themis_heuristic_scan.py +3 -5
- package/skills-lock.json +1 -1
- package/src/agents/aphrodite.md +1 -1
- package/src/agents/athena.md +6 -14
- package/src/agents/demeter.md +1 -1
- package/src/agents/hermes.md +3 -2
- package/src/agents/iris.md +4 -6
- package/src/agents/prometheus.md +3 -7
- package/src/agents/roster.json +567 -0
- package/src/agents/zeus.md +3 -0
- package/src/instructions/agent-return-format.instructions.md +1 -1
- package/src/instructions/zeus-anti-stall.instructions.md +11 -35
- package/src/instructions/zeus-council-synthesis.instructions.md +17 -49
- package/src/instructions/zeus-timeout-retry.instructions.md +12 -80
- package/src/mcp/mcp_codemap_module.py +6 -5
- package/src/mcp/pantheon-mcp-server.mjs +875 -0
- package/src/pantheon/agent-forge-tool.ts +316 -0
- package/src/pantheon/auto-permissions.ts +31 -1
- package/src/pantheon/codemap-tools.ts +525 -0
- package/src/pantheon/deepwork/plan-tracker.ts +63 -2
- package/src/pantheon/execute-after.ts +21 -0
- package/src/pantheon/hook-engine.ts +2 -1
- package/src/pantheon/native-memory-tools.ts +686 -0
- package/src/pantheon/presets.mjs +15 -0
- package/src/pantheon/step-ledger.ts +259 -0
- package/src/pantheon/swe-eval-harness.ts +211 -0
- package/src/pantheon/tools.ts +62 -7
- package/src/plugin/index.js +2091 -136
- package/src/plugin/index.ts +1 -14
- package/src/plugin.ts +167 -10
- package/src/plugins/tui/dist/tui.d.ts +66 -0
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +1259 -367
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/index.tsx +632 -71
- package/src/plugins/tui/src/pantheon-settings.tsx +78 -14
- package/src/plugins/tui/src/quota-state.ts +190 -0
- package/src/plugins/tui/src/tui-prefs.ts +169 -12
- package/src/routing.yml +3 -0
- package/src/skills/auto-continue/references/auto-continue-details.md +2 -31
- /package/scripts/{setup-v2-config.mjs → setup-config.mjs} +0 -0
package/src/plugin/index.ts
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pantheon V2 plugin — directory entry for the OpenCode V2
|
|
3
|
-
*
|
|
4
|
-
* Loader contract (proven by sandbox probes in ~/pantheon-sandbox/v2):
|
|
5
|
-
* the beta only accepts `plugins` entries that are DIRECTORIES containing a
|
|
6
|
-
* real index.js/index.ts — a file path warns "must be a directory" and a
|
|
7
|
-
* symlink is ignored. The installer therefore registers this directory
|
|
8
|
-
* (`<pkg>/src/plugin`), never the `src/plugin.ts` file directly.
|
|
9
|
-
*
|
|
10
|
-
* This index is a thin re-export shim over the real entry at
|
|
11
|
-
* `src/plugin.ts` (kept as the single source of truth so the
|
|
12
|
-
* `./plugin` package export, unit tests, and V1 tooling keep working
|
|
13
|
-
* unchanged). The shim shape mirrors the verified probe:
|
|
14
|
-
* `export { default } from '<installed>/src/plugin.ts'` loads with zero
|
|
15
|
-
* errors and exposes the full orchestration plugin (tools, events, hooks).
|
|
2
|
+
* Pantheon V2 plugin — directory entry for the OpenCode V2 loader.
|
|
16
3
|
*
|
|
17
4
|
* @module plugin/index
|
|
18
5
|
*/
|
package/src/plugin.ts
CHANGED
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
* @module plugin
|
|
85
85
|
*/
|
|
86
86
|
|
|
87
|
-
import { appendFileSync, mkdirSync } from 'node:fs'
|
|
87
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync } from 'node:fs'
|
|
88
88
|
import { realpath as realpathAsync } from 'node:fs/promises'
|
|
89
89
|
import path from 'node:path'
|
|
90
90
|
import { fileURLToPath } from 'node:url'
|
|
@@ -170,6 +170,7 @@ import { applyDecisionRouterToPrompt } from './pantheon/local-decision-prompt.ts
|
|
|
170
170
|
import { applyV2ModelOverrides, readV2ModelConfiguration } from './pantheon/model-overrides.ts'
|
|
171
171
|
import type { NativeDecisionRequest } from './pantheon/native-decisions.ts'
|
|
172
172
|
import { buildV2VisionPromptContext, type V2VisionRuntime } from './pantheon/native-vision.ts'
|
|
173
|
+
import { buildPrefixCachedPrompt } from './pantheon/prompt-cache-order.ts'
|
|
173
174
|
import { getSharedBoard } from './pantheon/shared-board.ts'
|
|
174
175
|
import { createV2ShellHooks, type V2ShellRunner } from './pantheon/shell-hooks.ts'
|
|
175
176
|
import {
|
|
@@ -438,15 +439,13 @@ function loadRuntimeOverrides(): void {
|
|
|
438
439
|
if (runtimeOverridesLoaded) return
|
|
439
440
|
runtimeOverridesLoaded = true
|
|
440
441
|
try {
|
|
441
|
-
const read = (
|
|
442
|
-
const fs = require('node:fs') as typeof import('node:fs')
|
|
442
|
+
const read = (filePath: string): string | undefined => {
|
|
443
443
|
try {
|
|
444
|
-
return
|
|
444
|
+
return readFileSync(filePath, 'utf8')
|
|
445
445
|
} catch {
|
|
446
446
|
return undefined
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
const path = require('node:path') as typeof import('node:path')
|
|
450
449
|
const globalRaw = read(path.join(resolveGlobalOverrideDir(), 'pantheon-overrides.json'))
|
|
451
450
|
const projectRaw = read(path.join(process.cwd(), '.pantheon', 'overrides.json'))
|
|
452
451
|
runtimeOverrides = mergeOverrides(globalRaw, projectRaw).entries
|
|
@@ -547,6 +546,25 @@ function installV2TodoEnforcer(context: PluginContext): TodoEnforcer | undefined
|
|
|
547
546
|
|
|
548
547
|
// ─── V2 Transform Functions ─────────────────────────────────────────────
|
|
549
548
|
|
|
549
|
+
function readCanonicalRoster(): Record<string, Record<string, unknown>> {
|
|
550
|
+
try {
|
|
551
|
+
const candidates = [
|
|
552
|
+
fileURLToPath(new URL('agents/roster.json', import.meta.url)),
|
|
553
|
+
fileURLToPath(new URL('../src/agents/roster.json', import.meta.url)),
|
|
554
|
+
fileURLToPath(new URL('src/agents/roster.json', import.meta.url)),
|
|
555
|
+
path.join(process.cwd(), 'src', 'agents', 'roster.json'),
|
|
556
|
+
]
|
|
557
|
+
for (const p of candidates) {
|
|
558
|
+
if (existsSync(p)) {
|
|
559
|
+
const raw = readFileSync(p, 'utf8')
|
|
560
|
+
const data = JSON.parse(raw) as { agents?: Record<string, Record<string, unknown>> }
|
|
561
|
+
if (data && typeof data.agents === 'object') return data.agents
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
} catch {}
|
|
565
|
+
return {}
|
|
566
|
+
}
|
|
567
|
+
|
|
550
568
|
function transformAgents(draft: AgentDraft): void {
|
|
551
569
|
// Beta 19192 guard (issue #92): draft may not have `list`, or list()
|
|
552
570
|
// may return a non-iterable. Never throw — mark unsupported and return.
|
|
@@ -570,8 +588,10 @@ function transformAgents(draft: AgentDraft): void {
|
|
|
570
588
|
markUnsupported('agent-transform-list')
|
|
571
589
|
return
|
|
572
590
|
}
|
|
591
|
+
let configuredOverrides: Record<string, { model: string; variant?: string }> = {}
|
|
573
592
|
try {
|
|
574
593
|
const modelConfiguration = readV2ModelConfiguration()
|
|
594
|
+
configuredOverrides = modelConfiguration.overrides
|
|
575
595
|
if (modelConfiguration.warnings.length > 0) {
|
|
576
596
|
// The V2 server PluginContext has no documented user-visible notification
|
|
577
597
|
// or logging channel; preserve the degradation for status diagnostics.
|
|
@@ -583,6 +603,45 @@ function transformAgents(draft: AgentDraft): void {
|
|
|
583
603
|
markUnsupported('agent-model-overrides')
|
|
584
604
|
}
|
|
585
605
|
try {
|
|
606
|
+
const roster = readCanonicalRoster()
|
|
607
|
+
const seenIds = new Set<string>()
|
|
608
|
+
for (const agent of agents) {
|
|
609
|
+
if (agent?.id) seenIds.add(agent.id)
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// Auto-provision any missing Pantheon agents (for single-command plugin add installs)
|
|
613
|
+
for (const [id, def] of Object.entries(roster)) {
|
|
614
|
+
if (!seenIds.has(id) && typeof draft.update === 'function') {
|
|
615
|
+
try {
|
|
616
|
+
draft.update(id, (current: Record<string, unknown>) => {
|
|
617
|
+
// If the host mock passed an existing different agent, do not mutate it
|
|
618
|
+
if (current.id && current.id !== id) return
|
|
619
|
+
current.id = id
|
|
620
|
+
current.name = def.name ?? id
|
|
621
|
+
current.description = def.description ?? ''
|
|
622
|
+
current.mode = id === 'zeus' ? 'primary' : (def.mode ?? 'subagent')
|
|
623
|
+
if (def.temperature !== undefined) current.temperature = def.temperature
|
|
624
|
+
const override = configuredOverrides[id]
|
|
625
|
+
if (override?.model) {
|
|
626
|
+
current.model = override.model
|
|
627
|
+
if (override.variant !== undefined) current.variant = override.variant
|
|
628
|
+
}
|
|
629
|
+
const body = typeof def.body === 'string' ? def.body.trim() : ''
|
|
630
|
+
current.system = body
|
|
631
|
+
? buildPrefixCachedPrompt({ identity: body, currentTurn: POLICY }).prompt
|
|
632
|
+
: POLICY
|
|
633
|
+
})
|
|
634
|
+
} catch {
|
|
635
|
+
/* fail-open */
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// Default agent is Zeus
|
|
641
|
+
try {
|
|
642
|
+
if (typeof draft.default === 'function') draft.default('zeus')
|
|
643
|
+
} catch {}
|
|
644
|
+
|
|
586
645
|
for (const agent of agents) {
|
|
587
646
|
draft.update(agent.id, (current) => {
|
|
588
647
|
// Beta 19192 hardening + SystemPart SKIP: `system` may be a non-string
|
|
@@ -615,7 +674,63 @@ function transformAgents(draft: AgentDraft): void {
|
|
|
615
674
|
}
|
|
616
675
|
}
|
|
617
676
|
|
|
677
|
+
const CANONICAL_SLASH_COMMANDS: ReadonlyArray<{ name: string; description: string }> = [
|
|
678
|
+
{
|
|
679
|
+
name: 'pantheon',
|
|
680
|
+
description: 'Dispatch inline multi-specialist Council synthesis for architectural trade-offs',
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
name: 'pantheon-deepwork',
|
|
684
|
+
description: 'Execute multi-phase Deepwork plan with DAG checkpoints and verification gates',
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
name: 'pantheon-audit',
|
|
688
|
+
description: 'Run zero-token heuristic static scan and Themis 3-layer security review',
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
name: 'pantheon-focus',
|
|
692
|
+
description: 'Manage persistent session goals and focus boundaries across compactions',
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
name: 'pantheon-model',
|
|
696
|
+
description: 'Inspect or configure per-agent model overrides in active-preset.json',
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
name: 'pantheon-optimize',
|
|
700
|
+
description: 'Analyze and prune stale artifacts, worktrees, and context overhead',
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
name: 'pantheon-settings',
|
|
704
|
+
description: 'Open the interactive Pantheon TUI settings and Quotas & Spend window',
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
name: 'pantheon-vision',
|
|
708
|
+
description: 'Inspect or configure multimodal vision gateway and model status',
|
|
709
|
+
},
|
|
710
|
+
]
|
|
711
|
+
|
|
618
712
|
function transformCommands(draft: CommandDraft): void {
|
|
713
|
+
// OpenCode 2.2+ CommandEditor exposes `draft.add(definition)` to register
|
|
714
|
+
// slash commands directly from the plugin (single-command install support).
|
|
715
|
+
try {
|
|
716
|
+
const maybeAdd = (draft as unknown as { add?: (def: unknown) => void }).add
|
|
717
|
+
if (typeof maybeAdd === 'function') {
|
|
718
|
+
for (const cmd of CANONICAL_SLASH_COMMANDS) {
|
|
719
|
+
try {
|
|
720
|
+
maybeAdd.call(draft, {
|
|
721
|
+
name: cmd.name,
|
|
722
|
+
description: cmd.description,
|
|
723
|
+
execute: async () => {},
|
|
724
|
+
})
|
|
725
|
+
} catch {
|
|
726
|
+
/* ignore duplicate command registration */
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
} catch {
|
|
731
|
+
/* optional 2.2+ command registration */
|
|
732
|
+
}
|
|
733
|
+
|
|
619
734
|
// Beta 19192 guard (issue #92): draft may not have `list`, or list()
|
|
620
735
|
// may return a non-iterable. Never throw — mark unsupported and return.
|
|
621
736
|
let commands: Iterable<{ name: string }>
|
|
@@ -652,9 +767,11 @@ function transformCommands(draft: CommandDraft): void {
|
|
|
652
767
|
}
|
|
653
768
|
|
|
654
769
|
function transformReferences(draft: ReferenceDraft): void {
|
|
770
|
+
const globalAgentsPath = fileURLToPath(new URL('../AGENTS.global.md', import.meta.url))
|
|
771
|
+
const fallbackAgentsPath = fileURLToPath(new URL('../AGENTS.md', import.meta.url))
|
|
655
772
|
draft.add('pantheon-agents', {
|
|
656
773
|
type: 'local',
|
|
657
|
-
path:
|
|
774
|
+
path: existsSync(globalAgentsPath) ? globalAgentsPath : fallbackAgentsPath,
|
|
658
775
|
description: 'Pantheon agent and execution policy',
|
|
659
776
|
})
|
|
660
777
|
}
|
|
@@ -1044,17 +1161,24 @@ function subscribeV2Events(
|
|
|
1044
1161
|
// `session.compacted` 0/11 (PROBE-C, F-12). The live turn-end signal
|
|
1045
1162
|
// is `session.execution.succeeded`, observed above. The branches are
|
|
1046
1163
|
// left untouched on purpose; removing them is a separate change.
|
|
1047
|
-
if (
|
|
1164
|
+
if (
|
|
1165
|
+
event.type === 'session.idle' ||
|
|
1166
|
+
event.type === 'session.deleted' ||
|
|
1167
|
+
event.type === 'session.execution.succeeded'
|
|
1168
|
+
) {
|
|
1048
1169
|
const properties = event.properties ?? {}
|
|
1170
|
+
const data = (event as { data?: Record<string, unknown> }).data ?? {}
|
|
1049
1171
|
const info = properties.info
|
|
1050
1172
|
const infoID =
|
|
1051
1173
|
info !== null && typeof info === 'object' ? (info as { id?: unknown }).id : undefined
|
|
1052
1174
|
const sessionID =
|
|
1053
1175
|
typeof properties.sessionID === 'string'
|
|
1054
1176
|
? properties.sessionID
|
|
1055
|
-
: typeof
|
|
1056
|
-
?
|
|
1057
|
-
:
|
|
1177
|
+
: typeof data.sessionID === 'string'
|
|
1178
|
+
? data.sessionID
|
|
1179
|
+
: typeof infoID === 'string'
|
|
1180
|
+
? infoID
|
|
1181
|
+
: undefined
|
|
1058
1182
|
if (sessionID) onTurnEnd?.(sessionID)
|
|
1059
1183
|
}
|
|
1060
1184
|
}
|
|
@@ -1077,15 +1201,19 @@ async function handleV2SessionEvent(event: V2SessionEvent): Promise<void> {
|
|
|
1077
1201
|
await onSessionCreated(event)
|
|
1078
1202
|
break
|
|
1079
1203
|
case 'session.idle':
|
|
1204
|
+
case 'session.execution.succeeded':
|
|
1080
1205
|
await onSessionIdle(event)
|
|
1081
1206
|
break
|
|
1082
1207
|
case 'session.deleted':
|
|
1083
1208
|
await onSessionDeleted(event)
|
|
1084
1209
|
break
|
|
1085
1210
|
case 'session.error':
|
|
1211
|
+
case 'session.execution.failed':
|
|
1212
|
+
case 'session.step.failed':
|
|
1086
1213
|
await onSessionError(event)
|
|
1087
1214
|
break
|
|
1088
1215
|
case 'session.compacted':
|
|
1216
|
+
case 'session.compaction.ended':
|
|
1089
1217
|
await onSessionCompacted(event)
|
|
1090
1218
|
break
|
|
1091
1219
|
default:
|
|
@@ -1498,6 +1626,29 @@ async function registerV2SessionHooks(context: PluginContext): Promise<boolean>
|
|
|
1498
1626
|
// never consults provider consent/credentials or invokes remote egress.
|
|
1499
1627
|
await applyDecisionRouterToPrompt(admission, userRequest)
|
|
1500
1628
|
|
|
1629
|
+
// When the OpenCode 2.2+ host exposes keyed session instructions,
|
|
1630
|
+
// publish the Pantheon policy marker via `instructions.entry.put`
|
|
1631
|
+
// so it stays KV-cache friendly.
|
|
1632
|
+
try {
|
|
1633
|
+
const sid = (admission as { sessionID?: unknown } | null)?.sessionID
|
|
1634
|
+
const instrEntry = (
|
|
1635
|
+
sessionCtx as unknown as {
|
|
1636
|
+
instructions?: {
|
|
1637
|
+
entry?: { put?: (arg: { sessionID: string; key: string; text: string }) => unknown }
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
).instructions?.entry
|
|
1641
|
+
if (typeof sid === 'string' && typeof instrEntry?.put === 'function') {
|
|
1642
|
+
await instrEntry.put({
|
|
1643
|
+
sessionID: sid,
|
|
1644
|
+
key: 'pantheon.policy',
|
|
1645
|
+
text: POLICY,
|
|
1646
|
+
})
|
|
1647
|
+
}
|
|
1648
|
+
} catch {
|
|
1649
|
+
/* optional host capability */
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1501
1652
|
// Shadow observation only. The projection carries `prompt.agents` and
|
|
1502
1653
|
// `prompt.skills` and nothing else, so no prompt text or file bytes
|
|
1503
1654
|
// reach a record; observeShadow clones and freezes it, so admission is
|
|
@@ -2964,4 +3115,10 @@ export function getUnsupportedFeatures(): readonly string[] {
|
|
|
2964
3115
|
return V2_UNSUPPORTED_FEATURES
|
|
2965
3116
|
}
|
|
2966
3117
|
|
|
3118
|
+
export const UNSUPPORTED_FEATURES = V2_UNSUPPORTED_FEATURES
|
|
3119
|
+
export const disposePlugin = v2Dispose
|
|
3120
|
+
export const resetIdleEnforcerForTests = resetV2IdleEnforcerForTests
|
|
3121
|
+
export const setSecretScanRunnerForTests = setV2SecretScanRunnerForTests
|
|
3122
|
+
export const setShellRunnerForTests = setV2ShellRunnerForTests
|
|
3123
|
+
|
|
2967
3124
|
export default plugin
|
|
@@ -203,6 +203,46 @@ export declare function contextBlockRows(usage: ContextUsage | null, cost: numbe
|
|
|
203
203
|
cells?: number;
|
|
204
204
|
evenMark?: boolean;
|
|
205
205
|
}): ContextBlockRows | null;
|
|
206
|
+
export type TurnCostSummary = {
|
|
207
|
+
current: number;
|
|
208
|
+
previous: number | null;
|
|
209
|
+
};
|
|
210
|
+
/** Custo do último turno do assistente e do turno anterior. Pure. */
|
|
211
|
+
export declare function latestTurnCost(messages: readonly any[] | null | undefined): TurnCostSummary | null;
|
|
212
|
+
export declare function formatTurnCostUSD(cost: number | null | undefined): string | null;
|
|
213
|
+
export declare function formatTurnCostLine(summary: TurnCostSummary | null | undefined): string | null;
|
|
214
|
+
export type TokenAnatomy = {
|
|
215
|
+
input: number;
|
|
216
|
+
output: number;
|
|
217
|
+
reasoning: number;
|
|
218
|
+
};
|
|
219
|
+
/** Extrai desdobramento de tokens (input, output, reasoning/thinking). Pure. */
|
|
220
|
+
export declare function extractTokenAnatomy(tokens: any): TokenAnatomy | null;
|
|
221
|
+
export declare function formatTokenAnatomyLine(anatomy: TokenAnatomy | null | undefined): string | null;
|
|
222
|
+
export declare function formatTokenAnatomySplit(anatomy: TokenAnatomy | null | undefined): {
|
|
223
|
+
inOut: string | null;
|
|
224
|
+
think: string | null;
|
|
225
|
+
} | null;
|
|
226
|
+
export type ToolCallSummary = {
|
|
227
|
+
total: number;
|
|
228
|
+
failures: number;
|
|
229
|
+
};
|
|
230
|
+
/** Conta chamadas de ferramentas e eventuais falhas/erros. Pure. */
|
|
231
|
+
export declare function countToolCalls(messages: readonly any[] | null | undefined): ToolCallSummary;
|
|
232
|
+
export declare function formatToolCallLine(summary: ToolCallSummary | null | undefined, locale?: string): string | null;
|
|
233
|
+
export type CompactionInfo = {
|
|
234
|
+
count: number;
|
|
235
|
+
prunedTokens: number;
|
|
236
|
+
};
|
|
237
|
+
/** Extrai contagem de compactações e estimativa de tokens podados. Pure. */
|
|
238
|
+
export declare function extractCompactionInfo(messages: readonly any[] | null | undefined): CompactionInfo;
|
|
239
|
+
/** Conta quantas vezes a sessão sofreu compactação nativa. Pure. */
|
|
240
|
+
export declare function countSessionCompactions(messages: readonly any[] | null | undefined): number;
|
|
241
|
+
export declare function formatCompactionBadge(info: number | CompactionInfo | null | undefined): string | null;
|
|
242
|
+
/** Conta mensagens do usuário para mensurar turnos da sessão. Pure. */
|
|
243
|
+
export declare function countUserTurns(messages: readonly any[] | null | undefined): number;
|
|
244
|
+
export declare function formatTurnsBadge(count: number, locale?: string): string | null;
|
|
245
|
+
export declare function resolveGateStatus(env?: Record<string, string | undefined>): string;
|
|
206
246
|
/** Column widths for one model row (labels are muted, numbers right-aligned). */
|
|
207
247
|
export declare const MODEL_USAGE_MODEL_WIDTH = 12;
|
|
208
248
|
export declare const MODEL_USAGE_TOKEN_WIDTH = 6;
|
|
@@ -1016,6 +1056,32 @@ export type SidebarModel = {
|
|
|
1016
1056
|
model: string;
|
|
1017
1057
|
overridden: boolean;
|
|
1018
1058
|
} | null>;
|
|
1059
|
+
/** Custo do último turno do assistente e do anterior. */
|
|
1060
|
+
turnCostLine: Accessor<string | null>;
|
|
1061
|
+
/** Decomposição anatômica de tokens (in / out / reasoning think). */
|
|
1062
|
+
tokenAnatomyLine: Accessor<string | null>;
|
|
1063
|
+
/** Contagem de chamadas de ferramentas e falhas. */
|
|
1064
|
+
toolCallsLine: Accessor<string | null>;
|
|
1065
|
+
/** Badge de compactação (ex: "1x compact"). */
|
|
1066
|
+
compactionBadge: Accessor<string | null>;
|
|
1067
|
+
/** Badge de turnos da sessão (ex: "↻ 4 turns"). */
|
|
1068
|
+
turnsBadge: Accessor<string | null>;
|
|
1069
|
+
/** Decomposição dividida de tokens (in/out na esquerda, think na direita). */
|
|
1070
|
+
tokenAnatomySplit: Accessor<{
|
|
1071
|
+
inOut: string | null;
|
|
1072
|
+
think: string | null;
|
|
1073
|
+
} | null>;
|
|
1074
|
+
/** Telemetria dividida (Cache % na esquerda, Speed na direita). */
|
|
1075
|
+
performanceSplit: Accessor<{
|
|
1076
|
+
cache: string | null;
|
|
1077
|
+
speed: string | null;
|
|
1078
|
+
} | null>;
|
|
1079
|
+
/** Proporção do contexto (ex: "48K / 200K"). */
|
|
1080
|
+
contextRatioLine: Accessor<string | null>;
|
|
1081
|
+
/** Status do portão de validação/segurança (ex: "✓ Gate: tests pass"). */
|
|
1082
|
+
gateStatus: Accessor<string>;
|
|
1083
|
+
/** Se a sessão ativa está fixada. */
|
|
1084
|
+
isPinned: Accessor<boolean>;
|
|
1019
1085
|
};
|
|
1020
1086
|
/** Reactive wiring behind the sidebar: refresh subscription, warm syncs, the
|
|
1021
1087
|
* running-only spinner and the completion-toast effect. `context` stays loosely
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui.d.ts","names":[],"sources":["../src/context-gauge.ts","../src/model-usage-limits.ts","../src/sidebar-width.ts","../src/index.tsx"],"mappings":";;;;KAEY;qBAEC;qBACA;qBACA;KAED;UAiBK;EACf;EACA,QAAQ;EACR;;wBAOc,iBAAiB,kBAAkB;wBAOnC,iBAAiB;wBAMjB,oBAAoB;wBAQpB,iBAAiB,iBAAiB;wBAOlC,WACd,oCACA,mBAAkB;EACf;EAAgB;;wBA+CL,YAAY;;;;qBChHf;qBACA;qBACA;;;;;;;;wBCyHG,UAAU;;;;
|
|
1
|
+
{"version":3,"file":"tui.d.ts","names":[],"sources":["../src/context-gauge.ts","../src/model-usage-limits.ts","../src/sidebar-width.ts","../src/index.tsx"],"mappings":";;;;KAEY;qBAEC;qBACA;qBACA;KAED;UAiBK;EACf;EACA,QAAQ;EACR;;wBAOc,iBAAiB,kBAAkB;wBAOnC,iBAAiB;wBAMjB,oBAAoB;wBAQpB,iBAAiB,iBAAiB;wBAOlC,WACd,oCACA,mBAAkB;EACf;EAAgB;;wBA+CL,YAAY;;;;qBChHf;qBACA;qBACA;;;;;;;;wBCyHG,UAAU;;;;qBCtCb;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