@shgroup/dsh-serenity-hooks 1.30.4 → 1.30.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/dsh.plugin.json +1 -1
- package/lib/client.js +19 -3
- package/lib/seams/system-prompt.d.ts +6 -1
- 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.30.
|
|
3
|
+
"version": "1.30.5",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"description": "宁静号 ACC harness(Native Cordis 插件):真实 DSH 工具 container_fs/logbook/dashboard/container_git/msm/praxis/handyman/localstore/container_admin/autopilot-trajectory + 拦截缝机械约束(safe-mode/路径守卫)+ 高级设定面板(双端口网关/账号管理)+ Skiff 认知子集角色(实验性)。适配 DSH 公开版(0.1.0-rc,deepseek-ai/deepseek-harness)。",
|
|
6
6
|
"engines": {
|
package/lib/client.js
CHANGED
|
@@ -358,6 +358,23 @@ window.__ModuleLoader__.load({
|
|
|
358
358
|
/** 图片落盘接口路径(node half api.ts,client 专属 x-serenity-ui 头) */
|
|
359
359
|
const UPLOAD_PATH = "/serenity/image-upload";
|
|
360
360
|
/**
|
|
361
|
+
* 判断是否触发图片落盘补救(纯函数,可单测)。
|
|
362
|
+
*
|
|
363
|
+
* ⚠️ v1.30.5 错误码契约修复(2026-09-08 用户实测"图片能进 rail 但发送被拒、无落盘"):
|
|
364
|
+
* DSH 0.1.1-rc.2 → 0.1.2-rc.1 升级后,host session-controller 把图片被拒错误码从
|
|
365
|
+
* `attachment-error` 改为 `session/attachment-invalid`(主会话)/ `subagent/attachment-invalid`
|
|
366
|
+
* (子代理),reason 仍为 `MODEL_DOES_NOT_SUPPORT_IMAGES`(rc.1 commands.ts:321 实证)。
|
|
367
|
+
* 旧实现只匹配 `attachment-error` → rc.1 下补救永不触发。兼容三码 + reason 双条件判定。
|
|
368
|
+
*
|
|
369
|
+
* @param code - promptError.error.code(host 投影)
|
|
370
|
+
* @param reason - promptError.error.details.reason
|
|
371
|
+
* @returns true = 应触发自动落盘补救
|
|
372
|
+
*/
|
|
373
|
+
function isImageFallbackTrigger(code, reason) {
|
|
374
|
+
if (code !== "attachment-error" && code !== "session/attachment-invalid" && code !== "subagent/attachment-invalid") return false;
|
|
375
|
+
return reason === "MODEL_DOES_NOT_SUPPORT_IMAGES";
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
361
378
|
* 图片提示消息模板(协议固有,S142 用户迭代):
|
|
362
379
|
* - v1.20.5 目录级提示(无文件名)→ 用户反馈 agent 还要猜
|
|
363
380
|
* - v1.20.6 恢复具体路径(对话里一定写名图片路径,agent 直接可用,无需猜)
|
|
@@ -440,9 +457,8 @@ window.__ModuleLoader__.load({
|
|
|
440
457
|
const promptError = session?.promptError?.error;
|
|
441
458
|
const imageIds = input?.imageIds ?? [];
|
|
442
459
|
(0, react.useEffect)(() => {
|
|
443
|
-
if (promptError?.code
|
|
444
|
-
if (
|
|
445
|
-
if (handlingRef.current || imageIds.length === 0) return;
|
|
460
|
+
if (handlingRef.current || !isImageFallbackTrigger(promptError?.code, promptError?.details?.reason)) return;
|
|
461
|
+
if (imageIds.length === 0) return;
|
|
446
462
|
handlingRef.current = true;
|
|
447
463
|
(async () => {
|
|
448
464
|
try {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* system-prompt.ts —
|
|
2
|
+
* system-prompt.ts — Induction(成员装配机制,specs v1.5.0 命名)装配文本构造
|
|
3
|
+
*
|
|
4
|
+
* 机制:把新实例(新会话 / rebuild 重建 / 新 agent)引入为轨迹成员的装配机制——本文件装配的文本
|
|
5
|
+
* 即 Induction 骨架(8 块五层,specs README §5):A 主体定义(ACC/Principles/CCE)→ B 质量规范(EAP)
|
|
6
|
+
* → C 状态调节(状态块)→ D 工作供给(SKILL/Tools)→ E 任务指示(Session),稳定→易变装配序;
|
|
7
|
+
* Metaphor 为 A 层世界模型记忆钩渲染层(不计入 8 块骨架)。
|
|
3
8
|
*
|
|
4
9
|
* **完全对齐 opencode-serenity-plugin 的 system.transform 注入内容**(compacting.ts):
|
|
5
10
|
* 结构(v1.19.8 精简,S142 重建视角 R↓):
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shgroup/dsh-serenity-hooks",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.5",
|
|
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": {
|