@tangle-network/agent-eval 0.122.2 → 0.122.3
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/analyst/index.js +3 -4
- package/dist/analyst/index.js.map +1 -1
- package/dist/benchmarks/index.js +3 -4
- package/dist/campaign/index.d.ts +6 -0
- package/dist/campaign/index.js +3 -4
- package/dist/{chunk-U4R2AGY5.js → chunk-DHJJACEX.js} +40 -30
- package/dist/{chunk-U4R2AGY5.js.map → chunk-DHJJACEX.js.map} +1 -1
- package/dist/{chunk-5CVUPHJ4.js → chunk-EAWKAVID.js} +74 -1
- package/dist/chunk-EAWKAVID.js.map +1 -0
- package/dist/{chunk-EXMKNOP5.js → chunk-IDC74VDL.js} +28 -21
- package/dist/chunk-IDC74VDL.js.map +1 -0
- package/dist/{chunk-5BYTIDZ7.js → chunk-SFXDMFGV.js} +2 -2
- package/dist/{chunk-XKSDSGSC.js → chunk-ULW7AATT.js} +3 -5
- package/dist/{chunk-XKSDSGSC.js.map → chunk-ULW7AATT.js.map} +1 -1
- package/dist/contract/index.d.ts +3 -0
- package/dist/contract/index.js +3 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/package.json +1 -1
- package/dist/chunk-3YYRZDON.js +0 -45
- package/dist/chunk-3YYRZDON.js.map +0 -1
- package/dist/chunk-5CVUPHJ4.js.map +0 -1
- package/dist/chunk-EXMKNOP5.js.map +0 -1
- /package/dist/{chunk-5BYTIDZ7.js.map → chunk-SFXDMFGV.js.map} +0 -0
|
@@ -1863,6 +1863,77 @@ function selectPriorFindings(source, analystId) {
|
|
|
1863
1863
|
return merged.length > 0 ? merged : void 0;
|
|
1864
1864
|
}
|
|
1865
1865
|
|
|
1866
|
+
// src/concurrency.ts
|
|
1867
|
+
var Mutex = class {
|
|
1868
|
+
locked = false;
|
|
1869
|
+
waiters = [];
|
|
1870
|
+
async acquire() {
|
|
1871
|
+
if (!this.locked) {
|
|
1872
|
+
this.locked = true;
|
|
1873
|
+
return () => this.release();
|
|
1874
|
+
}
|
|
1875
|
+
return new Promise((resolve) => {
|
|
1876
|
+
this.waiters.push(() => {
|
|
1877
|
+
resolve(() => this.release());
|
|
1878
|
+
});
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1881
|
+
release() {
|
|
1882
|
+
const next = this.waiters.shift();
|
|
1883
|
+
if (next) {
|
|
1884
|
+
next();
|
|
1885
|
+
} else {
|
|
1886
|
+
this.locked = false;
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
async runExclusive(fn) {
|
|
1890
|
+
const release = await this.acquire();
|
|
1891
|
+
try {
|
|
1892
|
+
return await fn();
|
|
1893
|
+
} finally {
|
|
1894
|
+
release();
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
/** True iff someone holds the lock right now. Diagnostics only. */
|
|
1898
|
+
get isLocked() {
|
|
1899
|
+
return this.locked;
|
|
1900
|
+
}
|
|
1901
|
+
/** Pending waiter count. Diagnostics only. */
|
|
1902
|
+
get pending() {
|
|
1903
|
+
return this.waiters.length;
|
|
1904
|
+
}
|
|
1905
|
+
};
|
|
1906
|
+
async function mapConcurrent(items, concurrency, map) {
|
|
1907
|
+
if (!Number.isInteger(concurrency) || concurrency < 1) {
|
|
1908
|
+
throw new Error(`mapConcurrent: concurrency must be a positive integer, got ${concurrency}`);
|
|
1909
|
+
}
|
|
1910
|
+
if (items.length === 0) return [];
|
|
1911
|
+
const results = new Array(items.length);
|
|
1912
|
+
let nextIndex = 0;
|
|
1913
|
+
let stopped = false;
|
|
1914
|
+
let failed = false;
|
|
1915
|
+
let failure;
|
|
1916
|
+
const worker = async () => {
|
|
1917
|
+
while (!stopped) {
|
|
1918
|
+
const index = nextIndex;
|
|
1919
|
+
nextIndex += 1;
|
|
1920
|
+
if (index >= items.length) return;
|
|
1921
|
+
try {
|
|
1922
|
+
results[index] = await map(items[index], index);
|
|
1923
|
+
} catch (error) {
|
|
1924
|
+
stopped = true;
|
|
1925
|
+
if (!failed) {
|
|
1926
|
+
failed = true;
|
|
1927
|
+
failure = error;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
};
|
|
1932
|
+
await Promise.all(Array.from({ length: Math.min(concurrency, items.length) }, () => worker()));
|
|
1933
|
+
if (failed) throw failure;
|
|
1934
|
+
return results;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1866
1937
|
// src/analyst/steer-firewall.ts
|
|
1867
1938
|
var OBSERVABLE_KINDS = /* @__PURE__ */ new Set([
|
|
1868
1939
|
"span",
|
|
@@ -2643,6 +2714,8 @@ export {
|
|
|
2643
2714
|
KNOWLEDGE_POISONING_KIND_SPEC,
|
|
2644
2715
|
DEFAULT_TRACE_ANALYST_KINDS,
|
|
2645
2716
|
AnalystRegistry,
|
|
2717
|
+
Mutex,
|
|
2718
|
+
mapConcurrent,
|
|
2646
2719
|
isTraceObservable,
|
|
2647
2720
|
isJudgeVerdict,
|
|
2648
2721
|
assertNoJudgeVerdict,
|
|
@@ -2665,4 +2738,4 @@ export {
|
|
|
2665
2738
|
aggregateRunScore,
|
|
2666
2739
|
clamp012 as clamp01
|
|
2667
2740
|
};
|
|
2668
|
-
//# sourceMappingURL=chunk-
|
|
2741
|
+
//# sourceMappingURL=chunk-EAWKAVID.js.map
|