/**
 * SSH HTTP layer — Phase 5 of the SSH tool integration plan
 * (docs/superpowers/plans/2026-05-12-ssh-tool-integration.md).
 *
 * Two router factories:
 *   createSshUserRouter — `/api/ssh/connections` + `/api/ssh/grants`
 *   createSshAdminRouter — `/api/ssh/admin/*`
 *
 * Both are mounted from src/bridge/server.ts ONLY when `ssh.enabled=true`
 * AND `MCP_ENCRYPTION_KEY` is configured (the master key gates the envelope-
 * encrypted DEKs in Phase 1a). When SSH is disabled, no router is mounted —
 * the endpoints simply do not exist (no 404 distinction from a missing route).
 *
 * Design conventions:
 * - Manual JSON validation (no zod) for consistency with pieces-api / mcp-api.
 * - Reason gating: every admin write path requires `body.reason` >= 8 chars.
 * - Audit logging: every admin write uses beginAudit → action → completeAudit
 *   (or beginAndComplete for synchronous DB-only changes); user actions audit
 *   only the privileged ones (test, verify, replace).
 * - Maintenance mode: when active, all write endpoints — user AND admin —
 *   return 503 with `Retry-After: 30`. Read endpoints stay available.
 * - Buffer hygiene: decrypted private keys are passed to ssh-session and then
 *   cleared on every code path (success, error, validation failure).
 * - Response shaping: `presentConnection()` strips encrypted blob fields and
 *   the pending host-key token (token only returned on test / observation).
 *
 * This module is a re-export barrel (split refactor): the implementation
 * lives in ssh-api-shared.ts (types & helpers), ssh-user-api.ts
 * (createSshUserRouter) and ssh-admin-api.ts (createSshAdminRouter).
 * Existing importers keep working unchanged.
 */

export type {
  SshTesterArgs,
  SshTesterVerdict,
  SshTesterResult,
  SshTester,
  SshEncryptResult,
  SshApiDeps,
} from './ssh-api-shared.js';
export { createSshUserRouter } from './ssh-user-api.js';
export { createSshAdminRouter } from './ssh-admin-api.js';
