akitallm 0.1.1__py3-none-any.whl → 1.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.
akita/tools/git.py ADDED
@@ -0,0 +1,79 @@
1
+ import os
2
+ import pathlib
3
+ import subprocess
4
+ from typing import Tuple, Optional
5
+ from urllib.parse import urlparse
6
+ from akita.core.config import CONFIG_DIR
7
+
8
+ class GitTool:
9
+ """
10
+ Utility for managing Git repositories within the Akita ecosystem.
11
+ """
12
+ REPOS_DIR = CONFIG_DIR / "repos"
13
+
14
+ @staticmethod
15
+ def parse_repo_url(url: str) -> Tuple[str, str]:
16
+ """
17
+ Extracts owner and repo name from a git URL.
18
+ Supports HTTPS and SSH formats.
19
+ """
20
+ # Clean URL
21
+ clean_url = url.strip().rstrip("/")
22
+ if clean_url.endswith(".git"):
23
+ clean_url = clean_url[:-4]
24
+
25
+ host = None
26
+ path_part = None
27
+
28
+ # Handle SCP-like SSH syntax: git@github.com:owner/repo
29
+ if "@" in clean_url and ":" in clean_url.split("@", 1)[1]:
30
+ user_host, path_part = clean_url.split("@", 1)[1].split(":", 1)
31
+ host = user_host
32
+ else:
33
+ parsed = urlparse(clean_url)
34
+ host = parsed.hostname
35
+ path_part = parsed.path.lstrip("/") if parsed.path else ""
36
+
37
+ if host and (host == "github.com" or host.endswith(".github.com")):
38
+ parts = [p for p in path_part.split("/") if p]
39
+ if len(parts) >= 2:
40
+ return parts[0], parts[1]
41
+
42
+ # Fallback for other providers or generic paths
43
+ parts = clean_url.split("/")
44
+ if len(parts) >= 2:
45
+ return parts[-2], parts[-1]
46
+
47
+ raise ValueError(f"Could not parse repository owner and name from URL: {url}")
48
+
49
+ @classmethod
50
+ def clone_repo(cls, url: str, branch: Optional[str] = None, depth: Optional[int] = None) -> str:
51
+ """
52
+ Clones a repository to ~/.akita/repos/<owner>/<repo>.
53
+ Returns the local path.
54
+ """
55
+ owner, repo = cls.parse_repo_url(url)
56
+ target_path = cls.REPOS_DIR / owner / repo
57
+
58
+ if target_path.exists():
59
+ raise FileExistsError(f"Repository already exists at: {target_path}. Please delete it first if you want to re-clone.")
60
+
61
+ target_path.parent.mkdir(parents=True, exist_ok=True)
62
+
63
+ cmd = ["git", "clone"]
64
+ if branch:
65
+ cmd += ["--branch", branch]
66
+ if depth:
67
+ cmd += ["--depth", str(depth)]
68
+
69
+ cmd += [url, str(target_path)]
70
+
71
+ result = subprocess.run(cmd, capture_all=True if hasattr(subprocess, 'capture_all') else False, text=True, check=False)
72
+
73
+ if result.returncode != 0:
74
+ # Clean up parent if it was empty
75
+ if not any(target_path.parent.iterdir()):
76
+ target_path.parent.rmdir()
77
+ raise RuntimeError(f"Git clone failed: {result.stderr or 'Unknown error'}")
78
+
79
+ return str(target_path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akitallm
3
- Version: 0.1.1
3
+ Version: 1.1.0
4
4
  Summary: AkitaLLM: An open-source local-first AI system for programming.
5
5
  Author: KerubinDev
6
6
  License: MIT
@@ -28,17 +28,11 @@ Requires-Dist: pytest-mock
28
28
  Requires-Dist: gitpython
29
29
  Requires-Dist: tomli-w
30
30
  Requires-Dist: tomli
31
+ Requires-Dist: whatthepatch>=1.0.5
32
+ Requires-Dist: tree-sitter>=0.21.3
33
+ Requires-Dist: tree-sitter-python>=0.21.0
31
34
  Dynamic: license-file
32
35
 
33
- ```text
34
- _ _ _ _ _ _ __ __
35
- / \ | | _(_) |_ __ _| | | | | \/ |
36
- / _ \ | |/ / | __/ _` | | | | | |\/| |
37
- / ___ \ | <| | || (_| | |___| |___| | | |
38
- /_/ \_\ |_|\_\_|\__\__,_|_____|_____|_| |_|
39
-
40
- ```
41
-
42
36
  # AkitaLLM
43
37
  ### A deterministic, local-first AI orchestrator for software engineers.
44
38
 
@@ -132,7 +126,10 @@ akita solve "Improve error handling in the reasoning engine to prevent silent fa
132
126
 
133
127
  ---
134
128
 
135
- ## Contributing
129
+ ### 🔌 Extensibility
130
+ AkitaLLM is built to be extended. You can create your own tools and plugins. Check the [Plugin Development Guide](PLUGINS.md) for more details.
131
+
132
+ ## 🤝 Contributing
136
133
 
137
134
  We are looking for engineers, not just coders. If you value robust abstractions, clean code, and predictable systems, your contribution is welcome.
138
135
 
@@ -0,0 +1,24 @@
1
+ akita/__init__.py,sha256=LGVQyDsWifdACo7qztwb8RWWHds1E7uQ-ZqD8SAjyw4,22
2
+ akita/cli/main.py,sha256=6jR4Dfg0HpDGkrr8kdpF6AfzLm6-5nStvsPN1VZd5as,12820
3
+ akita/core/ast_utils.py,sha256=8JrTZgfWjIvbzY5KzV2G9PuyOi8IxVdLMjDCPPLiz_I,3127
4
+ akita/core/config.py,sha256=0nlA5AiGjm0Kv5yUxqaHV2zA4Ld1rU_j2s2IjnYBB_Y,1656
5
+ akita/core/indexing.py,sha256=2j_NK8buZ1ugH3foa9KFQEtGOD-Lgoo2Se3Lx6Q7ZO4,3686
6
+ akita/core/plugins.py,sha256=P3azOFJ-yTw-kDdvjmHfNiU7nfvXQFadVPRnp1O7h-c,2951
7
+ akita/core/providers.py,sha256=SwCb2aTYJ-iNtWdah9IYzLf3vfTDA472i5nhJmsaZLs,6168
8
+ akita/core/trace.py,sha256=AxXUVZ7P8a0l5QTK5w9iSnUncUe62FGfRzDNN9xG5dg,692
9
+ akita/models/base.py,sha256=GC3WB9kMXpg1GCAX5104uovgdOZBIVIHJBq2SO8aU00,1723
10
+ akita/plugins/__init__.py,sha256=kfjmQqBhzhqQrH-Rd0jh0KxXyIT9T5DtEh-BETQD0FM,28
11
+ akita/plugins/files.py,sha256=Ha4YxmCz2G7iafqdr2TRE_xRlq1oeOBo6By3_S86jkE,1113
12
+ akita/reasoning/engine.py,sha256=w1gB-Y_Tzoan66T-EFd04X7V5mDcVOkSP2G6X3lmvxU,8634
13
+ akita/reasoning/session.py,sha256=rcJxcJXNjObjRwfuCY8NQKpKCqxeIppqkUpN-3mVRpE,472
14
+ akita/schemas/review.py,sha256=zzjLzTuiEpJfu4etS0NUBWfS3wyNobNDmDMhb5amWTI,905
15
+ akita/tools/base.py,sha256=jDA3jTP2qo6TjoTF6BSIb71BSfCJGSqbueIQz6lxuCM,1235
16
+ akita/tools/context.py,sha256=i6QjKMsKCZMIdCx82hkhMUzBQJolrcch2v1x-6nLy8U,5008
17
+ akita/tools/diff.py,sha256=bVH6_vHWoC9oYoS1RU4eOEnZHh6eFNtt6HCCzeGb6wY,4805
18
+ akita/tools/git.py,sha256=58ZCI2ZL7NYUQdRIe3969t6gRpVmCPD8B-UbP7cPBNY,2798
19
+ akitallm-1.1.0.dist-info/licenses/LICENSE,sha256=WE7_tfGR-IzkulSh6Pos02gucCXKboaXguAdr0bI9V0,1067
20
+ akitallm-1.1.0.dist-info/METADATA,sha256=rpPJHCMGPciP2apqy6Z8Vaho9XTChTiP_IfrbJK3BLo,5500
21
+ akitallm-1.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
22
+ akitallm-1.1.0.dist-info/entry_points.txt,sha256=Au1aAXCO2lX4kgElgknSVDpq7BcN5xAJJ0WvOAkhLzU,105
23
+ akitallm-1.1.0.dist-info/top_level.txt,sha256=duGU-i6qCRLqjo_b1XUqfhlSQky3QIO0Hlvfn2OV3hU,6
24
+ akitallm-1.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ [akitallm.plugins]
2
+ files = akita.plugins.files:FilesPlugin
3
+
4
+ [console_scripts]
5
+ akita = akita.cli.main:app
@@ -1,15 +0,0 @@
1
- akita/__init__.py,sha256=rnObPjuBcEStqSO0S6gsdS_ot8ITOQjVj_-P1LUUYpg,22
2
- akita/cli/main.py,sha256=BRtB4klB1y2zFeoYIQfwUdcg91mvsmPf3EV1A73T89s,7582
3
- akita/core/config.py,sha256=GsfkKqg0SlMhsQ2fHsRATjzDy6BzVSX8efIyh8o8DZw,1312
4
- akita/models/base.py,sha256=eZGCT-R9WEBaf8WaiMAkpQTdACewl-1F2uDEhs6ocQ4,1584
5
- akita/reasoning/engine.py,sha256=b436nuhli-87ADtgMK2VJCv1WE5LBtGFFJaNS5chiYw,7389
6
- akita/schemas/review.py,sha256=zzjLzTuiEpJfu4etS0NUBWfS3wyNobNDmDMhb5amWTI,905
7
- akita/tools/base.py,sha256=cufLJv8CtmzzNdmMlu-d8iC5QYXWXxc-X4mCYisChkU,1091
8
- akita/tools/context.py,sha256=Gryy9SjAIXkujWJdue5WH1tB_nSPc7ZAxC5o_r2Gnlg,3084
9
- akita/tools/diff.py,sha256=gPDOPCqxgjT8DWRc-x4GgNEtt2LOZvICtYyUaf_aSWM,1422
10
- akitallm-0.1.1.dist-info/licenses/LICENSE,sha256=WE7_tfGR-IzkulSh6Pos02gucCXKboaXguAdr0bI9V0,1067
11
- akitallm-0.1.1.dist-info/METADATA,sha256=X7n2ohb9aBeiYp9Z6o8xrAbeFJJcQu_oZi_NWGpT2TM,5515
12
- akitallm-0.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
13
- akitallm-0.1.1.dist-info/entry_points.txt,sha256=JGjCc_PusPfOXSVmY5U5VxDDG-yMNcXySluxVKjn_QA,45
14
- akitallm-0.1.1.dist-info/top_level.txt,sha256=duGU-i6qCRLqjo_b1XUqfhlSQky3QIO0Hlvfn2OV3hU,6
15
- akitallm-0.1.1.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- akita = akita.cli.main:app