MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / CheckPlugin

Method CheckPlugin

agent/app/service/agents_channels.go:539–571  ·  view source on GitHub ↗
(req dto.AgentPluginCheckReq)

Source from the content-addressed store, hash-verified

537}
538
539func (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
573func (a AgentService) ApproveChannelPairing(req dto.AgentChannelPairingApproveReq) error {
574 agent, install, err := a.loadAgentAndInstall(req.AgentID)

Callers

nothing calls this directly

Calls 5

loadAgentAndInstallMethod · 0.95
checkPluginInstalledFunction · 0.85
GetPathMethod · 0.45

Tested by

no test coverage detected