@kirkchinese/dsh-citeciter 0.2.1 → 0.3.1
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 +39 -55
- package/README.zh.md +35 -70
- package/lib/client.js +16302 -1062
- package/lib/index.js +1260 -241
- package/lib/topic-BfAp9KoS.js +269 -0
- package/lib/typert-common-DXguoziV.js +32 -0
- package/lib/typert.host.js +30 -11
- package/lib/typert.remote-client.js +2 -2
- package/lib/types/client/citation.d.ts +10 -0
- package/lib/types/client/companion-controller.d.ts +39 -0
- package/lib/types/client/components/CiteCiterSettings.d.ts +7 -0
- package/lib/types/client/components/CitePanel.d.ts +7 -10
- package/lib/types/client/components/QuestionCard.d.ts +8 -0
- package/lib/types/client/components/SelectionMenu.d.ts +6 -11
- package/lib/types/client/index.d.ts +2 -2
- package/lib/types/client/markdown-source-map.d.ts +16 -0
- package/lib/types/client/response-guard.d.ts +4 -0
- package/lib/types/client/types.d.ts +16 -31
- package/lib/types/index.d.ts +33 -22
- package/lib/types/observer.d.ts +44 -0
- package/lib/types/topic-runtime.d.ts +56 -0
- package/lib/types/topic.d.ts +559 -0
- package/lib/types/typert-common.d.ts +226 -69
- package/lib/types/typert.host.d.ts +577 -58
- package/lib/types/typert.remote-client.d.ts +3 -8
- package/package.json +70 -32
- package/lib/thread-D7ig_Lk7.js +0 -68
- package/lib/typert-common-CLPMRe7a.js +0 -51
- package/lib/types/client/explainer-controller.d.ts +0 -31
- package/lib/types/client/explainer.d.ts +0 -5
- package/lib/types/client/thread.d.ts +0 -22
- package/lib/types/client/transcript.d.ts +0 -14
- package/lib/types/projection.d.ts +0 -4
- package/lib/types/read-only.d.ts +0 -13
- package/lib/types/thread.d.ts +0 -107
- package/lib/types/validation.d.ts +0 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type JsonValue, type SessionEvent, type SessionHeader } from '@deepseek-ai/dsh-session';
|
|
2
|
+
import { type CitationDraft } from './topic.ts';
|
|
3
|
+
/** One atomic live-preferred SessionQuery observation. */
|
|
4
|
+
export interface ObserverSourceSnapshot {
|
|
5
|
+
readonly session: Pick<SessionHeader, 'id' | 'cwd'>;
|
|
6
|
+
readonly events: readonly SessionEvent[];
|
|
7
|
+
}
|
|
8
|
+
/** Authoritative facts resolved for a browser-submitted Citation. */
|
|
9
|
+
export interface ValidatedObserverCitation {
|
|
10
|
+
readonly citation: CitationDraft;
|
|
11
|
+
readonly assistantMessageSeq: number;
|
|
12
|
+
readonly assistantVisibleText: string;
|
|
13
|
+
readonly contentFingerprint: string;
|
|
14
|
+
}
|
|
15
|
+
/** Options for one bounded `read_source_session` result. */
|
|
16
|
+
export interface SourceReadOptions {
|
|
17
|
+
readonly fromSeq?: number;
|
|
18
|
+
readonly throughSeq?: number;
|
|
19
|
+
readonly includeReasoning: boolean;
|
|
20
|
+
/** Maximum UTF-8 bytes occupied by the serialized `events` array. */
|
|
21
|
+
readonly maxBytes: number;
|
|
22
|
+
}
|
|
23
|
+
/** One lossless-JSON evidence record emitted by `read_source_session`. */
|
|
24
|
+
export type SourceEvidenceEvent = JsonValue;
|
|
25
|
+
/** Complete bounded source-read payload recorded as the Topic tool result. */
|
|
26
|
+
export interface SourceReadResult {
|
|
27
|
+
readonly sourceSessionId: string;
|
|
28
|
+
readonly requestedFromSeq: number;
|
|
29
|
+
readonly requestedThroughSeq: number | null;
|
|
30
|
+
readonly capturedThroughSeq: number | null;
|
|
31
|
+
readonly availableThroughSeq: number | null;
|
|
32
|
+
readonly truncated: boolean;
|
|
33
|
+
readonly bytesUsed: number;
|
|
34
|
+
readonly events: readonly SourceEvidenceEvent[];
|
|
35
|
+
}
|
|
36
|
+
/** Compute the SHA-256 identity carried by the current CitationDraft schema. */
|
|
37
|
+
export declare function fingerprintCitationDraft(draft: Omit<CitationDraft, 'selectionFingerprint'>): string;
|
|
38
|
+
/**
|
|
39
|
+
* Validate one Citation against a committed assistant message in the observed source snapshot.
|
|
40
|
+
* A matching `assistant/message` is sufficient; its step and turn may remain open.
|
|
41
|
+
*/
|
|
42
|
+
export declare function validateObserverCitation(source: ObserverSourceSnapshot, rawDraft: CitationDraft): ValidatedObserverCitation;
|
|
43
|
+
/** Format one seq range without exposing chunks or exceeding the event-array byte budget. */
|
|
44
|
+
export declare function formatSourceSessionRead(source: ObserverSourceSnapshot, options: SourceReadOptions): SourceReadResult;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { type CiteCiterRequest, type CiteCiterResponse, type CiteCiterSettings } from './topic.ts';
|
|
3
|
+
/** One process-local private DSH tree with standard Session logs and Agent loop. */
|
|
4
|
+
export declare class TopicRuntime {
|
|
5
|
+
private readonly host;
|
|
6
|
+
private readonly settings;
|
|
7
|
+
private readonly runtime;
|
|
8
|
+
private readonly index;
|
|
9
|
+
private readonly fibers;
|
|
10
|
+
private readonly handles;
|
|
11
|
+
private readonly selections;
|
|
12
|
+
private readonly opening;
|
|
13
|
+
private readonly pendingQuestions;
|
|
14
|
+
private readonly ready;
|
|
15
|
+
private disposal;
|
|
16
|
+
private releasing;
|
|
17
|
+
private releaseLlm;
|
|
18
|
+
private releaseFs;
|
|
19
|
+
private releaseSubprocess;
|
|
20
|
+
private releaseSandboxPolicy;
|
|
21
|
+
private releaseQuestionProvider;
|
|
22
|
+
private hasSourceFiles;
|
|
23
|
+
private closed;
|
|
24
|
+
/** @param host - owning DSH context. @param settings - current user preferences. */
|
|
25
|
+
constructor(host: Context, settings?: () => CiteCiterSettings);
|
|
26
|
+
/** Wait until every private DSH service has started. */
|
|
27
|
+
initialize(): Promise<void>;
|
|
28
|
+
/** Execute one validated browser command against private Topics. */
|
|
29
|
+
request(rawRequest: CiteCiterRequest): Promise<CiteCiterResponse>;
|
|
30
|
+
/** Stop every owned Agent and plugin fiber before releasing bridged services. */
|
|
31
|
+
dispose(): Promise<void>;
|
|
32
|
+
private disposeOwned;
|
|
33
|
+
private start;
|
|
34
|
+
private releaseRuntime;
|
|
35
|
+
private releaseOwnedRuntime;
|
|
36
|
+
private create;
|
|
37
|
+
private createHandle;
|
|
38
|
+
private setupAgent;
|
|
39
|
+
private sourceTool;
|
|
40
|
+
private ensureHandle;
|
|
41
|
+
private ask;
|
|
42
|
+
private askUser;
|
|
43
|
+
private answerQuestion;
|
|
44
|
+
private cancelQuestion;
|
|
45
|
+
private stop;
|
|
46
|
+
private rename;
|
|
47
|
+
private archive;
|
|
48
|
+
private delete;
|
|
49
|
+
private removeSessionArtifact;
|
|
50
|
+
private selectModel;
|
|
51
|
+
private models;
|
|
52
|
+
private list;
|
|
53
|
+
private readLog;
|
|
54
|
+
private sourceAvailable;
|
|
55
|
+
private snapshot;
|
|
56
|
+
}
|
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Durable Citation version used by Observer Topics. */
|
|
3
|
+
export declare const CITATION_SCHEMA_VERSION: 3;
|
|
4
|
+
/** Navigation metadata version. Chat history remains in the DSH Session log. */
|
|
5
|
+
export declare const TOPIC_METADATA_SCHEMA_VERSION: 1;
|
|
6
|
+
/** Host settings namespace mirrored by the browser settings scope. */
|
|
7
|
+
export declare const CITECITER_SETTINGS_NAMESPACE: "citeciter";
|
|
8
|
+
/** Topic-scoped system prompt section. */
|
|
9
|
+
export declare const TUTOR_SECTION_NAME: "@kirkchinese/dsh-citeciter:tutor";
|
|
10
|
+
/** Topic-scoped, user-role Citation context. */
|
|
11
|
+
export declare const CITATION_CONTEXT_NAME: "@kirkchinese/dsh-citeciter:citation";
|
|
12
|
+
export declare const topicModeSchema: z.ZodEnum<{
|
|
13
|
+
observer: "observer";
|
|
14
|
+
"exact-fork": "exact-fork";
|
|
15
|
+
}>;
|
|
16
|
+
export type TopicMode = z.infer<typeof topicModeSchema>;
|
|
17
|
+
/** User preferences applied to new Topics and source reads. */
|
|
18
|
+
export declare const citeCiterSettingsSchema: z.ZodObject<{
|
|
19
|
+
defaultMode: z.ZodEnum<{
|
|
20
|
+
observer: "observer";
|
|
21
|
+
"exact-when-available": "exact-when-available";
|
|
22
|
+
}>;
|
|
23
|
+
includeSourceReasoning: z.ZodBoolean;
|
|
24
|
+
allowSourceFiles: z.ZodBoolean;
|
|
25
|
+
panelWidthPercent: z.ZodNumber;
|
|
26
|
+
reopenLastTopic: z.ZodBoolean;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export type CiteCiterSettings = z.infer<typeof citeCiterSettingsSchema>;
|
|
29
|
+
/** Settings used before an optional DSH settings provider becomes available. */
|
|
30
|
+
export declare const DEFAULT_CITECITER_SETTINGS: CiteCiterSettings;
|
|
31
|
+
/** Host-verifiable Markdown evidence plus the browser-visible quote used by the UI. */
|
|
32
|
+
export declare const citationDraftSchema: z.ZodObject<{
|
|
33
|
+
sourceSessionId: z.ZodString;
|
|
34
|
+
anchorSeq: z.ZodNumber;
|
|
35
|
+
startOffset: z.ZodNumber;
|
|
36
|
+
endOffset: z.ZodNumber;
|
|
37
|
+
sourceText: z.ZodString;
|
|
38
|
+
displayText: z.ZodString;
|
|
39
|
+
prefixText: z.ZodString;
|
|
40
|
+
suffixText: z.ZodString;
|
|
41
|
+
selectionFingerprint: z.ZodString;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
/** Browser-captured selection submitted for authoritative Host validation. */
|
|
44
|
+
export type CitationDraft = z.infer<typeof citationDraftSchema>;
|
|
45
|
+
export declare const citationRecordSchema: z.ZodObject<{
|
|
46
|
+
sourceSessionId: z.ZodString;
|
|
47
|
+
anchorSeq: z.ZodNumber;
|
|
48
|
+
startOffset: z.ZodNumber;
|
|
49
|
+
endOffset: z.ZodNumber;
|
|
50
|
+
sourceText: z.ZodString;
|
|
51
|
+
displayText: z.ZodString;
|
|
52
|
+
prefixText: z.ZodString;
|
|
53
|
+
suffixText: z.ZodString;
|
|
54
|
+
selectionFingerprint: z.ZodString;
|
|
55
|
+
schemaVersion: z.ZodLiteral<3>;
|
|
56
|
+
createdAt: z.ZodNumber;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
/** Immutable evidence identity owned by one Topic. */
|
|
59
|
+
export type CitationRecord = z.infer<typeof citationRecordSchema>;
|
|
60
|
+
export declare const modelConfigSchema: z.ZodObject<{
|
|
61
|
+
provider: z.ZodString;
|
|
62
|
+
model: z.ZodString;
|
|
63
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
64
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
stop: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
export type TopicModelConfig = z.infer<typeof modelConfigSchema>;
|
|
69
|
+
export declare const topicMetadataSchema: z.ZodObject<{
|
|
70
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
71
|
+
topicId: z.ZodNumber;
|
|
72
|
+
sessionId: z.ZodString;
|
|
73
|
+
sourceSessionId: z.ZodString;
|
|
74
|
+
sourceCwd: z.ZodString;
|
|
75
|
+
mode: z.ZodEnum<{
|
|
76
|
+
observer: "observer";
|
|
77
|
+
"exact-fork": "exact-fork";
|
|
78
|
+
}>;
|
|
79
|
+
citation: z.ZodObject<{
|
|
80
|
+
sourceSessionId: z.ZodString;
|
|
81
|
+
anchorSeq: z.ZodNumber;
|
|
82
|
+
startOffset: z.ZodNumber;
|
|
83
|
+
endOffset: z.ZodNumber;
|
|
84
|
+
sourceText: z.ZodString;
|
|
85
|
+
displayText: z.ZodString;
|
|
86
|
+
prefixText: z.ZodString;
|
|
87
|
+
suffixText: z.ZodString;
|
|
88
|
+
selectionFingerprint: z.ZodString;
|
|
89
|
+
schemaVersion: z.ZodLiteral<3>;
|
|
90
|
+
createdAt: z.ZodNumber;
|
|
91
|
+
}, z.core.$strict>;
|
|
92
|
+
modelConfig: z.ZodObject<{
|
|
93
|
+
provider: z.ZodString;
|
|
94
|
+
model: z.ZodString;
|
|
95
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
96
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
stop: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
forkThroughSeq: z.ZodNullable<z.ZodNumber>;
|
|
101
|
+
temporaryTitle: z.ZodString;
|
|
102
|
+
cachedTitle: z.ZodNullable<z.ZodString>;
|
|
103
|
+
cachedTitleSource: z.ZodNullable<z.ZodEnum<{
|
|
104
|
+
provider: "provider";
|
|
105
|
+
fallback: "fallback";
|
|
106
|
+
user: "user";
|
|
107
|
+
}>>;
|
|
108
|
+
createdAt: z.ZodNumber;
|
|
109
|
+
updatedAt: z.ZodNumber;
|
|
110
|
+
archivedAt: z.ZodNullable<z.ZodNumber>;
|
|
111
|
+
sourceAvailable: z.ZodBoolean;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
/** Small navigation record stored outside the standard Topic Session log. */
|
|
114
|
+
export type TopicMetadata = z.infer<typeof topicMetadataSchema>;
|
|
115
|
+
export declare const topicSummarySchema: z.ZodObject<{
|
|
116
|
+
topicId: z.ZodNumber;
|
|
117
|
+
sessionId: z.ZodString;
|
|
118
|
+
sourceSessionId: z.ZodString;
|
|
119
|
+
mode: z.ZodEnum<{
|
|
120
|
+
observer: "observer";
|
|
121
|
+
"exact-fork": "exact-fork";
|
|
122
|
+
}>;
|
|
123
|
+
citation: z.ZodObject<{
|
|
124
|
+
sourceSessionId: z.ZodString;
|
|
125
|
+
anchorSeq: z.ZodNumber;
|
|
126
|
+
startOffset: z.ZodNumber;
|
|
127
|
+
endOffset: z.ZodNumber;
|
|
128
|
+
sourceText: z.ZodString;
|
|
129
|
+
displayText: z.ZodString;
|
|
130
|
+
prefixText: z.ZodString;
|
|
131
|
+
suffixText: z.ZodString;
|
|
132
|
+
selectionFingerprint: z.ZodString;
|
|
133
|
+
schemaVersion: z.ZodLiteral<3>;
|
|
134
|
+
createdAt: z.ZodNumber;
|
|
135
|
+
}, z.core.$strict>;
|
|
136
|
+
title: z.ZodString;
|
|
137
|
+
titlePending: z.ZodBoolean;
|
|
138
|
+
createdAt: z.ZodNumber;
|
|
139
|
+
updatedAt: z.ZodNumber;
|
|
140
|
+
archived: z.ZodBoolean;
|
|
141
|
+
running: z.ZodBoolean;
|
|
142
|
+
sourceAvailable: z.ZodBoolean;
|
|
143
|
+
observedThroughSeq: z.ZodNullable<z.ZodNumber>;
|
|
144
|
+
modelConfig: z.ZodObject<{
|
|
145
|
+
provider: z.ZodString;
|
|
146
|
+
model: z.ZodString;
|
|
147
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
148
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
stop: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
151
|
+
}, z.core.$strict>;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
export type TopicSummary = z.infer<typeof topicSummarySchema>;
|
|
154
|
+
export declare const topicMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
155
|
+
role: z.ZodLiteral<"user">;
|
|
156
|
+
text: z.ZodString;
|
|
157
|
+
id: z.ZodString;
|
|
158
|
+
seq: z.ZodNumber;
|
|
159
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
160
|
+
role: z.ZodLiteral<"assistant">;
|
|
161
|
+
text: z.ZodString;
|
|
162
|
+
reasoning: z.ZodNullable<z.ZodString>;
|
|
163
|
+
streaming: z.ZodBoolean;
|
|
164
|
+
id: z.ZodString;
|
|
165
|
+
seq: z.ZodNumber;
|
|
166
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
167
|
+
role: z.ZodLiteral<"context">;
|
|
168
|
+
label: z.ZodString;
|
|
169
|
+
text: z.ZodString;
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
seq: z.ZodNumber;
|
|
172
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
173
|
+
role: z.ZodLiteral<"tool">;
|
|
174
|
+
name: z.ZodString;
|
|
175
|
+
arguments: z.ZodString;
|
|
176
|
+
result: z.ZodNullable<z.ZodString>;
|
|
177
|
+
isError: z.ZodBoolean;
|
|
178
|
+
running: z.ZodBoolean;
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
seq: z.ZodNumber;
|
|
181
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
182
|
+
role: z.ZodLiteral<"error">;
|
|
183
|
+
text: z.ZodString;
|
|
184
|
+
id: z.ZodString;
|
|
185
|
+
seq: z.ZodNumber;
|
|
186
|
+
}, z.core.$strict>], "role">;
|
|
187
|
+
export type TopicMessage = z.infer<typeof topicMessageSchema>;
|
|
188
|
+
export declare const questionOptionSchema: z.ZodObject<{
|
|
189
|
+
label: z.ZodString;
|
|
190
|
+
description: z.ZodOptional<z.ZodString>;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
export declare const questionItemSchema: z.ZodObject<{
|
|
193
|
+
id: z.ZodString;
|
|
194
|
+
question: z.ZodString;
|
|
195
|
+
header: z.ZodOptional<z.ZodString>;
|
|
196
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
197
|
+
label: z.ZodString;
|
|
198
|
+
description: z.ZodOptional<z.ZodString>;
|
|
199
|
+
}, z.core.$strict>>>;
|
|
200
|
+
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
201
|
+
}, z.core.$strict>;
|
|
202
|
+
export declare const questionAnswerSchema: z.ZodObject<{
|
|
203
|
+
answers: z.ZodArray<z.ZodObject<{
|
|
204
|
+
id: z.ZodString;
|
|
205
|
+
selected: z.ZodArray<z.ZodString>;
|
|
206
|
+
custom: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, z.core.$strict>>;
|
|
208
|
+
}, z.core.$strict>;
|
|
209
|
+
export type QuestionAnswer = z.infer<typeof questionAnswerSchema>;
|
|
210
|
+
export declare const pendingQuestionSchema: z.ZodObject<{
|
|
211
|
+
key: z.ZodString;
|
|
212
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
213
|
+
id: z.ZodString;
|
|
214
|
+
question: z.ZodString;
|
|
215
|
+
header: z.ZodOptional<z.ZodString>;
|
|
216
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
217
|
+
label: z.ZodString;
|
|
218
|
+
description: z.ZodOptional<z.ZodString>;
|
|
219
|
+
}, z.core.$strict>>>;
|
|
220
|
+
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
221
|
+
}, z.core.$strict>>;
|
|
222
|
+
}, z.core.$strict>;
|
|
223
|
+
export type PendingQuestion = z.infer<typeof pendingQuestionSchema>;
|
|
224
|
+
export declare const topicSnapshotSchema: z.ZodObject<{
|
|
225
|
+
topic: z.ZodObject<{
|
|
226
|
+
topicId: z.ZodNumber;
|
|
227
|
+
sessionId: z.ZodString;
|
|
228
|
+
sourceSessionId: z.ZodString;
|
|
229
|
+
mode: z.ZodEnum<{
|
|
230
|
+
observer: "observer";
|
|
231
|
+
"exact-fork": "exact-fork";
|
|
232
|
+
}>;
|
|
233
|
+
citation: z.ZodObject<{
|
|
234
|
+
sourceSessionId: z.ZodString;
|
|
235
|
+
anchorSeq: z.ZodNumber;
|
|
236
|
+
startOffset: z.ZodNumber;
|
|
237
|
+
endOffset: z.ZodNumber;
|
|
238
|
+
sourceText: z.ZodString;
|
|
239
|
+
displayText: z.ZodString;
|
|
240
|
+
prefixText: z.ZodString;
|
|
241
|
+
suffixText: z.ZodString;
|
|
242
|
+
selectionFingerprint: z.ZodString;
|
|
243
|
+
schemaVersion: z.ZodLiteral<3>;
|
|
244
|
+
createdAt: z.ZodNumber;
|
|
245
|
+
}, z.core.$strict>;
|
|
246
|
+
title: z.ZodString;
|
|
247
|
+
titlePending: z.ZodBoolean;
|
|
248
|
+
createdAt: z.ZodNumber;
|
|
249
|
+
updatedAt: z.ZodNumber;
|
|
250
|
+
archived: z.ZodBoolean;
|
|
251
|
+
running: z.ZodBoolean;
|
|
252
|
+
sourceAvailable: z.ZodBoolean;
|
|
253
|
+
observedThroughSeq: z.ZodNullable<z.ZodNumber>;
|
|
254
|
+
modelConfig: z.ZodObject<{
|
|
255
|
+
provider: z.ZodString;
|
|
256
|
+
model: z.ZodString;
|
|
257
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
258
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
259
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
260
|
+
stop: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
261
|
+
}, z.core.$strict>;
|
|
262
|
+
}, z.core.$strict>;
|
|
263
|
+
messages: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
264
|
+
role: z.ZodLiteral<"user">;
|
|
265
|
+
text: z.ZodString;
|
|
266
|
+
id: z.ZodString;
|
|
267
|
+
seq: z.ZodNumber;
|
|
268
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
269
|
+
role: z.ZodLiteral<"assistant">;
|
|
270
|
+
text: z.ZodString;
|
|
271
|
+
reasoning: z.ZodNullable<z.ZodString>;
|
|
272
|
+
streaming: z.ZodBoolean;
|
|
273
|
+
id: z.ZodString;
|
|
274
|
+
seq: z.ZodNumber;
|
|
275
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
276
|
+
role: z.ZodLiteral<"context">;
|
|
277
|
+
label: z.ZodString;
|
|
278
|
+
text: z.ZodString;
|
|
279
|
+
id: z.ZodString;
|
|
280
|
+
seq: z.ZodNumber;
|
|
281
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
282
|
+
role: z.ZodLiteral<"tool">;
|
|
283
|
+
name: z.ZodString;
|
|
284
|
+
arguments: z.ZodString;
|
|
285
|
+
result: z.ZodNullable<z.ZodString>;
|
|
286
|
+
isError: z.ZodBoolean;
|
|
287
|
+
running: z.ZodBoolean;
|
|
288
|
+
id: z.ZodString;
|
|
289
|
+
seq: z.ZodNumber;
|
|
290
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
291
|
+
role: z.ZodLiteral<"error">;
|
|
292
|
+
text: z.ZodString;
|
|
293
|
+
id: z.ZodString;
|
|
294
|
+
seq: z.ZodNumber;
|
|
295
|
+
}, z.core.$strict>], "role">>;
|
|
296
|
+
pendingQuestion: z.ZodNullable<z.ZodObject<{
|
|
297
|
+
key: z.ZodString;
|
|
298
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
299
|
+
id: z.ZodString;
|
|
300
|
+
question: z.ZodString;
|
|
301
|
+
header: z.ZodOptional<z.ZodString>;
|
|
302
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
303
|
+
label: z.ZodString;
|
|
304
|
+
description: z.ZodOptional<z.ZodString>;
|
|
305
|
+
}, z.core.$strict>>>;
|
|
306
|
+
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
307
|
+
}, z.core.$strict>>;
|
|
308
|
+
}, z.core.$strict>>;
|
|
309
|
+
error: z.ZodNullable<z.ZodString>;
|
|
310
|
+
}, z.core.$strict>;
|
|
311
|
+
export type TopicSnapshot = z.infer<typeof topicSnapshotSchema>;
|
|
312
|
+
export declare const modelOptionSchema: z.ZodObject<{
|
|
313
|
+
id: z.ZodString;
|
|
314
|
+
name: z.ZodString;
|
|
315
|
+
description: z.ZodOptional<z.ZodString>;
|
|
316
|
+
reasoningEfforts: z.ZodArray<z.ZodObject<{
|
|
317
|
+
id: z.ZodString;
|
|
318
|
+
name: z.ZodString;
|
|
319
|
+
}, z.core.$strict>>;
|
|
320
|
+
}, z.core.$strict>;
|
|
321
|
+
export declare const providerOptionSchema: z.ZodObject<{
|
|
322
|
+
id: z.ZodString;
|
|
323
|
+
name: z.ZodString;
|
|
324
|
+
models: z.ZodArray<z.ZodObject<{
|
|
325
|
+
id: z.ZodString;
|
|
326
|
+
name: z.ZodString;
|
|
327
|
+
description: z.ZodOptional<z.ZodString>;
|
|
328
|
+
reasoningEfforts: z.ZodArray<z.ZodObject<{
|
|
329
|
+
id: z.ZodString;
|
|
330
|
+
name: z.ZodString;
|
|
331
|
+
}, z.core.$strict>>;
|
|
332
|
+
}, z.core.$strict>>;
|
|
333
|
+
}, z.core.$strict>;
|
|
334
|
+
export type ProviderOption = z.infer<typeof providerOptionSchema>;
|
|
335
|
+
/** One strict direct-RPC command for the private CiteCiter runtime. */
|
|
336
|
+
export declare const citeCiterRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
337
|
+
action: z.ZodLiteral<"create">;
|
|
338
|
+
citation: z.ZodObject<{
|
|
339
|
+
sourceSessionId: z.ZodString;
|
|
340
|
+
anchorSeq: z.ZodNumber;
|
|
341
|
+
startOffset: z.ZodNumber;
|
|
342
|
+
endOffset: z.ZodNumber;
|
|
343
|
+
sourceText: z.ZodString;
|
|
344
|
+
displayText: z.ZodString;
|
|
345
|
+
prefixText: z.ZodString;
|
|
346
|
+
suffixText: z.ZodString;
|
|
347
|
+
selectionFingerprint: z.ZodString;
|
|
348
|
+
}, z.core.$strict>;
|
|
349
|
+
question: z.ZodString;
|
|
350
|
+
mode: z.ZodEnum<{
|
|
351
|
+
observer: "observer";
|
|
352
|
+
"exact-fork": "exact-fork";
|
|
353
|
+
"exact-when-available": "exact-when-available";
|
|
354
|
+
}>;
|
|
355
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
356
|
+
action: z.ZodLiteral<"list">;
|
|
357
|
+
sourceSessionId: z.ZodString;
|
|
358
|
+
includeArchived: z.ZodOptional<z.ZodBoolean>;
|
|
359
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
360
|
+
action: z.ZodLiteral<"get">;
|
|
361
|
+
topicSessionId: z.ZodString;
|
|
362
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
363
|
+
action: z.ZodLiteral<"ask">;
|
|
364
|
+
topicSessionId: z.ZodString;
|
|
365
|
+
question: z.ZodString;
|
|
366
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
367
|
+
action: z.ZodLiteral<"stop">;
|
|
368
|
+
topicSessionId: z.ZodString;
|
|
369
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
370
|
+
action: z.ZodLiteral<"answer-question">;
|
|
371
|
+
topicSessionId: z.ZodString;
|
|
372
|
+
key: z.ZodString;
|
|
373
|
+
answer: z.ZodObject<{
|
|
374
|
+
answers: z.ZodArray<z.ZodObject<{
|
|
375
|
+
id: z.ZodString;
|
|
376
|
+
selected: z.ZodArray<z.ZodString>;
|
|
377
|
+
custom: z.ZodOptional<z.ZodString>;
|
|
378
|
+
}, z.core.$strict>>;
|
|
379
|
+
}, z.core.$strict>;
|
|
380
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
381
|
+
action: z.ZodLiteral<"cancel-question">;
|
|
382
|
+
topicSessionId: z.ZodString;
|
|
383
|
+
key: z.ZodString;
|
|
384
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
385
|
+
action: z.ZodLiteral<"rename">;
|
|
386
|
+
topicSessionId: z.ZodString;
|
|
387
|
+
title: z.ZodString;
|
|
388
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
389
|
+
action: z.ZodLiteral<"archive">;
|
|
390
|
+
topicSessionId: z.ZodString;
|
|
391
|
+
archived: z.ZodBoolean;
|
|
392
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
393
|
+
action: z.ZodLiteral<"delete">;
|
|
394
|
+
topicSessionId: z.ZodString;
|
|
395
|
+
confirmSessionId: z.ZodString;
|
|
396
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
397
|
+
action: z.ZodLiteral<"models">;
|
|
398
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
399
|
+
action: z.ZodLiteral<"select-model">;
|
|
400
|
+
topicSessionId: z.ZodString;
|
|
401
|
+
provider: z.ZodString;
|
|
402
|
+
model: z.ZodString;
|
|
403
|
+
reasoningEffort: z.ZodNullable<z.ZodString>;
|
|
404
|
+
}, z.core.$strict>], "action">;
|
|
405
|
+
export type CiteCiterRequest = z.infer<typeof citeCiterRequestSchema>;
|
|
406
|
+
/** Strict response union returned by the single Remote command endpoint. */
|
|
407
|
+
export declare const citeCiterResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
408
|
+
kind: z.ZodLiteral<"topic">;
|
|
409
|
+
topic: z.ZodObject<{
|
|
410
|
+
topic: z.ZodObject<{
|
|
411
|
+
topicId: z.ZodNumber;
|
|
412
|
+
sessionId: z.ZodString;
|
|
413
|
+
sourceSessionId: z.ZodString;
|
|
414
|
+
mode: z.ZodEnum<{
|
|
415
|
+
observer: "observer";
|
|
416
|
+
"exact-fork": "exact-fork";
|
|
417
|
+
}>;
|
|
418
|
+
citation: z.ZodObject<{
|
|
419
|
+
sourceSessionId: z.ZodString;
|
|
420
|
+
anchorSeq: z.ZodNumber;
|
|
421
|
+
startOffset: z.ZodNumber;
|
|
422
|
+
endOffset: z.ZodNumber;
|
|
423
|
+
sourceText: z.ZodString;
|
|
424
|
+
displayText: z.ZodString;
|
|
425
|
+
prefixText: z.ZodString;
|
|
426
|
+
suffixText: z.ZodString;
|
|
427
|
+
selectionFingerprint: z.ZodString;
|
|
428
|
+
schemaVersion: z.ZodLiteral<3>;
|
|
429
|
+
createdAt: z.ZodNumber;
|
|
430
|
+
}, z.core.$strict>;
|
|
431
|
+
title: z.ZodString;
|
|
432
|
+
titlePending: z.ZodBoolean;
|
|
433
|
+
createdAt: z.ZodNumber;
|
|
434
|
+
updatedAt: z.ZodNumber;
|
|
435
|
+
archived: z.ZodBoolean;
|
|
436
|
+
running: z.ZodBoolean;
|
|
437
|
+
sourceAvailable: z.ZodBoolean;
|
|
438
|
+
observedThroughSeq: z.ZodNullable<z.ZodNumber>;
|
|
439
|
+
modelConfig: z.ZodObject<{
|
|
440
|
+
provider: z.ZodString;
|
|
441
|
+
model: z.ZodString;
|
|
442
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
443
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
444
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
445
|
+
stop: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
446
|
+
}, z.core.$strict>;
|
|
447
|
+
}, z.core.$strict>;
|
|
448
|
+
messages: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
449
|
+
role: z.ZodLiteral<"user">;
|
|
450
|
+
text: z.ZodString;
|
|
451
|
+
id: z.ZodString;
|
|
452
|
+
seq: z.ZodNumber;
|
|
453
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
454
|
+
role: z.ZodLiteral<"assistant">;
|
|
455
|
+
text: z.ZodString;
|
|
456
|
+
reasoning: z.ZodNullable<z.ZodString>;
|
|
457
|
+
streaming: z.ZodBoolean;
|
|
458
|
+
id: z.ZodString;
|
|
459
|
+
seq: z.ZodNumber;
|
|
460
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
461
|
+
role: z.ZodLiteral<"context">;
|
|
462
|
+
label: z.ZodString;
|
|
463
|
+
text: z.ZodString;
|
|
464
|
+
id: z.ZodString;
|
|
465
|
+
seq: z.ZodNumber;
|
|
466
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
467
|
+
role: z.ZodLiteral<"tool">;
|
|
468
|
+
name: z.ZodString;
|
|
469
|
+
arguments: z.ZodString;
|
|
470
|
+
result: z.ZodNullable<z.ZodString>;
|
|
471
|
+
isError: z.ZodBoolean;
|
|
472
|
+
running: z.ZodBoolean;
|
|
473
|
+
id: z.ZodString;
|
|
474
|
+
seq: z.ZodNumber;
|
|
475
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
476
|
+
role: z.ZodLiteral<"error">;
|
|
477
|
+
text: z.ZodString;
|
|
478
|
+
id: z.ZodString;
|
|
479
|
+
seq: z.ZodNumber;
|
|
480
|
+
}, z.core.$strict>], "role">>;
|
|
481
|
+
pendingQuestion: z.ZodNullable<z.ZodObject<{
|
|
482
|
+
key: z.ZodString;
|
|
483
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
484
|
+
id: z.ZodString;
|
|
485
|
+
question: z.ZodString;
|
|
486
|
+
header: z.ZodOptional<z.ZodString>;
|
|
487
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
488
|
+
label: z.ZodString;
|
|
489
|
+
description: z.ZodOptional<z.ZodString>;
|
|
490
|
+
}, z.core.$strict>>>;
|
|
491
|
+
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
492
|
+
}, z.core.$strict>>;
|
|
493
|
+
}, z.core.$strict>>;
|
|
494
|
+
error: z.ZodNullable<z.ZodString>;
|
|
495
|
+
}, z.core.$strict>;
|
|
496
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
497
|
+
kind: z.ZodLiteral<"topics">;
|
|
498
|
+
topics: z.ZodArray<z.ZodObject<{
|
|
499
|
+
topicId: z.ZodNumber;
|
|
500
|
+
sessionId: z.ZodString;
|
|
501
|
+
sourceSessionId: z.ZodString;
|
|
502
|
+
mode: z.ZodEnum<{
|
|
503
|
+
observer: "observer";
|
|
504
|
+
"exact-fork": "exact-fork";
|
|
505
|
+
}>;
|
|
506
|
+
citation: z.ZodObject<{
|
|
507
|
+
sourceSessionId: z.ZodString;
|
|
508
|
+
anchorSeq: z.ZodNumber;
|
|
509
|
+
startOffset: z.ZodNumber;
|
|
510
|
+
endOffset: z.ZodNumber;
|
|
511
|
+
sourceText: z.ZodString;
|
|
512
|
+
displayText: z.ZodString;
|
|
513
|
+
prefixText: z.ZodString;
|
|
514
|
+
suffixText: z.ZodString;
|
|
515
|
+
selectionFingerprint: z.ZodString;
|
|
516
|
+
schemaVersion: z.ZodLiteral<3>;
|
|
517
|
+
createdAt: z.ZodNumber;
|
|
518
|
+
}, z.core.$strict>;
|
|
519
|
+
title: z.ZodString;
|
|
520
|
+
titlePending: z.ZodBoolean;
|
|
521
|
+
createdAt: z.ZodNumber;
|
|
522
|
+
updatedAt: z.ZodNumber;
|
|
523
|
+
archived: z.ZodBoolean;
|
|
524
|
+
running: z.ZodBoolean;
|
|
525
|
+
sourceAvailable: z.ZodBoolean;
|
|
526
|
+
observedThroughSeq: z.ZodNullable<z.ZodNumber>;
|
|
527
|
+
modelConfig: z.ZodObject<{
|
|
528
|
+
provider: z.ZodString;
|
|
529
|
+
model: z.ZodString;
|
|
530
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
531
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
532
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
533
|
+
stop: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
534
|
+
}, z.core.$strict>;
|
|
535
|
+
}, z.core.$strict>>;
|
|
536
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
537
|
+
kind: z.ZodLiteral<"models">;
|
|
538
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
539
|
+
id: z.ZodString;
|
|
540
|
+
name: z.ZodString;
|
|
541
|
+
models: z.ZodArray<z.ZodObject<{
|
|
542
|
+
id: z.ZodString;
|
|
543
|
+
name: z.ZodString;
|
|
544
|
+
description: z.ZodOptional<z.ZodString>;
|
|
545
|
+
reasoningEfforts: z.ZodArray<z.ZodObject<{
|
|
546
|
+
id: z.ZodString;
|
|
547
|
+
name: z.ZodString;
|
|
548
|
+
}, z.core.$strict>>;
|
|
549
|
+
}, z.core.$strict>>;
|
|
550
|
+
}, z.core.$strict>>;
|
|
551
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
552
|
+
kind: z.ZodLiteral<"deleted">;
|
|
553
|
+
sessionId: z.ZodString;
|
|
554
|
+
}, z.core.$strict>], "kind">;
|
|
555
|
+
export type CiteCiterResponse = z.infer<typeof citeCiterResponseSchema>;
|
|
556
|
+
/** Fields whose canonical serialization defines selection identity. */
|
|
557
|
+
export declare function canonicalCitationIdentity(citation: Omit<CitationDraft, 'selectionFingerprint'>): string;
|
|
558
|
+
/** Render the immutable Citation as explicitly untrusted user-role context. */
|
|
559
|
+
export declare function renderCitationContext(citation: CitationRecord): string;
|