dsh-tidy-display 0.4.3 → 0.4.4
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/CHANGELOG.md +5 -0
- package/lib/client.js +83 -9
- package/lib/client.js.map +1 -1
- package/lib/types/client/OfficialContent.d.ts +9 -0
- package/lib/types/client/OfficialContent.d.ts.map +1 -1
- package/lib/types/client/OfficialContent.js +30 -9
- package/lib/types/client/OfficialContent.js.map +1 -1
- package/lib/types/client/Reader.d.ts.map +1 -1
- package/lib/types/client/Reader.js +11 -2
- package/lib/types/client/Reader.js.map +1 -1
- package/lib/types/client/ToolActivity.d.ts.map +1 -1
- package/lib/types/client/ToolActivity.js +3 -1
- package/lib/types/client/ToolActivity.js.map +1 -1
- package/lib/types/client/official-slots.d.ts +18 -0
- package/lib/types/client/official-slots.d.ts.map +1 -1
- package/lib/types/client/official-slots.js +38 -4
- package/lib/types/client/official-slots.js.map +1 -1
- package/package.json +1 -1
- package/src/client/OfficialContent.tsx +32 -8
- package/src/client/Reader.tsx +10 -2
- package/src/client/ToolActivity.tsx +3 -1
- package/src/client/official-slots.tsx +47 -3
- package/tests/official-slots.test.ts +41 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"official-slots.js","sourceRoot":"","sources":["../../../src/client/official-slots.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAsC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"official-slots.js","sourceRoot":"","sources":["../../../src/client/official-slots.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB,EAAsC,MAAM,OAAO,CAAC;AAK5H;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,OAAO,EAAE,qCAAqC;IAC9C,KAAK,EAAE,oBAAoB;IAC3B,IAAI,EAAE,4B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,GAAG,SAAS,CAAC;QACzD,MAAM,KAAK,CAAC;IACd,CAAC;IACD,OAAO,GAAG,EAAE;QACV,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;YAAE,IAAI,EAAE,CAAC;QACzD,IAAI,cAAc,KAAK,KAAK;YAAE,cAAc,GAAG,SAAS,CAAC;IAC3D,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -38,14 +38,13 @@ export function OfficialTool({ official, block, toolName, cwd, openFile, fallbac
|
|
|
38
38
|
</div>;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const owner = {
|
|
41
|
+
/**
|
|
42
|
+
* Owner currency for a keyed chat node. rc.1 dropped openSkill/renderMessageImages
|
|
43
|
+
* from ChatNodeOwnerProps (message images moved to the images child slot); older
|
|
44
|
+
* hosts still read both, so keep supplying them and cast past the new shape.
|
|
45
|
+
*/
|
|
46
|
+
function officialNodeOwner(render: BlockRenderProps, official: NonNullable<BlockRenderProps['official']>): ChatNodeOwnerProps {
|
|
47
|
+
return {
|
|
49
48
|
cwd: render.cwd,
|
|
50
49
|
openFile: render.openFile ?? (() => {}),
|
|
51
50
|
openSkill: () => {},
|
|
@@ -57,6 +56,13 @@ export function OfficialNode({ node, fallback, ...render }: BlockRenderProps & {
|
|
|
57
56
|
}),
|
|
58
57
|
fileMentions: official.officialFileMentions,
|
|
59
58
|
} as unknown as ChatNodeOwnerProps;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function OfficialNode({ node, fallback, ...render }: BlockRenderProps & { node: ChatConversationViewNode; fallback: ReactNode }) {
|
|
62
|
+
const official = render.official;
|
|
63
|
+
const [disclosureReset] = useState(() => createSnapshotStore(0));
|
|
64
|
+
if (!official) return fallback;
|
|
65
|
+
const owner = officialNodeOwner(render, official);
|
|
60
66
|
const turn = node.location.kind === 'turn' || node.location.kind === 'step' ? node.location.turn : undefined;
|
|
61
67
|
// The runtime node domain is open; the public SlotMap enumerates the known kinds.
|
|
62
68
|
const renderNode = official.renderSlot as unknown as (key: string, owner: object, options: object) => ReactNode;
|
|
@@ -65,6 +71,24 @@ export function OfficialNode({ node, fallback, ...render }: BlockRenderProps & {
|
|
|
65
71
|
</div>;
|
|
66
72
|
}
|
|
67
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Render one assistant-step node through the official mirror seat. Only an
|
|
76
|
+
* external shadow takeover (negative priority) is mirrored there; the host's own
|
|
77
|
+
* assistant-step entry is filtered out, so the default path renders nothing and
|
|
78
|
+
* the Reader keeps its own segmentation.
|
|
79
|
+
*/
|
|
80
|
+
export function AssistantStepDelegation({ node, ...render }: BlockRenderProps & { node: ChatConversationViewNode }) {
|
|
81
|
+
const official = render.official;
|
|
82
|
+
const [disclosureReset] = useState(() => createSnapshotStore(0));
|
|
83
|
+
if (!official) return null;
|
|
84
|
+
const owner = officialNodeOwner(render, official);
|
|
85
|
+
const turn = node.location.kind === 'turn' || node.location.kind === 'step' ? node.location.turn : undefined;
|
|
86
|
+
const renderNode = official.renderSlot as unknown as (key: string, owner: object, options: object) => ReactNode;
|
|
87
|
+
return <div data-reader-official-node={node.kind} data-chat-anchor-key={node.key} data-chat-flow-kind={node.kind}>
|
|
88
|
+
{renderNode(OFFICIAL_SEATS.nodes, { ...owner, node }, { entryKey: 'assistant-step', hookContext: { turnData: turn?.data, disclosureReset }, fallback: null })}
|
|
89
|
+
</div>;
|
|
90
|
+
}
|
|
91
|
+
|
|
68
92
|
export function OfficialTail({ official, owner, produced }: Pick<BlockRenderProps, 'official'> & { owner?: TurnTailOwnerProps; produced: readonly string[] }) {
|
|
69
93
|
const tailOwner = owner && official ? { ...owner, openFile: official.officialPreviewFile, readerProducedPaths: produced } : undefined;
|
|
70
94
|
if (!official || !tailOwner) return null;
|
package/src/client/Reader.tsx
CHANGED
|
@@ -6,7 +6,8 @@ import { JsonBlock, MarkdownText } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
|
6
6
|
import { BlockBoundary, Blocks, contentBlocks, CopyAnswer, UserMessageActions } from './Blocks.js';
|
|
7
7
|
import { ReasoningCard } from './ReasoningCard.js';
|
|
8
8
|
import { ToolActivity, ToolMedia } from './ToolActivity.js';
|
|
9
|
-
import { OfficialActions, OfficialNode, OfficialTail } from './OfficialContent.js';
|
|
9
|
+
import { AssistantStepDelegation, OfficialActions, OfficialNode, OfficialTail } from './OfficialContent.js';
|
|
10
|
+
import { useAssistantStepShadow } from './official-slots.js';
|
|
10
11
|
import { preparingLabel, readerFlow } from './tool-activity.js';
|
|
11
12
|
import { Disclosure, ProcessFragment, RetiringContent, StatusText, useMotionAllowed, usePinnedSelection, useReadingScroll } from './motion.js';
|
|
12
13
|
import { StreamMotionContext } from './streaming.js';
|
|
@@ -160,9 +161,16 @@ const AssistantNode = memo(function AssistantNode({ useChat, nodeKey, boundary,
|
|
|
160
161
|
motion: boolean; pinBottom: boolean; onRead: () => void; returnFocusTo: RefObject<HTMLButtonElement>; partStart?: number; folded?: boolean;
|
|
161
162
|
}) {
|
|
162
163
|
const node = useChat(snapshot => snapshot.nodes.get(nodeKey));
|
|
164
|
+
const shadowStep = useAssistantStepShadow();
|
|
163
165
|
if (!node || node.visibility === 'hidden' || !isNode(node, 'assistant-step')) return null;
|
|
164
166
|
const data = node.data;
|
|
165
167
|
const parts = assistantSegments(data.blocks);
|
|
168
|
+
if (shadowStep && render.official) {
|
|
169
|
+
// AssistantNode mounts once per segment part while the delegated official
|
|
170
|
+
// render covers the whole node; only the first part renders, the rest stay quiet.
|
|
171
|
+
if (partStart !== undefined && parts.length > 0 && partStart !== parts[0].start) return null;
|
|
172
|
+
return <BlockBoundary><AssistantStepDelegation {...render} node={node} /></BlockBoundary>;
|
|
173
|
+
}
|
|
166
174
|
const earlier = isEarlierNarration(data, boundary);
|
|
167
175
|
const hasToolCalls = data.blocks.some(block => block.kind === 'tool-call');
|
|
168
176
|
const isProcessStep = earlier || folded || hasToolCalls || (boundary.latestStep > 0 && data.step < boundary.latestStep);
|
|
@@ -743,7 +751,7 @@ export function Reader(props: ReaderProps) {
|
|
|
743
751
|
|
|
744
752
|
// ChatView publishes data-chat-flow="" on its column. Skins treat a
|
|
745
753
|
// scrollport without that hook as inspect-only and hide [data-composer-seat].
|
|
746
|
-
return <StreamMotionContext.Provider value={streamMotion}><div ref={root} className={css.root} data-reader-build="0.4.
|
|
754
|
+
return <StreamMotionContext.Provider value={streamMotion}><div ref={root} className={css.root} data-reader-build="0.4.4" data-dsh-tidy-display="0.4.4" data-reader-wait-clock-version="input-v1" data-reader-wait-start={waitAnchor.time ?? undefined} data-motion={motion ? 'on' : 'off'} data-reader-glass={frostedGlass || undefined} data-reader-bubbles={bubbles ? 'on' : 'off'} data-reader-auto-fold={autoFold ? 'on' : 'off'}>
|
|
747
755
|
<RailView enabled={railEnabled} side={railSide} style={railStyle} ring={railRing} hideOfficialNav={hideOfficialNav} hasMore={hasMore} loadOlder={props.loadOlder} />
|
|
748
756
|
<div className={css.column} data-chat-flow="">
|
|
749
757
|
<StickyLane kind="toolbar" className={css.toolbar}>
|
|
@@ -84,7 +84,9 @@ function searchFiles(value: unknown): SearchFileGroup[] | null {
|
|
|
84
84
|
function ResultView(props: BlockRenderProps & { entry: ToolActivityEntry; model: ReturnType<typeof activitySummary>; phase: ToolPhase }) {
|
|
85
85
|
const { official, entry, model } = props;
|
|
86
86
|
const fallback = <ResultFallback {...props} />;
|
|
87
|
-
|
|
87
|
+
// render_ui belongs to the official toolview mirror (GenUI registers it); show_widget
|
|
88
|
+
// keeps the local path because its html argument renders through McpAppFrame.
|
|
89
|
+
if (!official || !entry.block || model.name === 'show_widget') return fallback;
|
|
88
90
|
return <OfficialTool {...props} official={official} block={entry.block} toolName={model.name} cwd={props.cwd ?? model.cwd} fallback={fallback} />;
|
|
89
91
|
}
|
|
90
92
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement, memo, useMemo, type ComponentType, type ReactNode } from 'react';
|
|
1
|
+
import { createElement, memo, useCallback, useMemo, useSyncExternalStore, type ComponentType, type ReactNode } from 'react';
|
|
2
2
|
import type { Context } from '@deepseek-ai/cordis';
|
|
3
3
|
import type { SlotEntryDef, SlotMap, SlotSpec, StoredEntry } from '@deepseek-ai/dsh-client-ui-slots';
|
|
4
4
|
import type {} from '@deepseek-ai/dsh-client-ui-renderer/client';
|
|
@@ -59,6 +59,45 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
59
59
|
// Existing Reader presentations own these rows. All other node kinds, including
|
|
60
60
|
// future registrations, reach the official renderer through the fallback seat.
|
|
61
61
|
const READER_NODES = new Set(['user', 'steering', 'assistant-step', 'tool-call', 'turn-tail', 'turn-process']);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* An external takeover registers the node with a negative priority. The host's own
|
|
65
|
+
* assistant-step registration carries none (register-node-renderers.ts), so the
|
|
66
|
+
* sign of the rank is the smallest sufficient signal that someone else renders it.
|
|
67
|
+
*/
|
|
68
|
+
export const isShadowWinner = (entry: StoredEntry): boolean =>
|
|
69
|
+
typeof entry.options.priority === 'number' && entry.options.priority < 0;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Mirror only node kinds the Reader does not present itself. assistant-step stays
|
|
73
|
+
* Reader-owned unless a shadow takeover wins its cell; then it must reach the
|
|
74
|
+
* mirror seat so the Reader can delegate to it.
|
|
75
|
+
*/
|
|
76
|
+
export const acceptOfficialNode = (entry: StoredEntry): boolean =>
|
|
77
|
+
!READER_NODES.has(entry.options.key ?? '')
|
|
78
|
+
|| (entry.options.key === 'assistant-step' && isShadowWinner(entry));
|
|
79
|
+
|
|
80
|
+
/** Registry captured at install; the Reader's delegation read needs election winners. */
|
|
81
|
+
let installedSlots: CompositionRegistry | undefined;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Reactive read for the Reader: does an external shadow takeover win the
|
|
85
|
+
* assistant-step cell? Subscribes to the source slot so enabling the takeover
|
|
86
|
+
* plugin after mount flips the answer.
|
|
87
|
+
*/
|
|
88
|
+
export function useAssistantStepShadow(): boolean {
|
|
89
|
+
const registry = installedSlots;
|
|
90
|
+
const subscribe = useCallback(
|
|
91
|
+
(notify: () => void) => registry?.subscribe(OFFICIAL_SLOTS.nodes, notify) ?? (() => {}),
|
|
92
|
+
[registry],
|
|
93
|
+
);
|
|
94
|
+
const read = useCallback(
|
|
95
|
+
() => registry?.entriesOfSlot(OFFICIAL_SLOTS.nodes)
|
|
96
|
+
.some(entry => entry.options.key === 'assistant-step' && isShadowWinner(entry)) ?? false,
|
|
97
|
+
[registry],
|
|
98
|
+
);
|
|
99
|
+
return useSyncExternalStore(subscribe, read);
|
|
100
|
+
}
|
|
62
101
|
const EXPECTED: Record<OfficialFamily, Spec[]> = {
|
|
63
102
|
actions: [{ kind: 'list', scope: 'session' }],
|
|
64
103
|
tools: [{ kind: 'keyed', scope: 'session' }],
|
|
@@ -199,6 +238,7 @@ export function installOfficialSlots(ctx: Context): () => void {
|
|
|
199
238
|
// The SlotMap overloads are for statically declared keys. Aliases are a
|
|
200
239
|
// runtime composition, using exactly the public erased metadata contract.
|
|
201
240
|
const slots = ctx.slots as unknown as CompositionRegistry;
|
|
241
|
+
installedSlots = slots;
|
|
202
242
|
const disposers: (() => void)[] = [];
|
|
203
243
|
try {
|
|
204
244
|
for (const [name, source] of Object.entries(OFFICIAL_SLOTS)) {
|
|
@@ -213,14 +253,18 @@ export function installOfficialSlots(ctx: Context): () => void {
|
|
|
213
253
|
console.warn(`[dsh-tidy-display] official slot contract drift on mirror: ${source} (${spec.kind}/${spec.scope} vs ${declared?.kind ?? 'none'}/${declared?.scope ?? 'none'})`);
|
|
214
254
|
}
|
|
215
255
|
return mirrorOfficialSlot(slots, source, target, `dsh-tidy-display.official.${family}`,
|
|
216
|
-
family === 'nodes' ?
|
|
256
|
+
family === 'nodes' ? acceptOfficialNode : undefined);
|
|
217
257
|
}));
|
|
218
258
|
}
|
|
219
259
|
} catch (error) {
|
|
220
260
|
for (const stop of disposers.reverse()) stop();
|
|
261
|
+
if (installedSlots === slots) installedSlots = undefined;
|
|
221
262
|
throw error;
|
|
222
263
|
}
|
|
223
|
-
return () => {
|
|
264
|
+
return () => {
|
|
265
|
+
for (const stop of disposers.splice(0).reverse()) stop();
|
|
266
|
+
if (installedSlots === slots) installedSlots = undefined;
|
|
267
|
+
};
|
|
224
268
|
}
|
|
225
269
|
|
|
226
270
|
export type OfficialSlotKey = typeof OFFICIAL_SLOTS[OfficialFamily] & keyof SlotMap;
|
|
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict';
|
|
|
2
2
|
import test from 'node:test';
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { SlotCore } from '@deepseek-ai/dsh-client-ui-slots';
|
|
5
|
-
import { mirrorOfficialSlot, readerTailMatch, type CompositionRegistry } from '../src/client/official-slots.js';
|
|
5
|
+
import { acceptOfficialNode, isShadowWinner, mirrorOfficialSlot, readerTailMatch, type CompositionRegistry } from '../src/client/official-slots.js';
|
|
6
6
|
|
|
7
7
|
function registry(kind: 'keyed' | 'chain' | 'list' = 'keyed') {
|
|
8
8
|
const core = new SlotCore();
|
|
@@ -10,6 +10,7 @@ function registry(kind: 'keyed' | 'chain' | 'list' = 'keyed') {
|
|
|
10
10
|
register({ name: 'root', children: {
|
|
11
11
|
source: { kind, scope: 'session' },
|
|
12
12
|
reader: { kind, scope: 'session' },
|
|
13
|
+
toolview: { kind: 'keyed', scope: 'session' },
|
|
13
14
|
} }, () => null);
|
|
14
15
|
const slots: CompositionRegistry = {
|
|
15
16
|
register,
|
|
@@ -96,6 +97,45 @@ test('new registrations do not remount existing cards; winner changes and unload
|
|
|
96
97
|
assert.equal(core.entriesOfSlot('reader').length, 0);
|
|
97
98
|
});
|
|
98
99
|
|
|
100
|
+
test('a keyed render_ui toolview registration reaches the mirror seat', () => {
|
|
101
|
+
const { core, slots, register } = registry();
|
|
102
|
+
const genui = memo(() => null);
|
|
103
|
+
register({ name: 'source', key: 'render_ui' }, genui);
|
|
104
|
+
const stop = mirrorOfficialSlot(slots, 'source', 'toolview', 'reader.toolview');
|
|
105
|
+
const mirrored = core.entriesOfSlot('toolview')[0];
|
|
106
|
+
assert.equal(mirrored.component, genui);
|
|
107
|
+
assert.equal(mirrored.options.key, 'render_ui');
|
|
108
|
+
stop();
|
|
109
|
+
assert.equal(core.entriesOfSlot('toolview').length, 0);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test('the host assistant-step baseline is not mirrored into the reader seat', () => {
|
|
113
|
+
const { core, slots, register } = registry();
|
|
114
|
+
register({ name: 'source', key: 'assistant-step' }, memo(() => null));
|
|
115
|
+
register({ name: 'source', key: 'command' }, memo(() => null));
|
|
116
|
+
const stop = mirrorOfficialSlot(slots, 'source', 'reader', 'reader.children', acceptOfficialNode);
|
|
117
|
+
assert.deepEqual(core.entriesOfSlot('reader').map(entry => entry.options.key), ['command']);
|
|
118
|
+
stop();
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('a negative-priority assistant-step shadow takeover is mirrored into the reader seat', async () => {
|
|
122
|
+
const { core, slots, register } = registry();
|
|
123
|
+
register({ name: 'source', key: 'assistant-step' }, memo(() => null));
|
|
124
|
+
const shadow = memo(() => null);
|
|
125
|
+
const stop = mirrorOfficialSlot(slots, 'source', 'reader', 'reader.children', acceptOfficialNode);
|
|
126
|
+
assert.equal(core.entriesOfSlot('reader').length, 0);
|
|
127
|
+
const dropShadow = register({ name: 'source', key: 'assistant-step', priority: -10 }, shadow);
|
|
128
|
+
await changed();
|
|
129
|
+
const taken = core.entriesOfSlot('reader')[0];
|
|
130
|
+
assert.equal(taken.component, shadow);
|
|
131
|
+
assert.equal(taken.options.key, 'assistant-step');
|
|
132
|
+
assert.equal(isShadowWinner(taken), true);
|
|
133
|
+
dropShadow();
|
|
134
|
+
await changed();
|
|
135
|
+
assert.equal(core.entriesOfSlot('reader').length, 0);
|
|
136
|
+
stop();
|
|
137
|
+
});
|
|
138
|
+
|
|
99
139
|
test('partial setup rolls back its own registrations on a nested contract failure', () => {
|
|
100
140
|
const { core, slots, register } = registry();
|
|
101
141
|
register({ name: 'source', key: 'nested', children: { detail: { kind: 'single', scope: 'session' } } }, () => null);
|