дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 18:17:15 +02:00
A plugin web view can open interactive PTY sessions (spawn, input, resize, kill, streamed output and exit). Spawning requires the exact granted `process:<program>` and its pinned executable, with no PATH re-resolution or fallback shell; the cwd is the trusted project, arguments, environment (append-only) and sizes are validated, and at most eight sessions run per plugin. A frame can only drive the sessions it opened; output is acknowledged chunk by chunk and input/output are bounded. Sessions end on permission change, reload, disable, uninstall, frame teardown or window close. Requires API ^1.3; adds a web-pty test fixture. Verified on macOS; Windows/Linux not run. Co-authored-by: dengliu <[email protected]>
16 рядки
412 B
Rust
16 рядки
412 B
Rust
use openidea_plugin::{Error, Invocation, Plugin, register_plugin};
|
|
|
|
#[derive(Default)]
|
|
struct WebPty;
|
|
|
|
impl Plugin for WebPty {
|
|
fn run_command(&mut self, id: &str, _ctx: &Invocation, _arg: Option<&str>) -> Result<Option<String>, Error> {
|
|
match id {
|
|
"ping" => Ok(Some("Web PTY ready".into())),
|
|
_ => Err(Error::NotFound(id.into())),
|
|
}
|
|
}
|
|
}
|
|
|
|
register_plugin!(WebPty);
|