project

package
v0.1.0-rc4 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package project orchestrates content acquisition and search indexing for the mcpsmithy sources system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(ctx context.Context, cfg *config.Config, projectRoot string, opts BuildOptions) (search.Searcher, <-chan struct{})

Build processes all sources according to cfg and opts, returning a Searcher and a channel that closes when initial processing completes. Each source is fetched (if remote and policy permits) then indexed (unless opts.SkipIndex or the source has index: false).

Modes:

  • SkipIndex=true: fetch only, no indexing, blocks until complete (used by "sources pull")
  • otherwise: indexing runs in background; if syncInterval>0 a refresh loop re-runs every N minutes

Pull policies (applied per-source, falling back to global):

  • always: re-fetch on every startup and refresh
  • ifNotPresent: skip fetch if source directory already exists (default)
  • never: never fetch, only use sources already on disk

Types

type BuildOptions

type BuildOptions struct {
	// SkipIndex skips building the search index; only fetches remote sources
	// to disk. Used by the "sources pull" CLI command.
	SkipIndex bool

	// Registry overrides the source factory registry. When nil the
	// default registry (populated by init) is used. Tests can pass
	// a cloned registry to inject fakes without mutating globals.
	Registry *sources.Registry
}

BuildOptions configures the behaviour of Build.

Directories

Path Synopsis
Package sources provides content acquisition from local files, git repositories, and web pages.
Package sources provides content acquisition from local files, git repositories, and web pages.

Jump to

Keyboard shortcuts

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