feat: import prepared Catalog bindings through authenticated services

This commit is contained in:
Codex
2026-10-06 18:04:07 +02:00
parent d720da721b
commit af4c7b5df9
29 changed files with 835 additions and 35 deletions
+14
View File
@@ -13,6 +13,7 @@ import {
WorkspaceRepositoryLock,
normalizeRepositoryIdentity,
type GitStatus,
type PreparedWorkspaceSource,
} from "./git-repository.js";
import {
parseWorkspaceYaml,
@@ -121,6 +122,19 @@ export class WorkspaceRegistry {
});
}
async prepareInstallation(expected: PreparedWorkspaceSource): Promise<{ revision: string }> {
await this.repository.ensureLayout();
return await this.lock.run(async () => {
const head = await this.repository.verifyPrepared(expected);
const active = await this.tryActiveState();
if (active && active.head !== head) {
throw new WorkspaceRegistryError("workspace_stale", "Reconcile the active workspace revision before installation.");
}
if (!active) await this.activate(head);
return { revision: head };
});
}
async pull(): Promise<GitStatus> {
await this.repository.ensureLayout();
return await this.lock.run(async () => {