mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-26 19:07:17 +00:00
- Add host-rendered native IDE primitives (PluginCodeEditor/Monaco, PluginDataGrid/@tanstack/react-virtual, PluginSplitPane, PluginErCanvas) with Shadow DOM slot projection (zero iframes, zero plugin JS in renderer) - Expand Remote DOM budgets, expose full 22 Netcatty semantic CSS tokens, add dblclick/contextmenu/scroll/selection events, cursor-anchored PluginPopover, database theme icon, and full-bleed chrome flag - Add dynamic user-approved TCP/TLS byte streams (incl. localhost opt-in blocking internal control ports), in-band STARTTLS upgrade with cert fingerprint confirmation, durable revocable Vault SSH host bindings, plugin-owned encrypted secrets, native ui.openFile/saveFile streaming handles, 4 MiB clipboard, and prefix-filtered storage.keys - Optimize plugin view image pipeline with pooled sandboxed rasterizer window (auto-destroyed on idle/error/dispose), LRU version+hash cache in PluginViewResources, transient failure eviction in HostDrawnViewHost, renderer-side session deduplication, and RemoteImageElement cache + retry - Temporarily enable plugin host by default in hostBootstrap.cjs (marked TODO(revert), opt-out via NETCATTY_PLUGIN_DEV=0)
20 lines
1.4 KiB
TypeScript
20 lines
1.4 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import { readFile } from "node:fs/promises";
|
|
import test from "node:test";
|
|
import { validateManifestValue } from "./manifest.js";
|
|
import { checkPluginCompatibility } from "./compatibility.js";
|
|
|
|
const manifest = JSON.parse(await readFile(new URL("../../../examples/plugins/database-minimal/netcatty.plugin.json", import.meta.url), "utf8"));
|
|
|
|
test("byte stream packages require negotiated features and exact resources in optional grants", () => {
|
|
assert.equal(validateManifestValue(manifest).valid, true);
|
|
assert.equal(validateManifestValue({ ...manifest, features: {} }).valid, false);
|
|
for (const resources of [["*"], ["tcp://*:3306"], ["tcp://host:3306/"], ["udp://host:3306"], ["https://host"]]) {
|
|
assert.equal(validateManifestValue({ ...manifest, permissions: { required: ["commands", "views"], optional: [{ permission: "network.stream", resources }] } }).valid, false);
|
|
}
|
|
assert.equal(validateManifestValue({ ...manifest, permissions: { required: ["commands", "views"], optional: ["network.stream"] } }).valid, true);
|
|
assert.equal(validateManifestValue({ ...manifest, permissions: { required: ["commands", "views", "network.stream"] } }).valid, false);
|
|
assert.equal(checkPluginCompatibility(manifest, { netcattyVersion: "1.0.0", features: [] }).compatible, false);
|
|
assert.equal(checkPluginCompatibility(manifest, { netcattyVersion: "1.0.0", features: ["network.byte-streams"] }).compatible, true);
|
|
});
|