Help us shape the future of Go! Take the 2026 Go Developer Survey

memory

package
v0.4.32 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatMemory

func FormatMemory(entries []capmemory.MemoryEntry, used, limit int) string

Types

type Config

type Config struct {
	Disabled   bool         `json:"disabled"`
	CharLimit  int          `json:"charLimit"`
	MemoryRoot string       `json:"memoryRoot"`
	MemoryFile string       `json:"memoryFile"`
	Review     ReviewConfig `json:"review"`
}

func (*Config) SetDefaults added in v0.3.48

func (c *Config) SetDefaults()

New registers memory/default. SetDefaults implements pluginkit.Defaulter.

type Deps

type Deps struct {
	FS filesystem.Service `json:"fs"`
}

type ReviewConfig

type ReviewConfig struct {
	WriteApproval *bool `json:"writeApproval"`
}

ReviewConfig controls background-review memory writes.

type Service

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

Service owns tenant memory.md, ledger, staged review, and /memory commands.

func New

func New(cfg Config, deps Deps) (*Service, error)

func (*Service) ApproveStaged

func (s *Service) ApproveStaged(ctx context.Context, id string) (string, error)

func (*Service) BackgroundReviewRequiresStaging

func (s *Service) BackgroundReviewRequiresStaging(ctx context.Context) bool

BackgroundReviewRequiresStaging implements cap/memory.Service.

func (*Service) CaptureMemoryAdd

func (s *Service) CaptureMemoryAdd(ctx context.Context, text, source string) (string, error)

func (*Service) CaptureMemoryRemove

func (s *Service) CaptureMemoryRemove(ctx context.Context, oldText string) (string, error)

func (*Service) CaptureMemoryReplace

func (s *Service) CaptureMemoryReplace(ctx context.Context, oldText, content, source string) (string, error)

func (*Service) Commands

func (s *Service) Commands() []agentkit.Command

func (*Service) Disabled

func (s *Service) Disabled() bool

func (*Service) ListStaged

func (s *Service) ListStaged(ctx context.Context) ([]capmemory.StagedEntry, error)

func (*Service) LoadEntries

func (s *Service) LoadEntries(ctx context.Context) ([]capmemory.MemoryEntry, int, int, error)

func (*Service) MemoryTool

func (*Service) PreviewAddOutcome added in v0.3.33

func (s *Service) PreviewAddOutcome(ctx context.Context, text string) (capmemory.AddOutcome, error)

PreviewAddOutcome implements cap/memory.Reader.

func (*Service) PromptBody

func (s *Service) PromptBody(ctx context.Context) (string, error)

func (*Service) RegisterCommitObserver

func (s *Service) RegisterCommitObserver(o capmemory.CommitObserver)

RegisterCommitObserver appends a post-commit hook (learning/default registers in New).

func (*Service) RejectStaged

func (s *Service) RejectStaged(ctx context.Context, id string) (string, error)

func (*Service) ResolveRel

func (s *Service) ResolveRel(_ context.Context, parts ...string) (string, error)

ResolveRel returns the filesystem-relative path under memoryRoot (may carry a global:/local: scope prefix). Callers read/write it through the injected fs.

Jump to

Keyboard shortcuts

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