Add Beads library API for Go integration

Expose full Storage interface and all types through public beads.go API,
enabling external Go projects (like VC) to import Beads directly instead
of spawning CLI processes.

Changes:
- Expanded beads.go with all public types (Issue, Dependency, Comment, etc.)
- Added all constants (Status, IssueType, DependencyType, EventType)
- Created comprehensive integration tests (beads_integration_test.go)
- Added library usage example at examples/library-usage/
- Documented library integration in README.md

Test coverage: 96.4% on public API, 14 integration tests, all passing.

Closes bd-58, bd-59

Amp-Thread-ID: https://ampcode.com/threads/T-f0093c79-7422-45e2-b0ed-0ddfebc9ffea
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-10-22 15:49:29 -07:00
parent df36c11fe3
commit 5e7b3aa43a
8 changed files with 1127 additions and 4 deletions
+38 -4
View File
@@ -18,10 +18,21 @@ import (
// Core types for working with issues
type (
Issue = types.Issue
Status = types.Status
IssueType = types.IssueType
WorkFilter = types.WorkFilter
Issue = types.Issue
Status = types.Status
IssueType = types.IssueType
Dependency = types.Dependency
DependencyType = types.DependencyType
Comment = types.Comment
Event = types.Event
EventType = types.EventType
Label = types.Label
BlockedIssue = types.BlockedIssue
TreeNode = types.TreeNode
Statistics = types.Statistics
IssueFilter = types.IssueFilter
WorkFilter = types.WorkFilter
EpicStatus = types.EpicStatus
)
// Status constants
@@ -41,6 +52,29 @@ const (
TypeChore = types.TypeChore
)
// DependencyType constants
const (
DepBlocks = types.DepBlocks
DepRelated = types.DepRelated
DepParentChild = types.DepParentChild
DepDiscoveredFrom = types.DepDiscoveredFrom
)
// EventType constants
const (
EventCreated = types.EventCreated
EventUpdated = types.EventUpdated
EventStatusChanged = types.EventStatusChanged
EventCommented = types.EventCommented
EventClosed = types.EventClosed
EventReopened = types.EventReopened
EventDependencyAdded = types.EventDependencyAdded
EventDependencyRemoved = types.EventDependencyRemoved
EventLabelAdded = types.EventLabelAdded
EventLabelRemoved = types.EventLabelRemoved
EventCompacted = types.EventCompacted
)
// Storage provides the minimal interface for extension orchestration
type Storage = storage.Storage