sci-agent 0.2.0__tar.gz → 0.2.1__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.
- {sci_agent-0.2.0 → sci_agent-0.2.1}/PKG-INFO +1 -1
- {sci_agent-0.2.0 → sci_agent-0.2.1}/pyproject.toml +1 -1
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/sci_agent.egg-info/PKG-INFO +1 -1
- sci_agent-0.2.1/src/simple_ci/__init__.py +1 -0
- sci_agent-0.2.1/src/simple_ci/__main__.py +67 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/tests/test_cli.py +17 -0
- sci_agent-0.2.1/tests/test_version.py +6 -0
- sci_agent-0.2.0/src/simple_ci/__init__.py +0 -1
- sci_agent-0.2.0/src/simple_ci/__main__.py +0 -42
- sci_agent-0.2.0/tests/test_version.py +0 -5
- {sci_agent-0.2.0 → sci_agent-0.2.1}/README.md +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/setup.cfg +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/sci_agent.egg-info/SOURCES.txt +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/sci_agent.egg-info/dependency_links.txt +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/sci_agent.egg-info/entry_points.txt +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/sci_agent.egg-info/requires.txt +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/sci_agent.egg-info/top_level.txt +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/actions/__init__.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/actions/base.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/actions/build.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/actions/deploy.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/actions/hooks.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/actions/image.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/actions/source.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/actions/target.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/cli/__init__.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/cli/client.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/cli/config.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/cli/history.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/cli/main.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/cli/render.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/errors.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/models.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/server/__init__.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/server/app.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/server/auth.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/server/executor.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/server/main.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/server/store.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/ui/__init__.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/ui/server.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/src/simple_ci/ui/static/index.html +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/tests/test_actions_commands.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/tests/test_config_loader.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/tests/test_executor.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/tests/test_history.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/tests/test_hooks.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/tests/test_render.py +0 -0
- {sci_agent-0.2.0 → sci_agent-0.2.1}/tests/test_server_api.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.1"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import ctypes
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
TOP_LEVEL_HELP = """usage: sci-agent [-h] [--root ROOT] [--host HOST] [--port PORT] [--open]
|
|
8
|
+
sci-agent run [-h] [--env ENV] [--project PROJECT] [--pipeline PIPELINE] ...
|
|
9
|
+
sci-agent server [-h] [--host HOST] [--port PORT] [--token TOKEN]
|
|
10
|
+
|
|
11
|
+
Agent-first lightweight CI/CD tool.
|
|
12
|
+
|
|
13
|
+
commands:
|
|
14
|
+
run Run CI pipelines, inspect configuration, and view local history.
|
|
15
|
+
server Run the target execution API server.
|
|
16
|
+
|
|
17
|
+
default:
|
|
18
|
+
Without a command, sci-agent starts the local Web UI.
|
|
19
|
+
|
|
20
|
+
common examples:
|
|
21
|
+
sci-agent
|
|
22
|
+
sci-agent run --targets
|
|
23
|
+
sci-agent run --env 10-50-10-18 --project ai-threat --pipeline server-openapi --yes
|
|
24
|
+
sci-agent server --host 0.0.0.0 --port 9090 --token <token>
|
|
25
|
+
|
|
26
|
+
Use "sci-agent run --help" or "sci-agent server --help" for command-specific options.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _configure_stdio_encoding() -> None:
|
|
31
|
+
if sys.platform == "win32":
|
|
32
|
+
try:
|
|
33
|
+
kernel32 = ctypes.windll.kernel32
|
|
34
|
+
kernel32.SetConsoleOutputCP(65001)
|
|
35
|
+
kernel32.SetConsoleCP(65001)
|
|
36
|
+
except Exception:
|
|
37
|
+
pass
|
|
38
|
+
|
|
39
|
+
for stream in (sys.stdout, sys.stderr, sys.stdin):
|
|
40
|
+
try:
|
|
41
|
+
stream.reconfigure(encoding="utf-8", errors="replace")
|
|
42
|
+
except Exception:
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def main() -> None:
|
|
47
|
+
_configure_stdio_encoding()
|
|
48
|
+
|
|
49
|
+
argv = sys.argv[1:]
|
|
50
|
+
if argv and argv[0] in {"-h", "--help"}:
|
|
51
|
+
print(TOP_LEVEL_HELP)
|
|
52
|
+
elif argv and argv[0] == "server":
|
|
53
|
+
from simple_ci.server.main import handle_server
|
|
54
|
+
|
|
55
|
+
handle_server(argv[1:])
|
|
56
|
+
elif argv and argv[0] == "run":
|
|
57
|
+
from simple_ci.cli.main import handle_run
|
|
58
|
+
|
|
59
|
+
handle_run(argv[1:])
|
|
60
|
+
else:
|
|
61
|
+
from simple_ci.ui.server import run_ui
|
|
62
|
+
|
|
63
|
+
run_ui(argv)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
if __name__ == "__main__":
|
|
67
|
+
main()
|
|
@@ -14,6 +14,21 @@ from simple_ci.cli.client import ServerApiError, SimpleCiClient
|
|
|
14
14
|
from simple_ci.server.main import build_parser, resolve_server_token
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
def test_top_level_help_shows_commands_and_default_ui() -> None:
|
|
18
|
+
result = subprocess.run(
|
|
19
|
+
[sys.executable, "-m", "simple_ci", "--help"],
|
|
20
|
+
check=False,
|
|
21
|
+
capture_output=True,
|
|
22
|
+
text=True,
|
|
23
|
+
encoding="utf-8",
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
assert result.returncode == 0
|
|
27
|
+
assert "sci-agent run" in result.stdout
|
|
28
|
+
assert "sci-agent server" in result.stdout
|
|
29
|
+
assert "local Web UI" in result.stdout
|
|
30
|
+
|
|
31
|
+
|
|
17
32
|
def test_run_help_shows_env_option() -> None:
|
|
18
33
|
result = subprocess.run(
|
|
19
34
|
[sys.executable, "-m", "simple_ci", "run", "--help"],
|
|
@@ -67,6 +82,8 @@ def test_console_script_help_uses_sci_agent_command() -> None:
|
|
|
67
82
|
|
|
68
83
|
assert result.returncode == 0
|
|
69
84
|
assert "usage: sci-agent run" in result.stdout
|
|
85
|
+
|
|
86
|
+
|
|
70
87
|
def test_server_parser_accepts_missing_token() -> None:
|
|
71
88
|
args = build_parser().parse_args([])
|
|
72
89
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.0"
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import ctypes
|
|
4
|
-
import sys
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def _configure_stdio_encoding() -> None:
|
|
8
|
-
if sys.platform == "win32":
|
|
9
|
-
try:
|
|
10
|
-
kernel32 = ctypes.windll.kernel32
|
|
11
|
-
kernel32.SetConsoleOutputCP(65001)
|
|
12
|
-
kernel32.SetConsoleCP(65001)
|
|
13
|
-
except Exception:
|
|
14
|
-
pass
|
|
15
|
-
|
|
16
|
-
for stream in (sys.stdout, sys.stderr, sys.stdin):
|
|
17
|
-
try:
|
|
18
|
-
stream.reconfigure(encoding="utf-8", errors="replace")
|
|
19
|
-
except Exception:
|
|
20
|
-
pass
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def main() -> None:
|
|
24
|
-
_configure_stdio_encoding()
|
|
25
|
-
|
|
26
|
-
argv = sys.argv[1:]
|
|
27
|
-
if argv and argv[0] == "server":
|
|
28
|
-
from simple_ci.server.main import handle_server
|
|
29
|
-
|
|
30
|
-
handle_server(argv[1:])
|
|
31
|
-
elif argv and argv[0] == "run":
|
|
32
|
-
from simple_ci.cli.main import handle_run
|
|
33
|
-
|
|
34
|
-
handle_run(argv[1:])
|
|
35
|
-
else:
|
|
36
|
-
from simple_ci.ui.server import run_ui
|
|
37
|
-
|
|
38
|
-
run_ui(argv)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if __name__ == "__main__":
|
|
42
|
-
main()
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|