@volter-ai-dev/supercode-ui 0.1.20 → 0.1.21
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/README.md +7 -4
- package/components.mjs +193 -39
- package/composer.mjs +127 -23
- package/controller.mjs +21 -2
- package/conversation.mjs +213 -195
- package/core.mjs +12 -0
- package/embed.mjs +193 -39
- package/icon.mjs +5 -0
- package/index.d.ts +15 -5
- package/messenger.mjs +193 -39
- package/package.json +1 -1
- package/sessions.mjs +45 -36
- package/styles.css +2 -0
package/conversation.mjs
CHANGED
|
@@ -591,6 +591,11 @@ var ICONS = {
|
|
|
591
591
|
/* @__PURE__ */ jsx2("path", { d: "M9 3.5v10" }),
|
|
592
592
|
/* @__PURE__ */ jsx2("path", { d: "m4.75 9.5 4.25 4 4.25-4" })
|
|
593
593
|
] }),
|
|
594
|
+
image: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
595
|
+
/* @__PURE__ */ jsx2("rect", { x: "3", y: "3.5", width: "12", height: "11", rx: "1.75" }),
|
|
596
|
+
/* @__PURE__ */ jsx2("circle", { cx: "6.5", cy: "7", r: "1.25" }),
|
|
597
|
+
/* @__PURE__ */ jsx2("path", { d: "m4.5 13 3.25-3 2.1 1.85 1.65-1.5L14 13" })
|
|
598
|
+
] }),
|
|
594
599
|
menu: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
595
600
|
/* @__PURE__ */ jsx2("circle", { cx: "4", cy: "9", r: "1.25", fill: "currentColor", stroke: "none" }),
|
|
596
601
|
/* @__PURE__ */ jsx2("circle", { cx: "9", cy: "9", r: "1.25", fill: "currentColor", stroke: "none" }),
|
|
@@ -616,8 +621,19 @@ function UiIcon({ name, size = 16, class: className = "" }) {
|
|
|
616
621
|
return /* @__PURE__ */ jsx2("svg", { class: `scui-icon ${className}`, style: { "--scui-icon-size": `${size}px` }, viewBox: "0 0 18 18", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx2(Glyph, {}) });
|
|
617
622
|
}
|
|
618
623
|
|
|
624
|
+
// src/context.jsx
|
|
625
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "preact/jsx-runtime";
|
|
626
|
+
var MAX_IMAGE_BYTES = 5 * 1024 * 1024;
|
|
627
|
+
function MessageImages({ items }) {
|
|
628
|
+
if (!items?.length) return null;
|
|
629
|
+
return /* @__PURE__ */ jsx3("div", { class: "scui-message-images", children: items.map((item, index) => item.url ? /* @__PURE__ */ jsx3("img", { src: item.url, alt: item.label }, item.id ?? `${item.label}:${index}`) : /* @__PURE__ */ jsxs2("span", { children: [
|
|
630
|
+
/* @__PURE__ */ jsx3(UiIcon, { name: "image", size: 14 }),
|
|
631
|
+
item.label
|
|
632
|
+
] }, item.id ?? `${item.label}:${index}`)) });
|
|
633
|
+
}
|
|
634
|
+
|
|
619
635
|
// src/conversation.jsx
|
|
620
|
-
import { Fragment as Fragment3, jsx as
|
|
636
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs3 } from "preact/jsx-runtime";
|
|
621
637
|
function LoadingStatus({ state, compact = false }) {
|
|
622
638
|
const copy = {
|
|
623
639
|
connecting: ["Connecting to coding agents", "Checking installed harnesses and capabilities.", 0],
|
|
@@ -625,43 +641,43 @@ function LoadingStatus({ state, compact = false }) {
|
|
|
625
641
|
discovering: ["Loading recent sessions", "Scanning native session stores without loading full transcripts.", 2],
|
|
626
642
|
ready: ["Ready", "Coding sessions are up to date.", 3]
|
|
627
643
|
}[state.startup];
|
|
628
|
-
return /* @__PURE__ */
|
|
629
|
-
/* @__PURE__ */
|
|
630
|
-
/* @__PURE__ */
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */
|
|
644
|
+
return /* @__PURE__ */ jsxs3("div", { class: `scui-loading${compact ? " scui-loading-compact" : ""}`, role: "status", "aria-busy": state.startup !== "ready", children: [
|
|
645
|
+
/* @__PURE__ */ jsx4("span", { class: "scui-orbit", "aria-hidden": "true", children: /* @__PURE__ */ jsx4("i", {}) }),
|
|
646
|
+
/* @__PURE__ */ jsxs3("span", { class: "scui-loading-copy", children: [
|
|
647
|
+
/* @__PURE__ */ jsx4("strong", { children: copy[0] }),
|
|
648
|
+
/* @__PURE__ */ jsx4("small", { children: copy[1] })
|
|
633
649
|
] }),
|
|
634
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ jsx4("span", { class: "scui-progress", "aria-hidden": "true", children: [1, 2, 3].map((step) => /* @__PURE__ */ jsx4("i", { "data-progress": step <= copy[2] ? "done" : step === copy[2] + 1 ? "current" : "waiting" }, step)) })
|
|
635
651
|
] });
|
|
636
652
|
}
|
|
637
653
|
function RequestCard({ entry, adapter, canRespond }) {
|
|
638
654
|
const request = entry.request;
|
|
639
655
|
if (!request) return null;
|
|
640
656
|
if (request.status === "responded") {
|
|
641
|
-
return /* @__PURE__ */
|
|
657
|
+
return /* @__PURE__ */ jsxs3("div", { class: "scui-request-done", children: [
|
|
642
658
|
"\u2713 Request answered \xB7 ",
|
|
643
659
|
request.resolution?.name ?? request.requestKind
|
|
644
660
|
] });
|
|
645
661
|
}
|
|
646
|
-
return /* @__PURE__ */
|
|
647
|
-
/* @__PURE__ */
|
|
648
|
-
/* @__PURE__ */
|
|
649
|
-
/* @__PURE__ */
|
|
650
|
-
request.options.map((option) => /* @__PURE__ */
|
|
651
|
-
request.cancellable ? /* @__PURE__ */
|
|
662
|
+
return /* @__PURE__ */ jsxs3("section", { class: "scui-request", role: "alert", "aria-label": `${request.requestKind} needs input`, children: [
|
|
663
|
+
/* @__PURE__ */ jsx4("strong", { children: "Agent needs input" }),
|
|
664
|
+
/* @__PURE__ */ jsx4(Markdown, { value: request.payloadText || entry.text, copyText: adapter?.copyText }),
|
|
665
|
+
/* @__PURE__ */ jsxs3("div", { class: "scui-request-actions", children: [
|
|
666
|
+
request.options.map((option) => /* @__PURE__ */ jsx4("button", { type: "button", disabled: !canRespond, onClick: () => adapter.onIntent({ action: "respond", requestId: request.requestId, optionId: option.optionId }), children: option.name }, option.optionId)),
|
|
667
|
+
request.cancellable ? /* @__PURE__ */ jsx4("button", { type: "button", disabled: !canRespond, onClick: () => adapter.onIntent({ action: "respond", requestId: request.requestId, optionId: null }), children: "Cancel" }) : null
|
|
652
668
|
] })
|
|
653
669
|
] });
|
|
654
670
|
}
|
|
655
671
|
function ContextDisclosure({ context }) {
|
|
656
672
|
if (!context?.length) return null;
|
|
657
|
-
return /* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
673
|
+
return /* @__PURE__ */ jsxs3("details", { class: "scui-context", children: [
|
|
674
|
+
/* @__PURE__ */ jsxs3("summary", { children: [
|
|
659
675
|
"Context \xB7 ",
|
|
660
676
|
context.length
|
|
661
677
|
] }),
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ jsx4("div", { children: context.map((item, index) => /* @__PURE__ */ jsxs3("p", { children: [
|
|
679
|
+
/* @__PURE__ */ jsx4("strong", { children: item.label }),
|
|
680
|
+
/* @__PURE__ */ jsx4("span", { children: item.detail })
|
|
665
681
|
] }, item.id ?? index)) })
|
|
666
682
|
] });
|
|
667
683
|
}
|
|
@@ -683,46 +699,46 @@ function MessageMeta({ entry, adapter }) {
|
|
|
683
699
|
reset.current = setTimeout(() => setCopyState2("idle"), 1500);
|
|
684
700
|
};
|
|
685
701
|
const copyLabel = copyState === "copied" ? "Message copied" : copyState === "failed" ? "Copy failed \xB7 retry" : "Copy message";
|
|
686
|
-
return /* @__PURE__ */
|
|
687
|
-
validDate ? /* @__PURE__ */
|
|
688
|
-
adapter?.copyText && entry.text ? /* @__PURE__ */
|
|
702
|
+
return /* @__PURE__ */ jsxs3("footer", { class: "scui-message-meta", children: [
|
|
703
|
+
validDate ? /* @__PURE__ */ jsx4("time", { dateTime: validDate.toISOString(), title: validDate.toLocaleString(), children: validDate.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) }) : null,
|
|
704
|
+
adapter?.copyText && entry.text ? /* @__PURE__ */ jsx4("button", { type: "button", "aria-label": copyLabel, title: copyLabel, onClick: copy, "data-status": copyState, children: /* @__PURE__ */ jsx4(UiIcon, { name: "copy", size: 13 }) }) : null
|
|
689
705
|
] });
|
|
690
706
|
}
|
|
691
707
|
var TOOL_ICONS = {
|
|
692
|
-
read: () => /* @__PURE__ */
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
/* @__PURE__ */
|
|
708
|
+
read: () => /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
709
|
+
/* @__PURE__ */ jsx4("path", { d: "M5 2.75h7.25L15 5.5v7.75A1.75 1.75 0 0 1 13.25 15h-8.5A1.75 1.75 0 0 1 3 13.25v-8.5A2 2 0 0 1 5 2.75Z" }),
|
|
710
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 2.9v3h2.85M6 9h6M6 12h4" })
|
|
695
711
|
] }),
|
|
696
|
-
search: () => /* @__PURE__ */
|
|
697
|
-
/* @__PURE__ */
|
|
698
|
-
/* @__PURE__ */
|
|
712
|
+
search: () => /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
713
|
+
/* @__PURE__ */ jsx4("circle", { cx: "8", cy: "8", r: "4.5" }),
|
|
714
|
+
/* @__PURE__ */ jsx4("path", { d: "m11.5 11.5 3 3" })
|
|
699
715
|
] }),
|
|
700
|
-
edit: () => /* @__PURE__ */
|
|
701
|
-
/* @__PURE__ */
|
|
702
|
-
/* @__PURE__ */
|
|
716
|
+
edit: () => /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
717
|
+
/* @__PURE__ */ jsx4("path", { d: "m11.75 3.25 3 3-8.5 8.5-3.75.75.75-3.75 8.5-8.5Z" }),
|
|
718
|
+
/* @__PURE__ */ jsx4("path", { d: "m10 5 3 3" })
|
|
703
719
|
] }),
|
|
704
|
-
command: () => /* @__PURE__ */
|
|
705
|
-
test: () => /* @__PURE__ */
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
/* @__PURE__ */
|
|
720
|
+
command: () => /* @__PURE__ */ jsx4(Fragment3, { children: /* @__PURE__ */ jsx4("path", { d: "m3 5 3 3-3 3M8 12h6" }) }),
|
|
721
|
+
test: () => /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
722
|
+
/* @__PURE__ */ jsx4("path", { d: "M6 2.5v3L3 12a2 2 0 0 0 1.8 3h8.4a2 2 0 0 0 1.8-3l-3-6.5v-3M5 9h8" }),
|
|
723
|
+
/* @__PURE__ */ jsx4("path", { d: "M5 2.5h8" })
|
|
708
724
|
] }),
|
|
709
|
-
web: () => /* @__PURE__ */
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
/* @__PURE__ */
|
|
725
|
+
web: () => /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
726
|
+
/* @__PURE__ */ jsx4("circle", { cx: "9", cy: "9", r: "6.5" }),
|
|
727
|
+
/* @__PURE__ */ jsx4("path", { d: "M2.75 9h12.5M9 2.5c2 1.8 3 4 3 6.5s-1 4.7-3 6.5c-2-1.8-3-4-3-6.5s1-4.7 3-6.5Z" })
|
|
712
728
|
] }),
|
|
713
|
-
agent: () => /* @__PURE__ */
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
/* @__PURE__ */
|
|
729
|
+
agent: () => /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
730
|
+
/* @__PURE__ */ jsx4("circle", { cx: "9", cy: "6", r: "2.5" }),
|
|
731
|
+
/* @__PURE__ */ jsx4("path", { d: "M4 15c.4-3 2-4.5 5-4.5s4.6 1.5 5 4.5" })
|
|
716
732
|
] }),
|
|
717
|
-
plan: () => /* @__PURE__ */
|
|
718
|
-
other: () => /* @__PURE__ */
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
733
|
+
plan: () => /* @__PURE__ */ jsx4(Fragment3, { children: /* @__PURE__ */ jsx4("path", { d: "m3 5 1 1 2-2M3 9l1 1 2-2M3 13l1 1 2-2M8 5h7M8 9h7M8 13h7" }) }),
|
|
734
|
+
other: () => /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
735
|
+
/* @__PURE__ */ jsx4("path", { d: "M9 2.5v3M9 12.5v3M2.5 9h3M12.5 9h3" }),
|
|
736
|
+
/* @__PURE__ */ jsx4("circle", { cx: "9", cy: "9", r: "3.5" })
|
|
721
737
|
] })
|
|
722
738
|
};
|
|
723
739
|
function ToolIcon({ category }) {
|
|
724
740
|
const Glyph = TOOL_ICONS[category] ?? TOOL_ICONS.other;
|
|
725
|
-
return /* @__PURE__ */
|
|
741
|
+
return /* @__PURE__ */ jsx4("svg", { class: "scui-tool-icon", viewBox: "0 0 18 18", fill: "none", stroke: "currentColor", "stroke-width": "1.35", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx4(Glyph, {}) });
|
|
726
742
|
}
|
|
727
743
|
function toolAction2(entry, category, presentation) {
|
|
728
744
|
if (presentation?.action) return presentation.action;
|
|
@@ -777,7 +793,7 @@ function ToolMetrics({ presentation }) {
|
|
|
777
793
|
presentation.exitCode === null ? "" : `exit ${presentation.exitCode}`,
|
|
778
794
|
formatDuration(presentation.durationMs)
|
|
779
795
|
].filter(Boolean);
|
|
780
|
-
return metrics.length ? /* @__PURE__ */
|
|
796
|
+
return metrics.length ? /* @__PURE__ */ jsx4("div", { class: "scui-tool-metrics", children: metrics.map((metric) => /* @__PURE__ */ jsx4("span", { children: metric }, metric)) }) : null;
|
|
781
797
|
}
|
|
782
798
|
function PendingElapsed({ now }) {
|
|
783
799
|
const clock = now ?? Date.now;
|
|
@@ -787,74 +803,74 @@ function PendingElapsed({ now }) {
|
|
|
787
803
|
const timer = setInterval(() => setElapsed(Math.max(0, clock() - started.current)), 1e3);
|
|
788
804
|
return () => clearInterval(timer);
|
|
789
805
|
}, [clock]);
|
|
790
|
-
return /* @__PURE__ */
|
|
806
|
+
return /* @__PURE__ */ jsx4("small", { class: "scui-tool-elapsed", children: elapsed < 1e3 ? "now" : formatDuration(elapsed) });
|
|
791
807
|
}
|
|
792
808
|
function LinePreview({ value, kind }) {
|
|
793
809
|
if (!value) return null;
|
|
794
|
-
return /* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ jsx4("ol", { class: "scui-code-preview", "data-kind": kind, children: stripAnsi(value).split("\n").map((line, index) => {
|
|
795
811
|
const tone = kind === "diff" ? line.startsWith("+") && !line.startsWith("+++") ? "add" : line.startsWith("-") && !line.startsWith("---") ? "remove" : line.startsWith("@@") ? "hunk" : "plain" : "plain";
|
|
796
|
-
return /* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
/* @__PURE__ */
|
|
812
|
+
return /* @__PURE__ */ jsxs3("li", { "data-tone": tone, children: [
|
|
813
|
+
/* @__PURE__ */ jsx4("span", { children: index + 1 }),
|
|
814
|
+
/* @__PURE__ */ jsx4("code", { children: line || " " })
|
|
799
815
|
] }, index);
|
|
800
816
|
}) });
|
|
801
817
|
}
|
|
802
818
|
function TerminalPreview({ presentation, pending, failed }) {
|
|
803
|
-
return /* @__PURE__ */
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
/* @__PURE__ */
|
|
808
|
-
/* @__PURE__ */
|
|
819
|
+
return /* @__PURE__ */ jsxs3("section", { class: "scui-terminal", children: [
|
|
820
|
+
/* @__PURE__ */ jsxs3("header", { children: [
|
|
821
|
+
/* @__PURE__ */ jsxs3("span", { "aria-hidden": "true", children: [
|
|
822
|
+
/* @__PURE__ */ jsx4("i", {}),
|
|
823
|
+
/* @__PURE__ */ jsx4("i", {}),
|
|
824
|
+
/* @__PURE__ */ jsx4("i", {})
|
|
809
825
|
] }),
|
|
810
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ jsx4("code", { children: presentation.command ? `$ ${presentation.command}` : "Terminal" })
|
|
811
827
|
] }),
|
|
812
|
-
presentation.preview ? /* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
828
|
+
presentation.preview ? /* @__PURE__ */ jsx4("pre", { "data-error": failed, children: stripAnsi(presentation.preview) }) : pending ? /* @__PURE__ */ jsxs3("div", { class: "scui-terminal-wait", children: [
|
|
829
|
+
/* @__PURE__ */ jsx4("i", {}),
|
|
814
830
|
" Waiting for output"
|
|
815
|
-
] }) : /* @__PURE__ */
|
|
831
|
+
] }) : /* @__PURE__ */ jsx4("div", { class: "scui-terminal-empty", children: "No output" })
|
|
816
832
|
] });
|
|
817
833
|
}
|
|
818
834
|
function SearchPreview({ presentation }) {
|
|
819
835
|
const lines = stripAnsi(presentation.preview).split("\n").filter(Boolean);
|
|
820
|
-
return /* @__PURE__ */
|
|
821
|
-
presentation.query ? /* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ jsxs3("section", { class: "scui-search-preview", children: [
|
|
837
|
+
presentation.query ? /* @__PURE__ */ jsxs3("header", { children: [
|
|
838
|
+
/* @__PURE__ */ jsx4("span", { children: "Search" }),
|
|
839
|
+
/* @__PURE__ */ jsx4("code", { children: presentation.query })
|
|
824
840
|
] }) : null,
|
|
825
|
-
lines.length ? /* @__PURE__ */
|
|
841
|
+
lines.length ? /* @__PURE__ */ jsx4("ol", { children: lines.map((line, index) => {
|
|
826
842
|
const match = /^(.*?):(\d+)(?::(\d+))?:(.*)$/.exec(line);
|
|
827
|
-
return /* @__PURE__ */
|
|
828
|
-
/* @__PURE__ */
|
|
829
|
-
/* @__PURE__ */
|
|
843
|
+
return /* @__PURE__ */ jsx4("li", { children: match ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
844
|
+
/* @__PURE__ */ jsx4("code", { children: match[1] }),
|
|
845
|
+
/* @__PURE__ */ jsxs3("small", { children: [
|
|
830
846
|
match[2],
|
|
831
847
|
match[3] ? `:${match[3]}` : ""
|
|
832
848
|
] }),
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
] }) : /* @__PURE__ */
|
|
835
|
-
}) }) : /* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ jsx4("span", { children: match[4] })
|
|
850
|
+
] }) : /* @__PURE__ */ jsx4("span", { children: line }) }, index);
|
|
851
|
+
}) }) : /* @__PURE__ */ jsx4("p", { children: "No textual results" })
|
|
836
852
|
] });
|
|
837
853
|
}
|
|
838
854
|
function ToolPreview({ presentation, entry }) {
|
|
839
855
|
const pending = entry.status === "pending";
|
|
840
856
|
const failed = entry.status === "error";
|
|
841
|
-
if (presentation.detail === "terminal") return /* @__PURE__ */
|
|
842
|
-
if (presentation.detail === "diff") return presentation.preview ? /* @__PURE__ */
|
|
843
|
-
if (presentation.detail === "file") return presentation.preview ? /* @__PURE__ */
|
|
844
|
-
if (presentation.detail === "matches") return /* @__PURE__ */
|
|
845
|
-
if (presentation.detail === "web") return /* @__PURE__ */
|
|
846
|
-
presentation.url ? /* @__PURE__ */
|
|
847
|
-
presentation.preview ? /* @__PURE__ */
|
|
857
|
+
if (presentation.detail === "terminal") return /* @__PURE__ */ jsx4(TerminalPreview, { presentation, pending, failed });
|
|
858
|
+
if (presentation.detail === "diff") return presentation.preview ? /* @__PURE__ */ jsx4(LinePreview, { value: presentation.preview, kind: "diff" }) : /* @__PURE__ */ jsx4("div", { class: "scui-tool-empty", children: "Edit completed without a textual diff" });
|
|
859
|
+
if (presentation.detail === "file") return presentation.preview ? /* @__PURE__ */ jsx4(LinePreview, { value: presentation.preview, kind: "file" }) : /* @__PURE__ */ jsx4("div", { class: "scui-tool-empty", children: "File contents were not included in this event" });
|
|
860
|
+
if (presentation.detail === "matches") return /* @__PURE__ */ jsx4(SearchPreview, { presentation });
|
|
861
|
+
if (presentation.detail === "web") return /* @__PURE__ */ jsxs3("section", { class: "scui-web-preview", children: [
|
|
862
|
+
presentation.url ? /* @__PURE__ */ jsx4("code", { children: presentation.url }) : null,
|
|
863
|
+
presentation.preview ? /* @__PURE__ */ jsx4("p", { children: stripAnsi(presentation.preview) }) : /* @__PURE__ */ jsx4("small", { children: pending ? "Waiting for the page" : "No page summary returned" })
|
|
848
864
|
] });
|
|
849
|
-
if (presentation.detail === "agent") return /* @__PURE__ */
|
|
850
|
-
/* @__PURE__ */
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
] }, `${item.label}:${index}`)) }) : presentation.preview ? /* @__PURE__ */
|
|
853
|
-
if (presentation.detail === "plan") return /* @__PURE__ */
|
|
854
|
-
/* @__PURE__ */
|
|
855
|
-
/* @__PURE__ */
|
|
865
|
+
if (presentation.detail === "agent") return /* @__PURE__ */ jsx4("section", { class: "scui-agent-preview", children: presentation.items?.length ? /* @__PURE__ */ jsx4("ol", { class: "scui-agent-roster", children: presentation.items.map((item, index) => /* @__PURE__ */ jsxs3("li", { children: [
|
|
866
|
+
/* @__PURE__ */ jsx4("strong", { children: item.label }),
|
|
867
|
+
/* @__PURE__ */ jsx4("small", { children: item.status })
|
|
868
|
+
] }, `${item.label}:${index}`)) }) : presentation.preview ? /* @__PURE__ */ jsx4("pre", { children: stripAnsi(presentation.preview) }) : /* @__PURE__ */ jsx4("small", { children: pending ? "Agent is working" : "No textual handoff returned" }) });
|
|
869
|
+
if (presentation.detail === "plan") return /* @__PURE__ */ jsx4("ol", { class: "scui-plan-preview", children: presentation.items?.map((item, index) => /* @__PURE__ */ jsxs3("li", { "data-status": item.status, children: [
|
|
870
|
+
/* @__PURE__ */ jsx4("i", { "aria-hidden": "true" }),
|
|
871
|
+
/* @__PURE__ */ jsx4("span", { children: item.label })
|
|
856
872
|
] }, `${item.label}:${index}`)) });
|
|
857
|
-
return presentation.preview ? /* @__PURE__ */
|
|
873
|
+
return presentation.preview ? /* @__PURE__ */ jsx4("pre", { class: "scui-tool-output", "data-error": failed, children: stripAnsi(presentation.preview) }) : null;
|
|
858
874
|
}
|
|
859
875
|
function ToolActions({ presentation, adapter }) {
|
|
860
876
|
const [copied, setCopied] = useState(false);
|
|
@@ -868,27 +884,27 @@ function ToolActions({ presentation, adapter }) {
|
|
|
868
884
|
clearTimeout(reset.current);
|
|
869
885
|
reset.current = setTimeout(() => setCopied(false), 1500);
|
|
870
886
|
};
|
|
871
|
-
return action ? /* @__PURE__ */
|
|
887
|
+
return action ? /* @__PURE__ */ jsx4("div", { class: "scui-tool-actions", children: /* @__PURE__ */ jsx4("button", { type: "button", onClick: copy, children: copied ? "Copied" : action[0] }) }) : null;
|
|
872
888
|
}
|
|
873
889
|
function ToolStack({ tools }) {
|
|
874
890
|
if (tools.length < 2) return null;
|
|
875
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ jsx4("div", { class: "scui-tool-stack", "aria-label": "Coordinated tools", children: tools.map((tool) => /* @__PURE__ */ jsx4("span", { children: tool.replaceAll("__", " \xB7 ").replaceAll("_", " ") }, tool)) });
|
|
876
892
|
}
|
|
877
893
|
function TechnicalDetails({ entry }) {
|
|
878
894
|
if (!entry.arguments && !entry.resultText) return null;
|
|
879
|
-
return /* @__PURE__ */
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
-
entry.arguments ? /* @__PURE__ */
|
|
883
|
-
/* @__PURE__ */
|
|
884
|
-
/* @__PURE__ */
|
|
885
|
-
/* @__PURE__ */
|
|
886
|
-
/* @__PURE__ */
|
|
895
|
+
return /* @__PURE__ */ jsxs3("details", { class: "scui-tool-technical", children: [
|
|
896
|
+
/* @__PURE__ */ jsx4("summary", { children: "Technical details" }),
|
|
897
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
898
|
+
entry.arguments ? /* @__PURE__ */ jsxs3("section", { children: [
|
|
899
|
+
/* @__PURE__ */ jsx4("strong", { children: "Native arguments" }),
|
|
900
|
+
/* @__PURE__ */ jsx4("dl", { children: argumentRows(entry.arguments).map((row) => /* @__PURE__ */ jsxs3("div", { children: [
|
|
901
|
+
/* @__PURE__ */ jsx4("dt", { children: row.label }),
|
|
902
|
+
/* @__PURE__ */ jsx4("dd", { children: /* @__PURE__ */ jsx4("pre", { children: row.value }) })
|
|
887
903
|
] }, row.key)) })
|
|
888
904
|
] }) : null,
|
|
889
|
-
entry.resultText ? /* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
905
|
+
entry.resultText ? /* @__PURE__ */ jsxs3("section", { children: [
|
|
906
|
+
/* @__PURE__ */ jsx4("strong", { children: "Native result" }),
|
|
907
|
+
/* @__PURE__ */ jsxs3("pre", { "data-error": entry.status === "error", children: [
|
|
892
908
|
entry.resultText,
|
|
893
909
|
entry.truncated ? "\n[truncated]" : ""
|
|
894
910
|
] })
|
|
@@ -897,19 +913,20 @@ function TechnicalDetails({ entry }) {
|
|
|
897
913
|
] });
|
|
898
914
|
}
|
|
899
915
|
function TranscriptEntry({ entry, state, adapter }) {
|
|
900
|
-
if (entry.role === "request") return /* @__PURE__ */
|
|
916
|
+
if (entry.role === "request") return /* @__PURE__ */ jsx4(RequestCard, { entry, adapter, canRespond: state.canRespond });
|
|
901
917
|
if (entry.role === "reasoning") {
|
|
902
|
-
return /* @__PURE__ */
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
918
|
+
return /* @__PURE__ */ jsxs3("details", { class: "scui-reasoning", open: entry.streaming, children: [
|
|
919
|
+
/* @__PURE__ */ jsx4("summary", { children: entry.streaming ? "Reasoning\u2026" : "Reasoning" }),
|
|
920
|
+
/* @__PURE__ */ jsx4(Markdown, { value: entry.text, copyText: adapter?.copyText })
|
|
905
921
|
] });
|
|
906
922
|
}
|
|
907
|
-
if (entry.role === "notice" || entry.role === "system") return /* @__PURE__ */
|
|
908
|
-
return /* @__PURE__ */
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
911
|
-
|
|
912
|
-
/* @__PURE__ */
|
|
923
|
+
if (entry.role === "notice" || entry.role === "system") return /* @__PURE__ */ jsx4("div", { class: "scui-notice", "data-code": entry.code, children: entry.text });
|
|
924
|
+
return /* @__PURE__ */ jsxs3("article", { class: "scui-message", "data-role": entry.role, "aria-label": `${entry.role === "user" ? "Your" : "Assistant"} message`, children: [
|
|
925
|
+
/* @__PURE__ */ jsx4(MessageImages, { items: entry.images }),
|
|
926
|
+
/* @__PURE__ */ jsx4(Markdown, { value: entry.text, copyText: adapter?.copyText }),
|
|
927
|
+
/* @__PURE__ */ jsx4(ContextDisclosure, { context: entry.context }),
|
|
928
|
+
entry.truncated ? /* @__PURE__ */ jsx4("small", { class: "scui-truncated", children: "Entry truncated by host \xB7 load native session for the complete value" }) : null,
|
|
929
|
+
/* @__PURE__ */ jsx4(MessageMeta, { entry, adapter })
|
|
913
930
|
] });
|
|
914
931
|
}
|
|
915
932
|
function ToolRow({ entry, workspace, open = false, adapter }) {
|
|
@@ -921,102 +938,102 @@ function ToolRow({ entry, workspace, open = false, adapter }) {
|
|
|
921
938
|
const target = compactToolTarget(presentation.target, workspace);
|
|
922
939
|
const hasDetail = Boolean(entry.arguments || entry.resultText || presentation.preview || presentation.fields.length);
|
|
923
940
|
const category = presentation.category ?? toolCategory(entry);
|
|
924
|
-
const summary = /* @__PURE__ */
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
target ? /* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
entry.status === "pending" ? /* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
hasDetail ? /* @__PURE__ */
|
|
941
|
+
const summary = /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
942
|
+
/* @__PURE__ */ jsx4(ToolIcon, { category }),
|
|
943
|
+
/* @__PURE__ */ jsx4("strong", { children: toolAction2(entry, category, presentation) }),
|
|
944
|
+
target ? /* @__PURE__ */ jsx4("code", { class: "scui-tool-target", title: presentation.target, children: target }) : null,
|
|
945
|
+
/* @__PURE__ */ jsx4("span", { class: "scui-spacer" }),
|
|
946
|
+
entry.status === "pending" ? /* @__PURE__ */ jsx4(PendingElapsed, { now: adapter?.now }) : null,
|
|
947
|
+
/* @__PURE__ */ jsx4("span", { class: "scui-tool-status", role: "status", "data-status": entry.status ?? "completed", "aria-label": entry.status ?? "completed", children: entry.status === "pending" ? /* @__PURE__ */ jsx4("i", {}) : /* @__PURE__ */ jsx4(UiIcon, { name: entry.status === "error" ? "close" : "check", size: 12 }) }),
|
|
948
|
+
hasDetail ? /* @__PURE__ */ jsx4(UiIcon, { name: "chevron", size: 14, class: "scui-tool-chevron" }) : null
|
|
932
949
|
] });
|
|
933
|
-
if (!hasDetail) return /* @__PURE__ */
|
|
934
|
-
return /* @__PURE__ */
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
/* @__PURE__ */
|
|
940
|
-
presentation.fields.length ? /* @__PURE__ */
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
/* @__PURE__ */
|
|
950
|
+
if (!hasDetail) return /* @__PURE__ */ jsx4("div", { class: "scui-tool", "data-status": entry.status ?? "completed", "data-category": category, children: /* @__PURE__ */ jsx4("div", { class: "scui-tool-head", children: summary }) });
|
|
951
|
+
return /* @__PURE__ */ jsxs3("details", { class: "scui-tool", "data-status": entry.status ?? "completed", "data-category": category, open: expanded, onToggle: (event) => setExpanded(event.currentTarget.open), children: [
|
|
952
|
+
/* @__PURE__ */ jsx4("summary", { class: "scui-tool-head", children: summary }),
|
|
953
|
+
/* @__PURE__ */ jsxs3("div", { class: "scui-tool-detail", children: [
|
|
954
|
+
/* @__PURE__ */ jsx4(ToolMetrics, { presentation }),
|
|
955
|
+
/* @__PURE__ */ jsx4(ToolStack, { tools: presentation.tools ?? [] }),
|
|
956
|
+
/* @__PURE__ */ jsx4(ToolPreview, { presentation, entry }),
|
|
957
|
+
presentation.fields.length ? /* @__PURE__ */ jsx4("dl", { class: "scui-tool-fields", children: presentation.fields.map((field) => /* @__PURE__ */ jsxs3("div", { children: [
|
|
958
|
+
/* @__PURE__ */ jsx4("dt", { children: field.label }),
|
|
959
|
+
/* @__PURE__ */ jsx4("dd", { children: field.value })
|
|
943
960
|
] }, field.label)) }) : null,
|
|
944
|
-
/* @__PURE__ */
|
|
945
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ jsx4(ToolActions, { presentation, adapter }),
|
|
962
|
+
/* @__PURE__ */ jsx4(TechnicalDetails, { entry })
|
|
946
963
|
] })
|
|
947
964
|
] });
|
|
948
965
|
}
|
|
949
966
|
function ActivityGroup({ entries, state, adapter }) {
|
|
950
|
-
if (entries.length === 1) return /* @__PURE__ */
|
|
967
|
+
if (entries.length === 1) return /* @__PURE__ */ jsx4("section", { class: "scui-activity", "data-single": "true", children: /* @__PURE__ */ jsx4(ToolRow, { entry: entries[0], workspace: state.workspace, adapter }) });
|
|
951
968
|
const active = entries.some((entry) => entry.status === "pending");
|
|
952
969
|
const [open, setOpen] = useState(active);
|
|
953
970
|
const id = useId();
|
|
954
971
|
useEffect2(() => {
|
|
955
972
|
if (active) setOpen(true);
|
|
956
973
|
}, [active]);
|
|
957
|
-
return /* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
/* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
/* @__PURE__ */
|
|
974
|
+
return /* @__PURE__ */ jsxs3("section", { class: "scui-activity", children: [
|
|
975
|
+
/* @__PURE__ */ jsxs3("button", { class: "scui-activity-head", type: "button", "aria-expanded": open, "aria-controls": id, onClick: () => setOpen((value) => !value), children: [
|
|
976
|
+
/* @__PURE__ */ jsx4("span", { class: "scui-fold", "data-open": open, children: /* @__PURE__ */ jsx4(UiIcon, { name: "chevron", size: 14 }) }),
|
|
977
|
+
/* @__PURE__ */ jsx4("strong", { children: activitySummary(entries) }),
|
|
978
|
+
/* @__PURE__ */ jsx4("span", { class: "scui-spacer" }),
|
|
979
|
+
/* @__PURE__ */ jsxs3("small", { children: [
|
|
963
980
|
entries.filter((entry) => entry.status !== "pending").length,
|
|
964
981
|
"/",
|
|
965
982
|
entries.length
|
|
966
983
|
] })
|
|
967
984
|
] }),
|
|
968
|
-
open ? /* @__PURE__ */
|
|
985
|
+
open ? /* @__PURE__ */ jsx4("div", { id, children: entries.map((entry) => /* @__PURE__ */ jsx4(ToolRow, { entry, workspace: state.workspace, adapter }, entry.id)) }) : null
|
|
969
986
|
] });
|
|
970
987
|
}
|
|
971
988
|
function TaskPlan({ plan }) {
|
|
972
989
|
if (!plan.items.length) return null;
|
|
973
990
|
const complete = plan.items.filter((item) => item.status === "completed" || item.status === "cancelled").length;
|
|
974
|
-
return /* @__PURE__ */
|
|
975
|
-
/* @__PURE__ */
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ jsxs3("details", { class: "scui-plan", children: [
|
|
992
|
+
/* @__PURE__ */ jsxs3("summary", { children: [
|
|
993
|
+
/* @__PURE__ */ jsx4("span", { children: "Plan" }),
|
|
994
|
+
/* @__PURE__ */ jsxs3("small", { children: [
|
|
978
995
|
complete,
|
|
979
996
|
"/",
|
|
980
997
|
plan.items.length
|
|
981
998
|
] })
|
|
982
999
|
] }),
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
-
/* @__PURE__ */
|
|
1000
|
+
/* @__PURE__ */ jsx4("ol", { tabIndex: 0, "aria-label": "Task plan steps", children: plan.items.map((item) => /* @__PURE__ */ jsxs3("li", { "data-status": item.status, children: [
|
|
1001
|
+
/* @__PURE__ */ jsx4("i", { "aria-hidden": "true" }),
|
|
985
1002
|
" ",
|
|
986
|
-
/* @__PURE__ */
|
|
1003
|
+
/* @__PURE__ */ jsx4("span", { children: item.title })
|
|
987
1004
|
] }, item.id)) })
|
|
988
1005
|
] });
|
|
989
1006
|
}
|
|
990
1007
|
function SessionDetails({ semantics }) {
|
|
991
1008
|
if (!semantics.fidelity && !semantics.residueCount && !semantics.parseErrors && !semantics.subagents.length) return null;
|
|
992
|
-
return /* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
995
|
-
semantics.fidelity ? /* @__PURE__ */
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
/* @__PURE__ */
|
|
1009
|
+
return /* @__PURE__ */ jsxs3("details", { class: "scui-details", children: [
|
|
1010
|
+
/* @__PURE__ */ jsx4("summary", { children: "Session details" }),
|
|
1011
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
1012
|
+
semantics.fidelity ? /* @__PURE__ */ jsxs3("p", { children: [
|
|
1013
|
+
/* @__PURE__ */ jsx4("strong", { children: "Fidelity" }),
|
|
1014
|
+
/* @__PURE__ */ jsx4("span", { children: semantics.fidelity.replaceAll("_", " ") })
|
|
998
1015
|
] }) : null,
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ jsxs3("p", { children: [
|
|
1017
|
+
/* @__PURE__ */ jsx4("strong", { children: "Native records" }),
|
|
1018
|
+
/* @__PURE__ */ jsx4("span", { children: semantics.rawRecords })
|
|
1002
1019
|
] }),
|
|
1003
|
-
semantics.residueCount ? /* @__PURE__ */
|
|
1004
|
-
/* @__PURE__ */
|
|
1005
|
-
/* @__PURE__ */
|
|
1020
|
+
semantics.residueCount ? /* @__PURE__ */ jsxs3("p", { children: [
|
|
1021
|
+
/* @__PURE__ */ jsx4("strong", { children: "Residue" }),
|
|
1022
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
1006
1023
|
semantics.residueCount,
|
|
1007
1024
|
" retained"
|
|
1008
1025
|
] })
|
|
1009
1026
|
] }) : null,
|
|
1010
|
-
semantics.parseErrors ? /* @__PURE__ */
|
|
1011
|
-
/* @__PURE__ */
|
|
1012
|
-
/* @__PURE__ */
|
|
1027
|
+
semantics.parseErrors ? /* @__PURE__ */ jsxs3("p", { children: [
|
|
1028
|
+
/* @__PURE__ */ jsx4("strong", { children: "Parse diagnostics" }),
|
|
1029
|
+
/* @__PURE__ */ jsx4("span", { children: semantics.parseErrors })
|
|
1013
1030
|
] }) : null,
|
|
1014
|
-
semantics.subagents.map((agent) => /* @__PURE__ */
|
|
1015
|
-
/* @__PURE__ */
|
|
1031
|
+
semantics.subagents.map((agent) => /* @__PURE__ */ jsxs3("p", { children: [
|
|
1032
|
+
/* @__PURE__ */ jsxs3("strong", { children: [
|
|
1016
1033
|
agent.source,
|
|
1017
1034
|
" subagent"
|
|
1018
1035
|
] }),
|
|
1019
|
-
/* @__PURE__ */
|
|
1036
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
1020
1037
|
agent.messages,
|
|
1021
1038
|
" messages \xB7 ",
|
|
1022
1039
|
agent.fidelity.replaceAll("_", " ")
|
|
@@ -1035,7 +1052,7 @@ function ConversationAnnouncements({ state }) {
|
|
|
1035
1052
|
}
|
|
1036
1053
|
previousBusy.current = state.busy;
|
|
1037
1054
|
}, [state.busy, state.error, state.harness]);
|
|
1038
|
-
return /* @__PURE__ */
|
|
1055
|
+
return /* @__PURE__ */ jsx4("span", { class: "scui-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", children: announcement });
|
|
1039
1056
|
}
|
|
1040
1057
|
function Conversation({ state, adapter, components = {}, slots = {}, memoryKey = state.attached?.key || `${state.harness}:${state.workspace}`, pending = null, unreadAfterMessages = null }) {
|
|
1041
1058
|
const scroller = useRef2(null);
|
|
@@ -1084,54 +1101,55 @@ function Conversation({ state, adapter, components = {}, slots = {}, memoryKey =
|
|
|
1084
1101
|
else pin();
|
|
1085
1102
|
} else if (atBottom) pin();
|
|
1086
1103
|
}, [memoryKey, state.transcript, state.busy, state.operation, state.error, pendingMessage?.text, pendingMessage?.status]);
|
|
1087
|
-
return /* @__PURE__ */
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
/* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ jsxs3("div", { class: "scui-conversation-wrap", children: [
|
|
1105
|
+
/* @__PURE__ */ jsx4(ConversationAnnouncements, { state }),
|
|
1106
|
+
/* @__PURE__ */ jsx4("div", { class: "scui-conversation", ref: scroller, tabIndex: 0, "aria-label": "Conversation", onScroll: (event) => {
|
|
1090
1107
|
const element = event.currentTarget;
|
|
1091
1108
|
const bottom = element.scrollHeight - element.scrollTop - element.clientHeight <= 64;
|
|
1092
1109
|
setAtBottom(bottom);
|
|
1093
1110
|
remember({ top: element.scrollTop, atBottom: bottom });
|
|
1094
|
-
}, children: /* @__PURE__ */
|
|
1095
|
-
Before ? /* @__PURE__ */
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
/* @__PURE__ */
|
|
1098
|
-
state.history.hasEarlier ? /* @__PURE__ */
|
|
1111
|
+
}, children: /* @__PURE__ */ jsxs3("div", { children: [
|
|
1112
|
+
Before ? /* @__PURE__ */ jsx4(Before, { state, adapter, value: null }) : null,
|
|
1113
|
+
/* @__PURE__ */ jsx4(Plan, { plan: state.taskPlan, value: state.taskPlan, state, adapter }),
|
|
1114
|
+
/* @__PURE__ */ jsx4(SessionDetails, { semantics: state.semantics }),
|
|
1115
|
+
state.history.hasEarlier ? /* @__PURE__ */ jsx4("button", { class: "scui-load", type: "button", disabled: Boolean(state.operation), onClick: () => {
|
|
1099
1116
|
const element = scroller.current;
|
|
1100
1117
|
if (element) earlierAnchor.current = { height: element.scrollHeight, top: element.scrollTop, entries: state.transcript.length, firstId: state.transcript[0]?.id, seenOperation: false };
|
|
1101
1118
|
setAtBottom(false);
|
|
1102
1119
|
adapter.onIntent({ action: "loadEarlier" });
|
|
1103
1120
|
}, children: "Load earlier messages" }) : null,
|
|
1104
|
-
!blocks.length && state.startup !== "ready" ? /* @__PURE__ */
|
|
1105
|
-
!blocks.length && state.startup === "ready" ? Empty ? /* @__PURE__ */
|
|
1106
|
-
blocks.map((block, index) => /* @__PURE__ */
|
|
1107
|
-
index === unreadBlock ? /* @__PURE__ */
|
|
1108
|
-
block.kind === "activity" ? /* @__PURE__ */
|
|
1121
|
+
!blocks.length && state.startup !== "ready" ? /* @__PURE__ */ jsx4(LoadingStatus, { state }) : null,
|
|
1122
|
+
!blocks.length && state.startup === "ready" ? Empty ? /* @__PURE__ */ jsx4(Empty, { state, adapter, value: null }) : /* @__PURE__ */ jsx4("div", { class: "scui-empty", children: state.error ?? (state.harness ? `${harnessDisplayName(state.harness)} is listening. Say something.` : "No transcript yet.") }) : null,
|
|
1123
|
+
blocks.map((block, index) => /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1124
|
+
index === unreadBlock ? /* @__PURE__ */ jsx4("div", { class: "scui-unread-divider", role: "separator", "aria-label": "New messages", children: /* @__PURE__ */ jsx4("span", { children: "New" }) }) : null,
|
|
1125
|
+
block.kind === "activity" ? /* @__PURE__ */ jsx4(Group, { value: block.entries, entries: block.entries, state, adapter }) : /* @__PURE__ */ jsx4(Entry, { value: block.entry, entry: block.entry, state, adapter })
|
|
1109
1126
|
] }, block.id)),
|
|
1110
|
-
pendingMessage ? /* @__PURE__ */
|
|
1111
|
-
/* @__PURE__ */
|
|
1112
|
-
/* @__PURE__ */
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
|
|
1115
|
-
pendingMessage.status === "failed" ?
|
|
1116
|
-
|
|
1117
|
-
/* @__PURE__ */
|
|
1127
|
+
pendingMessage ? /* @__PURE__ */ jsxs3("article", { class: "scui-message scui-pending", "data-role": "user", "data-status": pendingMessage.status, "aria-label": "Your pending message", children: [
|
|
1128
|
+
/* @__PURE__ */ jsx4(MessageImages, { items: pendingMessage.images }),
|
|
1129
|
+
/* @__PURE__ */ jsx4(Markdown, { value: pendingMessage.text, copyText: adapter?.copyText }),
|
|
1130
|
+
/* @__PURE__ */ jsx4(ContextDisclosure, { context: pendingMessage.context }),
|
|
1131
|
+
/* @__PURE__ */ jsxs3("footer", { children: [
|
|
1132
|
+
/* @__PURE__ */ jsx4("small", { children: pendingMessage.status === "failed" ? "Not sent" : "Sending\u2026" }),
|
|
1133
|
+
pendingMessage.status === "failed" ? /* @__PURE__ */ jsxs3("span", { children: [
|
|
1134
|
+
/* @__PURE__ */ jsx4("button", { type: "button", onClick: pendingMessage.onRetry, children: "Retry" }),
|
|
1135
|
+
/* @__PURE__ */ jsx4("button", { type: "button", onClick: pendingMessage.onEdit, children: "Edit" })
|
|
1118
1136
|
] }) : null
|
|
1119
1137
|
] })
|
|
1120
1138
|
] }) : null,
|
|
1121
|
-
state.busy ? /* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
/* @__PURE__ */
|
|
1124
|
-
/* @__PURE__ */
|
|
1125
|
-
/* @__PURE__ */
|
|
1126
|
-
/* @__PURE__ */
|
|
1139
|
+
state.busy ? /* @__PURE__ */ jsxs3("div", { class: "scui-working", role: "status", children: [
|
|
1140
|
+
/* @__PURE__ */ jsx4("span", { "aria-hidden": "true", children: "\u2726" }),
|
|
1141
|
+
/* @__PURE__ */ jsx4("i", {}),
|
|
1142
|
+
/* @__PURE__ */ jsx4("i", {}),
|
|
1143
|
+
/* @__PURE__ */ jsx4("i", {}),
|
|
1144
|
+
/* @__PURE__ */ jsxs3("small", { children: [
|
|
1127
1145
|
harnessDisplayName(state.harness),
|
|
1128
1146
|
" is working"
|
|
1129
1147
|
] })
|
|
1130
1148
|
] }) : null,
|
|
1131
|
-
After ? /* @__PURE__ */
|
|
1149
|
+
After ? /* @__PURE__ */ jsx4(After, { state, adapter, value: null }) : null
|
|
1132
1150
|
] }) }),
|
|
1133
|
-
!atBottom ? /* @__PURE__ */
|
|
1134
|
-
/* @__PURE__ */
|
|
1151
|
+
!atBottom ? /* @__PURE__ */ jsxs3("button", { class: "scui-latest", type: "button", onClick: pin, children: [
|
|
1152
|
+
/* @__PURE__ */ jsx4(UiIcon, { name: "down", size: 13 }),
|
|
1135
1153
|
" Latest"
|
|
1136
1154
|
] }) : null
|
|
1137
1155
|
] });
|