diff --git a/DIVERGENCES.md b/DIVERGENCES.md index 9058b4d0a5..55069c1c1f 100644 --- a/DIVERGENCES.md +++ b/DIVERGENCES.md @@ -201,6 +201,8 @@ from the squash message first, or use a plain merge. | `packages/app/src/context/platform.tsx` | Added optional `gatewaySso?: GatewaySsoPlatform` capability (wire types in fork-only `src/gateway/types.ts`, exported as `@opencode-ai/app/gateway/types` — see the `packages/app/package.json` row). | Desktop-only SSO login for the configure gate; absence of the capability is the web deployment's kill-switch. | Keep the field + import; take upstream's surrounding platform changes. | | `packages/app/src/components/prompt-input-v2.tsx` | `onUnpaidClick` opens `DialogConnectProvider` (lazy import) instead of the free-models "unpaid" dialogs; their now-unused imports dropped. (The legacy `prompt-input.tsx` carried the same swap until its deletion — see the legacy prompt-input removal row.) | With the hosted providers hidden, "unpaid" means nothing is connected, and the free-models dialogs would render empty lists (this path is reachable on the web deployment; on desktop the gate covers it). | Keep the handler swap; take upstream's surrounding prompt-input changes. | | `packages/desktop/src/renderer/index.tsx` | Calls `installConsoleFormatting()` (fork-only `./console-format`) before anything else logs. | `spyRendererConsole` receives Chromium's flattened console-message string, so any renderer `console.*` with an object argument reached the terminal and the exported debug logs as `[object Object]`; the wrapper serializes structured arguments (Error-aware, circular-safe, truncated) at the source. | Keep the import and call; take upstream's surrounding entry changes. | +| Dead CLI installer: `packages/desktop/src/renderer/cli.ts` (deleted), `packages/desktop/src/preload/{index,types}.ts`, `packages/desktop/src/renderer/i18n/{en,es}.ts` | `cli.ts` deleted; `installCli` dropped from the `ElectronAPI` type and from the preload object; the five strings only it used removed (`desktop.menu.installCli`, `desktop.cli.{installed,failed}.{title,message}`). | The whole surface was unreachable, upstream included. Nothing imports `cli.ts` — not the renderer entry, not the menu — and no `ipcMain.handle("install-cli")` exists in either tree, so the one call it makes (`window.api.installCli()`) could only ever reject with "No handler registered for 'install-cli'". Its menu label had no menu item either: `DESKTOP_MENU` (`packages/app/src/desktop-menu.ts`) has no Install CLI entry, and the strings are dead weight for translators. Checked against anomalyco/opencode@dev: it carries the same three orphans and the same missing handler. | Keep removed. A sync will reintroduce all of it, since upstream still ships the dead copy — delete it again rather than merging it back. If upstream ever lands a real installer (an `install-cli` handler plus a `DESKTOP_MENU` item), take theirs wholesale: this is a deletion of dead code, not a decision that the feature is unwanted. | +| Dead desktop renderer strings: `packages/desktop/src/renderer/i18n/{en,es}.ts` | The remaining unread keys removed with the CLI installer's above: `desktop.menu.{checkForUpdates,reloadWebview,restart}` and all ten `desktop.updater.*`. What is left is the three `desktop.dialog.*` strings. | Both dictionaries feed one `t()` (`renderer/i18n/index.ts`) with exactly one importer, `renderer/index.tsx`, whose five call sites are all literal keys: `error.dev.rootNotFound` (from the app dict) and the three `desktop.dialog.*`. Nothing else can reach them. The menu labels were superseded by `DESKTOP_MENU` (`packages/app/src/desktop-menu.ts`), which carries its own; the updater strings by `main/updater.ts`, which shows those dialogs from the main process — where the renderer's `t()` cannot be called — with hardcoded English. Same story upstream: anomalyco/opencode@dev ships the identical dead dict. | Keep removed; a sync brings the dead copy back, so delete it again. One caveat that is not a reason to keep them: the updater dialogs really are English-only, and these strings are what a translation of them would have started from. Upstream's answer is `packages/app/src/i18n/desktop-native.ts` + `nativeT()` + a `set-native-translations` IPC channel, which feeds the main process translated strings; if that lands in a sync, take it wholesale rather than reviving these keys. | | Desktop gateway SSO wiring: `packages/desktop/src/main/index.ts`, `packages/desktop/src/preload/{index,types}.ts`, `packages/desktop/src/renderer/index.tsx` | Main instantiates the fork-only `src/main/gateway-sso/` controller (wrapping `@codev/gateway` `login`/`silentSso` — node-only loopback OAuth — with `shell.openExternal` and a `net.fetch` wrapper) and registers its `gateway-sso-*` IPC channels next to the sandbox ones, passing an `onConfigured` callback that restarts the running sandboxes (`SandboxController.restartRunning`) because a guest is handed its codev config once at boot and cannot see credentials that appear afterwards; preload exposes the `gatewaySso` namespace (subscribe fan-out, sandbox pattern) with types re-exported from `@opencode-ai/app/gateway/types`; the renderer platform maps `gatewaySso: window.api.gatewaySso`. | SSO login for the desktop configure gate must run in the main process (`node:http` loopback server, `~/.codev/auth.json` writes); `net.fetch` so enterprise proxies/PAC apply (egress precedent). | Keep the wiring; take upstream's surrounding changes. Keep channel names `gateway-sso-*` stable. | | `packages/app/package.json` | Added `"./gateway/types": "./src/gateway/types.ts"` to `exports`. | The desktop preload aliases the app-owned gateway SSO wire types (sandbox/types pattern). | Keep the export; take upstream's other manifest changes. | | `packages/app/src/i18n/{en,es}.ts` | Added the `gateway.configure.*` key family (configure-gate dialog) and reworded `sidebar.gettingStarted.line1` — the "includes free models" pitch no longer holds with the hosted providers hidden. | Strings for the fork's configure gate; the getting-started card must not advertise models the fork does not offer. | Keep our keys and copy; take upstream's surrounding i18n changes. | diff --git a/packages/desktop/src/preload/index.ts b/packages/desktop/src/preload/index.ts index 40d41be1f2..fa0df45d8c 100644 --- a/packages/desktop/src/preload/index.ts +++ b/packages/desktop/src/preload/index.ts @@ -12,7 +12,6 @@ const updaterHandler = (_: unknown, state: UpdaterState) => { const api: ElectronAPI = { killSidecar: () => ipcRenderer.invoke("kill-sidecar"), - installCli: () => ipcRenderer.invoke("install-cli"), awaitInitialization: () => ipcRenderer.invoke("await-initialization"), localServerHealth: () => ipcRenderer.invoke("local-server-health"), wslServers: { diff --git a/packages/desktop/src/preload/types.ts b/packages/desktop/src/preload/types.ts index 7c09afddfd..b04c4b0213 100644 --- a/packages/desktop/src/preload/types.ts +++ b/packages/desktop/src/preload/types.ts @@ -68,7 +68,6 @@ export type FatalRendererError = { export type ElectronAPI = { killSidecar: () => Promise - installCli: () => Promise awaitInitialization: () => Promise // Main-process (Node fetch) reachability of the built-in sidecar; immune to // renderer-side proxy stalls. diff --git a/packages/desktop/src/renderer/cli.ts b/packages/desktop/src/renderer/cli.ts deleted file mode 100644 index 11d3c1f1b0..0000000000 --- a/packages/desktop/src/renderer/cli.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { initI18n, t } from "./i18n" - -export async function installCli(): Promise { - await initI18n() - - try { - const path = await window.api.installCli() - window.alert(t("desktop.cli.installed.message", { path })) - } catch (e) { - window.alert(t("desktop.cli.failed.message", { error: String(e) })) - } -} diff --git a/packages/desktop/src/renderer/i18n/en.ts b/packages/desktop/src/renderer/i18n/en.ts index ce83756cca..8284270b47 100644 --- a/packages/desktop/src/renderer/i18n/en.ts +++ b/packages/desktop/src/renderer/i18n/en.ts @@ -1,27 +1,5 @@ export const dict = { - "desktop.menu.checkForUpdates": "Check for Updates...", - "desktop.menu.installCli": "Install CLI...", - "desktop.menu.reloadWebview": "Reload Webview", - "desktop.menu.restart": "Restart", - "desktop.dialog.chooseFolder": "Choose a folder", "desktop.dialog.chooseFile": "Choose a file", "desktop.dialog.saveFile": "Save file", - - "desktop.updater.checkFailed.title": "Update Check Failed", - "desktop.updater.checkFailed.message": "Failed to check for updates", - "desktop.updater.none.title": "No Update Available", - "desktop.updater.none.message": "You are already using the latest version of CoDev", - "desktop.updater.downloadFailed.title": "Update Failed", - "desktop.updater.downloadFailed.message": "Failed to download update", - "desktop.updater.downloaded.title": "Update Downloaded", - "desktop.updater.downloaded.prompt": - "Version {{version}} of CoDev has been downloaded, would you like to install it and relaunch?", - "desktop.updater.installFailed.title": "Update Failed", - "desktop.updater.installFailed.message": "Failed to install update", - - "desktop.cli.installed.title": "CLI Installed", - "desktop.cli.installed.message": "CLI installed to {{path}}\n\nRestart your terminal to use the 'codev' command.", - "desktop.cli.failed.title": "Installation Failed", - "desktop.cli.failed.message": "Failed to install CLI: {{error}}", } diff --git a/packages/desktop/src/renderer/i18n/es.ts b/packages/desktop/src/renderer/i18n/es.ts index e5614620d1..455521c196 100644 --- a/packages/desktop/src/renderer/i18n/es.ts +++ b/packages/desktop/src/renderer/i18n/es.ts @@ -1,27 +1,5 @@ export const dict = { - "desktop.menu.checkForUpdates": "Buscar actualizaciones...", - "desktop.menu.installCli": "Instalar CLI...", - "desktop.menu.reloadWebview": "Recargar Webview", - "desktop.menu.restart": "Reiniciar", - "desktop.dialog.chooseFolder": "Elegir una carpeta", "desktop.dialog.chooseFile": "Elegir un archivo", "desktop.dialog.saveFile": "Guardar archivo", - - "desktop.updater.checkFailed.title": "Comprobación de actualizaciones fallida", - "desktop.updater.checkFailed.message": "No se pudieron buscar actualizaciones", - "desktop.updater.none.title": "No hay actualizaciones disponibles", - "desktop.updater.none.message": "Ya estás usando la versión más reciente de CoDev", - "desktop.updater.downloadFailed.title": "Actualización fallida", - "desktop.updater.downloadFailed.message": "No se pudo descargar la actualización", - "desktop.updater.downloaded.title": "Actualización descargada", - "desktop.updater.downloaded.prompt": - "Se ha descargado la versión {{version}} de CoDev. ¿Quieres instalarla y reiniciar?", - "desktop.updater.installFailed.title": "Actualización fallida", - "desktop.updater.installFailed.message": "No se pudo instalar la actualización", - - "desktop.cli.installed.title": "CLI instalada", - "desktop.cli.installed.message": "CLI instalada en {{path}}\n\nReinicia tu terminal para usar el comando 'codev'.", - "desktop.cli.failed.title": "Instalación fallida", - "desktop.cli.failed.message": "No se pudo instalar la CLI: {{error}}", }