@deepseek-ai/dsh-client-ui-conversation 0.1.2-alpha.2 → 0.1.2-alpha.3
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.i18n.yaml +2 -2
- package/README.md +6 -2
- package/README.zh.md +6 -2
- package/lib/client.js +402 -214
- package/lib/types/client/contract/conversation.d.ts +1 -1
- package/lib/types/client/contract/slots.d.ts +4 -0
- package/lib/types/client/conversation/assembler.d.ts +20 -4
- package/lib/types/client/conversation/assembly.d.ts +7 -0
- package/lib/types/client/image-labels.d.ts +1 -1
- package/lib/types/client/locales.d.ts +2 -2
- package/lib/types/client/queue/QueueDock.d.ts +4 -1
- package/lib/types/client/skeleton/ConversationSession.d.ts +2 -2
- package/lib/types/client/stores.d.ts +7 -0
- package/lib/types/client/view-selection.d.ts +9 -0
- package/package.json +30 -30
|
@@ -217,7 +217,7 @@ export interface ConversationViewBuilder<Node extends ConversationViewNode = Con
|
|
|
217
217
|
readonly timeline: ConversationTimelineSnapshot;
|
|
218
218
|
}): Snapshot;
|
|
219
219
|
}
|
|
220
|
-
/** Registry contribution that creates
|
|
220
|
+
/** Registry contribution that creates an isolated builder when a Session first uses this target. */
|
|
221
221
|
export interface ConversationViewDefinition<Node extends ConversationViewNode = ConversationViewNode, Snapshot = unknown> {
|
|
222
222
|
readonly target: string;
|
|
223
223
|
/** @returns a new Session-owned incremental builder. */
|
|
@@ -264,6 +264,8 @@ export interface ConversationSessionInjected {
|
|
|
264
264
|
};
|
|
265
265
|
/** Bind input draft persistence to the Session-owned store instance. */
|
|
266
266
|
bindDraftMirror: (write: (text: string) => void) => () => void;
|
|
267
|
+
/** Select and activate one View while addressing an opaque focus request to it. */
|
|
268
|
+
openView: (view: string, focus: string) => void;
|
|
267
269
|
}
|
|
268
270
|
/** Business callbacks injected into the strict Session header. */
|
|
269
271
|
export interface ConversationSessionHeaderInjected {
|
|
@@ -273,6 +275,8 @@ export interface ConversationSessionHeaderInjected {
|
|
|
273
275
|
};
|
|
274
276
|
/** Select a Session through the Session Controller. */
|
|
275
277
|
open: (sessionId: SessionId) => void;
|
|
278
|
+
/** Select and activate one registered Conversation View. */
|
|
279
|
+
selectView: (view: string) => void;
|
|
276
280
|
}
|
|
277
281
|
/** Owner share of the resident composer bar. */
|
|
278
282
|
export interface ComposerBarOwnerProps {
|
|
@@ -22,12 +22,15 @@ export declare class ConversationNodeAssembler implements ConversationViewSnapsh
|
|
|
22
22
|
private readonly contexts;
|
|
23
23
|
private readonly contextsByKind;
|
|
24
24
|
private readonly contextsBySeq;
|
|
25
|
+
private readonly contextsByTarget;
|
|
25
26
|
private readonly inputs;
|
|
26
27
|
private readonly locationIndex;
|
|
27
28
|
private readonly dirty;
|
|
29
|
+
private readonly dirtyByTarget;
|
|
28
30
|
private readonly revised;
|
|
29
31
|
private readonly dependents;
|
|
30
32
|
private readonly views;
|
|
33
|
+
private readonly activeTargets;
|
|
31
34
|
private hasMore;
|
|
32
35
|
private replacePending;
|
|
33
36
|
private timelineDirty;
|
|
@@ -62,30 +65,40 @@ export declare class ConversationNodeAssembler implements ConversationViewSnapsh
|
|
|
62
65
|
*/
|
|
63
66
|
rebuildRegistry(): ConversationPublication;
|
|
64
67
|
/**
|
|
65
|
-
* Materialize dirty Contexts and advance every
|
|
68
|
+
* Materialize dirty Contexts and advance every active view builder.
|
|
66
69
|
* @returns whether any view snapshot was rebuilt or incrementally applied.
|
|
67
70
|
*/
|
|
68
71
|
flush(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Add one target to the monotonic active set and materialize its current snapshot.
|
|
74
|
+
* Pending Context work is flushed before the first complete replacement.
|
|
75
|
+
* @param target - registered or subsequently registered view target.
|
|
76
|
+
* @returns whether any active target snapshot changed.
|
|
77
|
+
*/
|
|
78
|
+
activateTarget(target: string): boolean;
|
|
69
79
|
/**
|
|
70
80
|
* Read the latest snapshot of a registered target.
|
|
71
81
|
* @param target - registered view target.
|
|
72
|
-
* @returns target snapshot, or undefined
|
|
82
|
+
* @returns target snapshot, or undefined before registration or activation.
|
|
73
83
|
*/
|
|
74
84
|
snapshot(target: string): unknown;
|
|
75
85
|
get<Target extends Extract<keyof ConversationViewSnapshotMap, string>>(target: Target): ConversationViewSnapshotMap[Target] | undefined;
|
|
76
86
|
/**
|
|
77
87
|
* Read targets whose owners classify their latest snapshot as visible activity.
|
|
78
|
-
* @returns
|
|
88
|
+
* @returns target ids contributing visible activity.
|
|
79
89
|
*/
|
|
80
|
-
|
|
90
|
+
activityTargets(): ReadonlySet<string>;
|
|
81
91
|
private sortedInputs;
|
|
82
92
|
private matchInput;
|
|
83
93
|
private collectInput;
|
|
84
94
|
private dispatchInput;
|
|
95
|
+
private createContext;
|
|
85
96
|
private acceptMatch;
|
|
86
97
|
private applyPendingMatches;
|
|
87
98
|
private replayContexts;
|
|
88
99
|
private replayContext;
|
|
100
|
+
private indexTargetContext;
|
|
101
|
+
private markDirty;
|
|
89
102
|
private replaceDependencies;
|
|
90
103
|
private replayRevisedDependents;
|
|
91
104
|
private readerFor;
|
|
@@ -96,6 +109,9 @@ export declare class ConversationNodeAssembler implements ConversationViewSnapsh
|
|
|
96
109
|
private replayDependencies;
|
|
97
110
|
private refreshMatchLocations;
|
|
98
111
|
private buildNode;
|
|
112
|
+
private replaceView;
|
|
113
|
+
private buildTargetNodes;
|
|
114
|
+
private buildTargetUpserts;
|
|
99
115
|
private buildLocationData;
|
|
100
116
|
private replaceLocationData;
|
|
101
117
|
private applyDirtyLocationData;
|
|
@@ -12,8 +12,15 @@ import { ConversationViewRegistry } from './view-registry.ts';
|
|
|
12
12
|
/** Observable faces published for one Session's Conversation assembly. */
|
|
13
13
|
export interface ConversationBinding {
|
|
14
14
|
readonly snapshot: ObservableSnapshot<ConversationSnapshot>;
|
|
15
|
+
/**
|
|
16
|
+
* Add one selected target to the Session's monotonic active set.
|
|
17
|
+
* @param target - registered or subsequently registered Conversation target.
|
|
18
|
+
*/
|
|
19
|
+
activate(target: string): void;
|
|
15
20
|
/**
|
|
16
21
|
* Resolve one target-owned snapshot source.
|
|
22
|
+
* The first subscriber activates the target unless shell selection already
|
|
23
|
+
* activated it; activation lasts for the remaining Session lifetime.
|
|
17
24
|
* @param target - registered Conversation target.
|
|
18
25
|
* @returns identity-stable source following the target.
|
|
19
26
|
*/
|
|
@@ -10,7 +10,7 @@ import type { ConversationKey } from './locales.ts';
|
|
|
10
10
|
export declare function imageSizeText(bytes: number): string;
|
|
11
11
|
/**
|
|
12
12
|
* Product copy for a host attachment rejection (the `details.reason` of
|
|
13
|
-
* `session/attachment-invalid` or `subagent/attachment-
|
|
13
|
+
* `session/attachment-invalid` or `subagent/attachment-invalid`).
|
|
14
14
|
* User-solvable reasons name the limit and the way out;
|
|
15
15
|
* reasons the user cannot act on fold into one send-failed line carrying the
|
|
16
16
|
* reason code for a bug report.
|
|
@@ -39,7 +39,6 @@ export declare const zh: {
|
|
|
39
39
|
'image.tooManyPixels': string;
|
|
40
40
|
'image.dimensionTooLarge': string;
|
|
41
41
|
'image.modelUnsupported': string;
|
|
42
|
-
'image.subagentUnsupported': string;
|
|
43
42
|
'image.sendFailed': string;
|
|
44
43
|
'context.aria': string;
|
|
45
44
|
'context.used': string;
|
|
@@ -125,6 +124,7 @@ export declare const zh: {
|
|
|
125
124
|
'web.contentTruncated': string;
|
|
126
125
|
'details.running': string;
|
|
127
126
|
'queue.count': string;
|
|
127
|
+
'queue.image': string;
|
|
128
128
|
'queue.edit': string;
|
|
129
129
|
'queue.edit.unsupported': string;
|
|
130
130
|
'queue.save': string;
|
|
@@ -187,7 +187,6 @@ export declare const en: {
|
|
|
187
187
|
'image.tooManyPixels': string;
|
|
188
188
|
'image.dimensionTooLarge': string;
|
|
189
189
|
'image.modelUnsupported': string;
|
|
190
|
-
'image.subagentUnsupported': string;
|
|
191
190
|
'image.sendFailed': string;
|
|
192
191
|
'context.aria': string;
|
|
193
192
|
'context.used': string;
|
|
@@ -273,6 +272,7 @@ export declare const en: {
|
|
|
273
272
|
'web.contentTruncated': string;
|
|
274
273
|
'details.running': string;
|
|
275
274
|
'queue.count': string;
|
|
275
|
+
'queue.image': string;
|
|
276
276
|
'queue.edit': string;
|
|
277
277
|
'queue.edit.unsupported': string;
|
|
278
278
|
'queue.save': string;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
2
3
|
import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
4
|
import type { QueueAction, QueueItemId } from '../contract/queue.ts';
|
|
4
5
|
/** Queue operations injected by the session-scoped registration. */
|
|
5
6
|
export interface QueueDockInjected {
|
|
6
7
|
updateQueue: (itemId: QueueItemId, action: QueueAction) => Promise<void>;
|
|
7
8
|
notify: (level: 'info' | 'error', text: string) => void;
|
|
9
|
+
/** Resolve one durable queued image into a session-scoped browser URL. */
|
|
10
|
+
loadImage: (attachment: ImageAttachmentRef) => Promise<string>;
|
|
8
11
|
}
|
|
9
12
|
/** Full props of a dock entry: InputZone owner share + session standard kit + global seat + the locale seat. */
|
|
10
13
|
export type QueueDockProps = PropsRuntime<'conversation.input.dock'> & QueueDockInjected & PropsLocale<'conversation'>;
|
|
@@ -12,7 +15,7 @@ export type QueueDockProps = PropsRuntime<'conversation.input.dock'> & QueueDock
|
|
|
12
15
|
* Queue strip: one item renders directly; multiple items default to a
|
|
13
16
|
* collapsible count header; an empty queue renders nothing.
|
|
14
17
|
*/
|
|
15
|
-
export declare function QueueDock({ useSession, updateQueue, notify, t }: QueueDockProps): import("react").JSX.Element | null;
|
|
18
|
+
export declare function QueueDock({ useSession, updateQueue, notify, loadImage, t }: QueueDockProps): import("react").JSX.Element | null;
|
|
16
19
|
/** Registers queue actions backed by the session-scoped conversation service. */
|
|
17
20
|
export declare const queueDockEntry: {
|
|
18
21
|
name: string;
|
|
@@ -9,12 +9,12 @@ export type ConversationSessionHeaderProps = ConversationSessionHeaderSlotProps;
|
|
|
9
9
|
* @param props - Strict Session store, view ledger, navigation, render, and locale shares.
|
|
10
10
|
* @returns the hidden blank-session header or visible title and tabs.
|
|
11
11
|
*/
|
|
12
|
-
export declare function ConversationSessionHeader({ sessionId, useSession, useSessions, useConversation, useConversationViews, useStore,
|
|
12
|
+
export declare function ConversationSessionHeader({ sessionId, useSession, useSessions, useConversation, useConversationViews, useStore, renderSlot, open, selectView, t, }: ConversationSessionHeaderProps): import("react").JSX.Element;
|
|
13
13
|
/**
|
|
14
14
|
* Renders the active Session view inside the resident scrollport and keeps
|
|
15
15
|
* the input draft mirrored while blank Hero chrome is visible.
|
|
16
16
|
* @param props - Strict Session input/store, view ledger, and render shares.
|
|
17
17
|
* @returns the active view area, or null while the Session remains blank.
|
|
18
18
|
*/
|
|
19
|
-
export declare function ConversationSession({ useSession, useConversation, useConversationViews, useInput, inputActions, useStore, actions, renderSlot, bindDraftMirror, }: ConversationSessionProps): import("react").JSX.Element | null;
|
|
19
|
+
export declare function ConversationSession({ useSession, useConversation, useConversationViews, useInput, inputActions, useStore, actions, renderSlot, bindDraftMirror, openView, }: ConversationSessionProps): import("react").JSX.Element | null;
|
|
20
20
|
//# sourceMappingURL=ConversationSession.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Per-session Conversation store shared by the shell body and header. */
|
|
2
2
|
import { type EngineStoreHandle } from '@deepseek-ai/dsh-client-store';
|
|
3
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
3
4
|
import type { ConversationStoreState } from './contract/views.ts';
|
|
4
5
|
/** Declared write set for the Conversation shell. */
|
|
5
6
|
type ConversationActions = {
|
|
@@ -13,5 +14,11 @@ type ConversationActions = {
|
|
|
13
14
|
* @returns the store handle.
|
|
14
15
|
*/
|
|
15
16
|
export declare function createConversationStore(): EngineStoreHandle<ConversationStoreState, ConversationActions>;
|
|
17
|
+
/**
|
|
18
|
+
* Read the persisted View preference before the Slot store is materialized.
|
|
19
|
+
* @param sessionId - Session-scoped persistence suffix.
|
|
20
|
+
* @returns the preferred View id, or null when storage has no usable value.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readConversationViewPreference(sessionId: SessionId): string | null;
|
|
16
23
|
export {};
|
|
17
24
|
//# sourceMappingURL=stores.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ViewTab } from './contract/views.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a preferred registered View, then Chat, without choosing another View.
|
|
4
|
+
* @param tabs - currently registered Views.
|
|
5
|
+
* @param selectedId - preferred View identity, when one is stored.
|
|
6
|
+
* @returns the selected View, Chat fallback, or undefined when neither is registered.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveActiveView(tabs: readonly ViewTab[], selectedId: string | null): ViewTab | undefined;
|
|
9
|
+
//# sourceMappingURL=view-selection.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-conversation",
|
|
3
3
|
"description": "Target-neutral Conversation assembly, shell, composer, queue, and view navigation",
|
|
4
|
-
"version": "0.1.2-alpha.
|
|
4
|
+
"version": "0.1.2-alpha.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -64,35 +64,35 @@
|
|
|
64
64
|
"@types/react-dom": "~18.3.0",
|
|
65
65
|
"zod": "^4.4.3",
|
|
66
66
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
67
|
-
"@deepseek-ai/dsh-api-
|
|
68
|
-
"@deepseek-ai/dsh-api-session-controller": "^0.1.2-alpha.
|
|
69
|
-
"@deepseek-ai/dsh-
|
|
70
|
-
"@deepseek-ai/dsh-attachment": "^0.1.2-alpha.
|
|
71
|
-
"@deepseek-ai/dsh-
|
|
72
|
-
"@deepseek-ai/dsh-client-store": "^0.1.2-alpha.
|
|
73
|
-
"@deepseek-ai/dsh-client-test-runtime": "^0.1.2-alpha.
|
|
74
|
-
"@deepseek-ai/dsh-client-
|
|
75
|
-
"@deepseek-ai/dsh-client-ui-
|
|
76
|
-
"@deepseek-ai/dsh-client-ui-
|
|
77
|
-
"@deepseek-ai/dsh-client-ui-
|
|
78
|
-
"@deepseek-ai/dsh-client-ui-
|
|
79
|
-
"@deepseek-ai/dsh-client-ui-workspace": "^0.1.2-alpha.
|
|
80
|
-
"@deepseek-ai/dsh-client-ui-
|
|
81
|
-
"@deepseek-ai/dsh-
|
|
82
|
-
"@deepseek-ai/dsh-
|
|
83
|
-
"@deepseek-ai/dsh-
|
|
84
|
-
"@deepseek-ai/dsh-
|
|
85
|
-
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.
|
|
86
|
-
"@deepseek-ai/dsh-
|
|
87
|
-
"@deepseek-ai/dsh-
|
|
88
|
-
"@deepseek-ai/dsh-
|
|
89
|
-
"@deepseek-ai/dsh-
|
|
90
|
-
"@deepseek-ai/dsh-
|
|
91
|
-
"@deepseek-ai/dsh-
|
|
92
|
-
"@deepseek-ai/dsh-util-
|
|
93
|
-
"@deepseek-ai/dsh-
|
|
94
|
-
"@deepseek-ai/dsh-
|
|
95
|
-
"@deepseek-ai/dsh-
|
|
67
|
+
"@deepseek-ai/dsh-api-workspace-controller": "^0.1.2-alpha.3",
|
|
68
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.1.2-alpha.3",
|
|
69
|
+
"@deepseek-ai/dsh-brand": "^0.1.2-alpha.3",
|
|
70
|
+
"@deepseek-ai/dsh-attachment": "^0.1.2-alpha.3",
|
|
71
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.2-alpha.3",
|
|
72
|
+
"@deepseek-ai/dsh-client-store": "^0.1.2-alpha.3",
|
|
73
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.2-alpha.3",
|
|
74
|
+
"@deepseek-ai/dsh-client-ui-layout": "^0.1.2-alpha.3",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-alpha.3",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-alpha.3",
|
|
77
|
+
"@deepseek-ai/dsh-client-ui-session": "^0.1.2-alpha.3",
|
|
78
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.2-alpha.3",
|
|
79
|
+
"@deepseek-ai/dsh-client-ui-workspace": "^0.1.2-alpha.3",
|
|
80
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.2-alpha.3",
|
|
81
|
+
"@deepseek-ai/dsh-commands": "^0.1.2-alpha.3",
|
|
82
|
+
"@deepseek-ai/dsh-goal": "^0.1.2-alpha.3",
|
|
83
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3",
|
|
84
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.3",
|
|
85
|
+
"@deepseek-ai/dsh-llm-retry": "^0.1.2-alpha.3",
|
|
86
|
+
"@deepseek-ai/dsh-permission-presets": "^0.1.2-alpha.3",
|
|
87
|
+
"@deepseek-ai/dsh-plan-mode": "^0.1.2-alpha.3",
|
|
88
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.3",
|
|
89
|
+
"@deepseek-ai/dsh-token-meter": "^0.1.2-alpha.3",
|
|
90
|
+
"@deepseek-ai/dsh-tool-todo": "^0.1.2-alpha.3",
|
|
91
|
+
"@deepseek-ai/dsh-util-crypto": "^0.1.2-alpha.3",
|
|
92
|
+
"@deepseek-ai/dsh-util-workspace-path": "^0.1.2-alpha.3",
|
|
93
|
+
"@deepseek-ai/dsh-settings": "^0.1.2-alpha.3",
|
|
94
|
+
"@deepseek-ai/dsh-workspace": "^0.1.2-alpha.3",
|
|
95
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.2-alpha.3"
|
|
96
96
|
},
|
|
97
97
|
"files": [
|
|
98
98
|
"lib/index.js",
|