Files
openidea/crates/ide-plugin/src/lib.rs
T
l0ng-ai 757412cb73 fix(security): reach content roots in plugin quick fixes and keep diagrams local
- A plugin quick fix may change or open files in the project's content
  roots (a project window group's members, extra Project Structure
  folders), still never git's own files; before, it was disabled for
  every file outside the primary root.
- `git init` (New Project › Create Git repository) uses the configured
  git executable again.
- Mermaid output is cleaned before it is shown: remote image sources,
  external `url()`, `@import` and address strings in its CSS are
  removed, so `style`/`classDef` values and HTML labels fetch nothing.
- The reply image e2e test loads a web image only after its button is
  clicked; the post-checkout hook test runs in a trusted scope.
- Capability docs list `project.write` as high risk.
2026-11-11 22:18:48 +08:00

36 lines
1.3 KiB
Rust

//! The WebAssembly runtime for plugins (wasmtime, component model, WASI
//! preview 2). Package handling, extension points and grants live in
//! `ide-extension`; the host that assembles them is `ide-host::plugins`.
//!
//! Each plugin with code runs in its own wasmtime `Store`: no files, env or
//! network beyond what [`HostApi`] grants, a fuel budget and wall-clock
//! deadline per call, and a linear-memory cap. A trap (panic, budget
//! exhausted, permission violation, cancellation) poisons the instance; the
//! host drops it. Each active plugin's runtime lives on its own [`Actor`] thread.
mod actor;
pub mod indexing;
mod runtime;
mod sandbox;
mod types;
mod wit_host;
pub use actor::{Actor, ActorError, Pending};
pub use runtime::{
API_VERSION, CANCELLED, CallCancel, CallError, GuestError, HostApi, PluginEngine, Runtime, RuntimeSetup, check_api,
component_api, host_api,
};
pub use sandbox::{
MAX_READ_BYTES, inside_root, inside_roots, read_text, resolve_in_root, resolve_in_roots, resolve_new_in_root,
resolve_new_in_roots, resolve_real, resolve_writable_in_root, resolve_writable_in_roots,
};
pub use types::*;
pub use wasmtime::component::Component;
mod execution;
pub use execution::*;
pub use ide_core::remote_settings::PluginRunTarget;
pub mod language_features;