diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..3003c465 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "name": "opencode-dev", + "image": "oven/bun:1", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": {} + }, + "postCreateCommand": "apt-get update && apt-get install -y python3 make g++ && bun install" +} \ No newline at end of file diff --git a/packages/tui/src/app.tsx b/packages/tui/src/app.tsx index 57f372ef..07d735cf 100644 --- a/packages/tui/src/app.tsx +++ b/packages/tui/src/app.tsx @@ -46,6 +46,7 @@ import { DialogStatus } from "./component/dialog-status" import { DialogDebug } from "./component/dialog-debug" import { DialogThemeList } from "./component/dialog-theme-list" import { DialogHelp } from "./ui/dialog-help" +import { DialogScotty } from "./ui/dialog-scotty" import { DialogAgent } from "./component/dialog-agent" import { DialogSessionList } from "./component/dialog-session-list" import { DialogWorkspaceList } from "./component/dialog-workspace-list" @@ -815,6 +816,15 @@ function App(props: { onSnapshot?: () => Promise; pluginHost: TuiPlugi }, category: "System", }, + { + name: "opencode.scotty", + title: "Show Scotty", + slashName: "scotty", + run: () => { + dialog.replace(() => ) + }, + category: "System", + }, { name: "docs.open", title: "Open docs", diff --git a/packages/tui/src/ui/dialog-scotty.tsx b/packages/tui/src/ui/dialog-scotty.tsx new file mode 100644 index 00000000..b9e1ef83 --- /dev/null +++ b/packages/tui/src/ui/dialog-scotty.tsx @@ -0,0 +1,53 @@ +import { For } from "solid-js" +import { TextAttributes } from "@opentui/core" +import { useTheme } from "../context/theme" +import { useDialog } from "./dialog" +import { useBindings } from "../keymap" + +// String.raw keeps the backslashes in the art literal. +const SCOTTY = String.raw` + /| ___ + / | / \ + / |___________/ o \ + | | + | \__| + | | + |______________________| + | | | | + |__| |__| +` + +// Drop the blank first and last rows the template literal adds. +const LINES = SCOTTY.split("\n").slice(1, -1) + +export function DialogScotty() { + const dialog = useDialog() + const { theme } = useTheme() + + useBindings(() => ({ + bindings: [ + { + key: "return", + desc: "Close Scotty", + group: "Dialog", + cmd: () => dialog.clear(), + }, + ], + })) + + return ( + + + + Scotty the Scottish Terrier + + dialog.clear()}> + esc + + + + {(line) => {line}} + + + ) +}