Skip to main content

Module plugins

Module plugins 

Source
Expand description

Plugin and marketplace actions over the command bus.

The work is reachable through crate::Command so that any view can act, rather than one view reaching for the forge-agent CLI functions this module calls from inside its own layer (rule 24’s case). The CLI calls, the batch runner and the disk scan are forge-agent’s; what lives here is the orchestration: resolving each action’s working directory from forge.toml rather than the launch directory (hard rule 14), serializing actions one at a time, and reporting through the Plugins* updates a view already listens to.

One run at a time: an update-all, a check and an action all serialize through Workspace::plugin_action_running, and the latest run stays readable mid-flight so a view attaching during one draws it.

Re-exportsΒ§

use std::path::PathBuf; πŸ”’
use std::sync::Arc; πŸ”’
use std::sync::atomic::Ordering; πŸ”’
use std::time::Duration; πŸ”’
use forge_agent::userdata::plugins::cli; πŸ”’
use forge_agent::userdata::plugins::cli::UpdateRunner; πŸ”’
use forge_primitives::plugins::InstalledPluginEntry; πŸ”’
use forge_primitives::plugins::MarketplaceEntry; πŸ”’
use forge_primitives::plugins::MarketplaceSourceEntry; πŸ”’
use forge_primitives::plugins::PluginRunRowStatus; πŸ”’
use forge_primitives::plugins::PluginUpdateRun; πŸ”’
use forge_primitives::plugins::PluginUpdateRunRow; πŸ”’
use forge_primitives::plugins::PluginUpdateTrigger; πŸ”’
use forge_primitives::plugins::PluginsCliActionSuccess; πŸ”’
use forge_primitives::plugins::PluginsInventorySnapshot; πŸ”’
use forge_primitives::plugins::update_availability; πŸ”’
use crate::protocol::DispatchError; πŸ”’
use crate::protocol::SessionUpdate; πŸ”’
use crate::workspace::Workspace; πŸ”’

StructsΒ§

PluginActionGuard πŸ”’
Clears the single-action gate however its task ends, panic included: a crashed task that left the gate shut would refuse every later press with no way back.
PluginCli πŸ”’
How the plugin actions reach claude and the disk. Real in every production build.

ConstantsΒ§

PLUGIN_CALL_TIMEOUT πŸ”’
Upper bound on one CLI call inside a batch; a hung call fails its row instead of pinning the run forever.

FunctionsΒ§

fail_action πŸ”’
Report a failed action, or a refusal found before one could run, on the frame the page already listens for.
plugin_call_cwd πŸ”’
The working directory one plugin CLI call runs in.
run_action πŸ”’
Run one CLI action and report its outcome on the Plugins frames.
run_update_batch πŸ”’
Run one update batch, reporting progress per row, persisting the rollback records it earns, and finishing with the refreshed inventory.
scan_inventory πŸ”’
The disk scan, off the runtime.
stale_rows πŸ”’
The run rows one update-all/check queues: exactly the stale installed entries, one per registry entry, each with the cwd its own scope runs in.

Type AliasesΒ§

PluginCliFut πŸ”’
One future handed back by the plugin CLI seams.
RefreshFn πŸ”’
RunAndRefresh πŸ”’
ScanFn πŸ”’