build(plugins): externalize tokenjuice

This commit is contained in:
Peter Steinberger
2026-05-29 20:54:07 +01:00
parent f10bad944f
commit 2b15850b47
12 changed files with 110 additions and 19 deletions

View File

@@ -6,6 +6,7 @@ Docs: https://docs.openclaw.ai
### Changes
- Plugins: externalize Tokenjuice as the official `@openclaw/tokenjuice` plugin with npm and ClawHub publish metadata.
- Plugins: externalize the GitHub Copilot agent runtime as the official `@openclaw/copilot` plugin with npm and ClawHub publish metadata.
### Fixes

View File

@@ -125,7 +125,6 @@ commands.
| [telegram](/plugins/reference/telegram) | Adds the Telegram channel surface for sending and receiving OpenClaw messages. | `@openclaw/telegram`<br />included in OpenClaw | channels: telegram |
| [tencent](/plugins/reference/tencent) | Adds Tencent TokenHub model provider support to OpenClaw. | `@openclaw/tencent-provider`<br />included in OpenClaw | providers: tencent-tokenhub |
| [together](/plugins/reference/together) | Adds Together model provider support to OpenClaw. | `@openclaw/together-provider`<br />included in OpenClaw | providers: together; contracts: videoGenerationProviders |
| [tokenjuice](/plugins/reference/tokenjuice) | Compacts exec and bash tool results with tokenjuice reducers. | `@openclaw/tokenjuice`<br />included in OpenClaw | contracts: agentToolResultMiddleware |
| [tts-local-cli](/plugins/reference/tts-local-cli) | Adds text-to-speech provider support. | `@openclaw/tts-local-cli`<br />included in OpenClaw | contracts: speechProviders |
| [venice](/plugins/reference/venice) | Adds Venice model provider support to OpenClaw. | `@openclaw/venice-provider`<br />included in OpenClaw | providers: venice |
| [vercel-ai-gateway](/plugins/reference/vercel-ai-gateway) | Adds Vercel AI Gateway model provider support to OpenClaw. | `@openclaw/vercel-ai-gateway-provider`<br />included in OpenClaw | providers: vercel-ai-gateway |
@@ -172,6 +171,7 @@ commands.
| [slack](/plugins/reference/slack) | OpenClaw Slack channel plugin for channels, DMs, commands, and app events. | `@openclaw/slack`<br />npm; ClawHub | channels: slack |
| [synology-chat](/plugins/reference/synology-chat) | Synology Chat channel plugin for OpenClaw channels and direct messages. | `@openclaw/synology-chat`<br />npm; ClawHub | channels: synology-chat |
| [tlon](/plugins/reference/tlon) | OpenClaw Tlon/Urbit channel plugin for chat workflows. | `@openclaw/tlon`<br />npm; ClawHub | channels: tlon; skills |
| [tokenjuice](/plugins/reference/tokenjuice) | Compacts exec and bash tool results with tokenjuice reducers. | `@openclaw/tokenjuice`<br />npm; ClawHub: `clawhub:@openclaw/tokenjuice` | contracts: agentToolResultMiddleware |
| [twitch](/plugins/reference/twitch) | OpenClaw Twitch channel plugin for chat and moderation workflows. | `@openclaw/twitch`<br />npm; ClawHub | channels: twitch |
| [voice-call](/plugins/reference/voice-call) | OpenClaw voice-call plugin for Twilio, Telnyx, and Plivo phone calls. | `@openclaw/voice-call`<br />npm; ClawHub | contracts: tools |
| [whatsapp](/plugins/reference/whatsapp) | OpenClaw WhatsApp channel plugin for WhatsApp Web chats. | `@openclaw/whatsapp`<br />ClawHub: `clawhub:@openclaw/whatsapp`; npm | channels: whatsapp |

View File

@@ -122,7 +122,7 @@ pnpm plugins:inventory:gen
| [tencent](/plugins/reference/tencent) | Adds Tencent TokenHub model provider support to OpenClaw. | `@openclaw/tencent-provider`<br />included in OpenClaw | providers: tencent-tokenhub |
| [tlon](/plugins/reference/tlon) | OpenClaw Tlon/Urbit channel plugin for chat workflows. | `@openclaw/tlon`<br />npm; ClawHub | channels: tlon; skills |
| [together](/plugins/reference/together) | Adds Together model provider support to OpenClaw. | `@openclaw/together-provider`<br />included in OpenClaw | providers: together; contracts: videoGenerationProviders |
| [tokenjuice](/plugins/reference/tokenjuice) | Compacts exec and bash tool results with tokenjuice reducers. | `@openclaw/tokenjuice`<br />included in OpenClaw | contracts: agentToolResultMiddleware |
| [tokenjuice](/plugins/reference/tokenjuice) | Compacts exec and bash tool results with tokenjuice reducers. | `@openclaw/tokenjuice`<br />npm; ClawHub: `clawhub:@openclaw/tokenjuice` | contracts: agentToolResultMiddleware |
| [tts-local-cli](/plugins/reference/tts-local-cli) | Adds text-to-speech provider support. | `@openclaw/tts-local-cli`<br />included in OpenClaw | contracts: speechProviders |
| [twitch](/plugins/reference/twitch) | OpenClaw Twitch channel plugin for chat and moderation workflows. | `@openclaw/twitch`<br />npm; ClawHub | channels: twitch |
| [venice](/plugins/reference/venice) | Adds Venice model provider support to OpenClaw. | `@openclaw/venice-provider`<br />included in OpenClaw | providers: venice |

View File

@@ -12,7 +12,7 @@ Compacts exec and bash tool results with tokenjuice reducers.
## Distribution
- Package: `@openclaw/tokenjuice`
- Install route: included in OpenClaw
- Install route: npm; ClawHub: `clawhub:@openclaw/tokenjuice`
## Surface

View File

@@ -1,13 +1,13 @@
---
summary: "Compact noisy exec and bash tool results with an optional bundled plugin"
summary: "Compact noisy exec and bash tool results with the optional Tokenjuice plugin"
title: "Tokenjuice"
read_when:
- You want shorter `exec` or `bash` tool results in OpenClaw
- You want to enable the bundled tokenjuice plugin
- You want to install or enable the Tokenjuice plugin
- You need to understand what tokenjuice changes and what it leaves raw
---
`tokenjuice` is an optional bundled plugin that compacts noisy `exec` and `bash`
`tokenjuice` is an optional external plugin that compacts noisy `exec` and `bash`
tool results after the command has already run.
It changes the returned `tool_result`, not the command itself. Tokenjuice does
@@ -19,7 +19,13 @@ trims the output before it goes back into the active harness session.
## Enable the plugin
Fast path:
Install once:
```bash
openclaw plugins install clawhub:@openclaw/tokenjuice
```
Then enable it:
```bash
openclaw config set plugins.entries.tokenjuice.enabled true
@@ -31,9 +37,6 @@ Equivalent:
openclaw plugins enable tokenjuice
```
OpenClaw already ships the plugin. There is no separate `plugins install`
or `tokenjuice install openclaw` step.
If you prefer editing config directly:
```json5

View File

@@ -17,7 +17,7 @@ vi.mock("./runtime-api.js", () => ({
import plugin from "./index.js";
describe("tokenjuice bundled plugin", () => {
describe("tokenjuice plugin", () => {
beforeEach(() => {
createTokenjuiceOpenClawEmbeddedExtension.mockClear();
tokenjuiceFactory.mockClear();

View File

@@ -0,0 +1,39 @@
{
"name": "@openclaw/tokenjuice",
"version": "2026.5.28",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@openclaw/tokenjuice",
"version": "2026.5.28",
"dependencies": {
"tokenjuice": "0.8.0"
},
"peerDependencies": {
"openclaw": ">=2026.5.28"
},
"peerDependenciesMeta": {
"openclaw": {
"optional": true
}
}
},
"node_modules/tokenjuice": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/tokenjuice/-/tokenjuice-0.8.0.tgz",
"integrity": "sha512-8jSOhyW3NzYNx7HbbGDkNVltQPiGaZB10Tty5Ovqpsw1VOBw7y+FikykNZ4+Gp9Ze94UubtcPDak7kkyv6F2cg==",
"license": "MIT",
"bin": {
"tokenjuice": "dist/cli/main.js"
},
"engines": {
"node": ">=20"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/vincentkoc"
}
}
}
}

View File

@@ -1,17 +1,47 @@
{
"name": "@openclaw/tokenjuice",
"version": "2026.5.28",
"description": "Bundled tokenjuice exec output compaction plugin",
"description": "OpenClaw tokenjuice exec output compaction plugin",
"repository": {
"type": "git",
"url": "https://github.com/openclaw/openclaw"
},
"type": "module",
"dependencies": {
"tokenjuice": "0.8.0"
},
"peerDependencies": {
"openclaw": ">=2026.5.28"
},
"peerDependenciesMeta": {
"openclaw": {
"optional": true
}
},
"devDependencies": {
"@openclaw/plugin-sdk": "workspace:*"
"@openclaw/plugin-sdk": "workspace:*",
"openclaw": "workspace:*"
},
"openclaw": {
"extensions": [
"./index.ts"
]
],
"install": {
"clawhubSpec": "clawhub:@openclaw/tokenjuice",
"npmSpec": "@openclaw/tokenjuice",
"defaultChoice": "npm",
"minHostVersion": ">=2026.5.28"
},
"compat": {
"pluginApi": ">=2026.5.28"
},
"build": {
"openclawVersion": "2026.5.28",
"bundledDist": false
},
"release": {
"publishToClawHub": true,
"publishToNpm": true
}
}
}

View File

@@ -105,6 +105,7 @@
"!dist/extensions/openshell/**",
"!dist/extensions/slack/**",
"!dist/extensions/synology-chat/**",
"!dist/extensions/tokenjuice/**",
"!dist/extensions/tlon/**",
"!dist/extensions/twitch/**",
"!dist/extensions/voice-call/**",
@@ -1876,7 +1877,6 @@
"quickjs-wasi": "3.0.0",
"rastermill": "0.3.0",
"tar": "7.5.15",
"tokenjuice": "0.8.0",
"tree-sitter-bash": "0.25.1",
"tslog": "4.10.2",
"typebox": "1.1.38",

6
pnpm-lock.yaml generated
View File

@@ -182,9 +182,6 @@ importers:
tar:
specifier: 7.5.15
version: 7.5.15
tokenjuice:
specifier: 0.8.0
version: 0.8.0
tree-sitter-bash:
specifier: 0.25.1
version: 0.25.1
@@ -1565,6 +1562,9 @@ importers:
'@openclaw/plugin-sdk':
specifier: workspace:*
version: link:../../packages/plugin-sdk
openclaw:
specifier: workspace:*
version: link:../..
extensions/tts-local-cli:
devDependencies:

View File

@@ -225,6 +225,24 @@
}
}
},
{
"name": "@openclaw/tokenjuice",
"description": "OpenClaw tokenjuice exec output compaction plugin",
"source": "official",
"kind": "plugin",
"openclaw": {
"plugin": {
"id": "tokenjuice",
"label": "Tokenjuice"
},
"install": {
"clawhubSpec": "clawhub:@openclaw/tokenjuice",
"npmSpec": "@openclaw/tokenjuice",
"defaultChoice": "npm",
"minHostVersion": ">=2026.5.28"
}
}
},
{
"name": "@openclaw/voice-call",
"description": "OpenClaw voice-call plugin",

View File

@@ -184,7 +184,7 @@ describe("bundled plugin build entries", () => {
const entries = listBundledPluginBuildEntries();
const artifacts = listBundledPluginPackArtifacts();
for (const pluginId of ["copilot", "openshell", "slack"]) {
for (const pluginId of ["copilot", "openshell", "slack", "tokenjuice"]) {
expectNoPrefixMatches(Object.keys(entries), `extensions/${pluginId}/`);
expectNoPrefixMatches(artifacts, `dist/extensions/${pluginId}/`);
}