تخطَّ إلى المحتوى
AggregaAggregaAggregaAggrega
اختر لغة: العربية
تُرجمت هذه الصفحة آليًا. اقرأ الأصل الإنجليزي.

aggrega plugin

فحص مكوِّنات Wasm الإضافية التي يستطيع CLI حلها

الصيغة العامة

aggrega plugin

الوصف

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.

الأوامر الفرعية

الأمرالوصف
aggrega plugin addابحث عن مكوِّن إضافي من النوع المسمّى في registry وأضفه
aggrega plugin gen-catalogولّد كيانات Plugin للكتالوج من describe() الخاص بوحدة guest مع تراكب مؤلَّف
aggrega plugin listاسرد المكوِّنات الإضافية التي يستطيع CLI حلّها مع بيانات describe() الخاصة بها
aggrega plugin removeأزل مكوِّنًا إضافيًا مكوَّنًا من النوع المسمّى
aggrega plugin run-localحمّل guest محليًا من ملف .wasm واستدعِ أحد تصديراته
aggrega plugin syncزامن السجلات التي تملكها الآلة في مكوِّن إضافي (دوال المضيف، وأوامر CLI) في ملف كيانه مع ملف .wasm الخاص به

وصف 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.

علامات aggrega plugin add

العلامةالافتراضيالوصف
--accept-capabilitiesfalseاقبل القدرات التي يعلنها مكوِّن cli إضافي دون المطالبة التفاعلية (للنوع cli فقط)
--capability—القدرة التي يخدمها ربط الموفِّر (مطلوبة للنوع provider ولا تصلح إلا معه)
--dry-runfalseنفّذ كل شيء إلا الكتابة: أعِد التكوين الناتج بوصفه محتوى مع تسمية الملف الذي هو له، ولا تنشئ شيئًا ولا تعدّله. وبدونه يُكتب الإرفاق في ملف التكوين المحلول. ولا يُقبل مع النوع cli.
--globalfalseاكتب الإرفاق في التكوين العام المشترك بين كل مساحات العمل.
--role—دور إرفاق الحوكمة: annotation-transform أو label-transform أو ir-verdict أو render-verdict (مطلوب للنوع governance ولا يصلح إلا معه)
--workspacefalseاكتب الإرفاق في تكوين مساحة عمل هذا المشروع. يكون هذا افتراضيًا لإرفاق موفِّر أو مقبس؛ أما مكوِّن cli إضافي فافتراضيه التكوين العام.
--yesfalseتجاوز مطالبة تأكيد قدرات cli للاستخدام غير التفاعلي (للنوع cli فقط)

وصف 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.

علامات aggrega plugin gen-catalog

العلامةالافتراضيالوصف
--dry-runfalseنفّذ كل شيء إلا الكتابة: أعِد الكيانات المولَّدة بوصفها محتوى مع تسمية الملف الذي هو لكل منها، ولا تنشئ شيئًا ولا تعدّله. وكل سلوك آخر هو سلوك الكتابة، لذا يُرفض هنا أيضًا الاختيار الذي سترفضه الكتابة. وبدونه تُكتب الكيانات تحت —output-dir.
--from-embeddedfalseولّد كيانًا لكل guest مضمَّن في هذا الملف الثنائي
--output-dir—الدليل الذي تُكتب تحته الكيانات المولَّدة (مطلوب)
--overlay—دليل التراكب المؤلَّف (—from-embedded) أو ملفه (—plugin) (مطلوب)
--plugin—ولّد كيانًا واحدًا لوحدة guest بصيغة .wasm في هذا المسار

وصف 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.

علامات aggrega plugin list

العلامةالافتراضيالوصف
--output, -otableصيغة الإخراج: table|json.

وصف 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.

علامات aggrega plugin remove

العلامةالافتراضيالوصف
--globalfalseأزل من التكوين العام المشترك بين كل مساحات العمل.
--workspacefalseأزل من تكوين مساحة عمل هذا المشروع. يكون هذا افتراضيًا لإرفاق موفِّر أو مقبس؛ أما أمر cli فافتراضيه التكوين العام.

وصف 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.

علامات aggrega plugin run-local

العلامةالافتراضيالوصف
--export—التصدير المعلَن المراد استدعاؤه
--plugin—مسار نظام الملفات إلى مُخرَج .wasm
--type—نوع المكوِّن الإضافي الذي يجب أن يطابقه التقرير الذاتي describe() الخاص بوحدة guest
--with—الحمولة للتصدير: JSON مضمَّن، أو @ للقراءة من ملف؛ وافتراضيها {} عند حذفها

وصف 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.

علامات aggrega plugin sync

العلامةالافتراضيالوصف
--plugin—مسار مُخرَج .wasm الخاص بالمكوِّن الإضافي الذي تحدد استيراداته و describe() دوال المضيف والأوامر المسجَّلة

ما يفعله إدخال مستورِد

يكتب aggrega plugin add importer هوية المكوِّن الإضافي وأحدث إصدار طُرح له، أو الإصدار الذي تسمّيه بصيغة <name>:<version> — importer/<name>:<version> — في قائمة plugins.importer. وذلك الإدخال يُرفق المستورِد الذي يسمّيه: فالاستيراد الذي يطلب صيغة يعلنها المستورِد يشغّل ذلك المستورِد، بذلك الإصدار، حتى حيث تعلن مستورِدات أخرى في كتالوجك الصيغة نفسها أيضًا، ولا يُسلَّم ما يحمله الإدخال تحت with إلا لذلك المستورِد وحده. ويصف أي مستورِد يحوّل مصدرًا إلى مسودات الإدخال كاملًا.

يُرفق المستورِد بإدخال واحد، لذا فإن إضافة مستورِد تسمّيه قائمة plugins.importer في الملف المكتوب بالفعل — بأي إصدار، أو بمدى — لا تضيف إدخالًا ثانيًا. وينقل الأمر ذلك الإدخال إلى الإصدار الذي حلّه بدلًا من ذلك: فيحتفظ الإدخال بمكانه في القائمة وبكل ما يحمله تحت with. وإضافة مستورِد بالإصدار الذي يسمّيه إدخاله بالفعل تترك الإدخال كما هو.

أوامر مكوِّن CLI الإضافي وعلاماتها

في كل مرة يبدأ فيها aggrega، يضيف أمرًا واحدًا لكل أمر يسهم به مكوِّن cli إضافي مكوَّن، قارئًا الأوامر وعلاماتها من التقرير الذاتي describe() الخاص بالمكوِّن الإضافي — من ذاكرة التخزين المؤقت للوصف حيث تحمل ملخّص المكوِّن الإضافي المثبَّت، وإلا بوصف المكوِّن الإضافي. وكل علامة معلَنة تُعلَن على أمرها فيسردها aggrega help <command> بالطريقة التي يسرد بها علامات أمر مدمج؛ ولا يزال المكوِّن الإضافي يتلقى وسائطه غير محللة ويقرأ علاماته الخاصة.

يقع الملخّص المثبَّت بجوار مرجع المكوِّن الإضافي في قائمة plugins.cli الخاصة بالتكوين، مكتوبًا sha256: يليه 64 رقمًا سداسيًا عشريًا صغيرًا — وهي الصيغة التي يسجّلها aggrega plugin add cli. والملخّص المكتوب بأي صيغة أخرى، مثل رقم سداسي عشري مجرد دون البادئة sha256:، يُرفض عند تحميل ملف التكوين، مع تسمية الملف والإدخال؛ وحتى يُصحَّح لا يُضاف أمر أي مكوِّن إضافي مكوَّن، ويحمل تحذير على الخطأ القياسي الرفض.

قبل أن يضيف aggrega أيًّا من أوامر مكوِّن إضافي، يفحص كل علامة يعلنها كل منها. والمكوِّن الإضافي الذي تفشل إعلاناته يُتخطى: فلا يُضاف أي من أوامره، ويسمّي تحذير واحد على الخطأ القياسي المكوِّن الإضافي والأمر والعلامة وما الخطأ فيها، ويعمل كل أمر آخر — مدمج أو من مكوِّن إضافي آخر — كالمعتاد:

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

يجتاز إعلان العلامة حين:

  • يكون للعلامة اسم، ولا تحمله علامة أخرى من الأمر نفسه؛
  • يكون اختصارها، إن كان لها، حرف ASCII واحدًا أو رقمًا لا تستخدمه علامة أخرى من الأمر نفسه؛
  • لا يعيد اسمها ولا اختصارها استخدام علامة يملكها كل أمر من أوامر aggrega بالفعل — --help و -h والعلامات العامة؛
  • يكون نوعها، إن أعلنت واحدًا، string أو bool أو int — والعلامة بلا نوع علامة سلسلة نصية؛
  • تكون قيمتها الافتراضية، إن أعلنت واحدة، قيمة من نوعها.

يتكرر التخطي، مع تحذيره، في كل استدعاء حتى يثبّت التكوين إصدارًا من المكوِّن الإضافي تجتاز إعلاناته. وتوصف الحقول التي يحملها إعلان العلامة تحت spec.commands في صفحة كيان Plugin.

توليد الكيانات ومزامنة السجلات: نوعان مختلفان من الفعل

أمران من هذه الأوامر الفرعية ينتجان ملفًا، وما ينتجانه ليس من النوع نفسه.

plugin gen-catalog — الكيانات المولَّدة لك لتحررها

ينتج aggrega plugin gen-catalog كيانات Plugin للكتالوج. والكيان مستند كتالوج: تودعه وتراجعه وتواصل تحريره بجانب بقية كتالوجك. ولأنه محتوى تملكه، يستطيع الأمر أن يسلّمه إليك بدلًا من وضعه على القرص.

ينفّذ --dry-run كل ما يفعله gen-catalog إلا الكتابة. يعيد الكيانات المولَّدة بوصفها محتوى — لا يُنشأ ملف، ولا يُصنع دليل — ويسمّي كل مستند في الإجابة الملف الذي هو له، فيعرف المستدعي أين ينتمي كل منها. والمستدعي الذي يحتفظ بنموذج مستنداته الخاص، مثل محرر، يضع المحتوى هناك، حيث تراه قبل حفظه ويمكنك تعديله أو التراجع عنه. وبدون العلامة تُكتب الكيانات تحت --output-dir، لأن المستدعي عند طرفية ليس لديه مكان أفضل يضعها فيه.

المحتوى المُعاد والبايتات المكتوبة هما المحتوى نفسه: يعيد --dry-run ما كانت الكتابة ستنتجه، لا معاينة مجمّعة على حدة. وكل سلوك آخر هو سلوك الكتابة أيضًا — تُقرأ وحدات guest نفسها، وتُطابَق التراكبات نفسها، و --output-dir مطلوب في الحالتين، لأن كل مستند معاد لا يزال يسمّي الملف الذي هو له ومساره مركَّب منه.

يُركَّب كل كيان ويُتحقق منه قبل تسليم أي منها، فالتشغيل ينتج المجموعة كلها أو لا ينتج شيئًا. والتراكب الذي يوقف التوليد — واحد مفقود، أو لا تطابق هويته وحدة guest التي يُدمج معه — لا يترك وراءه إخراجًا مكتوبًا جزئيًا يجب تنظيفه.

plugin sync — السجلات التي تملكها الآلة للمحوِّل البرمجي

يجعل aggrega plugin sync السجلات التي تملكها الآلة لمكوِّن إضافي متوافقة مع وحدته: مجموعة دوال المضيف المشتقة من قسم الاستيراد في الوحدة، ومرآة الأوامر المقروءة من التقرير الذاتي للمكوِّن الإضافي نفسه. وكلاهما حقيقة مرجعية في الملف الثنائي لا قيم يختارها أحد.

يكتب دائمًا، ولا يقدّم --dry-run. وهذا صحيح حتى مع أنه يكتب داخل ملف كيان ألّفته أنت — فالخط مرسوم على المحتوى لا على الملف. السجلات التي يحتفظ بها المحوِّل البرمجي عن نفسه ليست لك لتحررها، فلا شيء يُراجَع قبل وصولها؛ ويبقى المستند المحيط دون مساس بايتًا ببايت، ولا تتغير إلا تلك الكتل.