feat(pet): separate remote identity and add paper pet window
一些检测仍在等待运行
ci / Portable quality checks (push) Waiting to run
ci / Windows Tauri build (push) Waiting to run

这个提交存在于:
YokiiroBW 2026-07-20 16:28:42 +08:00
父节点 b2856ce075
当前提交 7dae4898cb
共有 19 个文件被更改,包括 244 次插入 和 46 次删除

查看文件

@ -69,6 +69,8 @@ pub struct AstrBotChatRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub nickname: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub config_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub attachments: Option<Vec<AstrBotAttachment>>,
@ -492,6 +494,7 @@ mod tests {
session_id: Some("session-a".into()),
conversation_id: None,
username: Some("desktop".into()),
nickname: None,
config_id: Some("model-a".into()),
attachments: Some(vec![AstrBotAttachment {
attachment_id: "file-a".into(),

查看文件

@ -81,6 +81,8 @@ pub struct ConnectionProfile {
/// AstrBot WebChat username / session owner used by OpenAPI chat.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub remote_username: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub remote_display_name: Option<String>,
/// Sticky AstrBot session id for reconnection continuity.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sticky_session_id: Option<String>,

查看文件

@ -135,7 +135,12 @@ otification`、`offline`。
- 完成 Windows release/installer、签名、版本号、CHANGELOG 和阶段总结。
- 通过全套阶段门槛后再进入主干合并和验收版本打包。
## 暂不进入实现
## 暂不进入实现
### 本轮已推进
- 远端身份已拆分为协议 ID(`remote_username`)与 BOT 称呼昵称(`remote_display_name`),两者不再共用字段。
- 2D 纸片人桌宠已从 manifest 基础推进到可运行窗口:透明、无边框、跳过任务栏、关闭后回托盘,并预留状态动作循环。
- 不复制 Hermes 或 Codex 的私有实现;只参考交互模式和资源组织方式。
- 不在首轮实现 Live2D、Spine、3D 桌宠或用户脚本插件。

查看文件

@ -67,7 +67,15 @@ Full product chat UI activation and production identity enrollment remain open f
1. Chat panel MVP against AstrBot adapter.
2. Persist sticky session + message history under profile/server/session keys.
3. Optional auto-connect activation using enrolled credential references only.
3. Optional auto-connect activation using enrolled credential references only.
## 2026-07-20: remote identity and runnable paper pet increment
- Added `remote_display_name` as a separate user-facing nickname; `remote_username` remains the validated ASCII protocol ID used for AstrBot session isolation.
- Migrated SQLite profiles to schema v9 without changing existing IDs or credentials.
- Passed the nickname through the Rust-owned AstrBot request boundary as an optional `nickname` field; secrets remain Rust-only.
- Added a transparent, borderless, skip-taskbar pet window with tray-resident hide-on-close behavior and a small CSS 2D paper-character state loop.
- Frontend checks pass; Rust test/build gate remains to be rerun after the final patch.
## Queue decision

查看文件

@ -288,6 +288,7 @@ mod tests {
local_tool_policy_id: None,
last_connected_at: None,
remote_username: None,
remote_display_name: None,
sticky_session_id: None,
created_at: "2026-07-20T00:00:00Z".into(),
updated_at: "2026-07-20T00:00:00Z".into(),

查看文件

@ -7,7 +7,7 @@ use time::{OffsetDateTime, format_description::well_known::Rfc3339};
use rusqlite::{Connection, OptionalExtension, params};
use thiserror::Error;
pub const CURRENT_SCHEMA_VERSION: u32 = 8;
pub const CURRENT_SCHEMA_VERSION: u32 = 9;
pub struct ApplicationDatabase {
store: Mutex<ProfileMessageStore>,
@ -529,6 +529,14 @@ fn migrate(connection: &mut Connection) -> Result<(), DatabaseError> {
transaction.commit()?;
}
if found <= 8 {
let transaction = connection.transaction()?;
transaction.execute_batch(
"ALTER TABLE connection_profiles ADD COLUMN remote_display_name TEXT CHECK(remote_display_name IS NULL OR length(remote_display_name) BETWEEN 1 AND 80); PRAGMA user_version = 9;",
)?;
transaction.commit()?;
}
Ok(())
}

查看文件

@ -21,8 +21,9 @@ const PROFILE_COLUMNS: &str = "
protocol_version,
local_tool_policy_id,
last_connected_at,
remote_username,
sticky_session_id,
remote_username,
remote_display_name,
sticky_session_id,
created_at,
updated_at
";
@ -113,14 +114,15 @@ impl ProfileMessageStore {
protocol_version,
local_tool_policy_id,
last_connected_at,
remote_username,
sticky_session_id,
remote_username,
remote_display_name,
sticky_session_id,
created_at,
updated_at
) VALUES (
?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9,
?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17, ?18,
?19, ?20, ?21
?19, ?20, ?21, ?22
)
",
params![
@ -141,8 +143,9 @@ impl ProfileMessageStore {
profile.protocol_version,
profile.local_tool_policy_id,
profile.last_connected_at,
profile.remote_username,
profile.sticky_session_id,
profile.remote_username,
profile.remote_display_name,
profile.sticky_session_id,
profile.created_at,
profile.updated_at,
],
@ -170,10 +173,11 @@ impl ProfileMessageStore {
protocol_version = ?15,
local_tool_policy_id = ?16,
last_connected_at = ?17,
remote_username = ?18,
sticky_session_id = ?19,
created_at = ?20,
updated_at = ?21
remote_username = ?18,
remote_display_name = ?19,
sticky_session_id = ?20,
created_at = ?21,
updated_at = ?22
WHERE id = ?1
",
params![
@ -194,8 +198,9 @@ impl ProfileMessageStore {
profile.protocol_version,
profile.local_tool_policy_id,
profile.last_connected_at,
profile.remote_username,
profile.sticky_session_id,
profile.remote_username,
profile.remote_display_name,
profile.sticky_session_id,
profile.created_at,
profile.updated_at,
],
@ -263,9 +268,10 @@ fn profile_from_row(row: &Row<'_>) -> Result<ConnectionProfile, DatabaseError> {
local_tool_policy_id: row.get(15)?,
last_connected_at: row.get(16)?,
remote_username: row.get(17)?,
sticky_session_id: row.get(18)?,
created_at: row.get(19)?,
updated_at: row.get(20)?,
remote_display_name: row.get(18)?,
sticky_session_id: row.get(19)?,
created_at: row.get(20)?,
updated_at: row.get(21)?,
})
}
@ -319,7 +325,8 @@ mod tests {
protocol_version: None,
local_tool_policy_id: None,
last_connected_at: None,
remote_username: None,
remote_username: None,
remote_display_name: None,
sticky_session_id: None,
created_at: "2026-07-18T00:00:00Z".into(),
updated_at: "2026-07-18T00:00:00Z".into(),

查看文件

@ -187,7 +187,8 @@ mod tests {
protocol_version: None,
local_tool_policy_id: None,
last_connected_at: None,
remote_username: None,
remote_username: None,
remote_display_name: None,
sticky_session_id: None,
created_at: "2026-07-19T00:00:00Z".into(),
updated_at: "2026-07-19T00:00:00Z".into(),

查看文件

@ -31,6 +31,8 @@ use tauri::{
tray::TrayIconBuilder,
};
const PET_WINDOW_ID: &str = "desktop-pet";
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
struct BootstrapStatus {
@ -163,6 +165,29 @@ fn open_main_window(app: AppHandle) -> Result<(), String> {
window.set_focus().map_err(|error| error.to_string())
}
#[tauri::command]
fn open_pet_window(app: AppHandle) -> Result<(), String> {
if let Some(window) = app.get_webview_window(PET_WINDOW_ID) {
window.show().map_err(|error| error.to_string())?;
return Ok(());
}
WebviewWindowBuilder::new(
&app,
PET_WINDOW_ID,
WebviewUrl::App("index.html?view=pet".into()),
)
.title("AstrBot Pet")
.inner_size(180.0, 220.0)
.resizable(false)
.decorations(false)
.transparent(true)
.always_on_top(false)
.skip_taskbar(true)
.build()
.map(|_| ())
.map_err(|error| error.to_string())
}
#[tauri::command]
fn bootstrap_status(
database: tauri::State<'_, ApplicationDatabase>,
@ -254,6 +279,11 @@ pub fn run() {
save_quick_window_state(window, window.app_handle());
return;
}
if window.label() == PET_WINDOW_ID {
api.prevent_close();
let _ = window.hide();
return;
}
api.prevent_close();
let _ = window.hide();
}
@ -265,6 +295,7 @@ pub fn run() {
open_quick_chat_window,
open_main_window,
open_status_bubble_window,
open_pet_window,
connection_policy_status,
profiles::list_connection_profiles,
profiles::create_connection_profile,

查看文件

@ -24,6 +24,7 @@ pub struct AstrBotClientConfig {
pub api_key: SecretString,
/// Remote WebChat username used as session owner identity.
pub remote_username: String,
pub remote_display_name: Option<String>,
/// Optional sticky session id. When absent, the first chat response supplies one.
pub session_id: Option<String>,
/// Expected server identity substitute. Empty means accept first observed identity.
@ -352,6 +353,7 @@ impl AstrBotClient {
session_id: session_id.clone(),
conversation_id: None,
username: Some(self.config.remote_username.clone()),
nickname: self.config.remote_display_name.clone(),
config_id,
attachments: (!attachments.is_empty()).then_some(attachments),
platform_id: None,
@ -509,6 +511,7 @@ mod tests {
base_url: "http://127.0.0.1:1".into(),
api_key: SecretString::from(String::new()),
remote_username: "user".into(),
remote_display_name: None,
session_id: None,
expected_server_instance_id: None,
});
@ -523,6 +526,7 @@ mod tests {
base_url: "http://192.168.31.210:26285/".into(),
api_key: SecretString::from("abk_test".to_owned()),
remote_username: "desktop-companion".into(),
remote_display_name: Some("Desktop Companion".into()),
session_id: Some("s1".into()),
expected_server_instance_id: None,
})

查看文件

@ -175,6 +175,7 @@ fn startup_activation_request(
api_key: Some(SecretString::from(api_key)),
bearer_token: None,
remote_username: Some(remote_username),
remote_display_name: profile.remote_display_name.clone(),
session_id: profile.sticky_session_id.clone(),
expected_server_instance_id: profile.server_instance_id.clone(),
})
@ -200,6 +201,7 @@ fn startup_activation_request(
api_key: None,
bearer_token: bearer,
remote_username: None,
remote_display_name: None,
session_id: None,
expected_server_instance_id: Some(expected),
})
@ -398,6 +400,7 @@ pub async fn probe_connection_slot(
api_key: Some(SecretString::from(api_key)),
bearer_token: None,
remote_username: Some(remote_username),
remote_display_name: profile.remote_display_name.clone(),
session_id: profile.sticky_session_id.clone(),
expected_server_instance_id: profile.server_instance_id.clone(),
}
@ -423,6 +426,7 @@ pub async fn probe_connection_slot(
api_key: None,
bearer_token: bearer,
remote_username: None,
remote_display_name: None,
session_id: None,
expected_server_instance_id: Some(expected),
}

查看文件

@ -39,6 +39,7 @@ pub struct SlotActivationRequest {
pub api_key: Option<SecretString>,
pub bearer_token: Option<SecretString>,
pub remote_username: Option<String>,
pub remote_display_name: Option<String>,
pub session_id: Option<String>,
pub expected_server_instance_id: Option<String>,
}
@ -258,6 +259,7 @@ impl DualSlotRuntime {
base_url: request.base_url.clone(),
api_key,
remote_username,
remote_display_name: request.remote_display_name.clone(),
session_id: request.session_id.clone(),
expected_server_instance_id: request.expected_server_instance_id.clone(),
})
@ -572,6 +574,7 @@ mod tests {
api_key: None,
bearer_token: None,
remote_username: None,
remote_display_name: None,
session_id: None,
expected_server_instance_id: None,
})

查看文件

@ -169,7 +169,8 @@ mod tests {
protocol_version: None,
local_tool_policy_id: None,
last_connected_at: None,
remote_username: None,
remote_username: None,
remote_display_name: None,
sticky_session_id: None,
created_at: "2026-07-19T00:00:00Z".into(),
updated_at: "2026-07-19T00:00:00Z".into(),

查看文件

@ -26,8 +26,10 @@ pub struct ConnectionProfileInput {
pub transport_kind: TransportKind,
#[serde(default)]
pub allow_insecure_http: bool,
#[serde(default)]
pub remote_username: Option<String>,
#[serde(default)]
pub remote_username: Option<String>,
#[serde(default)]
pub remote_display_name: Option<String>,
#[serde(default)]
pub pinned_certificate_fingerprint: Option<String>,
#[serde(default)]
@ -154,7 +156,8 @@ fn create_profile(
protocol_version: None,
local_tool_policy_id: None,
last_connected_at: None,
remote_username: normalized.remote_username,
remote_username: normalized.remote_username,
remote_display_name: normalized.remote_display_name,
sticky_session_id: None,
created_at: now.clone(),
updated_at: now,
@ -194,7 +197,8 @@ fn update_profile(
profile.authentication_type = normalized.authentication_type;
profile.transport_kind = normalized.transport_kind;
profile.allow_insecure_http = normalized.allow_insecure_http;
profile.remote_username = normalized.remote_username;
profile.remote_username = normalized.remote_username;
profile.remote_display_name = normalized.remote_display_name;
profile.pinned_certificate_fingerprint = normalized.pinned_certificate_fingerprint;
profile.auto_connect = normalized.auto_connect;
profile.auto_connect_slot = normalized.auto_connect_slot;
@ -251,6 +255,20 @@ fn normalize_input(
return Err(ProfileCommandError::validation(REMOTE_USERNAME_PATTERN));
}
let remote_display_name = request
.remote_display_name
.as_deref()
.map(str::trim)
.filter(|value| !value.is_empty())
.map(str::to_owned);
if let Some(name) = &remote_display_name
&& (name.chars().count() > MAX_DISPLAY_NAME_CHARS || name.chars().any(char::is_control))
{
return Err(ProfileCommandError::validation(
"Remote nickname must contain 1 to 80 visible characters.",
));
}
Ok(ConnectionProfileInput {
display_name,
role: request.role,
@ -259,7 +277,8 @@ fn normalize_input(
authentication_type: request.authentication_type,
transport_kind: request.transport_kind,
allow_insecure_http: request.allow_insecure_http,
remote_username,
remote_username,
remote_display_name,
pinned_certificate_fingerprint,
auto_connect: request.auto_connect,
auto_connect_slot: request.auto_connect_slot,
@ -356,7 +375,8 @@ mod tests {
authentication_type: AuthenticationType::DeviceToken,
transport_kind: TransportKind::DesktopV1,
allow_insecure_http: false,
remote_username: None,
remote_username: None,
remote_display_name: Some("测试用户".into()),
pinned_certificate_fingerprint: None,
auto_connect: false,
auto_connect_slot: None,
@ -370,7 +390,8 @@ mod tests {
create_profile(&database, request("https://example.test")).expect("create profile");
assert_eq!(created.display_name, "Test Profile");
assert_eq!(created.base_url, "https://example.test/");
assert!(created.credential_reference.is_none());
assert!(created.credential_reference.is_none());
assert_eq!(created.remote_display_name.as_deref(), Some("测试用户"));
assert!(!created.auto_connect);
assert!(created.auto_connect_slot.is_none());
@ -386,7 +407,8 @@ mod tests {
authentication_type: AuthenticationType::ApiKey,
transport_kind: TransportKind::DesktopV1,
allow_insecure_http: false,
remote_username: None,
remote_username: None,
remote_display_name: Some("更新昵称".into()),
pinned_certificate_fingerprint: None,
auto_connect: true,
auto_connect_slot: Some(ActiveSlotKind::Companion),
@ -396,7 +418,8 @@ mod tests {
.expect("update profile");
assert_eq!(updated.display_name, "Updated");
assert!(updated.auto_connect);
assert_eq!(updated.auto_connect_slot, Some(ActiveSlotKind::Companion));
assert_eq!(updated.auto_connect_slot, Some(ActiveSlotKind::Companion));
assert_eq!(updated.remote_display_name.as_deref(), Some("更新昵称"));
assert_eq!(list_profiles(&database).expect("list profiles").len(), 1);
delete_profile(&database, &created.id).expect("delete profile");

查看文件

@ -179,7 +179,8 @@ mod tests {
protocol_version: None,
local_tool_policy_id: None,
last_connected_at: None,
remote_username: None,
remote_username: None,
remote_display_name: None,
sticky_session_id: None,
created_at: "2026-07-19T00:00:00Z".into(),
updated_at: "2026-07-19T00:00:00Z".into(),

查看文件

@ -1,4 +1,5 @@
import { invoke } from "@tauri-apps/api/core";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { useCallback, useEffect, useState } from "react";
import { ChatPanel } from "./features/chat/ChatPanel";
@ -37,6 +38,7 @@ export function App() {
const view = params.get("view");
const isQuickView = view === "quick";
const isBubbleView = view === "bubble";
const isPetView = view === "pet";
const quickSlot = params.get("slot");
const [page, setPage] = useState<PageKey>("chat");
const [status, setStatus] = useState(initialStatus);
@ -66,6 +68,7 @@ export function App() {
}, [refreshStatus]);
if (isBubbleView) return <StatusBubble />;
if (isPetView) return <DesktopPetView />;
if (isQuickView) {
return (
<main className="quick-app-shell">
@ -373,11 +376,60 @@ function PetPage() {
<option value="secondary">优先副屏</option>
</select>
</SettingCard>
<SettingCard
title="运行桌宠"
description="桌宠窗口使用透明无边框模式,不创建任务栏按钮;关闭窗口后继续驻留托盘。"
>
<button type="button" onClick={() => void invoke("open_pet_window")}>
打开桌宠
</button>
</SettingCard>
</section>
</div>
);
}
function DesktopPetView() {
const [state, setState] = useState<"idle" | "working" | "resting" | "speaking">("idle");
useEffect(() => {
const states: Array<typeof state> = ["idle", "working", "resting", "speaking"];
const timer = window.setInterval(() => {
setState((current) => states[(states.indexOf(current) + 1) % states.length]);
}, 4200);
return () => window.clearInterval(timer);
}, []);
return (
<main className={`pet-window pet-window-${state}`} aria-label="AstrBot 桌宠">
<button
type="button"
className="pet-window-close"
aria-label="隐藏桌宠"
onClick={() => void getCurrentWindow().close()}
>
×
</button>
<div className="paper-pet" role="img" aria-label={`桌宠状态:${state}`}>
<div className="paper-pet-shadow" />
<div className="paper-pet-head">
<span className="paper-pet-ear left" />
<span className="paper-pet-ear right" />
<span className="paper-pet-eye left" />
<span className="paper-pet-eye right" />
<span className="paper-pet-mouth" />
</div>
<div className="paper-pet-body">
<span className="paper-pet-book" />
<span className="paper-pet-arm left" />
<span className="paper-pet-arm right" />
</div>
</div>
<span className="pet-window-status">{state === "working" ? "正在写写画画" : state === "resting" ? "休息中" : state === "speaking" ? "正在回应" : "陪伴中"}</span>
</main>
);
}
function DiagnosticsPage({
status,
onRefresh,

查看文件

@ -28,8 +28,9 @@ interface ProfileFormState {
baseUrl: string;
eventStreamUrl: string;
authenticationType: AuthenticationType;
transportKind: TransportKind;
remoteUsername: string;
transportKind: TransportKind;
remoteUsername: string;
remoteDisplayName: string;
allowInsecureHttp: boolean;
pinnedCertificateFingerprint: string;
autoConnect: boolean;
@ -43,7 +44,8 @@ const emptyForm: ProfileFormState = {
eventStreamUrl: "",
authenticationType: "device-token",
transportKind: "desktop-v1",
remoteUsername: "",
remoteUsername: "",
remoteDisplayName: "",
allowInsecureHttp: false,
pinnedCertificateFingerprint: "",
autoConnect: false,
@ -134,7 +136,8 @@ export function ProfileManager() {
eventStreamUrl: profile.eventStreamUrl ?? "",
authenticationType: profile.authenticationType,
transportKind: profile.transportKind ?? "desktop-v1",
remoteUsername: profile.remoteUsername ?? "",
remoteUsername: profile.remoteUsername ?? "",
remoteDisplayName: profile.remoteDisplayName ?? "",
allowInsecureHttp: profile.allowInsecureHttp,
pinnedCertificateFingerprint: profile.pinnedCertificateFingerprint ?? "",
autoConnect: profile.autoConnect,
@ -442,21 +445,37 @@ export function ProfileManager() {
<option value="astrbot-openapi">AstrBot OpenAPI</option>
</select>
</label>
{form.transportKind === "astrbot-openapi" ? (
{form.transportKind === "astrbot-openapi" ? (
<>
<label>
AstrBot 用户名
<input
value={form.remoteUsername}
<input
value={form.remoteUsername}
onChange={(event) =>
setForm((current) => ({
...current,
remoteUsername: event.target.value,
}))
}
placeholder="desktop-companion"
/>
</label>
) : null}
placeholder="desktop-companion"
/>
</label>
<label>
BOT 称呼昵称
<input
value={form.remoteDisplayName}
maxLength={80}
onChange={(event) =>
setForm((current) => ({
...current,
remoteDisplayName: event.target.value,
}))
}
placeholder="小明"
/>
</label>
</>
) : null}
<label className="checkbox-field">
<input
name="autoConnect"
@ -599,7 +618,8 @@ function toProfileInput(form: ProfileFormState): ConnectionProfileInput {
eventStreamUrl: eventStreamUrl || undefined,
authenticationType: form.authenticationType,
transportKind: form.transportKind,
remoteUsername: form.remoteUsername.trim() || undefined,
remoteUsername: form.remoteUsername.trim() || undefined,
remoteDisplayName: form.remoteDisplayName.trim() || undefined,
allowInsecureHttp: form.allowInsecureHttp,
pinnedCertificateFingerprint: fingerprint || undefined,
autoConnect: form.autoConnect,

查看文件

@ -1133,3 +1133,25 @@ select:focus {
.chat-session { display: grid; min-width: 11rem; gap: .2rem; padding: .65rem .75rem; border: 1px solid rgb(137 175 232 / 24%); border-radius: .7rem; color: #c7d4e9; background: rgb(7 18 34 / 55%); text-align: left; }
.chat-session:hover, .chat-session.active { border-color: #7db0ff; background: rgb(36 80 140 / 52%); }
.chat-session small { color: #91a7c9; font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet-window { position: relative; display: grid; min-height: 100vh; place-items: center; overflow: hidden; color: #f7faff; background: transparent; user-select: none; }
.pet-window-close { position: absolute; top: .5rem; right: .5rem; z-index: 2; width: 1.8rem; height: 1.8rem; padding: 0; border: 1px solid rgb(255 255 255 / 25%); border-radius: 999px; color: #fff; background: rgb(8 17 31 / 72%); line-height: 1; }
.pet-window-status { position: absolute; right: 0; bottom: .35rem; left: 0; color: #d7e5ff; font-size: .72rem; text-align: center; text-shadow: 0 1px 4px #08111f; }
.paper-pet { position: relative; width: 128px; height: 168px; animation: pet-idle 2.4s ease-in-out infinite; }
.paper-pet-shadow { position: absolute; right: 10px; bottom: 8px; left: 10px; height: 14px; border-radius: 50%; background: rgb(0 0 0 / 30%); filter: blur(4px); }
.paper-pet-head, .paper-pet-body { position: absolute; left: 50%; transform: translateX(-50%); border: 3px solid #263454; background: linear-gradient(145deg, #f4fbff 0%, #b6d7ff 100%); box-shadow: 8px 8px 0 rgb(75 114 175 / 30%); }
.paper-pet-head { top: 18px; width: 92px; height: 84px; border-radius: 45% 45% 42% 42%; }
.paper-pet-body { bottom: 25px; width: 72px; height: 70px; border-radius: 38% 38% 30% 30%; background: linear-gradient(145deg, #9cc4ff 0%, #6288d4 100%); }
.paper-pet-ear { position: absolute; top: -22px; width: 28px; height: 38px; border: 3px solid #263454; border-radius: 60% 60% 30% 30%; background: #d9edff; }
.paper-pet-ear.left { left: 7px; transform: rotate(-18deg); } .paper-pet-ear.right { right: 7px; transform: rotate(18deg); }
.paper-pet-eye { position: absolute; top: 39px; width: 9px; height: 12px; border-radius: 50%; background: #263454; }
.paper-pet-eye.left { left: 28px; } .paper-pet-eye.right { right: 28px; }
.paper-pet-mouth { position: absolute; bottom: 21px; left: 41px; width: 12px; height: 6px; border-bottom: 2px solid #263454; border-radius: 50%; }
.paper-pet-book { position: absolute; right: 8px; bottom: 13px; width: 37px; height: 27px; border: 2px solid #263454; border-radius: 3px; background: #ffe4a8; transform: rotate(-12deg); opacity: 0; }
.paper-pet-arm { position: absolute; top: 18px; width: 24px; height: 10px; border: 3px solid #263454; border-radius: 999px; background: #b6d7ff; }
.paper-pet-arm.left { left: -17px; transform: rotate(35deg); } .paper-pet-arm.right { right: -17px; transform: rotate(-35deg); }
.pet-window-working .paper-pet { animation: pet-work .8s ease-in-out infinite alternate; } .pet-window-working .paper-pet-book { opacity: 1; }
.pet-window-resting .paper-pet { animation: pet-rest 3s ease-in-out infinite; } .pet-window-speaking .paper-pet-mouth { height: 10px; background: #263454; }
@keyframes pet-idle { 50% { transform: translateY(-5px); } }
@keyframes pet-work { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-4px) rotate(2deg); } }
@keyframes pet-rest { 50% { transform: translateY(8px) rotate(8deg); } }

查看文件

@ -33,7 +33,8 @@ export const connectionProfileSchema = z
protocolVersion: optionalIdentifier,
localToolPolicyId: optionalIdentifier,
lastConnectedAt: optionalIdentifier,
remoteUsername,
remoteUsername,
remoteDisplayName: z.string().min(1).max(80).optional(),
stickySessionId: optionalIdentifier,
createdAt: z.string().min(1),
updatedAt: z.string().min(1),
@ -56,7 +57,8 @@ export interface ConnectionProfileInput {
authenticationType: AuthenticationType;
transportKind?: TransportKind;
allowInsecureHttp: boolean;
remoteUsername?: string;
remoteUsername?: string;
remoteDisplayName?: string;
pinnedCertificateFingerprint?: string;
autoConnect: boolean;
autoConnectSlot?: ActiveSlotKind;