mirror of
https://github.com/theniceboy/.config.git
synced 2026-07-16 22:01:21 +08:00
agent tracker + tmux config update
This commit is contained in:
parent
83d01d4a91
commit
cf365fc124
9 changed files with 628 additions and 145 deletions
|
|
@ -75,7 +75,8 @@ type statusRightConfig struct {
|
|||
Memory *bool `json:"memory,omitempty"`
|
||||
MemoryTotals *bool `json:"memory_totals,omitempty"`
|
||||
Agent *bool `json:"agent,omitempty"`
|
||||
Notes *bool `json:"notes,omitempty"`
|
||||
TodoPreview *bool `json:"todo_preview,omitempty"`
|
||||
Todos *bool `json:"todos,omitempty"`
|
||||
FlashMoe *bool `json:"flash_moe,omitempty"`
|
||||
Host *bool `json:"host,omitempty"`
|
||||
}
|
||||
|
|
@ -2611,7 +2612,17 @@ func loadRegistry() (*registry, error) {
|
|||
return nil, err
|
||||
}
|
||||
if err := json.Unmarshal(data, reg); err != nil {
|
||||
return nil, err
|
||||
fallback := ®istry{Agents: map[string]*agentRecord{}}
|
||||
dec := json.NewDecoder(strings.NewReader(string(data)))
|
||||
if decodeErr := dec.Decode(fallback); decodeErr != nil {
|
||||
return nil, err
|
||||
}
|
||||
trailing := strings.TrimSpace(string(data[int(dec.InputOffset()):]))
|
||||
if trailing == "" || strings.Trim(trailing, "}") != "" {
|
||||
return nil, err
|
||||
}
|
||||
reg = fallback
|
||||
_ = saveRegistry(reg)
|
||||
}
|
||||
if reg.Agents == nil {
|
||||
reg.Agents = map[string]*agentRecord{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue