@workerdeck/ui 2.9.0 → 2.11.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 (46) hide show
  1. package/build/index.d.mts +54 -7
  2. package/build/index.mjs +34 -16
  3. package/build/index.mjs.map +1 -1
  4. package/build/scoped.css +76 -1
  5. package/build/{SessionPanel-BClL7zUS.mjs → use-path-links-DO_79-wX.mjs} +834 -303
  6. package/build/use-path-links-DO_79-wX.mjs.map +1 -0
  7. package/build/workspace.mjs +3 -83
  8. package/build/workspace.mjs.map +1 -1
  9. package/package.json +4 -4
  10. package/src/components/agent/Composer.tsx +7 -4
  11. package/src/components/agent/PromptTokenText.tsx +11 -3
  12. package/src/components/agent/SessionInfoDialog.tsx +1 -1
  13. package/src/components/agent/SessionItem.tsx +13 -8
  14. package/src/components/agent/SessionList.tsx +1 -1
  15. package/src/components/agent/SessionPanel.tsx +6 -1
  16. package/src/components/agent/StatusBar.tsx +1 -1
  17. package/src/components/agent/Transcript.tsx +83 -79
  18. package/src/components/agent/TranscriptItemView.tsx +3 -1
  19. package/src/components/agent/TranscriptRows.tsx +60 -56
  20. package/src/components/agent/UsageDialog.tsx +101 -7
  21. package/src/components/agent/composer-commands.ts +14 -2
  22. package/src/components/agent/pulse.tsx +53 -16
  23. package/src/components/agent/use-path-links.ts +5 -19
  24. package/src/components/agent/use-transcript-jumps.ts +25 -0
  25. package/src/components/prompt-area/clipboard-helpers.ts +13 -4
  26. package/src/components/prompt-area/dom-helpers.ts +10 -1
  27. package/src/components/prompt-area/index.ts +10 -1
  28. package/src/components/prompt-area/prompt-area-engine.ts +23 -14
  29. package/src/components/prompt-area/types.ts +20 -0
  30. package/src/components/prompt-area/use-prompt-area-keydown.ts +2 -1
  31. package/src/components/prompt-area/use-prompt-area.ts +8 -2
  32. package/src/components/terminal/StatusLine.tsx +3 -2
  33. package/src/components/terminal/TerminalTranscript.tsx +31 -27
  34. package/src/components/terminal/blocks.ts +15 -7
  35. package/src/components/terminal/height.ts +14 -5
  36. package/src/components/terminal/items.tsx +99 -12
  37. package/src/components/terminal/peer-names.tsx +16 -0
  38. package/src/components/terminal/row.tsx +1 -1
  39. package/src/components/terminal/tool-run.ts +68 -0
  40. package/src/index.ts +3 -1
  41. package/src/lib/path-match.ts +51 -0
  42. package/src/lib/session-cost.ts +75 -0
  43. package/src/lib/tool-icon.ts +5 -1
  44. package/src/styles/terminal.css +93 -0
  45. package/src/styles/theme.css +1 -1
  46. package/build/SessionPanel-BClL7zUS.mjs.map +0 -1
package/build/index.d.mts CHANGED
@@ -10,7 +10,7 @@ import { Menu as Menu$1 } from "@base-ui/react/menu";
10
10
  import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
11
11
  import { Tooltip } from "@base-ui/react/tooltip";
12
12
  import { toast } from "sonner";
13
- import { ContextReading, ContextUsage, FilePatch, ModelOption, PermissionRequest, ProfileEngine, ProjectIcon as ProjectIcon$1, QuestionBehavior, RateLimitInfo, SessionInfo, SessionRow, SessionStatus, SessionTask, SkillInfo, SlashCommandInfo, UsageWindowRow, ViewConfig, WorkspaceScope, parseUserQuestions } from "@workerdeck/protocol";
13
+ import { ByModel, ContextReading, ContextUsage, FilePatch, ModelOption, PermissionRequest, PricingTable, ProfileEngine, ProfileSpend, ProjectIcon as ProjectIcon$1, QuestionBehavior, RateLimitInfo, SessionInfo, SessionRow, SessionStatus, SessionTask, SkillInfo, SlashCommandInfo, UsageWindowRow, ViewConfig, WorkspaceScope, parseUserQuestions } from "@workerdeck/protocol";
14
14
  import { ConnectionState, TranscriptItem, TranscriptState, UseAttachmentsResult } from "@workerdeck/react";
15
15
  import { WorkerDeckClient } from "@workerdeck/client";
16
16
  //#region src/components/ui/Button.d.ts
@@ -182,6 +182,12 @@ type ChipSegment = {
182
182
  value: string;
183
183
  /** The display text shown in the chip */
184
184
  displayText: string;
185
+ /**
186
+ * The character the chip serialises and renders with, when it differs from
187
+ * `trigger`. The trigger is the menu the chip came from; the sigil is the
188
+ * token the host parses. Unset, the trigger character is the sigil.
189
+ */
190
+ sigil?: string;
185
191
  /** Optional data payload attached to the chip */
186
192
  data?: unknown;
187
193
  /**
@@ -227,6 +233,10 @@ type TriggerSuggestion = {
227
233
  /** Optional arbitrary data passed through on selection */
228
234
  data?: unknown;
229
235
  };
236
+ type ChipOptions = {
237
+ sigil?: string;
238
+ trailingText?: string;
239
+ };
230
240
  /**
231
241
  * Configuration for a trigger character.
232
242
  */
@@ -268,6 +278,15 @@ type TriggerConfig = {
268
278
  * `onChipAdd` does not fire either.
269
279
  */
270
280
  insertAsText?: (suggestion: TriggerSuggestion) => string | undefined;
281
+ /**
282
+ * For 'dropdown' mode: per-suggestion overrides for the chip a selection
283
+ * resolves to. `sigil` replaces the trigger character in the chip's text and
284
+ * serialisation (a `/` menu inserting a `$name` token); `trailingText` is
285
+ * the editable text placed after the chip in place of the default single
286
+ * space (it is inserted verbatim, so include the leading space). Return
287
+ * undefined for the plain chip.
288
+ */
289
+ chipOptions?: (suggestion: TriggerSuggestion) => ChipOptions | undefined;
271
290
  /**
272
291
  * For 'callback' and 'launch' modes: called when the trigger is activated.
273
292
  * Receives the full input text and cursor position. For 'launch' it fires on
@@ -639,7 +658,7 @@ declare function launchTrigger(opts: LaunchTriggerOptions): TriggerConfig;
639
658
  //#region src/components/prompt-area/prompt-area-engine.d.ts
640
659
  /**
641
660
  * Converts an array of segments to a plain text string.
642
- * Chips are represented as `{trigger}{displayText}` (e.g., "@Alice").
661
+ * Chips are represented by {@link chipPlainText}.
643
662
  */
644
663
  declare function segmentsToPlainText(segments: Segment[]): string;
645
664
  /**
@@ -763,7 +782,7 @@ interface TerminalMarkdownProps {
763
782
  declare const TerminalMarkdown: import("react").MemoExoticComponent<({ children, streaming, className }: TerminalMarkdownProps) => import("react").JSX.Element>;
764
783
  //#endregion
765
784
  //#region src/components/terminal/row.d.ts
766
- type Tone = 'fg' | 'bright' | 'dim' | 'faint' | 'mark' | 'blue' | 'green' | 'red' | 'yellow' | 'magenta';
785
+ type Tone = 'fg' | 'bright' | 'dim' | 'faint' | 'mark' | 'blue' | 'green' | 'red' | 'yellow' | 'magenta' | 'peer';
767
786
  interface RowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
768
787
  glyph?: ReactNode;
769
788
  glyphTone?: Tone;
@@ -788,6 +807,25 @@ type FileLink = {
788
807
  };
789
808
  declare function parseFileLink(href: string | undefined, cwd: string | undefined): FileLink | undefined;
790
809
  //#endregion
810
+ //#region src/lib/path-match.d.ts
811
+ type PathHit = {
812
+ path: string;
813
+ line?: number;
814
+ };
815
+ type PathMatch = PathHit & {
816
+ length: number;
817
+ };
818
+ declare function matchPath(text: string | null | undefined, inCode?: boolean): PathMatch | undefined;
819
+ //#endregion
820
+ //#region src/components/agent/use-path-links.d.ts
821
+ declare function usePathLinks({ container, onOpen, enabled, ignore }: {
822
+ container: RefObject<HTMLElement | null>;
823
+ onOpen: (hit: PathHit) => void;
824
+ enabled?: boolean;
825
+ ignore?: string;
826
+ }): void;
827
+ declare function resolveAgainstCwd(path: string, cwd: string | undefined): string;
828
+ //#endregion
791
829
  //#region src/components/agent/Conversation.d.ts
792
830
  interface ConversationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
793
831
  children: ReactNode;
@@ -967,13 +1005,17 @@ interface UsageDialogProps {
967
1005
  rateLimits: UsageWindowRow[];
968
1006
  subscriptionType?: string;
969
1007
  engine: ProfileEngine;
970
- totalCostUsd: number;
1008
+ totalCostUsd?: number;
1009
+ costUsd?: number;
1010
+ usageByModel?: ByModel;
1011
+ pricing?: PricingTable;
1012
+ spend?: ProfileSpend;
971
1013
  updatedAt?: number;
972
1014
  open: boolean;
973
1015
  onOpenChange: (open: boolean) => void;
974
1016
  className?: string;
975
1017
  }
976
- declare function UsageDialog({ rateLimits, subscriptionType, engine, totalCostUsd, updatedAt, open, onOpenChange, className }: UsageDialogProps): import("react").JSX.Element;
1018
+ declare function UsageDialog({ rateLimits, subscriptionType, engine, totalCostUsd, costUsd, usageByModel, pricing, spend, updatedAt, open, onOpenChange, className }: UsageDialogProps): import("react").JSX.Element;
977
1019
  //#endregion
978
1020
  //#region src/components/agent/TaskList.d.ts
979
1021
  interface TaskListProps {
@@ -1092,6 +1134,11 @@ declare function rowShapeClass(active: boolean): string;
1092
1134
  declare function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeSubagentId, onSelect, onDelete, onRename, onClearContext, onSelectSubagent, emptyState, showControls, projectIcons, className }: SessionBrowserProps): import("react").JSX.Element;
1093
1135
  //#endregion
1094
1136
  //#region src/components/agent/SessionItem.d.ts
1137
+ type SelectModifiers = {
1138
+ meta: boolean;
1139
+ ctrl: boolean;
1140
+ alt: boolean;
1141
+ };
1095
1142
  interface SessionItemProps {
1096
1143
  row: SessionRow;
1097
1144
  active?: boolean;
@@ -1101,7 +1148,7 @@ interface SessionItemProps {
1101
1148
  projectIcons?: Record<string, string>;
1102
1149
  expanded?: boolean;
1103
1150
  onExpandedChange?: (expanded: boolean) => void;
1104
- onSelect?: () => void;
1151
+ onSelect?: (modifiers: SelectModifiers) => void;
1105
1152
  onSelectSubagent?: (toolUseId: string) => void;
1106
1153
  onRename?: (title: string) => void;
1107
1154
  renameOn?: 'doubleClick' | 'external';
@@ -1207,5 +1254,5 @@ declare function copyText(value: string): Promise<boolean>;
1207
1254
  declare function toolIcon(toolName: string): LucideIcon;
1208
1255
  declare function isMutatingTool(toolName: string): boolean;
1209
1256
  //#endregion
1210
- export { AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger, type ApprovalPromptProps, Badge, type BadgeProps, Band, Blank, Button, type ButtonProps, Card, CardContent, CardHeader, CardTitle, type ChipSegment, type ClientCommand, CodeBlock, type CodeBlockProps, Composer, type ComposerFileMatch, type ComposerHandle, type ComposerProps, type ComposerRow, ContextDialog, type ContextDialogProps, ContextRing, Conversation, ConversationContent, type ConversationProps, ConversationScrollButton, CopyAction, CopyButton, type CopyButtonProps, Dialog, DialogBody, DialogClose, DialogContent, DialogHeader, DialogRow, DialogTrigger, Empty, EmptyKey, EngineIcon, FileCard, type FileCardProps, type FileDeliveredItem, type FileLink, type FileLinkHandle, type FileLinkOpener, FileLinkProvider, HostFilesDialog, type HostFilesDialogProps, Ink, Input, Loader, McpDialog, type McpDialogProps, Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger, Message, MessageContent, type MessageProps, ModelSelect, type ModelSelectProps, PERMISSION_MODES, type PermissionModeChoice, type PermissionModeMeta, PermissionModeSelect, type PermissionModeSelectProps, PermissionPrompt, type PermissionPromptProps, ProgressRing, type ProgressRingProps, ProjectIcon, PromptArea, type PromptAreaHandle, type PromptAreaProps, PromptTokenText, QUESTION_BEHAVIORS, type QuestionBehaviorMeta, QuestionPrompt, type QuestionPromptProps, Reasoning, type ReasoningProps, Response, type ResponseProps, Row, type RowProps, STATUS_META, type Segment, Select, SelectContent, SelectItem, SelectItemText, SelectTrigger, SelectValue, SessionBrowser, type SessionBrowserProps, type SessionControls, SessionEmptyState, type SessionEmptyStateProps, SessionInfoDialog, type SessionInfoDialogProps, SessionItem, type SessionItemProps, SessionList, SessionListItem, type SessionListItemProps, type SessionListProps, SessionPanel, type SessionPanelProps, SessionStatusIcon, type SessionSurfacePanel, type SessionVitals, SkillsDialog, type SkillsDialogProps, Spinner, Splitter, type SplitterProps, StatusBar, type StatusBarProps, type Step, StepRow, StepToggle, SubagentStrip, TaskList, type TaskListProps, TasksDialog, type TasksDialogProps, type TerminalAffordances, TerminalDiff, TerminalItemView, TerminalMarkdown, type TerminalMarkdownProps, type TerminalMetrics, TerminalPermissionPrompt, type TerminalPermissionPromptProps, TerminalQuestionPrompt, type TerminalQuestionPromptProps, TerminalStatusLine, type TerminalStatusLineProps, TerminalSurface, type TerminalSurfaceProps, TerminalTranscript, type TerminalTranscriptProps, type TextSegment, Textarea, Tip, Toaster, type Tone, ToolCallCard, type ToolCallCardProps, type ToolCallItem, ToolTitleProvider, TooltipContent, TooltipProvider, Transcript, type TranscriptDensity, TranscriptDensityProvider, type TranscriptFont, type TranscriptProps, type TranscriptVariant, TranscriptVariantProvider, type TriggerConfig, type TriggerSuggestion, UsageDialog, type UsageDialogProps, UsageMeters, WithActions, badgeVariants, buttonVariants, cn, commandTrigger, copyText, engineMark, formatAgoPrecise, formatBytes, formatCost, formatCountdown, formatDuration, formatRateLimitWindow, formatRateLimitWindowLong, formatRelativeTime, formatTokens, friendlyModel, getChipsByTrigger, hashtagTrigger, isMutatingTool, isSegmentsEmpty, launchTrigger, matchClientCommand, mentionTrigger, mergeComposerRows, parseFileLink, parseUserQuestions, permissionModeChoices, permissionModeMeta, plainTextToSegments, previewPatch, rankComposerRows, rateLimitWindowSeconds, rowShapeClass, runningSteps, segmentsToPlainText, sessionSteps, skillPrompt, toast, toolIcon, toolInputPreview, useAffordances, useFileLinks, useMinuteClock, usePromptAreaState, useToolTitle, useTranscriptDensity, useTranscriptVariant, vendorMarkClass, vendorTextClass };
1257
+ export { AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger, type ApprovalPromptProps, Badge, type BadgeProps, Band, Blank, Button, type ButtonProps, Card, CardContent, CardHeader, CardTitle, type ChipSegment, type ClientCommand, CodeBlock, type CodeBlockProps, Composer, type ComposerFileMatch, type ComposerHandle, type ComposerProps, type ComposerRow, ContextDialog, type ContextDialogProps, ContextRing, Conversation, ConversationContent, type ConversationProps, ConversationScrollButton, CopyAction, CopyButton, type CopyButtonProps, Dialog, DialogBody, DialogClose, DialogContent, DialogHeader, DialogRow, DialogTrigger, Empty, EmptyKey, EngineIcon, FileCard, type FileCardProps, type FileDeliveredItem, type FileLink, type FileLinkHandle, type FileLinkOpener, FileLinkProvider, HostFilesDialog, type HostFilesDialogProps, Ink, Input, Loader, McpDialog, type McpDialogProps, Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger, Message, MessageContent, type MessageProps, ModelSelect, type ModelSelectProps, PERMISSION_MODES, type PathHit, type PathMatch, type PermissionModeChoice, type PermissionModeMeta, PermissionModeSelect, type PermissionModeSelectProps, PermissionPrompt, type PermissionPromptProps, ProgressRing, type ProgressRingProps, ProjectIcon, PromptArea, type PromptAreaHandle, type PromptAreaProps, PromptTokenText, QUESTION_BEHAVIORS, type QuestionBehaviorMeta, QuestionPrompt, type QuestionPromptProps, Reasoning, type ReasoningProps, Response, type ResponseProps, Row, type RowProps, STATUS_META, type Segment, Select, SelectContent, SelectItem, SelectItemText, type SelectModifiers, SelectTrigger, SelectValue, SessionBrowser, type SessionBrowserProps, type SessionControls, SessionEmptyState, type SessionEmptyStateProps, SessionInfoDialog, type SessionInfoDialogProps, SessionItem, type SessionItemProps, SessionList, SessionListItem, type SessionListItemProps, type SessionListProps, SessionPanel, type SessionPanelProps, SessionStatusIcon, type SessionSurfacePanel, type SessionVitals, SkillsDialog, type SkillsDialogProps, Spinner, Splitter, type SplitterProps, StatusBar, type StatusBarProps, type Step, StepRow, StepToggle, SubagentStrip, TaskList, type TaskListProps, TasksDialog, type TasksDialogProps, type TerminalAffordances, TerminalDiff, TerminalItemView, TerminalMarkdown, type TerminalMarkdownProps, type TerminalMetrics, TerminalPermissionPrompt, type TerminalPermissionPromptProps, TerminalQuestionPrompt, type TerminalQuestionPromptProps, TerminalStatusLine, type TerminalStatusLineProps, TerminalSurface, type TerminalSurfaceProps, TerminalTranscript, type TerminalTranscriptProps, type TextSegment, Textarea, Tip, Toaster, type Tone, ToolCallCard, type ToolCallCardProps, type ToolCallItem, ToolTitleProvider, TooltipContent, TooltipProvider, Transcript, type TranscriptDensity, TranscriptDensityProvider, type TranscriptFont, type TranscriptProps, type TranscriptVariant, TranscriptVariantProvider, type TriggerConfig, type TriggerSuggestion, UsageDialog, type UsageDialogProps, UsageMeters, WithActions, badgeVariants, buttonVariants, cn, commandTrigger, copyText, engineMark, formatAgoPrecise, formatBytes, formatCost, formatCountdown, formatDuration, formatRateLimitWindow, formatRateLimitWindowLong, formatRelativeTime, formatTokens, friendlyModel, getChipsByTrigger, hashtagTrigger, isMutatingTool, isSegmentsEmpty, launchTrigger, matchClientCommand, matchPath, mentionTrigger, mergeComposerRows, parseFileLink, parseUserQuestions, permissionModeChoices, permissionModeMeta, plainTextToSegments, previewPatch, rankComposerRows, rateLimitWindowSeconds, resolveAgainstCwd, rowShapeClass, runningSteps, segmentsToPlainText, sessionSteps, skillPrompt, toast, toolIcon, toolInputPreview, useAffordances, useFileLinks, useMinuteClock, usePathLinks, usePromptAreaState, useToolTitle, useTranscriptDensity, useTranscriptVariant, vendorMarkClass, vendorTextClass };
1211
1258
  //# sourceMappingURL=index.d.mts.map
package/build/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { $ as Band, $t as Input, A as PERMISSION_MODES, At as Tip, B as TaskList, Bt as Menu, C as TerminalPermissionPrompt, Ct as segmentsToPlainText, D as SubagentStrip, Dt as Spinner, E as parseUserQuestions, Et as CodeBlock, F as SkillsDialog, Ft as DialogClose, G as ToolTitleProvider, Gt as Select, H as contextNote, Ht as MenuItem, I as McpDialog, It as DialogContent, J as FileLinkProvider, Jt as SelectItemText, K as useToolTitle, Kt as SelectContent, L as HostFilesDialog, Lt as DialogHeader, M as permissionModeChoices, Mt as TooltipProvider, N as permissionModeMeta, Nt as Dialog, O as PermissionPrompt, Ot as CopyButton, P as ModelSelect, Pt as DialogBody, Q as previewPatch, Qt as Textarea, Rt as DialogRow, S as TerminalQuestionPrompt, St as plainTextToSegments, T as QuestionPrompt, Tt as Splitter, U as Composer, Ut as MenuSeparator, V as ContextDialog, Vt as MenuContent, W as TerminalSurface, Wt as MenuTrigger, X as parseFileLink, Xt as SelectValue, Y as useFileLinks, Yt as SelectTrigger, Z as TerminalDiff, Zt as PortalScope, _ as ConversationContent, _t as hashtagTrigger, a as Transcript, at as useAffordances, b as STATUS_META, bt as usePromptAreaState, c as PromptTokenText, ct as TranscriptDensityProvider, d as FileCard, dt as useTranscriptVariant, en as Badge, et as Blank, f as TerminalItemView, ft as matchClientCommand, g as Conversation, gt as commandTrigger, h as Loader, ht as skillPrompt, i as useMinuteClock, in as cn, it as WithActions, j as PermissionModeSelect, jt as TooltipContent, k as Response, kt as copyText, l as Message, lt as TranscriptVariantProvider, m as SessionEmptyState, mt as rankComposerRows, n as UsageDialog, nn as Button, nt as Row, o as ToolCallCard, ot as isMutatingTool, p as TerminalTranscript, pt as mergeComposerRows, q as TerminalMarkdown, qt as SelectItem, r as UsageMeters, rn as buttonVariants, rt as CopyAction, s as Reasoning, st as toolIcon, t as SessionPanel, tn as badgeVariants, tt as Ink, u as MessageContent, ut as useTranscriptDensity, v as ConversationScrollButton, vt as launchTrigger, w as QUESTION_BEHAVIORS, wt as ProgressRing, x as SessionInfoDialog, xt as PromptArea, y as StatusBar, yt as mentionTrigger, z as TasksDialog, zt as DialogTrigger } from "./SessionPanel-BClL7zUS.mjs";
1
+ import { $ as TerminalDiff, $t as SelectValue, A as PermissionPrompt, At as Spinner, Bt as DialogHeader, C as SessionInfoDialog, Ct as usePromptAreaState, D as QuestionPrompt, Dt as ProgressRing, E as QUESTION_BEHAVIORS, Et as segmentsToPlainText, F as permissionModeMeta, Ft as TooltipProvider, G as Composer, Gt as MenuItem, H as TaskList, Ht as DialogTrigger, I as ModelSelect, It as Dialog, J as useToolTitle, Jt as Select, K as TerminalSurface, Kt as MenuSeparator, L as SkillsDialog, Lt as DialogBody, M as PERMISSION_MODES, Mt as copyText, N as PermissionModeSelect, Nt as Tip, O as parseUserQuestions, Ot as Splitter, P as permissionModeChoices, Pt as TooltipContent, Q as parseFileLink, Qt as SelectTrigger, R as McpDialog, Rt as DialogClose, S as STATUS_META, St as mentionTrigger, T as TerminalPermissionPrompt, Tt as plainTextToSegments, U as ContextDialog, Ut as Menu, V as TasksDialog, Vt as DialogRow, W as contextNote, Wt as MenuContent, X as FileLinkProvider, Xt as SelectItem, Y as TerminalMarkdown, Yt as SelectContent, Z as useFileLinks, Zt as SelectItemText, _ as Loader, _t as rankComposerRows, a as UsageDialog, an as Button, at as CopyAction, b as ConversationScrollButton, bt as hashtagTrigger, c as Transcript, ct as PromptTokenText, d as Message, dt as TranscriptDensityProvider, en as PortalScope, et as previewPatch, f as MessageContent, ft as TranscriptVariantProvider, g as SessionEmptyState, gt as mergeComposerRows, h as TerminalTranscript, ht as matchClientCommand, i as SessionPanel, in as badgeVariants, it as Row, j as Response, jt as CopyButton, k as SubagentStrip, kt as CodeBlock, l as ToolCallCard, lt as isMutatingTool, m as TerminalItemView, mt as useTranscriptVariant, n as usePathLinks, nn as Input, nt as Blank, o as UsageMeters, on as buttonVariants, ot as WithActions, p as FileCard, pt as useTranscriptDensity, q as ToolTitleProvider, qt as MenuTrigger, r as matchPath, rn as Badge, rt as Ink, s as useMinuteClock, sn as cn, st as useAffordances, t as resolveAgainstCwd, tn as Textarea, tt as Band, u as Reasoning, ut as toolIcon, v as Conversation, vt as skillPrompt, w as TerminalQuestionPrompt, wt as PromptArea, x as StatusBar, xt as launchTrigger, y as ConversationContent, yt as commandTrigger, z as HostFilesDialog, zt as DialogContent } from "./use-path-links-DO_79-wX.mjs";
2
2
  import { C as rateLimitWindowSeconds, S as friendlyModel, _ as formatDuration, b as formatRelativeTime, c as tightestWindow, g as formatCountdown, h as formatCost, i as meterSeverity, m as formatBytes, o as modelLabel, p as formatAgoPrecise, r as meterColorClass, s as statusPresentation, t as contextSeverity, u as windowLabel, v as formatRateLimitWindow, w as toolInputPreview, x as formatTokens, y as formatRateLimitWindowLong } from "./status-kmsBhuFG.mjs";
3
3
  import { Fragment, useEffect, useMemo, useRef, useState } from "react";
4
4
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Anchor, ArrowRight, Atom, Beaker, BellRing, Bike, Binary, Blocks, Bot, Box, Brain, Briefcase, Brush, Bug, Building2, Cable, Camera, Car, Cat, Check, ChevronDown, ChevronRight, CircleAlert, CircleSlash, CircuitBoard, Cloud, Code, Coffee, Cog, Compass, Container, Cpu, CreditCard, Database, Diamond, Dog, Eraser, Feather, Film, Flame, FlaskConical, Folder, Gamepad2, Gauge, Gem, Ghost, Gift, GitBranch, Globe, GraduationCap, Hammer, Hexagon, House, Image, Key, Landmark, Laptop, Layers, Leaf, Library, Lightbulb, Lock, Mail, Map as Map$1, MessageCircle, Mic, Monitor, Moon, Mountain, Music, Network, Newspaper, Notebook, Orbit, Package, Palette, PauseCircle, PenTool, Pencil, Phone, PiggyBank, Plane, Plug, Puzzle, Radar, Radio, Receipt, Rocket, Ruler, Satellite, Scale, Scissors, Search, SearchX, Server, Shield, Ship, ShoppingCart, Signal, Smartphone, Sparkles, Sprout, Square, Star, Sun, Table, Tag, Target, Telescope, Terminal, TestTube, Trash2, TreePine, Trophy, Truck, Umbrella, Users, Wallet, Wand, Waves, Webhook, Wifi, Wrench, X, Zap } from "lucide-react";
6
6
  import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
7
7
  import { Toaster as Toaster$1, toast } from "sonner";
8
- import { STATE_LABELS, STATE_ORDER, adaptersOf, clearFilters, filterRows, groupRows, hasFacetFilter, isAgentRecord, projectLabel, projectSubpath, projectsOf, sessionLabel, subagentLabel, subsetSummary } from "@workerdeck/protocol";
8
+ import { STATE_LABELS, STATE_ORDER, adaptersOf, clearFilters, filterRows, groupRows, hasFacetFilter, isAgentRecord, projectLabel, projectName, projectSubpath, projectsOf, sessionLabel, subagentLabel, subsetSummary } from "@workerdeck/protocol";
9
9
  //#region src/components/ui/Card.tsx
10
10
  function Card({ className, ...props }) {
11
11
  return /* @__PURE__ */ jsx("div", {
@@ -172,9 +172,10 @@ function TerminalStatusLine({ className, state, rateLimits, connection, onOpenSt
172
172
  windowLabel(window.key)
173
173
  ]
174
174
  }, "usage"));
175
- if (state.totalCostUsd > 0) parts.push(/* @__PURE__ */ jsx(Ink, {
175
+ const costUsd = state.costUsd ?? (state.totalCostUsd || void 0);
176
+ if (costUsd !== void 0 && costUsd > 0) parts.push(/* @__PURE__ */ jsx(Ink, {
176
177
  tone: "faint",
177
- children: formatCost(state.totalCostUsd)
178
+ children: formatCost(costUsd)
178
179
  }, "cost"));
179
180
  if (model) parts.push(/* @__PURE__ */ jsx(Ink, {
180
181
  tone: "faint",
@@ -230,7 +231,7 @@ function SessionListItem({ session, active, onSelect, onDelete, className }) {
230
231
  }) : null,
231
232
  /* @__PURE__ */ jsx("span", {
232
233
  className: "shrink-0",
233
- children: formatCost(session.totalCostUsd)
234
+ children: formatCost(session.costUsd ?? session.totalCostUsd)
234
235
  }),
235
236
  /* @__PURE__ */ jsx("span", {
236
237
  className: "shrink-0",
@@ -587,6 +588,11 @@ function StepIcon({ state }) {
587
588
  }
588
589
  //#endregion
589
590
  //#region src/components/agent/SessionItem.tsx
591
+ const NO_MODIFIERS = {
592
+ meta: false,
593
+ ctrl: false,
594
+ alt: false
595
+ };
590
596
  function SessionItem({ row, active = false, activeStepKey, showGateway, showProject = true, projectIcons, expanded, onExpandedChange, onSelect, onSelectSubagent, onRename, renameOn = "doubleClick", editing, onEditingChange, actions, className }) {
591
597
  const { info } = row;
592
598
  const [ownExpanded, setOwnExpanded] = useState(false);
@@ -603,9 +609,10 @@ function SessionItem({ row, active = false, activeStepKey, showGateway, showProj
603
609
  };
604
610
  const engine = info.engine ?? "claude";
605
611
  const project = showProject ? projectLabel(row) : projectSubpath(row);
612
+ const projectTitle = showProject ? projectName(row) : void 0;
606
613
  const projectIcon = showProject ? info.project?.icon : void 0;
607
614
  const iconSrc = projectIcon?.type === "image" ? projectIcons?.[projectIcon.hash] : void 0;
608
- const cost = formatCost(info.totalCostUsd);
615
+ const cost = formatCost(info.costUsd ?? info.totalCostUsd);
609
616
  const extras = [
610
617
  showGateway ? row.hostName : void 0,
611
618
  info.profile ? `@${info.profile}` : void 0,
@@ -617,14 +624,17 @@ function SessionItem({ row, active = false, activeStepKey, showGateway, showProj
617
624
  className: vendorTextClass(engine, info.model),
618
625
  children: model
619
626
  }, "model"));
620
- if (project !== void 0) parts.push(/* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx(ProjectIcon, {
621
- icon: projectIcon,
622
- src: iconSrc,
623
- name: project,
624
- className: "mr-1.5 size-4 align-[-0.3em]"
625
- }), project] }, "project"));
627
+ if (project !== void 0) parts.push(/* @__PURE__ */ jsxs("span", {
628
+ title: projectTitle,
629
+ children: [/* @__PURE__ */ jsx(ProjectIcon, {
630
+ icon: projectIcon,
631
+ src: iconSrc,
632
+ name: projectTitle,
633
+ className: "mr-1.5 size-4 align-[-0.3em]"
634
+ }), project]
635
+ }, "project"));
626
636
  for (const extra of extras) parts.push(/* @__PURE__ */ jsx("span", { children: extra }, extra));
627
- const steps = sessionSteps(info, (toolUseId) => onSelectSubagent ? onSelectSubagent(toolUseId) : onSelect?.());
637
+ const steps = sessionSteps(info, (toolUseId) => onSelectSubagent ? onSelectSubagent(toolUseId) : onSelect?.(NO_MODIFIERS));
628
638
  const holdsOpenAgent = steps.some((s) => s.key === activeStepKey);
629
639
  return /* @__PURE__ */ jsxs("div", {
630
640
  "data-slot": "session-item",
@@ -633,13 +643,21 @@ function SessionItem({ row, active = false, activeStepKey, showGateway, showProj
633
643
  tabIndex: 0,
634
644
  onClick: (e) => {
635
645
  if (e.detail > 1 || isEditing) return;
636
- onSelect?.();
646
+ onSelect?.({
647
+ meta: e.metaKey,
648
+ ctrl: e.ctrlKey,
649
+ alt: e.altKey
650
+ });
637
651
  },
638
652
  onKeyDown: (e) => {
639
653
  if (e.target !== e.currentTarget) return;
640
654
  if (e.key === "Enter" || e.key === " ") {
641
655
  e.preventDefault();
642
- onSelect?.();
656
+ onSelect?.({
657
+ meta: e.metaKey,
658
+ ctrl: e.ctrlKey,
659
+ alt: e.altKey
660
+ });
643
661
  }
644
662
  },
645
663
  className: cn("group flex w-full cursor-pointer flex-col p-1 text-left outline-none", "rounded-[4px] transition-colors focus-visible:ring-2 focus-visible:ring-ring", holdsOpenAgent ? "bg-row-selected-weak" : active ? "bg-row-selected" : "hover:bg-row-hover", className),
@@ -1080,6 +1098,6 @@ function OneOfSelect({ label, value, options, onChange }) {
1080
1098
  });
1081
1099
  }
1082
1100
  //#endregion
1083
- export { AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger, Badge, Band, Blank, Button, Card, CardContent, CardHeader, CardTitle, CodeBlock, Composer, ContextDialog, ContextRing, Conversation, ConversationContent, ConversationScrollButton, CopyAction, CopyButton, Dialog, DialogBody, DialogClose, DialogContent, DialogHeader, DialogRow, DialogTrigger, Empty, EmptyKey, EngineIcon, FileCard, FileLinkProvider, HostFilesDialog, Ink, Input, Loader, McpDialog, Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger, Message, MessageContent, ModelSelect, PERMISSION_MODES, PermissionModeSelect, PermissionPrompt, ProgressRing, ProjectIcon, PromptArea, PromptTokenText, QUESTION_BEHAVIORS, QuestionPrompt, Reasoning, Response, Row, STATUS_META, Select, SelectContent, SelectItem, SelectItemText, SelectTrigger, SelectValue, SessionBrowser, SessionEmptyState, SessionInfoDialog, SessionItem, SessionList, SessionListItem, SessionPanel, SessionStatusIcon, SkillsDialog, Spinner, Splitter, StatusBar, StepRow, StepToggle, SubagentStrip, TaskList, TasksDialog, TerminalDiff, TerminalItemView, TerminalMarkdown, TerminalPermissionPrompt, TerminalQuestionPrompt, TerminalStatusLine, TerminalSurface, TerminalTranscript, Textarea, Tip, Toaster, ToolCallCard, ToolTitleProvider, TooltipContent, TooltipProvider, Transcript, TranscriptDensityProvider, TranscriptVariantProvider, UsageDialog, UsageMeters, WithActions, badgeVariants, buttonVariants, cn, commandTrigger, copyText, engineMark, formatAgoPrecise, formatBytes, formatCost, formatCountdown, formatDuration, formatRateLimitWindow, formatRateLimitWindowLong, formatRelativeTime, formatTokens, friendlyModel, getChipsByTrigger, hashtagTrigger, isMutatingTool, isSegmentsEmpty, launchTrigger, matchClientCommand, mentionTrigger, mergeComposerRows, parseFileLink, parseUserQuestions, permissionModeChoices, permissionModeMeta, plainTextToSegments, previewPatch, rankComposerRows, rateLimitWindowSeconds, rowShapeClass, runningSteps, segmentsToPlainText, sessionSteps, skillPrompt, toast, toolIcon, toolInputPreview, useAffordances, useFileLinks, useMinuteClock, usePromptAreaState, useToolTitle, useTranscriptDensity, useTranscriptVariant, vendorMarkClass, vendorTextClass };
1101
+ export { AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger, Badge, Band, Blank, Button, Card, CardContent, CardHeader, CardTitle, CodeBlock, Composer, ContextDialog, ContextRing, Conversation, ConversationContent, ConversationScrollButton, CopyAction, CopyButton, Dialog, DialogBody, DialogClose, DialogContent, DialogHeader, DialogRow, DialogTrigger, Empty, EmptyKey, EngineIcon, FileCard, FileLinkProvider, HostFilesDialog, Ink, Input, Loader, McpDialog, Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger, Message, MessageContent, ModelSelect, PERMISSION_MODES, PermissionModeSelect, PermissionPrompt, ProgressRing, ProjectIcon, PromptArea, PromptTokenText, QUESTION_BEHAVIORS, QuestionPrompt, Reasoning, Response, Row, STATUS_META, Select, SelectContent, SelectItem, SelectItemText, SelectTrigger, SelectValue, SessionBrowser, SessionEmptyState, SessionInfoDialog, SessionItem, SessionList, SessionListItem, SessionPanel, SessionStatusIcon, SkillsDialog, Spinner, Splitter, StatusBar, StepRow, StepToggle, SubagentStrip, TaskList, TasksDialog, TerminalDiff, TerminalItemView, TerminalMarkdown, TerminalPermissionPrompt, TerminalQuestionPrompt, TerminalStatusLine, TerminalSurface, TerminalTranscript, Textarea, Tip, Toaster, ToolCallCard, ToolTitleProvider, TooltipContent, TooltipProvider, Transcript, TranscriptDensityProvider, TranscriptVariantProvider, UsageDialog, UsageMeters, WithActions, badgeVariants, buttonVariants, cn, commandTrigger, copyText, engineMark, formatAgoPrecise, formatBytes, formatCost, formatCountdown, formatDuration, formatRateLimitWindow, formatRateLimitWindowLong, formatRelativeTime, formatTokens, friendlyModel, getChipsByTrigger, hashtagTrigger, isMutatingTool, isSegmentsEmpty, launchTrigger, matchClientCommand, matchPath, mentionTrigger, mergeComposerRows, parseFileLink, parseUserQuestions, permissionModeChoices, permissionModeMeta, plainTextToSegments, previewPatch, rankComposerRows, rateLimitWindowSeconds, resolveAgainstCwd, rowShapeClass, runningSteps, segmentsToPlainText, sessionSteps, skillPrompt, toast, toolIcon, toolInputPreview, useAffordances, useFileLinks, useMinuteClock, usePathLinks, usePromptAreaState, useToolTitle, useTranscriptDensity, useTranscriptVariant, vendorMarkClass, vendorTextClass };
1084
1102
 
1085
1103
  //# sourceMappingURL=index.mjs.map