дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-03 16:51:16 +02:00
[capabilities.reasons] lets a plugin say in one sentence why it asks for a declared capability. The permission dialog and the plugin's details in Settings › Plugins show it below the IDE's own description, marked as the plugin's words and never instead of it; it is translated through the plugin's locales/<tag>.json. Keys must be capabilities under required or optional; reasons are 1-500 characters. settings.open(page) opens Settings at the plugin's node or one of its declared pages, and settings.open-permissions at its permissions in Settings › Plugins (plugins#permissions:<id>, so it also reaches a separate Settings window), letting a notice take the user straight there. Both work only from a command or event of a window; an undeclared page is not-found. Plugin API 1.19.0: WIT package, engine, SDK wrappers and mock, rebuilt components; 1.18 is recorded as shipped with 0.1.54. The settings-pages fixture exercises both additions. Refs #6745
60 рядки
2.8 KiB
Plaintext
60 рядки
2.8 KiB
Plaintext
package openidea:[email protected];
|
|
|
|
/// Project-scoped targets owned by the registering plugin (API 1.4).
|
|
interface run-targets {
|
|
use types.{error};
|
|
use workspace.{project};
|
|
|
|
/// An argv wrapper using a granted, pinned process program. No shell is used.
|
|
/// Normally: program + args + workdir-args + command + command arguments.
|
|
/// An override matches wrap::program_name(command) and replaces args AND command:
|
|
/// program + override + workdir-args + command arguments.
|
|
/// DDEV: program="ddev", args=["exec"], commands=[("composer", ["composer"])]:
|
|
/// `ddev exec php x.php` and `ddev composer install`.
|
|
/// Each workdir-args element may contain {cwd}, mapped under container-root.
|
|
/// All workdir-args are omitted without container-root or for cwd outside the project.
|
|
/// Without workdir-args the wrapper manages its container directory itself.
|
|
/// The wrapper always starts in the configuration's LOCAL working directory.
|
|
/// Environment reaches the wrapper; forwarding into a container depends on its conventions.
|
|
/// Registration never selects the target. Debugging plugin targets is invalid.
|
|
record run-target {
|
|
id: string,
|
|
name: string,
|
|
program: string,
|
|
args: list<string>,
|
|
workdir-args: list<string>,
|
|
container-root: option<string>,
|
|
commands: list<tuple<string, list<string>>>,
|
|
}
|
|
|
|
/// Registers/replaces this plugin's target in an open, trusted project.
|
|
/// Targets survive idle reclamation, and disappear on unregister or plugin stop.
|
|
/// Remote project registration and execution take place on the server.
|
|
register: func(project: borrow<project>, target: run-target) -> result<_, error>;
|
|
/// Per-command prefix and optional replacement working-directory arguments (API 1.5).
|
|
/// None inherits the target's workdir-args; some([]) omits them.
|
|
/// Replacement arguments use the same {cwd} substitution and path restrictions.
|
|
record command-override {
|
|
name: string,
|
|
args: list<string>,
|
|
workdir-args: option<list<string>>,
|
|
}
|
|
|
|
/// Like run-target, with per-command working-directory argument control (API 1.5).
|
|
/// Matching commands use program + override args + selected workdir-args + command arguments.
|
|
record run-target-with-overrides {
|
|
id: string,
|
|
name: string,
|
|
program: string,
|
|
args: list<string>,
|
|
workdir-args: list<string>,
|
|
container-root: option<string>,
|
|
commands: list<command-override>,
|
|
}
|
|
|
|
/// Same ownership, trust, process grant and pin checks as register (API 1.5).
|
|
register-with-overrides: func(project: borrow<project>, target: run-target-with-overrides) -> result<_, error>;
|
|
/// Removes only this plugin's target from the project; missing ids are harmless.
|
|
unregister: func(project: borrow<project>, id: string);
|
|
}
|