@hybridaione/hybridclaw 0.6.0 → 0.7.1

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 (509) hide show
  1. package/AGENTS.md +380 -58
  2. package/CHANGELOG.md +63 -0
  3. package/README.md +93 -44
  4. package/config.example.json +85 -4
  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/Dockerfile +1 -0
  10. package/container/dist/approval-policy.js +46 -4
  11. package/container/dist/approval-policy.js.map +1 -1
  12. package/container/dist/browser-tools.js +35 -197
  13. package/container/dist/browser-tools.js.map +1 -1
  14. package/container/dist/discord-cdn.js +20 -0
  15. package/container/dist/discord-cdn.js.map +1 -0
  16. package/container/dist/index.js +192 -252
  17. package/container/dist/index.js.map +1 -1
  18. package/container/dist/model-retry.js +1 -1
  19. package/container/dist/model-retry.js.map +1 -1
  20. package/container/dist/native-media.js +273 -0
  21. package/container/dist/native-media.js.map +1 -0
  22. package/container/dist/providers/auxiliary.js +105 -0
  23. package/container/dist/providers/auxiliary.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 +19 -4
  27. package/container/dist/providers/local-ollama.js.map +1 -1
  28. package/container/dist/providers/local-openai-compat.js +31 -7
  29. package/container/dist/providers/local-openai-compat.js.map +1 -1
  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/router.js +140 -0
  33. package/container/dist/providers/router.js.map +1 -0
  34. package/container/dist/providers/shared.js +45 -8
  35. package/container/dist/providers/shared.js.map +1 -1
  36. package/container/dist/providers/thinking-extractor.js +46 -0
  37. package/container/dist/providers/thinking-extractor.js.map +1 -1
  38. package/container/dist/ralph.js +63 -0
  39. package/container/dist/ralph.js.map +1 -0
  40. package/container/dist/runtime-paths.js +32 -1
  41. package/container/dist/runtime-paths.js.map +1 -1
  42. package/container/dist/token-usage.js +4 -0
  43. package/container/dist/token-usage.js.map +1 -1
  44. package/container/dist/tools.js +353 -203
  45. package/container/dist/tools.js.map +1 -1
  46. package/container/dist/types.js +9 -1
  47. package/container/dist/types.js.map +1 -1
  48. package/container/package-lock.json +2 -2
  49. package/container/package.json +2 -1
  50. package/container/shared/provider-context.d.ts +13 -0
  51. package/container/shared/provider-context.js +48 -0
  52. package/container/shared/response-text.d.ts +1 -0
  53. package/container/shared/response-text.js +25 -0
  54. package/container/src/approval-policy.ts +56 -6
  55. package/container/src/browser-tools.ts +58 -218
  56. package/container/src/discord-cdn.ts +21 -0
  57. package/container/src/index.ts +208 -295
  58. package/container/src/model-retry.ts +1 -1
  59. package/container/src/native-media.ts +326 -0
  60. package/container/src/providers/auxiliary.ts +196 -0
  61. package/container/src/providers/hybridai.ts +1 -0
  62. package/container/src/providers/local-ollama.ts +18 -4
  63. package/container/src/providers/local-openai-compat.ts +31 -5
  64. package/container/src/providers/openai-codex.ts +4 -0
  65. package/container/src/providers/router.ts +237 -0
  66. package/container/src/providers/shared.ts +54 -8
  67. package/container/src/providers/thinking-extractor.ts +54 -0
  68. package/container/src/ralph.ts +71 -0
  69. package/container/src/runtime-paths.ts +42 -4
  70. package/container/src/token-usage.ts +4 -0
  71. package/container/src/tools.ts +1274 -982
  72. package/container/src/types.ts +66 -2
  73. package/dist/agent/agent.d.ts +3 -2
  74. package/dist/agent/agent.d.ts.map +1 -1
  75. package/dist/agent/agent.js +13 -10
  76. package/dist/agent/agent.js.map +1 -1
  77. package/dist/agent/conversation.d.ts +1 -0
  78. package/dist/agent/conversation.d.ts.map +1 -1
  79. package/dist/agent/conversation.js +2 -1
  80. package/dist/agent/conversation.js.map +1 -1
  81. package/dist/agent/executor-types.d.ts +30 -0
  82. package/dist/agent/executor-types.d.ts.map +1 -0
  83. package/dist/agent/executor-types.js +2 -0
  84. package/dist/agent/executor-types.js.map +1 -0
  85. package/dist/agent/executor.d.ts +2 -24
  86. package/dist/agent/executor.d.ts.map +1 -1
  87. package/dist/agent/executor.js +5 -0
  88. package/dist/agent/executor.js.map +1 -1
  89. package/dist/agent/prompt-hooks.d.ts +0 -1
  90. package/dist/agent/prompt-hooks.d.ts.map +1 -1
  91. package/dist/agent/prompt-hooks.js +18 -8
  92. package/dist/agent/prompt-hooks.js.map +1 -1
  93. package/dist/agent/tool-summary.d.ts +7 -0
  94. package/dist/agent/tool-summary.d.ts.map +1 -1
  95. package/dist/agent/tool-summary.js +14 -1
  96. package/dist/agent/tool-summary.js.map +1 -1
  97. package/dist/agents/agent-registry.d.ts +25 -0
  98. package/dist/agents/agent-registry.d.ts.map +1 -0
  99. package/dist/agents/agent-registry.js +394 -0
  100. package/dist/agents/agent-registry.js.map +1 -0
  101. package/dist/agents/agent-types.d.ts +23 -0
  102. package/dist/agents/agent-types.d.ts.map +1 -0
  103. package/dist/agents/agent-types.js +2 -0
  104. package/dist/agents/agent-types.js.map +1 -0
  105. package/dist/audit/audit-events.d.ts.map +1 -1
  106. package/dist/audit/audit-events.js +11 -4
  107. package/dist/audit/audit-events.js.map +1 -1
  108. package/dist/audit/audit-trail.d.ts.map +1 -1
  109. package/dist/audit/audit-trail.js +2 -47
  110. package/dist/audit/audit-trail.js.map +1 -1
  111. package/dist/channels/discord/attachments.d.ts.map +1 -1
  112. package/dist/channels/discord/attachments.js +171 -221
  113. package/dist/channels/discord/attachments.js.map +1 -1
  114. package/dist/channels/discord/discord-cdn-fetch.d.ts +20 -0
  115. package/dist/channels/discord/discord-cdn-fetch.d.ts.map +1 -0
  116. package/dist/channels/discord/discord-cdn-fetch.js +219 -0
  117. package/dist/channels/discord/discord-cdn-fetch.js.map +1 -0
  118. package/dist/channels/discord/inbound.d.ts +0 -1
  119. package/dist/channels/discord/inbound.d.ts.map +1 -1
  120. package/dist/channels/discord/inbound.js +4 -23
  121. package/dist/channels/discord/inbound.js.map +1 -1
  122. package/dist/channels/discord/media-cache.d.ts +18 -0
  123. package/dist/channels/discord/media-cache.d.ts.map +1 -0
  124. package/dist/channels/discord/media-cache.js +194 -0
  125. package/dist/channels/discord/media-cache.js.map +1 -0
  126. package/dist/channels/discord/prompt-adapter.js +3 -3
  127. package/dist/channels/discord/prompt-adapter.js.map +1 -1
  128. package/dist/channels/discord/runtime.d.ts +1 -0
  129. package/dist/channels/discord/runtime.d.ts.map +1 -1
  130. package/dist/channels/discord/runtime.js +50 -21
  131. package/dist/channels/discord/runtime.js.map +1 -1
  132. package/dist/channels/discord/send-files.d.ts +1 -0
  133. package/dist/channels/discord/send-files.d.ts.map +1 -1
  134. package/dist/channels/discord/send-files.js +2 -0
  135. package/dist/channels/discord/send-files.js.map +1 -1
  136. package/dist/channels/discord/slash-commands.d.ts.map +1 -1
  137. package/dist/channels/discord/slash-commands.js +33 -572
  138. package/dist/channels/discord/slash-commands.js.map +1 -1
  139. package/dist/channels/discord/tool-actions.d.ts +3 -1
  140. package/dist/channels/discord/tool-actions.d.ts.map +1 -1
  141. package/dist/channels/discord/tool-actions.js +66 -25
  142. package/dist/channels/discord/tool-actions.js.map +1 -1
  143. package/dist/channels/email/allowlist.d.ts +5 -0
  144. package/dist/channels/email/allowlist.d.ts.map +1 -0
  145. package/dist/channels/email/allowlist.js +67 -0
  146. package/dist/channels/email/allowlist.js.map +1 -0
  147. package/dist/channels/email/connection.d.ts +12 -0
  148. package/dist/channels/email/connection.d.ts.map +1 -0
  149. package/dist/channels/email/connection.js +223 -0
  150. package/dist/channels/email/connection.js.map +1 -0
  151. package/dist/channels/email/constants.d.ts +2 -0
  152. package/dist/channels/email/constants.d.ts.map +1 -0
  153. package/dist/channels/email/constants.js +2 -0
  154. package/dist/channels/email/constants.js.map +1 -0
  155. package/dist/channels/email/dedup.d.ts +8 -0
  156. package/dist/channels/email/dedup.d.ts.map +1 -0
  157. package/dist/channels/email/dedup.js +37 -0
  158. package/dist/channels/email/dedup.js.map +1 -0
  159. package/dist/channels/email/delivery.d.ts +27 -0
  160. package/dist/channels/email/delivery.d.ts.map +1 -0
  161. package/dist/channels/email/delivery.js +222 -0
  162. package/dist/channels/email/delivery.js.map +1 -0
  163. package/dist/channels/email/inbound.d.ts +19 -0
  164. package/dist/channels/email/inbound.d.ts.map +1 -0
  165. package/dist/channels/email/inbound.js +160 -0
  166. package/dist/channels/email/inbound.js.map +1 -0
  167. package/dist/channels/email/prompt-adapter.d.ts +3 -0
  168. package/dist/channels/email/prompt-adapter.d.ts.map +1 -0
  169. package/dist/channels/email/prompt-adapter.js +25 -0
  170. package/dist/channels/email/prompt-adapter.js.map +1 -0
  171. package/dist/channels/email/runtime.d.ts +31 -0
  172. package/dist/channels/email/runtime.d.ts.map +1 -0
  173. package/dist/channels/email/runtime.js +217 -0
  174. package/dist/channels/email/runtime.js.map +1 -0
  175. package/dist/channels/email/threading.d.ts +16 -0
  176. package/dist/channels/email/threading.d.ts.map +1 -0
  177. package/dist/channels/email/threading.js +76 -0
  178. package/dist/channels/email/threading.js.map +1 -0
  179. package/dist/channels/message/tool-actions.d.ts +3 -0
  180. package/dist/channels/message/tool-actions.d.ts.map +1 -0
  181. package/dist/channels/message/tool-actions.js +297 -0
  182. package/dist/channels/message/tool-actions.js.map +1 -0
  183. package/dist/channels/prompt-adapters.d.ts.map +1 -1
  184. package/dist/channels/prompt-adapters.js +22 -2
  185. package/dist/channels/prompt-adapters.js.map +1 -1
  186. package/dist/channels/whatsapp/auth.d.ts +25 -0
  187. package/dist/channels/whatsapp/auth.d.ts.map +1 -0
  188. package/dist/channels/whatsapp/auth.js +164 -0
  189. package/dist/channels/whatsapp/auth.js.map +1 -0
  190. package/dist/channels/whatsapp/connection.d.ts +13 -0
  191. package/dist/channels/whatsapp/connection.d.ts.map +1 -0
  192. package/dist/channels/whatsapp/connection.js +292 -0
  193. package/dist/channels/whatsapp/connection.js.map +1 -0
  194. package/dist/channels/whatsapp/debounce.d.ts +28 -0
  195. package/dist/channels/whatsapp/debounce.d.ts.map +1 -0
  196. package/dist/channels/whatsapp/debounce.js +69 -0
  197. package/dist/channels/whatsapp/debounce.js.map +1 -0
  198. package/dist/channels/whatsapp/delivery.d.ts +24 -0
  199. package/dist/channels/whatsapp/delivery.d.ts.map +1 -0
  200. package/dist/channels/whatsapp/delivery.js +98 -0
  201. package/dist/channels/whatsapp/delivery.js.map +1 -0
  202. package/dist/channels/whatsapp/inbound.d.ts +39 -0
  203. package/dist/channels/whatsapp/inbound.d.ts.map +1 -0
  204. package/dist/channels/whatsapp/inbound.js +284 -0
  205. package/dist/channels/whatsapp/inbound.js.map +1 -0
  206. package/dist/channels/whatsapp/markdown.d.ts +2 -0
  207. package/dist/channels/whatsapp/markdown.d.ts.map +1 -0
  208. package/dist/channels/whatsapp/markdown.js +39 -0
  209. package/dist/channels/whatsapp/markdown.js.map +1 -0
  210. package/dist/channels/whatsapp/message-store.d.ts +9 -0
  211. package/dist/channels/whatsapp/message-store.d.ts.map +1 -0
  212. package/dist/channels/whatsapp/message-store.js +212 -0
  213. package/dist/channels/whatsapp/message-store.js.map +1 -0
  214. package/dist/channels/whatsapp/mime-utils.d.ts +3 -0
  215. package/dist/channels/whatsapp/mime-utils.d.ts.map +1 -0
  216. package/dist/channels/whatsapp/mime-utils.js +33 -0
  217. package/dist/channels/whatsapp/mime-utils.js.map +1 -0
  218. package/dist/channels/whatsapp/phone.d.ts +8 -0
  219. package/dist/channels/whatsapp/phone.d.ts.map +1 -0
  220. package/dist/channels/whatsapp/phone.js +73 -0
  221. package/dist/channels/whatsapp/phone.js.map +1 -0
  222. package/dist/channels/whatsapp/prompt-adapter.d.ts +3 -0
  223. package/dist/channels/whatsapp/prompt-adapter.d.ts.map +1 -0
  224. package/dist/channels/whatsapp/prompt-adapter.js +24 -0
  225. package/dist/channels/whatsapp/prompt-adapter.js.map +1 -0
  226. package/dist/channels/whatsapp/runtime.d.ts +31 -0
  227. package/dist/channels/whatsapp/runtime.d.ts.map +1 -0
  228. package/dist/channels/whatsapp/runtime.js +195 -0
  229. package/dist/channels/whatsapp/runtime.js.map +1 -0
  230. package/dist/channels/whatsapp/self-echo-cache.d.ts +14 -0
  231. package/dist/channels/whatsapp/self-echo-cache.d.ts.map +1 -0
  232. package/dist/channels/whatsapp/self-echo-cache.js +57 -0
  233. package/dist/channels/whatsapp/self-echo-cache.js.map +1 -0
  234. package/dist/channels/whatsapp/typing.d.ts +12 -0
  235. package/dist/channels/whatsapp/typing.d.ts.map +1 -0
  236. package/dist/channels/whatsapp/typing.js +74 -0
  237. package/dist/channels/whatsapp/typing.js.map +1 -0
  238. package/dist/cli.d.ts.map +1 -1
  239. package/dist/cli.js +1422 -84
  240. package/dist/cli.js.map +1 -1
  241. package/dist/command-registry.d.ts +35 -0
  242. package/dist/command-registry.d.ts.map +1 -0
  243. package/dist/command-registry.js +855 -0
  244. package/dist/command-registry.js.map +1 -0
  245. package/dist/config/cli-flags.d.ts +0 -3
  246. package/dist/config/cli-flags.d.ts.map +1 -1
  247. package/dist/config/cli-flags.js +3 -3
  248. package/dist/config/cli-flags.js.map +1 -1
  249. package/dist/config/config.d.ts +38 -3
  250. package/dist/config/config.d.ts.map +1 -1
  251. package/dist/config/config.js +75 -6
  252. package/dist/config/config.js.map +1 -1
  253. package/dist/config/runtime-config.d.ts +90 -2
  254. package/dist/config/runtime-config.d.ts.map +1 -1
  255. package/dist/config/runtime-config.js +479 -4
  256. package/dist/config/runtime-config.js.map +1 -1
  257. package/dist/gateway/chat-result.d.ts +8 -0
  258. package/dist/gateway/chat-result.d.ts.map +1 -0
  259. package/dist/gateway/chat-result.js +206 -0
  260. package/dist/gateway/chat-result.js.map +1 -0
  261. package/dist/gateway/fullauto.d.ts +104 -0
  262. package/dist/gateway/fullauto.d.ts.map +1 -0
  263. package/dist/gateway/fullauto.js +1181 -0
  264. package/dist/gateway/fullauto.js.map +1 -0
  265. package/dist/gateway/gateway-agent-cards.d.ts +21 -0
  266. package/dist/gateway/gateway-agent-cards.d.ts.map +1 -0
  267. package/dist/gateway/gateway-agent-cards.js +334 -0
  268. package/dist/gateway/gateway-agent-cards.js.map +1 -0
  269. package/dist/gateway/gateway-error-utils.d.ts +3 -0
  270. package/dist/gateway/gateway-error-utils.d.ts.map +1 -0
  271. package/dist/gateway/gateway-error-utils.js +38 -0
  272. package/dist/gateway/gateway-error-utils.js.map +1 -0
  273. package/dist/gateway/gateway-formatting.d.ts +4 -0
  274. package/dist/gateway/gateway-formatting.d.ts.map +1 -0
  275. package/dist/gateway/gateway-formatting.js +30 -0
  276. package/dist/gateway/gateway-formatting.js.map +1 -0
  277. package/dist/gateway/gateway-request-runtime.d.ts +11 -0
  278. package/dist/gateway/gateway-request-runtime.d.ts.map +1 -0
  279. package/dist/gateway/gateway-request-runtime.js +72 -0
  280. package/dist/gateway/gateway-request-runtime.js.map +1 -0
  281. package/dist/gateway/gateway-service.d.ts +91 -7
  282. package/dist/gateway/gateway-service.d.ts.map +1 -1
  283. package/dist/gateway/gateway-service.js +1486 -296
  284. package/dist/gateway/gateway-service.js.map +1 -1
  285. package/dist/gateway/gateway-session-status.d.ts +14 -0
  286. package/dist/gateway/gateway-session-status.d.ts.map +1 -0
  287. package/dist/gateway/gateway-session-status.js +95 -0
  288. package/dist/gateway/gateway-session-status.js.map +1 -0
  289. package/dist/gateway/gateway-time.d.ts +5 -0
  290. package/dist/gateway/gateway-time.d.ts.map +1 -0
  291. package/dist/gateway/gateway-time.js +38 -0
  292. package/dist/gateway/gateway-time.js.map +1 -0
  293. package/dist/gateway/gateway-types.d.ts +304 -2
  294. package/dist/gateway/gateway-types.d.ts.map +1 -1
  295. package/dist/gateway/gateway-types.js.map +1 -1
  296. package/dist/gateway/gateway-utils.d.ts +5 -0
  297. package/dist/gateway/gateway-utils.d.ts.map +1 -0
  298. package/dist/gateway/gateway-utils.js +28 -0
  299. package/dist/gateway/gateway-utils.js.map +1 -0
  300. package/dist/gateway/gateway.js +334 -31
  301. package/dist/gateway/gateway.js.map +1 -1
  302. package/dist/gateway/health.d.ts.map +1 -1
  303. package/dist/gateway/health.js +388 -100
  304. package/dist/gateway/health.js.map +1 -1
  305. package/dist/gateway/proactive-delivery.d.ts +4 -1
  306. package/dist/gateway/proactive-delivery.d.ts.map +1 -1
  307. package/dist/gateway/proactive-delivery.js +24 -1
  308. package/dist/gateway/proactive-delivery.js.map +1 -1
  309. package/dist/gateway/show-mode.d.ts +11 -0
  310. package/dist/gateway/show-mode.d.ts.map +1 -0
  311. package/dist/gateway/show-mode.js +48 -0
  312. package/dist/gateway/show-mode.js.map +1 -0
  313. package/dist/infra/container-runner.d.ts +6 -18
  314. package/dist/infra/container-runner.d.ts.map +1 -1
  315. package/dist/infra/container-runner.js +49 -7
  316. package/dist/infra/container-runner.js.map +1 -1
  317. package/dist/infra/container-setup.d.ts.map +1 -1
  318. package/dist/infra/container-setup.js +1 -19
  319. package/dist/infra/container-setup.js.map +1 -1
  320. package/dist/infra/host-runner.d.ts +6 -33
  321. package/dist/infra/host-runner.d.ts.map +1 -1
  322. package/dist/infra/host-runner.js +47 -6
  323. package/dist/infra/host-runner.js.map +1 -1
  324. package/dist/infra/ipc.d.ts +1 -1
  325. package/dist/infra/ipc.d.ts.map +1 -1
  326. package/dist/infra/ipc.js +24 -2
  327. package/dist/infra/ipc.js.map +1 -1
  328. package/dist/infra/stream-debug.d.ts +1 -0
  329. package/dist/infra/stream-debug.d.ts.map +1 -1
  330. package/dist/infra/stream-debug.js +4 -0
  331. package/dist/infra/stream-debug.js.map +1 -1
  332. package/dist/infra/worker-signature.d.ts +16 -0
  333. package/dist/infra/worker-signature.d.ts.map +1 -1
  334. package/dist/infra/worker-signature.js +32 -2
  335. package/dist/infra/worker-signature.js.map +1 -1
  336. package/dist/logger.d.ts +2 -0
  337. package/dist/logger.d.ts.map +1 -1
  338. package/dist/logger.js +9 -1
  339. package/dist/logger.js.map +1 -1
  340. package/dist/media/audio-transcription-backends.d.ts +28 -0
  341. package/dist/media/audio-transcription-backends.d.ts.map +1 -0
  342. package/dist/media/audio-transcription-backends.js +764 -0
  343. package/dist/media/audio-transcription-backends.js.map +1 -0
  344. package/dist/media/audio-transcription.d.ts +19 -0
  345. package/dist/media/audio-transcription.d.ts.map +1 -0
  346. package/dist/media/audio-transcription.js +140 -0
  347. package/dist/media/audio-transcription.js.map +1 -0
  348. package/dist/media/mime-utils.d.ts +3 -0
  349. package/dist/media/mime-utils.d.ts.map +1 -0
  350. package/dist/media/mime-utils.js +8 -0
  351. package/dist/media/mime-utils.js.map +1 -0
  352. package/dist/media/path-utils.d.ts +2 -0
  353. package/dist/media/path-utils.d.ts.map +1 -0
  354. package/dist/media/path-utils.js +12 -0
  355. package/dist/media/path-utils.js.map +1 -0
  356. package/dist/media/pdf-context.d.ts +1 -0
  357. package/dist/media/pdf-context.d.ts.map +1 -1
  358. package/dist/media/pdf-context.js +12 -2
  359. package/dist/media/pdf-context.js.map +1 -1
  360. package/dist/memory/compaction.d.ts +0 -1
  361. package/dist/memory/compaction.d.ts.map +1 -1
  362. package/dist/memory/compaction.js +1 -1
  363. package/dist/memory/compaction.js.map +1 -1
  364. package/dist/memory/db.d.ts +39 -2
  365. package/dist/memory/db.d.ts.map +1 -1
  366. package/dist/memory/db.js +550 -4
  367. package/dist/memory/db.js.map +1 -1
  368. package/dist/memory/memory-service.d.ts +2 -2
  369. package/dist/memory/memory-service.d.ts.map +1 -1
  370. package/dist/memory/memory-service.js +22 -15
  371. package/dist/memory/memory-service.js.map +1 -1
  372. package/dist/model-selection.d.ts +5 -0
  373. package/dist/model-selection.d.ts.map +1 -1
  374. package/dist/model-selection.js +39 -0
  375. package/dist/model-selection.js.map +1 -1
  376. package/dist/onboarding.d.ts +1 -2
  377. package/dist/onboarding.d.ts.map +1 -1
  378. package/dist/onboarding.js +74 -12
  379. package/dist/onboarding.js.map +1 -1
  380. package/dist/providers/anthropic.d.ts.map +1 -1
  381. package/dist/providers/anthropic.js +0 -5
  382. package/dist/providers/anthropic.js.map +1 -1
  383. package/dist/providers/auxiliary.d.ts +49 -0
  384. package/dist/providers/auxiliary.d.ts.map +1 -0
  385. package/dist/providers/auxiliary.js +562 -0
  386. package/dist/providers/auxiliary.js.map +1 -0
  387. package/dist/providers/factory.d.ts +0 -2
  388. package/dist/providers/factory.d.ts.map +1 -1
  389. package/dist/providers/factory.js +6 -8
  390. package/dist/providers/factory.js.map +1 -1
  391. package/dist/providers/hybridai.d.ts.map +1 -1
  392. package/dist/providers/hybridai.js +3 -6
  393. package/dist/providers/hybridai.js.map +1 -1
  394. package/dist/providers/local-discovery.d.ts +13 -7
  395. package/dist/providers/local-discovery.d.ts.map +1 -1
  396. package/dist/providers/local-discovery.js +148 -128
  397. package/dist/providers/local-discovery.js.map +1 -1
  398. package/dist/providers/local-health.d.ts +0 -1
  399. package/dist/providers/local-health.d.ts.map +1 -1
  400. package/dist/providers/local-health.js +1 -12
  401. package/dist/providers/local-health.js.map +1 -1
  402. package/dist/providers/local-ollama.d.ts.map +1 -1
  403. package/dist/providers/local-ollama.js +3 -5
  404. package/dist/providers/local-ollama.js.map +1 -1
  405. package/dist/providers/local-openai-compat.d.ts.map +1 -1
  406. package/dist/providers/local-openai-compat.js +3 -2
  407. package/dist/providers/local-openai-compat.js.map +1 -1
  408. package/dist/providers/model-catalog.d.ts +6 -1
  409. package/dist/providers/model-catalog.d.ts.map +1 -1
  410. package/dist/providers/model-catalog.js +99 -8
  411. package/dist/providers/model-catalog.js.map +1 -1
  412. package/dist/providers/openai.d.ts.map +1 -1
  413. package/dist/providers/openai.js +3 -6
  414. package/dist/providers/openai.js.map +1 -1
  415. package/dist/providers/openrouter-discovery.d.ts +16 -0
  416. package/dist/providers/openrouter-discovery.d.ts.map +1 -0
  417. package/dist/providers/openrouter-discovery.js +166 -0
  418. package/dist/providers/openrouter-discovery.js.map +1 -0
  419. package/dist/providers/openrouter-utils.d.ts +7 -0
  420. package/dist/providers/openrouter-utils.d.ts.map +1 -0
  421. package/dist/providers/openrouter-utils.js +14 -0
  422. package/dist/providers/openrouter-utils.js.map +1 -0
  423. package/dist/providers/openrouter.d.ts +4 -0
  424. package/dist/providers/openrouter.d.ts.map +1 -0
  425. package/dist/providers/openrouter.js +34 -0
  426. package/dist/providers/openrouter.js.map +1 -0
  427. package/dist/providers/task-routing.d.ts +20 -0
  428. package/dist/providers/task-routing.d.ts.map +1 -0
  429. package/dist/providers/task-routing.js +203 -0
  430. package/dist/providers/task-routing.js.map +1 -0
  431. package/dist/providers/types.d.ts +3 -3
  432. package/dist/providers/types.d.ts.map +1 -1
  433. package/dist/providers/utils.d.ts +3 -0
  434. package/dist/providers/utils.d.ts.map +1 -0
  435. package/dist/providers/utils.js +9 -0
  436. package/dist/providers/utils.js.map +1 -0
  437. package/dist/scheduler/heartbeat.d.ts.map +1 -1
  438. package/dist/scheduler/heartbeat.js +35 -17
  439. package/dist/scheduler/heartbeat.js.map +1 -1
  440. package/dist/scheduler/scheduled-task-runner.d.ts.map +1 -1
  441. package/dist/scheduler/scheduled-task-runner.js +10 -1
  442. package/dist/scheduler/scheduled-task-runner.js.map +1 -1
  443. package/dist/scheduler/scheduler.d.ts +2 -0
  444. package/dist/scheduler/scheduler.d.ts.map +1 -1
  445. package/dist/scheduler/scheduler.js +5 -0
  446. package/dist/scheduler/scheduler.js.map +1 -1
  447. package/dist/security/media-paths.d.ts +19 -0
  448. package/dist/security/media-paths.d.ts.map +1 -0
  449. package/dist/security/media-paths.js +125 -0
  450. package/dist/security/media-paths.js.map +1 -0
  451. package/dist/security/mount-config.d.ts +0 -4
  452. package/dist/security/mount-config.d.ts.map +1 -1
  453. package/dist/security/mount-config.js +1 -1
  454. package/dist/security/mount-config.js.map +1 -1
  455. package/dist/security/redact.d.ts +10 -0
  456. package/dist/security/redact.d.ts.map +1 -0
  457. package/dist/security/redact.js +131 -0
  458. package/dist/security/redact.js.map +1 -0
  459. package/dist/security/runtime-secrets.d.ts +1 -1
  460. package/dist/security/runtime-secrets.d.ts.map +1 -1
  461. package/dist/security/runtime-secrets.js +7 -0
  462. package/dist/security/runtime-secrets.js.map +1 -1
  463. package/dist/session/session-maintenance.d.ts.map +1 -1
  464. package/dist/session/session-maintenance.js +50 -11
  465. package/dist/session/session-maintenance.js.map +1 -1
  466. package/dist/session/token-efficiency.d.ts.map +1 -1
  467. package/dist/session/token-efficiency.js +4 -0
  468. package/dist/session/token-efficiency.js.map +1 -1
  469. package/dist/skills/skills.d.ts +1 -0
  470. package/dist/skills/skills.d.ts.map +1 -1
  471. package/dist/skills/skills.js +9 -1
  472. package/dist/skills/skills.js.map +1 -1
  473. package/dist/tui-fullauto.d.ts +15 -0
  474. package/dist/tui-fullauto.d.ts.map +1 -0
  475. package/dist/tui-fullauto.js +56 -0
  476. package/dist/tui-fullauto.js.map +1 -0
  477. package/dist/tui-proactive.d.ts +3 -0
  478. package/dist/tui-proactive.d.ts.map +1 -0
  479. package/dist/tui-proactive.js +9 -0
  480. package/dist/tui-proactive.js.map +1 -0
  481. package/dist/tui-slash-command.d.ts +10 -0
  482. package/dist/tui-slash-command.d.ts.map +1 -1
  483. package/dist/tui-slash-command.js +25 -1
  484. package/dist/tui-slash-command.js.map +1 -1
  485. package/dist/tui-thinking.d.ts +14 -0
  486. package/dist/tui-thinking.d.ts.map +1 -0
  487. package/dist/tui-thinking.js +140 -0
  488. package/dist/tui-thinking.js.map +1 -0
  489. package/dist/tui.js +603 -168
  490. package/dist/tui.js.map +1 -1
  491. package/dist/types.d.ts +53 -3
  492. package/dist/types.d.ts.map +1 -1
  493. package/dist/types.js +9 -0
  494. package/dist/types.js.map +1 -1
  495. package/dist/utils/sleep.d.ts +2 -0
  496. package/dist/utils/sleep.d.ts.map +1 -0
  497. package/dist/utils/sleep.js +7 -0
  498. package/dist/utils/sleep.js.map +1 -0
  499. package/docs/agents.html +2177 -0
  500. package/docs/chat.html +194 -2
  501. package/docs/development/README.md +2 -0
  502. package/docs/development/runtime.md +34 -6
  503. package/docs/development/voice-tts.md +123 -0
  504. package/docs/index.html +14 -14
  505. package/package.json +23 -5
  506. package/skills/channel-catchup/SKILL.md +140 -0
  507. package/container/dist/model-client.js +0 -41
  508. package/container/dist/model-client.js.map +0 -1
  509. package/container/src/model-client.ts +0 -63
package/AGENTS.md CHANGED
@@ -1,85 +1,298 @@
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.7.1  |  **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.
198
+ - **README tone:** Describe the current state of the product, not changes
199
+ relative to a prior version. Avoid "now", "no longer", "deprecated … for
200
+ now", "recently added". The changelog is the place for transition language.
35
201
 
36
- ## Setup And Commands
202
+ ### Coding Style
37
203
 
38
- Prerequisites:
204
+ - **Language:** TypeScript (strict mode, ES2022 target, NodeNext modules, ESM).
205
+ - **Formatting:** Biome is authoritative. Run `npm run format` before
206
+ committing. The Husky pre-commit hook runs `npx biome check --write --staged`.
207
+ - **Single quotes** for strings (configured in `biome.json`).
208
+ - **No `any`** without strong justification. No `@ts-nocheck`.
209
+ - **File size:** aim for ~500 LOC; split when it improves clarity or
210
+ testability. `src/skills/skills-guard.ts` and `src/skills/skills.ts` are
211
+ current large exceptions — do not grow them further without splitting.
212
+ - **Comments:** brief comments for tricky or non-obvious logic only. Do not add
213
+ comments, docstrings, or type annotations to code you did not change.
214
+ - **Imports:** let Biome organize imports. Do not mix dynamic
215
+ `await import()` and static `import` for the same module in production paths.
216
+ - **Dependencies:** root `package.json` is for gateway/CLI deps. Container-only
217
+ deps go in `container/package.json`. Never add container deps to root.
39
218
 
40
- - Node.js 22 (matches CI)
41
- - npm
42
- - Docker when working on container-mode behavior or image builds
219
+ ### Git Discipline
220
+
221
+ - Treat existing uncommitted changes as user work unless you created them.
222
+ - Conventional Commits preferred: `feat:`, `fix:`, `test:`, `refactor:`,
223
+ `chore:`, `docs:`.
224
+ - Group related changes; avoid bundling unrelated refactors.
225
+ - Never commit real API keys, tokens, credentials, or personal data. Use
226
+ neutral placeholders in tests: `"test-key"`, `"example.com"`, `"user_a"`.
43
227
 
44
- Common commands:
228
+ ---
45
229
 
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
- ```
230
+ ## 7) Change Playbooks
61
231
 
62
- ## Testing Expectations
232
+ ### 7.1 Adding a Skill
63
233
 
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.
234
+ 1. Create `skills/<name>/SKILL.md` with required frontmatter:
235
+ ```yaml
236
+ ---
237
+ name: my-skill
238
+ description: One-line description
239
+ user-invocable: true # optional, enables /<name> invocation
240
+ ---
241
+ ```
242
+ 2. Add markdown instructions and working rules in the body.
243
+ 3. If the skill needs supporting scripts, place them alongside `SKILL.md`.
244
+ 4. Bundled script paths are mirrored into `/workspace/skills/<name>` at runtime.
245
+ 5. Test: `hybridclaw skill list` should show the new skill.
73
246
 
74
- ## Documentation Hierarchy
247
+ Skill resolution order (first match wins):
248
+ 1. `config.skills.extraDirs[]`
249
+ 2. Bundled: `skills/<name>`
250
+ 3. `$CODEX_HOME/skills`
251
+ 4. `~/.codex/skills`, `~/.claude/skills`, `~/.agents/skills`
252
+ 5. Project/workspace: `./.agents/skills`, `./skills`
75
253
 
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.
254
+ ### 7.2 Adding a Provider
255
+
256
+ 1. Create `src/providers/<name>.ts` implementing the provider interface.
257
+ 2. Register in the provider factory (`src/providers/`).
258
+ 3. Add config section in `src/config/` if new credentials or endpoints needed.
259
+ 4. Add tests for factory wiring, error paths, and config parsing.
260
+ 5. Update `docs/` if the provider is user-facing.
261
+
262
+ ### 7.3 Adding an MCP Server
81
263
 
82
- ## Bump Release
264
+ 1. Add the server config to `~/.hybridclaw/config.json` under `mcpServers`:
265
+ ```json
266
+ {
267
+ "mcpServers": {
268
+ "<server-name>": {
269
+ "command": "...",
270
+ "args": ["..."],
271
+ "transport": "stdio"
272
+ }
273
+ }
274
+ }
275
+ ```
276
+ 2. Tools are auto-discovered at startup and merged into the tool namespace.
277
+ 3. Test with `hybridclaw` running in dev mode.
278
+
279
+ ### 7.4 Modifying Approval Policy
280
+
281
+ 1. Edit `.hybridclaw/policy.yaml`.
282
+ 2. Approval tiers: green (silent) → yellow (narrated) → red (explicit approval).
283
+ 3. `pinned_red` patterns are never auto-promoted.
284
+ 4. Test approval flows with integration tests that exercise the boundary.
285
+
286
+ ### 7.5 Modifying Templates
287
+
288
+ 1. Edit the file in `templates/`.
289
+ 2. **Always** update `src/workspace.ts` if you add, remove, or rename a
290
+ template file.
291
+ 3. Run workspace bootstrap tests to verify.
292
+ 4. Remember: templates are seeded into agent workspaces at runtime — changes
293
+ only apply to new sessions or after workspace reset.
294
+
295
+ ### 7.6 Bump Release
83
296
 
84
297
  When the user says "bump release":
85
298
 
@@ -93,8 +306,117 @@ When the user says "bump release":
93
306
  3. Move `CHANGELOG.md` release notes from `Unreleased` to the new version
94
307
  heading (or create one).
95
308
  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`).
309
+ 5. Commit with `chore: release vX.Y.Z`.
97
310
  6. Create an annotated git tag `vX.Y.Z`.
98
311
  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.
312
+ 8. Create or publish a GitHub Release entry for the tag.
313
+
314
+ ---
315
+
316
+ ## 8) Testing Expectations
317
+
318
+ ### What to Run
319
+
320
+ | Change scope | Required checks |
321
+ |---------------------|-------------------------------------------------------------|
322
+ | Docs only | Verify links, commands, examples |
323
+ | `src/` changes | `npm run typecheck`, `npm run lint`, targeted Vitest suites |
324
+ | `container/` changes| `npm --prefix container run lint`, `npm run build`, IPC boundary tests |
325
+ | `skills/` changes | `hybridclaw skill list`, targeted skill tests |
326
+ | Release/packaging | Both `release:check` scripts, verify versioned docs |
327
+ | Security surfaces | Include boundary and failure-mode tests |
328
+
329
+ ### Conventions
330
+
331
+ - Test files: `tests/*.test.ts`, `*.integration.test.ts`, `*.e2e.test.ts`,
332
+ `*.live.test.ts`.
333
+ - Live tests require credentials. Skip them unless your change needs them,
334
+ and state that explicitly in your handoff.
335
+ - If you skip a relevant check, state what you skipped and why.
336
+ - Never hardcode real credentials in tests. Use env vars or test fixtures.
337
+
338
+ ---
339
+
340
+ ## 9) Anti-Patterns (Do Not)
341
+
342
+ - Do not rename or relocate `templates/` files without updating
343
+ `src/workspace.ts`.
344
+ - Do not add container-only deps to root `package.json`.
345
+ - Do not grow `src/skills/skills-guard.ts` or `src/skills/skills.ts` further
346
+ without splitting.
347
+ - Do not use `@ts-nocheck` or disable lint rules without strong justification.
348
+ - Do not silently weaken security policy, approval tiers, or mount allowlists.
349
+ - Do not log secrets, tokens, or sensitive payloads — even at debug level.
350
+ - Do not modify unrelated modules "while here".
351
+ - Do not include personal identity, real phone numbers, or live config values
352
+ in tests, examples, docs, or commits.
353
+ - Do not edit `node_modules/` or vendored files.
354
+ - Do not break prompt caching: do not alter past context, change toolsets, or
355
+ rebuild system prompts mid-conversation.
356
+ - Do not return stale or mocked data for security/audit paths.
357
+
358
+ ---
359
+
360
+ ## 10) Multi-Agent Safety
361
+
362
+ When multiple agents may be working on this repo concurrently:
363
+
364
+ - **Do not** create, apply, or drop `git stash` entries unless explicitly
365
+ requested (including `git pull --rebase --autostash`).
366
+ - **Do not** switch branches or check out a different branch unless explicitly
367
+ requested.
368
+ - **Do not** create, remove, or modify `git worktree` checkouts unless
369
+ explicitly requested.
370
+ - When the user says "commit", scope to **your changes only**. When the user
371
+ says "commit all", commit everything in grouped chunks.
372
+ - When the user says "push", you may `git pull --rebase` to integrate latest
373
+ changes. Never discard other agents' work.
374
+ - When you see unrecognized files, keep going. Focus on your changes and commit
375
+ only those.
376
+ - Focus reports on your edits. End with a brief "other files present" note only
377
+ if relevant.
378
+ - Lint/format churn: if diffs are formatting-only, auto-resolve without asking.
379
+ Only ask when changes are semantic (logic/data/behavior).
380
+
381
+ ---
382
+
383
+ ## 11) Documentation Hierarchy
384
+
385
+ | Document | Audience | Purpose |
386
+ |-----------------------------|---------------------|---------------------------------|
387
+ | `README.md` | End users | Product overview, setup |
388
+ | `AGENTS.md` (this file) | Coding agents | Canonical repo instructions |
389
+ | `CLAUDE.md` | Claude Code | Thin shim → `AGENTS.md` |
390
+ | `CONTRIBUTING.md` | Human contributors | Quickstart, PR workflow |
391
+ | `SECURITY.md` | Security reviewers | Runtime security controls |
392
+ | `TRUST_MODEL.md` | Operators | Trust acceptance policy |
393
+ | `docs/development/` | Maintainers | Architecture, runtime, testing |
394
+ | `templates/*.md` | Product runtime | Agent workspace bootstrap |
395
+
396
+ ---
397
+
398
+ ## 12) Handoff Template
399
+
400
+ When handing off work (agent → agent or agent → maintainer), include:
401
+
402
+ 1. **What changed** — files touched and why.
403
+ 2. **What did not change** — scope boundaries you respected.
404
+ 3. **Validation** — which checks you ran and their results.
405
+ 4. **Skipped checks** — what you did not run and why.
406
+ 5. **Remaining risks / unknowns** — open questions or edge cases.
407
+ 6. **Next recommended action** — what to do next.
408
+
409
+ ---
410
+
411
+ ## 13) Vibe Coding Guardrails
412
+
413
+ When working in fast iterative mode:
414
+
415
+ - Keep each iteration reversible (small commits, clear rollback path).
416
+ - Validate assumptions with code search before implementing.
417
+ - Prefer deterministic behavior over clever shortcuts.
418
+ - Do not "ship and hope" on security-sensitive paths.
419
+ - If uncertain about an internal API, search `src/` for existing usage patterns
420
+ before guessing.
421
+ - If uncertain about architecture, read the type definitions in `src/types.ts`
422
+ and the workspace bootstrap in `src/workspace.ts` before implementing.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,69 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.7.1](https://github.com/HybridAIOne/hybridclaw/tree/v0.7.1)
6
+
7
+ ### Added
8
+
9
+ - **Admin console and agent dashboards**: Added the embedded `/admin` console
10
+ and `/agents` workspace/session dashboards so operators can inspect gateway
11
+ state, sessions, channels, config, models, scheduler tasks, MCP servers,
12
+ audit events, skills, and tools from the browser.
13
+ - **Full-auto session mode**: Added supervised `fullauto` execution with queued
14
+ proactive delivery, persisted startup resume, watchdog recovery, and explicit
15
+ interruption when a human takes over the session.
16
+ - **First-class agents**: Agents now own workspaces independently of the active
17
+ model provider, with `agent` commands exposed through the gateway, TUI, and
18
+ Discord for creating, listing, switching, and inspecting agent bindings.
19
+ - **WhatsApp, email, and cross-channel messaging**: Added WhatsApp channel
20
+ integration, a native email channel, replay/message-store support, auth reset
21
+ tooling, and shared `message` routing so HybridClaw can send and normalize
22
+ delivery across Discord, WhatsApp, email, and local channels.
23
+ - **Shared audio transcription and OpenRouter auth**: Added inbound audio
24
+ transcription fallbacks across local CLIs and provider backends plus
25
+ `hybridclaw auth login|status|logout openrouter` for provider-aware
26
+ authentication and model selection.
27
+
28
+ ### Changed
29
+
30
+ - **Stable workspace identity across model/provider changes**: Session
31
+ workspaces are keyed by agent identity instead of provider-derived agent IDs,
32
+ so switching models or providers keeps the same workspace and memory unless
33
+ the session is explicitly rebound.
34
+ - **Session visibility and status controls**: Added
35
+ `show all|thinking|tools|none` across gateway, TUI, Discord, and web chat,
36
+ while shared status output now includes the current session agent and
37
+ effective model.
38
+ - **Media and prompt routing**: Current-turn attachments and media now flow
39
+ through shared routing for Discord, WhatsApp, email, and local clients,
40
+ including native vision/audio injection paths and stronger preference for
41
+ current-turn local files over history rediscovery.
42
+ - **Auxiliary task/provider routing**: Added Hermes-style auxiliary routing and
43
+ tighter provider fallback handling so deferred or background tasks pick the
44
+ right model more predictably.
45
+ - **Discord activation config cleanup**: Removed the obsolete
46
+ `discord.respondToAllMessages` config path. Guild activation now follows
47
+ `channel mode`, guild policy, and explicit free-response channel settings.
48
+
49
+ ### Fixed
50
+
51
+ - **Approval/runtime guard hardening**: Tightened approval confirmation flows,
52
+ tool runtime guards, and gateway/runtime follow-up handling so blocked or
53
+ long-running turns fail more predictably.
54
+ - **Agent, TUI, and heartbeat stability**: Improved TUI streaming and silent
55
+ reply handling, stabilized agent dashboards and heartbeat activity tracking,
56
+ and preserved visibility on long-running turns.
57
+ - **WhatsApp and email delivery reliability**: Fixed WhatsApp auth-lock races,
58
+ timeout handling, follow-up delivery edge cases, local message-store
59
+ persistence, and email runtime/delivery hardening.
60
+ - **Audio/media path handling**: Hardened audio transcription media-path
61
+ resolution, PDF truncation, and current-turn media handling across gateway
62
+ and container paths.
63
+ - **Discord media cache hardening**: Added SSRF-guarded Discord CDN fetches,
64
+ per-type cache limits, Unicode-aware filename sanitization, explicit
65
+ permissions, and lazy TTL-based cleanup with empty-directory pruning for
66
+ cached inbound media.
67
+
5
68
  ## [0.6.0](https://github.com/HybridAIOne/hybridclaw/tree/v0.6.0)
6
69
 
7
70
  ### Added