weread-export 0.1.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.
@@ -0,0 +1,63 @@
1
+ /**
2
+ * weread-export — model-facing tools.
3
+ *
4
+ * Mounted via ctx.tools.register. Covers the WeRead surface: status,
5
+ * config, search, book info, shelf, notes/highlights, reading stats,
6
+ * cache sync, and multi-target export (flomo / local file / Notion) with
7
+ * optional LLM prompt processing. Every tool resolves to { ok, message, ... }
8
+ * and never throws for API-level outcomes.
9
+ */
10
+ import type { WereadStore } from './store.ts';
11
+ import type { ExportDest } from './store.ts';
12
+ /** Shared tool dependencies. */
13
+ export interface ToolContext {
14
+ store: WereadStore;
15
+ }
16
+ /** Status tool: configuration + cache + export targets. */
17
+ export declare function wereadStatusTool(ctx: ToolContext): import("@deepseek-ai/dsh-tools").ToolDefinition;
18
+ /** Config tool: set/clear the API key, default flomo tag, and export limit. */
19
+ export declare function wereadConfigTool(ctx: ToolContext): import("@deepseek-ai/dsh-tools").ToolDefinition;
20
+ /** Search tool: book store search. */
21
+ export declare function wereadSearchTool(ctx: ToolContext): import("@deepseek-ai/dsh-tools").ToolDefinition;
22
+ /** Book tool: metadata + progress + chapter catalog summary. */
23
+ export declare function wereadBookTool(ctx: ToolContext): import("@deepseek-ai/dsh-tools").ToolDefinition;
24
+ /** Shelf tool: live bookshelf (optionally from cache). */
25
+ export declare function wereadShelfTool(ctx: ToolContext): import("@deepseek-ai/dsh-tools").ToolDefinition;
26
+ /** Notes tool: notebook overview or per-book highlights + thoughts. */
27
+ export declare function wereadNotesTool(ctx: ToolContext): import("@deepseek-ai/dsh-tools").ToolDefinition;
28
+ /** Readdata tool: reading statistics. */
29
+ export declare function wereadReaddataTool(ctx: ToolContext): import("@deepseek-ai/dsh-tools").ToolDefinition;
30
+ /** Sync tool: pull shelf + notebooks into the local cache. */
31
+ export declare function wereadSyncTool(ctx: ToolContext): import("@deepseek-ai/dsh-tools").ToolDefinition;
32
+ /** Shared export request. */
33
+ export interface ExportRequest {
34
+ bookId?: string;
35
+ dest?: ExportDest;
36
+ localDir?: string;
37
+ tag?: string;
38
+ prompt?: string;
39
+ usePrompt?: boolean;
40
+ limit?: number;
41
+ }
42
+ /** Export result shape. */
43
+ export interface ExportResult {
44
+ ok: boolean;
45
+ message: string;
46
+ dest: ExportDest;
47
+ sent?: number;
48
+ file?: string;
49
+ pageId?: string;
50
+ memoCount?: number;
51
+ bookId?: string;
52
+ }
53
+ /**
54
+ * Core export pipeline: pull highlights (+ thoughts), optionally process
55
+ * through the LLM prompt, then deliver to flomo / local file / Notion.
56
+ */
57
+ export declare function runExport(ctx: ToolContext, req: ExportRequest): Promise<ExportResult>;
58
+ /** Multi-target export tool: flomo / local file / Notion + optional prompt. */
59
+ export declare function wereadExportTool(ctx: ToolContext): import("@deepseek-ai/dsh-tools").ToolDefinition;
60
+ /** Flomo tool: convenience wrapper around weread_export with dest=flomo. */
61
+ export declare function wereadFlomoTool(ctx: ToolContext): import("@deepseek-ai/dsh-tools").ToolDefinition;
62
+ /** Build every weread tool. */
63
+ export declare function buildTools(ctx: ToolContext): import("@deepseek-ai/dsh-tools").ToolDefinition[];
package/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "weread-export",
3
+ "version": "0.1.2",
4
+ "description": "微信读书 (WeChat Reading) integration for DeepSeek Harness: connect the official WeRead Skills Agent Gateway with a wrk- API key, then browse your bookshelf, export highlights & thoughts, query reading stats, and send highlights to flomo — agent tools plus a web settings panel",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "exports": {
8
+ ".": "./lib/index.js",
9
+ "./client": "./lib/client.js",
10
+ "./package.json": "./package.json"
11
+ },
12
+ "dsh": {
13
+ "bundle": {
14
+ "patch": "./cordis.patch.yml"
15
+ },
16
+ "client": {
17
+ "inject": [
18
+ "@deepseek-ai/dsh-client-runtime",
19
+ "@deepseek-ai/dsh-client-connection",
20
+ "@deepseek-ai/dsh-client-ui-settings"
21
+ ],
22
+ "platform": "web"
23
+ }
24
+ },
25
+ "files": [
26
+ "lib",
27
+ "cordis.patch.yml",
28
+ "README.md",
29
+ "README.zh.md",
30
+ "LICENSE"
31
+ ],
32
+ "keywords": [
33
+ "dsh",
34
+ "dsh-plugin",
35
+ "deepseek-harness",
36
+ "weread",
37
+ "wechat-reading",
38
+ "微信读书",
39
+ "books",
40
+ "highlights",
41
+ "notes",
42
+ "reading"
43
+ ],
44
+ "license": "MIT",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/zhengjy01/weread-export"
48
+ },
49
+ "engines": {
50
+ "node": "^22.19.0 || >=24.0.0"
51
+ },
52
+ "scripts": {
53
+ "build": "tsc -p tsconfig.build.json && tsdown",
54
+ "bundle": "tsdown",
55
+ "watch": "tsdown --watch",
56
+ "typecheck": "tsc --noEmit"
57
+ },
58
+ "peerDependencies": {
59
+ "@deepseek-ai/cordis": "^4.0.1",
60
+ "@deepseek-ai/dsh-client-connection": "^0.1.0-rc.6",
61
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
62
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6",
63
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
64
+ "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.6",
65
+ "@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
66
+ "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
67
+ "react": "^18.2.0",
68
+ "react-dom": "^18.2.0"
69
+ },
70
+ "devDependencies": {
71
+ "@deepseek-ai/cordis": "^4.0.1",
72
+ "@deepseek-ai/dsh-client-connection": "^0.1.0-rc.6",
73
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
74
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6",
75
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
76
+ "@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.6",
77
+ "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
78
+ "@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
79
+ "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
80
+ "@types/node": "^22.20.0",
81
+ "@types/react": "~18.3.1",
82
+ "@types/react-dom": "^18.3.5",
83
+ "lightningcss": "1.32.0",
84
+ "react": "^18.3.1",
85
+ "react-dom": "^18.3.1",
86
+ "tsdown": "0.22.2",
87
+ "typescript": "~5.7.2"
88
+ }
89
+ }