@hybridaione/hybridclaw 0.4.2 → 0.5.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.
Files changed (239) hide show
  1. package/AGENTS.md +86 -5
  2. package/CHANGELOG.md +42 -0
  3. package/README.md +100 -2
  4. package/config.example.json +29 -1
  5. package/container/Dockerfile +17 -2
  6. package/container/dist/approval-policy.js +215 -3
  7. package/container/dist/approval-policy.js.map +1 -1
  8. package/container/dist/artifacts.js +83 -0
  9. package/container/dist/artifacts.js.map +1 -0
  10. package/container/dist/browser-tools.js +2 -0
  11. package/container/dist/browser-tools.js.map +1 -1
  12. package/container/dist/extensions.js.map +1 -1
  13. package/container/dist/index.js +172 -37
  14. package/container/dist/index.js.map +1 -1
  15. package/container/dist/mcp/client-manager.js +436 -0
  16. package/container/dist/mcp/client-manager.js.map +1 -0
  17. package/container/dist/mcp/config-watcher.js +47 -0
  18. package/container/dist/mcp/config-watcher.js.map +1 -0
  19. package/container/dist/mcp/tool-classifier.js +74 -0
  20. package/container/dist/mcp/tool-classifier.js.map +1 -0
  21. package/container/dist/mcp/types.js +2 -0
  22. package/container/dist/mcp/types.js.map +1 -0
  23. package/container/dist/model-retry.js +19 -4
  24. package/container/dist/model-retry.js.map +1 -1
  25. package/container/dist/runtime-capabilities.js +50 -0
  26. package/container/dist/runtime-capabilities.js.map +1 -0
  27. package/container/dist/runtime-paths.js +84 -0
  28. package/container/dist/runtime-paths.js.map +1 -1
  29. package/container/dist/tools.js +145 -20
  30. package/container/dist/tools.js.map +1 -1
  31. package/container/dist/web-search.js +1 -7
  32. package/container/dist/web-search.js.map +1 -1
  33. package/container/package-lock.json +1321 -2
  34. package/container/package.json +8 -1
  35. package/container/src/approval-policy.ts +263 -4
  36. package/container/src/artifacts.ts +111 -0
  37. package/container/src/browser-tools.ts +3 -0
  38. package/container/src/extensions.ts +4 -0
  39. package/container/src/index.ts +189 -38
  40. package/container/src/mcp/client-manager.ts +596 -0
  41. package/container/src/mcp/config-watcher.ts +63 -0
  42. package/container/src/mcp/tool-classifier.ts +78 -0
  43. package/container/src/mcp/types.ts +34 -0
  44. package/container/src/model-retry.ts +27 -4
  45. package/container/src/runtime-capabilities.ts +70 -0
  46. package/container/src/runtime-paths.ts +96 -0
  47. package/container/src/tools.ts +173 -19
  48. package/container/src/types.ts +3 -0
  49. package/container/src/web-search.ts +3 -9
  50. package/dist/agent/agent.d.ts.map +1 -1
  51. package/dist/agent/agent.js +10 -2
  52. package/dist/agent/agent.js.map +1 -1
  53. package/dist/agent/executor.d.ts.map +1 -1
  54. package/dist/agent/executor.js +5 -10
  55. package/dist/agent/executor.js.map +1 -1
  56. package/dist/agent/prompt-hooks.d.ts.map +1 -1
  57. package/dist/agent/prompt-hooks.js +51 -2
  58. package/dist/agent/prompt-hooks.js.map +1 -1
  59. package/dist/agent/tool-summary.d.ts.map +1 -1
  60. package/dist/agent/tool-summary.js +10 -1
  61. package/dist/agent/tool-summary.js.map +1 -1
  62. package/dist/auth/codex-auth.d.ts +1 -0
  63. package/dist/auth/codex-auth.d.ts.map +1 -1
  64. package/dist/auth/codex-auth.js +23 -8
  65. package/dist/auth/codex-auth.js.map +1 -1
  66. package/dist/channels/discord/approval-buttons.d.ts +8 -0
  67. package/dist/channels/discord/approval-buttons.d.ts.map +1 -0
  68. package/dist/channels/discord/approval-buttons.js +40 -0
  69. package/dist/channels/discord/approval-buttons.js.map +1 -0
  70. package/dist/channels/discord/attachments.d.ts.map +1 -1
  71. package/dist/channels/discord/attachments.js +120 -11
  72. package/dist/channels/discord/attachments.js.map +1 -1
  73. package/dist/channels/discord/delivery.d.ts.map +1 -1
  74. package/dist/channels/discord/delivery.js +5 -2
  75. package/dist/channels/discord/delivery.js.map +1 -1
  76. package/dist/channels/discord/inbound.d.ts.map +1 -1
  77. package/dist/channels/discord/inbound.js +2 -0
  78. package/dist/channels/discord/inbound.js.map +1 -1
  79. package/dist/channels/discord/prompt-adapter.d.ts.map +1 -1
  80. package/dist/channels/discord/prompt-adapter.js +1 -0
  81. package/dist/channels/discord/prompt-adapter.js.map +1 -1
  82. package/dist/channels/discord/runtime.d.ts +8 -1
  83. package/dist/channels/discord/runtime.d.ts.map +1 -1
  84. package/dist/channels/discord/runtime.js +172 -193
  85. package/dist/channels/discord/runtime.js.map +1 -1
  86. package/dist/channels/discord/send-files.d.ts +8 -0
  87. package/dist/channels/discord/send-files.d.ts.map +1 -0
  88. package/dist/channels/discord/send-files.js +65 -0
  89. package/dist/channels/discord/send-files.js.map +1 -0
  90. package/dist/channels/discord/slash-commands.d.ts +34 -0
  91. package/dist/channels/discord/slash-commands.d.ts.map +1 -0
  92. package/dist/channels/discord/slash-commands.js +527 -0
  93. package/dist/channels/discord/slash-commands.js.map +1 -0
  94. package/dist/channels/discord/stream.d.ts.map +1 -1
  95. package/dist/channels/discord/stream.js +4 -1
  96. package/dist/channels/discord/stream.js.map +1 -1
  97. package/dist/channels/discord/tool-actions.d.ts +4 -1
  98. package/dist/channels/discord/tool-actions.d.ts.map +1 -1
  99. package/dist/channels/discord/tool-actions.js +14 -5
  100. package/dist/channels/discord/tool-actions.js.map +1 -1
  101. package/dist/cli.d.ts.map +1 -1
  102. package/dist/cli.js +81 -2
  103. package/dist/cli.js.map +1 -1
  104. package/dist/config/config.d.ts +2 -0
  105. package/dist/config/config.d.ts.map +1 -1
  106. package/dist/config/config.js +4 -0
  107. package/dist/config/config.js.map +1 -1
  108. package/dist/config/runtime-config.d.ts +4 -1
  109. package/dist/config/runtime-config.d.ts.map +1 -1
  110. package/dist/config/runtime-config.js +82 -1
  111. package/dist/config/runtime-config.js.map +1 -1
  112. package/dist/gateway/gateway-service.d.ts +4 -0
  113. package/dist/gateway/gateway-service.d.ts.map +1 -1
  114. package/dist/gateway/gateway-service.js +238 -5
  115. package/dist/gateway/gateway-service.js.map +1 -1
  116. package/dist/gateway/gateway.js +64 -33
  117. package/dist/gateway/gateway.js.map +1 -1
  118. package/dist/gateway/health.d.ts.map +1 -1
  119. package/dist/gateway/health.js +141 -5
  120. package/dist/gateway/health.js.map +1 -1
  121. package/dist/gateway/pending-approvals.d.ts +20 -0
  122. package/dist/gateway/pending-approvals.d.ts.map +1 -0
  123. package/dist/gateway/pending-approvals.js +61 -0
  124. package/dist/gateway/pending-approvals.js.map +1 -0
  125. package/dist/gateway/proactive-delivery.d.ts +8 -0
  126. package/dist/gateway/proactive-delivery.d.ts.map +1 -0
  127. package/dist/gateway/proactive-delivery.js +14 -0
  128. package/dist/gateway/proactive-delivery.js.map +1 -0
  129. package/dist/infra/container-runner.d.ts.map +1 -1
  130. package/dist/infra/container-runner.js +43 -16
  131. package/dist/infra/container-runner.js.map +1 -1
  132. package/dist/infra/host-runner.d.ts.map +1 -1
  133. package/dist/infra/host-runner.js +45 -7
  134. package/dist/infra/host-runner.js.map +1 -1
  135. package/dist/infra/stream-debug.d.ts +9 -0
  136. package/dist/infra/stream-debug.d.ts.map +1 -0
  137. package/dist/infra/stream-debug.js +47 -0
  138. package/dist/infra/stream-debug.js.map +1 -0
  139. package/dist/logger-format.d.ts +13 -0
  140. package/dist/logger-format.d.ts.map +1 -0
  141. package/dist/logger-format.js +19 -0
  142. package/dist/logger-format.js.map +1 -0
  143. package/dist/logger.d.ts.map +1 -1
  144. package/dist/logger.js +57 -5
  145. package/dist/logger.js.map +1 -1
  146. package/dist/media/pdf-context.d.ts +8 -0
  147. package/dist/media/pdf-context.d.ts.map +1 -0
  148. package/dist/media/pdf-context.js +395 -0
  149. package/dist/media/pdf-context.js.map +1 -0
  150. package/dist/memory/compaction-archive.d.ts +8 -0
  151. package/dist/memory/compaction-archive.d.ts.map +1 -0
  152. package/dist/memory/compaction-archive.js +82 -0
  153. package/dist/memory/compaction-archive.js.map +1 -0
  154. package/dist/memory/compaction.d.ts +58 -0
  155. package/dist/memory/compaction.d.ts.map +1 -0
  156. package/dist/memory/compaction.js +494 -0
  157. package/dist/memory/compaction.js.map +1 -0
  158. package/dist/memory/db.d.ts +1 -0
  159. package/dist/memory/db.d.ts.map +1 -1
  160. package/dist/memory/db.js +25 -0
  161. package/dist/memory/db.js.map +1 -1
  162. package/dist/memory/memory-service.d.ts +5 -1
  163. package/dist/memory/memory-service.d.ts.map +1 -1
  164. package/dist/memory/memory-service.js +59 -1
  165. package/dist/memory/memory-service.js.map +1 -1
  166. package/dist/security/mount-config.d.ts +14 -0
  167. package/dist/security/mount-config.d.ts.map +1 -0
  168. package/dist/security/mount-config.js +155 -0
  169. package/dist/security/mount-config.js.map +1 -0
  170. package/dist/security/mount-security.d.ts +1 -0
  171. package/dist/security/mount-security.d.ts.map +1 -1
  172. package/dist/security/mount-security.js +7 -4
  173. package/dist/security/mount-security.js.map +1 -1
  174. package/dist/skills/skills-install.d.ts +26 -0
  175. package/dist/skills/skills-install.d.ts.map +1 -0
  176. package/dist/skills/skills-install.js +248 -0
  177. package/dist/skills/skills-install.js.map +1 -0
  178. package/dist/skills/skills.d.ts +39 -0
  179. package/dist/skills/skills.d.ts.map +1 -1
  180. package/dist/skills/skills.js +218 -23
  181. package/dist/skills/skills.js.map +1 -1
  182. package/dist/tui-slash-command.d.ts +6 -0
  183. package/dist/tui-slash-command.d.ts.map +1 -0
  184. package/dist/tui-slash-command.js +26 -0
  185. package/dist/tui-slash-command.js.map +1 -0
  186. package/dist/tui.js +21 -2
  187. package/dist/tui.js.map +1 -1
  188. package/dist/types.d.ts +47 -0
  189. package/dist/types.d.ts.map +1 -1
  190. package/dist/types.js.map +1 -1
  191. package/dist/workspace.d.ts.map +1 -1
  192. package/dist/workspace.js +140 -15
  193. package/dist/workspace.js.map +1 -1
  194. package/docs/chat.html +130 -2
  195. package/docs/development/README.md +15 -0
  196. package/docs/development/architecture.md +44 -0
  197. package/docs/development/releasing.md +70 -0
  198. package/docs/development/runtime.md +154 -0
  199. package/docs/development/skills.md +35 -0
  200. package/docs/development/testing.md +73 -0
  201. package/docs/index.html +14 -14
  202. package/docs/tools/web-search.md +1 -1
  203. package/package.json +15 -2
  204. package/skills/docx/SKILL.md +93 -0
  205. package/skills/docx/scripts/accept_changes.cjs +112 -0
  206. package/skills/docx/scripts/comment.cjs +398 -0
  207. package/skills/office/SKILL.md +14 -0
  208. package/skills/office/helpers/merge_runs.cjs +128 -0
  209. package/skills/office/helpers/simplify_redlines.cjs +79 -0
  210. package/skills/office/pack.cjs +210 -0
  211. package/skills/office/soffice.cjs +245 -0
  212. package/skills/office/templates/.gitkeep +1 -0
  213. package/skills/office/unpack.cjs +191 -0
  214. package/skills/office/validate.cjs +334 -0
  215. package/skills/office/xml.cjs +184 -0
  216. package/skills/office-workflows/SKILL.md +51 -0
  217. package/skills/pdf/SKILL.md +215 -0
  218. package/skills/pdf/forms.md +263 -0
  219. package/skills/pdf/reference.md +179 -0
  220. package/skills/pdf/scripts/_pdf_form_runtime.mjs +500 -0
  221. package/skills/pdf/scripts/_pdf_runtime.mjs +212 -0
  222. package/skills/pdf/scripts/check_bounding_boxes.mjs +96 -0
  223. package/skills/pdf/scripts/check_fillable_fields.mjs +29 -0
  224. package/skills/pdf/scripts/create_validation_image.mjs +60 -0
  225. package/skills/pdf/scripts/extract_form_field_info.mjs +62 -0
  226. package/skills/pdf/scripts/extract_form_structure.mjs +135 -0
  227. package/skills/pdf/scripts/extract_pdf_text.mjs +60 -0
  228. package/skills/pdf/scripts/fill_fillable_fields.mjs +70 -0
  229. package/skills/pdf/scripts/fill_pdf_form_with_annotations.mjs +88 -0
  230. package/skills/pdf/scripts/render_pdf_pages.mjs +68 -0
  231. package/skills/pptx/SKILL.md +75 -0
  232. package/skills/pptx/editing.md +44 -0
  233. package/skills/pptx/pptxgenjs.md +95 -0
  234. package/skills/pptx/scripts/thumbnail.cjs +189 -0
  235. package/skills/xlsx/SKILL.md +85 -0
  236. package/skills/xlsx/scripts/import_delimited.cjs +320 -0
  237. package/skills/xlsx/scripts/recalc.cjs +15 -0
  238. package/templates/README.md +13 -0
  239. package/skills/repo-orientation/SKILL.md +0 -74
package/AGENTS.md CHANGED
@@ -1,5 +1,84 @@
1
1
  # AGENTS.md
2
2
 
3
+ ## Scope
4
+
5
+ This file is the canonical repo-level instruction set for coding agents working
6
+ in HybridClaw.
7
+
8
+ - Follow this file first.
9
+ - If a deeper directory contains its own `AGENTS.md`, that file overrides this
10
+ one for its subtree.
11
+ - Keep `CLAUDE.md` aligned with this file. `CLAUDE.md` should only carry
12
+ tool-specific deltas.
13
+
14
+ ## Project Map
15
+
16
+ - `src/` core CLI, gateway, providers, auth, audit, scheduler, and runtime
17
+ wiring
18
+ - `container/` sandboxed runtime, tool executor, provider adapters, and
19
+ container build inputs
20
+ - `skills/` bundled `SKILL.md` skills plus any supporting scripts or reference
21
+ material
22
+ - `templates/` runtime workspace bootstrap files seeded into agent workspaces
23
+ - `tests/` Vitest suites across unit, integration, e2e, and live coverage
24
+ - `docs/` static site assets and maintainer/development reference docs
25
+
26
+ ## Working Rules
27
+
28
+ - Keep changes focused. Prefer targeted fixes over broad refactors unless the
29
+ task requires wider movement.
30
+ - Match the existing TypeScript + ESM patterns already used in the touched area.
31
+ - Update tests and docs when behavior, commands, or repo workflows change.
32
+ - Treat existing uncommitted changes as user work unless you created them.
33
+ - Do not rename or relocate files in `templates/` without updating
34
+ `src/workspace.ts` and the workspace bootstrap tests.
35
+
36
+ ## Setup And Commands
37
+
38
+ Prerequisites:
39
+
40
+ - Node.js 22 (matches CI)
41
+ - npm
42
+ - Docker when working on container-mode behavior or image builds
43
+
44
+ Common commands:
45
+
46
+ ```bash
47
+ npm install
48
+ npm run setup
49
+ npm run build
50
+ npm run typecheck
51
+ npm run lint
52
+ npm run check
53
+ npm run test:unit
54
+ npm run test:integration
55
+ npm run test:e2e
56
+ npm run test:live
57
+ npm run release:check
58
+ npm --prefix container run lint
59
+ npm --prefix container run release:check
60
+ ```
61
+
62
+ ## Testing Expectations
63
+
64
+ - Docs-only changes: keep links and commands accurate; runtime tests are usually
65
+ unnecessary.
66
+ - `src/` changes: run `npm run typecheck`, `npm run lint`, and the relevant
67
+ Vitest suites.
68
+ - `container/` changes: run `npm --prefix container run lint`, `npm run build`,
69
+ and targeted tests that exercise the runtime boundary.
70
+ - Release or packaging changes: run both release checks and verify versioned
71
+ docs stay aligned.
72
+ - If you skip a relevant check, state that explicitly in your handoff.
73
+
74
+ ## Documentation Hierarchy
75
+
76
+ - `README.md` is the end-user and product entry point.
77
+ - `CONTRIBUTING.md` is the human contributor quickstart.
78
+ - `docs/development/` holds deeper maintainer and runtime reference docs.
79
+ - `templates/*.md` are product runtime workspace seed files, not repo
80
+ contributor onboarding docs.
81
+
3
82
  ## Bump Release
4
83
 
5
84
  When the user says "bump release":
@@ -10,10 +89,12 @@ When the user says "bump release":
10
89
  - `package-lock.json` (root `version` and `packages[""]`)
11
90
  - `container/package.json`
12
91
  - `container/package-lock.json` (root `version` and `packages[""]`)
13
- - any user-facing version text (for example `src/tui.ts` banner).
14
- 3. Move `CHANGELOG.md` release notes from `Unreleased` to the new version heading (or create one).
92
+ - any user-facing version text (for example `src/tui.ts` banner)
93
+ 3. Move `CHANGELOG.md` release notes from `Unreleased` to the new version
94
+ heading (or create one).
15
95
  4. Update `README.md` "latest tag" link/text if present.
16
96
  5. Commit with a release chore message (for example `chore: release vX.Y.Z`).
17
- 6. Create annotated git tag `vX.Y.Z`.
18
- 7. Push commit and tag.
19
- 8. Always create/publish a GitHub Release entry for the tag (tags alone do not update the Releases list).
97
+ 6. Create an annotated git tag `vX.Y.Z`.
98
+ 7. Push the commit and tag.
99
+ 8. Always create or publish a GitHub Release entry for the tag. Tags alone do
100
+ not update the Releases list.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.5.0](https://github.com/HybridAIOne/hybridclaw/tree/v0.5.0)
6
+
7
+ ### Added
8
+
9
+ - **Model Context Protocol support**: Added runtime `mcpServers` config plus container MCP client loading so HybridClaw can expose configured MCP servers as namespaced tools, with TUI `/mcp list|add|toggle|remove|reconnect` management commands.
10
+ - **Discord slash command control plane**: Added global Discord slash commands for status, approvals, compaction, channel policy, model/bot selection, RAG, Ralph loop, MCP management, usage, export, sessions, audit, and scheduling, with private approval responses.
11
+ - **Bundled office document skills**: Added `docx`, `xlsx`, `pptx`, and `office-workflows` bundled skills plus shared office helper scripts for OOXML pack/unpack, tracked-change cleanup, spreadsheet import/recalc, and presentation thumbnail QA.
12
+ - **Authenticated artifact downloads**: Added gateway `/api/artifact` serving for generated agent artifacts and cached Discord media so the web chat can render previews and download generated office outputs safely.
13
+
14
+ ### Changed
15
+
16
+ - **Runtime capability guidance**: Prompt/tool summaries now group MCP tools cleanly and add office-file guardrails so models avoid fake binary placeholders and follow document QA workflows.
17
+ - **Discord delivery workflow**: The Discord `message` tool now supports native local-file uploads via `filePath`, and runtime delivery/register flows better handle workspace files, `/discord-media-cache`, and DM-visible global slash commands.
18
+ - **Documentation and examples**: README, runtime docs, and built-in web/chat surfaces now document MCP setup, bundled office skills, and artifact handling for the new workflows.
19
+
20
+ ## [0.4.3](https://github.com/HybridAIOne/hybridclaw/tree/v0.4.3)
21
+
22
+ ### Added
23
+
24
+ - **Manual session compaction command**: Added built-in `/compact` support across gateway, TUI, and Discord to archive older transcript history, summarize it into high-confidence session memory, and preserve a recent conversation tail for active context.
25
+ - **Bundled PDF workflow support**: Added a built-in `pdf` skill plus Node-based PDF tooling for text extraction, page rendering, fillable form inspection/filling, and non-fillable overlay workflows, with current-turn PDF context injection for explicit file paths and Discord attachments.
26
+ - **Skill installer commands**: Added `hybridclaw skill list` and `hybridclaw skill install <skill> [install-id]` so bundled skills can advertise optional dependency installers.
27
+ - **Container bind path config**: Added `container.binds` support alongside validated host/container path aliasing so configured external directories can be used safely from sandboxed tools and PDF workflows.
28
+ - **Published coverage badge**: CI now generates and publishes a coverage badge JSON artifact for the README badge and release-health visibility.
29
+
30
+ ### Changed
31
+
32
+ - **Attachment and media routing**: Gateway/media prompt assembly now distinguishes image attachments from document attachments, prefers current-turn local files for PDFs, and limits native vision injection to actual image inputs.
33
+ - **Contributor documentation structure**: Promoted `AGENTS.md` to the canonical repo-level agent guide, slimmed `CONTRIBUTING.md` into a contributor quickstart, and moved deeper maintainer/runtime references into `docs/development/`.
34
+ - **Host runtime workspace setup**: Host-mode agent workspaces now link package `node_modules`, while runtime path handling and workspace globbing understand configured extra mounts and local scratch paths more reliably.
35
+ - **Release metadata and docs alignment**: The published package now declares `Node 22.x`, README badges point at maintained badge sources, and the docs landing page tracks the current tagged release/version requirements.
36
+ - **Regression coverage**: Added focused unit coverage for memory chunking, gateway startup/health flows, Discord delivery chunking, PDF context handling, and compaction paths.
37
+
38
+ ### Fixed
39
+
40
+ - **Compaction archive path exposure**: `/compact` responses now show a safe archive reference instead of leaking absolute host filesystem paths in user-facing output.
41
+ - **Workspace bootstrap lifecycle**: `BOOTSTRAP.md` is now removed once onboarding is effectively complete and is not recreated on subsequent starts.
42
+ - **Codex device-code activation flow**: Device-code login now falls back to the default activation URL and tolerates nested pending/authorization error payloads from the auth service.
43
+ - **Runtime-home migration false positive**: Launching HybridClaw from `~/.hybridclaw` no longer treats the runtime `data/` directory as a legacy current-working-directory migration target.
44
+ - **Heartbeat proactive queue cleanup**: Local proactive delivery now drops orphaned heartbeat queue rows instead of trying to route them as real outbound messages.
45
+ - **Coverage badge publishing permissions**: CI now has the repository permissions needed to update the published coverage badge without failing the main workflow.
46
+
5
47
  ## [0.4.2](https://github.com/HybridAIOne/hybridclaw/tree/v0.4.2)
6
48
 
7
49
  ### Added
package/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # HybridClaw
2
2
 
3
+ [![CI](https://github.com/HybridAIOne/hybridclaw/actions/workflows/ci.yml/badge.svg)](https://github.com/HybridAIOne/hybridclaw/actions/workflows/ci.yml)
4
+ [![coverage](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/HybridAIOne/hybridclaw/gh-pages/badge/coverage.json)](https://github.com/HybridAIOne/hybridclaw/actions/workflows/ci.yml)
5
+ [![npm](https://img.shields.io/npm/v/@hybridaione/hybridclaw)](https://www.npmjs.com/package/@hybridaione/hybridclaw)
6
+ [![Node](https://img.shields.io/badge/node-22.x-5FA04E?logo=node.js&logoColor=white)](https://nodejs.org/en/download)
7
+ [![License](https://img.shields.io/github/license/HybridAIOne/hybridclaw)](https://github.com/HybridAIOne/hybridclaw/blob/main/LICENSE)
8
+ [![Docs](https://img.shields.io/badge/docs-github%20pages-blue)](https://hybridaione.github.io/hybridclaw/)
9
+ [![Powered by HybridAI](https://img.shields.io/badge/powered%20by-HybridAI-blueviolet)](https://hybridai.one)
10
+
3
11
  <img width="540" height="511" alt="image" src="docs/hero.png" />
4
12
 
5
13
  Personal AI assistant bot for Discord, powered by [HybridAI](https://hybridai.one).
@@ -11,6 +19,9 @@ npm install -g @hybridaione/hybridclaw
11
19
  hybridclaw onboarding
12
20
  ```
13
21
 
22
+ Prerequisites: Node.js 22. Docker is recommended when you want the default
23
+ container sandbox.
24
+
14
25
  ## HybridAI Advantage
15
26
 
16
27
  - Security-focused foundation
@@ -50,6 +61,9 @@ hybridclaw gateway
50
61
  # Or run gateway in foreground in this terminal
51
62
  hybridclaw gateway start --foreground
52
63
 
64
+ # For stdio MCP servers that rely on host tools like `docker` or `npx`
65
+ hybridclaw gateway start --foreground --sandbox=host
66
+
53
67
  # If DISCORD_TOKEN is set, gateway auto-connects to Discord.
54
68
 
55
69
  # Start terminal adapter (optional, in a second terminal)
@@ -129,11 +143,86 @@ HybridClaw creates `~/.hybridclaw/config.json` on first run and hot-reloads most
129
143
  - Start from `config.example.json` (reference).
130
144
  - Runtime state lives under `~/.hybridclaw/` (`config.json`, `credentials.json`, `data/hybridclaw.db`, audit/session files).
131
145
  - HybridClaw does not keep runtime state in the current working directory. If `./.env` exists, supported secrets are migrated once into `~/.hybridclaw/credentials.json`.
132
- - `container.*` controls execution isolation, including `sandboxMode`, `memory`, `memorySwap`, `cpus`, `network`, and additional mounts.
146
+ - `container.*` controls execution isolation, including `sandboxMode`, `memory`, `memorySwap`, `cpus`, `network`, `binds`, and additional mounts.
147
+ - Use `container.binds` for explicit host-to-container mounts in `host:container[:ro|rw]` format. Mounted paths appear inside the sandbox under `/workspace/extra/<container>`.
148
+ - `mcpServers.*` declares Model Context Protocol servers that HybridClaw connects to per session and exposes as namespaced tools (`server__tool`).
149
+ - `mcpServers.*.env` and `mcpServers.*.headers` are currently written to `~/.hybridclaw/config.json` as plain text. Use low-privilege tokens only, set `chmod 700 ~/.hybridclaw && chmod 600 ~/.hybridclaw/config.json`, and prefer `host` sandbox mode for stdio MCP servers that depend on host-installed tools.
133
150
  - Keep HybridAI secrets in `~/.hybridclaw/credentials.json` (`HYBRIDAI_API_KEY` required for HybridAI models, `DISCORD_TOKEN` optional). Codex OAuth sessions are stored separately in `~/.hybridclaw/codex-auth.json`.
134
151
  - Trust-model acceptance is stored in `~/.hybridclaw/config.json` under `security.*` and is required before runtime starts.
135
152
  - See [TRUST_MODEL.md](./TRUST_MODEL.md) for onboarding acceptance policy and [SECURITY.md](./SECURITY.md) for technical security guidelines.
136
- - For advanced configuration, audit/observability details, skills internals, agent tools, and developer docs, see [CONTRIBUTING.md](./CONTRIBUTING.md).
153
+ - For contributor workflow, see [CONTRIBUTING.md](./CONTRIBUTING.md). For deeper runtime, skills, release, and maintainer reference docs, see [docs/development/README.md](./docs/development/README.md).
154
+
155
+ ## TUI MCP Quickstart
156
+
157
+ For stdio MCP servers that use host binaries such as `docker`, `node`, or
158
+ `npx`, start the gateway in host mode:
159
+
160
+ ```bash
161
+ hybridclaw gateway start --foreground --sandbox=host
162
+ hybridclaw tui
163
+ ```
164
+
165
+ In the TUI, use the MCP slash commands directly:
166
+
167
+ ```text
168
+ /mcp list
169
+ /mcp add filesystem {"transport":"stdio","command":"npx","args":["-y","@modelcontextprotocol/server-filesystem","/Users/you/project"],"enabled":true}
170
+ /mcp toggle filesystem
171
+ /mcp reconnect filesystem
172
+ /mcp remove filesystem
173
+ ```
174
+
175
+ Once a server is enabled, its tools appear in prompts as namespaced tool names
176
+ such as `filesystem__read_file` or `github__list_issues`.
177
+
178
+ ## Bundled Skills
179
+
180
+ - `pdf` is bundled and supports text extraction, page rendering, fillable form inspection/filling, and non-fillable overlay workflows.
181
+ - `xlsx` is bundled for spreadsheet creation, formula-safe editing, CSV/TSV cleanup, and LibreOffice-backed recalculation.
182
+ - `docx` is bundled for Word document creation plus OOXML unpack/edit/pack workflows, comments, and tracked-change cleanup.
183
+ - `pptx` is bundled for presentation creation with `pptxgenjs`, template-preserving OOXML edits, and thumbnail-based visual QA.
184
+ - `office-workflows` is bundled for cross-format tasks such as CSV to XLSX cleanup and XLSX to PPTX or DOCX deliverables coordinated with delegation.
185
+ - Use `hybridclaw skill list` to inspect available installers and `hybridclaw skill install pdf [install-id]` when a bundled skill advertises optional setup helpers.
186
+
187
+ ## Optional Office Dependencies
188
+
189
+ When you run HybridClaw in the default container sandbox, the bundled office image already includes the main office tooling. These installs matter primarily for `--sandbox=host` workflows or when you want the same capabilities on your local machine.
190
+
191
+ What they unlock:
192
+
193
+ - LibreOffice (`soffice`) enables Office-to-PDF export, PPTX visual QA, and XLSX formula recalculation.
194
+ - Poppler (`pdftoppm`) enables slide/page thumbnail rendering for PPTX visual QA.
195
+ - Pandoc improves document conversion workflows around DOCX and Markdown.
196
+
197
+ macOS:
198
+
199
+ ```bash
200
+ brew install --cask libreoffice
201
+ brew install poppler pandoc
202
+ ```
203
+
204
+ Ubuntu / Debian:
205
+
206
+ ```bash
207
+ sudo apt-get update
208
+ sudo apt-get install -y libreoffice poppler-utils pandoc
209
+ ```
210
+
211
+ Fedora:
212
+
213
+ ```bash
214
+ sudo dnf install -y libreoffice poppler-utils pandoc
215
+ ```
216
+
217
+ Verify availability:
218
+
219
+ ```bash
220
+ sh -lc 'command -v soffice >/dev/null 2>&1 || command -v libreoffice >/dev/null 2>&1 && echo soffice_ok'
221
+ sh -lc 'command -v pdftoppm >/dev/null 2>&1 && echo pdftoppm_ok'
222
+ sh -lc 'command -v pandoc >/dev/null 2>&1 && echo pandoc_ok'
223
+ ```
224
+
225
+ Without these tools, the office skills still create and edit `.docx`, `.xlsx`, and `.pptx` files, but some higher-quality QA and conversion paths are skipped.
137
226
 
138
227
  ## Commands
139
228
 
@@ -145,6 +234,7 @@ CLI runtime commands:
145
234
  - `hybridclaw gateway stop` — Stop managed gateway backend process
146
235
  - `hybridclaw gateway status` — Show lifecycle/API status
147
236
  - `hybridclaw gateway <command...>` — Send a command to a running gateway (for example `sessions`, `bot info`)
237
+ - `hybridclaw gateway compact` — Archive older session history into semantic memory while preserving a recent active context tail
148
238
  - `hybridclaw tui` — Start terminal client connected to gateway
149
239
  - `hybridclaw onboarding` — Run HybridAI account/API key onboarding
150
240
  - `hybridclaw hybridai login [--device-code|--browser|--import]` — Store HybridAI API credentials via browser-assisted, headless/manual, or env-import flows
@@ -153,6 +243,8 @@ CLI runtime commands:
153
243
  - `hybridclaw codex login [--device-code|--browser|--import]` — Authenticate OpenAI Codex via OAuth or one-time Codex CLI import
154
244
  - `hybridclaw codex status` — Show stored Codex auth state, token mask, expiry, and source
155
245
  - `hybridclaw codex logout` — Clear stored Codex credentials
246
+ - `hybridclaw skill list` — Show skills and any declared installer options
247
+ - `hybridclaw skill install <skill> [install-id]` — Run a declared skill dependency installer
156
248
  - `hybridclaw update [status|--check] [--yes]` — Check for updates and upgrade global npm installs (source checkouts get git-based update instructions)
157
249
  - `hybridclaw audit ...` — Verify and inspect structured audit trail (`recent`, `search`, `approvals`, `verify`, `instructions`)
158
250
  - `hybridclaw audit instructions [--sync]` — Compare runtime instruction copies under `~/.hybridclaw/instructions/` against installed sources and restore shipped defaults when needed
@@ -163,6 +255,7 @@ In Discord, use `!claw help` to see all commands. Key ones:
163
255
  - `!claw bot set <id>` — Set chatbot for this channel
164
256
  - `!claw model set <name>` — Set model for this channel
165
257
  - `!claw rag on/off` — Toggle RAG
258
+ - `!claw compact` — Archive older history into session memory and keep a recent working tail
166
259
  - `!claw clear` — Clear conversation history
167
260
  - `!claw audit recent [n]` — Show recent structured audit events
168
261
  - `!claw audit verify [sessionId]` — Verify audit hash chain integrity
@@ -170,6 +263,11 @@ In Discord, use `!claw help` to see all commands. Key ones:
170
263
  - `!claw audit approvals [n] [--denied]` — Show policy approval decisions
171
264
  - `!claw usage [summary|daily|monthly|model [daily|monthly] [agentId]]` — Show token/cost aggregates
172
265
  - `!claw export session [sessionId]` — Export session snapshot as JSONL
266
+ - `!claw mcp list` — List configured MCP servers
267
+ - `!claw mcp add <name> <json>` — Add or update an MCP server config
173
268
  - `!claw schedule add "<cron>" <prompt>` — Add cron scheduled task
174
269
  - `!claw schedule add at "<ISO time>" <prompt>` — Add one-shot task
175
270
  - `!claw schedule add every <ms> <prompt>` — Add interval task
271
+
272
+ In the TUI, use `/compact` for session compaction and `/mcp ...` for runtime
273
+ MCP management.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 7,
2
+ "version": 8,
3
3
  "security": {
4
4
  "trustModelAccepted": false,
5
5
  "trustModelAcceptedAt": "",
@@ -89,10 +89,38 @@
89
89
  "cpus": "1",
90
90
  "network": "bridge",
91
91
  "timeoutMs": 300000,
92
+ "binds": [],
92
93
  "additionalMounts": "",
93
94
  "maxOutputBytes": 10485760,
94
95
  "maxConcurrent": 5
95
96
  },
97
+ "mcpServers": {
98
+ "filesystem": {
99
+ "transport": "stdio",
100
+ "command": "npx",
101
+ "args": [
102
+ "-y",
103
+ "@modelcontextprotocol/server-filesystem",
104
+ "/absolute/path/to/a/workspace"
105
+ ],
106
+ "enabled": false
107
+ },
108
+ "tavily": {
109
+ "transport": "stdio",
110
+ "command": "npx",
111
+ "args": ["-y", "tavily-mcp@latest"],
112
+ "env": {
113
+ "TAVILY_API_KEY": "replace-me"
114
+ },
115
+ "enabled": false
116
+ },
117
+ "playwright": {
118
+ "transport": "stdio",
119
+ "command": "npx",
120
+ "args": ["-y", "@playwright/mcp@latest"],
121
+ "enabled": false
122
+ }
123
+ },
96
124
  "web": {
97
125
  "search": {
98
126
  "provider": "auto",
@@ -1,10 +1,25 @@
1
1
  FROM node:20-slim
2
2
 
3
3
  RUN apt-get update && apt-get install -y --no-install-recommends \
4
- ripgrep git curl python3 python3-pip \
4
+ ripgrep git curl python3 python3-pip poppler-utils qpdf pandoc \
5
+ libreoffice-calc libreoffice-impress libreoffice-writer \
5
6
  && rm -rf /var/lib/apt/lists/*
6
7
 
7
- RUN python3 -m pip install --no-cache-dir --break-system-packages uv
8
+ RUN python3 -m pip install --no-cache-dir --break-system-packages \
9
+ uv \
10
+ pypdf==5.4.0 \
11
+ pdfplumber==0.11.6 \
12
+ pdf2image==1.17.0 \
13
+ reportlab==4.4.4 \
14
+ pillow==11.3.0
15
+
16
+ RUN npm install -g \
17
+ docx@9.5.1 \
18
+ pptxgenjs@4.0.1 \
19
+ exceljs@4.4.0 \
20
+ csv-parse@6.1.0 \
21
+ iconv-lite@0.7.0
22
+ ENV NODE_PATH=/usr/local/lib/node_modules:/app/node_modules
8
23
 
9
24
  WORKDIR /app
10
25