dsh-plugin-prompt-tool 3.1.4 → 3.1.5
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 +9 -3
- package/engine/compaction-epoch.d.mts +1 -0
- package/engine/conditions/composite.mjs +6 -1
- package/engine/conditions/evaluation.mjs +22 -3
- package/engine/conditions/examples.mjs +1 -0
- package/engine/conditions/index.mjs +4 -0
- package/engine/conditions/soul.mjs +15 -0
- package/engine/delivery.d.mts +1 -0
- package/engine/executor.mjs +4 -1
- package/engine/fillers.mjs +2 -1
- package/engine/generation-recovery.d.mts +6 -0
- package/engine/generation-recovery.mjs +53 -4
- package/engine/layers.mjs +7 -2
- package/engine/retrieval-reference.d.mts +1 -1
- package/engine/retrieval.mjs +2 -1
- package/engine/rule-runtime.d.mts +4 -0
- package/engine/rule-runtime.mjs +3 -2
- package/engine/rule-spec.mjs +7 -1
- package/engine/soul-maintenance.mjs +5 -0
- package/lib/client.js +2 -0
- package/lib/client.js.map +1 -1
- package/lib/index.mjs +1631 -166
- package/modules/soul/assets/ledger.md +4 -0
- package/modules/soul/assets/retrieval-synonyms.json +8 -0
- package/modules/soul/assets/tools.md +4 -0
- package/modules/soul/module.yml +27 -21
- package/package.json +1 -1
|
@@ -11,3 +11,7 @@
|
|
|
11
11
|
`lead` 必须附用户指定主导的 ref,并经正式审批。`promise` 仅最后 lead 署名的会话可写;通用 `module_file_append` 不允许写新旧账本名。读取用 action: list,检索与原文回取用 `module_search`/`module_open`;默认不读取其他历史会话。
|
|
12
12
|
|
|
13
13
|
没有 ref 的 fact,三个月后读到只能选择相信或不信——两条都不对。
|
|
14
|
+
|
|
15
|
+
**逐项收口**:`action: list, view: pending` 包含新未结与历史待核对,条目 `id` 是宿主稳定引用;分页游标随账本变化失效,失效后重读。`action: close` 必填 `targetId`、`outcome: completed/cancelled` 和非空 `reason`;`ref` 仍是证据出处。完成与取消均追加 close 事件,不改原行。promise 仅当前 lead 收口,shelved 原作者或当前 lead 可收口;同结果重复不追加,换结果拒绝。执行者只能给依据,不能替主导确认承诺。
|
|
16
|
+
|
|
17
|
+
历史分界在首个合法写操作前固定,普通读取不创建元数据。历史 promise/shelved 逐条待核对,不按摘要猜测完成。SELF 与提醒读取同一投影,无需手工 ledger_open。含 close 后不能把旧程序当安全可写版本;回滚先停写及旧投影贡献,保留全部历史。
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
- `soul_ledger`(moduleId: soul):`action: list` 读账本(limit 1–100);`action: append` 追加,必填 `type` 与 `概要`(一句话索引,不写长文),建议带 `ref`。type 八种:fact / gain / loss / shelved / promise / persona / container / lead。`promise` 仅最后 lead 署名会话可写,`lead` 需用户指定并审批;t/by 由宿主生成,不能改历史。
|
|
6
6
|
- `module_search`(moduleId: soul)→ 用命中的 `reference` 调 `module_open`(moduleId: soul)回取原文;引用会重新校验授权与版本,不是访问凭据。
|
|
7
|
+
- `soul_ledger` 收口:先 `action: list, view: pending` 取稳定 `id`(有 `nextCursor` 则继续);再 `action: close, targetId: id, outcome: completed/cancelled, reason: 非空依据`,可附 `ref`。promise 仅当前 lead 确认,shelved 原作者或当前 lead 可确认;暂时搁置仍未结。历史项标待核对,不自动视为已完成。
|
|
8
|
+
- `soul_state`(moduleId: soul):`status` 看当前时钟、会话状态和来源;`mark` 用 `text`+`expectedRevision` 显式记短状态(首次 null);`check` 只读核对文件、SELF实际投递、索引及运行观测,并给旧规则定向升级预览。标记时间与实际活动时间分开,不能指定其他会话。
|
|
9
|
+
- `module_search` 的 `mode: timeline` 按可信时间查已授权账本/会话,可用带时区的 `since/until` 和 `cursor`;未知时间明确标记。普通查询标注精确/归一/近义,原文不改。
|
|
10
|
+
- 旧副本升级:`soul_state action: check, includeUpgrade: true` 显式展开完整文件候选;有冲突先处理,不强覆盖。完整 `files` 交 `module_import` 模型工具按 `targetId`、`overwrite: true` 预览,核对后带新凭据提交;该入口保留私有数据、记忆和技能,不用普通覆盖导入替代。
|
|
7
11
|
- `module_file_read` / `module_file_append`(moduleId: soul):读取允许 `memory.md`、`assets/`、`data/`;追写只允许 `memory.md` 与 `data/`,一次一行。账本 `data/02-soul.jsonl` 只能走 `soul_ledger`,通用文件接口会被拒。
|
|
8
12
|
- `module_manifest`(moduleId: soul):`action: next` 看第一条缺失,`check` 看全部检查结果,`apply` 只建缺失文件、不覆盖不删除。
|
|
9
13
|
- `module_variables`(moduleId: soul,scope: module):`action: list` 读全部并返回 revisions;`get` 读单键;`set` 必须 `key` + `value` + 读取时的 `expectedRevisions`;`delete` 只删本模块键,删除后回落全局。
|
package/modules/soul/module.yml
CHANGED
|
@@ -5,7 +5,8 @@ id: soul
|
|
|
5
5
|
name: 灵魂架构(判据与推送)
|
|
6
6
|
version: 1.0.0
|
|
7
7
|
engineCompat: ">=0.7.2"
|
|
8
|
-
description: 灵魂架构完整核心:判据、结构化账本、授权检索、动态 SELF、上下文溯源、生成恢复与默认不唤醒的维护心跳;能力按 Agent
|
|
8
|
+
description: 灵魂架构完整核心:判据、结构化账本、授权检索、动态 SELF、上下文溯源、生成恢复与默认不唤醒的维护心跳;能力按 Agent
|
|
9
|
+
运行时装配,不依赖预设改装。原项目:https://github.com/cyanwell/dsh-agent-soul
|
|
9
10
|
meta:
|
|
10
11
|
source: manual
|
|
11
12
|
modules:
|
|
@@ -37,6 +38,7 @@ moduleConfigs:
|
|
|
37
38
|
- data/80-科普/
|
|
38
39
|
- data/90-历代根会话/
|
|
39
40
|
sessions: []
|
|
41
|
+
synonymsFile: assets/retrieval-synonyms.json
|
|
40
42
|
context-provenance:
|
|
41
43
|
enabled: true
|
|
42
44
|
audience: all
|
|
@@ -53,12 +55,19 @@ moduleConfigs:
|
|
|
53
55
|
subagentRecoveryLimit: 1
|
|
54
56
|
maintenanceCompression: false
|
|
55
57
|
allowFullFallback: false
|
|
58
|
+
lineRepeatChars: 2048
|
|
59
|
+
crossCallRepeatChars: 2048
|
|
60
|
+
maxCycleChars: 512
|
|
56
61
|
soul-maintenance:
|
|
57
62
|
enabled: true
|
|
58
63
|
intervalMs: 60000
|
|
59
64
|
wake: false
|
|
60
65
|
audience: all
|
|
61
66
|
budgetBytes: 12288
|
|
67
|
+
pressureThresholds:
|
|
68
|
+
- 0.45
|
|
69
|
+
- 0.6
|
|
70
|
+
- 0.8
|
|
62
71
|
order: 10
|
|
63
72
|
variables:
|
|
64
73
|
# 状态键由本模块声明;引擎只按普通模块变量处理,不认 soul 前缀。
|
|
@@ -66,8 +75,6 @@ variables:
|
|
|
66
75
|
plan_at: ''
|
|
67
76
|
scaffold_done: ''
|
|
68
77
|
scaffold_root: data
|
|
69
|
-
ledger_seq: '0'
|
|
70
|
-
ledger_open: '0'
|
|
71
78
|
rules:
|
|
72
79
|
- id: soul-core
|
|
73
80
|
name: 四条判据(常驻)
|
|
@@ -89,7 +96,7 @@ rules:
|
|
|
89
96
|
templateFile: ./assets/criteria.md
|
|
90
97
|
|
|
91
98
|
- id: soul-self
|
|
92
|
-
name: SELF
|
|
99
|
+
name: SELF(每步当前事实)
|
|
93
100
|
enabled: true
|
|
94
101
|
layer: runtime-context
|
|
95
102
|
then:
|
|
@@ -150,7 +157,7 @@ rules:
|
|
|
150
157
|
templateFile: ./assets/layers.md
|
|
151
158
|
params:
|
|
152
159
|
constant: false
|
|
153
|
-
keys: [灵魂, 五层, ECHO, VITAL, 架构]
|
|
160
|
+
keys: [ 灵魂, 五层, ECHO, VITAL, 架构 ]
|
|
154
161
|
secondaryKeys: []
|
|
155
162
|
selectiveLogic: AND_ANY
|
|
156
163
|
wordBoundary: ascii-token
|
|
@@ -176,7 +183,7 @@ rules:
|
|
|
176
183
|
templateFile: ./assets/echo.md
|
|
177
184
|
params:
|
|
178
185
|
constant: false
|
|
179
|
-
keys: [压缩, 上下文满, 摘要, 找不回, 退化]
|
|
186
|
+
keys: [ 压缩, 上下文满, 摘要, 找不回, 退化 ]
|
|
180
187
|
secondaryKeys: []
|
|
181
188
|
selectiveLogic: AND_ANY
|
|
182
189
|
wordBoundary: ascii-token
|
|
@@ -202,7 +209,7 @@ rules:
|
|
|
202
209
|
templateFile: ./assets/vital.md
|
|
203
210
|
params:
|
|
204
211
|
constant: false
|
|
205
|
-
keys: [预算, 烧光, 打转, 空转, 该停, 阈值]
|
|
212
|
+
keys: [ 预算, 烧光, 打转, 空转, 该停, 阈值 ]
|
|
206
213
|
secondaryKeys: []
|
|
207
214
|
selectiveLogic: AND_ANY
|
|
208
215
|
wordBoundary: ascii-token
|
|
@@ -228,7 +235,7 @@ rules:
|
|
|
228
235
|
templateFile: ./assets/ledger.md
|
|
229
236
|
params:
|
|
230
237
|
constant: false
|
|
231
|
-
keys: [账本, 未结, 承诺, 只追加]
|
|
238
|
+
keys: [ 账本, 未结, 承诺, 只追加 ]
|
|
232
239
|
secondaryKeys: []
|
|
233
240
|
selectiveLogic: AND_ANY
|
|
234
241
|
wordBoundary: ascii-token
|
|
@@ -353,20 +360,19 @@ rules:
|
|
|
353
360
|
strategy: static
|
|
354
361
|
order: 247
|
|
355
362
|
text: |-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
再说清是哪一条、证据是什么、下一步改哪个文件或哪条规则;
|
|
359
|
-
修完要重新 check,不要用「已修复」代替重新检查,也不要把失败项藏进总结。
|
|
363
|
+
清单检查当前有未通过项:先 module_manifest(moduleId: soul)action=check 看文件明细,再 soul_state(moduleId: soul)action=check 看SELF、索引和运行证据。
|
|
364
|
+
文件齐全不代表SELF已投递或能力已运行;明确哪项失败、证据和下一步,修复后重查,不以手写变量替代检查。
|
|
360
365
|
|
|
361
366
|
- id: soul-ledger-open
|
|
362
367
|
name: 未结账本提醒
|
|
363
368
|
enabled: true
|
|
364
369
|
layer: pre-step
|
|
365
370
|
if:
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
371
|
+
all:
|
|
372
|
+
- scope:
|
|
373
|
+
audience: main
|
|
374
|
+
- soul:
|
|
375
|
+
pending: true
|
|
370
376
|
then:
|
|
371
377
|
- id: inject
|
|
372
378
|
kind: inject-text
|
|
@@ -378,8 +384,8 @@ rules:
|
|
|
378
384
|
order: 126
|
|
379
385
|
role: user
|
|
380
386
|
text: |-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
387
|
+
账本有未结或历史待核对事项:先用 soul_ledger(moduleId: soul,action: list,view: pending)分页核对稳定 id。
|
|
388
|
+
明确完成或取消时,action: close,targetId: 该 id,outcome: completed/cancelled,reason: 非空依据;ref 仍表示出处。
|
|
389
|
+
promise 仅当前 lead 收口;shelved 允许原作者或当前 lead。执行者可提交证据,不替主导确认承诺。
|
|
390
|
+
暂时搁置仍是未结,不猜测历史已完成,不手工修改计数。仅主会话按集合变化或成功压缩提醒一次。
|
|
391
|
+
dedupe: batch
|