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:
@@ -5,7 +5,6 @@ import { extname, join } from 'node:path';
|
||||
import { homedir } from 'node:os';
|
||||
import type { HostApiContext } from '../context';
|
||||
import { parseJsonBody, sendJson } from '../route-utils';
|
||||
import { readProjectConfig } from '../../opencode/project-config';
|
||||
import { loadGameAssetCandidates } from '../../coding-projects/game-asset-browser';
|
||||
import {
|
||||
GameAssetReviewConflictError,
|
||||
@@ -128,13 +127,13 @@ export async function handleFileRoutes(
|
||||
): Promise<boolean> {
|
||||
if (url.pathname === '/api/files/game-asset-candidates' && req.method === 'GET') {
|
||||
try {
|
||||
const activeProject = await ctx.opencodeProjectStore.getActiveProject();
|
||||
const activeProject = await ctx.codingProjectStore.getActiveProject();
|
||||
if (!activeProject) {
|
||||
sendJson(res, 409, { success: false, error: 'No active project selected' });
|
||||
return true;
|
||||
}
|
||||
const config = await readProjectConfig(activeProject.path);
|
||||
if (config.status !== 'valid' || !config.config.initialized) {
|
||||
const config = await ctx.codingProducts?.projects.getConfig(activeProject.id);
|
||||
if (!config?.config.initialized) {
|
||||
sendJson(res, 403, { success: false, error: 'Game asset browsing is unavailable for an uninitialized project' });
|
||||
return true;
|
||||
}
|
||||
@@ -147,13 +146,13 @@ export async function handleFileRoutes(
|
||||
|
||||
if (url.pathname === '/api/files/game-asset-review' && (req.method === 'GET' || req.method === 'POST')) {
|
||||
try {
|
||||
const activeProject = await ctx.opencodeProjectStore.getActiveProject();
|
||||
const activeProject = await ctx.codingProjectStore.getActiveProject();
|
||||
if (!activeProject) {
|
||||
sendJson(res, 409, { success: false, error: 'No active project selected' });
|
||||
return true;
|
||||
}
|
||||
const config = await readProjectConfig(activeProject.path);
|
||||
if (config.status !== 'valid' || !config.config.initialized) {
|
||||
const config = await ctx.codingProducts?.projects.getConfig(activeProject.id);
|
||||
if (!config?.config.initialized) {
|
||||
sendJson(res, 403, { success: false, error: 'Game asset review is unavailable for an uninitialized project' });
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user