model

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiagnosticLevelInfo  = "info"
	DiagnosticLevelWarn  = "warn"
	DiagnosticLevelError = "error"
)

Diagnostic levels

View Source
const (
	ConfigSchemaVersion = 1
	IndexSchemaVersion  = 1
	ProtocolVersion     = 1
)

Version constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagnostic

type Diagnostic struct {
	Level   string // "info", "warn", or "error"
	Code    string
	Message string
	Span    Span
}

Diagnostic represents a parse error or warning

type EdgeType

type EdgeType string
const DefaultEdgeType EdgeType = "related-to"

DefaultEdgeType is used when no edge type is specified in a link

type Frontmatter

type Frontmatter struct {
	ID      NoteID
	Type    TypeName
	Key     Key
	Created time.Time
	Updated time.Time
	Title   string
	Tags    []string
	State   string
	// Extra preserves unknown fields from YAML frontmatter
	Extra map[string]any
}

Frontmatter represents the YAML frontmatter of a note

type Key

type Key string

type Note

type Note struct {
	FM       Frontmatter
	Path     string
	Body     string
	RawLinks []RawLink
	Diags    []Diagnostic
}

Note represents a complete parsed note

type NoteID

type NoteID string

Type aliases for canonical contracts

type RawLink struct {
	Source       TypeKey
	Target       RawTarget
	EdgeType     EdgeType
	Span         Span
	ResolvedToID *NoteID // Set during indexing when link is resolved (Phase 2+)
}

RawLink represents a link extracted from note body

type RawTarget

type RawTarget struct {
	// Type is nil if unqualified (e.g., [[key]] vs [[type:key]])
	Type *TypeName
	Key  Key
	// Label is reserved for future use
	Label *string
}

RawTarget represents a link target (may be unresolved)

type Span

type Span struct {
	Path      string
	StartByte int
	EndByte   int
	StartLine int // optional in v0
	StartCol  int // optional in v0
}

Span represents a location in source code

type TypeKey

type TypeKey struct {
	Type TypeName
	Key  Key
}

TypeKey represents a qualified note reference (type:key)

type TypeName

type TypeName string

Jump to

Keyboard shortcuts

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