/** * Non-destructive data migration for the goal tables carved out of * @elizaos/plugin-personal-assistant. * * The two goal tables (`life_goal_definitions`, `life_goal_links`) used to live * in the `app_lifeops` PostgreSQL schema, created by plugin-personal-assistant. * They now live in `app_goals`, created by this plugin's drizzle schema. * Existing installs still hold the owner's goal rows in `app_lifeops`, so on * first boot we copy them across — once, idempotently, and WITHOUT ever touching * the source. * * Existing completion markers and populated owner tables remain authoritative. * Only a fresh import into an empty target is copied and verified; the durable * receipt prevents later owner deletions from replaying stale legacy rows. * * The source table is NEVER dropped or altered. The source and target share the * exact column shape (PA's `app_lifeops` drizzle def and this plugin's * `app_goals` def are column-identical), so the `SELECT s.*` copy is safe. * * Definitions are copied before links so a reader observing mid-copy never sees * a link to a not-yet-copied definition. */ import { type IAgentRuntime, Service } from "@elizaos/core"; import { type CarveOutDatabase } from "@elizaos/plugin-sql"; export declare const GOALS_MIGRATION_LOG_PREFIX = "[Goals]"; export declare const GOALS_MIGRATION_SERVICE_TYPE = "goals_migration"; export declare const MIGRATED_GOAL_TABLES: readonly ["life_goal_definitions", "life_goal_links"]; export type MigratedGoalTable = (typeof MIGRATED_GOAL_TABLES)[number]; export type SqlExecutor = (sql: string) => Promise>>; export interface TableMigrationResult { table: MigratedGoalTable; outcome: "copied" | "source-missing" | "target-non-empty" | "already-migrated"; } export declare function migrateGoalTable(exec: SqlExecutor, table: MigratedGoalTable): Promise; export declare function migrateGoalTables(database: CarveOutDatabase): Promise; /** * Service whose `start()` performs the one-time, guarded, non-destructive copy * of the owner's goal rows from `app_lifeops` into `app_goals`. */ export declare class GoalsMigrationService extends Service { static readonly serviceType = "goals_migration"; capabilityDescription: string; static start(runtime: IAgentRuntime): Promise; private run; stop(): Promise; } //# sourceMappingURL=migration.d.ts.map