compact

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package compact is the Stage-1 namespace for the engine package's compaction-related types and functions. It currently re-exports the canonical symbols from package engine as type aliases and var aliases; no implementation lives here yet.

New code in hawk should import this package instead of reaching into engine for compact symbols. When Stage 2 of the engine split lands, the implementation will move into this directory and the engine package will become the alias re-exporter (the inverse of the current direction).

See REFACTOR_PLAN.md at the engine package root for the full split plan.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrompt

func BuildPrompt(variant Variant) string

BuildPrompt renders the compaction prompt template for the given variant.

func FormatSummary

func FormatSummary(raw string) string

FormatSummary normalises a raw LLM summary for display.

Types

type APICompactConfig

type APICompactConfig = engine.APICompactConfig

APICompactConfig tunes the API-boundary compactor.

func DefaultAPIConfig

func DefaultAPIConfig() APICompactConfig

DefaultAPIConfig returns the default API-boundary compactor config.

type APICompactStrategy

type APICompactStrategy = engine.APICompactStrategy

APICompactStrategy compacts at the API-call boundary (provider-specific).

type AutoCompactor

type AutoCompactor = engine.AutoCompactor

AutoCompactor decides when and how to compact based on context pressure.

func NewAutoCompactor

func NewAutoCompactor(config Config) *AutoCompactor

NewAutoCompactor constructs an auto-compactor with the given config.

type Config

type Config = engine.CompactConfig

Config tunes compaction behaviour.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default top-level compaction config.

type FileTracker

type FileTracker = engine.FileTracker

FileTracker remembers which files have been read/modified during a session; used by file-aware compactors to keep the relevant ones.

func NewFileTracker

func NewFileTracker() *FileTracker

NewFileTracker returns an empty file tracker.

type MicroCompactConfig

type MicroCompactConfig = engine.MicroCompactConfig

MicroCompactConfig tunes the micro-compactor.

func DefaultMicroConfig

func DefaultMicroConfig() MicroCompactConfig

DefaultMicroConfig returns the default micro-compactor config.

type MicroCompactStrategy

type MicroCompactStrategy = engine.MicroCompactStrategy

MicroCompactStrategy collapses adjacent short messages.

type Registry

type Registry = engine.StrategyRegistry

Registry stores strategies by name for runtime selection.

type Result

type Result = engine.CompactResult

Result is the outcome of a compaction pass.

type SessionMemoryConfig

type SessionMemoryConfig = engine.SessionMemoryConfig

SessionMemoryConfig tunes the session-memory compactor.

func DefaultSessionMemoryConfig

func DefaultSessionMemoryConfig() SessionMemoryConfig

DefaultSessionMemoryConfig returns the default session-memory compactor config.

type SessionMemoryStrategy

type SessionMemoryStrategy = engine.SessionMemoryStrategy

SessionMemoryStrategy distils conversation into a compact memory blob.

type SmartCompactStrategy

type SmartCompactStrategy = engine.SmartCompactStrategy

SmartCompactStrategy is the default LLM-driven compactor.

type Strategy

type Strategy = engine.CompactStrategy

Strategy is the contract every compaction strategy implements.

type TruncateStrategy

type TruncateStrategy = engine.TruncateStrategy

TruncateStrategy drops oldest messages first; cheap but lossy.

type Variant

type Variant = engine.CompactVariant

Variant identifies which compaction prompt variant to render.

Jump to

Keyboard shortcuts

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