@openclaw/tokenjuice 2026.11.7 → 2026.11.8
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.
|
@@ -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":"
|
|
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":"44ab8d01c4ab38ac7c04b9acf51bedf394c0240b152f8f291b036f94fccd3eec","facadeSource":"extensions/tokenjuice/tool-result-middleware.ts","sources":["extensions/tokenjuice/tool-result-middleware.ts"]}],"unrenderedSources":["extensions/tokenjuice/runtime-api.ts"]}
|
|
@@ -22,20 +22,27 @@ function createTokenjuiceAgentToolResultMiddleware() {
|
|
|
22
22
|
if (event === "tool_result") handler = registeredHandler;
|
|
23
23
|
} });
|
|
24
24
|
return async (event) => {
|
|
25
|
+
if (event.toolName === "exec" && typeof event.args.code === "string") return;
|
|
25
26
|
const current = event.result;
|
|
26
27
|
const workdir = event.args.workdir;
|
|
27
28
|
const cwd = event.cwd?.trim() ? event.cwd : typeof workdir === "string" && workdir.trim() ? workdir : process.cwd();
|
|
29
|
+
const details = normalizeDetails(event, current);
|
|
28
30
|
const next = await handler?.({
|
|
29
31
|
toolName: event.toolName,
|
|
30
32
|
input: event.args,
|
|
31
33
|
content: current.content,
|
|
32
|
-
details
|
|
34
|
+
details,
|
|
33
35
|
isError: event.isError
|
|
34
36
|
}, { cwd });
|
|
35
|
-
|
|
37
|
+
if (!next) return;
|
|
38
|
+
const nextDetails = next.details ?? details;
|
|
39
|
+
return { result: Object.assign({}, current, {
|
|
36
40
|
content: next.content ?? current.content,
|
|
37
|
-
details: next.
|
|
38
|
-
|
|
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
|
+
}) };
|
|
39
46
|
};
|
|
40
47
|
}
|
|
41
48
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/tokenjuice",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.8",
|
|
4
4
|
"description": "OpenClaw tokenjuice exec output compaction plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"tokenjuice": "0.8.5"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"openclaw": ">=2026.11.
|
|
14
|
+
"openclaw": ">=2026.11.8"
|
|
15
15
|
},
|
|
16
16
|
"peerDependenciesMeta": {
|
|
17
17
|
"openclaw": {
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"minHostVersion": ">=2026.5.28"
|
|
30
30
|
},
|
|
31
31
|
"compat": {
|
|
32
|
-
"pluginApi": ">=2026.11.
|
|
32
|
+
"pluginApi": ">=2026.11.8"
|
|
33
33
|
},
|
|
34
34
|
"build": {
|
|
35
|
-
"openclawVersion": "2026.11.
|
|
35
|
+
"openclawVersion": "2026.11.8",
|
|
36
36
|
"bundledDist": false
|
|
37
37
|
},
|
|
38
38
|
"release": {
|