getbased-agent-stack 0.5.0__tar.gz → 0.5.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.
Files changed (26) hide show
  1. getbased_agent_stack-0.5.2/LICENSE +20 -0
  2. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/PKG-INFO +36 -13
  3. getbased_agent_stack-0.5.0/src/getbased_agent_stack.egg-info/PKG-INFO → getbased_agent_stack-0.5.2/README.md +30 -26
  4. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/pyproject.toml +6 -6
  5. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/src/getbased_agent_stack/cli.py +6 -0
  6. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/src/getbased_agent_stack/units.py +19 -1
  7. getbased_agent_stack-0.5.0/README.md → getbased_agent_stack-0.5.2/src/getbased_agent_stack.egg-info/PKG-INFO +49 -7
  8. getbased_agent_stack-0.5.2/src/getbased_agent_stack.egg-info/requires.txt +11 -0
  9. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/tests/test_cli.py +19 -0
  10. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/tests/test_units.py +34 -0
  11. getbased_agent_stack-0.5.0/LICENSE +0 -22
  12. getbased_agent_stack-0.5.0/src/getbased_agent_stack.egg-info/requires.txt +0 -11
  13. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/setup.cfg +0 -0
  14. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/src/getbased_agent_stack/__init__.py +0 -0
  15. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/src/getbased_agent_stack/env_file.py +0 -0
  16. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/src/getbased_agent_stack/mcp_configs.py +0 -0
  17. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/src/getbased_agent_stack/systemd/getbased-dashboard.service +0 -0
  18. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/src/getbased_agent_stack/systemd/getbased-rag.service +0 -0
  19. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/src/getbased_agent_stack.egg-info/SOURCES.txt +0 -0
  20. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/src/getbased_agent_stack.egg-info/dependency_links.txt +0 -0
  21. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/src/getbased_agent_stack.egg-info/entry_points.txt +0 -0
  22. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/src/getbased_agent_stack.egg-info/top_level.txt +0 -0
  23. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/tests/test_env_file.py +0 -0
  24. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/tests/test_integration.py +0 -0
  25. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/tests/test_mcp_configs.py +0 -0
  26. {getbased_agent_stack-0.5.0 → getbased_agent_stack-0.5.2}/tests/test_systemd_units.py +0 -0
@@ -0,0 +1,20 @@
1
+ GNU AFFERO GENERAL PUBLIC LICENSE
2
+ Version 3, 19 November 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU Affero General Public License is a free, copyleft license for
11
+ software and other kinds of works, specifically designed to ensure
12
+ cooperation with the community in the case of network server software.
13
+
14
+ The licenses for most software and other practical works are designed
15
+ to take away your freedom to share and change the works. By contrast,
16
+ our General Public Licenses are intended to guarantee your freedom to
17
+ share and change all versions of a program--to make sure it remains free
18
+ software for all its users.
19
+
20
+ For the full license text, see <https://www.gnu.org/licenses/agpl-3.0.txt>
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: getbased-agent-stack
3
- Version: 0.5.0
3
+ Version: 0.5.2
4
4
  Summary: One-command install of the full getbased agent stack — getbased-mcp + getbased-rag + getbased-dashboard
5
- License-Expression: GPL-3.0-only
5
+ License-Expression: AGPL-3.0-or-later
6
6
  Requires-Python: >=3.10
7
7
  Description-Content-Type: text/markdown
8
8
  License-File: LICENSE
9
- Requires-Dist: getbased-mcp>=0.2.3
10
- Requires-Dist: getbased-rag>=0.7.1
11
- Requires-Dist: getbased-dashboard>=0.6.1
9
+ Requires-Dist: getbased-mcp>=0.2.5
10
+ Requires-Dist: getbased-rag>=0.7.2
11
+ Requires-Dist: getbased-dashboard>=0.6.2
12
12
  Provides-Extra: full
13
- Requires-Dist: getbased-rag[full]>=0.7.1; extra == "full"
13
+ Requires-Dist: getbased-rag[full]>=0.7.2; extra == "full"
14
14
  Provides-Extra: test
15
15
  Requires-Dist: pytest>=8.0; extra == "test"
16
16
  Requires-Dist: httpx>=0.27; extra == "test"
@@ -25,21 +25,34 @@ Part of the [getbased-agents monorepo](https://github.com/elkimek/getbased-agent
25
25
 
26
26
  ## Install
27
27
 
28
+ Linux, one command:
29
+
30
+ ```bash
31
+ curl -sSL https://getbased.health/install.sh | bash
32
+ ```
33
+
34
+ Runs end-to-end: installs `getbased-agent-stack[full]` via whichever of `uv` or `pipx` is available, exposes sibling binaries, runs `getbased-stack init --yes`, and starts rag + dashboard as systemd user services. [Read the script first](https://github.com/elkimek/get-based-site/blob/main/install.sh) if you're cautious.
35
+
36
+ Manual — pipx:
37
+
28
38
  ```bash
29
39
  pipx install --include-deps "getbased-agent-stack[full]"
30
40
  ```
31
41
 
32
42
  The `--include-deps` flag is required — it exposes `getbased-mcp`, `lens`, and `getbased-dashboard` alongside `getbased-stack` on your PATH. Without it, pipx only links the stack's own entry point and the MCP/rag/dashboard binaries stay hidden inside the venv.
33
43
 
34
- `uv` users: install each package as its own tool instead, since `uv tool` has no `--include-deps` equivalent yet:
44
+ Manual uv (0.11+):
35
45
 
36
46
  ```bash
37
- uv tool install getbased-mcp
38
- uv tool install "getbased-rag[full]"
39
- uv tool install getbased-dashboard
40
- uv tool install "getbased-agent-stack[full]"
47
+ uv tool install \
48
+ --with-executables-from getbased-rag \
49
+ --with-executables-from getbased-dashboard \
50
+ --with-executables-from getbased-mcp \
51
+ "getbased-agent-stack[full]"
41
52
  ```
42
53
 
54
+ `--with-executables-from` is uv's equivalent of pipx's `--include-deps` — one tool venv, all four binaries on PATH.
55
+
43
56
  Pulls:
44
57
 
45
58
  - [`getbased-mcp`](https://github.com/elkimek/getbased-agents/tree/main/packages/mcp) — stdio MCP server that Claude Code / Hermes / OpenClaw spawn
@@ -52,17 +65,27 @@ Total install: ~500 MB (the ML deps dominate). Smaller installs available — `p
52
65
 
53
66
  ## Quickstart — one command
54
67
 
68
+ Interactive wizard:
69
+
55
70
  ```bash
56
71
  getbased-stack init
57
72
  ```
58
73
 
74
+ Non-interactive (for scripted installs and curl | bash; `install.sh` uses this):
75
+
76
+ ```bash
77
+ getbased-stack init --yes
78
+ ```
79
+
59
80
  The wizard (~30 seconds):
60
81
 
61
- 1. Prompts for your `GETBASED_TOKEN` (skip if you don't use sync)
82
+ 1. Prompts for your `GETBASED_TOKEN` (skip if you don't use sync; `--yes` skips)
62
83
  2. Generates a rag API key if one doesn't exist
63
84
  3. Writes `~/.config/getbased/env` (mode 0600) — the shared config file
64
85
  4. Installs systemd user units for rag + dashboard, enables them, starts them
65
86
 
87
+ On non-systemd hosts (Docker, macOS, WSL1) step 4 writes the unit files but skips activation with a clear message instead of crashing — re-run on a systemd-enabled host or start `lens serve` + `getbased-dashboard serve` manually.
88
+
66
89
  Then paste one line into your MCP client:
67
90
 
68
91
  ```bash
@@ -154,4 +177,4 @@ The integration test (`tests/test_integration.py`) spins up `lens serve` in a su
154
177
 
155
178
  ## Licence
156
179
 
157
- GPL-3.0-only, matching the siblings.
180
+ AGPL-3.0-or-later, matching the siblings.
@@ -1,22 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: getbased-agent-stack
3
- Version: 0.5.0
4
- Summary: One-command install of the full getbased agent stack — getbased-mcp + getbased-rag + getbased-dashboard
5
- License-Expression: GPL-3.0-only
6
- Requires-Python: >=3.10
7
- Description-Content-Type: text/markdown
8
- License-File: LICENSE
9
- Requires-Dist: getbased-mcp>=0.2.3
10
- Requires-Dist: getbased-rag>=0.7.1
11
- Requires-Dist: getbased-dashboard>=0.6.1
12
- Provides-Extra: full
13
- Requires-Dist: getbased-rag[full]>=0.7.1; extra == "full"
14
- Provides-Extra: test
15
- Requires-Dist: pytest>=8.0; extra == "test"
16
- Requires-Dist: httpx>=0.27; extra == "test"
17
- Requires-Dist: pytest-timeout>=2.3; extra == "test"
18
- Dynamic: license-file
19
-
20
1
  # getbased-agent-stack
21
2
 
22
3
  Meta-package bundling the full [getbased](https://getbased.health) agent stack into one install: the MCP adapter, the RAG engine, the browser dashboard, an orchestration CLI (`init` / `install` / `mcp-config`), hardened systemd units for rag + dashboard, and paste-ready configs for Claude Desktop/Code, Cursor, Cline, and Hermes.
@@ -25,21 +6,34 @@ Part of the [getbased-agents monorepo](https://github.com/elkimek/getbased-agent
25
6
 
26
7
  ## Install
27
8
 
9
+ Linux, one command:
10
+
11
+ ```bash
12
+ curl -sSL https://getbased.health/install.sh | bash
13
+ ```
14
+
15
+ Runs end-to-end: installs `getbased-agent-stack[full]` via whichever of `uv` or `pipx` is available, exposes sibling binaries, runs `getbased-stack init --yes`, and starts rag + dashboard as systemd user services. [Read the script first](https://github.com/elkimek/get-based-site/blob/main/install.sh) if you're cautious.
16
+
17
+ Manual — pipx:
18
+
28
19
  ```bash
29
20
  pipx install --include-deps "getbased-agent-stack[full]"
30
21
  ```
31
22
 
32
23
  The `--include-deps` flag is required — it exposes `getbased-mcp`, `lens`, and `getbased-dashboard` alongside `getbased-stack` on your PATH. Without it, pipx only links the stack's own entry point and the MCP/rag/dashboard binaries stay hidden inside the venv.
33
24
 
34
- `uv` users: install each package as its own tool instead, since `uv tool` has no `--include-deps` equivalent yet:
25
+ Manual uv (0.11+):
35
26
 
36
27
  ```bash
37
- uv tool install getbased-mcp
38
- uv tool install "getbased-rag[full]"
39
- uv tool install getbased-dashboard
40
- uv tool install "getbased-agent-stack[full]"
28
+ uv tool install \
29
+ --with-executables-from getbased-rag \
30
+ --with-executables-from getbased-dashboard \
31
+ --with-executables-from getbased-mcp \
32
+ "getbased-agent-stack[full]"
41
33
  ```
42
34
 
35
+ `--with-executables-from` is uv's equivalent of pipx's `--include-deps` — one tool venv, all four binaries on PATH.
36
+
43
37
  Pulls:
44
38
 
45
39
  - [`getbased-mcp`](https://github.com/elkimek/getbased-agents/tree/main/packages/mcp) — stdio MCP server that Claude Code / Hermes / OpenClaw spawn
@@ -52,17 +46,27 @@ Total install: ~500 MB (the ML deps dominate). Smaller installs available — `p
52
46
 
53
47
  ## Quickstart — one command
54
48
 
49
+ Interactive wizard:
50
+
55
51
  ```bash
56
52
  getbased-stack init
57
53
  ```
58
54
 
55
+ Non-interactive (for scripted installs and curl | bash; `install.sh` uses this):
56
+
57
+ ```bash
58
+ getbased-stack init --yes
59
+ ```
60
+
59
61
  The wizard (~30 seconds):
60
62
 
61
- 1. Prompts for your `GETBASED_TOKEN` (skip if you don't use sync)
63
+ 1. Prompts for your `GETBASED_TOKEN` (skip if you don't use sync; `--yes` skips)
62
64
  2. Generates a rag API key if one doesn't exist
63
65
  3. Writes `~/.config/getbased/env` (mode 0600) — the shared config file
64
66
  4. Installs systemd user units for rag + dashboard, enables them, starts them
65
67
 
68
+ On non-systemd hosts (Docker, macOS, WSL1) step 4 writes the unit files but skips activation with a clear message instead of crashing — re-run on a systemd-enabled host or start `lens serve` + `getbased-dashboard serve` manually.
69
+
66
70
  Then paste one line into your MCP client:
67
71
 
68
72
  ```bash
@@ -154,4 +158,4 @@ The integration test (`tests/test_integration.py`) spins up `lens serve` in a su
154
158
 
155
159
  ## Licence
156
160
 
157
- GPL-3.0-only, matching the siblings.
161
+ AGPL-3.0-or-later, matching the siblings.
@@ -4,23 +4,23 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "getbased-agent-stack"
7
- version = "0.5.0"
7
+ version = "0.5.2"
8
8
  description = "One-command install of the full getbased agent stack — getbased-mcp + getbased-rag + getbased-dashboard"
9
9
  readme = "README.md"
10
- license = "GPL-3.0-only"
10
+ license = "AGPL-3.0-or-later"
11
11
  requires-python = ">=3.10"
12
12
  # Pulls every sibling package. Bump this meta when a sibling protocol
13
13
  # bump requires coordinated release.
14
14
  dependencies = [
15
- "getbased-mcp>=0.2.3",
16
- "getbased-rag>=0.7.1",
17
- "getbased-dashboard>=0.6.1",
15
+ "getbased-mcp>=0.2.5",
16
+ "getbased-rag>=0.7.2",
17
+ "getbased-dashboard>=0.6.2",
18
18
  ]
19
19
 
20
20
  [project.optional-dependencies]
21
21
  # `full` includes PDF/DOCX parsers and ONNX acceleration (pre-exported
22
22
  # weights — no PyTorch/transformers/optimum dance).
23
- full = ["getbased-rag[full]>=0.7.1"]
23
+ full = ["getbased-rag[full]>=0.7.2"]
24
24
  # For contributors running the integration test harness.
25
25
  test = ["pytest>=8.0", "httpx>=0.27", "pytest-timeout>=2.3"]
26
26
 
@@ -161,6 +161,12 @@ def cmd_init(args: argparse.Namespace) -> int:
161
161
 
162
162
 
163
163
  def _print_linger_hint(strict: bool) -> None:
164
+ # If systemctl isn't even available, the linger question is moot —
165
+ # we've already printed a clearer "systemd not available, unit files
166
+ # written but not activated" message above. Adding "services will
167
+ # stop on logout" here would mislead (there aren't any services).
168
+ if shutil.which("systemctl") is None:
169
+ return
164
170
  user = os.environ.get("USER", "")
165
171
  if not user:
166
172
  return
@@ -44,7 +44,14 @@ class CommandResult:
44
44
 
45
45
 
46
46
  def _real_shell(cmd: "list[str]") -> CommandResult:
47
- proc = subprocess.run(cmd, capture_output=True, text=True)
47
+ # FileNotFoundError when the binary isn't on PATH — happens on systems
48
+ # without systemd (Docker containers, macOS, WSL1). Return a shell-like
49
+ # 127 instead of propagating so callers can handle "not available" the
50
+ # same way they handle "failed" without an unhandled traceback.
51
+ try:
52
+ proc = subprocess.run(cmd, capture_output=True, text=True)
53
+ except FileNotFoundError:
54
+ return CommandResult(127, "", f"command not found: {cmd[0]}")
48
55
  return CommandResult(proc.returncode, proc.stdout, proc.stderr)
49
56
 
50
57
 
@@ -125,6 +132,17 @@ class UnitManager:
125
132
  written = self.install_files()
126
133
  for p in written:
127
134
  log.append(f"wrote {p}")
135
+ # Unit files are written above regardless — they're a prerequisite
136
+ # for any system that CAN run systemd. But if systemctl is absent
137
+ # (Docker container, macOS, WSL1), skip the daemon-reload/enable
138
+ # phase with a clear message rather than stacking cryptic "command
139
+ # not found" errors on top of each other.
140
+ if shutil.which("systemctl") is None:
141
+ log.append(
142
+ "systemctl not available — unit files written but not activated. "
143
+ "On a systemd-enabled host, re-run `getbased-stack install` to enable + start."
144
+ )
145
+ return log
128
146
  r = self.daemon_reload()
129
147
  if r.returncode != 0:
130
148
  log.append(f"daemon-reload FAILED: {r.stderr.strip()}")
@@ -1,3 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: getbased-agent-stack
3
+ Version: 0.5.2
4
+ Summary: One-command install of the full getbased agent stack — getbased-mcp + getbased-rag + getbased-dashboard
5
+ License-Expression: AGPL-3.0-or-later
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: getbased-mcp>=0.2.5
10
+ Requires-Dist: getbased-rag>=0.7.2
11
+ Requires-Dist: getbased-dashboard>=0.6.2
12
+ Provides-Extra: full
13
+ Requires-Dist: getbased-rag[full]>=0.7.2; extra == "full"
14
+ Provides-Extra: test
15
+ Requires-Dist: pytest>=8.0; extra == "test"
16
+ Requires-Dist: httpx>=0.27; extra == "test"
17
+ Requires-Dist: pytest-timeout>=2.3; extra == "test"
18
+ Dynamic: license-file
19
+
1
20
  # getbased-agent-stack
2
21
 
3
22
  Meta-package bundling the full [getbased](https://getbased.health) agent stack into one install: the MCP adapter, the RAG engine, the browser dashboard, an orchestration CLI (`init` / `install` / `mcp-config`), hardened systemd units for rag + dashboard, and paste-ready configs for Claude Desktop/Code, Cursor, Cline, and Hermes.
@@ -6,21 +25,34 @@ Part of the [getbased-agents monorepo](https://github.com/elkimek/getbased-agent
6
25
 
7
26
  ## Install
8
27
 
28
+ Linux, one command:
29
+
30
+ ```bash
31
+ curl -sSL https://getbased.health/install.sh | bash
32
+ ```
33
+
34
+ Runs end-to-end: installs `getbased-agent-stack[full]` via whichever of `uv` or `pipx` is available, exposes sibling binaries, runs `getbased-stack init --yes`, and starts rag + dashboard as systemd user services. [Read the script first](https://github.com/elkimek/get-based-site/blob/main/install.sh) if you're cautious.
35
+
36
+ Manual — pipx:
37
+
9
38
  ```bash
10
39
  pipx install --include-deps "getbased-agent-stack[full]"
11
40
  ```
12
41
 
13
42
  The `--include-deps` flag is required — it exposes `getbased-mcp`, `lens`, and `getbased-dashboard` alongside `getbased-stack` on your PATH. Without it, pipx only links the stack's own entry point and the MCP/rag/dashboard binaries stay hidden inside the venv.
14
43
 
15
- `uv` users: install each package as its own tool instead, since `uv tool` has no `--include-deps` equivalent yet:
44
+ Manual uv (0.11+):
16
45
 
17
46
  ```bash
18
- uv tool install getbased-mcp
19
- uv tool install "getbased-rag[full]"
20
- uv tool install getbased-dashboard
21
- uv tool install "getbased-agent-stack[full]"
47
+ uv tool install \
48
+ --with-executables-from getbased-rag \
49
+ --with-executables-from getbased-dashboard \
50
+ --with-executables-from getbased-mcp \
51
+ "getbased-agent-stack[full]"
22
52
  ```
23
53
 
54
+ `--with-executables-from` is uv's equivalent of pipx's `--include-deps` — one tool venv, all four binaries on PATH.
55
+
24
56
  Pulls:
25
57
 
26
58
  - [`getbased-mcp`](https://github.com/elkimek/getbased-agents/tree/main/packages/mcp) — stdio MCP server that Claude Code / Hermes / OpenClaw spawn
@@ -33,17 +65,27 @@ Total install: ~500 MB (the ML deps dominate). Smaller installs available — `p
33
65
 
34
66
  ## Quickstart — one command
35
67
 
68
+ Interactive wizard:
69
+
36
70
  ```bash
37
71
  getbased-stack init
38
72
  ```
39
73
 
74
+ Non-interactive (for scripted installs and curl | bash; `install.sh` uses this):
75
+
76
+ ```bash
77
+ getbased-stack init --yes
78
+ ```
79
+
40
80
  The wizard (~30 seconds):
41
81
 
42
- 1. Prompts for your `GETBASED_TOKEN` (skip if you don't use sync)
82
+ 1. Prompts for your `GETBASED_TOKEN` (skip if you don't use sync; `--yes` skips)
43
83
  2. Generates a rag API key if one doesn't exist
44
84
  3. Writes `~/.config/getbased/env` (mode 0600) — the shared config file
45
85
  4. Installs systemd user units for rag + dashboard, enables them, starts them
46
86
 
87
+ On non-systemd hosts (Docker, macOS, WSL1) step 4 writes the unit files but skips activation with a clear message instead of crashing — re-run on a systemd-enabled host or start `lens serve` + `getbased-dashboard serve` manually.
88
+
47
89
  Then paste one line into your MCP client:
48
90
 
49
91
  ```bash
@@ -135,4 +177,4 @@ The integration test (`tests/test_integration.py`) spins up `lens serve` in a su
135
177
 
136
178
  ## Licence
137
179
 
138
- GPL-3.0-only, matching the siblings.
180
+ AGPL-3.0-or-later, matching the siblings.
@@ -0,0 +1,11 @@
1
+ getbased-mcp>=0.2.5
2
+ getbased-rag>=0.7.2
3
+ getbased-dashboard>=0.6.2
4
+
5
+ [full]
6
+ getbased-rag[full]>=0.7.2
7
+
8
+ [test]
9
+ pytest>=8.0
10
+ httpx>=0.27
11
+ pytest-timeout>=2.3
@@ -331,6 +331,25 @@ def test_init_yes_installs_units_without_asking(stack_home, fake_shell, monkeypa
331
331
  assert (stack_home / "config" / "systemd" / "user" / "getbased-dashboard.service").exists()
332
332
 
333
333
 
334
+ def test_init_yes_survives_missing_systemctl(stack_home, fake_shell, monkeypatch):
335
+ """--yes on a host without systemctl (Docker, macOS, WSL1) must NOT
336
+ crash with an unhandled FileNotFoundError. Unit files still land;
337
+ systemd ops are skipped with a clear message."""
338
+ import shutil as _shutil
339
+ monkeypatch.setattr(_shutil, "which", lambda name: None)
340
+ # Prompts still stubbed defensively — --yes shouldn't call them.
341
+ monkeypatch.setattr("builtins.input", lambda *a, **kw: "")
342
+ monkeypatch.setattr("getpass.getpass", lambda *a, **kw: "")
343
+
344
+ rc, out, _ = _run(["init", "--yes"])
345
+ assert rc == 0
346
+ # Unit files still written (for re-run on a systemd-enabled host)
347
+ assert (stack_home / "config" / "systemd" / "user" / "getbased-rag.service").exists()
348
+ # Graceful message, not a traceback
349
+ assert "systemctl not available" in out
350
+ assert "Traceback" not in out
351
+
352
+
334
353
  def test_init_yes_preserves_existing_token(stack_home, fake_shell, monkeypatch):
335
354
  """Non-interactive mode must not nuke a previously-saved token —
336
355
  it takes the 'keep current' default, same as pressing Enter."""
@@ -164,6 +164,40 @@ def test_install_daemon_reload_failure_short_circuits(tmp_path):
164
164
  assert any("daemon-reload FAILED" in line for line in log)
165
165
 
166
166
 
167
+ def test_real_shell_handles_missing_binary(monkeypatch):
168
+ """_real_shell must not raise FileNotFoundError when systemctl is
169
+ absent (Docker, macOS, WSL1). Before 0.5.1 this crashed `init` with
170
+ an unhandled traceback — check it returns a shell-like 127 instead."""
171
+ import subprocess as sp
172
+
173
+ def boom(*a, **kw):
174
+ raise FileNotFoundError(2, "No such file or directory", "systemctl")
175
+
176
+ monkeypatch.setattr(sp, "run", boom)
177
+ r = units._real_shell(["systemctl", "--user", "daemon-reload"])
178
+ assert r.returncode == 127
179
+ assert "command not found" in r.stderr
180
+ assert "systemctl" in r.stderr
181
+
182
+
183
+ def test_install_skips_when_systemctl_absent(tmp_path, monkeypatch):
184
+ """On a host without systemctl, `install()` must write unit files
185
+ (harmless, enables later re-run) but skip daemon-reload/enable with
186
+ a clear message — not stack FAILED errors on top of each other."""
187
+ monkeypatch.setattr(units.shutil, "which", lambda name: None)
188
+ shell = FakeShell()
189
+ mgr = UnitManager(unit_dir=tmp_path, shell=shell)
190
+ log = mgr.install()
191
+
192
+ # Files written (prereq for future systemd-enabled reinstall)
193
+ for name in SERVICE_NAMES:
194
+ assert (tmp_path / name).exists()
195
+ # No systemctl calls attempted
196
+ assert not any(c[:1] == ["systemctl"] for c in shell.calls)
197
+ # User-visible message present
198
+ assert any("systemctl not available" in line for line in log)
199
+
200
+
167
201
  def test_install_enable_failure_reported(tmp_path):
168
202
  shell = FakeShell(
169
203
  {
@@ -1,22 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
- Preamble
9
-
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
12
-
13
- The licenses for most software and other practical works are designed
14
- to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
- share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
20
- your programs, too.
21
-
22
- For the full license text, see <https://www.gnu.org/licenses/gpl-3.0.txt>
@@ -1,11 +0,0 @@
1
- getbased-mcp>=0.2.3
2
- getbased-rag>=0.7.1
3
- getbased-dashboard>=0.6.1
4
-
5
- [full]
6
- getbased-rag[full]>=0.7.1
7
-
8
- [test]
9
- pytest>=8.0
10
- httpx>=0.27
11
- pytest-timeout>=2.3