chat-recall 0.7.79 → 0.7.81
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 +1 -1
- package/dist/cli.js +189 -134
- package/dist/index-reply.d.ts +22 -0
- package/dist/index-reply.d.ts.map +1 -0
- package/dist/index-reply.js +35 -0
- package/dist/index-reply.js.map +1 -0
- package/dist/mcp.js +182 -93
- package/dist/mcp.js.map +1 -1
- package/dist/scan-worker.js +59 -16
- package/dist/sync-client.d.ts.map +1 -1
- package/dist/sync-client.js +5 -1
- package/dist/sync-client.js.map +1 -1
- package/dist/watch.js +199 -144
- package/dist/yield-loop.d.ts +15 -0
- package/dist/yield-loop.d.ts.map +1 -0
- package/dist/yield-loop.js +17 -0
- package/dist/yield-loop.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The longest `recall_index` waits for the index before it answers.
|
|
3
|
+
*
|
|
4
|
+
* An MCP client closes a request after 60 s. The call that waited for the whole
|
|
5
|
+
* index failed with "The operation timed out." at 60.8 s, and the index went on
|
|
6
|
+
* without a caller.
|
|
7
|
+
*/
|
|
8
|
+
export declare const INDEX_REPLY_MS = 45000;
|
|
9
|
+
/** What the tool answers when the index is still running after INDEX_REPLY_MS. */
|
|
10
|
+
export declare const INDEX_RUNNING_REPLY = "The index is running in the background and finishes on its own. recall_status shows the session count, and the watch daemon keeps syncing meanwhile.";
|
|
11
|
+
/**
|
|
12
|
+
* Answer with the result of `work` when it ends within `ms`, and with
|
|
13
|
+
* `fallback` when it does not. `work` keeps running after the fallback.
|
|
14
|
+
*/
|
|
15
|
+
export declare function answerWithin<T>(work: Promise<T>, ms: number, fallback: T): Promise<T>;
|
|
16
|
+
/**
|
|
17
|
+
* One shared run for every caller. A call that arrives while the run is going
|
|
18
|
+
* joins it and its argument is ignored, so the process holds one index child
|
|
19
|
+
* at a time.
|
|
20
|
+
*/
|
|
21
|
+
export declare function sharedRun<A, T>(start: (arg: A) => Promise<T>): (arg: A) => Promise<T>;
|
|
22
|
+
//# sourceMappingURL=index-reply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-reply.d.ts","sourceRoot":"","sources":["../src/index-reply.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,QAAS,CAAC;AAErC,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,yJACwH,CAAC;AAEzJ;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAQrF;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAQrF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The longest `recall_index` waits for the index before it answers.
|
|
3
|
+
*
|
|
4
|
+
* An MCP client closes a request after 60 s. The call that waited for the whole
|
|
5
|
+
* index failed with "The operation timed out." at 60.8 s, and the index went on
|
|
6
|
+
* without a caller.
|
|
7
|
+
*/
|
|
8
|
+
export const INDEX_REPLY_MS = 45_000;
|
|
9
|
+
/** What the tool answers when the index is still running after INDEX_REPLY_MS. */
|
|
10
|
+
export const INDEX_RUNNING_REPLY = 'The index is running in the background and finishes on its own. recall_status shows the session count, and the watch daemon keeps syncing meanwhile.';
|
|
11
|
+
/**
|
|
12
|
+
* Answer with the result of `work` when it ends within `ms`, and with
|
|
13
|
+
* `fallback` when it does not. `work` keeps running after the fallback.
|
|
14
|
+
*/
|
|
15
|
+
export function answerWithin(work, ms, fallback) {
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
const timer = setTimeout(() => resolve(fallback), ms);
|
|
18
|
+
work.then((value) => { clearTimeout(timer); resolve(value); }, (error) => { clearTimeout(timer); reject(error); });
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* One shared run for every caller. A call that arrives while the run is going
|
|
23
|
+
* joins it and its argument is ignored, so the process holds one index child
|
|
24
|
+
* at a time.
|
|
25
|
+
*/
|
|
26
|
+
export function sharedRun(start) {
|
|
27
|
+
let current;
|
|
28
|
+
return (arg) => {
|
|
29
|
+
if (current === undefined) {
|
|
30
|
+
current = start(arg).finally(() => { current = undefined; });
|
|
31
|
+
}
|
|
32
|
+
return current;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=index-reply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-reply.js","sourceRoot":"","sources":["../src/index-reply.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC;AAErC,kFAAkF;AAClF,MAAM,CAAC,MAAM,mBAAmB,GAC9B,sJAAsJ,CAAC;AAEzJ;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAI,IAAgB,EAAE,EAAU,EAAE,QAAW;IACvE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,CACP,CAAC,KAAK,EAAE,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACnD,CAAC,KAAc,EAAE,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAC5D,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAO,KAA6B;IAC3D,IAAI,OAA+B,CAAC;IACpC,OAAO,CAAC,GAAG,EAAE,EAAE;QACb,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC"}
|