gda 0.1.24__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.
gda/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """gda — an agent-facing Godot CLI with structured output."""
gda/__main__.py ADDED
@@ -0,0 +1,14 @@
1
+ """Enable ``python -m gda`` (and thus ``sys.executable -m gda``).
2
+
3
+ gda-mcp invokes the CLI as ``[sys.executable, "-m", "gda", …]`` for a
4
+ deterministic, same-environment binary (ADR-0011, Design decision 3): it runs
5
+ the *exact* gda paired with the running gda-mcp, never a wrong global ``gda`` a
6
+ PATH lookup might resolve. This module is the ``-m gda`` entry point that makes
7
+ that invocation work; it shares the one Typer ``app`` with the ``gda`` console
8
+ script, so both entry points behave identically.
9
+ """
10
+
11
+ from gda.cli import app
12
+
13
+ if __name__ == "__main__":
14
+ app()
gda/binary.py ADDED
@@ -0,0 +1,35 @@
1
+ """Godot binary resolution.
2
+
3
+ Resolution precedence (highest first):
4
+
5
+ 1. An explicit path passed by the caller (the ``--godot`` flag).
6
+ 2. The ``GDA_GODOT`` environment variable.
7
+ 3. The local development default (the path documented in RULES.md).
8
+ """
9
+
10
+ import os
11
+ from collections.abc import Mapping
12
+ from pathlib import Path
13
+
14
+ GODOT_BIN_ENV = "GDA_GODOT"
15
+
16
+ # Local development default, per RULES.md.
17
+ DEFAULT_GODOT_BIN = "~/Applications/Godot.app/Contents/MacOS/Godot"
18
+
19
+
20
+ def resolve_godot_binary(
21
+ explicit: str | None = None,
22
+ env: Mapping[str, str] | None = None,
23
+ ) -> Path:
24
+ """Resolve the Godot binary path using flag > env > default precedence."""
25
+ if env is None:
26
+ env = os.environ
27
+ if explicit is not None:
28
+ # An explicit (even if empty) value is a deliberate choice; an empty
29
+ # one is a mistake we surface rather than silently override.
30
+ if not explicit:
31
+ raise ValueError("explicit Godot binary path is empty")
32
+ raw = explicit
33
+ else:
34
+ raw = env.get(GODOT_BIN_ENV) or DEFAULT_GODOT_BIN
35
+ return Path(raw).expanduser()