@workerdeck/ui 0.18.0 → 0.20.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-DPx8Iz8a.mjs → SessionPanel-CHktI2CF.mjs} +2 -2
- package/build/SessionPanel-CHktI2CF.mjs.map +1 -0
- package/build/index.d.mts +13 -0
- package/build/index.mjs +17 -4
- package/build/index.mjs.map +1 -1
- package/build/workspace.mjs +1 -1
- package/package.json +4 -4
- package/src/components/agent/PermissionModeSelect.tsx +5 -1
- package/src/components/agent/SessionBrowser.tsx +33 -0
- package/build/SessionPanel-DPx8Iz8a.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workerdeck/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Styled agent-control component library for WorkerDeck: session panel, transcript with streaming, tool-call cards, permission prompts, session list, composer. Tailwind v4 + Base UI + cva. Pairs with the headless @workerdeck/react layer.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"streamdown": "^2.5.0",
|
|
39
39
|
"tailwind-merge": "^3.6.0",
|
|
40
40
|
"use-stick-to-bottom": "^1.1.6",
|
|
41
|
-
"@workerdeck/client": "0.
|
|
42
|
-
"@workerdeck/protocol": "0.
|
|
43
|
-
"@workerdeck/react": "0.
|
|
41
|
+
"@workerdeck/client": "0.20.0",
|
|
42
|
+
"@workerdeck/protocol": "0.20.0",
|
|
43
|
+
"@workerdeck/react": "0.20.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"monaco-editor": "^0.56.0",
|
|
@@ -60,7 +60,11 @@ export const PERMISSION_MODES: PermissionModeMeta[] = [
|
|
|
60
60
|
value: 'auto',
|
|
61
61
|
label: 'Auto',
|
|
62
62
|
shortLabel: 'Auto',
|
|
63
|
-
|
|
63
|
+
// Engine-neutral on purpose: on claude this is the operator-configurable
|
|
64
|
+
// auto-mode classifier, on codex it is `approvalsReviewer: 'auto_review'`,
|
|
65
|
+
// a fixed OpenAI-prompted subagent. Both "something other than you decides";
|
|
66
|
+
// naming Claude here reads as a bug on a codex session.
|
|
67
|
+
description: 'The agent handles permission decisions',
|
|
64
68
|
icon: Zap,
|
|
65
69
|
},
|
|
66
70
|
{
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
BellRing,
|
|
5
5
|
CircleAlert,
|
|
6
6
|
CircleSlash,
|
|
7
|
+
Eraser,
|
|
7
8
|
Layers,
|
|
8
9
|
Moon,
|
|
9
10
|
PauseCircle,
|
|
@@ -82,6 +83,18 @@ export interface SessionBrowserProps {
|
|
|
82
83
|
* double-click would have already left the page.
|
|
83
84
|
*/
|
|
84
85
|
onRename?: (row: SessionRow, title: string) => void
|
|
86
|
+
/**
|
|
87
|
+
* Clear the conversation in place, from the row's eraser. Same session, empty
|
|
88
|
+
* context — **not** a delete: the engine keeps the old conversation and it
|
|
89
|
+
* stays resumable, which is why the row's copy never says "deleted".
|
|
90
|
+
*
|
|
91
|
+
* Rendered only where the session's own capability record allows it
|
|
92
|
+
* (`capabilities.clearContext`, absent = false), so a row that cannot be
|
|
93
|
+
* cleared has no eraser rather than one that errors. Omit the prop to have
|
|
94
|
+
* none at all — a host with no way to send a session command has nothing to
|
|
95
|
+
* hang it on (this is a WS command, not a REST route).
|
|
96
|
+
*/
|
|
97
|
+
onClearContext?: (row: SessionRow) => void
|
|
85
98
|
/** Open a session *at* one of its sub-agents, when the host can scroll a
|
|
86
99
|
* transcript to a `Task` row. Absent, the sub-agent list still expands and a
|
|
87
100
|
* step just opens its session — see `SessionRowItemProps`. */
|
|
@@ -144,6 +157,7 @@ export function SessionBrowser({
|
|
|
144
157
|
onSelect,
|
|
145
158
|
onDelete,
|
|
146
159
|
onRename,
|
|
160
|
+
onClearContext,
|
|
147
161
|
onSelectSubagent,
|
|
148
162
|
emptyState,
|
|
149
163
|
showControls = true,
|
|
@@ -314,6 +328,7 @@ export function SessionBrowser({
|
|
|
314
328
|
onSelect={onSelect}
|
|
315
329
|
onDelete={onDelete}
|
|
316
330
|
onRename={onRename}
|
|
331
|
+
onClearContext={onClearContext}
|
|
317
332
|
onSelectSubagent={onSelectSubagent}
|
|
318
333
|
/>
|
|
319
334
|
))}
|
|
@@ -352,6 +367,9 @@ interface SessionRowItemProps {
|
|
|
352
367
|
onSelect?: (row: SessionRow) => void
|
|
353
368
|
onDelete?: (row: SessionRow) => void
|
|
354
369
|
onRename?: (row: SessionRow, title: string) => void
|
|
370
|
+
/** See `SessionBrowserProps.onClearContext` — gated on the row's own
|
|
371
|
+
* capability record, not on the engine name. */
|
|
372
|
+
onClearContext?: (row: SessionRow) => void
|
|
355
373
|
/** Open one of a session's sub-agents — which now means handing the session
|
|
356
374
|
* panel over to that agent's own work (`SessionPanel.openSubagent`), and meant
|
|
357
375
|
* "scroll to its `Task` row" before that surface existed. Both are honest; a
|
|
@@ -370,6 +388,7 @@ function SessionRowItem({
|
|
|
370
388
|
onSelect,
|
|
371
389
|
onDelete,
|
|
372
390
|
onRename,
|
|
391
|
+
onClearContext,
|
|
373
392
|
onSelectSubagent,
|
|
374
393
|
}: SessionRowItemProps) {
|
|
375
394
|
const { info } = row
|
|
@@ -536,6 +555,20 @@ function SessionRowItem({
|
|
|
536
555
|
<Pencil className='size-3 text-fg-3' />
|
|
537
556
|
</Button>
|
|
538
557
|
) : null}
|
|
558
|
+
{onClearContext && info.capabilities?.clearContext ? (
|
|
559
|
+
<Button
|
|
560
|
+
variant='ghost'
|
|
561
|
+
size='icon-sm'
|
|
562
|
+
aria-label='Clear context'
|
|
563
|
+
title='Clear the conversation — the session keeps running and the old conversation stays resumable'
|
|
564
|
+
className='size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100'
|
|
565
|
+
onClick={(e) => {
|
|
566
|
+
e.stopPropagation()
|
|
567
|
+
onClearContext(row)
|
|
568
|
+
}}>
|
|
569
|
+
<Eraser className='size-3 text-fg-3' />
|
|
570
|
+
</Button>
|
|
571
|
+
) : null}
|
|
539
572
|
{onDelete ? (
|
|
540
573
|
<Button
|
|
541
574
|
variant='ghost'
|