claude-code-infinite 1.0.33 → 1.0.34
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/README.md +9 -2
- package/dist/cli-main.js +18 -9
- package/dist/cli-main.js.map +1 -1
- package/dist/hooks.d.ts +20 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +34 -4
- package/dist/hooks.js.map +1 -1
- package/dist/host-session.d.ts +12 -0
- package/dist/host-session.d.ts.map +1 -0
- package/dist/host-session.js +12 -0
- package/dist/host-session.js.map +1 -0
- package/dist/image-refs.d.ts +24 -2
- package/dist/image-refs.d.ts.map +1 -1
- package/dist/image-refs.js +67 -20
- package/dist/image-refs.js.map +1 -1
- package/dist/index-wait-413.d.ts +26 -0
- package/dist/index-wait-413.d.ts.map +1 -0
- package/dist/index-wait-413.js +113 -0
- package/dist/index-wait-413.js.map +1 -0
- package/dist/memtree-finder.d.ts +70 -6
- package/dist/memtree-finder.d.ts.map +1 -1
- package/dist/memtree-finder.js +150 -20
- package/dist/memtree-finder.js.map +1 -1
- package/dist/memtree-handover.d.ts +13 -0
- package/dist/memtree-handover.d.ts.map +1 -0
- package/dist/memtree-handover.js +231 -0
- package/dist/memtree-handover.js.map +1 -0
- package/dist/memtree-mcp-config.d.ts +2 -2
- package/dist/memtree-mcp-config.d.ts.map +1 -1
- package/dist/memtree-mcp-config.js +8 -5
- package/dist/memtree-mcp-config.js.map +1 -1
- package/dist/memtree-mcp.d.ts +182 -2
- package/dist/memtree-mcp.d.ts.map +1 -1
- package/dist/memtree-mcp.js +357 -38
- package/dist/memtree-mcp.js.map +1 -1
- package/dist/memtree-newest.d.ts +21 -3
- package/dist/memtree-newest.d.ts.map +1 -1
- package/dist/memtree-newest.js +43 -11
- package/dist/memtree-newest.js.map +1 -1
- package/dist/memtree-times.d.ts +33 -0
- package/dist/memtree-times.d.ts.map +1 -1
- package/dist/memtree-times.js +77 -0
- package/dist/memtree-times.js.map +1 -1
- package/dist/memtree-tools.d.ts +19 -5
- package/dist/memtree-tools.d.ts.map +1 -1
- package/dist/memtree-tools.js +97 -23
- package/dist/memtree-tools.js.map +1 -1
- package/dist/memtree.d.ts +23 -0
- package/dist/memtree.d.ts.map +1 -1
- package/dist/memtree.js +78 -4
- package/dist/memtree.js.map +1 -1
- package/dist/network-failure.d.ts +28 -0
- package/dist/network-failure.d.ts.map +1 -0
- package/dist/network-failure.js +67 -0
- package/dist/network-failure.js.map +1 -0
- package/dist/prefix-store.d.ts +4 -0
- package/dist/prefix-store.d.ts.map +1 -1
- package/dist/prefix-store.js +8 -4
- package/dist/prefix-store.js.map +1 -1
- package/dist/project-trees.d.ts +15 -7
- package/dist/project-trees.d.ts.map +1 -1
- package/dist/project-trees.js +20 -9
- package/dist/project-trees.js.map +1 -1
- package/dist/proxy.d.ts +69 -1
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +467 -39
- package/dist/proxy.js.map +1 -1
- package/dist/reqlog.d.ts +24 -0
- package/dist/reqlog.d.ts.map +1 -1
- package/dist/reqlog.js.map +1 -1
- package/dist/resume-guidance.d.ts +9 -3
- package/dist/resume-guidance.d.ts.map +1 -1
- package/dist/resume-guidance.js +9 -3
- package/dist/resume-guidance.js.map +1 -1
- package/dist/route-fallback.d.ts +77 -11
- package/dist/route-fallback.d.ts.map +1 -1
- package/dist/route-fallback.js +157 -33
- package/dist/route-fallback.js.map +1 -1
- package/dist/route-identity.d.ts +6 -2
- package/dist/route-identity.d.ts.map +1 -1
- package/dist/route-identity.js +209 -16
- package/dist/route-identity.js.map +1 -1
- package/dist/subagent-hint.d.ts +28 -0
- package/dist/subagent-hint.d.ts.map +1 -1
- package/dist/subagent-hint.js +37 -0
- package/dist/subagent-hint.js.map +1 -1
- package/package.json +1 -1
package/dist/image-refs.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export declare const STORED_IMAGES_FIELD = "memtree_image_sha256s";
|
|
|
8
8
|
export declare const MISSING_IMAGES_FIELD = "missing_image_sha256s";
|
|
9
9
|
/** The server's answer to references it cannot serve; the call is sent again with bytes. */
|
|
10
10
|
export declare const MISSING_IMAGES_STATUS = 409;
|
|
11
|
+
/** Reference blocks one call may carry unconfirmed (the server's MAX_IMAGE_REFS). */
|
|
12
|
+
export declare const MAX_UNCONFIRMED_REFS = 1000;
|
|
11
13
|
/** A message list as sent, and the shas it references (empty: nothing changed). */
|
|
12
14
|
export interface Referenced<T> {
|
|
13
15
|
value: T;
|
|
@@ -15,6 +17,8 @@ export interface Referenced<T> {
|
|
|
15
17
|
}
|
|
16
18
|
export declare class ImageRefs {
|
|
17
19
|
private known;
|
|
20
|
+
/** Shas the server said it lacks, until an answer lists them (bounded like known). */
|
|
21
|
+
private lacking;
|
|
18
22
|
private shaOf;
|
|
19
23
|
private shaChars;
|
|
20
24
|
private disabled;
|
|
@@ -22,18 +26,36 @@ export declare class ImageRefs {
|
|
|
22
26
|
get active(): boolean;
|
|
23
27
|
/** Learn the stored images an answer lists; a server that lists none changes nothing. */
|
|
24
28
|
noteAnswer(json: unknown): void;
|
|
29
|
+
/** Whether an answer shows a server that resolves references (it lists stored images). */
|
|
30
|
+
static resolvedBy(json: unknown): boolean;
|
|
31
|
+
/** The server lacks these: they are not referenced unconfirmed again. */
|
|
32
|
+
noteMissing(shas: readonly string[]): void;
|
|
25
33
|
/** The server could not serve these (or, without a list, any): send bytes for them. */
|
|
26
34
|
forget(shas: readonly string[]): void;
|
|
35
|
+
/**
|
|
36
|
+
* Forget what the server lacked: its bytes did not fit, and a lack can be a slow
|
|
37
|
+
* read on the server (its read deadline) that the next attempt no longer hits.
|
|
38
|
+
*/
|
|
39
|
+
retryMissing(): void;
|
|
27
40
|
/** The server refused references outright (an older or misconfigured server). */
|
|
28
41
|
disable(): void;
|
|
29
42
|
/** `messages` with each stored image as a reference; copy on write. */
|
|
30
43
|
referenceMessages(messages: Message[]): Referenced<Message[]>;
|
|
44
|
+
/**
|
|
45
|
+
* `messages` with every image as a reference unless the server said it lacks it, up
|
|
46
|
+
* to MAX_UNCONFIRMED_REFS: for a body that cannot be sent with its images' bytes, in
|
|
47
|
+
* a process that has no answer listing stored images yet (a resumed session). The
|
|
48
|
+
* server names the ones it lacks (409) and the caller sends those as bytes.
|
|
49
|
+
*/
|
|
50
|
+
referenceUnconfirmed(messages: Message[]): Referenced<Message[]>;
|
|
31
51
|
/** One message with each stored image as a reference; the same object if none is. */
|
|
32
52
|
referenceMessage(message: Message): Referenced<Message>;
|
|
53
|
+
private referenceAll;
|
|
54
|
+
private referenceOne;
|
|
33
55
|
private referenceBlocks;
|
|
34
56
|
private referenceBlock;
|
|
35
|
-
/** The image's sha when
|
|
36
|
-
private
|
|
57
|
+
/** The image's sha when its base64 re-encodes identically (what the server stores). */
|
|
58
|
+
private canonicalSha;
|
|
37
59
|
private rememberSha;
|
|
38
60
|
}
|
|
39
61
|
/** The shas a refusal names (409 detail), or undefined when it names none. */
|
package/dist/image-refs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-refs.d.ts","sourceRoot":"","sources":["../src/image-refs.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AACxD,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAC/C,oEAAoE;AACpE,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAC3D,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,4FAA4F;AAC5F,eAAO,MAAM,qBAAqB,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"image-refs.d.ts","sourceRoot":"","sources":["../src/image-refs.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AACxD,4EAA4E;AAC5E,eAAO,MAAM,kBA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UAAU,CAAC,OAAO,CAAC;IAKvD,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,cAAc;IAatB,uFAAuF;IACvF,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,WAAW;CAWpB;AAcD,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAQvE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAG3F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKvD"}
|
package/dist/image-refs.js
CHANGED
|
@@ -24,12 +24,16 @@ export const MISSING_IMAGES_FIELD = "missing_image_sha256s";
|
|
|
24
24
|
export const MISSING_IMAGES_STATUS = 409;
|
|
25
25
|
/** Stored shas remembered (a 1M-token window holds ~600 images). */
|
|
26
26
|
const KNOWN_MAX = 4096;
|
|
27
|
+
/** Reference blocks one call may carry unconfirmed (the server's MAX_IMAGE_REFS). */
|
|
28
|
+
export const MAX_UNCONFIRMED_REFS = 1000;
|
|
27
29
|
/** Base64 strings whose sha is remembered, by total length (memory bound). */
|
|
28
30
|
const SHA_CACHE_MAX_CHARS = 64 * 1024 * 1024;
|
|
29
31
|
const SHA_HEX_RE = /^[0-9a-f]{64}$/;
|
|
30
32
|
const BASE64_RE = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
31
33
|
export class ImageRefs {
|
|
32
34
|
known = new Map();
|
|
35
|
+
/** Shas the server said it lacks, until an answer lists them (bounded like known). */
|
|
36
|
+
lacking = new Map();
|
|
33
37
|
shaOf = new Map();
|
|
34
38
|
shaChars = 0;
|
|
35
39
|
disabled = false;
|
|
@@ -47,70 +51,104 @@ export class ImageRefs {
|
|
|
47
51
|
continue;
|
|
48
52
|
this.known.delete(sha);
|
|
49
53
|
this.known.set(sha, true);
|
|
54
|
+
this.lacking.delete(sha);
|
|
50
55
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
dropOldest(this.known, KNOWN_MAX);
|
|
57
|
+
}
|
|
58
|
+
/** Whether an answer shows a server that resolves references (it lists stored images). */
|
|
59
|
+
static resolvedBy(json) {
|
|
60
|
+
return Array.isArray(json?.[STORED_IMAGES_FIELD]);
|
|
61
|
+
}
|
|
62
|
+
/** The server lacks these: they are not referenced unconfirmed again. */
|
|
63
|
+
noteMissing(shas) {
|
|
64
|
+
for (const sha of shas)
|
|
65
|
+
this.lacking.set(sha, true);
|
|
66
|
+
dropOldest(this.lacking, KNOWN_MAX);
|
|
57
67
|
}
|
|
58
68
|
/** The server could not serve these (or, without a list, any): send bytes for them. */
|
|
59
69
|
forget(shas) {
|
|
60
70
|
for (const sha of shas)
|
|
61
71
|
this.known.delete(sha);
|
|
62
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Forget what the server lacked: its bytes did not fit, and a lack can be a slow
|
|
75
|
+
* read on the server (its read deadline) that the next attempt no longer hits.
|
|
76
|
+
*/
|
|
77
|
+
retryMissing() {
|
|
78
|
+
this.lacking.clear();
|
|
79
|
+
}
|
|
63
80
|
/** The server refused references outright (an older or misconfigured server). */
|
|
64
81
|
disable() {
|
|
65
82
|
this.disabled = true;
|
|
66
83
|
this.known.clear();
|
|
84
|
+
this.lacking.clear();
|
|
67
85
|
}
|
|
68
86
|
/** `messages` with each stored image as a reference; copy on write. */
|
|
69
87
|
referenceMessages(messages) {
|
|
70
88
|
if (!this.active)
|
|
71
89
|
return { value: messages, refs: [] };
|
|
90
|
+
return this.referenceAll(messages, (sha) => this.known.has(sha));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* `messages` with every image as a reference unless the server said it lacks it, up
|
|
94
|
+
* to MAX_UNCONFIRMED_REFS: for a body that cannot be sent with its images' bytes, in
|
|
95
|
+
* a process that has no answer listing stored images yet (a resumed session). The
|
|
96
|
+
* server names the ones it lacks (409) and the caller sends those as bytes.
|
|
97
|
+
*/
|
|
98
|
+
referenceUnconfirmed(messages) {
|
|
99
|
+
if (this.disabled)
|
|
100
|
+
return { value: messages, refs: [] };
|
|
101
|
+
let left = MAX_UNCONFIRMED_REFS;
|
|
102
|
+
return this.referenceAll(messages, (sha) => !this.lacking.has(sha) && left-- > 0);
|
|
103
|
+
}
|
|
104
|
+
/** One message with each stored image as a reference; the same object if none is. */
|
|
105
|
+
referenceMessage(message) {
|
|
106
|
+
if (!this.active)
|
|
107
|
+
return { value: message, refs: [] };
|
|
108
|
+
return this.referenceOne(message, (sha) => this.known.has(sha));
|
|
109
|
+
}
|
|
110
|
+
referenceAll(messages, wanted) {
|
|
72
111
|
const refs = [];
|
|
73
112
|
const value = messages.map((message) => {
|
|
74
|
-
const result = this.
|
|
113
|
+
const result = this.referenceOne(message, wanted);
|
|
75
114
|
refs.push(...result.refs);
|
|
76
115
|
return result.value;
|
|
77
116
|
});
|
|
78
117
|
return refs.length ? { value, refs } : { value: messages, refs };
|
|
79
118
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (!this.active || !Array.isArray(message?.content))
|
|
119
|
+
referenceOne(message, wanted) {
|
|
120
|
+
if (!Array.isArray(message?.content))
|
|
83
121
|
return { value: message, refs: [] };
|
|
84
122
|
const refs = [];
|
|
85
|
-
const content = this.referenceBlocks(message.content, refs);
|
|
123
|
+
const content = this.referenceBlocks(message.content, refs, wanted);
|
|
86
124
|
return { value: content === message.content ? message : { ...message, content }, refs };
|
|
87
125
|
}
|
|
88
|
-
referenceBlocks(blocks, refs) {
|
|
126
|
+
referenceBlocks(blocks, refs, wanted) {
|
|
89
127
|
let changed = false;
|
|
90
128
|
const out = blocks.map((block) => {
|
|
91
|
-
const next = this.referenceBlock(block, refs);
|
|
129
|
+
const next = this.referenceBlock(block, refs, wanted);
|
|
92
130
|
if (next !== block)
|
|
93
131
|
changed = true;
|
|
94
132
|
return next;
|
|
95
133
|
});
|
|
96
134
|
return changed ? out : blocks;
|
|
97
135
|
}
|
|
98
|
-
referenceBlock(block, refs) {
|
|
136
|
+
referenceBlock(block, refs, wanted) {
|
|
99
137
|
if (block?.type === "tool_result" && Array.isArray(block.content)) {
|
|
100
|
-
const content = this.referenceBlocks(block.content, refs);
|
|
138
|
+
const content = this.referenceBlocks(block.content, refs, wanted);
|
|
101
139
|
return content === block.content ? block : { ...block, content };
|
|
102
140
|
}
|
|
103
141
|
const source = block?.type === "image" ? block.source : undefined;
|
|
104
142
|
if (source?.type !== "base64" || typeof source.data !== "string")
|
|
105
143
|
return block;
|
|
106
|
-
const sha = this.
|
|
107
|
-
if (sha === undefined)
|
|
144
|
+
const sha = this.canonicalSha(source.data);
|
|
145
|
+
if (sha === undefined || !wanted(sha))
|
|
108
146
|
return block;
|
|
109
147
|
refs.push(sha);
|
|
110
148
|
return { ...block, source: { ...source, data: IMAGE_REF_PREFIX + sha } };
|
|
111
149
|
}
|
|
112
|
-
/** The image's sha when
|
|
113
|
-
|
|
150
|
+
/** The image's sha when its base64 re-encodes identically (what the server stores). */
|
|
151
|
+
canonicalSha(data) {
|
|
114
152
|
let sha = this.shaOf.get(data);
|
|
115
153
|
if (sha === undefined) {
|
|
116
154
|
if (!isCanonicalBase64(data))
|
|
@@ -118,7 +156,7 @@ export class ImageRefs {
|
|
|
118
156
|
sha = createHash("sha256").update(Buffer.from(data, "base64")).digest("hex");
|
|
119
157
|
this.rememberSha(data, sha);
|
|
120
158
|
}
|
|
121
|
-
return
|
|
159
|
+
return sha;
|
|
122
160
|
}
|
|
123
161
|
rememberSha(data, sha) {
|
|
124
162
|
if (data.length > SHA_CACHE_MAX_CHARS)
|
|
@@ -134,6 +172,15 @@ export class ImageRefs {
|
|
|
134
172
|
}
|
|
135
173
|
}
|
|
136
174
|
}
|
|
175
|
+
/** Drops a map's oldest entries until it holds at most `max`. */
|
|
176
|
+
function dropOldest(map, max) {
|
|
177
|
+
while (map.size > max) {
|
|
178
|
+
const first = map.keys().next().value;
|
|
179
|
+
if (first === undefined)
|
|
180
|
+
break;
|
|
181
|
+
map.delete(first);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
137
184
|
/** The shas a refusal names (409 detail), or undefined when it names none. */
|
|
138
185
|
export function missingImageShas(bodyText) {
|
|
139
186
|
try {
|
package/dist/image-refs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-refs.js","sourceRoot":"","sources":["../src/image-refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACxD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAC/C,oEAAoE;AACpE,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAC3D,+DAA+D;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAC5D,4FAA4F;AAC5F,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,oEAAoE;AACpE,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,8EAA8E;AAC9E,MAAM,mBAAmB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7C,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC,MAAM,SAAS,GAAG,wBAAwB,CAAC;AAQ3C,MAAM,OAAO,SAAS;IACZ,KAAK,GAAG,IAAI,GAAG,EAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"image-refs.js","sourceRoot":"","sources":["../src/image-refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAA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AM,CAAC,CAAC,GAAG,EAAiB,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,QAAgB;IAC/D,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IACvE,OAAO,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACtF,qFAAqF;IACrF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether MemTree's 413 to a compress call means "the index is still catching up on this
|
|
3
|
+
* conversation" (waiting fixes it) rather than "this request cannot fit" (it never will),
|
|
4
|
+
* and how long the server expects indexing to take.
|
|
5
|
+
*
|
|
6
|
+
* Today's server (polychat index_eta.py, 2026-11-02 on) answers an indexing 413 with
|
|
7
|
+
* `{"detail": "Memory for this conversation is being compressed in the background ...
|
|
8
|
+
* Estimated indexing time left: about 4 minutes. ..."}` and `Retry-After: 240` (30 s to
|
|
9
|
+
* 1 h). Its 413s that waiting cannot fix (the newest message alone over the window, too
|
|
10
|
+
* many unindexed tokens) carry no Retry-After. An explicit `index_pending` (or
|
|
11
|
+
* `index_behind`) boolean in the body, top level or in `detail`, decides when present.
|
|
12
|
+
* Older servers sent the background-compression text with a range ("5 to 9.9 hours").
|
|
13
|
+
* Since polychat 53459dbd every over-context 413 also says `X-Polychat-Index-Pending`:
|
|
14
|
+
* `true` when a live index job will cover what did not fit (then this is a wait, whatever
|
|
15
|
+
* else the answer says); `false` or absent decides nothing (a newest message too large
|
|
16
|
+
* says false while the server may still shrink it), and the rules above apply.
|
|
17
|
+
* Retry-After can be far too low (an incident's said 30 s; the job took ~14 min), so a
|
|
18
|
+
* wait goes on while MemTree keeps saying so (route-fallback.ts extends it).
|
|
19
|
+
*/
|
|
20
|
+
/** Seconds assumed when an indexing 413 says it is behind but not for how long. */
|
|
21
|
+
export declare const UNKNOWN_INDEX_WAIT_SECONDS = 60;
|
|
22
|
+
/** Seconds of indexing the server expects before this request fits; undefined: no wait. */
|
|
23
|
+
export declare function indexWaitFrom413(status: number, bodyText: string, retryAfter: string | null | undefined, now?: number, indexPendingHeader?: string | null): number | undefined;
|
|
24
|
+
/** A Retry-After header in seconds (delta-seconds or an HTTP date), if valid. */
|
|
25
|
+
export declare function retryAfterSeconds(value: string | null | undefined, now?: number): number | undefined;
|
|
26
|
+
//# sourceMappingURL=index-wait-413.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-wait-413.d.ts","sourceRoot":"","sources":["../src/index-wait-413.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,mFAAmF;AACnF,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,SAAa,EACzF,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,GACjC,MAAM,GAAG,SAAS,CAapB;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,SAAa,GACjD,MAAM,GAAG,SAAS,CAMpB"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether MemTree's 413 to a compress call means "the index is still catching up on this
|
|
3
|
+
* conversation" (waiting fixes it) rather than "this request cannot fit" (it never will),
|
|
4
|
+
* and how long the server expects indexing to take.
|
|
5
|
+
*
|
|
6
|
+
* Today's server (polychat index_eta.py, 2026-11-02 on) answers an indexing 413 with
|
|
7
|
+
* `{"detail": "Memory for this conversation is being compressed in the background ...
|
|
8
|
+
* Estimated indexing time left: about 4 minutes. ..."}` and `Retry-After: 240` (30 s to
|
|
9
|
+
* 1 h). Its 413s that waiting cannot fix (the newest message alone over the window, too
|
|
10
|
+
* many unindexed tokens) carry no Retry-After. An explicit `index_pending` (or
|
|
11
|
+
* `index_behind`) boolean in the body, top level or in `detail`, decides when present.
|
|
12
|
+
* Older servers sent the background-compression text with a range ("5 to 9.9 hours").
|
|
13
|
+
* Since polychat 53459dbd every over-context 413 also says `X-Polychat-Index-Pending`:
|
|
14
|
+
* `true` when a live index job will cover what did not fit (then this is a wait, whatever
|
|
15
|
+
* else the answer says); `false` or absent decides nothing (a newest message too large
|
|
16
|
+
* says false while the server may still shrink it), and the rules above apply.
|
|
17
|
+
* Retry-After can be far too low (an incident's said 30 s; the job took ~14 min), so a
|
|
18
|
+
* wait goes on while MemTree keeps saying so (route-fallback.ts extends it).
|
|
19
|
+
*/
|
|
20
|
+
/** The background-indexing sentence every indexing 413 starts with (polychat constants). */
|
|
21
|
+
const INDEXING_TEXT = "being compressed in the background";
|
|
22
|
+
/** Seconds assumed when an indexing 413 says it is behind but not for how long. */
|
|
23
|
+
export const UNKNOWN_INDEX_WAIT_SECONDS = 60;
|
|
24
|
+
/** Seconds of indexing the server expects before this request fits; undefined: no wait. */
|
|
25
|
+
export function indexWaitFrom413(status, bodyText, retryAfter, now = Date.now(), indexPendingHeader) {
|
|
26
|
+
if (status !== 413)
|
|
27
|
+
return undefined;
|
|
28
|
+
const fields = bodyFields(bodyText);
|
|
29
|
+
const flag = indexPendingHeader?.trim().toLowerCase() === "true" ? true
|
|
30
|
+
: explicitFlag(fields);
|
|
31
|
+
if (flag === false)
|
|
32
|
+
return undefined;
|
|
33
|
+
const headerSeconds = retryAfterSeconds(retryAfter, now);
|
|
34
|
+
const detail = detailText(fields, bodyText);
|
|
35
|
+
if (flag !== true && headerSeconds === undefined && !detail.includes(INDEXING_TEXT)) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return headerSeconds ?? bodySeconds(fields) ?? textSeconds(detail) ??
|
|
39
|
+
UNKNOWN_INDEX_WAIT_SECONDS;
|
|
40
|
+
}
|
|
41
|
+
/** A Retry-After header in seconds (delta-seconds or an HTTP date), if valid. */
|
|
42
|
+
export function retryAfterSeconds(value, now = Date.now()) {
|
|
43
|
+
const text = value?.trim();
|
|
44
|
+
if (!text)
|
|
45
|
+
return undefined;
|
|
46
|
+
if (/^\d+(\.\d+)?$/.test(text))
|
|
47
|
+
return positive(Number(text));
|
|
48
|
+
const at = Date.parse(text);
|
|
49
|
+
return Number.isFinite(at) ? positive(Math.ceil((at - now) / 1000)) : undefined;
|
|
50
|
+
}
|
|
51
|
+
/** The body's top-level object and its `detail` object, when they are objects. */
|
|
52
|
+
function bodyFields(bodyText) {
|
|
53
|
+
let parsed;
|
|
54
|
+
try {
|
|
55
|
+
parsed = JSON.parse(bodyText);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
if (!isObject(parsed))
|
|
61
|
+
return [];
|
|
62
|
+
return isObject(parsed.detail) ? [parsed, parsed.detail] : [parsed];
|
|
63
|
+
}
|
|
64
|
+
function explicitFlag(fields) {
|
|
65
|
+
for (const field of fields) {
|
|
66
|
+
for (const key of ["index_pending", "index_behind"]) {
|
|
67
|
+
if (typeof field[key] === "boolean")
|
|
68
|
+
return field[key];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
function bodySeconds(fields) {
|
|
74
|
+
for (const field of fields) {
|
|
75
|
+
for (const key of ["retry_after_seconds", "index_seconds_left", "seconds_left"]) {
|
|
76
|
+
const value = field[key];
|
|
77
|
+
if (typeof value === "number" && Number.isFinite(value) && value > 0)
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
function detailText(fields, bodyText) {
|
|
84
|
+
for (const field of fields) {
|
|
85
|
+
for (const key of ["detail", "message"]) {
|
|
86
|
+
if (typeof field[key] === "string")
|
|
87
|
+
return field[key];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return fields.length ? "" : bodyText;
|
|
91
|
+
}
|
|
92
|
+
const UNIT_SECONDS = { second: 1, minute: 60, hour: 3600 };
|
|
93
|
+
/**
|
|
94
|
+
* The time in an indexing 413's text: "about 4 minutes", "about 1.5 hours", "< 1 minute",
|
|
95
|
+
* or an older server's range ("5 to 9.9 hours": its upper end).
|
|
96
|
+
*/
|
|
97
|
+
function textSeconds(text) {
|
|
98
|
+
if (/<\s*1 minute/.test(text))
|
|
99
|
+
return 60;
|
|
100
|
+
const range = /(\d+(?:\.\d+)?)\s*(second|minute|hour)?s?\s+to\s+(\d+(?:\.\d+)?)\s*(second|minute|hour)s?/
|
|
101
|
+
.exec(text);
|
|
102
|
+
if (range)
|
|
103
|
+
return Number(range[3]) * UNIT_SECONDS[range[4]];
|
|
104
|
+
const about = /about\s+(\d+(?:\.\d+)?)\s*(second|minute|hour)s?/.exec(text);
|
|
105
|
+
return about ? Number(about[1]) * UNIT_SECONDS[about[2]] : undefined;
|
|
106
|
+
}
|
|
107
|
+
function positive(value) {
|
|
108
|
+
return Number.isFinite(value) && value > 0 ? value : undefined;
|
|
109
|
+
}
|
|
110
|
+
function isObject(value) {
|
|
111
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=index-wait-413.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-wait-413.js","sourceRoot":"","sources":["../src/index-wait-413.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,4FAA4F;AAC5F,MAAM,aAAa,GAAG,oCAAoC,CAAC;AAC3D,mFAAmF;AACnF,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,2FAA2F;AAC3F,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EAAE,QAAgB,EAAE,UAAqC,EAAE,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,EACzF,kBAAkC;IAElC,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,kBAAkB,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI;QACrE,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACzB,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,aAAa,GAAG,iBAAiB,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC5C,IAAI,IAAI,KAAK,IAAI,IAAI,aAAa,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACpF,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,aAAa,IAAI,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A2F;SACtG,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,IAAI,KAAK;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,kDAAkD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5E,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa;IAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC"}
|
package/dist/memtree-finder.d.ts
CHANGED
|
@@ -31,10 +31,12 @@ export interface FinderSession {
|
|
|
31
31
|
completion?: number;
|
|
32
32
|
conversation?: number | null;
|
|
33
33
|
};
|
|
34
|
+
/** `times`: when the tree's messages were written, first to last (servers from 2026-11). */
|
|
34
35
|
latest_tree?: {
|
|
35
36
|
request_id: string;
|
|
36
37
|
ref?: string;
|
|
37
38
|
links?: FinderTreeLinks;
|
|
39
|
+
times?: unknown;
|
|
38
40
|
} | null;
|
|
39
41
|
/** How it ended, from the newest stored record (polychat memtree_session_endings.py). */
|
|
40
42
|
ending?: FinderSessionEnding | null;
|
|
@@ -61,7 +63,15 @@ export interface FinderHit {
|
|
|
61
63
|
start: number;
|
|
62
64
|
end: number;
|
|
63
65
|
} | null;
|
|
66
|
+
/** The lines joined; older servers send only this. */
|
|
64
67
|
snippet?: string | null;
|
|
68
|
+
/** The 1-3 lines densest in the query's words, by block line (servers from 2026-11-09). */
|
|
69
|
+
snippets?: {
|
|
70
|
+
line: number;
|
|
71
|
+
text: string;
|
|
72
|
+
}[] | null;
|
|
73
|
+
/** The leaf's own summary (servers from 2026-11-09). */
|
|
74
|
+
summary?: string | null;
|
|
65
75
|
score?: number;
|
|
66
76
|
embedding_model?: string;
|
|
67
77
|
/** `<tree>#<node>`: the matched node, for read_node / read_lines `node`. */
|
|
@@ -83,29 +93,83 @@ export interface FinderSearchResponse {
|
|
|
83
93
|
query?: string;
|
|
84
94
|
mode?: string;
|
|
85
95
|
hits?: FinderHit[];
|
|
86
|
-
groups?:
|
|
87
|
-
embedding_model: string;
|
|
88
|
-
hits: FinderHit[];
|
|
89
|
-
has_more?: boolean;
|
|
90
|
-
}[];
|
|
96
|
+
groups?: FinderSearchGroup[];
|
|
91
97
|
next_cursor?: string | null;
|
|
92
98
|
matches_capped?: boolean;
|
|
93
99
|
charged?: boolean;
|
|
94
100
|
/** "any_word": no passage held every word, so these hold some of them. */
|
|
95
101
|
relaxed?: string;
|
|
102
|
+
/** On an empty first page across sessions (servers from 2026-11): what was searched. */
|
|
103
|
+
coverage?: FinderSearchCoverage;
|
|
104
|
+
}
|
|
105
|
+
/** One embedding model's ranking. */
|
|
106
|
+
export interface FinderSearchGroup {
|
|
107
|
+
embedding_model: string;
|
|
108
|
+
hits: FinderHit[];
|
|
109
|
+
has_more?: boolean;
|
|
110
|
+
/** The ranking ran out of time, so only the newest trees were ranked (servers from 2026-11-09). */
|
|
111
|
+
partial?: {
|
|
112
|
+
trees?: number;
|
|
113
|
+
of_trees?: number;
|
|
114
|
+
since?: string | null;
|
|
115
|
+
note?: string;
|
|
116
|
+
} | null;
|
|
117
|
+
}
|
|
118
|
+
/** Counts and times of the caller's own sessions; never content (polychat memtree_search_coverage.py). */
|
|
119
|
+
export interface FinderSearchCoverage {
|
|
120
|
+
sessions?: number;
|
|
121
|
+
newest_indexed_at?: string | null;
|
|
122
|
+
this_session?: {
|
|
123
|
+
state?: string;
|
|
124
|
+
indexed_at?: string | null;
|
|
125
|
+
percent?: number;
|
|
126
|
+
tokens?: number;
|
|
127
|
+
start_tokens?: number;
|
|
128
|
+
};
|
|
96
129
|
}
|
|
97
130
|
/** Query string for `/memtree/sessions` from the tool's arguments. */
|
|
98
131
|
export declare function sessionsQuery(args: Record<string, unknown>): string;
|
|
99
132
|
/** Query string for `/memtree/search`; `mode` defaults to text; `tree` scopes it to one tree. */
|
|
100
133
|
export declare function searchQuery(args: Record<string, unknown>, tree?: string): string;
|
|
134
|
+
/**
|
|
135
|
+
* A search across all sessions that the server refused as too broad (422: it
|
|
136
|
+
* did not finish in time) is retried over the newest days, widest window first.
|
|
137
|
+
* Measured on staging (2026-11-06): ~28% of agent searches came back 422 after
|
|
138
|
+
* 9-16 s. On its busiest account an unscoped search took ~10.5 s even for a word in
|
|
139
|
+
* no session (the cost is finding the account's trees, not matching), 14 and 7 days
|
|
140
|
+
* still timed out, and 2-3 days answered in ~0.5 s. The agents' own retries succeeded
|
|
141
|
+
* once they added a recent `since`. Only when the caller set no tree, time bounds or
|
|
142
|
+
* cursor.
|
|
143
|
+
*/
|
|
144
|
+
export declare const RECENT_SEARCH_WINDOWS_DAYS: readonly [3, 1];
|
|
145
|
+
/** The narrowed retry's arguments for `days`, or undefined when no retry applies. */
|
|
146
|
+
export declare function recentSearchArgs(args: Record<string, unknown>, tree: string | undefined, status: number, nowMs: number, days: number): Record<string, unknown> | undefined;
|
|
147
|
+
/** Added to the refusal when no narrowed window answered either. */
|
|
148
|
+
export declare function recentSearchFailedNote(triedDays: readonly number[], last: {
|
|
149
|
+
status: number;
|
|
150
|
+
error?: string;
|
|
151
|
+
}): string;
|
|
152
|
+
/** Said first in a narrowed retry's answer, so the model knows what was left out. */
|
|
153
|
+
export declare function recentSearchNote(since: string, days: number, pages?: boolean): string;
|
|
101
154
|
export declare function searchMode(value: unknown): (typeof FINDER_SEARCH_MODES)[number];
|
|
102
|
-
export declare function formatSessions(body: FinderSessionsResponse, args: Record<string, unknown
|
|
155
|
+
export declare function formatSessions(body: FinderSessionsResponse, args: Record<string, unknown>,
|
|
156
|
+
/** The calling Claude Code session: its entry is marked "(this session)". */
|
|
157
|
+
currentSessionId?: string): string;
|
|
158
|
+
/** Said after a charged first page's heading (the server's `charged`). */
|
|
159
|
+
export declare const CHARGED_NOTE = "charged: one search";
|
|
103
160
|
export declare function formatSearchResults(body: FinderSearchResponse, args: Record<string, unknown>): string;
|
|
104
161
|
/** Ancestors root first, ` › `-joined, each with its address when the tree is known. */
|
|
105
162
|
export declare function formatPath(path: {
|
|
106
163
|
id: number;
|
|
107
164
|
summary: string;
|
|
108
165
|
}[], ref?: string): string;
|
|
166
|
+
/** What an empty search covered: sessions searched, the newest index, this session's state. */
|
|
167
|
+
export declare function coverageLines(coverage: FinderSearchCoverage | undefined): string[];
|
|
168
|
+
/**
|
|
169
|
+
* Why a session may not be found, said on every empty search across sessions: only
|
|
170
|
+
* ccc sessions are indexed, and a session's newest messages wait for its next index.
|
|
171
|
+
*/
|
|
172
|
+
export declare const NOT_SEARCHED_NOTE: string;
|
|
109
173
|
/** "how it ended" lines of a session: last user message, then the tools and last reply after it. */
|
|
110
174
|
export declare function endingLines(ending: FinderSessionEnding | null | undefined): string[];
|
|
111
175
|
//# sourceMappingURL=memtree-finder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memtree-finder.d.ts","sourceRoot":"","sources":["../src/memtree-finder.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,mBAAmB,6BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"memtree-fin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