@workerdeck/ui 2.9.0 → 2.10.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/build/index.d.mts +52 -6
- package/build/index.mjs +23 -9
- package/build/index.mjs.map +1 -1
- package/build/scoped.css +20 -0
- package/build/{SessionPanel-BClL7zUS.mjs → use-path-links-CvcxdUXL.mjs} +437 -135
- package/build/use-path-links-CvcxdUXL.mjs.map +1 -0
- package/build/workspace.mjs +3 -83
- package/build/workspace.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/agent/Composer.tsx +7 -4
- package/src/components/agent/PromptTokenText.tsx +11 -3
- package/src/components/agent/SessionInfoDialog.tsx +1 -1
- package/src/components/agent/SessionItem.tsx +9 -5
- package/src/components/agent/SessionList.tsx +1 -1
- package/src/components/agent/SessionPanel.tsx +4 -1
- package/src/components/agent/StatusBar.tsx +1 -1
- package/src/components/agent/Transcript.tsx +83 -79
- package/src/components/agent/TranscriptItemView.tsx +1 -1
- package/src/components/agent/UsageDialog.tsx +87 -6
- package/src/components/agent/composer-commands.ts +14 -2
- package/src/components/agent/use-path-links.ts +5 -19
- package/src/components/prompt-area/clipboard-helpers.ts +13 -4
- package/src/components/prompt-area/dom-helpers.ts +10 -1
- package/src/components/prompt-area/index.ts +10 -1
- package/src/components/prompt-area/prompt-area-engine.ts +23 -14
- package/src/components/prompt-area/types.ts +20 -0
- package/src/components/prompt-area/use-prompt-area-keydown.ts +2 -1
- package/src/components/prompt-area/use-prompt-area.ts +8 -2
- package/src/components/terminal/StatusLine.tsx +3 -2
- package/src/components/terminal/items.tsx +3 -2
- package/src/index.ts +3 -1
- package/src/lib/path-match.ts +51 -0
- package/src/lib/session-cost.ts +65 -0
- 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, 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
|
|
661
|
+
* Chips are represented by {@link chipPlainText}.
|
|
643
662
|
*/
|
|
644
663
|
declare function segmentsToPlainText(segments: Segment[]): string;
|
|
645
664
|
/**
|
|
@@ -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,16 @@ interface UsageDialogProps {
|
|
|
967
1005
|
rateLimits: UsageWindowRow[];
|
|
968
1006
|
subscriptionType?: string;
|
|
969
1007
|
engine: ProfileEngine;
|
|
970
|
-
totalCostUsd
|
|
1008
|
+
totalCostUsd?: number;
|
|
1009
|
+
costUsd?: number;
|
|
1010
|
+
usageByModel?: ByModel;
|
|
1011
|
+
spend?: ProfileSpend;
|
|
971
1012
|
updatedAt?: number;
|
|
972
1013
|
open: boolean;
|
|
973
1014
|
onOpenChange: (open: boolean) => void;
|
|
974
1015
|
className?: string;
|
|
975
1016
|
}
|
|
976
|
-
declare function UsageDialog({ rateLimits, subscriptionType, engine, totalCostUsd, updatedAt, open, onOpenChange, className }: UsageDialogProps): import("react").JSX.Element;
|
|
1017
|
+
declare function UsageDialog({ rateLimits, subscriptionType, engine, totalCostUsd, costUsd, usageByModel, spend, updatedAt, open, onOpenChange, className }: UsageDialogProps): import("react").JSX.Element;
|
|
977
1018
|
//#endregion
|
|
978
1019
|
//#region src/components/agent/TaskList.d.ts
|
|
979
1020
|
interface TaskListProps {
|
|
@@ -1092,6 +1133,11 @@ declare function rowShapeClass(active: boolean): string;
|
|
|
1092
1133
|
declare function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeSubagentId, onSelect, onDelete, onRename, onClearContext, onSelectSubagent, emptyState, showControls, projectIcons, className }: SessionBrowserProps): import("react").JSX.Element;
|
|
1093
1134
|
//#endregion
|
|
1094
1135
|
//#region src/components/agent/SessionItem.d.ts
|
|
1136
|
+
type SelectModifiers = {
|
|
1137
|
+
meta: boolean;
|
|
1138
|
+
ctrl: boolean;
|
|
1139
|
+
alt: boolean;
|
|
1140
|
+
};
|
|
1095
1141
|
interface SessionItemProps {
|
|
1096
1142
|
row: SessionRow;
|
|
1097
1143
|
active?: boolean;
|
|
@@ -1101,7 +1147,7 @@ interface SessionItemProps {
|
|
|
1101
1147
|
projectIcons?: Record<string, string>;
|
|
1102
1148
|
expanded?: boolean;
|
|
1103
1149
|
onExpandedChange?: (expanded: boolean) => void;
|
|
1104
|
-
onSelect?: () => void;
|
|
1150
|
+
onSelect?: (modifiers: SelectModifiers) => void;
|
|
1105
1151
|
onSelectSubagent?: (toolUseId: string) => void;
|
|
1106
1152
|
onRename?: (title: string) => void;
|
|
1107
1153
|
renameOn?: 'doubleClick' | 'external';
|
|
@@ -1207,5 +1253,5 @@ declare function copyText(value: string): Promise<boolean>;
|
|
|
1207
1253
|
declare function toolIcon(toolName: string): LucideIcon;
|
|
1208
1254
|
declare function isMutatingTool(toolName: string): boolean;
|
|
1209
1255
|
//#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 };
|
|
1256
|
+
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
1257
|
//# sourceMappingURL=index.d.mts.map
|
package/build/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
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-CvcxdUXL.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";
|
|
@@ -172,9 +172,10 @@ function TerminalStatusLine({ className, state, rateLimits, connection, onOpenSt
|
|
|
172
172
|
windowLabel(window.key)
|
|
173
173
|
]
|
|
174
174
|
}, "usage"));
|
|
175
|
-
|
|
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(
|
|
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);
|
|
@@ -605,7 +611,7 @@ function SessionItem({ row, active = false, activeStepKey, showGateway, showProj
|
|
|
605
611
|
const project = showProject ? projectLabel(row) : projectSubpath(row);
|
|
606
612
|
const projectIcon = showProject ? info.project?.icon : void 0;
|
|
607
613
|
const iconSrc = projectIcon?.type === "image" ? projectIcons?.[projectIcon.hash] : void 0;
|
|
608
|
-
const cost = formatCost(info.totalCostUsd);
|
|
614
|
+
const cost = formatCost(info.costUsd ?? info.totalCostUsd);
|
|
609
615
|
const extras = [
|
|
610
616
|
showGateway ? row.hostName : void 0,
|
|
611
617
|
info.profile ? `@${info.profile}` : void 0,
|
|
@@ -624,7 +630,7 @@ function SessionItem({ row, active = false, activeStepKey, showGateway, showProj
|
|
|
624
630
|
className: "mr-1.5 size-4 align-[-0.3em]"
|
|
625
631
|
}), project] }, "project"));
|
|
626
632
|
for (const extra of extras) parts.push(/* @__PURE__ */ jsx("span", { children: extra }, extra));
|
|
627
|
-
const steps = sessionSteps(info, (toolUseId) => onSelectSubagent ? onSelectSubagent(toolUseId) : onSelect?.());
|
|
633
|
+
const steps = sessionSteps(info, (toolUseId) => onSelectSubagent ? onSelectSubagent(toolUseId) : onSelect?.(NO_MODIFIERS));
|
|
628
634
|
const holdsOpenAgent = steps.some((s) => s.key === activeStepKey);
|
|
629
635
|
return /* @__PURE__ */ jsxs("div", {
|
|
630
636
|
"data-slot": "session-item",
|
|
@@ -633,13 +639,21 @@ function SessionItem({ row, active = false, activeStepKey, showGateway, showProj
|
|
|
633
639
|
tabIndex: 0,
|
|
634
640
|
onClick: (e) => {
|
|
635
641
|
if (e.detail > 1 || isEditing) return;
|
|
636
|
-
onSelect?.(
|
|
642
|
+
onSelect?.({
|
|
643
|
+
meta: e.metaKey,
|
|
644
|
+
ctrl: e.ctrlKey,
|
|
645
|
+
alt: e.altKey
|
|
646
|
+
});
|
|
637
647
|
},
|
|
638
648
|
onKeyDown: (e) => {
|
|
639
649
|
if (e.target !== e.currentTarget) return;
|
|
640
650
|
if (e.key === "Enter" || e.key === " ") {
|
|
641
651
|
e.preventDefault();
|
|
642
|
-
onSelect?.(
|
|
652
|
+
onSelect?.({
|
|
653
|
+
meta: e.metaKey,
|
|
654
|
+
ctrl: e.ctrlKey,
|
|
655
|
+
alt: e.altKey
|
|
656
|
+
});
|
|
643
657
|
}
|
|
644
658
|
},
|
|
645
659
|
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 +1094,6 @@ function OneOfSelect({ label, value, options, onChange }) {
|
|
|
1080
1094
|
});
|
|
1081
1095
|
}
|
|
1082
1096
|
//#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 };
|
|
1097
|
+
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
1098
|
|
|
1085
1099
|
//# sourceMappingURL=index.mjs.map
|