reasoning

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrompt

func BuildPrompt(entries []eidetic.MemoryEntry, activeSurfaces []surfaces.Surface, recentlyResolved []surfaces.Surface, answeredSurfaces []surfaces.Surface) string

BuildPrompt assembles the prompt sent to Claude for a reasoning cycle.

Types

type CycleResponse

type CycleResponse struct {
	Expire []string     `json:"expire"`
	Create []RawSurface `json:"create"`
}

CycleResponse is the top-level JSON shape Claude returns.

func ParseResponse

func ParseResponse(raw string) (*CycleResponse, error)

ParseResponse extracts the cycle response from Claude's text output.

type Loop

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

Loop runs the periodic reasoning cycle.

func New

func New(interval time.Duration, ag agent.PrimaryAgent, eideticClient eidetic.Client, store SurfaceStore, logger *zap.SugaredLogger) *Loop

New creates a reasoning Loop.

func (*Loop) AddDeliverer

func (l *Loop) AddDeliverer(d agentapi.Deliverer)

AddDeliverer registers a channel bot for high-priority surface notifications.

func (*Loop) Run

func (l *Loop) Run(ctx context.Context)

Run starts the reasoning loop. Blocks until ctx is cancelled.

func (*Loop) Trigger

func (l *Loop) Trigger()

Trigger requests an early reasoning cycle. Safe to call from any goroutine. Multiple rapid triggers coalesce into a single debounced cycle.

type RawSurface

type RawSurface struct {
	Content     string   `json:"content"`
	SurfaceType string   `json:"surface_type"`
	Priority    int      `json:"priority"`
	Tags        []string `json:"tags"`
	TriggerAt   string   `json:"trigger_at,omitempty"` // RFC3339 timestamp for reminders
}

RawSurface is the JSON shape for a new surface to create.

func (*RawSurface) ParseTriggerAt

func (r *RawSurface) ParseTriggerAt() *time.Time

ParseTriggerAt parses the trigger_at field as RFC3339. Returns nil if empty or invalid.

type SurfaceStore

type SurfaceStore interface {
	List(ctx context.Context, f surfaces.ListFilter) ([]surfaces.Surface, error)
	Create(ctx context.Context, req surfaces.CreateRequest) (*surfaces.Surface, error)
	Update(ctx context.Context, id uuid.UUID, req surfaces.UpdateRequest) (*surfaces.Surface, error)
	DueReminders(ctx context.Context) ([]surfaces.Surface, error)
}

SurfaceStore is the subset of *surfaces.Store used by the reasoning loop.

Jump to

Keyboard shortcuts

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