app

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package app shares synchronized operations between the CLI and MCP front ends.

Index

Constants

This section is empty.

Variables

View Source
var ErrUninitialized = errors.New("KB not initialized")

Functions

func Info

func Info(ctx context.Context, root string) (kb.Details, error)

Info fills the same inspector response for both front ends.

func Move

func Move(ctx context.Context, idx *index.Index, root, old, new string, dry bool) (kb.MoveResult, string, error)

func Searcher

func Searcher(idx *index.Index, model string) (search.Search, bool, error)

func Synced

func Synced(ctx context.Context, root string, full bool) (*index.Index, string, error)

Synced resolves the root and opens an incrementally synchronized cache.

func Write

func Write(ctx context.Context, idx *index.Index, root, id, content, mode, verb string) (kb.WriteResult, error)

Write publishes, reindexes and commits a logical write for both front ends.

Types

type EmbedResult

type EmbedResult struct {
	Model         string `json:"model"`
	NotesEmbedded int    `json:"notes_embedded"`
	Chunks        int    `json:"chunks"`
	Skipped       int    `json:"skipped"`
	DurationMS    int64  `json:"duration_ms"`
	DryRun        bool   `json:"dry_run,omitempty"`
}

func Embed

func Embed(ctx context.Context, idx *index.Index, e embed.Embedder, force, dry bool, progress io.Writer) (EmbedResult, error)

type EvalResult

type EvalResult struct {
	Results []eval.Result `json:"results"`
}

func Eval

func Eval(ctx context.Context, idx *index.Index, path, mode string, diagnostics io.Writer) (EvalResult, error)

type SearchResult

type SearchResult struct {
	Mode string       `json:"mode"`
	Hits []search.Hit `json:"hits"`
}

func SearchDefault

func SearchDefault(ctx context.Context, idx *index.Index, q, mode string, limit int, diagnostics io.Writer) (SearchResult, error)

SearchDefault permits fallback only for an automatically selected hybrid mode.

Jump to

Keyboard shortcuts

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