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

+19 -19
View File
@@ -421,7 +421,7 @@ describe('works square host api routes', () => {
createRequest('POST', { projectId: 'prj_123' }),
response.res,
new URL('http://127.0.0.1/api/works/assets/tiny-farm/download'),
{ opencodeProjectStore: { listProjects } } as never,
{ codingProjectStore: { listProjects } } as never,
);
const expectedFilePath = join(tempDir, 'assets', 'resource-square', 'tiny-farm.zip');
@@ -1283,7 +1283,7 @@ describe('works square host api routes', () => {
}, headers),
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{ opencodeProjectStore: { listProjects } } as never,
{ codingProjectStore: { listProjects } } as never,
);
expect(handled).toBe(true);
@@ -1332,7 +1332,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact },
worksSubmissionBinding: { recordSubmitted },
} as never,
@@ -1437,7 +1437,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
} as never,
);
@@ -1499,7 +1499,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
} as never,
);
@@ -1556,7 +1556,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
} as never,
);
@@ -1598,7 +1598,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
} as never,
);
@@ -1636,7 +1636,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
} as never,
);
@@ -1677,7 +1677,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
} as never,
);
@@ -1734,7 +1734,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
} as never,
);
@@ -1776,7 +1776,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: {
codingProjectStore: {
listProjects: vi.fn(async () => [{ id: 'project-1', path: tempDir, name: 'space-cleaner' }]),
},
agentBrowser: { preflightStaticArtifact },
@@ -1809,7 +1809,7 @@ describe('works square host api routes', () => {
createRendererRequest('POST', { projectId: 'project-1', project: { app_id: 'space-cleaner', title: 'Space', summary: 'Clean' } }),
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{ opencodeProjectStore: { listProjects: vi.fn(async () => [{ id: 'project-1', path: 'private-project' }]) }, agentBrowser: { preflightStaticArtifact } } as never,
{ codingProjectStore: { listProjects: vi.fn(async () => [{ id: 'project-1', path: 'private-project' }]) }, agentBrowser: { preflightStaticArtifact } } as never,
);
expect(preflightStaticArtifact).not.toHaveBeenCalled();
expect(fetchMock).not.toHaveBeenCalled();
@@ -1843,7 +1843,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
worksSubmissionBinding: {
recordSubmitted: vi.fn(async () => { throw new Error('disk unavailable'); }),
@@ -1892,7 +1892,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
} as never,
);
@@ -1925,7 +1925,7 @@ describe('works square host api routes', () => {
.mockResolvedValueOnce(new Response(uploadPayload, { status: 201 }));
vi.stubGlobal('fetch', fetchMock);
const ctx = {
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
} as never;
@@ -1984,7 +1984,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
} as never,
);
@@ -2026,7 +2026,7 @@ describe('works square host api routes', () => {
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{
opencodeProjectStore: { listProjects: vi.fn(async () => [project]) },
codingProjectStore: { listProjects: vi.fn(async () => [project]) },
agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) },
} as never,
);
@@ -2053,7 +2053,7 @@ describe('works square host api routes', () => {
createRendererRequest('POST', { projectId: 'project-1', project: { app_id: 'space-cleaner', title: 'Space', summary: 'Clean' } }),
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{ opencodeProjectStore: { listProjects: vi.fn(async () => [{ id: 'project-1', path: tempDir }]) }, agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) } } as never,
{ codingProjectStore: { listProjects: vi.fn(async () => [{ id: 'project-1', path: tempDir }]) }, agentBrowser: { preflightStaticArtifact: vi.fn(async () => ({ ok: true })) } } as never,
);
expect(response.json()).toEqual({ success: false, status: 422, code: 'CLIENT_BUILD_PROTOCOL_REQUIRED', error: '请升级 Makelore 并重新提交。' });
expect(JSON.stringify(response.json())).not.toContain('token=secret');
@@ -2072,7 +2072,7 @@ describe('works square host api routes', () => {
}),
response.res,
new URL('http://127.0.0.1/api/works/projects/publish-source'),
{ opencodeProjectStore: { listProjects: vi.fn() } } as never,
{ codingProjectStore: { listProjects: vi.fn() } } as never,
);
expect(response.statusCode).toBe(200);