@termix-ssh/plugin-sdk 1.0.0
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/README.md +52 -0
- package/cli/commands/build.mjs +246 -0
- package/cli/commands/migrations.mjs +248 -0
- package/cli/commands/pack.mjs +42 -0
- package/cli/commands/sign.mjs +83 -0
- package/cli/commands/test.mjs +33 -0
- package/cli/commands/validate.mjs +215 -0
- package/cli/index.mjs +65 -0
- package/cli/lib/changelog.mjs +126 -0
- package/cli/lib/externals.mjs +46 -0
- package/cli/lib/plugin-dir.mjs +29 -0
- package/cli/lib/signing.mjs +86 -0
- package/cli/lib/static-url-imports.mjs +54 -0
- package/cli/lib/tmxplug.mjs +106 -0
- package/cli/patches/guacamole-common-js-flush.cjs +76 -0
- package/cli/patches/xterm-android-ime.cjs +130 -0
- package/client.d.ts +13 -0
- package/dist/backend.d.ts +1777 -0
- package/dist/backend.js +84 -0
- package/dist/capabilities.d.ts +38 -0
- package/dist/capabilities.js +71 -0
- package/dist/db.d.ts +112 -0
- package/dist/db.js +189 -0
- package/dist/ddl.d.ts +76 -0
- package/dist/ddl.js +678 -0
- package/dist/desktop.d.ts +346 -0
- package/dist/desktop.js +5 -0
- package/dist/frontend.d.ts +1206 -0
- package/dist/frontend.js +388 -0
- package/dist/host/chunk-F3SDZDDG.js +6017 -0
- package/dist/host/chunk-XGWE7BTJ.js +90 -0
- package/dist/host/chunk-XH5NXL6Y.js +56314 -0
- package/dist/host/chunk-YC2MAKSP.js +14 -0
- package/dist/host/linked-server-FZGWQW32.js +12 -0
- package/dist/host/rbac-api-6KDMBVDZ.js +52 -0
- package/dist/host/testing-host.js +414 -0
- package/dist/host/theme.css +91 -0
- package/dist/host/types/src/types/auth-protocols.d.ts +10 -0
- package/dist/host/types/src/types/connection-log.d.ts +13 -0
- package/dist/host/types/src/types/credential-sidebar-preferences.d.ts +38 -0
- package/dist/host/types/src/types/host-defaults.d.ts +60 -0
- package/dist/host/types/src/types/host-sidebar-preferences.d.ts +55 -0
- package/dist/host/types/src/types/index.d.ts +298 -0
- package/dist/host/types/src/types/keybindings.d.ts +27 -0
- package/dist/host/types/src/types/ui-preferences.d.ts +102 -0
- package/dist/host/types/src/types/ui-types.d.ts +260 -0
- package/dist/host/types/src/ui/api/admin-user-data-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/auth-methods-api.d.ts +63 -0
- package/dist/host/types/src/ui/api/credential-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/credentials-api.d.ts +56 -0
- package/dist/host/types/src/ui/api/dashboard-api.d.ts +23 -0
- package/dist/host/types/src/ui/api/external-account-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/host-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/host-status-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/open-tabs-api.d.ts +74 -0
- package/dist/host/types/src/ui/api/plugins-api.d.ts +128 -0
- package/dist/host/types/src/ui/api/rbac-api.d.ts +167 -0
- package/dist/host/types/src/ui/api/settings-api.d.ts +22 -0
- package/dist/host/types/src/ui/api/ssh-host-management-api.d.ts +65 -0
- package/dist/host/types/src/ui/api/sync-api.d.ts +93 -0
- package/dist/host/types/src/ui/api/system-status-api.d.ts +49 -0
- package/dist/host/types/src/ui/api/ui-preferences-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/user-management-api.d.ts +80 -0
- package/dist/host/types/src/ui/auth/Auth.d.ts +12 -0
- package/dist/host/types/src/ui/auth/auth-bits.d.ts +11 -0
- package/dist/host/types/src/ui/auth/silent-signin.d.ts +2 -0
- package/dist/host/types/src/ui/components/FullScreenAppWrapper.d.ts +9 -0
- package/dist/host/types/src/ui/components/alert-dialog.d.ts +14 -0
- package/dist/host/types/src/ui/components/alert.d.ts +9 -0
- package/dist/host/types/src/ui/components/badge.d.ts +9 -0
- package/dist/host/types/src/ui/components/button.d.ts +13 -0
- package/dist/host/types/src/ui/components/card-grid/CardGridCanvas.d.ts +22 -0
- package/dist/host/types/src/ui/components/card-grid/layout-utils.d.ts +26 -0
- package/dist/host/types/src/ui/components/card-grid/types.d.ts +29 -0
- package/dist/host/types/src/ui/components/card-masonry.d.ts +16 -0
- package/dist/host/types/src/ui/components/card.d.ts +11 -0
- package/dist/host/types/src/ui/components/charts/BarSeries.d.ts +16 -0
- package/dist/host/types/src/ui/components/charts/LineChart.d.ts +17 -0
- package/dist/host/types/src/ui/components/charts/RadialGauge.d.ts +18 -0
- package/dist/host/types/src/ui/components/charts/Sparkline.d.ts +22 -0
- package/dist/host/types/src/ui/components/charts/StatRow.d.ts +15 -0
- package/dist/host/types/src/ui/components/charts/geometry.d.ts +20 -0
- package/dist/host/types/src/ui/components/charts/index.d.ts +4 -0
- package/dist/host/types/src/ui/components/checkbox.d.ts +4 -0
- package/dist/host/types/src/ui/components/connection/ConnectionGate.d.ts +56 -0
- package/dist/host/types/src/ui/components/connection/ConnectionLogPanel.d.ts +9 -0
- package/dist/host/types/src/ui/components/connection/ConnectionScreen.d.ts +34 -0
- package/dist/host/types/src/ui/components/connection/connection-status.d.ts +1 -0
- package/dist/host/types/src/ui/components/data-view.d.ts +32 -0
- package/dist/host/types/src/ui/components/dialog.d.ts +17 -0
- package/dist/host/types/src/ui/components/dropdown-menu.d.ts +29 -0
- package/dist/host/types/src/ui/components/empty-state.d.ts +19 -0
- package/dist/host/types/src/ui/components/form-fields.d.ts +115 -0
- package/dist/host/types/src/ui/components/input.d.ts +3 -0
- package/dist/host/types/src/ui/components/kbd.d.ts +12 -0
- package/dist/host/types/src/ui/components/label.d.ts +4 -0
- package/dist/host/types/src/ui/components/manager-card.d.ts +25 -0
- package/dist/host/types/src/ui/components/meter.d.ts +14 -0
- package/dist/host/types/src/ui/components/metric-card.d.ts +18 -0
- package/dist/host/types/src/ui/components/panel-layout.d.ts +83 -0
- package/dist/host/types/src/ui/components/password-input.d.ts +4 -0
- package/dist/host/types/src/ui/components/popover.d.ts +7 -0
- package/dist/host/types/src/ui/components/scroll-area.d.ts +5 -0
- package/dist/host/types/src/ui/components/section-card.d.ts +29 -0
- package/dist/host/types/src/ui/components/select.d.ts +15 -0
- package/dist/host/types/src/ui/components/select2.d.ts +8 -0
- package/dist/host/types/src/ui/components/separator.d.ts +4 -0
- package/dist/host/types/src/ui/components/sheet.d.ts +14 -0
- package/dist/host/types/src/ui/components/sidebar.d.ts +69 -0
- package/dist/host/types/src/ui/components/skeleton.d.ts +2 -0
- package/dist/host/types/src/ui/components/slider.d.ts +4 -0
- package/dist/host/types/src/ui/components/sonner.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/prompt-styles.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/surface-scope.d.ts +79 -0
- package/dist/host/types/src/ui/components/switch.d.ts +4 -0
- package/dist/host/types/src/ui/components/tab-strip.d.ts +19 -0
- package/dist/host/types/src/ui/components/tabs.d.ts +7 -0
- package/dist/host/types/src/ui/components/textarea.d.ts +4 -0
- package/dist/host/types/src/ui/components/theme-provider.d.ts +14 -0
- package/dist/host/types/src/ui/components/tooltip.d.ts +7 -0
- package/dist/host/types/src/ui/contexts/BrandingContext.d.ts +15 -0
- package/dist/host/types/src/ui/contexts/UiPreferencesContext.d.ts +38 -0
- package/dist/host/types/src/ui/contexts/branding-document.d.ts +10 -0
- package/dist/host/types/src/ui/dashboard/dashboard-cards-registry.d.ts +30 -0
- package/dist/host/types/src/ui/hooks/use-action-slot.d.ts +10 -0
- package/dist/host/types/src/ui/hooks/use-adaptive-polling.d.ts +5 -0
- package/dist/host/types/src/ui/hooks/use-mobile.d.ts +1 -0
- package/dist/host/types/src/ui/hooks/use-permissions.d.ts +29 -0
- package/dist/host/types/src/ui/hooks/use-status-color-scheme.d.ts +12 -0
- package/dist/host/types/src/ui/hooks/use-sync-status.d.ts +4 -0
- package/dist/host/types/src/ui/hooks/useSshAuthProviders.d.ts +17 -0
- package/dist/host/types/src/ui/i18n/i18n.d.ts +52 -0
- package/dist/host/types/src/ui/lib/ServerStatusContext.d.ts +33 -0
- package/dist/host/types/src/ui/lib/adaptive-polling.d.ts +29 -0
- package/dist/host/types/src/ui/lib/adaptive-resource-budget.d.ts +39 -0
- package/dist/host/types/src/ui/lib/app-keyboard-shortcuts.d.ts +8 -0
- package/dist/host/types/src/ui/lib/base-path.d.ts +1 -0
- package/dist/host/types/src/ui/lib/clipboard-provider.d.ts +9 -0
- package/dist/host/types/src/ui/lib/clipboard.d.ts +20 -0
- package/dist/host/types/src/ui/lib/connection-origin.d.ts +47 -0
- package/dist/host/types/src/ui/lib/db-health-monitor.d.ts +34 -0
- package/dist/host/types/src/ui/lib/device-id.d.ts +1 -0
- package/dist/host/types/src/ui/lib/electron.d.ts +1 -0
- package/dist/host/types/src/ui/lib/embedded-server-status.d.ts +15 -0
- package/dist/host/types/src/ui/lib/error-message.d.ts +9 -0
- package/dist/host/types/src/ui/lib/frontend-logger.d.ts +67 -0
- package/dist/host/types/src/ui/lib/global-shortcut-handler.d.ts +3 -0
- package/dist/host/types/src/ui/lib/host-defaults-context.d.ts +48 -0
- package/dist/host/types/src/ui/lib/hosts-request-cache.d.ts +9 -0
- package/dist/host/types/src/ui/lib/keybinding-match.d.ts +3 -0
- package/dist/host/types/src/ui/lib/linked-server.d.ts +10 -0
- package/dist/host/types/src/ui/lib/local-adaptive-engine.d.ts +40 -0
- package/dist/host/types/src/ui/lib/permissions.d.ts +16 -0
- package/dist/host/types/src/ui/lib/plugin-i18n.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-icon.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-transport.d.ts +50 -0
- package/dist/host/types/src/ui/lib/registry.d.ts +29 -0
- package/dist/host/types/src/ui/lib/rem.d.ts +7 -0
- package/dist/host/types/src/ui/lib/remote-server-api.d.ts +11 -0
- package/dist/host/types/src/ui/lib/server-status-store.d.ts +37 -0
- package/dist/host/types/src/ui/lib/sync-events.d.ts +2 -0
- package/dist/host/types/src/ui/lib/sync-status.d.ts +6 -0
- package/dist/host/types/src/ui/lib/tab-jump-hotkey.d.ts +4 -0
- package/dist/host/types/src/ui/lib/theme.d.ts +21 -0
- package/dist/host/types/src/ui/lib/ttl-request-cache.d.ts +10 -0
- package/dist/host/types/src/ui/lib/usage-color.d.ts +5 -0
- package/dist/host/types/src/ui/lib/utils.d.ts +2 -0
- package/dist/host/types/src/ui/lib/visible-interval.d.ts +5 -0
- package/dist/host/types/src/ui/lib/widget-title.d.ts +8 -0
- package/dist/host/types/src/ui/lib/ws-auth.d.ts +1 -0
- package/dist/host/types/src/ui/main-axios.d.ts +170 -0
- package/dist/host/types/src/ui/plugin-host/PluginViewPlaceholder.d.ts +13 -0
- package/dist/host/types/src/ui/plugin-host/app.d.ts +18 -0
- package/dist/host/types/src/ui/plugin-host/auth-registry.d.ts +50 -0
- package/dist/host/types/src/ui/plugin-host/bridge.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/component-registry.d.ts +24 -0
- package/dist/host/types/src/ui/plugin-host/desktop.d.ts +7 -0
- package/dist/host/types/src/ui/plugin-host/extension-registry.d.ts +16 -0
- package/dist/host/types/src/ui/plugin-host/host-scope.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/loader.d.ts +52 -0
- package/dist/host/types/src/ui/plugin-host/plugin-store.d.ts +40 -0
- package/dist/host/types/src/ui/plugin-host/scope.d.ts +20 -0
- package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +99 -0
- package/dist/host/types/src/ui/plugin-host/shell-bridge.d.ts +67 -0
- package/dist/host/types/src/ui/plugin-host/view-ownership.d.ts +31 -0
- package/dist/host/types/src/ui/settings/HostPluginSections.d.ts +31 -0
- package/dist/host/types/src/ui/settings/SettingsFields.d.ts +22 -0
- package/dist/host/types/src/ui/settings/host-feature-tabs.d.ts +11 -0
- package/dist/host/types/src/ui/settings/settings-components.d.ts +32 -0
- package/dist/host/types/src/ui/settings/settings-fields-util.d.ts +11 -0
- package/dist/host/types/src/ui/shell/ActionSlot.d.ts +41 -0
- package/dist/host/types/src/ui/shell/TabContext.d.ts +30 -0
- package/dist/host/types/src/ui/shell/action-registry.d.ts +99 -0
- package/dist/host/types/src/ui/shell/keybinding-registry.d.ts +62 -0
- package/dist/host/types/src/ui/shell/palette-registry.d.ts +55 -0
- package/dist/host/types/src/ui/shell/panel-registry.d.ts +24 -0
- package/dist/host/types/src/ui/shell/tab-registry.d.ts +92 -0
- package/dist/host/types/src/ui/sidebar/HostManagerTabs.d.ts +65 -0
- package/dist/host/types/src/ui/sidebar/host-contributions.d.ts +72 -0
- package/dist/host/types/src/ui/sidebar/host-defaults/catalog.d.ts +17 -0
- package/dist/host/types/src/ui/sidebar/host-protocols.d.ts +49 -0
- package/dist/host/types/src/ui/sidebar/quick-connect-host.d.ts +21 -0
- package/dist/host/types/src/ui/sidebar/rail-items.d.ts +103 -0
- package/dist/host/types/src/ui/ssh/connection-log/ConnectionLogContext.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/BrowserSignInDialog.d.ts +18 -0
- package/dist/host/types/src/ui/ssh/dialogs/HostKeyVerificationDialog.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/PassphraseDialog.d.ts +15 -0
- package/dist/host/types/src/ui/ssh/dialogs/SSHAuthDialog.d.ts +20 -0
- package/dist/host/types/src/ui/ssh/dialogs/TOTPDialog.d.ts +13 -0
- package/dist/host/ui.d.ts +1 -0
- package/dist/host/ui.js +31754 -0
- package/dist/host/use-permissions-NULZL43J.js +18 -0
- package/dist/host-commands.d.ts +89 -0
- package/dist/host-commands.js +387 -0
- package/dist/manifest.d.ts +461 -0
- package/dist/manifest.js +1499 -0
- package/dist/settings.d.ts +43 -0
- package/dist/settings.js +168 -0
- package/dist/ssh-certs.d.ts +25 -0
- package/dist/ssh-certs.js +234 -0
- package/dist/ssh-options.d.ts +23 -0
- package/dist/ssh-options.js +1 -0
- package/dist/table-builder.d.ts +26 -0
- package/dist/table-builder.js +87 -0
- package/dist/testing/safe-ports.d.ts +10 -0
- package/dist/testing/safe-ports.js +59 -0
- package/dist/testing/setup.d.ts +7 -0
- package/dist/testing/setup.js +146 -0
- package/dist/testing.d.ts +537 -0
- package/dist/testing.js +1451 -0
- package/dist/vitest-preset.d.ts +54 -0
- package/dist/vitest-preset.js +96 -0
- package/package.json +143 -0
- package/schema/changelog.schema.json +67 -0
- package/schema/manifest.schema.json +1160 -0
- package/tsconfig.plugin.json +31 -0
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest v2: the inert JSON description of a plugin.
|
|
3
|
+
*
|
|
4
|
+
* Core reads this without running any plugin code, so everything that decides
|
|
5
|
+
* whether a plugin may load, what it may do and where its UI appears has to be
|
|
6
|
+
* expressible here.
|
|
7
|
+
*
|
|
8
|
+
* Unknown fields are rejected at every level. A typo'd "contribute" or
|
|
9
|
+
* "permissionGroups" used to validate clean and be silently dropped, which
|
|
10
|
+
* made a manifest look like it declared something it did not.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The plugin API this build implements. A minor bump adds to the API and
|
|
14
|
+
* never removes; a major bump may break plugins.
|
|
15
|
+
*
|
|
16
|
+
* engine.api is a semver range checked against this ("1" means any 1.x,
|
|
17
|
+
* "^1.2" needs 1.2 or later). engine.termix is checked against the core
|
|
18
|
+
* version by the server.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PLUGIN_API_VERSION = "1.0.0";
|
|
21
|
+
/** The API major, the default engine.api for a new plugin. */
|
|
22
|
+
export declare const SUPPORTED_PLUGIN_API_VERSION: string;
|
|
23
|
+
/** Whether this build's plugin API satisfies a manifest's engine.api. */
|
|
24
|
+
export declare function isApiCompatible(range: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether a core version satisfies a manifest's engine.termix. A prerelease
|
|
27
|
+
* core (2.9.0-beta.1) counts as that release.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isTermixCompatible(range: string, coreVersion: string | null): boolean;
|
|
30
|
+
export declare const PLUGIN_CATEGORIES: readonly ["Terminal", "Files & Transfer", "Infrastructure", "Monitoring", "Networking", "Access & Security", "Productivity"];
|
|
31
|
+
export declare const PLUGIN_PLATFORMS: readonly ["linux", "win32", "darwin"];
|
|
32
|
+
export declare const ACTION_CONTRIBUTION_KINDS: readonly ["button", "component"];
|
|
33
|
+
export type ActionContributionKind = (typeof ACTION_CONTRIBUTION_KINDS)[number];
|
|
34
|
+
/**
|
|
35
|
+
* Ids no plugin may take. A permission is registered as <id>.<name>, so a
|
|
36
|
+
* plugin called "admin" would mint admin.* permissions and could default them
|
|
37
|
+
* onto the user role; the rest are names core or the runtime already uses.
|
|
38
|
+
*/
|
|
39
|
+
export declare const RESERVED_PLUGIN_IDS: readonly string[];
|
|
40
|
+
/** The roles core seeds. A plugin may only set defaults for these. */
|
|
41
|
+
export declare const SYSTEM_ROLE_NAMES: readonly ["admin", "user"];
|
|
42
|
+
export type SystemRoleName = (typeof SYSTEM_ROLE_NAMES)[number];
|
|
43
|
+
/**
|
|
44
|
+
* Core permission groups. A plugin permission may not start with one of these,
|
|
45
|
+
* or a manifest could declare admin.users.manage and gate a route on it.
|
|
46
|
+
*/
|
|
47
|
+
export declare const RESERVED_PERMISSION_PREFIXES: readonly ["hosts", "credentials", "admin"];
|
|
48
|
+
/** The id a plugin-relative permission name is registered under. */
|
|
49
|
+
export declare function qualifyPermission(pluginId: string, name: string): string;
|
|
50
|
+
export interface PluginAuthor {
|
|
51
|
+
name: string;
|
|
52
|
+
url?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface PluginEngine {
|
|
55
|
+
/** Semver range of Termix releases the plugin runs on, e.g. ">=2.9.0". */
|
|
56
|
+
termix: string;
|
|
57
|
+
/**
|
|
58
|
+
* Semver range of the plugin API it needs, e.g. "1" or "^1.2". Use the
|
|
59
|
+
* lowest minor whose API you call, so older cores refuse it cleanly.
|
|
60
|
+
*/
|
|
61
|
+
api: string;
|
|
62
|
+
}
|
|
63
|
+
export interface HostCapabilityContribution {
|
|
64
|
+
key: string;
|
|
65
|
+
labelKey: string;
|
|
66
|
+
editorTab: string;
|
|
67
|
+
}
|
|
68
|
+
export interface PluginTabContribution {
|
|
69
|
+
id: string;
|
|
70
|
+
titleKey: string;
|
|
71
|
+
icon: string;
|
|
72
|
+
openFrom: string[];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A sidebar panel or dashboard card the plugin's frontend registers. Declared
|
|
76
|
+
* here so core knows who owns a saved view even while the plugin is off and
|
|
77
|
+
* its code never loaded.
|
|
78
|
+
*/
|
|
79
|
+
export interface PluginViewContribution {
|
|
80
|
+
id: string;
|
|
81
|
+
titleKey: string;
|
|
82
|
+
icon?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* One role permission a plugin contributes.
|
|
86
|
+
*
|
|
87
|
+
* `name` is short and plugin-relative; core registers it as
|
|
88
|
+
* `<pluginId>.<name>`, so a plugin can never name a core group or another
|
|
89
|
+
* plugin's namespace. The i18n keys are plugin-relative too.
|
|
90
|
+
*/
|
|
91
|
+
export interface PluginPermissionContribution {
|
|
92
|
+
name: string;
|
|
93
|
+
titleKey: string;
|
|
94
|
+
descriptionKey: string;
|
|
95
|
+
/** System roles that should hold this the first time it is seen. */
|
|
96
|
+
defaultRoles?: SystemRoleName[];
|
|
97
|
+
}
|
|
98
|
+
export interface PluginActionContribution {
|
|
99
|
+
id: string;
|
|
100
|
+
titleKey: string;
|
|
101
|
+
/** Name of the frontend export implementing this action. */
|
|
102
|
+
handler: string;
|
|
103
|
+
icon?: string;
|
|
104
|
+
permission?: string;
|
|
105
|
+
slot?: string;
|
|
106
|
+
kind?: ActionContributionKind;
|
|
107
|
+
}
|
|
108
|
+
export interface PluginActionSlot {
|
|
109
|
+
id: string;
|
|
110
|
+
accepts: ActionContributionKind[];
|
|
111
|
+
descriptionKey?: string;
|
|
112
|
+
}
|
|
113
|
+
export interface PluginServiceProvide {
|
|
114
|
+
service: string;
|
|
115
|
+
version: string;
|
|
116
|
+
/** The role permission a calling user needs. */
|
|
117
|
+
permission: string;
|
|
118
|
+
/**
|
|
119
|
+
* Named providers this plugin registers, for a service several plugins
|
|
120
|
+
* provide side by side (sessions.live, keyed by session type). Omitted, the
|
|
121
|
+
* plugin provides it once, unnamed.
|
|
122
|
+
*/
|
|
123
|
+
names?: string[];
|
|
124
|
+
}
|
|
125
|
+
export interface PluginServiceRequire {
|
|
126
|
+
service: string;
|
|
127
|
+
versionRange: string;
|
|
128
|
+
optional?: boolean;
|
|
129
|
+
}
|
|
130
|
+
export interface PluginSecretProvide {
|
|
131
|
+
key: string;
|
|
132
|
+
permission: string;
|
|
133
|
+
descriptionKey?: string;
|
|
134
|
+
}
|
|
135
|
+
export interface PluginSecretRequire {
|
|
136
|
+
plugin: string;
|
|
137
|
+
key: string;
|
|
138
|
+
optional?: boolean;
|
|
139
|
+
}
|
|
140
|
+
export declare const SETTINGS_FIELD_TYPES: readonly ["boolean", "string", "number", "select", "multiselect", "secret", "textarea", "json", "custom"];
|
|
141
|
+
export type PluginSettingsFieldType = (typeof SETTINGS_FIELD_TYPES)[number];
|
|
142
|
+
export declare const SETTINGS_SCOPES: readonly ["admin", "user", "host"];
|
|
143
|
+
export type PluginSettingsScope = (typeof SETTINGS_SCOPES)[number];
|
|
144
|
+
export interface PluginSettingsOption {
|
|
145
|
+
value: string;
|
|
146
|
+
labelKey: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* One field on a plugin's settings page.
|
|
150
|
+
*
|
|
151
|
+
* Core renders these; a plugin supplies data only, so it cannot ship its own
|
|
152
|
+
* form styling and drift from the rest of the app. `type: "custom"` is the
|
|
153
|
+
* escape hatch for UI a schema cannot express, and names a component the
|
|
154
|
+
* frontend registered rather than carrying markup.
|
|
155
|
+
*/
|
|
156
|
+
export interface PluginSettingsField {
|
|
157
|
+
key: string;
|
|
158
|
+
type: PluginSettingsFieldType;
|
|
159
|
+
/** Required except for "custom", which draws its own label. */
|
|
160
|
+
labelKey?: string;
|
|
161
|
+
descriptionKey?: string;
|
|
162
|
+
placeholderKey?: string;
|
|
163
|
+
default?: unknown;
|
|
164
|
+
/** select and multiselect only. */
|
|
165
|
+
options?: PluginSettingsOption[];
|
|
166
|
+
/** number only. */
|
|
167
|
+
min?: number;
|
|
168
|
+
max?: number;
|
|
169
|
+
/** Key of a boolean field in the same scope that must be on. */
|
|
170
|
+
requires?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Who may write it. Admin fields default to admin.plugins.manage; a short
|
|
173
|
+
* name resolves against this plugin's own permissions.
|
|
174
|
+
*/
|
|
175
|
+
permission?: string;
|
|
176
|
+
/** Section heading this field sits under. */
|
|
177
|
+
group?: string;
|
|
178
|
+
/** Registered component id. Required when type is "custom". */
|
|
179
|
+
component?: string;
|
|
180
|
+
/**
|
|
181
|
+
* Host scope only: whether the field can have a host default (server,
|
|
182
|
+
* user or folder) that hosts follow until they set their own. On by
|
|
183
|
+
* default for every field except secrets and json fields with
|
|
184
|
+
* `secretKeys`. Turn it off for a value that only makes sense per host,
|
|
185
|
+
* such as a MAC address or an API endpoint.
|
|
186
|
+
*/
|
|
187
|
+
defaultable?: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Host scope only: the levels that may set a default for it. Defaults to
|
|
190
|
+
* all three. Leave "admin" out for a value that points at one user's own
|
|
191
|
+
* rows (a snippet id, a profile id).
|
|
192
|
+
*/
|
|
193
|
+
defaultLevels?: Array<"admin" | "user" | "folder">;
|
|
194
|
+
/**
|
|
195
|
+
* Host scope only: a look-and-feel value. When the host follows its
|
|
196
|
+
* defaults, a user it is shared with gets their own defaults for it
|
|
197
|
+
* rather than the owner's.
|
|
198
|
+
*/
|
|
199
|
+
personal?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Host scope only: the lowest share level whose recipients see this value
|
|
202
|
+
* in the host payload. Defaults to "connect", everyone who sees the host.
|
|
203
|
+
*/
|
|
204
|
+
shareRead?: "connect" | "view" | "edit" | "manage";
|
|
205
|
+
/** Host scope only: only the host's owner may change it. */
|
|
206
|
+
ownerOnly?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* JSON fields only: keys inside the stored object that hold secrets, such
|
|
209
|
+
* as a gateway password. Core clears them from exports like any secret.
|
|
210
|
+
*/
|
|
211
|
+
secretKeys?: string[];
|
|
212
|
+
/**
|
|
213
|
+
* Stored and validated like any field, but not drawn by the generic
|
|
214
|
+
* settings form, because the plugin edits it in its own UI (a host editor
|
|
215
|
+
* section).
|
|
216
|
+
*/
|
|
217
|
+
hidden?: boolean;
|
|
218
|
+
}
|
|
219
|
+
export interface PluginHostSettingsContribution {
|
|
220
|
+
/** Boolean field rendered first, gating the rest of the section. */
|
|
221
|
+
enableKey?: string;
|
|
222
|
+
enableLabelKey?: string;
|
|
223
|
+
enableDescriptionKey?: string;
|
|
224
|
+
/** What the enable switch reads before a host saves it. Off by default. */
|
|
225
|
+
enableDefault?: boolean;
|
|
226
|
+
/** Host editor strip the generated tab sits in. Defaults to "top". */
|
|
227
|
+
editorGroup?: "top" | "ssh";
|
|
228
|
+
/** Position among that strip's tabs, core ones included. */
|
|
229
|
+
editorOrder?: number;
|
|
230
|
+
fields: PluginSettingsField[];
|
|
231
|
+
}
|
|
232
|
+
export interface PluginSettingsContribution {
|
|
233
|
+
admin?: PluginSettingsField[];
|
|
234
|
+
user?: PluginSettingsField[];
|
|
235
|
+
host?: PluginHostSettingsContribution;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* What a plugin adds to sign-in and SSH auth. Declared so core can tell who
|
|
239
|
+
* owns an auth type or factor even while the plugin is disabled, and so the
|
|
240
|
+
* login screen knows which bundles it needs before anyone has signed in.
|
|
241
|
+
*/
|
|
242
|
+
export interface PluginAuthContribution {
|
|
243
|
+
/** Values of ssh_data.auth_type this plugin provides. */
|
|
244
|
+
sshAuthTypes?: string[];
|
|
245
|
+
/** Login method ids. */
|
|
246
|
+
loginMethods?: string[];
|
|
247
|
+
/** Second factor ids. */
|
|
248
|
+
secondFactors?: string[];
|
|
249
|
+
/** Schemes this plugin resolves for "<scheme>://..." secret references, e.g. "op". */
|
|
250
|
+
secretSchemes?: string[];
|
|
251
|
+
/** Keyboard-interactive handler ids, e.g. "warpgate". */
|
|
252
|
+
keyboardInteractive?: string[];
|
|
253
|
+
}
|
|
254
|
+
export interface PluginContributions {
|
|
255
|
+
tabs?: PluginTabContribution[];
|
|
256
|
+
panels?: PluginViewContribution[];
|
|
257
|
+
dashboardCards?: PluginViewContribution[];
|
|
258
|
+
/**
|
|
259
|
+
* The frontend also runs on anonymous guest pages (shared-session and
|
|
260
|
+
* collab links), where it is activated with app.guest set.
|
|
261
|
+
*/
|
|
262
|
+
guest?: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* `?view=` names an anonymous guest page may open. Each must be served by a
|
|
265
|
+
* tab's `standalone` component. Needs `guest: true`.
|
|
266
|
+
*/
|
|
267
|
+
guestViews?: string[];
|
|
268
|
+
actions?: PluginActionContribution[];
|
|
269
|
+
actionSlots?: PluginActionSlot[];
|
|
270
|
+
permissions?: PluginPermissionContribution[];
|
|
271
|
+
settings?: PluginSettingsContribution;
|
|
272
|
+
/**
|
|
273
|
+
* A host-editor checkbox backed by a boolean column on the host record.
|
|
274
|
+
* A5/A6/A7 reshape this; it stays in v2 because remote-desktop, docker,
|
|
275
|
+
* proxmox and web-endpoint ship it today.
|
|
276
|
+
*/
|
|
277
|
+
hostCapability?: HostCapabilityContribution | HostCapabilityContribution[];
|
|
278
|
+
auth?: PluginAuthContribution;
|
|
279
|
+
http?: PluginHttpContribution;
|
|
280
|
+
/**
|
|
281
|
+
* This plugin's Appearance defaults for each interface preset, read in the
|
|
282
|
+
* frontend with usePluginUiPreferences. Every preset names the same keys;
|
|
283
|
+
* values are booleans, numbers, strings or string arrays.
|
|
284
|
+
*/
|
|
285
|
+
uiPresets?: Record<"simple" | "balanced" | "advanced", Record<string, unknown>>;
|
|
286
|
+
/**
|
|
287
|
+
* Wire names of the sync entities this plugin registers with
|
|
288
|
+
* ctx.sync.registerEntity, so a server can name them while the plugin is
|
|
289
|
+
* off and a desktop can list them in its sync settings.
|
|
290
|
+
*/
|
|
291
|
+
syncEntities?: string[];
|
|
292
|
+
/**
|
|
293
|
+
* Other plugins' action, slot and extension point ids this plugin calls,
|
|
294
|
+
* fills or extends. Declaration only: nothing breaks when the owner is
|
|
295
|
+
* missing, but the coupling is written down where tools and people can
|
|
296
|
+
* see it.
|
|
297
|
+
*/
|
|
298
|
+
uses?: string[];
|
|
299
|
+
/**
|
|
300
|
+
* Keybinding actions this plugin adds to Appearance > Keybindings, with
|
|
301
|
+
* the parameters a saved binding carries. Core validates saved bindings
|
|
302
|
+
* against these without running plugin code, and translates a parameter
|
|
303
|
+
* naming a sync entity over sync.
|
|
304
|
+
*/
|
|
305
|
+
keybindingActions?: PluginKeybindingActionContribution[];
|
|
306
|
+
/**
|
|
307
|
+
* Connection protocols whose per-host login core stores, encrypts,
|
|
308
|
+
* shares, exports and syncs for this plugin, read back with
|
|
309
|
+
* ctx.credentials.resolveHostProtocol.
|
|
310
|
+
*/
|
|
311
|
+
protocols?: PluginProtocolContribution[];
|
|
312
|
+
}
|
|
313
|
+
/** A field a protocol login carries besides username and password. */
|
|
314
|
+
export interface PluginProtocolCredentialField {
|
|
315
|
+
key: string;
|
|
316
|
+
/** Encrypted with the owner's data key and never sent to a browser. */
|
|
317
|
+
secret?: boolean;
|
|
318
|
+
}
|
|
319
|
+
export interface PluginProtocolContribution {
|
|
320
|
+
/** Stored with each login. Never change it once hosts use it. */
|
|
321
|
+
id: string;
|
|
322
|
+
credentialFields?: PluginProtocolCredentialField[];
|
|
323
|
+
/**
|
|
324
|
+
* The port an import row without one gets, for a host whose main
|
|
325
|
+
* protocol this is.
|
|
326
|
+
*/
|
|
327
|
+
defaultPort?: number;
|
|
328
|
+
/**
|
|
329
|
+
* What the owner's login falls back to from the host's own SSH login
|
|
330
|
+
* when the protocol login leaves it empty.
|
|
331
|
+
*/
|
|
332
|
+
hostLoginFallback?: Array<"username" | "password">;
|
|
333
|
+
}
|
|
334
|
+
/** Protocol ids core keeps for itself. */
|
|
335
|
+
export declare const RESERVED_PROTOCOL_IDS: readonly string[];
|
|
336
|
+
/** Login keys a declared credential field may not reuse. */
|
|
337
|
+
export declare const RESERVED_PROTOCOL_FIELD_KEYS: readonly string[];
|
|
338
|
+
/** One parameter a saved keybinding action carries next to its type. */
|
|
339
|
+
export interface PluginKeybindingParam {
|
|
340
|
+
type: "string" | "boolean";
|
|
341
|
+
required?: boolean;
|
|
342
|
+
/** A regular expression a string value must match. */
|
|
343
|
+
pattern?: string;
|
|
344
|
+
maxLength?: number;
|
|
345
|
+
/**
|
|
346
|
+
* The value is a local row id of this sync entity, stored as a string.
|
|
347
|
+
* Sync sends the row's syncId instead.
|
|
348
|
+
*/
|
|
349
|
+
syncEntity?: string;
|
|
350
|
+
}
|
|
351
|
+
export interface PluginKeybindingActionContribution {
|
|
352
|
+
/**
|
|
353
|
+
* Stored as the binding's action.type. New actions use
|
|
354
|
+
* "<plugin id>.<name>"; the bundled ones keep their 2.8 names.
|
|
355
|
+
*/
|
|
356
|
+
id: string;
|
|
357
|
+
params?: Record<string, PluginKeybindingParam>;
|
|
358
|
+
}
|
|
359
|
+
/** Keybinding action types the shell runs itself; no plugin may declare them. */
|
|
360
|
+
export declare const CORE_KEYBINDING_ACTIONS: readonly string[];
|
|
361
|
+
/**
|
|
362
|
+
* How a desktop linked to a server treats this plugin.
|
|
363
|
+
* - "mirror": follows the server, installed and switched on or off with it.
|
|
364
|
+
* - "local": each desktop decides for itself (a serial port is local).
|
|
365
|
+
* - "server": only makes sense on a server, never runs on a linked desktop.
|
|
366
|
+
*/
|
|
367
|
+
export type PluginDesktopMode = "mirror" | "local" | "server";
|
|
368
|
+
export declare const PLUGIN_DESKTOP_MODES: readonly PluginDesktopMode[];
|
|
369
|
+
export interface PluginHttpContribution {
|
|
370
|
+
/**
|
|
371
|
+
* Old URLs something outside Termix still calls (a webhook a third party
|
|
372
|
+
* posts to). Each must start with "/<plugin id>/"; a request under it is
|
|
373
|
+
* served by this plugin's router with that prefix removed, so
|
|
374
|
+
* "/automations/webhook/x" reaches the route "/webhook/x". Core routes win
|
|
375
|
+
* a clash.
|
|
376
|
+
*/
|
|
377
|
+
legacyPaths?: string[];
|
|
378
|
+
/**
|
|
379
|
+
* Old URLs outside the plugin's namespace that something outside Termix
|
|
380
|
+
* still sends people to (an identity provider's callback, a published
|
|
381
|
+
* resolver URL). A request at `from`, or under it, is redirected to `to`
|
|
382
|
+
* under /plugin-api/<id>/ with the rest of the path and the query kept.
|
|
383
|
+
* Core routes win a clash.
|
|
384
|
+
*/
|
|
385
|
+
legacyRedirects?: PluginLegacyRedirect[];
|
|
386
|
+
/**
|
|
387
|
+
* An admin may call this plugin's routes on behalf of another user with
|
|
388
|
+
* the X-Admin-Target-User header (the admin "manage user" panel). Without
|
|
389
|
+
* it core refuses the header on every route under /plugin-api/<id>/.
|
|
390
|
+
*/
|
|
391
|
+
adminImpersonation?: boolean;
|
|
392
|
+
}
|
|
393
|
+
export interface PluginLegacyRedirect {
|
|
394
|
+
/** An absolute path, e.g. "/users/oidc/callback". */
|
|
395
|
+
from: string;
|
|
396
|
+
/** A path in this plugin's router, e.g. "/callback". */
|
|
397
|
+
to: string;
|
|
398
|
+
/** 307 (the default) or 308 for a permanent move. */
|
|
399
|
+
status?: 307 | 308;
|
|
400
|
+
}
|
|
401
|
+
export interface PluginManifest {
|
|
402
|
+
id: string;
|
|
403
|
+
name: string;
|
|
404
|
+
version: string;
|
|
405
|
+
description: string;
|
|
406
|
+
author: PluginAuthor;
|
|
407
|
+
license: string;
|
|
408
|
+
repository?: string;
|
|
409
|
+
category: string;
|
|
410
|
+
icon?: string;
|
|
411
|
+
engine: PluginEngine;
|
|
412
|
+
/** Catalog capability ids. */
|
|
413
|
+
capabilities: string[];
|
|
414
|
+
/** pluginId -> semver range. A missing one blocks activation. */
|
|
415
|
+
dependencies?: Record<string, string>;
|
|
416
|
+
/** pluginId -> semver range. A missing one is normal. */
|
|
417
|
+
optionalDependencies?: Record<string, string>;
|
|
418
|
+
provides?: PluginServiceProvide[];
|
|
419
|
+
requires?: PluginServiceRequire[];
|
|
420
|
+
providesSecret?: PluginSecretProvide[];
|
|
421
|
+
requiresSecret?: PluginSecretRequire[];
|
|
422
|
+
contributes?: PluginContributions;
|
|
423
|
+
/** Built backend entry, relative to the plugin root. */
|
|
424
|
+
backend?: string;
|
|
425
|
+
/** Built frontend entry, relative to the plugin root. */
|
|
426
|
+
frontend?: string;
|
|
427
|
+
/** Locales directory, relative to the plugin root. */
|
|
428
|
+
locales?: string;
|
|
429
|
+
platforms?: string[];
|
|
430
|
+
/**
|
|
431
|
+
* Bare npm package names carrying a native (.node) binding. The CLI build
|
|
432
|
+
* never bundles them: they stay a real dependency in the plugin's own
|
|
433
|
+
* package.json and are resolved from node_modules at runtime instead,
|
|
434
|
+
* because esbuild bundling a native addon breaks the relative path it uses
|
|
435
|
+
* to locate its compiled binary.
|
|
436
|
+
*/
|
|
437
|
+
nativeDependencies?: string[];
|
|
438
|
+
/** How a linked desktop treats this plugin. Defaults to "mirror". */
|
|
439
|
+
desktop?: PluginDesktopMode;
|
|
440
|
+
}
|
|
441
|
+
export declare const DEFAULT_BACKEND_ENTRY = "dist/backend.js";
|
|
442
|
+
export declare const DEFAULT_FRONTEND_ENTRY = "dist/frontend.js";
|
|
443
|
+
export declare const DEFAULT_LOCALES_DIR = "locales";
|
|
444
|
+
export declare function validateManifest(manifest: unknown): string[];
|
|
445
|
+
export declare const PROTOCOL_ID_PATTERN: RegExp;
|
|
446
|
+
export declare const PROTOCOL_FIELD_KEY_PATTERN: RegExp;
|
|
447
|
+
/**
|
|
448
|
+
* Checks one saved keybinding action against the parameters its declaration
|
|
449
|
+
* lists. A parameter the declaration does not list is refused, so a binding
|
|
450
|
+
* cannot carry arbitrary data under a declared type.
|
|
451
|
+
*/
|
|
452
|
+
export declare function validateKeybindingActionParams(action: Record<string, unknown>, declaration: PluginKeybindingActionContribution): boolean;
|
|
453
|
+
export interface ParsedManifest {
|
|
454
|
+
manifest?: PluginManifest;
|
|
455
|
+
errors: string[];
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Validates, then applies the cross-field rules a JSON schema cannot express
|
|
459
|
+
* and fills in the entry-point defaults.
|
|
460
|
+
*/
|
|
461
|
+
export declare function parseManifest(raw: unknown): ParsedManifest;
|