refactor(server): commit project commands without the V1 engine #13896
Closedjuliusmarmingewants to merge 1 commit into
t3code/codex-turn-mapping fromv2/v2-nuke-v1-engine-1opened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- @@ -469,3 +558,3 @@469558 { concurrency: 1, discard: true },470559 );471560 return yield* dispatch(@@ -714,15 +715,12 @@714715 const projectSettingsFor = Effect.fnUntraced(function* (input: {715716 readonly cwd: string;716717 readonly threadId?: ThreadId | undefined;717718 }) {718719 const settings = yield* serverSettingsService.getSettings;719- if (!hasProjectSettingsOverrides(settings) || Option.isNone(projectionQuery)) return settings;720- const projectId = yield* (720+ if (!hasProjectSettingsOverrides(settings)) return settings;721+ const none = () => Option.none<ProjectId>();722+ const projectId =721723 input.threadId !== undefined722- ? projectionQuery.value723- .getThreadShellById(input.threadId)724- .pipe(Effect.map(Option.map((thread) => thread.projectId)))725- : projectionQuery.value726- .getActiveProjectByWorkspaceRoot(input.cwd)727- .pipe(Effect.map(Option.map((project) => project.id)))728- ).pipe(Effect.orElseSucceed(() => Option.none<ProjectId>()));724+ ? Option.isNone(threadProjections)725+ ? none()726+ : yield* threadProjections.value.getThreadShell(input.threadId).pipe(@@ -288,16 +384,11 @@288384 }),289385 ),290386 );291- yield* assertWorkspaceAvailable(input.projectId, workspaceRoot);292- const now = DateTime.formatIso(yield* DateTime.now);293387 return yield* dispatch(294- input.projectId,388+ input.commandId,295389 {296390 type: "project.create",297- commandId: input.commandId,298391 projectId: input.projectId,299392 title: input.title,300393 workspaceRoot,301- defaultModelSelection: input.defaultModelSelection ?? null,302- scripts: [...(input.scripts ?? [])],303- createdAt: now,394+ scripts: input.scripts ?? [],
- @@ -23,3 +24,5 @@2324 layer as threadCommandExecutorLayer,2425 } from "../orchestration-v2/ThreadCommandExecutor.ts";2526 import { planThreadDeletion } from "../orchestration-v2/ThreadDeletion.ts";27+import { OrchestrationCommandReceiptRepository } from "../persistence/Services/OrchestrationCommandReceipts.ts";28+import { OrchestrationEventStore } from "../persistence/Services/OrchestrationEventStore.ts";@@ -0,0 +29,21 @@29+ repositoryIdentity,30+ defaultModelSelection: row.defaultModelSelection,31+ defaultThreadEnvMode: row.defaultThreadEnvMode,32+ autoPull: row.autoPull,33+ faviconPath: row.faviconPath ?? null,34+ projectIcon: row.projectIcon ?? null,35+ scripts: row.scripts,36+ createdAt: row.createdAt,37+ updatedAt: row.updatedAt,38+ };39+}40+41+/** Active projects in creation order, without enrichment. */42+export const listActiveProjectShells = (projects: ProjectRows) =>43+ projects44+ .listAll()45+ .pipe(46+ Effect.map((rows) =>47+ rows.flatMap((row) => (row.deletedAt === null ? [toProjectShell(row)] : [])),48+ ),49+ );
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed