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
- Variables
- func Reference() string
- func Schema() ([]byte, error)
- type Answer
- type AnswerField
- type Codec
- type Command
- type Compiled
- type Delivery
- type DraftKind
- type Duration
- type Effect
- type Event
- type Fact
- type Job
- type Manifest
- type Named
- type Predicate
- type Role
- type Situation
- type Source
- type SourceVocabulary
- type Tool
- type UI
- type UIBucket
- type UIFacet
- type UIKey
- type UIMenu
- type UIView
Constants ¶
const File = "plugin.toml"
File is the manifest's name in a plugin's directory.
const SchemaID = "https://github.com/wloophq/wloop/plugin.schema.json"
SchemaID is the $id of plugin.toml's JSON schema.
const SourceKind plugin.Kind = "source"
SourceKind is the kind whose table Source decodes.
Variables ¶
var FactTypes = []string{"bool", "int", "string", "list", "duration", "timestamp"}
FactTypes are the types a fact declares.
Functions ¶
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.
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.
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."`
}
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."`
}
DraftKind is a kind of a plugin's drafts.
type Duration ¶
Duration is a Go duration spelled as text, such as "5m".
func (Duration) MarshalText ¶
func (*Duration) UnmarshalText ¶
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
// contains filtered or unexported fields
}
Manifest is a validated plugin.toml.
func Parse ¶
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.
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 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."`
}
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 */
}
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"`
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. |