(dbPath: string)
| 100 | // --------------------------------------------------------------------------- |
| 101 | |
| 102 | const bootRealStack = async (dbPath: string) => { |
| 103 | const migration = await migrateLocalV1ToV2IfNeeded({ |
| 104 | sqlitePath: dbPath, |
| 105 | tables: collectTables(), |
| 106 | namespace: "executor_local", |
| 107 | tenantId: TENANT, |
| 108 | }); |
| 109 | const sqlite = await createSqliteFumaDb({ |
| 110 | tables: collectTables(), |
| 111 | namespace: "executor_local", |
| 112 | path: dbPath, |
| 113 | }); |
| 114 | await Effect.runPromise(runSqliteDataMigrations(sqlite.client, localDataMigrations)); |
| 115 | const executor = await Effect.runPromise( |
| 116 | createExecutor({ |
| 117 | tenant: Tenant.make(TENANT), |
| 118 | subject: Subject.make("local"), |
| 119 | db: sqlite.db, |
| 120 | plugins: [ |
| 121 | openApiPlugin({ httpClientLayer: FetchHttpClient.layer }), |
| 122 | fileSecretsPlugin({ directory: join(workDir, "secrets") }), |
| 123 | memoryCredentialsPlugin(), |
| 124 | ] as const, |
| 125 | onElicitation: "accept-all", |
| 126 | }), |
| 127 | ); |
| 128 | return { |
| 129 | migration, |
| 130 | executor, |
| 131 | client: sqlite.client, |
| 132 | dispose: async () => { |
| 133 | await Effect.runPromise(Effect.ignore(executor.close())); |
| 134 | await sqlite.close(); |
| 135 | }, |
| 136 | }; |
| 137 | }; |
| 138 | |
| 139 | /** Seed a REAL v1-final database via the frozen legacy chain, with an mcp |
| 140 | * source the migration must carry over. */ |
no test coverage detected