|
|
@@ -112,6 +112,7 @@ export function Prompt(props: PromptProps) {
|
|
|
const [auto, setAuto] = createSignal<AutocompleteRef>()
|
|
|
const currentProviderLabel = createMemo(() => local.model.parsed().provider)
|
|
|
const hasRightContent = createMemo(() => Boolean(props.right))
|
|
|
+ const [autoaccept, setAutoaccept] = kv.signal<"none" | "edit">("permission_auto_accept", "edit")
|
|
|
|
|
|
function promptModelWarning() {
|
|
|
toast.show({
|
|
|
@@ -228,6 +229,17 @@ export function Prompt(props: PromptProps) {
|
|
|
|
|
|
command.register(() => {
|
|
|
return [
|
|
|
+ {
|
|
|
+ title: autoaccept() === "none" ? "Enable autoedit" : "Disable autoedit",
|
|
|
+ value: "permission.auto_accept.toggle",
|
|
|
+ search: "toggle permissions",
|
|
|
+ keybind: "permission_auto_accept_toggle",
|
|
|
+ category: "Agent",
|
|
|
+ onSelect: (dialog) => {
|
|
|
+ setAutoaccept(() => (autoaccept() === "none" ? "edit" : "none"))
|
|
|
+ dialog.clear()
|
|
|
+ },
|
|
|
+ },
|
|
|
{
|
|
|
title: "Clear prompt",
|
|
|
value: "prompt.clear",
|
|
|
@@ -1221,11 +1233,16 @@ export function Prompt(props: PromptProps) {
|
|
|
)}
|
|
|
</Show>
|
|
|
</box>
|
|
|
- <Show when={hasRightContent()}>
|
|
|
- <box flexDirection="row" gap={1} alignItems="center">
|
|
|
- {props.right}
|
|
|
- </box>
|
|
|
- </Show>
|
|
|
+ <box flexDirection="row" gap={1} alignItems="center">
|
|
|
+ <Show when={autoaccept() === "edit"}>
|
|
|
+ <text>
|
|
|
+ <span style={{ fg: theme.warning }}>autoedit</span>
|
|
|
+ </text>
|
|
|
+ </Show>
|
|
|
+ <Show when={hasRightContent()}>
|
|
|
+ <>{props.right}</>
|
|
|
+ </Show>
|
|
|
+ </box>
|
|
|
</box>
|
|
|
</box>
|
|
|
</box>
|