@kirkchinese/dsh-citeciter 0.5.0 → 0.8.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 +89 -70
- package/README.zh.md +91 -70
- package/lib/client.js +7028 -1167
- package/lib/index.js +1786 -587
- package/lib/{typert-common-DKqYKnRO.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 +19 -5
- package/lib/types/client/components/ActionWheel.d.ts +12 -0
- package/lib/types/client/components/BlackboardWorkspace.d.ts +7 -5
- 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/CiteCiterSettings.d.ts +12 -7
- package/lib/types/client/components/CiteLauncher.d.ts +9 -0
- package/lib/types/client/components/CitePanel.d.ts +15 -5
- package/lib/types/client/components/CompactBackButton.d.ts +4 -0
- package/lib/types/client/components/DocumentReader.d.ts +12 -3
- 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/UpdateNotice.d.ts +6 -3
- package/lib/types/client/components/UserMessageBody.d.ts +4 -0
- package/lib/types/client/components/WheelSettings.d.ts +7 -0
- package/lib/types/client/copy.d.ts +6 -0
- package/lib/types/client/dock-geometry.d.ts +23 -0
- package/lib/types/client/draft-references.d.ts +20 -0
- package/lib/types/client/entries.d.ts +3 -2
- 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 +18 -0
- 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 +7 -1
- package/lib/types/client/request-guard.d.ts +3 -2
- package/lib/types/client/selection.d.ts +1 -1
- 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 +6 -5
- package/lib/types/client/update-controller.d.ts +5 -3
- package/lib/types/client/view-actions.d.ts +26 -0
- 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 +15 -0
- package/lib/types/host-session-adapter.d.ts +31 -0
- package/lib/types/index.d.ts +6 -6
- 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/observer.d.ts +2 -1
- 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 +21 -57
- package/lib/types/topic-stream.d.ts +14 -0
- package/lib/types/topic.d.ts +301 -2
- package/lib/types/typert-common.d.ts +211 -1
- package/lib/types/typert.host.d.ts +456 -3
- package/lib/types/update.d.ts +1 -0
- package/lib/{update-u9-6c_qp.js → update-0LcFDvI5.js} +281 -14
- package/package.json +83 -70
- package/lib/types/client/components/SelectionMenu.d.ts +0 -13
|
@@ -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;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NativeComposer } from '../native-composer.ts';
|
|
2
|
+
/** Read and mutate the Host's authoritative inbox. Citer never owns a second queue. */
|
|
3
|
+
export declare function NativeQueue({ sessionId, native }: {
|
|
4
|
+
readonly sessionId: string;
|
|
5
|
+
readonly native: NativeComposer;
|
|
6
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Render plugin-owned floating content outside the shell's stacking context.
|
|
4
|
+
* The public slot still owns its React lifetime; unmounting removes the portal.
|
|
5
|
+
* Inline content keeps its original ancestry for the isolated dock adapter.
|
|
6
|
+
*/
|
|
7
|
+
export declare function OverlayPortal({ children, inline }: {
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
readonly inline?: boolean;
|
|
10
|
+
}): ReactNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CiteCiterSettings } from '../../topic.ts';
|
|
2
|
+
export type PermissionMode = NonNullable<CiteCiterSettings['defaultPermission']>;
|
|
3
|
+
/** Explicit permission selection; receives the Host's effective value. */
|
|
4
|
+
export declare function PermissionControl({ value, onChange }: {
|
|
5
|
+
readonly value: PermissionMode;
|
|
6
|
+
readonly onChange: (mode: PermissionMode) => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AskUserQuestionAnswer } from '@deepseek-ai/dsh-user-questions';
|
|
2
2
|
import type { PendingQuestion } from '../../topic.ts';
|
|
3
3
|
export interface QuestionCardProps {
|
|
4
|
-
readonly
|
|
5
|
-
|
|
4
|
+
readonly pending: {
|
|
5
|
+
readonly key: string;
|
|
6
|
+
readonly questions: readonly (PendingQuestion['questions'][number] & {
|
|
7
|
+
readonly detail?: string;
|
|
8
|
+
})[];
|
|
9
|
+
};
|
|
10
|
+
readonly onAnswer: (answer: AskUserQuestionAnswer) => Promise<unknown>;
|
|
11
|
+
readonly onCancel: () => Promise<unknown>;
|
|
6
12
|
}
|
|
7
13
|
/** Collect one standard DSH ask_user_question answer batch inside the private Topic. */
|
|
8
|
-
export declare function QuestionCard({
|
|
14
|
+
export declare function QuestionCard({ onAnswer, onCancel, pending }: QuestionCardProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Display only reasoning actually returned by the model. Expansion is local UI state; no model call or Session mutation occurs. */
|
|
2
|
+
export declare function ReasoningDisclosure({ text, active }: {
|
|
3
|
+
readonly text: string;
|
|
4
|
+
readonly active: boolean;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type DraftReference } from '../draft-references.ts';
|
|
2
|
+
/** Removable draft chips and rendered previews. No model calls or source reads. */
|
|
3
|
+
export declare function ReferenceAttachments({ references, onRemove }: {
|
|
4
|
+
readonly references: readonly DraftReference[];
|
|
5
|
+
readonly onRemove?: (id: string) => void;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Workspace actions remain reachable without a floating launcher over the composer. Callbacks own their dialogs and services. */
|
|
2
|
+
export declare function TopicActions({ hasTopic, onSettings, onReader }: {
|
|
3
|
+
readonly hasTopic: boolean;
|
|
4
|
+
readonly onSettings: () => void;
|
|
5
|
+
readonly onReader: () => void;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type FormEvent, type Ref, type ReactNode } from 'react';
|
|
2
|
+
import type { ProviderOption, TopicModelConfig } from '../../topic.ts';
|
|
3
|
+
import type { CompanionPhase } from '../companion-controller.ts';
|
|
4
|
+
import { type PermissionMode } from './PermissionControl.tsx';
|
|
5
|
+
import type { DeliveryMode } from '../native-composer.ts';
|
|
6
|
+
import type { DraftReference } from '../draft-references.ts';
|
|
7
|
+
/**
|
|
8
|
+
* Render the Topic draft and its submission controls without accessing services.
|
|
9
|
+
* @param props - controlled draft, model route, request state and user-action callbacks.
|
|
10
|
+
* @returns one form; model changes and sending remain owned by the Topic controller.
|
|
11
|
+
*/
|
|
12
|
+
export declare function TopicComposer({ question, placeholder, route, providers, phase, canSend, routeSaving, folded, inputRef, onExpand, onQuestion, onSubmit, onStop, onModel, onReasoning, attachments, permission, onPermission, onFiles, delivery, onDelivery, sources, onReference }: {
|
|
13
|
+
readonly sources: readonly DraftReference[];
|
|
14
|
+
readonly onReference: (reference: DraftReference) => void;
|
|
15
|
+
readonly permission: PermissionMode;
|
|
16
|
+
readonly onPermission: (mode: PermissionMode) => void;
|
|
17
|
+
readonly onFiles: (files: readonly File[]) => void;
|
|
18
|
+
readonly delivery: DeliveryMode;
|
|
19
|
+
readonly onDelivery: (mode: DeliveryMode) => void;
|
|
20
|
+
readonly attachments?: ReactNode;
|
|
21
|
+
readonly question: string;
|
|
22
|
+
readonly placeholder: string;
|
|
23
|
+
readonly route: TopicModelConfig | undefined;
|
|
24
|
+
readonly providers: readonly ProviderOption[];
|
|
25
|
+
readonly phase: CompanionPhase;
|
|
26
|
+
readonly canSend: boolean;
|
|
27
|
+
readonly routeSaving: boolean;
|
|
28
|
+
readonly folded: boolean;
|
|
29
|
+
readonly inputRef: Ref<HTMLTextAreaElement>;
|
|
30
|
+
readonly onExpand: () => void;
|
|
31
|
+
readonly onQuestion: (question: string) => void;
|
|
32
|
+
readonly onSubmit: (event: FormEvent, mode?: DeliveryMode) => void;
|
|
33
|
+
readonly onStop: () => void;
|
|
34
|
+
readonly onModel: (provider: string, model: string) => void;
|
|
35
|
+
readonly onReasoning: (effort: string | null) => void;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PointerEventHandler, ReactNode } from 'react';
|
|
2
|
+
/** Layout-only header: navigation, title and drag behavior are supplied by their independent controllers. */
|
|
3
|
+
export declare function TopicHeader({ compact, onBack, onDrag, title, status, children }: {
|
|
4
|
+
readonly compact: boolean;
|
|
5
|
+
readonly onBack: () => void;
|
|
6
|
+
readonly onDrag: PointerEventHandler<HTMLElement>;
|
|
7
|
+
readonly title: ReactNode;
|
|
8
|
+
readonly status: string;
|
|
9
|
+
readonly children: ReactNode;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ProviderOption, TopicModelConfig } from '../../topic.ts';
|
|
2
|
+
/** Model and reasoning hierarchy. Route changes are committed by the injected controller. */
|
|
3
|
+
export declare function TopicModelControls({ providers, route, saving, onModel, onReasoning }: {
|
|
4
|
+
readonly providers: readonly ProviderOption[];
|
|
5
|
+
readonly route: TopicModelConfig;
|
|
6
|
+
readonly saving: boolean;
|
|
7
|
+
readonly onModel: (provider: string, model: string) => void;
|
|
8
|
+
readonly onReasoning: (effort: string | null) => void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TopicSummary } from '../../topic.ts';
|
|
2
|
+
/** Session-list navigation with search. Receives domain rows and callbacks, without service discovery. */
|
|
3
|
+
export declare function TopicNavigation({ topics, activeId, archived, onOpen, onNew, onArchiveView, onSettings, onReader }: {
|
|
4
|
+
readonly topics: readonly TopicSummary[];
|
|
5
|
+
readonly activeId: string | undefined;
|
|
6
|
+
readonly archived: boolean;
|
|
7
|
+
readonly onOpen: (id: string) => void;
|
|
8
|
+
readonly onNew: () => void;
|
|
9
|
+
readonly onArchiveView: (archived: boolean) => void;
|
|
10
|
+
readonly onSettings: () => void;
|
|
11
|
+
readonly onReader: () => void;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render infrequent Topic management separately from the learning composer.
|
|
3
|
+
* @param props - current identity, operation status and management callbacks.
|
|
4
|
+
* @returns a controlled dialog; deletion is enabled only for legacy private logs or verified Citer-owned source storage.
|
|
5
|
+
*/
|
|
6
|
+
export declare function TopicSettingsDialog({ open, topic, archiving, deleting, error, onClose, onArchive, onDelete }: {
|
|
7
|
+
readonly open: boolean;
|
|
8
|
+
readonly topic: {
|
|
9
|
+
readonly sessionId: string;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
readonly archived: boolean;
|
|
12
|
+
readonly hosted?: boolean | undefined;
|
|
13
|
+
readonly storage?: 'source' | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
readonly archiving: boolean;
|
|
16
|
+
readonly deleting: boolean;
|
|
17
|
+
readonly error: string | null;
|
|
18
|
+
readonly onClose: () => void;
|
|
19
|
+
readonly onArchive: (archived: boolean) => Promise<boolean>;
|
|
20
|
+
readonly onDelete: () => void;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Inline rename committed by Enter or blur, cancelled by Escape. Double-click and F2 start editing. */
|
|
2
|
+
export declare function TopicTitle({ id, title, onRename }: {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly onRename: (title: string) => Promise<boolean>;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
2
4
|
/** Injected owner of the root-scoped update state. */
|
|
3
5
|
export interface UpdateNoticeProps {
|
|
4
|
-
readonly
|
|
6
|
+
readonly useUpdate: SnapshotSelectorHook<UpdateNoticeSnapshot>;
|
|
7
|
+
readonly updateController: UpdateActions;
|
|
5
8
|
}
|
|
6
9
|
/**
|
|
7
10
|
* Render the non-modal Web update notice in the frame-wide overlay.
|
|
8
11
|
* @param props - root-scoped update actions and observable state.
|
|
9
12
|
* @returns the available-version card, or no surface while current or suppressed.
|
|
10
13
|
*/
|
|
11
|
-
export declare function UpdateNotice({ updateController }: UpdateNoticeProps): import("react").JSX.Element | null;
|
|
14
|
+
export declare function UpdateNotice({ useUpdate, updateController }: UpdateNoticeProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CompanionSnapshot } from '../companion-controller.ts';
|
|
2
|
+
import type { CompanionActions } from '../view-actions.ts';
|
|
3
|
+
/** Edit eight stable slots as one validated settings transaction. */
|
|
4
|
+
export declare function WheelSettings({ snapshot, companion }: {
|
|
5
|
+
snapshot: CompanionSnapshot;
|
|
6
|
+
companion: CompanionActions;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -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
|
+
/** Wide windows reserve a column; compact windows navigate to a Citer page. */
|
|
11
|
+
export interface DockGeometry {
|
|
12
|
+
readonly mode: 'columns' | 'page';
|
|
13
|
+
readonly width: number;
|
|
14
|
+
readonly height: number;
|
|
15
|
+
readonly top: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Reserve a separate column, or the content area 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,20 @@
|
|
|
1
|
+
import type { TopicSummary } from '../topic.ts';
|
|
2
|
+
/** One unsent model-visible reference. Removing this value removes its serialized content. */
|
|
3
|
+
export interface DraftReference {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly kind: 'source' | 'excerpt' | 'board';
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly content: string;
|
|
8
|
+
readonly address?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Build initial references without submitting them. Stable Topic-scoped IDs preserve menu focus during live snapshot refreshes. */
|
|
11
|
+
export declare function topicDraftReferences(topic: TopicSummary, documentTitle?: string): readonly DraftReference[];
|
|
12
|
+
/** Display a document filename while retaining the full title/path in its serialized content. Legacy ID-only references keep their generic label. */
|
|
13
|
+
export declare function draftReferenceName(reference: DraftReference): string;
|
|
14
|
+
/** Serialize the exact visible attachment collection only at manual submission. */
|
|
15
|
+
export declare function serializeDraftReferences(question: string, references: readonly DraftReference[]): string;
|
|
16
|
+
/** Present sent reference blocks as expandable attachments while retaining the exact serialized model input in the Session log. Unrecognized text is preserved. */
|
|
17
|
+
export declare function parseSentReferences(text: string): {
|
|
18
|
+
readonly question: string;
|
|
19
|
+
readonly references: readonly DraftReference[];
|
|
20
|
+
};
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* Entries run in registration order; the first claim wins and is allowed to
|
|
5
5
|
* prevent the native context menu.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
7
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
8
|
+
import type { ChatSnapshot } from '@deepseek-ai/dsh-client-ui-chat/client';
|
|
8
9
|
import type { CiteSelection } from './types.ts';
|
|
9
10
|
/** Live browser facts an entry needs to resolve one selection. */
|
|
10
11
|
export interface CiteCiterEntryContext {
|
|
11
|
-
readonly
|
|
12
|
+
readonly readChat: (sessionId: SessionId) => ChatSnapshot | undefined;
|
|
12
13
|
readonly sourceSessionId: SessionId;
|
|
13
14
|
}
|
|
14
15
|
/** One Citer entry point: probe, capture, and claim a selection from the DOM. */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NativeComposer } from './native-composer.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Download one committed attachment on demand through its owning Session.
|
|
4
|
+
* @param sessionId - the exact Topic that authorizes the attachment read.
|
|
5
|
+
* @param id - the durable native attachment identity.
|
|
6
|
+
* @param name - suggested local filename; never used as a source filesystem path.
|
|
7
|
+
* @param load - native attachment reader, provided by the client controller.
|
|
8
|
+
* @returns the download action and its visible progress/error state.
|
|
9
|
+
* Repeated clicks share one request. Identity changes and unmount cancel UI effects
|
|
10
|
+
* and release the owned object URL without cancelling the host's shared reader.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useFileDownload(sessionId: string, id: string, name: string, load: NativeComposer['attachment']): {
|
|
13
|
+
download: () => Promise<void>;
|
|
14
|
+
busy: boolean;
|
|
15
|
+
error: string | undefined;
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type DragEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Isolate file drags inside one physical panel from document-level drop owners.
|
|
4
|
+
* @param open - whether the owning panel is mounted and available.
|
|
5
|
+
* @param enabled - whether a current Topic can receive attachments.
|
|
6
|
+
* @param onFiles - receive one dropped batch; never submits a model request.
|
|
7
|
+
* @returns the local invitation state and handlers to spread on the panel root.
|
|
8
|
+
* Global cancellation listeners exist only while open and are released on cleanup.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useFileDrop(open: boolean, enabled: boolean, onFiles: (files: readonly File[]) => void): {
|
|
11
|
+
active: boolean;
|
|
12
|
+
handlers: {
|
|
13
|
+
onDragEnter: (event: DragEvent<HTMLElement>) => void;
|
|
14
|
+
onDragOver: (event: DragEvent<HTMLElement>) => void;
|
|
15
|
+
onDragLeave: (event: DragEvent<HTMLElement>) => void;
|
|
16
|
+
onDrop: (event: DragEvent<HTMLElement>) => void;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Isolated, disposable layout adapter for DSH 0.1.5-rc.1 and Desktop 2.0.9 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, floating?: boolean): DockGeometry | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TopicMessage } from '../topic.ts';
|
|
2
|
+
/** Public todo states, projected from successful native todo_write results. */
|
|
3
|
+
export interface LearningTodo {
|
|
4
|
+
readonly content: string;
|
|
5
|
+
readonly status: 'pending' | 'in_progress' | 'completed';
|
|
6
|
+
}
|
|
7
|
+
/** Read the last accepted plan; malformed historical tool arguments do not replace a valid plan. */
|
|
8
|
+
export declare function learningTodos(messages: readonly TopicMessage[]): readonly LearningTodo[];
|
|
9
|
+
/** One user-submitted learning request. Planning continues inside its ordinary Agent turn. */
|
|
10
|
+
export declare function withLearningRoute(question: string, enabled: boolean): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ComposerAttachment, DraftAttachmentId, DraftFileUploads } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
|
+
import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store';
|
|
4
|
+
import type { SessionFace, SessionSnapshot } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
5
|
+
export type DeliveryMode = 'queue' | 'steer';
|
|
6
|
+
export interface NativeComposer {
|
|
7
|
+
readonly uploads: ObservableSnapshot<DraftFileUploads>;
|
|
8
|
+
retry(sessionId: string, id: DraftAttachmentId): void;
|
|
9
|
+
watch(sessionId: string, listener: (snapshot: SessionSnapshot) => void): () => void;
|
|
10
|
+
queue(sessionId: string, id: Parameters<SessionFace['updateQueue']>[0], action: Parameters<SessionFace['updateQueue']>[1]): Promise<void>;
|
|
11
|
+
/** Read an image or file through its owning Session's attachment authorization. */
|
|
12
|
+
attachment(sessionId: string, id: string): Promise<Blob>;
|
|
13
|
+
add(sessionId: string, files: readonly File[]): Promise<readonly ComposerAttachment[]>;
|
|
14
|
+
remove(id: DraftAttachmentId): void;
|
|
15
|
+
send(sessionId: string, text: string, attachments: readonly DraftAttachmentId[], mode: DeliveryMode): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
/** Adapt the installed conversation service's published composer methods; never reach its private input machine. */
|
|
18
|
+
export declare function createNativeComposer(ctx: Context): NativeComposer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ActionSource } from './action-controller.ts';
|
|
2
|
+
import type { ReaderSelection } from './reader-selection.ts';
|
|
3
|
+
/** Decode a complete Host-owned preview buffer. Reject binary, partial and oversized imports. */
|
|
4
|
+
export declare function decodeNativeText(content: {
|
|
5
|
+
readonly kind: 'text';
|
|
6
|
+
readonly text: string;
|
|
7
|
+
readonly eof: boolean;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'bytes';
|
|
10
|
+
readonly data: Uint8Array;
|
|
11
|
+
}): string;
|
|
12
|
+
/** Capture the file address's own Session and immutable text, never the later active tab. */
|
|
13
|
+
export declare function nativeDocumentSource(address: string, content: string, selection: ReaderSelection): ActionSource;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PointerEvent, type RefObject } from 'react';
|
|
2
|
+
/** Pointer lifecycle survives reparenting between the host slot and the floating portal. */
|
|
3
|
+
export declare function usePanelDrag(panel: RefObject<HTMLElement | null>, floating: boolean, setPresentation: (mode: 'side' | 'floating') => void): {
|
|
4
|
+
position: {
|
|
5
|
+
left: number;
|
|
6
|
+
top: number;
|
|
7
|
+
} | null;
|
|
8
|
+
dockTarget: boolean;
|
|
9
|
+
start: (event: PointerEvent<HTMLElement>) => void;
|
|
10
|
+
};
|
|
@@ -11,6 +11,8 @@ export interface ReaderSnapshot {
|
|
|
11
11
|
selection: ReaderSelection | null;
|
|
12
12
|
question: string;
|
|
13
13
|
creating: boolean;
|
|
14
|
+
importing: boolean;
|
|
15
|
+
loading: boolean;
|
|
14
16
|
error: string | null;
|
|
15
17
|
}
|
|
16
18
|
export interface ReaderFace {
|
|
@@ -19,7 +21,11 @@ export interface ReaderFace {
|
|
|
19
21
|
setOpen(open: boolean): void;
|
|
20
22
|
refresh(): Promise<void>;
|
|
21
23
|
importFile(name: string, content: string): Promise<DocumentSummary | null>;
|
|
24
|
+
/** Read a local text file; file access failures are displayed in the Reader. */
|
|
25
|
+
importLocalFile(file: Pick<File, 'name' | 'size' | 'text'>): Promise<void>;
|
|
22
26
|
openDocument(documentId: string): Promise<void>;
|
|
27
|
+
/** Load a zero-based page of the active document, clearing its previous selection. */
|
|
28
|
+
openPage(page: number): Promise<void>;
|
|
23
29
|
setSelection(selection: ReaderSelection | null): void;
|
|
24
30
|
setQuestion(question: string): void;
|
|
25
31
|
createTopic(): Promise<void>;
|
|
@@ -29,5 +35,5 @@ type RemoteRequest = (request: CiteCiterRequest, signal: AbortSignal) => Promise
|
|
|
29
35
|
/** Initial Reader snapshot. */
|
|
30
36
|
export declare function createInitialReaderSnapshot(): ReaderSnapshot;
|
|
31
37
|
/** Bind the Reader store to the CiteCiter Remote and the companion Topic creator. */
|
|
32
|
-
export declare function createReaderController(request: RemoteRequest, companion: CompanionFace, store?: import("@deepseek-ai/dsh-client-
|
|
38
|
+
export declare function createReaderController(request: RemoteRequest, companion: CompanionFace, store?: import("@deepseek-ai/dsh-client-store").SnapshotStore<ReaderSnapshot>): ReaderFace;
|
|
33
39
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ActionModel } from '../actions.ts';
|
|
1
2
|
import type { TopicScenario } from '../topic.ts';
|
|
2
3
|
import type { CiteSelection } from './types.ts';
|
|
3
4
|
export type CreateMode = 'observer' | 'exact-fork' | 'exact-when-available';
|
|
@@ -12,7 +13,7 @@ export interface RequestIntent {
|
|
|
12
13
|
* @param mode - resolved Topic creation mode.
|
|
13
14
|
* @returns the pending intent key and request ID.
|
|
14
15
|
*/
|
|
15
|
-
export declare function claimCreateTopicIntent(selection: CiteSelection, question: string, mode: CreateMode, scenario?: TopicScenario): Promise<RequestIntent>;
|
|
16
|
+
export declare function claimCreateTopicIntent(selection: CiteSelection, question: string, mode: CreateMode, scenario?: TopicScenario, modelRoute?: ActionModel): Promise<RequestIntent>;
|
|
16
17
|
/**
|
|
17
18
|
* Claim the retry-stable request ID for one uncited Topic creation.
|
|
18
19
|
* @param sourceSessionId - owning DSH Session.
|
|
@@ -34,7 +35,7 @@ export interface DocumentClaimIntent {
|
|
|
34
35
|
* @param question - normalized first question.
|
|
35
36
|
* @returns the pending intent key and request ID.
|
|
36
37
|
*/
|
|
37
|
-
export declare function claimCreateDocumentIntent(claim: DocumentClaimIntent, question: string): Promise<RequestIntent>;
|
|
38
|
+
export declare function claimCreateDocumentIntent(claim: DocumentClaimIntent, question: string, sourceSessionId?: string, modelRoute?: ActionModel): Promise<RequestIntent>;
|
|
38
39
|
/**
|
|
39
40
|
* Claim the retry-stable request ID for one pending Topic follow-up.
|
|
40
41
|
* @param topicSessionId - target private Topic Session.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store';
|
|
3
|
+
import type { DeliveryMode } from './native-composer.ts';
|
|
4
|
+
/** Read the conversation-owned busy-Enter preference through the public settings mirror. The bound scope is disposed with ctx; this adapter never writes Host settings. */
|
|
5
|
+
export declare function bindSubmissionPreference(ctx: Context): ObservableSnapshot<DeliveryMode>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type UIEvent } from 'react';
|
|
2
|
+
/** Keep each Topic's reading position across portal moves, view changes and close/reopen. Follow new output only while the reader is near the end. */
|
|
3
|
+
export declare function useTranscriptPosition(topicId: string, revision: unknown): {
|
|
4
|
+
ref: (node: HTMLDivElement | null) => void;
|
|
5
|
+
onScroll: (event: UIEvent<HTMLDivElement>) => void;
|
|
6
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { SessionId } from '@deepseek-ai/dsh-
|
|
1
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
2
2
|
import type { ToolEvidenceProjection } from '../evidence-text.ts';
|
|
3
|
+
import type { PanelPresentation } from '../actions.ts';
|
|
3
4
|
/** One right-click selection inside a rendered assistant model call. */
|
|
4
5
|
export interface AssistantCiteSelection {
|
|
5
6
|
readonly entryId: 'citeciter.entry.assistant';
|
|
@@ -36,11 +37,11 @@ export interface BoardCitationRequest {
|
|
|
36
37
|
readonly prompt: string;
|
|
37
38
|
}
|
|
38
39
|
export interface CiteOverlaySnapshot {
|
|
39
|
-
readonly menuSelection: CiteSelection | null;
|
|
40
40
|
readonly panelOpen: boolean;
|
|
41
|
+
readonly presentation: PanelPresentation;
|
|
41
42
|
readonly boardCitation: BoardCitationRequest | null;
|
|
42
43
|
}
|
|
43
|
-
/**
|
|
44
|
+
/** Observable panel presentation and board-citation requests; gestures have their own controller. */
|
|
44
45
|
export declare class CiteBus {
|
|
45
46
|
private readonly reportListenerError;
|
|
46
47
|
private snapshot;
|
|
@@ -52,10 +53,10 @@ export declare class CiteBus {
|
|
|
52
53
|
getSnapshot: () => CiteOverlaySnapshot;
|
|
53
54
|
/** @param listener - observer. @returns disposer. */
|
|
54
55
|
subscribe: (listener: () => void) => (() => void);
|
|
55
|
-
/** Show or dismiss the selection question popover. */
|
|
56
|
-
setMenuSelection(selection: CiteSelection | null): void;
|
|
57
56
|
/** Open or close the independent companion dock. */
|
|
58
57
|
setPanelOpen(panelOpen: boolean): void;
|
|
58
|
+
/** Change only the current workspace presentation, keeping its Topic and drafts. */
|
|
59
|
+
setPresentation(presentation: PanelPresentation): void;
|
|
59
60
|
/**
|
|
60
61
|
* Queue one user-requested board reference for the matching Topic composer.
|
|
61
62
|
* @param topicSessionId - Topic that owns the referenced board.
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
2
|
+
import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
2
3
|
import type { CiteCiterSettings } from '../topic.ts';
|
|
3
4
|
type UpdateStorage = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;
|
|
4
5
|
/** One newer package version returned by the validated Host check. */
|
|
5
6
|
export interface AvailableUpdate {
|
|
6
7
|
readonly currentVersion: string;
|
|
7
8
|
readonly latestVersion: string;
|
|
9
|
+
readonly profile?: string;
|
|
8
10
|
}
|
|
9
11
|
/** Observable state shared by the update card and settings page. */
|
|
10
12
|
export interface UpdateNoticeSnapshot {
|
|
@@ -52,6 +54,6 @@ export declare function createUpdateBrowserEnvironment(): UpdateBrowserEnvironme
|
|
|
52
54
|
* @returns the root-scoped update controller.
|
|
53
55
|
*/
|
|
54
56
|
export declare function createUpdateController(settings: SettingsScope<CiteCiterSettings>, checkUpdate: CheckUpdate, store: SnapshotStore<UpdateNoticeSnapshot>, environment?: UpdateBrowserEnvironment, reportCheckError?: (error: unknown) => void): UpdateController;
|
|
55
|
-
/** @param version - validated latest package version. @returns the command shown and copied by the
|
|
56
|
-
export declare function citeCiterUpdateCommand(version: string): string;
|
|
57
|
+
/** @param version - validated latest package version. @param profile - active Desktop profile, or Web default. @returns the command shown and copied by the notice. */
|
|
58
|
+
export declare function citeCiterUpdateCommand(version: string, profile?: string): string;
|
|
57
59
|
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Plain UI callbacks; subscriptions and disposal remain with the Client plugin. */
|
|
2
|
+
import type { CompanionFace } from './companion-controller.ts';
|
|
3
|
+
import type { ReaderFace } from './reader-controller.ts';
|
|
4
|
+
import type { SettingsDocumentController } from './settings-document.ts';
|
|
5
|
+
import type { CiteBus } from './types.ts';
|
|
6
|
+
import type { UpdateController } from './update-controller.ts';
|
|
7
|
+
/** Callbacks the Topic view may invoke. */
|
|
8
|
+
export type CompanionActions = Omit<CompanionFace, 'getSnapshot' | 'subscribe' | 'dispose'>;
|
|
9
|
+
/** Callbacks the document view may invoke. */
|
|
10
|
+
export type ReaderActions = Omit<ReaderFace, 'getSnapshot' | 'subscribe' | 'dispose'>;
|
|
11
|
+
/** Callbacks the settings view may invoke. */
|
|
12
|
+
export type SettingsDocumentActions = Omit<SettingsDocumentController, 'getSnapshot' | 'subscribe' | 'dispose'>;
|
|
13
|
+
/** Callbacks the update view may invoke. */
|
|
14
|
+
export type UpdateActions = Omit<UpdateController, 'getSnapshot' | 'subscribe' | 'dispose'>;
|
|
15
|
+
/** Overlay events used by rendered components. */
|
|
16
|
+
export type OverlayActions = Pick<CiteBus, 'setPanelOpen' | 'setPresentation' | 'requestBoardCitation' | 'clearBoardCitation'>;
|
|
17
|
+
/**
|
|
18
|
+
* Remove lifecycle and subscription methods from a plain controller's view props.
|
|
19
|
+
* @param controller - Client-owned controller with arrow-function callbacks.
|
|
20
|
+
* @returns callbacks separate from the observable supplied to inject.hooks.
|
|
21
|
+
*/
|
|
22
|
+
export declare function viewActions<T extends {
|
|
23
|
+
getSnapshot(): unknown;
|
|
24
|
+
subscribe(listener: () => void): () => void;
|
|
25
|
+
dispose(): Promise<void>;
|
|
26
|
+
}>(controller: T): Omit<T, 'getSnapshot' | 'subscribe' | 'dispose'>;
|