@hybridaione/hybridclaw 0.5.0 → 0.7.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 (466) hide show
  1. package/AGENTS.md +377 -58
  2. package/CHANGELOG.md +96 -0
  3. package/README.md +139 -6
  4. package/config.example.json +57 -3
  5. package/console/dist/assets/index-D00hMcZD.js +13 -0
  6. package/console/dist/assets/index-Dou3u0ob.css +1 -0
  7. package/console/dist/index.html +16 -0
  8. package/console/package.json +24 -0
  9. package/container/dist/approval-policy.js +167 -39
  10. package/container/dist/approval-policy.js.map +1 -1
  11. package/container/dist/browser-tools.js +69 -21
  12. package/container/dist/browser-tools.js.map +1 -1
  13. package/container/dist/discord-cdn.js +20 -0
  14. package/container/dist/discord-cdn.js.map +1 -0
  15. package/container/dist/index.js +139 -306
  16. package/container/dist/index.js.map +1 -1
  17. package/container/dist/mcp/client-manager.js +9 -2
  18. package/container/dist/mcp/client-manager.js.map +1 -1
  19. package/container/dist/mcp/config-watcher.js.map +1 -1
  20. package/container/dist/model-client.js +14 -0
  21. package/container/dist/model-client.js.map +1 -1
  22. package/container/dist/native-media.js +273 -0
  23. package/container/dist/native-media.js.map +1 -0
  24. package/container/dist/providers/hybridai.js +1 -0
  25. package/container/dist/providers/hybridai.js.map +1 -1
  26. package/container/dist/providers/local-ollama.js +273 -0
  27. package/container/dist/providers/local-ollama.js.map +1 -0
  28. package/container/dist/providers/local-openai-compat.js +533 -0
  29. package/container/dist/providers/local-openai-compat.js.map +1 -0
  30. package/container/dist/providers/openai-codex.js +4 -3
  31. package/container/dist/providers/openai-codex.js.map +1 -1
  32. package/container/dist/providers/shared.js +43 -3
  33. package/container/dist/providers/shared.js.map +1 -1
  34. package/container/dist/providers/thinking-extractor.js +139 -0
  35. package/container/dist/providers/thinking-extractor.js.map +1 -0
  36. package/container/dist/providers/tool-call-normalizer.js +603 -0
  37. package/container/dist/providers/tool-call-normalizer.js.map +1 -0
  38. package/container/dist/ralph.js +63 -0
  39. package/container/dist/ralph.js.map +1 -0
  40. package/container/dist/runtime-capabilities.js +2 -12
  41. package/container/dist/runtime-capabilities.js.map +1 -1
  42. package/container/dist/runtime-paths.js +32 -1
  43. package/container/dist/runtime-paths.js.map +1 -1
  44. package/container/dist/stalled-turns.js +8 -0
  45. package/container/dist/stalled-turns.js.map +1 -0
  46. package/container/dist/system-messages.js +56 -0
  47. package/container/dist/system-messages.js.map +1 -0
  48. package/container/dist/token-usage.js +4 -0
  49. package/container/dist/token-usage.js.map +1 -1
  50. package/container/dist/tool-loop-detection.js +192 -0
  51. package/container/dist/tool-loop-detection.js.map +1 -0
  52. package/container/dist/tools.js +930 -808
  53. package/container/dist/tools.js.map +1 -1
  54. package/container/package-lock.json +2 -2
  55. package/container/package.json +1 -1
  56. package/container/src/approval-policy.ts +186 -42
  57. package/container/src/browser-tools.ts +82 -23
  58. package/container/src/discord-cdn.ts +21 -0
  59. package/container/src/index.ts +208 -323
  60. package/container/src/mcp/client-manager.ts +16 -5
  61. package/container/src/mcp/config-watcher.ts +4 -1
  62. package/container/src/model-client.ts +20 -0
  63. package/container/src/native-media.ts +326 -0
  64. package/container/src/providers/hybridai.ts +1 -0
  65. package/container/src/providers/local-ollama.ts +388 -0
  66. package/container/src/providers/local-openai-compat.ts +696 -0
  67. package/container/src/providers/openai-codex.ts +4 -0
  68. package/container/src/providers/shared.ts +63 -4
  69. package/container/src/providers/thinking-extractor.ts +170 -0
  70. package/container/src/providers/tool-call-normalizer.ts +751 -0
  71. package/container/src/ralph.ts +71 -0
  72. package/container/src/runtime-capabilities.ts +5 -12
  73. package/container/src/runtime-paths.ts +42 -4
  74. package/container/src/stalled-turns.ts +12 -0
  75. package/container/src/system-messages.ts +63 -0
  76. package/container/src/token-usage.ts +4 -0
  77. package/container/src/tool-loop-detection.ts +241 -0
  78. package/container/src/tools.ts +1099 -861
  79. package/container/src/types.ts +26 -2
  80. package/dist/agent/agent.d.ts +3 -2
  81. package/dist/agent/agent.d.ts.map +1 -1
  82. package/dist/agent/agent.js +13 -10
  83. package/dist/agent/agent.js.map +1 -1
  84. package/dist/agent/conversation.d.ts +1 -0
  85. package/dist/agent/conversation.d.ts.map +1 -1
  86. package/dist/agent/conversation.js +2 -1
  87. package/dist/agent/conversation.js.map +1 -1
  88. package/dist/agent/executor-types.d.ts +30 -0
  89. package/dist/agent/executor-types.d.ts.map +1 -0
  90. package/dist/agent/executor-types.js +2 -0
  91. package/dist/agent/executor-types.js.map +1 -0
  92. package/dist/agent/executor.d.ts +2 -24
  93. package/dist/agent/executor.d.ts.map +1 -1
  94. package/dist/agent/executor.js +5 -0
  95. package/dist/agent/executor.js.map +1 -1
  96. package/dist/agent/prompt-hooks.d.ts +1 -1
  97. package/dist/agent/prompt-hooks.d.ts.map +1 -1
  98. package/dist/agent/prompt-hooks.js +23 -12
  99. package/dist/agent/prompt-hooks.js.map +1 -1
  100. package/dist/agent/tool-summary.d.ts +7 -0
  101. package/dist/agent/tool-summary.d.ts.map +1 -1
  102. package/dist/agent/tool-summary.js +13 -0
  103. package/dist/agent/tool-summary.js.map +1 -1
  104. package/dist/agents/agent-registry.d.ts +24 -0
  105. package/dist/agents/agent-registry.d.ts.map +1 -0
  106. package/dist/agents/agent-registry.js +386 -0
  107. package/dist/agents/agent-registry.js.map +1 -0
  108. package/dist/agents/agent-types.d.ts +23 -0
  109. package/dist/agents/agent-types.d.ts.map +1 -0
  110. package/dist/agents/agent-types.js +2 -0
  111. package/dist/agents/agent-types.js.map +1 -0
  112. package/dist/audit/audit-events.d.ts.map +1 -1
  113. package/dist/audit/audit-events.js +11 -4
  114. package/dist/audit/audit-events.js.map +1 -1
  115. package/dist/audit/audit-trail.d.ts.map +1 -1
  116. package/dist/audit/audit-trail.js +2 -47
  117. package/dist/audit/audit-trail.js.map +1 -1
  118. package/dist/channels/discord/attachments.d.ts.map +1 -1
  119. package/dist/channels/discord/attachments.js +131 -126
  120. package/dist/channels/discord/attachments.js.map +1 -1
  121. package/dist/channels/discord/debounce.js +1 -1
  122. package/dist/channels/discord/debounce.js.map +1 -1
  123. package/dist/channels/discord/delivery.d.ts +12 -5
  124. package/dist/channels/discord/delivery.d.ts.map +1 -1
  125. package/dist/channels/discord/delivery.js +5 -4
  126. package/dist/channels/discord/delivery.js.map +1 -1
  127. package/dist/channels/discord/inbound.d.ts +0 -1
  128. package/dist/channels/discord/inbound.d.ts.map +1 -1
  129. package/dist/channels/discord/inbound.js +4 -22
  130. package/dist/channels/discord/inbound.js.map +1 -1
  131. package/dist/channels/discord/prompt-adapter.js +3 -3
  132. package/dist/channels/discord/prompt-adapter.js.map +1 -1
  133. package/dist/channels/discord/runtime.d.ts +3 -1
  134. package/dist/channels/discord/runtime.d.ts.map +1 -1
  135. package/dist/channels/discord/runtime.js +126 -40
  136. package/dist/channels/discord/runtime.js.map +1 -1
  137. package/dist/channels/discord/send-files.d.ts +1 -0
  138. package/dist/channels/discord/send-files.d.ts.map +1 -1
  139. package/dist/channels/discord/send-files.js +2 -0
  140. package/dist/channels/discord/send-files.js.map +1 -1
  141. package/dist/channels/discord/slash-commands.d.ts.map +1 -1
  142. package/dist/channels/discord/slash-commands.js +33 -503
  143. package/dist/channels/discord/slash-commands.js.map +1 -1
  144. package/dist/channels/discord/tool-actions.d.ts +3 -1
  145. package/dist/channels/discord/tool-actions.d.ts.map +1 -1
  146. package/dist/channels/discord/tool-actions.js +66 -25
  147. package/dist/channels/discord/tool-actions.js.map +1 -1
  148. package/dist/channels/message/tool-actions.d.ts +3 -0
  149. package/dist/channels/message/tool-actions.d.ts.map +1 -0
  150. package/dist/channels/message/tool-actions.js +151 -0
  151. package/dist/channels/message/tool-actions.js.map +1 -0
  152. package/dist/channels/prompt-adapters.d.ts.map +1 -1
  153. package/dist/channels/prompt-adapters.js +11 -2
  154. package/dist/channels/prompt-adapters.js.map +1 -1
  155. package/dist/channels/whatsapp/auth.d.ts +12 -0
  156. package/dist/channels/whatsapp/auth.d.ts.map +1 -0
  157. package/dist/channels/whatsapp/auth.js +34 -0
  158. package/dist/channels/whatsapp/auth.js.map +1 -0
  159. package/dist/channels/whatsapp/connection.d.ts +11 -0
  160. package/dist/channels/whatsapp/connection.d.ts.map +1 -0
  161. package/dist/channels/whatsapp/connection.js +265 -0
  162. package/dist/channels/whatsapp/connection.js.map +1 -0
  163. package/dist/channels/whatsapp/debounce.d.ts +28 -0
  164. package/dist/channels/whatsapp/debounce.d.ts.map +1 -0
  165. package/dist/channels/whatsapp/debounce.js +69 -0
  166. package/dist/channels/whatsapp/debounce.js.map +1 -0
  167. package/dist/channels/whatsapp/delivery.d.ts +20 -0
  168. package/dist/channels/whatsapp/delivery.d.ts.map +1 -0
  169. package/dist/channels/whatsapp/delivery.js +96 -0
  170. package/dist/channels/whatsapp/delivery.js.map +1 -0
  171. package/dist/channels/whatsapp/inbound.d.ts +39 -0
  172. package/dist/channels/whatsapp/inbound.d.ts.map +1 -0
  173. package/dist/channels/whatsapp/inbound.js +284 -0
  174. package/dist/channels/whatsapp/inbound.js.map +1 -0
  175. package/dist/channels/whatsapp/markdown.d.ts +2 -0
  176. package/dist/channels/whatsapp/markdown.d.ts.map +1 -0
  177. package/dist/channels/whatsapp/markdown.js +39 -0
  178. package/dist/channels/whatsapp/markdown.js.map +1 -0
  179. package/dist/channels/whatsapp/mime-utils.d.ts +3 -0
  180. package/dist/channels/whatsapp/mime-utils.d.ts.map +1 -0
  181. package/dist/channels/whatsapp/mime-utils.js +33 -0
  182. package/dist/channels/whatsapp/mime-utils.js.map +1 -0
  183. package/dist/channels/whatsapp/phone.d.ts +8 -0
  184. package/dist/channels/whatsapp/phone.d.ts.map +1 -0
  185. package/dist/channels/whatsapp/phone.js +73 -0
  186. package/dist/channels/whatsapp/phone.js.map +1 -0
  187. package/dist/channels/whatsapp/prompt-adapter.d.ts +3 -0
  188. package/dist/channels/whatsapp/prompt-adapter.d.ts.map +1 -0
  189. package/dist/channels/whatsapp/prompt-adapter.js +24 -0
  190. package/dist/channels/whatsapp/prompt-adapter.js.map +1 -0
  191. package/dist/channels/whatsapp/runtime.d.ts +31 -0
  192. package/dist/channels/whatsapp/runtime.d.ts.map +1 -0
  193. package/dist/channels/whatsapp/runtime.js +192 -0
  194. package/dist/channels/whatsapp/runtime.js.map +1 -0
  195. package/dist/channels/whatsapp/self-echo-cache.d.ts +14 -0
  196. package/dist/channels/whatsapp/self-echo-cache.d.ts.map +1 -0
  197. package/dist/channels/whatsapp/self-echo-cache.js +57 -0
  198. package/dist/channels/whatsapp/self-echo-cache.js.map +1 -0
  199. package/dist/channels/whatsapp/typing.d.ts +12 -0
  200. package/dist/channels/whatsapp/typing.d.ts.map +1 -0
  201. package/dist/channels/whatsapp/typing.js +74 -0
  202. package/dist/channels/whatsapp/typing.js.map +1 -0
  203. package/dist/cli.d.ts.map +1 -1
  204. package/dist/cli.js +476 -9
  205. package/dist/cli.js.map +1 -1
  206. package/dist/command-registry.d.ts +35 -0
  207. package/dist/command-registry.d.ts.map +1 -0
  208. package/dist/command-registry.js +806 -0
  209. package/dist/command-registry.js.map +1 -0
  210. package/dist/config/config.d.ts +37 -1
  211. package/dist/config/config.d.ts.map +1 -1
  212. package/dist/config/config.js +62 -2
  213. package/dist/config/config.js.map +1 -1
  214. package/dist/config/runtime-config.d.ts +56 -2
  215. package/dist/config/runtime-config.d.ts.map +1 -1
  216. package/dist/config/runtime-config.js +379 -4
  217. package/dist/config/runtime-config.js.map +1 -1
  218. package/dist/gateway/approval-confirmation.d.ts +3 -0
  219. package/dist/gateway/approval-confirmation.d.ts.map +1 -0
  220. package/dist/gateway/approval-confirmation.js +34 -0
  221. package/dist/gateway/approval-confirmation.js.map +1 -0
  222. package/dist/gateway/chat-result.d.ts +8 -0
  223. package/dist/gateway/chat-result.d.ts.map +1 -0
  224. package/dist/gateway/chat-result.js +206 -0
  225. package/dist/gateway/chat-result.js.map +1 -0
  226. package/dist/gateway/fullauto.d.ts +104 -0
  227. package/dist/gateway/fullauto.d.ts.map +1 -0
  228. package/dist/gateway/fullauto.js +1181 -0
  229. package/dist/gateway/fullauto.js.map +1 -0
  230. package/dist/gateway/gateway-agent-cards.d.ts +21 -0
  231. package/dist/gateway/gateway-agent-cards.d.ts.map +1 -0
  232. package/dist/gateway/gateway-agent-cards.js +334 -0
  233. package/dist/gateway/gateway-agent-cards.js.map +1 -0
  234. package/dist/gateway/gateway-error-utils.d.ts +3 -0
  235. package/dist/gateway/gateway-error-utils.d.ts.map +1 -0
  236. package/dist/gateway/gateway-error-utils.js +38 -0
  237. package/dist/gateway/gateway-error-utils.js.map +1 -0
  238. package/dist/gateway/gateway-formatting.d.ts +4 -0
  239. package/dist/gateway/gateway-formatting.d.ts.map +1 -0
  240. package/dist/gateway/gateway-formatting.js +30 -0
  241. package/dist/gateway/gateway-formatting.js.map +1 -0
  242. package/dist/gateway/gateway-request-runtime.d.ts +11 -0
  243. package/dist/gateway/gateway-request-runtime.d.ts.map +1 -0
  244. package/dist/gateway/gateway-request-runtime.js +72 -0
  245. package/dist/gateway/gateway-request-runtime.js.map +1 -0
  246. package/dist/gateway/gateway-service.d.ts +91 -7
  247. package/dist/gateway/gateway-service.d.ts.map +1 -1
  248. package/dist/gateway/gateway-service.js +1496 -285
  249. package/dist/gateway/gateway-service.js.map +1 -1
  250. package/dist/gateway/gateway-session-status.d.ts +14 -0
  251. package/dist/gateway/gateway-session-status.d.ts.map +1 -0
  252. package/dist/gateway/gateway-session-status.js +95 -0
  253. package/dist/gateway/gateway-session-status.js.map +1 -0
  254. package/dist/gateway/gateway-time.d.ts +5 -0
  255. package/dist/gateway/gateway-time.d.ts.map +1 -0
  256. package/dist/gateway/gateway-time.js +38 -0
  257. package/dist/gateway/gateway-time.js.map +1 -0
  258. package/dist/gateway/gateway-types.d.ts +309 -2
  259. package/dist/gateway/gateway-types.d.ts.map +1 -1
  260. package/dist/gateway/gateway-types.js.map +1 -1
  261. package/dist/gateway/gateway-utils.d.ts +5 -0
  262. package/dist/gateway/gateway-utils.d.ts.map +1 -0
  263. package/dist/gateway/gateway-utils.js +28 -0
  264. package/dist/gateway/gateway-utils.js.map +1 -0
  265. package/dist/gateway/gateway.js +255 -52
  266. package/dist/gateway/gateway.js.map +1 -1
  267. package/dist/gateway/health.d.ts.map +1 -1
  268. package/dist/gateway/health.js +388 -100
  269. package/dist/gateway/health.js.map +1 -1
  270. package/dist/gateway/pending-approvals.d.ts +20 -1
  271. package/dist/gateway/pending-approvals.d.ts.map +1 -1
  272. package/dist/gateway/pending-approvals.js +29 -6
  273. package/dist/gateway/pending-approvals.js.map +1 -1
  274. package/dist/gateway/proactive-delivery.d.ts +3 -1
  275. package/dist/gateway/proactive-delivery.d.ts.map +1 -1
  276. package/dist/gateway/proactive-delivery.js +18 -1
  277. package/dist/gateway/proactive-delivery.js.map +1 -1
  278. package/dist/gateway/reset-confirmation.d.ts +16 -0
  279. package/dist/gateway/reset-confirmation.d.ts.map +1 -0
  280. package/dist/gateway/reset-confirmation.js +49 -0
  281. package/dist/gateway/reset-confirmation.js.map +1 -0
  282. package/dist/gateway/show-mode.d.ts +10 -0
  283. package/dist/gateway/show-mode.d.ts.map +1 -0
  284. package/dist/gateway/show-mode.js +46 -0
  285. package/dist/gateway/show-mode.js.map +1 -0
  286. package/dist/infra/container-runner.d.ts +6 -18
  287. package/dist/infra/container-runner.d.ts.map +1 -1
  288. package/dist/infra/container-runner.js +69 -19
  289. package/dist/infra/container-runner.js.map +1 -1
  290. package/dist/infra/container-setup.d.ts.map +1 -1
  291. package/dist/infra/container-setup.js +1 -19
  292. package/dist/infra/container-setup.js.map +1 -1
  293. package/dist/infra/host-runner.d.ts +6 -33
  294. package/dist/infra/host-runner.d.ts.map +1 -1
  295. package/dist/infra/host-runner.js +64 -17
  296. package/dist/infra/host-runner.js.map +1 -1
  297. package/dist/infra/ipc.d.ts +16 -0
  298. package/dist/infra/ipc.d.ts.map +1 -1
  299. package/dist/infra/ipc.js +40 -7
  300. package/dist/infra/ipc.js.map +1 -1
  301. package/dist/infra/stream-debug.d.ts +1 -0
  302. package/dist/infra/stream-debug.d.ts.map +1 -1
  303. package/dist/infra/stream-debug.js +4 -0
  304. package/dist/infra/stream-debug.js.map +1 -1
  305. package/dist/infra/worker-signature.d.ts +9 -0
  306. package/dist/infra/worker-signature.d.ts.map +1 -0
  307. package/dist/infra/worker-signature.js +15 -0
  308. package/dist/infra/worker-signature.js.map +1 -0
  309. package/dist/logger.d.ts +2 -0
  310. package/dist/logger.d.ts.map +1 -1
  311. package/dist/logger.js +9 -1
  312. package/dist/logger.js.map +1 -1
  313. package/dist/media/audio-transcription-backends.d.ts +28 -0
  314. package/dist/media/audio-transcription-backends.d.ts.map +1 -0
  315. package/dist/media/audio-transcription-backends.js +764 -0
  316. package/dist/media/audio-transcription-backends.js.map +1 -0
  317. package/dist/media/audio-transcription.d.ts +19 -0
  318. package/dist/media/audio-transcription.d.ts.map +1 -0
  319. package/dist/media/audio-transcription.js +140 -0
  320. package/dist/media/audio-transcription.js.map +1 -0
  321. package/dist/media/mime-utils.d.ts +3 -0
  322. package/dist/media/mime-utils.d.ts.map +1 -0
  323. package/dist/media/mime-utils.js +8 -0
  324. package/dist/media/mime-utils.js.map +1 -0
  325. package/dist/media/path-utils.d.ts +2 -0
  326. package/dist/media/path-utils.d.ts.map +1 -0
  327. package/dist/media/path-utils.js +12 -0
  328. package/dist/media/path-utils.js.map +1 -0
  329. package/dist/media/pdf-context.d.ts +1 -0
  330. package/dist/media/pdf-context.d.ts.map +1 -1
  331. package/dist/media/pdf-context.js +12 -2
  332. package/dist/media/pdf-context.js.map +1 -1
  333. package/dist/memory/db.d.ts +39 -2
  334. package/dist/memory/db.d.ts.map +1 -1
  335. package/dist/memory/db.js +550 -4
  336. package/dist/memory/db.js.map +1 -1
  337. package/dist/memory/memory-service.d.ts +2 -2
  338. package/dist/memory/memory-service.d.ts.map +1 -1
  339. package/dist/memory/memory-service.js +20 -11
  340. package/dist/memory/memory-service.js.map +1 -1
  341. package/dist/model-selection.d.ts +3 -0
  342. package/dist/model-selection.d.ts.map +1 -0
  343. package/dist/model-selection.js +18 -0
  344. package/dist/model-selection.js.map +1 -0
  345. package/dist/onboarding.d.ts +0 -1
  346. package/dist/onboarding.d.ts.map +1 -1
  347. package/dist/onboarding.js +13 -7
  348. package/dist/onboarding.js.map +1 -1
  349. package/dist/providers/anthropic.d.ts.map +1 -1
  350. package/dist/providers/anthropic.js +0 -5
  351. package/dist/providers/anthropic.js.map +1 -1
  352. package/dist/providers/factory.d.ts +0 -1
  353. package/dist/providers/factory.d.ts.map +1 -1
  354. package/dist/providers/factory.js +18 -13
  355. package/dist/providers/factory.js.map +1 -1
  356. package/dist/providers/hybridai.d.ts.map +1 -1
  357. package/dist/providers/hybridai.js +3 -6
  358. package/dist/providers/hybridai.js.map +1 -1
  359. package/dist/providers/local-discovery.d.ts +18 -0
  360. package/dist/providers/local-discovery.d.ts.map +1 -0
  361. package/dist/providers/local-discovery.js +311 -0
  362. package/dist/providers/local-discovery.js.map +1 -0
  363. package/dist/providers/local-health.d.ts +10 -0
  364. package/dist/providers/local-health.d.ts.map +1 -0
  365. package/dist/providers/local-health.js +163 -0
  366. package/dist/providers/local-health.js.map +1 -0
  367. package/dist/providers/local-ollama.d.ts +3 -0
  368. package/dist/providers/local-ollama.d.ts.map +1 -0
  369. package/dist/providers/local-ollama.js +44 -0
  370. package/dist/providers/local-ollama.js.map +1 -0
  371. package/dist/providers/local-openai-compat.d.ts +4 -0
  372. package/dist/providers/local-openai-compat.d.ts.map +1 -0
  373. package/dist/providers/local-openai-compat.js +56 -0
  374. package/dist/providers/local-openai-compat.js.map +1 -0
  375. package/dist/providers/local-types.d.ts +60 -0
  376. package/dist/providers/local-types.d.ts.map +1 -0
  377. package/dist/providers/local-types.js +2 -0
  378. package/dist/providers/local-types.js.map +1 -0
  379. package/dist/providers/model-catalog.d.ts +6 -0
  380. package/dist/providers/model-catalog.d.ts.map +1 -0
  381. package/dist/providers/model-catalog.js +35 -0
  382. package/dist/providers/model-catalog.js.map +1 -0
  383. package/dist/providers/openai.d.ts.map +1 -1
  384. package/dist/providers/openai.js +3 -6
  385. package/dist/providers/openai.js.map +1 -1
  386. package/dist/providers/types.d.ts +7 -3
  387. package/dist/providers/types.d.ts.map +1 -1
  388. package/dist/scheduler/heartbeat.d.ts.map +1 -1
  389. package/dist/scheduler/heartbeat.js +46 -18
  390. package/dist/scheduler/heartbeat.js.map +1 -1
  391. package/dist/scheduler/scheduled-task-runner.d.ts.map +1 -1
  392. package/dist/scheduler/scheduled-task-runner.js +13 -2
  393. package/dist/scheduler/scheduled-task-runner.js.map +1 -1
  394. package/dist/scheduler/scheduler.d.ts +2 -0
  395. package/dist/scheduler/scheduler.d.ts.map +1 -1
  396. package/dist/scheduler/scheduler.js +5 -0
  397. package/dist/scheduler/scheduler.js.map +1 -1
  398. package/dist/security/media-paths.d.ts +19 -0
  399. package/dist/security/media-paths.d.ts.map +1 -0
  400. package/dist/security/media-paths.js +125 -0
  401. package/dist/security/media-paths.js.map +1 -0
  402. package/dist/security/redact.d.ts +10 -0
  403. package/dist/security/redact.d.ts.map +1 -0
  404. package/dist/security/redact.js +131 -0
  405. package/dist/security/redact.js.map +1 -0
  406. package/dist/security/runtime-secrets.d.ts +1 -1
  407. package/dist/security/runtime-secrets.d.ts.map +1 -1
  408. package/dist/security/runtime-secrets.js +5 -0
  409. package/dist/security/runtime-secrets.js.map +1 -1
  410. package/dist/session/session-maintenance.d.ts.map +1 -1
  411. package/dist/session/session-maintenance.js +32 -6
  412. package/dist/session/session-maintenance.js.map +1 -1
  413. package/dist/session/token-efficiency.d.ts.map +1 -1
  414. package/dist/session/token-efficiency.js +4 -0
  415. package/dist/session/token-efficiency.js.map +1 -1
  416. package/dist/skills/skills.d.ts +2 -1
  417. package/dist/skills/skills.d.ts.map +1 -1
  418. package/dist/skills/skills.js +18 -10
  419. package/dist/skills/skills.js.map +1 -1
  420. package/dist/tui-fullauto.d.ts +15 -0
  421. package/dist/tui-fullauto.d.ts.map +1 -0
  422. package/dist/tui-fullauto.js +56 -0
  423. package/dist/tui-fullauto.js.map +1 -0
  424. package/dist/tui-proactive.d.ts +3 -0
  425. package/dist/tui-proactive.d.ts.map +1 -0
  426. package/dist/tui-proactive.js +9 -0
  427. package/dist/tui-proactive.js.map +1 -0
  428. package/dist/tui-slash-command.d.ts +10 -0
  429. package/dist/tui-slash-command.d.ts.map +1 -1
  430. package/dist/tui-slash-command.js +25 -1
  431. package/dist/tui-slash-command.js.map +1 -1
  432. package/dist/tui-thinking.d.ts +14 -0
  433. package/dist/tui-thinking.d.ts.map +1 -0
  434. package/dist/tui-thinking.js +140 -0
  435. package/dist/tui-thinking.js.map +1 -0
  436. package/dist/tui.js +551 -140
  437. package/dist/tui.js.map +1 -1
  438. package/dist/types.d.ts +32 -3
  439. package/dist/types.d.ts.map +1 -1
  440. package/dist/types.js.map +1 -1
  441. package/dist/utils/sleep.d.ts +2 -0
  442. package/dist/utils/sleep.d.ts.map +1 -0
  443. package/dist/utils/sleep.js +7 -0
  444. package/dist/utils/sleep.js.map +1 -0
  445. package/dist/workspace.d.ts +10 -1
  446. package/dist/workspace.d.ts.map +1 -1
  447. package/dist/workspace.js +29 -0
  448. package/dist/workspace.js.map +1 -1
  449. package/docs/CNAME +1 -0
  450. package/docs/agents.html +2177 -0
  451. package/docs/chat.html +194 -2
  452. package/docs/development/README.md +2 -0
  453. package/docs/development/runtime.md +138 -1
  454. package/docs/development/voice-tts.md +123 -0
  455. package/docs/index.html +116 -81
  456. package/package.json +14 -5
  457. package/skills/docx/scripts/accept_changes.cjs +3 -1
  458. package/skills/docx/scripts/comment.cjs +40 -20
  459. package/skills/office/helpers/merge_runs.cjs +8 -2
  460. package/skills/office/helpers/simplify_redlines.cjs +1 -4
  461. package/skills/office/pack.cjs +12 -8
  462. package/skills/office/validate.cjs +30 -16
  463. package/skills/office/xml.cjs +15 -4
  464. package/skills/xlsx/SKILL.md +18 -4
  465. package/skills/xlsx/references/financial-modeling.md +33 -0
  466. package/skills/xlsx/scripts/import_delimited.cjs +24 -6
package/AGENTS.md CHANGED
@@ -1,85 +1,295 @@
1
- # AGENTS.md
2
-
3
- ## Scope
1
+ # AGENTS.md — HybridClaw Engineering Protocol
4
2
 
5
3
  This file is the canonical repo-level instruction set for coding agents working
6
- in HybridClaw.
4
+ in HybridClaw. Read it before any code change.
5
+
6
+ ## Scope
7
7
 
8
8
  - Follow this file first.
9
9
  - If a deeper directory contains its own `AGENTS.md`, that file overrides this
10
10
  one for its subtree.
11
11
  - Keep `CLAUDE.md` aligned with this file. `CLAUDE.md` should only carry
12
12
  tool-specific deltas.
13
+ - `templates/*.md` are product runtime workspace bootstrap files, not repo
14
+ contributor onboarding docs.
15
+
16
+ ---
17
+
18
+ ## 1) Project Snapshot
19
+
20
+ HybridClaw is a personal AI assistant bot for Discord, powered by HybridAI.
21
+ Enterprise-grade Node.js 22 application with gateway service, TUI client, and
22
+ Docker-sandboxed container runtime.
23
+
24
+ **Version:** 0.6.0  |  **Package:** `@hybridaione/hybridclaw`
25
+  |  **License:** see `LICENSE`
26
+
27
+ Architecture: gateway (core runtime, SQLite persistence, REST API, Discord
28
+ integration) → container (Docker-sandboxed tool execution via file-based IPC) →
29
+ TUI (thin HTTP client). Agent workspaces are bootstrapped from `templates/` and
30
+ seeded with identity, memory, and context files managed by `src/workspace.ts`.
31
+
32
+ ---
33
+
34
+ ## 2) Project Map
35
+
36
+ ```
37
+ src/
38
+ cli.ts CLI entry point and command dispatch
39
+ types.ts Core type definitions (ChatMessage, ContainerInput, ToolExecution, etc.)
40
+ workspace.ts Workspace bootstrap (SOUL.md, IDENTITY.md, USER.md, etc.)
41
+ logger.ts Structured logging (pino)
42
+ tui.ts Terminal UI
43
+ onboarding.ts Interactive onboarding
44
+ model-selection.ts Model selection logic
45
+ agent/ Agent execution: conversation loop, tool executor, prompt hooks, delegation
46
+ audit/ Append-only audit trail, approval tracking, hash-chain integrity
47
+ auth/ HybridAI and OpenAI Codex authentication flows
48
+ channels/discord/ Discord integration and delivery logic
49
+ config/ CLI flag parsing, runtime config management
50
+ gateway/ Core gateway service: HTTP APIs, health, session mgmt, approvals
51
+ infra/ Container setup, IPC (file-based), worker signatures, runners
52
+ memory/ SQLite database, semantic memory, compaction, consolidation, chunking
53
+ providers/ Model providers (HybridAI, Anthropic, OpenAI, Ollama, LM Studio, vLLM)
54
+ scheduler/ Scheduled task execution and cron management
55
+ security/ Mount allowlists, approval policies, secret redaction, instruction audit
56
+ session/ Session transcripts, token tracking, compaction, export
57
+ skills/ Skill resolution, installation, trust-aware guard
58
+ utils/ Shared utilities
59
+ media/ Media handling and context management
60
+
61
+ container/ Sandboxed runtime (separate npm package)
62
+ src/ Container agent runtime, tool execution, provider adapters, MCP client
63
+ Dockerfile Container build definition
64
+ package.json Container-specific deps (Playwright, agent-browser, PDF, MCP SDK)
65
+
66
+ skills/ Bundled SKILL.md skills (pdf, docx, xlsx, pptx, office, personality, etc.)
67
+ templates/ Runtime workspace bootstrap files seeded into agent workspaces
68
+ tests/ Vitest suites: unit, integration, e2e, live
69
+ docs/ Static site assets, development reference docs
70
+ console/ Web console workspace package
71
+ ```
72
+
73
+ ### Key Data Flows
74
+
75
+ ```
76
+ User message → Gateway (HTTP/Discord) → ContainerInput (JSON)
77
+ → Container spawns (Docker sandbox, file-based IPC)
78
+ → Agent loop (tool calls, approvals, MCP)
79
+ → ContainerOutput (JSON) → Gateway → User
80
+ → Session persisted (SQLite), audit logged (wire.jsonl, hash-chained)
81
+ ```
82
+
83
+ ### Extension Points
84
+
85
+ | Extension | Interface / Registration | Playbook |
86
+ |---------------|--------------------------------------------------------------|----------|
87
+ | Skill | `skills/<name>/SKILL.md` frontmatter | §7.1 |
88
+ | Provider | `src/providers/<name>.ts` + factory | §7.2 |
89
+ | MCP Server | `~/.hybridclaw/config.json` (`mcpServers.*`) → tool namespace | §7.3 |
90
+ | Approval rule | `.hybridclaw/policy.yaml` | §7.4 |
91
+ | Template | `templates/<name>.md` + `src/workspace.ts` | §7.5 |
92
+
93
+ ---
94
+
95
+ ## 3) Engineering Principles
96
+
97
+ These are implementation constraints, not suggestions.
98
+
99
+ ### 3.1 KISS
100
+
101
+ - Prefer straightforward control flow over abstraction.
102
+ - Keep error paths obvious and localized.
103
+ - Three similar lines of code is better than a premature helper.
104
+
105
+ ### 3.2 YAGNI
106
+
107
+ - Do not add config keys, interfaces, or feature flags without a concrete caller.
108
+ - Do not add error handling for scenarios that cannot happen.
109
+ - Do not design for hypothetical future requirements.
110
+
111
+ ### 3.3 DRY — Rule of Three
112
+
113
+ - Duplicate small local logic when it preserves clarity.
114
+ - Extract shared helpers only after three repeated, stable patterns.
115
+ - When extracting, preserve module boundaries.
116
+
117
+ ### 3.4 Fail Fast
118
+
119
+ - Prefer explicit errors for unsupported or unsafe states.
120
+ - Never silently broaden permissions or capabilities.
121
+ - Validate at system boundaries (user input, external APIs, IPC); trust internal
122
+ code.
123
+
124
+ ### 3.5 Secure by Default
125
+
126
+ - LLM output is untrusted by default.
127
+ - Defaults are deny-by-default (mount allowlists, approval tiers, sandbox).
128
+ - Never log secrets, raw tokens, or sensitive payloads.
129
+ - Read `SECURITY.md` and `TRUST_MODEL.md` before touching security surfaces.
130
+
131
+ ---
132
+
133
+ ## 4) Risk Tiers by Path
134
+
135
+ Classify changes by blast radius. When uncertain, classify higher.
136
+
137
+ | Tier | Paths |
138
+ |--------|-----------------------------------------------------------------------------|
139
+ | High | `src/security/`, `src/gateway/`, `src/infra/`, `src/audit/`, `container/src/approval-policy.ts`, `container/src/extensions.ts`, `.hybridclaw/policy.yaml` |
140
+ | Medium | `src/agent/`, `src/providers/`, `src/session/`, `src/memory/`, `src/skills/`, `container/src/`, `templates/` |
141
+ | Low | `docs/`, `skills/` (bundled SKILL.md), test additions, comments, formatting |
142
+
143
+ **High-risk changes** must include threat/risk notes and boundary/failure-mode
144
+ tests. **Medium-risk changes** need targeted test coverage. **Low-risk changes**
145
+ should verify no broken references.
146
+
147
+ ---
148
+
149
+ ## 5) Setup and Commands
150
+
151
+ ### Prerequisites
152
+
153
+ - Node.js 22 (matches CI and `engines` field)
154
+ - npm
155
+ - Docker when working on container-mode behavior or image builds
13
156
 
14
- ## Project Map
157
+ ### Common Commands
15
158
 
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
159
+ ```bash
160
+ npm install # install deps + Husky hooks
161
+ npm run setup # install container/ deps
162
+ npm run build # compile root + container TypeScript
163
+ npm run typecheck # tsc --noEmit
164
+ npm run lint # tsc --noEmit with unused detection
165
+ npm run check # biome check src
166
+ npm run format # biome check --write src
167
+ npm run test:unit # vitest unit suite
168
+ npm run test:integration # integration tests
169
+ npm run test:e2e # end-to-end tests
170
+ npm run test:live # live tests (requires credentials)
171
+ npm run release:check # verify release readiness
172
+ npm --prefix container run lint # container lint
173
+ npm --prefix container run release:check # container release check
174
+ npm run build:container # build Docker image
175
+ ```
176
+
177
+ ### Dev Mode
178
+
179
+ ```bash
180
+ npm run dev # tsx src/cli.ts gateway (hot reload)
181
+ npm run tui # tsx src/cli.ts tui
182
+ ```
25
183
 
26
- ## Working Rules
184
+ ---
185
+
186
+ ## 6) Working Rules
187
+
188
+ ### Code Changes
27
189
 
28
190
  - Keep changes focused. Prefer targeted fixes over broad refactors unless the
29
191
  task requires wider movement.
30
- - Match the existing TypeScript + ESM patterns already used in the touched area.
192
+ - Match the existing TypeScript + ESM patterns in the touched area.
31
193
  - Update tests and docs when behavior, commands, or repo workflows change.
32
- - Treat existing uncommitted changes as user work unless you created them.
33
194
  - Do not rename or relocate files in `templates/` without updating
34
195
  `src/workspace.ts` and the workspace bootstrap tests.
196
+ - Do not mix container and gateway changes in one commit unless they are
197
+ tightly coupled.
35
198
 
36
- ## Setup And Commands
199
+ ### Coding Style
37
200
 
38
- Prerequisites:
201
+ - **Language:** TypeScript (strict mode, ES2022 target, NodeNext modules, ESM).
202
+ - **Formatting:** Biome is authoritative. Run `npm run format` before
203
+ committing. The Husky pre-commit hook runs `npx biome check --write --staged`.
204
+ - **Single quotes** for strings (configured in `biome.json`).
205
+ - **No `any`** without strong justification. No `@ts-nocheck`.
206
+ - **File size:** aim for ~500 LOC; split when it improves clarity or
207
+ testability. `src/skills/skills-guard.ts` and `src/skills/skills.ts` are
208
+ current large exceptions — do not grow them further without splitting.
209
+ - **Comments:** brief comments for tricky or non-obvious logic only. Do not add
210
+ comments, docstrings, or type annotations to code you did not change.
211
+ - **Imports:** let Biome organize imports. Do not mix dynamic
212
+ `await import()` and static `import` for the same module in production paths.
213
+ - **Dependencies:** root `package.json` is for gateway/CLI deps. Container-only
214
+ deps go in `container/package.json`. Never add container deps to root.
39
215
 
40
- - Node.js 22 (matches CI)
41
- - npm
42
- - Docker when working on container-mode behavior or image builds
216
+ ### Git Discipline
217
+
218
+ - Treat existing uncommitted changes as user work unless you created them.
219
+ - Conventional Commits preferred: `feat:`, `fix:`, `test:`, `refactor:`,
220
+ `chore:`, `docs:`.
221
+ - Group related changes; avoid bundling unrelated refactors.
222
+ - Never commit real API keys, tokens, credentials, or personal data. Use
223
+ neutral placeholders in tests: `"test-key"`, `"example.com"`, `"user_a"`.
43
224
 
44
- Common commands:
225
+ ---
45
226
 
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
- ```
227
+ ## 7) Change Playbooks
61
228
 
62
- ## Testing Expectations
229
+ ### 7.1 Adding a Skill
63
230
 
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.
231
+ 1. Create `skills/<name>/SKILL.md` with required frontmatter:
232
+ ```yaml
233
+ ---
234
+ name: my-skill
235
+ description: One-line description
236
+ user-invocable: true # optional, enables /<name> invocation
237
+ ---
238
+ ```
239
+ 2. Add markdown instructions and working rules in the body.
240
+ 3. If the skill needs supporting scripts, place them alongside `SKILL.md`.
241
+ 4. Bundled script paths are mirrored into `/workspace/skills/<name>` at runtime.
242
+ 5. Test: `hybridclaw skill list` should show the new skill.
73
243
 
74
- ## Documentation Hierarchy
244
+ Skill resolution order (first match wins):
245
+ 1. `config.skills.extraDirs[]`
246
+ 2. Bundled: `skills/<name>`
247
+ 3. `$CODEX_HOME/skills`
248
+ 4. `~/.codex/skills`, `~/.claude/skills`, `~/.agents/skills`
249
+ 5. Project/workspace: `./.agents/skills`, `./skills`
75
250
 
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.
251
+ ### 7.2 Adding a Provider
252
+
253
+ 1. Create `src/providers/<name>.ts` implementing the provider interface.
254
+ 2. Register in the provider factory (`src/providers/`).
255
+ 3. Add config section in `src/config/` if new credentials or endpoints needed.
256
+ 4. Add tests for factory wiring, error paths, and config parsing.
257
+ 5. Update `docs/` if the provider is user-facing.
258
+
259
+ ### 7.3 Adding an MCP Server
81
260
 
82
- ## Bump Release
261
+ 1. Add the server config to `~/.hybridclaw/config.json` under `mcpServers`:
262
+ ```json
263
+ {
264
+ "mcpServers": {
265
+ "<server-name>": {
266
+ "command": "...",
267
+ "args": ["..."],
268
+ "transport": "stdio"
269
+ }
270
+ }
271
+ }
272
+ ```
273
+ 2. Tools are auto-discovered at startup and merged into the tool namespace.
274
+ 3. Test with `hybridclaw` running in dev mode.
275
+
276
+ ### 7.4 Modifying Approval Policy
277
+
278
+ 1. Edit `.hybridclaw/policy.yaml`.
279
+ 2. Approval tiers: green (silent) → yellow (narrated) → red (explicit approval).
280
+ 3. `pinned_red` patterns are never auto-promoted.
281
+ 4. Test approval flows with integration tests that exercise the boundary.
282
+
283
+ ### 7.5 Modifying Templates
284
+
285
+ 1. Edit the file in `templates/`.
286
+ 2. **Always** update `src/workspace.ts` if you add, remove, or rename a
287
+ template file.
288
+ 3. Run workspace bootstrap tests to verify.
289
+ 4. Remember: templates are seeded into agent workspaces at runtime — changes
290
+ only apply to new sessions or after workspace reset.
291
+
292
+ ### 7.6 Bump Release
83
293
 
84
294
  When the user says "bump release":
85
295
 
@@ -93,8 +303,117 @@ When the user says "bump release":
93
303
  3. Move `CHANGELOG.md` release notes from `Unreleased` to the new version
94
304
  heading (or create one).
95
305
  4. Update `README.md` "latest tag" link/text if present.
96
- 5. Commit with a release chore message (for example `chore: release vX.Y.Z`).
306
+ 5. Commit with `chore: release vX.Y.Z`.
97
307
  6. Create an annotated git tag `vX.Y.Z`.
98
308
  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.
309
+ 8. Create or publish a GitHub Release entry for the tag.
310
+
311
+ ---
312
+
313
+ ## 8) Testing Expectations
314
+
315
+ ### What to Run
316
+
317
+ | Change scope | Required checks |
318
+ |---------------------|-------------------------------------------------------------|
319
+ | Docs only | Verify links, commands, examples |
320
+ | `src/` changes | `npm run typecheck`, `npm run lint`, targeted Vitest suites |
321
+ | `container/` changes| `npm --prefix container run lint`, `npm run build`, IPC boundary tests |
322
+ | `skills/` changes | `hybridclaw skill list`, targeted skill tests |
323
+ | Release/packaging | Both `release:check` scripts, verify versioned docs |
324
+ | Security surfaces | Include boundary and failure-mode tests |
325
+
326
+ ### Conventions
327
+
328
+ - Test files: `tests/*.test.ts`, `*.integration.test.ts`, `*.e2e.test.ts`,
329
+ `*.live.test.ts`.
330
+ - Live tests require credentials. Skip them unless your change needs them,
331
+ and state that explicitly in your handoff.
332
+ - If you skip a relevant check, state what you skipped and why.
333
+ - Never hardcode real credentials in tests. Use env vars or test fixtures.
334
+
335
+ ---
336
+
337
+ ## 9) Anti-Patterns (Do Not)
338
+
339
+ - Do not rename or relocate `templates/` files without updating
340
+ `src/workspace.ts`.
341
+ - Do not add container-only deps to root `package.json`.
342
+ - Do not grow `src/skills/skills-guard.ts` or `src/skills/skills.ts` further
343
+ without splitting.
344
+ - Do not use `@ts-nocheck` or disable lint rules without strong justification.
345
+ - Do not silently weaken security policy, approval tiers, or mount allowlists.
346
+ - Do not log secrets, tokens, or sensitive payloads — even at debug level.
347
+ - Do not modify unrelated modules "while here".
348
+ - Do not include personal identity, real phone numbers, or live config values
349
+ in tests, examples, docs, or commits.
350
+ - Do not edit `node_modules/` or vendored files.
351
+ - Do not break prompt caching: do not alter past context, change toolsets, or
352
+ rebuild system prompts mid-conversation.
353
+ - Do not return stale or mocked data for security/audit paths.
354
+
355
+ ---
356
+
357
+ ## 10) Multi-Agent Safety
358
+
359
+ When multiple agents may be working on this repo concurrently:
360
+
361
+ - **Do not** create, apply, or drop `git stash` entries unless explicitly
362
+ requested (including `git pull --rebase --autostash`).
363
+ - **Do not** switch branches or check out a different branch unless explicitly
364
+ requested.
365
+ - **Do not** create, remove, or modify `git worktree` checkouts unless
366
+ explicitly requested.
367
+ - When the user says "commit", scope to **your changes only**. When the user
368
+ says "commit all", commit everything in grouped chunks.
369
+ - When the user says "push", you may `git pull --rebase` to integrate latest
370
+ changes. Never discard other agents' work.
371
+ - When you see unrecognized files, keep going. Focus on your changes and commit
372
+ only those.
373
+ - Focus reports on your edits. End with a brief "other files present" note only
374
+ if relevant.
375
+ - Lint/format churn: if diffs are formatting-only, auto-resolve without asking.
376
+ Only ask when changes are semantic (logic/data/behavior).
377
+
378
+ ---
379
+
380
+ ## 11) Documentation Hierarchy
381
+
382
+ | Document | Audience | Purpose |
383
+ |-----------------------------|---------------------|---------------------------------|
384
+ | `README.md` | End users | Product overview, setup |
385
+ | `AGENTS.md` (this file) | Coding agents | Canonical repo instructions |
386
+ | `CLAUDE.md` | Claude Code | Thin shim → `AGENTS.md` |
387
+ | `CONTRIBUTING.md` | Human contributors | Quickstart, PR workflow |
388
+ | `SECURITY.md` | Security reviewers | Runtime security controls |
389
+ | `TRUST_MODEL.md` | Operators | Trust acceptance policy |
390
+ | `docs/development/` | Maintainers | Architecture, runtime, testing |
391
+ | `templates/*.md` | Product runtime | Agent workspace bootstrap |
392
+
393
+ ---
394
+
395
+ ## 12) Handoff Template
396
+
397
+ When handing off work (agent → agent or agent → maintainer), include:
398
+
399
+ 1. **What changed** — files touched and why.
400
+ 2. **What did not change** — scope boundaries you respected.
401
+ 3. **Validation** — which checks you ran and their results.
402
+ 4. **Skipped checks** — what you did not run and why.
403
+ 5. **Remaining risks / unknowns** — open questions or edge cases.
404
+ 6. **Next recommended action** — what to do next.
405
+
406
+ ---
407
+
408
+ ## 13) Vibe Coding Guardrails
409
+
410
+ When working in fast iterative mode:
411
+
412
+ - Keep each iteration reversible (small commits, clear rollback path).
413
+ - Validate assumptions with code search before implementing.
414
+ - Prefer deterministic behavior over clever shortcuts.
415
+ - Do not "ship and hope" on security-sensitive paths.
416
+ - If uncertain about an internal API, search `src/` for existing usage patterns
417
+ before guessing.
418
+ - If uncertain about architecture, read the type definitions in `src/types.ts`
419
+ and the workspace bootstrap in `src/workspace.ts` before implementing.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,102 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.7.0](https://github.com/HybridAIOne/hybridclaw/tree/v0.7.0)
6
+
7
+ ### Added
8
+
9
+ - **First-class agents and agent commands**: Agents now own workspaces
10
+ independently of the active model provider, with `agent` commands available
11
+ through the gateway, TUI, and Discord for inspecting, listing, creating, and
12
+ switching session bindings.
13
+ - **Agent/session dashboard split**: The `/agents` page and `/api/agents`
14
+ response now distinguish logical agents from bound sessions so operators can
15
+ see both workspace-level state and per-session runtime state.
16
+ - **Embedded admin console and full-auto sessions**: Added the `/admin` web
17
+ console plus `fullauto [status|off|on [prompt]|<prompt>]` so operators can
18
+ inspect runtime state in the browser and arm persistent background session
19
+ loops from gateway and TUI control surfaces.
20
+ - **WhatsApp channel integration and shared message routing**: Added WhatsApp
21
+ channel setup/linking plus shared `message` send routing across Discord,
22
+ WhatsApp, and local proactive channels, including local-file delivery from
23
+ workspaces and `/discord-media-cache`.
24
+ - **Inbound audio transcription**: Added multi-backend audio
25
+ transcription with local CLI auto-detect, provider fallbacks, and native
26
+ current-turn audio injection for supported local-model sessions when no
27
+ transcript backend is available.
28
+
29
+ ### Changed
30
+
31
+ - **Stable workspace identity across model/provider changes**: Session
32
+ workspaces are now keyed by agent identity instead of provider-derived agent
33
+ IDs, so switching from one backend or model family to another keeps the same
34
+ workspace and memory unless the session is explicitly rebound to another
35
+ agent.
36
+ - **Session visibility control**: Added `show all|thinking|tools|none` across
37
+ gateway, TUI, Discord, and web chat so each session can suppress thinking
38
+ previews and tool activity independently.
39
+ - **Runtime status visibility**: Shared `status` output in TUI and Discord now
40
+ includes the current session agent alongside the effective model and sandbox
41
+ state.
42
+ - **TUI streaming and thinking presentation**: TUI replies now stream as
43
+ multiline assistant output, transient thinking previews are rendered
44
+ separately from final answers, tool activity stays live during streaming, and
45
+ the thinking indicator uses the new pulsing jellyfish status line.
46
+ - **Audio/media and channel delivery flow**: Audio attachments, local media
47
+ sends, and PDF context truncation now share tighter path handling and more
48
+ consistent fallback behavior across Discord, WhatsApp, and TUI-driven turns.
49
+ - **Discord activation config cleanup**: Removed the obsolete
50
+ `discord.respondToAllMessages` config path. Guild activation now follows
51
+ `channel mode`, guild policy, and explicit free-response channel settings.
52
+
53
+ ### Fixed
54
+
55
+ - **Heartbeat/tool-call stream timeouts**: Hidden stream activity now extends
56
+ the IPC inactivity deadline even when providers emit tool-call or reasoning
57
+ chunks without visible text, preventing false heartbeat timeouts on long
58
+ local-model turns.
59
+ - **WhatsApp follow-up reliability**: Timeout, follow-up, and internal channel
60
+ handling edge cases no longer leave WhatsApp turns hanging or silently losing
61
+ queued replies.
62
+ - **Tool placeholder replies**: Placeholder `Done.` replies after failed tool
63
+ turns are now replaced with useful fallback content such as concise tool
64
+ failure summaries or derived tool results.
65
+ - **Approval/runtime hardening and redaction**: Tool-output secret redaction and
66
+ approval/runtime guards were tightened to reduce accidental leakage and make
67
+ blocked or failed actions surface more clearly.
68
+
69
+ ## [0.6.0](https://github.com/HybridAIOne/hybridclaw/tree/v0.6.0)
70
+
71
+ ### Added
72
+
73
+ - **Local LLM provider support**: Added Ollama, LM Studio, and vLLM as local
74
+ backends with `hybridclaw local configure|status`, auto-discovery of running
75
+ instances, health monitoring, model catalog management, thinking extraction,
76
+ and tool-call normalization for small local models.
77
+ - **Session reset flow**: Added `reset [yes|no]` across gateway/TUI and Discord
78
+ slash commands so a session can clear history, restore per-session
79
+ model/chatbot/RAG defaults, and remove the active agent workspace after
80
+ confirmation.
81
+ - **Activity-based agent timeout**: The IPC read timeout now resets on agent
82
+ activity (text deltas, tool progress) instead of using a fixed wall clock,
83
+ so slow local models making steady progress are not killed prematurely.
84
+
85
+ ### Fixed
86
+
87
+ - **Host sandbox `/workspace` references**: System prompt skill locations and
88
+ tool guidance now use real filesystem paths when `sandbox=host` instead of
89
+ the container-only `/workspace` mount path that does not exist on the host.
90
+ - **Local provider session stability**: Pooled workers now restart when backend
91
+ targets or auth signatures change, recreated workspaces clear stale session
92
+ transcript state, and missing workspace approval policies are bootstrapped
93
+ reliably.
94
+ - **Session compaction budget accuracy**: Auto-compaction now counts system
95
+ prompt tokens instead of only message and summary tokens, so compaction
96
+ triggers at the configured threshold.
97
+ - **Misleading timeout error message**: Changed "Timeout waiting for container
98
+ output" to "Timeout waiting for agent output" since the same IPC mechanism
99
+ is used by both host and container runners.
100
+
5
101
  ## [0.5.0](https://github.com/HybridAIOne/hybridclaw/tree/v0.5.0)
6
102
 
7
103
  ### Added