@tangle-network/agent-app 0.16.1 → 0.18.0
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/index.js +29 -29
- package/dist/platform/index.d.ts +71 -1
- package/dist/platform/index.js +55 -0
- package/dist/platform/index.js.map +1 -1
- package/dist/skills/index.d.ts +136 -0
- package/dist/skills/index.js +131 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/web-react/index.d.ts +37 -1
- package/dist/web-react/index.js +199 -122
- package/dist/web-react/index.js.map +1 -1
- package/package.json +12 -2
package/dist/web-react/index.js
CHANGED
|
@@ -451,19 +451,95 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
|
|
|
451
451
|
] });
|
|
452
452
|
}
|
|
453
453
|
|
|
454
|
+
// src/web-react/seat-paywall.tsx
|
|
455
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
456
|
+
function CheckGlyph() {
|
|
457
|
+
return /* @__PURE__ */ jsx3(
|
|
458
|
+
"svg",
|
|
459
|
+
{
|
|
460
|
+
className: "h-4 w-4 shrink-0 text-primary",
|
|
461
|
+
viewBox: "0 0 24 24",
|
|
462
|
+
fill: "none",
|
|
463
|
+
stroke: "currentColor",
|
|
464
|
+
strokeWidth: "2.5",
|
|
465
|
+
strokeLinecap: "round",
|
|
466
|
+
strokeLinejoin: "round",
|
|
467
|
+
"aria-hidden": true,
|
|
468
|
+
children: /* @__PURE__ */ jsx3("path", { d: "M20 6 9 17l-5-5" })
|
|
469
|
+
}
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
function Benefit({ children }) {
|
|
473
|
+
return /* @__PURE__ */ jsxs3("li", { className: "flex items-start gap-2.5 text-sm text-foreground", children: [
|
|
474
|
+
/* @__PURE__ */ jsx3("span", { className: "mt-0.5", children: /* @__PURE__ */ jsx3(CheckGlyph, {}) }),
|
|
475
|
+
/* @__PURE__ */ jsx3("span", { children })
|
|
476
|
+
] });
|
|
477
|
+
}
|
|
478
|
+
function SeatPaywall({
|
|
479
|
+
product,
|
|
480
|
+
onCheckout,
|
|
481
|
+
priceUsd = 100,
|
|
482
|
+
includedUsageUsd = 50,
|
|
483
|
+
tagline,
|
|
484
|
+
ctaLabel
|
|
485
|
+
}) {
|
|
486
|
+
return /* @__PURE__ */ jsx3("div", { className: "flex min-h-[60vh] w-full items-center justify-center p-6", children: /* @__PURE__ */ jsxs3("div", { className: "w-full max-w-md rounded-2xl border border-border bg-card p-8 shadow-sm", children: [
|
|
487
|
+
/* @__PURE__ */ jsx3("p", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: product }),
|
|
488
|
+
/* @__PURE__ */ jsxs3("h1", { className: "mt-2 text-2xl font-semibold tracking-tight text-foreground", children: [
|
|
489
|
+
"Unlock ",
|
|
490
|
+
product
|
|
491
|
+
] }),
|
|
492
|
+
tagline && /* @__PURE__ */ jsx3("p", { className: "mt-2 text-sm text-muted-foreground", children: tagline }),
|
|
493
|
+
/* @__PURE__ */ jsxs3("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
|
|
494
|
+
/* @__PURE__ */ jsxs3("span", { className: "text-3xl font-semibold text-foreground", children: [
|
|
495
|
+
"$",
|
|
496
|
+
priceUsd
|
|
497
|
+
] }),
|
|
498
|
+
/* @__PURE__ */ jsx3("span", { className: "text-sm text-muted-foreground", children: "/mo" })
|
|
499
|
+
] }),
|
|
500
|
+
/* @__PURE__ */ jsxs3("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
501
|
+
"Includes $",
|
|
502
|
+
includedUsageUsd,
|
|
503
|
+
"/mo of AI usage"
|
|
504
|
+
] }),
|
|
505
|
+
/* @__PURE__ */ jsxs3("ul", { className: "mt-6 space-y-2.5", children: [
|
|
506
|
+
/* @__PURE__ */ jsxs3(Benefit, { children: [
|
|
507
|
+
"Full access to ",
|
|
508
|
+
product
|
|
509
|
+
] }),
|
|
510
|
+
/* @__PURE__ */ jsxs3(Benefit, { children: [
|
|
511
|
+
"$",
|
|
512
|
+
includedUsageUsd,
|
|
513
|
+
"/mo of AI usage included, every month"
|
|
514
|
+
] }),
|
|
515
|
+
/* @__PURE__ */ jsx3(Benefit, { children: "One Tangle wallet across every product you run" })
|
|
516
|
+
] }),
|
|
517
|
+
/* @__PURE__ */ jsx3(
|
|
518
|
+
"button",
|
|
519
|
+
{
|
|
520
|
+
type: "button",
|
|
521
|
+
onClick: onCheckout,
|
|
522
|
+
className: "mt-7 inline-flex w-full items-center justify-center rounded-xl bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground transition hover:bg-primary/90",
|
|
523
|
+
children: ctaLabel ?? `Unlock ${product}`
|
|
524
|
+
}
|
|
525
|
+
),
|
|
526
|
+
/* @__PURE__ */ jsx3("p", { className: "mt-3 text-center text-xs text-muted-foreground/70", children: "Cancel anytime." })
|
|
527
|
+
] }) });
|
|
528
|
+
}
|
|
529
|
+
|
|
454
530
|
// src/web-react/index.tsx
|
|
455
|
-
import { Fragment as Fragment2, jsx as
|
|
531
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
456
532
|
function ChevronDown({ className }) {
|
|
457
|
-
return /* @__PURE__ */
|
|
533
|
+
return /* @__PURE__ */ jsx4("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx4("path", { d: "m6 9 6 6 6-6" }) });
|
|
458
534
|
}
|
|
459
535
|
function SearchGlyph({ className }) {
|
|
460
|
-
return /* @__PURE__ */
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
/* @__PURE__ */
|
|
536
|
+
return /* @__PURE__ */ jsxs4("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
537
|
+
/* @__PURE__ */ jsx4("circle", { cx: "11", cy: "11", r: "8" }),
|
|
538
|
+
/* @__PURE__ */ jsx4("path", { d: "m21 21-4.3-4.3" })
|
|
463
539
|
] });
|
|
464
540
|
}
|
|
465
541
|
function SparkleGlyph({ className }) {
|
|
466
|
-
return /* @__PURE__ */
|
|
542
|
+
return /* @__PURE__ */ jsx4("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx4("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3M5.6 5.6l2.1 2.1m8.6 8.6 2.1 2.1m0-12.8-2.1 2.1M7.7 16.3l-2.1 2.1" }) });
|
|
467
543
|
}
|
|
468
544
|
function useClickOutside(onOutside) {
|
|
469
545
|
const ref = useRef2(null);
|
|
@@ -502,7 +578,7 @@ function formatContext(len) {
|
|
|
502
578
|
return `${len} ctx`;
|
|
503
579
|
}
|
|
504
580
|
function SectionHeader({ children }) {
|
|
505
|
-
return /* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ jsx4("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground/70", children });
|
|
506
582
|
}
|
|
507
583
|
function ModelRow({
|
|
508
584
|
model,
|
|
@@ -512,19 +588,19 @@ function ModelRow({
|
|
|
512
588
|
}) {
|
|
513
589
|
const price = formatPrice(model.pricing?.prompt);
|
|
514
590
|
const ctx = formatContext(model.contextLength);
|
|
515
|
-
return /* @__PURE__ */
|
|
591
|
+
return /* @__PURE__ */ jsxs4(
|
|
516
592
|
"button",
|
|
517
593
|
{
|
|
518
594
|
type: "button",
|
|
519
595
|
onClick: onSelect,
|
|
520
596
|
className: `flex w-full items-center gap-2.5 rounded-md px-3 py-2.5 text-left text-sm transition ${selected ? "bg-primary/10 font-medium" : "hover:bg-accent/30"}`,
|
|
521
597
|
children: [
|
|
522
|
-
renderProviderBadge ? renderProviderBadge(model.provider) : /* @__PURE__ */
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
!model.supportsTools && /* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
ctx && /* @__PURE__ */
|
|
527
|
-
price && /* @__PURE__ */
|
|
598
|
+
renderProviderBadge ? renderProviderBadge(model.provider) : /* @__PURE__ */ jsx4(ProviderLogo, { provider: model.provider, size: 16 }),
|
|
599
|
+
/* @__PURE__ */ jsx4("span", { className: "truncate", children: model.name }),
|
|
600
|
+
!model.supportsTools && /* @__PURE__ */ jsx4("span", { className: "shrink-0 rounded bg-muted/60 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "no tools" }),
|
|
601
|
+
/* @__PURE__ */ jsxs4("span", { className: "ml-auto flex shrink-0 items-center gap-2 text-xs text-muted-foreground", children: [
|
|
602
|
+
ctx && /* @__PURE__ */ jsx4("span", { children: ctx }),
|
|
603
|
+
price && /* @__PURE__ */ jsx4("span", { children: price })
|
|
528
604
|
] })
|
|
529
605
|
]
|
|
530
606
|
}
|
|
@@ -562,24 +638,24 @@ function ModelPicker({ value, onChange, models, loading, renderProviderBadge, re
|
|
|
562
638
|
setOpen(false);
|
|
563
639
|
setQuery("");
|
|
564
640
|
};
|
|
565
|
-
return /* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
641
|
+
return /* @__PURE__ */ jsxs4("div", { ref: containerRef, className: "relative inline-flex", children: [
|
|
642
|
+
/* @__PURE__ */ jsxs4(
|
|
567
643
|
"button",
|
|
568
644
|
{
|
|
569
645
|
type: "button",
|
|
570
646
|
onClick: () => setOpen((v) => !v),
|
|
571
647
|
className: "inline-flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1.5 text-sm font-medium text-foreground transition hover:bg-accent/30",
|
|
572
648
|
children: [
|
|
573
|
-
selected ? renderProviderBadge ? renderProviderBadge(selected.provider) : /* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */
|
|
575
|
-
/* @__PURE__ */
|
|
649
|
+
selected ? renderProviderBadge ? renderProviderBadge(selected.provider) : /* @__PURE__ */ jsx4(ProviderLogo, { provider: selected.provider, size: 16 }) : /* @__PURE__ */ jsx4(SparkleGlyph, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
650
|
+
/* @__PURE__ */ jsx4("span", { className: "max-w-[160px] truncate", children: selected?.name ?? value }),
|
|
651
|
+
/* @__PURE__ */ jsx4(ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
576
652
|
]
|
|
577
653
|
}
|
|
578
654
|
),
|
|
579
|
-
open && /* @__PURE__ */
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */
|
|
655
|
+
open && /* @__PURE__ */ jsxs4("div", { className: "absolute bottom-full left-0 z-50 mb-2 w-[420px] overflow-hidden rounded-xl border border-border bg-card shadow-lg", children: [
|
|
656
|
+
/* @__PURE__ */ jsx4("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2", children: [
|
|
657
|
+
/* @__PURE__ */ jsx4(SearchGlyph, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
658
|
+
/* @__PURE__ */ jsx4(
|
|
583
659
|
"input",
|
|
584
660
|
{
|
|
585
661
|
ref: inputRef,
|
|
@@ -591,20 +667,20 @@ function ModelPicker({ value, onChange, models, loading, renderProviderBadge, re
|
|
|
591
667
|
}
|
|
592
668
|
)
|
|
593
669
|
] }) }),
|
|
594
|
-
/* @__PURE__ */
|
|
595
|
-
loading && /* @__PURE__ */
|
|
596
|
-
!loading && filtered && /* @__PURE__ */
|
|
597
|
-
filtered.length === 0 && /* @__PURE__ */
|
|
598
|
-
filtered.map((m) => /* @__PURE__ */
|
|
670
|
+
/* @__PURE__ */ jsxs4("div", { className: "max-h-[400px] overflow-y-auto p-1 pb-2", children: [
|
|
671
|
+
loading && /* @__PURE__ */ jsx4("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "Loading models..." }),
|
|
672
|
+
!loading && filtered && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
673
|
+
filtered.length === 0 && /* @__PURE__ */ jsx4("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No models match your search" }),
|
|
674
|
+
filtered.map((m) => /* @__PURE__ */ jsx4(ModelRow, { model: m, selected: m.id === value, onSelect: () => select(m.id), renderProviderBadge }, m.id))
|
|
599
675
|
] }),
|
|
600
|
-
!loading && !filtered && /* @__PURE__ */
|
|
601
|
-
sections.recommended.length > 0 && /* @__PURE__ */
|
|
602
|
-
/* @__PURE__ */
|
|
603
|
-
sections.recommended.map((m) => /* @__PURE__ */
|
|
676
|
+
!loading && !filtered && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
677
|
+
sections.recommended.length > 0 && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
678
|
+
/* @__PURE__ */ jsx4(SectionHeader, { children: recommendedLabel }),
|
|
679
|
+
sections.recommended.map((m) => /* @__PURE__ */ jsx4(ModelRow, { model: m, selected: m.id === value, onSelect: () => select(m.id), renderProviderBadge }, m.id))
|
|
604
680
|
] }),
|
|
605
|
-
sections.byProvider.map((g) => /* @__PURE__ */
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
g.items.map((m) => /* @__PURE__ */
|
|
681
|
+
sections.byProvider.map((g) => /* @__PURE__ */ jsxs4("div", { children: [
|
|
682
|
+
/* @__PURE__ */ jsx4(SectionHeader, { children: g.provider }),
|
|
683
|
+
g.items.map((m) => /* @__PURE__ */ jsx4(ModelRow, { model: m, selected: m.id === value, onSelect: () => select(m.id), renderProviderBadge }, m.id))
|
|
608
684
|
] }, g.provider))
|
|
609
685
|
] })
|
|
610
686
|
] })
|
|
@@ -621,8 +697,8 @@ function EffortPicker({ value, onChange }) {
|
|
|
621
697
|
const [open, setOpen] = useState3(false);
|
|
622
698
|
const containerRef = useClickOutside(() => setOpen(false));
|
|
623
699
|
const selected = EFFORT_LEVELS.find((l) => l.id === value) ?? EFFORT_LEVELS[2];
|
|
624
|
-
return /* @__PURE__ */
|
|
625
|
-
/* @__PURE__ */
|
|
700
|
+
return /* @__PURE__ */ jsxs4("div", { ref: containerRef, className: "relative inline-flex", children: [
|
|
701
|
+
/* @__PURE__ */ jsxs4(
|
|
626
702
|
"button",
|
|
627
703
|
{
|
|
628
704
|
type: "button",
|
|
@@ -630,13 +706,13 @@ function EffortPicker({ value, onChange }) {
|
|
|
630
706
|
title: "Reasoning effort",
|
|
631
707
|
className: "inline-flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1.5 text-sm font-medium text-foreground transition hover:bg-accent/30",
|
|
632
708
|
children: [
|
|
633
|
-
/* @__PURE__ */
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ jsx4(SparkleGlyph, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
710
|
+
/* @__PURE__ */ jsx4("span", { children: selected.label }),
|
|
711
|
+
/* @__PURE__ */ jsx4(ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
636
712
|
]
|
|
637
713
|
}
|
|
638
714
|
),
|
|
639
|
-
open && /* @__PURE__ */
|
|
715
|
+
open && /* @__PURE__ */ jsx4("div", { className: "absolute bottom-full left-0 z-50 mb-2 w-36 overflow-hidden rounded-xl border border-border bg-card p-1 shadow-lg", children: EFFORT_LEVELS.map((l) => /* @__PURE__ */ jsx4(
|
|
640
716
|
"button",
|
|
641
717
|
{
|
|
642
718
|
type: "button",
|
|
@@ -652,41 +728,41 @@ function EffortPicker({ value, onChange }) {
|
|
|
652
728
|
] });
|
|
653
729
|
}
|
|
654
730
|
function RunDrillIn({ run, onClose }) {
|
|
655
|
-
return /* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */
|
|
657
|
-
/* @__PURE__ */
|
|
731
|
+
return /* @__PURE__ */ jsxs4("div", { className: "fixed inset-y-0 right-0 z-50 flex w-[480px] max-w-full flex-col border-l border-border bg-card shadow-xl", children: [
|
|
732
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
|
|
733
|
+
/* @__PURE__ */ jsx4(
|
|
658
734
|
"span",
|
|
659
735
|
{
|
|
660
736
|
className: `h-2 w-2 shrink-0 rounded-full ${run.status === "running" ? "bg-yellow-500" : run.status === "error" ? "bg-red-500" : "bg-green-500"}`
|
|
661
737
|
}
|
|
662
738
|
),
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
|
|
740
|
+
/* @__PURE__ */ jsx4("p", { className: "truncate text-sm font-semibold", children: run.title }),
|
|
741
|
+
/* @__PURE__ */ jsx4("p", { className: "truncate font-mono text-[11px] text-muted-foreground", children: run.toolName })
|
|
666
742
|
] }),
|
|
667
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ jsx4(
|
|
668
744
|
"button",
|
|
669
745
|
{
|
|
670
746
|
type: "button",
|
|
671
747
|
onClick: onClose,
|
|
672
748
|
"aria-label": "Close",
|
|
673
749
|
className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent/30 hover:text-foreground",
|
|
674
|
-
children: /* @__PURE__ */
|
|
750
|
+
children: /* @__PURE__ */ jsx4("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx4("path", { d: "M18 6 6 18M6 6l12 12" }) })
|
|
675
751
|
}
|
|
676
752
|
)
|
|
677
753
|
] }),
|
|
678
|
-
/* @__PURE__ */
|
|
679
|
-
run.steps.length === 0 && /* @__PURE__ */
|
|
680
|
-
run.steps.map((step, i) => /* @__PURE__ */
|
|
681
|
-
/* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
|
|
755
|
+
run.steps.length === 0 && /* @__PURE__ */ jsx4("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
|
|
756
|
+
run.steps.map((step, i) => /* @__PURE__ */ jsxs4("div", { className: "rounded-lg border border-border/60 bg-background", children: [
|
|
757
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-baseline gap-2 border-b border-border/40 px-3 py-1.5", children: [
|
|
758
|
+
/* @__PURE__ */ jsx4("span", { className: `font-mono text-[11px] ${step.status === "error" ? "text-red-600" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
|
|
759
|
+
/* @__PURE__ */ jsx4("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
|
|
760
|
+
/* @__PURE__ */ jsx4("span", { className: "shrink-0 text-[10px] text-muted-foreground/60", children: new Date(step.at).toLocaleTimeString() })
|
|
685
761
|
] }),
|
|
686
|
-
step.detail && /* @__PURE__ */
|
|
762
|
+
step.detail && /* @__PURE__ */ jsx4("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap px-3 py-2 font-mono text-[11px] leading-relaxed text-muted-foreground", children: step.detail })
|
|
687
763
|
] }, i))
|
|
688
764
|
] }),
|
|
689
|
-
/* @__PURE__ */
|
|
765
|
+
/* @__PURE__ */ jsx4("p", { className: "border-t border-border px-4 py-2 text-[11px] text-muted-foreground/60", children: "Readonly drill-in. Follow up in the main chat." })
|
|
690
766
|
] });
|
|
691
767
|
}
|
|
692
768
|
function pendingApprovalOf(call) {
|
|
@@ -696,26 +772,26 @@ function pendingApprovalOf(call) {
|
|
|
696
772
|
}
|
|
697
773
|
function ToolGlyph({ name, className }) {
|
|
698
774
|
if (name.startsWith("sandbox_")) {
|
|
699
|
-
return /* @__PURE__ */
|
|
700
|
-
/* @__PURE__ */
|
|
701
|
-
/* @__PURE__ */
|
|
775
|
+
return /* @__PURE__ */ jsxs4("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
776
|
+
/* @__PURE__ */ jsx4("polyline", { points: "4 17 10 11 4 5" }),
|
|
777
|
+
/* @__PURE__ */ jsx4("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
702
778
|
] });
|
|
703
779
|
}
|
|
704
780
|
if (name === "submit_proposal") {
|
|
705
|
-
return /* @__PURE__ */
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
/* @__PURE__ */
|
|
781
|
+
return /* @__PURE__ */ jsxs4("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
782
|
+
/* @__PURE__ */ jsx4("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
783
|
+
/* @__PURE__ */ jsx4("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
|
|
708
784
|
] });
|
|
709
785
|
}
|
|
710
786
|
if (name === "schedule_followup") {
|
|
711
|
-
return /* @__PURE__ */
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
/* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ jsxs4("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
|
|
788
|
+
/* @__PURE__ */ jsx4("circle", { cx: "12", cy: "12", r: "9" }),
|
|
789
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 7v5l3 3" })
|
|
714
790
|
] });
|
|
715
791
|
}
|
|
716
|
-
return /* @__PURE__ */
|
|
717
|
-
/* @__PURE__ */
|
|
718
|
-
/* @__PURE__ */
|
|
792
|
+
return /* @__PURE__ */ jsxs4("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
793
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
|
|
794
|
+
/* @__PURE__ */ jsx4("circle", { cx: "12", cy: "12", r: "4" })
|
|
719
795
|
] });
|
|
720
796
|
}
|
|
721
797
|
function toolOutcomeOf(call) {
|
|
@@ -749,36 +825,36 @@ function truncate(v, max = 240) {
|
|
|
749
825
|
function KvRows({ data }) {
|
|
750
826
|
const entries = Object.entries(data).filter(([, v]) => v !== void 0 && v !== null && v !== "");
|
|
751
827
|
if (!entries.length) return null;
|
|
752
|
-
return /* @__PURE__ */
|
|
753
|
-
/* @__PURE__ */
|
|
754
|
-
/* @__PURE__ */
|
|
828
|
+
return /* @__PURE__ */ jsx4("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs4("div", { className: "contents", children: [
|
|
829
|
+
/* @__PURE__ */ jsx4("dt", { className: "font-mono text-[11px] text-muted-foreground/70", children: k }),
|
|
830
|
+
/* @__PURE__ */ jsx4("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-[11px] text-muted-foreground", children: truncate(v) })
|
|
755
831
|
] }, k)) });
|
|
756
832
|
}
|
|
757
833
|
function ShellDetail({ call }) {
|
|
758
834
|
const outcome = toolOutcomeOf(call);
|
|
759
835
|
const r = outcome?.result ?? {};
|
|
760
|
-
return /* @__PURE__ */
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
r.exitCode != null && /* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ jsxs4("div", { className: "overflow-hidden rounded-md bg-zinc-900 font-mono text-[11px] leading-relaxed", children: [
|
|
837
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 px-3 pt-2 text-zinc-400", children: [
|
|
838
|
+
/* @__PURE__ */ jsx4("span", { className: "select-none text-zinc-500", children: "$" }),
|
|
839
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1 truncate text-zinc-200", children: String(call.args?.command ?? "") }),
|
|
840
|
+
r.exitCode != null && /* @__PURE__ */ jsxs4("span", { className: r.exitCode === 0 ? "text-emerald-400" : "text-red-400", children: [
|
|
765
841
|
"exit ",
|
|
766
842
|
r.exitCode
|
|
767
843
|
] })
|
|
768
844
|
] }),
|
|
769
|
-
/* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ jsx4("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap px-3 pb-2.5 pt-1.5 text-zinc-300", children: outcome?.ok === false ? outcome.message ?? "failed" : [r.stdout, r.stderr].filter(Boolean).join("\n") || "(no output)" })
|
|
770
846
|
] });
|
|
771
847
|
}
|
|
772
848
|
function DefaultToolDetail({ call }) {
|
|
773
849
|
const outcome = toolOutcomeOf(call);
|
|
774
|
-
return /* @__PURE__ */
|
|
775
|
-
call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */
|
|
776
|
-
/* @__PURE__ */
|
|
777
|
-
/* @__PURE__ */
|
|
850
|
+
return /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
|
|
851
|
+
call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs4("div", { children: [
|
|
852
|
+
/* @__PURE__ */ jsx4("p", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/50", children: "Called with" }),
|
|
853
|
+
/* @__PURE__ */ jsx4(KvRows, { data: call.args })
|
|
778
854
|
] }),
|
|
779
|
-
outcome && /* @__PURE__ */
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
outcome.ok === false ? /* @__PURE__ */
|
|
855
|
+
outcome && /* @__PURE__ */ jsxs4("div", { children: [
|
|
856
|
+
/* @__PURE__ */ jsx4("p", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/50", children: outcome.ok === false ? "Failed" : "Result" }),
|
|
857
|
+
outcome.ok === false ? /* @__PURE__ */ jsx4("p", { className: "text-xs text-red-600", children: outcome.message ?? "Tool failed" }) : outcome.result && typeof outcome.result === "object" ? /* @__PURE__ */ jsx4(KvRows, { data: outcome.result }) : /* @__PURE__ */ jsx4("p", { className: "font-mono text-[11px] text-muted-foreground", children: truncate(outcome.result) })
|
|
782
858
|
] })
|
|
783
859
|
] });
|
|
784
860
|
}
|
|
@@ -793,28 +869,28 @@ function ToolCallCard({
|
|
|
793
869
|
const pending = call.status === "done" ? pendingApprovalOf(call) : null;
|
|
794
870
|
const failed = call.status === "error" || toolOutcomeOf(call)?.ok === false;
|
|
795
871
|
const custom = renderers?.[call.name]?.(call, message);
|
|
796
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ jsxs4(
|
|
797
873
|
"div",
|
|
798
874
|
{
|
|
799
875
|
className: `w-fit min-w-[280px] max-w-full rounded-lg border text-xs transition ${pending ? "border-amber-300/60 bg-amber-500/5" : failed ? "border-red-300/60 bg-red-500/5" : "border-border/60 bg-muted/20"}`,
|
|
800
876
|
children: [
|
|
801
|
-
/* @__PURE__ */
|
|
877
|
+
/* @__PURE__ */ jsxs4(
|
|
802
878
|
"button",
|
|
803
879
|
{
|
|
804
880
|
type: "button",
|
|
805
881
|
onClick: () => setExpanded((v) => !v),
|
|
806
882
|
className: "flex w-full items-center gap-2 px-3 py-2 text-left",
|
|
807
883
|
children: [
|
|
808
|
-
/* @__PURE__ */
|
|
884
|
+
/* @__PURE__ */ jsx4(
|
|
809
885
|
"span",
|
|
810
886
|
{
|
|
811
887
|
className: `h-2 w-2 shrink-0 rounded-full ${call.status === "running" ? "animate-pulse bg-yellow-500" : pending ? "bg-amber-500" : failed ? "bg-red-500" : "bg-green-500"}`
|
|
812
888
|
}
|
|
813
889
|
),
|
|
814
|
-
/* @__PURE__ */
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
pending && approval && /* @__PURE__ */
|
|
817
|
-
/* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ jsx4(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
891
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1 truncate font-medium", children: friendlyToolTitle(call) }),
|
|
892
|
+
pending && approval && /* @__PURE__ */ jsxs4("span", { className: "flex shrink-0 items-center gap-1", onClick: (e) => e.stopPropagation(), children: [
|
|
893
|
+
/* @__PURE__ */ jsx4(
|
|
818
894
|
"button",
|
|
819
895
|
{
|
|
820
896
|
type: "button",
|
|
@@ -823,7 +899,7 @@ function ToolCallCard({
|
|
|
823
899
|
children: "Approve"
|
|
824
900
|
}
|
|
825
901
|
),
|
|
826
|
-
/* @__PURE__ */
|
|
902
|
+
/* @__PURE__ */ jsx4(
|
|
827
903
|
"button",
|
|
828
904
|
{
|
|
829
905
|
type: "button",
|
|
@@ -833,14 +909,14 @@ function ToolCallCard({
|
|
|
833
909
|
}
|
|
834
910
|
)
|
|
835
911
|
] }),
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
912
|
+
/* @__PURE__ */ jsx4("span", { className: "shrink-0 text-[11px] text-muted-foreground/70", children: call.status === "running" ? "running\u2026" : pending ? "awaiting approval" : failed ? "failed" : "done" }),
|
|
913
|
+
/* @__PURE__ */ jsx4(ChevronDown, { className: `h-3 w-3 shrink-0 text-muted-foreground transition-transform ${expanded ? "rotate-180" : ""}` })
|
|
838
914
|
]
|
|
839
915
|
}
|
|
840
916
|
),
|
|
841
|
-
expanded && /* @__PURE__ */
|
|
842
|
-
custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */
|
|
843
|
-
onOpenRun && call.name.startsWith("sandbox_") && /* @__PURE__ */
|
|
917
|
+
expanded && /* @__PURE__ */ jsxs4("div", { className: "border-t border-border/40 px-3 py-2.5", children: [
|
|
918
|
+
custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx4(ShellDetail, { call }) : /* @__PURE__ */ jsx4(DefaultToolDetail, { call })),
|
|
919
|
+
onOpenRun && call.name.startsWith("sandbox_") && /* @__PURE__ */ jsx4(
|
|
844
920
|
"button",
|
|
845
921
|
{
|
|
846
922
|
type: "button",
|
|
@@ -880,22 +956,22 @@ function AssistantMessage({
|
|
|
880
956
|
const el = reasoningScrollRef.current;
|
|
881
957
|
if (el && streaming && !content) el.scrollTop = el.scrollHeight;
|
|
882
958
|
}, [reasoning, streaming, content]);
|
|
883
|
-
return /* @__PURE__ */
|
|
884
|
-
/* @__PURE__ */
|
|
885
|
-
/* @__PURE__ */
|
|
886
|
-
msg.modelUsed && /* @__PURE__ */
|
|
887
|
-
formatTokensPerSecond(msg) && /* @__PURE__ */
|
|
888
|
-
formatModelCost(msg, models) && /* @__PURE__ */
|
|
959
|
+
return /* @__PURE__ */ jsxs4("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
|
|
960
|
+
/* @__PURE__ */ jsxs4("div", { className: "mb-1 flex items-baseline gap-2 text-[11px] tracking-wide text-muted-foreground/60", children: [
|
|
961
|
+
/* @__PURE__ */ jsx4("span", { className: "font-semibold uppercase", children: agentLabel }),
|
|
962
|
+
msg.modelUsed && /* @__PURE__ */ jsx4("span", { className: "font-mono normal-case", children: msg.modelUsed }),
|
|
963
|
+
formatTokensPerSecond(msg) && /* @__PURE__ */ jsx4("span", { children: formatTokensPerSecond(msg) }),
|
|
964
|
+
formatModelCost(msg, models) && /* @__PURE__ */ jsx4("span", { children: formatModelCost(msg, models) })
|
|
889
965
|
] }),
|
|
890
|
-
reasoning && /* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
892
|
-
/* @__PURE__ */
|
|
966
|
+
reasoning && /* @__PURE__ */ jsxs4("details", { className: "mb-2 rounded-lg border-l-2 border-border/70 bg-muted/20 px-3 py-2", open: !content, children: [
|
|
967
|
+
/* @__PURE__ */ jsx4("summary", { className: "cursor-pointer select-none text-xs font-medium text-muted-foreground", children: !content ? /* @__PURE__ */ jsx4("span", { className: "animate-pulse", children: "Thinking\u2026" }) : thinkMsRef.current != null ? `Thought for ${Math.max(1, Math.round(thinkMsRef.current / 1e3))}s` : "Thought process" }),
|
|
968
|
+
/* @__PURE__ */ jsx4("div", { ref: reasoningScrollRef, className: "mt-2 max-h-48 overflow-y-auto whitespace-pre-wrap text-[13px] leading-relaxed text-muted-foreground/70", children: reasoning })
|
|
893
969
|
] }),
|
|
894
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ jsxs4("div", { className: "text-base leading-[1.75]", children: [
|
|
895
971
|
renderBody(content),
|
|
896
|
-
streaming && content && !msg.toolCalls?.length && /* @__PURE__ */
|
|
972
|
+
streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx4("span", { className: "ml-0.5 inline-block h-[1.1em] w-[3px] translate-y-[2px] animate-pulse rounded-sm bg-foreground/70", "aria-hidden": true })
|
|
897
973
|
] }),
|
|
898
|
-
msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */
|
|
974
|
+
msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx4("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc) => /* @__PURE__ */ jsx4(
|
|
899
975
|
ToolCallCard,
|
|
900
976
|
{
|
|
901
977
|
call: tc,
|
|
@@ -915,10 +991,10 @@ function ThinkingRow({ agentLabel }) {
|
|
|
915
991
|
const id = setInterval(() => setSeconds((s) => s + 1), 1e3);
|
|
916
992
|
return () => clearInterval(id);
|
|
917
993
|
}, []);
|
|
918
|
-
return /* @__PURE__ */
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
/* @__PURE__ */
|
|
994
|
+
return /* @__PURE__ */ jsxs4("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
|
|
995
|
+
/* @__PURE__ */ jsx4("p", { className: "mb-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground/60", children: agentLabel }),
|
|
996
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 text-base text-muted-foreground", children: [
|
|
997
|
+
/* @__PURE__ */ jsx4("svg", { className: "h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx4("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }),
|
|
922
998
|
"Thinking",
|
|
923
999
|
seconds >= 3 ? ` \xB7 ${seconds}s` : "..."
|
|
924
1000
|
] })
|
|
@@ -936,14 +1012,14 @@ function ChatMessages({
|
|
|
936
1012
|
onToolCallClick,
|
|
937
1013
|
toolRenderers
|
|
938
1014
|
}) {
|
|
939
|
-
const renderBody = renderMarkdown ?? ((content) => /* @__PURE__ */
|
|
1015
|
+
const renderBody = renderMarkdown ?? ((content) => /* @__PURE__ */ jsx4("p", { className: "whitespace-pre-wrap", children: content }));
|
|
940
1016
|
const lastIsUser = messages[messages.length - 1]?.role === "user";
|
|
941
|
-
return /* @__PURE__ */
|
|
1017
|
+
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
942
1018
|
messages.map(
|
|
943
|
-
(msg) => msg.role === "user" ? /* @__PURE__ */
|
|
944
|
-
/* @__PURE__ */
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
] }) }, msg.id) : /* @__PURE__ */
|
|
1019
|
+
(msg) => msg.role === "user" ? /* @__PURE__ */ jsx4("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs4("div", { className: "ml-auto w-fit max-w-[85%]", children: [
|
|
1020
|
+
/* @__PURE__ */ jsx4("p", { className: "mb-1 text-right text-[11px] font-semibold uppercase tracking-wide text-muted-foreground/60", children: userLabel }),
|
|
1021
|
+
/* @__PURE__ */ jsx4("div", { className: "rounded-2xl rounded-tr-md bg-primary/10 px-4 py-2.5 text-base leading-relaxed", children: /* @__PURE__ */ jsx4("p", { className: "whitespace-pre-wrap", children: msg.content }) })
|
|
1022
|
+
] }) }, msg.id) : /* @__PURE__ */ jsx4(
|
|
947
1023
|
AssistantMessage,
|
|
948
1024
|
{
|
|
949
1025
|
msg,
|
|
@@ -959,7 +1035,7 @@ function ChatMessages({
|
|
|
959
1035
|
msg.id
|
|
960
1036
|
)
|
|
961
1037
|
),
|
|
962
|
-
loading && lastIsUser && /* @__PURE__ */
|
|
1038
|
+
loading && lastIsUser && /* @__PURE__ */ jsx4(ThinkingRow, { agentLabel })
|
|
963
1039
|
] });
|
|
964
1040
|
}
|
|
965
1041
|
export {
|
|
@@ -971,6 +1047,7 @@ export {
|
|
|
971
1047
|
ModelPicker,
|
|
972
1048
|
ProviderLogo,
|
|
973
1049
|
RunDrillIn,
|
|
1050
|
+
SeatPaywall,
|
|
974
1051
|
activityTone,
|
|
975
1052
|
consumeChatStream,
|
|
976
1053
|
dispatchChatStreamLine,
|