rtxclaw 0.1.0__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 (181) hide show
  1. rtxclaw-0.1.0/LICENSE +21 -0
  2. rtxclaw-0.1.0/MANIFEST.in +15 -0
  3. rtxclaw-0.1.0/PKG-INFO +416 -0
  4. rtxclaw-0.1.0/README.md +371 -0
  5. rtxclaw-0.1.0/pyproject.toml +123 -0
  6. rtxclaw-0.1.0/setup.cfg +4 -0
  7. rtxclaw-0.1.0/src/requirements.txt +64 -0
  8. rtxclaw-0.1.0/src/rtxclaw.egg-info/PKG-INFO +416 -0
  9. rtxclaw-0.1.0/src/rtxclaw.egg-info/SOURCES.txt +179 -0
  10. rtxclaw-0.1.0/src/rtxclaw.egg-info/dependency_links.txt +1 -0
  11. rtxclaw-0.1.0/src/rtxclaw.egg-info/entry_points.txt +2 -0
  12. rtxclaw-0.1.0/src/rtxclaw.egg-info/requires.txt +27 -0
  13. rtxclaw-0.1.0/src/rtxclaw.egg-info/top_level.txt +7 -0
  14. rtxclaw-0.1.0/src/rtxclaw_acp/__init__.py +20 -0
  15. rtxclaw-0.1.0/src/rtxclaw_acp/client/__init__.py +54 -0
  16. rtxclaw-0.1.0/src/rtxclaw_acp/client/client.py +711 -0
  17. rtxclaw-0.1.0/src/rtxclaw_acp/client/handlers.py +128 -0
  18. rtxclaw-0.1.0/src/rtxclaw_acp/client/http_spawn.py +265 -0
  19. rtxclaw-0.1.0/src/rtxclaw_acp/client/spawn.py +98 -0
  20. rtxclaw-0.1.0/src/rtxclaw_acp/client/ws_spawn.py +111 -0
  21. rtxclaw-0.1.0/src/rtxclaw_acp/protocol/__init__.py +45 -0
  22. rtxclaw-0.1.0/src/rtxclaw_acp/protocol/http.py +339 -0
  23. rtxclaw-0.1.0/src/rtxclaw_acp/protocol/jsonrpc.py +494 -0
  24. rtxclaw-0.1.0/src/rtxclaw_acp/protocol/schema.py +104 -0
  25. rtxclaw-0.1.0/src/rtxclaw_acp/protocol/transport.py +92 -0
  26. rtxclaw-0.1.0/src/rtxclaw_acp/protocol/ws.py +167 -0
  27. rtxclaw-0.1.0/src/rtxclaw_acp/server/__init__.py +33 -0
  28. rtxclaw-0.1.0/src/rtxclaw_acp/server/backend.py +174 -0
  29. rtxclaw-0.1.0/src/rtxclaw_acp/server/http_server.py +554 -0
  30. rtxclaw-0.1.0/src/rtxclaw_acp/server/server.py +834 -0
  31. rtxclaw-0.1.0/src/rtxclaw_acp/server/spawn.py +93 -0
  32. rtxclaw-0.1.0/src/rtxclaw_acp/server/ws_server.py +269 -0
  33. rtxclaw-0.1.0/src/rtxclaw_agent/__init__.py +34 -0
  34. rtxclaw-0.1.0/src/rtxclaw_agent/__main__.py +14 -0
  35. rtxclaw-0.1.0/src/rtxclaw_agent/acp_bridge.py +5118 -0
  36. rtxclaw-0.1.0/src/rtxclaw_agent/acp_stdio_main.py +130 -0
  37. rtxclaw-0.1.0/src/rtxclaw_agent/agent_cli.py +1368 -0
  38. rtxclaw-0.1.0/src/rtxclaw_agent/cli.py +209 -0
  39. rtxclaw-0.1.0/src/rtxclaw_agent/config.py +58 -0
  40. rtxclaw-0.1.0/src/rtxclaw_agent/doctor.py +407 -0
  41. rtxclaw-0.1.0/src/rtxclaw_agent/gateway.py +332 -0
  42. rtxclaw-0.1.0/src/rtxclaw_agent/gateway_cli.py +706 -0
  43. rtxclaw-0.1.0/src/rtxclaw_agent/heartbeat.py +500 -0
  44. rtxclaw-0.1.0/src/rtxclaw_agent/openai_endpoint.py +1075 -0
  45. rtxclaw-0.1.0/src/rtxclaw_agent/py.typed +0 -0
  46. rtxclaw-0.1.0/src/rtxclaw_agent/runtime.py +147 -0
  47. rtxclaw-0.1.0/src/rtxclaw_agent/server.py +32 -0
  48. rtxclaw-0.1.0/src/rtxclaw_agent/worker.py +677 -0
  49. rtxclaw-0.1.0/src/rtxclaw_core/__init__.py +13 -0
  50. rtxclaw-0.1.0/src/rtxclaw_core/agent.py +1418 -0
  51. rtxclaw-0.1.0/src/rtxclaw_core/agents/__init__.py +185 -0
  52. rtxclaw-0.1.0/src/rtxclaw_core/agents/acp_translation.py +498 -0
  53. rtxclaw-0.1.0/src/rtxclaw_core/agents/agent.py +1618 -0
  54. rtxclaw-0.1.0/src/rtxclaw_core/agents/claude_engine.py +631 -0
  55. rtxclaw-0.1.0/src/rtxclaw_core/agents/codex_engine.py +378 -0
  56. rtxclaw-0.1.0/src/rtxclaw_core/agents/default_scaffolds.py +320 -0
  57. rtxclaw-0.1.0/src/rtxclaw_core/agents/engine.py +635 -0
  58. rtxclaw-0.1.0/src/rtxclaw_core/agents/external_cli.py +1100 -0
  59. rtxclaw-0.1.0/src/rtxclaw_core/agents/factory.py +143 -0
  60. rtxclaw-0.1.0/src/rtxclaw_core/agents/gateway_shim.py +517 -0
  61. rtxclaw-0.1.0/src/rtxclaw_core/agents/gemini_engine.py +805 -0
  62. rtxclaw-0.1.0/src/rtxclaw_core/agents/legacy_compat.py +636 -0
  63. rtxclaw-0.1.0/src/rtxclaw_core/agents/local_llm.py +2565 -0
  64. rtxclaw-0.1.0/src/rtxclaw_core/agents/permissions_integration.py +404 -0
  65. rtxclaw-0.1.0/src/rtxclaw_core/agents/regression_checklist.py +717 -0
  66. rtxclaw-0.1.0/src/rtxclaw_core/agents/session_log.py +426 -0
  67. rtxclaw-0.1.0/src/rtxclaw_core/agents/wire_protocols.py +283 -0
  68. rtxclaw-0.1.0/src/rtxclaw_core/builtin_skills/__init__.py +13 -0
  69. rtxclaw-0.1.0/src/rtxclaw_core/builtin_skills/config-setup/SKILL.md +295 -0
  70. rtxclaw-0.1.0/src/rtxclaw_core/builtin_skills/nodriver-browser/SKILL.md +220 -0
  71. rtxclaw-0.1.0/src/rtxclaw_core/commands.py +261 -0
  72. rtxclaw-0.1.0/src/rtxclaw_core/config.py +174 -0
  73. rtxclaw-0.1.0/src/rtxclaw_core/context.py +212 -0
  74. rtxclaw-0.1.0/src/rtxclaw_core/context_report.py +521 -0
  75. rtxclaw-0.1.0/src/rtxclaw_core/errors.py +265 -0
  76. rtxclaw-0.1.0/src/rtxclaw_core/event_bus.py +219 -0
  77. rtxclaw-0.1.0/src/rtxclaw_core/hooks.py +363 -0
  78. rtxclaw-0.1.0/src/rtxclaw_core/json_repair.py +121 -0
  79. rtxclaw-0.1.0/src/rtxclaw_core/models.py +424 -0
  80. rtxclaw-0.1.0/src/rtxclaw_core/plan_steps.py +63 -0
  81. rtxclaw-0.1.0/src/rtxclaw_core/providers.py +252 -0
  82. rtxclaw-0.1.0/src/rtxclaw_core/restart.py +216 -0
  83. rtxclaw-0.1.0/src/rtxclaw_core/session.py +377 -0
  84. rtxclaw-0.1.0/src/rtxclaw_core/session_index.py +596 -0
  85. rtxclaw-0.1.0/src/rtxclaw_core/skill_index.py +325 -0
  86. rtxclaw-0.1.0/src/rtxclaw_core/skills.py +405 -0
  87. rtxclaw-0.1.0/src/rtxclaw_core/splitter.py +76 -0
  88. rtxclaw-0.1.0/src/rtxclaw_core/sqlite_facts.py +1013 -0
  89. rtxclaw-0.1.0/src/rtxclaw_core/system_prompt.py +373 -0
  90. rtxclaw-0.1.0/src/rtxclaw_core/tool_runner.py +166 -0
  91. rtxclaw-0.1.0/src/rtxclaw_core/tools/__init__.py +82 -0
  92. rtxclaw-0.1.0/src/rtxclaw_core/tools/_log.py +82 -0
  93. rtxclaw-0.1.0/src/rtxclaw_core/tools/monitor.py +736 -0
  94. rtxclaw-0.1.0/src/rtxclaw_core/tools/permissions.py +341 -0
  95. rtxclaw-0.1.0/src/rtxclaw_core/tools/prompt.py +29 -0
  96. rtxclaw-0.1.0/src/rtxclaw_core/tools/registry.py +1801 -0
  97. rtxclaw-0.1.0/src/rtxclaw_core/tools/runners.py +4332 -0
  98. rtxclaw-0.1.0/src/rtxclaw_core/tools/safety.py +216 -0
  99. rtxclaw-0.1.0/src/rtxclaw_core/turn_runtime.py +1605 -0
  100. rtxclaw-0.1.0/src/rtxclaw_mcp/__init__.py +10 -0
  101. rtxclaw-0.1.0/src/rtxclaw_mcp/mcp_client.py +536 -0
  102. rtxclaw-0.1.0/src/rtxclaw_mcp/youtube_mcp_server.py +1003 -0
  103. rtxclaw-0.1.0/src/rtxclaw_memory/__init__.py +16 -0
  104. rtxclaw-0.1.0/src/rtxclaw_memory/memory_embed.py +379 -0
  105. rtxclaw-0.1.0/src/rtxclaw_memory/memory_index.py +1398 -0
  106. rtxclaw-0.1.0/src/rtxclaw_memory/memory_manager.py +545 -0
  107. rtxclaw-0.1.0/src/rtxclaw_memory/memory_primitives.py +207 -0
  108. rtxclaw-0.1.0/src/rtxclaw_memory/memory_provider.py +128 -0
  109. rtxclaw-0.1.0/src/rtxclaw_memory/memory_synth.py +286 -0
  110. rtxclaw-0.1.0/src/rtxclaw_memory/memory_tools.py +231 -0
  111. rtxclaw-0.1.0/src/rtxclaw_memory/memory_write.py +418 -0
  112. rtxclaw-0.1.0/src/rtxclaw_telegram/__init__.py +22 -0
  113. rtxclaw-0.1.0/src/rtxclaw_telegram/bot.py +4612 -0
  114. rtxclaw-0.1.0/src/rtxclaw_telegram/cli.py +320 -0
  115. rtxclaw-0.1.0/src/rtxclaw_telegram/config.py +246 -0
  116. rtxclaw-0.1.0/src/rtxclaw_telegram/py.typed +0 -0
  117. rtxclaw-0.1.0/src/rtxclaw_tui/__init__.py +10 -0
  118. rtxclaw-0.1.0/src/rtxclaw_tui/__main__.py +4 -0
  119. rtxclaw-0.1.0/src/rtxclaw_tui/agent_client.py +1931 -0
  120. rtxclaw-0.1.0/src/rtxclaw_tui/app.py +9799 -0
  121. rtxclaw-0.1.0/src/rtxclaw_tui/commands.py +19 -0
  122. rtxclaw-0.1.0/src/rtxclaw_tui/py.typed +0 -0
  123. rtxclaw-0.1.0/tests/test_00_prereqs.py +32 -0
  124. rtxclaw-0.1.0/tests/test_01_bootstrap.py +74 -0
  125. rtxclaw-0.1.0/tests/test_02_workspace.py +115 -0
  126. rtxclaw-0.1.0/tests/test_03_agent_scaffold.py +48 -0
  127. rtxclaw-0.1.0/tests/test_04_daemon_lifecycle.py +99 -0
  128. rtxclaw-0.1.0/tests/test_05_tui_smoke.py +229 -0
  129. rtxclaw-0.1.0/tests/test_06_oneshot.py +68 -0
  130. rtxclaw-0.1.0/tests/test_07_memory.py +312 -0
  131. rtxclaw-0.1.0/tests/test_08_telegram.py +241 -0
  132. rtxclaw-0.1.0/tests/test_10_telegram_commands.py +2151 -0
  133. rtxclaw-0.1.0/tests/test_11_tui_commands.py +757 -0
  134. rtxclaw-0.1.0/tests/test_12_reasoning_loop_detection.py +139 -0
  135. rtxclaw-0.1.0/tests/test_13_auto_compaction.py +172 -0
  136. rtxclaw-0.1.0/tests/test_14_memory_search_api.py +125 -0
  137. rtxclaw-0.1.0/tests/test_15_skills.py +267 -0
  138. rtxclaw-0.1.0/tests/test_16_acp_routes.py +330 -0
  139. rtxclaw-0.1.0/tests/test_17_small_models.py +139 -0
  140. rtxclaw-0.1.0/tests/test_18_acp_spec_compliance.py +139 -0
  141. rtxclaw-0.1.0/tests/test_19_mcp_client.py +158 -0
  142. rtxclaw-0.1.0/tests/test_20_delegate_turn_record.py +119 -0
  143. rtxclaw-0.1.0/tests/test_21_hooks.py +163 -0
  144. rtxclaw-0.1.0/tests/test_22_session_persist.py +176 -0
  145. rtxclaw-0.1.0/tests/test_23_session_index.py +158 -0
  146. rtxclaw-0.1.0/tests/test_24_commands_parser.py +189 -0
  147. rtxclaw-0.1.0/tests/test_25_context_loader.py +146 -0
  148. rtxclaw-0.1.0/tests/test_26_telegram_helpers.py +741 -0
  149. rtxclaw-0.1.0/tests/test_27_system_prompt.py +181 -0
  150. rtxclaw-0.1.0/tests/test_28_plan_steps.py +258 -0
  151. rtxclaw-0.1.0/tests/test_30_tool_search.py +222 -0
  152. rtxclaw-0.1.0/tests/test_31_read_file_slicing.py +216 -0
  153. rtxclaw-0.1.0/tests/test_32_nudge_continuation.py +164 -0
  154. rtxclaw-0.1.0/tests/test_33_reasoning_roundtrip.py +139 -0
  155. rtxclaw-0.1.0/tests/test_34_event_logging.py +204 -0
  156. rtxclaw-0.1.0/tests/test_35_set_mode_gate.py +175 -0
  157. rtxclaw-0.1.0/tests/test_36_inject_current_todos.py +121 -0
  158. rtxclaw-0.1.0/tests/test_37_telegram_image_block.py +189 -0
  159. rtxclaw-0.1.0/tests/test_38_restart_gateway_aware.py +251 -0
  160. rtxclaw-0.1.0/tests/test_39_image_prompt_capability.py +124 -0
  161. rtxclaw-0.1.0/tests/test_40_parallel_tools.py +476 -0
  162. rtxclaw-0.1.0/tests/test_41_tui_parallel_tool_render_order.py +281 -0
  163. rtxclaw-0.1.0/tests/test_42_telegram_env_bootstrap.py +195 -0
  164. rtxclaw-0.1.0/tests/test_42_tui_streaming_tool_split.py +284 -0
  165. rtxclaw-0.1.0/tests/test_43_telegram_audio_transcode.py +123 -0
  166. rtxclaw-0.1.0/tests/test_43_tui_shells_session_isolation.py +147 -0
  167. rtxclaw-0.1.0/tests/test_44_todo_replace_merge.py +164 -0
  168. rtxclaw-0.1.0/tests/test_45_layered_loop_detection.py +48 -0
  169. rtxclaw-0.1.0/tests/test_46_model_sampling_request.py +93 -0
  170. rtxclaw-0.1.0/tests/test_47_delegate_claude_retry.py +141 -0
  171. rtxclaw-0.1.0/tests/test_50_openai_endpoint.py +506 -0
  172. rtxclaw-0.1.0/tests/test_51_cli_engine_concurrent_sids.py +337 -0
  173. rtxclaw-0.1.0/tests/test_52_cli_engine_prompt_drift_resumes.py +196 -0
  174. rtxclaw-0.1.0/tests/test_53_ratio_loop_false_positive.py +170 -0
  175. rtxclaw-0.1.0/tests/test_54_image_model_capability.py +233 -0
  176. rtxclaw-0.1.0/tests/test_55_cli_engine_image_attach.py +263 -0
  177. rtxclaw-0.1.0/tests/test_56_permission_outbound_routing.py +360 -0
  178. rtxclaw-0.1.0/tests/test_57_update_tool_diff_widget.py +188 -0
  179. rtxclaw-0.1.0/tests/test_58_pip_install_wizard.py +436 -0
  180. rtxclaw-0.1.0/tests/test_agents_skeleton.py +874 -0
  181. rtxclaw-0.1.0/tests/test_zz_cleanup.py +77 -0
rtxclaw-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rtxclaw.ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,15 @@
1
+ # sdist contents beyond the auto-included package sources.
2
+ #
3
+ # Wheels are driven by [tool.setuptools.package-data] in pyproject.toml;
4
+ # this file only matters for `python -m build --sdist` (e.g. a future
5
+ # PyPI upload). The git+https install path builds a wheel straight from
6
+ # the source tree and never consults MANIFEST.in.
7
+
8
+ include README.md
9
+ include LICENSE
10
+ include pyproject.toml
11
+ include src/requirements.txt
12
+ recursive-include src/rtxclaw_core/builtin_skills *
13
+ global-include py.typed
14
+ global-exclude __pycache__/*
15
+ global-exclude *.py[cod]
rtxclaw-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,416 @@
1
+ Metadata-Version: 2.4
2
+ Name: rtxclaw
3
+ Version: 0.1.0
4
+ Summary: Sovereign-inference TUI chat against an OpenAI-compatible vLLM endpoint.
5
+ Author: rtxclaw.ai
6
+ License-Expression: MIT
7
+ Keywords: llm,tui,vllm,agent,acp,sovereign-inference
8
+ Classifier: Environment :: Console
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: textual>=0.85
19
+ Requires-Dist: httpx>=0.27
20
+ Requires-Dist: aiohttp>=3.9
21
+ Requires-Dist: rich>=13.0
22
+ Requires-Dist: trafilatura>=2.0
23
+ Requires-Dist: openai>=1.0
24
+ Requires-Dist: sqlite-vec>=0.1.6
25
+ Requires-Dist: mcp>=1.0
26
+ Requires-Dist: markitdown[pdf]>=0.0.1a3
27
+ Requires-Dist: markitdown-mcp>=0.0.1a3
28
+ Requires-Dist: agent-client-protocol>=0.9
29
+ Requires-Dist: hypercorn>=0.17
30
+ Requires-Dist: starlette>=0.40
31
+ Requires-Dist: sse-starlette>=2.1
32
+ Requires-Dist: imageio-ffmpeg>=0.5.1
33
+ Requires-Dist: yt-dlp>=2024.10.7
34
+ Requires-Dist: youtube-transcript-api>=1.0
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest>=8.0; extra == "dev"
37
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
38
+ Requires-Dist: pytest-xdist>=3.5; extra == "dev"
39
+ Requires-Dist: pytest-timeout>=2.3; extra == "dev"
40
+ Requires-Dist: import-linter>=2.0; extra == "dev"
41
+ Requires-Dist: jsonschema>=4; extra == "dev"
42
+ Requires-Dist: telethon>=1.36; extra == "dev"
43
+ Requires-Dist: gTTS>=2.4; extra == "dev"
44
+ Dynamic: license-file
45
+
46
+ # rtxclaw.ai
47
+
48
+ > **Run it now:** `git clone … && cd rtxclaw && ./rtxclaw` —
49
+ > the launcher creates `.venv/`, installs dependencies, and starts
50
+ > the TUI. See **[Getting started](docs/getting-started.md)** for
51
+ > first-time configuration, the workspace layout, env knobs, and the
52
+ > `RTXCLAW_HOME=~/.rtxclaw-test` test-sandbox pattern.
53
+
54
+ ## Install
55
+
56
+ ```bash
57
+ pip install rtxclaw
58
+ ```
59
+
60
+ That puts a `rtxclaw` command on your `PATH`. Run it once with no
61
+ arguments — the first-run wizard walks you through the LLM endpoint,
62
+ model, and (optionally) Telegram, then brings the gateway up itself.
63
+ Three steps and you're in the TUI:
64
+
65
+ > **`pip install rtxclaw` → `rtxclaw` → answer the wizard → done.**
66
+
67
+ `pyproject.toml` declares the `rtxclaw_*` packages, the `rtxclaw`
68
+ console script, and the full runtime dependency set; cutting a release
69
+ is a `python -m build && twine upload dist/*` away.
70
+
71
+ ### From a clone (for development)
72
+
73
+ `git clone … && cd rtxclaw && ./rtxclaw` — the launcher creates
74
+ `.venv/`, runs an editable `pip install -e .`, and starts the TUI.
75
+
76
+ rtxclaw.ai is the cypherpunk version of inference.
77
+
78
+ It exists to empower the user to have total control over their data and ideas, without the hassle of endless configuration or requiring deep open-source model knowledge just to get useful work done.
79
+
80
+ This project starts from a hard truth: the AI industry is underinvesting in infrastructure and degrading model quality to keep up with demand. Decisions like blocking OpenClaw from the Max plan and forcing heavy API costs on users reinforce the view that AI companies are sucking people and companies’ ideas like the Matrix uses human crops for creativity and for studying human thought processes.
81
+
82
+ That is the opposite of sovereignty.
83
+
84
+ The current model asks users and companies to pour their private context, internal reasoning, product ideas, and operational intelligence into centralized AI systems they do not control. In return, they get rising costs, shrinking access, degraded quality under load, and dependence on infrastructure decisions made by someone else.
85
+
86
+ And the risk is not theoretical.
87
+
88
+ The imminent Taiwan conflict will create heavy shocks to current business. Any company relying on AI will have no option but to pay the price of neoclouds if supply chains seize up and centralized inference tightens further. Businesses that chose not to build on-prem infrastructure, or at least retain the option, will be trapped into paying whatever the market demands.
89
+
90
+ rtxclaw is the answer to that trap.
91
+
92
+ rtxclaw is a custom-built agent system that adapts to the available inference capacity by creating tailored agents for each hardware profile, from a modest RTX 3060 to RTX 3090, RTX 4090, RTX 5090, A6000-class workstations, and up to advanced rented neocloud GPUs on platforms like Vast.ai.
93
+
94
+ Instead of forcing every task through one oversized, expensive, centralized stack, rtxclaw rightsizes inference to the real job:
95
+
96
+ - small agents on cheap local hardware
97
+ - stronger agents on workstations
98
+ - burst agents on rented neocloud GPUs
99
+ - flexible routing based on actual available capacity
100
+ - model selection based on task value, latency, and hardware envelope
101
+ - agent behavior shaped around the realities of the machine it runs on
102
+
103
+ Agents can be spawned in seconds using the right-sizing capacity for each task, reducing the cost of AI while increasing resilience, performance, and control.
104
+
105
+ ## Why rtxclaw exists
106
+
107
+ Most AI products are built around a hidden assumption: the user should adapt to the vendor.
108
+
109
+ The vendor chooses the models.
110
+ The vendor chooses the pricing.
111
+ The vendor chooses when quality gets degraded.
112
+ The vendor chooses which products get blocked.
113
+ The vendor chooses which workloads are too expensive.
114
+ The vendor chooses whether your use case is welcome.
115
+
116
+ rtxclaw rejects that model.
117
+
118
+ The intelligence layer of a company is too important to outsource blindly. Your prompts are not just prompts. They are product direction, customer knowledge, internal process, strategy, failure modes, experimentation, and judgment in raw form. If your AI stack is not sovereign, your cognition stack is not sovereign.
119
+
120
+ ## Core principles
121
+
122
+ - **Own the data**
123
+ - **Own the ideas**
124
+ - **Own the inference path**
125
+ - **Minimize configuration**
126
+ - **Avoid vendor lock-in**
127
+ - **Use the smallest capable model**
128
+ - **Adapt to available hardware**
129
+ - **Keep the system understandable**
130
+ - **Prefer tailored agents over monolithic bloat**
131
+ - **Treat inference as infrastructure, not magic**
132
+ - **Cancel scopes you can reason about** — abort one session and only that session (plus its subagents) dies; abort the gateway and everything dies. No mystery middle ground.
133
+
134
+ ## Design philosophy
135
+
136
+ rtxclaw follows a simple philosophy: small enough to understand, flexible enough to adapt, powerful enough to matter.
137
+
138
+ Customization should come from code and agent behavior, not from endless configuration sprawl. The system should adapt to the user, the hardware, and the workload, not force the user to adapt to the limitations of a vendor’s pricing model or infrastructure bottlenecks.
139
+
140
+ This means:
141
+
142
+ - no blind dependence on one model provider
143
+ - no assumption that every task deserves frontier-model pricing
144
+ - no assumption that cloud is always the answer
145
+ - no assumption that local hardware is too weak to matter
146
+ - no assumption that one agent shape fits every machine
147
+
148
+ ## Hardware-aware agents
149
+
150
+ rtxclaw is built around the idea that different hardware should produce different agent strategies.
151
+
152
+ A small local card like an RTX 3060 should not be treated the same way as a 4090, a 5090, an RTX A6000, or a high-memory neocloud GPU. The system should understand the available VRAM, throughput, latency, and cost envelope, then spawn the right kind of agent for the job.
153
+
154
+ Examples:
155
+
156
+ - **RTX 3060 / 4060-class**: lightweight routing, summarization, background memory work, small local copilots
157
+ - **RTX 3090 / 4090-class**: stronger coding agents, research agents, orchestration, hybrid local inference
158
+ - **RTX 5090-class**: high-end desktop inference, multi-agent local workflows, stronger reasoning on-prem
159
+ - **A6000 / workstation-class**: larger-context agents, heavier pipelines, persistent business-critical agent roles
160
+ - **Vast.ai / neocloud GPUs**: burst capacity, specialized heavy jobs, temporary swarms, overflow compute
161
+
162
+ The point is not to chase the biggest GPU.
163
+ The point is to make every GPU useful.
164
+
165
+ ## What rtxclaw does
166
+
167
+ rtxclaw creates a custom-built agent system that:
168
+
169
+ - detects or knows the available inference capacity
170
+ - matches tasks to the right runtime and hardware tier
171
+ - spawns agents in seconds
172
+ - routes work based on cost, latency, and model capability
173
+ - reduces unnecessary API dependence
174
+ - uses neocloud only when it makes economic or operational sense
175
+ - preserves the option of on-prem inference as a first-class path
176
+ - keeps the architecture understandable enough to modify
177
+
178
+ ## What makes it cypherpunk
179
+
180
+ Cypherpunk systems assume the network is hostile, dependency is dangerous, and convenience without control becomes a trap.
181
+
182
+ rtxclaw applies that logic to inference.
183
+
184
+ - If your intelligence depends entirely on remote providers, you do not control your intelligence.
185
+ - If your private reasoning is continuously exported, you do not control your ideas.
186
+ - If your costs can be repriced overnight, you do not control your operating margin.
187
+ - If your access can be revoked by policy, demand spikes, or product decisions, you do not control your future.
188
+
189
+ Sovereign inference means keeping optionality.
190
+ Sovereign inference means designing for adversarial conditions.
191
+ Sovereign inference means your agent system can still function when cloud prices spike, access tightens, models get rate-limited, or supply chains crack.
192
+
193
+ ## Why now
194
+
195
+ As models get smarter and smaller, like Gemma 4 and Qwen3.5, the direction becomes obvious. The future belongs to systems that can run intelligence anywhere, on hardware you control, on hardware you rent intelligently, or on whatever inference capacity is available at that moment.
196
+
197
+ Model progress is shrinking the moat of centralized inference. Better small models plus better open-weight ecosystems mean the balance shifts toward adaptive systems that can move fluidly between local, workstation, datacenter, and burst cloud environments.
198
+
199
+ That is the world rtxclaw is built for.
200
+
201
+ ## Architecture
202
+
203
+ ### System prompt layout (mirrors OpenClaw)
204
+
205
+ Tool-contract guidance lives **with the tool**, in code. Behavioural style lives in operator-editable `.md` files. Both sit above the cache boundary; the contract goes FIRST so the model sees it before lost-in-the-middle attention drops.
206
+
207
+ Stable-prefix order (above `<!-- RTXCLAW_CACHE_BOUNDARY -->`):
208
+
209
+ 1. `## Tooling` — hardcoded in `rtxclaw_core.system_prompt.tooling_prompt_section`. Carries the `todo` contract: "if 2+ steps, call `todo` first; one `in_progress` at a time; don't restate the plan."
210
+ 2. `## Execution Bias` — hardcoded, mirrors OpenClaw's `buildExecutionBiasSection` verbatim. Negative reinforcement: "do not finish with a plan/promise when tools can move it forward."
211
+ 3. `WORKSPACE.md` → `SOUL.md` → `USER.md` → `TOOLS.md` → `TOOLCALL.md` → `AGENTS.md` (`## ⚠️ When to plan` — behavioural triggers only; the contract is upstream).
212
+ 4. `MODE-AUTO.md` / `MODE-PLAN.md` / `MODE-ASK.md` (one, by active permission mode).
213
+ 5. `# SKILLS` summary block.
214
+ 6. `# EXTERNAL TOOLS — MCP / ACP` block (when configured).
215
+ 7. `# DEFERRED TOOLS` catalog (names + 1-line descriptions; full schemas loaded via `tool_search`).
216
+
217
+ Below the cache boundary:
218
+
219
+ - `# WORKSPACE-CONTEXT` (frontend, cwd).
220
+ - `# MEMORY.md` (curated long-term memory; main session only).
221
+ - `# HEARTBEAT.md` (heartbeat session only).
222
+
223
+ The `## Tooling` + `## Execution Bias` reordering (2026-05-07) was driven by an observed compliance gap: a Qwen3.6-27B-BF16 session on SGLang ignored the planning rule that the same prompt's FP8/vLLM session followed. The rule had been buried at byte ~13 K of a 26 K stable head. With the new layout it sits at byte 0.
224
+
225
+ ### Single-process agent gateway
226
+
227
+ rtxclaw is moving from "one daemon per agent" to "one gateway, many child subprocesses":
228
+
229
+ ```
230
+ rtxclaw gateway (single parent process)
231
+ ├─ binds 1 ACP HTTP listener (default :20100)
232
+ ├─ child manager: lazy-spawn, idle-timeout, crash-respawn
233
+ └─ /acp/<agent_name>/... → child stdio
234
+
235
+ ┌─────────────────────────────┼─────────────────────────────┐
236
+ ▼ ▼ ▼
237
+ main child scraper child … agent N child
238
+ (rtxclaw agent acp-stdio, (rtxclaw agent acp-stdio, (per-agent process,
239
+ CoreBackend(main)) CoreBackend(scraper)) lazy-spawned on first
240
+ session/new for that name)
241
+ ```
242
+
243
+ - **ACP-compliant.** The gateway is itself an ACP server externally (existing `make_acp_app`). Each child is an ACP server over stdio (existing `acp_stdio_main`). The gateway is a per-session multiplexing proxy — no protocol change.
244
+ - **Bootstrap context filtered per child.** Sub-agents only get `AGENTS.md` + `TOOLS.md` for context economy (mirrors OpenClaw).
245
+ - **Lazy spawn.** Children come up on first `session/new` for their agent name; idle-timeout (default 30 min) reaps them. Bounded concurrency (default 16 live children) so 100+ agent types don't all run at once.
246
+ - **Cancel cascade.** Gateway-level abort (SIGTERM, `gateway stop`) fans out to every live child. Per-session ACP `cancel(parent_session_id)` cancels the parent's turn AND any subagent sessions the parent has spawned.
247
+ - **Migration path.** Existing `rtxclaw agent start <name>` keeps working as a standalone daemon during transition. Gateway mode is opt-in via `rtxclaw gateway start`.
248
+
249
+ ### Abort & cancel scopes
250
+
251
+ One of the reasons rtxclaw exists. With a hosted assistant you can't selectively kill *just this branch of work* — you abort the chat or you don't, and the moment you abort you also lose every parallel thread the agent had going. rtxclaw has two cleanly separated abort scopes; nothing in between, on purpose.
252
+
253
+ **Narrow: `session/cancel` (per-session ACP cancel).**
254
+
255
+ Cancel an in-flight prompt on one session. What dies:
256
+
257
+ - the turn currently running in that session
258
+ - every subagent session that turn spawned (via `delegate_agent` / future gateway-aware subagent), regardless of which agent child hosts them — so a `main` session that fanned work out to `scraper` and `researcher` cancels all three with one call
259
+
260
+ What survives:
261
+
262
+ - every other session on the same agent (parallel chats keep going)
263
+ - every session on every other agent (other agents are untouched)
264
+ - the agent child processes themselves (warm, ready for the next turn)
265
+
266
+ This is the granularity an operator actually needs. "Stop this idea, keep everything else running" works without bringing down adjacent work.
267
+
268
+ **Broad: `rtxclaw gateway stop` (SIGTERM the gateway).**
269
+
270
+ The single big-red-button. SIGTERM the gateway parent → `ChildManager.shutdown()` SIGTERMs every live agent child within a 10 s deadline → every session on every agent dies. Use when something is genuinely wedged at the host level.
271
+
272
+ **Why no per-agent middle ground.** A "kill just `main`, leave `scraper` running" command would solve a problem `session/cancel` already covers — if a session on `main` is misbehaving, cancel that session. The agent child process itself is cheap (idle-reaped at 30 min by default), so killing the whole child to abort one session is throwing away warm state for no reason. We can add `gateway kill <agent>` later if a real use case shows up; today it'd be a footgun more than a feature.
273
+
274
+ **Cleanup is OS-level, not best-effort.**
275
+
276
+ - Each child agent runs in its own process group (`start_new_session=True`).
277
+ - Each `monitor_start`-spawned process runs in its own process group.
278
+ - SIGTERM at every layer escalates to SIGKILL after a grace period.
279
+ - A wedged child cannot block gateway shutdown — `ChildManager.shutdown()` is bounded; orphaned children get killed by the OS when the gateway exits.
280
+
281
+ You always know what dies and what doesn't.
282
+
283
+ ### Subagent infrastructure
284
+
285
+ A new `subagent` tool lets one agent delegate a self-contained sub-task to another agent on the same gateway. The parent calls `subagent(agent="researcher", prompt="…", isolation="…")` → gateway opens a fresh ACP session against the named child → returns a single result message back to the parent. The child's session is filtered down to `AGENTS.md` + `TOOLS.md` only, with a narrow tool allowlist passed by the parent. Child sessions cancel-cascade with the parent.
286
+
287
+ This is distinct from `delegate_claude` / `delegate_codex` (those route to external Claude / Codex CLIs). `subagent` is rtxclaw-on-rtxclaw, all local, all sovereign.
288
+
289
+ ### Monitor tool
290
+
291
+ Long-running background process registry. Four model-facing tools:
292
+
293
+ - `monitor_start(command, cwd?)` — spawn the command in its own process group, return a `monitor_id`.
294
+ - `monitor_read(monitor_id, max_lines=100, timeout_s=2.0)` — pop unread lines from the buffer; if buffer is empty, waits up to `timeout_s` for the next line OR for the process to exit.
295
+ - `monitor_stop(monitor_id)` — SIGTERM the process group, escalate to SIGKILL after a grace period, return the exit code.
296
+ - `monitor_list()` — every live monitor + its buffer state. Reads the sidecar so monitors started in earlier tool rounds still surface.
297
+
298
+ Plus two operator-facing surfaces in the TUI:
299
+
300
+ - `/monitors` — opens a navigable modal panel: ↑/↓ to navigate, `x` to SIGTERM the selected PID, `r` to reload, `q`/Esc to close. Refreshes itself every 1.5 s so processes that exit elsewhere disappear without manual reload.
301
+ - `monitor_list` (model-facing) prints the same data as a one-shot text dump for non-interactive review.
302
+
303
+ v1 is **pull-based** (the model polls); the buffer is an in-memory rolling window (~5 000 lines per monitor). The push-based variant — each line becomes a session-update notification that wakes the agent between rounds — is a follow-up that needs gateway integration.
304
+
305
+ **Cross-subprocess persistence.** Tool runners run in short-lived subprocesses; v1's in-process registry would die between calls. To survive, every `monitor_start` writes an entry to a per-session sidecar at `<sessions_dir>/<parent_sid>.monitors.json`. The actual subprocess keeps running across tool rounds because it was spawned with `start_new_session=True` and is reparented to init when its launcher exits. `monitor_list`, `monitor_stop`, and the TUI panel all read the sidecar and recompute liveness via `os.kill(pid, 0)`, so a process that died after its launcher subprocess exited still gets listed correctly. Each monitor runs in its own process group so `monitor_stop` reaps any subcommands the shell spawned.
306
+
307
+ ### Subagents
308
+
309
+ `/subagents` (TUI command) lists every subagent the active session has spawned via `delegate_agent` (rtxclaw → rtxclaw), `delegate_claude` (rtxclaw → Claude Code), or `delegate_codex` (rtxclaw → Codex CLI). Each entry shows the kind, target, child session id, and last activity. `/subagents <N>` enters the Nth subagent — for `delegate_agent`, that's a TUI-level `/agent <target>` switch into the child agent's transcript; for the external bridges it surfaces the bridge's own session id so the operator can re-attach via that bridge's CLI.
310
+
311
+ The continuity is automatic: every delegate call persists its child session id to a sidecar at `<sessions_dir>/<parent_sid>.delegate_<kind>[.<target>].json`, and the next delegate call from the same parent resumes the same child. `/subagents` is the operator's view into that persisted graph.
312
+
313
+ ### Logging
314
+
315
+ Every tool call is instrumented to append a structured event line to the agent's `gateway.log` (`<RTXCLAW_AGENT_HOME>/logs/gateway.log`). Format:
316
+
317
+ ```
318
+ 2026-05-07T13:39:56Z MONITOR_START monitor_id="2dae1ed81a36" pid=2377452 command="…" cwd=null
319
+ 2026-05-07T13:39:56Z MONITOR_EXIT monitor_id="2dae1ed81a36" exit_code=0 buffered_lines=24 unread=12 cancelled=false
320
+ 2026-05-07T13:39:56Z MONITOR_STOP monitor_id="2dae1ed81a36" cross_subprocess=true was_alive=true pid=2377452
321
+ 2026-05-07T13:39:57Z DELEGATE_AGENT_START target="scraper" parent_session="69fc…" task_chars=82
322
+ 2026-05-07T13:39:58Z DELEGATE_AGENT_SPAWNED target="scraper" child_pid=2378001 cwd="/home/…"
323
+ 2026-05-07T13:40:05Z DELEGATE_AGENT_DONE target="scraper" stop_reason="end_turn" reply_chars=482
324
+ ```
325
+
326
+ Greppable by event prefix. Best-effort writes — a logfile that's been rolled away or is unwritable will not break the tool call. The session JSON remains the authoritative trace; this log is auxiliary telemetry for cross-call debugging.
327
+
328
+ ### Reliability — Telegram bot ↔ gateway recovery
329
+
330
+ The Telegram bot (`rtxclaw-telegram.service`) and the agent gateway (`rtxclaw-gateway.service`) are independent systemd units. They can restart in either order without bringing each other down — but only because the bot now treats every gateway-side identity as "live until proven otherwise" and re-establishes anything that disappeared.
331
+
332
+ Three failure modes the bot now tolerates without operator intervention:
333
+
334
+ 1. **Idle reap of a chat session.** Children GC sessions after `child_idle_timeout_s` (default 1800 s). A chat that goes quiet for 30+ minutes returns to a gateway that has never heard of its sid. Before recovery: `session_prompt` raised `LookupError: no live child owns session …` and the bot returned `⚠️ agent error — see telegram.log`. Now the bot calls `session/load` (or `session/new` as a fallback), updates the chat's persisted sid, and re-issues the prompt — the user sees the model answer, not the error.
335
+ 2. **Gateway parent restart between turns.** A redeploy / `systemctl restart rtxclaw-gateway` / OOM kill resets the in-memory `child.sessions` map. Same symptom as (1), same fix path.
336
+ 3. **SSE stream torn down by gateway crash.** The bot's `AcpClient` holds a long-lived GET SSE pump. If the gateway dies, the TCP socket lands in `CLOSE-WAIT` and the bot's read loop exits — but the cached client used to stay in `self._clients`, so the next prompt would either hang on a dead future or fail with `AcpTransportClosed` on every retry. The fix has three parts:
337
+ - `AcpClient._read_loop` now flips `self._closed = True` in its `finally`, not only `close()`.
338
+ - `AcpClient._reserve_call` rejects calls on a closed client with `AcpTransportClosed("client is closed")` instead of allocating a future the (already-exited) read loop will never satisfy.
339
+ - The bot's `_get_or_open_client` evicts cached clients with `_closed=True` and reopens; the `_dispatch_blocks` recovery path also drops the dead client mid-turn before re-running the prompt.
340
+
341
+ The recovery is bounded: at most **one retry per turn**, and only when nothing has streamed yet (no content / thoughts / tool headers). A failure mid-stream surfaces normally — re-running would emit duplicate output to the user.
342
+
343
+ The `/agent <name>` command verifies the saved session up-front via `session/load` before promising "Resuming saved session …". An invalid binding now silently rolls over to a fresh session at switch time instead of failing on the first message after the switch.
344
+
345
+ ### Group-chat reply gates
346
+
347
+ Two `<telegram_home>/config.json` knobs control when the bot speaks up in shared groups. Both default to "off" so an existing single-operator deployment behaves exactly as before.
348
+
349
+ ```jsonc
350
+ {
351
+ "allowed_chat_ids": [-1003916299625], // chat-level allowlist (existing)
352
+ "allowed_user_ids": [8484692594], // NEW — per-user allowlist (silent drop)
353
+ "mention_required_in_groups": true // NEW — only reply when @-mentioned in groups
354
+ }
355
+ ```
356
+
357
+ `allowed_user_ids` (silent per-user drop) — when non-empty, a message in an allowed chat still has to come from one of these `from.id`s. Different members of a group fall through silently (no "you're not allowed" reply, because that would advertise the bot to everyone reading the chat). Empty list ⇒ the gate is disabled and every member of an allowed chat may interact, matching the legacy behavior.
358
+
359
+ `mention_required_in_groups` (silent group gate) — when true, in non-private chats the bot ignores everything that doesn't address it. Three signals count as "addressed":
360
+
361
+ 1. `@<botname>` anywhere in the raw text (covers `/cmd@<botname>` and conversational mentions).
362
+ 2. The message is a direct reply (`reply_to_message`) to one of the bot's own messages — Telegram's swipe-to-reply convention.
363
+ 3. A `text_mention` entity targets the bot's user id (a Telegram client mentioned the bot without typing the @handle, e.g. tap-to-mention from the member list).
364
+
365
+ DMs (`chat.type == "private"`) are always exempt from this gate — there's no other recipient there to confuse, so requiring a mention would just be friction.
366
+
367
+ Both knobs are settable via `rtxclaw configure`:
368
+
369
+ ```bash
370
+ rtxclaw configure --telegram-allowed-user-ids "8484692594,123456789"
371
+ rtxclaw configure --telegram-mention-required on
372
+ # Clear the per-user list (revert to "any member of an allowed chat"):
373
+ rtxclaw configure --telegram-allowed-user-ids ""
374
+ ```
375
+
376
+ The bot reads config at startup; restart with `sudo systemctl restart rtxclaw-telegram.service` after editing.
377
+
378
+ ### Diagnosing the recovery path
379
+
380
+ When the bot exercises any of the three fallbacks above it logs to `~/.rtxclaw/telegram/logs/telegram.log`:
381
+
382
+ ```
383
+ WARNING session_prompt: gateway lost session chat=… sid=… — attempting reopen (…)
384
+ INFO session reopen via session/load chat=… sid=… # success: same sid restored
385
+ INFO session reopen via session/new chat=… old_sid=… new_sid=… # fallback: new sid bound
386
+ WARNING evicting closed ACP client for chat_key=…; reopening # transport-died path
387
+ ```
388
+
389
+ Operator runbook for "bot replied `agent error` once and then started working":
390
+
391
+ 1. Find the message in `telegram.log` — recovery emits the WARNING + INFO above.
392
+ 2. If the gateway side reaped the session, check `child_idle_timeout_s` in `~/.rtxclaw/config.json` (default 1800 s); raise it if 30 min is too short for the conversation cadence.
393
+ 3. If the gateway parent itself died, `journalctl -u rtxclaw-gateway.service --since "10 min ago"` shows whether it was a clean restart, a SIGTERM, or a SIGKILL. A SIGKILL with no kernel OOM in `dmesg` and no `MemoryMax` set usually means manual `systemctl restart` during dev work.
394
+
395
+ `MemoryMax` on the gateway unit is `infinity` by default — there is no in-process memory cap. If you want one, set it under `[Service]` in `deploy/systemd/rtxclaw-gateway.service` (e.g. `MemoryMax=2G`); the recovery logic above handles a cgroup-OOM kill identically to a manual restart.
396
+
397
+ ## The vision
398
+
399
+ rtxclaw is not a neocloud wrapper.
400
+ rtxclaw is not a dependency engine.
401
+ rtxclaw is not permissioned intelligence.
402
+
403
+ rtxclaw is sovereign inference infrastructure for the agent era.
404
+
405
+ It is a system where:
406
+
407
+ - your data stays under your control
408
+ - your agents adapt to your hardware reality
409
+ - your costs are shaped by intelligent routing, not vendor extraction
410
+ - your stack remains understandable enough to audit and modify
411
+ - your business does not collapse because someone else throttled access to intelligence
412
+
413
+ The AI future will not belong only to the largest labs.
414
+ It will belong to those who can route, compress, adapt, and deploy intelligence with discipline.
415
+
416
+ rtxclaw is built for that future.