@workerdeck/ui 3.2.0 → 3.4.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/{SessionPanel-BNNc8grK.d.mts → SessionPanel-DIi4sEgh.d.mts} +5 -2
- package/build/index.d.mts +24 -5
- package/build/index.mjs +297 -62
- package/build/index.mjs.map +1 -1
- package/build/scoped.css +52 -3
- package/build/{use-path-links-C6Fh5zdx.mjs → use-path-links-WCsysQPy.mjs} +337 -83
- package/build/use-path-links-WCsysQPy.mjs.map +1 -0
- package/build/workspace.d.mts +1 -1
- package/build/workspace.mjs +1 -1
- package/package.json +4 -4
- package/src/components/agent/Composer.tsx +29 -6
- package/src/components/agent/EffortSelect.tsx +64 -0
- package/src/components/agent/ModelSelect.tsx +1 -1
- package/src/components/agent/SessionBrowser.tsx +106 -17
- package/src/components/agent/SessionFilters.tsx +2 -2
- package/src/components/agent/SessionGroups.tsx +248 -0
- package/src/components/agent/SessionItem.tsx +3 -1
- package/src/components/agent/SessionPanel.tsx +75 -28
- package/src/components/agent/TranscriptItemView.tsx +20 -2
- package/src/components/agent/composer-commands.ts +24 -0
- package/src/components/terminal/affordances.tsx +29 -1
- package/src/components/terminal/height.ts +12 -2
- package/src/components/terminal/items.tsx +35 -3
- package/src/components/terminal/live-tool.ts +71 -0
- package/src/components/terminal/tool-run.ts +6 -3
- package/src/index.ts +8 -1
- package/src/styles/terminal.css +9 -2
- package/src/styles/theme.css +3 -1
- package/build/use-path-links-C6Fh5zdx.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentType, ReactNode } from "react";
|
|
2
2
|
import { LucideIcon } from "lucide-react";
|
|
3
|
-
import { ModelOption, PermissionMode, PermissionRequest, SessionTask, ShellInfo, SkillInfo, SlashCommandInfo, SubagentInfo } from "@workerdeck/protocol";
|
|
3
|
+
import { EngineCapabilities, ModelOption, PermissionMode, PermissionRequest, SessionTask, ShellInfo, SkillInfo, SlashCommandInfo, SubagentInfo } from "@workerdeck/protocol";
|
|
4
4
|
import { ClientToolHandler, ConnectionState, TranscriptState, UseToolCallHostOptions } from "@workerdeck/react";
|
|
5
5
|
import { WorkerDeckClient } from "@workerdeck/client";
|
|
6
6
|
//#region src/components/agent/composer-commands.d.ts
|
|
@@ -199,6 +199,7 @@ interface SessionPanelProps {
|
|
|
199
199
|
}
|
|
200
200
|
type SessionControls = {
|
|
201
201
|
setModel: (model?: string) => void;
|
|
202
|
+
setEffort: (effort?: string) => void;
|
|
202
203
|
setPermissionMode: (mode: PermissionMode) => void;
|
|
203
204
|
interrupt: () => void;
|
|
204
205
|
focusComposer: () => void;
|
|
@@ -212,6 +213,8 @@ type SessionVitals = {
|
|
|
212
213
|
capabilities: TranscriptState['capabilities'];
|
|
213
214
|
model: string | undefined;
|
|
214
215
|
models: ModelOption[];
|
|
216
|
+
effort: TranscriptState['effort'];
|
|
217
|
+
efforts: readonly string[];
|
|
215
218
|
permissionMode: TranscriptState['permissionMode'];
|
|
216
219
|
permissionModes: PermissionModeChoice[];
|
|
217
220
|
skills: SkillInfo[] | undefined;
|
|
@@ -227,4 +230,4 @@ type SessionVitals = {
|
|
|
227
230
|
declare function SessionPanel({ client, sessionId, header, panelSurface, statusSurface, statusPlacement, onOpenPanel, onVitals, transcriptVariant, transcriptFont, affordances, terminalMetrics, scrubber, bookmarks, peerMentions, onToggleBookmark, reveal, subagents, shells, openSubagent, onSubagentChange, openShell, onShellChange, stickyPrompt, controlsSurface, onControls, focusComposerOnClick, unseen, readOnly, approvalPrompts, toolHost, clientTools, cacheTranscript, emptyState, onLinkClick, onOpenFile, fontSize, className }: SessionPanelProps): import("react").JSX.Element;
|
|
228
231
|
//#endregion
|
|
229
232
|
export { ComposerRow as A, PermissionModeChoice as C, permissionModeChoices as D, PermissionModeSelectProps as E, skillPrompt as F, mergeComposerRows as M, rankComposerRows as N, permissionModeMeta as O, rankPeerSessions as P, PERMISSION_MODES as S, PermissionModeSelect as T, AgentWriteIcon as _, SessionVitals as a, WithActions as b, TranscriptVariant as c, ApprovalPromptProps as d, FileLinkHandle as f, ActionPlacement as g, useFileLinks as h, SessionSurfacePanel as i, matchClientCommand as j, ClientCommand as k, TranscriptVariantProvider as l, FileLinkProvider as m, SessionPanel as n, TerminalMetrics as o, FileLinkOpener as p, SessionPanelProps as r, TranscriptFont as s, SessionControls as t, useTranscriptVariant as u, CopyAction as v, PermissionModeMeta as w, useAffordances as x, TerminalAffordances as y };
|
|
230
|
-
//# sourceMappingURL=SessionPanel-
|
|
233
|
+
//# sourceMappingURL=SessionPanel-DIi4sEgh.d.mts.map
|
package/build/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as formatCost, c as formatRateLimitWindow, d as formatTokens, f as friendlyModel, i as formatBytes, l as formatRateLimitWindowLong, m as toolInputPreview, o as formatCountdown, p as rateLimitWindowSeconds, r as formatAgoPrecise, s as formatDuration, u as formatRelativeTime } from "./format-eS_oUry-.mjs";
|
|
2
|
-
import { A as ComposerRow, C as PermissionModeChoice, D as permissionModeChoices, E as PermissionModeSelectProps, F as skillPrompt, M as mergeComposerRows, N as rankComposerRows, O as permissionModeMeta, P as rankPeerSessions, S as PERMISSION_MODES, T as PermissionModeSelect, _ as AgentWriteIcon, a as SessionVitals, b as WithActions, c as TranscriptVariant, d as ApprovalPromptProps, f as FileLinkHandle, g as ActionPlacement, h as useFileLinks, i as SessionSurfacePanel, j as matchClientCommand, k as ClientCommand, l as TranscriptVariantProvider, m as FileLinkProvider, n as SessionPanel, o as TerminalMetrics, p as FileLinkOpener, r as SessionPanelProps, s as TranscriptFont, t as SessionControls, u as useTranscriptVariant, v as CopyAction, w as PermissionModeMeta, x as useAffordances, y as TerminalAffordances } from "./SessionPanel-
|
|
2
|
+
import { A as ComposerRow, C as PermissionModeChoice, D as permissionModeChoices, E as PermissionModeSelectProps, F as skillPrompt, M as mergeComposerRows, N as rankComposerRows, O as permissionModeMeta, P as rankPeerSessions, S as PERMISSION_MODES, T as PermissionModeSelect, _ as AgentWriteIcon, a as SessionVitals, b as WithActions, c as TranscriptVariant, d as ApprovalPromptProps, f as FileLinkHandle, g as ActionPlacement, h as useFileLinks, i as SessionSurfacePanel, j as matchClientCommand, k as ClientCommand, l as TranscriptVariantProvider, m as FileLinkProvider, n as SessionPanel, o as TerminalMetrics, p as FileLinkOpener, r as SessionPanelProps, s as TranscriptFont, t as SessionControls, u as useTranscriptVariant, v as CopyAction, w as PermissionModeMeta, x as useAffordances, y as TerminalAffordances } from "./SessionPanel-DIi4sEgh.mjs";
|
|
3
3
|
import { ButtonHTMLAttributes, FunctionComponent, HTMLAttributes, InputHTMLAttributes, ReactElement, ReactNode, Ref, RefObject, TextareaHTMLAttributes } from "react";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
5
|
import { ClassValue } from "clsx";
|
|
@@ -11,7 +11,7 @@ import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
|
11
11
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
12
12
|
import { Tooltip } from "@base-ui/react/tooltip";
|
|
13
13
|
import { toast } from "sonner";
|
|
14
|
-
import { ByModel, ContextReading, ContextUsage, FilePatch, McpServerActionRequest, McpServerStatusInfo, McpServerToolInfo, ModelOption, PermissionRequest, PricingTable, ProfileEngine, ProfileSpend, ProjectIcon as ProjectIcon$1, QuestionBehavior, RateLimitInfo, SessionInfo, SessionRow, SessionStatus, SessionTask, ShellInfo, SkillInfo, SlashCommandInfo, StepDisplay, SubagentDisplay, UsageWindowRow, ViewConfig, WorkspaceScope, parseUserQuestions } from "@workerdeck/protocol";
|
|
14
|
+
import { ByModel, ContextReading, ContextUsage, EngineCapabilities, FilePatch, McpServerActionRequest, McpServerStatusInfo, McpServerToolInfo, ModelOption, PermissionRequest, PricingTable, ProfileEngine, ProfileSpend, ProjectIcon as ProjectIcon$1, QuestionBehavior, RateLimitInfo, SessionInfo, SessionRow, SessionStatus, SessionTask, ShellInfo, SkillInfo, SlashCommandInfo, StepDisplay, SubagentDisplay, UsageWindowRow, ViewConfig, WorkspaceScope, parseUserQuestions } from "@workerdeck/protocol";
|
|
15
15
|
import { ConnectionState, PeerSessionOption, TranscriptItem, TranscriptState, UseAttachmentsResult } from "@workerdeck/react";
|
|
16
16
|
import { WorkerDeckClient } from "@workerdeck/client";
|
|
17
17
|
//#region src/components/ui/Button.d.ts
|
|
@@ -975,6 +975,7 @@ type ComposerHandle = {
|
|
|
975
975
|
};
|
|
976
976
|
interface ComposerProps {
|
|
977
977
|
onSend: (text: string, attachmentIds: string[]) => void;
|
|
978
|
+
onSendNow?: (text: string, attachmentIds: string[]) => void;
|
|
978
979
|
onInterrupt: () => void;
|
|
979
980
|
busy: boolean;
|
|
980
981
|
disabled?: boolean;
|
|
@@ -1001,7 +1002,7 @@ interface ComposerProps {
|
|
|
1001
1002
|
className?: string;
|
|
1002
1003
|
ref?: Ref<ComposerHandle>;
|
|
1003
1004
|
}
|
|
1004
|
-
declare function Composer({ onSend, onInterrupt, busy, disabled, placeholder, commands, skills, clientCommands, onSearchFiles, peers, onShellCommand, attachments, toolbar, layout, fontSize, lineHeight, affordances, draft, className, ref }: ComposerProps): import("react").JSX.Element;
|
|
1005
|
+
declare function Composer({ onSend, onSendNow, onInterrupt, busy, disabled, placeholder, commands, skills, clientCommands, onSearchFiles, peers, onShellCommand, attachments, toolbar, layout, fontSize, lineHeight, affordances, draft, className, ref }: ComposerProps): import("react").JSX.Element;
|
|
1005
1006
|
//#endregion
|
|
1006
1007
|
//#region src/components/agent/ModelSelect.d.ts
|
|
1007
1008
|
interface ModelSelectProps {
|
|
@@ -1014,6 +1015,18 @@ interface ModelSelectProps {
|
|
|
1014
1015
|
}
|
|
1015
1016
|
declare function ModelSelect({ models, model, onModelChange, variant, disabled, className }: ModelSelectProps): import("react").JSX.Element;
|
|
1016
1017
|
//#endregion
|
|
1018
|
+
//#region src/components/agent/EffortSelect.d.ts
|
|
1019
|
+
declare function effortChoices(models: readonly ModelOption[], model: string | undefined, capabilities: Pick<EngineCapabilities, 'reasoningEfforts'>): readonly string[];
|
|
1020
|
+
interface EffortSelectProps {
|
|
1021
|
+
efforts: readonly string[];
|
|
1022
|
+
effort?: string | null;
|
|
1023
|
+
onEffortChange: (effort?: string) => void;
|
|
1024
|
+
variant?: 'toolbar' | 'form';
|
|
1025
|
+
disabled?: boolean;
|
|
1026
|
+
className?: string;
|
|
1027
|
+
}
|
|
1028
|
+
declare function EffortSelect({ efforts, effort, onEffortChange, variant, disabled, className }: EffortSelectProps): import("react").JSX.Element;
|
|
1029
|
+
//#endregion
|
|
1017
1030
|
//#region src/components/agent/StatusBar.d.ts
|
|
1018
1031
|
interface StatusBarProps {
|
|
1019
1032
|
state: TranscriptState;
|
|
@@ -1242,12 +1255,14 @@ interface SessionBrowserProps {
|
|
|
1242
1255
|
onDelete?: (row: SessionRow) => void;
|
|
1243
1256
|
onRename?: (row: SessionRow, title: string) => void;
|
|
1244
1257
|
onClearContext?: (row: SessionRow) => void;
|
|
1258
|
+
onSleep?: (row: SessionRow) => void;
|
|
1245
1259
|
onSelectSubagent?: (row: SessionRow, toolUseId: string) => void;
|
|
1246
1260
|
onSelectTask?: (row: SessionRow, task: SessionTask) => void;
|
|
1247
1261
|
onStopTask?: (row: SessionRow, toolUseId: string) => void;
|
|
1248
1262
|
onSelectShell?: (row: SessionRow, shellId: string) => void;
|
|
1249
1263
|
onKillShell?: (row: SessionRow, shellId: string) => void;
|
|
1250
1264
|
onShellAgentWrite?: (row: SessionRow, shellId: string, enabled: boolean) => void;
|
|
1265
|
+
onCreateInGroup?: (target: GroupTarget) => void;
|
|
1251
1266
|
emptyState?: ReactNode;
|
|
1252
1267
|
showControls?: boolean;
|
|
1253
1268
|
showSearch?: boolean;
|
|
@@ -1255,8 +1270,12 @@ interface SessionBrowserProps {
|
|
|
1255
1270
|
projectIcons?: Record<string, string>;
|
|
1256
1271
|
className?: string;
|
|
1257
1272
|
}
|
|
1273
|
+
type GroupTarget = {
|
|
1274
|
+
hostId: string;
|
|
1275
|
+
cwd?: string;
|
|
1276
|
+
};
|
|
1258
1277
|
declare function rowShapeClass(active: boolean): string;
|
|
1259
|
-
declare function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeSubagentId, activeShellId, now, isActive, rowActions, gatewayCount, showSubset, onSelect, onDelete, onRename, onClearContext, onSelectSubagent, onSelectTask, onStopTask, onSelectShell, onKillShell, onShellAgentWrite, emptyState, showControls, showSearch, autoFocusSearch, projectIcons, className }: SessionBrowserProps): import("react").JSX.Element;
|
|
1278
|
+
declare function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeSubagentId, activeShellId, now, isActive, rowActions, gatewayCount, showSubset, onSelect, onDelete, onRename, onClearContext, onSleep, onSelectSubagent, onSelectTask, onStopTask, onSelectShell, onKillShell, onShellAgentWrite, onCreateInGroup, emptyState, showControls, showSearch, autoFocusSearch, projectIcons, className }: SessionBrowserProps): import("react").JSX.Element;
|
|
1260
1279
|
declare function SessionSearch({ value, onChange, autoFocus, className, inputClassName }: {
|
|
1261
1280
|
value: string;
|
|
1262
1281
|
onChange: (value: string) => void;
|
|
@@ -1495,5 +1514,5 @@ declare function copyText(value: string): Promise<boolean>;
|
|
|
1495
1514
|
declare function toolIcon(toolName: string): LucideIcon;
|
|
1496
1515
|
declare function isMutatingTool(toolName: string): boolean;
|
|
1497
1516
|
//#endregion
|
|
1498
|
-
export { type ActionPlacement, AgentWriteIcon, 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, ContextPanel, type ContextPanelProps, 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, ImageViewer, ImageViewerProvider, Ink, Input, Loader, McpDialog, type McpDialogProps, McpPanel, McpPanelActions, type McpPanelModel, type McpPanelProps, Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger, Message, MessageContent, type MessageProps, ModelSelect, type ModelSelectProps, type OpenImage, OptionSelect, type OptionSelectProps, PERMISSION_MODES, type PathHit, type PathMatch, type PermissionModeChoice, type PermissionModeMeta, PermissionModeSelect, type PermissionModeSelectProps, PermissionPrompt, type PermissionPromptProps, Popover, PopoverContent, PopoverTrigger, 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, SHELL_AGENT_WRITE_NOTE, SHELL_GLYPH, SHELL_KILL_GLYPH, STATUS_META, STEP_DISPLAY_OPTIONS, SUBAGENT_DISPLAY_META, SUBAGENT_DISPLAY_ORDER, type Segment, Select, SelectContent, SelectItem, SelectItemText, type SelectModifiers, SelectTrigger, SelectValue, SessionBrowser, type SessionBrowserProps, type SessionControls, SessionEmptyState, type SessionEmptyStateProps, SessionFilters, SessionFiltersButton, type SessionFiltersButtonProps, type SessionFiltersProps, SessionInfoDialog, type SessionInfoDialogProps, SessionInfoPanel, type SessionInfoPanelProps, SessionItem, type SessionItemProps, SessionList, SessionListItem, type SessionListItemProps, type SessionListProps, SessionNamesProvider, SessionPanel, type SessionPanelProps, SessionSearch, SessionStatusIcon, type SessionSurfacePanel, type SessionVitals, type ShellActions, ShellActionsProvider, type ShellFrame, type ShellFrameOptions, type ShellStepOptions, ShellStrip, type ShellStripProps, SkillNamesProvider, SkillsDialog, type SkillsDialogProps, Spinner, Splitter, type SplitterProps, StatusBar, type StatusBarProps, type Step, StepDisplayControl, type StepKind, StepRow, SubagentDisplayIcon, SubagentStrip, SubagentToggle, type SubagentToggleProps, TaskList, type TaskListProps, type TaskStepOptions, 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 TranscriptFont, type TranscriptProps, type TranscriptVariant, TranscriptVariantProvider, type TriggerConfig, type TriggerSuggestion, UsageDialog, type UsageDialogProps, UsageMeters, ViewableImage, type ViewedImage, 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, rankPeerSessions, rateLimitWindowSeconds, resolveAgainstCwd, rowShapeClass, segmentsToPlainText, sessionSteps, shellAgentWriteLabel, shellGrantable, shellInfoFailed, shellInfoLabel, shellInfoStatusText, shellTitle, skillPrompt, toast, toolIcon, toolInputPreview, useAffordances, useFileLinks, useMcpPanel, useMinuteClock, useOpenImage, usePathLinks, usePromptAreaState, useShellActions, useShellFrame, useToolTitle, useTranscriptVariant, vendorMarkClass, vendorTextClass };
|
|
1517
|
+
export { type ActionPlacement, AgentWriteIcon, 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, ContextPanel, type ContextPanelProps, ContextRing, Conversation, ConversationContent, type ConversationProps, ConversationScrollButton, CopyAction, CopyButton, type CopyButtonProps, Dialog, DialogBody, DialogClose, DialogContent, DialogHeader, DialogRow, DialogTrigger, EffortSelect, type EffortSelectProps, Empty, EmptyKey, EngineIcon, FileCard, type FileCardProps, type FileDeliveredItem, type FileLink, type FileLinkHandle, type FileLinkOpener, FileLinkProvider, type GroupTarget, HostFilesDialog, type HostFilesDialogProps, ImageViewer, ImageViewerProvider, Ink, Input, Loader, McpDialog, type McpDialogProps, McpPanel, McpPanelActions, type McpPanelModel, type McpPanelProps, Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger, Message, MessageContent, type MessageProps, ModelSelect, type ModelSelectProps, type OpenImage, OptionSelect, type OptionSelectProps, PERMISSION_MODES, type PathHit, type PathMatch, type PermissionModeChoice, type PermissionModeMeta, PermissionModeSelect, type PermissionModeSelectProps, PermissionPrompt, type PermissionPromptProps, Popover, PopoverContent, PopoverTrigger, 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, SHELL_AGENT_WRITE_NOTE, SHELL_GLYPH, SHELL_KILL_GLYPH, STATUS_META, STEP_DISPLAY_OPTIONS, SUBAGENT_DISPLAY_META, SUBAGENT_DISPLAY_ORDER, type Segment, Select, SelectContent, SelectItem, SelectItemText, type SelectModifiers, SelectTrigger, SelectValue, SessionBrowser, type SessionBrowserProps, type SessionControls, SessionEmptyState, type SessionEmptyStateProps, SessionFilters, SessionFiltersButton, type SessionFiltersButtonProps, type SessionFiltersProps, SessionInfoDialog, type SessionInfoDialogProps, SessionInfoPanel, type SessionInfoPanelProps, SessionItem, type SessionItemProps, SessionList, SessionListItem, type SessionListItemProps, type SessionListProps, SessionNamesProvider, SessionPanel, type SessionPanelProps, SessionSearch, SessionStatusIcon, type SessionSurfacePanel, type SessionVitals, type ShellActions, ShellActionsProvider, type ShellFrame, type ShellFrameOptions, type ShellStepOptions, ShellStrip, type ShellStripProps, SkillNamesProvider, SkillsDialog, type SkillsDialogProps, Spinner, Splitter, type SplitterProps, StatusBar, type StatusBarProps, type Step, StepDisplayControl, type StepKind, StepRow, SubagentDisplayIcon, SubagentStrip, SubagentToggle, type SubagentToggleProps, TaskList, type TaskListProps, type TaskStepOptions, 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 TranscriptFont, type TranscriptProps, type TranscriptVariant, TranscriptVariantProvider, type TriggerConfig, type TriggerSuggestion, UsageDialog, type UsageDialogProps, UsageMeters, ViewableImage, type ViewedImage, WithActions, badgeVariants, buttonVariants, cn, commandTrigger, copyText, effortChoices, 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, rankPeerSessions, rateLimitWindowSeconds, resolveAgainstCwd, rowShapeClass, segmentsToPlainText, sessionSteps, shellAgentWriteLabel, shellGrantable, shellInfoFailed, shellInfoLabel, shellInfoStatusText, shellTitle, skillPrompt, toast, toolIcon, toolInputPreview, useAffordances, useFileLinks, useMcpPanel, useMinuteClock, useOpenImage, usePathLinks, usePromptAreaState, useShellActions, useShellFrame, useToolTitle, useTranscriptVariant, vendorMarkClass, vendorTextClass };
|
|
1499
1518
|
//# sourceMappingURL=index.d.mts.map
|
package/build/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as Composer, $t as Splitter, A as PermissionPrompt, An as badgeVariants, At as WithActions, B as EffortSelect, Bt as mergeComposerRows, C as SessionInfoDialog, Cn as SelectItemText, Ct as previewPatch, D as QUESTION_BEHAVIORS, Dn as Textarea, Dt as Row, E as TerminalPermissionPrompt, En as PortalScope, Et as Ink, F as SubagentStrip, Ft as isMutatingTool, G as McpPanel, Gt as hashtagTrigger, H as ModelSelect, Ht as rankPeerSessions, I as PERMISSION_MODES, It as toolIcon, J as HostFilesDialog, Jt as usePromptAreaState, K as McpPanelActions, Kt as launchTrigger, L as PermissionModeSelect, Lt as TranscriptVariantProvider, M as useShellFrame, Mn as buttonVariants, Mt as PromptTokenText, Nn as cn, Nt as SessionNamesProvider, O as QuestionPrompt, On as Input, Ot as AgentWriteIcon, P as ShellStrip, Pt as SkillNamesProvider, Q as contextNote, Qt as ProgressRing, R as permissionModeChoices, Rt as useTranscriptVariant, S as STATUS_META, Sn as SelectItem, St as TerminalDiff, T as TerminalQuestionPrompt, Tn as SelectValue, Tt as Blank, U as SkillsDialog, Ut as skillPrompt, V as effortChoices, Vt as rankComposerRows, W as McpDialog, Wt as commandTrigger, X as ContextDialog, Xt as plainTextToSegments, Yt as PromptArea, Z as ContextPanel, Zt as segmentsToPlainText, _ as Loader, _n as MenuSeparator, _t as ViewableImage, a as UsageDialog, an as TooltipContent, at as SHELL_KILL_GLYPH, b as ConversationScrollButton, bn as Select, bt as useFileLinks, c as TerminalTranscript, cn as DialogBody, ct as shellInfoFailed, d as Reasoning, dn as DialogHeader, dt as shellTitle, en as CodeBlock, et as TerminalSurface, f as Message, fn as DialogRow, ft as ToolTitleProvider, g as SessionEmptyState, gn as MenuItem, gt as ImageViewerProvider, h as TerminalItemView, hn as MenuContent, ht as ImageViewer, i as SessionPanel, in as Tip, it as SHELL_GLYPH, j as Response, jn as Button, jt as useAffordances, k as parseUserQuestions, kn as Badge, kt as CopyAction, l as Transcript, ln as DialogClose, lt as shellInfoLabel, m as FileCard, mn as Menu, mt as TerminalMarkdown, n as usePathLinks, nn as CopyButton, nt as useShellActions, o as UsageMeters, on as TooltipProvider, ot as shellAgentWriteLabel, p as MessageContent, pn as DialogTrigger, pt as useToolTitle, q as useMcpPanel, qt as mentionTrigger, r as matchPath, rn as copyText, rt as SHELL_AGENT_WRITE_NOTE, s as useMinuteClock, sn as Dialog, st as shellGrantable, t as resolveAgainstCwd, tn as Spinner, tt as ShellActionsProvider, u as ToolCallCard, un as DialogContent, ut as shellInfoStatusText, v as Conversation, vn as MenuTrigger, vt as useOpenImage, w as SessionInfoPanel, wn as SelectTrigger, wt as Band, x as StatusBar, xn as SelectContent, xt as parseFileLink, y as ConversationContent, yn as OptionSelect, yt as FileLinkProvider, z as permissionModeMeta, zt as matchClientCommand } from "./use-path-links-WCsysQPy.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
|
-
import { Anchor, ArrowRight, Atom, Beaker, BellRing, Bike, Binary, Blocks, Bot, Box, Brain, Briefcase, Brush, Bug, Building2, Cable, Camera, Car, Cat, Check, ChevronDown, Circle, CircleAlert, CircleSlash, CircuitBoard, Cloud, Code, Coffee, Cog, Compass, Container, Cpu, CreditCard, Database, Diamond, Dog, Eraser, Feather, Film, Filter, Flame, FlaskConical, Folder, FolderOpen, 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";
|
|
5
|
+
import { Anchor, ArrowRight, Atom, Beaker, BedDouble, BellRing, Bike, Binary, Blocks, Bot, Box, Brain, Briefcase, Brush, Bug, Building2, Cable, Camera, Car, Cat, Check, ChevronDown, Circle, CircleAlert, CircleSlash, CircuitBoard, Cloud, Code, Coffee, Cog, Compass, Container, Cpu, CreditCard, Database, Diamond, Dog, Eraser, Feather, Film, Filter, Flame, FlaskConical, Folder, FolderOpen, Gamepad2, Gauge, Gem, Ghost, Gift, GitBranch, Globe, GraduationCap, GripVertical, 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, Plus, 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 { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
8
8
|
import { Toaster as Toaster$1, toast } from "sonner";
|
|
9
|
-
import { STATE_LABELS, STATE_ORDER, adaptersOf, clearFilters, displayCustomized, displayedTasks, facetFilterCount, filterRows, groupRows, hasFacetFilter, isAgentRecord, projectLabel, projectName, projectSubpath, projectsOf, scopeActive, sessionLabel, subagentLabel, subsetSummary, taskSummary, visibleShells, visibleSubagents, visibleTasks } from "@workerdeck/protocol";
|
|
9
|
+
import { STATE_LABELS, STATE_ORDER, adaptersOf, addCustomGroup, clearFilters, displayCustomized, displayedTasks, facetFilterCount, filterRows, groupRows, hasFacetFilter, isAgentRecord, moveCustomGroup, moveToCustomGroup, newCustomGroupId, projectLabel, projectName, projectSubpath, projectsOf, removeCustomGroup, renameCustomGroup, scopeActive, sessionKey, sessionLabel, subagentLabel, subsetSummary, taskSummary, visibleShells, visibleSubagents, visibleTasks } from "@workerdeck/protocol";
|
|
10
10
|
//#region src/components/ui/Card.tsx
|
|
11
11
|
function Card({ className, ...props }) {
|
|
12
12
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -632,14 +632,14 @@ function SessionFilters({ config, onConfigChange, rows, scope, gateways: gateway
|
|
|
632
632
|
value: "adapter",
|
|
633
633
|
label: "By engine"
|
|
634
634
|
},
|
|
635
|
-
|
|
635
|
+
{
|
|
636
636
|
value: "project",
|
|
637
|
-
label: "By project"
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
value: "
|
|
641
|
-
label: "
|
|
642
|
-
}
|
|
637
|
+
label: gateways.length > 1 ? "By gateway & project" : "By project"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
value: "custom",
|
|
641
|
+
label: "Custom"
|
|
642
|
+
}
|
|
643
643
|
],
|
|
644
644
|
onChange: (groupBy) => set({ groupBy })
|
|
645
645
|
})
|
|
@@ -1097,6 +1097,8 @@ function SessionItem({ row, active = false, activeStepKey, showGateway, showProj
|
|
|
1097
1097
|
return /* @__PURE__ */ jsxs("div", {
|
|
1098
1098
|
"data-slot": "session-item",
|
|
1099
1099
|
"data-active": active || void 0,
|
|
1100
|
+
"data-asleep": info.engineAsleep || void 0,
|
|
1101
|
+
title: info.engineAsleep ? "Asleep, wakes on your next message" : void 0,
|
|
1100
1102
|
role: "button",
|
|
1101
1103
|
tabIndex: 0,
|
|
1102
1104
|
onClick: (e) => {
|
|
@@ -1120,7 +1122,7 @@ function SessionItem({ row, active = false, activeStepKey, showGateway, showProj
|
|
|
1120
1122
|
},
|
|
1121
1123
|
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", holdsOpenStep ? "bg-row-selected-weak" : active ? "bg-row-selected" : "hover:bg-row-hover", className),
|
|
1122
1124
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
1123
|
-
className: "flex flex-col gap-1 py-0.5 pr-0.5 pl-1.5",
|
|
1125
|
+
className: cn("flex flex-col gap-1 py-0.5 pr-0.5 pl-1.5", info.engineAsleep && "opacity-60"),
|
|
1124
1126
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
1125
1127
|
className: "flex h-5 items-center gap-1.5 overflow-hidden",
|
|
1126
1128
|
children: [
|
|
@@ -1224,23 +1226,250 @@ function NameEditor({ initial, onCommit, onCancel }) {
|
|
|
1224
1226
|
});
|
|
1225
1227
|
}
|
|
1226
1228
|
//#endregion
|
|
1229
|
+
//#region src/components/agent/SessionGroups.tsx
|
|
1230
|
+
function useGroupDrag(groups, onChange) {
|
|
1231
|
+
const [item, setItem] = useState();
|
|
1232
|
+
const [over, setOver] = useState();
|
|
1233
|
+
const end = () => {
|
|
1234
|
+
setItem(void 0);
|
|
1235
|
+
setOver(void 0);
|
|
1236
|
+
};
|
|
1237
|
+
const start = (e, next) => {
|
|
1238
|
+
e.stopPropagation();
|
|
1239
|
+
e.dataTransfer.effectAllowed = "move";
|
|
1240
|
+
e.dataTransfer.setData("text/plain", next.kind === "session" ? next.key : next.id);
|
|
1241
|
+
setItem(next);
|
|
1242
|
+
};
|
|
1243
|
+
const accept = (e, spot) => {
|
|
1244
|
+
e.preventDefault();
|
|
1245
|
+
e.stopPropagation();
|
|
1246
|
+
e.dataTransfer.dropEffect = "move";
|
|
1247
|
+
setOver(spot);
|
|
1248
|
+
};
|
|
1249
|
+
function session(key, group) {
|
|
1250
|
+
return {
|
|
1251
|
+
draggable: true,
|
|
1252
|
+
onDragStart: (e) => start(e, {
|
|
1253
|
+
kind: "session",
|
|
1254
|
+
key
|
|
1255
|
+
}),
|
|
1256
|
+
onDragEnd: end,
|
|
1257
|
+
onDragOver: (e) => {
|
|
1258
|
+
if (item?.kind === "session") accept(e, `row:${key}`);
|
|
1259
|
+
},
|
|
1260
|
+
onDrop: (e) => {
|
|
1261
|
+
if (item?.kind !== "session") return;
|
|
1262
|
+
e.preventDefault();
|
|
1263
|
+
e.stopPropagation();
|
|
1264
|
+
if (item.key !== key) onChange(moveToCustomGroup(groups, item.key, group.custom, group.custom ? key : void 0));
|
|
1265
|
+
end();
|
|
1266
|
+
}
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
function container(group) {
|
|
1270
|
+
return {
|
|
1271
|
+
onDragOver: (e) => {
|
|
1272
|
+
if (item) accept(e, `group:${group.key}`);
|
|
1273
|
+
},
|
|
1274
|
+
onDrop: (e) => {
|
|
1275
|
+
e.preventDefault();
|
|
1276
|
+
if (item?.kind === "session") onChange(moveToCustomGroup(groups, item.key, group.custom));
|
|
1277
|
+
else if (item?.kind === "group") onChange(moveCustomGroup(groups, item.id, group.custom));
|
|
1278
|
+
end();
|
|
1279
|
+
}
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
function header(group) {
|
|
1283
|
+
const id = group.custom;
|
|
1284
|
+
if (id === void 0) return {};
|
|
1285
|
+
return {
|
|
1286
|
+
draggable: true,
|
|
1287
|
+
onDragStart: (e) => start(e, {
|
|
1288
|
+
kind: "group",
|
|
1289
|
+
id
|
|
1290
|
+
}),
|
|
1291
|
+
onDragEnd: end
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1294
|
+
return {
|
|
1295
|
+
dragging: item !== void 0,
|
|
1296
|
+
isOver: (spot) => over === spot,
|
|
1297
|
+
session,
|
|
1298
|
+
container,
|
|
1299
|
+
header,
|
|
1300
|
+
create: (name = "New group") => {
|
|
1301
|
+
const id = newCustomGroupId();
|
|
1302
|
+
onChange(addCustomGroup(groups, name, id));
|
|
1303
|
+
return id;
|
|
1304
|
+
},
|
|
1305
|
+
rename: (id, name) => onChange(renameCustomGroup(groups, id, name)),
|
|
1306
|
+
remove: (id) => onChange(removeCustomGroup(groups, id))
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
function CustomGroupHeader({ group, editing, onEditingChange, onRename, onRemove, dragProps }) {
|
|
1310
|
+
if (editing) return /* @__PURE__ */ jsx(GroupNameInput, {
|
|
1311
|
+
initial: group.label ?? "",
|
|
1312
|
+
onRename,
|
|
1313
|
+
onDone: () => onEditingChange(false)
|
|
1314
|
+
});
|
|
1315
|
+
const custom = group.custom !== void 0;
|
|
1316
|
+
return /* @__PURE__ */ jsx(GroupHeading, {
|
|
1317
|
+
...dragProps,
|
|
1318
|
+
label: group.label ?? "",
|
|
1319
|
+
count: group.rows.length,
|
|
1320
|
+
className: cn("group/heading", custom && "cursor-grab"),
|
|
1321
|
+
onDoubleClick: custom ? () => onEditingChange(true) : void 0,
|
|
1322
|
+
leading: custom ? /* @__PURE__ */ jsx(GripVertical, { className: "-ml-1.5 size-3 opacity-0 group-hover/heading:opacity-60" }) : void 0,
|
|
1323
|
+
actions: custom ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(HeadingAction, {
|
|
1324
|
+
label: "Rename group",
|
|
1325
|
+
onClick: () => onEditingChange(true),
|
|
1326
|
+
children: /* @__PURE__ */ jsx(Pencil, { className: "size-3" })
|
|
1327
|
+
}), /* @__PURE__ */ jsx(HeadingAction, {
|
|
1328
|
+
label: "Delete group",
|
|
1329
|
+
title: "Delete the group - its sessions move to Ungrouped",
|
|
1330
|
+
onClick: onRemove,
|
|
1331
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "size-3" })
|
|
1332
|
+
})] }) : void 0
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
function GroupNameInput({ initial, onRename, onDone }) {
|
|
1336
|
+
const [draft, setDraft] = useState(initial);
|
|
1337
|
+
const commit = () => {
|
|
1338
|
+
const name = draft.trim();
|
|
1339
|
+
if (name && name !== initial) onRename(name);
|
|
1340
|
+
onDone();
|
|
1341
|
+
};
|
|
1342
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1343
|
+
className: "px-2",
|
|
1344
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
1345
|
+
autoFocus: true,
|
|
1346
|
+
"aria-label": "Group name",
|
|
1347
|
+
value: draft,
|
|
1348
|
+
onFocus: (e) => e.currentTarget.select(),
|
|
1349
|
+
onChange: (e) => setDraft(e.target.value),
|
|
1350
|
+
onBlur: commit,
|
|
1351
|
+
onKeyDown: (e) => {
|
|
1352
|
+
if (e.key === "Enter") commit();
|
|
1353
|
+
else if (e.key === "Escape") {
|
|
1354
|
+
e.stopPropagation();
|
|
1355
|
+
onDone();
|
|
1356
|
+
}
|
|
1357
|
+
},
|
|
1358
|
+
className: "h-6 text-label"
|
|
1359
|
+
})
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
function GroupHeading({ label, count, leading, actions, className, ...rest }) {
|
|
1363
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1364
|
+
...rest,
|
|
1365
|
+
className: cn("group/heading flex min-h-5 items-center gap-2 px-2 text-label font-medium text-fg-4", className),
|
|
1366
|
+
children: [
|
|
1367
|
+
leading,
|
|
1368
|
+
/* @__PURE__ */ jsx("span", {
|
|
1369
|
+
className: "min-w-0 truncate uppercase tracking-wide",
|
|
1370
|
+
children: label
|
|
1371
|
+
}),
|
|
1372
|
+
/* @__PURE__ */ jsx("span", {
|
|
1373
|
+
className: "text-fg-4/70",
|
|
1374
|
+
children: count
|
|
1375
|
+
}),
|
|
1376
|
+
actions ? /* @__PURE__ */ jsx("span", {
|
|
1377
|
+
className: "ml-auto flex items-center gap-0.5 opacity-0 transition-opacity group-hover/heading:opacity-100 focus-within:opacity-100",
|
|
1378
|
+
children: actions
|
|
1379
|
+
}) : null
|
|
1380
|
+
]
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
function HeadingAction({ label, title, onClick, children }) {
|
|
1384
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
1385
|
+
variant: "ghost",
|
|
1386
|
+
size: "icon-sm",
|
|
1387
|
+
"aria-label": label,
|
|
1388
|
+
title: title ?? label,
|
|
1389
|
+
className: "size-5 text-fg-3",
|
|
1390
|
+
onClick: (e) => {
|
|
1391
|
+
e.stopPropagation();
|
|
1392
|
+
onClick();
|
|
1393
|
+
},
|
|
1394
|
+
children
|
|
1395
|
+
});
|
|
1396
|
+
}
|
|
1397
|
+
function NewGroupButton({ onClick }) {
|
|
1398
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
1399
|
+
variant: "ghost",
|
|
1400
|
+
size: "xs",
|
|
1401
|
+
className: "mx-1 self-start text-fg-3",
|
|
1402
|
+
onClick,
|
|
1403
|
+
children: [/* @__PURE__ */ jsx(Plus, {}), "New group"]
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
//#endregion
|
|
1227
1407
|
//#region src/components/agent/SessionBrowser.tsx
|
|
1228
1408
|
function rowShapeClass(active) {
|
|
1229
1409
|
return cn("px-2 py-1.5 hover:bg-row-hover", active ? "mr-1 ml-0 rounded-r-md border-l-4 border-l-accent" : "mx-1 rounded-md");
|
|
1230
1410
|
}
|
|
1231
|
-
function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeSubagentId, activeShellId, now, isActive = (row) => row.info.id === activeId, rowActions, gatewayCount, showSubset = true, onSelect, onDelete, onRename, onClearContext, onSelectSubagent, onSelectTask, onStopTask, onSelectShell, onKillShell, onShellAgentWrite, emptyState, showControls = true, showSearch = showControls, autoFocusSearch, projectIcons, className }) {
|
|
1411
|
+
function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeSubagentId, activeShellId, now, isActive = (row) => row.info.id === activeId, rowActions, gatewayCount, showSubset = true, onSelect, onDelete, onRename, onClearContext, onSleep, onSelectSubagent, onSelectTask, onStopTask, onSelectShell, onKillShell, onShellAgentWrite, onCreateInGroup, emptyState, showControls = true, showSearch = showControls, autoFocusSearch, projectIcons, className }) {
|
|
1412
|
+
const rowGateways = useMemo(() => new Set(rows.map((row) => row.hostId)).size, [rows]);
|
|
1413
|
+
const gateways = gatewayCount ?? rowGateways;
|
|
1232
1414
|
const visible = useMemo(() => filterRows(rows, config, scope), [
|
|
1233
1415
|
rows,
|
|
1234
1416
|
config,
|
|
1235
1417
|
scope
|
|
1236
1418
|
]);
|
|
1237
|
-
const groups = useMemo(() => groupRows(visible, config), [
|
|
1419
|
+
const groups = useMemo(() => groupRows(visible, config, { gatewayCount: gateways }), [
|
|
1420
|
+
visible,
|
|
1421
|
+
config,
|
|
1422
|
+
gateways
|
|
1423
|
+
]);
|
|
1238
1424
|
const subset = subsetSummary(config, scope, visible.length, rows.length);
|
|
1239
|
-
const
|
|
1425
|
+
const custom = config.groupBy === "custom";
|
|
1426
|
+
const [editingGroup, setEditingGroup] = useState();
|
|
1240
1427
|
const set = (patch) => onConfigChange({
|
|
1241
1428
|
...config,
|
|
1242
1429
|
...patch
|
|
1243
1430
|
});
|
|
1431
|
+
const drag = useGroupDrag(config.customGroups ?? [], (customGroups) => set({ customGroups }));
|
|
1432
|
+
const heading = (group) => {
|
|
1433
|
+
if (custom) return /* @__PURE__ */ jsx(CustomGroupHeader, {
|
|
1434
|
+
group,
|
|
1435
|
+
editing: group.custom !== void 0 && editingGroup === group.custom,
|
|
1436
|
+
onEditingChange: (editing) => setEditingGroup(editing ? group.custom : void 0),
|
|
1437
|
+
onRename: (name) => group.custom && drag.rename(group.custom, name),
|
|
1438
|
+
onRemove: () => group.custom && drag.remove(group.custom),
|
|
1439
|
+
dragProps: drag.header(group)
|
|
1440
|
+
});
|
|
1441
|
+
if (config.groupBy === "none" || !group.label) return null;
|
|
1442
|
+
const project = config.groupBy === "project";
|
|
1443
|
+
const target = project && group.hostId ? {
|
|
1444
|
+
hostId: group.hostId,
|
|
1445
|
+
cwd: group.cwd
|
|
1446
|
+
} : void 0;
|
|
1447
|
+
return /* @__PURE__ */ jsx(GroupHeading, {
|
|
1448
|
+
label: group.gateway && group.project ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1449
|
+
group.gateway,
|
|
1450
|
+
/* @__PURE__ */ jsx("span", {
|
|
1451
|
+
"aria-hidden": true,
|
|
1452
|
+
children: " · "
|
|
1453
|
+
}),
|
|
1454
|
+
/* @__PURE__ */ jsx("span", {
|
|
1455
|
+
className: "text-fg-1",
|
|
1456
|
+
children: group.project
|
|
1457
|
+
})
|
|
1458
|
+
] }) : group.label,
|
|
1459
|
+
count: group.rows.length,
|
|
1460
|
+
title: project && group.cwd ? group.cwd : void 0,
|
|
1461
|
+
leading: project ? /* @__PURE__ */ jsx(ProjectIcon, {
|
|
1462
|
+
icon: group.rows[0]?.info.project?.icon,
|
|
1463
|
+
src: iconSrcOf(group.rows[0], projectIcons),
|
|
1464
|
+
name: group.label
|
|
1465
|
+
}) : void 0,
|
|
1466
|
+
actions: target && onCreateInGroup ? /* @__PURE__ */ jsx(HeadingAction, {
|
|
1467
|
+
label: `New session in ${group.label}`,
|
|
1468
|
+
onClick: () => onCreateInGroup(target),
|
|
1469
|
+
children: /* @__PURE__ */ jsx(Plus, { className: "size-3" })
|
|
1470
|
+
}) : void 0
|
|
1471
|
+
});
|
|
1472
|
+
};
|
|
1244
1473
|
return /* @__PURE__ */ jsxs("div", {
|
|
1245
1474
|
"data-slot": "session-browser",
|
|
1246
1475
|
className: cn("flex flex-col gap-3", className),
|
|
@@ -1291,52 +1520,46 @@ function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeS
|
|
|
1291
1520
|
icon: /* @__PURE__ */ jsx(Layers, {}),
|
|
1292
1521
|
title: "Nothing here",
|
|
1293
1522
|
description: "No session to show."
|
|
1294
|
-
}) : /* @__PURE__ */
|
|
1523
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
1295
1524
|
className: "flex flex-col gap-4 px-1",
|
|
1296
|
-
children: groups.map((group) => /* @__PURE__ */ jsxs("div", {
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
onStopTask,
|
|
1335
|
-
onSelectShell,
|
|
1336
|
-
onKillShell,
|
|
1337
|
-
onShellAgentWrite
|
|
1338
|
-
}, `${row.hostId}:${row.info.id}`))]
|
|
1339
|
-
}, group.key))
|
|
1525
|
+
children: [groups.map((group) => /* @__PURE__ */ jsxs("div", {
|
|
1526
|
+
...custom ? drag.container(group) : {},
|
|
1527
|
+
className: cn("flex flex-col gap-1 rounded-md", custom && drag.isOver(`group:${group.key}`) && "bg-row-hover/50"),
|
|
1528
|
+
children: [
|
|
1529
|
+
heading(group),
|
|
1530
|
+
custom && group.custom !== void 0 && group.rows.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
1531
|
+
className: "mx-1 rounded-md border border-dashed border-border px-2 py-2 text-center text-label text-fg-4",
|
|
1532
|
+
children: "Drag sessions here"
|
|
1533
|
+
}) : null,
|
|
1534
|
+
group.rows.map((row) => /* @__PURE__ */ jsx(SessionRowItem, {
|
|
1535
|
+
dragProps: custom ? drag.session(sessionKey(row), group) : void 0,
|
|
1536
|
+
dropTarget: custom && drag.isOver(`row:${sessionKey(row)}`),
|
|
1537
|
+
row,
|
|
1538
|
+
active: isActive(row),
|
|
1539
|
+
activeSubagentId,
|
|
1540
|
+
activeShellId,
|
|
1541
|
+
actions: rowActions?.(row),
|
|
1542
|
+
now,
|
|
1543
|
+
showGateway: gateways > 1 && config.groupBy !== "project",
|
|
1544
|
+
showProject: config.groupBy !== "project",
|
|
1545
|
+
subagents: config.subagents,
|
|
1546
|
+
shells: config.shells,
|
|
1547
|
+
tasks: config.tasks,
|
|
1548
|
+
projectIcons,
|
|
1549
|
+
onSelect,
|
|
1550
|
+
onDelete,
|
|
1551
|
+
onRename,
|
|
1552
|
+
onClearContext,
|
|
1553
|
+
onSleep,
|
|
1554
|
+
onSelectSubagent,
|
|
1555
|
+
onSelectTask,
|
|
1556
|
+
onStopTask,
|
|
1557
|
+
onSelectShell,
|
|
1558
|
+
onKillShell,
|
|
1559
|
+
onShellAgentWrite
|
|
1560
|
+
}, sessionKey(row)))
|
|
1561
|
+
]
|
|
1562
|
+
}, group.key)), custom ? /* @__PURE__ */ jsx(NewGroupButton, { onClick: () => setEditingGroup(drag.create()) }) : null]
|
|
1340
1563
|
})
|
|
1341
1564
|
]
|
|
1342
1565
|
});
|
|
@@ -1345,10 +1568,10 @@ function iconSrcOf(row, icons) {
|
|
|
1345
1568
|
const icon = row?.info.project?.icon;
|
|
1346
1569
|
return icon?.type === "image" ? icons?.[icon.hash] : void 0;
|
|
1347
1570
|
}
|
|
1348
|
-
function SessionRowItem({ row, active, actions, activeSubagentId, activeShellId, now, showGateway, showProject = true, subagents, shells, tasks, projectIcons, onSelect, onDelete, onRename, onClearContext, onSelectSubagent, onSelectTask, onStopTask, onSelectShell, onKillShell, onShellAgentWrite }) {
|
|
1571
|
+
function SessionRowItem({ row, dragProps, dropTarget, active, actions, activeSubagentId, activeShellId, now, showGateway, showProject = true, subagents, shells, tasks, projectIcons, onSelect, onDelete, onRename, onClearContext, onSleep, onSelectSubagent, onSelectTask, onStopTask, onSelectShell, onKillShell, onShellAgentWrite }) {
|
|
1349
1572
|
const { info } = row;
|
|
1350
1573
|
const [editing, setEditing] = useState(false);
|
|
1351
|
-
|
|
1574
|
+
const item = /* @__PURE__ */ jsx(SessionItem, {
|
|
1352
1575
|
row,
|
|
1353
1576
|
active: active === true,
|
|
1354
1577
|
activeStepKey: active ? activeShellId ?? activeSubagentId : void 0,
|
|
@@ -1382,6 +1605,12 @@ function SessionRowItem({ row, active, actions, activeSubagentId, activeShellId,
|
|
|
1382
1605
|
onClick: () => onClearContext(row),
|
|
1383
1606
|
children: /* @__PURE__ */ jsx(Eraser, { className: "size-3 text-fg-3" })
|
|
1384
1607
|
}) : null,
|
|
1608
|
+
onSleep && info.capabilities?.engineSleep && info.status === "idle" && !info.engineAsleep ? /* @__PURE__ */ jsx(RowAction, {
|
|
1609
|
+
label: "Sleep session",
|
|
1610
|
+
title: "Stop the engine process to free its memory - the session stays here and wakes on your next message",
|
|
1611
|
+
onClick: () => onSleep(row),
|
|
1612
|
+
children: /* @__PURE__ */ jsx(BedDouble, { className: "size-3 text-fg-3" })
|
|
1613
|
+
}) : null,
|
|
1385
1614
|
onDelete ? /* @__PURE__ */ jsx(RowAction, {
|
|
1386
1615
|
label: "Close session",
|
|
1387
1616
|
onClick: () => onDelete(row),
|
|
@@ -1389,6 +1618,12 @@ function SessionRowItem({ row, active, actions, activeSubagentId, activeShellId,
|
|
|
1389
1618
|
}) : null
|
|
1390
1619
|
] })
|
|
1391
1620
|
});
|
|
1621
|
+
if (!dragProps) return item;
|
|
1622
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1623
|
+
...dragProps,
|
|
1624
|
+
className: cn("rounded-md", dropTarget && "shadow-[inset_0_2px_0_0_var(--color-accent)]"),
|
|
1625
|
+
children: item
|
|
1626
|
+
});
|
|
1392
1627
|
}
|
|
1393
1628
|
function RowAction({ label, title, onClick, children }) {
|
|
1394
1629
|
return /* @__PURE__ */ jsx(Button, {
|
|
@@ -1509,6 +1744,6 @@ function SubagentToggle({ value, onChange, className }) {
|
|
|
1509
1744
|
})] });
|
|
1510
1745
|
}
|
|
1511
1746
|
//#endregion
|
|
1512
|
-
export { AgentWriteIcon, AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger, Badge, Band, Blank, Button, Card, CardContent, CardHeader, CardTitle, CodeBlock, Composer, ContextDialog, ContextPanel, ContextRing, Conversation, ConversationContent, ConversationScrollButton, CopyAction, CopyButton, Dialog, DialogBody, DialogClose, DialogContent, DialogHeader, DialogRow, DialogTrigger, Empty, EmptyKey, EngineIcon, FileCard, FileLinkProvider, HostFilesDialog, ImageViewer, ImageViewerProvider, Ink, Input, Loader, McpDialog, McpPanel, McpPanelActions, Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger, Message, MessageContent, ModelSelect, OptionSelect, PERMISSION_MODES, PermissionModeSelect, PermissionPrompt, Popover, PopoverContent, PopoverTrigger, ProgressRing, ProjectIcon, PromptArea, PromptTokenText, QUESTION_BEHAVIORS, QuestionPrompt, Reasoning, Response, Row, SHELL_AGENT_WRITE_NOTE, SHELL_GLYPH, SHELL_KILL_GLYPH, STATUS_META, STEP_DISPLAY_OPTIONS, SUBAGENT_DISPLAY_META, SUBAGENT_DISPLAY_ORDER, Select, SelectContent, SelectItem, SelectItemText, SelectTrigger, SelectValue, SessionBrowser, SessionEmptyState, SessionFilters, SessionFiltersButton, SessionInfoDialog, SessionInfoPanel, SessionItem, SessionList, SessionListItem, SessionNamesProvider, SessionPanel, SessionSearch, SessionStatusIcon, ShellActionsProvider, ShellStrip, SkillNamesProvider, SkillsDialog, Spinner, Splitter, StatusBar, StepDisplayControl, StepRow, SubagentDisplayIcon, SubagentStrip, SubagentToggle, TaskList, TasksDialog, TerminalDiff, TerminalItemView, TerminalMarkdown, TerminalPermissionPrompt, TerminalQuestionPrompt, TerminalStatusLine, TerminalSurface, TerminalTranscript, Textarea, Tip, Toaster, ToolCallCard, ToolTitleProvider, TooltipContent, TooltipProvider, Transcript, TranscriptVariantProvider, UsageDialog, UsageMeters, ViewableImage, 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, rankPeerSessions, rateLimitWindowSeconds, resolveAgainstCwd, rowShapeClass, segmentsToPlainText, sessionSteps, shellAgentWriteLabel, shellGrantable, shellInfoFailed, shellInfoLabel, shellInfoStatusText, shellTitle, skillPrompt, toast, toolIcon, toolInputPreview, useAffordances, useFileLinks, useMcpPanel, useMinuteClock, useOpenImage, usePathLinks, usePromptAreaState, useShellActions, useShellFrame, useToolTitle, useTranscriptVariant, vendorMarkClass, vendorTextClass };
|
|
1747
|
+
export { AgentWriteIcon, AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger, Badge, Band, Blank, Button, Card, CardContent, CardHeader, CardTitle, CodeBlock, Composer, ContextDialog, ContextPanel, ContextRing, Conversation, ConversationContent, ConversationScrollButton, CopyAction, CopyButton, Dialog, DialogBody, DialogClose, DialogContent, DialogHeader, DialogRow, DialogTrigger, EffortSelect, Empty, EmptyKey, EngineIcon, FileCard, FileLinkProvider, HostFilesDialog, ImageViewer, ImageViewerProvider, Ink, Input, Loader, McpDialog, McpPanel, McpPanelActions, Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger, Message, MessageContent, ModelSelect, OptionSelect, PERMISSION_MODES, PermissionModeSelect, PermissionPrompt, Popover, PopoverContent, PopoverTrigger, ProgressRing, ProjectIcon, PromptArea, PromptTokenText, QUESTION_BEHAVIORS, QuestionPrompt, Reasoning, Response, Row, SHELL_AGENT_WRITE_NOTE, SHELL_GLYPH, SHELL_KILL_GLYPH, STATUS_META, STEP_DISPLAY_OPTIONS, SUBAGENT_DISPLAY_META, SUBAGENT_DISPLAY_ORDER, Select, SelectContent, SelectItem, SelectItemText, SelectTrigger, SelectValue, SessionBrowser, SessionEmptyState, SessionFilters, SessionFiltersButton, SessionInfoDialog, SessionInfoPanel, SessionItem, SessionList, SessionListItem, SessionNamesProvider, SessionPanel, SessionSearch, SessionStatusIcon, ShellActionsProvider, ShellStrip, SkillNamesProvider, SkillsDialog, Spinner, Splitter, StatusBar, StepDisplayControl, StepRow, SubagentDisplayIcon, SubagentStrip, SubagentToggle, TaskList, TasksDialog, TerminalDiff, TerminalItemView, TerminalMarkdown, TerminalPermissionPrompt, TerminalQuestionPrompt, TerminalStatusLine, TerminalSurface, TerminalTranscript, Textarea, Tip, Toaster, ToolCallCard, ToolTitleProvider, TooltipContent, TooltipProvider, Transcript, TranscriptVariantProvider, UsageDialog, UsageMeters, ViewableImage, WithActions, badgeVariants, buttonVariants, cn, commandTrigger, copyText, effortChoices, 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, rankPeerSessions, rateLimitWindowSeconds, resolveAgainstCwd, rowShapeClass, segmentsToPlainText, sessionSteps, shellAgentWriteLabel, shellGrantable, shellInfoFailed, shellInfoLabel, shellInfoStatusText, shellTitle, skillPrompt, toast, toolIcon, toolInputPreview, useAffordances, useFileLinks, useMcpPanel, useMinuteClock, useOpenImage, usePathLinks, usePromptAreaState, useShellActions, useShellFrame, useToolTitle, useTranscriptVariant, vendorMarkClass, vendorTextClass };
|
|
1513
1748
|
|
|
1514
1749
|
//# sourceMappingURL=index.mjs.map
|