manifest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package manifest reads and validates a plugin's plugin.toml: its id, the kinds its binary serves, the protocol version it speaks and one table per kind, whose contents the kind's SDK package defines and decodes.

Index

Constants

View Source
const File = "plugin.toml"

File is the manifest's name in a plugin's directory.

View Source
const SchemaID = "https://github.com/wloophq/wloop/plugin.schema.json"

SchemaID is the $id of plugin.toml's JSON schema.

View Source
const SourceKind plugin.Kind = "source"

SourceKind is the kind whose table Source decodes.

Variables

View Source
var FactTypes = []string{"bool", "int", "string", "list", "duration", "timestamp"}

FactTypes are the types a fact declares.

Functions

func Reference

func Reference() string

Reference is the reference page of plugin.toml, in Markdown.

func Schema

func Schema() ([]byte, error)

Schema is the JSON schema of plugin.toml.

Types

type Answer

type Answer struct {
	Name   string        `toml:"name" doc:"The answer's name. Required."`
	Doc    string        `toml:"doc" doc:"When the tool answers it. Required."`
	Fields []AnswerField `toml:"fields" doc:"The fields its wording reads."`
}

Answer is one answer of a tool, worded by tools.toml.

type AnswerField

type AnswerField struct {
	Name   string `toml:"name" doc:"The field's name, as the template reads it. Required."`
	Number bool   `toml:"number" doc:"The field is a number; otherwise text."`
}

AnswerField is a field an answer's wording reads.

type Codec

type Codec struct {
	Keys      []string          `` /* 129-byte string literal not displayed */
	URLs      []string          `` /* 183-byte string literal not displayed */
	Label     string            `toml:"label" doc:"The template of the unit as a person reads it; empty, or a field the key lacks, reads the key."`
	Fields    map[string]string `toml:"fields" doc:"The pattern of a field, by name, as a Go regular expression."`
	FoldCase  bool              `toml:"fold_case" doc:"Two keys that differ only in case name the same unit."`
	Target    string            `toml:"target" doc:"How a command line names a unit, such as \"<url>\"."`
	TargetsRe string            `toml:"targets" doc:"The pattern a draft target this plugin posts to matches, as a Go regular expression; empty takes none."`
}

Codec is how a source plugin's unit keys and web addresses are spelled. Templates name fields in braces; a field matches its pattern in Fields, or a run of characters other than "/", "?", "#" and white space.

func (Codec) Compile

func (c Codec) Compile() (*Compiled, error)

Compile checks c's templates and patterns.

type Command

type Command struct {
	Name  string `toml:"name" doc:"The command's name, after the plugin's id on the command line. Required."`
	Usage string `toml:"usage" doc:"The command's arguments, as its help shows them."`
}

Command is a command of the plugin binary in CLI mode.

type Compiled

type Compiled struct {
	// contains filtered or unexported fields
}

Compiled is a Codec ready to read keys and addresses, which the host uses for a plugin's units whether or not the plugin runs.

func (*Compiled) Equal

func (c *Compiled) Equal(a, b string) bool

Equal says whether keys a and b name the same unit.

func (*Compiled) KeyOf

func (c *Compiled) KeyOf(url string) (string, bool)

KeyOf is the key an address names; false for an address of no unit.

func (*Compiled) Label

func (c *Compiled) Label(key string) string

Label is key as a person reads it.

func (*Compiled) Takes

func (c *Compiled) Takes(target string) bool

Takes says whether the plugin posts drafts to target.

func (*Compiled) URL

func (c *Compiled) URL(key string) string

URL is the web address of key; "" for a key with none.

func (*Compiled) Valid

func (c *Compiled) Valid(key string) error

Valid says why key is not a unit key of the codec.

type Delivery

type Delivery struct {
	Name  string `toml:"name" doc:"The delivery's name, such as \"comment\". Required."`
	Posts bool   `toml:"posts" doc:"A draft with this delivery reaches people, so it waits for approval."`
	Emoji bool   `toml:"emoji" doc:"A draft with this delivery adds or removes an emoji, named by its reaction, and has no text."`
}

Delivery is how a source plugin posts a draft.

type DraftKind

type DraftKind struct {
	Name         string          `toml:"name" doc:"The kind's name, such as \"nudge\". Required."`
	Purpose      string          `toml:"purpose" doc:"What a draft of the kind is for; empty is its name."`
	Delivery     string          `toml:"delivery" doc:"How it is posted, one of deliveries; empty is default_delivery."`
	Schema       string          `` /* 172-byte string literal not displayed */
	Preview      string          `` /* 192-byte string literal not displayed */
	Basis        string          `` /* 177-byte string literal not displayed */
	TextRequired bool            `toml:"text_required" doc:"A draft of the kind needs a text."`
	Editable     []string        `` /* 131-byte string literal not displayed */
	Facts        []DraftKindFact `toml:"facts" doc:"The payload fields an approval rule reads."`
	Verdict      string          `` /* 209-byte string literal not displayed */
	// Verdicts are the values of the enum Verdict points to, which Source reads from the schema.
	Verdicts []string `toml:"-"`
	// SchemaJSON is the content of Schema, which Source reads from the
	// plugin's directory.
	SchemaJSON json.RawMessage `toml:"-"`
}

DraftKind is a kind of a plugin's drafts.

type DraftKindFact added in v0.5.0

type DraftKindFact struct {
	Name    string `toml:"name" doc:"The fact's name, draft.<provider>.<kind>.<field>. Required."`
	Pointer string `toml:"pointer" doc:"The JSON pointer to the field in the payload, which the schema makes a required string enum. Required."`
}

DraftKindFact is a payload field of a draft kind read as an approval fact.

type Duration

type Duration time.Duration

Duration is a Go duration spelled as text, such as "5m".

func (Duration) MarshalText

func (d Duration) MarshalText() ([]byte, error)

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(b []byte) error

type Effect

type Effect struct {
	Name    string   `toml:"name" doc:"The effect's name, <slot>.<name>. Required."`
	Applies []string `toml:"applies" doc:"What may carry it. Required." enum:"turn,draft"`
	Doc     string   `toml:"doc" doc:"What the effect does. Required."`
	Silent  bool     `` /* 133-byte string literal not displayed */
}

Effect is a turn or draft effect a source plugin applies.

type Event

type Event struct {
	Name             string `toml:"name" doc:"The event kind. Required."`
	Doc              string `toml:"doc" doc:"What happened. Required."`
	Resolves         string `toml:"resolves" doc:"The link event the host's resolver reads it as." enum:"review,merged,closed"`
	AnswersAskedTurn bool   `toml:"answers_asked_turn" doc:"The event answers the turn that asked for it, which my_review reconciles with."`
	// Verdicts are the record verdicts of an answering event's states.
	Verdicts map[string]string `` /* 165-byte string literal not displayed */
}

Event is an event kind only a plugin's units record.

type Fact

type Fact struct {
	Name        string   `toml:"name" doc:"The fact's name, <slot>.<name>. Required."`
	Type        string   `toml:"type" doc:"The fact's type. Required." enum:"bool,int,string,list,duration,timestamp"`
	Doc         string   `toml:"doc" doc:"What the fact says, for the reference pages. Required."`
	Slots       []string `toml:"slots" doc:"Where the fact is read besides the workflows." enum:"action,turn,name"`
	Dim         bool     `toml:"dim" doc:"The fact is a profile dimension."`
	Enum        []string `toml:"enum" doc:"The values the fact takes; empty takes any."`
	Untrusted   bool     `toml:"untrusted" doc:"A third party's text sets the fact, so no approval rule reads it."`
	TimeVarying bool     `toml:"time_varying" doc:"The fact changes with time alone: the plugin reports it as a temporal value."`
}

Fact is a workflow fact a source plugin reports.

type Job

type Job struct {
	Name      string   `toml:"name" doc:"The job's name, which Ingest receives. Required."`
	Every     Duration `toml:"every" doc:"How often the job runs, as a Go duration, unless every_from is set. Required."`
	EveryFrom string   `` /* 165-byte string literal not displayed */
	Timeout   Duration `toml:"timeout" doc:"A run's limit, as a Go duration; empty is the host's default."`
	Retry     Duration `toml:"retry" doc:"The first wait after a failed run, as a Go duration, doubling up to every; empty backs off from every."`
}

Job is a job the host schedules and runs through Ingest.

type Manifest

type Manifest struct {
	// ID is the plugin's id; a source plugin's units carry it as provider.
	ID string
	// Kinds are the kinds the plugin's binary serves.
	Kinds []plugin.Kind
	// Protocol is the plugin protocol version the binary speaks.
	Protocol int
	// Dir is the directory Load read the manifest from, empty after Parse.
	Dir string
	// Files is the plugin's directory, which holds the files the manifest
	// names, such as its draft kinds' schemas; Load sets it to Dir, and a
	// caller of Parse sets it before Source reads them.
	Files fs.FS
	// contains filtered or unexported fields
}

Manifest is a validated plugin.toml.

func Load

func Load(dir string) (*Manifest, error)

Load reads and validates dir's plugin.toml.

func Parse

func Parse(raw []byte) (*Manifest, error)

Parse validates a plugin.toml's content. Every top-level key is id, kinds, protocol or the table of a declared kind; every declared kind has a table.

func (*Manifest) Decode

func (m *Manifest) Decode(kind plugin.Kind, v any) error

Decode decodes the table of kind into v, refusing a key v does not read.

func (*Manifest) Source

func (m *Manifest) Source() (*Source, error)

Source decodes and validates m's [source] table, and compiles its codec.

type Named

type Named struct {
	Name string `toml:"name" doc:"The name. Required."`
	Doc  string `toml:"doc" doc:"What it means. Required."`
}

Named is a name the plugin declares, with what it means.

type Predicate added in v0.4.0

type Predicate struct {
	Name  string   `toml:"name" doc:"The predicate's name, its key in predicates.toml. Required."`
	Doc   string   `toml:"doc" doc:"What the predicate decides. Required."`
	Facts []string `toml:"facts" doc:"The facts of facts the plugin hands with each question, the only ones the predicate may read. Required."`
}

Predicate is a predicate the plugin's profile layer sets, over the facts the plugin hands the host when it asks whether it holds.

type Role

type Role struct {
	Name      string `toml:"name" doc:"The role's name. Required."`
	Doc       string `toml:"doc" doc:"What the role's turns do. Required."`
	RoundKind string `toml:"round_kind" doc:"The sweep round its turns are, such as \"review\"."`
	Reconcile string `toml:"reconcile" doc:"The host reconcile its turns run, such as \"my_review\"."`
	Prepare   string `toml:"prepare" doc:"The host prepare its turns run, such as \"action:nudge.prepare\"."`
	Launch    string `toml:"launch" doc:"The host launch its turns run, such as \"probe\"."`
	Workspace string `toml:"workspace" doc:"The workspace builtin its turns run in; empty is any."`
	Context   string `toml:"context" doc:"What its turns are about."`
	Policy    string `toml:"policy" doc:"The agent policy of its sessions."`
	DrivesRow bool   `toml:"drives_row" doc:"Its turns drive the row of the workspace they run in."`
}

Role binds an intent to host mechanisms, each by its host name.

type Session added in v0.5.0

type Session struct {
	WriteCommands []string `` /* 266-byte string literal not displayed */
}

Session is what the plugin tells the host about the agent sessions it serves.

type Situation

type Situation struct {
	Name string `toml:"name" doc:"The situation's kind. Required."`
	Doc  string `toml:"doc" doc:"What the unit waits on. Required."`
	Rank int    `toml:"rank" doc:"Its order among the plugin's situations, lowest first; 0 is its place among the declarations."`
}

Situation is a situation a plugin derives.

type Source

type Source struct {
	// Name is how a person reads the plugin's service.
	Name  string `toml:"name" doc:"How a person reads the plugin's service, such as \"GitHub\". Required."`
	Codec Codec  `toml:"codec" doc:"How the plugin's unit keys and addresses are spelled. Required."`
	SourceVocabulary
	Jobs        []Job     `toml:"jobs" doc:"The jobs the host runs on the plugin through Ingest, by name."`
	ConfigReads []string  `` /* 188-byte string literal not displayed */
	Notify      []string  `` /* 178-byte string literal not displayed */
	UI          *UI       `toml:"ui" doc:"What clients show of the plugin; every label lives in its profile layer."`
	Commands    []Command `toml:"commands" doc:"The commands the plugin binary serves in CLI mode, which run without the daemon."`
	Tools       []Tool    `toml:"tools" doc:"The MCP tools the plugin serves through CallTool."`
	Session     Session   `toml:"session" doc:"What the agent sessions of an intent that sets source_writes = false may not run."`
}

Source is the [source] table of a source plugin's manifest.

type SourceVocabulary

type SourceVocabulary struct {
	// Provider is the plugin's id, the provider of its units; Source sets it
	// from the manifest.
	Provider string `toml:"-"`

	Slot              string      `toml:"slot" doc:"The workflow fact slot of the plugin's units, such as \"pr\"; every fact name starts with it. Required."`
	BriefSubject      bool        `toml:"brief_subject" doc:"The plugin's units may have a brief, whose facts their workflows read."`
	Rounds            bool        `toml:"rounds" doc:"The plugin's units count automatic turns per unit, against turns.per_unit_per_day."`
	Payload           string      `toml:"payload" doc:"The template root of the plugin's turn payload, such as \"PR\", which only intents of the plugin read."`
	Facts             []Fact      `toml:"facts" doc:"The workflow facts the plugin reports."`
	Effects           []Effect    `toml:"effects" doc:"The turn and draft effects the plugin applies through ApplyEffect."`
	Events            []Event     `toml:"events" doc:"The event kinds only the plugin's units record."`
	Roles             []Role      `toml:"roles" doc:"The roles an intent of the plugin may take, each naming host mechanisms."`
	RowKinds          []string    `toml:"row_kinds" doc:"The values of row.kind on the plugin's rows."`
	Deliveries        []Delivery  `toml:"deliveries" doc:"How the plugin posts drafts."`
	DraftKinds        []DraftKind `toml:"draft_kinds" doc:"The kinds of the plugin's drafts; the host derives a draft's delivery from its kind."`
	DefaultDelivery   string      `toml:"default_delivery" doc:"The delivery of a draft whose kind names none; one of deliveries."`
	Signals           []Named     `toml:"signals" doc:"The link signals the plugin reports, read as task.link_signal.<name>."`
	Predicates        []Predicate `` /* 157-byte string literal not displayed */
	Marks             []Named     `` /* 144-byte string literal not displayed */
	Kinds             []string    `toml:"kinds" doc:"The task kind values the plugin's units give their tasks."`
	Situations        []Situation `toml:"situations" doc:"The situations the plugin derives, in the order the cockpit ranks them."`
	Steps             []string    `toml:"steps" doc:"The core workflow steps that run on the plugin's units, such as \"turn.dismiss\"."`
	LanguageFact      string      `` /* 182-byte string literal not displayed */
	MembersFact       string      `` /* 263-byte string literal not displayed */
	PostedFact        string      `` /* 266-byte string literal not displayed */
	ReactionsFact     string      `` /* 284-byte string literal not displayed */
	UnmentionableFact string      `` /* 288-byte string literal not displayed */
}

SourceVocabulary is what a source plugin adds to the host's tables before the profile loads.

type Tool

type Tool struct {
	Name     string   `toml:"name" doc:"The tool's name; its description lives in the profile's tools.toml. Required."`
	Doc      string   `toml:"doc" doc:"What the tool does, for the reference pages. Required."`
	Input    string   `toml:"input" doc:"The JSON schema of the tool's arguments, an object. Required."`
	Posts    string   `toml:"posts" doc:"The tool posts at once, recorded as a sent draft; empty posts nothing." enum:"now"`
	Proposes bool     `toml:"proposes" doc:"The tool only proposes drafts the user approves, so a session policy may allow it without a prompt."`
	Reads    bool     `toml:"reads" doc:"The tool only reads the source, writing nothing to it, so a session policy may allow it without a prompt."`
	Answers  []Answer `toml:"answers" doc:"The answers the tool returns, which tools.toml words."`
}

Tool is an MCP tool the plugin serves.

type UI

type UI struct {
	Views   []UIView  `toml:"views" doc:"The plugin's views."`
	Facets  []UIFacet `toml:"facets" doc:"The facets of the plugin's rows, whose values a snapshot reports."`
	Menubar []UIMenu  `toml:"menubar" doc:"The menu bar's sections of the plugin."`
	Keys    []UIKey   `toml:"keys" doc:"The plugin's key bindings."`
	Web     string    `toml:"web" doc:"A directory of the plugin the host serves under /plugins/<id>/, with no call to the plugin."`
}

UI is what clients show of a source plugin. Labels and notification bodies live in the plugin's profile layer.

type UIBucket

type UIBucket struct {
	ID     string   `toml:"id" doc:"The bucket's id. Required."`
	Within Duration `` /* 181-byte string literal not displayed */
}

UIBucket is an age bucket of a time facet: the values younger than Within, the first bucket that covers one winning. A negative Within reads a value in the future; the last bucket may leave it unset to catch the rest.

type UIFacet

type UIFacet struct {
	ID    string   `toml:"id" doc:"The facet's id. Required."`
	Field string   `toml:"field" doc:"What it reads: row.*, item.* or <provider>.*."`
	Group bool     `toml:"group" doc:"Rows may be grouped by it."`
	Sort  string   `toml:"sort" doc:"How its values sort." enum:"rank,text,time"`
	Rank  []string `toml:"rank" doc:"Its values in order, with sort = rank."`
	// Buckets group a time facet's values by age; each bucket's label lives
	// in the profile layer.
	Buckets []UIBucket `toml:"buckets" doc:"The age buckets of a time facet, youngest first; only with sort = time."`
	Match   string     `toml:"match" doc:"How a filter matches a value; empty is exact." enum:"exact,suffix,prefix,team"`
	Menu    bool       `toml:"menu" doc:"It shows in the filter menu."`
	// Strip colors each row's strip by the facet's first value, its legend
	// the facet's rank; at most one facet of a plugin is the strip's.
	Strip bool `toml:"strip" doc:"Each row's strip is colored by its value, and its rank is the strip's legend; at most one facet."`
}

UIFacet is a facet of a plugin's rows.

type UIKey

type UIKey struct {
	Key     string `toml:"key" doc:"The key. Required."`
	Action  string `toml:"action" doc:"The action it runs. Required."`
	Surface string `toml:"surface" doc:"Where it binds; empty is every surface." enum:"web,tui,menubar"`
}

UIKey binds a key to an action.

type UIMenu

type UIMenu struct {
	ID   string `toml:"id" doc:"The section's id. Required."`
	View string `toml:"view" doc:"The view it shows. Required."`
}

UIMenu is a menu bar section showing a view.

type UIView

type UIView struct {
	ID       string   `toml:"id" doc:"The view's id, unique across plugins. Required."`
	Rows     bool     `toml:"rows" doc:"A list of rows filtered by a snapshot's views; otherwise a custom view served by View."`
	Order    int      `toml:"order" doc:"Its order among the views."`
	Surfaces []string `toml:"surfaces" doc:"Where it shows." enum:"web,tui,menubar"`
}

UIView is a view of a plugin.

Directories

Path Synopsis
cmd
manifestdoc command
Command manifestdoc writes plugin.toml's JSON schema and reference page from package manifest; make docs-ref runs it from the repository root.
Command manifestdoc writes plugin.toml's JSON schema and reference page from package manifest; make docs-ref runs it from the repository root.

Jump to

Keyboard shortcuts

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