Plugins
An AgentUse plugin is an installable package. A plugin can contribute executable extensions today, with other resource types such as skills and agents able to use the same package boundary in the future. An extension is a TypeScript or JavaScript module that exports one activation function. The function receives a stable API and registers events, providers, or provider patches. AgentUse waits for async activation before model discovery and execution begin.Loose project and global extensions
Single-file extensions are discovered automatically from the existing plugin directories:.agentuse/plugins/*.{ts,js}for the current project.$AGENTUSE_CONFIG_DIR/plugins/*.{ts,js}for every project (defaults to~/.agentuse/plugins/*.{ts,js}).
agentuse.on("agent:complete", handler). New extensions should use the activation API.
Event API
agentuse.on(event, handler) returns a disposable registration. Handlers run sequentially in registration order and receive a context containing an abort signal. Logging stays on the activation API so handlers can close over agentuse.log.
Observational events and non-input fields are immutable snapshots.
tool:call is the deliberate exception: every handler shares the same mutable input object, so later handlers, AgentUse approval policy, and the tool see prior mutations. Return-based transformations from tool:result and agent:complete are also chained through later handlers. A handler failure is logged and does not prevent later handlers from running.
Intercepting tools
block denies the tool call. reason is returned to the model. terminate stops the agent loop after the denied result instead of allowing another model turn.
Transforming the final response
Event shapes
Provider API
Register a provider with a unique model prefix, model catalog, transport, and optional authentication and prompt behavior:acme:acme-large. Declared model limits and modalities participate in validation, context compaction, output-token limits, media tools, and agentuse models.
Model catalogs
Providers can declare models directly, inherit a built-in catalog, or discover models asynchronously during activation:Transports
AgentUse includes declarative transports:anthropic-messagesopenai-responsesopenai-chat-completions
custom when a provider needs a different protocol or a subprocess-backed runtime:
warningbefore any response output.text-deltaandreasoning-delta, with optional stable block IDs.tool-callwith an ID, name, and structured input.- Optional
response-metadataorerrorevents. - Exactly one terminal
finishevent with a normalized reason and optional token usage.
finish is rejected. When the consumer cancels a run, the request’s abort signal fires and the stream’s iterator is closed, so check request.signal in long-running loops.
If the custom transport speaks a known wire protocol, say so with protocol: "anthropic" or protocol: "openai". AgentUse then applies that protocol’s behavior, such as Anthropic output-token limits and which providerOptions block reaches the model. Omit it for a bespoke API.
Authentication
AgentUse core owns restrictive credential-file permissions, credential persistence, cross-process refresh locking, status reporting, and deletion. Plugins return opaque credentials and implement provider-specific login, refresh, and request resolution.expires property are refreshed five minutes before expiry. AgentUse serializes refreshes and persists the returned credential before resolving request authentication. Declared environment credentials are resolved first, so an explicit process token is never blocked by an expired stored credential. When an adapter takes ownership of legacy provider OAuth, AgentUse moves it atomically into the adapter’s method-specific credential slot.
Readiness checks
A provider that needs something on the machine besides a credential, such as a bridged local CLI, declares an optionalcheck(). AgentUse runs it for
agentuse provider list, the dashboard Providers tab, and right after
agentuse plugins install, and refuses to build a model for the provider while
it fails, so an installed bridge never reports as connected when it cannot run.
detail is shown beside the connected badge. message says what is missing
and fix is a command the user can run. A check that throws or takes longer
than ten seconds counts as not ready.
The dashboard Providers tab renders saved providers immediately, then updates
each row as readiness and recent connection checks finish. A row distinguishes
Connected, Not verified or Not checked, Reconnect required,
Temporarily unavailable, and Not connected, so a stored credential is
not presented as proof of a working connection. From the Plugins tab, open in
Providers uses a ?provider= link that opens Settings with the matching
provider row expanded.
Provider-owned prompts
Prompt contributions have stable IDs and ownership metadata:Built-in provider adapters, patches, and overrides
A plugin can conditionally contribute a transport to an existing provider namespace. The adapter is evaluated before the built-in transport; when its predicate returnsfalse, the built-in provider continues unchanged:
when function
receives the normal provider runtime context, including scoped authentication,
and is evaluated whenever AgentUse selects provider behavior. If several
adapters match, the highest priority wins; equal priorities retain plugin
registration order. The selected adapter owns transport, authentication,
model metadata, prompt contributions, and media capabilities for that request.
If models is omitted, the existing provider catalog and model IDs are
inherited unchanged.
A plugin can patch a built-in endpoint without replacing its models:
Distributed packages
Curated provider plugins
AgentUse maintains a deliberately small, release-reviewed shortlist for the provider setup experience. These plugins remain third-party executable code: review their source and project status before installing them. Browse the current choices in Settings > Providers. Each provider card shows its publisher, reviewed version, installation source, and authentication requirements. Community providers maintain their own setup instructions; follow the linked repository for provider-specific credentials and limitations. Some providers use credentials managed by an external application rather than an AgentUse login. The shortlist is bundled with AgentUse rather than fetched from a mutable remote marketplace. A new or changed listing therefore goes through the normal AgentUse release review. The dashboard also exposes an advanced GitHub installation path. It requires an explicit tag or full commit, reads onlypackage.json before showing consent,
and installs the exact commit that was inspected. The resulting plugin is
labelled Unreviewed. Installed provider plugins can be updated or removed
from Settings > Providers; removing a package does not delete its saved
credential.
The v0.21 compatibility migration is narrower than normal installation: when
AgentUse finds an Anthropic OAuth credential written by the removed core flow,
it installs the pinned compatibility plugin and adopts the credential
without interrupting the user. New users still choose the plugin explicitly.
A Git repository package declares its resources in package.json:
agentuse.providers is optional static metadata for the dashboard’s safe
pre-install preview. It does not register the provider; the extension still
does that during activation. Extension entry paths must stay inside the plugin
package. Runtime dependencies belong in dependencies. Git installation uses
npm install --omit=dev --ignore-scripts; package lifecycle scripts never run
implicitly.
Installing and managing packages
-l for project scope:
agentuse plugins install ./my-plugin links the local directory directly, globally by default or into the project with -l. AgentUse validates and activates its current working tree without cloning it, so the folder does not need to be a Git repository and uncommitted edits are available on the next process start. Updating a linked plugin revalidates its manifest; removing it only removes the registry record and never deletes the source directory. plugins update reports “already up to date” when a linked package’s version is unchanged or a source pinned to a tag or commit still resolves to the installed commit. Append a full commit SHA (./my-plugin@<sha>) to clone and pin a local Git checkout instead of linking it.
Global packages live under $AGENTUSE_DATA_DIR/plugins, which defaults to ~/.local/share/agentuse/plugins. Managed project packages live under .agentuse/packages; linked plugins in either scope remain in their original directories. Both are recorded in .agentuse/plugins.json. agentuse plugins list --all-scopes displays every scope and marks linked entries.
Git tags, branches, and commits can be selected with @ref. Updates retain the configured ref. Git installation and updates clone into staging, install safe runtime dependencies, compile and activate every entry, and only then replace the active checkout. A failed validation leaves the working version in place.
The shorter agentuse install|update|list|remove commands remain as compatibility aliases.