package wang.yaojia.webterm.wire

/**
 * Wire-level constants shared with the server (FROZEN contract, plan §3.1). The Android
 * analogue of iOS `WireProtocol.WireConstants`. No magic numbers downstream.
 */
public object WireConstants {
    /** WS endpoint path (`src/config.ts` DEFAULT_WS_PATH). Stamped into [HostEndpoint.wsUrl]. */
    public const val WS_PATH: String = "/term"

    /**
     * Soft-reset prefix (ESC `[0m`) the server prepends to ring-buffer replay as a safety net
     * (`src/types.ts:167-170` / M2). Clients may use it to recognise the replay boundary;
     * NEVER strip it — it is valid ANSI the emulator must consume.
     */
    public const val REPLAY_SOFT_RESET_PREFIX: String = "\u001B[0m"

    /**
     * `exit.code` value meaning the PTY spawn never succeeded (M4); `exit.reason` is required
     * server-side in that case. Not a retryable state.
     */
    public const val SPAWN_FAILED_EXIT_CODE: Int = -1

    /** Valid `resize` cols/rows range, inclusive (`src/protocol.ts:113-115`). */
    public val RESIZE_RANGE: IntRange = 1..1000
}
