From c113580800f1c7235aa6da9465e0f9e6b59b882f Mon Sep 17 00:00:00 2001 From: Kulvir Date: Mon, 9 Mar 2026 15:09:56 -0700 Subject: [PATCH] fix: restore TUI crash after upstream merge Co-Authored-By: Kai (Claude Opus 4.6) --- packages/opencode/src/cli/cmd/github.ts | 50 ++-- packages/opencode/src/cli/cmd/tui/app.tsx | 14 +- .../cli/cmd/tui/component/dialog-status.tsx | 2 +- .../src/cli/cmd/tui/component/logo.tsx | 4 +- .../src/cli/cmd/tui/component/tips.tsx | 56 ++-- .../src/cli/cmd/tui/context/theme.tsx | 12 +- .../cmd/tui/context/theme/altimate-code.json | 245 ++++++++++++++++++ .../src/cli/cmd/tui/routes/session/index.tsx | 2 +- .../cli/cmd/tui/routes/session/permission.tsx | 6 +- .../cli/cmd/tui/routes/session/sidebar.tsx | 2 +- packages/opencode/src/cli/cmd/tui/thread.ts | 3 + packages/opencode/src/cli/cmd/tui/worker.ts | 4 + packages/opencode/src/cli/logo.ts | 14 +- packages/opencode/src/server/routes/config.ts | 22 ++ 14 files changed, 364 insertions(+), 72 deletions(-) create mode 100644 packages/opencode/src/cli/cmd/tui/context/theme/altimate-code.json diff --git a/packages/opencode/src/cli/cmd/github.ts b/packages/opencode/src/cli/cmd/github.ts index 2491abc567..88b8c4f65e 100644 --- a/packages/opencode/src/cli/cmd/github.ts +++ b/packages/opencode/src/cli/cmd/github.ts @@ -133,9 +133,9 @@ type IssueQueryResponse = { } } -const AGENT_USERNAME = "opencode-agent[bot]" +const AGENT_USERNAME = "altimate-code-agent[bot]" const AGENT_REACTION = "eyes" -const WORKFLOW_FILE = ".github/workflows/opencode.yml" +const WORKFLOW_FILE = ".github/workflows/altimate-code.yml" // Event categories for routing // USER_EVENTS: triggered by user actions, have actor/issueId, support reactions/comments @@ -242,7 +242,7 @@ export const GithubInstallCommand = cmd({ "", " 3. Go to a GitHub issue and comment `/oc summarize` to see the agent in action", "", - " Learn more about the GitHub agent - https://opencode.ai/docs/github/#usage-examples", + " Learn more about the GitHub agent - https://altimate-code.dev/docs/github/#usage-examples", ].join("\n"), ) } @@ -266,7 +266,7 @@ export const GithubInstallCommand = cmd({ async function promptProvider() { const priority: Record = { - opencode: 0, + "altimate-code": 0, anthropic: 1, openai: 2, google: 3, @@ -324,7 +324,7 @@ export const GithubInstallCommand = cmd({ if (installation) return s.stop("GitHub app already installed") // Open browser - const url = "https://github.com/apps/opencode-agent" + const url = "https://github.com/apps/altimate-code-agent" const command = process.platform === "darwin" ? `open "${url}"` @@ -361,7 +361,7 @@ export const GithubInstallCommand = cmd({ async function getInstallation() { return await fetch( - `https://api.opencode.ai/get_github_app_installation?owner=${app.owner}&repo=${app.repo}`, + `https://api.altimate-code.dev/get_github_app_installation?owner=${app.owner}&repo=${app.repo}`, ) .then((res) => res.json()) .then((data) => data.installation) @@ -376,7 +376,7 @@ export const GithubInstallCommand = cmd({ await Filesystem.write( path.join(app.root, WORKFLOW_FILE), - `name: opencode + `name: altimate-code on: issue_comment: @@ -385,12 +385,12 @@ on: types: [created] jobs: - opencode: + altimate-code: if: | contains(github.event.comment.body, ' /oc') || startsWith(github.event.comment.body, '/oc') || - contains(github.event.comment.body, ' /opencode') || - startsWith(github.event.comment.body, '/opencode') + contains(github.event.comment.body, ' /altimate-code') || + startsWith(github.event.comment.body, '/altimate-code') runs-on: ubuntu-latest permissions: id-token: write @@ -403,8 +403,8 @@ jobs: with: persist-credentials: false - - name: Run opencode - uses: anomalyco/opencode/github@latest${envStr} + - name: Run altimate-code + uses: altimate/altimate-code/github@latest${envStr} with: model: ${provider}/${model}`, ) @@ -474,7 +474,7 @@ export const GithubRunCommand = cmd({ ? (payload as IssueCommentEvent | IssuesEvent).issue.number : (payload as PullRequestEvent | PullRequestReviewCommentEvent).pull_request.number const runUrl = `/${owner}/${repo}/actions/runs/${runId}` - const shareBaseUrl = isMock ? "https://dev.opencode.ai" : "https://opencode.ai" + const shareBaseUrl = isMock ? "https://dev.altimate-code.dev" : "https://altimate-code.dev" let appToken: string let octoRest: Octokit @@ -522,7 +522,7 @@ export const GithubRunCommand = cmd({ await addReaction(commentType) } - // Setup opencode session + // Setup altimate-code session const repoData = await fetchRepo() session = await Session.create({ permission: [ @@ -540,7 +540,7 @@ export const GithubRunCommand = cmd({ await Session.share(session.id) return session.id.slice(-8) })() - console.log("opencode session", session.id) + console.log("altimate-code session", session.id) // Handle event types: // REPO_EVENTS (schedule, workflow_dispatch): no issue/PR context, output to logs/PR only @@ -713,7 +713,7 @@ export const GithubRunCommand = cmd({ function normalizeOidcBaseUrl(): string { const value = process.env["OIDC_BASE_URL"] - if (!value) return "https://api.opencode.ai" + if (!value) return "https://api.altimate-code.dev" return value.replace(/\/+$/, "") } @@ -762,7 +762,7 @@ export const GithubRunCommand = cmd({ } const reviewContext = getReviewCommentContext() - const mentions = (process.env["MENTIONS"] || "/opencode,/oc") + const mentions = (process.env["MENTIONS"] || "/altimate-code,/oc") .split(",") .map((m) => m.trim().toLowerCase()) .filter(Boolean) @@ -909,7 +909,7 @@ export const GithubRunCommand = cmd({ } async function chat(message: string, files: PromptFiles = []) { - console.log("Sending message to opencode...") + console.log("Sending message to altimate-code...") const result = await SessionPrompt.prompt({ sessionID: session.id, @@ -1005,7 +1005,7 @@ export const GithubRunCommand = cmd({ async function getOidcToken() { try { - return await core.getIDToken("opencode-github-action") + return await core.getIDToken("altimate-code-github-action") } catch (error) { console.error("Failed to get OIDC token:", error instanceof Error ? error.message : error) throw new Error( @@ -1107,9 +1107,9 @@ export const GithubRunCommand = cmd({ .join("") if (type === "schedule" || type === "dispatch") { const hex = crypto.randomUUID().slice(0, 6) - return `opencode/${type}-${hex}-${timestamp}` + return `altimate-code/${type}-${hex}-${timestamp}` } - return `opencode/${type}${issueId}-${timestamp}` + return `altimate-code/${type}${issueId}-${timestamp}` } async function pushToNewBranch(summary: string, branch: string, commit: boolean, isSchedule: boolean) { @@ -1388,9 +1388,9 @@ Co-authored-by: ${actor} <${actor}@users.noreply.github.com>"` const titleAlt = encodeURIComponent(session.title.substring(0, 50)) const title64 = Buffer.from(session.title.substring(0, 700), "utf8").toString("base64") - return `${titleAlt}\n` + return `${titleAlt}\n` })() - const shareUrl = shareId ? `[opencode session](${shareBaseUrl}/s/${shareId})  |  ` : "" + const shareUrl = shareId ? `[altimate-code session](${shareBaseUrl}/s/${shareId})  |  ` : "" return `\n\n${image}${shareUrl}[github run](${runUrl})` } @@ -1451,7 +1451,7 @@ query($owner: String!, $repo: String!, $number: Int!) { return [ "", "You are running as a GitHub Action. Important:", - "- Git push and PR creation are handled AUTOMATICALLY by the opencode infrastructure after your response", + "- Git push and PR creation are handled AUTOMATICALLY by the altimate-code infrastructure after your response", "- Do NOT include warnings or disclaimers about GitHub tokens, workflow permissions, or PR creation capabilities", "- Do NOT suggest manual steps for creating PRs or pushing code - this happens automatically", "- Focus only on the code changes and your analysis/response", @@ -1589,7 +1589,7 @@ query($owner: String!, $repo: String!, $number: Int!) { return [ "", "You are running as a GitHub Action. Important:", - "- Git push and PR creation are handled AUTOMATICALLY by the opencode infrastructure after your response", + "- Git push and PR creation are handled AUTOMATICALLY by the altimate-code infrastructure after your response", "- Do NOT include warnings or disclaimers about GitHub tokens, workflow permissions, or PR creation capabilities", "- Do NOT suggest manual steps for creating PRs or pushing code - this happens automatically", "- Focus only on the code changes and your analysis/response", diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx index 85db959df4..9d94bddc3e 100644 --- a/packages/opencode/src/cli/cmd/tui/app.tsx +++ b/packages/opencode/src/cli/cmd/tui/app.tsx @@ -35,6 +35,8 @@ import { TuiEvent } from "./event" import { KVProvider, useKV } from "./context/kv" import { Provider } from "@/provider/provider" import { ArgsProvider, useArgs, type Args } from "./context/args" +import { TuiConfigProvider } from "@tui/context/tui-config" +import type { TuiConfig } from "@/config/tui" import open from "open" import { writeHeapSnapshot } from "v8" import { PromptRefProvider, usePromptRef } from "./context/prompt" @@ -108,6 +110,7 @@ export function tui(input: { fetch?: typeof fetch headers?: RequestInit["headers"] events?: EventSource + tuiConfig?: TuiConfig.Info onExit?: () => Promise }) { // promise to prevent immediate exit @@ -116,6 +119,7 @@ export function tui(input: { win32DisableProcessedInput() const mode = await getTerminalBackgroundColor() + const tuiConfig = input.tuiConfig ?? {} // Re-clear after getTerminalBackgroundColor() — setRawMode(false) restores // the original console mode which re-enables ENABLE_PROCESSED_INPUT. @@ -146,9 +150,10 @@ export function tui(input: { events={input.events} > - - - + + + + @@ -164,7 +169,8 @@ export function tui(input: { - + + diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx index 3b6b5ef218..5b59acbd3c 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx @@ -79,7 +79,7 @@ export function DialogStatus() { {(val) => val().error} Disabled in configuration - Needs authentication (run: opencode mcp auth {key}) + Needs authentication (run: altimate mcp auth {key}) {(val) => (val() as { error: string }).error} diff --git a/packages/opencode/src/cli/cmd/tui/component/logo.tsx b/packages/opencode/src/cli/cmd/tui/component/logo.tsx index 8e6208b140..cde2a16463 100644 --- a/packages/opencode/src/cli/cmd/tui/component/logo.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/logo.tsx @@ -75,8 +75,8 @@ export function Logo() { {(line, index) => ( - {renderLine(line, theme.textMuted, false)} - {renderLine(logo.right[index()], theme.text, true)} + {renderLine(line, theme.primary, false)} + {renderLine(logo.right[index()], theme.accent, true)} )} diff --git a/packages/opencode/src/cli/cmd/tui/component/tips.tsx b/packages/opencode/src/cli/cmd/tui/component/tips.tsx index 73d82248ad..422600c634 100644 --- a/packages/opencode/src/cli/cmd/tui/component/tips.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/tips.tsx @@ -54,7 +54,7 @@ const TIPS = [ "Press {highlight}Tab{/highlight} to cycle between Build and Plan agents", "Use {highlight}/undo{/highlight} to revert the last message and file changes", "Use {highlight}/redo{/highlight} to restore previously undone messages and file changes", - "Run {highlight}/share{/highlight} to create a public link to your conversation at opencode.ai", + "Run {highlight}/share{/highlight} to create a public link to your conversation at altimate-code.dev", "Drag and drop images into the terminal to add them as context", "Press {highlight}Ctrl+V{/highlight} to paste images from your clipboard into the prompt", "Press {highlight}Ctrl+X E{/highlight} or {highlight}/editor{/highlight} to compose messages in your external editor", @@ -80,46 +80,46 @@ const TIPS = [ "Switch to {highlight}Plan{/highlight} agent to get suggestions without making actual changes", "Use {highlight}@agent-name{/highlight} in prompts to invoke specialized subagents", "Press {highlight}Ctrl+X Right/Left{/highlight} to cycle through parent and child sessions", - "Create {highlight}opencode.json{/highlight} for server settings and {highlight}tui.json{/highlight} for TUI settings", - "Place TUI settings in {highlight}~/.config/opencode/tui.json{/highlight} for global config", + "Create {highlight}altimate-code.json{/highlight} in project root for project-specific settings", + "Place settings in {highlight}~/.config/altimate-code/altimate-code.json{/highlight} for global config", "Add {highlight}$schema{/highlight} to your config for autocomplete in your editor", "Configure {highlight}model{/highlight} in config to set your default model", - "Override any keybind in {highlight}tui.json{/highlight} via the {highlight}keybinds{/highlight} section", + "Override any keybind in config via the {highlight}keybinds{/highlight} section", "Set any keybind to {highlight}none{/highlight} to disable it completely", "Configure local or remote MCP servers in the {highlight}mcp{/highlight} config section", - "OpenCode auto-handles OAuth for remote MCP servers requiring auth", - "Add {highlight}.md{/highlight} files to {highlight}.opencode/command/{/highlight} to define reusable custom prompts", + "Altimate CLI auto-handles OAuth for remote MCP servers requiring auth", + "Add {highlight}.md{/highlight} files to {highlight}.altimate-code/command/{/highlight} to define reusable custom prompts", "Use {highlight}$ARGUMENTS{/highlight}, {highlight}$1{/highlight}, {highlight}$2{/highlight} in custom commands for dynamic input", "Use backticks in commands to inject shell output (e.g., {highlight}`git status`{/highlight})", - "Add {highlight}.md{/highlight} files to {highlight}.opencode/agent/{/highlight} for specialized AI personas", + "Add {highlight}.md{/highlight} files to {highlight}.altimate-code/agent/{/highlight} for specialized AI personas", "Configure per-agent permissions for {highlight}edit{/highlight}, {highlight}bash{/highlight}, and {highlight}webfetch{/highlight} tools", 'Use patterns like {highlight}"git *": "allow"{/highlight} for granular bash permissions', 'Set {highlight}"rm -rf *": "deny"{/highlight} to block destructive commands', 'Configure {highlight}"git push": "ask"{/highlight} to require approval before pushing', - "OpenCode auto-formats files using prettier, gofmt, ruff, and more", + "Altimate CLI auto-formats files using prettier, gofmt, ruff, and more", 'Set {highlight}"formatter": false{/highlight} in config to disable all auto-formatting', "Define custom formatter commands with file extensions in config", - "OpenCode uses LSP servers for intelligent code analysis", - "Create {highlight}.ts{/highlight} files in {highlight}.opencode/tools/{/highlight} to define new LLM tools", + "Altimate CLI uses LSP servers for intelligent code analysis", + "Create {highlight}.ts{/highlight} files in {highlight}.altimate-code/tools/{/highlight} to define new LLM tools", "Tool definitions can invoke scripts written in Python, Go, etc", - "Add {highlight}.ts{/highlight} files to {highlight}.opencode/plugin/{/highlight} for event hooks", + "Add {highlight}.ts{/highlight} files to {highlight}.altimate-code/plugin/{/highlight} for event hooks", "Use plugins to send OS notifications when sessions complete", - "Create a plugin to prevent OpenCode from reading sensitive files", - "Use {highlight}opencode run{/highlight} for non-interactive scripting", - "Use {highlight}opencode --continue{/highlight} to resume the last session", - "Use {highlight}opencode run -f file.ts{/highlight} to attach files via CLI", + "Create a plugin to prevent Altimate CLI from reading sensitive files", + "Use {highlight}altimate-code run{/highlight} for non-interactive scripting", + "Use {highlight}altimate-code --continue{/highlight} to resume the last session", + "Use {highlight}altimate-code run -f file.ts{/highlight} to attach files via CLI", "Use {highlight}--format json{/highlight} for machine-readable output in scripts", - "Run {highlight}opencode serve{/highlight} for headless API access to OpenCode", - "Use {highlight}opencode run --attach{/highlight} to connect to a running server", - "Run {highlight}opencode upgrade{/highlight} to update to the latest version", - "Run {highlight}opencode auth list{/highlight} to see all configured providers", - "Run {highlight}opencode agent create{/highlight} for guided agent creation", - "Use {highlight}/opencode{/highlight} in GitHub issues/PRs to trigger AI actions", - "Run {highlight}opencode github install{/highlight} to set up the GitHub workflow", - "Comment {highlight}/opencode fix this{/highlight} on issues to auto-create PRs", + "Run {highlight}altimate-code serve{/highlight} for headless API access to Altimate CLI", + "Use {highlight}altimate-code run --attach{/highlight} to connect to a running server", + "Run {highlight}altimate-code upgrade{/highlight} to update to the latest version", + "Run {highlight}altimate-code auth list{/highlight} to see all configured providers", + "Run {highlight}altimate-code agent create{/highlight} for guided agent creation", + "Use {highlight}/altimate-code{/highlight} in GitHub issues/PRs to trigger AI actions", + "Run {highlight}altimate-code github install{/highlight} to set up the GitHub workflow", + "Comment {highlight}/altimate-code fix this{/highlight} on issues to auto-create PRs", "Comment {highlight}/oc{/highlight} on PR code lines for targeted code reviews", 'Use {highlight}"theme": "system"{/highlight} to match your terminal\'s colors', - "Create JSON theme files in {highlight}.opencode/themes/{/highlight} directory", + "Create JSON theme files in {highlight}.altimate-code/themes/{/highlight} directory", "Themes support dark/light variants for both modes", "Reference ANSI colors 0-255 in custom themes", "Use {highlight}{env:VAR_NAME}{/highlight} syntax to reference environment variables in config", @@ -135,15 +135,15 @@ const TIPS = [ "Run {highlight}/unshare{/highlight} to remove a session from public access", "Permission {highlight}doom_loop{/highlight} prevents infinite tool call loops", "Permission {highlight}external_directory{/highlight} protects files outside project", - "Run {highlight}opencode debug config{/highlight} to troubleshoot configuration", + "Run {highlight}altimate-code debug config{/highlight} to troubleshoot configuration", "Use {highlight}--print-logs{/highlight} flag to see detailed logs in stderr", "Press {highlight}Ctrl+X G{/highlight} or {highlight}/timeline{/highlight} to jump to specific messages", "Press {highlight}Ctrl+X H{/highlight} to toggle code block visibility in messages", "Press {highlight}Ctrl+X S{/highlight} or {highlight}/status{/highlight} to see system status info", - "Enable {highlight}scroll_acceleration{/highlight} in {highlight}tui.json{/highlight} for smooth macOS-style scrolling", + "Enable {highlight}tui.scroll_acceleration{/highlight} for smooth macOS-style scrolling", "Toggle username display in chat via command palette ({highlight}Ctrl+P{/highlight})", - "Run {highlight}docker run -it --rm ghcr.io/anomalyco/opencode{/highlight} for containerized use", - "Use {highlight}/connect{/highlight} with OpenCode Zen for curated, tested models", + "Run {highlight}docker run -it --rm ghcr.io/altimate/altimate-code{/highlight} for containerized use", + "Use {highlight}/connect{/highlight} with Altimate CLI Zen for curated, tested models", "Commit your project's {highlight}AGENTS.md{/highlight} file to Git for team sharing", "Use {highlight}/review{/highlight} to review uncommitted changes, branches, or PRs", "Run {highlight}/help{/highlight} or {highlight}Ctrl+X H{/highlight} to show the help dialog", diff --git a/packages/opencode/src/cli/cmd/tui/context/theme.tsx b/packages/opencode/src/cli/cmd/tui/context/theme.tsx index 2320c08ccc..2a607d07ba 100644 --- a/packages/opencode/src/cli/cmd/tui/context/theme.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/theme.tsx @@ -24,6 +24,7 @@ import nightowl from "./theme/nightowl.json" with { type: "json" } import nord from "./theme/nord.json" with { type: "json" } import osakaJade from "./theme/osaka-jade.json" with { type: "json" } import onedark from "./theme/one-dark.json" with { type: "json" } +import altimateCode from "./theme/altimate-code.json" with { type: "json" } import opencode from "./theme/opencode.json" with { type: "json" } import orng from "./theme/orng.json" with { type: "json" } import lucentOrng from "./theme/lucent-orng.json" with { type: "json" } @@ -160,6 +161,7 @@ export const DEFAULT_THEMES: Record = { nord, ["one-dark"]: onedark, ["osaka-jade"]: osakaJade, + ["altimate-code"]: altimateCode, opencode, orng, ["lucent-orng"]: lucentOrng, @@ -285,7 +287,7 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({ const [store, setStore] = createStore({ themes: DEFAULT_THEMES, mode: kv.get("theme_mode", props.mode), - active: (config.theme ?? kv.get("theme", "opencode")) as string, + active: (config.theme ?? kv.get("theme", "altimate-code")) as string, ready: false, }) @@ -305,7 +307,7 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({ ) }) .catch(() => { - setStore("active", "opencode") + setStore("active", "altimate-code") }) .finally(() => { if (store.active !== "system") { @@ -328,7 +330,7 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({ if (store.active === "system") { setStore( produce((draft) => { - draft.active = "opencode" + draft.active = "altimate-code" draft.ready = true }), ) @@ -353,7 +355,7 @@ export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({ }) const values = createMemo(() => { - return resolveTheme(store.themes[store.active] ?? store.themes.opencode, store.mode) + return resolveTheme(store.themes[store.active] ?? store.themes["altimate-code"], store.mode) }) const syntax = createMemo(() => generateSyntax(values())) @@ -397,7 +399,7 @@ async function getCustomThemes() { Global.Path.config, ...(await Array.fromAsync( Filesystem.up({ - targets: [".opencode"], + targets: [".altimate-code"], start: process.cwd(), }), )), diff --git a/packages/opencode/src/cli/cmd/tui/context/theme/altimate-code.json b/packages/opencode/src/cli/cmd/tui/context/theme/altimate-code.json new file mode 100644 index 0000000000..8f585a4509 --- /dev/null +++ b/packages/opencode/src/cli/cmd/tui/context/theme/altimate-code.json @@ -0,0 +1,245 @@ +{ + "$schema": "https://opencode.ai/theme.json", + "defs": { + "darkStep1": "#0a0a0a", + "darkStep2": "#141414", + "darkStep3": "#1e1e1e", + "darkStep4": "#282828", + "darkStep5": "#323232", + "darkStep6": "#3c3c3c", + "darkStep7": "#484848", + "darkStep8": "#606060", + "darkStep9": "#fab283", + "darkStep10": "#ffc09f", + "darkStep11": "#808080", + "darkStep12": "#eeeeee", + "darkSecondary": "#5c9cf5", + "darkAccent": "#9d7cd8", + "darkRed": "#e06c75", + "darkOrange": "#f5a742", + "darkGreen": "#7fd88f", + "darkCyan": "#56b6c2", + "darkYellow": "#e5c07b", + "lightStep1": "#ffffff", + "lightStep2": "#fafafa", + "lightStep3": "#f5f5f5", + "lightStep4": "#ebebeb", + "lightStep5": "#e1e1e1", + "lightStep6": "#d4d4d4", + "lightStep7": "#b8b8b8", + "lightStep8": "#a0a0a0", + "lightStep9": "#3b7dd8", + "lightStep10": "#2968c3", + "lightStep11": "#8a8a8a", + "lightStep12": "#1a1a1a", + "lightSecondary": "#7b5bb6", + "lightAccent": "#d68c27", + "lightRed": "#d1383d", + "lightOrange": "#d68c27", + "lightGreen": "#3d9a57", + "lightCyan": "#318795", + "lightYellow": "#b0851f" + }, + "theme": { + "primary": { + "dark": "darkStep9", + "light": "lightStep9" + }, + "secondary": { + "dark": "darkSecondary", + "light": "lightSecondary" + }, + "accent": { + "dark": "darkAccent", + "light": "lightAccent" + }, + "error": { + "dark": "darkRed", + "light": "lightRed" + }, + "warning": { + "dark": "darkOrange", + "light": "lightOrange" + }, + "success": { + "dark": "darkGreen", + "light": "lightGreen" + }, + "info": { + "dark": "darkCyan", + "light": "lightCyan" + }, + "text": { + "dark": "darkStep12", + "light": "lightStep12" + }, + "textMuted": { + "dark": "darkStep11", + "light": "lightStep11" + }, + "background": { + "dark": "darkStep1", + "light": "lightStep1" + }, + "backgroundPanel": { + "dark": "darkStep2", + "light": "lightStep2" + }, + "backgroundElement": { + "dark": "darkStep3", + "light": "lightStep3" + }, + "border": { + "dark": "darkStep7", + "light": "lightStep7" + }, + "borderActive": { + "dark": "darkStep8", + "light": "lightStep8" + }, + "borderSubtle": { + "dark": "darkStep6", + "light": "lightStep6" + }, + "diffAdded": { + "dark": "#4fd6be", + "light": "#1e725c" + }, + "diffRemoved": { + "dark": "#c53b53", + "light": "#c53b53" + }, + "diffContext": { + "dark": "#828bb8", + "light": "#7086b5" + }, + "diffHunkHeader": { + "dark": "#828bb8", + "light": "#7086b5" + }, + "diffHighlightAdded": { + "dark": "#b8db87", + "light": "#4db380" + }, + "diffHighlightRemoved": { + "dark": "#e26a75", + "light": "#f52a65" + }, + "diffAddedBg": { + "dark": "#20303b", + "light": "#d5e5d5" + }, + "diffRemovedBg": { + "dark": "#37222c", + "light": "#f7d8db" + }, + "diffContextBg": { + "dark": "darkStep2", + "light": "lightStep2" + }, + "diffLineNumber": { + "dark": "darkStep3", + "light": "lightStep3" + }, + "diffAddedLineNumberBg": { + "dark": "#1b2b34", + "light": "#c5d5c5" + }, + "diffRemovedLineNumberBg": { + "dark": "#2d1f26", + "light": "#e7c8cb" + }, + "markdownText": { + "dark": "darkStep12", + "light": "lightStep12" + }, + "markdownHeading": { + "dark": "darkAccent", + "light": "lightAccent" + }, + "markdownLink": { + "dark": "darkStep9", + "light": "lightStep9" + }, + "markdownLinkText": { + "dark": "darkCyan", + "light": "lightCyan" + }, + "markdownCode": { + "dark": "darkGreen", + "light": "lightGreen" + }, + "markdownBlockQuote": { + "dark": "darkYellow", + "light": "lightYellow" + }, + "markdownEmph": { + "dark": "darkYellow", + "light": "lightYellow" + }, + "markdownStrong": { + "dark": "darkOrange", + "light": "lightOrange" + }, + "markdownHorizontalRule": { + "dark": "darkStep11", + "light": "lightStep11" + }, + "markdownListItem": { + "dark": "darkStep9", + "light": "lightStep9" + }, + "markdownListEnumeration": { + "dark": "darkCyan", + "light": "lightCyan" + }, + "markdownImage": { + "dark": "darkStep9", + "light": "lightStep9" + }, + "markdownImageText": { + "dark": "darkCyan", + "light": "lightCyan" + }, + "markdownCodeBlock": { + "dark": "darkStep12", + "light": "lightStep12" + }, + "syntaxComment": { + "dark": "darkStep11", + "light": "lightStep11" + }, + "syntaxKeyword": { + "dark": "darkAccent", + "light": "lightAccent" + }, + "syntaxFunction": { + "dark": "darkStep9", + "light": "lightStep9" + }, + "syntaxVariable": { + "dark": "darkRed", + "light": "lightRed" + }, + "syntaxString": { + "dark": "darkGreen", + "light": "lightGreen" + }, + "syntaxNumber": { + "dark": "darkOrange", + "light": "lightOrange" + }, + "syntaxType": { + "dark": "darkYellow", + "light": "lightYellow" + }, + "syntaxOperator": { + "dark": "darkCyan", + "light": "lightCyan" + }, + "syntaxPunctuation": { + "dark": "darkStep12", + "light": "lightStep12" + } + } +} diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index d3a4ff81e0..c49850df9c 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -247,7 +247,7 @@ export function Session() { `${logo[3] ?? ""}`, ``, ` ${weak("Session")}${UI.Style.TEXT_NORMAL_BOLD}${title}${UI.Style.TEXT_NORMAL}`, - ` ${weak("Continue")}${UI.Style.TEXT_NORMAL_BOLD}opencode -s ${session()?.id}${UI.Style.TEXT_NORMAL}`, + ` ${weak("Continue")}${UI.Style.TEXT_NORMAL_BOLD}altimate -s ${session()?.id}${UI.Style.TEXT_NORMAL}`, ``, ].join("\n"), ) diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx index a50cd96fc8..bfb3eda6ed 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx @@ -157,11 +157,11 @@ export function PermissionPrompt(props: { request: PermissionRequest }) { body={ - + - This will allow the following patterns until OpenCode is restarted + This will allow the following patterns until Altimate CLI is restarted {(pattern) => ( @@ -501,7 +501,7 @@ function RejectPrompt(props: { onConfirm: (message: string) => void; onCancel: ( Reject permission - Tell OpenCode what to do differently + Tell Altimate CLI what to do differently - OpenCode includes free models so you can start immediately. + Altimate CLI includes free models so you can start immediately. Connect from 75+ providers to use other models, including Claude, GPT, Gemini etc diff --git a/packages/opencode/src/cli/cmd/tui/thread.ts b/packages/opencode/src/cli/cmd/tui/thread.ts index 2a8741e3e6..4d767ca5b5 100644 --- a/packages/opencode/src/cli/cmd/tui/thread.ts +++ b/packages/opencode/src/cli/cmd/tui/thread.ts @@ -161,10 +161,13 @@ export const TuiThreadCommand = cmd({ events = createEventSource(client) } + const tuiConfig = await client.call("tuiConfig", undefined) + const tuiPromise = tui({ url, fetch: customFetch, events, + tuiConfig, args: { continue: args.continue, sessionID: args.session, diff --git a/packages/opencode/src/cli/cmd/tui/worker.ts b/packages/opencode/src/cli/cmd/tui/worker.ts index 590dafcdcd..78ca34b0cc 100644 --- a/packages/opencode/src/cli/cmd/tui/worker.ts +++ b/packages/opencode/src/cli/cmd/tui/worker.ts @@ -135,6 +135,10 @@ export const rpc = { }, }) }, + async tuiConfig() { + const response = await Server.App().fetch(new Request("http://altimate-code.internal/config/tui")) + return response.json() + }, async reload() { Config.global.reset() await Instance.disposeAll() diff --git a/packages/opencode/src/cli/logo.ts b/packages/opencode/src/cli/logo.ts index 44fb93c15b..6b6333b9b4 100644 --- a/packages/opencode/src/cli/logo.ts +++ b/packages/opencode/src/cli/logo.ts @@ -1,6 +1,16 @@ export const logo = { - left: [" ", "█▀▀█ █▀▀█ █▀▀█ █▀▀▄", "█__█ █__█ █^^^ █__█", "▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀~~▀"], - right: [" ▄ ", "█▀▀▀ █▀▀█ █▀▀█ █▀▀█", "█___ █__█ █__█ █^^^", "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀"], + left: [ + " ", + "█▀▀█ █ ████ ██ █▄ ▄█ █▀▀█ ████ █▀▀▀", + "█^^█ █___ _██_ ██ █_^_█ █^^█ _██_ █^^^", + "▀ ▀ ▀▀▀▀ ~▀▀~ ▀▀ ▀~~~▀ ▀ ▀ ~▀▀~ ▀▀▀▀", + ], + right: [ + " ", + "█▀▀▀ █▀▀█ █▀▀█ █▀▀▀", + "█___ █__█ █__█ █^^^", + "▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀", + ], } export const marks = "_^~" diff --git a/packages/opencode/src/server/routes/config.ts b/packages/opencode/src/server/routes/config.ts index 85d28f6aa6..6ee589824d 100644 --- a/packages/opencode/src/server/routes/config.ts +++ b/packages/opencode/src/server/routes/config.ts @@ -2,6 +2,7 @@ import { Hono } from "hono" import { describeRoute, validator, resolver } from "hono-openapi" import z from "zod" import { Config } from "../../config/config" +import { TuiConfig } from "../../config/tui" import { Provider } from "../../provider/provider" import { mapValues } from "remeda" import { errors } from "../error" @@ -58,6 +59,27 @@ export const ConfigRoutes = lazy(() => return c.json(config) }, ) + .get( + "/tui", + describeRoute({ + summary: "Get TUI configuration", + description: "Retrieve the TUI-specific configuration (theme, keybinds, etc).", + operationId: "config.tui", + responses: { + 200: { + description: "TUI config", + content: { + "application/json": { + schema: resolver(TuiConfig.Info), + }, + }, + }, + }, + }), + async (c) => { + return c.json(await TuiConfig.get()) + }, + ) .get( "/providers", describeRoute({