ptyRejectionBanner (lib/pty-close-copy.ts)

hermes-agent · web/src/lib/pty-close-copy.ts · typescript · MIT
realtime

Pure module providing user‑facing PTY connection lifecycle messages and actions for dashboard chat.

// Source: https://github.com/NousResearch/hermes-agent | License: MIT | Copyright 2025 Nous Research
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * User-facing copy for the dashboard chat (PTY) connection lifecycle.
 *
 * Pure: ChatPage owns the socket and state, this module owns the words and
 * the "which button goes with this failure" decision, so both can be tested
 * without xterm or a fake WebSocket. WebSocket close codes never appear in
 * user text — ChatPage logs them to the console instead.
 */

export type PtyBannerAction = 'reload' | 'check-server' | null

export interface PtyBanner {
  text: string
  action: PtyBannerAction
}

/** Chat tab opened without the injected login token (loopback mode only). */
export const PTY_TOKEN_MISSING_BANNER: PtyBanner

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key