@kirkchinese/dsh-citeciter 0.6.0 → 0.8.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 +88 -56
- package/README.zh.md +90 -56
- package/lib/client.js +6677 -953
- package/lib/index.js +1736 -538
- package/lib/{typert-common-C6yTitXx.js → typert-common-DxE1_Bn_.js} +1 -1
- package/lib/typert.host.js +2 -2
- package/lib/typert.remote-client.js +1 -1
- package/lib/types/actions.d.ts +47 -0
- package/lib/types/board-capture.d.ts +11 -0
- package/lib/types/board.d.ts +4 -4
- package/lib/types/citation-mapping.d.ts +8 -0
- package/lib/types/citer-agent-registry.d.ts +21 -0
- package/lib/types/citer-session-access.d.ts +11 -0
- package/lib/types/citer-session-store.d.ts +7 -0
- package/lib/types/citer-session-world.d.ts +21 -0
- package/lib/types/client/action-controller.d.ts +61 -0
- package/lib/types/client/action-executor.d.ts +6 -0
- package/lib/types/client/board-capture-target.d.ts +8 -0
- package/lib/types/client/citer-session-face.d.ts +59 -0
- package/lib/types/client/compact-navigation.d.ts +3 -0
- package/lib/types/client/companion-controller.d.ts +15 -4
- package/lib/types/client/components/ActionWheel.d.ts +12 -0
- package/lib/types/client/components/BoardCaptureSurface.d.ts +8 -0
- package/lib/types/client/components/BoardView.d.ts +5 -3
- package/lib/types/client/components/ChoicePopover.d.ts +8 -0
- package/lib/types/client/components/CiteLauncher.d.ts +9 -0
- package/lib/types/client/components/CitePanel.d.ts +7 -1
- package/lib/types/client/components/CompactBackButton.d.ts +4 -0
- package/lib/types/client/components/DocumentReader.d.ts +7 -1
- package/lib/types/client/components/FileAttachments.d.ts +9 -0
- package/lib/types/client/components/FileDropHint.d.ts +5 -0
- package/lib/types/client/components/LearningCards.d.ts +12 -0
- package/lib/types/client/components/LearningRoute.d.ts +7 -0
- package/lib/types/client/components/MessageAttachments.d.ts +12 -0
- package/lib/types/client/components/MessageFile.d.ts +8 -0
- package/lib/types/client/components/ModelChoice.d.ts +10 -0
- package/lib/types/client/components/NativeInteraction.d.ts +7 -0
- package/lib/types/client/components/NativeLearningDocument.d.ts +9 -0
- package/lib/types/client/components/NativeQueue.d.ts +6 -0
- package/lib/types/client/components/OverlayPortal.d.ts +10 -0
- package/lib/types/client/components/PermissionControl.d.ts +7 -0
- package/lib/types/client/components/QuestionCard.d.ts +10 -4
- package/lib/types/client/components/ReasoningDisclosure.d.ts +5 -0
- package/lib/types/client/components/ReferenceAttachments.d.ts +6 -0
- package/lib/types/client/components/TopicActions.d.ts +6 -0
- package/lib/types/client/components/TopicComposer.d.ts +36 -0
- package/lib/types/client/components/TopicHeader.d.ts +10 -0
- package/lib/types/client/components/TopicModelControls.d.ts +9 -0
- package/lib/types/client/components/TopicNavigation.d.ts +12 -0
- package/lib/types/client/components/TopicSettingsDialog.d.ts +21 -0
- package/lib/types/client/components/TopicTitle.d.ts +6 -0
- package/lib/types/client/components/UserMessageBody.d.ts +4 -0
- package/lib/types/client/components/WheelSettings.d.ts +7 -0
- package/lib/types/client/dock-geometry.d.ts +3 -3
- package/lib/types/client/draft-references.d.ts +20 -0
- package/lib/types/client/file-download.d.ts +16 -0
- package/lib/types/client/file-drop.d.ts +18 -0
- package/lib/types/client/host-dock.d.ts +2 -2
- package/lib/types/client/learning-route.d.ts +10 -0
- package/lib/types/client/native-composer.d.ts +18 -0
- package/lib/types/client/native-document.d.ts +13 -0
- package/lib/types/client/panel-drag.d.ts +10 -0
- package/lib/types/client/reader-controller.d.ts +6 -0
- package/lib/types/client/request-guard.d.ts +3 -2
- package/lib/types/client/submission-preference.d.ts +5 -0
- package/lib/types/client/transcript-position.d.ts +6 -0
- package/lib/types/client/types.d.ts +5 -4
- package/lib/types/client/view-actions.d.ts +1 -1
- package/lib/types/client/wheel-gesture.d.ts +13 -0
- package/lib/types/document-pages.d.ts +4 -0
- package/lib/types/documents.d.ts +7 -5
- package/lib/types/host-agent-modules.d.ts +21 -0
- package/lib/types/host-session-adapter.d.ts +31 -0
- package/lib/types/index.d.ts +5 -5
- package/lib/types/learning.d.ts +72 -0
- package/lib/types/native-attachment-read.d.ts +19 -0
- package/lib/types/native-session-contract.d.ts +198 -0
- package/lib/types/native-session-read.d.ts +4 -0
- package/lib/types/owned-session-cleanup.d.ts +2 -0
- package/lib/types/service.d.ts +1 -1
- package/lib/types/session-migration.d.ts +3 -0
- package/lib/types/source-session.d.ts +7 -0
- package/lib/types/source-storage.d.ts +12 -0
- package/lib/types/topic-index.d.ts +75 -0
- package/lib/types/topic-runtime.d.ts +19 -55
- package/lib/types/topic-stream.d.ts +14 -0
- package/lib/types/topic.d.ts +301 -2
- package/lib/types/typert-common.d.ts +210 -1
- package/lib/types/typert.host.d.ts +454 -3
- package/lib/{update-C0K5ekMg.js → update-0LcFDvI5.js} +279 -13
- package/package.json +86 -78
- package/lib/types/client/components/SelectionMenu.d.ts +0 -17
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as citeCiterRequestSchema, p as citeCiterResponseSchema, r as updateCheckResponseSchema } from "./update-
|
|
1
|
+
import { f as citeCiterRequestSchema, p as citeCiterResponseSchema, r as updateCheckResponseSchema } from "./update-0LcFDvI5.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 = {
|
package/lib/typert.host.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { n as updateCheckDescriptor, 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-0LcFDvI5.js";
|
|
2
|
+
import { n as updateCheckDescriptor, t as citeCiterRequestDescriptor } from "./typert-common-DxE1_Bn_.js";
|
|
3
3
|
//#region lib/types/typert.host.js
|
|
4
4
|
/** Handwritten strict Host contribution matching the single Remote decorator. */
|
|
5
5
|
const TYPERT = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as updateCheckDescriptor, t as citeCiterRequestDescriptor } from "./typert-common-
|
|
1
|
+
import { n as updateCheckDescriptor, t as citeCiterRequestDescriptor } from "./typert-common-DxE1_Bn_.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 = {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** One persisted wheel slot; its prompt is sent as a durable user message. */
|
|
3
|
+
export declare const citeActionSchema: z.ZodObject<{
|
|
4
|
+
label: z.ZodString;
|
|
5
|
+
prompt: z.ZodString;
|
|
6
|
+
ask: z.ZodBoolean;
|
|
7
|
+
scenario: z.ZodEnum<{
|
|
8
|
+
qa: "qa";
|
|
9
|
+
present: "present";
|
|
10
|
+
}>;
|
|
11
|
+
presentation: z.ZodEnum<{
|
|
12
|
+
side: "side";
|
|
13
|
+
floating: "floating";
|
|
14
|
+
}>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
export type CiteAction = z.infer<typeof citeActionSchema>;
|
|
17
|
+
export declare const wheelSlotsSchema: z.ZodArray<z.ZodNullable<z.ZodObject<{
|
|
18
|
+
label: z.ZodString;
|
|
19
|
+
prompt: z.ZodString;
|
|
20
|
+
ask: z.ZodBoolean;
|
|
21
|
+
scenario: z.ZodEnum<{
|
|
22
|
+
qa: "qa";
|
|
23
|
+
present: "present";
|
|
24
|
+
}>;
|
|
25
|
+
presentation: z.ZodEnum<{
|
|
26
|
+
side: "side";
|
|
27
|
+
floating: "floating";
|
|
28
|
+
}>;
|
|
29
|
+
}, z.core.$strict>>>;
|
|
30
|
+
export declare const wheelTriggerSchema: z.ZodEnum<{
|
|
31
|
+
"right-button": "right-button";
|
|
32
|
+
Alt: "Alt";
|
|
33
|
+
Control: "Control";
|
|
34
|
+
Shift: "Shift";
|
|
35
|
+
Meta: "Meta";
|
|
36
|
+
}>;
|
|
37
|
+
export type WheelTrigger = z.infer<typeof wheelTriggerSchema>;
|
|
38
|
+
export type PanelPresentation = CiteAction['presentation'];
|
|
39
|
+
export declare const actionModelSchema: z.ZodObject<{
|
|
40
|
+
provider: z.ZodString;
|
|
41
|
+
model: z.ZodString;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
export type ActionModel = z.infer<typeof actionModelSchema>;
|
|
44
|
+
/** Clockwise from twelve o'clock. Empty slots retain their positions. */
|
|
45
|
+
export declare const DEFAULT_WHEEL_SLOTS: readonly (CiteAction | null)[];
|
|
46
|
+
/** Combine a mode and optional user question without hidden system state. */
|
|
47
|
+
export declare function actionQuestion(action: CiteAction, question: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
/** Correlates one model-requested render with one client reply; bytes become a durable DSH attachment. */
|
|
3
|
+
export declare class BoardCaptureBroker {
|
|
4
|
+
private readonly pending;
|
|
5
|
+
id(sessionId: string): string | undefined;
|
|
6
|
+
reply(sessionId: string, id: string, png?: string, error?: string): void;
|
|
7
|
+
dispose(): void;
|
|
8
|
+
private capture;
|
|
9
|
+
/** Tool returns the browser-rendered board image inside the current turn; it never starts another prompt. */
|
|
10
|
+
tool(ctx: Context): import("@deepseek-ai/dsh-tools").ToolDefinition;
|
|
11
|
+
}
|
package/lib/types/board.d.ts
CHANGED
|
@@ -10,12 +10,12 @@ export declare const BOARD_MAX_ELEMENTS = 50;
|
|
|
10
10
|
export declare const BOARD_MAX_CONTENT_BYTES = 500000;
|
|
11
11
|
/** Element kinds the blackboard renders safely on the chalk canvas. */
|
|
12
12
|
export declare const boardElementKindSchema: z.ZodEnum<{
|
|
13
|
+
image: "image";
|
|
13
14
|
text: "text";
|
|
14
15
|
markdown: "markdown";
|
|
15
16
|
math: "math";
|
|
16
17
|
svg: "svg";
|
|
17
18
|
html: "html";
|
|
18
|
-
image: "image";
|
|
19
19
|
table: "table";
|
|
20
20
|
}>;
|
|
21
21
|
export type BoardElementKind = z.infer<typeof boardElementKindSchema>;
|
|
@@ -32,12 +32,12 @@ export declare const boardOpSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
32
32
|
op: z.ZodLiteral<"set">;
|
|
33
33
|
id: z.ZodString;
|
|
34
34
|
kind: z.ZodEnum<{
|
|
35
|
+
image: "image";
|
|
35
36
|
text: "text";
|
|
36
37
|
markdown: "markdown";
|
|
37
38
|
math: "math";
|
|
38
39
|
svg: "svg";
|
|
39
40
|
html: "html";
|
|
40
|
-
image: "image";
|
|
41
41
|
table: "table";
|
|
42
42
|
}>;
|
|
43
43
|
content: z.ZodString;
|
|
@@ -93,12 +93,12 @@ export declare const boardBatchSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.Zod
|
|
|
93
93
|
op: z.ZodLiteral<"set">;
|
|
94
94
|
id: z.ZodString;
|
|
95
95
|
kind: z.ZodEnum<{
|
|
96
|
+
image: "image";
|
|
96
97
|
text: "text";
|
|
97
98
|
markdown: "markdown";
|
|
98
99
|
math: "math";
|
|
99
100
|
svg: "svg";
|
|
100
101
|
html: "html";
|
|
101
|
-
image: "image";
|
|
102
102
|
table: "table";
|
|
103
103
|
}>;
|
|
104
104
|
content: z.ZodString;
|
|
@@ -185,12 +185,12 @@ export declare const boardSnapshotSchema: z.ZodObject<{
|
|
|
185
185
|
elements: z.ZodArray<z.ZodObject<{
|
|
186
186
|
id: z.ZodString;
|
|
187
187
|
kind: z.ZodEnum<{
|
|
188
|
+
image: "image";
|
|
188
189
|
text: "text";
|
|
189
190
|
markdown: "markdown";
|
|
190
191
|
math: "math";
|
|
191
192
|
svg: "svg";
|
|
192
193
|
html: "html";
|
|
193
|
-
image: "image";
|
|
194
194
|
table: "table";
|
|
195
195
|
}>;
|
|
196
196
|
content: z.ZodString;
|
|
@@ -13,5 +13,13 @@ export interface ResolvedCitationRange {
|
|
|
13
13
|
readonly prefixText: string;
|
|
14
14
|
readonly suffixText: string;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Locate a literal textarea selection in authoritative document source text.
|
|
18
|
+
* @param selection - raw selected text and page-local surrounding context.
|
|
19
|
+
* @param content - complete normalized document; offsets use UTF-16 code units.
|
|
20
|
+
* @returns the unique best exact match, retaining Markdown and code punctuation.
|
|
21
|
+
* @throws when the quote is absent or repeated context cannot disambiguate it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveDocumentRange(selection: CitationTextSelection, content: string): ResolvedCitationRange;
|
|
16
24
|
/** Resolve rendered selection context against authoritative Markdown source. */
|
|
17
25
|
export declare function resolveCitationRange(selection: CitationTextSelection, answer: string): ResolvedCitationRange;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import AgentRegistry, { type Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { SessionId } from '@deepseek-ai/dsh-session';
|
|
4
|
+
/** Own a separate factory while publishing live identities through DSH's public registry for its conversation, upload and queue APIs. */
|
|
5
|
+
export declare class CiterAgentRegistry extends AgentRegistry {
|
|
6
|
+
private readonly options;
|
|
7
|
+
constructor(ctx: Context, options: {
|
|
8
|
+
readonly registry: AgentRegistry;
|
|
9
|
+
});
|
|
10
|
+
enter(agent: Agent, owner: Agent | undefined): () => void;
|
|
11
|
+
announce(agent: Agent): void;
|
|
12
|
+
register(agent: Agent): () => void;
|
|
13
|
+
get(id: SessionId): Agent | undefined;
|
|
14
|
+
list(): Agent[];
|
|
15
|
+
roots(): Agent[];
|
|
16
|
+
isOwnedBy(id: SessionId, owner: Agent): boolean;
|
|
17
|
+
currentInitiator(): Agent | undefined;
|
|
18
|
+
requireInitiator(): Agent;
|
|
19
|
+
withInitiator<T>(agent: Agent, operation: () => T): T;
|
|
20
|
+
withoutInitiator<T>(operation: () => T): T;
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type SessionStore from '@deepseek-ai/dsh-session';
|
|
3
|
+
import type { Session } from '@deepseek-ai/dsh-session';
|
|
4
|
+
/** Bridge native checkpoints and identity lookups to owned stores without adding their members to Host enumeration. */
|
|
5
|
+
export declare class CiterSessionAccess {
|
|
6
|
+
private readonly owners;
|
|
7
|
+
/** Install one reversible adapter for this plugin's lifetime. No Host files or Agent Loop methods change. */
|
|
8
|
+
constructor(ctx: Context, drain: () => Promise<void>);
|
|
9
|
+
/** Register after native enter; unregister after native detach, including failed publication. */
|
|
10
|
+
enter(session: Session, store: SessionStore): () => void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type SessionStore from '@deepseek-ai/dsh-session';
|
|
3
|
+
import type { CiterSessionAccess } from './citer-session-access.ts';
|
|
4
|
+
/** Own live Topic membership without advertising it as a root Host conversation. */
|
|
5
|
+
export declare function createCiterSessionStore(Base: typeof SessionStore, access: CiterSessionAccess): new (ctx: Context, fallback: {
|
|
6
|
+
readonly store: SessionStore;
|
|
7
|
+
}) => SessionStore;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { AgentHandle } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { CiterSessionAccess } from './citer-session-access.ts';
|
|
4
|
+
/** A Topic-owned DSH factory and JSONL backend; live conversation APIs stay shared, disk ownership does not. */
|
|
5
|
+
export declare class CiterSessionWorld {
|
|
6
|
+
private fiber;
|
|
7
|
+
private readonly started;
|
|
8
|
+
private disposal;
|
|
9
|
+
private readonly handles;
|
|
10
|
+
private release;
|
|
11
|
+
private closing;
|
|
12
|
+
/** @param host - owning plugin context. @param root - verified Topic-owned JSONL directory. */
|
|
13
|
+
constructor(host: Context, root: string, access: CiterSessionAccess);
|
|
14
|
+
/** Wait for the isolated factory before creating or restoring a Topic. */
|
|
15
|
+
context(): Promise<Context>;
|
|
16
|
+
/** Retain the native handle so Agents settle while their persistence listeners are still mounted. */
|
|
17
|
+
own(handle: AgentHandle): Promise<AgentHandle>;
|
|
18
|
+
private start;
|
|
19
|
+
/** Stop and drain all factory-owned Agents before the caller can delete this Topic's files. */
|
|
20
|
+
dispose(): Promise<void>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
2
|
+
import { type ActionModel, type CiteAction } from '../actions.ts';
|
|
3
|
+
import type { CiteSelection } from './types.ts';
|
|
4
|
+
/** Immutable capture from a conversation, imported document or native file preview. */
|
|
5
|
+
export type ActionSource = {
|
|
6
|
+
readonly kind: 'conversation';
|
|
7
|
+
readonly selection: CiteSelection;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'document';
|
|
10
|
+
readonly sourceSessionId: SessionId;
|
|
11
|
+
readonly displayText: string;
|
|
12
|
+
readonly prefixText: string;
|
|
13
|
+
readonly suffixText: string;
|
|
14
|
+
readonly title: string;
|
|
15
|
+
readonly documentId?: string;
|
|
16
|
+
readonly content?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const actionSourceSession: (source: ActionSource) => SessionId;
|
|
19
|
+
export declare const actionSourceQuote: (source: ActionSource) => string;
|
|
20
|
+
export interface WheelSnapshot {
|
|
21
|
+
readonly source: ActionSource;
|
|
22
|
+
readonly x: number;
|
|
23
|
+
readonly y: number;
|
|
24
|
+
readonly active: number | null;
|
|
25
|
+
readonly slots: readonly (CiteAction | null)[];
|
|
26
|
+
readonly held: boolean;
|
|
27
|
+
readonly scale: number;
|
|
28
|
+
}
|
|
29
|
+
export interface ActionSnapshot {
|
|
30
|
+
wheel: WheelSnapshot | null;
|
|
31
|
+
pending: {
|
|
32
|
+
readonly source: ActionSource;
|
|
33
|
+
readonly action: CiteAction;
|
|
34
|
+
readonly x: number;
|
|
35
|
+
readonly y: number;
|
|
36
|
+
} | null;
|
|
37
|
+
question: string;
|
|
38
|
+
submitting: boolean;
|
|
39
|
+
error: string | null;
|
|
40
|
+
model: ActionModel | undefined;
|
|
41
|
+
}
|
|
42
|
+
/** Direction around the actual displayed centre; no action inside the dead zone or outside the wheel. */
|
|
43
|
+
export declare function wheelSector(dx: number, dy: number): number | null;
|
|
44
|
+
/** Controller owns duplicate submission, retry drafts and source-change cancellation. Dispose with the Client. */
|
|
45
|
+
export declare function createActionController(execute: (source: ActionSource, action: CiteAction, question: string, model?: ActionModel) => Promise<void>, defaultModel?: () => ActionModel | undefined): {
|
|
46
|
+
getSnapshot: () => ActionSnapshot;
|
|
47
|
+
subscribe: (fn: () => void) => () => void;
|
|
48
|
+
open(source: ActionSource, x: number, y: number, slots: readonly (CiteAction | null)[], held: boolean): void;
|
|
49
|
+
move(x: number, y: number): void;
|
|
50
|
+
focus(index: number): void;
|
|
51
|
+
release(quick: boolean): void;
|
|
52
|
+
/** Cancel only the transient gesture; a question draft belongs to its explicit close/source lifecycle. */
|
|
53
|
+
dismissWheel(): void;
|
|
54
|
+
choose: (index: number | null) => void;
|
|
55
|
+
cancel: () => void;
|
|
56
|
+
submit: () => Promise<void>;
|
|
57
|
+
setModel(model: ActionModel | undefined): void;
|
|
58
|
+
setQuestion(question: string): void;
|
|
59
|
+
dispose(): Promise<void>;
|
|
60
|
+
};
|
|
61
|
+
export type ActionController = ReturnType<typeof createActionController>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CiteAction, ActionModel, PanelPresentation } from '../actions.ts';
|
|
2
|
+
import { type ActionSource } from './action-controller.ts';
|
|
3
|
+
import type { CompanionFace } from './companion-controller.ts';
|
|
4
|
+
import type { ReaderFace } from './reader-controller.ts';
|
|
5
|
+
/** Bind explicit Topic and document services. No UI, global listeners or Cordis discovery. */
|
|
6
|
+
export declare function createActionExecutor(companion: CompanionFace, reader: ReaderFace, open: (presentation: PanelPresentation) => void): (source: ActionSource, action: CiteAction, question: string, modelRoute?: ActionModel) => Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the rendered board for one exact capture address.
|
|
3
|
+
* @param sessionId - owning Citer Session identity.
|
|
4
|
+
* @param revision - requested board revision.
|
|
5
|
+
* @param fallback - offscreen capture root, excluded from visible candidates.
|
|
6
|
+
* @returns a painted, viewport-intersecting board, or undefined to use the fallback renderer.
|
|
7
|
+
*/
|
|
8
|
+
export declare function findVisibleCaptureBoard(sessionId: string, revision: number, fallback: HTMLElement): HTMLElement | undefined;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { SessionFace, SessionSnapshot } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
3
|
+
import { type SessionId } from '@deepseek-ai/dsh-session/types';
|
|
4
|
+
import type { SessionRequestId } from '@deepseek-ai/dsh-api-session-controller/types';
|
|
5
|
+
type Submission = Parameters<SessionFace['beginSubmission']>[0];
|
|
6
|
+
/** Own the published SessionFace contract for Citer navigation. Sending, uploads and inbox mutations remain native DSH operations. */
|
|
7
|
+
export declare class CiterSessionFace implements SessionFace {
|
|
8
|
+
private readonly ctx;
|
|
9
|
+
readonly sessionId: SessionId;
|
|
10
|
+
private readonly store;
|
|
11
|
+
private readonly pending;
|
|
12
|
+
private readonly lifetime;
|
|
13
|
+
private readonly emptyProjection;
|
|
14
|
+
readonly projections: {
|
|
15
|
+
faceOf: (_key: string) => import("@deepseek-ai/dsh-client-store").SnapshotStore<unknown>;
|
|
16
|
+
};
|
|
17
|
+
private observers;
|
|
18
|
+
private timer;
|
|
19
|
+
private refreshing;
|
|
20
|
+
constructor(ctx: Context, sessionId: SessionId);
|
|
21
|
+
getSnapshot: () => SessionSnapshot;
|
|
22
|
+
subscribe: (listener: () => void) => (() => void);
|
|
23
|
+
/** Establish ownership and obtain a real baseline before accepting composer work. */
|
|
24
|
+
ready(): Promise<void>;
|
|
25
|
+
private patch;
|
|
26
|
+
private retire;
|
|
27
|
+
beginSubmission(input: Submission): {
|
|
28
|
+
requestId: SessionRequestId;
|
|
29
|
+
abandon: () => void;
|
|
30
|
+
};
|
|
31
|
+
prompt: SessionFace['prompt'];
|
|
32
|
+
/** Generic Citer attachment read; the installed SessionFace verb only supports images. */
|
|
33
|
+
readCiterAttachment: (attachmentId: string) => Promise<{
|
|
34
|
+
readonly ok: false;
|
|
35
|
+
readonly error: import("@deepseek-ai/dsh-typert-protocol").RemoteFailure;
|
|
36
|
+
} | {
|
|
37
|
+
ok: true;
|
|
38
|
+
value: {
|
|
39
|
+
attachment: import("@deepseek-ai/dsh-attachment").ImageAttachmentRef | {
|
|
40
|
+
attachmentId: import("@deepseek-ai/dsh-attachment").AttachmentId;
|
|
41
|
+
name: string;
|
|
42
|
+
bytes: number;
|
|
43
|
+
};
|
|
44
|
+
data: Uint8Array<ArrayBuffer>;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
readAttachment: SessionFace['readAttachment'];
|
|
48
|
+
updateQueue: SessionFace['updateQueue'];
|
|
49
|
+
cancel: SessionFace['cancel'];
|
|
50
|
+
rename: SessionFace['rename'];
|
|
51
|
+
command: SessionFace['command'];
|
|
52
|
+
loadOlder: () => Promise<void>;
|
|
53
|
+
loadThrough: () => Promise<void>;
|
|
54
|
+
private schedule;
|
|
55
|
+
private refresh;
|
|
56
|
+
/** Stop polling and settle each owned submission exactly once when its plugin closes. */
|
|
57
|
+
dispose(): void;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { NativeComposer, DeliveryMode } from './native-composer.ts';
|
|
2
|
+
import type { DraftAttachmentId } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
1
3
|
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
2
4
|
import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
3
5
|
import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
@@ -5,12 +7,18 @@ import type { ChatSnapshot } from '@deepseek-ai/dsh-client-ui-chat/client';
|
|
|
5
7
|
import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol';
|
|
6
8
|
import { type CiteCiterRequest, type CiteCiterResponse, type CiteCiterSettings, type ProviderOption, type QuestionAnswer, type TopicScenario, type TopicSnapshot, type TopicSummary } from '../topic.ts';
|
|
7
9
|
import { type CreateMode, type DocumentClaimIntent } from './request-guard.ts';
|
|
10
|
+
import type { ActionModel } from '../actions.ts';
|
|
8
11
|
import type { CiteSelection } from './types.ts';
|
|
9
12
|
export type CompanionPhase = 'idle' | 'creating' | 'ready' | 'running' | 'stopping' | 'stopped' | 'error';
|
|
10
13
|
export type { CreateMode } from './request-guard.ts';
|
|
11
14
|
export type TopicsStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
12
15
|
export type SettingsSaveStatus = 'idle' | 'saving' | 'saved' | 'error';
|
|
13
16
|
export interface CompanionSnapshot {
|
|
17
|
+
composeSeed: {
|
|
18
|
+
readonly sessionId: string;
|
|
19
|
+
readonly question: string;
|
|
20
|
+
readonly id: string;
|
|
21
|
+
} | null;
|
|
14
22
|
sourceSessionId: SessionId | null;
|
|
15
23
|
phase: CompanionPhase;
|
|
16
24
|
draftQuote: string | null;
|
|
@@ -38,13 +46,16 @@ export interface CompanionFace {
|
|
|
38
46
|
subscribe(listener: () => void): () => void;
|
|
39
47
|
setSource(sessionId: SessionId | null): void;
|
|
40
48
|
retainVisible(): () => void;
|
|
41
|
-
create(selection: CiteSelection, question: string, mode?: CreateMode, scenario?: TopicScenario): Promise<void>;
|
|
49
|
+
create(selection: CiteSelection, question: string, mode?: CreateMode, scenario?: TopicScenario, modelRoute?: ActionModel): Promise<void>;
|
|
42
50
|
createFree(question: string, scenario: Extract<TopicScenario, 'qa' | 'present'>): Promise<boolean>;
|
|
43
|
-
|
|
51
|
+
/** Create a Reading Topic; rejects on failure so the Reader retains the unsent question. */
|
|
52
|
+
createFromDocument(claim: DocumentClaimIntent, question: string, sourceSessionId?: SessionId, modelRoute?: ActionModel): Promise<void>;
|
|
44
53
|
openTopic(sessionId: string): Promise<void>;
|
|
45
|
-
ask(question: string): Promise<boolean>;
|
|
54
|
+
ask(question: string, attachments?: readonly DraftAttachmentId[], mode?: DeliveryMode): Promise<boolean>;
|
|
55
|
+
setPermission(mode: NonNullable<CiteCiterSettings['defaultPermission']>): Promise<void>;
|
|
46
56
|
answerQuestion(key: string, answer: QuestionAnswer): Promise<void>;
|
|
47
57
|
cancelQuestion(key: string): Promise<void>;
|
|
58
|
+
boardCaptureReply(sessionId: string, id: string, png?: string, error?: string): Promise<void>;
|
|
48
59
|
stop(): Promise<void>;
|
|
49
60
|
rename(title: string): Promise<boolean>;
|
|
50
61
|
archive(archived: boolean): Promise<boolean>;
|
|
@@ -59,4 +70,4 @@ export interface CompanionFace {
|
|
|
59
70
|
/** Initial browser snapshot for the root-scoped CiteCiter controller. */
|
|
60
71
|
export declare const INITIAL_COMPANION_SNAPSHOT: CompanionSnapshot;
|
|
61
72
|
/** Bind private Topic Remote calls to one browser snapshot and polling lifecycle. */
|
|
62
|
-
export declare function createCompanionController(readChat: (sessionId: SessionId) => ChatSnapshot | undefined, settingsScope: SettingsScope<CiteCiterSettings>, request: RemoteRequest, onAutoOpen: () => void, store: SnapshotStore<CompanionSnapshot
|
|
73
|
+
export declare function createCompanionController(readChat: (sessionId: SessionId) => ChatSnapshot | undefined, settingsScope: SettingsScope<CiteCiterSettings>, request: RemoteRequest, onAutoOpen: () => void, store: SnapshotStore<CompanionSnapshot>, nativeComposer: NativeComposer): CompanionFace;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
|
|
2
|
+
import { type ActionController, type ActionSnapshot } from '../action-controller.ts';
|
|
3
|
+
import type { CompanionActions } from '../view-actions.ts';
|
|
4
|
+
import type { CompanionSnapshot } from '../companion-controller.ts';
|
|
5
|
+
export type ActionCallbacks = Omit<ActionController, 'getSnapshot' | 'subscribe' | 'dispose'>;
|
|
6
|
+
/** Public shell overlay: wheel, input prompt and visible retry. Business work stays in its controller. */
|
|
7
|
+
export declare function ActionWheel({ useActions, useCompanion, actions, companion }: {
|
|
8
|
+
useActions: SnapshotSelectorHook<ActionSnapshot>;
|
|
9
|
+
useCompanion: SnapshotSelectorHook<CompanionSnapshot>;
|
|
10
|
+
actions: ActionCallbacks;
|
|
11
|
+
companion: CompanionActions;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BoardSnapshot } from '../../board.ts';
|
|
2
|
+
/** Reuses the exact board renderer when its visible tab is closed; no synthetic drawing or extra conversation is created. */
|
|
3
|
+
export declare function BoardCaptureSurface({ id, sessionId, board, reply }: {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly sessionId: string;
|
|
6
|
+
readonly board: BoardSnapshot | undefined;
|
|
7
|
+
readonly reply: (sessionId: string, id: string, png?: string, error?: string) => Promise<void>;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import 'katex/dist/katex.min.css';
|
|
2
2
|
import { type BoardElementState, type BoardSnapshot } from '../../board.ts';
|
|
3
3
|
/**
|
|
4
|
-
* Render one final-state blackboard projection in
|
|
5
|
-
* @param props -
|
|
4
|
+
* Render one final-state blackboard projection in either learning surface.
|
|
5
|
+
* @param props - snapshot, motion preference, optional compact reading mode and citation action.
|
|
6
6
|
* @returns the safe blackboard canvas.
|
|
7
7
|
*/
|
|
8
|
-
export declare function BoardView({ snapshot, animations, onQuoteElement, }: {
|
|
8
|
+
export declare function BoardView({ snapshot, animations, onQuoteElement, compact, sessionId, }: {
|
|
9
9
|
readonly snapshot: BoardSnapshot | undefined;
|
|
10
10
|
readonly animations: boolean;
|
|
11
11
|
readonly onQuoteElement?: (element: BoardElementState) => void;
|
|
12
|
+
readonly compact?: boolean;
|
|
13
|
+
readonly sessionId?: string;
|
|
12
14
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode, type RefObject } from 'react';
|
|
2
|
+
/** Anchored menu surface. Owns positioning, focus and dismissal, not selection state. */
|
|
3
|
+
export declare function ChoicePopover({ anchor, label, onClose, children }: {
|
|
4
|
+
readonly anchor: RefObject<HTMLElement>;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly onClose: () => void;
|
|
7
|
+
readonly children: ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
/** Independent entry back to the current learning workspace; owns no selection state. */
|
|
5
|
+
export declare function CiteLauncher({ useCompanion, useOverlay, openPanel }: {
|
|
6
|
+
useCompanion: SnapshotSelectorHook<CompanionSnapshot>;
|
|
7
|
+
useOverlay: SnapshotSelectorHook<CiteOverlaySnapshot>;
|
|
8
|
+
openPanel: () => void;
|
|
9
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import type { NativeComposer, DeliveryMode } from '../native-composer.ts';
|
|
2
|
+
import type { UseSessionPendingInteraction } from '@deepseek-ai/dsh-client-ui-session/client';
|
|
1
3
|
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
|
|
2
4
|
import type { CiteOverlaySnapshot } from '../types.ts';
|
|
3
5
|
import type { CompanionSnapshot } from '../companion-controller.ts';
|
|
4
6
|
import type { CompanionActions, OverlayActions } from '../view-actions.ts';
|
|
5
7
|
export interface CitePanelProps {
|
|
8
|
+
readonly nativeComposer: NativeComposer;
|
|
6
9
|
readonly useCompanion: SnapshotSelectorHook<CompanionSnapshot>;
|
|
7
10
|
readonly useOverlay: SnapshotSelectorHook<CiteOverlaySnapshot>;
|
|
11
|
+
readonly useInteractions: UseSessionPendingInteraction;
|
|
12
|
+
readonly useSubmission: SnapshotSelectorHook<DeliveryMode>;
|
|
8
13
|
readonly bus: OverlayActions;
|
|
9
14
|
readonly companion: CompanionActions;
|
|
10
15
|
readonly closePanel: () => void;
|
|
16
|
+
readonly openReader: () => void;
|
|
11
17
|
readonly reportParseError: (messageId: string) => void;
|
|
12
18
|
}
|
|
13
19
|
/**
|
|
@@ -15,4 +21,4 @@ export interface CitePanelProps {
|
|
|
15
21
|
* @param props - shared panel bus, Topic controller, and host callbacks.
|
|
16
22
|
* @returns the responsive Topic dock and its dialogs, or null while closed.
|
|
17
23
|
*/
|
|
18
|
-
export declare function CitePanel({ useCompanion, useOverlay, bus, companion, closePanel, reportParseError }: CitePanelProps): import("react").JSX.Element | null;
|
|
24
|
+
export declare function CitePanel({ nativeComposer, useCompanion, useOverlay, useInteractions, useSubmission, bus, companion, closePanel, openReader, reportParseError }: CitePanelProps): import("react").JSX.Element | null;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
|
|
2
2
|
import type { ReaderSnapshot } from '../reader-controller.ts';
|
|
3
|
+
import type { CiteOverlaySnapshot } from '../types.ts';
|
|
3
4
|
import type { ReaderActions } from '../view-actions.ts';
|
|
5
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
6
|
+
import type { SelectionSurfaces } from '../wheel-gesture.ts';
|
|
4
7
|
/** Reader shell-overlay entry: compact trigger plus the document library panel. */
|
|
5
|
-
export declare function DocumentReader({ reader, useReader }: {
|
|
8
|
+
export declare function DocumentReader({ reader, useReader, useOverlay, registerSurface, sourceSessionId }: {
|
|
6
9
|
readonly reader: ReaderActions;
|
|
7
10
|
readonly useReader: SnapshotSelectorHook<ReaderSnapshot>;
|
|
11
|
+
readonly useOverlay: SnapshotSelectorHook<CiteOverlaySnapshot>;
|
|
12
|
+
readonly registerSurface: SelectionSurfaces['register'];
|
|
13
|
+
readonly sourceSessionId: () => SessionId | null;
|
|
8
14
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComposerAttachment, DraftAttachmentId } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
2
|
+
import type { NativeComposer } from '../native-composer.ts';
|
|
3
|
+
/** Native Conversation-owned file drafts. The owning controller handles upload and lifetime. */
|
|
4
|
+
export declare function FileAttachments({ files, remove, native, sessionId }: {
|
|
5
|
+
readonly files: readonly ComposerAttachment[];
|
|
6
|
+
readonly remove: (id: DraftAttachmentId) => void;
|
|
7
|
+
readonly native: NativeComposer;
|
|
8
|
+
readonly sessionId: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type LearningCardsProjection } from '../../learning.ts';
|
|
2
|
+
/** Read the latest durable Topic card set. Recall affects display only and never schedules work. */
|
|
3
|
+
export declare function LearningCards({ projection, recall, setRecall, disabled, topicTitle, topicId, source, onRevise }: {
|
|
4
|
+
readonly projection: LearningCardsProjection;
|
|
5
|
+
readonly recall: boolean;
|
|
6
|
+
readonly setRecall: (value: boolean) => void;
|
|
7
|
+
readonly disabled: boolean;
|
|
8
|
+
readonly topicTitle: string;
|
|
9
|
+
readonly topicId: string;
|
|
10
|
+
readonly source: string;
|
|
11
|
+
readonly onRevise: () => void;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TopicMessage } from '../../topic.ts';
|
|
2
|
+
/** Optional native todo projection. The user toggles planning; the model owns plan contents. */
|
|
3
|
+
export declare function LearningRoute({ enabled, messages, onChange }: {
|
|
4
|
+
readonly enabled: boolean;
|
|
5
|
+
readonly messages: readonly TopicMessage[];
|
|
6
|
+
readonly onChange: (enabled: boolean) => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NativeComposer } from '../native-composer.ts';
|
|
2
|
+
export interface MessageAttachment {
|
|
3
|
+
readonly kind: 'image' | 'file';
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
}
|
|
7
|
+
/** Render durable native attachments with a session-authorized loader and owned object URLs. */
|
|
8
|
+
export declare function MessageAttachments({ sessionId, attachments, load }: {
|
|
9
|
+
readonly sessionId: string;
|
|
10
|
+
readonly attachments: readonly MessageAttachment[];
|
|
11
|
+
readonly load: NativeComposer['attachment'];
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NativeComposer } from '../native-composer.ts';
|
|
2
|
+
import type { MessageAttachment } from './MessageAttachments.tsx';
|
|
3
|
+
/** Accessible file chip. The download hook owns requests and object URLs. */
|
|
4
|
+
export declare function MessageFile({ sessionId, attachment, load }: {
|
|
5
|
+
readonly sessionId: string;
|
|
6
|
+
readonly attachment: MessageAttachment;
|
|
7
|
+
readonly load: NativeComposer['attachment'];
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ActionModel } from '../../actions.ts';
|
|
2
|
+
import type { ProviderOption } from '../../topic.ts';
|
|
3
|
+
/** Model identities are encoded together, so provider-local model IDs never collide. */
|
|
4
|
+
export declare function ModelChoice({ providers, value, onChange, disabled, label }: {
|
|
5
|
+
providers: readonly ProviderOption[];
|
|
6
|
+
value: ActionModel | undefined;
|
|
7
|
+
onChange: (value: ActionModel | undefined) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SessionPendingInteraction } from '@deepseek-ai/dsh-client-ui-session/client';
|
|
2
|
+
import type { TopicMessage } from '../../topic.ts';
|
|
3
|
+
/** Present the Host's one-shot pending request. Decisions go to its existing waterfall; no second permission authority is created. Remount on pending.key. */
|
|
4
|
+
export declare function NativeInteraction({ pending, messages }: {
|
|
5
|
+
readonly pending: SessionPendingInteraction;
|
|
6
|
+
readonly messages: readonly TopicMessage[];
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DocumentPreviewProps } from '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/client';
|
|
2
|
+
import type { ActionSource } from '../action-controller.ts';
|
|
3
|
+
import type { SelectionSurfaces } from '../wheel-gesture.ts';
|
|
4
|
+
export interface LearningDocumentActions {
|
|
5
|
+
readonly registerSurface: SelectionSurfaces['register'];
|
|
6
|
+
readonly openActions: (source: ActionSource, x: number, y: number) => void;
|
|
7
|
+
}
|
|
8
|
+
/** Alternate native document renderer. DSH owns loading, reload and file navigation. */
|
|
9
|
+
export declare function NativeLearningDocument({ content, resourceAddress, wrap, scrollportRef, registerSurface, openActions }: DocumentPreviewProps & LearningDocumentActions): import("react").JSX.Element;
|