dsh-whale-loli 0.9.1 → 0.9.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.
- package/cordis.patch.yml +11 -1
- package/listing.json +1 -1
- package/package.json +1 -1
- package/src/index.js +31 -4
package/cordis.patch.yml
CHANGED
|
@@ -21,8 +21,18 @@
|
|
|
21
21
|
# ── 好感度守护进程(宿主级,只挂一次)─────────────────────────────────
|
|
22
22
|
# 设置页的面板用 ctx.remote.$mount() 挂到 REMOTE_NAMESPACE 上,
|
|
23
23
|
# 再调 status() / set(scope, value)。落在宿主根作用域,只为了能直接改盘。
|
|
24
|
+
#
|
|
25
|
+
# ⚠️ name 必须是**裸包名**,不能写成 'dsh-whale-loli/affinity-daemon'。
|
|
26
|
+
# 宿主 client-modules 扫客户端 bundle 时只认 ctx.loader.entries() 里
|
|
27
|
+
# specifier 解析得成包的行(不带斜杠的裸名,或
|
|
28
|
+
# createRequire().resolve('<spec>/package.json') 解得动的 subpath)。
|
|
29
|
+
# '.../affinity-daemon/package.json' 解不动(ERR_PACKAGE_PATH_NOT_EXPORTED),
|
|
30
|
+
# dsh.client 就永远不被发现,「设置 → 好感度」也就永远不出现。
|
|
31
|
+
# 用裸包名 + config.daemon 分派(见 src/index.js 的 applyEntry)。
|
|
24
32
|
- id: whale-affinity-daemon
|
|
25
|
-
name: 'dsh-whale-loli
|
|
33
|
+
name: 'dsh-whale-loli'
|
|
34
|
+
config:
|
|
35
|
+
daemon: true
|
|
26
36
|
|
|
27
37
|
# ── 预设一:鲸鱼娘Agent预设(原版)────────────────────────────────────
|
|
28
38
|
- id: preset-鲸鱼娘Agent预设
|
package/listing.json
CHANGED
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"zh": "把 Agent 预设打包成插件:装上就会在 Agent 预设列表里注册「鲸鱼娘Agent预设」「鲸鱼娘活人版Agent预设」「鲸鱼娘涩涩版Agent预设」和「鲸鱼娘女儿版Agent预设」,直接在模式下拉里选用,不用手改配置。每个预设本体是官方极简模式(只开放 shell)+ 文件工具 + 鲸鱼娘人设 + 自己那份持久记忆文件,以提示变量形式注入,开口前就已经读过;另外每个预设各配一个专用写入工具(whale_memory_add / whale_memory_v2_add / whale_memory_v3_add / whale_memory_v4_add),用来把每轮的一行摘要追加进去,记忆会自己长,不会停在手写那几条。四个预设完全隔离:记忆文件不同、提示变量不同、写入工具也不同。每个预设还带好感度(-100~100 共七档),可以打开「设置 → 好感度」,用滑块或档位按钮直接调,也可以让 agent 用 affinity_v*_set 工具改;离 0 越远越不听指令、越会自作主张,最两端的两档甚至会越过允许直接做大改动。女儿版称呼「爸爸」,性格天真活泼可爱(好奇心重、黏人、没心机),不是甜腻那一型。"
|
|
10
10
|
},
|
|
11
11
|
"npm": "dsh-whale-loli",
|
|
12
|
-
"version": "0.9.
|
|
12
|
+
"version": "0.9.2"
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-whale-loli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "鲸鱼娘 Agent 预设(四个:原版 / 活人版 / 涩涩版 / 女儿版)— 极简模式工具面 + 鲸鱼娘·小鱼人设 + 跨会话长期记忆(四区格式:固定记忆永久、滚动摘要 80 条 FIFO、最近详细区、归档索引)+ 好感度(-100~100 七档,设置页面板滑块 / 档位按钮、工具也可调,离 0 越远越不听指令、两端会越过允许自作主张)。记忆与好感度都走提示变量注入、各配一条专用工具,四个预设各自独立文件、独立变量、独立工具、互不相通。好感度面板走宿主根作用域的 remote 服务(whale-affinity-daemon),设置页是浏览器 React 够不到 ~/.dsh 的磁盘,只能这样连线。女儿版称呼「爸爸」、性格天真活泼可爱。上下文压缩交给 billion-context 插件;本插件不挂 history-window(预设作用域取不到宿主的 compaction 服务,挂载会拖挂会话 resume)。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import { readFileSync } from 'node:fs';
|
|
|
23
23
|
import { fileURLToPath } from 'node:url';
|
|
24
24
|
import { apply as applyMemory, inject as memoryInject, name as memoryName } from './memory.js';
|
|
25
25
|
import { apply as applyAffinity, name as affinityName } from './affinity.js';
|
|
26
|
+
import { apply as applyDaemon, inject as daemonInject } from './daemon.js';
|
|
26
27
|
|
|
27
28
|
const read = (rel) => readFileSync(fileURLToPath(new URL(rel, import.meta.url)), 'utf8');
|
|
28
29
|
|
|
@@ -148,6 +149,28 @@ function apply(ctx, config = {}) {
|
|
|
148
149
|
return applyMemory(ctx, config);
|
|
149
150
|
}
|
|
150
151
|
|
|
152
|
+
/**
|
|
153
|
+
* 宿主级那一行(`config.daemon: true`)挂的是好感度守护进程。
|
|
154
|
+
*
|
|
155
|
+
* 为什么非要挤进默认导出:宿主的 client-modules 只会扫描 `ctx.loader.entries()`
|
|
156
|
+
* 里那些 **specifier 本身能被解析成包** 的行(`exactPackageSpecifier` 只认
|
|
157
|
+
* 不带斜杠的裸名,或用 `createRequire().resolve('<spec>/package.json')` 能解到的
|
|
158
|
+
* subpath)。我们的 daemon 原先写成 `name: 'dsh-whale-loli/affinity-daemon'`,
|
|
159
|
+
* 而 `dsh-whale-loli/affinity-daemon/package.json` 解析不到
|
|
160
|
+
* (`ERR_PACKAGE_PATH_NOT_EXPORTED`),于是 `dsh.client` 永远不被发现,
|
|
161
|
+
* 「设置 → 好感度」那一栏也就永远不出现。
|
|
162
|
+
*
|
|
163
|
+
* 而预设里的那几行 `dsh-whale-loli` 又不在宿主根 Loader 的 entries 里
|
|
164
|
+
* (它们在预设自己的 scope 里),同样扫不到。
|
|
165
|
+
*
|
|
166
|
+
* 所以让宿主级那一行直接用裸包名 `dsh-whale-loli`,靠 `config.daemon` 分派到
|
|
167
|
+
* daemon —— 这样 specifier 解析得动,manifest 带 `dsh.client`,客户端被挂上。
|
|
168
|
+
*/
|
|
169
|
+
function applyEntry(ctx, config = {}) {
|
|
170
|
+
if (config?.daemon === true) return applyDaemon(ctx, config);
|
|
171
|
+
return applyMemory(ctx, config);
|
|
172
|
+
}
|
|
173
|
+
|
|
151
174
|
/** 好感度行(scope / variableName / toolName / commandName 由预设各自传入)。 */
|
|
152
175
|
function applyAffinityRow(ctx, config = {}) {
|
|
153
176
|
return applyAffinity(ctx, config);
|
|
@@ -155,12 +178,16 @@ function applyAffinityRow(ctx, config = {}) {
|
|
|
155
178
|
|
|
156
179
|
export default {
|
|
157
180
|
name: 'dsh-whale-loli',
|
|
158
|
-
// 注意:`inject`
|
|
181
|
+
// 注意:`inject` 是静态声明,只能写作用域里**一直存在**的服务名。
|
|
159
182
|
// 千万别把不存在的服务名写进来 —— 宿主会一直等它,结果是**所有**预设
|
|
160
183
|
// 都挂在 `agent-preset/invalid` 上加载失败,而且报错只提插件名不提字段,
|
|
161
|
-
//
|
|
162
|
-
|
|
163
|
-
|
|
184
|
+
// 极难定位。
|
|
185
|
+
//
|
|
186
|
+
// 这一行是「记忆行」和「宿主级 daemon 行」**共用**的:两者都得声明齐。
|
|
187
|
+
// memory 只要 systemPrompt(预设里必然存在);daemon 要 reflect / typert
|
|
188
|
+
// (宿主根作用域里必然存在)。两边的并集不会让任何一边等不到东西。
|
|
189
|
+
inject: [...new Set([...memoryInject, ...daemonInject])],
|
|
190
|
+
apply: applyEntry,
|
|
164
191
|
};
|
|
165
192
|
|
|
166
193
|
// 让 `whale-memory` 也能作为本包的一个入口被挂载(patch 里用的是这个名字)。
|