Documentation
¶
Overview ¶
Package local runs the batteries-included HumanLLM desktop composition in one process: a loopback caller endpoint, an SQLite-backed llm.Service, and a browser human side connected in-process through workerkit.
Index ¶
- Constants
- type Config
- type Credentials
- type Local
- func (local *Local) BaseURL() string
- func (local *Local) CallerToken() string
- func (local *Local) Close() error
- func (local *Local) Credentials() Credentials
- func (local *Local) Service() *llm.Service
- func (local *Local) Wait() error
- func (local *Local) WebURL() string
- func (local *Local) WebWorker() *workerkit.Worker
- type PublicStackConfig
Constants ¶
const (
// DefaultListenAddress asks the kernel for a free IPv4 loopback port.
DefaultListenAddress = "127.0.0.1:0"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Public PublicStackConfig
ListenAddress string
CallerSubject string
WorkerSubject string
ShutdownTimeout time.Duration
// WebListenAddress is the loopback address of the browser human side.
// Empty asks the kernel for a free loopback port.
WebListenAddress string
// WebStatePath is the durable workerkit conversation state used by the web
// human side. Empty derives workerkit-state.db in workspace-scoped user data.
WebStatePath string
// WebStateStore optionally supplies an application-owned implementation.
// Local borrows it and ignores WebStatePath. The built-in implementation is
// SQLite; this is the replacement seam for embedders.
WebStateStore workerkit.StateStore
// WebStateDisabled selects the reference in-memory implementation and turns
// off the filesystem mirror baseline.
WebStateDisabled bool
// WebDisableAutoTitle routes tool-less chat requests to the inbox instead of
// using the built-in title responder.
WebDisableAutoTitle bool
// HumanWorkspaceRoot is the Human-side base directory. New workspace-tier
// conversations receive stable child directories here; the Human may later
// select a different existing repo per conversation in the Web UI.
// It never describes the Agent user's cwd.
HumanWorkspaceRoot string
// ExistingCallerToken reuses a host-owned bearer/API key. Empty creates an
// ephemeral token returned by CallerToken/Credentials; Local never persists
// or revokes host credentials.
ExistingCallerToken string
}
Config controls the reference one-process deployment. It intentionally exposes only policy and durable locations owned by this composition. Hosts needing different authentication, stores, routing, transports, or UIs compose the public llm, callerhttp, and workerkit ports directly.
func DefaultConfig ¶
DefaultConfig returns a complete workspace-scoped public-stack configuration. Private databases live in OS user data; the Human workspace base is the only intentionally user-visible tree.
type Credentials ¶
Credentials are the caller-side secret for the local model endpoint. NewlyIssued is true only for an ephemeral token allocated by Open. The in-process worker has no credential surface.
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
Local owns the reference service, caller transport, loopback HTTP servers, workerkit worker, mirror, and built-in StateStore resource. Close is idempotent.
func Open ¶
Open starts the public reference composition. Any partial failure closes all components already opened. The local package is intentionally in-process; distributed gateway/worker transports are composed by their own products.
func (*Local) CallerToken ¶
CallerToken returns the caller bearer/API key held in memory.
func (*Local) Close ¶
Close cancels active handlers and maintenance loops, drains both loopback servers, stops the human side, and finally shuts down Service (which owns its Store). It is safe to call more than once.
func (*Local) Credentials ¶
func (local *Local) Credentials() Credentials
Credentials returns a copy of the local caller credential metadata.
func (*Local) Service ¶
Service returns the public correctness core owned by Local. Callers may use its read-only/status and explicit maintenance APIs while Local is alive; they must not shut it down independently.
type PublicStackConfig ¶
type PublicStackConfig struct {
DatabasePath string
CallerWriteTimeout time.Duration
CallerHeartbeat time.Duration
MaxPending time.Duration
ExpirySweepInterval time.Duration
ReplayPayloadGrace time.Duration
RetentionSweepInterval time.Duration
AssignmentBuffer int
}
PublicStackConfig selects operational policy for the reference composition. Scheduling remains a host concern: Local drives the public RunExpiry and RunRetention operations using these intervals.