agent-brain-cli 10.3.0__tar.gz → 10.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.
Files changed (48) hide show
  1. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/PKG-INFO +2 -2
  2. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/__init__.py +1 -1
  3. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/client/transport.py +53 -2
  4. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/pyproject.toml +2 -2
  5. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/README.md +0 -0
  6. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/__main__.py +0 -0
  7. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/cli.py +0 -0
  8. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/client/__init__.py +0 -0
  9. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/client/api_client.py +0 -0
  10. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/client/protocol.py +0 -0
  11. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/__init__.py +0 -0
  12. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/cache.py +0 -0
  13. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/config.py +0 -0
  14. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/doctor.py +0 -0
  15. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/folders.py +0 -0
  16. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/index.py +0 -0
  17. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/init.py +0 -0
  18. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/inject.py +0 -0
  19. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/install_agent.py +0 -0
  20. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/jobs.py +0 -0
  21. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/list_cmd.py +0 -0
  22. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/mcp.py +0 -0
  23. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/prompt.py +0 -0
  24. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/query.py +0 -0
  25. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/reset.py +0 -0
  26. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/resources.py +0 -0
  27. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/start.py +0 -0
  28. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/status.py +0 -0
  29. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/stop.py +0 -0
  30. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/types.py +0 -0
  31. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/commands/uninstall.py +0 -0
  32. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/config.py +0 -0
  33. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/config_migrate.py +0 -0
  34. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/config_schema.py +0 -0
  35. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/diagnostics.py +0 -0
  36. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/mcp_runtime.py +0 -0
  37. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/migration.py +0 -0
  38. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/runtime/__init__.py +0 -0
  39. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/runtime/claude_converter.py +0 -0
  40. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/runtime/codex_converter.py +0 -0
  41. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/runtime/converter_base.py +0 -0
  42. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/runtime/gemini_converter.py +0 -0
  43. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/runtime/opencode_converter.py +0 -0
  44. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/runtime/parser.py +0 -0
  45. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/runtime/skill_runtime_converter.py +0 -0
  46. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/runtime/tool_maps.py +0 -0
  47. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/runtime/types.py +0 -0
  48. {agent_brain_cli-10.3.0 → agent_brain_cli-10.3.2}/agent_brain_cli/xdg_paths.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agent-brain-cli
3
- Version: 10.3.0
3
+ Version: 10.3.2
4
4
  Summary: Agent Brain CLI - Command-line interface for managing AI agent memory and knowledge retrieval
5
5
  Home-page: https://github.com/SpillwaveSolutions/agent-brain
6
6
  License: MIT
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3
15
15
  Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
- Requires-Dist: agent-brain-rag (>=10.3.0,<11.0.0)
18
+ Requires-Dist: agent-brain-rag (>=10.3.2,<11.0.0)
19
19
  Requires-Dist: agent-brain-uds (>=10.3.0,<11.0.0)
20
20
  Requires-Dist: click (>=8.1.0,<9.0.0)
21
21
  Requires-Dist: httpx (>=0.28.0,<0.29.0)
@@ -1,3 +1,3 @@
1
1
  """Doc-Serve CLI - Command-line interface for managing Doc-Serve server."""
2
2
 
3
- __version__ = "10.3.0"
3
+ __version__ = "10.3.2"
@@ -32,6 +32,7 @@ Three §3.5 design-doc misuse cases surface as ``click.UsageError``
32
32
 
33
33
  from __future__ import annotations
34
34
 
35
+ import os
35
36
  import shutil
36
37
  from pathlib import Path
37
38
  from typing import cast
@@ -63,6 +64,41 @@ def _resolve_state_dir_for_discovery() -> Path | None:
63
64
  return None
64
65
 
65
66
 
67
+ def _stdio_command(state_dir: Path | None) -> str | list[str]:
68
+ """Build the ``agent-brain-mcp`` stdio command, pinning the state dir.
69
+
70
+ When ``state_dir`` is resolved, returns
71
+ ``["agent-brain-mcp", "--state-dir", <path>]`` so the spawned MCP
72
+ server resolves the same backend the CLI's UDS path would (CLI-MCP-04
73
+ byte-identical guarantee). ``McpStdioBackend`` filters the subprocess
74
+ env through ``DEFAULT_ENV_ALLOWLIST`` (which intentionally drops
75
+ ``AGENT_BRAIN_STATE_DIR``), so an explicit arg is the only reliable
76
+ way to propagate the state dir across the env boundary.
77
+
78
+ ``AGENT_BRAIN_STATE_DIR`` takes precedence over the discovery value,
79
+ mirroring the UDS leg (``resolve_transport`` →
80
+ ``resolve_socket_path`` honors the same override). Without this, a
81
+ user who sets ``AGENT_BRAIN_STATE_DIR`` and runs from a non-project
82
+ cwd would get the project-root discovery dir on the MCP leg but the
83
+ override on the UDS leg — diverging the two and breaking CLI-MCP-04.
84
+
85
+ When neither the env override nor ``state_dir`` resolves, returns the
86
+ bare ``"agent-brain-mcp"`` string and lets the subprocess fall back
87
+ to its own cwd-based discovery — preserving pre-fix behavior.
88
+ """
89
+ env_override = os.environ.get("AGENT_BRAIN_STATE_DIR")
90
+ if env_override:
91
+ resolved: str | None = str(Path(env_override).expanduser())
92
+ elif state_dir is not None:
93
+ resolved = str(state_dir)
94
+ else:
95
+ resolved = None
96
+
97
+ if resolved is None:
98
+ return "agent-brain-mcp"
99
+ return ["agent-brain-mcp", "--state-dir", resolved]
100
+
101
+
66
102
  def open_backend(ctx: click.Context, *, timeout: float = 30.0) -> BackendClient:
67
103
  """Construct a ``BackendClient`` over the transport selected by ``ctx``.
68
104
 
@@ -132,11 +168,21 @@ def open_backend(ctx: click.Context, *, timeout: float = 30.0) -> BackendClient:
132
168
  "agent-brain-mcp not found on PATH; install "
133
169
  "agent-brain-mcp into the same Python environment"
134
170
  )
171
+ # Pin the resolved state dir into the subprocess as an
172
+ # explicit --state-dir arg (CLI-MCP-04). McpStdioBackend
173
+ # filters env through DEFAULT_ENV_ALLOWLIST, which drops
174
+ # AGENT_BRAIN_STATE_DIR, so without this the spawned
175
+ # agent-brain-mcp falls back to cwd discovery and may resolve
176
+ # a DIFFERENT backend than --transport uds. Passing the dir
177
+ # explicitly makes the byte-identical guarantee hold from any
178
+ # cwd. When state_dir is None (resolution failed) we keep the
179
+ # bare command and let agent-brain-mcp do its own cwd discovery.
180
+ command = _stdio_command(state_dir)
135
181
  # cast(): agent_brain_mcp ships with ignore_missing_imports=true
136
182
  # so mypy treats McpStdioBackend as Any. The runtime
137
183
  # @runtime_checkable Protocol contract is pinned by the
138
184
  # Phase 56-03 isinstance test in agent-brain-mcp/tests/.
139
- return cast(BackendClient, McpStdioBackend(command="agent-brain-mcp"))
185
+ return cast(BackendClient, McpStdioBackend(command=command))
140
186
  # mcp_transport == "http" — resolve_mcp_transport guarantees
141
187
  # mcp_target is not None for the http branch.
142
188
  assert mcp_target is not None # noqa: S101
@@ -244,11 +290,16 @@ def open_mcp_backend(ctx: click.Context, *, timeout: float = 30.0) -> McpBackend
244
290
  "agent-brain-mcp not found on PATH; install "
245
291
  "agent-brain-mcp into the same Python environment"
246
292
  )
293
+ # Pin the resolved state dir into the subprocess (CLI-MCP-04) —
294
+ # same rationale as open_backend: DEFAULT_ENV_ALLOWLIST drops
295
+ # AGENT_BRAIN_STATE_DIR, so prompts/resources would otherwise run
296
+ # against a cwd-discovered backend.
297
+ command = _stdio_command(state_dir)
247
298
  # cast(): mirrors open_backend's pattern. The runtime
248
299
  # @runtime_checkable Protocol contract is pinned by the
249
300
  # Plan 59-01 isinstance test in agent-brain-mcp/tests/
250
301
  # test_mcp_backend_protocol_skeleton.py.
251
- return cast(McpBackend, McpStdioBackend(command="agent-brain-mcp"))
302
+ return cast(McpBackend, McpStdioBackend(command=command))
252
303
  # mcp_transport == "http" — resolve_mcp_transport guarantees
253
304
  # mcp_target is not None for the http branch.
254
305
  assert mcp_target is not None # noqa: S101
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "agent-brain-cli"
3
- version = "10.3.0"
3
+ version = "10.3.2"
4
4
  description = "Agent Brain CLI - Command-line interface for managing AI agent memory and knowledge retrieval"
5
5
  authors = ["Spillwave Solutions"]
6
6
  readme = "README.md"
@@ -27,7 +27,7 @@ httpx = "^0.28.0"
27
27
  rich = "^13.9.0"
28
28
  pyyaml = "^6.0.0"
29
29
  pydantic = "^2.10.0"
30
- agent-brain-rag = "^10.3.0"
30
+ agent-brain-rag = "^10.3.2"
31
31
  agent-brain-uds = "^10.3.0"
32
32
  psutil = "^6.0"
33
33