@termix-ssh/plugin-sdk 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/PLUGIN-GUIDE.md +92 -72
- package/dist/backend.d.ts +370 -0
- package/dist/capabilities.js +2 -0
- package/dist/frontend.d.ts +45 -0
- package/dist/host/{PluginsTab-S33WIIGC.js → PluginsTab-YAGYRBIE.js} +3 -3
- package/dist/host/{chunk-57DJU2ZA.js → chunk-2MU6WNSX.js} +1 -1
- package/dist/host/{chunk-VFTB2RDP.js → chunk-446UEDSK.js} +4 -2
- package/dist/host/{chunk-3L45NNT5.js → chunk-7LEJ3HYF.js} +20 -3
- package/dist/host/{chunk-V44FCJBQ.js → chunk-J2AILBXM.js} +540 -400
- package/dist/host/{chunk-2IV3VX7F.js → chunk-LQKK2JJA.js} +5 -1
- package/dist/host/core-classes.json +1 -1
- package/dist/host/{linked-server-SCJH7DSL.js → linked-server-OUF3POT7.js} +5 -3
- package/dist/host/{rbac-api-KA5IPQQL.js → rbac-api-LZVENREG.js} +1 -1
- package/dist/host/testing-host.js +4 -4
- package/dist/host/types/src/types/onboarding.d.ts +0 -1
- package/dist/host/types/src/ui/auth/Auth.d.ts +1 -0
- package/dist/host/types/src/ui/lib/linked-server.d.ts +2 -0
- package/dist/host/types/src/ui/plugin-host/NativeView.d.ts +19 -0
- package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +2 -6
- package/dist/host/types/src/ui/shell/CompanionFrame.d.ts +11 -0
- package/dist/host/types/src/ui/shell/companions.d.ts +63 -0
- package/dist/host/ui.js +149 -815
- package/dist/host/{use-permissions-LLN6TLAL.js → use-permissions-BYCDS5PD.js} +1 -1
- package/dist/manifest.d.ts +1 -1
- package/dist/manifest.js +1 -1
- package/dist/testing.d.ts +5 -1
- package/dist/testing.js +28 -0
- package/package.json +1 -1
- package/schema/manifest.schema.json +2 -0
- package/dist/host/types/src/ui/api/sync-api.d.ts +0 -93
- package/dist/host/types/src/ui/auth/ElectronLoginForm.d.ts +0 -9
- package/dist/host/types/src/ui/hooks/use-sync-status.d.ts +0 -4
- package/dist/host/types/src/ui/lib/sync-status.d.ts +0 -6
- package/dist/host/types/src/ui/settings/sync/LinkServerDialog.d.ts +0 -12
- package/dist/host/types/src/ui/settings/sync/ProxySettingsFields.d.ts +0 -15
- package/dist/host/types/src/ui/settings/sync/saved-servers.d.ts +0 -3
package/dist/frontend.d.ts
CHANGED
|
@@ -773,6 +773,43 @@ export interface SettingsComponentProps {
|
|
|
773
773
|
setValue: (key: string, value: unknown) => void;
|
|
774
774
|
running: boolean;
|
|
775
775
|
}
|
|
776
|
+
/** What a companion starts with. Read from the plugin's own settings. */
|
|
777
|
+
export interface CompanionDefaults {
|
|
778
|
+
/** Open by itself the first time a matching tab shows. */
|
|
779
|
+
open?: boolean;
|
|
780
|
+
side?: "left" | "right" | "bottom";
|
|
781
|
+
/** Pixels of width, or height at the bottom. */
|
|
782
|
+
size?: number;
|
|
783
|
+
/** Show the edge button that opens and closes it. Default true. */
|
|
784
|
+
edgeButton?: boolean;
|
|
785
|
+
}
|
|
786
|
+
export interface CompanionProps {
|
|
787
|
+
/** The tab it sits beside. */
|
|
788
|
+
tab: PluginTabRecord;
|
|
789
|
+
host?: PluginHostRecord;
|
|
790
|
+
/** The host in the shape the connection APIs take. */
|
|
791
|
+
sshHost?: Record<string, unknown>;
|
|
792
|
+
/** The tab's surface handle (see TabHandle), read at call time. */
|
|
793
|
+
getHandle: () => TabHandle | null;
|
|
794
|
+
side: "left" | "right" | "bottom";
|
|
795
|
+
/** False while the tab is in the background or the panel is closed. */
|
|
796
|
+
isVisible: boolean;
|
|
797
|
+
close: () => void;
|
|
798
|
+
setSide: (side: "left" | "right" | "bottom") => void;
|
|
799
|
+
}
|
|
800
|
+
export interface CompanionOptions {
|
|
801
|
+
icon?: IconComponent;
|
|
802
|
+
titleKey?: string;
|
|
803
|
+
order?: number;
|
|
804
|
+
/** Tab types it applies to. Any tab with a host when empty. */
|
|
805
|
+
tabTypes?: string[];
|
|
806
|
+
when?: (tab: PluginTabRecord, host?: PluginHostRecord) => boolean;
|
|
807
|
+
/**
|
|
808
|
+
* A hook returning the starting state. It runs in the plugin's scope, so it
|
|
809
|
+
* can read the plugin's settings.
|
|
810
|
+
*/
|
|
811
|
+
useDefaults?: () => CompanionDefaults;
|
|
812
|
+
}
|
|
776
813
|
export type ActionHandler = (...args: never[]) => unknown;
|
|
777
814
|
export interface ActionSlotDefinition {
|
|
778
815
|
id: string;
|
|
@@ -1001,6 +1038,14 @@ export interface TermixApp extends TermixAppInfo {
|
|
|
1001
1038
|
registerRailItem: (item: RailItemContribution) => Disposer;
|
|
1002
1039
|
registerPanel: (id: string, component: ComponentType<PanelProps>, options?: PanelOptions) => Disposer;
|
|
1003
1040
|
registerTab: (type: string, component: ComponentType<TabProps>, options?: TabOptions) => Disposer;
|
|
1041
|
+
/**
|
|
1042
|
+
* A panel that sits beside any host tab the options match (a terminal, a
|
|
1043
|
+
* desktop, ...), bound to that tab's host. The user opens, resizes and moves
|
|
1044
|
+
* it; the tab keeps running underneath.
|
|
1045
|
+
*/
|
|
1046
|
+
registerCompanion: (id: string, component: ComponentType<CompanionProps>, options?: CompanionOptions) => Disposer;
|
|
1047
|
+
/** Opens a companion on a tab, or closes it when it is showing. */
|
|
1048
|
+
toggleCompanion: (tab: PluginTabRecord, id?: string) => void;
|
|
1004
1049
|
registerHostEditorSection: (section: HostEditorSectionContribution) => Disposer;
|
|
1005
1050
|
registerHostAction: (action: HostActionContribution) => Disposer;
|
|
1006
1051
|
registerHostProtocol: (protocol: HostProtocolContribution) => Disposer;
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
sortPlugins,
|
|
30
30
|
uploadEntry,
|
|
31
31
|
youtubeEmbedUrl
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-446UEDSK.js";
|
|
33
33
|
import {
|
|
34
34
|
ArrowDownWideNarrow,
|
|
35
35
|
BookOpen,
|
|
@@ -107,8 +107,8 @@ import {
|
|
|
107
107
|
updatePlugin,
|
|
108
108
|
uploadPlugin,
|
|
109
109
|
useConfirm
|
|
110
|
-
} from "./chunk-
|
|
111
|
-
import "./chunk-
|
|
110
|
+
} from "./chunk-LQKK2JJA.js";
|
|
111
|
+
import "./chunk-7LEJ3HYF.js";
|
|
112
112
|
import {
|
|
113
113
|
__toESM,
|
|
114
114
|
define_import_meta_env_default,
|
|
@@ -26,7 +26,7 @@ var inFlight = null;
|
|
|
26
26
|
function load() {
|
|
27
27
|
if (cache) return Promise.resolve(cache);
|
|
28
28
|
if (inFlight) return inFlight;
|
|
29
|
-
inFlight = import("./rbac-api-
|
|
29
|
+
inFlight = import("./rbac-api-LZVENREG.js").then(({ getMyPermissions }) => getMyPermissions()).then((result) => {
|
|
30
30
|
cache = {
|
|
31
31
|
permissions: result.permissions ?? [],
|
|
32
32
|
isAdmin: !!result.isAdmin
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
Trash,
|
|
8
8
|
cn,
|
|
9
9
|
useAreaPreferences
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LQKK2JJA.js";
|
|
11
11
|
import {
|
|
12
12
|
isElectron
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7LEJ3HYF.js";
|
|
14
14
|
import {
|
|
15
15
|
__commonJS,
|
|
16
16
|
__toESM,
|
|
@@ -2383,6 +2383,8 @@ var CAPABILITY_CATALOG = [
|
|
|
2383
2383
|
entry("db:core-refs", "high"),
|
|
2384
2384
|
entry("auth:provide", "high"),
|
|
2385
2385
|
entry("auth:policy", "high"),
|
|
2386
|
+
entry("sync:provide", "high"),
|
|
2387
|
+
entry("ssh:transport", "high"),
|
|
2386
2388
|
entry("device:serial", "high"),
|
|
2387
2389
|
entry("notify:hub", "high"),
|
|
2388
2390
|
entry("ui:layout", "high"),
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
|
|
8
8
|
// src/ui/lib/linked-server.ts
|
|
9
9
|
init_define_import_meta_env();
|
|
10
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
10
11
|
|
|
11
12
|
// src/ui/lib/electron.ts
|
|
12
13
|
init_define_import_meta_env();
|
|
@@ -5432,7 +5433,6 @@ init_define_import_meta_env();
|
|
|
5432
5433
|
init_define_import_meta_env();
|
|
5433
5434
|
var LEGACY_SEEN = Object.freeze({
|
|
5434
5435
|
plugins: 1,
|
|
5435
|
-
"desktop-sync": 1,
|
|
5436
5436
|
preset: 1,
|
|
5437
5437
|
appearance: 1,
|
|
5438
5438
|
security: 1
|
|
@@ -6316,7 +6316,7 @@ async function updateRole(roleId, roleData) {
|
|
|
6316
6316
|
try {
|
|
6317
6317
|
const response = await rbacApi.put(`/rbac/roles/${roleId}`, roleData);
|
|
6318
6318
|
if (roleData.permissions) {
|
|
6319
|
-
const { notifyPermissionsChanged } = await import("./use-permissions-
|
|
6319
|
+
const { notifyPermissionsChanged } = await import("./use-permissions-BYCDS5PD.js");
|
|
6320
6320
|
notifyPermissionsChanged();
|
|
6321
6321
|
}
|
|
6322
6322
|
return response.data;
|
|
@@ -6898,7 +6898,7 @@ function createRemoteOriginApiInstance(path) {
|
|
|
6898
6898
|
});
|
|
6899
6899
|
instance.interceptors.request.use(
|
|
6900
6900
|
async (config) => {
|
|
6901
|
-
const { getLinkedSession: getLinkedSession2 } = await import("./linked-server-
|
|
6901
|
+
const { getLinkedSession: getLinkedSession2 } = await import("./linked-server-OUF3POT7.js");
|
|
6902
6902
|
const linked = await getLinkedSession2();
|
|
6903
6903
|
config.baseURL = linked ? `${linked.serverUrl}${path}` : "http://no-server-configured";
|
|
6904
6904
|
if (config.headers.set) {
|
|
@@ -7287,6 +7287,22 @@ function notifySyncChanged() {
|
|
|
7287
7287
|
cached = null;
|
|
7288
7288
|
window.dispatchEvent(new CustomEvent(SYNC_CHANGED_EVENT));
|
|
7289
7289
|
}
|
|
7290
|
+
function useDesktopLinked() {
|
|
7291
|
+
const [linked, setLinked] = useState2(false);
|
|
7292
|
+
useEffect2(() => {
|
|
7293
|
+
let live = true;
|
|
7294
|
+
const read = () => void getLinkedSession().then((session) => {
|
|
7295
|
+
if (live) setLinked(!!session);
|
|
7296
|
+
});
|
|
7297
|
+
read();
|
|
7298
|
+
window.addEventListener(SYNC_CHANGED_EVENT, read);
|
|
7299
|
+
return () => {
|
|
7300
|
+
live = false;
|
|
7301
|
+
window.removeEventListener(SYNC_CHANGED_EVENT, read);
|
|
7302
|
+
};
|
|
7303
|
+
}, []);
|
|
7304
|
+
return linked;
|
|
7305
|
+
}
|
|
7290
7306
|
|
|
7291
7307
|
export {
|
|
7292
7308
|
getPluginStoreState,
|
|
@@ -7332,6 +7348,7 @@ export {
|
|
|
7332
7348
|
websocketAuthProtocols,
|
|
7333
7349
|
getLinkedSession,
|
|
7334
7350
|
notifySyncChanged,
|
|
7351
|
+
useDesktopLinked,
|
|
7335
7352
|
resolveConnectionOrigin,
|
|
7336
7353
|
buildOriginWsUrl,
|
|
7337
7354
|
getAllServerStatuses,
|