@ai-matrx/agents 0.42.1 → 0.43.2

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.
@@ -541,7 +541,7 @@ function ContextRulesTable({
541
541
  },
542
542
  rowId(row)
543
543
  );
544
- const heading = (props) => /* @__PURE__ */ jsx3(Heading, { ...props, comfortable, readOnly }, props.id);
544
+ const heading = (props) => /* @__PURE__ */ jsx3(Heading, { ...props, grid, narrow, comfortable, readOnly }, props.id);
545
545
  const renderLevel = (level, depth) => {
546
546
  const all = levelRows(level);
547
547
  const name = level.ref.path[level.ref.path.length - 1] ?? "";
@@ -638,38 +638,44 @@ function Heading({
638
638
  checked,
639
639
  onToggle,
640
640
  noSwitch,
641
+ grid,
642
+ narrow,
641
643
  comfortable,
642
644
  readOnly
643
645
  }) {
644
646
  const { count, charsLabel } = summarizeContextRows(rows);
645
647
  const total = rows.length;
646
648
  const showSwitch = !noSwitch && (Boolean(onToggle) || readOnly && total > 0);
649
+ const countLabel = total > 0 ? count === total ? String(total) : `${count}/${total}` : null;
650
+ const toggle = showSwitch ? /* @__PURE__ */ jsx3(
651
+ Switch,
652
+ {
653
+ size: "sm",
654
+ "aria-label": `Include ${switchName}`,
655
+ checked,
656
+ disabled: readOnly || !onToggle,
657
+ onCheckedChange: (next) => onToggle?.(next)
658
+ }
659
+ ) : null;
647
660
  return /* @__PURE__ */ jsxs3(
648
661
  "div",
649
662
  {
650
663
  role: "row",
651
664
  "data-heading": kind,
652
665
  className: cn2(
653
- "flex items-center gap-2 border-b border-border/50 font-medium",
654
- comfortable ? "min-h-11 px-3" : "h-7 px-2",
666
+ grid,
667
+ "border-b border-border/50 font-medium",
668
+ comfortable ? "min-h-11 py-1" : "min-h-7 py-0.5",
655
669
  kind === "group" ? "bg-muted/25 text-muted-foreground" : "bg-muted/60 text-foreground"
656
670
  ),
657
671
  children: [
658
- /* @__PURE__ */ jsx3("div", { role: "cell", className: cn2("flex min-w-0 flex-1 items-center", indent(depth)), children: /* @__PURE__ */ jsx3("span", { className: "min-w-0 truncate", title: label, children: label }) }),
659
- /* @__PURE__ */ jsxs3("div", { role: "cell", className: "flex shrink-0 items-center gap-2 font-normal tabular-nums text-muted-foreground", children: [
660
- total > 0 ? /* @__PURE__ */ jsx3("span", { children: count === total ? total : `${count}/${total}` }) : null,
661
- total > 0 ? /* @__PURE__ */ jsx3("span", { children: charsLabel }) : null,
662
- showSwitch ? /* @__PURE__ */ jsx3(
663
- Switch,
664
- {
665
- size: "sm",
666
- "aria-label": `Include ${switchName}`,
667
- checked,
668
- disabled: readOnly || !onToggle,
669
- onCheckedChange: (next) => onToggle?.(next)
670
- }
671
- ) : null
672
- ] })
672
+ /* @__PURE__ */ jsxs3("div", { role: "cell", className: cn2("flex min-w-0 items-baseline gap-1.5", indent(depth)), children: [
673
+ /* @__PURE__ */ jsx3("span", { className: "min-w-0 whitespace-normal break-words", title: label, children: label }),
674
+ countLabel ? /* @__PURE__ */ jsx3("span", { className: "shrink-0 font-normal tabular-nums text-muted-foreground", children: countLabel }) : null
675
+ ] }),
676
+ /* @__PURE__ */ jsx3("div", { role: "cell", className: cn2("flex justify-center", narrow && "order-last"), children: toggle }),
677
+ /* @__PURE__ */ jsx3("div", { role: "cell", className: "text-right font-normal tabular-nums text-muted-foreground", children: total > 0 ? charsLabel : null }),
678
+ /* @__PURE__ */ jsx3("div", { role: "cell" })
673
679
  ]
674
680
  }
675
681
  );
@@ -751,7 +757,7 @@ function ContextRuleRow({
751
757
  ]
752
758
  }
753
759
  ),
754
- /* @__PURE__ */ jsx3("div", { role: "cell", className: "flex justify-center", children: /* @__PURE__ */ jsx3(
760
+ /* @__PURE__ */ jsx3("div", { role: "cell", className: cn2("flex justify-center", narrow && "order-last"), children: /* @__PURE__ */ jsx3(
755
761
  Switch,
756
762
  {
757
763
  size: "sm",
@@ -921,11 +927,12 @@ function ContextRulesChip({
921
927
  {
922
928
  type: "button",
923
929
  "aria-label": faceName,
930
+ title: name || void 0,
924
931
  "data-mismatch": warn ? "true" : void 0,
925
932
  "data-blind": blind ? "true" : void 0,
926
933
  onClick: isMobile ? () => setOpen(true) : void 0,
927
934
  className: cn3(
928
- "relative inline-flex h-6 max-w-[12rem] shrink-0 items-center gap-1 rounded-md border border-border bg-card px-1.5 text-xs font-medium text-foreground transition-colors hover:bg-accent",
935
+ "relative inline-flex h-6 min-w-0 shrink items-center gap-1 rounded-md border border-border bg-card px-1.5 text-xs font-medium text-foreground transition-colors hover:bg-accent",
929
936
  comfortable && "after:absolute after:-inset-x-1.5 after:-inset-y-2.5 after:content-['']",
930
937
  !eyeOpen && "text-muted-foreground",
931
938
  blind && "border-dashed",