@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.
Files changed (236) hide show
  1. package/README.md +52 -0
  2. package/cli/commands/build.mjs +246 -0
  3. package/cli/commands/migrations.mjs +248 -0
  4. package/cli/commands/pack.mjs +42 -0
  5. package/cli/commands/sign.mjs +83 -0
  6. package/cli/commands/test.mjs +33 -0
  7. package/cli/commands/validate.mjs +215 -0
  8. package/cli/index.mjs +65 -0
  9. package/cli/lib/changelog.mjs +126 -0
  10. package/cli/lib/externals.mjs +46 -0
  11. package/cli/lib/plugin-dir.mjs +29 -0
  12. package/cli/lib/signing.mjs +86 -0
  13. package/cli/lib/static-url-imports.mjs +54 -0
  14. package/cli/lib/tmxplug.mjs +106 -0
  15. package/cli/patches/guacamole-common-js-flush.cjs +76 -0
  16. package/cli/patches/xterm-android-ime.cjs +130 -0
  17. package/client.d.ts +13 -0
  18. package/dist/backend.d.ts +1777 -0
  19. package/dist/backend.js +84 -0
  20. package/dist/capabilities.d.ts +38 -0
  21. package/dist/capabilities.js +71 -0
  22. package/dist/db.d.ts +112 -0
  23. package/dist/db.js +189 -0
  24. package/dist/ddl.d.ts +76 -0
  25. package/dist/ddl.js +678 -0
  26. package/dist/desktop.d.ts +346 -0
  27. package/dist/desktop.js +5 -0
  28. package/dist/frontend.d.ts +1206 -0
  29. package/dist/frontend.js +388 -0
  30. package/dist/host/chunk-F3SDZDDG.js +6017 -0
  31. package/dist/host/chunk-XGWE7BTJ.js +90 -0
  32. package/dist/host/chunk-XH5NXL6Y.js +56314 -0
  33. package/dist/host/chunk-YC2MAKSP.js +14 -0
  34. package/dist/host/linked-server-FZGWQW32.js +12 -0
  35. package/dist/host/rbac-api-6KDMBVDZ.js +52 -0
  36. package/dist/host/testing-host.js +414 -0
  37. package/dist/host/theme.css +91 -0
  38. package/dist/host/types/src/types/auth-protocols.d.ts +10 -0
  39. package/dist/host/types/src/types/connection-log.d.ts +13 -0
  40. package/dist/host/types/src/types/credential-sidebar-preferences.d.ts +38 -0
  41. package/dist/host/types/src/types/host-defaults.d.ts +60 -0
  42. package/dist/host/types/src/types/host-sidebar-preferences.d.ts +55 -0
  43. package/dist/host/types/src/types/index.d.ts +298 -0
  44. package/dist/host/types/src/types/keybindings.d.ts +27 -0
  45. package/dist/host/types/src/types/ui-preferences.d.ts +102 -0
  46. package/dist/host/types/src/types/ui-types.d.ts +260 -0
  47. package/dist/host/types/src/ui/api/admin-user-data-api.d.ts +11 -0
  48. package/dist/host/types/src/ui/api/auth-methods-api.d.ts +63 -0
  49. package/dist/host/types/src/ui/api/credential-sidebar-preferences-api.d.ts +3 -0
  50. package/dist/host/types/src/ui/api/credentials-api.d.ts +56 -0
  51. package/dist/host/types/src/ui/api/dashboard-api.d.ts +23 -0
  52. package/dist/host/types/src/ui/api/external-account-api.d.ts +8 -0
  53. package/dist/host/types/src/ui/api/host-sidebar-preferences-api.d.ts +3 -0
  54. package/dist/host/types/src/ui/api/host-status-api.d.ts +11 -0
  55. package/dist/host/types/src/ui/api/open-tabs-api.d.ts +74 -0
  56. package/dist/host/types/src/ui/api/plugins-api.d.ts +128 -0
  57. package/dist/host/types/src/ui/api/rbac-api.d.ts +167 -0
  58. package/dist/host/types/src/ui/api/settings-api.d.ts +22 -0
  59. package/dist/host/types/src/ui/api/ssh-host-management-api.d.ts +65 -0
  60. package/dist/host/types/src/ui/api/sync-api.d.ts +93 -0
  61. package/dist/host/types/src/ui/api/system-status-api.d.ts +49 -0
  62. package/dist/host/types/src/ui/api/ui-preferences-api.d.ts +8 -0
  63. package/dist/host/types/src/ui/api/user-management-api.d.ts +80 -0
  64. package/dist/host/types/src/ui/auth/Auth.d.ts +12 -0
  65. package/dist/host/types/src/ui/auth/auth-bits.d.ts +11 -0
  66. package/dist/host/types/src/ui/auth/silent-signin.d.ts +2 -0
  67. package/dist/host/types/src/ui/components/FullScreenAppWrapper.d.ts +9 -0
  68. package/dist/host/types/src/ui/components/alert-dialog.d.ts +14 -0
  69. package/dist/host/types/src/ui/components/alert.d.ts +9 -0
  70. package/dist/host/types/src/ui/components/badge.d.ts +9 -0
  71. package/dist/host/types/src/ui/components/button.d.ts +13 -0
  72. package/dist/host/types/src/ui/components/card-grid/CardGridCanvas.d.ts +22 -0
  73. package/dist/host/types/src/ui/components/card-grid/layout-utils.d.ts +26 -0
  74. package/dist/host/types/src/ui/components/card-grid/types.d.ts +29 -0
  75. package/dist/host/types/src/ui/components/card-masonry.d.ts +16 -0
  76. package/dist/host/types/src/ui/components/card.d.ts +11 -0
  77. package/dist/host/types/src/ui/components/charts/BarSeries.d.ts +16 -0
  78. package/dist/host/types/src/ui/components/charts/LineChart.d.ts +17 -0
  79. package/dist/host/types/src/ui/components/charts/RadialGauge.d.ts +18 -0
  80. package/dist/host/types/src/ui/components/charts/Sparkline.d.ts +22 -0
  81. package/dist/host/types/src/ui/components/charts/StatRow.d.ts +15 -0
  82. package/dist/host/types/src/ui/components/charts/geometry.d.ts +20 -0
  83. package/dist/host/types/src/ui/components/charts/index.d.ts +4 -0
  84. package/dist/host/types/src/ui/components/checkbox.d.ts +4 -0
  85. package/dist/host/types/src/ui/components/connection/ConnectionGate.d.ts +56 -0
  86. package/dist/host/types/src/ui/components/connection/ConnectionLogPanel.d.ts +9 -0
  87. package/dist/host/types/src/ui/components/connection/ConnectionScreen.d.ts +34 -0
  88. package/dist/host/types/src/ui/components/connection/connection-status.d.ts +1 -0
  89. package/dist/host/types/src/ui/components/data-view.d.ts +32 -0
  90. package/dist/host/types/src/ui/components/dialog.d.ts +17 -0
  91. package/dist/host/types/src/ui/components/dropdown-menu.d.ts +29 -0
  92. package/dist/host/types/src/ui/components/empty-state.d.ts +19 -0
  93. package/dist/host/types/src/ui/components/form-fields.d.ts +115 -0
  94. package/dist/host/types/src/ui/components/input.d.ts +3 -0
  95. package/dist/host/types/src/ui/components/kbd.d.ts +12 -0
  96. package/dist/host/types/src/ui/components/label.d.ts +4 -0
  97. package/dist/host/types/src/ui/components/manager-card.d.ts +25 -0
  98. package/dist/host/types/src/ui/components/meter.d.ts +14 -0
  99. package/dist/host/types/src/ui/components/metric-card.d.ts +18 -0
  100. package/dist/host/types/src/ui/components/panel-layout.d.ts +83 -0
  101. package/dist/host/types/src/ui/components/password-input.d.ts +4 -0
  102. package/dist/host/types/src/ui/components/popover.d.ts +7 -0
  103. package/dist/host/types/src/ui/components/scroll-area.d.ts +5 -0
  104. package/dist/host/types/src/ui/components/section-card.d.ts +29 -0
  105. package/dist/host/types/src/ui/components/select.d.ts +15 -0
  106. package/dist/host/types/src/ui/components/select2.d.ts +8 -0
  107. package/dist/host/types/src/ui/components/separator.d.ts +4 -0
  108. package/dist/host/types/src/ui/components/sheet.d.ts +14 -0
  109. package/dist/host/types/src/ui/components/sidebar.d.ts +69 -0
  110. package/dist/host/types/src/ui/components/skeleton.d.ts +2 -0
  111. package/dist/host/types/src/ui/components/slider.d.ts +4 -0
  112. package/dist/host/types/src/ui/components/sonner.d.ts +4 -0
  113. package/dist/host/types/src/ui/components/surface/prompt-styles.d.ts +4 -0
  114. package/dist/host/types/src/ui/components/surface/surface-scope.d.ts +79 -0
  115. package/dist/host/types/src/ui/components/switch.d.ts +4 -0
  116. package/dist/host/types/src/ui/components/tab-strip.d.ts +19 -0
  117. package/dist/host/types/src/ui/components/tabs.d.ts +7 -0
  118. package/dist/host/types/src/ui/components/textarea.d.ts +4 -0
  119. package/dist/host/types/src/ui/components/theme-provider.d.ts +14 -0
  120. package/dist/host/types/src/ui/components/tooltip.d.ts +7 -0
  121. package/dist/host/types/src/ui/contexts/BrandingContext.d.ts +15 -0
  122. package/dist/host/types/src/ui/contexts/UiPreferencesContext.d.ts +38 -0
  123. package/dist/host/types/src/ui/contexts/branding-document.d.ts +10 -0
  124. package/dist/host/types/src/ui/dashboard/dashboard-cards-registry.d.ts +30 -0
  125. package/dist/host/types/src/ui/hooks/use-action-slot.d.ts +10 -0
  126. package/dist/host/types/src/ui/hooks/use-adaptive-polling.d.ts +5 -0
  127. package/dist/host/types/src/ui/hooks/use-mobile.d.ts +1 -0
  128. package/dist/host/types/src/ui/hooks/use-permissions.d.ts +29 -0
  129. package/dist/host/types/src/ui/hooks/use-status-color-scheme.d.ts +12 -0
  130. package/dist/host/types/src/ui/hooks/use-sync-status.d.ts +4 -0
  131. package/dist/host/types/src/ui/hooks/useSshAuthProviders.d.ts +17 -0
  132. package/dist/host/types/src/ui/i18n/i18n.d.ts +52 -0
  133. package/dist/host/types/src/ui/lib/ServerStatusContext.d.ts +33 -0
  134. package/dist/host/types/src/ui/lib/adaptive-polling.d.ts +29 -0
  135. package/dist/host/types/src/ui/lib/adaptive-resource-budget.d.ts +39 -0
  136. package/dist/host/types/src/ui/lib/app-keyboard-shortcuts.d.ts +8 -0
  137. package/dist/host/types/src/ui/lib/base-path.d.ts +1 -0
  138. package/dist/host/types/src/ui/lib/clipboard-provider.d.ts +9 -0
  139. package/dist/host/types/src/ui/lib/clipboard.d.ts +20 -0
  140. package/dist/host/types/src/ui/lib/connection-origin.d.ts +47 -0
  141. package/dist/host/types/src/ui/lib/db-health-monitor.d.ts +34 -0
  142. package/dist/host/types/src/ui/lib/device-id.d.ts +1 -0
  143. package/dist/host/types/src/ui/lib/electron.d.ts +1 -0
  144. package/dist/host/types/src/ui/lib/embedded-server-status.d.ts +15 -0
  145. package/dist/host/types/src/ui/lib/error-message.d.ts +9 -0
  146. package/dist/host/types/src/ui/lib/frontend-logger.d.ts +67 -0
  147. package/dist/host/types/src/ui/lib/global-shortcut-handler.d.ts +3 -0
  148. package/dist/host/types/src/ui/lib/host-defaults-context.d.ts +48 -0
  149. package/dist/host/types/src/ui/lib/hosts-request-cache.d.ts +9 -0
  150. package/dist/host/types/src/ui/lib/keybinding-match.d.ts +3 -0
  151. package/dist/host/types/src/ui/lib/linked-server.d.ts +10 -0
  152. package/dist/host/types/src/ui/lib/local-adaptive-engine.d.ts +40 -0
  153. package/dist/host/types/src/ui/lib/permissions.d.ts +16 -0
  154. package/dist/host/types/src/ui/lib/plugin-i18n.d.ts +11 -0
  155. package/dist/host/types/src/ui/lib/plugin-icon.d.ts +11 -0
  156. package/dist/host/types/src/ui/lib/plugin-transport.d.ts +50 -0
  157. package/dist/host/types/src/ui/lib/registry.d.ts +29 -0
  158. package/dist/host/types/src/ui/lib/rem.d.ts +7 -0
  159. package/dist/host/types/src/ui/lib/remote-server-api.d.ts +11 -0
  160. package/dist/host/types/src/ui/lib/server-status-store.d.ts +37 -0
  161. package/dist/host/types/src/ui/lib/sync-events.d.ts +2 -0
  162. package/dist/host/types/src/ui/lib/sync-status.d.ts +6 -0
  163. package/dist/host/types/src/ui/lib/tab-jump-hotkey.d.ts +4 -0
  164. package/dist/host/types/src/ui/lib/theme.d.ts +21 -0
  165. package/dist/host/types/src/ui/lib/ttl-request-cache.d.ts +10 -0
  166. package/dist/host/types/src/ui/lib/usage-color.d.ts +5 -0
  167. package/dist/host/types/src/ui/lib/utils.d.ts +2 -0
  168. package/dist/host/types/src/ui/lib/visible-interval.d.ts +5 -0
  169. package/dist/host/types/src/ui/lib/widget-title.d.ts +8 -0
  170. package/dist/host/types/src/ui/lib/ws-auth.d.ts +1 -0
  171. package/dist/host/types/src/ui/main-axios.d.ts +170 -0
  172. package/dist/host/types/src/ui/plugin-host/PluginViewPlaceholder.d.ts +13 -0
  173. package/dist/host/types/src/ui/plugin-host/app.d.ts +18 -0
  174. package/dist/host/types/src/ui/plugin-host/auth-registry.d.ts +50 -0
  175. package/dist/host/types/src/ui/plugin-host/bridge.d.ts +26 -0
  176. package/dist/host/types/src/ui/plugin-host/component-registry.d.ts +24 -0
  177. package/dist/host/types/src/ui/plugin-host/desktop.d.ts +7 -0
  178. package/dist/host/types/src/ui/plugin-host/extension-registry.d.ts +16 -0
  179. package/dist/host/types/src/ui/plugin-host/host-scope.d.ts +26 -0
  180. package/dist/host/types/src/ui/plugin-host/loader.d.ts +52 -0
  181. package/dist/host/types/src/ui/plugin-host/plugin-store.d.ts +40 -0
  182. package/dist/host/types/src/ui/plugin-host/scope.d.ts +20 -0
  183. package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +99 -0
  184. package/dist/host/types/src/ui/plugin-host/shell-bridge.d.ts +67 -0
  185. package/dist/host/types/src/ui/plugin-host/view-ownership.d.ts +31 -0
  186. package/dist/host/types/src/ui/settings/HostPluginSections.d.ts +31 -0
  187. package/dist/host/types/src/ui/settings/SettingsFields.d.ts +22 -0
  188. package/dist/host/types/src/ui/settings/host-feature-tabs.d.ts +11 -0
  189. package/dist/host/types/src/ui/settings/settings-components.d.ts +32 -0
  190. package/dist/host/types/src/ui/settings/settings-fields-util.d.ts +11 -0
  191. package/dist/host/types/src/ui/shell/ActionSlot.d.ts +41 -0
  192. package/dist/host/types/src/ui/shell/TabContext.d.ts +30 -0
  193. package/dist/host/types/src/ui/shell/action-registry.d.ts +99 -0
  194. package/dist/host/types/src/ui/shell/keybinding-registry.d.ts +62 -0
  195. package/dist/host/types/src/ui/shell/palette-registry.d.ts +55 -0
  196. package/dist/host/types/src/ui/shell/panel-registry.d.ts +24 -0
  197. package/dist/host/types/src/ui/shell/tab-registry.d.ts +92 -0
  198. package/dist/host/types/src/ui/sidebar/HostManagerTabs.d.ts +65 -0
  199. package/dist/host/types/src/ui/sidebar/host-contributions.d.ts +72 -0
  200. package/dist/host/types/src/ui/sidebar/host-defaults/catalog.d.ts +17 -0
  201. package/dist/host/types/src/ui/sidebar/host-protocols.d.ts +49 -0
  202. package/dist/host/types/src/ui/sidebar/quick-connect-host.d.ts +21 -0
  203. package/dist/host/types/src/ui/sidebar/rail-items.d.ts +103 -0
  204. package/dist/host/types/src/ui/ssh/connection-log/ConnectionLogContext.d.ts +17 -0
  205. package/dist/host/types/src/ui/ssh/dialogs/BrowserSignInDialog.d.ts +18 -0
  206. package/dist/host/types/src/ui/ssh/dialogs/HostKeyVerificationDialog.d.ts +17 -0
  207. package/dist/host/types/src/ui/ssh/dialogs/PassphraseDialog.d.ts +15 -0
  208. package/dist/host/types/src/ui/ssh/dialogs/SSHAuthDialog.d.ts +20 -0
  209. package/dist/host/types/src/ui/ssh/dialogs/TOTPDialog.d.ts +13 -0
  210. package/dist/host/ui.d.ts +1 -0
  211. package/dist/host/ui.js +31754 -0
  212. package/dist/host/use-permissions-NULZL43J.js +18 -0
  213. package/dist/host-commands.d.ts +89 -0
  214. package/dist/host-commands.js +387 -0
  215. package/dist/manifest.d.ts +461 -0
  216. package/dist/manifest.js +1499 -0
  217. package/dist/settings.d.ts +43 -0
  218. package/dist/settings.js +168 -0
  219. package/dist/ssh-certs.d.ts +25 -0
  220. package/dist/ssh-certs.js +234 -0
  221. package/dist/ssh-options.d.ts +23 -0
  222. package/dist/ssh-options.js +1 -0
  223. package/dist/table-builder.d.ts +26 -0
  224. package/dist/table-builder.js +87 -0
  225. package/dist/testing/safe-ports.d.ts +10 -0
  226. package/dist/testing/safe-ports.js +59 -0
  227. package/dist/testing/setup.d.ts +7 -0
  228. package/dist/testing/setup.js +146 -0
  229. package/dist/testing.d.ts +537 -0
  230. package/dist/testing.js +1451 -0
  231. package/dist/vitest-preset.d.ts +54 -0
  232. package/dist/vitest-preset.js +96 -0
  233. package/package.json +143 -0
  234. package/schema/changelog.schema.json +67 -0
  235. package/schema/manifest.schema.json +1160 -0
  236. package/tsconfig.plugin.json +31 -0
@@ -0,0 +1,65 @@
1
+ import { type ComponentType, type ReactNode } from "react";
2
+ /** Core host editor tabs. Plugins add theirs through registerHostEditorSection. */
3
+ export type CoreHostTabId = "general" | "ssh";
4
+ export type HostTabId = CoreHostTabId | (string & {});
5
+ export type CredentialTabId = "general" | "auth";
6
+ type HostTab = {
7
+ id: HostTabId;
8
+ label: string;
9
+ icon: ReactNode;
10
+ };
11
+ type CredentialTab = {
12
+ id: CredentialTabId;
13
+ label: string;
14
+ icon: ReactNode;
15
+ };
16
+ export interface HostEditorSectionRenderProps {
17
+ form: any;
18
+ setField: (key: string, value: unknown) => void;
19
+ /** Applies several fields at once, against the latest form. */
20
+ updateForm: (patch: (form: Record<string, unknown>) => Record<string, unknown>) => void;
21
+ host?: unknown;
22
+ credentials?: unknown[];
23
+ adminTargetUserId?: string;
24
+ protocols: Record<string, boolean>;
25
+ /** "defaults" in the host defaults editor. */
26
+ mode?: "host" | "defaults";
27
+ }
28
+ /**
29
+ * A host editor tab contributed at runtime. "top" tabs sit in the main strip
30
+ * beside General and SSH; "ssh" tabs sit in the SSH group's second strip.
31
+ */
32
+ export interface HostEditorSectionDef {
33
+ id: string;
34
+ pluginId?: string;
35
+ group: "top" | "ssh";
36
+ labelKey: string;
37
+ /** Already-translated label, used instead of labelKey when set. */
38
+ label?: string;
39
+ icon?: ComponentType<{
40
+ className?: string;
41
+ }>;
42
+ /** Position among the group's tabs, core ones included. */
43
+ order?: number;
44
+ /** Whether to offer the tab for these protocols. Defaults to always. */
45
+ visible?: (protocols: Record<string, boolean>) => boolean;
46
+ /** Also offered in the host defaults editor; "only" for nowhere else. */
47
+ defaults?: boolean | "only";
48
+ component: ComponentType<HostEditorSectionRenderProps>;
49
+ }
50
+ export declare const registerHostEditorSection: (item: HostEditorSectionDef) => () => void;
51
+ export declare const unregisterHostEditorSection: (id: string) => void;
52
+ export declare const getHostEditorSection: (id: string) => HostEditorSectionDef;
53
+ export declare const hostEditorSectionList: () => HostEditorSectionDef[];
54
+ export declare const useHostEditorSections: () => HostEditorSectionDef[];
55
+ export declare const resetHostEditorSections: () => void;
56
+ /** Whether a tab lives in the SSH group's second strip. */
57
+ export declare function isSshGroupTab(id: string): boolean;
58
+ /**
59
+ * The main strip. With `protocols`, registered tabs are filtered by their
60
+ * `visible`; without, every registered top tab is listed.
61
+ */
62
+ export declare function makeHostTabs(t: (key: string) => string, protocols?: Record<string, boolean>, defaultsMode?: boolean): HostTab[];
63
+ export declare function makeHostSshSubTabs(t: (key: string) => string, protocols?: Record<string, boolean>, defaultsMode?: boolean): HostTab[];
64
+ export declare function makeCredentialTabs(t: (key: string) => string): CredentialTab[];
65
+ export { TabStrip } from "../components/tab-strip";
@@ -0,0 +1,72 @@
1
+ import type { ComponentType } from "react";
2
+ import type { Host } from "../../types/ui-types";
3
+ import type { TabShellCallbacks } from "../shell/tab-registry";
4
+ type Icon = ComponentType<{
5
+ className?: string;
6
+ size?: number | string;
7
+ }>;
8
+ /**
9
+ * What a plugin adds to a host: ways to connect or open a tool, badges on its
10
+ * row, and entries in its context menu. The host list, quick connect and the
11
+ * command palette all read these instead of knowing about each protocol.
12
+ */
13
+ export interface HostActionDef {
14
+ id: string;
15
+ pluginId?: string;
16
+ titleKey: string;
17
+ icon: Icon;
18
+ kind: "connect" | "open";
19
+ priority?: number;
20
+ tabType?: string;
21
+ when: (host: Host) => boolean;
22
+ run?: (host: Host, shell: TabShellCallbacks) => void;
23
+ tray?: boolean;
24
+ copyUrlView?: string;
25
+ /** Where the dashboard's host status list sends a click. */
26
+ overview?: boolean;
27
+ /** Offered as a button in Quick Connect, opening tabType. */
28
+ quickConnect?: boolean;
29
+ order?: number;
30
+ /** A label worked out per host, e.g. a single endpoint's name. */
31
+ label?: (host: Host) => string | undefined;
32
+ /** Several targets: two or more become a picker, one runs directly. */
33
+ items?: (host: Host) => {
34
+ id: string;
35
+ label: string;
36
+ run: (host: Host, shell: TabShellCallbacks) => void;
37
+ }[];
38
+ }
39
+ export interface HostBadgeDef {
40
+ id: string;
41
+ pluginId?: string;
42
+ when: (host: Host) => boolean;
43
+ component: ComponentType<{
44
+ host: Host;
45
+ }>;
46
+ order?: number;
47
+ }
48
+ export interface HostContextMenuItemDef {
49
+ id: string;
50
+ pluginId?: string;
51
+ titleKey: string;
52
+ icon?: Icon;
53
+ when: (host: Host) => boolean;
54
+ run: (host: Host, shell: TabShellCallbacks) => void;
55
+ order?: number;
56
+ }
57
+ export declare const registerHostAction: (item: HostActionDef) => () => void;
58
+ export declare const useHostActions: () => HostActionDef[];
59
+ export declare const listHostActions: () => HostActionDef[];
60
+ export declare const registerHostBadge: (item: HostBadgeDef) => () => void;
61
+ export declare const useHostBadges: () => HostBadgeDef[];
62
+ export declare const registerHostContextMenuItem: (item: HostContextMenuItemDef) => () => void;
63
+ export declare const useHostContextMenuItems: () => HostContextMenuItemDef[];
64
+ export declare function hostActionsFor(all: HostActionDef[], host: Host, kind?: HostActionDef["kind"]): HostActionDef[];
65
+ /** The connect action a click on the host should run, by priority. */
66
+ export declare function defaultConnectAction(all: HostActionDef[], host: Host): HostActionDef | undefined;
67
+ export declare function hostBadgesFor(all: HostBadgeDef[], host: Host): HostBadgeDef[];
68
+ export declare function hostMenuItemsFor(all: HostContextMenuItemDef[], host: Host): HostContextMenuItemDef[];
69
+ /** Runs an action, falling back to opening its tab type. */
70
+ export declare function runHostAction(action: HostActionDef, host: Host, shell: TabShellCallbacks): void;
71
+ export declare function resetHostContributions(): void;
72
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The keys the host editor can show a default for: core's own, and every
3
+ * running plugin's host fields that can have one.
4
+ */
5
+ import { type HostDefaultsLevel } from "../../../types/host-defaults";
6
+ import { type PluginSettingsField, type PluginSummary } from "../../api/plugins-api";
7
+ export interface EditorDefaultKey {
8
+ fullKey: string;
9
+ namespace: string;
10
+ key: string;
11
+ levels: readonly HostDefaultsLevel[];
12
+ }
13
+ export declare function isDefaultableField(field: PluginSettingsField): boolean;
14
+ export declare function pluginDefaultKeys(plugins: PluginSummary[]): EditorDefaultKey[];
15
+ export declare const CORE_EDITOR_KEYS: EditorDefaultKey[];
16
+ /** Every key, by full key. Refreshed when the plugin list is. */
17
+ export declare function useEditorDefaultKeys(): Map<string, EditorDefaultKey>;
@@ -0,0 +1,49 @@
1
+ import type { ComponentType } from "react";
2
+ type Icon = ComponentType<{
3
+ className?: string;
4
+ size?: number | string;
5
+ }>;
6
+ /**
7
+ * A connection protocol a plugin adds next to SSH. Its on/off
8
+ * switch and port are the plugin's own host settings, so core reads them
9
+ * from host.pluginSettings[pluginId] and never knows the protocol by name.
10
+ */
11
+ export interface HostProtocolDef {
12
+ id: string;
13
+ pluginId: string;
14
+ /** The plugin's boolean host setting that switches the protocol on. */
15
+ settingKey: string;
16
+ /** The plugin's number host setting holding the port, if it has one. */
17
+ portKey?: string;
18
+ defaultPort: number;
19
+ titleKey: string;
20
+ descriptionKey?: string;
21
+ connectionOriginNoteKey?: string;
22
+ icon: Icon;
23
+ order?: number;
24
+ /** Offer it in Quick Connect, optionally with a domain field. */
25
+ quickConnect?: {
26
+ showDomain?: boolean;
27
+ };
28
+ }
29
+ export declare const registerHostProtocol: (item: HostProtocolDef) => () => void;
30
+ export declare const useHostProtocols: () => HostProtocolDef[];
31
+ export declare const listHostProtocols: () => HostProtocolDef[];
32
+ /** Which protocols are on, keyed by setting key, with SSH as enableSsh. */
33
+ export type HostProtocols = {
34
+ enableSsh: boolean;
35
+ } & Record<string, boolean>;
36
+ type PluginSettingsBag = Record<string, Record<string, unknown>> | undefined;
37
+ export declare function protocolEnabled(pluginSettings: PluginSettingsBag, protocol: HostProtocolDef): boolean;
38
+ export declare function protocolPort(pluginSettings: PluginSettingsBag, protocol: HostProtocolDef): number;
39
+ export declare function hostProtocolFlags(host: {
40
+ enableSsh?: boolean;
41
+ pluginSettings?: PluginSettingsBag;
42
+ } | null, list?: HostProtocolDef[]): HostProtocols;
43
+ /** The protocols a host has switched on, in registration order. */
44
+ export declare function enabledHostProtocols(host: {
45
+ pluginSettings?: PluginSettingsBag;
46
+ }, list?: HostProtocolDef[]): HostProtocolDef[];
47
+ /** Writes the editor's protocol switches into each owner's host settings. */
48
+ export declare function withProtocolSettings(pluginSettings: Record<string, Record<string, unknown>>, flags: HostProtocols, list?: HostProtocolDef[]): Record<string, Record<string, unknown>>;
49
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { SSHHostData } from "../../types";
2
+ import type { Host } from "../../types/ui-types";
3
+ import type { HostProtocolDef } from "./host-protocols";
4
+ import { type HostActionDef } from "./host-contributions";
5
+ type QuickConnectInput = Pick<Host, "ip" | "port" | "username" | "authType" | "password" | "key" | "credentialId"> & {
6
+ /** A plugin protocol; SSH when omitted. */
7
+ protocol?: HostProtocolDef;
8
+ domain?: string;
9
+ /** Fields a plugin's SSH auth editor filled in. */
10
+ authFields?: Record<string, unknown>;
11
+ };
12
+ export declare function isQuickConnectHost(host: Pick<Host, "id">): boolean;
13
+ export declare function createQuickConnectHost(input: QuickConnectInput): Host;
14
+ export declare function quickConnectHostToPayload(host: Host): SSHHostData;
15
+ /**
16
+ * Every way to reach the address: connect actions (terminal, remote desktop)
17
+ * by priority, then tools that opted into Quick Connect. Only actions that
18
+ * open a tab work here, since the host is never saved.
19
+ */
20
+ export declare function quickConnectTargets(all: HostActionDef[], host: Host): HostActionDef[];
21
+ export {};
@@ -0,0 +1,103 @@
1
+ import { type LucideIcon } from "lucide-react";
2
+ /**
3
+ * The one list of navigation destinations.
4
+ *
5
+ * This used to be duplicated in four places -- AppRail's button array, the
6
+ * visibility toggles in UserProfilePanel, AppShell's sidebar title map, and
7
+ * the mobile bar's own primary/more lists -- which drifted: half the sidebar
8
+ * titles were hardcoded English, the alerts entry had no visibility toggle,
9
+ * and the mobile bar ignored hidden tabs entirely. Everything now derives from
10
+ * here, so adding a destination is a single edit.
11
+ */
12
+ export interface RailItemDef {
13
+ /** Matches RailView, or a TabType for entries that open a tab instead. */
14
+ id: string;
15
+ icon: LucideIcon;
16
+ /** i18n key; every label goes through t() so nothing is hardcoded English. */
17
+ labelKey: string;
18
+ /** Tab-opening entries rather than sidebar panels. */
19
+ kind?: "tab";
20
+ /** Always-available destinations that users cannot hide. */
21
+ alwaysVisible?: boolean;
22
+ /** Renders a separator after this item in the rail. */
23
+ separatorAfter?: boolean;
24
+ /** The rail band it sits in. Defaults to "tools". */
25
+ group?: RailGroup;
26
+ /** Shown on the mobile bottom bar's primary row rather than its More menu. */
27
+ mobilePrimary?: boolean;
28
+ /**
29
+ * Can also open as a full-width tab in the main area, via ctrl/middle-click
30
+ * or the rail context menu. The id doubles as the TabType.
31
+ */
32
+ promotable?: boolean;
33
+ /**
34
+ * Can be opened in the right dock. Reference panels only -- editors stay in
35
+ * the left sidebar, which is the only dock that widens for them.
36
+ */
37
+ rightDockable?: boolean;
38
+ /** Desktop app only. Hidden in the browser build, including its toggle. */
39
+ electronOnly?: boolean;
40
+ /** False keeps it out of the Navigation visibility toggles. */
41
+ hideable?: boolean;
42
+ /** A plugin item that stays visible in the Simple preset. */
43
+ simplePreset?: boolean;
44
+ /** Registered but not shown, e.g. while its feature is switched off. */
45
+ hidden?: boolean;
46
+ /** Places a registered item after this id instead of at the end. */
47
+ after?: string;
48
+ /** Tie-break among registered items. */
49
+ order?: number;
50
+ /** Set for items a plugin registered. */
51
+ pluginId?: string;
52
+ /** Role permission the user needs to see it at all, as a full id. */
53
+ permission?: string;
54
+ /** "footer" renders it at the bottom of the rail, above the profile. */
55
+ placement?: "main" | "footer";
56
+ /** Called as a hook by the rail; a positive number shows as a badge. */
57
+ useBadge?: () => number | null | undefined;
58
+ }
59
+ /** Things you keep, things you do, and the instance itself. */
60
+ export type RailGroup = "objects" | "tools" | "system";
61
+ export declare const RAIL_GROUP_ORDER: RailGroup[];
62
+ export declare const RAIL_ITEMS: RailItemDef[];
63
+ /** Main rail items split into their bands, in band order, empty bands left out. */
64
+ export declare function groupRailItems(items: RailItemDef[]): {
65
+ group: RailGroup;
66
+ items: RailItemDef[];
67
+ }[];
68
+ export declare function registerRailItem(def: RailItemDef): () => void;
69
+ /** Registered items, hidden ones included. */
70
+ export declare const listRegisteredRailItems: () => RailItemDef[];
71
+ /**
72
+ * Rail items available in the current build. Electron-only destinations are
73
+ * dropped in the browser build so they never reach the rail, the mobile bar,
74
+ * or the visibility toggles.
75
+ */
76
+ export declare function visibleRailItems(): RailItemDef[];
77
+ /**
78
+ * Drops items gated on a permission the user lacks. Until permissions load,
79
+ * gated items stay hidden rather than flashing in and out.
80
+ */
81
+ export declare function permittedRailItems(items: RailItemDef[], permissions: {
82
+ has: (permission: string) => boolean;
83
+ loaded: boolean;
84
+ }): RailItemDef[];
85
+ /**
86
+ * visibleRailItems() as a hook, re-rendering when plugins change it, without
87
+ * the items the user's permissions hide.
88
+ */
89
+ export declare function useRailItems(): RailItemDef[];
90
+ /** Places outside the rail that still need a title, like the Settings tab. */
91
+ export declare const RAIL_UTILITY_ITEMS: RailItemDef[];
92
+ /** Ids that may be opened in the right dock. */
93
+ export declare function rightDockableIds(): string[];
94
+ /** Ids that may be opened as a full-width tab: a tab type or a panel to show. */
95
+ export declare function promotableIds(): string[];
96
+ /** Ids a user is allowed to hide from Appearance > Sidebar > Navigation. */
97
+ export declare function hideableRailIds(): string[];
98
+ /** Whether a rail view is one of core's own, rather than a plugin's. */
99
+ export declare function isCoreRailView(id: string): boolean;
100
+ /** Translated label for any rail destination, including registered ones. */
101
+ export declare function railItemLabel(id: string, t: (key: string) => string): string;
102
+ /** Test seam. */
103
+ export declare function resetRegisteredRailItems(): void;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import type { LogEntry } from "../../../types/connection-log";
3
+ interface ConnectionLogContextType {
4
+ logs: LogEntry[];
5
+ addLog: (entry: Omit<LogEntry, "id" | "timestamp">) => void;
6
+ setLogs: (entries: Omit<LogEntry, "id" | "timestamp">[]) => void;
7
+ clearLogs: () => void;
8
+ isExpanded: boolean;
9
+ toggleExpanded: () => void;
10
+ setIsExpanded: React.Dispatch<React.SetStateAction<boolean>>;
11
+ }
12
+ export declare function ConnectionLogProvider({ children, }: {
13
+ children: React.ReactNode;
14
+ }): React.JSX.Element;
15
+ export declare function useConnectionLog(): ConnectionLogContextType;
16
+ export declare function useOptionalConnectionLog(): ConnectionLogContextType;
17
+ export {};
@@ -0,0 +1,18 @@
1
+ interface BrowserSignInDialogProps {
2
+ isOpen: boolean;
3
+ /** Who is asking, e.g. the product name of an SSH gateway. */
4
+ label: string;
5
+ url: string;
6
+ /** A code to compare in the browser; "N/A" or empty hides it. */
7
+ code: string;
8
+ onContinue: () => void;
9
+ onCancel: () => void;
10
+ onOpenUrl: () => void;
11
+ backgroundColor?: string;
12
+ }
13
+ /**
14
+ * A keyboard-interactive round finished in a browser: open the URL, compare
15
+ * the code there, then continue.
16
+ */
17
+ export declare function BrowserSignInDialog({ isOpen, label, url, code, onContinue, onCancel, onOpenUrl, backgroundColor, }: BrowserSignInDialogProps): import("react").JSX.Element;
18
+ export {};
@@ -0,0 +1,17 @@
1
+ interface HostKeyVerificationDialogProps {
2
+ isOpen: boolean;
3
+ scenario: "new" | "changed";
4
+ ip: string;
5
+ port: number;
6
+ hostname?: string;
7
+ fingerprint: string;
8
+ oldFingerprint?: string;
9
+ keyType: string;
10
+ oldKeyType?: string;
11
+ algorithm: string;
12
+ onAccept: () => void;
13
+ onReject: () => void;
14
+ backgroundColor?: string;
15
+ }
16
+ export declare function HostKeyVerificationDialog({ isOpen, scenario, ip, port, hostname, fingerprint, oldFingerprint, algorithm, onAccept, onReject, backgroundColor, }: HostKeyVerificationDialogProps): import("react").JSX.Element;
17
+ export {};
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ interface PassphraseDialogProps {
3
+ isOpen: boolean;
4
+ onSubmit: (passphrase: string) => void;
5
+ onCancel: () => void;
6
+ hostInfo: {
7
+ ip: string;
8
+ port: number;
9
+ username: string;
10
+ name?: string;
11
+ };
12
+ backgroundColor?: string;
13
+ }
14
+ export declare function PassphraseDialog({ isOpen, onSubmit, onCancel, hostInfo, backgroundColor, }: PassphraseDialogProps): React.JSX.Element;
15
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ interface SSHAuthDialogProps {
3
+ isOpen: boolean;
4
+ reason: "no_keyboard" | "auth_failed" | "timeout";
5
+ onSubmit: (credentials: {
6
+ password?: string;
7
+ sshKey?: string;
8
+ keyPassword?: string;
9
+ }) => void;
10
+ onCancel: () => void;
11
+ hostInfo: {
12
+ ip: string;
13
+ port: number;
14
+ username: string;
15
+ name?: string;
16
+ };
17
+ backgroundColor?: string;
18
+ }
19
+ export declare function SSHAuthDialog({ isOpen, reason, onSubmit, onCancel, hostInfo, backgroundColor, }: SSHAuthDialogProps): React.JSX.Element;
20
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import type { MFAPromptMode } from "@termix-ssh/plugin-sdk/frontend";
3
+ export type { MFAPromptMode };
4
+ interface TOTPDialogProps {
5
+ isOpen: boolean;
6
+ prompt: string;
7
+ mode?: MFAPromptMode;
8
+ waiting?: boolean;
9
+ onSubmit: (code: string) => void;
10
+ onCancel: () => void;
11
+ backgroundColor?: string;
12
+ }
13
+ export declare function TOTPDialog({ isOpen, prompt, mode, waiting, onSubmit, onCancel, backgroundColor, }: TOTPDialogProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./types/src/ui/plugin-host/sdk-ui.js";