Skip to content

Commit 0629090

Browse files
committed
feat(tui): restore plugin manager dialog
1 parent 1c8175a commit 0629090

18 files changed

Lines changed: 148 additions & 1451 deletions

File tree

‎packages/plugin/src/tui/context.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,11 @@ export interface DialogSelectOptions<Value> {
230230
}
231231

232232
export interface Dialog {
233-
/** Shows a dialog and returns a function that closes it. */
234-
show(render: () => JSX.Element, onClose?: () => void): () => void
235-
/** Sets the presentation options for this plugin's active dialog. */
233+
/** Shows a dialog. */
234+
show(render: () => JSX.Element, onClose?: () => void): void
235+
/** Sets the active dialog's presentation options. */
236236
set(options: DialogOptions): void
237-
/** Closes this plugin's active dialog. */
237+
/** Closes the active dialog. */
238238
clear(): void
239239
alert(options: DialogAlertOptions): Promise<void>
240240
confirm(options: DialogConfirmOptions): Promise<boolean | undefined>

‎packages/tui/package.json‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
},
1212
"exports": {
1313
".": "./src/index.tsx",
14-
"./builtins": "./src/feature-plugins/builtins.ts",
1514
"./config": "./src/config/index.tsx",
1615
"./config/keybind": "./src/config/keybind.ts",
1716
"./config/v1": "./src/config/v1/index.tsx",
@@ -37,9 +36,6 @@
3736
"./context/keymap": "./src/context/keymap.tsx",
3837
"./prompt/content": "./src/prompt/content.ts",
3938
"./prompt/display": "./src/prompt/display.ts",
40-
"./plugin/runtime": "./src/plugin/runtime.tsx",
41-
"./plugin/slots": "./src/plugin/slots.tsx",
42-
"./plugin/command-shim": "./src/plugin/command-shim.ts",
4339
"./parsers-config": "./src/parsers-config.ts",
4440
"./util/error": "./src/util/error.ts",
4541
"./util/filetype": "./src/util/filetype.ts",

‎packages/tui/src/app.tsx‎

Lines changed: 41 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ import { ArgsProvider, useArgs, type Args } from "./context/args"
8181
import open from "open"
8282
import { PromptRefProvider, usePromptRef } from "./context/prompt"
8383
import { Config, ConfigProvider, useConfig } from "./config"
84-
import { createPluginRuntime, PluginRuntimeProvider, usePluginRuntime } from "./plugin/runtime"
8584
import { PluginProvider, PluginRoute, PluginSlot, usePlugin, type PackageResolver } from "./plugin/context"
8685
import { CommandPaletteDialog } from "./component/command-palette"
8786
import { COMMAND_PALETTE_COMMAND, Keymap, type KeymapCommand } from "./context/keymap"
@@ -275,8 +274,6 @@ export const run = Effect.fn("Tui.run")(function* (input: TuiInput) {
275274
() => Effect.sync(() => process.off("SIGHUP", onSighup)),
276275
)
277276
renderer.once("destroy", () => Deferred.doneUnsafe(shutdown, Effect.void))
278-
const pluginRuntime = createPluginRuntime()
279-
280277
yield* Effect.tryPromise(async () => {
281278
// Prewarm palette before ThemeProvider mounts so `system` theme avoids a first-paint fallback flash.
282279
void renderer.getPalette({ size: 16 }).catch(() => undefined)
@@ -354,49 +351,47 @@ export const run = Effect.fn("Tui.run")(function* (input: TuiInput) {
354351
: undefined
355352
}
356353
>
357-
<PluginRuntimeProvider value={pluginRuntime}>
358-
<ClientProvider api={api} service={service}>
359-
<PermissionProvider>
360-
<DataProvider>
361-
<LocationProvider>
362-
<SessionTabsProvider>
363-
<ThemeProvider mode={mode}>
364-
<ThemeErrorToast />
365-
<LocalProvider>
366-
<PromptStashProvider>
367-
<DialogProvider>
368-
<FrecencyProvider>
369-
<PromptHistoryProvider>
370-
<PromptRefProvider>
371-
<EditorContextProvider>
372-
<AttentionProvider>
373-
<PluginProvider packages={input.packages}>
374-
<App
375-
pair={
376-
input.server.endpoint.auth
377-
? input.server.endpoint.auth
378-
: {
379-
username: "opencode",
380-
password: "",
381-
}
382-
}
383-
/>
384-
</PluginProvider>
385-
</AttentionProvider>
386-
</EditorContextProvider>
387-
</PromptRefProvider>
388-
</PromptHistoryProvider>
389-
</FrecencyProvider>
390-
</DialogProvider>
391-
</PromptStashProvider>
392-
</LocalProvider>
393-
</ThemeProvider>
394-
</SessionTabsProvider>
395-
</LocationProvider>
396-
</DataProvider>
397-
</PermissionProvider>
398-
</ClientProvider>
399-
</PluginRuntimeProvider>
354+
<ClientProvider api={api} service={service}>
355+
<PermissionProvider>
356+
<DataProvider>
357+
<LocationProvider>
358+
<SessionTabsProvider>
359+
<ThemeProvider mode={mode}>
360+
<ThemeErrorToast />
361+
<LocalProvider>
362+
<PromptStashProvider>
363+
<DialogProvider>
364+
<FrecencyProvider>
365+
<PromptHistoryProvider>
366+
<PromptRefProvider>
367+
<EditorContextProvider>
368+
<AttentionProvider>
369+
<PluginProvider packages={input.packages}>
370+
<App
371+
pair={
372+
input.server.endpoint.auth
373+
? input.server.endpoint.auth
374+
: {
375+
username: "opencode",
376+
password: "",
377+
}
378+
}
379+
/>
380+
</PluginProvider>
381+
</AttentionProvider>
382+
</EditorContextProvider>
383+
</PromptRefProvider>
384+
</PromptHistoryProvider>
385+
</FrecencyProvider>
386+
</DialogProvider>
387+
</PromptStashProvider>
388+
</LocalProvider>
389+
</ThemeProvider>
390+
</SessionTabsProvider>
391+
</LocationProvider>
392+
</DataProvider>
393+
</PermissionProvider>
394+
</ClientProvider>
400395
</RouteProvider>
401396
</ToastProvider>
402397
</Keymap.Provider>
@@ -453,7 +448,6 @@ function App(props: { pair?: DialogPairCredentials }) {
453448
const location = useLocation()
454449
const exit = useExit()
455450
const promptRef = usePromptRef()
456-
const pluginRuntime = usePluginRuntime()
457451
const plugins = usePlugin()
458452
const clipboard = useClipboard()
459453

‎packages/tui/src/config/v1/keybind.ts‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -230,24 +230,9 @@ export const Definitions = {
230230
"permission.prompt.fullscreen": keybind("ctrl+f", "Toggle permission prompt fullscreen"),
231231
"plugins.toggle": keybind("space", "Toggle plugin"),
232232
"dialog.mcp.toggle": keybind("space", "Toggle MCP server"),
233-
"dialog.plugins.install": keybind("shift+i", "Install plugin from plugin dialog"),
234233

235234
terminal_suspend: keybind("ctrl+z", "Suspend terminal"),
236235
terminal_title_toggle: keybind("none", "Toggle terminal title"),
237-
plugin_manager: keybind("none", "Open plugin manager dialog"),
238-
plugin_install: keybind("none", "Install plugin"),
239-
240-
which_key_toggle: keybind("ctrl+alt+k", "Toggle which-key panel"),
241-
which_key_layout_toggle: keybind("ctrl+alt+shift+k", "Switch which-key layout"),
242-
which_key_pending_toggle: keybind("ctrl+alt+shift+p", "Toggle which-key pending preview"),
243-
which_key_group_previous: keybind("ctrl+alt+left,ctrl+alt+[", "Previous which-key group"),
244-
which_key_group_next: keybind("ctrl+alt+right,ctrl+alt+]", "Next which-key group"),
245-
which_key_scroll_up: keybind("ctrl+alt+up,ctrl+alt+p", "Scroll which-key up"),
246-
which_key_scroll_down: keybind("ctrl+alt+down,ctrl+alt+n", "Scroll which-key down"),
247-
which_key_page_up: keybind("ctrl+alt+pageup", "Page which-key up"),
248-
which_key_page_down: keybind("ctrl+alt+pagedown", "Page which-key down"),
249-
which_key_home: keybind("ctrl+alt+home", "Jump to first which-key binding"),
250-
which_key_end: keybind("ctrl+alt+end", "Jump to last which-key binding"),
251236
} satisfies Record<string, Definition>
252237

253238
type KeybindName = keyof typeof Definitions
@@ -425,19 +410,6 @@ export const CommandMap = {
425410
history_next: "prompt.history.next",
426411
terminal_suspend: "terminal.suspend",
427412
terminal_title_toggle: "terminal.title.toggle",
428-
plugin_manager: "plugins.list",
429-
plugin_install: "plugins.install",
430-
which_key_toggle: "which-key.toggle",
431-
which_key_layout_toggle: "which-key.layout.toggle",
432-
which_key_pending_toggle: "which-key.pending.toggle",
433-
which_key_group_previous: "which-key.group.previous",
434-
which_key_group_next: "which-key.group.next",
435-
which_key_scroll_up: "which-key.scroll.up",
436-
which_key_scroll_down: "which-key.scroll.down",
437-
which_key_page_up: "which-key.page.up",
438-
which_key_page_down: "which-key.page.down",
439-
which_key_home: "which-key.home",
440-
which_key_end: "which-key.end",
441413
} satisfies BindingCommandMap
442414
const CommandDescriptions = Object.fromEntries(
443415
Object.entries(Definitions).map(([name, item]) => [

‎packages/tui/src/feature-plugins/builtins.ts‎

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)