serve

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package serve hosts the culi review console: a local, single-user web UI over the knowledge store (candidate triage, KB browse, token-savings and job-health dashboards). It is off every performance-critical path — the hook and MCP surfaces never touch it — so it favors clarity over the hot-path stdlib-only discipline the retrieval packages keep.

The frontend is embedded (assets.go) and served static; all dynamic data flows through /api/* JSON endpoints backed by the same store, knowledge, and learn packages the CLI uses. Writes (approve/reject) reuse mine.Confirm / mine.Reject verbatim, so the console and `culi review` stay behaviorally identical and every mutation lands in the knowledge git history.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, opt Options) error

Run starts the console HTTP server and blocks until ctx is cancelled or the listener fails. Shutdown is graceful (in-flight requests drain).

Types

type Options

type Options struct {
	Base  string
	Cfg   config.Config
	Store *store.Store
	Addr  string
	// StatsFn returns the `culi stats` report (as an opaque value the console
	// re-marshals to JSON), injected so serve need not import the cli package.
	StatsFn func(context.Context) any
}

Options carries everything Run needs; the caller (cli.Serve) owns the store and config lifecycle.

Jump to

Keyboard shortcuts

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