diff --git a/packages/opencode/src/cli/cmd/run/footer.prompt.tsx b/packages/opencode/src/cli/cmd/run/footer.prompt.tsx index c3f9918acc..7d0c4488fe 100644 --- a/packages/opencode/src/cli/cmd/run/footer.prompt.tsx +++ b/packages/opencode/src/cli/cmd/run/footer.prompt.tsx @@ -34,10 +34,10 @@ const AUTOCOMPLETE_ROWS = FOOTER_MENU_ROWS const AUTOCOMPLETE_BOTTOM_ROWS = 1 export const TEXTAREA_MIN_ROWS = 1 -export const TEXTAREA_MAX_ROWS = 6 +const TEXTAREA_MAX_ROWS = 6 export const PROMPT_MAX_ROWS = TEXTAREA_MAX_ROWS + AUTOCOMPLETE_ROWS - 1 + AUTOCOMPLETE_BOTTOM_ROWS -export const HINT_BREAKPOINTS = { +const HINT_BREAKPOINTS = { send: 50, newline: 66, history: 80, diff --git a/packages/opencode/src/cli/cmd/run/footer.view.tsx b/packages/opencode/src/cli/cmd/run/footer.view.tsx index affc664b15..59567f9736 100644 --- a/packages/opencode/src/cli/cmd/run/footer.view.tsx +++ b/packages/opencode/src/cli/cmd/run/footer.view.tsx @@ -96,8 +96,6 @@ type RunFooterViewProps = { onSubagentSelect?: (sessionID: string | undefined) => void } -export { TEXTAREA_MIN_ROWS, TEXTAREA_MAX_ROWS } from "./footer.prompt" - export function RunFooterView(props: RunFooterViewProps) { const term = useTerminalDimensions() const active = createMemo(() => props.view?.() ?? { type: "prompt" }) diff --git a/packages/opencode/src/cli/cmd/run/scrollback.writer.tsx b/packages/opencode/src/cli/cmd/run/scrollback.writer.tsx index 94c136415d..23cefb17fa 100644 --- a/packages/opencode/src/cli/cmd/run/scrollback.writer.tsx +++ b/packages/opencode/src/cli/cmd/run/scrollback.writer.tsx @@ -27,7 +27,7 @@ function todoColor(theme: RunTheme, status: string) { return status === "in_progress" ? theme.footer.warning : theme.block.muted } -export function entryGroupKey(commit: StreamCommit): string | undefined { +function entryGroupKey(commit: StreamCommit): string | undefined { if (!commit.partID) { return undefined } @@ -49,7 +49,7 @@ export function sameEntryGroup(left: StreamCommit | undefined, right: StreamComm return Boolean(current && next && current === next) } -export function entryLayout(commit: StreamCommit, body: RunEntryBody = entryBody(commit)): EntryLayout { +function entryLayout(commit: StreamCommit, body: RunEntryBody = entryBody(commit)): EntryLayout { if (commit.kind === "tool") { if (body.type === "structured" || body.type === "markdown") { return "block" 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 ebc65a45b7..4d4c138ec3 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx @@ -5,8 +5,6 @@ import { useDialog } from "@tui/ui/dialog" import { useSync } from "@tui/context/sync" import { For, Match, Switch, Show, createMemo } from "solid-js" -export type DialogStatusProps = {} - export function DialogStatus() { const sync = useSync() const { theme } = useTheme() diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-workspace-create.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-workspace-create.tsx index b22930bc6c..1fcc9975a3 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-workspace-create.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-workspace-create.tsx @@ -49,7 +49,7 @@ export function recentConnectedWorkspacesThe user has changed the current working directory to "${dir}". This is still the same project but at a possibly new location; take this into account when working with any files from now on.` } @@ -169,7 +169,7 @@ export async function confirmWorkspaceFileChanges(input: { return fileChangeChoice === "yes" } -export function DialogWorkspaceSelect(props: { +function DialogWorkspaceSelect(props: { adapters?: Adapter[] onSelect: (selection: WorkspaceSelection) => Promise | void }) { diff --git a/packages/opencode/src/cli/cmd/tui/component/logo.tsx b/packages/opencode/src/cli/cmd/tui/component/logo.tsx index 557b868774..8259e6da56 100644 --- a/packages/opencode/src/cli/cmd/tui/component/logo.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/logo.tsx @@ -878,8 +878,3 @@ export function Logo(props: { shape?: LogoShape; ink?: RGBA; idle?: boolean } = ) } -export function GoLogo() { - const { theme } = useTheme() - const base = tint(theme.background, theme.text, 0.62) - return -} diff --git a/packages/opencode/src/cli/cmd/tui/context/local.tsx b/packages/opencode/src/cli/cmd/tui/context/local.tsx index c4bab95842..986a43efba 100644 --- a/packages/opencode/src/cli/cmd/tui/context/local.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/local.tsx @@ -15,7 +15,7 @@ import { useSDK } from "./sdk" import { RGBA } from "@opentui/core" import { Filesystem } from "@/util/filesystem" -export function parseModel(model: string) { +function parseModel(model: string) { const [providerID, ...rest] = model.split("/") return { providerID: providerID, diff --git a/packages/opencode/src/cli/cmd/tui/context/route.tsx b/packages/opencode/src/cli/cmd/tui/context/route.tsx index 35be17801b..a4edade204 100644 --- a/packages/opencode/src/cli/cmd/tui/context/route.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/route.tsx @@ -2,18 +2,18 @@ import { createStore, reconcile } from "solid-js/store" import { createSimpleContext } from "./helper" import type { PromptInfo } from "../component/prompt/history" -export type HomeRoute = { +type HomeRoute = { type: "home" prompt?: PromptInfo } -export type SessionRoute = { +type SessionRoute = { type: "session" sessionID: string prompt?: PromptInfo } -export type PluginRoute = { +type PluginRoute = { type: "plugin" id: string data?: Record @@ -44,8 +44,6 @@ export const { use: useRoute, provider: RouteProvider } = createSimpleContext({ }, }) -export type RouteContext = ReturnType - export function useRouteData(type: T) { const route = useRoute() return route.data as Extract diff --git a/packages/opencode/src/cli/cmd/tui/context/theme.tsx b/packages/opencode/src/cli/cmd/tui/context/theme.tsx index 3829f4488c..2ce9490a32 100644 --- a/packages/opencode/src/cli/cmd/tui/context/theme.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/theme.tsx @@ -518,7 +518,7 @@ export function tint(base: RGBA, overlay: RGBA, alpha: number): RGBA { return RGBA.fromInts(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)) } -export function generateSystem(colors: TerminalColors, mode: "dark" | "light"): ThemeJson { +function generateSystem(colors: TerminalColors, mode: "dark" | "light"): ThemeJson { const bg = RGBA.fromHex(colors.defaultBackground ?? colors.palette[0]!) const fg = RGBA.fromHex(colors.defaultForeground ?? colors.palette[7]!) const transparent = RGBA.fromValues(bg.r, bg.g, bg.b, 0) diff --git a/packages/opencode/src/cli/cmd/tui/feature-plugins/system/diff-viewer-file-tree.tsx b/packages/opencode/src/cli/cmd/tui/feature-plugins/system/diff-viewer-file-tree.tsx index e55ef7aa7b..e55ecac941 100644 --- a/packages/opencode/src/cli/cmd/tui/feature-plugins/system/diff-viewer-file-tree.tsx +++ b/packages/opencode/src/cli/cmd/tui/feature-plugins/system/diff-viewer-file-tree.tsx @@ -7,7 +7,7 @@ import { buildFileTree, flattenFileTree, type FileTreeItem } from "./diff-viewer const FILE_TREE_WIDTH = 32 const FILE_TREE_HORIZONTAL_PADDING = 2 -export type DiffViewerFileTreeTheme = { +type DiffViewerFileTreeTheme = { readonly background: ColorInput readonly backgroundPanel: ColorInput readonly backgroundElement: ColorInput diff --git a/packages/opencode/src/cli/cmd/tui/keymap.tsx b/packages/opencode/src/cli/cmd/tui/keymap.tsx index d8489fd2f7..b3b2bcd417 100644 --- a/packages/opencode/src/cli/cmd/tui/keymap.tsx +++ b/packages/opencode/src/cli/cmd/tui/keymap.tsx @@ -11,7 +11,7 @@ import type { TuiConfig } from "./config/tui" import { useTuiConfig } from "./context/tui-config" import { TuiKeybind } from "./config/keybind" -export const LEADER_TOKEN = "leader" +const LEADER_TOKEN = "leader" export const OPENCODE_BASE_MODE = "base" export const COMMAND_PALETTE_COMMAND = "command.palette.show" @@ -38,7 +38,7 @@ function isVisiblePaletteCommand(command: Command) { return command.hidden !== true && command.name !== COMMAND_PALETTE_COMMAND } -export function createOpencodeModeStack(keymap: OpenTuiKeymap) { +function createOpencodeModeStack(keymap: OpenTuiKeymap) { keymap.setData(OPENCODE_MODE_KEY, OPENCODE_BASE_MODE) const offFields = keymap.registerLayerFields({ diff --git a/packages/opencode/src/cli/cmd/tui/plugin/slots.tsx b/packages/opencode/src/cli/cmd/tui/plugin/slots.tsx index 085f6994bf..22ba68d46c 100644 --- a/packages/opencode/src/cli/cmd/tui/plugin/slots.tsx +++ b/packages/opencode/src/cli/cmd/tui/plugin/slots.tsx @@ -5,7 +5,7 @@ import { isRecord } from "@/util/record" type RuntimeSlotMap = TuiSlotMap> type Slot = (props: TuiSlotProps) => JSX.Element | null -export type HostSlotPlugin = {}> = SolidPlugin, TuiSlotContext> +type HostSlotPlugin = {}> = SolidPlugin, TuiSlotContext> export type HostPluginApi = TuiPluginApi export type HostSlots = { diff --git a/packages/opencode/src/cli/cmd/tui/ui/dialog-confirm.tsx b/packages/opencode/src/cli/cmd/tui/ui/dialog-confirm.tsx index 823ba13a89..21950f8fd4 100644 --- a/packages/opencode/src/cli/cmd/tui/ui/dialog-confirm.tsx +++ b/packages/opencode/src/cli/cmd/tui/ui/dialog-confirm.tsx @@ -14,7 +14,7 @@ export type DialogConfirmProps = { label?: string } -export type DialogConfirmResult = boolean | undefined +type DialogConfirmResult = boolean | undefined export function DialogConfirm(props: DialogConfirmProps) { const dialog = useDialog() diff --git a/packages/opencode/src/cli/cmd/tui/ui/toast.tsx b/packages/opencode/src/cli/cmd/tui/ui/toast.tsx index d15fb39205..a1e1a0b373 100644 --- a/packages/opencode/src/cli/cmd/tui/ui/toast.tsx +++ b/packages/opencode/src/cli/cmd/tui/ui/toast.tsx @@ -8,7 +8,7 @@ import { Schema } from "effect" import { TuiEvent } from "../event" type ToastInput = Schema.Codec.Encoded -export type ToastOptions = Schema.Schema.Type +type ToastOptions = Schema.Schema.Type const decodeToastOptions = Schema.decodeUnknownSync(TuiEvent.ToastShow.properties) @@ -84,7 +84,7 @@ function init() { return toast } -export type ToastContext = ReturnType +type ToastContext = ReturnType const ctx = createContext() diff --git a/packages/opencode/test/cli/cmd/tui/sync-fixture.tsx b/packages/opencode/test/cli/cmd/tui/sync-fixture.tsx index 5f51374c16..db9bf379b3 100644 --- a/packages/opencode/test/cli/cmd/tui/sync-fixture.tsx +++ b/packages/opencode/test/cli/cmd/tui/sync-fixture.tsx @@ -9,7 +9,7 @@ import { SDKProvider, type EventSource } from "../../../../src/cli/cmd/tui/conte import { SyncProvider, useSync } from "../../../../src/cli/cmd/tui/context/sync" import type { GlobalEvent } from "@opencode-ai/sdk/v2" -export const worktree = "/tmp/opencode" +const worktree = "/tmp/opencode" export const directory = `${worktree}/packages/opencode` export async function wait(fn: () => boolean, timeout = 2000) { @@ -27,11 +27,7 @@ export function json(data: unknown, init?: ResponseInit) { }) } -export function eventSource(): EventSource { - return { subscribe: async () => () => {} } -} - -export function createEventSource() { +function createEventSource() { let fn: ((event: GlobalEvent) => void) | undefined return { @@ -52,7 +48,7 @@ export function createEventSource() { type FetchHandler = (url: URL) => Response | Promise | undefined -export function createFetch(override?: FetchHandler) { +function createFetch(override?: FetchHandler) { const session = [] as URL[] const fetch = (async (input: RequestInfo | URL) => { const url = new URL(input instanceof Request ? input.url : String(input)) diff --git a/packages/opencode/test/fixture/tui-runtime.ts b/packages/opencode/test/fixture/tui-runtime.ts index 75fc2fdc44..b447f6d7f3 100644 --- a/packages/opencode/test/fixture/tui-runtime.ts +++ b/packages/opencode/test/fixture/tui-runtime.ts @@ -11,7 +11,7 @@ type ResolvedInput = Omit = {}): TuiConfig.Resolved["keybinds"] { +function createTuiResolvedKeybinds(input: Partial = {}): TuiConfig.Resolved["keybinds"] { const keybinds = TuiKeybind.Keybinds.parse(input) return createBindingLookup(TuiKeybind.toBindingConfig(keybinds), { commandMap: TuiKeybind.CommandMap, diff --git a/packages/opencode/test/lib/cli-process.ts b/packages/opencode/test/lib/cli-process.ts index e260242fd3..d0fe447d18 100644 --- a/packages/opencode/test/lib/cli-process.ts +++ b/packages/opencode/test/lib/cli-process.ts @@ -31,7 +31,7 @@ import { it } from "./effect" const opencodeRoot = path.resolve(import.meta.dir, "../../") const cliEntry = path.join(opencodeRoot, "src/index.ts") -export const testModelID = "test/test-model" +const testModelID = "test/test-model" // Wrap a Bun subprocess pipe (or any ReadableStream) as a Stream. // Centralizes the `evaluate` + `onError` boilerplate and tags errors with the @@ -177,7 +177,7 @@ export type CliFixture = { // up the tmpdir on scope exit. TestLLMServer.layer is provided internally so // the caller doesn't need to wire it up — the fixture's lifetime is tied to // the surrounding Scope. -export function withCliFixture( +function withCliFixture( fn: (input: CliFixture) => Effect.Effect, ): Effect.Effect { return Effect.gen(function* () { diff --git a/packages/opencode/test/lib/llm-server.ts b/packages/opencode/test/lib/llm-server.ts index 1f873a9fbb..a8420d395f 100644 --- a/packages/opencode/test/lib/llm-server.ts +++ b/packages/opencode/test/lib/llm-server.ts @@ -449,7 +449,7 @@ function fail(item: HttpError) { }) } -export class Reply { +class Reply { #head: unknown[] = [role()] #tail: unknown[] = [] #usage: Usage | undefined @@ -557,7 +557,7 @@ export function reply() { return new Reply() } -export function httpError(status: number, body: unknown): Item { +function httpError(status: number, body: unknown): Item { return { type: "http-error", status, diff --git a/packages/opencode/test/lib/snapshot.ts b/packages/opencode/test/lib/snapshot.ts index 64fa31eb8e..bb5653cc25 100644 --- a/packages/opencode/test/lib/snapshot.ts +++ b/packages/opencode/test/lib/snapshot.ts @@ -21,25 +21,16 @@ const REAL_TMP = fs.realpathSync(TMP) * snapshots captured on macOS/Linux contain LF, so a Windows run without * this step always diffs. */ -export function stripCrlf(text: string): string { +function stripCrlf(text: string): string { return text.replaceAll("\r\n", "\n") } -/** - * Converts Windows-style `\` separators to POSIX `/` so paths render - * identically across OSes. Use for path strings you want stable in a - * snapshot, not for filesystem operations. - */ -export function toPosixPath(p: string): string { - return p.replaceAll("\\", "/") -} - /** * Strips both the OS-level `os.tmpdir()` and its realpath form (macOS * `/var/folders` → `/private/var/folders`) from text, replacing each * occurrence with `marker` (default ``). */ -export function withTmpdirStripped(text: string, marker = ""): string { +function withTmpdirStripped(text: string, marker = ""): string { return text.replaceAll(REAL_TMP, marker).replaceAll(TMP, marker) } diff --git a/packages/opencode/test/server/httpapi-exercise/dsl.ts b/packages/opencode/test/server/httpapi-exercise/dsl.ts index 60d41576f0..b80b101691 100644 --- a/packages/opencode/test/server/httpapi-exercise/dsl.ts +++ b/packages/opencode/test/server/httpapi-exercise/dsl.ts @@ -11,7 +11,6 @@ import type { RequestSpec, ScenarioContext, SeededContext, - TodoScenario, } from "./types" class ScenarioBuilder { @@ -186,14 +185,6 @@ export const http = { ticketBypass: routes("ticket-bypass"), } -export const pending = (method: Method, path: string, name: string, reason: string): TodoScenario => ({ - kind: "todo", - method, - path, - name, - reason, -}) - export function route(template: string, params: Record) { return Object.entries(params).reduce( (next, [key, value]) => next.replaceAll(`{${key}}`, value).replaceAll(`:${key}`, value), diff --git a/packages/opencode/test/server/httpapi-exercise/routing.ts b/packages/opencode/test/server/httpapi-exercise/routing.ts index 9e432af2e3..83bef0aab7 100644 --- a/packages/opencode/test/server/httpapi-exercise/routing.ts +++ b/packages/opencode/test/server/httpapi-exercise/routing.ts @@ -55,7 +55,7 @@ export function parseOptions(args: string[]): Options { } } -export function matches(options: Options, scenario: Scenario) { +function matches(options: Options, scenario: Scenario) { if (!options.include) return true return ( scenario.name.includes(options.include) || diff --git a/packages/opencode/test/server/httpapi-exercise/types.ts b/packages/opencode/test/server/httpapi-exercise/types.ts index e1fe93ba7e..a1d327c872 100644 --- a/packages/opencode/test/server/httpapi-exercise/types.ts +++ b/packages/opencode/test/server/httpapi-exercise/types.ts @@ -6,7 +6,7 @@ import type { MessageV2 } from "../../../src/session/message-v2" import type { SessionID } from "../../../src/session/schema" export const OpenApiMethods = ["get", "post", "put", "delete", "patch"] as const -export const Methods = ["GET", "POST", "PUT", "DELETE", "PATCH"] as const +const Methods = ["GET", "POST", "PUT", "DELETE", "PATCH"] as const export type Method = (typeof Methods)[number] export type OpenApiMethod = (typeof OpenApiMethods)[number]