Dashboard › opencode › Distillation
b32cb0ed-afd9-433a-b97f-a744997654bb["lore_tm_v1_quY30Y1xcOBV0dkkbqQGD9-TCOiJh7eire1i-myx2-c","lore_tm_v1_s79hDjpy8oWSLvMwSLenYg_IYoJFsoaEpYSAKzv-YPI"]
Date: Sep 16, 2026
packages/sdk/openapi.json:26283-26343 defines SyncEventSessionNextStepRecovered as a "sync" event whose nested syncEvent.type is "session.next.step.recovered.1"; outer required fields are type, id, and syncEvent, with outer id matching ^evt_; nested required fields are type, id, seq, aggregateID, and data, with nested id matching ^evt_.SyncEventSessionNextStepRecovered.syncEvent.data contains timestamp: number, sessionID: string matching ^ses, executionID: string, optional assistantMessageID: string matching ^msg_, and phase restricted to "ready", "unknown", or "continue"; required data fields are timestamp, sessionID, executionID, and phase; additionalProperties is false at the data, nested event, and outer event levels.packages/core/src/database/sqlite.node.ts:23-45 defines SqliteClient extending Client.SqlClient with [TypeId], config, loadExtension(path), and updateValues: never; Config supports filename, readonly, create, readwrite, disableWAL, timeout, allowExtension, spanAttributes, transformResultNames, and transformQueryNames; SqliteConnection adds loadExtension(path).packages/core/src/database/sqlite.node.ts:47-87 defines make(options), obtains Sqlite.Native as DatabaseSync, creates a SQLite statement compiler via Statement.makeCompilerSqlite(options.transformQueryNames), optionally transforms result names, and implements run()/runValues() with native.prepare(query), fiber-context Client.SafeIntegers, and statement.all(...); runValues() additionally calls statement.setReturnArrays(true). Execution failures become SqlError values classified with message "Failed to execute statement" and operation "execute".packages/core/src/database/sqlite.node.ts:89-113 creates the SqliteConnection: execute() optionally transforms rows, executeRaw() calls run(), executeValues() calls runValues(), executeUnprepared() delegates to execute(), and executeStream() dies with "executeStream not implemented"; loadExtension(path) calls native.loadExtension(path) and maps failures to SqlError with message "Failed to load extension" and operation "loadExtension".packages/core/src/database/sqlite.node.ts:115-145 serializes access with Semaphore.make(1). The ordinary acquirer uses one permit; transactionAcquirer uses Effect.uninterruptibleMask, takes one permit interruptibly through restore(...), and registers semaphore.release(1) as a scope finalizer. Client.make() receives acquirer, compiler, transactionAcquirer, optional span attributes plus ["db.system.name", "sqlite"], and transformRows; the resulting client exposes its TypeId, original config, and semaphore-acquired loadExtension.packages/core/src/database/sqlite.node.ts:147-162 defines nativeLayer(config), opening new DatabaseSync(config.filename, { readOnly: config.readonly, timeout: config.timeout, allowExtension: config.allowExtension, enableForeignKeyConstraints: true, open: true }), registering native.close() as a finalizer, and executing PRAGMA journal_mode = WAL; unless disableWAL === true or readonly === true.packages/core/src/database/sqlite.node.ts:164-178 defines sqliteLayer for Client.SqlClient, drizzleLayer for Sqlite.Drizzle using the same Sqlite.Native DatabaseSync, and exported layer(config), which merges the native, SQL client, and Drizzle layers, provides the native layer to the dependents, and provides Reactivity.layer.