@shgroup/dsh-serenity-hooks 1.20.1 → 1.20.3
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 +14 -8
- 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.20.
|
|
3
|
+
"version": "1.20.3",
|
|
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/client.js
CHANGED
|
@@ -359,18 +359,24 @@ window.__ModuleLoader__.load({
|
|
|
359
359
|
/**
|
|
360
360
|
* 取 rail 图片的浏览器 File。
|
|
361
361
|
* conversation.draftImages 是 root singleton 的公开方法(读 controller 的 draftAttachments Map,
|
|
362
|
-
* 与调用 ctx 的作用域无关)——直接 ctx.get('conversation')
|
|
362
|
+
* 与调用 ctx 的作用域无关)——直接 ctx.get('conversation')。
|
|
363
|
+
* ⚠️ 必须作为方法调用(conversation.draftImages(ids)):解构取出再调会丢失 this
|
|
364
|
+
* (draftImages 内部读 this.draftAttachments → "Cannot read properties of undefined")。
|
|
363
365
|
*/
|
|
364
366
|
async function getDraftFiles(ctx, _sessionId, ids) {
|
|
365
|
-
const
|
|
366
|
-
if (draftImages === void 0) return [];
|
|
367
|
-
return (draftImages(ids) ?? []).map((a) => a.file);
|
|
367
|
+
const conversation = ctx.get?.("conversation");
|
|
368
|
+
if (conversation?.draftImages === void 0) return [];
|
|
369
|
+
return (conversation.draftImages(ids) ?? []).map((a) => a.file);
|
|
368
370
|
}
|
|
369
|
-
/**
|
|
371
|
+
/**
|
|
372
|
+
* 纯文本重发(绕过图片门禁——不含 image part,模型永不触发 MODEL_DOES_NOT_SUPPORT_IMAGES)。
|
|
373
|
+
* ⚠️ 必须作为方法调用(session.prompt(...)):解构取出再调会丢失 this
|
|
374
|
+
* (prompt 内部读 this.promptError → "Cannot set properties of undefined (setting 'promptError')")。
|
|
375
|
+
*/
|
|
370
376
|
async function resendText(ctx, sessionId, text) {
|
|
371
|
-
const
|
|
372
|
-
if (prompt === void 0) throw new Error("serenity image fallback: session unavailable");
|
|
373
|
-
const result = await prompt([{
|
|
377
|
+
const session = ctx.sessions.binding(sessionId)?.session;
|
|
378
|
+
if (session?.prompt === void 0) throw new Error("serenity image fallback: session unavailable");
|
|
379
|
+
const result = await session.prompt([{
|
|
374
380
|
type: "text",
|
|
375
381
|
text
|
|
376
382
|
}], "queue");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shgroup/dsh-serenity-hooks",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.3",
|
|
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": {
|