@cocorograph/hub-agent 0.6.47 → 0.6.48

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.47",
3
+ "version": "0.6.48",
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
@@ -1028,6 +1028,7 @@ async function dispatch(msg, ctx) {
1028
1028
  msg.request_id,
1029
1029
  !!msg.allow,
1030
1030
  msg.deny_message,
1031
+ msg.updated_input,
1031
1032
  )
1032
1033
  : false
1033
1034
  if (handledByTui) return
@@ -114,9 +114,12 @@ export class TuiPermissionBridge extends EventEmitter {
114
114
  * @param {string} request_id
115
115
  * @param {boolean} allow
116
116
  * @param {string} [denyMessage]
117
+ * @param {unknown} [updatedInput] AskUserQuestion 等の回答 ({questions, answers})。
118
+ * フックが PreToolUse の hookSpecificOutput.updatedInput として注入し、claude が
119
+ * 対話 UI を出さず確定する。Bash 等の allow/deny だけで済むツールでは undefined。
117
120
  * @returns {Promise<boolean>} この bridge の管理下だったか
118
121
  */
119
- async resolve(request_id, allow, denyMessage) {
122
+ async resolve(request_id, allow, denyMessage, updatedInput) {
120
123
  if (!this._pending.has(request_id)) return false
121
124
  this._pending.delete(request_id)
122
125
  const decision = allow ? "allow" : "deny"
@@ -125,7 +128,13 @@ export class TuiPermissionBridge extends EventEmitter {
125
128
  try {
126
129
  await writeFile(
127
130
  tmp,
128
- JSON.stringify({ decision, deny_message: denyMessage ?? null }),
131
+ JSON.stringify({
132
+ decision,
133
+ deny_message: denyMessage ?? null,
134
+ // 回答 (AskUserQuestion の {questions, answers} 等)。フックが
135
+ // updatedInput として注入する。無ければ null (Bash 等)。
136
+ updated_input: updatedInput ?? null,
137
+ }),
129
138
  )
130
139
  await rename(tmp, fp)
131
140
  } catch (err) {