дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 03:05:40 +02:00
feat(plugins): let plugin code open streaming log tabs (#2082)
views.open-log-tab(key, title, process-log) (SDK host::open_log_tab) opens the read-only log tab a web view opens with open-log-tab, from a command or event of a window, reusing the Services pane's process-log. The host checks the process grant and limits when called and remembers what each key runs in that window; the tab starts it by key (plugin_log_tab_spawn) through the web-view PTY checks: pinned program, trusted project, session cap, lifecycle and grant revocation. Remote windows report that these tabs aren't available there yet.
Цей коміт міститься в:
1 джерело
ec171c3188
коміт
2bf412ff0d
92 files changed
+496
-50
No files matched your search
@@ -1150,11 +1150,29 @@ five-tab retention limit; evicting a hidden tab stops its process. Closing the
|
||||
tab, disabling/updating the plugin, changing grants, switching projects or
|
||||
closing the window stops it, including a pending spawn.
|
||||
|
||||
A plugin's code opens the same tab without a page, from a command or event of a
|
||||
window, with `host::open_log_tab(key, title, &log)` (WIT `views.open-log-tab`)
|
||||
and the `ProcessLog` the Services pane uses:
|
||||
|
||||
```rust
|
||||
use openidea_plugin::details::ProcessLog;
|
||||
|
||||
let log = ProcessLog::new("kubectl", &["logs", "-f", "deploy/api"]).toggle("previous", "Previous", &["--previous"]);
|
||||
host::open_log_tab("api-logs", "api logs", &log)?;
|
||||
```
|
||||
|
||||
The call fails at once without the `process:<program>` grant or over the limits
|
||||
above. The host remembers what each key runs in that window, and the tab starts
|
||||
it by key, so nothing the tab sends names a program; a plugin keeps at most 32
|
||||
such tabs per window (opening more forgets the oldest). Tabs opened by code
|
||||
don't run in remote projects yet.
|
||||
|
||||
The built fixture `crates/ide-plugin/tests/fixtures/web-log` exercises permission
|
||||
refusal, continuous Unicode output and a plugin-defined Verbose toggle. On Unix,
|
||||
grant its optional `process:bash` permission and use its Log Probe tool window.
|
||||
Its `Log Probe: Open Stream` and `Log Probe: Try Undeclared Program` commands
|
||||
also ask the sandboxed page to open a tab, exercising the Wasm-to-page bridge.
|
||||
also ask the sandboxed page to open a tab, exercising the Wasm-to-page bridge;
|
||||
`Log Probe: Open From Code` opens one from the plugin's code.
|
||||
This extends the web bridge without changing released WIT signatures.
|
||||
|
||||
### Plugin-backed content editor tabs (API 1.3)
|
||||
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
b390c7f6acf5d32cbf451faf7a6393f2d4f130d5131ef0857a2b0904c434f598
|
||||
7dfbea1faeae8930b462fe80d431c83c49aeafa45ac7acd36f7d7f05fac3aaa4
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
1eea85130f5feacdcd6aade3548ac8e6ca4c1b316441346a89a7be6c13caaba7
|
||||
adeef6ba69276d3ac8e9ba349ca6e787befa6532ccac69bc35a381c0428af189
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
d2e1a074d81a4f29935524b6ba11a94d6a9bc301833ea721ed9e7cab461e198e
|
||||
51def3be1a570ee61cb23f0b738002427298dbdafffcb687896531685bbe3c77
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
150ed795daab29e3a152e50ebdf5e4ec3ca569d792962b77fce5fac428e7e076
|
||||
6c4439b36b22289c8dc54498d6e7e72a4c4cc15eac1a4957fc2b71d4fbd3c330
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
580e19fd349b6be1f2d4c32e572015337ef8f1e73b1b1f24199fc6d4ea73189f
|
||||
00d56f431ab8e59c04796cf56054a98ba78040a5e4142c3f727725c31781a008
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
64d1e9a8bf48355f380feba052ea0ffb5f4ae7957b04d0a62a04e1d49d6ed690
|
||||
9fca272eec5a601b8de6071aa358954e9b79db08f45714f077624418e8f616bc
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
ef76535391c4186a6373ef61197d96cc3ad7c42f47505ec75328ba5385e4df6e
|
||||
5adfc0d749feabe5fe7e20857fd636d01341b91f3dd8440779af6dcd14435619
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
246a3ace4e3ccdd9ed4f2499cde275c9ea2402fbb902893cc2d8d3403175bd47
|
||||
1b388c40cb6be29c5e10e938c0c8f6848d10cb4bf1f7438db37f53b13314708e
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
75b3b93fe5ca2c5a58052c931f4d9cd824c379227d7f4cd8477fa89d045cda06
|
||||
af4478864196b5802f505d26beafe4492bc1335536311bc873b9d18773f9eebb
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
59f62db0a1c20a1d4fa6b380cd3272ec70ea4789835873d0abe3839ec08c94c3
|
||||
46ce9f2d5b4f87a4be26facea4870f3de59952dc95c536fcf33fb0ff0a7c27a7
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
548c6ed16fcd5d3a053bf6d8417d52ebd0fd74138d0665e9205eb8bf32ec497a
|
||||
f4e37cdac925f376bac945d5bb86c648b559787aa22737e6440835456f9f74cf
|
||||
Reference in new issue
Заблокувати користувача