feat: remove legacy OpenCode runtime

Cut product flows over to Coding/Pi and retain only the migration-owned v1 boundary. Promote supported native optional packages because electron-builder omitted pnpm transitive optional closure from the packaged ASAR.
This commit is contained in:
brother7 committed 2026-08-24 12:17:43 +08:00
1 parent 61fede2b4d
commit 5a275b93a7
199 files changed
+1330 -64725

No files matched your search

+2 -21
View File
@@ -1,9 +1,8 @@
/**
* IPC Handlers
* Registers the renderer channels used by the opencode-first desktop app.
* Registers the renderer channels used by the desktop app.
*/
import { app, BrowserWindow, dialog, ipcMain, shell } from 'electron';
import type { OpencodeManager } from '../opencode/manager';
import { registerHostApiProxyHandlers } from './ipc/host-api-proxy';
import { registerTranscriptExportHandler } from './ipc/transcript-export';
import { applyProxySettings } from './proxy';
@@ -184,7 +183,6 @@ async function handleUnifiedProvider(action: string, payload: unknown): Promise<
async function handleUnifiedRequest(
request: UnifiedRequest,
opencodeManager: OpencodeManager,
): Promise<UnifiedResponse> {
const id = request.id;
const module = request.module || '';
@@ -198,11 +196,6 @@ async function handleUnifiedRequest(
return unsupported(id, module, action);
}
if (module === 'opencode') {
if (action === 'status') return ok(id, opencodeManager.getStatus());
return unsupported(id, module, action);
}
if (module === 'settings') {
if (action === 'getAll') return ok(id, await getAllSettings());
if (action === 'get') {
@@ -241,9 +234,6 @@ async function handleUnifiedRequest(
}
export function registerIpcHandlers(
_legacyRuntimeManager: unknown,
opencodeManager: OpencodeManager,
_legacyMarketplaceService: unknown,
mainWindow: BrowserWindow,
lifecycle?: BackgroundLifecycleController,
hostApiContext?: HostApiContext,
@@ -262,7 +252,7 @@ export function registerIpcHandlers(
rendererWebContents.on('destroyed', releaseRendererLeases);
}
ipcMain.handle('app:request', async (_event, request: UnifiedRequest) => (
handleUnifiedRequest(request, opencodeManager)
handleUnifiedRequest(request)
));
ipcMain.handle('app:version', () => app.getVersion());
@@ -276,15 +266,6 @@ export function registerIpcHandlers(
});
ipcMain.handle('app:performance', () => collectPerformanceSnapshot(lifecycle));
ipcMain.handle('opencode:status', () => opencodeManager.getStatus());
ipcMain.handle('opencode:start', () => opencodeManager.start());
ipcMain.handle('opencode:stop', async () => {
await opencodeManager.stop();
return opencodeManager.getStatus();
});
ipcMain.handle('opencode:restart', () => opencodeManager.restart());
ipcMain.handle('opencode:health', () => opencodeManager.checkHealth());
ipcMain.handle('lifecycle:activity', (_event, activity: DesktopActivity) => {
const nextActivity = activity && typeof activity === 'object'
? activity