swarmauri_toolkit_github 0.9.1.dev2__py3-none-any.whl → 0.11.0.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- swarmauri_toolkit_github/GithubBranchTool.py +11 -3
- swarmauri_toolkit_github/GithubCommitTool.py +12 -3
- swarmauri_toolkit_github/GithubIssueTool.py +12 -3
- swarmauri_toolkit_github/GithubPRTool.py +19 -4
- swarmauri_toolkit_github/GithubRepoTool.py +15 -4
- {swarmauri_toolkit_github-0.9.1.dev2.dist-info → swarmauri_toolkit_github-0.11.0.dev1.dist-info}/METADATA +12 -10
- swarmauri_toolkit_github-0.11.0.dev1.dist-info/RECORD +12 -0
- {swarmauri_toolkit_github-0.9.1.dev2.dist-info → swarmauri_toolkit_github-0.11.0.dev1.dist-info}/WHEEL +1 -1
- swarmauri_toolkit_github-0.9.1.dev2.dist-info/RECORD +0 -12
- {swarmauri_toolkit_github-0.9.1.dev2.dist-info → swarmauri_toolkit_github-0.11.0.dev1.dist-info}/entry_points.txt +0 -0
- {swarmauri_toolkit_github-0.9.1.dev2.dist-info → swarmauri_toolkit_github-0.11.0.dev1.dist-info}/licenses/LICENSE +0 -0
|
@@ -16,13 +16,19 @@ class GithubBranchTool(ToolBase):
|
|
|
16
16
|
Parameter(
|
|
17
17
|
name="action",
|
|
18
18
|
input_type="string",
|
|
19
|
-
description=
|
|
19
|
+
description=(
|
|
20
|
+
"The action to perform on the GitHub API, e.g., "
|
|
21
|
+
"'create_repo', 'delete_repo', 'create_issue', etc."
|
|
22
|
+
),
|
|
20
23
|
required=True,
|
|
21
24
|
),
|
|
22
25
|
Parameter(
|
|
23
26
|
name="repo_name",
|
|
24
27
|
input_type="string",
|
|
25
|
-
description=
|
|
28
|
+
description=(
|
|
29
|
+
"The full name of the repository to interact with, e.g. "
|
|
30
|
+
"'owner/repository'."
|
|
31
|
+
),
|
|
26
32
|
required=True,
|
|
27
33
|
),
|
|
28
34
|
Parameter(
|
|
@@ -34,7 +40,9 @@ class GithubBranchTool(ToolBase):
|
|
|
34
40
|
Parameter(
|
|
35
41
|
name="source_branch",
|
|
36
42
|
input_type="string",
|
|
37
|
-
description=
|
|
43
|
+
description=(
|
|
44
|
+
"The name of the source branch to create a branch from."
|
|
45
|
+
),
|
|
38
46
|
required=False,
|
|
39
47
|
),
|
|
40
48
|
]
|
|
@@ -14,19 +14,28 @@ class GithubCommitTool(ToolBase):
|
|
|
14
14
|
Parameter(
|
|
15
15
|
name="action",
|
|
16
16
|
input_type="string",
|
|
17
|
-
description=
|
|
17
|
+
description=(
|
|
18
|
+
"The action to perform on the GitHub API, e.g., "
|
|
19
|
+
"'create_repo', 'delete_repo', 'create_issue', etc."
|
|
20
|
+
),
|
|
18
21
|
required=True,
|
|
19
22
|
),
|
|
20
23
|
Parameter(
|
|
21
24
|
name="repo_name",
|
|
22
25
|
input_type="string",
|
|
23
|
-
description=
|
|
26
|
+
description=(
|
|
27
|
+
"The full name of the repository to interact with, e.g. "
|
|
28
|
+
"'owner/repository'."
|
|
29
|
+
),
|
|
24
30
|
required=True,
|
|
25
31
|
),
|
|
26
32
|
Parameter(
|
|
27
33
|
name="file_path",
|
|
28
34
|
input_type="string",
|
|
29
|
-
description=
|
|
35
|
+
description=(
|
|
36
|
+
"The path to the file in the repository, e.g. "
|
|
37
|
+
"'path/to/file.txt'."
|
|
38
|
+
),
|
|
30
39
|
required=False,
|
|
31
40
|
),
|
|
32
41
|
Parameter(
|
|
@@ -14,13 +14,20 @@ class GithubIssueTool(ToolBase):
|
|
|
14
14
|
Parameter(
|
|
15
15
|
name="action",
|
|
16
16
|
input_type="string",
|
|
17
|
-
description=
|
|
17
|
+
description=(
|
|
18
|
+
"The action to perform on the GitHub API, e.g., "
|
|
19
|
+
"'create_issue', 'delete_issue', 'close_issue', "
|
|
20
|
+
"'list_issues', 'get_issue'"
|
|
21
|
+
),
|
|
18
22
|
required=True,
|
|
19
23
|
),
|
|
20
24
|
Parameter(
|
|
21
25
|
name="repo_name",
|
|
22
26
|
input_type="string",
|
|
23
|
-
description=
|
|
27
|
+
description=(
|
|
28
|
+
"The full name of the repository to interact with, e.g. "
|
|
29
|
+
"'owner/repository'."
|
|
30
|
+
),
|
|
24
31
|
required=False,
|
|
25
32
|
),
|
|
26
33
|
Parameter(
|
|
@@ -75,7 +82,9 @@ class GithubIssueTool(ToolBase):
|
|
|
75
82
|
raise ValueError(f"Action '{action}' is not supported.")
|
|
76
83
|
|
|
77
84
|
# Issue Management Methods
|
|
78
|
-
def create_issue(
|
|
85
|
+
def create_issue(
|
|
86
|
+
self, repo_name: str, title: str, body: str = None
|
|
87
|
+
) -> str:
|
|
79
88
|
try:
|
|
80
89
|
repo = self._github.get_repo(repo_name)
|
|
81
90
|
repo.create_issue(title=title, body=body)
|
|
@@ -14,13 +14,20 @@ class GithubPRTool(ToolBase):
|
|
|
14
14
|
Parameter(
|
|
15
15
|
name="action",
|
|
16
16
|
input_type="string",
|
|
17
|
-
description=
|
|
17
|
+
description=(
|
|
18
|
+
"The action to perform on the GitHub API, e.g., "
|
|
19
|
+
"'create_pull', 'merge_pull', 'close_pull', 'get_pull', "
|
|
20
|
+
"'list_pulls' etc."
|
|
21
|
+
),
|
|
18
22
|
required=True,
|
|
19
23
|
),
|
|
20
24
|
Parameter(
|
|
21
25
|
name="repo_name",
|
|
22
26
|
input_type="string",
|
|
23
|
-
description=
|
|
27
|
+
description=(
|
|
28
|
+
"The full name of the repository to interact with, e.g. "
|
|
29
|
+
"'owner/repository'."
|
|
30
|
+
),
|
|
24
31
|
required=False,
|
|
25
32
|
),
|
|
26
33
|
Parameter(
|
|
@@ -44,7 +51,10 @@ class GithubPRTool(ToolBase):
|
|
|
44
51
|
Parameter(
|
|
45
52
|
name="base",
|
|
46
53
|
input_type="string",
|
|
47
|
-
description=
|
|
54
|
+
description=(
|
|
55
|
+
"The base branch you're merging into, typically 'main' or "
|
|
56
|
+
"'master'"
|
|
57
|
+
),
|
|
48
58
|
required=False,
|
|
49
59
|
),
|
|
50
60
|
Parameter(
|
|
@@ -88,7 +98,12 @@ class GithubPRTool(ToolBase):
|
|
|
88
98
|
|
|
89
99
|
# Pull Request Management Methods
|
|
90
100
|
def create_pull(
|
|
91
|
-
self,
|
|
101
|
+
self,
|
|
102
|
+
repo_name: str,
|
|
103
|
+
title: str,
|
|
104
|
+
head: str,
|
|
105
|
+
base: str,
|
|
106
|
+
body: str = None,
|
|
92
107
|
) -> str:
|
|
93
108
|
try:
|
|
94
109
|
repo = self._github.get_repo(repo_name)
|
|
@@ -14,19 +14,30 @@ class GithubRepoTool(ToolBase):
|
|
|
14
14
|
Parameter(
|
|
15
15
|
name="action",
|
|
16
16
|
input_type="string",
|
|
17
|
-
description=
|
|
17
|
+
description=(
|
|
18
|
+
"The action to perform on the GitHub API, e.g., "(
|
|
19
|
+
"'create_repo', 'delete_repo', 'update_repo', and "
|
|
20
|
+
"'get_repo'"
|
|
21
|
+
)
|
|
22
|
+
),
|
|
18
23
|
required=True,
|
|
19
24
|
),
|
|
20
25
|
Parameter(
|
|
21
26
|
name="repo_name",
|
|
22
27
|
input_type="string",
|
|
23
|
-
description=
|
|
28
|
+
description=(
|
|
29
|
+
"The full name of the repository to interact with, e.g. "
|
|
30
|
+
"'owner/repository'."
|
|
31
|
+
),
|
|
24
32
|
required=False,
|
|
25
33
|
),
|
|
26
34
|
Parameter(
|
|
27
35
|
name="file_path",
|
|
28
36
|
input_type="string",
|
|
29
|
-
description=
|
|
37
|
+
description=(
|
|
38
|
+
"The path to the file in the repository, e.g. "
|
|
39
|
+
"'path/to/file.txt'."
|
|
40
|
+
),
|
|
30
41
|
required=False,
|
|
31
42
|
),
|
|
32
43
|
]
|
|
@@ -83,7 +94,7 @@ class GithubRepoTool(ToolBase):
|
|
|
83
94
|
def get_repo(self, repo_name: str) -> str:
|
|
84
95
|
try:
|
|
85
96
|
repo = self._github.get_repo(repo_name)
|
|
86
|
-
repo_info = f"Repository: {repo.full_name}\nDescription: {repo.description}\nClone URL: {repo.clone_url}"
|
|
97
|
+
repo_info = f"Repository: {repo.full_name}\nDescription: {repo.description}\nClone URL: {repo.clone_url}" # noqa: E501
|
|
87
98
|
return repo_info
|
|
88
99
|
except GithubException as e:
|
|
89
100
|
return f"Error retrieving repository info: {e}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: swarmauri_toolkit_github
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11.0.dev1
|
|
4
4
|
Summary: Github Toolkit
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -40,12 +40,12 @@ Description-Content-Type: text/markdown
|
|
|
40
40
|
<img src="https://img.shields.io/pypi/l/swarmauri_toolkit_github" alt="PyPI - License"/></a>
|
|
41
41
|
<a href="https://pypi.org/project/swarmauri_toolkit_github/">
|
|
42
42
|
<img src="https://img.shields.io/pypi/v/swarmauri_toolkit_github?label=swarmauri_toolkit_github&color=green" alt="PyPI - swarmauri_toolkit_github"/></a>
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
<a href="https://discord.gg/N4UpBuQv8T">
|
|
44
|
+
<img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
|
|
45
45
|
|
|
46
|
-
# Swarmauri Toolkit
|
|
46
|
+
# Swarmauri Toolkit ? GitHub
|
|
47
47
|
|
|
48
|
-
A Swarmauri toolkit that wraps PyGithub behind Swarmauri
|
|
48
|
+
A Swarmauri toolkit that wraps PyGithub behind Swarmauri?s agent/tool abstractions. Authenticate once and gain access to repository, issue, pull request, branch, and commit helpers?ready for scripted automation or conversational agents.
|
|
49
49
|
|
|
50
50
|
- Creates a shared GitHub client so every tool call reuses the same token and rate-limit state.
|
|
51
51
|
- Normalizes responses into dictionaries so downstream logic can inspect status messages or raw PyGithub payloads.
|
|
@@ -53,7 +53,7 @@ A Swarmauri toolkit that wraps PyGithub behind Swarmauri’s agent/tool abs
|
|
|
53
53
|
|
|
54
54
|
## Requirements
|
|
55
55
|
|
|
56
|
-
- Python 3.10
|
|
56
|
+
- Python 3.10 ? 3.13.
|
|
57
57
|
- GitHub personal access token (classic or fine-grained) with the scopes your workflow requires. Store it in an environment variable such as `GITHUB_TOKEN`.
|
|
58
58
|
- Runtime dependencies (`PyGithub`, `python-dotenv`, and the Swarmauri base/standard packages) install automatically with the toolkit.
|
|
59
59
|
|
|
@@ -83,7 +83,7 @@ uv add swarmauri_toolkit_github
|
|
|
83
83
|
uv pip install swarmauri_toolkit_github
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
> Tip: `python-dotenv` is imported automatically
|
|
86
|
+
> Tip: `python-dotenv` is imported automatically?drop your token into a local `.env` file (`GITHUB_TOKEN=ghp_...`) for quick experimentation.
|
|
87
87
|
|
|
88
88
|
## Quick Start
|
|
89
89
|
|
|
@@ -186,11 +186,13 @@ Keep a backlog tidy by automatically nudging stale tickets.
|
|
|
186
186
|
|
|
187
187
|
## Troubleshooting
|
|
188
188
|
|
|
189
|
-
- **`ValueError: Invalid Token or Missing api_token`**
|
|
190
|
-
- **PyGithub exception messages**
|
|
191
|
-
- **GitHub rate limits**
|
|
189
|
+
- **`ValueError: Invalid Token or Missing api_token`** ? Pass the token explicitly (`GithubToolkit(api_token=...)`) or export `GITHUB_TOKEN` before instantiating the toolkit.
|
|
190
|
+
- **PyGithub exception messages** ? Most actions bubble up PyGithub errors verbatim (permission issues, missing branches, etc.). Inspect the text in the returned string to resolve scope or naming problems.
|
|
191
|
+
- **GitHub rate limits** ? PyGithub tracks remaining requests; consider batching actions or sleeping when `Github.get_rate_limit()` indicates low headroom.
|
|
192
192
|
|
|
193
193
|
## License
|
|
194
194
|
|
|
195
195
|
`swarmauri_toolkit_github` is released under the Apache 2.0 License. See `LICENSE` for full details.
|
|
196
196
|
|
|
197
|
+
|
|
198
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
swarmauri_toolkit_github/GithubBranchTool.py,sha256=L2V-YvOAqumJo-wybSzMXlOnCdPNIOgbhQyCRDArzT8,4244
|
|
2
|
+
swarmauri_toolkit_github/GithubCommitTool.py,sha256=C8sqi74eFswJlltQiWdqd9D49qnwwPPsDiAJ2ctK3xo,5254
|
|
3
|
+
swarmauri_toolkit_github/GithubIssueTool.py,sha256=Cdv9-lvsUA3lU9vqOp2YGS4Oy4Q55HUJccc7fZPs5QQ,4656
|
|
4
|
+
swarmauri_toolkit_github/GithubPRTool.py,sha256=_SWEDNVDwSlvyimW7VZYkcCKAaQ6jb5oj-dsf-Hz6oQ,5265
|
|
5
|
+
swarmauri_toolkit_github/GithubRepoTool.py,sha256=I6ZmwFaEOicIJXkpqmlLTU1JtGugonBmRxgu2btqRro,4218
|
|
6
|
+
swarmauri_toolkit_github/GithubToolkit.py,sha256=gXLnqbHfNzMM979rDrRpioFnW20O8Qkw9IOVxsjmoP0,1852
|
|
7
|
+
swarmauri_toolkit_github/__init__.py,sha256=ugR4rSIjWjFsklYq1zKlDuNwi2ao9NnzEcgQdGAtVgY,836
|
|
8
|
+
swarmauri_toolkit_github-0.11.0.dev1.dist-info/METADATA,sha256=RXfPtdBL9bEUASk-kIhBN5rvny9qc5Izl-5Klec0QGc,7316
|
|
9
|
+
swarmauri_toolkit_github-0.11.0.dev1.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
|
|
10
|
+
swarmauri_toolkit_github-0.11.0.dev1.dist-info/entry_points.txt,sha256=2xC828KqwS3K-0qhlcdqbKhtoQhkzst3Y0i0KfCzXNI,467
|
|
11
|
+
swarmauri_toolkit_github-0.11.0.dev1.dist-info/licenses/LICENSE,sha256=djUXOlCxLVszShEpZXshZ7v33G-2qIC_j9KXpWKZSzQ,11359
|
|
12
|
+
swarmauri_toolkit_github-0.11.0.dev1.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
swarmauri_toolkit_github/GithubBranchTool.py,sha256=kAb-iBP7SVNqFP9JT3jZkIZUsHquTI74oB-ttd_5mBw,4078
|
|
2
|
-
swarmauri_toolkit_github/GithubCommitTool.py,sha256=M6QXm_upD1QInenheQ2dWJq1BZDGWq6wG0kb-g7AXzQ,5065
|
|
3
|
-
swarmauri_toolkit_github/GithubIssueTool.py,sha256=Xgu2kPZqdtjy9Hj6LGjcZFuu7cw7DW9-67ywkmE4Ppw,4493
|
|
4
|
-
swarmauri_toolkit_github/GithubPRTool.py,sha256=ptSPk7FabS9OJ1Qdf34ydfYONbNu9r2xsnSN8aibGn4,5012
|
|
5
|
-
swarmauri_toolkit_github/GithubRepoTool.py,sha256=YqkQN4tqSnzMK01azjrtO7iTFbAay_psAB8YXo7Jj3k,3961
|
|
6
|
-
swarmauri_toolkit_github/GithubToolkit.py,sha256=gXLnqbHfNzMM979rDrRpioFnW20O8Qkw9IOVxsjmoP0,1852
|
|
7
|
-
swarmauri_toolkit_github/__init__.py,sha256=ugR4rSIjWjFsklYq1zKlDuNwi2ao9NnzEcgQdGAtVgY,836
|
|
8
|
-
swarmauri_toolkit_github-0.9.1.dev2.dist-info/METADATA,sha256=ZxB-B3fIjGOGq_I6FWRt0rflUeFsFoUXIk7kSnPdV6w,7201
|
|
9
|
-
swarmauri_toolkit_github-0.9.1.dev2.dist-info/WHEEL,sha256=EGEvSphFYqXKs23-kQBeyNoJP1nrT8ZJKQoi5p5DYL8,88
|
|
10
|
-
swarmauri_toolkit_github-0.9.1.dev2.dist-info/entry_points.txt,sha256=2xC828KqwS3K-0qhlcdqbKhtoQhkzst3Y0i0KfCzXNI,467
|
|
11
|
-
swarmauri_toolkit_github-0.9.1.dev2.dist-info/licenses/LICENSE,sha256=djUXOlCxLVszShEpZXshZ7v33G-2qIC_j9KXpWKZSzQ,11359
|
|
12
|
-
swarmauri_toolkit_github-0.9.1.dev2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|