@tangle-network/agent-eval 0.122.2 → 0.122.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.
Files changed (34) hide show
  1. package/dist/analyst/index.js +3 -4
  2. package/dist/analyst/index.js.map +1 -1
  3. package/dist/benchmarks/index.js +5 -6
  4. package/dist/campaign/index.d.ts +273 -252
  5. package/dist/campaign/index.js +8 -5
  6. package/dist/{chunk-N3QPYIVG.js → chunk-4R4GTZBZ.js} +10 -10
  7. package/dist/{chunk-EXMKNOP5.js → chunk-75OCWDXJ.js} +137 -43
  8. package/dist/chunk-75OCWDXJ.js.map +1 -0
  9. package/dist/{chunk-BD2OK6ZW.js → chunk-7GLJX32M.js} +2 -2
  10. package/dist/{chunk-5CVUPHJ4.js → chunk-EAWKAVID.js} +74 -1
  11. package/dist/chunk-EAWKAVID.js.map +1 -0
  12. package/dist/{chunk-OZFTLMGS.js → chunk-GTSVLG2M.js} +2 -2
  13. package/dist/{chunk-U4R2AGY5.js → chunk-MWN2X7C5.js} +42 -32
  14. package/dist/{chunk-U4R2AGY5.js.map → chunk-MWN2X7C5.js.map} +1 -1
  15. package/dist/{chunk-5BYTIDZ7.js → chunk-SFXDMFGV.js} +2 -2
  16. package/dist/{chunk-XKSDSGSC.js → chunk-ULW7AATT.js} +3 -5
  17. package/dist/{chunk-XKSDSGSC.js.map → chunk-ULW7AATT.js.map} +1 -1
  18. package/dist/contract/index.d.ts +3 -0
  19. package/dist/contract/index.js +5 -5
  20. package/dist/index.d.ts +36 -30
  21. package/dist/index.js +11 -11
  22. package/dist/index.js.map +1 -1
  23. package/dist/openapi.json +1 -1
  24. package/dist/{run-campaign-2YJ3Z6JS.js → run-campaign-J6RHX2VO.js} +2 -2
  25. package/package.json +1 -1
  26. package/dist/chunk-3YYRZDON.js +0 -45
  27. package/dist/chunk-3YYRZDON.js.map +0 -1
  28. package/dist/chunk-5CVUPHJ4.js.map +0 -1
  29. package/dist/chunk-EXMKNOP5.js.map +0 -1
  30. /package/dist/{chunk-N3QPYIVG.js.map → chunk-4R4GTZBZ.js.map} +0 -0
  31. /package/dist/{chunk-BD2OK6ZW.js.map → chunk-7GLJX32M.js.map} +0 -0
  32. /package/dist/{chunk-OZFTLMGS.js.map → chunk-GTSVLG2M.js.map} +0 -0
  33. /package/dist/{chunk-5BYTIDZ7.js.map → chunk-SFXDMFGV.js.map} +0 -0
  34. /package/dist/{run-campaign-2YJ3Z6JS.js.map → run-campaign-J6RHX2VO.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  summarizeBackendIntegrity
3
- } from "./chunk-N3QPYIVG.js";
3
+ } from "./chunk-4R4GTZBZ.js";
4
4
  import {
5
5
  paretoChart
6
6
  } from "./chunk-DPZAEKA6.js";
@@ -995,4 +995,4 @@ export {
995
995
  summarizeExecution,
996
996
  analyzeRuns
997
997
  };
998
- //# sourceMappingURL=chunk-BD2OK6ZW.js.map
998
+ //# sourceMappingURL=chunk-7GLJX32M.js.map
@@ -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-5CVUPHJ4.js.map
2741
+ //# sourceMappingURL=chunk-EAWKAVID.js.map