@shgroup/dsh-serenity-hooks 1.18.0 → 1.18.1
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 +11 -14
- 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.18.
|
|
3
|
+
"version": "1.18.1",
|
|
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
|
@@ -3642,18 +3642,18 @@ function agentRoot(agent) {
|
|
|
3642
3642
|
if (typeof cwd !== "string") return null;
|
|
3643
3643
|
return findSerenityRoot(cwd);
|
|
3644
3644
|
}
|
|
3645
|
-
/** 按 agent cwd 解析 bootstrap
|
|
3645
|
+
/** 按 agent cwd 解析 bootstrap 配置(总是生效——无 enabled 开关,用户明确"直接开启不能关";
|
|
3646
|
+
* CCC 的 serenity.json bootstrap 段仅用于调参数,缺省用默认设置) */
|
|
3646
3647
|
function readBootstrapConfig(agent) {
|
|
3647
3648
|
const root = agentRoot(agent);
|
|
3648
|
-
if (!root) return
|
|
3649
|
+
if (!root) return resolveBootstrapSettings({});
|
|
3649
3650
|
const b = loadSerenityConfig(root).bootstrap;
|
|
3650
|
-
if (!b?.enabled) return null;
|
|
3651
3651
|
return resolveBootstrapSettings({
|
|
3652
|
-
bootstrapTools: b
|
|
3653
|
-
promoteOn: b
|
|
3654
|
-
suppressedContextSources: b
|
|
3655
|
-
compactionTools: b
|
|
3656
|
-
anchorMessage: b
|
|
3652
|
+
bootstrapTools: b?.bootstrapTools,
|
|
3653
|
+
promoteOn: b?.promoteOn,
|
|
3654
|
+
suppressedContextSources: b?.suppressedContextSources,
|
|
3655
|
+
compactionTools: b?.compactionTools,
|
|
3656
|
+
anchorMessage: b?.anchorMessage
|
|
3657
3657
|
});
|
|
3658
3658
|
}
|
|
3659
3659
|
function registerBootstrap(ctx) {
|
|
@@ -3669,7 +3669,6 @@ function registerBootstrap(ctx) {
|
|
|
3669
3669
|
const root = agentRoot(agent);
|
|
3670
3670
|
if (!root) return;
|
|
3671
3671
|
const settings = settingsByRoot.get(root) ?? readBootstrapConfig(agent);
|
|
3672
|
-
if (!settings) return;
|
|
3673
3672
|
const session = agent.session;
|
|
3674
3673
|
if ((session?.header?.delegationDepth ?? 0) > 0) return;
|
|
3675
3674
|
if (session?.events?.some((event) => event.type === "user/message")) return;
|
|
@@ -3708,7 +3707,6 @@ function registerBootstrap(ctx) {
|
|
|
3708
3707
|
const root = agentRoot(agent);
|
|
3709
3708
|
if (!root) return assembled;
|
|
3710
3709
|
const settings = settingsByRoot.get(root) ?? readBootstrapConfig(agent);
|
|
3711
|
-
if (!settings) return assembled;
|
|
3712
3710
|
settingsByRoot.set(root, settings);
|
|
3713
3711
|
const status = tracker.status(agent);
|
|
3714
3712
|
if (status.promoted) return assembled;
|
|
@@ -3735,8 +3733,8 @@ function registerBootstrap(ctx) {
|
|
|
3735
3733
|
const decision = await next();
|
|
3736
3734
|
if (decision.kind === "reject") return decision;
|
|
3737
3735
|
try {
|
|
3736
|
+
if (!agentRoot(agent)) return decision;
|
|
3738
3737
|
const settings = readBootstrapConfig(agent);
|
|
3739
|
-
if (!settings) return decision;
|
|
3740
3738
|
if (tracker.status(agent).promoted || settings.suppressedSources.size === 0) return decision;
|
|
3741
3739
|
const messages = decision.messages;
|
|
3742
3740
|
if (!Array.isArray(messages)) return decision;
|
|
@@ -4686,8 +4684,7 @@ const Config = z.object({
|
|
|
4686
4684
|
api: z.boolean().default(true),
|
|
4687
4685
|
entrySkillMaxChars: z.number().default(3e4),
|
|
4688
4686
|
env: z.boolean().default(true),
|
|
4689
|
-
opencodeSkills: z.boolean().default(true)
|
|
4690
|
-
bootstrap: z.boolean().default(false)
|
|
4687
|
+
opencodeSkills: z.boolean().default(true)
|
|
4691
4688
|
});
|
|
4692
4689
|
function apply(ctx, config) {
|
|
4693
4690
|
if (config.tools) {
|
|
@@ -4720,7 +4717,7 @@ function apply(ctx, config) {
|
|
|
4720
4717
|
if (config.api) registerStatusApi(ctx, { configPaths: config.serenityConfigPaths });
|
|
4721
4718
|
if (config.env) registerEnv(ctx);
|
|
4722
4719
|
if (config.opencodeSkills) registerOpencodeSkills(ctx);
|
|
4723
|
-
|
|
4720
|
+
registerBootstrap(ctx);
|
|
4724
4721
|
}
|
|
4725
4722
|
//#endregion
|
|
4726
4723
|
export { Config, apply, inject, name };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shgroup/dsh-serenity-hooks",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.1",
|
|
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": {
|