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,6 +5,7 @@ import { createCodingConversationStore } from '../coding-projects/conversation-s
|
||||
import { CodingProjectService } from '../coding-projects/project-service';
|
||||
import {
|
||||
createCodingProjectStore,
|
||||
type CodingProjectStore,
|
||||
type CodingProjectStorage,
|
||||
} from '../coding-projects/project-store';
|
||||
import { CodingConversationService } from '../coding-runtime/conversation-service';
|
||||
@@ -31,6 +32,7 @@ import {
|
||||
} from './coding-provider-auth';
|
||||
import { createCodingProductHost, type CodingProductComposition } from './coding-product-services';
|
||||
import { archivePiConversationSession } from '../coding-runtime/pi/resource-loader';
|
||||
import { resolveLegacyProjectModel } from '../coding-projects/legacy-v1';
|
||||
|
||||
export interface CodingCompositionPaths {
|
||||
executablePath: string;
|
||||
@@ -41,6 +43,7 @@ export interface CodingCompositionPaths {
|
||||
|
||||
export interface CreateCodingCompositionOptions {
|
||||
storage: CodingProjectStorage;
|
||||
projectStore?: CodingProjectStore;
|
||||
browser: AgentBrowserModule;
|
||||
paths: CodingCompositionPaths;
|
||||
localProxyCredential?: string;
|
||||
@@ -70,7 +73,7 @@ export function resolveCodingPiRuntimePaths(input: {
|
||||
export function createCodingComposition(
|
||||
options: CreateCodingCompositionOptions,
|
||||
): CodingProductComposition {
|
||||
const projectStore = createCodingProjectStore(options.storage);
|
||||
const projectStore = options.projectStore ?? createCodingProjectStore(options.storage);
|
||||
const attachments = new CodingAttachmentStore(
|
||||
path.join(options.paths.userDataDir, 'coding-runtime', 'attachments'),
|
||||
);
|
||||
@@ -156,6 +159,12 @@ export function createCodingComposition(
|
||||
})),
|
||||
});
|
||||
const projects = new CodingProjectService(projectStore, {
|
||||
migration: {
|
||||
resolveLegacyModel: async ({ legacyModel }) => resolveLegacyProjectModel(
|
||||
legacyModel,
|
||||
await getProviderService().listAccounts(),
|
||||
),
|
||||
},
|
||||
createConversationStore: conversationStoreForProject,
|
||||
onResourcesChanged: async (project) => {
|
||||
runtime.markResourcesStale();
|
||||
@@ -195,6 +204,10 @@ export function createCodingComposition(
|
||||
conversations,
|
||||
runtime,
|
||||
host,
|
||||
async sleep() {
|
||||
const conversationIds = runtime.getDiagnostics().workers.map((worker) => worker.conversationId);
|
||||
await Promise.allSettled(conversationIds.map((conversationId) => runtime.dispose(conversationId)));
|
||||
},
|
||||
async shutdown() {
|
||||
await subagents.close();
|
||||
await runtime.shutdown();
|
||||
|
||||
Reference in New Issue
Block a user