feat: move terminal settings, look and ssh tools into ssh-terminal plugin

This commit is contained in:
LukeGus committed 2026-09-29 02:38:37 -05:00
1 parent ffa872ebd3
commit d9bba10612
242 files changed
+25071 -7207

No files matched your search

+5
View File
@@ -10,6 +10,8 @@
* transports could leave core's internals behind.
*/
import type { HostSshOptions } from "./ssh-options.js";
export type { HostSshOptions } from "./ssh-options.js";
import type { PluginManifest, PluginSettingsField } from "./manifest.js";
import type { PluginTableDefinition } from "./db.js";
@@ -575,6 +577,8 @@ export interface PluginHostRecord {
folder: string | null;
jumpHosts?: unknown;
enableSsh?: boolean | null;
/** Keepalive, legacy algorithms, agent and environment options. */
sshOptions?: HostSshOptions | null;
createdAt?: string | null;
updatedAt?: string | null;
[key: string]: unknown;
@@ -775,6 +779,7 @@ export interface PluginSshHost {
username: string;
userId?: string | null;
authType?: string | null;
sshOptions?: HostSshOptions | null;
[key: string]: unknown;
}
+12 -9
View File
@@ -16,6 +16,8 @@
import { useCallback, useEffect, useRef, useState } from "react";
import type { ComponentType, ReactNode, Ref } from "react";
import type { PluginManifest } from "./manifest.js";
import type { HostSshOptions } from "./ssh-options.js";
export type { HostSshOptions } from "./ssh-options.js";
export type Disposer = () => void;
@@ -39,6 +41,10 @@ export interface PluginHostRecord {
username?: string;
folder?: string;
tags?: string[];
/** Keepalive, legacy algorithms, agent and environment options. */
sshOptions?: HostSshOptions | null;
/** Each enabled plugin's host settings, secrets redacted. */
pluginSettings?: Record<string, Record<string, unknown>>;
[key: string]: unknown;
}
@@ -863,10 +869,10 @@ export interface PluginCoreApi {
) => Promise<void>;
/** The user's custom keybindings, enabled or not. */
getCustomKeybindings: () => Promise<CustomKeybinding[]>;
/** Turns auto tmux on or off in a host's terminal options. */
setHostAutoTmux: (hostId: number, autoTmux: boolean) => Promise<void>;
/** A browser-side UI preference (a cookie, or the desktop app's store). */
getClientPreference: (name: string) => string | undefined;
/** Saves a browser-side UI preference where getClientPreference reads it. */
setClientPreference: (name: string, value: string) => void;
/** Every host the user can see, fetched now rather than from the shell's cache. */
listHosts: () => Promise<PluginHostRecord[]>;
/** The user's stored credentials, without their secrets. */
@@ -1015,17 +1021,14 @@ export function getCustomKeybindings(): Promise<CustomKeybinding[]> {
return requireHost().core.getCustomKeybindings();
}
export function setHostAutoTmux(
hostId: number,
autoTmux: boolean,
): Promise<void> {
return requireHost().core.setHostAutoTmux(hostId, autoTmux);
}
export function getClientPreference(name: string): string | undefined {
return requireHost().core.getClientPreference(name);
}
export function setClientPreference(name: string, value: string): void {
requireHost().core.setClientPreference(name, value);
}
export function listHosts(): Promise<PluginHostRecord[]> {
return requireHost().core.listHosts();
}
+20
View File
@@ -0,0 +1,20 @@
/**
* A host's SSH connection options, as core's connect pipeline reads them
* (`ssh_data.ssh_options`). Shared by the backend and frontend host records.
*/
export interface HostSshOptions {
/** Seconds between keepalive packets. */
keepaliveInterval?: number;
/** Missed keepalives before the connection is dropped. */
keepaliveCountMax?: number;
/** Offer older key exchange, cipher and MAC algorithms. On unless false. */
allowLegacyAlgorithms?: boolean;
/** Agent auth: the agent socket to use instead of the default. */
agentSocketPath?: string | null;
/** Agent auth: the key comment or fingerprint to offer first. */
agentIdentity?: string | null;
/** Forward the agent (or the host's key) into the session. */
agentForwarding?: boolean;
/** Variables exported into an interactive session. */
environmentVariables?: Array<{ key: string; value: string }>;
}
+1 -1
View File
@@ -137,8 +137,8 @@ const offline = () =>
getHostPassword: async () => null,
patchOpenTab: async () => {},
getCustomKeybindings: async () => [],
setHostAutoTmux: async () => {},
getClientPreference: () => undefined,
setClientPreference: () => {},
listHosts: async () => [],
listCredentials: async () => [],
},