@kirkchinese/dsh-citeciter 0.9.0-beta.3 → 0.9.0-beta.4
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 +14 -10
- package/README.zh.md +14 -10
- package/assets/citeciter-mascot.png +0 -0
- package/assets/locale/en.json +6 -0
- package/assets/locale/zh.json +6 -0
- package/lib/client.js +4103 -1318
- package/lib/index.js +276 -60
- package/lib/{typert-common-B3cX-hWj.js → typert-common-BtQUArWP.js} +1 -1
- package/lib/typert.host.js +2 -2
- package/lib/typert.remote-client.js +1 -1
- package/lib/types/actions.d.ts +8 -0
- package/lib/types/client/action-controller.d.ts +14 -1
- package/lib/types/client/action-executor.d.ts +3 -1
- package/lib/types/client/board-citation.d.ts +2 -0
- package/lib/types/client/board-timeline.d.ts +4 -1
- package/lib/types/client/companion-controller.d.ts +1 -1
- package/lib/types/client/components/BoardView.d.ts +3 -1
- package/lib/types/client/components/CiteCiterSettings.d.ts +13 -2
- package/lib/types/client/components/CitePanel.d.ts +14 -1
- package/lib/types/client/components/CiterTab.d.ts +15 -0
- package/lib/types/client/components/ContextRow.d.ts +7 -0
- package/lib/types/client/components/SelectionToolbar.d.ts +2 -0
- package/lib/types/client/components/ToolMessage.d.ts +10 -5
- package/lib/types/client/components/TopicActions.d.ts +4 -1
- package/lib/types/client/components/TopicHeader.d.ts +4 -3
- package/lib/types/client/components/TopicUsage.d.ts +5 -0
- package/lib/types/client/components/UserMessageBody.d.ts +7 -2
- package/lib/types/client/conversation-dom.d.ts +2 -0
- package/lib/types/client/copy.d.ts +16 -4
- package/lib/types/client/draft-references.d.ts +3 -1
- package/lib/types/client/entries.d.ts +3 -0
- package/lib/types/client/i18n.d.ts +23 -0
- package/lib/types/client/locales/board.d.ts +51 -0
- package/lib/types/client/locales/common.d.ts +7 -0
- package/lib/types/client/locales/index.d.ts +564 -0
- package/lib/types/client/locales/panel.d.ts +215 -0
- package/lib/types/client/locales/settings.d.ts +179 -0
- package/lib/types/client/locales/transcript.d.ts +127 -0
- package/lib/types/client/main-quote.d.ts +16 -0
- package/lib/types/client/native-file-link.d.ts +10 -0
- package/lib/types/client/request-guard.d.ts +2 -1
- package/lib/types/client/rich-content.d.ts +7 -0
- package/lib/types/client/selection-references.d.ts +1 -1
- package/lib/types/client/tool-cards.d.ts +84 -0
- package/lib/types/client/tool-presentation.d.ts +1 -4
- package/lib/types/client/topic-presentation.d.ts +8 -3
- package/lib/types/client/types.d.ts +12 -0
- package/lib/types/client/view-actions.d.ts +1 -1
- package/lib/types/evidence-text.d.ts +8 -0
- package/lib/types/message-projection.d.ts +25 -8
- package/lib/types/model-admission.d.ts +1 -1
- package/lib/types/owned-session-cleanup.d.ts +7 -1
- package/lib/types/source-read-tool.d.ts +1 -1
- package/lib/types/source-session.d.ts +8 -2
- package/lib/types/tool-events.d.ts +2 -0
- package/lib/types/topic-context.d.ts +9 -3
- package/lib/types/topic-log.d.ts +3 -1
- package/lib/types/topic-prompts.d.ts +4 -0
- package/lib/types/topic-runtime.d.ts +2 -2
- package/lib/types/topic.d.ts +75 -1
- package/lib/types/typert-common.d.ts +24 -0
- package/lib/types/typert.host.d.ts +72 -0
- package/lib/{update-CGteMuNJ.js → update-D-jnLTb5.js} +30 -1
- package/package.json +65 -58
- package/lib/types/client/board-capture-target.d.ts +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as citeCiterRequestSchema, f as citeCiterResponseSchema, r as updateCheckResponseSchema } from "./update-
|
|
1
|
+
import { d as citeCiterRequestSchema, f as citeCiterResponseSchema, r as updateCheckResponseSchema } from "./update-D-jnLTb5.js";
|
|
2
2
|
//#region lib/types/typert-codec.js
|
|
3
3
|
/** Official Typert lazily resolves schemas after module registration. */
|
|
4
4
|
function strictCodec(typeSymbol, schema) {
|
package/lib/typert.host.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as topicSummarySchema, c as citationDraftSchema, d as citeCiterRequestSchema, f as citeCiterResponseSchema, l as citationRecordSchema, r as updateCheckResponseSchema, x as topicSnapshotSchema } from "./update-
|
|
2
|
-
import { n as updateCheckDescriptor, r as namedSchema, t as citeCiterRequestDescriptor } from "./typert-common-
|
|
1
|
+
import { S as topicSummarySchema, c as citationDraftSchema, d as citeCiterRequestSchema, f as citeCiterResponseSchema, l as citationRecordSchema, r as updateCheckResponseSchema, x as topicSnapshotSchema } from "./update-D-jnLTb5.js";
|
|
2
|
+
import { n as updateCheckDescriptor, r as namedSchema, t as citeCiterRequestDescriptor } from "./typert-common-BtQUArWP.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-BtQUArWP.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 = {
|
package/lib/types/actions.d.ts
CHANGED
|
@@ -54,6 +54,14 @@ export declare const actionModelSchema: z.ZodObject<{
|
|
|
54
54
|
export type ActionModel = z.infer<typeof actionModelSchema>;
|
|
55
55
|
/** Toolbar order, and clockwise from twelve o'clock on the wheel. Empty slots retain their positions. */
|
|
56
56
|
export declare const DEFAULT_WHEEL_SLOTS: readonly (CiteAction | null)[];
|
|
57
|
+
/** English built-in actions, used only when the active UI language is not Chinese. */
|
|
58
|
+
export declare const ENGLISH_WHEEL_SLOTS: readonly (CiteAction | null)[];
|
|
59
|
+
/**
|
|
60
|
+
* Resolve the actions for the current UI language without changing persisted settings. Saving
|
|
61
|
+
* actions stores the whole list, so each slot is judged on its own: a built-in action the user
|
|
62
|
+
* left unchanged (even if moved) follows the language; an edited or added action stays as written.
|
|
63
|
+
*/
|
|
64
|
+
export declare function localizedWheelSlots(slots: readonly (CiteAction | null)[] | undefined, chinese: boolean): readonly (CiteAction | null)[];
|
|
57
65
|
/**
|
|
58
66
|
* Decide how a chosen action is delivered.
|
|
59
67
|
* @param action - the chosen slot.
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
2
2
|
import { type ActionModel, type CiteAction } from '../actions.ts';
|
|
3
3
|
import type { CiteSelection } from './types.ts';
|
|
4
|
-
/** Immutable capture from a conversation, imported document
|
|
4
|
+
/** Immutable capture from a conversation, imported document, native file preview or a Topic's own transcript. */
|
|
5
5
|
export type ActionSource = {
|
|
6
6
|
readonly kind: 'conversation';
|
|
7
7
|
readonly selection: CiteSelection;
|
|
8
|
+
readonly quoteText?: string;
|
|
9
|
+
} | {
|
|
10
|
+
/** An ordinary user message: excerpt only, not a host-verified citation claim. */
|
|
11
|
+
readonly kind: 'quote';
|
|
12
|
+
readonly sourceSessionId: SessionId;
|
|
13
|
+
readonly anchorKey: string;
|
|
14
|
+
readonly displayText: string;
|
|
8
15
|
} | {
|
|
9
16
|
readonly kind: 'document';
|
|
10
17
|
readonly sourceSessionId: SessionId;
|
|
@@ -14,6 +21,12 @@ export type ActionSource = {
|
|
|
14
21
|
readonly title: string;
|
|
15
22
|
readonly documentId?: string;
|
|
16
23
|
readonly content?: string;
|
|
24
|
+
} | {
|
|
25
|
+
/** Text selected in a Topic's own answers or tool output; actions continue that Topic. */
|
|
26
|
+
readonly kind: 'topic';
|
|
27
|
+
readonly sourceSessionId: SessionId;
|
|
28
|
+
readonly topicSessionId: string;
|
|
29
|
+
readonly displayText: string;
|
|
17
30
|
};
|
|
18
31
|
export declare const actionSourceSession: (source: ActionSource) => SessionId;
|
|
19
32
|
export declare const actionSourceQuote: (source: ActionSource) => string;
|
|
@@ -7,4 +7,6 @@ export interface ActionRunOptions {
|
|
|
7
7
|
readonly newTopic?: boolean;
|
|
8
8
|
}
|
|
9
9
|
/** Bind explicit Topic and document services. No UI, global listeners or Cordis discovery. */
|
|
10
|
-
export declare function createActionExecutor(companion: CompanionFace, reader: ReaderFace, open: (presentation: PanelPresentation) => void): (source: ActionSource, action: CiteAction, question: string, modelRoute?: ActionModel, options?: ActionRunOptions) => Promise<void
|
|
10
|
+
export declare function createActionExecutor(companion: CompanionFace, reader: ReaderFace, open: (presentation: PanelPresentation) => void): ((source: ActionSource, action: CiteAction, question: string, modelRoute?: ActionModel, options?: ActionRunOptions) => Promise<void>) & {
|
|
11
|
+
quote: (source: ActionSource) => Promise<void>;
|
|
12
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { BoardElementState } from '../board.ts';
|
|
2
|
+
/** Decode common and numeric HTML entities in board labels without requiring a DOM. */
|
|
3
|
+
export declare function decodeBoardCitationEntities(text: string): string;
|
|
2
4
|
/**
|
|
3
5
|
* Quote the selected board element without exposing its raw SVG/HTML or image bytes.
|
|
4
6
|
* @param element - the actual selected element from the current Topic board.
|
|
@@ -10,10 +10,13 @@ export declare function frameStyle(frame: ElementFrame, size: {
|
|
|
10
10
|
readonly w: number;
|
|
11
11
|
readonly h: number;
|
|
12
12
|
}): CSSProperties;
|
|
13
|
+
/** Whether timeline playback is permitted by both the board setting and system preference. */
|
|
14
|
+
export declare function timelineMotionAllowed(animations: boolean, reducedMotion: boolean): boolean;
|
|
13
15
|
/** Playback state of one board timeline. */
|
|
14
16
|
export interface TimelinePlayer {
|
|
15
17
|
readonly t: number;
|
|
16
18
|
readonly playing: boolean;
|
|
19
|
+
readonly canPlay: boolean;
|
|
17
20
|
readonly toggle: () => void;
|
|
18
21
|
readonly seek: (atMs: number) => void;
|
|
19
22
|
}
|
|
@@ -22,7 +25,7 @@ export interface TimelinePlayer {
|
|
|
22
25
|
* allowed; otherwise it rests on its final frame. A frozen time (frame capture) never plays.
|
|
23
26
|
* @param timeline - compiled timeline, or null.
|
|
24
27
|
* @param key - identity of the timeline; a new key restarts playback.
|
|
25
|
-
* @param options -
|
|
28
|
+
* @param options - animation permission and an optional frozen capture time.
|
|
26
29
|
*/
|
|
27
30
|
export declare function useTimelinePlayer(timeline: CompiledTimeline | null, key: string | null, options: {
|
|
28
31
|
readonly autoplay: boolean;
|
|
@@ -7,7 +7,7 @@ import type { ChatSnapshot } from '@deepseek-ai/dsh-client-ui-chat/client';
|
|
|
7
7
|
import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol';
|
|
8
8
|
import { type CiteCiterRequest, type CiteCiterResponse, type CiteCiterSettings, type ProviderOption, type QuestionAnswer, type TopicSnapshot, type TopicSummary } from '../topic.ts';
|
|
9
9
|
import { type DocumentClaimIntent } from './request-guard.ts';
|
|
10
|
-
import {
|
|
10
|
+
import type { ActionDelivery, ActionModel } from '../actions.ts';
|
|
11
11
|
import type { CiteSelection } from './types.ts';
|
|
12
12
|
import { type DraftReference } from './draft-references.ts';
|
|
13
13
|
export type CompanionPhase = 'idle' | 'creating' | 'ready' | 'running' | 'stopping' | 'stopped' | 'error';
|
|
@@ -5,7 +5,7 @@ import { type BoardElementState, type BoardSnapshot } from '../../board.ts';
|
|
|
5
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, compact, sessionId, frameAtMs, }: {
|
|
8
|
+
export declare function BoardView({ snapshot, animations, onQuoteElement, compact, sessionId, frameAtMs, capture, }: {
|
|
9
9
|
readonly snapshot: BoardSnapshot | undefined;
|
|
10
10
|
readonly animations: boolean;
|
|
11
11
|
readonly onQuoteElement?: (element: BoardElementState) => void;
|
|
@@ -13,4 +13,6 @@ export declare function BoardView({ snapshot, animations, onQuoteElement, compac
|
|
|
13
13
|
readonly sessionId?: string;
|
|
14
14
|
/** Freeze the board's timeline at this time, for frame capture. */
|
|
15
15
|
readonly frameAtMs?: number;
|
|
16
|
+
/** Render only the logical canvas inside an offscreen capture surface. */
|
|
17
|
+
readonly capture?: boolean;
|
|
16
18
|
}): import("react").JSX.Element;
|
|
@@ -4,13 +4,24 @@ import type { SettingsDocumentSnapshot } from '../settings-document.ts';
|
|
|
4
4
|
import type { CompanionSnapshot } from '../companion-controller.ts';
|
|
5
5
|
import type { CompanionActions, UpdateActions, SettingsDocumentActions } from '../view-actions.ts';
|
|
6
6
|
import type { SettingsSectionOwnerProps } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
7
|
-
|
|
7
|
+
import type { CiteOverlaySnapshot } from '../types.ts';
|
|
8
|
+
/** What the settings page needs; the host's settings and plugin pages each add their own owner props. */
|
|
9
|
+
export interface CiteCiterSettingsProps extends Partial<SettingsSectionOwnerProps> {
|
|
8
10
|
readonly useCompanion: SnapshotSelectorHook<CompanionSnapshot>;
|
|
9
11
|
readonly useDocument: SnapshotSelectorHook<SettingsDocumentSnapshot>;
|
|
10
12
|
readonly useUpdate: SnapshotSelectorHook<UpdateNoticeSnapshot>;
|
|
11
13
|
readonly companion: CompanionActions;
|
|
12
14
|
readonly settingsDocument: SettingsDocumentActions;
|
|
13
15
|
readonly updateController: UpdateActions;
|
|
16
|
+
/** Where the workspace lives; the width setting applies only to Citer's own overlay. */
|
|
17
|
+
readonly useOverlay?: SnapshotSelectorHook<CiteOverlaySnapshot> | undefined;
|
|
14
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Citer's entry on DSH's plugin page: a one-line summary in the list, the full settings on its page.
|
|
21
|
+
* @param view - `summary` for the bundle row, `page` for the bundle's own page.
|
|
22
|
+
*/
|
|
23
|
+
export declare function CiterPluginConfig(props: CiteCiterSettingsProps & {
|
|
24
|
+
readonly view: 'summary' | 'page';
|
|
25
|
+
}): import("react").JSX.Element;
|
|
15
26
|
/** Native DSH settings page for Citer preferences. */
|
|
16
|
-
export declare function CiteCiterSettings({ useCompanion, useDocument, useUpdate, companion, settingsDocument, updateController }: CiteCiterSettingsProps): import("react").JSX.Element;
|
|
27
|
+
export declare function CiteCiterSettings({ useCompanion, useDocument, useUpdate, useOverlay, companion, settingsDocument, updateController }: CiteCiterSettingsProps): import("react").JSX.Element;
|
|
@@ -4,6 +4,8 @@ import type { InteractionSnapshot } from '../host-ui-adapter.ts';
|
|
|
4
4
|
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
|
|
5
5
|
import type { UseSessions } from '@deepseek-ai/dsh-client-ui-session/client';
|
|
6
6
|
import type { CiteOverlaySnapshot } from '../types.ts';
|
|
7
|
+
import type { SelectionSurfaces } from '../wheel-gesture.ts';
|
|
8
|
+
import type { FileOpener } from '../native-file-link.ts';
|
|
7
9
|
import type { CompanionSnapshot } from '../companion-controller.ts';
|
|
8
10
|
import type { CompanionActions, OverlayActions } from '../view-actions.ts';
|
|
9
11
|
export interface CitePanelProps {
|
|
@@ -21,10 +23,21 @@ export interface CitePanelProps {
|
|
|
21
23
|
readonly reportParseError: (messageId: string) => void;
|
|
22
24
|
/** Host standard prop: the session list, used to show source titles on reference chips. */
|
|
23
25
|
readonly useSessions?: UseSessions;
|
|
26
|
+
/** Makes text selected in the transcript a Citer action source that continues this Topic. */
|
|
27
|
+
readonly registerSurface?: SelectionSurfaces['register'];
|
|
28
|
+
/** Opens a source-workspace file in DSH's right sidebar. */
|
|
29
|
+
readonly openFile?: FileOpener;
|
|
30
|
+
/**
|
|
31
|
+
* `tab` renders inside a DSH right-sidebar tab, which owns placement, size, splitting,
|
|
32
|
+
* floating and closing; `overlay` is Citer's own dock for hosts without that sidebar.
|
|
33
|
+
*/
|
|
34
|
+
readonly host?: 'overlay' | 'tab';
|
|
35
|
+
/** In a sidebar tab: whether the tab is on screen. */
|
|
36
|
+
readonly tabVisible?: boolean;
|
|
24
37
|
}
|
|
25
38
|
/**
|
|
26
39
|
* Render the independent Topic workspace on the right edge of the shell.
|
|
27
40
|
* @param props - shared panel bus, Topic controller, and host callbacks.
|
|
28
41
|
* @returns the responsive Topic dock and its dialogs, or null while closed.
|
|
29
42
|
*/
|
|
30
|
-
export declare function CitePanel({ nativeComposer, drafts, useDrafts, useCompanion, useOverlay, useInteractions, useSubmission, useSessions, bus, companion, closePanel, openReader, reportParseError }: CitePanelProps): import("react").JSX.Element | null;
|
|
43
|
+
export declare function CitePanel({ nativeComposer, drafts, useDrafts, useCompanion, useOverlay, useInteractions, useSubmission, useSessions, bus, companion, closePanel, openReader, reportParseError, registerSurface, openFile, host, tabVisible }: CitePanelProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { UseSidebarRightTabInfo } from '@deepseek-ai/dsh-client-ui-sidebar-right/client';
|
|
2
|
+
import { type CitePanelProps } from './CitePanel.tsx';
|
|
3
|
+
/**
|
|
4
|
+
* Citer's workspace as a DSH right-sidebar tab. The sidebar owns placement, splitting, floating,
|
|
5
|
+
* fullscreen and closing; while the tab is on screen Citer counts as open, so the desktop pet
|
|
6
|
+
* steps aside and finished answers are not marked unread.
|
|
7
|
+
*/
|
|
8
|
+
export declare function CiterTab(props: CitePanelProps & {
|
|
9
|
+
readonly useTabInfo: UseSidebarRightTabInfo;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
/** The mascot as the guide card and tab icon, at the size DSH draws icons. */
|
|
12
|
+
export declare function CiterIcon({ size, className }: {
|
|
13
|
+
readonly size?: number | undefined;
|
|
14
|
+
readonly className?: string | undefined;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TopicMessage } from '../../topic.ts';
|
|
2
|
+
/** One logged context row; only known Host presentation copy is localized, never its model-visible body. */
|
|
3
|
+
export declare function ContextRow({ message }: {
|
|
4
|
+
readonly message: Extract<TopicMessage, {
|
|
5
|
+
role: 'context';
|
|
6
|
+
}>;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -3,10 +3,12 @@ import { type CiteAction } from '../../actions.ts';
|
|
|
3
3
|
import type { ActionSource } from '../action-controller.ts';
|
|
4
4
|
import type { CompanionSnapshot } from '../companion-controller.ts';
|
|
5
5
|
import type { SelectionToolbarSnapshot } from '../selection-toolbar.ts';
|
|
6
|
+
/** The explicit way to start a separate Topic: the user's own question about the selection. */
|
|
6
7
|
/** Toolbar callbacks; the controllers stay with the Client plugin. */
|
|
7
8
|
export interface SelectionToolbarActions {
|
|
8
9
|
readonly dismiss: () => void;
|
|
9
10
|
readonly run: (source: ActionSource, action: CiteAction, x: number, y: number, newTopic?: boolean) => void;
|
|
11
|
+
readonly quote: (source: ActionSource) => Promise<void>;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* Actions for the current selection: the first configured actions inline, the rest and
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { TopicMessage } from '../../topic.ts';
|
|
2
2
|
import type { NativeComposer } from '../native-composer.ts';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
type ToolMessage = Extract<TopicMessage, {
|
|
4
|
+
role: 'tool';
|
|
5
|
+
}>;
|
|
6
|
+
/** Keep a tool tree inside the parent's disclosure; absent metadata uses the original lossless inspector. */
|
|
7
|
+
export declare function ToolRow({ message, childCalls, sessionId, load, openFile }: {
|
|
8
|
+
readonly message: ToolMessage;
|
|
9
|
+
readonly childCalls: readonly ToolMessage[];
|
|
8
10
|
readonly sessionId: string;
|
|
9
11
|
readonly load: NativeComposer['attachment'];
|
|
12
|
+
/** Open a source-workspace file in DSH's right sidebar; absent when the host has none. */
|
|
13
|
+
readonly openFile?: ((path: string, line?: number) => boolean) | undefined;
|
|
10
14
|
}): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -5,13 +5,16 @@ export interface TopicMenu {
|
|
|
5
5
|
} | undefined;
|
|
6
6
|
readonly busy: boolean;
|
|
7
7
|
readonly learningRoute: boolean;
|
|
8
|
+
/** Whether ordinary context (runtime, time, skills, system prompt) is listed in the transcript. */
|
|
9
|
+
readonly allContext: boolean;
|
|
10
|
+
readonly onAllContext: (shown: boolean) => void;
|
|
8
11
|
readonly onRename: () => void;
|
|
9
12
|
readonly onLearningRoute: (enabled: boolean) => void;
|
|
10
13
|
readonly onReader: () => void;
|
|
11
14
|
readonly onArchive: (archived: boolean) => void;
|
|
12
15
|
readonly onDelete: () => void;
|
|
13
16
|
}
|
|
14
|
-
/** The "⋯" menu in the host's menu: rename, learning route, document reader, archive and permanent deletion. */
|
|
17
|
+
/** The "⋯" menu in the host's menu: rename, learning route, document reader, context visibility, archive and permanent deletion. */
|
|
15
18
|
export declare function TopicActions({ menu }: {
|
|
16
19
|
readonly menu: TopicMenu;
|
|
17
20
|
}): import("react").JSX.Element;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { PointerEventHandler, ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Layout-only header. The Citer mark identifies the panel; dragging the header floats it.
|
|
4
|
-
* Navigation, title and closing are supplied by their own controllers.
|
|
4
|
+
* Navigation, title and closing are supplied by their own controllers. In DSH's right sidebar
|
|
5
|
+
* the tab chip owns closing and moving, so `onClose` and `onDrag` are omitted there.
|
|
5
6
|
* @param status - shown only while something is happening or needs attention.
|
|
6
7
|
*/
|
|
7
8
|
export declare function TopicHeader({ compact, onBack, onClose, onDrag, title, status, children }: {
|
|
8
9
|
readonly compact: boolean;
|
|
9
10
|
readonly onBack: () => void;
|
|
10
|
-
readonly onClose
|
|
11
|
-
readonly onDrag
|
|
11
|
+
readonly onClose?: (() => void) | undefined;
|
|
12
|
+
readonly onDrag?: PointerEventHandler<HTMLElement> | undefined;
|
|
12
13
|
readonly title: ReactNode;
|
|
13
14
|
readonly status: string | null;
|
|
14
15
|
readonly children: ReactNode;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TopicUsage as TopicUsageValue } from '../../topic.ts';
|
|
2
|
+
/** Present Topic-owned token totals without fetching state or mutating the panel. */
|
|
3
|
+
export declare function TopicUsage({ usage }: {
|
|
4
|
+
readonly usage?: TopicUsageValue;
|
|
5
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { QuestionReply } from '../../question-reply.ts';
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Read-only presentation of a committed user message. Attachments remain inspectable as reference
|
|
4
|
+
* chips and formulas are rendered without mutating the durable prompt. A learning-stage prompt
|
|
5
|
+
* collapses to its stage line and the user's own question.
|
|
6
|
+
*/
|
|
7
|
+
export declare function UserMessageBody({ text, questionReply, sourceTitle, stageClassName }: {
|
|
4
8
|
readonly text: string;
|
|
5
9
|
readonly questionReply?: QuestionReply | undefined;
|
|
6
10
|
readonly sourceTitle?: ((sessionId: string) => string | undefined) | undefined;
|
|
11
|
+
readonly stageClassName?: string | undefined;
|
|
7
12
|
}): import("react").JSX.Element;
|
|
@@ -10,6 +10,8 @@ export interface DshAssistantAnchor {
|
|
|
10
10
|
readonly element: HTMLElement;
|
|
11
11
|
readonly anchorKey: string;
|
|
12
12
|
}
|
|
13
|
+
/** A committed ordinary user message in the native DSH chat. */
|
|
14
|
+
export declare function dshUserAnchorForTarget(target: EventTarget | null): DshAssistantAnchor | null;
|
|
13
15
|
/** Best-effort Read Frog selection classification. */
|
|
14
16
|
export type ReadFrogSelection = {
|
|
15
17
|
readonly kind: 'none';
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
import type { JsonTreeLabels, MarkdownLabels } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
-
/**
|
|
1
|
+
/** Presentation copy for shared UI primitives. */
|
|
2
|
+
import type { CodeToolbarLabels, DiffBlockLabels, JsonTreeLabels, MarkdownLabels, ReadBlockLabels, SearchBlockLabels, TerminalBlockLabels } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
+
/** Live getters keep consumers outside the transcript slice localized without changing their API. */
|
|
4
4
|
export declare const markdownLabels: MarkdownLabels;
|
|
5
5
|
/** Localized labels supplied to the Cordis-free JSON inspector. */
|
|
6
|
-
export declare
|
|
6
|
+
export declare function jsonTreeLabels(): JsonTreeLabels;
|
|
7
|
+
/** Shared toolbar copy for read and diff code surfaces. */
|
|
8
|
+
export declare function codeToolbarLabels(): CodeToolbarLabels;
|
|
9
|
+
/** DSH-style labels for numbered file reads. */
|
|
10
|
+
export declare function readBlockLabels(): ReadBlockLabels;
|
|
11
|
+
/** DSH-style labels for applied file differences. */
|
|
12
|
+
export declare function diffBlockLabels(): DiffBlockLabels;
|
|
13
|
+
/** Terminal status and output controls. */
|
|
14
|
+
export declare function terminalBlockLabels(): TerminalBlockLabels & {
|
|
15
|
+
commandLine: (line: number) => string;
|
|
16
|
+
};
|
|
17
|
+
/** Result-count labels for grouped grep matches and glob paths. */
|
|
18
|
+
export declare function searchBlockLabels(): SearchBlockLabels;
|
|
@@ -6,7 +6,9 @@ export type DraftReference = DraftContent['references'][number];
|
|
|
6
6
|
export declare function mergeDraftReferences(current: readonly DraftReference[], incoming: readonly DraftReference[]): readonly DraftReference[];
|
|
7
7
|
/** Build initial references without submitting them. Stable Topic-scoped IDs preserve menu focus during live snapshot refreshes. */
|
|
8
8
|
export declare function topicDraftReferences(topic: TopicSummary, documentTitle?: string): readonly DraftReference[];
|
|
9
|
-
/**
|
|
9
|
+
/** Translate only the visible chip kind; reference.label remains the serialized Chinese marker. */
|
|
10
|
+
export declare function draftReferenceLabel(reference: DraftReference): string;
|
|
11
|
+
/** Display a document filename while retaining the full title/path in its serialized content. */
|
|
10
12
|
export declare function draftReferenceName(reference: DraftReference): string;
|
|
11
13
|
/**
|
|
12
14
|
* Chip text that shows what a reference contains instead of its kind. Serialized labels
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
8
8
|
import type { ChatSnapshot } from '@deepseek-ai/dsh-client-ui-chat/client';
|
|
9
|
+
import type { ActionSource } from './action-controller.ts';
|
|
9
10
|
import type { CiteSelection } from './types.ts';
|
|
10
11
|
/** Live browser facts an entry needs to resolve one selection. */
|
|
11
12
|
export interface CiteCiterEntryContext {
|
|
@@ -51,6 +52,8 @@ export declare function createCiteCiterEntryRegistry(): CiteCiterEntryRegistry;
|
|
|
51
52
|
* @returns the entry contribution; register it on the shared registry.
|
|
52
53
|
*/
|
|
53
54
|
export declare function createAssistantEntry(): CiteCiterEntry;
|
|
55
|
+
/** Capture a committed user-message excerpt without inventing a host-verified citation claim. */
|
|
56
|
+
export declare function readUserMessageQuote(event: MouseEvent, context: CiteCiterEntryContext): ActionSource | null;
|
|
54
57
|
/**
|
|
55
58
|
* Built-in tool evidence entry: claims a whole-card tool result from its
|
|
56
59
|
* `call:<callId>` row and the enclosing `tool-call` chat flow. Terminal and
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { type CiterKey } from './locales/index.ts';
|
|
3
|
+
export type { CiterKey } from './locales/index.ts';
|
|
4
|
+
/** DSH locale namespace that holds Citer's dictionaries. */
|
|
5
|
+
export declare const CITER_LOCALE_NAMESPACE = "citeciter";
|
|
6
|
+
/** Fill `{name}` placeholders, as DSH's own dictionaries do. */
|
|
7
|
+
export declare function formatText(template: string, params?: Record<string, unknown>): string;
|
|
8
|
+
/**
|
|
9
|
+
* Translate one Citer key in the active DSH language.
|
|
10
|
+
* @param key - dictionary key.
|
|
11
|
+
* @param params - `{name}` placeholder values.
|
|
12
|
+
*/
|
|
13
|
+
export declare function t(key: CiterKey, params?: Record<string, unknown>): string;
|
|
14
|
+
/** Whether DSH currently shows Chinese; picks localized defaults such as preset action prompts. */
|
|
15
|
+
export declare function isChinese(): boolean;
|
|
16
|
+
/** Re-render on DSH language changes; returns a revision usable as a memo dependency. */
|
|
17
|
+
export declare function useLocale(): number;
|
|
18
|
+
/**
|
|
19
|
+
* Register Citer's dictionaries and follow the active language for the lifetime of `ctx`.
|
|
20
|
+
* Without DSH's locale service, text stays Chinese.
|
|
21
|
+
* @param ctx - Client root context.
|
|
22
|
+
*/
|
|
23
|
+
export declare function installLocale(ctx: Context): void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** The blackboard, its animation player, learning cards and the learning route. */
|
|
2
|
+
export declare const zh: {
|
|
3
|
+
'board.title': string;
|
|
4
|
+
'board.workspace.label': string;
|
|
5
|
+
'board.workspace.empty': string;
|
|
6
|
+
'board.svg.alt': string;
|
|
7
|
+
'board.html.title': string;
|
|
8
|
+
'board.image.invalid': string;
|
|
9
|
+
'board.image.alt': string;
|
|
10
|
+
'board.label': string;
|
|
11
|
+
'board.subtitle': string;
|
|
12
|
+
'board.waiting': string;
|
|
13
|
+
'board.revision': string;
|
|
14
|
+
'board.view.canvas': string;
|
|
15
|
+
'board.view.notes': string;
|
|
16
|
+
'board.warning.invalid': string;
|
|
17
|
+
'board.empty': string;
|
|
18
|
+
'board.quote.label': string;
|
|
19
|
+
'board.quote.action': string;
|
|
20
|
+
'board.animation.label': string;
|
|
21
|
+
'board.animation.pause': string;
|
|
22
|
+
'board.animation.play': string;
|
|
23
|
+
'board.animation.replay': string;
|
|
24
|
+
'board.animation.progress': string;
|
|
25
|
+
'board.animation.step': string;
|
|
26
|
+
'board.cards.label': string;
|
|
27
|
+
'board.cards.eyebrow': string;
|
|
28
|
+
'board.cards.question': string;
|
|
29
|
+
'board.cards.example': string;
|
|
30
|
+
'board.cards.answer': string;
|
|
31
|
+
'board.cards.reveal': string;
|
|
32
|
+
'board.cards.kicker': string;
|
|
33
|
+
'board.cards.title': string;
|
|
34
|
+
'board.cards.recall': string;
|
|
35
|
+
'board.cards.recallOn': string;
|
|
36
|
+
'board.cards.recallOff': string;
|
|
37
|
+
'board.cards.invalid': string;
|
|
38
|
+
'board.cards.empty.title': string;
|
|
39
|
+
'board.cards.empty.description': string;
|
|
40
|
+
'board.cards.prepare': string;
|
|
41
|
+
'board.cards.export': string;
|
|
42
|
+
'board.cards.revise': string;
|
|
43
|
+
'board.cards.provenance': string;
|
|
44
|
+
'board.cards.saved': string;
|
|
45
|
+
'board.cards.markdown.source': string;
|
|
46
|
+
'board.cards.markdown.example': string;
|
|
47
|
+
'board.cards.markdown.selfTest': string;
|
|
48
|
+
'board.route.progress': string;
|
|
49
|
+
'board.route.completed': string;
|
|
50
|
+
};
|
|
51
|
+
export declare const en: Record<keyof typeof zh, string>;
|