voice

package
v0.6.1004 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package voice is the Writing Voice: the instructions an LLM follows to write as a person writes, one Markdown file, VOICE.md, at most MaxBytes. It is not a knowledge pack: it has no wiki, no sources and no name, and a person keeps one. A run reads it through the one tool voice_read, granted only when a voice is attached, and the System Prompt's head says what it governs and what it never does.

This package is the format: what a VOICE.md must be, its digest, and the record kept beside it. The local store keeps it sealed (pkg/knowledge/store), the Voice Writer writes it (pkg/voice/writer, pkg/voice/build), and the engine stages it into a run.

Index

Constants

View Source
const (
	// File is the voice's one file.
	File = "VOICE.md"
	// MaxBytes caps a VOICE.md: the drafted instruction's cap, so a
	// full LLM skill fits and AI Review reads it in one chunk.
	MaxBytes = 32 << 10
	// MetaSchema is the format of the record kept beside a voice.
	MetaSchema = "agentry-voice/v1"
)

Variables

View Source
var ErrNoVoice = errors.New("no Writing Voice is kept on this computer; make one with `agentry voice create --file SAMPLE`")

ErrNoVoice is what a store that keeps no voice answers.

Functions

func Check

func Check(text []byte) error

Check holds text to the format: UTF-8 Markdown with something in it, no NUL, at most MaxBytes.

func Digest

func Digest(text []byte) string

Digest is text's digest, "sha256:<hex>".

func Stamp

func Stamp(t time.Time) string

Stamp formats a time as the record does.

Types

type Creator

type Creator struct {
	CLI   string `json:"cli,omitempty"`
	Model string `json:"model,omitempty"`
}

Creator is what wrote a version.

type Meta

type Meta struct {
	Schema string `json:"schema"`
	// ID names the voice's sealed copy and wraps its key ("vo_" and 32
	// hex digits). A new version keeps it.
	ID      string `json:"id"`
	SHA256  string `json:"sha256"`
	Bytes   int    `json:"bytes"`
	Source  Source `json:"source"`
	Created string `json:"created"`
	Updated string `json:"updated"`
	// AlwaysAttach is this computer's voice's own flag: every run
	// here attaches it unless the run says not to. On when a voice is
	// first made.
	AlwaysAttach bool `json:"alwaysAttach"`
	// Creator is the client and model that wrote the last version; empty
	// for the person's own text.
	Creator *Creator `json:"creator,omitempty"`
}

Meta is the record kept in the clear beside a sealed voice: what it is, never what it says.

func (Meta) Describe

func (m Meta) Describe() string

Describe is how the receipt and the CLI name a version: its digest, its size and where it came from.

func (Meta) Origin

func (m Meta) Origin() string

Origin is where this computer's voice came from, as a run's receipt records it. A downloaded voice was reviewed in the account; nothing here checks it again, and the record kept beside it is not authenticated, so the receipt says no more than that.

type Source

type Source string

Source is how a version of the voice came to be.

const (
	// SourceCreate is the Voice Writer over writing samples and a brief.
	SourceCreate Source = "create"
	// SourceImprove is the Voice Writer over the current voice, more
	// samples and a brief.
	SourceImprove Source = "improve"
	// SourceAIEdit is the Voice Writer over the current voice and a note.
	SourceAIEdit Source = "ai-edit"
	// SourceEdit is the person's own text.
	SourceEdit Source = "edit"
	// SourceDownload is the account's live voice, downloaded: AI Review
	// passed it in the account before it was live there.
	SourceDownload Source = "download"
)

func (Source) Phrase

func (s Source) Phrase() string

Phrase is the source in a sentence.

func (Source) Valid

func (s Source) Valid() bool

Valid says whether s is a source this client knows.

Directories

Path Synopsis
Package build writes a Writing Voice with the Voice Writer: it stages the person's writing samples, decodes them before any agent sees them (pkg/runner/decode, the Knowledge Creator's decode step), runs the built-in Voice Writer over their text with the current voice when there is one (pkg/runner/localrun), and returns the VOICE.md it wrote, held to the format.
Package build writes a Writing Voice with the Voice Writer: it stages the person's writing samples, decodes them before any agent sees them (pkg/runner/decode, the Knowledge Creator's decode step), runs the built-in Voice Writer over their text with the current voice when there is one (pkg/runner/localrun), and returns the VOICE.md it wrote, held to the format.
Package remote is the client of a registry's Writing Voice routes (the core's docs/voice.md): read the account's voice, put a new version for review, and set the account's always-attach flag, for the account a session token or a personal access token with voice:read and voice:write speaks for.
Package remote is the client of a registry's Writing Voice routes (the core's docs/voice.md): read the account's voice, put a new version for review, and set the account's always-attach flag, for the account a session token or a personal access token with voice:read and voice:write speaks for.
Package writer is the Voice Writer: the QuickAgent package that writes a person's Writing Voice from samples of their writing, embedded in the CLI and run by the runner as a built-in package, the third beside the Knowledge Creator and the Drafter.
Package writer is the Voice Writer: the QuickAgent package that writes a person's Writing Voice from samples of their writing, embedded in the CLI and run by the runner as a built-in package, the third beside the Knowledge Creator and the Drafter.

Jump to

Keyboard shortcuts

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