local

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "local"

Name is the bundled local MemoryProvider registration name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	EnsureDirs() error
	LoadPromptIndex(scope memcontract.Scope) (content string, truncated bool, err error)
	List(scope memcontract.Scope) ([]memcontract.Header, error)
	Recall(
		ctx context.Context,
		query memcontract.Query,
		opts memcontract.RecallOptions,
	) (memcontract.Packaged, error)
	ApplyDecision(ctx context.Context, decision memcontract.Decision) error
	ForWorkspace(workspaceRoot string) Backend
	ForAgent(workspaceID string, agentName string, tier memcontract.AgentTier) Backend
}

Backend is the contract-typed substrate the local provider needs from AGH's memory store without depending on controller or recall internals directly.

type Option

type Option func(*Provider)

Option customizes the bundled local Provider.

func WithClock

func WithClock(now func() time.Time) Option

WithClock injects a deterministic clock.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger injects a provider logger used until Initialize overrides it.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements the bundled local MemoryProvider over Store seams.

func New

func New(backend Backend, opts ...Option) *Provider

New constructs a bundled local provider over the supplied memory store.

func (*Provider) Initialize

func (p *Provider) Initialize(ctx context.Context, init memcontract.ProviderInit) error

Initialize prepares local memory directories and records workspace metadata.

func (*Provider) OnMemoryWrite

func (p *Provider) OnMemoryWrite(ctx context.Context, rec memcontract.WriteRecord) error

OnMemoryWrite applies a controller decision through the local store.

func (*Provider) OnPreCompress

OnPreCompress returns no local pre-compression hint.

func (*Provider) OnSessionEnd

func (p *Provider) OnSessionEnd(ctx context.Context, _ memcontract.SessionEndRecord) error

OnSessionEnd is a no-op for the bundled local provider.

func (*Provider) OnSessionSwitch

func (p *Provider) OnSessionSwitch(ctx context.Context, _ memcontract.SessionSwitchRecord) error

OnSessionSwitch is a no-op for the bundled local provider.

func (*Provider) Prefetch

Prefetch is a no-op for the bundled local provider.

func (*Provider) Recall

Recall delegates deterministic read-path packaging to the local store.

func (*Provider) Shutdown

func (p *Provider) Shutdown(ctx context.Context) error

Shutdown marks the local provider unavailable for future lifecycle calls.

func (*Provider) SyncTurn

func (p *Provider) SyncTurn(ctx context.Context, _ memcontract.TurnRecord) error

SyncTurn is a no-op for the bundled local provider.

func (*Provider) SystemPromptBlock

func (p *Provider) SystemPromptBlock(
	ctx context.Context,
	req memcontract.SnapshotRequest,
) (memcontract.SnapshotResult, error)

SystemPromptBlock returns the prompt-safe local MEMORY.md block for one scope.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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