@openclaw/tokenjuice 2026.11.7 → 2026.11.10-beta.2

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 (361) hide show
  1. package/README.md +1 -1
  2. package/dist/.source-module-urls/e1cd11006f37307698d3ccaa0b9377541a8f8fcd96acf7a0d93ee391c8c5abfa.json +1 -1
  3. package/dist/index.js +1 -2
  4. package/dist/tool-result-middleware.js +33 -19
  5. package/node_modules/tokenjuice/README.md +71 -272
  6. package/node_modules/tokenjuice/dist/cli/command-types.d.ts +36 -0
  7. package/node_modules/tokenjuice/dist/cli/command-types.js +1 -0
  8. package/node_modules/tokenjuice/dist/cli/doctor-commands.d.ts +2 -0
  9. package/node_modules/tokenjuice/dist/cli/doctor-commands.js +674 -0
  10. package/node_modules/tokenjuice/dist/cli/doctor-output.d.ts +2 -1
  11. package/node_modules/tokenjuice/dist/cli/doctor-output.js +9 -0
  12. package/node_modules/tokenjuice/dist/cli/host-command.d.ts +4 -0
  13. package/node_modules/tokenjuice/dist/cli/host-command.js +19 -0
  14. package/node_modules/tokenjuice/dist/cli/install-commands.d.ts +2 -0
  15. package/node_modules/tokenjuice/dist/cli/install-commands.js +1263 -0
  16. package/node_modules/tokenjuice/dist/cli/main.d.ts +2 -33
  17. package/node_modules/tokenjuice/dist/cli/main.js +255 -5950
  18. package/node_modules/tokenjuice/dist/cli/uninstall-commands.d.ts +2 -0
  19. package/node_modules/tokenjuice/dist/cli/uninstall-commands.js +554 -0
  20. package/node_modules/tokenjuice/dist/core/bounded-jsonl.js +15 -3
  21. package/node_modules/tokenjuice/dist/core/bounded-text-file.d.ts +3 -0
  22. package/node_modules/tokenjuice/dist/core/bounded-text-file.js +32 -0
  23. package/node_modules/tokenjuice/dist/core/classify.d.ts +0 -5
  24. package/node_modules/tokenjuice/dist/core/classify.js +1 -1
  25. package/node_modules/tokenjuice/dist/core/command-identity.d.ts +0 -2
  26. package/node_modules/tokenjuice/dist/core/command-identity.js +2 -2
  27. package/node_modules/tokenjuice/dist/core/command-match.d.ts +0 -3
  28. package/node_modules/tokenjuice/dist/core/command-match.js +88 -8
  29. package/node_modules/tokenjuice/dist/core/command.d.ts +0 -1
  30. package/node_modules/tokenjuice/dist/core/compaction-metadata.d.ts +1 -1
  31. package/node_modules/tokenjuice/dist/core/env.d.ts +1 -0
  32. package/node_modules/tokenjuice/dist/core/env.js +8 -0
  33. package/node_modules/tokenjuice/dist/core/integrations/compact-bash-result.d.ts +7 -3
  34. package/node_modules/tokenjuice/dist/core/integrations/compact-bash-result.js +190 -10
  35. package/node_modules/tokenjuice/dist/core/integrations/compact-copilot-result.d.ts +6 -0
  36. package/node_modules/tokenjuice/dist/core/integrations/compact-copilot-result.js +50 -0
  37. package/node_modules/tokenjuice/dist/core/integrations/compact-deepseek-result.d.ts +7 -0
  38. package/node_modules/tokenjuice/dist/core/integrations/compact-deepseek-result.js +46 -0
  39. package/node_modules/tokenjuice/dist/core/integrations/compact-framework-result.d.ts +11 -0
  40. package/node_modules/tokenjuice/dist/core/integrations/compact-framework-result.js +19 -0
  41. package/node_modules/tokenjuice/dist/core/integrations/compact-opencode-v2-result.d.ts +2 -0
  42. package/node_modules/tokenjuice/dist/core/integrations/compact-opencode-v2-result.js +39 -0
  43. package/node_modules/tokenjuice/dist/core/integrations/compact-qoder-result.d.ts +2 -0
  44. package/node_modules/tokenjuice/dist/core/integrations/compact-qoder-result.js +34 -0
  45. package/node_modules/tokenjuice/dist/core/integrations/openclaw-command.d.ts +2 -0
  46. package/node_modules/tokenjuice/dist/core/integrations/openclaw-command.js +13 -0
  47. package/node_modules/tokenjuice/dist/core/integrations/rewrite-cline-input.d.ts +4 -0
  48. package/node_modules/tokenjuice/dist/core/integrations/rewrite-cline-input.js +18 -0
  49. package/node_modules/tokenjuice/dist/core/inventory-safety.d.ts +0 -1
  50. package/node_modules/tokenjuice/dist/core/inventory-safety.js +1 -1
  51. package/node_modules/tokenjuice/dist/core/record-fields.d.ts +1 -0
  52. package/node_modules/tokenjuice/dist/core/record-fields.js +9 -0
  53. package/node_modules/tokenjuice/dist/core/reduce-inspection-summary.d.ts +2 -1
  54. package/node_modules/tokenjuice/dist/core/reduce-inspection-summary.js +7 -94
  55. package/node_modules/tokenjuice/dist/core/simple-yaml-frontmatter.d.ts +9 -0
  56. package/node_modules/tokenjuice/dist/core/simple-yaml-frontmatter.js +125 -0
  57. package/node_modules/tokenjuice/dist/core/source.d.ts +0 -1
  58. package/node_modules/tokenjuice/dist/core/source.js +14 -4
  59. package/node_modules/tokenjuice/dist/core/structural-markers.d.ts +11 -0
  60. package/node_modules/tokenjuice/dist/core/structural-markers.js +49 -0
  61. package/node_modules/tokenjuice/dist/core/text.d.ts +0 -1
  62. package/node_modules/tokenjuice/dist/core/text.js +0 -3
  63. package/node_modules/tokenjuice/dist/core/toml-structure.d.ts +2 -0
  64. package/node_modules/tokenjuice/dist/core/toml-structure.js +83 -0
  65. package/node_modules/tokenjuice/dist/core/validate-rules.d.ts +2 -2
  66. package/node_modules/tokenjuice/dist/core/wrap.js +1 -1
  67. package/node_modules/tokenjuice/dist/hosts/adal/index.d.ts +5 -17
  68. package/node_modules/tokenjuice/dist/hosts/adal/index.js +15 -125
  69. package/node_modules/tokenjuice/dist/hosts/aether/index.d.ts +2 -7
  70. package/node_modules/tokenjuice/dist/hosts/aether/index.js +17 -155
  71. package/node_modules/tokenjuice/dist/hosts/agent-layer/index.d.ts +2 -9
  72. package/node_modules/tokenjuice/dist/hosts/agent-layer/index.js +10 -64
  73. package/node_modules/tokenjuice/dist/hosts/agentinit/index.d.ts +2 -8
  74. package/node_modules/tokenjuice/dist/hosts/agentinit/index.js +15 -111
  75. package/node_modules/tokenjuice/dist/hosts/agentlink/index.d.ts +2 -8
  76. package/node_modules/tokenjuice/dist/hosts/agentlink/index.js +14 -97
  77. package/node_modules/tokenjuice/dist/hosts/agentloom/index.d.ts +2 -9
  78. package/node_modules/tokenjuice/dist/hosts/agentloom/index.js +11 -52
  79. package/node_modules/tokenjuice/dist/hosts/agents-cli/index.d.ts +2 -8
  80. package/node_modules/tokenjuice/dist/hosts/agents-cli/index.js +10 -41
  81. package/node_modules/tokenjuice/dist/hosts/agents-md/index.d.ts +5 -16
  82. package/node_modules/tokenjuice/dist/hosts/agents-md/index.js +16 -128
  83. package/node_modules/tokenjuice/dist/hosts/agentsge/index.d.ts +2 -9
  84. package/node_modules/tokenjuice/dist/hosts/agentsge/index.js +11 -52
  85. package/node_modules/tokenjuice/dist/hosts/agentsmesh/index.d.ts +2 -8
  86. package/node_modules/tokenjuice/dist/hosts/agentsmesh/index.js +10 -53
  87. package/node_modules/tokenjuice/dist/hosts/ai-memory-protocol/index.d.ts +2 -8
  88. package/node_modules/tokenjuice/dist/hosts/ai-memory-protocol/index.js +13 -42
  89. package/node_modules/tokenjuice/dist/hosts/aictl/index.d.ts +5 -16
  90. package/node_modules/tokenjuice/dist/hosts/aictl/index.js +17 -128
  91. package/node_modules/tokenjuice/dist/hosts/aider/index.d.ts +2 -9
  92. package/node_modules/tokenjuice/dist/hosts/aider/index.js +6 -18
  93. package/node_modules/tokenjuice/dist/hosts/amazon-q/index.d.ts +2 -9
  94. package/node_modules/tokenjuice/dist/hosts/amazon-q/index.js +31 -105
  95. package/node_modules/tokenjuice/dist/hosts/amp/index.d.ts +2 -9
  96. package/node_modules/tokenjuice/dist/hosts/amp/index.js +11 -72
  97. package/node_modules/tokenjuice/dist/hosts/ante/index.d.ts +11 -0
  98. package/node_modules/tokenjuice/dist/hosts/ante/index.js +76 -0
  99. package/node_modules/tokenjuice/dist/hosts/antigravity/index.d.ts +2 -9
  100. package/node_modules/tokenjuice/dist/hosts/antigravity/index.js +29 -117
  101. package/node_modules/tokenjuice/dist/hosts/anywhere-agents/index.d.ts +2 -8
  102. package/node_modules/tokenjuice/dist/hosts/anywhere-agents/index.js +14 -97
  103. package/node_modules/tokenjuice/dist/hosts/augment/index.d.ts +2 -9
  104. package/node_modules/tokenjuice/dist/hosts/augment/index.js +29 -117
  105. package/node_modules/tokenjuice/dist/hosts/avante/index.d.ts +5 -17
  106. package/node_modules/tokenjuice/dist/hosts/avante/index.js +5 -27
  107. package/node_modules/tokenjuice/dist/hosts/baz/index.d.ts +2 -8
  108. package/node_modules/tokenjuice/dist/hosts/baz/index.js +17 -132
  109. package/node_modules/tokenjuice/dist/hosts/bito/index.d.ts +2 -8
  110. package/node_modules/tokenjuice/dist/hosts/bito/index.js +11 -108
  111. package/node_modules/tokenjuice/dist/hosts/blackbox/index.d.ts +2 -8
  112. package/node_modules/tokenjuice/dist/hosts/blackbox/index.js +16 -157
  113. package/node_modules/tokenjuice/dist/hosts/blocks/index.d.ts +2 -8
  114. package/node_modules/tokenjuice/dist/hosts/blocks/index.js +16 -157
  115. package/node_modules/tokenjuice/dist/hosts/bob/index.d.ts +5 -17
  116. package/node_modules/tokenjuice/dist/hosts/bob/index.js +13 -123
  117. package/node_modules/tokenjuice/dist/hosts/builder/index.d.ts +2 -9
  118. package/node_modules/tokenjuice/dist/hosts/builder/index.js +34 -131
  119. package/node_modules/tokenjuice/dist/hosts/charlie/index.d.ts +5 -16
  120. package/node_modules/tokenjuice/dist/hosts/charlie/index.js +16 -140
  121. package/node_modules/tokenjuice/dist/hosts/claude-code/index.js +12 -49
  122. package/node_modules/tokenjuice/dist/hosts/clawdbot/index.d.ts +2 -8
  123. package/node_modules/tokenjuice/dist/hosts/clawdbot/index.js +48 -235
  124. package/node_modules/tokenjuice/dist/hosts/cline/index.d.ts +6 -13
  125. package/node_modules/tokenjuice/dist/hosts/cline/index.js +134 -135
  126. package/node_modules/tokenjuice/dist/hosts/codeant/index.d.ts +5 -16
  127. package/node_modules/tokenjuice/dist/hosts/codeant/index.js +12 -123
  128. package/node_modules/tokenjuice/dist/hosts/codebuddy/index.js +14 -58
  129. package/node_modules/tokenjuice/dist/hosts/codebuff/index.d.ts +5 -17
  130. package/node_modules/tokenjuice/dist/hosts/codebuff/index.js +13 -123
  131. package/node_modules/tokenjuice/dist/hosts/codegen/index.d.ts +5 -17
  132. package/node_modules/tokenjuice/dist/hosts/codegen/index.js +13 -123
  133. package/node_modules/tokenjuice/dist/hosts/coder-agents/index.d.ts +2 -8
  134. package/node_modules/tokenjuice/dist/hosts/coder-agents/index.js +25 -193
  135. package/node_modules/tokenjuice/dist/hosts/coderabbit/index.d.ts +2 -8
  136. package/node_modules/tokenjuice/dist/hosts/coderabbit/index.js +16 -173
  137. package/node_modules/tokenjuice/dist/hosts/codex/index.d.ts +3 -4
  138. package/node_modules/tokenjuice/dist/hosts/codex/index.js +26 -58
  139. package/node_modules/tokenjuice/dist/hosts/command-code/index.d.ts +6 -13
  140. package/node_modules/tokenjuice/dist/hosts/command-code/index.js +87 -331
  141. package/node_modules/tokenjuice/dist/hosts/continue/index.d.ts +2 -9
  142. package/node_modules/tokenjuice/dist/hosts/continue/index.js +6 -18
  143. package/node_modules/tokenjuice/dist/hosts/copilot-agent/index.d.ts +2 -11
  144. package/node_modules/tokenjuice/dist/hosts/copilot-agent/index.js +15 -166
  145. package/node_modules/tokenjuice/dist/hosts/copilot-cli/index.d.ts +2 -11
  146. package/node_modules/tokenjuice/dist/hosts/copilot-cli/index.js +24 -196
  147. package/node_modules/tokenjuice/dist/hosts/copilot-sdk/index.d.ts +12 -0
  148. package/node_modules/tokenjuice/dist/hosts/copilot-sdk/index.js +15 -0
  149. package/node_modules/tokenjuice/dist/hosts/crush/index.d.ts +2 -9
  150. package/node_modules/tokenjuice/dist/hosts/crush/index.js +6 -18
  151. package/node_modules/tokenjuice/dist/hosts/cursor/index.js +7 -8
  152. package/node_modules/tokenjuice/dist/hosts/deepagents/index.d.ts +5 -17
  153. package/node_modules/tokenjuice/dist/hosts/deepagents/index.js +15 -125
  154. package/node_modules/tokenjuice/dist/hosts/deepseek-harness/bundle/cordis.patch.yml +3 -0
  155. package/node_modules/tokenjuice/dist/hosts/deepseek-harness/bundle/index.js +9656 -0
  156. package/node_modules/tokenjuice/dist/hosts/deepseek-harness/bundle/package.json +18 -0
  157. package/node_modules/tokenjuice/dist/hosts/deepseek-harness/runtime.d.ts +7 -0
  158. package/node_modules/tokenjuice/dist/hosts/deepseek-harness/runtime.js +23 -0
  159. package/node_modules/tokenjuice/dist/hosts/devin/index.d.ts +2 -11
  160. package/node_modules/tokenjuice/dist/hosts/devin/index.js +7 -9
  161. package/node_modules/tokenjuice/dist/hosts/docker-agent/index.d.ts +2 -7
  162. package/node_modules/tokenjuice/dist/hosts/docker-agent/index.js +19 -99
  163. package/node_modules/tokenjuice/dist/hosts/dot-agents/index.d.ts +2 -8
  164. package/node_modules/tokenjuice/dist/hosts/dot-agents/index.js +12 -41
  165. package/node_modules/tokenjuice/dist/hosts/droid/index.d.ts +5 -12
  166. package/node_modules/tokenjuice/dist/hosts/droid/index.js +106 -211
  167. package/node_modules/tokenjuice/dist/hosts/eca/index.d.ts +2 -8
  168. package/node_modules/tokenjuice/dist/hosts/eca/index.js +26 -190
  169. package/node_modules/tokenjuice/dist/hosts/elyra/index.d.ts +2 -8
  170. package/node_modules/tokenjuice/dist/hosts/elyra/index.js +26 -190
  171. package/node_modules/tokenjuice/dist/hosts/firebase-studio/index.d.ts +2 -9
  172. package/node_modules/tokenjuice/dist/hosts/firebase-studio/index.js +16 -123
  173. package/node_modules/tokenjuice/dist/hosts/forgecode/index.d.ts +5 -16
  174. package/node_modules/tokenjuice/dist/hosts/forgecode/index.js +20 -161
  175. package/node_modules/tokenjuice/dist/hosts/gemini-cli/index.d.ts +5 -12
  176. package/node_modules/tokenjuice/dist/hosts/gemini-cli/index.js +87 -94
  177. package/node_modules/tokenjuice/dist/hosts/gitlab-duo/index.d.ts +2 -9
  178. package/node_modules/tokenjuice/dist/hosts/gitlab-duo/index.js +17 -123
  179. package/node_modules/tokenjuice/dist/hosts/goose/index.d.ts +2 -9
  180. package/node_modules/tokenjuice/dist/hosts/goose/index.js +34 -77
  181. package/node_modules/tokenjuice/dist/hosts/gptme/index.d.ts +5 -17
  182. package/node_modules/tokenjuice/dist/hosts/gptme/index.js +13 -123
  183. package/node_modules/tokenjuice/dist/hosts/greptile/index.d.ts +2 -8
  184. package/node_modules/tokenjuice/dist/hosts/greptile/index.js +18 -156
  185. package/node_modules/tokenjuice/dist/hosts/grok-bot/index.d.ts +2 -8
  186. package/node_modules/tokenjuice/dist/hosts/grok-bot/index.js +14 -110
  187. package/node_modules/tokenjuice/dist/hosts/grok-build/index.d.ts +5 -17
  188. package/node_modules/tokenjuice/dist/hosts/grok-build/index.js +13 -113
  189. package/node_modules/tokenjuice/dist/hosts/grok-cli/index.d.ts +7 -14
  190. package/node_modules/tokenjuice/dist/hosts/grok-cli/index.js +32 -188
  191. package/node_modules/tokenjuice/dist/hosts/hermes/bundle/__init__.py +1 -0
  192. package/node_modules/tokenjuice/dist/hosts/hermes/bundle/plugin.yaml +7 -0
  193. package/node_modules/tokenjuice/dist/hosts/hermes/bundle/tokenjuice_integrations/README.md +29 -0
  194. package/node_modules/tokenjuice/dist/hosts/hermes/bundle/tokenjuice_integrations/__init__.py +3 -0
  195. package/node_modules/tokenjuice/dist/hosts/hermes/bundle/tokenjuice_integrations/bridge.py +39 -0
  196. package/node_modules/tokenjuice/dist/hosts/hermes/bundle/tokenjuice_integrations/fastmcp.py +24 -0
  197. package/node_modules/tokenjuice/dist/hosts/hermes/bundle/tokenjuice_integrations/hermes.py +13 -0
  198. package/node_modules/tokenjuice/dist/hosts/hermes/bundle/tokenjuice_integrations/langchain.py +38 -0
  199. package/node_modules/tokenjuice/dist/hosts/hermes/bundle/tokenjuice_integrations/plugin.yaml +7 -0
  200. package/node_modules/tokenjuice/dist/hosts/jean2/index.d.ts +5 -17
  201. package/node_modules/tokenjuice/dist/hosts/jean2/index.js +13 -123
  202. package/node_modules/tokenjuice/dist/hosts/jetbrains-ai/index.d.ts +2 -9
  203. package/node_modules/tokenjuice/dist/hosts/jetbrains-ai/index.js +33 -133
  204. package/node_modules/tokenjuice/dist/hosts/jules/index.d.ts +5 -17
  205. package/node_modules/tokenjuice/dist/hosts/jules/index.js +13 -123
  206. package/node_modules/tokenjuice/dist/hosts/junie/index.d.ts +5 -17
  207. package/node_modules/tokenjuice/dist/hosts/junie/index.js +5 -27
  208. package/node_modules/tokenjuice/dist/hosts/kilo/index.d.ts +2 -8
  209. package/node_modules/tokenjuice/dist/hosts/kilo/index.js +6 -18
  210. package/node_modules/tokenjuice/dist/hosts/kimi/index.d.ts +7 -13
  211. package/node_modules/tokenjuice/dist/hosts/kimi/index.js +38 -156
  212. package/node_modules/tokenjuice/dist/hosts/kiro/index.d.ts +2 -9
  213. package/node_modules/tokenjuice/dist/hosts/kiro/index.js +6 -18
  214. package/node_modules/tokenjuice/dist/hosts/knowns/index.d.ts +5 -16
  215. package/node_modules/tokenjuice/dist/hosts/knowns/index.js +35 -203
  216. package/node_modules/tokenjuice/dist/hosts/leanctl/index.d.ts +5 -16
  217. package/node_modules/tokenjuice/dist/hosts/leanctl/index.js +15 -156
  218. package/node_modules/tokenjuice/dist/hosts/localcode/index.d.ts +2 -7
  219. package/node_modules/tokenjuice/dist/hosts/localcode/index.js +10 -68
  220. package/node_modules/tokenjuice/dist/hosts/mastra/index.d.ts +28 -0
  221. package/node_modules/tokenjuice/dist/hosts/mastra/index.js +26 -0
  222. package/node_modules/tokenjuice/dist/hosts/mcp-agent/index.d.ts +2 -7
  223. package/node_modules/tokenjuice/dist/hosts/mcp-agent/index.js +15 -109
  224. package/node_modules/tokenjuice/dist/hosts/mini-swe-agent/index.d.ts +2 -7
  225. package/node_modules/tokenjuice/dist/hosts/mini-swe-agent/index.js +21 -110
  226. package/node_modules/tokenjuice/dist/hosts/mistral-vibe/index.d.ts +5 -17
  227. package/node_modules/tokenjuice/dist/hosts/mistral-vibe/index.js +13 -123
  228. package/node_modules/tokenjuice/dist/hosts/mux/index.d.ts +6 -13
  229. package/node_modules/tokenjuice/dist/hosts/mux/index.js +54 -349
  230. package/node_modules/tokenjuice/dist/hosts/novakit/index.d.ts +5 -16
  231. package/node_modules/tokenjuice/dist/hosts/novakit/index.js +35 -203
  232. package/node_modules/tokenjuice/dist/hosts/ona/index.d.ts +2 -8
  233. package/node_modules/tokenjuice/dist/hosts/ona/index.js +19 -283
  234. package/node_modules/tokenjuice/dist/hosts/open-interpreter/index.d.ts +2 -9
  235. package/node_modules/tokenjuice/dist/hosts/open-interpreter/index.js +11 -66
  236. package/node_modules/tokenjuice/dist/hosts/openclaw/extension.js +6 -5
  237. package/node_modules/tokenjuice/dist/hosts/opencode/extension/runtime.js +540 -363
  238. package/node_modules/tokenjuice/dist/hosts/opencode/index.js +8 -54
  239. package/node_modules/tokenjuice/dist/hosts/opencode/v2/bundle/index.js +9648 -0
  240. package/node_modules/tokenjuice/dist/hosts/opencode/v2/index.d.ts +37 -0
  241. package/node_modules/tokenjuice/dist/hosts/opencode/v2/index.js +97 -0
  242. package/node_modules/tokenjuice/dist/hosts/opencode/v2/runtime.d.ts +13 -0
  243. package/node_modules/tokenjuice/dist/hosts/opencode/v2/runtime.js +23 -0
  244. package/node_modules/tokenjuice/dist/hosts/openhands/index.d.ts +7 -14
  245. package/node_modules/tokenjuice/dist/hosts/openhands/index.js +111 -186
  246. package/node_modules/tokenjuice/dist/hosts/openwebui/index.d.ts +2 -7
  247. package/node_modules/tokenjuice/dist/hosts/openwebui/index.js +2 -24
  248. package/node_modules/tokenjuice/dist/hosts/pi/extension/pi-types.d.ts +3 -2
  249. package/node_modules/tokenjuice/dist/hosts/pi/extension/runtime.d.ts +2 -1
  250. package/node_modules/tokenjuice/dist/hosts/pi/extension/runtime.js +545 -359
  251. package/node_modules/tokenjuice/dist/hosts/pi/extension/status-panel.d.ts +1 -1
  252. package/node_modules/tokenjuice/dist/hosts/pi/extension/status.d.ts +1 -1
  253. package/node_modules/tokenjuice/dist/hosts/pi/extension/tool-result.d.ts +1 -1
  254. package/node_modules/tokenjuice/dist/hosts/pi/index.d.ts +1 -0
  255. package/node_modules/tokenjuice/dist/hosts/pi/index.js +5 -53
  256. package/node_modules/tokenjuice/dist/hosts/pi-go/index.d.ts +2 -8
  257. package/node_modules/tokenjuice/dist/hosts/pi-go/index.js +26 -190
  258. package/node_modules/tokenjuice/dist/hosts/plandex/index.d.ts +2 -9
  259. package/node_modules/tokenjuice/dist/hosts/plandex/index.js +10 -41
  260. package/node_modules/tokenjuice/dist/hosts/qoder/hook-install.d.ts +22 -0
  261. package/node_modules/tokenjuice/dist/hosts/qoder/hook-install.js +105 -0
  262. package/node_modules/tokenjuice/dist/hosts/qoder/hook.d.ts +1 -0
  263. package/node_modules/tokenjuice/dist/hosts/qoder/hook.js +22 -0
  264. package/node_modules/tokenjuice/dist/hosts/qoder/index.d.ts +5 -17
  265. package/node_modules/tokenjuice/dist/hosts/qoder/index.js +13 -113
  266. package/node_modules/tokenjuice/dist/hosts/qoderwork/index.d.ts +36 -0
  267. package/node_modules/tokenjuice/dist/hosts/qoderwork/index.js +20 -0
  268. package/node_modules/tokenjuice/dist/hosts/qodo/index.d.ts +2 -8
  269. package/node_modules/tokenjuice/dist/hosts/qodo/index.js +20 -290
  270. package/node_modules/tokenjuice/dist/hosts/qwen-code/index.d.ts +6 -13
  271. package/node_modules/tokenjuice/dist/hosts/qwen-code/index.js +60 -165
  272. package/node_modules/tokenjuice/dist/hosts/qwenwork/index.d.ts +36 -0
  273. package/node_modules/tokenjuice/dist/hosts/qwenwork/index.js +20 -0
  274. package/node_modules/tokenjuice/dist/hosts/replit/index.d.ts +5 -17
  275. package/node_modules/tokenjuice/dist/hosts/replit/index.js +13 -123
  276. package/node_modules/tokenjuice/dist/hosts/roo/index.d.ts +5 -17
  277. package/node_modules/tokenjuice/dist/hosts/roo/index.js +5 -31
  278. package/node_modules/tokenjuice/dist/hosts/rovo/index.d.ts +5 -17
  279. package/node_modules/tokenjuice/dist/hosts/rovo/index.js +13 -123
  280. package/node_modules/tokenjuice/dist/hosts/ruler/index.d.ts +2 -9
  281. package/node_modules/tokenjuice/dist/hosts/ruler/index.js +10 -64
  282. package/node_modules/tokenjuice/dist/hosts/shared/bundle-runtime.d.ts +2 -0
  283. package/node_modules/tokenjuice/dist/hosts/shared/bundle-runtime.js +56 -0
  284. package/node_modules/tokenjuice/dist/hosts/shared/hook-command-doctor.d.ts +3 -8
  285. package/node_modules/tokenjuice/dist/hosts/shared/hook-command-doctor.js +3 -3
  286. package/node_modules/tokenjuice/dist/hosts/shared/hook-doctor.d.ts +112 -101
  287. package/node_modules/tokenjuice/dist/hosts/shared/hook-doctor.js +10 -0
  288. package/node_modules/tokenjuice/dist/hosts/shared/hook-output.d.ts +0 -1
  289. package/node_modules/tokenjuice/dist/hosts/shared/hook-output.js +1 -1
  290. package/node_modules/tokenjuice/dist/hosts/shared/hooks-json-file.d.ts +15 -0
  291. package/node_modules/tokenjuice/dist/hosts/shared/hooks-json-file.js +93 -0
  292. package/node_modules/tokenjuice/dist/hosts/shared/host-command.d.ts +1 -1
  293. package/node_modules/tokenjuice/dist/hosts/shared/host-command.js +4 -4
  294. package/node_modules/tokenjuice/dist/hosts/shared/instruction-doctor.d.ts +4 -0
  295. package/node_modules/tokenjuice/dist/hosts/shared/instruction-file.d.ts +26 -6
  296. package/node_modules/tokenjuice/dist/hosts/shared/instruction-file.js +125 -5
  297. package/node_modules/tokenjuice/dist/hosts/shared/instruction-guidance.d.ts +7 -0
  298. package/node_modules/tokenjuice/dist/hosts/shared/instruction-guidance.js +24 -0
  299. package/node_modules/tokenjuice/dist/hosts/shared/managed-skill.d.ts +42 -0
  300. package/node_modules/tokenjuice/dist/hosts/shared/managed-skill.js +87 -0
  301. package/node_modules/tokenjuice/dist/hosts/shared/marker-instruction-doctor.d.ts +29 -0
  302. package/node_modules/tokenjuice/dist/hosts/shared/marker-instruction-doctor.js +72 -0
  303. package/node_modules/tokenjuice/dist/hosts/shared/marker-instructions.d.ts +12 -0
  304. package/node_modules/tokenjuice/dist/hosts/shared/marker-instructions.js +43 -0
  305. package/node_modules/tokenjuice/dist/hosts/shared/owned-instruction-doctor.d.ts +9 -0
  306. package/node_modules/tokenjuice/dist/hosts/shared/owned-instruction-doctor.js +17 -0
  307. package/node_modules/tokenjuice/dist/hosts/shared/path-ancestors.d.ts +14 -0
  308. package/node_modules/tokenjuice/dist/hosts/shared/path-ancestors.js +117 -0
  309. package/node_modules/tokenjuice/dist/hosts/shared/pre-tool-wrap.d.ts +7 -7
  310. package/node_modules/tokenjuice/dist/hosts/shared/pre-tool-wrap.js +13 -48
  311. package/node_modules/tokenjuice/dist/hosts/shared/private-config-file.d.ts +2 -0
  312. package/node_modules/tokenjuice/dist/hosts/shared/private-config-file.js +36 -0
  313. package/node_modules/tokenjuice/dist/hosts/shared/project-root.d.ts +5 -0
  314. package/node_modules/tokenjuice/dist/hosts/shared/project-root.js +33 -0
  315. package/node_modules/tokenjuice/dist/hosts/shared/project-skill-doctor.d.ts +14 -0
  316. package/node_modules/tokenjuice/dist/hosts/shared/project-skill-doctor.js +62 -0
  317. package/node_modules/tokenjuice/dist/hosts/shared/restorable-rule.d.ts +15 -0
  318. package/node_modules/tokenjuice/dist/hosts/shared/restorable-rule.js +64 -0
  319. package/node_modules/tokenjuice/dist/hosts/shared/restorable-skill.d.ts +15 -0
  320. package/node_modules/tokenjuice/dist/hosts/shared/restorable-skill.js +48 -0
  321. package/node_modules/tokenjuice/dist/hosts/shared/settings-file.d.ts +5 -1
  322. package/node_modules/tokenjuice/dist/hosts/shared/settings-file.js +33 -5
  323. package/node_modules/tokenjuice/dist/hosts/shared/skill-frontmatter.d.ts +5 -0
  324. package/node_modules/tokenjuice/dist/hosts/shared/skill-frontmatter.js +18 -0
  325. package/node_modules/tokenjuice/dist/hosts/stagewise/index.d.ts +2 -8
  326. package/node_modules/tokenjuice/dist/hosts/stagewise/index.js +50 -377
  327. package/node_modules/tokenjuice/dist/hosts/swe-agent/index.d.ts +2 -7
  328. package/node_modules/tokenjuice/dist/hosts/swe-agent/index.js +20 -88
  329. package/node_modules/tokenjuice/dist/hosts/tabby/index.d.ts +2 -8
  330. package/node_modules/tokenjuice/dist/hosts/tabby/index.js +13 -190
  331. package/node_modules/tokenjuice/dist/hosts/tabnine/index.d.ts +5 -17
  332. package/node_modules/tokenjuice/dist/hosts/tabnine/index.js +13 -123
  333. package/node_modules/tokenjuice/dist/hosts/trae/index.d.ts +2 -9
  334. package/node_modules/tokenjuice/dist/hosts/trae/index.js +17 -123
  335. package/node_modules/tokenjuice/dist/hosts/uipath/index.d.ts +5 -17
  336. package/node_modules/tokenjuice/dist/hosts/uipath/index.js +13 -123
  337. package/node_modules/tokenjuice/dist/hosts/vscode-copilot/index.d.ts +2 -11
  338. package/node_modules/tokenjuice/dist/hosts/vscode-copilot/index.js +15 -101
  339. package/node_modules/tokenjuice/dist/hosts/warp/index.d.ts +5 -17
  340. package/node_modules/tokenjuice/dist/hosts/warp/index.js +14 -116
  341. package/node_modules/tokenjuice/dist/hosts/windsurf/index.d.ts +2 -9
  342. package/node_modules/tokenjuice/dist/hosts/windsurf/index.js +6 -18
  343. package/node_modules/tokenjuice/dist/hosts/zed/index.d.ts +5 -17
  344. package/node_modules/tokenjuice/dist/hosts/zed/index.js +5 -27
  345. package/node_modules/tokenjuice/dist/hosts/zencoder/index.d.ts +2 -9
  346. package/node_modules/tokenjuice/dist/hosts/zencoder/index.js +42 -139
  347. package/node_modules/tokenjuice/dist/index.d.ts +20 -4
  348. package/node_modules/tokenjuice/dist/index.js +14 -4
  349. package/node_modules/tokenjuice/dist/python/LICENSE +21 -0
  350. package/node_modules/tokenjuice/dist/python/README.md +38 -0
  351. package/node_modules/tokenjuice/dist/python/pyproject.toml +30 -0
  352. package/node_modules/tokenjuice/dist/python/tokenjuice_integrations/README.md +29 -0
  353. package/node_modules/tokenjuice/dist/python/tokenjuice_integrations/__init__.py +3 -0
  354. package/node_modules/tokenjuice/dist/python/tokenjuice_integrations/bridge.py +39 -0
  355. package/node_modules/tokenjuice/dist/python/tokenjuice_integrations/fastmcp.py +24 -0
  356. package/node_modules/tokenjuice/dist/python/tokenjuice_integrations/hermes.py +13 -0
  357. package/node_modules/tokenjuice/dist/python/tokenjuice_integrations/langchain.py +38 -0
  358. package/node_modules/tokenjuice/dist/python/tokenjuice_integrations/plugin.yaml +7 -0
  359. package/node_modules/tokenjuice/dist/types.d.ts +9 -8
  360. package/node_modules/tokenjuice/package.json +32 -11
  361. package/package.json +5 -5
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Official Tokenjuice output compaction plugin for OpenClaw.
4
4
 
5
- Tokenjuice compacts noisy `exec` and `bash` tool results after commands run, before the result is fed back into the active agent session. It does not rewrite commands, rerun commands, or change exit codes.
5
+ Tokenjuice compacts noisy OpenClaw `exec` and `bash` tool results in embedded runs and OpenClaw dynamic tools in the Codex app-server harness. Native codex-rs shell results returned to the model stay unchanged. It does not rewrite commands, rerun commands, or change exit codes.
6
6
 
7
7
  ## Install
8
8
 
@@ -1 +1 @@
1
- {"version":3,"entries":[{"output":"index.js","source":"extensions/tokenjuice/index.ts"},{"output":"runtime-api.js","source":"extensions/tokenjuice/runtime-api.ts"},{"output":"tool-result-middleware.js","source":"extensions/tokenjuice/tool-result-middleware.ts"}],"chunks":[{"output":"index.js","sha256":"f323eab7170069654d03b69985b007393d8307c0c1fac5336104851563dfefcd","facadeSource":"extensions/tokenjuice/index.ts","sources":["extensions/tokenjuice/index.ts"]},{"output":"runtime-api.js","sha256":"ed2b93f5080d21d766b3325f7ed6fb86f488449a4185605d59d8a37100bbcd2c","facadeSource":"extensions/tokenjuice/runtime-api.ts","sources":[]},{"output":"tool-result-middleware.js","sha256":"6ed5662fa6bd4189f306fe64964f7484d4d90d6748e796fd66092a9954bdf6e3","facadeSource":"extensions/tokenjuice/tool-result-middleware.ts","sources":["extensions/tokenjuice/tool-result-middleware.ts"]}],"unrenderedSources":["extensions/tokenjuice/runtime-api.ts"]}
1
+ {"version":3,"entries":[{"output":"index.js","source":"extensions/tokenjuice/index.ts"},{"output":"runtime-api.js","source":"extensions/tokenjuice/runtime-api.ts"},{"output":"tool-result-middleware.js","source":"extensions/tokenjuice/tool-result-middleware.ts"}],"chunks":[{"output":"index.js","sha256":"e37aca8e7a9ad7547e92b6e91e649f80e4066e42a57d8ba4cf99d0f45d778ab4","facadeSource":"extensions/tokenjuice/index.ts","sources":["extensions/tokenjuice/index.ts"]},{"output":"runtime-api.js","sha256":"ed2b93f5080d21d766b3325f7ed6fb86f488449a4185605d59d8a37100bbcd2c","facadeSource":"extensions/tokenjuice/runtime-api.ts","sources":[]},{"output":"tool-result-middleware.js","sha256":"42d9fc0a8d04bcc3ad214df1fd8a6b62d8b2e2c5b75e3e9deabd8bec9adcb793","facadeSource":"extensions/tokenjuice/tool-result-middleware.ts","sources":["extensions/tokenjuice/tool-result-middleware.ts"]}],"unrenderedSources":["extensions/tokenjuice/runtime-api.ts"]}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createTokenjuiceAgentToolResultMiddleware } from "./tool-result-middleware.js";
2
2
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
3
- //#region extensions/tokenjuice/index.ts
3
+ // extensions/tokenjuice/index.ts
4
4
  var tokenjuice_default = definePluginEntry({
5
5
  id: "tokenjuice",
6
6
  name: "tokenjuice",
@@ -9,5 +9,4 @@ var tokenjuice_default = definePluginEntry({
9
9
  api.registerAgentToolResultMiddleware(createTokenjuiceAgentToolResultMiddleware());
10
10
  }
11
11
  });
12
- //#endregion
13
12
  export { tokenjuice_default as default };
@@ -1,7 +1,8 @@
1
1
  import { createTokenjuiceOpenClawEmbeddedExtension } from "./runtime-api.js";
2
2
  import process from "node:process";
3
3
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
- //#region extensions/tokenjuice/tool-result-middleware.ts
4
+ // extensions/tokenjuice/tool-result-middleware.ts
5
+ const retainedRuleScopes = /* @__PURE__ */ new Set();
5
6
  function normalizeDetails(event, current) {
6
7
  if (event.toolName !== "exec" && event.toolName !== "bash" || typeof event.args.command !== "string" || !event.args.command) return current.details;
7
8
  const metadata = isRecord(current.details) ? { ...current.details } : {};
@@ -10,11 +11,9 @@ function normalizeDetails(event, current) {
10
11
  const rawExitCode = metadata.exitCode;
11
12
  const failed = event.isError === true || metadata.ok === false || metadata.success === false || metadata.timedOut === true || Boolean(metadata.error) || typeof rawExitCode === "number" && Number.isFinite(rawExitCode) && rawExitCode !== 0;
12
13
  const exitCode = typeof rawExitCode === "number" && Number.isFinite(rawExitCode) ? rawExitCode : failed ? 1 : 0;
13
- return {
14
- ...metadata,
15
- status: failed ? "failed" : "completed",
16
- exitCode
17
- };
14
+ metadata.status = failed ? "failed" : "completed";
15
+ metadata.exitCode = exitCode;
16
+ return metadata;
18
17
  }
19
18
  function createTokenjuiceAgentToolResultMiddleware() {
20
19
  let handler;
@@ -24,19 +23,34 @@ function createTokenjuiceAgentToolResultMiddleware() {
24
23
  return async (event) => {
25
24
  const current = event.result;
26
25
  const workdir = event.args.workdir;
27
- const cwd = event.cwd?.trim() ? event.cwd : typeof workdir === "string" && workdir.trim() ? workdir : process.cwd();
28
- const next = await handler?.({
29
- toolName: event.toolName,
30
- input: event.args,
31
- content: current.content,
32
- details: normalizeDetails(event, current),
33
- isError: event.isError
34
- }, { cwd });
35
- return next ? { result: Object.assign({}, current, {
36
- content: next.content ?? current.content,
37
- details: next.details ?? current.details
38
- }) } : void 0;
26
+ const details = normalizeDetails(event, current);
27
+ const detailsCwd = isRecord(details) ? details.cwd : void 0;
28
+ const cwd = typeof workdir === "string" && workdir.trim() ? workdir : typeof detailsCwd === "string" && detailsCwd.trim() ? detailsCwd : event.cwd?.trim() ? event.cwd : process.cwd();
29
+ try {
30
+ const next = await handler?.({
31
+ toolName: event.toolName,
32
+ input: event.args,
33
+ content: current.content,
34
+ details,
35
+ isError: event.isError
36
+ }, { cwd });
37
+ if (!next) return;
38
+ const nextDetails = next.details ?? details;
39
+ return { result: Object.assign({}, current, {
40
+ content: next.content ?? current.content,
41
+ details: next.content && isRecord(nextDetails) ? {
42
+ ...nextDetails,
43
+ aggregated: next.content.filter((block) => block.type === "text").map((block) => block.text).join("\n")
44
+ } : nextDetails
45
+ }) };
46
+ } finally {
47
+ retainedRuleScopes.add(cwd);
48
+ if (retainedRuleScopes.size >= 128) {
49
+ const { clearRuleCache } = await import("tokenjuice");
50
+ clearRuleCache();
51
+ retainedRuleScopes.clear();
52
+ }
53
+ }
39
54
  };
40
55
  }
41
- //#endregion
42
56
  export { createTokenjuiceAgentToolResultMiddleware };
@@ -4,317 +4,116 @@
4
4
 
5
5
  lean output compaction for terminal-heavy agent workflows.
6
6
 
7
- ## what is tokenjuice?
7
+ tokenjuice runs noisy commands and returns smaller, deterministic output to your agent.
8
+ JSON rules summarize listings, test output, build logs, and other terminal output.
9
+ The same core powers the CLI and host integrations.
8
10
 
9
- tokenjuice is a deterministic output compactor for terminal-heavy agent workflows. agents and harnesses run noisy commands like `git status`, `pnpm test`, `docker build`, `rg`, or `pnpm --help`; tokenjuice keeps the command semantics untouched, observes the output after execution, and returns a smaller payload built from rule-driven reducers instead of dumping the whole wall of terminal text back into context.
10
-
11
- the point is leverage: less transcript waste, fewer useless reruns, and cleaner handoff between tools without making the shell magical. raw output stays available only when you explicitly ask for it through `--raw` / `--full` or opt-in artifact storage, rules stay inspectable JSON instead of LLM vibes, and host integrations stay thin wrappers around the same core reducer instead of becoming one-off adapter logic.
11
+ ## install
12
12
 
13
- ## host integrations
13
+ Requires **Node.js 22 or newer**.
14
14
 
15
- supported integrations:
16
-
17
- | Logo | Client | Install | Hook file |
18
- | --- | --- | --- | --- |
19
- | <img width="48px" src="docs/client-claude.jpg" alt="Claude" /> | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | `tokenjuice install claude-code` | `~/.claude/settings.json` |
20
- | <img width="48px" src="docs/client-codebuddy.png" alt="CodeBuddy" /> | [CodeBuddy](https://codebuddy.tencent.com/) | `tokenjuice install codebuddy` | `~/.codebuddy/settings.json` |
21
- | <img width="48px" src="docs/client-openai.jpg" alt="Codex" /> | [Codex CLI](https://github.com/openai/codex) | `tokenjuice install codex` | `~/.codex/hooks.json` |
22
- | <img width="48px" src="docs/client-cursor.jpg" alt="Cursor" /> | [Cursor](https://cursor.com/docs/hooks) | `tokenjuice install cursor` | `~/.cursor/hooks.json` |
23
- | <img width="48px" src="docs/client-droid.png" alt="Droid" /> | [Droid (Factory CLI)](https://docs.factory.ai/cli/configuration/hooks-guide) | `tokenjuice install droid` | `~/.factory/settings.json` |
24
- | <img width="48px" src="docs/client-copilot.png" alt="GitHub Copilot CLI" /> | [GitHub Copilot CLI](https://github.com/github/copilot-cli) | `tokenjuice install copilot-cli` | `~/.copilot/hooks/tokenjuice-cli.json` |
25
- | <img width="48px" src="docs/client-openclaw.jpg" alt="OpenClaw" /> | [OpenClaw](https://openclaw.ai/) | `openclaw config set plugins.entries.tokenjuice.enabled true` | `~/.openclaw/openclaw.json` |
26
- | <img width="48px" src="docs/client-opencode.png" alt="OpenCode" /> | [OpenCode](https://opencode.ai/) | `tokenjuice install opencode` | `~/.config/opencode/plugins/tokenjuice.js` |
27
- | <img width="48px" src="docs/client-pi.png" alt="pi" /> | [pi](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent) | `tokenjuice install pi` | `~/.pi/agent/extensions/tokenjuice.js` |
28
- | <img width="48px" src="docs/client-copilot.png" alt="VS Code Copilot" /> | [VS Code Copilot Chat](https://code.visualstudio.com/docs/copilot/overview) | `tokenjuice install vscode-copilot` | `~/.copilot/hooks/tokenjuice-vscode.json` |
29
-
30
- beta integrations:
31
-
32
- | Logo | Client | Install | Hook file |
33
- | --- | --- | --- | --- |
34
- | <img width="48px" src="docs/client-adal.svg" alt="AdaL CLI" /> | [AdaL CLI](https://docs.sylph.ai/features/plugins-and-skills) | `tokenjuice install adal` | `AGENTS.md` |
35
- | <img width="48px" src="docs/client-aether.svg" alt="Aether" /> | [Aether](https://aether-agent.io/) | `tokenjuice install aether` | `.aether/tokenjuice.md` / `.aether/settings.json` |
36
- | <img width="48px" src="docs/client-aictl.svg" alt="aictl" /> | [aictl](https://www.aictl.app/) | `tokenjuice install aictl` | `AICTL.md` |
37
- | <img width="48px" src="docs/client-ai-memory-protocol.svg" alt="AI Memory Protocol" /> | [AI Memory Protocol](https://github.com/bburda/ai_memory_protocol) | `tokenjuice install ai-memory-protocol` | `.memories/memory/preferences.rst` |
38
- | <img width="48px" src="docs/client-aider.svg" alt="Aider" /> | [Aider](https://aider.chat/) | `tokenjuice install aider` | `CONVENTIONS.tokenjuice.md` |
39
- | <img width="48px" src="docs/client-agent-layer.svg" alt="Agent Layer" /> | [Agent Layer](https://agent-layer.dev/docs/) | `tokenjuice install agent-layer` | `.agent-layer/instructions/tokenjuice.md`; run `al sync` after install or uninstall |
40
- | <img width="48px" src="docs/client-agentinit.svg" alt="AgentInit" /> | [AgentInit](https://pypi.org/project/agentinit/) | `tokenjuice install agentinit` | `AGENTS.md`; run `agentinit sync` after install or uninstall |
41
- | <img width="48px" src="docs/client-agentlink.svg" alt="Agentlink" /> | [Agentlink](https://agentlink.run/) | `tokenjuice install agentlink` | `AGENTS.md`; run `agentlink sync` after install or uninstall |
42
- | <img width="48px" src="docs/client-agentloom.svg" alt="Agentloom" /> | [Agentloom](https://agentloom.sh/docs) | `tokenjuice install agentloom` | `.agents/rules/tokenjuice-agentloom.md`; run `agentloom sync` after install or uninstall |
43
- | <img width="48px" src="docs/client-agents-cli.svg" alt="agents-cli" /> | [agents-cli](https://agents-cli.sh/) | `tokenjuice install agents-cli` | `~/.agents/memory/AGENTS.md`; run `agents sync` after install or uninstall |
44
- | <img width="48px" src="docs/client-agents-md.svg" alt="AGENTS.md" /> | [AGENTS.md](https://agents.md/) | `tokenjuice install agents-md` | `AGENTS.md` |
45
- | <img width="48px" src="docs/client-agentsge.svg" alt="agents.ge" /> | [agents.ge](https://agents.ge/) | `tokenjuice install agentsge` | `.agents/rules/tokenjuice-agentsge.md` |
46
- | <img width="48px" src="docs/client-agentsmesh.svg" alt="AgentsMesh" /> | [AgentsMesh](https://samplexbro.github.io/agentsmesh/) | `tokenjuice install agentsmesh` | `.agentsmesh/rules/tokenjuice.md`; run `agentsmesh generate` after install or uninstall |
47
- | <img width="48px" src="docs/client-amazon-q.svg" alt="Amazon Q" /> | [Amazon Q Developer CLI / Kiro compatibility](https://kiro.dev/docs/cli/migrating-from-q/) | `tokenjuice install amazon-q` | `.amazonq/rules/tokenjuice.md` |
48
- | <img width="48px" src="docs/client-amp.svg" alt="Amp" /> | [Amp](https://ampcode.com/manual) | `tokenjuice install amp` | `AGENTS.md` / `AGENT.md` / `CLAUDE.md` |
49
- | <img width="48px" src="docs/client-antigravity.svg" alt="Antigravity" /> | [Google Antigravity](https://antigravity.google/) | `tokenjuice install antigravity` | `.agents/rules/tokenjuice.md` |
50
- | <img width="48px" src="docs/client-anywhere-agents.svg" alt="anywhere-agents" /> | [anywhere-agents](https://anywhere-agents.readthedocs.io/) | `tokenjuice install anywhere-agents` | `AGENTS.local.md`; run `anywhere-agents` after install or uninstall |
51
- | <img width="48px" src="docs/client-augment.svg" alt="Augment" /> | [Augment](https://docs.augmentcode.com/cli/rules) | `tokenjuice install augment` | `.augment/rules/tokenjuice.md` |
52
- | <img width="48px" src="docs/client-avante.png" alt="Avante" /> | [Avante.nvim](https://github.com/yetone/avante.nvim) | `tokenjuice install avante` | `avante.md` |
53
- | <img width="48px" src="docs/client-baz.svg" alt="Baz" /> | [Baz](https://docs.baz.co/agents/skills-and-instructions) | `tokenjuice install baz` | `.baz/skills/tokenjuice/SKILL.md` |
54
- | <img width="48px" src="docs/client-bito.svg" alt="Bito" /> | [Bito](https://docs.bito.ai/ai-code-reviews-in-git/agent-settings/repo-level-settings) | `tokenjuice install bito` | `.bito.yaml` / `.bito/tokenjuice.md` |
55
- | <img width="48px" src="docs/client-blackbox.svg" alt="Blackbox" /> | [Blackbox CLI](https://docs.blackbox.ai/features/blackbox-cli/skills) | `tokenjuice install blackbox` | `.blackbox/skills/tokenjuice/SKILL.md` |
56
- | <img width="48px" src="docs/client-blocks.svg" alt="Blocks" /> | [Blocks](https://docs.blocks.team/using-blocks/features/skills) | `tokenjuice install blocks` | `.agents/skills/tokenjuice-blocks/SKILL.md` |
57
- | <img width="48px" src="docs/client-clawdbot.svg" alt="Clawdbot" /> | [Clawdbot](https://docs.clawd.bot/skills) | `tokenjuice install clawdbot` | `skills/tokenjuice/SKILL.md` |
58
- | <img width="48px" src="docs/client-bob.svg" alt="IBM Bob" /> | [IBM Bob Shell](https://bob.ibm.com/docs/shell/configuration/configuring) | `tokenjuice install bob` | `AGENTS.md` |
59
- | <img width="48px" src="docs/client-builder.svg" alt="Builder" /> | [Builder](https://www.builder.io/c/docs/projects-configuration-files) | `tokenjuice install builder` | `.builder/rules/tokenjuice.mdc` |
60
- | <img width="48px" src="docs/client-charlie.svg" alt="Charlie" /> | [Charlie](https://docs.charlielabs.ai/customization/instructions) | `tokenjuice install charlie` | `AGENTS.md` |
61
- | <img width="48px" src="docs/client-cline.svg" alt="Cline" /> | [Cline](https://docs.cline.bot/features/hooks/hook-reference) | `tokenjuice install cline` | `~/Documents/Cline/Hooks/tokenjuice-post-tool-use` |
62
- | <img width="48px" src="docs/client-codeant.svg" alt="CodeAnt" /> | [CodeAnt](https://docs.codeant.ai/ide/review/code_review_instructions) | `tokenjuice install codeant` | `.codeant/instructions.json` |
63
- | <img width="48px" src="docs/client-codebuff.svg" alt="Codebuff" /> | [Codebuff](https://www.codebuff.com/docs/help/quick-start) | `tokenjuice install codebuff` | `AGENTS.md` |
64
- | <img width="48px" src="docs/client-codegen.svg" alt="Codegen" /> | [Codegen](https://docs.codegen.com/settings/repo-rules) | `tokenjuice install codegen` | `AGENTS.md` |
65
- | <img width="48px" src="docs/client-coder-agents.svg" alt="Coder Agents" /> | [Coder Agents](https://coder.com/docs/ai-coder/agents) | `tokenjuice install coder-agents` | `.agents/skills/tokenjuice/SKILL.md` |
66
- | <img width="48px" src="docs/client-coderabbit.svg" alt="CodeRabbit" /> | [CodeRabbit](https://docs.coderabbit.ai/configuration/path-instructions) | `tokenjuice install coderabbit` | `.coderabbit.yaml` |
67
- | <img width="48px" src="docs/client-command-code.svg" alt="Command Code" /> | [Command Code](https://commandcode.ai/docs/) | `tokenjuice install command-code` | `~/.commandcode/settings.json` / `.commandcode/settings.json` |
68
- | <img width="48px" src="docs/client-continue.png" alt="Continue" /> | [Continue](https://docs.continue.dev/) | `tokenjuice install continue` | `.continue/rules/tokenjuice.md` |
69
- | <img width="48px" src="docs/client-crush.svg" alt="Crush" /> | [Crush](https://github.com/charmbracelet/crush) | `tokenjuice install crush` | `.crush/skills/tokenjuice/SKILL.md` |
70
- | <img width="48px" src="docs/client-deepagents.svg" alt="Deep Agents Code" /> | [Deep Agents Code](https://docs.langchain.com/oss/javascript/deepagents/code/overview) | `tokenjuice install deepagents` | `.deepagents/AGENTS.md` |
71
- | <img width="48px" src="docs/client-devin.svg" alt="Devin" /> | [Devin for Terminal](https://cli.devin.ai/docs/extensibility/hooks/overview) | `tokenjuice install devin` | `.devin/hooks.v1.json` |
72
- | <img width="48px" src="docs/client-dot-agents.svg" alt="dot-agents" /> | [dot-agents](https://www.dot-agents.com/) | `tokenjuice install dot-agents` | `~/.agents/rules/global/rules.mdc`; run `dot-agents sync` after install or uninstall |
73
- | <img width="48px" src="docs/client-docker-agent.svg" alt="Docker Agent" /> | [Docker Agent](https://docs.docker.com/ai/docker-agent/) | `tokenjuice install docker-agent` | `.docker-agent/tokenjuice.md` |
74
- | <img width="48px" src="docs/client-eca.svg" alt="ECA" /> | [ECA](https://eca.dev/) | `tokenjuice install eca` | `.eca/skills/tokenjuice/SKILL.md` |
75
- | <img width="48px" src="docs/client-elyra.svg" alt="Elyra" /> | [Elyra](https://elyracode.com/) | `tokenjuice install elyra` | `.elyra/skills/tokenjuice/SKILL.md` |
76
- | <img width="48px" src="docs/client-firebase-studio.svg" alt="Firebase Studio" /> | [Firebase Studio](https://firebase.google.com/docs/studio/set-up-gemini) | `tokenjuice install firebase-studio` | `.idx/airules.md` |
77
- | <img width="48px" src="docs/client-forgecode.svg" alt="ForgeCode" /> | [ForgeCode](https://forgecode.dev/docs/custom-rules/) | `tokenjuice install forgecode` | `AGENTS.md` |
78
- | <img width="48px" src="docs/client-gemini.png" alt="Gemini" /> | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `tokenjuice install gemini-cli` | `~/.gemini/settings.json` |
79
- | <img width="48px" src="docs/client-gitlab-duo.svg" alt="GitLab Duo" /> | [GitLab Duo Agent Platform](https://docs.gitlab.com/user/duo_agent_platform/customize/custom_rules/) | `tokenjuice install gitlab-duo` | `.gitlab/duo/chat-rules.md` |
80
- | <img width="48px" src="docs/client-goose.svg" alt="Goose" /> | [Goose](https://goose-docs.ai/) | `tokenjuice install goose` | `.goosehints` |
81
- | <img width="48px" src="docs/client-greptile.svg" alt="Greptile" /> | [Greptile](https://www.greptile.com/docs/code-review/greptile-config) | `tokenjuice install greptile` | `.greptile/rules.md` |
82
- | <img width="48px" src="docs/client-grok-build.svg" alt="Grok Build" /> | [Grok Build](https://docs.x.ai/build/overview) | `tokenjuice install grok-build` | `AGENTS.md` |
83
- | <img width="48px" src="docs/client-grok-bot.svg" alt="Grok Bot" /> | Grok Bot | `tokenjuice install grok-bot` | `.cursor/rules/tokenjuice.mdc` |
84
- | <img width="48px" src="docs/client-grok-cli.svg" alt="Grok CLI" /> | [Grok CLI](https://github.com/superagent-ai/grok-cli) | `tokenjuice install grok-cli` | `~/.grok/user-settings.json` |
85
- | <img width="48px" src="docs/client-gptme.svg" alt="gptme" /> | [gptme](https://gptme.org/docs/prompts.html) | `tokenjuice install gptme` | `AGENTS.md` |
86
- | <img width="48px" src="docs/client-copilot.png" alt="GitHub Copilot coding agent" /> | [GitHub Copilot coding agent](https://docs.github.com/en/copilot/using-github-copilot/coding-agent) | `tokenjuice install copilot-agent` | `.github/hooks/tokenjuice-agent.json` |
87
- | <img width="48px" src="docs/client-jean2.svg" alt="Jean2" /> | [Jean2](https://jean2.ai/docs/deep-dive/agents-md) | `tokenjuice install jean2` | `AGENTS.md` |
88
- | <img width="48px" src="docs/client-jetbrains-ai.svg" alt="JetBrains AI Assistant" /> | [JetBrains AI Assistant](https://www.jetbrains.com/help/ai-assistant/) | `tokenjuice install jetbrains-ai` | `.aiassistant/rules/tokenjuice.md` |
89
- | <img width="48px" src="docs/client-junie.svg" alt="Junie" /> | [Junie](https://junie.jetbrains.com/docs/junie-cli-usage.html) | `tokenjuice install junie` | `.junie/AGENTS.md` |
90
- | <img width="48px" src="docs/client-jules.svg" alt="Jules" /> | [Jules](https://jules.google/docs/) | `tokenjuice install jules` | `AGENTS.md` |
91
- | <img width="48px" src="docs/client-leanctl.svg" alt="LeanCTL" /> | [LeanCTL](https://leanctl.com/docs/configuration) | `tokenjuice install leanctl` | `.leanctl/instructions.md` |
92
- | <img width="48px" src="docs/client-kimi.svg" alt="Kimi" /> | [Kimi Code CLI](https://moonshotai.github.io/kimi-cli/en/) | `tokenjuice install kimi` | `~/.kimi/config.toml` |
93
- | <img width="48px" src="docs/client-kiro.svg" alt="Kiro" /> | [Kiro](https://kiro.dev/) | `tokenjuice install kiro` | `.kiro/steering/tokenjuice.md` |
94
- | <img width="48px" src="docs/client-kilo.svg" alt="Kilo Code" /> | [Kilo Code](https://kilocode.ai/) | `tokenjuice install kilo` | `kilo.jsonc` or `.kilo/kilo.jsonc` + `.kilo/rules/tokenjuice.md` |
95
- | <img width="48px" src="docs/client-localcode.svg" alt="LocalCode" /> | [LocalCode](https://www.localcode.codes/) | `tokenjuice install localcode` | `~/.localcode/plugins/tokenjuice/` |
96
- | <img width="48px" src="docs/client-mcp-agent.svg" alt="mcp-agent" /> | [mcp-agent](https://docs.mcp-agent.com/) | `tokenjuice install mcp-agent` | `.mcp-agent/agents/tokenjuice.md` |
97
- | <img width="48px" src="docs/client-mini-swe-agent.svg" alt="mini-SWE-agent" /> | [mini-SWE-agent](https://mini-swe-agent.com/) | `tokenjuice install mini-swe-agent` | `.mini-swe-agent/tokenjuice.yaml` |
98
- | <img width="48px" src="docs/client-swe-agent.svg" alt="SWE-agent" /> | [SWE-agent](https://swe-agent.com/latest/) | `tokenjuice install swe-agent` | `.swe-agent/tokenjuice.yaml` |
99
- | <img width="48px" src="docs/client-stagewise.svg" alt="Stagewise" /> | [Stagewise](https://docs.stagewise.io/agent/skills-and-context) | `tokenjuice install stagewise` | `.stagewise/skills/tokenjuice/SKILL.md` |
100
- | <img width="48px" src="docs/client-mistral-vibe.svg" alt="Mistral Vibe" /> | [Mistral Vibe](https://docs.mistral.ai/mistral-vibe/agents-skills) | `tokenjuice install mistral-vibe` | `AGENTS.md` |
101
- | <img width="48px" src="docs/client-mux.svg" alt="Mux" /> | [Mux](https://mux.coder.com/hooks/tools) | `tokenjuice install mux` | `.mux/tool_post` |
102
- | <img width="48px" src="docs/client-novakit.svg" alt="NovaKit" /> | [NovaKit CLI](https://www.novakit.ai/docs/cli) | `tokenjuice install novakit` | `NOVAKIT.md` |
103
- | <img width="48px" src="docs/client-knowns.svg" alt="Knowns" /> | [Knowns](https://knowns.sh/) | `tokenjuice install knowns` | `KNOWNS.md` |
104
- | <img width="48px" src="docs/client-ona.svg" alt="Ona" /> | [Ona Agent](https://ona.com/docs/ona/agents/overview) | `tokenjuice install ona` | `.ona/skills/tokenjuice/SKILL.md` |
105
- | <img width="48px" src="docs/client-openhands.svg" alt="OpenHands" /> | [OpenHands](https://docs.openhands.dev/) | `tokenjuice install openhands` | `.openhands/hooks.json` |
106
- | <img width="48px" src="docs/client-open-interpreter.svg" alt="Open Interpreter" /> | [Open Interpreter](https://www.openinterpreter.com/docs/terminal/agents_md) | `tokenjuice install open-interpreter` | `AGENTS.md` |
107
- | <img width="48px" src="docs/client-openwebui.svg" alt="Open WebUI" /> | [Open WebUI](https://openwebui.com/) | `tokenjuice install openwebui` | `.openwebui/tools/tokenjuice_compact.py` |
108
- | <img width="48px" src="docs/client-pi-go.svg" alt="pi-go" /> | [pi-go](https://pi-go.sh/) | `tokenjuice install pi-go` | `.pi/skills/tokenjuice/SKILL.md` |
109
- | <img width="48px" src="docs/client-plandex.svg" alt="Plandex" /> | [Plandex](https://docs.plandex.ai/) | `tokenjuice install plandex` | `PLANDEX.tokenjuice.md` |
110
- | <img width="48px" src="docs/client-qodo.svg" alt="Qodo" /> | [Qodo Code Review](https://docs.qodo.ai/code-review/get-started/configuration-overview/configuration-file) | `tokenjuice install qodo` | `.pr_agent.toml` |
111
- | <img width="48px" src="docs/client-qoder.svg" alt="Qoder" /> | [Qoder CLI](https://docs.qoder.com/cli/using-cli) | `tokenjuice install qoder` | `AGENTS.md` |
112
- | <img width="48px" src="docs/client-qwen-code.svg" alt="Qwen Code" /> | [Qwen Code](https://qwenlm.github.io/qwen-code-docs/) | `tokenjuice install qwen-code` | `.qwen/settings.json` |
113
- | <img width="48px" src="docs/client-replit.svg" alt="Replit" /> | [Replit Agent](https://docs.replit.com/references/project-setup/replit-dot-md) | `tokenjuice install replit` | `replit.md` |
114
- | <img width="48px" src="docs/client-roo.svg" alt="Roo Code" /> | [Roo Code](https://roocode.com/) | `tokenjuice install roo` | `.roo/rules/tokenjuice.md` |
115
- | <img width="48px" src="docs/client-rovo.svg" alt="Rovo" /> | [Rovo Dev CLI](https://support.atlassian.com/rovo/docs/use-memory-in-rovo-dev-cli/) | `tokenjuice install rovo` | `AGENTS.md` |
116
- | <img width="48px" src="docs/client-ruler.svg" alt="Ruler" /> | [Ruler](https://github.com/intellectronica/ruler) | `tokenjuice install ruler` | `.ruler/tokenjuice.md` |
117
- | <img width="48px" src="docs/client-tabby.svg" alt="Tabby" /> | [Tabby](https://tabby.tabbyml.com/) | `tokenjuice install tabby` | `~/.tabby/config.toml` |
118
- | <img width="48px" src="docs/client-tabnine.svg" alt="Tabnine" /> | [Tabnine CLI](https://docs.tabnine.com/main/getting-started/tabnine-cli/features/cli-commands) | `tokenjuice install tabnine` | `TABNINE.md` |
119
- | <img width="48px" src="docs/client-trae.svg" alt="Trae" /> | [Trae](https://traeide.com/) | `tokenjuice install trae` | `.trae/rules/project_rules.md` |
120
- | <img width="48px" src="docs/client-uipath.svg" alt="UiPath" /> | [UiPath for Coding Agents](https://www.uipath.com/developers/coding-agents) | `tokenjuice install uipath` | `AGENTS.md` |
121
- | <img width="48px" src="docs/client-warp.svg" alt="Warp" /> | [Warp](https://docs.warp.dev/agent-platform/capabilities/rules) | `tokenjuice install warp` | `AGENTS.md` / `WARP.md` |
122
- | <img width="48px" src="docs/client-windsurf.svg" alt="Windsurf" /> | [Windsurf](https://windsurf.com/) | `tokenjuice install windsurf` | `.windsurf/rules/tokenjuice.md` |
123
- | <img width="48px" src="docs/client-zed.svg" alt="Zed" /> | [Zed](https://zed.dev/docs/ai/rules.html) | `tokenjuice install zed` | `.rules` |
124
- | <img width="48px" src="docs/client-zencoder.svg" alt="Zencoder" /> | [Zencoder](https://docs.zencoder.ai/rules-context/zen-rules) | `tokenjuice install zencoder` | `.zencoder/rules/tokenjuice.md` |
15
+ ```bash
16
+ npm install -g tokenjuice
17
+ tokenjuice --version
18
+ tokenjuice wrap -- git status
19
+ ```
125
20
 
126
- ## install
21
+ Other package managers:
127
22
 
128
23
  ```bash
129
- npm install -g tokenjuice
130
- # or
131
24
  pnpm add -g tokenjuice
132
- # or
133
25
  yarn global add tokenjuice
134
- # or (the vincentkoc/tap alias maps to github.com/vincentkoc/homebrew-tap)
26
+ ```
27
+
28
+ For Homebrew:
29
+
30
+ ```bash
135
31
  brew tap vincentkoc/tap
136
32
  brew install tokenjuice
137
33
  ```
138
34
 
139
- Homebrew publication is owned by the Tokenjuice workflow in the canonical
140
- `vincentkoc/homebrew-tap` repository. Release maintainers dispatch it manually
141
- with the published tag until GitHub App automation lands.
35
+ See [distribution](docs/distribution.md) for release artifacts and Linux packages.
36
+
37
+ ## host integrations
38
+
39
+ Choose an integration from the [client catalog](docs/integrations.md).
40
+
41
+ Building an agent? Use the native [Hermes, Copilot SDK, LangChain, Mastra, and FastMCP adapters](docs/framework-integrations.md).
42
+ Check its guide before installing: automatic replacement, command wrapping, and skill guidance have different contracts.
43
+ The [support matrix](docs/adapter-support-matrix.md) records native test versions and remaining acceptance work.
142
44
 
143
- then:
45
+ For example, Claude Code uses pre-tool command wrapping:
144
46
 
145
47
  ```bash
146
- tokenjuice --help
147
- tokenjuice --version
148
- tokenjuice install [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]
149
- tokenjuice uninstall [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]
48
+ tokenjuice install claude-code
49
+ tokenjuice doctor claude-code
150
50
  ```
151
51
 
152
- OpenClaw support is bundled on the OpenClaw side. Do not run
153
- `tokenjuice install openclaw`; enable the bundled plugin instead:
52
+ Restart the host or start a fresh session as its guide requires.
53
+ A successful doctor check confirms managed configuration. It does not prove that the host loaded it or delivered compacted output.
54
+ Use `tokenjuice uninstall claude-code` to remove tokenjuice's managed wiring.
55
+
56
+ OpenClaw uses the external `@openclaw/tokenjuice` plugin:
154
57
 
155
58
  ```bash
59
+ openclaw plugins install @openclaw/tokenjuice
156
60
  openclaw config set plugins.entries.tokenjuice.enabled true
61
+ openclaw gateway restart
157
62
  ```
158
63
 
159
- this requires OpenClaw `2026.4.22` or newer.
64
+ Match the plugin to your OpenClaw version. See the [OpenClaw guide](https://docs.openclaw.ai/tools/tokenjuice) for host compatibility.
65
+
66
+ The OpenClaw adapter compacts shell results, not Code Mode JavaScript results.
67
+ Code Mode inputs carrying `code` pass through unchanged, even when OpenClaw
68
+ also supplies that JavaScript in a `command` alias. Genuine shell `command`
69
+ inputs still use the normal compaction and inspection-output protections.
160
70
 
161
71
  ## commands
162
72
 
163
73
  ```bash
164
74
  tokenjuice --help
165
- tokenjuice --version
166
- tokenjuice reduce [file]
167
- tokenjuice reduce-json [file]
168
- tokenjuice wrap -- <command> [args...]
169
- tokenjuice wrap --no-stats -- <command> [args...]
170
- tokenjuice wrap --raw -- <command> [args...]
171
- tokenjuice wrap --store -- <command> [args...]
172
- tokenjuice install [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]
173
- tokenjuice install [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder] --local
174
- tokenjuice uninstall [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]
175
- tokenjuice ls
176
- tokenjuice cat <artifact-id>
177
- tokenjuice verify
178
- tokenjuice discover
179
- tokenjuice doctor
75
+ tokenjuice reduce build.log
76
+ tokenjuice reduce-json result.json
77
+ tokenjuice wrap -- pnpm test
78
+ tokenjuice wrap --keep-failures -- pnpm test
79
+ tokenjuice wrap --raw -- git status
80
+ tokenjuice wrap --store -- pnpm test
180
81
  tokenjuice doctor hooks
181
- tokenjuice doctor pi
182
- tokenjuice doctor opencode
183
- tokenjuice stats
184
82
  tokenjuice stats --timezone utc
185
- tokenjuice stats --limit 1000
186
- ```
187
-
188
- ## overview
189
-
190
- tokenjuice has three surfaces. `reduce` compacts text that already exists, `wrap` runs a command and compacts the observed output, and `reduce-json` gives host adapters a stable machine protocol. host integrations are intentionally thin: they install a hook, extension, rule, or guidance file; call the shared compactor; and return compacted context through the host's native surface. use `tokenjuice doctor hooks` to check installed wiring, `tokenjuice doctor <host>` for one integration, and `tokenjuice install <host> --local` when validating the current repo build before release.
191
-
192
- the reduction engine is rule-driven. built-in JSON rules live in `src/rules`, user overrides live in `~/.config/tokenjuice/rules`, and project overrides live in `.tokenjuice/rules`; later layers override earlier ones by rule id. rules classify command output, normalize lines, keep or drop patterns, count facts, and retain deterministic head/tail slices. host adapters also apply a narrow safe-inventory policy: exact file-content reads stay raw, standalone repository inventory commands can compact, and unsafe mixed command sequences stay raw.
193
-
194
- when a reducer gets it wrong or the task needs untouched bytes, use the explicit bypass:
195
-
196
- ```bash
197
- tokenjuice wrap --raw -- pnpm --help
198
- tokenjuice wrap --full -- git status
83
+ tokenjuice verify --fixtures
84
+ tokenjuice discover
199
85
  ```
200
86
 
201
- statistics use bounded metadata segments and exclude pre-existing JSON sidecars. page with `--limit` and the returned `--cursor`; output reports when coverage is partial. set `TOKENJUICE_STATS=off` or pass `--no-stats` to stop metadata and hook-debug telemetry writes. `--raw` and `--full` return untouched bytes; artifact retention remains opt-in through `--store`.
87
+ `reduce` compacts existing text. `wrap` runs a command and compacts its observed output.
88
+ `reduce-json` provides the machine protocol for adapters.
89
+ See the [spec](docs/spec.md) for options, JSON envelopes, rules, and storage behavior.
202
90
 
203
- useful maintenance commands:
91
+ ## output and storage
204
92
 
205
- ```bash
206
- tokenjuice verify --fixtures
207
- tokenjuice discover
208
- tokenjuice doctor hooks
209
- tokenjuice stats --timezone utc
210
- ```
93
+ Host integrations preserve exact file reads and apply their documented compaction policy to eligible output.
94
+ Use `--keep-failures` to preserve failed commands' stdout, stderr, and exit status within the capture limit.
95
+ Automatic pre-tool wrappers enable this option.
211
96
 
212
- ## adapter JSON
97
+ `--raw` and its alias `--full` bypass reduction. They still obey the capture limit, which defaults to `4mb`.
98
+ Increase `--max-capture-bytes` when you need a larger capture.
213
99
 
214
- `reduce-json` is the machine-facing adapter command. it reads JSON from stdin or a file and always writes JSON to stdout; see the [spec](docs/spec.md) for envelope options and adapter behavior.
100
+ Raw artifact storage is opt-in through `--store`.
101
+ The Pi extension is the exception: it stores the raw bytes of every rewrite for retrieval with `tokenjuice cat <artifact-id>`.
102
+ Set `TOKENJUICE_ARTIFACT_DIR` to choose the artifact directory.
215
103
 
216
- direct payload:
104
+ Statistics use bounded metadata segments. `tokenjuice stats --limit 1000` reports partial coverage and a cursor for the next page.
105
+ Set `TOKENJUICE_STATS=off` or pass `--no-stats` to disable metadata and hook-debug telemetry writes.
217
106
 
218
- ```json
219
- {
220
- "toolName": "exec",
221
- "command": "pnpm test",
222
- "argv": ["pnpm", "test"],
223
- "combinedText": "RUN v3.2.4 /repo\n...",
224
- "exitCode": 1
225
- }
226
- ```
107
+ Rules load from built-ins, `~/.config/tokenjuice/rules`, and `.tokenjuice/rules`.
108
+ Later layers override earlier rules by ID. See [rule authoring](docs/rules.md).
227
109
 
228
110
  ## docs
229
111
 
230
- - [spec](docs/spec.md)
231
- - [rules](docs/rules.md)
232
- - [integration playbook](docs/integration-playbook.md)
233
- - [AdaL CLI integration](docs/adal-integration.md)
234
- - [Aether integration](docs/aether-integration.md)
235
- - [Agent Layer integration](docs/agent-layer-integration.md)
236
- - [AgentInit integration](docs/agentinit-integration.md)
237
- - [Agentlink integration](docs/agentlink-integration.md)
238
- - [Agentloom integration](docs/agentloom-integration.md)
239
- - [agents-cli integration](docs/agents-cli-integration.md)
240
- - [AGENTS.md integration](docs/agents-md-integration.md)
241
- - [agents.ge integration](docs/agentsge-integration.md)
242
- - [AgentsMesh integration](docs/agentsmesh-integration.md)
243
- - [Amp integration](docs/amp-integration.md)
244
- - [Amazon Q integration](docs/amazon-q-integration.md)
245
- - [aictl integration](docs/aictl-integration.md)
246
- - [AI Memory Protocol integration](docs/ai-memory-protocol-integration.md)
247
- - [Antigravity integration](docs/antigravity-integration.md)
248
- - [anywhere-agents integration](docs/anywhere-agents-integration.md)
249
- - [Augment integration](docs/augment-integration.md)
250
- - [Baz integration](docs/baz-integration.md)
251
- - [Bito integration](docs/bito-integration.md)
252
- - [Blackbox integration](docs/blackbox-integration.md)
253
- - [Blocks integration](docs/blocks-integration.md)
254
- - [Clawdbot integration](docs/clawdbot-integration.md)
255
- - [IBM Bob integration](docs/bob-integration.md)
256
- - [Builder integration](docs/builder-integration.md)
257
- - [Charlie integration](docs/charlie-integration.md)
258
- - [GitHub Copilot coding agent integration](docs/copilot-agent-integration.md)
259
- - [CodeAnt integration](docs/codeant-integration.md)
260
- - [Codebuff integration](docs/codebuff-integration.md)
261
- - [Codegen integration](docs/codegen-integration.md)
262
- - [Coder Agents integration](docs/coder-agents-integration.md)
263
- - [CodeRabbit integration](docs/coderabbit-integration.md)
264
- - [Command Code integration](docs/command-code-integration.md)
265
- - [Crush integration](docs/crush-integration.md)
266
- - [Cursor integration](docs/cursor-integration.md)
267
- - [CodeBuddy integration](docs/codebuddy-integration.md)
268
- - [Deep Agents Code integration](docs/deepagents-integration.md)
269
- - [Devin integration](docs/devin-integration.md)
270
- - [dot-agents integration](docs/dot-agents-integration.md)
271
- - [Docker Agent integration](docs/docker-agent-integration.md)
272
- - [ECA integration](docs/eca-integration.md)
273
- - [Elyra integration](docs/elyra-integration.md)
274
- - [ForgeCode integration](docs/forgecode-integration.md)
275
- - [Goose integration](docs/goose-integration.md)
276
- - [Greptile integration](docs/greptile-integration.md)
277
- - [Grok Build integration](docs/grok-build-integration.md)
278
- - [Grok CLI integration](docs/grok-cli-integration.md)
279
- - [gptme integration](docs/gptme-integration.md)
280
- - [Jean2 integration](docs/jean2-integration.md)
281
- - [JetBrains AI Assistant integration](docs/jetbrains-ai-integration.md)
282
- - [LeanCTL integration](docs/leanctl-integration.md)
283
- - [Kimi integration](docs/kimi-integration.md)
284
- - [Kiro integration](docs/kiro-integration.md)
285
- - [Kilo Code integration](docs/kilo-integration.md)
286
- - [LocalCode integration](docs/localcode-integration.md)
287
- - [mcp-agent integration](docs/mcp-agent-integration.md)
288
- - [mini-SWE-agent integration](docs/mini-swe-agent-integration.md)
289
- - [SWE-agent integration](docs/swe-agent-integration.md)
290
- - [Stagewise integration](docs/stagewise-integration.md)
291
- - [Mistral Vibe integration](docs/mistral-vibe-integration.md)
292
- - [Mux integration](docs/mux-integration.md)
293
- - [NovaKit integration](docs/novakit-integration.md)
294
- - [Knowns integration](docs/knowns-integration.md)
295
- - [Ona integration](docs/ona-integration.md)
296
- - [Open Interpreter integration](docs/open-interpreter-integration.md)
297
- - [Open WebUI integration](docs/openwebui-integration.md)
298
- - [pi-go integration](docs/pi-go-integration.md)
299
- - [Plandex integration](docs/plandex-integration.md)
300
- - [Qodo integration](docs/qodo-integration.md)
301
- - [Qoder integration](docs/qoder-integration.md)
302
- - [Qwen Code integration](docs/qwen-code-integration.md)
303
- - [Replit integration](docs/replit-integration.md)
304
- - [Roo Code integration](docs/roo-integration.md)
305
- - [Rovo integration](docs/rovo-integration.md)
306
- - [Ruler integration](docs/ruler-integration.md)
307
- - [Tabby integration](docs/tabby-integration.md)
308
- - [Tabnine integration](docs/tabnine-integration.md)
309
- - [Trae integration](docs/trae-integration.md)
310
- - [UiPath integration](docs/uipath-integration.md)
311
- - [Warp integration](docs/warp-integration.md)
312
- - [Windsurf integration](docs/windsurf-integration.md)
313
- - [Zencoder integration](docs/zencoder-integration.md)
314
- - [security](SECURITY.md)
315
-
316
- ## status
317
-
318
- usable foundation for token reduction with diagnostics and a growing reducer set, now focused on deeper coverage and tuning.
112
+ - [documentation index](docs/README.md) — all integration guides and reference pages
113
+ - [client catalog](docs/integrations.md) — setup routes and configuration locations
114
+ - [support and verification](docs/adapter-support-matrix.md) — evidence and acceptance limits
115
+ - [spec](docs/spec.md) — CLI, adapter protocol, compaction, and storage
116
+ - [contributing](CONTRIBUTING.md) — development and validation
117
+ - [security](SECURITY.md) — private vulnerability reporting
319
118
 
320
119
  💙 built by [Vincent Koc](https://github.com/vincentkoc).
@@ -0,0 +1,36 @@
1
+ export type Format = "text" | "json";
2
+ /** Parsed command-line arguments shared by every CLI command. */
3
+ export type ParsedArgs = {
4
+ command: string | undefined;
5
+ format: Format;
6
+ local: boolean;
7
+ classifier: string | undefined;
8
+ fixtures: boolean;
9
+ sourceCommand: string | undefined;
10
+ toolName: string | undefined;
11
+ exitCode: number | undefined;
12
+ store: boolean;
13
+ noStats: boolean;
14
+ tee: boolean;
15
+ raw: boolean;
16
+ keepFailures?: boolean;
17
+ noOmit: boolean;
18
+ allowOmit: boolean;
19
+ storeDir: string | undefined;
20
+ maxInlineChars: number | undefined;
21
+ maxCaptureBytes: number | undefined;
22
+ maxInputBytes: number | undefined;
23
+ timeZone: string | undefined;
24
+ source: string | undefined;
25
+ bySource: boolean;
26
+ limit: number | undefined;
27
+ cursor: string | undefined;
28
+ wrapLauncher: string | undefined;
29
+ trace: boolean;
30
+ printInstructions: boolean;
31
+ skipCommandNames: string[];
32
+ positionals: string[];
33
+ passthrough: string[];
34
+ };
35
+ /** Runs one CLI command for a resolved target and returns the process exit code. */
36
+ export type HostCommandHandler = (args: ParsedArgs, target: string) => Promise<number>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { HostCommandHandler } from "./command-types.js";
2
+ export declare const doctorCommands: ReadonlyMap<string, HostCommandHandler>;