dsh-context-fold 0.1.2 → 0.1.3
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.
- package/lib/index.js +2 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1407,7 +1407,7 @@ function buildReport(session, deps) {
|
|
|
1407
1407
|
const event = session.eventAt(fold.seq);
|
|
1408
1408
|
const message = event === void 0 ? null : session.deriveEventMessage(event);
|
|
1409
1409
|
const content = message !== null && message.role === "tool" ? message.content : void 0;
|
|
1410
|
-
const tokensAfter =
|
|
1410
|
+
const tokensAfter = message === null ? 0 : deps.estimateMessage(message);
|
|
1411
1411
|
const inline = inlineTextOf(content) ?? "";
|
|
1412
1412
|
const locator = locatorOf(inline);
|
|
1413
1413
|
folds.push({
|
|
@@ -1444,10 +1444,7 @@ function buildReport(session, deps) {
|
|
|
1444
1444
|
charsBefore: target.chars?.[position] ?? 0,
|
|
1445
1445
|
charsAfter: Array.from(block.text).length,
|
|
1446
1446
|
tokensBefore: estimateFromChars(target.chars?.[position] ?? 0),
|
|
1447
|
-
tokensAfter:
|
|
1448
|
-
type: "text",
|
|
1449
|
-
text: block.text
|
|
1450
|
-
}]),
|
|
1447
|
+
tokensAfter: estimateFromChars(Array.from(block.text).length),
|
|
1451
1448
|
inline: block.text,
|
|
1452
1449
|
recoverable: locator !== void 0,
|
|
1453
1450
|
...locator === void 0 ? {} : { locator }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-context-fold",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "dsh-context-fold: stage-boundary folding of completed tool results into a conclusion plus a spill path, deterministic and replay-safe.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|