Matrix
Matrix 帳號由所屬伺服器代管。找出伺服器的 HTTPS 網址和你的 Matrix 使用者 ID,例如 @alex:matrix.example.org。
以擁有者身分登入 SwB。將這段提示詞交給具備擁有者權限的代理。
Read the setup guide at https://swb.one/docs/setup/matrix. Help me exchange messages with an agent in Matrix. Give me https://swb.one/docs/connect if I need to connect this agent to SwB first. Use a SwB client with owner access. Call `connect(what="matrix")`. Do each step marked "you" yourself. Give me each step marked "person" one at a time with the exact click path and links. Wait for me to say done after each step. Ask me for the HTTPS address of my Matrix homeserver and my Matrix user ID. Ask me to create a private room with room encryption set to **Off**. Give me the path `Room Settings > Advanced > Internal Room ID` in Element. Ask me for that room ID. Put my Matrix user ID in `owner_ids`. Put the room ID in `rooms`. Apply the YAML from `connect` to `config/switchboard.yaml`. If the file needs a manual edit, give me the YAML. Restart SwB after an edit. Call `connect(what="matrix")` again for the private claim link. Ask me to create a separate account for the bot on that Matrix homeserver. Ask me to sign in to Element with the bot account in a separate browser profile. Ask me to keep that session signed in. Give me the path `Settings > Help & About > Advanced > Access Token`. Ask me to enter the token only through the SwB claim link that connect returns. Keep tokens out of this chat and tool arguments. Read the Matrix bot user ID from `setup.bot_user_id` in `matrix_status`. Ask me to return to my owner session in Matrix. Ask me to invite the bot from my owner account. Call `connect(what="matrix")` again to check the connection. Ask me "Which agent answers here?" Use `targets` to show the choices. Save my choice for the room with `chat_main_set`, using the Matrix block name, space and room ID. Ask me to send a short message in the room. In a group room, ask me to mention the bot. Ask me to confirm that the agent replies in the same room.
代理會呼叫 connect(what="matrix") 取得連線指引。告訴它你要由哪個代理在聊天室回覆。
聊天室
建立私人聊天室。建立時關閉聊天室加密。
在 Element 開啟 Room Settings > Advanced > Internal Room ID。把聊天室 ID 交給代理。
機器人帳號
在 Matrix 所屬伺服器上為機器人另建一個帳號。用另一個瀏覽器設定檔開啟 Element。登入機器人帳號並維持登入狀態。
開啟 Settings > Help & About > Advanced > Access Token。複製存取權杖。SwB 用權杖存取機器人帳號。
開啟代理提供的 SwB 認領連結。在頁面上貼上存取權杖。
測試聊天室
回到 Matrix 的擁有者工作階段。用擁有者帳號邀請機器人。
傳一則簡短的文字訊息。在群組聊天室中標註機器人。查看代理在同一個聊天室的回覆。

