mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix: implement permission handler callbacks and add CodexPermission UI support
Adds onRequest and onComplete callbacks to CodexPermissionHandler to track permission request/response lifecycle. Includes helper functions to normalize command and cwd inputs, and displays permission requests in the web UI.
This commit is contained in:
@@ -137,6 +137,15 @@ export const knownTools: Record<string, {
|
||||
},
|
||||
minimal: true
|
||||
},
|
||||
CodexPermission: {
|
||||
icon: () => <QuestionIcon className={DEFAULT_ICON_CLASS} />,
|
||||
title: (opts) => {
|
||||
const tool = getInputStringAny(opts.input, ['tool'])
|
||||
return tool ? `Permission: ${tool}` : 'Permission request'
|
||||
},
|
||||
subtitle: (opts) => getInputStringAny(opts.input, ['command']) ?? null,
|
||||
minimal: true
|
||||
},
|
||||
shell_command: {
|
||||
icon: () => <TerminalIcon className={DEFAULT_ICON_CLASS} />,
|
||||
title: (opts) => opts.description ?? 'Terminal',
|
||||
|
||||
Reference in New Issue
Block a user