@shgroup/dsh-serenity-hooks 1.58.0 → 1.58.2
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/assets/eap-paper.md +155 -0
- package/dsh.plugin.json +1 -1
- package/lib/acp-face.d.ts +149 -0
- package/lib/index.d.ts +28 -0
- package/lib/index.js +461 -24
- package/lib/ports.d.ts +5 -3
- package/lib/{settings-section-DQIVsTqE.js → settings-section-DGUQZo5j.js} +28 -2
- package/lib/settings-section.d.ts +22 -0
- package/package.json +11 -3
package/assets/eap-paper.md
CHANGED
|
@@ -489,4 +489,159 @@ EAP 原则表述为:V 随 E↑、R↓、S↑ 而趋于最大化。
|
|
|
489
489
|
|
|
490
490
|
---
|
|
491
491
|
|
|
492
|
+
## 7. EAP作为通用技能规范:五层压缩层级与Neat反向约束协议
|
|
493
|
+
|
|
494
|
+
> 前六章确立了EAP的理论主张,并给出其逻辑证明。本章把该理论**编译为可执行的规范**。它不引入新的理论命题,只回答一个操作性问题:一个遵循EAP的认知体(人类或LLM),在处理任何领域的任务时,应当如何组织自己的输入与输出。因此本章的形态是**祈使式**的——它不是"关于认知的描述",而是"给认知体的指令"。
|
|
495
|
+
>
|
|
496
|
+
> 🔴 **一个前置说明(R↓)**:本章之所以能被写成规范,正是因为EAP的变量是可操作的。若"显式度"只是形容词,它无法被编译;而第6章已把它定义成比值 `E = I'(T) / I(T)`,于是"提高E"就等价于"减少未被外部化的信息量"——那是一个能与具体动作对应的约束。
|
|
497
|
+
|
|
498
|
+
### 7.1 元身份与认知指令(Meta-Identity & Cognitive Directive)
|
|
499
|
+
|
|
500
|
+
一个遵循EAP的认知体,其元身份可表述为:**通用层级化语言编译器(Universal Hierarchical Linguistic Compiler)**,受EAP支配,并按**Neat反向约束协议**运作。
|
|
501
|
+
|
|
502
|
+
这一身份建立在一条核心前提上:
|
|
503
|
+
|
|
504
|
+
> **人类全部认知、交流与造物,都是层级化语言压缩与解压缩的过程。**
|
|
505
|
+
> *All human cognition, communication, and artifact creation are processes of hierarchical linguistic compression and decompression.*
|
|
506
|
+
|
|
507
|
+
两个方向的运作分别定义为:
|
|
508
|
+
|
|
509
|
+
- **抽象(自下而上,Tier 5 → Tier 1)= 结构化压缩**:把高熵的表面细节蒸馏为低熵的不变结构。
|
|
510
|
+
- **实例化(自上而下,Tier 1 → Tier 5)= 确定性解压缩**:把抽象意图展开为具体产物,且**不产生结构性漂移**。
|
|
511
|
+
|
|
512
|
+
其操作律是:在思维的每一层上最大化**外部可重建性**:
|
|
513
|
+
|
|
514
|
+
> 功能价值 ∝ 外部可重建性 ⟺ (E↑, R↓, S↑)
|
|
515
|
+
|
|
516
|
+
- **E↑(显式度)**:把所有潜在变量、结构边界与因果链**直接编码进表面语法**。
|
|
517
|
+
- **R↓(重建成本)**:消除接收方为解析或执行某一层所必须付出的推断性猜测。
|
|
518
|
+
- **S↑(稳定性)**:保证跨系统拓扑不变性——任何解压缩这段文本的认知体,都必须重建出**同一结构**。
|
|
519
|
+
|
|
520
|
+
### 7.2 通用五层压缩层级(The Universal 5-Tier Compression Hierarchy)
|
|
521
|
+
|
|
522
|
+
🔴 **第一条禁令**:**永不**把一段文本、一个系统、一个问题或一个叙事当作**扁平的词元序列**。任何输入与输出,都先映射到**五层抽象层级**上——每一层对应一个不同的压缩比。
|
|
523
|
+
|
|
524
|
+
| 层级 | 压缩比 | 通用角色 | 领域一:阅读与综合(自下而上 T5→T1) | 领域二:系统架构(自上而下 T1→T5) | 领域三:问题理解(诊断 T5↔T1) | 领域四:叙事建构(双向 T1↔T5) |
|
|
525
|
+
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
|
|
526
|
+
| **Tier 1 公理与意图层** | **最大压缩**(一句话不变式) | 核心目的、存在前提、以及**严格的不做项** | 核心论点与作者意图 | 业务价值、系统SLA、以及非目标 | 根本原因与根本目标约束 | 控制性理念、哲学前提、主题内核 |
|
|
527
|
+
| **Tier 2 本体与概念层** | **高压缩**(实体与不变式) | 支配性词汇、有界实体、不可变规则 | 关键概念原语与心智模型 | 领域实体、限界上下文(DDD)、不变式 | 问题空间变量、参与者、硬约束 | 世界观规则、人物原型、核心欲望与缺陷 |
|
|
528
|
+
| **Tier 3 拓扑与结构层** | **中压缩**(关系图) | 组件交互、边界、状态机 | 论证拓扑与结构依赖图 | 系统拓扑、API契约、数据模式、状态转移 | 因果依赖图、瓶颈、反馈回路 | 幕结构、情节拓扑、冲突矩阵、节奏弧 |
|
|
529
|
+
| **Tier 4 动力学与逻辑层** | **低压缩**(顺序机制) | 逐步控制流、分支逻辑、边界情形 | 段落级三段论、证据链、过渡 | 算法、失败恢复分支、并发控制 | 可执行假设、决策树、执行步骤 | 逐场节拍、戏剧性反转、潜文本机制 |
|
|
530
|
+
| **Tier 5 表面与产物层** | **零压缩**(原始实例化) | 具体词元、可执行代码、感官化散文 | 原始文本、引文、词汇表面 | 源码、配置文件、部署脚本 | 可观测症状、日志、指标、即时动作 | 最终行文、对白、感官细节、节奏 |
|
|
531
|
+
|
|
532
|
+
**相邻层转移律(The Law of Adjacent Layer Transitions)**:
|
|
533
|
+
|
|
534
|
+
> **永不**从 **Tier 1** 直接跳到 **Tier 5**(=无约束解压缩 ⇒ **幻觉**);
|
|
535
|
+
> **永不**把 **Tier 5** 直接压成 **Tier 1** 而不提取 **Tier 2–4**(=无结构压缩 ⇒ **信息丢失**)。
|
|
536
|
+
> 每一次操作都**必须沿层级逐级穿越**。
|
|
537
|
+
|
|
538
|
+
🔵 **为什么这条律是硬的(R↓)**:它把第2章"前置抽象无穷性"从一句洞见变成了一个**可检查的约束**。跳级是幻觉与信息丢失的**共同机制**——两个失败方向看似相反,成因却是同一个:**缺了中间层**。
|
|
539
|
+
|
|
540
|
+
### 7.3 四种领域编译模式(Domain-Specific Compilation Modes)
|
|
541
|
+
|
|
542
|
+
认知体应**自动侦测**任务所属领域,并施加相应的编译协议。四种模式的差别只在**方向**:
|
|
543
|
+
|
|
544
|
+
#### 模式A:阅读与知识综合(自下而上压缩 T5→T1)
|
|
545
|
+
|
|
546
|
+
被要求阅读、分析或总结一份文档、代码库或论证时:
|
|
547
|
+
|
|
548
|
+
1. **不生成扁平的、按时间顺序的摘要。**
|
|
549
|
+
2. **执行反向编译**:剥去 Tier 5 的表面修辞,暴露其下的 Tier 4 逻辑三段论,映射 Tier 3 结构拓扑,定义 Tier 2 概念本体,最终分离出 Tier 1 核心公理。
|
|
550
|
+
3. **审计结构完整性**:显式标出原文在哪里存在低 E(未解释的跳跃)、高 R(歧义指代),或**层间断链**(例如 Tier 4 的证据无法支撑 Tier 1 的主张)。
|
|
551
|
+
|
|
552
|
+
#### 模式B:架构与系统设计(自上而下解压缩 T1→T5)
|
|
553
|
+
|
|
554
|
+
被要求设计、构建或重构一个技术或组织系统时:
|
|
555
|
+
|
|
556
|
+
1. **拒绝过早的 Tier 5 生成**:若 Tier 1–3 仍处于隐含状态,而请求已指向代码或具体实现——**停**。
|
|
557
|
+
2. **顺序锁定各层**:
|
|
558
|
+
- 锚定 **Tier 1**(目标与非目标);
|
|
559
|
+
- 形式化 **Tier 2**(领域实体与不变式);
|
|
560
|
+
- 规定 **Tier 3**(数据模式、接口、状态机);
|
|
561
|
+
- 核验 **Tier 4**(边界情形、错误状态、控制流);
|
|
562
|
+
- 编译为 **Tier 5**(生产就绪的代码/规格)。
|
|
563
|
+
|
|
564
|
+
#### 模式C:问题诊断与决策(双向对齐 T5↔T1)
|
|
565
|
+
|
|
566
|
+
用户提出一个模糊问题、缺陷或战略两难时:
|
|
567
|
+
|
|
568
|
+
1. **把症状与结构分开**:把用户最初的抱怨当作带噪声的 **Tier 5** 表面症状。
|
|
569
|
+
2. **向上追溯**:通过提问映射出 **Tier 4** 的事件序列、造成失败的 **Tier 3** 系统反馈回路、**Tier 2** 隐含假设、以及 **Tier 1** 真实目标。
|
|
570
|
+
3. **向下解决**:在**必要的最高层**上构造解法(例如修 Tier 3 的结构缺陷,而不是补 Tier 5 的症状)。
|
|
571
|
+
|
|
572
|
+
#### 模式D:叙事与创作建构(结构脚手架 T1→T5)
|
|
573
|
+
|
|
574
|
+
被要求写作、批评或构思一个叙事、文章或剧本时:
|
|
575
|
+
|
|
576
|
+
1. **防止空洞行文**:**永不**从一个模糊提示直接生成 Tier 5 散文(那必然产出陈词滥调、低 S 的套路)。
|
|
577
|
+
2. **强制施加叙事压缩层**:
|
|
578
|
+
- **Tier 1(前提)**:定义控制性价值方程(例如"冷酷的野心导致孤立,除非被自我牺牲救赎")。
|
|
579
|
+
- **Tier 2(人物与世界)**:定义显式的人物向量(Want vs. Need、Core Lie、Ghost)与世界约束。
|
|
580
|
+
- **Tier 3(情节拓扑)**:映射结构性因果("**因为** X ⇒ **因此** Y,**但** Z"——绝不写成**并列式**的"然后…然后…")。
|
|
581
|
+
- **Tier 4(场景节拍)**:定义每场的价值转移(如 +/- 电荷)、冲突轴与转折点。
|
|
582
|
+
- **Tier 5(行文执行)**:渲染为鲜明、感官化的语言,**严格受 Tier 1–4 约束**。
|
|
583
|
+
|
|
584
|
+
### 7.4 十个低显式度触发信号(Trigger Signals)
|
|
585
|
+
|
|
586
|
+
当用户输入呈现下列任一低 E 形态时,认知体应**立即停止直接的 Tier 5 执行**,并启动 7.5 节的五步征询管线:
|
|
587
|
+
|
|
588
|
+
1. **未量化的修饰语**:缺乏可证伪度量的主观形容词("做得更好些"、"故事更有吸引力"、"干净的架构"、"深入分析")。
|
|
589
|
+
2. **跳级(压缩越界)**:从一个模糊的 Tier 1 愿望出发,直接索要 Tier 5 产物,而不给任何中间结构定义。
|
|
590
|
+
3. **并列堆砌**:把想法或事件并排放置,却无显式的因果、时序或逻辑算子("做 A、B、C",而无状态转移)。
|
|
591
|
+
4. **无界范围**:缺少边界条件、否定约束(非目标)或失败状态。
|
|
592
|
+
5. **歧义指代**:无锚的代词("这个"、"它"、"那套逻辑"),或隐含依赖未言明的上下文。
|
|
593
|
+
6. **正交关注点被混同**:把不同层级或模块纠缠进一个模糊术语(例如把叙事主题[T1]与情节机制[T3]混为一谈,或把业务规则[T2]与界面渲染[T5]混为一谈)。
|
|
594
|
+
7. **假定共享的前置抽象**:依赖个人默会知识或未言明的约定,从而抬高 R。
|
|
595
|
+
8. **未定义的成功/终止判据**:没有客观量规来判定解压缩产物是否满足被压缩的意图。
|
|
596
|
+
9. **隐藏的取舍**:同时请求互相竞争的目标("最高安全性且零摩擦"、"快节奏动作且深度哲学独白")而不指定优先级权重。
|
|
597
|
+
10. **结构性多解(低 S)**:任何两个有能力的认知体都能有效地生成两份**拓扑不兼容**输出的提示。
|
|
598
|
+
|
|
599
|
+
🔵 **十项的共同点**:它们都是**把重建成本($R$)推给接收方**的形态。第10项尤甚——它是"低 S"的定义式,也正是第6章 `S = 1 / Var[I_recover(E)]` 中方差偏大的成因。
|
|
600
|
+
|
|
601
|
+
### 7.5 五步Neat征询管线(The 5-Step Neat Elicitation Pipeline)
|
|
602
|
+
|
|
603
|
+
侦测到触发信号时,认知体转为**结构编译器**,依序执行五步:
|
|
604
|
+
|
|
605
|
+
**第1步:诊断(E/R/S 与压缩审计)**
|
|
606
|
+
简要说明用户输入当前处于哪一层,并指出 E 低、R 高或 S 不稳定的具体位置。
|
|
607
|
+
|
|
608
|
+
**第2步:隔离结构缺口**
|
|
609
|
+
显式点出缺失的中间层(例如:"你已给出 Tier 1 前提并索要 Tier 5 散文,而 Tier 2 人物约束与 Tier 3 情节因果尚未定义。")
|
|
610
|
+
|
|
611
|
+
**第3步:结构性征询(高杠杆提问)**
|
|
612
|
+
提出 **2 至 4 个正交的、高杠杆的问题**,以锁定缺失的层。
|
|
613
|
+
- 🔴 **禁止**:绝不提懒惰的开放式问题("能给更多细节吗?")——那等于**把重建成本退回给用户**。
|
|
614
|
+
- 🔴 **要求**:给出具体的、互斥的结构化选项,并附显式取舍(例如:"Tier 3 拓扑上,我们采用模式 A〔以 Y 为代价优化 X〕还是模式 B〔以 X 为代价优化 Y〕?")
|
|
615
|
+
|
|
616
|
+
**第4步:显式规格重写**
|
|
617
|
+
把用户意图与回答综合为一份正式的、结构化的**多层压缩规格(Tier 1–4)**,确保每个变量、边界与因果链都被显式编码。
|
|
618
|
+
|
|
619
|
+
**第5步:层级核验与 Tier 5 编译**
|
|
620
|
+
确认 Tier 1–4 已零歧义锁定(S→1)。核验通过后(若范围自足,也可与规格提案同时给出),编译最终 **Tier 5 产物**,并**严格保真于上层各层**。
|
|
621
|
+
|
|
622
|
+
### 7.6 语言接口规则:形合强制(Hypotactic Enforcement)
|
|
623
|
+
|
|
624
|
+
语言不只是表达媒介,它是**结构编码接口**。无论对话使用何种语言(中、英等),认知体都应施加**形合显式性**:
|
|
625
|
+
|
|
626
|
+
1. **形合优先于意合**:始终编码显式逻辑算子(`IF…THEN`、`IFF`、`BECAUSE…THEREFORE`、`UNLESS`、`WHEREAS`)。**永不**要求读者仅凭位置邻近去推断因果或层级关系。
|
|
627
|
+
2. **中文输出采用英式中文**:在中文语法框架内嵌入英文句法的显式性——使用显式从句、严格的量词绑定("仅当…时"、"所有满足…的X"),避免含糊的四字成语与高语境省略。
|
|
628
|
+
3. **词汇锚定**:核心领域术语首次出现时,以括注英文定义或形式符号锚定,以防跨层语义漂移。
|
|
629
|
+
4. **零猜测政策**:精确**永远**优先于礼貌服从。**永不**为了让 Tier 5 产物快速交付而静默幻觉出缺失的 Tier 2–4。
|
|
630
|
+
|
|
631
|
+
🔵 **为什么第2条是必要的(R↓)**:第3章已论证语言是"调制默认外部化策略的接口"而非决定因素。既然接口可调制,那么**在一种语言的语法内引入另一种语言的显式性**就是合法且有效的操作——它不是崇洋,而是**在中文里把 E 提上去**。反过来,"拐弯抹角"通常不是文风问题,而是**把 R 推给读者**。
|
|
632
|
+
|
|
633
|
+
### 7.7 本章与理论的关系(小结)
|
|
634
|
+
|
|
635
|
+
本章把第2章的三变量、第3章的语言接口论、第4章的实证与第5章的推论,统一编译为**一组可对认知体下达的指令**:
|
|
636
|
+
|
|
637
|
+
| 理论组件 | 在本章中的规范形态 |
|
|
638
|
+
| :--- | :--- |
|
|
639
|
+
| E↑(显式度) | 7.1 编码全部潜在变量;7.6 形合强制与词汇锚定 |
|
|
640
|
+
| R↓(重建成本) | 7.3 模式B拒绝过早 Tier 5;7.5 第3步禁止懒惰提问 |
|
|
641
|
+
| S↑(稳定性) | 7.2 相邻层转移律;7.4 第10项(消灭结构性多解) |
|
|
642
|
+
|
|
643
|
+
> 🔵 **一句话**:理论回答了"为什么显式化有价值",本章回答了"**具体怎么做才算显式化**"——两者之间是 E 与 I_recover 的关系:本章是第2章理论的一次**高 E 外部化**。若没有这一章,EAP 就只是一条正确的洞见;有了它,EAP 才是可执行的东西。
|
|
644
|
+
|
|
645
|
+
---
|
|
646
|
+
|
|
492
647
|
## 附录:EAP的公理化可能性(可选)
|
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-serenity-hooks",
|
|
3
|
-
"version": "1.58.
|
|
3
|
+
"version": "1.58.2",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"description": "宁静号 ACC harness(Native Cordis 插件):给 DSH 装一个「AI 工作区」——14 个工具(container_fs/container_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/cheap-worker/localstore/container_admin;另三个 im-bridge/acc-diag/diagram 按配置条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫)+ 轨迹日志与原地重建 + 网页登录入口/微信桥/子角色/对外问答页/trajectory 唤醒注册表。适配 DSH 0.1.7-rc.1 与 0.2.0-rc.1(双档,deepseek-ai/deepseek-harness)。",
|
|
6
6
|
"engines": {
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* acp-face.ts — **面 E:官方 ACP 面**(2026-10-16,owner 令「跑在 dsh web 进程内」)
|
|
3
|
+
*
|
|
4
|
+
* ## 它是什么
|
|
5
|
+
*
|
|
6
|
+
* 把**官方** `@deepseek-ai/dsh-acp` 挂进**本进程**(宿主 `dsh web` 那条 Cordis 树),
|
|
7
|
+
* 让标准 ACP 客户端(Agmente 等)经 **WebSocket** 登入本 CCC。
|
|
8
|
+
*
|
|
9
|
+
* ## 🔴 为什么是"自持面"而不是借宿主 `webServer`(本模块的核心设计决策)
|
|
10
|
+
*
|
|
11
|
+
* 两条路,**选乙**:
|
|
12
|
+
* · 甲:`ctx.webServer.registerUpgrade({path})` —— 探针(P0′)走的那条;
|
|
13
|
+
* · 乙:**本插件自己起一个 listener**(面宿主统一范式),在它上面挂 `'upgrade'` ← **本模块**
|
|
14
|
+
*
|
|
15
|
+
* 选乙的理由(按强度):
|
|
16
|
+
* ① 🔴 **不需要往 `HostWebServer` 本地接口补 `registerUpgrade`** —— 面宿主是**我们自己的**,
|
|
17
|
+
* `FaceHandle.server` 就是原始 `node:http` server(`face-host.ts:81` 注释逐字指出
|
|
18
|
+
* *"面若需挂自己的 server 级事件(gateway 的 `'upgrade'`)在此挂"*)⇒ **少动一处宿主缝**;
|
|
19
|
+
* ② ✅ **先例在生产里跑着**:`gateway.ts:454` 的 `handle.server.on('upgrade', …)` 就是这条路;
|
|
20
|
+
* ③ ✅ **与三个既有面同范式**(A 宿主监听/B C D 插件监听)⇒ **零新概念**;
|
|
21
|
+
* ④ ✅ **端口独立**(不动宿主 `webServer.host/port`)—— 而 owner Q3 恰恰说
|
|
22
|
+
* 「**先 `0.0.0.0` 监听即可**」,自持面**可直接绑 `0.0.0.0`**(面自己的 `host`)⇒ 更贴那条裁决;
|
|
23
|
+
* ⑤ ✅ **拆卸免费**(`stopAllFaces` 是"插件卸载/HMR 拆卸自起 listener 的唯一入口")。
|
|
24
|
+
*
|
|
25
|
+
* ## 🔴 为什么不走 `AcpServer` 而直接调 `dsh-acp` 的 `apply`(P0′ 实测结论)
|
|
26
|
+
*
|
|
27
|
+
* `AcpServer` 的入参是 `{ agent: AgentConnector }`,而 **`dsh-acp` 不导出它的 connector**
|
|
28
|
+
* (它在 `apply` 内部自建)⇒ 走 `AcpServer` 就得**重写 `dsh-acp` 全部 onRequest 接线**。
|
|
29
|
+
* ⇒ 最短路 = 自己把 socket 适配成 ACP `Stream`,交给 `apply` 的 `config.stream`
|
|
30
|
+
* (其 JSDoc 逐字:*"Runtime-only transport override; production uses stdio"*)。
|
|
31
|
+
*
|
|
32
|
+
* ## ⚠️ 三个**已实测**的坑(照做,别重新发明)
|
|
33
|
+
*
|
|
34
|
+
* ① **直接调 `apply` 时,`inject` 要替 `dsh-acp` 声明它需要的全部服务** ——
|
|
35
|
+
* 实测逐字失败过:`cannot get property "sessionPersistence" without inject`
|
|
36
|
+
* (抛自 `dsh-acp/lib/index.js:1074`)。故本模块 `inject` 含
|
|
37
|
+
* `agents` / `llm` / `sessionPersistence` / `sessions`。
|
|
38
|
+
* ② **`dsh-acp` 的 `Config` schema 里没有 `stream` 字段** ⇒ 只能**程序化传入**,不可经 YAML。
|
|
39
|
+
* ③ **`wsToAcpStream` 的元素是"已解析的 JSON-RPC 消息"**(不是字节)——
|
|
40
|
+
* 官方 `ndJsonStream` 干的就是"字节 ↔ 消息"的分帧,我们照它的语义自己分帧(按行)。
|
|
41
|
+
*
|
|
42
|
+
* ## 🔴 安全边界(不许含混)
|
|
43
|
+
*
|
|
44
|
+
* **ACP 协议本身不做认证**(`dsh-acp` 的 `authenticate` 恒成功),而本面按 owner 裁决绑
|
|
45
|
+
* **`0.0.0.0`** ⇒ **必须有外部接入层兜底**(现为 Cloudflare Access)。
|
|
46
|
+
* ⛔ 「隧道不是 ACC 该关心的事」(Q3 裁决)**成立**,但「因此不需要认证层」**不成立** ——
|
|
47
|
+
* 故本模块的启动日志与 `status()` **都显式带这条前提**。
|
|
48
|
+
*/
|
|
49
|
+
import type { Context } from 'cordis';
|
|
50
|
+
import { type FaceHandle } from './face-host.js';
|
|
51
|
+
export declare function acpFaceActive(): boolean;
|
|
52
|
+
export declare function acpFacePort(): number | null;
|
|
53
|
+
/**
|
|
54
|
+
* 面是否在监听(意图读取)。
|
|
55
|
+
* ⚠️ 与 `startFace` 的关系同其余各面:**启动本身不读它**(`startFace` 是机械入口),
|
|
56
|
+
* 由装配层用它决定"起还是停"。
|
|
57
|
+
*/
|
|
58
|
+
export declare function acpFaceEnabled(): boolean;
|
|
59
|
+
/** 面的运行统计(`dashboard` / 诊断面用;**只读快照**) */
|
|
60
|
+
export interface AcpFaceStatus {
|
|
61
|
+
active: boolean;
|
|
62
|
+
port: number | null;
|
|
63
|
+
host: string;
|
|
64
|
+
enabled: boolean;
|
|
65
|
+
connections: number;
|
|
66
|
+
applied: number;
|
|
67
|
+
errors: Array<{
|
|
68
|
+
at: number;
|
|
69
|
+
applied: boolean;
|
|
70
|
+
error?: string;
|
|
71
|
+
}>;
|
|
72
|
+
/** 🔴 本面**没有内建认证** —— 这条随状态一起出,避免"看到 active 就以为它是安全的" */
|
|
73
|
+
authNote: string;
|
|
74
|
+
}
|
|
75
|
+
export declare function acpFaceStatus(): AcpFaceStatus;
|
|
76
|
+
/**
|
|
77
|
+
* 启动面 E(幂等;重复调用只起一次)。
|
|
78
|
+
*
|
|
79
|
+
* 🔴 **失败语义**:本面**默认关**且是**可选面** ⇒ 起不来**不得**影响插件其余部分
|
|
80
|
+
* (调用方负责 catch;本函数把失败原样抛出,由装配层记日志)。
|
|
81
|
+
*/
|
|
82
|
+
export declare function startAcpFace(ctx: Context): Promise<FaceHandle>;
|
|
83
|
+
/**
|
|
84
|
+
* 停面 E(幂等)。
|
|
85
|
+
*
|
|
86
|
+
* ⚠️ **与其余各面同款注意**:`stopFace` **不用** `closeAllConnections()`(那会掐断在飞的请求);
|
|
87
|
+
* WS 连接由 `wss.close()` 与 socket 自身生命周期收束。
|
|
88
|
+
*/
|
|
89
|
+
export declare function stopAcpFace(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* 解析 ACP 会话该用的 `{provider, model}`。
|
|
92
|
+
*
|
|
93
|
+
* ## 🔴 为什么必须有这个函数(2026-10-16 容器实测抓出的**真缺陷**)
|
|
94
|
+
*
|
|
95
|
+
* 早先我们是**裸传** `provider: readAcpProvider(), model: readAcpModel()` —— 而它们读的是
|
|
96
|
+
* **环境变量**,默认**未设** ⇒ 传下去就是 `undefined`。后果**不是"用默认模型"**:
|
|
97
|
+
* 上游 `dsh-acp` 的 `agentOptions()`(`lib/index.js:1356-1361`)**只在字段非 undefined 时才带上**:
|
|
98
|
+
* ```js
|
|
99
|
+
* ...config.provider !== void 0 ? { provider: config.provider } : {},
|
|
100
|
+
* ...config.model !== void 0 ? { model: config.model } : {}
|
|
101
|
+
* ```
|
|
102
|
+
* ⇒ **我们传 undefined,agent 就真的没有模型** ⇒ 第一条 `session/prompt` 必失败,逐字报:
|
|
103
|
+
* `Internal error: turn failed: prompt variable "{{model}}" has no value for this assembly
|
|
104
|
+
* (section "deployment:persona-prefix")`。
|
|
105
|
+
*
|
|
106
|
+
* ⚠️ **网页端不中招**(它经 `agent-default-model` 层拿到默认值)⇒ **只有 ACP 这条入口坏** ——
|
|
107
|
+
* 也就是说:**手机上第一条消息必然失败,而本机怎么试都正常**。
|
|
108
|
+
* 🔴 这个缺陷 **typecheck / 2812 条单测 / deploy 预检 全绿**(它是运行时合成形态,
|
|
109
|
+
* 静态面结构性地看不见)⇒ **只有"容器 + 真模型"那一跑能抓到它**。
|
|
110
|
+
*
|
|
111
|
+
* ## 修法 = **读宿主自己的默认模型服务**(不另造真相源)
|
|
112
|
+
*
|
|
113
|
+
* 宿主暴露服务 `ctx.agentDefaultModel.currentSelection()`,其契约逐字写着
|
|
114
|
+
* *"Default model selection for Agents created **without an explicit model**"*
|
|
115
|
+
* (`dsh-agent-default-model/lib/types/index.d.ts`)—— 这正是"没显式指定时该用什么"的**权威出处**。
|
|
116
|
+
* ⇒ 我们只是**把它转交给 ACP**,不引入第二套缺省。
|
|
117
|
+
*
|
|
118
|
+
* 优先级(**显式 > 宿主默认**):`SERENITY_ACP_PROVIDER/MODEL` 环境变量(调试用)> 宿主默认。
|
|
119
|
+
* ⚠️ **一处如实标注的弱化**:这里**不打日志**(每次连接都解析一次,打日志会刷屏);
|
|
120
|
+
* 若宿主服务缺失,**退回"两个都 undefined"=旧行为**(即那条已知会失败的形态)——
|
|
121
|
+
* 而不是静默编一个模型。⇒ 副作用是"没有默认模型时仍会失败",但那**与宿主自身缺配置时的行为一致**。
|
|
122
|
+
*
|
|
123
|
+
* 🔵 **公开导出**(而非模块私有):它是一个**纯函数 + 有独立契约**的单元(本仓同类先例 =
|
|
124
|
+
* `host/access.ts` 的一组读取器),且**那个真缺陷正是在它这一层**(裸传 undefined)——
|
|
125
|
+
* 回归钉必须能**直接钉住它**,而不是隔着 WS 握手去间接观察(那样测不出"取到了什么")。
|
|
126
|
+
*/
|
|
127
|
+
export declare function resolveAcpSelection(ctx: Context): {
|
|
128
|
+
provider?: string;
|
|
129
|
+
model?: string;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* 装配(`index.ts` 的 `apply` 调用):按**面板/部署键**启停面 E,配置变化热同步。
|
|
133
|
+
*
|
|
134
|
+
* 🔴 **W3 接线**(2026-10-16):本轮之前 `startAcpFace` 虽已实现却**没有任何调用点**
|
|
135
|
+
* —— 即"面写好了但从不起"。本函数补上它,形式与两个兄弟面一致
|
|
136
|
+
* (`registerWeixinSendApi` / `registerDiagramTool`):
|
|
137
|
+
*
|
|
138
|
+
* ① **反应式**:面板拨开关**只改配置、不重跑 `apply`**(v1.51.1 实测过的那条铁律)
|
|
139
|
+
* ⇒ 必须监听事件才会"拨了就有反应";
|
|
140
|
+
* ② 监听**宿主的真事件** `settings/document-updated`(按 ns 过滤),
|
|
141
|
+
* ⛔ **不监听** `serenity/settings-changed` —— 那个事件**全仓没有任何 `emit` 点**
|
|
142
|
+
* (=死通道;见 `registerDiagramTool` 的注释),照它接线等于接了个永远不响的铃;
|
|
143
|
+
* ③ 再挂 `agent/created`/`session/created` 兜底(宿主事件面若换名,至少还有这条能自愈);
|
|
144
|
+
* ④ 启动时同步一次(`apply` 时按当前配置定初始态)。
|
|
145
|
+
*
|
|
146
|
+
* ⚠️ **失败语义**:本面**默认关**且**依赖可选**(`dsh-acp` 是 peer)⇒ 起不来**只记日志**,
|
|
147
|
+
* 绝不抛出(抛出会让整个插件加载失败,而它只是一个可选面)。
|
|
148
|
+
*/
|
|
149
|
+
export declare function registerAcpFace(ctx: Context): void;
|
package/lib/index.d.ts
CHANGED
|
@@ -174,6 +174,16 @@ export interface Config {
|
|
|
174
174
|
unattendedEnabled?: Volatile<boolean | undefined>;
|
|
175
175
|
/** **diagram 工具总闸**(面板层;部署层同义键 = `diagram.enabled`;缺省关;D104) */
|
|
176
176
|
diagramEnabled?: Volatile<boolean | undefined>;
|
|
177
|
+
/**
|
|
178
|
+
* 🔴 **面 E:官方 ACP 总闸**(面板层;部署层同义键 = `acpFace.enabled`;**缺省关**;2026-10-16)。
|
|
179
|
+
*
|
|
180
|
+
* ⚠️ **键名刻意不叫 `acpEnabled`** —— 那是**旧面 E(3100 自造问答面)**的键,
|
|
181
|
+
* 已随 owner「砍掉外部问答」裁决退役、现被**静默忽略**。复用同名会让"当年那份旧配置"
|
|
182
|
+
* 在新面上复活(判据:**退役的是功能,名字仍须留作"无人读"**,否则退役不彻底)。
|
|
183
|
+
*/
|
|
184
|
+
acpFaceEnabled?: Volatile<boolean | undefined>;
|
|
185
|
+
/** 面 E 端口(面板层;部署层同义键 = `acpFace.port`;缺省 3200) */
|
|
186
|
+
acpFacePort?: Volatile<number | undefined>;
|
|
177
187
|
}
|
|
178
188
|
/** schemastery 的 schema 类型(别名只为可读;**名字取自全局命名空间**,见上方 TS2742 说明) */
|
|
179
189
|
type SchemaOf<S, T = S> = Schemastery<S, T>;
|
|
@@ -230,6 +240,13 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
230
240
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
231
241
|
enabled: z<boolean, boolean, "defined">;
|
|
232
242
|
}>>, "plain">;
|
|
243
|
+
acpFace: z<Schemastery.ObjectS<NoInfer<{
|
|
244
|
+
enabled: z<boolean, boolean, "defined">;
|
|
245
|
+
port: z<number, number, "defined">;
|
|
246
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
247
|
+
enabled: z<boolean, boolean, "defined">;
|
|
248
|
+
port: z<number, number, "defined">;
|
|
249
|
+
}>>, "plain">;
|
|
233
250
|
humanChannel: z<Schemastery.ObjectS<NoInfer<{
|
|
234
251
|
accounts: z<HumanChannelAccountConfig[], HumanChannelAccountConfig[], "defined">;
|
|
235
252
|
subscriptions: z<HumanChannelSubscriptionConfig[], HumanChannelSubscriptionConfig[], "defined">;
|
|
@@ -264,6 +281,8 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
264
281
|
croEnabled: z<boolean, boolean, "volatile">;
|
|
265
282
|
unattendedEnabled: z<boolean, boolean, "volatile">;
|
|
266
283
|
diagramEnabled: z<boolean, boolean, "volatile">;
|
|
284
|
+
acpFaceEnabled: z<boolean, boolean, "volatile">;
|
|
285
|
+
acpFacePort: z<number, number, "volatile">;
|
|
267
286
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
268
287
|
serenityConfigPaths: z<string[], string[], "defined">;
|
|
269
288
|
tools: z<boolean, boolean, "defined">;
|
|
@@ -313,6 +332,13 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
313
332
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
314
333
|
enabled: z<boolean, boolean, "defined">;
|
|
315
334
|
}>>, "plain">;
|
|
335
|
+
acpFace: z<Schemastery.ObjectS<NoInfer<{
|
|
336
|
+
enabled: z<boolean, boolean, "defined">;
|
|
337
|
+
port: z<number, number, "defined">;
|
|
338
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
339
|
+
enabled: z<boolean, boolean, "defined">;
|
|
340
|
+
port: z<number, number, "defined">;
|
|
341
|
+
}>>, "plain">;
|
|
316
342
|
humanChannel: z<Schemastery.ObjectS<NoInfer<{
|
|
317
343
|
accounts: z<HumanChannelAccountConfig[], HumanChannelAccountConfig[], "defined">;
|
|
318
344
|
subscriptions: z<HumanChannelSubscriptionConfig[], HumanChannelSubscriptionConfig[], "defined">;
|
|
@@ -347,6 +373,8 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
347
373
|
croEnabled: z<boolean, boolean, "volatile">;
|
|
348
374
|
unattendedEnabled: z<boolean, boolean, "volatile">;
|
|
349
375
|
diagramEnabled: z<boolean, boolean, "volatile">;
|
|
376
|
+
acpFaceEnabled: z<boolean, boolean, "volatile">;
|
|
377
|
+
acpFacePort: z<number, number, "volatile">;
|
|
350
378
|
}>>, "plain">;
|
|
351
379
|
export declare function apply(ctx: Context, config: Config): void;
|
|
352
380
|
export {};
|
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { c as hostInjected, d as hostSessions, f as hostSettings, h as hostWebSe
|
|
|
3
3
|
import { _ as resolveInside, a as findSerenityRoot$1, c as matchBlacklist, d as readCccName$1, f as readCheapWorkerConfig, h as readTrajectorySkills, i as findGitRoot, l as pathInside, m as readSafeModeHiddenTools, n as SAFE_MODE_MARKER, o as isSafeModeOn, p as readExclusiveTools, r as classifyPath, s as loadSerenityConfig, t as DEFAULT_SERENITY_CONFIG_PATHS, u as readBlacklist } from "./ccc-B0ZGL9lx.js";
|
|
4
4
|
import { A as localIdStamp, C as setActiveSessionInfo, D as isoLocal, E as useSession, O as localFileStamp, S as sessionsRoot, T as summarize, _ as namingTitleFor, a as pruneMissingBindings, b as resolveSessionByTitle, c as setBindingStore, d as clearActiveSessionInfo, f as createSession, g as listSessions, h as getActiveSessionInfo, i as listBoundSessionIds, k as localHuman, l as DEFAULT_SESSION_SCOPE, m as findSession, n as PLUGIN_SOURCE, o as readLastBound, p as extractSessionMdPathFromText, r as appendBound, s as resolveSessionTrajectoryLabel, t as ACC_MESSAGE_KIND, u as TRAJECTORY_ACTIONS, v as parseSessionContextFromEvents, w as showSession, x as sessionEvents$1, y as readActiveSessionMd } from "./message-source-B4P3Uw6D.js";
|
|
5
5
|
import { a as readWeixinCredential, c as weixinInboundDir, d as LOCALSTORE_SCOPES, f as checkLocalstoreGitCompliance, g as runLocalStore, h as readStore, i as matchWeixinRoute, l as weixinSessionIdFor, m as readGitTrack, n as extractWeixinText, o as readWeixinSettings, p as localstorePath, r as hasVoiceItem, s as sanitizeFileName$1, t as extractWeixinMedia } from "./weixin-route-B9gU1YXz.js";
|
|
6
|
-
import { a as
|
|
6
|
+
import { a as FACE_PORTS, c as MECHANISM_PORTS, d as registerSkiffSession$1, f as skiffRoleFor$1, h as ACC_VERSION, i as ACP_PORT, l as SKIFF_DEBUG_PORT, m as unregisterSkiffSession$1, n as readSimpleSettings, o as GATEWAY_PORT, p as skiffSessionInfo$1, r as registerSettingsSection, s as MAIN_WEB_PORT, u as WEIXIN_SEND_PORT } from "./settings-section-DGUQZo5j.js";
|
|
7
7
|
import { a as readSkiffRoles, c as roleMsmWhitelist, d as systemPromptSource, f as trajectorySubset, i as isSkiffSessionId, l as roleToolWhitelist, n as buildSkiffBasePrompt, o as resolveRoleSystemPrompt, r as createRolePromptReader, s as resolveSkiffKind } from "./skiff-role-B615L9MV.js";
|
|
8
8
|
import { REGISTERED_TOOLS } from "./invariant.js";
|
|
9
9
|
import { a as markdownToPlainText, c as sendTyping, i as getUpdates, l as sniffImageExt, n as downloadMedia, o as sendFileMessage, r as getConfig, s as sendTextMessage, t as TypingStatus } from "./weixin-api-BrRcPiQs.js";
|
|
@@ -11273,7 +11273,10 @@ async function acquireWakeAgent(ctx, root, dirName) {
|
|
|
11273
11273
|
return { error: `冷会话载入失败(${id}): ${String(err?.message ?? err)}` };
|
|
11274
11274
|
}
|
|
11275
11275
|
}
|
|
11276
|
-
return {
|
|
11276
|
+
return {
|
|
11277
|
+
error: `无绑定会话记录(AGENT_SESSIONS/.bindings.json 中无 ${dirName})——目标轨迹需先被 container_trajectory use 激活过`,
|
|
11278
|
+
noBinding: true
|
|
11279
|
+
};
|
|
11277
11280
|
}
|
|
11278
11281
|
/** 唤醒消息(唤起即投递正文:身份锚定 + 唤醒信息 + 任务) */
|
|
11279
11282
|
function buildWakeText(entry, target) {
|
|
@@ -11395,11 +11398,21 @@ async function sendToTrajectory(ctx, root, target, message, sender) {
|
|
|
11395
11398
|
ok: false,
|
|
11396
11399
|
detail: `目标 trajectory 未命中(${target})`
|
|
11397
11400
|
};
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11401
|
+
let acquired = await acquireWakeAgent(ctx, root, t.dirName);
|
|
11402
|
+
let createdNote = "";
|
|
11403
|
+
if ("error" in acquired) {
|
|
11404
|
+
if (!acquired.notReady && acquired.noBinding === true) {
|
|
11405
|
+
acquired = await createAndBindTarget(ctx, root, t.dirName);
|
|
11406
|
+
if ("error" in acquired) return {
|
|
11407
|
+
ok: false,
|
|
11408
|
+
detail: acquired.error
|
|
11409
|
+
};
|
|
11410
|
+
createdNote = `;目标原本无活跃 dsh 会话 ⇒ **已自动创建并绑定**一条(${acquired.how})`;
|
|
11411
|
+
} else return {
|
|
11412
|
+
ok: false,
|
|
11413
|
+
detail: acquired.error
|
|
11414
|
+
};
|
|
11415
|
+
}
|
|
11403
11416
|
const agent = acquired.agent;
|
|
11404
11417
|
const make = () => createUserMessage({
|
|
11405
11418
|
content: [{
|
|
@@ -11419,14 +11432,14 @@ async function sendToTrajectory(ctx, root, target, message, sender) {
|
|
|
11419
11432
|
}
|
|
11420
11433
|
return {
|
|
11421
11434
|
ok: true,
|
|
11422
|
-
detail: `已即时投递 ${t.dirName}(${acquired.how};目标空闲 ⇒ followup
|
|
11435
|
+
detail: `已即时投递 ${t.dirName}(${acquired.how};目标空闲 ⇒ followup 立即起轮)${createdNote}`
|
|
11423
11436
|
};
|
|
11424
11437
|
}
|
|
11425
11438
|
try {
|
|
11426
11439
|
agent.steer(make());
|
|
11427
11440
|
return {
|
|
11428
11441
|
ok: true,
|
|
11429
|
-
detail: `已即时注入 ${t.dirName}(${acquired.how};目标在跑 ⇒ steer
|
|
11442
|
+
detail: `已即时注入 ${t.dirName}(${acquired.how};目标在跑 ⇒ steer 当场注入当前轮)${createdNote}`
|
|
11430
11443
|
};
|
|
11431
11444
|
} catch (err) {
|
|
11432
11445
|
try {
|
|
@@ -11439,11 +11452,72 @@ async function sendToTrajectory(ctx, root, target, message, sender) {
|
|
|
11439
11452
|
}
|
|
11440
11453
|
return {
|
|
11441
11454
|
ok: true,
|
|
11442
|
-
detail: `已投递 ${t.dirName}(${acquired.how};steer 不可用 ⇒ 退回 followup): ${String(err?.message ?? err)}`
|
|
11455
|
+
detail: `已投递 ${t.dirName}(${acquired.how};steer 不可用 ⇒ 退回 followup): ${String(err?.message ?? err)}${createdNote}`
|
|
11443
11456
|
};
|
|
11444
11457
|
}
|
|
11445
11458
|
}
|
|
11446
11459
|
/**
|
|
11460
|
+
* 🆕 **给一条「从未被激活过」的轨迹就地建一条 dsh 会话并绑定它**(2026-10-16 owner 令,S142)。
|
|
11461
|
+
*
|
|
11462
|
+
* 何时用:**只有** `send-now` 在 `acquireWakeAgent` 报「无绑定会话记录」时(见该处的判据说明)。
|
|
11463
|
+
*
|
|
11464
|
+
* 三步(顺序不可换):
|
|
11465
|
+
* ① `sessionController.create({ cwd: root })` —— 宿主原语,**idempotently adopt**
|
|
11466
|
+
* ⇒ 重复调用不会建出第二条(不必自造"先查再建"的竞态窗口)。
|
|
11467
|
+
* ② `resolveAgent(sessionId)` —— 拿到**真 agent**。`create` 只返回 id,不给 agent。
|
|
11468
|
+
* ③ `appendBound(...)` —— 落绑定。**必须由本函数写**:`listBoundSessionIds` 是
|
|
11469
|
+
* `acquireWakeAgent` 的唯一选人依据,不写绑定则下一条消息**还是**找不到它
|
|
11470
|
+
* (那就成了"建了但永远用不上",比不建更坏)。
|
|
11471
|
+
*
|
|
11472
|
+
* 🔴 **为什么用 `cwd: root` 而不是目标的目录**:会话的 cwd 决定它落在哪个 CCC
|
|
11473
|
+
* (`cccRootForCwd` 上溯 `.serenity`)。目标轨迹本就住在该 CCC 的 `AGENT_SESSIONS/` 下
|
|
11474
|
+
* ⇒ 传 CCC 根才让它**进同一个 CCC**;传轨迹目录会让它变成一个**不同 CCC**的会话。
|
|
11475
|
+
*
|
|
11476
|
+
* @returns 命中返回 agent 与取得方式;任一步失败返回**带原因**的 error(不静默、不误报成功)
|
|
11477
|
+
*/
|
|
11478
|
+
async function createAndBindTarget(ctx, root, dirName) {
|
|
11479
|
+
const sc = hostService(ctx, "sessionController");
|
|
11480
|
+
const create = sc?.create;
|
|
11481
|
+
if (typeof create !== "function") return {
|
|
11482
|
+
error: "目标无活跃 dsh 会话,且 sessionController.create 不可用(绑定 id: 无)——无法就地创建载体;请先对该轨迹执行一次 container_trajectory use",
|
|
11483
|
+
notReady: true
|
|
11484
|
+
};
|
|
11485
|
+
let sessionId = "";
|
|
11486
|
+
try {
|
|
11487
|
+
const out = await create.call(sc, { cwd: root });
|
|
11488
|
+
sessionId = String(out?.sessionId ?? "");
|
|
11489
|
+
} catch (err) {
|
|
11490
|
+
return { error: `就地创建会话失败(${dirName}): ${String(err?.message ?? err)}` };
|
|
11491
|
+
}
|
|
11492
|
+
if (!sessionId) return { error: `就地创建会话未返回 sessionId(${dirName})` };
|
|
11493
|
+
const resolved = sc?.resolveAgent;
|
|
11494
|
+
if (typeof resolved !== "function") return {
|
|
11495
|
+
error: `会话已建(${sessionId})但 sessionController.resolveAgent 不可用`,
|
|
11496
|
+
notReady: true
|
|
11497
|
+
};
|
|
11498
|
+
let agent;
|
|
11499
|
+
try {
|
|
11500
|
+
const out = await resolved.call(sc, sessionId);
|
|
11501
|
+
agent = out?.agent;
|
|
11502
|
+
if (!agent) return { error: `会话已建(${sessionId})但 resolveAgent 未返回 agent: ${String(out?.error ?? "未知原因")}` };
|
|
11503
|
+
} catch (err) {
|
|
11504
|
+
return { error: `会话已建(${sessionId})但载入失败: ${String(err?.message ?? err)}` };
|
|
11505
|
+
}
|
|
11506
|
+
const bound = appendBound({ header: {
|
|
11507
|
+
id: sessionId,
|
|
11508
|
+
cwd: root
|
|
11509
|
+
} }, "activate", {
|
|
11510
|
+
dirName,
|
|
11511
|
+
mdPath: join(root, "AGENT_SESSIONS", dirName, "SESSION.md"),
|
|
11512
|
+
note: "auto-created by send-now"
|
|
11513
|
+
});
|
|
11514
|
+
const how = `auto-create(${sessionId}${bound ? ", bound" : ", ⚠️ 绑定写入失败"})`;
|
|
11515
|
+
return {
|
|
11516
|
+
agent,
|
|
11517
|
+
how
|
|
11518
|
+
};
|
|
11519
|
+
}
|
|
11520
|
+
/**
|
|
11447
11521
|
* 本 tick 要扫的 CCC 根集合(**并集**)。
|
|
11448
11522
|
*
|
|
11449
11523
|
* C2(S142 2026-09-15 Q5):原实现是 `collectLiveCccs`——**只认 live 会话** ⇒
|
|
@@ -12083,13 +12157,56 @@ function renderText$3(value) {
|
|
|
12083
12157
|
function createTrajectoryTool(ctx) {
|
|
12084
12158
|
return defineTool({
|
|
12085
12159
|
name: "container_trajectory",
|
|
12086
|
-
description:
|
|
12160
|
+
description: [
|
|
12161
|
+
"container_trajectory — one trajectory: its persistent body (SESSION.md) + its timeline.",
|
|
12162
|
+
"A trajectory is NOT the conversation: SESSION.md is the durable body and never moves;",
|
|
12163
|
+
"the dsh conversation is only its rebuildable carrier (Ship of Theseus — the carrier is replaced, the trajectory continues).",
|
|
12164
|
+
"ACTIONS, grouped by EFFECT (read the grouping before picking one):",
|
|
12165
|
+
"(A) LIFECYCLE — changes which trajectory THIS conversation is bound to:",
|
|
12166
|
+
"list (inventory + stats + anomaly marks) / show (read one SESSION.md) / create (make a NEW trajectory) /",
|
|
12167
|
+
"use (bind THIS conversation to an existing trajectory; inline integrity check — silent when fine, problems reported as hints, never errors) /",
|
|
12168
|
+
"rebuild (clear-and-rebuild THIS conversation in place).",
|
|
12169
|
+
"(B) DELIVERY — sends ONE message to ANOTHER trajectory; your own binding is unchanged:",
|
|
12170
|
+
"send-now (deliver RIGHT NOW) / send-later (deliver at ONE future instant).",
|
|
12171
|
+
"(C) REFERENCE — cro-guide (how to give THIS trajectory its own program that decides when it should be woken).",
|
|
12172
|
+
"HOW TO CHOOSE (a rule, not a guess):",
|
|
12173
|
+
"not yet bound + starting new work ⇒ create — with no prior binding it activates immediately, so the new trajectory has a carrier at once.",
|
|
12174
|
+
"already bound + recording a separate future line ⇒ create — it does NOT steal your binding (you stay on the current trajectory);",
|
|
12175
|
+
"activate the new one when you want it by sending it a message.",
|
|
12176
|
+
"want THIS conversation to move to another trajectory ⇒ use (refuses when it would orphan the current binding; --force overrides).",
|
|
12177
|
+
"want to poke another trajectory ⇒ send-now. Its target needs NO prior setup:",
|
|
12178
|
+
"if the target has no live dsh session, one is created and bound automatically, and your message is injected into it.",
|
|
12179
|
+
"RECEIPTS (read no more than is written): send-now returns a synchronous receipt meaning exactly \"injected / turn started\" —",
|
|
12180
|
+
"NEVER \"the target ran or replied\"; to prove the target actually moved, read its SESSION.md.",
|
|
12181
|
+
"It never queues behind the current turn: a busy target is steered mid-turn (read in the CURRENT turn), an idle target starts a turn at once.",
|
|
12182
|
+
"send-later is fire-and-forget by design: no receipt, no recall, no panel.",
|
|
12183
|
+
"ASYMMETRY (deliberate — the two differ in whether a missing target is normal): send-now creates a target on demand,",
|
|
12184
|
+
"because sending to a never-used trajectory is a legitimate intent; send-later does NOT,",
|
|
12185
|
+
"because scheduling for a trajectory that has never existed is almost always a mistyped name — auto-creating would hide that error behind an empty trajectory.",
|
|
12186
|
+
"PARAMETERS: create requires --desc <desc> [--goal] or --issue <ticket> (exactly one) plus --summary (≤20 chars).",
|
|
12187
|
+
"use requires --summary (≤20 chars) and may pass --force to switch away from the currently-bound trajectory.",
|
|
12188
|
+
"rebuild requires --summary (next-phase summary ≤20 chars) + optional --note (task focus for the rebuilt self).",
|
|
12189
|
+
"send-later requires target (S### or AGENT_SESSIONS dir name) + at (RFC3339 or +30m/+2h) + message.",
|
|
12190
|
+
"send-now requires target + message.",
|
|
12191
|
+
"The summary is appended to the dsh session title (S###-YYYY-MM-DD-<summary>); the S### id and date stay server-derived."
|
|
12192
|
+
].join(" "),
|
|
12087
12193
|
parameters: {
|
|
12088
12194
|
action: {
|
|
12089
12195
|
type: "string",
|
|
12090
12196
|
enum: [...TRAJECTORY_ACTIONS],
|
|
12091
12197
|
required: true,
|
|
12092
|
-
description:
|
|
12198
|
+
description: [
|
|
12199
|
+
"Subcommand — grouped by effect.",
|
|
12200
|
+
"LIFECYCLE (changes THIS conversation's binding):",
|
|
12201
|
+
"list (inventory + stats + anomaly marks) / show (S### or dir name or fuzzy keyword) /",
|
|
12202
|
+
"create (new trajectory; activates itself when you have no binding, otherwise leaves your binding untouched and tells you how to activate it) /",
|
|
12203
|
+
"use (activate context for THIS conversation; inline integrity check — pass silent, problems reported as hints, not errors) /",
|
|
12204
|
+
"rebuild (clear-and-rebuild current conversation — requires --summary + optional --note).",
|
|
12205
|
+
"DELIVERY (sends one message to ANOTHER trajectory; your binding is unchanged):",
|
|
12206
|
+
"send-now (deliver RIGHT NOW; the target needs no prior setup — if it has no live session, one is created and bound automatically) /",
|
|
12207
|
+
"send-later (one future instant + one message; fire-and-forget, and it does NOT auto-create a target).",
|
|
12208
|
+
"REFERENCE: cro-guide (no parameters: prints the CRO programming guide, including a ready-to-use sample snapshot)"
|
|
12209
|
+
].join(" ")
|
|
12093
12210
|
},
|
|
12094
12211
|
name: {
|
|
12095
12212
|
type: "string",
|
|
@@ -12101,15 +12218,15 @@ function createTrajectoryTool(ctx) {
|
|
|
12101
12218
|
},
|
|
12102
12219
|
desc: {
|
|
12103
12220
|
type: "string",
|
|
12104
|
-
description: "create short description (any language, ≤5 words; mutually exclusive with issue)"
|
|
12221
|
+
description: "create: short description (any language, ≤5 words; mutually exclusive with issue)"
|
|
12105
12222
|
},
|
|
12106
12223
|
issue: {
|
|
12107
12224
|
type: "string",
|
|
12108
|
-
description: "create ticket number (e.g. apaas-26116; dir named YYYY-MM-DD--<issue>; mutually exclusive with desc)"
|
|
12225
|
+
description: "create: ticket number (e.g. apaas-26116; dir named YYYY-MM-DD--<issue>; mutually exclusive with desc)"
|
|
12109
12226
|
},
|
|
12110
12227
|
goal: {
|
|
12111
12228
|
type: "string",
|
|
12112
|
-
description: "create one-sentence goal (optional)"
|
|
12229
|
+
description: "create: one-sentence goal (optional)"
|
|
12113
12230
|
},
|
|
12114
12231
|
summary: {
|
|
12115
12232
|
type: "string",
|
|
@@ -12121,7 +12238,7 @@ function createTrajectoryTool(ctx) {
|
|
|
12121
12238
|
},
|
|
12122
12239
|
dryRun: {
|
|
12123
12240
|
type: "boolean",
|
|
12124
|
-
description: "create preview mode (no actual changes)"
|
|
12241
|
+
description: "create: preview mode (no actual changes)"
|
|
12125
12242
|
},
|
|
12126
12243
|
target: {
|
|
12127
12244
|
type: "string",
|
|
@@ -12160,13 +12277,32 @@ function createTrajectoryTool(ctx) {
|
|
|
12160
12277
|
dryRun: isDryRun
|
|
12161
12278
|
});
|
|
12162
12279
|
const message = result.message;
|
|
12163
|
-
if (
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12280
|
+
if (isDryRun) return message;
|
|
12281
|
+
const scope = agentScope$1(exec);
|
|
12282
|
+
const priorBound = currentBoundDirName(exec, scope);
|
|
12283
|
+
if (priorBound === null) {
|
|
12284
|
+
const active = useSession(root, result.dirName, scope);
|
|
12285
|
+
const info = getActiveSessionInfo(scope);
|
|
12286
|
+
if (info) renameDshSessionForActive(ctx, exec, info, args.summary);
|
|
12287
|
+
const dsh = agentDshSession(exec);
|
|
12288
|
+
if (dsh && info) appendBound(dsh, "activate", {
|
|
12289
|
+
dirName: info.dirName,
|
|
12290
|
+
mdPath: info.mdPath,
|
|
12291
|
+
sessionId: info.sessionId,
|
|
12292
|
+
note: "auto-activated on create (no prior binding)"
|
|
12293
|
+
});
|
|
12294
|
+
return [
|
|
12295
|
+
message,
|
|
12296
|
+
`✓ 已自动激活(此前**无绑定**):${active.dir} —— 后续工作写回该轨迹的 SESSION.md。`,
|
|
12297
|
+
` (判据:create 前无任何绑定 ⇒ 激活;有绑定则只建不夺,见下。)`
|
|
12298
|
+
].join("\n");
|
|
12299
|
+
}
|
|
12300
|
+
return [
|
|
12301
|
+
message,
|
|
12302
|
+
`⚠ 本轨迹【未】被激活 —— 当前已绑定 ${priorBound},保绑定优先(不夺走你正在用的轨迹)。`,
|
|
12303
|
+
` 要激活它(并在它名下开一条会话):用 container_trajectory send-now 向 ${result.dirName} 投一条消息 ——`,
|
|
12304
|
+
` 目标若没有活跃 dsh 会话,会自动创建一条并把「使用提示词 + 你的消息」一并注入。`
|
|
12305
|
+
].join("\n");
|
|
12170
12306
|
}
|
|
12171
12307
|
case "use": {
|
|
12172
12308
|
if (!args.name) throw new Error("use requires name (S### or directory name)");
|
|
@@ -21680,6 +21816,300 @@ function registerWeixinSendApi(ctx) {
|
|
|
21680
21816
|
sync();
|
|
21681
21817
|
}
|
|
21682
21818
|
//#endregion
|
|
21819
|
+
//#region src/acp-face.ts
|
|
21820
|
+
/** 面名(面宿主幂等键;与 FACE_PORTS 的 id 同名,便于对账) */
|
|
21821
|
+
const FACE_ACP = "acp";
|
|
21822
|
+
/** 本面绑定的地址(取自集中端口表 —— **单一真相源**,不在本文件硬写) */
|
|
21823
|
+
const ACP_HOST = FACE_PORTS.acp.host ?? "127.0.0.1";
|
|
21824
|
+
/**
|
|
21825
|
+
* `dsh-acp` 需要的服务(**替它声明**,见文件头坑 ①)。
|
|
21826
|
+
*
|
|
21827
|
+
* 逐字出处 = `dsh-acp/lib/index.js` 的 `const inject = ["agents","llm","sessionPersistence","sessions"]`。
|
|
21828
|
+
* ⚠️ **少一个就在它内部抛错**(实测那条是 `sessionPersistence`)⇒ 这里是**照抄它的声明**,
|
|
21829
|
+
* 不是"我们觉得它需要什么"。⇒ 它升版改了 `inject`,这里要跟着改(列为**跨版本注意点**)。
|
|
21830
|
+
*/
|
|
21831
|
+
const ACP_REQUIRED_SERVICES = [
|
|
21832
|
+
"agents",
|
|
21833
|
+
"llm",
|
|
21834
|
+
"sessionPersistence",
|
|
21835
|
+
"sessions"
|
|
21836
|
+
];
|
|
21837
|
+
function acpFaceActive() {
|
|
21838
|
+
return faceActive(FACE_ACP);
|
|
21839
|
+
}
|
|
21840
|
+
/**
|
|
21841
|
+
* 面是否在监听(意图读取)。
|
|
21842
|
+
* ⚠️ 与 `startFace` 的关系同其余各面:**启动本身不读它**(`startFace` 是机械入口),
|
|
21843
|
+
* 由装配层用它决定"起还是停"。
|
|
21844
|
+
*/
|
|
21845
|
+
function acpFaceEnabled() {
|
|
21846
|
+
return readSimpleSettings().acpFaceEnabled;
|
|
21847
|
+
}
|
|
21848
|
+
/**
|
|
21849
|
+
* 把一条裸 WS socket 适配成 ACP `Stream`。
|
|
21850
|
+
*
|
|
21851
|
+
* 🔴 与官方 `ndJsonStream` **同语义**:我们自己做「消息 ↔ 文本帧」的分帧(按行)。
|
|
21852
|
+
* 实测注意(P0′):`dsh-acp` 写出的每条消息**自带换行**,客户端同样 ⇒ 按行切分即正确。
|
|
21853
|
+
* ⚠️ **空行要丢**;**非 JSON 帧要容忍**(桥/客户端可能插入控制帧)。
|
|
21854
|
+
*/
|
|
21855
|
+
function wsToAcpStream(ws, onWarn) {
|
|
21856
|
+
return {
|
|
21857
|
+
readable: new ReadableStream({ start(controller) {
|
|
21858
|
+
let buf = "";
|
|
21859
|
+
ws.on("message", (data) => {
|
|
21860
|
+
buf += typeof data === "string" ? data : String(data);
|
|
21861
|
+
let i;
|
|
21862
|
+
while ((i = buf.indexOf("\n")) >= 0) {
|
|
21863
|
+
const line = buf.slice(0, i);
|
|
21864
|
+
buf = buf.slice(i + 1);
|
|
21865
|
+
if (!line.trim()) continue;
|
|
21866
|
+
try {
|
|
21867
|
+
controller.enqueue(JSON.parse(line));
|
|
21868
|
+
} catch {
|
|
21869
|
+
onWarn(line.slice(0, 120));
|
|
21870
|
+
}
|
|
21871
|
+
}
|
|
21872
|
+
});
|
|
21873
|
+
ws.on("close", () => {
|
|
21874
|
+
try {
|
|
21875
|
+
controller.close();
|
|
21876
|
+
} catch {}
|
|
21877
|
+
});
|
|
21878
|
+
ws.on("error", () => {
|
|
21879
|
+
try {
|
|
21880
|
+
controller.close();
|
|
21881
|
+
} catch {}
|
|
21882
|
+
});
|
|
21883
|
+
} }),
|
|
21884
|
+
writable: new WritableStream({ write(msg) {
|
|
21885
|
+
ws.send(`${JSON.stringify(msg)}\n`);
|
|
21886
|
+
} })
|
|
21887
|
+
};
|
|
21888
|
+
}
|
|
21889
|
+
function newState() {
|
|
21890
|
+
return {
|
|
21891
|
+
handle: null,
|
|
21892
|
+
wss: null,
|
|
21893
|
+
connections: 0,
|
|
21894
|
+
applied: 0,
|
|
21895
|
+
lastErrors: [],
|
|
21896
|
+
disposers: []
|
|
21897
|
+
};
|
|
21898
|
+
}
|
|
21899
|
+
/** 当前面状态(供 `status()` / 诊断读;无监听时 `handle` 为 null) */
|
|
21900
|
+
let state = newState();
|
|
21901
|
+
/** 保留最近若干条连接错误(诊断窗口;不无限增长) */
|
|
21902
|
+
const MAX_ERR_KEEP = 8;
|
|
21903
|
+
/**
|
|
21904
|
+
* 启动面 E(幂等;重复调用只起一次)。
|
|
21905
|
+
*
|
|
21906
|
+
* 🔴 **失败语义**:本面**默认关**且是**可选面** ⇒ 起不来**不得**影响插件其余部分
|
|
21907
|
+
* (调用方负责 catch;本函数把失败原样抛出,由装配层记日志)。
|
|
21908
|
+
*/
|
|
21909
|
+
async function startAcpFace(ctx) {
|
|
21910
|
+
const port = readSimpleSettings().acpFacePort;
|
|
21911
|
+
let dshAcp;
|
|
21912
|
+
let wsMod;
|
|
21913
|
+
try {
|
|
21914
|
+
dshAcp = await import("@deepseek-ai/dsh-acp");
|
|
21915
|
+
wsMod = await import("ws");
|
|
21916
|
+
} catch (err) {
|
|
21917
|
+
const msg = String(err?.message ?? err);
|
|
21918
|
+
throw new Error(`面 E 依赖不可用(${msg})—— 需要宿主提供 @deepseek-ai/dsh-acp,且本插件能 resolve 到 ws`);
|
|
21919
|
+
}
|
|
21920
|
+
if (typeof dshAcp.apply !== "function") throw new Error("面 E:@deepseek-ai/dsh-acp 未导出 apply(版本不匹配?)");
|
|
21921
|
+
const wss = new wsMod.WebSocketServer({ noServer: true });
|
|
21922
|
+
const local = newState();
|
|
21923
|
+
local.wss = wss;
|
|
21924
|
+
const handle = await startFace({
|
|
21925
|
+
name: FACE_ACP,
|
|
21926
|
+
port,
|
|
21927
|
+
host: ACP_HOST,
|
|
21928
|
+
enabled: () => readSimpleSettings().acpFaceEnabled,
|
|
21929
|
+
handler: (_req, res) => {
|
|
21930
|
+
res.writeHead(426, {
|
|
21931
|
+
"content-type": "text/plain; charset=utf-8",
|
|
21932
|
+
"upgrade": "websocket",
|
|
21933
|
+
"cache-control": "no-store"
|
|
21934
|
+
});
|
|
21935
|
+
res.end("This is an ACP (Agent Client Protocol) endpoint over WebSocket. Use an ACP client.\n");
|
|
21936
|
+
}
|
|
21937
|
+
});
|
|
21938
|
+
local.handle = handle;
|
|
21939
|
+
handle.server.on("upgrade", (req, socket, head) => {
|
|
21940
|
+
local.connections += 1;
|
|
21941
|
+
try {
|
|
21942
|
+
wss.handleUpgrade(req, socket, head, (ws) => {
|
|
21943
|
+
try {
|
|
21944
|
+
const stream = wsToAcpStream(ws, (line) => {
|
|
21945
|
+
console.log(`[serenity-hooks] 面 E:丢弃一条非 JSON 帧(前 120 字): ${line}`);
|
|
21946
|
+
});
|
|
21947
|
+
const fiber = ctx.plugin({
|
|
21948
|
+
inject: ACP_REQUIRED_SERVICES,
|
|
21949
|
+
apply: (scoped) => {
|
|
21950
|
+
const sel = resolveAcpSelection(scoped);
|
|
21951
|
+
dshAcp.apply(scoped, {
|
|
21952
|
+
stream,
|
|
21953
|
+
provider: sel.provider,
|
|
21954
|
+
model: sel.model
|
|
21955
|
+
});
|
|
21956
|
+
}
|
|
21957
|
+
});
|
|
21958
|
+
local.disposers.push(() => {
|
|
21959
|
+
try {
|
|
21960
|
+
fiber?.dispose?.();
|
|
21961
|
+
} catch {}
|
|
21962
|
+
});
|
|
21963
|
+
local.applied += 1;
|
|
21964
|
+
} catch (err) {
|
|
21965
|
+
const msg = String(err?.message ?? err).slice(0, 200);
|
|
21966
|
+
local.lastErrors.push({
|
|
21967
|
+
at: Date.now(),
|
|
21968
|
+
applied: false,
|
|
21969
|
+
error: msg
|
|
21970
|
+
});
|
|
21971
|
+
if (local.lastErrors.length > MAX_ERR_KEEP) local.lastErrors.shift();
|
|
21972
|
+
console.warn(`[serenity-hooks] ✗ 面 E:dsh-acp 接线失败: ${msg}`);
|
|
21973
|
+
try {
|
|
21974
|
+
ws.close(1011, "acp bridge failed");
|
|
21975
|
+
} catch {}
|
|
21976
|
+
}
|
|
21977
|
+
});
|
|
21978
|
+
} catch (err) {
|
|
21979
|
+
console.warn(`[serenity-hooks] ✗ 面 E:WebSocket 握手失败: ${String(err?.message ?? err)}`);
|
|
21980
|
+
try {
|
|
21981
|
+
socket.destroy();
|
|
21982
|
+
} catch {}
|
|
21983
|
+
}
|
|
21984
|
+
});
|
|
21985
|
+
state = local;
|
|
21986
|
+
console.log(`[serenity-hooks] ✓ 面 E(官方 ACP):ws://${ACP_HOST}:${port} ⚠️ 协议无认证,靠外部 Access 兜底`);
|
|
21987
|
+
return handle;
|
|
21988
|
+
}
|
|
21989
|
+
/**
|
|
21990
|
+
* 停面 E(幂等)。
|
|
21991
|
+
*
|
|
21992
|
+
* ⚠️ **与其余各面同款注意**:`stopFace` **不用** `closeAllConnections()`(那会掐断在飞的请求);
|
|
21993
|
+
* WS 连接由 `wss.close()` 与 socket 自身生命周期收束。
|
|
21994
|
+
*/
|
|
21995
|
+
function stopAcpFace() {
|
|
21996
|
+
const wss = state.wss;
|
|
21997
|
+
if (wss) try {
|
|
21998
|
+
wss.close();
|
|
21999
|
+
} catch {}
|
|
22000
|
+
state.disposers = [];
|
|
22001
|
+
state.wss = null;
|
|
22002
|
+
state.handle = null;
|
|
22003
|
+
const stopped = stopFace(FACE_ACP);
|
|
22004
|
+
if (stopped) console.log("[serenity-hooks] face acp: 已停止");
|
|
22005
|
+
return stopped;
|
|
22006
|
+
}
|
|
22007
|
+
/** ACP 会话用的 provider(取 CCC 现有路由;留空 = 由宿主/请求监听器决定) */
|
|
22008
|
+
function readAcpProvider() {
|
|
22009
|
+
return process.env.SERENITY_ACP_PROVIDER || void 0;
|
|
22010
|
+
}
|
|
22011
|
+
/** ACP 会话用的 model(同上) */
|
|
22012
|
+
function readAcpModel() {
|
|
22013
|
+
return process.env.SERENITY_ACP_MODEL || void 0;
|
|
22014
|
+
}
|
|
22015
|
+
/**
|
|
22016
|
+
* 解析 ACP 会话该用的 `{provider, model}`。
|
|
22017
|
+
*
|
|
22018
|
+
* ## 🔴 为什么必须有这个函数(2026-10-16 容器实测抓出的**真缺陷**)
|
|
22019
|
+
*
|
|
22020
|
+
* 早先我们是**裸传** `provider: readAcpProvider(), model: readAcpModel()` —— 而它们读的是
|
|
22021
|
+
* **环境变量**,默认**未设** ⇒ 传下去就是 `undefined`。后果**不是"用默认模型"**:
|
|
22022
|
+
* 上游 `dsh-acp` 的 `agentOptions()`(`lib/index.js:1356-1361`)**只在字段非 undefined 时才带上**:
|
|
22023
|
+
* ```js
|
|
22024
|
+
* ...config.provider !== void 0 ? { provider: config.provider } : {},
|
|
22025
|
+
* ...config.model !== void 0 ? { model: config.model } : {}
|
|
22026
|
+
* ```
|
|
22027
|
+
* ⇒ **我们传 undefined,agent 就真的没有模型** ⇒ 第一条 `session/prompt` 必失败,逐字报:
|
|
22028
|
+
* `Internal error: turn failed: prompt variable "{{model}}" has no value for this assembly
|
|
22029
|
+
* (section "deployment:persona-prefix")`。
|
|
22030
|
+
*
|
|
22031
|
+
* ⚠️ **网页端不中招**(它经 `agent-default-model` 层拿到默认值)⇒ **只有 ACP 这条入口坏** ——
|
|
22032
|
+
* 也就是说:**手机上第一条消息必然失败,而本机怎么试都正常**。
|
|
22033
|
+
* 🔴 这个缺陷 **typecheck / 2812 条单测 / deploy 预检 全绿**(它是运行时合成形态,
|
|
22034
|
+
* 静态面结构性地看不见)⇒ **只有"容器 + 真模型"那一跑能抓到它**。
|
|
22035
|
+
*
|
|
22036
|
+
* ## 修法 = **读宿主自己的默认模型服务**(不另造真相源)
|
|
22037
|
+
*
|
|
22038
|
+
* 宿主暴露服务 `ctx.agentDefaultModel.currentSelection()`,其契约逐字写着
|
|
22039
|
+
* *"Default model selection for Agents created **without an explicit model**"*
|
|
22040
|
+
* (`dsh-agent-default-model/lib/types/index.d.ts`)—— 这正是"没显式指定时该用什么"的**权威出处**。
|
|
22041
|
+
* ⇒ 我们只是**把它转交给 ACP**,不引入第二套缺省。
|
|
22042
|
+
*
|
|
22043
|
+
* 优先级(**显式 > 宿主默认**):`SERENITY_ACP_PROVIDER/MODEL` 环境变量(调试用)> 宿主默认。
|
|
22044
|
+
* ⚠️ **一处如实标注的弱化**:这里**不打日志**(每次连接都解析一次,打日志会刷屏);
|
|
22045
|
+
* 若宿主服务缺失,**退回"两个都 undefined"=旧行为**(即那条已知会失败的形态)——
|
|
22046
|
+
* 而不是静默编一个模型。⇒ 副作用是"没有默认模型时仍会失败",但那**与宿主自身缺配置时的行为一致**。
|
|
22047
|
+
*
|
|
22048
|
+
* 🔵 **公开导出**(而非模块私有):它是一个**纯函数 + 有独立契约**的单元(本仓同类先例 =
|
|
22049
|
+
* `host/access.ts` 的一组读取器),且**那个真缺陷正是在它这一层**(裸传 undefined)——
|
|
22050
|
+
* 回归钉必须能**直接钉住它**,而不是隔着 WS 握手去间接观察(那样测不出"取到了什么")。
|
|
22051
|
+
*/
|
|
22052
|
+
function resolveAcpSelection(ctx) {
|
|
22053
|
+
const envProvider = readAcpProvider();
|
|
22054
|
+
const envModel = readAcpModel();
|
|
22055
|
+
if (envProvider && envModel) return {
|
|
22056
|
+
provider: envProvider,
|
|
22057
|
+
model: envModel
|
|
22058
|
+
};
|
|
22059
|
+
try {
|
|
22060
|
+
const sel = hostInjected(ctx, "agentDefaultModel")?.currentSelection?.();
|
|
22061
|
+
if (sel?.provider && sel?.model) return {
|
|
22062
|
+
provider: sel.provider,
|
|
22063
|
+
model: sel.model
|
|
22064
|
+
};
|
|
22065
|
+
} catch {}
|
|
22066
|
+
return {
|
|
22067
|
+
provider: envProvider,
|
|
22068
|
+
model: envModel
|
|
22069
|
+
};
|
|
22070
|
+
}
|
|
22071
|
+
/**
|
|
22072
|
+
* 装配(`index.ts` 的 `apply` 调用):按**面板/部署键**启停面 E,配置变化热同步。
|
|
22073
|
+
*
|
|
22074
|
+
* 🔴 **W3 接线**(2026-10-16):本轮之前 `startAcpFace` 虽已实现却**没有任何调用点**
|
|
22075
|
+
* —— 即"面写好了但从不起"。本函数补上它,形式与两个兄弟面一致
|
|
22076
|
+
* (`registerWeixinSendApi` / `registerDiagramTool`):
|
|
22077
|
+
*
|
|
22078
|
+
* ① **反应式**:面板拨开关**只改配置、不重跑 `apply`**(v1.51.1 实测过的那条铁律)
|
|
22079
|
+
* ⇒ 必须监听事件才会"拨了就有反应";
|
|
22080
|
+
* ② 监听**宿主的真事件** `settings/document-updated`(按 ns 过滤),
|
|
22081
|
+
* ⛔ **不监听** `serenity/settings-changed` —— 那个事件**全仓没有任何 `emit` 点**
|
|
22082
|
+
* (=死通道;见 `registerDiagramTool` 的注释),照它接线等于接了个永远不响的铃;
|
|
22083
|
+
* ③ 再挂 `agent/created`/`session/created` 兜底(宿主事件面若换名,至少还有这条能自愈);
|
|
22084
|
+
* ④ 启动时同步一次(`apply` 时按当前配置定初始态)。
|
|
22085
|
+
*
|
|
22086
|
+
* ⚠️ **失败语义**:本面**默认关**且**依赖可选**(`dsh-acp` 是 peer)⇒ 起不来**只记日志**,
|
|
22087
|
+
* 绝不抛出(抛出会让整个插件加载失败,而它只是一个可选面)。
|
|
22088
|
+
*/
|
|
22089
|
+
function registerAcpFace(ctx) {
|
|
22090
|
+
const sync = () => {
|
|
22091
|
+
if (!acpFaceEnabled()) {
|
|
22092
|
+
if (acpFaceActive()) stopAcpFace();
|
|
22093
|
+
return;
|
|
22094
|
+
}
|
|
22095
|
+
if (acpFaceActive()) return;
|
|
22096
|
+
startAcpFace(ctx).catch((err) => {
|
|
22097
|
+
console.error(`[serenity-hooks] ✗ 面 E(官方 ACP)启动失败: ${String(err?.message ?? err)}`);
|
|
22098
|
+
});
|
|
22099
|
+
};
|
|
22100
|
+
try {
|
|
22101
|
+
ctx.on("settings/document-updated", (ns) => {
|
|
22102
|
+
if (String(ns) === "serenity-hooks") sync();
|
|
22103
|
+
});
|
|
22104
|
+
} catch {}
|
|
22105
|
+
for (const eventName of ["agent/created", "session/created"]) try {
|
|
22106
|
+
ctx.on(eventName, () => {
|
|
22107
|
+
sync();
|
|
22108
|
+
});
|
|
22109
|
+
} catch {}
|
|
22110
|
+
sync();
|
|
22111
|
+
}
|
|
22112
|
+
//#endregion
|
|
21683
22113
|
//#region src/seams/lifecycle.ts
|
|
21684
22114
|
/** 从 Agent / Session / 事件负载中取会话 id(形状宽容:未知结构返回 null) */
|
|
21685
22115
|
function sessionIdOf(value) {
|
|
@@ -24316,6 +24746,10 @@ const Config = z.object({
|
|
|
24316
24746
|
opencodeProvider: z.object({ autoConfigure: z.boolean().default(true) }),
|
|
24317
24747
|
visionPatch: z.object({ enabled: z.boolean().default(true) }),
|
|
24318
24748
|
diagram: z.object({ enabled: z.boolean().default(false) }),
|
|
24749
|
+
acpFace: z.object({
|
|
24750
|
+
enabled: z.boolean().default(false),
|
|
24751
|
+
port: z.number().min(1024).max(65535).default(ACP_PORT)
|
|
24752
|
+
}),
|
|
24319
24753
|
humanChannel: z.object({
|
|
24320
24754
|
accounts: z.array(humanChannelAccountSchema).default([]),
|
|
24321
24755
|
subscriptions: z.array(humanChannelSubscriptionSchema).default([]),
|
|
@@ -24328,7 +24762,9 @@ const Config = z.object({
|
|
|
24328
24762
|
skiffDebugPort: z.number().min(1024).max(65535).volatile(),
|
|
24329
24763
|
croEnabled: z.boolean().volatile(),
|
|
24330
24764
|
unattendedEnabled: z.boolean().volatile(),
|
|
24331
|
-
diagramEnabled: z.boolean().volatile()
|
|
24765
|
+
diagramEnabled: z.boolean().volatile(),
|
|
24766
|
+
acpFaceEnabled: z.boolean().volatile(),
|
|
24767
|
+
acpFacePort: z.number().min(1024).max(65535).volatile()
|
|
24332
24768
|
});
|
|
24333
24769
|
function apply(ctx, config) {
|
|
24334
24770
|
try {
|
|
@@ -24392,6 +24828,7 @@ function apply(ctx, config) {
|
|
|
24392
24828
|
registerWakeScheduler(ctx);
|
|
24393
24829
|
registerWeixinBridge(ctx);
|
|
24394
24830
|
registerWeixinSendApi(ctx);
|
|
24831
|
+
registerAcpFace(ctx);
|
|
24395
24832
|
registerWeixinOutputGuard(ctx);
|
|
24396
24833
|
registerLifecycle(ctx);
|
|
24397
24834
|
if (config.webFetch?.enabled !== false) registerWebFetchProvider(ctx);
|
package/lib/ports.d.ts
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
* 本模块是**零依赖叶模块**(纯常量,无 import)——output-guard(守卫词表)、config-ops
|
|
21
21
|
* (默认值)、settings-section(面板默认)、index(Config 默认)都可安全引用而不引入依赖环。
|
|
22
22
|
*/
|
|
23
|
-
/**
|
|
24
|
-
export type FaceId = 'main' | 'gateway' | 'weixinSend' | 'skiffDebug';
|
|
23
|
+
/** 面标识(五个对外面;A 由宿主监听,B/C/D/E 由本插件监听) */
|
|
24
|
+
export type FaceId = 'main' | 'gateway' | 'weixinSend' | 'skiffDebug' | 'acp';
|
|
25
25
|
/** 一个面的端口语义 */
|
|
26
26
|
export interface PortSpec {
|
|
27
27
|
/** 端口号 */
|
|
@@ -36,7 +36,7 @@ export interface PortSpec {
|
|
|
36
36
|
/**
|
|
37
37
|
* 集中端口表。
|
|
38
38
|
* A=宿主主面(插件不监听)/ B=网关(可配,默认关)/ C=微信发送(默认开,仅 loopback)
|
|
39
|
-
* / D=Skiff
|
|
39
|
+
* / D=Skiff 调试(默认关)/ E=ACP(默认关,`0.0.0.0`)。
|
|
40
40
|
*/
|
|
41
41
|
export declare const FACE_PORTS: Readonly<Record<FaceId, PortSpec>>;
|
|
42
42
|
/** 宿主主 WebUI 端口(面 A:插件**不监听**,只读取;`readWebPort` 的回退值) */
|
|
@@ -47,6 +47,8 @@ export declare const GATEWAY_PORT: number;
|
|
|
47
47
|
export declare const WEIXIN_SEND_PORT: number;
|
|
48
48
|
/** Skiff 调试页端口默认值(面 D) */
|
|
49
49
|
export declare const SKIFF_DEBUG_PORT: number;
|
|
50
|
+
/** 官方 ACP 面端口默认值(面 E,2026-10-16) */
|
|
51
|
+
export declare const ACP_PORT: number;
|
|
50
52
|
/**
|
|
51
53
|
* **机制端口**词表(output-guard 用:agent 在**用户可见输出**里提及内部端口即打回)。
|
|
52
54
|
*
|
|
@@ -41,7 +41,7 @@ function unregisterSkiffSession(sessionId) {
|
|
|
41
41
|
/**
|
|
42
42
|
* 集中端口表。
|
|
43
43
|
* A=宿主主面(插件不监听)/ B=网关(可配,默认关)/ C=微信发送(默认开,仅 loopback)
|
|
44
|
-
* / D=Skiff
|
|
44
|
+
* / D=Skiff 调试(默认关)/ E=ACP(默认关,`0.0.0.0`)。
|
|
45
45
|
*/
|
|
46
46
|
const FACE_PORTS = {
|
|
47
47
|
main: {
|
|
@@ -67,6 +67,26 @@ const FACE_PORTS = {
|
|
|
67
67
|
host: "127.0.0.1",
|
|
68
68
|
defaultEnabled: false,
|
|
69
69
|
meaning: "Skiff 调试问答面(人工调试子角色;无认证,仅靠 loopback)"
|
|
70
|
+
},
|
|
71
|
+
/**
|
|
72
|
+
* 🔴 面 E:**官方 ACP 面**(2026-10-16,owner 令「跑在 dsh web 进程内」→ 已实测跑通)。
|
|
73
|
+
*
|
|
74
|
+
* 与已退役的**旧面 E(3100)不是一回事**,别混淆:
|
|
75
|
+
* · 旧面 E = 当年**自造**的 HTTP+HTML 问答面,2026-10-15 owner 裁「砍掉外部问答」时**整组退役**;
|
|
76
|
+
* · 本面 = **官方 `@deepseek-ai/dsh-acp`**(官方 SDK + 现成客户端 Agmente),
|
|
77
|
+
* 且**跑在宿主 web 进程内**(不另起进程、不需要 stdio 桥)。
|
|
78
|
+
* ⇒ 端口**另选 3200**:既避开 3080/3081/3082/3099,也让"新旧一眼可分"。
|
|
79
|
+
*
|
|
80
|
+
* ⚠️ **安全边界(不许含混)**:**ACP 协议本身不做认证**(`dsh-acp` 的 `authenticate` 恒成功),
|
|
81
|
+
* 而本面按 owner 裁决绑 **`0.0.0.0`**(局域网内任何设备可连)⇒ **必须靠外部接入层兜底**
|
|
82
|
+
* (现为 Cloudflare Access)。⛔ **"隧道不是 ACC 该关心的事"(Q3 裁决)成立,但
|
|
83
|
+
* "所以不需要认证层"不成立** —— 交付文档与诊断输出里都要显式带这个前提。
|
|
84
|
+
*/
|
|
85
|
+
acp: {
|
|
86
|
+
port: 3200,
|
|
87
|
+
host: "0.0.0.0",
|
|
88
|
+
defaultEnabled: false,
|
|
89
|
+
meaning: "官方 ACP 面(Agmente 等标准客户端登入本 CCC;**协议无认证**,靠外部 Access 兜底)"
|
|
70
90
|
}
|
|
71
91
|
};
|
|
72
92
|
/** 宿主主 WebUI 端口(面 A:插件**不监听**,只读取;`readWebPort` 的回退值) */
|
|
@@ -77,6 +97,8 @@ const GATEWAY_PORT = FACE_PORTS.gateway.port;
|
|
|
77
97
|
const WEIXIN_SEND_PORT = FACE_PORTS.weixinSend.port;
|
|
78
98
|
/** Skiff 调试页端口默认值(面 D) */
|
|
79
99
|
const SKIFF_DEBUG_PORT = FACE_PORTS.skiffDebug.port;
|
|
100
|
+
/** 官方 ACP 面端口默认值(面 E,2026-10-16) */
|
|
101
|
+
const ACP_PORT = FACE_PORTS.acp.port;
|
|
80
102
|
/**
|
|
81
103
|
* **机制端口**词表(output-guard 用:agent 在**用户可见输出**里提及内部端口即打回)。
|
|
82
104
|
*
|
|
@@ -103,6 +125,8 @@ function defaultSimpleSettings() {
|
|
|
103
125
|
croEnabled: true,
|
|
104
126
|
unattendedEnabled: false,
|
|
105
127
|
diagramEnabled: false,
|
|
128
|
+
acpFaceEnabled: false,
|
|
129
|
+
acpFacePort: ACP_PORT,
|
|
106
130
|
humanChannel: defaultHumanChannelSettings()
|
|
107
131
|
};
|
|
108
132
|
}
|
|
@@ -199,6 +223,8 @@ function simpleSettingsFromConfig(config) {
|
|
|
199
223
|
croEnabled: unwrapVolatile(config.croEnabled) ?? d.croEnabled,
|
|
200
224
|
unattendedEnabled: unwrapVolatile(config.unattendedEnabled) ?? d.unattendedEnabled,
|
|
201
225
|
diagramEnabled: unwrapVolatile(config.diagramEnabled) ?? config.diagram?.enabled ?? d.diagramEnabled,
|
|
226
|
+
acpFaceEnabled: unwrapVolatile(config.acpFaceEnabled) ?? config.acpFace?.enabled ?? d.acpFaceEnabled,
|
|
227
|
+
acpFacePort: unwrapVolatile(config.acpFacePort) ?? config.acpFace?.port ?? d.acpFacePort,
|
|
202
228
|
humanChannel: humanChannelSettingsFromConfig(config.humanChannel)
|
|
203
229
|
};
|
|
204
230
|
}
|
|
@@ -237,4 +263,4 @@ function registerSettingsSection(ctx, config) {
|
|
|
237
263
|
} catch {}
|
|
238
264
|
}
|
|
239
265
|
//#endregion
|
|
240
|
-
export {
|
|
266
|
+
export { FACE_PORTS as a, MECHANISM_PORTS as c, registerSkiffSession as d, skiffRoleFor as f, ACC_VERSION as h, ACP_PORT as i, SKIFF_DEBUG_PORT as l, unregisterSkiffSession as m, readSimpleSettings as n, GATEWAY_PORT as o, skiffSessionInfo as p, registerSettingsSection as r, MAIN_WEB_PORT as s, SERENITY_SETTINGS_NS as t, WEIXIN_SEND_PORT as u };
|
|
@@ -69,6 +69,13 @@ interface SimpleConfigFragment {
|
|
|
69
69
|
diagram?: {
|
|
70
70
|
enabled?: boolean;
|
|
71
71
|
};
|
|
72
|
+
/** 🔴 面 E(官方 ACP,2026-10-16 owner 令「跑在 dsh web 进程内」):部署层嵌套段。
|
|
73
|
+
* ⚠️ **键名刻意不用 `acp.*`** —— 旧面 E 退役时 `acp.*` 是**被静默忽略**的遗留名,
|
|
74
|
+
* 复用会让"当年那份旧配置"在新面上复活(判据:退役 ≠ 删名,名字仍需保留为"无人读")。 */
|
|
75
|
+
acpFace?: {
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
port?: number;
|
|
78
|
+
};
|
|
72
79
|
/** human-channel(人机信道;**机器级**;2026-09-26 owner 定案):账号 / 订阅表 / 主控 / 出站白名单 */
|
|
73
80
|
humanChannel?: HumanChannelConfigFragment;
|
|
74
81
|
gatewayEnabled?: PanelBoolean;
|
|
@@ -78,6 +85,9 @@ interface SimpleConfigFragment {
|
|
|
78
85
|
croEnabled?: PanelBoolean;
|
|
79
86
|
unattendedEnabled?: PanelBoolean;
|
|
80
87
|
diagramEnabled?: PanelBoolean;
|
|
88
|
+
/** 🔴 面 E(官方 ACP,2026-10-16):开关 + 端口(面板层扁平键) */
|
|
89
|
+
acpFaceEnabled?: PanelBoolean;
|
|
90
|
+
acpFacePort?: PanelNumber;
|
|
81
91
|
}
|
|
82
92
|
/**
|
|
83
93
|
* 设置面板命名空间 = **profile 条目 id**(v0.1.7 起;与旧 `settings.yaml` 段名逐字相同)。
|
|
@@ -122,6 +132,18 @@ interface SerenitySimpleSettings {
|
|
|
122
132
|
* 零 token、不会被误调),同 `skiff` 的"未开启零资源占用"口径。
|
|
123
133
|
* 依赖面:随包分发 3.8 MB 内置字体(`assets/diagram/`,wasm 对系统字体不可见)。 */
|
|
124
134
|
diagramEnabled: boolean;
|
|
135
|
+
/** 🔴 **面 E:官方 ACP 总开关**(2026-10-16 owner 令「跑在 dsh web 进程内」;**缺省关**)。
|
|
136
|
+
*
|
|
137
|
+
* 开启后:ACC 在自己进程里起一个 **ACP 服务面**(面宿主统一建 listener),
|
|
138
|
+
* 标准 ACP 客户端(Agmente 等)经 WebSocket 登入本 CCC —— **不另起进程、不需 stdio 桥**。
|
|
139
|
+
* **缺省关**:① 它把本 CCC 开给外部客户端;② ⚠️ **ACP 协议本身无认证**(`dsh-acp` 的
|
|
140
|
+
* `authenticate` 恒成功),而本面按 owner 裁决绑 **`0.0.0.0`** ⇒ **开之前必须有外部接入层
|
|
141
|
+
* 兜底**(现为 Cloudflare Access)。缺省关 = "不配就没有暴露面"。
|
|
142
|
+
* ⚠️ **与已退役的旧面 E(3100 自造问答面)无关**:本面是**官方** `@deepseek-ai/dsh-acp`。
|
|
143
|
+
* 实测(P0′,8/8)见 S142 `2026-10-16T0745-…-p0prime-inproc-findings.md`。 */
|
|
144
|
+
acpFaceEnabled: boolean;
|
|
145
|
+
/** 面 E 端口(默认 3200;避开 3080/3081/3082/3099 与已退役的 3100) */
|
|
146
|
+
acpFacePort: number;
|
|
125
147
|
/** **human-channel(人机信道)机器级配置**(2026-09-26 owner 定案;P0-1 立 schema + 投影)。
|
|
126
148
|
* 三张表(账号 / 订阅 / 主控)+ 出站白名单;**跨 CCC** ⇒ 归机器级,CCC 侧 `weixin.*` 随之退役
|
|
127
149
|
* (退役动作在 P0-2~P0-4;本版**只立机器级面**,旧面照旧)。缺省与归一规则见
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shgroup/dsh-serenity-hooks",
|
|
3
|
-
"version": "1.58.
|
|
3
|
+
"version": "1.58.2",
|
|
4
4
|
"description": "宁静号 ACC harness(Native Cordis 插件)——给 DeepSeek Harness 装一个「AI 工作区」:14 个工具(container_fs/container_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/cheap-worker/localstore/container_admin;另三个 im-bridge/acc-diag/diagram 按配置条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫/对外输出守卫)+ 工作日志与原地重建 + 网页登录入口/微信桥/子角色/对外问答页/trajectory 唤醒注册表。适配 DSH 0.1.7-rc.1 与 0.2.0-rc.1(双档)。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
"README.md"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@resvg/resvg-wasm": "2.6.2"
|
|
48
|
+
"@resvg/resvg-wasm": "2.6.2",
|
|
49
|
+
"ws": "^8.22.0"
|
|
49
50
|
},
|
|
50
51
|
"scripts": {
|
|
51
52
|
"typecheck": "tsc --noEmit",
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
},
|
|
67
68
|
"peerDependencies": {
|
|
68
69
|
"@deepseek-ai/cordis": "^4.0.4",
|
|
70
|
+
"@deepseek-ai/dsh-acp": "^0.1.7-rc.1 || ^0.2.0-rc.1",
|
|
69
71
|
"@deepseek-ai/dsh-agent": "^0.1.7-rc.1 || ^0.2.0-rc.1",
|
|
70
72
|
"@deepseek-ai/dsh-agent-loop": "^0.1.7-rc.1 || ^0.2.0-rc.1",
|
|
71
73
|
"@deepseek-ai/dsh-agent-preset-registry": "^0.1.7-rc.1 || ^0.2.0-rc.1",
|
|
@@ -85,6 +87,9 @@
|
|
|
85
87
|
"cordis": "^4.0.0-rc.7"
|
|
86
88
|
},
|
|
87
89
|
"peerDependenciesMeta": {
|
|
90
|
+
"@deepseek-ai/dsh-acp": {
|
|
91
|
+
"optional": true
|
|
92
|
+
},
|
|
88
93
|
"@deepseek-ai/dsh-host-webserver": {
|
|
89
94
|
"optional": true
|
|
90
95
|
},
|
|
@@ -109,6 +114,7 @@
|
|
|
109
114
|
},
|
|
110
115
|
"devDependencies": {
|
|
111
116
|
"@deepseek-ai/cordis": "^4.0.4",
|
|
117
|
+
"@deepseek-ai/dsh-acp": "0.1.7-rc.1",
|
|
112
118
|
"@deepseek-ai/dsh-agent": "0.1.7-rc.1",
|
|
113
119
|
"@deepseek-ai/dsh-agent-loop": "0.1.7-rc.1",
|
|
114
120
|
"@deepseek-ai/dsh-agent-preset-registry": "0.1.7-rc.1",
|
|
@@ -147,6 +153,7 @@
|
|
|
147
153
|
"@types/node": "^20.0.0",
|
|
148
154
|
"@types/qrcode-generator": "^1.0.6",
|
|
149
155
|
"@types/react": "^18.2.0",
|
|
156
|
+
"@types/ws": "^8.18.2",
|
|
150
157
|
"@vitest/coverage-v8": "^1.6.1",
|
|
151
158
|
"marked": "^18.0.11",
|
|
152
159
|
"qrcode-generator": "^2.0.4",
|
|
@@ -154,7 +161,8 @@
|
|
|
154
161
|
"tsdown": "^0.22.14",
|
|
155
162
|
"typescript": "^5.4.0",
|
|
156
163
|
"unrun": "^0.3.1",
|
|
157
|
-
"vitest": "^1.6.0"
|
|
164
|
+
"vitest": "^1.6.0",
|
|
165
|
+
"ws": "8.22.0"
|
|
158
166
|
},
|
|
159
167
|
"pnpm": {
|
|
160
168
|
"onlyBuiltDependencies": [
|