Dashboard › opencode › Distillation
924e4a2e-5ec3-4314-abda-5017b59cb08a["lore_tm_v1_aJdqWmQ93Ire-V11kMu7Ge3xzgAmuhyaQwpfHtD64fU","lore_tm_v1_g_QF-Nw6m6GI06G8tlqt4n3G4jIt-0_7dKi_cZz9k8s","lore_tm_v1_cXHoJcfQ7OPovUxgTdAS-zlXO9kiDyic2mJsmi0VgQ0","lore_tm_v1_C8SQ7nDr8uBBlzO0cY_S3wVkJNiKS5AfOazF9DZa3vM","lore_tm_v1_IBRbGQngi0MuG7R6BVID4GegYF7iRRHqnUjUkZIMij4","lore_tm_v1_Gm9LIueEqoEfKxOxdWmPuYR6Ay0TSPxA7C5eaneaWVY","lore_tm_v1_IoSobYGZ21EOmWmWTwNJIHpUjUKgrO3y4woW5CfqFyw","lore_tm_v1_1N8YEWnNkymqo5TWMGQICPV3OuO6OZAZraFP9KpI-k8","lore_tm_v1_osYiT67m1q9DmWCSIvW47L9ph1bpavR5M23km8xpmZE","lore_tm_v1_EbZGZ6hxH7gGlcGePTOVEie1SdxrIBnltr8df-jinhA","lore_tm_v1_4tvqkRhQuSBWoFuMx4h5_zGy-nhJEhi2XEIoplsJM7U","lore_tm_v1_nnF1-1dhd9zclNuu11VNvOvN1aftuKoS9kf-Kc7rV30","lore_tm_v1_wxLFbG13HdDz4ktjQKTcfDdyIg_80pVwLRFBBk5W5Hg","lore_tm_v1_Fg79i16OJfkTs4cT644mT_5WNjBCRvNyyKENIMhj7nU"]
Date: Sep 14, 2026
<platform> with the applicable platform, with examples darwin-arm64 and linux-x64, when running ./packages/opencode/dist/opencode-<platform>/bin/opencode; source is /home/byk/Code/opencode/CONTRIBUTING.md:56-70.repo-setup skill was unavailable, so it read repository guidance directly while retaining read-only scope./home/byk/Code/opencode/packages/core/package.json:8-13: script "db": "bun drizzle-kit" and script "migration": "bun run script/migration.ts"; Core requires Bun tooling and uses drizzle-kit.sqliteTable(...) declarations in /home/byk/Code/opencode/packages/core/src/session/sql.ts: SessionTable at :22-66, MessageTable at :68-80, PartTable at :82-98, TodoTable at :100-117, SessionMessageTable at :119-138, SessionInputTable at :140-166, and SessionContextEpochTable at :168-176. Tables use typed text()/integer() fields, foreign-key .references(...), Timestamps, and index declarations in the third sqliteTable argument where needed.schema: ["./src/**/*.sql.ts", "./src/**/sql.ts"] with dialect: "sqlite" in /home/byk/Code/opencode/packages/core/drizzle.config.ts:1-10; therefore a Core table is added in a matching sql.ts or *.sql.ts source file./home/byk/Code/opencode/packages/core/script/migration.ts:10-21 defines migration artifacts and CLI options: baseline snapshot packages/core/schema.json, generated migration directory packages/core/src/database/migration, registry packages/core/src/database/migration.gen.ts, schema packages/core/src/database/schema.gen.ts, and flags --check plus --name./home/byk/Code/opencode/packages/core/script/migration.ts:28-61 copies packages/core/schema.json into a temporary incremental baseline, invokes Drizzle, requires at most one generated migration, writes it as packages/core/src/database/migration/<name>.ts, updates packages/core/schema.json, regenerates packages/core/src/database/schema.gen.ts, and regenerates packages/core/src/database/migration.gen.ts.bun drizzle-kit generate --config ${config} ${name ? ["--name", name] : []}, run with cwd packages/core, at /home/byk/Code/opencode/packages/core/script/migration.ts:94-106. Repository stale-artifact errors prescribe bun script/migration.ts from packages/core at :64-88; the package-level entry point is bun run migration from packages/core, with optional script argument --name.DatabaseMigration.Migration, with id and up(tx) calling tx.run(...), in /home/byk/Code/opencode/packages/core/script/migration.ts:127-173; generated migration modules are dynamically imported into the registry by renderRegistry(...) at :187-195./home/byk/Code/opencode/packages/server/src/routes.ts:26-37: add the Core node to the module-level const applicationServices = LayerNode.group([...]). Current members are Database.node, EventV2.node, httpClient, ToolOutputStore.cleanupNode, SessionV2.node, PermissionSaved.node, PtyTicket.node, Credential.node, PtyEnvironment.node, and LocationServiceMap.node.makeRoutes(...) using AppNodeBuilder.build(applicationServices, [[SessionExecution.node, SessionExecutionLocal.node]]) at /home/byk/Code/opencode/packages/server/src/routes.ts:51-62, then provides the resulting serviceLayer to the HTTP API layer./home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/server.ts: module-level const app = LayerNode.group([...]) begins at :212; createRoutes(...) begins at :271; V2 route composition supplies AppNodeBuilderV1.build(SessionV2.node, [..., [SessionExecution.node, SessionExecutionLocal.node], ...]) at :298-303, supplies locationServiceMapV2 at :304, and supplies the process-global application graph with AppNodeBuilderV1.build(app) at :306.OpenApi.fromApi is deferred until /doc is requested so processes that never serve it, including CLI processes and scripts, do not pay its cost at module load; source is /home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/server.ts:183-184.