opencode-usage-insights 0.1.3 → 0.3.0

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/dist/tui.d.ts CHANGED
@@ -8,19 +8,24 @@ import { type PanelView, type RangeKey } from "./panel-data";
8
8
  * - `session.composer.top`: one telemetry line after every turn with the end
9
9
  * time, the delta since the previous prompt, the provider and model that ran
10
10
  * it, turn and session token totals, and cache warnings.
11
- * - `session.panel` + the `/stats` slash command: the statistics panel over
12
- * the database written by the server entry.
11
+ * - `session.panel` + the `/usage-insights` slash command: the statistics
12
+ * panel over the database written by the server entry. Its `go` view reads
13
+ * the host's live OpenCode Go allowance; the sidebar carries the compact
14
+ * forecast.
13
15
  *
14
- * The line is computed from the host's transcript alone; the database is opened
15
- * lazily for the panel and the sidebar, read-only in spirit: the TUI never
16
- * writes usage. When the database cannot be opened, the line still works and
17
- * the panel explains itself.
16
+ * The line is computed from the host's transcript alone; the panel, the
17
+ * sidebar history and the stored list estimate come from the server's usage
18
+ * RPC. The TUI never opens SQLite, so it works the same against a local or a
19
+ * remote server. When the RPC is unavailable, the line still works and the
20
+ * panel explains itself.
18
21
  */
19
22
  export type Options = {
20
23
  /** Turn the TUI side off: no line and no panel. */
21
24
  enabled?: boolean | undefined;
22
- /** SQLite database path override; must match the server entry. */
25
+ /** Server-side database path override; the TUI reads it through the RPC. */
23
26
  db?: string | undefined;
27
+ /** Allow the panel's prune, wipe, vacuum and backfill actions. Defaults to true. */
28
+ maintenance?: boolean | undefined;
24
29
  /**
25
30
  * List-price estimates for steps the host reports as costing nothing.
26
31
  * `off` hides them on the line, in the panel and in the sidebar, and
@@ -38,11 +43,18 @@ export type Options = {
38
43
  labels?: Partial<LineLabels> | undefined;
39
44
  /** Show the per-prompt history in the session sidebar (default true). */
40
45
  sidebar?: boolean | undefined;
41
- /** How many turns the sidebar history shows (default 8). */
46
+ /** How many turns the sidebar history shows (default 8, clamped to 1–50). */
42
47
  sidebarTurns?: number | undefined;
43
48
  /**
44
- * Show the `/usage` statistics panel and its command (default true).
45
- * `false` keeps the live line and the sidebar history.
49
+ * Read the host's OpenCode Go allowance and show the `go` view and the
50
+ * sidebar forecast. `off` makes no usage-limits request at all.
51
+ */
52
+ quota?: "auto" | "off" | undefined;
53
+ /** Full subscription label; defaults to the host provider name or OpenCode Go. */
54
+ quotaName?: string | undefined;
55
+ /**
56
+ * Show the `/usage-insights` statistics panel and its command (default
57
+ * true). `false` keeps the live line and the sidebar history.
46
58
  */
47
59
  panel?: boolean | undefined;
48
60
  };