generate

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 13 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 generate orchestrates the codebase-to-vault pipeline: scan, parse, normalize, compute metrics, render, and write.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

Generate runs the full repository-to-vault pipeline and returns a structured summary of the generated topic.

func GenerateWithObserver

func GenerateWithObserver(ctx context.Context, opts models.GenerateOptions, observer Observer) (models.GenerationSummary, error)

GenerateWithObserver runs the full pipeline and emits structured events to the provided observer while returning the final summary.

Types

type Event

type Event struct {
	Kind           EventKind      `json:"kind"`
	Stage          string         `json:"stage"`
	Completed      int            `json:"completed,omitempty"`
	DurationMillis int64          `json:"durationMillis,omitempty"`
	Error          string         `json:"error,omitempty"`
	Fields         map[string]any `json:"fields,omitempty"`
	Total          int            `json:"total,omitempty"`
}

Event reports structured progress from the generate pipeline.

type EventKind

type EventKind string

EventKind identifies one generation lifecycle event.

const (
	EventStageStarted   EventKind = "stage_started"
	EventStageProgress  EventKind = "stage_progress"
	EventStageCompleted EventKind = "stage_completed"
	EventStageFailed    EventKind = "stage_failed"
)

type Observer

type Observer interface {
	ObserveGenerateEvent(context.Context, Event)
}

Observer receives structured generation events.

type ObserverFunc

type ObserverFunc func(context.Context, Event)

ObserverFunc adapts a function into an Observer.

func (ObserverFunc) ObserveGenerateEvent

func (fn ObserverFunc) ObserveGenerateEvent(ctx context.Context, event Event)

ObserveGenerateEvent implements Observer.

Jump to

Keyboard shortcuts

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