@termix-ssh/plugin-sdk 1.0.21 → 1.0.22

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 (39) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/PLUGIN-GUIDE.md +62 -3
  3. package/cli/commands/build.mjs +55 -36
  4. package/cli/commands/validate.mjs +4 -0
  5. package/dist/backend.d.ts +32 -7
  6. package/dist/frontend.d.ts +7 -0
  7. package/dist/host/{PluginsTab-HQGSDSHS.js → PluginsTab-CM2B33BD.js} +22 -14
  8. package/dist/host/chunk-7J4QNGFM.js +345 -0
  9. package/dist/host/{chunk-A5CULDWV.js → chunk-HQ6NNFSX.js} +109 -1574
  10. package/dist/host/chunk-I5F2PSMR.js +1526 -0
  11. package/dist/host/{chunk-FGX27MAA.js → chunk-JRV2HIDK.js} +1 -1
  12. package/dist/host/{chunk-JFQGI4OD.js → chunk-P26QKKU5.js} +38 -9
  13. package/dist/host/{chunk-WWFRBU2E.js → chunk-ROB2SH5Q.js} +76 -49
  14. package/dist/host/chunk-TK3Y437H.js +53 -0
  15. package/dist/host/{chunk-GTHINW3L.js → chunk-VKNGNEF3.js} +34650 -34968
  16. package/dist/host/core-classes.json +1 -1
  17. package/dist/host/frame-host.css +2 -0
  18. package/dist/host/frame-host.js +242 -0
  19. package/dist/host/{linked-server-UDSFY3N7.js → linked-server-J5G457OA.js} +1 -1
  20. package/dist/host/{rbac-api-AAAPMF52.js → rbac-api-PY22W5UY.js} +5 -1
  21. package/dist/host/testing-host.js +9 -6
  22. package/dist/host/types/src/types/host-sidebar-preferences.d.ts +2 -0
  23. package/dist/host/types/src/types/index.d.ts +8 -0
  24. package/dist/host/types/src/ui/api/plugins-api.d.ts +2 -1
  25. package/dist/host/types/src/ui/api/rbac-api.d.ts +19 -1
  26. package/dist/host/types/src/ui/components/data-view.d.ts +1 -1
  27. package/dist/host/types/src/ui/main-axios.d.ts +1 -1
  28. package/dist/host/types/src/ui/plugin-host/loader.d.ts +6 -0
  29. package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +1 -1
  30. package/dist/host/types/src/ui/plugins/use-plugins-manager.d.ts +1 -1
  31. package/dist/host/types/src/ui/shell/tab-registry.d.ts +2 -0
  32. package/dist/host/ui.js +356 -369
  33. package/dist/host/{use-permissions-VAND5GEG.js → use-permissions-EWRI3WLT.js} +1 -1
  34. package/dist/host-commands.d.ts +7 -0
  35. package/dist/host-commands.js +35 -5
  36. package/dist/manifest.d.ts +28 -1
  37. package/dist/manifest.js +108 -1
  38. package/package.json +5 -1
  39. package/schema/manifest.schema.json +42 -0
@@ -26,7 +26,7 @@ var inFlight = null;
26
26
  function load() {
27
27
  if (cache) return Promise.resolve(cache);
28
28
  if (inFlight) return inFlight;
29
- inFlight = import("./rbac-api-AAAPMF52.js").then(({ getMyPermissions }) => getMyPermissions()).then((result) => {
29
+ inFlight = import("./rbac-api-PY22W5UY.js").then(({ getMyPermissions }) => getMyPermissions()).then((result) => {
30
30
  cache = {
31
31
  permissions: result.permissions ?? [],
32
32
  isAdmin: !!result.isAdmin
@@ -4428,7 +4428,7 @@ var FrontendLogger = class {
4428
4428
  this.serviceName = serviceName;
4429
4429
  this.serviceIcon = serviceIcon;
4430
4430
  this.serviceColor = serviceColor;
4431
- this.isDevelopment = true;
4431
+ this.isDevelopment = false;
4432
4432
  }
4433
4433
  getTimeStamp() {
4434
4434
  const now = /* @__PURE__ */ new Date();
@@ -5205,6 +5205,7 @@ function defaultHostSidebarPreferences() {
5205
5205
  statusColorScheme: "accent",
5206
5206
  openOnDoubleClick: false,
5207
5207
  showFolderPaths: true,
5208
+ stripedRows: true,
5208
5209
  hostClickBehavior: "newTab",
5209
5210
  closeOnOpen: false,
5210
5211
  barActions: {},
@@ -5273,6 +5274,7 @@ function sanitizeHostSidebarPreferences(input) {
5273
5274
  ) ? displayObj.statusColorScheme : defaults2.display.statusColorScheme,
5274
5275
  openOnDoubleClick: typeof displayObj.openOnDoubleClick === "boolean" ? displayObj.openOnDoubleClick : defaults2.display.openOnDoubleClick,
5275
5276
  showFolderPaths: typeof displayObj.showFolderPaths === "boolean" ? displayObj.showFolderPaths : defaults2.display.showFolderPaths,
5277
+ stripedRows: typeof displayObj.stripedRows === "boolean" ? displayObj.stripedRows : defaults2.display.stripedRows,
5276
5278
  hostClickBehavior: HOST_CLICK_BEHAVIORS.includes(
5277
5279
  displayObj.hostClickBehavior
5278
5280
  ) ? displayObj.hostClickBehavior : defaults2.display.hostClickBehavior,
@@ -6318,7 +6320,7 @@ async function updateRole(roleId, roleData) {
6318
6320
  try {
6319
6321
  const response = await rbacApi.put(`/rbac/roles/${roleId}`, roleData);
6320
6322
  if (roleData.permissions) {
6321
- const { notifyPermissionsChanged } = await import("./use-permissions-VAND5GEG.js");
6323
+ const { notifyPermissionsChanged } = await import("./use-permissions-EWRI3WLT.js");
6322
6324
  notifyPermissionsChanged();
6323
6325
  }
6324
6326
  return response.data;
@@ -6404,9 +6406,11 @@ async function getFolderAccess(folder) {
6404
6406
  throw handleApiError(error, "get folder access");
6405
6407
  }
6406
6408
  }
6407
- async function revokeFolderAccess(ruleId) {
6409
+ async function revokeFolderAccess(ruleId, options = {}) {
6408
6410
  try {
6409
- await rbacApi.delete(`/rbac/folder/access/${ruleId}`);
6411
+ await rbacApi.delete(`/rbac/folder/access/${ruleId}`, {
6412
+ params: options.fromHosts ? { fromHosts: "true" } : void 0
6413
+ });
6410
6414
  } catch (error) {
6411
6415
  throw handleApiError(error, "revoke folder access");
6412
6416
  }
@@ -6479,6 +6483,29 @@ async function getHostAuthOverride(hostId, protocol, sharedCopySyncId) {
6479
6483
  throw handleApiError(error, "fetch host authentication override");
6480
6484
  }
6481
6485
  }
6486
+ async function getFolderAuthOverride(folder, protocol, sharedCopySyncId) {
6487
+ try {
6488
+ const target = await getSharedCopyTarget(0, sharedCopySyncId);
6489
+ const response = await target.api.get(`/rbac/folder-auth/${protocol}`, {
6490
+ params: { folder }
6491
+ });
6492
+ return response.data;
6493
+ } catch (error) {
6494
+ throw handleApiError(error, "fetch folder authentication override");
6495
+ }
6496
+ }
6497
+ async function setFolderAuthOverride(folder, protocol, credentialId, sharedCopySyncId) {
6498
+ try {
6499
+ const target = await getSharedCopyTarget(0, sharedCopySyncId);
6500
+ const response = await target.api.put(`/rbac/folder-auth/${protocol}`, {
6501
+ folder,
6502
+ credentialId
6503
+ });
6504
+ return response.data;
6505
+ } catch (error) {
6506
+ throw handleApiError(error, "update folder authentication override");
6507
+ }
6508
+ }
6482
6509
  async function setHostAuthOverride(hostId, protocol, credentialId, sharedCopySyncId) {
6483
6510
  try {
6484
6511
  const target = await getSharedCopyTarget(hostId, sharedCopySyncId);
@@ -6705,7 +6732,7 @@ function createApiInstance(baseURL, serviceName = "API") {
6705
6732
  operation: "request_start"
6706
6733
  };
6707
6734
  const logger = getLoggerForService(serviceName);
6708
- const isDevMode = true;
6735
+ const isDevMode = false;
6709
6736
  if (isDevMode) {
6710
6737
  logger.requestStart(method, fullUrl, context);
6711
6738
  }
@@ -6778,7 +6805,7 @@ function createApiInstance(baseURL, serviceName = "API") {
6778
6805
  operation: "request_success"
6779
6806
  };
6780
6807
  const logger = getLoggerForService(serviceName);
6781
- if (true) {
6808
+ if (false) {
6782
6809
  logger.requestSuccess(
6783
6810
  method,
6784
6811
  fullUrl,
@@ -6816,7 +6843,7 @@ function createApiInstance(baseURL, serviceName = "API") {
6816
6843
  };
6817
6844
  const logger = getLoggerForService(serviceName);
6818
6845
  const isSilentRetry = !!error.config?.__silentRetry;
6819
- if (!isSilentRetry) {
6846
+ if (false) {
6820
6847
  if (status === 401) {
6821
6848
  logger.authError(method, fullUrl, context);
6822
6849
  } else if (status === 0 || !status) {
@@ -6870,7 +6897,7 @@ function isDev() {
6870
6897
  if (isElectron()) {
6871
6898
  return false;
6872
6899
  }
6873
- return window.location.port === "3000" || window.location.port === "5173" || window.location.port === "" || window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
6900
+ return false;
6874
6901
  }
6875
6902
  var apiHost = define_import_meta_env_default.VITE_API_HOST || (typeof window !== "undefined" ? window.location.hostname : "localhost");
6876
6903
  function getBackendUrl(path) {
@@ -6900,7 +6927,7 @@ function createRemoteOriginApiInstance(path) {
6900
6927
  });
6901
6928
  instance.interceptors.request.use(
6902
6929
  async (config) => {
6903
- const { getLinkedSession: getLinkedSession2 } = await import("./linked-server-UDSFY3N7.js");
6930
+ const { getLinkedSession: getLinkedSession2 } = await import("./linked-server-J5G457OA.js");
6904
6931
  const linked = await getLinkedSession2();
6905
6932
  config.baseURL = linked ? `${linked.serverUrl}${path}` : "http://no-server-configured";
6906
6933
  if (config.headers.set) {
@@ -7455,6 +7482,8 @@ export {
7455
7482
  getSharedHosts,
7456
7483
  revokeHostAccess,
7457
7484
  getHostAuthOverride,
7485
+ getFolderAuthOverride,
7486
+ setFolderAuthOverride,
7458
7487
  setHostAuthOverride,
7459
7488
  shareCredential,
7460
7489
  getCredentialAccess,
@@ -1,6 +1,8 @@
1
1
  const __termixNoGlob = () => ({});
2
2
  import {
3
- Button,
3
+ Button
4
+ } from "./chunk-7J4QNGFM.js";
5
+ import {
4
6
  ChevronRight,
5
7
  PANEL,
6
8
  Plus,
@@ -8,10 +10,10 @@ import {
8
10
  cn,
9
11
  gridSizeStyle,
10
12
  useAreaPreferences
11
- } from "./chunk-GTHINW3L.js";
13
+ } from "./chunk-VKNGNEF3.js";
12
14
  import {
13
15
  isElectron
14
- } from "./chunk-JFQGI4OD.js";
16
+ } from "./chunk-P26QKKU5.js";
15
17
  import {
16
18
  __commonJS,
17
19
  __toESM,
@@ -2181,6 +2183,13 @@ function EmptyState({
2181
2183
  // src/ui/components/data-view.tsx
2182
2184
  init_define_import_meta_env();
2183
2185
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
2186
+ function listColumnTemplates(columns) {
2187
+ return {
2188
+ base: columns.filter((column) => column.hideBelow === void 0).map((column) => column.width).join(" ") || "none",
2189
+ md: columns.filter((column) => column.hideBelow !== "lg").map((column) => column.width).join(" ") || "none",
2190
+ lg: columns.map((column) => column.width).join(" ") || "none"
2191
+ };
2192
+ }
2184
2193
  var COLS = {
2185
2194
  1: "grid-cols-1",
2186
2195
  2: "grid-cols-2",
@@ -2205,6 +2214,7 @@ var XL_COLS = {
2205
2214
  3: "xl:grid-cols-3",
2206
2215
  4: "xl:grid-cols-4"
2207
2216
  };
2217
+ var LIST_GRID_CLASS = "grid grid-cols-[var(--data-view-cols)] @min-[48rem]:grid-cols-[var(--data-view-cols-md)] @min-[64rem]:grid-cols-[var(--data-view-cols-lg)] gap-x-2 px-3";
2208
2218
  function gridClass(columns) {
2209
2219
  return cn(
2210
2220
  COLS[columns.base ?? 1],
@@ -2213,6 +2223,11 @@ function gridClass(columns) {
2213
2223
  columns.xl && XL_COLS[columns.xl]
2214
2224
  );
2215
2225
  }
2226
+ function columnVisibility(hideBelow) {
2227
+ if (hideBelow === "md") return "hidden @min-[48rem]:block";
2228
+ if (hideBelow === "lg") return "hidden @min-[64rem]:block";
2229
+ return "";
2230
+ }
2216
2231
  function DataView({
2217
2232
  items,
2218
2233
  view,
@@ -2246,60 +2261,72 @@ function DataView({
2246
2261
  }
2247
2262
  );
2248
2263
  }
2249
- const template = listColumns.map((c) => c.width).join(" ");
2250
- const rowHeight = density === "compact" ? "h-7" : "h-9";
2251
- return /* @__PURE__ */ jsxs2("div", { className: cn("border border-border bg-card", className), role: "table", children: [
2252
- /* @__PURE__ */ jsx3(
2253
- "div",
2254
- {
2255
- className: "sticky top-0 z-10 grid items-center border-b border-border bg-card px-3 text-[10px] font-semibold uppercase tracking-widest text-muted-foreground",
2256
- style: { gridTemplateColumns: template },
2257
- children: listColumns.map((column) => /* @__PURE__ */ jsx3(
2258
- "span",
2264
+ const templates = listColumnTemplates(listColumns);
2265
+ const rowHeight = density === "compact" ? "min-h-7" : "min-h-9";
2266
+ return /* @__PURE__ */ jsxs2(
2267
+ "div",
2268
+ {
2269
+ className: cn("@container border border-border bg-card", className),
2270
+ style: {
2271
+ "--data-view-cols": templates.base,
2272
+ "--data-view-cols-md": templates.md,
2273
+ "--data-view-cols-lg": templates.lg
2274
+ },
2275
+ role: "table",
2276
+ children: [
2277
+ /* @__PURE__ */ jsx3(
2278
+ "div",
2259
2279
  {
2260
2280
  className: cn(
2261
- "truncate py-2",
2262
- column.align === "end" && "text-right",
2263
- column.hideBelow === "md" && "hidden md:block",
2264
- column.hideBelow === "lg" && "hidden lg:block"
2281
+ LIST_GRID_CLASS,
2282
+ "sticky top-0 z-10 items-center border-b border-border bg-card text-[10px] font-semibold uppercase tracking-widest text-muted-foreground"
2265
2283
  ),
2266
- children: column.header
2267
- },
2268
- column.key
2269
- ))
2270
- }
2271
- ),
2272
- /* @__PURE__ */ jsx3("div", { children: items.map((item) => {
2273
- const active = isRowActive?.(item) ?? false;
2274
- return /* @__PURE__ */ jsx3(
2275
- "div",
2276
- {
2277
- onClick: onRowClick ? () => onRowClick(item) : void 0,
2278
- className: cn(
2279
- "grid items-center gap-x-2 border-b border-border/50 px-3 text-xs transition-colors last:border-0",
2280
- rowHeight,
2281
- onRowClick && "cursor-pointer",
2282
- active ? "bg-accent-brand/10" : "hover:bg-muted/40"
2283
- ),
2284
- style: { gridTemplateColumns: template },
2285
- children: listColumns.map((column) => /* @__PURE__ */ jsx3(
2284
+ children: listColumns.map((column) => /* @__PURE__ */ jsx3(
2285
+ "span",
2286
+ {
2287
+ className: cn(
2288
+ "truncate py-2",
2289
+ column.align === "end" && "text-right",
2290
+ columnVisibility(column.hideBelow)
2291
+ ),
2292
+ children: column.header
2293
+ },
2294
+ column.key
2295
+ ))
2296
+ }
2297
+ ),
2298
+ /* @__PURE__ */ jsx3("div", { children: items.map((item) => {
2299
+ const active = isRowActive?.(item) ?? false;
2300
+ return /* @__PURE__ */ jsx3(
2286
2301
  "div",
2287
2302
  {
2303
+ onClick: onRowClick ? () => onRowClick(item) : void 0,
2288
2304
  className: cn(
2289
- "min-w-0 truncate",
2290
- column.align === "end" && "text-right",
2291
- column.hideBelow === "md" && "hidden md:block",
2292
- column.hideBelow === "lg" && "hidden lg:block"
2305
+ LIST_GRID_CLASS,
2306
+ "items-center border-b border-border/50 text-xs transition-colors last:border-0",
2307
+ rowHeight,
2308
+ onRowClick && "cursor-pointer",
2309
+ active ? "bg-accent-brand/10" : "hover:bg-muted/40"
2293
2310
  ),
2294
- children: column.cell(item)
2311
+ children: listColumns.map((column) => /* @__PURE__ */ jsx3(
2312
+ "div",
2313
+ {
2314
+ className: cn(
2315
+ "min-w-0 truncate",
2316
+ column.align === "end" && "text-right",
2317
+ columnVisibility(column.hideBelow)
2318
+ ),
2319
+ children: column.cell(item)
2320
+ },
2321
+ column.key
2322
+ ))
2295
2323
  },
2296
- column.key
2297
- ))
2298
- },
2299
- getKey(item)
2300
- );
2301
- }) })
2302
- ] });
2324
+ getKey(item)
2325
+ );
2326
+ }) })
2327
+ ]
2328
+ }
2329
+ );
2303
2330
  }
2304
2331
 
2305
2332
  // src/ui/lib/issue-url.ts
@@ -0,0 +1,53 @@
1
+ const __termixNoGlob = () => ({});
2
+ import {
3
+ useTheme
4
+ } from "./chunk-HQ6NNFSX.js";
5
+ import {
6
+ init_define_import_meta_env
7
+ } from "./chunk-YGYBM7SQ.js";
8
+
9
+ // src/ui/components/sonner.tsx
10
+ init_define_import_meta_env();
11
+ import { Toaster as Sonner } from "sonner";
12
+ import { jsx } from "react/jsx-runtime";
13
+ var Toaster = ({ ...props }) => {
14
+ const { theme = "system" } = useTheme();
15
+ return /* @__PURE__ */ jsx(
16
+ Sonner,
17
+ {
18
+ theme,
19
+ className: "toaster group",
20
+ toastOptions: {
21
+ classNames: {
22
+ toast: "group toast group-[.toaster]:bg-card group-[.toaster]:text-card-foreground group-[.toaster]:border-border group-[.toaster]:rounded-none! group-[.toaster]:shadow-lg group-[.toaster]:font-mono",
23
+ description: "group-[.toast]:text-muted-foreground",
24
+ actionButton: "group-[.toast]:bg-accent-brand group-[.toast]:text-white group-[.toast]:font-semibold",
25
+ cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
26
+ success: "group-[.toast]:!text-accent-brand group-[.toast]:!border-accent-brand/30",
27
+ info: "group-[.toast]:!text-accent-brand group-[.toast]:!border-accent-brand/30",
28
+ error: "group-[.toast]:!text-destructive group-[.toast]:!border-destructive/30"
29
+ }
30
+ },
31
+ style: {
32
+ "--radius": "0px",
33
+ "--normal-bg": "var(--card)",
34
+ "--normal-border": "var(--border)",
35
+ "--normal-text": "var(--card-foreground)",
36
+ "--success-bg": "var(--card)",
37
+ "--success-border": "var(--border)",
38
+ "--success-text": "var(--color-accent-brand)",
39
+ "--info-bg": "var(--card)",
40
+ "--info-border": "var(--border)",
41
+ "--info-text": "var(--color-accent-brand)",
42
+ "--error-bg": "var(--card)",
43
+ "--error-border": "var(--border)",
44
+ "--error-text": "var(--destructive)"
45
+ },
46
+ ...props
47
+ }
48
+ );
49
+ };
50
+
51
+ export {
52
+ Toaster
53
+ };