Help us shape the future of Go! Take the 2026 Go Developer Survey

overlay

package
v2.219.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package overlay projects the canonical person model into a compact, caller-stateful identity surface.

Index

Constants

View Source
const (
	Format        = "agent-compose.overlay.v1"
	SchemaVersion = 1
)

Variables

This section is empty.

Functions

func Marshal

func Marshal(doc *Document) ([]byte, error)

func RenderText

func RenderText(doc *Document, width int) (string, error)

Types

type Document

type Document struct {
	Format          string `json:"format"`
	SchemaVersion   int    `json:"schema_version"`
	Person          string `json:"person"`
	Role            string `json:"role"`
	RoleDisplayName string `json:"role_display_name"`
	Purpose         string `json:"purpose"`
	// Stance is the role's posture, not a personality's. See docs/identity.md.
	Stance string      `json:"stance,omitempty"`
	Seat   person.Seat `json:"seat"`
	// Annotation is the composed identity string a renderer shows verbatim,
	// `Moss-Toad (Engineer)`.
	Annotation string `json:"annotation"`
	// Identity is the four-part sentence a seat answers "who are you" with.
	// Seat-resolved, so it lives here rather than on the card (#396).
	Identity string `json:"identity,omitempty"`

	// A field rather than only prose, because a consumer parsed Identity for
	// it (#7362). Derived from the meld, with no element segment (#7485).
	Creature string `json:"creature,omitempty"`

	// A renderer that draws a role with no roster entry gets the carried
	// object from here, so it is projected rather than left to a roster.
	Carried *person.Carried `json:"carried,omitempty"`
	// Outro carries voice at the close, so a hold banner is not invented.
	Outro         *person.Outro `json:"outro,omitempty"`
	Expression    string        `json:"expression"`
	FavoriteColor string        `json:"favorite_color"`
	// Background is solved across the whole roster, so a renderer that tints
	// its own cannot tell two roles apart. See internal/palette/role-palette.txt.
	Background    string        `json:"background"`
	Personalities []Personality `json:"personalities"`
}

func Build

func Build(p *person.Person, roleName, harness, expression string) (*Document, error)

type Personality

type Personality struct {
	Name      string        `json:"name"`
	Species   string        `json:"species"`
	ColorWord string        `json:"color_word"`
	Color     string        `json:"color"`
	Motif     string        `json:"motif"`
	Geometry  string        `json:"geometry"`
	Emblem    person.Emblem `json:"emblem"`
	Body      person.Body   `json:"body"`
}

Jump to

Keyboard shortcuts

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