deuscode 0.3.1__tar.gz → 0.3.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deuscode
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: AI-powered multi-agent CLI coding assistant for local LLMs
5
5
  License: AGPL-3.0-or-later
6
6
  License-File: LICENSE
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "deuscode"
7
- version = "0.3.1"
7
+ version = "0.3.2"
8
8
  description = "AI-powered multi-agent CLI coding assistant for local LLMs"
9
9
  readme = "README.md"
10
10
  license = { text = "AGPL-3.0-or-later" }
@@ -0,0 +1 @@
1
+ version = "0.3.2"
@@ -14,6 +14,22 @@ _SYSTEM_BASE = (
14
14
  )
15
15
 
16
16
 
17
+ async def run_agent(
18
+ prompt: str,
19
+ path: str = ".",
20
+ model_override: str | None = None,
21
+ no_map: bool = False,
22
+ ) -> None:
23
+ from deuscode.config import load_config
24
+ try:
25
+ config = load_config()
26
+ except FileNotFoundError as e:
27
+ ui.error(str(e))
28
+ return
29
+ result = await run(prompt, config, path=path, model_override=model_override, no_map=no_map)
30
+ ui.final_answer(result)
31
+
32
+
17
33
  async def run(
18
34
  prompt: str,
19
35
  config: Config,
@@ -0,0 +1,56 @@
1
+ import sys
2
+ import asyncio
3
+ from typing import Optional
4
+
5
+ import typer
6
+
7
+ from deuscode import ui
8
+ from deuscode.agent import run_agent
9
+ from deuscode.setup import run_setup_runpod, run_stop_runpod
10
+
11
+ app = typer.Typer(
12
+ name="deus",
13
+ help="Deus - AI-powered CLI coding assistant",
14
+ add_completion=False,
15
+ no_args_is_help=True,
16
+ )
17
+
18
+ setup_app = typer.Typer(help="Configure Deus endpoints and models.")
19
+ app.add_typer(setup_app, name="setup")
20
+
21
+
22
+ @setup_app.callback(invoke_without_command=True)
23
+ def setup_callback(
24
+ ctx: typer.Context,
25
+ runpod: bool = typer.Option(False, "--runpod", help="Configure RunPod GPU endpoint"),
26
+ stop: bool = typer.Option(False, "--stop", help="Stop the current RunPod pod"),
27
+ ) -> None:
28
+ if ctx.invoked_subcommand is not None:
29
+ return
30
+ if stop:
31
+ asyncio.run(run_stop_runpod())
32
+ elif runpod:
33
+ asyncio.run(run_setup_runpod())
34
+ else:
35
+ ui.error("Use --runpod to configure or --stop to stop pod")
36
+
37
+
38
+ @app.command(name="ask", hidden=True)
39
+ def ask(
40
+ prompt: str = typer.Argument(..., help="What to ask Deus"),
41
+ path: str = typer.Option(".", "--path", help="Repo path to map"),
42
+ model: Optional[str] = typer.Option(None, "--model", help="Override config model"),
43
+ no_map: bool = typer.Option(False, "--no-map", help="Skip repo-map"),
44
+ ) -> None:
45
+ asyncio.run(run_agent(prompt, path, model, no_map))
46
+
47
+
48
+ def main() -> None:
49
+ known_subcommands = ["setup", "ask", "--help", "-h"]
50
+ if len(sys.argv) > 1 and sys.argv[1] not in known_subcommands:
51
+ sys.argv.insert(1, "ask")
52
+ app()
53
+
54
+
55
+ if __name__ == "__main__":
56
+ main()
@@ -1 +0,0 @@
1
- version = "0.3.1"
@@ -1,56 +0,0 @@
1
- import asyncio
2
- from typing import Optional
3
-
4
- import typer
5
-
6
- from deuscode import ui
7
- from deuscode.config import load_config
8
- from deuscode import agent
9
- from deuscode.setup import run_setup_runpod, run_stop_runpod
10
-
11
- app = typer.Typer(invoke_without_command=True, help="Deus - AI-powered CLI coding assistant")
12
-
13
-
14
- @app.callback(invoke_without_command=True)
15
- def main(
16
- ctx: typer.Context,
17
- prompt: Optional[str] = typer.Argument(None, help="What to ask Deus"),
18
- path: str = typer.Option(".", "--path", help="Repo path to map"),
19
- model: Optional[str] = typer.Option(None, "--model", help="Override config model"),
20
- no_map: bool = typer.Option(False, "--no-map", help="Skip repo-map generation"),
21
- ) -> None:
22
- if ctx.invoked_subcommand is not None:
23
- return
24
- if not prompt:
25
- ui.error("Provide a prompt or use a subcommand (e.g. deus setup --runpod)")
26
- raise typer.Exit(1)
27
- try:
28
- config = load_config()
29
- except FileNotFoundError as e:
30
- ui.error(str(e))
31
- raise typer.Exit(1)
32
- try:
33
- result = asyncio.run(agent.run(prompt, config, path=path, model_override=model, no_map=no_map))
34
- ui.final_answer(result)
35
- except Exception as e:
36
- ui.error(str(e))
37
- raise typer.Exit(1)
38
-
39
-
40
- @app.command()
41
- def setup(
42
- runpod: bool = typer.Option(False, "--runpod", help="Configure a RunPod GPU endpoint"),
43
- stop: bool = typer.Option(False, "--stop", help="Stop the current RunPod pod"),
44
- ) -> None:
45
- """Configure Deus endpoints and models."""
46
- if stop:
47
- asyncio.run(run_stop_runpod())
48
- elif runpod:
49
- asyncio.run(run_setup_runpod())
50
- else:
51
- ui.error("Use --runpod to configure or --stop to stop pod")
52
- raise typer.Exit(1)
53
-
54
-
55
- if __name__ == "__main__":
56
- app()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes