@workerdeck/ui 1.4.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/build/{SessionPanel-DQp2oStr.mjs → SessionPanel-DrMj8Yv0.mjs} +150 -106
- package/build/SessionPanel-DrMj8Yv0.mjs.map +1 -0
- package/build/{SessionPanel-BSwUJDwg.d.mts → SessionPanel-My98j9RZ.d.mts} +6 -5
- package/build/index.d.mts +32 -31
- package/build/index.mjs +24 -41
- package/build/index.mjs.map +1 -1
- package/build/scoped.css +7 -4
- package/build/workspace.d.mts +3 -3
- package/build/workspace.mjs +3 -3
- package/build/workspace.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/agent/SessionBrowser.tsx +0 -6
- package/src/components/agent/SessionItem.tsx +2 -9
- package/src/components/agent/SessionPanel.tsx +34 -11
- package/src/components/agent/SessionSteps.tsx +18 -32
- package/src/components/agent/SessionWorkspace.tsx +3 -3
- package/src/components/agent/StatusBar.tsx +14 -1
- package/src/components/agent/TaskList.tsx +89 -0
- package/src/components/agent/TasksDialog.tsx +46 -0
- package/src/components/terminal/todos.ts +7 -38
- package/src/index.ts +2 -1
- package/build/SessionPanel-DQp2oStr.mjs.map +0 -1
- package/src/components/agent/held-sends.tsx +0 -73
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { LucideIcon } from "lucide-react";
|
|
3
|
-
import { ModelOption, PermissionMode, SkillInfo } from "@workerdeck/protocol";
|
|
3
|
+
import { ModelOption, PermissionMode, SessionTask, SkillInfo, 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/PermissionModeSelect.d.ts
|
|
@@ -95,10 +95,10 @@ interface SessionPanelProps {
|
|
|
95
95
|
nonce: number;
|
|
96
96
|
};
|
|
97
97
|
onSubagentChange?: (toolUseId: string | undefined) => void;
|
|
98
|
+
subagents?: SubagentInfo[];
|
|
98
99
|
stickyPrompt?: boolean;
|
|
99
100
|
transcriptDensity?: TranscriptDensity;
|
|
100
101
|
transcriptFont?: TranscriptFont;
|
|
101
|
-
midTurnSend?: 'fold' | 'hold';
|
|
102
102
|
controlsSurface?: 'internal' | 'external' | 'status';
|
|
103
103
|
onControls?: (controls: SessionControls | undefined) => void;
|
|
104
104
|
focusComposerOnClick?: boolean;
|
|
@@ -122,7 +122,7 @@ type SessionControls = {
|
|
|
122
122
|
focusComposer: () => void;
|
|
123
123
|
insertComposerText: (text: string) => void;
|
|
124
124
|
};
|
|
125
|
-
type SessionSurfacePanel = 'info' | 'context' | 'usage' | 'mcp' | 'files' | 'skills';
|
|
125
|
+
type SessionSurfacePanel = 'info' | 'context' | 'usage' | 'mcp' | 'files' | 'skills' | 'tasks';
|
|
126
126
|
type SessionVitals = {
|
|
127
127
|
status: TranscriptState['status'];
|
|
128
128
|
connection: ConnectionState;
|
|
@@ -135,12 +135,13 @@ type SessionVitals = {
|
|
|
135
135
|
skills: SkillInfo[] | undefined;
|
|
136
136
|
cwd: TranscriptState['cwd'];
|
|
137
137
|
contextUsage: TranscriptState['contextUsage'];
|
|
138
|
+
tasks: SessionTask[];
|
|
138
139
|
rateLimits: TranscriptState['rateLimits'];
|
|
139
140
|
rateLimitsUpdatedAt: number | undefined;
|
|
140
141
|
itemCount: number;
|
|
141
142
|
totalCostUsd: number;
|
|
142
143
|
};
|
|
143
|
-
declare function SessionPanel({ client, sessionId, header, panelSurface, statusSurface, statusPlacement, onOpenPanel, onVitals, transcriptVariant, transcriptDensity, transcriptFont,
|
|
144
|
+
declare function SessionPanel({ client, sessionId, header, panelSurface, statusSurface, statusPlacement, onOpenPanel, onVitals, transcriptVariant, transcriptDensity, transcriptFont, affordances, terminalMetrics, scrubber, bookmarks, onToggleBookmark, reveal, subagents, openSubagent, onSubagentChange, stickyPrompt, controlsSurface, onControls, focusComposerOnClick, unseen, readOnly, toolHost, clientTools, cacheTranscript, emptyState, onLinkClick, fontSize, className }: SessionPanelProps): import("react").JSX.Element;
|
|
144
145
|
//#endregion
|
|
145
146
|
export { permissionModeChoices as C, PermissionModeSelectProps as S, useAffordances as _, SessionVitals as a, PermissionModeMeta as b, TranscriptDensityProvider as c, TranscriptVariantProvider as d, useTranscriptDensity as f, WithActions as g, TerminalAffordances as h, SessionSurfacePanel as i, TranscriptFont as l, CopyAction as m, SessionPanel as n, TerminalMetrics as o, useTranscriptVariant as p, SessionPanelProps as r, TranscriptDensity as s, SessionControls as t, TranscriptVariant as u, PERMISSION_MODES as v, permissionModeMeta as w, PermissionModeSelect as x, PermissionModeChoice as y };
|
|
146
|
-
//# sourceMappingURL=SessionPanel-
|
|
147
|
+
//# sourceMappingURL=SessionPanel-My98j9RZ.d.mts.map
|
package/build/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as formatCountdown, c as formatRateLimitWindowLong, d as friendlyModel, f as rateLimitWindowSeconds, i as formatCost, l as formatRelativeTime, n as formatAgoPrecise, o as formatDuration, p as toolInputPreview, r as formatBytes, s as formatRateLimitWindow, u as formatTokens } from "./format-TVRJzYUj.mjs";
|
|
2
|
-
import { C as permissionModeChoices, S as PermissionModeSelectProps, _ as useAffordances, a as SessionVitals, b as PermissionModeMeta, c as TranscriptDensityProvider, d as TranscriptVariantProvider, f as useTranscriptDensity, g as WithActions, h as TerminalAffordances, i as SessionSurfacePanel, l as TranscriptFont, m as CopyAction, n as SessionPanel, o as TerminalMetrics, p as useTranscriptVariant, r as SessionPanelProps, s as TranscriptDensity, t as SessionControls, u as TranscriptVariant, v as PERMISSION_MODES, w as permissionModeMeta, x as PermissionModeSelect, y as PermissionModeChoice } from "./SessionPanel-
|
|
2
|
+
import { C as permissionModeChoices, S as PermissionModeSelectProps, _ as useAffordances, a as SessionVitals, b as PermissionModeMeta, c as TranscriptDensityProvider, d as TranscriptVariantProvider, f as useTranscriptDensity, g as WithActions, h as TerminalAffordances, i as SessionSurfacePanel, l as TranscriptFont, m as CopyAction, n as SessionPanel, o as TerminalMetrics, p as useTranscriptVariant, r as SessionPanelProps, s as TranscriptDensity, t as SessionControls, u as TranscriptVariant, v as PERMISSION_MODES, w as permissionModeMeta, x as PermissionModeSelect, y as PermissionModeChoice } from "./SessionPanel-My98j9RZ.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";
|
|
@@ -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, SkillInfo, SlashCommandInfo, UsageWindowRow, UserQuestion, ViewConfig, WorkspaceScope } from "@workerdeck/protocol";
|
|
13
|
+
import { ContextReading, ContextUsage, FilePatch, ModelOption, PermissionRequest, ProfileEngine, ProjectIcon as ProjectIcon$1, QuestionBehavior, RateLimitInfo, SessionInfo, SessionRow, SessionStatus, SessionTask, SkillInfo, SlashCommandInfo, UsageWindowRow, UserQuestion, ViewConfig, WorkspaceScope } 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
|
|
@@ -832,26 +832,6 @@ declare function ToolTitleProvider({ value, children }: {
|
|
|
832
832
|
}): import("react").JSX.Element;
|
|
833
833
|
declare function useToolTitle(name: string): string | undefined;
|
|
834
834
|
//#endregion
|
|
835
|
-
//#region src/components/agent/held-sends.d.ts
|
|
836
|
-
type HeldSend = {
|
|
837
|
-
text: string;
|
|
838
|
-
attachmentIds: string[];
|
|
839
|
-
};
|
|
840
|
-
type HeldSends = {
|
|
841
|
-
held: HeldSend[];
|
|
842
|
-
submit: (text: string, attachmentIds: string[]) => void;
|
|
843
|
-
flush: () => void;
|
|
844
|
-
};
|
|
845
|
-
declare function useHeldSends(options: {
|
|
846
|
-
hold: boolean;
|
|
847
|
-
busy: boolean;
|
|
848
|
-
send: (text: string, attachmentIds: string[]) => void;
|
|
849
|
-
}): HeldSends;
|
|
850
|
-
declare function HeldSendsBar({ held, onSendNow }: {
|
|
851
|
-
held: HeldSend[];
|
|
852
|
-
onSendNow: () => void;
|
|
853
|
-
}): import("react").JSX.Element | null;
|
|
854
|
-
//#endregion
|
|
855
835
|
//#region src/components/agent/FileCard.d.ts
|
|
856
836
|
type FileDeliveredItem = Extract<TranscriptItem, {
|
|
857
837
|
kind: 'file_delivered';
|
|
@@ -946,12 +926,14 @@ interface StatusBarProps {
|
|
|
946
926
|
onOpenStatus?: () => void;
|
|
947
927
|
onOpenContext?: () => void;
|
|
948
928
|
onOpenUsage?: () => void;
|
|
929
|
+
tasks?: readonly SessionTask[];
|
|
930
|
+
onOpenTasks?: () => void;
|
|
949
931
|
controls?: ReactNode;
|
|
950
932
|
actions?: ReactNode;
|
|
951
933
|
placement?: 'top' | 'bottom';
|
|
952
934
|
className?: string;
|
|
953
935
|
}
|
|
954
|
-
declare function StatusBar({ state, rateLimits, connected, connection, onOpenStatus, onOpenContext, onOpenUsage, controls, actions, placement, className }: StatusBarProps): import("react").JSX.Element;
|
|
936
|
+
declare function StatusBar({ state, rateLimits, connected, connection, onOpenStatus, onOpenContext, onOpenUsage, tasks, onOpenTasks, controls, actions, placement, className }: StatusBarProps): import("react").JSX.Element;
|
|
955
937
|
//#endregion
|
|
956
938
|
//#region src/components/agent/ContextDialog.d.ts
|
|
957
939
|
interface ContextDialogProps {
|
|
@@ -976,6 +958,28 @@ interface UsageDialogProps {
|
|
|
976
958
|
}
|
|
977
959
|
declare function UsageDialog({ rateLimits, subscriptionType, engine, totalCostUsd, updatedAt, open, onOpenChange, className }: UsageDialogProps): import("react").JSX.Element;
|
|
978
960
|
//#endregion
|
|
961
|
+
//#region src/components/agent/TaskList.d.ts
|
|
962
|
+
interface TaskListProps {
|
|
963
|
+
tasks: readonly SessionTask[];
|
|
964
|
+
showCompleted: boolean;
|
|
965
|
+
onShowCompletedChange?: (showCompleted: boolean) => void;
|
|
966
|
+
onSelectTask?: (task: SessionTask) => void;
|
|
967
|
+
className?: string;
|
|
968
|
+
}
|
|
969
|
+
declare function TaskList({ tasks, showCompleted, onShowCompletedChange, onSelectTask, className }: TaskListProps): import("react").JSX.Element;
|
|
970
|
+
//#endregion
|
|
971
|
+
//#region src/components/agent/TasksDialog.d.ts
|
|
972
|
+
interface TasksDialogProps {
|
|
973
|
+
tasks: readonly SessionTask[];
|
|
974
|
+
showCompleted: boolean;
|
|
975
|
+
onShowCompletedChange: (showCompleted: boolean) => void;
|
|
976
|
+
onSelectTask?: (task: SessionTask) => void;
|
|
977
|
+
open: boolean;
|
|
978
|
+
onOpenChange: (open: boolean) => void;
|
|
979
|
+
className?: string;
|
|
980
|
+
}
|
|
981
|
+
declare function TasksDialog({ tasks, showCompleted, onShowCompletedChange, onSelectTask, open, onOpenChange, className }: TasksDialogProps): import("react").JSX.Element;
|
|
982
|
+
//#endregion
|
|
979
983
|
//#region src/components/agent/UsageMeters.d.ts
|
|
980
984
|
declare function useMinuteClock(active?: boolean): number;
|
|
981
985
|
declare function UsageMeters({ windows, now, className }: {
|
|
@@ -1062,14 +1066,13 @@ interface SessionBrowserProps {
|
|
|
1062
1066
|
onRename?: (row: SessionRow, title: string) => void;
|
|
1063
1067
|
onClearContext?: (row: SessionRow) => void;
|
|
1064
1068
|
onSelectSubagent?: (row: SessionRow, toolUseId: string) => void;
|
|
1065
|
-
onRevealStep?: (row: SessionRow, toolUseId: string) => void;
|
|
1066
1069
|
emptyState?: React.ReactNode;
|
|
1067
1070
|
showControls?: boolean;
|
|
1068
1071
|
projectIcons?: Record<string, string>;
|
|
1069
1072
|
className?: string;
|
|
1070
1073
|
}
|
|
1071
1074
|
declare function rowShapeClass(active: boolean): string;
|
|
1072
|
-
declare function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeSubagentId, onSelect, onDelete, onRename, onClearContext, onSelectSubagent,
|
|
1075
|
+
declare function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeSubagentId, onSelect, onDelete, onRename, onClearContext, onSelectSubagent, emptyState, showControls, projectIcons, className }: SessionBrowserProps): import("react").JSX.Element;
|
|
1073
1076
|
//#endregion
|
|
1074
1077
|
//#region src/components/agent/SessionItem.d.ts
|
|
1075
1078
|
interface SessionItemProps {
|
|
@@ -1083,7 +1086,6 @@ interface SessionItemProps {
|
|
|
1083
1086
|
onExpandedChange?: (expanded: boolean) => void;
|
|
1084
1087
|
onSelect?: () => void;
|
|
1085
1088
|
onSelectSubagent?: (toolUseId: string) => void;
|
|
1086
|
-
onRevealStep?: (toolUseId: string) => void;
|
|
1087
1089
|
onRename?: (title: string) => void;
|
|
1088
1090
|
renameOn?: 'doubleClick' | 'external';
|
|
1089
1091
|
editing?: boolean;
|
|
@@ -1091,7 +1093,7 @@ interface SessionItemProps {
|
|
|
1091
1093
|
actions?: ReactNode;
|
|
1092
1094
|
className?: string;
|
|
1093
1095
|
}
|
|
1094
|
-
declare function SessionItem({ row, active, activeStepKey, showGateway, showProject, projectIcons, expanded, onExpandedChange, onSelect, onSelectSubagent,
|
|
1096
|
+
declare function SessionItem({ row, active, activeStepKey, showGateway, showProject, projectIcons, expanded, onExpandedChange, onSelect, onSelectSubagent, onRename, renameOn, editing, onEditingChange, actions, className }: SessionItemProps): import("react").JSX.Element;
|
|
1095
1097
|
//#endregion
|
|
1096
1098
|
//#region src/components/agent/EngineIcon.d.ts
|
|
1097
1099
|
declare function engineMark(engine: string, model?: string): string | undefined;
|
|
@@ -1108,13 +1110,12 @@ type Step = {
|
|
|
1108
1110
|
key: string;
|
|
1109
1111
|
label: string;
|
|
1110
1112
|
noun: string;
|
|
1111
|
-
|
|
1112
|
-
state: 'done' | 'running' | 'pending' | 'failed';
|
|
1113
|
+
state: 'done' | 'running' | 'failed';
|
|
1113
1114
|
detail?: string;
|
|
1114
1115
|
title: string;
|
|
1115
1116
|
onSelect: () => void;
|
|
1116
1117
|
};
|
|
1117
|
-
declare function sessionSteps(info: SessionInfo, onSelect: (toolUseId: string
|
|
1118
|
+
declare function sessionSteps(info: SessionInfo, onSelect: (toolUseId: string) => void): Step[];
|
|
1118
1119
|
declare function runningSteps(steps: readonly Step[]): number;
|
|
1119
1120
|
declare function StepToggle({ expanded, running, total, noun, onToggle }: {
|
|
1120
1121
|
expanded: boolean;
|
|
@@ -1189,5 +1190,5 @@ declare function copyText(value: string): Promise<boolean>;
|
|
|
1189
1190
|
declare function toolIcon(toolName: string): LucideIcon;
|
|
1190
1191
|
declare function isMutatingTool(toolName: string): boolean;
|
|
1191
1192
|
//#endregion
|
|
1192
|
-
export { AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger, Badge, type BadgeProps, Band, Blank, Button, type ButtonProps, Card, CardContent, CardHeader, CardTitle, type ChipSegment, CodeBlock, type CodeBlockProps, Composer, type ComposerFileMatch, type ComposerHandle, type ComposerProps, 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,
|
|
1193
|
+
export { AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger, Badge, type BadgeProps, Band, Blank, Button, type ButtonProps, Card, CardContent, CardHeader, CardTitle, type ChipSegment, CodeBlock, type CodeBlockProps, Composer, type ComposerFileMatch, type ComposerHandle, type ComposerProps, 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, 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, mentionTrigger, parseUserQuestions, permissionModeChoices, permissionModeMeta, plainTextToSegments, previewPatch, rateLimitWindowSeconds, rowShapeClass, runningSteps, segmentsToPlainText, sessionSteps, skillPrompt, toast, toolIcon, toolInputPreview, useAffordances, useMinuteClock, usePromptAreaState, useToolTitle, useTranscriptDensity, useTranscriptVariant, vendorMarkClass, vendorTextClass };
|
|
1193
1194
|
//# sourceMappingURL=index.d.mts.map
|
package/build/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as Ink, A as
|
|
1
|
+
import { $ as Ink, A as PERMISSION_MODES, At as DialogHeader, B as TaskList, Bt as SelectItem, C as TerminalPermissionPrompt, Ct as Tip, D as SubagentStrip, Dt as DialogBody, E as parseUserQuestions, Et as Dialog, F as SkillsDialog, Ft as MenuItem, G as TerminalSurface, Gt as Input, H as contextNote, Ht as SelectTrigger, I as McpDialog, It as MenuSeparator, J as TerminalMarkdown, Jt as Button, K as ToolTitleProvider, Kt as Badge, L as HostFilesDialog, Lt as MenuTrigger, M as permissionModeChoices, Mt as DialogTrigger, N as permissionModeMeta, Nt as Menu, O as PermissionPrompt, Ot as DialogClose, P as ModelSelect, Pt as MenuContent, Q as Blank, Rt as Select, S as TerminalQuestionPrompt, St as copyText, T as QuestionPrompt, Tt as TooltipProvider, U as Composer, Ut as SelectValue, V as ContextDialog, Vt as SelectItemText, W as skillPrompt, Wt as PortalScope, X as previewPatch, Xt as cn, Y as TerminalDiff, Yt as buttonVariants, Z as Band, _ as ConversationContent, _t as ProgressRing, a as Transcript, at as toolIcon, b as STATUS_META, bt as Spinner, c as PromptTokenText, ct as useTranscriptDensity, d as FileCard, dt as hashtagTrigger, et as Row, f as TerminalItemView, ft as mentionTrigger, g as Conversation, gt as segmentsToPlainText, h as Loader, ht as plainTextToSegments, i as useMinuteClock, it as isMutatingTool, j as PermissionModeSelect, jt as DialogRow, k as Response, kt as DialogContent, l as Message, lt as useTranscriptVariant, m as SessionEmptyState, mt as PromptArea, n as UsageDialog, nt as WithActions, o as ToolCallCard, ot as TranscriptDensityProvider, p as TerminalTranscript, pt as usePromptAreaState, q as useToolTitle, qt as badgeVariants, r as UsageMeters, rt as useAffordances, s as Reasoning, st as TranscriptVariantProvider, t as SessionPanel, tt as CopyAction, u as MessageContent, ut as commandTrigger, v as ConversationScrollButton, vt as Splitter, w as QUESTION_BEHAVIORS, wt as TooltipContent, x as SessionInfoDialog, xt as CopyButton, y as StatusBar, yt as CodeBlock, z as TasksDialog, zt as SelectContent } from "./SessionPanel-DrMj8Yv0.mjs";
|
|
2
2
|
import { C as toolInputPreview, S as rateLimitWindowSeconds, _ as formatRateLimitWindow, b as formatTokens, c as tightestWindow, f as formatAgoPrecise, g as formatDuration, h as formatCountdown, i as meterSeverity, m as formatCost, o as modelLabel, p as formatBytes, r as meterColorClass, s as statusPresentation, t as contextSeverity, u as windowLabel, v as formatRateLimitWindowLong, x as friendlyModel, y as formatRelativeTime } from "./status-C4TAgVSc.mjs";
|
|
3
3
|
import { Fragment, forwardRef, 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, ChevronRight, CircleAlert, CircleSlash, CircuitBoard, Cloud, Code, Coffee, Cog, Compass, Container, Cpu, CreditCard, Database, Diamond, Dog,
|
|
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
8
|
import { STATE_LABELS, STATE_ORDER, adaptersOf, clearFilters, filterRows, groupRows, hasFacetFilter, isAgentRecord, projectLabel, projectSubpath, projectsOf, sessionLabel, subagentLabel, subsetSummary } from "@workerdeck/protocol";
|
|
@@ -522,20 +522,15 @@ function SessionStatusIcon({ row, className }) {
|
|
|
522
522
|
//#endregion
|
|
523
523
|
//#region src/components/agent/SessionSteps.tsx
|
|
524
524
|
function sessionSteps(info, onSelect) {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
title: `${subagentLabel(sub)} · ${sub.toolCount} tool${sub.toolCount === 1 ? "" : "s"}`,
|
|
535
|
-
onSelect: () => onSelect(sub.toolUseId, kind)
|
|
536
|
-
};
|
|
537
|
-
});
|
|
538
|
-
return [...steps.filter((s) => s.kind === "agent"), ...steps.filter((s) => s.kind === "task")];
|
|
525
|
+
return (info.subagents ?? []).filter(isAgentRecord).map((sub) => ({
|
|
526
|
+
key: sub.toolUseId,
|
|
527
|
+
label: subagentLabel(sub),
|
|
528
|
+
noun: "agent",
|
|
529
|
+
state: stepState(sub.status),
|
|
530
|
+
detail: sub.toolCount > 0 ? String(sub.toolCount) : void 0,
|
|
531
|
+
title: `${subagentLabel(sub)} · ${sub.toolCount} tool${sub.toolCount === 1 ? "" : "s"}`,
|
|
532
|
+
onSelect: () => onSelect(sub.toolUseId)
|
|
533
|
+
}));
|
|
539
534
|
}
|
|
540
535
|
function stepState(status) {
|
|
541
536
|
switch (status) {
|
|
@@ -568,23 +563,18 @@ function StepToggle({ expanded, running, total, noun, onToggle }) {
|
|
|
568
563
|
});
|
|
569
564
|
}
|
|
570
565
|
function StepRow({ step, active = false, onSelect }) {
|
|
571
|
-
const
|
|
572
|
-
const selected = active && agent;
|
|
573
|
-
const body = step.state === "failed" ? "text-danger" : agent ? "text-success" : "text-fg-4";
|
|
566
|
+
const body = step.state === "failed" ? "text-danger" : "text-success";
|
|
574
567
|
return /* @__PURE__ */ jsxs("button", {
|
|
575
568
|
type: "button",
|
|
576
569
|
title: step.title,
|
|
577
|
-
"aria-current":
|
|
570
|
+
"aria-current": active || void 0,
|
|
578
571
|
onClick: (e) => {
|
|
579
572
|
e.stopPropagation();
|
|
580
573
|
onSelect();
|
|
581
574
|
},
|
|
582
|
-
className: cn("flex w-full items-center gap-1.5 rounded-[4px] py-1 pr-2.5 pl-3.5", "text-left text-micro outline-none",
|
|
575
|
+
className: cn("flex w-full items-center gap-1.5 rounded-[4px] py-1 pr-2.5 pl-3.5", "text-left text-micro outline-none", active ? "bg-row-selected" : "hover:bg-row-active", body),
|
|
583
576
|
children: [
|
|
584
|
-
/* @__PURE__ */ jsx(StepIcon, {
|
|
585
|
-
state: step.state,
|
|
586
|
-
kind: step.kind
|
|
587
|
-
}),
|
|
577
|
+
/* @__PURE__ */ jsx(StepIcon, { state: step.state }),
|
|
588
578
|
/* @__PURE__ */ jsx("span", {
|
|
589
579
|
className: "min-w-0 flex-1 truncate",
|
|
590
580
|
children: step.label
|
|
@@ -593,22 +583,20 @@ function StepRow({ step, active = false, onSelect }) {
|
|
|
593
583
|
className: "shrink-0 tabular-nums text-fg-4",
|
|
594
584
|
children: step.detail
|
|
595
585
|
}) : null,
|
|
596
|
-
|
|
586
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "size-3.5 shrink-0 text-fg-4" })
|
|
597
587
|
]
|
|
598
588
|
});
|
|
599
589
|
}
|
|
600
|
-
function StepIcon({ state
|
|
601
|
-
if (kind === "task" && state !== "running" && state !== "failed") return /* @__PURE__ */ jsx(Dot, { className: "size-[11px] shrink-0" });
|
|
590
|
+
function StepIcon({ state }) {
|
|
602
591
|
switch (state) {
|
|
603
592
|
case "running": return /* @__PURE__ */ jsx(Spinner, { className: "size-[11px] shrink-0" });
|
|
604
593
|
case "failed": return /* @__PURE__ */ jsx(CircleAlert, { className: "size-[11px] shrink-0" });
|
|
605
|
-
case "pending": return /* @__PURE__ */ jsx(PauseCircle, { className: "size-[11px] shrink-0" });
|
|
606
594
|
default: return /* @__PURE__ */ jsx(Check, { className: "size-[11px] shrink-0" });
|
|
607
595
|
}
|
|
608
596
|
}
|
|
609
597
|
//#endregion
|
|
610
598
|
//#region src/components/agent/SessionItem.tsx
|
|
611
|
-
function SessionItem({ row, active = false, activeStepKey, showGateway, showProject = true, projectIcons, expanded, onExpandedChange, onSelect, onSelectSubagent,
|
|
599
|
+
function SessionItem({ row, active = false, activeStepKey, showGateway, showProject = true, projectIcons, expanded, onExpandedChange, onSelect, onSelectSubagent, onRename, renameOn = "doubleClick", editing, onEditingChange, actions, className }) {
|
|
612
600
|
const { info } = row;
|
|
613
601
|
const [ownExpanded, setOwnExpanded] = useState(false);
|
|
614
602
|
const open = expanded ?? ownExpanded;
|
|
@@ -645,11 +633,8 @@ function SessionItem({ row, active = false, activeStepKey, showGateway, showProj
|
|
|
645
633
|
className: "mr-1.5 size-4 align-[-0.3em]"
|
|
646
634
|
}), project] }, "project"));
|
|
647
635
|
for (const extra of extras) parts.push(/* @__PURE__ */ jsx("span", { children: extra }, extra));
|
|
648
|
-
const steps = sessionSteps(info, (toolUseId
|
|
649
|
-
|
|
650
|
-
return onRevealStep ? onRevealStep(toolUseId) : onSelect?.();
|
|
651
|
-
});
|
|
652
|
-
const holdsOpenAgent = steps.some((s) => s.kind === "agent" && s.key === activeStepKey);
|
|
636
|
+
const steps = sessionSteps(info, (toolUseId) => onSelectSubagent ? onSelectSubagent(toolUseId) : onSelect?.());
|
|
637
|
+
const holdsOpenAgent = steps.some((s) => s.key === activeStepKey);
|
|
653
638
|
return /* @__PURE__ */ jsxs("div", {
|
|
654
639
|
"data-slot": "session-item",
|
|
655
640
|
"data-active": active || void 0,
|
|
@@ -783,7 +768,7 @@ function NameEditor({ initial, onCommit, onCancel }) {
|
|
|
783
768
|
function rowShapeClass(active) {
|
|
784
769
|
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");
|
|
785
770
|
}
|
|
786
|
-
function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeSubagentId, onSelect, onDelete, onRename, onClearContext, onSelectSubagent,
|
|
771
|
+
function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeSubagentId, onSelect, onDelete, onRename, onClearContext, onSelectSubagent, emptyState, showControls = true, projectIcons, className }) {
|
|
787
772
|
const visible = useMemo(() => filterRows(rows, config, scope), [
|
|
788
773
|
rows,
|
|
789
774
|
config,
|
|
@@ -991,8 +976,7 @@ function SessionBrowser({ rows, config, onConfigChange, scope, activeId, activeS
|
|
|
991
976
|
onDelete,
|
|
992
977
|
onRename,
|
|
993
978
|
onClearContext,
|
|
994
|
-
onSelectSubagent
|
|
995
|
-
onRevealStep
|
|
979
|
+
onSelectSubagent
|
|
996
980
|
}, `${row.hostId}:${row.info.id}`))]
|
|
997
981
|
}, group.key))
|
|
998
982
|
})
|
|
@@ -1003,7 +987,7 @@ function iconSrcOf(row, icons) {
|
|
|
1003
987
|
const icon = row?.info.project?.icon;
|
|
1004
988
|
return icon?.type === "image" ? icons?.[icon.hash] : void 0;
|
|
1005
989
|
}
|
|
1006
|
-
function SessionRowItem({ row, active, activeSubagentId, showGateway, showProject = true, projectIcons, onSelect, onDelete, onRename, onClearContext, onSelectSubagent
|
|
990
|
+
function SessionRowItem({ row, active, activeSubagentId, showGateway, showProject = true, projectIcons, onSelect, onDelete, onRename, onClearContext, onSelectSubagent }) {
|
|
1007
991
|
const { info } = row;
|
|
1008
992
|
const [editing, setEditing] = useState(false);
|
|
1009
993
|
return /* @__PURE__ */ jsx(SessionItem, {
|
|
@@ -1015,7 +999,6 @@ function SessionRowItem({ row, active, activeSubagentId, showGateway, showProjec
|
|
|
1015
999
|
projectIcons,
|
|
1016
1000
|
onSelect: () => onSelect?.(row),
|
|
1017
1001
|
onSelectSubagent: onSelectSubagent ? (id) => onSelectSubagent(row, id) : void 0,
|
|
1018
|
-
onRevealStep: onRevealStep ? (id) => onRevealStep(row, id) : void 0,
|
|
1019
1002
|
onRename: onRename ? (title) => onRename(row, title) : void 0,
|
|
1020
1003
|
renameOn: "external",
|
|
1021
1004
|
editing,
|
|
@@ -1106,6 +1089,6 @@ function OneOfSelect({ label, value, options, onChange }) {
|
|
|
1106
1089
|
});
|
|
1107
1090
|
}
|
|
1108
1091
|
//#endregion
|
|
1109
|
-
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,
|
|
1092
|
+
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, 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, mentionTrigger, parseUserQuestions, permissionModeChoices, permissionModeMeta, plainTextToSegments, previewPatch, rateLimitWindowSeconds, rowShapeClass, runningSteps, segmentsToPlainText, sessionSteps, skillPrompt, toast, toolIcon, toolInputPreview, useAffordances, useMinuteClock, usePromptAreaState, useToolTitle, useTranscriptDensity, useTranscriptVariant, vendorMarkClass, vendorTextClass };
|
|
1110
1093
|
|
|
1111
1094
|
//# sourceMappingURL=index.mjs.map
|