@kirkchinese/dsh-citeciter 0.8.0 → 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.
@@ -1,4 +1,4 @@
1
- import { f as citeCiterRequestSchema, p as citeCiterResponseSchema, r as updateCheckResponseSchema } from "./update-0LcFDvI5.js";
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 = {
@@ -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-0LcFDvI5.js";
2
- import { n as updateCheckDescriptor, t as citeCiterRequestDescriptor } from "./typert-common-DxE1_Bn_.js";
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-DxE1_Bn_.js";
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 = {
@@ -10,6 +10,12 @@ export interface HostAgentModules {
10
10
  readonly SessionStore: typeof SessionStore;
11
11
  readonly createScope: (ctx: Context, key: object) => HostScope;
12
12
  }
13
- /** Resolve published runtime modules from the actual launcher, preserving Desktop's module identities across external-plugin fallback paths. */
13
+ /**
14
+ * Resolve runtime modules from the host installation, not the plugin's dependencies.
15
+ * CLI argv can name an npm/pnpm symlink; canonicalize it before walking node_modules.
16
+ * Desktop retains its app.asar anchor and module identities without filesystem realpath.
17
+ * @returns the host's AgentLoop, SessionStore and scope factory.
18
+ * @throws when the launcher cannot be located or its runtime exports are unavailable.
19
+ */
14
20
  export declare function loadHostAgentModules(): Promise<HostAgentModules>;
15
21
  export {};
@@ -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 one seq range without exposing chunks or exceeding the event-array byte budget. */
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
- private sourceTool;
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
- observedThroughSeq: z.number().int().nonnegative().nullable().optional()
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
- observedThroughSeq: z.number().int().nonnegative().nullable(),
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.0",
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
+ }