MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / bootRealStack

Function bootRealStack

apps/local/src/db/v1-v2-boot-drive.test.ts:102–137  ·  view source on GitHub ↗
(dbPath: string)

Source from the content-addressed store, hash-verified

100// ---------------------------------------------------------------------------
101
102const 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. */

Callers 1

Calls 7

createSqliteFumaDbFunction · 0.90
runSqliteDataMigrationsFunction · 0.90
createExecutorFunction · 0.90
collectTablesFunction · 0.85
fileSecretsPluginFunction · 0.85
closeMethod · 0.65

Tested by

no test coverage detected