@workerdeck/ui 0.23.0 → 1.0.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-DUt2VzXG.mjs → SessionPanel-DDgBkHsi.mjs} +2151 -3357
- package/build/SessionPanel-DDgBkHsi.mjs.map +1 -0
- package/build/SessionPanel-E_L_ldQ5.d.mts +207 -0
- package/build/format-B8ZM9LPy.d.mts +16 -0
- package/build/format.d.mts +8 -75
- package/build/format.mjs +2 -2
- package/build/index.d.mts +63 -1138
- package/build/index.mjs +4 -300
- package/build/index.mjs.map +1 -1
- package/build/scoped.css +15 -23
- package/build/{status-BE-zg88x.mjs → status-C0HSLZas.mjs} +14 -85
- package/build/status-C0HSLZas.mjs.map +1 -0
- package/build/workspace.d.mts +5 -126
- package/build/workspace.mjs +11 -143
- package/build/workspace.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/agent/CodeEditor.tsx +31 -103
- package/src/components/agent/Composer.tsx +114 -333
- package/src/components/agent/ContextDialog.tsx +20 -41
- package/src/components/agent/ContextRing.tsx +6 -28
- package/src/components/agent/Conversation.tsx +21 -33
- package/src/components/agent/EditorTabs.tsx +39 -67
- package/src/components/agent/EngineIcon.tsx +29 -72
- package/src/components/agent/EntryIcon.tsx +16 -0
- package/src/components/agent/FileCard.tsx +10 -16
- package/src/components/agent/FileTree.tsx +52 -125
- package/src/components/agent/FileViewer.tsx +30 -60
- package/src/components/agent/HostFilesDialog.tsx +40 -69
- package/src/components/agent/Loader.tsx +3 -24
- package/src/components/agent/McpDialog.tsx +64 -137
- package/src/components/agent/Message.tsx +2 -21
- package/src/components/agent/ModelSelect.tsx +33 -62
- package/src/components/agent/PermissionModeSelect.tsx +21 -79
- package/src/components/agent/PermissionPrompt.tsx +59 -63
- package/src/components/agent/ProjectIcon.tsx +228 -93
- package/src/components/agent/PromptTokenText.tsx +10 -16
- package/src/components/agent/QuestionPrompt.tsx +43 -64
- package/src/components/agent/Reasoning.tsx +13 -16
- package/src/components/agent/Response.tsx +3 -9
- package/src/components/agent/Scrubber.tsx +31 -80
- package/src/components/agent/SessionBrowser.tsx +64 -243
- package/src/components/agent/SessionEmptyState.tsx +10 -40
- package/src/components/agent/SessionInfoDialog.tsx +46 -78
- package/src/components/agent/SessionItem.tsx +53 -320
- package/src/components/agent/SessionList.tsx +23 -39
- package/src/components/agent/SessionPanel.tsx +315 -996
- package/src/components/agent/SessionStatusIcon.tsx +14 -28
- package/src/components/agent/SessionSteps.tsx +34 -187
- package/src/components/agent/SessionWorkspace.tsx +104 -219
- package/src/components/agent/SkillsDialog.tsx +35 -80
- package/src/components/agent/StatusBar.tsx +51 -136
- package/src/components/agent/SubagentStrip.tsx +12 -77
- package/src/components/agent/ToolCallCard.tsx +94 -135
- package/src/components/agent/Transcript.tsx +103 -1288
- package/src/components/agent/TranscriptItemView.tsx +155 -0
- package/src/components/agent/TranscriptRows.tsx +418 -0
- package/src/components/agent/UsageDialog.tsx +7 -29
- package/src/components/agent/UsageMeters.tsx +18 -73
- package/src/components/agent/pulse.tsx +9 -32
- package/src/components/agent/scrubber-marks.ts +33 -103
- package/src/components/agent/status.ts +1 -5
- package/src/components/agent/tool-result-fetch.tsx +3 -25
- package/src/components/agent/tool-result-image.tsx +32 -111
- package/src/components/agent/transcript-rows.ts +41 -118
- package/src/components/agent/transcript-variant.tsx +3 -80
- package/src/components/agent/use-height-epoch.ts +10 -24
- package/src/components/agent/use-path-links.ts +45 -63
- package/src/components/agent/use-subagent-frame.ts +106 -0
- package/src/components/agent/use-transcript-jumps.ts +49 -107
- package/src/components/prompt-area/animated-placeholder.tsx +6 -5
- package/src/components/prompt-area/clipboard-helpers.ts +26 -21
- package/src/components/prompt-area/cursor-helpers.ts +79 -37
- package/src/components/prompt-area/dom-helpers.ts +97 -69
- package/src/components/prompt-area/file-strip.tsx +90 -80
- package/src/components/prompt-area/html-to-markdown.ts +67 -46
- package/src/components/prompt-area/image-strip.tsx +8 -18
- package/src/components/prompt-area/index.ts +2 -15
- package/src/components/prompt-area/prompt-area-engine.ts +100 -115
- package/src/components/prompt-area/prompt-area-list-ops.ts +66 -59
- package/src/components/prompt-area/prompt-area.tsx +31 -38
- package/src/components/prompt-area/remove-button.tsx +3 -9
- package/src/components/prompt-area/segment-helpers.ts +4 -12
- package/src/components/prompt-area/trigger-popover.tsx +15 -27
- package/src/components/prompt-area/trigger-presets.ts +0 -10
- package/src/components/prompt-area/types.ts +3 -8
- package/src/components/prompt-area/use-chip-editing.ts +305 -0
- package/src/components/prompt-area/use-markdown-mode.ts +7 -17
- package/src/components/prompt-area/use-prompt-area-events.ts +80 -86
- package/src/components/prompt-area/use-prompt-area-keydown.ts +598 -0
- package/src/components/prompt-area/use-prompt-area-state.ts +5 -23
- package/src/components/prompt-area/use-prompt-area.ts +170 -896
- package/src/components/prompt-area/use-trigger-search.ts +21 -19
- package/src/components/terminal/PermissionPrompt.tsx +56 -59
- package/src/components/terminal/QuestionPrompt.tsx +28 -79
- package/src/components/terminal/StatusLine.tsx +13 -63
- package/src/components/terminal/TerminalTranscript.tsx +44 -160
- package/src/components/terminal/affordances.tsx +68 -98
- package/src/components/terminal/blocks.ts +20 -156
- package/src/components/terminal/diff.tsx +19 -67
- package/src/components/terminal/height.ts +163 -313
- package/src/components/terminal/image-box.ts +0 -44
- package/src/components/terminal/items.tsx +150 -305
- package/src/components/terminal/markdown.tsx +36 -95
- package/src/components/terminal/press.tsx +26 -53
- package/src/components/terminal/prompt.tsx +40 -170
- package/src/components/terminal/result-preview.ts +8 -56
- package/src/components/terminal/row.tsx +11 -98
- package/src/components/terminal/scrubber.tsx +108 -401
- package/src/components/terminal/surface.tsx +6 -54
- package/src/components/terminal/todos.ts +66 -0
- package/src/components/terminal/tool-run.ts +21 -192
- package/src/components/ui/AlertDialog.tsx +8 -23
- package/src/components/ui/Badge.tsx +18 -29
- package/src/components/ui/Button.tsx +7 -15
- package/src/components/ui/Card.tsx +2 -13
- package/src/components/ui/CodeBlock.tsx +10 -37
- package/src/components/ui/CopyButton.tsx +10 -23
- package/src/components/ui/Dialog.tsx +23 -36
- package/src/components/ui/Empty.tsx +6 -29
- package/src/components/ui/Input.tsx +14 -16
- package/src/components/ui/Menu.tsx +6 -18
- package/src/components/ui/PortalScope.tsx +1 -21
- package/src/components/ui/ProgressRing.tsx +8 -19
- package/src/components/ui/Select.tsx +18 -31
- package/src/components/ui/Sonner.tsx +1 -2
- package/src/components/ui/Spinner.tsx +1 -1
- package/src/components/ui/Splitter.tsx +30 -64
- package/src/components/ui/Textarea.tsx +2 -5
- package/src/components/ui/Tooltip.tsx +3 -13
- package/src/format.ts +0 -9
- package/src/index.ts +16 -113
- package/src/lib/clipboard.ts +8 -28
- package/src/lib/css.ts +8 -0
- package/src/lib/format.ts +101 -86
- package/src/lib/plan-request.ts +16 -0
- package/src/lib/status.ts +45 -95
- package/src/lib/tool-icon.ts +39 -47
- package/src/lib/utils.ts +1 -3
- package/src/styles/terminal.css +81 -49
- package/src/styles/theme.css +96 -32
- package/src/workspace.ts +1 -24
- package/build/SessionPanel-BobynUo4.d.mts +0 -669
- package/build/SessionPanel-DUt2VzXG.mjs.map +0 -1
- package/build/format-ljc3lKpA.d.mts +0 -59
- package/build/status-BE-zg88x.mjs.map +0 -1
|
@@ -17,67 +17,39 @@ export interface SessionInfoDialogProps {
|
|
|
17
17
|
onOpenChange: (open: boolean) => void
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
* What this session *is*: engine, profile, model, mode, where it runs, which
|
|
22
|
-
* credentials it found, and the files it has handed over.
|
|
23
|
-
*
|
|
24
|
-
* The identity half of the session's facts. Context and usage have their own
|
|
25
|
-
* panels — they change every turn and are consulted mid-run, while everything
|
|
26
|
-
* here is fixed at creation and looked up once.
|
|
27
|
-
*/
|
|
28
|
-
export function SessionInfoDialog({
|
|
29
|
-
state,
|
|
30
|
-
client,
|
|
31
|
-
sessionId,
|
|
32
|
-
open,
|
|
33
|
-
onOpenChange,
|
|
34
|
-
}: SessionInfoDialogProps) {
|
|
20
|
+
export function SessionInfoDialog({ state, client, sessionId, open, onOpenChange }: SessionInfoDialogProps) {
|
|
35
21
|
const session = state.session
|
|
36
22
|
const mode = state.permissionMode ? permissionModeMeta(state.permissionMode) : undefined
|
|
37
23
|
return (
|
|
38
24
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
39
25
|
<DialogContent>
|
|
40
|
-
<DialogHeader title=
|
|
26
|
+
<DialogHeader title="Session info" description={session?.title} />
|
|
41
27
|
<DialogBody>
|
|
42
|
-
<div className=
|
|
43
|
-
<div className=
|
|
44
|
-
<DialogRow label=
|
|
45
|
-
{session?.profile ?
|
|
46
|
-
<DialogRow label='Profile'>{session.profile}</DialogRow>
|
|
47
|
-
) : null}
|
|
28
|
+
<div className="flex flex-col divide-y divide-border">
|
|
29
|
+
<div className="pb-2">
|
|
30
|
+
<DialogRow label="Engine">{state.engine ?? 'claude'}</DialogRow>
|
|
31
|
+
{session?.profile ? <DialogRow label="Profile">{session.profile}</DialogRow> : null}
|
|
48
32
|
{state.model ? (
|
|
49
|
-
<DialogRow label=
|
|
33
|
+
<DialogRow label="Model" mono>
|
|
50
34
|
{state.model}
|
|
51
35
|
</DialogRow>
|
|
52
36
|
) : null}
|
|
53
|
-
{mode ? <DialogRow label=
|
|
54
|
-
{session?.apiKeySource ?
|
|
55
|
-
<DialogRow label='Credentials'>{session.apiKeySource}</DialogRow>
|
|
56
|
-
) : null}
|
|
37
|
+
{mode ? <DialogRow label="Permission mode">{mode.label}</DialogRow> : null}
|
|
38
|
+
{session?.apiKeySource ? <DialogRow label="Credentials">{session.apiKeySource}</DialogRow> : null}
|
|
57
39
|
</div>
|
|
58
|
-
<div className=
|
|
59
|
-
{state.cwd ? <CopyRow label=
|
|
60
|
-
{state.sdkSessionId ?
|
|
61
|
-
|
|
62
|
-
) : null}
|
|
63
|
-
{session ? <CopyRow label='Gateway session id' value={session.id} /> : null}
|
|
40
|
+
<div className="py-2">
|
|
41
|
+
{state.cwd ? <CopyRow label="Working directory" value={state.cwd} /> : null}
|
|
42
|
+
{state.sdkSessionId ? <CopyRow label="Engine session id" value={state.sdkSessionId} /> : null}
|
|
43
|
+
{session ? <CopyRow label="Gateway session id" value={session.id} /> : null}
|
|
64
44
|
</div>
|
|
65
|
-
<div className=
|
|
66
|
-
{session?.createdAt ? (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
{session?.numTurns !== undefined ? (
|
|
70
|
-
<DialogRow label='Turns'>{session.numTurns}</DialogRow>
|
|
71
|
-
) : null}
|
|
72
|
-
<DialogRow label='Cost' mono>
|
|
45
|
+
<div className="py-2">
|
|
46
|
+
{session?.createdAt ? <DialogRow label="Started">{formatRelativeTime(session.createdAt)}</DialogRow> : null}
|
|
47
|
+
{session?.numTurns !== undefined ? <DialogRow label="Turns">{session.numTurns}</DialogRow> : null}
|
|
48
|
+
<DialogRow label="Cost" mono>
|
|
73
49
|
{formatCost(state.totalCostUsd)}
|
|
74
50
|
</DialogRow>
|
|
75
51
|
</div>
|
|
76
|
-
{
|
|
77
|
-
404s, and a "Files" heading over nothing reads as a failed load. */}
|
|
78
|
-
{state.capabilities.vfs ? (
|
|
79
|
-
<SessionFiles client={client} sessionId={sessionId} open={open} />
|
|
80
|
-
) : null}
|
|
52
|
+
{state.capabilities.vfs ? <SessionFiles client={client} sessionId={sessionId} open={open} /> : null}
|
|
81
53
|
</div>
|
|
82
54
|
</DialogBody>
|
|
83
55
|
</DialogContent>
|
|
@@ -85,47 +57,44 @@ export function SessionInfoDialog({
|
|
|
85
57
|
)
|
|
86
58
|
}
|
|
87
59
|
|
|
88
|
-
/** Long ids are for pasting elsewhere, so give them a copy target. */
|
|
89
60
|
function CopyRow({ label, value }: { label: string; value: string }) {
|
|
90
61
|
return (
|
|
91
|
-
<div className=
|
|
92
|
-
<div className=
|
|
93
|
-
<div className=
|
|
94
|
-
<div className=
|
|
62
|
+
<div className="flex items-start justify-between gap-2 py-1.5">
|
|
63
|
+
<div className="min-w-0 flex-1">
|
|
64
|
+
<div className="text-label text-fg-3">{label}</div>
|
|
65
|
+
<div className="mt-0.5 font-mono text-label break-all text-fg-1">{value}</div>
|
|
95
66
|
</div>
|
|
96
67
|
<CopyButton value={value} aria-label={`Copy ${label.toLowerCase()}`} />
|
|
97
68
|
</div>
|
|
98
69
|
)
|
|
99
70
|
}
|
|
100
71
|
|
|
101
|
-
|
|
102
|
-
* opens — this is not a live list and nothing pushes changes to it. */
|
|
103
|
-
function SessionFiles({
|
|
104
|
-
client,
|
|
105
|
-
sessionId,
|
|
106
|
-
open,
|
|
107
|
-
}: {
|
|
108
|
-
client: WorkerDeckClient
|
|
109
|
-
sessionId: string | undefined
|
|
110
|
-
open: boolean
|
|
111
|
-
}) {
|
|
72
|
+
function SessionFiles({ client, sessionId, open }: { client: WorkerDeckClient; sessionId: string | undefined; open: boolean }) {
|
|
112
73
|
const [files, setFiles] = useState<SessionFileInfo[] | undefined>()
|
|
113
74
|
const [loading, setLoading] = useState(false)
|
|
114
75
|
|
|
115
76
|
useEffect(() => {
|
|
116
|
-
if (!open || !sessionId)
|
|
77
|
+
if (!open || !sessionId) {
|
|
78
|
+
return
|
|
79
|
+
}
|
|
117
80
|
let cancelled = false
|
|
118
81
|
setLoading(true)
|
|
119
82
|
client
|
|
120
83
|
.listSessionFiles(sessionId)
|
|
121
84
|
.then((list) => {
|
|
122
|
-
if (!cancelled)
|
|
85
|
+
if (!cancelled) {
|
|
86
|
+
setFiles(list)
|
|
87
|
+
}
|
|
123
88
|
})
|
|
124
89
|
.catch(() => {
|
|
125
|
-
if (!cancelled)
|
|
90
|
+
if (!cancelled) {
|
|
91
|
+
setFiles([])
|
|
92
|
+
}
|
|
126
93
|
})
|
|
127
94
|
.finally(() => {
|
|
128
|
-
if (!cancelled)
|
|
95
|
+
if (!cancelled) {
|
|
96
|
+
setLoading(false)
|
|
97
|
+
}
|
|
129
98
|
})
|
|
130
99
|
return () => {
|
|
131
100
|
cancelled = true
|
|
@@ -133,26 +102,25 @@ function SessionFiles({
|
|
|
133
102
|
}, [client, sessionId, open])
|
|
134
103
|
|
|
135
104
|
return (
|
|
136
|
-
<div className=
|
|
137
|
-
<h3 className=
|
|
105
|
+
<div className="pt-3">
|
|
106
|
+
<h3 className="text-label font-medium text-fg-3">Files</h3>
|
|
138
107
|
{loading ? (
|
|
139
|
-
<div className=
|
|
140
|
-
<Spinner className=
|
|
108
|
+
<div className="py-3 text-center">
|
|
109
|
+
<Spinner className="size-4 text-fg-4" />
|
|
141
110
|
</div>
|
|
142
111
|
) : !files?.length ? (
|
|
143
|
-
<p className=
|
|
112
|
+
<p className="py-2 text-body-sm text-fg-4">Nothing delivered yet.</p>
|
|
144
113
|
) : (
|
|
145
|
-
<ul className=
|
|
114
|
+
<ul className="mt-1 flex flex-col">
|
|
146
115
|
{files.map((file) => (
|
|
147
116
|
<li key={file.path}>
|
|
148
117
|
<a
|
|
149
118
|
href={sessionId ? client.sessionFileUrl(sessionId, file.path) : undefined}
|
|
150
|
-
className=
|
|
151
|
-
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
</span>
|
|
155
|
-
<span className='shrink-0 text-label text-fg-4'>{formatBytes(file.bytes)}</span>
|
|
119
|
+
className="flex items-center gap-2 rounded-md px-1 py-1.5 hover:bg-surface-hover"
|
|
120
|
+
>
|
|
121
|
+
<Download className="size-3.5 shrink-0 text-fg-4" />
|
|
122
|
+
<span className="min-w-0 flex-1 truncate font-mono text-label text-fg-1">{file.path}</span>
|
|
123
|
+
<span className="shrink-0 text-label text-fg-4">{formatBytes(file.bytes)}</span>
|
|
156
124
|
</a>
|
|
157
125
|
</li>
|
|
158
126
|
))}
|