Salta ai contenuti
AggregaAggrega
Seleziona lingua: Italiano
Questa pagina è stata tradotta automaticamente. Leggi l’originale in inglese.

aggrega plugin

Ispeziona i plugin Wasm che la CLI può risolvere

Sinossi

aggrega plugin

Descrizione

Work with the WebAssembly plugins this CLI can resolve.
All of Aggrega's provider-specific and policy-specific behaviour lives in Wasm
plugins rather than in the binary, so this is where you see which ones are
reachable, add or remove a workspace binding, and check a guest before you
publish it.
Plugins reach the CLI two ways. Some are compiled into the binary and resolve
with no filesystem, cache or network access. The rest are workspace bindings in
.aggrega-config.yaml, resolved through the plugin cascade. "aggrega plugin list"
shows both groups together.
The subcommands below cover the whole life of a binding: list what is reachable,
add and remove bindings, run a local guest export directly, sync the
machine-owned records in a Plugin entity with its .wasm, and generate Plugin
catalog entities from a guest's own metadata.

Sottocomandi

ComandoDescrizione
aggrega plugin addTrova nel registry un plugin del tipo indicato e lo aggiunge
aggrega plugin gen-catalogGenera entità Plugin del catalogo dal describe() del guest più un overlay scritto a mano
aggrega plugin listElenca i plugin che la CLI può risolvere con i loro metadati describe()
aggrega plugin removeRimuove un plugin configurato del tipo indicato
aggrega plugin run-localCarica un guest .wasm locale e chiama uno dei suoi export
aggrega plugin syncSincronizza i record gestiti dalla macchina di un plugin (funzioni host, comandi CLI) nel suo file di entità con il suo .wasm

Descrizione di aggrega plugin add

Find a plugin of the named type in the configured registry and add it to your
configuration.
Examples:
aggrega plugin add cli moo # add the moo command
aggrega plugin add cli moo:0.2.4 # a specific version
aggrega plugin add governance rego --role render-verdict
Arguments:
<type> The plugin socket to add for. One of: provider, governance,
linter, importer, or cli. The governance type requires --role.
<query> The plugin's name, optionally followed by :<version> to add that
version rather than the latest published one. The name is looked
up directly first. Where no plugin of the chosen type has that name,
it is matched as a case-insensitive substring against the plugin
names of that type, which reads the registry's whole catalog and
must resolve to exactly one plugin — otherwise the command lists the
candidates so you can narrow it. A query naming a version is never
matched that way. The provider type takes no version.
What add writes depends on the type:
- A socket type (governance, linter, importer) pins the version the query
names, or else the latest published version, and adds the bare plugin
identity (<type>/<name>:<version>) to the plugins.<type> list. The latest
is never taken from pre-release versions, so a plugin that publishes only
those is added by naming one. A governance entry also records its --role,
one of annotation-transform, label-transform, ir-verdict, or render-verdict.
An importer the plugins.importer list already names keeps its one entry,
moved to the pinned version with its place and what it carries under with.
- The provider type adds a plugins.providers entry naming the plugin by its
bare identity (provider/<name>) with no version; --capability names the
capability the binding serves, preserving existing settings. The version is
the one the Recipe pins, or else the highest available, and the lockfile
records the one a pull chose.
- The cli type fetches the plugin from the registry, verifies it, and caches
its bytes, then pins it into the plugins.cli list as a top-level aggrega
command — no separate pull step. Its resolved reference and the content
digest of the verified bytes are recorded so the command runs those exact
bytes, resolving from the local cache on later runs with no further network
access. A cli plugin defaults to the global config, so its command is
available in every workspace; --workspace pins it to this project instead.
It needs no workspace: run outside one, its bytes are cached in the
machine-wide cache rather than in the folder you ran it in. Its declared
capabilities are confirmed before installing, and --accept-capabilities or
--yes skips that prompt for non-interactive use.
A provider or socket attachment is written to a workspace's own configuration
unless --global is passed, so outside a workspace it is refused before the
registry is reached; so is anything else that can be refused without it.
A provider or socket attachment is configuration you go on editing, so --dry-run
does everything the plain command does except write: it hands back the
configuration the write would have produced, creating and modifying nothing. The
answer names the file that content is for — which matters here, because a
--global attachment targets the config shared across every workspace. A caller
that keeps its own document model puts the content there, where it is visible
before it is saved and can be amended or undone. The registry is still searched,
and for a socket type the version still resolved, since the returned document
carries the identity a write would have written.
Under --dry-run standard output carries that content and nothing else, so it stays
parseable; a version substitution is announced on standard error instead. The cli
type does not accept --dry-run: what it records is the content digest of the bytes
it verified, which is a record the machine maintains rather than content you
edit.

Flag di aggrega plugin add

FlagPredefinitoDescrizione
--accept-capabilitiesfalseAccetta le capability dichiarate di un plugin cli senza il prompt interattivo (solo tipo cli)
--capability—Capability servita dal binding del provider (obbligatoria per il tipo provider e valida solo con esso)
--dry-runfalseFa tutto tranne scrivere: restituisce la configurazione risultante come contenuto, indicando il file a cui è destinata, e non crea né modifica nulla. Senza questo flag l’associazione viene scritta nel file di configurazione risolto. Non accettato con il tipo cli.
--globalfalseScrive l’associazione nella configurazione globale condivisa da tutti i workspace.
--role—Ruolo dell’associazione di governance: annotation-transform, label-transform, ir-verdict o render-verdict (obbligatorio per il tipo governance e valido solo con esso)
--workspacefalseScrive l’associazione nella configurazione del workspace di questo progetto. Un’associazione provider o socket va qui per impostazione predefinita; un plugin cli va per impostazione predefinita nella configurazione globale.
--yesfalseSalta il prompt di conferma delle capability cli per l’uso non interattivo (solo tipo cli)

Descrizione di aggrega plugin gen-catalog

Generate one Plugin entity per selected Wasm guest.
Each entity's contract fields — pluginType, abiVersion, capabilities, exports,
and contract — are derived from the guest's describe() self-report, so the
entity can never promise a capability the binary does not provide. The entity's
identity (metadata.name), runtime limits, and provider block come from an authored
per-plugin overlay; the entity version is the guest's describe() self-report
version. The plugin-level description, when the guest reports one, is emitted as
metadata.description and omitted cleanly when it does not.
Two selection modes:
--from-embedded generate an entity for every guest embedded in this binary.
The overlay path is a directory; each overlay is matched to
a guest by its metadata.name identity, and, where overlays
in several socket directories (<socket>/<name>.yaml)
declare one name, by the directory naming the guest's
socket.
--plugin <f.wasm> generate a single entity for one non-embedded guest. The
overlay path is a single overlay file.
The output is written under <output-dir>/<pluginType>/<name>/<version>/plugin.yaml
and carries a generated-output banner. The leading pluginType segment keeps two
same-named plugins in different sockets apart, since a bare plugin name is unique
only within its own socket. Regenerating over unchanged inputs yields
byte-identical files.
A generated entity is a catalog document you own and go on editing, so --dry-run
does everything gen-catalog does except write: it hands the content back, creating
and modifying nothing, and the answer names the file each document is for. A
caller that keeps its own document model — an editor, for instance — puts the
content there, where it is visible before it is saved and can be amended or
undone. Every other behaviour is the write's — the same guests are read and the
same overlays matched — so a selection gen-catalog would refuse is refused under
--dry-run too. Without the flag the entities are written, because a caller at a
terminal has nowhere better to put them.

Flag di aggrega plugin gen-catalog

FlagPredefinitoDescrizione
--dry-runfalseFa tutto tranne scrivere: restituisce le entità generate come contenuto, indicando il file a cui è destinata ciascuna, e non crea né modifica nulla. Ogni altro comportamento è quello della scrittura, quindi una selezione che la scrittura rifiuterebbe viene rifiutata anche qui. Senza questo flag le entità vengono scritte sotto —output-dir.
--from-embeddedfalsegenera un’entità per ogni guest incorporato in questo binario
--output-dir—directory sotto cui vengono scritte le entità generate (obbligatorio)
--overlay—directory (—from-embedded) o file (—plugin) dell’overlay scritto a mano (obbligatorio)
--plugin—genera una singola entità per il guest .wasm in questo percorso

Descrizione di aggrega plugin list

List every Wasm plugin the CLI can see and, for each, its self-reported
describe() metadata.
Two groups are printed. Embedded built-ins are the provider and linter guests
compiled into the binary; they resolve with no filesystem, cache, or network
access. Configured plugins are the workspace bindings — the provider and linter
bindings and the CLI-extension commands — resolved through the plugin cascade.
Each plugin's type appears in the TYPE column, so a CLI-extension command
(type cli) is legible alongside the socket plugins; a CLI plugin also carries a
status of its own — ready, unresolved, describe-failed, or digest-drift when
its bytes changed since it was pinned at install.
The default output is a scannable table with one row per plugin, showing its
type, name, served capabilities, and version. The output is read-only and
deterministic. A plugin that fails to resolve or describe is listed with its
failure status rather than halting the whole listing.
With -o json, the output is a structured object carrying the full per-plugin
detail — type, name, version, commit, capabilities, input kinds, boundary
assembly, exports, origin, readiness, and any resolve or describe error —
grouped as embedded and configured. It is suitable for programmatic
consumption and documentation generation.

Flag di aggrega plugin list

FlagPredefinitoDescrizione
--output, -otableFormato di output: table|json.

Descrizione di aggrega plugin remove

Remove a configured plugin of the named type from a config file so it no longer
participates.
The type is one of provider, governance, linter, importer, or cli — the same
set 'plugin add' accepts. The query identifies the entry to remove: the plugin's
short name (matched against 'add's short name so remove is symmetric with add),
its full pinned reference, or, for the provider type, the capability the binding
serves. A query that matches nothing halts and leaves the config untouched, so a
typo never silently removes the wrong plugin.
A provider or socket attachment defaults to this project's workspace config; a cli
command defaults to the global config shared across every workspace. --global and
--workspace force the file the removal targets, overriding the default.

Flag di aggrega plugin remove

FlagPredefinitoDescrizione
--globalfalseRimuove dalla configurazione globale condivisa da tutti i workspace.
--workspacefalseRimuove dalla configurazione del workspace di questo progetto. Un’associazione provider o socket va qui per impostazione predefinita; un comando cli va per impostazione predefinita nella configurazione globale.

Descrizione di aggrega plugin run-local

Load a .wasm guest from a filesystem path, call one of its declared
exports with an optional payload, and write the guest's answer to stdout.
The guest is addressed directly by --plugin path; it is not resolved through
the workspace plugin cascade. The export named by --export must be one the
guest advertises in its describe() self-report, or the call is rejected before
the guest runs.
The command has two forms. The artifact form takes no positional argument and
loads the guest bare. The entity form takes a Plugin entity file as its one
positional argument: the entity is schema-validated, and its declared
metadata.pluginType and export contract are cross-checked against the guest's
describe() before the guest runs. In both forms the guest bytes come from
--plugin; the entity carries no artifact path.
The payload is supplied with --with, and it is always written as JSON. A value
beginning with @ reads the payload bytes from a file (--with @input.json); any
other value is taken as a literal inline JSON payload (--with '{"k":1}'). When
--with is omitted, the export receives the minimal empty JSON object {}. The
resolved payload is validated as JSON before the guest runs, so malformed input
is reported up front.
An export a socket calls with a payload reads it in a binary encoding rather
than as JSON; a CLI plugin's cli_run export is the exception, and reads JSON.
Which encoding an export reads is fixed by the socket that export serves, so no
flag selects it: the resolved payload is converted into the encoding the named
export reads before the guest is called. The conversion reads the payload's
shape from the export's name, so it covers each export a socket calls by
default; an entry function an attachment or a pipeline step names under a name
of its own receives the payload as written. The authored payload stays JSON
either way.
The answer is converted the same way in reverse. An export a socket calls
answers in that binary encoding, so its answer is read as the export's output
shape and written to stdout as indented JSON; an answer that is not that shape
is reported as an error naming the export rather than printed. A cli_run
export's answer, and an entry function under a name of its own, are written to
stdout exactly as the guest wrote them. When the guest exits non-zero, what it
wrote is passed through unchanged.
In the artifact form, --type optionally names a plugin type the guest's
describe() self-report must agree with, or the load is rejected before the
guest runs; when omitted, no type expectation is imposed. In the entity form
--type is rejected, because the entity's metadata.pluginType supplies the type.
The guest's clean exit code becomes this command's exit status, so a failure
inside the plugin is distinguishable from a failure of aggrega itself.

Flag di aggrega plugin run-local

FlagPredefinitoDescrizione
--export—l’export dichiarato da chiamare
--plugin—percorso nel filesystem dell’artefatto .wasm
--type—il tipo di plugin a cui deve corrispondere l’auto-descrizione describe() del guest
--with—payload per l’export: JSON inline, oppure @ per leggerlo da un file; se omesso il valore predefinito è {}

Descrizione di aggrega plugin sync

Sync a plugin's machine-owned records in a Plugin entity file with its .wasm.
Two records are not authored by hand: the set of host functions a plugin may
call, derived from the plugin's .wasm import section, and the top-level commands a
CLI plugin contributes, read from the plugin's describe() self-report. Both are
ground truth in the binary. This command reads the .wasm, derives the
host-function set in canonical form and the command mirror in describe()-declared
order, and aligns the entity's spec.runtime.hostFunctions and spec.commands with
them — creating the runtime block when the file has none. Only those blocks
change; every comment, blank line, and other field is preserved byte-for-byte. A
plugin that imports no host functions or contributes no commands records an
explicit empty list, so each field is always present and reviewable.
The write is idempotent: re-running when the records already match the .wasm
leaves the file untouched. Commit the result; publish (aggrega push) then only
verifies the committed records against the .wasm and refuses to publish a file
whose records are out of sync with its binary.

Flag di aggrega plugin sync

FlagPredefinitoDescrizione
--plugin—Percorso dell’artefatto .wasm del plugin i cui import e il cui describe() determinano le funzioni host e i comandi registrati

Cosa fa una voce importer

aggrega plugin add importer scrive l’identità del plugin e l’ultima versione pubblicata per esso, o la versione che indichi come <name>:<version> — importer/<name>:<version> — nell’elenco plugins.importer. Quella voce associa l’importer che indica: un’importazione che richiede un formato dichiarato dall’importer esegue quell’importer, a quella versione, anche quando altri importer del tuo catalogo dichiarano lo stesso formato, e solo a quell’importer viene passato ciò che la voce contiene sotto with. Quale importer trasforma una sorgente in bozze descrive la voce per intero.

Un importer viene associato da una sola voce, quindi aggiungerne uno che l’elenco plugins.importer del file in scrittura indica già — a qualsiasi versione, o tramite un intervallo — non aggiunge una seconda voce. Il comando sposta invece quella voce alla versione che ha risolto: la voce mantiene la sua posizione nell’elenco e tutto ciò che contiene sotto with. Aggiungere un importer alla versione già indicata dalla sua voce lascia la voce com’è.

I comandi di un plugin CLI e i loro flag

A ogni avvio, aggrega aggiunge un comando per ogni comando fornito da un plugin cli configurato, leggendo i comandi e i loro flag dall’auto-descrizione describe() del plugin — dalla cache di describe quando contiene il digest fissato del plugin, e altrimenti interrogando il plugin. Ogni flag dichiarato viene dichiarato sul suo comando, così aggrega help <command> lo elenca come elenca i flag di un comando integrato; il plugin riceve comunque i suoi argomenti senza analisi e legge da sé i propri flag.

Il digest fissato si trova accanto al riferimento del plugin nell’elenco plugins.cli della configurazione, scritto come sha256: seguito da 64 cifre esadecimali minuscole — la grafia che registra aggrega plugin add cli. Un digest scritto in qualsiasi altro modo, per esempio esadecimale nudo senza il prefisso sha256:, viene rifiutato al caricamento del file di configurazione, indicando il file e la voce; finché non viene corretto non viene aggiunto il comando di alcun plugin configurato, e un avviso sullo standard error riporta il rifiuto.

Prima di aggiungere qualsiasi comando di un plugin, aggrega controlla ogni flag dichiarato da ciascuno di essi. Un plugin le cui dichiarazioni non superano il controllo viene saltato: nessuno dei suoi comandi viene aggiunto, un avviso sullo standard error indica il plugin, il comando, il flag e cosa c’è di sbagliato, e ogni altro comando — integrato o di un altro plugin — viene eseguito come di consueto:

warning: CLI plugin "oci://hub.aggrega.ai/plugin/cli/greet:1.2.0" was not added as a command: its command "greet" declares the flag "--verbose" with the shorthand "vv"; a shorthand is a single ASCII letter or digit

Una dichiarazione di flag supera il controllo quando:

  • il flag ha un nome, e nessun altro flag dello stesso comando lo ha;
  • la sua forma abbreviata, se ne ha una, è una singola lettera o cifra ASCII che nessun altro flag dello stesso comando usa;
  • né il suo nome né la sua forma abbreviata riutilizzano un flag che ogni comando aggrega ha già — --help, -h e i flag globali;
  • il suo tipo, se ne dichiara uno, è string, bool o int — un flag senza tipo è un flag stringa;
  • il suo valore predefinito, se ne dichiara uno, è un valore del suo tipo.

Il salto si ripete, con il suo avviso, a ogni invocazione finché la configurazione non fissa una versione del plugin le cui dichiarazioni superano il controllo. I campi di una dichiarazione di flag sono descritti sotto spec.commands nella pagina dell’entità Plugin.

Generare entità e sincronizzare record: due tipi di atto diversi

Due di questi sottocomandi producono un file, e ciò che producono non è dello stesso tipo.

plugin gen-catalog — le entità generate sono tue da modificare

aggrega plugin gen-catalog produce entità Plugin del catalogo. Un’entità è un documento del catalogo: la archivi, la revisioni e continui a modificarla insieme al resto del tuo catalogo. Poiché è contenuto di tua proprietà, il comando può consegnartela anziché metterla su disco.

--dry-run fa tutto ciò che fa gen-catalog tranne scrivere. Restituisce le entità generate come contenuto — non viene creato alcun file né alcuna directory — e ogni documento nella risposta indica il file a cui è destinato, così un chiamante sa dove va ciascuno. Un chiamante che mantiene un proprio modello del documento, come un editor, mette lì il contenuto, dove lo vedi prima che venga salvato e puoi modificarlo o annullarlo. Senza il flag le entità vengono scritte sotto --output-dir, perché un chiamante su un terminale non ha un posto migliore in cui metterle.

Il contenuto restituito e i byte scritti sono lo stesso contenuto: --dry-run restituisce ciò che la scrittura avrebbe prodotto, non un’anteprima assemblata separatamente. Anche ogni altro comportamento è quello della scrittura — vengono letti gli stessi guest, abbinati gli stessi overlay, e --output-dir è obbligatorio in entrambi i casi, perché ogni documento restituito indica comunque il file a cui è destinato e quel percorso è composto a partire da esso.

Ogni entità viene composta e convalidata prima che ne venga consegnata una qualsiasi, quindi un’esecuzione produce l’intero insieme oppure nulla. Un overlay che arresta la generazione — uno mancante, o la cui identità non corrisponde al guest con cui viene unito — non lascia alcun output scritto a metà da ripulire.

plugin sync — i record gestiti dalla macchina sono del compilatore

aggrega plugin sync allinea i record gestiti dalla macchina di un plugin al suo modulo: l’insieme delle funzioni host ricavato dalla sezione di import del modulo e il riflesso dei comandi letto dall’auto-descrizione del plugin stesso. Entrambi sono verità di fatto nel binario anziché valori scelti da qualcuno.

Scrive sempre e non offre alcun --dry-run. Questo vale anche se scrive all’interno di un file di entità che hai scritto tu — il confine è tracciato sul contenuto, non sul file. I record che il compilatore mantiene su sé stesso non sono tuoi da modificare, quindi non c’è nulla da revisionare prima che vengano applicati; il documento circostante resta intatto byte per byte, e cambiano solo quei blocchi.