@shgroup/dsh-serenity-hooks 1.130.2 → 1.130.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/index.js +43 -36
- 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.130.
|
|
3
|
+
"version": "1.130.3",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"description": "宁静号 ACC harness(Native Cordis 插件):给 DSH 装一个「AI 工作区」——14 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/localstore/container_admin/browser_slot;另三个 im-bridge/diagram/reconstruct 按条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫)+ 认知轨迹日志与原地重建 + 网页登录入口/IM 桥/认知轨迹唤醒注册表 + 浏览器槽位管理(≤20 个独立 profile 的 Chrome 槽位,带占用归属与异常时向所属会话反向注入提醒)。轨迹声明 = 轨迹目录下的 trajectory.json(约束面 + 旧标识 uid + CRO 机器绑定 cro.host;旧名 trajectory-constraint.json / skiff.json 仍在读取族里);轨迹提示词 = 轨迹目录下的 PROMPT.md(一条轨迹「是谁、按什么章程工作」,所有轨迹通用,追加在容器层与质量层之后,不替换它们)。适配 DSH 0.1.7-rc.1 / 0.2.0-rc.1 / 0.2.1-rc.1(三档,deepseek-ai/deepseek-harness)。",
|
|
6
6
|
"engines": {
|
package/lib/index.js
CHANGED
|
@@ -20704,42 +20704,49 @@ function listDownloaded(absDir) {
|
|
|
20704
20704
|
* 而对话框正文由页面控制(可以写任何话)。要接受必须由调用方显式要求。
|
|
20705
20705
|
*/
|
|
20706
20706
|
async function handleDialog(slot, targetId, accept, promptText) {
|
|
20707
|
-
|
|
20708
|
-
|
|
20709
|
-
|
|
20710
|
-
|
|
20711
|
-
|
|
20712
|
-
|
|
20713
|
-
|
|
20714
|
-
|
|
20715
|
-
|
|
20716
|
-
|
|
20717
|
-
|
|
20718
|
-
|
|
20719
|
-
|
|
20720
|
-
|
|
20721
|
-
|
|
20722
|
-
|
|
20723
|
-
|
|
20724
|
-
|
|
20725
|
-
|
|
20726
|
-
|
|
20727
|
-
|
|
20728
|
-
|
|
20729
|
-
|
|
20730
|
-
|
|
20731
|
-
|
|
20732
|
-
|
|
20733
|
-
|
|
20734
|
-
|
|
20735
|
-
|
|
20736
|
-
|
|
20737
|
-
|
|
20738
|
-
|
|
20739
|
-
|
|
20740
|
-
|
|
20741
|
-
|
|
20742
|
-
|
|
20707
|
+
/**
|
|
20708
|
+
* 🔴🔴 **真机实测(2026-11-11):先 `Page.enable` 再处理弹窗,会把整页卡死。**
|
|
20709
|
+
*
|
|
20710
|
+
* 现象:`click` 一个会 `confirm()` 的按钮 ⇒ 点击请求 30s 超时(页面同步阻塞,这是**预期的**);
|
|
20711
|
+
* 接着调 `dialog` 去处理它 ⇒ **`Page.enable` 自己超时 30s**,弹窗一直挂着,页面永久卡死。
|
|
20712
|
+
*
|
|
20713
|
+
* 对照实验(裸 WS 直连,同一个卡死的页面):
|
|
20714
|
+
* · `Page.handleJavaScriptDialog{accept:false}` **不 enable 直接发** ⇒ 立刻返回 `No dialog is showing`
|
|
20715
|
+
* (说明这条路**通**,只是此刻那条 confirm 已被上一次尝试里的某个环节关掉了)
|
|
20716
|
+
* · `Page.enable` ⇒ 在弹窗阻塞的页面上**挂住**
|
|
20717
|
+
*
|
|
20718
|
+
* ⇒ 判据:**在「页面已阻塞」这个状态下,任何需要页面响应的方法都不能排在前面**。
|
|
20719
|
+
* `Page.enable` 要往渲染器要一次响应,而渲染器正停在 `confirm()` 那一行上。
|
|
20720
|
+
* ⇒ **先直接发 `handleJavaScriptDialog`**(它由浏览器进程处理,不经过被阻塞的渲染器),
|
|
20721
|
+
* 成功/失败都能立刻知道;`Page.enable` 只在需要**事件面**(拿弹窗类型与正文)时**事后**补。
|
|
20722
|
+
*
|
|
20723
|
+
* ⚠️ 代价如实登记:不 enable 就拿不到 `Page.javascriptDialogOpening` 的 type/message,
|
|
20724
|
+
* 所以本函数报的 `type`/`message` 多为空。**这不是缺陷** —— 判据是「先把页面救回来」,
|
|
20725
|
+
* 而类型/正文属于附加信息(要它就得在弹窗出现**之前** enable,那是调用方的编排问题)。
|
|
20726
|
+
*/
|
|
20727
|
+
const send = async (method, params, timeoutMs) => await withPage(slot, targetId, async (s) => await s(method, params, timeoutMs));
|
|
20728
|
+
try {
|
|
20729
|
+
await send("Page.handleJavaScriptDialog", {
|
|
20730
|
+
accept,
|
|
20731
|
+
...promptText !== void 0 ? { promptText } : {}
|
|
20732
|
+
}, 8e3);
|
|
20733
|
+
return {
|
|
20734
|
+
hadDialog: true,
|
|
20735
|
+
type: "",
|
|
20736
|
+
message: "",
|
|
20737
|
+
accepted: accept
|
|
20738
|
+
};
|
|
20739
|
+
} catch (e) {
|
|
20740
|
+
const msg = String(e?.message ?? e);
|
|
20741
|
+
if (/no dialog|No dialog is showing/i.test(msg)) return {
|
|
20742
|
+
hadDialog: false,
|
|
20743
|
+
type: "",
|
|
20744
|
+
message: "",
|
|
20745
|
+
accepted: false
|
|
20746
|
+
};
|
|
20747
|
+
if (/超时|timeout/i.test(msg)) throw new Error("⛔ 处理弹窗超时:连 handleJavaScriptDialog 都没能在 8s 内返回。\n ⇒ 这个 target 已经不响应了(多半是被 sync alert/confirm 卡住且浏览器进程也没接住)。\n ⇒ 出路:close 掉这个 tab 重来(页面状态已不可信)—— ⛔ 不要反复重试同一个 target。");
|
|
20748
|
+
throw e;
|
|
20749
|
+
}
|
|
20743
20750
|
}
|
|
20744
20751
|
/**
|
|
20745
20752
|
* 在页面里等一个条件成立(`wait` 动作)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shgroup/dsh-serenity-hooks",
|
|
3
|
-
"version": "1.130.
|
|
3
|
+
"version": "1.130.3",
|
|
4
4
|
"description": "宁静号 ACC harness(Native Cordis 插件)——给 DeepSeek Harness 装一个「AI 工作区」:14 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/localstore/container_admin/browser_slot;另三个 im-bridge/diagram/reconstruct 按条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫/对外输出守卫)+ 认知轨迹日志与原地重建 + 网页登录入口/IM 桥/认知轨迹唤醒注册表 + 浏览器槽位管理(≤20 个独立 profile 的 Chrome 槽位,带占用归属与异常时向所属会话反向注入提醒)。轨迹声明 = 轨迹目录下的 trajectory.json(约束面 + 旧标识 uid + CRO 机器绑定 cro.host;旧名 trajectory-constraint.json / skiff.json 仍在读取族里);轨迹提示词 = 轨迹目录下的 PROMPT.md(一条轨迹「是谁、按什么章程工作」,所有轨迹通用,追加在容器层与质量层之后,不替换它们)。适配 DSH 0.1.7-rc.1 / 0.2.0-rc.1 / 0.2.1-rc.1(三档)。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|