@termix-ssh/plugin-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/cli/commands/build.mjs +246 -0
- package/cli/commands/migrations.mjs +248 -0
- package/cli/commands/pack.mjs +42 -0
- package/cli/commands/sign.mjs +83 -0
- package/cli/commands/test.mjs +33 -0
- package/cli/commands/validate.mjs +215 -0
- package/cli/index.mjs +65 -0
- package/cli/lib/changelog.mjs +126 -0
- package/cli/lib/externals.mjs +46 -0
- package/cli/lib/plugin-dir.mjs +29 -0
- package/cli/lib/signing.mjs +86 -0
- package/cli/lib/static-url-imports.mjs +54 -0
- package/cli/lib/tmxplug.mjs +106 -0
- package/cli/patches/guacamole-common-js-flush.cjs +76 -0
- package/cli/patches/xterm-android-ime.cjs +130 -0
- package/client.d.ts +13 -0
- package/dist/backend.d.ts +1777 -0
- package/dist/backend.js +84 -0
- package/dist/capabilities.d.ts +38 -0
- package/dist/capabilities.js +71 -0
- package/dist/db.d.ts +112 -0
- package/dist/db.js +189 -0
- package/dist/ddl.d.ts +76 -0
- package/dist/ddl.js +678 -0
- package/dist/desktop.d.ts +346 -0
- package/dist/desktop.js +5 -0
- package/dist/frontend.d.ts +1206 -0
- package/dist/frontend.js +388 -0
- package/dist/host/chunk-F3SDZDDG.js +6017 -0
- package/dist/host/chunk-XGWE7BTJ.js +90 -0
- package/dist/host/chunk-XH5NXL6Y.js +56314 -0
- package/dist/host/chunk-YC2MAKSP.js +14 -0
- package/dist/host/linked-server-FZGWQW32.js +12 -0
- package/dist/host/rbac-api-6KDMBVDZ.js +52 -0
- package/dist/host/testing-host.js +414 -0
- package/dist/host/theme.css +91 -0
- package/dist/host/types/src/types/auth-protocols.d.ts +10 -0
- package/dist/host/types/src/types/connection-log.d.ts +13 -0
- package/dist/host/types/src/types/credential-sidebar-preferences.d.ts +38 -0
- package/dist/host/types/src/types/host-defaults.d.ts +60 -0
- package/dist/host/types/src/types/host-sidebar-preferences.d.ts +55 -0
- package/dist/host/types/src/types/index.d.ts +298 -0
- package/dist/host/types/src/types/keybindings.d.ts +27 -0
- package/dist/host/types/src/types/ui-preferences.d.ts +102 -0
- package/dist/host/types/src/types/ui-types.d.ts +260 -0
- package/dist/host/types/src/ui/api/admin-user-data-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/auth-methods-api.d.ts +63 -0
- package/dist/host/types/src/ui/api/credential-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/credentials-api.d.ts +56 -0
- package/dist/host/types/src/ui/api/dashboard-api.d.ts +23 -0
- package/dist/host/types/src/ui/api/external-account-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/host-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/host-status-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/open-tabs-api.d.ts +74 -0
- package/dist/host/types/src/ui/api/plugins-api.d.ts +128 -0
- package/dist/host/types/src/ui/api/rbac-api.d.ts +167 -0
- package/dist/host/types/src/ui/api/settings-api.d.ts +22 -0
- package/dist/host/types/src/ui/api/ssh-host-management-api.d.ts +65 -0
- package/dist/host/types/src/ui/api/sync-api.d.ts +93 -0
- package/dist/host/types/src/ui/api/system-status-api.d.ts +49 -0
- package/dist/host/types/src/ui/api/ui-preferences-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/user-management-api.d.ts +80 -0
- package/dist/host/types/src/ui/auth/Auth.d.ts +12 -0
- package/dist/host/types/src/ui/auth/auth-bits.d.ts +11 -0
- package/dist/host/types/src/ui/auth/silent-signin.d.ts +2 -0
- package/dist/host/types/src/ui/components/FullScreenAppWrapper.d.ts +9 -0
- package/dist/host/types/src/ui/components/alert-dialog.d.ts +14 -0
- package/dist/host/types/src/ui/components/alert.d.ts +9 -0
- package/dist/host/types/src/ui/components/badge.d.ts +9 -0
- package/dist/host/types/src/ui/components/button.d.ts +13 -0
- package/dist/host/types/src/ui/components/card-grid/CardGridCanvas.d.ts +22 -0
- package/dist/host/types/src/ui/components/card-grid/layout-utils.d.ts +26 -0
- package/dist/host/types/src/ui/components/card-grid/types.d.ts +29 -0
- package/dist/host/types/src/ui/components/card-masonry.d.ts +16 -0
- package/dist/host/types/src/ui/components/card.d.ts +11 -0
- package/dist/host/types/src/ui/components/charts/BarSeries.d.ts +16 -0
- package/dist/host/types/src/ui/components/charts/LineChart.d.ts +17 -0
- package/dist/host/types/src/ui/components/charts/RadialGauge.d.ts +18 -0
- package/dist/host/types/src/ui/components/charts/Sparkline.d.ts +22 -0
- package/dist/host/types/src/ui/components/charts/StatRow.d.ts +15 -0
- package/dist/host/types/src/ui/components/charts/geometry.d.ts +20 -0
- package/dist/host/types/src/ui/components/charts/index.d.ts +4 -0
- package/dist/host/types/src/ui/components/checkbox.d.ts +4 -0
- package/dist/host/types/src/ui/components/connection/ConnectionGate.d.ts +56 -0
- package/dist/host/types/src/ui/components/connection/ConnectionLogPanel.d.ts +9 -0
- package/dist/host/types/src/ui/components/connection/ConnectionScreen.d.ts +34 -0
- package/dist/host/types/src/ui/components/connection/connection-status.d.ts +1 -0
- package/dist/host/types/src/ui/components/data-view.d.ts +32 -0
- package/dist/host/types/src/ui/components/dialog.d.ts +17 -0
- package/dist/host/types/src/ui/components/dropdown-menu.d.ts +29 -0
- package/dist/host/types/src/ui/components/empty-state.d.ts +19 -0
- package/dist/host/types/src/ui/components/form-fields.d.ts +115 -0
- package/dist/host/types/src/ui/components/input.d.ts +3 -0
- package/dist/host/types/src/ui/components/kbd.d.ts +12 -0
- package/dist/host/types/src/ui/components/label.d.ts +4 -0
- package/dist/host/types/src/ui/components/manager-card.d.ts +25 -0
- package/dist/host/types/src/ui/components/meter.d.ts +14 -0
- package/dist/host/types/src/ui/components/metric-card.d.ts +18 -0
- package/dist/host/types/src/ui/components/panel-layout.d.ts +83 -0
- package/dist/host/types/src/ui/components/password-input.d.ts +4 -0
- package/dist/host/types/src/ui/components/popover.d.ts +7 -0
- package/dist/host/types/src/ui/components/scroll-area.d.ts +5 -0
- package/dist/host/types/src/ui/components/section-card.d.ts +29 -0
- package/dist/host/types/src/ui/components/select.d.ts +15 -0
- package/dist/host/types/src/ui/components/select2.d.ts +8 -0
- package/dist/host/types/src/ui/components/separator.d.ts +4 -0
- package/dist/host/types/src/ui/components/sheet.d.ts +14 -0
- package/dist/host/types/src/ui/components/sidebar.d.ts +69 -0
- package/dist/host/types/src/ui/components/skeleton.d.ts +2 -0
- package/dist/host/types/src/ui/components/slider.d.ts +4 -0
- package/dist/host/types/src/ui/components/sonner.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/prompt-styles.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/surface-scope.d.ts +79 -0
- package/dist/host/types/src/ui/components/switch.d.ts +4 -0
- package/dist/host/types/src/ui/components/tab-strip.d.ts +19 -0
- package/dist/host/types/src/ui/components/tabs.d.ts +7 -0
- package/dist/host/types/src/ui/components/textarea.d.ts +4 -0
- package/dist/host/types/src/ui/components/theme-provider.d.ts +14 -0
- package/dist/host/types/src/ui/components/tooltip.d.ts +7 -0
- package/dist/host/types/src/ui/contexts/BrandingContext.d.ts +15 -0
- package/dist/host/types/src/ui/contexts/UiPreferencesContext.d.ts +38 -0
- package/dist/host/types/src/ui/contexts/branding-document.d.ts +10 -0
- package/dist/host/types/src/ui/dashboard/dashboard-cards-registry.d.ts +30 -0
- package/dist/host/types/src/ui/hooks/use-action-slot.d.ts +10 -0
- package/dist/host/types/src/ui/hooks/use-adaptive-polling.d.ts +5 -0
- package/dist/host/types/src/ui/hooks/use-mobile.d.ts +1 -0
- package/dist/host/types/src/ui/hooks/use-permissions.d.ts +29 -0
- package/dist/host/types/src/ui/hooks/use-status-color-scheme.d.ts +12 -0
- package/dist/host/types/src/ui/hooks/use-sync-status.d.ts +4 -0
- package/dist/host/types/src/ui/hooks/useSshAuthProviders.d.ts +17 -0
- package/dist/host/types/src/ui/i18n/i18n.d.ts +52 -0
- package/dist/host/types/src/ui/lib/ServerStatusContext.d.ts +33 -0
- package/dist/host/types/src/ui/lib/adaptive-polling.d.ts +29 -0
- package/dist/host/types/src/ui/lib/adaptive-resource-budget.d.ts +39 -0
- package/dist/host/types/src/ui/lib/app-keyboard-shortcuts.d.ts +8 -0
- package/dist/host/types/src/ui/lib/base-path.d.ts +1 -0
- package/dist/host/types/src/ui/lib/clipboard-provider.d.ts +9 -0
- package/dist/host/types/src/ui/lib/clipboard.d.ts +20 -0
- package/dist/host/types/src/ui/lib/connection-origin.d.ts +47 -0
- package/dist/host/types/src/ui/lib/db-health-monitor.d.ts +34 -0
- package/dist/host/types/src/ui/lib/device-id.d.ts +1 -0
- package/dist/host/types/src/ui/lib/electron.d.ts +1 -0
- package/dist/host/types/src/ui/lib/embedded-server-status.d.ts +15 -0
- package/dist/host/types/src/ui/lib/error-message.d.ts +9 -0
- package/dist/host/types/src/ui/lib/frontend-logger.d.ts +67 -0
- package/dist/host/types/src/ui/lib/global-shortcut-handler.d.ts +3 -0
- package/dist/host/types/src/ui/lib/host-defaults-context.d.ts +48 -0
- package/dist/host/types/src/ui/lib/hosts-request-cache.d.ts +9 -0
- package/dist/host/types/src/ui/lib/keybinding-match.d.ts +3 -0
- package/dist/host/types/src/ui/lib/linked-server.d.ts +10 -0
- package/dist/host/types/src/ui/lib/local-adaptive-engine.d.ts +40 -0
- package/dist/host/types/src/ui/lib/permissions.d.ts +16 -0
- package/dist/host/types/src/ui/lib/plugin-i18n.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-icon.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-transport.d.ts +50 -0
- package/dist/host/types/src/ui/lib/registry.d.ts +29 -0
- package/dist/host/types/src/ui/lib/rem.d.ts +7 -0
- package/dist/host/types/src/ui/lib/remote-server-api.d.ts +11 -0
- package/dist/host/types/src/ui/lib/server-status-store.d.ts +37 -0
- package/dist/host/types/src/ui/lib/sync-events.d.ts +2 -0
- package/dist/host/types/src/ui/lib/sync-status.d.ts +6 -0
- package/dist/host/types/src/ui/lib/tab-jump-hotkey.d.ts +4 -0
- package/dist/host/types/src/ui/lib/theme.d.ts +21 -0
- package/dist/host/types/src/ui/lib/ttl-request-cache.d.ts +10 -0
- package/dist/host/types/src/ui/lib/usage-color.d.ts +5 -0
- package/dist/host/types/src/ui/lib/utils.d.ts +2 -0
- package/dist/host/types/src/ui/lib/visible-interval.d.ts +5 -0
- package/dist/host/types/src/ui/lib/widget-title.d.ts +8 -0
- package/dist/host/types/src/ui/lib/ws-auth.d.ts +1 -0
- package/dist/host/types/src/ui/main-axios.d.ts +170 -0
- package/dist/host/types/src/ui/plugin-host/PluginViewPlaceholder.d.ts +13 -0
- package/dist/host/types/src/ui/plugin-host/app.d.ts +18 -0
- package/dist/host/types/src/ui/plugin-host/auth-registry.d.ts +50 -0
- package/dist/host/types/src/ui/plugin-host/bridge.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/component-registry.d.ts +24 -0
- package/dist/host/types/src/ui/plugin-host/desktop.d.ts +7 -0
- package/dist/host/types/src/ui/plugin-host/extension-registry.d.ts +16 -0
- package/dist/host/types/src/ui/plugin-host/host-scope.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/loader.d.ts +52 -0
- package/dist/host/types/src/ui/plugin-host/plugin-store.d.ts +40 -0
- package/dist/host/types/src/ui/plugin-host/scope.d.ts +20 -0
- package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +99 -0
- package/dist/host/types/src/ui/plugin-host/shell-bridge.d.ts +67 -0
- package/dist/host/types/src/ui/plugin-host/view-ownership.d.ts +31 -0
- package/dist/host/types/src/ui/settings/HostPluginSections.d.ts +31 -0
- package/dist/host/types/src/ui/settings/SettingsFields.d.ts +22 -0
- package/dist/host/types/src/ui/settings/host-feature-tabs.d.ts +11 -0
- package/dist/host/types/src/ui/settings/settings-components.d.ts +32 -0
- package/dist/host/types/src/ui/settings/settings-fields-util.d.ts +11 -0
- package/dist/host/types/src/ui/shell/ActionSlot.d.ts +41 -0
- package/dist/host/types/src/ui/shell/TabContext.d.ts +30 -0
- package/dist/host/types/src/ui/shell/action-registry.d.ts +99 -0
- package/dist/host/types/src/ui/shell/keybinding-registry.d.ts +62 -0
- package/dist/host/types/src/ui/shell/palette-registry.d.ts +55 -0
- package/dist/host/types/src/ui/shell/panel-registry.d.ts +24 -0
- package/dist/host/types/src/ui/shell/tab-registry.d.ts +92 -0
- package/dist/host/types/src/ui/sidebar/HostManagerTabs.d.ts +65 -0
- package/dist/host/types/src/ui/sidebar/host-contributions.d.ts +72 -0
- package/dist/host/types/src/ui/sidebar/host-defaults/catalog.d.ts +17 -0
- package/dist/host/types/src/ui/sidebar/host-protocols.d.ts +49 -0
- package/dist/host/types/src/ui/sidebar/quick-connect-host.d.ts +21 -0
- package/dist/host/types/src/ui/sidebar/rail-items.d.ts +103 -0
- package/dist/host/types/src/ui/ssh/connection-log/ConnectionLogContext.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/BrowserSignInDialog.d.ts +18 -0
- package/dist/host/types/src/ui/ssh/dialogs/HostKeyVerificationDialog.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/PassphraseDialog.d.ts +15 -0
- package/dist/host/types/src/ui/ssh/dialogs/SSHAuthDialog.d.ts +20 -0
- package/dist/host/types/src/ui/ssh/dialogs/TOTPDialog.d.ts +13 -0
- package/dist/host/ui.d.ts +1 -0
- package/dist/host/ui.js +31754 -0
- package/dist/host/use-permissions-NULZL43J.js +18 -0
- package/dist/host-commands.d.ts +89 -0
- package/dist/host-commands.js +387 -0
- package/dist/manifest.d.ts +461 -0
- package/dist/manifest.js +1499 -0
- package/dist/settings.d.ts +43 -0
- package/dist/settings.js +168 -0
- package/dist/ssh-certs.d.ts +25 -0
- package/dist/ssh-certs.js +234 -0
- package/dist/ssh-options.d.ts +23 -0
- package/dist/ssh-options.js +1 -0
- package/dist/table-builder.d.ts +26 -0
- package/dist/table-builder.js +87 -0
- package/dist/testing/safe-ports.d.ts +10 -0
- package/dist/testing/safe-ports.js +59 -0
- package/dist/testing/setup.d.ts +7 -0
- package/dist/testing/setup.js +146 -0
- package/dist/testing.d.ts +537 -0
- package/dist/testing.js +1451 -0
- package/dist/vitest-preset.d.ts +54 -0
- package/dist/vitest-preset.js +96 -0
- package/package.json +143 -0
- package/schema/changelog.schema.json +67 -0
- package/schema/manifest.schema.json +1160 -0
- package/tsconfig.plugin.json +31 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const __termixNoGlob = () => ({});
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// <define:import.meta.env>
|
|
9
|
+
var define_import_meta_env_default = { DEV: false, PROD: true, MODE: "production", SSR: false, BASE_URL: "/" };
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
__export,
|
|
13
|
+
define_import_meta_env_default
|
|
14
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const __termixNoGlob = () => ({});
|
|
2
|
+
import {
|
|
3
|
+
assignRoleToUser,
|
|
4
|
+
createRole,
|
|
5
|
+
deleteRole,
|
|
6
|
+
getCredentialAccess,
|
|
7
|
+
getFolderAccess,
|
|
8
|
+
getHostAccess,
|
|
9
|
+
getHostAuthOverride,
|
|
10
|
+
getMyPermissions,
|
|
11
|
+
getPermissionsCatalog,
|
|
12
|
+
getRoleMembers,
|
|
13
|
+
getRoles,
|
|
14
|
+
getSharedHosts,
|
|
15
|
+
getUserRoles,
|
|
16
|
+
removeRoleFromUser,
|
|
17
|
+
revokeCredentialAccess,
|
|
18
|
+
revokeFolderAccess,
|
|
19
|
+
revokeHostAccess,
|
|
20
|
+
setHostAuthOverride,
|
|
21
|
+
shareCredential,
|
|
22
|
+
shareFolder,
|
|
23
|
+
shareHost,
|
|
24
|
+
updateHostAccess,
|
|
25
|
+
updateRole
|
|
26
|
+
} from "./chunk-F3SDZDDG.js";
|
|
27
|
+
import "./chunk-YC2MAKSP.js";
|
|
28
|
+
export {
|
|
29
|
+
assignRoleToUser,
|
|
30
|
+
createRole,
|
|
31
|
+
deleteRole,
|
|
32
|
+
getCredentialAccess,
|
|
33
|
+
getFolderAccess,
|
|
34
|
+
getHostAccess,
|
|
35
|
+
getHostAuthOverride,
|
|
36
|
+
getMyPermissions,
|
|
37
|
+
getPermissionsCatalog,
|
|
38
|
+
getRoleMembers,
|
|
39
|
+
getRoles,
|
|
40
|
+
getSharedHosts,
|
|
41
|
+
getUserRoles,
|
|
42
|
+
removeRoleFromUser,
|
|
43
|
+
revokeCredentialAccess,
|
|
44
|
+
revokeFolderAccess,
|
|
45
|
+
revokeHostAccess,
|
|
46
|
+
setHostAuthOverride,
|
|
47
|
+
shareCredential,
|
|
48
|
+
shareFolder,
|
|
49
|
+
shareHost,
|
|
50
|
+
updateHostAccess,
|
|
51
|
+
updateRole
|
|
52
|
+
};
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
const __termixNoGlob = () => ({});
|
|
2
|
+
import {
|
|
3
|
+
ActionSlot,
|
|
4
|
+
ComponentSlot,
|
|
5
|
+
PluginViewPlaceholder,
|
|
6
|
+
SurfaceScope,
|
|
7
|
+
ThemeProvider,
|
|
8
|
+
createPluginApp,
|
|
9
|
+
getExtension,
|
|
10
|
+
getHostEditorSection,
|
|
11
|
+
getLoginMethodUI,
|
|
12
|
+
getPanel,
|
|
13
|
+
getRegisteredDashboardCard,
|
|
14
|
+
getSecondFactorUI,
|
|
15
|
+
getSettingsComponent,
|
|
16
|
+
getSlotContributions,
|
|
17
|
+
hostActionsFor,
|
|
18
|
+
hostEditorSectionList,
|
|
19
|
+
i18n_default,
|
|
20
|
+
installPluginHostBridge,
|
|
21
|
+
listActions,
|
|
22
|
+
listExtensions,
|
|
23
|
+
listHostActions,
|
|
24
|
+
listHostProtocols,
|
|
25
|
+
listKeybindingActions,
|
|
26
|
+
listKeybindingDefaults,
|
|
27
|
+
listLoginMethodUIs,
|
|
28
|
+
listPaletteGroups,
|
|
29
|
+
listPanels,
|
|
30
|
+
listRegisteredRailItems,
|
|
31
|
+
listSecondFactorUIs,
|
|
32
|
+
listSettingsComponents,
|
|
33
|
+
loadPaletteGroup,
|
|
34
|
+
notifyShellReady,
|
|
35
|
+
registeredDashboardCardList,
|
|
36
|
+
resetShellBridge,
|
|
37
|
+
setPluginApiForTesting,
|
|
38
|
+
setRemoteServerUrlForTesting,
|
|
39
|
+
setShellCallbacks,
|
|
40
|
+
setShellHosts,
|
|
41
|
+
setShellLayoutProvider
|
|
42
|
+
} from "./chunk-XH5NXL6Y.js";
|
|
43
|
+
import {
|
|
44
|
+
setPermissionsForTesting
|
|
45
|
+
} from "./chunk-XGWE7BTJ.js";
|
|
46
|
+
import {
|
|
47
|
+
getTabType,
|
|
48
|
+
listTabTypes,
|
|
49
|
+
setFrontendState,
|
|
50
|
+
setPluginSummaries
|
|
51
|
+
} from "./chunk-F3SDZDDG.js";
|
|
52
|
+
import "./chunk-YC2MAKSP.js";
|
|
53
|
+
|
|
54
|
+
// src/ui/plugin-host/testing-host.tsx
|
|
55
|
+
import { render } from "@testing-library/react";
|
|
56
|
+
|
|
57
|
+
// src/ui/shell/shell-layout.ts
|
|
58
|
+
var CORE_UNSAVED = /* @__PURE__ */ new Set([
|
|
59
|
+
"dashboard",
|
|
60
|
+
"host-manager",
|
|
61
|
+
"settings",
|
|
62
|
+
"user-profile",
|
|
63
|
+
"admin-settings",
|
|
64
|
+
"split-screen"
|
|
65
|
+
]);
|
|
66
|
+
function isUnregisteredPluginTabType(type) {
|
|
67
|
+
return !CORE_UNSAVED.has(type) && !getTabType(type);
|
|
68
|
+
}
|
|
69
|
+
function opensAsSingleton(type, hasHost) {
|
|
70
|
+
const def = getTabType(type);
|
|
71
|
+
return !!def && (!!def.singleton || !!def.hostless && !hasHost);
|
|
72
|
+
}
|
|
73
|
+
function resolveLayoutTabTarget(snapshot, allHosts) {
|
|
74
|
+
let host;
|
|
75
|
+
if (snapshot.hostSyncId) {
|
|
76
|
+
host = allHosts.find((h) => h.syncId === snapshot.hostSyncId);
|
|
77
|
+
if (!host) return { kind: "skip" };
|
|
78
|
+
}
|
|
79
|
+
if (opensAsSingleton(snapshot.type, !!host)) {
|
|
80
|
+
return { kind: "singleton", host };
|
|
81
|
+
}
|
|
82
|
+
if (!host && isUnregisteredPluginTabType(snapshot.type)) {
|
|
83
|
+
return { kind: "singleton" };
|
|
84
|
+
}
|
|
85
|
+
return host ? { kind: "host", host } : { kind: "skip" };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// src/ui/plugin-host/testing-host.tsx
|
|
89
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
90
|
+
function recordingShell(calls) {
|
|
91
|
+
const record = (method) => (...args) => {
|
|
92
|
+
calls.push({ method, args });
|
|
93
|
+
};
|
|
94
|
+
return {
|
|
95
|
+
openTab: record("openTab"),
|
|
96
|
+
openSingletonTab: record("openSingletonTab"),
|
|
97
|
+
connectHost: record("connectHost"),
|
|
98
|
+
closeTab: record("closeTab"),
|
|
99
|
+
renameTab: record("renameTab"),
|
|
100
|
+
openRailView: record("openRailView"),
|
|
101
|
+
closeRailView: record("closeRailView"),
|
|
102
|
+
openHostEditor: record("openHostEditor"),
|
|
103
|
+
saveQuickConnect: async (...args) => {
|
|
104
|
+
calls.push({ method: "saveQuickConnect", args });
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function wrap(element) {
|
|
109
|
+
return render(
|
|
110
|
+
/* @__PURE__ */ jsx(ThemeProvider, { defaultTheme: "dark", storageKey: "termix-test-theme", children: /* @__PURE__ */ jsx(SurfaceScope, { className: "h-full", children: element }) })
|
|
111
|
+
).container;
|
|
112
|
+
}
|
|
113
|
+
function missing(kind, id) {
|
|
114
|
+
throw new Error(`renderWithApp: nothing registered ${kind} "${id}"`);
|
|
115
|
+
}
|
|
116
|
+
async function renderPlugin(plugin, options = {}) {
|
|
117
|
+
const pluginId = options.pluginId ?? options.manifest?.id ?? "test-plugin";
|
|
118
|
+
const manifest = {
|
|
119
|
+
id: pluginId,
|
|
120
|
+
name: pluginId,
|
|
121
|
+
version: "1.0.0",
|
|
122
|
+
description: "",
|
|
123
|
+
author: { name: "test" },
|
|
124
|
+
license: "MIT",
|
|
125
|
+
category: "Productivity",
|
|
126
|
+
engine: { termix: ">=2.9.0", api: "1" },
|
|
127
|
+
capabilities: [],
|
|
128
|
+
...options.manifest
|
|
129
|
+
};
|
|
130
|
+
installPluginHostBridge();
|
|
131
|
+
resetShellBridge();
|
|
132
|
+
setPermissionsForTesting(options.permissions ?? [], options.isAdmin);
|
|
133
|
+
const hosts = options.hosts ?? [];
|
|
134
|
+
setShellHosts(hosts);
|
|
135
|
+
const shellCalls = [];
|
|
136
|
+
const shell = recordingShell(shellCalls);
|
|
137
|
+
setShellCallbacks(shell);
|
|
138
|
+
let layout = options.layout ?? null;
|
|
139
|
+
const opened = [];
|
|
140
|
+
setShellLayoutProvider({
|
|
141
|
+
getLayout: () => layout,
|
|
142
|
+
applyLayout: async (next, applyOptions) => {
|
|
143
|
+
shellCalls.push({ method: "applyLayout", args: [next, applyOptions] });
|
|
144
|
+
layout = next;
|
|
145
|
+
opened.length = 0;
|
|
146
|
+
const skipped = [];
|
|
147
|
+
const tabs = next.tabs ?? [];
|
|
148
|
+
for (const snapshot of tabs) {
|
|
149
|
+
const target = resolveLayoutTabTarget(snapshot, hosts);
|
|
150
|
+
if (target.kind === "skip") {
|
|
151
|
+
skipped.push(snapshot.hostNameSnapshot || snapshot.label);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
opened.push({
|
|
155
|
+
type: snapshot.type,
|
|
156
|
+
hostId: "host" in target && target.host ? Number(target.host.id) : void 0,
|
|
157
|
+
label: snapshot.customLabel ?? snapshot.label
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return { skipped };
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
const summary = {
|
|
164
|
+
id: pluginId,
|
|
165
|
+
name: manifest.name,
|
|
166
|
+
version: manifest.version,
|
|
167
|
+
enabled: true,
|
|
168
|
+
state: "active",
|
|
169
|
+
contributes: manifest.contributes ?? null,
|
|
170
|
+
frontend: true
|
|
171
|
+
};
|
|
172
|
+
setPluginSummaries([summary]);
|
|
173
|
+
if (options.locales) {
|
|
174
|
+
i18n_default.addResourceBundle(
|
|
175
|
+
"en",
|
|
176
|
+
pluginId,
|
|
177
|
+
options.locales,
|
|
178
|
+
true,
|
|
179
|
+
true
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
setPluginApiForTesting(
|
|
183
|
+
pluginId,
|
|
184
|
+
options.api ?? null
|
|
185
|
+
);
|
|
186
|
+
setRemoteServerUrlForTesting(options.remoteServerUrl ?? null);
|
|
187
|
+
const handle = createPluginApp(pluginId, manifest, summary.contributes, {
|
|
188
|
+
guest: options.guest
|
|
189
|
+
});
|
|
190
|
+
await plugin.activate(handle.app);
|
|
191
|
+
setFrontendState(pluginId, "active");
|
|
192
|
+
if (options.ready) notifyShellReady();
|
|
193
|
+
const mine = (items) => items.filter((item) => item.pluginId === pluginId);
|
|
194
|
+
const tabRecord = (type, host) => ({
|
|
195
|
+
id: `${type}-test`,
|
|
196
|
+
instanceId: `${type}-test`,
|
|
197
|
+
type,
|
|
198
|
+
label: type,
|
|
199
|
+
host,
|
|
200
|
+
openedAt: 0
|
|
201
|
+
});
|
|
202
|
+
return {
|
|
203
|
+
app: handle.app,
|
|
204
|
+
shellCalls,
|
|
205
|
+
registered: {
|
|
206
|
+
railItems: () => mine(listRegisteredRailItems()).map((item) => ({
|
|
207
|
+
id: item.id,
|
|
208
|
+
hidden: item.hidden,
|
|
209
|
+
permission: item.permission
|
|
210
|
+
})),
|
|
211
|
+
tabs: () => mine(listTabTypes()).map((def) => def.id),
|
|
212
|
+
panels: () => mine(listPanels()).map((panel) => panel.id),
|
|
213
|
+
hostActions: () => mine(listHostActions()).map((action) => ({
|
|
214
|
+
id: action.id,
|
|
215
|
+
tabType: action.tabType
|
|
216
|
+
})),
|
|
217
|
+
hostActionsFor: (host) => mine(
|
|
218
|
+
hostActionsFor(listHostActions(), host)
|
|
219
|
+
),
|
|
220
|
+
hostProtocols: () => mine(listHostProtocols()).map((protocol) => protocol.id),
|
|
221
|
+
hostEditorSections: () => mine(hostEditorSectionList()).map((section) => section.id),
|
|
222
|
+
dashboardCards: () => mine(registeredDashboardCardList()).map((card) => card.id),
|
|
223
|
+
extensions: (pointId) => mine(listExtensions(pointId)).map((extension) => extension.id),
|
|
224
|
+
settingsComponents: () => listSettingsComponents().filter((key) => key.startsWith(`${pluginId}:`)).map((key) => key.slice(pluginId.length + 1)),
|
|
225
|
+
slot: (slotId) => mine(getSlotContributions(slotId)).map(
|
|
226
|
+
(contribution) => contribution.actionId
|
|
227
|
+
),
|
|
228
|
+
actions: () => mine(listActions()).map((action) => action.id),
|
|
229
|
+
loginMethods: () => mine(listLoginMethodUIs()).map((method) => method.id),
|
|
230
|
+
secondFactors: () => mine(listSecondFactorUIs()).map((factor) => factor.id),
|
|
231
|
+
paletteGroups: () => mine(listPaletteGroups()).map((group) => group.id),
|
|
232
|
+
keybindingActions: () => mine(listKeybindingActions()).map((action) => action.id),
|
|
233
|
+
keybindingDefaults: () => mine(listKeybindingDefaults()).map((binding) => binding.id)
|
|
234
|
+
},
|
|
235
|
+
async loadPaletteGroup(id) {
|
|
236
|
+
const group = listPaletteGroups().find((entry) => entry.id === id) ?? missing("a palette group", id);
|
|
237
|
+
return await loadPaletteGroup(group);
|
|
238
|
+
},
|
|
239
|
+
renderTab(type, props = {}) {
|
|
240
|
+
const def = getTabType(type) ?? missing("a tab", type);
|
|
241
|
+
const Component = def.component;
|
|
242
|
+
const host = props.host;
|
|
243
|
+
return wrap(
|
|
244
|
+
/* @__PURE__ */ jsx(
|
|
245
|
+
Component,
|
|
246
|
+
{
|
|
247
|
+
tab: tabRecord(type, host),
|
|
248
|
+
host,
|
|
249
|
+
label: type,
|
|
250
|
+
isVisible: true,
|
|
251
|
+
isFocusedPane: true,
|
|
252
|
+
inSplit: false,
|
|
253
|
+
handleRef: null,
|
|
254
|
+
shell,
|
|
255
|
+
...props
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
);
|
|
259
|
+
},
|
|
260
|
+
openedTabs: () => opened.map((tab) => ({ ...tab })),
|
|
261
|
+
renderOpenedTab(index) {
|
|
262
|
+
const tab = opened[index] ?? missing("an opened tab at index", index);
|
|
263
|
+
const def = getTabType(tab.type);
|
|
264
|
+
if (!def) {
|
|
265
|
+
return wrap(/* @__PURE__ */ jsx(PluginViewPlaceholder, { kind: "tab", viewId: tab.type }));
|
|
266
|
+
}
|
|
267
|
+
const Component = def.component;
|
|
268
|
+
return wrap(
|
|
269
|
+
/* @__PURE__ */ jsx(
|
|
270
|
+
Component,
|
|
271
|
+
{
|
|
272
|
+
tab: tabRecord(tab.type),
|
|
273
|
+
label: tab.label,
|
|
274
|
+
isVisible: true,
|
|
275
|
+
isFocusedPane: true,
|
|
276
|
+
inSplit: false,
|
|
277
|
+
handleRef: null,
|
|
278
|
+
shell
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
);
|
|
282
|
+
},
|
|
283
|
+
renderPanel(id, props = {}) {
|
|
284
|
+
const panel = getPanel(id) ?? missing("a panel", id);
|
|
285
|
+
const Component = panel.component;
|
|
286
|
+
return wrap(
|
|
287
|
+
/* @__PURE__ */ jsx(
|
|
288
|
+
Component,
|
|
289
|
+
{
|
|
290
|
+
active: true,
|
|
291
|
+
shell,
|
|
292
|
+
setEditing: () => {
|
|
293
|
+
},
|
|
294
|
+
placement: "left",
|
|
295
|
+
...props
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
);
|
|
299
|
+
},
|
|
300
|
+
renderExtension(pointId, id, component = "view", props = {}) {
|
|
301
|
+
const extension = getExtension(pointId, id);
|
|
302
|
+
const Component = extension?.pluginId === pluginId ? extension.components?.[component] : void 0;
|
|
303
|
+
if (!Component) missing(`an extension "${component}" component`, id);
|
|
304
|
+
return wrap(/* @__PURE__ */ jsx(Component, { ...props }));
|
|
305
|
+
},
|
|
306
|
+
renderDashboardCard(id) {
|
|
307
|
+
const card = getRegisteredDashboardCard(id) ?? missing("a card", id);
|
|
308
|
+
const Component = card.component;
|
|
309
|
+
return wrap(/* @__PURE__ */ jsx(Component, { isVisible: true, shell }));
|
|
310
|
+
},
|
|
311
|
+
renderHostEditorSection(id, props = {}) {
|
|
312
|
+
const section = getHostEditorSection(id) ?? missing("a host editor section", id);
|
|
313
|
+
const Component = section.component;
|
|
314
|
+
return wrap(
|
|
315
|
+
/* @__PURE__ */ jsx(
|
|
316
|
+
Component,
|
|
317
|
+
{
|
|
318
|
+
form: {},
|
|
319
|
+
setField: () => {
|
|
320
|
+
},
|
|
321
|
+
updateForm: () => {
|
|
322
|
+
},
|
|
323
|
+
protocols: {},
|
|
324
|
+
...props
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
);
|
|
328
|
+
},
|
|
329
|
+
renderSettingsComponent(componentId, props = {}) {
|
|
330
|
+
const Component = getSettingsComponent(pluginId, componentId) ?? missing("a settings component", componentId);
|
|
331
|
+
return wrap(
|
|
332
|
+
/* @__PURE__ */ jsx(
|
|
333
|
+
Component,
|
|
334
|
+
{
|
|
335
|
+
pluginId,
|
|
336
|
+
values: {},
|
|
337
|
+
setValue: () => {
|
|
338
|
+
},
|
|
339
|
+
running: true,
|
|
340
|
+
...props
|
|
341
|
+
}
|
|
342
|
+
)
|
|
343
|
+
);
|
|
344
|
+
},
|
|
345
|
+
renderLoginMethod(id, props = {}) {
|
|
346
|
+
const method = getLoginMethodUI(id) ?? missing("a login method", id);
|
|
347
|
+
const Component = method.component;
|
|
348
|
+
return wrap(
|
|
349
|
+
/* @__PURE__ */ jsx(
|
|
350
|
+
Component,
|
|
351
|
+
{
|
|
352
|
+
methodId: id,
|
|
353
|
+
instances: [],
|
|
354
|
+
rememberMe: false,
|
|
355
|
+
disabled: false,
|
|
356
|
+
submit: async () => {
|
|
357
|
+
},
|
|
358
|
+
startRedirect: async () => {
|
|
359
|
+
},
|
|
360
|
+
complete: async () => {
|
|
361
|
+
},
|
|
362
|
+
...props
|
|
363
|
+
}
|
|
364
|
+
)
|
|
365
|
+
);
|
|
366
|
+
},
|
|
367
|
+
renderSecondFactor(id, props = {}) {
|
|
368
|
+
const factor = getSecondFactorUI(id) ?? missing("a second factor", id);
|
|
369
|
+
const Component = factor.component;
|
|
370
|
+
return wrap(
|
|
371
|
+
/* @__PURE__ */ jsx(
|
|
372
|
+
Component,
|
|
373
|
+
{
|
|
374
|
+
factorId: id,
|
|
375
|
+
rememberMe: false,
|
|
376
|
+
disabled: false,
|
|
377
|
+
verify: async () => {
|
|
378
|
+
},
|
|
379
|
+
challenge: async () => null,
|
|
380
|
+
cancel: () => {
|
|
381
|
+
},
|
|
382
|
+
...props
|
|
383
|
+
}
|
|
384
|
+
)
|
|
385
|
+
);
|
|
386
|
+
},
|
|
387
|
+
renderEnrollment(id) {
|
|
388
|
+
const entry = getSecondFactorUI(id) ?? getLoginMethodUI(id);
|
|
389
|
+
const Component = entry?.enrollment ?? missing("an enrolment section", id);
|
|
390
|
+
return wrap(/* @__PURE__ */ jsx(Component, {}));
|
|
391
|
+
},
|
|
392
|
+
renderSlot(slotId, props = {}) {
|
|
393
|
+
return wrap(
|
|
394
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
395
|
+
/* @__PURE__ */ jsx(ActionSlot, { slotId }),
|
|
396
|
+
/* @__PURE__ */ jsx(ComponentSlot, { slotId, props })
|
|
397
|
+
] })
|
|
398
|
+
);
|
|
399
|
+
},
|
|
400
|
+
async deactivate() {
|
|
401
|
+
try {
|
|
402
|
+
await plugin.deactivate?.();
|
|
403
|
+
} finally {
|
|
404
|
+
handle.dispose();
|
|
405
|
+
setFrontendState(pluginId, "inactive");
|
|
406
|
+
setPluginApiForTesting(pluginId, null);
|
|
407
|
+
setRemoteServerUrlForTesting(null);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
export {
|
|
413
|
+
renderPlugin
|
|
414
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The design tokens plugins build against: custom variants, the Tailwind
|
|
3
|
+
* theme and shared utilities. Core imports it, and the SDK ships a copy that
|
|
4
|
+
* `termix-plugin build` compiles a plugin's own classes against, so a plugin
|
|
5
|
+
* class means the same thing wherever it is compiled. Values only; anything
|
|
6
|
+
* that renders on its own belongs in index.css.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
@custom-variant dark (&:is(.dark *));
|
|
10
|
+
@custom-variant dracula (&:is(.dracula *));
|
|
11
|
+
@custom-variant catppuccin (&:is(.catppuccin *));
|
|
12
|
+
@custom-variant nord (&:is(.nord *));
|
|
13
|
+
@custom-variant solarized (&:is(.solarized *));
|
|
14
|
+
@custom-variant tokyo-night (&:is(.tokyo-night *));
|
|
15
|
+
@custom-variant one-dark (&:is(.one-dark *));
|
|
16
|
+
@custom-variant gruvbox (&:is(.gruvbox *));
|
|
17
|
+
|
|
18
|
+
@theme inline {
|
|
19
|
+
--font-heading: var(--font-mono);
|
|
20
|
+
--font-mono: var(--font-ui, "JetBrains Mono Variable", monospace);
|
|
21
|
+
--color-accent-brand: var(--accent-brand);
|
|
22
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
23
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
24
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
25
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
26
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
27
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
28
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
29
|
+
--color-sidebar: var(--sidebar);
|
|
30
|
+
--color-chart-5: var(--chart-5);
|
|
31
|
+
--color-chart-4: var(--chart-4);
|
|
32
|
+
--color-chart-3: var(--chart-3);
|
|
33
|
+
--color-chart-2: var(--chart-2);
|
|
34
|
+
--color-chart-1: var(--chart-1);
|
|
35
|
+
--color-ring: var(--ring);
|
|
36
|
+
--color-input: var(--input);
|
|
37
|
+
--color-border: var(--border);
|
|
38
|
+
--color-destructive: var(--destructive);
|
|
39
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
40
|
+
--color-accent: var(--accent);
|
|
41
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
42
|
+
--color-muted: var(--muted);
|
|
43
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
44
|
+
--color-secondary: var(--secondary);
|
|
45
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
46
|
+
--color-primary: var(--primary);
|
|
47
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
48
|
+
--color-popover: var(--popover);
|
|
49
|
+
--color-card-foreground: var(--card-foreground);
|
|
50
|
+
--color-card: var(--card);
|
|
51
|
+
--color-foreground: var(--foreground);
|
|
52
|
+
--color-background: var(--background);
|
|
53
|
+
--color-surface: var(--surface);
|
|
54
|
+
--color-surface-dim: var(--surface-dim);
|
|
55
|
+
--color-warning: var(--warning);
|
|
56
|
+
--color-terminal-bg: var(--terminal-bg);
|
|
57
|
+
--color-bg-base: var(--bg-base);
|
|
58
|
+
--color-border-base: var(--border-base);
|
|
59
|
+
--color-foreground-secondary: var(--foreground-secondary);
|
|
60
|
+
--color-canvas: var(--canvas);
|
|
61
|
+
--color-overlay: var(--overlay);
|
|
62
|
+
--radius-sm: calc(var(--radius) * 0.6);
|
|
63
|
+
--radius-md: calc(var(--radius) * 0.8);
|
|
64
|
+
--radius-lg: var(--radius);
|
|
65
|
+
--radius-xl: calc(var(--radius) * 1.4);
|
|
66
|
+
--radius-2xl: calc(var(--radius) * 1.8);
|
|
67
|
+
--radius-3xl: calc(var(--radius) * 2.2);
|
|
68
|
+
--radius-4xl: calc(var(--radius) * 2.6);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@utility scrollbar-none {
|
|
72
|
+
scrollbar-width: none;
|
|
73
|
+
&::-webkit-scrollbar {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@utility thin-scrollbar {
|
|
79
|
+
scrollbar-width: thin;
|
|
80
|
+
scrollbar-color: oklch(1 0 0 / 15%) transparent;
|
|
81
|
+
&::-webkit-scrollbar {
|
|
82
|
+
width: 4px;
|
|
83
|
+
}
|
|
84
|
+
&::-webkit-scrollbar-track {
|
|
85
|
+
background: transparent;
|
|
86
|
+
}
|
|
87
|
+
&::-webkit-scrollbar-thumb {
|
|
88
|
+
background: oklch(1 0 0 / 15%);
|
|
89
|
+
border-radius: 2px;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Core's own protocol. Every other one is declared by a plugin. */
|
|
2
|
+
export declare const SSH_AUTH_PROTOCOL = "ssh";
|
|
3
|
+
/** "ssh", or a protocol id a plugin declares in contributes.protocols. */
|
|
4
|
+
export type AuthOverrideProtocol = string;
|
|
5
|
+
export interface HostAuthOverrideState<CredentialId extends number | string = number> {
|
|
6
|
+
credentialId?: CredentialId;
|
|
7
|
+
required: boolean;
|
|
8
|
+
ownerAuthShared: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type HostAuthOverrides<CredentialId extends number | string = number> = Partial<Record<AuthOverrideProtocol, HostAuthOverrideState<CredentialId>>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a connection is. Core's SSH pipeline uses the named stages; a plugin
|
|
3
|
+
* may log its own (such as "guac_ready") and they pass through unchanged.
|
|
4
|
+
*/
|
|
5
|
+
export type ConnectionStage = "dns" | "tcp" | "handshake" | "auth" | "connected" | "connection" | "error" | "proxy" | "jump" | "validation" | (string & {});
|
|
6
|
+
export type LogEntry = {
|
|
7
|
+
id: string;
|
|
8
|
+
timestamp: Date;
|
|
9
|
+
type: "info" | "success" | "warning" | "error";
|
|
10
|
+
stage: ConnectionStage;
|
|
11
|
+
message: string;
|
|
12
|
+
details?: Record<string, unknown> | string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential sidebar preferences model. Shared by the frontend sidebar and
|
|
3
|
+
* the backend preferences endpoint (no framework imports, mirrors
|
|
4
|
+
* ./host-sidebar-preferences.ts's dependency-free convention). Independent
|
|
5
|
+
* from HostSidebarPreferences by design — a separate parallel system, not a
|
|
6
|
+
* shared blob, matching how credentialSortKey/credentialFilterState were
|
|
7
|
+
* already independently namespaced from hostSortKey/etc. before this port.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately smaller than HostSidebarPreferences: no groupKey selector
|
|
10
|
+
* (folder is the only grouping credentials have, so there's nothing to
|
|
11
|
+
* pick), no statusColorScheme (credentials have no online/offline concept).
|
|
12
|
+
*/
|
|
13
|
+
export declare const CREDENTIAL_SIDEBAR_PREFS_VERSION = 1;
|
|
14
|
+
export type CredentialSortKey = "default" | "name-asc" | "name-desc" | "username-asc" | "username-desc" | "manual";
|
|
15
|
+
export type CredentialDensity = "comfortable" | "compact";
|
|
16
|
+
export type CredentialTrayTrigger = "always" | "hover" | "click" | "actionsOnly";
|
|
17
|
+
export interface CredentialSidebarFilterState {
|
|
18
|
+
/** Credential type ids; plugins can add their own. */
|
|
19
|
+
type: string[];
|
|
20
|
+
tags: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface CredentialSidebarDisplayPreferences {
|
|
23
|
+
density: CredentialDensity;
|
|
24
|
+
showTags: boolean;
|
|
25
|
+
trayTrigger: CredentialTrayTrigger;
|
|
26
|
+
}
|
|
27
|
+
export interface CredentialSidebarPreferences {
|
|
28
|
+
version: number;
|
|
29
|
+
sort: {
|
|
30
|
+
key: CredentialSortKey;
|
|
31
|
+
pinnedFirst: boolean;
|
|
32
|
+
};
|
|
33
|
+
filters: CredentialSidebarFilterState;
|
|
34
|
+
openFolders: string[];
|
|
35
|
+
display: CredentialSidebarDisplayPreferences;
|
|
36
|
+
}
|
|
37
|
+
export declare function defaultCredentialSidebarPreferences(): CredentialSidebarPreferences;
|
|
38
|
+
export declare function sanitizeCredentialSidebarPreferences(input: unknown): CredentialSidebarPreferences;
|