@peasant-labs/fairtrade 0.0.61 → 0.0.63

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.
@@ -191,12 +191,12 @@ var w = /* @__PURE__ */ new Set([
191
191
  "EnterWorktree",
192
192
  "SendMessage",
193
193
  "TeamCreate"
194
- ]), ee = /* @__PURE__ */ new Set([
194
+ ]), T = /* @__PURE__ */ new Set([
195
195
  "Write",
196
196
  "Edit",
197
197
  "NotebookEdit"
198
198
  ]);
199
- function T(e) {
199
+ function ee(e) {
200
200
  let t = [], n = [], r = /* @__PURE__ */ new Map();
201
201
  for (let i = 0; i < e.length; i++) {
202
202
  let a = e[i];
@@ -211,7 +211,7 @@ function T(e) {
211
211
  type: "subagent",
212
212
  label: `Subagent: ${e.name}`,
213
213
  severity: "info"
214
- }), ee.has(e.name)) {
214
+ }), T.has(e.name)) {
215
215
  let t = f(e);
216
216
  if (t) {
217
217
  let e = r.get(t) ?? [];
@@ -533,7 +533,7 @@ function W(e) {
533
533
  })).filter(({ tg: t }) => e[t.startIndex]?.role !== "system").map(({ tg: t, i: n }) => _e(t, n, e));
534
534
  }
535
535
  function G(e, t = {}) {
536
- let n = A(e), r = T(e).map((t) => ge(t, e)), i = W(e), a = H(t.scorecard, t.medians), o = {};
536
+ let n = A(e), r = ee(e).map((t) => ge(t, e)), i = W(e), a = H(t.scorecard, t.medians), o = {};
537
537
  return n.length && (o.phases = n), a.length && (o.scorecardBands = a), r.length && (o.patternAnnotations = r), i.length && (o.taskGroups = i), o;
538
538
  }
539
539
  //#endregion
@@ -920,7 +920,7 @@ function nt(t, n) {
920
920
  turnCount: t.turnCount,
921
921
  toolCallCount: t.toolCallCount
922
922
  };
923
- t.project && (r.project = t.project), t.model && (r.model = t.model), t.inputSubmissionCount !== void 0 && (r.inputSubmissionCount = t.inputSubmissionCount), t.purpose && (r.purpose = t.purpose), t.rootSessionId && (r.rootSessionId = t.rootSessionId), dt(t) && (r.hasNormalizedEvidence = !0);
923
+ t.project && (r.project = t.project), t.model && (r.model = t.model), t.inputSubmissionCount !== void 0 && (r.inputSubmissionCount = t.inputSubmissionCount), t.purpose && (r.purpose = t.purpose), t.rootSessionId && (r.rootSessionId = t.rootSessionId), ft(t) && (r.hasNormalizedEvidence = !0);
924
924
  let i = t.workingDirectory ?? t.gitContext?.workingDirectory;
925
925
  return i && (r.workingDirectory = i), t.outcome && (r.outcome = t.outcome), t.scorecard !== void 0 && (r.scorecard = t.scorecard), n && (r.git = n), r;
926
926
  }
@@ -969,7 +969,7 @@ function at(e) {
969
969
  }
970
970
  function ot(e) {
971
971
  let t = /* @__PURE__ */ new Map();
972
- for (let n of e) for (let e of n.toolCalls) {
972
+ for (let n of e) for (let e of n.toolCalls ?? []) {
973
973
  let r = e.filePath;
974
974
  if (!r) continue;
975
975
  let i = t.get(r);
@@ -1056,8 +1056,8 @@ function ct(e) {
1056
1056
  if (e === "revert") return "re-edit";
1057
1057
  if (e === "subagent") return "subagent";
1058
1058
  }
1059
- function lt(e, t) {
1060
- let n = {
1059
+ function lt(e) {
1060
+ let t = {
1061
1061
  edits: 0,
1062
1062
  bash: 0,
1063
1063
  read: 0,
@@ -1066,8 +1066,11 @@ function lt(e, t) {
1066
1066
  tasks: 0,
1067
1067
  other: 0
1068
1068
  };
1069
- for (let t of e) for (let e of t.toolCalls) n[e.group]++;
1070
- let r = {};
1069
+ for (let n of e) for (let e of n.toolCalls ?? []) t[e.group]++;
1070
+ return t;
1071
+ }
1072
+ function ut(e, t) {
1073
+ let n = lt(e), r = {};
1071
1074
  for (let e of Object.keys(t)) {
1072
1075
  let n = t[e] ?? [], i = /* @__PURE__ */ new Set();
1073
1076
  for (let e of n) {
@@ -1084,8 +1087,8 @@ function lt(e, t) {
1084
1087
  totalTurns: e.length
1085
1088
  };
1086
1089
  }
1087
- function ut(e, t, r, i) {
1088
- let a = dt(e);
1090
+ function dt(e, t, r, i) {
1091
+ let a = ft(e);
1089
1092
  if (a) try {
1090
1093
  e = {
1091
1094
  ...n(e),
@@ -1104,10 +1107,10 @@ function ut(e, t, r, i) {
1104
1107
  files: ot(s),
1105
1108
  tasks: Ve(l.taskGroups ?? W(d), s),
1106
1109
  highlights: st(s, p, f),
1107
- filterIndex: lt(s, u),
1110
+ filterIndex: ut(s, u),
1108
1111
  analytics: l
1109
1112
  };
1110
- return e.nativeMetadata && (m.nativeMetadata = e.nativeMetadata), a && (m.usageScopes = be(o)), m.relationships = ft(e.relationships ?? [], i?.relationshipNavigation), m.earlierHistory = (e.earlierHistory ?? []).map((t, n) => {
1113
+ return e.nativeMetadata && (m.nativeMetadata = e.nativeMetadata), a && (m.usageScopes = be(o)), m.relationships = pt(e.relationships ?? [], i?.relationshipNavigation), m.earlierHistory = (e.earlierHistory ?? []).map((t, n) => {
1111
1114
  let r = `earlier-${n}`, i = $(e, t.turns, t.nativeMetadata, r);
1112
1115
  return {
1113
1116
  id: r,
@@ -1119,7 +1122,7 @@ function ut(e, t, r, i) {
1119
1122
  };
1120
1123
  }), m;
1121
1124
  }
1122
- function dt(e) {
1125
+ function ft(e) {
1123
1126
  return e.harness === "pi" || [
1124
1127
  "nativeMetadata",
1125
1128
  "inputSubmissionCount",
@@ -1129,7 +1132,7 @@ function dt(e) {
1129
1132
  "earlierHistory"
1130
1133
  ].some((t) => X(e, t)) || !!e.turns?.some(He);
1131
1134
  }
1132
- function ft(e, t) {
1135
+ function pt(e, t) {
1133
1136
  let n;
1134
1137
  try {
1135
1138
  n = a.array().parse(t === void 0 ? [] : t);
@@ -1220,12 +1223,14 @@ function $(e, t, n, r, i, a, o) {
1220
1223
  };
1221
1224
  u.has(t) && (x.sourcePosition = u.get(t)), f === 0 && t.role === "assistant" && (x.provider = h), t.agentName && (x.agentName = t.agentName), t.controlKind && (x.controlKind = t.controlKind, x.isControl = !0), o && (x.thinking = o);
1222
1225
  let C = Be(t.role, a, h);
1223
- C !== void 0 && (x.displayContent = C), t.usage && (x.usage = t.usage), t.sourceEntryRef && (x.sourceEntryRef = t.sourceEntryRef), t.provenance && (x.provenance = t.provenance), t.entryType && (x.entryType = t.entryType), t.stopReason !== void 0 && t.stopReason !== null && (x.stopReason = t.stopReason), g && (x.isError = !0), e === v && (x.isFinal = !0), !t.usage && (t.tokensIn != null || t.tokensOut != null) && (x.tokens = {
1226
+ C !== void 0 && (x.displayContent = C), t.usage && (x.usage = t.usage);
1227
+ let w = t;
1228
+ w.truncated === !0 && (x.truncated = !0), typeof w.byteLength == "number" && w.byteLength >= 0 && (x.byteLength = w.byteLength), t.sourceEntryRef && (x.sourceEntryRef = t.sourceEntryRef), t.provenance && (x.provenance = t.provenance), t.entryType && (x.entryType = t.entryType), t.stopReason !== void 0 && t.stopReason !== null && (x.stopReason = t.stopReason), g && (x.isError = !0), e === v && (x.isFinal = !0), !t.usage && (t.tokensIn != null || t.tokensOut != null) && (x.tokens = {
1224
1229
  in: t.tokensIn ?? 0,
1225
1230
  out: t.tokensOut ?? 0
1226
1231
  }), t.timestamp && (x.timestamp = t.timestamp);
1227
- let w = l.get(t.index);
1228
- w?.effectiveModel !== void 0 && (x.effectiveModel = w.effectiveModel), w?.modelChangedFrom !== void 0 && (x.modelChangedFrom = w.modelChangedFrom), b.push(x);
1232
+ let T = l.get(t.index);
1233
+ T?.effectiveModel !== void 0 && (x.effectiveModel = T.effectiveModel), T?.modelChangedFrom !== void 0 && (x.modelChangedFrom = T.modelChangedFrom), b.push(x);
1229
1234
  }
1230
1235
  return {
1231
1236
  turns: b,
@@ -1236,4 +1241,4 @@ function $(e, t, n, r, i, a, o) {
1236
1241
  };
1237
1242
  }
1238
1243
  //#endregion
1239
- export { y as _, Oe as a, E as b, q as c, T as d, H as f, W as g, he as h, ke as i, ve as l, G as m, Ge as n, De as o, C as p, Te as r, Ee as s, ut as t, K as u, x as v, h as x, A as y };
1244
+ export { h as C, E as S, he as _, Te as a, x as b, De as c, ve as d, K as f, G as g, C as h, Ge as i, Ee as l, H as m, ot as n, ke as o, ee as p, lt as r, Oe as s, dt as t, q as u, W as v, A as x, y };