calendarauto

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package calendarauto registers confirmed future appointments from new communications.

Index

Constants

View Source
const MaxContentRunes = 24000
View Source
const MinimumConfidence = 0.9

Variables

View Source
var ErrCalendarConflict = errors.New("calendar automation: ambiguous overlapping event")

Functions

This section is empty.

Types

type Config

type Config struct {
	Store     Store
	Decider   Decider
	Extractor Extractor
	Writer    Writer
	Interval  time.Duration
	BatchSize int
	Now       func() time.Time
}

type Decider

type Decider interface {
	Decide(context.Context, *model.Document, time.Time) (Decision, error)
}

type Decision

type Decision struct {
	Action string `json:"action"`
	// Confidence stores the selected class probability, not Jev concentration.
	Confidence float64 `json:"confidence"`
}

type Evaluator

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

func NewEvaluator

func NewEvaluator(j JevClassifier, l llm.Completer) *Evaluator

func (*Evaluator) Decide

func (e *Evaluator) Decide(ctx context.Context, doc *model.Document, now time.Time) (Decision, error)

func (*Evaluator) Extract

func (e *Evaluator) Extract(ctx context.Context, doc *model.Document, now time.Time) (*Event, error)

type Event

type Event struct {
	Summary     string `json:"summary"`
	Start       string `json:"start"`
	End         string `json:"end"`
	Location    string `json:"location"`
	Description string `json:"description"`
	Evidence    string `json:"evidence"`
}

type Extractor

type Extractor interface {
	Extract(context.Context, *model.Document, time.Time) (*Event, error)
}

type GoogleWriter

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

GoogleWriter uses a separate write-scoped credential from the read collector. Refresh tokens are read from a private read-only mount; access tokens stay in memory.

func NewGoogleWriter

func NewGoogleWriter(ctx context.Context, credentialsPath, tokenPath, calendarID string) (*GoogleWriter, error)

func (*GoogleWriter) EnsureEvent

func (g *GoogleWriter) EnsureEvent(ctx context.Context, e Event) (string, bool, error)

type JevClassifier

type JevClassifier interface {
	Classify(context.Context, string, map[string]jev.Question) (*jev.Response, error)
}

type Job

type Job struct {
	Document *model.Document
	Decision *Decision
	Event    *Event
	Attempts int
}

type Store

type Store interface {
	Initialize(context.Context) (time.Time, error)
	AcquireLock(context.Context) (release func(), acquired bool, err error)
	ListJobs(context.Context, time.Time, int) ([]Job, error)
	SaveDecision(context.Context, uuid.UUID, Decision) error
	SaveEvent(context.Context, uuid.UUID, Event) error
	Finish(context.Context, uuid.UUID, string, string) error
	Retry(context.Context, uuid.UUID, string) error
}

type Worker

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

func New

func New(cfg Config) *Worker

func (*Worker) Run

func (w *Worker) Run(ctx context.Context)

func (*Worker) Tick

func (w *Worker) Tick(ctx context.Context) error

type Writer

type Writer interface {
	EnsureEvent(context.Context, Event) (eventID string, created bool, err error)
}

Jump to

Keyboard shortcuts

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