diff --git a/.gitignore b/.gitignore index ddb49a2..3b2a193 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,9 @@ target/ .env.* !.env.example +# Tauri 生成 +ui/src-tauri/gen/ + # IDE 与系统 .idea/ *.iml diff --git a/agent/cmd/tapremly-agent/main.go b/agent/cmd/tapremly-agent/main.go new file mode 100644 index 0000000..4b1e076 --- /dev/null +++ b/agent/cmd/tapremly-agent/main.go @@ -0,0 +1,52 @@ +package main + +import ( + "context" + "errors" + "log/slog" + "os" + "os/signal" + "path/filepath" + + "git.asio.asia/TapRemly/desktop/agent/internal/app" + "git.asio.asia/TapRemly/desktop/agent/internal/lockfile" + "git.asio.asia/TapRemly/desktop/agent/internal/paths" +) + +func main() { + dir, err := paths.Dir() + if err != nil { + os.Exit(1) + } + if err := os.MkdirAll(dir, 0o700); err != nil { + os.Exit(1) + } + setupLog(filepath.Join(dir, "agent.log")) + + lock, err := lockfile.Acquire(filepath.Join(dir, "agent.json")) + if err != nil { + slog.Error("无法启动", "err", err) + os.Exit(1) + } + defer lock.Close() + + application, err := app.New(dir) + if err != nil { + slog.Error("无法读取本机数据", "err", err) + os.Exit(1) + } + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) + defer stop() + if err := application.Run(ctx, lock); err != nil && !errors.Is(err, context.Canceled) { + slog.Error("已退出", "err", err) + os.Exit(1) + } +} + +func setupLog(path string) { + f, err := os.OpenFile(path, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0o600) + if err != nil { + return + } + slog.SetDefault(slog.New(slog.NewTextHandler(f, &slog.HandlerOptions{Level: slog.LevelInfo}))) +} diff --git a/agent/go.mod b/agent/go.mod new file mode 100644 index 0000000..ac60859 --- /dev/null +++ b/agent/go.mod @@ -0,0 +1,12 @@ +module git.asio.asia/TapRemly/desktop/agent + +go 1.27 + +require git.asio.asia/nixevol/NixMsg/sdk/go v0.1.1 + +require ( + github.com/eclipse/paho.golang v0.23.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + golang.org/x/net v0.43.0 // indirect +) diff --git a/agent/go.sum b/agent/go.sum new file mode 100644 index 0000000..b307c77 --- /dev/null +++ b/agent/go.sum @@ -0,0 +1,22 @@ +git.asio.asia/nixevol/NixMsg/sdk/go v0.1.1 h1:g1KDOuFQab/ozK72XdPs0kQ7zSF4l/KuUyI5a7CjsyM= +git.asio.asia/nixevol/NixMsg/sdk/go v0.1.1/go.mod h1:1gpE3UgMS+JtC+lbvDco8GoxPmaipWxyVYYF5n30CS8= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/eclipse/paho.golang v0.23.0 h1:KHgl2wz6EJo7cMBmkuhpt7C576vP+kpPv7jjvSyR6Mk= +github.com/eclipse/paho.golang v0.23.0/go.mod h1:nQRhTkoZv8EAiNs5UU0/WdQIx2NrnWUpL9nsGJTQN04= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/agent/internal/account/account.go b/agent/internal/account/account.go new file mode 100644 index 0000000..da4ff7a --- /dev/null +++ b/agent/internal/account/account.go @@ -0,0 +1,468 @@ +// Package account 访问 TapRemly 账号服务。服务端尚未完成时按同一约定调用。 +package account + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/http/cookiejar" + "net/url" + "strconv" + "strings" + "time" + "unicode/utf8" + + "git.asio.asia/TapRemly/desktop/agent/internal/protocol" + "git.asio.asia/TapRemly/desktop/agent/internal/store" +) + +// Error 是可以显示给用户的短句。 +type Error string + +func (e Error) Error() string { return string(e) } + +// Device 是账号下的一台设备。 +type Device struct { + ID string + Name string + EndpointID string + GroupID string +} + +// Group 是一个分组。 +type Group struct { + ID string + Name string +} + +// Provision 是登记本机时服务端返回的端信息。密码不向外转发。 +type Provision struct { + ID string + Name string + EndpointID string + Password string + DeviceToken string +} + +// Session 带着账号会话访问服务器。 +type Session struct { + Base string + HTTP *http.Client +} + +func NewSession(base string, cookies []store.Cookie) (*Session, error) { + jar, err := cookiejar.New(nil) + if err != nil { + return nil, err + } + base = strings.TrimRight(strings.TrimSpace(base), "/") + if base == "" { + return nil, Error("请填写服务器地址") + } + u, err := url.Parse(base) + if err != nil || u.Scheme == "" || u.Host == "" { + return nil, Error("服务器地址不正确") + } + if len(cookies) > 0 { + list := make([]*http.Cookie, 0, len(cookies)) + for _, c := range cookies { + if c.Name == "" { + continue + } + list = append(list, &http.Cookie{ + Name: c.Name, Value: c.Value, Path: c.Path, Expires: c.Expires, Secure: c.Secure, HttpOnly: c.HttpOnly, + }) + } + jar.SetCookies(u, list) + } + return &Session{ + Base: base, + HTTP: &http.Client{Timeout: 20 * time.Second, Jar: jar}, + }, nil +} + +// Cookies 导出当前会话,供下次启动继续使用。 +func (s *Session) Cookies() []store.Cookie { + u, err := url.Parse(s.Base) + if err != nil || s.HTTP == nil || s.HTTP.Jar == nil { + return nil + } + src := s.HTTP.Jar.Cookies(u) + out := make([]store.Cookie, 0, len(src)) + for _, c := range src { + out = append(out, store.Cookie{ + Name: c.Name, Value: c.Value, Domain: u.Hostname(), Path: c.Path, Expires: c.Expires, Secure: c.Secure, HttpOnly: c.HttpOnly, + }) + } + return out +} + +func (s *Session) Login(ctx context.Context, username, password string) (string, error) { + body := map[string]string{"username": username, "password": password} + resp, raw, err := s.do(ctx, http.MethodPost, "/api/login", body, "") + if err != nil { + return "", err + } + if resp.StatusCode == http.StatusUnauthorized || resp.StatusCode == http.StatusForbidden { + return "", Error("账号或密码不正确") + } + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return "", apiErr(resp.StatusCode, raw, false) + } + name := username + if n := firstString(raw, "username", "name"); n != "" { + name = n + } + return name, nil +} + +func (s *Session) Logout(ctx context.Context) error { + resp, raw, err := s.do(ctx, http.MethodDelete, "/api/login", nil, "") + if err != nil { + return err + } + if resp.StatusCode == http.StatusNotFound || resp.StatusCode == http.StatusNoContent || resp.StatusCode == http.StatusOK { + return nil + } + if resp.StatusCode >= 400 { + return apiErr(resp.StatusCode, raw, false) + } + return nil +} + +func (s *Session) Devices(ctx context.Context) ([]Device, error) { + resp, raw, err := s.do(ctx, http.MethodGet, "/api/devices", nil, "") + if err != nil { + return nil, err + } + if resp.StatusCode == http.StatusUnauthorized || resp.StatusCode == http.StatusForbidden { + return nil, Error("请重新登录账号") + } + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return nil, apiErr(resp.StatusCode, raw, false) + } + return decodeDevices(raw) +} + +func (s *Session) Groups(ctx context.Context) ([]Group, error) { + resp, raw, err := s.do(ctx, http.MethodGet, "/api/groups", nil, "") + if err != nil { + return nil, err + } + if resp.StatusCode == http.StatusUnauthorized || resp.StatusCode == http.StatusForbidden { + return nil, Error("请重新登录账号") + } + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return nil, apiErr(resp.StatusCode, raw, false) + } + return decodeGroups(raw) +} + +func (s *Session) CreateGroup(ctx context.Context, name string) error { + return s.expectOK(ctx, http.MethodPost, "/api/groups", map[string]string{"name": name}) +} + +func (s *Session) RenameGroup(ctx context.Context, id, name string) error { + return s.expectOK(ctx, http.MethodPatch, "/api/groups/"+url.PathEscape(id), map[string]string{"name": name}) +} + +func (s *Session) DeleteGroup(ctx context.Context, id string) error { + return s.expectOK(ctx, http.MethodDelete, "/api/groups/"+url.PathEscape(id), nil) +} + +func (s *Session) AddDevice(ctx context.Context, name, endpointID string) (Provision, error) { + payload := map[string]string{"name": name} + if endpointID != "" { + payload["endpoint_id"] = endpointID + } + resp, raw, err := s.do(ctx, http.MethodPost, "/api/devices", payload, "") + if err != nil { + return Provision{}, err + } + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return Provision{}, apiErr(resp.StatusCode, raw, false) + } + return decodeProvision(raw), nil +} + +func (s *Session) PatchDevice(ctx context.Context, id string, name *string, groupID *string) error { + payload := map[string]any{} + if name != nil { + payload["name"] = *name + } + if groupID != nil { + payload["group_id"] = *groupID + } + return s.expectOK(ctx, http.MethodPatch, "/api/devices/"+url.PathEscape(id), payload) +} + +func (s *Session) DeleteDevice(ctx context.Context, id string) error { + return s.expectOK(ctx, http.MethodDelete, "/api/devices/"+url.PathEscape(id), nil) +} + +func (s *Session) GetLogs(ctx context.Context, endpointID string) ([]protocol.Log, error) { + resp, raw, err := s.do(ctx, http.MethodGet, "/api/devices/"+url.PathEscape(endpointID)+"/logs", nil, "") + if err != nil { + return nil, err + } + if resp.StatusCode == http.StatusNotFound { + return []protocol.Log{}, nil + } + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return nil, apiErr(resp.StatusCode, raw, false) + } + return decodeLogs(raw), nil +} + +// PutLogs 用创建设备时的设备令牌覆盖上传最近若干条。 +func PutLogs(ctx context.Context, base, endpointID, deviceToken string, items []protocol.Log) error { + base = strings.TrimRight(strings.TrimSpace(base), "/") + if base == "" || endpointID == "" || deviceToken == "" { + return nil + } + if items == nil { + items = []protocol.Log{} + } + payload, err := json.Marshal(map[string]any{"items": items}) + if err != nil { + return err + } + req, err := http.NewRequestWithContext(ctx, http.MethodPut, base+"/api/devices/"+url.PathEscape(endpointID)+"/logs", bytes.NewReader(payload)) + if err != nil { + return err + } + req.Header.Set("Content-Type", "application/json; charset=utf-8") + req.Header.Set("Authorization", "Bearer "+deviceToken) + resp, err := (&http.Client{Timeout: 15 * time.Second}).Do(req) + if err != nil { + return Error("暂时连不上账号服务") + } + defer resp.Body.Close() + raw, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return apiErr(resp.StatusCode, raw, false) + } + return nil +} + +func (s *Session) expectOK(ctx context.Context, method, path string, payload any) error { + resp, raw, err := s.do(ctx, method, path, payload, "") + if err != nil { + return err + } + if resp.StatusCode == http.StatusUnauthorized || resp.StatusCode == http.StatusForbidden { + return Error("请重新登录账号") + } + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return apiErr(resp.StatusCode, raw, false) + } + return nil +} + +func (s *Session) do(ctx context.Context, method, path string, payload any, bearer string) (*http.Response, []byte, error) { + var body io.Reader + if payload != nil { + b, err := json.Marshal(payload) + if err != nil { + return nil, nil, err + } + body = bytes.NewReader(b) + } + req, err := http.NewRequestWithContext(ctx, method, s.Base+path, body) + if err != nil { + return nil, nil, err + } + if payload != nil { + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } + if bearer != "" { + req.Header.Set("Authorization", "Bearer "+bearer) + } + resp, err := s.HTTP.Do(req) + if err != nil { + return nil, nil, Error("暂时连不上账号服务") + } + raw, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + _ = resp.Body.Close() + return resp, raw, nil +} + +func apiErr(code int, raw []byte, login bool) error { + if login && (code == http.StatusUnauthorized || code == http.StatusForbidden) { + return Error("账号或密码不正确") + } + if code == http.StatusUnauthorized || code == http.StatusForbidden { + return Error("请重新登录账号") + } + if s := firstString(raw, "message", "error"); s != "" && utf8.RuneCountInString(s) <= 80 && containsHan(s) { + return Error(s) + } + if code >= 500 { + return Error("账号服务暂时不可用") + } + return Error("操作没有成功") +} + +func containsHan(s string) bool { + for _, r := range s { + if r >= 0x4e00 && r <= 0x9fff { + return true + } + } + return false +} + +func decodeDevices(raw []byte) ([]Device, error) { + items := extractItems(raw) + out := make([]Device, 0, len(items)) + for _, m := range items { + d := Device{ + ID: str(m, "id"), + Name: first(m, "name"), + EndpointID: first(m, "endpoint_id", "endpointId"), + GroupID: first(m, "group_id", "groupId"), + } + if d.EndpointID == "" { + d.EndpointID = d.ID + } + if d.ID == "" { + d.ID = d.EndpointID + } + if d.Name == "" { + d.Name = d.EndpointID + } + out = append(out, d) + } + return out, nil +} + +func decodeGroups(raw []byte) ([]Group, error) { + items := extractItems(raw) + out := make([]Group, 0, len(items)) + for _, m := range items { + g := Group{ID: str(m, "id"), Name: first(m, "name")} + if g.ID == "" { + continue + } + if g.Name == "" { + g.Name = g.ID + } + out = append(out, g) + } + return out, nil +} + +func decodeLogs(raw []byte) []protocol.Log { + var wrap struct { + Items []protocol.Log `json:"items"` + } + if json.Unmarshal(raw, &wrap) == nil && wrap.Items != nil { + return wrap.Items + } + var items []protocol.Log + if json.Unmarshal(raw, &items) == nil && items != nil { + return items + } + return []protocol.Log{} +} + +func decodeProvision(raw []byte) Provision { + m := pickObject(object(raw)) + p := Provision{ + ID: str(m, "id"), + Name: first(m, "name"), + EndpointID: first(m, "endpoint_id", "endpointId"), + Password: first(m, "password", "login_password", "nixmsg_password"), + DeviceToken: first(m, "device_token", "deviceToken"), + } + if p.DeviceToken == "" && p.Password != "" { + p.DeviceToken = first(m, "token") + } + return p +} + +func pickObject(m map[string]any) map[string]any { + for _, k := range []string{"device", "data"} { + nested, ok := m[k].(map[string]any) + if !ok { + continue + } + if first(nested, "endpoint_id", "endpointId", "id", "password") != "" { + return nested + } + } + return m +} + +func extractItems(raw []byte) []map[string]any { + var wrap map[string]json.RawMessage + if json.Unmarshal(raw, &wrap) == nil { + for _, key := range []string{"items", "devices", "groups"} { + if b, ok := wrap[key]; ok { + return rawList(b) + } + } + } + return rawList(raw) +} + +func rawList(b []byte) []map[string]any { + var arr []json.RawMessage + if json.Unmarshal(b, &arr) != nil { + return nil + } + out := make([]map[string]any, 0, len(arr)) + for _, item := range arr { + var m map[string]any + if json.Unmarshal(item, &m) == nil { + out = append(out, m) + } + } + return out +} + +func object(raw []byte) map[string]any { + var m map[string]any + _ = json.Unmarshal(raw, &m) + if m == nil { + m = map[string]any{} + } + return m +} + +func firstString(raw []byte, keys ...string) string { + return first(object(raw), keys...) +} + +func first(m map[string]any, keys ...string) string { + for _, k := range keys { + if s := str(m, k); s != "" { + return s + } + } + return "" +} + +func str(m map[string]any, k string) string { + v, ok := m[k] + if !ok || v == nil { + return "" + } + switch t := v.(type) { + case string: + return strings.TrimSpace(t) + case float64: + return strconv.FormatInt(int64(t), 10) + case json.Number: + return t.String() + default: + s := strings.TrimSpace(fmt.Sprint(t)) + if s == "" { + return "" + } + return s + } +} diff --git a/agent/internal/app/app.go b/agent/internal/app/app.go new file mode 100644 index 0000000..6572130 --- /dev/null +++ b/agent/internal/app/app.go @@ -0,0 +1,517 @@ +package app + +import ( + "context" + "crypto/rand" + "encoding/hex" + "encoding/json" + "errors" + "net" + "net/http" + "os" + "sync" + "time" + + "git.asio.asia/TapRemly/desktop/agent/internal/account" + "git.asio.asia/TapRemly/desktop/agent/internal/engine" + "git.asio.asia/TapRemly/desktop/agent/internal/idutil" + "git.asio.asia/TapRemly/desktop/agent/internal/lockfile" + "git.asio.asia/TapRemly/desktop/agent/internal/protocol" + "git.asio.asia/TapRemly/desktop/agent/internal/shell" + "git.asio.asia/TapRemly/desktop/agent/internal/store" + nixmsg "git.asio.asia/nixevol/NixMsg/sdk/go" +) + +// App 是这台电脑唯一的连接和本机接口。 +type App struct { + dir string + st *store.Store + eng *engine.Engine + + mu sync.Mutex + token string + client *nixmsg.Client + stop context.CancelFunc + connState string + connText string + presence map[string]bool + presenceOK bool + deviceIDs []string + serverLogs map[string][]protocol.Log +} + +func New(dir string) (*App, error) { + st, err := store.New(dir) + if err != nil { + return nil, err + } + return &App{ + dir: dir, + st: st, + eng: engine.New(st, shell.System{}), + connText: "未连接", + presence: map[string]bool{}, + serverLogs: map[string][]protocol.Log{}, + }, nil +} + +// Run 监听本机随机端口,并把地址写入锁文件。 +func (a *App) Run(ctx context.Context, lock *lockfile.File) error { + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + return err + } + token := newToken() + a.mu.Lock() + a.token = token + a.mu.Unlock() + if err := lock.Publish(ln.Addr().String(), token, os.Getpid()); err != nil { + _ = ln.Close() + return err + } + ctx, cancel := context.WithCancel(ctx) + a.mu.Lock() + a.stop = cancel + a.mu.Unlock() + + srv := &http.Server{ + Handler: cors(a.routes()), + ReadHeaderTimeout: 5 * time.Second, + } + go func() { + <-ctx.Done() + sh, done := context.WithTimeout(context.Background(), 3*time.Second) + defer done() + _ = srv.Shutdown(sh) + a.closeClient() + }() + go a.autoConnect() + err = srv.Serve(ln) + if errors.Is(err, http.ErrServerClosed) { + return nil + } + return err +} + +func (a *App) requestStop() { + a.mu.Lock() + stop := a.stop + a.mu.Unlock() + if stop != nil { + stop() + } +} + +func (a *App) autoConnect() { + var url, id, session, pending string + a.st.View(func(d *store.Data) { + url, id, session, pending = d.NixURL, d.EndpointID, d.SessionToken, d.PendingSecret + }) + if id == "" || url == "" { + return + } + if session != "" { + _ = a.connect(url, id, "", session) + return + } + if pending != "" { + _ = a.connect(url, id, pending, "") + } +} + +func (a *App) connect(rawURL, id, password, session string) error { + if !idutil.ValidEndpoint(id) { + return engine.Error("端编号不正确") + } + _ = a.st.Update(func(d *store.Data) error { + d.NixURL = rawURL + d.EndpointID = id + if password != "" { + d.PendingSecret = password + } + return nil + }) + + c := nixmsg.New() + c.OnSession(func(tok string) { + if tok == "" { + return + } + _ = a.st.Update(func(d *store.Data) error { + d.SessionToken = tok + d.PendingSecret = "" + d.EndpointID = id + d.NixURL = rawURL + return nil + }) + }) + c.OnMessage(func(msg nixmsg.Message) error { return a.onMessage(c, msg) }) + c.OnPresence(func(ev nixmsg.PresenceEvent) { a.onPresence(c, ev) }) + c.OnConnection(func(ev nixmsg.ConnectionEvent) { a.onConnection(c, ev) }) + + a.mu.Lock() + old := a.client + a.client = c + a.connState = string(nixmsg.StateConnecting) + a.connText = "正在连接" + a.mu.Unlock() + if old != nil { + _ = old.Close() + } + + cred := nixmsg.Credential{Password: password} + if session != "" { + cred = nixmsg.Credential{SessionToken: session} + } + ctx, cancel := context.WithTimeout(context.Background(), 35*time.Second) + defer cancel() + err := c.Connect(ctx, rawURL, id, cred, nixmsg.Options{ClientLabel: "tapremly/0.1"}) + if err != nil { + a.noteAuth(err, session != "") + a.mu.Lock() + if a.client == c { + a.client = nil + a.connState = string(nixmsg.StateOffline) + a.connText = publicErr(nixErr(err)) + } + a.mu.Unlock() + _ = c.Close() + return nixErr(err) + } + go a.rewatch() + return nil +} + +func (a *App) noteAuth(err error, usedSession bool) { + var api *nixmsg.APIError + if !errors.As(err, &api) { + return + } + switch api.Code { + case nixmsg.CodeBadCredentials, nixmsg.CodeAuthFailed, nixmsg.CodePasswordReset, nixmsg.CodeSessionInvalid: + _ = a.st.Update(func(d *store.Data) error { + d.PendingSecret = "" + if usedSession || api.Code == nixmsg.CodeSessionInvalid || api.Code == nixmsg.CodePasswordReset { + d.SessionToken = "" + } + return nil + }) + } +} + +func (a *App) onConnection(c *nixmsg.Client, ev nixmsg.ConnectionEvent) { + a.mu.Lock() + if a.client != c { + a.mu.Unlock() + return + } + a.connState = string(ev.State) + a.connText = connText(ev.State) + a.mu.Unlock() + if ev.State == nixmsg.StateAuthFailed { + _ = a.st.Update(func(d *store.Data) error { + d.SessionToken = "" + d.PendingSecret = "" + return nil + }) + } + if ev.State == nixmsg.StateOnline { + go a.rewatch() + } +} + +func (a *App) onPresence(c *nixmsg.Client, ev nixmsg.PresenceEvent) { + a.mu.Lock() + defer a.mu.Unlock() + if a.client != c { + return + } + if a.presence == nil { + a.presence = map[string]bool{} + } + a.presence[ev.ID] = ev.Online + a.presenceOK = true +} + +func (a *App) onMessage(c *nixmsg.Client, msg nixmsg.Message) error { + a.mu.Lock() + cur := a.client + a.mu.Unlock() + if cur != c { + return nil + } + outs, logs, err := a.eng.Accept(msg.From, msg.Body.Data) + if err != nil { + return err + } + for _, o := range outs { + _, _ = a.sendRaw(o.To, o.Body, engine.Delivery{}, false) + } + if len(logs) > 0 { + go a.uploadLogs(logs) + } + return nil +} + +func (a *App) closeClient() { + a.mu.Lock() + c := a.client + a.client = nil + a.connState = string(nixmsg.StateOffline) + a.connText = "未连接" + a.presenceOK = false + a.mu.Unlock() + if c != nil { + _ = c.Close() + } +} + +func (a *App) sendRaw(to string, body []byte, opt engine.Delivery, pinID bool) (nixmsg.SendResult, error) { + a.mu.Lock() + c := a.client + a.mu.Unlock() + if c == nil { + return nixmsg.SendResult{}, engine.Error("还没有连上") + } + so := nixmsg.SendOptions{ContentType: "application/json; charset=utf-8"} + if opt.Keep { + so.Keep = true + so.TTL = opt.TTL + } + so.SendAt = opt.SendAt + if pinID { + var probe struct { + ID string `json:"id"` + } + if json.Unmarshal(body, &probe) == nil && idutil.ValidMessage(probe.ID) { + so.ID = probe.ID + } + } + ctx, cancel := context.WithTimeout(context.Background(), 35*time.Second) + defer cancel() + res, err := c.Send(ctx, nixmsg.Target{Kind: "endpoint", ID: to}, nixmsg.Body{ + Enc: "utf8", + ContentType: "application/json; charset=utf-8", + Data: string(body), + }, so) + if err != nil { + return res, nixErr(err) + } + return res, nil +} + +func (a *App) uploadLogs(items []protocol.Log) { + var base, token, ep string + a.st.View(func(d *store.Data) { + base, token, ep = d.ServerURL, d.DeviceToken, d.EndpointID + }) + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + _ = account.PutLogs(ctx, base, ep, token, items) +} + +func (a *App) rewatch() { + a.mu.Lock() + ids := append([]string(nil), a.deviceIDs...) + c := a.client + a.mu.Unlock() + if c == nil || len(ids) == 0 { + return + } + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + _ = c.WatchPresence(ctx, ids, false) + items, err := c.Presence(ctx, ids) + if err != nil { + return + } + a.mu.Lock() + defer a.mu.Unlock() + if a.client != c { + return + } + if a.presence == nil { + a.presence = map[string]bool{} + } + for _, it := range items { + a.presence[it.ID] = it.Online + } + a.presenceOK = true +} + +func (a *App) rememberDevices(list []account.Device) { + ids := make([]string, 0, len(list)) + seen := map[string]bool{} + for _, d := range list { + if d.EndpointID == "" || seen[d.EndpointID] { + continue + } + seen[d.EndpointID] = true + ids = append(ids, d.EndpointID) + } + a.mu.Lock() + a.deviceIDs = ids + a.mu.Unlock() + go a.rewatch() +} + +func (a *App) limits() engine.Limits { + a.mu.Lock() + c := a.client + a.mu.Unlock() + if c == nil { + return engine.Limits{} + } + lim := c.Limits() + return engine.Limits{MaxTTL: lim.MaxTTLSeconds, MaxSchedule: lim.MaxScheduleSeconds} +} + +func (a *App) session() (*account.Session, error) { + var base string + var cookies []store.Cookie + a.st.View(func(d *store.Data) { + base = d.ServerURL + cookies = append([]store.Cookie(nil), d.Cookies...) + }) + return account.NewSession(base, cookies) +} + +func (a *App) pushPublished() { + body, err := protocol.ShortcutsBody("", a.eng.Published()) + if err != nil { + return + } + a.mu.Lock() + online := a.connState == string(nixmsg.StateOnline) && a.presenceOK + presence := a.presence + a.mu.Unlock() + if !online { + return + } + for _, id := range a.eng.TrustList() { + if presence[id] { + _, _ = a.sendRaw(id, body, engine.Delivery{}, false) + } + } +} + +func (a *App) refreshShortcuts(remote string) error { + if !idutil.ValidEndpoint(remote) { + return engine.Error("端编号不正确") + } + id := idutil.New() + if err := a.eng.BeginShortcutSync(remote, id); err != nil { + return err + } + body, err := protocol.ShortcutsGetBody(id) + if err != nil { + return err + } + if _, err := a.sendRaw(remote, body, engine.Delivery{}, false); err != nil { + _ = a.eng.FinishShortcutSync(remote, id) + return err + } + go func() { + time.Sleep(8 * time.Second) + _ = a.eng.FinishShortcutSync(remote, id) + }() + return nil +} + +func (a *App) refreshLogs(remote string) error { + if !idutil.ValidEndpoint(remote) { + return engine.Error("端编号不正确") + } + if sess, err := a.session(); err == nil { + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + items, gerr := sess.GetLogs(ctx, remote) + cancel() + if gerr == nil { + a.mu.Lock() + a.serverLogs[remote] = items + a.mu.Unlock() + } + } + a.mu.Lock() + online := a.connState == string(nixmsg.StateOnline) && a.presenceOK && a.presence[remote] + a.mu.Unlock() + if !online { + return nil + } + id := idutil.New() + if err := a.eng.BeginLogSync(remote, id); err != nil { + return err + } + body, err := protocol.LogsGetBody(id) + if err != nil { + return err + } + if _, err := a.sendRaw(remote, body, engine.Delivery{}, false); err != nil { + _ = a.eng.FinishLogSync(remote, id, "") + return err + } + go func() { + time.Sleep(8 * time.Second) + _ = a.eng.FinishLogSync(remote, id, "") + }() + return nil +} + +func connText(st nixmsg.ConnectionState) string { + switch st { + case nixmsg.StateOnline: + return "在线" + case nixmsg.StateConnecting, nixmsg.StateReconnecting: + return "正在连接" + case nixmsg.StateKicked: + return "已在其他地方登录" + case nixmsg.StateAuthFailed: + return "登录失败" + default: + return "未连接" + } +} + +func nixErr(err error) error { + if err == nil { + return nil + } + var api *nixmsg.APIError + if errors.As(err, &api) { + switch api.Code { + case nixmsg.CodeBadCredentials, nixmsg.CodeAuthFailed, nixmsg.CodePasswordReset: + return engine.Error("端编号或密码不正确") + case nixmsg.CodeTakenOver, nixmsg.CodeKicked: + return engine.Error("这个端已在其他地方登录") + case nixmsg.CodeSessionInvalid: + return engine.Error("登录已失效,请重新登录") + default: + return engine.Error("连不上") + } + } + if errors.Is(err, context.DeadlineExceeded) { + return engine.Error("连不上") + } + return engine.Error("连不上") +} + +func publicErr(err error) string { + var ee engine.Error + if errors.As(err, &ee) { + return ee.Error() + } + var ae account.Error + if errors.As(err, &ae) { + return ae.Error() + } + if err == nil { + return "" + } + return "没有成功" +} + +func newToken() string { + var b [32]byte + _, _ = rand.Read(b[:]) + return hex.EncodeToString(b[:]) +} diff --git a/agent/internal/app/http.go b/agent/internal/app/http.go new file mode 100644 index 0000000..6e54bd5 --- /dev/null +++ b/agent/internal/app/http.go @@ -0,0 +1,880 @@ +package app + +import ( + "context" + "encoding/json" + "net/http" + "net/url" + "strings" + "time" + + "git.asio.asia/TapRemly/desktop/agent/internal/account" + "git.asio.asia/TapRemly/desktop/agent/internal/engine" + "git.asio.asia/TapRemly/desktop/agent/internal/idutil" + "git.asio.asia/TapRemly/desktop/agent/internal/protocol" + "git.asio.asia/TapRemly/desktop/agent/internal/store" + nixmsg "git.asio.asia/nixevol/NixMsg/sdk/go" +) + +func (a *App) routes() http.Handler { + mux := http.NewServeMux() + mux.HandleFunc("GET /v1/status", a.authed(a.handleStatus)) + mux.HandleFunc("POST /v1/stop", a.authed(a.handleStop)) + mux.HandleFunc("PUT /v1/settings", a.authed(a.handlePutSettings)) + mux.HandleFunc("POST /v1/session", a.authed(a.handleLogin)) + mux.HandleFunc("POST /v1/session/reconnect", a.authed(a.handleReconnect)) + mux.HandleFunc("DELETE /v1/session", a.authed(a.handleLogout)) + mux.HandleFunc("POST /v1/account/login", a.authed(a.handleAccountLogin)) + mux.HandleFunc("DELETE /v1/account", a.authed(a.handleAccountLogout)) + mux.HandleFunc("GET /v1/devices", a.authed(a.handleDevices)) + mux.HandleFunc("POST /v1/devices", a.authed(a.handleAddDevice)) + mux.HandleFunc("PATCH /v1/devices/{id}", a.authed(a.handlePatchDevice)) + mux.HandleFunc("DELETE /v1/devices/{id}", a.authed(a.handleDeleteDevice)) + mux.HandleFunc("GET /v1/groups", a.authed(a.handleGroups)) + mux.HandleFunc("POST /v1/groups", a.authed(a.handleCreateGroup)) + mux.HandleFunc("PATCH /v1/groups/{id}", a.authed(a.handleRenameGroup)) + mux.HandleFunc("DELETE /v1/groups/{id}", a.authed(a.handleDeleteGroup)) + mux.HandleFunc("GET /v1/trust", a.authed(a.handleTrustList)) + mux.HandleFunc("POST /v1/trust", a.authed(a.handleTrustAdd)) + mux.HandleFunc("DELETE /v1/trust/{id}", a.authed(a.handleTrustRemove)) + mux.HandleFunc("GET /v1/shortcuts/local", a.authed(a.handleLocalList)) + mux.HandleFunc("POST /v1/shortcuts/local", a.authed(a.handleLocalSave)) + mux.HandleFunc("PATCH /v1/shortcuts/local/{id}", a.authed(a.handleLocalUpdate)) + mux.HandleFunc("DELETE /v1/shortcuts/local/{id}", a.authed(a.handleLocalDelete)) + mux.HandleFunc("POST /v1/shortcuts/copy", a.authed(a.handleCopy)) + mux.HandleFunc("GET /v1/shortcuts/remote", a.authed(a.handleRemoteList)) + mux.HandleFunc("POST /v1/shortcuts/remote/refresh", a.authed(a.handleRemoteRefresh)) + mux.HandleFunc("GET /v1/shortcuts/published", a.authed(a.handlePublishedList)) + mux.HandleFunc("POST /v1/shortcuts/published", a.authed(a.handlePublishedSave)) + mux.HandleFunc("PATCH /v1/shortcuts/published/{id}", a.authed(a.handlePublishedUpdate)) + mux.HandleFunc("DELETE /v1/shortcuts/published/{id}", a.authed(a.handlePublishedDelete)) + mux.HandleFunc("POST /v1/send", a.authed(a.handleSend)) + mux.HandleFunc("GET /v1/inbox", a.authed(a.handleInbox)) + mux.HandleFunc("POST /v1/inbox/read", a.authed(a.handleInboxRead)) + mux.HandleFunc("GET /v1/results", a.authed(a.handleResults)) + mux.HandleFunc("GET /v1/logs", a.authed(a.handleLocalLogs)) + mux.HandleFunc("GET /v1/logs/remote", a.authed(a.handleRemoteLogs)) + mux.HandleFunc("POST /v1/logs/fetch", a.authed(a.handleFetchLogs)) + return mux +} + +func (a *App) authed(next http.HandlerFunc) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + h := r.Header.Get("Authorization") + const prefix = "Bearer " + a.mu.Lock() + token := a.token + a.mu.Unlock() + if len(h) <= len(prefix) || h[:len(prefix)] != prefix || token == "" || subtleEqual(h[len(prefix):], token) != 1 { + writeErr(w, http.StatusUnauthorized, "请先连接") + return + } + next(w, r) + } +} + +func subtleEqual(a, b string) int { + if len(a) != len(b) { + return 0 + } + var v byte + for i := 0; i < len(a); i++ { + v |= a[i] ^ b[i] + } + if v == 0 { + return 1 + } + return 0 +} + +func (a *App) handleStatus(w http.ResponseWriter, _ *http.Request) { + var endpoint, server, nix, user, session string + var hasToken bool + a.st.View(func(d *store.Data) { + endpoint, server, nix, user, session = d.EndpointID, d.ServerURL, d.NixURL, d.AccountUser, d.SessionToken + hasToken = d.DeviceToken != "" + }) + a.mu.Lock() + state, text := a.connState, a.connText + a.mu.Unlock() + if text == "" { + text = "未连接" + } + lim := a.limits() + writeJSON(w, http.StatusOK, map[string]any{ + "running": true, + "conn": state, + "conn_text": text, + "endpoint_id": endpoint, + "logged_in": session != "", + "server_url": server, + "nixmsg_url": nix, + "account_user": user, + "has_device_token": hasToken, + "max_ttl_seconds": limOr(lim.MaxTTL, 2592000), + "max_schedule_seconds": limOr(lim.MaxSchedule, 31536000), + }) +} + +func limOr(v, def int64) int64 { + if v > 0 { + return v + } + return def +} + +func (a *App) handleStop(w http.ResponseWriter, _ *http.Request) { + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) + go func() { + time.Sleep(80 * time.Millisecond) + a.requestStop() + }() +} + +func (a *App) handlePutSettings(w http.ResponseWriter, r *http.Request) { + var req struct { + ServerURL string `json:"server_url"` + NixURL string `json:"nixmsg_url"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + req.ServerURL = strings.TrimRight(strings.TrimSpace(req.ServerURL), "/") + req.NixURL = strings.TrimSpace(req.NixURL) + if !validServer(req.ServerURL) || !validNix(req.NixURL) { + writeErr(w, http.StatusBadRequest, "地址不正确") + return + } + if err := a.st.Update(func(d *store.Data) error { + d.ServerURL = req.ServerURL + d.NixURL = req.NixURL + return nil + }); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handleLogin(w http.ResponseWriter, r *http.Request) { + var req struct { + EndpointID string `json:"endpoint_id"` + Password string `json:"password"` + NixURL string `json:"nixmsg_url"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + req.EndpointID = strings.TrimSpace(req.EndpointID) + req.NixURL = strings.TrimSpace(req.NixURL) + if req.NixURL == "" { + a.st.View(func(d *store.Data) { req.NixURL = d.NixURL }) + } + if !validNix(req.NixURL) { + writeErr(w, http.StatusBadRequest, "地址不正确") + return + } + if err := a.connect(req.NixURL, req.EndpointID, req.Password, ""); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]any{"ok": true, "endpoint_id": req.EndpointID}) +} + +func (a *App) handleReconnect(w http.ResponseWriter, _ *http.Request) { + var url, id, session, pending string + a.st.View(func(d *store.Data) { + url, id, session, pending = d.NixURL, d.EndpointID, d.SessionToken, d.PendingSecret + }) + if id == "" { + writeErr(w, http.StatusBadRequest, "请先登录") + return + } + var err error + switch { + case session != "": + err = a.connect(url, id, "", session) + case pending != "": + err = a.connect(url, id, pending, "") + default: + writeErr(w, http.StatusBadRequest, "请重新登录") + return + } + if err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handleLogout(w http.ResponseWriter, r *http.Request) { + a.mu.Lock() + c := a.client + a.mu.Unlock() + if c != nil { + ctx, cancel := contextTimeout(r) + _ = c.Logout(ctx) + cancel() + } + a.closeClient() + _ = a.st.Update(func(d *store.Data) error { + d.SessionToken = "" + d.PendingSecret = "" + return nil + }) + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handleAccountLogin(w http.ResponseWriter, r *http.Request) { + var req struct { + Username string `json:"username"` + Password string `json:"password"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + req.Username = strings.TrimSpace(req.Username) + if req.Username == "" || req.Password == "" { + writeErr(w, http.StatusBadRequest, "请填写账号和密码") + return + } + sess, err := a.session() + if err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + ctx, cancel := contextTimeout(r) + defer cancel() + name, err := sess.Login(ctx, req.Username, req.Password) + if err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + if err := a.st.Update(func(d *store.Data) error { + d.AccountUser = name + d.Cookies = sess.Cookies() + return nil + }); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]any{"username": name}) +} + +func (a *App) handleAccountLogout(w http.ResponseWriter, r *http.Request) { + if sess, err := a.session(); err == nil { + ctx, cancel := contextTimeout(r) + _ = sess.Logout(ctx) + cancel() + } + _ = a.st.Update(func(d *store.Data) error { + d.AccountUser = "" + d.Cookies = nil + return nil + }) + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handleDevices(w http.ResponseWriter, r *http.Request) { + sess, err := a.accountSession() + if err != nil { + writeErr(w, http.StatusUnauthorized, publicErr(err)) + return + } + ctx, cancel := contextTimeout(r) + defer cancel() + list, err := sess.Devices(ctx) + _ = a.st.Update(func(d *store.Data) error { + d.Cookies = sess.Cookies() + return nil + }) + if err != nil { + writeErr(w, http.StatusBadGateway, publicErr(err)) + return + } + a.rememberDevices(list) + writeJSON(w, http.StatusOK, map[string]any{"items": a.decorate(list)}) +} + +func (a *App) handleGroups(w http.ResponseWriter, r *http.Request) { + sess, err := a.accountSession() + if err != nil { + writeErr(w, http.StatusUnauthorized, publicErr(err)) + return + } + ctx, cancel := contextTimeout(r) + defer cancel() + list, err := sess.Groups(ctx) + if err != nil { + writeErr(w, http.StatusBadGateway, publicErr(err)) + return + } + items := make([]map[string]string, 0, len(list)) + for _, g := range list { + items = append(items, map[string]string{"id": g.ID, "name": g.Name}) + } + writeJSON(w, http.StatusOK, map[string]any{"items": items}) +} + +func (a *App) handleCreateGroup(w http.ResponseWriter, r *http.Request) { + var req struct { + Name string `json:"name"` + } + if err := readJSON(r, &req); err != nil || !idutil.ValidName(req.Name) { + writeErr(w, http.StatusBadRequest, "请填写名称") + return + } + a.withAccount(w, r, func(ctx context.Context, sess *account.Session) error { + return sess.CreateGroup(ctx, strings.TrimSpace(req.Name)) + }) +} + +func (a *App) handleRenameGroup(w http.ResponseWriter, r *http.Request) { + var req struct { + Name string `json:"name"` + } + if err := readJSON(r, &req); err != nil || !idutil.ValidName(req.Name) { + writeErr(w, http.StatusBadRequest, "请填写名称") + return + } + id := r.PathValue("id") + a.withAccount(w, r, func(ctx context.Context, sess *account.Session) error { + return sess.RenameGroup(ctx, id, strings.TrimSpace(req.Name)) + }) +} + +func (a *App) handleDeleteGroup(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + a.withAccount(w, r, func(ctx context.Context, sess *account.Session) error { + return sess.DeleteGroup(ctx, id) + }) +} + +func (a *App) handleAddDevice(w http.ResponseWriter, r *http.Request) { + var req struct { + Name string `json:"name"` + EndpointID string `json:"endpoint_id"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + req.Name = strings.TrimSpace(req.Name) + req.EndpointID = strings.TrimSpace(req.EndpointID) + if !idutil.ValidName(req.Name) { + writeErr(w, http.StatusBadRequest, "请填写名称") + return + } + if req.EndpointID != "" && !idutil.ValidEndpoint(req.EndpointID) { + writeErr(w, http.StatusBadRequest, "端编号不正确") + return + } + sess, err := a.accountSession() + if err != nil { + writeErr(w, http.StatusUnauthorized, publicErr(err)) + return + } + ctx, cancel := contextTimeout(r) + defer cancel() + prov, err := sess.AddDevice(ctx, req.Name, req.EndpointID) + _ = a.st.Update(func(d *store.Data) error { + d.Cookies = sess.Cookies() + return nil + }) + if err != nil { + writeErr(w, http.StatusBadGateway, publicErr(err)) + return + } + if prov.DeviceToken != "" && req.EndpointID == "" { + _ = a.st.Update(func(d *store.Data) error { + d.DeviceToken = prov.DeviceToken + if prov.EndpointID != "" { + d.EndpointID = prov.EndpointID + } + return nil + }) + } + if prov.Password != "" && prov.EndpointID != "" { + var nix string + a.st.View(func(d *store.Data) { nix = d.NixURL }) + _ = a.connect(nix, prov.EndpointID, prov.Password, "") + } + id := prov.ID + if id == "" { + id = prov.EndpointID + } + name := prov.Name + if name == "" { + name = req.Name + } + ep := prov.EndpointID + if ep == "" { + ep = req.EndpointID + } + writeJSON(w, http.StatusOK, map[string]any{"id": id, "name": name, "endpoint_id": ep}) +} + +func (a *App) handlePatchDevice(w http.ResponseWriter, r *http.Request) { + var raw map[string]json.RawMessage + if err := readJSON(r, &raw); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + var name, groupID *string + if b, ok := raw["name"]; ok { + var s string + if json.Unmarshal(b, &s) != nil || !idutil.ValidName(s) { + writeErr(w, http.StatusBadRequest, "请填写名称") + return + } + s = strings.TrimSpace(s) + name = &s + } + if b, ok := raw["group_id"]; ok { + var s string + if json.Unmarshal(b, &s) != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + groupID = &s + } + id := r.PathValue("id") + a.withAccount(w, r, func(ctx context.Context, sess *account.Session) error { + return sess.PatchDevice(ctx, id, name, groupID) + }) +} + +func (a *App) handleDeleteDevice(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + a.withAccount(w, r, func(ctx context.Context, sess *account.Session) error { + return sess.DeleteDevice(ctx, id) + }) +} + +func (a *App) handleTrustList(w http.ResponseWriter, _ *http.Request) { + writeJSON(w, http.StatusOK, map[string]any{"items": a.eng.TrustList()}) +} + +func (a *App) handleTrustAdd(w http.ResponseWriter, r *http.Request) { + var req struct { + EndpointID string `json:"endpoint_id"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + if err := a.eng.TrustAdd(req.EndpointID); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handleTrustRemove(w http.ResponseWriter, r *http.Request) { + id, _ := url.PathUnescape(r.PathValue("id")) + if err := a.eng.TrustRemove(id); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handleLocalList(w http.ResponseWriter, r *http.Request) { + remote := r.URL.Query().Get("remote") + items := a.eng.ListLocal(remote) + out := make([]map[string]any, 0, len(items)) + for _, it := range items { + out = append(out, map[string]any{ + "id": it.ID, "name": it.Name, "shell": it.Shell, "confirm": it.Confirm, "remote_id": it.RemoteID, + }) + } + writeJSON(w, http.StatusOK, map[string]any{"items": out}) +} + +func (a *App) handleLocalSave(w http.ResponseWriter, r *http.Request) { + var req struct { + RemoteID string `json:"remote_id"` + Name string `json:"name"` + Shell string `json:"shell"` + Confirm bool `json:"confirm"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + item, err := a.eng.SaveLocal(req.RemoteID, req.Name, req.Shell, req.Confirm) + if err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, item) +} + +func (a *App) handleLocalUpdate(w http.ResponseWriter, r *http.Request) { + var req struct { + Name string `json:"name"` + Shell string `json:"shell"` + Confirm bool `json:"confirm"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + if err := a.eng.UpdateLocal(r.PathValue("id"), req.Name, req.Shell, req.Confirm); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handleLocalDelete(w http.ResponseWriter, r *http.Request) { + if err := a.eng.DeleteLocal(r.PathValue("id")); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handleCopy(w http.ResponseWriter, r *http.Request) { + var req struct { + RemoteID string `json:"remote_id"` + ShortcutID string `json:"shortcut_id"` + FromRemote bool `json:"from_remote"` + Targets []string `json:"targets"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + created, err := a.eng.CopyTo(req.RemoteID, req.ShortcutID, req.FromRemote, req.Targets) + if err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]any{"items": created}) +} + +func (a *App) handleRemoteList(w http.ResponseWriter, r *http.Request) { + remote := r.URL.Query().Get("remote") + c := a.eng.RemoteCache(remote) + synced := "" + if !c.SyncedAt.IsZero() { + synced = c.SyncedAt.UTC().Format(time.RFC3339) + } + writeJSON(w, http.StatusOK, map[string]any{ + "items": c.Items, "synced_at": synced, "syncing": c.Syncing, + }) +} + +func (a *App) handleRemoteRefresh(w http.ResponseWriter, r *http.Request) { + var req struct { + Remote string `json:"remote"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + if err := a.refreshShortcuts(req.Remote); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handlePublishedList(w http.ResponseWriter, _ *http.Request) { + writeJSON(w, http.StatusOK, map[string]any{"items": a.eng.Published()}) +} + +func (a *App) handlePublishedSave(w http.ResponseWriter, r *http.Request) { + var req struct { + Name string `json:"name"` + Shell string `json:"shell"` + Confirm bool `json:"confirm"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + item, err := a.eng.SavePublished(req.Name, req.Shell, req.Confirm) + if err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + go a.pushPublished() + writeJSON(w, http.StatusOK, item) +} + +func (a *App) handlePublishedUpdate(w http.ResponseWriter, r *http.Request) { + var req struct { + Name string `json:"name"` + Shell string `json:"shell"` + Confirm bool `json:"confirm"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + if err := a.eng.UpdatePublished(r.PathValue("id"), req.Name, req.Shell, req.Confirm); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + go a.pushPublished() + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handlePublishedDelete(w http.ResponseWriter, r *http.Request) { + if err := a.eng.DeletePublished(r.PathValue("id")); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + go a.pushPublished() + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handleSend(w http.ResponseWriter, r *http.Request) { + var req struct { + Remote string `json:"remote"` + Kind string `json:"kind"` + Shell string `json:"shell"` + Text string `json:"text"` + ShortcutID string `json:"shortcut_id"` + SendAtMs *int64 `json:"send_at_ms"` + Keep bool `json:"keep"` + TTLSeconds *int64 `json:"ttl_seconds"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + opt := engine.Delivery{Keep: req.Keep} + if req.Keep { + opt.TTL = req.TTLSeconds + } + if req.SendAtMs != nil && *req.SendAtMs > 0 { + t := time.UnixMilli(*req.SendAtMs) + opt.SendAt = &t + } + lim := a.limits() + var ( + id string + body []byte + err error + ) + switch req.Kind { + case "shell": + id, body, err = a.eng.SendShell(req.Remote, req.Shell, opt, lim) + case "text": + id, body, err = a.eng.SendText(req.Remote, req.Text, opt, lim) + case "remote": + id, body, err = a.eng.SendRemoteShortcut(req.Remote, req.ShortcutID, opt, lim) + case "local": + remote, script, _, lerr := a.eng.LocalShell(req.ShortcutID) + if lerr != nil { + err = lerr + break + } + id, body, err = a.eng.SendShell(remote, script, opt, lim) + req.Remote = remote + default: + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + if err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + if _, err := a.sendRaw(req.Remote, body, opt, true); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]any{"id": id, "note": a.offlineNote(req.Remote, opt)}) +} + +func (a *App) offlineNote(remote string, opt engine.Delivery) string { + if opt.SendAt != nil && opt.SendAt.After(time.Now().Add(2*time.Second)) { + return "到时再发送" + } + if opt.Keep { + return "" + } + a.mu.Lock() + defer a.mu.Unlock() + if a.connState == string(nixmsg.StateOnline) && a.presenceOK && !a.presence[remote] { + return "没有留下" + } + return "" +} + +func (a *App) handleInbox(w http.ResponseWriter, _ *http.Request) { + items := a.eng.Inbox() + out := make([]map[string]any, 0, len(items)) + for _, it := range items { + out = append(out, map[string]any{ + "id": it.ID, "from": it.From, "text": it.Text, "at": it.At.UTC().Format(time.RFC3339), "read": it.Read, + }) + } + writeJSON(w, http.StatusOK, map[string]any{"items": out}) +} + +func (a *App) handleInboxRead(w http.ResponseWriter, _ *http.Request) { + if err := a.eng.MarkInboxRead(); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) handleResults(w http.ResponseWriter, _ *http.Request) { + items := a.eng.Results() + out := make([]map[string]any, 0, len(items)) + for _, it := range items { + out = append(out, map[string]any{ + "id": it.ID, "remote": it.Remote, "ok": it.OK, "error": it.Error, "duplicate": it.Duplicate, + "at": it.At.UTC().Format(time.RFC3339), + }) + } + writeJSON(w, http.StatusOK, map[string]any{"items": out}) +} + +func (a *App) handleLocalLogs(w http.ResponseWriter, _ *http.Request) { + writeJSON(w, http.StatusOK, map[string]any{"items": a.eng.LocalLogs()}) +} + +func (a *App) handleRemoteLogs(w http.ResponseWriter, r *http.Request) { + remote := r.URL.Query().Get("remote") + c := a.eng.RemoteLogs(remote) + synced := "" + if !c.SyncedAt.IsZero() { + synced = c.SyncedAt.UTC().Format(time.RFC3339) + } + a.mu.Lock() + server := append([]protocol.Log(nil), a.serverLogs[remote]...) + a.mu.Unlock() + if server == nil { + server = []protocol.Log{} + } + writeJSON(w, http.StatusOK, map[string]any{ + "items": c.Items, "synced_at": synced, "syncing": c.Syncing, "error": c.Error, "server_items": server, + }) +} + +func (a *App) handleFetchLogs(w http.ResponseWriter, r *http.Request) { + var req struct { + Remote string `json:"remote"` + } + if err := readJSON(r, &req); err != nil { + writeErr(w, http.StatusBadRequest, "内容不正确") + return + } + if err := a.refreshLogs(req.Remote); err != nil { + writeErr(w, http.StatusBadRequest, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func (a *App) decorate(list []account.Device) []map[string]any { + a.mu.Lock() + connected := a.connState == string(nixmsg.StateOnline) + ready := a.presenceOK + presence := a.presence + a.mu.Unlock() + out := make([]map[string]any, 0, len(list)) + for _, d := range list { + p := "unknown" + if connected && ready { + if presence[d.EndpointID] { + p = "online" + } else { + p = "offline" + } + } + out = append(out, map[string]any{ + "id": d.ID, "name": d.Name, "endpoint_id": d.EndpointID, "group_id": d.GroupID, + "online": p == "online", "presence": p, + }) + } + return out +} + +func (a *App) accountSession() (*account.Session, error) { + var user string + a.st.View(func(d *store.Data) { user = d.AccountUser }) + if user == "" { + return nil, engine.Error("请先登录账号") + } + return a.session() +} + +func (a *App) withAccount(w http.ResponseWriter, r *http.Request, fn func(ctx context.Context, sess *account.Session) error) { + sess, err := a.accountSession() + if err != nil { + writeErr(w, http.StatusUnauthorized, publicErr(err)) + return + } + ctx, cancel := contextTimeout(r) + defer cancel() + err = fn(ctx, sess) + _ = a.st.Update(func(d *store.Data) error { + d.Cookies = sess.Cookies() + return nil + }) + if err != nil { + writeErr(w, http.StatusBadGateway, publicErr(err)) + return + } + writeJSON(w, http.StatusOK, map[string]bool{"ok": true}) +} + +func contextTimeout(r *http.Request) (context.Context, context.CancelFunc) { + return context.WithTimeout(r.Context(), 20*time.Second) +} + +func validServer(s string) bool { + u, err := url.Parse(s) + if err != nil || u.Host == "" { + return false + } + return u.Scheme == "http" || u.Scheme == "https" +} + +func validNix(s string) bool { + u, err := url.Parse(s) + if err != nil || u.Host == "" { + return false + } + return u.Scheme == "ws" || u.Scheme == "wss" +} + +func readJSON(r *http.Request, dst any) error { + dec := json.NewDecoder(http.MaxBytesReader(nil, r.Body, 1<<20)) + return dec.Decode(dst) +} + +func writeJSON(w http.ResponseWriter, code int, v any) { + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.WriteHeader(code) + enc := json.NewEncoder(w) + enc.SetEscapeHTML(false) + _ = enc.Encode(v) +} + +func writeErr(w http.ResponseWriter, code int, msg string) { + writeJSON(w, code, map[string]string{"error": msg}) +} + +func cors(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type") + w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, OPTIONS") + if r.Method == http.MethodOptions { + w.WriteHeader(http.StatusNoContent) + return + } + next.ServeHTTP(w, r) + }) +} diff --git a/agent/internal/app/http_test.go b/agent/internal/app/http_test.go new file mode 100644 index 0000000..cafd136 --- /dev/null +++ b/agent/internal/app/http_test.go @@ -0,0 +1,79 @@ +package app + +import ( + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" +) + +func TestHTTPTempShellDoesNotCreateShortcut(t *testing.T) { + a, err := New(t.TempDir()) + if err != nil { + t.Fatal(err) + } + a.token = "secret" + srv := httptest.NewServer(a.routes()) + defer srv.Close() + + res := do(t, srv.URL, "POST", "/v1/send", `{"remote":"peer-a","kind":"shell","shell":"echo hi"}`) + if res.StatusCode != http.StatusBadRequest { + t.Fatalf("status %d", res.StatusCode) + } + body, _ := io.ReadAll(res.Body) + _ = res.Body.Close() + if !strings.Contains(string(body), "还没有连上") { + t.Fatalf("body %s", body) + } + + res = do(t, srv.URL, "GET", "/v1/shortcuts/local?remote=peer-a", "") + raw, _ := io.ReadAll(res.Body) + _ = res.Body.Close() + if res.StatusCode != http.StatusOK { + t.Fatalf("list %d %s", res.StatusCode, raw) + } + if !strings.Contains(string(raw), `"items":[]`) && !strings.Contains(string(raw), `"items": []`) { + t.Fatalf("shortcut appeared: %s", raw) + } + + res = do(t, srv.URL, "POST", "/v1/shortcuts/local", `{"remote_id":"peer-a","name":"打招呼","shell":"echo hi","confirm":false}`) + raw, _ = io.ReadAll(res.Body) + _ = res.Body.Close() + if res.StatusCode != http.StatusOK { + t.Fatalf("save %d %s", res.StatusCode, raw) + } + res = do(t, srv.URL, "GET", "/v1/shortcuts/local?remote=peer-a", "") + raw, _ = io.ReadAll(res.Body) + _ = res.Body.Close() + if !strings.Contains(string(raw), "打招呼") { + t.Fatalf("saved item missing: %s", raw) + } + res = do(t, srv.URL, "GET", "/v1/shortcuts/local?remote=peer-b", "") + raw, _ = io.ReadAll(res.Body) + _ = res.Body.Close() + if strings.Contains(string(raw), "打招呼") { + t.Fatalf("leaked: %s", raw) + } +} + +func do(t *testing.T, base, method, path, body string) *http.Response { + t.Helper() + var rdr io.Reader + if body != "" { + rdr = strings.NewReader(body) + } + req, err := http.NewRequest(method, base+path, rdr) + if err != nil { + t.Fatal(err) + } + req.Header.Set("Authorization", "Bearer secret") + if body != "" { + req.Header.Set("Content-Type", "application/json") + } + res, err := http.DefaultClient.Do(req) + if err != nil { + t.Fatal(err) + } + return res +} diff --git a/agent/internal/engine/engine.go b/agent/internal/engine/engine.go new file mode 100644 index 0000000..ebc8eb1 --- /dev/null +++ b/agent/internal/engine/engine.go @@ -0,0 +1,811 @@ +package engine + +import ( + "context" + "strings" + "time" + + "git.asio.asia/TapRemly/desktop/agent/internal/idutil" + "git.asio.asia/TapRemly/desktop/agent/internal/protocol" + "git.asio.asia/TapRemly/desktop/agent/internal/shell" + "git.asio.asia/TapRemly/desktop/agent/internal/store" +) + +const ( + dedupWindow = 24 * time.Hour + defaultMaxTTL = int64(2592000) + defaultMaxSchedule = int64(31536000) +) + +// Outbox 是要发出的一条正文。 +type Outbox struct { + To string + Body []byte +} + +// Delivery 是发送选项,不写入正文。 +type Delivery struct { + SendAt *time.Time + Keep bool + TTL *int64 +} + +// Limits 来自连接握手,为零时用默认上限。 +type Limits struct { + MaxTTL int64 + MaxSchedule int64 +} + +func (l Limits) ttl() int64 { + if l.MaxTTL > 0 { + return l.MaxTTL + } + return defaultMaxTTL +} + +func (l Limits) schedule() int64 { + if l.MaxSchedule > 0 { + return l.MaxSchedule + } + return defaultMaxSchedule +} + +// Engine 处理信任、执行、快捷命令和去重。不连接网络。 +type Engine struct { + st *store.Store + run shell.Runner + now func() time.Time +} + +func New(st *store.Store, run shell.Runner) *Engine { + if run == nil { + run = shell.System{} + } + return &Engine{st: st, run: run, now: time.Now} +} + +// Accept 处理一条收到的正文,返回需要回复的消息。 +// 同一 id 在 24 小时内只执行一次。未信任不执行。 +func (e *Engine) Accept(from, raw string) ([]Outbox, []protocol.Log, error) { + msg, err := protocol.Parse(raw) + if err != nil || msg.V != protocol.Version { + return nil, nil, nil + } + switch msg.Type { + case protocol.TypeShell: + return e.acceptCommand(from, msg.ID, msg.Shell, false, "") + case protocol.TypeShortcut: + return e.acceptCommand(from, msg.ID, "", true, msg.ShortcutID) + case protocol.TypeText: + return nil, nil, e.acceptText(from, msg) + case protocol.TypeShortcuts: + return nil, nil, e.acceptShortcuts(from, msg) + case protocol.TypeShortcutsGet: + return e.replyShortcuts(from, msg.ID) + case protocol.TypeLogsGet: + return e.replyLogs(from, msg.ID) + case protocol.TypeLogs: + return nil, nil, e.acceptLogs(from, msg) + case protocol.TypeResult: + return nil, nil, e.acceptResult(from, msg) + default: + return nil, nil, nil + } +} + +func (e *Engine) acceptCommand(from, id, script string, shortcut bool, shortcutID string) ([]Outbox, []protocol.Log, error) { + if !idutil.ValidMessage(id) { + return nil, nil, nil + } + now := e.now() + var ( + reply []byte + fresh bool + runSh string + ) + err := e.st.Update(func(d *store.Data) error { + store.TrimExecuted(d, now, dedupWindow) + if prev, ok := findExecuted(d, id); ok { + body, err := protocol.ResultBody(id, prev.OK, prev.Error, true) + if err != nil { + return err + } + reply = body + return nil + } + fresh = true + if !trusted(d, from) { + body, err := protocol.ResultBody(id, false, protocol.ErrNotTrusted, false) + if err != nil { + return err + } + reply = body + d.Executed = append(d.Executed, store.Executed{ID: id, At: now, OK: false, Error: protocol.ErrNotTrusted}) + return nil + } + if shortcut { + item, ok := findPublished(d, shortcutID) + if !ok { + body, err := protocol.ResultBody(id, false, "没有这条命令", false) + if err != nil { + return err + } + reply = body + d.Executed = append(d.Executed, store.Executed{ID: id, At: now, OK: false, Error: "没有这条命令"}) + return nil + } + script = item.Shell + } + script = strings.TrimSpace(script) + if script == "" { + body, err := protocol.ResultBody(id, false, "命令是空的", false) + if err != nil { + return err + } + reply = body + d.Executed = append(d.Executed, store.Executed{ID: id, At: now, OK: false, Error: "命令是空的"}) + return nil + } + runSh = script + // 先占住这个 id,避免执行过程中的重复投递再跑一次。 + d.Executed = append(d.Executed, store.Executed{ID: id, At: now, OK: false, Error: "正在执行"}) + return nil + }) + if err != nil { + return nil, nil, err + } + if !fresh || runSh == "" { + if reply == nil { + return nil, nil, nil + } + return []Outbox{{To: from, Body: reply}}, nil, nil + } + + out, runErr := e.run.Run(context.Background(), runSh) + ok, detail := shell.Summarize(out, runErr) + body, err := protocol.ResultBody(id, ok, errText(ok, detail), false) + if err != nil { + return nil, nil, err + } + logItem := protocol.Log{ + At: now.UTC().Format(time.RFC3339), + Summary: shell.Summary(runSh), + OK: ok, + Detail: detail, + } + var upload []protocol.Log + err = e.st.Update(func(d *store.Data) error { + for i := range d.Executed { + if d.Executed[i].ID == id { + d.Executed[i].OK = ok + d.Executed[i].Error = errText(ok, detail) + d.Executed[i].Detail = detail + break + } + } + upload = store.AppendLog(d, logItem) + return nil + }) + if err != nil { + return nil, nil, err + } + return []Outbox{{To: from, Body: body}}, upload, nil +} + +func errText(ok bool, detail string) string { + if ok { + return "" + } + if detail == "" { + return "没有成功" + } + return detail +} + +func (e *Engine) acceptText(from string, msg protocol.Message) error { + text := strings.TrimSpace(msg.Text) + if text == "" { + return nil + } + return e.st.Update(func(d *store.Data) error { + d.Inbox = append(d.Inbox, store.TextMsg{ + ID: msg.ID, + From: from, + Text: text, + At: e.now(), + }) + if len(d.Inbox) > 200 { + d.Inbox = append([]store.TextMsg(nil), d.Inbox[len(d.Inbox)-200:]...) + } + return nil + }) +} + +func (e *Engine) acceptShortcuts(from string, msg protocol.Message) error { + items := append([]protocol.Shortcut(nil), msg.Items...) + return e.st.Update(func(d *store.Data) error { + prev := d.Remote[from] + prev.Items = items + prev.SyncedAt = e.now() + prev.Syncing = false + prev.ReqID = "" + d.Remote[from] = prev + return nil + }) +} + +func (e *Engine) acceptLogs(from string, msg protocol.Message) error { + items := append([]protocol.Log(nil), msg.Logs...) + return e.st.Update(func(d *store.Data) error { + prev := d.RemoteLogs[from] + prev.Items = items + prev.SyncedAt = e.now() + prev.Syncing = false + prev.ReqID = "" + prev.Error = msg.Error + d.RemoteLogs[from] = prev + return nil + }) +} + +func (e *Engine) acceptResult(from string, msg protocol.Message) error { + if msg.ID == "" || msg.OK == nil { + return nil + } + ok := *msg.OK + return e.st.Update(func(d *store.Data) error { + d.Results = append(d.Results, store.CmdResult{ + ID: msg.ID, + Remote: from, + OK: ok, + Error: msg.Error, + Duplicate: msg.Duplicate, + At: e.now(), + }) + if len(d.Results) > 200 { + d.Results = append([]store.CmdResult(nil), d.Results[len(d.Results)-200:]...) + } + return nil + }) +} + +func (e *Engine) replyShortcuts(from, id string) ([]Outbox, []protocol.Log, error) { + var items []protocol.Shortcut + e.st.View(func(d *store.Data) { + items = append([]protocol.Shortcut(nil), d.Published...) + }) + body, err := protocol.ShortcutsBody(id, items) + if err != nil { + return nil, nil, err + } + return []Outbox{{To: from, Body: body}}, nil, nil +} + +func (e *Engine) replyLogs(from, id string) ([]Outbox, []protocol.Log, error) { + var ( + trustedPeer bool + items []protocol.Log + ) + e.st.View(func(d *store.Data) { + trustedPeer = trusted(d, from) + if trustedPeer { + items = append([]protocol.Log(nil), d.Logs...) + } + }) + if !trustedPeer { + body, err := protocol.LogsBody(id, false, protocol.ErrNotTrusted, nil) + if err != nil { + return nil, nil, err + } + return []Outbox{{To: from, Body: body}}, nil, nil + } + body, err := protocol.LogsBody(id, true, "", items) + if err != nil { + return nil, nil, err + } + return []Outbox{{To: from, Body: body}}, nil, nil +} + +// SendShell 只组一条临时命令,不写入快捷命令。 +func (e *Engine) SendShell(remote, script string, opt Delivery, lim Limits) (string, []byte, error) { + script = strings.TrimSpace(script) + if script == "" { + return "", nil, errStr("请输入要执行的内容") + } + if err := checkDelivery(opt, lim, e.now()); err != nil { + return "", nil, err + } + if !idutil.ValidEndpoint(remote) { + return "", nil, errStr("端编号不正确") + } + id := idutil.New() + body, err := protocol.ShellBody(id, script) + if err != nil { + return "", nil, err + } + return id, body, nil +} + +// SendText 只组文字,不进入 shell。 +func (e *Engine) SendText(remote, text string, opt Delivery, lim Limits) (string, []byte, error) { + text = strings.TrimSpace(text) + if text == "" { + return "", nil, errStr("请输入文字") + } + if err := checkDelivery(opt, lim, e.now()); err != nil { + return "", nil, err + } + if !idutil.ValidEndpoint(remote) { + return "", nil, errStr("端编号不正确") + } + id := idutil.New() + body, err := protocol.TextBody(id, text) + if err != nil { + return "", nil, err + } + return id, body, nil +} + +// SendRemoteShortcut 让远端执行它自己保存的快捷命令。 +func (e *Engine) SendRemoteShortcut(remote, shortcutID string, opt Delivery, lim Limits) (string, []byte, error) { + if !idutil.ValidMessage(shortcutID) { + return "", nil, errStr("没有这条命令") + } + if err := checkDelivery(opt, lim, e.now()); err != nil { + return "", nil, err + } + if !idutil.ValidEndpoint(remote) { + return "", nil, errStr("端编号不正确") + } + id := idutil.New() + body, err := protocol.ShortcutBody(id, shortcutID) + if err != nil { + return "", nil, err + } + return id, body, nil +} + +// LocalShell 取出本端快捷命令的 shell,供发送使用。不新增记录。 +func (e *Engine) LocalShell(id string) (remote, script string, confirm bool, err error) { + err = errStr("没有这条命令") + e.st.View(func(d *store.Data) { + for _, it := range d.Local { + if it.ID == id { + remote = it.RemoteID + script = it.Shell + confirm = it.Confirm + err = nil + return + } + } + }) + return remote, script, confirm, err +} + +// SaveLocal 把当前内容存进这一台远端的本端列表。 +func (e *Engine) SaveLocal(remote, name, script string, confirm bool) (protocol.Shortcut, error) { + remote = strings.TrimSpace(remote) + name = strings.TrimSpace(name) + script = strings.TrimSpace(script) + if !idutil.ValidEndpoint(remote) { + return protocol.Shortcut{}, errStr("端编号不正确") + } + if !idutil.ValidName(name) { + return protocol.Shortcut{}, errStr("请填写名称") + } + if script == "" { + return protocol.Shortcut{}, errStr("请填写要执行的内容") + } + item := protocol.Shortcut{ID: idutil.New(), Name: name, Shell: script, Confirm: confirm} + err := e.st.Update(func(d *store.Data) error { + d.Local = append(d.Local, store.LocalShortcut{Shortcut: item, RemoteID: remote}) + return nil + }) + return item, err +} + +// UpdateLocal 只改本端快捷命令。 +func (e *Engine) UpdateLocal(id, name, script string, confirm bool) error { + name = strings.TrimSpace(name) + script = strings.TrimSpace(script) + if !idutil.ValidName(name) { + return errStr("请填写名称") + } + if script == "" { + return errStr("请填写要执行的内容") + } + found := false + err := e.st.Update(func(d *store.Data) error { + for i := range d.Local { + if d.Local[i].ID == id { + d.Local[i].Name = name + d.Local[i].Shell = script + d.Local[i].Confirm = confirm + found = true + return nil + } + } + return errStr("没有这条命令") + }) + if err != nil { + return err + } + if !found { + return errStr("没有这条命令") + } + return nil +} + +// DeleteLocal 删除本端快捷命令。 +func (e *Engine) DeleteLocal(id string) error { + found := false + err := e.st.Update(func(d *store.Data) error { + out := d.Local[:0] + for _, it := range d.Local { + if it.ID == id { + found = true + continue + } + out = append(out, it) + } + d.Local = out + if !found { + return errStr("没有这条命令") + } + return nil + }) + return err +} + +// ListLocal 返回某一台远端的本端快捷命令。 +func (e *Engine) ListLocal(remote string) []store.LocalShortcut { + var out []store.LocalShortcut + e.st.View(func(d *store.Data) { + for _, it := range d.Local { + if it.RemoteID == remote { + out = append(out, it) + } + } + }) + if out == nil { + out = []store.LocalShortcut{} + } + return out +} + +// CopyLocal 把一条本端或远端缓存的快捷命令复制到其他远端的本端列表,生成新编号。 +func (e *Engine) CopyTo(sourceRemote, shortcutID string, fromRemote bool, targets []string) ([]protocol.Shortcut, error) { + if len(targets) == 0 { + return nil, errStr("请选择设备") + } + var src protocol.Shortcut + found := false + e.st.View(func(d *store.Data) { + if fromRemote { + cache := d.Remote[sourceRemote] + for _, it := range cache.Items { + if it.ID == shortcutID { + src = it + found = true + return + } + } + return + } + for _, it := range d.Local { + if it.ID == shortcutID && it.RemoteID == sourceRemote { + src = it.Shortcut + found = true + return + } + } + }) + if !found { + return nil, errStr("没有这条命令") + } + created := make([]protocol.Shortcut, 0, len(targets)) + err := e.st.Update(func(d *store.Data) error { + seen := map[string]bool{} + for _, remote := range targets { + remote = strings.TrimSpace(remote) + if !idutil.ValidEndpoint(remote) { + return errStr("端编号不正确") + } + if seen[remote] { + continue + } + seen[remote] = true + item := protocol.Shortcut{ + ID: idutil.New(), + Name: src.Name, + Shell: src.Shell, + Confirm: src.Confirm, + } + d.Local = append(d.Local, store.LocalShortcut{Shortcut: item, RemoteID: remote}) + created = append(created, item) + } + return nil + }) + return created, err +} + +// RemoteCache 返回上次同步的远端快捷命令。 +func (e *Engine) RemoteCache(remote string) store.RemoteCache { + var c store.RemoteCache + e.st.View(func(d *store.Data) { + c = d.Remote[remote] + c.Items = append([]protocol.Shortcut(nil), c.Items...) + }) + if c.Items == nil { + c.Items = []protocol.Shortcut{} + } + return c +} + +// BeginShortcutSync 标记正在同步。 +func (e *Engine) BeginShortcutSync(remote, reqID string) error { + return e.st.Update(func(d *store.Data) error { + prev := d.Remote[remote] + prev.Syncing = true + prev.ReqID = reqID + d.Remote[remote] = prev + return nil + }) +} + +// BeginLogSync 标记正在拉取日志。 +func (e *Engine) BeginLogSync(remote, reqID string) error { + return e.st.Update(func(d *store.Data) error { + prev := d.RemoteLogs[remote] + prev.Syncing = true + prev.ReqID = reqID + prev.Error = "" + d.RemoteLogs[remote] = prev + return nil + }) +} + +// FinishShortcutSync 在超时或失败时结束同步。已经收到列表则不动。 +func (e *Engine) FinishShortcutSync(remote, reqID string) error { + return e.st.Update(func(d *store.Data) error { + prev := d.Remote[remote] + if prev.ReqID == reqID { + prev.Syncing = false + prev.ReqID = "" + d.Remote[remote] = prev + } + return nil + }) +} + +// FinishLogSync 在超时或失败时结束日志拉取。 +func (e *Engine) FinishLogSync(remote, reqID, errText string) error { + return e.st.Update(func(d *store.Data) error { + prev := d.RemoteLogs[remote] + if prev.ReqID == reqID { + prev.Syncing = false + prev.ReqID = "" + if errText != "" && prev.Error == "" { + prev.Error = errText + } + d.RemoteLogs[remote] = prev + } + return nil + }) +} + +// RemoteLogs 返回向对方要来的日志。 +func (e *Engine) RemoteLogs(remote string) store.LogCache { + var c store.LogCache + e.st.View(func(d *store.Data) { + c = d.RemoteLogs[remote] + c.Items = append([]protocol.Log(nil), c.Items...) + }) + if c.Items == nil { + c.Items = []protocol.Log{} + } + return c +} + +// LocalLogs 返回本机执行记录。 +func (e *Engine) LocalLogs() []protocol.Log { + var out []protocol.Log + e.st.View(func(d *store.Data) { + out = append([]protocol.Log(nil), d.Logs...) + }) + if out == nil { + out = []protocol.Log{} + } + return out +} + +func (e *Engine) TrustList() []string { + var out []string + e.st.View(func(d *store.Data) { + out = append([]string(nil), d.Trust...) + }) + if out == nil { + out = []string{} + } + return out +} + +func (e *Engine) TrustAdd(id string) error { + id = strings.TrimSpace(id) + if !idutil.ValidEndpoint(id) { + return errStr("端编号不正确") + } + return e.st.Update(func(d *store.Data) error { + if trusted(d, id) { + return nil + } + d.Trust = append(d.Trust, id) + return nil + }) +} + +func (e *Engine) TrustRemove(id string) error { + return e.st.Update(func(d *store.Data) error { + out := d.Trust[:0] + for _, it := range d.Trust { + if it == id { + continue + } + out = append(out, it) + } + d.Trust = out + return nil + }) +} + +func (e *Engine) Published() []protocol.Shortcut { + var out []protocol.Shortcut + e.st.View(func(d *store.Data) { + out = append([]protocol.Shortcut(nil), d.Published...) + }) + if out == nil { + out = []protocol.Shortcut{} + } + return out +} + +// SavePublished 新增本机发布的快捷命令,返回是否需要推送。 +func (e *Engine) SavePublished(name, script string, confirm bool) (protocol.Shortcut, error) { + name = strings.TrimSpace(name) + script = strings.TrimSpace(script) + if !idutil.ValidName(name) { + return protocol.Shortcut{}, errStr("请填写名称") + } + if script == "" { + return protocol.Shortcut{}, errStr("请填写要执行的内容") + } + item := protocol.Shortcut{ID: idutil.New(), Name: name, Shell: script, Confirm: confirm} + err := e.st.Update(func(d *store.Data) error { + d.Published = append(d.Published, item) + return nil + }) + return item, err +} + +func (e *Engine) UpdatePublished(id, name, script string, confirm bool) error { + name = strings.TrimSpace(name) + script = strings.TrimSpace(script) + if !idutil.ValidName(name) { + return errStr("请填写名称") + } + if script == "" { + return errStr("请填写要执行的内容") + } + return e.st.Update(func(d *store.Data) error { + for i := range d.Published { + if d.Published[i].ID == id { + d.Published[i].Name = name + d.Published[i].Shell = script + d.Published[i].Confirm = confirm + return nil + } + } + return errStr("没有这条命令") + }) +} + +func (e *Engine) DeletePublished(id string) error { + return e.st.Update(func(d *store.Data) error { + out := d.Published[:0] + found := false + for _, it := range d.Published { + if it.ID == id { + found = true + continue + } + out = append(out, it) + } + if !found { + return errStr("没有这条命令") + } + d.Published = out + return nil + }) +} + +func (e *Engine) Inbox() []store.TextMsg { + var out []store.TextMsg + e.st.View(func(d *store.Data) { + out = append([]store.TextMsg(nil), d.Inbox...) + }) + if out == nil { + out = []store.TextMsg{} + } + return out +} + +func (e *Engine) MarkInboxRead() error { + return e.st.Update(func(d *store.Data) error { + for i := range d.Inbox { + d.Inbox[i].Read = true + } + return nil + }) +} + +func (e *Engine) Results() []store.CmdResult { + var out []store.CmdResult + e.st.View(func(d *store.Data) { + out = append([]store.CmdResult(nil), d.Results...) + }) + if out == nil { + out = []store.CmdResult{} + } + return out +} + +func checkDelivery(opt Delivery, lim Limits, now time.Time) error { + if opt.Keep { + if opt.TTL == nil || *opt.TTL <= 0 { + return errStr("请填写有效期") + } + if *opt.TTL > lim.ttl() { + return errStr("有效期超出上限") + } + } + if opt.SendAt != nil { + if opt.SendAt.After(now.Add(time.Duration(lim.schedule()) * time.Second)) { + return errStr("定时超出上限") + } + } + return nil +} + +func trusted(d *store.Data, id string) bool { + for _, it := range d.Trust { + if it == id { + return true + } + } + return false +} + +func findExecuted(d *store.Data, id string) (store.Executed, bool) { + for _, it := range d.Executed { + if it.ID == id { + return it, true + } + } + return store.Executed{}, false +} + +func findPublished(d *store.Data, id string) (protocol.Shortcut, bool) { + for _, it := range d.Published { + if it.ID == id { + return it, true + } + } + return protocol.Shortcut{}, false +} + +// Error 是可以显示给用户的短句。 +type Error string + +func (e Error) Error() string { return string(e) } + +func errStr(s string) error { return Error(s) } diff --git a/agent/internal/engine/engine_test.go b/agent/internal/engine/engine_test.go new file mode 100644 index 0000000..530e3d9 --- /dev/null +++ b/agent/internal/engine/engine_test.go @@ -0,0 +1,253 @@ +package engine + +import ( + "context" + "encoding/json" + "strings" + "testing" + "time" + + "git.asio.asia/TapRemly/desktop/agent/internal/protocol" + "git.asio.asia/TapRemly/desktop/agent/internal/store" +) + +type fakeRun struct { + calls []string +} + +func (f *fakeRun) Run(_ context.Context, script string) (string, error) { + f.calls = append(f.calls, script) + return "done", nil +} + +func newTest(t *testing.T) (*Engine, *fakeRun) { + t.Helper() + st, err := store.New(t.TempDir()) + if err != nil { + t.Fatal(err) + } + fake := &fakeRun{} + return New(st, fake), fake +} + +func shellRaw(id, script string) string { + b, _ := protocol.ShellBody(id, script) + return string(b) +} + +func resultOf(t *testing.T, body []byte) protocol.Message { + t.Helper() + m, err := protocol.Parse(string(body)) + if err != nil { + t.Fatal(err) + } + return m +} + +func TestUntrustedDoesNotRun(t *testing.T) { + e, fake := newTest(t) + outs, logs, err := e.Accept("stranger", shellRaw("cmd-1", "echo hi")) + if err != nil { + t.Fatal(err) + } + if len(fake.calls) != 0 { + t.Fatalf("executed: %v", fake.calls) + } + if len(logs) != 0 { + t.Fatal("logged untrusted command") + } + if len(outs) != 1 { + t.Fatalf("outs %d", len(outs)) + } + got := resultOf(t, outs[0].Body) + if got.OK == nil || *got.OK || got.Error != protocol.ErrNotTrusted || got.Duplicate { + t.Fatalf("result %+v", got) + } + + outs, _, err = e.Accept("stranger", shellRaw("cmd-1", "echo hi")) + if err != nil { + t.Fatal(err) + } + if len(fake.calls) != 0 { + t.Fatal("second delivery executed") + } + got = resultOf(t, outs[0].Body) + if got.Error != protocol.ErrNotTrusted || !got.Duplicate { + t.Fatalf("duplicate result %+v", got) + } +} + +func TestSameIDRunsOnce(t *testing.T) { + e, fake := newTest(t) + if err := e.TrustAdd("friend"); err != nil { + t.Fatal(err) + } + outs, _, err := e.Accept("friend", shellRaw("cmd-9", "echo once")) + if err != nil { + t.Fatal(err) + } + if len(fake.calls) != 1 || fake.calls[0] != "echo once" { + t.Fatalf("calls %v", fake.calls) + } + first := resultOf(t, outs[0].Body) + if first.OK == nil || !*first.OK || first.Duplicate { + t.Fatalf("first %+v", first) + } + + outs, _, err = e.Accept("friend", shellRaw("cmd-9", "echo once")) + if err != nil { + t.Fatal(err) + } + if len(fake.calls) != 1 { + t.Fatalf("ran again: %v", fake.calls) + } + second := resultOf(t, outs[0].Body) + if second.OK == nil || !*second.OK || !second.Duplicate { + t.Fatalf("second %+v", second) + } +} + +func TestDuplicateExpiresAfter24h(t *testing.T) { + e, fake := newTest(t) + start := time.Date(2026, 1, 2, 3, 4, 5, 0, time.UTC) + e.now = func() time.Time { return start } + if err := e.TrustAdd("friend"); err != nil { + t.Fatal(err) + } + if _, _, err := e.Accept("friend", shellRaw("cmd-9", "echo once")); err != nil { + t.Fatal(err) + } + e.now = func() time.Time { return start.Add(25 * time.Hour) } + if _, _, err := e.Accept("friend", shellRaw("cmd-9", "echo once")); err != nil { + t.Fatal(err) + } + if len(fake.calls) != 2 { + t.Fatalf("calls %d", len(fake.calls)) + } +} + +func TestTempShellDoesNotCreateShortcut(t *testing.T) { + e, _ := newTest(t) + if _, _, err := e.SendShell("peer-a", "echo hi", Delivery{}, Limits{}); err != nil { + t.Fatal(err) + } + if n := len(e.ListLocal("peer-a")); n != 0 { + t.Fatalf("temp shell created %d shortcuts", n) + } + if _, err := e.SaveLocal("peer-a", "打招呼", "echo hi", false); err != nil { + t.Fatal(err) + } + got := e.ListLocal("peer-a") + if len(got) != 1 || got[0].Name != "打招呼" || got[0].Shell != "echo hi" { + t.Fatalf("%+v", got) + } + if n := len(e.ListLocal("peer-b")); n != 0 { + t.Fatalf("leaked to other remote: %d", n) + } +} + +func TestShortcutsStayWithRemote(t *testing.T) { + e, _ := newTest(t) + if _, err := e.SaveLocal("peer-a", "关机", "shutdown -s -t 1", true); err != nil { + t.Fatal(err) + } + if _, err := e.SaveLocal("peer-b", "查看", "dir", false); err != nil { + t.Fatal(err) + } + a := e.ListLocal("peer-a") + b := e.ListLocal("peer-b") + if len(a) != 1 || a[0].Name != "关机" || len(b) != 1 || b[0].Name != "查看" { + t.Fatalf("a=%+v b=%+v", a, b) + } +} + +func TestCopyCreatesNewIDs(t *testing.T) { + e, _ := newTest(t) + src, err := e.SaveLocal("peer-a", "关机", "shutdown -s -t 1", true) + if err != nil { + t.Fatal(err) + } + created, err := e.CopyTo("peer-a", src.ID, false, []string{"peer-b", "peer-c"}) + if err != nil { + t.Fatal(err) + } + if len(created) != 2 { + t.Fatalf("created %d", len(created)) + } + seen := map[string]bool{src.ID: true} + for _, it := range created { + if seen[it.ID] { + t.Fatalf("id reused: %s", it.ID) + } + seen[it.ID] = true + if it.Name != "关机" || it.Shell != "shutdown -s -t 1" || !it.Confirm { + t.Fatalf("copy changed fields: %+v", it) + } + } + if len(e.ListLocal("peer-a")) != 1 { + t.Fatal("source changed") + } + if len(e.ListLocal("peer-b")) != 1 || len(e.ListLocal("peer-c")) != 1 { + t.Fatal("missing copy") + } +} + +func TestTextDoesNotRunShell(t *testing.T) { + e, fake := newTest(t) + if err := e.TrustAdd("friend"); err != nil { + t.Fatal(err) + } + raw, _ := protocol.TextBody("msg-1", "你好") + outs, logs, err := e.Accept("friend", string(raw)) + if err != nil { + t.Fatal(err) + } + if len(fake.calls) != 0 || len(outs) != 0 || len(logs) != 0 { + t.Fatalf("text entered shell calls=%v outs=%d logs=%d", fake.calls, len(outs), len(logs)) + } + inbox := e.Inbox() + if len(inbox) != 1 || inbox[0].Text != "你好" || inbox[0].From != "friend" { + t.Fatalf("inbox %+v", inbox) + } +} + +func TestPublishedShortcutUsesStoredShell(t *testing.T) { + e, fake := newTest(t) + if err := e.TrustAdd("friend"); err != nil { + t.Fatal(err) + } + item, err := e.SavePublished("列目录", "dir", false) + if err != nil { + t.Fatal(err) + } + body, _ := protocol.ShortcutBody("cmd-3", item.ID) + if _, _, err := e.Accept("friend", string(body)); err != nil { + t.Fatal(err) + } + if len(fake.calls) != 1 || fake.calls[0] != "dir" { + t.Fatalf("calls %v", fake.calls) + } +} + +func TestMissingShortcutDoesNotRun(t *testing.T) { + e, fake := newTest(t) + if err := e.TrustAdd("friend"); err != nil { + t.Fatal(err) + } + body, _ := protocol.ShortcutBody("cmd-4", "missing-id") + outs, _, err := e.Accept("friend", string(body)) + if err != nil { + t.Fatal(err) + } + if len(fake.calls) != 0 { + t.Fatal("ran missing shortcut") + } + got := resultOf(t, outs[0].Body) + if got.OK == nil || *got.OK || got.Error == "" { + b, _ := json.Marshal(got) + t.Fatalf("result %s", b) + } + if strings.Contains(got.Error, "not_trusted") { + t.Fatal("trusted peer reported not trusted") + } +} diff --git a/agent/internal/idutil/id.go b/agent/internal/idutil/id.go new file mode 100644 index 0000000..2679895 --- /dev/null +++ b/agent/internal/idutil/id.go @@ -0,0 +1,52 @@ +package idutil + +import ( + "crypto/rand" + "encoding/hex" + "strings" + "unicode/utf8" +) + +// New 生成 32 位消息号,符合 1–64 位字母数字及 _ . -。 +func New() string { + var b [16]byte + _, _ = rand.Read(b[:]) + return hex.EncodeToString(b[:]) +} + +// ValidMessage 检查消息号。 +func ValidMessage(s string) bool { + if len(s) < 1 || len(s) > 64 { + return false + } + for i := 0; i < len(s); i++ { + c := s[i] + if (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_' || c == '.' || c == '-' { + continue + } + return false + } + return true +} + +// ValidEndpoint 检查端编号:小写字母、数字、_ . -。 +func ValidEndpoint(s string) bool { + if len(s) < 1 || len(s) > 64 { + return false + } + for i := 0; i < len(s); i++ { + c := s[i] + if (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '_' || c == '.' || c == '-' { + continue + } + return false + } + return true +} + +// ValidName 检查给人看的名称。 +func ValidName(s string) bool { + s = strings.TrimSpace(s) + n := utf8.RuneCountInString(s) + return n >= 1 && n <= 40 +} diff --git a/agent/internal/lockfile/lock_unix.go b/agent/internal/lockfile/lock_unix.go new file mode 100644 index 0000000..425479b --- /dev/null +++ b/agent/internal/lockfile/lock_unix.go @@ -0,0 +1,24 @@ +//go:build !windows + +package lockfile + +import ( + "os" + "syscall" +) + +func lockExclusive(f *os.File) error { + err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB) + if err == syscall.EWOULDBLOCK || err == syscall.EAGAIN { + return ErrBusy + } + return err +} + +func unlock(f *os.File) { + _ = syscall.Flock(int(f.Fd()), syscall.LOCK_UN) +} + +func ownOnly(path string) { + _ = os.Chmod(path, 0o600) +} diff --git a/agent/internal/lockfile/lock_windows.go b/agent/internal/lockfile/lock_windows.go new file mode 100644 index 0000000..d3e34cf --- /dev/null +++ b/agent/internal/lockfile/lock_windows.go @@ -0,0 +1,60 @@ +//go:build windows + +package lockfile + +import ( + "os" + "os/exec" + "syscall" + "unsafe" +) + +var ( + modkernel32 = syscall.NewLazyDLL("kernel32.dll") + procLockFileEx = modkernel32.NewProc("LockFileEx") + procUnlockFileEx = modkernel32.NewProc("UnlockFileEx") +) + +const ( + lockfileExclusive = 0x00000002 + lockfileFailImmediately = 0x00000001 +) + +func lockExclusive(f *os.File) error { + var ov syscall.Overlapped + // 锁在文件末尾之外,界面仍能读取正文。 + ov.Offset = 0xFFFF0000 + ov.OffsetHigh = 0x7FFF + r, _, err := procLockFileEx.Call( + f.Fd(), + uintptr(lockfileExclusive|lockfileFailImmediately), + 0, + 1, + 0, + uintptr(unsafe.Pointer(&ov)), + ) + if r == 0 { + if errno, ok := err.(syscall.Errno); ok && errno != 0 && errno != 32 && errno != 33 { + return errno + } + return ErrBusy + } + return nil +} + +func unlock(f *os.File) { + var ov syscall.Overlapped + ov.Offset = 0xFFFF0000 + ov.OffsetHigh = 0x7FFF + _, _, _ = procUnlockFileEx.Call(f.Fd(), 0, 1, 0, uintptr(unsafe.Pointer(&ov))) +} + +func ownOnly(path string) { + user := os.Getenv("USERNAME") + if user == "" { + return + } + cmd := exec.Command("icacls", path, "/inheritance:r", "/grant:r", user+":(F)") + cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true, CreationFlags: 0x08000000} + _ = cmd.Run() +} diff --git a/agent/internal/lockfile/lockfile.go b/agent/internal/lockfile/lockfile.go new file mode 100644 index 0000000..4878cc8 --- /dev/null +++ b/agent/internal/lockfile/lockfile.go @@ -0,0 +1,82 @@ +package lockfile + +import ( + "encoding/json" + "errors" + "os" + "path/filepath" +) + +// Info 是界面连接前读取的内容。 +type Info struct { + Addr string `json:"addr"` + Token string `json:"token"` + PID int `json:"pid"` +} + +// File 独占本机地址文件,避免同时跑两个被控。 +type File struct { + f *os.File + path string +} + +// ErrBusy 表示已经有一个被控进程持有文件。 +var ErrBusy = errors.New("已经有一个被控在运行") + +// Acquire 创建或打开文件并独占。失败时调用方应退出。 +func Acquire(path string) (*File, error) { + if err := os.MkdirAll(filepath.Dir(path), 0o700); err != nil { + return nil, err + } + f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0o600) + if err != nil { + return nil, err + } + if err := lockExclusive(f); err != nil { + _ = f.Close() + return nil, err + } + ownOnly(path) + return &File{f: f, path: path}, nil +} + +// Publish 写入地址、令牌和进程号。锁继续由本进程持有。 +func (f *File) Publish(addr, token string, pid int) error { + b, err := json.Marshal(Info{Addr: addr, Token: token, PID: pid}) + if err != nil { + return err + } + if _, err := f.f.WriteAt(b, 0); err != nil { + return err + } + if err := f.f.Truncate(int64(len(b))); err != nil { + return err + } + return f.f.Sync() +} + +// Close 释放独占。 +func (f *File) Close() error { + unlock(f.f) + return f.f.Close() +} + +// Read 读取地址文件。进程是否仍在由调用方另行判断。 +func Read(path string) (Info, error) { + b, err := os.ReadFile(path) + if err != nil { + return Info{}, err + } + var info Info + if err := json.Unmarshal(trimSpace(b), &info); err != nil { + return Info{}, err + } + return info, nil +} + +func trimSpace(b []byte) []byte { + for len(b) > 0 && (b[len(b)-1] == ' ' || b[len(b)-1] == '\n' || b[len(b)-1] == '\r' || b[len(b)-1] == '\t' || b[len(b)-1] == 0) { + b = b[:len(b)-1] + } + return b +} diff --git a/agent/internal/lockfile/lockfile_test.go b/agent/internal/lockfile/lockfile_test.go new file mode 100644 index 0000000..b3478e5 --- /dev/null +++ b/agent/internal/lockfile/lockfile_test.go @@ -0,0 +1,30 @@ +package lockfile + +import ( + "errors" + "path/filepath" + "testing" +) + +func TestExclusiveAndReadable(t *testing.T) { + path := filepath.Join(t.TempDir(), "agent.json") + a, err := Acquire(path) + if err != nil { + t.Fatal(err) + } + defer a.Close() + if err := a.Publish("127.0.0.1:1", "tok", 42); err != nil { + t.Fatal(err) + } + _, err = Acquire(path) + if !errors.Is(err, ErrBusy) { + t.Fatalf("second acquire: %v", err) + } + info, err := Read(path) + if err != nil { + t.Fatal(err) + } + if info.Addr != "127.0.0.1:1" || info.Token != "tok" || info.PID != 42 { + t.Fatalf("%+v", info) + } +} diff --git a/agent/internal/paths/paths.go b/agent/internal/paths/paths.go new file mode 100644 index 0000000..04ea323 --- /dev/null +++ b/agent/internal/paths/paths.go @@ -0,0 +1,33 @@ +package paths + +import ( + "os" + "path/filepath" + "runtime" +) + +// Dir 是当前用户的本机数据目录。测试可设置 TAPREMLY_HOME。 +func Dir() (string, error) { + if d := os.Getenv("TAPREMLY_HOME"); d != "" { + return d, nil + } + if runtime.GOOS == "windows" { + local := os.Getenv("LOCALAPPDATA") + if local == "" { + home, err := os.UserHomeDir() + if err != nil { + return "", err + } + local = filepath.Join(home, "AppData", "Local") + } + return filepath.Join(local, "TapRemly"), nil + } + if x := os.Getenv("XDG_DATA_HOME"); x != "" { + return filepath.Join(x, "tapremly"), nil + } + home, err := os.UserHomeDir() + if err != nil { + return "", err + } + return filepath.Join(home, ".local", "share", "tapremly"), nil +} diff --git a/agent/internal/protocol/protocol.go b/agent/internal/protocol/protocol.go new file mode 100644 index 0000000..9b900e5 --- /dev/null +++ b/agent/internal/protocol/protocol.go @@ -0,0 +1,157 @@ +// Package protocol 是设备之间的消息正文。定时和离线保留不写进正文。 +package protocol + +import "encoding/json" + +const Version = 1 + +const ( + TypeShell = "shell" + TypeShortcut = "shortcut" + TypeText = "text" + TypeShortcuts = "shortcuts" + TypeShortcutsGet = "shortcuts_get" + TypeResult = "result" + TypeLogs = "logs" + TypeLogsGet = "logs_get" +) + +const ErrNotTrusted = "not_trusted" + +// Shortcut 是一条快捷命令。 +type Shortcut struct { + ID string `json:"id"` + Name string `json:"name"` + Shell string `json:"shell"` + Confirm bool `json:"confirm"` +} + +// Log 是一条执行记录。 +type Log struct { + At string `json:"at"` + Summary string `json:"summary"` + OK bool `json:"ok"` + Detail string `json:"detail"` +} + +// Message 是收到的正文。不认识的字段忽略。 +type Message struct { + V int `json:"v"` + Type string `json:"type"` + ID string `json:"id"` + Shell string `json:"shell"` + ShortcutID string `json:"shortcut_id"` + Text string `json:"text"` + Items []Shortcut `json:"items"` + Logs []Log `json:"items_logs"` + OK *bool `json:"ok"` + Error string `json:"error"` + Duplicate bool `json:"duplicate"` +} + +// Parse 解析正文。logs 与 shortcuts 都使用 items,由类型区分。 +func Parse(data string) (Message, error) { + var m Message + if err := json.Unmarshal([]byte(data), &m); err != nil { + return Message{}, err + } + if m.Type == TypeLogs { + var wrap struct { + Items []Log `json:"items"` + } + if err := json.Unmarshal([]byte(data), &wrap); err != nil { + return Message{}, err + } + m.Logs = wrap.Items + } + return m, nil +} + +// ResultBody 编码执行结果。 +func ResultBody(id string, ok bool, errText string, duplicate bool) ([]byte, error) { + r := struct { + V int `json:"v"` + Type string `json:"type"` + ID string `json:"id"` + OK bool `json:"ok"` + Error string `json:"error,omitempty"` + Duplicate bool `json:"duplicate,omitempty"` + }{V: Version, Type: TypeResult, ID: id, OK: ok, Error: errText, Duplicate: duplicate} + return json.Marshal(r) +} + +// ShellBody 编码临时命令或本端快捷命令。 +func ShellBody(id, shell string) ([]byte, error) { + return json.Marshal(struct { + V int `json:"v"` + Type string `json:"type"` + ID string `json:"id"` + Shell string `json:"shell"` + }{Version, TypeShell, id, shell}) +} + +// ShortcutBody 编码执行远端快捷命令的请求。 +func ShortcutBody(id, shortcutID string) ([]byte, error) { + return json.Marshal(struct { + V int `json:"v"` + Type string `json:"type"` + ID string `json:"id"` + ShortcutID string `json:"shortcut_id"` + }{Version, TypeShortcut, id, shortcutID}) +} + +// TextBody 编码文字。 +func TextBody(id, text string) ([]byte, error) { + return json.Marshal(struct { + V int `json:"v"` + Type string `json:"type"` + ID string `json:"id"` + Text string `json:"text"` + }{Version, TypeText, id, text}) +} + +// ShortcutsBody 编码快捷命令列表。id 用来对应一次拉取。 +func ShortcutsBody(id string, items []Shortcut) ([]byte, error) { + if items == nil { + items = []Shortcut{} + } + return json.Marshal(struct { + V int `json:"v"` + Type string `json:"type"` + ID string `json:"id,omitempty"` + Items []Shortcut `json:"items"` + }{Version, TypeShortcuts, id, items}) +} + +// ShortcutsGetBody 向远端要它发布的快捷命令。 +func ShortcutsGetBody(id string) ([]byte, error) { + return json.Marshal(struct { + V int `json:"v"` + Type string `json:"type"` + ID string `json:"id"` + }{Version, TypeShortcutsGet, id}) +} + +// LogsGetBody 向在线的对方要本地长日志。 +func LogsGetBody(id string) ([]byte, error) { + return json.Marshal(struct { + V int `json:"v"` + Type string `json:"type"` + ID string `json:"id"` + }{Version, TypeLogsGet, id}) +} + +// LogsBody 编码日志列表。 +func LogsBody(id string, ok bool, errText string, items []Log) ([]byte, error) { + if items == nil { + items = []Log{} + } + return json.Marshal(struct { + V int `json:"v"` + Type string `json:"type"` + ID string `json:"id,omitempty"` + OK bool `json:"ok"` + Error string `json:"error,omitempty"` + Items []Log `json:"items"` + }{Version, TypeLogs, id, ok, errText, items}) +} diff --git a/agent/internal/shell/hide_other.go b/agent/internal/shell/hide_other.go new file mode 100644 index 0000000..d28952f --- /dev/null +++ b/agent/internal/shell/hide_other.go @@ -0,0 +1,7 @@ +//go:build !windows + +package shell + +import "os/exec" + +func hide(cmd *exec.Cmd) {} diff --git a/agent/internal/shell/hide_windows.go b/agent/internal/shell/hide_windows.go new file mode 100644 index 0000000..123d8ed --- /dev/null +++ b/agent/internal/shell/hide_windows.go @@ -0,0 +1,15 @@ +//go:build windows + +package shell + +import ( + "os/exec" + "syscall" +) + +func hide(cmd *exec.Cmd) { + cmd.SysProcAttr = &syscall.SysProcAttr{ + HideWindow: true, + CreationFlags: 0x08000000, // CREATE_NO_WINDOW + } +} diff --git a/agent/internal/shell/shell.go b/agent/internal/shell/shell.go new file mode 100644 index 0000000..6aaa27f --- /dev/null +++ b/agent/internal/shell/shell.go @@ -0,0 +1,115 @@ +package shell + +import ( + "bytes" + "context" + "errors" + "os/exec" + "runtime" + "strings" + "time" + "unicode/utf8" +) + +// Runner 执行一段 shell。测试注入假实现。 +type Runner interface { + Run(ctx context.Context, script string) (output string, err error) +} + +// Interpreter 返回当前系统的解释器和参数。 +// Windows 用 cmd.exe /c,macOS 和 Linux 用 /bin/sh -c。 +func Interpreter(script string) (name string, args []string) { + if runtime.GOOS == "windows" { + return "cmd.exe", []string{"/c", script} + } + return "/bin/sh", []string{"-c", script} +} + +// System 在当前登录用户的权限下执行。 +type System struct { + Timeout time.Duration +} + +func (s System) Run(ctx context.Context, script string) (string, error) { + timeout := s.Timeout + if timeout <= 0 { + timeout = 45 * time.Second + } + cctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + name, args := Interpreter(script) + cmd := exec.CommandContext(cctx, name, args...) + hide(cmd) + var buf limited + cmd.Stdout = &buf + cmd.Stderr = &buf + err := cmd.Run() + out := strings.TrimSpace(buf.String()) + if cctx.Err() == context.DeadlineExceeded { + return out, context.DeadlineExceeded + } + return out, err +} + +// Summarize 把执行结果收成一句短话,不把系统内部错误原样抛出。 +func Summarize(output string, err error) (ok bool, detail string) { + line := firstLine(output) + if err == nil { + if line == "" { + return true, "已完成" + } + return true, clip(line, 120) + } + if errors.Is(err, context.DeadlineExceeded) { + return false, "执行超时" + } + if line != "" { + return false, clip(line, 120) + } + return false, "没有成功" +} + +func firstLine(s string) string { + s = strings.TrimSpace(s) + if s == "" { + return "" + } + if i := strings.IndexAny(s, "\r\n"); i >= 0 { + s = s[:i] + } + return strings.TrimSpace(s) +} + +func clip(s string, n int) string { + if utf8.RuneCountInString(s) <= n { + return s + } + r := []rune(s) + return string(r[:n]) + "…" +} + +// Summary 是日志里的命令摘要。 +func Summary(script string) string { + s := firstLine(script) + return clip(s, 80) +} + +type limited struct { + buf bytes.Buffer +} + +func (l *limited) Write(p []byte) (int, error) { + const max = 8192 + n := len(p) + if l.buf.Len() >= max { + return n, nil + } + room := max - l.buf.Len() + if len(p) > room { + p = p[:room] + } + _, _ = l.buf.Write(p) + return n, nil +} + +func (l *limited) String() string { return l.buf.String() } diff --git a/agent/internal/shell/shell_test.go b/agent/internal/shell/shell_test.go new file mode 100644 index 0000000..7067578 --- /dev/null +++ b/agent/internal/shell/shell_test.go @@ -0,0 +1,42 @@ +package shell + +import ( + "context" + "runtime" + "strings" + "testing" + "time" +) + +func TestInterpreter(t *testing.T) { + name, args := Interpreter("echo hi") + if runtime.GOOS == "windows" { + if name != "cmd.exe" || len(args) != 2 || args[0] != "/c" || args[1] != "echo hi" { + t.Fatalf("windows interpreter: %s %v", name, args) + } + return + } + if name != "/bin/sh" || len(args) != 2 || args[0] != "-c" || args[1] != "echo hi" { + t.Fatalf("unix interpreter: %s %v", name, args) + } +} + +func TestSystemEcho(t *testing.T) { + out, err := (System{Timeout: 5 * time.Second}).Run(context.Background(), "echo tapremly-ok") + if err != nil { + t.Fatal(err) + } + if !strings.Contains(out, "tapremly-ok") { + t.Fatalf("output %q", out) + } +} +func TestSummarize(t *testing.T) { + ok, detail := Summarize("hello\r\nworld", nil) + if !ok || detail != "hello" { + t.Fatalf("got %v %q", ok, detail) + } + ok, detail = Summarize("", context.DeadlineExceeded) + if ok || detail != "执行超时" { + t.Fatalf("got %v %q", ok, detail) + } +} diff --git a/agent/internal/store/store.go b/agent/internal/store/store.go new file mode 100644 index 0000000..bff7eac --- /dev/null +++ b/agent/internal/store/store.go @@ -0,0 +1,279 @@ +package store + +import ( + "encoding/json" + "os" + "path/filepath" + "sync" + "time" + + "git.asio.asia/TapRemly/desktop/agent/internal/protocol" +) + +const ( + maxLogs = 500 + maxInbox = 200 + maxResults = 200 +) + +// Executed 记住一条命令的第一次结果。 +type Executed struct { + ID string `json:"id"` + At time.Time `json:"at"` + OK bool `json:"ok"` + Error string `json:"error,omitempty"` + Detail string `json:"detail,omitempty"` + Raw json.RawMessage `json:"raw,omitempty"` +} + +// LocalShortcut 是针对某一台远端的本端快捷命令。 +type LocalShortcut struct { + protocol.Shortcut + RemoteID string `json:"remote_id"` +} + +// RemoteCache 是某台远端上次同步来的快捷命令。 +type RemoteCache struct { + Items []protocol.Shortcut `json:"items"` + SyncedAt time.Time `json:"synced_at"` + Syncing bool `json:"syncing"` + ReqID string `json:"req_id,omitempty"` +} + +// LogCache 是向对方要来的长日志。 +type LogCache struct { + Items []protocol.Log `json:"items"` + SyncedAt time.Time `json:"synced_at"` + Syncing bool `json:"syncing"` + ReqID string `json:"req_id,omitempty"` + Error string `json:"error,omitempty"` +} + +// TextMsg 是收到的文字。 +type TextMsg struct { + ID string `json:"id"` + From string `json:"from"` + Text string `json:"text"` + At time.Time `json:"at"` + Read bool `json:"read"` +} + +// CmdResult 是我们发出的命令收到的结果。 +type CmdResult struct { + ID string `json:"id"` + Remote string `json:"remote"` + OK bool `json:"ok"` + Error string `json:"error,omitempty"` + Duplicate bool `json:"duplicate,omitempty"` + At time.Time `json:"at"` +} + +// Cookie 是账号会话里需要记住的一块。 +type Cookie struct { + Name string `json:"name"` + Value string `json:"value"` + Domain string `json:"domain"` + Path string `json:"path"` + Expires time.Time `json:"expires"` + Secure bool `json:"secure"` + HttpOnly bool `json:"http_only"` +} + +// Data 是落在本机的全部状态。令牌只在这个文件里,不进界面存储。 +type Data struct { + ServerURL string `json:"server_url"` + NixURL string `json:"nixmsg_url"` + EndpointID string `json:"endpoint_id"` + SessionToken string `json:"session_token,omitempty"` + DeviceToken string `json:"device_token,omitempty"` + AccountUser string `json:"account_user,omitempty"` + Cookies []Cookie `json:"cookies,omitempty"` + Trust []string `json:"trust"` + PendingSecret string `json:"pending_secret,omitempty"` + Local []LocalShortcut `json:"local_shortcuts"` + Published []protocol.Shortcut `json:"published"` + Remote map[string]RemoteCache `json:"remote_shortcuts"` + RemoteLogs map[string]LogCache `json:"remote_logs"` + Executed []Executed `json:"executed"` + Logs []protocol.Log `json:"logs"` + Inbox []TextMsg `json:"inbox"` + Results []CmdResult `json:"results"` +} + +// Store 用一个 JSON 文件保存状态。 +type Store struct { + mu sync.Mutex + path string + data Data +} + +func New(dir string) (*Store, error) { + if err := os.MkdirAll(dir, 0o700); err != nil { + return nil, err + } + s := &Store{path: filepath.Join(dir, "state.json")} + s.data = defaultData() + b, err := os.ReadFile(s.path) + if err != nil { + if os.IsNotExist(err) { + return s, s.saveLocked() + } + return nil, err + } + if len(b) > 0 { + if err := json.Unmarshal(b, &s.data); err != nil { + return nil, err + } + } + s.normalize() + return s, nil +} + +func defaultData() Data { + return Data{ + ServerURL: "http://127.0.0.1:8080", + NixURL: "ws://127.0.0.1:7443/mqtt", + Trust: []string{}, + Local: []LocalShortcut{}, + Published: []protocol.Shortcut{}, + Remote: map[string]RemoteCache{}, + RemoteLogs: map[string]LogCache{}, + Executed: []Executed{}, + Logs: []protocol.Log{}, + Inbox: []TextMsg{}, + Results: []CmdResult{}, + } +} + +func (d Data) clone() Data { + n := d + n.Trust = append([]string(nil), d.Trust...) + n.Cookies = append([]Cookie(nil), d.Cookies...) + n.Local = append([]LocalShortcut(nil), d.Local...) + n.Published = append([]protocol.Shortcut(nil), d.Published...) + n.Executed = append([]Executed(nil), d.Executed...) + n.Logs = append([]protocol.Log(nil), d.Logs...) + n.Inbox = append([]TextMsg(nil), d.Inbox...) + n.Results = append([]CmdResult(nil), d.Results...) + n.Remote = map[string]RemoteCache{} + for k, v := range d.Remote { + v.Items = append([]protocol.Shortcut(nil), v.Items...) + n.Remote[k] = v + } + n.RemoteLogs = map[string]LogCache{} + for k, v := range d.RemoteLogs { + v.Items = append([]protocol.Log(nil), v.Items...) + n.RemoteLogs[k] = v + } + return n +} + +func (d *Data) normalize() { + if d.ServerURL == "" { + d.ServerURL = "http://127.0.0.1:8080" + } + if d.NixURL == "" { + d.NixURL = "ws://127.0.0.1:7443/mqtt" + } + if d.Trust == nil { + d.Trust = []string{} + } + if d.Local == nil { + d.Local = []LocalShortcut{} + } + if d.Published == nil { + d.Published = []protocol.Shortcut{} + } + if d.Remote == nil { + d.Remote = map[string]RemoteCache{} + } + if d.RemoteLogs == nil { + d.RemoteLogs = map[string]LogCache{} + } + if d.Executed == nil { + d.Executed = []Executed{} + } + if d.Logs == nil { + d.Logs = []protocol.Log{} + } + if d.Inbox == nil { + d.Inbox = []TextMsg{} + } + if d.Results == nil { + d.Results = []CmdResult{} + } +} + +func (s *Store) normalize() { + s.data.normalize() +} + +// Update 在副本上修改,成功后才替换并保存。回调里不能再调用 Store。 +func (s *Store) Update(fn func(*Data) error) error { + s.mu.Lock() + defer s.mu.Unlock() + next := s.data.clone() + if err := fn(&next); err != nil { + return err + } + next.normalize() + s.data = next + return s.saveLocked() +} + +// View 在锁内只读。回调里复制需要带走的数据。 +func (s *Store) View(fn func(*Data)) { + s.mu.Lock() + defer s.mu.Unlock() + s.normalize() + fn(&s.data) +} + +func (s *Store) saveLocked() error { + s.normalize() + b, err := json.MarshalIndent(s.data, "", " ") + if err != nil { + return err + } + tmp := s.path + ".tmp" + if err := os.WriteFile(tmp, b, 0o600); err != nil { + return err + } + if err := os.Rename(tmp, s.path); err != nil { + _ = os.Remove(s.path) + if err2 := os.Rename(tmp, s.path); err2 != nil { + return err2 + } + } + return nil +} + +// AppendLog 保留最近 500 条,返回最近 20 条供上传。 +func AppendLog(d *Data, item protocol.Log) []protocol.Log { + d.Logs = append(d.Logs, item) + if len(d.Logs) > maxLogs { + d.Logs = append([]protocol.Log(nil), d.Logs[len(d.Logs)-maxLogs:]...) + } + return LastLogs(d.Logs, 20) +} + +// LastLogs 取末尾 n 条。 +func LastLogs(items []protocol.Log, n int) []protocol.Log { + if len(items) <= n { + out := append([]protocol.Log(nil), items...) + return out + } + return append([]protocol.Log(nil), items[len(items)-n:]...) +} + +// TrimExecuted 丢掉早于保留窗口的记录。 +func TrimExecuted(d *Data, now time.Time, keep time.Duration) { + cut := now.Add(-keep) + out := d.Executed[:0] + for _, e := range d.Executed { + if e.At.After(cut) { + out = append(out, e) + } + } + d.Executed = out +} diff --git a/ui/env.d.ts b/ui/env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/ui/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/ui/index.html b/ui/index.html new file mode 100644 index 0000000..984db42 --- /dev/null +++ b/ui/index.html @@ -0,0 +1,12 @@ + + + + + + TapRemly + + +
+ + + diff --git a/ui/package.json b/ui/package.json new file mode 100644 index 0000000..99baae6 --- /dev/null +++ b/ui/package.json @@ -0,0 +1,26 @@ +{ + "name": "tapremly", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vue-tsc --noEmit && vite build", + "tauri": "tauri" + }, + "dependencies": { + "@tauri-apps/api": "^2.8.0", + "naive-ui": "^2.42.0", + "pinia": "^3.0.3", + "vue": "^3.5.22", + "vue-router": "^4.5.1" + }, + "devDependencies": { + "@tauri-apps/cli": "^2.8.0", + "@types/node": "^24.5.2", + "@vitejs/plugin-vue": "^6.0.1", + "typescript": "~5.9.2", + "vite": "^7.1.5", + "vue-tsc": "^3.0.7" + } +} diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml new file mode 100644 index 0000000..313a4e7 --- /dev/null +++ b/ui/pnpm-lock.yaml @@ -0,0 +1,1362 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@tauri-apps/api': + specifier: ^2.8.0 + version: 2.12.3 + naive-ui: + specifier: ^2.42.0 + version: 2.45.3(vue@3.5.43(typescript@5.9.3)) + pinia: + specifier: ^3.0.3 + version: 3.0.4(typescript@5.9.3)(vue@3.5.43(typescript@5.9.3)) + vue: + specifier: ^3.5.22 + version: 3.5.43(typescript@5.9.3) + vue-router: + specifier: ^4.5.1 + version: 4.6.4(vue@3.5.43(typescript@5.9.3)) + devDependencies: + '@tauri-apps/cli': + specifier: ^2.8.0 + version: 2.12.2 + '@types/node': + specifier: ^24.5.2 + version: 24.19.2 + '@vitejs/plugin-vue': + specifier: ^6.0.1 + version: 6.0.10(vite@7.3.7(@types/node@24.19.2))(vue@3.5.43(typescript@5.9.3)) + typescript: + specifier: ~5.9.2 + version: 5.9.3 + vite: + specifier: ^7.1.5 + version: 7.3.7(@types/node@24.19.2) + vue-tsc: + specifier: ^3.0.7 + version: 3.3.13(typescript@5.9.3) + +packages: + + '@babel/helper-string-parser@7.29.7': + resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.29.7': + resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.29.9': + resolution: {integrity: sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/types@7.29.8': + resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==} + engines: {node: '>=6.9.0'} + + '@css-render/plugin-bem@0.15.14': + resolution: {integrity: sha512-QK513CJ7yEQxm/P3EwsI+d+ha8kSOcjGvD6SevM41neEMxdULE+18iuQK6tEChAWMOQNQPLG/Rw3Khb69r5neg==} + peerDependencies: + css-render: ~0.15.14 + + '@css-render/vue3-ssr@0.15.14': + resolution: {integrity: sha512-//8027GSbxE9n3QlD73xFY6z4ZbHbvrOVB7AO6hsmrEzGbg+h2A09HboUyDgu+xsmj7JnvJD39Irt+2D0+iV8g==} + peerDependencies: + vue: ^3.0.11 + + '@emotion/hash@0.8.0': + resolution: {integrity: sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==} + + '@esbuild/aix-ppc64@0.28.2': + resolution: {integrity: sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.28.2': + resolution: {integrity: sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.28.2': + resolution: {integrity: sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.28.2': + resolution: {integrity: sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.28.2': + resolution: {integrity: sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.28.2': + resolution: {integrity: sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.28.2': + resolution: {integrity: sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.28.2': + resolution: {integrity: sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.28.2': + resolution: {integrity: sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.28.2': + resolution: {integrity: sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.28.2': + resolution: {integrity: sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.28.2': + resolution: {integrity: sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.28.2': + resolution: {integrity: sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.28.2': + resolution: {integrity: sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.28.2': + resolution: {integrity: sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.28.2': + resolution: {integrity: sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.28.2': + resolution: {integrity: sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.28.2': + resolution: {integrity: sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.28.2': + resolution: {integrity: sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.28.2': + resolution: {integrity: sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.28.2': + resolution: {integrity: sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.28.2': + resolution: {integrity: sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.28.2': + resolution: {integrity: sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.28.2': + resolution: {integrity: sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.28.2': + resolution: {integrity: sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.28.2': + resolution: {integrity: sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@juggle/resize-observer@3.4.0': + resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} + + '@napi-rs/lzma-linux-x64-gnu@1.5.1': + resolution: {integrity: sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==} + engines: {node: ^22.20 || ^24.12 || >=25} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/pluginutils@1.0.1': + resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} + + '@rollup/rollup-android-arm-eabi@4.64.5': + resolution: {integrity: sha512-MrfgRQSpD5hkkRg6XI16B6EDLb+6+xp8xje6bpdSwkYw+qxrBKbUVrRAQu9h82UT+QumSIVQ8HXsXjPd2dlhqw==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.64.5': + resolution: {integrity: sha512-+uu2p/R9Tzn8GpoQyX1pAo5dmKT1DhXevfaCzqzmPFhnLjHLWw7uWkaVGlxmhwYoRiYYhsGfRcD5cTBpL7rgSw==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.64.5': + resolution: {integrity: sha512-17dys+YEmzwzzFVHQAVDONg5FALXY9kd99HFEpfk4gJVHYxoh5bGea3D4t1fXXnwkTcOe25wPyd6nWS0I8IdLQ==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.64.5': + resolution: {integrity: sha512-wg0zQEKkEvFZf1UaaX1UELOoPs//OSKUG7D+yITuqOsAvza7LvHTv5Wu4nmMfzNG7EYI2jp2PJC7Id6OETmsYQ==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.64.5': + resolution: {integrity: sha512-CoJmWcpEMuwin+TZ/ev/H9uDyF/uxUKQSWXdmIPn/UBx/uGV9+4ebMp0FwnlhWR9PE1AdzYsKf3bZevhif38+A==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.64.5': + resolution: {integrity: sha512-PxZnLAaTUAL5xG0W2BXLeYPKrK2b3LIASV2/e/Kf7PZvSLI1iAQIm9B9aJD+YyFIT7hc6qaMV3+OOO35R28LfA==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.64.5': + resolution: {integrity: sha512-uPo3IvnONjhbFXwWgroBeFwOicuhT7ZwQrnzkzmOtBJzeQbkUJUE1SJDfDI31ijQ5+ZUIA6sPrdUMxTSnxUWAg==} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm-musleabihf@4.64.5': + resolution: {integrity: sha512-ywI8Jyuc4LyHYTjC0mw4yA1ulvZBkHusdpWnoiEBsmBuHvSnt90btTBGCZ+s/2y+YNNfVAEKy33nPo5UI9zTmg==} + cpu: [arm] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-arm64-gnu@4.64.5': + resolution: {integrity: sha512-tmuXJoQ/3ovSr637aykZMdQteU/CB2APAz2CrvsbibuoHZi1BS1Db13cVViBdEARGwXCLn1DSJ8wsjoThLJPGA==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm64-musl@4.64.5': + resolution: {integrity: sha512-5FMjSYNcUOHx7oW8Qu9KB6jGPpvF/8sG7+BDHwU/Ihh1/6FMJ9ySmsFG4tJ1qbNRuP8OLzCBDso4sF0mQaLuFQ==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-loong64-gnu@4.64.5': + resolution: {integrity: sha512-K8ZJ+neLDbUkIrL8dqF/5LtuVCrKwo27kREgOlxjBEjlOXwHvDnHLU8Z/UKv/B49qi7e8hsSDOyoJwhwqhvX4w==} + cpu: [loong64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-loong64-musl@4.64.5': + resolution: {integrity: sha512-NlVxsq7PFPv0DBKGuNWRDKixQYQCjM53zl04mxEcKMBmJbCBIUm1JdPfIWDRHyOOFzzYPmLQzfeEwh4716ayQg==} + cpu: [loong64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-ppc64-gnu@4.64.5': + resolution: {integrity: sha512-ARhRHJYs5eCFet5azfrHD97vOkD8OzNW2RSMlvo5CcBqXaTOLfp0OHDtUQh7/K5AL5fUYoFp2fgC9KDg4vVYMQ==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-ppc64-musl@4.64.5': + resolution: {integrity: sha512-atSgreM5C7jpxd9aEXN+6vJ5wTd05iYw+S3FiQpw7VsoEl8B90llbq35ARON+GOHj5QlVQEq2vOKWCHTob/BSQ==} + cpu: [ppc64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-riscv64-gnu@4.64.5': + resolution: {integrity: sha512-vmlmwBFGnjVWxSRoVabNkyYuscSmg52Pd0fM8jEbNT3Jmka4A6HcB84x4uAmuumznWfBVaxKOqU6jbEgomWKCA==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-riscv64-musl@4.64.5': + resolution: {integrity: sha512-hhJrP6S9WkbsbcHgUkvCBS5Cn8IdsG8XjlLZyxjnv9+NdoYfbbZE4TWJYr8apdaj1M5t5Y1id2StnEslxpNFyA==} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-s390x-gnu@4.64.5': + resolution: {integrity: sha512-NNVCyN9pGrwFmQa4bf+Cnf5aVH3g6ZpnlOg1Cs/H9swIHT9bRixijfzUqyEIWm1WtiAuR1LJ+rJH6zpBm8kgQA==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-gnu@4.64.5': + resolution: {integrity: sha512-dR9nd6OKnvSS60Ifz/L7Mj5zzYyoqyRn2NwTuaOONKaa3xsVGXyp8YusMbvFyEOR94DxnwgcbgsFqkHd29ZSzQ==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-musl@4.64.5': + resolution: {integrity: sha512-1tzsMjaqhsh3bAO6SJiJqh8hIr9sSPRd+i2vPPxJHod8/XYnf9TEnK0z/u3r1z1AkI347X0KbRSg9dWcxeGahw==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rollup/rollup-openbsd-x64@4.64.5': + resolution: {integrity: sha512-01mWMQblKoXXsmk28KXtpbA96w7g/aOWUoV3AC16fdHdqkykGalqyyM+5u8M7uP5/MEMiiPv69Hv7iv/hEH/dA==} + cpu: [x64] + os: [openbsd] + + '@rollup/rollup-openharmony-arm64@4.64.5': + resolution: {integrity: sha512-trdnMPb/DNm4V/CgsaoGgr90HfQQ071wfK0KoIs4YpLvjBgVQGXhGabg2Z6nK4EcYNilrb9ZZPcsP6+zpJIdxQ==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.64.5': + resolution: {integrity: sha512-x2LxZlfdfsw99T6/qb9EqE/Qi84JWzibjyOJyhJsgFJy6CafaTiqIXCCnslCGrV5XWNh7fwrS3FbRENcuKnooA==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.64.5': + resolution: {integrity: sha512-/Qd/9aDQIo0+jmItgBmPIs8195YVbDxRRApn47GyufgbutCDOh7eP5vSKKlI4QNFeaI+wKQAkSMsPnF3EuMpaA==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.64.5': + resolution: {integrity: sha512-ngUJ/XvOWrqbd2IMsfXfh2xXFLTP3sY7sCKvxbGvYdBZ1KmXFd3ewDZ9n3/GNzAUgzRuhLT/UvJRivbNoAQRBw==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.64.5': + resolution: {integrity: sha512-IhV6ew/DuzUWwHaYmlh7MrPCV3lKFUq/amTEwysi4r/mwNPAEfAMh5dYWeTSPTeMy2pFHGMEWYtPkHzfX3tG5A==} + cpu: [x64] + os: [win32] + + '@tauri-apps/api@2.12.3': + resolution: {integrity: sha512-9s0PKw0p4r3kFq92jhpivYSp+cSht15o0gXpZxuQd0+dV9KCexEVkNaLELVoLdJWyoH4KlfQo5h3W2LIM8siJg==} + + '@tauri-apps/cli-darwin-arm64@2.12.2': + resolution: {integrity: sha512-Lk3zaBTfzNvA7670Al5PNgo2M/95uaDPe1yp+ILJeDOmol87XiYuK5E5+FUbK5e6U6OORx9qpZdOo2U+5tETtQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@tauri-apps/cli-darwin-x64@2.12.2': + resolution: {integrity: sha512-2CyYjJ833JB3sKRz4B0W/Tv4oOVC16ws1bxdSCWj1XvrmanWwvZi99e5tNIoCHwHhcOm0jh+sh0PCGQyls6Z+w==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@tauri-apps/cli-linux-arm-gnueabihf@2.12.2': + resolution: {integrity: sha512-uvt2xbone4JftKarelssi86Kqnl7JiG1Smh5+Ae+nZmtM+JUhTGmqkcqfUPXRW8Ygwog92POZvd4oGDN9j8eXQ==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + + '@tauri-apps/cli-linux-arm64-gnu@2.12.2': + resolution: {integrity: sha512-DZlDJ24u3tlocKOYqzR+b2M+Qr+5WFcoMBZ7EfdhHN5j3ZXwBBpms4G4gyNvPCrak5vMzmdZ65ecBXPJcC+5sA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@tauri-apps/cli-linux-arm64-musl@2.12.2': + resolution: {integrity: sha512-pb+RTZUYH/p0gR4j4ecCCq+FNfz3W3eKuUQvVEBn7MQZx6DzfLO7FaYzt2NyDKWpdNN3lP10mdzOvw3R5P5aAQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@tauri-apps/cli-linux-riscv64-gnu@2.12.2': + resolution: {integrity: sha512-nidEvDUJyHYNbIv9MUk6KiEix8IXfRh4Wj2G2SA5g8nFmgbBCwazUNWYiG/LhNeNbfZpBMLerRBUtoQ5K0GidA==} + engines: {node: '>= 10'} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@tauri-apps/cli-linux-x64-gnu@2.12.2': + resolution: {integrity: sha512-gkXyYn3w+Xfc8nz/DleEbkm1M7bBuU2cejqUXNmI98cA2P5kp+oPmS4ALTorb1FaNWjpsKoYZBWsbS9BXxYFkQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@tauri-apps/cli-linux-x64-musl@2.12.2': + resolution: {integrity: sha512-MrjgoZ09s8Hsn99XvxSNvK8NQTZxi7XiyK3FxxytzfHgz2jb3qUT69CZtsokRkN/zdi9rCgrMtq+w9XNICjcfQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@tauri-apps/cli-win32-arm64-msvc@2.12.2': + resolution: {integrity: sha512-BR+CYM7iF3lkfyTtVkwMQU/s9hwegLpj3UqDjaxKCPmixQCa1csBBPy3C75V+FhLtOjIXNna4Gt6Vm9oxbV+qA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@tauri-apps/cli-win32-ia32-msvc@2.12.2': + resolution: {integrity: sha512-zODJo9l3TbNBM+GrO/yPqGeELNMK5cjIc+QHh1WQc3l8tD+jDZGTQyYuAxViCsM6Uh5uWJ//RnCZG9LXrvsXww==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + + '@tauri-apps/cli-win32-x64-msvc@2.12.2': + resolution: {integrity: sha512-cQXI2ZaZmwBDt0XATCqASVanYizxkEE3ceQVlVHXaQ51HzsQUWA04c9Nz7LrrY2lgAu3jFMyat+8Yz3Z2R2qBA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@tauri-apps/cli@2.12.2': + resolution: {integrity: sha512-PMSppzAnlT+BvZtRKuidxjRSm2r5t8kDpJ/czmmQUa0AtDNTwrjLE8vApK3phCWGg7isfnYL46Dl1jB4ArI0hA==} + engines: {node: '>= 10'} + hasBin: true + + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + + '@types/lodash-es@4.17.12': + resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} + + '@types/lodash@4.17.26': + resolution: {integrity: sha512-48NWfiY6oNcKOh47Z4h+sIvwcQR91h6KPhaYKgeMIrkT2jV82Gy90SErj60vW8jQbeMSOSbhIv3bZ7JoqPPVhA==} + + '@types/node@24.19.2': + resolution: {integrity: sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==} + + '@vitejs/plugin-vue@6.0.10': + resolution: {integrity: sha512-b80aUQh3n+qEzzZm5oQp3rT2QImeCx58K6eFl/RkJ3d65KW0kTuv5lNsLRVAjbW9YRUpo/wzmvzMgV34bTAItA==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + vite: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 + vue: ^3.2.25 || ^3.6.0-rc.10 + + '@volar/language-core@2.4.28': + resolution: {integrity: sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ==} + + '@volar/source-map@2.4.28': + resolution: {integrity: sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ==} + + '@volar/typescript@2.4.28': + resolution: {integrity: sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@vue/compiler-core@3.5.43': + resolution: {integrity: sha512-zdiLhnbe1QQqgDT8xZMpNmyqZ3qlI+/Q/FHQco57Kwl/b05HhCzN6eVGN9QU9rbga4CrS0H5SYY8VGHZCt/1Hg==} + + '@vue/compiler-dom@3.5.43': + resolution: {integrity: sha512-PEZoAk3NQmsn/ejMzSOCyTYqwGqczrWm70PuhBKjjv1+TCoQAaO/zOqNwjV+honlNstT5ILxtc+8r8UUfj+iEQ==} + + '@vue/compiler-sfc@3.5.43': + resolution: {integrity: sha512-FCbrG3XNCRl+js3huuKx4IVHBLTvMkJhVepjbxSPu1gn4yWLaYtGNQdjJGZaMytXB6qb76qQDDmDSLy/vkmleQ==} + + '@vue/compiler-ssr@3.5.43': + resolution: {integrity: sha512-GF62orf7KiJX9RqrHNGrYBudsQGD0OhJ5nDs90O8UiDuS40+YMYomiXu6w6EuvtXuRDc3MSNis3EaaSKAVSWpg==} + + '@vue/devtools-api@6.6.4': + resolution: {integrity: sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==} + + '@vue/devtools-api@7.7.10': + resolution: {integrity: sha512-KxtEpUOOpFz/qOGRrAwA36QF7DqIA+FXgCYit9mk9wjbaZt0sXOFz81ElOZtKA4HbWHUdwNjZHBFsFFyp5BZiA==} + + '@vue/devtools-kit@7.7.10': + resolution: {integrity: sha512-3WNi2Kq4tbpVbmhml7RiphmAt0279oh3fKNeWMQIrltfX8Q91b4i5PL8DtyNKdwmcsGrV4fg+erwWOmD05CLIw==} + + '@vue/devtools-shared@7.7.10': + resolution: {integrity: sha512-wOPslzB8vTvpxwdaOcR2qAbwmuSP0L+rhpoC6Cf56V3Jip+HWb7PQQXOUPgBNQARpXsbQX/+mvi8kKucmBGRwQ==} + + '@vue/language-core@3.3.13': + resolution: {integrity: sha512-axA0Xemn5LuUKuKWob0/kVq7xQ2mJJM6VqA9Exvt35nM9yRC31goWVve/G/Zb2ZCLsXC8FHYjjfXlnshknSCew==} + + '@vue/reactivity@3.5.43': + resolution: {integrity: sha512-G/c9GyOZNI2jVaaS6OX1EF1SSFSv7H0ERqNTl4+DTFMlZmB5eVAB53aLQNam/7NL2NPtaDD7RdVrzf8uJzMuOA==} + + '@vue/runtime-core@3.5.43': + resolution: {integrity: sha512-hU6U6VnVhBGQDpvlnnDlIB8ZGJBiOcgk2lh/0InltHiz3D8oSkluvuvY+do1G2H3+udeKFsmaBlgVYP7gXQzEw==} + + '@vue/runtime-dom@3.5.43': + resolution: {integrity: sha512-Bb2Jc0YjjJdMt1SJmb9b2L/IWd3I8lIT9x9eS/xvvP9CiVgna0ffua74xKRmt4/uSJ+0r4iN8ex1jrqkhQGWQw==} + + '@vue/server-renderer@3.5.43': + resolution: {integrity: sha512-l2Ygjv9NehV94PSBxNWsAHC0j/eIIKbn92mBuWXAPGLnn6HfJ6MH5ubsd+Nk0YoZ5FRuxWI1P2VSoh+dbPQhCQ==} + + '@vue/shared@3.5.43': + resolution: {integrity: sha512-uksS7YGMR5NZyr4JNq0Rp+QyLns0ueaz20KwzIPW9R0LH1Vnt4E+XUM29PNseEbf1www2gOuhuDi5AKOIXag9Q==} + + alien-signals@3.2.1: + resolution: {integrity: sha512-I8FjmltrfnDFoZedi5CG8DghVYNhzb/Ijluz7tCSJH0xpd0484Kowhbb1XDYOxfJpU1p5wnM2X54dA+IfGyD1g==} + + async-validator@4.2.5: + resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==} + + birpc@2.9.0: + resolution: {integrity: sha512-KrayHS5pBi69Xi9JmvoqrIgYGDkD6mcSe/i6YKi3w5kekCLzrX4+nawcXqrj2tIp50Kw/mT/s3p+GVK0A0sKxw==} + + copy-anything@4.1.5: + resolution: {integrity: sha512-vePst2VLTSqPglW7Q98VwFpGiGpOHTyXIo81MO5VyLecA5zMbZw/P/V1vmwD1jksa2iJpn/YkDrJ3XhTfzUyhQ==} + engines: {node: '>=18'} + + css-render@0.15.14: + resolution: {integrity: sha512-9nF4PdUle+5ta4W5SyZdLCCmFd37uVimSjg1evcTqKJCyvCEEj12WKzOSBNak6r4im4J4iYXKH1OWpUV5LBYFg==} + + csstype@3.0.11: + resolution: {integrity: sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==} + + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + + date-fns-tz@3.2.0: + resolution: {integrity: sha512-sg8HqoTEulcbbbVXeg84u5UnlsQa8GS5QXMqjjYIhS4abEVVKIUwe0/l/UhrZdKaL/W5eWZNlbTeEIiOXTcsBQ==} + peerDependencies: + date-fns: ^3.0.0 || ^4.0.0 + + date-fns@4.4.0: + resolution: {integrity: sha512-+1UMbeh68lH1SegH83CGWwpb6OHHbpSgr3+s5Eww5M4CAgswBpoWS0AjTOfEJ33HiYKz1hdj/KTFprzXHmq/6w==} + + entities@7.0.1: + resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} + engines: {node: '>=0.12'} + + esbuild@0.28.2: + resolution: {integrity: sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==} + engines: {node: '>=18'} + hasBin: true + + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + + evtd@0.2.4: + resolution: {integrity: sha512-qaeGN5bx63s/AXgQo8gj6fBkxge+OoLddLniox5qtLAEY5HSnuSlISXVPxnSae1dWblvTh4/HoMIB+mbMsvZzw==} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + highlight.js@11.12.0: + resolution: {integrity: sha512-nbfWpyRMcMrPMmDwJB+dhX/eiaPKtc2RB+0QZskqJ3WjRA/FDS0e9hZrx8EC/lbEv8gXy98FcDbNa/dspAaJMg==} + engines: {node: '>=12.0.0'} + + hookable@5.5.3: + resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} + + lodash-es@4.18.1: + resolution: {integrity: sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==} + + lodash@4.18.1: + resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==} + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + mitt@3.0.1: + resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} + + muggle-string@0.4.1: + resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==} + + naive-ui@2.45.3: + resolution: {integrity: sha512-D83gJ+6zUdkQ5DuUbmlfyaM1t8pV5WMPa6KmL9mByqQuiL12qBdA0n/iEIth4dQw1x/duNGpOS2anpt5FKO1kw==} + engines: {node: '>=20'} + peerDependencies: + vue: ^3.0.0 + + nanoid@3.3.20: + resolution: {integrity: sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + + perfect-debounce@1.0.0: + resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + pinia@3.0.4: + resolution: {integrity: sha512-l7pqLUFTI/+ESXn6k3nu30ZIzW5E2WZF/LaHJEpoq6ElcLD+wduZoB2kBN19du6K/4FDpPMazY2wJr+IndBtQw==} + peerDependencies: + typescript: '>=4.5.0' + vue: ^3.5.11 + peerDependenciesMeta: + typescript: + optional: true + + postcss@8.5.29: + resolution: {integrity: sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==} + engines: {node: ^10 || ^12 || >=14} + + rfdc@1.4.1: + resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + + rollup@4.64.5: + resolution: {integrity: sha512-EAP5ZHcz2ijbgCWwPkpI7zh6bfsri2Ez5FtCy2dCp1k62duXzfG7DLGGh7RU2QQXWwavT+u4qpvDF/TWOiiGTw==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + seemly@0.3.10: + resolution: {integrity: sha512-2+SMxtG1PcsL0uyhkumlOU6Qo9TAQ/WyH7tthnPIOQB05/12jz9naq6GZ6iZ6ApVsO3rr2gsnTf3++OV63kE1Q==} + + source-map-js@1.2.2: + resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} + engines: {node: '>=0.10.0'} + + speakingurl@14.0.1: + resolution: {integrity: sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==} + engines: {node: '>=0.10.0'} + + superjson@2.2.6: + resolution: {integrity: sha512-H+ue8Zo4vJmV2nRjpx86P35lzwDT3nItnIsocgumgr0hHMQ+ZGq5vrERg9kJBo5AWGmxZDhzDo+WVIJqkB0cGA==} + engines: {node: '>=16'} + + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + + treemate@0.3.11: + resolution: {integrity: sha512-M8RGFoKtZ8dF+iwJfAJTOH/SM4KluKOKRJpjCMhI8bG3qB74zrFoArKZ62ll0Fr3mqkMJiQOmWYkdYgDeITYQg==} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@7.24.6: + resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==} + + vdirs@0.1.8: + resolution: {integrity: sha512-H9V1zGRLQZg9b+GdMk8MXDN2Lva0zx72MPahDKc30v+DtwKjfyOSXWRIX4t2mhDubM1H09gPhWeth/BJWPHGUw==} + peerDependencies: + vue: ^3.0.11 + + vite@7.3.7: + resolution: {integrity: sha512-AHEzTORMbi7/7aXp7w7KZ5+DCUdSeLsJz0grY8xHpc9DHdYb0vQu6DqJfm2tOw3gDExNgPgnJTXxM6syYFHaCA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + jiti: '>=1.21.0' + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vooks@0.2.12: + resolution: {integrity: sha512-iox0I3RZzxtKlcgYaStQYKEzWWGAduMmq+jS7OrNdQo1FgGfPMubGL3uGHOU9n97NIvfFDBGnpSvkWyb/NSn/Q==} + peerDependencies: + vue: ^3.0.0 + + vscode-uri@3.2.0: + resolution: {integrity: sha512-m2gXo3bn0G1kT9InzMf07fTbqMbGtyckj3bH5ktLO+1Ssv+yiATZ4dhwaQv9UZWxJh6E9IFGnQyjgWVDWVBDrg==} + + vue-router@4.6.4: + resolution: {integrity: sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==} + peerDependencies: + vue: ^3.5.0 + + vue-tsc@3.3.13: + resolution: {integrity: sha512-jE4/bXdOMSHVxEGgQCqNllJy+9N3Gx6tfSAsg0yhFK/MAN6eXqISihupnDEKSCt12VVnjN2gI3AqLYcqoh5x/A==} + hasBin: true + peerDependencies: + typescript: '>=5.0.0' + + vue@3.5.43: + resolution: {integrity: sha512-o5qZoksdnjIKvW1srZ3ab7pcDNYAerBjRe54D0LBLfRdCYFrSgBHVXokMas35czQc0//lmx4/tuY4ZNQ+Rf2Ng==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + vueuc@0.4.66: + resolution: {integrity: sha512-hHrZl+0AsrUvqYPBXSXQ2QaSrO3razjeUseLAhJWlOS/Hdfw/Y2MU05fOTP1qn1A3121gMxsHLaEz2V6CkWdTg==} + peerDependencies: + vue: ^3.0.11 + +snapshots: + + '@babel/helper-string-parser@7.29.7': {} + + '@babel/helper-validator-identifier@7.29.7': {} + + '@babel/parser@7.29.9': + dependencies: + '@babel/types': 7.29.8 + + '@babel/types@7.29.8': + dependencies: + '@babel/helper-string-parser': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + + '@css-render/plugin-bem@0.15.14(css-render@0.15.14)': + dependencies: + css-render: 0.15.14 + + '@css-render/vue3-ssr@0.15.14(vue@3.5.43(typescript@5.9.3))': + dependencies: + vue: 3.5.43(typescript@5.9.3) + + '@emotion/hash@0.8.0': {} + + '@esbuild/aix-ppc64@0.28.2': + optional: true + + '@esbuild/android-arm64@0.28.2': + optional: true + + '@esbuild/android-arm@0.28.2': + optional: true + + '@esbuild/android-x64@0.28.2': + optional: true + + '@esbuild/darwin-arm64@0.28.2': + optional: true + + '@esbuild/darwin-x64@0.28.2': + optional: true + + '@esbuild/freebsd-arm64@0.28.2': + optional: true + + '@esbuild/freebsd-x64@0.28.2': + optional: true + + '@esbuild/linux-arm64@0.28.2': + optional: true + + '@esbuild/linux-arm@0.28.2': + optional: true + + '@esbuild/linux-ia32@0.28.2': + optional: true + + '@esbuild/linux-loong64@0.28.2': + optional: true + + '@esbuild/linux-mips64el@0.28.2': + optional: true + + '@esbuild/linux-ppc64@0.28.2': + optional: true + + '@esbuild/linux-riscv64@0.28.2': + optional: true + + '@esbuild/linux-s390x@0.28.2': + optional: true + + '@esbuild/linux-x64@0.28.2': + optional: true + + '@esbuild/netbsd-arm64@0.28.2': + optional: true + + '@esbuild/netbsd-x64@0.28.2': + optional: true + + '@esbuild/openbsd-arm64@0.28.2': + optional: true + + '@esbuild/openbsd-x64@0.28.2': + optional: true + + '@esbuild/openharmony-arm64@0.28.2': + optional: true + + '@esbuild/sunos-x64@0.28.2': + optional: true + + '@esbuild/win32-arm64@0.28.2': + optional: true + + '@esbuild/win32-ia32@0.28.2': + optional: true + + '@esbuild/win32-x64@0.28.2': + optional: true + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@juggle/resize-observer@3.4.0': {} + + '@napi-rs/lzma-linux-x64-gnu@1.5.1': + optional: true + + '@rolldown/pluginutils@1.0.1': {} + + '@rollup/rollup-android-arm-eabi@4.64.5': + optional: true + + '@rollup/rollup-android-arm64@4.64.5': + optional: true + + '@rollup/rollup-darwin-arm64@4.64.5': + optional: true + + '@rollup/rollup-darwin-x64@4.64.5': + optional: true + + '@rollup/rollup-freebsd-arm64@4.64.5': + optional: true + + '@rollup/rollup-freebsd-x64@4.64.5': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.64.5': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.64.5': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.64.5': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.64.5': + optional: true + + '@rollup/rollup-linux-loong64-gnu@4.64.5': + optional: true + + '@rollup/rollup-linux-loong64-musl@4.64.5': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.64.5': + optional: true + + '@rollup/rollup-linux-ppc64-musl@4.64.5': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.64.5': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.64.5': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.64.5': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.64.5': + optional: true + + '@rollup/rollup-linux-x64-musl@4.64.5': + optional: true + + '@rollup/rollup-openbsd-x64@4.64.5': + optional: true + + '@rollup/rollup-openharmony-arm64@4.64.5': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.64.5': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.64.5': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.64.5': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.64.5': + optional: true + + '@tauri-apps/api@2.12.3': {} + + '@tauri-apps/cli-darwin-arm64@2.12.2': + optional: true + + '@tauri-apps/cli-darwin-x64@2.12.2': + optional: true + + '@tauri-apps/cli-linux-arm-gnueabihf@2.12.2': + optional: true + + '@tauri-apps/cli-linux-arm64-gnu@2.12.2': + optional: true + + '@tauri-apps/cli-linux-arm64-musl@2.12.2': + optional: true + + '@tauri-apps/cli-linux-riscv64-gnu@2.12.2': + optional: true + + '@tauri-apps/cli-linux-x64-gnu@2.12.2': + optional: true + + '@tauri-apps/cli-linux-x64-musl@2.12.2': + optional: true + + '@tauri-apps/cli-win32-arm64-msvc@2.12.2': + optional: true + + '@tauri-apps/cli-win32-ia32-msvc@2.12.2': + optional: true + + '@tauri-apps/cli-win32-x64-msvc@2.12.2': + optional: true + + '@tauri-apps/cli@2.12.2': + optionalDependencies: + '@tauri-apps/cli-darwin-arm64': 2.12.2 + '@tauri-apps/cli-darwin-x64': 2.12.2 + '@tauri-apps/cli-linux-arm-gnueabihf': 2.12.2 + '@tauri-apps/cli-linux-arm64-gnu': 2.12.2 + '@tauri-apps/cli-linux-arm64-musl': 2.12.2 + '@tauri-apps/cli-linux-riscv64-gnu': 2.12.2 + '@tauri-apps/cli-linux-x64-gnu': 2.12.2 + '@tauri-apps/cli-linux-x64-musl': 2.12.2 + '@tauri-apps/cli-win32-arm64-msvc': 2.12.2 + '@tauri-apps/cli-win32-ia32-msvc': 2.12.2 + '@tauri-apps/cli-win32-x64-msvc': 2.12.2 + + '@types/estree@1.0.9': {} + + '@types/lodash-es@4.17.12': + dependencies: + '@types/lodash': 4.17.26 + + '@types/lodash@4.17.26': {} + + '@types/node@24.19.2': + dependencies: + undici-types: 7.24.6 + + '@vitejs/plugin-vue@6.0.10(vite@7.3.7(@types/node@24.19.2))(vue@3.5.43(typescript@5.9.3))': + dependencies: + '@rolldown/pluginutils': 1.0.1 + vite: 7.3.7(@types/node@24.19.2) + vue: 3.5.43(typescript@5.9.3) + + '@volar/language-core@2.4.28': + dependencies: + '@volar/source-map': 2.4.28 + + '@volar/source-map@2.4.28': {} + + '@volar/typescript@2.4.28(typescript@5.9.3)': + dependencies: + '@volar/language-core': 2.4.28 + path-browserify: 1.0.1 + vscode-uri: 3.2.0 + optionalDependencies: + typescript: 5.9.3 + + '@vue/compiler-core@3.5.43': + dependencies: + '@babel/parser': 7.29.9 + '@vue/shared': 3.5.43 + entities: 7.0.1 + estree-walker: 2.0.2 + source-map-js: 1.2.2 + + '@vue/compiler-dom@3.5.43': + dependencies: + '@vue/compiler-core': 3.5.43 + '@vue/shared': 3.5.43 + + '@vue/compiler-sfc@3.5.43': + dependencies: + '@babel/parser': 7.29.9 + '@vue/compiler-core': 3.5.43 + '@vue/compiler-dom': 3.5.43 + '@vue/compiler-ssr': 3.5.43 + '@vue/shared': 3.5.43 + estree-walker: 2.0.2 + magic-string: 0.30.21 + postcss: 8.5.29 + source-map-js: 1.2.2 + + '@vue/compiler-ssr@3.5.43': + dependencies: + '@vue/compiler-dom': 3.5.43 + '@vue/shared': 3.5.43 + + '@vue/devtools-api@6.6.4': {} + + '@vue/devtools-api@7.7.10': + dependencies: + '@vue/devtools-kit': 7.7.10 + + '@vue/devtools-kit@7.7.10': + dependencies: + '@vue/devtools-shared': 7.7.10 + birpc: 2.9.0 + hookable: 5.5.3 + mitt: 3.0.1 + perfect-debounce: 1.0.0 + speakingurl: 14.0.1 + superjson: 2.2.6 + + '@vue/devtools-shared@7.7.10': + dependencies: + rfdc: 1.4.1 + + '@vue/language-core@3.3.13': + dependencies: + '@volar/language-core': 2.4.28 + '@vue/compiler-dom': 3.5.43 + '@vue/shared': 3.5.43 + alien-signals: 3.2.1 + muggle-string: 0.4.1 + path-browserify: 1.0.1 + picomatch: 4.0.7 + + '@vue/reactivity@3.5.43': + dependencies: + '@vue/shared': 3.5.43 + + '@vue/runtime-core@3.5.43': + dependencies: + '@vue/reactivity': 3.5.43 + '@vue/shared': 3.5.43 + + '@vue/runtime-dom@3.5.43': + dependencies: + '@vue/reactivity': 3.5.43 + '@vue/runtime-core': 3.5.43 + '@vue/shared': 3.5.43 + csstype: 3.2.3 + + '@vue/server-renderer@3.5.43': + dependencies: + '@vue/compiler-ssr': 3.5.43 + '@vue/runtime-dom': 3.5.43 + '@vue/shared': 3.5.43 + + '@vue/shared@3.5.43': {} + + alien-signals@3.2.1: {} + + async-validator@4.2.5: {} + + birpc@2.9.0: {} + + copy-anything@4.1.5: {} + + css-render@0.15.14: + dependencies: + '@emotion/hash': 0.8.0 + csstype: 3.0.11 + + csstype@3.0.11: {} + + csstype@3.2.3: {} + + date-fns-tz@3.2.0(date-fns@4.4.0): + dependencies: + date-fns: 4.4.0 + + date-fns@4.4.0: {} + + entities@7.0.1: {} + + esbuild@0.28.2: + optionalDependencies: + '@esbuild/aix-ppc64': 0.28.2 + '@esbuild/android-arm': 0.28.2 + '@esbuild/android-arm64': 0.28.2 + '@esbuild/android-x64': 0.28.2 + '@esbuild/darwin-arm64': 0.28.2 + '@esbuild/darwin-x64': 0.28.2 + '@esbuild/freebsd-arm64': 0.28.2 + '@esbuild/freebsd-x64': 0.28.2 + '@esbuild/linux-arm': 0.28.2 + '@esbuild/linux-arm64': 0.28.2 + '@esbuild/linux-ia32': 0.28.2 + '@esbuild/linux-loong64': 0.28.2 + '@esbuild/linux-mips64el': 0.28.2 + '@esbuild/linux-ppc64': 0.28.2 + '@esbuild/linux-riscv64': 0.28.2 + '@esbuild/linux-s390x': 0.28.2 + '@esbuild/linux-x64': 0.28.2 + '@esbuild/netbsd-arm64': 0.28.2 + '@esbuild/netbsd-x64': 0.28.2 + '@esbuild/openbsd-arm64': 0.28.2 + '@esbuild/openbsd-x64': 0.28.2 + '@esbuild/openharmony-arm64': 0.28.2 + '@esbuild/sunos-x64': 0.28.2 + '@esbuild/win32-arm64': 0.28.2 + '@esbuild/win32-ia32': 0.28.2 + '@esbuild/win32-x64': 0.28.2 + + estree-walker@2.0.2: {} + + evtd@0.2.4: {} + + fdir@6.5.0(picomatch@4.0.7): + optionalDependencies: + picomatch: 4.0.7 + + fsevents@2.3.3: + optional: true + + highlight.js@11.12.0: {} + + hookable@5.5.3: {} + + lodash-es@4.18.1: {} + + lodash@4.18.1: {} + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + mitt@3.0.1: {} + + muggle-string@0.4.1: {} + + naive-ui@2.45.3(vue@3.5.43(typescript@5.9.3)): + dependencies: + '@css-render/plugin-bem': 0.15.14(css-render@0.15.14) + '@css-render/vue3-ssr': 0.15.14(vue@3.5.43(typescript@5.9.3)) + '@types/lodash': 4.17.26 + '@types/lodash-es': 4.17.12 + async-validator: 4.2.5 + css-render: 0.15.14 + csstype: 3.2.3 + date-fns: 4.4.0 + date-fns-tz: 3.2.0(date-fns@4.4.0) + evtd: 0.2.4 + highlight.js: 11.12.0 + lodash: 4.18.1 + lodash-es: 4.18.1 + seemly: 0.3.10 + treemate: 0.3.11 + vdirs: 0.1.8(vue@3.5.43(typescript@5.9.3)) + vooks: 0.2.12(vue@3.5.43(typescript@5.9.3)) + vue: 3.5.43(typescript@5.9.3) + vueuc: 0.4.66(vue@3.5.43(typescript@5.9.3)) + + nanoid@3.3.20: {} + + path-browserify@1.0.1: {} + + perfect-debounce@1.0.0: {} + + picocolors@1.1.1: {} + + picomatch@4.0.7: {} + + pinia@3.0.4(typescript@5.9.3)(vue@3.5.43(typescript@5.9.3)): + dependencies: + '@vue/devtools-api': 7.7.10 + vue: 3.5.43(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + + postcss@8.5.29: + dependencies: + nanoid: 3.3.20 + picocolors: 1.1.1 + source-map-js: 1.2.2 + + rfdc@1.4.1: {} + + rollup@4.64.5: + dependencies: + '@types/estree': 1.0.9 + optionalDependencies: + '@napi-rs/lzma-linux-x64-gnu': 1.5.1 + '@rollup/rollup-android-arm-eabi': 4.64.5 + '@rollup/rollup-android-arm64': 4.64.5 + '@rollup/rollup-darwin-arm64': 4.64.5 + '@rollup/rollup-darwin-x64': 4.64.5 + '@rollup/rollup-freebsd-arm64': 4.64.5 + '@rollup/rollup-freebsd-x64': 4.64.5 + '@rollup/rollup-linux-arm-gnueabihf': 4.64.5 + '@rollup/rollup-linux-arm-musleabihf': 4.64.5 + '@rollup/rollup-linux-arm64-gnu': 4.64.5 + '@rollup/rollup-linux-arm64-musl': 4.64.5 + '@rollup/rollup-linux-loong64-gnu': 4.64.5 + '@rollup/rollup-linux-loong64-musl': 4.64.5 + '@rollup/rollup-linux-ppc64-gnu': 4.64.5 + '@rollup/rollup-linux-ppc64-musl': 4.64.5 + '@rollup/rollup-linux-riscv64-gnu': 4.64.5 + '@rollup/rollup-linux-riscv64-musl': 4.64.5 + '@rollup/rollup-linux-s390x-gnu': 4.64.5 + '@rollup/rollup-linux-x64-gnu': 4.64.5 + '@rollup/rollup-linux-x64-musl': 4.64.5 + '@rollup/rollup-openbsd-x64': 4.64.5 + '@rollup/rollup-openharmony-arm64': 4.64.5 + '@rollup/rollup-win32-arm64-msvc': 4.64.5 + '@rollup/rollup-win32-ia32-msvc': 4.64.5 + '@rollup/rollup-win32-x64-gnu': 4.64.5 + '@rollup/rollup-win32-x64-msvc': 4.64.5 + fsevents: 2.3.3 + + seemly@0.3.10: {} + + source-map-js@1.2.2: {} + + speakingurl@14.0.1: {} + + superjson@2.2.6: + dependencies: + copy-anything: 4.1.5 + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 + + treemate@0.3.11: {} + + typescript@5.9.3: {} + + undici-types@7.24.6: {} + + vdirs@0.1.8(vue@3.5.43(typescript@5.9.3)): + dependencies: + evtd: 0.2.4 + vue: 3.5.43(typescript@5.9.3) + + vite@7.3.7(@types/node@24.19.2): + dependencies: + esbuild: 0.28.2 + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 + postcss: 8.5.29 + rollup: 4.64.5 + tinyglobby: 0.2.17 + optionalDependencies: + '@types/node': 24.19.2 + fsevents: 2.3.3 + + vooks@0.2.12(vue@3.5.43(typescript@5.9.3)): + dependencies: + evtd: 0.2.4 + vue: 3.5.43(typescript@5.9.3) + + vscode-uri@3.2.0: {} + + vue-router@4.6.4(vue@3.5.43(typescript@5.9.3)): + dependencies: + '@vue/devtools-api': 6.6.4 + vue: 3.5.43(typescript@5.9.3) + + vue-tsc@3.3.13(typescript@5.9.3): + dependencies: + '@volar/typescript': 2.4.28(typescript@5.9.3) + '@vue/language-core': 3.3.13 + typescript: 5.9.3 + + vue@3.5.43(typescript@5.9.3): + dependencies: + '@vue/compiler-dom': 3.5.43 + '@vue/compiler-sfc': 3.5.43 + '@vue/runtime-dom': 3.5.43 + '@vue/server-renderer': 3.5.43 + '@vue/shared': 3.5.43 + optionalDependencies: + typescript: 5.9.3 + + vueuc@0.4.66(vue@3.5.43(typescript@5.9.3)): + dependencies: + '@css-render/vue3-ssr': 0.15.14(vue@3.5.43(typescript@5.9.3)) + '@juggle/resize-observer': 3.4.0 + css-render: 0.15.14 + evtd: 0.2.4 + seemly: 0.3.10 + vdirs: 0.1.8(vue@3.5.43(typescript@5.9.3)) + vooks: 0.2.12(vue@3.5.43(typescript@5.9.3)) + vue: 3.5.43(typescript@5.9.3) diff --git a/ui/pnpm-workspace.yaml b/ui/pnpm-workspace.yaml new file mode 100644 index 0000000..5ed0b5a --- /dev/null +++ b/ui/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +allowBuilds: + esbuild: true diff --git a/ui/src-tauri/Cargo.lock b/ui/src-tauri/Cargo.lock new file mode 100644 index 0000000..e0ef9e6 --- /dev/null +++ b/ui/src-tauri/Cargo.lock @@ -0,0 +1,4392 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2fb6cfd47bf496ff64095c20eaba0c201404ee38714d4142fcfa1dc334fcc7a" + +[[package]] +name = "alloc-stdlib" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5c1865780388bfa186411ab5f247819487fc4864c6e9c3106611fa347586e1" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android_system_properties" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "atk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" +dependencies = [ + "atk-sys", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" +dependencies = [ + "serde_core", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] + +[[package]] +name = "brotli" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8b851b75c23ca7873623d612fe49bd1989aeb03d08fb9432187eb253d3d4c6b" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "941cd9bd4ddab83cb46fa5a2d428f1c857b24ac78cb876cf7beb710840934bd7" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "bytemuck" +version = "1.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" +dependencies = [ + "serde", +] + +[[package]] +name = "cairo-rs" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +dependencies = [ + "bitflags 2.13.2", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror 1.0.69", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "camino" +version = "1.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbad30e4b4c14a39e3cc8aed085a12a327257c316619c93581e017bc52be591" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.21", +] + +[[package]] +name = "cargo_toml" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f4b26e751e711a5302649417f2da046dce6391b2ea30a4820f37462314f0b9" +dependencies = [ + "semver", + "serde", + "toml 1.1.8+spec-1.1.0", +] + +[[package]] +name = "cc" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6651c9ed80effdc7db0ff72512157f901af5e3549e341e24b1dd4887d836d838" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a347dcabdae9c31b0825fd6a8bed285ec9c2acb89c47827126d52fa4f59cece3" +dependencies = [ + "fnv", + "uuid", + "web-time", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "num-traits", + "serde", + "windows-link", +] + +[[package]] +name = "combine" +version = "4.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfc320937d09e6de266b31b9afb480f197d7a861be86be7cb2ea7e5d1bfffc5e" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "cookie" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a373e3602691c3cdea496d2f0ee5935151e6168fe87739483c463db1b2f2f87" +dependencies = [ + "time", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" +dependencies = [ + "bitflags 2.13.2", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.13.2", + "core-foundation", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01a7799fd6b852db0e61728dde9a204c423b44d689dbd432522543614b490e78" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98b0cc327b5bc766e7fda9c9260cc0fa81b43a8e240440422dff70788e3f9ef1" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9cdaae01d5ed7882b04d795e7f752f46ff52d2fa3b50a20d28c464510bba98" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "phf", + "smallvec", +] + +[[package]] +name = "cssparser-macros" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a" +dependencies = [ + "quote", + "syn 3.0.8", +] + +[[package]] +name = "ctor" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d" + +[[package]] +name = "darling" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 3.0.8", +] + +[[package]] +name = "darling_macro" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" +dependencies = [ + "darling_core", + "quote", + "syn 3.0.8", +] + +[[package]] +name = "dbus" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab69f03cc8c4340c9c8e315114e1658e6775a9b16a04357973aa21cec22b32e" +dependencies = [ + "libc", + "libdbus-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "defmt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8" +dependencies = [ + "defmt-parser", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "defmt-parser" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" +dependencies = [ + "thiserror 2.0.21", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "serde_core", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.119", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d57d423b3c82e89b9a24ca3091fee61f456a26edbd28d26c65906f4bc1dcd8f" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags 2.13.2", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.8", +] + +[[package]] +name = "dlopen2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "dom_query" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fac5fca71e65e94cc718a6e2af65d6e0f9c6027751c2aa562fbb5087fda639bc" +dependencies = [ + "bit-set", + "cssparser", + "foldhash", + "html5ever", + "precomputed-hash", + "selectors", + "tendril", +] + +[[package]] +name = "dpi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" +dependencies = [ + "serde", +] + +[[package]] +name = "dtoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "embed-resource" +version = "3.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6168487b5e7eb2673e6efe1200b1848016e436a6ca0b8031bf04bd9d493a249f" +dependencies = [ + "cc", + "memchr", + "rustc_version", + "toml 1.1.8+spec-1.1.0", + "vswhom", + "winreg 0.56.0", +] + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aedcfb3409746eddb02b9e19ebda1c3394f759a152e48ee875a0844d1b955484" + +[[package]] +name = "flate2" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb" +dependencies = [ + "crc32fast", + "miniz_oxide 0.9.1", + "zlib-rs", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.8", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-executor" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-macro" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.8", +] + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "gdk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + +[[package]] +name = "gdkx11-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps", + "x11", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", +] + +[[package]] +name = "gio" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "glib" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +dependencies = [ + "bitflags 2.13.2", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "glib-macros" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 2.0.2", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "html5ever" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a1761807faccc9a19e86944bbf40610014066306f96edcdedc2fb714bcb7b8" +dependencies = [ + "log", + "markup5ever", +] + +[[package]] +name = "http" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3e324da4c95177d6291d4c8730197c0d1822f8a9766814a4a44fa5ab797c9c" +dependencies = [ + "atomic-waker", + "bytes", + "futures-core", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-util" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" +dependencies = [ + "base64 0.23.1", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "httparse", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ico" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371" +dependencies = [ + "byteorder", + "png 0.17.16", +] + +[[package]] +name = "icu_collections" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0" + +[[package]] +name = "icu_properties" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa" + +[[package]] +name = "icu_provider" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "infer" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4200d433cbd5178df7797c9c2e75b348b728e39631cf14520d1e2fc424201f4" +dependencies = [ + "cfb", +] + +[[package]] +name = "ipnet" +version = "2.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "javascriptcore-rs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "jiff" +version = "0.2.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b005715dcbeb0089a3c0dab99f2ff1cc3b2525323552703d648585d342a383" +dependencies = [ + "defmt", + "jiff-core", + "jiff-static", + "jiff-tzdb-platform", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", + "windows-link", +] + +[[package]] +name = "jiff-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e52fe76043ccecc9005d2305ebaadf7d7fc0cc89ca6baa10a94d6bc68c7128c" +dependencies = [ + "defmt", + "log", +] + +[[package]] +name = "jiff-static" +version = "0.2.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc9817253cf7c7ee4684451bd327e88d6f3658014e54a29198625590650695c" +dependencies = [ + "jiff-core", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "jiff-tzdb" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa8377070c6bae868759445e5a77f66d84f0b72f3a054bfb00e6d038b8282da7" + +[[package]] +name = "jiff-tzdb-platform" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" +dependencies = [ + "jiff-tzdb", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "js-sys" +version = "0.3.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7421438de105a0827e44fadd05377727847d717c80ce29a229f85fd04c427b72" +dependencies = [ + "jsonptr", + "serde", + "serde_json", + "thiserror 2.0.21", +] + +[[package]] +name = "jsonptr" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5a3cc660ba5d72bce0b3bb295bf20847ccbb40fd423f3f05b61273672e561fe" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "keyboard-types" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d" +dependencies = [ + "bitflags 2.13.2", + "serde", +] + +[[package]] +name = "libappindicator" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + +[[package]] +name = "libc" +version = "0.2.190" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce5d3ddc6d3fa000eb1536d85e147bfe31aacaba692ed6a876f95cb7c855be78" + +[[package]] +name = "libdbus-sys" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "328c4789d42200f1eeec05bd86c9c13c7f091d2ba9a6ea35acdf51f31bc0f043" +dependencies = [ + "pkg-config", +] + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libredox" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d" +dependencies = [ + "libc", +] + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" + +[[package]] +name = "markup5ever" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7122d987ec5f704ee56f6e5b41a7d93722e9aae27ae07cafa4036c4d3f9757de" +dependencies = [ + "log", + "tendril", + "web_atoms", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "miniz_oxide" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "muda" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cca139e57da4383727f189e43e66e84fa372347027fc996f9f1a007ec0a37996" +dependencies = [ + "crossbeam-channel", + "dpi", + "gtk", + "keyboard-types", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "once_cell", + "png 0.18.1", + "serde", + "thiserror 2.0.21", + "windows-sys 0.61.2", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.13.2", + "jni-sys 0.3.1", + "log", + "ndk-sys", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys 0.3.1", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "num-conv" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "objc2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8" +dependencies = [ + "objc2-encode", + "objc2-exception-helper", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" +dependencies = [ + "bitflags 2.13.2", + "block2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-data" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.13.2", + "dispatch2", + "objc2", +] + +[[package]] +name = "objc2-core-graphics" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" +dependencies = [ + "bitflags 2.13.2", + "dispatch2", + "objc2", + "objc2-core-foundation", + "objc2-io-surface", +] + +[[package]] +name = "objc2-core-image" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-location" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-text" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-exception-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" +dependencies = [ + "cc", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.13.2", + "block2", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-io-surface" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" +dependencies = [ + "bitflags 2.13.2", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-image", + "objc2-core-location", + "objc2-core-text", + "objc2-foundation", + "objc2-quartz-core", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" +dependencies = [ + "bitflags 2.13.2", + "block2", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros", + "phf_shared", + "serde", +] + +[[package]] +name = "phf_codegen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared", +] + +[[package]] +name = "phf_macros" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" + +[[package]] +name = "plist" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896bade328c13f7042a297ea5ac5b0951f6cf989dea5f32c2fd98da398195cb" +dependencies = [ + "base64 0.23.1", + "indexmap 2.14.2", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide 0.8.9", +] + +[[package]] +name = "png" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" +dependencies = [ + "bitflags 2.13.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide 0.8.9", +] + +[[package]] +name = "portable-atomic" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" + +[[package]] +name = "portable-atomic-util" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.17+spec-1.1.0", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41b1177fdf999d2321d3fb46ff47159d9c1fb9ad66a4879f8c50a0b504615e9b" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.13.2", +] + +[[package]] +name = "redox_users" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0" +dependencies = [ + "libredox", + "thiserror 2.0.21", +] + +[[package]] +name = "ref-cast" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.8", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "reqwest" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a1cfa75cc186dd73d5818e510e042e40927bccc9c236b061cea97e1eb08029" +dependencies = [ + "base64 0.23.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "indexmap 1.9.3", + "schemars_derive", + "serde", + "serde_json", + "url", + "uuid", +] + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "687274d293b6cdc6e73e0fee520bf2049650090d7164f87672d212a3c530cf4a" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.119", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "selectors" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adfa1c298912827b8a28b223b3b874357397ae706e6190acd9bf28cee99114d" +dependencies = [ + "bitflags 2.13.2", + "cssparser", + "derive_more", + "log", + "new_debug_unreachable", + "phf", + "phf_codegen", + "precomputed-hash", + "rustc-hash", + "servo_arc", + "smallvec", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-untagged" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" +dependencies = [ + "erased-serde", + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.8", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_repr" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.8", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_with" +version = "3.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9adc193c780ef8f159aee8b61e2d5801aaa555e6eb0947fe45530ec506296f" +dependencies = [ + "base64 0.23.1", + "bs58", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.14.2", + "jiff", + "schemars 0.9.0", + "schemars 1.2.2", + "serde_core", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e17bbc68e28663bbbb90df47e058aa7eda4fb445b89fe70457bb94fbccf6e49" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 3.0.8", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "servo_arc" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "simd-adler32" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + +[[package]] +name = "siphasher" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b3dc8af474f516a851ff4bd12db780f948b9250ad37211e4eec0bccea54e01b" + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "softbuffer" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" +dependencies = [ + "bytemuck", + "js-sys", + "ndk", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle", + "redox_syscall", + "tracing", + "wasm-bindgen", + "web-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "string_cache" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + +[[package]] +name = "string_cache_codegen" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "swift-rs" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cefd87076fd385308ee4aff597256c902f1fbb4d031de1558efc12f8ffefadd9" +dependencies = [ + "base64 0.21.7", + "serde", + "serde_json", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01016da373cd8f7ef12624f796309f5c31ba8d646dd08856c02cd741d823c622" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.8", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml 0.8.2", + "version-compare", +] + +[[package]] +name = "tao" +version = "0.37.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f37f381f4e048e6cdf038b5705f8cf14ad108279d46eb968140a7b291aba9400" +dependencies = [ + "bitflags 2.13.2", + "block2", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dbus", + "dispatch2", + "dlopen2", + "dpi", + "gdkwayland-sys", + "gdkx11-sys", + "gtk", + "jni", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "parking_lot", + "percent-encoding", + "raw-window-handle", + "tao-macros", + "unicode-segmentation", + "url", + "windows", + "windows-core", + "windows-version", + "x11-dl", +] + +[[package]] +name = "tao-macros" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f7eeb6d99155545da6150a1795945f16ac9c178deb2a5f2e74d776107bd5849" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tapremly" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "tauri", + "tauri-build", + "winreg 0.55.0", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tauri" +version = "2.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c404ecf956ff241bf6b39dd688614724e1bf1f63255abb4fc46d1c40371672ea" +dependencies = [ + "anyhow", + "bytes", + "cookie", + "dirs", + "dunce", + "embed_plist", + "getrandom 0.3.4", + "glob", + "gtk", + "heck 0.5.0", + "http", + "jni", + "libc", + "log", + "mime", + "muda", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "percent-encoding", + "plist", + "raw-window-handle", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "swift-rs", + "tauri-build", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "thiserror 2.0.21", + "tokio", + "tray-icon", + "url", + "webkit2gtk", + "webview2-com", + "window-vibrancy", + "windows", +] + +[[package]] +name = "tauri-build" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eea0b6302f82c574b21af6fc6ae6e86183b9280853c22621d0abf0936911ffc" +dependencies = [ + "anyhow", + "cargo_toml", + "dirs", + "glob", + "heck 0.5.0", + "json-patch", + "schemars 0.8.22", + "semver", + "serde", + "serde_json", + "tauri-utils", + "tauri-winres", + "walkdir", +] + +[[package]] +name = "tauri-codegen" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02f468f9a9bcd404f57e5c191d91024e3de953d4b610f78c2907e7110615cb1c" +dependencies = [ + "base64 0.23.1", + "brotli", + "ico", + "json-patch", + "plist", + "png 0.18.1", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "sha2", + "syn 2.0.119", + "tauri-utils", + "thiserror 2.0.21", + "time", + "url", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131bffec939b20642380317f8403a33c8888489925e14bb965ceaff0d949b1cb" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-runtime" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a57a2a9b8c8b7fc00d35b510fe808ded7f9f1b44fc1cdda6aee38632ea5413" +dependencies = [ + "cookie", + "dpi", + "gtk", + "http", + "jni", + "objc2", + "objc2-ui-kit", + "objc2-web-kit", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror 2.0.21", + "url", + "webkit2gtk", + "webview2-com", + "windows", +] + +[[package]] +name = "tauri-runtime-wry" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9e7e0c9f80a5130773cfabb6df4dc924518fb1b2c923726966804634b57d22" +dependencies = [ + "gtk", + "http", + "jni", + "log", + "objc2", + "objc2-app-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "softbuffer", + "tao", + "tauri-runtime", + "tauri-utils", + "url", + "webkit2gtk", + "webview2-com", + "windows", + "wry", +] + +[[package]] +name = "tauri-utils" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ff55a614843b9a3f010f211df637c94df2607175b8d0f6e0f4a7c19e18621ee" +dependencies = [ + "anyhow", + "brotli", + "cargo_metadata", + "ctor", + "dom_query", + "dunce", + "glob", + "http", + "infer", + "json-patch", + "log", + "memchr", + "phf", + "plist", + "proc-macro2", + "quote", + "regex", + "schemars 0.8.22", + "semver", + "serde", + "serde-untagged", + "serde_json", + "serde_with", + "swift-rs", + "thiserror 2.0.21", + "toml 1.1.8+spec-1.1.0", + "url", + "urlpattern", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-winres" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc65d45c68858bfe420dd29e834b5d15dbecf8a07a8a16cf4d532c7b1f69d4b6" +dependencies = [ + "dunce", + "embed-resource", + "toml 1.1.8+spec-1.1.0", +] + +[[package]] +name = "tendril" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fed54709c5b3a53d09bb1c113ea4f5ceafd1e772ddcb0030a82e1d56c087b08" +dependencies = [ + "new_debug_unreachable", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" +dependencies = [ + "thiserror-impl 2.0.21", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.8", +] + +[[package]] +name = "time" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" + +[[package]] +name = "time-macros" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" + +[[package]] +name = "tokio" +version = "1.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e95f91fcc7a621e8b030f6aa23c71fe9838ae2fb4d8118b75602a328f5144044" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-util" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "toml" +version = "1.1.8+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d" +dependencies = [ + "indexmap 2.14.2", + "serde_core", + "serde_spanned 1.1.2", + "toml_datetime 1.1.2+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 1.0.4", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.14.2", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.14.2", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.25.17+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c" +dependencies = [ + "indexmap 2.14.2", + "toml_datetime 1.1.2+spec-1.1.0", + "toml_parser", + "winnow 1.0.4", +] + +[[package]] +name = "toml_parser" +version = "1.1.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" +dependencies = [ + "winnow 1.0.4", +] + +[[package]] +name = "toml_writer" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06bdbd8cfc056b8d2e2e85f29b56a3bdbecb527cef81eb39e3e7b98af4652770" + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags 2.13.2", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tray-icon" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b9c52859a94554803ccd4a24b98f74148ebc73b90676d783f3490b1bff9d72" +dependencies = [ + "crossbeam-channel", + "dirs", + "libappindicator", + "muda", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "once_cell", + "png 0.18.1", + "serde", + "thiserror 2.0.21", + "windows-sys 0.61.2", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unicode-ident" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954" + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "urlpattern" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df16f50ef4cc145211879a3867ba757076b25dfee812040dcb0658bd9ae7904b" +dependencies = [ + "icu_properties", + "regex", + "serde", + "url", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cc1186384beb7dd8eedea376413fd654937285ea6c9cfbb928dc3043ea4b606" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec4cdd0dd910afe868b7ef477227d8d538b46b3075031afee8a9f2acb0a2ed0b" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cbab34de2d982e9b48e18d216d04c4a6f641066ff19ffb699980f591ee3610e" +dependencies = [ + "js-sys", + "tokio", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 3.0.8", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88261b9deccee56594c11a3460c462c41f58d148598fe70ad77070126a68aba4" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web_atoms" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba8b815c1b593dc0baf78dd0f4fc8fdb2de53198fb1163738093e9a311c33fb3" +dependencies = [ + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", +] + +[[package]] +name = "webkit2gtk" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pkg-config", + "soup3-sys", + "system-deps", +] + +[[package]] +name = "webview2-com" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f89fca7a704cee10dcb3654c1dbb8941d1783132f1917358af75bec37a7d7e6" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows", + "windows-core", +] + +[[package]] +name = "webview2-com-macros" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a921c1b6914c367b2b823cd4cde6f96beec77d30a939c8199bb377cf9b9b54" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "webview2-com-sys" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a07132775117d6065853d9d1178157b8c90e228de47129d6bce2c7edebedfb" +dependencies = [ + "thiserror 2.0.21", + "windows", + "windows-core", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "window-vibrancy" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111e51caca442cafd9bab396628ac4d814880eaea4e63dfd76a12e9f342b5580" +dependencies = [ + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle", + "windows-sys 0.61.2", + "windows-version", +] + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core", + "windows-link", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.55.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb5a765337c50e9ec252c2069be9bf91c7df47afb103b642ba3a53bf8101be97" +dependencies = [ + "cfg-if", + "windows-sys 0.59.0", +] + +[[package]] +name = "winreg" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10" +dependencies = [ + "cfg-if", + "windows-sys 0.61.2", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "wry" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a819957a01b3119af85e638a38d242af76dbc87d130dca67bfd0441072e21ff0" +dependencies = [ + "base64 0.22.1", + "block2", + "cookie", + "crossbeam-channel", + "dirs", + "dom_query", + "dpi", + "dunce", + "gdkx11", + "gtk", + "http", + "javascriptcore-rs", + "jni", + "libc", + "ndk", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "sha2", + "soup3", + "tao-macros", + "thiserror 2.0.21", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows", + "windows-core", + "windows-version", + "x11-dl", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.8", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.8", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.8", +] + +[[package]] +name = "zlib-rs" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/ui/src-tauri/Cargo.toml b/ui/src-tauri/Cargo.toml new file mode 100644 index 0000000..4b9db80 --- /dev/null +++ b/ui/src-tauri/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "tapremly" +version = "0.1.0" +description = "TapRemly" +edition = "2021" + +[lib] +name = "tapremly_lib" +crate-type = ["staticlib", "cdylib", "rlib"] + +[build-dependencies] +tauri-build = { version = "2", features = [] } + +[dependencies] +serde = { version = "1", features = ["derive"] } +serde_json = "1" +tauri = { version = "2", features = [] } + +[target.'cfg(windows)'.dependencies] +winreg = "0.55" + +[profile.release] +panic = "abort" +codegen-units = 1 +lto = true +opt-level = "s" +strip = true diff --git a/ui/src-tauri/build.rs b/ui/src-tauri/build.rs new file mode 100644 index 0000000..649bd77 --- /dev/null +++ b/ui/src-tauri/build.rs @@ -0,0 +1,11 @@ +fn main() { + let attributes = + tauri_build::Attributes::new().app_manifest(tauri_build::AppManifest::new().commands(&[ + "agent_endpoint", + "start_agent", + "stop_agent", + "autostart_get", + "autostart_set", + ])); + tauri_build::try_build(attributes).expect("failed to run tauri-build"); +} diff --git a/ui/src-tauri/capabilities/default.json b/ui/src-tauri/capabilities/default.json new file mode 100644 index 0000000..a39a36d --- /dev/null +++ b/ui/src-tauri/capabilities/default.json @@ -0,0 +1,14 @@ +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "default", + "description": "主窗口", + "windows": ["main"], + "permissions": [ + "core:default", + "allow-agent-endpoint", + "allow-start-agent", + "allow-stop-agent", + "allow-autostart-get", + "allow-autostart-set" + ] +} diff --git a/ui/src-tauri/icons/128x128.png b/ui/src-tauri/icons/128x128.png new file mode 100644 index 0000000..aac9ca9 Binary files /dev/null and b/ui/src-tauri/icons/128x128.png differ diff --git a/ui/src-tauri/icons/128x128@2x.png b/ui/src-tauri/icons/128x128@2x.png new file mode 100644 index 0000000..461254b Binary files /dev/null and b/ui/src-tauri/icons/128x128@2x.png differ diff --git a/ui/src-tauri/icons/32x32.png b/ui/src-tauri/icons/32x32.png new file mode 100644 index 0000000..ccd4716 Binary files /dev/null and b/ui/src-tauri/icons/32x32.png differ diff --git a/ui/src-tauri/icons/64x64.png b/ui/src-tauri/icons/64x64.png new file mode 100644 index 0000000..1e85eb6 Binary files /dev/null and b/ui/src-tauri/icons/64x64.png differ diff --git a/ui/src-tauri/icons/Square107x107Logo.png b/ui/src-tauri/icons/Square107x107Logo.png new file mode 100644 index 0000000..cd09696 Binary files /dev/null and b/ui/src-tauri/icons/Square107x107Logo.png differ diff --git a/ui/src-tauri/icons/Square142x142Logo.png b/ui/src-tauri/icons/Square142x142Logo.png new file mode 100644 index 0000000..b5bfbc0 Binary files /dev/null and b/ui/src-tauri/icons/Square142x142Logo.png differ diff --git a/ui/src-tauri/icons/Square150x150Logo.png b/ui/src-tauri/icons/Square150x150Logo.png new file mode 100644 index 0000000..3fd9e29 Binary files /dev/null and b/ui/src-tauri/icons/Square150x150Logo.png differ diff --git a/ui/src-tauri/icons/Square284x284Logo.png b/ui/src-tauri/icons/Square284x284Logo.png new file mode 100644 index 0000000..c66e40d Binary files /dev/null and b/ui/src-tauri/icons/Square284x284Logo.png differ diff --git a/ui/src-tauri/icons/Square30x30Logo.png b/ui/src-tauri/icons/Square30x30Logo.png new file mode 100644 index 0000000..e34f0ab Binary files /dev/null and b/ui/src-tauri/icons/Square30x30Logo.png differ diff --git a/ui/src-tauri/icons/Square310x310Logo.png b/ui/src-tauri/icons/Square310x310Logo.png new file mode 100644 index 0000000..bbb3633 Binary files /dev/null and b/ui/src-tauri/icons/Square310x310Logo.png differ diff --git a/ui/src-tauri/icons/Square44x44Logo.png b/ui/src-tauri/icons/Square44x44Logo.png new file mode 100644 index 0000000..263919b Binary files /dev/null and b/ui/src-tauri/icons/Square44x44Logo.png differ diff --git a/ui/src-tauri/icons/Square71x71Logo.png b/ui/src-tauri/icons/Square71x71Logo.png new file mode 100644 index 0000000..47a25cb Binary files /dev/null and b/ui/src-tauri/icons/Square71x71Logo.png differ diff --git a/ui/src-tauri/icons/Square89x89Logo.png b/ui/src-tauri/icons/Square89x89Logo.png new file mode 100644 index 0000000..ba2dfa8 Binary files /dev/null and b/ui/src-tauri/icons/Square89x89Logo.png differ diff --git a/ui/src-tauri/icons/StoreLogo.png b/ui/src-tauri/icons/StoreLogo.png new file mode 100644 index 0000000..dfe2ffe Binary files /dev/null and b/ui/src-tauri/icons/StoreLogo.png differ diff --git a/ui/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml b/ui/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..2ffbf24 --- /dev/null +++ b/ui/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ui/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png b/ui/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..6d07585 Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png differ diff --git a/ui/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png b/ui/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..47acbce Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/ui/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png b/ui/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..e2a8ed0 Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png differ diff --git a/ui/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png b/ui/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..292caa1 Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png differ diff --git a/ui/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png b/ui/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..79def30 Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/ui/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png b/ui/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..78846f0 Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png differ diff --git a/ui/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png b/ui/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..d537578 Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png differ diff --git a/ui/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png b/ui/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..a772134 Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/ui/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png b/ui/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..d0b18a1 Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/ui/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png b/ui/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..826164b Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png differ diff --git a/ui/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png b/ui/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..62aaaf9 Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/ui/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png b/ui/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..01baf7e Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/ui/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png b/ui/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..a4b831c Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/ui/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/ui/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..becb652 Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/ui/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png b/ui/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..120d29c Binary files /dev/null and b/ui/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/ui/src-tauri/icons/android/values/ic_launcher_background.xml b/ui/src-tauri/icons/android/values/ic_launcher_background.xml new file mode 100644 index 0000000..16cdd5a --- /dev/null +++ b/ui/src-tauri/icons/android/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + \ No newline at end of file diff --git a/ui/src-tauri/icons/icon.icns b/ui/src-tauri/icons/icon.icns new file mode 100644 index 0000000..529d4bc Binary files /dev/null and b/ui/src-tauri/icons/icon.icns differ diff --git a/ui/src-tauri/icons/icon.ico b/ui/src-tauri/icons/icon.ico new file mode 100644 index 0000000..11df0c4 Binary files /dev/null and b/ui/src-tauri/icons/icon.ico differ diff --git a/ui/src-tauri/icons/icon.png b/ui/src-tauri/icons/icon.png new file mode 100644 index 0000000..99a2d95 Binary files /dev/null and b/ui/src-tauri/icons/icon.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-20x20@1x.png b/ui/src-tauri/icons/ios/AppIcon-20x20@1x.png new file mode 100644 index 0000000..35181cc Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-20x20@1x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-20x20@2x-1.png b/ui/src-tauri/icons/ios/AppIcon-20x20@2x-1.png new file mode 100644 index 0000000..fdceeb9 Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-20x20@2x-1.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-20x20@2x.png b/ui/src-tauri/icons/ios/AppIcon-20x20@2x.png new file mode 100644 index 0000000..fdceeb9 Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-20x20@2x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-20x20@3x.png b/ui/src-tauri/icons/ios/AppIcon-20x20@3x.png new file mode 100644 index 0000000..befe578 Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-20x20@3x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-29x29@1x.png b/ui/src-tauri/icons/ios/AppIcon-29x29@1x.png new file mode 100644 index 0000000..18b620a Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-29x29@1x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-29x29@2x-1.png b/ui/src-tauri/icons/ios/AppIcon-29x29@2x-1.png new file mode 100644 index 0000000..53dad63 Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-29x29@2x-1.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-29x29@2x.png b/ui/src-tauri/icons/ios/AppIcon-29x29@2x.png new file mode 100644 index 0000000..53dad63 Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-29x29@2x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-29x29@3x.png b/ui/src-tauri/icons/ios/AppIcon-29x29@3x.png new file mode 100644 index 0000000..5ebb293 Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-29x29@3x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-40x40@1x.png b/ui/src-tauri/icons/ios/AppIcon-40x40@1x.png new file mode 100644 index 0000000..fdceeb9 Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-40x40@1x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-40x40@2x-1.png b/ui/src-tauri/icons/ios/AppIcon-40x40@2x-1.png new file mode 100644 index 0000000..fd0981c Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-40x40@2x-1.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-40x40@2x.png b/ui/src-tauri/icons/ios/AppIcon-40x40@2x.png new file mode 100644 index 0000000..fd0981c Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-40x40@2x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-40x40@3x.png b/ui/src-tauri/icons/ios/AppIcon-40x40@3x.png new file mode 100644 index 0000000..b8202bf Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-40x40@3x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-512@2x.png b/ui/src-tauri/icons/ios/AppIcon-512@2x.png new file mode 100644 index 0000000..d7cdac3 Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-512@2x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-60x60@2x.png b/ui/src-tauri/icons/ios/AppIcon-60x60@2x.png new file mode 100644 index 0000000..b8202bf Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-60x60@2x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-60x60@3x.png b/ui/src-tauri/icons/ios/AppIcon-60x60@3x.png new file mode 100644 index 0000000..c4509aa Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-60x60@3x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-76x76@1x.png b/ui/src-tauri/icons/ios/AppIcon-76x76@1x.png new file mode 100644 index 0000000..3ce0cf7 Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-76x76@1x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-76x76@2x.png b/ui/src-tauri/icons/ios/AppIcon-76x76@2x.png new file mode 100644 index 0000000..5ebdc2e Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-76x76@2x.png differ diff --git a/ui/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png b/ui/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png new file mode 100644 index 0000000..ba804a9 Binary files /dev/null and b/ui/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png differ diff --git a/ui/src-tauri/permissions/autogenerated/agent_endpoint.toml b/ui/src-tauri/permissions/autogenerated/agent_endpoint.toml new file mode 100644 index 0000000..ad204be --- /dev/null +++ b/ui/src-tauri/permissions/autogenerated/agent_endpoint.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-agent-endpoint" +description = "Enables the agent_endpoint command without any pre-configured scope." +commands.allow = ["agent_endpoint"] + +[[permission]] +identifier = "deny-agent-endpoint" +description = "Denies the agent_endpoint command without any pre-configured scope." +commands.deny = ["agent_endpoint"] diff --git a/ui/src-tauri/permissions/autogenerated/autostart_get.toml b/ui/src-tauri/permissions/autogenerated/autostart_get.toml new file mode 100644 index 0000000..0d98547 --- /dev/null +++ b/ui/src-tauri/permissions/autogenerated/autostart_get.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-autostart-get" +description = "Enables the autostart_get command without any pre-configured scope." +commands.allow = ["autostart_get"] + +[[permission]] +identifier = "deny-autostart-get" +description = "Denies the autostart_get command without any pre-configured scope." +commands.deny = ["autostart_get"] diff --git a/ui/src-tauri/permissions/autogenerated/autostart_set.toml b/ui/src-tauri/permissions/autogenerated/autostart_set.toml new file mode 100644 index 0000000..87441cc --- /dev/null +++ b/ui/src-tauri/permissions/autogenerated/autostart_set.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-autostart-set" +description = "Enables the autostart_set command without any pre-configured scope." +commands.allow = ["autostart_set"] + +[[permission]] +identifier = "deny-autostart-set" +description = "Denies the autostart_set command without any pre-configured scope." +commands.deny = ["autostart_set"] diff --git a/ui/src-tauri/permissions/autogenerated/start_agent.toml b/ui/src-tauri/permissions/autogenerated/start_agent.toml new file mode 100644 index 0000000..3f9af14 --- /dev/null +++ b/ui/src-tauri/permissions/autogenerated/start_agent.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-start-agent" +description = "Enables the start_agent command without any pre-configured scope." +commands.allow = ["start_agent"] + +[[permission]] +identifier = "deny-start-agent" +description = "Denies the start_agent command without any pre-configured scope." +commands.deny = ["start_agent"] diff --git a/ui/src-tauri/permissions/autogenerated/stop_agent.toml b/ui/src-tauri/permissions/autogenerated/stop_agent.toml new file mode 100644 index 0000000..fcfbfdb --- /dev/null +++ b/ui/src-tauri/permissions/autogenerated/stop_agent.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-stop-agent" +description = "Enables the stop_agent command without any pre-configured scope." +commands.allow = ["stop_agent"] + +[[permission]] +identifier = "deny-stop-agent" +description = "Denies the stop_agent command without any pre-configured scope." +commands.deny = ["stop_agent"] diff --git a/ui/src-tauri/src/lib.rs b/ui/src-tauri/src/lib.rs new file mode 100644 index 0000000..0a90424 --- /dev/null +++ b/ui/src-tauri/src/lib.rs @@ -0,0 +1,404 @@ +use std::fs; +use std::io::{Read, Write}; +use std::net::TcpStream; +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; +use std::time::Duration; + +use serde::Deserialize; +use serde::Serialize; +use tauri::Manager; + +#[derive(Deserialize)] +struct AgentFile { + addr: String, + token: String, + pid: u32, +} + +#[derive(Serialize)] +struct Endpoint { + running: bool, + addr: String, + token: String, + pid: u32, +} + +fn data_dir() -> PathBuf { + if let Ok(home) = std::env::var("TAPREMLY_HOME") { + if !home.is_empty() { + return PathBuf::from(home); + } + } + #[cfg(windows)] + { + let local = std::env::var("LOCALAPPDATA").unwrap_or_else(|_| { + let user = std::env::var("USERPROFILE").unwrap_or_default(); + format!("{user}\\AppData\\Local") + }); + return PathBuf::from(local).join("TapRemly"); + } + #[cfg(not(windows))] + { + if let Ok(xdg) = std::env::var("XDG_DATA_HOME") { + if !xdg.is_empty() { + return PathBuf::from(xdg).join("tapremly"); + } + } + let home = std::env::var("HOME").unwrap_or_default(); + PathBuf::from(home) + .join(".local") + .join("share") + .join("tapremly") + } +} + +fn read_file() -> Option { + let raw = fs::read(data_dir().join("agent.json")).ok()?; + serde_json::from_slice(&raw).ok() +} + +#[cfg(windows)] +#[link(name = "kernel32")] +extern "system" { + fn OpenProcess(access: u32, inherit: i32, pid: u32) -> *mut std::ffi::c_void; + fn GetExitCodeProcess(handle: *mut std::ffi::c_void, code: *mut u32) -> i32; + fn CloseHandle(handle: *mut std::ffi::c_void) -> i32; + fn TerminateProcess(handle: *mut std::ffi::c_void, code: u32) -> i32; +} + +fn pid_alive(pid: u32) -> bool { + if pid == 0 { + return false; + } + #[cfg(windows)] + { + const QUERY: u32 = 0x1000; + const STILL_ACTIVE: u32 = 259; + unsafe { + let handle = OpenProcess(QUERY, 0, pid); + if handle.is_null() { + return false; + } + let mut code = 0u32; + let ok = GetExitCodeProcess(handle, &mut code); + CloseHandle(handle); + ok != 0 && code == STILL_ACTIVE + } + } + #[cfg(not(windows))] + { + Command::new("kill") + .args(["-0", &pid.to_string()]) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .status() + .map(|s| s.success()) + .unwrap_or(false) + } +} + +fn endpoint() -> Endpoint { + match read_file() { + Some(info) if pid_alive(info.pid) => Endpoint { + running: true, + addr: info.addr, + token: info.token, + pid: info.pid, + }, + _ => Endpoint { + running: false, + addr: String::new(), + token: String::new(), + pid: 0, + }, + } +} + +fn find_agent(app: &tauri::AppHandle) -> Option { + if let Ok(dir) = app.path().resource_dir() { + for name in ["tapremly-agent.exe", "tapremly-agent"] { + let path = dir.join(name); + if path.is_file() { + return Some(path); + } + } + } + let mut dirs = Vec::new(); + if let Ok(exe) = std::env::current_exe() { + let mut dir = exe.parent().map(Path::to_path_buf); + for _ in 0..8 { + if let Some(current) = dir { + dirs.push(current.clone()); + dir = current.parent().map(Path::to_path_buf); + } + } + } + if let Ok(cwd) = std::env::current_dir() { + dirs.push(cwd); + } + for dir in dirs { + for name in ["tapremly-agent.exe", "tapremly-agent"] { + let direct = dir.join(name); + if direct.is_file() { + return Some(direct); + } + let nested = dir.join("agent").join(name); + if nested.is_file() { + return Some(nested); + } + } + } + None +} + +fn spawn_detached(exe: &Path) -> Result<(), String> { + #[cfg(windows)] + { + use std::os::windows::process::CommandExt; + const CREATE_NO_WINDOW: u32 = 0x0800_0000; + const DETACHED_PROCESS: u32 = 0x0000_0008; + const CREATE_NEW_PROCESS_GROUP: u32 = 0x0000_0200; + const CREATE_BREAKAWAY_FROM_JOB: u32 = 0x0100_0000; + let flags = CREATE_NO_WINDOW + | DETACHED_PROCESS + | CREATE_NEW_PROCESS_GROUP + | CREATE_BREAKAWAY_FROM_JOB; + let mut cmd = Command::new(exe); + cmd.stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .creation_flags(flags); + if cmd.spawn().is_err() { + let mut plain = Command::new(exe); + plain + .stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .creation_flags(CREATE_NO_WINDOW | DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP); + plain.spawn().map_err(|err| err.to_string())?; + } + return Ok(()); + } + #[cfg(not(windows))] + { + use std::os::unix::process::CommandExt; + let mut cmd = Command::new(exe); + cmd.stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .process_group(0); + cmd.spawn().map_err(|err| err.to_string())?; + Ok(()) + } +} + +fn http_stop(addr: &str, token: &str) -> Result<(), String> { + let mut stream = TcpStream::connect(addr).map_err(|err| err.to_string())?; + stream + .set_read_timeout(Some(Duration::from_secs(2))) + .map_err(|err| err.to_string())?; + let req = format!( + "POST /v1/stop HTTP/1.1\r\nHost: {addr}\r\nAuthorization: Bearer {token}\r\nContent-Length: 0\r\nConnection: close\r\n\r\n" + ); + stream + .write_all(req.as_bytes()) + .map_err(|err| err.to_string())?; + let mut buf = [0u8; 128]; + let _ = stream.read(&mut buf); + Ok(()) +} + +#[cfg(windows)] +fn force_kill(pid: u32) { + const TERMINATE: u32 = 0x0001; + unsafe { + let handle = OpenProcess(TERMINATE, 0, pid); + if !handle.is_null() { + TerminateProcess(handle, 1); + CloseHandle(handle); + } + } +} + +#[cfg(not(windows))] +fn force_kill(pid: u32) { + let _ = Command::new("kill").args(["-9", &pid.to_string()]).status(); +} + +fn wait_dead(pid: u32) -> bool { + for _ in 0..30 { + if !pid_alive(pid) { + return true; + } + std::thread::sleep(Duration::from_millis(100)); + } + false +} + +#[cfg(windows)] +fn autostart_command(exe: &Path) -> String { + format!("\"{}\"", exe.display()) +} + +#[cfg(windows)] +fn autostart_key() -> Result { + use winreg::enums::{HKEY_CURRENT_USER, KEY_READ, KEY_WRITE}; + use winreg::RegKey; + let hkcu = RegKey::predef(HKEY_CURRENT_USER); + hkcu.open_subkey_with_flags( + "Software\\Microsoft\\Windows\\CurrentVersion\\Run", + KEY_READ | KEY_WRITE, + ) + .map_err(|err| err.to_string()) +} + +#[tauri::command] +fn agent_endpoint() -> Endpoint { + endpoint() +} + +#[tauri::command] +fn start_agent(app: tauri::AppHandle) -> Result<(), String> { + if endpoint().running { + return Ok(()); + } + let exe = find_agent(&app).ok_or("找不到被控程序")?; + spawn_detached(&exe)?; + for _ in 0..40 { + if endpoint().running { + return Ok(()); + } + std::thread::sleep(Duration::from_millis(100)); + } + Err("被控没有启动".into()) +} + +#[tauri::command] +fn stop_agent() -> Result<(), String> { + let Some(info) = read_file() else { + return Ok(()); + }; + if !pid_alive(info.pid) { + return Ok(()); + } + let _ = http_stop(&info.addr, &info.token); + if !wait_dead(info.pid) { + force_kill(info.pid); + let _ = wait_dead(info.pid); + } + Ok(()) +} + +#[tauri::command] +fn autostart_get() -> bool { + #[cfg(windows)] + { + let Ok(key) = autostart_key() else { + return false; + }; + return key.get_value::("TapRemly").is_ok(); + } + #[cfg(target_os = "macos")] + { + return macos_plist().is_file(); + } + #[cfg(all(not(windows), not(target_os = "macos")))] + { + linux_desktop().is_file() + } +} + +#[tauri::command] +fn autostart_set(app: tauri::AppHandle, enable: bool) -> Result<(), String> { + let exe = find_agent(&app).ok_or("找不到被控程序")?; + #[cfg(windows)] + { + let key = autostart_key()?; + if enable { + key.set_value("TapRemly", &autostart_command(&exe)) + .map_err(|err| err.to_string())?; + } else { + match key.delete_value("TapRemly") { + Ok(()) => {} + Err(err) if err.kind() == std::io::ErrorKind::NotFound => {} + Err(err) => return Err(err.to_string()), + } + } + return Ok(()); + } + #[cfg(target_os = "macos")] + { + let path = macos_plist(); + if enable { + if let Some(dir) = path.parent() { + fs::create_dir_all(dir).map_err(|err| err.to_string())?; + } + let body = format!( + r#" + + +Labelasia.asio.tapremly.agent +ProgramArguments{} +RunAtLoad +LimitLoadToSessionTypeAqua + +"#, + exe.display() + ); + fs::write(path, body).map_err(|err| err.to_string())?; + } else if path.exists() { + fs::remove_file(path).map_err(|err| err.to_string())?; + } + return Ok(()); + } + #[cfg(all(not(windows), not(target_os = "macos")))] + { + let path = linux_desktop(); + if enable { + if let Some(dir) = path.parent() { + fs::create_dir_all(dir).map_err(|err| err.to_string())?; + } + let body = format!( + "[Desktop Entry]\nType=Application\nName=TapRemly\nExec={}\nX-GNOME-Autostart-enabled=true\nNoDisplay=true\n", + exe.display() + ); + fs::write(path, body).map_err(|err| err.to_string())?; + } else if path.exists() { + fs::remove_file(path).map_err(|err| err.to_string())?; + } + Ok(()) + } +} + +#[cfg(target_os = "macos")] +fn macos_plist() -> PathBuf { + let home = std::env::var("HOME").unwrap_or_default(); + PathBuf::from(home) + .join("Library") + .join("LaunchAgents") + .join("asia.asio.tapremly.agent.plist") +} + +#[cfg(all(not(windows), not(target_os = "macos")))] +fn linux_desktop() -> PathBuf { + let home = std::env::var("HOME").unwrap_or_default(); + let dir = std::env::var("XDG_CONFIG_HOME").unwrap_or_else(|_| format!("{home}/.config")); + PathBuf::from(dir) + .join("autostart") + .join("tapremly-agent.desktop") +} + +#[cfg_attr(mobile, tauri::mobile_entry_point)] +pub fn run() { + tauri::Builder::default() + .invoke_handler(tauri::generate_handler![ + agent_endpoint, + start_agent, + stop_agent, + autostart_get, + autostart_set + ]) + .run(tauri::generate_context!()) + .expect("启动失败"); +} diff --git a/ui/src-tauri/src/main.rs b/ui/src-tauri/src/main.rs new file mode 100644 index 0000000..5957e0d --- /dev/null +++ b/ui/src-tauri/src/main.rs @@ -0,0 +1,5 @@ +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +fn main() { + tapremly_lib::run(); +} diff --git a/ui/src-tauri/tauri.conf.json b/ui/src-tauri/tauri.conf.json new file mode 100644 index 0000000..f64ee88 --- /dev/null +++ b/ui/src-tauri/tauri.conf.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.tauri.app/config/2", + "productName": "TapRemly", + "version": "0.1.0", + "identifier": "asia.asio.tapremly", + "build": { + "beforeDevCommand": "pnpm dev", + "devUrl": "http://127.0.0.1:1420", + "beforeBuildCommand": "pnpm build", + "frontendDist": "../dist" + }, + "app": { + "windows": [ + { + "label": "main", + "title": "TapRemly", + "width": 1180, + "height": 780, + "minWidth": 960, + "minHeight": 640, + "resizable": true + } + ], + "security": { + "csp": null + } + }, + "bundle": { + "active": true, + "targets": ["nsis"], + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ], + "resources": { + "../../agent/tapremly-agent.exe": "tapremly-agent.exe" + } + } +} diff --git a/ui/src/App.vue b/ui/src/App.vue new file mode 100644 index 0000000..ab5694e --- /dev/null +++ b/ui/src/App.vue @@ -0,0 +1,25 @@ + + + diff --git a/ui/src/Shell.vue b/ui/src/Shell.vue new file mode 100644 index 0000000..f136344 --- /dev/null +++ b/ui/src/Shell.vue @@ -0,0 +1,129 @@ + + + diff --git a/ui/src/api.ts b/ui/src/api.ts new file mode 100644 index 0000000..0cb7da7 --- /dev/null +++ b/ui/src/api.ts @@ -0,0 +1,118 @@ +import { invoke } from '@tauri-apps/api/core' + +export class ApiError extends Error {} + +interface Endpoint { + running: boolean + addr: string + token: string + pid: number +} + +let cache: Endpoint | null = null + +function inTauri() { + return typeof window !== 'undefined' && '__TAURI_INTERNALS__' in window +} + +async function readEndpoint(): Promise { + if (inTauri()) { + const info = await invoke('agent_endpoint') + return info.running ? info : null + } + if (!import.meta.env.DEV) return null + const res = await fetch('/__agent') + if (!res.ok) return null + const info = (await res.json()) as Endpoint + return info.running ? info : null +} + +export async function connectAgent(force = false) { + if (!force && cache?.running) return true + cache = await readEndpoint() + return !!cache +} + +export function agentRunning() { + return !!cache?.running +} + +export async function api(path: string, init: RequestInit = {}, allowRetry = true): Promise { + const ready = await connectAgent(!cache) + if (!ready || !cache) throw new ApiError('被控未运行') + let res: Response + try { + res = await fetch(`http://${cache.addr}${path}`, { + ...init, + headers: { + ...(init.body ? { 'Content-Type': 'application/json' } : {}), + Authorization: `Bearer ${cache.token}`, + ...(init.headers || {}), + }, + }) + } catch (err) { + cache = null + if (allowRetry) return api(path, init, false) + throw new ApiError('被控未运行') + } + if (res.status === 401 && allowRetry) { + cache = null + return api(path, init, false) + } + const text = await res.text() + let data: { error?: string } = {} + if (text) { + try { + data = JSON.parse(text) as { error?: string } + } catch { + throw new ApiError('没有成功') + } + } + if (!res.ok) throw new ApiError(data.error || '没有成功') + return data as T +} + +export async function startAgent() { + if (inTauri()) { + await invoke('start_agent') + } else if (import.meta.env.DEV) { + const res = await fetch('/__agent/start', { method: 'POST' }) + if (!res.ok) throw new ApiError('找不到被控程序') + for (let i = 0; i < 40; i++) { + await new Promise((r) => setTimeout(r, 100)) + if (await connectAgent(true)) return + } + throw new ApiError('被控没有启动') + } else { + throw new ApiError('请从桌面图标打开') + } + cache = null + await connectAgent(true) +} + +export async function stopAgent() { + if (inTauri()) { + await invoke('stop_agent') + } else { + try { + await api('/v1/stop', { method: 'POST' }, false) + } catch { + await fetch('/__agent/stop', { method: 'POST' }).catch(() => undefined) + } + } + cache = null +} + +export async function autostartGet() { + if (!inTauri()) return false + return invoke('autostart_get') +} + +export async function autostartSet(enable: boolean) { + if (!inTauri()) throw new ApiError('请使用桌面上的程序设置开机启动') + await invoke('autostart_set', { enable }) +} + +export function canAutostart() { + return inTauri() +} diff --git a/ui/src/components/CopyDialog.vue b/ui/src/components/CopyDialog.vue new file mode 100644 index 0000000..39d67ba --- /dev/null +++ b/ui/src/components/CopyDialog.vue @@ -0,0 +1,48 @@ + + + diff --git a/ui/src/components/DeviceList.vue b/ui/src/components/DeviceList.vue new file mode 100644 index 0000000..4ef1621 --- /dev/null +++ b/ui/src/components/DeviceList.vue @@ -0,0 +1,210 @@ + + + diff --git a/ui/src/components/HelpTip.vue b/ui/src/components/HelpTip.vue new file mode 100644 index 0000000..7bcbeaa --- /dev/null +++ b/ui/src/components/HelpTip.vue @@ -0,0 +1,14 @@ + + + diff --git a/ui/src/components/HostDialog.vue b/ui/src/components/HostDialog.vue new file mode 100644 index 0000000..4132430 --- /dev/null +++ b/ui/src/components/HostDialog.vue @@ -0,0 +1,207 @@ + + + diff --git a/ui/src/components/ShortcutDialog.vue b/ui/src/components/ShortcutDialog.vue new file mode 100644 index 0000000..9b89860 --- /dev/null +++ b/ui/src/components/ShortcutDialog.vue @@ -0,0 +1,56 @@ + + + diff --git a/ui/src/main.ts b/ui/src/main.ts new file mode 100644 index 0000000..e18e6cc --- /dev/null +++ b/ui/src/main.ts @@ -0,0 +1,7 @@ +import { createApp } from 'vue' +import { createPinia } from 'pinia' +import App from './App.vue' +import router from './router' +import './styles.css' + +createApp(App).use(createPinia()).use(router).mount('#app') diff --git a/ui/src/router.ts b/ui/src/router.ts new file mode 100644 index 0000000..5bca3f9 --- /dev/null +++ b/ui/src/router.ts @@ -0,0 +1,13 @@ +import { createRouter, createWebHistory } from 'vue-router' +import DevicePane from './views/DevicePane.vue' +import TrustView from './views/TrustView.vue' +import CommandsView from './views/CommandsView.vue' + +export default createRouter({ + history: createWebHistory(), + routes: [ + { path: '/', component: DevicePane }, + { path: '/trust', component: TrustView }, + { path: '/commands', component: CommandsView }, + ], +}) diff --git a/ui/src/stores/app.ts b/ui/src/stores/app.ts new file mode 100644 index 0000000..0e22a29 --- /dev/null +++ b/ui/src/stores/app.ts @@ -0,0 +1,139 @@ +import { computed, ref } from 'vue' +import { defineStore } from 'pinia' +import { api, autostartGet, connectAgent } from '../api' +import type { CmdResult, Device, Group, InboxItem, Status } from '../types' + +export const useAppStore = defineStore('app', () => { + const running = ref(false) + const connText = ref('未连接') + const endpointId = ref('') + const loggedIn = ref(false) + const serverUrl = ref('http://127.0.0.1:8080') + const nixUrl = ref('ws://127.0.0.1:7443/mqtt') + const accountUser = ref('') + const maxTtl = ref(2592000) + const maxSchedule = ref(31536000) + const autostart = ref(false) + const devices = ref([]) + const groups = ref([]) + const deviceError = ref('') + const selectedId = ref('') + const inbox = ref([]) + const results = ref([]) + const untrusted = ref>({}) + + const selected = computed(() => devices.value.find((item) => item.id === selectedId.value) || null) + + function nameOf(endpoint: string) { + return devices.value.find((item) => item.endpoint_id === endpoint)?.name || endpoint + } + + async function refreshStatus() { + const alive = await connectAgent(true) + running.value = alive + if (!alive) { + connText.value = '未连接' + return + } + const status = await api('/v1/status') + connText.value = status.conn_text || '未连接' + endpointId.value = status.endpoint_id || '' + loggedIn.value = status.logged_in + serverUrl.value = status.server_url || serverUrl.value + nixUrl.value = status.nixmsg_url || nixUrl.value + accountUser.value = status.account_user || '' + maxTtl.value = status.max_ttl_seconds || 2592000 + maxSchedule.value = status.max_schedule_seconds || 31536000 + } + + async function refreshDevices() { + if (!running.value) { + devices.value = [] + groups.value = [] + deviceError.value = '' + return + } + try { + const [deviceRes, groupRes] = await Promise.all([ + api<{ items: Device[] }>('/v1/devices'), + api<{ items: Group[] }>('/v1/groups'), + ]) + devices.value = deviceRes.items || [] + groups.value = groupRes.items || [] + deviceError.value = '' + if (selectedId.value && !devices.value.some((item) => item.id === selectedId.value)) { + selectedId.value = '' + } + } catch (err) { + devices.value = [] + groups.value = [] + deviceError.value = err instanceof Error ? err.message : '没有成功' + } + } + + async function refreshInbox() { + if (!running.value) { + inbox.value = [] + return + } + const res = await api<{ items: InboxItem[] }>('/v1/inbox') + inbox.value = res.items || [] + } + + async function refreshResults() { + if (!running.value) return + const res = await api<{ items: CmdResult[] }>('/v1/results') + const next = { ...untrusted.value } + for (const item of res.items || []) { + if (item.error === 'not_trusted') next[item.remote] = true + else if (item.ok) next[item.remote] = false + } + untrusted.value = next + results.value = res.items || [] + } + + async function refreshAutostart() { + try { + autostart.value = await autostartGet() + } catch { + autostart.value = false + } + } + + async function tick() { + try { + await refreshStatus() + if (!running.value) return + await Promise.all([refreshDevices(), refreshInbox(), refreshResults()]) + } catch { + running.value = false + } + } + + return { + running, + connText, + endpointId, + loggedIn, + serverUrl, + nixUrl, + accountUser, + maxTtl, + maxSchedule, + autostart, + devices, + groups, + deviceError, + selectedId, + selected, + inbox, + results, + untrusted, + nameOf, + refreshStatus, + refreshDevices, + refreshInbox, + refreshAutostart, + tick, + } +}) diff --git a/ui/src/styles.css b/ui/src/styles.css new file mode 100644 index 0000000..ee5a583 --- /dev/null +++ b/ui/src/styles.css @@ -0,0 +1,342 @@ +html, +body, +#app { + height: 100%; + margin: 0; + overflow: hidden; + color: #1f2933; + background: #f3f5f7; +} + +button, +input, +textarea { + font: inherit; +} + +.shell { + height: 100%; + display: grid; + grid-template-rows: 52px minmax(0, 1fr); +} + +.topbar { + display: flex; + align-items: center; + gap: 10px; + padding: 0 14px; + background: #fff; + border-bottom: 1px solid #e4e7eb; +} + +.brand { + font-size: 16px; + font-weight: 650; + letter-spacing: 0.2px; +} + +.top-status { + color: #52606d; + font-size: 13px; + min-width: 4em; +} + +.spacer { + flex: 1; +} + +.body { + display: grid; + grid-template-columns: 300px minmax(0, 1fr); + min-height: 0; +} + +.pane { + min-height: 0; + min-width: 0; +} + +.list { + height: 100%; + display: flex; + flex-direction: column; + background: #fff; + border-right: 1px solid #e4e7eb; +} + +.list-head, +.page-head, +.section-head, +.trust-head { + display: flex; + align-items: center; + gap: 8px; + min-height: 48px; + padding: 8px 12px; +} + +.list-head { + border-bottom: 1px solid #eef0f2; +} + +.list-title, +.page-title, +.section-title { + font-size: 15px; + font-weight: 650; +} + +.list-search { + padding: 8px 12px 4px; +} + +.list-scroll, +.page-scroll, +.trust-scroll, +.drawer-scroll { + min-height: 0; + overflow: auto; +} + +.list-scroll { + flex: 1; + padding: 4px 8px 16px; +} + +.group-head { + display: flex; + align-items: center; + gap: 6px; + margin: 10px 4px 4px; + color: #52606d; + font-size: 12px; +} + +.group-name { + font-weight: 650; +} + +.device-row, +.sc-row, +.trust-row, +.log-row, +.msg-row { + display: flex; + align-items: center; + gap: 8px; + border-radius: 8px; +} + +.device-row { + width: 100%; + text-align: left; + border: 0; + background: transparent; + padding: 8px 10px; + cursor: pointer; +} + +.device-row:hover, +.sc-row:hover, +.trust-row:hover { + background: #f4f7f8; +} + +.device-row.active { + background: #e7f3f6; +} + +.device-main { + min-width: 0; + flex: 1; +} + +.device-name, +.sc-name, +.msg-text { + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.device-id, +.sc-shell, +.muted { + color: #7b8794; + font-size: 12px; +} + +.pill { + flex: none; + font-size: 12px; + border-radius: 999px; + padding: 1px 8px; +} + +.pill.online { + color: #0f6b3a; + background: #e5f6ec; +} + +.pill.offline, +.pill.unknown { + color: #52606d; + background: #eef0f2; +} + +.empty { + margin: 28px 16px; + color: #52606d; + line-height: 1.6; +} + +.page { + height: 100%; + display: flex; + flex-direction: column; + min-height: 0; +} + +.page-head { + background: #fff; + border-bottom: 1px solid #eef0f2; +} + +.send { + flex: none; + background: #fff; + padding: 12px 16px 10px; + border-bottom: 1px solid #e4e7eb; +} + +.send-line { + display: flex; + align-items: center; + gap: 12px; + margin-top: 8px; + flex-wrap: wrap; +} + +.send-line .grow { + flex: 1; +} + +.warn { + margin-top: 8px; + color: #9a3412; + font-size: 13px; +} + +.hint { + margin-top: 6px; + color: #52606d; + font-size: 12px; +} + +.bad { + color: #b42318; + font-size: 12px; +} + +.page-scroll { + flex: 1; + padding: 8px 16px 24px; +} + +.section { + margin-top: 8px; +} + +.section-head { + padding-left: 0; + padding-right: 0; +} + +.sc-row { + padding: 8px 10px; + cursor: pointer; +} + +.sc-name { + flex: none; + max-width: 40%; + font-weight: 600; +} + +.sc-shell { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.help { + width: 16px; + height: 16px; + padding: 0; + border: 1px solid #c5ced6; + border-radius: 50%; + background: #fff; + color: #52606d; + font-size: 11px; + line-height: 14px; + cursor: help; +} + +.modal-body { + max-height: min(62vh, 520px); + overflow: auto; + padding-right: 2px; +} + +.modal-actions, +.row-actions { + display: flex; + justify-content: flex-end; + gap: 8px; +} + +.trust, +.commands { + height: 100%; + display: flex; + flex-direction: column; + min-height: 0; + background: #f3f5f7; +} + +.trust-scroll, +.commands .page-scroll { + flex: 1; + padding: 4px 16px 12px; +} + +.trust-add { + flex: none; + display: flex; + gap: 8px; + padding: 12px 16px; + background: #fff; + border-top: 1px solid #e4e7eb; +} + +.trust-row, +.log-row, +.msg-row { + padding: 8px 0; + border-bottom: 1px solid #eef0f2; +} + +.log-row, +.msg-row { + align-items: flex-start; + flex-direction: column; + gap: 2px; +} + +.inline { + display: flex; + align-items: center; + gap: 6px; +} diff --git a/ui/src/types.ts b/ui/src/types.ts new file mode 100644 index 0000000..99c17a6 --- /dev/null +++ b/ui/src/types.ts @@ -0,0 +1,91 @@ +export interface Device { + id: string + name: string + endpoint_id: string + group_id: string + online: boolean + presence: 'online' | 'offline' | 'unknown' | string +} + +export interface Group { + id: string + name: string +} + +export interface Shortcut { + id: string + name: string + shell: string + confirm: boolean + remote_id?: string +} + +export interface Status { + running: boolean + conn: string + conn_text: string + endpoint_id: string + logged_in: boolean + server_url: string + nixmsg_url: string + account_user: string + has_device_token: boolean + max_ttl_seconds: number + max_schedule_seconds: number +} + +export interface InboxItem { + id: string + from: string + text: string + at: string + read: boolean +} + +export interface CmdResult { + id: string + remote: string + ok: boolean + error?: string + duplicate?: boolean + at: string +} + +export interface LogItem { + at: string + summary: string + ok: boolean + detail: string +} + +export interface RemoteShortcuts { + items: Shortcut[] + synced_at: string + syncing: boolean +} + +export interface RemoteLogs { + items: LogItem[] + synced_at: string + syncing: boolean + error?: string + server_items: LogItem[] +} + +export function presenceText(value: string) { + if (value === 'online') return '在线' + if (value === 'offline') return '不在线' + return '未知' +} + +export function formatTime(iso: string) { + if (!iso) return '' + const date = new Date(iso) + if (Number.isNaN(date.getTime())) return '' + return date.toLocaleString('zh-CN', { + month: 'numeric', + day: 'numeric', + hour: '2-digit', + minute: '2-digit', + }) +} diff --git a/ui/src/views/CommandsView.vue b/ui/src/views/CommandsView.vue new file mode 100644 index 0000000..38b4d96 --- /dev/null +++ b/ui/src/views/CommandsView.vue @@ -0,0 +1,109 @@ + + + diff --git a/ui/src/views/DevicePane.vue b/ui/src/views/DevicePane.vue new file mode 100644 index 0000000..5bedf14 --- /dev/null +++ b/ui/src/views/DevicePane.vue @@ -0,0 +1,425 @@ + + + diff --git a/ui/src/views/TrustView.vue b/ui/src/views/TrustView.vue new file mode 100644 index 0000000..a46c524 --- /dev/null +++ b/ui/src/views/TrustView.vue @@ -0,0 +1,68 @@ + + + diff --git a/ui/tsconfig.json b/ui/tsconfig.json new file mode 100644 index 0000000..c48f618 --- /dev/null +++ b/ui/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "useDefineForClassFields": true, + "module": "ESNext", + "moduleResolution": "bundler", + "strict": true, + "jsx": "preserve", + "resolveJsonModule": true, + "isolatedModules": true, + "esModuleInterop": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + "noEmit": true, + "types": ["node"] + }, + "include": ["src/**/*.ts", "src/**/*.vue", "env.d.ts"] +} diff --git a/ui/tsconfig.node.json b/ui/tsconfig.node.json new file mode 100644 index 0000000..4ec5a56 --- /dev/null +++ b/ui/tsconfig.node.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "strict": true, + "skipLibCheck": true, + "noEmit": true, + "types": ["node"] + }, + "include": ["vite.config.ts"] +} diff --git a/ui/vite.config.ts b/ui/vite.config.ts new file mode 100644 index 0000000..c4172ab --- /dev/null +++ b/ui/vite.config.ts @@ -0,0 +1,82 @@ +import { defineConfig, type Plugin } from 'vite' +import vue from '@vitejs/plugin-vue' +import fs from 'node:fs' +import os from 'node:os' +import path from 'node:path' +import { spawn } from 'node:child_process' +import { fileURLToPath } from 'node:url' + +const here = path.dirname(fileURLToPath(import.meta.url)) + +function agentFile() { + if (process.env.TAPREMLY_HOME) return path.join(process.env.TAPREMLY_HOME, 'agent.json') + const local = process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local') + return path.join(local, 'TapRemly', 'agent.json') +} + +function alive(pid: number) { + if (!pid) return false + try { + process.kill(pid, 0) + return true + } catch (err) { + return (err as NodeJS.ErrnoException).code === 'EPERM' + } +} + +function readInfo() { + try { + const info = JSON.parse(fs.readFileSync(agentFile(), 'utf8')) as { addr?: string; token?: string; pid?: number } + const pid = Number(info.pid || 0) + if (!info.addr || !info.token || !alive(pid)) return { running: false, addr: '', token: '', pid: 0 } + return { running: true, addr: info.addr, token: info.token, pid } + } catch { + return { running: false, addr: '', token: '', pid: 0 } + } +} + +function agentDev(): Plugin { + return { + name: 'tapremly-agent-dev', + configureServer(server) { + server.middlewares.use('/__agent', (req, res) => { + if (req.method === 'POST' && req.url?.startsWith('/start')) { + const exe = path.resolve(here, '../agent/tapremly-agent.exe') + if (!fs.existsSync(exe)) { + res.statusCode = 404 + res.end('找不到被控程序') + return + } + const child = spawn(exe, [], { detached: true, stdio: 'ignore', windowsHide: true }) + child.unref() + res.end('ok') + return + } + if (req.method === 'POST' && req.url?.startsWith('/stop')) { + const info = readInfo() + if (info.running) { + fetch(`http://${info.addr}/v1/stop`, { + method: 'POST', + headers: { Authorization: `Bearer ${info.token}` }, + }).catch(() => undefined) + } + res.end('ok') + return + } + res.setHeader('content-type', 'application/json') + res.end(JSON.stringify(readInfo())) + }) + }, + } +} + +export default defineConfig({ + plugins: [vue(), agentDev()], + clearScreen: false, + server: { + host: '127.0.0.1', + port: 1420, + strictPort: true, + }, + envPrefix: ['VITE_', 'TAURI_'], +})