@kirkchinese/dsh-citeciter 0.4.3 → 0.6.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 +65 -64
- package/README.zh.md +65 -64
- package/lib/client.js +32195 -2477
- package/lib/index.js +1300 -149
- package/lib/{typert-common-4_cbghYz.js → typert-common-C6yTitXx.js} +23 -3
- package/lib/typert.host.js +7 -3
- package/lib/typert.remote-client.js +2 -2
- package/lib/types/board.d.ts +237 -0
- package/lib/types/client/companion-controller.d.ts +15 -6
- package/lib/types/client/components/BlackboardWorkspace.d.ts +18 -0
- package/lib/types/client/components/BoardView.d.ts +12 -0
- package/lib/types/client/components/CiteCiterSettings.d.ts +12 -5
- package/lib/types/client/components/CitePanel.d.ts +14 -6
- package/lib/types/client/components/DocumentReader.d.ts +8 -0
- package/lib/types/client/components/QuestionCard.d.ts +2 -2
- package/lib/types/client/components/SelectionMenu.d.ts +14 -6
- package/lib/types/client/components/UpdateNotice.d.ts +14 -0
- package/lib/types/client/conversation-dom.d.ts +9 -1
- package/lib/types/client/copy.d.ts +6 -0
- package/lib/types/client/dock-geometry.d.ts +23 -0
- package/lib/types/client/entries.d.ts +61 -0
- package/lib/types/client/entry-ids.d.ts +3 -0
- package/lib/types/client/host-dock.d.ts +18 -0
- package/lib/types/client/hotkeys.d.ts +19 -0
- package/lib/types/client/reader-controller.d.ts +33 -0
- package/lib/types/client/reader-selection.d.ts +12 -0
- package/lib/types/client/request-guard.d.ts +24 -1
- package/lib/types/client/rich-content.d.ts +6 -0
- package/lib/types/client/selection.d.ts +5 -3
- package/lib/types/client/topic-presentation.d.ts +15 -0
- package/lib/types/client/types.d.ts +37 -2
- package/lib/types/client/update-controller.d.ts +59 -0
- package/lib/types/client/view-actions.d.ts +26 -0
- package/lib/types/documents.d.ts +45 -0
- package/lib/types/evidence-text.d.ts +29 -0
- package/lib/types/index.d.ts +14 -15
- package/lib/types/observer.d.ts +28 -2
- package/lib/types/service.d.ts +81 -0
- package/lib/types/topic-runtime.d.ts +305 -7
- package/lib/types/topic.d.ts +604 -43
- package/lib/types/typert-common.d.ts +279 -11
- package/lib/types/typert.host.d.ts +671 -34
- package/lib/types/typert.remote-client.d.ts +3 -0
- package/lib/types/update.d.ts +69 -0
- package/lib/update-C0K5ekMg.js +1073 -0
- package/package.json +87 -79
- package/lib/topic-BVNCaVbJ.js +0 -307
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as citeCiterRequestSchema, p as citeCiterResponseSchema, r as updateCheckResponseSchema } from "./update-C0K5ekMg.js";
|
|
2
2
|
//#region lib/types/typert-common.js
|
|
3
3
|
/** Strict root-scoped Topic command shared by Host and browser manifests. */
|
|
4
4
|
const citeCiterRequestDescriptor = {
|
|
@@ -25,9 +25,29 @@ const citeCiterRequestDescriptor = {
|
|
|
25
25
|
},
|
|
26
26
|
sourceLocation: {
|
|
27
27
|
file: "src/index.ts",
|
|
28
|
-
line:
|
|
28
|
+
line: 127,
|
|
29
|
+
column: 3
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/** Strict root-scoped read-only update check shared by Host and browser manifests. */
|
|
33
|
+
const updateCheckDescriptor = {
|
|
34
|
+
id: "@kirkchinese/dsh-citeciter#citeciter/checkUpdate",
|
|
35
|
+
service: "citeciter",
|
|
36
|
+
namespace: "citeciter",
|
|
37
|
+
method: "checkUpdate",
|
|
38
|
+
invocation: { kind: "direct" },
|
|
39
|
+
parameters: [],
|
|
40
|
+
cancellation: { parameter: "signal" },
|
|
41
|
+
result: {
|
|
42
|
+
mode: "strict",
|
|
43
|
+
typeSymbol: "@kirkchinese/dsh-citeciter#UpdateCheckResponse",
|
|
44
|
+
schema: updateCheckResponseSchema
|
|
45
|
+
},
|
|
46
|
+
sourceLocation: {
|
|
47
|
+
file: "src/index.ts",
|
|
48
|
+
line: 134,
|
|
29
49
|
column: 3
|
|
30
50
|
}
|
|
31
51
|
};
|
|
32
52
|
//#endregion
|
|
33
|
-
export { citeCiterRequestDescriptor as t };
|
|
53
|
+
export { updateCheckDescriptor as n, citeCiterRequestDescriptor as t };
|
package/lib/typert.host.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as citeCiterRequestDescriptor } from "./typert-common-
|
|
1
|
+
import { C as topicSummarySchema, S as topicSnapshotSchema, f as citeCiterRequestSchema, l as citationDraftSchema, p as citeCiterResponseSchema, r as updateCheckResponseSchema, u as citationRecordSchema } from "./update-C0K5ekMg.js";
|
|
2
|
+
import { n as updateCheckDescriptor, t as citeCiterRequestDescriptor } from "./typert-common-C6yTitXx.js";
|
|
3
3
|
//#region lib/types/typert.host.js
|
|
4
4
|
/** Handwritten strict Host contribution matching the single Remote decorator. */
|
|
5
5
|
const TYPERT = {
|
|
@@ -29,6 +29,10 @@ const TYPERT = {
|
|
|
29
29
|
{
|
|
30
30
|
name: "CiteCiterResponse",
|
|
31
31
|
schema: citeCiterResponseSchema
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "UpdateCheckResponse",
|
|
35
|
+
schema: updateCheckResponseSchema
|
|
32
36
|
}
|
|
33
37
|
],
|
|
34
38
|
model: {
|
|
@@ -36,7 +40,7 @@ const TYPERT = {
|
|
|
36
40
|
events: [],
|
|
37
41
|
objects: []
|
|
38
42
|
},
|
|
39
|
-
invocations: [citeCiterRequestDescriptor]
|
|
43
|
+
invocations: [citeCiterRequestDescriptor, updateCheckDescriptor]
|
|
40
44
|
};
|
|
41
45
|
//#endregion
|
|
42
46
|
export { TYPERT, TYPERT as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as citeCiterRequestDescriptor } from "./typert-common-
|
|
1
|
+
import { n as updateCheckDescriptor, t as citeCiterRequestDescriptor } from "./typert-common-C6yTitXx.js";
|
|
2
2
|
//#region lib/types/typert.remote-client.js
|
|
3
3
|
/** Browser contribution mounted by the CiteCiter Client fiber. */
|
|
4
4
|
const TYPERT_REMOTE = {
|
|
5
5
|
package: "@kirkchinese/dsh-citeciter",
|
|
6
|
-
descriptors: [citeCiterRequestDescriptor]
|
|
6
|
+
descriptors: [citeCiterRequestDescriptor, updateCheckDescriptor]
|
|
7
7
|
};
|
|
8
8
|
//#endregion
|
|
9
9
|
export { TYPERT_REMOTE, TYPERT_REMOTE as default };
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/** Shared blackboard protocol v4 and deterministic state folding. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/** Wire/version identity carried by every board snapshot. */
|
|
4
|
+
export declare const BOARD_PROTOCOL_VERSION: 4;
|
|
5
|
+
/** Maximum operations accepted in one atomic board commit. */
|
|
6
|
+
export declare const BOARD_MAX_BATCH_OPS = 50;
|
|
7
|
+
/** Maximum elements retained on one board. */
|
|
8
|
+
export declare const BOARD_MAX_ELEMENTS = 50;
|
|
9
|
+
/** Maximum combined UTF-8 element-content bytes retained on one board. */
|
|
10
|
+
export declare const BOARD_MAX_CONTENT_BYTES = 500000;
|
|
11
|
+
/** Element kinds the blackboard renders safely on the chalk canvas. */
|
|
12
|
+
export declare const boardElementKindSchema: z.ZodEnum<{
|
|
13
|
+
text: "text";
|
|
14
|
+
markdown: "markdown";
|
|
15
|
+
math: "math";
|
|
16
|
+
svg: "svg";
|
|
17
|
+
html: "html";
|
|
18
|
+
image: "image";
|
|
19
|
+
table: "table";
|
|
20
|
+
}>;
|
|
21
|
+
export type BoardElementKind = z.infer<typeof boardElementKindSchema>;
|
|
22
|
+
/** Style keys the board renderer applies directly as inline CSS properties. */
|
|
23
|
+
export declare const boardStyleSchema: z.ZodObject<{
|
|
24
|
+
color: z.ZodOptional<z.ZodString>;
|
|
25
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type BoardStyle = z.infer<typeof boardStyleSchema>;
|
|
28
|
+
/** One deterministic blackboard command in canvas-percent coordinates. */
|
|
29
|
+
export declare const boardOpSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
30
|
+
op: z.ZodLiteral<"clear">;
|
|
31
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
32
|
+
op: z.ZodLiteral<"set">;
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
kind: z.ZodEnum<{
|
|
35
|
+
text: "text";
|
|
36
|
+
markdown: "markdown";
|
|
37
|
+
math: "math";
|
|
38
|
+
svg: "svg";
|
|
39
|
+
html: "html";
|
|
40
|
+
image: "image";
|
|
41
|
+
table: "table";
|
|
42
|
+
}>;
|
|
43
|
+
content: z.ZodString;
|
|
44
|
+
x: z.ZodNumber;
|
|
45
|
+
y: z.ZodNumber;
|
|
46
|
+
w: z.ZodNumber;
|
|
47
|
+
h: z.ZodNumber;
|
|
48
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
color: z.ZodOptional<z.ZodString>;
|
|
50
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
53
|
+
op: z.ZodLiteral<"update">;
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
content: z.ZodOptional<z.ZodString>;
|
|
56
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
w: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
h: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
color: z.ZodOptional<z.ZodString>;
|
|
62
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
65
|
+
op: z.ZodLiteral<"remove">;
|
|
66
|
+
id: z.ZodString;
|
|
67
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
68
|
+
op: z.ZodLiteral<"clear_region">;
|
|
69
|
+
x: z.ZodNumber;
|
|
70
|
+
y: z.ZodNumber;
|
|
71
|
+
w: z.ZodNumber;
|
|
72
|
+
h: z.ZodNumber;
|
|
73
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
74
|
+
op: z.ZodLiteral<"animate">;
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
animation: z.ZodEnum<{
|
|
77
|
+
"fade-in": "fade-in";
|
|
78
|
+
"slide-in": "slide-in";
|
|
79
|
+
pulse: "pulse";
|
|
80
|
+
highlight: "highlight";
|
|
81
|
+
}>;
|
|
82
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
iterations: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
85
|
+
op: z.ZodLiteral<"focus">;
|
|
86
|
+
id: z.ZodNullable<z.ZodString>;
|
|
87
|
+
}, z.core.$strict>], "op">;
|
|
88
|
+
export type BoardOp = z.infer<typeof boardOpSchema>;
|
|
89
|
+
/** One validated, non-empty atomic blackboard commit. */
|
|
90
|
+
export declare const boardBatchSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
|
+
op: z.ZodLiteral<"clear">;
|
|
92
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
93
|
+
op: z.ZodLiteral<"set">;
|
|
94
|
+
id: z.ZodString;
|
|
95
|
+
kind: z.ZodEnum<{
|
|
96
|
+
text: "text";
|
|
97
|
+
markdown: "markdown";
|
|
98
|
+
math: "math";
|
|
99
|
+
svg: "svg";
|
|
100
|
+
html: "html";
|
|
101
|
+
image: "image";
|
|
102
|
+
table: "table";
|
|
103
|
+
}>;
|
|
104
|
+
content: z.ZodString;
|
|
105
|
+
x: z.ZodNumber;
|
|
106
|
+
y: z.ZodNumber;
|
|
107
|
+
w: z.ZodNumber;
|
|
108
|
+
h: z.ZodNumber;
|
|
109
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
110
|
+
color: z.ZodOptional<z.ZodString>;
|
|
111
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strict>>;
|
|
113
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
114
|
+
op: z.ZodLiteral<"update">;
|
|
115
|
+
id: z.ZodString;
|
|
116
|
+
content: z.ZodOptional<z.ZodString>;
|
|
117
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
w: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
h: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
122
|
+
color: z.ZodOptional<z.ZodString>;
|
|
123
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, z.core.$strict>>;
|
|
125
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
126
|
+
op: z.ZodLiteral<"remove">;
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
129
|
+
op: z.ZodLiteral<"clear_region">;
|
|
130
|
+
x: z.ZodNumber;
|
|
131
|
+
y: z.ZodNumber;
|
|
132
|
+
w: z.ZodNumber;
|
|
133
|
+
h: z.ZodNumber;
|
|
134
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
135
|
+
op: z.ZodLiteral<"animate">;
|
|
136
|
+
id: z.ZodString;
|
|
137
|
+
animation: z.ZodEnum<{
|
|
138
|
+
"fade-in": "fade-in";
|
|
139
|
+
"slide-in": "slide-in";
|
|
140
|
+
pulse: "pulse";
|
|
141
|
+
highlight: "highlight";
|
|
142
|
+
}>;
|
|
143
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
iterations: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
146
|
+
op: z.ZodLiteral<"focus">;
|
|
147
|
+
id: z.ZodNullable<z.ZodString>;
|
|
148
|
+
}, z.core.$strict>], "op">>;
|
|
149
|
+
/** One rendered blackboard element after op folding. */
|
|
150
|
+
export interface BoardElementState {
|
|
151
|
+
readonly id: string;
|
|
152
|
+
readonly kind: BoardElementKind;
|
|
153
|
+
readonly content: string;
|
|
154
|
+
readonly x: number;
|
|
155
|
+
readonly y: number;
|
|
156
|
+
readonly w: number;
|
|
157
|
+
readonly h: number;
|
|
158
|
+
readonly style: BoardStyle;
|
|
159
|
+
readonly focused: boolean;
|
|
160
|
+
readonly animation?: {
|
|
161
|
+
readonly name: 'fade-in' | 'slide-in' | 'pulse' | 'highlight';
|
|
162
|
+
readonly durationMs: number;
|
|
163
|
+
readonly iterations: number;
|
|
164
|
+
readonly run: number;
|
|
165
|
+
} | undefined;
|
|
166
|
+
}
|
|
167
|
+
/** Immutable blackboard state keyed by element id. */
|
|
168
|
+
export type BoardState = ReadonlyMap<string, BoardElementState>;
|
|
169
|
+
/** Empty immutable input for the first board commit. */
|
|
170
|
+
export declare const EMPTY_BOARD_STATE: BoardState;
|
|
171
|
+
/**
|
|
172
|
+
* Apply one validated op batch atomically to the current board state.
|
|
173
|
+
* @param state - current element map.
|
|
174
|
+
* @param ops - validated, non-empty ops in application order.
|
|
175
|
+
* @returns the new state and the number of applied ops.
|
|
176
|
+
*/
|
|
177
|
+
export declare function applyBoardOps(state: BoardState, ops: readonly BoardOp[]): {
|
|
178
|
+
readonly state: BoardState;
|
|
179
|
+
readonly revision: number;
|
|
180
|
+
};
|
|
181
|
+
/** Snapshot field containing only the final projected board state. */
|
|
182
|
+
export declare const boardSnapshotSchema: z.ZodObject<{
|
|
183
|
+
version: z.ZodLiteral<4>;
|
|
184
|
+
revision: z.ZodNumber;
|
|
185
|
+
elements: z.ZodArray<z.ZodObject<{
|
|
186
|
+
id: z.ZodString;
|
|
187
|
+
kind: z.ZodEnum<{
|
|
188
|
+
text: "text";
|
|
189
|
+
markdown: "markdown";
|
|
190
|
+
math: "math";
|
|
191
|
+
svg: "svg";
|
|
192
|
+
html: "html";
|
|
193
|
+
image: "image";
|
|
194
|
+
table: "table";
|
|
195
|
+
}>;
|
|
196
|
+
content: z.ZodString;
|
|
197
|
+
x: z.ZodNumber;
|
|
198
|
+
y: z.ZodNumber;
|
|
199
|
+
w: z.ZodNumber;
|
|
200
|
+
h: z.ZodNumber;
|
|
201
|
+
style: z.ZodObject<{
|
|
202
|
+
color: z.ZodOptional<z.ZodString>;
|
|
203
|
+
fontSize: z.ZodOptional<z.ZodString>;
|
|
204
|
+
}, z.core.$strict>;
|
|
205
|
+
focused: z.ZodBoolean;
|
|
206
|
+
animation: z.ZodOptional<z.ZodObject<{
|
|
207
|
+
name: z.ZodEnum<{
|
|
208
|
+
"fade-in": "fade-in";
|
|
209
|
+
"slide-in": "slide-in";
|
|
210
|
+
pulse: "pulse";
|
|
211
|
+
highlight: "highlight";
|
|
212
|
+
}>;
|
|
213
|
+
durationMs: z.ZodNumber;
|
|
214
|
+
iterations: z.ZodNumber;
|
|
215
|
+
run: z.ZodNumber;
|
|
216
|
+
}, z.core.$strict>>;
|
|
217
|
+
}, z.core.$strict>>;
|
|
218
|
+
invalid: z.ZodNumber;
|
|
219
|
+
}, z.core.$strict>;
|
|
220
|
+
export type BoardSnapshot = z.infer<typeof boardSnapshotSchema>;
|
|
221
|
+
/** Empty snapshot used before any board commit. */
|
|
222
|
+
export declare const EMPTY_BOARD_SNAPSHOT: BoardSnapshot;
|
|
223
|
+
/**
|
|
224
|
+
* Read renderable elements from one final-state snapshot.
|
|
225
|
+
* @param snapshot - projected final board state.
|
|
226
|
+
* @returns ordered elements plus the committed revision.
|
|
227
|
+
*/
|
|
228
|
+
export declare function foldBoardSnapshot(snapshot: BoardSnapshot): {
|
|
229
|
+
readonly elements: readonly BoardElementState[];
|
|
230
|
+
readonly revision: number;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* Fold a raw op list from first-set order; used by protocol tests.
|
|
234
|
+
* @param ops - one validated op batch.
|
|
235
|
+
* @returns final elements in insertion order.
|
|
236
|
+
*/
|
|
237
|
+
export declare function foldBoardElements(ops: readonly BoardOp[]): readonly BoardElementState[];
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
2
|
+
import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
3
|
+
import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
4
|
+
import type { ChatSnapshot } from '@deepseek-ai/dsh-client-ui-chat/client';
|
|
2
5
|
import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
-
import { type CiteCiterRequest, type CiteCiterResponse, type CiteCiterSettings, type ProviderOption, type QuestionAnswer, type TopicSnapshot, type TopicSummary } from '../topic.ts';
|
|
4
|
-
import { type CreateMode } from './request-guard.ts';
|
|
6
|
+
import { type CiteCiterRequest, type CiteCiterResponse, type CiteCiterSettings, type ProviderOption, type QuestionAnswer, type TopicScenario, type TopicSnapshot, type TopicSummary } from '../topic.ts';
|
|
7
|
+
import { type CreateMode, type DocumentClaimIntent } from './request-guard.ts';
|
|
5
8
|
import type { CiteSelection } from './types.ts';
|
|
6
9
|
export type CompanionPhase = 'idle' | 'creating' | 'ready' | 'running' | 'stopping' | 'stopped' | 'error';
|
|
7
10
|
export type { CreateMode } from './request-guard.ts';
|
|
@@ -24,6 +27,8 @@ export interface CompanionSnapshot {
|
|
|
24
27
|
reasoningEffortSaving: boolean;
|
|
25
28
|
renaming: boolean;
|
|
26
29
|
archiving: boolean;
|
|
30
|
+
deleting: boolean;
|
|
31
|
+
notice: string | null;
|
|
27
32
|
includeArchived: boolean;
|
|
28
33
|
error: string | null;
|
|
29
34
|
}
|
|
@@ -32,8 +37,10 @@ export interface CompanionFace {
|
|
|
32
37
|
getSnapshot(): CompanionSnapshot;
|
|
33
38
|
subscribe(listener: () => void): () => void;
|
|
34
39
|
setSource(sessionId: SessionId | null): void;
|
|
35
|
-
|
|
36
|
-
create(selection: CiteSelection, question: string, mode?: CreateMode): Promise<void>;
|
|
40
|
+
retainVisible(): () => void;
|
|
41
|
+
create(selection: CiteSelection, question: string, mode?: CreateMode, scenario?: TopicScenario): Promise<void>;
|
|
42
|
+
createFree(question: string, scenario: Extract<TopicScenario, 'qa' | 'present'>): Promise<boolean>;
|
|
43
|
+
createFromDocument(claim: DocumentClaimIntent, question: string): Promise<void>;
|
|
37
44
|
openTopic(sessionId: string): Promise<void>;
|
|
38
45
|
ask(question: string): Promise<boolean>;
|
|
39
46
|
answerQuestion(key: string, answer: QuestionAnswer): Promise<void>;
|
|
@@ -41,6 +48,8 @@ export interface CompanionFace {
|
|
|
41
48
|
stop(): Promise<void>;
|
|
42
49
|
rename(title: string): Promise<boolean>;
|
|
43
50
|
archive(archived: boolean): Promise<boolean>;
|
|
51
|
+
deleteTopic(confirmSessionId: string): Promise<'complete' | 'pending' | false>;
|
|
52
|
+
dismissError(): void;
|
|
44
53
|
setIncludeArchived(include: boolean): void;
|
|
45
54
|
setModelRoute(provider: string, model: string): Promise<void>;
|
|
46
55
|
setReasoningEffort(reasoningEffort: string | null): Promise<void>;
|
|
@@ -50,4 +59,4 @@ export interface CompanionFace {
|
|
|
50
59
|
/** Initial browser snapshot for the root-scoped CiteCiter controller. */
|
|
51
60
|
export declare const INITIAL_COMPANION_SNAPSHOT: CompanionSnapshot;
|
|
52
61
|
/** Bind private Topic Remote calls to one browser snapshot and polling lifecycle. */
|
|
53
|
-
export declare function createCompanionController(
|
|
62
|
+
export declare function createCompanionController(readChat: (sessionId: SessionId) => ChatSnapshot | undefined, settingsScope: SettingsScope<CiteCiterSettings>, request: RemoteRequest, onAutoOpen: () => void, store: SnapshotStore<CompanionSnapshot>): CompanionFace;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
|
|
2
|
+
import type { CompanionSnapshot } from '../companion-controller.ts';
|
|
3
|
+
import type { CompanionActions, OverlayActions } from '../view-actions.ts';
|
|
4
|
+
import type { ConvViewProps } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
5
|
+
/** Additional faces owned by CiteCiter's conversation-view registration. */
|
|
6
|
+
export interface BlackboardWorkspaceInjected {
|
|
7
|
+
readonly useCompanion: SnapshotSelectorHook<CompanionSnapshot>;
|
|
8
|
+
readonly companion: CompanionActions;
|
|
9
|
+
readonly bus: OverlayActions;
|
|
10
|
+
readonly openPanel: () => void;
|
|
11
|
+
}
|
|
12
|
+
export type BlackboardWorkspaceProps = ConvViewProps & BlackboardWorkspaceInjected;
|
|
13
|
+
/**
|
|
14
|
+
* Render the session-scoped blackboard registered through conversation.view.
|
|
15
|
+
* @param props - active DSH conversation identity and CiteCiter browser faces.
|
|
16
|
+
* @returns the matching Topic board or a source-specific empty state.
|
|
17
|
+
*/
|
|
18
|
+
export declare function BlackboardWorkspace({ useCompanion, sessionId, companion, bus, openPanel }: BlackboardWorkspaceProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import 'katex/dist/katex.min.css';
|
|
2
|
+
import { type BoardElementState, type BoardSnapshot } from '../../board.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Render one final-state blackboard projection in the main conversation workspace.
|
|
5
|
+
* @param props - board snapshot, motion preference, and optional citation action.
|
|
6
|
+
* @returns the safe blackboard canvas.
|
|
7
|
+
*/
|
|
8
|
+
export declare function BoardView({ snapshot, animations, onQuoteElement, }: {
|
|
9
|
+
readonly snapshot: BoardSnapshot | undefined;
|
|
10
|
+
readonly animations: boolean;
|
|
11
|
+
readonly onQuoteElement?: (element: BoardElementState) => void;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
|
|
2
|
+
import type { UpdateNoticeSnapshot } from '../update-controller.ts';
|
|
3
|
+
import type { SettingsDocumentSnapshot } from '../settings-document.ts';
|
|
4
|
+
import type { CompanionSnapshot } from '../companion-controller.ts';
|
|
5
|
+
import type { CompanionActions, UpdateActions, SettingsDocumentActions } from '../view-actions.ts';
|
|
1
6
|
import type { SettingsSectionOwnerProps } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
2
|
-
import type { CompanionFace } from '../companion-controller.ts';
|
|
3
|
-
import type { SettingsDocumentController } from '../settings-document.ts';
|
|
4
7
|
export interface CiteCiterSettingsProps extends SettingsSectionOwnerProps {
|
|
5
|
-
readonly
|
|
6
|
-
readonly
|
|
8
|
+
readonly useCompanion: SnapshotSelectorHook<CompanionSnapshot>;
|
|
9
|
+
readonly useDocument: SnapshotSelectorHook<SettingsDocumentSnapshot>;
|
|
10
|
+
readonly useUpdate: SnapshotSelectorHook<UpdateNoticeSnapshot>;
|
|
11
|
+
readonly companion: CompanionActions;
|
|
12
|
+
readonly settingsDocument: SettingsDocumentActions;
|
|
13
|
+
readonly updateController: UpdateActions;
|
|
7
14
|
}
|
|
8
15
|
/** Native DSH settings page for CiteCiter-owned preferences. */
|
|
9
|
-
export declare function CiteCiterSettings({ companion, settingsDocument }: CiteCiterSettingsProps): import("react").JSX.Element;
|
|
16
|
+
export declare function CiteCiterSettings({ useCompanion, useDocument, useUpdate, companion, settingsDocument, updateController }: CiteCiterSettingsProps): import("react").JSX.Element;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
|
|
2
|
+
import type { CiteOverlaySnapshot } from '../types.ts';
|
|
3
|
+
import type { CompanionSnapshot } from '../companion-controller.ts';
|
|
4
|
+
import type { CompanionActions, OverlayActions } from '../view-actions.ts';
|
|
3
5
|
export interface CitePanelProps {
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
6
|
+
readonly useCompanion: SnapshotSelectorHook<CompanionSnapshot>;
|
|
7
|
+
readonly useOverlay: SnapshotSelectorHook<CiteOverlaySnapshot>;
|
|
8
|
+
readonly bus: OverlayActions;
|
|
9
|
+
readonly companion: CompanionActions;
|
|
6
10
|
readonly closePanel: () => void;
|
|
7
11
|
readonly reportParseError: (messageId: string) => void;
|
|
8
12
|
}
|
|
9
|
-
/**
|
|
10
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Render the independent Topic workspace on the right edge of the shell.
|
|
15
|
+
* @param props - shared panel bus, Topic controller, and host callbacks.
|
|
16
|
+
* @returns the responsive Topic dock and its dialogs, or null while closed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function CitePanel({ useCompanion, useOverlay, bus, companion, closePanel, reportParseError }: CitePanelProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
|
|
2
|
+
import type { ReaderSnapshot } from '../reader-controller.ts';
|
|
3
|
+
import type { ReaderActions } from '../view-actions.ts';
|
|
4
|
+
/** Reader shell-overlay entry: compact trigger plus the document library panel. */
|
|
5
|
+
export declare function DocumentReader({ reader, useReader }: {
|
|
6
|
+
readonly reader: ReaderActions;
|
|
7
|
+
readonly useReader: SnapshotSelectorHook<ReaderSnapshot>;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CompanionActions } from '../view-actions.ts';
|
|
2
2
|
import type { PendingQuestion } from '../../topic.ts';
|
|
3
3
|
export interface QuestionCardProps {
|
|
4
|
-
readonly companion:
|
|
4
|
+
readonly companion: CompanionActions;
|
|
5
5
|
readonly pending: PendingQuestion;
|
|
6
6
|
}
|
|
7
7
|
/** Collect one standard DSH ask_user_question answer batch inside the private Topic. */
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
|
|
2
|
+
import type { CiteOverlaySnapshot } from '../types.ts';
|
|
3
|
+
import type { CompanionSnapshot } from '../companion-controller.ts';
|
|
4
|
+
import type { CompanionActions, OverlayActions } from '../view-actions.ts';
|
|
3
5
|
export interface SelectionMenuProps {
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
6
|
+
readonly useCompanion: SnapshotSelectorHook<CompanionSnapshot>;
|
|
7
|
+
readonly useOverlay: SnapshotSelectorHook<CiteOverlaySnapshot>;
|
|
8
|
+
readonly bus: OverlayActions;
|
|
9
|
+
readonly companion: CompanionActions;
|
|
6
10
|
readonly openPanel: () => void;
|
|
7
11
|
}
|
|
8
|
-
/**
|
|
9
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Ask the first question beside the selected source text.
|
|
14
|
+
* @param props - shared selection state and Topic actions.
|
|
15
|
+
* @returns the contextual creation popover and companion launcher.
|
|
16
|
+
*/
|
|
17
|
+
export declare function SelectionMenu({ useCompanion, useOverlay, bus, companion, openPanel }: SelectionMenuProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
|
|
2
|
+
import type { UpdateNoticeSnapshot } from '../update-controller.ts';
|
|
3
|
+
import type { UpdateActions } from '../view-actions.ts';
|
|
4
|
+
/** Injected owner of the root-scoped update state. */
|
|
5
|
+
export interface UpdateNoticeProps {
|
|
6
|
+
readonly useUpdate: SnapshotSelectorHook<UpdateNoticeSnapshot>;
|
|
7
|
+
readonly updateController: UpdateActions;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Render the non-modal Web update notice in the frame-wide overlay.
|
|
11
|
+
* @param props - root-scoped update actions and observable state.
|
|
12
|
+
* @returns the available-version card, or no surface while current or suppressed.
|
|
13
|
+
*/
|
|
14
|
+
export declare function UpdateNotice({ useUpdate, updateController }: UpdateNoticeProps): import("react").JSX.Element | null;
|
|
@@ -41,13 +41,21 @@ export declare function dshAssistantAnchorForTarget(target: EventTarget | null):
|
|
|
41
41
|
*/
|
|
42
42
|
export declare function dshIntersectedAssistantAnchors(range: Range): DshAssistantAnchor[];
|
|
43
43
|
/**
|
|
44
|
-
* Detect generated controls
|
|
44
|
+
* Detect generated controls and collapsed code chrome.
|
|
45
45
|
*
|
|
46
46
|
* @param range - current rendered selection range.
|
|
47
47
|
* @param flow - assistant flow containing the range.
|
|
48
48
|
* @returns whether the range touches content that CiteCiter must ignore.
|
|
49
49
|
*/
|
|
50
50
|
export declare function dshRangeTouchesExcludedContent(range: Range, flow: HTMLElement): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Detect a selection endpoint inside a generated reasoning disclosure row.
|
|
53
|
+
*
|
|
54
|
+
* @param range - current rendered selection range.
|
|
55
|
+
* @param flow - assistant flow containing the range.
|
|
56
|
+
* @returns whether a collapsed or expanded reasoning header anchors the selection.
|
|
57
|
+
*/
|
|
58
|
+
export declare function dshRangeHasReasoningHeaderEndpoint(range: Range, flow: HTMLElement): boolean;
|
|
51
59
|
/**
|
|
52
60
|
* Find the current DSH assistant element for a persisted anchor key.
|
|
53
61
|
*
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Chinese presentation copy owned by CiteCiter, including shared primitive chrome. */
|
|
2
|
+
import type { JsonTreeLabels, MarkdownLabels } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
+
/** Localized labels supplied to the Cordis-free Markdown renderer. */
|
|
4
|
+
export declare const markdownLabels: MarkdownLabels;
|
|
5
|
+
/** Localized labels supplied to the Cordis-free JSON inspector. */
|
|
6
|
+
export declare const jsonTreeLabels: JsonTreeLabels;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Space allocation for the learning panel inside the host content viewport. */
|
|
2
|
+
export interface DockViewport {
|
|
3
|
+
readonly width: number;
|
|
4
|
+
readonly height: number;
|
|
5
|
+
readonly sidebar: number;
|
|
6
|
+
readonly details: number;
|
|
7
|
+
readonly caption: number;
|
|
8
|
+
readonly percent: number;
|
|
9
|
+
}
|
|
10
|
+
/** The host keeps its conversation and details visible in both arrangements. */
|
|
11
|
+
export interface DockGeometry {
|
|
12
|
+
readonly mode: 'columns' | 'rows';
|
|
13
|
+
readonly width: number;
|
|
14
|
+
readonly height: number;
|
|
15
|
+
readonly top: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Reserve a separate column, or a bottom row when two readable columns cannot fit.
|
|
19
|
+
* CSS pixels already account for browser zoom and Windows display scaling.
|
|
20
|
+
* @param viewport - measured host dimensions and the saved width preference.
|
|
21
|
+
* @returns panel dimensions within the host, excluding its native caption.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveDockGeometry(viewport: DockViewport): DockGeometry;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client entry-point registry: every "start a Citer from here" surface
|
|
3
|
+
* contributes one entry that probes the pointer event and claims a selection.
|
|
4
|
+
* Entries run in registration order; the first claim wins and is allowed to
|
|
5
|
+
* prevent the native context menu.
|
|
6
|
+
*/
|
|
7
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
8
|
+
import type { ChatSnapshot } from '@deepseek-ai/dsh-client-ui-chat/client';
|
|
9
|
+
import type { CiteSelection } from './types.ts';
|
|
10
|
+
/** Live browser facts an entry needs to resolve one selection. */
|
|
11
|
+
export interface CiteCiterEntryContext {
|
|
12
|
+
readonly readChat: (sessionId: SessionId) => ChatSnapshot | undefined;
|
|
13
|
+
readonly sourceSessionId: SessionId;
|
|
14
|
+
}
|
|
15
|
+
/** One Citer entry point: probe, capture, and claim a selection from the DOM. */
|
|
16
|
+
export interface CiteCiterEntry {
|
|
17
|
+
/** Stable entry identity recorded on the claimed selection. */
|
|
18
|
+
readonly id: string;
|
|
19
|
+
/**
|
|
20
|
+
* Claim the current pointer event for this entry.
|
|
21
|
+
* @param event - context-menu event whose position anchors the claim.
|
|
22
|
+
* @param context - current source session and its bindings.
|
|
23
|
+
* @returns a validated selection, or null when this entry does not own the event.
|
|
24
|
+
*/
|
|
25
|
+
claim(event: MouseEvent, context: CiteCiterEntryContext): CiteSelection | null;
|
|
26
|
+
}
|
|
27
|
+
/** Mutable ordered entry registry with effect-style registration. */
|
|
28
|
+
export interface CiteCiterEntryRegistry {
|
|
29
|
+
/**
|
|
30
|
+
* Append one entry.
|
|
31
|
+
* @param entry - immutable entry contribution.
|
|
32
|
+
* @returns disposer removing the exact entry.
|
|
33
|
+
*/
|
|
34
|
+
register(entry: CiteCiterEntry): () => void;
|
|
35
|
+
/** Registered entries in claim order. */
|
|
36
|
+
list(): readonly CiteCiterEntry[];
|
|
37
|
+
/**
|
|
38
|
+
* Ask entries in order for a claimed selection.
|
|
39
|
+
* @returns the first entry claim, or null when no entry owns the event.
|
|
40
|
+
*/
|
|
41
|
+
claim(event: MouseEvent, context: CiteCiterEntryContext): {
|
|
42
|
+
readonly entry: CiteCiterEntry;
|
|
43
|
+
readonly selection: CiteSelection;
|
|
44
|
+
} | null;
|
|
45
|
+
}
|
|
46
|
+
/** Create an ordered client entry registry. */
|
|
47
|
+
export declare function createCiteCiterEntryRegistry(): CiteCiterEntryRegistry;
|
|
48
|
+
/**
|
|
49
|
+
* Built-in assistant answer entry: resolves a selection inside a committed
|
|
50
|
+
* `assistant-step` flow, including collapsed reasoning disclosure rows.
|
|
51
|
+
* @returns the entry contribution; register it on the shared registry.
|
|
52
|
+
*/
|
|
53
|
+
export declare function createAssistantEntry(): CiteCiterEntry;
|
|
54
|
+
/**
|
|
55
|
+
* Built-in tool evidence entry: claims a whole-card tool result from its
|
|
56
|
+
* `call:<callId>` row and the enclosing `tool-call` chat flow. Terminal and
|
|
57
|
+
* diff cards select their dedicated projections; everything else is
|
|
58
|
+
* `result-text`.
|
|
59
|
+
* @returns the entry contribution; register it after the assistant entry.
|
|
60
|
+
*/
|
|
61
|
+
export declare function createToolEvidenceEntry(): CiteCiterEntry;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Isolated, disposable layout adapter for DSH rc.1 and Desktop 2.0.5 frames. */
|
|
2
|
+
import { type RefObject } from 'react';
|
|
3
|
+
import { type DockGeometry } from './dock-geometry.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Locate the frame owning the public shell.overlay contribution.
|
|
6
|
+
* @param panel - mounted learning panel.
|
|
7
|
+
* @returns its immediate frame, or null before mounting.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findContainingFrame(panel: HTMLElement | null): HTMLElement | null;
|
|
10
|
+
/**
|
|
11
|
+
* Reserve host space without rewriting the host's saved columns or hiding details.
|
|
12
|
+
* Unknown frame structures receive no DOM changes. All owned styles disappear on close.
|
|
13
|
+
* @param panel - mounted panel reference.
|
|
14
|
+
* @param open - whether space should be reserved.
|
|
15
|
+
* @param percent - user's preferred fraction of the content viewport.
|
|
16
|
+
* @returns measured panel placement; null when the host frame is unsupported.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useHostDock(panel: RefObject<HTMLElement | null>, open: boolean, percent: number): DockGeometry | null;
|