@kirkchinese/dsh-citeciter 0.4.0 → 0.4.2
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 +52 -34
- package/README.zh.md +52 -34
- package/lib/client.js +646 -151
- package/lib/index.js +492 -110
- package/lib/{topic-DByv84H6.js → topic-BVNCaVbJ.js} +1 -0
- package/lib/{typert-common-Bvx1k2cq.js → typert-common-4_cbghYz.js} +3 -2
- package/lib/typert.host.js +2 -2
- package/lib/typert.remote-client.js +1 -1
- package/lib/types/client/companion-controller.d.ts +6 -4
- package/lib/types/client/components/CiteCiterSettings.d.ts +3 -1
- package/lib/types/client/components/CitePanel.d.ts +1 -1
- package/lib/types/client/conversation-dom.d.ts +72 -0
- package/lib/types/client/prompt.d.ts +7 -2
- package/lib/types/client/request-guard.d.ts +26 -0
- package/lib/types/client/selection.d.ts +8 -0
- package/lib/types/client/settings-document.d.ts +21 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/topic-runtime.d.ts +39 -2
- package/lib/types/topic.d.ts +1 -0
- package/lib/types/typert-common.d.ts +5 -1
- package/lib/types/typert.host.d.ts +6 -1
- package/lib/types/typert.remote-client.d.ts +1 -1
- package/package.json +27 -24
- package/lib/types/client/citation.d.ts +0 -10
|
@@ -213,6 +213,7 @@ const citeCiterRequestSchema = z.union([createRequestSchema, z.discriminatedUnio
|
|
|
213
213
|
}).strict(),
|
|
214
214
|
z.object({
|
|
215
215
|
action: z.literal("ask"),
|
|
216
|
+
requestId: z.string().min(1).optional(),
|
|
216
217
|
topicSessionId: topicSessionIdSchema,
|
|
217
218
|
question: questionSchema
|
|
218
219
|
}).strict(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as citeCiterRequestSchema, u as citeCiterResponseSchema } from "./topic-
|
|
1
|
+
import { l as citeCiterRequestSchema, u as citeCiterResponseSchema } from "./topic-BVNCaVbJ.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 = {
|
|
@@ -17,6 +17,7 @@ const citeCiterRequestDescriptor = {
|
|
|
17
17
|
schema: citeCiterRequestSchema
|
|
18
18
|
}
|
|
19
19
|
}],
|
|
20
|
+
cancellation: { parameter: "signal" },
|
|
20
21
|
result: {
|
|
21
22
|
mode: "strict",
|
|
22
23
|
typeSymbol: "@kirkchinese/dsh-citeciter#CiteCiterResponse",
|
|
@@ -24,7 +25,7 @@ const citeCiterRequestDescriptor = {
|
|
|
24
25
|
},
|
|
25
26
|
sourceLocation: {
|
|
26
27
|
file: "src/index.ts",
|
|
27
|
-
line:
|
|
28
|
+
line: 66,
|
|
28
29
|
column: 3
|
|
29
30
|
}
|
|
30
31
|
};
|
package/lib/typert.host.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as topicSummarySchema, l as citeCiterRequestSchema, m as topicSnapshotSchema, o as citationDraftSchema, s as citationRecordSchema, u as citeCiterResponseSchema } from "./topic-
|
|
2
|
-
import { t as citeCiterRequestDescriptor } from "./typert-common-
|
|
1
|
+
import { h as topicSummarySchema, l as citeCiterRequestSchema, m as topicSnapshotSchema, o as citationDraftSchema, s as citationRecordSchema, u as citeCiterResponseSchema } from "./topic-BVNCaVbJ.js";
|
|
2
|
+
import { t as citeCiterRequestDescriptor } from "./typert-common-4_cbghYz.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 { t as citeCiterRequestDescriptor } from "./typert-common-
|
|
1
|
+
import { t as citeCiterRequestDescriptor } from "./typert-common-4_cbghYz.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 = {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type ISessions, type SessionId, type SettingsScope, type SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client';
|
|
2
2
|
import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
3
|
import { type CiteCiterRequest, type CiteCiterResponse, type CiteCiterSettings, type ProviderOption, type QuestionAnswer, type TopicSnapshot, type TopicSummary } from '../topic.ts';
|
|
4
|
+
import { type CreateMode } from './request-guard.ts';
|
|
4
5
|
import type { CiteSelection } from './types.ts';
|
|
5
6
|
export type CompanionPhase = 'idle' | 'creating' | 'ready' | 'running' | 'stopping' | 'stopped' | 'error';
|
|
6
|
-
export type CreateMode
|
|
7
|
+
export type { CreateMode } from './request-guard.ts';
|
|
7
8
|
export type TopicsStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
8
9
|
export type SettingsSaveStatus = 'idle' | 'saving' | 'saved' | 'error';
|
|
9
10
|
export interface CompanionSnapshot {
|
|
@@ -26,7 +27,7 @@ export interface CompanionSnapshot {
|
|
|
26
27
|
includeArchived: boolean;
|
|
27
28
|
error: string | null;
|
|
28
29
|
}
|
|
29
|
-
type RemoteRequest = (request: CiteCiterRequest) => Promise<RemoteResult<CiteCiterResponse>>;
|
|
30
|
+
type RemoteRequest = (request: CiteCiterRequest, signal: AbortSignal) => Promise<RemoteResult<CiteCiterResponse>>;
|
|
30
31
|
export interface CompanionFace {
|
|
31
32
|
getSnapshot(): CompanionSnapshot;
|
|
32
33
|
subscribe(listener: () => void): () => void;
|
|
@@ -46,6 +47,7 @@ export interface CompanionFace {
|
|
|
46
47
|
setSetting<Key extends keyof CiteCiterSettings>(key: Key, value: CiteCiterSettings[Key]): Promise<void>;
|
|
47
48
|
dispose(): Promise<void>;
|
|
48
49
|
}
|
|
50
|
+
/** Initial browser snapshot for the root-scoped CiteCiter controller. */
|
|
51
|
+
export declare const INITIAL_COMPANION_SNAPSHOT: CompanionSnapshot;
|
|
49
52
|
/** Bind private Topic Remote calls to one browser snapshot and polling lifecycle. */
|
|
50
|
-
export declare function createCompanionController(sessions: ISessions, settingsScope: SettingsScope<CiteCiterSettings>, request: RemoteRequest, onAutoOpen
|
|
51
|
-
export {};
|
|
53
|
+
export declare function createCompanionController(sessions: ISessions, settingsScope: SettingsScope<CiteCiterSettings>, request: RemoteRequest, onAutoOpen: () => void, store: SnapshotStore<CompanionSnapshot>): CompanionFace;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { SettingsSectionOwnerProps } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
2
2
|
import type { CompanionFace } from '../companion-controller.ts';
|
|
3
|
+
import type { SettingsDocumentController } from '../settings-document.ts';
|
|
3
4
|
export interface CiteCiterSettingsProps extends SettingsSectionOwnerProps {
|
|
4
5
|
readonly companion: CompanionFace;
|
|
6
|
+
readonly settingsDocument: SettingsDocumentController;
|
|
5
7
|
}
|
|
6
8
|
/** Native DSH settings page for CiteCiter-owned preferences. */
|
|
7
|
-
export declare function CiteCiterSettings({ companion }: CiteCiterSettingsProps): import("react").JSX.Element;
|
|
9
|
+
export declare function CiteCiterSettings({ companion, settingsDocument }: CiteCiterSettingsProps): import("react").JSX.Element;
|
|
@@ -6,5 +6,5 @@ export interface CitePanelProps {
|
|
|
6
6
|
readonly closePanel: () => void;
|
|
7
7
|
readonly reportParseError: (messageId: string) => void;
|
|
8
8
|
}
|
|
9
|
-
/** Independent
|
|
9
|
+
/** Independent learning workspace with a reversible Host-column compatibility adapter. */
|
|
10
10
|
export declare function CitePanel({ bus, companion, closePanel, reportParseError }: CitePanelProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** Centralized best-effort adapters for DSH conversation and Read Frog DOM markers. */
|
|
2
|
+
/** One parsed DSH conversation flow element. */
|
|
3
|
+
export interface DshConversationFlow {
|
|
4
|
+
readonly element: HTMLElement;
|
|
5
|
+
readonly kind: string;
|
|
6
|
+
readonly anchorKey: string | null;
|
|
7
|
+
}
|
|
8
|
+
/** One validated assistant flow carrying a stable DSH anchor. */
|
|
9
|
+
export interface DshAssistantAnchor {
|
|
10
|
+
readonly element: HTMLElement;
|
|
11
|
+
readonly anchorKey: string;
|
|
12
|
+
}
|
|
13
|
+
/** Best-effort Read Frog selection classification. */
|
|
14
|
+
export type ReadFrogSelection = {
|
|
15
|
+
readonly kind: 'none';
|
|
16
|
+
} | {
|
|
17
|
+
readonly kind: 'invalid';
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: 'translation';
|
|
20
|
+
readonly sourceParagraph: HTMLElement;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Parse the nearest DSH conversation flow containing a DOM node.
|
|
24
|
+
*
|
|
25
|
+
* @param node - rendered conversation node to inspect.
|
|
26
|
+
* @returns parsed flow metadata, or null outside a known DSH flow.
|
|
27
|
+
*/
|
|
28
|
+
export declare function dshConversationFlow(node: Node): DshConversationFlow | null;
|
|
29
|
+
/**
|
|
30
|
+
* Parse the assistant anchor that owns a context-menu event target.
|
|
31
|
+
*
|
|
32
|
+
* @param target - browser event target to inspect.
|
|
33
|
+
* @returns validated assistant metadata, or null outside an anchored assistant flow.
|
|
34
|
+
*/
|
|
35
|
+
export declare function dshAssistantAnchorForTarget(target: EventTarget | null): DshAssistantAnchor | null;
|
|
36
|
+
/**
|
|
37
|
+
* Return assistant anchors intersected by a DOM range in document order.
|
|
38
|
+
*
|
|
39
|
+
* @param range - current rendered selection range.
|
|
40
|
+
* @returns validated assistant anchors touched by the range.
|
|
41
|
+
*/
|
|
42
|
+
export declare function dshIntersectedAssistantAnchors(range: Range): DshAssistantAnchor[];
|
|
43
|
+
/**
|
|
44
|
+
* Detect DSH-rendered reasoning, generated controls, and collapsed code chrome.
|
|
45
|
+
*
|
|
46
|
+
* @param range - current rendered selection range.
|
|
47
|
+
* @param flow - assistant flow containing the range.
|
|
48
|
+
* @returns whether the range touches content that CiteCiter must ignore.
|
|
49
|
+
*/
|
|
50
|
+
export declare function dshRangeTouchesExcludedContent(range: Range, flow: HTMLElement): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Find the current DSH assistant element for a persisted anchor key.
|
|
53
|
+
*
|
|
54
|
+
* @param anchorKey - stable anchor emitted by the DSH conversation renderer.
|
|
55
|
+
* @returns matching rendered assistant element, or null when it is not mounted.
|
|
56
|
+
*/
|
|
57
|
+
export declare function findDshAssistantAnchor(anchorKey: string): HTMLElement | null;
|
|
58
|
+
/**
|
|
59
|
+
* Determine whether a node is projected reasoning or translation rather than committed answer text.
|
|
60
|
+
*
|
|
61
|
+
* @param node - rendered node to classify.
|
|
62
|
+
* @returns whether the node must stay out of committed answer text.
|
|
63
|
+
*/
|
|
64
|
+
export declare function isNonAnswerContent(node: Node): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Resolve a selection wholly inside one Read Frog translation to its source paragraph.
|
|
67
|
+
*
|
|
68
|
+
* @param range - current rendered selection range.
|
|
69
|
+
* @param assistant - assistant flow containing the translated projection.
|
|
70
|
+
* @returns translation mapping state and source paragraph when available.
|
|
71
|
+
*/
|
|
72
|
+
export declare function readFrogSelection(range: Range, assistant: HTMLElement): ReadFrogSelection;
|
|
@@ -10,5 +10,10 @@ export interface ParsedNextQuestions {
|
|
|
10
10
|
* prose. System Tutor and Citation Context travel through their own layers.
|
|
11
11
|
*/
|
|
12
12
|
export declare function normalizeQuestion(rawQuestion: string): string;
|
|
13
|
-
/**
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Parse optional follow-up control text without exposing complete or partial markers.
|
|
15
|
+
* @param text - accumulated assistant text.
|
|
16
|
+
* @param streaming - whether the text may end inside a control marker.
|
|
17
|
+
* @returns visible answer text, valid shortcut questions, and malformed-control status.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseNextQuestions(text: string, streaming?: boolean): ParsedNextQuestions;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CiteSelection } from './types.ts';
|
|
2
|
+
export type CreateMode = 'observer' | 'exact-fork' | 'exact-when-available';
|
|
3
|
+
export interface RequestIntent {
|
|
4
|
+
readonly key: string;
|
|
5
|
+
readonly requestId: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Claim the retry-stable request ID for one pending Topic-creation intent.
|
|
9
|
+
* @param selection - cited source selection.
|
|
10
|
+
* @param question - normalized first question.
|
|
11
|
+
* @param mode - resolved Topic creation mode.
|
|
12
|
+
* @returns the pending intent key and request ID.
|
|
13
|
+
*/
|
|
14
|
+
export declare function claimCreateTopicIntent(selection: CiteSelection, question: string, mode: CreateMode): Promise<RequestIntent>;
|
|
15
|
+
/**
|
|
16
|
+
* Claim the retry-stable request ID for one pending Topic follow-up.
|
|
17
|
+
* @param topicSessionId - target private Topic Session.
|
|
18
|
+
* @param question - normalized follow-up question.
|
|
19
|
+
* @returns the pending intent key and request ID.
|
|
20
|
+
*/
|
|
21
|
+
export declare function claimAskIntent(topicSessionId: string, question: string): Promise<RequestIntent>;
|
|
22
|
+
/**
|
|
23
|
+
* Forget a confirmed request so a later identical submission is a new user intent.
|
|
24
|
+
* @param intent - confirmed pending intent.
|
|
25
|
+
*/
|
|
26
|
+
export declare function completeRequestIntent(intent: RequestIntent): void;
|
|
@@ -12,3 +12,11 @@ import type { CiteSelection } from './types.ts';
|
|
|
12
12
|
* @returns validated selection metadata, or null when CiteCiter should ignore it.
|
|
13
13
|
*/
|
|
14
14
|
export declare function readSelection(event: MouseEvent, sourceSessionId: SessionId): CiteSelection | null;
|
|
15
|
+
/**
|
|
16
|
+
* Claim a context menu only after resolving a valid DSH assistant selection.
|
|
17
|
+
*
|
|
18
|
+
* @param event - context-menu event to validate and optionally cancel.
|
|
19
|
+
* @param sourceSessionId - current source session captured with the selection.
|
|
20
|
+
* @returns validated selection metadata, or null while leaving the native menu untouched.
|
|
21
|
+
*/
|
|
22
|
+
export declare function claimSelectionContextMenu(event: MouseEvent, sourceSessionId: SessionId): CiteSelection | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SettingsDescribeFace } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
2
|
+
export interface SettingsDocumentSnapshot {
|
|
3
|
+
status: 'idle' | 'loading' | 'ready' | 'missing' | 'unavailable' | 'error';
|
|
4
|
+
opening: boolean;
|
|
5
|
+
error: string | null;
|
|
6
|
+
message: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface SettingsDocumentController {
|
|
9
|
+
getSnapshot(): SettingsDocumentSnapshot;
|
|
10
|
+
subscribe(listener: () => void): () => void;
|
|
11
|
+
load(): Promise<void>;
|
|
12
|
+
open(): Promise<void>;
|
|
13
|
+
dispose(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Create the browser owner for the Host settings-document action.
|
|
17
|
+
* @param describe - mirrored Host settings-document availability.
|
|
18
|
+
* @param openDocument - Host operation that opens the authoritative file.
|
|
19
|
+
* @returns observable loading, availability, and action state.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createSettingsDocumentController(describe: SettingsDescribeFace, openDocument: (signal: AbortSignal) => Promise<void>): SettingsDocumentController;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare class CiteCiterHost extends TypertRemoteService {
|
|
|
31
31
|
/** Do not publish the Remote service until its private runtime is ready. */
|
|
32
32
|
[Service.init](): Promise<void>;
|
|
33
33
|
/** Validate and execute one strict Topic command. */
|
|
34
|
-
request(rawRequest: CiteCiterRequest): Promise<CiteCiterResponse>;
|
|
34
|
+
request(rawRequest: CiteCiterRequest, signal: AbortSignal): Promise<CiteCiterResponse>;
|
|
35
35
|
}
|
|
36
36
|
/** Register optional settings and mount the Host Remote service. */
|
|
37
37
|
export declare function apply(ctx: Context): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import { type SessionEvent } from '@deepseek-ai/dsh-session';
|
|
2
|
+
import { type SessionEvent, type SessionHeader } from '@deepseek-ai/dsh-session';
|
|
3
3
|
import { type SessionTitleProviderRequest } from '@deepseek-ai/dsh-session-title';
|
|
4
4
|
import { type ObserverSourceSnapshot } from './observer.ts';
|
|
5
5
|
import { type CiteCiterRequest, type CiteCiterResponse, type CiteCiterSettings, type TopicMetadata, type TopicMode } from './topic.ts';
|
|
@@ -10,6 +10,11 @@ type CreateRequest = Extract<CiteCiterRequest, {
|
|
|
10
10
|
export declare function citeCiterToolAvailable(name: string, allowSourceFiles: boolean): boolean;
|
|
11
11
|
/** Select the first human question added after a Topic's inherited seed. */
|
|
12
12
|
export declare function selectTopicTitleMessage(request: SessionTitleProviderRequest): import("@deepseek-ai/dsh-session-title").SessionTitleUserMessage;
|
|
13
|
+
/** Session header and events used to project one private Topic. */
|
|
14
|
+
export interface RuntimeTopicLog {
|
|
15
|
+
readonly header: SessionHeader;
|
|
16
|
+
readonly events: readonly SessionEvent[];
|
|
17
|
+
}
|
|
13
18
|
/** Minimal on-disk navigation index; Session history stays in standard DSH JSONL. */
|
|
14
19
|
export declare class TopicIndex {
|
|
15
20
|
private readonly root;
|
|
@@ -27,6 +32,19 @@ export declare class TopicIndex {
|
|
|
27
32
|
private read;
|
|
28
33
|
private readIfPresent;
|
|
29
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Return the first genuine Topic question after any Exact Fork seed.
|
|
37
|
+
* @param log - private Topic Session contents.
|
|
38
|
+
* @returns the first post-seed question, or `null` when it has not been committed.
|
|
39
|
+
*/
|
|
40
|
+
export declare function firstPostSeedUserQuestion(log: RuntimeTopicLog): string | null;
|
|
41
|
+
/**
|
|
42
|
+
* Find a post-seed user question by its durable message identifier.
|
|
43
|
+
* @param log - private Topic Session contents.
|
|
44
|
+
* @param messageId - request identity stored as the user-message identity.
|
|
45
|
+
* @returns the matching question, or `null` when the request is not committed.
|
|
46
|
+
*/
|
|
47
|
+
export declare function postSeedUserQuestionById(log: RuntimeTopicLog, messageId: string): string | null;
|
|
30
48
|
/** Fold only titles created inside the private Topic, excluding inherited fork titles. */
|
|
31
49
|
export declare function foldTopicTitle(metadata: TopicMetadata, events: readonly SessionEvent[]): import("@deepseek-ai/dsh-session-title").SessionTitleSnapshot | undefined;
|
|
32
50
|
/** Resolve the actual Topic mode without forking through an open DSH turn. */
|
|
@@ -41,12 +59,17 @@ export declare class TopicRuntime {
|
|
|
41
59
|
private readonly settings;
|
|
42
60
|
private readonly runtime;
|
|
43
61
|
private readonly index;
|
|
62
|
+
private readonly lifecycleAbort;
|
|
44
63
|
private readonly fibers;
|
|
45
64
|
private readonly handles;
|
|
46
65
|
private readonly selections;
|
|
47
66
|
private readonly opening;
|
|
67
|
+
private readonly requests;
|
|
68
|
+
private readonly cleanupFailures;
|
|
48
69
|
private readonly pendingQuestions;
|
|
49
70
|
private readonly creations;
|
|
71
|
+
private readonly asks;
|
|
72
|
+
private readonly topicAdmissions;
|
|
50
73
|
private readonly modelChanges;
|
|
51
74
|
private readonly titleRefreshes;
|
|
52
75
|
private readonly titleRefreshAttempted;
|
|
@@ -68,21 +91,34 @@ export declare class TopicRuntime {
|
|
|
68
91
|
/** Wait until every private DSH service has started. */
|
|
69
92
|
initialize(): Promise<void>;
|
|
70
93
|
/** Execute one validated browser command against private Topics. */
|
|
71
|
-
request(rawRequest: CiteCiterRequest): Promise<CiteCiterResponse>;
|
|
94
|
+
request(rawRequest: CiteCiterRequest, callerSignal: AbortSignal): Promise<CiteCiterResponse>;
|
|
95
|
+
private executeRequest;
|
|
72
96
|
/** Stop every owned Agent and plugin fiber before releasing bridged services. */
|
|
73
97
|
dispose(): Promise<void>;
|
|
74
98
|
private disposeOwned;
|
|
99
|
+
private beginClosing;
|
|
100
|
+
private assertOpen;
|
|
75
101
|
private start;
|
|
76
102
|
private releaseRuntime;
|
|
77
103
|
private releaseOwnedRuntime;
|
|
104
|
+
private settleOwnedOperations;
|
|
78
105
|
private create;
|
|
106
|
+
/** Let a caller stop waiting without cancelling an accepted idempotent mutation. */
|
|
107
|
+
private waitForCaller;
|
|
79
108
|
private createIdempotent;
|
|
109
|
+
private resumeOrCreate;
|
|
80
110
|
private createHandle;
|
|
81
111
|
private setupAgent;
|
|
82
112
|
private globTool;
|
|
83
113
|
private sourceTool;
|
|
84
114
|
private ensureHandle;
|
|
115
|
+
private disposeLateHandle;
|
|
116
|
+
/** Resolve only after the accepted question is present in the durable model-input log. */
|
|
117
|
+
private commitFollowup;
|
|
85
118
|
private ask;
|
|
119
|
+
private askIdempotent;
|
|
120
|
+
private queueAsk;
|
|
121
|
+
private queueTopicAdmission;
|
|
86
122
|
private askUser;
|
|
87
123
|
private answerQuestion;
|
|
88
124
|
private cancelQuestion;
|
|
@@ -100,6 +136,7 @@ export declare class TopicRuntime {
|
|
|
100
136
|
private list;
|
|
101
137
|
private summary;
|
|
102
138
|
private summaryFromMetadata;
|
|
139
|
+
private get;
|
|
103
140
|
private readLog;
|
|
104
141
|
private scheduleSourceAvailabilityCheck;
|
|
105
142
|
private rememberSourceAvailability;
|
package/lib/types/topic.d.ts
CHANGED
|
@@ -404,6 +404,7 @@ export declare const citeCiterRequestSchema: z.ZodUnion<readonly [z.ZodUnion<rea
|
|
|
404
404
|
topicSessionId: z.ZodString;
|
|
405
405
|
}, z.core.$strict>, z.ZodObject<{
|
|
406
406
|
action: z.ZodLiteral<"ask">;
|
|
407
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
407
408
|
topicSessionId: z.ZodString;
|
|
408
409
|
question: z.ZodString;
|
|
409
410
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -60,6 +60,7 @@ export declare const citeCiterRequestDescriptor: {
|
|
|
60
60
|
topicSessionId: import("zod").ZodString;
|
|
61
61
|
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
62
62
|
action: import("zod").ZodLiteral<"ask">;
|
|
63
|
+
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
63
64
|
topicSessionId: import("zod").ZodString;
|
|
64
65
|
question: import("zod").ZodString;
|
|
65
66
|
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
@@ -112,6 +113,9 @@ export declare const citeCiterRequestDescriptor: {
|
|
|
112
113
|
}, import("zod/v4/core").$strict>], "action">]>;
|
|
113
114
|
};
|
|
114
115
|
}];
|
|
116
|
+
readonly cancellation: {
|
|
117
|
+
readonly parameter: "signal";
|
|
118
|
+
};
|
|
115
119
|
readonly result: {
|
|
116
120
|
readonly mode: "strict";
|
|
117
121
|
readonly typeSymbol: "@kirkchinese/dsh-citeciter#CiteCiterResponse";
|
|
@@ -272,7 +276,7 @@ export declare const citeCiterRequestDescriptor: {
|
|
|
272
276
|
};
|
|
273
277
|
readonly sourceLocation: {
|
|
274
278
|
readonly file: "src/index.ts";
|
|
275
|
-
readonly line:
|
|
279
|
+
readonly line: 66;
|
|
276
280
|
readonly column: 3;
|
|
277
281
|
};
|
|
278
282
|
};
|
|
@@ -213,6 +213,7 @@ export declare const TYPERT: {
|
|
|
213
213
|
topicSessionId: import("zod").ZodString;
|
|
214
214
|
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
215
215
|
action: import("zod").ZodLiteral<"ask">;
|
|
216
|
+
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
216
217
|
topicSessionId: import("zod").ZodString;
|
|
217
218
|
question: import("zod").ZodString;
|
|
218
219
|
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
@@ -486,6 +487,7 @@ export declare const TYPERT: {
|
|
|
486
487
|
topicSessionId: import("zod").ZodString;
|
|
487
488
|
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
488
489
|
action: import("zod").ZodLiteral<"ask">;
|
|
490
|
+
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
489
491
|
topicSessionId: import("zod").ZodString;
|
|
490
492
|
question: import("zod").ZodString;
|
|
491
493
|
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
@@ -538,6 +540,9 @@ export declare const TYPERT: {
|
|
|
538
540
|
}, import("zod/v4/core").$strict>], "action">]>;
|
|
539
541
|
};
|
|
540
542
|
}];
|
|
543
|
+
readonly cancellation: {
|
|
544
|
+
readonly parameter: "signal";
|
|
545
|
+
};
|
|
541
546
|
readonly result: {
|
|
542
547
|
readonly mode: "strict";
|
|
543
548
|
readonly typeSymbol: "@kirkchinese/dsh-citeciter#CiteCiterResponse";
|
|
@@ -698,7 +703,7 @@ export declare const TYPERT: {
|
|
|
698
703
|
};
|
|
699
704
|
readonly sourceLocation: {
|
|
700
705
|
readonly file: "src/index.ts";
|
|
701
|
-
readonly line:
|
|
706
|
+
readonly line: 66;
|
|
702
707
|
readonly column: 3;
|
|
703
708
|
};
|
|
704
709
|
}];
|
|
@@ -2,7 +2,7 @@ import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-ty
|
|
|
2
2
|
import type { CiteCiterRequest, CiteCiterResponse } from './topic.ts';
|
|
3
3
|
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
4
4
|
interface CiteCiterRemoteNamespace {
|
|
5
|
-
request: (request: CiteCiterRequest) => Promise<RemoteResult<CiteCiterResponse>>;
|
|
5
|
+
request: (request: CiteCiterRequest, signal?: AbortSignal) => Promise<RemoteResult<CiteCiterResponse>>;
|
|
6
6
|
}
|
|
7
7
|
interface TypertRemoteMap {
|
|
8
8
|
'citeciter/request': CiteCiterRemoteNamespace['request'];
|
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirkchinese/dsh-citeciter",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.4.2",
|
|
4
|
+
"description": "Verifiable, source-bound, read-only investigations for DeepSeek Harness responses",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
7
7
|
"dsh",
|
|
8
8
|
"dsh-plugin",
|
|
9
9
|
"cordis",
|
|
10
10
|
"citation",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
11
|
+
"source-bound",
|
|
12
|
+
"verification",
|
|
13
|
+
"evidence",
|
|
14
|
+
"investigation",
|
|
14
15
|
"context-management",
|
|
15
16
|
"read-only",
|
|
16
17
|
"explanation",
|
|
@@ -64,10 +65,10 @@
|
|
|
64
65
|
"client": {
|
|
65
66
|
"inject": [
|
|
66
67
|
"@deepseek-ai/dsh-api-gateway",
|
|
68
|
+
"@deepseek-ai/dsh-client-connection",
|
|
67
69
|
"@deepseek-ai/dsh-client-runtime",
|
|
70
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
68
71
|
"@deepseek-ai/dsh-client-ui-layout",
|
|
69
|
-
"@deepseek-ai/dsh-client-ui-slots",
|
|
70
|
-
"@deepseek-ai/dsh-client-ui-primitives",
|
|
71
72
|
"@deepseek-ai/dsh-client-ui-settings"
|
|
72
73
|
],
|
|
73
74
|
"platform": "web"
|
|
@@ -79,16 +80,30 @@
|
|
|
79
80
|
"cordis.patch.yml",
|
|
80
81
|
"README.zh.md"
|
|
81
82
|
],
|
|
83
|
+
"scripts": {
|
|
84
|
+
"build": "npm run build:lib && npm run build:bundle",
|
|
85
|
+
"prebuild:lib": "node scripts/clean-types.mjs",
|
|
86
|
+
"build:lib": "tsc -p tsconfig.json",
|
|
87
|
+
"prebuild:bundle": "node scripts/clean-bundle.mjs",
|
|
88
|
+
"build:bundle": "tsdown --env.DSH_BUILD_FACE client",
|
|
89
|
+
"postbuild:bundle": "node scripts/normalize-bundle.mjs",
|
|
90
|
+
"prepack": "npm run build",
|
|
91
|
+
"dev": "npm run build && node dev/watch.mjs",
|
|
92
|
+
"smoke:seed": "node dev/seed-smoke-session.mjs",
|
|
93
|
+
"smoke:hmr": "node dev/hmr-smoke.mjs",
|
|
94
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
95
|
+
"test": "npm run build:lib && node --test tests/*.test.mjs"
|
|
96
|
+
},
|
|
82
97
|
"peerDependencies": {
|
|
83
98
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
84
99
|
"@deepseek-ai/dsh-agent": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
85
100
|
"@deepseek-ai/dsh-agent-loop": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
86
101
|
"@deepseek-ai/dsh-api-gateway": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
102
|
+
"@deepseek-ai/dsh-client-connection": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
87
103
|
"@deepseek-ai/dsh-client-runtime": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
104
|
+
"@deepseek-ai/dsh-client-ui-conversation": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
88
105
|
"@deepseek-ai/dsh-client-ui-layout": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
89
|
-
"@deepseek-ai/dsh-client-ui-primitives": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
90
106
|
"@deepseek-ai/dsh-client-ui-settings": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
91
|
-
"@deepseek-ai/dsh-client-ui-slots": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
92
107
|
"@deepseek-ai/dsh-fs": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
93
108
|
"@deepseek-ai/dsh-home-paths": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
94
109
|
"@deepseek-ai/dsh-llm": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
@@ -110,7 +125,6 @@
|
|
|
110
125
|
"@deepseek-ai/dsh-typert-protocol": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
111
126
|
"@deepseek-ai/dsh-user-questions": ">=0.1.1-rc.1 <0.1.1-rc.3",
|
|
112
127
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
113
|
-
"react": "^18.2.0",
|
|
114
128
|
"zod": "^4.4.3"
|
|
115
129
|
},
|
|
116
130
|
"devDependencies": {
|
|
@@ -118,7 +132,9 @@
|
|
|
118
132
|
"@deepseek-ai/dsh-agent": "0.1.1-rc.2",
|
|
119
133
|
"@deepseek-ai/dsh-agent-loop": "0.1.1-rc.2",
|
|
120
134
|
"@deepseek-ai/dsh-api-gateway": "0.1.1-rc.2",
|
|
135
|
+
"@deepseek-ai/dsh-client-connection": "0.1.1-rc.2",
|
|
121
136
|
"@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
|
|
137
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.1.1-rc.2",
|
|
122
138
|
"@deepseek-ai/dsh-client-ui-layout": "0.1.1-rc.2",
|
|
123
139
|
"@deepseek-ai/dsh-client-ui-primitives": "0.1.1-rc.2",
|
|
124
140
|
"@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
|
|
@@ -157,18 +173,5 @@
|
|
|
157
173
|
"tsdown": "^0.22.2",
|
|
158
174
|
"typescript": "^6.0.3",
|
|
159
175
|
"zod": "^4.4.3"
|
|
160
|
-
},
|
|
161
|
-
"scripts": {
|
|
162
|
-
"build": "npm run build:lib && npm run build:bundle",
|
|
163
|
-
"prebuild:lib": "node scripts/clean-types.mjs",
|
|
164
|
-
"build:lib": "tsc -p tsconfig.json",
|
|
165
|
-
"prebuild:bundle": "node scripts/clean-bundle.mjs",
|
|
166
|
-
"build:bundle": "tsdown --env.DSH_BUILD_FACE client",
|
|
167
|
-
"postbuild:bundle": "node scripts/normalize-bundle.mjs",
|
|
168
|
-
"dev": "npm run build && node dev/watch.mjs",
|
|
169
|
-
"smoke:seed": "node dev/seed-smoke-session.mjs",
|
|
170
|
-
"smoke:hmr": "node dev/hmr-smoke.mjs",
|
|
171
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
172
|
-
"test": "npm run build:lib && node --test tests/*.test.mjs"
|
|
173
176
|
}
|
|
174
|
-
}
|
|
177
|
+
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CitationDraft } from '../topic.ts';
|
|
2
|
-
import type { CiteSelection } from './types.ts';
|
|
3
|
-
interface SourceSelection extends CiteSelection {
|
|
4
|
-
readonly sourceText: string;
|
|
5
|
-
}
|
|
6
|
-
/** Map rendered Markdown selection context back to one exact raw answer range. */
|
|
7
|
-
export declare function normalizeSelectionAgainstAnswer(selection: CiteSelection, answer: string): SourceSelection;
|
|
8
|
-
/** Build the browser claim that the Host later checks against one committed model call. */
|
|
9
|
-
export declare function createCitationDraft(selection: SourceSelection, assistantMessageSeq: number): Promise<CitationDraft>;
|
|
10
|
-
export {};
|