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:
2026-08-24 12:17:43 +08:00
parent 61fede2b4d
commit 5a275b93a7
199 changed files with 1330 additions and 64725 deletions

View File

@@ -2,7 +2,7 @@ import { createHash } from 'node:crypto';
import { watch, type FSWatcher } from 'node:fs';
import { access, readFile } from 'node:fs/promises';
import { join } from 'node:path';
import type { OpencodeProject, OpencodeProjectStore } from '../opencode/project-store';
import type { CodingProject, CodingProjectStore } from '../coding-projects/project-store';
import { readWorksSubmissionBinding } from './works-submission-binding';
import { WORKS_SQUARE_CONFIG } from '../api/works-config';
import { proxyAwareFetch } from '../utils/proxy-fetch';
@@ -39,7 +39,7 @@ type WatchDirectory = (
onChange: (filename: string | null) => void,
) => ProjectProgressWatcher;
type ProjectProgressProjectStore = Pick<OpencodeProjectStore, 'getActiveProject' | 'subscribe'> & Partial<Pick<OpencodeProjectStore, 'listProjects'>>;
type ProjectProgressProjectStore = Pick<CodingProjectStore, 'getActiveProject' | 'subscribe'> & Partial<Pick<CodingProjectStore, 'listProjects'>>;
export type ProjectProgressSyncOptions = {
apiBaseUrl?: string;
@@ -50,7 +50,7 @@ export type ProjectProgressSyncOptions = {
};
type ProjectProgressState = {
project: OpencodeProject;
project: CodingProject;
watcher: ProjectProgressWatcher | null;
timer: ReturnType<typeof setTimeout> | null;
pendingProgress: boolean;
@@ -137,7 +137,7 @@ async function readProductOverview(projectPath: string): Promise<string> {
}
async function resolveProjectProgressIdentity(
project: OpencodeProject,
project: CodingProject,
): Promise<ProjectProgressIdentity> {
const binding = await readWorksSubmissionBinding(project.path, project.id);
if (binding?.status === 'submitted' && binding.app_id) {
@@ -210,7 +210,7 @@ export function createProjectProgressSync(
}, immediate ? 0 : debounceMs);
}
function attachProject(project: OpencodeProject): void {
function attachProject(project: CodingProject): void {
const previous = states.get(project.id);
if (previous && previous.project.path === project.path) {
previous.project = project;