reasonix 0.39.0 → 0.39.1

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.
Files changed (38) hide show
  1. package/dist/cli/{chat-QCY6CH7O.js → chat-EVPUW4A4.js} +6 -6
  2. package/dist/cli/{chunk-BQR5TTNY.js → chunk-6TJSZ4J2.js} +2 -2
  3. package/dist/cli/{chunk-5ZCRXN7S.js → chunk-BTSIAOUG.js} +26 -7
  4. package/dist/cli/{chunk-5ZCRXN7S.js.map → chunk-BTSIAOUG.js.map} +1 -1
  5. package/dist/cli/{chunk-AKDDHHE6.js → chunk-CGX5GIW6.js} +2 -2
  6. package/dist/cli/{chunk-TGO7X47P.js → chunk-JBBMMYOI.js} +3 -3
  7. package/dist/cli/{chunk-AJGLCSZS.js → chunk-TWJAH4XD.js} +39 -25
  8. package/dist/cli/chunk-TWJAH4XD.js.map +1 -0
  9. package/dist/cli/{chunk-TPK2CHWR.js → chunk-VM6A6QLY.js} +147 -20
  10. package/dist/cli/chunk-VM6A6QLY.js.map +1 -0
  11. package/dist/cli/{code-3BBVXXY6.js → code-TTOCA52N.js} +6 -6
  12. package/dist/cli/{diff-LXBBKOZA.js → diff-RO2QQBNN.js} +3 -3
  13. package/dist/cli/{doctor-ZBUEBRXP.js → doctor-ISVGUPT2.js} +4 -4
  14. package/dist/cli/index.js +14 -14
  15. package/dist/cli/{replay-TWTUIUUB.js → replay-ZDS4TDXB.js} +3 -3
  16. package/dist/cli/{run-RWBLIICY.js → run-TG7NE73J.js} +4 -4
  17. package/dist/cli/{server-EPU4QONU.js → server-2FXGNQ4F.js} +3 -3
  18. package/dist/cli/{sessions-TWUFHOUX.js → sessions-XFGZNOOJ.js} +4 -4
  19. package/dist/cli/{setup-WHXXHIZV.js → setup-EJAMRGKQ.js} +2 -2
  20. package/dist/cli/{version-RAMBOIYL.js → version-DPEVFI6I.js} +4 -4
  21. package/dist/index.js +61 -28
  22. package/dist/index.js.map +1 -1
  23. package/package.json +1 -3
  24. package/dist/cli/chunk-AJGLCSZS.js.map +0 -1
  25. package/dist/cli/chunk-TPK2CHWR.js.map +0 -1
  26. /package/dist/cli/{chat-QCY6CH7O.js.map → chat-EVPUW4A4.js.map} +0 -0
  27. /package/dist/cli/{chunk-BQR5TTNY.js.map → chunk-6TJSZ4J2.js.map} +0 -0
  28. /package/dist/cli/{chunk-AKDDHHE6.js.map → chunk-CGX5GIW6.js.map} +0 -0
  29. /package/dist/cli/{chunk-TGO7X47P.js.map → chunk-JBBMMYOI.js.map} +0 -0
  30. /package/dist/cli/{code-3BBVXXY6.js.map → code-TTOCA52N.js.map} +0 -0
  31. /package/dist/cli/{diff-LXBBKOZA.js.map → diff-RO2QQBNN.js.map} +0 -0
  32. /package/dist/cli/{doctor-ZBUEBRXP.js.map → doctor-ISVGUPT2.js.map} +0 -0
  33. /package/dist/cli/{replay-TWTUIUUB.js.map → replay-ZDS4TDXB.js.map} +0 -0
  34. /package/dist/cli/{run-RWBLIICY.js.map → run-TG7NE73J.js.map} +0 -0
  35. /package/dist/cli/{server-EPU4QONU.js.map → server-2FXGNQ4F.js.map} +0 -0
  36. /package/dist/cli/{sessions-TWUFHOUX.js.map → sessions-XFGZNOOJ.js.map} +0 -0
  37. /package/dist/cli/{setup-WHXXHIZV.js.map → setup-EJAMRGKQ.js.map} +0 -0
  38. /package/dist/cli/{version-RAMBOIYL.js.map → version-DPEVFI6I.js.map} +0 -0
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  chatCommand
4
- } from "./chunk-TPK2CHWR.js";
4
+ } from "./chunk-VM6A6QLY.js";
5
5
  import "./chunk-BQNUJJN7.js";
6
6
  import "./chunk-7G3SESEU.js";
7
7
  import "./chunk-MRLXEMZ7.js";
8
8
  import "./chunk-CPOV2O73.js";
9
- import "./chunk-5ZCRXN7S.js";
9
+ import "./chunk-BTSIAOUG.js";
10
10
  import "./chunk-SJNIIH5W.js";
11
11
  import "./chunk-XJLZ4HKU.js";
12
12
  import "./chunk-XHQIK7B6.js";
@@ -14,7 +14,7 @@ import "./chunk-DDA76P44.js";
14
14
  import "./chunk-NLV2YORE.js";
15
15
  import "./chunk-SUZRC4NC.js";
16
16
  import "./chunk-MHDNZXJJ.js";
17
- import "./chunk-TGO7X47P.js";
17
+ import "./chunk-JBBMMYOI.js";
18
18
  import "./chunk-AFFZF3MW.js";
19
19
  import "./chunk-DAEAAVDF.js";
20
20
  import "./chunk-KMWKGPFZ.js";
@@ -28,10 +28,10 @@ import "./chunk-NTVW2TWO.js";
28
28
  import "./chunk-6DR4F3MC.js";
29
29
  import "./chunk-FM57FNPJ.js";
30
30
  import "./chunk-4D662BWT.js";
31
- import "./chunk-AKDDHHE6.js";
31
+ import "./chunk-CGX5GIW6.js";
32
32
  import "./chunk-5X7LZJDE.js";
33
33
  import "./chunk-6CXT5JRM.js";
34
- import "./chunk-AJGLCSZS.js";
34
+ import "./chunk-TWJAH4XD.js";
35
35
  import "./chunk-SWLIVNTP.js";
36
36
  import "./chunk-ZTLZO42A.js";
37
37
  import "./chunk-ORM6PK57.js";
@@ -39,4 +39,4 @@ import "./chunk-CRPQUBP6.js";
39
39
  export {
40
40
  chatCommand
41
41
  };
42
- //# sourceMappingURL=chat-QCY6CH7O.js.map
42
+ //# sourceMappingURL=chat-EVPUW4A4.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  t
4
- } from "./chunk-AJGLCSZS.js";
4
+ } from "./chunk-TWJAH4XD.js";
5
5
 
6
6
  // src/cli/ui/RecordView.tsx
7
7
  import { Box, Text } from "ink";
@@ -43,4 +43,4 @@ function truncate(s, max) {
43
43
  export {
44
44
  RecordView
45
45
  };
46
- //# sourceMappingURL=chunk-BQR5TTNY.js.map
46
+ //# sourceMappingURL=chunk-6TJSZ4J2.js.map
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  formatHookOutcomeMessage,
23
23
  runHooks
24
- } from "./chunk-AKDDHHE6.js";
24
+ } from "./chunk-CGX5GIW6.js";
25
25
  import {
26
26
  ignoredByLayers,
27
27
  loadGitignoreAt,
@@ -36,7 +36,7 @@ import {
36
36
  } from "./chunk-6CXT5JRM.js";
37
37
  import {
38
38
  t
39
- } from "./chunk-AJGLCSZS.js";
39
+ } from "./chunk-TWJAH4XD.js";
40
40
  import {
41
41
  DEFAULT_INDEX_EXCLUDES,
42
42
  webSearchEndpoint,
@@ -3784,6 +3784,16 @@ var DEFAULT_TOPK = 5;
3784
3784
  var FETCH_MAX_BYTES = 10 * 1024 * 1024;
3785
3785
  var USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36";
3786
3786
  var MOJEEK_ENDPOINT = "https://www.mojeek.com/search";
3787
+ function searchStatusError(status) {
3788
+ if (status === 429) return t("webErrors.rateLimit429");
3789
+ if (status === 403) return t("webErrors.forbidden403");
3790
+ return t("webErrors.status", { status });
3791
+ }
3792
+ function fetchStatusError(status, url) {
3793
+ if (status === 429) return t("webErrors.fetchRateLimit429", { url });
3794
+ if (status === 403) return t("webErrors.fetchForbidden403", { url });
3795
+ return t("webErrors.fetchStatus", { status, url });
3796
+ }
3787
3797
  async function webSearch(query, opts = {}) {
3788
3798
  if (opts.engine === "searxng") {
3789
3799
  return searchSearxng(query, opts);
@@ -3801,7 +3811,7 @@ async function searchMojeek(query, opts = {}) {
3801
3811
  signal: opts.signal,
3802
3812
  redirect: "follow"
3803
3813
  });
3804
- if (!resp.ok) throw new Error(t("webErrors.status", { status: resp.status }));
3814
+ if (!resp.ok) throw new Error(searchStatusError(resp.status));
3805
3815
  const html = await resp.text();
3806
3816
  const results = parseMojeekResults(html).slice(0, topK);
3807
3817
  if (results.length === 0) {
@@ -3851,7 +3861,7 @@ async function searchSearxng(query, opts = {}) {
3851
3861
  }
3852
3862
  throw err;
3853
3863
  }
3854
- if (!resp.ok) throw new Error(t("webErrors.status", { status: resp.status }));
3864
+ if (!resp.ok) throw new Error(searchStatusError(resp.status));
3855
3865
  const html = await resp.text();
3856
3866
  const results = parseSearxngHtmlResults(html).slice(0, topK);
3857
3867
  if (results.length === 0) {
@@ -3936,7 +3946,11 @@ async function webFetch(url, opts = {}) {
3936
3946
  const maxChars = opts.maxChars ?? DEFAULT_FETCH_MAX_CHARS;
3937
3947
  const timeoutMs = opts.timeoutMs ?? DEFAULT_FETCH_TIMEOUT_MS;
3938
3948
  const ctl = new AbortController();
3939
- const timer = setTimeout(() => ctl.abort(), timeoutMs);
3949
+ let timedOut = false;
3950
+ const timer = setTimeout(() => {
3951
+ timedOut = true;
3952
+ ctl.abort();
3953
+ }, timeoutMs);
3940
3954
  const cancel = () => ctl.abort();
3941
3955
  opts.signal?.addEventListener("abort", cancel, { once: true });
3942
3956
  let resp;
@@ -3946,11 +3960,16 @@ async function webFetch(url, opts = {}) {
3946
3960
  signal: ctl.signal,
3947
3961
  redirect: "follow"
3948
3962
  });
3963
+ } catch (err) {
3964
+ if (timedOut) {
3965
+ throw new Error(t("webErrors.fetchTimeout", { ms: timeoutMs, url }));
3966
+ }
3967
+ throw err;
3949
3968
  } finally {
3950
3969
  clearTimeout(timer);
3951
3970
  opts.signal?.removeEventListener("abort", cancel);
3952
3971
  }
3953
- if (!resp.ok) throw new Error(t("webErrors.fetchStatus", { status: resp.status, url }));
3972
+ if (!resp.ok) throw new Error(fetchStatusError(resp.status, url));
3954
3973
  const contentType = resp.headers.get("content-type") ?? "";
3955
3974
  const declaredLen = Number(resp.headers.get("content-length") ?? "");
3956
3975
  if (Number.isFinite(declaredLen) && declaredLen > FETCH_MAX_BYTES) {
@@ -5208,4 +5227,4 @@ export {
5208
5227
  snapshotBeforeEdits,
5209
5228
  restoreSnapshots
5210
5229
  };
5211
- //# sourceMappingURL=chunk-5ZCRXN7S.js.map
5230
+ //# sourceMappingURL=chunk-BTSIAOUG.js.map