@kirkchinese/dsh-citeciter 0.4.3 → 0.6.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 +65 -64
- package/README.zh.md +65 -64
- package/lib/client.js +32195 -2477
- package/lib/index.js +1300 -149
- package/lib/{typert-common-4_cbghYz.js → typert-common-C6yTitXx.js} +23 -3
- package/lib/typert.host.js +7 -3
- package/lib/typert.remote-client.js +2 -2
- package/lib/types/board.d.ts +237 -0
- package/lib/types/client/companion-controller.d.ts +15 -6
- package/lib/types/client/components/BlackboardWorkspace.d.ts +18 -0
- package/lib/types/client/components/BoardView.d.ts +12 -0
- package/lib/types/client/components/CiteCiterSettings.d.ts +12 -5
- package/lib/types/client/components/CitePanel.d.ts +14 -6
- package/lib/types/client/components/DocumentReader.d.ts +8 -0
- package/lib/types/client/components/QuestionCard.d.ts +2 -2
- package/lib/types/client/components/SelectionMenu.d.ts +14 -6
- package/lib/types/client/components/UpdateNotice.d.ts +14 -0
- package/lib/types/client/conversation-dom.d.ts +9 -1
- package/lib/types/client/copy.d.ts +6 -0
- package/lib/types/client/dock-geometry.d.ts +23 -0
- package/lib/types/client/entries.d.ts +61 -0
- package/lib/types/client/entry-ids.d.ts +3 -0
- package/lib/types/client/host-dock.d.ts +18 -0
- package/lib/types/client/hotkeys.d.ts +19 -0
- package/lib/types/client/reader-controller.d.ts +33 -0
- package/lib/types/client/reader-selection.d.ts +12 -0
- package/lib/types/client/request-guard.d.ts +24 -1
- package/lib/types/client/rich-content.d.ts +6 -0
- package/lib/types/client/selection.d.ts +5 -3
- package/lib/types/client/topic-presentation.d.ts +15 -0
- package/lib/types/client/types.d.ts +37 -2
- package/lib/types/client/update-controller.d.ts +59 -0
- package/lib/types/client/view-actions.d.ts +26 -0
- package/lib/types/documents.d.ts +45 -0
- package/lib/types/evidence-text.d.ts +29 -0
- package/lib/types/index.d.ts +14 -15
- package/lib/types/observer.d.ts +28 -2
- package/lib/types/service.d.ts +81 -0
- package/lib/types/topic-runtime.d.ts +305 -7
- package/lib/types/topic.d.ts +604 -43
- package/lib/types/typert-common.d.ts +279 -11
- package/lib/types/typert.host.d.ts +671 -34
- package/lib/types/typert.remote-client.d.ts +3 -0
- package/lib/types/update.d.ts +69 -0
- package/lib/update-C0K5ekMg.js +1073 -0
- package/package.json +87 -79
- package/lib/topic-BVNCaVbJ.js +0 -307
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
2
2
|
import type { CiteCiterRequest, CiteCiterResponse } from './topic.ts';
|
|
3
|
+
import type { UpdateCheckResponse } from './update.ts';
|
|
3
4
|
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
4
5
|
interface CiteCiterRemoteNamespace {
|
|
5
6
|
request: (request: CiteCiterRequest, signal?: AbortSignal) => Promise<RemoteResult<CiteCiterResponse>>;
|
|
7
|
+
checkUpdate: (signal?: AbortSignal) => Promise<RemoteResult<UpdateCheckResponse>>;
|
|
6
8
|
}
|
|
7
9
|
interface TypertRemoteMap {
|
|
8
10
|
'citeciter/request': CiteCiterRemoteNamespace['request'];
|
|
11
|
+
'citeciter/checkUpdate': CiteCiterRemoteNamespace['checkUpdate'];
|
|
9
12
|
}
|
|
10
13
|
interface TypertRemoteNamespaceMap {
|
|
11
14
|
citeciter: CiteCiterRemoteNamespace;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** Bounded, read-only npm update check for the Web plugin. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/** Fixed registry document used to resolve the installable `latest` version. */
|
|
4
|
+
export declare const CITECITER_NPM_LATEST_URL: "https://registry.npmjs.org/@kirkchinese%2fdsh-citeciter/latest";
|
|
5
|
+
/** Successful checks remain fresh for six hours in one Host process. */
|
|
6
|
+
export declare const UPDATE_CHECK_TTL_MS: number;
|
|
7
|
+
/** Stable failure identifiers consumed by the Web settings and notification UI. */
|
|
8
|
+
export declare const updateCheckErrorCodeSchema: z.ZodEnum<{
|
|
9
|
+
"installed-version-invalid": "installed-version-invalid";
|
|
10
|
+
"registry-timeout": "registry-timeout";
|
|
11
|
+
"registry-network": "registry-network";
|
|
12
|
+
"registry-http": "registry-http";
|
|
13
|
+
"registry-response-too-large": "registry-response-too-large";
|
|
14
|
+
"registry-response-invalid": "registry-response-invalid";
|
|
15
|
+
"registry-version-invalid": "registry-version-invalid";
|
|
16
|
+
}>;
|
|
17
|
+
/** Failure identifier returned instead of exposing transport-specific messages. */
|
|
18
|
+
export type UpdateCheckErrorCode = z.infer<typeof updateCheckErrorCodeSchema>;
|
|
19
|
+
/** Strict result of one read-only npm `latest` check. */
|
|
20
|
+
export declare const updateCheckResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
+
kind: z.ZodLiteral<"success">;
|
|
22
|
+
installedVersion: z.ZodString;
|
|
23
|
+
latestVersion: z.ZodString;
|
|
24
|
+
updateAvailable: z.ZodBoolean;
|
|
25
|
+
checkedAt: z.ZodNumber;
|
|
26
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
28
|
+
kind: z.ZodLiteral<"error">;
|
|
29
|
+
code: z.ZodEnum<{
|
|
30
|
+
"installed-version-invalid": "installed-version-invalid";
|
|
31
|
+
"registry-timeout": "registry-timeout";
|
|
32
|
+
"registry-network": "registry-network";
|
|
33
|
+
"registry-http": "registry-http";
|
|
34
|
+
"registry-response-too-large": "registry-response-too-large";
|
|
35
|
+
"registry-response-invalid": "registry-response-invalid";
|
|
36
|
+
"registry-version-invalid": "registry-version-invalid";
|
|
37
|
+
}>;
|
|
38
|
+
checkedAt: z.ZodNumber;
|
|
39
|
+
}, z.core.$strict>], "kind">;
|
|
40
|
+
/** Browser-facing update result; this operation never installs or restarts anything. */
|
|
41
|
+
export type UpdateCheckResponse = z.infer<typeof updateCheckResponseSchema>;
|
|
42
|
+
/**
|
|
43
|
+
* Compare stable versions without accepting prerelease or build suffixes.
|
|
44
|
+
* @param left - first candidate version.
|
|
45
|
+
* @param right - second candidate version.
|
|
46
|
+
* @returns negative, zero, or positive for valid versions; otherwise `null`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function compareStableVersions(left: string, right: string): -1 | 0 | 1 | null;
|
|
49
|
+
/** Per-Host update checker with bounded I/O and a successful-result TTL cache. */
|
|
50
|
+
export declare class UpdateChecker {
|
|
51
|
+
private readonly fetchImpl;
|
|
52
|
+
private readonly now;
|
|
53
|
+
private readonly installedVersion;
|
|
54
|
+
private cached;
|
|
55
|
+
private inFlight;
|
|
56
|
+
/**
|
|
57
|
+
* @param fetchImpl - HTTPS transport; injectable for deterministic tests.
|
|
58
|
+
* @param now - wall-clock provider used for response timestamps and cache expiry.
|
|
59
|
+
* @param installedVersion - installed package-version reader.
|
|
60
|
+
*/
|
|
61
|
+
constructor(fetchImpl?: typeof globalThis.fetch, now?: () => number, installedVersion?: () => Promise<string>);
|
|
62
|
+
/**
|
|
63
|
+
* Read npm's installable latest version without mutating the installation.
|
|
64
|
+
* @param callerSignal - Remote caller cancellation.
|
|
65
|
+
* @returns a strict success or stable classified failure.
|
|
66
|
+
*/
|
|
67
|
+
check(callerSignal: AbortSignal): Promise<UpdateCheckResponse>;
|
|
68
|
+
private checkFresh;
|
|
69
|
+
}
|