dsh-palace 0.0.0-stage → 1.0.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.
Files changed (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +132 -2
  3. package/client/client.js +728 -0
  4. package/cordis.patch.yml +4 -0
  5. package/lib/index.js +1900 -0
  6. package/package.json +74 -4
  7. package/vendor/epub.LICENSE.txt +27 -0
  8. package/vendor/epub.min.js +1 -0
  9. package/vendor/fonts/OFL.txt +192 -0
  10. package/vendor/fonts/eb-garamond-latin-400-normal.woff2 +0 -0
  11. package/vendor/fonts/eb-garamond-latin-ext-400-normal.woff2 +0 -0
  12. package/vendor/fonts/fonts.css +103 -0
  13. package/vendor/fonts/noto-serif-sc-100-400-normal.woff2 +0 -0
  14. package/vendor/fonts/noto-serif-sc-101-400-normal.woff2 +0 -0
  15. package/vendor/fonts/noto-serif-sc-102-400-normal.woff2 +0 -0
  16. package/vendor/fonts/noto-serif-sc-103-400-normal.woff2 +0 -0
  17. package/vendor/fonts/noto-serif-sc-104-400-normal.woff2 +0 -0
  18. package/vendor/fonts/noto-serif-sc-105-400-normal.woff2 +0 -0
  19. package/vendor/fonts/noto-serif-sc-106-400-normal.woff2 +0 -0
  20. package/vendor/fonts/noto-serif-sc-107-400-normal.woff2 +0 -0
  21. package/vendor/fonts/noto-serif-sc-108-400-normal.woff2 +0 -0
  22. package/vendor/fonts/noto-serif-sc-109-400-normal.woff2 +0 -0
  23. package/vendor/fonts/noto-serif-sc-110-400-normal.woff2 +0 -0
  24. package/vendor/fonts/noto-serif-sc-111-400-normal.woff2 +0 -0
  25. package/vendor/fonts/noto-serif-sc-112-400-normal.woff2 +0 -0
  26. package/vendor/fonts/noto-serif-sc-113-400-normal.woff2 +0 -0
  27. package/vendor/fonts/noto-serif-sc-114-400-normal.woff2 +0 -0
  28. package/vendor/fonts/noto-serif-sc-115-400-normal.woff2 +0 -0
  29. package/vendor/fonts/noto-serif-sc-116-400-normal.woff2 +0 -0
  30. package/vendor/fonts/noto-serif-sc-117-400-normal.woff2 +0 -0
  31. package/vendor/fonts/noto-serif-sc-118-400-normal.woff2 +0 -0
  32. package/vendor/fonts/noto-serif-sc-119-400-normal.woff2 +0 -0
  33. package/vendor/fonts/noto-serif-sc-21-400-normal.woff2 +0 -0
  34. package/vendor/fonts/noto-serif-sc-22-400-normal.woff2 +0 -0
  35. package/vendor/fonts/noto-serif-sc-23-400-normal.woff2 +0 -0
  36. package/vendor/fonts/noto-serif-sc-24-400-normal.woff2 +0 -0
  37. package/vendor/fonts/noto-serif-sc-25-400-normal.woff2 +0 -0
  38. package/vendor/fonts/noto-serif-sc-26-400-normal.woff2 +0 -0
  39. package/vendor/fonts/noto-serif-sc-27-400-normal.woff2 +0 -0
  40. package/vendor/fonts/noto-serif-sc-28-400-normal.woff2 +0 -0
  41. package/vendor/fonts/noto-serif-sc-29-400-normal.woff2 +0 -0
  42. package/vendor/fonts/noto-serif-sc-30-400-normal.woff2 +0 -0
  43. package/vendor/fonts/noto-serif-sc-31-400-normal.woff2 +0 -0
  44. package/vendor/fonts/noto-serif-sc-32-400-normal.woff2 +0 -0
  45. package/vendor/fonts/noto-serif-sc-33-400-normal.woff2 +0 -0
  46. package/vendor/fonts/noto-serif-sc-34-400-normal.woff2 +0 -0
  47. package/vendor/fonts/noto-serif-sc-35-400-normal.woff2 +0 -0
  48. package/vendor/fonts/noto-serif-sc-36-400-normal.woff2 +0 -0
  49. package/vendor/fonts/noto-serif-sc-37-400-normal.woff2 +0 -0
  50. package/vendor/fonts/noto-serif-sc-38-400-normal.woff2 +0 -0
  51. package/vendor/fonts/noto-serif-sc-39-400-normal.woff2 +0 -0
  52. package/vendor/fonts/noto-serif-sc-4-400-normal.woff2 +0 -0
  53. package/vendor/fonts/noto-serif-sc-40-400-normal.woff2 +0 -0
  54. package/vendor/fonts/noto-serif-sc-41-400-normal.woff2 +0 -0
  55. package/vendor/fonts/noto-serif-sc-42-400-normal.woff2 +0 -0
  56. package/vendor/fonts/noto-serif-sc-43-400-normal.woff2 +0 -0
  57. package/vendor/fonts/noto-serif-sc-44-400-normal.woff2 +0 -0
  58. package/vendor/fonts/noto-serif-sc-45-400-normal.woff2 +0 -0
  59. package/vendor/fonts/noto-serif-sc-46-400-normal.woff2 +0 -0
  60. package/vendor/fonts/noto-serif-sc-47-400-normal.woff2 +0 -0
  61. package/vendor/fonts/noto-serif-sc-48-400-normal.woff2 +0 -0
  62. package/vendor/fonts/noto-serif-sc-49-400-normal.woff2 +0 -0
  63. package/vendor/fonts/noto-serif-sc-5-400-normal.woff2 +0 -0
  64. package/vendor/fonts/noto-serif-sc-50-400-normal.woff2 +0 -0
  65. package/vendor/fonts/noto-serif-sc-51-400-normal.woff2 +0 -0
  66. package/vendor/fonts/noto-serif-sc-52-400-normal.woff2 +0 -0
  67. package/vendor/fonts/noto-serif-sc-53-400-normal.woff2 +0 -0
  68. package/vendor/fonts/noto-serif-sc-54-400-normal.woff2 +0 -0
  69. package/vendor/fonts/noto-serif-sc-55-400-normal.woff2 +0 -0
  70. package/vendor/fonts/noto-serif-sc-56-400-normal.woff2 +0 -0
  71. package/vendor/fonts/noto-serif-sc-57-400-normal.woff2 +0 -0
  72. package/vendor/fonts/noto-serif-sc-58-400-normal.woff2 +0 -0
  73. package/vendor/fonts/noto-serif-sc-59-400-normal.woff2 +0 -0
  74. package/vendor/fonts/noto-serif-sc-6-400-normal.woff2 +0 -0
  75. package/vendor/fonts/noto-serif-sc-60-400-normal.woff2 +0 -0
  76. package/vendor/fonts/noto-serif-sc-61-400-normal.woff2 +0 -0
  77. package/vendor/fonts/noto-serif-sc-62-400-normal.woff2 +0 -0
  78. package/vendor/fonts/noto-serif-sc-63-400-normal.woff2 +0 -0
  79. package/vendor/fonts/noto-serif-sc-64-400-normal.woff2 +0 -0
  80. package/vendor/fonts/noto-serif-sc-65-400-normal.woff2 +0 -0
  81. package/vendor/fonts/noto-serif-sc-66-400-normal.woff2 +0 -0
  82. package/vendor/fonts/noto-serif-sc-67-400-normal.woff2 +0 -0
  83. package/vendor/fonts/noto-serif-sc-68-400-normal.woff2 +0 -0
  84. package/vendor/fonts/noto-serif-sc-69-400-normal.woff2 +0 -0
  85. package/vendor/fonts/noto-serif-sc-70-400-normal.woff2 +0 -0
  86. package/vendor/fonts/noto-serif-sc-71-400-normal.woff2 +0 -0
  87. package/vendor/fonts/noto-serif-sc-72-400-normal.woff2 +0 -0
  88. package/vendor/fonts/noto-serif-sc-73-400-normal.woff2 +0 -0
  89. package/vendor/fonts/noto-serif-sc-74-400-normal.woff2 +0 -0
  90. package/vendor/fonts/noto-serif-sc-75-400-normal.woff2 +0 -0
  91. package/vendor/fonts/noto-serif-sc-76-400-normal.woff2 +0 -0
  92. package/vendor/fonts/noto-serif-sc-77-400-normal.woff2 +0 -0
  93. package/vendor/fonts/noto-serif-sc-78-400-normal.woff2 +0 -0
  94. package/vendor/fonts/noto-serif-sc-79-400-normal.woff2 +0 -0
  95. package/vendor/fonts/noto-serif-sc-80-400-normal.woff2 +0 -0
  96. package/vendor/fonts/noto-serif-sc-81-400-normal.woff2 +0 -0
  97. package/vendor/fonts/noto-serif-sc-82-400-normal.woff2 +0 -0
  98. package/vendor/fonts/noto-serif-sc-83-400-normal.woff2 +0 -0
  99. package/vendor/fonts/noto-serif-sc-84-400-normal.woff2 +0 -0
  100. package/vendor/fonts/noto-serif-sc-85-400-normal.woff2 +0 -0
  101. package/vendor/fonts/noto-serif-sc-86-400-normal.woff2 +0 -0
  102. package/vendor/fonts/noto-serif-sc-87-400-normal.woff2 +0 -0
  103. package/vendor/fonts/noto-serif-sc-88-400-normal.woff2 +0 -0
  104. package/vendor/fonts/noto-serif-sc-89-400-normal.woff2 +0 -0
  105. package/vendor/fonts/noto-serif-sc-90-400-normal.woff2 +0 -0
  106. package/vendor/fonts/noto-serif-sc-91-400-normal.woff2 +0 -0
  107. package/vendor/fonts/noto-serif-sc-97-400-normal.woff2 +0 -0
  108. package/vendor/fonts/noto-serif-sc-98-400-normal.woff2 +0 -0
  109. package/vendor/fonts/noto-serif-sc-99-400-normal.woff2 +0 -0
  110. package/vendor/fonts/noto-serif-sc-cyrillic-400-normal.woff2 +0 -0
  111. package/vendor/fonts/noto-serif-sc-latin-400-normal.woff2 +0 -0
  112. package/vendor/fonts/noto-serif-sc-latin-ext-400-normal.woff2 +0 -0
  113. package/vendor/fonts/noto-serif-sc-vietnamese-400-normal.woff2 +0 -0
  114. package/vendor/icons/README.md +2 -0
  115. package/vendor/icons/black-swan.webp +0 -0
  116. package/vendor/icons/earth.webp +0 -0
  117. package/vendor/icons/gold-coin.webp +0 -0
  118. package/vendor/icons/lotus-leaf.webp +0 -0
  119. package/vendor/icons/mars.webp +0 -0
  120. package/vendor/icons/mercury.webp +0 -0
  121. package/vendor/icons/moon.webp +0 -0
  122. package/vendor/icons/open-book.webp +0 -0
  123. package/vendor/icons/orange.webp +0 -0
  124. package/vendor/icons/pufferfish.webp +0 -0
  125. package/vendor/icons/rainbow.webp +0 -0
  126. package/vendor/icons/shell.webp +0 -0
  127. package/vendor/icons/snow-mountain.webp +0 -0
  128. package/vendor/icons/sun.webp +0 -0
  129. package/vendor/icons/teardrop.webp +0 -0
  130. package/vendor/icons/venus.webp +0 -0
  131. package/vendor/jszip.LICENSE.md +651 -0
  132. package/vendor/jszip.min.js +13 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-palace contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,133 @@
1
- # Temporary Holding Version
1
+ # dsh-palace
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm](https://img.shields.io/npm/v/dsh-palace)](https://www.npmjs.com/package/dsh-palace)
4
+
5
+ > Memory Palace:DeepSeek Harness 的读书插件。把书、视频课和笔记放进一座水彩宫殿,你只管记,AI 帮你整理。
6
+
7
+ 装好后,它在 Harness 里显示为 **Memory Palace**(记忆宫殿)。`dsh-palace` 是它在 npm 上的包名,安装时要输入这个名字。
8
+
9
+ 它适合任何「边读边记」的人:读闲书、啃教材、看网课、备考刷题都行。你不用操心怎么分类、怎么排计划,记下来就好,剩下的交给 AI。
10
+
11
+ ## 目录
12
+
13
+ - [背景](#背景)
14
+ - [安装](#安装)
15
+ - [使用](#使用)
16
+ - [数据存在哪](#数据存在哪)
17
+ - [常见问题](#常见问题)
18
+ - [维护者](#维护者)
19
+ - [参与贡献](#参与贡献)
20
+ - [许可证](#许可证)
21
+
22
+ ## 背景
23
+
24
+ 「记忆宫殿」是一种古老的记忆方法:把要记的东西放进脑海里一座房子的各个房间。这个插件把它画成了真的宫殿:
25
+
26
+ - **宫殿**:每本书、每门视频课、每条笔记各占一格。拖动可以排位置;把一格拖到另一格上,就合成一个分组。每格上的圆环显示读了多少。
27
+ - **立体视图**:点右下角「轴测」(或按键盘 `I`),宫殿会立起来,相关的书之间会连上电弧。鼠标停在格子上,能看到它们为什么相关。
28
+ - **阅览室**:点开一格,就进入这本书的房间,里面有三页:
29
+ - **进度**:目录、读到哪、目标完成日期。落后了会自动重算每天该读多少。
30
+ - **卡片**:摘录(书里的原话)、想法(你自己的话)、错题(做错的题)。
31
+ - **灵感**:和 AI 聊完这本书,一键把这次对话总结成一篇短文存下来。
32
+ - **读书**:EPUB 电子书直接在格子里读,点一个词就能翻译。PDF 用你电脑上的阅读器打开,B 站视频课用浏览器打开,看完回来打勾。
33
+ - **AI 对话**:宫殿和每本书都能和 AI 聊(用的就是 Harness 自己的对话)。AI 会记住你读过什么、想过什么,帮你在书和书之间找联系。
34
+
35
+ ## 安装
36
+
37
+ **你需要**:电脑上装好 DeepSeek Harness 桌面版(0.2.x)。
38
+
39
+ 1. 打开 Harness,进入插件安装界面。
40
+ 2. 输入 `dsh-palace`,点安装。
41
+ 3. 完全退出 Harness,再重新打开。
42
+ 4. 左侧导航出现「Memory Palace」,就装好了。
43
+
44
+ > **用过测试版 `dsh-shelf` 的朋友**:先卸载 `dsh-shelf`,再按上面的步骤安装 `dsh-palace`。你原来的书、笔记和对话会自动保留(数据继续放在原来的 `dsh-shelf-data` 文件夹里),不用重新添加。如果你以前在 `cordis.patch.yml` 里给 `dsh-shelf` 设过 `dataDir`,记得把同样的路径填到 `dsh-palace` 的条目下(见[数据存在哪](#数据存在哪))。
45
+
46
+ ## 使用
47
+
48
+ ### 第一次打开
49
+
50
+ 有三个入口,打开的是同一座宫殿:
51
+
52
+ - 左侧导航的「Memory Palace」:全屏打开,看得最清楚;
53
+ - 对话标题栏右侧的书本按钮:一边聊天一边看;
54
+ - 右侧栏的「Memory Palace」卡片。
55
+
56
+ ### 放进第一本书
57
+
58
+ 1. 点右下角的 **+**。
59
+ 2. 选一个文件(PDF 或 EPUB),或者粘贴一个 B 站视频链接,也可以只写一条笔记。
60
+ 3. 插件只记住文件在哪,**不会复制、也不会改动你的文件**。
61
+
62
+ ### 读书和记笔记
63
+
64
+ 1. 点开一格,进入阅览室。
65
+ 2. 读完一节,在「进度」里打个勾;鼠标移到某一节点「学到这里」,前面的会一起勾上。
66
+ 3. 想记点什么,在「卡片」里写下来,或者直接跟 AI 说。
67
+ 4. 点阅览室左边的 **AI**,和这本书聊聊;聊完点「把这次对话存成灵感」。
68
+
69
+ ### 直接跟 AI 说也行
70
+
71
+ 不想点按钮,可以在对话里直接说:
72
+
73
+ - 「把 ~/Documents/反脆弱.epub 放进宫殿」
74
+ - 「这个视频课加进来:https://www.bilibili.com/video/BV…」
75
+ - 「《刑法讲义》的目录在第 5 到 12 页,帮我生成目录」
76
+ - 「我 2027 年 9 月考试,帮我把这几本书排一下目标日期」
77
+ - 「这本书和《反脆弱》有什么联系?」
78
+ - 记错题:把错题截图粘贴到这本书的对话里,说「记错题」。
79
+
80
+ ## 数据存在哪
81
+
82
+ 所有数据都在你自己的电脑上,默认放在 `~/Documents/dsh-palace-data/`(「文稿」文件夹里的 `dsh-palace-data`;用过测试版的是原来的 `dsh-shelf-data`)。都是普通文件,复制这个文件夹就是备份:
83
+
84
+ - `palace.json`:宫殿里每一格的位置
85
+ - `items/`:每一格的目录、进度、卡片和灵感
86
+ - `images/`:错题截图
87
+ - `memory/`:AI 的记忆(你读过什么、想过什么)
88
+
89
+ 想换个位置存放,可以在 Harness profile 的 `cordis.patch.yml` 里加上:
90
+
91
+ ```yaml
92
+ - id: dsh-palace
93
+ name: dsh-palace
94
+ config:
95
+ dataDir: /你想要的/目录
96
+ ```
97
+
98
+ ## 常见问题
99
+
100
+ **PDF 没有目录怎么办?** 扫描版 PDF 常常没有目录。进入这本书,在缩略图里勾选目录所在的几页,AI 只读这几页就能生成目录,不用把整本书交给 AI。
101
+
102
+ **目录或错题识别不出来?** 当前选用的 AI 模型要支持看图。也可以自己截图发给 AI,说「生成《某书》的目录」。
103
+
104
+ **错题截图没存上?** 截图要直接粘贴在对话里。截图没存上时,题目文字也照样会记下来。
105
+
106
+ **界面字体需要另外装吗?** 不用。插件自带思源宋体和 EB Garamond。
107
+
108
+ ## 维护者
109
+
110
+ - [@feolhn](https://github.com/feolhn):开发
111
+ - [@bbhh1226](https://github.com/bbhh1226):界面与交互设计
112
+
113
+ ## 参与贡献
114
+
115
+ 仓库目前还没有公开。公开后欢迎提 Issue 和 Pull Request。
116
+
117
+ 想自己改代码的话:
118
+
119
+ ```sh
120
+ pnpm install
121
+ pnpm run setup # 启用提交前的个人信息检查(只需一次)
122
+ pnpm build # 生成 lib/(Host)和 client/(前端)
123
+ pnpm test # 测试(core / host / AI 工具)
124
+ pnpm verify # 合并前跑:类型检查 + 测试 + 个人信息检查 + 构建
125
+ ```
126
+
127
+ 从源码安装:先 `pnpm build`,再在插件安装界面填仓库文件夹的完整路径。每次改完代码都要重新 `pnpm build`,再重启 Harness。开发文档见 [WORK.md](WORK.md),接口约定见 [docs/CONTRACT.md](docs/CONTRACT.md)。
128
+
129
+ ## 许可证
130
+
131
+ [MIT](LICENSE) © 2026 dsh-palace contributors
132
+
133
+ 内置字体(思源宋体、EB Garamond)使用 [SIL OFL 1.1](vendor/fonts/OFL.txt)。