gleamunison/agent_read_model

Durable branch definitions and explicit source overlays share a read model. Stored entries retain their AST and content identity; surface projections are for elaboration only and are never presented as the original source.

Types

pub type Entry {
  Source(
    name: String,
    definition: elab_types.SurfaceDef,
    origin: Origin,
  )
  Stored(
    name: String,
    ref: identity.DefinitionRef,
    definition: ast.Definition,
    branch: String,
  )
}

Constructors

pub type Origin {
  Bootstrap
  Scratch
  Branch(String)
}

Constructors

  • Bootstrap
  • Scratch
  • Branch(String)
pub type Selection {
  Selection(
    adapter: storage.StorageAdapter,
    branch: String,
    names: dict.Dict(
      identity.DefinitionRef,
      identity.DefinitionRef,
    ),
  )
}

Constructors

Values

pub fn cache(
  entries: List(Entry),
  baseline: types.TypeCache,
) -> types.TypeCache
pub fn definitions(
  entries: List(Entry),
) -> List(#(String, elab_types.SurfaceDef))
pub fn load(
  adapter: storage.StorageAdapter,
  branch: String,
) -> Result(#(List(Entry), Selection), String)
pub fn name(entry: Entry) -> String
pub fn origin(entry: Entry) -> Origin
pub fn projection(
  entry: Entry,
) -> Result(#(String, elab_types.SurfaceDef), Nil)
✨ Search Document