@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 +1 -1
- package/src/main.mjs +1 -0
- package/src/tui-permission-bridge.mjs +11 -2
package/package.json
CHANGED
package/src/main.mjs
CHANGED
|
@@ -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({
|
|
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) {
|