返回 DeepSeek-Reasonix
host_command_owners.go
根目录 / desktop / host_command_owners.go
1 package main
2
3 import (
4 _ "embed"
5 "encoding/json"
6
7 "reasonix/desktop/internal/hostrpc"
8 )
9
10 const hostCommandOwnersFile = "host_command_owners.generated.json"
11
12 //go:embed host_command_owners.generated.json
13 var hostCommandOwnersJSON []byte
14
15 func newDesktopRegistry(app *App) (*hostrpc.Registry, error) {
16 var owners map[string]hostrpc.CommandOwnership
17 if err := json.Unmarshal(hostCommandOwnersJSON, &owners); err != nil {
18 return nil, err
19 }
20 return hostrpc.NewRegistryWithOwners(app, nil, owners)
21 }
22
22 lines GO