memory

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 12 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

func NewMemoryTool

func NewMemoryTool(_ struct{}, deps MemoryToolDeps) (agentkit.Tool, error)

NewMemoryTool registers tool/memory for the main agent.

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"`
}

type Deps

type Deps struct {
	Workspace workspace.Service `json:"workspace"`
}

type MemoryToolDeps

type MemoryToolDeps struct {
	Memory capmemory.Tool `json:"memory"`
}

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)

New registers memory/default.

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) 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(ctx context.Context, parts ...string) (string, error)

Jump to

Keyboard shortcuts

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