@remnic/core 9.35.1 → 9.35.2

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/dist/index.js CHANGED
@@ -109,7 +109,7 @@ import {
109
109
  watchForChanges,
110
110
  writeManifest,
111
111
  writeMeetingEpisodeMemory
112
- } from "./chunk-2NUC473W.js";
112
+ } from "./chunk-FHYGLITW.js";
113
113
  import {
114
114
  WEARABLE_SOURCE_PREFIX,
115
115
  buildExtractionTurns,
@@ -215,7 +215,7 @@ import "./chunk-I6WYQSX4.js";
215
215
  import {
216
216
  CODEX_THREAD_KEY_PREFIX
217
217
  } from "./chunk-4EX5WZ4M.js";
218
- import "./chunk-NQUF7XKR.js";
218
+ import "./chunk-FT4RF53O.js";
219
219
  import "./chunk-6DNMUYEE.js";
220
220
  import {
221
221
  buildTargetedFactRecallSection,
@@ -286,7 +286,7 @@ import {
286
286
  import "./chunk-LTHVM4XN.js";
287
287
  import {
288
288
  ExtractionEngine
289
- } from "./chunk-DP7ZV2II.js";
289
+ } from "./chunk-OA6PIPDE.js";
290
290
  import "./chunk-4RA3C3EV.js";
291
291
  import "./chunk-B6XHIBIB.js";
292
292
  import "./chunk-CMQZNEIF.js";
@@ -295,8 +295,8 @@ import "./chunk-2CGLBUW3.js";
295
295
  import {
296
296
  ModelRegistry
297
297
  } from "./chunk-WLZYGLJ4.js";
298
- import "./chunk-ZCPP5OW6.js";
299
- import "./chunk-4RNZMRAV.js";
298
+ import "./chunk-JQSBRLJ6.js";
299
+ import "./chunk-WKDFJXW5.js";
300
300
  import "./chunk-JUXOTY6J.js";
301
301
  import "./chunk-YIAA2X3D.js";
302
302
  import "./chunk-WOCNN776.js";
@@ -3,5 +3,67 @@ declare function waitForRetryBackoff(backoffMs: number, signal?: AbortSignal): P
3
3
  declare function normalizeBackendTripReason(reason: string): string;
4
4
  declare function extractNonRecoverableBackendReason(reason: string): string | null;
5
5
  declare function extractNonRecoverableBackendReasonFromErrorText(errorText: string): string | null;
6
+ /**
7
+ * Flatten a fetch rejection into one line, including the `cause` undici hides
8
+ * the real reason behind (`fetch failed` alone says nothing).
9
+ */
10
+ declare function describeFetchFailure(err: unknown): string;
11
+ /**
12
+ * What to record when every availability probe failed.
13
+ *
14
+ * A probe that TIMED OUT is not evidence the backend is down: the budget is a
15
+ * fixed 2s and a busy event loop can burn it before the socket is scheduled,
16
+ * so the backend looks dead while it answers other callers in single-digit ms.
17
+ * Caching that verdict took extraction offline for a whole health-check
18
+ * interval at a time (issue #2210), so a timeout leaves availability UNKNOWN —
19
+ * this call fails, the next one re-probes instead of reading a stale false.
20
+ *
21
+ * A backend that ANSWERED and said no is a real verdict and stays cached, or
22
+ * the daemon re-probes a known-bad endpoint on every request.
23
+ */
24
+ declare function resolveUnavailableVerdict(args: {
25
+ baseUrl: string;
26
+ sawAbortedProbe: boolean;
27
+ wasAvailable: boolean | null;
28
+ }): {
29
+ cacheVerdict: boolean;
30
+ warning: string | null;
31
+ };
32
+ interface ProbeFetchResult {
33
+ ok: boolean;
34
+ data: unknown;
35
+ status: number | null;
36
+ /** The probe hit its own budget rather than getting an answer. */
37
+ aborted?: boolean;
38
+ }
39
+ /**
40
+ * One health-probe request.
41
+ *
42
+ * Every failure is logged with its cause: a transport error and a 404 both
43
+ * returned `ok: false` with nothing recorded, so an unreachable backend was
44
+ * indistinguishable from a wrong path and an availability failure had no
45
+ * diagnosable reason at all (§22, issue #2210).
46
+ */
47
+ declare function probeFetch(url: string, options: {
48
+ timeoutMs: number;
49
+ headers: Record<string, string>;
50
+ signal?: AbortSignal;
51
+ }): Promise<ProbeFetchResult>;
52
+ /**
53
+ * Collapses concurrent probe sequences onto one in-flight run.
54
+ *
55
+ * A timed-out availability probe deliberately caches nothing (issue #2210),
56
+ * which removed the false verdict that used to absorb concurrent callers:
57
+ * every queued request would then run its own full probe sequence, on a host
58
+ * already slow enough to blow the probe budget.
59
+ *
60
+ * Cancellation is refcounted rather than shared: one caller walking away must
61
+ * not abort a sequence the others are still waiting on, so the underlying task
62
+ * is aborted only once every waiter has gone.
63
+ */
64
+ declare class SingleFlightProbe {
65
+ private pending;
66
+ run(task: (signal: AbortSignal) => Promise<boolean>, signal?: AbortSignal): Promise<boolean>;
67
+ }
6
68
 
7
- export { extractNonRecoverableBackendReason, extractNonRecoverableBackendReasonFromErrorText, isAbortError, normalizeBackendTripReason, waitForRetryBackoff };
69
+ export { type ProbeFetchResult, SingleFlightProbe, describeFetchFailure, extractNonRecoverableBackendReason, extractNonRecoverableBackendReasonFromErrorText, isAbortError, normalizeBackendTripReason, probeFetch, resolveUnavailableVerdict, waitForRetryBackoff };
@@ -1,16 +1,25 @@
1
1
  import {
2
+ SingleFlightProbe,
3
+ describeFetchFailure,
2
4
  extractNonRecoverableBackendReason,
3
5
  extractNonRecoverableBackendReasonFromErrorText,
4
6
  isAbortError,
5
7
  normalizeBackendTripReason,
8
+ probeFetch,
9
+ resolveUnavailableVerdict,
6
10
  waitForRetryBackoff
7
- } from "./chunk-4RNZMRAV.js";
11
+ } from "./chunk-WKDFJXW5.js";
12
+ import "./chunk-3WCASNQZ.js";
8
13
  import "./chunk-PZ5AY32C.js";
9
14
  export {
15
+ SingleFlightProbe,
16
+ describeFetchFailure,
10
17
  extractNonRecoverableBackendReason,
11
18
  extractNonRecoverableBackendReasonFromErrorText,
12
19
  isAbortError,
13
20
  normalizeBackendTripReason,
21
+ probeFetch,
22
+ resolveUnavailableVerdict,
14
23
  waitForRetryBackoff
15
24
  };
16
25
  //# sourceMappingURL=local-llm-helpers.js.map
@@ -44,6 +44,7 @@ declare class LocalLlmClient {
44
44
  private config;
45
45
  private isAvailable;
46
46
  private lastHealthCheck;
47
+ private readonly availabilityProbe;
47
48
  private detectedType;
48
49
  private cachedModelInfo;
49
50
  private cachedLmsContext;
@@ -89,7 +90,8 @@ declare class LocalLlmClient {
89
90
  private getTrippedBackendState;
90
91
  private markBackendUnavailable;
91
92
  /**
92
- * Fetch with timeout for health checks
93
+ * Fetch with timeout for health checks. Body lives in the sibling helper so
94
+ * this file stays under its size ceiling (issue #1995).
93
95
  */
94
96
  private fetchWithTimeout;
95
97
  private probeLmStudioNativeModels;
@@ -98,6 +100,7 @@ declare class LocalLlmClient {
98
100
  * Uses 127.0.0.1 instead of localhost to avoid DNS issues (consistent with tactician)
99
101
  */
100
102
  checkAvailability(signal?: AbortSignal): Promise<boolean>;
103
+ private probeAvailability;
101
104
  /**
102
105
  * Try to get context window from LM Studio settings.json as fallback.
103
106
  * This reads the defaultContextLength setting which is what LM Studio uses
package/dist/local-llm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  LocalLlmClient
3
- } from "./chunk-ZCPP5OW6.js";
4
- import "./chunk-4RNZMRAV.js";
3
+ } from "./chunk-JQSBRLJ6.js";
4
+ import "./chunk-WKDFJXW5.js";
5
5
  import "./chunk-JUXOTY6J.js";
6
6
  import "./chunk-O75CRYGF.js";
7
7
  import "./chunk-JUC24CTX.js";
@@ -4,7 +4,7 @@ import {
4
4
  filterRecallCandidates,
5
5
  graphPathRelativeToStorage,
6
6
  mergeGraphExpandedResults
7
- } from "./chunk-2NUC473W.js";
7
+ } from "./chunk-FHYGLITW.js";
8
8
  import "./chunk-UV72DEZD.js";
9
9
  import "./chunk-I74SUMNI.js";
10
10
  import "./chunk-ILNPU5W5.js";
@@ -38,7 +38,7 @@ import "./chunk-KWMXR7XS.js";
38
38
  import "./chunk-UHGBNIOS.js";
39
39
  import "./chunk-I6WYQSX4.js";
40
40
  import "./chunk-4EX5WZ4M.js";
41
- import "./chunk-NQUF7XKR.js";
41
+ import "./chunk-FT4RF53O.js";
42
42
  import "./chunk-6DNMUYEE.js";
43
43
  import "./chunk-T67LUYCR.js";
44
44
  import "./chunk-QFN4U7AG.js";
@@ -66,15 +66,15 @@ import "./chunk-PHRLJFWZ.js";
66
66
  import "./chunk-64NJRYU2.js";
67
67
  import "./chunk-K2TDK7GG.js";
68
68
  import "./chunk-LTHVM4XN.js";
69
- import "./chunk-DP7ZV2II.js";
69
+ import "./chunk-OA6PIPDE.js";
70
70
  import "./chunk-4RA3C3EV.js";
71
71
  import "./chunk-B6XHIBIB.js";
72
72
  import "./chunk-CMQZNEIF.js";
73
73
  import "./chunk-54V4BZWP.js";
74
74
  import "./chunk-2CGLBUW3.js";
75
75
  import "./chunk-WLZYGLJ4.js";
76
- import "./chunk-ZCPP5OW6.js";
77
- import "./chunk-4RNZMRAV.js";
76
+ import "./chunk-JQSBRLJ6.js";
77
+ import "./chunk-WKDFJXW5.js";
78
78
  import "./chunk-JUXOTY6J.js";
79
79
  import "./chunk-YIAA2X3D.js";
80
80
  import "./chunk-WOCNN776.js";