@peasant-labs/fairtrade 0.0.21 → 0.0.22

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.
@@ -3236,6 +3236,32 @@ var xr = Object.freeze([
3236
3236
  icon: ie
3237
3237
  }
3238
3238
  ]), Sr = Object.freeze([
3239
+ Object.freeze({
3240
+ id: "home",
3241
+ label: "home",
3242
+ inNav: !0
3243
+ }),
3244
+ Object.freeze({
3245
+ id: "settings",
3246
+ label: "settings",
3247
+ inNav: !0
3248
+ }),
3249
+ Object.freeze({
3250
+ id: "analytics",
3251
+ label: "analytics",
3252
+ inNav: !1
3253
+ }),
3254
+ Object.freeze({
3255
+ id: "changes",
3256
+ label: "changes",
3257
+ inNav: !1
3258
+ }),
3259
+ Object.freeze({
3260
+ id: "map",
3261
+ label: "code map",
3262
+ inNav: !1
3263
+ })
3264
+ ]), Cr = Object.freeze([
3239
3265
  {
3240
3266
  id: "analytics",
3241
3267
  label: "analytics"
@@ -3249,10 +3275,13 @@ var xr = Object.freeze([
3249
3275
  label: "code map"
3250
3276
  }
3251
3277
  ]);
3252
- function Cr(e) {
3278
+ function wr(e) {
3279
+ return e.filter((e) => e.inNav !== !1);
3280
+ }
3281
+ function Tr(e) {
3253
3282
  return e && (/(INPUT|TEXTAREA|SELECT)/.test(e.tagName) || e.isContentEditable);
3254
3283
  }
3255
- function wr({ apps: e = xr, defaultApp: t, activeApp: n, onAppChange: r, renderApp: i, brand: a = "fairtrade", ariaLabel: c = "the design system in use" }) {
3284
+ function Er({ apps: e = xr, defaultApp: t, activeApp: n, onAppChange: r, renderApp: i, brand: a = "fairtrade", ariaLabel: c = "the design system in use" }) {
3256
3285
  let [d, f] = s(t ?? e[0]?.id), p = n ?? d, m = o({}), h = (e) => {
3257
3286
  n === void 0 && f(e), r?.(e);
3258
3287
  }, g = e.find((e) => e.id === p) ?? e[0];
@@ -3261,7 +3290,7 @@ function wr({ apps: e = xr, defaultApp: t, activeApp: n, onAppChange: r, renderA
3261
3290
  id: "inuse",
3262
3291
  "aria-label": c,
3263
3292
  onKeyDown: (t) => {
3264
- if (Cr(t.target)) return;
3293
+ if (Tr(t.target)) return;
3265
3294
  let n = {
3266
3295
  1: 0,
3267
3296
  2: 1,
@@ -3345,39 +3374,43 @@ function wr({ apps: e = xr, defaultApp: t, activeApp: n, onAppChange: r, renderA
3345
3374
  })]
3346
3375
  });
3347
3376
  }
3348
- function Tr({ sections: e = Sr, activeId: t, activePrimaryId: n, onSectionChange: r, backTo: i, onBack: a, children: o, ariaLabel: s = "peasant sections" }) {
3349
- let c = n ?? t;
3377
+ function Dr({ sections: e = Sr, activeId: t, activePrimaryId: n, onSectionChange: r, backTo: i, onBack: a, notice: o = null, children: s, ariaLabel: c = "peasant sections" }) {
3378
+ let d = n ?? t;
3350
3379
  return /* @__PURE__ */ u("div", {
3351
3380
  className: "iu-app-root",
3352
- children: [/* @__PURE__ */ u("nav", {
3353
- className: "iu-subnav",
3354
- "aria-label": s,
3355
- children: [i ? /* @__PURE__ */ u("button", {
3356
- type: "button",
3357
- className: "iu-subnav-back",
3358
- onClick: () => a ? a(i) : r?.(i),
3359
- children: [/* @__PURE__ */ l(p, {
3360
- size: 14,
3361
- "aria-hidden": "true"
3362
- }), " back"]
3363
- }) : null, e.map((e) => /* @__PURE__ */ l("button", {
3364
- type: "button",
3365
- className: "iu-subnav-item" + (c === e.id ? " active" : ""),
3366
- "aria-current": t === e.id ? "page" : void 0,
3367
- onClick: () => r?.(e.id),
3368
- children: e.label
3369
- }, e.id))]
3370
- }), /* @__PURE__ */ l("div", {
3371
- className: "iu-view",
3372
- children: o
3373
- })]
3381
+ children: [
3382
+ /* @__PURE__ */ u("nav", {
3383
+ className: "iu-subnav",
3384
+ "aria-label": c,
3385
+ children: [i ? /* @__PURE__ */ u("button", {
3386
+ type: "button",
3387
+ className: "iu-subnav-back",
3388
+ onClick: () => a ? a(i) : r?.(i),
3389
+ children: [/* @__PURE__ */ l(p, {
3390
+ size: 14,
3391
+ "aria-hidden": "true"
3392
+ }), " back"]
3393
+ }) : null, wr(e).map((e) => /* @__PURE__ */ l("button", {
3394
+ type: "button",
3395
+ className: "iu-subnav-item" + (d === e.id ? " active" : ""),
3396
+ "aria-current": t === e.id ? "page" : void 0,
3397
+ onClick: () => r?.(e.id),
3398
+ children: e.label
3399
+ }, e.id))]
3400
+ }),
3401
+ o,
3402
+ /* @__PURE__ */ l("div", {
3403
+ className: "iu-view",
3404
+ children: s
3405
+ })
3406
+ ]
3374
3407
  });
3375
3408
  }
3376
- function Er({ sections: e = Sr, activeId: t = void 0, hrefFor: n = void 0, LinkComponent: r = void 0, onSectionChange: i = void 0, className: a = "iu-subnav", itemClassName: o = "iu-subnav-item", activeItemClassName: s = "active", activeMarker: d = null, ariaLabel: f = "peasant sections" }) {
3409
+ function Or({ sections: e = Sr, activeId: t = void 0, hrefFor: n = void 0, LinkComponent: r = void 0, onSectionChange: i = void 0, className: a = "iu-subnav", itemClassName: o = "iu-subnav-item", activeItemClassName: s = "active", activeMarker: d = null, ariaLabel: f = "peasant sections" }) {
3377
3410
  return /* @__PURE__ */ l("nav", {
3378
3411
  className: a,
3379
3412
  "aria-label": f,
3380
- children: e.map((e) => {
3413
+ children: wr(e).map((e) => {
3381
3414
  let a = t === e.id, f = o + (a && s ? " " + s : ""), p = /* @__PURE__ */ u(c, { children: [e.label, a ? d : null] }), m = n?.(e);
3382
3415
  return m && r ? /* @__PURE__ */ l(r, {
3383
3416
  href: m,
@@ -3403,22 +3436,22 @@ function Er({ sections: e = Sr, activeId: t = void 0, hrefFor: n = void 0, LinkC
3403
3436
  }
3404
3437
  //#endregion
3405
3438
  //#region src/ui/transcript/graph/GraphTurnNode.jsx
3406
- function Dr(e) {
3439
+ function kr(e) {
3407
3440
  return e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : String(e);
3408
3441
  }
3409
- function Or(e, t) {
3442
+ function Ar(e, t) {
3410
3443
  return e === "user" ? "you" : t ? "subagent" : e === "assistant" ? "assistant" : e;
3411
3444
  }
3412
- function kr({ role: e, agentName: t, provider: n, hasError: r }) {
3445
+ function jr({ role: e, agentName: t, provider: n, hasError: r }) {
3413
3446
  return r ? "clay" : e === "user" ? "teal" : t ? "mauve" : e === "assistant" ? n === void 0 ? "amber" : F(n) : null;
3414
3447
  }
3415
- function Ar({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount: i, totalTokens: a, tokensIn: o, tokensOut: s, hasError: c = !1, hasRetry: d = !1, hasRevert: f = !1, isSearchMatch: p = !1, isFilteredOut: m = !1, isSelected: h = !1, provider: g, className: _ = "" }) {
3416
- let v = kr({
3448
+ function Mr({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount: i, totalTokens: a, tokensIn: o, tokensOut: s, hasError: c = !1, hasRetry: d = !1, hasRevert: f = !1, isSearchMatch: p = !1, isFilteredOut: m = !1, isSelected: h = !1, provider: g, className: _ = "" }) {
3449
+ let v = jr({
3417
3450
  role: e,
3418
3451
  agentName: t,
3419
3452
  provider: g,
3420
3453
  hasError: c
3421
- }), y = Or(e, t), b = c ? "error" : d ? "retry" : f ? "re-edit" : null, x = o != null || s != null ? `${o ?? 0} in · ${s ?? 0} out` : void 0;
3454
+ }), y = Ar(e, t), b = c ? "error" : d ? "retry" : f ? "re-edit" : null, x = o != null || s != null ? `${o ?? 0} in · ${s ?? 0} out` : void 0;
3422
3455
  return /* @__PURE__ */ u("div", {
3423
3456
  className: [
3424
3457
  "ft-gnode",
@@ -3471,7 +3504,7 @@ function Ar({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount
3471
3504
  }), a > 0 && /* @__PURE__ */ l("span", {
3472
3505
  className: "ft-gnode-meta-tokens",
3473
3506
  title: x,
3474
- children: Dr(a)
3507
+ children: kr(a)
3475
3508
  })]
3476
3509
  })
3477
3510
  ]
@@ -3479,19 +3512,19 @@ function Ar({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount
3479
3512
  }
3480
3513
  //#endregion
3481
3514
  //#region src/ui/transcript/graph/GraphToolNode.jsx
3482
- function jr(e) {
3515
+ function Nr(e) {
3483
3516
  return e == null || e <= 0 ? "" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(1).replace(/\.0$/, "")}s`;
3484
3517
  }
3485
- function Mr(e) {
3518
+ function Pr(e) {
3486
3519
  if (!e) return "";
3487
3520
  let t = e.split("/");
3488
3521
  return t[t.length - 1] || e;
3489
3522
  }
3490
- function Nr(e) {
3523
+ function Fr(e) {
3491
3524
  return !!e.isError || e.exitCode != null && e.exitCode !== 0;
3492
3525
  }
3493
- function Pr({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r = !1, max: i = 4, className: a = "" }) {
3494
- let o = e.slice(0, i), s = e.length - o.length, c = jr(t), d = e.length;
3526
+ function Ir({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r = !1, max: i = 4, className: a = "" }) {
3527
+ let o = e.slice(0, i), s = e.length - o.length, c = Nr(t), d = e.length;
3495
3528
  return /* @__PURE__ */ u("div", {
3496
3529
  className: [
3497
3530
  "ft-gnode",
@@ -3512,7 +3545,7 @@ function Pr({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r =
3512
3545
  }), /* @__PURE__ */ u("ul", {
3513
3546
  className: "ft-gnode-tools-list",
3514
3547
  children: [o.map((e) => {
3515
- let t = Nr(e), n = e.preview || Mr(e.filePath);
3548
+ let t = Fr(e), n = e.preview || Pr(e.filePath);
3516
3549
  return /* @__PURE__ */ u("li", {
3517
3550
  className: `ft-gnode-tools-row${t ? " ft-gnode-tools-row-failed" : ""}`,
3518
3551
  children: [
@@ -3543,7 +3576,7 @@ function Pr({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r =
3543
3576
  }
3544
3577
  //#endregion
3545
3578
  //#region src/ui/transcript/graph/GraphSubagentBranch.jsx
3546
- function Fr({ agentName: e, depth: t, className: n = "" }) {
3579
+ function Lr({ agentName: e, depth: t, className: n = "" }) {
3547
3580
  return /* @__PURE__ */ u("div", {
3548
3581
  className: ["ft-gnode-lane", n].filter(Boolean).join(" "),
3549
3582
  children: [
@@ -3564,7 +3597,7 @@ function Fr({ agentName: e, depth: t, className: n = "" }) {
3564
3597
  }
3565
3598
  //#endregion
3566
3599
  //#region src/ui/transcript/graph/GraphLegend.jsx
3567
- var Ir = Object.freeze([
3600
+ var Rr = Object.freeze([
3568
3601
  {
3569
3602
  kind: "user",
3570
3603
  label: "you"
@@ -3586,7 +3619,7 @@ var Ir = Object.freeze([
3586
3619
  label: "error"
3587
3620
  }
3588
3621
  ]);
3589
- function Lr({ kind: e, provider: t }) {
3622
+ function zr({ kind: e, provider: t }) {
3590
3623
  switch (e) {
3591
3624
  case "user": return "teal";
3592
3625
  case "assistant": return t === void 0 ? "amber" : F(t);
@@ -3595,11 +3628,11 @@ function Lr({ kind: e, provider: t }) {
3595
3628
  default: return null;
3596
3629
  }
3597
3630
  }
3598
- function Rr({ items: e = Ir, className: t = "" }) {
3631
+ function Br({ items: e = Rr, className: t = "" }) {
3599
3632
  return /* @__PURE__ */ l("div", {
3600
3633
  className: ["ft-graph-legend", t].filter(Boolean).join(" "),
3601
3634
  children: e.map((e) => {
3602
- let t = Lr(e), n = t ? { background: `var(--${t})` } : void 0;
3635
+ let t = zr(e), n = t ? { background: `var(--${t})` } : void 0;
3603
3636
  return /* @__PURE__ */ u("span", {
3604
3637
  className: "ft-graph-legend-item",
3605
3638
  children: [/* @__PURE__ */ l("span", {
@@ -3613,4 +3646,4 @@ function Rr({ items: e = Ir, className: t = "" }) {
3613
3646
  });
3614
3647
  }
3615
3648
  //#endregion
3616
- export { $e as $, xt as A, Vt as B, ln as C, xe as Ct, bt as D, ht as E, Ht as F, tt as G, ct as H, Gt as I, rt as J, it as K, At as L, Ot as M, Mt as N, yt as O, Dt as P, J as Q, jt as R, sn as S, Se as St, gt as T, lt as U, Nt as V, ut as W, ot as X, et as Y, st as Z, an as _, Oe as _t, Ar as a, V as at, cn as b, F as bt, Er as c, I as ct, vr as d, ze as dt, Ye as et, _r as f, Fe as ft, Y as g, Pe as gt, qt as h, Ie as ht, Pr as i, He as it, kt as j, vt as k, xr as l, R as lt, or as m, Ne as mt, Rr as n, U as nt, Sr as o, Ve as ot, br as p, Le as pt, nt as q, Fr as r, H as rt, Tr as s, B as st, Ir as t, G as tt, wr as u, z as ut, X as v, ke as vt, _t as w, Jt as x, N as xt, dn as y, je as yt, Wt as z };
3649
+ export { J as $, vt as A, Wt as B, sn as C, Se as Ct, ht as D, gt as E, Dt as F, ut as G, Nt as H, Ht as I, nt as J, tt as K, Gt as L, kt as M, Ot as N, bt as O, Mt as P, st as Q, At as R, Jt as S, N as St, _t as T, ct as U, Vt as V, lt as W, et as X, rt as Y, ot as Z, Y as _, Pe as _t, Mr as a, He as at, dn as b, je as bt, Or as c, B as ct, Sr as d, z as dt, $e as et, vr as f, ze as ft, qt as g, Ie as gt, or as h, Ne as ht, Ir as i, H as it, xt as j, yt as k, xr as l, I as lt, br as m, Le as mt, Br as n, G as nt, Cr as o, V as ot, _r as p, Fe as pt, it as q, Lr as r, U as rt, Dr as s, Ve as st, Rr as t, Ye as tt, Er as u, R as ut, an as v, Oe as vt, ln as w, xe as wt, cn as x, F as xt, X as y, ke as yt, jt as z };