@tangle-network/agent-app 3.0.2 → 3.0.4
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/dist/assistant/index.js +15 -90
- package/dist/assistant/index.js.map +1 -1
- package/dist/chat-routes/index.js +5 -5
- package/dist/{chunk-4EQWYI53.js → chunk-AFMLLZWU.js} +2 -2
- package/dist/{chunk-B2NN5BIJ.js → chunk-FWLVAWKR.js} +2 -2
- package/dist/{chunk-PO23GWVQ.js → chunk-JDNGAX4C.js} +4 -4
- package/dist/{chunk-5WQ77MPN.js → chunk-NN3CQNX5.js} +786 -719
- package/dist/chunk-NN3CQNX5.js.map +1 -0
- package/dist/{chunk-3XVGMHCD.js → chunk-PISTUUEZ.js} +2 -2
- package/dist/{chunk-DCPOEDPK.js → chunk-YYA2CVOY.js} +6 -6
- package/dist/chunk-YYA2CVOY.js.map +1 -0
- package/dist/preset-cloudflare/index.js +1 -1
- package/dist/public-consultation/index.js +4 -4
- package/dist/runtime/index.js +3 -3
- package/dist/runtime/router-turn.js +2 -2
- package/dist/sandbox/index.js +2 -2
- package/dist/turn-trace/index.js +1 -1
- package/dist/turn-trace/recorder.d.ts +2 -1
- package/dist/web-react/index.d.ts +1 -0
- package/dist/web-react/index.js +3 -1
- package/dist/web-react/resize-handle.d.ts +24 -0
- package/package.json +1 -1
- package/dist/assistant/ResizeHandle.d.ts +0 -19
- package/dist/chunk-5WQ77MPN.js.map +0 -1
- package/dist/chunk-DCPOEDPK.js.map +0 -1
- /package/dist/{chunk-4EQWYI53.js.map → chunk-AFMLLZWU.js.map} +0 -0
- /package/dist/{chunk-B2NN5BIJ.js.map → chunk-FWLVAWKR.js.map} +0 -0
- /package/dist/{chunk-PO23GWVQ.js.map → chunk-JDNGAX4C.js.map} +0 -0
- /package/dist/{chunk-3XVGMHCD.js.map → chunk-PISTUUEZ.js.map} +0 -0
|
@@ -407,20 +407,86 @@ function TurnProgress({ phase, pendingMessage = "Sending\u2026", startedAt, show
|
|
|
407
407
|
);
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
+
// src/web-react/resize-handle.tsx
|
|
411
|
+
import { useRef } from "react";
|
|
412
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
413
|
+
function ResizeHandle({ width, minWidth, maxWidth, edge = "left", label, onPreview, onCommit, onNudge, onReset, className = "" }) {
|
|
414
|
+
const dragRef = useRef(null);
|
|
415
|
+
const sign = edge === "left" ? -1 : 1;
|
|
416
|
+
const onPointerDown = (e) => {
|
|
417
|
+
if (e.button !== 0) return;
|
|
418
|
+
e.preventDefault();
|
|
419
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
420
|
+
dragRef.current = { startX: e.clientX, startWidth: width, lastWidth: width };
|
|
421
|
+
};
|
|
422
|
+
const onPointerMove = (e) => {
|
|
423
|
+
const drag = dragRef.current;
|
|
424
|
+
if (!drag) return;
|
|
425
|
+
const next = drag.startWidth + sign * (e.clientX - drag.startX);
|
|
426
|
+
if (Math.abs(next - drag.lastWidth) < 1) return;
|
|
427
|
+
drag.lastWidth = next;
|
|
428
|
+
onPreview(next);
|
|
429
|
+
};
|
|
430
|
+
const endDrag = (e) => {
|
|
431
|
+
const drag = dragRef.current;
|
|
432
|
+
if (!drag) return;
|
|
433
|
+
dragRef.current = null;
|
|
434
|
+
if (e.currentTarget.hasPointerCapture(e.pointerId)) {
|
|
435
|
+
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
436
|
+
}
|
|
437
|
+
if (drag.lastWidth !== drag.startWidth) onCommit(drag.lastWidth);
|
|
438
|
+
};
|
|
439
|
+
const onKeyDown = (e) => {
|
|
440
|
+
const STEP = 24;
|
|
441
|
+
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
442
|
+
e.preventDefault();
|
|
443
|
+
onNudge((e.key === "ArrowRight" ? STEP : -STEP) * sign);
|
|
444
|
+
};
|
|
445
|
+
return (
|
|
446
|
+
// biome-ignore lint/a11y/useSemanticElements: a focusable drag handle is an ARIA window-splitter (role=separator); no native HTML element provides this.
|
|
447
|
+
/* @__PURE__ */ jsx2(
|
|
448
|
+
"div",
|
|
449
|
+
{
|
|
450
|
+
role: "separator",
|
|
451
|
+
"aria-orientation": "vertical",
|
|
452
|
+
"aria-label": label,
|
|
453
|
+
"aria-valuemin": minWidth,
|
|
454
|
+
"aria-valuemax": maxWidth,
|
|
455
|
+
"aria-valuenow": width,
|
|
456
|
+
tabIndex: 0,
|
|
457
|
+
onPointerDown,
|
|
458
|
+
onPointerMove,
|
|
459
|
+
onPointerUp: endDrag,
|
|
460
|
+
onPointerCancel: endDrag,
|
|
461
|
+
onKeyDown,
|
|
462
|
+
onDoubleClick: onReset,
|
|
463
|
+
className: `group absolute inset-y-0 z-10 flex w-2 cursor-ew-resize touch-none items-center justify-center ${edge === "left" ? "left-0 -translate-x-1/2" : "right-0 translate-x-1/2"} ${className}`,
|
|
464
|
+
children: /* @__PURE__ */ jsx2(
|
|
465
|
+
"span",
|
|
466
|
+
{
|
|
467
|
+
"aria-hidden": "true",
|
|
468
|
+
className: "h-10 w-1 rounded-full bg-border transition-colors group-hover:bg-primary group-focus:bg-primary"
|
|
469
|
+
}
|
|
470
|
+
)
|
|
471
|
+
}
|
|
472
|
+
)
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
|
|
410
476
|
// src/web-react/reasoning-row.tsx
|
|
411
|
-
import { useEffect as useEffect2, useMemo, useRef as
|
|
477
|
+
import { useEffect as useEffect2, useMemo, useRef as useRef3, useState as useState3 } from "react";
|
|
412
478
|
import { RunRowShell } from "@tangle-network/ui/run";
|
|
413
479
|
import { Markdown } from "@tangle-network/ui/markdown";
|
|
414
480
|
import { Button } from "@tangle-network/ui/primitives";
|
|
415
481
|
|
|
416
482
|
// src/web-react/chat-scroll.ts
|
|
417
|
-
import { useCallback, useRef, useState as useState2 } from "react";
|
|
483
|
+
import { useCallback, useRef as useRef2, useState as useState2 } from "react";
|
|
418
484
|
function useChatScroll() {
|
|
419
485
|
const [viewport, viewportRef] = useState2(null);
|
|
420
486
|
const [content, contentRef] = useState2(null);
|
|
421
487
|
const [following, setFollowing] = useState2(true);
|
|
422
|
-
const followingRef =
|
|
423
|
-
const previousTop =
|
|
488
|
+
const followingRef = useRef2(true);
|
|
489
|
+
const previousTop = useRef2(0);
|
|
424
490
|
const follow = useCallback((value) => {
|
|
425
491
|
followingRef.current = value;
|
|
426
492
|
setFollowing(value);
|
|
@@ -509,7 +575,7 @@ function useChatScroll() {
|
|
|
509
575
|
}
|
|
510
576
|
|
|
511
577
|
// src/web-react/reasoning-row.tsx
|
|
512
|
-
import { jsx as
|
|
578
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
513
579
|
function reasoningPreview(text) {
|
|
514
580
|
const flat = text.replace(/[*_`#>]+/g, "").replace(/\s+/g, " ").trim();
|
|
515
581
|
if (!flat) return void 0;
|
|
@@ -527,7 +593,7 @@ function useSecondTick(active) {
|
|
|
527
593
|
return () => clearInterval(id);
|
|
528
594
|
}, [active]);
|
|
529
595
|
}
|
|
530
|
-
var defaultRenderText = (text) => /* @__PURE__ */
|
|
596
|
+
var defaultRenderText = (text) => /* @__PURE__ */ jsx3(Markdown, { className: "text-base leading-relaxed", children: text });
|
|
531
597
|
function ReasoningRow({
|
|
532
598
|
text,
|
|
533
599
|
startedAt,
|
|
@@ -540,8 +606,8 @@ function ReasoningRow({
|
|
|
540
606
|
const thinking = thinkingProp ?? (startedAt !== void 0 && endedAt === void 0);
|
|
541
607
|
const body = useMemo(() => renderText(text), [renderText, text]);
|
|
542
608
|
const visible = text.trim() !== "";
|
|
543
|
-
const seenStart =
|
|
544
|
-
const seenEnd =
|
|
609
|
+
const seenStart = useRef3(null);
|
|
610
|
+
const seenEnd = useRef3(null);
|
|
545
611
|
if (thinking && visible) {
|
|
546
612
|
if (seenStart.current === null) seenStart.current = Date.now();
|
|
547
613
|
seenEnd.current = null;
|
|
@@ -568,14 +634,14 @@ function ReasoningRow({
|
|
|
568
634
|
RunRowShell,
|
|
569
635
|
{
|
|
570
636
|
className,
|
|
571
|
-
icon: /* @__PURE__ */
|
|
637
|
+
icon: /* @__PURE__ */ jsx3(BrainGlyph, { className: "h-3.5 w-3.5" }),
|
|
572
638
|
title,
|
|
573
639
|
description: thinking ? void 0 : reasoningPreview(text),
|
|
574
640
|
status: thinking ? "running" : "idle",
|
|
575
641
|
open,
|
|
576
642
|
onOpenChange: setOpen,
|
|
577
643
|
children: [
|
|
578
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ jsx3(
|
|
579
645
|
"div",
|
|
580
646
|
{
|
|
581
647
|
ref: viewportRef,
|
|
@@ -585,10 +651,10 @@ function ReasoningRow({
|
|
|
585
651
|
"data-reasoning": thinking ? "thinking" : "settled",
|
|
586
652
|
"aria-busy": thinking || void 0,
|
|
587
653
|
className: "max-h-[min(28rem,60dvh)] overflow-y-auto overscroll-contain px-4 py-4 text-base leading-relaxed text-foreground",
|
|
588
|
-
children: /* @__PURE__ */
|
|
654
|
+
children: /* @__PURE__ */ jsx3("div", { ref: contentRef, className: "min-w-0 break-words", children: body })
|
|
589
655
|
}
|
|
590
656
|
),
|
|
591
|
-
!following && /* @__PURE__ */
|
|
657
|
+
!following && /* @__PURE__ */ jsx3("div", { className: "flex justify-end px-4 pb-3", children: /* @__PURE__ */ jsx3(Button, { type: "button", variant: "outline", "aria-label": "Jump to latest reasoning", onClick: jumpToLatest, children: "Jump to latest" }) })
|
|
592
658
|
]
|
|
593
659
|
}
|
|
594
660
|
);
|
|
@@ -619,7 +685,7 @@ import { Button as Button2, CodeBlock, Tabs, TabsContent, TabsList, TabsTrigger
|
|
|
619
685
|
import { CopyButton } from "@tangle-network/sandbox-ui/markdown";
|
|
620
686
|
|
|
621
687
|
// src/web-react/agent-profile-layout.tsx
|
|
622
|
-
import { jsx as
|
|
688
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
623
689
|
var sectionGlyphs = {
|
|
624
690
|
Identity: { path: "M20 21v-2a7 7 0 0 0-14 0v2 M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0", color: "bg-primary/10 text-primary" },
|
|
625
691
|
"Prompts and instructions": { path: "M8 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-3 M9 15l3-1 9-9-2-2-9 9-1 3", color: "bg-primary/10 text-primary" },
|
|
@@ -630,22 +696,22 @@ var resourceGlyph = { path: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0
|
|
|
630
696
|
function ProfileSectionHeading({ title }) {
|
|
631
697
|
const glyph = sectionGlyphs[title] ?? resourceGlyph;
|
|
632
698
|
return /* @__PURE__ */ jsxs3("span", { className: "flex min-w-0 items-center gap-3", children: [
|
|
633
|
-
/* @__PURE__ */
|
|
634
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ jsx4("span", { className: `flex size-9 shrink-0 items-center justify-center rounded-lg ${glyph.color}`, children: /* @__PURE__ */ jsx4("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", className: "size-4", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx4("path", { d: glyph.path }) }) }),
|
|
700
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 break-words text-sm font-semibold text-foreground", children: title })
|
|
635
701
|
] });
|
|
636
702
|
}
|
|
637
703
|
function ProfileCard({ title, description, children }) {
|
|
638
704
|
return /* @__PURE__ */ jsxs3("section", { "aria-label": title, className: "min-w-0 overflow-hidden rounded-xl border border-border bg-card", children: [
|
|
639
705
|
/* @__PURE__ */ jsxs3("header", { className: "border-b border-border bg-muted/35 px-4 py-3 sm:px-5", children: [
|
|
640
|
-
/* @__PURE__ */
|
|
641
|
-
description && /* @__PURE__ */
|
|
706
|
+
/* @__PURE__ */ jsx4("h3", { children: /* @__PURE__ */ jsx4(ProfileSectionHeading, { title }) }),
|
|
707
|
+
description && /* @__PURE__ */ jsx4("p", { className: "mt-2 text-sm leading-6 text-muted-foreground", children: description })
|
|
642
708
|
] }),
|
|
643
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ jsx4("div", { className: "min-w-0 space-y-4 p-4 sm:p-5", children })
|
|
644
710
|
] });
|
|
645
711
|
}
|
|
646
712
|
|
|
647
713
|
// src/web-react/agent-profile-viewer.tsx
|
|
648
|
-
import { jsx as
|
|
714
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
649
715
|
function nonempty(value) {
|
|
650
716
|
return Boolean(value?.trim());
|
|
651
717
|
}
|
|
@@ -657,41 +723,41 @@ function ResourceRow({ label, resource, path }) {
|
|
|
657
723
|
const name = resourceName(resource);
|
|
658
724
|
return /* @__PURE__ */ jsxs4("li", { className: "min-w-0 py-2 first:pt-0 last:pb-0", children: [
|
|
659
725
|
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
|
|
660
|
-
/* @__PURE__ */
|
|
661
|
-
path && /* @__PURE__ */
|
|
662
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ jsx5("span", { className: "shrink-0 text-sm font-medium text-muted-foreground", children: label }),
|
|
727
|
+
path && /* @__PURE__ */ jsx5("code", { className: "break-all font-mono text-sm text-foreground", children: path }),
|
|
728
|
+
/* @__PURE__ */ jsx5("span", { className: "min-w-0 break-all text-sm text-foreground", children: name }),
|
|
663
729
|
resource.kind === "github" && resource.ref && /* @__PURE__ */ jsxs4("span", { className: "shrink-0 text-sm text-muted-foreground", children: [
|
|
664
730
|
"at ",
|
|
665
731
|
resource.ref
|
|
666
732
|
] })
|
|
667
733
|
] }),
|
|
668
734
|
resource.kind === "inline" && nonempty(resource.content) && /* @__PURE__ */ jsxs4("details", { className: "mt-1.5", children: [
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
735
|
+
/* @__PURE__ */ jsx5("summary", { className: "w-fit cursor-pointer select-none text-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "View inline content" }),
|
|
736
|
+
/* @__PURE__ */ jsx5("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-3 text-sm leading-relaxed text-foreground", children: resource.content })
|
|
671
737
|
] })
|
|
672
738
|
] });
|
|
673
739
|
}
|
|
674
740
|
function PromptDetail({ label, path, note, value }) {
|
|
675
741
|
return /* @__PURE__ */ jsxs4("div", { className: "min-w-0 space-y-3", children: [
|
|
676
742
|
/* @__PURE__ */ jsxs4("div", { className: "space-y-1", children: [
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
-
/* @__PURE__ */
|
|
679
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ jsx5("h4", { className: "text-sm font-semibold text-foreground", children: label }),
|
|
744
|
+
/* @__PURE__ */ jsx5("code", { className: "block break-all font-mono text-xs text-primary", children: path }),
|
|
745
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm leading-6 text-muted-foreground", children: note })
|
|
680
746
|
] }),
|
|
681
|
-
/* @__PURE__ */
|
|
747
|
+
/* @__PURE__ */ jsx5("div", { className: "whitespace-pre-wrap break-words rounded-lg border border-border bg-muted/35 p-4 text-sm leading-7 text-foreground", children: value })
|
|
682
748
|
] });
|
|
683
749
|
}
|
|
684
750
|
function ProfileSection({ title, children }) {
|
|
685
|
-
return /* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ jsx5(ProfileCard, { title, children });
|
|
686
752
|
}
|
|
687
753
|
function ProfileConfiguration({ expanded, children }) {
|
|
688
|
-
if (expanded) return /* @__PURE__ */
|
|
754
|
+
if (expanded) return /* @__PURE__ */ jsx5("div", { className: "space-y-4", children });
|
|
689
755
|
return /* @__PURE__ */ jsxs4("details", { className: "group/config border-t border-border pt-4", children: [
|
|
690
756
|
/* @__PURE__ */ jsxs4("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 rounded-sm py-2 font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
|
|
691
757
|
"Profile configuration ",
|
|
692
|
-
/* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ jsx5("span", { "aria-hidden": "true", className: "text-muted-foreground group-open/config:rotate-90", children: "\u203A" })
|
|
693
759
|
] }),
|
|
694
|
-
/* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ jsx5("div", { className: "space-y-4 pt-4", children })
|
|
695
761
|
] });
|
|
696
762
|
}
|
|
697
763
|
function permissionRows(profile) {
|
|
@@ -745,19 +811,19 @@ function ProfileOverview({ profile, defaultExpanded = true, showIdentity = true
|
|
|
745
811
|
const hasProfileDetails = Boolean(profile.model?.default || profile.model?.small || profile.model?.reasoningEffort || profile.model?.provider || profile.harness || profile.description || profile.version || profile.tags?.length || hasConfiguration);
|
|
746
812
|
return /* @__PURE__ */ jsxs4("div", { className: "min-w-0 text-sm text-foreground", children: [
|
|
747
813
|
(showIdentity || nonempty(profile.description)) && /* @__PURE__ */ jsxs4("header", { className: "mb-6 min-w-0", children: [
|
|
748
|
-
showIdentity && /* @__PURE__ */
|
|
749
|
-
nonempty(profile.description) && /* @__PURE__ */
|
|
814
|
+
showIdentity && /* @__PURE__ */ jsx5("h2", { className: "break-words text-lg font-semibold leading-tight text-foreground", children: nonempty(profile.name) ? profile.name : "Unnamed profile" }),
|
|
815
|
+
nonempty(profile.description) && /* @__PURE__ */ jsx5("p", { className: "mt-2 whitespace-pre-wrap break-words leading-6 text-muted-foreground", children: profile.description })
|
|
750
816
|
] }),
|
|
751
|
-
!hasProfileDetails && /* @__PURE__ */
|
|
817
|
+
!hasProfileDetails && /* @__PURE__ */ jsx5("p", { className: "text-muted-foreground", children: "No profile details are configured." }),
|
|
752
818
|
(hasConfiguration || profile.model || profile.harness || profile.version || profile.tags?.length) && /* @__PURE__ */ jsxs4(ProfileConfiguration, { expanded: defaultExpanded, children: [
|
|
753
|
-
hasBehavior && /* @__PURE__ */
|
|
819
|
+
hasBehavior && /* @__PURE__ */ jsx5(ProfileSection, { title: "Prompts and instructions", children: /* @__PURE__ */ jsxs4("div", { className: "space-y-6", children: [
|
|
754
820
|
!nonempty(prompt?.systemPrompt) && /* @__PURE__ */ jsxs4("div", { className: "space-y-1", children: [
|
|
755
|
-
/* @__PURE__ */
|
|
756
|
-
/* @__PURE__ */
|
|
757
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ jsx5("h4", { className: "text-sm font-semibold", children: "System prompt" }),
|
|
822
|
+
/* @__PURE__ */ jsx5("code", { className: "block font-mono text-xs text-primary", children: "prompt.systemPrompt" }),
|
|
823
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm leading-6 text-muted-foreground", children: "No override configured. The runtime supplies its default system prompt." })
|
|
758
824
|
] }),
|
|
759
|
-
nonempty(prompt?.systemPrompt) && /* @__PURE__ */
|
|
760
|
-
nonempty(prompt?.appendSystemPrompt) && /* @__PURE__ */
|
|
825
|
+
nonempty(prompt?.systemPrompt) && /* @__PURE__ */ jsx5(PromptDetail, { label: "System prompt", path: "prompt.systemPrompt", note: "The profile\u2019s system prompt override. Replaces the harness default where supported.", value: prompt.systemPrompt }),
|
|
826
|
+
nonempty(prompt?.appendSystemPrompt) && /* @__PURE__ */ jsx5(
|
|
761
827
|
PromptDetail,
|
|
762
828
|
{
|
|
763
829
|
label: "Appended system prompt",
|
|
@@ -767,62 +833,62 @@ function ProfileOverview({ profile, defaultExpanded = true, showIdentity = true
|
|
|
767
833
|
}
|
|
768
834
|
),
|
|
769
835
|
instructions.length > 0 && /* @__PURE__ */ jsxs4("div", { className: "space-y-1.5", children: [
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ jsx5("h4", { className: "text-sm font-semibold text-foreground", children: "Project instructions" }),
|
|
837
|
+
/* @__PURE__ */ jsx5("code", { className: "block break-all font-mono text-xs text-primary", children: "prompt.instructions" }),
|
|
838
|
+
/* @__PURE__ */ jsx5("p", { className: "pb-2 text-sm leading-6 text-muted-foreground", children: "Lower-priority workspace guidance. These entries are separate from the system prompt." }),
|
|
839
|
+
/* @__PURE__ */ jsx5("ul", { className: "space-y-2", children: instructions.map((instruction, index) => /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5("div", { className: "whitespace-pre-wrap break-words rounded-lg border border-border bg-muted/35 p-4 text-sm leading-7", children: instruction }) }, `${index}:${instruction}`)) })
|
|
774
840
|
] }),
|
|
775
|
-
typeof resourceInstructions === "string" && nonempty(resourceInstructions) && /* @__PURE__ */
|
|
776
|
-
resourceInstructions && typeof resourceInstructions !== "string" && /* @__PURE__ */
|
|
841
|
+
typeof resourceInstructions === "string" && nonempty(resourceInstructions) && /* @__PURE__ */ jsx5(PromptDetail, { label: "Resource instructions", path: "resources.instructions", note: "Instructions declared with workspace resources. Their loading is controlled by the runtime.", value: resourceInstructions }),
|
|
842
|
+
resourceInstructions && typeof resourceInstructions !== "string" && /* @__PURE__ */ jsx5("ul", { children: /* @__PURE__ */ jsx5(ResourceRow, { label: "resources.instructions", resource: resourceInstructions }) })
|
|
777
843
|
] }) }),
|
|
778
|
-
(profile.model?.default || profile.model?.small || profile.model?.provider || profile.model?.reasoningEffort || profile.harness) && /* @__PURE__ */
|
|
844
|
+
(profile.model?.default || profile.model?.small || profile.model?.provider || profile.model?.reasoningEffort || profile.harness) && /* @__PURE__ */ jsx5(ProfileSection, { title: "Model and runtime", children: /* @__PURE__ */ jsx5("dl", { className: "grid gap-x-6 gap-y-4 sm:grid-cols-2", children: [
|
|
779
845
|
["Default model", profile.model?.default],
|
|
780
846
|
["Provider", profile.model?.provider],
|
|
781
847
|
["Preferred harness", profile.harness],
|
|
782
848
|
["Reasoning", profile.model?.reasoningEffort],
|
|
783
849
|
["Small model", profile.model?.small]
|
|
784
850
|
].filter(([, value]) => value).map(([label, value]) => /* @__PURE__ */ jsxs4("div", { className: "min-w-0", children: [
|
|
785
|
-
/* @__PURE__ */
|
|
786
|
-
/* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ jsx5("dt", { className: "mb-1 text-sm text-muted-foreground", children: label }),
|
|
852
|
+
/* @__PURE__ */ jsx5("dd", { className: "break-words font-medium", children: value })
|
|
787
853
|
] }, label)) }) }),
|
|
788
|
-
(tools.length > 0 || permissions.length > 0) && /* @__PURE__ */
|
|
854
|
+
(tools.length > 0 || permissions.length > 0) && /* @__PURE__ */ jsx5(ProfileSection, { title: "Tools and permissions", children: /* @__PURE__ */ jsx5("div", { children: /* @__PURE__ */ jsx5("ul", { className: "divide-y divide-border/70", children: [.../* @__PURE__ */ new Set([...tools.map(([name]) => name), ...permissions.map(([name]) => name)])].sort().map((name) => {
|
|
789
855
|
const enabled = tools.find(([tool]) => tool === name)?.[1];
|
|
790
856
|
const policy = permissions.find(([permission]) => permission === name)?.[1];
|
|
791
857
|
return /* @__PURE__ */ jsxs4("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
|
|
792
|
-
/* @__PURE__ */
|
|
793
|
-
/* @__PURE__ */
|
|
858
|
+
/* @__PURE__ */ jsx5("code", { className: "min-w-0 break-all font-mono text-sm text-foreground", children: name }),
|
|
859
|
+
/* @__PURE__ */ jsx5("span", { className: "shrink-0 text-sm text-muted-foreground", children: [enabled === void 0 ? void 0 : enabled ? "Enabled" : "Disabled", policy].filter(Boolean).join(" \xB7 ") })
|
|
794
860
|
] }, name);
|
|
795
861
|
}) }) }) }),
|
|
796
|
-
mcp.length > 0 && /* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
/* @__PURE__ */
|
|
862
|
+
mcp.length > 0 && /* @__PURE__ */ jsx5(ProfileSection, { title: "MCP servers", children: /* @__PURE__ */ jsx5("ul", { className: "divide-y divide-border/70", children: mcp.map(([name, server]) => /* @__PURE__ */ jsxs4("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
|
|
863
|
+
/* @__PURE__ */ jsx5("span", { className: "min-w-0 break-words font-medium text-foreground", children: name }),
|
|
864
|
+
/* @__PURE__ */ jsx5("span", { className: "shrink-0 text-sm text-muted-foreground", children: server.enabled === false ? "Disabled in profile" : "Enabled in profile" })
|
|
799
865
|
] }, name)) }) }),
|
|
800
|
-
Boolean(profile.connections?.length) && /* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
802
|
-
connection.capabilities.length > 0 && /* @__PURE__ */
|
|
866
|
+
Boolean(profile.connections?.length) && /* @__PURE__ */ jsx5(ProfileSection, { title: "Hub capabilities", children: /* @__PURE__ */ jsx5("ul", { className: "space-y-2", children: profile.connections?.map((connection, index) => /* @__PURE__ */ jsxs4("li", { className: "min-w-0", children: [
|
|
867
|
+
/* @__PURE__ */ jsx5("p", { className: "font-medium text-foreground", children: connection.alias || "Hub connection" }),
|
|
868
|
+
connection.capabilities.length > 0 && /* @__PURE__ */ jsx5("ul", { className: "mt-1 flex flex-wrap gap-1.5", children: connection.capabilities.map((capability, capabilityIndex) => /* @__PURE__ */ jsx5("li", { className: "rounded-full bg-muted px-2 py-0.5 text-sm text-muted-foreground", children: capability }, `${capability}:${capabilityIndex}`)) })
|
|
803
869
|
] }, `${connection.alias ?? "connection"}:${index}`)) }) }),
|
|
804
870
|
(resources.length > 0 || profile.resources?.failOnError) && /* @__PURE__ */ jsxs4(ProfileSection, { title: "Declared resources", children: [
|
|
805
|
-
/* @__PURE__ */
|
|
806
|
-
profile.resources?.failOnError && /* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ jsx5("ul", { className: "divide-y divide-border/70", children: resources.map(({ key, ...item }) => /* @__PURE__ */ jsx5(ResourceRow, { ...item }, key)) }),
|
|
872
|
+
profile.resources?.failOnError && /* @__PURE__ */ jsx5("p", { className: "mt-2 text-sm text-muted-foreground", children: "Profile configuration requires declared resources to load successfully." })
|
|
807
873
|
] }),
|
|
808
|
-
Boolean(profile.subagents && Object.keys(profile.subagents).length) && /* @__PURE__ */
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
nonempty(subagent.description) && /* @__PURE__ */
|
|
874
|
+
Boolean(profile.subagents && Object.keys(profile.subagents).length) && /* @__PURE__ */ jsx5(ProfileSection, { title: "Subagents", children: /* @__PURE__ */ jsx5("ul", { className: "divide-y divide-border/70", children: Object.entries(profile.subagents ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([name, subagent]) => /* @__PURE__ */ jsxs4("li", { className: "py-1.5 first:pt-0 last:pb-0", children: [
|
|
875
|
+
/* @__PURE__ */ jsx5("p", { className: "font-medium text-foreground", children: name }),
|
|
876
|
+
nonempty(subagent.description) && /* @__PURE__ */ jsx5("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-sm leading-relaxed text-muted-foreground", children: subagent.description })
|
|
811
877
|
] }, name)) }) }),
|
|
812
|
-
Boolean(profile.hooks && Object.keys(profile.hooks).length) && /* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
878
|
+
Boolean(profile.hooks && Object.keys(profile.hooks).length) && /* @__PURE__ */ jsx5(ProfileSection, { title: "Lifecycle hooks", children: /* @__PURE__ */ jsx5("ul", { className: "space-y-1", children: Object.entries(profile.hooks ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([event, commands]) => /* @__PURE__ */ jsxs4("li", { className: "flex min-w-0 justify-between gap-4", children: [
|
|
879
|
+
/* @__PURE__ */ jsx5("code", { className: "font-mono text-sm text-foreground", children: event }),
|
|
814
880
|
/* @__PURE__ */ jsxs4("span", { className: "text-sm text-muted-foreground", children: [
|
|
815
881
|
commands.length,
|
|
816
882
|
" configured"
|
|
817
883
|
] })
|
|
818
884
|
] }, event)) }) }),
|
|
819
|
-
Boolean(profile.modes && Object.keys(profile.modes).length) && /* @__PURE__ */
|
|
820
|
-
(profile.version || profile.tags?.length) && /* @__PURE__ */
|
|
885
|
+
Boolean(profile.modes && Object.keys(profile.modes).length) && /* @__PURE__ */ jsx5(ProfileSection, { title: "Modes", children: /* @__PURE__ */ jsx5("ul", { className: "flex flex-wrap gap-1.5", children: Object.keys(profile.modes ?? {}).sort().map((mode) => /* @__PURE__ */ jsx5("li", { className: "rounded-full bg-muted px-2 py-0.5 text-sm text-muted-foreground", children: mode }, mode)) }) }),
|
|
886
|
+
(profile.version || profile.tags?.length) && /* @__PURE__ */ jsx5(ProfileSection, { title: "Metadata", children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap gap-x-4 gap-y-2 text-muted-foreground", children: [
|
|
821
887
|
profile.version && /* @__PURE__ */ jsxs4("span", { children: [
|
|
822
888
|
"Version ",
|
|
823
889
|
profile.version
|
|
824
890
|
] }),
|
|
825
|
-
profile.tags?.map((tag) => /* @__PURE__ */
|
|
891
|
+
profile.tags?.map((tag) => /* @__PURE__ */ jsx5("span", { children: tag }, tag))
|
|
826
892
|
] }) })
|
|
827
893
|
] })
|
|
828
894
|
] });
|
|
@@ -830,50 +896,50 @@ function ProfileOverview({ profile, defaultExpanded = true, showIdentity = true
|
|
|
830
896
|
function JsonValue({ value, name }) {
|
|
831
897
|
if (value !== null && typeof value === "object") {
|
|
832
898
|
const entries = Object.entries(value);
|
|
833
|
-
return /* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ jsx5("li", { className: "min-w-0 list-none", children: /* @__PURE__ */ jsxs4("details", { open: true, children: [
|
|
834
900
|
/* @__PURE__ */ jsxs4("summary", { className: "cursor-pointer break-all rounded px-2 py-2 font-mono text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
901
|
+
/* @__PURE__ */ jsx5("span", { className: "font-medium text-primary", children: name }),
|
|
902
|
+
/* @__PURE__ */ jsx5("span", { className: "ml-2 text-xs text-muted-foreground", children: Array.isArray(value) ? `Array \xB7 ${entries.length}` : `Object \xB7 ${entries.length}` })
|
|
837
903
|
] }),
|
|
838
904
|
/* @__PURE__ */ jsxs4("ul", { className: "ml-3 min-w-0 border-l border-border pl-3", children: [
|
|
839
|
-
entries.map(([key, child]) => /* @__PURE__ */
|
|
840
|
-
entries.length === 0 && /* @__PURE__ */
|
|
905
|
+
entries.map(([key, child]) => /* @__PURE__ */ jsx5(JsonValue, { name: key, value: child }, key)),
|
|
906
|
+
entries.length === 0 && /* @__PURE__ */ jsx5("li", { className: "block px-2 py-1 font-mono text-sm text-muted-foreground", children: Array.isArray(value) ? "[]" : "{}" })
|
|
841
907
|
] })
|
|
842
908
|
] }) });
|
|
843
909
|
}
|
|
844
910
|
return /* @__PURE__ */ jsxs4("li", { className: "min-w-0 list-none px-2 py-2", children: [
|
|
845
911
|
/* @__PURE__ */ jsxs4("span", { className: "block break-all font-mono text-xs font-medium text-primary", children: [
|
|
846
912
|
name,
|
|
847
|
-
/* @__PURE__ */
|
|
913
|
+
/* @__PURE__ */ jsx5("span", { className: "ml-2 font-normal text-muted-foreground", children: value === null ? "null" : typeof value })
|
|
848
914
|
] }),
|
|
849
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ jsx5("span", { className: "mt-1 block whitespace-pre-wrap break-words font-mono text-sm leading-6 text-foreground", children: typeof value === "string" ? value || '""' : JSON.stringify(value) })
|
|
850
916
|
] });
|
|
851
917
|
}
|
|
852
918
|
function AgentProfileViewer({ profile, className = "", showFullProfile = false, ...overview }) {
|
|
853
919
|
const [view, setView] = useState4("overview");
|
|
854
920
|
const json = showFullProfile ? JSON.stringify(profile, null, 2) : "";
|
|
855
|
-
return /* @__PURE__ */
|
|
921
|
+
return /* @__PURE__ */ jsx5("section", { className: `min-w-0 text-sm text-foreground ${className}`.trim(), "aria-label": "Agent profile", children: showFullProfile ? /* @__PURE__ */ jsxs4(Tabs, { value: view, onValueChange: setView, children: [
|
|
856
922
|
/* @__PURE__ */ jsxs4("div", { className: "mb-4 flex min-w-0 flex-wrap items-center justify-between gap-3 rounded-xl border border-border bg-card p-2", children: [
|
|
857
923
|
/* @__PURE__ */ jsxs4(TabsList, { "aria-label": "Profile view", className: "h-auto flex-wrap justify-start", children: [
|
|
858
|
-
/* @__PURE__ */
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
-
/* @__PURE__ */
|
|
924
|
+
/* @__PURE__ */ jsx5(TabsTrigger, { value: "overview", children: "Overview" }),
|
|
925
|
+
/* @__PURE__ */ jsx5(TabsTrigger, { value: "json", children: "JSON tree" }),
|
|
926
|
+
/* @__PURE__ */ jsx5(TabsTrigger, { value: "raw", children: "Raw" })
|
|
861
927
|
] }),
|
|
862
928
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
863
|
-
/* @__PURE__ */
|
|
864
|
-
/* @__PURE__ */
|
|
929
|
+
/* @__PURE__ */ jsx5(CopyButton, { text: json }),
|
|
930
|
+
/* @__PURE__ */ jsx5(Button2, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ jsx5("a", { href: `data:application/json;charset=utf-8,${encodeURIComponent(json)}`, download: "agent-profile.json", children: "Download" }) })
|
|
865
931
|
] })
|
|
866
932
|
] }),
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ jsx5(TabsContent, { value: "overview", className: "mt-0", children: /* @__PURE__ */ jsx5(ProfileOverview, { profile, ...overview }) }),
|
|
934
|
+
/* @__PURE__ */ jsx5(TabsContent, { value: "json", className: "mt-0", children: /* @__PURE__ */ jsxs4("div", { className: "min-w-0 overflow-hidden rounded-xl border border-border bg-card", children: [
|
|
869
935
|
/* @__PURE__ */ jsxs4("div", { className: "border-b border-border bg-muted/35 p-4", children: [
|
|
870
|
-
/* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ jsx5(ProfileSectionHeading, { title: "Full profile JSON" }),
|
|
937
|
+
/* @__PURE__ */ jsx5("p", { className: "mt-2 text-sm leading-6 text-muted-foreground", children: "Every configured field, including extensions. Expand or collapse any object." })
|
|
872
938
|
] }),
|
|
873
|
-
/* @__PURE__ */
|
|
939
|
+
/* @__PURE__ */ jsx5("ul", { className: "min-w-0 p-2 sm:p-4", children: Object.entries(profile).map(([key, value]) => /* @__PURE__ */ jsx5(JsonValue, { name: key, value }, key)) })
|
|
874
940
|
] }) }),
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
] }) : /* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ jsx5(TabsContent, { value: "raw", className: "min-w-0 mt-0", children: /* @__PURE__ */ jsx5(CodeBlock, { code: json, language: "json", label: "agent-profile.json", showLineNumbers: true, className: "max-w-full" }) })
|
|
942
|
+
] }) : /* @__PURE__ */ jsx5(ProfileOverview, { profile, ...overview }) });
|
|
877
943
|
}
|
|
878
944
|
|
|
879
945
|
// src/web-react/interaction-card-support.ts
|
|
@@ -1048,7 +1114,7 @@ function createInteractionAnswerSubmitter(options) {
|
|
|
1048
1114
|
}
|
|
1049
1115
|
|
|
1050
1116
|
// src/web-react/interaction-question-card.tsx
|
|
1051
|
-
import { useEffect as useEffect3, useMemo as useMemo2, useRef as
|
|
1117
|
+
import { useEffect as useEffect3, useMemo as useMemo2, useRef as useRef4, useState as useState6 } from "react";
|
|
1052
1118
|
|
|
1053
1119
|
// src/web-react/motion.ts
|
|
1054
1120
|
import { useState as useState5 } from "react";
|
|
@@ -1061,9 +1127,9 @@ function useArrivalStyle(index) {
|
|
|
1061
1127
|
}
|
|
1062
1128
|
|
|
1063
1129
|
// src/web-react/interaction-question-card.tsx
|
|
1064
|
-
import { Fragment, jsx as
|
|
1130
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1065
1131
|
function CheckGlyph({ className }) {
|
|
1066
|
-
return /* @__PURE__ */
|
|
1132
|
+
return /* @__PURE__ */ jsx6("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx6("path", { d: "M20 6 9 17l-5-5" }) });
|
|
1067
1133
|
}
|
|
1068
1134
|
var BADGE_VARIANT_CLASSES = {
|
|
1069
1135
|
outline: "border-border text-foreground",
|
|
@@ -1071,7 +1137,7 @@ var BADGE_VARIANT_CLASSES = {
|
|
|
1071
1137
|
destructive: "border-transparent bg-destructive/15 text-destructive"
|
|
1072
1138
|
};
|
|
1073
1139
|
function InteractionBadge({ variant, children }) {
|
|
1074
|
-
return /* @__PURE__ */
|
|
1140
|
+
return /* @__PURE__ */ jsx6("span", { className: `inline-flex items-center rounded-md border px-2 py-0.5 text-sm font-medium ${BADGE_VARIANT_CLASSES[variant]}`, children });
|
|
1075
1141
|
}
|
|
1076
1142
|
function InteractionActionButton({
|
|
1077
1143
|
variant = "primary",
|
|
@@ -1080,7 +1146,7 @@ function InteractionActionButton({
|
|
|
1080
1146
|
children
|
|
1081
1147
|
}) {
|
|
1082
1148
|
const variantClasses = variant === "primary" ? "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90" : "border border-border bg-transparent text-foreground hover:bg-accent";
|
|
1083
|
-
return /* @__PURE__ */
|
|
1149
|
+
return /* @__PURE__ */ jsx6(
|
|
1084
1150
|
"button",
|
|
1085
1151
|
{
|
|
1086
1152
|
type: "button",
|
|
@@ -1102,7 +1168,7 @@ function QuestionOptionList({
|
|
|
1102
1168
|
onToggle,
|
|
1103
1169
|
answered = false
|
|
1104
1170
|
}) {
|
|
1105
|
-
return /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ jsx6(Fragment, { children: options.map((option, optionIndex) => {
|
|
1106
1172
|
const inputId = `${idPrefix}-${optionIndex}`;
|
|
1107
1173
|
const checked = selectedValues.includes(option.value);
|
|
1108
1174
|
const highlighted = answered && checked;
|
|
@@ -1113,7 +1179,7 @@ function QuestionOptionList({
|
|
|
1113
1179
|
style: staggerStyle(optionIndex),
|
|
1114
1180
|
className: `agent-arrive flex gap-2 rounded-lg border p-3 transition-colors ${highlighted ? "border-primary bg-primary/5" : "border-strong"} ${disabled ? "cursor-default" : "cursor-pointer hover:bg-accent"}`,
|
|
1115
1181
|
children: [
|
|
1116
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ jsx6(
|
|
1117
1183
|
"input",
|
|
1118
1184
|
{
|
|
1119
1185
|
id: inputId,
|
|
@@ -1129,10 +1195,10 @@ function QuestionOptionList({
|
|
|
1129
1195
|
}
|
|
1130
1196
|
),
|
|
1131
1197
|
/* @__PURE__ */ jsxs5("span", { className: "min-w-0 flex-1", children: [
|
|
1132
|
-
/* @__PURE__ */
|
|
1133
|
-
option.description && /* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ jsx6("span", { id: `${inputId}-label`, className: "block text-sm font-medium leading-5 text-foreground", children: option.label }),
|
|
1199
|
+
option.description && /* @__PURE__ */ jsx6("span", { id: `${inputId}-description`, className: "mt-0.5 block text-sm leading-5 text-muted-foreground", children: option.description })
|
|
1134
1200
|
] }),
|
|
1135
|
-
highlighted && /* @__PURE__ */
|
|
1201
|
+
highlighted && /* @__PURE__ */ jsx6(CheckGlyph, { className: "mt-0.5 h-4 w-4 shrink-0 text-primary" })
|
|
1136
1202
|
]
|
|
1137
1203
|
},
|
|
1138
1204
|
`${option.value}-${optionIndex}`
|
|
@@ -1185,7 +1251,7 @@ function useInteractionQuestionCardViewState({
|
|
|
1185
1251
|
const [lateAnswerOutcome, setLateAnswerOutcome] = useState6(null);
|
|
1186
1252
|
const lateAnswerSent = lateAnswerOutcome !== null;
|
|
1187
1253
|
const [error, setError] = useState6(null);
|
|
1188
|
-
const submitInFlightRef =
|
|
1254
|
+
const submitInFlightRef = useRef4(false);
|
|
1189
1255
|
const [declining, setDeclining] = useState6(false);
|
|
1190
1256
|
const [askId, setAskId] = useState6(interaction.id);
|
|
1191
1257
|
if (askId !== interaction.id) {
|
|
@@ -1331,7 +1397,7 @@ function useInteractionQuestionCardViewState({
|
|
|
1331
1397
|
}
|
|
1332
1398
|
function InteractionQuestionCard(props) {
|
|
1333
1399
|
const view = useInteractionQuestionCardViewState(props);
|
|
1334
|
-
return /* @__PURE__ */
|
|
1400
|
+
return /* @__PURE__ */ jsx6(InteractionQuestionCardView, { ...view });
|
|
1335
1401
|
}
|
|
1336
1402
|
function InteractionQuestionCardView({
|
|
1337
1403
|
className,
|
|
@@ -1372,12 +1438,12 @@ function InteractionQuestionCardView({
|
|
|
1372
1438
|
// dark card.
|
|
1373
1439
|
/* @__PURE__ */ jsxs5("div", { className: `agent-arrive rounded-xl border border-card-edge bg-card p-4 dark:[color-scheme:dark] ${className ?? ""}`, children: [
|
|
1374
1440
|
/* @__PURE__ */ jsxs5("div", { className: "mb-3 flex flex-wrap items-center gap-2", children: [
|
|
1375
|
-
/* @__PURE__ */
|
|
1376
|
-
/* @__PURE__ */
|
|
1441
|
+
/* @__PURE__ */ jsx6(InteractionBadge, { variant: "outline", children: kindLabel ?? "Question" }),
|
|
1442
|
+
/* @__PURE__ */ jsx6(InteractionBadge, { variant: answered ? "default" : status === "expired" || status === "declined" ? "destructive" : "outline", children: STATUS_LABELS[status] })
|
|
1377
1443
|
] }),
|
|
1378
|
-
interaction.title.trim() && interaction.fields.every((field) => field.label !== interaction.title) && /* @__PURE__ */
|
|
1379
|
-
interaction.body && (renderMarkdown ? /* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
1444
|
+
interaction.title.trim() && interaction.fields.every((field) => field.label !== interaction.title) && /* @__PURE__ */ jsx6("p", { className: "mb-3 text-[15px] font-semibold leading-snug text-foreground", children: interaction.title }),
|
|
1445
|
+
interaction.body && (renderMarkdown ? /* @__PURE__ */ jsx6("div", { className: "mb-3 text-sm leading-5 text-muted-foreground", children: renderMarkdown(interaction.body) }) : /* @__PURE__ */ jsx6("p", { className: "mb-3 text-sm leading-5 text-muted-foreground", children: interaction.body })),
|
|
1446
|
+
/* @__PURE__ */ jsx6(
|
|
1381
1447
|
InteractionQuestionFields,
|
|
1382
1448
|
{
|
|
1383
1449
|
interaction,
|
|
@@ -1388,20 +1454,20 @@ function InteractionQuestionCardView({
|
|
|
1388
1454
|
setFieldValue
|
|
1389
1455
|
}
|
|
1390
1456
|
),
|
|
1391
|
-
error && /* @__PURE__ */
|
|
1392
|
-
terminalNote && /* @__PURE__ */
|
|
1457
|
+
error && /* @__PURE__ */ jsx6("p", { role: "alert", className: "mt-3 text-sm text-destructive", children: error }),
|
|
1458
|
+
terminalNote && /* @__PURE__ */ jsx6("p", { className: "mt-3 text-sm text-muted-foreground", children: terminalNote }),
|
|
1393
1459
|
(showSubmitButton || showTimeoutNote) && /* @__PURE__ */ jsxs5("div", { className: "mt-4 flex flex-wrap items-center justify-end gap-2", children: [
|
|
1394
|
-
showTimeoutNote && /* @__PURE__ */
|
|
1395
|
-
missingHint && /* @__PURE__ */
|
|
1396
|
-
showDeclineButton && /* @__PURE__ */
|
|
1397
|
-
showSubmitButton && /* @__PURE__ */
|
|
1460
|
+
showTimeoutNote && /* @__PURE__ */ jsx6("div", { className: "mr-auto text-sm text-muted-foreground", children: timeoutNote }),
|
|
1461
|
+
missingHint && /* @__PURE__ */ jsx6("span", { "aria-live": "polite", className: "text-sm text-muted-foreground", children: missingHint }),
|
|
1462
|
+
showDeclineButton && /* @__PURE__ */ jsx6(InteractionActionButton, { variant: "outline", onClick: () => void decline(), disabled, children: declining ? "Declining\u2026" : "Decline" }),
|
|
1463
|
+
showSubmitButton && /* @__PURE__ */ jsx6(InteractionActionButton, { onClick: () => void submit(), disabled: disabled || !answerData, children: submitLabel })
|
|
1398
1464
|
] }),
|
|
1399
|
-
answered && /* @__PURE__ */
|
|
1400
|
-
/* @__PURE__ */
|
|
1465
|
+
answered && /* @__PURE__ */ jsx6("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsxs5("span", { className: "inline-flex items-center gap-1 text-sm text-muted-foreground", children: [
|
|
1466
|
+
/* @__PURE__ */ jsx6(CheckGlyph, { className: "h-3 w-3" }),
|
|
1401
1467
|
"Answered"
|
|
1402
1468
|
] }) }),
|
|
1403
|
-
lateAnswerSent && /* @__PURE__ */
|
|
1404
|
-
/* @__PURE__ */
|
|
1469
|
+
lateAnswerSent && /* @__PURE__ */ jsx6("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsxs5("span", { className: "inline-flex items-center gap-1 text-sm text-muted-foreground", children: [
|
|
1470
|
+
/* @__PURE__ */ jsx6(CheckGlyph, { className: "h-3 w-3" }),
|
|
1405
1471
|
lateAnswerOutcome === "queued" ? "Queued. It sends when the agent finishes." : "Sent as new message"
|
|
1406
1472
|
] }) })
|
|
1407
1473
|
] })
|
|
@@ -1415,14 +1481,14 @@ function InteractionQuestionFields({
|
|
|
1415
1481
|
answered,
|
|
1416
1482
|
setFieldValue
|
|
1417
1483
|
}) {
|
|
1418
|
-
return /* @__PURE__ */
|
|
1484
|
+
return /* @__PURE__ */ jsx6("div", { className: "space-y-4", children: interaction.fields.map((field) => {
|
|
1419
1485
|
const value = values[field.name] ?? {};
|
|
1420
1486
|
const select = selectField(field);
|
|
1421
1487
|
const freeText = freeTextField(field);
|
|
1422
1488
|
return /* @__PURE__ */ jsxs5("fieldset", { className: "space-y-2", children: [
|
|
1423
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ jsx6("p", { className: "text-sm font-medium leading-5 text-foreground", children: field.label }),
|
|
1424
1490
|
select ? /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
1425
|
-
/* @__PURE__ */
|
|
1491
|
+
/* @__PURE__ */ jsx6(
|
|
1426
1492
|
QuestionOptionList,
|
|
1427
1493
|
{
|
|
1428
1494
|
groupName: `${interaction.id}-${field.name}`,
|
|
@@ -1435,7 +1501,7 @@ function InteractionQuestionFields({
|
|
|
1435
1501
|
answered
|
|
1436
1502
|
}
|
|
1437
1503
|
),
|
|
1438
|
-
select.allowCustom === true && /* @__PURE__ */
|
|
1504
|
+
select.allowCustom === true && /* @__PURE__ */ jsx6(
|
|
1439
1505
|
"input",
|
|
1440
1506
|
{
|
|
1441
1507
|
type: "text",
|
|
@@ -1447,8 +1513,8 @@ function InteractionQuestionFields({
|
|
|
1447
1513
|
className: FIELD_INPUT_CLASSES
|
|
1448
1514
|
}
|
|
1449
1515
|
)
|
|
1450
|
-
] }) : field.type === "boolean" ? /* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1516
|
+
] }) : field.type === "boolean" ? /* @__PURE__ */ jsx6("div", { className: "flex gap-4", children: ["true", "false"].map((boolValue) => /* @__PURE__ */ jsxs5("label", { className: "flex cursor-pointer items-center gap-2 text-sm text-foreground", children: [
|
|
1517
|
+
/* @__PURE__ */ jsx6(
|
|
1452
1518
|
"input",
|
|
1453
1519
|
{
|
|
1454
1520
|
type: "radio",
|
|
@@ -1461,7 +1527,7 @@ function InteractionQuestionFields({
|
|
|
1461
1527
|
}
|
|
1462
1528
|
),
|
|
1463
1529
|
boolValue === "true" ? "Yes" : "No"
|
|
1464
|
-
] }, boolValue)) }) : field.type === "number" ? /* @__PURE__ */
|
|
1530
|
+
] }, boolValue)) }) : field.type === "number" ? /* @__PURE__ */ jsx6(
|
|
1465
1531
|
"input",
|
|
1466
1532
|
{
|
|
1467
1533
|
type: "number",
|
|
@@ -1471,7 +1537,7 @@ function InteractionQuestionFields({
|
|
|
1471
1537
|
onChange: (event) => setFieldValue(field.name, { text: event.target.value }),
|
|
1472
1538
|
className: FIELD_INPUT_CLASSES
|
|
1473
1539
|
}
|
|
1474
|
-
) : field.type === "secret" ? /* @__PURE__ */
|
|
1540
|
+
) : field.type === "secret" ? /* @__PURE__ */ jsx6(
|
|
1475
1541
|
"input",
|
|
1476
1542
|
{
|
|
1477
1543
|
type: "password",
|
|
@@ -1483,7 +1549,7 @@ function InteractionQuestionFields({
|
|
|
1483
1549
|
maxLength: freeText ? textFieldMaxLength(freeText) : void 0,
|
|
1484
1550
|
className: FIELD_INPUT_CLASSES
|
|
1485
1551
|
}
|
|
1486
|
-
) : /* @__PURE__ */
|
|
1552
|
+
) : /* @__PURE__ */ jsx6(
|
|
1487
1553
|
"textarea",
|
|
1488
1554
|
{
|
|
1489
1555
|
value: value.text ?? "",
|
|
@@ -1501,13 +1567,13 @@ function InteractionQuestionFields({
|
|
|
1501
1567
|
}
|
|
1502
1568
|
|
|
1503
1569
|
// src/web-react/interaction-plan-card.tsx
|
|
1504
|
-
import { useLayoutEffect, useMemo as useMemo3, useRef as
|
|
1505
|
-
import { jsx as
|
|
1570
|
+
import { useLayoutEffect, useMemo as useMemo3, useRef as useRef5, useState as useState7 } from "react";
|
|
1571
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1506
1572
|
function CheckGlyph2({ className }) {
|
|
1507
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ jsx7("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx7("path", { d: "M20 6 9 17l-5-5" }) });
|
|
1508
1574
|
}
|
|
1509
1575
|
function ChevronDownGlyph({ className }) {
|
|
1510
|
-
return /* @__PURE__ */
|
|
1576
|
+
return /* @__PURE__ */ jsx7("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx7("path", { d: "m6 9 6 6 6-6" }) });
|
|
1511
1577
|
}
|
|
1512
1578
|
var STATUS_LABELS2 = interactionStatusLabels({
|
|
1513
1579
|
pending: "Waiting for your approval",
|
|
@@ -1529,7 +1595,7 @@ function submittedFieldText(field, values) {
|
|
|
1529
1595
|
return String(answer);
|
|
1530
1596
|
}
|
|
1531
1597
|
function useBodyOverflows(body, renderMarkdown) {
|
|
1532
|
-
const bodyRef =
|
|
1598
|
+
const bodyRef = useRef5(null);
|
|
1533
1599
|
const [overflows, setOverflows] = useState7(false);
|
|
1534
1600
|
useLayoutEffect(() => {
|
|
1535
1601
|
const el = bodyRef.current;
|
|
@@ -1553,7 +1619,7 @@ function InteractionPlanCard({
|
|
|
1553
1619
|
const [localStatus, setLocalStatus] = useState7(null);
|
|
1554
1620
|
const [reRequested, setReRequested] = useState7(false);
|
|
1555
1621
|
const [error, setError] = useState7(null);
|
|
1556
|
-
const submitInFlightRef =
|
|
1622
|
+
const submitInFlightRef = useRef5(false);
|
|
1557
1623
|
const { bodyRef, overflows } = useBodyOverflows(interaction.body, renderMarkdown);
|
|
1558
1624
|
const status = isTerminalInteractionStatus(interaction.status) ? interaction.status : localStatus ?? interaction.status;
|
|
1559
1625
|
const reRequestable = isLateAnswerableStatus(status) && onReRequest !== void 0;
|
|
@@ -1623,21 +1689,21 @@ function InteractionPlanCard({
|
|
|
1623
1689
|
// same DOM node, and a CSS animation does not replay on a re-render.
|
|
1624
1690
|
/* @__PURE__ */ jsxs6("div", { className: `agent-arrive rounded-xl border border-card-edge bg-card p-4 ${className ?? ""}`, children: [
|
|
1625
1691
|
/* @__PURE__ */ jsxs6("div", { className: "mb-3 flex flex-wrap items-center gap-2", children: [
|
|
1626
|
-
/* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */
|
|
1692
|
+
/* @__PURE__ */ jsx7(InteractionBadge, { variant: "outline", children: "Plan" }),
|
|
1693
|
+
/* @__PURE__ */ jsx7(InteractionBadge, { variant: approved ? "default" : status === "expired" || status === "declined" ? "destructive" : "outline", children: STATUS_LABELS2[status] })
|
|
1628
1694
|
] }),
|
|
1629
|
-
interaction.title.trim() && /* @__PURE__ */
|
|
1695
|
+
interaction.title.trim() && /* @__PURE__ */ jsx7("p", { className: "mb-3 text-[15px] font-semibold leading-snug text-foreground", children: interaction.title }),
|
|
1630
1696
|
interaction.body && /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
|
|
1631
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ jsx7(
|
|
1632
1698
|
"div",
|
|
1633
1699
|
{
|
|
1634
1700
|
ref: bodyRef,
|
|
1635
1701
|
className: "overflow-hidden text-sm text-foreground",
|
|
1636
1702
|
style: expanded || !overflows ? void 0 : { maxHeight: COLLAPSED_MAX_HEIGHT },
|
|
1637
|
-
children: renderMarkdown ? renderMarkdown(interaction.body) : /* @__PURE__ */
|
|
1703
|
+
children: renderMarkdown ? renderMarkdown(interaction.body) : /* @__PURE__ */ jsx7("p", { className: "whitespace-pre-wrap leading-5", children: interaction.body })
|
|
1638
1704
|
}
|
|
1639
1705
|
),
|
|
1640
|
-
overflows && !expanded && /* @__PURE__ */
|
|
1706
|
+
overflows && !expanded && /* @__PURE__ */ jsx7("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-card to-transparent" }),
|
|
1641
1707
|
overflows && /* @__PURE__ */ jsxs6(
|
|
1642
1708
|
"button",
|
|
1643
1709
|
{
|
|
@@ -1645,7 +1711,7 @@ function InteractionPlanCard({
|
|
|
1645
1711
|
onClick: () => setExpanded((prev) => !prev),
|
|
1646
1712
|
className: "relative z-10 mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground transition hover:text-foreground",
|
|
1647
1713
|
children: [
|
|
1648
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ jsx7(ChevronDownGlyph, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` }),
|
|
1649
1715
|
expanded ? "Collapse plan" : "Show full plan"
|
|
1650
1716
|
]
|
|
1651
1717
|
}
|
|
@@ -1665,9 +1731,9 @@ function InteractionPlanCard({
|
|
|
1665
1731
|
// CHOICES being offered, and telling the eye there are three of them
|
|
1666
1732
|
// before it has read any is information about the decision. A form's
|
|
1667
1733
|
// fields carry no such count to announce.
|
|
1668
|
-
/* @__PURE__ */
|
|
1669
|
-
/* @__PURE__ */
|
|
1670
|
-
fieldAcceptsFreeText(field) ? /* @__PURE__ */
|
|
1734
|
+
/* @__PURE__ */ jsx7("div", { className: "mt-3 space-y-4", children: interaction.fields.map((field) => /* @__PURE__ */ jsxs6("fieldset", { className: "space-y-2", children: [
|
|
1735
|
+
/* @__PURE__ */ jsx7("p", { className: "text-sm font-medium leading-5 text-foreground", children: field.label }),
|
|
1736
|
+
fieldAcceptsFreeText(field) ? /* @__PURE__ */ jsx7(
|
|
1671
1737
|
"textarea",
|
|
1672
1738
|
{
|
|
1673
1739
|
value: values[field.name]?.text ?? "",
|
|
@@ -1678,7 +1744,7 @@ function InteractionPlanCard({
|
|
|
1678
1744
|
placeholder: field.type === "text" ? field.placeholder ?? "Optional feedback for the agent" : void 0,
|
|
1679
1745
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary disabled:opacity-50"
|
|
1680
1746
|
}
|
|
1681
|
-
) : /* @__PURE__ */
|
|
1747
|
+
) : /* @__PURE__ */ jsx7(
|
|
1682
1748
|
"input",
|
|
1683
1749
|
{
|
|
1684
1750
|
type: "text",
|
|
@@ -1690,27 +1756,27 @@ function InteractionPlanCard({
|
|
|
1690
1756
|
}
|
|
1691
1757
|
)
|
|
1692
1758
|
] }, field.name)) }),
|
|
1693
|
-
interaction.fields.length > 0 && status !== "pending" && /* @__PURE__ */
|
|
1759
|
+
interaction.fields.length > 0 && status !== "pending" && /* @__PURE__ */ jsx7("div", { className: "mt-3 space-y-2", children: interaction.fields.map((field) => {
|
|
1694
1760
|
const text = submittedFieldText(field, submittedValues);
|
|
1695
1761
|
if (!text) return null;
|
|
1696
1762
|
return /* @__PURE__ */ jsxs6("div", { children: [
|
|
1697
|
-
/* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */
|
|
1763
|
+
/* @__PURE__ */ jsx7("p", { className: "text-xs font-medium text-muted-foreground", children: field.label }),
|
|
1764
|
+
/* @__PURE__ */ jsx7("p", { className: "mt-0.5 whitespace-pre-wrap text-sm text-foreground", children: text })
|
|
1699
1765
|
] }, field.name);
|
|
1700
1766
|
}) }),
|
|
1701
|
-
error && /* @__PURE__ */
|
|
1702
|
-
terminalNote && /* @__PURE__ */
|
|
1703
|
-
canReRequest && /* @__PURE__ */
|
|
1704
|
-
reRequested && /* @__PURE__ */
|
|
1705
|
-
/* @__PURE__ */
|
|
1767
|
+
error && /* @__PURE__ */ jsx7("p", { className: "mt-3 text-xs text-destructive", children: error }),
|
|
1768
|
+
terminalNote && /* @__PURE__ */ jsx7("p", { className: "mt-3 text-xs text-muted-foreground", children: terminalNote }),
|
|
1769
|
+
canReRequest && /* @__PURE__ */ jsx7("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsx7(InteractionActionButton, { variant: "outline", onClick: () => void requestReSubmission(), disabled: submitting !== null, children: submitting === "requesting" ? "Asking\u2026" : reRequestLabel ?? DEFAULT_RE_REQUEST_LABEL }) }),
|
|
1770
|
+
reRequested && /* @__PURE__ */ jsx7("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
1771
|
+
/* @__PURE__ */ jsx7(CheckGlyph2, { className: "h-3 w-3" }),
|
|
1706
1772
|
"Re-submission requested"
|
|
1707
1773
|
] }) }),
|
|
1708
1774
|
status === "pending" && /* @__PURE__ */ jsxs6("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
|
|
1709
|
-
/* @__PURE__ */
|
|
1710
|
-
/* @__PURE__ */
|
|
1775
|
+
/* @__PURE__ */ jsx7(InteractionActionButton, { variant: "outline", onClick: () => void submit("declined"), disabled, children: submitting === "reject" ? "Sending\u2026" : "Request changes" }),
|
|
1776
|
+
/* @__PURE__ */ jsx7(InteractionActionButton, { onClick: () => void submit("accepted"), disabled: disabled || approveData === null, children: submitting === "approve" ? "Approving\u2026" : "Approve plan" })
|
|
1711
1777
|
] }),
|
|
1712
|
-
approved && /* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1778
|
+
approved && /* @__PURE__ */ jsx7("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
1779
|
+
/* @__PURE__ */ jsx7(CheckGlyph2, { className: "h-3 w-3" }),
|
|
1714
1780
|
"Approved"
|
|
1715
1781
|
] }) })
|
|
1716
1782
|
] })
|
|
@@ -1718,7 +1784,7 @@ function InteractionPlanCard({
|
|
|
1718
1784
|
}
|
|
1719
1785
|
|
|
1720
1786
|
// src/web-react/durable-plan-flow.ts
|
|
1721
|
-
import { useCallback as useCallback2, useEffect as useEffect4, useLayoutEffect as useLayoutEffect2, useRef as
|
|
1787
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useLayoutEffect as useLayoutEffect2, useRef as useRef6, useState as useState8 } from "react";
|
|
1722
1788
|
var DurablePlanClientError = class extends Error {
|
|
1723
1789
|
constructor(message, status, code, currentPlan) {
|
|
1724
1790
|
super(message);
|
|
@@ -1835,16 +1901,16 @@ function useDurablePlanFlow(options) {
|
|
|
1835
1901
|
const [deciding, setDeciding] = useState8(null);
|
|
1836
1902
|
const [restoring, setRestoring] = useState8(false);
|
|
1837
1903
|
const [error, setError] = useState8(null);
|
|
1838
|
-
const attachments =
|
|
1839
|
-
const decisionInFlight =
|
|
1840
|
-
const restoration =
|
|
1904
|
+
const attachments = useRef6(/* @__PURE__ */ new Map());
|
|
1905
|
+
const decisionInFlight = useRef6(false);
|
|
1906
|
+
const restoration = useRef6({ restored: null, inFlight: null, attempts: /* @__PURE__ */ new Map() });
|
|
1841
1907
|
const [effectPending, setEffectPending] = useState8(false);
|
|
1842
1908
|
const [attachError, setAttachError] = useState8(null);
|
|
1843
1909
|
const [restoreRetry, setRestoreRetry] = useState8(0);
|
|
1844
1910
|
const advanceRestore = useCallback2(() => setRestoreRetry((value) => value + 1), []);
|
|
1845
|
-
const lifetime =
|
|
1911
|
+
const lifetime = useRef6(null);
|
|
1846
1912
|
const scopeKey = options.scopeKey ?? options.client.scopeKey;
|
|
1847
|
-
const latest =
|
|
1913
|
+
const latest = useRef6(options);
|
|
1848
1914
|
useLayoutEffect2(() => {
|
|
1849
1915
|
latest.current = options;
|
|
1850
1916
|
});
|
|
@@ -1990,8 +2056,8 @@ function useDurablePlanFlow(options) {
|
|
|
1990
2056
|
}
|
|
1991
2057
|
|
|
1992
2058
|
// src/web-react/durable-plan-card.tsx
|
|
1993
|
-
import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect3, useRef as
|
|
1994
|
-
import { jsx as
|
|
2059
|
+
import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect3, useRef as useRef7, useState as useState9 } from "react";
|
|
2060
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1995
2061
|
function statusLabel(plan) {
|
|
1996
2062
|
switch (plan.status) {
|
|
1997
2063
|
case "pending":
|
|
@@ -2024,7 +2090,7 @@ function DurablePlanCard({
|
|
|
2024
2090
|
useEffect5(() => setLocalError(null), [plan.planId, plan.revision, plan.status]);
|
|
2025
2091
|
const actionable = plan.status === "pending";
|
|
2026
2092
|
const disabled = !canWrite || !actionable || deciding !== null;
|
|
2027
|
-
const bodyRef =
|
|
2093
|
+
const bodyRef = useRef7(null);
|
|
2028
2094
|
const [overflows, setOverflows] = useState9(false);
|
|
2029
2095
|
useLayoutEffect3(() => {
|
|
2030
2096
|
const el = bodyRef.current;
|
|
@@ -2042,27 +2108,27 @@ function DurablePlanCard({
|
|
|
2042
2108
|
return /* @__PURE__ */ jsxs7("div", { className: `rounded-xl border border-primary/40 bg-card p-4 ${className ?? ""}`, children: [
|
|
2043
2109
|
/* @__PURE__ */ jsxs7("div", { className: "mb-3 flex flex-wrap items-center justify-between gap-2", children: [
|
|
2044
2110
|
/* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2111
|
+
/* @__PURE__ */ jsx8(InteractionBadge, { variant: "outline", children: "Plan decision" }),
|
|
2112
|
+
/* @__PURE__ */ jsx8(InteractionBadge, { variant: plan.status === "approved" ? "default" : plan.status === "rejected" || plan.status === "withdrawn" ? "destructive" : "outline", children: statusLabel(plan) })
|
|
2047
2113
|
] }),
|
|
2048
2114
|
/* @__PURE__ */ jsxs7("span", { className: "text-xs text-muted-foreground", children: [
|
|
2049
2115
|
"Revision ",
|
|
2050
2116
|
plan.revision
|
|
2051
2117
|
] })
|
|
2052
2118
|
] }),
|
|
2053
|
-
plan.title && /* @__PURE__ */
|
|
2119
|
+
plan.title && /* @__PURE__ */ jsx8("p", { className: "mb-3 text-[15px] font-semibold leading-snug text-foreground", children: plan.title }),
|
|
2054
2120
|
/* @__PURE__ */ jsxs7("div", { className: "relative", children: [
|
|
2055
|
-
/* @__PURE__ */
|
|
2121
|
+
/* @__PURE__ */ jsx8(
|
|
2056
2122
|
"div",
|
|
2057
2123
|
{
|
|
2058
2124
|
ref: bodyRef,
|
|
2059
2125
|
className: "overflow-hidden text-sm",
|
|
2060
2126
|
style: expanded || !overflows ? void 0 : { maxHeight: COLLAPSED_MAX_HEIGHT2 },
|
|
2061
|
-
children: renderMarkdown ? renderMarkdown(plan.body) : /* @__PURE__ */
|
|
2127
|
+
children: renderMarkdown ? renderMarkdown(plan.body) : /* @__PURE__ */ jsx8("p", { className: "whitespace-pre-wrap leading-5", children: plan.body })
|
|
2062
2128
|
}
|
|
2063
2129
|
),
|
|
2064
|
-
overflows && !expanded && /* @__PURE__ */
|
|
2065
|
-
overflows && /* @__PURE__ */
|
|
2130
|
+
overflows && !expanded && /* @__PURE__ */ jsx8("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-card to-transparent" }),
|
|
2131
|
+
overflows && /* @__PURE__ */ jsx8(
|
|
2066
2132
|
"button",
|
|
2067
2133
|
{
|
|
2068
2134
|
type: "button",
|
|
@@ -2073,8 +2139,8 @@ function DurablePlanCard({
|
|
|
2073
2139
|
)
|
|
2074
2140
|
] }),
|
|
2075
2141
|
actionable && /* @__PURE__ */ jsxs7("div", { className: "mt-3 space-y-2", children: [
|
|
2076
|
-
/* @__PURE__ */
|
|
2077
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ jsx8("label", { className: "block text-sm font-medium leading-5 text-foreground", htmlFor: `durable-plan-feedback-${plan.planId}-${plan.revision}`, children: "Feedback for requested changes" }),
|
|
2143
|
+
/* @__PURE__ */ jsx8(
|
|
2078
2144
|
"textarea",
|
|
2079
2145
|
{
|
|
2080
2146
|
id: `durable-plan-feedback-${plan.planId}-${plan.revision}`,
|
|
@@ -2087,16 +2153,16 @@ function DurablePlanCard({
|
|
|
2087
2153
|
}
|
|
2088
2154
|
)
|
|
2089
2155
|
] }),
|
|
2090
|
-
(localError ?? error) && /* @__PURE__ */
|
|
2156
|
+
(localError ?? error) && /* @__PURE__ */ jsx8("p", { className: "mt-3 text-xs text-destructive", children: localError ?? error }),
|
|
2091
2157
|
actionable && /* @__PURE__ */ jsxs7("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
|
|
2092
|
-
/* @__PURE__ */
|
|
2093
|
-
/* @__PURE__ */
|
|
2158
|
+
/* @__PURE__ */ jsx8(InteractionActionButton, { variant: "outline", onClick: () => void submit("rejected"), disabled, children: deciding === "rejected" ? "Sending\u2026" : "Request changes" }),
|
|
2159
|
+
/* @__PURE__ */ jsx8(InteractionActionButton, { onClick: () => void submit("approved"), disabled, children: deciding === "approved" ? "Approving\u2026" : "Approve plan" })
|
|
2094
2160
|
] })
|
|
2095
2161
|
] });
|
|
2096
2162
|
}
|
|
2097
2163
|
|
|
2098
2164
|
// src/web-react/durable-plan-flow-card.tsx
|
|
2099
|
-
import { jsx as
|
|
2165
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2100
2166
|
function DurablePlanFlowCard({
|
|
2101
2167
|
plan,
|
|
2102
2168
|
client,
|
|
@@ -2111,7 +2177,7 @@ function DurablePlanFlowCard({
|
|
|
2111
2177
|
const decided = current.status === "approved" || current.status === "rejected";
|
|
2112
2178
|
const rejected = current.status === "rejected";
|
|
2113
2179
|
return /* @__PURE__ */ jsxs8("div", { className: "space-y-2", children: [
|
|
2114
|
-
/* @__PURE__ */
|
|
2180
|
+
/* @__PURE__ */ jsx9(
|
|
2115
2181
|
DurablePlanCard,
|
|
2116
2182
|
{
|
|
2117
2183
|
plan: current,
|
|
@@ -2124,8 +2190,8 @@ function DurablePlanFlowCard({
|
|
|
2124
2190
|
}
|
|
2125
2191
|
),
|
|
2126
2192
|
flow.effectPending && decided && /* @__PURE__ */ jsxs8("div", { className: "flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border p-3 text-sm", children: [
|
|
2127
|
-
/* @__PURE__ */
|
|
2128
|
-
/* @__PURE__ */
|
|
2193
|
+
/* @__PURE__ */ jsx9("p", { children: "The decision is saved. Its follow-up still needs confirmation." }),
|
|
2194
|
+
/* @__PURE__ */ jsx9(
|
|
2129
2195
|
InteractionActionButton,
|
|
2130
2196
|
{
|
|
2131
2197
|
disabled: !canWrite || flow.deciding !== null,
|
|
@@ -2134,7 +2200,7 @@ function DurablePlanFlowCard({
|
|
|
2134
2200
|
}
|
|
2135
2201
|
)
|
|
2136
2202
|
] }),
|
|
2137
|
-
flow.attachError && /* @__PURE__ */
|
|
2203
|
+
flow.attachError && /* @__PURE__ */ jsx9(
|
|
2138
2204
|
"button",
|
|
2139
2205
|
{
|
|
2140
2206
|
type: "button",
|
|
@@ -2147,7 +2213,7 @@ function DurablePlanFlowCard({
|
|
|
2147
2213
|
}
|
|
2148
2214
|
|
|
2149
2215
|
// src/web-react/durable-chat-cards.tsx
|
|
2150
|
-
import { jsx as
|
|
2216
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
2151
2217
|
function planIdentity(planId, revision) {
|
|
2152
2218
|
return `${planId}:${revision}`;
|
|
2153
2219
|
}
|
|
@@ -2188,9 +2254,9 @@ function DurableChatCards({
|
|
|
2188
2254
|
}) {
|
|
2189
2255
|
const cards = durableChatCardsFromParts(parts);
|
|
2190
2256
|
if (cards.length === 0) return null;
|
|
2191
|
-
return /* @__PURE__ */
|
|
2257
|
+
return /* @__PURE__ */ jsx10("div", { className: `space-y-3 ${className ?? ""}`, children: cards.map((card) => {
|
|
2192
2258
|
if (card.kind === "plan") {
|
|
2193
|
-
return /* @__PURE__ */
|
|
2259
|
+
return /* @__PURE__ */ jsx10(
|
|
2194
2260
|
DurablePlanCard,
|
|
2195
2261
|
{
|
|
2196
2262
|
plan: card.plan,
|
|
@@ -2204,7 +2270,7 @@ function DurableChatCards({
|
|
|
2204
2270
|
);
|
|
2205
2271
|
}
|
|
2206
2272
|
if (card.interaction.kind === "plan") {
|
|
2207
|
-
return /* @__PURE__ */
|
|
2273
|
+
return /* @__PURE__ */ jsx10(
|
|
2208
2274
|
InteractionPlanCard,
|
|
2209
2275
|
{
|
|
2210
2276
|
interaction: card.interaction,
|
|
@@ -2218,7 +2284,7 @@ function DurableChatCards({
|
|
|
2218
2284
|
card.key
|
|
2219
2285
|
);
|
|
2220
2286
|
}
|
|
2221
|
-
return /* @__PURE__ */
|
|
2287
|
+
return /* @__PURE__ */ jsx10(
|
|
2222
2288
|
InteractionQuestionCard,
|
|
2223
2289
|
{
|
|
2224
2290
|
interaction: card.interaction,
|
|
@@ -2450,7 +2516,7 @@ function useChatInteractions(options = {}) {
|
|
|
2450
2516
|
}
|
|
2451
2517
|
|
|
2452
2518
|
// src/web-react/use-file-mentions.ts
|
|
2453
|
-
import { useCallback as useCallback4, useMemo as useMemo5, useRef as
|
|
2519
|
+
import { useCallback as useCallback4, useMemo as useMemo5, useRef as useRef8, useState as useState11 } from "react";
|
|
2454
2520
|
var FILE_MENTION_KIND = "file";
|
|
2455
2521
|
var AGENT_MENTION_KIND = "agent";
|
|
2456
2522
|
function agentToMentionItem(agent) {
|
|
@@ -2525,9 +2591,9 @@ function useFileMentions(options) {
|
|
|
2525
2591
|
} = options;
|
|
2526
2592
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
2527
2593
|
const [state, setState] = useState11({ kind: "idle" });
|
|
2528
|
-
const stateRef =
|
|
2594
|
+
const stateRef = useRef8(state);
|
|
2529
2595
|
stateRef.current = state;
|
|
2530
|
-
const inFlightRef =
|
|
2596
|
+
const inFlightRef = useRef8(null);
|
|
2531
2597
|
const [mentions, setMentions] = useState11([]);
|
|
2532
2598
|
const agentsByHandle = useMemo5(() => new Map((agents ?? []).map((agent) => [agent.handle, agent])), [agents]);
|
|
2533
2599
|
const load = useCallback4(() => {
|
|
@@ -2690,12 +2756,12 @@ function segmentsFromParts(parts) {
|
|
|
2690
2756
|
}
|
|
2691
2757
|
|
|
2692
2758
|
// src/web-react/use-plan-mode-selection.ts
|
|
2693
|
-
import { useCallback as useCallback5, useEffect as useEffect6, useRef as
|
|
2759
|
+
import { useCallback as useCallback5, useEffect as useEffect6, useRef as useRef9, useState as useState12 } from "react";
|
|
2694
2760
|
function usePlanModeSelection(threadId, initialPlanMode, options = {}) {
|
|
2695
2761
|
const [value, setValueState] = useState12(initialPlanMode);
|
|
2696
2762
|
const [saving, setSaving] = useState12(false);
|
|
2697
|
-
const inFlightRef =
|
|
2698
|
-
const seqRef =
|
|
2763
|
+
const inFlightRef = useRef9(0);
|
|
2764
|
+
const seqRef = useRef9(0);
|
|
2699
2765
|
const { threadUrl } = options;
|
|
2700
2766
|
useEffect6(() => {
|
|
2701
2767
|
if (inFlightRef.current === 0) setValueState(initialPlanMode);
|
|
@@ -2730,7 +2796,7 @@ function usePlanModeSelection(threadId, initialPlanMode, options = {}) {
|
|
|
2730
2796
|
}
|
|
2731
2797
|
|
|
2732
2798
|
// src/web-react/use-models.ts
|
|
2733
|
-
import { useEffect as useEffect7, useRef as
|
|
2799
|
+
import { useEffect as useEffect7, useRef as useRef10, useState as useState13 } from "react";
|
|
2734
2800
|
var modelCache = /* @__PURE__ */ new Map();
|
|
2735
2801
|
var STALE_AFTER_MS = 10 * 60 * 1e3;
|
|
2736
2802
|
function useModels(options = {}) {
|
|
@@ -2741,7 +2807,7 @@ function useModels(options = {}) {
|
|
|
2741
2807
|
const [loading, setLoading] = useState13(enabled && !cached);
|
|
2742
2808
|
const [error, setError] = useState13(null);
|
|
2743
2809
|
const [reloadKey, setReloadKey] = useState13(0);
|
|
2744
|
-
const forceFetch =
|
|
2810
|
+
const forceFetch = useRef10(false);
|
|
2745
2811
|
useEffect7(() => {
|
|
2746
2812
|
if (!enabled) {
|
|
2747
2813
|
setLoading(false);
|
|
@@ -2798,22 +2864,22 @@ function useModels(options = {}) {
|
|
|
2798
2864
|
|
|
2799
2865
|
// src/web-react/message-attachments.tsx
|
|
2800
2866
|
import { useCallback as useCallback6, useEffect as useEffect8, useState as useState14 } from "react";
|
|
2801
|
-
import { jsx as
|
|
2867
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2802
2868
|
function FileGlyph({ className }) {
|
|
2803
2869
|
return /* @__PURE__ */ jsxs9("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
2804
|
-
/* @__PURE__ */
|
|
2805
|
-
/* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ jsx11("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
2871
|
+
/* @__PURE__ */ jsx11("path", { d: "M14 2v6h6" })
|
|
2806
2872
|
] });
|
|
2807
2873
|
}
|
|
2808
2874
|
function ImageGlyph({ className }) {
|
|
2809
2875
|
return /* @__PURE__ */ jsxs9("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
2810
|
-
/* @__PURE__ */
|
|
2811
|
-
/* @__PURE__ */
|
|
2812
|
-
/* @__PURE__ */
|
|
2876
|
+
/* @__PURE__ */ jsx11("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
2877
|
+
/* @__PURE__ */ jsx11("circle", { cx: "9", cy: "9", r: "2" }),
|
|
2878
|
+
/* @__PURE__ */ jsx11("path", { d: "m21 15-5-5L5 21" })
|
|
2813
2879
|
] });
|
|
2814
2880
|
}
|
|
2815
2881
|
function WarningGlyph({ className }) {
|
|
2816
|
-
return /* @__PURE__ */
|
|
2882
|
+
return /* @__PURE__ */ jsx11("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx11("path", { d: "M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z" }) });
|
|
2817
2883
|
}
|
|
2818
2884
|
function iconForMediaType(mediaType) {
|
|
2819
2885
|
return mediaType?.startsWith("image/") ? ImageGlyph : FileGlyph;
|
|
@@ -2886,8 +2952,8 @@ function useAttachmentObjectUrl(blob) {
|
|
|
2886
2952
|
}
|
|
2887
2953
|
function AttachmentThumbnailError({ name }) {
|
|
2888
2954
|
return /* @__PURE__ */ jsxs9("span", { className: "inline-flex h-16 w-16 shrink-0 flex-col items-center justify-center gap-1 rounded-md border border-destructive/40 bg-destructive/10 px-1 text-center text-destructive", children: [
|
|
2889
|
-
/* @__PURE__ */
|
|
2890
|
-
/* @__PURE__ */
|
|
2955
|
+
/* @__PURE__ */ jsx11(WarningGlyph, { className: "h-4 w-4 shrink-0" }),
|
|
2956
|
+
/* @__PURE__ */ jsx11("span", { className: "line-clamp-2 text-xs leading-tight", children: name })
|
|
2891
2957
|
] });
|
|
2892
2958
|
}
|
|
2893
2959
|
function AttachmentUnavailable({ shape }) {
|
|
@@ -2898,8 +2964,8 @@ function AttachmentUnavailable({ shape }) {
|
|
|
2898
2964
|
"aria-disabled": "true",
|
|
2899
2965
|
className: "inline-flex h-16 w-16 shrink-0 flex-col items-center justify-center gap-1 rounded-md border border-border bg-muted px-1 text-center text-muted-foreground",
|
|
2900
2966
|
children: [
|
|
2901
|
-
/* @__PURE__ */
|
|
2902
|
-
/* @__PURE__ */
|
|
2967
|
+
/* @__PURE__ */ jsx11(WarningGlyph, { className: "h-4 w-4 shrink-0" }),
|
|
2968
|
+
/* @__PURE__ */ jsx11("span", { className: "line-clamp-2 text-xs leading-tight", children: "Attachment unavailable" })
|
|
2903
2969
|
]
|
|
2904
2970
|
}
|
|
2905
2971
|
);
|
|
@@ -2910,7 +2976,7 @@ function AttachmentUnavailable({ shape }) {
|
|
|
2910
2976
|
"aria-disabled": "true",
|
|
2911
2977
|
className: "inline-flex items-center gap-1 rounded-md border border-border bg-muted px-2 py-0.5 text-xs text-muted-foreground",
|
|
2912
2978
|
children: [
|
|
2913
|
-
/* @__PURE__ */
|
|
2979
|
+
/* @__PURE__ */ jsx11(WarningGlyph, { className: "h-3 w-3 shrink-0" }),
|
|
2914
2980
|
"Attachment unavailable"
|
|
2915
2981
|
]
|
|
2916
2982
|
}
|
|
@@ -2937,22 +3003,22 @@ function AttachmentThumbnail({ part, resolveFileUrl, fetchFile }) {
|
|
|
2937
3003
|
window.open(objectUrl, "_blank", "noopener");
|
|
2938
3004
|
}, [objectUrl]);
|
|
2939
3005
|
if (!displayName) {
|
|
2940
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ jsx11(AttachmentUnavailable, { shape: "thumbnail" });
|
|
2941
3007
|
}
|
|
2942
3008
|
if (!result) {
|
|
2943
|
-
return /* @__PURE__ */
|
|
3009
|
+
return /* @__PURE__ */ jsx11("span", { "aria-hidden": "true", className: "inline-block h-16 w-16 shrink-0 animate-pulse rounded-md bg-muted" });
|
|
2944
3010
|
}
|
|
2945
3011
|
if (!result.ok || !objectUrl) {
|
|
2946
|
-
return /* @__PURE__ */
|
|
3012
|
+
return /* @__PURE__ */ jsx11(AttachmentThumbnailError, { name: displayName });
|
|
2947
3013
|
}
|
|
2948
|
-
return /* @__PURE__ */
|
|
3014
|
+
return /* @__PURE__ */ jsx11(
|
|
2949
3015
|
"button",
|
|
2950
3016
|
{
|
|
2951
3017
|
type: "button",
|
|
2952
3018
|
onClick: handleClick,
|
|
2953
3019
|
"aria-label": `Open ${displayName}`,
|
|
2954
3020
|
className: "h-16 w-16 shrink-0 overflow-hidden rounded-md border border-border",
|
|
2955
|
-
children: /* @__PURE__ */
|
|
3021
|
+
children: /* @__PURE__ */ jsx11("img", { src: objectUrl, alt: displayName, className: "h-16 w-16 object-cover" })
|
|
2956
3022
|
}
|
|
2957
3023
|
);
|
|
2958
3024
|
}
|
|
@@ -2981,7 +3047,7 @@ function AttachmentChip({ part, resolveFileUrl, fetchFile }) {
|
|
|
2981
3047
|
});
|
|
2982
3048
|
}, [displayName, status, resolveFileUrl, part, fetchFile]);
|
|
2983
3049
|
if (!displayName) {
|
|
2984
|
-
return /* @__PURE__ */
|
|
3050
|
+
return /* @__PURE__ */ jsx11(AttachmentUnavailable, { shape: "chip" });
|
|
2985
3051
|
}
|
|
2986
3052
|
const Icon = status === "error" ? WarningGlyph : iconForMediaType(part.mediaType);
|
|
2987
3053
|
const className = [
|
|
@@ -2996,7 +3062,7 @@ function AttachmentChip({ part, resolveFileUrl, fetchFile }) {
|
|
|
2996
3062
|
title: status === "error" ? errorMessage ?? void 0 : void 0,
|
|
2997
3063
|
className,
|
|
2998
3064
|
children: [
|
|
2999
|
-
/* @__PURE__ */
|
|
3065
|
+
/* @__PURE__ */ jsx11(Icon, { className: "h-3 w-3 shrink-0" }),
|
|
3000
3066
|
displayName,
|
|
3001
3067
|
typeof part.size === "number" && /* @__PURE__ */ jsxs9("span", { className: "text-muted-foreground/70", children: [
|
|
3002
3068
|
"\xB7 ",
|
|
@@ -3008,13 +3074,13 @@ function AttachmentChip({ part, resolveFileUrl, fetchFile }) {
|
|
|
3008
3074
|
}
|
|
3009
3075
|
function MessageAttachments({ parts, resolveFileUrl, justify = "end", fetchFile }) {
|
|
3010
3076
|
if (parts.length === 0) return null;
|
|
3011
|
-
return /* @__PURE__ */
|
|
3012
|
-
(part) => part.type === "image" ? /* @__PURE__ */
|
|
3077
|
+
return /* @__PURE__ */ jsx11("div", { className: `flex flex-wrap gap-1.5 ${justify === "start" ? "justify-start" : "justify-end"}`, children: parts.map(
|
|
3078
|
+
(part) => part.type === "image" ? /* @__PURE__ */ jsx11(AttachmentThumbnail, { part, resolveFileUrl, fetchFile }, `${part.path}:${part.name}`) : /* @__PURE__ */ jsx11(AttachmentChip, { part, resolveFileUrl, fetchFile }, `${part.path}:${part.name}`)
|
|
3013
3079
|
) });
|
|
3014
3080
|
}
|
|
3015
3081
|
|
|
3016
3082
|
// src/web-react/smooth-text.ts
|
|
3017
|
-
import { useEffect as useEffect9, useRef as
|
|
3083
|
+
import { useEffect as useEffect9, useRef as useRef11, useState as useState15 } from "react";
|
|
3018
3084
|
function nextRevealCount(shown, targetLength, dtMs, opts = {}) {
|
|
3019
3085
|
if (shown >= targetLength) return targetLength;
|
|
3020
3086
|
const base = opts.baseCharsPerSecond ?? 90;
|
|
@@ -3026,8 +3092,8 @@ function nextRevealCount(shown, targetLength, dtMs, opts = {}) {
|
|
|
3026
3092
|
}
|
|
3027
3093
|
function useSmoothText(target, enabled, opts) {
|
|
3028
3094
|
const [, force] = useState15(0);
|
|
3029
|
-
const shownRef =
|
|
3030
|
-
const lastTargetRef =
|
|
3095
|
+
const shownRef = useRef11(0);
|
|
3096
|
+
const lastTargetRef = useRef11("");
|
|
3031
3097
|
if (!target.startsWith(lastTargetRef.current.slice(0, Math.floor(shownRef.current)))) {
|
|
3032
3098
|
shownRef.current = 0;
|
|
3033
3099
|
}
|
|
@@ -3056,7 +3122,7 @@ function useSmoothText(target, enabled, opts) {
|
|
|
3056
3122
|
// src/web-react/mission-activity.tsx
|
|
3057
3123
|
import { useCallback as useCallback7, useEffect as useEffect10, useState as useState16 } from "react";
|
|
3058
3124
|
import { FlowWaterfall } from "@tangle-network/charts/react";
|
|
3059
|
-
import { Fragment as Fragment2, jsx as
|
|
3125
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3060
3126
|
var LIVE_STATUSES = /* @__PURE__ */ new Set(["pending", "running"]);
|
|
3061
3127
|
var OK_STATUSES = /* @__PURE__ */ new Set(["completed", "done", "succeeded"]);
|
|
3062
3128
|
var ERROR_STATUSES = /* @__PURE__ */ new Set(["failed", "error", "cancelled", "aborted"]);
|
|
@@ -3087,15 +3153,15 @@ function mergeActivityPages(existing, incoming) {
|
|
|
3087
3153
|
return [...byTask.values()].sort((a, b) => Date.parse(b.startedAt) - Date.parse(a.startedAt));
|
|
3088
3154
|
}
|
|
3089
3155
|
function ChevronGlyph({ className }) {
|
|
3090
|
-
return /* @__PURE__ */
|
|
3156
|
+
return /* @__PURE__ */ jsx12("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx12("path", { d: "m6 9 6 6 6-6" }) });
|
|
3091
3157
|
}
|
|
3092
3158
|
function RefreshGlyph({ className }) {
|
|
3093
|
-
return /* @__PURE__ */
|
|
3159
|
+
return /* @__PURE__ */ jsx12("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx12("path", { d: "M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6" }) });
|
|
3094
3160
|
}
|
|
3095
3161
|
function CopyGlyph({ className }) {
|
|
3096
3162
|
return /* @__PURE__ */ jsxs10("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
3097
|
-
/* @__PURE__ */
|
|
3098
|
-
/* @__PURE__ */
|
|
3163
|
+
/* @__PURE__ */ jsx12("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
3164
|
+
/* @__PURE__ */ jsx12("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
3099
3165
|
] });
|
|
3100
3166
|
}
|
|
3101
3167
|
function TraceIdCopy({ traceId }) {
|
|
@@ -3119,28 +3185,28 @@ function TraceIdCopy({ traceId }) {
|
|
|
3119
3185
|
"aria-label": "Copy trace id",
|
|
3120
3186
|
className: "inline-flex min-w-0 items-center gap-1.5 rounded text-left font-mono text-muted-foreground transition hover:text-foreground",
|
|
3121
3187
|
children: [
|
|
3122
|
-
/* @__PURE__ */
|
|
3123
|
-
/* @__PURE__ */
|
|
3124
|
-
copied && /* @__PURE__ */
|
|
3188
|
+
/* @__PURE__ */ jsx12("span", { className: "truncate", children: traceId }),
|
|
3189
|
+
/* @__PURE__ */ jsx12(CopyGlyph, { className: "h-3 w-3 shrink-0" }),
|
|
3190
|
+
copied && /* @__PURE__ */ jsx12("span", { className: "shrink-0 not-italic text-success", children: "copied" })
|
|
3125
3191
|
]
|
|
3126
3192
|
}
|
|
3127
3193
|
);
|
|
3128
3194
|
}
|
|
3129
3195
|
function StatusDot({ tone }) {
|
|
3130
3196
|
return /* @__PURE__ */ jsxs10("span", { className: "inline-flex items-center", children: [
|
|
3131
|
-
/* @__PURE__ */
|
|
3197
|
+
/* @__PURE__ */ jsx12(
|
|
3132
3198
|
"span",
|
|
3133
3199
|
{
|
|
3134
3200
|
"aria-hidden": true,
|
|
3135
3201
|
className: `h-2 w-2 shrink-0 rounded-full ${tone === "live" ? "bg-warning" : tone === "ok" ? "bg-success" : tone === "error" ? "bg-destructive" : "bg-muted-foreground/40"}`
|
|
3136
3202
|
}
|
|
3137
3203
|
),
|
|
3138
|
-
/* @__PURE__ */
|
|
3204
|
+
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: tone })
|
|
3139
3205
|
] });
|
|
3140
3206
|
}
|
|
3141
3207
|
function RunLabel({ tool, detail, live }) {
|
|
3142
3208
|
return /* @__PURE__ */ jsxs10("span", { className: "min-w-0 flex-1 truncate", children: [
|
|
3143
|
-
/* @__PURE__ */
|
|
3209
|
+
/* @__PURE__ */ jsx12("span", { className: live ? "agent-shimmer font-medium" : "font-medium", "data-motion": live ? "essential" : void 0, children: tool }),
|
|
3144
3210
|
/* @__PURE__ */ jsxs10("span", { className: "text-muted-foreground", children: [
|
|
3145
3211
|
" \u2014 ",
|
|
3146
3212
|
detail
|
|
@@ -3153,13 +3219,13 @@ function LaneRow({ run, staggerIndex }) {
|
|
|
3153
3219
|
const cost = formatActivityCost(run.costUsd);
|
|
3154
3220
|
const duration = formatActivityDuration(run.durationMs);
|
|
3155
3221
|
return /* @__PURE__ */ jsxs10("div", { className: "agent-arrive flex items-center gap-2 py-1 text-xs", style: arrival, children: [
|
|
3156
|
-
/* @__PURE__ */
|
|
3157
|
-
/* @__PURE__ */
|
|
3158
|
-
tone === "live" && (run.iteration !== void 0 || run.phase !== void 0) && /* @__PURE__ */
|
|
3222
|
+
/* @__PURE__ */ jsx12(StatusDot, { tone }),
|
|
3223
|
+
/* @__PURE__ */ jsx12(RunLabel, { tool: run.tool, detail: run.detail, live: tone === "live" }),
|
|
3224
|
+
tone === "live" && (run.iteration !== void 0 || run.phase !== void 0) && /* @__PURE__ */ jsx12("span", { className: "shrink-0 rounded-full bg-warning/10 px-1.5 py-0.5 font-mono text-xs text-warning", children: [run.iteration !== void 0 ? `iter ${run.iteration}` : null, run.phase ?? null].filter(Boolean).join(" \xB7 ") }),
|
|
3159
3225
|
/* @__PURE__ */ jsxs10("span", { className: "flex shrink-0 items-center gap-1.5 font-mono text-xs tabular-nums text-muted-foreground/70", children: [
|
|
3160
|
-
tone !== "live" && tone !== "ok" && /* @__PURE__ */
|
|
3161
|
-
cost && /* @__PURE__ */
|
|
3162
|
-
duration && /* @__PURE__ */
|
|
3226
|
+
tone !== "live" && tone !== "ok" && /* @__PURE__ */ jsx12("span", { children: run.status }),
|
|
3227
|
+
cost && /* @__PURE__ */ jsx12("span", { children: cost }),
|
|
3228
|
+
duration && /* @__PURE__ */ jsx12("span", { children: duration })
|
|
3163
3229
|
] })
|
|
3164
3230
|
] });
|
|
3165
3231
|
}
|
|
@@ -3167,7 +3233,7 @@ function MissionActivityLane({ activity, startedAt, nowMs }) {
|
|
|
3167
3233
|
const [expanded, setExpanded] = useState16(false);
|
|
3168
3234
|
if (activity.length === 0) return null;
|
|
3169
3235
|
return /* @__PURE__ */ jsxs10("div", { className: "mt-1 border-l border-border pl-3", children: [
|
|
3170
|
-
activity.map((run, index) => /* @__PURE__ */
|
|
3236
|
+
activity.map((run, index) => /* @__PURE__ */ jsx12(LaneRow, { run, staggerIndex: index }, run.taskId)),
|
|
3171
3237
|
/* @__PURE__ */ jsxs10(
|
|
3172
3238
|
"button",
|
|
3173
3239
|
{
|
|
@@ -3175,12 +3241,12 @@ function MissionActivityLane({ activity, startedAt, nowMs }) {
|
|
|
3175
3241
|
onClick: () => setExpanded((v) => !v),
|
|
3176
3242
|
className: "flex items-center gap-1 py-0.5 text-xs font-medium text-muted-foreground/70 transition hover:text-foreground",
|
|
3177
3243
|
children: [
|
|
3178
|
-
/* @__PURE__ */
|
|
3244
|
+
/* @__PURE__ */ jsx12(ChevronGlyph, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` }),
|
|
3179
3245
|
"timeline"
|
|
3180
3246
|
]
|
|
3181
3247
|
}
|
|
3182
3248
|
),
|
|
3183
|
-
expanded && /* @__PURE__ */
|
|
3249
|
+
expanded && /* @__PURE__ */ jsx12("div", { className: "rounded-md border border-border bg-secondary p-2", children: /* @__PURE__ */ jsx12(
|
|
3184
3250
|
FlowWaterfall,
|
|
3185
3251
|
{
|
|
3186
3252
|
trace: stepActivityFlowTrace(activity, {
|
|
@@ -3203,33 +3269,33 @@ function ActivityRow({
|
|
|
3203
3269
|
const duration = formatActivityDuration(record2.durationMs);
|
|
3204
3270
|
return /* @__PURE__ */ jsxs10("div", { className: "agent-arrive rounded-lg border border-card-edge bg-card", style: arrival, children: [
|
|
3205
3271
|
/* @__PURE__ */ jsxs10("button", { type: "button", onClick: () => setOpen((v) => !v), className: "flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm", children: [
|
|
3206
|
-
/* @__PURE__ */
|
|
3207
|
-
/* @__PURE__ */
|
|
3208
|
-
tone === "live" && (record2.iteration !== void 0 || record2.phase !== void 0) && /* @__PURE__ */
|
|
3209
|
-
/* @__PURE__ */
|
|
3272
|
+
/* @__PURE__ */ jsx12(StatusDot, { tone }),
|
|
3273
|
+
/* @__PURE__ */ jsx12(RunLabel, { tool: record2.tool, detail: record2.detail, live: tone === "live" }),
|
|
3274
|
+
tone === "live" && (record2.iteration !== void 0 || record2.phase !== void 0) && /* @__PURE__ */ jsx12("span", { className: "shrink-0 rounded-full bg-warning/10 px-2 py-0.5 font-mono text-xs text-warning", children: [record2.iteration !== void 0 ? `iter ${record2.iteration}` : null, record2.phase ?? null].filter(Boolean).join(" \xB7 ") }),
|
|
3275
|
+
/* @__PURE__ */ jsx12(
|
|
3210
3276
|
"span",
|
|
3211
3277
|
{
|
|
3212
3278
|
className: `shrink-0 rounded-full px-2 py-0.5 text-xs font-medium ${tone === "ok" ? "bg-success/10 text-success" : tone === "error" ? "bg-destructive/10 text-destructive" : tone === "live" ? "bg-warning/10 text-warning" : "bg-secondary text-muted-foreground"}`,
|
|
3213
3279
|
children: record2.status
|
|
3214
3280
|
}
|
|
3215
3281
|
),
|
|
3216
|
-
cost && /* @__PURE__ */
|
|
3217
|
-
/* @__PURE__ */
|
|
3282
|
+
cost && /* @__PURE__ */ jsx12("span", { className: "shrink-0 font-mono text-xs tabular-nums text-muted-foreground", children: cost }),
|
|
3283
|
+
/* @__PURE__ */ jsx12(ChevronGlyph, { className: `h-3 w-3 shrink-0 text-muted-foreground transition-transform ${open ? "rotate-180" : ""}` })
|
|
3218
3284
|
] }),
|
|
3219
3285
|
open && /* @__PURE__ */ jsxs10("div", { className: "space-y-2.5 border-t border-border px-3 py-2.5", children: [
|
|
3220
|
-
record2.durationMs !== void 0 && /* @__PURE__ */
|
|
3286
|
+
record2.durationMs !== void 0 && /* @__PURE__ */ jsx12("div", { className: "rounded-md border border-border bg-secondary p-2", children: /* @__PURE__ */ jsx12(FlowWaterfall, { trace: stepActivityFlowTrace([record2]) }) }),
|
|
3221
3287
|
/* @__PURE__ */ jsxs10("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-xs", children: [
|
|
3222
|
-
/* @__PURE__ */
|
|
3223
|
-
/* @__PURE__ */
|
|
3224
|
-
/* @__PURE__ */
|
|
3225
|
-
/* @__PURE__ */
|
|
3288
|
+
/* @__PURE__ */ jsx12("dt", { className: "text-muted-foreground/60", children: "task" }),
|
|
3289
|
+
/* @__PURE__ */ jsx12("dd", { className: "truncate text-muted-foreground", children: record2.taskId }),
|
|
3290
|
+
/* @__PURE__ */ jsx12("dt", { className: "text-muted-foreground/60", children: "started" }),
|
|
3291
|
+
/* @__PURE__ */ jsx12("dd", { className: "text-muted-foreground", children: new Date(record2.startedAt).toLocaleString() }),
|
|
3226
3292
|
duration && /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
3227
|
-
/* @__PURE__ */
|
|
3228
|
-
/* @__PURE__ */
|
|
3293
|
+
/* @__PURE__ */ jsx12("dt", { className: "text-muted-foreground/60", children: "duration" }),
|
|
3294
|
+
/* @__PURE__ */ jsx12("dd", { className: "text-muted-foreground", children: duration })
|
|
3229
3295
|
] }),
|
|
3230
3296
|
record2.traceId && /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
3231
|
-
/* @__PURE__ */
|
|
3232
|
-
/* @__PURE__ */
|
|
3297
|
+
/* @__PURE__ */ jsx12("dt", { className: "text-muted-foreground/60", children: "trace" }),
|
|
3298
|
+
/* @__PURE__ */ jsx12("dd", { className: "min-w-0", children: /* @__PURE__ */ jsx12(TraceIdCopy, { traceId: record2.traceId }) })
|
|
3233
3299
|
] })
|
|
3234
3300
|
] }),
|
|
3235
3301
|
record2.missionRef && renderMissionRef?.(record2.missionRef, record2)
|
|
@@ -3263,8 +3329,8 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
|
|
|
3263
3329
|
const loading = status === "loading";
|
|
3264
3330
|
return /* @__PURE__ */ jsxs10("div", { className: "space-y-2", children: [
|
|
3265
3331
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
3266
|
-
/* @__PURE__ */
|
|
3267
|
-
/* @__PURE__ */
|
|
3332
|
+
/* @__PURE__ */ jsx12("h2", { className: "flex-1 text-sm font-semibold", children: title }),
|
|
3333
|
+
/* @__PURE__ */ jsx12(
|
|
3268
3334
|
"button",
|
|
3269
3335
|
{
|
|
3270
3336
|
type: "button",
|
|
@@ -3272,15 +3338,15 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
|
|
|
3272
3338
|
disabled: loading,
|
|
3273
3339
|
"aria-label": "Refresh",
|
|
3274
3340
|
className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground disabled:opacity-50",
|
|
3275
|
-
children: /* @__PURE__ */
|
|
3341
|
+
children: /* @__PURE__ */ jsx12(RefreshGlyph, { className: `h-3.5 w-3.5 ${loading ? "animate-spin" : ""}` })
|
|
3276
3342
|
}
|
|
3277
3343
|
)
|
|
3278
3344
|
] }),
|
|
3279
|
-
status === "error" && /* @__PURE__ */
|
|
3280
|
-
status === "ready" && rows.length === 0 && /* @__PURE__ */
|
|
3281
|
-
/* @__PURE__ */
|
|
3282
|
-
/* @__PURE__ */
|
|
3283
|
-
cursor && /* @__PURE__ */
|
|
3345
|
+
status === "error" && /* @__PURE__ */ jsx12("p", { role: "alert", className: "rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive", children: error }),
|
|
3346
|
+
status === "ready" && rows.length === 0 && /* @__PURE__ */ jsx12("p", { className: "px-1 text-sm text-muted-foreground", children: emptyLabel }),
|
|
3347
|
+
/* @__PURE__ */ jsx12("span", { role: "status", "aria-live": "polite", "aria-busy": loading, className: "sr-only", children: loading ? "Loading activity\u2026" : "" }),
|
|
3348
|
+
/* @__PURE__ */ jsx12("div", { className: "space-y-1.5", "aria-busy": loading, children: rows.map((record2, index) => /* @__PURE__ */ jsx12(ActivityRow, { record: record2, renderMissionRef, staggerIndex: index }, record2.taskId)) }),
|
|
3349
|
+
cursor && /* @__PURE__ */ jsx12(
|
|
3284
3350
|
"button",
|
|
3285
3351
|
{
|
|
3286
3352
|
type: "button",
|
|
@@ -3294,7 +3360,7 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
|
|
|
3294
3360
|
}
|
|
3295
3361
|
|
|
3296
3362
|
// src/web-react/provenance.tsx
|
|
3297
|
-
import { useCallback as useCallback8, useEffect as useEffect11, useId, useRef as
|
|
3363
|
+
import { useCallback as useCallback8, useEffect as useEffect11, useId, useRef as useRef12, useState as useState17 } from "react";
|
|
3298
3364
|
|
|
3299
3365
|
// src/web-react/provenance-model.ts
|
|
3300
3366
|
var PROVENANCE_BASES = ["extracted", "entered", "computed", "asserted"];
|
|
@@ -3454,7 +3520,7 @@ function provenanceTriggerLabel(record2, standing) {
|
|
|
3454
3520
|
}
|
|
3455
3521
|
|
|
3456
3522
|
// src/web-react/provenance.tsx
|
|
3457
|
-
import { jsx as
|
|
3523
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3458
3524
|
var BASIS_TONES = {
|
|
3459
3525
|
extracted: "border-primary/30 bg-primary/10 text-primary",
|
|
3460
3526
|
entered: "border-success/30 bg-success/10 text-success",
|
|
@@ -3480,26 +3546,26 @@ function BasisGlyph({ basis, className }) {
|
|
|
3480
3546
|
switch (basis) {
|
|
3481
3547
|
case "extracted":
|
|
3482
3548
|
return /* @__PURE__ */ jsxs11("svg", { ...shared, children: [
|
|
3483
|
-
/* @__PURE__ */
|
|
3484
|
-
/* @__PURE__ */
|
|
3485
|
-
/* @__PURE__ */
|
|
3549
|
+
/* @__PURE__ */ jsx13("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
|
|
3550
|
+
/* @__PURE__ */ jsx13("polyline", { points: "14 3 14 8 19 8" }),
|
|
3551
|
+
/* @__PURE__ */ jsx13("line", { x1: "9", y1: "13", x2: "15", y2: "13" })
|
|
3486
3552
|
] });
|
|
3487
3553
|
case "entered":
|
|
3488
3554
|
return /* @__PURE__ */ jsxs11("svg", { ...shared, children: [
|
|
3489
|
-
/* @__PURE__ */
|
|
3490
|
-
/* @__PURE__ */
|
|
3555
|
+
/* @__PURE__ */ jsx13("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
3556
|
+
/* @__PURE__ */ jsx13("circle", { cx: "12", cy: "7", r: "4" })
|
|
3491
3557
|
] });
|
|
3492
3558
|
case "computed":
|
|
3493
3559
|
return /* @__PURE__ */ jsxs11("svg", { ...shared, children: [
|
|
3494
|
-
/* @__PURE__ */
|
|
3495
|
-
/* @__PURE__ */
|
|
3496
|
-
/* @__PURE__ */
|
|
3497
|
-
/* @__PURE__ */
|
|
3560
|
+
/* @__PURE__ */ jsx13("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
3561
|
+
/* @__PURE__ */ jsx13("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
3562
|
+
/* @__PURE__ */ jsx13("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
|
|
3563
|
+
/* @__PURE__ */ jsx13("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
|
|
3498
3564
|
] });
|
|
3499
3565
|
case "asserted":
|
|
3500
3566
|
return /* @__PURE__ */ jsxs11("svg", { ...shared, children: [
|
|
3501
|
-
/* @__PURE__ */
|
|
3502
|
-
/* @__PURE__ */
|
|
3567
|
+
/* @__PURE__ */ jsx13("path", { d: "M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1" }),
|
|
3568
|
+
/* @__PURE__ */ jsx13("circle", { cx: "12", cy: "12", r: "3.2" })
|
|
3503
3569
|
] });
|
|
3504
3570
|
}
|
|
3505
3571
|
}
|
|
@@ -3521,8 +3587,8 @@ function SourceRow({
|
|
|
3521
3587
|
const openable = status === "ready" && (onOpenSource !== void 0 || source.href !== void 0);
|
|
3522
3588
|
return /* @__PURE__ */ jsxs11("li", { className: "rounded-md border border-card-edge bg-card px-2.5 py-2", children: [
|
|
3523
3589
|
/* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
|
|
3524
|
-
/* @__PURE__ */
|
|
3525
|
-
source.locator && /* @__PURE__ */
|
|
3590
|
+
/* @__PURE__ */ jsx13("span", { className: "text-sm font-medium text-foreground", children: source.label }),
|
|
3591
|
+
source.locator && /* @__PURE__ */ jsx13("span", { className: "text-xs text-muted-foreground", children: source.locator }),
|
|
3526
3592
|
openable && (onOpenSource ? /* @__PURE__ */ jsxs11(
|
|
3527
3593
|
"button",
|
|
3528
3594
|
{
|
|
@@ -3564,7 +3630,7 @@ function SourceRow({
|
|
|
3564
3630
|
className: `mt-1 text-xs ${status === "unavailable" ? "text-destructive" : "text-muted-foreground"}`,
|
|
3565
3631
|
children: [
|
|
3566
3632
|
statusLine,
|
|
3567
|
-
status === "unavailable" && onRetrySource && /* @__PURE__ */
|
|
3633
|
+
status === "unavailable" && onRetrySource && /* @__PURE__ */ jsx13(
|
|
3568
3634
|
"button",
|
|
3569
3635
|
{
|
|
3570
3636
|
type: "button",
|
|
@@ -3589,8 +3655,8 @@ function ProvenanceValue({
|
|
|
3589
3655
|
className
|
|
3590
3656
|
}) {
|
|
3591
3657
|
const [open, setOpen] = useState17(defaultOpen);
|
|
3592
|
-
const triggerRef =
|
|
3593
|
-
const rootRef =
|
|
3658
|
+
const triggerRef = useRef12(null);
|
|
3659
|
+
const rootRef = useRef12(null);
|
|
3594
3660
|
const panelId = useId();
|
|
3595
3661
|
const standing = rollUpProvenanceStanding(record2, confidencePolicy);
|
|
3596
3662
|
const basisMeta = provenanceBasisMeta(record2.basis);
|
|
@@ -3632,8 +3698,8 @@ function ProvenanceValue({
|
|
|
3632
3698
|
};
|
|
3633
3699
|
}, [open]);
|
|
3634
3700
|
const summary = /* @__PURE__ */ jsxs11("span", { className: "inline-flex flex-wrap items-baseline gap-x-1.5", children: [
|
|
3635
|
-
record2.label && /* @__PURE__ */
|
|
3636
|
-
/* @__PURE__ */
|
|
3701
|
+
record2.label && /* @__PURE__ */ jsx13("span", { className: "text-xs text-muted-foreground", children: record2.label }),
|
|
3702
|
+
/* @__PURE__ */ jsx13("span", { className: hasValue ? "text-sm text-foreground" : "text-sm italic text-muted-foreground", children: hasValue ? record2.display : missingValueLabel })
|
|
3637
3703
|
] });
|
|
3638
3704
|
if (maxDepth <= 0) {
|
|
3639
3705
|
return /* @__PURE__ */ jsxs11(
|
|
@@ -3649,12 +3715,12 @@ function ProvenanceValue({
|
|
|
3649
3715
|
{
|
|
3650
3716
|
className: `ml-1.5 inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-xs font-medium ${BASIS_TONES[record2.basis]}`,
|
|
3651
3717
|
children: [
|
|
3652
|
-
/* @__PURE__ */
|
|
3718
|
+
/* @__PURE__ */ jsx13(BasisGlyph, { basis: record2.basis, className: "h-3 w-3" }),
|
|
3653
3719
|
basisMeta.label
|
|
3654
3720
|
]
|
|
3655
3721
|
}
|
|
3656
3722
|
),
|
|
3657
|
-
/* @__PURE__ */
|
|
3723
|
+
/* @__PURE__ */ jsx13("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: describeProvenance(record2) })
|
|
3658
3724
|
]
|
|
3659
3725
|
}
|
|
3660
3726
|
);
|
|
@@ -3681,15 +3747,15 @@ function ProvenanceValue({
|
|
|
3681
3747
|
"aria-label": provenanceTriggerLabel(record2, standing),
|
|
3682
3748
|
className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-xs font-medium transition hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ${BASIS_TONES[record2.basis]}`,
|
|
3683
3749
|
children: [
|
|
3684
|
-
/* @__PURE__ */
|
|
3685
|
-
/* @__PURE__ */
|
|
3750
|
+
/* @__PURE__ */ jsx13(BasisGlyph, { basis: record2.basis, className: "h-3 w-3" }),
|
|
3751
|
+
/* @__PURE__ */ jsx13("span", { "aria-hidden": true, children: basisMeta.label })
|
|
3686
3752
|
]
|
|
3687
3753
|
}
|
|
3688
3754
|
),
|
|
3689
3755
|
standing !== "settled" && // Legible at rest: what to do about the value does not wait for
|
|
3690
3756
|
// someone to open the panel. `aria-hidden` because the trigger's
|
|
3691
3757
|
// accessible name already carries it — this is the visual half.
|
|
3692
|
-
/* @__PURE__ */
|
|
3758
|
+
/* @__PURE__ */ jsx13("span", { "aria-hidden": true, className: `text-xs font-medium ${STANDING_TONES[standing]}`, children: standingMeta.label })
|
|
3693
3759
|
] }),
|
|
3694
3760
|
open && /* @__PURE__ */ jsxs11(
|
|
3695
3761
|
"div",
|
|
@@ -3700,7 +3766,7 @@ function ProvenanceValue({
|
|
|
3700
3766
|
className: "mt-1.5 w-full min-w-0 space-y-2 rounded-lg border border-border bg-card px-3 py-2.5 text-left",
|
|
3701
3767
|
children: [
|
|
3702
3768
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
3703
|
-
/* @__PURE__ */
|
|
3769
|
+
/* @__PURE__ */ jsx13("p", { className: "text-[12px] leading-snug text-foreground", children: describeProvenance(record2) }),
|
|
3704
3770
|
/* @__PURE__ */ jsxs11("p", { className: `mt-0.5 text-xs leading-snug ${STANDING_TONES[standing]}`, children: [
|
|
3705
3771
|
standingMeta.label,
|
|
3706
3772
|
" \u2014 ",
|
|
@@ -3711,7 +3777,7 @@ function ProvenanceValue({
|
|
|
3711
3777
|
" There is nothing outside the model to check it against."
|
|
3712
3778
|
] })
|
|
3713
3779
|
] }),
|
|
3714
|
-
sources.length > 0 && /* @__PURE__ */
|
|
3780
|
+
sources.length > 0 && /* @__PURE__ */ jsx13("ul", { className: "space-y-1.5", children: sources.map((source, index) => /* @__PURE__ */ jsx13(
|
|
3715
3781
|
SourceRow,
|
|
3716
3782
|
{
|
|
3717
3783
|
source,
|
|
@@ -3724,12 +3790,12 @@ function ProvenanceValue({
|
|
|
3724
3790
|
gaps.filter((gap) => gap.kind !== "unavailable-source").map((gap) => (
|
|
3725
3791
|
// An unavailable source already states itself on its own row; a
|
|
3726
3792
|
// structural gap has no row to state it, so it gets one here.
|
|
3727
|
-
/* @__PURE__ */
|
|
3793
|
+
/* @__PURE__ */ jsx13("p", { className: "rounded-md bg-destructive/10 px-2 py-1.5 text-xs leading-snug text-destructive", children: gap.message }, gap.kind)
|
|
3728
3794
|
)),
|
|
3729
|
-
loading.length > 0 && sources.length === 0 && /* @__PURE__ */
|
|
3795
|
+
loading.length > 0 && sources.length === 0 && /* @__PURE__ */ jsx13("p", { role: "status", className: "text-xs text-muted-foreground", children: "Looking up where this came from\u2026" }),
|
|
3730
3796
|
inputs.length > 0 && /* @__PURE__ */ jsxs11("div", { className: "border-t border-border pt-2", children: [
|
|
3731
|
-
/* @__PURE__ */
|
|
3732
|
-
/* @__PURE__ */
|
|
3797
|
+
/* @__PURE__ */ jsx13("p", { className: "text-xs font-medium uppercase tracking-[0.05em] text-muted-foreground", children: record2.derivation ? `Computed from ${record2.derivation}` : "Computed from" }),
|
|
3798
|
+
/* @__PURE__ */ jsx13("ul", { className: "mt-1.5 space-y-1.5", children: inputs.map((input, index) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsx13(
|
|
3733
3799
|
ProvenanceValue,
|
|
3734
3800
|
{
|
|
3735
3801
|
record: input,
|
|
@@ -3750,7 +3816,7 @@ function ProvenanceValue({
|
|
|
3750
3816
|
}
|
|
3751
3817
|
function ProvenanceLegend({ bases, className }) {
|
|
3752
3818
|
if (bases.length === 0) return null;
|
|
3753
|
-
return /* @__PURE__ */
|
|
3819
|
+
return /* @__PURE__ */ jsx13("ul", { className: `flex flex-wrap items-center gap-x-3 gap-y-1.5 ${className ?? ""}`, children: bases.map((basis) => {
|
|
3754
3820
|
const meta = provenanceBasisMeta(basis);
|
|
3755
3821
|
return /* @__PURE__ */ jsxs11("li", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
3756
3822
|
/* @__PURE__ */ jsxs11(
|
|
@@ -3758,18 +3824,18 @@ function ProvenanceLegend({ bases, className }) {
|
|
|
3758
3824
|
{
|
|
3759
3825
|
className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-xs font-medium ${BASIS_TONES[basis]}`,
|
|
3760
3826
|
children: [
|
|
3761
|
-
/* @__PURE__ */
|
|
3827
|
+
/* @__PURE__ */ jsx13(BasisGlyph, { basis, className: "h-3 w-3" }),
|
|
3762
3828
|
meta.label
|
|
3763
3829
|
]
|
|
3764
3830
|
}
|
|
3765
3831
|
),
|
|
3766
|
-
/* @__PURE__ */
|
|
3832
|
+
/* @__PURE__ */ jsx13("span", { children: meta.meaning })
|
|
3767
3833
|
] }, basis);
|
|
3768
3834
|
}) });
|
|
3769
3835
|
}
|
|
3770
3836
|
|
|
3771
3837
|
// src/web-react/seat-paywall.tsx
|
|
3772
|
-
import { Fragment as Fragment3, jsx as
|
|
3838
|
+
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3773
3839
|
function usd(cents) {
|
|
3774
3840
|
return new Intl.NumberFormat("en-US", {
|
|
3775
3841
|
style: "currency",
|
|
@@ -3779,7 +3845,7 @@ function usd(cents) {
|
|
|
3779
3845
|
}).format(cents / 100);
|
|
3780
3846
|
}
|
|
3781
3847
|
function CheckGlyph3() {
|
|
3782
|
-
return /* @__PURE__ */
|
|
3848
|
+
return /* @__PURE__ */ jsx14(
|
|
3783
3849
|
"svg",
|
|
3784
3850
|
{
|
|
3785
3851
|
className: "h-4 w-4 shrink-0 text-primary",
|
|
@@ -3790,14 +3856,14 @@ function CheckGlyph3() {
|
|
|
3790
3856
|
strokeLinecap: "round",
|
|
3791
3857
|
strokeLinejoin: "round",
|
|
3792
3858
|
"aria-hidden": true,
|
|
3793
|
-
children: /* @__PURE__ */
|
|
3859
|
+
children: /* @__PURE__ */ jsx14("path", { d: "M20 6 9 17l-5-5" })
|
|
3794
3860
|
}
|
|
3795
3861
|
);
|
|
3796
3862
|
}
|
|
3797
3863
|
function Benefit({ children }) {
|
|
3798
3864
|
return /* @__PURE__ */ jsxs12("li", { className: "flex items-start gap-2.5 text-sm text-foreground", children: [
|
|
3799
|
-
/* @__PURE__ */
|
|
3800
|
-
/* @__PURE__ */
|
|
3865
|
+
/* @__PURE__ */ jsx14("span", { className: "mt-0.5", children: /* @__PURE__ */ jsx14(CheckGlyph3, {}) }),
|
|
3866
|
+
/* @__PURE__ */ jsx14("span", { children })
|
|
3801
3867
|
] });
|
|
3802
3868
|
}
|
|
3803
3869
|
function SeatPaywall({
|
|
@@ -3815,17 +3881,17 @@ function SeatPaywall({
|
|
|
3815
3881
|
const recurringPrice = offer ? usd(offer.recurring.priceCents) : `$${priceUsd}`;
|
|
3816
3882
|
const recurringUsage = offer ? usd(offer.recurring.includedCreditsCents) : `$${includedUsageUsd}`;
|
|
3817
3883
|
const introductory = offer?.introductory ?? null;
|
|
3818
|
-
return /* @__PURE__ */
|
|
3819
|
-
/* @__PURE__ */
|
|
3884
|
+
return /* @__PURE__ */ jsx14("div", { className: "flex min-h-[60vh] w-full items-center justify-center p-6", children: /* @__PURE__ */ jsxs12("div", { className: "w-full max-w-md rounded-2xl border border-card-edge bg-card p-8", children: [
|
|
3885
|
+
/* @__PURE__ */ jsx14("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: product }),
|
|
3820
3886
|
/* @__PURE__ */ jsxs12("h1", { className: "mt-2 text-2xl font-semibold tracking-tight text-foreground", children: [
|
|
3821
3887
|
"Unlock ",
|
|
3822
3888
|
product
|
|
3823
3889
|
] }),
|
|
3824
|
-
tagline && /* @__PURE__ */
|
|
3890
|
+
tagline && /* @__PURE__ */ jsx14("p", { className: "mt-2 text-sm text-muted-foreground", children: tagline }),
|
|
3825
3891
|
introductory ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
3826
3892
|
/* @__PURE__ */ jsxs12("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
|
|
3827
|
-
/* @__PURE__ */
|
|
3828
|
-
/* @__PURE__ */
|
|
3893
|
+
/* @__PURE__ */ jsx14("span", { className: "text-3xl font-semibold text-foreground", children: usd(introductory.priceCents) }),
|
|
3894
|
+
/* @__PURE__ */ jsx14("span", { className: "text-sm text-muted-foreground", children: "first month" })
|
|
3829
3895
|
] }),
|
|
3830
3896
|
/* @__PURE__ */ jsxs12("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
3831
3897
|
"Includes ",
|
|
@@ -3841,8 +3907,8 @@ function SeatPaywall({
|
|
|
3841
3907
|
] })
|
|
3842
3908
|
] }) : /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
3843
3909
|
/* @__PURE__ */ jsxs12("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
|
|
3844
|
-
/* @__PURE__ */
|
|
3845
|
-
/* @__PURE__ */
|
|
3910
|
+
/* @__PURE__ */ jsx14("span", { className: "text-3xl font-semibold text-foreground", children: recurringPrice }),
|
|
3911
|
+
/* @__PURE__ */ jsx14("span", { className: "text-sm text-muted-foreground", children: "/mo" })
|
|
3846
3912
|
] }),
|
|
3847
3913
|
/* @__PURE__ */ jsxs12("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
3848
3914
|
"Includes ",
|
|
@@ -3850,10 +3916,10 @@ function SeatPaywall({
|
|
|
3850
3916
|
"/mo of AI usage"
|
|
3851
3917
|
] })
|
|
3852
3918
|
] }),
|
|
3853
|
-
/* @__PURE__ */
|
|
3919
|
+
/* @__PURE__ */ jsx14("ul", { className: "mt-6 space-y-2.5", children: (benefits ?? [
|
|
3854
3920
|
`Full access to ${product}`
|
|
3855
|
-
]).map((benefit, i) => /* @__PURE__ */
|
|
3856
|
-
/* @__PURE__ */
|
|
3921
|
+
]).map((benefit, i) => /* @__PURE__ */ jsx14(Benefit, { children: benefit }, i)) }),
|
|
3922
|
+
/* @__PURE__ */ jsx14(
|
|
3857
3923
|
"button",
|
|
3858
3924
|
{
|
|
3859
3925
|
type: "button",
|
|
@@ -3863,12 +3929,12 @@ function SeatPaywall({
|
|
|
3863
3929
|
children: pending ? "Opening checkout\u2026" : ctaLabel ?? "Continue to checkout"
|
|
3864
3930
|
}
|
|
3865
3931
|
),
|
|
3866
|
-
footnote && /* @__PURE__ */
|
|
3932
|
+
footnote && /* @__PURE__ */ jsx14("p", { className: "mt-3 text-center text-xs text-muted-foreground/70", children: footnote })
|
|
3867
3933
|
] }) });
|
|
3868
3934
|
}
|
|
3869
3935
|
|
|
3870
3936
|
// src/web-react/use-session-history.ts
|
|
3871
|
-
import { useCallback as useCallback9, useEffect as useEffect12, useMemo as useMemo6, useRef as
|
|
3937
|
+
import { useCallback as useCallback9, useEffect as useEffect12, useMemo as useMemo6, useRef as useRef13, useState as useState18 } from "react";
|
|
3872
3938
|
function seedSignature(page) {
|
|
3873
3939
|
return JSON.stringify({
|
|
3874
3940
|
nextCursor: page.nextCursor ?? null,
|
|
@@ -3893,16 +3959,16 @@ function useSessionHistory({
|
|
|
3893
3959
|
const [nextCursor, setNextCursor] = useState18(initialPage.nextCursor ?? null);
|
|
3894
3960
|
const [phase, setPhase] = useState18("idle");
|
|
3895
3961
|
const [reloadKey, setReloadKey] = useState18(0);
|
|
3896
|
-
const seqRef =
|
|
3897
|
-
const resetAbortRef =
|
|
3898
|
-
const loadMoreAbortRef =
|
|
3899
|
-
const loadingMoreRef =
|
|
3900
|
-
const lastOpRef =
|
|
3901
|
-
const nextCursorRef =
|
|
3962
|
+
const seqRef = useRef13(0);
|
|
3963
|
+
const resetAbortRef = useRef13(null);
|
|
3964
|
+
const loadMoreAbortRef = useRef13(null);
|
|
3965
|
+
const loadingMoreRef = useRef13(false);
|
|
3966
|
+
const lastOpRef = useRef13("first");
|
|
3967
|
+
const nextCursorRef = useRef13(nextCursor);
|
|
3902
3968
|
nextCursorRef.current = nextCursor;
|
|
3903
|
-
const viewRef =
|
|
3969
|
+
const viewRef = useRef13({ q, sort, fetchPage });
|
|
3904
3970
|
viewRef.current = { q, sort, fetchPage };
|
|
3905
|
-
const seedRef =
|
|
3971
|
+
const seedRef = useRef13(initialPage);
|
|
3906
3972
|
seedRef.current = initialPage;
|
|
3907
3973
|
const isDefaultView = q === "" && sort === defaultSort;
|
|
3908
3974
|
const seedKey = useMemo6(() => seedSignature(initialPage), [initialPage]);
|
|
@@ -3967,7 +4033,7 @@ function useSessionHistory({
|
|
|
3967
4033
|
// src/web-react/use-session-actions.tsx
|
|
3968
4034
|
import { useCallback as useCallback10, useState as useState19 } from "react";
|
|
3969
4035
|
import { Input } from "@tangle-network/ui/primitives";
|
|
3970
|
-
import { Fragment as Fragment4, jsx as
|
|
4036
|
+
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3971
4037
|
var DEFAULT_LABELS = {
|
|
3972
4038
|
renameTitle: "Rename session",
|
|
3973
4039
|
renameField: "Title",
|
|
@@ -4055,12 +4121,12 @@ function useSessionActions({
|
|
|
4055
4121
|
busy,
|
|
4056
4122
|
error,
|
|
4057
4123
|
footer: /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
4058
|
-
/* @__PURE__ */
|
|
4059
|
-
/* @__PURE__ */
|
|
4124
|
+
/* @__PURE__ */ jsx15(ActionDialogButton, { onClick: () => setRenameTarget(null), disabled: busy, variant: "ghost", children: text.cancel }),
|
|
4125
|
+
/* @__PURE__ */ jsx15(ActionDialogButton, { onClick: () => void submitRename(), disabled: busy || !renameValue.trim(), children: text.renameSubmit })
|
|
4060
4126
|
] }),
|
|
4061
4127
|
children: [
|
|
4062
|
-
/* @__PURE__ */
|
|
4063
|
-
/* @__PURE__ */
|
|
4128
|
+
/* @__PURE__ */ jsx15("label", { htmlFor: "agent-app-rename-session", className: "text-xs text-muted-foreground", children: text.renameField }),
|
|
4129
|
+
/* @__PURE__ */ jsx15(
|
|
4064
4130
|
Input,
|
|
4065
4131
|
{
|
|
4066
4132
|
id: "agent-app-rename-session",
|
|
@@ -4079,7 +4145,7 @@ function useSessionActions({
|
|
|
4079
4145
|
]
|
|
4080
4146
|
}
|
|
4081
4147
|
),
|
|
4082
|
-
deleteTarget && /* @__PURE__ */
|
|
4148
|
+
deleteTarget && /* @__PURE__ */ jsx15(
|
|
4083
4149
|
ActionDialog,
|
|
4084
4150
|
{
|
|
4085
4151
|
title: text.deleteTitle,
|
|
@@ -4087,10 +4153,10 @@ function useSessionActions({
|
|
|
4087
4153
|
busy,
|
|
4088
4154
|
error,
|
|
4089
4155
|
footer: /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
4090
|
-
/* @__PURE__ */
|
|
4091
|
-
/* @__PURE__ */
|
|
4156
|
+
/* @__PURE__ */ jsx15(ActionDialogButton, { onClick: () => setDeleteTarget(null), disabled: busy, variant: "ghost", children: text.cancel }),
|
|
4157
|
+
/* @__PURE__ */ jsx15(ActionDialogButton, { onClick: () => void confirmDelete(), disabled: busy, variant: "destructive", children: text.deleteSubmit })
|
|
4092
4158
|
] }),
|
|
4093
|
-
children: /* @__PURE__ */
|
|
4159
|
+
children: /* @__PURE__ */ jsx15("p", { className: "text-sm text-muted-foreground", children: text.deleteBody(sessionLabel(deleteTarget)) })
|
|
4094
4160
|
}
|
|
4095
4161
|
)
|
|
4096
4162
|
] });
|
|
@@ -4098,12 +4164,12 @@ function useSessionActions({
|
|
|
4098
4164
|
}
|
|
4099
4165
|
|
|
4100
4166
|
// src/web-react/session-history-panel.tsx
|
|
4101
|
-
import { useCallback as useCallback11, useEffect as useEffect13, useId as useId2, useRef as
|
|
4167
|
+
import { useCallback as useCallback11, useEffect as useEffect13, useId as useId2, useRef as useRef14, useState as useState20 } from "react";
|
|
4102
4168
|
import { Button as Button3, Checkbox, Input as Input2, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@tangle-network/ui/primitives";
|
|
4103
4169
|
import { ShellHeader } from "@tangle-network/sandbox-ui/workspace";
|
|
4104
|
-
import { Fragment as Fragment5, jsx as
|
|
4170
|
+
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4105
4171
|
function AnchorLink({ to, className, children }) {
|
|
4106
|
-
return /* @__PURE__ */
|
|
4172
|
+
return /* @__PURE__ */ jsx16("a", { href: to, className, children });
|
|
4107
4173
|
}
|
|
4108
4174
|
var MINUTE = 6e4;
|
|
4109
4175
|
var HOUR = 60 * MINUTE;
|
|
@@ -4121,16 +4187,16 @@ function formatSessionTimestamp(isoDate) {
|
|
|
4121
4187
|
}
|
|
4122
4188
|
function SkeletonRows() {
|
|
4123
4189
|
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
4124
|
-
/* @__PURE__ */
|
|
4125
|
-
/* @__PURE__ */
|
|
4126
|
-
/* @__PURE__ */
|
|
4127
|
-
/* @__PURE__ */
|
|
4128
|
-
/* @__PURE__ */
|
|
4190
|
+
/* @__PURE__ */ jsx16("span", { role: "status", "aria-live": "polite", "aria-busy": true, className: "sr-only", children: "Loading sessions\u2026" }),
|
|
4191
|
+
/* @__PURE__ */ jsx16("div", { className: "flex flex-col gap-0.5", "aria-hidden": true, children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-3 px-3 py-2.5", children: [
|
|
4192
|
+
/* @__PURE__ */ jsx16("div", { className: "h-4 w-4 animate-pulse rounded bg-muted" }),
|
|
4193
|
+
/* @__PURE__ */ jsx16("div", { className: "h-4 w-1/2 animate-pulse rounded bg-muted" }),
|
|
4194
|
+
/* @__PURE__ */ jsx16("div", { className: "ml-auto h-3 w-12 animate-pulse rounded bg-muted" })
|
|
4129
4195
|
] }, i)) })
|
|
4130
4196
|
] });
|
|
4131
4197
|
}
|
|
4132
4198
|
function MessageIcon({ className }) {
|
|
4133
|
-
return /* @__PURE__ */
|
|
4199
|
+
return /* @__PURE__ */ jsx16("svg", { viewBox: "0 0 24 24", className, fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx16("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
|
|
4134
4200
|
}
|
|
4135
4201
|
function useSessionHistoryPanelViewState({
|
|
4136
4202
|
history,
|
|
@@ -4158,7 +4224,7 @@ function useSessionHistoryPanelViewState({
|
|
|
4158
4224
|
contentWidth = "reading",
|
|
4159
4225
|
className
|
|
4160
4226
|
}) {
|
|
4161
|
-
const scrollRef =
|
|
4227
|
+
const scrollRef = useRef14(null);
|
|
4162
4228
|
const sentinelRef = useInfiniteScroll(history.loadMore, {
|
|
4163
4229
|
enabled: history.hasMore && !history.isLoadingMore && !history.isError,
|
|
4164
4230
|
root: scrollRef,
|
|
@@ -4266,7 +4332,7 @@ function useSessionHistoryPanelViewState({
|
|
|
4266
4332
|
}
|
|
4267
4333
|
function SessionHistoryPanel(props) {
|
|
4268
4334
|
const view = useSessionHistoryPanelViewState(props);
|
|
4269
|
-
return /* @__PURE__ */
|
|
4335
|
+
return /* @__PURE__ */ jsx16(SessionHistoryPanelView, { ...view });
|
|
4270
4336
|
}
|
|
4271
4337
|
function SessionHistoryPanelView({
|
|
4272
4338
|
className,
|
|
@@ -4314,15 +4380,15 @@ function SessionHistoryPanelView({
|
|
|
4314
4380
|
confirmBulkAction
|
|
4315
4381
|
}) {
|
|
4316
4382
|
return /* @__PURE__ */ jsxs14("div", { className: `flex min-h-0 min-w-0 flex-1 flex-col ${className ?? ""}`, children: [
|
|
4317
|
-
showHeader && /* @__PURE__ */
|
|
4318
|
-
/* @__PURE__ */
|
|
4383
|
+
showHeader && /* @__PURE__ */ jsx16(ShellHeader, { as: "header", className: "bg-transparent px-4 sm:px-6", children: /* @__PURE__ */ jsxs14("div", { className: `flex items-center gap-3 px-3 ${column}`, children: [
|
|
4384
|
+
/* @__PURE__ */ jsx16("h1", { className: "flex-1 truncate text-sm font-semibold text-foreground", children: title }),
|
|
4319
4385
|
newSessionHref && /* @__PURE__ */ jsxs14(
|
|
4320
4386
|
Link,
|
|
4321
4387
|
{
|
|
4322
4388
|
to: newSessionHref,
|
|
4323
4389
|
className: "inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground transition hover:opacity-90",
|
|
4324
4390
|
children: [
|
|
4325
|
-
/* @__PURE__ */
|
|
4391
|
+
/* @__PURE__ */ jsx16("span", { "aria-hidden": true, className: "text-sm leading-none", children: "+" }),
|
|
4326
4392
|
"New chat"
|
|
4327
4393
|
]
|
|
4328
4394
|
}
|
|
@@ -4331,7 +4397,7 @@ function SessionHistoryPanelView({
|
|
|
4331
4397
|
/* @__PURE__ */ jsxs14("div", { ref: scrollRef, className: "min-h-0 flex-1 overflow-y-auto", children: [
|
|
4332
4398
|
hasAnySessions && /* @__PURE__ */ jsxs14("div", { className: "sticky top-0 z-10 bg-background px-4 sm:px-6", children: [
|
|
4333
4399
|
/* @__PURE__ */ jsxs14("div", { className: `flex flex-col gap-2 px-3 pb-3 pt-4 sm:flex-row sm:items-center sm:gap-3 ${column}`, children: [
|
|
4334
|
-
/* @__PURE__ */
|
|
4400
|
+
/* @__PURE__ */ jsx16(
|
|
4335
4401
|
Input2,
|
|
4336
4402
|
{
|
|
4337
4403
|
type: "search",
|
|
@@ -4343,16 +4409,16 @@ function SessionHistoryPanelView({
|
|
|
4343
4409
|
}
|
|
4344
4410
|
),
|
|
4345
4411
|
/* @__PURE__ */ jsxs14(Select, { value: sort, onValueChange: (value) => onSortChange(value), children: [
|
|
4346
|
-
/* @__PURE__ */
|
|
4412
|
+
/* @__PURE__ */ jsx16(SelectTrigger, { "aria-label": "Sort sessions", className: "shrink-0 sm:w-[132px]", children: /* @__PURE__ */ jsx16(SelectValue, {}) }),
|
|
4347
4413
|
/* @__PURE__ */ jsxs14(SelectContent, { children: [
|
|
4348
|
-
/* @__PURE__ */
|
|
4349
|
-
/* @__PURE__ */
|
|
4414
|
+
/* @__PURE__ */ jsx16(SelectItem, { value: "newest", children: "Newest" }),
|
|
4415
|
+
/* @__PURE__ */ jsx16(SelectItem, { value: "oldest", children: "Oldest" })
|
|
4350
4416
|
] })
|
|
4351
4417
|
] })
|
|
4352
4418
|
] }),
|
|
4353
4419
|
onBulkAction && /* @__PURE__ */ jsxs14("div", { className: `flex flex-col gap-2 border-t border-border px-3 py-3 ${column}`, children: [
|
|
4354
4420
|
/* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
4355
|
-
/* @__PURE__ */
|
|
4421
|
+
/* @__PURE__ */ jsx16(
|
|
4356
4422
|
Button3,
|
|
4357
4423
|
{
|
|
4358
4424
|
type: "button",
|
|
@@ -4363,7 +4429,7 @@ function SessionHistoryPanelView({
|
|
|
4363
4429
|
children: "Select all"
|
|
4364
4430
|
}
|
|
4365
4431
|
),
|
|
4366
|
-
/* @__PURE__ */
|
|
4432
|
+
/* @__PURE__ */ jsx16(
|
|
4367
4433
|
Button3,
|
|
4368
4434
|
{
|
|
4369
4435
|
type: "button",
|
|
@@ -4389,8 +4455,8 @@ function SessionHistoryPanelView({
|
|
|
4389
4455
|
)
|
|
4390
4456
|
] }),
|
|
4391
4457
|
/* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
4392
|
-
/* @__PURE__ */
|
|
4393
|
-
/* @__PURE__ */
|
|
4458
|
+
/* @__PURE__ */ jsx16("label", { htmlFor: "agent-app-session-age", className: "text-xs text-muted-foreground", children: "Session age" }),
|
|
4459
|
+
/* @__PURE__ */ jsx16(
|
|
4394
4460
|
Input2,
|
|
4395
4461
|
{
|
|
4396
4462
|
id: "agent-app-session-age",
|
|
@@ -4404,7 +4470,7 @@ function SessionHistoryPanelView({
|
|
|
4404
4470
|
className: "w-20 tabular-nums"
|
|
4405
4471
|
}
|
|
4406
4472
|
),
|
|
4407
|
-
/* @__PURE__ */
|
|
4473
|
+
/* @__PURE__ */ jsx16("span", { className: "text-xs text-muted-foreground", children: "days" }),
|
|
4408
4474
|
/* @__PURE__ */ jsxs14(
|
|
4409
4475
|
Button3,
|
|
4410
4476
|
{
|
|
@@ -4436,15 +4502,15 @@ function SessionHistoryPanelView({
|
|
|
4436
4502
|
] })
|
|
4437
4503
|
] })
|
|
4438
4504
|
] }),
|
|
4439
|
-
/* @__PURE__ */
|
|
4440
|
-
/* @__PURE__ */
|
|
4441
|
-
/* @__PURE__ */
|
|
4442
|
-
] }) : history.isLoadingFirst ? /* @__PURE__ */
|
|
4505
|
+
/* @__PURE__ */ jsx16("div", { className: `px-4 pb-8 pt-1 sm:px-6 ${column}`, children: !hasAnySessions ? /* @__PURE__ */ jsxs14("div", { className: "flex min-h-[50vh] flex-col items-center justify-center gap-2 text-center", children: [
|
|
4506
|
+
/* @__PURE__ */ jsx16("p", { className: "text-sm font-medium text-foreground", children: emptyTitle }),
|
|
4507
|
+
/* @__PURE__ */ jsx16("p", { className: "max-w-xs text-xs text-muted-foreground", children: emptyDescription })
|
|
4508
|
+
] }) : history.isLoadingFirst ? /* @__PURE__ */ jsx16(SkeletonRows, {}) : history.items.length === 0 ? history.isError ? /* @__PURE__ */ jsx16(ErrorBlock, { onRetry: history.retry, message: "Couldn\u2019t load your sessions." }) : isSearching ? /* @__PURE__ */ jsxs14("p", { className: "py-16 text-center text-sm text-muted-foreground", children: [
|
|
4443
4509
|
"No sessions match \u201C",
|
|
4444
4510
|
searchTerm,
|
|
4445
4511
|
"\u201D."
|
|
4446
|
-
] }) : /* @__PURE__ */
|
|
4447
|
-
history.items.map((session) => /* @__PURE__ */
|
|
4512
|
+
] }) : /* @__PURE__ */ jsx16("p", { className: "py-16 text-center text-sm text-muted-foreground", children: "No sessions remain." }) : /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-0.5", children: [
|
|
4513
|
+
history.items.map((session) => /* @__PURE__ */ jsx16(
|
|
4448
4514
|
SessionRow,
|
|
4449
4515
|
{
|
|
4450
4516
|
session,
|
|
@@ -4471,10 +4537,10 @@ function SessionHistoryPanelView({
|
|
|
4471
4537
|
},
|
|
4472
4538
|
session.id
|
|
4473
4539
|
)),
|
|
4474
|
-
history.isError ? /* @__PURE__ */
|
|
4540
|
+
history.isError ? /* @__PURE__ */ jsx16(ErrorBlock, { onRetry: history.retry, message: "Couldn\u2019t load more sessions.", inline: true }) : history.hasMore ? /* @__PURE__ */ jsx16("div", { ref: sentinelRef, className: "flex items-center justify-center py-6", children: history.isLoadingMore && /* @__PURE__ */ jsx16("span", { role: "status", "aria-live": "polite", "aria-busy": true, className: "text-xs text-muted-foreground", children: "Loading\u2026" }) }) : null
|
|
4475
4541
|
] }) })
|
|
4476
4542
|
] }),
|
|
4477
|
-
bulkTarget && /* @__PURE__ */
|
|
4543
|
+
bulkTarget && /* @__PURE__ */ jsx16(
|
|
4478
4544
|
ActionDialog,
|
|
4479
4545
|
{
|
|
4480
4546
|
title: bulkTarget.title,
|
|
@@ -4487,7 +4553,7 @@ function SessionHistoryPanelView({
|
|
|
4487
4553
|
busy: bulkBusy,
|
|
4488
4554
|
error: bulkError,
|
|
4489
4555
|
footer: /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
4490
|
-
/* @__PURE__ */
|
|
4556
|
+
/* @__PURE__ */ jsx16(
|
|
4491
4557
|
ActionDialogButton,
|
|
4492
4558
|
{
|
|
4493
4559
|
onClick: () => {
|
|
@@ -4499,9 +4565,9 @@ function SessionHistoryPanelView({
|
|
|
4499
4565
|
children: "Cancel"
|
|
4500
4566
|
}
|
|
4501
4567
|
),
|
|
4502
|
-
/* @__PURE__ */
|
|
4568
|
+
/* @__PURE__ */ jsx16(ActionDialogButton, { onClick: () => void confirmBulkAction(), disabled: bulkBusy, variant: "destructive", children: bulkBusy ? "Working\u2026" : deleteLabel })
|
|
4503
4569
|
] }),
|
|
4504
|
-
children: /* @__PURE__ */
|
|
4570
|
+
children: /* @__PURE__ */ jsx16("p", { className: "text-sm text-muted-foreground", children: bulkTarget.body })
|
|
4505
4571
|
}
|
|
4506
4572
|
)
|
|
4507
4573
|
] });
|
|
@@ -4512,8 +4578,8 @@ function ErrorBlock({ message, onRetry, inline }) {
|
|
|
4512
4578
|
{
|
|
4513
4579
|
className: inline ? "flex items-center justify-center gap-3 py-6 text-sm text-muted-foreground" : "flex min-h-[40vh] flex-col items-center justify-center gap-3 text-center",
|
|
4514
4580
|
children: [
|
|
4515
|
-
/* @__PURE__ */
|
|
4516
|
-
/* @__PURE__ */
|
|
4581
|
+
/* @__PURE__ */ jsx16("span", { className: "text-sm text-muted-foreground", children: message }),
|
|
4582
|
+
/* @__PURE__ */ jsx16(Button3, { type: "button", variant: "outline", size: "sm", onClick: onRetry, children: "Retry" })
|
|
4517
4583
|
]
|
|
4518
4584
|
}
|
|
4519
4585
|
);
|
|
@@ -4541,7 +4607,7 @@ function SessionRow({
|
|
|
4541
4607
|
const hasMenu = Boolean(onRename) || Boolean(onDelete) || extras.length > 0;
|
|
4542
4608
|
const showUnread = Boolean(session.unread) && !responding;
|
|
4543
4609
|
return /* @__PURE__ */ jsxs14("div", { className: `group relative flex items-center gap-2 rounded-lg px-3 py-2.5 transition-colors hover:bg-accent ${selected ? "bg-primary/10" : ""}`, children: [
|
|
4544
|
-
selectable && /* @__PURE__ */
|
|
4610
|
+
selectable && /* @__PURE__ */ jsx16(
|
|
4545
4611
|
Checkbox,
|
|
4546
4612
|
{
|
|
4547
4613
|
checked: selected,
|
|
@@ -4550,9 +4616,9 @@ function SessionRow({
|
|
|
4550
4616
|
}
|
|
4551
4617
|
),
|
|
4552
4618
|
/* @__PURE__ */ jsxs14(Link, { to: href, className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
4553
|
-
showUnread && /* @__PURE__ */
|
|
4554
|
-
/* @__PURE__ */
|
|
4555
|
-
/* @__PURE__ */
|
|
4619
|
+
showUnread && /* @__PURE__ */ jsx16("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-primary", "aria-hidden": true }),
|
|
4620
|
+
/* @__PURE__ */ jsx16(MessageIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
4621
|
+
/* @__PURE__ */ jsx16(
|
|
4556
4622
|
"span",
|
|
4557
4623
|
{
|
|
4558
4624
|
className: `truncate text-sm ${responding ? "text-muted-foreground" : "text-foreground"} ${showUnread ? "font-semibold" : ""}`,
|
|
@@ -4561,9 +4627,9 @@ function SessionRow({
|
|
|
4561
4627
|
}
|
|
4562
4628
|
)
|
|
4563
4629
|
] }),
|
|
4564
|
-
/* @__PURE__ */
|
|
4630
|
+
/* @__PURE__ */ jsx16("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: timestamp }),
|
|
4565
4631
|
hasMenu && /* @__PURE__ */ jsxs14("div", { ref: containerRef, className: "relative shrink-0", children: [
|
|
4566
|
-
/* @__PURE__ */
|
|
4632
|
+
/* @__PURE__ */ jsx16(
|
|
4567
4633
|
Button3,
|
|
4568
4634
|
{
|
|
4569
4635
|
type: "button",
|
|
@@ -4574,7 +4640,7 @@ function SessionRow({
|
|
|
4574
4640
|
"aria-controls": menuOpen ? panelId : void 0,
|
|
4575
4641
|
onClick: () => setMenuOpen((open) => !open),
|
|
4576
4642
|
className: "text-muted-foreground focus-visible:opacity-100 sm:opacity-0 sm:group-hover:opacity-100 aria-expanded:opacity-100",
|
|
4577
|
-
children: /* @__PURE__ */
|
|
4643
|
+
children: /* @__PURE__ */ jsx16("span", { "aria-hidden": true, className: "text-base leading-none", children: "\u22EF" })
|
|
4578
4644
|
}
|
|
4579
4645
|
),
|
|
4580
4646
|
/* @__PURE__ */ jsxs14(
|
|
@@ -4587,7 +4653,7 @@ function SessionRow({
|
|
|
4587
4653
|
panelRef,
|
|
4588
4654
|
className: `w-36 overflow-hidden rounded-md border border-card-edge bg-popover py-1 ${OVERLAY_SHADOW}`,
|
|
4589
4655
|
children: [
|
|
4590
|
-
onRename && /* @__PURE__ */
|
|
4656
|
+
onRename && /* @__PURE__ */ jsx16(
|
|
4591
4657
|
"button",
|
|
4592
4658
|
{
|
|
4593
4659
|
type: "button",
|
|
@@ -4600,7 +4666,7 @@ function SessionRow({
|
|
|
4600
4666
|
children: renameLabel
|
|
4601
4667
|
}
|
|
4602
4668
|
),
|
|
4603
|
-
extras.map((action) => /* @__PURE__ */
|
|
4669
|
+
extras.map((action) => /* @__PURE__ */ jsx16(
|
|
4604
4670
|
"button",
|
|
4605
4671
|
{
|
|
4606
4672
|
type: "button",
|
|
@@ -4614,7 +4680,7 @@ function SessionRow({
|
|
|
4614
4680
|
},
|
|
4615
4681
|
action.id
|
|
4616
4682
|
)),
|
|
4617
|
-
onDelete && /* @__PURE__ */
|
|
4683
|
+
onDelete && /* @__PURE__ */ jsx16(
|
|
4618
4684
|
"button",
|
|
4619
4685
|
{
|
|
4620
4686
|
type: "button",
|
|
@@ -5090,17 +5156,17 @@ import {
|
|
|
5090
5156
|
useEffect as useEffect14,
|
|
5091
5157
|
useId as useId3,
|
|
5092
5158
|
useMemo as useMemo8,
|
|
5093
|
-
useRef as
|
|
5159
|
+
useRef as useRef15,
|
|
5094
5160
|
useState as useState21
|
|
5095
5161
|
} from "react";
|
|
5096
5162
|
import { Button as Button4, EmptyState, Skeleton, Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell } from "@tangle-network/ui/primitives";
|
|
5097
5163
|
|
|
5098
5164
|
// src/web-react/record-grid-review-actions.tsx
|
|
5099
|
-
import { jsx as
|
|
5165
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5100
5166
|
function ReviewActions({ rowId, kind, rowLabel, onAccept, onReject }) {
|
|
5101
5167
|
const noun = kind === "changed" ? `proposed change to ${rowLabel}` : kind === "added" ? `new row ${rowLabel}` : `removal of ${rowLabel}`;
|
|
5102
5168
|
return /* @__PURE__ */ jsxs15("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
5103
|
-
onReject && /* @__PURE__ */
|
|
5169
|
+
onReject && /* @__PURE__ */ jsx17(
|
|
5104
5170
|
"button",
|
|
5105
5171
|
{
|
|
5106
5172
|
type: "button",
|
|
@@ -5110,7 +5176,7 @@ function ReviewActions({ rowId, kind, rowLabel, onAccept, onReject }) {
|
|
|
5110
5176
|
children: "Reject"
|
|
5111
5177
|
}
|
|
5112
5178
|
),
|
|
5113
|
-
onAccept && /* @__PURE__ */
|
|
5179
|
+
onAccept && /* @__PURE__ */ jsx17(
|
|
5114
5180
|
"button",
|
|
5115
5181
|
{
|
|
5116
5182
|
type: "button",
|
|
@@ -5125,7 +5191,7 @@ function ReviewActions({ rowId, kind, rowLabel, onAccept, onReject }) {
|
|
|
5125
5191
|
|
|
5126
5192
|
// src/web-react/record-grid-editors.tsx
|
|
5127
5193
|
import { useMemo as useMemo7 } from "react";
|
|
5128
|
-
import { jsx as
|
|
5194
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
5129
5195
|
var INPUT_CLASS = "w-full rounded-md border border-strong bg-background px-2 py-1 text-sm text-foreground outline-none focus:border-primary/60 focus:ring-1 focus:ring-primary/40";
|
|
5130
5196
|
function groupColumns(columns) {
|
|
5131
5197
|
const groups = [];
|
|
@@ -5163,8 +5229,8 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
|
|
|
5163
5229
|
},
|
|
5164
5230
|
onBlur: () => onCommit(text),
|
|
5165
5231
|
children: [
|
|
5166
|
-
/* @__PURE__ */
|
|
5167
|
-
column.options.map((option) => /* @__PURE__ */
|
|
5232
|
+
/* @__PURE__ */ jsx18("option", { value: "", children: "\u2014" }),
|
|
5233
|
+
column.options.map((option) => /* @__PURE__ */ jsx18("option", { value: option.value, children: option.label }, option.value))
|
|
5168
5234
|
]
|
|
5169
5235
|
}
|
|
5170
5236
|
);
|
|
@@ -5182,7 +5248,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
|
|
|
5182
5248
|
}
|
|
5183
5249
|
};
|
|
5184
5250
|
if (column.kind === "text" && column.multiline === true) {
|
|
5185
|
-
return /* @__PURE__ */
|
|
5251
|
+
return /* @__PURE__ */ jsx18(
|
|
5186
5252
|
"textarea",
|
|
5187
5253
|
{
|
|
5188
5254
|
...shared,
|
|
@@ -5194,7 +5260,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
|
|
|
5194
5260
|
}
|
|
5195
5261
|
);
|
|
5196
5262
|
}
|
|
5197
|
-
return /* @__PURE__ */
|
|
5263
|
+
return /* @__PURE__ */ jsx18(
|
|
5198
5264
|
"input",
|
|
5199
5265
|
{
|
|
5200
5266
|
...shared,
|
|
@@ -5231,8 +5297,8 @@ function AddRecordForm({
|
|
|
5231
5297
|
},
|
|
5232
5298
|
className: "space-y-4 rounded-xl border border-card-edge bg-card p-4",
|
|
5233
5299
|
children: [
|
|
5234
|
-
/* @__PURE__ */
|
|
5235
|
-
formError !== null && /* @__PURE__ */
|
|
5300
|
+
/* @__PURE__ */ jsx18("h3", { className: "text-sm font-semibold text-foreground", children: label }),
|
|
5301
|
+
formError !== null && /* @__PURE__ */ jsx18("p", { role: "alert", className: "rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive", children: formError }),
|
|
5236
5302
|
groups.map((group) => {
|
|
5237
5303
|
const fields = group.columns.filter((column) => isRecordGridCellApplicable(column, draft));
|
|
5238
5304
|
if (fields.length === 0) return null;
|
|
@@ -5241,8 +5307,8 @@ function AddRecordForm({
|
|
|
5241
5307
|
{
|
|
5242
5308
|
className: group.label === null ? "min-w-0" : "min-w-0 rounded-lg border border-card-edge p-3",
|
|
5243
5309
|
children: [
|
|
5244
|
-
group.label !== null && /* @__PURE__ */
|
|
5245
|
-
/* @__PURE__ */
|
|
5310
|
+
group.label !== null && /* @__PURE__ */ jsx18("legend", { className: "px-1 text-xs font-medium text-muted-foreground", children: group.label }),
|
|
5311
|
+
/* @__PURE__ */ jsx18("div", { className: "grid gap-3 sm:grid-cols-2", children: fields.map((column) => {
|
|
5246
5312
|
const fieldId = `${fieldPrefix}-${column.id}`;
|
|
5247
5313
|
const errorId = `${fieldId}-error`;
|
|
5248
5314
|
const message = errors[column.id];
|
|
@@ -5253,9 +5319,9 @@ function AddRecordForm({
|
|
|
5253
5319
|
children: [
|
|
5254
5320
|
/* @__PURE__ */ jsxs16("label", { htmlFor: fieldId, className: "mb-1 block text-xs font-medium text-muted-foreground", children: [
|
|
5255
5321
|
column.header,
|
|
5256
|
-
column.required === true && /* @__PURE__ */
|
|
5322
|
+
column.required === true && /* @__PURE__ */ jsx18("span", { className: "ml-0.5 text-destructive", children: "*" })
|
|
5257
5323
|
] }),
|
|
5258
|
-
/* @__PURE__ */
|
|
5324
|
+
/* @__PURE__ */ jsx18(
|
|
5259
5325
|
DraftField,
|
|
5260
5326
|
{
|
|
5261
5327
|
column,
|
|
@@ -5266,8 +5332,8 @@ function AddRecordForm({
|
|
|
5266
5332
|
onValue: (next) => setDraft({ ...draft, [column.id]: next })
|
|
5267
5333
|
}
|
|
5268
5334
|
),
|
|
5269
|
-
column.hint && /* @__PURE__ */
|
|
5270
|
-
message !== void 0 && /* @__PURE__ */
|
|
5335
|
+
column.hint && /* @__PURE__ */ jsx18("p", { className: "mt-1 text-xs text-muted-foreground", children: column.hint }),
|
|
5336
|
+
message !== void 0 && /* @__PURE__ */ jsx18("p", { id: errorId, role: "alert", className: "mt-1 text-xs text-destructive", children: message })
|
|
5271
5337
|
]
|
|
5272
5338
|
},
|
|
5273
5339
|
column.id
|
|
@@ -5279,7 +5345,7 @@ function AddRecordForm({
|
|
|
5279
5345
|
);
|
|
5280
5346
|
}),
|
|
5281
5347
|
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2", children: [
|
|
5282
|
-
/* @__PURE__ */
|
|
5348
|
+
/* @__PURE__ */ jsx18(
|
|
5283
5349
|
"button",
|
|
5284
5350
|
{
|
|
5285
5351
|
type: "submit",
|
|
@@ -5288,7 +5354,7 @@ function AddRecordForm({
|
|
|
5288
5354
|
children: busy ? "Saving\u2026" : "Save"
|
|
5289
5355
|
}
|
|
5290
5356
|
),
|
|
5291
|
-
/* @__PURE__ */
|
|
5357
|
+
/* @__PURE__ */ jsx18(
|
|
5292
5358
|
"button",
|
|
5293
5359
|
{
|
|
5294
5360
|
type: "button",
|
|
@@ -5309,7 +5375,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
5309
5375
|
"aria-describedby": describedBy
|
|
5310
5376
|
};
|
|
5311
5377
|
if (column.kind === "boolean") {
|
|
5312
|
-
return /* @__PURE__ */
|
|
5378
|
+
return /* @__PURE__ */ jsx18(
|
|
5313
5379
|
"input",
|
|
5314
5380
|
{
|
|
5315
5381
|
...shared,
|
|
@@ -5329,14 +5395,14 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
5329
5395
|
value: typeof value === "string" ? value : "",
|
|
5330
5396
|
onChange: (event) => onValue(event.target.value === "" ? null : event.target.value),
|
|
5331
5397
|
children: [
|
|
5332
|
-
/* @__PURE__ */
|
|
5333
|
-
column.options.map((option) => /* @__PURE__ */
|
|
5398
|
+
/* @__PURE__ */ jsx18("option", { value: "", children: "\u2014" }),
|
|
5399
|
+
column.options.map((option) => /* @__PURE__ */ jsx18("option", { value: option.value, children: option.label }, option.value))
|
|
5334
5400
|
]
|
|
5335
5401
|
}
|
|
5336
5402
|
);
|
|
5337
5403
|
}
|
|
5338
5404
|
if (column.kind === "text" && column.multiline === true) {
|
|
5339
|
-
return /* @__PURE__ */
|
|
5405
|
+
return /* @__PURE__ */ jsx18(
|
|
5340
5406
|
"textarea",
|
|
5341
5407
|
{
|
|
5342
5408
|
...shared,
|
|
@@ -5348,7 +5414,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
5348
5414
|
);
|
|
5349
5415
|
}
|
|
5350
5416
|
if (column.kind === "number" || column.kind === "currency") {
|
|
5351
|
-
return /* @__PURE__ */
|
|
5417
|
+
return /* @__PURE__ */ jsx18(
|
|
5352
5418
|
"input",
|
|
5353
5419
|
{
|
|
5354
5420
|
...shared,
|
|
@@ -5368,7 +5434,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
5368
5434
|
}
|
|
5369
5435
|
);
|
|
5370
5436
|
}
|
|
5371
|
-
return /* @__PURE__ */
|
|
5437
|
+
return /* @__PURE__ */ jsx18(
|
|
5372
5438
|
"input",
|
|
5373
5439
|
{
|
|
5374
5440
|
...shared,
|
|
@@ -5382,7 +5448,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
5382
5448
|
|
|
5383
5449
|
// src/web-react/record-grid-source-marker.tsx
|
|
5384
5450
|
import { useCallback as useCallback12 } from "react";
|
|
5385
|
-
import { jsx as
|
|
5451
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5386
5452
|
var BASIS_TONES2 = {
|
|
5387
5453
|
extracted: "border-primary/60 text-primary",
|
|
5388
5454
|
entered: "border-success/60 text-success",
|
|
@@ -5405,7 +5471,7 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
|
|
|
5405
5471
|
);
|
|
5406
5472
|
const { containerRef, triggerRef, panelRef, triggerProps } = usePopover(open, setOpen);
|
|
5407
5473
|
return /* @__PURE__ */ jsxs17("span", { ref: containerRef, className: "relative inline-flex", children: [
|
|
5408
|
-
/* @__PURE__ */
|
|
5474
|
+
/* @__PURE__ */ jsx19(
|
|
5409
5475
|
"button",
|
|
5410
5476
|
{
|
|
5411
5477
|
type: "button",
|
|
@@ -5418,7 +5484,7 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
|
|
|
5418
5484
|
onToggle();
|
|
5419
5485
|
},
|
|
5420
5486
|
className: `inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border ${BASIS_TONES2[basis]}`,
|
|
5421
|
-
children: /* @__PURE__ */
|
|
5487
|
+
children: /* @__PURE__ */ jsx19(
|
|
5422
5488
|
"svg",
|
|
5423
5489
|
{
|
|
5424
5490
|
viewBox: "0 0 24 24",
|
|
@@ -5428,7 +5494,7 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
|
|
|
5428
5494
|
strokeWidth: "2.5",
|
|
5429
5495
|
strokeLinecap: "round",
|
|
5430
5496
|
"aria-hidden": true,
|
|
5431
|
-
children: /* @__PURE__ */
|
|
5497
|
+
children: /* @__PURE__ */ jsx19("path", { d: "M9 8h6M9 12h6M9 16h3" })
|
|
5432
5498
|
}
|
|
5433
5499
|
)
|
|
5434
5500
|
}
|
|
@@ -5453,7 +5519,7 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
|
|
|
5453
5519
|
source.locator ? ` \xB7 ${source.locator}` : "",
|
|
5454
5520
|
` \xB7 ${BASIS_TITLES[basis]}`
|
|
5455
5521
|
] }),
|
|
5456
|
-
source.href && /* @__PURE__ */
|
|
5522
|
+
source.href && /* @__PURE__ */ jsx19(
|
|
5457
5523
|
"a",
|
|
5458
5524
|
{
|
|
5459
5525
|
href: source.href,
|
|
@@ -5471,7 +5537,7 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
|
|
|
5471
5537
|
}
|
|
5472
5538
|
|
|
5473
5539
|
// src/web-react/record-grid.tsx
|
|
5474
|
-
import { jsx as
|
|
5540
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5475
5541
|
var EMPTY_RECORD_GRID_ROWS = [];
|
|
5476
5542
|
var CELL_KEY_SEPARATOR = "\0";
|
|
5477
5543
|
function cellKey(rowId, columnId) {
|
|
@@ -5521,10 +5587,10 @@ function useRecordGridViewState({
|
|
|
5521
5587
|
const [draftErrors, setDraftErrors] = useState21({});
|
|
5522
5588
|
const [draftError, setDraftError] = useState21(null);
|
|
5523
5589
|
const [creating, setCreating] = useState21(false);
|
|
5524
|
-
const cellRefs =
|
|
5525
|
-
const settling =
|
|
5526
|
-
const draftCounter =
|
|
5527
|
-
const editingRef =
|
|
5590
|
+
const cellRefs = useRef15(/* @__PURE__ */ new Map());
|
|
5591
|
+
const settling = useRef15(false);
|
|
5592
|
+
const draftCounter = useRef15(0);
|
|
5593
|
+
const editingRef = useRef15(null);
|
|
5528
5594
|
const setEditing = useCallback13((next) => {
|
|
5529
5595
|
editingRef.current = next;
|
|
5530
5596
|
setEditingState(next);
|
|
@@ -5766,7 +5832,7 @@ function useRecordGridViewState({
|
|
|
5766
5832
|
}
|
|
5767
5833
|
function RecordGrid(props) {
|
|
5768
5834
|
const view = useRecordGridViewState(props);
|
|
5769
|
-
return /* @__PURE__ */
|
|
5835
|
+
return /* @__PURE__ */ jsx20(RecordGridView, { ...view });
|
|
5770
5836
|
}
|
|
5771
5837
|
function RecordGridView({
|
|
5772
5838
|
state,
|
|
@@ -5836,7 +5902,7 @@ function RecordGridView({
|
|
|
5836
5902
|
"Loading ",
|
|
5837
5903
|
caption
|
|
5838
5904
|
] }),
|
|
5839
|
-
Array.from({ length: Math.max(1, loadingRowCount) }, (_, index) => /* @__PURE__ */
|
|
5905
|
+
Array.from({ length: Math.max(1, loadingRowCount) }, (_, index) => /* @__PURE__ */ jsx20(Skeleton, { className: "h-8", "aria-hidden": true }, index))
|
|
5840
5906
|
]
|
|
5841
5907
|
}
|
|
5842
5908
|
)
|
|
@@ -5846,8 +5912,8 @@ function RecordGridView({
|
|
|
5846
5912
|
return /* @__PURE__ */ jsxs18("div", { className: `space-y-3 ${className ?? ""}`, children: [
|
|
5847
5913
|
toolbar,
|
|
5848
5914
|
/* @__PURE__ */ jsxs18("div", { role: "alert", className: "rounded-xl border border-destructive/40 bg-destructive/10 px-4 py-4", children: [
|
|
5849
|
-
/* @__PURE__ */
|
|
5850
|
-
/* @__PURE__ */
|
|
5915
|
+
/* @__PURE__ */ jsx20("p", { className: "text-sm font-medium text-destructive", children: state.message }),
|
|
5916
|
+
/* @__PURE__ */ jsx20(
|
|
5851
5917
|
"button",
|
|
5852
5918
|
{
|
|
5853
5919
|
type: "button",
|
|
@@ -5859,7 +5925,7 @@ function RecordGridView({
|
|
|
5859
5925
|
] })
|
|
5860
5926
|
] });
|
|
5861
5927
|
}
|
|
5862
|
-
const addForm = adding && onCreate && !reviewing ? /* @__PURE__ */
|
|
5928
|
+
const addForm = adding && onCreate && !reviewing ? /* @__PURE__ */ jsx20(
|
|
5863
5929
|
AddRecordForm,
|
|
5864
5930
|
{
|
|
5865
5931
|
columns,
|
|
@@ -5880,15 +5946,15 @@ function RecordGridView({
|
|
|
5880
5946
|
if (visibleRows.length === 0 && !reviewing) {
|
|
5881
5947
|
return /* @__PURE__ */ jsxs18("div", { className: `space-y-3 ${className ?? ""}`, children: [
|
|
5882
5948
|
toolbar,
|
|
5883
|
-
addForm ?? /* @__PURE__ */
|
|
5949
|
+
addForm ?? /* @__PURE__ */ jsx20(
|
|
5884
5950
|
EmptyState,
|
|
5885
5951
|
{
|
|
5886
5952
|
title: empty.title,
|
|
5887
5953
|
description: empty.description,
|
|
5888
5954
|
className: "rounded-xl border border-dashed border-border",
|
|
5889
5955
|
action: /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center justify-center gap-2", children: [
|
|
5890
|
-
empty.action && (isValidElement(empty.action) ? empty.action : /* @__PURE__ */
|
|
5891
|
-
onCreate && /* @__PURE__ */
|
|
5956
|
+
empty.action && (isValidElement(empty.action) ? empty.action : /* @__PURE__ */ jsx20(Button4, { type: "button", variant: "outline", size: "sm", onClick: empty.action.onClick, children: empty.action.label })),
|
|
5957
|
+
onCreate && /* @__PURE__ */ jsx20(Button4, { type: "button", variant: "outline", size: "sm", onClick: openAdd, children: addLabel })
|
|
5892
5958
|
] })
|
|
5893
5959
|
}
|
|
5894
5960
|
)
|
|
@@ -5913,11 +5979,11 @@ function RecordGridView({
|
|
|
5913
5979
|
className: "flex flex-wrap items-center justify-between gap-3 rounded-xl border border-card-edge bg-card px-4 py-2.5",
|
|
5914
5980
|
children: [
|
|
5915
5981
|
/* @__PURE__ */ jsxs18("div", { className: "min-w-0", children: [
|
|
5916
|
-
/* @__PURE__ */
|
|
5917
|
-
/* @__PURE__ */
|
|
5982
|
+
/* @__PURE__ */ jsx20("p", { className: "text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: "Proposed changes" }),
|
|
5983
|
+
/* @__PURE__ */ jsx20("p", { className: "mt-0.5 text-xs tabular-nums text-muted-foreground", children: reviewSummary })
|
|
5918
5984
|
] }),
|
|
5919
5985
|
(onAcceptAll || onRejectAll) && /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
5920
|
-
onRejectAll && /* @__PURE__ */
|
|
5986
|
+
onRejectAll && /* @__PURE__ */ jsx20(
|
|
5921
5987
|
"button",
|
|
5922
5988
|
{
|
|
5923
5989
|
type: "button",
|
|
@@ -5927,7 +5993,7 @@ function RecordGridView({
|
|
|
5927
5993
|
children: "Reject all"
|
|
5928
5994
|
}
|
|
5929
5995
|
),
|
|
5930
|
-
onAcceptAll && /* @__PURE__ */
|
|
5996
|
+
onAcceptAll && /* @__PURE__ */ jsx20(
|
|
5931
5997
|
"button",
|
|
5932
5998
|
{
|
|
5933
5999
|
type: "button",
|
|
@@ -5944,7 +6010,7 @@ function RecordGridView({
|
|
|
5944
6010
|
return /* @__PURE__ */ jsxs18("div", { className: `space-y-3 ${className ?? ""}`, children: [
|
|
5945
6011
|
toolbar,
|
|
5946
6012
|
reviewBar,
|
|
5947
|
-
/* @__PURE__ */
|
|
6013
|
+
/* @__PURE__ */ jsx20("div", { className: "overflow-x-auto rounded-xl border border-card-edge bg-card", children: /* @__PURE__ */ jsxs18(
|
|
5948
6014
|
Table,
|
|
5949
6015
|
{
|
|
5950
6016
|
wrapper: false,
|
|
@@ -5953,8 +6019,8 @@ function RecordGridView({
|
|
|
5953
6019
|
className: "border-collapse text-left",
|
|
5954
6020
|
onKeyDown: handleGridKeyDown,
|
|
5955
6021
|
children: [
|
|
5956
|
-
/* @__PURE__ */
|
|
5957
|
-
columns.map((column) => /* @__PURE__ */
|
|
6022
|
+
/* @__PURE__ */ jsx20(TableHeader, { children: /* @__PURE__ */ jsxs18(TableRow, { role: "row", className: "text-xs uppercase tracking-[0.05em] text-muted-foreground", children: [
|
|
6023
|
+
columns.map((column) => /* @__PURE__ */ jsx20(
|
|
5958
6024
|
TableHead,
|
|
5959
6025
|
{
|
|
5960
6026
|
role: "columnheader",
|
|
@@ -5964,9 +6030,9 @@ function RecordGridView({
|
|
|
5964
6030
|
},
|
|
5965
6031
|
column.id
|
|
5966
6032
|
)),
|
|
5967
|
-
showActionsColumn && /* @__PURE__ */
|
|
6033
|
+
showActionsColumn && /* @__PURE__ */ jsx20(TableHead, { role: "columnheader", scope: "col", className: "h-auto w-px px-3 py-2", children: /* @__PURE__ */ jsx20("span", { className: "sr-only", children: reviewing ? "Review" : "Row actions" }) })
|
|
5968
6034
|
] }) }),
|
|
5969
|
-
/* @__PURE__ */
|
|
6035
|
+
/* @__PURE__ */ jsx20(
|
|
5970
6036
|
RecordGridRows,
|
|
5971
6037
|
{
|
|
5972
6038
|
visibleRows,
|
|
@@ -6001,8 +6067,8 @@ function RecordGridView({
|
|
|
6001
6067
|
addedRows
|
|
6002
6068
|
}
|
|
6003
6069
|
),
|
|
6004
|
-
hasFooter && /* @__PURE__ */
|
|
6005
|
-
columns.map((column) => /* @__PURE__ */
|
|
6070
|
+
hasFooter && /* @__PURE__ */ jsx20(TableFooter, { children: /* @__PURE__ */ jsxs18(TableRow, { role: "row", className: "border-t-2 border-border", children: [
|
|
6071
|
+
columns.map((column) => /* @__PURE__ */ jsx20(
|
|
6006
6072
|
TableCell,
|
|
6007
6073
|
{
|
|
6008
6074
|
role: "gridcell",
|
|
@@ -6011,7 +6077,7 @@ function RecordGridView({
|
|
|
6011
6077
|
},
|
|
6012
6078
|
column.id
|
|
6013
6079
|
)),
|
|
6014
|
-
showActionsColumn && /* @__PURE__ */
|
|
6080
|
+
showActionsColumn && /* @__PURE__ */ jsx20(TableCell, { role: "gridcell" })
|
|
6015
6081
|
] }) })
|
|
6016
6082
|
]
|
|
6017
6083
|
}
|
|
@@ -6024,8 +6090,8 @@ function RecordGridView({
|
|
|
6024
6090
|
className: "inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-sm font-medium text-foreground transition hover:bg-accent",
|
|
6025
6091
|
children: [
|
|
6026
6092
|
/* @__PURE__ */ jsxs18(RecordGridActionGlyph, { children: [
|
|
6027
|
-
/* @__PURE__ */
|
|
6028
|
-
/* @__PURE__ */
|
|
6093
|
+
/* @__PURE__ */ jsx20("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
6094
|
+
/* @__PURE__ */ jsx20("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
6029
6095
|
] }),
|
|
6030
6096
|
addLabel
|
|
6031
6097
|
]
|
|
@@ -6034,7 +6100,7 @@ function RecordGridView({
|
|
|
6034
6100
|
] });
|
|
6035
6101
|
}
|
|
6036
6102
|
function RecordGridActionGlyph({ children }) {
|
|
6037
|
-
return /* @__PURE__ */
|
|
6103
|
+
return /* @__PURE__ */ jsx20(
|
|
6038
6104
|
"svg",
|
|
6039
6105
|
{
|
|
6040
6106
|
viewBox: "0 0 24 24",
|
|
@@ -6110,7 +6176,7 @@ function RecordGridRows({
|
|
|
6110
6176
|
const cellDiff = rowDiff?.kind === "changed" ? diffCellByKey.get(key) : void 0;
|
|
6111
6177
|
if (isEditing && editable) {
|
|
6112
6178
|
return /* @__PURE__ */ jsxs18(TableCell, { role: "gridcell", className: `px-3 py-1.5 ${alignmentClass(column)}`, children: [
|
|
6113
|
-
/* @__PURE__ */
|
|
6179
|
+
/* @__PURE__ */ jsx20(
|
|
6114
6180
|
CellEditor,
|
|
6115
6181
|
{
|
|
6116
6182
|
column,
|
|
@@ -6123,11 +6189,11 @@ function RecordGridRows({
|
|
|
6123
6189
|
onCancel: () => cancelEdit(row, column)
|
|
6124
6190
|
}
|
|
6125
6191
|
),
|
|
6126
|
-
cellError !== void 0 && /* @__PURE__ */
|
|
6192
|
+
cellError !== void 0 && /* @__PURE__ */ jsx20("p", { id: errorId, role: "alert", className: "mt-1 text-xs leading-snug text-destructive", children: cellError })
|
|
6127
6193
|
] }, column.id);
|
|
6128
6194
|
}
|
|
6129
6195
|
if (column.kind === "boolean" && editable) {
|
|
6130
|
-
return /* @__PURE__ */
|
|
6196
|
+
return /* @__PURE__ */ jsx20(TableCell, { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsx20(
|
|
6131
6197
|
"input",
|
|
6132
6198
|
{
|
|
6133
6199
|
type: "checkbox",
|
|
@@ -6146,7 +6212,7 @@ function RecordGridRows({
|
|
|
6146
6212
|
) }, column.id);
|
|
6147
6213
|
}
|
|
6148
6214
|
const display = applicable ? formatRecordGridValue(column, value, locale) : "";
|
|
6149
|
-
return /* @__PURE__ */
|
|
6215
|
+
return /* @__PURE__ */ jsx20(
|
|
6150
6216
|
TableCell,
|
|
6151
6217
|
{
|
|
6152
6218
|
role: "gridcell",
|
|
@@ -6165,19 +6231,19 @@ function RecordGridRows({
|
|
|
6165
6231
|
column
|
|
6166
6232
|
)} ${editable ? "cursor-text" : ""}`,
|
|
6167
6233
|
children: /* @__PURE__ */ jsxs18("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
|
|
6168
|
-
column.id === columns[0]?.id && removedRow && /* @__PURE__ */
|
|
6234
|
+
column.id === columns[0]?.id && removedRow && /* @__PURE__ */ jsx20("span", { className: "inline-flex shrink-0 rounded border border-destructive/60 px-1 py-px text-[11px] font-semibold uppercase tracking-[0.05em] text-destructive", children: "Remove" }),
|
|
6169
6235
|
cellDiff ? /* @__PURE__ */ jsxs18("span", { className: "inline-flex max-w-full flex-wrap items-baseline gap-x-1.5", children: [
|
|
6170
|
-
/* @__PURE__ */
|
|
6171
|
-
/* @__PURE__ */
|
|
6172
|
-
/* @__PURE__ */
|
|
6173
|
-
] }) : /* @__PURE__ */
|
|
6236
|
+
/* @__PURE__ */ jsx20("span", { className: "tabular-nums text-destructive line-through decoration-destructive/60", children: formatRecordGridValue(column, cellDiff.before, locale) || "\u2014" }),
|
|
6237
|
+
/* @__PURE__ */ jsx20("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "\u2192" }),
|
|
6238
|
+
/* @__PURE__ */ jsx20("span", { className: "tabular-nums font-medium text-success", children: formatRecordGridValue(column, cellDiff.after, locale) || "\u2014" })
|
|
6239
|
+
] }) : /* @__PURE__ */ jsx20(
|
|
6174
6240
|
"span",
|
|
6175
6241
|
{
|
|
6176
6242
|
className: removedRow ? "truncate text-destructive line-through decoration-destructive/60" : display === "" ? "text-muted-foreground" : "truncate text-foreground",
|
|
6177
6243
|
children: display === "" ? applicable ? "\u2014" : "n/a" : display
|
|
6178
6244
|
}
|
|
6179
6245
|
),
|
|
6180
|
-
source && /* @__PURE__ */
|
|
6246
|
+
source && /* @__PURE__ */ jsx20(
|
|
6181
6247
|
SourceMarker,
|
|
6182
6248
|
{
|
|
6183
6249
|
panelId: `${fieldPrefix}-source-${row.id}-${column.id}`,
|
|
@@ -6193,7 +6259,7 @@ function RecordGridRows({
|
|
|
6193
6259
|
column.id
|
|
6194
6260
|
);
|
|
6195
6261
|
}),
|
|
6196
|
-
showActionsColumn && /* @__PURE__ */
|
|
6262
|
+
showActionsColumn && /* @__PURE__ */ jsx20(TableCell, { role: "gridcell", className: "px-3 py-2 text-right", children: reviewing ? rowDiff && /* @__PURE__ */ jsx20(
|
|
6197
6263
|
ReviewActions,
|
|
6198
6264
|
{
|
|
6199
6265
|
rowId: row.id,
|
|
@@ -6203,7 +6269,7 @@ function RecordGridRows({
|
|
|
6203
6269
|
onReject: onRejectRow
|
|
6204
6270
|
}
|
|
6205
6271
|
) : row.readOnly === true ? null : confirmDelete === row.id ? /* @__PURE__ */ jsxs18("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
6206
|
-
/* @__PURE__ */
|
|
6272
|
+
/* @__PURE__ */ jsx20(
|
|
6207
6273
|
"button",
|
|
6208
6274
|
{
|
|
6209
6275
|
type: "button",
|
|
@@ -6213,7 +6279,7 @@ function RecordGridRows({
|
|
|
6213
6279
|
children: "Delete"
|
|
6214
6280
|
}
|
|
6215
6281
|
),
|
|
6216
|
-
/* @__PURE__ */
|
|
6282
|
+
/* @__PURE__ */ jsx20(
|
|
6217
6283
|
"button",
|
|
6218
6284
|
{
|
|
6219
6285
|
type: "button",
|
|
@@ -6223,7 +6289,7 @@ function RecordGridRows({
|
|
|
6223
6289
|
children: "Cancel"
|
|
6224
6290
|
}
|
|
6225
6291
|
)
|
|
6226
|
-
] }) : /* @__PURE__ */
|
|
6292
|
+
] }) : /* @__PURE__ */ jsx20(
|
|
6227
6293
|
"button",
|
|
6228
6294
|
{
|
|
6229
6295
|
type: "button",
|
|
@@ -6231,15 +6297,15 @@ function RecordGridRows({
|
|
|
6231
6297
|
onClick: () => setConfirmDelete(row.id),
|
|
6232
6298
|
className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-destructive/10 hover:text-destructive",
|
|
6233
6299
|
children: /* @__PURE__ */ jsxs18(RecordGridActionGlyph, { children: [
|
|
6234
|
-
/* @__PURE__ */
|
|
6235
|
-
/* @__PURE__ */
|
|
6300
|
+
/* @__PURE__ */ jsx20("polyline", { points: "3 6 5 6 21 6" }),
|
|
6301
|
+
/* @__PURE__ */ jsx20("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
6236
6302
|
] })
|
|
6237
6303
|
}
|
|
6238
6304
|
) })
|
|
6239
6305
|
]
|
|
6240
6306
|
}
|
|
6241
6307
|
),
|
|
6242
|
-
rowError !== void 0 && /* @__PURE__ */
|
|
6308
|
+
rowError !== void 0 && /* @__PURE__ */ jsx20(TableRow, { role: "row", children: /* @__PURE__ */ jsx20(TableCell, { role: "gridcell", colSpan: columnSpan, className: "px-3 pb-2", children: /* @__PURE__ */ jsx20("p", { role: "alert", className: "rounded-md bg-destructive/10 px-2.5 py-1.5 text-xs text-destructive", children: rowError }) }) })
|
|
6243
6309
|
] }, row.id);
|
|
6244
6310
|
}),
|
|
6245
6311
|
reviewing && addedRows.map((row) => {
|
|
@@ -6255,9 +6321,9 @@ function RecordGridRows({
|
|
|
6255
6321
|
const applicable = isRecordGridCellApplicable(column, row.values);
|
|
6256
6322
|
const value = row.values[column.id] ?? null;
|
|
6257
6323
|
const display = applicable ? formatRecordGridValue(column, value, locale) : "";
|
|
6258
|
-
return /* @__PURE__ */
|
|
6259
|
-
columnIndex === 0 && /* @__PURE__ */
|
|
6260
|
-
/* @__PURE__ */
|
|
6324
|
+
return /* @__PURE__ */ jsx20(TableCell, { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsxs18("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
|
|
6325
|
+
columnIndex === 0 && /* @__PURE__ */ jsx20("span", { className: "inline-flex shrink-0 rounded border border-success/60 px-1 py-px text-[11px] font-semibold uppercase tracking-[0.05em] text-success", children: "New" }),
|
|
6326
|
+
/* @__PURE__ */ jsx20(
|
|
6261
6327
|
"span",
|
|
6262
6328
|
{
|
|
6263
6329
|
className: `tabular-nums ${display === "" ? "text-muted-foreground" : "truncate text-foreground"}`,
|
|
@@ -6266,7 +6332,7 @@ function RecordGridRows({
|
|
|
6266
6332
|
)
|
|
6267
6333
|
] }) }, column.id);
|
|
6268
6334
|
}),
|
|
6269
|
-
/* @__PURE__ */
|
|
6335
|
+
/* @__PURE__ */ jsx20(TableCell, { role: "gridcell", className: "px-3 py-2 text-right", children: /* @__PURE__ */ jsx20(
|
|
6270
6336
|
ReviewActions,
|
|
6271
6337
|
{
|
|
6272
6338
|
rowId: row.id,
|
|
@@ -6290,15 +6356,15 @@ import {
|
|
|
6290
6356
|
useEffect as useEffect15,
|
|
6291
6357
|
useId as useId4,
|
|
6292
6358
|
useMemo as useMemo9,
|
|
6293
|
-
useRef as
|
|
6359
|
+
useRef as useRef16,
|
|
6294
6360
|
useState as useState22
|
|
6295
6361
|
} from "react";
|
|
6296
6362
|
import { Dialog, DialogContent, DialogTitle } from "@tangle-network/ui/primitives";
|
|
6297
|
-
import { jsx as
|
|
6363
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6298
6364
|
function SearchGlyph({ className }) {
|
|
6299
6365
|
return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
6300
|
-
/* @__PURE__ */
|
|
6301
|
-
/* @__PURE__ */
|
|
6366
|
+
/* @__PURE__ */ jsx21("circle", { cx: "11", cy: "11", r: "8" }),
|
|
6367
|
+
/* @__PURE__ */ jsx21("path", { d: "m21 21-4.3-4.3" })
|
|
6302
6368
|
] });
|
|
6303
6369
|
}
|
|
6304
6370
|
function CommandPalette({
|
|
@@ -6326,7 +6392,7 @@ function CommandPalette({
|
|
|
6326
6392
|
);
|
|
6327
6393
|
const [query, setQuery] = useState22(initialQuery ?? "");
|
|
6328
6394
|
const [active, setActive] = useState22(0);
|
|
6329
|
-
const inputRef =
|
|
6395
|
+
const inputRef = useRef16(null);
|
|
6330
6396
|
const surfaceId = useId4();
|
|
6331
6397
|
const listId = `${surfaceId}-list`;
|
|
6332
6398
|
const flat = useMemo9(() => filterCommandPaletteItems(items, query), [items, query]);
|
|
@@ -6344,7 +6410,7 @@ function CommandPalette({
|
|
|
6344
6410
|
document.addEventListener("keydown", onKeyDown);
|
|
6345
6411
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
6346
6412
|
}, [hotkey, open, setOpen]);
|
|
6347
|
-
const restoreFocusRef =
|
|
6413
|
+
const restoreFocusRef = useRef16(null);
|
|
6348
6414
|
useEffect15(() => {
|
|
6349
6415
|
if (open) return;
|
|
6350
6416
|
setQuery(initialQuery ?? "");
|
|
@@ -6376,7 +6442,7 @@ function CommandPalette({
|
|
|
6376
6442
|
}
|
|
6377
6443
|
};
|
|
6378
6444
|
let rowIndex = -1;
|
|
6379
|
-
return /* @__PURE__ */
|
|
6445
|
+
return /* @__PURE__ */ jsx21(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs19(
|
|
6380
6446
|
DialogContent,
|
|
6381
6447
|
{
|
|
6382
6448
|
hideCloseButton: true,
|
|
@@ -6395,10 +6461,10 @@ function CommandPalette({
|
|
|
6395
6461
|
...{ [POPOVER_SURFACE_ATTR]: surfaceId },
|
|
6396
6462
|
className: `top-[15%] z-[1000] flex max-h-[70vh] w-[560px] max-w-[calc(100vw-2rem)] translate-y-0 flex-col gap-0 overflow-hidden rounded-xl border-card-edge bg-popover p-0 ${OVERLAY_SHADOW}`,
|
|
6397
6463
|
children: [
|
|
6398
|
-
/* @__PURE__ */
|
|
6464
|
+
/* @__PURE__ */ jsx21(DialogTitle, { className: "sr-only", children: label }),
|
|
6399
6465
|
/* @__PURE__ */ jsxs19("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-3 py-2.5", children: [
|
|
6400
|
-
/* @__PURE__ */
|
|
6401
|
-
/* @__PURE__ */
|
|
6466
|
+
/* @__PURE__ */ jsx21(SearchGlyph, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
6467
|
+
/* @__PURE__ */ jsx21(
|
|
6402
6468
|
"input",
|
|
6403
6469
|
{
|
|
6404
6470
|
ref: inputRef,
|
|
@@ -6421,10 +6487,10 @@ function CommandPalette({
|
|
|
6421
6487
|
)
|
|
6422
6488
|
] }),
|
|
6423
6489
|
/* @__PURE__ */ jsxs19("div", { role: "listbox", id: listId, className: "min-h-0 flex-1 overflow-y-auto p-1 pb-2", children: [
|
|
6424
|
-
loading && /* @__PURE__ */
|
|
6425
|
-
!loading && flat.length === 0 && /* @__PURE__ */
|
|
6490
|
+
loading && /* @__PURE__ */ jsx21("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "Loading\u2026" }),
|
|
6491
|
+
!loading && flat.length === 0 && /* @__PURE__ */ jsx21("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: emptyMessage ?? (query.trim() ? `No results for \u201C${query.trim()}\u201D` : "Nothing here yet") }),
|
|
6426
6492
|
!loading && sections.map((section) => /* @__PURE__ */ jsxs19("div", { children: [
|
|
6427
|
-
/* @__PURE__ */
|
|
6493
|
+
/* @__PURE__ */ jsx21("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: section.group }),
|
|
6428
6494
|
section.items.map((item) => {
|
|
6429
6495
|
rowIndex += 1;
|
|
6430
6496
|
const index = rowIndex;
|
|
@@ -6438,9 +6504,9 @@ function CommandPalette({
|
|
|
6438
6504
|
onClick: () => choose(item),
|
|
6439
6505
|
className: `flex w-full cursor-pointer items-center gap-2.5 rounded-md px-3 py-2.5 text-left text-sm ${index === activeIndex ? "bg-accent" : ""}`,
|
|
6440
6506
|
children: [
|
|
6441
|
-
/* @__PURE__ */
|
|
6442
|
-
item.description && /* @__PURE__ */
|
|
6443
|
-
item.hint && /* @__PURE__ */
|
|
6507
|
+
/* @__PURE__ */ jsx21("span", { className: "truncate text-foreground", children: item.label }),
|
|
6508
|
+
item.description && /* @__PURE__ */ jsx21("span", { className: "truncate text-xs text-muted-foreground", children: item.description }),
|
|
6509
|
+
item.hint && /* @__PURE__ */ jsx21("span", { className: "ml-auto shrink-0 text-xs tabular-nums text-muted-foreground", children: item.hint })
|
|
6444
6510
|
]
|
|
6445
6511
|
},
|
|
6446
6512
|
item.id
|
|
@@ -6449,14 +6515,14 @@ function CommandPalette({
|
|
|
6449
6515
|
] }, section.group))
|
|
6450
6516
|
] }),
|
|
6451
6517
|
/* @__PURE__ */ jsxs19("div", { className: "flex shrink-0 items-center justify-between border-t border-border px-3 py-2 text-xs text-muted-foreground", children: [
|
|
6452
|
-
/* @__PURE__ */
|
|
6518
|
+
/* @__PURE__ */ jsx21("span", { className: "tabular-nums", children: query.trim() ? `${flat.length} of ${items.length}` : `${items.length} items` }),
|
|
6453
6519
|
/* @__PURE__ */ jsxs19("span", { className: "flex items-center gap-1.5", children: [
|
|
6454
|
-
/* @__PURE__ */
|
|
6455
|
-
/* @__PURE__ */
|
|
6456
|
-
/* @__PURE__ */
|
|
6457
|
-
/* @__PURE__ */
|
|
6458
|
-
/* @__PURE__ */
|
|
6459
|
-
/* @__PURE__ */
|
|
6520
|
+
/* @__PURE__ */ jsx21("kbd", { className: "rounded border border-border bg-background px-1 py-0.5", children: "\u2191\u2193" }),
|
|
6521
|
+
/* @__PURE__ */ jsx21("span", { children: "navigate" }),
|
|
6522
|
+
/* @__PURE__ */ jsx21("kbd", { className: "ml-1.5 rounded border border-border bg-background px-1 py-0.5", children: "\u21B5" }),
|
|
6523
|
+
/* @__PURE__ */ jsx21("span", { children: "select" }),
|
|
6524
|
+
/* @__PURE__ */ jsx21("kbd", { className: "ml-1.5 rounded border border-border bg-background px-1 py-0.5", children: "esc" }),
|
|
6525
|
+
/* @__PURE__ */ jsx21("span", { children: "close" })
|
|
6460
6526
|
] })
|
|
6461
6527
|
] })
|
|
6462
6528
|
]
|
|
@@ -6465,7 +6531,7 @@ function CommandPalette({
|
|
|
6465
6531
|
}
|
|
6466
6532
|
|
|
6467
6533
|
// src/web-react/sparkline.tsx
|
|
6468
|
-
import { jsx as
|
|
6534
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
6469
6535
|
var DEFAULT_SPARKLINE_WIDTH = 96;
|
|
6470
6536
|
var DEFAULT_SPARKLINE_HEIGHT = 24;
|
|
6471
6537
|
var DEFAULT_INSET = 2.5;
|
|
@@ -6577,8 +6643,8 @@ function Sparkline({
|
|
|
6577
6643
|
"data-sparkline": geometry.gaps > 0 ? "unavailable" : "empty",
|
|
6578
6644
|
className: joinClasses("text-[11px] text-muted-foreground", className),
|
|
6579
6645
|
children: [
|
|
6580
|
-
/* @__PURE__ */
|
|
6581
|
-
/* @__PURE__ */
|
|
6646
|
+
/* @__PURE__ */ jsx22("span", { className: "sr-only", children: accessibleName }),
|
|
6647
|
+
/* @__PURE__ */ jsx22("span", { "aria-hidden": "true", children: geometry.gaps > 0 ? unavailableLabel : emptyLabel })
|
|
6582
6648
|
]
|
|
6583
6649
|
}
|
|
6584
6650
|
);
|
|
@@ -6602,7 +6668,7 @@ function Sparkline({
|
|
|
6602
6668
|
geometry.segments.map((segment, index) => {
|
|
6603
6669
|
const key = `segment-${index}`;
|
|
6604
6670
|
if (segment.length > 1) {
|
|
6605
|
-
return /* @__PURE__ */
|
|
6671
|
+
return /* @__PURE__ */ jsx22(
|
|
6606
6672
|
"polyline",
|
|
6607
6673
|
{
|
|
6608
6674
|
points: sparklinePointsAttribute(segment),
|
|
@@ -6618,9 +6684,9 @@ function Sparkline({
|
|
|
6618
6684
|
}
|
|
6619
6685
|
const only = segment[0];
|
|
6620
6686
|
if (only.x === end.x && only.y === end.y) return null;
|
|
6621
|
-
return /* @__PURE__ */
|
|
6687
|
+
return /* @__PURE__ */ jsx22("circle", { cx: only.x, cy: only.y, r: DOT_RADIUS, fill: "currentColor" }, key);
|
|
6622
6688
|
}),
|
|
6623
|
-
/* @__PURE__ */
|
|
6689
|
+
/* @__PURE__ */ jsx22("circle", { cx: end.x, cy: end.y, r: DOT_RADIUS, fill: "currentColor" })
|
|
6624
6690
|
]
|
|
6625
6691
|
}
|
|
6626
6692
|
);
|
|
@@ -6631,10 +6697,10 @@ import {
|
|
|
6631
6697
|
isValidElement as isValidElement2,
|
|
6632
6698
|
useCallback as useCallback15,
|
|
6633
6699
|
useEffect as useEffect16,
|
|
6634
|
-
useRef as
|
|
6700
|
+
useRef as useRef17,
|
|
6635
6701
|
useState as useState23
|
|
6636
6702
|
} from "react";
|
|
6637
|
-
import { Fragment as Fragment7, jsx as
|
|
6703
|
+
import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
6638
6704
|
function insightDelta(value, previous) {
|
|
6639
6705
|
if (typeof value !== "number" || !Number.isFinite(value)) return null;
|
|
6640
6706
|
if (typeof previous !== "number" || !Number.isFinite(previous)) return null;
|
|
@@ -6695,22 +6761,22 @@ function InsightCard({
|
|
|
6695
6761
|
className: joinClasses("agent-arrive flex h-full flex-col rounded-xl border border-card-edge bg-card p-4", className),
|
|
6696
6762
|
style,
|
|
6697
6763
|
children: [
|
|
6698
|
-
eyebrow ? /* @__PURE__ */
|
|
6764
|
+
eyebrow ? /* @__PURE__ */ jsx23("p", { "data-insight-eyebrow": "", className: "mb-0.5 text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: eyebrow }) : null,
|
|
6699
6765
|
/* @__PURE__ */ jsxs21("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
6700
|
-
/* @__PURE__ */
|
|
6766
|
+
/* @__PURE__ */ jsx23("h3", { className: "text-[13px] font-medium text-muted-foreground", children: title }),
|
|
6701
6767
|
live ? (
|
|
6702
6768
|
// No `data-motion` opt-out: the word is the signal and the sweep is
|
|
6703
6769
|
// emphasis, so the reduced-motion floor reaches this like everything
|
|
6704
6770
|
// else and leaves a static, legible label.
|
|
6705
|
-
/* @__PURE__ */
|
|
6771
|
+
/* @__PURE__ */ jsx23("span", { className: "agent-shimmer shrink-0 text-[11px] font-medium", "data-insight-live": "", children: liveLabel })
|
|
6706
6772
|
) : null
|
|
6707
6773
|
] }),
|
|
6708
|
-
/* @__PURE__ */
|
|
6709
|
-
/* @__PURE__ */
|
|
6710
|
-
/* @__PURE__ */
|
|
6774
|
+
/* @__PURE__ */ jsx23("p", { className: "mt-1 flex items-baseline gap-1", children: unavailable ? /* @__PURE__ */ jsxs21("span", { "data-insight-value": "unavailable", className: "text-xl font-semibold text-muted-foreground", children: [
|
|
6775
|
+
/* @__PURE__ */ jsx23("span", { "aria-hidden": "true", children: INSIGHT_UNAVAILABLE_GLYPH }),
|
|
6776
|
+
/* @__PURE__ */ jsx23("span", { className: "sr-only", children: INSIGHT_UNAVAILABLE_LABEL })
|
|
6711
6777
|
] }) : /* @__PURE__ */ jsxs21(Fragment7, { children: [
|
|
6712
|
-
/* @__PURE__ */
|
|
6713
|
-
unit ? /* @__PURE__ */
|
|
6778
|
+
/* @__PURE__ */ jsx23("span", { className: "text-xl font-semibold tabular-nums text-foreground", children: shown }),
|
|
6779
|
+
unit ? /* @__PURE__ */ jsx23("span", { className: "text-[11px] text-muted-foreground", children: unit }) : null
|
|
6714
6780
|
] }) }),
|
|
6715
6781
|
delta ? /* @__PURE__ */ jsxs21("p", { "data-insight-delta": delta.direction, className: `mt-0.5 text-[11px] font-medium ${TONE_CLASS[tone]}`, children: [
|
|
6716
6782
|
/* @__PURE__ */ jsxs21("span", { "aria-hidden": "true", children: [
|
|
@@ -6719,16 +6785,16 @@ function InsightCard({
|
|
|
6719
6785
|
] }),
|
|
6720
6786
|
formatInsightDelta(delta, format)
|
|
6721
6787
|
] }) : null,
|
|
6722
|
-
description ? /* @__PURE__ */
|
|
6723
|
-
series ? /* @__PURE__ */
|
|
6724
|
-
action ? /* @__PURE__ */
|
|
6788
|
+
description ? /* @__PURE__ */ jsx23("p", { className: "mt-1 text-[11px] text-muted-foreground", children: description }) : null,
|
|
6789
|
+
series ? /* @__PURE__ */ jsx23("div", { className: "mt-2 text-muted-foreground", children: /* @__PURE__ */ jsx23(Sparkline, { values: series, label: seriesLabel ?? title, format }) }) : null,
|
|
6790
|
+
action ? /* @__PURE__ */ jsx23("div", { className: "mt-3", children: renderInsightAction(action) }) : null
|
|
6725
6791
|
]
|
|
6726
6792
|
}
|
|
6727
6793
|
);
|
|
6728
6794
|
}
|
|
6729
6795
|
function renderInsightAction(action) {
|
|
6730
6796
|
if (isValidElement2(action)) return action;
|
|
6731
|
-
return /* @__PURE__ */
|
|
6797
|
+
return /* @__PURE__ */ jsx23(
|
|
6732
6798
|
"button",
|
|
6733
6799
|
{
|
|
6734
6800
|
type: "button",
|
|
@@ -6804,7 +6870,7 @@ function InsightDeck({
|
|
|
6804
6870
|
if (carried !== held) setHeld(carried);
|
|
6805
6871
|
const shown = carried !== null && state.status !== "ready" ? { status: "ready", value: carried, retry: state.retry } : state;
|
|
6806
6872
|
const refreshing = shown !== state;
|
|
6807
|
-
const reported =
|
|
6873
|
+
const reported = useRef17(0);
|
|
6808
6874
|
const settlePage = useCallback15(
|
|
6809
6875
|
(next) => {
|
|
6810
6876
|
if (reported.current === next) return;
|
|
@@ -6813,7 +6879,7 @@ function InsightDeck({
|
|
|
6813
6879
|
},
|
|
6814
6880
|
[onPageChange]
|
|
6815
6881
|
);
|
|
6816
|
-
return /* @__PURE__ */
|
|
6882
|
+
return /* @__PURE__ */ jsx23(
|
|
6817
6883
|
AsyncView,
|
|
6818
6884
|
{
|
|
6819
6885
|
state: shown,
|
|
@@ -6821,7 +6887,7 @@ function InsightDeck({
|
|
|
6821
6887
|
loadingLabel,
|
|
6822
6888
|
retryLabel,
|
|
6823
6889
|
className,
|
|
6824
|
-
children: (insights) => /* @__PURE__ */
|
|
6890
|
+
children: (insights) => /* @__PURE__ */ jsx23(
|
|
6825
6891
|
InsightPages,
|
|
6826
6892
|
{
|
|
6827
6893
|
insights,
|
|
@@ -6888,9 +6954,9 @@ function InsightPages({
|
|
|
6888
6954
|
const pageCount = insightPageCount(insights.length, size);
|
|
6889
6955
|
const current = Math.min(Math.max(page, 0), pageCount - 1);
|
|
6890
6956
|
const visible = insightPageSlice(insights, current, size);
|
|
6891
|
-
const sectionRef =
|
|
6892
|
-
const listRef =
|
|
6893
|
-
const recoverFocus =
|
|
6957
|
+
const sectionRef = useRef17(null);
|
|
6958
|
+
const listRef = useRef17(null);
|
|
6959
|
+
const recoverFocus = useRef17(false);
|
|
6894
6960
|
useEffect16(() => {
|
|
6895
6961
|
onPageSettled(current);
|
|
6896
6962
|
}, [current, onPageSettled]);
|
|
@@ -6946,7 +7012,7 @@ function InsightPages({
|
|
|
6946
7012
|
tabIndex: pageCount > 1 ? 0 : void 0,
|
|
6947
7013
|
"aria-keyshortcuts": pageCount > 1 ? "ArrowLeft ArrowRight PageUp PageDown Home End" : void 0,
|
|
6948
7014
|
children: [
|
|
6949
|
-
/* @__PURE__ */
|
|
7015
|
+
/* @__PURE__ */ jsx23("ul", { ref: listRef, className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: visible.map(({ id, style, ...card }, index) => (
|
|
6950
7016
|
// The page index is in the key on purpose: a page turn is an arrival,
|
|
6951
7017
|
// and reusing the node would swap the text under a card that never
|
|
6952
7018
|
// moved. Remounting replays `.agent-arrive` with the new stagger.
|
|
@@ -6957,7 +7023,7 @@ function InsightPages({
|
|
|
6957
7023
|
// does not arrive a second time. The key does BOTH jobs — but only
|
|
6958
7024
|
// because the deck now keeps this subtree mounted across a reload
|
|
6959
7025
|
// (see `InsightDeck`); a key is never compared across a teardown.
|
|
6960
|
-
/* @__PURE__ */
|
|
7026
|
+
/* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsx23(InsightCard, { ...card, style: staggerStyle(index, style) }) }, `${current}:${id}`)
|
|
6961
7027
|
)) }),
|
|
6962
7028
|
/* @__PURE__ */ jsxs21("div", { className: pageCount > 1 ? "flex items-center justify-between gap-2" : void 0, children: [
|
|
6963
7029
|
/* @__PURE__ */ jsxs21(
|
|
@@ -6975,7 +7041,7 @@ function InsightPages({
|
|
|
6975
7041
|
}
|
|
6976
7042
|
),
|
|
6977
7043
|
pageCount > 1 ? /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1", children: [
|
|
6978
|
-
/* @__PURE__ */
|
|
7044
|
+
/* @__PURE__ */ jsx23(PagerButton, { label: "Previous insights", glyph: "\u2039", atEnd: current === 0, onClick: () => goTo(current - 1) }),
|
|
6979
7045
|
pageCount <= MAX_PAGE_DOTS ? Array.from({ length: pageCount }, (_, index) => (
|
|
6980
7046
|
// WCAG 2.2 SC 2.5.8 wants a 24x24 CSS px target. The dot stays
|
|
6981
7047
|
// 8px because a 24px dot is a different control; the BUTTON
|
|
@@ -6983,7 +7049,7 @@ function InsightPages({
|
|
|
6983
7049
|
// and the span is the graphic. The Spacing exception cannot
|
|
6984
7050
|
// rescue the bare dot — at a 12px pitch the 24px circle around
|
|
6985
7051
|
// each centre overlaps its neighbour's.
|
|
6986
|
-
/* @__PURE__ */
|
|
7052
|
+
/* @__PURE__ */ jsx23(
|
|
6987
7053
|
"button",
|
|
6988
7054
|
{
|
|
6989
7055
|
type: "button",
|
|
@@ -6991,7 +7057,7 @@ function InsightPages({
|
|
|
6991
7057
|
"aria-current": index === current ? "page" : void 0,
|
|
6992
7058
|
onClick: () => goTo(index),
|
|
6993
7059
|
className: "group flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
|
|
6994
|
-
children: /* @__PURE__ */
|
|
7060
|
+
children: /* @__PURE__ */ jsx23(
|
|
6995
7061
|
"span",
|
|
6996
7062
|
{
|
|
6997
7063
|
"aria-hidden": "true",
|
|
@@ -7005,7 +7071,7 @@ function InsightPages({
|
|
|
7005
7071
|
index
|
|
7006
7072
|
)
|
|
7007
7073
|
)) : null,
|
|
7008
|
-
/* @__PURE__ */
|
|
7074
|
+
/* @__PURE__ */ jsx23(
|
|
7009
7075
|
PagerButton,
|
|
7010
7076
|
{
|
|
7011
7077
|
label: "Next insights",
|
|
@@ -7026,7 +7092,7 @@ function PagerButton({
|
|
|
7026
7092
|
atEnd,
|
|
7027
7093
|
onClick
|
|
7028
7094
|
}) {
|
|
7029
|
-
return /* @__PURE__ */
|
|
7095
|
+
return /* @__PURE__ */ jsx23(
|
|
7030
7096
|
"button",
|
|
7031
7097
|
{
|
|
7032
7098
|
type: "button",
|
|
@@ -7036,15 +7102,15 @@ function PagerButton({
|
|
|
7036
7102
|
if (!atEnd) onClick();
|
|
7037
7103
|
},
|
|
7038
7104
|
className: `flex h-6 w-6 items-center justify-center rounded-md border border-border text-xs text-muted-foreground transition ${atEnd ? "opacity-40" : "hover:bg-accent hover:text-foreground"}`,
|
|
7039
|
-
children: /* @__PURE__ */
|
|
7105
|
+
children: /* @__PURE__ */ jsx23("span", { "aria-hidden": "true", children: glyph })
|
|
7040
7106
|
}
|
|
7041
7107
|
);
|
|
7042
7108
|
}
|
|
7043
7109
|
|
|
7044
7110
|
// src/web-react/review-inbox.tsx
|
|
7045
|
-
import { useEffect as useEffect17, useRef as
|
|
7111
|
+
import { useEffect as useEffect17, useRef as useRef18, useState as useState24 } from "react";
|
|
7046
7112
|
import { Button as Button5, PageHeader } from "@tangle-network/ui/primitives";
|
|
7047
|
-
import { Fragment as Fragment8, jsx as
|
|
7113
|
+
import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
7048
7114
|
var revisionKey = (item) => JSON.stringify([item.id, item.revision]);
|
|
7049
7115
|
function comparisonOrder(items, seed) {
|
|
7050
7116
|
const result = [...items].sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
|
|
@@ -7069,12 +7135,12 @@ function ReviewInbox({ items, initialSelectedId, renderItem, renderCompareBrief,
|
|
|
7069
7135
|
const [refreshing, setRefreshing] = useState24(false);
|
|
7070
7136
|
const [restart, setRestart] = useState24(false);
|
|
7071
7137
|
const [refreshError, setRefreshError] = useState24("");
|
|
7072
|
-
const cache =
|
|
7073
|
-
const comparisons =
|
|
7074
|
-
const drafts =
|
|
7075
|
-
const pending =
|
|
7076
|
-
const section =
|
|
7077
|
-
const form =
|
|
7138
|
+
const cache = useRef18(/* @__PURE__ */ new Map());
|
|
7139
|
+
const comparisons = useRef18(/* @__PURE__ */ new Map());
|
|
7140
|
+
const drafts = useRef18(/* @__PURE__ */ new Map());
|
|
7141
|
+
const pending = useRef18(false);
|
|
7142
|
+
const section = useRef18(null);
|
|
7143
|
+
const form = useRef18(null);
|
|
7078
7144
|
for (const item of items) {
|
|
7079
7145
|
cache.current.set(item.id, item);
|
|
7080
7146
|
if (!comparisons.current.has(item.id)) comparisons.current.set(item.id, item.compare ? { ...item.compare } : void 0);
|
|
@@ -7223,19 +7289,19 @@ function ReviewInbox({ items, initialSelectedId, renderItem, renderCompareBrief,
|
|
|
7223
7289
|
className: `mx-auto min-w-0 space-y-5 outline-none ${compare ? "max-w-none" : "max-w-4xl"}`,
|
|
7224
7290
|
"data-review-inbox": true,
|
|
7225
7291
|
children: [
|
|
7226
|
-
/* @__PURE__ */
|
|
7292
|
+
/* @__PURE__ */ jsx24(
|
|
7227
7293
|
PageHeader,
|
|
7228
7294
|
{
|
|
7229
7295
|
title: "Review inbox",
|
|
7230
7296
|
description: "Review the oldest work first. Every decision includes your score and feedback.",
|
|
7231
|
-
actions: onRefresh && /* @__PURE__ */
|
|
7232
|
-
meta: /* @__PURE__ */
|
|
7297
|
+
actions: onRefresh && /* @__PURE__ */ jsx24(Button5, { variant: "outline", disabled: busy || refreshing || loading, onClick: () => void refresh(), children: refreshing ? "Refreshing\u2026" : "Refresh" }),
|
|
7298
|
+
meta: /* @__PURE__ */ jsx24("p", { role: "status", "data-review-progress": true, children: active ? `${compare ? reviewed : rank} of ${round2.length}${compare ? " resolved" : ""}` : `${reviewed} of ${round2.length} resolved` })
|
|
7233
7299
|
}
|
|
7234
7300
|
),
|
|
7235
|
-
(error || refreshError) && /* @__PURE__ */
|
|
7236
|
-
round2.length > 0 && /* @__PURE__ */
|
|
7237
|
-
(loading || error) && !active ? /* @__PURE__ */
|
|
7238
|
-
/* @__PURE__ */
|
|
7301
|
+
(error || refreshError) && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-sm text-[var(--surface-danger-text)]", children: error || refreshError }),
|
|
7302
|
+
round2.length > 0 && /* @__PURE__ */ jsx24("progress", { "aria-label": "Items resolved this round", value: reviewed, max: round2.length, className: "h-1.5 w-full accent-primary" }),
|
|
7303
|
+
(loading || error) && !active ? /* @__PURE__ */ jsx24("p", { role: "status", children: loading ? "Loading the review inbox\u2026" : "The review inbox could not load." }) : !active ? /* @__PURE__ */ jsxs22("div", { className: "py-12 text-center", children: [
|
|
7304
|
+
/* @__PURE__ */ jsx24("h2", { className: "text-xl font-semibold", children: "All caught up" }),
|
|
7239
7305
|
/* @__PURE__ */ jsxs22("p", { className: "mt-2 text-sm text-muted-foreground", children: [
|
|
7240
7306
|
reviewed,
|
|
7241
7307
|
" of ",
|
|
@@ -7245,18 +7311,18 @@ function ReviewInbox({ items, initialSelectedId, renderItem, renderCompareBrief,
|
|
|
7245
7311
|
] }) : /* @__PURE__ */ jsxs22(Fragment8, { children: [
|
|
7246
7312
|
/* @__PURE__ */ jsxs22("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
7247
7313
|
/* @__PURE__ */ jsxs22("div", { className: "min-w-0", children: [
|
|
7248
|
-
!compare && /* @__PURE__ */
|
|
7249
|
-
/* @__PURE__ */
|
|
7314
|
+
!compare && /* @__PURE__ */ jsx24("p", { className: "text-sm text-muted-foreground", children: active.kind }),
|
|
7315
|
+
/* @__PURE__ */ jsx24("h2", { className: "break-words text-lg font-semibold", "data-review-title": true, children: compare ? "Compare drafts" : active.title })
|
|
7250
7316
|
] }),
|
|
7251
7317
|
/* @__PURE__ */ jsxs22("div", { className: "flex gap-2", children: [
|
|
7252
|
-
/* @__PURE__ */
|
|
7253
|
-
/* @__PURE__ */
|
|
7318
|
+
/* @__PURE__ */ jsx24(Button5, { variant: "outline", "aria-keyshortcuts": "K", disabled: busy || unanswered.length < 2, onClick: () => navigate(-1), children: "Previous" }),
|
|
7319
|
+
/* @__PURE__ */ jsx24(Button5, { variant: "outline", "aria-keyshortcuts": "J", disabled: busy || unanswered.length < 2, onClick: () => navigate(1), children: "Next" })
|
|
7254
7320
|
] })
|
|
7255
7321
|
] }),
|
|
7256
7322
|
compare ? /* @__PURE__ */ jsxs22(Fragment8, { children: [
|
|
7257
|
-
renderCompareBrief && /* @__PURE__ */
|
|
7258
|
-
!compareValid && /* @__PURE__ */
|
|
7259
|
-
/* @__PURE__ */
|
|
7323
|
+
renderCompareBrief && /* @__PURE__ */ jsx24("div", { "data-review-compare-brief": true, children: renderCompareBrief(compare.rowId) }),
|
|
7324
|
+
!compareValid && /* @__PURE__ */ jsx24("p", { role: "alert", children: "This comparison changed. Refresh the inbox before reviewing it." }),
|
|
7325
|
+
/* @__PURE__ */ jsx24("div", { className: "grid min-w-0 grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3", "data-review-compare-row": true, children: compareItems.map((item, index) => {
|
|
7260
7326
|
const key = revisionKey(item);
|
|
7261
7327
|
const done = isAnswered(item);
|
|
7262
7328
|
const present = currentItems.has(item.id);
|
|
@@ -7274,9 +7340,9 @@ function ReviewInbox({ items, initialSelectedId, renderItem, renderCompareBrief,
|
|
|
7274
7340
|
"Draft ",
|
|
7275
7341
|
index + 1
|
|
7276
7342
|
] }),
|
|
7277
|
-
/* @__PURE__ */
|
|
7278
|
-
present && !done && !item.canReview && /* @__PURE__ */
|
|
7279
|
-
done ? /* @__PURE__ */
|
|
7343
|
+
/* @__PURE__ */ jsx24("div", { className: "min-w-0", "data-review-content": true, children: renderItem(item) }),
|
|
7344
|
+
present && !done && !item.canReview && /* @__PURE__ */ jsx24("p", { className: "text-sm text-muted-foreground", children: "You do not have permission to review this item." }),
|
|
7345
|
+
done ? /* @__PURE__ */ jsx24("p", { role: "status", children: "Review saved" }) : !present ? /* @__PURE__ */ jsx24("p", { role: "status", children: "This draft is no longer waiting." }) : /* @__PURE__ */ jsx24(
|
|
7280
7346
|
ReviewFeedbackForm,
|
|
7281
7347
|
{
|
|
7282
7348
|
draftKey: key,
|
|
@@ -7297,9 +7363,9 @@ function ReviewInbox({ items, initialSelectedId, renderItem, renderCompareBrief,
|
|
|
7297
7363
|
);
|
|
7298
7364
|
}) })
|
|
7299
7365
|
] }) : /* @__PURE__ */ jsxs22(Fragment8, { children: [
|
|
7300
|
-
available && !active.canReview && /* @__PURE__ */
|
|
7301
|
-
/* @__PURE__ */
|
|
7302
|
-
/* @__PURE__ */
|
|
7366
|
+
available && !active.canReview && /* @__PURE__ */ jsx24("p", { className: "text-sm text-muted-foreground", children: "You do not have permission to review this item." }),
|
|
7367
|
+
/* @__PURE__ */ jsx24("div", { className: "min-w-0", "data-review-content": true, children: renderItem(active) }),
|
|
7368
|
+
/* @__PURE__ */ jsx24(
|
|
7303
7369
|
ReviewFeedbackForm,
|
|
7304
7370
|
{
|
|
7305
7371
|
ref: form,
|
|
@@ -7317,7 +7383,7 @@ function ReviewInbox({ items, initialSelectedId, renderItem, renderCompareBrief,
|
|
|
7317
7383
|
currentKey
|
|
7318
7384
|
)
|
|
7319
7385
|
] }),
|
|
7320
|
-
!compare && /* @__PURE__ */
|
|
7386
|
+
!compare && /* @__PURE__ */ jsx24("p", { className: "text-xs leading-5 text-muted-foreground", children: "A approve \xB7 R request changes \xB7 S score \xB7 J/K next/previous \xB7 Esc leave a field. Shortcuts pause while typing." })
|
|
7321
7387
|
] })
|
|
7322
7388
|
]
|
|
7323
7389
|
}
|
|
@@ -7339,48 +7405,48 @@ function formatTokensPerSecond(msg) {
|
|
|
7339
7405
|
}
|
|
7340
7406
|
|
|
7341
7407
|
// src/web-react/run-drill-in.tsx
|
|
7342
|
-
import { jsx as
|
|
7408
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
7343
7409
|
function RunDrillIn({ run, onClose }) {
|
|
7344
7410
|
return /* @__PURE__ */ jsxs23("div", { className: `fixed inset-y-0 right-0 z-50 flex w-[480px] max-w-full flex-col border-l border-card-edge bg-popover ${OVERLAY_SHADOW}`, children: [
|
|
7345
7411
|
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
|
|
7346
|
-
/* @__PURE__ */
|
|
7412
|
+
/* @__PURE__ */ jsx25(
|
|
7347
7413
|
"span",
|
|
7348
7414
|
{
|
|
7349
7415
|
className: `h-2 w-2 shrink-0 rounded-full ${run.status === "running" ? "bg-warning" : run.status === "error" ? "bg-destructive" : "bg-success"}`
|
|
7350
7416
|
}
|
|
7351
7417
|
),
|
|
7352
7418
|
/* @__PURE__ */ jsxs23("div", { className: "min-w-0 flex-1", children: [
|
|
7353
|
-
/* @__PURE__ */
|
|
7354
|
-
/* @__PURE__ */
|
|
7419
|
+
/* @__PURE__ */ jsx25("p", { className: "truncate text-[15px] font-semibold", children: run.title }),
|
|
7420
|
+
/* @__PURE__ */ jsx25("p", { className: "truncate font-mono text-xs text-muted-foreground", children: run.toolName })
|
|
7355
7421
|
] }),
|
|
7356
|
-
/* @__PURE__ */
|
|
7422
|
+
/* @__PURE__ */ jsx25(
|
|
7357
7423
|
"button",
|
|
7358
7424
|
{
|
|
7359
7425
|
type: "button",
|
|
7360
7426
|
onClick: onClose,
|
|
7361
7427
|
"aria-label": "Close",
|
|
7362
7428
|
className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
|
|
7363
|
-
children: /* @__PURE__ */
|
|
7429
|
+
children: /* @__PURE__ */ jsx25("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx25("path", { d: "M18 6 6 18M6 6l12 12" }) })
|
|
7364
7430
|
}
|
|
7365
7431
|
)
|
|
7366
7432
|
] }),
|
|
7367
7433
|
/* @__PURE__ */ jsxs23("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
|
|
7368
|
-
run.steps.length === 0 && /* @__PURE__ */
|
|
7434
|
+
run.steps.length === 0 && /* @__PURE__ */ jsx25("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
|
|
7369
7435
|
run.steps.map((step, i) => /* @__PURE__ */ jsxs23("div", { className: "rounded-lg border border-card-edge bg-card", children: [
|
|
7370
7436
|
/* @__PURE__ */ jsxs23("div", { className: "flex items-baseline gap-2 border-b border-border px-3 py-1.5", children: [
|
|
7371
|
-
/* @__PURE__ */
|
|
7372
|
-
/* @__PURE__ */
|
|
7373
|
-
/* @__PURE__ */
|
|
7437
|
+
/* @__PURE__ */ jsx25("span", { className: `font-mono text-xs ${step.status === "error" ? "text-destructive" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
|
|
7438
|
+
/* @__PURE__ */ jsx25("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
|
|
7439
|
+
/* @__PURE__ */ jsx25("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: new Date(step.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) })
|
|
7374
7440
|
] }),
|
|
7375
|
-
step.detail && /* @__PURE__ */
|
|
7441
|
+
step.detail && /* @__PURE__ */ jsx25("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap px-3 py-2 font-mono text-xs leading-relaxed text-muted-foreground", children: step.detail })
|
|
7376
7442
|
] }, i))
|
|
7377
7443
|
] }),
|
|
7378
|
-
/* @__PURE__ */
|
|
7444
|
+
/* @__PURE__ */ jsx25("p", { className: "border-t border-border px-4 py-2 text-xs text-muted-foreground", children: "Read-only transcript \u2014 reply in the main chat." })
|
|
7379
7445
|
] });
|
|
7380
7446
|
}
|
|
7381
7447
|
|
|
7382
7448
|
// src/web-react/chat-empty-state.tsx
|
|
7383
|
-
import { jsx as
|
|
7449
|
+
import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
7384
7450
|
function ChatEmptyState({
|
|
7385
7451
|
productName = "Agent",
|
|
7386
7452
|
headline = "Ask the agent to do something",
|
|
@@ -7390,11 +7456,11 @@ function ChatEmptyState({
|
|
|
7390
7456
|
const doorCount = Math.min(doors?.length ?? 0, 3);
|
|
7391
7457
|
const doorsGridClass = doorCount === 1 ? "mx-auto max-w-sm sm:grid-cols-1" : doorCount === 2 ? "sm:grid-cols-2" : "sm:grid-cols-3";
|
|
7392
7458
|
return /* @__PURE__ */ jsxs24("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center px-6 py-12 text-center sm:py-20", children: [
|
|
7393
|
-
/* @__PURE__ */
|
|
7394
|
-
/* @__PURE__ */
|
|
7395
|
-
/* @__PURE__ */
|
|
7396
|
-
subline && /* @__PURE__ */
|
|
7397
|
-
doors && doors.length > 0 && /* @__PURE__ */
|
|
7459
|
+
/* @__PURE__ */ jsx26("span", { className: "mb-5 inline-flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10 ring-1 ring-primary/15", children: /* @__PURE__ */ jsx26(BrandMark, { size: 32, className: "shrink-0" }) }),
|
|
7460
|
+
/* @__PURE__ */ jsx26("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: productName }),
|
|
7461
|
+
/* @__PURE__ */ jsx26("h2", { className: "mt-1.5 text-balance text-2xl font-semibold leading-tight text-foreground", children: headline }),
|
|
7462
|
+
subline && /* @__PURE__ */ jsx26("p", { className: "mt-3 max-w-md text-[15px] leading-relaxed text-muted-foreground", children: subline }),
|
|
7463
|
+
doors && doors.length > 0 && /* @__PURE__ */ jsx26("div", { className: `mt-7 grid w-full gap-2.5 ${doorsGridClass}`, children: doors.slice(0, 3).map((door, i) => /* @__PURE__ */ jsxs24(
|
|
7398
7464
|
"button",
|
|
7399
7465
|
{
|
|
7400
7466
|
type: "button",
|
|
@@ -7405,7 +7471,7 @@ function ChatEmptyState({
|
|
|
7405
7471
|
door.icon,
|
|
7406
7472
|
door.label
|
|
7407
7473
|
] }),
|
|
7408
|
-
door.description && /* @__PURE__ */
|
|
7474
|
+
door.description && /* @__PURE__ */ jsx26("span", { className: "mt-0.5 text-[12px] leading-snug text-muted-foreground", children: door.description })
|
|
7409
7475
|
]
|
|
7410
7476
|
},
|
|
7411
7477
|
i
|
|
@@ -7417,7 +7483,7 @@ function ChatEmptyState({
|
|
|
7417
7483
|
import { useState as useState25 } from "react";
|
|
7418
7484
|
import { TerminalDisplay, TerminalLine } from "@tangle-network/ui/primitives";
|
|
7419
7485
|
import { InlineToolItem } from "@tangle-network/ui/run";
|
|
7420
|
-
import { Fragment as Fragment9, jsx as
|
|
7486
|
+
import { Fragment as Fragment9, jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
7421
7487
|
function resolveToolPresentation(rendered) {
|
|
7422
7488
|
if (typeof rendered === "object" && rendered !== null) {
|
|
7423
7489
|
const presentation = rendered;
|
|
@@ -7433,25 +7499,25 @@ function pendingApprovalOf(call) {
|
|
|
7433
7499
|
function ToolGlyph({ name, className }) {
|
|
7434
7500
|
if (name.startsWith("sandbox_")) {
|
|
7435
7501
|
return /* @__PURE__ */ jsxs25("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
7436
|
-
/* @__PURE__ */
|
|
7437
|
-
/* @__PURE__ */
|
|
7502
|
+
/* @__PURE__ */ jsx27("polyline", { points: "4 17 10 11 4 5" }),
|
|
7503
|
+
/* @__PURE__ */ jsx27("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
7438
7504
|
] });
|
|
7439
7505
|
}
|
|
7440
7506
|
if (name === "submit_proposal") {
|
|
7441
7507
|
return /* @__PURE__ */ jsxs25("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
7442
|
-
/* @__PURE__ */
|
|
7443
|
-
/* @__PURE__ */
|
|
7508
|
+
/* @__PURE__ */ jsx27("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
7509
|
+
/* @__PURE__ */ jsx27("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
|
|
7444
7510
|
] });
|
|
7445
7511
|
}
|
|
7446
7512
|
if (name === "schedule_followup") {
|
|
7447
7513
|
return /* @__PURE__ */ jsxs25("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
|
|
7448
|
-
/* @__PURE__ */
|
|
7449
|
-
/* @__PURE__ */
|
|
7514
|
+
/* @__PURE__ */ jsx27("circle", { cx: "12", cy: "12", r: "9" }),
|
|
7515
|
+
/* @__PURE__ */ jsx27("path", { d: "M12 7v5l3 3" })
|
|
7450
7516
|
] });
|
|
7451
7517
|
}
|
|
7452
7518
|
return /* @__PURE__ */ jsxs25("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
7453
|
-
/* @__PURE__ */
|
|
7454
|
-
/* @__PURE__ */
|
|
7519
|
+
/* @__PURE__ */ jsx27("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
|
|
7520
|
+
/* @__PURE__ */ jsx27("circle", { cx: "12", cy: "12", r: "4" })
|
|
7455
7521
|
] });
|
|
7456
7522
|
}
|
|
7457
7523
|
function toolOutcomeOf(call) {
|
|
@@ -7537,21 +7603,21 @@ function truncate(v, max = 240) {
|
|
|
7537
7603
|
function KvRows({ data }) {
|
|
7538
7604
|
const entries = Object.entries(data).filter(([, v]) => v !== void 0 && v !== null && v !== "");
|
|
7539
7605
|
if (!entries.length) return null;
|
|
7540
|
-
return /* @__PURE__ */
|
|
7541
|
-
/* @__PURE__ */
|
|
7542
|
-
/* @__PURE__ */
|
|
7606
|
+
return /* @__PURE__ */ jsx27("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs25("div", { className: "contents", children: [
|
|
7607
|
+
/* @__PURE__ */ jsx27("dt", { className: "font-mono text-xs text-muted-foreground", children: k }),
|
|
7608
|
+
/* @__PURE__ */ jsx27("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground", children: truncate(v) })
|
|
7543
7609
|
] }, k)) });
|
|
7544
7610
|
}
|
|
7545
7611
|
function ShellDetail({ call }) {
|
|
7546
7612
|
const outcome = toolOutcomeOf(call);
|
|
7547
7613
|
const r = outcome?.result ?? {};
|
|
7548
7614
|
return /* @__PURE__ */ jsxs25(TerminalDisplay, { showHeader: false, autoScroll: false, maxHeight: "14rem", className: "text-xs", children: [
|
|
7549
|
-
/* @__PURE__ */
|
|
7615
|
+
/* @__PURE__ */ jsx27(TerminalLine, { type: "command", children: String(call.args?.command ?? "") }),
|
|
7550
7616
|
r.exitCode != null && /* @__PURE__ */ jsxs25(TerminalLine, { type: r.exitCode === 0 ? "success" : "error", children: [
|
|
7551
7617
|
"exit ",
|
|
7552
7618
|
r.exitCode
|
|
7553
7619
|
] }),
|
|
7554
|
-
/* @__PURE__ */
|
|
7620
|
+
/* @__PURE__ */ jsx27(TerminalLine, { type: outcome?.ok === false ? "error" : "output", children: outcome?.ok === false ? outcome.message ?? "failed" : [r.stdout, r.stderr].filter(Boolean).join("\n") || "(no output)" })
|
|
7555
7621
|
] });
|
|
7556
7622
|
}
|
|
7557
7623
|
function DefaultToolDetail({ call }) {
|
|
@@ -7559,15 +7625,15 @@ function DefaultToolDetail({ call }) {
|
|
|
7559
7625
|
const envelope = typeof result === "object" && result !== null ? result : null;
|
|
7560
7626
|
return /* @__PURE__ */ jsxs25("div", { className: "space-y-2", children: [
|
|
7561
7627
|
call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs25("div", { children: [
|
|
7562
|
-
/* @__PURE__ */
|
|
7563
|
-
/* @__PURE__ */
|
|
7628
|
+
/* @__PURE__ */ jsx27("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Called with" }),
|
|
7629
|
+
/* @__PURE__ */ jsx27(KvRows, { data: call.args })
|
|
7564
7630
|
] }),
|
|
7565
7631
|
envelope ? /* @__PURE__ */ jsxs25("div", { children: [
|
|
7566
|
-
/* @__PURE__ */
|
|
7567
|
-
envelope.ok === false ? /* @__PURE__ */
|
|
7632
|
+
/* @__PURE__ */ jsx27("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: envelope.ok === false ? "Failed" : "Result" }),
|
|
7633
|
+
envelope.ok === false ? /* @__PURE__ */ jsx27("p", { className: "text-xs text-destructive", children: envelope.message ?? "Tool failed" }) : envelope.result && typeof envelope.result === "object" ? /* @__PURE__ */ jsx27(KvRows, { data: envelope.result }) : envelope.result != null ? /* @__PURE__ */ jsx27("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(envelope.result) }) : null
|
|
7568
7634
|
] }) : result != null ? /* @__PURE__ */ jsxs25("div", { children: [
|
|
7569
|
-
/* @__PURE__ */
|
|
7570
|
-
/* @__PURE__ */
|
|
7635
|
+
/* @__PURE__ */ jsx27("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Result" }),
|
|
7636
|
+
/* @__PURE__ */ jsx27("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(result) })
|
|
7571
7637
|
] }) : null
|
|
7572
7638
|
] });
|
|
7573
7639
|
}
|
|
@@ -7584,18 +7650,18 @@ function ProposalCard({
|
|
|
7584
7650
|
const { pending: deciding, run: decide } = usePending();
|
|
7585
7651
|
return /* @__PURE__ */ jsxs25("div", { className: "w-full max-w-full rounded-xl border border-warning/50 bg-warning/[0.06] text-sm shadow-sm ring-1 ring-warning/10", children: [
|
|
7586
7652
|
/* @__PURE__ */ jsxs25("div", { className: "flex items-start gap-2.5 px-4 pt-3.5", children: [
|
|
7587
|
-
/* @__PURE__ */
|
|
7653
|
+
/* @__PURE__ */ jsx27("span", { className: "mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-warning/15 text-warning", children: /* @__PURE__ */ jsx27(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
|
|
7588
7654
|
/* @__PURE__ */ jsxs25("div", { className: "min-w-0 flex-1", children: [
|
|
7589
|
-
/* @__PURE__ */
|
|
7590
|
-
/* @__PURE__ */
|
|
7591
|
-
summary && /* @__PURE__ */
|
|
7592
|
-
typeSlug && /* @__PURE__ */
|
|
7593
|
-
meta.length > 0 && /* @__PURE__ */
|
|
7655
|
+
/* @__PURE__ */ jsx27("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-warning-strong", children: approval ? "Needs your approval" : "Awaiting approval" }),
|
|
7656
|
+
/* @__PURE__ */ jsx27("p", { className: "mt-0.5 text-[15px] font-semibold leading-snug text-foreground", children: friendlyToolTitle(call) }),
|
|
7657
|
+
summary && /* @__PURE__ */ jsx27("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: summary }),
|
|
7658
|
+
typeSlug && /* @__PURE__ */ jsx27("p", { className: "mt-1 font-mono text-xs text-muted-foreground", children: typeSlug }),
|
|
7659
|
+
meta.length > 0 && /* @__PURE__ */ jsx27("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: meta.map((m, i) => /* @__PURE__ */ jsx27("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground", children: m }, i)) })
|
|
7594
7660
|
] })
|
|
7595
7661
|
] }),
|
|
7596
7662
|
/* @__PURE__ */ jsxs25("div", { className: "flex flex-wrap items-center gap-2 px-4 pb-3.5 pt-3", children: [
|
|
7597
7663
|
approval && /* @__PURE__ */ jsxs25(Fragment9, { children: [
|
|
7598
|
-
/* @__PURE__ */
|
|
7664
|
+
/* @__PURE__ */ jsx27(
|
|
7599
7665
|
"button",
|
|
7600
7666
|
{
|
|
7601
7667
|
type: "button",
|
|
@@ -7605,7 +7671,7 @@ function ProposalCard({
|
|
|
7605
7671
|
children: "Approve & run"
|
|
7606
7672
|
}
|
|
7607
7673
|
),
|
|
7608
|
-
/* @__PURE__ */
|
|
7674
|
+
/* @__PURE__ */ jsx27(
|
|
7609
7675
|
"button",
|
|
7610
7676
|
{
|
|
7611
7677
|
type: "button",
|
|
@@ -7625,12 +7691,12 @@ function ProposalCard({
|
|
|
7625
7691
|
className: "ml-auto inline-flex items-center gap-1 rounded text-[12px] font-medium text-muted-foreground transition hover:text-foreground",
|
|
7626
7692
|
children: [
|
|
7627
7693
|
expanded ? "Hide details" : "View details",
|
|
7628
|
-
/* @__PURE__ */
|
|
7694
|
+
/* @__PURE__ */ jsx27(ChevronDown, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` })
|
|
7629
7695
|
]
|
|
7630
7696
|
}
|
|
7631
7697
|
)
|
|
7632
7698
|
] }),
|
|
7633
|
-
expanded && /* @__PURE__ */
|
|
7699
|
+
expanded && /* @__PURE__ */ jsx27("div", { className: "border-t border-warning/20 px-4 py-3 text-xs", children: custom ?? /* @__PURE__ */ jsx27(DefaultToolDetail, { call }) })
|
|
7634
7700
|
] });
|
|
7635
7701
|
}
|
|
7636
7702
|
function formatFollowupWhen(when) {
|
|
@@ -7645,14 +7711,14 @@ function FollowupCard({ call }) {
|
|
|
7645
7711
|
const when = typeof a.when === "string" ? a.when : typeof a.at === "string" ? a.at : typeof a.schedule === "string" ? a.schedule : null;
|
|
7646
7712
|
const failed = toolCallFailed(call);
|
|
7647
7713
|
const errorText = failed ? toolOutcomeOf(call)?.message ?? "Scheduling failed" : null;
|
|
7648
|
-
return /* @__PURE__ */
|
|
7714
|
+
return /* @__PURE__ */ jsx27("div", { className: "flex items-start gap-2", children: /* @__PURE__ */ jsxs25("div", { className: "min-w-0 flex-1 overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)]", children: [
|
|
7649
7715
|
/* @__PURE__ */ jsxs25("div", { className: "flex w-full items-center gap-2.5 px-3 py-2", children: [
|
|
7650
|
-
/* @__PURE__ */
|
|
7651
|
-
/* @__PURE__ */
|
|
7652
|
-
when && /* @__PURE__ */
|
|
7653
|
-
/* @__PURE__ */
|
|
7716
|
+
/* @__PURE__ */ jsx27("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-[var(--radius-sm)] border border-border bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx27(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
|
|
7717
|
+
/* @__PURE__ */ jsx27("span", { className: "shrink-0 whitespace-nowrap text-xs font-medium text-foreground", children: friendlyToolTitle(call) }),
|
|
7718
|
+
when && /* @__PURE__ */ jsx27("span", { title: when, className: "hidden min-w-0 flex-1 truncate font-mono text-xs tabular-nums text-muted-foreground sm:inline", children: formatFollowupWhen(when) }),
|
|
7719
|
+
/* @__PURE__ */ jsx27("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: call.status === "running" ? /* @__PURE__ */ jsx27("svg", { className: "h-3 w-3 shrink-0 animate-spin text-[var(--accent-text)]", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx27("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }) : /* @__PURE__ */ jsx27("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${failed ? "bg-[var(--surface-danger-text)]" : "bg-[var(--surface-success-text)]"}` }) })
|
|
7654
7720
|
] }),
|
|
7655
|
-
errorText && /* @__PURE__ */
|
|
7721
|
+
errorText && /* @__PURE__ */ jsx27("div", { className: "border-t border-border px-3 py-2 text-xs text-[var(--surface-danger-text)]", children: errorText })
|
|
7656
7722
|
] }) });
|
|
7657
7723
|
}
|
|
7658
7724
|
function toolRowTitle(call) {
|
|
@@ -7675,10 +7741,10 @@ function ToolCallCard({
|
|
|
7675
7741
|
const arrival = useArrivalStyle(staggerIndex ?? 0);
|
|
7676
7742
|
const pending = call.status === "done" ? pendingApprovalOf(call) : null;
|
|
7677
7743
|
const kind = blockKindOf(call);
|
|
7678
|
-
const arrive = (row) => /* @__PURE__ */
|
|
7744
|
+
const arrive = (row) => /* @__PURE__ */ jsx27("div", { className: "agent-arrive", style: arrival, children: row });
|
|
7679
7745
|
if (pending) {
|
|
7680
7746
|
return arrive(
|
|
7681
|
-
/* @__PURE__ */
|
|
7747
|
+
/* @__PURE__ */ jsx27(
|
|
7682
7748
|
ProposalCard,
|
|
7683
7749
|
{
|
|
7684
7750
|
call,
|
|
@@ -7691,18 +7757,18 @@ function ToolCallCard({
|
|
|
7691
7757
|
);
|
|
7692
7758
|
}
|
|
7693
7759
|
if (kind === "followup") {
|
|
7694
|
-
return arrive(/* @__PURE__ */
|
|
7760
|
+
return arrive(/* @__PURE__ */ jsx27(FollowupCard, { call }));
|
|
7695
7761
|
}
|
|
7696
7762
|
const custom = resolveToolPresentation(renderers?.[call.name]?.(call, message));
|
|
7697
7763
|
return arrive(
|
|
7698
|
-
/* @__PURE__ */
|
|
7764
|
+
/* @__PURE__ */ jsx27(
|
|
7699
7765
|
InlineToolItem,
|
|
7700
7766
|
{
|
|
7701
7767
|
part: chatToolCallPart(call),
|
|
7702
7768
|
title: custom.title ?? toolRowTitle(call),
|
|
7703
7769
|
description: custom.description ?? toolRowDescription(call),
|
|
7704
|
-
renderToolDetail: () => custom.detail ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */
|
|
7705
|
-
actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */
|
|
7770
|
+
renderToolDetail: () => custom.detail ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx27(ShellDetail, { call }) : /* @__PURE__ */ jsx27(DefaultToolDetail, { call })),
|
|
7771
|
+
actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */ jsx27(
|
|
7706
7772
|
"button",
|
|
7707
7773
|
{
|
|
7708
7774
|
type: "button",
|
|
@@ -7711,8 +7777,8 @@ function ToolCallCard({
|
|
|
7711
7777
|
title: "Open full transcript",
|
|
7712
7778
|
className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
|
|
7713
7779
|
children: /* @__PURE__ */ jsxs25("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
7714
|
-
/* @__PURE__ */
|
|
7715
|
-
/* @__PURE__ */
|
|
7780
|
+
/* @__PURE__ */ jsx27("path", { d: "M7 17 17 7" }),
|
|
7781
|
+
/* @__PURE__ */ jsx27("path", { d: "M7 7h10v10" })
|
|
7716
7782
|
] })
|
|
7717
7783
|
}
|
|
7718
7784
|
) : void 0
|
|
@@ -7722,14 +7788,14 @@ function ToolCallCard({
|
|
|
7722
7788
|
}
|
|
7723
7789
|
|
|
7724
7790
|
// src/web-react/chat-messages.tsx
|
|
7725
|
-
import { useEffect as useEffect18, useMemo as useMemo11, useRef as
|
|
7791
|
+
import { useEffect as useEffect18, useMemo as useMemo11, useRef as useRef19, useState as useState26, memo } from "react";
|
|
7726
7792
|
import { isViewerMessage, MessageAuthor, partitionBySpeaker, SpeakerHeader, TRANSCRIPT_TEXT } from "@tangle-network/ui/chat";
|
|
7727
7793
|
|
|
7728
7794
|
// src/web-react/chat-message-body.tsx
|
|
7729
7795
|
import { useMemo as useMemo10 } from "react";
|
|
7730
|
-
import { jsx as
|
|
7796
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
7731
7797
|
function StreamingCaret() {
|
|
7732
|
-
return /* @__PURE__ */
|
|
7798
|
+
return /* @__PURE__ */ jsx28(
|
|
7733
7799
|
"span",
|
|
7734
7800
|
{
|
|
7735
7801
|
className: "ml-0.5 inline-block h-[1.1em] w-[3px] translate-y-[2px] animate-[agent-caret_1s_step-end_infinite] rounded-sm bg-foreground/70",
|
|
@@ -7756,7 +7822,7 @@ function SegmentText({
|
|
|
7756
7822
|
// log was appended to".
|
|
7757
7823
|
/* @__PURE__ */ jsxs26("div", { className: `${messageClassName}${streaming ? "" : " agent-stream-in"}`, children: [
|
|
7758
7824
|
body,
|
|
7759
|
-
showCaret && /* @__PURE__ */
|
|
7825
|
+
showCaret && /* @__PURE__ */ jsx28(StreamingCaret, {})
|
|
7760
7826
|
] })
|
|
7761
7827
|
);
|
|
7762
7828
|
}
|
|
@@ -7782,7 +7848,7 @@ function SegmentedBody({
|
|
|
7782
7848
|
const leftoverToolCalls = (msg.toolCalls ?? []).filter(
|
|
7783
7849
|
(tc) => !segmentToolIds.has(tc.id)
|
|
7784
7850
|
);
|
|
7785
|
-
const renderToolCard = (call, index) => /* @__PURE__ */
|
|
7851
|
+
const renderToolCard = (call, index) => /* @__PURE__ */ jsx28(
|
|
7786
7852
|
ToolCallCard,
|
|
7787
7853
|
{
|
|
7788
7854
|
call,
|
|
@@ -7811,12 +7877,12 @@ function SegmentedBody({
|
|
|
7811
7877
|
const children = [];
|
|
7812
7878
|
for (const g of groups) {
|
|
7813
7879
|
if (g.kind === "notice") {
|
|
7814
|
-
children.push(/* @__PURE__ */
|
|
7880
|
+
children.push(/* @__PURE__ */ jsx28(SegmentNotice, { tone: g.tone, content: g.content }, `notice-${g.index}`));
|
|
7815
7881
|
continue;
|
|
7816
7882
|
}
|
|
7817
7883
|
if (g.kind === "text") {
|
|
7818
7884
|
children.push(
|
|
7819
|
-
/* @__PURE__ */
|
|
7885
|
+
/* @__PURE__ */ jsx28(
|
|
7820
7886
|
SegmentText,
|
|
7821
7887
|
{
|
|
7822
7888
|
content: g.content,
|
|
@@ -7838,7 +7904,7 @@ function SegmentedBody({
|
|
|
7838
7904
|
g.calls.length,
|
|
7839
7905
|
" steps"
|
|
7840
7906
|
] }),
|
|
7841
|
-
/* @__PURE__ */
|
|
7907
|
+
/* @__PURE__ */ jsx28("div", { className: "mt-1.5 flex flex-col gap-1.5", children: g.calls.map(renderToolCard) })
|
|
7842
7908
|
] }, `tools-fold-${g.index}`)
|
|
7843
7909
|
);
|
|
7844
7910
|
continue;
|
|
@@ -7847,9 +7913,9 @@ function SegmentedBody({
|
|
|
7847
7913
|
}
|
|
7848
7914
|
leftoverToolCalls.forEach((call, index) => children.push(renderToolCard(call, index)));
|
|
7849
7915
|
if (showCaret && streaming && segments[lastIndex]?.kind === "tool") {
|
|
7850
|
-
children.push(/* @__PURE__ */
|
|
7916
|
+
children.push(/* @__PURE__ */ jsx28(StreamingCaret, {}, "streaming-caret"));
|
|
7851
7917
|
}
|
|
7852
|
-
return /* @__PURE__ */
|
|
7918
|
+
return /* @__PURE__ */ jsx28("div", { className: "flex flex-col gap-2", children });
|
|
7853
7919
|
}
|
|
7854
7920
|
var NOTICE_TONE_CLASS = {
|
|
7855
7921
|
error: "border-destructive/40 bg-destructive/5 text-destructive",
|
|
@@ -7863,17 +7929,17 @@ function SegmentNotice({ tone, content }) {
|
|
|
7863
7929
|
className: `flex items-start gap-2.5 rounded-lg border px-3 py-2.5 text-sm ${NOTICE_TONE_CLASS[tone]}`,
|
|
7864
7930
|
children: [
|
|
7865
7931
|
/* @__PURE__ */ jsxs26("svg", { className: "mt-0.5 h-4 w-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
7866
|
-
/* @__PURE__ */
|
|
7867
|
-
/* @__PURE__ */
|
|
7932
|
+
/* @__PURE__ */ jsx28("circle", { cx: "12", cy: "12", r: "9" }),
|
|
7933
|
+
/* @__PURE__ */ jsx28("path", { d: "M12 8v4m0 4h.01" })
|
|
7868
7934
|
] }),
|
|
7869
|
-
/* @__PURE__ */
|
|
7935
|
+
/* @__PURE__ */ jsx28("span", { className: "min-w-0 flex-1 whitespace-pre-wrap break-words", children: content })
|
|
7870
7936
|
]
|
|
7871
7937
|
}
|
|
7872
7938
|
);
|
|
7873
7939
|
}
|
|
7874
7940
|
|
|
7875
7941
|
// src/web-react/chat-messages.tsx
|
|
7876
|
-
import { Fragment as Fragment10, jsx as
|
|
7942
|
+
import { Fragment as Fragment10, jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7877
7943
|
function splitBySpeaker(rows) {
|
|
7878
7944
|
return rows.flatMap((row) => {
|
|
7879
7945
|
const sections = row.role === "assistant" && row.parts ? partitionBySpeaker(row.parts) : [];
|
|
@@ -7905,7 +7971,7 @@ function copyTextOf(msg) {
|
|
|
7905
7971
|
}
|
|
7906
7972
|
function CopyMessageButton({ text }) {
|
|
7907
7973
|
const [copied, setCopied] = useState26(false);
|
|
7908
|
-
const timerRef =
|
|
7974
|
+
const timerRef = useRef19(null);
|
|
7909
7975
|
useEffect18(
|
|
7910
7976
|
() => () => {
|
|
7911
7977
|
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
@@ -7925,7 +7991,7 @@ function CopyMessageButton({ text }) {
|
|
|
7925
7991
|
}
|
|
7926
7992
|
);
|
|
7927
7993
|
};
|
|
7928
|
-
return /* @__PURE__ */
|
|
7994
|
+
return /* @__PURE__ */ jsx29(
|
|
7929
7995
|
"button",
|
|
7930
7996
|
{
|
|
7931
7997
|
type: "button",
|
|
@@ -7933,9 +7999,9 @@ function CopyMessageButton({ text }) {
|
|
|
7933
7999
|
"aria-label": "Copy message",
|
|
7934
8000
|
title: "Copy message",
|
|
7935
8001
|
className: "rounded p-0.5 text-muted-foreground transition hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
7936
|
-
children: copied ? /* @__PURE__ */
|
|
7937
|
-
/* @__PURE__ */
|
|
7938
|
-
/* @__PURE__ */
|
|
8002
|
+
children: copied ? /* @__PURE__ */ jsx29("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx29("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs27("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
8003
|
+
/* @__PURE__ */ jsx29("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
8004
|
+
/* @__PURE__ */ jsx29("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
7939
8005
|
] })
|
|
7940
8006
|
}
|
|
7941
8007
|
);
|
|
@@ -7965,7 +8031,7 @@ function AssistantMessageImpl({
|
|
|
7965
8031
|
const answerScroll = useChatScroll();
|
|
7966
8032
|
const quiet = chrome === "quiet";
|
|
7967
8033
|
const authorClassName = quiet ? "mb-1.5" : void 0;
|
|
7968
|
-
const author = msg.speaker ? /* @__PURE__ */
|
|
8034
|
+
const author = msg.speaker ? /* @__PURE__ */ jsx29(SpeakerHeader, { speaker: msg.speaker, live: streaming, className: authorClassName }) : msg.author ? /* @__PURE__ */ jsx29(MessageAuthor, { author: msg.author, className: authorClassName }) : null;
|
|
7969
8035
|
return /* @__PURE__ */ jsxs27("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
|
|
7970
8036
|
quiet && author,
|
|
7971
8037
|
!quiet && /* @__PURE__ */ jsxs27(
|
|
@@ -7973,15 +8039,15 @@ function AssistantMessageImpl({
|
|
|
7973
8039
|
{
|
|
7974
8040
|
className: `mb-1 flex ${author ? "items-center" : "items-baseline"} gap-2 text-xs tabular-nums text-muted-foreground`,
|
|
7975
8041
|
children: [
|
|
7976
|
-
author ?? /* @__PURE__ */
|
|
7977
|
-
msg.modelUsed && /* @__PURE__ */
|
|
7978
|
-
formatTokensPerSecond(msg) && /* @__PURE__ */
|
|
7979
|
-
formatModelCost(msg, models) && /* @__PURE__ */
|
|
8042
|
+
author ?? /* @__PURE__ */ jsx29("span", { className: "font-semibold uppercase tracking-[0.05em]", children: agentLabel }),
|
|
8043
|
+
msg.modelUsed && /* @__PURE__ */ jsx29("span", { className: "font-mono normal-case", children: msg.modelUsed }),
|
|
8044
|
+
formatTokensPerSecond(msg) && /* @__PURE__ */ jsx29("span", { children: formatTokensPerSecond(msg) }),
|
|
8045
|
+
formatModelCost(msg, models) && /* @__PURE__ */ jsx29("span", { children: formatModelCost(msg, models) })
|
|
7980
8046
|
]
|
|
7981
8047
|
}
|
|
7982
8048
|
),
|
|
7983
|
-
/* @__PURE__ */
|
|
7984
|
-
/* @__PURE__ */
|
|
8049
|
+
/* @__PURE__ */ jsx29("div", { ref: msg.speaker ? answerScroll.viewportRef : void 0, className: msg.speaker ? "agent-speaker-answer" : void 0, tabIndex: msg.speaker ? 0 : void 0, role: msg.speaker ? "region" : void 0, "aria-label": msg.speaker ? `Answer from ${msg.speaker.name}` : void 0, children: /* @__PURE__ */ jsxs27("div", { ref: msg.speaker ? answerScroll.contentRef : void 0, children: [
|
|
8050
|
+
/* @__PURE__ */ jsx29(
|
|
7985
8051
|
ReasoningRow,
|
|
7986
8052
|
{
|
|
7987
8053
|
className: "mb-2",
|
|
@@ -7991,7 +8057,7 @@ function AssistantMessageImpl({
|
|
|
7991
8057
|
thinking: streaming && !hasAnswerText && msg.reasoningEndedAt === void 0
|
|
7992
8058
|
}
|
|
7993
8059
|
),
|
|
7994
|
-
segments && segments.length > 0 ? /* @__PURE__ */
|
|
8060
|
+
segments && segments.length > 0 ? /* @__PURE__ */ jsx29(
|
|
7995
8061
|
SegmentedBody,
|
|
7996
8062
|
{
|
|
7997
8063
|
segments,
|
|
@@ -8007,9 +8073,9 @@ function AssistantMessageImpl({
|
|
|
8007
8073
|
) : /* @__PURE__ */ jsxs27(Fragment10, { children: [
|
|
8008
8074
|
/* @__PURE__ */ jsxs27("div", { className: messageClassName, children: [
|
|
8009
8075
|
body,
|
|
8010
|
-
!msg.speaker && streaming && content && !msg.toolCalls?.length && /* @__PURE__ */
|
|
8076
|
+
!msg.speaker && streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx29(StreamingCaret, {})
|
|
8011
8077
|
] }),
|
|
8012
|
-
msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */
|
|
8078
|
+
msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx29("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc, index) => /* @__PURE__ */ jsx29(
|
|
8013
8079
|
ToolCallCard,
|
|
8014
8080
|
{
|
|
8015
8081
|
call: tc,
|
|
@@ -8022,7 +8088,7 @@ function AssistantMessageImpl({
|
|
|
8022
8088
|
tc.id
|
|
8023
8089
|
)) })
|
|
8024
8090
|
] }),
|
|
8025
|
-
durableCards && msg.parts && /* @__PURE__ */
|
|
8091
|
+
durableCards && msg.parts && /* @__PURE__ */ jsx29(
|
|
8026
8092
|
DurableChatCards,
|
|
8027
8093
|
{
|
|
8028
8094
|
...durableCards,
|
|
@@ -8031,7 +8097,7 @@ function AssistantMessageImpl({
|
|
|
8031
8097
|
className: "mt-3"
|
|
8032
8098
|
}
|
|
8033
8099
|
),
|
|
8034
|
-
workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */
|
|
8100
|
+
workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */ jsx29(
|
|
8035
8101
|
WorkProductCard,
|
|
8036
8102
|
{
|
|
8037
8103
|
part,
|
|
@@ -8041,7 +8107,7 @@ function AssistantMessageImpl({
|
|
|
8041
8107
|
`${part.ref.id}:${part.ref.version}`
|
|
8042
8108
|
)),
|
|
8043
8109
|
renderExtras?.(msg),
|
|
8044
|
-
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */
|
|
8110
|
+
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx29("div", { className: "mt-2", children: /* @__PURE__ */ jsx29(
|
|
8045
8111
|
MessageAttachments,
|
|
8046
8112
|
{
|
|
8047
8113
|
parts: attachmentPartsFromMessageParts(msg.parts),
|
|
@@ -8051,10 +8117,10 @@ function AssistantMessageImpl({
|
|
|
8051
8117
|
) })
|
|
8052
8118
|
] }) }),
|
|
8053
8119
|
quiet && /* @__PURE__ */ jsxs27("div", { "data-testid": "message-meta-lane", className: QUIET_META_LANE_CLASS, children: [
|
|
8054
|
-
/* @__PURE__ */
|
|
8055
|
-
msg.modelUsed && /* @__PURE__ */
|
|
8056
|
-
formatTokensPerSecond(msg) && /* @__PURE__ */
|
|
8057
|
-
formatModelCost(msg, models) && /* @__PURE__ */
|
|
8120
|
+
/* @__PURE__ */ jsx29(CopyMessageButton, { text: copyTextOf(msg) }),
|
|
8121
|
+
msg.modelUsed && /* @__PURE__ */ jsx29("span", { className: "font-mono", children: msg.modelUsed }),
|
|
8122
|
+
formatTokensPerSecond(msg) && /* @__PURE__ */ jsx29("span", { children: formatTokensPerSecond(msg) }),
|
|
8123
|
+
formatModelCost(msg, models) && /* @__PURE__ */ jsx29("span", { children: formatModelCost(msg, models) })
|
|
8058
8124
|
] })
|
|
8059
8125
|
] });
|
|
8060
8126
|
}
|
|
@@ -8071,18 +8137,18 @@ function useThinkingSeconds(active) {
|
|
|
8071
8137
|
}
|
|
8072
8138
|
function ThinkingRow({ agentLabel, chrome = "labeled", phase }) {
|
|
8073
8139
|
return /* @__PURE__ */ jsxs27("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
|
|
8074
|
-
chrome !== "quiet" && /* @__PURE__ */
|
|
8075
|
-
/* @__PURE__ */
|
|
8140
|
+
chrome !== "quiet" && /* @__PURE__ */ jsx29("p", { className: "mb-1 text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: agentLabel }),
|
|
8141
|
+
/* @__PURE__ */ jsx29(TurnProgress, { phase, pendingMessage: "Thinking\u2026", className: "text-[15px]" })
|
|
8076
8142
|
] });
|
|
8077
8143
|
}
|
|
8078
8144
|
function StreamErrorRow({ message, onRetry }) {
|
|
8079
|
-
return /* @__PURE__ */
|
|
8145
|
+
return /* @__PURE__ */ jsx29("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs27("div", { role: "alert", className: "flex items-start gap-2.5 rounded-lg border border-destructive/40 bg-destructive/5 px-3 py-2.5 text-sm text-destructive", children: [
|
|
8080
8146
|
/* @__PURE__ */ jsxs27("svg", { className: "mt-0.5 h-4 w-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
8081
|
-
/* @__PURE__ */
|
|
8082
|
-
/* @__PURE__ */
|
|
8147
|
+
/* @__PURE__ */ jsx29("circle", { cx: "12", cy: "12", r: "9" }),
|
|
8148
|
+
/* @__PURE__ */ jsx29("path", { d: "M12 8v4m0 4h.01" })
|
|
8083
8149
|
] }),
|
|
8084
|
-
/* @__PURE__ */
|
|
8085
|
-
onRetry && /* @__PURE__ */
|
|
8150
|
+
/* @__PURE__ */ jsx29("span", { className: "min-w-0 flex-1 break-words", children: message }),
|
|
8151
|
+
onRetry && /* @__PURE__ */ jsx29(
|
|
8086
8152
|
"button",
|
|
8087
8153
|
{
|
|
8088
8154
|
type: "button",
|
|
@@ -8103,20 +8169,20 @@ function OtherPersonMessage({
|
|
|
8103
8169
|
const attachments = resolveAttachmentUrl ? attachmentPartsFromMessageParts(msg.parts) : [];
|
|
8104
8170
|
return /* @__PURE__ */ jsxs27("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
|
|
8105
8171
|
/* @__PURE__ */ jsxs27("div", { className: `w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
|
|
8106
|
-
/* @__PURE__ */
|
|
8107
|
-
/* @__PURE__ */
|
|
8172
|
+
/* @__PURE__ */ jsx29(MessageAuthor, { author, className: "mb-1.5" }),
|
|
8173
|
+
/* @__PURE__ */ jsx29(
|
|
8108
8174
|
"div",
|
|
8109
8175
|
{
|
|
8110
8176
|
className: `w-fit max-w-full rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-4 py-2.5 text-[hsl(var(--foreground))] ${quiet ? "" : "rounded-tl-md "}${messageClassName}`,
|
|
8111
|
-
children: /* @__PURE__ */
|
|
8177
|
+
children: /* @__PURE__ */ jsx29("p", { className: "whitespace-pre-wrap", children: msg.content })
|
|
8112
8178
|
}
|
|
8113
8179
|
),
|
|
8114
|
-
resolveAttachmentUrl && attachments.length > 0 && /* @__PURE__ */
|
|
8180
|
+
resolveAttachmentUrl && attachments.length > 0 && /* @__PURE__ */ jsx29("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx29(MessageAttachments, { parts: attachments, resolveFileUrl: resolveAttachmentUrl, justify: "start" }) })
|
|
8115
8181
|
] }),
|
|
8116
|
-
quiet && /* @__PURE__ */
|
|
8182
|
+
quiet && /* @__PURE__ */ jsx29("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-start`, children: /* @__PURE__ */ jsx29(CopyMessageButton, { text: msg.content }) })
|
|
8117
8183
|
] });
|
|
8118
8184
|
}
|
|
8119
|
-
var renderPlainBody = (content) => /* @__PURE__ */
|
|
8185
|
+
var renderPlainBody = (content) => /* @__PURE__ */ jsx29("p", { className: "whitespace-pre-wrap", children: content });
|
|
8120
8186
|
function ChatMessages({
|
|
8121
8187
|
messages: storedMessages,
|
|
8122
8188
|
messageSize = "default",
|
|
@@ -8149,7 +8215,7 @@ function ChatMessages({
|
|
|
8149
8215
|
const lastIsUser = messages[messages.length - 1]?.role === "user";
|
|
8150
8216
|
const quiet = chrome === "quiet";
|
|
8151
8217
|
if (messages.length === 0 && !loading && !error) {
|
|
8152
|
-
const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */
|
|
8218
|
+
const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx29(ChatEmptyState, { ...emptyState });
|
|
8153
8219
|
return /* @__PURE__ */ jsxs27(Fragment10, { children: [
|
|
8154
8220
|
header,
|
|
8155
8221
|
empty
|
|
@@ -8158,7 +8224,7 @@ function ChatMessages({
|
|
|
8158
8224
|
return /* @__PURE__ */ jsxs27(Fragment10, { children: [
|
|
8159
8225
|
header,
|
|
8160
8226
|
messages.map(
|
|
8161
|
-
(msg) => msg.role === "user" && msg.author && !isViewerMessage(msg.author, viewerId) ? /* @__PURE__ */
|
|
8227
|
+
(msg) => msg.role === "user" && msg.author && !isViewerMessage(msg.author, viewerId) ? /* @__PURE__ */ jsx29(
|
|
8162
8228
|
OtherPersonMessage,
|
|
8163
8229
|
{
|
|
8164
8230
|
msg,
|
|
@@ -8170,15 +8236,15 @@ function ChatMessages({
|
|
|
8170
8236
|
msg.id
|
|
8171
8237
|
) : msg.role === "user" ? /* @__PURE__ */ jsxs27("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
|
|
8172
8238
|
/* @__PURE__ */ jsxs27("div", { className: `ml-auto w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
|
|
8173
|
-
!quiet && /* @__PURE__ */
|
|
8174
|
-
/* @__PURE__ */
|
|
8239
|
+
!quiet && /* @__PURE__ */ jsx29("p", { className: "mb-1 text-right text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: userLabel }),
|
|
8240
|
+
/* @__PURE__ */ jsx29(
|
|
8175
8241
|
"div",
|
|
8176
8242
|
{
|
|
8177
8243
|
className: `rounded-2xl bg-[hsl(var(--foreground))] px-4 py-2.5 text-[hsl(var(--background))] ${quiet ? "" : "rounded-tr-md "}${messageClassName}`,
|
|
8178
|
-
children: /* @__PURE__ */
|
|
8244
|
+
children: /* @__PURE__ */ jsx29("p", { className: "whitespace-pre-wrap", children: msg.content })
|
|
8179
8245
|
}
|
|
8180
8246
|
),
|
|
8181
|
-
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */
|
|
8247
|
+
resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx29("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx29(
|
|
8182
8248
|
MessageAttachments,
|
|
8183
8249
|
{
|
|
8184
8250
|
parts: attachmentPartsFromMessageParts(msg.parts),
|
|
@@ -8187,8 +8253,8 @@ function ChatMessages({
|
|
|
8187
8253
|
}
|
|
8188
8254
|
) })
|
|
8189
8255
|
] }),
|
|
8190
|
-
quiet && /* @__PURE__ */
|
|
8191
|
-
] }, msg.id) : /* @__PURE__ */
|
|
8256
|
+
quiet && /* @__PURE__ */ jsx29("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-end`, children: /* @__PURE__ */ jsx29(CopyMessageButton, { text: msg.content }) })
|
|
8257
|
+
] }, msg.id) : /* @__PURE__ */ jsx29(
|
|
8192
8258
|
AssistantMessage,
|
|
8193
8259
|
{
|
|
8194
8260
|
msg,
|
|
@@ -8209,15 +8275,15 @@ function ChatMessages({
|
|
|
8209
8275
|
msg.id
|
|
8210
8276
|
)
|
|
8211
8277
|
),
|
|
8212
|
-
loading && lastIsUser && /* @__PURE__ */
|
|
8213
|
-
error && !loading && /* @__PURE__ */
|
|
8278
|
+
loading && lastIsUser && /* @__PURE__ */ jsx29(ThinkingRow, { agentLabel, chrome, phase: turnPhase }),
|
|
8279
|
+
error && !loading && /* @__PURE__ */ jsx29(StreamErrorRow, { message: error, onRetry })
|
|
8214
8280
|
] });
|
|
8215
8281
|
}
|
|
8216
8282
|
|
|
8217
8283
|
// src/web-react/api-access-panel.tsx
|
|
8218
|
-
import { useEffect as useEffect19, useRef as
|
|
8284
|
+
import { useEffect as useEffect19, useRef as useRef20, useState as useState27 } from "react";
|
|
8219
8285
|
import { Button as Button6, Input as Input3, PageHeader as PageHeader2 } from "@tangle-network/ui/primitives";
|
|
8220
|
-
import { jsx as
|
|
8286
|
+
import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
8221
8287
|
var defaultExpiryChoices = [1, 7, 30];
|
|
8222
8288
|
function pruneScopes(scopes, access) {
|
|
8223
8289
|
const offered = new Map(access.map((option) => [option.scope, option]));
|
|
@@ -8297,9 +8363,9 @@ function ApiAccessPanel({
|
|
|
8297
8363
|
const [created, setCreated] = useState27(null);
|
|
8298
8364
|
const [notice, setNotice] = useState27(null);
|
|
8299
8365
|
const [error, setError] = useState27(null);
|
|
8300
|
-
const keyHeading =
|
|
8301
|
-
const nameInput =
|
|
8302
|
-
const keyWasShown =
|
|
8366
|
+
const keyHeading = useRef20(null);
|
|
8367
|
+
const nameInput = useRef20(null);
|
|
8368
|
+
const keyWasShown = useRef20(false);
|
|
8303
8369
|
const selectedScopes = pruneScopes(scopes, access);
|
|
8304
8370
|
useEffect19(() => {
|
|
8305
8371
|
setScopes((current) => {
|
|
@@ -8353,10 +8419,10 @@ function ApiAccessPanel({
|
|
|
8353
8419
|
setRevoking(null);
|
|
8354
8420
|
}
|
|
8355
8421
|
}
|
|
8356
|
-
return /* @__PURE__ */
|
|
8422
|
+
return /* @__PURE__ */ jsx30("main", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs28("div", { className: "mx-auto max-w-2xl space-y-8 px-4 py-8 sm:px-8", children: [
|
|
8357
8423
|
/* @__PURE__ */ jsxs28("div", { className: "space-y-2", children: [
|
|
8358
|
-
accountHref && /* @__PURE__ */
|
|
8359
|
-
/* @__PURE__ */
|
|
8424
|
+
accountHref && /* @__PURE__ */ jsx30("a", { href: accountHref, className: "text-sm text-muted-foreground hover:text-foreground", children: "Account" }),
|
|
8425
|
+
/* @__PURE__ */ jsx30(
|
|
8360
8426
|
PageHeader2,
|
|
8361
8427
|
{
|
|
8362
8428
|
className: "mb-0",
|
|
@@ -8365,14 +8431,14 @@ function ApiAccessPanel({
|
|
|
8365
8431
|
}
|
|
8366
8432
|
)
|
|
8367
8433
|
] }),
|
|
8368
|
-
error && /* @__PURE__ */
|
|
8369
|
-
notice && /* @__PURE__ */
|
|
8434
|
+
error && /* @__PURE__ */ jsx30("p", { role: "alert", className: "rounded-lg border border-destructive/40 p-3 text-sm text-destructive", children: error }),
|
|
8435
|
+
notice && /* @__PURE__ */ jsx30("p", { role: "status", className: "text-sm text-muted-foreground", children: notice }),
|
|
8370
8436
|
created ? /* @__PURE__ */ jsxs28("section", { "aria-labelledby": "save-api-key", className: "space-y-4 rounded-xl border border-border bg-card p-5", children: [
|
|
8371
|
-
/* @__PURE__ */
|
|
8372
|
-
/* @__PURE__ */
|
|
8437
|
+
/* @__PURE__ */ jsx30("h2", { ref: keyHeading, tabIndex: -1, id: "save-api-key", className: "font-medium outline-none", children: "Save your key" }),
|
|
8438
|
+
/* @__PURE__ */ jsx30("p", { className: "text-sm text-muted-foreground", children: "Copy it directly into your client\u2019s secret storage. It is shown only now. Keep it out of chat messages and prompts." }),
|
|
8373
8439
|
/* @__PURE__ */ jsxs28("div", { className: "flex gap-2", children: [
|
|
8374
|
-
/* @__PURE__ */
|
|
8375
|
-
/* @__PURE__ */
|
|
8440
|
+
/* @__PURE__ */ jsx30(Input3, { size: "lg", "aria-label": "New API key", type: "password", value: created.key, readOnly: true, autoComplete: "off", className: "min-w-0 font-mono" }),
|
|
8441
|
+
/* @__PURE__ */ jsx30(Button6, { onClick: async () => {
|
|
8376
8442
|
try {
|
|
8377
8443
|
await navigator.clipboard.writeText(created.key);
|
|
8378
8444
|
setNotice("Key copied");
|
|
@@ -8381,20 +8447,20 @@ function ApiAccessPanel({
|
|
|
8381
8447
|
}
|
|
8382
8448
|
}, children: "Copy key" })
|
|
8383
8449
|
] }),
|
|
8384
|
-
/* @__PURE__ */
|
|
8450
|
+
/* @__PURE__ */ jsx30(Button6, { variant: "outline", onClick: () => {
|
|
8385
8451
|
setCreated(null);
|
|
8386
8452
|
setNotice(null);
|
|
8387
8453
|
}, children: "I\u2019ve saved it" })
|
|
8388
8454
|
] }) : /* @__PURE__ */ jsxs28("form", { onSubmit: createKey, className: "space-y-5 rounded-xl border border-border bg-card p-5", children: [
|
|
8389
|
-
/* @__PURE__ */
|
|
8455
|
+
/* @__PURE__ */ jsx30("h2", { className: "font-medium", children: "Create a key" }),
|
|
8390
8456
|
/* @__PURE__ */ jsxs28("div", { className: "grid gap-4 sm:grid-cols-[1fr_10rem]", children: [
|
|
8391
8457
|
/* @__PURE__ */ jsxs28("div", { className: "space-y-1.5", children: [
|
|
8392
|
-
/* @__PURE__ */
|
|
8393
|
-
/* @__PURE__ */
|
|
8458
|
+
/* @__PURE__ */ jsx30("label", { className: "text-sm font-medium", htmlFor: "key-name", children: "Name" }),
|
|
8459
|
+
/* @__PURE__ */ jsx30(Input3, { size: "lg", ref: nameInput, id: "key-name", value: name, onChange: (event) => setName(event.target.value), placeholder: "Client on my server", maxLength: 100, required: true, autoComplete: "off" })
|
|
8394
8460
|
] }),
|
|
8395
8461
|
/* @__PURE__ */ jsxs28("div", { className: "space-y-1.5", children: [
|
|
8396
|
-
/* @__PURE__ */
|
|
8397
|
-
/* @__PURE__ */
|
|
8462
|
+
/* @__PURE__ */ jsx30("label", { className: "text-sm font-medium", htmlFor: "key-expiry", children: "Expires in" }),
|
|
8463
|
+
/* @__PURE__ */ jsx30("select", { id: "key-expiry", value: selectedDays ?? "", onChange: (event) => setDays(Number(event.target.value)), className: "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm", children: allowedDays.map((days2) => /* @__PURE__ */ jsxs28("option", { value: days2, children: [
|
|
8398
8464
|
days2,
|
|
8399
8465
|
" ",
|
|
8400
8466
|
days2 === 1 ? "day" : "days"
|
|
@@ -8402,7 +8468,7 @@ function ApiAccessPanel({
|
|
|
8402
8468
|
] })
|
|
8403
8469
|
] }),
|
|
8404
8470
|
workspaces && workspaces.length > 0 && /* @__PURE__ */ jsxs28("div", { className: "space-y-1.5", children: [
|
|
8405
|
-
/* @__PURE__ */
|
|
8471
|
+
/* @__PURE__ */ jsx30("label", { className: "text-sm font-medium", htmlFor: "key-reach", children: "Reaches" }),
|
|
8406
8472
|
/* @__PURE__ */ jsxs28("select", { id: "key-reach", value: selectedWorkspace, onChange: (event) => setReach(event.target.value), className: "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm", children: [
|
|
8407
8473
|
/* @__PURE__ */ jsxs28("option", { value: "", children: [
|
|
8408
8474
|
"All ",
|
|
@@ -8416,11 +8482,11 @@ function ApiAccessPanel({
|
|
|
8416
8482
|
] })
|
|
8417
8483
|
] }),
|
|
8418
8484
|
/* @__PURE__ */ jsxs28("fieldset", { className: "space-y-3", children: [
|
|
8419
|
-
/* @__PURE__ */
|
|
8485
|
+
/* @__PURE__ */ jsx30("legend", { className: "mb-3 text-sm font-medium", children: "Permissions" }),
|
|
8420
8486
|
access.map((option) => {
|
|
8421
8487
|
const unavailable = !expandScopes([option.scope], access).includes(option.scope);
|
|
8422
8488
|
return /* @__PURE__ */ jsxs28("label", { className: "flex cursor-pointer items-start gap-3", children: [
|
|
8423
|
-
/* @__PURE__ */
|
|
8489
|
+
/* @__PURE__ */ jsx30(
|
|
8424
8490
|
"input",
|
|
8425
8491
|
{
|
|
8426
8492
|
type: "checkbox",
|
|
@@ -8431,31 +8497,31 @@ function ApiAccessPanel({
|
|
|
8431
8497
|
}
|
|
8432
8498
|
),
|
|
8433
8499
|
/* @__PURE__ */ jsxs28("span", { className: "text-sm", children: [
|
|
8434
|
-
/* @__PURE__ */
|
|
8435
|
-
/* @__PURE__ */
|
|
8436
|
-
unavailable && /* @__PURE__ */
|
|
8500
|
+
/* @__PURE__ */ jsx30("span", { className: "block font-medium", children: option.label }),
|
|
8501
|
+
/* @__PURE__ */ jsx30("span", { className: "text-muted-foreground", children: option.description }),
|
|
8502
|
+
unavailable && /* @__PURE__ */ jsx30("span", { className: "block text-muted-foreground", children: "Required permission unavailable." })
|
|
8437
8503
|
] })
|
|
8438
8504
|
] }, option.scope);
|
|
8439
8505
|
})
|
|
8440
8506
|
] }),
|
|
8441
|
-
limitsDescription && /* @__PURE__ */
|
|
8442
|
-
/* @__PURE__ */
|
|
8507
|
+
limitsDescription && /* @__PURE__ */ jsx30("p", { className: "text-sm text-muted-foreground", children: limitsDescription }),
|
|
8508
|
+
/* @__PURE__ */ jsx30(Button6, { type: "submit", disabled: creating || !name.trim() || !selectedScopes.length || selectedDays === void 0, children: creating ? "Creating\u2026" : "Create key" })
|
|
8443
8509
|
] }),
|
|
8444
8510
|
/* @__PURE__ */ jsxs28("section", { "aria-labelledby": "existing-keys", className: "space-y-3 rounded-xl border border-border bg-card p-5", children: [
|
|
8445
|
-
/* @__PURE__ */
|
|
8446
|
-
keys.length === 0 ? /* @__PURE__ */
|
|
8511
|
+
/* @__PURE__ */ jsx30("h2", { id: "existing-keys", className: "font-medium", children: "Your keys" }),
|
|
8512
|
+
keys.length === 0 ? /* @__PURE__ */ jsx30("p", { className: "text-sm text-muted-foreground", children: "No keys yet." }) : /* @__PURE__ */ jsx30("ul", { className: "divide-y divide-border", children: keys.map((key) => /* @__PURE__ */ jsxs28("li", { className: "flex items-start justify-between gap-3 p-4", children: [
|
|
8447
8513
|
/* @__PURE__ */ jsxs28("div", { className: "min-w-0 space-y-1", children: [
|
|
8448
|
-
/* @__PURE__ */
|
|
8449
|
-
/* @__PURE__ */
|
|
8450
|
-
/* @__PURE__ */
|
|
8451
|
-
workspaces && /* @__PURE__ */
|
|
8514
|
+
/* @__PURE__ */ jsx30("p", { className: "break-words text-sm font-medium", children: key.name }),
|
|
8515
|
+
/* @__PURE__ */ jsx30("p", { className: "text-sm text-muted-foreground", children: key.expiresAt ? `${new Date(key.expiresAt).getTime() <= Date.now() ? "Expired" : "Expires"} ${new Date(key.expiresAt).toLocaleDateString()}` : "No expiry" }),
|
|
8516
|
+
/* @__PURE__ */ jsx30("p", { className: "text-sm text-muted-foreground", children: key.scopes.map((scope) => access.find((access2) => access2.scope === scope)?.label ?? scope).join(" \xB7 ") }),
|
|
8517
|
+
workspaces && /* @__PURE__ */ jsx30("p", { className: "text-sm text-muted-foreground", children: key.workspaceIds?.length ? `Only ${key.workspaceIds.map(workspaceName).join(", ")}` : `All ${workspaceNoun.plural}` })
|
|
8452
8518
|
] }),
|
|
8453
|
-
/* @__PURE__ */
|
|
8519
|
+
/* @__PURE__ */ jsx30(Button6, { variant: "outline", disabled: revoking !== null, onClick: () => revokeKey(key.id), "aria-label": `Revoke ${key.name}`, children: revoking === key.id ? "Revoking\u2026" : "Revoke" })
|
|
8454
8520
|
] }, key.id)) })
|
|
8455
8521
|
] }),
|
|
8456
8522
|
/* @__PURE__ */ jsxs28("p", { className: "text-sm text-muted-foreground", children: [
|
|
8457
8523
|
"Use ",
|
|
8458
|
-
/* @__PURE__ */
|
|
8524
|
+
/* @__PURE__ */ jsx30("code", { className: "text-sm", children: baseUrl }),
|
|
8459
8525
|
" as the API base and send the key as a Bearer credential."
|
|
8460
8526
|
] })
|
|
8461
8527
|
] }) });
|
|
@@ -8463,13 +8529,13 @@ function ApiAccessPanel({
|
|
|
8463
8529
|
|
|
8464
8530
|
// src/web-react/agent-setup-block.tsx
|
|
8465
8531
|
import { Check } from "lucide-react";
|
|
8466
|
-
import { useEffect as useEffect20, useRef as
|
|
8467
|
-
import { Fragment as Fragment11, jsx as
|
|
8532
|
+
import { useEffect as useEffect20, useRef as useRef21, useState as useState28 } from "react";
|
|
8533
|
+
import { Fragment as Fragment11, jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
8468
8534
|
function AgentSetupBlock({ productName, setupUrl, markdown, description, className }) {
|
|
8469
8535
|
const [notice, setNotice] = useState28(null);
|
|
8470
8536
|
const [copied, setCopied] = useState28(false);
|
|
8471
|
-
const copiedResetTimer =
|
|
8472
|
-
const mounted =
|
|
8537
|
+
const copiedResetTimer = useRef21(null);
|
|
8538
|
+
const mounted = useRef21(true);
|
|
8473
8539
|
const prompt = markdown ?? `Set up ${productName} for me. Fetch ${setupUrl} and follow every step in it.`;
|
|
8474
8540
|
useEffect20(() => {
|
|
8475
8541
|
mounted.current = true;
|
|
@@ -8504,27 +8570,27 @@ function AgentSetupBlock({ productName, setupUrl, markdown, description, classNa
|
|
|
8504
8570
|
className: `space-y-3 rounded-xl border border-border bg-card p-5 ${className ?? ""}`.trim(),
|
|
8505
8571
|
children: [
|
|
8506
8572
|
/* @__PURE__ */ jsxs29("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
8507
|
-
/* @__PURE__ */
|
|
8508
|
-
/* @__PURE__ */
|
|
8573
|
+
/* @__PURE__ */ jsx31("h2", { id: "agent-setup-heading", className: "font-medium text-foreground", children: "Hand this to your agent" }),
|
|
8574
|
+
/* @__PURE__ */ jsx31(
|
|
8509
8575
|
"button",
|
|
8510
8576
|
{
|
|
8511
8577
|
type: "button",
|
|
8512
8578
|
onClick: copy,
|
|
8513
8579
|
className: "inline-flex items-center justify-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",
|
|
8514
8580
|
children: copied ? /* @__PURE__ */ jsxs29(Fragment11, { children: [
|
|
8515
|
-
/* @__PURE__ */
|
|
8581
|
+
/* @__PURE__ */ jsx31(Check, { "aria-hidden": "true", className: "h-4 w-4" }),
|
|
8516
8582
|
"Copied"
|
|
8517
8583
|
] }) : "Copy setup prompt"
|
|
8518
8584
|
}
|
|
8519
8585
|
)
|
|
8520
8586
|
] }),
|
|
8521
|
-
/* @__PURE__ */
|
|
8587
|
+
/* @__PURE__ */ jsx31("p", { className: "text-sm text-muted-foreground", children: description ?? `Your coding agent sets up ${productName} end to end: it asks you to approve once, gets its own capped key, installs the client, and verifies a first call.` }),
|
|
8522
8588
|
/* @__PURE__ */ jsxs29("p", { className: "text-sm text-muted-foreground", children: [
|
|
8523
8589
|
"Raw prompt:",
|
|
8524
8590
|
" ",
|
|
8525
|
-
/* @__PURE__ */
|
|
8591
|
+
/* @__PURE__ */ jsx31("a", { href: setupUrl, className: "font-mono text-foreground underline", children: setupUrl })
|
|
8526
8592
|
] }),
|
|
8527
|
-
notice ? /* @__PURE__ */
|
|
8593
|
+
notice ? /* @__PURE__ */ jsx31("p", { role: "status", className: "text-sm text-foreground", children: notice }) : null
|
|
8528
8594
|
]
|
|
8529
8595
|
}
|
|
8530
8596
|
);
|
|
@@ -8532,37 +8598,37 @@ function AgentSetupBlock({ productName, setupUrl, markdown, description, classNa
|
|
|
8532
8598
|
|
|
8533
8599
|
// src/web-react/agent-profile-choices.tsx
|
|
8534
8600
|
import { useId as useId5 } from "react";
|
|
8535
|
-
import { jsx as
|
|
8601
|
+
import { jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
8536
8602
|
function AgentProfileChoices({ value, profiles, onChange, disabled, locked, lockReason, onNewChat, label = "Agent profile" }) {
|
|
8537
8603
|
const name = useId5();
|
|
8538
8604
|
const selected = profiles.find((profile) => profile.id === value);
|
|
8539
8605
|
if (locked) {
|
|
8540
8606
|
return /* @__PURE__ */ jsxs30("div", { className: "space-y-2 rounded-lg border border-border p-3 text-sm", children: [
|
|
8541
|
-
/* @__PURE__ */
|
|
8542
|
-
/* @__PURE__ */
|
|
8543
|
-
onNewChat && !disabled && /* @__PURE__ */
|
|
8607
|
+
/* @__PURE__ */ jsx32("p", { className: "font-medium text-foreground", children: selected?.name ?? value }),
|
|
8608
|
+
/* @__PURE__ */ jsx32("p", { className: "text-muted-foreground", children: lockReason ?? "This conversation stays on its current profile." }),
|
|
8609
|
+
onNewChat && !disabled && /* @__PURE__ */ jsx32("button", { type: "button", onClick: onNewChat, className: "text-sm font-medium text-primary underline underline-offset-4", children: "New chat to switch profile" })
|
|
8544
8610
|
] });
|
|
8545
8611
|
}
|
|
8546
8612
|
return /* @__PURE__ */ jsxs30("fieldset", { disabled, className: "min-w-0 space-y-1", children: [
|
|
8547
|
-
/* @__PURE__ */
|
|
8613
|
+
/* @__PURE__ */ jsx32("legend", { className: "sr-only", children: label }),
|
|
8548
8614
|
/* @__PURE__ */ jsxs30("div", { className: "max-h-48 space-y-1 overflow-y-auto", children: [
|
|
8549
8615
|
profiles.map((profile) => /* @__PURE__ */ jsxs30("label", { className: "flex min-h-10 cursor-pointer items-start gap-2 rounded-lg border border-transparent p-2 text-sm hover:bg-muted has-[:checked]:border-border has-[:checked]:bg-muted has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60", children: [
|
|
8550
|
-
/* @__PURE__ */
|
|
8616
|
+
/* @__PURE__ */ jsx32("input", { type: "radio", name, value: profile.id, checked: profile.id === value, disabled, onChange: () => {
|
|
8551
8617
|
if (!disabled) onChange(profile.id);
|
|
8552
8618
|
}, className: "mt-1 shrink-0 accent-primary" }),
|
|
8553
8619
|
/* @__PURE__ */ jsxs30("span", { className: "min-w-0", children: [
|
|
8554
|
-
/* @__PURE__ */
|
|
8555
|
-
profile.description && /* @__PURE__ */
|
|
8620
|
+
/* @__PURE__ */ jsx32("span", { className: "block font-medium text-foreground", children: profile.name }),
|
|
8621
|
+
profile.description && /* @__PURE__ */ jsx32("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: profile.description })
|
|
8556
8622
|
] })
|
|
8557
8623
|
] }, profile.id)),
|
|
8558
|
-
profiles.length === 0 && /* @__PURE__ */
|
|
8624
|
+
profiles.length === 0 && /* @__PURE__ */ jsx32("p", { role: "status", className: "p-2 text-sm text-muted-foreground", children: "No profiles available." })
|
|
8559
8625
|
] })
|
|
8560
8626
|
] });
|
|
8561
8627
|
}
|
|
8562
8628
|
|
|
8563
8629
|
// src/web-react/composer-profile-pill.tsx
|
|
8564
8630
|
import { AgentProfilePicker } from "@tangle-network/sandbox-ui/chat";
|
|
8565
|
-
import { jsx as
|
|
8631
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
8566
8632
|
var TRIGGER = {
|
|
8567
8633
|
composer: "max-w-[180px]",
|
|
8568
8634
|
// A menu panel repoints surface-container to its own tone, which would leave
|
|
@@ -8587,7 +8653,7 @@ function ComposerProfilePill({
|
|
|
8587
8653
|
placement = "composer",
|
|
8588
8654
|
className
|
|
8589
8655
|
}) {
|
|
8590
|
-
return /* @__PURE__ */
|
|
8656
|
+
return /* @__PURE__ */ jsx33(
|
|
8591
8657
|
AgentProfilePicker,
|
|
8592
8658
|
{
|
|
8593
8659
|
value: selection.value,
|
|
@@ -8618,6 +8684,7 @@ export {
|
|
|
8618
8684
|
defaultReconnectDelayMs,
|
|
8619
8685
|
streamChatTurn,
|
|
8620
8686
|
TurnProgress,
|
|
8687
|
+
ResizeHandle,
|
|
8621
8688
|
useChatScroll,
|
|
8622
8689
|
ReasoningRow,
|
|
8623
8690
|
getChatFundingRecovery,
|
|
@@ -8765,4 +8832,4 @@ export {
|
|
|
8765
8832
|
AgentProfileChoices,
|
|
8766
8833
|
ComposerProfilePill
|
|
8767
8834
|
};
|
|
8768
|
-
//# sourceMappingURL=chunk-
|
|
8835
|
+
//# sourceMappingURL=chunk-NN3CQNX5.js.map
|