@ai-matrx/agents 0.43.6 → 0.43.9
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.
- package/CHANGELOG.md +13 -0
- package/dist/content-transfer/index.cjs.map +1 -1
- package/dist/content-transfer/index.js.map +1 -1
- package/dist/content-transfer/react/index.cjs.map +1 -1
- package/dist/content-transfer/react/index.js.map +1 -1
- package/dist/context/react/index.cjs +225 -192
- package/dist/context/react/index.cjs.map +1 -1
- package/dist/context/react/index.js +230 -197
- package/dist/context/react/index.js.map +1 -1
- package/dist/generated/api-types.cjs.map +1 -1
- package/dist/generated/api-types.d.cts +235 -0
- package/dist/generated/api-types.d.ts +235 -0
- package/dist/generated/stream-events.cjs.map +1 -1
- package/dist/generated/stream-events.d.cts +3 -0
- package/dist/generated/stream-events.d.ts +3 -0
- package/dist/generated/stream-events.js.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{keys.generated-BjKL_5CY.d.cts → keys.generated-Dfy6RITs.d.cts} +4 -4
- package/dist/{keys.generated-BjKL_5CY.d.ts → keys.generated-Dfy6RITs.d.ts} +4 -4
- package/dist/mandates/index.cjs +2 -2
- package/dist/mandates/index.cjs.map +1 -1
- package/dist/mandates/index.d.cts +2 -2
- package/dist/mandates/index.d.ts +2 -2
- package/dist/mandates/index.js +2 -2
- package/dist/mandates/index.js.map +1 -1
- package/dist/matrx/index.d.cts +1 -1
- package/dist/matrx/index.d.ts +1 -1
- package/generated/api-types.ts +235 -0
- package/generated/stream-events.ts +3 -0
- package/mandates/snapshots/keys.0.43.7.json +653 -0
- package/mandates/snapshots/keys.0.43.8.json +653 -0
- package/mandates/snapshots/keys.0.43.9.json +653 -0
- package/package.json +1 -1
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
PopoverContent,
|
|
8
8
|
PopoverTrigger,
|
|
9
9
|
Switch,
|
|
10
|
-
Tooltip as
|
|
11
|
-
TooltipContent as
|
|
12
|
-
TooltipProvider,
|
|
13
|
-
TooltipTrigger as
|
|
14
|
-
cn as
|
|
10
|
+
Tooltip as Tooltip3,
|
|
11
|
+
TooltipContent as TooltipContent3,
|
|
12
|
+
TooltipProvider as TooltipProvider2,
|
|
13
|
+
TooltipTrigger as TooltipTrigger3,
|
|
14
|
+
cn as cn3
|
|
15
15
|
} from "@ai-matrx/design-system";
|
|
16
16
|
|
|
17
17
|
// context/index.ts
|
|
@@ -178,6 +178,14 @@ var ArrowDownToLineIcon = icon(
|
|
|
178
178
|
/* @__PURE__ */ jsx("path", { d: "M19 21H5" })
|
|
179
179
|
] })
|
|
180
180
|
);
|
|
181
|
+
var LockIcon = icon(
|
|
182
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
183
|
+
/* @__PURE__ */ jsx("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
|
|
184
|
+
/* @__PURE__ */ jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
185
|
+
] })
|
|
186
|
+
);
|
|
187
|
+
var CheckIcon = icon(/* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }));
|
|
188
|
+
var MinusIcon = icon(/* @__PURE__ */ jsx("path", { d: "M5 12h14" }));
|
|
181
189
|
|
|
182
190
|
// context/react/hierarchy.ts
|
|
183
191
|
var AI_MATRX_LEVEL = { id: "ai_matrx", path: ["AI Matrx"], order: 900 };
|
|
@@ -252,14 +260,41 @@ function includeChanges(rows, include, cap) {
|
|
|
252
260
|
return changes;
|
|
253
261
|
}
|
|
254
262
|
|
|
263
|
+
// context/react/FrozenInclude.tsx
|
|
264
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, cn } from "@ai-matrx/design-system";
|
|
265
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
266
|
+
var FROZEN_INCLUDE_TOOLTIP = "Sent as shown";
|
|
267
|
+
function FrozenInclude({ name, checked }) {
|
|
268
|
+
return /* @__PURE__ */ jsx2(TooltipProvider, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ jsxs2(Tooltip, { children: [
|
|
269
|
+
/* @__PURE__ */ jsx2(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs2(
|
|
270
|
+
"span",
|
|
271
|
+
{
|
|
272
|
+
role: "img",
|
|
273
|
+
"aria-label": `${checked ? "Included" : "Not included"}: ${name}`,
|
|
274
|
+
"data-frozen-include": checked ? "on" : "off",
|
|
275
|
+
tabIndex: 0,
|
|
276
|
+
className: cn(
|
|
277
|
+
"inline-flex h-5 items-center gap-0.5 rounded px-1 text-muted-foreground",
|
|
278
|
+
checked ? "bg-muted text-foreground" : "bg-transparent"
|
|
279
|
+
),
|
|
280
|
+
children: [
|
|
281
|
+
checked ? /* @__PURE__ */ jsx2(CheckIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx2(MinusIcon, { className: "h-3 w-3" }),
|
|
282
|
+
/* @__PURE__ */ jsx2(LockIcon, { className: "h-2.5 w-2.5 opacity-70" })
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
) }),
|
|
286
|
+
/* @__PURE__ */ jsx2(TooltipContent, { children: FROZEN_INCLUDE_TOOLTIP })
|
|
287
|
+
] }) });
|
|
288
|
+
}
|
|
289
|
+
|
|
255
290
|
// context/react/InlineMaxInput.tsx
|
|
256
291
|
import * as React from "react";
|
|
257
292
|
import {
|
|
258
293
|
Input,
|
|
259
|
-
Tooltip,
|
|
260
|
-
TooltipContent,
|
|
261
|
-
TooltipTrigger,
|
|
262
|
-
cn
|
|
294
|
+
Tooltip as Tooltip2,
|
|
295
|
+
TooltipContent as TooltipContent2,
|
|
296
|
+
TooltipTrigger as TooltipTrigger2,
|
|
297
|
+
cn as cn2
|
|
263
298
|
} from "@ai-matrx/design-system";
|
|
264
299
|
|
|
265
300
|
// context/react/shared.ts
|
|
@@ -339,7 +374,7 @@ function onRequestReason(row) {
|
|
|
339
374
|
}
|
|
340
375
|
|
|
341
376
|
// context/react/InlineMaxInput.tsx
|
|
342
|
-
import { jsx as
|
|
377
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
343
378
|
function InlineMaxInput({
|
|
344
379
|
value,
|
|
345
380
|
inherited,
|
|
@@ -373,16 +408,16 @@ function InlineMaxInput({
|
|
|
373
408
|
if (next !== value) onCommit(next);
|
|
374
409
|
};
|
|
375
410
|
const overridden = value !== null;
|
|
376
|
-
return /* @__PURE__ */
|
|
377
|
-
/* @__PURE__ */
|
|
411
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn2("flex items-center justify-end", comfortable ? "gap-0.5" : "gap-1"), children: [
|
|
412
|
+
/* @__PURE__ */ jsx3(
|
|
378
413
|
"span",
|
|
379
414
|
{
|
|
380
415
|
"aria-hidden": "true",
|
|
381
|
-
className:
|
|
416
|
+
className: cn2("h-1.5 w-1.5 shrink-0 rounded-full", overridden ? "bg-primary" : "bg-transparent")
|
|
382
417
|
}
|
|
383
418
|
),
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ jsxs3(Tooltip2, { open: notice, children: [
|
|
420
|
+
/* @__PURE__ */ jsx3(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx3(
|
|
386
421
|
Input,
|
|
387
422
|
{
|
|
388
423
|
type: "text",
|
|
@@ -412,30 +447,30 @@ function InlineMaxInput({
|
|
|
412
447
|
e.currentTarget.blur();
|
|
413
448
|
}
|
|
414
449
|
},
|
|
415
|
-
className:
|
|
450
|
+
className: cn2(
|
|
416
451
|
"min-w-0 rounded px-1 py-0 text-right tabular-nums shadow-none",
|
|
417
452
|
comfortable ? "h-8 w-[6.5ch] text-base" : "h-6 w-[6.5ch] text-xs"
|
|
418
453
|
)
|
|
419
454
|
}
|
|
420
455
|
) }),
|
|
421
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ jsx3(TooltipContent2, { children: `Limit is ${cap}` })
|
|
422
457
|
] }),
|
|
423
|
-
overridden && !disabled ? /* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
458
|
+
overridden && !disabled ? /* @__PURE__ */ jsxs3(Tooltip2, { children: [
|
|
459
|
+
/* @__PURE__ */ jsx3(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ jsx3(
|
|
425
460
|
"button",
|
|
426
461
|
{
|
|
427
462
|
type: "button",
|
|
428
463
|
"aria-label": `Reset inline max for ${label}`,
|
|
429
464
|
onClick: () => onCommit(null),
|
|
430
|
-
className:
|
|
465
|
+
className: cn2(
|
|
431
466
|
"inline-flex shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
432
467
|
comfortable ? "h-8 w-7" : "h-5 w-5"
|
|
433
468
|
),
|
|
434
|
-
children: /* @__PURE__ */
|
|
469
|
+
children: /* @__PURE__ */ jsx3(RotateCcwIcon, { className: "h-3 w-3" })
|
|
435
470
|
}
|
|
436
471
|
) }),
|
|
437
|
-
/* @__PURE__ */
|
|
438
|
-
] }) : /* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ jsx3(TooltipContent2, { children: `Reset to ${formatLimit(inherited)}` })
|
|
473
|
+
] }) : /* @__PURE__ */ jsx3("span", { "aria-hidden": "true", className: cn2("shrink-0", comfortable ? "w-7" : "w-5") })
|
|
439
474
|
] });
|
|
440
475
|
}
|
|
441
476
|
|
|
@@ -456,7 +491,7 @@ function summarizeContextRows(rows) {
|
|
|
456
491
|
}
|
|
457
492
|
|
|
458
493
|
// context/react/ContextRulesTable.tsx
|
|
459
|
-
import { jsx as
|
|
494
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
460
495
|
var CONTEXT_RULES_GRID = {
|
|
461
496
|
compact: "grid grid-cols-[minmax(0,1fr)_2.75rem_4rem_6.5rem] items-center gap-x-2 px-2",
|
|
462
497
|
comfortable: "grid grid-cols-[minmax(0,1fr)_2.75rem_3.5rem_6.75rem] items-center gap-x-1.5 px-3"
|
|
@@ -522,7 +557,7 @@ function ContextRulesTable({
|
|
|
522
557
|
const changes = bulkChanges(list, next);
|
|
523
558
|
if (changes.length > 0) onSetInclude(changes);
|
|
524
559
|
} : void 0;
|
|
525
|
-
const renderRow = (row, depth) => /* @__PURE__ */
|
|
560
|
+
const renderRow = (row, depth) => /* @__PURE__ */ jsx4(
|
|
526
561
|
ContextRuleRow,
|
|
527
562
|
{
|
|
528
563
|
row,
|
|
@@ -541,11 +576,11 @@ function ContextRulesTable({
|
|
|
541
576
|
},
|
|
542
577
|
rowId(row)
|
|
543
578
|
);
|
|
544
|
-
const heading = (props) => /* @__PURE__ */
|
|
579
|
+
const heading = (props) => /* @__PURE__ */ jsx4(Heading, { ...props, grid, narrow, comfortable, readOnly }, props.id);
|
|
545
580
|
const renderLevel = (level, depth) => {
|
|
546
581
|
const all = levelRows(level);
|
|
547
582
|
const name = level.ref.path[level.ref.path.length - 1] ?? "";
|
|
548
|
-
return /* @__PURE__ */
|
|
583
|
+
return /* @__PURE__ */ jsxs4("div", { role: "rowgroup", "aria-label": headed ? level.ref.path.join(" \u203A ") : void 0, "data-level": level.ref.id, children: [
|
|
549
584
|
headed ? heading({
|
|
550
585
|
id: `h:${level.ref.id}`,
|
|
551
586
|
kind: "level",
|
|
@@ -556,7 +591,7 @@ function ContextRulesTable({
|
|
|
556
591
|
...levelSwitch(level, bulk(all))
|
|
557
592
|
}) : null,
|
|
558
593
|
level.rows.map((row) => renderRow(row, depth + 1)),
|
|
559
|
-
level.groups.map((group) => /* @__PURE__ */
|
|
594
|
+
level.groups.map((group) => /* @__PURE__ */ jsxs4("div", { role: "rowgroup", "aria-label": group.ref.label, "data-group": group.ref.id, children: [
|
|
560
595
|
heading({
|
|
561
596
|
id: `h:${group.ref.id}`,
|
|
562
597
|
kind: "group",
|
|
@@ -571,7 +606,7 @@ function ContextRulesTable({
|
|
|
571
606
|
] }, group.ref.id))
|
|
572
607
|
] }, level.ref.id);
|
|
573
608
|
};
|
|
574
|
-
return /* @__PURE__ */
|
|
609
|
+
return /* @__PURE__ */ jsx4(TooltipProvider2, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ jsxs4(
|
|
575
610
|
"div",
|
|
576
611
|
{
|
|
577
612
|
ref: rootRef,
|
|
@@ -579,22 +614,22 @@ function ContextRulesTable({
|
|
|
579
614
|
"aria-label": "Values",
|
|
580
615
|
"data-density": density,
|
|
581
616
|
"data-layout": narrow ? "narrow" : "wide",
|
|
582
|
-
className:
|
|
617
|
+
className: cn3("text-xs", className),
|
|
583
618
|
children: [
|
|
584
|
-
narrow ? null : /* @__PURE__ */
|
|
619
|
+
narrow ? null : /* @__PURE__ */ jsxs4(
|
|
585
620
|
"div",
|
|
586
621
|
{
|
|
587
622
|
role: "row",
|
|
588
|
-
className:
|
|
623
|
+
className: cn3(grid, "sticky top-0 z-10 h-7 border-b border-border bg-card font-medium text-muted-foreground"),
|
|
589
624
|
children: [
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
-
/* @__PURE__ */
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ jsx4("span", { role: "columnheader", children: "Item" }),
|
|
626
|
+
/* @__PURE__ */ jsx4("span", { role: "columnheader", className: "text-center", children: "Include" }),
|
|
627
|
+
/* @__PURE__ */ jsx4("span", { role: "columnheader", className: "text-right", children: "Chars" }),
|
|
628
|
+
/* @__PURE__ */ jsx4("span", { role: "columnheader", className: "pr-6 text-right", children: "Inline max" })
|
|
594
629
|
]
|
|
595
630
|
}
|
|
596
631
|
),
|
|
597
|
-
levels.length === 0 ? /* @__PURE__ */
|
|
632
|
+
levels.length === 0 ? /* @__PURE__ */ jsx4("div", { className: "px-2 py-3 text-center text-muted-foreground", children: "None" }) : sectionsOf(levels).map((section) => {
|
|
598
633
|
if (section.label === null || !headed) return renderLevel(section.levels[0], 0);
|
|
599
634
|
const all = section.levels.flatMap(levelRows);
|
|
600
635
|
const several = section.levels.length > 1;
|
|
@@ -606,7 +641,7 @@ function ContextRulesTable({
|
|
|
606
641
|
}
|
|
607
642
|
if (changes.length > 0) onSetInclude?.(changes);
|
|
608
643
|
} : void 0;
|
|
609
|
-
return /* @__PURE__ */
|
|
644
|
+
return /* @__PURE__ */ jsxs4("div", { role: "rowgroup", "aria-label": section.label, "data-section": section.label, children: [
|
|
610
645
|
heading({
|
|
611
646
|
id: `h:${section.id}`,
|
|
612
647
|
kind: "section",
|
|
@@ -647,35 +682,35 @@ function Heading({
|
|
|
647
682
|
const total = rows.length;
|
|
648
683
|
const showSwitch = !noSwitch && (Boolean(onToggle) || readOnly && total > 0);
|
|
649
684
|
const countLabel = total > 0 ? count === total ? String(total) : `${count}/${total}` : null;
|
|
650
|
-
const toggle = showSwitch ? /* @__PURE__ */
|
|
685
|
+
const toggle = showSwitch ? readOnly ? /* @__PURE__ */ jsx4(FrozenInclude, { name: switchName, checked }) : /* @__PURE__ */ jsx4(
|
|
651
686
|
Switch,
|
|
652
687
|
{
|
|
653
688
|
size: "sm",
|
|
654
689
|
"aria-label": `Include ${switchName}`,
|
|
655
690
|
checked,
|
|
656
|
-
disabled:
|
|
691
|
+
disabled: !onToggle,
|
|
657
692
|
onCheckedChange: (next) => onToggle?.(next)
|
|
658
693
|
}
|
|
659
694
|
) : null;
|
|
660
|
-
return /* @__PURE__ */
|
|
695
|
+
return /* @__PURE__ */ jsxs4(
|
|
661
696
|
"div",
|
|
662
697
|
{
|
|
663
698
|
role: "row",
|
|
664
699
|
"data-heading": kind,
|
|
665
|
-
className:
|
|
700
|
+
className: cn3(
|
|
666
701
|
grid,
|
|
667
702
|
"border-b border-border/50 font-medium",
|
|
668
703
|
comfortable ? "min-h-11 py-1" : "min-h-7 py-0.5",
|
|
669
704
|
kind === "group" ? "bg-muted/25 text-muted-foreground" : "bg-muted/60 text-foreground"
|
|
670
705
|
),
|
|
671
706
|
children: [
|
|
672
|
-
/* @__PURE__ */
|
|
673
|
-
/* @__PURE__ */
|
|
674
|
-
countLabel ? /* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ jsxs4("div", { role: "cell", className: cn3("flex min-w-0 items-baseline gap-1.5", indent(depth)), children: [
|
|
708
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 whitespace-normal break-words", title: label, children: label }),
|
|
709
|
+
countLabel ? /* @__PURE__ */ jsx4("span", { className: "shrink-0 font-normal tabular-nums text-muted-foreground", children: countLabel }) : null
|
|
675
710
|
] }),
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ jsx4("div", { role: "cell", className: cn3("flex justify-center", narrow && "order-last"), children: toggle }),
|
|
712
|
+
/* @__PURE__ */ jsx4("div", { role: "cell", className: "text-right font-normal tabular-nums text-muted-foreground", children: total > 0 ? charsLabel : null }),
|
|
713
|
+
/* @__PURE__ */ jsx4("div", { role: "cell" })
|
|
679
714
|
]
|
|
680
715
|
}
|
|
681
716
|
);
|
|
@@ -697,7 +732,7 @@ function ContextRuleRow({
|
|
|
697
732
|
}) {
|
|
698
733
|
const selfChecked = row.blockedBy === "self_check" || mismatches.some((m) => m.reason === "self_check");
|
|
699
734
|
const decided = selfChecked ? SELF_CHECK_TOOLTIP : row.serverResolved ? SERVER_RESOLVED_TOOLTIP : `Include: ${LAYER_LABEL[row.decided_by.include]} \xB7 Limit: ${LAYER_LABEL[row.decided_by.max_inline_chars]}`;
|
|
700
|
-
const labelNode = onOpenRow ? /* @__PURE__ */
|
|
735
|
+
const labelNode = onOpenRow ? /* @__PURE__ */ jsx4(
|
|
701
736
|
"button",
|
|
702
737
|
{
|
|
703
738
|
type: "button",
|
|
@@ -705,8 +740,8 @@ function ContextRuleRow({
|
|
|
705
740
|
className: "block min-w-0 flex-1 truncate text-left hover:underline focus-visible:underline focus-visible:outline-none",
|
|
706
741
|
children: row.label
|
|
707
742
|
}
|
|
708
|
-
) : /* @__PURE__ */
|
|
709
|
-
return /* @__PURE__ */
|
|
743
|
+
) : /* @__PURE__ */ jsx4("span", { className: "block min-w-0 flex-1 truncate", children: row.label });
|
|
744
|
+
return /* @__PURE__ */ jsxs4(
|
|
710
745
|
"div",
|
|
711
746
|
{
|
|
712
747
|
role: "row",
|
|
@@ -716,72 +751,71 @@ function ContextRuleRow({
|
|
|
716
751
|
"data-included": row.include ? "true" : "false",
|
|
717
752
|
"data-mismatch": mismatches.length > 0 ? "true" : void 0,
|
|
718
753
|
"aria-selected": selected || void 0,
|
|
719
|
-
className:
|
|
754
|
+
className: cn3(
|
|
720
755
|
grid,
|
|
721
756
|
"border-b border-border/50",
|
|
722
757
|
comfortable ? "min-h-11" : "h-7",
|
|
723
758
|
selected && "bg-accent"
|
|
724
759
|
),
|
|
725
760
|
children: [
|
|
726
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ jsxs4(
|
|
727
762
|
"div",
|
|
728
763
|
{
|
|
729
764
|
role: "cell",
|
|
730
|
-
className:
|
|
765
|
+
className: cn3(
|
|
731
766
|
"flex min-w-0 items-center gap-1.5",
|
|
732
767
|
indent(depth),
|
|
733
768
|
!row.include && "opacity-50"
|
|
734
769
|
),
|
|
735
770
|
children: [
|
|
736
|
-
mismatches.length > 0 ? /* @__PURE__ */
|
|
737
|
-
/* @__PURE__ */
|
|
771
|
+
mismatches.length > 0 ? /* @__PURE__ */ jsxs4(Tooltip3, { children: [
|
|
772
|
+
/* @__PURE__ */ jsx4(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsx4(
|
|
738
773
|
"span",
|
|
739
774
|
{
|
|
740
775
|
role: "img",
|
|
741
776
|
"aria-label": "Mismatch",
|
|
742
777
|
className: "inline-flex shrink-0 text-warning",
|
|
743
|
-
children: /* @__PURE__ */
|
|
778
|
+
children: /* @__PURE__ */ jsx4(TriangleAlertIcon, { className: "h-3.5 w-3.5" })
|
|
744
779
|
}
|
|
745
780
|
) }),
|
|
746
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ jsx4(TooltipContent3, { children: describeMismatches(mismatches) })
|
|
747
782
|
] }) : null,
|
|
748
|
-
lead ? /* @__PURE__ */
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
-
/* @__PURE__ */
|
|
783
|
+
lead ? /* @__PURE__ */ jsx4("span", { className: "inline-flex shrink-0 items-center", children: lead }) : null,
|
|
784
|
+
/* @__PURE__ */ jsxs4(Tooltip3, { children: [
|
|
785
|
+
/* @__PURE__ */ jsx4(TooltipTrigger3, { asChild: true, children: labelNode }),
|
|
786
|
+
/* @__PURE__ */ jsxs4(TooltipContent3, { children: [
|
|
787
|
+
/* @__PURE__ */ jsx4("div", { children: row.label }),
|
|
788
|
+
/* @__PURE__ */ jsx4("div", { className: "font-normal text-muted-foreground", children: decided })
|
|
754
789
|
] })
|
|
755
790
|
] }),
|
|
756
|
-
trail ? /* @__PURE__ */
|
|
791
|
+
trail ? /* @__PURE__ */ jsx4("span", { className: "min-w-0 max-w-[45%] shrink truncate text-muted-foreground", children: trail }) : null
|
|
757
792
|
]
|
|
758
793
|
}
|
|
759
794
|
),
|
|
760
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ jsx4("div", { role: "cell", className: cn3("flex justify-center", narrow && "order-last"), children: readOnly ? /* @__PURE__ */ jsx4(FrozenInclude, { name: row.label, checked: row.include }) : /* @__PURE__ */ jsx4(
|
|
761
796
|
Switch,
|
|
762
797
|
{
|
|
763
798
|
size: "sm",
|
|
764
799
|
"aria-label": `Include ${row.label}`,
|
|
765
800
|
checked: row.include,
|
|
766
|
-
disabled: readOnly,
|
|
767
801
|
onCheckedChange: (next) => onChange(row.key, row.surfaceKey, withInclude(row, next))
|
|
768
802
|
}
|
|
769
803
|
) }),
|
|
770
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ jsxs4(
|
|
771
805
|
"div",
|
|
772
806
|
{
|
|
773
807
|
role: "cell",
|
|
774
|
-
className:
|
|
808
|
+
className: cn3("flex items-center justify-end gap-1 tabular-nums", !row.include && "opacity-50"),
|
|
775
809
|
children: [
|
|
776
|
-
row.include && row.delivery === "on_request" ? /* @__PURE__ */
|
|
777
|
-
/* @__PURE__ */
|
|
778
|
-
/* @__PURE__ */
|
|
810
|
+
row.include && row.delivery === "on_request" ? /* @__PURE__ */ jsxs4(Tooltip3, { children: [
|
|
811
|
+
/* @__PURE__ */ jsx4(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsx4("span", { role: "img", "aria-label": "On request", className: "inline-flex text-muted-foreground", children: /* @__PURE__ */ jsx4(ArrowDownToLineIcon, { className: "h-3 w-3" }) }) }),
|
|
812
|
+
/* @__PURE__ */ jsx4(TooltipContent3, { children: onRequestReason(row) })
|
|
779
813
|
] }) : null,
|
|
780
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ jsx4("span", { children: formatChars(row.chars) })
|
|
781
815
|
]
|
|
782
816
|
}
|
|
783
817
|
),
|
|
784
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ jsx4("div", { role: "cell", children: narrow ? /* @__PURE__ */ jsx4(InlineMaxButton, { row, cap, readOnly, comfortable, onChange }) : /* @__PURE__ */ jsx4(
|
|
785
819
|
InlineMaxInput,
|
|
786
820
|
{
|
|
787
821
|
label: row.label,
|
|
@@ -808,27 +842,27 @@ function InlineMaxButton({
|
|
|
808
842
|
const [open, setOpen] = React2.useState(false);
|
|
809
843
|
const own = row.userRule?.max_inline_chars ?? null;
|
|
810
844
|
const text = own !== null ? formatLimit(own) : limitPlaceholder(row, cap);
|
|
811
|
-
return /* @__PURE__ */
|
|
812
|
-
/* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ jsxs4(Popover, { open, onOpenChange: setOpen, children: [
|
|
846
|
+
/* @__PURE__ */ jsx4(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs4(
|
|
813
847
|
"button",
|
|
814
848
|
{
|
|
815
849
|
type: "button",
|
|
816
850
|
"aria-label": `Inline max ${row.label}: ${text}`,
|
|
817
851
|
disabled: readOnly,
|
|
818
|
-
className:
|
|
852
|
+
className: cn3(
|
|
819
853
|
"relative inline-flex min-w-[2.25rem] items-center justify-end gap-1 rounded px-1 tabular-nums hover:bg-accent disabled:opacity-60",
|
|
820
854
|
comfortable ? "h-8 after:absolute after:-inset-y-1.5 after:inset-x-0 after:content-['']" : "h-6",
|
|
821
855
|
own === null ? "text-muted-foreground" : "text-foreground"
|
|
822
856
|
),
|
|
823
857
|
children: [
|
|
824
|
-
own !== null ? /* @__PURE__ */
|
|
858
|
+
own !== null ? /* @__PURE__ */ jsx4("span", { "aria-hidden": true, className: "h-1 w-1 rounded-full bg-primary" }) : null,
|
|
825
859
|
text
|
|
826
860
|
]
|
|
827
861
|
}
|
|
828
862
|
) }),
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ jsx4(PopoverContent, { align: "end", className: "w-auto p-2", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 text-xs", children: [
|
|
864
|
+
/* @__PURE__ */ jsx4("span", { className: "text-muted-foreground", children: "Inline max" }),
|
|
865
|
+
/* @__PURE__ */ jsx4(
|
|
832
866
|
InlineMaxInput,
|
|
833
867
|
{
|
|
834
868
|
label: row.label,
|
|
@@ -853,13 +887,13 @@ import {
|
|
|
853
887
|
PopoverContent as PopoverContent2,
|
|
854
888
|
PopoverTrigger as PopoverTrigger2,
|
|
855
889
|
Switch as Switch2,
|
|
856
|
-
Tooltip as
|
|
857
|
-
TooltipContent as
|
|
858
|
-
TooltipProvider as
|
|
859
|
-
TooltipTrigger as
|
|
860
|
-
cn as
|
|
890
|
+
Tooltip as Tooltip4,
|
|
891
|
+
TooltipContent as TooltipContent4,
|
|
892
|
+
TooltipProvider as TooltipProvider3,
|
|
893
|
+
TooltipTrigger as TooltipTrigger4,
|
|
894
|
+
cn as cn4
|
|
861
895
|
} from "@ai-matrx/design-system";
|
|
862
|
-
import { jsx as
|
|
896
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
863
897
|
var BLIND_TOOLTIP = "This model can't read these values";
|
|
864
898
|
var BLIND_LABEL = "Not read";
|
|
865
899
|
function IconButton({
|
|
@@ -868,21 +902,21 @@ function IconButton({
|
|
|
868
902
|
comfortable,
|
|
869
903
|
children
|
|
870
904
|
}) {
|
|
871
|
-
return /* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
905
|
+
return /* @__PURE__ */ jsxs5(Tooltip4, { children: [
|
|
906
|
+
/* @__PURE__ */ jsx5(TooltipTrigger4, { asChild: true, children: /* @__PURE__ */ jsx5(
|
|
873
907
|
"button",
|
|
874
908
|
{
|
|
875
909
|
type: "button",
|
|
876
910
|
"aria-label": label,
|
|
877
911
|
onClick,
|
|
878
|
-
className:
|
|
912
|
+
className: cn4(
|
|
879
913
|
"inline-flex shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
880
914
|
comfortable ? "h-11 w-11" : "h-7 w-7"
|
|
881
915
|
),
|
|
882
916
|
children
|
|
883
917
|
}
|
|
884
918
|
) }),
|
|
885
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ jsx5(TooltipContent4, { children: label })
|
|
886
920
|
] });
|
|
887
921
|
}
|
|
888
922
|
function ContextRulesChip({
|
|
@@ -923,7 +957,7 @@ function ContextRulesChip({
|
|
|
923
957
|
const hasPage = on !== void 0 && !hierarchy;
|
|
924
958
|
const headerName = hierarchy ? "" : name;
|
|
925
959
|
const eyeOpen = !blind && on !== false;
|
|
926
|
-
const faceButton = /* @__PURE__ */
|
|
960
|
+
const faceButton = /* @__PURE__ */ jsxs5(
|
|
927
961
|
"button",
|
|
928
962
|
{
|
|
929
963
|
type: "button",
|
|
@@ -933,7 +967,7 @@ function ContextRulesChip({
|
|
|
933
967
|
"data-blind": blind ? "true" : void 0,
|
|
934
968
|
"aria-pressed": pressed,
|
|
935
969
|
onClick: isMobile ? () => setOpen(true) : void 0,
|
|
936
|
-
className:
|
|
970
|
+
className: cn4(
|
|
937
971
|
"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",
|
|
938
972
|
comfortable && "after:absolute after:-inset-x-1.5 after:-inset-y-2.5 after:content-['']",
|
|
939
973
|
!eyeOpen && "text-muted-foreground",
|
|
@@ -943,36 +977,36 @@ function ContextRulesChip({
|
|
|
943
977
|
className
|
|
944
978
|
),
|
|
945
979
|
children: [
|
|
946
|
-
eyeOpen ? /* @__PURE__ */
|
|
947
|
-
name ? /* @__PURE__ */
|
|
948
|
-
/* @__PURE__ */
|
|
949
|
-
warn ? /* @__PURE__ */
|
|
950
|
-
/* @__PURE__ */
|
|
980
|
+
eyeOpen ? /* @__PURE__ */ jsx5(EyeIcon, { className: "h-3 w-3 shrink-0" }) : /* @__PURE__ */ jsx5(EyeOffIcon, { className: "h-3 w-3 shrink-0" }),
|
|
981
|
+
name ? /* @__PURE__ */ jsx5("span", { className: "min-w-0 truncate", children: name }) : null,
|
|
982
|
+
/* @__PURE__ */ jsx5("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: count }),
|
|
983
|
+
warn ? /* @__PURE__ */ jsxs5("span", { className: "inline-flex shrink-0 items-center gap-0.5 tabular-nums text-warning", children: [
|
|
984
|
+
/* @__PURE__ */ jsx5(TriangleAlertIcon, { className: "h-3 w-3" }),
|
|
951
985
|
mismatchCount
|
|
952
986
|
] }) : null
|
|
953
987
|
]
|
|
954
988
|
}
|
|
955
989
|
);
|
|
956
990
|
const faceTip = blind ? BLIND_TOOLTIP : name ? null : faceName;
|
|
957
|
-
const withBlindTip = (trigger) => faceTip ? /* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
/* @__PURE__ */
|
|
991
|
+
const withBlindTip = (trigger) => faceTip ? /* @__PURE__ */ jsxs5(Tooltip4, { children: [
|
|
992
|
+
/* @__PURE__ */ jsx5(TooltipTrigger4, { asChild: true, children: trigger }),
|
|
993
|
+
/* @__PURE__ */ jsx5(TooltipContent4, { children: faceTip })
|
|
960
994
|
] }) : trigger;
|
|
961
|
-
const body = /* @__PURE__ */
|
|
962
|
-
/* @__PURE__ */
|
|
995
|
+
const body = /* @__PURE__ */ jsxs5("div", { className: "flex min-h-0 flex-col", children: [
|
|
996
|
+
/* @__PURE__ */ jsxs5(
|
|
963
997
|
"div",
|
|
964
998
|
{
|
|
965
|
-
className:
|
|
999
|
+
className: cn4(
|
|
966
1000
|
"flex shrink-0 items-center gap-2 border-b border-border px-3",
|
|
967
1001
|
comfortable ? "h-12" : "h-10"
|
|
968
1002
|
),
|
|
969
1003
|
children: [
|
|
970
|
-
eyeOpen ? /* @__PURE__ */
|
|
971
|
-
headerName ? /* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */
|
|
973
|
-
/* @__PURE__ */
|
|
974
|
-
blind ? /* @__PURE__ */
|
|
975
|
-
hasPage ? /* @__PURE__ */
|
|
1004
|
+
eyeOpen ? /* @__PURE__ */ jsx5(EyeIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ jsx5(EyeOffIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
1005
|
+
headerName ? /* @__PURE__ */ jsx5("span", { className: "min-w-0 truncate text-sm font-medium", children: headerName }) : null,
|
|
1006
|
+
/* @__PURE__ */ jsx5("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: `${count} \xB7 ${charsLabel} chars` }),
|
|
1007
|
+
/* @__PURE__ */ jsxs5("div", { className: "ml-auto flex shrink-0 items-center gap-0.5", children: [
|
|
1008
|
+
blind ? /* @__PURE__ */ jsx5("span", { className: "mr-1 text-xs text-muted-foreground", children: BLIND_LABEL }) : null,
|
|
1009
|
+
hasPage ? /* @__PURE__ */ jsx5(
|
|
976
1010
|
Switch2,
|
|
977
1011
|
{
|
|
978
1012
|
size: "sm",
|
|
@@ -983,8 +1017,8 @@ function ContextRulesChip({
|
|
|
983
1017
|
className: "mr-1"
|
|
984
1018
|
}
|
|
985
1019
|
) : null,
|
|
986
|
-
anyOverride && !readOnly ? /* @__PURE__ */
|
|
987
|
-
/* @__PURE__ */
|
|
1020
|
+
anyOverride && !readOnly ? /* @__PURE__ */ jsx5(IconButton, { label: "Reset all", onClick: onResetAll, comfortable, children: /* @__PURE__ */ jsx5(RotateCcwIcon, { className: "h-3.5 w-3.5" }) }) : null,
|
|
1021
|
+
/* @__PURE__ */ jsx5(
|
|
988
1022
|
IconButton,
|
|
989
1023
|
{
|
|
990
1024
|
label: "Open full view",
|
|
@@ -993,14 +1027,14 @@ function ContextRulesChip({
|
|
|
993
1027
|
setOpen(false);
|
|
994
1028
|
onOpenFullView();
|
|
995
1029
|
},
|
|
996
|
-
children: /* @__PURE__ */
|
|
1030
|
+
children: /* @__PURE__ */ jsx5(PanelRightIcon, { className: "h-3.5 w-3.5" })
|
|
997
1031
|
}
|
|
998
1032
|
)
|
|
999
1033
|
] })
|
|
1000
1034
|
]
|
|
1001
1035
|
}
|
|
1002
1036
|
),
|
|
1003
|
-
/* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ jsx5("div", { className: cn4("min-h-0 overflow-y-auto", comfortable ? "max-h-[70dvh]" : "max-h-[min(24rem,60vh)]"), children: /* @__PURE__ */ jsx5(
|
|
1004
1038
|
ContextRulesTable,
|
|
1005
1039
|
{
|
|
1006
1040
|
rows,
|
|
@@ -1016,14 +1050,14 @@ function ContextRulesChip({
|
|
|
1016
1050
|
) })
|
|
1017
1051
|
] });
|
|
1018
1052
|
if (isMobile) {
|
|
1019
|
-
return /* @__PURE__ */
|
|
1053
|
+
return /* @__PURE__ */ jsxs5(TooltipProvider3, { delayDuration: 300, titleTooltips: false, children: [
|
|
1020
1054
|
withBlindTip(faceButton),
|
|
1021
|
-
/* @__PURE__ */
|
|
1055
|
+
/* @__PURE__ */ jsx5(BottomSheet, { open, onOpenChange: setOpen, title: name || faceName, surface: "solid", children: body })
|
|
1022
1056
|
] });
|
|
1023
1057
|
}
|
|
1024
|
-
return /* @__PURE__ */
|
|
1025
|
-
withBlindTip(/* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
1058
|
+
return /* @__PURE__ */ jsx5(TooltipProvider3, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ jsxs5(Popover2, { open, onOpenChange: setOpen, children: [
|
|
1059
|
+
withBlindTip(/* @__PURE__ */ jsx5(PopoverTrigger2, { asChild: true, children: faceButton })),
|
|
1060
|
+
/* @__PURE__ */ jsx5(
|
|
1027
1061
|
PopoverContent2,
|
|
1028
1062
|
{
|
|
1029
1063
|
align: "end",
|
|
@@ -1039,14 +1073,14 @@ import * as React5 from "react";
|
|
|
1039
1073
|
import {
|
|
1040
1074
|
Input as Input2,
|
|
1041
1075
|
Switch as Switch3,
|
|
1042
|
-
TooltipProvider as
|
|
1043
|
-
cn as
|
|
1076
|
+
TooltipProvider as TooltipProvider4,
|
|
1077
|
+
cn as cn7
|
|
1044
1078
|
} from "@ai-matrx/design-system";
|
|
1045
1079
|
|
|
1046
1080
|
// context/react/ContextDeliveredValue.tsx
|
|
1047
1081
|
import * as React4 from "react";
|
|
1048
|
-
import { ErrorBox, Skeleton, cn as
|
|
1049
|
-
import { jsx as
|
|
1082
|
+
import { ErrorBox, Skeleton, cn as cn5 } from "@ai-matrx/design-system";
|
|
1083
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1050
1084
|
function ContextDeliveredValue({
|
|
1051
1085
|
row,
|
|
1052
1086
|
load,
|
|
@@ -1054,10 +1088,10 @@ function ContextDeliveredValue({
|
|
|
1054
1088
|
}) {
|
|
1055
1089
|
const blocks = row.deliveredBlocks ?? [];
|
|
1056
1090
|
if (!row.delivered && !row.onRequest && blocks.length === 0) {
|
|
1057
|
-
return isServerAuthoritativeKey(row.key) ? /* @__PURE__ */
|
|
1091
|
+
return isServerAuthoritativeKey(row.key) ? /* @__PURE__ */ jsx6("p", { "data-testid": "context-server-fills", className: cn5("text-xs text-muted-foreground", className), children: "Filled in by the server" }) : null;
|
|
1058
1092
|
}
|
|
1059
|
-
return /* @__PURE__ */
|
|
1060
|
-
row.delivered ? /* @__PURE__ */
|
|
1093
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn5("flex flex-col gap-3", className), children: [
|
|
1094
|
+
row.delivered ? /* @__PURE__ */ jsx6(
|
|
1061
1095
|
DeliveredSection,
|
|
1062
1096
|
{
|
|
1063
1097
|
title: "Agent received",
|
|
@@ -1066,7 +1100,7 @@ function ContextDeliveredValue({
|
|
|
1066
1100
|
load
|
|
1067
1101
|
}
|
|
1068
1102
|
) : null,
|
|
1069
|
-
blocks.map((block) => /* @__PURE__ */
|
|
1103
|
+
blocks.map((block) => /* @__PURE__ */ jsx6(
|
|
1070
1104
|
DeliveredSection,
|
|
1071
1105
|
{
|
|
1072
1106
|
title: block.label,
|
|
@@ -1079,7 +1113,7 @@ function ContextDeliveredValue({
|
|
|
1079
1113
|
row.onRequest || row.delivery === "on_request" && row.delivered ? (
|
|
1080
1114
|
// A lazy value (a document, a file family …) carries no ref: the turn never reads
|
|
1081
1115
|
// it. It is fetched — and sized — when opened.
|
|
1082
|
-
/* @__PURE__ */
|
|
1116
|
+
/* @__PURE__ */ jsx6(
|
|
1083
1117
|
DeliveredSection,
|
|
1084
1118
|
{
|
|
1085
1119
|
title: "Returned on request",
|
|
@@ -1089,7 +1123,7 @@ function ContextDeliveredValue({
|
|
|
1089
1123
|
}
|
|
1090
1124
|
)
|
|
1091
1125
|
) : null,
|
|
1092
|
-
row.delivered && CONTEXT_FETCHABLE_ROWS[row.key] ? /* @__PURE__ */
|
|
1126
|
+
row.delivered && CONTEXT_FETCHABLE_ROWS[row.key] ? /* @__PURE__ */ jsx6(
|
|
1093
1127
|
DeliveredSection,
|
|
1094
1128
|
{
|
|
1095
1129
|
title: "Agent can fetch",
|
|
@@ -1136,18 +1170,18 @@ function DeliveredSection({
|
|
|
1136
1170
|
};
|
|
1137
1171
|
}, [load, kind, key, attempt]);
|
|
1138
1172
|
const unavailable = loaded.state === "done" && !loaded.available;
|
|
1139
|
-
return /* @__PURE__ */
|
|
1140
|
-
/* @__PURE__ */
|
|
1141
|
-
/* @__PURE__ */
|
|
1142
|
-
unavailable ? /* @__PURE__ */
|
|
1173
|
+
return /* @__PURE__ */ jsxs6("section", { className: "flex flex-col gap-1", "aria-label": title, "data-view-kind": kind, "data-view-key": key, children: [
|
|
1174
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-baseline gap-2 text-xs", children: [
|
|
1175
|
+
/* @__PURE__ */ jsx6("span", { className: "font-medium", children: title }),
|
|
1176
|
+
unavailable ? /* @__PURE__ */ jsx6(
|
|
1143
1177
|
"span",
|
|
1144
1178
|
{
|
|
1145
1179
|
"data-testid": "context-delivered-unavailable",
|
|
1146
1180
|
className: "rounded border border-border px-1.5 text-[11px] text-muted-foreground",
|
|
1147
1181
|
children: "Not available to this agent"
|
|
1148
1182
|
}
|
|
1149
|
-
) : ref_ || loaded.state === "done" ? /* @__PURE__ */
|
|
1150
|
-
loaded.state === "done" && loaded.fetched === false ? /* @__PURE__ */
|
|
1183
|
+
) : ref_ || loaded.state === "done" ? /* @__PURE__ */ jsx6("span", { className: "tabular-nums text-muted-foreground", children: `${formatChars(ref_ ? ref_.chars : loaded.state === "done" ? loaded.chars : 0)} chars` }) : null,
|
|
1184
|
+
loaded.state === "done" && loaded.fetched === false ? /* @__PURE__ */ jsx6(
|
|
1151
1185
|
"span",
|
|
1152
1186
|
{
|
|
1153
1187
|
"data-testid": "context-delivered-not-read",
|
|
@@ -1156,9 +1190,9 @@ function DeliveredSection({
|
|
|
1156
1190
|
}
|
|
1157
1191
|
) : null
|
|
1158
1192
|
] }),
|
|
1159
|
-
unavailable ? null : !load ? /* @__PURE__ */
|
|
1160
|
-
/* @__PURE__ */
|
|
1161
|
-
/* @__PURE__ */
|
|
1193
|
+
unavailable ? null : !load ? /* @__PURE__ */ jsx6("span", { className: "text-xs text-muted-foreground", children: "\u2014" }) : loaded.state === "loading" ? /* @__PURE__ */ jsx6(Skeleton, { "data-testid": "context-delivered-loading", className: "h-16 w-full" }) : loaded.state === "error" ? /* @__PURE__ */ jsxs6(ErrorBox, { as: "div", message: loaded.message, className: "flex items-center gap-2 text-xs text-destructive", children: [
|
|
1194
|
+
/* @__PURE__ */ jsx6("span", { className: "min-w-0 truncate", title: loaded.message, children: loaded.message }),
|
|
1195
|
+
/* @__PURE__ */ jsx6(
|
|
1162
1196
|
"button",
|
|
1163
1197
|
{
|
|
1164
1198
|
type: "button",
|
|
@@ -1167,11 +1201,11 @@ function DeliveredSection({
|
|
|
1167
1201
|
children: "Retry"
|
|
1168
1202
|
}
|
|
1169
1203
|
)
|
|
1170
|
-
] }) : loaded.text === "" ? /* @__PURE__ */
|
|
1204
|
+
] }) : loaded.text === "" ? /* @__PURE__ */ jsx6("span", { "data-testid": "context-delivered-empty", className: "text-xs text-muted-foreground", children: "None" }) : /* @__PURE__ */ jsx6(
|
|
1171
1205
|
"pre",
|
|
1172
1206
|
{
|
|
1173
1207
|
"data-testid": "context-delivered-text",
|
|
1174
|
-
className:
|
|
1208
|
+
className: cn5(
|
|
1175
1209
|
"max-h-[min(50dvh,22rem)] cursor-text select-text overflow-auto",
|
|
1176
1210
|
"whitespace-pre-wrap break-words rounded border border-border",
|
|
1177
1211
|
"bg-muted/40 p-2 font-mono text-[11px] text-foreground"
|
|
@@ -1183,8 +1217,8 @@ function DeliveredSection({
|
|
|
1183
1217
|
}
|
|
1184
1218
|
|
|
1185
1219
|
// context/react/ContextReceiptBlocks.tsx
|
|
1186
|
-
import { cn as
|
|
1187
|
-
import { jsx as
|
|
1220
|
+
import { cn as cn6 } from "@ai-matrx/design-system";
|
|
1221
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1188
1222
|
function ContextReceiptBlocks({
|
|
1189
1223
|
blocks,
|
|
1190
1224
|
selectedId,
|
|
@@ -1194,29 +1228,29 @@ function ContextReceiptBlocks({
|
|
|
1194
1228
|
}) {
|
|
1195
1229
|
if (blocks.length === 0) return null;
|
|
1196
1230
|
const comfortable = density === "comfortable";
|
|
1197
|
-
return /* @__PURE__ */
|
|
1198
|
-
/* @__PURE__ */
|
|
1231
|
+
return /* @__PURE__ */ jsx7("div", { role: "table", "aria-label": "Also sent", className: cn6("text-xs", className), children: /* @__PURE__ */ jsxs7("div", { role: "rowgroup", children: [
|
|
1232
|
+
/* @__PURE__ */ jsx7(
|
|
1199
1233
|
"div",
|
|
1200
1234
|
{
|
|
1201
1235
|
role: "row",
|
|
1202
1236
|
className: "flex h-6 items-center bg-muted/40 px-2 font-medium text-muted-foreground",
|
|
1203
|
-
children: /* @__PURE__ */
|
|
1237
|
+
children: /* @__PURE__ */ jsx7("span", { role: "cell", children: "Also sent" })
|
|
1204
1238
|
}
|
|
1205
1239
|
),
|
|
1206
|
-
blocks.map((block) => /* @__PURE__ */
|
|
1240
|
+
blocks.map((block) => /* @__PURE__ */ jsxs7(
|
|
1207
1241
|
"div",
|
|
1208
1242
|
{
|
|
1209
1243
|
role: "row",
|
|
1210
1244
|
"data-block-id": block.id,
|
|
1211
1245
|
"aria-selected": selectedId === block.id || void 0,
|
|
1212
|
-
className:
|
|
1246
|
+
className: cn6(
|
|
1213
1247
|
CONTEXT_RULES_GRID[density],
|
|
1214
1248
|
"border-b border-border/50",
|
|
1215
1249
|
comfortable ? "min-h-11" : "h-7",
|
|
1216
1250
|
selectedId === block.id && "bg-accent"
|
|
1217
1251
|
),
|
|
1218
1252
|
children: [
|
|
1219
|
-
/* @__PURE__ */
|
|
1253
|
+
/* @__PURE__ */ jsx7("div", { role: "cell", className: "col-span-2 flex min-w-0 items-center", children: onOpenBlock ? /* @__PURE__ */ jsx7(
|
|
1220
1254
|
"button",
|
|
1221
1255
|
{
|
|
1222
1256
|
type: "button",
|
|
@@ -1225,9 +1259,9 @@ function ContextReceiptBlocks({
|
|
|
1225
1259
|
className: "block min-w-0 flex-1 truncate text-left hover:underline focus-visible:underline focus-visible:outline-none",
|
|
1226
1260
|
children: block.label
|
|
1227
1261
|
}
|
|
1228
|
-
) : /* @__PURE__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1262
|
+
) : /* @__PURE__ */ jsx7("span", { title: block.label, className: "block min-w-0 flex-1 truncate", children: block.label }) }),
|
|
1263
|
+
/* @__PURE__ */ jsx7("div", { role: "cell", className: "text-right tabular-nums", children: formatChars(block.delivered.chars) }),
|
|
1264
|
+
/* @__PURE__ */ jsx7("div", { role: "cell" })
|
|
1231
1265
|
]
|
|
1232
1266
|
},
|
|
1233
1267
|
block.id
|
|
@@ -1239,12 +1273,12 @@ function ContextReceiptBlockDetail({
|
|
|
1239
1273
|
load,
|
|
1240
1274
|
className
|
|
1241
1275
|
}) {
|
|
1242
|
-
return /* @__PURE__ */
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
/* @__PURE__ */
|
|
1245
|
-
/* @__PURE__ */
|
|
1276
|
+
return /* @__PURE__ */ jsxs7("div", { className: cn6("flex flex-col gap-3 p-3", className), children: [
|
|
1277
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
1278
|
+
/* @__PURE__ */ jsx7("h3", { className: "min-w-0 truncate text-sm font-medium", children: block.label }),
|
|
1279
|
+
/* @__PURE__ */ jsx7("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: `${formatChars(block.delivered.chars)} chars \xB7 ${DELIVERY_LABEL.inline}` })
|
|
1246
1280
|
] }),
|
|
1247
|
-
/* @__PURE__ */
|
|
1281
|
+
/* @__PURE__ */ jsx7(
|
|
1248
1282
|
DeliveredSection,
|
|
1249
1283
|
{
|
|
1250
1284
|
title: "Agent received",
|
|
@@ -1257,7 +1291,7 @@ function ContextReceiptBlockDetail({
|
|
|
1257
1291
|
}
|
|
1258
1292
|
|
|
1259
1293
|
// context/react/ContextRulesPanelBody.tsx
|
|
1260
|
-
import { Fragment as Fragment2, jsx as
|
|
1294
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1261
1295
|
function layerCells(row) {
|
|
1262
1296
|
const { surface, agent, default_max } = row.layers ?? {};
|
|
1263
1297
|
const declared = agent?.declared === true;
|
|
@@ -1280,38 +1314,38 @@ function layerCells(row) {
|
|
|
1280
1314
|
var LAYERS = ["default", "page", "agent", "you"];
|
|
1281
1315
|
function LayerTable({ row }) {
|
|
1282
1316
|
const cells = layerCells(row);
|
|
1283
|
-
const cell = (text, winning) => /* @__PURE__ */
|
|
1317
|
+
const cell = (text, winning) => /* @__PURE__ */ jsx8(
|
|
1284
1318
|
"span",
|
|
1285
1319
|
{
|
|
1286
1320
|
role: "cell",
|
|
1287
1321
|
"data-winning": winning ? "true" : void 0,
|
|
1288
|
-
className:
|
|
1322
|
+
className: cn7(
|
|
1289
1323
|
"rounded px-1.5 py-0.5 text-right tabular-nums",
|
|
1290
1324
|
winning ? "bg-primary/10 font-medium text-foreground" : "text-muted-foreground"
|
|
1291
1325
|
),
|
|
1292
1326
|
children: text
|
|
1293
1327
|
}
|
|
1294
1328
|
);
|
|
1295
|
-
return /* @__PURE__ */
|
|
1296
|
-
/* @__PURE__ */
|
|
1329
|
+
return /* @__PURE__ */ jsxs8("div", { role: "table", "aria-label": "Layers", className: "text-xs", children: [
|
|
1330
|
+
/* @__PURE__ */ jsxs8(
|
|
1297
1331
|
"div",
|
|
1298
1332
|
{
|
|
1299
1333
|
role: "row",
|
|
1300
1334
|
className: "grid h-7 grid-cols-[1fr_5rem_5rem] items-center gap-x-2 border-b border-border font-medium text-muted-foreground",
|
|
1301
1335
|
children: [
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */
|
|
1336
|
+
/* @__PURE__ */ jsx8("span", { role: "columnheader", children: "Layer" }),
|
|
1337
|
+
/* @__PURE__ */ jsx8("span", { role: "columnheader", className: "text-right", children: "Include" }),
|
|
1338
|
+
/* @__PURE__ */ jsx8("span", { role: "columnheader", className: "text-right", children: "Inline max" })
|
|
1305
1339
|
]
|
|
1306
1340
|
}
|
|
1307
1341
|
),
|
|
1308
|
-
LAYERS.map((layer) => /* @__PURE__ */
|
|
1342
|
+
LAYERS.map((layer) => /* @__PURE__ */ jsxs8(
|
|
1309
1343
|
"div",
|
|
1310
1344
|
{
|
|
1311
1345
|
role: "row",
|
|
1312
1346
|
className: "grid h-7 grid-cols-[1fr_5rem_5rem] items-center gap-x-2 border-b border-border/50",
|
|
1313
1347
|
children: [
|
|
1314
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ jsx8("span", { role: "cell", children: LAYER_LABEL[layer] }),
|
|
1315
1349
|
cell(cells[layer].include, row.decided_by.include === layer),
|
|
1316
1350
|
cell(cells[layer].limit, row.decided_by.max_inline_chars === layer)
|
|
1317
1351
|
]
|
|
@@ -1330,29 +1364,28 @@ function RowDetail({
|
|
|
1330
1364
|
comfortable,
|
|
1331
1365
|
loadView
|
|
1332
1366
|
}) {
|
|
1333
|
-
return /* @__PURE__ */
|
|
1334
|
-
/* @__PURE__ */
|
|
1335
|
-
/* @__PURE__ */
|
|
1336
|
-
/* @__PURE__ */
|
|
1367
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-3 p-3", children: [
|
|
1368
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
1369
|
+
/* @__PURE__ */ jsx8("h3", { className: "min-w-0 truncate text-sm font-medium", children: row.label }),
|
|
1370
|
+
/* @__PURE__ */ jsx8("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: `${formatChars(row.chars)} chars \xB7 ${DELIVERY_LABEL[row.delivery]}` })
|
|
1337
1371
|
] }),
|
|
1338
|
-
mismatches.length > 0 ? /* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1340
|
-
/* @__PURE__ */
|
|
1372
|
+
mismatches.length > 0 ? /* @__PURE__ */ jsxs8("div", { className: "flex items-start gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-2 py-1.5 text-xs text-warning", children: [
|
|
1373
|
+
/* @__PURE__ */ jsx8(TriangleAlertIcon, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
|
|
1374
|
+
/* @__PURE__ */ jsx8("span", { children: describeMismatches(mismatches) })
|
|
1341
1375
|
] }) : null,
|
|
1342
|
-
/* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1376
|
+
/* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-[auto_1fr] items-center gap-x-4 gap-y-2 text-xs", children: [
|
|
1377
|
+
/* @__PURE__ */ jsx8("span", { className: "text-muted-foreground", children: "Include" }),
|
|
1378
|
+
/* @__PURE__ */ jsx8("div", { className: cn7("flex items-center", comfortable ? "h-11" : "h-7"), children: readOnly ? /* @__PURE__ */ jsx8(FrozenInclude, { name: row.label, checked: row.include }) : /* @__PURE__ */ jsx8(
|
|
1345
1379
|
Switch3,
|
|
1346
1380
|
{
|
|
1347
1381
|
size: "sm",
|
|
1348
1382
|
"aria-label": `Include ${row.label}`,
|
|
1349
1383
|
checked: row.include,
|
|
1350
|
-
disabled: readOnly,
|
|
1351
1384
|
onCheckedChange: (next) => onChange(row.key, row.surfaceKey, withInclude(row, next))
|
|
1352
1385
|
}
|
|
1353
1386
|
) }),
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
/* @__PURE__ */
|
|
1387
|
+
/* @__PURE__ */ jsx8("span", { className: "text-muted-foreground", children: "Inline max" }),
|
|
1388
|
+
/* @__PURE__ */ jsx8("div", { className: "flex", children: /* @__PURE__ */ jsx8(
|
|
1356
1389
|
InlineMaxInput,
|
|
1357
1390
|
{
|
|
1358
1391
|
label: row.label,
|
|
@@ -1366,8 +1399,8 @@ function RowDetail({
|
|
|
1366
1399
|
}
|
|
1367
1400
|
) })
|
|
1368
1401
|
] }),
|
|
1369
|
-
/* @__PURE__ */
|
|
1370
|
-
/* @__PURE__ */
|
|
1402
|
+
/* @__PURE__ */ jsx8(LayerTable, { row }),
|
|
1403
|
+
/* @__PURE__ */ jsx8(ContextDeliveredValue, { row, load: loadView }),
|
|
1371
1404
|
renderDetail ? renderDetail(row) : null
|
|
1372
1405
|
] });
|
|
1373
1406
|
}
|
|
@@ -1410,9 +1443,9 @@ function ContextRulesPanelBody({
|
|
|
1410
1443
|
const openedBlock = openBlockId ? (blocks ?? []).find((b) => b.id === openBlockId) ?? null : null;
|
|
1411
1444
|
const selected = !openedBlock && selectedKey ? rows.find((r) => r.key === selectedKey) ?? null : null;
|
|
1412
1445
|
const comfortable = !!isMobile;
|
|
1413
|
-
const search = /* @__PURE__ */
|
|
1414
|
-
/* @__PURE__ */
|
|
1415
|
-
/* @__PURE__ */
|
|
1446
|
+
const search = /* @__PURE__ */ jsxs8("div", { className: "relative shrink-0 border-b border-border p-2", children: [
|
|
1447
|
+
/* @__PURE__ */ jsx8(SearchIcon, { className: "pointer-events-none absolute left-4 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
1448
|
+
/* @__PURE__ */ jsx8(
|
|
1416
1449
|
Input2,
|
|
1417
1450
|
{
|
|
1418
1451
|
type: "search",
|
|
@@ -1420,12 +1453,12 @@ function ContextRulesPanelBody({
|
|
|
1420
1453
|
placeholder: "Search",
|
|
1421
1454
|
value: query,
|
|
1422
1455
|
onChange: (e) => setQuery(e.target.value),
|
|
1423
|
-
className:
|
|
1456
|
+
className: cn7("pl-7 shadow-none", comfortable ? "h-11 text-base" : "h-8 text-xs")
|
|
1424
1457
|
}
|
|
1425
1458
|
)
|
|
1426
1459
|
] });
|
|
1427
|
-
const table = /* @__PURE__ */
|
|
1428
|
-
/* @__PURE__ */
|
|
1460
|
+
const table = /* @__PURE__ */ jsxs8("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
|
|
1461
|
+
/* @__PURE__ */ jsx8(
|
|
1429
1462
|
ContextRulesTable,
|
|
1430
1463
|
{
|
|
1431
1464
|
rows: visible,
|
|
@@ -1440,7 +1473,7 @@ function ContextRulesPanelBody({
|
|
|
1440
1473
|
...mismatches ? { mismatches } : {}
|
|
1441
1474
|
}
|
|
1442
1475
|
),
|
|
1443
|
-
/* @__PURE__ */
|
|
1476
|
+
/* @__PURE__ */ jsx8(
|
|
1444
1477
|
ContextReceiptBlocks,
|
|
1445
1478
|
{
|
|
1446
1479
|
blocks: visibleBlocks,
|
|
@@ -1450,7 +1483,7 @@ function ContextRulesPanelBody({
|
|
|
1450
1483
|
}
|
|
1451
1484
|
)
|
|
1452
1485
|
] });
|
|
1453
|
-
const detail = openedBlock ? /* @__PURE__ */
|
|
1486
|
+
const detail = openedBlock ? /* @__PURE__ */ jsx8(ContextReceiptBlockDetail, { block: openedBlock, load: loadView }) : selected ? /* @__PURE__ */ jsx8(
|
|
1454
1487
|
RowDetail,
|
|
1455
1488
|
{
|
|
1456
1489
|
row: selected,
|
|
@@ -1464,31 +1497,31 @@ function ContextRulesPanelBody({
|
|
|
1464
1497
|
}
|
|
1465
1498
|
) : null;
|
|
1466
1499
|
if (isMobile) {
|
|
1467
|
-
return /* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1500
|
+
return /* @__PURE__ */ jsx8(TooltipProvider4, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ jsx8("div", { className: cn7("flex h-full min-h-0 flex-col", className), children: detail ? /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1501
|
+
/* @__PURE__ */ jsx8("div", { className: "flex h-12 shrink-0 items-center border-b border-border px-1", children: /* @__PURE__ */ jsxs8(
|
|
1469
1502
|
"button",
|
|
1470
1503
|
{
|
|
1471
1504
|
type: "button",
|
|
1472
1505
|
onClick: () => select(null),
|
|
1473
1506
|
className: "inline-flex h-11 items-center gap-1 rounded-md px-2 text-sm text-muted-foreground hover:text-foreground",
|
|
1474
1507
|
children: [
|
|
1475
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ jsx8(ChevronLeftIcon, { className: "h-4 w-4" }),
|
|
1476
1509
|
"Back"
|
|
1477
1510
|
]
|
|
1478
1511
|
}
|
|
1479
1512
|
) }),
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
] }) : /* @__PURE__ */
|
|
1513
|
+
/* @__PURE__ */ jsx8("div", { className: "min-h-0 flex-1 overflow-y-auto", children: detail })
|
|
1514
|
+
] }) : /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1482
1515
|
search,
|
|
1483
1516
|
table
|
|
1484
1517
|
] }) }) });
|
|
1485
1518
|
}
|
|
1486
|
-
return /* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1519
|
+
return /* @__PURE__ */ jsx8(TooltipProvider4, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ jsxs8("div", { className: cn7("flex h-full min-h-0", className), children: [
|
|
1520
|
+
/* @__PURE__ */ jsxs8("aside", { className: "flex w-[22rem] shrink-0 flex-col border-r border-border", children: [
|
|
1488
1521
|
search,
|
|
1489
1522
|
table
|
|
1490
1523
|
] }),
|
|
1491
|
-
/* @__PURE__ */
|
|
1524
|
+
/* @__PURE__ */ jsx8("section", { className: "min-h-0 min-w-0 flex-1 overflow-y-auto", children: detail ?? /* @__PURE__ */ jsx8("div", { className: "flex h-full items-center justify-center text-xs text-muted-foreground", children: "Select an item" }) })
|
|
1492
1525
|
] }) });
|
|
1493
1526
|
}
|
|
1494
1527
|
export {
|