@mcp-b/react-components 0.3.0 → 0.5.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/{CodeBlock-C2Xjxu9M.js → CodeBlock-D-a84xBL.js} +1 -1
- package/dist/{FileTree-D0c9Yj9U.js → FileTree-D8rtTLgK.js} +1 -1
- package/dist/attachment-preview-ChtC3HiU.js +25 -0
- package/dist/components/Activity.js +1 -1
- package/dist/components/AgentChat.d.ts +31 -1
- package/dist/components/AgentChat.js +166 -38
- package/dist/components/AgentConnection.js +3 -3
- package/dist/components/Artifact.js +1 -1
- package/dist/components/BrowserLiveView.js +2 -2
- package/dist/components/BrowserReplay.js +1 -1
- package/dist/components/ChainOfThought.d.ts +1 -1
- package/dist/components/ChainOfThought.js +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/Commit.js +2 -2
- package/dist/components/Context.d.ts +28 -27
- package/dist/components/Context.js +48 -47
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/Conversation.js +1 -1
- package/dist/components/Dialog.js +1 -1
- package/dist/components/EnvironmentVariables.js +1 -1
- package/dist/components/FileTree.js +1 -1
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Message.d.ts +16 -2
- package/dist/components/Message.js +39 -5
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/NavigationMenu.js +1 -1
- package/dist/components/PricingPage.js +2 -2
- package/dist/components/PromptInput.d.ts +532 -2
- package/dist/components/PromptInput.js +158 -20
- package/dist/components/Queue.js +1 -1
- package/dist/components/Reasoning.js +9 -17
- package/dist/components/Select.js +1 -1
- package/dist/components/Sources.js +1 -1
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Task.js +1 -1
- package/dist/components/Terminal.js +2 -2
- package/dist/components/TestResults.js +1 -1
- package/dist/components/ThinkChat.d.ts +24 -5
- package/dist/components/ThinkChat.js +87 -19
- package/dist/components/WebPreview.js +1 -1
- package/dist/components/WorkspaceExplorer.js +3 -3
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-Dd6DEhOm.js → copy-button-BmJEAKuP.js} +1 -1
- package/dist/{icons-DQC4Zw5R.js → icons-CZRH4FVH.js} +1 -15
- package/dist/{icons-ctdVxng0.d.ts → icons-CmO7-pNY.d.ts} +1 -2
- package/dist/styles/agent-chat.css +39 -6
- package/dist/styles/attachment-preview.css +21 -0
- package/dist/styles/context.css +9 -17
- package/dist/styles/conversation.css +3 -3
- package/dist/styles/index.css +1 -1
- package/dist/styles/message.css +50 -2
- package/dist/styles/prompt-input.css +189 -6
- package/dist/styles/reasoning.css +0 -1
- package/package.json +2 -2
- package/dist/PromptInput-Dzn-fOPc.d.ts +0 -444
- package/dist/components/Tool.d.ts +0 -123
- package/dist/components/Tool.js +0 -209
- package/dist/styles/tool.css +0 -203
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { A as
|
|
2
|
+
import { A as SquareIcon, E as PlusIcon, M as WarningIcon, P as XIcon, S as MonitorIcon, _ as ImageIcon, i as ArrowUpIcon, k as SpinnerIcon, m as FileIcon, o as ChevronDownIcon, w as PencilIcon } from "../icons-CZRH4FVH.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
5
|
+
import { t as AttachmentPreview } from "../attachment-preview-ChtC3HiU.js";
|
|
5
6
|
import { Combobox, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator } from "./Combobox.js";
|
|
6
|
-
import { MenuItem, MenuPopup, MenuPortal, MenuPositioner, MenuRoot, MenuTrigger } from "./Menu.js";
|
|
7
|
+
import { MenuItem, MenuPopup, MenuPortal, MenuPositioner, MenuRadioGroup, MenuRadioItem, MenuRadioItemIndicator, MenuRoot, MenuTrigger } from "./Menu.js";
|
|
7
8
|
import { Select, SelectContent, SelectItem, SelectPortal, SelectPositioner, SelectTrigger, SelectValue } from "./Select.js";
|
|
8
9
|
import { Tab, TabPanel, TabsList } from "./Tabs.js";
|
|
9
10
|
import * as React from "react";
|
|
@@ -339,6 +340,59 @@ function PromptInputHeader({ className, children, ref, ...props }) {
|
|
|
339
340
|
children
|
|
340
341
|
});
|
|
341
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* One pending attachment chip: image files show a thumbnail, everything else
|
|
345
|
+
* a file icon and name. The corner button removes it from the pending list.
|
|
346
|
+
*/
|
|
347
|
+
function PromptInputAttachment({ file, className, ref, ...props }) {
|
|
348
|
+
const attachments = usePromptInputAttachments();
|
|
349
|
+
const isImage = file.mediaType.startsWith("image/");
|
|
350
|
+
const name = file.filename ?? "attachment";
|
|
351
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
352
|
+
ref,
|
|
353
|
+
className: cx("prompt-input__attachment", className),
|
|
354
|
+
"data-image": isImage || void 0,
|
|
355
|
+
...props,
|
|
356
|
+
children: [isImage ? /* @__PURE__ */ jsx(AttachmentPreview, {
|
|
357
|
+
url: file.url,
|
|
358
|
+
filename: file.filename,
|
|
359
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
360
|
+
type: "button",
|
|
361
|
+
className: "prompt-input__attachment-zoom",
|
|
362
|
+
"aria-label": `Preview ${name}`,
|
|
363
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
364
|
+
className: "prompt-input__attachment-thumb",
|
|
365
|
+
src: file.url,
|
|
366
|
+
alt: ""
|
|
367
|
+
})
|
|
368
|
+
})
|
|
369
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FileIcon, { className: "prompt-input__attachment-icon" }), /* @__PURE__ */ jsx("span", {
|
|
370
|
+
className: "prompt-input__attachment-name",
|
|
371
|
+
children: name
|
|
372
|
+
})] }), /* @__PURE__ */ jsx("button", {
|
|
373
|
+
type: "button",
|
|
374
|
+
className: "prompt-input__attachment-remove",
|
|
375
|
+
"aria-label": `Remove ${name}`,
|
|
376
|
+
onClick: () => attachments.remove(file.id),
|
|
377
|
+
children: /* @__PURE__ */ jsx(XIcon, { size: 12 })
|
|
378
|
+
})]
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* The pending-attachment chip row. Renders nothing while the list is empty,
|
|
383
|
+
* so it can sit in the composer unconditionally — files added via the file
|
|
384
|
+
* dialog, paste, or drop appear here until submit sends and clears them.
|
|
385
|
+
*/
|
|
386
|
+
function PromptInputAttachments({ className, children, ref, ...props }) {
|
|
387
|
+
const attachments = usePromptInputAttachments();
|
|
388
|
+
if (attachments.files.length === 0) return null;
|
|
389
|
+
return /* @__PURE__ */ jsx("div", {
|
|
390
|
+
ref,
|
|
391
|
+
className: cx("prompt-input__attachments", className),
|
|
392
|
+
...props,
|
|
393
|
+
children: attachments.files.map((file) => /* @__PURE__ */ jsx(React.Fragment, { children: children ? children(file) : /* @__PURE__ */ jsx(PromptInputAttachment, { file }) }, file.id))
|
|
394
|
+
});
|
|
395
|
+
}
|
|
342
396
|
function PromptInputBody({ className, children, ref, ...props }) {
|
|
343
397
|
return /* @__PURE__ */ jsx("div", {
|
|
344
398
|
ref,
|
|
@@ -363,7 +417,7 @@ function PromptInputTools({ className, children, ref, ...props }) {
|
|
|
363
417
|
children
|
|
364
418
|
});
|
|
365
419
|
}
|
|
366
|
-
const MIN_TEXTAREA_HEIGHT_PX =
|
|
420
|
+
const MIN_TEXTAREA_HEIGHT_PX = 24;
|
|
367
421
|
const MAX_TEXTAREA_HEIGHT_PX = 240;
|
|
368
422
|
function PromptInputTextarea({ className, placeholder = "How can I help?", rows = 1, minHeight = MIN_TEXTAREA_HEIGHT_PX, maxHeight = MAX_TEXTAREA_HEIGHT_PX, onChange, onCompositionEnd, onCompositionStart, onKeyDown, onInput, onPaste, ref, ...props }) {
|
|
369
423
|
const { submit } = usePromptInputContext("PromptInputTextarea");
|
|
@@ -446,7 +500,7 @@ function PromptInputTextarea({ className, placeholder = "How can I help?", rows
|
|
|
446
500
|
});
|
|
447
501
|
}
|
|
448
502
|
function PromptInputButton({ className, tooltip, variant = "ghost", color = "neutral", size, children, "aria-label": ariaLabel, ref, ...props }) {
|
|
449
|
-
const resolvedSize = size ?? (React.Children.count(children) > 1 ? "
|
|
503
|
+
const resolvedSize = size ?? (React.Children.count(children) > 1 ? "xs" : "icon-xs");
|
|
450
504
|
const tooltipConfig = typeof tooltip === "string" ? { content: tooltip } : tooltip;
|
|
451
505
|
const fallbackLabel = ariaLabel ?? (typeof tooltipConfig?.content === "string" ? tooltipConfig.content : void 0);
|
|
452
506
|
const button = /* @__PURE__ */ jsx(Button, {
|
|
@@ -525,7 +579,61 @@ function PromptInputActionAddScreenshot({ label = "Take screenshot", onClick, ch
|
|
|
525
579
|
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MonitorIcon, { className: "prompt-input__action-menu-icon" }), label] })
|
|
526
580
|
});
|
|
527
581
|
}
|
|
528
|
-
|
|
582
|
+
const PERMISSION_MODES = [{
|
|
583
|
+
value: "ask",
|
|
584
|
+
label: "Ask for approval",
|
|
585
|
+
description: "Pause and ask before sensitive actions run"
|
|
586
|
+
}, {
|
|
587
|
+
value: "bypass",
|
|
588
|
+
label: "Bypass permissions",
|
|
589
|
+
description: "Approve every request automatically"
|
|
590
|
+
}];
|
|
591
|
+
/**
|
|
592
|
+
* Footer control for choosing how approval requests are handled — ask each
|
|
593
|
+
* time, or bypass. Purely a picker: the auto-approve behavior lives with
|
|
594
|
+
* whoever owns the approvals (`AgentChat` wires both ends).
|
|
595
|
+
*/
|
|
596
|
+
function PromptInputPermissionSelector({ value, onValueChange, question = "How should agent actions be approved?" }) {
|
|
597
|
+
return /* @__PURE__ */ jsxs(MenuRoot, { children: [/* @__PURE__ */ jsx(MenuTrigger, { render: /* @__PURE__ */ jsxs(PromptInputButton, {
|
|
598
|
+
size: "xs",
|
|
599
|
+
className: "prompt-input__permissions-trigger",
|
|
600
|
+
"data-mode": value,
|
|
601
|
+
"aria-label": (PERMISSION_MODES.find((mode) => mode.value === value) ?? PERMISSION_MODES[0]).label,
|
|
602
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
603
|
+
className: "prompt-input__permissions-current",
|
|
604
|
+
children: PERMISSION_MODES.map((mode) => /* @__PURE__ */ jsxs("span", {
|
|
605
|
+
className: "prompt-input__permissions-current-option",
|
|
606
|
+
"data-active": mode.value === value || void 0,
|
|
607
|
+
children: [mode.value === "bypass" ? /* @__PURE__ */ jsx(WarningIcon, { size: 14 }) : null, mode.label]
|
|
608
|
+
}, mode.value))
|
|
609
|
+
}), /* @__PURE__ */ jsx(ChevronDownIcon, { size: 12 })]
|
|
610
|
+
}) }), /* @__PURE__ */ jsx(MenuPortal, { children: /* @__PURE__ */ jsx(MenuPositioner, { children: /* @__PURE__ */ jsxs(MenuPopup, {
|
|
611
|
+
className: "prompt-input__permissions-menu",
|
|
612
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
613
|
+
className: "prompt-input__permissions-question",
|
|
614
|
+
children: question
|
|
615
|
+
}), /* @__PURE__ */ jsx(MenuRadioGroup, {
|
|
616
|
+
value,
|
|
617
|
+
onValueChange: (mode) => onValueChange(mode),
|
|
618
|
+
children: PERMISSION_MODES.map((mode) => /* @__PURE__ */ jsxs(MenuRadioItem, {
|
|
619
|
+
value: mode.value,
|
|
620
|
+
closeOnClick: true,
|
|
621
|
+
className: "prompt-input__permissions-option",
|
|
622
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
623
|
+
className: "prompt-input__permissions-option-text",
|
|
624
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
625
|
+
className: "prompt-input__permissions-option-label",
|
|
626
|
+
children: mode.label
|
|
627
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
628
|
+
className: "prompt-input__permissions-option-description",
|
|
629
|
+
children: mode.description
|
|
630
|
+
})]
|
|
631
|
+
}), /* @__PURE__ */ jsx(MenuRadioItemIndicator, { className: "prompt-input__permissions-check" })]
|
|
632
|
+
}, mode.value))
|
|
633
|
+
})]
|
|
634
|
+
}) }) })] });
|
|
635
|
+
}
|
|
636
|
+
function PromptInputSubmit({ className, status = "ready", onStop, variant = "normal", color = "primary", size = "icon-sm", onClick, children, label, ref, ...props }) {
|
|
529
637
|
const isStopping = status === "submitted" || status === "streaming";
|
|
530
638
|
const resolvedLabel = label ?? defaultSubmitLabel(status);
|
|
531
639
|
return /* @__PURE__ */ jsx(Button, {
|
|
@@ -549,12 +657,22 @@ function PromptInputSubmit({ className, status = "ready", onStop, variant = "nor
|
|
|
549
657
|
children: children ?? defaultSubmitIcon(status)
|
|
550
658
|
});
|
|
551
659
|
}
|
|
660
|
+
function getPausedExecution(part) {
|
|
661
|
+
if (part.state !== "output-available") return void 0;
|
|
662
|
+
const output = part.output;
|
|
663
|
+
return output?.status === "paused" && typeof output.executionId === "string" ? output : void 0;
|
|
664
|
+
}
|
|
665
|
+
/** The id a response must carry: the approval id, or the paused run's executionId. */
|
|
666
|
+
function getApprovalRequestId(part) {
|
|
667
|
+
if (part.state === "approval-requested") return part.approval.id;
|
|
668
|
+
return getPausedExecution(part)?.executionId;
|
|
669
|
+
}
|
|
552
670
|
/** Derives pending tool approvals straight from the messages — no app-owned shapes. */
|
|
553
|
-
function getPendingToolApprovals(messages) {
|
|
671
|
+
function getPendingToolApprovals(messages, { pausedExecutions = false } = {}) {
|
|
554
672
|
const pending = [];
|
|
555
673
|
messages.forEach((message, messageIndex) => {
|
|
556
674
|
message.parts.forEach((part, partIndex) => {
|
|
557
|
-
if (isToolOrDynamicToolUIPart(part) && part.state === "approval-requested") pending.push({
|
|
675
|
+
if (isToolOrDynamicToolUIPart(part) && (part.state === "approval-requested" || pausedExecutions && getPausedExecution(part))) pending.push({
|
|
558
676
|
message,
|
|
559
677
|
messageIndex,
|
|
560
678
|
part,
|
|
@@ -575,30 +693,33 @@ function formatApprovalValue(value) {
|
|
|
575
693
|
* sends the text as the native approval `reason`. Submit (or Enter) sends the
|
|
576
694
|
* current selection — approve by default.
|
|
577
695
|
*/
|
|
578
|
-
function PromptInputApproval({ part, onRespond, onSkip, question, count, className, ref, ...props }) {
|
|
696
|
+
function PromptInputApproval({ part, onRespond, executionApprovals, onSkip, question, count, className, ref, ...props }) {
|
|
579
697
|
const [selected, setSelected] = React.useState("approve");
|
|
580
698
|
const [reason, setReason] = React.useState("");
|
|
581
699
|
const [busy, setBusy] = React.useState(false);
|
|
582
700
|
const yesRef = React.useRef(null);
|
|
583
701
|
const reasonRef = React.useRef(null);
|
|
584
702
|
const approval = part.state === "approval-requested" ? part.approval : void 0;
|
|
585
|
-
const
|
|
703
|
+
const paused = getPausedExecution(part);
|
|
704
|
+
const approvalId = approval?.id ?? paused?.executionId;
|
|
586
705
|
React.useEffect(() => {
|
|
587
706
|
setSelected("approve");
|
|
588
707
|
setReason("");
|
|
589
708
|
setBusy(false);
|
|
590
709
|
}, [approvalId]);
|
|
591
|
-
if (!
|
|
710
|
+
if (approval ? !onRespond : !(paused && executionApprovals)) return null;
|
|
592
711
|
const toolName = getToolName(part);
|
|
593
712
|
const respond = (approved) => {
|
|
594
713
|
if (busy) return;
|
|
595
714
|
setBusy(true);
|
|
596
715
|
const trimmed = reason.trim();
|
|
597
|
-
|
|
716
|
+
const denyReason = !approved && trimmed ? trimmed : void 0;
|
|
717
|
+
if (approval) onRespond?.({
|
|
598
718
|
id: approval.id,
|
|
599
719
|
approved,
|
|
600
|
-
reason:
|
|
720
|
+
reason: denyReason
|
|
601
721
|
});
|
|
722
|
+
else if (paused) approved ? executionApprovals?.approve(paused.executionId) : executionApprovals?.reject(paused.executionId, denyReason);
|
|
602
723
|
};
|
|
603
724
|
const submit = () => respond(selected === "approve");
|
|
604
725
|
const input = "input" in part ? part.input : void 0;
|
|
@@ -618,16 +739,33 @@ function PromptInputApproval({ part, onRespond, onSkip, question, count, classNa
|
|
|
618
739
|
children: [
|
|
619
740
|
/* @__PURE__ */ jsxs("div", {
|
|
620
741
|
className: "prompt-input__approval-question",
|
|
621
|
-
children: [/* @__PURE__ */ jsx("span", { children: question ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
742
|
+
children: [/* @__PURE__ */ jsx("span", { children: question ?? (paused ? /* @__PURE__ */ jsx(Fragment, { children: "The agent's code is paused on these calls. Allow it to continue?" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
622
743
|
"Do you want to allow the agent to run ",
|
|
623
744
|
/* @__PURE__ */ jsx("code", { children: toolName }),
|
|
624
745
|
"?"
|
|
625
|
-
] }) }), count && count > 1 ? /* @__PURE__ */ jsxs("span", {
|
|
746
|
+
] })) }), count && count > 1 ? /* @__PURE__ */ jsxs("span", {
|
|
626
747
|
className: "prompt-input__approval-count",
|
|
627
748
|
children: ["1 of ", count]
|
|
628
749
|
}) : null]
|
|
629
750
|
}),
|
|
630
|
-
|
|
751
|
+
paused ? /* @__PURE__ */ jsx("div", {
|
|
752
|
+
className: "prompt-input__approval-preview",
|
|
753
|
+
children: paused.pending.map((action) => /* @__PURE__ */ jsxs("div", {
|
|
754
|
+
className: "prompt-input__approval-preview-row",
|
|
755
|
+
children: [
|
|
756
|
+
/* @__PURE__ */ jsxs("span", {
|
|
757
|
+
className: "prompt-input__approval-preview-key",
|
|
758
|
+
children: [
|
|
759
|
+
action.connector,
|
|
760
|
+
".",
|
|
761
|
+
action.method
|
|
762
|
+
]
|
|
763
|
+
}),
|
|
764
|
+
" ",
|
|
765
|
+
action.args === void 0 ? null : formatApprovalValue(action.args)
|
|
766
|
+
]
|
|
767
|
+
}, action.seq))
|
|
768
|
+
}) : input !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
631
769
|
className: "prompt-input__approval-preview",
|
|
632
770
|
children: inputEntries ? inputEntries.map(([key, value]) => /* @__PURE__ */ jsxs("div", {
|
|
633
771
|
className: "prompt-input__approval-preview-row",
|
|
@@ -697,7 +835,7 @@ function PromptInputApproval({ part, onRespond, onSkip, question, count, classNa
|
|
|
697
835
|
}),
|
|
698
836
|
onSkip ? /* @__PURE__ */ jsx(Button, {
|
|
699
837
|
type: "button",
|
|
700
|
-
size: "
|
|
838
|
+
size: "xs",
|
|
701
839
|
variant: "ghost",
|
|
702
840
|
color: "neutral",
|
|
703
841
|
className: "prompt-input__approval-skip",
|
|
@@ -707,7 +845,7 @@ function PromptInputApproval({ part, onRespond, onSkip, question, count, classNa
|
|
|
707
845
|
}) : null,
|
|
708
846
|
/* @__PURE__ */ jsxs(Button, {
|
|
709
847
|
type: "button",
|
|
710
|
-
size: "
|
|
848
|
+
size: "xs",
|
|
711
849
|
color: "primary",
|
|
712
850
|
className: "prompt-input__approval-submit",
|
|
713
851
|
disabled: busy,
|
|
@@ -844,11 +982,11 @@ function fileToPart(file) {
|
|
|
844
982
|
};
|
|
845
983
|
}
|
|
846
984
|
function revokeFileUrls(files) {
|
|
847
|
-
for (const file of files) if (file.url
|
|
985
|
+
for (const file of files) if (file.url.startsWith("blob:")) URL.revokeObjectURL(file.url);
|
|
848
986
|
}
|
|
849
987
|
async function resolveSubmittedFile(file) {
|
|
850
988
|
const { id: _id, ...part } = file;
|
|
851
|
-
if (!part.url
|
|
989
|
+
if (!part.url.startsWith("blob:")) return part;
|
|
852
990
|
const dataUrl = await blobUrlToDataUrl(part.url);
|
|
853
991
|
return {
|
|
854
992
|
...part,
|
|
@@ -909,4 +1047,4 @@ function createId() {
|
|
|
909
1047
|
return globalThis.crypto?.randomUUID?.() ?? `prompt-input-${Date.now()}-${Math.random()}`;
|
|
910
1048
|
}
|
|
911
1049
|
//#endregion
|
|
912
|
-
export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputProvider, PromptInputSelect, PromptInputSelectContent, PromptInputSelectItem, PromptInputSelectTrigger, PromptInputSelectValue, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, usePromptInputReferencedSources, useProviderAttachments };
|
|
1050
|
+
export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputPermissionSelector, PromptInputProvider, PromptInputSelect, PromptInputSelectContent, PromptInputSelectItem, PromptInputSelectTrigger, PromptInputSelectValue, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, getApprovalRequestId, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, usePromptInputReferencedSources, useProviderAttachments };
|
package/dist/components/Queue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a as CheckIcon, c as ChevronRightIcon, m as FileIcon, u as DotIcon } from "../icons-CZRH4FVH.js";
|
|
4
4
|
import { Button } from "./Button.js";
|
|
5
5
|
import { Badge } from "./Badge.js";
|
|
6
6
|
import { ScrollArea } from "./ScrollArea.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import {
|
|
3
|
+
import { c as ChevronRightIcon } from "../icons-CZRH4FVH.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { cjk } from "@streamdown/cjk";
|
|
@@ -140,22 +140,14 @@ function ReasoningTrigger({ className, children, getThinkingMessage = defaultGet
|
|
|
140
140
|
"data-streaming": isStreaming ? "" : void 0,
|
|
141
141
|
...props,
|
|
142
142
|
unstyled: true,
|
|
143
|
-
children: [
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
/* @__PURE__ */ jsx(
|
|
150
|
-
|
|
151
|
-
children: getThinkingMessage(isStreaming, duration)
|
|
152
|
-
}),
|
|
153
|
-
/* @__PURE__ */ jsx("span", {
|
|
154
|
-
className: "reasoning__trigger-icon",
|
|
155
|
-
"aria-hidden": "true",
|
|
156
|
-
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
157
|
-
})
|
|
158
|
-
]
|
|
143
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
144
|
+
className: "reasoning__trigger-label",
|
|
145
|
+
children: getThinkingMessage(isStreaming, duration)
|
|
146
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
147
|
+
className: "reasoning__trigger-icon",
|
|
148
|
+
"aria-hidden": "true",
|
|
149
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
150
|
+
})]
|
|
159
151
|
});
|
|
160
152
|
}
|
|
161
153
|
const streamdownPlugins = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as CheckIcon, i as ArrowUpIcon, t as ArrowDownIcon } from "../icons-CZRH4FVH.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Select as Select$1 } from "@base-ui/react/select";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import {
|
|
3
|
+
import { c as ChevronRightIcon, y as LinkIcon } from "../icons-CZRH4FVH.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Sources.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as CheckIcon, k as SpinnerIcon } from "../icons-CZRH4FVH.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/Stepper.tsx
|
package/dist/components/Task.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import {
|
|
3
|
+
import { O as SearchIcon, c as ChevronRightIcon, m as FileIcon } from "../icons-CZRH4FVH.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Task.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { P as XIcon, j as TerminalIcon } from "../icons-CZRH4FVH.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
5
|
+
import { t as CopyButton } from "../copy-button-BmJEAKuP.js";
|
|
5
6
|
import { Badge } from "./Badge.js";
|
|
6
|
-
import { t as CopyButton } from "../copy-button-Dd6DEhOm.js";
|
|
7
7
|
import { ScrollArea } from "./ScrollArea.js";
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import {
|
|
3
|
+
import { P as XIcon, a as CheckIcon, c as ChevronRightIcon, k as SpinnerIcon } from "../icons-CZRH4FVH.js";
|
|
4
4
|
import { Badge } from "./Badge.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ExecutionApprovals } from "./PromptInput.js";
|
|
1
2
|
import { AgentChatProps, AgentChatRenderPartContext } from "./AgentChat.js";
|
|
2
3
|
import { BrowserLiveView, BrowserLiveViewProps } from "./BrowserLiveView.js";
|
|
3
4
|
import { BrowserReplay, BrowserReplayProps } from "./BrowserReplay.js";
|
|
@@ -34,8 +35,24 @@ interface ThinkChatMessagesProps extends ThinkChatActivityRendererOptions {
|
|
|
34
35
|
placeholder?: string;
|
|
35
36
|
/** Rendered after each message (e.g. per-message actions). */
|
|
36
37
|
renderMessageAfter?: AgentChatProps["renderMessageAfter"];
|
|
38
|
+
/**
|
|
39
|
+
* Overrides the built-in connection notice (derived from the hook's
|
|
40
|
+
* `isRecovering`/`connectionError`) shown between transcript and composer.
|
|
41
|
+
*/
|
|
42
|
+
notice?: AgentChatProps["notice"];
|
|
37
43
|
/** Full replacement for part rendering; wins over excludeTools/toolRenderers. */
|
|
38
44
|
renderPart?: AgentChatProps["renderPart"];
|
|
45
|
+
/**
|
|
46
|
+
* Surfaces paused codemode executions in the composer's approval UI —
|
|
47
|
+
* the same confirmation tool approvals use. See {@link ExecutionApprovals}.
|
|
48
|
+
*/
|
|
49
|
+
executionApprovals?: ExecutionApprovals;
|
|
50
|
+
/**
|
|
51
|
+
* Shows a Context ring in the composer footer — how much of the model's
|
|
52
|
+
* window the conversation occupies, from `metadata.usage` on the newest
|
|
53
|
+
* message that reports it.
|
|
54
|
+
*/
|
|
55
|
+
contextWindow?: AgentChatProps["contextWindow"];
|
|
39
56
|
}
|
|
40
57
|
/**
|
|
41
58
|
* Bespoke rendering for one tool inside the activity log. Both hooks fall
|
|
@@ -52,9 +69,9 @@ type ThinkChatToolRenderers = Record<string, ThinkChatToolRenderer>;
|
|
|
52
69
|
interface ThinkChatActivityRendererOptions {
|
|
53
70
|
/**
|
|
54
71
|
* Tool names to keep out of activity folding entirely — the run splits
|
|
55
|
-
* around them and they fall through to your own renderPart /
|
|
56
|
-
*
|
|
57
|
-
* `toolRenderers` instead.
|
|
72
|
+
* around them and they fall through to your own renderPart / AgentChat's
|
|
73
|
+
* generic standalone activity row. For tools that should stay in the log
|
|
74
|
+
* with custom UI, use `toolRenderers` instead.
|
|
58
75
|
*/
|
|
59
76
|
excludeTools?: readonly string[];
|
|
60
77
|
/** Per-tool label/panel overrides inside the activity log, keyed by tool name. */
|
|
@@ -98,6 +115,8 @@ declare function ThinkChatMessages({
|
|
|
98
115
|
renderPart,
|
|
99
116
|
excludeTools,
|
|
100
117
|
toolRenderers,
|
|
118
|
+
executionApprovals,
|
|
119
|
+
notice,
|
|
101
120
|
...props
|
|
102
121
|
}: ThinkChatMessagesProps): React.JSX.Element;
|
|
103
122
|
/** Agent work (reasoning, tool calls, step boundaries) vs. content shown to the user. */
|
|
@@ -136,7 +155,7 @@ declare function ThinkChatActivity({
|
|
|
136
155
|
* parts (reasoning + tool calls) into one collapsed Activity box. Everything
|
|
137
156
|
* is derived from the UIMessage stream: part order, tool states, reasoning
|
|
138
157
|
* state. Excluded tools split the run and return undefined so your own
|
|
139
|
-
* renderPart (or
|
|
158
|
+
* renderPart (or AgentChat's generic activity row) takes over for them.
|
|
140
159
|
*/
|
|
141
160
|
declare function createThinkChatActivityRenderer({
|
|
142
161
|
excludeTools,
|
|
@@ -183,4 +202,4 @@ declare const ThinkChat: {
|
|
|
183
202
|
createActivityRenderer: typeof createThinkChatActivityRenderer;
|
|
184
203
|
};
|
|
185
204
|
//#endregion
|
|
186
|
-
export { BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, type FileInfo, ThinkChat, ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, ThinkChatToolRenderer, ThinkChatToolRenderers, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, useThinkChat, useWorkspace };
|
|
205
|
+
export { BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, type ExecutionApprovals, type FileInfo, ThinkChat, ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, ThinkChatToolRenderer, ThinkChatToolRenderers, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, useThinkChat, useWorkspace };
|