@tangle-network/agent-eval 0.102.0 → 0.103.0

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 (80) hide show
  1. package/dist/adapters/http.d.ts +2 -2
  2. package/dist/adapters/langchain.d.ts +2 -2
  3. package/dist/adapters/otel.d.ts +4 -4
  4. package/dist/analyst/index.d.ts +8 -8
  5. package/dist/{analyze-runs-BlJRBniC.d.ts → analyze-runs-Cd-A_K4l.d.ts} +3 -3
  6. package/dist/belief-state/index.d.ts +3 -3
  7. package/dist/benchmarks/index.d.ts +2 -2
  8. package/dist/campaign/index.d.ts +14 -14
  9. package/dist/campaign/index.js +34 -11
  10. package/dist/campaign/index.js.map +1 -1
  11. package/dist/{chunk-G6S73VA7.js → chunk-2NSLDY4B.js} +3 -2
  12. package/dist/{chunk-G6S73VA7.js.map → chunk-2NSLDY4B.js.map} +1 -1
  13. package/dist/{chunk-4LWD6GC7.js → chunk-6FIAJHCU.js} +2 -2
  14. package/dist/{chunk-PMF5WIBX.js → chunk-7RBJANJD.js} +2 -2
  15. package/dist/{chunk-BOETF6BU.js → chunk-B2TMQM62.js} +2 -2
  16. package/dist/{chunk-QUCGGMYM.js → chunk-HV5PBTJF.js} +3 -3
  17. package/dist/{chunk-CMJSTXUR.js → chunk-IXOV77YF.js} +105 -18
  18. package/dist/chunk-IXOV77YF.js.map +1 -0
  19. package/dist/{chunk-52CCCXU3.js → chunk-NTVWIH24.js} +104 -43
  20. package/dist/chunk-NTVWIH24.js.map +1 -0
  21. package/dist/chunk-RQNOLV3I.js +855 -0
  22. package/dist/chunk-RQNOLV3I.js.map +1 -0
  23. package/dist/{chunk-JCUREYF5.js → chunk-U3IDYATS.js} +2 -2
  24. package/dist/{chunk-LSCBODPQ.js → chunk-XKA6ZGEY.js} +11 -2
  25. package/dist/chunk-XKA6ZGEY.js.map +1 -0
  26. package/dist/{code-agent-session-B6ZcDwyA.d.ts → code-agent-session-Ce-9u7YM.d.ts} +1 -1
  27. package/dist/contract/index.d.ts +16 -16
  28. package/dist/contract/index.js +5 -5
  29. package/dist/{control-DC8TELh0.d.ts → control-C8RmK9H4.d.ts} +1 -1
  30. package/dist/control.d.ts +2 -2
  31. package/dist/control.js +2 -2
  32. package/dist/{corpus-ONOzGFmG.d.ts → corpus-CiSzzLa5.d.ts} +1 -1
  33. package/dist/{default-registry-Dhrc__SE.d.ts → default-registry-ZhqsTr4K.d.ts} +2 -2
  34. package/dist/diagnose.d.ts +3 -3
  35. package/dist/diagnose.js +1 -1
  36. package/dist/{gepa-bxuDoaO9.d.ts → gepa-DeyPTlvx.d.ts} +1 -1
  37. package/dist/hosted/index.d.ts +4 -4
  38. package/dist/{index-W96macmS.d.ts → index-B-bFgiAF.d.ts} +1 -1
  39. package/dist/index.d.ts +27 -23
  40. package/dist/index.js +26 -10
  41. package/dist/index.js.map +1 -1
  42. package/dist/{insight-report-C02J3q4T.d.ts → insight-report-k0sRTzKg.d.ts} +1 -1
  43. package/dist/{kind-factory-OgqQSvLi.d.ts → kind-factory-D0nk7AKV.d.ts} +1 -1
  44. package/dist/meta-eval/index.d.ts +2 -2
  45. package/dist/multishot/index.d.ts +2 -2
  46. package/dist/openapi.json +1 -1
  47. package/dist/{policy-edit-Dccm9tyA.d.ts → policy-edit-BDQzzsBU.d.ts} +2 -2
  48. package/dist/{pre-registration-BjGZf9YA.d.ts → pre-registration-mWG2w8d-.d.ts} +45 -12
  49. package/dist/product-benchmark/index.d.ts +104 -1
  50. package/dist/product-benchmark/index.js +15 -1
  51. package/dist/{provenance-BEITkFII.d.ts → provenance-BhJm32vN.d.ts} +3 -3
  52. package/dist/{release-report-B1tA6pKu.d.ts → release-report-BQ1Ziyu-.d.ts} +2 -2
  53. package/dist/reporting.d.ts +4 -4
  54. package/dist/{researcher-Ba2y1Foi.d.ts → researcher-B_ODTAJs.d.ts} +2 -2
  55. package/dist/rl.d.ts +8 -8
  56. package/dist/rl.js +2 -2
  57. package/dist/{rubric-predictive-validity-w7tun-q3.d.ts → rubric-predictive-validity-0MdjTt8R.d.ts} +1 -1
  58. package/dist/{run-campaign-RF3H6D4U.js → run-campaign-2L4WCJHR.js} +2 -2
  59. package/dist/{run-record-DEwidcqn.d.ts → run-record-MRdJ-Kq2.d.ts} +12 -1
  60. package/dist/{runtime-trajectory-OJDaTYHN.d.ts → runtime-trajectory-8w0_jmtR.d.ts} +1 -1
  61. package/dist/{semantic-concept-judge-J8xvjdc3.d.ts → semantic-concept-judge-D-IlH5v1.d.ts} +2 -2
  62. package/dist/{summary-report-C4uzRWh8.d.ts → summary-report-C0nnxOD8.d.ts} +1 -1
  63. package/dist/traces.d.ts +1 -1
  64. package/dist/traces.js +2 -2
  65. package/dist/{types-fWqEJm7h.d.ts → types-DFI_Z-ZL.d.ts} +18 -1
  66. package/dist/{types-BEzCBMQD.d.ts → types-Dz9cKF0g.d.ts} +1 -1
  67. package/dist/workflow/index.d.ts +4 -4
  68. package/dist/workflow/index.js +1 -1
  69. package/package.json +1 -1
  70. package/dist/chunk-52CCCXU3.js.map +0 -1
  71. package/dist/chunk-63MBSQTX.js +0 -350
  72. package/dist/chunk-63MBSQTX.js.map +0 -1
  73. package/dist/chunk-CMJSTXUR.js.map +0 -1
  74. package/dist/chunk-LSCBODPQ.js.map +0 -1
  75. /package/dist/{chunk-4LWD6GC7.js.map → chunk-6FIAJHCU.js.map} +0 -0
  76. /package/dist/{chunk-PMF5WIBX.js.map → chunk-7RBJANJD.js.map} +0 -0
  77. /package/dist/{chunk-BOETF6BU.js.map → chunk-B2TMQM62.js.map} +0 -0
  78. /package/dist/{chunk-QUCGGMYM.js.map → chunk-HV5PBTJF.js.map} +0 -0
  79. /package/dist/{chunk-JCUREYF5.js.map → chunk-U3IDYATS.js.map} +0 -0
  80. /package/dist/{run-campaign-RF3H6D4U.js.map → run-campaign-2L4WCJHR.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  runCampaign,
3
3
  summarizeBackendIntegrity
4
- } from "./chunk-LSCBODPQ.js";
4
+ } from "./chunk-XKA6ZGEY.js";
5
5
  import {
6
6
  callLlm
7
7
  } from "./chunk-CWNP4DV4.js";
@@ -764,6 +764,106 @@ function mean(xs) {
764
764
  return xs.reduce((s, x) => s + x, 0) / xs.length;
765
765
  }
766
766
 
767
+ // src/json-recovery.ts
768
+ function autoCloseTruncatedJson(raw) {
769
+ const stack = [];
770
+ let inString = false;
771
+ let escaped = false;
772
+ for (const c of raw) {
773
+ if (escaped) {
774
+ escaped = false;
775
+ continue;
776
+ }
777
+ if (inString) {
778
+ if (c === "\\") {
779
+ escaped = true;
780
+ continue;
781
+ }
782
+ if (c === '"') {
783
+ inString = false;
784
+ continue;
785
+ }
786
+ continue;
787
+ }
788
+ if (c === '"') {
789
+ inString = true;
790
+ continue;
791
+ }
792
+ if (c === "{" || c === "[") stack.push(c);
793
+ else if (c === "}") {
794
+ if (stack.pop() !== "{") return null;
795
+ } else if (c === "]") {
796
+ if (stack.pop() !== "[") return null;
797
+ }
798
+ }
799
+ if (stack.length === 0 && !inString) return raw;
800
+ let suffix = "";
801
+ if (escaped) suffix += "\\";
802
+ if (inString) suffix += '"';
803
+ while (stack.length > 0) {
804
+ const opener = stack.pop();
805
+ suffix += opener === "{" ? "}" : "]";
806
+ }
807
+ return raw + suffix;
808
+ }
809
+ var UNPARSEABLE = /* @__PURE__ */ Symbol("unparseable");
810
+ function tryParse(candidate) {
811
+ try {
812
+ return JSON.parse(candidate);
813
+ } catch {
814
+ return UNPARSEABLE;
815
+ }
816
+ }
817
+ function lastCommaOutsideString(s) {
818
+ let inString = false;
819
+ let escaped = false;
820
+ let last = -1;
821
+ for (let i = 0; i < s.length; i++) {
822
+ const c = s[i];
823
+ if (escaped) {
824
+ escaped = false;
825
+ continue;
826
+ }
827
+ if (inString) {
828
+ if (c === "\\") escaped = true;
829
+ else if (c === '"') inString = false;
830
+ continue;
831
+ }
832
+ if (c === '"') inString = true;
833
+ else if (c === ",") last = i;
834
+ }
835
+ return last;
836
+ }
837
+ function recoverTruncatedJson(text) {
838
+ const objStart = text.indexOf("{");
839
+ const arrStart = text.indexOf("[");
840
+ const starts = [objStart, arrStart].filter((i) => i >= 0).sort((a, b) => a - b);
841
+ for (const start of starts) {
842
+ const recovered = recoverFrom(text.slice(start));
843
+ if (recovered !== UNPARSEABLE) return recovered;
844
+ }
845
+ return null;
846
+ }
847
+ function recoverFrom(slice) {
848
+ let candidate = slice;
849
+ const lastClose = Math.max(candidate.lastIndexOf("}"), candidate.lastIndexOf("]"));
850
+ if (lastClose > 0) {
851
+ const balanced = tryParse(candidate.slice(0, lastClose + 1));
852
+ if (balanced !== UNPARSEABLE) return balanced;
853
+ }
854
+ for (let i = 0; i < 64; i++) {
855
+ const closed = autoCloseTruncatedJson(candidate);
856
+ if (closed !== null) {
857
+ const parsed = tryParse(closed);
858
+ if (parsed !== UNPARSEABLE) return parsed;
859
+ }
860
+ const cut = lastCommaOutsideString(candidate);
861
+ if (cut <= 0) return UNPARSEABLE;
862
+ candidate = candidate.slice(0, cut);
863
+ }
864
+ return UNPARSEABLE;
865
+ }
866
+
767
867
  // src/reflective-mutation.ts
768
868
  var DEFAULT_MUTATION_PRIMITIVES = [
769
869
  'Strengthen an imperative ("should" \u2192 "must")',
@@ -888,46 +988,6 @@ function truncate(s, max) {
888
988
  function quote(s) {
889
989
  return s.replace(/`/g, "\\`");
890
990
  }
891
- function autoCloseTruncatedJson(raw) {
892
- const stack = [];
893
- let inString = false;
894
- let escaped = false;
895
- for (const c of raw) {
896
- if (escaped) {
897
- escaped = false;
898
- continue;
899
- }
900
- if (inString) {
901
- if (c === "\\") {
902
- escaped = true;
903
- continue;
904
- }
905
- if (c === '"') {
906
- inString = false;
907
- continue;
908
- }
909
- continue;
910
- }
911
- if (c === '"') {
912
- inString = true;
913
- continue;
914
- }
915
- if (c === "{" || c === "[") stack.push(c);
916
- else if (c === "}") {
917
- if (stack.pop() !== "{") return null;
918
- } else if (c === "]") {
919
- if (stack.pop() !== "[") return null;
920
- }
921
- }
922
- if (stack.length === 0 && !inString) return raw;
923
- let suffix = "";
924
- if (inString) suffix += '"';
925
- while (stack.length > 0) {
926
- const opener = stack.pop();
927
- suffix += opener === "{" ? "}" : "]";
928
- }
929
- return raw + suffix;
930
- }
931
991
  function parseReflectionResponse(raw, maxProposals) {
932
992
  let text = raw.trim();
933
993
  if (text.startsWith("```")) text = text.replace(/^```(?:json)?\n?/, "").replace(/\n?```$/, "");
@@ -1400,7 +1460,7 @@ async function runImprovementLoop(opts) {
1400
1460
  const dispatchTimeoutMs = opts.dispatchTimeoutMs ?? DEFAULT_DISPATCH_TIMEOUT_MS;
1401
1461
  const optimization = await runOptimization({ ...opts, dispatchTimeoutMs });
1402
1462
  const winnerIsBaseline = optimization.winnerSurfaceHash === surfaceHash(opts.baselineSurface);
1403
- const { runCampaign: runCampaign2 } = await import("./run-campaign-RF3H6D4U.js");
1463
+ const { runCampaign: runCampaign2 } = await import("./run-campaign-2L4WCJHR.js");
1404
1464
  const baselineOnHoldout = await runCampaign2({
1405
1465
  ...opts,
1406
1466
  dispatchTimeoutMs,
@@ -1930,6 +1990,7 @@ async function emitLoopProvenance(args) {
1930
1990
  }
1931
1991
 
1932
1992
  export {
1993
+ recoverTruncatedJson,
1933
1994
  dominates,
1934
1995
  paretoFrontier,
1935
1996
  scalarScore,
@@ -1968,4 +2029,4 @@ export {
1968
2029
  provenanceSpansPath,
1969
2030
  emitLoopProvenance
1970
2031
  };
1971
- //# sourceMappingURL=chunk-52CCCXU3.js.map
2032
+ //# sourceMappingURL=chunk-NTVWIH24.js.map