@cocorograph/hub-agent 0.6.63 → 0.6.64

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocorograph/hub-agent",
3
- "version": "0.6.63",
3
+ "version": "0.6.64",
4
4
  "description": "Hub Hosted Cockpit のローカル常駐 agent。Hub と outbound WSS で接続し、ローカルの tmux/pty を中継する。",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
package/src/main.mjs CHANGED
@@ -573,7 +573,7 @@ export async function startDaemon({ version, ptyModule, claudeSdk } = {}) {
573
573
  const tuiPermissionBridge = new TuiPermissionBridge({ logger })
574
574
  tuiPermissionBridge.on(
575
575
  "permission",
576
- ({ request_id, session_id, cwd, tool_name, input }) => {
576
+ ({ request_id, session_id, cwd, tool_name, input, context_text }) => {
577
577
  if (cwd) {
578
578
  try {
579
579
  recordChatActivity(cwd, { inputPending: true })
@@ -589,6 +589,8 @@ export async function startDaemon({ version, ptyModule, claudeSdk } = {}) {
589
589
  request_id,
590
590
  tool_name,
591
591
  input,
592
+ // 質問/承認カードの直前アシスタント説明 (フック由来。browser がカード上部に表示)。
593
+ context_text: context_text ?? null,
592
594
  })
593
595
  },
594
596
  )
@@ -1535,6 +1537,8 @@ async function dispatch(msg, ctx) {
1535
1537
  request_id: p.request_id,
1536
1538
  tool_name: p.tool_name,
1537
1539
  input: p.input,
1540
+ // 再 hydrate でも直前説明を保つ (listPending が payload ごと保持している)。
1541
+ context_text: p.context_text ?? null,
1538
1542
  })
1539
1543
  }
1540
1544
  if (pend.length) {
@@ -111,6 +111,9 @@ export class TuiPermissionBridge extends EventEmitter {
111
111
  cwd: body.cwd ?? null,
112
112
  tool_name: body.tool_name ?? "",
113
113
  input: body.tool_input ?? {},
114
+ // 質問/承認カードの直前アシスタント説明 (フックが transcript から抽出して同梱)。
115
+ // browser はこれをカード上部に表示し、jsonl tail の到着レースに依らず文脈を読める。
116
+ context_text: body.context_text ?? null,
114
117
  }
115
118
  // payload も保持する (セッション切替でビュー再マウント時の re-hydrate / listPending 用)。
116
119
  this._pending.set(request_id, { payload, at: Date.now() })