@hyperfixi/mcp-server 2.9.2 → 2.9.4
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/{esm-7SV6EOOG.js → esm-WMQN6QOB.js} +222 -217
- package/dist/index.js +2 -2
- package/package.json +38 -38
|
@@ -145,18 +145,18 @@ function expandSequence(body, isAlphaSequence, max) {
|
|
|
145
145
|
if (n[0] === void 0 || n[1] === void 0) {
|
|
146
146
|
return N;
|
|
147
147
|
}
|
|
148
|
-
const
|
|
148
|
+
const x2 = numeric(n[0]);
|
|
149
149
|
const y = numeric(n[1]);
|
|
150
150
|
const width = Math.max(n[0].length, n[1].length);
|
|
151
151
|
let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
|
|
152
152
|
let test = lte;
|
|
153
|
-
const reverse = y <
|
|
153
|
+
const reverse = y < x2;
|
|
154
154
|
if (reverse) {
|
|
155
155
|
incr *= -1;
|
|
156
156
|
test = gte;
|
|
157
157
|
}
|
|
158
158
|
const pad = n.some(isPadded);
|
|
159
|
-
for (let i =
|
|
159
|
+
for (let i = x2; test(i, y) && N.length < max; i += incr) {
|
|
160
160
|
let c;
|
|
161
161
|
if (isAlphaSequence) {
|
|
162
162
|
c = String.fromCharCode(i);
|
|
@@ -308,7 +308,7 @@ var parseClass = (glob2, position) => {
|
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
if (c === "[" && !escaping) {
|
|
311
|
-
for (const [cls, [unip,
|
|
311
|
+
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
|
|
312
312
|
if (glob2.startsWith(cls, i)) {
|
|
313
313
|
if (rangeStart) {
|
|
314
314
|
return ["$.", false, glob2.length - pos, true];
|
|
@@ -318,7 +318,7 @@ var parseClass = (glob2, position) => {
|
|
|
318
318
|
negs.push(unip);
|
|
319
319
|
else
|
|
320
320
|
ranges.push(unip);
|
|
321
|
-
uflag = uflag ||
|
|
321
|
+
uflag = uflag || u;
|
|
322
322
|
continue WHILE;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
@@ -1836,38 +1836,37 @@ minimatch.unescape = unescape;
|
|
|
1836
1836
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1837
1837
|
|
|
1838
1838
|
// ../../node_modules/lru-cache/dist/esm/node/index.min.js
|
|
1839
|
-
import { tracingChannel as
|
|
1840
|
-
var S =
|
|
1841
|
-
var W =
|
|
1842
|
-
var
|
|
1843
|
-
var
|
|
1839
|
+
import { tracingChannel as G, channel as P } from "diagnostics_channel";
|
|
1840
|
+
var S = P("lru-cache:metrics");
|
|
1841
|
+
var W = G("lru-cache");
|
|
1842
|
+
var L = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
1843
|
+
var R = () => S.hasSubscribers || W.hasSubscribers;
|
|
1844
1844
|
var U = /* @__PURE__ */ new Set();
|
|
1845
|
-
var
|
|
1846
|
-
var
|
|
1847
|
-
typeof
|
|
1845
|
+
var M = typeof process == "object" && process ? process : {};
|
|
1846
|
+
var k = (d3, e, t, i) => {
|
|
1847
|
+
typeof M.emitWarning == "function" ? M.emitWarning(d3, e, t, i) : console.error(`[${t}] ${e}: ${d3}`);
|
|
1848
1848
|
};
|
|
1849
|
-
var H = (
|
|
1850
|
-
var
|
|
1851
|
-
var
|
|
1852
|
-
var j = (u3) => F(u3) ? u3 <= Math.pow(2, 8) ? Uint8Array : u3 <= Math.pow(2, 16) ? Uint16Array : u3 <= Math.pow(2, 32) ? Uint32Array : u3 <= Number.MAX_SAFE_INTEGER ? O : null : null;
|
|
1849
|
+
var H = (d3) => !U.has(d3);
|
|
1850
|
+
var T = (d3) => !!d3 && d3 === Math.floor(d3) && d3 > 0 && isFinite(d3);
|
|
1851
|
+
var j = (d3) => T(d3) ? d3 <= Math.pow(2, 8) ? Uint8Array : d3 <= Math.pow(2, 16) ? Uint16Array : d3 <= Math.pow(2, 32) ? Uint32Array : d3 <= Number.MAX_SAFE_INTEGER ? O : null : null;
|
|
1853
1852
|
var O = class extends Array {
|
|
1854
1853
|
constructor(e) {
|
|
1855
1854
|
super(e), this.fill(0);
|
|
1856
1855
|
}
|
|
1857
1856
|
};
|
|
1858
|
-
var
|
|
1857
|
+
var x = class d {
|
|
1859
1858
|
heap;
|
|
1860
1859
|
length;
|
|
1861
1860
|
static #o = false;
|
|
1862
1861
|
static create(e) {
|
|
1863
1862
|
let t = j(e);
|
|
1864
1863
|
if (!t) return [];
|
|
1865
|
-
|
|
1866
|
-
let i = new
|
|
1867
|
-
return
|
|
1864
|
+
d.#o = true;
|
|
1865
|
+
let i = new d(e, t);
|
|
1866
|
+
return d.#o = false, i;
|
|
1868
1867
|
}
|
|
1869
1868
|
constructor(e, t) {
|
|
1870
|
-
if (!
|
|
1869
|
+
if (!d.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
1871
1870
|
this.heap = new t(e), this.length = 0;
|
|
1872
1871
|
}
|
|
1873
1872
|
push(e) {
|
|
@@ -1877,14 +1876,14 @@ var R = class u {
|
|
|
1877
1876
|
return this.heap[--this.length];
|
|
1878
1877
|
}
|
|
1879
1878
|
};
|
|
1880
|
-
var
|
|
1879
|
+
var I = class d2 {
|
|
1881
1880
|
#o;
|
|
1882
|
-
#
|
|
1883
|
-
#w;
|
|
1884
|
-
#x;
|
|
1881
|
+
#c;
|
|
1885
1882
|
#S;
|
|
1883
|
+
#O;
|
|
1884
|
+
#w;
|
|
1886
1885
|
#M;
|
|
1887
|
-
#
|
|
1886
|
+
#I;
|
|
1888
1887
|
#m;
|
|
1889
1888
|
get perf() {
|
|
1890
1889
|
return this.#m;
|
|
@@ -1904,14 +1903,15 @@ var M = class u2 {
|
|
|
1904
1903
|
allowStaleOnFetchAbort;
|
|
1905
1904
|
allowStaleOnFetchRejection;
|
|
1906
1905
|
ignoreFetchAbort;
|
|
1906
|
+
backgroundFetchSize;
|
|
1907
1907
|
#n;
|
|
1908
1908
|
#b;
|
|
1909
1909
|
#s;
|
|
1910
1910
|
#i;
|
|
1911
1911
|
#t;
|
|
1912
|
-
#a;
|
|
1913
|
-
#c;
|
|
1914
1912
|
#l;
|
|
1913
|
+
#u;
|
|
1914
|
+
#a;
|
|
1915
1915
|
#h;
|
|
1916
1916
|
#y;
|
|
1917
1917
|
#r;
|
|
@@ -1920,12 +1920,12 @@ var M = class u2 {
|
|
|
1920
1920
|
#d;
|
|
1921
1921
|
#g;
|
|
1922
1922
|
#T;
|
|
1923
|
-
#
|
|
1923
|
+
#U;
|
|
1924
1924
|
#f;
|
|
1925
|
-
#
|
|
1925
|
+
#D;
|
|
1926
1926
|
static unsafeExposeInternals(e) {
|
|
1927
|
-
return { starts: e.#F, ttls: e.#d, autopurgeTimers: e.#g, sizes: e.#_, keyMap: e.#s, keyList: e.#i, valList: e.#t, next: e.#
|
|
1928
|
-
return e.#
|
|
1927
|
+
return { starts: e.#F, ttls: e.#d, autopurgeTimers: e.#g, sizes: e.#_, keyMap: e.#s, keyList: e.#i, valList: e.#t, next: e.#l, prev: e.#u, get head() {
|
|
1928
|
+
return e.#a;
|
|
1929
1929
|
}, get tail() {
|
|
1930
1930
|
return e.#h;
|
|
1931
1931
|
}, free: e.#y, isBackgroundFetch: (t) => e.#e(t), backgroundFetch: (t, i, s, n) => e.#P(t, i, s, n), moveToTail: (t) => e.#L(t), indexes: (t) => e.#A(t), rindexes: (t) => e.#z(t), isStale: (t) => e.#p(t) };
|
|
@@ -1934,7 +1934,7 @@ var M = class u2 {
|
|
|
1934
1934
|
return this.#o;
|
|
1935
1935
|
}
|
|
1936
1936
|
get maxSize() {
|
|
1937
|
-
return this.#
|
|
1937
|
+
return this.#c;
|
|
1938
1938
|
}
|
|
1939
1939
|
get calculatedSize() {
|
|
1940
1940
|
return this.#b;
|
|
@@ -1946,134 +1946,139 @@ var M = class u2 {
|
|
|
1946
1946
|
return this.#M;
|
|
1947
1947
|
}
|
|
1948
1948
|
get memoMethod() {
|
|
1949
|
-
return this.#
|
|
1949
|
+
return this.#I;
|
|
1950
1950
|
}
|
|
1951
1951
|
get dispose() {
|
|
1952
|
-
return this.#
|
|
1952
|
+
return this.#S;
|
|
1953
1953
|
}
|
|
1954
1954
|
get onInsert() {
|
|
1955
|
-
return this.#
|
|
1955
|
+
return this.#O;
|
|
1956
1956
|
}
|
|
1957
1957
|
get disposeAfter() {
|
|
1958
|
-
return this.#
|
|
1958
|
+
return this.#w;
|
|
1959
1959
|
}
|
|
1960
1960
|
constructor(e) {
|
|
1961
|
-
let { max: t = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas:
|
|
1962
|
-
if (
|
|
1963
|
-
if (this.#m =
|
|
1961
|
+
let { max: t = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas: l, allowStale: h, dispose: r, onInsert: c, disposeAfter: m, noDisposeOnSet: _, noUpdateTTL: u, maxSize: g = 0, maxEntrySize: f = 0, sizeCalculation: y, fetchMethod: a, memoMethod: w, noDeleteOnFetchRejection: F, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: p, allowStaleOnFetchAbort: A, ignoreFetchAbort: z, backgroundFetchSize: C = 1, perf: E } = e;
|
|
1962
|
+
if (this.backgroundFetchSize = C, E !== void 0 && typeof E?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
1963
|
+
if (this.#m = E ?? L, t !== 0 && !T(t)) throw new TypeError("max option must be a nonnegative integer");
|
|
1964
1964
|
let v = t ? j(t) : Array;
|
|
1965
1965
|
if (!v) throw new Error("invalid max value: " + t);
|
|
1966
|
-
if (this.#o = t, this.#
|
|
1967
|
-
if (!this.#
|
|
1966
|
+
if (this.#o = t, this.#c = g, this.maxEntrySize = f || this.#c, this.sizeCalculation = y, this.sizeCalculation) {
|
|
1967
|
+
if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
1968
1968
|
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
1969
1969
|
}
|
|
1970
|
-
if (
|
|
1971
|
-
if (this.#
|
|
1972
|
-
if (this.#M = a, this.#
|
|
1973
|
-
if (this.#
|
|
1974
|
-
if (!
|
|
1970
|
+
if (w !== void 0 && typeof w != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
1971
|
+
if (this.#I = w, a !== void 0 && typeof a != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
1972
|
+
if (this.#M = a, this.#U = !!a, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: t }).fill(void 0), this.#t = Array.from({ length: t }).fill(void 0), this.#l = new v(t), this.#u = new v(t), this.#a = 0, this.#h = 0, this.#y = x.create(t), this.#n = 0, this.#b = 0, typeof r == "function" && (this.#S = r), typeof c == "function" && (this.#O = c), typeof m == "function" ? (this.#w = m, this.#r = []) : (this.#w = void 0, this.#r = void 0), this.#T = !!this.#S, this.#D = !!this.#O, this.#f = !!this.#w, this.noDisposeOnSet = !!_, this.noUpdateTTL = !!u, this.noDeleteOnFetchRejection = !!F, this.allowStaleOnFetchRejection = !!p, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
|
|
1973
|
+
if (this.#c !== 0 && !T(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
1974
|
+
if (!T(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
1975
1975
|
this.#X();
|
|
1976
1976
|
}
|
|
1977
|
-
if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!
|
|
1978
|
-
if (!
|
|
1979
|
-
this.#
|
|
1977
|
+
if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!l, this.ttlResolution = T(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
|
|
1978
|
+
if (!T(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
1979
|
+
this.#k();
|
|
1980
1980
|
}
|
|
1981
|
-
if (this.#o === 0 && this.ttl === 0 && this.#
|
|
1982
|
-
if (!this.ttlAutopurge && !this.#o && !this.#
|
|
1983
|
-
let
|
|
1984
|
-
H(
|
|
1981
|
+
if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
1982
|
+
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
1983
|
+
let D = "LRU_CACHE_UNBOUNDED";
|
|
1984
|
+
H(D) && (U.add(D), k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", D, d2));
|
|
1985
1985
|
}
|
|
1986
1986
|
}
|
|
1987
1987
|
getRemainingTTL(e) {
|
|
1988
1988
|
return this.#s.has(e) ? 1 / 0 : 0;
|
|
1989
1989
|
}
|
|
1990
|
-
#
|
|
1990
|
+
#k() {
|
|
1991
1991
|
let e = new O(this.#o), t = new O(this.#o);
|
|
1992
1992
|
this.#d = e, this.#F = t;
|
|
1993
1993
|
let i = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
|
|
1994
|
-
this.#g = i, this.#
|
|
1995
|
-
t[
|
|
1996
|
-
}, this.#
|
|
1997
|
-
t[
|
|
1994
|
+
this.#g = i, this.#H = (h, r, c = this.#m.now()) => {
|
|
1995
|
+
t[h] = r !== 0 ? c : 0, e[h] = r, s(h, r);
|
|
1996
|
+
}, this.#R = (h) => {
|
|
1997
|
+
t[h] = e[h] !== 0 ? this.#m.now() : 0, s(h, e[h]);
|
|
1998
1998
|
};
|
|
1999
|
-
let s = this.ttlAutopurge ? (
|
|
2000
|
-
if (i?.[
|
|
2001
|
-
let
|
|
2002
|
-
this.#p(
|
|
2003
|
-
},
|
|
2004
|
-
|
|
1999
|
+
let s = this.ttlAutopurge ? (h, r) => {
|
|
2000
|
+
if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), r && r !== 0 && i) {
|
|
2001
|
+
let c = setTimeout(() => {
|
|
2002
|
+
this.#p(h) ? (this.#E(this.#i[h], "expire"), i[h] = void 0) : s(h, l(h));
|
|
2003
|
+
}, r + 1);
|
|
2004
|
+
c.unref && c.unref(), i[h] = c;
|
|
2005
2005
|
}
|
|
2006
2006
|
} : () => {
|
|
2007
2007
|
};
|
|
2008
|
-
this.#
|
|
2009
|
-
if (e[
|
|
2010
|
-
let
|
|
2011
|
-
if (!
|
|
2012
|
-
|
|
2013
|
-
let
|
|
2014
|
-
|
|
2008
|
+
this.#v = (h, r) => {
|
|
2009
|
+
if (e[r]) {
|
|
2010
|
+
let c = e[r], m = t[r];
|
|
2011
|
+
if (!c || !m) return;
|
|
2012
|
+
h.ttl = c, h.start = m, h.now = n || o();
|
|
2013
|
+
let _ = h.now - m;
|
|
2014
|
+
h.remainingTTL = c - _;
|
|
2015
2015
|
}
|
|
2016
2016
|
};
|
|
2017
2017
|
let n = 0, o = () => {
|
|
2018
|
-
let
|
|
2018
|
+
let h = this.#m.now();
|
|
2019
2019
|
if (this.ttlResolution > 0) {
|
|
2020
|
-
n =
|
|
2021
|
-
let
|
|
2022
|
-
|
|
2020
|
+
n = h;
|
|
2021
|
+
let r = setTimeout(() => n = 0, this.ttlResolution);
|
|
2022
|
+
r.unref && r.unref();
|
|
2023
2023
|
}
|
|
2024
|
-
return
|
|
2024
|
+
return h;
|
|
2025
2025
|
};
|
|
2026
|
-
this.getRemainingTTL = (
|
|
2027
|
-
let
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
let
|
|
2032
|
-
return
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2026
|
+
this.getRemainingTTL = (h) => {
|
|
2027
|
+
let r = this.#s.get(h);
|
|
2028
|
+
return r === void 0 ? 0 : l(r);
|
|
2029
|
+
};
|
|
2030
|
+
let l = (h) => {
|
|
2031
|
+
let r = e[h], c = t[h];
|
|
2032
|
+
if (!r || !c) return 1 / 0;
|
|
2033
|
+
let m = (n || o()) - c;
|
|
2034
|
+
return r - m;
|
|
2035
|
+
};
|
|
2036
|
+
this.#p = (h) => {
|
|
2037
|
+
let r = t[h], c = e[h];
|
|
2038
|
+
return !!c && !!r && (n || o()) - r > c;
|
|
2036
2039
|
};
|
|
2037
2040
|
}
|
|
2038
|
-
#
|
|
2041
|
+
#R = () => {
|
|
2039
2042
|
};
|
|
2040
|
-
#
|
|
2043
|
+
#v = () => {
|
|
2041
2044
|
};
|
|
2042
|
-
#
|
|
2045
|
+
#H = () => {
|
|
2043
2046
|
};
|
|
2044
2047
|
#p = () => false;
|
|
2045
2048
|
#X() {
|
|
2046
2049
|
let e = new O(this.#o);
|
|
2047
|
-
this.#b = 0, this.#_ = e, this.#
|
|
2050
|
+
this.#b = 0, this.#_ = e, this.#x = (t) => {
|
|
2048
2051
|
this.#b -= e[t], e[t] = 0;
|
|
2049
|
-
}, this.#
|
|
2050
|
-
if (
|
|
2051
|
-
|
|
2052
|
-
if (
|
|
2053
|
-
|
|
2054
|
-
|
|
2052
|
+
}, this.#N = (t, i, s, n) => {
|
|
2053
|
+
if (!T(s)) {
|
|
2054
|
+
if (this.#e(i)) return this.backgroundFetchSize;
|
|
2055
|
+
if (n) {
|
|
2056
|
+
if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
|
|
2057
|
+
if (s = n(i, t), !T(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
2058
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
2059
|
+
}
|
|
2055
2060
|
return s;
|
|
2056
|
-
}, this.#
|
|
2057
|
-
if (e[t] = i, this.#
|
|
2058
|
-
let n = this.#
|
|
2061
|
+
}, this.#j = (t, i, s) => {
|
|
2062
|
+
if (e[t] = i, this.#c) {
|
|
2063
|
+
let n = this.#c - e[t];
|
|
2059
2064
|
for (; this.#b > n; ) this.#G(true);
|
|
2060
2065
|
}
|
|
2061
2066
|
this.#b += e[t], s && (s.entrySize = i, s.totalCalculatedSize = this.#b);
|
|
2062
2067
|
};
|
|
2063
2068
|
}
|
|
2064
|
-
#
|
|
2069
|
+
#x = (e) => {
|
|
2065
2070
|
};
|
|
2066
|
-
#
|
|
2071
|
+
#j = (e, t, i) => {
|
|
2067
2072
|
};
|
|
2068
|
-
#
|
|
2073
|
+
#N = (e, t, i, s) => {
|
|
2069
2074
|
if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
2070
2075
|
return 0;
|
|
2071
2076
|
};
|
|
2072
2077
|
*#A({ allowStale: e = this.allowStale } = {}) {
|
|
2073
|
-
if (this.#n) for (let t = this.#h; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#
|
|
2078
|
+
if (this.#n) for (let t = this.#h; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#a); ) t = this.#u[t];
|
|
2074
2079
|
}
|
|
2075
2080
|
*#z({ allowStale: e = this.allowStale } = {}) {
|
|
2076
|
-
if (this.#n) for (let t = this.#
|
|
2081
|
+
if (this.#n) for (let t = this.#a; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#h); ) t = this.#l[t];
|
|
2077
2082
|
}
|
|
2078
2083
|
#V(e) {
|
|
2079
2084
|
return e !== void 0 && this.#s.get(this.#i[e]) === e;
|
|
@@ -2126,7 +2131,7 @@ var M = class u2 {
|
|
|
2126
2131
|
}
|
|
2127
2132
|
purgeStale() {
|
|
2128
2133
|
let e = false;
|
|
2129
|
-
for (let t of this.#z({ allowStale: true })) this.#p(t) && (this.#
|
|
2134
|
+
for (let t of this.#z({ allowStale: true })) this.#p(t) && (this.#E(this.#i[t], "expire"), e = true);
|
|
2130
2135
|
return e;
|
|
2131
2136
|
}
|
|
2132
2137
|
info(e) {
|
|
@@ -2136,9 +2141,9 @@ var M = class u2 {
|
|
|
2136
2141
|
if (s === void 0) return;
|
|
2137
2142
|
let n = { value: s };
|
|
2138
2143
|
if (this.#d && this.#F) {
|
|
2139
|
-
let o = this.#d[t],
|
|
2140
|
-
if (o &&
|
|
2141
|
-
let h = o - (this.#m.now() -
|
|
2144
|
+
let o = this.#d[t], l = this.#F[t];
|
|
2145
|
+
if (o && l) {
|
|
2146
|
+
let h = o - (this.#m.now() - l);
|
|
2142
2147
|
n.ttl = h, n.start = Date.now();
|
|
2143
2148
|
}
|
|
2144
2149
|
}
|
|
@@ -2152,8 +2157,8 @@ var M = class u2 {
|
|
|
2152
2157
|
let o = { value: n };
|
|
2153
2158
|
if (this.#d && this.#F) {
|
|
2154
2159
|
o.ttl = this.#d[t];
|
|
2155
|
-
let
|
|
2156
|
-
o.start = Math.floor(Date.now() -
|
|
2160
|
+
let l = this.#m.now() - this.#F[t];
|
|
2161
|
+
o.start = Math.floor(Date.now() - l);
|
|
2157
2162
|
}
|
|
2158
2163
|
this.#_ && (o.size = this.#_[t]), e.unshift([i, o]);
|
|
2159
2164
|
}
|
|
@@ -2166,51 +2171,49 @@ var M = class u2 {
|
|
|
2166
2171
|
let s = Date.now() - i.start;
|
|
2167
2172
|
i.start = this.#m.now() - s;
|
|
2168
2173
|
}
|
|
2169
|
-
this.#
|
|
2174
|
+
this.#W(t, i.value, i);
|
|
2170
2175
|
}
|
|
2171
2176
|
}
|
|
2172
2177
|
set(e, t, i = {}) {
|
|
2173
2178
|
let { status: s = S.hasSubscribers ? {} : void 0 } = i;
|
|
2174
|
-
i.status = s, s && (s.op = "set", s.key = e, t !== void 0 && (s.value = t));
|
|
2175
|
-
let n = this.#
|
|
2179
|
+
i.status = s, s && (s.op = "set", s.key = e, t !== void 0 && (s.value = t), s.cache = this);
|
|
2180
|
+
let n = this.#W(e, t, i);
|
|
2176
2181
|
return s && S.hasSubscribers && S.publish(s), n;
|
|
2177
2182
|
}
|
|
2178
|
-
#
|
|
2179
|
-
let { ttl:
|
|
2180
|
-
if (t === void 0) return
|
|
2181
|
-
let { noUpdateTTL:
|
|
2182
|
-
|
|
2183
|
-
let
|
|
2184
|
-
if (this.maxEntrySize &&
|
|
2185
|
-
let
|
|
2186
|
-
if (
|
|
2183
|
+
#W(e, t, i, s) {
|
|
2184
|
+
let { ttl: n = this.ttl, start: o, noDisposeOnSet: l = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: r } = i, c = this.#e(t);
|
|
2185
|
+
if (t === void 0) return r && (r.set = "deleted"), this.delete(e), this;
|
|
2186
|
+
let { noUpdateTTL: m = this.noUpdateTTL } = i;
|
|
2187
|
+
r && !c && (r.value = t);
|
|
2188
|
+
let _ = this.#N(e, t, i.size || 0, h, r);
|
|
2189
|
+
if (this.maxEntrySize && _ > this.maxEntrySize) return this.#E(e, "set"), r && (r.set = "miss", r.maxEntrySizeExceeded = true), this;
|
|
2190
|
+
let u = this.#n === 0 ? void 0 : this.#s.get(e);
|
|
2191
|
+
if (u === void 0) u = this.#n === 0 ? this.#h : this.#y.length !== 0 ? this.#y.pop() : this.#n === this.#o ? this.#G(false) : this.#n, this.#i[u] = e, this.#t[u] = t, this.#s.set(e, u), this.#l[this.#h] = u, this.#u[u] = this.#h, this.#h = u, this.#n++, this.#j(u, _, r), r && (r.set = "add"), m = false, this.#D && !c && this.#O?.(t, e, "add");
|
|
2187
2192
|
else {
|
|
2188
|
-
this.#L(
|
|
2189
|
-
let g = this.#t[
|
|
2193
|
+
this.#L(u);
|
|
2194
|
+
let g = this.#t[u];
|
|
2190
2195
|
if (t !== g) {
|
|
2191
|
-
if (
|
|
2192
|
-
g.__abortController.abort(new Error("replaced"));
|
|
2193
|
-
let { __staleWhileFetching:
|
|
2194
|
-
|
|
2195
|
-
} else
|
|
2196
|
-
if (this.#
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
p !== void 0 && (h.oldValue = p);
|
|
2196
|
+
if (!l) if (this.#e(g)) {
|
|
2197
|
+
g !== s && g.__abortController.abort(new Error("replaced"));
|
|
2198
|
+
let { __staleWhileFetching: f } = g;
|
|
2199
|
+
f !== void 0 && f !== t && (this.#T && this.#S?.(f, e, "set"), this.#f && this.#r?.push([f, e, "set"]));
|
|
2200
|
+
} else this.#T && this.#S?.(g, e, "set"), this.#f && this.#r?.push([g, e, "set"]);
|
|
2201
|
+
if (this.#x(u), this.#j(u, _, r), this.#t[u] = t, !c) {
|
|
2202
|
+
let f = g && this.#e(g) ? g.__staleWhileFetching : g, y = f === void 0 ? "add" : t !== f ? "replace" : "update";
|
|
2203
|
+
r && (r.set = y, f !== void 0 && (r.oldValue = f)), this.#D && this.onInsert?.(t, e, y);
|
|
2200
2204
|
}
|
|
2201
|
-
} else
|
|
2202
|
-
this.#j && this.onInsert?.(t, e, t === g ? "update" : "replace");
|
|
2205
|
+
} else c || (r && (r.set = "update"), this.#D && this.onInsert?.(t, e, "update"));
|
|
2203
2206
|
}
|
|
2204
|
-
if (
|
|
2205
|
-
let g = this.#r,
|
|
2206
|
-
for (;
|
|
2207
|
+
if (n !== 0 && !this.#d && this.#k(), this.#d && (m || this.#H(u, n, o), r && this.#v(r, u)), !l && this.#f && this.#r) {
|
|
2208
|
+
let g = this.#r, f;
|
|
2209
|
+
for (; f = g?.shift(); ) this.#w?.(...f);
|
|
2207
2210
|
}
|
|
2208
2211
|
return this;
|
|
2209
2212
|
}
|
|
2210
2213
|
pop() {
|
|
2211
2214
|
try {
|
|
2212
2215
|
for (; this.#n; ) {
|
|
2213
|
-
let e = this.#t[this.#
|
|
2216
|
+
let e = this.#t[this.#a];
|
|
2214
2217
|
if (this.#G(true), this.#e(e)) {
|
|
2215
2218
|
if (e.__staleWhileFetching) return e.__staleWhileFetching;
|
|
2216
2219
|
} else if (e !== void 0) return e;
|
|
@@ -2218,17 +2221,19 @@ var M = class u2 {
|
|
|
2218
2221
|
} finally {
|
|
2219
2222
|
if (this.#f && this.#r) {
|
|
2220
2223
|
let e = this.#r, t;
|
|
2221
|
-
for (; t = e?.shift(); ) this.#
|
|
2224
|
+
for (; t = e?.shift(); ) this.#w?.(...t);
|
|
2222
2225
|
}
|
|
2223
2226
|
}
|
|
2224
2227
|
}
|
|
2225
2228
|
#G(e) {
|
|
2226
|
-
let t = this.#
|
|
2227
|
-
|
|
2229
|
+
let t = this.#a, i = this.#i[t], s = this.#t[t], n = this.#e(s);
|
|
2230
|
+
n && s.__abortController.abort(new Error("evicted"));
|
|
2231
|
+
let o = n ? s.__staleWhileFetching : s;
|
|
2232
|
+
return (this.#T || this.#f) && o !== void 0 && (this.#T && this.#S?.(o, i, "evict"), this.#f && this.#r?.push([o, i, "evict"])), this.#x(t), this.#g?.[t] && (clearTimeout(this.#g[t]), this.#g[t] = void 0), e && (this.#i[t] = void 0, this.#t[t] = void 0, this.#y.push(t)), this.#n === 1 ? (this.#a = this.#h = 0, this.#y.length = 0) : this.#a = this.#l[t], this.#s.delete(i), this.#n--, t;
|
|
2228
2233
|
}
|
|
2229
2234
|
has(e, t = {}) {
|
|
2230
2235
|
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
2231
|
-
t.status = i, i && (i.op = "has", i.key = e);
|
|
2236
|
+
t.status = i, i && (i.op = "has", i.key = e, i.cache = this);
|
|
2232
2237
|
let s = this.#Y(e, t);
|
|
2233
2238
|
return S.hasSubscribers && S.publish(i), s;
|
|
2234
2239
|
}
|
|
@@ -2237,14 +2242,14 @@ var M = class u2 {
|
|
|
2237
2242
|
if (n !== void 0) {
|
|
2238
2243
|
let o = this.#t[n];
|
|
2239
2244
|
if (this.#e(o) && o.__staleWhileFetching === void 0) return false;
|
|
2240
|
-
if (this.#p(n)) s && (s.has = "stale", this.#
|
|
2241
|
-
else return i && this.#
|
|
2245
|
+
if (this.#p(n)) s && (s.has = "stale", this.#v(s, n));
|
|
2246
|
+
else return i && this.#R(n), s && (s.has = "hit", this.#v(s, n)), true;
|
|
2242
2247
|
} else s && (s.has = "miss");
|
|
2243
2248
|
return false;
|
|
2244
2249
|
}
|
|
2245
2250
|
peek(e, t = {}) {
|
|
2246
|
-
let { status: i =
|
|
2247
|
-
i && (i.op = "peek", i.key = e), t.status = i;
|
|
2251
|
+
let { status: i = R() ? {} : void 0 } = t;
|
|
2252
|
+
i && (i.op = "peek", i.key = e, i.cache = this), t.status = i;
|
|
2248
2253
|
let s = this.#J(e, t);
|
|
2249
2254
|
return S.hasSubscribers && S.publish(i), s;
|
|
2250
2255
|
}
|
|
@@ -2254,67 +2259,67 @@ var M = class u2 {
|
|
|
2254
2259
|
i && (i.peek = n === void 0 ? "miss" : "stale");
|
|
2255
2260
|
return;
|
|
2256
2261
|
}
|
|
2257
|
-
let o = this.#t[n],
|
|
2258
|
-
return i && (
|
|
2262
|
+
let o = this.#t[n], l = this.#e(o) ? o.__staleWhileFetching : o;
|
|
2263
|
+
return i && (l !== void 0 ? (i.peek = "hit", i.value = l) : i.peek = "miss"), l;
|
|
2259
2264
|
}
|
|
2260
2265
|
#P(e, t, i, s) {
|
|
2261
2266
|
let n = t === void 0 ? void 0 : this.#t[t];
|
|
2262
2267
|
if (this.#e(n)) return n;
|
|
2263
|
-
let o = new AbortController(), { signal:
|
|
2264
|
-
|
|
2265
|
-
let h = { signal: o.signal, options: i, context: s },
|
|
2266
|
-
let { aborted: a } = o.signal,
|
|
2267
|
-
if (i.status && (a && !y ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason,
|
|
2268
|
-
let b =
|
|
2269
|
-
return (
|
|
2270
|
-
}, c = (
|
|
2271
|
-
let { aborted: a } = o.signal,
|
|
2272
|
-
if (this.#t[t] ===
|
|
2273
|
-
if (
|
|
2274
|
-
},
|
|
2268
|
+
let o = new AbortController(), { signal: l } = i;
|
|
2269
|
+
l?.addEventListener("abort", () => o.abort(l.reason), { signal: o.signal });
|
|
2270
|
+
let h = { signal: o.signal, options: i, context: s }, r = (f, y = false) => {
|
|
2271
|
+
let { aborted: a } = o.signal, w = i.ignoreFetchAbort && f !== void 0, F = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && f !== void 0);
|
|
2272
|
+
if (i.status && (a && !y ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason, w && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), a && !w && !y) return m(o.signal.reason, F);
|
|
2273
|
+
let b = u, p = this.#t[t];
|
|
2274
|
+
return (p === u || p === void 0 && w && y) && (f === void 0 ? b.__staleWhileFetching !== void 0 ? this.#t[t] = b.__staleWhileFetching : this.#E(e, "fetch") : (i.status && (i.status.fetchUpdated = true), this.#W(e, f, h.options, b))), f;
|
|
2275
|
+
}, c = (f) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = f), m(f, false)), m = (f, y) => {
|
|
2276
|
+
let { aborted: a } = o.signal, w = a && i.allowStaleOnFetchAbort, F = w || i.allowStaleOnFetchRejection, b = F || i.noDeleteOnFetchRejection, p = u;
|
|
2277
|
+
if (this.#t[t] === u && (!b || !y && p.__staleWhileFetching === void 0 ? this.#E(e, "fetch") : w || (this.#t[t] = p.__staleWhileFetching)), F) return i.status && p.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), p.__staleWhileFetching;
|
|
2278
|
+
if (p.__returned === p) throw f;
|
|
2279
|
+
}, _ = (f, y) => {
|
|
2275
2280
|
let a = this.#M?.(e, n, h);
|
|
2276
|
-
|
|
2277
|
-
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (
|
|
2278
|
-
});
|
|
2281
|
+
o.signal.addEventListener("abort", () => {
|
|
2282
|
+
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (f(void 0), i.allowStaleOnFetchAbort && (f = (w) => r(w, true)));
|
|
2283
|
+
}), a && a instanceof Promise ? a.then((w) => f(w === void 0 ? void 0 : w), y) : a !== void 0 && f(a);
|
|
2279
2284
|
};
|
|
2280
2285
|
i.status && (i.status.fetchDispatched = true);
|
|
2281
|
-
let
|
|
2282
|
-
return t === void 0 ? (this.#
|
|
2286
|
+
let u = new Promise(_).then(r, c), g = Object.assign(u, { __abortController: o, __staleWhileFetching: n, __returned: void 0 });
|
|
2287
|
+
return t === void 0 ? (this.#W(e, g, { ...h.options, status: void 0 }), t = this.#s.get(e)) : this.#t[t] = g, g;
|
|
2283
2288
|
}
|
|
2284
2289
|
#e(e) {
|
|
2285
|
-
if (!this.#
|
|
2290
|
+
if (!this.#U) return false;
|
|
2286
2291
|
let t = e;
|
|
2287
2292
|
return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
|
|
2288
2293
|
}
|
|
2289
2294
|
fetch(e, t = {}) {
|
|
2290
|
-
let i = W.hasSubscribers, { status: s =
|
|
2295
|
+
let i = W.hasSubscribers, { status: s = R() ? {} : void 0 } = t;
|
|
2291
2296
|
t.status = s, s && t.context && (s.context = t.context);
|
|
2292
2297
|
let n = this.#B(e, t);
|
|
2293
2298
|
return s && i && (s.trace = true, W.tracePromise(() => n, s).catch(() => {
|
|
2294
2299
|
})), n;
|
|
2295
2300
|
}
|
|
2296
2301
|
async #B(e, t = {}) {
|
|
2297
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet:
|
|
2298
|
-
if (a && (a.op = "fetch", a.key = e, y && (a.forceRefresh = true)), !this.#
|
|
2299
|
-
let
|
|
2302
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: l = this.noDisposeOnSet, size: h = 0, sizeCalculation: r = this.sizeCalculation, noUpdateTTL: c = this.noUpdateTTL, noDeleteOnFetchRejection: m = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: _ = this.allowStaleOnFetchRejection, ignoreFetchAbort: u = this.ignoreFetchAbort, allowStaleOnFetchAbort: g = this.allowStaleOnFetchAbort, context: f, forceRefresh: y = false, status: a, signal: w } = t;
|
|
2303
|
+
if (a && (a.op = "fetch", a.key = e, y && (a.forceRefresh = true), a.cache = this), !this.#U) return a && (a.fetch = "get"), this.#C(e, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, status: a });
|
|
2304
|
+
let F = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, ttl: o, noDisposeOnSet: l, size: h, sizeCalculation: r, noUpdateTTL: c, noDeleteOnFetchRejection: m, allowStaleOnFetchRejection: _, allowStaleOnFetchAbort: g, ignoreFetchAbort: u, status: a, signal: w }, b = this.#s.get(e);
|
|
2300
2305
|
if (b === void 0) {
|
|
2301
2306
|
a && (a.fetch = "miss");
|
|
2302
|
-
let
|
|
2303
|
-
return
|
|
2307
|
+
let p = this.#P(e, b, F, f);
|
|
2308
|
+
return p.__returned = p;
|
|
2304
2309
|
} else {
|
|
2305
|
-
let
|
|
2306
|
-
if (this.#e(
|
|
2307
|
-
let
|
|
2308
|
-
return a && (a.fetch = "inflight",
|
|
2310
|
+
let p = this.#t[b];
|
|
2311
|
+
if (this.#e(p)) {
|
|
2312
|
+
let v = i && p.__staleWhileFetching !== void 0;
|
|
2313
|
+
return a && (a.fetch = "inflight", v && (a.returnedStale = true)), v ? p.__staleWhileFetching : p.__returned = p;
|
|
2309
2314
|
}
|
|
2310
2315
|
let A = this.#p(b);
|
|
2311
|
-
if (!y && !A) return a && (a.fetch = "hit"), this.#L(b), s && this.#
|
|
2312
|
-
let z = this.#P(e, b,
|
|
2313
|
-
return a && (a.fetch = A ? "stale" : "refresh",
|
|
2316
|
+
if (!y && !A) return a && (a.fetch = "hit"), this.#L(b), s && this.#R(b), a && this.#v(a, b), p;
|
|
2317
|
+
let z = this.#P(e, b, F, f), E = z.__staleWhileFetching !== void 0 && i;
|
|
2318
|
+
return a && (a.fetch = A ? "stale" : "refresh", E && A && (a.returnedStale = true)), E ? z.__staleWhileFetching : z.__returned = z;
|
|
2314
2319
|
}
|
|
2315
2320
|
}
|
|
2316
2321
|
forceFetch(e, t = {}) {
|
|
2317
|
-
let i = W.hasSubscribers, { status: s =
|
|
2322
|
+
let i = W.hasSubscribers, { status: s = R() ? {} : void 0 } = t;
|
|
2318
2323
|
t.status = s, s && t.context && (s.context = t.context);
|
|
2319
2324
|
let n = this.#K(e, t);
|
|
2320
2325
|
return s && i && (s.trace = true, W.tracePromise(() => n, s).catch(() => {
|
|
@@ -2327,67 +2332,67 @@ var M = class u2 {
|
|
|
2327
2332
|
}
|
|
2328
2333
|
memo(e, t = {}) {
|
|
2329
2334
|
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
2330
|
-
t.status = i, i && (i.op = "memo", i.key = e, t.context && (i.context = t.context));
|
|
2335
|
+
t.status = i, i && (i.op = "memo", i.key = e, t.context && (i.context = t.context), i.cache = this);
|
|
2331
2336
|
let s = this.#Q(e, t);
|
|
2332
2337
|
return i && (i.value = s), S.hasSubscribers && S.publish(i), s;
|
|
2333
2338
|
}
|
|
2334
2339
|
#Q(e, t = {}) {
|
|
2335
|
-
let i = this.#
|
|
2340
|
+
let i = this.#I;
|
|
2336
2341
|
if (!i) throw new Error("no memoMethod provided to constructor");
|
|
2337
|
-
let { context: s, status: n, forceRefresh: o, ...
|
|
2342
|
+
let { context: s, status: n, forceRefresh: o, ...l } = t;
|
|
2338
2343
|
n && o && (n.forceRefresh = true);
|
|
2339
|
-
let h = this.#C(e,
|
|
2340
|
-
if (n && (n.memo =
|
|
2341
|
-
let c = i(e, h, { options:
|
|
2342
|
-
return n && (n.value = c), this.#
|
|
2344
|
+
let h = this.#C(e, l), r = o || h === void 0;
|
|
2345
|
+
if (n && (n.memo = r ? "miss" : "hit", r || (n.value = h)), !r) return h;
|
|
2346
|
+
let c = i(e, h, { options: l, context: s });
|
|
2347
|
+
return n && (n.value = c), this.#W(e, c, l), c;
|
|
2343
2348
|
}
|
|
2344
2349
|
get(e, t = {}) {
|
|
2345
2350
|
let { status: i = S.hasSubscribers ? {} : void 0 } = t;
|
|
2346
|
-
t.status = i, i && (i.op = "get", i.key = e);
|
|
2351
|
+
t.status = i, i && (i.op = "get", i.key = e, i.cache = this);
|
|
2347
2352
|
let s = this.#C(e, t);
|
|
2348
2353
|
return i && (s !== void 0 && (i.value = s), S.hasSubscribers && S.publish(i)), s;
|
|
2349
2354
|
}
|
|
2350
2355
|
#C(e, t = {}) {
|
|
2351
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = t,
|
|
2352
|
-
if (
|
|
2356
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = t, l = this.#s.get(e);
|
|
2357
|
+
if (l === void 0) {
|
|
2353
2358
|
o && (o.get = "miss");
|
|
2354
2359
|
return;
|
|
2355
2360
|
}
|
|
2356
|
-
let h = this.#t[
|
|
2357
|
-
return o && this.#
|
|
2361
|
+
let h = this.#t[l], r = this.#e(h);
|
|
2362
|
+
return o && this.#v(o, l), this.#p(l) ? r ? (o && (o.get = "stale-fetching"), i && h.__staleWhileFetching !== void 0 ? (o && (o.returnedStale = true), h.__staleWhileFetching) : void 0) : (n || this.#E(e, "expire"), o && (o.get = "stale"), i ? (o && (o.returnedStale = true), h) : void 0) : (o && (o.get = r ? "fetching" : "hit"), this.#L(l), s && this.#R(l), r ? h.__staleWhileFetching : h);
|
|
2358
2363
|
}
|
|
2359
2364
|
#$(e, t) {
|
|
2360
|
-
this.#
|
|
2365
|
+
this.#u[t] = e, this.#l[e] = t;
|
|
2361
2366
|
}
|
|
2362
2367
|
#L(e) {
|
|
2363
|
-
e !== this.#h && (e === this.#
|
|
2368
|
+
e !== this.#h && (e === this.#a ? this.#a = this.#l[e] : this.#$(this.#u[e], this.#l[e]), this.#$(this.#h, e), this.#h = e);
|
|
2364
2369
|
}
|
|
2365
2370
|
delete(e) {
|
|
2366
|
-
return this.#
|
|
2371
|
+
return this.#E(e, "delete");
|
|
2367
2372
|
}
|
|
2368
|
-
#
|
|
2369
|
-
S.hasSubscribers && S.publish({ op: "delete", delete: t, key: e });
|
|
2373
|
+
#E(e, t) {
|
|
2374
|
+
S.hasSubscribers && S.publish({ op: "delete", delete: t, key: e, cache: this });
|
|
2370
2375
|
let i = false;
|
|
2371
2376
|
if (this.#n !== 0) {
|
|
2372
2377
|
let s = this.#s.get(e);
|
|
2373
|
-
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g
|
|
2378
|
+
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#q(t);
|
|
2374
2379
|
else {
|
|
2375
|
-
this.#
|
|
2380
|
+
this.#x(s);
|
|
2376
2381
|
let n = this.#t[s];
|
|
2377
|
-
if (this.#e(n) ? n.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#
|
|
2378
|
-
else if (s === this.#
|
|
2382
|
+
if (this.#e(n) ? n.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#S?.(n, e, t), this.#f && this.#r?.push([n, e, t])), this.#s.delete(e), this.#i[s] = void 0, this.#t[s] = void 0, s === this.#h) this.#h = this.#u[s];
|
|
2383
|
+
else if (s === this.#a) this.#a = this.#l[s];
|
|
2379
2384
|
else {
|
|
2380
|
-
let o = this.#
|
|
2381
|
-
this.#
|
|
2382
|
-
let
|
|
2383
|
-
this.#
|
|
2385
|
+
let o = this.#u[s];
|
|
2386
|
+
this.#l[o] = this.#l[s];
|
|
2387
|
+
let l = this.#l[s];
|
|
2388
|
+
this.#u[l] = this.#u[s];
|
|
2384
2389
|
}
|
|
2385
2390
|
this.#n--, this.#y.push(s);
|
|
2386
2391
|
}
|
|
2387
2392
|
}
|
|
2388
2393
|
if (this.#f && this.#r?.length) {
|
|
2389
2394
|
let s = this.#r, n;
|
|
2390
|
-
for (; n = s?.shift(); ) this.#
|
|
2395
|
+
for (; n = s?.shift(); ) this.#w?.(...n);
|
|
2391
2396
|
}
|
|
2392
2397
|
return i;
|
|
2393
2398
|
}
|
|
@@ -2400,7 +2405,7 @@ var M = class u2 {
|
|
|
2400
2405
|
if (this.#e(i)) i.__abortController.abort(new Error("deleted"));
|
|
2401
2406
|
else {
|
|
2402
2407
|
let s = this.#i[t];
|
|
2403
|
-
this.#T && this.#
|
|
2408
|
+
this.#T && this.#S?.(i, s, e), this.#f && this.#r?.push([i, s, e]);
|
|
2404
2409
|
}
|
|
2405
2410
|
}
|
|
2406
2411
|
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
|
|
@@ -2408,9 +2413,9 @@ var M = class u2 {
|
|
|
2408
2413
|
for (let t of this.#g ?? []) t !== void 0 && clearTimeout(t);
|
|
2409
2414
|
this.#g?.fill(void 0);
|
|
2410
2415
|
}
|
|
2411
|
-
if (this.#_ && this.#_.fill(0), this.#
|
|
2416
|
+
if (this.#_ && this.#_.fill(0), this.#a = 0, this.#h = 0, this.#y.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
|
|
2412
2417
|
let t = this.#r, i;
|
|
2413
|
-
for (; i = t?.shift(); ) this.#
|
|
2418
|
+
for (; i = t?.shift(); ) this.#w?.(...i);
|
|
2414
2419
|
}
|
|
2415
2420
|
}
|
|
2416
2421
|
};
|
|
@@ -3349,7 +3354,7 @@ var ENOREALPATH = 512;
|
|
|
3349
3354
|
var ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
|
|
3350
3355
|
var TYPEMASK = 1023;
|
|
3351
3356
|
var entToType = (s) => s.isFile() ? IFREG : s.isDirectory() ? IFDIR : s.isSymbolicLink() ? IFLNK : s.isCharacterDevice() ? IFCHR : s.isBlockDevice() ? IFBLK : s.isSocket() ? IFSOCK : s.isFIFO() ? IFIFO : UNKNOWN;
|
|
3352
|
-
var normalizeCache = new
|
|
3357
|
+
var normalizeCache = new I({ max: 2 ** 12 });
|
|
3353
3358
|
var normalize = (s) => {
|
|
3354
3359
|
const c = normalizeCache.get(s);
|
|
3355
3360
|
if (c)
|
|
@@ -3358,7 +3363,7 @@ var normalize = (s) => {
|
|
|
3358
3363
|
normalizeCache.set(s, n);
|
|
3359
3364
|
return n;
|
|
3360
3365
|
};
|
|
3361
|
-
var normalizeNocaseCache = new
|
|
3366
|
+
var normalizeNocaseCache = new I({ max: 2 ** 12 });
|
|
3362
3367
|
var normalizeNocase = (s) => {
|
|
3363
3368
|
const c = normalizeNocaseCache.get(s);
|
|
3364
3369
|
if (c)
|
|
@@ -3367,12 +3372,12 @@ var normalizeNocase = (s) => {
|
|
|
3367
3372
|
normalizeNocaseCache.set(s, n);
|
|
3368
3373
|
return n;
|
|
3369
3374
|
};
|
|
3370
|
-
var ResolveCache = class extends
|
|
3375
|
+
var ResolveCache = class extends I {
|
|
3371
3376
|
constructor() {
|
|
3372
3377
|
super({ max: 256 });
|
|
3373
3378
|
}
|
|
3374
3379
|
};
|
|
3375
|
-
var ChildrenCache = class extends
|
|
3380
|
+
var ChildrenCache = class extends I {
|
|
3376
3381
|
constructor(maxSize = 16 * 1024) {
|
|
3377
3382
|
super({
|
|
3378
3383
|
maxSize,
|
|
@@ -5343,7 +5348,7 @@ var SubWalks = class {
|
|
|
5343
5348
|
return subs;
|
|
5344
5349
|
}
|
|
5345
5350
|
entries() {
|
|
5346
|
-
return this.keys().map((
|
|
5351
|
+
return this.keys().map((k2) => [k2, this.store.get(k2)]);
|
|
5347
5352
|
}
|
|
5348
5353
|
keys() {
|
|
5349
5354
|
return [...this.store.keys()].filter((t) => t.canReaddir());
|
package/dist/index.js
CHANGED
|
@@ -8087,7 +8087,7 @@ function createInlineExtractor() {
|
|
|
8087
8087
|
const fs = await import("fs");
|
|
8088
8088
|
const path = await import("path");
|
|
8089
8089
|
const crypto = await import("crypto");
|
|
8090
|
-
const { glob } = await import("./esm-
|
|
8090
|
+
const { glob } = await import("./esm-WMQN6QOB.js");
|
|
8091
8091
|
const globs = [
|
|
8092
8092
|
"**/*.html",
|
|
8093
8093
|
"**/*.htm",
|
|
@@ -8728,7 +8728,7 @@ function execShell(cmd, cwd, timeout) {
|
|
|
8728
8728
|
const duration_ms = Date.now() - start;
|
|
8729
8729
|
const output = truncate((stdout ?? "") + (stderr ?? "")).trim();
|
|
8730
8730
|
const timedOut = !!(error && "killed" in error && error.killed);
|
|
8731
|
-
const exitCode = error ? error.code
|
|
8731
|
+
const exitCode = error ? typeof error.code === "number" ? error.code : 1 : 0;
|
|
8732
8732
|
resolve({
|
|
8733
8733
|
exitCode,
|
|
8734
8734
|
output: timedOut ? `Timed out after ${timeout}s` : output,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperfixi/mcp-server",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.4",
|
|
4
4
|
"description": "Model Context Protocol server for HyperFixi hyperscript development",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,31 +37,31 @@
|
|
|
37
37
|
"author": "LokaScript Contributors",
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@hyperfixi/patterns-reference": "^2.9.
|
|
41
|
-
"@lokascript/compilation-service": "^2.9.
|
|
42
|
-
"@lokascript/domain-config": "^2.9.
|
|
43
|
-
"@lokascript/framework": "^2.9.
|
|
44
|
-
"@lokascript/planner": "^2.9.
|
|
45
|
-
"@lokascript/semantic": "^2.9.
|
|
40
|
+
"@hyperfixi/patterns-reference": "^2.9.4",
|
|
41
|
+
"@lokascript/compilation-service": "^2.9.4",
|
|
42
|
+
"@lokascript/domain-config": "^2.9.4",
|
|
43
|
+
"@lokascript/framework": "^2.9.4",
|
|
44
|
+
"@lokascript/planner": "^2.9.4",
|
|
45
|
+
"@lokascript/semantic": "^2.9.4",
|
|
46
46
|
"@modelcontextprotocol/sdk": "^1.25.0",
|
|
47
47
|
"yaml": "^2.8.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@hyperfixi/core": "^2.9.
|
|
51
|
-
"@hyperfixi/patterns-reference": "^2.9.
|
|
52
|
-
"@hyperfixi/server-bridge": "^2.9.
|
|
53
|
-
"@lokascript/compilation-service": "^2.9.
|
|
54
|
-
"@lokascript/domain-bdd": "^2.9.
|
|
55
|
-
"@lokascript/domain-behaviorspec": "^2.9.
|
|
56
|
-
"@lokascript/domain-flow": "^2.9.
|
|
57
|
-
"@lokascript/domain-jsx": "^2.9.
|
|
58
|
-
"@lokascript/domain-learn": "^2.9.
|
|
59
|
-
"@lokascript/domain-llm": "^2.9.
|
|
60
|
-
"@lokascript/domain-sql": "^2.9.
|
|
61
|
-
"@lokascript/domain-todo": "^2.9.
|
|
62
|
-
"@lokascript/domain-voice": "^2.9.
|
|
63
|
-
"@lokascript/framework": "^2.9.
|
|
64
|
-
"@lokascript/semantic": "^2.9.
|
|
50
|
+
"@hyperfixi/core": "^2.9.4",
|
|
51
|
+
"@hyperfixi/patterns-reference": "^2.9.4",
|
|
52
|
+
"@hyperfixi/server-bridge": "^2.9.4",
|
|
53
|
+
"@lokascript/compilation-service": "^2.9.4",
|
|
54
|
+
"@lokascript/domain-bdd": "^2.9.4",
|
|
55
|
+
"@lokascript/domain-behaviorspec": "^2.9.4",
|
|
56
|
+
"@lokascript/domain-flow": "^2.9.4",
|
|
57
|
+
"@lokascript/domain-jsx": "^2.9.4",
|
|
58
|
+
"@lokascript/domain-learn": "^2.9.4",
|
|
59
|
+
"@lokascript/domain-llm": "^2.9.4",
|
|
60
|
+
"@lokascript/domain-sql": "^2.9.4",
|
|
61
|
+
"@lokascript/domain-todo": "^2.9.4",
|
|
62
|
+
"@lokascript/domain-voice": "^2.9.4",
|
|
63
|
+
"@lokascript/framework": "^2.9.4",
|
|
64
|
+
"@lokascript/semantic": "^2.9.4"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"@lokascript/compilation-service": {
|
|
@@ -111,22 +111,22 @@
|
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
|
-
"@hyperfixi/core": "^2.9.
|
|
115
|
-
"@hyperfixi/patterns-reference": "^2.9.
|
|
116
|
-
"@hyperfixi/server-bridge": "^2.9.
|
|
117
|
-
"@lokascript/compilation-service": "^2.9.
|
|
118
|
-
"@lokascript/domain-bdd": "^2.9.
|
|
119
|
-
"@lokascript/domain-behaviorspec": "^2.9.
|
|
120
|
-
"@lokascript/domain-flow": "^2.9.
|
|
121
|
-
"@lokascript/domain-jsx": "^2.9.
|
|
122
|
-
"@lokascript/domain-learn": "^2.9.
|
|
123
|
-
"@lokascript/domain-llm": "^2.9.
|
|
124
|
-
"@lokascript/domain-sql": "^2.9.
|
|
125
|
-
"@lokascript/domain-todo": "^2.9.
|
|
126
|
-
"@lokascript/domain-voice": "^2.9.
|
|
127
|
-
"@lokascript/framework": "^2.9.
|
|
128
|
-
"@lokascript/semantic": "^2.9.
|
|
129
|
-
"@types/node": "^
|
|
114
|
+
"@hyperfixi/core": "^2.9.4",
|
|
115
|
+
"@hyperfixi/patterns-reference": "^2.9.4",
|
|
116
|
+
"@hyperfixi/server-bridge": "^2.9.4",
|
|
117
|
+
"@lokascript/compilation-service": "^2.9.4",
|
|
118
|
+
"@lokascript/domain-bdd": "^2.9.4",
|
|
119
|
+
"@lokascript/domain-behaviorspec": "^2.9.4",
|
|
120
|
+
"@lokascript/domain-flow": "^2.9.4",
|
|
121
|
+
"@lokascript/domain-jsx": "^2.9.4",
|
|
122
|
+
"@lokascript/domain-learn": "^2.9.4",
|
|
123
|
+
"@lokascript/domain-llm": "^2.9.4",
|
|
124
|
+
"@lokascript/domain-sql": "^2.9.4",
|
|
125
|
+
"@lokascript/domain-todo": "^2.9.4",
|
|
126
|
+
"@lokascript/domain-voice": "^2.9.4",
|
|
127
|
+
"@lokascript/framework": "^2.9.4",
|
|
128
|
+
"@lokascript/semantic": "^2.9.4",
|
|
129
|
+
"@types/node": "^26.1.2",
|
|
130
130
|
"tsup": "^8.0.0",
|
|
131
131
|
"tsx": "^4.23.1",
|
|
132
132
|
"typescript": "^5.0.0",
|