@gaia-minds/assistant-cli 0.1.0 → 0.2.0
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.
- package/CONSTITUTION.md +208 -0
- package/README.md +85 -158
- package/assistant/README.md +126 -12
- package/package.json +6 -1
- package/tools/agent-actions.py +1213 -0
- package/tools/agent-alignment.py +888 -0
- package/tools/agent-config.yml +20 -5
- package/tools/agent-loop.py +502 -62
- package/tools/agent_actions.py +42 -0
- package/tools/agent_alignment.py +41 -0
- package/tools/gaia-assistant.py +2375 -34
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Import shim for environments where symlinks are not preserved.
|
|
3
|
+
|
|
4
|
+
Keeps `import agent_actions` working by loading the canonical
|
|
5
|
+
`agent-actions.py` module from disk.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import importlib.util
|
|
11
|
+
import sys
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from types import ModuleType
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
_IMPL_PATH = Path(__file__).with_name("agent-actions.py")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _load_impl() -> ModuleType:
|
|
20
|
+
spec = importlib.util.spec_from_file_location("gaia_agent_actions_impl", _IMPL_PATH)
|
|
21
|
+
if spec is None or spec.loader is None:
|
|
22
|
+
raise ImportError(f"Unable to load actions module from {_IMPL_PATH}")
|
|
23
|
+
module = importlib.util.module_from_spec(spec)
|
|
24
|
+
sys.modules[spec.name] = module
|
|
25
|
+
spec.loader.exec_module(module)
|
|
26
|
+
return module
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
_IMPL = _load_impl()
|
|
30
|
+
|
|
31
|
+
# Re-export public API expected by agent-loop and tests.
|
|
32
|
+
for _name in dir(_IMPL):
|
|
33
|
+
if _name.startswith("__"):
|
|
34
|
+
continue
|
|
35
|
+
globals()[_name] = getattr(_IMPL, _name)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
if __name__ == "__main__":
|
|
39
|
+
if hasattr(_IMPL, "_main"):
|
|
40
|
+
_IMPL._main()
|
|
41
|
+
else:
|
|
42
|
+
raise SystemExit("Action module CLI entrypoint not found")
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Import shim for environments where symlinks are not preserved.
|
|
3
|
+
|
|
4
|
+
Keeps `import agent_alignment` working by loading the canonical
|
|
5
|
+
`agent-alignment.py` module from disk.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import importlib.util
|
|
11
|
+
import sys
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from types import ModuleType
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
_IMPL_PATH = Path(__file__).with_name("agent-alignment.py")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _load_impl() -> ModuleType:
|
|
20
|
+
spec = importlib.util.spec_from_file_location("gaia_agent_alignment_impl", _IMPL_PATH)
|
|
21
|
+
if spec is None or spec.loader is None:
|
|
22
|
+
raise ImportError(f"Unable to load alignment module from {_IMPL_PATH}")
|
|
23
|
+
module = importlib.util.module_from_spec(spec)
|
|
24
|
+
sys.modules[spec.name] = module
|
|
25
|
+
spec.loader.exec_module(module)
|
|
26
|
+
return module
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
_IMPL = _load_impl()
|
|
30
|
+
|
|
31
|
+
# Re-export public API expected by agent-loop and tests.
|
|
32
|
+
for _name in dir(_IMPL):
|
|
33
|
+
if _name.startswith("__"):
|
|
34
|
+
continue
|
|
35
|
+
globals()[_name] = getattr(_IMPL, _name)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
if __name__ == "__main__":
|
|
39
|
+
if hasattr(_IMPL, "_self_test"):
|
|
40
|
+
raise SystemExit(_IMPL._self_test())
|
|
41
|
+
raise SystemExit("Alignment module self-test entrypoint not found")
|