grove

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package grove is Fuse's adapter to the in-process Grove engine. The previous HTTP client + auto-spawn of `grove serve` is gone: Fuse now links against `grove/pkg/grove` and opens the on-disk index directly. Public types (Client, Edge, ImpactNode, SymbolRecord, EnsureRunning) are preserved so the rest of Fuse compiles unchanged.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureRunning

func EnsureRunning(ctx context.Context, baseURL, binary, root string, timeout time.Duration) error

EnsureRunning is a no-op in the embedded model — Grove is in-process. Kept for API compatibility; baseURL/binary/timeout are ignored. root is required so we know which repository's .grove/ to attach to.

Types

type Client

type Client struct {
	BaseURL string
	Token   string
	// contains filtered or unexported fields
}

Client wraps an embedded Grove engine. BaseURL/Token are accepted for API compatibility but unused.

func New

func New(baseURL string) *Client

New returns a Client. baseURL is retained for compatibility and ignored.

func (*Client) Close

func (c *Client) Close()

Close releases the engine.

func (*Client) Deps

func (c *Client) Deps(ctx context.Context, filePath string) ([]Edge, error)

Deps returns dependency edges for filePath.

func (*Client) Health

func (c *Client) Health(ctx context.Context) error

Health returns nil if the engine is open (or can be opened lazily).

func (*Client) Impact

func (c *Client) Impact(ctx context.Context, query string, maxDepth int) ([]ImpactNode, error)

Impact returns nodes affected by changes to query (file or symbol).

func (*Client) Index

func (c *Client) Index(ctx context.Context, dir string) error

Index triggers (re-)indexing of dir.

func (*Client) Symbols

func (c *Client) Symbols(ctx context.Context, query string, limit int) ([]SymbolRecord, error)

Symbols searches symbols by query string.

func (*Client) WithTokenFromDir

func (c *Client) WithTokenFromDir(dir string) *Client

WithTokenFromDir records the project root so Fuse can open the engine at <dir>/.grove/grove.db on first use. No token is read (none exists).

type Edge

type Edge struct {
	From       string  `json:"from"`
	To         string  `json:"to"`
	Type       string  `json:"type"`
	Confidence float64 `json:"confidence"`
}

Edge mirrors the engine edge shape Fuse consumes.

type ImpactNode

type ImpactNode struct {
	ID       string `json:"id"`
	FilePath string `json:"filePath"`
	Name     string `json:"name"`
}

ImpactNode is one entry in the blast-radius response.

type SymbolRecord

type SymbolRecord struct {
	ID       string `json:"id"`
	FilePath string `json:"filePath"`
	Name     string `json:"name"`
	Kind     string `json:"kind"`
}

SymbolRecord is the wire-format subset Fuse uses.

Jump to

Keyboard shortcuts

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