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

+18 -5
View File
@@ -52,10 +52,23 @@ async function createGameProject() {
return projectPath;
}
function createContext(projectPath: string) {
return {
codingProjectStore: {
getActiveProject: async () => ({ id: 'project-1', path: projectPath }),
},
codingProducts: {
projects: {
getConfig: async () => ({ config: { initialized: true } }),
},
},
} as never;
}
describe('game asset review host route', () => {
it('projects the Agent submission and persists approval across a later invocation', async () => {
const projectPath = await createGameProject();
const ctx = { opencodeProjectStore: { getActiveProject: async () => ({ path: projectPath }) } } as never;
const ctx = createContext(projectPath);
const candidateIds = encodeURIComponent(JSON.stringify(['hero', 'jump']));
const initialResponse = createResponse();
@@ -80,7 +93,7 @@ describe('game asset review host route', () => {
it('accepts all card decisions in one atomic batch', async () => {
const projectPath = await createGameProject();
const ctx = { opencodeProjectStore: { getActiveProject: async () => ({ path: projectPath }) } } as never;
const ctx = createContext(projectPath);
const response = createResponse();
await handleFileRoutes(createRequest('POST', {
@@ -113,7 +126,7 @@ describe('game asset review host route', () => {
| 主角 | Kenney | CC0 |
| 音效 | Kenney | CC0 |
`);
const ctx = { opencodeProjectStore: { getActiveProject: async () => ({ path: projectPath }) } } as never;
const ctx = createContext(projectPath);
const response = createResponse();
await handleFileRoutes(createRequest('GET'), response.res, new URL('http://127.0.0.1/api/files/game-asset-review?invocationId=legacy-review&candidateIds=%5B%5D'), ctx);
@@ -133,7 +146,7 @@ describe('game asset review host route', () => {
| --- | --- | --- |
| 主角 | Kenney | CC0 |
`);
const ctx = { opencodeProjectStore: { getActiveProject: async () => ({ path: projectPath }) } } as never;
const ctx = createContext(projectPath);
const response = createResponse();
await handleFileRoutes(createRequest('GET'), response.res, new URL('http://127.0.0.1/api/files/game-asset-review?invocationId=legacy-unmatched&candidateIds=%5B%22hero%22%5D'), ctx);
@@ -153,7 +166,7 @@ describe('game asset review host route', () => {
| C-001 | Flappy Bird Style Sprites | 小鸟+管子 | 待审核 | A |
| C-006 | Kenney Impact Sounds | 音效 | 待审核 | A/B/C |
`);
const ctx = { opencodeProjectStore: { getActiveProject: async () => ({ path: projectPath }) } } as never;
const ctx = createContext(projectPath);
const response = createResponse();
await handleFileRoutes(createRequest('GET'), response.res, new URL('http://127.0.0.1/api/files/game-asset-review?invocationId=actual-plan&candidateIds=%5B%5D'), ctx);