mirror of
https://github.com/wassname/pi-dynamic-context-pruning.git
synced 2026-06-27 15:16:10 +08:00
fix: gap calculation scoped to requested range, clearer error text
This commit is contained in:
+2
-1
@@ -173,6 +173,7 @@ export function registerCompressTool(
|
|||||||
|
|
||||||
const sortedEntries = [...state.messageIdSnapshot.entries()]
|
const sortedEntries = [...state.messageIdSnapshot.entries()]
|
||||||
.filter(([id]) => id.startsWith('m')) // only mNNN ids
|
.filter(([id]) => id.startsWith('m')) // only mNNN ids
|
||||||
|
.filter(([, ts]) => ts >= startTimestamp && ts <= endTimestamp) // only within requested range
|
||||||
.sort((a, b) => a[1] - b[1])
|
.sort((a, b) => a[1] - b[1])
|
||||||
|
|
||||||
// Walk sorted messages, grouping consecutive uncovered ones into gap ranges
|
// Walk sorted messages, grouping consecutive uncovered ones into gap ranges
|
||||||
@@ -213,7 +214,7 @@ export function registerCompressTool(
|
|||||||
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`[compress] Range {startId: "${startId}", endId: "${endId}"} overlaps existing summaries: ${overlapInfo}. ` +
|
`[compress] Range {startId: "${startId}", endId: "${endId}"} overlaps existing summaries: ${overlapInfo}. ` +
|
||||||
`Available ranges: ${gapInfo}`,
|
`Available ranges within your requested range: ${gapInfo}`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Generated
+2
-17
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@complexthings/pi-dynamic-context-pruning",
|
"name": "@complexthings/pi-dynamic-context-pruning",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@complexthings/pi-dynamic-context-pruning",
|
"name": "@complexthings/pi-dynamic-context-pruning",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jsonc-parser": "^3.3.1"
|
"jsonc-parser": "^3.3.1"
|
||||||
},
|
},
|
||||||
@@ -913,9 +913,6 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -933,9 +930,6 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -953,9 +947,6 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -973,9 +964,6 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -993,9 +981,6 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|||||||
Reference in New Issue
Block a user