(host: SlashCommandHost)
| 119 | } |
| 120 | |
| 121 | export async function showUsage(host: SlashCommandHost): Promise<void> { |
| 122 | const sessionUsage = await loadSessionUsageReport(host); |
| 123 | const managedUsage = await loadManagedUsageReport(host); |
| 124 | const reportArgs = { |
| 125 | sessionUsage: sessionUsage.usage, |
| 126 | sessionUsageError: sessionUsage.error, |
| 127 | contextUsage: host.state.appState.contextUsage, |
| 128 | contextTokens: host.state.appState.contextTokens, |
| 129 | maxContextTokens: host.state.appState.maxContextTokens, |
| 130 | managedUsage: managedUsage?.usage, |
| 131 | managedUsageError: managedUsage?.error, |
| 132 | }; |
| 133 | const panel = new UsagePanelComponent(() => buildUsageReportLines(reportArgs), 'primary'); |
| 134 | host.state.transcriptContainer.addChild(panel); |
| 135 | host.state.ui.requestRender(); |
| 136 | } |
| 137 | |
| 138 | export async function showStatusReport(host: SlashCommandHost): Promise<void> { |
| 139 | const [runtimeStatus, managedUsage] = await Promise.all([ |
no test coverage detected