@sema-agent/core
Version:
Stateless, task-oriented AI agent core
17 lines (16 loc) • 941 B
TypeScript
import type { MemoryBackend, PatchReport } from "./types.js";
export interface MigrateScopeReport {
/** Entries moved to the new scope (CAS-clean). */
moved: number;
/** Entries that hit a CAS conflict (concurrently edited during migration) — re-run to retry. */
conflicts: PatchReport["conflicts"];
/** Whether the consolidation cursor was carried over (only when the old scope had one). */
cursorMoved: boolean;
}
/**
* Move EVERY entry from `fromScope` to `toScope` on one backend (id-preserving, rev-recomputed via
* the cross-scope move contract), then carry the consolidation cursor. NOT transactional across
* entries (the contract's per-patch independence): a conflict leaves that entry in place — the
* report says so and a re-run picks it up. Refuses same-key no-ops.
*/
export declare function migrateScope(backend: MemoryBackend, fromScope: string, toScope: string): Promise<MigrateScopeReport>;