Ir al contenido
AggregaAggrega
Seleccionar idioma: Español
Esta página se tradujo automáticamente. Lee el original en inglés.

aggrega plugin

Inspeccionar los plugins Wasm que la CLI puede resolver

Sinopsis

aggrega plugin

Descripción

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.

Subcomandos

ComandoDescripción
aggrega plugin addEncontrar en el registry un plugin del tipo indicado y añadirlo
aggrega plugin gen-catalogGenerar entidades Plugin del catálogo a partir del describe() del guest más un overlay escrito a mano
aggrega plugin listListar los plugins que la CLI puede resolver con sus metadatos de describe()
aggrega plugin removeEliminar un plugin configurado del tipo indicado
aggrega plugin run-localCargar un guest .wasm local y llamar a uno de sus exports
aggrega plugin syncSincronizar los registros gestionados por la máquina de un plugin (funciones del host, comandos de la CLI) en su archivo de entidad con su .wasm

Descripción de 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.

Flags de aggrega plugin add

FlagPredeterminadoDescripción
--accept-capabilitiesfalseAceptar las capabilities declaradas de un plugin cli sin la pregunta interactiva (solo tipo cli)
--capability—Capability que sirve el binding de provider (obligatoria para el tipo provider, y válida solo con él)
--dry-runfalseHacer todo excepto escribir: devolver la configuración resultante como contenido, nombrando el archivo al que está destinada, y no crear ni modificar nada. Sin este flag, la vinculación se escribe en el archivo de configuración resuelto. No se acepta con el tipo cli.
--globalfalseEscribir la vinculación en la configuración global compartida por todos los workspaces.
--role—Rol de la vinculación de gobernanza: annotation-transform, label-transform, ir-verdict o render-verdict (obligatorio para el tipo governance, y válido solo con él)
--workspacefalseEscribir la vinculación en la configuración del workspace de este proyecto. Una vinculación provider o socket va aquí de forma predeterminada; un plugin cli va de forma predeterminada a la configuración global.
--yesfalseOmitir la pregunta de confirmación de capabilities cli para uso no interactivo (solo tipo cli)

Descripción de 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.

Flags de aggrega plugin gen-catalog

FlagPredeterminadoDescripción
--dry-runfalseHacer todo excepto escribir: devolver las entidades generadas como contenido, nombrando el archivo al que está destinada cada una, y no crear ni modificar nada. Cualquier otro comportamiento es el de la escritura, así que una selección que la escritura rechazaría también se rechaza aquí. Sin este flag, las entidades se escriben bajo —output-dir.
--from-embeddedfalsegenerar una entidad para cada guest integrado en este binario
--output-dir—directorio bajo el que se escriben las entidades generadas (obligatorio)
--overlay—directorio (—from-embedded) o archivo (—plugin) del overlay escrito a mano (obligatorio)
--plugin—generar una sola entidad para el guest .wasm en esta ruta

Descripción de 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.

Flags de aggrega plugin list

FlagPredeterminadoDescripción
--output, -otableFormato de salida: table|json.

Descripción de 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.

Flags de aggrega plugin remove

FlagPredeterminadoDescripción
--globalfalseEliminar de la configuración global compartida por todos los workspaces.
--workspacefalseEliminar de la configuración del workspace de este proyecto. Una vinculación provider o socket va aquí de forma predeterminada; un comando cli va de forma predeterminada a la configuración global.

Descripción de 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.

Flags de aggrega plugin run-local

FlagPredeterminadoDescripción
--export—el export declarado al que llamar
--plugin—ruta del sistema de archivos al artefacto .wasm
--type—el tipo de plugin con el que debe coincidir la autodescripción describe() del guest
--with—payload para el export: JSON en línea, o @ para leerlo de un archivo; si se omite, el valor predeterminado es {}

Descripción de 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.

Flags de aggrega plugin sync

FlagPredeterminadoDescripción
--plugin—Ruta al artefacto .wasm del plugin cuyos imports y describe() determinan las funciones del host y los comandos registrados

Qué hace una entrada de importer

aggrega plugin add importer escribe la identidad del plugin y la última versión publicada para él, o la versión que indiques como <name>:<version> —importer/<name>:<version>— en la lista plugins.importer. Esa entrada vincula el importer que nombra: una importación que pide un formato que anuncia el importer ejecuta ese importer, en esa versión, aunque otros importers de tu catálogo anuncien también el formato, y solo a ese importer se le pasa lo que la entrada lleva bajo with. Qué importer convierte una fuente en borradores describe la entrada por completo.

Un importer se vincula mediante una sola entrada, así que añadir uno que la lista plugins.importer del archivo que se escribe ya nombra —en cualquier versión, o mediante un rango— no añade una segunda entrada. En su lugar, el comando mueve esa entrada a la versión que resolvió: la entrada conserva su lugar en la lista y todo lo que lleva bajo with. Añadir un importer en la versión que ya nombra su entrada deja la entrada como está.

Los comandos de un plugin de CLI y sus flags

Cada vez que aggrega se inicia, añade un comando por cada comando que aporta un plugin cli configurado, leyendo los comandos y sus flags de la autodescripción describe() del plugin: de la caché de describe cuando contiene el digest fijado del plugin, y si no, consultando al plugin. Cada flag declarado se declara en su comando, de modo que aggrega help <command> lo lista igual que lista los flags de un comando integrado; el plugin sigue recibiendo sus argumentos sin analizar y lee sus propios flags.

El digest fijado está junto a la referencia del plugin en la lista plugins.cli de la configuración, escrito como sha256: seguido de 64 dígitos hexadecimales en minúscula, la grafía que registra aggrega plugin add cli. Un digest escrito de cualquier otra forma, como hexadecimal sin más y sin el prefijo sha256:, se rechaza al cargar el archivo de configuración, nombrando el archivo y la entrada; hasta que se corrija no se añade el comando de ningún plugin configurado, y una advertencia en la salida de error estándar lleva el rechazo.

Antes de añadir cualquiera de los comandos de un plugin, aggrega comprueba cada flag que declara cada uno de ellos. Un plugin cuyas declaraciones no superan la comprobación se omite: no se añade ninguno de sus comandos, una advertencia en la salida de error estándar nombra el plugin, el comando, el flag y qué tiene de incorrecto, y cualquier otro comando —integrado o de otro plugin— se ejecuta como de costumbre:

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 declaración de flag supera la comprobación cuando:

  • el flag tiene un nombre, y ningún otro flag del mismo comando lo tiene;
  • su forma abreviada, si tiene una, es una sola letra o dígito ASCII que no usa ningún otro flag del mismo comando;
  • ni su nombre ni su forma abreviada reutilizan un flag que ya tiene cada comando aggrega: --help, -h y los flags globales;
  • su tipo, si declara uno, es string, bool o int; un flag sin tipo es un flag de cadena;
  • su valor predeterminado, si declara uno, es un valor de su tipo.

La omisión se repite, con su advertencia, en cada invocación hasta que la configuración fije una versión del plugin cuyas declaraciones superen la comprobación. Los campos que lleva una declaración de flag se describen en spec.commands en la página de la entidad Plugin.

Generar entidades y sincronizar registros: dos tipos de acto distintos

Dos de estos subcomandos producen un archivo, y lo que producen no es el mismo tipo de cosa.

plugin gen-catalog: las entidades generadas son tuyas para editarlas

aggrega plugin gen-catalog produce entidades Plugin del catálogo. Una entidad es un documento del catálogo: la archivas, la revisas y sigues editándola junto con el resto de tu catálogo. Como es contenido que te pertenece, el comando puede entregártelo en lugar de escribirlo en el disco.

--dry-run hace todo lo que hace gen-catalog excepto escribir. Devuelve las entidades generadas como contenido —no se crea ningún archivo ni ningún directorio— y cada documento de la respuesta nombra el archivo al que está destinado, de modo que quien llama sabe adónde va cada uno. Quien llama y mantiene su propio modelo de documento, como un editor, coloca allí el contenido, donde lo ves antes de que se guarde y puedes modificarlo o deshacerlo. Sin el flag, las entidades se escriben bajo --output-dir, porque quien llama desde un terminal no tiene un sitio mejor donde ponerlas.

El contenido devuelto y los bytes escritos son el mismo contenido: --dry-run devuelve lo que habría producido la escritura, no una vista previa montada por separado. Cualquier otro comportamiento también es el de la escritura: se leen los mismos guests, se emparejan los mismos overlays y --output-dir es obligatorio en ambos casos, porque cada documento devuelto sigue nombrando el archivo al que está destinado y esa ruta se compone a partir de él.

Cada entidad se compone y se valida antes de entregar ninguna, así que una ejecución produce el conjunto completo o no produce nada. Un overlay que detiene la generación —uno que falta, o cuya identidad no coincide con el guest con el que se combina— no deja ninguna salida escrita a medias que limpiar.

plugin sync: los registros gestionados por la máquina son del compilador

aggrega plugin sync pone al día los registros gestionados por la máquina de un plugin con su módulo: el conjunto de funciones del host derivado de la sección de imports del módulo y el reflejo de comandos leído de la propia autodescripción del plugin. Ambos son la verdad que contiene el binario, no valores que alguien elija.

Siempre escribe y no ofrece --dry-run. Esto se mantiene aunque escriba dentro de un archivo de entidad que tú escribiste: la línea se traza sobre el contenido, no sobre el archivo. Los registros que el compilador mantiene sobre sí mismo no son tuyos para editarlos, así que no hay nada que revisar antes de que se apliquen; el documento que los rodea queda intacto byte a byte, y solo cambian esos bloques.