dsh-fish-memory 1.4.6 → 1.4.7

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 (4) hide show
  1. package/LICENSE +50 -21
  2. package/README.md +3 -1
  3. package/lib/index.js +42 -3
  4. package/package.json +56 -56
package/LICENSE CHANGED
@@ -1,21 +1,50 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Yuuyuko
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.
1
+ Yuuyuko-uu 插件许可 1.2
2
+
3
+ 版权所有 (c) 2026 Yuuyuko-uu
4
+
5
+ ──────────────────────────────────────────────────────────────
6
+
7
+ 【为什么不用 MIT】
8
+
9
+ 2026 年 10 月,有人把我这几个插件(代码、README,还有我做的图)
10
+ 改名、去掉署名,在视频里说成「自研」发布。
11
+
12
+ 他没有违反 MIT —— MIT 只要求保留版权声明,不管「这是谁做的」。
13
+
14
+ 所以换成了这份许可。它只多要求一件事:
15
+ 你拿走的时候,说一声这是谁做的。
16
+
17
+ 安装、修改、商用,全都允许 —— 和 MIT 一样宽。
18
+
19
+ ──────────────────────────────────────────────────────────────
20
+
21
+ 一、允许,不需要另外问我
22
+
23
+ 1. 安装到自己的机器上使用,长期用,商用也行。
24
+ 2. 读源码、改源码、改成自己需要的版本(改给自己用,不必公开)。
25
+ 3. 把你的改动发给我(issue / PR);我采纳后,按仓库惯例记你的贡献。
26
+ 4. 在文章、视频、教程里介绍、演示、截图、引用本项目 —— 请附上原仓库地址。
27
+
28
+ 二、允许,但必须做到
29
+
30
+ 5. 再分发时(把代码或其实质性部分放进你自己的仓库、整合包、安装包,
31
+ 或者换一个包名发布),必须同时做到:
32
+ a) 完整保留本文件,不删、不改、不缩略;
33
+ b) 在 README 的第一屏写明:本项目派生自 <原仓库地址>,原作者 Yuuyuko-uu;
34
+ c) 说明你改了哪些部分。
35
+ 6. 公开的衍生作品必须继续使用本许可(或更严格的许可),不得改用更宽松的许可。
36
+
37
+ 三、禁止
38
+
39
+ 7. 不得把本项目的全部或实质性部分声称为你自己原创 ——
40
+ 包括在 README、发布说明、视频、插件市场条目里,
41
+ 把它写成「自研」「原创」「我写的」。
42
+ 8. 不得删除、替换、隐藏本项目的作者署名,
43
+ 包括 LICENSE、NOTICE、README、package.json 和源码注释里的。
44
+
45
+ 四、其他
46
+
47
+ 9. 本项目按「现状」提供,不附带任何明示或默示的担保。
48
+ 10. 违反第二、三条中任何一条,本许可立即终止;你还应当删除已发布的衍生作品。
49
+ 从违约那一刻起,你就不再拥有使用、复制、分发本项目的任何授权。
50
+ 11. 上面没写的情况想用,直接来问我,一般都会答应。
package/README.md CHANGED
@@ -279,7 +279,9 @@ dsh plugin --profile desktop add dsh-fish-memory
279
279
 
280
280
  ## 许可
281
281
 
282
- MIT
282
+ [Yuuyuko-uu 插件许可 1.0](./LICENSE):允许使用、修改、商用;
283
+ 再分发时要在 README 第一屏注明原仓库和原作者;禁止把本项目说成自己的原创。
284
+ 这份许可不是 OSI 认证的开源许可,用之前请读一遍全文。
283
285
 
284
286
  分词用的词表来自 [jieba](https://github.com/fxsjy/jieba) 的 `extra_dict/dict.txt.small`
285
287
  (MIT 协议),只保留了词条本身、去掉了词频和词性两列。
package/lib/index.js CHANGED
@@ -1917,6 +1917,12 @@ function 洗键系统(称呼, 已有键) {
1917
1917
  // ⚠ 讲第三方的事,对象写那个人,别一律写「她」
1918
1918
  // (跟提炼那边同一个道理:把第三方并进「她」,人和事就串了)
1919
1919
  '- ⚠ 讲**第三方**的(孩子、家里人、朋友、别的 AI),对象就写那个人,别一律写成「' + 她 + '」。\n' +
1920
+ // ⚠⚠ 1.4.7:**「助手自己」必须写成「我」**。
1921
+ // 这份提示词以前从头到尾只有「她.xxx」的例子,一个字都没提「我」——
1922
+ // 于是「我是谁」「我是怎么说话的」那两节的条目,键全被标成 ta.xxx,
1923
+ // 等于**把助手自己的事记成了她的**,两边一起乱。
1924
+ '- ⚠⚠ 讲**助手自己**的(我的名字、外形、说话方式、脾气、我自己定下的规矩、我的习惯),\n' +
1925
+ ' 对象必须写「我」,不许写成「' + 她 + '」。例:`我.名字`、`我.说话方式`、`我.脾气`。\n' +
1920
1926
  '输出格式严格是每行「编号|事实键」,不要解释、不要正文、不要别的格子。\n' +
1921
1927
  '例:\n' +
1922
1928
  '1|' + 她 + '个子不矮,量过是一米七。\n' +
@@ -2049,6 +2055,10 @@ export function 清掉注入上下文(文) {
2049
2055
  let 方块之后 = false
2050
2056
  const 元信息行 = /^(Current runtime context|Current DSH|Current working directory|Current DeepSeek Harness|Browser time zone|Time sampled|Elapsed since|Approval (policy|prompts))/i
2051
2057
  const 固定句 = /^(下面是你们过去真实发生过的事|(?如果此刻你想起什么|有时间的事会写在前面)/
2058
+ // ⭐ 1.4.7:**我们自己的**提醒块 —— 整块(一直到空行)都要跳。
2059
+ // 它里面是给模型的提醒,不是她说的话;而且它不一定带那句固定句,所以不能只丢表头。
2060
+ // ⚠ 别往里加别的插件的表头 —— 那些要「只丢表头、正文留下」(见下面那段注释)。
2061
+ const 整块跳 = /^【(你记得的事)】/
2052
2062
  for (const 行 of 行们) {
2053
2063
  const 净 = 行.trim()
2054
2064
  if (跳到空行) {
@@ -2065,7 +2075,22 @@ export function 清掉注入上下文(文) {
2065
2075
  continue
2066
2076
  }
2067
2077
  if (/^【[^】]{2,14}】/.test(净)) {
2068
- 跳到空行 = true
2078
+ // ⚠⚠ 1.4.7:原来这里无条件 `跳到空行 = true`,于是**表头下面紧跟正文、中间没有空行**的那种
2079
+ // 消息(QQ 桥转进来的就是 `【QQ私聊】\n正文`)会把**正文一起跳掉**,函数返回空串。
2080
+ // 后果不是「少一条线索」,是**整条消息一条记忆都召回不到**:
2081
+ // query 空 → 不召回、不写 trace、不打注入日志(表现就是 traces 永远是 [])。
2082
+ //
2083
+ // 现在分两种表头:
2084
+ // · 我们自己的提醒块(【你记得的事】)→ 照旧整块跳到空行(里面是提醒,不是她说的话);
2085
+ // · 别的插件加的来源头(【QQ私聊】/【QQ群 123…】/【本机注入…】)→ **只丢表头这一行**,
2086
+ // 正文留下当检索词。
2087
+ // ⚠ 代价说清楚:不认识的插件如果塞了「【标题】+ 一坨说明」又没空行隔开,那坨会漏进检索词。
2088
+ // 权衡下来这样更好 —— 漏一点顶多多一条词,整段跳掉是**完全不召回**。
2089
+ if (整块跳.test(净)) {
2090
+ 跳到空行 = true
2091
+ } else {
2092
+ 方块之后 = true
2093
+ }
2069
2094
  continue
2070
2095
  }
2071
2096
  if (固定句.test(净)) {
@@ -4747,6 +4772,21 @@ export function apply(ctx) {
4747
4772
  // ⚠ 切换本身**不搬动**记忆(此后读写的库换了,旧库还在原处)。
4748
4773
  // 要把同一个工作区里几间会话的记忆并成一份,用下面的 /merge-workspace。
4749
4774
  mroute('/dsh-fish-memory/mode', async (req, res) => {
4775
+ const 回 = (o) => {
4776
+ res.writeHead(200, { 'content-type': 'application/json; charset=utf-8' })
4777
+ res.end(JSON.stringify(o))
4778
+ }
4779
+ // ⚠ 1.4.7:这条路由以前**不分 GET / POST** —— 谁打进来都往下走,没请求体时
4780
+ // `b.模式` 是空串、被判成 'session',然后**把配置写回 session**。
4781
+ // 于是:切到「按工作区」之后,只要外面读一次状态(GET,没有 body),
4782
+ // 就被悄悄掰回「按会话」,界面看着就是「点了没反应 / 按钮一直灰」。
4783
+ // 现在只有 POST 才改;GET 只报当前值,不写盘。
4784
+ if (String(req.method || '').toUpperCase() !== 'POST') {
4785
+ let 当前 = 'session'
4786
+ try { 当前 = String(loadCfg().模式 || '') === 'workspace' ? 'workspace' : 'session' } catch (error) {}
4787
+ 回({ ok: true, 模式: 当前 })
4788
+ return
4789
+ }
4750
4790
  let body = ''
4751
4791
  for await (const chunk of req) body += chunk
4752
4792
  let b = {}
@@ -4758,8 +4798,7 @@ export function apply(ctx) {
4758
4798
  saveCfg(c)
4759
4799
  diag('记忆归类模式 → ' + 模式)
4760
4800
  } catch (error) {}
4761
- res.writeHead(200, { 'content-type': 'application/json; charset=utf-8' })
4762
- res.end(JSON.stringify({ ok: true, 模式 }))
4801
+ 回({ ok: true, 模式 })
4763
4802
  })
4764
4803
 
4765
4804
  // ⭐ 1.4.5:把同一个工作区里几间会话的记忆并成一份。
package/package.json CHANGED
@@ -1,56 +1,56 @@
1
- {
2
- "name": "dsh-fish-memory",
3
- "version": "1.4.6",
4
- "description": "给 DSH 里的会话一份会淡忘的长期记忆,每条都带时间。",
5
- "license": "MIT",
6
- "type": "module",
7
- "keywords": [
8
- "deepseek-harness",
9
- "dsh-plugin",
10
- "memory",
11
- "long-term-memory",
12
- "ai-companion"
13
- ],
14
- "repository": {
15
- "type": "git",
16
- "url": "git+https://github.com/Yuuyuko-uu/dsh-fish-memory.git"
17
- },
18
- "main": "lib/index.js",
19
- "exports": {
20
- ".": "./lib/index.js",
21
- "./client": "./lib/client.js",
22
- "./cordis.patch.yml": "./cordis.patch.yml",
23
- "./package.json": "./package.json"
24
- },
25
- "files": [
26
- "lib",
27
- "cordis.patch.yml",
28
- "README.md"
29
- ],
30
- "dsh": {
31
- "bundle": {
32
- "patch": "./cordis.patch.yml"
33
- },
34
- "client": {
35
- "platform": "web",
36
- "inject": [
37
- "slots"
38
- ],
39
- "external": [
40
- "react"
41
- ]
42
- }
43
- },
44
- "peerDependencies": {
45
- "@deepseek-ai/dsh-tools": "*",
46
- "@deepseek-ai/dsh-llm": "*"
47
- },
48
- "peerDependenciesMeta": {
49
- "@deepseek-ai/dsh-tools": {
50
- "optional": true
51
- },
52
- "@deepseek-ai/dsh-llm": {
53
- "optional": true
54
- }
55
- }
56
- }
1
+ {
2
+ "name": "dsh-fish-memory",
3
+ "version": "1.4.7",
4
+ "description": "给 DSH 里的会话一份会淡忘的长期记忆,每条都带时间。",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "type": "module",
7
+ "keywords": [
8
+ "deepseek-harness",
9
+ "dsh-plugin",
10
+ "memory",
11
+ "long-term-memory",
12
+ "ai-companion"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/Yuuyuko-uu/dsh-fish-memory.git"
17
+ },
18
+ "main": "lib/index.js",
19
+ "exports": {
20
+ ".": "./lib/index.js",
21
+ "./client": "./lib/client.js",
22
+ "./cordis.patch.yml": "./cordis.patch.yml",
23
+ "./package.json": "./package.json"
24
+ },
25
+ "files": [
26
+ "lib",
27
+ "cordis.patch.yml",
28
+ "README.md"
29
+ ],
30
+ "dsh": {
31
+ "bundle": {
32
+ "patch": "./cordis.patch.yml"
33
+ },
34
+ "client": {
35
+ "platform": "web",
36
+ "inject": [
37
+ "slots"
38
+ ],
39
+ "external": [
40
+ "react"
41
+ ]
42
+ }
43
+ },
44
+ "peerDependencies": {
45
+ "@deepseek-ai/dsh-tools": "*",
46
+ "@deepseek-ai/dsh-llm": "*"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "@deepseek-ai/dsh-tools": {
50
+ "optional": true
51
+ },
52
+ "@deepseek-ai/dsh-llm": {
53
+ "optional": true
54
+ }
55
+ }
56
+ }