@ai-matrx/agents 0.59.214 → 0.59.215
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 +6 -2
- package/dist/catalog/react/index.cjs +29 -31
- package/dist/catalog/react/index.js +1 -3
- package/dist/context/react/index.cjs +171 -205
- package/dist/context/react/index.js +172 -201
- package/dist/mandates/index.cjs +2 -2
- package/dist/mandates/index.d.cts +4 -4
- package/dist/mandates/index.d.ts +4 -4
- package/dist/mandates/index.js +2 -2
- package/dist/models/react/index.cjs +339 -436
- package/dist/models/react/index.js +346 -432
- package/dist/settings/react/index.cjs +116 -173
- package/dist/settings/react/index.js +126 -172
- package/dist/versions/react/index.cjs +15 -68
- package/dist/versions/react/index.js +83 -121
- package/package.json +5 -5
|
@@ -398,116 +398,70 @@ import { ErrorBox } from "@ai-matrx/design-system";
|
|
|
398
398
|
import { Button, Switch } from "@ai-matrx/design-system/controls";
|
|
399
399
|
|
|
400
400
|
// settings/react/settings-icons.tsx
|
|
401
|
-
import {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
var
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
var
|
|
424
|
-
/* @__PURE__ */ jsx("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
425
|
-
/* @__PURE__ */ jsx("path", { d: "M12 9v4" }),
|
|
426
|
-
/* @__PURE__ */ jsx("path", { d: "M12 17h.01" })
|
|
427
|
-
] });
|
|
428
|
-
var VariableGlyph = ({ className }) => /* @__PURE__ */ jsxs(Svg, { className, children: [
|
|
429
|
-
/* @__PURE__ */ jsx("path", { d: "M8 21s-4-3-4-9 4-9 4-9" }),
|
|
430
|
-
/* @__PURE__ */ jsx("path", { d: "M16 3s4 3 4 9-4 9-4 9" }),
|
|
431
|
-
/* @__PURE__ */ jsx("line", { x1: "15", x2: "9", y1: "9", y2: "15" }),
|
|
432
|
-
/* @__PURE__ */ jsx("line", { x1: "9", x2: "15", y1: "9", y2: "15" })
|
|
433
|
-
] });
|
|
434
|
-
var UnlinkGlyph = ({ className }) => /* @__PURE__ */ jsxs(Svg, { className, children: [
|
|
435
|
-
/* @__PURE__ */ jsx("path", { d: "m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71" }),
|
|
436
|
-
/* @__PURE__ */ jsx("path", { d: "m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71" }),
|
|
437
|
-
/* @__PURE__ */ jsx("line", { x1: "8", x2: "8", y1: "2", y2: "5" }),
|
|
438
|
-
/* @__PURE__ */ jsx("line", { x1: "2", x2: "5", y1: "8", y2: "8" }),
|
|
439
|
-
/* @__PURE__ */ jsx("line", { x1: "16", x2: "16", y1: "19", y2: "22" }),
|
|
440
|
-
/* @__PURE__ */ jsx("line", { x1: "19", x2: "22", y1: "16", y2: "16" })
|
|
441
|
-
] });
|
|
442
|
-
var WrenchGlyph = ({ className }) => /* @__PURE__ */ jsx(Svg, { className, children: /* @__PURE__ */ jsx("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z" }) });
|
|
443
|
-
var Trash2Glyph = ({ className }) => /* @__PURE__ */ jsxs(Svg, { className, children: [
|
|
444
|
-
/* @__PURE__ */ jsx("path", { d: "M10 11v6" }),
|
|
445
|
-
/* @__PURE__ */ jsx("path", { d: "M14 11v6" }),
|
|
446
|
-
/* @__PURE__ */ jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }),
|
|
447
|
-
/* @__PURE__ */ jsx("path", { d: "M3 6h18" }),
|
|
448
|
-
/* @__PURE__ */ jsx("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
449
|
-
] });
|
|
450
|
-
var RotateCcwGlyph = ({ className }) => /* @__PURE__ */ jsxs(Svg, { className, children: [
|
|
451
|
-
/* @__PURE__ */ jsx("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
452
|
-
/* @__PURE__ */ jsx("path", { d: "M3 3v5h5" })
|
|
453
|
-
] });
|
|
454
|
-
var ImageGlyph = ({ className }) => /* @__PURE__ */ jsxs(Svg, { className, children: [
|
|
455
|
-
/* @__PURE__ */ jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2" }),
|
|
456
|
-
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "9", r: "2" }),
|
|
457
|
-
/* @__PURE__ */ jsx("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
|
|
458
|
-
] });
|
|
459
|
-
var FileTextGlyph = ({ className }) => /* @__PURE__ */ jsxs(Svg, { className, children: [
|
|
460
|
-
/* @__PURE__ */ jsx("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
461
|
-
/* @__PURE__ */ jsx("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
|
|
462
|
-
/* @__PURE__ */ jsx("path", { d: "M10 9H8" }),
|
|
463
|
-
/* @__PURE__ */ jsx("path", { d: "M16 13H8" }),
|
|
464
|
-
/* @__PURE__ */ jsx("path", { d: "M16 17H8" })
|
|
465
|
-
] });
|
|
466
|
-
var YoutubeGlyph = ({ className }) => /* @__PURE__ */ jsxs(Svg, { className, children: [
|
|
467
|
-
/* @__PURE__ */ jsx("path", { d: "M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17" }),
|
|
468
|
-
/* @__PURE__ */ jsx("path", { d: "m10 15 5-3-5-3z" })
|
|
469
|
-
] });
|
|
401
|
+
import {
|
|
402
|
+
AlertTriangleIcon as GAlertTriangleIcon,
|
|
403
|
+
CircleCheckIcon as GCircleCheckIcon,
|
|
404
|
+
FileTextIcon as GFileTextIcon,
|
|
405
|
+
ImageIcon as GImageIcon,
|
|
406
|
+
RotateCcwIcon as GRotateCcwIcon,
|
|
407
|
+
Trash2Icon as GTrash2Icon,
|
|
408
|
+
UnlinkIcon as GUnlinkIcon,
|
|
409
|
+
VariableIcon as GVariableIcon,
|
|
410
|
+
WrenchIcon as GWrenchIcon,
|
|
411
|
+
YoutubeIcon as GYoutubeIcon
|
|
412
|
+
} from "@ai-matrx/design-system/icons";
|
|
413
|
+
var sized = (Glyph) => Glyph;
|
|
414
|
+
var CircleCheckGlyph = sized(GCircleCheckIcon);
|
|
415
|
+
var TriangleAlertGlyph = sized(GAlertTriangleIcon);
|
|
416
|
+
var VariableGlyph = sized(GVariableIcon);
|
|
417
|
+
var UnlinkGlyph = sized(GUnlinkIcon);
|
|
418
|
+
var WrenchGlyph = sized(GWrenchIcon);
|
|
419
|
+
var Trash2Glyph = sized(GTrash2Icon);
|
|
420
|
+
var RotateCcwGlyph = sized(GRotateCcwIcon);
|
|
421
|
+
var ImageGlyph = sized(GImageIcon);
|
|
422
|
+
var FileTextGlyph = sized(GFileTextIcon);
|
|
423
|
+
var YoutubeGlyph = sized(GYoutubeIcon);
|
|
470
424
|
|
|
471
425
|
// settings/react/SettingRowFrame.tsx
|
|
472
426
|
import { Label } from "@ai-matrx/design-system";
|
|
473
|
-
import {
|
|
474
|
-
|
|
427
|
+
import { cn } from "@ai-matrx/design-system/cn";
|
|
428
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
475
429
|
function formatSettingValue(value) {
|
|
476
430
|
if (typeof value === "boolean") return value ? "On" : "Off";
|
|
477
431
|
if (value !== null && typeof value === "object") return JSON.stringify(value);
|
|
478
432
|
return String(value);
|
|
479
433
|
}
|
|
480
434
|
function SettingRowFrame({ rowKey, state, leading, label, children, actions }) {
|
|
481
|
-
return /* @__PURE__ */
|
|
435
|
+
return /* @__PURE__ */ jsxs(
|
|
482
436
|
"div",
|
|
483
437
|
{
|
|
484
438
|
"data-setting-row": rowKey,
|
|
485
439
|
"data-setting-state": state,
|
|
486
440
|
className: "grid grid-cols-[1rem_minmax(0,1fr)_auto] items-start gap-x-2 gap-y-1 py-1 @md:grid-cols-[1rem_9rem_minmax(0,1fr)_auto]",
|
|
487
441
|
children: [
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
/* @__PURE__ */
|
|
490
|
-
children !== void 0 ? /* @__PURE__ */
|
|
491
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-7 items-center", children: leading }),
|
|
443
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-h-7 min-w-0 items-center", children: label }),
|
|
444
|
+
children !== void 0 ? /* @__PURE__ */ jsx("div", { className: "col-span-2 col-start-2 row-start-2 min-w-0 @md:col-span-1 @md:col-start-3 @md:row-start-1", children }) : null,
|
|
445
|
+
/* @__PURE__ */ jsx("div", { className: "col-start-3 row-start-1 flex min-h-7 items-center justify-end @md:col-start-4", children: actions })
|
|
492
446
|
]
|
|
493
447
|
}
|
|
494
448
|
);
|
|
495
449
|
}
|
|
496
450
|
function RowLabel({ htmlFor, muted, children }) {
|
|
497
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ jsx(Label, { htmlFor, className: cn("min-w-0 truncate type-body", muted ? "text-muted-foreground" : "text-foreground"), children });
|
|
498
452
|
}
|
|
499
453
|
function RowText({ children, mono }) {
|
|
500
|
-
return /* @__PURE__ */
|
|
454
|
+
return /* @__PURE__ */ jsx("span", { className: cn("flex min-h-7 items-center truncate type-secondary text-muted-foreground", mono && "font-mono"), children });
|
|
501
455
|
}
|
|
502
456
|
function SettingsGroupSection({ id, title, children }) {
|
|
503
|
-
return /* @__PURE__ */
|
|
504
|
-
title ? /* @__PURE__ */
|
|
457
|
+
return /* @__PURE__ */ jsxs("section", { "data-settings-group": id, className: title ? "mt-2 border-t border-border pt-2" : void 0, children: [
|
|
458
|
+
title ? /* @__PURE__ */ jsx("h3", { className: "pb-1 type-title text-foreground", children: title }) : null,
|
|
505
459
|
children
|
|
506
460
|
] });
|
|
507
461
|
}
|
|
508
462
|
|
|
509
463
|
// settings/react/InputCapabilitiesEditor.tsx
|
|
510
|
-
import { Fragment, jsx as
|
|
464
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
511
465
|
var GATE_META = {
|
|
512
466
|
image_urls: {
|
|
513
467
|
label: "Image URLs",
|
|
@@ -536,24 +490,24 @@ function InputCapabilitiesEditor({
|
|
|
536
490
|
title = "Input Capabilities",
|
|
537
491
|
disabled = false
|
|
538
492
|
}) {
|
|
539
|
-
return /* @__PURE__ */
|
|
493
|
+
return /* @__PURE__ */ jsxs2(SettingsGroupSection, { id: "input-capabilities", title, children: [
|
|
540
494
|
UI_GATE_EDITABLE_KEYS.map((key) => {
|
|
541
495
|
const { label, description, Icon } = GATE_META[key];
|
|
542
496
|
const switchId = `${idPrefix}-${key}`;
|
|
543
497
|
const changed = changedKeys?.has(key) === true;
|
|
544
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ jsx2(
|
|
545
499
|
SettingRowFrame,
|
|
546
500
|
{
|
|
547
501
|
rowKey: key,
|
|
548
502
|
state: values[key] === true ? "on" : "off",
|
|
549
|
-
leading: /* @__PURE__ */
|
|
550
|
-
label: /* @__PURE__ */
|
|
551
|
-
actions: /* @__PURE__ */
|
|
552
|
-
changed && onReset ? /* @__PURE__ */
|
|
503
|
+
leading: /* @__PURE__ */ jsx2(Icon, { className: "h-4 w-4 text-muted-foreground" }),
|
|
504
|
+
label: /* @__PURE__ */ jsx2(RowLabel, { htmlFor: switchId, children: label }),
|
|
505
|
+
actions: /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
506
|
+
changed && onReset ? /* @__PURE__ */ jsx2(
|
|
553
507
|
Button,
|
|
554
508
|
{
|
|
555
509
|
variant: "quiet",
|
|
556
|
-
icon: /* @__PURE__ */
|
|
510
|
+
icon: /* @__PURE__ */ jsx2(RotateCcwGlyph, {}),
|
|
557
511
|
onClick: () => onReset(key),
|
|
558
512
|
disabled,
|
|
559
513
|
"aria-label": `${resetLabel}: ${label}`,
|
|
@@ -561,7 +515,7 @@ function InputCapabilitiesEditor({
|
|
|
561
515
|
"data-setting-reset": key
|
|
562
516
|
}
|
|
563
517
|
) : null,
|
|
564
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ jsx2(
|
|
565
519
|
Switch,
|
|
566
520
|
{
|
|
567
521
|
id: switchId,
|
|
@@ -571,12 +525,12 @@ function InputCapabilitiesEditor({
|
|
|
571
525
|
}
|
|
572
526
|
)
|
|
573
527
|
] }),
|
|
574
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ jsx2(RowText, { children: description })
|
|
575
529
|
},
|
|
576
530
|
key
|
|
577
531
|
);
|
|
578
532
|
}),
|
|
579
|
-
error ? /* @__PURE__ */
|
|
533
|
+
error ? /* @__PURE__ */ jsx2(ErrorBox, { as: "p", className: "py-1 type-meta text-destructive", message: error }) : null
|
|
580
534
|
] });
|
|
581
535
|
}
|
|
582
536
|
|
|
@@ -599,7 +553,7 @@ import {
|
|
|
599
553
|
TooltipTrigger
|
|
600
554
|
} from "@ai-matrx/design-system";
|
|
601
555
|
import { AspectRatioSelect, OptionCombobox, isAspectRatioOptionSet } from "@ai-matrx/design-system/controls";
|
|
602
|
-
import { jsx as
|
|
556
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
603
557
|
var SELECT_MAX_OPTIONS = 12;
|
|
604
558
|
function choiceFor(options) {
|
|
605
559
|
if (isAspectRatioOptionSet(options)) return "aspect-ratio";
|
|
@@ -607,10 +561,10 @@ function choiceFor(options) {
|
|
|
607
561
|
return "select";
|
|
608
562
|
}
|
|
609
563
|
function WarningIcon({ className }) {
|
|
610
|
-
return /* @__PURE__ */
|
|
611
|
-
/* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
613
|
-
/* @__PURE__ */
|
|
564
|
+
return /* @__PURE__ */ jsxs3("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", className, children: [
|
|
565
|
+
/* @__PURE__ */ jsx3("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
566
|
+
/* @__PURE__ */ jsx3("path", { d: "M12 9v4" }),
|
|
567
|
+
/* @__PURE__ */ jsx3("path", { d: "M12 17h.01" })
|
|
614
568
|
] });
|
|
615
569
|
}
|
|
616
570
|
function flattenTypeObject(value) {
|
|
@@ -634,7 +588,7 @@ function SettingControlInput({
|
|
|
634
588
|
const isValueMismatch = stringValue !== "" && !control.enum.includes(stringValue);
|
|
635
589
|
const emit = (v) => onChange(settingKey === "response_format" ? { type: v } : v);
|
|
636
590
|
const choice = choiceFor(control.enum);
|
|
637
|
-
const picker = choice === "aspect-ratio" ? /* @__PURE__ */
|
|
591
|
+
const picker = choice === "aspect-ratio" ? /* @__PURE__ */ jsx3(
|
|
638
592
|
AspectRatioSelect,
|
|
639
593
|
{
|
|
640
594
|
value: isValueMismatch ? "" : stringValue,
|
|
@@ -645,7 +599,7 @@ function SettingControlInput({
|
|
|
645
599
|
id: inputId,
|
|
646
600
|
placeholder: "Default"
|
|
647
601
|
}
|
|
648
|
-
) : choice === "searchable" ? /* @__PURE__ */
|
|
602
|
+
) : choice === "searchable" ? /* @__PURE__ */ jsx3(
|
|
649
603
|
OptionCombobox,
|
|
650
604
|
{
|
|
651
605
|
value: isValueMismatch ? "" : stringValue,
|
|
@@ -657,23 +611,23 @@ function SettingControlInput({
|
|
|
657
611
|
placeholder: "Default"
|
|
658
612
|
}
|
|
659
613
|
) : null;
|
|
660
|
-
return /* @__PURE__ */
|
|
661
|
-
picker ?? /* @__PURE__ */
|
|
614
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-1 items-center gap-1.5", children: [
|
|
615
|
+
picker ?? /* @__PURE__ */ jsxs3(
|
|
662
616
|
Select,
|
|
663
617
|
{
|
|
664
618
|
value: isValueMismatch ? "" : stringValue,
|
|
665
619
|
onValueChange: emit,
|
|
666
620
|
disabled,
|
|
667
621
|
children: [
|
|
668
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ jsx3(
|
|
669
623
|
SelectTrigger,
|
|
670
624
|
{
|
|
671
625
|
id: inputId,
|
|
672
626
|
className: "h-7 flex-1 border-0 bg-transparent px-1 text-xs font-medium text-foreground shadow-none hover:bg-transparent focus:ring-0 pointer-coarse:h-11 [&_svg]:h-3 [&_svg]:w-3",
|
|
673
|
-
children: /* @__PURE__ */
|
|
627
|
+
children: /* @__PURE__ */ jsx3(SelectValue, { placeholder: isValueMismatch ? stringValue : "Default" })
|
|
674
628
|
}
|
|
675
629
|
),
|
|
676
|
-
/* @__PURE__ */
|
|
630
|
+
/* @__PURE__ */ jsx3(SelectContent, { className: "text-xs", children: control.enum.map((option) => /* @__PURE__ */ jsx3(
|
|
677
631
|
SelectItem,
|
|
678
632
|
{
|
|
679
633
|
value: option,
|
|
@@ -685,9 +639,9 @@ function SettingControlInput({
|
|
|
685
639
|
]
|
|
686
640
|
}
|
|
687
641
|
),
|
|
688
|
-
isValueMismatch && /* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
642
|
+
isValueMismatch && /* @__PURE__ */ jsx3(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs3(Tooltip, { children: [
|
|
643
|
+
/* @__PURE__ */ jsx3(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx3("span", { className: "shrink-0 cursor-help text-amber-500", children: /* @__PURE__ */ jsx3(WarningIcon, { className: "h-3.5 w-3.5" }) }) }),
|
|
644
|
+
/* @__PURE__ */ jsxs3(TooltipContent, { side: "top", className: "max-w-[220px] type-secondary", children: [
|
|
691
645
|
'"',
|
|
692
646
|
stringValue,
|
|
693
647
|
'" is not a recognized option for this model'
|
|
@@ -696,8 +650,8 @@ function SettingControlInput({
|
|
|
696
650
|
] });
|
|
697
651
|
}
|
|
698
652
|
if (control.type === "boolean") {
|
|
699
|
-
return /* @__PURE__ */
|
|
700
|
-
/* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
|
|
654
|
+
/* @__PURE__ */ jsx3(
|
|
701
655
|
Checkbox,
|
|
702
656
|
{
|
|
703
657
|
id: inputId,
|
|
@@ -707,7 +661,7 @@ function SettingControlInput({
|
|
|
707
661
|
className: "cursor-pointer"
|
|
708
662
|
}
|
|
709
663
|
),
|
|
710
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ jsx3(
|
|
711
665
|
Label2,
|
|
712
666
|
{
|
|
713
667
|
htmlFor: inputId,
|
|
@@ -720,7 +674,7 @@ function SettingControlInput({
|
|
|
720
674
|
if (control.type === "number" || control.type === "integer") {
|
|
721
675
|
const numeric = typeof value === "number" ? value : void 0;
|
|
722
676
|
const hasRange = control.min !== void 0 && control.max !== void 0;
|
|
723
|
-
return /* @__PURE__ */
|
|
677
|
+
return /* @__PURE__ */ jsx3(
|
|
724
678
|
NumberInput,
|
|
725
679
|
{
|
|
726
680
|
value: numeric,
|
|
@@ -738,7 +692,7 @@ function SettingControlInput({
|
|
|
738
692
|
}
|
|
739
693
|
if (control.type === "string_array") {
|
|
740
694
|
const arrayValue = Array.isArray(value) ? value.join("\n") : "";
|
|
741
|
-
return /* @__PURE__ */
|
|
695
|
+
return /* @__PURE__ */ jsx3(
|
|
742
696
|
Textarea,
|
|
743
697
|
{
|
|
744
698
|
id: inputId,
|
|
@@ -751,7 +705,7 @@ function SettingControlInput({
|
|
|
751
705
|
);
|
|
752
706
|
}
|
|
753
707
|
if (control.type === "array" || control.type === "object_array" || typeof value === "object" && value !== null) {
|
|
754
|
-
return /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ jsx3(
|
|
755
709
|
JsonValueInput,
|
|
756
710
|
{
|
|
757
711
|
id: inputId,
|
|
@@ -761,7 +715,7 @@ function SettingControlInput({
|
|
|
761
715
|
}
|
|
762
716
|
);
|
|
763
717
|
}
|
|
764
|
-
return /* @__PURE__ */
|
|
718
|
+
return /* @__PURE__ */ jsx3(
|
|
765
719
|
Input,
|
|
766
720
|
{
|
|
767
721
|
id: inputId,
|
|
@@ -786,8 +740,8 @@ function JsonValueInput({
|
|
|
786
740
|
setDraft(toText(value));
|
|
787
741
|
setJsonError(null);
|
|
788
742
|
}, [JSON.stringify(value)]);
|
|
789
|
-
return /* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
743
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-1", children: [
|
|
744
|
+
/* @__PURE__ */ jsx3(
|
|
791
745
|
Textarea,
|
|
792
746
|
{
|
|
793
747
|
id,
|
|
@@ -814,7 +768,7 @@ function JsonValueInput({
|
|
|
814
768
|
spellCheck: false
|
|
815
769
|
}
|
|
816
770
|
),
|
|
817
|
-
jsonError && /* @__PURE__ */
|
|
771
|
+
jsonError && /* @__PURE__ */ jsx3("p", { className: "type-meta text-amber-600 dark:text-amber-400", children: jsonError })
|
|
818
772
|
] });
|
|
819
773
|
}
|
|
820
774
|
function NumberInput({
|
|
@@ -848,12 +802,12 @@ function NumberInput({
|
|
|
848
802
|
} else setDraft(shown);
|
|
849
803
|
};
|
|
850
804
|
if (withSlider) {
|
|
851
|
-
return /* @__PURE__ */
|
|
805
|
+
return /* @__PURE__ */ jsxs3(
|
|
852
806
|
"div",
|
|
853
807
|
{
|
|
854
808
|
className: "grid grid-cols-[1fr_4.5rem] items-center gap-2",
|
|
855
809
|
children: [
|
|
856
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ jsx3(
|
|
857
811
|
Slider,
|
|
858
812
|
{
|
|
859
813
|
...min !== void 0 ? { min } : {},
|
|
@@ -871,7 +825,7 @@ function NumberInput({
|
|
|
871
825
|
disabled
|
|
872
826
|
}
|
|
873
827
|
),
|
|
874
|
-
/* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ jsx3(
|
|
875
829
|
Input,
|
|
876
830
|
{
|
|
877
831
|
type: "text",
|
|
@@ -892,7 +846,7 @@ function NumberInput({
|
|
|
892
846
|
}
|
|
893
847
|
);
|
|
894
848
|
}
|
|
895
|
-
return /* @__PURE__ */
|
|
849
|
+
return /* @__PURE__ */ jsx3(
|
|
896
850
|
Input,
|
|
897
851
|
{
|
|
898
852
|
type: "text",
|
|
@@ -912,28 +866,28 @@ function NumberInput({
|
|
|
912
866
|
}
|
|
913
867
|
|
|
914
868
|
// settings/react/ModelSettingsPanel.tsx
|
|
915
|
-
import { Fragment as Fragment2, jsx as
|
|
869
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
916
870
|
function StatusGlyph({ issue, source }) {
|
|
917
871
|
const title = issue ? issue.message : source ? `Valid \xB7 ${source}` : "Valid";
|
|
918
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ jsx4(
|
|
919
873
|
"span",
|
|
920
874
|
{
|
|
921
875
|
className: cn("inline-flex h-7 w-6 shrink-0 items-center justify-center", issue ? "text-warning" : "text-success"),
|
|
922
876
|
role: "img",
|
|
923
877
|
"aria-label": title,
|
|
924
878
|
title,
|
|
925
|
-
children: issue ? /* @__PURE__ */
|
|
879
|
+
children: issue ? /* @__PURE__ */ jsx4(TriangleAlertGlyph, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx4(CircleCheckGlyph, { className: "h-3.5 w-3.5" })
|
|
926
880
|
}
|
|
927
881
|
);
|
|
928
882
|
}
|
|
929
883
|
function ModelSettingRow({ row, control, target, idPrefix, disabled }) {
|
|
930
884
|
const read = target.read(row.key, control);
|
|
931
885
|
const resetLabel = target.resetLabel ?? "Reset to agent";
|
|
932
|
-
const reset = read.changedHere && target.resetToInherited ? /* @__PURE__ */
|
|
886
|
+
const reset = read.changedHere && target.resetToInherited ? /* @__PURE__ */ jsx4(
|
|
933
887
|
Button2,
|
|
934
888
|
{
|
|
935
889
|
variant: "quiet",
|
|
936
|
-
icon: /* @__PURE__ */
|
|
890
|
+
icon: /* @__PURE__ */ jsx4(RotateCcwGlyph, {}),
|
|
937
891
|
onClick: () => target.resetToInherited?.(row.key),
|
|
938
892
|
disabled,
|
|
939
893
|
"aria-label": `${resetLabel}: ${row.label}`,
|
|
@@ -942,20 +896,20 @@ function ModelSettingRow({ row, control, target, idPrefix, disabled }) {
|
|
|
942
896
|
}
|
|
943
897
|
) : null;
|
|
944
898
|
if (read.state === "bound") {
|
|
945
|
-
return /* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ jsx4(
|
|
946
900
|
SettingRowFrame,
|
|
947
901
|
{
|
|
948
902
|
rowKey: row.key,
|
|
949
903
|
state: "bound",
|
|
950
|
-
leading: /* @__PURE__ */
|
|
951
|
-
label: /* @__PURE__ */
|
|
952
|
-
actions: /* @__PURE__ */
|
|
904
|
+
leading: /* @__PURE__ */ jsx4(Checkbox2, { checked: true, disabled: true, "aria-label": `${row.label} is a run input` }),
|
|
905
|
+
label: /* @__PURE__ */ jsx4(RowLabel, { children: row.label }),
|
|
906
|
+
actions: /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
953
907
|
reset,
|
|
954
|
-
target.unbind ? /* @__PURE__ */
|
|
908
|
+
target.unbind ? /* @__PURE__ */ jsx4(
|
|
955
909
|
Button2,
|
|
956
910
|
{
|
|
957
911
|
variant: "quiet",
|
|
958
|
-
icon: /* @__PURE__ */
|
|
912
|
+
icon: /* @__PURE__ */ jsx4(UnlinkGlyph, {}),
|
|
959
913
|
onClick: () => target.unbind?.(row.key, control),
|
|
960
914
|
disabled,
|
|
961
915
|
"aria-label": `Make ${row.label} a fixed setting`,
|
|
@@ -963,9 +917,9 @@ function ModelSettingRow({ row, control, target, idPrefix, disabled }) {
|
|
|
963
917
|
}
|
|
964
918
|
) : null
|
|
965
919
|
] }),
|
|
966
|
-
children: /* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
920
|
+
children: /* @__PURE__ */ jsxs4("span", { className: "flex min-h-7 min-w-0 items-center gap-2", "data-bound-control": row.key, children: [
|
|
921
|
+
/* @__PURE__ */ jsx4(Chip, { tone: "primary", icon: /* @__PURE__ */ jsx4(VariableGlyph, {}), label: `{{${read.variableName}}}` }),
|
|
922
|
+
/* @__PURE__ */ jsx4("span", { className: "truncate type-meta text-muted-foreground", children: read.value === void 0 || read.value === null || read.value === "" ? "Model default" : formatSettingValue(read.value) })
|
|
969
923
|
] })
|
|
970
924
|
}
|
|
971
925
|
);
|
|
@@ -975,12 +929,12 @@ function ModelSettingRow({ row, control, target, idPrefix, disabled }) {
|
|
|
975
929
|
const isOff = isSet && isOffValue(value, control);
|
|
976
930
|
const checkboxId = `${idPrefix}-setting-${row.key}`;
|
|
977
931
|
const canBind = Boolean(target.bind) && (target.canBind?.(row.key) ?? true);
|
|
978
|
-
return /* @__PURE__ */
|
|
932
|
+
return /* @__PURE__ */ jsx4(
|
|
979
933
|
SettingRowFrame,
|
|
980
934
|
{
|
|
981
935
|
rowKey: row.key,
|
|
982
936
|
state: isOff ? "off" : read.state,
|
|
983
|
-
leading: /* @__PURE__ */
|
|
937
|
+
leading: /* @__PURE__ */ jsx4(
|
|
984
938
|
Checkbox2,
|
|
985
939
|
{
|
|
986
940
|
id: checkboxId,
|
|
@@ -989,14 +943,14 @@ function ModelSettingRow({ row, control, target, idPrefix, disabled }) {
|
|
|
989
943
|
onCheckedChange: (next) => next === true ? target.turnOn(row.key, control) : target.clear(row.key)
|
|
990
944
|
}
|
|
991
945
|
),
|
|
992
|
-
label: /* @__PURE__ */
|
|
993
|
-
actions: /* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
995
|
-
canBind ? /* @__PURE__ */
|
|
946
|
+
label: /* @__PURE__ */ jsx4(RowLabel, { htmlFor: checkboxId, muted: !isSet, children: row.label }),
|
|
947
|
+
actions: /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
948
|
+
/* @__PURE__ */ jsx4(StatusGlyph, { issue: read.issue, source: read.source }),
|
|
949
|
+
canBind ? /* @__PURE__ */ jsx4(
|
|
996
950
|
Button2,
|
|
997
951
|
{
|
|
998
952
|
variant: "quiet",
|
|
999
|
-
icon: /* @__PURE__ */
|
|
953
|
+
icon: /* @__PURE__ */ jsx4(VariableGlyph, {}),
|
|
1000
954
|
onClick: () => target.bind?.(row.key, control),
|
|
1001
955
|
disabled,
|
|
1002
956
|
"aria-label": `Make ${row.label} a run input`,
|
|
@@ -1004,11 +958,11 @@ function ModelSettingRow({ row, control, target, idPrefix, disabled }) {
|
|
|
1004
958
|
"data-bind-control": row.key
|
|
1005
959
|
}
|
|
1006
960
|
) : null,
|
|
1007
|
-
isSet && read.issue?.fixable && target.fix ? /* @__PURE__ */
|
|
961
|
+
isSet && read.issue?.fixable && target.fix ? /* @__PURE__ */ jsx4(
|
|
1008
962
|
Button2,
|
|
1009
963
|
{
|
|
1010
964
|
variant: "quiet",
|
|
1011
|
-
icon: /* @__PURE__ */
|
|
965
|
+
icon: /* @__PURE__ */ jsx4(WrenchGlyph, {}),
|
|
1012
966
|
onClick: () => target.fix?.(row.key),
|
|
1013
967
|
disabled,
|
|
1014
968
|
"aria-label": `Fix ${row.label} automatically`,
|
|
@@ -1016,12 +970,12 @@ function ModelSettingRow({ row, control, target, idPrefix, disabled }) {
|
|
|
1016
970
|
}
|
|
1017
971
|
) : null,
|
|
1018
972
|
reset,
|
|
1019
|
-
isSet ? /* @__PURE__ */
|
|
973
|
+
isSet ? /* @__PURE__ */ jsx4(
|
|
1020
974
|
Button2,
|
|
1021
975
|
{
|
|
1022
976
|
variant: "quiet",
|
|
1023
977
|
removes: true,
|
|
1024
|
-
icon: /* @__PURE__ */
|
|
978
|
+
icon: /* @__PURE__ */ jsx4(Trash2Glyph, {}),
|
|
1025
979
|
onClick: () => target.clear(row.key),
|
|
1026
980
|
disabled,
|
|
1027
981
|
"aria-label": `Clear ${row.label} to not set`,
|
|
@@ -1030,8 +984,8 @@ function ModelSettingRow({ row, control, target, idPrefix, disabled }) {
|
|
|
1030
984
|
}
|
|
1031
985
|
) : null
|
|
1032
986
|
] }),
|
|
1033
|
-
children: isSet ? /* @__PURE__ */
|
|
1034
|
-
/* @__PURE__ */
|
|
987
|
+
children: isSet ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
988
|
+
/* @__PURE__ */ jsx4(
|
|
1035
989
|
SettingControlInput,
|
|
1036
990
|
{
|
|
1037
991
|
settingKey: row.key,
|
|
@@ -1042,40 +996,40 @@ function ModelSettingRow({ row, control, target, idPrefix, disabled }) {
|
|
|
1042
996
|
id: `${idPrefix}-control-${row.key}`
|
|
1043
997
|
}
|
|
1044
998
|
),
|
|
1045
|
-
read.issue ? /* @__PURE__ */
|
|
1046
|
-
] }) : /* @__PURE__ */
|
|
999
|
+
read.issue ? /* @__PURE__ */ jsx4("p", { className: "pt-1 type-meta text-warning-ink", children: read.issue.message }) : null
|
|
1000
|
+
] }) : /* @__PURE__ */ jsx4(RowText, { children: read.modelDefault !== void 0 && read.modelDefault !== null ? `Not set \xB7 Model default: ${formatSettingValue(read.modelDefault)}` : "Not set" })
|
|
1047
1001
|
}
|
|
1048
1002
|
);
|
|
1049
1003
|
}
|
|
1050
1004
|
function ExtraSettingRow({ rowKey, label, value, kind, onClear, onReset, resetLabel = "Reset to agent", disabled = false }) {
|
|
1051
|
-
return /* @__PURE__ */
|
|
1005
|
+
return /* @__PURE__ */ jsx4(
|
|
1052
1006
|
SettingRowFrame,
|
|
1053
1007
|
{
|
|
1054
1008
|
rowKey,
|
|
1055
1009
|
state: kind,
|
|
1056
|
-
label: /* @__PURE__ */
|
|
1057
|
-
actions: /* @__PURE__ */
|
|
1058
|
-
kind === "translated" ? /* @__PURE__ */
|
|
1059
|
-
onReset ? /* @__PURE__ */
|
|
1010
|
+
label: /* @__PURE__ */ jsx4(RowLabel, { children: label }),
|
|
1011
|
+
actions: /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1012
|
+
kind === "translated" ? /* @__PURE__ */ jsx4(Chip, { tone: "sky", label: "Translated", title: "Kept as set and sent as this model's closest equivalent" }) : /* @__PURE__ */ jsx4(Chip, { tone: "warning", label: "Not on this model", title: "This model has no such setting" }),
|
|
1013
|
+
onReset ? /* @__PURE__ */ jsx4(Button2, { variant: "quiet", icon: /* @__PURE__ */ jsx4(RotateCcwGlyph, {}), onClick: onReset, disabled, "aria-label": `${resetLabel}: ${label}`, title: resetLabel, "data-setting-reset": rowKey }) : /* @__PURE__ */ jsx4(Button2, { variant: "quiet", removes: true, icon: /* @__PURE__ */ jsx4(Trash2Glyph, {}), onClick: onClear, disabled, "aria-label": `Clear ${label}`, title: "Clear to not set", "data-setting-clear": rowKey })
|
|
1060
1014
|
] }),
|
|
1061
|
-
children: /* @__PURE__ */
|
|
1015
|
+
children: /* @__PURE__ */ jsx4(RowText, { mono: value !== void 0 && value !== null, children: value === void 0 || value === null ? "Not set" : isOffValue(value, null) ? "Off" : formatSettingValue(value) })
|
|
1062
1016
|
}
|
|
1063
1017
|
);
|
|
1064
1018
|
}
|
|
1065
1019
|
function ModelRow({ model, resetLabel, idPrefix, disabled }) {
|
|
1066
1020
|
const off = disabled || model.disabled === true;
|
|
1067
1021
|
const oneMessageId = `${idPrefix}-model-one-message`;
|
|
1068
|
-
return /* @__PURE__ */
|
|
1022
|
+
return /* @__PURE__ */ jsx4(
|
|
1069
1023
|
SettingRowFrame,
|
|
1070
1024
|
{
|
|
1071
1025
|
rowKey: "model",
|
|
1072
1026
|
state: model.value ? "set" : "unset",
|
|
1073
|
-
label: /* @__PURE__ */
|
|
1074
|
-
actions: model.changedHere && model.resetToInherited ? /* @__PURE__ */
|
|
1027
|
+
label: /* @__PURE__ */ jsx4(RowLabel, { children: "Model" }),
|
|
1028
|
+
actions: model.changedHere && model.resetToInherited ? /* @__PURE__ */ jsx4(
|
|
1075
1029
|
Button2,
|
|
1076
1030
|
{
|
|
1077
1031
|
variant: "quiet",
|
|
1078
|
-
icon: /* @__PURE__ */
|
|
1032
|
+
icon: /* @__PURE__ */ jsx4(RotateCcwGlyph, {}),
|
|
1079
1033
|
onClick: () => model.resetToInherited?.(),
|
|
1080
1034
|
disabled: off,
|
|
1081
1035
|
"aria-label": `${resetLabel}: Model`,
|
|
@@ -1083,8 +1037,8 @@ function ModelRow({ model, resetLabel, idPrefix, disabled }) {
|
|
|
1083
1037
|
"data-setting-reset": "model"
|
|
1084
1038
|
}
|
|
1085
1039
|
) : null,
|
|
1086
|
-
children: /* @__PURE__ */
|
|
1087
|
-
/* @__PURE__ */
|
|
1040
|
+
children: /* @__PURE__ */ jsxs4("div", { className: "flex min-h-7 min-w-0 flex-wrap items-center gap-x-2", children: [
|
|
1041
|
+
/* @__PURE__ */ jsx4(
|
|
1088
1042
|
ModelListDropdown,
|
|
1089
1043
|
{
|
|
1090
1044
|
"aria-label": "Model",
|
|
@@ -1100,8 +1054,8 @@ function ModelRow({ model, resetLabel, idPrefix, disabled }) {
|
|
|
1100
1054
|
...model.disabledTitle ? { disabledTitle: model.disabledTitle } : {}
|
|
1101
1055
|
}
|
|
1102
1056
|
),
|
|
1103
|
-
model.oneMessage ? /* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1057
|
+
model.oneMessage ? /* @__PURE__ */ jsxs4("label", { htmlFor: oneMessageId, className: "flex min-h-7 items-center gap-1 type-secondary text-muted-foreground", title: "Use this model for the next message, then go back", children: [
|
|
1058
|
+
/* @__PURE__ */ jsx4(
|
|
1105
1059
|
Switch2,
|
|
1106
1060
|
{
|
|
1107
1061
|
id: oneMessageId,
|
|
@@ -1131,7 +1085,7 @@ function ModelSettingsPanel({
|
|
|
1131
1085
|
const groups = controls ? buildSettingsRows(controls, values).filter((group) => group.rows.length > 0) : [];
|
|
1132
1086
|
const extras = extraSettingKeys(controls, values, target.changedKeys);
|
|
1133
1087
|
const resetLabel = target.resetLabel ?? "Reset to agent";
|
|
1134
|
-
const extraRow = (key, kind) => /* @__PURE__ */
|
|
1088
|
+
const extraRow = (key, kind) => /* @__PURE__ */ jsx4(
|
|
1135
1089
|
ExtraSettingRow,
|
|
1136
1090
|
{
|
|
1137
1091
|
rowKey: key,
|
|
@@ -1145,17 +1099,17 @@ function ModelSettingsPanel({
|
|
|
1145
1099
|
},
|
|
1146
1100
|
key
|
|
1147
1101
|
);
|
|
1148
|
-
return /* @__PURE__ */
|
|
1149
|
-
model ? /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ jsxs4("div", { "data-model-settings-panel": "", className: "@container flex min-w-0 flex-col", children: [
|
|
1103
|
+
model ? /* @__PURE__ */ jsx4(ModelRow, { model, resetLabel, idPrefix, disabled }) : null,
|
|
1150
1104
|
notices,
|
|
1151
1105
|
extras.unsupported.map((key) => extraRow(key, "unsupported")),
|
|
1152
|
-
extras.translated.length > 0 ? /* @__PURE__ */
|
|
1153
|
-
groups.length === 0 && emptyNote ? /* @__PURE__ */
|
|
1154
|
-
groups.map((group) => /* @__PURE__ */
|
|
1106
|
+
extras.translated.length > 0 ? /* @__PURE__ */ jsx4(SettingsGroupSection, { id: "translated", title: "Translated for this model", children: /* @__PURE__ */ jsx4("div", { "data-translated-settings": "", children: extras.translated.map((key) => extraRow(key, "translated")) }) }) : null,
|
|
1107
|
+
groups.length === 0 && emptyNote ? /* @__PURE__ */ jsx4("div", { className: "py-2 type-secondary text-muted-foreground", children: emptyNote }) : null,
|
|
1108
|
+
groups.map((group) => /* @__PURE__ */ jsx4(SettingsGroupSection, { id: group.id, title: group.label || void 0, children: group.rows.map((row) => {
|
|
1155
1109
|
const custom = renderRow?.(row);
|
|
1156
|
-
if (custom !== void 0) return /* @__PURE__ */
|
|
1110
|
+
if (custom !== void 0) return /* @__PURE__ */ jsx4("div", { children: custom }, row.key);
|
|
1157
1111
|
if (!row.control) return null;
|
|
1158
|
-
return /* @__PURE__ */
|
|
1112
|
+
return /* @__PURE__ */ jsx4(
|
|
1159
1113
|
ModelSettingRow,
|
|
1160
1114
|
{
|
|
1161
1115
|
row,
|
|
@@ -1167,7 +1121,7 @@ function ModelSettingsPanel({
|
|
|
1167
1121
|
row.key
|
|
1168
1122
|
);
|
|
1169
1123
|
}) }, group.id)),
|
|
1170
|
-
capabilities ? /* @__PURE__ */
|
|
1124
|
+
capabilities ? /* @__PURE__ */ jsx4(
|
|
1171
1125
|
InputCapabilitiesEditor,
|
|
1172
1126
|
{
|
|
1173
1127
|
values: capabilities.values,
|