The open source coding agent.
TypeScript
sync
Dax Raad261ff416a9fb
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsxindex 91150da9c9a..0dfefe42223 100644--- a/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx@@ -47,6 +47,9 @@ function init() {}}},+ show() {+ dialog.replace(() => <DialogCommand options={options()} />)+ },register(cb: () => CommandOption[]) {const results = createMemo(cb)setRegistrations((arr) => [results, ...arr])@@ -90,7 +93,10 @@ function DialogCommand(props: { options: CommandOption[] }) {return (<DialogSelecttitle="Commands"- options={props.options.map((x) => ({ ...x, footer: x.keybind ? keybind.print(x.keybind) : undefined }))}+ options={props.options.map((x) => ({+ ...x,+ footer: x.keybind ? keybind.print(x.keybind) : undefined,+ }))}/>)}diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsxindex 92798b94280..e455f99bd0f 100644--- a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx+++ b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx@@ -270,6 +270,11 @@ export function Autocomplete(props: {description: "show help",onSelect: () => command.trigger("help.show"),},+ {+ display: "/commands",+ description: "show all commands",+ onSelect: () => command.show(),+ },)const max = firstBy(results, [(x) => x.display.length, "desc"])?.display.lengthif (!max) return resultsdiff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsxindex c5a195f3afc..8c52ba3a7f7 100644--- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx+++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx@@ -563,10 +563,11 @@ export function Prompt(props: PromptProps) {if (store.mode === "normal") autocomplete.onKeyDown(e)if (!autocomplete.visible) {if (- (e.name === "up" && input.cursorOffset === 0) ||- (e.name === "down" && input.cursorOffset === input.plainText.length)+ (keybind.match("history_previous", e) && input.cursorOffset === 0) ||+ (keybind.match("history_next", e) &&+ input.cursorOffset === input.plainText.length)) {- const direction = e.name === "up" ? -1 : 1+ const direction = keybind.match("history_previous", e) ? -1 : 1const item = history.move(direction, input.plainText)if (item) {diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.tsindex ac1165eab95..f84cca73406 100644--- a/packages/opencode/src/config/config.ts+++ b/packages/opencode/src/config/config.ts@@ -385,7 +385,11 @@ export namespace Config {.optional().default("ctrl+x").describe("Leader key for keybind combinations"),- app_exit: z.string().optional().default("ctrl+c,ctrl+d,<leader>q").describe("Exit the application"),+ app_exit: z+ .string()+ .optional()+ .default("ctrl+c,ctrl+d,<leader>q")+ .describe("Exit the application"),editor_open: z.string().optional().default("<leader>e").describe("Open external editor"),theme_list: z.string().optional().default("<leader>t").describe("List available themes"),sidebar_toggle: z.string().optional().default("<leader>b").describe("Toggle sidebar"),@@ -462,6 +466,8 @@ export namespace Config {.optional().default("shift+enter,ctrl+j").describe("Insert newline in input"),+ history_previous: z.string().optional().default("up").describe("Previous history item"),+ history_next: z.string().optional().default("down").describe("Previous history item"),}).strict().meta({diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.tsindex fce8d203b1a..994fa8244bf 100644--- a/packages/sdk/js/src/gen/types.gen.ts+++ b/packages/sdk/js/src/gen/types.gen.ts@@ -150,6 +150,14 @@ export type KeybindsConfig = {* Insert newline in input*/input_newline?: string+ /**+ * Previous history item+ */+ history_previous?: string+ /**+ * Previous history item+ */+ history_next?: string}export type AgentConfig = {