@shgroup/dsh-serenity-hooks 1.19.7 → 1.19.8
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/dsh.plugin.json +1 -1
- package/lib/index.js +44 -16
- package/package.json +1 -1
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-serenity-hooks",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.8",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"description": "宁静号 ACC harness(Native Cordis 插件):真实 DSH 工具 cc_fs/session/acc_msm/eap/neat/cce/loop + 拦截缝机械约束(safe-mode/路径守卫)。适配 DSH 公开版(0.1.0-rc,deepseek-ai/deepseek-harness)。私有(dsh-external 组织)。",
|
|
6
6
|
"engines": {
|
package/lib/index.js
CHANGED
|
@@ -4089,11 +4089,24 @@ function cceBlock() {
|
|
|
4089
4089
|
""
|
|
4090
4090
|
].join("\n");
|
|
4091
4091
|
}
|
|
4092
|
-
/**
|
|
4093
|
-
|
|
4092
|
+
/**
|
|
4093
|
+
* Principles 块(v1.19.8 合并,S142):认知容器本体论(why)+ 操作边界(operational
|
|
4094
|
+
* boundaries)。原独立 Principles 与 Constraints 合并——同属容器约束体系,先原则
|
|
4095
|
+
* 后边界(从抽象到具体,重建视角 R↓)。**注意:Constraints 不再作为独立对齐块存在
|
|
4096
|
+
* (spec 修订:同步 osp compacting.ts——Constraints 内容并入本块,工具名仍为平台真实名)。**
|
|
4097
|
+
*/
|
|
4098
|
+
function principlesBlock(root) {
|
|
4094
4099
|
return [
|
|
4095
4100
|
"",
|
|
4096
|
-
"=== Serenity
|
|
4101
|
+
"=== Serenity Principles ===",
|
|
4102
|
+
"Why a cognitive container: all work is cognition — every artifact, decision,",
|
|
4103
|
+
"and line of code is a product of thought; and from cognition, any work can",
|
|
4104
|
+
"be built. In this frame, the world contains no errors — only insufficient",
|
|
4105
|
+
"cognition. A setback is a gap to be filled (read, ask, research), not a",
|
|
4106
|
+
"fault to be hidden. Never disguise or excuse what you do not know;",
|
|
4107
|
+
"not-knowing is a state to be repaired, and reporting it is the first repair.",
|
|
4108
|
+
"",
|
|
4109
|
+
"Operational boundaries:",
|
|
4097
4110
|
`Root: ${root}`,
|
|
4098
4111
|
" • File access — read/edit/write/grep/glob are confined to Root; paths outside Root are rejected (RR5)",
|
|
4099
4112
|
" • Shell — use acc_msm by default. Note: bash may be disabled",
|
|
@@ -4134,7 +4147,7 @@ function metaphorBlock() {
|
|
|
4134
4147
|
"violation. The universe is structured in three layers — the Ship (the",
|
|
4135
4148
|
"container itself), the Voyage (the cognitive lifecycle), the Crew",
|
|
4136
4149
|
"(multi-agent collaboration); every metaphor maps to one protocol",
|
|
4137
|
-
"constraint.",
|
|
4150
|
+
"constraint. The Sea has no mistakes — only waters you have not yet charted.",
|
|
4138
4151
|
"",
|
|
4139
4152
|
"THE SHIP — the container itself",
|
|
4140
4153
|
"",
|
|
@@ -4183,9 +4196,11 @@ function metaphorBlock() {
|
|
|
4183
4196
|
].join("\n");
|
|
4184
4197
|
}
|
|
4185
4198
|
/**
|
|
4186
|
-
* 运行时状态块 1) safe-mode(S134 v1.16.12):ON 时告知 agent
|
|
4187
|
-
*
|
|
4188
|
-
*
|
|
4199
|
+
* 运行时状态块 1) safe-mode(S134 v1.16.12):ON 时告知 agent。
|
|
4200
|
+
* v1.19.8 结构重排(S142 用户设计思路):语义(为什么——无人值守自由)→
|
|
4201
|
+
* 机制(什么被禁用)→ 约束(不可做什么)。文案与实现逐项对应(guards.ts):
|
|
4202
|
+
* bash 禁用(restrict deny + decideGuard)、黑名单路径拦截、CCC 治理文件保护;
|
|
4203
|
+
* write/edit 等其余工具保留(受路径逃逸/黑名单约束)。
|
|
4189
4204
|
*/
|
|
4190
4205
|
function safeModeBlock(root) {
|
|
4191
4206
|
if (!isSafeModeOn(root)) return "";
|
|
@@ -4193,13 +4208,21 @@ function safeModeBlock(root) {
|
|
|
4193
4208
|
return [
|
|
4194
4209
|
"",
|
|
4195
4210
|
"=== Serenity Safe Mode ===",
|
|
4196
|
-
"Safe mode is ON (enabled by the user)
|
|
4197
|
-
"
|
|
4198
|
-
"
|
|
4199
|
-
"
|
|
4211
|
+
"Safe mode is ON (enabled by the user). It makes the vessel unattended-capable —",
|
|
4212
|
+
"the hull holds its course without a watch on deck: you may work with fuller",
|
|
4213
|
+
"freedom, pushing work forward autonomously without pausing for approval at",
|
|
4214
|
+
"every step. The guards are not chains; they are the ballast that lets you",
|
|
4215
|
+
"sail unaccompanied.",
|
|
4216
|
+
"",
|
|
4217
|
+
"Operational details:",
|
|
4218
|
+
"- bash is disabled (hidden and blocked)",
|
|
4219
|
+
"- blacklist rules apply to file paths",
|
|
4220
|
+
"- CCC governance files (.serenity, .serenity-safe-on) are protected from agent writes",
|
|
4221
|
+
"- other read/write tools remain available, subject to path-escape and blacklist guards",
|
|
4222
|
+
blacklist.length > 0 ? `\nActive blacklist rules: ${blacklist.map((b) => b.message ?? b.pattern).join(", ")}` : "",
|
|
4223
|
+
"",
|
|
4200
4224
|
"Behavior constraints: do not attempt to bypass restrictions; do not write to",
|
|
4201
4225
|
"blacklisted paths or governance files.",
|
|
4202
|
-
blacklist.length > 0 ? `\nActive blacklist rules: ${blacklist.map((b) => b.message ?? b.pattern).join(", ")}` : "",
|
|
4203
4226
|
""
|
|
4204
4227
|
].join("\n");
|
|
4205
4228
|
}
|
|
@@ -4282,17 +4305,22 @@ function sessionBlock(root, scope = DEFAULT_SESSION_SCOPE) {
|
|
|
4282
4305
|
""
|
|
4283
4306
|
].join("\n");
|
|
4284
4307
|
}
|
|
4285
|
-
/**
|
|
4308
|
+
/**
|
|
4309
|
+
* 完整系统提示词注入文本(v1.19.8 结构精简,S142 重建视角 R↓):
|
|
4310
|
+
* 身份(ACC)→ 世界模型(Metaphor)→ 信念/边界(Principles)→ 时间约束(CCE)
|
|
4311
|
+
* → 质量(EAP)→ 状态(SafeMode/Localstore)→ CCC 上下文(SKILL)→ 会话(Session)。
|
|
4312
|
+
* 认知展开顺序:我是谁 → 我所在的世界 → 为什么 → 如何一致 → 产物标准 → 当前状态 → 上下文。
|
|
4313
|
+
*/
|
|
4286
4314
|
function serenitySystemPrompt(root, scope = DEFAULT_SESSION_SCOPE) {
|
|
4287
4315
|
const parts = [
|
|
4288
4316
|
accBlock(root),
|
|
4317
|
+
metaphorBlock(),
|
|
4318
|
+
principlesBlock(root),
|
|
4289
4319
|
cceBlock(),
|
|
4290
|
-
|
|
4320
|
+
eapBlock()
|
|
4291
4321
|
];
|
|
4292
4322
|
const state = [safeModeBlock(root), localstoreBlock(root)].filter((b) => b !== "").join("\n");
|
|
4293
4323
|
if (state) parts.push(state);
|
|
4294
|
-
parts.push(eapBlock());
|
|
4295
|
-
parts.push(metaphorBlock());
|
|
4296
4324
|
const skill = entrySkillSectionText(root);
|
|
4297
4325
|
if (skill) parts.push(skill);
|
|
4298
4326
|
const session = sessionBlock(root, scope);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shgroup/dsh-serenity-hooks",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.8",
|
|
4
4
|
"description": "宁静号 ACC harness — Native Cordis 插件(DeepSeek Harness 运行时)。真实 DSH 工具注册(cc_fs/session/acc_msm 等 9 工具)+ 拦截缝机械约束(safe-mode/路径守卫/会话落盘)+ 系统提示词注入(ACC/CCE/Constraints/SKILL/Session 五块)。适配 DSH 公开版(deepseek-ai/deepseek-harness 0.1.0-rc)。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|