pantheon-opencode 1.6.2-beta.9 → 1.6.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/CHANGELOG.md +101 -0
- package/README.md +34 -60
- package/README.pt-BR.md +10 -12
- package/bin/pantheon-init.mjs +22 -32
- package/package.json +3 -3
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/decision-router.mjs +41 -56
- package/scripts/install/decision-router-config.mjs +67 -1
- package/scripts/install/npx-cache-sweep.mjs +103 -0
- package/scripts/install/opencode.mjs +7 -7
- package/scripts/install/plugin.mjs +4 -3
- package/scripts/install/strings.mjs +4 -0
- package/scripts/release-gates.mjs +6 -82
- package/scripts/sync-tui.mjs +3 -3
- package/src/agents/zeus.md +4 -2
- package/src/pantheon/jev-decision-tool.ts +366 -114
- package/src/pantheon/jev-decisions.ts +11 -13
- package/src/pantheon/jev-escalation.ts +639 -0
- package/src/pantheon/jev-quality-score.ts +432 -0
- package/src/pantheon/jev-risk-gate.ts +479 -0
- package/src/pantheon/local-decision-prompt.ts +12 -18
- package/src/pantheon/v2-decision-telemetry.ts +14 -4
- package/src/pantheon/v2-native-decisions.ts +1 -1
- package/src/plugin-v2.ts +201 -24
- package/src/plugins/tui/dist/server-v2.d.ts +19 -11
- package/src/plugins/tui/dist/server-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/server-v2.js +19 -789
- package/src/plugins/tui/dist/server-v2.js.map +1 -1
- package/src/plugins/tui/dist/tui-v2.d.ts +12 -331
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui-v2.js +257 -5370
- package/src/plugins/tui/dist/tui-v2.js.map +1 -1
- package/src/plugins/tui/dist/tui.js +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-v2.tsx +213 -86
- package/src/plugins/tui/src/server-v2.ts +18 -982
- package/src/plugins/tui/tsconfig.typecheck.json +1 -6
- package/src/plugins/tui/tsdown.config.ts +1 -11
- package/src/plugins/tui/dist/cost-data-CCZUs1aJ.js +0 -749
- package/src/plugins/tui/dist/cost-data-CCZUs1aJ.js.map +0 -1
- package/src/plugins/tui/dist/quota-adapters.d.ts +0 -89
- package/src/plugins/tui/dist/quota-adapters.d.ts.map +0 -1
- package/src/plugins/tui/dist/quota-adapters.js +0 -1142
- package/src/plugins/tui/dist/quota-adapters.js.map +0 -1
- package/src/plugins/tui/dist/quota-cli.d.ts +0 -17
- package/src/plugins/tui/dist/quota-cli.d.ts.map +0 -1
- package/src/plugins/tui/dist/quota-cli.js +0 -184
- package/src/plugins/tui/dist/quota-cli.js.map +0 -1
- package/src/plugins/tui/dist/quota-rpc-DMmXBhBe.js +0 -684
- package/src/plugins/tui/dist/quota-rpc-DMmXBhBe.js.map +0 -1
- package/src/plugins/tui/dist/usage-history-contract-nt1rnBPE.js +0 -118
- package/src/plugins/tui/dist/usage-history-contract-nt1rnBPE.js.map +0 -1
- package/src/plugins/tui/dist/usage-history-worker.js +0 -25
- package/src/plugins/tui/dist/usage-history-worker.js.map +0 -1
- package/src/plugins/tui/src/go-key-diagnostic-ui.ts +0 -100
- package/src/plugins/tui/src/go-key-diagnostic.ts +0 -125
- package/src/plugins/tui/src/quota-adapters.ts +0 -1598
- package/src/plugins/tui/src/quota-cli.ts +0 -237
- package/src/plugins/tui/src/quota-rpc.ts +0 -373
- package/src/plugins/tui/src/quota-v2-model.ts +0 -1032
- package/src/plugins/tui/src/quota-v2.tsx +0 -1238
- package/src/plugins/tui/src/usage-history-contract.ts +0 -217
- package/src/plugins/tui/src/usage-history-validation.ts +0 -104
- package/src/plugins/tui/src/usage-history-view.tsx +0 -236
- package/src/plugins/tui/src/usage-history-worker.ts +0 -25
- package/src/plugins/tui/src/usage-view-model.ts +0 -272
|
@@ -23,13 +23,6 @@ import {
|
|
|
23
23
|
MODEL_USAGE_SESSION_LIMIT,
|
|
24
24
|
MODEL_USAGE_VISIBLE_CEILING,
|
|
25
25
|
} from './model-usage-limits'
|
|
26
|
-
import { QuotaSidebarSummary, quotaTextLines, registerQuotaTui } from './quota-v2'
|
|
27
|
-
import {
|
|
28
|
-
createQuotaRuntime,
|
|
29
|
-
type QuotaRuntime,
|
|
30
|
-
resolveActiveModelRef,
|
|
31
|
-
resolveModelContextSnapshot,
|
|
32
|
-
} from './quota-v2-model'
|
|
33
26
|
import { cellWidth, GRAPHEMES, SIDEBAR_CONTENT_WIDTH } from './sidebar-width'
|
|
34
27
|
|
|
35
28
|
export type { ContextProgressTone } from './context-gauge'
|
|
@@ -44,80 +37,12 @@ export {
|
|
|
44
37
|
formatSpent,
|
|
45
38
|
formatTokenCount,
|
|
46
39
|
} from './context-gauge'
|
|
47
|
-
export { quotaGoCheckCommand } from './go-key-diagnostic-ui'
|
|
48
40
|
export {
|
|
49
41
|
MODEL_USAGE_MESSAGE_LIMIT,
|
|
50
42
|
MODEL_USAGE_SESSION_LIMIT,
|
|
51
43
|
MODEL_USAGE_VISIBLE_CEILING,
|
|
52
44
|
} from './model-usage-limits'
|
|
53
|
-
export type { QuotaIconMode, QuotaIconName, QuotaTab } from './quota-v2'
|
|
54
|
-
export {
|
|
55
|
-
activeQuotaModelLabel,
|
|
56
|
-
DEFAULT_QUOTA_TAB,
|
|
57
|
-
financeMetricLines,
|
|
58
|
-
moveQuotaTab,
|
|
59
|
-
openQuotaPanel,
|
|
60
|
-
providerState,
|
|
61
|
-
QUOTA_ICON,
|
|
62
|
-
QUOTA_OPEN_COMMAND_ID,
|
|
63
|
-
QUOTA_PANEL_COMMANDS,
|
|
64
|
-
QUOTA_PANEL_NAME,
|
|
65
|
-
QUOTA_TABS,
|
|
66
|
-
QuotaPanel,
|
|
67
|
-
quotaIcon,
|
|
68
|
-
quotaMetricLines,
|
|
69
|
-
quotaOpenCommand,
|
|
70
|
-
quotaPanelKeymapLayer,
|
|
71
|
-
quotaPanelStatusMessage,
|
|
72
|
-
quotaTabLabel,
|
|
73
|
-
quotaTextLines,
|
|
74
|
-
quotaUsageTone,
|
|
75
|
-
quotaWindowLines,
|
|
76
|
-
runQuotaPanelCommand,
|
|
77
|
-
sidebarFinanceEntries,
|
|
78
|
-
snapshotSummary,
|
|
79
|
-
} from './quota-v2'
|
|
80
|
-
export type { QuotaSidebarEntry } from './quota-v2-model'
|
|
81
|
-
export {
|
|
82
|
-
collectRecentModelUsageRows,
|
|
83
|
-
compactQuotaMetric,
|
|
84
|
-
createQuotaClock,
|
|
85
|
-
createQuotaRuntime,
|
|
86
|
-
DEFAULT_QUOTA_PREFERENCES,
|
|
87
|
-
formatQuotaCountdown,
|
|
88
|
-
formatQuotaMetric,
|
|
89
|
-
normalizeQuotaPreferences,
|
|
90
|
-
QUOTA_CLOCK_INTERVAL_MS,
|
|
91
|
-
quotaClock,
|
|
92
|
-
quotaProgress,
|
|
93
|
-
quotaSidebarEntries,
|
|
94
|
-
quotaSnapshotFromStatus,
|
|
95
|
-
quotaSnapshotStatusLabel,
|
|
96
|
-
} from './quota-v2-model'
|
|
97
45
|
export { cellWidth } from './sidebar-width'
|
|
98
|
-
export { UsageHistorySection } from './usage-history-view'
|
|
99
|
-
export type { ActiveContextCostResult } from './usage-view-model'
|
|
100
|
-
export {
|
|
101
|
-
activeContextEstimateErrorLines,
|
|
102
|
-
activeContextEstimateLines,
|
|
103
|
-
activeContextEstimateMissingLines,
|
|
104
|
-
activeContextEstimatePendingLines,
|
|
105
|
-
activeModelIdentity,
|
|
106
|
-
sessionSpendLabel,
|
|
107
|
-
USAGE_HISTORY_PERIOD_BINDINGS,
|
|
108
|
-
usageHistoryChartLines,
|
|
109
|
-
usageHistoryControlsLines,
|
|
110
|
-
usageHistoryCoverageLabel,
|
|
111
|
-
usageHistoryEmptyMessage,
|
|
112
|
-
usageHistoryPartialWarning,
|
|
113
|
-
usageHistoryPeriodForKey,
|
|
114
|
-
usageHistoryPricingLabel,
|
|
115
|
-
usageHistorySelectorLabel,
|
|
116
|
-
usageHistorySelectorLines,
|
|
117
|
-
usageHistoryTextLines,
|
|
118
|
-
usageHistoryUnavailableMessage,
|
|
119
|
-
} from './usage-view-model'
|
|
120
|
-
export { resolveActiveModelRef, resolveModelContextSnapshot }
|
|
121
46
|
|
|
122
47
|
const SINGLETON = Symbol.for('pantheon.tui.v2.loaded')
|
|
123
48
|
|
|
@@ -362,6 +287,184 @@ export function resolveContextLimit(models: readonly any[], ref: unknown): numbe
|
|
|
362
287
|
return null
|
|
363
288
|
}
|
|
364
289
|
|
|
290
|
+
/* ─── Active model & context snapshot ─────────────────────
|
|
291
|
+
* `resolveActiveModelRef` and `resolveModelContextSnapshot` (and the private
|
|
292
|
+
* helpers below them) moved here verbatim from the removed `quota-v2-model.ts`
|
|
293
|
+
* when the native quota surface was deleted: the sidebar's Context gauge is
|
|
294
|
+
* their only remaining consumer. They read only host-published transcript and
|
|
295
|
+
* model-catalog data — no RPC and no provider call. They are deliberately
|
|
296
|
+
* distinct from the looser helpers above (`modelRefID`, `resolveContextLimit`,
|
|
297
|
+
* `transcriptWindow`): identity matching here is provider-qualified and the
|
|
298
|
+
* context window excludes messages with no reported usage. */
|
|
299
|
+
|
|
300
|
+
export type ModelContextSnapshot = { tokens: number; percent: number; limit: number }
|
|
301
|
+
|
|
302
|
+
function asRecord(value: unknown): Record<string, unknown> | undefined {
|
|
303
|
+
return typeof value === 'object' && value !== null
|
|
304
|
+
? (value as Record<string, unknown>)
|
|
305
|
+
: undefined
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
function modelID(ref: unknown): string | null {
|
|
309
|
+
const record = asRecord(ref)
|
|
310
|
+
const id = typeof ref === 'string' ? ref : (record?.id ?? record?.modelID)
|
|
311
|
+
return typeof id === 'string' && id.trim() !== '' ? id : null
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function messageModelRef(message: Record<string, unknown>): unknown {
|
|
315
|
+
return message.model ?? message
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function modelProvider(ref: unknown, models: readonly unknown[]): string | null {
|
|
319
|
+
const direct = asRecord(ref)?.providerID
|
|
320
|
+
if (typeof direct === 'string' && direct.trim() !== '') return direct.trim()
|
|
321
|
+
const id = modelID(ref)
|
|
322
|
+
if (id === null) return null
|
|
323
|
+
const segment = id.slice(id.lastIndexOf('/') + 1)
|
|
324
|
+
const providers = new Set<string>()
|
|
325
|
+
for (const candidate of models) {
|
|
326
|
+
const item = asRecord(candidate)
|
|
327
|
+
if (!item) continue
|
|
328
|
+
if (item.id !== id && item.modelID !== id && item.id !== segment && item.modelID !== segment)
|
|
329
|
+
continue
|
|
330
|
+
if (typeof item.providerID === 'string' && item.providerID.trim() !== '') {
|
|
331
|
+
providers.add(item.providerID.trim())
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
const explicitProvider = id.includes('/') ? id.slice(0, id.indexOf('/')) : null
|
|
335
|
+
if (explicitProvider && providers.has(explicitProvider)) return explicitProvider
|
|
336
|
+
return providers.size === 1 ? ([...providers][0] ?? null) : null
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function modelIdentity(
|
|
340
|
+
ref: unknown,
|
|
341
|
+
models: readonly unknown[],
|
|
342
|
+
): {
|
|
343
|
+
key: string
|
|
344
|
+
id: string
|
|
345
|
+
providerID: string | null
|
|
346
|
+
label: string
|
|
347
|
+
} | null {
|
|
348
|
+
const id = modelID(ref)
|
|
349
|
+
if (id === null) return null
|
|
350
|
+
const providerID = modelProvider(ref, models)
|
|
351
|
+
const segment = id.slice(id.lastIndexOf('/') + 1)
|
|
352
|
+
return {
|
|
353
|
+
key: `${providerID ?? ''}\u0000${id}`,
|
|
354
|
+
id,
|
|
355
|
+
providerID,
|
|
356
|
+
label: segment || id,
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function tokenCount(message: Record<string, unknown>): number | null {
|
|
361
|
+
const tokens = asRecord(message.tokens)
|
|
362
|
+
if (!tokens) return null
|
|
363
|
+
const cache = asRecord(tokens.cache)
|
|
364
|
+
const values = [tokens.input, tokens.output, tokens.reasoning, cache?.read, cache?.write]
|
|
365
|
+
const reported = values.filter(
|
|
366
|
+
(value): value is number => typeof value === 'number' && Number.isFinite(value) && value >= 0,
|
|
367
|
+
)
|
|
368
|
+
return reported.length === 0 ? null : reported.reduce((sum, value) => sum + value, 0)
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
function contextLimit(ref: unknown, models: readonly unknown[]): number | null {
|
|
372
|
+
const id = modelID(ref)
|
|
373
|
+
if (id === null) return null
|
|
374
|
+
const providerID = modelProvider(ref, models)
|
|
375
|
+
if (providerID === null) return null
|
|
376
|
+
const segment = id.slice(id.lastIndexOf('/') + 1)
|
|
377
|
+
const matches = models.filter((value) => {
|
|
378
|
+
const model = asRecord(value)
|
|
379
|
+
if (!model) return false
|
|
380
|
+
const idMatches =
|
|
381
|
+
model.id === id || model.modelID === id || model.id === segment || model.modelID === segment
|
|
382
|
+
return idMatches && model.providerID === providerID
|
|
383
|
+
})
|
|
384
|
+
const limits = new Set<number>()
|
|
385
|
+
for (const candidate of matches) {
|
|
386
|
+
const limit = asRecord(asRecord(candidate)?.limit)?.context
|
|
387
|
+
if (typeof limit === 'number' && Number.isFinite(limit) && limit > 0) limits.add(limit)
|
|
388
|
+
}
|
|
389
|
+
return limits.size === 1 ? ([...limits][0] ?? null) : null
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function liveTranscriptWindow(
|
|
393
|
+
messages: readonly unknown[],
|
|
394
|
+
revertMessageID: string | null | undefined,
|
|
395
|
+
): { start: number; end: number } {
|
|
396
|
+
let end = messages.length
|
|
397
|
+
if (revertMessageID) {
|
|
398
|
+
const boundary = messages.findIndex((message) => asRecord(message)?.id === revertMessageID)
|
|
399
|
+
if (boundary >= 0) end = boundary
|
|
400
|
+
}
|
|
401
|
+
let start = 0
|
|
402
|
+
for (let index = end - 1; index >= 0; index -= 1) {
|
|
403
|
+
if (asRecord(messages[index])?.type === 'compaction') {
|
|
404
|
+
start = index + 1
|
|
405
|
+
break
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
return { start, end }
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function latestContext(
|
|
412
|
+
messages: readonly unknown[],
|
|
413
|
+
modelRef: unknown,
|
|
414
|
+
models: readonly unknown[],
|
|
415
|
+
revertMessageID?: string | null,
|
|
416
|
+
): ModelContextSnapshot | null {
|
|
417
|
+
const target = modelIdentity(modelRef, models)
|
|
418
|
+
if (target === null || target.providerID === null) return null
|
|
419
|
+
const limit = contextLimit(modelRef, models)
|
|
420
|
+
if (limit === null || limit <= 0) return null
|
|
421
|
+
const { start, end } = liveTranscriptWindow(messages, revertMessageID)
|
|
422
|
+
for (let index = end - 1; index >= start; index -= 1) {
|
|
423
|
+
const message = asRecord(messages[index])
|
|
424
|
+
if (message?.type !== 'assistant') continue
|
|
425
|
+
const identity = modelIdentity(messageModelRef(message), models)
|
|
426
|
+
if (identity?.id !== target.id || identity.providerID !== target.providerID) continue
|
|
427
|
+
const tokens = tokenCount(message)
|
|
428
|
+
if (tokens === null || tokens <= 0) continue
|
|
429
|
+
return { tokens, percent: Math.round((tokens / limit) * 100), limit }
|
|
430
|
+
}
|
|
431
|
+
return null
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/** Snapshot for one exact model identity in the bounded active transcript. */
|
|
435
|
+
export function resolveModelContextSnapshot(
|
|
436
|
+
messages: readonly unknown[],
|
|
437
|
+
modelRef: unknown,
|
|
438
|
+
models: readonly unknown[],
|
|
439
|
+
revertMessageID?: string | null,
|
|
440
|
+
): ModelContextSnapshot | null {
|
|
441
|
+
return latestContext(
|
|
442
|
+
messages.slice(-MODEL_USAGE_MESSAGE_LIMIT),
|
|
443
|
+
modelRef,
|
|
444
|
+
models,
|
|
445
|
+
revertMessageID,
|
|
446
|
+
)
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/** Select the pinned chat model before transcript or configured-agent fallbacks. */
|
|
450
|
+
export function resolveActiveModelRef(
|
|
451
|
+
sessionModel: unknown,
|
|
452
|
+
activeMessages: readonly unknown[],
|
|
453
|
+
fallbackModel: unknown = null,
|
|
454
|
+
): unknown {
|
|
455
|
+
if (modelID(sessionModel) !== null) return sessionModel
|
|
456
|
+
|
|
457
|
+
const firstMessage = Math.max(0, activeMessages.length - MODEL_USAGE_MESSAGE_LIMIT)
|
|
458
|
+
for (let index = activeMessages.length - 1; index >= firstMessage; index -= 1) {
|
|
459
|
+
const message = asRecord(activeMessages[index])
|
|
460
|
+
if (message?.type !== 'assistant') continue
|
|
461
|
+
const ref = messageModelRef(message)
|
|
462
|
+
if (modelID(ref) !== null) return ref
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
return modelID(fallbackModel) === null ? null : fallbackModel
|
|
466
|
+
}
|
|
467
|
+
|
|
365
468
|
/** Native token total: input + output + reasoning + cache read + cache write. */
|
|
366
469
|
export function messageTokensTotal(tokens: any): number {
|
|
367
470
|
const cacheRead = numberOrNull(tokens?.cache?.read) ?? 0
|
|
@@ -644,14 +747,14 @@ export function collectModelUsage(messages: readonly any[]): ModelUsage[] {
|
|
|
644
747
|
if (id === null || model === null) continue
|
|
645
748
|
const providerID = typeof message.model?.providerID === 'string' ? message.model.providerID : ''
|
|
646
749
|
const key = `${providerID}\u0000${id}`
|
|
647
|
-
const
|
|
750
|
+
const tokensTotal = message.tokens ? messageTokensTotal(message.tokens) : 0
|
|
648
751
|
const cost = numberOrNull(message.cost) ?? 0
|
|
649
752
|
const current = totals.get(key)
|
|
650
753
|
if (current) {
|
|
651
|
-
current.tokens += Math.max(0,
|
|
754
|
+
current.tokens += Math.max(0, tokensTotal)
|
|
652
755
|
current.cost += Math.max(0, cost)
|
|
653
756
|
} else {
|
|
654
|
-
totals.set(key, { model, tokens: Math.max(0,
|
|
757
|
+
totals.set(key, { model, tokens: Math.max(0, tokensTotal), cost: Math.max(0, cost) })
|
|
655
758
|
}
|
|
656
759
|
}
|
|
657
760
|
return [...totals.values()]
|
|
@@ -724,9 +827,39 @@ export function modelUsageRowText(row: ModelUsageRow): string {
|
|
|
724
827
|
return `${row.model.padEnd(MODEL_USAGE_MODEL_WIDTH)} ${row.tokens.padStart(MODEL_USAGE_TOKEN_WIDTH)} ${row.cost.padStart(MODEL_USAGE_COST_WIDTH)}`
|
|
725
828
|
}
|
|
726
829
|
|
|
830
|
+
/** Wrap on grapheme boundaries, measuring terminal cells rather than code units.
|
|
831
|
+
* (Body moved verbatim from the removed quota module's `quotaTextLines`.) */
|
|
832
|
+
function wrapTextLines(text: string, width: number, indent: number): string[] {
|
|
833
|
+
const max = Number.isFinite(width) ? Math.max(0, Math.floor(width)) : 0
|
|
834
|
+
if (max < 1) return []
|
|
835
|
+
const padding = ' '.repeat(Math.min(Math.max(0, indent), Math.max(0, max - 2)))
|
|
836
|
+
const lines: string[] = []
|
|
837
|
+
let line = padding
|
|
838
|
+
const segmenter = new Intl.Segmenter()
|
|
839
|
+
for (const word of text.trim().split(/\s+/)) {
|
|
840
|
+
if (!word) continue
|
|
841
|
+
if (line.trim() && cellWidth(line) + 1 + cellWidth(word) > max) {
|
|
842
|
+
lines.push(line.trimEnd())
|
|
843
|
+
line = padding
|
|
844
|
+
}
|
|
845
|
+
if (line.trim()) line += ' '
|
|
846
|
+
for (const { segment } of segmenter.segment(word)) {
|
|
847
|
+
const glyphWidth = cellWidth(segment)
|
|
848
|
+
if (glyphWidth > max) continue
|
|
849
|
+
if (cellWidth(line) + glyphWidth > max) {
|
|
850
|
+
if (line.trim()) lines.push(line.trimEnd())
|
|
851
|
+
line = glyphWidth + cellWidth(padding) <= max ? padding : ''
|
|
852
|
+
}
|
|
853
|
+
line += segment
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
if (line.trim()) lines.push(line.trimEnd())
|
|
857
|
+
return lines
|
|
858
|
+
}
|
|
859
|
+
|
|
727
860
|
/** Wrap sidebar text by terminal cells, preserving the complete values. */
|
|
728
861
|
export function sidebarTextLines(value: string): string[] {
|
|
729
|
-
return
|
|
862
|
+
return wrapTextLines(value, SIDEBAR_CONTENT_WIDTH, 0)
|
|
730
863
|
}
|
|
731
864
|
|
|
732
865
|
/** Align a monetary value when it fits, otherwise preserve it on a new line. */
|
|
@@ -3792,7 +3925,6 @@ function BlockHeader(props: {
|
|
|
3792
3925
|
interface SidebarProps {
|
|
3793
3926
|
context: Context
|
|
3794
3927
|
sessionID?: string
|
|
3795
|
-
quotaRuntime: QuotaRuntime
|
|
3796
3928
|
}
|
|
3797
3929
|
|
|
3798
3930
|
function Sidebar(props: SidebarProps): JSX.Element {
|
|
@@ -4034,8 +4166,6 @@ function Sidebar(props: SidebarProps): JSX.Element {
|
|
|
4034
4166
|
</Show>
|
|
4035
4167
|
</box>
|
|
4036
4168
|
</Show>
|
|
4037
|
-
{/* Keep quota inside this composition: host slots order claims, not our blocks. */}
|
|
4038
|
-
<QuotaSidebarSummary context={context} runtime={props.quotaRuntime} />
|
|
4039
4169
|
</box>
|
|
4040
4170
|
)
|
|
4041
4171
|
}
|
|
@@ -4310,13 +4440,11 @@ const plugin = Plugin.define({
|
|
|
4310
4440
|
// Eager load/sync at setup so the cache is warm before the slot's first
|
|
4311
4441
|
// render (Known Issue: empty sidebar before the first prompt).
|
|
4312
4442
|
warmUpSidebarData(context, location)
|
|
4313
|
-
const quotaRuntime = createQuotaRuntime(context)
|
|
4314
|
-
const unregisterQuotaTui = registerQuotaTui(context, quotaRuntime)
|
|
4315
4443
|
|
|
4316
4444
|
const unregisterSidebar = context.ui.slot({
|
|
4317
4445
|
append: 'sidebar.content',
|
|
4318
4446
|
render: ({ sessionID }: { sessionID: string }) => (
|
|
4319
|
-
<Sidebar context={context} sessionID={sessionID}
|
|
4447
|
+
<Sidebar context={context} sessionID={sessionID} />
|
|
4320
4448
|
),
|
|
4321
4449
|
})
|
|
4322
4450
|
const unregisterHome = context.ui.slot({
|
|
@@ -4354,7 +4482,6 @@ const plugin = Plugin.define({
|
|
|
4354
4482
|
if (typeof unregisterPromptFooter === 'function') unregisterPromptFooter()
|
|
4355
4483
|
if (typeof unregisterPanel === 'function') unregisterPanel()
|
|
4356
4484
|
if (typeof unregisterCommands === 'function') unregisterCommands()
|
|
4357
|
-
unregisterQuotaTui()
|
|
4358
4485
|
delete globalState[SINGLETON]
|
|
4359
4486
|
}
|
|
4360
4487
|
},
|