Documentation
¶
Overview ¶
Package memory is the console-facing MemoryService handler: an observable, editable view over the durable handoff-journal entries the MCP magus_memory tool writes. It is a second door onto the EXACT on-disk store that tool maintains (internal/memory, aliased `store` here), never a second store of its own, so the browser edit surface and the agent-facing tool share one set of records. Its reason to exist: an agent can accumulate stale or bloated records, and a human list/edit/delete surface is the safety valve.
A record's body/refs are AGENT-WRITTEN and therefore UNTRUSTED: clients must render them as text, never as trusted HTML. The daemon mounts this on the loopback listener behind the same bearer guard as the other console services and never on the LAN share listener.
Index ¶
- type Service
- func (s *Service) DeleteMemory(_ context.Context, req *connect.Request[memoryv1.DeleteMemoryRequest]) (*connect.Response[memoryv1.DeleteMemoryResponse], error)
- func (s *Service) GetCursor(_ context.Context, _ *connect.Request[memoryv1.GetCursorRequest]) (*connect.Response[memoryv1.Cursor], error)
- func (s *Service) ListMemories(_ context.Context, _ *connect.Request[memoryv1.ListMemoriesRequest]) (*connect.Response[memoryv1.ListMemoriesResponse], error)
- func (s *Service) UpdateCursor(_ context.Context, _ *connect.Request[memoryv1.UpdateCursorRequest]) (*connect.Response[memoryv1.Cursor], error)
- func (s *Service) UpdateMemory(_ context.Context, req *connect.Request[memoryv1.UpdateMemoryRequest]) (*connect.Response[memoryv1.Memory], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements memoryv1alpha1connect.MemoryServiceHandler over the on-disk record store.
func NewService ¶
func NewService(ws workspace) *Service
NewService builds a MemoryService handler over the workspace ws.
func (*Service) DeleteMemory ¶
func (s *Service) DeleteMemory(_ context.Context, req *connect.Request[memoryv1.DeleteMemoryRequest]) (*connect.Response[memoryv1.DeleteMemoryResponse], error)
DeleteMemory removes a record by name. allow_missing=true makes deleting an absent record a no-op; otherwise an absent record is NotFound. Any other failure is a storage error.
func (*Service) GetCursor ¶ added in v0.3.0
func (s *Service) GetCursor(_ context.Context, _ *connect.Request[memoryv1.GetCursorRequest]) (*connect.Response[memoryv1.Cursor], error)
GetCursor returns a legacy cursor snapshot for migration. New handoffs use named entries.
func (*Service) ListMemories ¶ added in v0.3.0
func (s *Service) ListMemories(_ context.Context, _ *connect.Request[memoryv1.ListMemoriesRequest]) (*connect.Response[memoryv1.ListMemoriesResponse], error)
ListMemories returns every record in full. Pagination is wired in the contract but the store returns all records today, so next_page_token is always empty.
func (*Service) UpdateCursor ¶ added in v0.3.0
func (s *Service) UpdateCursor(_ context.Context, _ *connect.Request[memoryv1.UpdateCursorRequest]) (*connect.Response[memoryv1.Cursor], error)
UpdateCursor rejects global cursor writes: a shared single snapshot lets one session erase another's handoff. The RPC remains in the schema so older consoles receive a migration hint.
func (*Service) UpdateMemory ¶ added in v0.3.0
func (s *Service) UpdateMemory(_ context.Context, req *connect.Request[memoryv1.UpdateMemoryRequest]) (*connect.Response[memoryv1.Memory], error)
UpdateMemory upserts a record keyed by memory.name. allow_missing=true creates the record when absent (the upsert); allow_missing=false rejects an absent record with NotFound. Only a full replace is supported, so a non-empty update_mask is rejected rather than silently dropping the fields the mask omits.