Files
kandev/apps/web/e2e/helpers/api-client-ssh.ts
T
José Almeida ed76b7b6f0 refactor(e2e): extract SSH HTTP shapes into api-client-ssh.ts
api-client.ts was already over the 600-line lint cap on main (1528
lines); the SSH additions made it worse. Split the SSH HTTP shape
types into a dedicated module and re-export from api-client.ts so
existing callers keep working. The methods themselves stay on
ApiClient as thin pass-throughs since splitting them out across the
class boundary would change every test call site.

Also document the per-executor bound on the SSH listSessions per-row
GetTaskSession lookup (typical N < 10), and what a batch path would
need (a repo method to fetch task_sessions by id list). Cubic /
Greptile P2.
2026-05-18 00:05:15 +01:00

52 lines
1.2 KiB
TypeScript

// SSH-specific HTTP shapes for the e2e ApiClient. Kept in a dedicated module
// (apart from helpers/api-client.ts) so adding SSH fields doesn't keep growing
// the omnibus client file. ApiClient methods that exercise these shapes live
// on the ApiClient class itself, alongside the rest of the surface.
export type SSHIdentitySourceBody = "agent" | "file";
export type SSHTestRequestBody = {
name: string;
host_alias?: string;
host?: string;
port?: number;
user?: string;
identity_source?: SSHIdentitySourceBody;
identity_file?: string;
proxy_jump?: string;
};
export type SSHTestStepBody = {
name: string;
duration_ms: number;
success: boolean;
output?: string;
error?: string;
};
export type SSHTestResultBody = {
success: boolean;
fingerprint?: string;
uname_all?: string;
arch?: string;
git_version?: string;
agentctl_action?: "cached" | "uploaded" | "skipped";
steps: SSHTestStepBody[];
total_duration_ms: number;
error?: string;
};
export type SSHSessionBody = {
session_id: string;
task_id: string;
task_title?: string;
host: string;
user?: string;
remote_task_dir?: string;
remote_agentctl_port?: number;
local_forward_port?: number;
status: string;
uptime_seconds: number;
created_at: string;
};