Skip to main content

Module plugins

Module plugins 

Source
Expand description

Plugin discovery and manifest types.

Structs§

Manifest
Declarative metadata a plugin ships with itself. The wire shape is JSON; the on-disk convention (sibling file, embedded resource, --manifest flag, …) is deliberately out of scope of this struct and will be settled in a follow-up.
ManifestWithNameAndSource
A Manifest enriched with the plugin’s identifying name and the source it was loaded from. Used when listing or describing installed plugins, where the bare manifest fields are not enough to identify which plugin they belong to or where they came from.
McpServer
MCP server entry inside Manifest::mcp_servers. Same url + authorization semantics as objectiveai_sdk::agent::McpServer plus a name field that agent declarations reference (via objectiveai_sdk::agent::ClientObjectiveaiMcpPluginEntry::mcp_servers).
ViewerRoute
One HTTP route a plugin’s viewer registers on the host viewer’s embedded axum server. The full path served is /plugin/<repository>/<self.path>; on a hit, the body is JSON-decoded and forwarded as a PluginRequest { type: self.type, value: body } event to the frontend.
WhitelistEntry
One whitelist row. Each field is a regex matched anchored against the corresponding install parameter (compiled as ^(?:pattern)$). All four fields must match for the row to allow the install.

Enums§

HttpMethod
HTTP methods supported by ViewerRoute. Serializes as upper-case ("GET", "POST", …) on the wire.
InstallError
Failures the plugin install pipeline can encounter. Shape modelled after objectiveai-api’s github::Error: split request / response / status / parse so diagnostics name what failed, plus IO variants for the local-disk side of the flow.

Functions§

check_plugin_whitelist
Returns Ok(true) iff the quadruple matches at least one entry in whitelist. Each field is compiled as ^(?:pattern)$ so patterns like Object won’t match ObjectAttacker. Returns Err(regex::Error) if any pattern fails to compile.
default_whitelist
The hard-coded default whitelist. Single entry: any repo under the ObjectiveAI GitHub org passes; everything else requires --insecure.
raw_manifest_url
Convention: the raw-GitHub URL we’d fetch objectiveai.json from for a given (owner, repository, optional commit sha). Defaults to HEAD when no commit is supplied. Lifted out so the cli and the SDK’s own install_plugin wrapper share one source of truth.