mirror of
https://github.com/lucas-labs/claude-plugins.git
synced 2026-05-11 17:15:43 -03:00
Show input_preview only for Bash in permission prompts
Write/Edit previews are unbearably long over iMessage. Bash is the dangerous one where seeing the command matters; everything else gets tool_name + description only.
This commit is contained in:
parent
9693fd75c3
commit
d49d339d1e
@ -536,10 +536,13 @@ mcp.setNotificationHandler(
|
|||||||
async ({ params }) => {
|
async ({ params }) => {
|
||||||
const { request_id, tool_name, description, input_preview } = params
|
const { request_id, tool_name, description, input_preview } = params
|
||||||
const access = loadAccess()
|
const access = loadAccess()
|
||||||
|
// input_preview is unbearably long for Write/Edit; show only for Bash
|
||||||
|
// where the command itself is the dangerous part.
|
||||||
|
const preview = tool_name === 'Bash' ? `${input_preview}\n\n` : '\n'
|
||||||
const text =
|
const text =
|
||||||
`🔐 Permission request [${request_id}]\n` +
|
`🔐 Permission request [${request_id}]\n` +
|
||||||
`${tool_name}: ${description}\n` +
|
`${tool_name}: ${description}\n` +
|
||||||
`${input_preview}\n\n` +
|
preview +
|
||||||
`Reply "yes ${request_id}" to allow or "no ${request_id}" to deny.`
|
`Reply "yes ${request_id}" to allow or "no ${request_id}" to deny.`
|
||||||
// allowFrom holds handle IDs, not chat GUIDs — resolve via qChatsForHandle.
|
// allowFrom holds handle IDs, not chat GUIDs — resolve via qChatsForHandle.
|
||||||
// Include SELF addresses so the owner's self-chat gets the prompt even
|
// Include SELF addresses so the owner's self-chat gets the prompt even
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user