feat: add remote config and host metadata

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-02 14:27:39 +08:00
parent 1e7efd9c3b
commit 1e33bfa4bc
4 changed files with 99 additions and 3 deletions
+12 -2
View File
@@ -18,8 +18,8 @@ func TestDefaultConfig(t *testing.T) {
if cfg.Notify.Protocol != "osc777" {
t.Fatalf("expected osc777, got %q", cfg.Notify.Protocol)
}
if !cfg.Inbox.Enabled {
t.Fatal("expected inbox enabled by default")
if cfg.Inbox.Enabled {
t.Fatal("expected inbox disabled by default")
}
if cfg.Inbox.Addr != "127.0.0.1:17777" {
t.Fatalf("expected default inbox addr, got %q", cfg.Inbox.Addr)
@@ -104,6 +104,16 @@ func TestDefaultInboxSocketPrefersXDGRuntimeDir(t *testing.T) {
}
}
func TestDefaultRemoteDisabledInbox(t *testing.T) {
cfg := Default()
if cfg.Inbox.Enabled {
t.Fatal("inbox should default disabled")
}
if cfg.Remote.TimeoutMS != 2000 {
t.Fatalf("remote timeout: got %d", cfg.Remote.TimeoutMS)
}
}
func TestEventEnabled(t *testing.T) {
cfg := Default()
if !cfg.EventEnabled("stop") {