mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-28 19:51:11 +00:00
refactor(git): Restructure git helpers with dataclasses and add remote update checking
Replace get_git_info implementation with structured dataclass-based approach. Add GitHeadInfo, GitReleaseInfo, GitRemoteReleaseInfo, GitRemoteReleasesResult, GitRemoteCommitsInfo, GitRepoReleaseInfo, and PluginUpdateInfo dataclasses. Implement get_remote_releases to query GitHub tags, get_remote_commits_since_local to check for upstream commits, get_repo_release_info to extract repository metadata, and update
This commit is contained in:
parent
4cce1e265c
commit
482fa42d98
7 changed files with 858 additions and 73 deletions
|
|
@ -7,6 +7,7 @@ from plugins._plugin_installer.helpers.install import (
|
|||
get_marketplace_index,
|
||||
install_from_git,
|
||||
install_uploaded_zip,
|
||||
update_from_git,
|
||||
)
|
||||
|
||||
class PluginInstall(ApiHandler):
|
||||
|
|
@ -20,6 +21,8 @@ class PluginInstall(ApiHandler):
|
|||
return self._install_zip(request)
|
||||
elif action == "install_git":
|
||||
return self._install_git(input)
|
||||
elif action == "update_plugin":
|
||||
return self._update_git(input)
|
||||
elif action == "fetch_index":
|
||||
return self._fetch_index(input)
|
||||
else:
|
||||
|
|
@ -48,5 +51,8 @@ class PluginInstall(ApiHandler):
|
|||
|
||||
return install_from_git(url=git_url, token=git_token, plugin_name=plugin_name)
|
||||
|
||||
def _update_git(self, input: dict) -> dict:
|
||||
return update_from_git(input.get("plugin_name", ""))
|
||||
|
||||
def _fetch_index(self, input: dict) -> dict:
|
||||
return {"success": True, **get_marketplace_index()}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue