From ef93b31a74946fafac7eb01b07abaca224119ae6 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Mon, 24 Nov 2025 22:55:36 -0800 Subject: [PATCH] Export Transaction type for atomic multi-operation support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Transaction type alias to both internal/beads and public beads packages. This allows extensions like VC to use RunInTransaction() with the proper Transaction interface type for atomic issue creation. bd-m73k 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- beads.go | 4 ++++ internal/beads/beads.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/beads.go b/beads.go index de463cb6..27833e92 100644 --- a/beads.go +++ b/beads.go @@ -17,6 +17,10 @@ import ( // Storage is the interface for beads storage operations type Storage = beads.Storage +// Transaction provides atomic multi-operation support within a database transaction. +// Use Storage.RunInTransaction() to obtain a Transaction instance. +type Transaction = beads.Transaction + // NewSQLiteStorage creates a new SQLite storage instance at the given path func NewSQLiteStorage(ctx context.Context, dbPath string) (Storage, error) { return beads.NewSQLiteStorage(ctx, dbPath) diff --git a/internal/beads/beads.go b/internal/beads/beads.go index 24541e06..4f9b8d7b 100644 --- a/internal/beads/beads.go +++ b/internal/beads/beads.go @@ -112,6 +112,10 @@ const ( // Storage provides the minimal interface for extension orchestration type Storage = storage.Storage +// Transaction provides atomic multi-operation support within a database transaction. +// Use Storage.RunInTransaction() to obtain a Transaction instance. +type Transaction = storage.Transaction + // NewSQLiteStorage opens a bd SQLite database for programmatic access. // Most extensions should use this to query ready work and update issue status. func NewSQLiteStorage(ctx context.Context, dbPath string) (Storage, error) {