feat(ui): drop the slash and the argument echo from the command row
The web command row renders `title · summary` from one logged command lifecycle pair, and the two halves were written without knowing about each other: the title was the dispatched line rebuilt from `command/run` and the summary was `command/done`'s verbatim text, so every Access-chip pick read `/permission workspace-write · Permission preset: workspace-write.` — the command name twice and its argument twice. The title is now the bare command name (no `/`, no arguments — the summary already says what the command did), and a command handler's settlement text never repeats the command's own name, so `/permission` returns `preset workspace-write`. The row reads `permission · preset workspace-write`, and the TUI notice still names the preset that now applies. The log is unchanged: `command/run` keeps its structured name/args split for a richer registered row.
This commit is contained in:
@@ -211,16 +211,19 @@ export class PermissionService extends Service {
|
||||
name: 'permission',
|
||||
description: 'Switch the permission preset (sandbox mode + approval policy)',
|
||||
input: { hint: '<preset>' },
|
||||
// The settlement text never repeats the command's own name: a surface
|
||||
// that renders `name · text` (the web command row) would otherwise
|
||||
// read `permission · Permission preset: workspace-write.`
|
||||
handler: ({ agent, rawInput }) => {
|
||||
const name = rawInput.trim()
|
||||
if (name === '') {
|
||||
return { kind: 'success', text: `Current permission preset: ${this.current(agent.session.events)}. Available: ${this.names.join(', ')}.` }
|
||||
return { kind: 'success', text: `current preset ${this.current(agent.session.events)} (available: ${this.names.join(', ')})` }
|
||||
}
|
||||
if (!this.names.includes(name)) {
|
||||
return { kind: 'error', text: `unknown permission preset "${name}" (available: ${this.names.join(', ')})` }
|
||||
}
|
||||
this.set(agent.session, name)
|
||||
return { kind: 'success', text: `Permission preset: ${name}.` }
|
||||
return { kind: 'success', text: `preset ${name}` }
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user