cofluxd 0.7.0 → 0.8.0

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.
Files changed (2) hide show
  1. package/cofluxd.mjs +6 -3
  2. package/package.json +1 -1
package/cofluxd.mjs CHANGED
@@ -666,11 +666,11 @@ function cmdUninstall(v) {
666
666
 
667
667
  /* ------------------------------ hook:agent 事件信使 ------------------------------ */
668
668
  // agent hook 的上报信使:用户在 claude/codex 的 hook 配置里指向本命令,事件发生时它把
669
- // 事件名转发给本机 worker 的固定 gateway(POST /hook),供活动状态判定(执行中/等待交互)。
669
+ // 事件名转发给本机 worker 的固定 gateway(POST /hook),供活动状态判定。
670
670
  //
671
671
  // 输入两种形态都收:claude 与 codex hooks 引擎走 stdin JSON;codex 旧式 notify 把 payload
672
- // 作为最后一个 argv 传入。只转发事件名 + agent 会话 id + 本进程 pid/ppid——payload 里的
673
- // prompt / 回答原文一律不出机(隐私边界)。
672
+ // 作为最后一个 argv 传入。只转发事件名 + notification 类型 + agent 会话 id + 本进程
673
+ // pid/ppid——payload 里的 prompt / 回答原文 / 通知正文一律不出机(隐私边界)。
674
674
  //
675
675
  // 契约(worker 侧将来实现 /hook 时依赖):请求保持到收到响应才退出——worker 在处理期间
676
676
  // 用上报的 pid 反查进程树归属哪个 session,本进程活着扫描才有效。
@@ -721,6 +721,7 @@ async function cmdHook() {
721
721
  hookDebug(portResult.error);
722
722
  return;
723
723
  }
724
+ const notification = payload.notification_type ?? payload.notificationType;
724
725
  const body = {
725
726
  agent,
726
727
  event,
@@ -728,6 +729,8 @@ async function cmdHook() {
728
729
  ppid: process.ppid,
729
730
  // agent 自身的会话标识(claude: session_id / codex notify: thread-id),供 worker 去重与调试
730
731
  agentSessionId: payload.session_id ?? payload["thread-id"] ?? undefined,
732
+ // Claude Notification 的类型枚举(permission_prompt / agent_needs_input …),不含正文
733
+ notification: typeof notification === "string" && notification ? notification : undefined,
731
734
  };
732
735
  hookDebug("POST /hook", JSON.stringify(body));
733
736
  const res = await fetch(`http://127.0.0.1:${portResult.port}/hook`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cofluxd",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "coflux daemon 管理 CLI:装/起/停/升级 Rust daemon(supervisor + worker)",
5
5
  "type": "module",
6
6
  "bin": {