@termix-ssh/plugin-sdk 1.0.10 → 1.0.12
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 +30 -0
- package/PLUGIN-GUIDE.md +151 -36
- package/cli/commands/build.mjs +36 -22
- package/cli/commands/pack.mjs +12 -2
- package/cli/commands/validate.mjs +63 -3
- package/cli/lib/plugin-dir.mjs +11 -0
- package/cli/lib/tmxplug.mjs +9 -0
- package/dist/backend.d.ts +37 -3
- package/dist/capabilities.js +2 -0
- package/dist/frontend.d.ts +152 -0
- package/dist/frontend.js +7 -0
- package/dist/host/PluginsTab-EV4MSGY6.js +2933 -0
- package/dist/host/{chunk-G346FUE4.js → chunk-AWR6FYDO.js} +8877 -11159
- package/dist/host/{chunk-NZG6HNQH.js → chunk-RUPLD6RF.js} +1504 -15
- package/dist/host/{chunk-DIOJ3KW2.js → chunk-VEWOYAMZ.js} +6 -1
- package/dist/host/chunk-X4QZKO5G.js +3120 -0
- package/dist/host/chunk-XKA3DBB2.js +10375 -0
- package/dist/host/chunk-YGYBM7SQ.js +58 -0
- package/dist/host/core-classes.json +1 -1
- package/dist/host/{linked-server-QAKKDBFM.js → linked-server-B4NEG4MA.js} +2 -2
- package/dist/host/{rbac-api-5267EMX7.js → rbac-api-OUO3LUOC.js} +2 -2
- package/dist/host/testing-host.js +123 -57
- package/dist/host/types/src/types/ui-types.d.ts +2 -1
- package/dist/host/types/src/ui/api/audit-log-api.d.ts +46 -0
- package/dist/host/types/src/ui/api/host-defaults-api.d.ts +42 -0
- package/dist/host/types/src/ui/api/host-tags-api.d.ts +2 -0
- package/dist/host/types/src/ui/api/look-api.d.ts +40 -0
- package/dist/host/types/src/ui/api/open-tabs-api.d.ts +4 -0
- package/dist/host/types/src/ui/api/plugins-api.d.ts +26 -0
- package/dist/host/types/src/ui/api/private-endpoints-api.d.ts +6 -0
- package/dist/host/types/src/ui/api/tls-api.d.ts +25 -0
- package/dist/host/types/src/ui/auth/ElectronLoginForm.d.ts +9 -0
- package/dist/host/types/src/ui/components/command.d.ts +78 -0
- package/dist/host/types/src/ui/components/folder-style.d.ts +16 -0
- package/dist/host/types/src/ui/components/theme-provider.d.ts +2 -1
- package/dist/host/types/src/ui/components/version-badge.d.ts +7 -0
- package/dist/host/types/src/ui/hooks/use-page-visible-interval.d.ts +10 -0
- package/dist/host/types/src/ui/lib/activity-types.d.ts +15 -0
- package/dist/host/types/src/ui/lib/app-version.d.ts +2 -0
- package/dist/host/types/src/ui/lib/apply-ui-preset.d.ts +19 -0
- package/dist/host/types/src/ui/lib/connection-origin.d.ts +4 -5
- package/dist/host/types/src/ui/lib/create-id.d.ts +2 -0
- package/dist/host/types/src/ui/lib/database-transfer-url.d.ts +8 -0
- package/dist/host/types/src/ui/lib/desktop-updates.d.ts +29 -0
- package/dist/host/types/src/ui/lib/electron.d.ts +5 -0
- package/dist/host/types/src/ui/lib/host-connection-tabs.d.ts +14 -0
- package/dist/host/types/src/ui/lib/host-to-ssh-host.d.ts +4 -0
- package/dist/host/types/src/ui/lib/issue-url.d.ts +21 -0
- package/dist/host/types/src/ui/lib/local-adaptive-preferences.d.ts +9 -0
- package/dist/host/types/src/ui/lib/pane-nav-hotkey.d.ts +7 -0
- package/dist/host/types/src/ui/lib/plugin-i18n.d.ts +16 -0
- package/dist/host/types/src/ui/lib/role-label.d.ts +3 -0
- package/dist/host/types/src/ui/look/LookSettings.d.ts +8 -0
- package/dist/host/types/src/ui/look/layout-registry.d.ts +34 -0
- package/dist/host/types/src/ui/look/look-store.d.ts +29 -0
- package/dist/host/types/src/ui/look/resolve-look.d.ts +18 -0
- package/dist/host/types/src/ui/look/theme-css.d.ts +7 -0
- package/dist/host/types/src/ui/look/theme-registry.d.ts +41 -0
- package/dist/host/types/src/ui/look/use-look-theme.d.ts +12 -0
- package/dist/host/types/src/ui/manage/manage-requests.d.ts +34 -0
- package/dist/host/types/src/ui/plugin-host/loader.d.ts +2 -0
- package/dist/host/types/src/ui/plugin-host/scope.d.ts +6 -0
- package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +102 -0
- package/dist/host/types/src/ui/plugin-host/view-ownership.d.ts +1 -1
- package/dist/host/types/src/ui/plugins/PluginConsentPrompt.d.ts +20 -0
- package/dist/host/types/src/ui/plugins/PluginDetail.d.ts +7 -0
- package/dist/host/types/src/ui/plugins/PluginReleaseNotes.d.ts +14 -0
- package/dist/host/types/src/ui/plugins/PluginsTab.d.ts +1 -0
- package/dist/host/types/src/ui/plugins/RegistriesSection.d.ts +4 -0
- package/dist/host/types/src/ui/plugins/plugin-bits.d.ts +23 -0
- package/dist/host/types/src/ui/plugins/plugin-model.d.ts +116 -0
- package/dist/host/types/src/ui/plugins/use-plugins-manager.d.ts +75 -0
- package/dist/host/types/src/ui/settings/appearance/appearance-controls.d.ts +53 -0
- package/dist/host/types/src/ui/settings/sync/LinkServerDialog.d.ts +12 -0
- package/dist/host/types/src/ui/settings/sync/ProxySettingsFields.d.ts +15 -0
- package/dist/host/types/src/ui/settings/sync/saved-servers.d.ts +3 -0
- package/dist/host/types/src/ui/shell/controller/ShellControllerProvider.d.ts +20 -0
- package/dist/host/types/src/ui/shell/controller/plugin-shell.d.ts +7 -0
- package/dist/host/types/src/ui/shell/controller/shell-store.d.ts +4 -0
- package/dist/host/types/src/ui/shell/controller/types.d.ts +156 -0
- package/dist/host/types/src/ui/shell/controller/use-hosts.d.ts +10 -0
- package/dist/host/types/src/ui/shell/controller/use-regions.d.ts +5 -0
- package/dist/host/types/src/ui/shell/controller/use-shell-keybindings.d.ts +12 -0
- package/dist/host/types/src/ui/shell/controller/use-shell-lifecycle.d.ts +17 -0
- package/dist/host/types/src/ui/shell/controller/use-split.d.ts +21 -0
- package/dist/host/types/src/ui/shell/controller/use-tabs.d.ts +70 -0
- package/dist/host/types/src/ui/shell/controller/use-workspace-layout.d.ts +4 -0
- package/dist/host/types/src/ui/shell/reconnect-tabs.d.ts +6 -0
- package/dist/host/types/src/ui/shell/shell-layout.d.ts +46 -0
- package/dist/host/types/src/ui/shell/split/EmptyPanePicker.d.ts +32 -0
- package/dist/host/types/src/ui/shell/split/SplitDropOverlay.d.ts +9 -0
- package/dist/host/types/src/ui/shell/split/SplitLayoutMenu.d.ts +16 -0
- package/dist/host/types/src/ui/shell/split/SplitView.d.ts +31 -0
- package/dist/host/types/src/ui/shell/split/split-drag.d.ts +58 -0
- package/dist/host/types/src/ui/shell/split/split-presets.d.ts +28 -0
- package/dist/host/types/src/ui/shell/split/split-tabs.d.ts +95 -0
- package/dist/host/types/src/ui/shell/split/split-targets.d.ts +30 -0
- package/dist/host/types/src/ui/shell/split/split-tree.d.ts +89 -0
- package/dist/host/types/src/ui/shell/stage/TabStage.d.ts +9 -0
- package/dist/host/types/src/ui/shell/stage/tab-stage-store.d.ts +24 -0
- package/dist/host/types/src/ui/shell/tab-close-guards.d.ts +9 -0
- package/dist/host/types/src/ui/shell/tab-handles.d.ts +8 -0
- package/dist/host/types/src/ui/shell/tabUtils.d.ts +15 -0
- package/dist/host/types/src/ui/sidebar/AuthEnrollmentSections.d.ts +5 -0
- package/dist/host/types/src/ui/sidebar/HostManagerData.d.ts +4 -0
- package/dist/host/types/src/ui/sidebar/HostManagerTabs.d.ts +10 -4
- package/dist/host/types/src/ui/sidebar/build-host-tree.d.ts +25 -0
- package/dist/host/types/src/ui/sidebar/host-export-payload.d.ts +30 -0
- package/dist/host/ui.js +6238 -4054
- package/dist/host/{use-permissions-2P2TP6GY.js → use-permissions-6VSHHUMB.js} +2 -2
- package/dist/manifest.d.ts +41 -1
- package/dist/manifest.js +89 -1
- package/dist/testing/setup.js +1 -0
- package/dist/testing.d.ts +12 -1
- package/dist/testing.js +25 -1
- package/dist/theme-css.d.ts +11 -0
- package/dist/theme-css.js +142 -0
- package/dist/vitest-preset.d.ts +18 -0
- package/dist/vitest-preset.js +14 -3
- package/package.json +1 -1
- package/schema/manifest.schema.json +111 -8
- package/tsconfig.plugin.json +1 -0
- package/dist/host/chunk-YC2MAKSP.js +0 -14
package/dist/frontend.d.ts
CHANGED
|
@@ -222,6 +222,146 @@ export interface TabsApi extends Pick<ShellApi, "openTab" | "openSingletonTab" |
|
|
|
222
222
|
/** Called once the shell has restored its tabs after login. */
|
|
223
223
|
onReady: (listener: () => void) => Disposer;
|
|
224
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* A whole-app layout. Core renders the chosen one inside its providers and an
|
|
227
|
+
* error boundary; everything it shows comes from useShell(). Declare it in
|
|
228
|
+
* manifest contributes.layouts and add the ui:layout capability.
|
|
229
|
+
*/
|
|
230
|
+
export interface LayoutContribution {
|
|
231
|
+
id: string;
|
|
232
|
+
/** Your own i18n key or plain text, the same as the manifest's label. */
|
|
233
|
+
label: string;
|
|
234
|
+
component: ComponentType;
|
|
235
|
+
/** Shown on phones and narrow windows. The desktop app never uses it. */
|
|
236
|
+
mobileComponent?: ComponentType;
|
|
237
|
+
/** Theme to start with when nobody chose one. */
|
|
238
|
+
defaultTheme?: string;
|
|
239
|
+
}
|
|
240
|
+
/** A tab as a layout sees it. Splits are tabs too, with a `split` field. */
|
|
241
|
+
export interface ShellTabState extends PluginTabRecord {
|
|
242
|
+
instanceId: string;
|
|
243
|
+
customLabel?: string;
|
|
244
|
+
/** Set while the tab sits in a split pane. */
|
|
245
|
+
parentSplitTabId?: string;
|
|
246
|
+
openedAt?: number;
|
|
247
|
+
}
|
|
248
|
+
/** What a dock region shows and how it is sized, in Normal-size pixels. */
|
|
249
|
+
export interface ShellDockState {
|
|
250
|
+
view: string | null;
|
|
251
|
+
open: boolean;
|
|
252
|
+
width: number;
|
|
253
|
+
dragging: boolean;
|
|
254
|
+
setView: (view: string | null) => void;
|
|
255
|
+
setWidth: (width: number) => void;
|
|
256
|
+
/** Starts a drag from the dock's edge, from a mousedown. */
|
|
257
|
+
startResize: (event: {
|
|
258
|
+
clientX: number;
|
|
259
|
+
preventDefault: () => void;
|
|
260
|
+
}) => void;
|
|
261
|
+
resetWidth: () => void;
|
|
262
|
+
}
|
|
263
|
+
/** The live shell: state and actions, nothing drawn. Read with useShell(). */
|
|
264
|
+
export interface ShellController {
|
|
265
|
+
tabs: {
|
|
266
|
+
list: ShellTabState[];
|
|
267
|
+
/** What a tab bar shows: tabs not sitting in a split. */
|
|
268
|
+
topLevel: ShellTabState[];
|
|
269
|
+
activeId: string;
|
|
270
|
+
/** True once saved tabs were restored after login. */
|
|
271
|
+
ready: boolean;
|
|
272
|
+
/** The user turned on tab numbers. */
|
|
273
|
+
showNumbers: boolean;
|
|
274
|
+
setActive: (id: string) => void;
|
|
275
|
+
reorder: (topLevel: ShellTabState[]) => void;
|
|
276
|
+
close: (id: string) => Promise<void>;
|
|
277
|
+
rename: (id: string, label: string) => void;
|
|
278
|
+
/** Reconnects or reloads a session tab. */
|
|
279
|
+
refresh: (id: string) => void;
|
|
280
|
+
reconnectAll: () => void;
|
|
281
|
+
openSingleton: (type: string) => string | undefined;
|
|
282
|
+
};
|
|
283
|
+
split: {
|
|
284
|
+
/** The split shown now, or null. */
|
|
285
|
+
activeId: string | null;
|
|
286
|
+
focusedPaneId: string | null;
|
|
287
|
+
/** Every split with its panes, for a split menu. */
|
|
288
|
+
summaries: Array<{
|
|
289
|
+
id: string;
|
|
290
|
+
label: string;
|
|
291
|
+
full: boolean;
|
|
292
|
+
panes: Array<{
|
|
293
|
+
id: string;
|
|
294
|
+
index: number;
|
|
295
|
+
tabId: string | null;
|
|
296
|
+
label: string | null;
|
|
297
|
+
}>;
|
|
298
|
+
}>;
|
|
299
|
+
activeFull: boolean;
|
|
300
|
+
/** Split a tab, apply a preset, unsplit, add to a pane. */
|
|
301
|
+
handleAction: (action: Record<string, unknown> & {
|
|
302
|
+
kind: string;
|
|
303
|
+
}) => void;
|
|
304
|
+
};
|
|
305
|
+
hosts: {
|
|
306
|
+
list: PluginHostRecord[];
|
|
307
|
+
loading: boolean;
|
|
308
|
+
loaded: boolean;
|
|
309
|
+
reload: () => Promise<void>;
|
|
310
|
+
};
|
|
311
|
+
regions: {
|
|
312
|
+
left: ShellDockState & {
|
|
313
|
+
view: string;
|
|
314
|
+
};
|
|
315
|
+
right: ShellDockState;
|
|
316
|
+
/** What a rail click does: toggles or switches the left dock. */
|
|
317
|
+
railClick: (view: string) => void;
|
|
318
|
+
openInRightDock: (view: string) => void;
|
|
319
|
+
toggleRightDock: () => void;
|
|
320
|
+
};
|
|
321
|
+
palette: {
|
|
322
|
+
isOpen: boolean;
|
|
323
|
+
open: () => void;
|
|
324
|
+
close: () => void;
|
|
325
|
+
};
|
|
326
|
+
fullscreen: {
|
|
327
|
+
active: boolean;
|
|
328
|
+
toggle: () => void;
|
|
329
|
+
};
|
|
330
|
+
/** The same callbacks tabs and panels get. */
|
|
331
|
+
actions: ShellApi;
|
|
332
|
+
env: {
|
|
333
|
+
isMobile: boolean;
|
|
334
|
+
isElectron: boolean;
|
|
335
|
+
user: {
|
|
336
|
+
username: string;
|
|
337
|
+
isAdmin: boolean;
|
|
338
|
+
};
|
|
339
|
+
permissions: string[];
|
|
340
|
+
branding: {
|
|
341
|
+
appName: string | null;
|
|
342
|
+
tagline: string | null;
|
|
343
|
+
logo: string | null;
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
/** Core registries, as hooks a layout calls while rendering. */
|
|
347
|
+
registries: {
|
|
348
|
+
useRailItems: () => ReadonlyArray<{
|
|
349
|
+
id: string;
|
|
350
|
+
} & Record<string, unknown>>;
|
|
351
|
+
usePanels: () => ReadonlyArray<{
|
|
352
|
+
id: string;
|
|
353
|
+
} & Record<string, unknown>>;
|
|
354
|
+
useTabTypes: () => ReadonlyArray<{
|
|
355
|
+
id: string;
|
|
356
|
+
} & Record<string, unknown>>;
|
|
357
|
+
useDashboardCards: () => ReadonlyArray<{
|
|
358
|
+
id: string;
|
|
359
|
+
} & Record<string, unknown>>;
|
|
360
|
+
};
|
|
361
|
+
logout: (options?: {
|
|
362
|
+
manual?: boolean;
|
|
363
|
+
}) => void;
|
|
364
|
+
}
|
|
225
365
|
export interface RailItemContribution {
|
|
226
366
|
/** Must be declared in manifest contributes.tabs or contributes.panels. */
|
|
227
367
|
id: string;
|
|
@@ -886,6 +1026,12 @@ export interface TermixApp extends TermixAppInfo {
|
|
|
886
1026
|
registerSshAuthEditor: (editor: SshAuthEditorContribution) => Disposer;
|
|
887
1027
|
registerLoginMethod: (method: LoginMethodContribution) => Disposer;
|
|
888
1028
|
registerSecondFactorUI: (factor: SecondFactorContribution) => Disposer;
|
|
1029
|
+
/**
|
|
1030
|
+
* A whole-app layout. Declared in manifest contributes.layouts with the
|
|
1031
|
+
* ui:layout capability. Only the chosen layout's plugin is loaded, so
|
|
1032
|
+
* register it in activate. Needs plugin API 1.4.
|
|
1033
|
+
*/
|
|
1034
|
+
registerLayout: (layout: LayoutContribution) => Disposer;
|
|
889
1035
|
/**
|
|
890
1036
|
* Translates a key from the plugin's own locales, for code outside a
|
|
891
1037
|
* component (a toast from activate). Components use useTranslation().
|
|
@@ -993,6 +1139,7 @@ export interface PluginHostBridge {
|
|
|
993
1139
|
useTheme: () => {
|
|
994
1140
|
theme: "light" | "dark";
|
|
995
1141
|
};
|
|
1142
|
+
useShell: () => ShellController | null;
|
|
996
1143
|
toast: ToastApi;
|
|
997
1144
|
getApi: (pluginId: string) => PluginApiClient;
|
|
998
1145
|
getApiFor: (pluginId: string, origin: unknown) => PluginApiClient;
|
|
@@ -1154,6 +1301,11 @@ export declare function useCurrentUser(): CurrentUser | null;
|
|
|
1154
1301
|
export declare function useTheme(): {
|
|
1155
1302
|
theme: "light" | "dark";
|
|
1156
1303
|
};
|
|
1304
|
+
/**
|
|
1305
|
+
* The live shell, for a layout. Null outside the signed-in app. Needs plugin
|
|
1306
|
+
* API 1.4.
|
|
1307
|
+
*/
|
|
1308
|
+
export declare function useShell(): ShellController | null;
|
|
1157
1309
|
export declare function useToast(): ToastApi;
|
|
1158
1310
|
export declare function logActivity(type: string, hostId: number, hostName: string): Promise<void>;
|
|
1159
1311
|
/** Tells the shell hosts were added or changed, so its lists reload. */
|
package/dist/frontend.js
CHANGED
|
@@ -98,6 +98,13 @@ export function useCurrentUser() {
|
|
|
98
98
|
export function useTheme() {
|
|
99
99
|
return requireHost().useTheme();
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* The live shell, for a layout. Null outside the signed-in app. Needs plugin
|
|
103
|
+
* API 1.4.
|
|
104
|
+
*/
|
|
105
|
+
export function useShell() {
|
|
106
|
+
return requireHost().useShell();
|
|
107
|
+
}
|
|
101
108
|
export function useToast() {
|
|
102
109
|
return requireHost().toast;
|
|
103
110
|
}
|