Skip to content

core.adapter

Adapter modules: MCP protocol adapter, plugin lifecycle, marketplace scaffolds, and provider diagnostics.

MCP Adapter

core.adapter.mcp_adapter

Optional MCP interoperability layer.

Provides an adapter that can expose or consume tools/resources/prompts in an MCP-like shape without making MCP the internal core dependency.

MCPAdapter

Adapter for MCP-like interoperability.

Parameters

tools : List of MCP tool definitions resources : List of MCP resource definitions

resolve_tool(name: str) -> str | None

Resolve an MCP tool name to an internal tool name.

MCPResourceDefinition dataclass

Definition of an MCP-compatible resource.

Parameters

uri : Resource URI name : Human-readable name description : Description mime_type : MIME type

MCPResourceType

Bases: Enum

Types of MCP resources.

MCPToolDefinition dataclass

Definition of an MCP-compatible tool.

Parameters

name : Tool name description : Human-readable description parameters : JSON schema for parameters internal_tool : Mapping to internal tool name

Plugin Lifecycle

core.adapter.plugin_lifecycle

Plugin loading lifecycle.

Defines plugin discovery, manifest validation, install/uninstall, enable/disable, version compatibility, permission grants, audit logging, and safe failure behavior.

PluginEntry dataclass

Plugin registry entry.

Parameters

manifest : Plugin manifest state : Current plugin state install_path : Path where the plugin is installed error : Last error message (if any) metadata : Arbitrary additional context

PluginManager

Manages plugin lifecycle.

Parameters

companion_version : Current Vector Companion version

disable(name: str) -> PluginEntry | None

Disable a plugin.

discover(manifest: PluginManifest) -> PluginEntry

Discover and validate a plugin.

enable(name: str) -> PluginEntry | None

Enable a plugin.

get_audit_log() -> list[dict[str, Any]]

Get the audit log.

install(name: str, path: str = '') -> PluginEntry | None

Install a plugin.

list_plugins(state: PluginState | None = None) -> list[PluginEntry]

List plugins with optional state filtering.

uninstall(name: str) -> bool

Uninstall a plugin.

PluginManifest dataclass

Plugin manifest for validation.

Parameters

name : Plugin name version : Semantic version description : Human-readable description permissions : Required permissions min_companion_version : Minimum Vector Companion version max_companion_version : Maximum Vector Companion version author : Plugin author

PluginState

Bases: Enum

Plugin lifecycle states.

Diagnostics

core.adapter.diagnostics

User-facing diagnostics bundle.

Builds a privacy-aware diagnostic export that includes version, platform, dependency health, redacted settings, recent structured logs, backend status, and performance counters.

DiagnosticSection

Bases: Enum

Sections of a diagnostics bundle.

DiagnosticsBundle

Builds a privacy-aware diagnostics export.

Parameters

config : Diagnostics configuration

add_entry(section: DiagnosticSection, key: str, value: Any, is_redacted: bool = False) -> None

Add an entry to the bundle.

entry_count() -> int

Count total entries.

generate_report() -> dict[str, Any]

Generate a diagnostics report.

get_entries_by_section(section: DiagnosticSection) -> list[DiagnosticsEntry]

Get entries for a specific section.

DiagnosticsConfig dataclass

Configuration for diagnostics export.

Parameters

include_logs : Whether to include recent logs include_settings : Whether to include redacted settings include_performance : Whether to include performance counters redact_pii : Whether to redact personally identifiable information max_log_lines : Maximum number of log lines to include

DiagnosticsEntry dataclass

A single entry in a diagnostics bundle.

Parameters

section : Diagnostics section key : Entry key value : Entry value is_redacted : Whether the value has been redacted