kestrel-feature-github 0.1.0__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.
@@ -0,0 +1,107 @@
1
+ """Data models for GitHub feature."""
2
+ from dataclasses import dataclass, field
3
+ from datetime import datetime
4
+ from enum import Enum
5
+ from typing import Optional
6
+
7
+
8
+ class FileType(Enum):
9
+ """Type of file in repository."""
10
+ FILE = "file"
11
+ DIR = "dir"
12
+ SYMLINK = "symlink"
13
+ SUBMODULE = "submodule"
14
+
15
+
16
+ @dataclass
17
+ class RepoFile:
18
+ """A file or directory in a repository."""
19
+ path: str
20
+ name: str
21
+ type: FileType
22
+ size: int = 0
23
+ sha: str = ""
24
+ download_url: Optional[str] = None
25
+
26
+ def is_dir(self) -> bool:
27
+ return self.type == FileType.DIR
28
+
29
+ def is_file(self) -> bool:
30
+ return self.type == FileType.FILE
31
+
32
+
33
+ @dataclass
34
+ class FileContent:
35
+ """Content of a file from repository."""
36
+ path: str
37
+ content: str
38
+ sha: str
39
+ size: int
40
+ encoding: str = "utf-8"
41
+ repo: str = ""
42
+ ref: str = "main"
43
+ cached_at: Optional[datetime] = None
44
+
45
+
46
+ @dataclass
47
+ class SearchResult:
48
+ """A search result from GitHub code search."""
49
+ path: str
50
+ repo: str
51
+ name: str
52
+ sha: str
53
+ score: float = 0.0
54
+ html_url: str = ""
55
+ text_matches: list[dict] = field(default_factory=list)
56
+
57
+
58
+ @dataclass
59
+ class CodeDefinition:
60
+ """A code definition (function, class, etc.) extracted from source."""
61
+ name: str
62
+ type: str # "function", "class", "method", "variable"
63
+ path: str
64
+ start_line: int
65
+ end_line: int
66
+ signature: str = ""
67
+ docstring: str = ""
68
+ source: str = ""
69
+
70
+
71
+ @dataclass
72
+ class ComponentManifest:
73
+ """A component.yaml manifest for a feature."""
74
+ feature_name: str
75
+ description: str
76
+ version: str = "1.0.0"
77
+ entry_point: str = "feature.py"
78
+ files: list[str] = field(default_factory=list)
79
+ tools: list[str] = field(default_factory=list)
80
+ dependencies: list[str] = field(default_factory=list)
81
+
82
+ @classmethod
83
+ def from_dict(cls, data: dict, feature_name: str) -> "ComponentManifest":
84
+ """Create from dictionary (parsed YAML).
85
+
86
+ Handles both formats for tools:
87
+ - Simple: ["tool1", "tool2"]
88
+ - Dict: [{"name": "tool1", "description": "..."}, ...]
89
+ """
90
+ # Normalize tools to list of strings
91
+ raw_tools = data.get("tools", [])
92
+ tools = []
93
+ for t in raw_tools:
94
+ if isinstance(t, dict):
95
+ tools.append(t.get("name", str(t)))
96
+ else:
97
+ tools.append(str(t))
98
+
99
+ return cls(
100
+ feature_name=feature_name,
101
+ description=data.get("description", ""),
102
+ version=data.get("version", "1.0.0"),
103
+ entry_point=data.get("entry_point", "feature.py"),
104
+ files=data.get("files", []),
105
+ tools=tools,
106
+ dependencies=data.get("dependencies", []),
107
+ )
@@ -0,0 +1,51 @@
1
+ Metadata-Version: 2.4
2
+ Name: kestrel-feature-github
3
+ Version: 0.1.0
4
+ Summary: Kestrel GitHub integration feature
5
+ License: Apache-2.0
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: aiosqlite>=0.21.0
9
+ Requires-Dist: httpx>=0.27.0
10
+ Requires-Dist: kestrel-sovereign-sdk<1,>=0.11
11
+ Requires-Dist: pyyaml>=6.0
12
+ Provides-Extra: test
13
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'test'
14
+ Requires-Dist: pytest>=8.0.0; extra == 'test'
15
+ Description-Content-Type: text/markdown
16
+
17
+ # kestrel-feature-github
18
+
19
+ GitHub integration for Kestrel Sovereign agents — manage issues, pull requests, and repositories directly from agent conversations.
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ uv pip install kestrel-feature-github
25
+ ```
26
+
27
+ ## Dependencies
28
+
29
+ - `kestrel-sovereign-sdk`
30
+ - `httpx`
31
+ - `pyyaml`
32
+ - `aiosqlite`
33
+
34
+ ## Usage
35
+
36
+ Once installed, the `GitHubFeature` is automatically discovered by kestrel-sovereign via the `kestrel_sovereign.features` entry point.
37
+
38
+ See [SKILL.md](SKILL.md) for the full skill reference.
39
+
40
+ ## Configuration
41
+
42
+ | Variable | Description |
43
+ |----------|-------------|
44
+ | `GITHUB_TOKEN` | GitHub personal access token with repo access |
45
+
46
+ ## Development
47
+
48
+ ```bash
49
+ uv sync --extra test
50
+ uv run --extra test pytest
51
+ ```
@@ -0,0 +1,12 @@
1
+ kestrel_feature_github/SKILL.md,sha256=tC4PaPdW_5wL6Db1IIv83-vUGhc1_YLa9y25fI5vy44,3852
2
+ kestrel_feature_github/__init__.py,sha256=kPaKHij-tY2MMrsNSPlt4b7gRExhggbyU0P3HXENMFM,150
3
+ kestrel_feature_github/ast_analyzer.py,sha256=_fwk0dhbKWEQsTnjsYzd8qhMFOLBUccutIenaTxEiBM,7971
4
+ kestrel_feature_github/cache.py,sha256=LpCJH7X2e85DjKCyYg303a7X8HgSpyMlUrL4FeEQCDE,9548
5
+ kestrel_feature_github/client.py,sha256=eq5_9b0lZaJ1T0QbauqMPPteyo6m-X867VsLKpJnsPc,17967
6
+ kestrel_feature_github/feature.py,sha256=y9AixAzqAxPw8b8-2K6vq8YbQM5VR4QXCYy-NXm3YZs,24675
7
+ kestrel_feature_github/models.py,sha256=db0FRpw2zvpB24Gzw1NNWxe48f1wJUKqFy3QmNEr3C4,2731
8
+ kestrel_feature_github-0.1.0.dist-info/METADATA,sha256=qDlAojmgRIHqtAPX0t5aVr7BQgZgiXX-Bw-mK67VIdY,1200
9
+ kestrel_feature_github-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
10
+ kestrel_feature_github-0.1.0.dist-info/entry_points.txt,sha256=ojvtumSfwd3xucEr_ypclIml5dJyVOjRtSmjOiJ8GPE,82
11
+ kestrel_feature_github-0.1.0.dist-info/licenses/LICENSE,sha256=hu6c8OxhelXVvfNXUulz6QLts9AT2cgmSDAv2tc5P3I,5206
12
+ kestrel_feature_github-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [kestrel_sovereign.features]
2
+ GitHubFeature = kestrel_feature_github:GitHubFeature
@@ -0,0 +1,106 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the
13
+ copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means (i) the
18
+ power, direct or indirect, to cause the direction or management of such
19
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
20
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of
21
+ such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
24
+ permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation source, and
28
+ configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical transformation
31
+ or translation of a Source form, including but not limited to compiled object
32
+ code, generated documentation, and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or Object form,
35
+ made available under the License, as indicated by a copyright notice that is
36
+ included in or attached to the work.
37
+
38
+ "Derivative Works" shall mean any work, whether in Source or Object form,
39
+ that is based on (or derived from) the Work and for which the editorial
40
+ revisions, annotations, elaborations, or other modifications represent, as a
41
+ whole, an original work of authorship. For the purposes of this License,
42
+ Derivative Works shall not include works that remain separable from, or
43
+ merely link (or bind by name) to the interfaces of, the Work and Derivative
44
+ Works thereof.
45
+
46
+ "Contribution" shall mean any work of authorship, including the original
47
+ version of the Work and any modifications or additions to that Work or
48
+ Derivative Works thereof, that is intentionally submitted to Licensor for
49
+ inclusion in the Work by the copyright owner or by an individual or Legal
50
+ Entity authorized to submit on behalf of the copyright owner.
51
+
52
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
53
+ behalf of whom a Contribution has been received by Licensor and subsequently
54
+ incorporated within the Work.
55
+
56
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
57
+ License, each Contributor hereby grants to You a perpetual, worldwide,
58
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
59
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
60
+ sublicense, and distribute the Work and such Derivative Works in Source or
61
+ Object form.
62
+
63
+ 3. Grant of Patent License. Subject to the terms and conditions of this
64
+ License, each Contributor hereby grants to You a perpetual, worldwide,
65
+ non-exclusive, no-charge, royalty-free, irrevocable patent license to make,
66
+ have made, use, offer to sell, sell, import, and otherwise transfer the Work.
67
+
68
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
69
+ Derivative Works thereof in any medium, with or without modifications, and in
70
+ Source or Object form, provided that You meet the following conditions:
71
+
72
+ (a) You must give any other recipients of the Work or Derivative Works a copy
73
+ of this License; and
74
+
75
+ (b) You must cause any modified files to carry prominent notices stating that
76
+ You changed the files; and
77
+
78
+ (c) You must retain, in the Source form of any Derivative Works that You
79
+ distribute, all copyright, patent, trademark, and attribution notices from
80
+ the Source form of the Work, excluding those notices that do not pertain to
81
+ any part of the Derivative Works; and
82
+
83
+ (d) If the Work includes a "NOTICE" text file as part of its distribution,
84
+ then any Derivative Works that You distribute must include a readable copy of
85
+ the attribution notices contained within such NOTICE file.
86
+
87
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
88
+ Contribution intentionally submitted for inclusion in the Work by You to the
89
+ Licensor shall be under the terms and conditions of this License.
90
+
91
+ 6. Trademarks. This License does not grant permission to use the trade names,
92
+ trademarks, service marks, or product names of the Licensor.
93
+
94
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
95
+ writing, Licensor provides the Work on an "AS IS" BASIS, WITHOUT WARRANTIES
96
+ OR CONDITIONS OF ANY KIND, either express or implied.
97
+
98
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
99
+ tort, contract, or otherwise, unless required by applicable law, shall any
100
+ Contributor be liable to You for damages.
101
+
102
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work
103
+ or Derivative Works thereof, You may choose to offer support, warranty,
104
+ indemnity, or other liability obligations. However, in accepting such
105
+ obligations, You may act only on Your own behalf and on Your sole
106
+ responsibility.