@termix-ssh/plugin-sdk 1.0.11 → 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.
Files changed (117) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/PLUGIN-GUIDE.md +95 -3
  3. package/cli/commands/build.mjs +36 -22
  4. package/cli/commands/pack.mjs +12 -2
  5. package/cli/commands/validate.mjs +63 -3
  6. package/cli/lib/plugin-dir.mjs +11 -0
  7. package/cli/lib/tmxplug.mjs +9 -0
  8. package/dist/capabilities.js +2 -0
  9. package/dist/frontend.d.ts +152 -0
  10. package/dist/frontend.js +7 -0
  11. package/dist/host/PluginsTab-EV4MSGY6.js +2933 -0
  12. package/dist/host/{chunk-RLQBKJRK.js → chunk-AWR6FYDO.js} +8873 -11163
  13. package/dist/host/{chunk-7RRTYD6B.js → chunk-RUPLD6RF.js} +1497 -15
  14. package/dist/host/{chunk-LSWB3ZZV.js → chunk-VEWOYAMZ.js} +6 -1
  15. package/dist/host/chunk-X4QZKO5G.js +3120 -0
  16. package/dist/host/chunk-XKA3DBB2.js +10375 -0
  17. package/dist/host/chunk-YGYBM7SQ.js +58 -0
  18. package/dist/host/core-classes.json +1 -1
  19. package/dist/host/{linked-server-UCW74T2V.js → linked-server-B4NEG4MA.js} +2 -2
  20. package/dist/host/{rbac-api-6UYMFIFV.js → rbac-api-OUO3LUOC.js} +2 -2
  21. package/dist/host/testing-host.js +123 -57
  22. package/dist/host/types/src/types/ui-types.d.ts +2 -1
  23. package/dist/host/types/src/ui/api/audit-log-api.d.ts +46 -0
  24. package/dist/host/types/src/ui/api/host-defaults-api.d.ts +42 -0
  25. package/dist/host/types/src/ui/api/host-tags-api.d.ts +2 -0
  26. package/dist/host/types/src/ui/api/look-api.d.ts +40 -0
  27. package/dist/host/types/src/ui/api/open-tabs-api.d.ts +4 -0
  28. package/dist/host/types/src/ui/api/plugins-api.d.ts +26 -0
  29. package/dist/host/types/src/ui/api/private-endpoints-api.d.ts +6 -0
  30. package/dist/host/types/src/ui/api/tls-api.d.ts +25 -0
  31. package/dist/host/types/src/ui/auth/ElectronLoginForm.d.ts +9 -0
  32. package/dist/host/types/src/ui/components/command.d.ts +78 -0
  33. package/dist/host/types/src/ui/components/folder-style.d.ts +16 -0
  34. package/dist/host/types/src/ui/components/theme-provider.d.ts +2 -1
  35. package/dist/host/types/src/ui/components/version-badge.d.ts +7 -0
  36. package/dist/host/types/src/ui/hooks/use-page-visible-interval.d.ts +10 -0
  37. package/dist/host/types/src/ui/lib/activity-types.d.ts +15 -0
  38. package/dist/host/types/src/ui/lib/app-version.d.ts +2 -0
  39. package/dist/host/types/src/ui/lib/apply-ui-preset.d.ts +19 -0
  40. package/dist/host/types/src/ui/lib/create-id.d.ts +2 -0
  41. package/dist/host/types/src/ui/lib/database-transfer-url.d.ts +8 -0
  42. package/dist/host/types/src/ui/lib/desktop-updates.d.ts +29 -0
  43. package/dist/host/types/src/ui/lib/host-connection-tabs.d.ts +14 -0
  44. package/dist/host/types/src/ui/lib/host-to-ssh-host.d.ts +4 -0
  45. package/dist/host/types/src/ui/lib/issue-url.d.ts +21 -0
  46. package/dist/host/types/src/ui/lib/local-adaptive-preferences.d.ts +9 -0
  47. package/dist/host/types/src/ui/lib/pane-nav-hotkey.d.ts +7 -0
  48. package/dist/host/types/src/ui/lib/plugin-i18n.d.ts +4 -3
  49. package/dist/host/types/src/ui/lib/role-label.d.ts +3 -0
  50. package/dist/host/types/src/ui/look/LookSettings.d.ts +8 -0
  51. package/dist/host/types/src/ui/look/layout-registry.d.ts +34 -0
  52. package/dist/host/types/src/ui/look/look-store.d.ts +29 -0
  53. package/dist/host/types/src/ui/look/resolve-look.d.ts +18 -0
  54. package/dist/host/types/src/ui/look/theme-css.d.ts +7 -0
  55. package/dist/host/types/src/ui/look/theme-registry.d.ts +41 -0
  56. package/dist/host/types/src/ui/look/use-look-theme.d.ts +12 -0
  57. package/dist/host/types/src/ui/manage/manage-requests.d.ts +34 -0
  58. package/dist/host/types/src/ui/plugin-host/loader.d.ts +2 -0
  59. package/dist/host/types/src/ui/plugin-host/scope.d.ts +6 -0
  60. package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +102 -0
  61. package/dist/host/types/src/ui/plugin-host/view-ownership.d.ts +1 -1
  62. package/dist/host/types/src/ui/plugins/PluginConsentPrompt.d.ts +20 -0
  63. package/dist/host/types/src/ui/plugins/PluginDetail.d.ts +7 -0
  64. package/dist/host/types/src/ui/plugins/PluginReleaseNotes.d.ts +14 -0
  65. package/dist/host/types/src/ui/plugins/PluginsTab.d.ts +1 -0
  66. package/dist/host/types/src/ui/plugins/RegistriesSection.d.ts +4 -0
  67. package/dist/host/types/src/ui/plugins/plugin-bits.d.ts +23 -0
  68. package/dist/host/types/src/ui/plugins/plugin-model.d.ts +116 -0
  69. package/dist/host/types/src/ui/plugins/use-plugins-manager.d.ts +75 -0
  70. package/dist/host/types/src/ui/settings/appearance/appearance-controls.d.ts +53 -0
  71. package/dist/host/types/src/ui/settings/sync/LinkServerDialog.d.ts +12 -0
  72. package/dist/host/types/src/ui/settings/sync/ProxySettingsFields.d.ts +15 -0
  73. package/dist/host/types/src/ui/settings/sync/saved-servers.d.ts +3 -0
  74. package/dist/host/types/src/ui/shell/controller/ShellControllerProvider.d.ts +20 -0
  75. package/dist/host/types/src/ui/shell/controller/plugin-shell.d.ts +7 -0
  76. package/dist/host/types/src/ui/shell/controller/shell-store.d.ts +4 -0
  77. package/dist/host/types/src/ui/shell/controller/types.d.ts +156 -0
  78. package/dist/host/types/src/ui/shell/controller/use-hosts.d.ts +10 -0
  79. package/dist/host/types/src/ui/shell/controller/use-regions.d.ts +5 -0
  80. package/dist/host/types/src/ui/shell/controller/use-shell-keybindings.d.ts +12 -0
  81. package/dist/host/types/src/ui/shell/controller/use-shell-lifecycle.d.ts +17 -0
  82. package/dist/host/types/src/ui/shell/controller/use-split.d.ts +21 -0
  83. package/dist/host/types/src/ui/shell/controller/use-tabs.d.ts +70 -0
  84. package/dist/host/types/src/ui/shell/controller/use-workspace-layout.d.ts +4 -0
  85. package/dist/host/types/src/ui/shell/reconnect-tabs.d.ts +6 -0
  86. package/dist/host/types/src/ui/shell/shell-layout.d.ts +46 -0
  87. package/dist/host/types/src/ui/shell/split/EmptyPanePicker.d.ts +32 -0
  88. package/dist/host/types/src/ui/shell/split/SplitDropOverlay.d.ts +9 -0
  89. package/dist/host/types/src/ui/shell/split/SplitLayoutMenu.d.ts +16 -0
  90. package/dist/host/types/src/ui/shell/split/SplitView.d.ts +31 -0
  91. package/dist/host/types/src/ui/shell/split/split-drag.d.ts +58 -0
  92. package/dist/host/types/src/ui/shell/split/split-presets.d.ts +28 -0
  93. package/dist/host/types/src/ui/shell/split/split-tabs.d.ts +95 -0
  94. package/dist/host/types/src/ui/shell/split/split-targets.d.ts +30 -0
  95. package/dist/host/types/src/ui/shell/split/split-tree.d.ts +89 -0
  96. package/dist/host/types/src/ui/shell/stage/TabStage.d.ts +9 -0
  97. package/dist/host/types/src/ui/shell/stage/tab-stage-store.d.ts +24 -0
  98. package/dist/host/types/src/ui/shell/tab-close-guards.d.ts +9 -0
  99. package/dist/host/types/src/ui/shell/tab-handles.d.ts +8 -0
  100. package/dist/host/types/src/ui/shell/tabUtils.d.ts +15 -0
  101. package/dist/host/types/src/ui/sidebar/AuthEnrollmentSections.d.ts +5 -0
  102. package/dist/host/types/src/ui/sidebar/HostManagerData.d.ts +4 -0
  103. package/dist/host/types/src/ui/sidebar/build-host-tree.d.ts +25 -0
  104. package/dist/host/types/src/ui/sidebar/host-export-payload.d.ts +30 -0
  105. package/dist/host/ui.js +6236 -4055
  106. package/dist/host/{use-permissions-GYCBY2AU.js → use-permissions-6VSHHUMB.js} +2 -2
  107. package/dist/manifest.d.ts +41 -1
  108. package/dist/manifest.js +89 -1
  109. package/dist/testing/setup.js +1 -0
  110. package/dist/theme-css.d.ts +11 -0
  111. package/dist/theme-css.js +142 -0
  112. package/dist/vitest-preset.d.ts +18 -0
  113. package/dist/vitest-preset.js +14 -3
  114. package/package.json +1 -1
  115. package/schema/manifest.schema.json +111 -8
  116. package/tsconfig.plugin.json +1 -0
  117. package/dist/host/chunk-YC2MAKSP.js +0 -14
@@ -1,10 +1,15 @@
1
1
  const __termixNoGlob = () => ({});
2
2
  import {
3
3
  __export,
4
- define_import_meta_env_default
5
- } from "./chunk-YC2MAKSP.js";
4
+ define_import_meta_env_default,
5
+ init_define_import_meta_env
6
+ } from "./chunk-YGYBM7SQ.js";
7
+
8
+ // src/ui/lib/linked-server.ts
9
+ init_define_import_meta_env();
6
10
 
7
11
  // src/ui/lib/electron.ts
12
+ init_define_import_meta_env();
8
13
  function isElectron() {
9
14
  if (typeof window === "undefined") return false;
10
15
  const win = window;
@@ -20,12 +25,26 @@ function localBackendPort() {
20
25
  return typeof port === "number" && Number.isInteger(port) && port > 0 && port < 65536 ? port : DEFAULT_LOCAL_BACKEND_PORT;
21
26
  }
22
27
 
28
+ // src/ui/main-axios.ts
29
+ init_define_import_meta_env();
30
+
23
31
  // src/ui/lib/error-message.ts
32
+ init_define_import_meta_env();
24
33
  function getErrorMessage(error, fallback = "Unknown error") {
25
34
  return error instanceof Error ? error.message : fallback;
26
35
  }
27
36
 
37
+ // node_modules/axios/index.js
38
+ init_define_import_meta_env();
39
+
40
+ // node_modules/axios/lib/axios.js
41
+ init_define_import_meta_env();
42
+
43
+ // node_modules/axios/lib/utils.js
44
+ init_define_import_meta_env();
45
+
28
46
  // node_modules/axios/lib/helpers/bind.js
47
+ init_define_import_meta_env();
29
48
  function bind(fn, thisArg) {
30
49
  return function wrap() {
31
50
  return fn.apply(thisArg, arguments);
@@ -580,7 +599,26 @@ var utils_default = {
580
599
  isSafeIterable
581
600
  };
582
601
 
602
+ // node_modules/axios/lib/core/Axios.js
603
+ init_define_import_meta_env();
604
+
605
+ // node_modules/axios/lib/helpers/buildURL.js
606
+ init_define_import_meta_env();
607
+
608
+ // node_modules/axios/lib/helpers/AxiosURLSearchParams.js
609
+ init_define_import_meta_env();
610
+
611
+ // node_modules/axios/lib/helpers/toFormData.js
612
+ init_define_import_meta_env();
613
+
614
+ // node_modules/axios/lib/core/AxiosError.js
615
+ init_define_import_meta_env();
616
+
617
+ // node_modules/axios/lib/core/AxiosHeaders.js
618
+ init_define_import_meta_env();
619
+
583
620
  // node_modules/axios/lib/helpers/parseHeaders.js
621
+ init_define_import_meta_env();
584
622
  var ignoreDuplicateOf = utils_default.toObjectSet([
585
623
  "age",
586
624
  "authorization",
@@ -627,6 +665,7 @@ var parseHeaders_default = (rawHeaders) => {
627
665
  };
628
666
 
629
667
  // node_modules/axios/lib/helpers/sanitizeHeaderValue.js
668
+ init_define_import_meta_env();
630
669
  function trimSPorHTAB(str) {
631
670
  let start = 0;
632
671
  let end = str.length;
@@ -1160,6 +1199,7 @@ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
1160
1199
  var AxiosError_default = AxiosError;
1161
1200
 
1162
1201
  // node_modules/axios/lib/helpers/null.js
1202
+ init_define_import_meta_env();
1163
1203
  var null_default = null;
1164
1204
 
1165
1205
  // node_modules/axios/lib/helpers/toFormData.js
@@ -1370,6 +1410,7 @@ function buildURL(url, params, options) {
1370
1410
  }
1371
1411
 
1372
1412
  // node_modules/axios/lib/core/InterceptorManager.js
1413
+ init_define_import_meta_env();
1373
1414
  var $internals2 = /* @__PURE__ */ Symbol("internals");
1374
1415
  function countHandlers(handlers) {
1375
1416
  return handlers ? handlers.length : 0;
@@ -1507,7 +1548,17 @@ var InterceptorManager = class {
1507
1548
  };
1508
1549
  var InterceptorManager_default = InterceptorManager;
1509
1550
 
1551
+ // node_modules/axios/lib/core/dispatchRequest.js
1552
+ init_define_import_meta_env();
1553
+
1554
+ // node_modules/axios/lib/core/transformData.js
1555
+ init_define_import_meta_env();
1556
+
1557
+ // node_modules/axios/lib/defaults/index.js
1558
+ init_define_import_meta_env();
1559
+
1510
1560
  // node_modules/axios/lib/defaults/transitional.js
1561
+ init_define_import_meta_env();
1511
1562
  var transitional_default = {
1512
1563
  silentJSONParsing: true,
1513
1564
  forcedJSONParsing: true,
@@ -1517,13 +1568,25 @@ var transitional_default = {
1517
1568
  validateStatusUndefinedResolves: true
1518
1569
  };
1519
1570
 
1571
+ // node_modules/axios/lib/helpers/toURLEncodedForm.js
1572
+ init_define_import_meta_env();
1573
+
1574
+ // node_modules/axios/lib/platform/index.js
1575
+ init_define_import_meta_env();
1576
+
1577
+ // node_modules/axios/lib/platform/browser/index.js
1578
+ init_define_import_meta_env();
1579
+
1520
1580
  // node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
1581
+ init_define_import_meta_env();
1521
1582
  var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default;
1522
1583
 
1523
1584
  // node_modules/axios/lib/platform/browser/classes/FormData.js
1585
+ init_define_import_meta_env();
1524
1586
  var FormData_default = typeof FormData !== "undefined" ? FormData : null;
1525
1587
 
1526
1588
  // node_modules/axios/lib/platform/browser/classes/Blob.js
1589
+ init_define_import_meta_env();
1527
1590
  var Blob_default = typeof Blob !== "undefined" ? Blob : null;
1528
1591
 
1529
1592
  // node_modules/axios/lib/platform/browser/index.js
@@ -1546,6 +1609,7 @@ __export(utils_exports, {
1546
1609
  navigator: () => _navigator,
1547
1610
  origin: () => origin
1548
1611
  });
1612
+ init_define_import_meta_env();
1549
1613
  var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
1550
1614
  var _navigator = typeof navigator === "object" && navigator || void 0;
1551
1615
  var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
@@ -1576,6 +1640,7 @@ function toURLEncodedForm(data, options) {
1576
1640
  }
1577
1641
 
1578
1642
  // node_modules/axios/lib/helpers/formDataToJSON.js
1643
+ init_define_import_meta_env();
1579
1644
  var MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
1580
1645
  function throwIfDepthExceeded(index) {
1581
1646
  if (index > MAX_DEPTH) {
@@ -1644,6 +1709,7 @@ function formDataToJSON(formData) {
1644
1709
  var formDataToJSON_default = formDataToJSON;
1645
1710
 
1646
1711
  // node_modules/axios/lib/core/methodList.js
1712
+ init_define_import_meta_env();
1647
1713
  var methodList = Object.freeze([
1648
1714
  "get",
1649
1715
  "delete",
@@ -1790,11 +1856,13 @@ function transformData(fns, response) {
1790
1856
  }
1791
1857
 
1792
1858
  // node_modules/axios/lib/cancel/isCancel.js
1859
+ init_define_import_meta_env();
1793
1860
  function isCancel(value) {
1794
1861
  return !!(value && value.__CANCEL__);
1795
1862
  }
1796
1863
 
1797
1864
  // node_modules/axios/lib/cancel/CanceledError.js
1865
+ init_define_import_meta_env();
1798
1866
  var CanceledError = class extends AxiosError_default {
1799
1867
  /**
1800
1868
  * A `CanceledError` is an object that is thrown when an operation is canceled.
@@ -1813,7 +1881,14 @@ var CanceledError = class extends AxiosError_default {
1813
1881
  };
1814
1882
  var CanceledError_default = CanceledError;
1815
1883
 
1884
+ // node_modules/axios/lib/adapters/adapters.js
1885
+ init_define_import_meta_env();
1886
+
1887
+ // node_modules/axios/lib/adapters/xhr.js
1888
+ init_define_import_meta_env();
1889
+
1816
1890
  // node_modules/axios/lib/core/settle.js
1891
+ init_define_import_meta_env();
1817
1892
  function settle(resolve, reject, response) {
1818
1893
  const validateStatus2 = response.config.validateStatus;
1819
1894
  if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
@@ -1830,6 +1905,7 @@ function settle(resolve, reject, response) {
1830
1905
  }
1831
1906
 
1832
1907
  // node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js
1908
+ init_define_import_meta_env();
1833
1909
  var urlParserControlCharacters = /[\t\n\r]/g;
1834
1910
  function normalizeURLForProtocolCheck(url) {
1835
1911
  if (typeof url !== "string") {
@@ -1843,12 +1919,17 @@ function normalizeURLForProtocolCheck(url) {
1843
1919
  }
1844
1920
 
1845
1921
  // node_modules/axios/lib/helpers/parseProtocol.js
1922
+ init_define_import_meta_env();
1846
1923
  function parseProtocol(url) {
1847
1924
  const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
1848
1925
  return match && match[1] || "";
1849
1926
  }
1850
1927
 
1928
+ // node_modules/axios/lib/helpers/progressEventReducer.js
1929
+ init_define_import_meta_env();
1930
+
1851
1931
  // node_modules/axios/lib/helpers/speedometer.js
1932
+ init_define_import_meta_env();
1852
1933
  function speedometer(samplesCount, min) {
1853
1934
  samplesCount = samplesCount || 10;
1854
1935
  const bytes = new Array(samplesCount);
@@ -1885,6 +1966,7 @@ function speedometer(samplesCount, min) {
1885
1966
  var speedometer_default = speedometer;
1886
1967
 
1887
1968
  // node_modules/axios/lib/helpers/throttle.js
1969
+ init_define_import_meta_env();
1888
1970
  function throttle(fn, freq) {
1889
1971
  let timestamp = 0;
1890
1972
  let threshold = 1e3 / freq;
@@ -1961,7 +2043,11 @@ var progressEventDecorator = (total, throttled) => {
1961
2043
  };
1962
2044
  var asyncDecorator = (fn, scheduler = utils_default.asap) => (...args) => scheduler(() => fn(...args));
1963
2045
 
2046
+ // node_modules/axios/lib/helpers/resolveConfig.js
2047
+ init_define_import_meta_env();
2048
+
1964
2049
  // node_modules/axios/lib/helpers/isURLSameOrigin.js
2050
+ init_define_import_meta_env();
1965
2051
  var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
1966
2052
  url = new URL(url, platform_default.origin);
1967
2053
  return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
@@ -1971,6 +2057,7 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PUR
1971
2057
  ) : () => true;
1972
2058
 
1973
2059
  // node_modules/axios/lib/helpers/cookies.js
2060
+ init_define_import_meta_env();
1974
2061
  var cookies_default = platform_default.hasStandardBrowserEnv ? (
1975
2062
  // Standard browser envs support document.cookie
1976
2063
  {
@@ -2027,7 +2114,11 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? (
2027
2114
  }
2028
2115
  );
2029
2116
 
2117
+ // node_modules/axios/lib/core/buildFullPath.js
2118
+ init_define_import_meta_env();
2119
+
2030
2120
  // node_modules/axios/lib/helpers/isAbsoluteURL.js
2121
+ init_define_import_meta_env();
2031
2122
  function isAbsoluteURL(url) {
2032
2123
  if (typeof url !== "string") {
2033
2124
  return false;
@@ -2036,6 +2127,7 @@ function isAbsoluteURL(url) {
2036
2127
  }
2037
2128
 
2038
2129
  // node_modules/axios/lib/helpers/combineURLs.js
2130
+ init_define_import_meta_env();
2039
2131
  function combineURLs(baseURL, relativeURL) {
2040
2132
  if (!relativeURL) {
2041
2133
  return baseURL;
@@ -2093,6 +2185,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
2093
2185
  }
2094
2186
 
2095
2187
  // node_modules/axios/lib/core/mergeConfig.js
2188
+ init_define_import_meta_env();
2096
2189
  var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
2097
2190
  var ownEnumerableKeys = (thing) => {
2098
2191
  if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
@@ -2221,6 +2314,7 @@ function mergeConfig(config1, config2) {
2221
2314
  }
2222
2315
 
2223
2316
  // node_modules/axios/lib/core/setFormDataHeaders.js
2317
+ init_define_import_meta_env();
2224
2318
  var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
2225
2319
  function setFormDataHeaders(headers, formHeaders, policy) {
2226
2320
  if (policy !== "content-only") {
@@ -2463,7 +2557,11 @@ var xhr_default = isXHRAdapterSupported && function(config) {
2463
2557
  });
2464
2558
  };
2465
2559
 
2560
+ // node_modules/axios/lib/adapters/fetch.js
2561
+ init_define_import_meta_env();
2562
+
2466
2563
  // node_modules/axios/lib/helpers/composeSignals.js
2564
+ init_define_import_meta_env();
2467
2565
  var composeSignals = (signals, timeout) => {
2468
2566
  signals = signals ? signals.filter(Boolean) : [];
2469
2567
  if (!timeout && !signals.length) {
@@ -2513,6 +2611,7 @@ var composeSignals = (signals, timeout) => {
2513
2611
  var composeSignals_default = composeSignals;
2514
2612
 
2515
2613
  // node_modules/axios/lib/helpers/trackStream.js
2614
+ init_define_import_meta_env();
2516
2615
  var streamChunk = function* (chunk, chunkSize) {
2517
2616
  let len = chunk.byteLength;
2518
2617
  if (!chunkSize || len < chunkSize) {
@@ -2593,6 +2692,7 @@ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
2593
2692
  };
2594
2693
 
2595
2694
  // node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
2695
+ init_define_import_meta_env();
2596
2696
  var isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
2597
2697
  var isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
2598
2698
  var hexValue = (charCode) => charCode <= 57 ? charCode - 48 : (charCode & 223) - 55;
@@ -2693,6 +2793,7 @@ function estimateDataURLDecodedBytes(url) {
2693
2793
  }
2694
2794
 
2695
2795
  // node_modules/axios/lib/env/data.js
2796
+ init_define_import_meta_env();
2696
2797
  var VERSION = "1.20.0";
2697
2798
 
2698
2799
  // node_modules/axios/lib/adapters/fetch.js
@@ -3269,6 +3370,7 @@ function dispatchRequest(_config) {
3269
3370
  }
3270
3371
 
3271
3372
  // node_modules/axios/lib/helpers/validator.js
3373
+ init_define_import_meta_env();
3272
3374
  var validators = {};
3273
3375
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
3274
3376
  validators[type] = function validator(thing) {
@@ -3554,6 +3656,7 @@ utils_default.forEach(["post", "put", "patch", "query"], function forEachMethodW
3554
3656
  var Axios_default = Axios;
3555
3657
 
3556
3658
  // node_modules/axios/lib/cancel/CancelToken.js
3659
+ init_define_import_meta_env();
3557
3660
  var CancelToken = class _CancelToken {
3558
3661
  constructor(executor) {
3559
3662
  if (typeof executor !== "function") {
@@ -3652,6 +3755,7 @@ var CancelToken = class _CancelToken {
3652
3755
  var CancelToken_default = CancelToken;
3653
3756
 
3654
3757
  // node_modules/axios/lib/helpers/spread.js
3758
+ init_define_import_meta_env();
3655
3759
  function spread(callback) {
3656
3760
  return function wrap(arr) {
3657
3761
  return callback.apply(null, arr);
@@ -3659,11 +3763,13 @@ function spread(callback) {
3659
3763
  }
3660
3764
 
3661
3765
  // node_modules/axios/lib/helpers/isAxiosError.js
3766
+ init_define_import_meta_env();
3662
3767
  function isAxiosError(payload) {
3663
3768
  return utils_default.isObject(payload) && payload.isAxiosError === true;
3664
3769
  }
3665
3770
 
3666
3771
  // node_modules/axios/lib/helpers/HttpStatusCode.js
3772
+ init_define_import_meta_env();
3667
3773
  var HttpStatusCode = {
3668
3774
  Continue: 100,
3669
3775
  SwitchingProtocols: 101,
@@ -3810,6 +3916,7 @@ import { toast } from "sonner";
3810
3916
  import i18n2 from "i18next";
3811
3917
 
3812
3918
  // src/ui/lib/base-path.ts
3919
+ init_define_import_meta_env();
3813
3920
  function getBasePath() {
3814
3921
  const runtime = document.querySelector('meta[name="termix-base-path"]')?.content.trim() || window.__TERMIX_BASE_PATH__;
3815
3922
  if (runtime) {
@@ -3820,7 +3927,14 @@ function getBasePath() {
3820
3927
  return base.endsWith("/") ? base.slice(0, -1) : base;
3821
3928
  }
3822
3929
 
3930
+ // src/ui/shell/TabContext.tsx
3931
+ init_define_import_meta_env();
3932
+
3933
+ // src/ui/shell/tab-registry.ts
3934
+ init_define_import_meta_env();
3935
+
3823
3936
  // src/ui/lib/registry.ts
3937
+ init_define_import_meta_env();
3824
3938
  import { useSyncExternalStore } from "react";
3825
3939
  function createRegistry(sort) {
3826
3940
  const items = /* @__PURE__ */ new Map();
@@ -3871,7 +3985,11 @@ function byOrderThenId(a, b) {
3871
3985
  return (a.order ?? 0) - (b.order ?? 0) || a.id.localeCompare(b.id);
3872
3986
  }
3873
3987
 
3988
+ // src/ui/plugin-host/view-ownership.ts
3989
+ init_define_import_meta_env();
3990
+
3874
3991
  // src/ui/plugin-host/plugin-store.ts
3992
+ init_define_import_meta_env();
3875
3993
  import { useSyncExternalStore as useSyncExternalStore2 } from "react";
3876
3994
  var state = { loaded: false, settled: false, records: /* @__PURE__ */ new Map() };
3877
3995
  var listeners = /* @__PURE__ */ new Set();
@@ -3931,6 +4049,9 @@ function getPluginRecord(pluginId) {
3931
4049
  function knownPluginIds() {
3932
4050
  return [...state.records.keys()];
3933
4051
  }
4052
+ function resetPluginStore() {
4053
+ commit({ loaded: false, settled: false, records: /* @__PURE__ */ new Map() });
4054
+ }
3934
4055
 
3935
4056
  // src/ui/plugin-host/view-ownership.ts
3936
4057
  function declares(record, kind, id) {
@@ -3940,6 +4061,9 @@ function declares(record, kind, id) {
3940
4061
  if (kind === "panel") {
3941
4062
  return !!contributes.panels?.some((panel) => panel.id === id) || !!contributes.tabs?.some((tab) => tab.id === id);
3942
4063
  }
4064
+ if (kind === "layout") {
4065
+ return !!contributes.layouts?.some((layout) => layout.id === id);
4066
+ }
3943
4067
  return !!contributes.dashboardCards?.some((card) => card.id === id);
3944
4068
  }
3945
4069
  function viewOwner(kind, id) {
@@ -3979,6 +4103,29 @@ var getTabType = registry.get;
3979
4103
  var listTabTypes = registry.list;
3980
4104
  var useTabTypes = registry.useList;
3981
4105
  var resetTabTypes = registry.reset;
4106
+ var CORE_PERSISTENT = /* @__PURE__ */ new Set();
4107
+ var CORE_SESSION = /* @__PURE__ */ new Set();
4108
+ var CORE_HOSTLESS = /* @__PURE__ */ new Set(["dashboard"]);
4109
+ function isOwnedButAbsent(type) {
4110
+ return !registry.get(type) && !!viewOwner("tab", type);
4111
+ }
4112
+ function isPersistentTabType(type) {
4113
+ if (CORE_PERSISTENT.has(type)) return true;
4114
+ const def = registry.get(type);
4115
+ if (def) return !!def.persistent;
4116
+ return isOwnedButAbsent(type);
4117
+ }
4118
+ function isSessionTabType(type) {
4119
+ return CORE_SESSION.has(type) || !!registry.get(type)?.session;
4120
+ }
4121
+ function isHostlessTabType(type) {
4122
+ return CORE_HOSTLESS.has(type) || !!registry.get(type)?.hostless;
4123
+ }
4124
+ function canRestoreTabType(type, host) {
4125
+ const def = registry.get(type);
4126
+ if (!host) return isHostlessTabType(type) || isOwnedButAbsent(type);
4127
+ return def?.restore ? def.restore(host) : true;
4128
+ }
3982
4129
  function tabTypeForActivity(activityType) {
3983
4130
  return registry.list().find(
3984
4131
  (def) => def.id === activityType || def.activityTypes?.includes(activityType)
@@ -4268,6 +4415,7 @@ function TabProvider({ children }) {
4268
4415
  }
4269
4416
 
4270
4417
  // src/ui/lib/frontend-logger.ts
4418
+ init_define_import_meta_env();
4271
4419
  var FrontendLogger = class {
4272
4420
  serviceName;
4273
4421
  serviceIcon;
@@ -4535,6 +4683,7 @@ function createFrontendLogger(serviceName, serviceIcon = "\u{1F9E9}", serviceCol
4535
4683
  }
4536
4684
 
4537
4685
  // src/ui/lib/db-health-monitor.ts
4686
+ init_define_import_meta_env();
4538
4687
  var DatabaseHealthMonitor = class _DatabaseHealthMonitor {
4539
4688
  static instance;
4540
4689
  listeners = /* @__PURE__ */ new Map();
@@ -4608,6 +4757,7 @@ var DatabaseHealthMonitor = class _DatabaseHealthMonitor {
4608
4757
  var dbHealthMonitor = DatabaseHealthMonitor.getInstance();
4609
4758
 
4610
4759
  // src/ui/lib/device-id.ts
4760
+ init_define_import_meta_env();
4611
4761
  var DEVICE_ID_STORAGE_KEY = "termixDeviceId";
4612
4762
  var DEVICE_ID_PATTERN = /^[a-f0-9]{64}$/;
4613
4763
  function createDeviceId() {
@@ -4629,10 +4779,18 @@ function getDeviceId() {
4629
4779
  }
4630
4780
  }
4631
4781
 
4782
+ // src/ui/api/ssh-host-management-api.ts
4783
+ init_define_import_meta_env();
4784
+
4785
+ // src/ui/lib/hosts-request-cache.ts
4786
+ init_define_import_meta_env();
4787
+
4632
4788
  // src/ui/lib/sync-events.ts
4789
+ init_define_import_meta_env();
4633
4790
  var SYNC_CHANGED_EVENT = "termix:sync-changed";
4634
4791
 
4635
4792
  // src/ui/lib/ttl-request-cache.ts
4793
+ init_define_import_meta_env();
4636
4794
  function createTtlRequestCache(ttlMs) {
4637
4795
  let cached2 = null;
4638
4796
  let inflight2 = null;
@@ -4691,6 +4849,18 @@ function getCachedSSHHosts(loader) {
4691
4849
  bindInvalidationListeners();
4692
4850
  return hostsCache.get(loader);
4693
4851
  }
4852
+ function getCachedServerStatuses(loader) {
4853
+ return statusCache.get(loader);
4854
+ }
4855
+ function invalidateServerStatusCache() {
4856
+ statusCache.invalidate();
4857
+ }
4858
+ function getCachedSSHFolders(loader) {
4859
+ return foldersCache.get(loader);
4860
+ }
4861
+ function invalidateSSHFoldersCache() {
4862
+ foldersCache.invalidate();
4863
+ }
4694
4864
  function invalidateHostsAndStatusCaches() {
4695
4865
  hostsCache.invalidate();
4696
4866
  statusCache.invalidate();
@@ -4710,8 +4880,120 @@ async function getSSHHosts() {
4710
4880
  throw handleApiError(error, "fetch SSH hosts");
4711
4881
  }
4712
4882
  }
4883
+ async function createSSHHost(hostData) {
4884
+ try {
4885
+ if (hostData.authType === "key" && hostData.key instanceof File) {
4886
+ const formData = new FormData();
4887
+ formData.append("key", hostData.key);
4888
+ const dataWithoutFile = { ...hostData, key: void 0 };
4889
+ formData.append("data", JSON.stringify(dataWithoutFile));
4890
+ const response2 = await sshHostApi.post("/db/host", formData, {
4891
+ headers: { "Content-Type": "multipart/form-data" }
4892
+ });
4893
+ invalidateHostsAndStatusCaches();
4894
+ return response2.data;
4895
+ }
4896
+ const response = await sshHostApi.post("/db/host", hostData);
4897
+ invalidateHostsAndStatusCaches();
4898
+ return response.data;
4899
+ } catch (error) {
4900
+ throw handleApiError(error, "create SSH host");
4901
+ }
4902
+ }
4903
+ async function updateSSHHost(hostId, hostData) {
4904
+ try {
4905
+ if (hostData.authType === "key" && hostData.key instanceof File) {
4906
+ const formData = new FormData();
4907
+ formData.append("key", hostData.key);
4908
+ const dataWithoutFile = { ...hostData, key: void 0 };
4909
+ formData.append("data", JSON.stringify(dataWithoutFile));
4910
+ const response2 = await sshHostApi.put(`/db/host/${hostId}`, formData, {
4911
+ headers: { "Content-Type": "multipart/form-data" }
4912
+ });
4913
+ invalidateHostsAndStatusCaches();
4914
+ return response2.data;
4915
+ }
4916
+ const response = await sshHostApi.put(`/db/host/${hostId}`, hostData);
4917
+ invalidateHostsAndStatusCaches();
4918
+ return response.data;
4919
+ } catch (error) {
4920
+ throw handleApiError(error, "update SSH host");
4921
+ }
4922
+ }
4923
+ async function bulkImportSSHHosts(hosts, overwrite = false, credentials) {
4924
+ try {
4925
+ const response = await sshHostApi.post("/bulk-import", {
4926
+ hosts,
4927
+ overwrite,
4928
+ ...credentials ? { credentials } : {}
4929
+ });
4930
+ invalidateHostsAndStatusCaches();
4931
+ return response.data;
4932
+ } catch (error) {
4933
+ handleApiError(error, "bulk import SSH hosts");
4934
+ }
4935
+ }
4936
+ async function importSSHConfigHosts(content, overwrite = false) {
4937
+ try {
4938
+ const response = await sshHostApi.post("/ssh-config-import", {
4939
+ content,
4940
+ overwrite
4941
+ });
4942
+ invalidateHostsAndStatusCaches();
4943
+ return response.data;
4944
+ } catch (error) {
4945
+ handleApiError(error, "import SSH config hosts");
4946
+ }
4947
+ }
4948
+ async function bulkUpdateSSHHosts(hostIds, updates) {
4949
+ try {
4950
+ const response = await sshHostApi.patch("/bulk-update", {
4951
+ hostIds,
4952
+ updates
4953
+ });
4954
+ invalidateHostsAndStatusCaches();
4955
+ return response.data;
4956
+ } catch (error) {
4957
+ handleApiError(error, "bulk update SSH hosts");
4958
+ }
4959
+ }
4960
+ async function reorderSSHHosts(positions) {
4961
+ try {
4962
+ const response = await sshHostApi.put("/reorder", { positions });
4963
+ invalidateHostsAndStatusCaches();
4964
+ return response.data;
4965
+ } catch (error) {
4966
+ handleApiError(error, "reorder SSH hosts");
4967
+ }
4968
+ }
4969
+ async function deleteSSHHost(hostId) {
4970
+ try {
4971
+ const response = await sshHostApi.delete(`/db/host/${hostId}`);
4972
+ invalidateHostsAndStatusCaches();
4973
+ return response.data;
4974
+ } catch (error) {
4975
+ handleApiError(error, "delete SSH host");
4976
+ }
4977
+ }
4978
+ async function exportAllSSHHosts(options) {
4979
+ try {
4980
+ const response = await sshHostApi.get(
4981
+ options?.share ? "/db/hosts/export?share=1" : "/db/hosts/export"
4982
+ );
4983
+ return response.data;
4984
+ } catch (error) {
4985
+ handleApiError(error, "export all SSH hosts");
4986
+ }
4987
+ }
4988
+
4989
+ // src/ui/api/host-status-api.ts
4990
+ init_define_import_meta_env();
4991
+
4992
+ // src/ui/lib/connection-origin.ts
4993
+ init_define_import_meta_env();
4713
4994
 
4714
4995
  // src/ui/lib/ws-auth.ts
4996
+ init_define_import_meta_env();
4715
4997
  var JWT_PROTOCOL_PREFIX = "termix.jwt.";
4716
4998
  function websocketAuthProtocols(token) {
4717
4999
  return token ? [`${JWT_PROTOCOL_PREFIX}${token}`] : [];
@@ -4765,7 +5047,416 @@ async function buildOriginWsUrl({
4765
5047
  };
4766
5048
  }
4767
5049
 
5050
+ // src/ui/api/host-status-api.ts
5051
+ var STATUS_RETRY_SCHEDULE = [
5052
+ { timeoutMs: 2e3, pauseAfterMs: 3e3 },
5053
+ { timeoutMs: 5e3, pauseAfterMs: 5e3 },
5054
+ { timeoutMs: 8e3, pauseAfterMs: null }
5055
+ ];
5056
+ function isTransientStatusError(error) {
5057
+ if (!axios_default.isAxiosError(error)) return false;
5058
+ if (error.response) {
5059
+ return false;
5060
+ }
5061
+ const code = error.code;
5062
+ if (!code) {
5063
+ return true;
5064
+ }
5065
+ return code === "ECONNABORTED" || code === "ETIMEDOUT" || code === "ERR_NETWORK" || code === "ECONNREFUSED" || code === "ECONNRESET";
5066
+ }
5067
+ async function getAllServerStatuses() {
5068
+ return getCachedServerStatuses(async () => {
5069
+ let lastError = null;
5070
+ let localStatuses = {};
5071
+ let localHostIds = null;
5072
+ let remoteHostsBySyncId = null;
5073
+ if (isElectron()) {
5074
+ const response = await sshHostApi.get("/db/host");
5075
+ const defaultOrigin = await resolveConnectionOrigin({
5076
+ connectionOrigin: null
5077
+ });
5078
+ const hosts = response.data || [];
5079
+ localHostIds = hosts.filter((host) => (host.connectionOrigin ?? defaultOrigin) === "local").map((host) => host.id);
5080
+ remoteHostsBySyncId = new Map(
5081
+ hosts.filter(
5082
+ (host) => (host.connectionOrigin ?? defaultOrigin) === "remote" && !!host.syncId
5083
+ ).map((host) => [host.syncId, host.id])
5084
+ );
5085
+ }
5086
+ for (let i = 0; i < STATUS_RETRY_SCHEDULE.length; i++) {
5087
+ const { timeoutMs, pauseAfterMs } = STATUS_RETRY_SCHEDULE[i];
5088
+ const isFinalAttempt = i === STATUS_RETRY_SCHEDULE.length - 1;
5089
+ try {
5090
+ const response = await sshHostApi.get("/status", {
5091
+ timeout: timeoutMs,
5092
+ ...localHostIds === null ? {} : { params: { hostIds: localHostIds.join(",") } },
5093
+ // Silence per-attempt interceptor logging & health-monitor side
5094
+ // effects on all attempts except the final one, so background
5095
+ // blips don't look like real outages.
5096
+ __silentRetry: !isFinalAttempt
5097
+ });
5098
+ localStatuses = response.data || {};
5099
+ lastError = null;
5100
+ break;
5101
+ } catch (error) {
5102
+ lastError = error;
5103
+ if (!isTransientStatusError(error)) {
5104
+ break;
5105
+ }
5106
+ if (pauseAfterMs === null) {
5107
+ break;
5108
+ }
5109
+ await new Promise((resolve) => setTimeout(resolve, pauseAfterMs));
5110
+ }
5111
+ }
5112
+ if (lastError) handleApiError(lastError, "fetch server statuses");
5113
+ if (remoteHostsBySyncId?.size && await getLinkedSession()) {
5114
+ try {
5115
+ const remoteResult = await getRemoteCoreApi().get(
5116
+ "/sync/v2/host-status",
5117
+ {
5118
+ timeout: 8e3,
5119
+ __silentRetry: true
5120
+ }
5121
+ );
5122
+ const merged = { ...localStatuses };
5123
+ for (const [syncId, status] of Object.entries(
5124
+ remoteResult.data || {}
5125
+ )) {
5126
+ const localId = remoteHostsBySyncId.get(syncId);
5127
+ if (localId !== void 0) merged[localId] = status;
5128
+ }
5129
+ return merged;
5130
+ } catch {
5131
+ }
5132
+ }
5133
+ return localStatuses;
5134
+ });
5135
+ }
5136
+ async function getStatusCheckSettings() {
5137
+ try {
5138
+ const response = await sshHostApi.get("/status/settings");
5139
+ return response.data;
5140
+ } catch (error) {
5141
+ handleApiError(error, "fetch status check settings");
5142
+ }
5143
+ }
5144
+ async function updateStatusCheckSettings(settings) {
5145
+ try {
5146
+ await sshHostApi.put("/status/settings", settings);
5147
+ } catch (error) {
5148
+ handleApiError(error, "update status check settings");
5149
+ }
5150
+ }
5151
+
5152
+ // src/ui/api/host-sidebar-preferences-api.ts
5153
+ init_define_import_meta_env();
5154
+
5155
+ // src/types/host-sidebar-preferences.ts
5156
+ init_define_import_meta_env();
5157
+ var HOST_SIDEBAR_PREFS_VERSION = 1;
5158
+ var HOST_ROW_FIELD_KEYS = [
5159
+ "showAddress",
5160
+ "showUsername",
5161
+ "showPort",
5162
+ "showPinIcon",
5163
+ "showSharedBadge",
5164
+ "showBadges"
5165
+ ];
5166
+ function defaultHostRowFields() {
5167
+ return {
5168
+ showAddress: true,
5169
+ showUsername: true,
5170
+ showPort: false,
5171
+ showPinIcon: true,
5172
+ showSharedBadge: true,
5173
+ showBadges: true
5174
+ };
5175
+ }
5176
+ var GROUP_KEYS = [
5177
+ "folder",
5178
+ "tag",
5179
+ "status",
5180
+ "protocol",
5181
+ "auth"
5182
+ ];
5183
+ var SORT_KEYS = [
5184
+ "default",
5185
+ "name-asc",
5186
+ "name-desc",
5187
+ "ip-asc",
5188
+ "ip-desc",
5189
+ "status-online",
5190
+ "status-offline",
5191
+ "manual"
5192
+ ];
5193
+ var DENSITIES = ["comfortable", "compact"];
5194
+ var TRAY_TRIGGERS = [
5195
+ "always",
5196
+ "hover",
5197
+ "click",
5198
+ "actionsOnly"
5199
+ ];
5200
+ var HOST_CLICK_BEHAVIORS = [
5201
+ "newTab",
5202
+ "focusExisting",
5203
+ "focusExistingDoubleClickNew"
5204
+ ];
5205
+ var STATUS_COLOR_SCHEMES = ["accent", "status"];
5206
+ var FILTER_STATUS = [
5207
+ "online",
5208
+ "offline",
5209
+ "pinned"
5210
+ ];
5211
+ var AUTH_TYPE_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
5212
+ function defaultHostSidebarPreferences() {
5213
+ return {
5214
+ version: HOST_SIDEBAR_PREFS_VERSION,
5215
+ sort: { key: "default", pinnedFirst: false },
5216
+ groupKey: "folder",
5217
+ filters: {
5218
+ status: [],
5219
+ authType: [],
5220
+ protocol: [],
5221
+ features: [],
5222
+ tags: []
5223
+ },
5224
+ openFolders: [],
5225
+ display: {
5226
+ density: "comfortable",
5227
+ showTags: true,
5228
+ trayTrigger: "always",
5229
+ statusColorScheme: "accent",
5230
+ openOnDoubleClick: false,
5231
+ showFolderPaths: true,
5232
+ hostClickBehavior: "newTab",
5233
+ closeOnOpen: false,
5234
+ barActions: {},
5235
+ ...defaultHostRowFields()
5236
+ }
5237
+ };
5238
+ }
5239
+ var ACTION_ID_PATTERN = /^[a-z0-9][a-z0-9._:-]{0,79}$/;
5240
+ function sanitizeBarActions(input) {
5241
+ if (!input || typeof input !== "object" || Array.isArray(input)) return {};
5242
+ const out = {};
5243
+ for (const [id, value] of Object.entries(input)) {
5244
+ if (ACTION_ID_PATTERN.test(id) && typeof value === "boolean") {
5245
+ out[id] = value;
5246
+ }
5247
+ }
5248
+ return out;
5249
+ }
5250
+ function sanitizeStringArray(input) {
5251
+ if (!Array.isArray(input)) return [];
5252
+ return input.filter((v) => typeof v === "string");
5253
+ }
5254
+ function sanitizeEnumArray(input, allowed) {
5255
+ if (!Array.isArray(input)) return [];
5256
+ return input.filter((v) => allowed.includes(v));
5257
+ }
5258
+ function sanitizeHostSidebarPreferences(input) {
5259
+ const defaults2 = defaultHostSidebarPreferences();
5260
+ if (!input || typeof input !== "object") return defaults2;
5261
+ const obj = input;
5262
+ const sortObj = obj.sort ?? {};
5263
+ const sort = {
5264
+ key: SORT_KEYS.includes(sortObj.key) ? sortObj.key : defaults2.sort.key,
5265
+ pinnedFirst: typeof sortObj.pinnedFirst === "boolean" ? sortObj.pinnedFirst : defaults2.sort.pinnedFirst
5266
+ };
5267
+ const groupKey = GROUP_KEYS.includes(obj.groupKey) ? obj.groupKey : defaults2.groupKey;
5268
+ const filtersObj = obj.filters ?? {};
5269
+ const filters = {
5270
+ status: sanitizeEnumArray(filtersObj.status, FILTER_STATUS),
5271
+ authType: sanitizeStringArray(filtersObj.authType).filter(
5272
+ (value) => AUTH_TYPE_PATTERN.test(value)
5273
+ ),
5274
+ protocol: sanitizeStringArray(filtersObj.protocol).filter(
5275
+ (value) => AUTH_TYPE_PATTERN.test(value)
5276
+ ),
5277
+ features: sanitizeStringArray(filtersObj.features).filter(
5278
+ (value) => AUTH_TYPE_PATTERN.test(value)
5279
+ ),
5280
+ tags: sanitizeStringArray(filtersObj.tags)
5281
+ };
5282
+ const openFolders = sanitizeStringArray(obj.openFolders);
5283
+ const displayObj = obj.display ?? {};
5284
+ const rowFields = {};
5285
+ for (const key of HOST_ROW_FIELD_KEYS) {
5286
+ rowFields[key] = typeof displayObj[key] === "boolean" ? displayObj[key] : defaults2.display[key];
5287
+ }
5288
+ const display = {
5289
+ ...rowFields,
5290
+ density: DENSITIES.includes(displayObj.density) ? displayObj.density : defaults2.display.density,
5291
+ showTags: typeof displayObj.showTags === "boolean" ? displayObj.showTags : defaults2.display.showTags,
5292
+ trayTrigger: TRAY_TRIGGERS.includes(
5293
+ displayObj.trayTrigger
5294
+ ) ? displayObj.trayTrigger : defaults2.display.trayTrigger,
5295
+ statusColorScheme: STATUS_COLOR_SCHEMES.includes(
5296
+ displayObj.statusColorScheme
5297
+ ) ? displayObj.statusColorScheme : defaults2.display.statusColorScheme,
5298
+ openOnDoubleClick: typeof displayObj.openOnDoubleClick === "boolean" ? displayObj.openOnDoubleClick : defaults2.display.openOnDoubleClick,
5299
+ showFolderPaths: typeof displayObj.showFolderPaths === "boolean" ? displayObj.showFolderPaths : defaults2.display.showFolderPaths,
5300
+ hostClickBehavior: HOST_CLICK_BEHAVIORS.includes(
5301
+ displayObj.hostClickBehavior
5302
+ ) ? displayObj.hostClickBehavior : defaults2.display.hostClickBehavior,
5303
+ closeOnOpen: typeof displayObj.closeOnOpen === "boolean" ? displayObj.closeOnOpen : defaults2.display.closeOnOpen,
5304
+ barActions: sanitizeBarActions(displayObj.barActions)
5305
+ };
5306
+ return {
5307
+ version: HOST_SIDEBAR_PREFS_VERSION,
5308
+ sort,
5309
+ groupKey,
5310
+ filters,
5311
+ openFolders,
5312
+ display
5313
+ };
5314
+ }
5315
+
5316
+ // src/ui/api/host-sidebar-preferences-api.ts
5317
+ async function getHostSidebarPreferences() {
5318
+ try {
5319
+ const response = await authApi.get("/host-sidebar/preferences");
5320
+ return sanitizeHostSidebarPreferences(response.data?.preferences);
5321
+ } catch (error) {
5322
+ handleApiError(error, "fetch host sidebar preferences");
5323
+ throw error;
5324
+ }
5325
+ }
5326
+ async function saveHostSidebarPreferences(preferences) {
5327
+ try {
5328
+ await authApi.put("/host-sidebar/preferences", preferences);
5329
+ } catch (error) {
5330
+ handleApiError(error, "save host sidebar preferences");
5331
+ throw error;
5332
+ }
5333
+ }
5334
+
5335
+ // src/ui/api/credential-sidebar-preferences-api.ts
5336
+ init_define_import_meta_env();
5337
+
5338
+ // src/types/credential-sidebar-preferences.ts
5339
+ init_define_import_meta_env();
5340
+ var CREDENTIAL_SIDEBAR_PREFS_VERSION = 1;
5341
+ var CREDENTIAL_ROW_FIELD_KEYS = [
5342
+ "showUsername",
5343
+ "showUsageCount",
5344
+ "showTypeBadge",
5345
+ "showPinIcon",
5346
+ "showSharedBadge"
5347
+ ];
5348
+ function defaultCredentialRowFields() {
5349
+ return {
5350
+ showUsername: true,
5351
+ showUsageCount: true,
5352
+ showTypeBadge: true,
5353
+ showPinIcon: true,
5354
+ showSharedBadge: true
5355
+ };
5356
+ }
5357
+ var SORT_KEYS2 = [
5358
+ "default",
5359
+ "name-asc",
5360
+ "name-desc",
5361
+ "username-asc",
5362
+ "username-desc",
5363
+ "manual"
5364
+ ];
5365
+ var DENSITIES2 = ["comfortable", "compact"];
5366
+ var TRAY_TRIGGERS2 = [
5367
+ "always",
5368
+ "hover",
5369
+ "click",
5370
+ "actionsOnly"
5371
+ ];
5372
+ var TYPE_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
5373
+ function defaultCredentialSidebarPreferences() {
5374
+ return {
5375
+ version: CREDENTIAL_SIDEBAR_PREFS_VERSION,
5376
+ sort: { key: "default", pinnedFirst: false },
5377
+ filters: {
5378
+ type: [],
5379
+ tags: []
5380
+ },
5381
+ openFolders: [],
5382
+ display: {
5383
+ density: "comfortable",
5384
+ showTags: true,
5385
+ trayTrigger: "always",
5386
+ ...defaultCredentialRowFields()
5387
+ }
5388
+ };
5389
+ }
5390
+ function sanitizeStringArray2(input) {
5391
+ if (!Array.isArray(input)) return [];
5392
+ return input.filter((v) => typeof v === "string");
5393
+ }
5394
+ function sanitizeCredentialSidebarPreferences(input) {
5395
+ const defaults2 = defaultCredentialSidebarPreferences();
5396
+ if (!input || typeof input !== "object") return defaults2;
5397
+ const obj = input;
5398
+ const sortObj = obj.sort ?? {};
5399
+ const sort = {
5400
+ key: SORT_KEYS2.includes(sortObj.key) ? sortObj.key : defaults2.sort.key,
5401
+ pinnedFirst: typeof sortObj.pinnedFirst === "boolean" ? sortObj.pinnedFirst : defaults2.sort.pinnedFirst
5402
+ };
5403
+ const filtersObj = obj.filters ?? {};
5404
+ const filters = {
5405
+ type: sanitizeStringArray2(filtersObj.type).filter(
5406
+ (value) => TYPE_PATTERN.test(value)
5407
+ ),
5408
+ tags: sanitizeStringArray2(filtersObj.tags)
5409
+ };
5410
+ const openFolders = sanitizeStringArray2(obj.openFolders);
5411
+ const displayObj = obj.display ?? {};
5412
+ const rowFields = {};
5413
+ for (const key of CREDENTIAL_ROW_FIELD_KEYS) {
5414
+ rowFields[key] = typeof displayObj[key] === "boolean" ? displayObj[key] : defaults2.display[key];
5415
+ }
5416
+ const display = {
5417
+ ...rowFields,
5418
+ density: DENSITIES2.includes(displayObj.density) ? displayObj.density : defaults2.display.density,
5419
+ showTags: typeof displayObj.showTags === "boolean" ? displayObj.showTags : defaults2.display.showTags,
5420
+ trayTrigger: TRAY_TRIGGERS2.includes(
5421
+ displayObj.trayTrigger
5422
+ ) ? displayObj.trayTrigger : defaults2.display.trayTrigger
5423
+ };
5424
+ return {
5425
+ version: CREDENTIAL_SIDEBAR_PREFS_VERSION,
5426
+ sort,
5427
+ filters,
5428
+ openFolders,
5429
+ display
5430
+ };
5431
+ }
5432
+
5433
+ // src/ui/api/credential-sidebar-preferences-api.ts
5434
+ async function getCredentialSidebarPreferences() {
5435
+ try {
5436
+ const response = await authApi.get("/credential-sidebar/preferences");
5437
+ return sanitizeCredentialSidebarPreferences(response.data?.preferences);
5438
+ } catch (error) {
5439
+ handleApiError(error, "fetch credential sidebar preferences");
5440
+ throw error;
5441
+ }
5442
+ }
5443
+ async function saveCredentialSidebarPreferences(preferences) {
5444
+ try {
5445
+ await authApi.put("/credential-sidebar/preferences", preferences);
5446
+ } catch (error) {
5447
+ handleApiError(error, "save credential sidebar preferences");
5448
+ throw error;
5449
+ }
5450
+ }
5451
+
5452
+ // src/ui/api/ui-preferences-api.ts
5453
+ init_define_import_meta_env();
5454
+
5455
+ // src/types/ui-preferences.ts
5456
+ init_define_import_meta_env();
5457
+
4768
5458
  // src/types/onboarding.ts
5459
+ init_define_import_meta_env();
4769
5460
  var LEGACY_SEEN = Object.freeze({
4770
5461
  plugins: 1,
4771
5462
  "desktop-sync": 1,
@@ -4900,19 +5591,72 @@ var AREA_SPECS = {
4900
5591
  };
4901
5592
  var UI_AREA_KEYS = Object.keys(AREA_SPECS);
4902
5593
 
4903
- // src/ui/lib/remote-server-api.ts
4904
- async function hydrateLocalSharedHostAuth(host) {
4905
- return host;
5594
+ // src/ui/api/settings-api.ts
5595
+ init_define_import_meta_env();
5596
+ async function getLogLevel() {
5597
+ try {
5598
+ const response = await authApi.get("/users/log-level");
5599
+ return response.data;
5600
+ } catch (error) {
5601
+ handleApiError(error, "fetch log level");
5602
+ }
4906
5603
  }
4907
- async function getConnectedRemoteApi() {
4908
- return await getLinkedSession() ? getRemoteCoreApi() : null;
5604
+ async function updateLogLevel(level) {
5605
+ try {
5606
+ await authApi.patch("/users/log-level", { level });
5607
+ } catch (error) {
5608
+ handleApiError(error, "update log level");
5609
+ }
4909
5610
  }
4910
- async function resolveRemoteHostId(syncId) {
4911
- if (!syncId) return null;
4912
- const api = await getConnectedRemoteApi();
4913
- if (!api) return null;
5611
+ async function getSessionTimeout() {
4914
5612
  try {
4915
- const response = await api.get(
5613
+ const response = await authApi.get("/users/session-timeout");
5614
+ return response.data;
5615
+ } catch (error) {
5616
+ handleApiError(error, "fetch session timeout");
5617
+ }
5618
+ }
5619
+ async function updateSessionTimeout(timeoutHours) {
5620
+ try {
5621
+ await authApi.patch("/users/session-timeout", { timeoutHours });
5622
+ } catch (error) {
5623
+ handleApiError(error, "update session timeout");
5624
+ }
5625
+ }
5626
+ async function getBranding() {
5627
+ try {
5628
+ const response = await authApi.get("/users/branding");
5629
+ return response.data;
5630
+ } catch (error) {
5631
+ handleApiError(error, "fetch branding settings");
5632
+ }
5633
+ }
5634
+ async function updateBranding(update) {
5635
+ try {
5636
+ const response = await authApi.patch("/users/branding", update);
5637
+ return response.data;
5638
+ } catch (error) {
5639
+ handleApiError(error, "update branding settings");
5640
+ }
5641
+ }
5642
+
5643
+ // src/ui/api/user-management-api.ts
5644
+ init_define_import_meta_env();
5645
+
5646
+ // src/ui/lib/remote-server-api.ts
5647
+ init_define_import_meta_env();
5648
+ async function hydrateLocalSharedHostAuth(host) {
5649
+ return host;
5650
+ }
5651
+ async function getConnectedRemoteApi() {
5652
+ return await getLinkedSession() ? getRemoteCoreApi() : null;
5653
+ }
5654
+ async function resolveRemoteHostId(syncId) {
5655
+ if (!syncId) return null;
5656
+ const api = await getConnectedRemoteApi();
5657
+ if (!api) return null;
5658
+ try {
5659
+ const response = await api.get(
4916
5660
  `/sync/v2/hosts/${encodeURIComponent(syncId)}`
4917
5661
  );
4918
5662
  return typeof response.data?.id === "number" ? response.data.id : null;
@@ -4922,6 +5666,190 @@ async function resolveRemoteHostId(syncId) {
4922
5666
  }
4923
5667
 
4924
5668
  // src/ui/api/user-management-api.ts
5669
+ async function getUserList(options = {}) {
5670
+ try {
5671
+ const api = await getConnectedRemoteApi() ?? authApi;
5672
+ const response = await api.get("/users/list", {
5673
+ params: {
5674
+ ...options.search ? { search: options.search } : {},
5675
+ ...options.limit ? { limit: options.limit } : {},
5676
+ ...options.offset ? { offset: options.offset } : {}
5677
+ }
5678
+ });
5679
+ return response.data;
5680
+ } catch (error) {
5681
+ handleApiError(error, "fetch user list");
5682
+ }
5683
+ }
5684
+ async function getSessions() {
5685
+ try {
5686
+ const response = await authApi.get("/users/sessions");
5687
+ return response.data;
5688
+ } catch (error) {
5689
+ handleApiError(error, "fetch sessions");
5690
+ }
5691
+ }
5692
+ async function revokeSession(sessionId) {
5693
+ try {
5694
+ const response = await authApi.delete(`/users/sessions/${sessionId}`);
5695
+ return response.data;
5696
+ } catch (error) {
5697
+ handleApiError(error, "revoke session");
5698
+ }
5699
+ }
5700
+ async function revokeAllUserSessions(userId) {
5701
+ try {
5702
+ const response = await authApi.post("/users/sessions/revoke-all", {
5703
+ targetUserId: userId,
5704
+ exceptCurrent: false
5705
+ });
5706
+ return response.data;
5707
+ } catch (error) {
5708
+ handleApiError(error, "revoke all user sessions");
5709
+ }
5710
+ }
5711
+ async function createApiKey(name, userId, expiresAt) {
5712
+ try {
5713
+ const response = await authApi.post("/users/api-keys", {
5714
+ name,
5715
+ userId,
5716
+ expiresAt: expiresAt ?? null
5717
+ });
5718
+ return response.data;
5719
+ } catch (error) {
5720
+ handleApiError(error, "create API key");
5721
+ }
5722
+ }
5723
+ async function getApiKeys() {
5724
+ try {
5725
+ const response = await authApi.get("/users/api-keys");
5726
+ return response.data;
5727
+ } catch (error) {
5728
+ handleApiError(error, "fetch API keys");
5729
+ }
5730
+ }
5731
+ async function deleteApiKey(keyId) {
5732
+ try {
5733
+ const response = await authApi.delete(`/users/api-keys/${keyId}`);
5734
+ return response.data;
5735
+ } catch (error) {
5736
+ handleApiError(error, "delete API key");
5737
+ }
5738
+ }
5739
+ async function makeUserAdmin(userId) {
5740
+ try {
5741
+ const response = await authApi.post("/users/make-admin", { userId });
5742
+ return response.data;
5743
+ } catch (error) {
5744
+ handleApiError(error, "make user admin");
5745
+ }
5746
+ }
5747
+ async function removeAdminStatus(userId) {
5748
+ try {
5749
+ const response = await authApi.post("/users/remove-admin", { userId });
5750
+ return response.data;
5751
+ } catch (error) {
5752
+ handleApiError(error, "remove admin status");
5753
+ }
5754
+ }
5755
+ async function deleteUser(username, successorUserId) {
5756
+ try {
5757
+ const response = await authApi.delete("/users/delete-user", {
5758
+ data: { username, successorUserId }
5759
+ });
5760
+ return response.data;
5761
+ } catch (error) {
5762
+ handleApiError(error, "delete user");
5763
+ }
5764
+ }
5765
+ async function deleteAccount(password) {
5766
+ try {
5767
+ const response = await authApi.delete("/users/delete-account", {
5768
+ data: { password }
5769
+ });
5770
+ return response.data;
5771
+ } catch (error) {
5772
+ handleApiError(error, "delete account");
5773
+ }
5774
+ }
5775
+ async function adminResetUserPassword(userId, newPassword, confirmDataWipe = false) {
5776
+ const response = await authApi.post("/users/admin/reset-password", {
5777
+ userId,
5778
+ newPassword,
5779
+ confirmDataWipe
5780
+ });
5781
+ return response.data;
5782
+ }
5783
+ async function adminExportUserData(userId) {
5784
+ try {
5785
+ const response = await authApi.get(
5786
+ `/users/admin/export/${encodeURIComponent(userId)}`,
5787
+ { timeout: 12e4 }
5788
+ );
5789
+ return response.data;
5790
+ } catch (error) {
5791
+ handleApiError(error, "export user data");
5792
+ }
5793
+ }
5794
+ async function updateRegistrationAllowed(allowed) {
5795
+ try {
5796
+ const response = await authApi.patch("/users/registration-allowed", {
5797
+ allowed
5798
+ });
5799
+ return response.data;
5800
+ } catch (error) {
5801
+ handleApiError(error, "update registration allowed");
5802
+ }
5803
+ }
5804
+ async function getExternalAutoProvision() {
5805
+ try {
5806
+ const response = await authApi.get("/users/external-auto-provision");
5807
+ return response.data;
5808
+ } catch (error) {
5809
+ handleApiError(error, "check OIDC auto-provision status");
5810
+ }
5811
+ }
5812
+ async function updateExternalAutoProvision(enabled) {
5813
+ try {
5814
+ const response = await authApi.patch("/users/external-auto-provision", {
5815
+ enabled
5816
+ });
5817
+ return response.data;
5818
+ } catch (error) {
5819
+ handleApiError(error, "update OIDC auto-provision");
5820
+ }
5821
+ }
5822
+ async function getSecondFactorAfterExternalLogin() {
5823
+ try {
5824
+ const response = await authApi.get(
5825
+ "/users/second-factor-after-external-login"
5826
+ );
5827
+ return response.data;
5828
+ } catch (error) {
5829
+ handleApiError(error, "check second factor after external login status");
5830
+ }
5831
+ }
5832
+ async function updateSecondFactorAfterExternalLogin(enabled) {
5833
+ try {
5834
+ const response = await authApi.patch(
5835
+ "/users/second-factor-after-external-login",
5836
+ { enabled }
5837
+ );
5838
+ return response.data;
5839
+ } catch (error) {
5840
+ handleApiError(error, "update second factor after external login");
5841
+ }
5842
+ }
5843
+ async function updatePasswordLoginAllowed(allowed) {
5844
+ try {
5845
+ const response = await authApi.patch("/users/password-login-allowed", {
5846
+ allowed
5847
+ });
5848
+ return response.data;
5849
+ } catch (error) {
5850
+ handleApiError(error, "update password login allowed");
5851
+ }
5852
+ }
4925
5853
  async function getPasswordResetAllowed() {
4926
5854
  try {
4927
5855
  const response = await authApi.get("/users/password-reset-allowed");
@@ -4930,8 +5858,148 @@ async function getPasswordResetAllowed() {
4930
5858
  handleApiError(error, "get password reset allowed");
4931
5859
  }
4932
5860
  }
5861
+ async function updatePasswordResetAllowed(allowed) {
5862
+ try {
5863
+ const response = await authApi.patch("/users/password-reset-allowed", {
5864
+ allowed
5865
+ });
5866
+ return response.data;
5867
+ } catch (error) {
5868
+ handleApiError(error, "update password reset allowed");
5869
+ }
5870
+ }
5871
+
5872
+ // src/ui/api/admin-user-data-api.ts
5873
+ init_define_import_meta_env();
5874
+ var ADMIN_TARGET_USER_HEADER = "X-Admin-Target-User";
5875
+ function adminHeaders(targetUserId) {
5876
+ return { [ADMIN_TARGET_USER_HEADER]: targetUserId };
5877
+ }
5878
+ async function adminGetUserHosts(targetUserId) {
5879
+ try {
5880
+ const response = await sshHostApi.get("/db/host", {
5881
+ headers: adminHeaders(targetUserId)
5882
+ });
5883
+ return Array.isArray(response.data) ? response.data : [];
5884
+ } catch (error) {
5885
+ throw handleApiError(error, "fetch user's hosts");
5886
+ }
5887
+ }
5888
+ async function adminCreateUserHost(targetUserId, hostData) {
5889
+ try {
5890
+ if (hostData.authType === "key" && hostData.key instanceof File) {
5891
+ const formData = new FormData();
5892
+ formData.append("key", hostData.key);
5893
+ const dataWithoutFile = { ...hostData, key: void 0 };
5894
+ formData.append("data", JSON.stringify(dataWithoutFile));
5895
+ const response2 = await sshHostApi.post("/db/host", formData, {
5896
+ headers: {
5897
+ "Content-Type": "multipart/form-data",
5898
+ ...adminHeaders(targetUserId)
5899
+ }
5900
+ });
5901
+ return response2.data;
5902
+ }
5903
+ const response = await sshHostApi.post("/db/host", hostData, {
5904
+ headers: adminHeaders(targetUserId)
5905
+ });
5906
+ return response.data;
5907
+ } catch (error) {
5908
+ throw handleApiError(error, "create host for user");
5909
+ }
5910
+ }
5911
+ async function adminUpdateUserHost(targetUserId, hostId, hostData) {
5912
+ try {
5913
+ if (hostData.authType === "key" && hostData.key instanceof File) {
5914
+ const formData = new FormData();
5915
+ formData.append("key", hostData.key);
5916
+ const dataWithoutFile = { ...hostData, key: void 0 };
5917
+ formData.append("data", JSON.stringify(dataWithoutFile));
5918
+ const response2 = await sshHostApi.put(`/db/host/${hostId}`, formData, {
5919
+ headers: {
5920
+ "Content-Type": "multipart/form-data",
5921
+ ...adminHeaders(targetUserId)
5922
+ }
5923
+ });
5924
+ return response2.data;
5925
+ }
5926
+ const response = await sshHostApi.put(`/db/host/${hostId}`, hostData, {
5927
+ headers: adminHeaders(targetUserId)
5928
+ });
5929
+ return response.data;
5930
+ } catch (error) {
5931
+ throw handleApiError(error, "update user's host");
5932
+ }
5933
+ }
5934
+ async function adminDeleteUserHost(targetUserId, hostId) {
5935
+ try {
5936
+ const response = await sshHostApi.delete(`/db/host/${hostId}`, {
5937
+ headers: adminHeaders(targetUserId)
5938
+ });
5939
+ return response.data;
5940
+ } catch (error) {
5941
+ throw handleApiError(error, "delete user's host");
5942
+ }
5943
+ }
5944
+ async function adminGetHostPassword(targetUserId, hostId, field = "password") {
5945
+ try {
5946
+ const response = await sshHostApi.get(
5947
+ `/db/host/${hostId}/password?field=${field}`,
5948
+ { headers: adminHeaders(targetUserId) }
5949
+ );
5950
+ return response.data?.value || null;
5951
+ } catch {
5952
+ return null;
5953
+ }
5954
+ }
5955
+ async function adminGetUserCredentials(targetUserId) {
5956
+ try {
5957
+ const response = await authApi.get("/credentials", {
5958
+ headers: adminHeaders(targetUserId)
5959
+ });
5960
+ return response.data;
5961
+ } catch (error) {
5962
+ throw handleApiError(error, "fetch user's credentials");
5963
+ }
5964
+ }
5965
+ async function adminCreateUserCredential(targetUserId, credentialData) {
5966
+ try {
5967
+ const response = await authApi.post("/credentials", credentialData, {
5968
+ headers: adminHeaders(targetUserId)
5969
+ });
5970
+ return response.data;
5971
+ } catch (error) {
5972
+ throw handleApiError(error, "create credential for user");
5973
+ }
5974
+ }
5975
+ async function adminUpdateUserCredential(targetUserId, credentialId, credentialData) {
5976
+ try {
5977
+ const response = await authApi.put(
5978
+ `/credentials/${credentialId}`,
5979
+ credentialData,
5980
+ { headers: adminHeaders(targetUserId) }
5981
+ );
5982
+ return response.data;
5983
+ } catch (error) {
5984
+ throw handleApiError(error, "update user's credential");
5985
+ }
5986
+ }
5987
+ async function adminDeleteUserCredential(targetUserId, credentialId) {
5988
+ try {
5989
+ const response = await authApi.delete(`/credentials/${credentialId}`, {
5990
+ headers: adminHeaders(targetUserId)
5991
+ });
5992
+ return response.data;
5993
+ } catch (error) {
5994
+ throw handleApiError(error, "delete user's credential");
5995
+ }
5996
+ }
4933
5997
 
4934
5998
  // src/ui/api/system-status-api.ts
5999
+ init_define_import_meta_env();
6000
+ function releaseUrlFrom(info) {
6001
+ return info?.latest_release?.html_url ?? "";
6002
+ }
4935
6003
  async function getVersionInfo(checkRemote = true) {
4936
6004
  try {
4937
6005
  const response = await authApi.get(
@@ -4942,6 +6010,18 @@ async function getVersionInfo(checkRemote = true) {
4942
6010
  handleApiError(error, "fetch version info");
4943
6011
  }
4944
6012
  }
6013
+ async function getUpdateChannel() {
6014
+ const response = await authApi.get("/version/channel");
6015
+ return response.data;
6016
+ }
6017
+ async function setUpdateChannel(channel) {
6018
+ const response = await authApi.put("/version/channel", { channel });
6019
+ return response.data;
6020
+ }
6021
+ async function getChannelReleases() {
6022
+ const response = await authApi.get("/version/releases");
6023
+ return response.data;
6024
+ }
4945
6025
  async function getDatabaseHealth() {
4946
6026
  try {
4947
6027
  const response = await authApi.get("/health");
@@ -4952,6 +6032,7 @@ async function getDatabaseHealth() {
4952
6032
  }
4953
6033
 
4954
6034
  // src/ui/api/credentials-api.ts
6035
+ init_define_import_meta_env();
4955
6036
  async function getCredentials() {
4956
6037
  try {
4957
6038
  const response = await authApi.get("/credentials");
@@ -4960,6 +6041,52 @@ async function getCredentials() {
4960
6041
  throw handleApiError(error, "fetch credentials");
4961
6042
  }
4962
6043
  }
6044
+ async function getCredentialDetails(credentialId) {
6045
+ try {
6046
+ const response = await authApi.get(`/credentials/${credentialId}`);
6047
+ return response.data;
6048
+ } catch (error) {
6049
+ throw handleApiError(error, "fetch credential details");
6050
+ }
6051
+ }
6052
+ async function createCredential(credentialData) {
6053
+ try {
6054
+ const response = await authApi.post("/credentials", credentialData);
6055
+ return response.data;
6056
+ } catch (error) {
6057
+ throw handleApiError(error, "create credential");
6058
+ }
6059
+ }
6060
+ async function updateCredential(credentialId, credentialData) {
6061
+ try {
6062
+ const response = await authApi.put(
6063
+ `/credentials/${credentialId}`,
6064
+ credentialData
6065
+ );
6066
+ return response.data;
6067
+ } catch (error) {
6068
+ throw handleApiError(error, "update credential");
6069
+ }
6070
+ }
6071
+ async function duplicateCredential(credentialId, data) {
6072
+ try {
6073
+ const response = await authApi.post(
6074
+ `/credentials/${credentialId}/duplicate`,
6075
+ data
6076
+ );
6077
+ return response.data;
6078
+ } catch (error) {
6079
+ throw handleApiError(error, "duplicate credential");
6080
+ }
6081
+ }
6082
+ async function deleteCredential(credentialId) {
6083
+ try {
6084
+ const response = await authApi.delete(`/credentials/${credentialId}`);
6085
+ return response.data;
6086
+ } catch (error) {
6087
+ throw handleApiError(error, "delete credential");
6088
+ }
6089
+ }
4963
6090
  async function getHostPassword(hostId, field = "password") {
4964
6091
  try {
4965
6092
  const response = await sshHostApi.get(
@@ -4970,8 +6097,167 @@ async function getHostPassword(hostId, field = "password") {
4970
6097
  return null;
4971
6098
  }
4972
6099
  }
6100
+ async function renameFolder(oldName, newName) {
6101
+ try {
6102
+ const response = await authApi.put("/host/folders/rename", {
6103
+ oldName,
6104
+ newName
6105
+ });
6106
+ invalidateSSHFoldersCache();
6107
+ return response.data;
6108
+ } catch (error) {
6109
+ handleApiError(error, "rename folder");
6110
+ }
6111
+ }
6112
+ async function getSSHFolders() {
6113
+ try {
6114
+ sshLogger.info("Fetching SSH folders", {
6115
+ operation: "fetch_ssh_folders"
6116
+ });
6117
+ const folders = await getCachedSSHFolders(async () => {
6118
+ const response = await authApi.get("/host/folders");
6119
+ return response.data;
6120
+ });
6121
+ sshLogger.success("SSH folders fetched successfully", {
6122
+ operation: "fetch_ssh_folders",
6123
+ count: folders.length
6124
+ });
6125
+ return folders;
6126
+ } catch (error) {
6127
+ sshLogger.error("Failed to fetch SSH folders", error, {
6128
+ operation: "fetch_ssh_folders"
6129
+ });
6130
+ handleApiError(error, "fetch SSH folders");
6131
+ throw error;
6132
+ }
6133
+ }
6134
+ async function updateFolderMetadata(name, color, icon, credentialId, localOnly) {
6135
+ try {
6136
+ sshLogger.info("Updating folder metadata", {
6137
+ operation: "update_folder_metadata",
6138
+ name,
6139
+ color,
6140
+ icon,
6141
+ credentialId
6142
+ });
6143
+ await authApi.put("/host/folders/metadata", {
6144
+ name,
6145
+ color,
6146
+ icon,
6147
+ credentialId,
6148
+ localOnly
6149
+ });
6150
+ invalidateSSHFoldersCache();
6151
+ sshLogger.success("Folder metadata updated successfully", {
6152
+ operation: "update_folder_metadata",
6153
+ name
6154
+ });
6155
+ } catch (error) {
6156
+ sshLogger.error("Failed to update folder metadata", error, {
6157
+ operation: "update_folder_metadata",
6158
+ name
6159
+ });
6160
+ handleApiError(error, "update folder metadata");
6161
+ throw error;
6162
+ }
6163
+ }
6164
+ async function reorderFolders(positions) {
6165
+ try {
6166
+ const response = await authApi.put("/host/folders/reorder", {
6167
+ positions
6168
+ });
6169
+ invalidateSSHFoldersCache();
6170
+ return response.data;
6171
+ } catch (error) {
6172
+ handleApiError(error, "reorder folders");
6173
+ throw error;
6174
+ }
6175
+ }
6176
+ async function deleteAllHostsInFolder(folderName) {
6177
+ try {
6178
+ sshLogger.info("Deleting all hosts in folder", {
6179
+ operation: "delete_folder_hosts",
6180
+ folderName
6181
+ });
6182
+ const response = await authApi.delete(
6183
+ `/host/folders/${encodeURIComponent(folderName)}/hosts`
6184
+ );
6185
+ invalidateHostsAndStatusCaches();
6186
+ sshLogger.success("All hosts in folder deleted successfully", {
6187
+ operation: "delete_folder_hosts",
6188
+ folderName,
6189
+ deletedCount: response.data.deletedCount
6190
+ });
6191
+ return response.data;
6192
+ } catch (error) {
6193
+ sshLogger.error("Failed to delete hosts in folder", error, {
6194
+ operation: "delete_folder_hosts",
6195
+ folderName
6196
+ });
6197
+ handleApiError(error, "delete hosts in folder");
6198
+ throw error;
6199
+ }
6200
+ }
6201
+ async function renameCredentialFolder(oldName, newName) {
6202
+ try {
6203
+ const response = await authApi.put("/credentials/folders/rename", {
6204
+ oldName,
6205
+ newName
6206
+ });
6207
+ invalidateSSHFoldersCache();
6208
+ return response.data;
6209
+ } catch (error) {
6210
+ throw handleApiError(error, "rename credential folder");
6211
+ }
6212
+ }
6213
+ async function reorderCredentials(positions) {
6214
+ try {
6215
+ const response = await authApi.put("/credentials/reorder", {
6216
+ positions
6217
+ });
6218
+ return response.data;
6219
+ } catch (error) {
6220
+ handleApiError(error, "reorder credentials");
6221
+ throw error;
6222
+ }
6223
+ }
6224
+ async function generatePublicKeyFromPrivate(privateKey, keyPassword) {
6225
+ try {
6226
+ const response = await authApi.post("/credentials/generate-public-key", {
6227
+ privateKey,
6228
+ keyPassword
6229
+ });
6230
+ return response.data;
6231
+ } catch (error) {
6232
+ throw handleApiError(error, "generate public key from private key");
6233
+ }
6234
+ }
6235
+ async function generateKeyPair(keyType, keySize, passphrase) {
6236
+ try {
6237
+ const response = await authApi.post("/credentials/generate-key-pair", {
6238
+ keyType,
6239
+ keySize,
6240
+ passphrase
6241
+ });
6242
+ return response.data;
6243
+ } catch (error) {
6244
+ throw handleApiError(error, "generate SSH key pair");
6245
+ }
6246
+ }
6247
+ async function deployCredentialToHost(credentialId, targetHostId) {
6248
+ try {
6249
+ const response = await authApi.post(
6250
+ `/credentials/${credentialId}/deploy-to-host`,
6251
+ { targetHostId }
6252
+ );
6253
+ return response.data;
6254
+ } catch (error) {
6255
+ throw handleApiError(error, "deploy credential to host");
6256
+ }
6257
+ }
4973
6258
 
4974
6259
  // src/ui/api/dashboard-api.ts
6260
+ init_define_import_meta_env();
4975
6261
  async function getUptime() {
4976
6262
  try {
4977
6263
  const response = await authApi.get("/dashboard/uptime");
@@ -5002,8 +6288,45 @@ async function logActivity(type, hostId, hostName) {
5002
6288
  throw handleApiError(error, "log activity");
5003
6289
  }
5004
6290
  }
6291
+ async function resetRecentActivity() {
6292
+ try {
6293
+ const response = await authApi.delete("/dashboard/activity/reset");
6294
+ return response.data;
6295
+ } catch (error) {
6296
+ throw handleApiError(error, "reset recent activity");
6297
+ }
6298
+ }
6299
+
6300
+ // src/ui/api/external-account-api.ts
6301
+ init_define_import_meta_env();
6302
+ async function linkExternalToPasswordAccount(externalUserId, targetUsername) {
6303
+ try {
6304
+ const response = await authApi.post("/users/link-external-to-password", {
6305
+ externalUserId,
6306
+ targetUsername
6307
+ });
6308
+ return response.data;
6309
+ } catch (error) {
6310
+ throw handleApiError(error, "link external account to password account");
6311
+ }
6312
+ }
6313
+ async function unlinkExternalFromPasswordAccount(userId) {
6314
+ try {
6315
+ const response = await authApi.post(
6316
+ "/users/unlink-external-from-password",
6317
+ { userId }
6318
+ );
6319
+ return response.data;
6320
+ } catch (error) {
6321
+ throw handleApiError(
6322
+ error,
6323
+ "unlink external sign-in from password account"
6324
+ );
6325
+ }
6326
+ }
5005
6327
 
5006
6328
  // src/ui/api/rbac-api.ts
6329
+ init_define_import_meta_env();
5007
6330
  import i18n from "i18next";
5008
6331
  async function getSharingTarget(hostId, syncId) {
5009
6332
  const api = await getConnectedRemoteApi();
@@ -5044,7 +6367,7 @@ async function updateRole(roleId, roleData) {
5044
6367
  try {
5045
6368
  const response = await rbacApi.put(`/rbac/roles/${roleId}`, roleData);
5046
6369
  if (roleData.permissions) {
5047
- const { notifyPermissionsChanged } = await import("./use-permissions-GYCBY2AU.js");
6370
+ const { notifyPermissionsChanged } = await import("./use-permissions-6VSHHUMB.js");
5048
6371
  notifyPermissionsChanged();
5049
6372
  }
5050
6373
  return response.data;
@@ -5247,14 +6570,36 @@ async function revokeCredentialAccess(credentialId, accessId) {
5247
6570
  }
5248
6571
 
5249
6572
  // src/ui/api/open-tabs-api.ts
6573
+ init_define_import_meta_env();
5250
6574
  function hasPersistableHostId(tab) {
5251
6575
  return tab.hostId == null || Number.isInteger(tab.hostId) && tab.hostId > 0;
5252
6576
  }
5253
6577
  var activeSessionsCache = createTtlRequestCache(2e3);
6578
+ async function getOpenTabs() {
6579
+ const response = await authApi.get("/open-tabs");
6580
+ return response.data;
6581
+ }
6582
+ async function deleteOpenTab(instanceId) {
6583
+ await authApi.delete(`/open-tabs/${instanceId}`);
6584
+ }
5254
6585
  async function patchOpenTab(instanceId, updates) {
5255
6586
  if (!hasPersistableHostId(updates)) return;
5256
6587
  await authApi.patch(`/open-tabs/${instanceId}`, updates);
5257
6588
  }
6589
+ async function addOpenTab(tab) {
6590
+ if (!hasPersistableHostId(tab)) return;
6591
+ await authApi.post("/open-tabs", tab);
6592
+ }
6593
+ async function getActiveSessions() {
6594
+ return activeSessionsCache.get(async () => {
6595
+ const response = await authApi.get("/open-tabs/active-sessions");
6596
+ return Array.isArray(response.data) ? response.data : [];
6597
+ });
6598
+ }
6599
+ async function getSessionTimeoutMinutes() {
6600
+ const response = await authApi.get("/open-tabs/session-timeout");
6601
+ return Number(response.data?.minutes) || 30;
6602
+ }
5258
6603
  function parseCustomKeybindings(raw) {
5259
6604
  if (!raw) return [];
5260
6605
  try {
@@ -5271,6 +6616,9 @@ async function getUserPreferences() {
5271
6616
  return response.data;
5272
6617
  });
5273
6618
  }
6619
+ async function saveUserPreferences(prefs) {
6620
+ await authApi.put("/user-preferences", prefs);
6621
+ }
5274
6622
 
5275
6623
  // src/ui/main-axios.ts
5276
6624
  var TRUST_TOKEN_KEY = "termixTrustToken";
@@ -5601,7 +6949,7 @@ function createRemoteOriginApiInstance(path) {
5601
6949
  });
5602
6950
  instance.interceptors.request.use(
5603
6951
  async (config) => {
5604
- const { getLinkedSession: getLinkedSession2 } = await import("./linked-server-UCW74T2V.js");
6952
+ const { getLinkedSession: getLinkedSession2 } = await import("./linked-server-B4NEG4MA.js");
5605
6953
  const linked = await getLinkedSession2();
5606
6954
  config.baseURL = linked ? `${linked.serverUrl}${path}` : "http://no-server-configured";
5607
6955
  if (config.headers.set) {
@@ -5790,6 +7138,17 @@ async function registerUser(username, password) {
5790
7138
  handleApiError(error, "register user");
5791
7139
  }
5792
7140
  }
7141
+ async function adminCreateUser(username, password) {
7142
+ try {
7143
+ const response = await authApi.post("/users/admin-create", {
7144
+ username,
7145
+ password
7146
+ });
7147
+ return response.data;
7148
+ } catch (error) {
7149
+ handleApiError(error, "admin create user");
7150
+ }
7151
+ }
5793
7152
  async function loginUser(username, password, rememberMe = false) {
5794
7153
  try {
5795
7154
  const response = await authApi.post("/users/login", {
@@ -5824,6 +7183,20 @@ async function requestTrustedProxyLogin() {
5824
7183
  if (response.data.success) markUserAuthenticated();
5825
7184
  return response.data;
5826
7185
  }
7186
+ async function logoutUser() {
7187
+ try {
7188
+ const response = await authApi.post("/users/logout");
7189
+ clearClientAuthState();
7190
+ userWasAuthenticated = false;
7191
+ authInvalidationHandled = false;
7192
+ return response.data;
7193
+ } catch (error) {
7194
+ clearClientAuthState();
7195
+ userWasAuthenticated = false;
7196
+ authInvalidationHandled = false;
7197
+ handleApiError(error, "logout user");
7198
+ }
7199
+ }
5827
7200
  async function getUserInfo() {
5828
7201
  try {
5829
7202
  const response = await authApi.get("/users/me");
@@ -5925,6 +7298,17 @@ async function completePasswordReset(username, tempToken, newPassword, confirmDa
5925
7298
  handleApiError(error, "complete password reset");
5926
7299
  }
5927
7300
  }
7301
+ async function changePassword(oldPassword, newPassword) {
7302
+ try {
7303
+ const response = await authApi.post("/users/change-password", {
7304
+ oldPassword,
7305
+ newPassword
7306
+ });
7307
+ return response.data;
7308
+ } catch (error) {
7309
+ handleApiError(error, "change password");
7310
+ }
7311
+ }
5928
7312
 
5929
7313
  // src/ui/lib/linked-server.ts
5930
7314
  var CACHE_MS = 6e4;
@@ -5963,6 +7347,7 @@ export {
5963
7347
  setFrontendState,
5964
7348
  getPluginRecord,
5965
7349
  knownPluginIds,
7350
+ resetPluginStore,
5966
7351
  isElectron,
5967
7352
  localBackendPort,
5968
7353
  createRegistry,
@@ -5973,6 +7358,9 @@ export {
5973
7358
  getTabType,
5974
7359
  listTabTypes,
5975
7360
  useTabTypes,
7361
+ isPersistentTabType,
7362
+ isSessionTabType,
7363
+ canRestoreTabType,
5976
7364
  tabTypeForActivity,
5977
7365
  useTabs,
5978
7366
  useTabsSafe,
@@ -5983,24 +7371,107 @@ export {
5983
7371
  dbHealthMonitor,
5984
7372
  getDeviceId,
5985
7373
  SYNC_CHANGED_EVENT,
7374
+ invalidateServerStatusCache,
7375
+ invalidateHostsAndStatusCaches,
5986
7376
  getSSHHosts,
7377
+ createSSHHost,
7378
+ updateSSHHost,
7379
+ bulkImportSSHHosts,
7380
+ importSSHConfigHosts,
7381
+ bulkUpdateSSHHosts,
7382
+ reorderSSHHosts,
7383
+ deleteSSHHost,
7384
+ exportAllSSHHosts,
5987
7385
  websocketAuthProtocols,
5988
7386
  getLinkedSession,
5989
7387
  notifySyncChanged,
5990
7388
  resolveConnectionOrigin,
5991
7389
  buildOriginWsUrl,
7390
+ getAllServerStatuses,
7391
+ getStatusCheckSettings,
7392
+ updateStatusCheckSettings,
7393
+ defaultHostRowFields,
7394
+ defaultHostSidebarPreferences,
7395
+ sanitizeHostSidebarPreferences,
7396
+ getHostSidebarPreferences,
7397
+ saveHostSidebarPreferences,
7398
+ CREDENTIAL_ROW_FIELD_KEYS,
7399
+ defaultCredentialRowFields,
7400
+ defaultCredentialSidebarPreferences,
7401
+ sanitizeCredentialSidebarPreferences,
7402
+ getCredentialSidebarPreferences,
7403
+ saveCredentialSidebarPreferences,
5992
7404
  pluginStepKey,
5993
7405
  PRESETS,
7406
+ UI_AREA_KEYS,
7407
+ getLogLevel,
7408
+ updateLogLevel,
7409
+ getSessionTimeout,
7410
+ updateSessionTimeout,
7411
+ getBranding,
7412
+ updateBranding,
5994
7413
  hydrateLocalSharedHostAuth,
7414
+ getConnectedRemoteApi,
5995
7415
  resolveRemoteHostId,
7416
+ getUserList,
7417
+ getSessions,
7418
+ revokeSession,
7419
+ revokeAllUserSessions,
7420
+ createApiKey,
7421
+ getApiKeys,
7422
+ deleteApiKey,
7423
+ makeUserAdmin,
7424
+ removeAdminStatus,
7425
+ deleteUser,
7426
+ deleteAccount,
7427
+ adminResetUserPassword,
7428
+ adminExportUserData,
7429
+ updateRegistrationAllowed,
7430
+ getExternalAutoProvision,
7431
+ updateExternalAutoProvision,
7432
+ getSecondFactorAfterExternalLogin,
7433
+ updateSecondFactorAfterExternalLogin,
7434
+ updatePasswordLoginAllowed,
5996
7435
  getPasswordResetAllowed,
7436
+ updatePasswordResetAllowed,
7437
+ adminGetUserHosts,
7438
+ adminCreateUserHost,
7439
+ adminUpdateUserHost,
7440
+ adminDeleteUserHost,
7441
+ adminGetHostPassword,
7442
+ adminGetUserCredentials,
7443
+ adminCreateUserCredential,
7444
+ adminUpdateUserCredential,
7445
+ adminDeleteUserCredential,
7446
+ releaseUrlFrom,
5997
7447
  getVersionInfo,
7448
+ getUpdateChannel,
7449
+ setUpdateChannel,
7450
+ getChannelReleases,
5998
7451
  getDatabaseHealth,
5999
7452
  getCredentials,
7453
+ getCredentialDetails,
7454
+ createCredential,
7455
+ updateCredential,
7456
+ duplicateCredential,
7457
+ deleteCredential,
6000
7458
  getHostPassword,
7459
+ renameFolder,
7460
+ getSSHFolders,
7461
+ updateFolderMetadata,
7462
+ reorderFolders,
7463
+ deleteAllHostsInFolder,
7464
+ renameCredentialFolder,
7465
+ reorderCredentials,
7466
+ generatePublicKeyFromPrivate,
7467
+ generateKeyPair,
7468
+ deployCredentialToHost,
6001
7469
  getUptime,
6002
7470
  getRecentActivity,
6003
7471
  logActivity,
7472
+ resetRecentActivity,
7473
+ linkExternalToPasswordAccount,
7474
+ unlinkExternalFromPasswordAccount,
6004
7475
  getRoles,
6005
7476
  createRole,
6006
7477
  updateRole,
@@ -6024,21 +7495,31 @@ export {
6024
7495
  shareCredential,
6025
7496
  getCredentialAccess,
6026
7497
  revokeCredentialAccess,
7498
+ getOpenTabs,
7499
+ deleteOpenTab,
6027
7500
  patchOpenTab,
7501
+ addOpenTab,
7502
+ getActiveSessions,
7503
+ getSessionTimeoutMinutes,
6028
7504
  parseCustomKeybindings,
6029
7505
  getUserPreferences,
7506
+ saveUserPreferences,
6030
7507
  TRUST_TOKEN_KEY,
6031
7508
  setCookie,
6032
7509
  getCookie,
6033
7510
  markUserAuthenticated,
6034
7511
  getBackendUrl,
6035
7512
  createRemoteOriginApiInstance,
7513
+ hostApi,
7514
+ sshHostApi,
6036
7515
  authApi,
6037
7516
  rbacApi,
6038
7517
  handleApiError,
6039
7518
  registerUser,
7519
+ adminCreateUser,
6040
7520
  loginUser,
6041
7521
  requestTrustedProxyLogin,
7522
+ logoutUser,
6042
7523
  getUserInfo,
6043
7524
  getCurrentToken,
6044
7525
  getRegistrationAllowed,
@@ -6047,5 +7528,6 @@ export {
6047
7528
  requestDesktopAutoSession,
6048
7529
  initiatePasswordReset,
6049
7530
  verifyPasswordResetCode,
6050
- completePasswordReset
7531
+ completePasswordReset,
7532
+ changePassword
6051
7533
  };