model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockStartIndex

func BlockStartIndex(blocks []Block) map[int]int

BlockStartIndex builds a map from each block's Range.Start to its index. Useful for mapping segment blocks back to the global block list.

Types

type Block

type Block struct {
	Kind            BlockKind
	Text            string
	HeadingLevel    int
	HeadingPath     []string
	Range           SourceRange
	TokensApprox    int
	LinesApprox     int
	IsPseudoHeading bool
}

Block represents a single markdown block element.

type BlockKind

type BlockKind int

BlockKind represents the type of a markdown block.

const (
	BlockHeading BlockKind = iota
	BlockParagraph
	BlockList
	BlockCodeBlock
	BlockThematicBreak
	BlockTable
	BlockBlockquote
	BlockHTMLBlock
	BlockMathBlock
)

func (BlockKind) String

func (k BlockKind) String() string

type Embedding

type Embedding struct {
	BlockIndex int
	Vector     []float64
}

Embedding represents a vector embedding for a block.

type Segment

type Segment struct {
	Blocks      []Block
	HeadingPath []string
	Range       SourceRange
	TokenCount  int
	LineCount   int

	// Multi-agent support fields
	ID            string  // Content-addressable segment ID (SHA256)
	Coherence     float64 // Intra-segment semantic coherence (0.0-1.0)
	PrevSegmentID string  // Previous segment ID (empty if first)
	NextSegmentID string  // Next segment ID (empty if last)
}

Segment represents a contiguous group of blocks forming a semantic unit.

type SourceRange

type SourceRange struct {
	Start int
	End   int
}

SourceRange represents a byte range in the original source.

Jump to

Keyboard shortcuts

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