(req dto.AgentPluginCheckReq)
| 537 | } |
| 538 | |
| 539 | func (a AgentService) CheckPlugin(req dto.AgentPluginCheckReq) (*dto.AgentPluginStatus, error) { |
| 540 | _, install, err := a.loadAgentAndInstall(req.AgentID) |
| 541 | if err != nil { |
| 542 | return nil, err |
| 543 | } |
| 544 | installed, err := checkPluginInstalled(install.GetPath(), req.Type) |
| 545 | if err != nil { |
| 546 | return nil, err |
| 547 | } |
| 548 | status := &dto.AgentPluginStatus{Installed: installed} |
| 549 | if !installed { |
| 550 | return status, nil |
| 551 | } |
| 552 | currentVersion, err := loadOpenclawPluginCurrentVersion(install.GetPath(), req.Type) |
| 553 | if err != nil { |
| 554 | global.LOG.Errorf("load openclaw plugin current version failed: %v", err) |
| 555 | return status, nil |
| 556 | } |
| 557 | status.CurrentVersion = currentVersion |
| 558 | if !req.CheckLatest { |
| 559 | return status, nil |
| 560 | } |
| 561 | latestVersion, err := loadOpenclawPluginLatestVersion(install.ContainerName, req.Type) |
| 562 | if err != nil { |
| 563 | global.LOG.Errorf("load openclaw plugin latest version failed: %v", err) |
| 564 | return status, nil |
| 565 | } |
| 566 | status.LatestVersion = latestVersion |
| 567 | if currentVersion != "" && latestVersion != "" { |
| 568 | status.Upgradable = common.CompareVersion(latestVersion, currentVersion) |
| 569 | } |
| 570 | return status, nil |
| 571 | } |
| 572 | |
| 573 | func (a AgentService) ApproveChannelPairing(req dto.AgentChannelPairingApproveReq) error { |
| 574 | agent, install, err := a.loadAgentAndInstall(req.AgentID) |
nothing calls this directly
no test coverage detected