@workerdeck/ui 0.23.0 → 1.1.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.
Files changed (145) hide show
  1. package/build/{SessionPanel-DUt2VzXG.mjs → SessionPanel-I5QSLLb0.mjs} +2266 -3459
  2. package/build/SessionPanel-I5QSLLb0.mjs.map +1 -0
  3. package/build/SessionPanel-yNO60Tzw.d.mts +151 -0
  4. package/build/format-C_lpFq0l.d.mts +16 -0
  5. package/build/format.d.mts +8 -76
  6. package/build/format.mjs +2 -2
  7. package/build/index.d.mts +291 -1695
  8. package/build/index.mjs +6 -301
  9. package/build/index.mjs.map +1 -1
  10. package/build/scoped.css +32 -23
  11. package/build/{status-BE-zg88x.mjs → status-Dm9INVTt.mjs} +17 -88
  12. package/build/status-Dm9INVTt.mjs.map +1 -0
  13. package/build/workspace.d.mts +8 -187
  14. package/build/workspace.mjs +13 -144
  15. package/build/workspace.mjs.map +1 -1
  16. package/package.json +24 -24
  17. package/src/components/agent/CodeEditor.tsx +31 -103
  18. package/src/components/agent/Composer.tsx +114 -333
  19. package/src/components/agent/ContextDialog.tsx +20 -41
  20. package/src/components/agent/ContextRing.tsx +6 -28
  21. package/src/components/agent/Conversation.tsx +21 -33
  22. package/src/components/agent/EditorTabs.tsx +39 -67
  23. package/src/components/agent/EngineIcon.tsx +29 -72
  24. package/src/components/agent/EntryIcon.tsx +16 -0
  25. package/src/components/agent/FileCard.tsx +10 -16
  26. package/src/components/agent/FileTree.tsx +52 -125
  27. package/src/components/agent/FileViewer.tsx +30 -60
  28. package/src/components/agent/HostFilesDialog.tsx +40 -69
  29. package/src/components/agent/Loader.tsx +3 -24
  30. package/src/components/agent/McpDialog.tsx +64 -137
  31. package/src/components/agent/Message.tsx +2 -21
  32. package/src/components/agent/ModelSelect.tsx +33 -62
  33. package/src/components/agent/PermissionModeSelect.tsx +21 -79
  34. package/src/components/agent/PermissionPrompt.tsx +59 -63
  35. package/src/components/agent/ProjectIcon.tsx +228 -93
  36. package/src/components/agent/PromptTokenText.tsx +10 -16
  37. package/src/components/agent/QuestionPrompt.tsx +43 -64
  38. package/src/components/agent/Reasoning.tsx +13 -16
  39. package/src/components/agent/Response.tsx +3 -9
  40. package/src/components/agent/Scrubber.tsx +31 -80
  41. package/src/components/agent/SessionBrowser.tsx +64 -243
  42. package/src/components/agent/SessionEmptyState.tsx +10 -40
  43. package/src/components/agent/SessionInfoDialog.tsx +46 -78
  44. package/src/components/agent/SessionItem.tsx +53 -320
  45. package/src/components/agent/SessionList.tsx +23 -39
  46. package/src/components/agent/SessionPanel.tsx +315 -996
  47. package/src/components/agent/SessionStatusIcon.tsx +14 -28
  48. package/src/components/agent/SessionSteps.tsx +34 -187
  49. package/src/components/agent/SessionWorkspace.tsx +104 -219
  50. package/src/components/agent/SkillsDialog.tsx +35 -80
  51. package/src/components/agent/StatusBar.tsx +51 -136
  52. package/src/components/agent/SubagentStrip.tsx +12 -77
  53. package/src/components/agent/ToolCallCard.tsx +94 -135
  54. package/src/components/agent/Transcript.tsx +103 -1288
  55. package/src/components/agent/TranscriptItemView.tsx +155 -0
  56. package/src/components/agent/TranscriptRows.tsx +418 -0
  57. package/src/components/agent/UsageDialog.tsx +7 -29
  58. package/src/components/agent/UsageMeters.tsx +18 -73
  59. package/src/components/agent/pulse.tsx +9 -32
  60. package/src/components/agent/scrubber-marks.ts +33 -103
  61. package/src/components/agent/status.ts +1 -5
  62. package/src/components/agent/tool-result-fetch.tsx +3 -25
  63. package/src/components/agent/tool-result-image.tsx +32 -111
  64. package/src/components/agent/transcript-rows.ts +41 -118
  65. package/src/components/agent/transcript-variant.tsx +3 -80
  66. package/src/components/agent/use-height-epoch.ts +10 -24
  67. package/src/components/agent/use-path-links.ts +45 -63
  68. package/src/components/agent/use-subagent-frame.ts +106 -0
  69. package/src/components/agent/use-transcript-jumps.ts +49 -107
  70. package/src/components/prompt-area/animated-placeholder.tsx +6 -5
  71. package/src/components/prompt-area/clipboard-helpers.ts +26 -21
  72. package/src/components/prompt-area/cursor-helpers.ts +79 -37
  73. package/src/components/prompt-area/dom-helpers.ts +97 -69
  74. package/src/components/prompt-area/file-strip.tsx +90 -80
  75. package/src/components/prompt-area/html-to-markdown.ts +67 -46
  76. package/src/components/prompt-area/image-strip.tsx +8 -18
  77. package/src/components/prompt-area/index.ts +2 -15
  78. package/src/components/prompt-area/prompt-area-engine.ts +100 -115
  79. package/src/components/prompt-area/prompt-area-list-ops.ts +66 -59
  80. package/src/components/prompt-area/prompt-area.tsx +31 -38
  81. package/src/components/prompt-area/remove-button.tsx +3 -9
  82. package/src/components/prompt-area/segment-helpers.ts +4 -12
  83. package/src/components/prompt-area/trigger-popover.tsx +15 -27
  84. package/src/components/prompt-area/trigger-presets.ts +0 -10
  85. package/src/components/prompt-area/types.ts +3 -8
  86. package/src/components/prompt-area/use-chip-editing.ts +305 -0
  87. package/src/components/prompt-area/use-markdown-mode.ts +7 -17
  88. package/src/components/prompt-area/use-prompt-area-events.ts +80 -86
  89. package/src/components/prompt-area/use-prompt-area-keydown.ts +598 -0
  90. package/src/components/prompt-area/use-prompt-area-state.ts +5 -23
  91. package/src/components/prompt-area/use-prompt-area.ts +170 -896
  92. package/src/components/prompt-area/use-trigger-search.ts +21 -19
  93. package/src/components/terminal/PermissionPrompt.tsx +56 -59
  94. package/src/components/terminal/QuestionPrompt.tsx +28 -79
  95. package/src/components/terminal/StatusLine.tsx +13 -63
  96. package/src/components/terminal/TerminalTranscript.tsx +44 -160
  97. package/src/components/terminal/affordances.tsx +68 -98
  98. package/src/components/terminal/blocks.ts +20 -156
  99. package/src/components/terminal/diff.tsx +19 -67
  100. package/src/components/terminal/height.ts +163 -313
  101. package/src/components/terminal/image-box.ts +0 -44
  102. package/src/components/terminal/items.tsx +150 -305
  103. package/src/components/terminal/markdown.tsx +36 -95
  104. package/src/components/terminal/press.tsx +26 -53
  105. package/src/components/terminal/prompt.tsx +40 -170
  106. package/src/components/terminal/result-preview.ts +8 -56
  107. package/src/components/terminal/row.tsx +11 -98
  108. package/src/components/terminal/scrubber.tsx +108 -401
  109. package/src/components/terminal/surface.tsx +6 -54
  110. package/src/components/terminal/todos.ts +66 -0
  111. package/src/components/terminal/tool-run.ts +21 -192
  112. package/src/components/ui/AlertDialog.tsx +8 -23
  113. package/src/components/ui/Badge.tsx +18 -29
  114. package/src/components/ui/Button.tsx +7 -15
  115. package/src/components/ui/Card.tsx +2 -13
  116. package/src/components/ui/CodeBlock.tsx +10 -37
  117. package/src/components/ui/CopyButton.tsx +10 -23
  118. package/src/components/ui/Dialog.tsx +23 -36
  119. package/src/components/ui/Empty.tsx +6 -29
  120. package/src/components/ui/Input.tsx +14 -16
  121. package/src/components/ui/Menu.tsx +6 -18
  122. package/src/components/ui/PortalScope.tsx +1 -21
  123. package/src/components/ui/ProgressRing.tsx +8 -19
  124. package/src/components/ui/Select.tsx +18 -31
  125. package/src/components/ui/Sonner.tsx +1 -2
  126. package/src/components/ui/Spinner.tsx +1 -1
  127. package/src/components/ui/Splitter.tsx +30 -64
  128. package/src/components/ui/Textarea.tsx +2 -5
  129. package/src/components/ui/Tooltip.tsx +3 -13
  130. package/src/format.ts +0 -9
  131. package/src/index.ts +16 -113
  132. package/src/lib/clipboard.ts +8 -28
  133. package/src/lib/css.ts +8 -0
  134. package/src/lib/format.ts +101 -86
  135. package/src/lib/plan-request.ts +16 -0
  136. package/src/lib/status.ts +45 -95
  137. package/src/lib/tool-icon.ts +39 -47
  138. package/src/lib/utils.ts +1 -3
  139. package/src/styles/terminal.css +81 -49
  140. package/src/styles/theme.css +96 -32
  141. package/src/workspace.ts +1 -24
  142. package/build/SessionPanel-BobynUo4.d.mts +0 -669
  143. package/build/SessionPanel-DUt2VzXG.mjs.map +0 -1
  144. package/build/format-ljc3lKpA.d.mts +0 -59
  145. package/build/status-BE-zg88x.mjs.map +0 -1
@@ -0,0 +1,151 @@
1
+ import { ReactNode } from "react";
2
+ import { LucideIcon } from "lucide-react";
3
+ import { ModelOption, PermissionMode, SkillInfo } from "@workerdeck/protocol";
4
+ import { ClientToolHandler, ConnectionState, TranscriptState, UseToolCallHostOptions } from "@workerdeck/react";
5
+ import { WorkerDeckClient } from "@workerdeck/client";
6
+ //#region src/components/agent/PermissionModeSelect.d.ts
7
+ type PermissionModeMeta = {
8
+ value: PermissionMode;
9
+ label: string;
10
+ shortLabel: string;
11
+ description: string;
12
+ icon: LucideIcon;
13
+ dangerous?: boolean;
14
+ };
15
+ declare const PERMISSION_MODES: PermissionModeMeta[];
16
+ declare function permissionModeMeta(mode: PermissionMode): PermissionModeMeta | undefined;
17
+ type PermissionModeChoice = {
18
+ value: PermissionMode;
19
+ label: string;
20
+ description: string;
21
+ dangerous?: boolean;
22
+ disabled?: boolean;
23
+ };
24
+ declare function permissionModeChoices(modes?: readonly PermissionMode[], canBypass?: boolean): PermissionModeChoice[];
25
+ interface PermissionModeSelectProps {
26
+ mode?: PermissionMode;
27
+ onModeChange: (mode: PermissionMode) => void;
28
+ modes?: readonly PermissionMode[];
29
+ canBypass?: boolean;
30
+ variant?: 'toolbar' | 'form';
31
+ disabled?: boolean;
32
+ className?: string;
33
+ }
34
+ declare function PermissionModeSelect({ mode, onModeChange, modes, canBypass, variant, disabled, className }: PermissionModeSelectProps): import("react").JSX.Element;
35
+ //#endregion
36
+ //#region src/components/terminal/affordances.d.ts
37
+ type TerminalAffordances = {
38
+ hover?: boolean;
39
+ actions?: boolean;
40
+ };
41
+ declare function useAffordances(): Required<TerminalAffordances>;
42
+ declare function WithActions({ actions, children, className }: {
43
+ actions: ReactNode;
44
+ children: ReactNode;
45
+ className?: string;
46
+ }): import("react").JSX.Element;
47
+ declare function CopyAction({ text, label }: {
48
+ text: string;
49
+ label?: string;
50
+ }): import("react").JSX.Element;
51
+ //#endregion
52
+ //#region src/components/agent/transcript-variant.d.ts
53
+ type TranscriptVariant = 'cards' | 'terminal';
54
+ declare function TranscriptVariantProvider({ value, children }: {
55
+ value: TranscriptVariant;
56
+ children: ReactNode;
57
+ }): import("react").JSX.Element;
58
+ declare function useTranscriptVariant(): TranscriptVariant;
59
+ type TranscriptDensity = 'comfortable' | 'compact';
60
+ declare function TranscriptDensityProvider({ value, children }: {
61
+ value: TranscriptDensity;
62
+ children: ReactNode;
63
+ }): import("react").JSX.Element;
64
+ declare function useTranscriptDensity(): TranscriptDensity;
65
+ type TranscriptFont = 'sans' | 'mono';
66
+ //#endregion
67
+ //#region src/components/agent/SessionPanel.d.ts
68
+ type TerminalMetrics = {
69
+ fontSize?: number;
70
+ lineHeight?: number;
71
+ };
72
+ interface SessionPanelProps {
73
+ client: WorkerDeckClient;
74
+ sessionId: string | undefined;
75
+ header?: ReactNode | ((slots: {
76
+ actions: ReactNode;
77
+ }) => ReactNode);
78
+ panelSurface?: 'internal' | 'external';
79
+ statusSurface?: 'internal' | 'external';
80
+ statusPlacement?: 'top' | 'bottom';
81
+ onOpenPanel?: (panel: SessionSurfacePanel) => void;
82
+ onVitals?: (vitals: SessionVitals) => void;
83
+ transcriptVariant?: TranscriptVariant;
84
+ affordances?: TerminalAffordances | boolean;
85
+ terminalMetrics?: TerminalMetrics;
86
+ scrubber?: boolean;
87
+ /** Bookmarked transcript item ids — the host owns membership and persistence. */
88
+ bookmarks?: readonly string[];
89
+ onToggleBookmark?: (itemId: string) => void;
90
+ reveal?: {
91
+ toolUseId: string;
92
+ nonce: number;
93
+ };
94
+ openSubagent?: {
95
+ toolUseId: string;
96
+ nonce: number;
97
+ };
98
+ onSubagentChange?: (toolUseId: string | undefined) => void;
99
+ stickyPrompt?: boolean;
100
+ transcriptDensity?: TranscriptDensity;
101
+ transcriptFont?: TranscriptFont;
102
+ controlsSurface?: 'internal' | 'external' | 'status';
103
+ onControls?: (controls: SessionControls | undefined) => void;
104
+ focusComposerOnClick?: boolean;
105
+ unseen?: {
106
+ itemCount: number;
107
+ since?: number;
108
+ };
109
+ readOnly?: boolean;
110
+ toolHost?: UseToolCallHostOptions | false;
111
+ cacheTranscript?: boolean;
112
+ emptyState?: ReactNode;
113
+ onLinkClick?: (href: string) => boolean | void;
114
+ clientTools?: Record<string, ClientToolHandler>;
115
+ fontSize?: number;
116
+ className?: string;
117
+ }
118
+ type SessionControls = {
119
+ setModel: (model?: string) => void;
120
+ setPermissionMode: (mode: PermissionMode) => void;
121
+ interrupt: () => void;
122
+ focusComposer: () => void;
123
+ insertComposerText: (text: string) => void;
124
+ };
125
+ type SessionSurfacePanel = 'info' | 'context' | 'usage' | 'mcp' | 'files' | 'skills';
126
+ type SessionVitals = {
127
+ status: TranscriptState['status'];
128
+ connection: ConnectionState;
129
+ engine: TranscriptState['engine'];
130
+ capabilities: TranscriptState['capabilities'];
131
+ model: string | undefined;
132
+ models: ModelOption[];
133
+ permissionMode: TranscriptState['permissionMode'];
134
+ permissionModes: PermissionModeChoice[];
135
+ skills: SkillInfo[] | undefined;
136
+ cwd: TranscriptState['cwd'];
137
+ contextUsage: TranscriptState['contextUsage'];
138
+ rateLimits: TranscriptState['rateLimits'];
139
+ /**
140
+ * When the newest window in `rateLimits` was reported, as event time — not receive time. External chrome (the
141
+ * VS Code status bar, iOS) cannot otherwise tell a live reading from one a days-old session just replayed.
142
+ * Absent means unknown, which is not the same as fresh.
143
+ */
144
+ rateLimitsUpdatedAt: number | undefined;
145
+ itemCount: number;
146
+ totalCostUsd: number;
147
+ };
148
+ declare function SessionPanel({ client, sessionId, header, panelSurface, statusSurface, statusPlacement, onOpenPanel, onVitals, transcriptVariant, transcriptDensity, transcriptFont, affordances, terminalMetrics, scrubber, bookmarks, onToggleBookmark, reveal, openSubagent, onSubagentChange, stickyPrompt, controlsSurface, onControls, focusComposerOnClick, unseen, readOnly, toolHost, clientTools, cacheTranscript, emptyState, onLinkClick, fontSize, className }: SessionPanelProps): import("react").JSX.Element;
149
+ //#endregion
150
+ export { permissionModeChoices as C, PermissionModeSelectProps as S, useAffordances as _, SessionVitals as a, PermissionModeMeta as b, TranscriptDensityProvider as c, TranscriptVariantProvider as d, useTranscriptDensity as f, WithActions as g, TerminalAffordances as h, SessionSurfacePanel as i, TranscriptFont as l, CopyAction as m, SessionPanel as n, TerminalMetrics as o, useTranscriptVariant as p, SessionPanelProps as r, TranscriptDensity as s, SessionControls as t, TranscriptVariant as u, PERMISSION_MODES as v, permissionModeMeta as w, PermissionModeSelect as x, PermissionModeChoice as y };
151
+ //# sourceMappingURL=SessionPanel-yNO60Tzw.d.mts.map
@@ -0,0 +1,16 @@
1
+ //#region src/lib/format.d.ts
2
+ declare function formatCost(usd: number | undefined): string;
3
+ declare function formatDuration(ms: number): string;
4
+ declare function formatTokens(tokens: number): string;
5
+ declare function formatBytes(bytes: number): string;
6
+ declare function formatCountdown(untilEpochMs: number, now?: number): string;
7
+ declare function formatRelativeTime(epochMs: number | undefined, now?: number): string;
8
+ declare function formatRateLimitWindow(key: string): string;
9
+ declare function formatRateLimitWindowLong(key: string): string;
10
+ declare function rateLimitWindowSeconds(key: string): number | undefined;
11
+ declare function formatAgoPrecise(epochMs: number, now?: number): string;
12
+ declare function toolInputPreview(input: unknown, max?: number): string;
13
+ declare function friendlyModel(id: string | undefined): string | undefined;
14
+ //#endregion
15
+ export { formatDuration as a, formatRelativeTime as c, rateLimitWindowSeconds as d, toolInputPreview as f, formatCountdown as i, formatTokens as l, formatBytes as n, formatRateLimitWindow as o, formatCost as r, formatRateLimitWindowLong as s, formatAgoPrecise as t, friendlyModel as u };
16
+ //# sourceMappingURL=format-C_lpFq0l.d.mts.map
@@ -1,22 +1,7 @@
1
- import { a as formatDuration, c as formatRelativeTime, d as rateLimitWindowSeconds, f as toolInputPreview, i as formatCountdown, l as formatTokens, n as formatBytes, o as formatRateLimitWindow, r as formatCost, s as formatRateLimitWindowLong, t as formatAgoPrecise, u as friendlyModel } from "./format-ljc3lKpA.mjs";
1
+ import { a as formatDuration, c as formatRelativeTime, d as rateLimitWindowSeconds, f as toolInputPreview, i as formatCountdown, l as formatTokens, n as formatBytes, o as formatRateLimitWindow, r as formatCost, s as formatRateLimitWindowLong, t as formatAgoPrecise, u as friendlyModel } from "./format-C_lpFq0l.mjs";
2
2
  import { ModelOption, RateLimitInfo, SessionStatus } from "@workerdeck/protocol";
3
-
4
3
  //#region src/lib/status.d.ts
5
- /**
6
- * How a session's live readings become a status line — the pure half, so every
7
- * host spells "Needs approval", "80% is a warning" and "which window is the
8
- * binding one" the same way.
9
- *
10
- * Structurally typed against `SessionVitals` rather than importing it: this file
11
- * ships from the React-free `@workerdeck/ui/format` entry, and a host drawing
12
- * the readings outside React (the VS Code extension host in the window status
13
- * bar) must not pull a component graph in to do it. A real `SessionVitals`
14
- * satisfies every shape here.
15
- */
16
4
  type StatusSeverity = 'none' | 'warning' | 'error';
17
- /** What a status slot shows, before any host's icon vocabulary gets involved.
18
- * `icon` is a VS Code codicon name — the one host-shaped thing left, because the
19
- * alternative is a second mapping table in the only consumer. */
20
5
  type StatusPresentation = {
21
6
  icon: string;
22
7
  label: string;
@@ -24,89 +9,36 @@ type StatusPresentation = {
24
9
  };
25
10
  type StatusReadings = {
26
11
  status: SessionStatus;
27
- /** `@workerdeck/react`'s `ConnectionState`, structurally — the link state wins
28
- * the slot, so it has to be part of the reading. */
29
12
  connection?: 'live' | 'reconnecting' | 'offline';
30
13
  };
31
- /**
32
- * The status slot, connection first. A session status held over a dead socket is
33
- * the last thing we heard, not the current state — so a lost link takes the slot
34
- * rather than letting "Running" imply a turn is still streaming.
35
- */
36
14
  declare function statusPresentation(vitals: StatusReadings | undefined): StatusPresentation;
37
- /** 0–100 → the colour a meter wears. One pair of thresholds for every surface. */
38
15
  declare function meterSeverity(pct: number | undefined): StatusSeverity;
39
- /**
40
- * The three *lanes* a plan-usage reading can occupy, and the whole reason this
41
- * is a rule rather than a per-client `if`.
42
- *
43
- * The CLI reports one window per limit (`five_hour`, `seven_day`, and a
44
- * `seven_day_<model>` bucket per model-scoped limit — `seven_day_opus`,
45
- * `seven_day_sonnet`, and whatever `model_scoped` names next). A surface with
46
- * one slot shows the fullest of them, which is why `tightestWindow` exists —
47
- * but that answers "what is closest to blocking me", not "how much of *this
48
- * session's* budget have I spent", and those are different questions a reader
49
- * asks at different times. A weekly window at 71% will win the single slot over
50
- * a five-hour window at 60% every time, so the reading you actually watch while
51
- * working is the one you can never see.
52
- *
53
- * Hence three lanes, each independently showable:
54
- *
55
- * - `'session'` — the five-hour window. The one that resets while you work.
56
- * - `'weekly'` — the plain seven-day window, the account-wide ceiling.
57
- * - `'model'` — the fullest of the *model-scoped* weekly buckets. Deliberately
58
- * not a named model: which models have their own bucket is the plan's
59
- * business and changes without notice, so a client that hardcoded
60
- * `seven_day_opus` would show nothing the month it becomes something else.
61
- * The label comes from the key, so this lane names whatever it found.
62
- */
63
16
  type UsageLane = 'session' | 'weekly' | 'model';
64
- /** The window a lane points at, or `undefined` when this account has none. */
65
17
  declare function usageWindow(rateLimits: Record<string, RateLimitInfo> | undefined, lane: UsageLane): {
66
18
  key: string;
67
19
  info: RateLimitInfo;
68
20
  } | undefined;
69
- /** The rate-limit window that gets the one visible slot: whichever is fullest,
70
- * since the binding constraint is the one worth glancing at. Still the right
71
- * rule for a surface with exactly one slot; {@link usageWindow} is for one with
72
- * three. */
73
21
  declare function tightestWindow(rateLimits: Record<string, RateLimitInfo> | undefined): {
74
22
  key: string;
75
23
  info: RateLimitInfo;
76
24
  } | undefined;
77
- /** A rate-limit window's key, named for a human. A model-scoped bucket is named
78
- * for its model alone (`seven_day_fable` → "Fable"): the lane it sits in
79
- * already says weekly, and "Seven day fable" in a status bar is three words to
80
- * say one. */
81
25
  declare function windowLabel(key: string): string;
82
26
  type ModelReadings = {
83
27
  model?: string;
84
28
  models: readonly ModelOption[];
85
29
  };
86
- /**
87
- * The catalog row a session is actually running, or `undefined` for a model the
88
- * list doesn't name. Matched leniently: a session reports the *resolved* id
89
- * (`claude-sonnet-5`) where the row may be keyed on the alias (`sonnet`), and
90
- * either can carry a `[1m]` context-window suffix.
91
- */
92
30
  declare function currentModel(vitals: ModelReadings | undefined): ModelOption | undefined;
93
- /** A session's model, named the way the picker names it. Falls back to the raw
94
- * id, and to "Default" while the session is on the CLI's own pick. */
95
31
  declare function modelLabel(vitals: ModelReadings | undefined): string;
96
- /** Context percentage as its meter severity — the reading and the colour come
97
- * from one place so a panel and a status bar never disagree.
98
- *
99
- * Takes only the number it reads, so the compact `ContextReading` that rides
100
- * the sessions list and the full `ContextUsage` on the event stream are coloured
101
- * by one rule rather than two. */
102
32
  declare function contextSeverity(usage: {
103
33
  percentage: number;
104
34
  } | undefined): StatusSeverity;
105
- /** {@link meterSeverity} as a text colour class. Here rather than beside each
106
- * meter because the status bar, the context dialog and a sessions-list row all
107
- * paint the same reading, and a fourth copy of the thresholds is a fourth
108
- * chance for one surface to call 81% orange and another call it grey. */
109
35
  declare function meterColorClass(pct: number | undefined): string;
36
+ /**
37
+ * The fill colour for a meter bar. Deliberately a different ramp from
38
+ * {@link meterColorClass}: a bar reads as alarming later than a number does, so the tint
39
+ * turns at 70/90 where the text severity turns at 80/95.
40
+ */
41
+ declare function meterTintClass(pct: number): string;
110
42
  //#endregion
111
- export { ModelReadings, StatusPresentation, StatusReadings, StatusSeverity, UsageLane, contextSeverity, currentModel, formatAgoPrecise, formatBytes, formatCost, formatCountdown, formatDuration, formatRateLimitWindow, formatRateLimitWindowLong, formatRelativeTime, formatTokens, friendlyModel, meterColorClass, meterSeverity, modelLabel, rateLimitWindowSeconds, statusPresentation, tightestWindow, toolInputPreview, usageWindow, windowLabel };
43
+ export { ModelReadings, StatusPresentation, StatusReadings, StatusSeverity, UsageLane, contextSeverity, currentModel, formatAgoPrecise, formatBytes, formatCost, formatCountdown, formatDuration, formatRateLimitWindow, formatRateLimitWindowLong, formatRelativeTime, formatTokens, friendlyModel, meterColorClass, meterSeverity, meterTintClass, modelLabel, rateLimitWindowSeconds, statusPresentation, tightestWindow, toolInputPreview, usageWindow, windowLabel };
112
44
  //# sourceMappingURL=format.d.mts.map
package/build/format.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as formatRelativeTime, a as modelLabel, b as rateLimitWindowSeconds, c as usageWindow, d as formatBytes, f as formatCost, g as formatRateLimitWindowLong, h as formatRateLimitWindow, i as meterSeverity, l as windowLabel, m as formatDuration, n as currentModel, o as statusPresentation, p as formatCountdown, r as meterColorClass, s as tightestWindow, t as contextSeverity, u as formatAgoPrecise, v as formatTokens, x as toolInputPreview, y as friendlyModel } from "./status-BE-zg88x.mjs";
2
- export { contextSeverity, currentModel, formatAgoPrecise, formatBytes, formatCost, formatCountdown, formatDuration, formatRateLimitWindow, formatRateLimitWindowLong, formatRelativeTime, formatTokens, friendlyModel, meterColorClass, meterSeverity, modelLabel, rateLimitWindowSeconds, statusPresentation, tightestWindow, toolInputPreview, usageWindow, windowLabel };
1
+ import { S as toolInputPreview, _ as formatRateLimitWindowLong, a as meterTintClass, b as friendlyModel, c as tightestWindow, d as formatAgoPrecise, f as formatBytes, g as formatRateLimitWindow, h as formatDuration, i as meterSeverity, l as usageWindow, m as formatCountdown, n as currentModel, o as modelLabel, p as formatCost, r as meterColorClass, s as statusPresentation, t as contextSeverity, u as windowLabel, v as formatRelativeTime, x as rateLimitWindowSeconds, y as formatTokens } from "./status-Dm9INVTt.mjs";
2
+ export { contextSeverity, currentModel, formatAgoPrecise, formatBytes, formatCost, formatCountdown, formatDuration, formatRateLimitWindow, formatRateLimitWindowLong, formatRelativeTime, formatTokens, friendlyModel, meterColorClass, meterSeverity, meterTintClass, modelLabel, rateLimitWindowSeconds, statusPresentation, tightestWindow, toolInputPreview, usageWindow, windowLabel };