mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
Merge pull request #9118 from dotCooCoo/feat/plugin-api-javascript-runtime
Plug-ins: object filters written in JavaScript
This commit is contained in:
40 files changed
+1478
-45
No files matched your search
Generated
+1
@@ -8787,6 +8787,7 @@ dependencies = [
|
||||
"vectorcraft-color",
|
||||
"vectorcraft-doc",
|
||||
"vectorcraft-geom 0.24.1",
|
||||
"vectorcraft-js",
|
||||
"wasmi",
|
||||
"wasmparser 0.228.0",
|
||||
"wat",
|
||||
|
||||
@@ -50,6 +50,10 @@
|
||||
//! also given the parts of the active document it names in `_context.document`, whether or not
|
||||
//! anything is selected: the settings, artboards, layers and swatches, as plain values
|
||||
//! ([`context`]).
|
||||
//!
|
||||
//! A filter may be written in JavaScript ([`vectorcraft_plugins::js`]): `plugin.install {path}`
|
||||
//! takes its `.vcplugin` manifest and reads the `.js` file the manifest names beside it, and the
|
||||
//! plug-in store keeps the two as one module.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, Mutex, RwLock};
|
||||
@@ -124,6 +128,10 @@ pub fn describe(p: &Plugin) -> Value {
|
||||
if m.paint_output {
|
||||
v["paintOutput"] = json!(true);
|
||||
}
|
||||
if let Some(script) = p.script() {
|
||||
v["runtime"] = json!(m.runtime.name());
|
||||
v["script"] = json!(script);
|
||||
}
|
||||
if !m.command_allowlist.is_empty() {
|
||||
v["commandAllowlist"] = json!(m.command_allowlist);
|
||||
}
|
||||
@@ -1008,8 +1016,9 @@ pub(crate) fn admit_effects_for(cmd: &str, fx: &[Effect], n: &Node) -> std::resu
|
||||
/// Largest base64 payload `plugin.install` accepts (the module limit, encoded).
|
||||
const MAX_DATA_CHARS: usize = (32 << 20) / 3 * 4 + 4;
|
||||
|
||||
/// The `.wasm` extension plug-in files have (File › Open installs them).
|
||||
pub const EXTS: &[&str] = &["wasm"];
|
||||
/// The extensions plug-in files have (File › Open installs them): a WebAssembly module, and a
|
||||
/// JavaScript plug-in's manifest.
|
||||
pub const EXTS: &[&str] = &["wasm", vectorcraft_plugins::js::PACKAGE_EXT];
|
||||
|
||||
/// The plug-in module command `c`'s params give, loaded and checked, and its bytes: `path` (a
|
||||
/// `.wasm` file) or `dataBase64` (the module, with `name` shown as its source).
|
||||
@@ -1389,12 +1398,23 @@ fn inspect(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
})
|
||||
}
|
||||
|
||||
/// The plug-in in the `.wasm` file `path`, and its module.
|
||||
/// The plug-in in the `.wasm` file `path`, or in the `.vcplugin` manifest `path` and the `.js` file
|
||||
/// it names, and its module: for a JavaScript plug-in, the manifest with the script's text
|
||||
/// ([`registry::read_js_package`]). Under automation read roots the script must be inside them too.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn load_path(path: &str) -> Result<(Plugin, Vec<u8>)> {
|
||||
crate::file_access::check_read(path).map_err(EngineError::Other)?;
|
||||
let limits = vectorcraft_plugins::Limits::default();
|
||||
let bytes = crate::store::read_capped(std::path::Path::new(path), limits.max_module_bytes as u64).map_err(EngineError::Other)?;
|
||||
let file = std::path::Path::new(path);
|
||||
let bytes = if registry::is_js_package(file) {
|
||||
let allow = |script: &std::path::Path| match script.to_str() {
|
||||
Some(script) => crate::file_access::check_read(script),
|
||||
None => Err(format!("automation path rejected: {} isn't valid text", script.display())),
|
||||
};
|
||||
registry::read_js_package(file, &allow).map_err(err)?
|
||||
} else {
|
||||
crate::store::read_capped(file, limits.max_module_bytes as u64).map_err(EngineError::Other)?
|
||||
};
|
||||
Ok((Plugin::load(&bytes, limits).map_err(err)?.with_source(path), bytes))
|
||||
}
|
||||
|
||||
@@ -1958,7 +1978,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"List Plug-ins",
|
||||
[],
|
||||
None,
|
||||
"{} → {plugins: [{id, name, version, kind: \"filter\"|\"effect\"|\"exporter\"|\"importer\", author, description, params (doc), paramsSchema, effect? (the effect id of a live effect: plugin.<id>), format? and extensions? (an exporter's or importer's format id, plugin.<id>, for document.export or document.open's importer, and its file extensions), place?: true (an importer whose files file.place also reads, see file.place's importer), budget?: \"heavy\" (a filter that may compute for longer, see plugin.install's allowHeavy), inputs?: [\"type\"|\"image\"|\"symbolInstance\"] (the objects besides paths a filter reads, see plugin.run), writes?: [\"type\"|\"image\"|\"symbolInstance\"] (the kinds among inputs a filter may change, see plugin.run), context?: [\"settings\"|\"artboards\"|\"layers\"|\"swatches\"] (the parts of the active document a filter's runs and its or a live effect's commands are given in _context.document, with or without a selection, see docs/plugins.md), size, source, permissions: [name] (what it may do: the ones its manifest lists, else the ones its kind implies; progress: it may report its progress, see Cancel and write log lines; settings: it may keep settings of its own; cache: it may keep a cache of its own; commands: a filter may run the commands its commandAllowlist names, see docs/plugins.md), commandAllowlist?: [command id] (the commands a filter with the commands permission may run while it runs, with vc_call), hash (the module's SHA-256), api (the plug-in API level it was built for, 1, 2 or 3), paintOutput?: true (a live effect whose pieces have paints of their own, see docs/plugins.md), cacheBytes (the bytes its cache holds; see plugin.clearCache), commands?: [{id, command (its command id, plugin.<id>.<command id>, which runs it), label, params (doc), paramsSchema, menu?: {path: [menu label], after?: item label (escaped), placed?: false (it stays in its plug-in's submenu: its label reads like a built-in item or submenu of that menu or another plug-in command placed there)} (the menu its manifest places it in, see docs/plugins.md)}] (the menu commands a filter or live effect adds)}], folder: the Additional Plug-ins Folder load report {folder, loaded, failed: [{file, error}], leftOut} | null (under automation read roots, a folder outside them is null, and a failed file and a plug-in's source outside them are named by their file name), safeMode: bool (no plug-in loads or runs, see plugin.safeMode), disabled: [{id, file, name, label}] (turned off for the next launch, see plugin.setEnabled)}",
|
||||
"{} → {plugins: [{id, name, version, kind: \"filter\"|\"effect\"|\"exporter\"|\"importer\", author, description, params (doc), paramsSchema, effect? (the effect id of a live effect: plugin.<id>), format? and extensions? (an exporter's or importer's format id, plugin.<id>, for document.export or document.open's importer, and its file extensions), place?: true (an importer whose files file.place also reads, see file.place's importer), budget?: \"heavy\" (a filter that may compute for longer, see plugin.install's allowHeavy), inputs?: [\"type\"|\"image\"|\"symbolInstance\"] (the objects besides paths a filter reads, see plugin.run), writes?: [\"type\"|\"image\"|\"symbolInstance\"] (the kinds among inputs a filter may change, see plugin.run), context?: [\"settings\"|\"artboards\"|\"layers\"|\"swatches\"] (the parts of the active document a filter's runs and its or a live effect's commands are given in _context.document, with or without a selection, see docs/plugins.md), size, source, permissions: [name] (what it may do: the ones its manifest lists, else the ones its kind implies; progress: it may report its progress, see Cancel and write log lines; settings: it may keep settings of its own; cache: it may keep a cache of its own; commands: a filter may run the commands its commandAllowlist names, see docs/plugins.md), commandAllowlist?: [command id] (the commands a filter with the commands permission may run while it runs, with vc_call), hash (the module's SHA-256), api (the plug-in API level it was built for, 1, 2 or 3), runtime?: \"js\" and script?: its .js file name (a JavaScript filter, see docs/plugins.md), paintOutput?: true (a live effect whose pieces have paints of their own, see docs/plugins.md), cacheBytes (the bytes its cache holds; see plugin.clearCache), commands?: [{id, command (its command id, plugin.<id>.<command id>, which runs it), label, params (doc), paramsSchema, menu?: {path: [menu label], after?: item label (escaped), placed?: false (it stays in its plug-in's submenu: its label reads like a built-in item or submenu of that menu or another plug-in command placed there)} (the menu its manifest places it in, see docs/plugins.md)}] (the menu commands a filter or live effect adds)}], folder: the Additional Plug-ins Folder load report {folder, loaded, failed: [{file, error}], leftOut} | null (under automation read roots, a folder outside them is null, and a failed file and a plug-in's source outside them are named by their file name), safeMode: bool (no plug-in loads or runs, see plugin.safeMode), disabled: [{id, file, name, label}] (turned off for the next launch, see plugin.setEnabled)}",
|
||||
always,
|
||||
list
|
||||
),
|
||||
@@ -1985,7 +2005,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Install Plug-in",
|
||||
[],
|
||||
None,
|
||||
"{path: a .wasm file (desktop) | dataBase64: the module (+ name?: shown as its source), replace?: bool (true once the user agreed: a module with other bytes than the plug-in installed with its id, or with none installed, one whose id has settings or a cache in the plug-in store, installs only with it, takes that plug-in's place and gets its settings and cache; false: one whose id is installed is refused; left out, the same module installs again), name?: file name (with dataBase64), allowHeavy?: bool (a filter whose manifest asks for a heavy budget, budget \"heavy\" in plugin.inspect, installs only with it), grant?: [permission] (a plug-in whose manifest lists permissions, needsApproval in plugin.inspect, installs only when grant holds every one of them; the grant is recorded with the module's hash and covers only that module, so a module with other bytes needs a new grant even when it lists the same permissions; installing a module that lists no permissions forgets the grant held for its id; a refused install keeps the grant, a failed write of the module to the plug-in store leaves the grant in the store, and a stored module that is disabled or not read in Safe Mode keeps the grant for its id; with a plug-in store attached, only the grants kept there count, and a grants.json without VectorCraft's MAC for that folder grants nothing; when the system key store can't be reached, the grant lasts for this session only; a request's allowHeavy and grant are refused unless the session was started with vectorcraft-cli --allow-plugin-grants: in the desktop app a person approves the install, see ui.installPlugin, and a module whose hash is already recorded, by a person's approval or by a grant accepted under that flag, needs no grant), hash?: string (the module's SHA-256 as plugin.inspect gave it: a module with other bytes is refused)} validate and install a WebAssembly plug-in for this session (with a plug-in store, the install waits while another window or process changes the store and writes the module and its grant before that window or process changes it again; when the store's disabled.lock can't be locked, nothing is installed) (a module whose commandAllowlist names a command no plug-in may call, such as one that reads or writes files, is refused) → its plugin.list entry, plus unknownCommands?: [id] (commandAllowlist ids no command has; a call of one fails)",
|
||||
"{path: a .wasm file or a JavaScript plug-in's .vcplugin manifest (read with the .js file its script names) (desktop) | dataBase64: the module or a JavaScript plug-in as one JSON object (its manifest, with the script's text in source) (+ name?: shown as its source), replace?: bool (true once the user agreed: a module with other bytes than the plug-in installed with its id, or with none installed, one whose id has settings or a cache in the plug-in store, installs only with it, takes that plug-in's place and gets its settings and cache; false: one whose id is installed is refused; left out, the same module installs again), name?: file name (with dataBase64), allowHeavy?: bool (a filter whose manifest asks for a heavy budget, budget \"heavy\" in plugin.inspect, installs only with it), grant?: [permission] (a plug-in whose manifest lists permissions, needsApproval in plugin.inspect, installs only when grant holds every one of them; the grant is recorded with the module's hash and covers only that module, so a module with other bytes needs a new grant even when it lists the same permissions; installing a module that lists no permissions forgets the grant held for its id; a refused install keeps the grant, a failed write of the module to the plug-in store leaves the grant in the store, and a stored module that is disabled or not read in Safe Mode keeps the grant for its id; with a plug-in store attached, only the grants kept there count, and a grants.json without VectorCraft's MAC for that folder grants nothing; when the system key store can't be reached, the grant lasts for this session only; a request's allowHeavy and grant are refused unless the session was started with vectorcraft-cli --allow-plugin-grants: in the desktop app a person approves the install, see ui.installPlugin, and a module whose hash is already recorded, by a person's approval or by a grant accepted under that flag, needs no grant), hash?: string (the module's SHA-256 as plugin.inspect gave it: a module with other bytes is refused)} validate and install a plug-in for this session (with a plug-in store, the install waits while another window or process changes the store and writes the module and its grant before that window or process changes it again; when the store's disabled.lock can't be locked, nothing is installed) (a module whose commandAllowlist names a command no plug-in may call, such as one that reads or writes files, is refused) → its plugin.list entry, plus unknownCommands?: [id] (commandAllowlist ids no command has; a call of one fails)",
|
||||
always,
|
||||
install
|
||||
),
|
||||
@@ -1994,7 +2014,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Inspect Plug-in",
|
||||
[],
|
||||
None,
|
||||
"{path: a .wasm file (desktop) | dataBase64: the module, name?: the file name shown as its source (with dataBase64)} validate a WebAssembly plug-in without installing it → the plugin.list entry it would have, plus needsApproval: bool (true when it lists permissions no person has granted this very module, its bytes included: it then needs a person's approval, see plugin.install) and needsReplace: bool (true when it would take the place of another module with its id: plugin.install then needs replace: true), unknownCommands?: [id] (commandAllowlist ids no command has) and refusedCommands?: [id] (commandAllowlist ids no plug-in may call: plugin.install refuses the module)",
|
||||
"{path: a .wasm file or a .vcplugin manifest (desktop) | dataBase64: the module or a JavaScript plug-in's JSON, name?: the file name shown as its source (with dataBase64)} validate a plug-in without installing it, running none of its code → the plugin.list entry it would have, plus needsApproval: bool (true when it lists permissions no person has granted this very module, its bytes included: it then needs a person's approval, see plugin.install) and needsReplace: bool (true when it would take the place of another module with its id: plugin.install then needs replace: true), unknownCommands?: [id] (commandAllowlist ids no command has) and refusedCommands?: [id] (commandAllowlist ids no plug-in may call: plugin.install refuses the module)",
|
||||
always,
|
||||
inspect
|
||||
),
|
||||
@@ -2021,7 +2041,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Reload Plug-ins",
|
||||
["Object", "Plug-ins"],
|
||||
None,
|
||||
"{path?: a folder (default: the Additional Plug-ins Folder preference)} install every *.wasm in it, the first 1,000 by file name (desktop; a bad module, one that isn't a regular file, and one disabled with plugin.setEnabled, is reported and skipped, and so are a heavy filter and a plug-in that lists permissions the user hasn't granted this very module, its bytes included; an error in Safe Mode) → {folder, loaded: [id], failed: [{file, error}], leftOut: the count of *.wasm files past the first 1,000, not tried}",
|
||||
"{path?: a folder (default: the Additional Plug-ins Folder preference)} install every *.wasm and *.vcplugin in it, the first 1,000 by file name (desktop; a bad module, one that isn't a regular file, and one disabled with plugin.setEnabled, is reported and skipped, and so are a heavy filter and a plug-in that lists permissions the user hasn't granted this very module, its bytes included; an error in Safe Mode) → {folder, loaded: [id], failed: [{file, error}], leftOut: the count of *.wasm and *.vcplugin files past the first 1,000, not tried}",
|
||||
always,
|
||||
reload
|
||||
),
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
//! JavaScript filter plug-ins through the engine: a `.vcplugin` manifest and the `.js` file it
|
||||
//! names install with `plugin.install {path}`, run with `plugin.run` as one undo step, and a run
|
||||
//! that fails or exhausts its budget leaves the document as it was.
|
||||
// Integration tests: unwrapping and panicking on failure is fine here, unlike in shipped code (AGENTS.md › Robustness).
|
||||
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_color::Color;
|
||||
use vectorcraft_engine::Session;
|
||||
use vectorcraft_testkit::fixtures::{exec, rect, select, session};
|
||||
|
||||
/// Paints every input object's first fill blue.
|
||||
const BLUE: &str = "function run(input, params) {\n\
|
||||
return {objects: input.objects.map(function (o) {\n\
|
||||
return {id: o.id, fills: [{type: 'solid', color: {model: 'rgb', r: 0, g: 0, b: 1}}]};\n\
|
||||
})};\n\
|
||||
}\n";
|
||||
|
||||
/// An empty folder for one test, with anything an earlier run left there removed.
|
||||
fn folder(tag: &str) -> PathBuf {
|
||||
let d = std::env::temp_dir().join(format!("vc-plugin-js-{tag}-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&d);
|
||||
std::fs::create_dir_all(&d).unwrap();
|
||||
d
|
||||
}
|
||||
|
||||
/// Writes the manifest of filter `id`, whose code is `tint.js`, with `extra` keys, and `script` as
|
||||
/// that file → the manifest's path.
|
||||
fn package(dir: &Path, id: &str, extra: Value, script: Option<&str>) -> String {
|
||||
let mut m = json!({"id": id, "name": "Tint", "kind": "filter", "runtime": "js", "script": "tint.js"});
|
||||
if let (Some(m), Value::Object(extra)) = (m.as_object_mut(), extra) {
|
||||
m.extend(extra);
|
||||
}
|
||||
let path = dir.join(format!("{id}.vcplugin"));
|
||||
std::fs::write(&path, serde_json::to_vec(&m).unwrap()).unwrap();
|
||||
if let Some(script) = script {
|
||||
std::fs::write(dir.join("tint.js"), script).unwrap();
|
||||
}
|
||||
path.display().to_string()
|
||||
}
|
||||
|
||||
/// The active document's layers and its undo steps.
|
||||
fn state(s: &mut Session) -> (Value, usize) {
|
||||
let layers = exec(s, "document.inspect", json!({}))["layers"].take();
|
||||
(layers, s.doc().unwrap().history.undo.len())
|
||||
}
|
||||
|
||||
fn fill(s: &Session, id: vectorcraft_doc::NodeId) -> Option<Color> {
|
||||
s.doc().unwrap().doc.node(id).unwrap().appearance.fill_paint().color()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_javascript_filter_changes_a_fill_as_one_undo_step() {
|
||||
let dir = folder("blue");
|
||||
let mut s = session();
|
||||
let path = package(&dir, "test.js.engine.blue", json!({}), Some(BLUE));
|
||||
let info = exec(&mut s, "plugin.install", json!({"path": path, "replace": true}));
|
||||
assert_eq!((info["runtime"].as_str(), info["script"].as_str(), info["kind"].as_str()), (Some("js"), Some("tint.js"), Some("filter")));
|
||||
let id = rect(&mut s, 10.0, 10.0, 20.0, 20.0);
|
||||
exec(&mut s, "paint.setFill", json!({"ids": [id.0], "color": "#ff0000"}));
|
||||
select(&mut s, &[id]);
|
||||
let before = state(&mut s);
|
||||
let r = exec(&mut s, "plugin.run", json!({"id": "test.js.engine.blue"}));
|
||||
assert_eq!(r["ids"], json!([id.0]));
|
||||
assert_eq!(fill(&s, id).map(|c| c.to_rgb_uncalibrated()), Some([0.0, 0.0, 1.0]));
|
||||
assert_eq!(state(&mut s).1, before.1 + 1, "one undo step");
|
||||
exec(&mut s, "edit.undo", json!({}));
|
||||
assert_eq!(state(&mut s), before);
|
||||
exec(&mut s, "plugin.remove", json!({"id": "test.js.engine.blue"}));
|
||||
std::fs::remove_dir_all(&dir).unwrap();
|
||||
}
|
||||
|
||||
/// An endless loop ends with the plug-in's instruction budget, the error names the plug-in, and the
|
||||
/// document and its history stay as they were.
|
||||
#[test]
|
||||
fn an_endless_loop_stops_on_its_budget_and_changes_nothing() {
|
||||
let dir = folder("loop");
|
||||
let mut s = session();
|
||||
let path = package(&dir, "test.js.engine.loop", json!({}), Some("function run(input) {\n while (true) {}\n}\n"));
|
||||
exec(&mut s, "plugin.install", json!({"path": path, "replace": true}));
|
||||
let id = rect(&mut s, 10.0, 10.0, 20.0, 20.0);
|
||||
select(&mut s, &[id]);
|
||||
let before = state(&mut s);
|
||||
let e = s.execute("plugin.run", &json!({"id": "test.js.engine.loop"})).unwrap_err().to_string();
|
||||
assert!(e.contains("instruction budget") && e.contains("test.js.engine.loop, tint.js line 2"), "{e}");
|
||||
assert_eq!(state(&mut s), before);
|
||||
exec(&mut s, "plugin.remove", json!({"id": "test.js.engine.loop"}));
|
||||
std::fs::remove_dir_all(&dir).unwrap();
|
||||
}
|
||||
|
||||
/// A filter that reads `File` throws a `ReferenceError`: the realm has none of the script runner's
|
||||
/// file access. Nothing changes.
|
||||
#[test]
|
||||
fn a_javascript_filter_has_no_file_access() {
|
||||
let dir = folder("file");
|
||||
let mut s = session();
|
||||
let path = package(&dir, "test.js.engine.file", json!({}), Some("function run(input) {\n return new File('/etc/passwd').read();\n}\n"));
|
||||
exec(&mut s, "plugin.install", json!({"path": path, "replace": true}));
|
||||
let id = rect(&mut s, 10.0, 10.0, 20.0, 20.0);
|
||||
select(&mut s, &[id]);
|
||||
let before = state(&mut s);
|
||||
let e = s.execute("plugin.run", &json!({"id": "test.js.engine.file"})).unwrap_err().to_string();
|
||||
assert!(e.contains("ReferenceError") && e.contains("File") && e.contains("test.js.engine.file"), "{e}");
|
||||
assert_eq!(state(&mut s), before);
|
||||
exec(&mut s, "plugin.remove", json!({"id": "test.js.engine.file"}));
|
||||
std::fs::remove_dir_all(&dir).unwrap();
|
||||
}
|
||||
|
||||
/// A manifest with `"runtime": "js"` and no `script` is refused at install, the error names the
|
||||
/// key, and nothing is installed.
|
||||
#[test]
|
||||
fn a_manifest_without_its_script_is_refused_at_install() {
|
||||
let dir = folder("noscript");
|
||||
let mut s = session();
|
||||
let path = package(&dir, "test.js.engine.noscript", json!({"script": null}), None);
|
||||
let mut m: Value = serde_json::from_slice(&std::fs::read(&path).unwrap()).unwrap();
|
||||
m.as_object_mut().unwrap().remove("script");
|
||||
std::fs::write(&path, serde_json::to_vec(&m).unwrap()).unwrap();
|
||||
for cmd in ["plugin.inspect", "plugin.install"] {
|
||||
let e = s.execute(cmd, &json!({"path": path})).unwrap_err().to_string();
|
||||
assert!(e.contains("`runtime` \"js\" needs `script`"), "{cmd}: {e}");
|
||||
}
|
||||
assert!(vectorcraft_plugins::registry::get("test.js.engine.noscript").is_none());
|
||||
std::fs::remove_dir_all(&dir).unwrap();
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "vectorcraft-plugins"
|
||||
description = "Sandboxed WebAssembly plug-ins for VectorCraft: a resource-limited wasmi host for object filters and live effects"
|
||||
description = "Sandboxed plug-ins for VectorCraft: a resource-limited wasmi host for object filters and live effects, and JavaScript object filters"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
@@ -21,6 +21,8 @@ craft-vectorcraft-format = { workspace = true }
|
||||
# The SHA-256 of a module, which the install prompt shows and a grant records.
|
||||
sha2 = { version = "0.10", default-features = false }
|
||||
thiserror = { workspace = true }
|
||||
# The interpreter of JavaScript plug-ins (`js.rs`).
|
||||
vectorcraft-js = { workspace = true }
|
||||
wasmi = { workspace = true }
|
||||
wasmparser = { workspace = true }
|
||||
# The monotonic clock of run deadlines and the first-view budget: `std::time::Instant` on the
|
||||
|
||||
@@ -688,7 +688,7 @@ impl Run {
|
||||
}
|
||||
}
|
||||
|
||||
fn progress(&mut self, done: i64, total: i64) {
|
||||
pub(crate) fn progress(&mut self, done: i64, total: i64) {
|
||||
let total = u64::try_from(total).unwrap_or(0);
|
||||
let done = u64::try_from(done).unwrap_or(0);
|
||||
let done = if total > 0 { done.min(total) } else { done };
|
||||
@@ -710,12 +710,12 @@ impl Run {
|
||||
vectorcraft_doc::cancel::progress(done, total, PROGRESS_STEP);
|
||||
}
|
||||
|
||||
fn cancelled(&self) -> i32 {
|
||||
pub(crate) fn cancelled(&self) -> i32 {
|
||||
i32::from(vectorcraft_doc::cancel::is_cancelled() || self.deadline.passed())
|
||||
}
|
||||
|
||||
/// Writes the `len` bytes at `ptr` in `memory` as a line of `level` → what `vc_log` returns.
|
||||
fn log(&mut self, level: i32, memory: &[u8], ptr: usize, len: usize) -> i32 {
|
||||
pub(crate) fn log(&mut self, level: i32, memory: &[u8], ptr: usize, len: usize) -> i32 {
|
||||
let Some(level) = LogLevel::from_code(level) else { return LOG_BAD_LEVEL };
|
||||
let Some(bytes) = ptr.checked_add(len).and_then(|end| memory.get(ptr..end)) else { return LOG_OUTSIDE_MEMORY };
|
||||
if self.report.truncated {
|
||||
|
||||
@@ -0,0 +1,517 @@
|
||||
//! JavaScript plug-ins: an object filter whose manifest gives `"runtime": "js"`, with its code in a
|
||||
//! JavaScript file instead of a WebAssembly module, run on `vectorcraft-js`.
|
||||
//!
|
||||
//! On disk the plug-in is a manifest file (`.vcplugin`, JSON) with `"runtime": "js"` and `script`,
|
||||
//! the name of its `.js` file in the same folder ([`crate::registry::read_js_package`]). The host
|
||||
//! loads it as one JSON object, the manifest with the script's text in `source`
|
||||
//! ([`read_bundle`]): that object is what `plugin.install {dataBase64}` takes, what the plug-in
|
||||
//! store keeps, and what the SHA-256 a grant records covers, so a change to the manifest or to the
|
||||
//! script needs a new approval. Loading parses the script and runs none of it.
|
||||
//!
|
||||
//! Each run gets a fresh realm with the language's built-ins and a `vc` object: `vc.input`
|
||||
//! and `vc.params` hold the input and parameter JSON a WebAssembly filter's `vc_run` is given, and
|
||||
//! with the `progress` permission `vc.progress(done, total)`, `vc.cancelled()` and
|
||||
//! `vc.log(level, text)` do what `vc_progress`, `vc_cancelled` and `vc_log` do ([`crate::host`]).
|
||||
//! The realm has no `$`, `File`, `Folder`, `app` or other global of the script runner, no clock
|
||||
//! (`Date.now()` is `NaN`) and no host function besides these. The script's top level runs, then
|
||||
//! `run(input, params)` is called with the parsed JSON, and the value it returns, written as JSON,
|
||||
//! is the run's output, which the host checks as it checks a WebAssembly filter's.
|
||||
//!
|
||||
//! A run is held to the filter's instruction budget (one budget for the top level and the call,
|
||||
//! checked in slices between which the deadline and Cancel are checked), a heap of at most the
|
||||
//! plug-in's memory cap, and the interpreter's frame and re-entry limits. A thrown error, a limit
|
||||
//! or a malformed result fails the run with an [`Error`] that names the plug-in, its script and,
|
||||
//! when known, the line and column.
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
use serde_json::{Map, Value};
|
||||
use vectorcraft_js::{Data, HostError, HostItem, JsValue, LimitKind, Progress, Realm, RunError, RunErrorKind};
|
||||
|
||||
use crate::host::{Deadline, LOG_BAD_LEVEL, LOG_DROPPED, LOG_WRITTEN, Report, Run};
|
||||
use crate::manifest::{MAX_MANIFEST_BYTES, Manifest, Runtime};
|
||||
use crate::permissions::{self, Permission};
|
||||
use crate::runtime::SELECTION_TOO_LARGE;
|
||||
use crate::{Error, Limits, Result};
|
||||
|
||||
/// The extension of a JavaScript plug-in's manifest file.
|
||||
pub const PACKAGE_EXT: &str = "vcplugin";
|
||||
|
||||
/// Largest script, in bytes.
|
||||
pub const MAX_SCRIPT_BYTES: usize = 8 << 20;
|
||||
|
||||
/// Longest script file name, in bytes.
|
||||
pub const MAX_SCRIPT_NAME: usize = 128;
|
||||
|
||||
/// The script's name when the plug-in's JSON gives none.
|
||||
pub const DEFAULT_SCRIPT: &str = "plugin.js";
|
||||
|
||||
/// Instructions a run executes between two checks of its deadline and Cancel.
|
||||
pub const FUEL_SLICE: u64 = 1_000_000;
|
||||
|
||||
/// Longest error message a run reports, in characters.
|
||||
const MAX_ERROR_TEXT: usize = 512;
|
||||
|
||||
/// What `script` may hold.
|
||||
const SCRIPT_NAME_RULE: &str =
|
||||
"`script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.`";
|
||||
|
||||
/// Where the script's text may be given.
|
||||
pub const SOURCE_RULE: &str =
|
||||
"`source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script`";
|
||||
|
||||
/// The error of a plug-in's JSON without `"runtime": "js"`.
|
||||
pub(crate) const NOT_JS: &str = "a JavaScript plug-in's manifest gives `runtime` \"js\"";
|
||||
|
||||
/// What the arguments of `vc.progress` and `vc.log` may be.
|
||||
const PROGRESS_ARGS: &str = "vc.progress(done, total) takes two numbers";
|
||||
const LOG_ARGS: &str = "vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string";
|
||||
|
||||
/// What runs the plug-in: its script's top level is done, `run` is called with the input and the
|
||||
/// parameters, and what it returns is written as JSON.
|
||||
const ENTRY: &str = "(function () {\n\
|
||||
if (typeof run !== 'function') throw new TypeError('the script defines no function run(input, params)');\n\
|
||||
return JSON.stringify(run(JSON.parse(vc.input), JSON.parse(vc.params)));\n\
|
||||
})()";
|
||||
|
||||
/// A JavaScript plug-in's code.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub(crate) struct Script {
|
||||
/// Its file name, which errors give.
|
||||
pub(crate) name: String,
|
||||
pub(crate) source: String,
|
||||
}
|
||||
|
||||
/// Is `name` a script file name `script` may give: a `.js` file directly in the manifest's folder?
|
||||
pub fn valid_script_name(name: &str) -> bool {
|
||||
(1..=MAX_SCRIPT_NAME).contains(&name.len())
|
||||
&& !name.starts_with('.')
|
||||
&& !name.chars().any(|c| matches!(c, '/' | '\\' | ':') || c.is_control())
|
||||
&& name.len() > 3
|
||||
&& name.get(name.len() - 3..).is_some_and(|ext| ext.eq_ignore_ascii_case(".js"))
|
||||
}
|
||||
|
||||
/// The `script` a manifest's JSON gives, checked.
|
||||
pub(crate) fn script_name(v: &Value) -> Result<String> {
|
||||
match v.as_str() {
|
||||
Some(name) if valid_script_name(name) => Ok(name.to_string()),
|
||||
_ => Err(Error::Manifest(SCRIPT_NAME_RULE.into())),
|
||||
}
|
||||
}
|
||||
|
||||
/// The error of a manifest with `"runtime": "js"` and no `script`.
|
||||
pub(crate) fn no_script() -> Error {
|
||||
Error::Manifest("`runtime` \"js\" needs `script`: the name of the plug-in's .js file, next to the manifest".into())
|
||||
}
|
||||
|
||||
/// Does `map`, a plug-in's JSON, give `"runtime": "js"`?
|
||||
pub(crate) fn is_js(map: &Map<String, Value>) -> bool {
|
||||
map.get("runtime").and_then(Value::as_str) == Some(Runtime::Js.name())
|
||||
}
|
||||
|
||||
/// How the script is read.
|
||||
fn options() -> vectorcraft_js::Options {
|
||||
vectorcraft_js::Options { max_source_units: MAX_SCRIPT_BYTES, ..vectorcraft_js::Options::default() }
|
||||
}
|
||||
|
||||
/// Reads a JavaScript plug-in given as one JSON object: its manifest, with the script's text in
|
||||
/// `source` and its file name in `script` (left out: [`DEFAULT_SCRIPT`]). The manifest is checked as
|
||||
/// a module's is, and the script is parsed, not run.
|
||||
pub(crate) fn read_bundle(bytes: &[u8]) -> Result<(Manifest, Script)> {
|
||||
let mut map: Map<String, Value> = serde_json::from_slice(bytes).map_err(|e| Error::Manifest(e.to_string()))?;
|
||||
if !is_js(&map) {
|
||||
return Err(Error::Manifest(NOT_JS.into()));
|
||||
}
|
||||
let named = map.remove("script");
|
||||
let source = match map.remove("source") {
|
||||
Some(Value::String(s)) => s,
|
||||
Some(_) => return Err(Error::Manifest(SOURCE_RULE.into())),
|
||||
None if named.is_some() => return Err(Error::Manifest(SOURCE_RULE.into())),
|
||||
None => return Err(no_script()),
|
||||
};
|
||||
let name = named.as_ref().map_or_else(|| Ok(DEFAULT_SCRIPT.to_string()), script_name)?;
|
||||
if source.len() > MAX_SCRIPT_BYTES {
|
||||
return Err(Error::Module(format!("{} is {} bytes (limit {})", name, source.len(), MAX_SCRIPT_BYTES)));
|
||||
}
|
||||
// The manifest is read from `bytes`, so `params` keep their order; its size is counted
|
||||
// without `script` and `source`.
|
||||
let size = serde_json::to_vec(&map).map_err(|e| Error::Manifest(e.to_string()))?.len();
|
||||
if size > MAX_MANIFEST_BYTES {
|
||||
return Err(Error::Manifest(format!("manifest is {size} bytes (limit {MAX_MANIFEST_BYTES})")));
|
||||
}
|
||||
let text = std::str::from_utf8(bytes).map_err(|_| Error::Manifest("manifest is not UTF-8".into()))?;
|
||||
let manifest = Manifest::parse_text(text)?;
|
||||
if let Err(e) = vectorcraft_js::parse(&source, &options()) {
|
||||
let named = Named { id: &manifest.id, script: &name };
|
||||
return Err(Error::Module(located(&permissions::display_text(&e.message, MAX_ERROR_TEXT), &named, Some((e.line, e.column)))));
|
||||
}
|
||||
Ok((manifest, Script { name, source }))
|
||||
}
|
||||
|
||||
/// `reason` followed by where it happened: the plug-in's id, its script's name and, when `at` gives
|
||||
/// them, the line and column.
|
||||
fn located(reason: &str, named: &Named<'_>, at: Option<(u32, u32)>) -> String {
|
||||
let (id, script) = (named.id, named.script);
|
||||
match at {
|
||||
Some((line, column)) if line > 0 => format!("{reason} ({id}, {script} line {line}, column {column})"),
|
||||
_ => format!("{reason} ({id}, {script})"),
|
||||
}
|
||||
}
|
||||
|
||||
/// One run's input and budgets.
|
||||
pub(crate) struct Call<'a> {
|
||||
pub(crate) input: &'a [u8],
|
||||
pub(crate) params: &'a [u8],
|
||||
pub(crate) limits: &'a Limits,
|
||||
/// The plug-in's memory cap, which the run's heap stays within.
|
||||
pub(crate) max_memory: usize,
|
||||
pub(crate) deadline: Deadline,
|
||||
}
|
||||
|
||||
/// The heap a run may use with memory cap `max_memory`.
|
||||
fn heap_bytes(max_memory: usize) -> usize {
|
||||
vectorcraft_js::Limits::default().heap_bytes.min(max_memory)
|
||||
}
|
||||
|
||||
/// Runs `script`, the code of the plug-in `m` describes, on `call`'s input in a fresh realm → the
|
||||
/// output JSON. What it reported with `vc.progress` and `vc.log` goes to `report`.
|
||||
pub(crate) fn run(script: &Script, m: &Manifest, call: &Call<'_>, state: Run, report: &mut Report) -> Result<Vec<u8>> {
|
||||
let heap = heap_bytes(call.max_memory);
|
||||
// Each UTF-8 byte may become a UTF-16 code unit of two bytes, and the parsed JSON takes more.
|
||||
if call.input.len().saturating_add(call.params.len()) > heap / 8 {
|
||||
return Err(Error::Limit(SELECTION_TOO_LARGE.into()));
|
||||
}
|
||||
// The host writes the input and the parameters with serde_json, so they are UTF-8.
|
||||
let (input, params) = (String::from_utf8_lossy(call.input), String::from_utf8_lossy(call.params));
|
||||
let state = Rc::new(RefCell::new(state));
|
||||
let out = run_realm(script, m, (&*input, &*params), call, heap, &state);
|
||||
*report = std::mem::take(&mut state.borrow_mut().report);
|
||||
out
|
||||
}
|
||||
|
||||
/// What errors name: the plug-in's id and its script's file name.
|
||||
struct Named<'a> {
|
||||
id: &'a str,
|
||||
script: &'a str,
|
||||
}
|
||||
|
||||
fn run_realm(
|
||||
script: &Script,
|
||||
m: &Manifest,
|
||||
(input, params): (&str, &str),
|
||||
call: &Call<'_>,
|
||||
heap: usize,
|
||||
state: &Rc<RefCell<Run>>,
|
||||
) -> Result<Vec<u8>> {
|
||||
let defaults = vectorcraft_js::Limits::default();
|
||||
let fuel = call.limits.fuel_base.saturating_add((call.input.len() as u64).saturating_mul(call.limits.fuel_per_byte));
|
||||
let limits = vectorcraft_js::Limits { fuel, heap_bytes: heap, ..defaults };
|
||||
let mut realm = Realm::with_options(options(), limits);
|
||||
realm.set_clock(|| f64::NAN);
|
||||
let named = Named { id: &m.id, script: &script.name };
|
||||
realm.define_host_object("vc", vc_items(input, params, m, state)).map_err(|e| match e.kind {
|
||||
RunErrorKind::Limit(LimitKind::Heap) => Error::Limit(SELECTION_TOO_LARGE.into()),
|
||||
_ => js_error(&realm, e, vectorcraft_js::UNKNOWN_SOURCE, &named),
|
||||
})?;
|
||||
let (_, tag) = drive(&mut realm, &script.source, &call.deadline, &named, None)?;
|
||||
// The call takes what the top level left of the budget.
|
||||
let left = realm.fuel_left();
|
||||
realm.set_limits(vectorcraft_js::Limits { fuel: left, ..realm.limits().clone() });
|
||||
let (value, _) = drive(&mut realm, ENTRY, &call.deadline, &named, Some(tag))?;
|
||||
vectorcraft_doc::cancel::check().map_err(|_| Error::Cancelled)?;
|
||||
call.deadline.check()?;
|
||||
match value {
|
||||
JsValue::String(s) if s.len() > call.limits.max_output_bytes => {
|
||||
let (what, len, max) = ("the output", s.len(), call.limits.max_output_bytes);
|
||||
Err(Error::Limit(format!("output size ({what} is {len} bytes, limit {max})")))
|
||||
}
|
||||
JsValue::String(s) => Ok(s.into_bytes()),
|
||||
_ => Err(Error::Output(located(NO_OUTPUT, &named, None))),
|
||||
}
|
||||
}
|
||||
|
||||
/// The error of a `run` that returned nothing JSON can write.
|
||||
const NO_OUTPUT: &str = "run(input, params) returned no output object";
|
||||
|
||||
/// The limit a run that nested its calls too deeply exceeded.
|
||||
const CALL_DEPTH: &str = "call depth";
|
||||
|
||||
/// Runs `source` in `realm` to its end, in slices of [`FUEL_SLICE`] with the deadline and Cancel
|
||||
/// checked between them → its completion value, and the source tag of the plug-in's script:
|
||||
/// `script_tag`, or with `None` the tag of `source`, which is then the script.
|
||||
fn drive(realm: &mut Realm, source: &str, deadline: &Deadline, named: &Named<'_>, script_tag: Option<u32>) -> Result<(JsValue, u32)> {
|
||||
let started = realm.start(source);
|
||||
let tag = script_tag.unwrap_or_else(|| realm.script_tag());
|
||||
started.map_err(|e| js_error(realm, e, tag, named))?;
|
||||
loop {
|
||||
match realm.advance(FUEL_SLICE) {
|
||||
Ok(Progress::Done(v)) => return Ok((v, tag)),
|
||||
Ok(Progress::Paused) => {}
|
||||
Err(e) => return Err(js_error(realm, e, tag, named)),
|
||||
}
|
||||
if vectorcraft_doc::cancel::check().is_err() {
|
||||
realm.end();
|
||||
return Err(Error::Cancelled);
|
||||
}
|
||||
if let Err(e) = deadline.check() {
|
||||
realm.end();
|
||||
return Err(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The plug-in error for `e`, which a run of `realm` ended with: it names the plug-in and the script,
|
||||
/// and the line and column when the error is in the script (source tag `tag`).
|
||||
fn js_error(realm: &Realm, e: RunError, tag: u32, named: &Named<'_>) -> Error {
|
||||
let at = (realm.error_tag() == tag).then_some((e.line, e.column));
|
||||
let message = permissions::display_text(&e.message, MAX_ERROR_TEXT);
|
||||
match e.kind {
|
||||
RunErrorKind::Syntax => Error::Module(located(&message, named, at)),
|
||||
RunErrorKind::Thrown | RunErrorKind::Limit(LimitKind::Host) => Error::Failed(located(&message, named, at)),
|
||||
RunErrorKind::Limit(LimitKind::Jobs) => Error::Limit(located(&message, named, at)),
|
||||
RunErrorKind::Limit(LimitKind::Fuel | LimitKind::Unbroken) => Error::Limit(located("instruction budget", named, at)),
|
||||
RunErrorKind::Limit(LimitKind::Heap) => Error::Limit(located("memory budget", named, at)),
|
||||
RunErrorKind::Limit(LimitKind::Frames | LimitKind::Reentry) => Error::Limit(located(CALL_DEPTH, named, at)),
|
||||
RunErrorKind::Limit(LimitKind::Interrupted) => Error::Cancelled,
|
||||
RunErrorKind::Internal => Error::Trap(located(&message, named, at)),
|
||||
}
|
||||
}
|
||||
|
||||
/// The members of the realm's `vc` object.
|
||||
fn vc_items(input: &str, params: &str, m: &Manifest, state: &Rc<RefCell<Run>>) -> Vec<(String, HostItem)> {
|
||||
let mut items = vec![
|
||||
("input".to_string(), HostItem::Value(Data::String(input.into()))),
|
||||
("params".to_string(), HostItem::Value(Data::String(params.into()))),
|
||||
];
|
||||
if !m.permissions().contains(&Permission::Progress) {
|
||||
return items;
|
||||
}
|
||||
let number = |args: &[Data], i: usize, rule: &str| match args.get(i) {
|
||||
Some(Data::Number(n)) => Ok(*n),
|
||||
_ => Err(HostError::Type(rule.into())),
|
||||
};
|
||||
let run = state.clone();
|
||||
items.push((
|
||||
"progress".into(),
|
||||
HostItem::Function(Rc::new(move |args| {
|
||||
let (done, total) = (number(&args, 0, PROGRESS_ARGS)?, number(&args, 1, PROGRESS_ARGS)?);
|
||||
// `as` turns NaN into 0 and clamps the rest, as `vc_progress` clamps negative values.
|
||||
run.borrow_mut().progress(done as i64, total as i64);
|
||||
Ok(Data::Undefined)
|
||||
})),
|
||||
));
|
||||
let run = state.clone();
|
||||
items.push(("cancelled".into(), HostItem::Function(Rc::new(move |_| Ok(Data::Bool(run.borrow().cancelled() == 1))))));
|
||||
let run = state.clone();
|
||||
items.push((
|
||||
"log".into(),
|
||||
HostItem::Function(Rc::new(move |args| {
|
||||
let level = number(&args, 0, LOG_ARGS)?;
|
||||
let Some(Data::String(text)) = args.get(1) else { return Err(HostError::Type(LOG_ARGS.into())) };
|
||||
let level = if level.fract() == 0.0 && (0.0..=3.0).contains(&level) { level as i32 } else { LOG_BAD_LEVEL };
|
||||
match run.borrow_mut().log(level, text.as_bytes(), 0, text.len()) {
|
||||
LOG_WRITTEN => Ok(Data::Bool(true)),
|
||||
LOG_DROPPED => Ok(Data::Bool(false)),
|
||||
_ => Err(HostError::Range(LOG_ARGS.into())),
|
||||
}
|
||||
})),
|
||||
));
|
||||
items
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use serde_json::{Value, json};
|
||||
|
||||
use crate::{Error, Limits, Plugin};
|
||||
|
||||
/// A JavaScript filter `id` with `source` as its code, and `extra` manifest keys.
|
||||
fn bundle(id: &str, source: &str, extra: Value) -> Vec<u8> {
|
||||
let mut m = json!({"id": id, "name": "JS test", "kind": "filter", "runtime": "js", "script": "test.js", "source": source});
|
||||
if let (Some(m), Value::Object(extra)) = (m.as_object_mut(), extra) {
|
||||
m.extend(extra);
|
||||
}
|
||||
serde_json::to_vec(&m).unwrap()
|
||||
}
|
||||
|
||||
fn load(bytes: &[u8]) -> crate::Result<Plugin> {
|
||||
load_with(bytes, Limits::default())
|
||||
}
|
||||
|
||||
fn load_with(bytes: &[u8], limits: Limits) -> crate::Result<Plugin> {
|
||||
let _lock = crate::safe_mode::TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner());
|
||||
Plugin::load(bytes, limits)
|
||||
}
|
||||
|
||||
const PATH: &str = r#"{"objects":[{"id":7,"type":"path","fills":[{"type":"solid","color":{"model":"rgb","r":1,"g":0,"b":0}}]}]}"#;
|
||||
|
||||
/// The output of `run(input, params)` is the run's output JSON.
|
||||
#[test]
|
||||
fn a_filter_returns_its_objects_as_json() {
|
||||
let src = "function run(input, params) { return {objects: input.objects.map(function (o) { \
|
||||
return {id: o.id, fills: [{type: 'solid', color: {model: 'rgb', r: 0, g: 0, b: params.blue}}]}; })}; }";
|
||||
let p = load(&bundle("test.js.blue", src, json!({}))).unwrap();
|
||||
assert_eq!((p.runtime(), p.script()), (crate::Runtime::Js, Some("test.js")));
|
||||
let out: Value = serde_json::from_slice(&p.run(PATH.as_bytes(), br#"{"blue":1}"#).unwrap()).unwrap();
|
||||
assert_eq!(out, json!({"objects": [{"id": 7, "fills": [{"type": "solid", "color": {"model": "rgb", "r": 0, "g": 0, "b": 1}}]}]}));
|
||||
}
|
||||
|
||||
/// The realm has none of the script runner's globals, so code that reads them throws a
|
||||
/// `ReferenceError` naming the global, the plug-in and where in its script.
|
||||
#[test]
|
||||
fn file_folder_and_app_are_not_defined() {
|
||||
for name in ["File", "Folder", "$", "app", "BridgeTalk"] {
|
||||
let src = format!("function run(input) {{\n return {name}.x;\n}}");
|
||||
let e = load(&bundle("test.js.globals", &src, json!({}))).unwrap().run(PATH.as_bytes(), b"{}").unwrap_err();
|
||||
let Error::Failed(why) = &e else { panic!("{name}: {e:?}") };
|
||||
assert!(why.starts_with("ReferenceError") && why.contains(name), "{name}: {why}");
|
||||
assert!(why.ends_with("(test.js.globals, test.js line 2, column 10)"), "{name}: {why}");
|
||||
}
|
||||
let p = load(&bundle("test.js.clock", "function run() { return {objects: [], n: String(Date.now())}; }", json!({}))).unwrap();
|
||||
let out: Value = serde_json::from_slice(&p.run(b"{\"objects\":[]}", b"{}").unwrap()).unwrap();
|
||||
assert_eq!(out["n"], "NaN", "no clock");
|
||||
}
|
||||
|
||||
/// Each run has a realm of its own: what one run changes in the built-ins, the next run doesn't
|
||||
/// see.
|
||||
#[test]
|
||||
fn a_polluted_prototype_does_not_reach_the_next_run() {
|
||||
let src = "function run() { var seen = Object.prototype.polluted; Object.prototype.polluted = 1; \
|
||||
Array.prototype.map = null; return {objects: [], seen: String(seen)}; }";
|
||||
let p = load(&bundle("test.js.pollute", src, json!({}))).unwrap();
|
||||
for _ in 0..2 {
|
||||
let out: Value = serde_json::from_slice(&p.run(b"{\"objects\":[]}", b"{}").unwrap()).unwrap();
|
||||
assert_eq!(out["seen"], "undefined");
|
||||
}
|
||||
}
|
||||
|
||||
/// An endless loop ends with the instruction budget, naming the plug-in and the line.
|
||||
#[test]
|
||||
fn an_endless_loop_ends_with_the_instruction_budget() {
|
||||
let p = load(&bundle("test.js.loop", "function run() {\n for (;;) {}\n}", json!({}))).unwrap();
|
||||
let limits = Limits { fuel_base: 3 * super::FUEL_SLICE, fuel_per_byte: 0, ..Limits::default() };
|
||||
let e = p.run_limited(b"{\"objects\":[]}", b"{}", &limits).unwrap_err();
|
||||
assert!(matches!(&e, Error::Limit(why) if why.starts_with("instruction budget (test.js.loop, test.js line 2")), "{e:?}");
|
||||
}
|
||||
|
||||
/// A plug-in that fills its heap ends with its memory budget, and a realm another caller holds
|
||||
/// meanwhile, such as a script's, runs on as before.
|
||||
#[test]
|
||||
fn heap_exhaustion_leaves_a_held_realm_usable() {
|
||||
let mut held = vectorcraft_js::Realm::new();
|
||||
held.run("var kept = 41;").unwrap();
|
||||
let src = "function run() { var a = []; for (;;) { a.push(new Array(1000).join('x') + a.length); } }";
|
||||
let small = load_with(&bundle("test.js.heap", src, json!({})), Limits { max_memory_bytes: 8 << 20, ..Limits::default() }).unwrap();
|
||||
let e = small.run(b"{\"objects\":[]}", b"{}").unwrap_err();
|
||||
assert!(matches!(&e, Error::Limit(why) if why.starts_with("memory budget (test.js.heap")), "{e:?}");
|
||||
assert_eq!(held.run("kept + 1").unwrap(), vectorcraft_js::JsValue::Number(42.0));
|
||||
}
|
||||
|
||||
/// An input too large for the heap is refused before it is copied in.
|
||||
#[test]
|
||||
fn a_selection_too_large_for_the_heap_is_refused() {
|
||||
let small =
|
||||
load_with(&bundle("test.js.big", "function run(i) { return i; }", json!({})), Limits { max_memory_bytes: 1 << 20, ..Limits::default() })
|
||||
.unwrap();
|
||||
let input = format!(r#"{{"objects":[],"pad":"{}"}}"#, "x".repeat(200_000));
|
||||
assert_eq!(small.run(input.as_bytes(), b"{}"), Err(Error::Limit(crate::runtime::SELECTION_TOO_LARGE.into())));
|
||||
}
|
||||
|
||||
/// A result that isn't an output object, and a script without `run`, fail the run.
|
||||
#[test]
|
||||
fn a_missing_entry_or_result_fails_the_run() {
|
||||
let e = load(&bundle("test.js.none", "var x = 1;", json!({}))).unwrap().run(b"{\"objects\":[]}", b"{}").unwrap_err();
|
||||
assert!(matches!(&e, Error::Failed(why) if why.contains("defines no function run")), "{e:?}");
|
||||
let e = load(&bundle("test.js.undef", "function run() {}", json!({}))).unwrap().run(b"{\"objects\":[]}", b"{}").unwrap_err();
|
||||
assert!(matches!(&e, Error::Output(why) if why.contains("test.js.undef")), "{e:?}");
|
||||
let e = load(&bundle("test.js.cycle", "function run() { var o = {}; o.o = o; return o; }", json!({})))
|
||||
.unwrap()
|
||||
.run(b"{\"objects\":[]}", b"{}")
|
||||
.unwrap_err();
|
||||
assert!(matches!(&e, Error::Failed(why) if why.starts_with("TypeError")), "{e:?}");
|
||||
}
|
||||
|
||||
/// With `progress`, `vc.progress` and `vc.log` report as their imports do; without it, `vc`
|
||||
/// has neither.
|
||||
#[test]
|
||||
fn progress_and_log_need_the_progress_permission() {
|
||||
let src = "function run() { vc.progress(3, 4); vc.log(2, 'half'); return {objects: [], cancelled: vc.cancelled()}; }";
|
||||
let p = load(&bundle("test.js.progress", src, json!({"api": 2, "permissions": ["progress"]}))).unwrap();
|
||||
let (out, report) = p.run_reporting(b"{\"objects\":[]}", b"{}", p.limits());
|
||||
let out: Value = serde_json::from_slice(&out.unwrap()).unwrap();
|
||||
assert_eq!(out["cancelled"], false);
|
||||
assert_eq!(report.progress, Some((3, 4)));
|
||||
assert_eq!(report.lines, vec![crate::LogLine { level: crate::LogLevel::Info, text: "half".into() }]);
|
||||
let e = load(&bundle("test.js.quiet", src, json!({}))).unwrap().run(b"{\"objects\":[]}", b"{}").unwrap_err();
|
||||
assert!(matches!(&e, Error::Failed(why) if why.starts_with("TypeError")), "{e:?}");
|
||||
}
|
||||
|
||||
/// Loading checks the manifest and the script, and runs none of it.
|
||||
#[test]
|
||||
fn loading_refuses_a_bad_manifest_or_script() {
|
||||
let ok = "function run() { return {objects: []}; }";
|
||||
let refused = |bytes: Vec<u8>| load(&bytes).unwrap_err();
|
||||
let e = refused(bundle("test.js.syntax", "function run( {", json!({})));
|
||||
assert!(matches!(&e, Error::Module(why) if why.contains("(test.js.syntax, test.js line 1, column")), "{e:?}");
|
||||
let big = "x".repeat(super::MAX_SCRIPT_BYTES + 1);
|
||||
assert!(matches!(refused(bundle("test.js.big", &big, json!({}))), Error::Module(why) if why.starts_with("test.js is")));
|
||||
let e = refused(bundle("test.js.effect", ok, json!({"kind": "effect"})));
|
||||
assert!(matches!(&e, Error::Manifest(why) if why.contains("`runtime` \"js\" is for an object filter")), "{e:?}");
|
||||
let e = refused(bundle("test.js.settings", ok, json!({"api": 2, "permissions": ["settings"]})));
|
||||
assert!(matches!(&e, Error::Manifest(why) if why.contains("`settings`")), "{e:?}");
|
||||
let e = refused(bundle("test.js.name", ok, json!({"script": "../x.js"})));
|
||||
assert!(matches!(&e, Error::Manifest(why) if why.starts_with("`script`")), "{e:?}");
|
||||
let e = refused(bundle("test.js.py", ok, json!({"runtime": "py"})));
|
||||
assert!(matches!(&e, Error::Manifest(why) if why == super::NOT_JS), "{e:?}");
|
||||
let mut no_source: Value = serde_json::from_slice(&bundle("test.js.nosource", ok, json!({}))).unwrap();
|
||||
no_source.as_object_mut().unwrap().remove("source");
|
||||
let e = refused(serde_json::to_vec(&no_source).unwrap());
|
||||
assert!(matches!(&e, Error::Manifest(why) if why.contains("`source`")), "{e:?}");
|
||||
// Top-level code that would throw does not run at load.
|
||||
assert!(load(&bundle("test.js.lazy", "throw new Error('ran');", json!({}))).is_ok());
|
||||
}
|
||||
|
||||
/// A WebAssembly module's manifest can't give `"runtime": "js"`.
|
||||
#[test]
|
||||
fn a_module_manifest_cannot_be_javascript() {
|
||||
let manifest = r#"{"id":"test.js.wasm","name":"T","kind":"filter","runtime":"js"}"#;
|
||||
let bytes = wat::parse_str(crate::wat::returning(manifest, r#"{"objects":[]}"#)).unwrap();
|
||||
assert!(matches!(load(&bytes), Err(Error::Manifest(why)) if why.contains("`runtime`")));
|
||||
}
|
||||
|
||||
/// The SHA-256 a grant records is the bundle's, so another script is another module.
|
||||
#[test]
|
||||
fn the_hash_covers_the_script() {
|
||||
let a = load(&bundle("test.js.hash", "function run() { return {objects: []}; }", json!({}))).unwrap();
|
||||
let b = load(&bundle("test.js.hash", "function run() { return {objects: [] }; }", json!({}))).unwrap();
|
||||
assert_ne!(a.hash(), b.hash());
|
||||
}
|
||||
|
||||
/// The parameters, and a command's, keep the order the plug-in's JSON declares them in.
|
||||
#[test]
|
||||
fn params_keep_their_declaration_order() {
|
||||
let num = r#"{"type": "number", "min": 0, "max": 10, "default": 1}"#;
|
||||
let text = format!(
|
||||
r#"{{"id": "test.js.order", "name": "JS test", "kind": "filter", "runtime": "js", "script": "test.js",
|
||||
"params": {{"z": {num}, "a": {num}, "m": {num}}},
|
||||
"commands": [{{"id": "go", "label": "Go", "params": {{"y": {num}, "b": {num}}}}}],
|
||||
"source": "function run(i) {{ return i; }}"}}"#
|
||||
);
|
||||
let (manifest, _) = super::read_bundle(text.as_bytes()).unwrap();
|
||||
let names = |p: &[(String, crate::manifest::Param)]| p.iter().map(|(k, _)| k.clone()).collect::<Vec<_>>();
|
||||
assert_eq!(names(&manifest.params), ["z", "a", "m"]);
|
||||
assert_eq!(names(&manifest.commands[0].params), ["y", "b"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn script_names_stay_in_the_manifest_s_folder() {
|
||||
for ok in ["tint.js", "Tint Tool.JS", "a.b.js"] {
|
||||
assert!(super::valid_script_name(ok), "{ok}");
|
||||
}
|
||||
for bad in ["", ".js", ".hidden.js", "../x.js", "sub/x.js", "sub\\x.js", "c:x.js", "x.jsx", "x.js\n", "x.wasm"] {
|
||||
assert!(!super::valid_script_name(bad), "{bad:?}");
|
||||
}
|
||||
assert!(!super::valid_script_name(&format!("{}.js", "a".repeat(126))));
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,10 @@
|
||||
//! the set of [`permissions`] its manifest lists, which the user approves when it is installed. A
|
||||
//! filter or a live effect may also add menu commands of its own ([`Command`]), which the host
|
||||
//! runs through `vc_run` with the command's id in `_context`.
|
||||
//!
|
||||
//! An object filter may also be written in JavaScript ([`js`]): its manifest gives
|
||||
//! `"runtime": "js"` and names a `.js` file, which runs in a fresh `vectorcraft-js` realm for each
|
||||
//! run, with the same input, output, permissions and budgets.
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
pub mod deferred;
|
||||
@@ -40,6 +44,7 @@ pub mod effect;
|
||||
pub mod export;
|
||||
pub mod host;
|
||||
pub mod import;
|
||||
pub mod js;
|
||||
pub mod loader;
|
||||
pub mod manifest;
|
||||
pub mod objects;
|
||||
@@ -53,7 +58,7 @@ pub mod wat;
|
||||
|
||||
pub use dialog::ParamUi;
|
||||
pub use host::{LogLevel, LogLine, Report};
|
||||
pub use manifest::{Budget, Command, ContextSection, InputKind, Kind, Manifest, MenuPlace, Param, ParamSpec};
|
||||
pub use manifest::{Budget, Command, ContextSection, InputKind, Kind, Manifest, MenuPlace, Param, ParamSpec, Runtime};
|
||||
pub use runtime::{ABI_VERSION, HEAVY_FUEL, HEAVY_WALL_TIME_MS, LARGE_FUEL, Limits, Plugin, heavy_terms};
|
||||
#[doc(hidden)]
|
||||
pub use runtime::{BYTES_COPIED_PER_FUEL, FUEL_SLICE};
|
||||
|
||||
@@ -224,6 +224,32 @@ impl Budget {
|
||||
}
|
||||
}
|
||||
|
||||
/// What runs a plug-in's code.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum Runtime {
|
||||
/// A WebAssembly module ([`crate::Plugin::load`]); the manifest is the module's `vc_manifest`.
|
||||
#[default]
|
||||
Wasm,
|
||||
/// A JavaScript file run on `vectorcraft-js` ([`crate::js`]): an object filter whose manifest
|
||||
/// gives `"runtime": "js"`.
|
||||
Js,
|
||||
}
|
||||
|
||||
impl Runtime {
|
||||
pub fn name(self) -> &'static str {
|
||||
match self {
|
||||
Runtime::Wasm => "wasm",
|
||||
Runtime::Js => "js",
|
||||
}
|
||||
}
|
||||
|
||||
/// WebAssembly, which a manifest written back leaves out (`skip_serializing_if`).
|
||||
fn is_wasm(&self) -> bool {
|
||||
*self == Runtime::Wasm
|
||||
}
|
||||
}
|
||||
|
||||
/// One declared parameter.
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(tag = "type", rename_all = "camelCase")]
|
||||
@@ -494,6 +520,9 @@ pub struct Manifest {
|
||||
/// lists any ([`Manifest::validate`]).
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub command_allowlist: Vec<String>,
|
||||
/// What runs its code: WebAssembly when left out, or `"js"` for a JavaScript filter.
|
||||
#[serde(default, skip_serializing_if = "Runtime::is_wasm")]
|
||||
pub runtime: Runtime,
|
||||
}
|
||||
|
||||
impl Manifest {
|
||||
@@ -503,6 +532,13 @@ impl Manifest {
|
||||
return Err(Error::Manifest(format!("manifest is {} bytes (limit {MAX_MANIFEST_BYTES})", bytes.len())));
|
||||
}
|
||||
let text = std::str::from_utf8(bytes).map_err(|_| Error::Manifest("manifest is not UTF-8".into()))?;
|
||||
Manifest::parse_text(text)
|
||||
}
|
||||
|
||||
/// [`Manifest::parse`] without its size limit, for JSON that holds other keys besides the
|
||||
/// manifest's (a JavaScript plug-in's `source`), whose caller checks the manifest's size. Keys
|
||||
/// the manifest doesn't declare are ignored, and `params` keep the order the text gives them.
|
||||
pub(crate) fn parse_text(text: &str) -> Result<Manifest> {
|
||||
if serde_json::from_str::<Value>(text).is_ok_and(|v| v.get("paintOutput").is_some_and(|p| *p != Value::Bool(true))) {
|
||||
return Err(Error::Manifest("`paintOutput` may only be true".into()));
|
||||
}
|
||||
@@ -533,6 +569,7 @@ impl Manifest {
|
||||
paint_output: false,
|
||||
commands: Vec::new(),
|
||||
command_allowlist: Vec::new(),
|
||||
runtime: Runtime::Wasm,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -620,7 +657,30 @@ impl Manifest {
|
||||
}
|
||||
self.validate_params()?;
|
||||
self.validate_commands()?;
|
||||
self.validate_allowlist()
|
||||
self.validate_allowlist()?;
|
||||
self.validate_runtime()
|
||||
}
|
||||
|
||||
/// A JavaScript plug-in (`"runtime": "js"`) is an object filter, and of the host's permissions
|
||||
/// it lists only `progress`: its realm has no settings, cache or command calls.
|
||||
fn validate_runtime(&self) -> Result<()> {
|
||||
if self.runtime == Runtime::Wasm {
|
||||
return Ok(());
|
||||
}
|
||||
if self.kind != Kind::Filter {
|
||||
let kind = self.kind.name();
|
||||
return Err(Error::Manifest(format!("`runtime` \"js\" is for an object filter (`kind` \"filter\"), not `kind` \"{kind}\"")));
|
||||
}
|
||||
let listed = self.permissions.as_deref().unwrap_or_default();
|
||||
for p in [Permission::Settings, Permission::Cache, Permission::Commands] {
|
||||
if listed.iter().any(|n| n == p.name()) {
|
||||
let name = p.name();
|
||||
return Err(Error::Manifest(format!(
|
||||
"a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress`"
|
||||
)));
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// `commandAllowlist` lists at most [`MAX_ALLOWED_COMMANDS`] distinct command ids
|
||||
|
||||
@@ -279,14 +279,73 @@ pub fn intern(s: &str) -> &'static str {
|
||||
v
|
||||
}
|
||||
|
||||
/// Reads a `.wasm` file (refusing anything that isn't a regular file or exceeds the module limit)
|
||||
/// Reads a `.wasm` file (refusing anything that isn't a regular file or exceeds the module limit),
|
||||
/// or a JavaScript plug-in's `.vcplugin` manifest and the script it names ([`read_js_package`]),
|
||||
/// and loads it.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub fn load_file(path: &std::path::Path, limits: Limits) -> Result<Plugin> {
|
||||
let bytes = read_module(path, &limits, || {})?;
|
||||
load_file_where(path, limits, &|_| Ok(()))
|
||||
}
|
||||
|
||||
/// [`load_file`], reading a JavaScript plug-in's script only when `allow` accepts its path.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn load_file_where(path: &std::path::Path, limits: Limits, allow: &dyn Fn(&std::path::Path) -> std::result::Result<(), String>) -> Result<Plugin> {
|
||||
let bytes = if is_js_package(path) { read_js_package(path, allow)? } else { read_module(path, &limits, || {})? };
|
||||
Ok(Plugin::load(&bytes, limits)?.with_source(path.display().to_string()))
|
||||
}
|
||||
|
||||
/// Does `path` name a JavaScript plug-in's manifest file: is its extension `.vcplugin`?
|
||||
pub fn is_js_package(path: &std::path::Path) -> bool {
|
||||
path.extension().is_some_and(|x| x.eq_ignore_ascii_case(crate::js::PACKAGE_EXT))
|
||||
}
|
||||
|
||||
/// The JavaScript plug-in whose manifest file is `path`, as the one JSON object [`Plugin::load`]
|
||||
/// reads: the manifest, with the text of the script its `script` names in `source`. The manifest
|
||||
/// file must give `"runtime": "js"` and `script`, a `.js` file in the same folder, and no `source`.
|
||||
/// Each file is refused before it is read when it isn't a regular file or is larger than its limit
|
||||
/// ([`crate::manifest::MAX_MANIFEST_BYTES`], [`crate::js::MAX_SCRIPT_BYTES`]); the script is read
|
||||
/// only when `allow` accepts its path, and must be UTF-8.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub fn read_js_package(path: &std::path::Path, allow: &dyn Fn(&std::path::Path) -> std::result::Result<(), String>) -> Result<Vec<u8>> {
|
||||
read_js_package_with(path, allow, || {})
|
||||
}
|
||||
|
||||
/// [`read_js_package`], with `opening` run between the script's size check and its open.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn read_js_package_with(
|
||||
path: &std::path::Path,
|
||||
allow: &dyn Fn(&std::path::Path) -> std::result::Result<(), String>,
|
||||
opening: impl FnOnce(),
|
||||
) -> Result<Vec<u8>> {
|
||||
use serde_json::Value;
|
||||
let manifest_limits = Limits { max_module_bytes: crate::manifest::MAX_MANIFEST_BYTES, ..Limits::default() };
|
||||
let bytes = read_module(path, &manifest_limits, || {})?;
|
||||
let map: serde_json::Map<String, Value> = serde_json::from_slice(&bytes).map_err(|e| Error::Manifest(format!("{}: {e}", path.display())))?;
|
||||
if !crate::js::is_js(&map) {
|
||||
return Err(Error::Manifest(crate::js::NOT_JS.into()));
|
||||
}
|
||||
if map.contains_key("source") {
|
||||
return Err(Error::Manifest(crate::js::SOURCE_RULE.into()));
|
||||
}
|
||||
let name = crate::js::script_name(map.get("script").ok_or_else(crate::js::no_script)?)?;
|
||||
let file = path.parent().unwrap_or(std::path::Path::new("")).join(&name);
|
||||
allow(&file).map_err(Error::Io)?;
|
||||
let script_limits = Limits { max_module_bytes: crate::js::MAX_SCRIPT_BYTES, ..Limits::default() };
|
||||
let source = read_module(&file, &script_limits, opening)?;
|
||||
let source = String::from_utf8(source).map_err(|_| Error::Module("the script is not UTF-8 text".into()))?;
|
||||
// `source` is added to the manifest's own text, so its keys keep their order. The text parsed as
|
||||
// an object that has `runtime`, so its last character other than white space is its closing `}`.
|
||||
let end = bytes.iter().rposition(|b| !b.is_ascii_whitespace()).filter(|&i| bytes[i] == b'}');
|
||||
let end = end.ok_or_else(|| Error::Manifest(format!("{}: not a JSON object", path.display())))?;
|
||||
let source = serde_json::to_vec(&Value::String(source)).map_err(|e| Error::Manifest(e.to_string()))?;
|
||||
let mut out = Vec::with_capacity(bytes.len() + source.len() + 12);
|
||||
out.extend_from_slice(&bytes[..end]);
|
||||
out.extend_from_slice(b",\"source\":");
|
||||
out.extend_from_slice(&source);
|
||||
out.push(b'}');
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// The bytes of the module file at `path`. A path that doesn't name a regular file is refused
|
||||
/// before it is opened, and so is one over the module limit. On Unix the file is opened without
|
||||
/// waiting, so a named pipe put in its place after that check doesn't hold the load until something
|
||||
@@ -329,7 +388,7 @@ fn open_module(path: &std::path::Path) -> std::io::Result<std::fs::File> {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
const MAX_FOLDER_FILES: usize = 1000;
|
||||
|
||||
/// The first [`MAX_FOLDER_FILES`] `*.wasm` paths directly in `dir` by file name, sorted, and how
|
||||
/// The first [`MAX_FOLDER_FILES`] `*.wasm` and `*.vcplugin` paths directly in `dir` by file name, sorted, and how
|
||||
/// many more there are. Only that many paths are held while the folder is listed. An error while
|
||||
/// the folder is listed is returned, as one opening it is.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
@@ -340,7 +399,7 @@ fn folder_files(dir: &std::path::Path) -> Result<(Vec<std::path::PathBuf>, usize
|
||||
let mut more = 0;
|
||||
for entry in rd {
|
||||
let p = entry.map_err(io)?.path();
|
||||
if !p.extension().is_some_and(|x| x.eq_ignore_ascii_case("wasm")) {
|
||||
if !p.extension().is_some_and(|x| x.eq_ignore_ascii_case("wasm")) && !is_js_package(&p) {
|
||||
continue;
|
||||
}
|
||||
kept.push(p);
|
||||
@@ -373,7 +432,7 @@ pub struct FolderReport {
|
||||
pub no_thread: bool,
|
||||
}
|
||||
|
||||
/// Installs every `*.wasm` directly in `dir` (not recursive), in file-name order, up to the first
|
||||
/// Installs every `*.wasm` and `*.vcplugin` ([`read_js_package`]) directly in `dir` (not recursive), in file-name order, up to the first
|
||||
/// 1,000 by file name; the report counts the files left out ([`FolderReport::left_out`]). Anything
|
||||
/// that isn't a regular file, such as a named pipe, is reported and skipped without waiting on it
|
||||
/// ([`load_file`]). The modules load on worker threads ([`FolderLoad`]) and install in file-name
|
||||
@@ -386,7 +445,7 @@ pub fn load_folder(dir: &std::path::Path) -> Result<FolderReport> {
|
||||
load_folder_where(dir, |_| Ok(()), approved)
|
||||
}
|
||||
|
||||
/// [`load_folder`], loading only the files `allow` accepts, and of the plug-ins that list
|
||||
/// [`load_folder`], loading only the files `allow` accepts (a JavaScript plug-in's script too), and of the plug-ins that list
|
||||
/// permissions only those `approve` accepts and a recorded grant covers ([`install`]); the others
|
||||
/// are reported as failed with the reason. A plug-in the user disabled ([`crate::safe_mode::skipped`]) is reported and
|
||||
/// skipped, by its file before it loads or by its id after (its file is then disabled too, so the
|
||||
@@ -500,7 +559,7 @@ impl FolderLoad {
|
||||
hook(&path);
|
||||
}
|
||||
}
|
||||
load_file(&path, Limits::default())
|
||||
load_file_where(&path, Limits::default(), &*allow)
|
||||
}));
|
||||
}
|
||||
files.push((f, refused));
|
||||
@@ -885,6 +944,104 @@ mod tests {
|
||||
assert!(matches!(&read, Err(Error::Module(e)) if e.contains("limit 16")), "{read:?}");
|
||||
}
|
||||
|
||||
/// A JavaScript plug-in's manifest file and its script, in `dir`.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn write_js(dir: &std::path::Path, id: &str, manifest: serde_json::Value, script: Option<&str>) -> std::path::PathBuf {
|
||||
let mut m = serde_json::json!({"id": id, "name": "JS", "kind": "filter", "runtime": "js", "script": "f.js"});
|
||||
if let (Some(m), serde_json::Value::Object(extra)) = (m.as_object_mut(), manifest) {
|
||||
m.extend(extra);
|
||||
}
|
||||
let path = dir.join(format!("{id}.vcplugin"));
|
||||
std::fs::write(&path, serde_json::to_vec(&m).unwrap()).unwrap();
|
||||
if let Some(script) = script {
|
||||
std::fs::write(dir.join("f.js"), script).unwrap();
|
||||
}
|
||||
path
|
||||
}
|
||||
|
||||
/// A `.vcplugin` in a folder installs with its script, and its SHA-256 is the one an install of
|
||||
/// the same package by bytes gets.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[test]
|
||||
fn a_folder_installs_a_javascript_plugin() {
|
||||
let _lock = crate::safe_mode::TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner());
|
||||
crate::safe_mode::set_active(None);
|
||||
let dir = test_dir("js");
|
||||
let id = "test.registry.js";
|
||||
write_js(&dir, id, serde_json::json!({}), Some("function run(i) { return i; }"));
|
||||
let r = load_folder_where(&dir, |_| Ok(()), |_| false).unwrap();
|
||||
let bytes = read_js_package(&dir.join(format!("{id}.vcplugin")), &|_| Ok(())).unwrap();
|
||||
std::fs::remove_dir_all(&dir).unwrap();
|
||||
assert_eq!(r.loaded, vec![id.to_string()], "{r:?}");
|
||||
let p = get(id).unwrap();
|
||||
assert_eq!((p.script(), p.hash()), (Some("f.js"), crate::permissions::sha256_hex(&bytes).as_str()));
|
||||
assert!(remove(id));
|
||||
}
|
||||
|
||||
/// A manifest with `"runtime": "js"` and no `script` is refused, and the error names the key;
|
||||
/// so is one that names a script `allow` refuses or that isn't there.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[test]
|
||||
fn a_javascript_manifest_needs_its_script() {
|
||||
let dir = test_dir("js-script");
|
||||
let no_key = write_js(&dir, "a", serde_json::json!({"script": null}), None);
|
||||
let mut m: serde_json::Value = serde_json::from_slice(&std::fs::read(&no_key).unwrap()).unwrap();
|
||||
m.as_object_mut().unwrap().remove("script");
|
||||
std::fs::write(&no_key, serde_json::to_vec(&m).unwrap()).unwrap();
|
||||
let missing = write_js(&dir, "b", serde_json::json!({}), None);
|
||||
let inline = write_js(&dir, "c", serde_json::json!({"source": "function run(i) { return i; }"}), None);
|
||||
let not_js = write_js(&dir, "d", serde_json::json!({"runtime": "wasm"}), None);
|
||||
let refused = read_js_package(&missing, &|p| Err(format!("{} is outside", p.display())));
|
||||
let results = [
|
||||
read_js_package(&no_key, &|_| Ok(())),
|
||||
read_js_package(&missing, &|_| Ok(())),
|
||||
read_js_package(&inline, &|_| Ok(())),
|
||||
read_js_package(¬_js, &|_| Ok(())),
|
||||
];
|
||||
std::fs::remove_dir_all(&dir).unwrap();
|
||||
assert!(matches!(&results[0], Err(Error::Manifest(e)) if e.starts_with("`runtime` \"js\" needs `script`")), "{:?}", results[0]);
|
||||
assert!(matches!(&results[1], Err(Error::Io(e)) if e.contains("f.js")), "{:?}", results[1]);
|
||||
assert!(matches!(&results[2], Err(Error::Manifest(e)) if e.contains("`source`")), "{:?}", results[2]);
|
||||
assert!(matches!(&results[3], Err(Error::Manifest(e)) if e == crate::js::NOT_JS), "{:?}", results[3]);
|
||||
assert!(matches!(&refused, Err(Error::Io(e)) if e.ends_with("is outside")), "{refused:?}");
|
||||
}
|
||||
|
||||
/// A script larger than the limit is refused by its size before it is opened.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[test]
|
||||
fn an_oversized_script_is_refused_before_it_is_read() {
|
||||
let dir = test_dir("js-big");
|
||||
let path = write_js(&dir, "big", serde_json::json!({}), Some(""));
|
||||
std::fs::File::options().write(true).open(dir.join("f.js")).unwrap().set_len(crate::js::MAX_SCRIPT_BYTES as u64 + 1).unwrap();
|
||||
let opened = std::cell::Cell::new(false);
|
||||
let read = read_js_package_with(&path, &|_| Ok(()), || opened.set(true));
|
||||
std::fs::remove_dir_all(&dir).unwrap();
|
||||
assert!(matches!(&read, Err(Error::Module(e)) if e.contains(&format!("limit {}", crate::js::MAX_SCRIPT_BYTES))), "{read:?}");
|
||||
assert!(!opened.get(), "the script was opened");
|
||||
}
|
||||
|
||||
/// A manifest file's parameters keep their declaration order through the package it is read
|
||||
/// into, which is its own text with `source` added.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[test]
|
||||
fn a_javascript_package_keeps_the_manifest_s_order() {
|
||||
let dir = test_dir("js-order");
|
||||
let num = r#"{"type": "number", "min": 0, "max": 10, "default": 1}"#;
|
||||
let text = format!(
|
||||
"{{\"id\": \"order\", \"name\": \"JS\", \"kind\": \"filter\", \"runtime\": \"js\", \"script\": \"f.js\", \"params\": {{\"z\": {num}, \"a\": {num}}}}}\n"
|
||||
);
|
||||
let path = dir.join("order.vcplugin");
|
||||
std::fs::write(&path, &text).unwrap();
|
||||
std::fs::write(dir.join("f.js"), "function run(i) { return i; }").unwrap();
|
||||
let bytes = read_js_package(&path, &|_| Ok(()));
|
||||
std::fs::remove_dir_all(&dir).unwrap();
|
||||
let bytes = bytes.unwrap();
|
||||
let expected = format!("{},\"source\":\"function run(i) {{ return i; }}\"}}", text.trim_end().strip_suffix('}').unwrap());
|
||||
assert_eq!(String::from_utf8_lossy(&bytes), expected);
|
||||
let (manifest, _) = crate::js::read_bundle(&bytes).unwrap();
|
||||
assert_eq!(manifest.params.iter().map(|(k, _)| k.as_str()).collect::<Vec<_>>(), ["z", "a"]);
|
||||
}
|
||||
|
||||
/// A folder load reports a subfolder, a named pipe and a link to a named pipe with `.wasm`
|
||||
/// names as not files, and goes on.
|
||||
#[cfg(unix)]
|
||||
|
||||
@@ -7,7 +7,7 @@ use wasmi::{
|
||||
use wasmparser::{CompositeInnerType, Parser, Payload, Validator, WasmFeatures};
|
||||
|
||||
use crate::host::{self, Bridge, Deadline, Host, Report, Run};
|
||||
use crate::manifest::{MANIFEST_SECTION, MAX_MANIFEST_BYTES, Manifest};
|
||||
use crate::manifest::{MANIFEST_SECTION, MAX_MANIFEST_BYTES, Manifest, Runtime};
|
||||
use crate::permissions::Permission;
|
||||
use crate::{Error, Kind, Result};
|
||||
|
||||
@@ -169,12 +169,17 @@ impl Default for Limits {
|
||||
}
|
||||
}
|
||||
|
||||
/// A plug-in's code: a WebAssembly module, or a JavaScript file ([`crate::js`]).
|
||||
enum Code {
|
||||
Wasm { engine: Engine, module: Module },
|
||||
Js(crate::js::Script),
|
||||
}
|
||||
|
||||
/// A loaded, validated plug-in. Cheap to share (`Arc`) and safe to run from several threads:
|
||||
/// every run gets its own store and instance.
|
||||
/// every run gets its own store and instance, or for a JavaScript plug-in its own realm.
|
||||
pub struct Plugin {
|
||||
manifest: Manifest,
|
||||
engine: Engine,
|
||||
module: Module,
|
||||
code: Code,
|
||||
limits: Limits,
|
||||
size: usize,
|
||||
hash: String,
|
||||
@@ -341,13 +346,21 @@ impl Plugin {
|
||||
/// is one the host offers ([`crate::host::IMPORTS`]) and its manifest allows, and checks the
|
||||
/// exports. A module that carries its manifest in a [`MANIFEST_SECTION`] custom section is
|
||||
/// checked without being instantiated, so none of its code runs; one without that section is
|
||||
/// instantiated to call `vc_abi_version` and `vc_manifest`. In Safe Mode nothing is loaded
|
||||
/// ([`Error::SafeMode`]).
|
||||
/// instantiated to call `vc_abi_version` and `vc_manifest`. Bytes that hold a JSON object with
|
||||
/// `"runtime": "js"` are a JavaScript plug-in ([`crate::js`]): its manifest is checked and its
|
||||
/// script parsed, and none of it runs. In Safe Mode nothing is loaded ([`Error::SafeMode`]).
|
||||
pub fn load(bytes: &[u8], limits: Limits) -> Result<Plugin> {
|
||||
crate::safe_mode::check()?;
|
||||
if bytes.len() > limits.max_module_bytes {
|
||||
return Err(Error::Module(format!("module is {} bytes (limit {})", bytes.len(), limits.max_module_bytes)));
|
||||
}
|
||||
if bytes.trim_ascii_start().starts_with(b"{") {
|
||||
let (manifest, script) = crate::js::read_bundle(bytes)?;
|
||||
let hash = crate::permissions::sha256_hex(bytes);
|
||||
let mut p = Plugin { manifest, code: Code::Js(script), limits, size: bytes.len(), hash, source: None, serial: 0 };
|
||||
p.heavy_limits();
|
||||
return Ok(p);
|
||||
}
|
||||
if !bytes.starts_with(b"\0asm") {
|
||||
return Err(Error::Module("not a WebAssembly binary (missing \\0asm header)".into()));
|
||||
}
|
||||
@@ -362,8 +375,17 @@ impl Plugin {
|
||||
let module = Module::new(&engine, bytes).map_err(|e| Error::Module(e.to_string()))?;
|
||||
let imports = host::check_imports(&module)?;
|
||||
let hash = crate::permissions::sha256_hex(bytes);
|
||||
let mut p = Plugin { manifest: Manifest::placeholder(), engine, module, limits, size: bytes.len(), hash, source: None, serial: 0 };
|
||||
let live = match section_manifest(&p.module)? {
|
||||
let section = section_manifest(&module)?;
|
||||
let mut p = Plugin {
|
||||
manifest: Manifest::placeholder(),
|
||||
code: Code::Wasm { engine, module: module.clone() },
|
||||
limits,
|
||||
size: bytes.len(),
|
||||
hash,
|
||||
source: None,
|
||||
serial: 0,
|
||||
};
|
||||
let live = match section {
|
||||
Some(manifest) => {
|
||||
p.manifest = manifest;
|
||||
None
|
||||
@@ -388,13 +410,11 @@ impl Plugin {
|
||||
Some(live)
|
||||
}
|
||||
};
|
||||
host::check_granted(&p.manifest, &imports)?;
|
||||
// A heavy filter's runs get the larger budget the host allows for one, which the host
|
||||
// lets the user allow or refuse before installing it.
|
||||
if p.manifest.budget == crate::Budget::Heavy {
|
||||
p.limits.fuel_base = p.limits.fuel_base.max(p.limits.heavy_fuel);
|
||||
p.limits.wall_time_ms = p.limits.wall_time_ms.max(p.limits.heavy_wall_time_ms);
|
||||
if p.manifest.runtime != Runtime::Wasm {
|
||||
return Err(Error::Manifest("a WebAssembly module's manifest leaves `runtime` out: \"js\" is for a JavaScript plug-in".into()));
|
||||
}
|
||||
host::check_granted(&p.manifest, &imports)?;
|
||||
p.heavy_limits();
|
||||
// The other exports must exist with the right types.
|
||||
match live {
|
||||
Some(live) => {
|
||||
@@ -402,13 +422,35 @@ impl Plugin {
|
||||
live.func::<RunArgs, i64>("vc_run")?;
|
||||
}
|
||||
None => {
|
||||
check_exports(&p.module, p.limits.max_memory_bytes)?;
|
||||
check_exports(&module, p.limits.max_memory_bytes)?;
|
||||
check_tables(bytes)?;
|
||||
}
|
||||
}
|
||||
Ok(p)
|
||||
}
|
||||
|
||||
/// A heavy filter's runs get the larger budget the host allows for one, which the host lets the
|
||||
/// user allow or refuse before installing it.
|
||||
fn heavy_limits(&mut self) {
|
||||
if self.manifest.budget == crate::Budget::Heavy {
|
||||
self.limits.fuel_base = self.limits.fuel_base.max(self.limits.heavy_fuel);
|
||||
self.limits.wall_time_ms = self.limits.wall_time_ms.max(self.limits.heavy_wall_time_ms);
|
||||
}
|
||||
}
|
||||
|
||||
/// What runs its code ([`Manifest::runtime`]).
|
||||
pub fn runtime(&self) -> Runtime {
|
||||
self.manifest.runtime
|
||||
}
|
||||
|
||||
/// A JavaScript plug-in's script file name; `None` for a WebAssembly module.
|
||||
pub fn script(&self) -> Option<&str> {
|
||||
match &self.code {
|
||||
Code::Js(script) => Some(&script.name),
|
||||
Code::Wasm { .. } => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn manifest(&self) -> &Manifest {
|
||||
&self.manifest
|
||||
}
|
||||
@@ -452,6 +494,7 @@ impl Plugin {
|
||||
/// A new instance for `run`, with the host imports of the permissions `granted` linked. When the
|
||||
/// module's start function fails, what it reported through the host imports goes to `report`.
|
||||
fn instantiate(&self, run: Run, granted: &[Permission], report: &mut Report) -> Result<Live> {
|
||||
let Code::Wasm { engine, module } = &self.code else { return Err(Error::Module("not a WebAssembly binary (missing \\0asm header)".into())) };
|
||||
let limits = StoreLimitsBuilder::new()
|
||||
.memory_size(self.limits.max_memory_bytes)
|
||||
.memories(1)
|
||||
@@ -459,13 +502,13 @@ impl Plugin {
|
||||
.table_elements(MAX_TABLE_ELEMENTS as usize)
|
||||
.instances(1)
|
||||
.build();
|
||||
let mut store = Store::new(&self.engine, Host { limits, run });
|
||||
let mut store = Store::new(engine, Host { limits, run });
|
||||
store.limiter(|h| &mut h.limits);
|
||||
// The start function (if any) runs on one slice of fuel: it runs before `call` can check
|
||||
// the deadline or a cancel between slices, so a heavy budget would let it run for minutes.
|
||||
store.set_fuel(self.limits.fuel_base.min(FUEL_SLICE)).map_err(wasm_err)?;
|
||||
let linker = host::linker(&self.engine, granted);
|
||||
let instance = match linker.instantiate_and_start(&mut store, &self.module) {
|
||||
let linker = host::linker(engine, granted);
|
||||
let instance = match linker.instantiate_and_start(&mut store, module) {
|
||||
Ok(instance) => instance,
|
||||
Err(e) => {
|
||||
*report = std::mem::take(&mut store.data_mut().run.report);
|
||||
@@ -595,6 +638,14 @@ impl Plugin {
|
||||
let deadline = Deadline::new(limits.wall_time_ms);
|
||||
let m = &self.manifest;
|
||||
let run = Run::new(&m.id, m.kind != Kind::Effect, true, deadline).with_storage(crate::registry::storage(&m.id));
|
||||
if let Code::Js(script) = &self.code {
|
||||
// Its manifest lists no `commands`, so nothing calls it with a bridge.
|
||||
if bridge.is_some() {
|
||||
return Err(Error::Abi("a JavaScript plug-in makes no command calls".into()));
|
||||
}
|
||||
let call = crate::js::Call { input, params, limits, max_memory: self.limits.max_memory_bytes, deadline };
|
||||
return crate::js::run(script, m, &call, run, report);
|
||||
}
|
||||
let mut live = self.instantiate(run, &m.permissions(), report)?;
|
||||
// Calls can be made from `vc_run` on, not from the start function.
|
||||
if bridge.is_some() {
|
||||
|
||||
@@ -7979,6 +7979,21 @@ variable-list-end {0}, {1} {0} i {1}
|
||||
@msg time budget pressupost de temps
|
||||
@msg memory budget (the selection is too large to hand over) pressupost de memòria (la selecció és massa gran per passar-la)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) mida de la sortida ({what} fa {len} bytes, límit {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} línia {line}, columna {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget pressupost de memòria
|
||||
@msg call depth profunditat de crides
|
||||
@msg run(input, params) returned no output object run(input, params) no ha retornat cap objecte de sortida
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" necessita `script`: el nom del fitxer .js del complement, al costat del manifest
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` ha de ser el nom d’un fitxer .js a la carpeta del manifest: 1-128 bytes, sense carpeta, sense `:`, sense començar per `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` és el text de l’script i només es dona en el JSON que pren el dataBase64 de plugin.install: un fitxer .vcplugin anomena el seu script a `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" el manifest d’un complement de JavaScript indica `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" és per a un filtre d’objectes (`kind` "filter"), no per a `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` un complement de JavaScript no pot incloure el permís `{name}`: dels permisos de l’amfitrió pot incloure `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in el manifest d’un mòdul WebAssembly omet `runtime`: "js" és per a un complement de JavaScript
|
||||
@msg a JavaScript plug-in makes no command calls un complement de JavaScript no crida ordres
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) pren dos nombres
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) pren un nivell, 0 (error), 1 (avís), 2 (informació) o 3 (depuració), i una cadena
|
||||
@msg the plug-in's grant can't be removed from the plug-in store el permís del complement no es pot treure del magatzem de complements
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it el permís `{shown}` està reservat per a una API de complements posterior; aquest amfitrió no el concedeix
|
||||
@msg unknown permission `{shown}` permís desconegut `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7592,6 +7592,21 @@ axis Y Axis osa Y
|
||||
@msg time budget časový rozpočet
|
||||
@msg memory budget (the selection is too large to hand over) rozpočet paměti (výběr je příliš velký na předání)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) velikost výstupu ({what} má {len} bajtů, limit {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} řádek {line}, sloupec {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget rozpočet paměti
|
||||
@msg call depth hloubka volání
|
||||
@msg run(input, params) returned no output object run(input, params) nevrátila žádný výstupní objekt
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" vyžaduje `script`: název souboru .js zásuvného modulu vedle manifestu
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` musí být název souboru .js ve složce manifestu: 1-128 bajtů, bez složky, bez `:`, nesmí začínat `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` je text skriptu a uvádí se jen v JSON, které přijímá dataBase64 příkazu plugin.install: soubor .vcplugin uvádí svůj skript v `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" manifest zásuvného modulu v JavaScriptu uvádí `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" je pro filtr objektů (`kind` "filter"), ne pro `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` zásuvný modul v JavaScriptu nemůže uvést oprávnění `{name}`: z oprávnění hostitele smí uvést `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in manifest modulu WebAssembly vynechává `runtime`: "js" je pro zásuvný modul v JavaScriptu
|
||||
@msg a JavaScript plug-in makes no command calls zásuvný modul v JavaScriptu nevolá žádné příkazy
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) přijímá dvě čísla
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) přijímá úroveň, 0 (chyba), 1 (varování), 2 (informace) nebo 3 (ladění), a řetězec
|
||||
@msg the plug-in's grant can't be removed from the plug-in store oprávnění zásuvného modulu nelze odebrat z úložiště zásuvných modulů
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it oprávnění `{shown}` je vyhrazeno pro pozdější API zásuvných modulů; tento hostitel ho neuděluje
|
||||
@msg unknown permission `{shown}` neznámé oprávnění `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -762,6 +762,21 @@ liquify-list-end {0}, {1} {0} og {1}
|
||||
@msg time budget tidsbudget
|
||||
@msg memory budget (the selection is too large to hand over) hukommelsesbudget (markeringen er for stor til at blive overdraget)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) outputstørrelse ({what} fylder {len} byte, grænse {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} linje {line}, kolonne {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget hukommelsesbudget
|
||||
@msg call depth kaldedybde
|
||||
@msg run(input, params) returned no output object run(input, params) returnerede intet outputobjekt
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" kræver `script`: navnet på plug-in'ets .js-fil ved siden af manifestet
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` skal være navnet på en .js-fil i manifestets mappe: 1-128 byte, ingen mappe, intet `:`, må ikke starte med `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` er scriptets tekst og angives kun i den JSON, som dataBase64 i plugin.install tager: en .vcplugin-fil navngiver sit script i `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" et JavaScript-plug-ins manifest angiver `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" er til et objektfilter (`kind` "filter"), ikke `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` et JavaScript-plug-in kan ikke angive tilladelsen `{name}`: af værtens tilladelser må det angive `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in et WebAssembly-moduls manifest udelader `runtime`: "js" er til et JavaScript-plug-in
|
||||
@msg a JavaScript plug-in makes no command calls et JavaScript-plug-in kalder ingen kommandoer
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) tager to tal
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) tager et niveau, 0 (fejl), 1 (advarsel), 2 (information) eller 3 (fejlsøgning), og en streng
|
||||
@msg the plug-in's grant can't be removed from the plug-in store plug-in'ets tilladelse kan ikke fjernes fra plug-in-lageret
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it tilladelsen `{shown}` er reserveret til et senere plug-in-API; denne vært tildeler den ikke
|
||||
@msg unknown permission `{shown}` ukendt tilladelse `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7173,6 +7173,21 @@ axis Y Axis Y-Achse
|
||||
@msg time budget Zeitbudget
|
||||
@msg memory budget (the selection is too large to hand over) Speicherbudget (die Auswahl ist zu groß zum Übergeben)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) Ausgabegröße ({what} ist {len} Byte groß, Grenze {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} Zeile {line}, Spalte {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget Speicherbudget
|
||||
@msg call depth Aufruftiefe
|
||||
@msg run(input, params) returned no output object run(input, params) hat kein Ausgabeobjekt zurückgegeben
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" braucht `script`: den Namen der .js-Datei des Plug-ins neben dem Manifest
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` muss der Name einer .js-Datei im Ordner des Manifests sein: 1-128 Byte, kein Ordner, kein `:`, nicht mit `.` beginnend
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` ist der Text des Skripts und steht nur in dem JSON, das dataBase64 von plugin.install übernimmt: eine .vcplugin-Datei nennt ihr Skript in `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" das Manifest eines JavaScript-Plug-ins gibt `runtime` "js" an
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" gilt für einen Objektfilter (`kind` "filter"), nicht für `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` ein JavaScript-Plug-in kann die Berechtigung `{name}` nicht aufführen: von den Berechtigungen des Hosts darf es `progress` aufführen
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in das Manifest eines WebAssembly-Moduls lässt `runtime` weg: "js" gilt für ein JavaScript-Plug-in
|
||||
@msg a JavaScript plug-in makes no command calls ein JavaScript-Plug-in ruft keine Befehle auf
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) nimmt zwei Zahlen
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) nimmt eine Stufe, 0 (Fehler), 1 (Warnung), 2 (Information) oder 3 (Debug), und eine Zeichenfolge
|
||||
@msg the plug-in's grant can't be removed from the plug-in store die Berechtigung des Plug-ins kann nicht aus dem Plug-in-Speicher entfernt werden
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it die Berechtigung `{shown}` ist für eine spätere Plug-in-API reserviert; dieser Host gewährt sie nicht
|
||||
@msg unknown permission `{shown}` unbekannte Berechtigung `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7582,6 +7582,21 @@ axis Y Axis Άξονας Y
|
||||
@msg time budget χρονικός προϋπολογισμός
|
||||
@msg memory budget (the selection is too large to hand over) προϋπολογισμός μνήμης (η επιλογή είναι πολύ μεγάλη για να παραδοθεί)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) μέγεθος εξόδου ({what}: {len} byte, όριο {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} γραμμή {line}, στήλη {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget προϋπολογισμός μνήμης
|
||||
@msg call depth βάθος κλήσεων
|
||||
@msg run(input, params) returned no output object η run(input, params) δεν επέστρεψε αντικείμενο εξόδου
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest το `runtime` "js" χρειάζεται `script`: το όνομα του αρχείου .js του προσθέτου, δίπλα στο αρχείο δηλώσεων
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` το `script` πρέπει να είναι το όνομα ενός αρχείου .js στον φάκελο του αρχείου δηλώσεων: 1-128 byte, χωρίς φάκελο, χωρίς `:`, χωρίς να αρχίζει με `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` το `source` είναι το κείμενο του σεναρίου και δίνεται μόνο στο JSON που δέχεται το dataBase64 της plugin.install: ένα αρχείο .vcplugin ονομάζει το σενάριό του στο `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" το αρχείο δηλώσεων ενός προσθέτου JavaScript δίνει `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" το `runtime` "js" είναι για φίλτρο αντικειμένων (`kind` "filter"), όχι για `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` ένα πρόσθετο JavaScript δεν μπορεί να δηλώσει την άδεια `{name}`: από τις άδειες του κεντρικού υπολογιστή μπορεί να δηλώσει την `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in το αρχείο δηλώσεων μιας μονάδας WebAssembly παραλείπει το `runtime`: το "js" είναι για πρόσθετο JavaScript
|
||||
@msg a JavaScript plug-in makes no command calls ένα πρόσθετο JavaScript δεν καλεί εντολές
|
||||
@msg vc.progress(done, total) takes two numbers η vc.progress(done, total) δέχεται δύο αριθμούς
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string η vc.log(level, text) δέχεται ένα επίπεδο, 0 (σφάλμα), 1 (προειδοποίηση), 2 (πληροφορία) ή 3 (εντοπισμός σφαλμάτων), και μια συμβολοσειρά
|
||||
@msg the plug-in's grant can't be removed from the plug-in store η άδεια του πρόσθετου δεν μπορεί να αφαιρεθεί από τον χώρο αποθήκευσης πρόσθετων
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it το δικαίωμα `{shown}` είναι δεσμευμένο για μεταγενέστερο API προσθέτων· αυτός ο κεντρικός υπολογιστής δεν το παραχωρεί
|
||||
@msg unknown permission `{shown}` άγνωστο δικαίωμα `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7568,6 +7568,21 @@ axis Y Axis Eje Y
|
||||
@msg time budget presupuesto de tiempo
|
||||
@msg memory budget (the selection is too large to hand over) presupuesto de memoria (la selección es demasiado grande para entregarla)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) tamaño de salida ({what} ocupa {len} bytes, límite {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} línea {line}, columna {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget presupuesto de memoria
|
||||
@msg call depth profundidad de llamadas
|
||||
@msg run(input, params) returned no output object run(input, params) no devolvió ningún objeto de salida
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" necesita `script`: el nombre del archivo .js del plugin, junto al manifiesto
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` debe ser el nombre de un archivo .js en la carpeta del manifiesto: 1-128 bytes, sin carpeta, sin `:`, sin empezar por `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` es el texto del script y solo se da en el JSON que toma el dataBase64 de plugin.install: un archivo .vcplugin nombra su script en `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" el manifiesto de un plugin de JavaScript indica `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" es para un filtro de objetos (`kind` "filter"), no para `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` un plugin de JavaScript no puede incluir el permiso `{name}`: de los permisos del host puede incluir `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in el manifiesto de un módulo WebAssembly omite `runtime`: "js" es para un plugin de JavaScript
|
||||
@msg a JavaScript plug-in makes no command calls un plugin de JavaScript no llama a comandos
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) recibe dos números
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) recibe un nivel, 0 (error), 1 (advertencia), 2 (información) o 3 (depuración), y una cadena
|
||||
@msg the plug-in's grant can't be removed from the plug-in store el permiso del plugin no se puede quitar del almacén de plugins
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it el permiso `{shown}` está reservado para una API de plugins posterior; este host no lo concede
|
||||
@msg unknown permission `{shown}` permiso desconocido `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7659,6 +7659,21 @@ axis Y Axis Y-akseli
|
||||
@msg time budget aikabudjetti
|
||||
@msg memory budget (the selection is too large to hand over) muistibudjetti (valinta on liian suuri luovutettavaksi)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) tulosteen koko ({what}: {len} tavua, raja {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} rivi {line}, sarake {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget muistibudjetti
|
||||
@msg call depth kutsusyvyys
|
||||
@msg run(input, params) returned no output object run(input, params) ei palauttanut tulosobjektia
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" tarvitsee avaimen `script`: laajennuksen .js-tiedoston nimen manifestin vieressä
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` on oltava manifestin kansiossa olevan .js-tiedoston nimi: 1-128 tavua, ei kansiota, ei merkkiä `:`, ei alussa merkkiä `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` on komentosarjan teksti, ja se annetaan vain JSONissa, jonka plugin.install-komennon dataBase64 ottaa: .vcplugin-tiedosto nimeää komentosarjansa avaimessa `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" JavaScript-laajennuksen manifesti antaa `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" on objektisuodattimelle (`kind` "filter"), ei arvolle `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` JavaScript-laajennus ei voi luetella lupaa `{name}`: isännän luvista se voi luetella luvan `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in WebAssembly-moduulin manifesti jättää avaimen `runtime` pois: "js" on JavaScript-laajennukselle
|
||||
@msg a JavaScript plug-in makes no command calls JavaScript-laajennus ei kutsu komentoja
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) ottaa kaksi lukua
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) ottaa tason, 0 (virhe), 1 (varoitus), 2 (tieto) tai 3 (virheenjäljitys), ja merkkijonon
|
||||
@msg the plug-in's grant can't be removed from the plug-in store laajennuksen käyttöoikeutta ei voi poistaa laajennusvarastosta
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it käyttöoikeus `{shown}` on varattu myöhemmälle laajennus-API:lle; tämä isäntä ei myönnä sitä
|
||||
@msg unknown permission `{shown}` tuntematon käyttöoikeus `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7589,6 +7589,21 @@ axis Y Axis Axe Y
|
||||
@msg time budget budget de temps
|
||||
@msg memory budget (the selection is too large to hand over) budget mémoire (la sélection est trop grande pour être transmise)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) taille de sortie ({what} fait {len} octets, limite {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} ligne {line}, colonne {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget budget mémoire
|
||||
@msg call depth profondeur d’appel
|
||||
@msg run(input, params) returned no output object run(input, params) n’a renvoyé aucun objet de sortie
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" a besoin de `script`, le nom du fichier .js du plug-in placé à côté du manifeste
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` doit être le nom d’un fichier .js dans le dossier du manifeste (1-128 octets, sans dossier, sans `:`, ne commençant pas par `.`)
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` est le texte du script, donné uniquement dans le JSON que prend le dataBase64 de plugin.install, et un fichier .vcplugin nomme son script dans `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" le manifeste d’un plug-in JavaScript indique `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" est réservé à un filtre d’objets (`kind` "filter"), pas à `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` un plug-in JavaScript ne peut pas lister l’autorisation `{name}`, et parmi les autorisations de l’hôte, il peut lister `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in le manifeste d’un module WebAssembly omet `runtime`, car "js" est réservé à un plug-in JavaScript
|
||||
@msg a JavaScript plug-in makes no command calls un plug-in JavaScript n’appelle aucune commande
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) prend deux nombres
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) prend un niveau, 0 (erreur), 1 (avertissement), 2 (information) ou 3 (débogage), et une chaîne
|
||||
@msg the plug-in's grant can't be removed from the plug-in store l’autorisation du plug-in ne peut pas être retirée du magasin de plug-ins
|
||||
@msg unknown permission `{shown}` autorisation inconnue `{shown}`
|
||||
@msg “{name}” asks for the permissions {asked}: a person has to approve them in the desktop app, or pass `grant` in a session started with --allow-plugin-grants « {name} » demande les autorisations {asked} : une personne doit les approuver dans l’application de bureau, ou passez `grant` dans une session démarrée avec --allow-plugin-grants
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8824,6 +8824,21 @@ liquify-list-end {0}, {1} {0} और {1}
|
||||
@msg outlineText {v}: true or false outlineText {v}: true या false
|
||||
@msg output intent profile: {e} उत्पादन आशय प्रोफ़ाइल: {e}
|
||||
@msg output size ({what} is {len} bytes, limit {max}) आउटपुट का आकार ({what} {len} बाइट्स का है, सीमा {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} पंक्ति {line}, स्तंभ {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget स्मृति बजट
|
||||
@msg call depth कॉल गहराई
|
||||
@msg run(input, params) returned no output object run(input, params) ने कोई आउटपुट ऑब्जेक्ट नहीं लौटाया
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" को `script` चाहिए: मैनिफ़ेस्ट के पास प्लग-इन की .js फ़ाइल का नाम
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` मैनिफ़ेस्ट के फ़ोल्डर में किसी .js फ़ाइल का नाम होना चाहिए: 1-128 बाइट्स, कोई फ़ोल्डर नहीं, कोई `:` नहीं, `.` से शुरू नहीं
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` स्क्रिप्ट का टेक्स्ट है, जो केवल उस JSON में दिया जाता है जिसे plugin.install का dataBase64 लेता है: .vcplugin फ़ाइल अपनी स्क्रिप्ट का नाम `script` में देती है
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" JavaScript प्लग-इन का मैनिफ़ेस्ट `runtime` "js" देता है
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" ऑब्जेक्ट फ़िल्टर (`kind` "filter") के लिए है, `kind` "{kind}" के लिए नहीं
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` JavaScript प्लग-इन अनुमति `{name}` सूचीबद्ध नहीं कर सकता: होस्ट की अनुमतियों में से वह `progress` सूचीबद्ध कर सकता है
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in WebAssembly मॉड्यूल का मैनिफ़ेस्ट `runtime` छोड़ देता है: "js" JavaScript प्लग-इन के लिए है
|
||||
@msg a JavaScript plug-in makes no command calls JavaScript प्लग-इन कोई कमांड कॉल नहीं करता
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) दो संख्याएँ लेता है
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) एक स्तर, 0 (त्रुटि), 1 (चेतावनी), 2 (जानकारी) या 3 (डीबग), और एक स्ट्रिंग लेता है
|
||||
@msg output.destination: {_1} files are CMYK, and “{name}” is an RGB profile output.destination: {_1} फ़ाइलें CMYK हैं, और "{name}" एक RGB प्रोफ़ाइल है
|
||||
@msg output.destination: {e} output.destination: {e}
|
||||
@msg output.destination: no RGB or CMYK profile is called “{name}” output.destination: "{name}" नाम की कोई RGB या CMYK प्रोफ़ाइल नहीं है
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7577,6 +7577,21 @@ axis Y Axis Y tengely
|
||||
@msg time budget időkeret
|
||||
@msg memory budget (the selection is too large to hand over) memóriakeret (a kijelölés túl nagy az átadáshoz)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) kimenet mérete ({what}: {len} bájt, korlát {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script}, {line}. sor, {column}. oszlop)
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget memóriakeret
|
||||
@msg call depth hívási mélység
|
||||
@msg run(input, params) returned no output object a run(input, params) nem adott vissza kimeneti objektumot
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest a `runtime` "js" értékhez `script` kell: a bővítmény .js fájljának neve a leíró mellett
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` a `script` a leíró mappájában lévő .js fájl neve legyen: 1-128 bájt, mappa nélkül, `:` nélkül, és nem kezdődhet `.` karakterrel
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` a `source` a parancsfájl szövege, és csak abban a JSON-ban adható meg, amelyet a plugin.install dataBase64 paramétere fogad: a .vcplugin fájl a `script` kulcsban nevezi meg a parancsfájlját
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" egy JavaScript-bővítmény leírója `runtime` "js" értéket ad meg
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" a `runtime` "js" objektumszűrőhöz való (`kind` "filter"), nem `kind` "{kind}" értékhez
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` egy JavaScript-bővítmény nem sorolhatja fel a(z) `{name}` engedélyt: a gazdagép engedélyei közül a `progress` engedélyt sorolhatja fel
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in egy WebAssembly-modul leírója elhagyja a `runtime` kulcsot: a "js" JavaScript-bővítményhez való
|
||||
@msg a JavaScript plug-in makes no command calls egy JavaScript-bővítmény nem hív parancsokat
|
||||
@msg vc.progress(done, total) takes two numbers a vc.progress(done, total) két számot vár
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string a vc.log(level, text) egy szintet, 0 (hiba), 1 (figyelmeztetés), 2 (információ) vagy 3 (hibakeresés), és egy karakterláncot vár
|
||||
@msg the plug-in's grant can't be removed from the plug-in store a bővítmény engedélye nem távolítható el a bővítménytárból
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it a(z) `{shown}` engedély egy későbbi bővítmény-API számára van fenntartva; ez a gazdaprogram nem adja meg
|
||||
@msg unknown permission `{shown}` ismeretlen engedély: `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -643,6 +643,21 @@
|
||||
@msg time budget anggaran waktu
|
||||
@msg memory budget (the selection is too large to hand over) anggaran memori (seleksi terlalu besar untuk diserahkan)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) ukuran keluaran ({what} berukuran {len} byte, batas {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} baris {line}, kolom {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget anggaran memori
|
||||
@msg call depth kedalaman panggilan
|
||||
@msg run(input, params) returned no output object run(input, params) tidak mengembalikan objek keluaran
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" memerlukan `script`: nama file .js plug-in, di samping manifes
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` harus berupa nama file .js di folder manifes: 1-128 byte, tanpa folder, tanpa `:`, tidak diawali `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` adalah teks skrip dan hanya diberikan dalam JSON yang diterima dataBase64 plugin.install: file .vcplugin menamai skripnya di `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" manifes plug-in JavaScript memberikan `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" untuk filter objek (`kind` "filter"), bukan `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` plug-in JavaScript tidak dapat mencantumkan izin `{name}`: dari izin host, plug-in ini boleh mencantumkan `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in manifes modul WebAssembly menghilangkan `runtime`: "js" untuk plug-in JavaScript
|
||||
@msg a JavaScript plug-in makes no command calls plug-in JavaScript tidak memanggil perintah
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) menerima dua angka
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) menerima level, 0 (kesalahan), 1 (peringatan), 2 (informasi), atau 3 (debug), dan string
|
||||
@msg the plug-in's grant can't be removed from the plug-in store izin yang diberikan kepada plug-in tidak dapat dihapus dari penyimpanan plug-in
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it izin `{shown}` dicadangkan untuk API plug-in yang lebih baru; host ini tidak memberikannya
|
||||
@msg unknown permission `{shown}` izin tidak dikenal `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7212,6 +7212,21 @@ axis Y Axis Asse Y
|
||||
@msg time budget budget di tempo
|
||||
@msg memory budget (the selection is too large to hand over) budget di memoria (la selezione è troppo grande per essere passata)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) dimensione dell’output ({what} è di {len} byte, limite {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} riga {line}, colonna {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget budget di memoria
|
||||
@msg call depth profondità delle chiamate
|
||||
@msg run(input, params) returned no output object run(input, params) non ha restituito alcun oggetto di output
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" richiede `script`: il nome del file .js del plug-in, accanto al manifest
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` deve essere il nome di un file .js nella cartella del manifest: 1-128 byte, nessuna cartella, nessun `:`, senza iniziare con `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` è il testo dello script, indicato solo nel JSON che riceve il dataBase64 di plugin.install: un file .vcplugin indica il proprio script in `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" il manifest di un plug-in JavaScript indica `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" è per un filtro di oggetti (`kind` "filter"), non per `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` un plug-in JavaScript non può elencare il permesso `{name}`: dei permessi dell’host può elencare `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in il manifest di un modulo WebAssembly omette `runtime`: "js" è per un plug-in JavaScript
|
||||
@msg a JavaScript plug-in makes no command calls un plug-in JavaScript non chiama comandi
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) accetta due numeri
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) accetta un livello, 0 (errore), 1 (avviso), 2 (informazione) o 3 (debug), e una stringa
|
||||
@msg the plug-in's grant can't be removed from the plug-in store il permesso del plug-in non può essere rimosso dall’archivio dei plug-in
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it l’autorizzazione `{shown}` è riservata a un’API dei plug-in successiva; questo host non la concede
|
||||
@msg unknown permission `{shown}` autorizzazione sconosciuta `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7287,6 +7287,21 @@ axis Y Axis Y 軸
|
||||
@msg time budget 時間予算
|
||||
@msg memory budget (the selection is too large to hand over) メモリ予算 (選択範囲が大きすぎて渡せません)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) 出力サイズ ({what} は {len} バイト、上限 {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}、{script} {line} 行 {column} 列)
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}、{script})
|
||||
@msg memory budget メモリ予算
|
||||
@msg call depth 呼び出しの深さ
|
||||
@msg run(input, params) returned no output object run(input, params) が出力オブジェクトを返しませんでした
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" には `script` が必要です: マニフェストと同じ場所にあるプラグインの .js ファイルの名前
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` はマニフェストのフォルダーにある .js ファイルの名前にしてください: 1-128 バイト、フォルダーなし、`:` なし、`.` で始まらないこと
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` はスクリプトのテキストで、plugin.install の dataBase64 が受け取る JSON でだけ指定します: .vcplugin ファイルはスクリプトを `script` で指定します
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" JavaScript プラグインのマニフェストは `runtime` "js" を指定します
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" はオブジェクトフィルター (`kind` "filter") 用で、`kind` "{kind}" 用ではありません
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` JavaScript プラグインは権限 `{name}` を指定できません: ホストの権限のうち指定できるのは `progress` です
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in WebAssembly モジュールのマニフェストでは `runtime` を省略します: "js" は JavaScript プラグイン用です
|
||||
@msg a JavaScript plug-in makes no command calls JavaScript プラグインはコマンドを呼び出しません
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) には数値を 2 つ指定します
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) にはレベル 0 (エラー)、1 (警告)、2 (情報)、3 (デバッグ) のいずれかと文字列を指定します
|
||||
@msg the plug-in's grant can't be removed from the plug-in store プラグインの許可をプラグインストアから削除できません
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it 権限 `{shown}` は今後のプラグイン API 用に予約されています。このホストはこの権限を付与しません
|
||||
@msg unknown permission `{shown}` 不明な権限 `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9697,6 +9697,21 @@ axis Y Axis Y ღერძი
|
||||
@msg time budget დროის ბიუჯეტი
|
||||
@msg memory budget (the selection is too large to hand over) მეხსიერების ბიუჯეტი (მონიშნული ზედმეტად დიდია გადასაცემად)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) გამოტანის ზომა ({what}: {len} ბაიტი, ლიმიტი {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script}, სტრიქონი {line}, სვეტი {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget მეხსიერების ბიუჯეტი
|
||||
@msg call depth გამოძახების სიღრმე
|
||||
@msg run(input, params) returned no output object run(input, params)-მა გამოტანის ობიექტი არ დააბრუნა
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" საჭიროებს `script`-ს: პლაგინის .js ფაილის სახელს მანიფესტის გვერდით
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` უნდა იყოს მანიფესტის საქაღალდეში მყოფი .js ფაილის სახელი: 1-128 ბაიტი, საქაღალდის გარეშე, `:` სიმბოლოს გარეშე, `.` სიმბოლოთი არ უნდა იწყებოდეს
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` სკრიპტის ტექსტია და მიეთითება მხოლოდ JSON-ში, რომელსაც plugin.install-ის dataBase64 იღებს: .vcplugin ფაილი თავის სკრიპტს `script` გასაღებში ასახელებს
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" JavaScript პლაგინის მანიფესტი მიუთითებს `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" ობიექტების ფილტრისთვისაა (`kind` "filter"), არა `kind` "{kind}" მნიშვნელობისთვის
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` JavaScript პლაგინს არ შეუძლია ნებართვის `{name}` ჩამოთვლა: ჰოსტის ნებართვებიდან მას შეუძლია ჩამოთვალოს `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in WebAssembly მოდულის მანიფესტი გამოტოვებს `runtime` გასაღებს: "js" JavaScript პლაგინისთვისაა
|
||||
@msg a JavaScript plug-in makes no command calls JavaScript პლაგინი ბრძანებებს არ იძახებს
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) იღებს ორ რიცხვს
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) იღებს დონეს, 0 (შეცდომა), 1 (გაფრთხილება), 2 (ინფორმაცია) ან 3 (გამართვა), და სტრიქონს
|
||||
@msg the plug-in's grant can't be removed from the plug-in store პლაგინის ნებართვის წაშლა პლაგინების საცავიდან შეუძლებელია
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it ნებართვა `{shown}` დაჯავშნილია პლაგინების მომავალი API-სთვის; ეს ჰოსტი მას არ გასცემს
|
||||
@msg unknown permission `{shown}` უცნობი ნებართვა `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7184,6 +7184,21 @@ axis Y Axis Y축
|
||||
@msg time budget 시간 예산
|
||||
@msg memory budget (the selection is too large to hand over) 메모리 예산(선택 항목이 너무 커서 넘길 수 없음)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) 출력 크기({what}: {len}바이트, 제한 {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason}({id}, {script} {line}행 {column}열)
|
||||
@msg {reason} ({id}, {script}) {reason}({id}, {script})
|
||||
@msg memory budget 메모리 예산
|
||||
@msg call depth 호출 깊이
|
||||
@msg run(input, params) returned no output object run(input, params)이 출력 개체를 반환하지 않았습니다
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js"에는 `script`가 필요합니다: 매니페스트 옆에 있는 플러그인 .js 파일의 이름
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script`는 매니페스트 폴더에 있는 .js 파일의 이름이어야 합니다: 1-128바이트, 폴더 없음, `:` 없음, `.`으로 시작하지 않음
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source`는 스크립트의 텍스트이며 plugin.install의 dataBase64가 받는 JSON에서만 지정합니다: .vcplugin 파일은 스크립트를 `script`에 지정합니다
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" JavaScript 플러그인의 매니페스트는 `runtime` "js"를 지정합니다
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js"는 개체 필터(`kind` "filter")용이며 `kind` "{kind}"용이 아닙니다
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` JavaScript 플러그인은 권한 `{name}`을(를) 나열할 수 없습니다: 호스트 권한 중에서 `progress`를 나열할 수 있습니다
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in WebAssembly 모듈의 매니페스트는 `runtime`을 생략합니다: "js"는 JavaScript 플러그인용입니다
|
||||
@msg a JavaScript plug-in makes no command calls JavaScript 플러그인은 명령을 호출하지 않습니다
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total)는 숫자 두 개를 받습니다
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text)는 수준 0(오류), 1(경고), 2(정보), 3(디버그) 중 하나와 문자열을 받습니다
|
||||
@msg the plug-in's grant can't be removed from the plug-in store 플러그인 저장소에서 플러그인의 권한을 제거할 수 없습니다
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it `{shown}` 권한은 이후 플러그인 API용으로 예약되어 있습니다. 이 호스트는 이 권한을 부여하지 않습니다
|
||||
@msg unknown permission `{shown}` 알 수 없는 권한 `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -607,6 +607,21 @@ liquify-list-end {0}, {1} {0} en {1}
|
||||
@msg time budget tijdbudget
|
||||
@msg memory budget (the selection is too large to hand over) geheugenbudget (de selectie is te groot om door te geven)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) uitvoergrootte ({what} is {len} bytes, limiet {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} regel {line}, kolom {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget geheugenbudget
|
||||
@msg call depth aanroepdiepte
|
||||
@msg run(input, params) returned no output object run(input, params) heeft geen uitvoerobject teruggegeven
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" heeft `script` nodig: de naam van het .js-bestand van de plug-in, naast het manifest
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` moet de naam zijn van een .js-bestand in de map van het manifest: 1-128 bytes, geen map, geen `:`, niet beginnend met `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` is de tekst van het script en staat alleen in de JSON die dataBase64 van plugin.install aanneemt: een .vcplugin-bestand noemt zijn script in `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" het manifest van een JavaScript-plug-in geeft `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" is voor een objectfilter (`kind` "filter"), niet voor `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` een JavaScript-plug-in kan de toestemming `{name}` niet vermelden: van de toestemmingen van de host mag hij `progress` vermelden
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in het manifest van een WebAssembly-module laat `runtime` weg: "js" is voor een JavaScript-plug-in
|
||||
@msg a JavaScript plug-in makes no command calls een JavaScript-plug-in roept geen opdrachten aan
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) neemt twee getallen
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) neemt een niveau, 0 (fout), 1 (waarschuwing), 2 (informatie) of 3 (foutopsporing), en een tekenreeks
|
||||
@msg the plug-in's grant can't be removed from the plug-in store de toekenning van de plug-in kan niet uit de plug-inopslag worden verwijderd
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it machtiging `{shown}` is gereserveerd voor een latere plug-in-API; deze host kent haar niet toe
|
||||
@msg unknown permission `{shown}` onbekende machtiging `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7445,6 +7445,21 @@ axis Y Axis Oś Y
|
||||
@msg time budget budżet czasu
|
||||
@msg memory budget (the selection is too large to hand over) budżet pamięci (zaznaczenie jest zbyt duże, aby je przekazać)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) rozmiar wyjścia ({what} ma {len} bajtów, limit {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} wiersz {line}, kolumna {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget budżet pamięci
|
||||
@msg call depth głębokość wywołań
|
||||
@msg run(input, params) returned no output object run(input, params) nie zwróciła obiektu wyjściowego
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" wymaga `script`: nazwy pliku .js wtyczki obok manifestu
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` musi być nazwą pliku .js w folderze manifestu: 1-128 bajtów, bez folderu, bez `:`, nie może zaczynać się od `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` to tekst skryptu, podawany tylko w JSON, który przyjmuje dataBase64 polecenia plugin.install: plik .vcplugin podaje swój skrypt w `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" manifest wtyczki JavaScript podaje `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" jest dla filtra obiektów (`kind` "filter"), nie dla `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` wtyczka JavaScript nie może wymienić uprawnienia `{name}`: spośród uprawnień hosta może wymienić `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in manifest modułu WebAssembly pomija `runtime`: "js" jest dla wtyczki JavaScript
|
||||
@msg a JavaScript plug-in makes no command calls wtyczka JavaScript nie wywołuje poleceń
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) przyjmuje dwie liczby
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) przyjmuje poziom, 0 (błąd), 1 (ostrzeżenie), 2 (informacja) lub 3 (debugowanie), oraz ciąg znaków
|
||||
@msg the plug-in's grant can't be removed from the plug-in store nie można usunąć uprawnienia wtyczki z magazynu wtyczek
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it uprawnienie `{shown}` jest zarezerwowane dla późniejszego API wtyczek; ten host go nie przyznaje
|
||||
@msg unknown permission `{shown}` nieznane uprawnienie `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7491,6 +7491,21 @@ axis Y Axis Eixo Y
|
||||
@msg time budget orçamento de tempo
|
||||
@msg memory budget (the selection is too large to hand over) orçamento de memória (a seleção é grande demais para ser entregue)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) tamanho da saída ({what} tem {len} bytes, limite {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} linha {line}, coluna {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget orçamento de memória
|
||||
@msg call depth profundidade de chamadas
|
||||
@msg run(input, params) returned no output object run(input, params) não retornou nenhum objeto de saída
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" precisa de `script`: o nome do arquivo .js do plug-in, ao lado do manifesto
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` deve ser o nome de um arquivo .js na pasta do manifesto: 1-128 bytes, sem pasta, sem `:`, sem começar com `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` é o texto do script, dado só no JSON que o dataBase64 de plugin.install recebe: um arquivo .vcplugin indica seu script em `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" o manifesto de um plug-in JavaScript indica `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" é para um filtro de objetos (`kind` "filter"), não para `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` um plug-in JavaScript não pode listar a permissão `{name}`: das permissões do host, ele pode listar `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in o manifesto de um módulo WebAssembly omite `runtime`: "js" é para um plug-in JavaScript
|
||||
@msg a JavaScript plug-in makes no command calls um plug-in JavaScript não chama comandos
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) recebe dois números
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) recebe um nível, 0 (erro), 1 (aviso), 2 (informação) ou 3 (depuração), e uma string
|
||||
@msg the plug-in's grant can't be removed from the plug-in store a permissão do plug-in não pode ser removida do armazenamento de plug-ins
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it a permissão `{shown}` está reservada para uma API de plug-in futura; este host não a concede
|
||||
@msg unknown permission `{shown}` permissão desconhecida `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7212,6 +7212,21 @@ axis Y Axis Ось Y
|
||||
@msg time budget бюджет времени
|
||||
@msg memory budget (the selection is too large to hand over) бюджет памяти (выделение слишком велико для передачи)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) размер вывода ({what}: {len} байт, предел {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script}, строка {line}, столбец {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget бюджет памяти
|
||||
@msg call depth глубина вызовов
|
||||
@msg run(input, params) returned no output object run(input, params) не вернула объект вывода
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest для `runtime` "js" нужен `script`: имя файла .js модуля рядом с манифестом
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` должен быть именем файла .js в папке манифеста: 1-128 байт, без папки, без `:`, не начинаясь с `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` содержит текст скрипта и задаётся только в JSON, который принимает dataBase64 команды plugin.install: файл .vcplugin называет свой скрипт в `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" манифест модуля JavaScript задаёт `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" предназначен для фильтра объектов (`kind` "filter"), а не для `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` модуль JavaScript не может перечислять разрешение `{name}`: из разрешений хоста он может перечислить `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in манифест модуля WebAssembly не указывает `runtime`: "js" предназначен для модуля JavaScript
|
||||
@msg a JavaScript plug-in makes no command calls модуль JavaScript не вызывает команды
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) принимает два числа
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) принимает уровень, 0 (ошибка), 1 (предупреждение), 2 (информация) или 3 (отладка), и строку
|
||||
@msg the plug-in's grant can't be removed from the plug-in store разрешение модуля нельзя удалить из хранилища модулей
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it разрешение `{shown}` зарезервировано для будущего API модулей; этот хост его не выдаёт
|
||||
@msg unknown permission `{shown}` неизвестное разрешение `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9767,6 +9767,21 @@ digits Hindi Hindi
|
||||
@msg outlineText {v}: true or false outlineText {v}: true eller false
|
||||
@msg output intent profile: {e} profil för utgångsavsikt: {e}
|
||||
@msg output size ({what} is {len} bytes, limit {max}) utdatastorlek ({what} är {len} byte, gräns {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} rad {line}, kolumn {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget minnesbudget
|
||||
@msg call depth anropsdjup
|
||||
@msg run(input, params) returned no output object run(input, params) returnerade inget utdataobjekt
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" kräver `script`: namnet på pluginets .js-fil bredvid manifestet
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` måste vara namnet på en .js-fil i manifestets mapp: 1-128 byte, ingen mapp, inget `:`, får inte börja med `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` är skriptets text och anges bara i den JSON som dataBase64 i plugin.install tar: en .vcplugin-fil namnger sitt skript i `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" manifestet för ett JavaScript-plugin anger `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" är för ett objektfilter (`kind` "filter"), inte `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` ett JavaScript-plugin kan inte ange behörigheten `{name}`: av värdens behörigheter får det ange `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in manifestet för en WebAssembly-modul utelämnar `runtime`: "js" är för ett JavaScript-plugin
|
||||
@msg a JavaScript plug-in makes no command calls ett JavaScript-plugin anropar inga kommandon
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) tar två tal
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) tar en nivå, 0 (fel), 1 (varning), 2 (information) eller 3 (felsökning), och en sträng
|
||||
@msg output.destination: {_1} files are CMYK, and “{name}” is an RGB profile output.destination: {_1}-filer är CMYK, och ”{name}” är en RGB-profil
|
||||
@msg output.destination: {e} output.destination: {e}
|
||||
@msg output.destination: no RGB or CMYK profile is called “{name}” output.destination: ingen RGB- eller CMYK-profil heter ”{name}”
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7664,6 +7664,21 @@ axis Y Axis Y ekseni
|
||||
@msg time budget zaman bütçesi
|
||||
@msg memory budget (the selection is too large to hand over) bellek bütçesi (seçim aktarılamayacak kadar büyük)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) çıktı boyutu ({what}: {len} bayt, sınır {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} satır {line}, sütun {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget bellek bütçesi
|
||||
@msg call depth çağrı derinliği
|
||||
@msg run(input, params) returned no output object run(input, params) bir çıktı nesnesi döndürmedi
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" için `script` gerekir: eklentinin bildirimin yanındaki .js dosyasının adı
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script`, bildirimin klasöründeki bir .js dosyasının adı olmalıdır: 1-128 bayt, klasör yok, `:` yok, `.` ile başlamaz
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` betiğin metnidir ve yalnızca plugin.install komutunun dataBase64 parametresinin aldığı JSON içinde verilir: bir .vcplugin dosyası betiğini `script` içinde adlandırır
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" bir JavaScript eklentisinin bildirimi `runtime` "js" verir
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" bir nesne filtresi içindir (`kind` "filter"), `kind` "{kind}" için değil
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` bir JavaScript eklentisi `{name}` iznini listeleyemez: ana makinenin izinlerinden `progress` iznini listeleyebilir
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in bir WebAssembly modülünün bildirimi `runtime` anahtarını atlar: "js" bir JavaScript eklentisi içindir
|
||||
@msg a JavaScript plug-in makes no command calls bir JavaScript eklentisi komut çağırmaz
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) iki sayı alır
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) bir düzey, 0 (hata), 1 (uyarı), 2 (bilgi) veya 3 (hata ayıklama), ve bir dize alır
|
||||
@msg the plug-in's grant can't be removed from the plug-in store eklentinin izni eklenti deposundan kaldırılamıyor
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it `{shown}` izni sonraki bir eklenti API’si için ayrılmıştır; bu ana bilgisayar bu izni vermez
|
||||
@msg unknown permission `{shown}` bilinmeyen izin `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7194,6 +7194,21 @@ axis Y Axis Вісь Y
|
||||
@msg time budget бюджет часу
|
||||
@msg memory budget (the selection is too large to hand over) бюджет пам’яті (виділення завелике для передавання)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) розмір виводу ({what}: {len} байтів, межа {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script}, рядок {line}, стовпець {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget бюджет пам’яті
|
||||
@msg call depth глибина викликів
|
||||
@msg run(input, params) returned no output object run(input, params) не повернула об’єкт виводу
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest для `runtime` "js" потрібен `script`: ім’я файлу .js модуля поруч із маніфестом
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` має бути ім’ям файлу .js у теці маніфесту: 1-128 байтів, без теки, без `:`, не починаючись із `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` містить текст скрипту й задається лише в JSON, який приймає dataBase64 команди plugin.install: файл .vcplugin називає свій скрипт у `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" маніфест модуля JavaScript задає `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" призначено для фільтра об’єктів (`kind` "filter"), а не для `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` модуль JavaScript не може перелічувати дозвіл `{name}`: із дозволів хоста він може перелічити `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in маніфест модуля WebAssembly не вказує `runtime`: "js" призначено для модуля JavaScript
|
||||
@msg a JavaScript plug-in makes no command calls модуль JavaScript не викликає команд
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) приймає два числа
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) приймає рівень, 0 (помилка), 1 (попередження), 2 (інформація) або 3 (налагодження), і рядок
|
||||
@msg the plug-in's grant can't be removed from the plug-in store дозвіл модуля не вдається вилучити зі сховища модулів
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it дозвіл `{shown}` зарезервовано для пізнішого API модулів; цей хост його не надає
|
||||
@msg unknown permission `{shown}` невідомий дозвіл `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7241,6 +7241,21 @@ axis Y Axis Trục Y
|
||||
@msg time budget ngân sách thời gian
|
||||
@msg memory budget (the selection is too large to hand over) ngân sách bộ nhớ (vùng chọn quá lớn để chuyển giao)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) kích thước đầu ra ({what} là {len} byte, giới hạn {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason} ({id}, {script} dòng {line}, cột {column})
|
||||
@msg {reason} ({id}, {script}) {reason} ({id}, {script})
|
||||
@msg memory budget ngân sách bộ nhớ
|
||||
@msg call depth độ sâu lời gọi
|
||||
@msg run(input, params) returned no output object run(input, params) không trả về đối tượng đầu ra nào
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" cần `script`: tên tệp .js của plug-in, nằm cạnh manifest
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` phải là tên một tệp .js trong thư mục của manifest: 1-128 byte, không có thư mục, không có `:`, không bắt đầu bằng `.`
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` là văn bản của tập lệnh, chỉ được cung cấp trong JSON mà dataBase64 của plugin.install nhận: tệp .vcplugin nêu tên tập lệnh của nó trong `script`
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" manifest của plug-in JavaScript cho `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" dành cho bộ lọc đối tượng (`kind` "filter"), không phải `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` plug-in JavaScript không thể liệt kê quyền `{name}`: trong các quyền của máy chủ, nó có thể liệt kê `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in manifest của mô-đun WebAssembly bỏ qua `runtime`: "js" dành cho plug-in JavaScript
|
||||
@msg a JavaScript plug-in makes no command calls plug-in JavaScript không gọi lệnh
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) nhận hai số
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) nhận một mức, 0 (lỗi), 1 (cảnh báo), 2 (thông tin) hoặc 3 (gỡ lỗi), và một chuỗi
|
||||
@msg the plug-in's grant can't be removed from the plug-in store không thể xóa quyền của plug-in khỏi kho plug-in
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it quyền `{shown}` được dành cho một API plug-in sau này; máy chủ này không cấp quyền đó
|
||||
@msg unknown permission `{shown}` quyền không xác định `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7424,6 +7424,21 @@ axis Y Axis Y 轴
|
||||
@msg time budget 时间预算
|
||||
@msg memory budget (the selection is too large to hand over) 内存预算(所选内容太大,无法传递)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) 输出大小({what} 为 {len} 字节,上限 {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason}({id},{script} 第 {line} 行,第 {column} 列)
|
||||
@msg {reason} ({id}, {script}) {reason}({id},{script})
|
||||
@msg memory budget 内存预算
|
||||
@msg call depth 调用深度
|
||||
@msg run(input, params) returned no output object run(input, params) 未返回输出对象
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" 需要 `script`:清单旁边增效工具 .js 文件的名称
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` 必须是清单所在文件夹中 .js 文件的名称:1-128 字节,不含文件夹,不含 `:`,不以 `.` 开头
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` 是脚本的文本,只在 plugin.install 的 dataBase64 接受的 JSON 中给出:.vcplugin 文件在 `script` 中指定其脚本
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" JavaScript 增效工具的清单指定 `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" 用于对象滤镜(`kind` "filter"),而不是 `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` JavaScript 增效工具不能列出权限 `{name}`:在主机的权限中,它可以列出 `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in WebAssembly 模块的清单省略 `runtime`:"js" 用于 JavaScript 增效工具
|
||||
@msg a JavaScript plug-in makes no command calls JavaScript 增效工具不调用命令
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) 接受两个数字
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) 接受一个级别(0(错误)、1(警告)、2(信息)或 3(调试))和一个字符串
|
||||
@msg the plug-in's grant can't be removed from the plug-in store 无法从增效工具存储中移除该增效工具的授权
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it 权限 `{shown}` 保留给以后的增效工具 API;此主机不授予该权限
|
||||
@msg unknown permission `{shown}` 未知权限 `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7243,6 +7243,21 @@ axis Y Axis Y 軸
|
||||
@msg time budget 時間預算
|
||||
@msg memory budget (the selection is too large to hand over) 記憶體預算(所選內容太大,無法傳遞)
|
||||
@msg output size ({what} is {len} bytes, limit {max}) 輸出大小({what} 為 {len} 位元組,上限 {max})
|
||||
@msg {reason} ({id}, {script} line {line}, column {column}) {reason}({id},{script} 第 {line} 行,第 {column} 欄)
|
||||
@msg {reason} ({id}, {script}) {reason}({id},{script})
|
||||
@msg memory budget 記憶體預算
|
||||
@msg call depth 呼叫深度
|
||||
@msg run(input, params) returned no output object run(input, params) 未傳回輸出物件
|
||||
@msg `runtime` "js" needs `script`: the name of the plug-in's .js file, next to the manifest `runtime` "js" 需要 `script`:資訊清單旁增效模組 .js 檔案的名稱
|
||||
@msg `script` must be the name of a .js file in the manifest's folder: 1-128 bytes, no folder, no `:`, not starting with `.` `script` 必須是資訊清單所在資料夾中 .js 檔案的名稱:1-128 位元組,不含資料夾,不含 `:`,不以 `.` 開頭
|
||||
@msg `source` is the script's text, given only in the JSON that plugin.install's dataBase64 takes: a .vcplugin file names its script in `script` `source` 是指令碼的文字,只在 plugin.install 的 dataBase64 接受的 JSON 中提供:.vcplugin 檔案在 `script` 中指定其指令碼
|
||||
@msg a JavaScript plug-in's manifest gives `runtime` "js" JavaScript 增效模組的資訊清單指定 `runtime` "js"
|
||||
@msg `runtime` "js" is for an object filter (`kind` "filter"), not `kind` "{kind}" `runtime` "js" 用於物件濾鏡(`kind` "filter"),而不是 `kind` "{kind}"
|
||||
@msg a JavaScript plug-in can't list the permission `{name}`: of the host's permissions it may list `progress` JavaScript 增效模組不能列出權限 `{name}`:在主機的權限中,它可以列出 `progress`
|
||||
@msg a WebAssembly module's manifest leaves `runtime` out: "js" is for a JavaScript plug-in WebAssembly 模組的資訊清單不填寫 `runtime`:"js" 用於 JavaScript 增效模組
|
||||
@msg a JavaScript plug-in makes no command calls JavaScript 增效模組不呼叫命令
|
||||
@msg vc.progress(done, total) takes two numbers vc.progress(done, total) 接受兩個數字
|
||||
@msg vc.log(level, text) takes a level, 0 (error), 1 (warning), 2 (information) or 3 (debug), and a string vc.log(level, text) 接受一個層級(0(錯誤)、1(警告)、2(資訊)或 3(偵錯))和一個字串
|
||||
@msg the plug-in's grant can't be removed from the plug-in store 無法從增效模組存放區移除該增效模組的授權
|
||||
@msg permission `{shown}` is reserved for a later plug-in API; this host doesn't grant it 權限 `{shown}` 保留給日後的增效模組 API;此主機不授予該權限
|
||||
@msg unknown permission `{shown}` 未知權限 `{shown}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -26,9 +26,15 @@ pub fn open_bytes(app: &mut VectorcraftApp, name: &str, bytes: &[u8], path: Opti
|
||||
/// [`open_bytes`], a document opening with `document.open`'s params `p`.
|
||||
fn open_bytes_with(app: &mut VectorcraftApp, name: &str, bytes: &[u8], path: Option<String>, p: &Value) -> Result<Value, String> {
|
||||
let opens = opens_as(name);
|
||||
// A WebAssembly plug-in is installed.
|
||||
// A plug-in is installed: a JavaScript plug-in's manifest by its path, which the script it
|
||||
// names is read beside. Without a path the manifest's bytes alone are refused, since they hold
|
||||
// no script (`vectorcraft_plugins::js::SOURCE_RULE`).
|
||||
if opens == Some(OpensAs::Plugin) {
|
||||
let module = json!({"dataBase64": vectorcraft_format::base64_encode(bytes), "name": path.as_deref().unwrap_or(name)});
|
||||
let js = vectorcraft_plugins::registry::is_js_package(std::path::Path::new(name));
|
||||
let module = match path.as_deref() {
|
||||
Some(path) if js => json!({ "path": path }),
|
||||
_ => json!({"dataBase64": vectorcraft_format::base64_encode(bytes), "name": path.as_deref().unwrap_or(name)}),
|
||||
};
|
||||
return install_module(app, module).map(|_| Value::Null);
|
||||
}
|
||||
if opens == Some(OpensAs::ShortcutSet) {
|
||||
@@ -609,6 +615,12 @@ fn open_file_with(app: &mut VectorcraftApp, path: &str, background: bool, p: &Va
|
||||
note_recent(app, path);
|
||||
return Ok(Value::Null);
|
||||
}
|
||||
// A JavaScript plug-in's manifest is read by `plugin.install {path}`, with the script it names.
|
||||
if opens_as(path) == Some(OpensAs::Plugin) && vectorcraft_plugins::registry::is_js_package(std::path::Path::new(path)) {
|
||||
install_module(app, json!({ "path": path }))?;
|
||||
note_recent(app, path);
|
||||
return Ok(Value::Null);
|
||||
}
|
||||
// A file only an importer plug-in reads is not read past the importer's input limit.
|
||||
check_import_size(path, false)?;
|
||||
let bytes = read(app, path)?;
|
||||
|
||||
@@ -777,3 +777,47 @@ fn installing_a_plugin_that_reports_progress_says_so() {
|
||||
assert_eq!(vectorcraft_plugins::registry::granted(id).map(|g| g.permissions.len()), Some(2));
|
||||
h.state_mut().run("plugin.remove", json!({"id": id})).unwrap();
|
||||
}
|
||||
|
||||
/// File › Open of a JavaScript plug-in's `.vcplugin` installs it with the script beside it. Without
|
||||
/// a path (the web file picker), the manifest alone is refused, the error says how the script is
|
||||
/// given, and nothing is installed.
|
||||
#[test]
|
||||
fn opening_a_javascript_manifest_installs_it_with_its_script() {
|
||||
let mut app = app();
|
||||
let id = "test.ui.js.open";
|
||||
let dir = std::env::temp_dir().join(format!("vc-ui-js-open-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
std::fs::create_dir_all(&dir).unwrap();
|
||||
let manifest = json!({"id": id, "name": "Open JS", "kind": "filter", "runtime": "js", "script": "open.js"}).to_string();
|
||||
let path = dir.join("open.vcplugin");
|
||||
std::fs::write(&path, &manifest).unwrap();
|
||||
std::fs::write(dir.join("open.js"), "function run(input) { return input; }").unwrap();
|
||||
let e = io::open_bytes(&mut app, "open.vcplugin", manifest.as_bytes(), None).unwrap_err();
|
||||
assert!(e.contains(vectorcraft_plugins::js::SOURCE_RULE), "{e}");
|
||||
assert!(vectorcraft_plugins::registry::get(id).is_none());
|
||||
io::open_bytes(&mut app, "open.vcplugin", manifest.as_bytes(), Some(path.display().to_string())).unwrap();
|
||||
std::fs::remove_dir_all(&dir).unwrap();
|
||||
assert_eq!(vectorcraft_plugins::registry::get(id).and_then(|p| p.script().map(str::to_string)).as_deref(), Some("open.js"));
|
||||
app.run("plugin.remove", json!({"id": id})).unwrap();
|
||||
}
|
||||
|
||||
/// Opening a JavaScript plug-in's `.vcplugin` by its path installs it through `plugin.install
|
||||
/// {path}` without the app's file reader reading the manifest first.
|
||||
#[test]
|
||||
fn opening_a_javascript_manifest_by_path_does_not_read_it_first() {
|
||||
let mut app = app();
|
||||
app.services.read = Some(Box::new(|_: &str| Err("the whole file was read".to_string())));
|
||||
let id = "test.ui.js.open.path";
|
||||
let dir = std::env::temp_dir().join(format!("vc-ui-js-open-path-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
std::fs::create_dir_all(&dir).unwrap();
|
||||
let manifest = json!({"id": id, "name": "Open JS by path", "kind": "filter", "runtime": "js", "script": "open.js"}).to_string();
|
||||
let path = dir.join("open.vcplugin");
|
||||
std::fs::write(&path, &manifest).unwrap();
|
||||
std::fs::write(dir.join("open.js"), "function run(input) { return input; }").unwrap();
|
||||
let r = io::open_path(&mut app, &path.display().to_string());
|
||||
std::fs::remove_dir_all(&dir).unwrap();
|
||||
assert_eq!(r, Ok(Value::Null));
|
||||
assert_eq!(vectorcraft_plugins::registry::get(id).and_then(|p| p.script().map(str::to_string)).as_deref(), Some("open.js"));
|
||||
app.run("plugin.remove", json!({"id": id})).unwrap();
|
||||
}
|
||||
+4
-1
@@ -14122,7 +14122,10 @@ them again at startup (`plugin.remove` deletes them there). A window or process
|
||||
while it changes it, so installs, removals, grants and plug-in settings from two of them do not mix; when the file can't
|
||||
be locked, `plugin.install` and `plugin.remove` fail and change nothing:
|
||||
`plugin.install {path | dataBase64}` installs one, `plugin.list` / `plugin.info {id}` describe them (parameters,
|
||||
schema, defaults). An object filter runs on the selected paths and compound paths with `plugin.run {id, params}` (one
|
||||
schema, defaults). An object filter may also be a JavaScript plug-in: a `.vcplugin` manifest with `"runtime": "js"` and
|
||||
`script`, the `.js` file beside it, which `plugin.install {path}`, `plugin.inspect {path}` and `plugin.reload` read
|
||||
together (`runtime` and `script` in its entry); it runs in an interpreter of its own with no file, command or clock
|
||||
access ([plugins.md](plugins.md#javascript-filters)). An object filter runs on the selected paths and compound paths with `plugin.run {id, params}` (one
|
||||
undo step; it may change, delete or add objects, and the result is selected; a run that changes no object and no kept
|
||||
data records no undo step and leaves the document unmodified) → `{plugin, ids, notice?, pluginName?}`.
|
||||
`notice` is the text the filter's output reports in its `notice` key, escaped and cut at 200 characters
|
||||
|
||||
+61
-3
@@ -21,6 +21,9 @@ There are four kinds of plug-in:
|
||||
paths and compound paths. File › Open lists their files, File › Open With lists the importers by name, and the host
|
||||
hands them the file's bytes.
|
||||
|
||||
An object filter may also be written in JavaScript, as a manifest and a `.js` file ([JavaScript
|
||||
filters](#javascript-filters)).
|
||||
|
||||
This page is the contract for plug-in authors and the reference for the host (`crates/plugins`, the `plugin.*` commands
|
||||
in `crates/engine/src/cmd/plugin.rs`).
|
||||
|
||||
@@ -28,14 +31,14 @@ in `crates/engine/src/cmd/plugin.rs`).
|
||||
|
||||
| Command | Params | What it does |
|
||||
|---|---|---|
|
||||
| `plugin.list` | `{}` | `{"plugins": [{id, name, version, kind, author, description, params, paramsSchema, effect?, format?, extensions?, budget?, commands?, commandAllowlist?, context?, size, source, api, paintOutput?, permissions, hash, cacheBytes}], "folder": report}` (`api` is the manifest's [plug-in API level](#permissions); `context` lists the [document information](#document-information) it reads; `budget: "heavy"` for a [heavy filter](#heavy-filters); `commands` lists its [commands](#commands); `commandAllowlist` lists the commands it may [call](#command-calls); `paintOutput: true` marks a [painted live effect](#painted-live-effects); `permissions` lists what it [may do](#permissions), `hash` is the module's SHA-256; `cacheBytes` is the size of its [cache](#settings-and-cache)) |
|
||||
| `plugin.list` | `{}` | `{"plugins": [{id, name, version, kind, author, description, params, paramsSchema, effect?, format?, extensions?, budget?, commands?, commandAllowlist?, context?, size, source, api, paintOutput?, permissions, hash, cacheBytes}], "folder": report}` (`api` is the manifest's [plug-in API level](#permissions); `context` lists the [document information](#document-information) it reads; `budget: "heavy"` for a [heavy filter](#heavy-filters); `commands` lists its [commands](#commands); `commandAllowlist` lists the commands it may [call](#command-calls); `paintOutput: true` marks a [painted live effect](#painted-live-effects); `permissions` lists what it [may do](#permissions), `hash` is the module's SHA-256; `runtime: "js"` and `script` mark a [JavaScript filter](#javascript-filters); `cacheBytes` is the size of its [cache](#settings-and-cache)) |
|
||||
| `plugin.info` | `{"id"}` | One plug-in: the `plugin.list` entry plus `manifest`, `defaults` and `lastError` (a live effect's last failure). |
|
||||
| `plugin.run` | `{"id", "params"?: {…}, "ids"?: [...]}` (plug-in params may also be top-level keys) | Runs an object filter on the selection (or `ids`; an `ids` that is not a list of object ids is an error). One undo step; the result is selected, except the objects it locked or made guides. An output that changes no object and none of the data it keeps with the document ([`documentData`](#output)) records no undo step and leaves the document unmodified. |
|
||||
| `plugin.install` | `{"path": "/x/y.wasm"}` (desktop) or `{"dataBase64": "…", "name"?}`, `"replace"?: bool`, `"allowHeavy": bool = false`, `"grant"?: [permission]`, `"hash"?: "sha256 hex"` | Validates and installs a module; returns its `plugin.list` entry. The desktop app and `vectorcraft-cli` keep it in the `Plug-ins` folder next to the preferences, so it is installed again after a restart (#2541). A module with other bytes than the plug-in installed with its id, or, with none installed, one whose id has [settings and a cache](#settings-and-cache) in the `Plug-ins` folder, installs only with `replace: true`, once the user agreed; it takes that plug-in's place and gets its settings and cache. The same module installs again without `replace`, and `replace: false` refuses a module whose id is installed. A [heavy filter](#heavy-filters) installs only with `allowHeavy: true`. A plug-in whose manifest lists [permissions](#permissions) installs only when `grant` lists every one of them, unless a grant is already recorded for a module with the same SHA-256. A request's `grant` and `allowHeavy` are refused except in a session started with `vectorcraft-cli --allow-plugin-grants`. With `hash`, a module whose SHA-256 differs is refused. A module whose `commandAllowlist` lists a command no plug-in may call is refused; ids no command has are listed as `unknownCommands` ([command calls](#command-calls)). |
|
||||
| `plugin.install` | `{"path": "/x/y.wasm"}` or a [JavaScript filter's](#javascript-filters) `.vcplugin` (desktop) or `{"dataBase64": "…", "name"?}`, `"replace"?: bool`, `"allowHeavy": bool = false`, `"grant"?: [permission]`, `"hash"?: "sha256 hex"` | Validates and installs a module; returns its `plugin.list` entry. The desktop app and `vectorcraft-cli` keep it in the `Plug-ins` folder next to the preferences, so it is installed again after a restart (#2541). A module with other bytes than the plug-in installed with its id, or, with none installed, one whose id has [settings and a cache](#settings-and-cache) in the `Plug-ins` folder, installs only with `replace: true`, once the user agreed; it takes that plug-in's place and gets its settings and cache. The same module installs again without `replace`, and `replace: false` refuses a module whose id is installed. A [heavy filter](#heavy-filters) installs only with `allowHeavy: true`. A plug-in whose manifest lists [permissions](#permissions) installs only when `grant` lists every one of them, unless a grant is already recorded for a module with the same SHA-256. A request's `grant` and `allowHeavy` are refused except in a session started with `vectorcraft-cli --allow-plugin-grants`. With `hash`, a module whose SHA-256 differs is refused. A module whose `commandAllowlist` lists a command no plug-in may call is refused; ids no command has are listed as `unknownCommands` ([command calls](#command-calls)). |
|
||||
| `plugin.inspect` | as `plugin.install`: `{"path"}` or `{"dataBase64", "name"?}` | Validates a module without installing it; returns the `plugin.list` entry it would have, plus `needsApproval` (true when installing it needs a person's approval), `needsReplace` (true when `plugin.install` needs `replace: true`), and the `commandAllowlist` ids no command has (`unknownCommands`) and those no plug-in may call (`refusedCommands`). |
|
||||
| `plugin.remove` | `{"id"}` | Uninstalls, and deletes it from the `Plug-ins` folder with its [settings and cache](#settings-and-cache). |
|
||||
| `plugin.clearCache` | `{"id"?}` | Deletes every entry in the [cache](#settings-and-cache) of plug-in `id`, or of every installed plug-in; settings stay. Returns `{"cleared": [id], "bytesFreed"}`. |
|
||||
| `plugin.reload` | `{"path"?: "folder"}` (default: the preference folder) | Installs every `*.wasm` in a folder, the first 1,000 by file name; a bad module is reported and skipped, and so are an entry that is not a regular file, a heavy filter and a plug-in whose permissions the user hasn't granted (nobody was asked). Returns `{"folder", "loaded", "failed": [{file, error}], "leftOut"}`; `leftOut` counts the `*.wasm` files past the first 1,000, which were not tried. |
|
||||
| `plugin.reload` | `{"path"?: "folder"}` (default: the preference folder) | Installs every `*.wasm` and `*.vcplugin` in a folder, the first 1,000 by file name; a bad module is reported and skipped, and so are an entry that is not a regular file, a heavy filter and a plug-in whose permissions the user hasn't granted (nobody was asked). Returns `{"folder", "loaded", "failed": [{file, error}], "leftOut"}`; `leftOut` counts the `*.wasm` and `*.vcplugin` files past the first 1,000, which were not tried. |
|
||||
|
||||
Live effects are applied like any effect: `effect.apply {"effect": "plugin.<id>", "params": {…}}`, edited with
|
||||
`effect.setParams`, listed by `effect.list` (menu `Effect › Plug-ins`) and baked by Object › Expand Appearance.
|
||||
@@ -1224,6 +1227,61 @@ and `wat::when_given` a plug-in whose output depends on whether its input or par
|
||||
in a live effect's geometry. `wat::reporting` and `wat::cooperating` build level 2 plug-ins that import the host
|
||||
functions.
|
||||
|
||||
## JavaScript filters
|
||||
|
||||
An object filter may also be written in JavaScript (ECMAScript 5.1, the language VectorCraft's scripts use). The
|
||||
plug-in is two files in one folder: a manifest, `<name>.vcplugin`, and the `.js` file it names in `script`.
|
||||
|
||||
```json
|
||||
{"id": "org.example.tint", "name": "Tint Blue", "kind": "filter", "runtime": "js", "script": "tint.js",
|
||||
"params": {"blue": {"type": "number", "min": 0, "max": 1, "default": 1}}}
|
||||
```
|
||||
|
||||
```js
|
||||
function run(input, params) {
|
||||
return {objects: input.objects.map(function (o) {
|
||||
return {id: o.id, fills: [{type: "solid", color: {model: "rgb", r: 0, g: 0, b: params.blue}}]};
|
||||
})};
|
||||
}
|
||||
```
|
||||
|
||||
The manifest has the keys of a module's [manifest](#manifest), with `"runtime": "js"` and `script`, a file name of 1 to
|
||||
128 bytes ending in `.js`, without a folder or `:`, and not starting with `.`. Left out, `runtime` is WebAssembly, so
|
||||
existing modules load as before; a module's own manifest may not give `"js"`. A JavaScript plug-in is a filter (`kind`
|
||||
`"filter"`), and of the host's [permissions](#permissions) it may list `progress` but not `settings`, `cache` or
|
||||
`commands`, so it has no `commandAllowlist`.
|
||||
|
||||
`plugin.install {path}` and `plugin.inspect {path}` take the `.vcplugin` file, and File › Open and `plugin.reload`
|
||||
install it like a `.wasm` file. The host refuses a manifest without `script`, with `source`, or with a `runtime` other
|
||||
than `"js"`, and refuses a manifest file over 64 KiB or a script over 8 MiB by its size before reading it; under
|
||||
automation read roots the script must be inside them too. The host reads the two files into one JSON object, the
|
||||
manifest with the script's text in `source`: `plugin.install {dataBase64}` takes that object, the `Plug-ins` folder keeps
|
||||
it as the plug-in's file, and `hash` is its SHA-256, so a changed manifest or script needs a new approval. Installing
|
||||
parses the script and runs none of it; a syntax error is an install error with its line and column.
|
||||
|
||||
Each run gets a new interpreter with its own heap, so nothing one run defines or changes, the built-ins' prototypes
|
||||
included, reaches the next. The script's top level runs, then `run(input, params)` is called with the parsed
|
||||
[input](#input) and [parameters](#parameters), and what it returns is written as JSON and checked
|
||||
as a module's [output](#output) is, before anything in the document changes. The global object holds the language's
|
||||
built-ins and `vc`:
|
||||
|
||||
| Member | What it is |
|
||||
|---|---|
|
||||
| `vc.input`, `vc.params` | The input and parameter JSON as text. |
|
||||
| `vc.progress(done, total)` | As `vc_progress` ([host imports](#host-imports-api-level-2)); with `progress` only. |
|
||||
| `vc.cancelled()` | `true` once the user cancelled or the time budget ran out; with `progress` only. |
|
||||
| `vc.log(level, text)` | Writes a log line as `vc_log` does: `level` 0 (error) to 3 (debug), `true` when written and `false` when the run's log budget dropped it; with `progress` only. |
|
||||
|
||||
The realm has no `$`, `File`, `Folder`, `app`, `#include` or other part of the script runner, no file, network or
|
||||
command access, and no clock: `Date.now()` is `NaN`. A run gets a filter's instruction budget (one budget for the top
|
||||
level and the call, plus the budget per byte of input) and wall-clock budget, checked between slices of 1,000,000
|
||||
instructions, where Cancel stops it too; its heap is at most the interpreter's default heap and the plug-in's memory cap (512 MiB), whichever is smaller, and
|
||||
an input and parameters larger than an eighth of the heap fail the run with the memory-budget error for a selection
|
||||
too large to hand over. A thrown error, a limit, a missing `run`, a result that is not an object JSON can write, or an
|
||||
output larger than 64 MiB fails the run, and the document and undo history stay as they were. The error names the
|
||||
plug-in, its script and, for an error in the script, the line and column, for example `plug-in exceeded its
|
||||
instruction budget (org.example.tint, tint.js line 3, column 5)`.
|
||||
|
||||
## Performance
|
||||
|
||||
The interpreter costs roughly 10–100× native speed per instruction. Filters handle a selection in one call, so a
|
||||
|
||||
@@ -2773,6 +2773,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- **A drag ended by a command with Real-time Drawing off:** when Undo, Redo, a filter that calls commands or a plug-in command that calls commands ends a drag whose preview Real-time Drawing off has not applied yet, the preview is applied first and kept as an undo step of its own, as releasing the drag keeps it; a preview that fails cancels the drag. The filter or plug-in command is then given the objects where the drag left them. Regressions: `crates/engine/src/tests/plugins.rs`, `crates/engine/src/tests/prefs.rs`. Scores and hours unchanged.
|
||||
- **The warning of a preview applied when a command ends a drag:** a preview that Real-time Drawing off left unapplied, and that Undo, Clear History or another command applies before it runs, keeps its warning: the command's result carries it as `previewWarning`, and as `warning` when the command has none of its own, and the status bar shows it, as releasing the drag shows it. Typing kept as its own step when a tool's drag begins, or when Cmd lends the Selection tool, shows its applied preview's warning in the status bar too. Regressions: `settling_a_deferred_preview_keeps_its_warning` and `settling_typing_for_a_tool_shows_its_preview_warning` in `crates/engine/src/tests/prefs.rs`, `settled_warnings_join_the_result` in `crates/engine/src/session/execute.rs`. Scores and hours unchanged.
|
||||
- **Typing kept when a dialog or a panel previews, with Real-time Drawing off:** a dialog's Preview, a panel's live slider, the Effect Gallery's preview, the font menus' preview, a paint for the characters the Type tool selected and an inline graphic inserted while typing first apply the typing that Real-time Drawing off left unapplied, as an undo step of its own, and the status bar shows that typing's preview warning. The Character, Paragraph and Tabs panels, Bullets and Numbering, Justification and the inline graphic then act on the characters the Type tool selected in the typed text. When the typing can't be kept, the status bar shows the error and the dialog's preview does not start. Regressions: `settling_typing_for_a_dialog_returns_its_preview_warning` in `crates/engine/src/tests/prefs.rs`, `ending_deferred_typing_for_another_edit_keeps_the_typing` in `crates/engine/src/tests/textedit.rs`, `inserting_while_deferred_typing_keeps_the_typing` in `crates/engine/src/tests/inline.rs`, `settled_typing_tests` in `crates/ui-egui/src/dialogs/form.rs`, `stack_preview_keeps_typing_in_progress` in `crates/ui-egui/src/dialogs/effect_gallery.rs`. Scores and hours unchanged.
|
||||
- **JavaScript filter plug-ins (G17, #2193):** an object filter may be a `.vcplugin` manifest with `"runtime": "js"` and the `.js` file its `script` names, installed with `plugin.install {path}` or from the plug-in folder. Each run gets a new interpreter with the filter's instruction, time and memory budgets and no file, command or clock access; `run(input, params)` returns the output a module would, checked the same way, and the document changes as one undo step. A manifest without `script`, an unsafe script name or a script over 8 MiB is refused before the script is read. Regressions: `crates/plugins/src/js.rs`, `crates/plugins/src/registry.rs`, `crates/engine/tests/plugin_js.rs`. Scores and hours unchanged.
|
||||
- **Plug-in progress, Cancel and log lines (G17):** at plug-in API level 2 a plug-in with the `progress` permission imports `env.vc_progress`, `env.vc_cancelled` and `env.vc_log`. A heavy filter's and an export's progress windows show its progress as a percentage bar, their Cancel reaches it through `vc_cancelled`, a light filter with `progress` and no `commandAllowlist` runs in the background with the same progress window when it runs at once or OK runs it with Preview off, and its log lines go to the app's log with its id, capped per line and per run. Installing checks every import and names the one it refuses. Regressions: `crates/plugins/src/host.rs`, `crates/plugins/tests/abi.rs`, `crates/engine/src/tests/plugins.rs`, `crates/engine/tests/plugin_fuzz.rs`, `crates/ui-egui/src/tests/plugin_runs.rs`. Scores and hours unchanged.
|
||||
- **Live-effect plug-ins paint their output (G17, #121):** a live effect whose manifest has `"api": 2` and `"paintOutput": true` returns pieces, each drawn by itself in order with fills and strokes of its own in the filter's paint forms (a piece without them keeps the object's; an empty list paints none; an effect on a fill returns only fills, one on a stroke only strokes). The whole result is checked first: limits, numbers in range with nothing clamped, known keys only, and the swatches and patterns it names in the document; one fault draws that step of the stack unchanged, keeps the effect record and puts the plug-in's name and the field in `plugin.info`'s `lastError`. The pieces are drawn, measured and exported to PDF and SVG from the appearance stack without changing the document, and Expand Appearance writes them as ordinary paths in one undo step. Effects without the key behave as before. Regressions: `crates/plugins/src/painted/tests.rs`, `crates/plugins/src/manifest.rs`, `crates/engine/src/tests/plugins.rs`, `crates/engine/tests/plugin_fuzz.rs`. Scores and hours unchanged.
|
||||
- **Painted effects refuse gradient stop plates without a spot link (G17):** a gradient stop with process `plates` in a painted live effect's fill or stroke must link to a spot swatch of the document itself; a stop with no link, a `null` link or only the gradient's own `swatch` refuses the whole result, and so does a link to a process swatch or Registration, also when a cached result's swatch stops being a spot swatch. `lastError` names the stop's `plates`. Regressions: `crates/plugins/src/painted/tests.rs`, `crates/plugins/src/effect.rs` (`cached_painted_plates_refuse_after_spot_becomes_process`). Scores and hours unchanged.
|
||||
|
||||
Reference in new issue
Block a user