@kirkchinese/dsh-citeciter 0.8.1 → 0.8.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 +16 -9
- package/README.zh.md +16 -9
- package/lib/client.js +5 -3
- package/lib/index.js +1335 -1251
- package/lib/{typert-common-DxE1_Bn_.js → typert-common-BMA9IB7p.js} +1 -1
- package/lib/typert.host.js +2 -2
- package/lib/typert.remote-client.js +1 -1
- package/lib/types/observer.d.ts +9 -1
- package/lib/types/source-read-tool.d.ts +14 -0
- package/lib/types/topic-prompts.d.ts +4 -0
- package/lib/types/topic-runtime.d.ts +2 -1
- package/lib/{update-0LcFDvI5.js → update-BtuUBRbP.js} +4 -2
- package/package.json +12 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as citeCiterRequestSchema, p as citeCiterResponseSchema, r as updateCheckResponseSchema } from "./update-
|
|
1
|
+
import { f as citeCiterRequestSchema, p as citeCiterResponseSchema, r as updateCheckResponseSchema } from "./update-BtuUBRbP.js";
|
|
2
2
|
//#region lib/types/typert-common.js
|
|
3
3
|
/** Strict root-scoped Topic command shared by Host and browser manifests. */
|
|
4
4
|
const citeCiterRequestDescriptor = {
|
package/lib/typert.host.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as topicSummarySchema, S as topicSnapshotSchema, f as citeCiterRequestSchema, l as citationDraftSchema, p as citeCiterResponseSchema, r as updateCheckResponseSchema, u as citationRecordSchema } from "./update-
|
|
2
|
-
import { n as updateCheckDescriptor, t as citeCiterRequestDescriptor } from "./typert-common-
|
|
1
|
+
import { C as topicSummarySchema, S as topicSnapshotSchema, f as citeCiterRequestSchema, l as citationDraftSchema, p as citeCiterResponseSchema, r as updateCheckResponseSchema, u as citationRecordSchema } from "./update-BtuUBRbP.js";
|
|
2
|
+
import { n as updateCheckDescriptor, t as citeCiterRequestDescriptor } from "./typert-common-BMA9IB7p.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-BMA9IB7p.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/observer.d.ts
CHANGED
|
@@ -35,11 +35,19 @@ export type SourceEvidenceEvent = JsonValue;
|
|
|
35
35
|
/** Complete bounded source-read payload recorded as the Topic tool result. */
|
|
36
36
|
export interface SourceReadResult {
|
|
37
37
|
readonly sourceSessionId: string;
|
|
38
|
+
/** Highest sequence in the entire readable snapshot, independent of request bounds. */
|
|
39
|
+
readonly sourceMaxSeq: number | null;
|
|
38
40
|
readonly requestedFromSeq: number;
|
|
39
41
|
readonly requestedThroughSeq: number | null;
|
|
42
|
+
/** Last scanned sequence; filtered records can advance this without adding evidence. */
|
|
40
43
|
readonly capturedThroughSeq: number | null;
|
|
44
|
+
/** Legacy upper-bound marker; may precede fromSeq and is not the source horizon. */
|
|
41
45
|
readonly availableThroughSeq: number | null;
|
|
46
|
+
/** A byte-budget stop within the requested range, not a source exhaustion flag. */
|
|
42
47
|
readonly truncated: boolean;
|
|
48
|
+
readonly hasMore: boolean;
|
|
49
|
+
/** First unscanned sequence at or after fromSeq, including beyond a requested range cap. */
|
|
50
|
+
readonly nextFromSeq: number | null;
|
|
43
51
|
readonly bytesUsed: number;
|
|
44
52
|
readonly events: readonly SourceEvidenceEvent[];
|
|
45
53
|
}
|
|
@@ -68,5 +76,5 @@ export declare function resolveToolEvidence(source: ObserverSourceSnapshot, rawC
|
|
|
68
76
|
* @returns verified evidence with document offsets in its entry.
|
|
69
77
|
*/
|
|
70
78
|
export declare function resolveDocumentEvidence(content: string, rawClaim: DocumentEvidenceClaim): ValidatedDocumentEvidence;
|
|
71
|
-
/** Format
|
|
79
|
+
/** Format a range plus the readable snapshot horizon and cursor, without exposing chunks or exceeding the event-array byte budget. */
|
|
72
80
|
export declare function formatSourceSessionRead(source: ObserverSourceSnapshot, options: SourceReadOptions): SourceReadResult;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ObserverSourceSnapshot } from './observer.ts';
|
|
2
|
+
export declare const SOURCE_READ_SECTION_NAME = "@kirkchinese/dsh-citeciter:source-read";
|
|
3
|
+
/** Describe the actual readable snapshot without injecting citation metadata or unsent attachments. */
|
|
4
|
+
export declare function sourceReadPrompt(frozen: boolean): string;
|
|
5
|
+
/**
|
|
6
|
+
* Build the source-read contract independently of Session ownership and UI.
|
|
7
|
+
* @param options - an authorized snapshot reader, reasoning preference and immutable-prefix flag.
|
|
8
|
+
* @returns a native tool with explicit snapshot, range and continuation semantics.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createSourceReadTool(options: {
|
|
11
|
+
readonly read: (signal: AbortSignal) => Promise<ObserverSourceSnapshot>;
|
|
12
|
+
readonly includeReasoning: () => boolean;
|
|
13
|
+
readonly frozen: boolean;
|
|
14
|
+
}): import("@deepseek-ai/dsh-tools").ToolDefinition;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Shared final-answer control protocol, parsed into editable question shortcuts by the client. */
|
|
2
|
+
export declare const FIRST_ANSWER_FOLLOWUPS = "After completing the first user question in this Topic, append three concise, distinct questions the user may naturally ask next, in the user's language. Put them only at the end of that first final answer, not in intermediate tool steps or later replies. Each question must deepen understanding of the answer, be at most 160 characters, and avoid unsolicited source changes or workflow actions. The UI turns them into editable drafts; never answer or send them automatically. Emit a JSON array inside this exact block, without a code fence or prose after it:\n<citeciter-next-questions>\n[\"\u95EE\u9898\u4E00\uFF1F\",\"\u95EE\u9898\u4E8C\uFF1F\",\"\u95EE\u9898\u4E09\uFF1F\"]\n</citeciter-next-questions>";
|
|
3
|
+
/** Compose native Topic instructions without importing legacy read-only policy or hidden citation content. */
|
|
4
|
+
export declare function composeHostedTopicPrompt(custom: string | undefined, followups: boolean): string;
|
|
@@ -363,7 +363,8 @@ export declare class TopicRuntime {
|
|
|
363
363
|
private blackboardApplyTool;
|
|
364
364
|
private readDocumentTool;
|
|
365
365
|
private searchDocumentTool;
|
|
366
|
-
|
|
366
|
+
/** Share source-read instructions and contract across native and legacy Topic runtimes. */
|
|
367
|
+
private registerSourceTool;
|
|
367
368
|
private ensureHandle;
|
|
368
369
|
private disposeLateHandle;
|
|
369
370
|
/** Resolve only after the accepted question is present in the durable model-input log. */
|
|
@@ -670,7 +670,8 @@ const topicMetadataFields = {
|
|
|
670
670
|
updatedAt: z.number().int().nonnegative(),
|
|
671
671
|
archivedAt: z.number().int().nonnegative().nullable(),
|
|
672
672
|
sourceAvailable: z.boolean(),
|
|
673
|
-
|
|
673
|
+
/** Cursor from this Topic's last source read, never the source horizon or a permission boundary. */
|
|
674
|
+
observedThroughSeq: z.number().int().nonnegative().nullable().optional().describe("Last source-read scan cursor; not the source horizon or an access limit.")
|
|
674
675
|
};
|
|
675
676
|
/** Canonical Topic metadata committed by the current runtime. */
|
|
676
677
|
const topicMetadataSchema = z.object({
|
|
@@ -735,7 +736,8 @@ const topicSummarySchema = z.object({
|
|
|
735
736
|
archived: z.boolean(),
|
|
736
737
|
running: z.boolean(),
|
|
737
738
|
sourceAvailable: z.boolean(),
|
|
738
|
-
|
|
739
|
+
/** Cursor from this Topic's last source read, never the source horizon or a permission boundary. */
|
|
740
|
+
observedThroughSeq: z.number().int().nonnegative().nullable().describe("Last source-read scan cursor; not the source horizon or an access limit."),
|
|
739
741
|
modelConfig: modelConfigSchema
|
|
740
742
|
}).strict();
|
|
741
743
|
const messageAttachmentSchema = z.object({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirkchinese/dsh-citeciter",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Source-aware native DSH Topics with manual drafts, permissions, visual boards and learning cards",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -83,17 +83,6 @@
|
|
|
83
83
|
"cordis.patch.yml",
|
|
84
84
|
"README.zh.md"
|
|
85
85
|
],
|
|
86
|
-
"scripts": {
|
|
87
|
-
"build": "npm run build:lib && npm run build:bundle",
|
|
88
|
-
"prebuild:lib": "node scripts/clean-types.mjs",
|
|
89
|
-
"build:lib": "tsc -p tsconfig.host.json && tsc -p tsconfig.client.json",
|
|
90
|
-
"prebuild:bundle": "node scripts/clean-bundle.mjs",
|
|
91
|
-
"build:bundle": "tsdown --env.DSH_BUILD_FACE client",
|
|
92
|
-
"postbuild:bundle": "node scripts/normalize-bundle.mjs",
|
|
93
|
-
"prepack": "npm run build",
|
|
94
|
-
"dev": "npm run build && node dev/watch.mjs",
|
|
95
|
-
"typecheck": "tsc -p tsconfig.host.json --noEmit && tsc -p tsconfig.client.json --noEmit"
|
|
96
|
-
},
|
|
97
86
|
"peerDependencies": {
|
|
98
87
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
99
88
|
"@deepseek-ai/dsh-agent": "0.1.5-rc.1",
|
|
@@ -189,5 +178,15 @@
|
|
|
189
178
|
"@deepseek-ai/dsh-util-values": "0.1.5-rc.1",
|
|
190
179
|
"html-to-image": "1.11.13",
|
|
191
180
|
"katex": "^0.18.4"
|
|
181
|
+
},
|
|
182
|
+
"scripts": {
|
|
183
|
+
"build": "npm run build:lib && npm run build:bundle",
|
|
184
|
+
"prebuild:lib": "node scripts/clean-types.mjs",
|
|
185
|
+
"build:lib": "tsc -p tsconfig.host.json && tsc -p tsconfig.client.json",
|
|
186
|
+
"prebuild:bundle": "node scripts/clean-bundle.mjs",
|
|
187
|
+
"build:bundle": "tsdown --env.DSH_BUILD_FACE client",
|
|
188
|
+
"postbuild:bundle": "node scripts/normalize-bundle.mjs",
|
|
189
|
+
"dev": "npm run build && node dev/watch.mjs",
|
|
190
|
+
"typecheck": "tsc -p tsconfig.host.json --noEmit && tsc -p tsconfig.client.json --noEmit"
|
|
192
191
|
}
|
|
193
|
-
}
|
|
192
|
+
}
|