export

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Overview

Package export provides data export functionality for bv.

This file implements Cloudflare wrangler CLI integration for deploying static sites to Cloudflare Pages. It follows safety-first principles: no auto-install without confirmation, clear prompts for authentication.

Package export provides data export functionality for bv.

This file implements GitHub CLI integration for deploying static sites to GitHub Pages. It follows safety-first principles: no auto-install, confirmation prompts for destructive operations.

Package export provides data export functionality for bv.

This file implements a local preview server for static site bundles. It serves files with no-cache headers and auto-opens the browser.

Package export provides SQLite-based data export for static viewer deployment.

This file implements the SQLiteExporter which exports bv's issue data to a SQLite database optimized for client-side querying with sql.js WASM.

Package export provides data export functionality for bv.

This file implements SQLite schema creation for static export, following mcp_agent_mail's architecture for client-side sql.js querying.

Package export provides data export functionality for bv.

This file defines the SQLite export data structures following mcp_agent_mail's proven architecture for client-side sql.js WASM querying.

Package export provides viewer asset embedding for static site generation.

Package export provides data export functionality for bv.

This file implements the interactive deployment wizard for --pages flag. It guides users through exporting and deploying static sites to GitHub Pages.

Index

Constants

View Source
const DefaultPreviewPort = 9000

DefaultPreviewPort is the default port for the preview server.

View Source
const PreviewPortRangeEnd = 9100
View Source
const PreviewPortRangeStart = 9000

PreviewPortRange defines the range of ports to try if default is unavailable.

View Source
const SchemaVersion = 1

Schema version for tracking migrations

Variables

View Source
var ViewerAssetsFS embed.FS

ViewerAssetsFS embeds the viewer_assets directory for static site export. This allows the bv binary to include all necessary HTML/JS/CSS assets without requiring them to exist on the filesystem.

Functions

func AttemptGHInstall added in v0.10.3

func AttemptGHInstall() error

AttemptGHInstall attempts to install gh CLI via Homebrew (macOS only). Returns an error if not on macOS or if installation fails.

func AttemptWranglerInstall added in v0.10.3

func AttemptWranglerInstall() error

AttemptWranglerInstall attempts to install wrangler via npm.

func AuthenticateGH added in v0.10.3

func AuthenticateGH() error

AuthenticateGH starts the interactive gh authentication flow.

func AuthenticateWrangler added in v0.10.3

func AuthenticateWrangler() error

AuthenticateWrangler starts the interactive wrangler authentication flow.

func CopyEmbeddedAssets added in v0.11.2

func CopyEmbeddedAssets(outputDir, title string) error

CopyEmbeddedAssets copies all embedded viewer assets to the specified output directory. If title is provided, it replaces "Beads Viewer" in index.html.

func CreateFTSIndex added in v0.10.3

func CreateFTSIndex(db *sql.DB) error

CreateFTSIndex creates the FTS5 full-text search virtual table. This must be called after issues are inserted.

func CreateMaterializedViews added in v0.10.3

func CreateMaterializedViews(db *sql.DB) error

CreateMaterializedViews creates denormalized views for fast queries. This must be called after all data is inserted.

func CreateRepository added in v0.10.3

func CreateRepository(name string, private bool, description string) (string, error)

CreateRepository creates a new GitHub repository.

func CreateSchema added in v0.10.3

func CreateSchema(db *sql.DB) error

CreateSchema creates all tables, indexes, and triggers in the database.

func DeleteCloudflareProject added in v0.10.3

func DeleteCloudflareProject(projectName string, confirm bool) error

DeleteCloudflareProject deletes a Cloudflare Pages project.

func DeleteRepository added in v0.10.3

func DeleteRepository(repoFullName string, confirm bool) error

DeleteRepository deletes a repository (requires confirmation).

func EnableGitHubPages added in v0.10.3

func EnableGitHubPages(repoFullName string) (string, error)

EnableGitHubPages enables GitHub Pages for a repository.

func FindAvailablePort added in v0.10.3

func FindAvailablePort(start, end int) (int, error)

FindAvailablePort finds an available port in the given range.

func GenerateHeadersFile added in v0.10.3

func GenerateHeadersFile(bundlePath string) error

GenerateHeadersFile creates a _headers file for Cloudflare Pages. This provides security headers without needing a service worker.

func GenerateInteractiveGraphFilename added in v0.10.3

func GenerateInteractiveGraphFilename(projectName string) string

GenerateInteractiveGraphFilename creates an auto-generated filename Format: {project}_graph_export__as_of__YYYY_MM_DD__HH_MM__git_head_hash__{gitshort}.html

func GenerateInteractiveGraphHTML added in v0.10.3

func GenerateInteractiveGraphHTML(opts InteractiveGraphOptions) (string, error)

GenerateInteractiveGraphHTML creates a self-contained HTML file with force-graph visualization

func GenerateMarkdown

func GenerateMarkdown(issues []model.Issue, title string) (string, error)

GenerateMarkdown creates a comprehensive markdown report of all issues

func GenerateMermaidGraph added in v0.10.3

func GenerateMermaidGraph(issues []model.Issue, issueIDs map[string]bool, config MermaidConfig) string

GenerateMermaidGraph generates a Mermaid diagram for the given issues.

func GeneratePriorityBrief added in v0.10.3

func GeneratePriorityBrief(triage interface{}, config PriorityBriefConfig) string

GeneratePriorityBrief creates a compact Markdown priority brief from triage data (bv-96) This is designed for human readability and can be rendered to PNG

func GeneratePriorityBriefFromTriageJSON added in v0.10.3

func GeneratePriorityBriefFromTriageJSON(triageJSON []byte, config PriorityBriefConfig) (string, error)

GeneratePriorityBriefFromTriage creates a priority brief from a TriageResult (bv-96) This is the production version that takes proper triage data

func HasEmbeddedAssets added in v0.11.2

func HasEmbeddedAssets() bool

HasEmbeddedAssets returns true if viewer assets are embedded in the binary.

func InitAndPush added in v0.10.3

func InitAndPush(bundlePath string, repoFullName string, forceOverwrite bool) error

InitAndPush initializes a git repository and pushes to GitHub.

func InsertMetaValue added in v0.10.3

func InsertMetaValue(db *sql.DB, key, value string) error

InsertMetaValue inserts or updates a metadata key-value pair.

func ListCloudflareProjects added in v0.10.3

func ListCloudflareProjects() ([]string, error)

ListCloudflareProjects lists existing Cloudflare Pages projects.

func ListUserRepos added in v0.10.3

func ListUserRepos(limit int) ([]string, error)

ListUserRepos lists repositories for the authenticated user.

func OpenCloudflareInBrowser added in v0.10.3

func OpenCloudflareInBrowser(projectName string) error

OpenCloudflareInBrowser opens the Cloudflare Pages dashboard in browser. Set BV_NO_BROWSER=1 to suppress browser opening (useful for tests).

func OpenInBrowser added in v0.10.3

func OpenInBrowser(url string) error

OpenInBrowser opens a URL in the default browser. Set BV_NO_BROWSER=1 to suppress browser opening (useful for tests).

func OptimizeDatabase added in v0.10.3

func OptimizeDatabase(db *sql.DB, pageSize int) error

OptimizeDatabase runs optimizations for httpvfs streaming. Call this as the final step before closing the database.

func RepoExists added in v0.10.3

func RepoExists(name string) bool

RepoExists checks if a repository exists.

func RepoHasContent added in v0.10.3

func RepoHasContent(repoFullName string) (bool, error)

RepoHasContent checks if a repository has any content.

func SaveGraphSnapshot added in v0.10.3

func SaveGraphSnapshot(opts GraphSnapshotOptions) error

SaveGraphSnapshot renders a static graph snapshot (SVG or PNG) with a minimal summary block. It intentionally keeps the visual language concise so AI agents can parse it without reading auxiliary docs.

func SaveMarkdownToFile

func SaveMarkdownToFile(issues []model.Issue, filename string) error

SaveMarkdownToFile writes the generated markdown to a file

func SaveWizardConfig added in v0.10.3

func SaveWizardConfig(config *WizardConfig) error

SaveWizardConfig saves wizard configuration for future runs.

func ShowInstallInstructions added in v0.10.3

func ShowInstallInstructions()

ShowInstallInstructions prints gh CLI installation instructions.

func ShowWranglerInstallInstructions added in v0.10.3

func ShowWranglerInstallInstructions()

ShowWranglerInstallInstructions prints wrangler CLI installation instructions.

func StartPreview added in v0.10.3

func StartPreview(bundlePath string) error

StartPreview is a convenience function to start a preview server with auto port selection.

func StartPreviewWithConfig added in v0.10.3

func StartPreviewWithConfig(config PreviewConfig) error

StartPreviewWithConfig starts a preview server with the given configuration.

func SuggestProjectName added in v0.10.3

func SuggestProjectName(bundlePath string) string

SuggestProjectName generates a suggested Cloudflare Pages project name.

func SuggestRepoName added in v0.10.3

func SuggestRepoName(bundlePath string) string

SuggestRepoName generates a suggested repository name from the bundle path.

func WizardConfigPath added in v0.10.3

func WizardConfigPath() string

WizardConfigPath returns the path to the wizard config file.

Types

type AdjacencyEdge added in v0.10.3

type AdjacencyEdge struct {
	From string `json:"from"`
	To   string `json:"to"`
	Type string `json:"type"` // "blocks" or "related"
}

AdjacencyEdge represents an edge in the adjacency graph.

type AdjacencyGraph added in v0.10.3

type AdjacencyGraph struct {
	Nodes []AdjacencyNode `json:"nodes"`
	Edges []AdjacencyEdge `json:"edges"`
}

AdjacencyGraph is the JSON adjacency list representation.

type AdjacencyNode added in v0.10.3

type AdjacencyNode struct {
	ID       string   `json:"id"`
	Title    string   `json:"title"`
	Status   string   `json:"status"`
	Priority int      `json:"priority"`
	Labels   []string `json:"labels,omitempty"`
	PageRank float64  `json:"pagerank,omitempty"`
}

AdjacencyNode represents a node in the adjacency graph.

type ChunkConfig added in v0.10.3

type ChunkConfig struct {
	Chunked    bool        `json:"chunked"`
	ChunkCount int         `json:"chunk_count"`
	ChunkSize  int64       `json:"chunk_size"`
	TotalSize  int64       `json:"total_size"`
	Hash       string      `json:"hash,omitempty"`
	Chunks     []ChunkInfo `json:"chunks,omitempty"`
}

ChunkConfig describes how a large database was chunked.

type ChunkInfo added in v0.10.3

type ChunkInfo struct {
	Path string `json:"path"`
	Hash string `json:"hash,omitempty"`
	Size int64  `json:"size,omitempty"`
}

ChunkInfo describes an individual chunk file.

type CloudflareDeployConfig added in v0.10.3

type CloudflareDeployConfig struct {
	// ProjectName is the Cloudflare Pages project name
	ProjectName string

	// BundlePath is the path to the static site bundle to deploy
	BundlePath string

	// Branch is the branch name for deployment (default: main)
	Branch string

	// SkipConfirmation skips interactive confirmation prompts (for CI)
	SkipConfirmation bool
}

CloudflareDeployConfig configures Cloudflare Pages deployment.

type CloudflareDeployResult added in v0.10.3

type CloudflareDeployResult struct {
	// ProjectName is the Cloudflare Pages project name
	ProjectName string

	// URL is the deployment URL (xxx.pages.dev)
	URL string

	// DeploymentID is the unique deployment identifier
	DeploymentID string
}

CloudflareDeployResult contains the result of a deployment.

func DeployToCloudflarePages added in v0.10.3

func DeployToCloudflarePages(config CloudflareDeployConfig) (*CloudflareDeployResult, error)

DeployToCloudflarePages performs a complete deployment to Cloudflare Pages.

type CloudflareStatus added in v0.10.3

type CloudflareStatus struct {
	Installed     bool
	Authenticated bool
	AccountName   string
	AccountID     string
	NPMInstalled  bool
}

CloudflareStatus represents the current status of wrangler CLI.

func CheckWranglerStatus added in v0.10.3

func CheckWranglerStatus() (*CloudflareStatus, error)

CheckWranglerStatus checks the status of wrangler CLI.

type ExportDependency added in v0.10.3

type ExportDependency struct {
	IssueID     string `json:"issue_id"`
	DependsOnID string `json:"depends_on_id"`
	Type        string `json:"type"`
}

ExportDependency represents a dependency relationship for export.

type ExportIssue added in v0.10.3

type ExportIssue struct {
	// Core issue data (embedded)
	ID          string          `json:"id"`
	Title       string          `json:"title"`
	Description string          `json:"description,omitempty"`
	Status      model.Status    `json:"status"`
	Priority    int             `json:"priority"`
	IssueType   model.IssueType `json:"issue_type"`
	Assignee    string          `json:"assignee,omitempty"`
	Labels      []string        `json:"labels,omitempty"`
	CreatedAt   time.Time       `json:"created_at"`
	UpdatedAt   time.Time       `json:"updated_at"`
	ClosedAt    *time.Time      `json:"closed_at,omitempty"`

	// Computed graph metrics
	PageRank       float64  `json:"pagerank"`
	Betweenness    float64  `json:"betweenness,omitempty"`
	CriticalPath   int      `json:"critical_path_depth"`
	TriageScore    float64  `json:"triage_score,omitempty"`
	BlocksCount    int      `json:"blocks_count"`
	BlockedByCount int      `json:"blocked_by_count"`
	BlocksIDs      []string `json:"blocks_ids,omitempty"`
	BlockedByIDs   []string `json:"blocked_by_ids,omitempty"`
}

ExportIssue extends model.Issue with computed graph metrics for export. The client builds search text on load by concatenating fields.

type ExportMeta added in v0.10.3

type ExportMeta struct {
	Version     string    `json:"version"`
	GeneratedAt time.Time `json:"generated_at"`
	GitCommit   string    `json:"git_commit,omitempty"`
	IssueCount  int       `json:"issue_count"`
	DepCount    int       `json:"dependency_count"`
	DataHash    string    `json:"data_hash,omitempty"`
	Title       string    `json:"title,omitempty"`
}

ExportMeta contains metadata about the export.

type ExportMetrics added in v0.10.3

type ExportMetrics struct {
	IssueID        string  `json:"issue_id"`
	PageRank       float64 `json:"pagerank"`
	Betweenness    float64 `json:"betweenness"`
	CriticalPath   int     `json:"critical_path_depth"`
	TriageScore    float64 `json:"triage_score"`
	BlocksCount    int     `json:"blocks_count"`
	BlockedByCount int     `json:"blocked_by_count"`
}

ExportMetrics holds computed metrics for a single issue.

type GitHubDeployConfig added in v0.10.3

type GitHubDeployConfig struct {
	// RepoName is the desired repository name (without owner)
	RepoName string

	// Private indicates whether the repository should be private
	Private bool

	// Description is the repository description
	Description string

	// BundlePath is the path to the static site bundle to deploy
	BundlePath string

	// SkipConfirmation skips interactive confirmation prompts (for CI)
	SkipConfirmation bool

	// ForceOverwrite allows overwriting non-empty repositories
	ForceOverwrite bool
}

GitHubDeployConfig configures GitHub Pages deployment.

type GitHubDeployResult added in v0.10.3

type GitHubDeployResult struct {
	// RepoFullName is the full repository name (owner/repo)
	RepoFullName string

	// PagesURL is the GitHub Pages URL
	PagesURL string

	// GitRemote is the git remote URL
	GitRemote string
}

GitHubDeployResult contains the result of a deployment.

func DeployToGitHubPages added in v0.10.3

func DeployToGitHubPages(config GitHubDeployConfig) (*GitHubDeployResult, error)

DeployToGitHubPages performs a complete deployment to GitHub Pages.

type GitHubPagesStatus added in v0.10.3

type GitHubPagesStatus struct {
	Enabled   bool   `json:"enabled"`
	URL       string `json:"url,omitempty"`
	Branch    string `json:"branch,omitempty"`
	Path      string `json:"path,omitempty"`
	BuildType string `json:"build_type,omitempty"`
}

GetGitHubPagesStatus checks if Pages is enabled and returns the URL.

func CheckGitHubPagesStatus added in v0.10.3

func CheckGitHubPagesStatus(repoFullName string) (*GitHubPagesStatus, error)

CheckGitHubPagesStatus checks the GitHub Pages status for a repository.

type GitHubStatus added in v0.10.3

type GitHubStatus struct {
	Installed     bool
	Authenticated bool
	Username      string
	GitConfigured bool
	GitName       string
	GitEmail      string
}

GitHubStatus represents the current status of gh CLI.

func CheckGHStatus added in v0.10.3

func CheckGHStatus() (*GitHubStatus, error)

CheckGHStatus checks the status of gh CLI and git configuration.

type GraphExplanation added in v0.10.3

type GraphExplanation struct {
	What        string `json:"what"`
	HowToRender string `json:"how_to_render,omitempty"`
	WhenToUse   string `json:"when_to_use"`
}

GraphExplanation provides context for AI agents.

type GraphExportConfig added in v0.10.3

type GraphExportConfig struct {
	Format   GraphExportFormat // Output format (json, dot, mermaid)
	Label    string            // Filter to specific label
	Root     string            // Subgraph from specific root
	Depth    int               // Max depth for subgraph (0 = unlimited)
	DataHash string            // Hash of input data for provenance
}

GraphExportConfig configures graph export behavior.

type GraphExportFormat added in v0.10.3

type GraphExportFormat string

GraphExportFormat specifies the output format for graph export.

const (
	GraphFormatJSON    GraphExportFormat = "json"
	GraphFormatDOT     GraphExportFormat = "dot"
	GraphFormatMermaid GraphExportFormat = "mermaid"
)

type GraphExportResult added in v0.10.3

type GraphExportResult struct {
	Format         string            `json:"format"`
	Graph          string            `json:"graph,omitempty"`
	Nodes          int               `json:"nodes"`
	Edges          int               `json:"edges"`
	FiltersApplied map[string]string `json:"filters_applied,omitempty"`
	Explanation    GraphExplanation  `json:"explanation"`
	DataHash       string            `json:"data_hash,omitempty"`
	Adjacency      *AdjacencyGraph   `json:"adjacency,omitempty"`
}

GraphExportResult contains the exported graph and metadata.

func ExportGraph added in v0.10.3

func ExportGraph(issues []model.Issue, stats *analysis.GraphStats, config GraphExportConfig) (*GraphExportResult, error)

ExportGraph exports the dependency graph in the specified format.

func (*GraphExportResult) JSON added in v0.10.3

func (r *GraphExportResult) JSON() ([]byte, error)

GraphExportResultJSON returns the result as JSON bytes.

type GraphLayout added in v0.10.3

type GraphLayout struct {
	Positions   map[string][2]float64 `json:"positions"`
	Metrics     map[string][5]float64 `json:"metrics"`
	Links       [][2]string           `json:"links"`
	Cycles      [][]string            `json:"cycles,omitempty"`
	Version     string                `json:"version"`
	GeneratedAt string                `json:"generated_at"`
	NodeCount   int                   `json:"node_count"`
	EdgeCount   int                   `json:"edge_count"`
}

GraphLayout is a compact representation of pre-computed graph layout data. This is much smaller than full node data (~30KB vs ~200KB) for fast initial load.

type GraphSnapshotOptions added in v0.10.3

type GraphSnapshotOptions struct {
	Path     string               // Output path; format inferred from extension when Format empty
	Format   string               // "svg" or "png" (case-insensitive). If empty, inferred from Path.
	Title    string               // Optional title rendered in summary block
	Preset   string               // Layout preset: "compact" (default) or "roomy"
	Issues   []model.Issue        // Issues to render (already filtered by recipe/workspace)
	Stats    *analysis.GraphStats // Graph analysis used for layout/summary
	DataHash string               // Hash of input issues for provenance
}

GraphSnapshotOptions controls graph snapshot export behaviour.

type InteractiveGraphOptions added in v0.10.3

type InteractiveGraphOptions struct {
	Issues      []model.Issue
	Stats       *analysis.GraphStats
	Triage      *analysis.TriageResult     // Full triage output for display
	History     *correlation.HistoryReport // Git history correlation data
	Title       string
	DataHash    string
	Path        string // Output path - if empty, auto-generates based on project
	ProjectName string // Project name for auto-naming
}

InteractiveGraphOptions configures HTML graph generation

type MermaidConfig added in v0.10.3

type MermaidConfig struct {
	ShowNoDependenciesNode bool // If true, adds a "No Dependencies" node when no edges exist
}

MermaidConfig configures the Mermaid graph generation.

type PreviewConfig added in v0.10.3

type PreviewConfig struct {
	// BundlePath is the path to the static site bundle
	BundlePath string

	// Port is the port to serve on (0 for auto-select)
	Port int

	// OpenBrowser determines whether to auto-open a browser
	OpenBrowser bool

	// Quiet suppresses status messages
	Quiet bool
}

PreviewConfig configures the preview server.

func DefaultPreviewConfig added in v0.10.3

func DefaultPreviewConfig() PreviewConfig

DefaultPreviewConfig returns sensible defaults for preview configuration.

type PreviewServer added in v0.10.3

type PreviewServer struct {
	// contains filtered or unexported fields
}

PreviewServer serves a static site bundle locally for previewing.

func NewPreviewServer added in v0.10.3

func NewPreviewServer(bundlePath string, port int) *PreviewServer

NewPreviewServer creates a new preview server for the given bundle.

func (*PreviewServer) Port added in v0.10.3

func (p *PreviewServer) Port() int

Port returns the port the server is running on.

func (*PreviewServer) Start added in v0.10.3

func (p *PreviewServer) Start() error

Start starts the preview server and blocks until stopped.

func (*PreviewServer) StartWithGracefulShutdown added in v0.10.3

func (p *PreviewServer) StartWithGracefulShutdown() error

StartWithGracefulShutdown starts the server with signal handling for clean shutdown.

func (*PreviewServer) Stop added in v0.10.3

func (p *PreviewServer) Stop() error

Stop gracefully stops the preview server.

func (*PreviewServer) URL added in v0.10.3

func (p *PreviewServer) URL() string

URL returns the full URL of the preview server.

type PriorityBriefConfig added in v0.10.3

type PriorityBriefConfig struct {
	MaxRecommendations int    // Max recommendations to include (default: 5)
	MaxQuickWins       int    // Max quick wins to include (default: 3)
	MaxBlockers        int    // Max blockers to include (default: 3)
	IncludeWhatIf      bool   // Include what-if deltas
	IncludeLegend      bool   // Include metric legend
	DataHash           string // Optional data hash for verification
}

PriorityBriefConfig configures the priority brief generation

func DefaultPriorityBriefConfig added in v0.10.3

func DefaultPriorityBriefConfig() PriorityBriefConfig

DefaultPriorityBriefConfig returns sensible defaults for the priority brief

type ProjectHealth added in v0.10.3

type ProjectHealth struct {
	OpenCount       int            `json:"open_count"`
	ClosedCount     int            `json:"closed_count"`
	BlockedCount    int            `json:"blocked_count"`
	InProgressCount int            `json:"in_progress_count"`
	ActionableCount int            `json:"actionable_count"`
	ByStatus        map[string]int `json:"by_status"`
	ByType          map[string]int `json:"by_type"`
	ByPriority      map[int]int    `json:"by_priority"`
	CycleCount      int            `json:"cycle_count,omitempty"`
	Velocity        *Velocity      `json:"velocity,omitempty"`
}

ProjectHealth contains project health statistics.

type QuickWin added in v0.10.3

type QuickWin struct {
	ID          string   `json:"id"`
	Title       string   `json:"title"`
	Score       float64  `json:"score"`
	Reason      string   `json:"reason"`
	UnblocksIDs []string `json:"unblocks_ids,omitempty"`
}

QuickWin represents a quick win item from triage.

type SQLiteExportConfig added in v0.10.3

type SQLiteExportConfig struct {
	// OutputDir is the directory to write export files
	OutputDir string

	// Title is a custom title for the static site
	Title string

	// ChunkThreshold is the file size (bytes) above which to chunk the database
	// Default: 5MB
	ChunkThreshold int64

	// ChunkSize is the size of each chunk when chunking is needed
	// Default: 1MB (optimal for httpvfs range requests)
	ChunkSize int64

	// IncludeRobotOutputs determines whether to write JSON robot outputs
	IncludeRobotOutputs bool

	// PageSize is the SQLite page size (optimal: 1024 for httpvfs)
	PageSize int
}

SQLiteExportConfig configures the SQLite export process.

func DefaultSQLiteExportConfig added in v0.10.3

func DefaultSQLiteExportConfig() SQLiteExportConfig

DefaultSQLiteExportConfig returns sensible defaults for export configuration.

type SQLiteExporter added in v0.10.3

type SQLiteExporter struct {
	Issues  []*model.Issue
	Deps    []*model.Dependency
	Metrics map[string]*model.IssueMetrics
	Stats   *analysis.GraphStats
	Triage  *analysis.TriageResult
	Config  SQLiteExportConfig
	// contains filtered or unexported fields
}

SQLiteExporter exports bv data to a SQLite database for static deployment.

func NewSQLiteExporter added in v0.10.3

func NewSQLiteExporter(issues []*model.Issue, deps []*model.Dependency, metricsOrStats interface{}, triage *analysis.TriageResult) *SQLiteExporter

NewSQLiteExporter creates a new exporter with the given data. The third parameter may be either:

  • map[string]*model.IssueMetrics (explicit metrics)
  • *analysis.GraphStats (for computed metrics)

This keeps backward compatibility with legacy call sites/tests.

func (*SQLiteExporter) Export added in v0.10.3

func (e *SQLiteExporter) Export(outputDir string) error

Export writes the SQLite database and supporting files to the output directory.

func (*SQLiteExporter) ExportToJSON added in v0.10.3

func (e *SQLiteExporter) ExportToJSON(path string) error

ExportToJSON exports issues to a JSON file (alternative to SQLite).

func (*SQLiteExporter) GetExportedIssues added in v0.10.3

func (e *SQLiteExporter) GetExportedIssues() []ExportIssue

GetExportedIssues converts issues to ExportIssue format.

func (*SQLiteExporter) SetGitHash added in v0.10.3

func (e *SQLiteExporter) SetGitHash(hash string)

SetGitHash sets the git commit hash for export metadata.

type TriageRecommendation added in v0.10.3

type TriageRecommendation struct {
	ID           string   `json:"id"`
	Title        string   `json:"title"`
	IssueType    string   `json:"issue_type"`
	Status       string   `json:"status"`
	Priority     int      `json:"priority"`
	TriageScore  float64  `json:"triage_score"`
	BlocksCount  int      `json:"blocks_count"`
	Action       string   `json:"action"`
	Reasons      []string `json:"reasons"`
	UnblocksIDs  []string `json:"unblocks_ids,omitempty"`
	BlockedByIDs []string `json:"blocked_by_ids,omitempty"`
}

TriageRecommendation represents a single triage recommendation for export.

type Velocity added in v0.10.3

type Velocity struct {
	ClosedLast7Days  int            `json:"closed_last_7_days"`
	ClosedLast30Days int            `json:"closed_last_30_days"`
	AvgDaysToClose   float64        `json:"avg_days_to_close"`
	Weekly           []VelocityWeek `json:"weekly,omitempty"`
	Estimated        bool           `json:"estimated,omitempty"`
}

Velocity captures project-level throughput stats for exports/robots.

type VelocityWeek added in v0.10.3

type VelocityWeek struct {
	WeekStart time.Time `json:"week_start"`
	Closed    int       `json:"closed"`
}

VelocityWeek holds weekly bucketed closure counts (Monday-start UTC).

type Wizard added in v0.10.3

type Wizard struct {
	// contains filtered or unexported fields
}

Wizard handles the interactive deployment flow.

func NewWizard added in v0.10.3

func NewWizard(beadsPath string) *Wizard

NewWizard creates a new deployment wizard.

func (*Wizard) GetConfig added in v0.10.3

func (w *Wizard) GetConfig() *WizardConfig

GetConfig returns the collected wizard configuration.

func (*Wizard) OfferPreview added in v0.10.3

func (w *Wizard) OfferPreview() (string, error)

OfferPreview asks if user wants to preview and handles the preview flow.

func (*Wizard) PerformDeploy added in v0.10.3

func (w *Wizard) PerformDeploy() (*WizardResult, error)

PerformDeploy deploys the bundle to the configured target.

func (*Wizard) PerformExport added in v0.10.3

func (w *Wizard) PerformExport(bundlePath string) error

PerformExport creates the static site bundle. This is called by the main CLI after collecting issues.

func (*Wizard) PrintSuccess added in v0.10.3

func (w *Wizard) PrintSuccess(result *WizardResult)

PrintSuccess prints the success message after deployment.

func (*Wizard) Run added in v0.10.3

func (w *Wizard) Run() (*WizardResult, error)

Run executes the interactive wizard flow.

type WizardConfig added in v0.10.3

type WizardConfig struct {
	// Export options
	IncludeClosed  bool   `json:"include_closed"`
	IncludeHistory bool   `json:"include_history"`
	Title          string `json:"title"`
	Subtitle       string `json:"subtitle,omitempty"`

	// Deployment target
	DeployTarget string `json:"deploy_target"` // "github", "cloudflare", "local"

	// GitHub options
	RepoName        string `json:"repo_name,omitempty"`
	RepoPrivate     bool   `json:"repo_private,omitempty"`
	RepoDescription string `json:"repo_description,omitempty"`

	// Cloudflare options
	CloudflareProject string `json:"cloudflare_project,omitempty"`
	CloudflareBranch  string `json:"cloudflare_branch,omitempty"`

	// Output path for bundle
	OutputPath string `json:"output_path,omitempty"`
}

WizardConfig holds configuration for the deployment wizard.

func LoadWizardConfig added in v0.10.3

func LoadWizardConfig() (*WizardConfig, error)

LoadWizardConfig loads previously saved wizard configuration.

type WizardResult added in v0.10.3

type WizardResult struct {
	BundlePath   string
	RepoFullName string
	PagesURL     string
	DeployTarget string
	// Cloudflare-specific
	CloudflareProject string
	CloudflareURL     string
}

WizardResult contains the result of running the wizard.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL