@dudko.dev/agent-web-react 0.0.35 → 0.0.36
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 +1 -1
- package/dist/index.cjs +186 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -7
- package/dist/index.d.ts +35 -7
- package/dist/index.js +213 -93
- package/dist/index.js.map +1 -1
- package/dist/styles.css +13 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2519,6 +2519,31 @@ var attachmentRefusal = (kind, caps, canConvertPdf = false) => {
|
|
|
2519
2519
|
}
|
|
2520
2520
|
return void 0;
|
|
2521
2521
|
};
|
|
2522
|
+
var menuSections = (options) => {
|
|
2523
|
+
const out = [];
|
|
2524
|
+
for (const option of options) {
|
|
2525
|
+
const section = option.section || void 0;
|
|
2526
|
+
const last = out[out.length - 1];
|
|
2527
|
+
if (last && last.section === section) last.options.push(option);
|
|
2528
|
+
else out.push({ ...section ? { section } : {}, options: [option] });
|
|
2529
|
+
}
|
|
2530
|
+
return out;
|
|
2531
|
+
};
|
|
2532
|
+
var menuKeyTarget = (key, index, count) => {
|
|
2533
|
+
if (count <= 0) return void 0;
|
|
2534
|
+
switch (key) {
|
|
2535
|
+
case "ArrowDown":
|
|
2536
|
+
return index < 0 ? 0 : (index + 1) % count;
|
|
2537
|
+
case "ArrowUp":
|
|
2538
|
+
return index < 0 ? count - 1 : (index - 1 + count) % count;
|
|
2539
|
+
case "Home":
|
|
2540
|
+
return 0;
|
|
2541
|
+
case "End":
|
|
2542
|
+
return count - 1;
|
|
2543
|
+
default:
|
|
2544
|
+
return void 0;
|
|
2545
|
+
}
|
|
2546
|
+
};
|
|
2522
2547
|
var formatElapsed = (ms) => {
|
|
2523
2548
|
const s = Math.max(0, Math.floor(ms / 1e3));
|
|
2524
2549
|
if (s < 60) return `${s}s`;
|
|
@@ -4947,8 +4972,8 @@ var McpAppLine = ({ app, note, action, onAction, labels, className }) => {
|
|
|
4947
4972
|
};
|
|
4948
4973
|
|
|
4949
4974
|
// src/components/AgentComposer.tsx
|
|
4950
|
-
import { useEffect as useEffect9, useLayoutEffect as useLayoutEffect3, useMemo as useMemo6, useRef as useRef8, useState as useState9 } from "react";
|
|
4951
|
-
import { Fragment as
|
|
4975
|
+
import { Fragment as Fragment2, useEffect as useEffect9, useLayoutEffect as useLayoutEffect3, useMemo as useMemo6, useRef as useRef8, useState as useState9 } from "react";
|
|
4976
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
4952
4977
|
var thinkingDefaults = (l) => [
|
|
4953
4978
|
{ id: "off", label: l.thinkingLevels.off },
|
|
4954
4979
|
{ id: "none", label: l.thinkingLevels.none },
|
|
@@ -4958,6 +4983,34 @@ var thinkingDefaults = (l) => [
|
|
|
4958
4983
|
];
|
|
4959
4984
|
var MODES = ["autopilot", "ask-writes", "ask-all", "read-only"];
|
|
4960
4985
|
var ModeIcon = ({ mode }) => mode === "autopilot" ? /* @__PURE__ */ jsx5(BoltIcon, { size: 14 }) : mode === "read-only" ? /* @__PURE__ */ jsx5(EyeIcon, { size: 14 }) : /* @__PURE__ */ jsx5(ShieldIcon, { size: 14 });
|
|
4986
|
+
var useMenuKeys = (open, menuRef, chipRef, close) => {
|
|
4987
|
+
useEffect9(() => {
|
|
4988
|
+
if (!open) return;
|
|
4989
|
+
const menu = menuRef.current;
|
|
4990
|
+
const rows = menu ? [...menu.querySelectorAll('[role^="menuitem"]')] : [];
|
|
4991
|
+
(rows.find((r) => r.getAttribute("aria-checked") === "true") ?? rows[0])?.focus();
|
|
4992
|
+
}, [open, menuRef]);
|
|
4993
|
+
return (e) => {
|
|
4994
|
+
const menu = menuRef.current;
|
|
4995
|
+
if (!menu) return;
|
|
4996
|
+
if (e.key === "Escape") {
|
|
4997
|
+
e.preventDefault();
|
|
4998
|
+
close();
|
|
4999
|
+
chipRef.current?.focus();
|
|
5000
|
+
return;
|
|
5001
|
+
}
|
|
5002
|
+
const rows = [...menu.querySelectorAll('[role^="menuitem"]')];
|
|
5003
|
+
const to = menuKeyTarget(
|
|
5004
|
+
e.key,
|
|
5005
|
+
rows.indexOf(document.activeElement),
|
|
5006
|
+
rows.length
|
|
5007
|
+
);
|
|
5008
|
+
if (to === void 0) return;
|
|
5009
|
+
e.preventDefault();
|
|
5010
|
+
rows[to].focus();
|
|
5011
|
+
};
|
|
5012
|
+
};
|
|
5013
|
+
var opensMenu = (key) => key === "ArrowDown" || key === "ArrowUp";
|
|
4961
5014
|
var attachSeq = 0;
|
|
4962
5015
|
var useIsoLayoutEffect3 = typeof window === "undefined" ? useEffect9 : useLayoutEffect3;
|
|
4963
5016
|
var useMenuPlacement = (open, anchor, align) => {
|
|
@@ -5049,6 +5102,10 @@ var AgentComposer = ({
|
|
|
5049
5102
|
const rootRef = useRef8(null);
|
|
5050
5103
|
const modelRef = useRef8(null);
|
|
5051
5104
|
const modeRef = useRef8(null);
|
|
5105
|
+
const modelChipRef = useRef8(null);
|
|
5106
|
+
const modeChipRef = useRef8(null);
|
|
5107
|
+
const modelMenuRef = useRef8(null);
|
|
5108
|
+
const modeMenuRef = useRef8(null);
|
|
5052
5109
|
const [dropRect, setDropRect] = useState9();
|
|
5053
5110
|
const [compactBar, setCompactBar] = useState9(false);
|
|
5054
5111
|
useEffect9(() => {
|
|
@@ -5177,6 +5234,9 @@ ${draftText}` : draftText);
|
|
|
5177
5234
|
const commandsStyle = useMenuPlacement(paletteOpen, rootRef, "stretch");
|
|
5178
5235
|
const modelStyle = useMenuPlacement(menu === "model", modelRef, "left");
|
|
5179
5236
|
const modeStyle = useMenuPlacement(menu === "mode", modeRef, "right");
|
|
5237
|
+
const closeMenu = () => setMenu(void 0);
|
|
5238
|
+
const modelMenuKeys = useMenuKeys(menu === "model", modelMenuRef, modelChipRef, closeMenu);
|
|
5239
|
+
const modeMenuKeys = useMenuKeys(menu === "mode", modeMenuRef, modeChipRef, closeMenu);
|
|
5180
5240
|
useEffect9(() => setActive(0), [text, menu]);
|
|
5181
5241
|
useEffect9(() => {
|
|
5182
5242
|
if (!menu) return;
|
|
@@ -5574,7 +5634,7 @@ ${draftText}` : draftText);
|
|
|
5574
5634
|
] }),
|
|
5575
5635
|
stt.listening && stt.interim && /* @__PURE__ */ jsx5("div", { className: "awr-composer2__interim", children: stt.interim }),
|
|
5576
5636
|
/* @__PURE__ */ jsxs3("div", { className: "awr-toolbar", children: [
|
|
5577
|
-
attachments !== false && /* @__PURE__ */ jsxs3(
|
|
5637
|
+
attachments !== false && /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
5578
5638
|
/* @__PURE__ */ jsx5(
|
|
5579
5639
|
"button",
|
|
5580
5640
|
{
|
|
@@ -5634,8 +5694,15 @@ ${draftText}` : draftText);
|
|
|
5634
5694
|
"button",
|
|
5635
5695
|
{
|
|
5636
5696
|
type: "button",
|
|
5697
|
+
ref: modelChipRef,
|
|
5637
5698
|
className: "awr-tchip awr-tchip--btn",
|
|
5638
5699
|
onClick: () => setMenu(menu === "model" ? void 0 : "model"),
|
|
5700
|
+
onKeyDown: (e) => {
|
|
5701
|
+
if (menu !== "model" && opensMenu(e.key)) {
|
|
5702
|
+
e.preventDefault();
|
|
5703
|
+
setMenu("model");
|
|
5704
|
+
}
|
|
5705
|
+
},
|
|
5639
5706
|
"aria-haspopup": "menu",
|
|
5640
5707
|
"aria-expanded": menu === "model",
|
|
5641
5708
|
title: [model?.label, thinkingLabel].filter(Boolean).join(" \xB7 "),
|
|
@@ -5645,47 +5712,81 @@ ${draftText}` : draftText);
|
|
|
5645
5712
|
]
|
|
5646
5713
|
}
|
|
5647
5714
|
),
|
|
5648
|
-
menu === "model" && /* @__PURE__ */ jsxs3(
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5715
|
+
menu === "model" && /* @__PURE__ */ jsxs3(
|
|
5716
|
+
"div",
|
|
5717
|
+
{
|
|
5718
|
+
className: "awr-menu awr-menu--pop",
|
|
5719
|
+
style: modelStyle,
|
|
5720
|
+
role: "menu",
|
|
5721
|
+
ref: modelMenuRef,
|
|
5722
|
+
onKeyDown: modelMenuKeys,
|
|
5723
|
+
children: [
|
|
5724
|
+
thinking && /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
5725
|
+
/* @__PURE__ */ jsx5("div", { className: "awr-menu__head", children: L.thinking }),
|
|
5726
|
+
thinkingOptions.map((o) => /* @__PURE__ */ jsx5(
|
|
5727
|
+
"button",
|
|
5728
|
+
{
|
|
5729
|
+
type: "button",
|
|
5730
|
+
role: "menuitemradio",
|
|
5731
|
+
"aria-checked": thinking.value === o.id,
|
|
5732
|
+
className: `awr-menu__item${thinking.value === o.id ? " is-active" : ""}`,
|
|
5733
|
+
onClick: () => {
|
|
5734
|
+
thinking.onChange(o.id);
|
|
5735
|
+
setMenu(void 0);
|
|
5736
|
+
},
|
|
5737
|
+
children: o.label
|
|
5738
|
+
},
|
|
5739
|
+
o.id
|
|
5740
|
+
))
|
|
5741
|
+
] }),
|
|
5742
|
+
model?.options?.length ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
5743
|
+
/* @__PURE__ */ jsx5("div", { className: "awr-menu__head", children: L.model }),
|
|
5744
|
+
menuSections(model.options).map((run, i, runs) => {
|
|
5745
|
+
const rows = run.options.map((o) => /* @__PURE__ */ jsxs3(
|
|
5746
|
+
"button",
|
|
5747
|
+
{
|
|
5748
|
+
type: "button",
|
|
5749
|
+
role: "menuitemradio",
|
|
5750
|
+
"aria-checked": model.value === o.id,
|
|
5751
|
+
className: `awr-menu__item${model.value === o.id ? " is-active" : ""}`,
|
|
5752
|
+
onClick: () => {
|
|
5753
|
+
model.onSelect?.(o.id);
|
|
5754
|
+
setMenu(void 0);
|
|
5755
|
+
},
|
|
5756
|
+
children: [
|
|
5757
|
+
o.label,
|
|
5758
|
+
o.group && /* @__PURE__ */ jsx5("span", { className: "awr-menu__group", children: o.group })
|
|
5759
|
+
]
|
|
5760
|
+
},
|
|
5761
|
+
o.id
|
|
5762
|
+
));
|
|
5763
|
+
if (run.section)
|
|
5764
|
+
return /* @__PURE__ */ jsxs3(
|
|
5765
|
+
"div",
|
|
5766
|
+
{
|
|
5767
|
+
role: "group",
|
|
5768
|
+
"aria-label": run.section,
|
|
5769
|
+
className: "awr-menu__section",
|
|
5770
|
+
children: [
|
|
5771
|
+
/* @__PURE__ */ jsx5(
|
|
5772
|
+
"div",
|
|
5773
|
+
{
|
|
5774
|
+
className: "awr-menu__head awr-menu__sectionhead",
|
|
5775
|
+
"aria-hidden": "true",
|
|
5776
|
+
children: run.section
|
|
5777
|
+
}
|
|
5778
|
+
),
|
|
5779
|
+
rows
|
|
5780
|
+
]
|
|
5781
|
+
},
|
|
5782
|
+
`s${i}`
|
|
5783
|
+
);
|
|
5784
|
+
return runs[i - 1]?.section ? /* @__PURE__ */ jsx5("div", { className: "awr-menu__section awr-menu__section--plain", children: rows }, `s${i}`) : /* @__PURE__ */ jsx5(Fragment2, { children: rows }, `s${i}`);
|
|
5785
|
+
})
|
|
5786
|
+
] }) : null
|
|
5787
|
+
]
|
|
5788
|
+
}
|
|
5789
|
+
)
|
|
5689
5790
|
] }),
|
|
5690
5791
|
/* @__PURE__ */ jsx5("span", { className: "awr-toolbar__spacer" }),
|
|
5691
5792
|
toolbarEnd,
|
|
@@ -5694,9 +5795,16 @@ ${draftText}` : draftText);
|
|
|
5694
5795
|
"button",
|
|
5695
5796
|
{
|
|
5696
5797
|
type: "button",
|
|
5798
|
+
ref: modeChipRef,
|
|
5697
5799
|
className: `awr-tchip awr-tchip--btn awr-mode awr-mode--${agent.approvalMode}`,
|
|
5698
5800
|
title: MODE_CHIP[agent.approvalMode].hint,
|
|
5699
5801
|
onClick: () => setMenu(menu === "mode" ? void 0 : "mode"),
|
|
5802
|
+
onKeyDown: (e) => {
|
|
5803
|
+
if (menu !== "mode" && opensMenu(e.key)) {
|
|
5804
|
+
e.preventDefault();
|
|
5805
|
+
setMenu("mode");
|
|
5806
|
+
}
|
|
5807
|
+
},
|
|
5700
5808
|
"aria-haspopup": "menu",
|
|
5701
5809
|
"aria-expanded": menu === "mode",
|
|
5702
5810
|
"aria-label": `${L.toolConsent}: ${MODE_CHIP[agent.approvalMode].label}`,
|
|
@@ -5706,29 +5814,39 @@ ${draftText}` : draftText);
|
|
|
5706
5814
|
]
|
|
5707
5815
|
}
|
|
5708
5816
|
),
|
|
5709
|
-
menu === "mode" && /* @__PURE__ */ jsxs3(
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
"
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5817
|
+
menu === "mode" && /* @__PURE__ */ jsxs3(
|
|
5818
|
+
"div",
|
|
5819
|
+
{
|
|
5820
|
+
className: "awr-menu awr-menu--pop",
|
|
5821
|
+
style: modeStyle,
|
|
5822
|
+
role: "menu",
|
|
5823
|
+
ref: modeMenuRef,
|
|
5824
|
+
onKeyDown: modeMenuKeys,
|
|
5825
|
+
children: [
|
|
5826
|
+
/* @__PURE__ */ jsx5("div", { className: "awr-menu__head", children: L.toolConsent }),
|
|
5827
|
+
MODES.map((m) => /* @__PURE__ */ jsxs3(
|
|
5828
|
+
"button",
|
|
5829
|
+
{
|
|
5830
|
+
type: "button",
|
|
5831
|
+
role: "menuitemradio",
|
|
5832
|
+
"aria-checked": agent.approvalMode === m,
|
|
5833
|
+
className: `awr-menu__item${agent.approvalMode === m ? " is-active" : ""}`,
|
|
5834
|
+
onClick: () => {
|
|
5835
|
+
agent.setApprovalMode(m);
|
|
5836
|
+
setMenu(void 0);
|
|
5837
|
+
},
|
|
5838
|
+
children: [
|
|
5839
|
+
/* @__PURE__ */ jsx5(ModeIcon, { mode: m }),
|
|
5840
|
+
" ",
|
|
5841
|
+
MODE_CHIP[m].label,
|
|
5842
|
+
/* @__PURE__ */ jsx5("span", { className: "awr-menu__desc", children: MODE_CHIP[m].hint })
|
|
5843
|
+
]
|
|
5844
|
+
},
|
|
5845
|
+
m
|
|
5846
|
+
))
|
|
5847
|
+
]
|
|
5848
|
+
}
|
|
5849
|
+
)
|
|
5732
5850
|
] }),
|
|
5733
5851
|
canSteer && /* @__PURE__ */ jsx5("button", { type: "button", className: "awr-sendbtn", onClick: submit, "aria-label": L.steer, children: /* @__PURE__ */ jsx5(SendIcon, { size: 16 }) }),
|
|
5734
5852
|
busy ? /* @__PURE__ */ jsx5(
|
|
@@ -5758,7 +5876,7 @@ ${draftText}` : draftText);
|
|
|
5758
5876
|
};
|
|
5759
5877
|
|
|
5760
5878
|
// src/components/ChatHistoryList.tsx
|
|
5761
|
-
import { Fragment as
|
|
5879
|
+
import { Fragment as Fragment4 } from "react";
|
|
5762
5880
|
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
5763
5881
|
var defaultTime = (ms) => {
|
|
5764
5882
|
const d = new Date(ms);
|
|
@@ -5828,7 +5946,7 @@ var ChatHistoryList = ({
|
|
|
5828
5946
|
}
|
|
5829
5947
|
)
|
|
5830
5948
|
] }, c.id);
|
|
5831
|
-
return renderChat ? /* @__PURE__ */ jsx6(
|
|
5949
|
+
return renderChat ? /* @__PURE__ */ jsx6(Fragment4, { children: renderChat(c, active, row) }, c.id) : row;
|
|
5832
5950
|
}) })
|
|
5833
5951
|
] });
|
|
5834
5952
|
};
|
|
@@ -6235,12 +6353,12 @@ var ElicitationPrompt = ({
|
|
|
6235
6353
|
};
|
|
6236
6354
|
|
|
6237
6355
|
// src/components/FilesPanel.tsx
|
|
6238
|
-
import { Fragment as
|
|
6356
|
+
import { Fragment as Fragment6, useEffect as useEffect12, useRef as useRef10, useState as useState12 } from "react";
|
|
6239
6357
|
|
|
6240
6358
|
// src/components/ImageViewer.tsx
|
|
6241
6359
|
import { createContext as createContext3, useContext as useContext3, useEffect as useEffect11, useRef as useRef9, useState as useState11 } from "react";
|
|
6242
6360
|
import { createPortal } from "react-dom";
|
|
6243
|
-
import { Fragment as
|
|
6361
|
+
import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
6244
6362
|
var fileNameOf = (name) => name.split(/[\\/]/).filter(Boolean).pop() ?? name;
|
|
6245
6363
|
var SWIPE_PX = 48;
|
|
6246
6364
|
var ImageViewer = ({ images, index, onIndex, onClose, labels }) => {
|
|
@@ -6381,7 +6499,7 @@ var ImageViewer = ({ images, index, onIndex, onClose, labels }) => {
|
|
|
6381
6499
|
)
|
|
6382
6500
|
}
|
|
6383
6501
|
),
|
|
6384
|
-
count > 1 && /* @__PURE__ */ jsxs7(
|
|
6502
|
+
count > 1 && /* @__PURE__ */ jsxs7(Fragment5, { children: [
|
|
6385
6503
|
/* @__PURE__ */ jsx9(
|
|
6386
6504
|
"button",
|
|
6387
6505
|
{
|
|
@@ -6454,7 +6572,7 @@ var ImageThumb = ({
|
|
|
6454
6572
|
onClose: close,
|
|
6455
6573
|
labels
|
|
6456
6574
|
});
|
|
6457
|
-
return /* @__PURE__ */ jsxs7(
|
|
6575
|
+
return /* @__PURE__ */ jsxs7(Fragment5, { children: [
|
|
6458
6576
|
/* @__PURE__ */ jsx9(
|
|
6459
6577
|
"button",
|
|
6460
6578
|
{
|
|
@@ -6484,7 +6602,7 @@ var ImageThumb = ({
|
|
|
6484
6602
|
};
|
|
6485
6603
|
|
|
6486
6604
|
// src/components/FilesPanel.tsx
|
|
6487
|
-
import { Fragment as
|
|
6605
|
+
import { Fragment as Fragment7, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
6488
6606
|
var PREVIEW_CHARS = 2e4;
|
|
6489
6607
|
var FilesPanel = ({
|
|
6490
6608
|
files: vfs,
|
|
@@ -6528,7 +6646,7 @@ var FilesPanel = ({
|
|
|
6528
6646
|
return /* @__PURE__ */ jsxs8("div", { className: ["awr-filespanel", className].filter(Boolean).join(" "), children: [
|
|
6529
6647
|
/* @__PURE__ */ jsxs8("div", { className: "awr-panel__head", children: [
|
|
6530
6648
|
/* @__PURE__ */ jsx10("span", { className: "awr-panel__title", children: title ?? L.files }),
|
|
6531
|
-
allowUpload && /* @__PURE__ */ jsxs8(
|
|
6649
|
+
allowUpload && /* @__PURE__ */ jsxs8(Fragment7, { children: [
|
|
6532
6650
|
/* @__PURE__ */ jsx10(
|
|
6533
6651
|
"button",
|
|
6534
6652
|
{
|
|
@@ -6603,7 +6721,7 @@ var FilesPanel = ({
|
|
|
6603
6721
|
},
|
|
6604
6722
|
f.path
|
|
6605
6723
|
);
|
|
6606
|
-
return renderFile ? /* @__PURE__ */ jsx10(
|
|
6724
|
+
return renderFile ? /* @__PURE__ */ jsx10(Fragment6, { children: renderFile(f, row) }, f.path) : row;
|
|
6607
6725
|
}) }),
|
|
6608
6726
|
preview && /* @__PURE__ */ jsx10("div", { className: "awr-filepreview", children: preview.kind === "image" ? (
|
|
6609
6727
|
// A click (Enter, Space) opens it over the chat, fitted to the screen.
|
|
@@ -6623,7 +6741,7 @@ var FilesPanel = ({
|
|
|
6623
6741
|
};
|
|
6624
6742
|
|
|
6625
6743
|
// src/components/FileChips.tsx
|
|
6626
|
-
import { Fragment as
|
|
6744
|
+
import { Fragment as Fragment8, useEffect as useEffect14, useMemo as useMemo7, useState as useState14 } from "react";
|
|
6627
6745
|
|
|
6628
6746
|
// src/file-kinds.ts
|
|
6629
6747
|
import { MEDIA_IMAGE_TYPES, isTextMime } from "@dudko.dev/agent-web";
|
|
@@ -6771,7 +6889,7 @@ var SandboxedFrame = ({
|
|
|
6771
6889
|
] });
|
|
6772
6890
|
|
|
6773
6891
|
// src/components/FileChips.tsx
|
|
6774
|
-
import { Fragment as
|
|
6892
|
+
import { Fragment as Fragment9, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6775
6893
|
var FILE_PREVIEW_CHARS = 2e4;
|
|
6776
6894
|
var textOf = (file) => file.encoding === "base64" ? new TextDecoder().decode(bytesOf(file.content, "base64")) : file.content;
|
|
6777
6895
|
var KIND_ICON = {
|
|
@@ -6835,10 +6953,10 @@ var SourceView = ({
|
|
|
6835
6953
|
() => linesOf(html ? tokenizeHtml(shown) : [{ kind: "text", text: shown }]),
|
|
6836
6954
|
[shown, html]
|
|
6837
6955
|
);
|
|
6838
|
-
return /* @__PURE__ */ jsxs11(
|
|
6956
|
+
return /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
6839
6957
|
/* @__PURE__ */ jsx13("pre", { className: ["awr-source", className].filter(Boolean).join(" "), tabIndex: 0, children: lines.map((line, i) => /* @__PURE__ */ jsxs11("span", { className: "awr-source__line", children: [
|
|
6840
6958
|
line.map(
|
|
6841
|
-
(t, k) => t.kind === "text" ? /* @__PURE__ */ jsx13(
|
|
6959
|
+
(t, k) => t.kind === "text" ? /* @__PURE__ */ jsx13(Fragment8, { children: t.text }, k) : /* @__PURE__ */ jsx13("span", { className: `awr-source__${t.kind}`, children: t.text }, k)
|
|
6842
6960
|
),
|
|
6843
6961
|
"\n"
|
|
6844
6962
|
] }, i)) }),
|
|
@@ -6864,11 +6982,11 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
|
|
|
6864
6982
|
html: showing === "preview" ? html : void 0,
|
|
6865
6983
|
scripts,
|
|
6866
6984
|
height: tall ? height * 2 : height,
|
|
6867
|
-
label: /* @__PURE__ */ jsxs11(
|
|
6985
|
+
label: /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
6868
6986
|
/* @__PURE__ */ jsx13(CodeIcon, { size: 14, className: "awr-frame__icon" }),
|
|
6869
6987
|
/* @__PURE__ */ jsxs11("span", { className: "awr-frame__titles", children: [
|
|
6870
6988
|
/* @__PURE__ */ jsx13("span", { className: "awr-frame__title", children: L.htmlFrameTitle }),
|
|
6871
|
-
/* @__PURE__ */ jsx13("span", { className: "awr-frame__badges", children: showing === "preview" ? /* @__PURE__ */ jsxs11(
|
|
6989
|
+
/* @__PURE__ */ jsx13("span", { className: "awr-frame__badges", children: showing === "preview" ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
6872
6990
|
/* @__PURE__ */ jsx13(LockIcon, { size: 11 }),
|
|
6873
6991
|
" ",
|
|
6874
6992
|
L.htmlSandboxed,
|
|
@@ -6879,7 +6997,7 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
|
|
|
6879
6997
|
] }) : L.htmlSourceNote })
|
|
6880
6998
|
] })
|
|
6881
6999
|
] }),
|
|
6882
|
-
actions: canFrame ? /* @__PURE__ */ jsxs11(
|
|
7000
|
+
actions: canFrame ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
6883
7001
|
/* @__PURE__ */ jsx13(
|
|
6884
7002
|
Seg,
|
|
6885
7003
|
{
|
|
@@ -6906,7 +7024,7 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
|
|
|
6906
7024
|
}
|
|
6907
7025
|
)
|
|
6908
7026
|
] }) : void 0,
|
|
6909
|
-
footer: /* @__PURE__ */ jsxs11(
|
|
7027
|
+
footer: /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
6910
7028
|
/* @__PURE__ */ jsx13(FileIcon, { size: 11 }),
|
|
6911
7029
|
/* @__PURE__ */ jsx13("code", { children: written.path }),
|
|
6912
7030
|
/* @__PURE__ */ jsxs11("span", { className: "awr-frame__footmeta", children: [
|
|
@@ -6918,7 +7036,7 @@ var HtmlPreview = ({ written, file, htmlPreview, previewChars, L }) => {
|
|
|
6918
7036
|
linked.length > 0 ? ` \xB7 ${L.htmlLinkedFiles(linked.join(", "))}` : ""
|
|
6919
7037
|
] })
|
|
6920
7038
|
] }),
|
|
6921
|
-
children: showing === "source" ? /* @__PURE__ */ jsxs11(
|
|
7039
|
+
children: showing === "source" ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
6922
7040
|
tooLarge && options ? /* @__PURE__ */ jsx13("p", { className: "awr-fileview__cut", children: L.htmlTooLarge }) : null,
|
|
6923
7041
|
/* @__PURE__ */ jsx13(SourceView, { text: html, html: true, maxChars: previewChars, className: "awr-frame__source" })
|
|
6924
7042
|
] }) : void 0
|
|
@@ -6991,7 +7109,7 @@ var TextPreview = ({
|
|
|
6991
7109
|
]
|
|
6992
7110
|
}
|
|
6993
7111
|
) }),
|
|
6994
|
-
/* @__PURE__ */ jsx13("div", { className: `awr-fileview__body${long && !all ? " is-folded" : ""}`, children: showing === "rendered" ? /* @__PURE__ */ jsxs11(
|
|
7112
|
+
/* @__PURE__ */ jsx13("div", { className: `awr-fileview__body${long && !all ? " is-folded" : ""}`, children: showing === "rendered" ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
6995
7113
|
/* @__PURE__ */ jsx13("div", { className: "awr-fileview__rendered", children: rendered }),
|
|
6996
7114
|
text.length > previewChars && /* @__PURE__ */ jsx13("p", { className: "awr-fileview__cut", children: L.fileCut(previewChars) })
|
|
6997
7115
|
] }) : /* @__PURE__ */ jsx13(SourceView, { text, maxChars: previewChars }) }),
|
|
@@ -7144,10 +7262,10 @@ var FileChip = ({
|
|
|
7144
7262
|
};
|
|
7145
7263
|
|
|
7146
7264
|
// src/components/StepList.tsx
|
|
7147
|
-
import { Fragment as
|
|
7265
|
+
import { Fragment as Fragment11 } from "react";
|
|
7148
7266
|
|
|
7149
7267
|
// src/components/SubagentTree.tsx
|
|
7150
|
-
import { Fragment as
|
|
7268
|
+
import { Fragment as Fragment10, useEffect as useEffect15, useState as useState15 } from "react";
|
|
7151
7269
|
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
7152
7270
|
var useElapsed = (startedAt, running) => {
|
|
7153
7271
|
const [now, setNow] = useState15(void 0);
|
|
@@ -7241,7 +7359,7 @@ var SubagentTree = ({
|
|
|
7241
7359
|
},
|
|
7242
7360
|
node.id
|
|
7243
7361
|
);
|
|
7244
|
-
return renderSubagent ? /* @__PURE__ */ jsx14(
|
|
7362
|
+
return renderSubagent ? /* @__PURE__ */ jsx14(Fragment10, { children: renderSubagent(node, row) }, node.id) : row;
|
|
7245
7363
|
})
|
|
7246
7364
|
}
|
|
7247
7365
|
);
|
|
@@ -7420,7 +7538,7 @@ var StepItem = ({
|
|
|
7420
7538
|
},
|
|
7421
7539
|
i
|
|
7422
7540
|
);
|
|
7423
|
-
return renderToolCall ? /* @__PURE__ */ jsx15(
|
|
7541
|
+
return renderToolCall ? /* @__PURE__ */ jsx15(Fragment11, { children: renderToolCall(call, row) }, i) : row;
|
|
7424
7542
|
}) }),
|
|
7425
7543
|
approvals.length > 0 && /* @__PURE__ */ jsx15("ul", { className: "awr-step__tools", children: approvals.map((a) => /* @__PURE__ */ jsxs13("li", { className: `awr-tool awr-tool__row awr-tool--approval-${a.status}`, children: [
|
|
7426
7544
|
/* @__PURE__ */ jsx15(ShieldIcon, { size: 13, className: "awr-tool__icon" }),
|
|
@@ -8179,7 +8297,7 @@ var UsageBadge = ({
|
|
|
8179
8297
|
};
|
|
8180
8298
|
|
|
8181
8299
|
// src/components/AgentChat.tsx
|
|
8182
|
-
import { Fragment as
|
|
8300
|
+
import { Fragment as Fragment12, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
8183
8301
|
var usePrefersDark = () => {
|
|
8184
8302
|
const query = "(prefers-color-scheme: dark)";
|
|
8185
8303
|
const [dark, setDark] = useState17(
|
|
@@ -8412,7 +8530,7 @@ var AgentChatInner = ({
|
|
|
8412
8530
|
const showReplan = agent.replan && agent.replan.mode !== "continue";
|
|
8413
8531
|
const replanFailedEarly = showReplanFailed && agent.replan?.failed === true && agent.steps.length === 0;
|
|
8414
8532
|
const earlyDecisions = showDecisions ? agent.decisions ?? [] : [];
|
|
8415
|
-
const liveExtra = agent.planThought.trim() || showReplan || replanFailedEarly || earlyDecisions.length > 0 ? /* @__PURE__ */ jsxs19(
|
|
8533
|
+
const liveExtra = agent.planThought.trim() || showReplan || replanFailedEarly || earlyDecisions.length > 0 ? /* @__PURE__ */ jsxs19(Fragment12, { children: [
|
|
8416
8534
|
agent.planThought.trim() && /* @__PURE__ */ jsxs19("details", { className: "awr-activity__plan", children: [
|
|
8417
8535
|
/* @__PURE__ */ jsx20("summary", { children: L.planned }),
|
|
8418
8536
|
/* @__PURE__ */ jsx20("p", { className: "awr-activity__thought", children: agent.planThought })
|
|
@@ -8639,7 +8757,7 @@ var AgentChatInner = ({
|
|
|
8639
8757
|
),
|
|
8640
8758
|
panelTarget
|
|
8641
8759
|
)
|
|
8642
|
-
) : asSheet ? /* @__PURE__ */ jsxs19(
|
|
8760
|
+
) : asSheet ? /* @__PURE__ */ jsxs19(Fragment12, { children: [
|
|
8643
8761
|
/* @__PURE__ */ jsx20("div", { className: "awr-sheet__scrim", onClick: () => setPanelApp(void 0) }),
|
|
8644
8762
|
/* @__PURE__ */ jsxs19(
|
|
8645
8763
|
"aside",
|
|
@@ -9121,6 +9239,8 @@ export {
|
|
|
9121
9239
|
mcpAppSandboxShellCsp,
|
|
9122
9240
|
mcpAppSandboxTarget,
|
|
9123
9241
|
mediaFamilyOf,
|
|
9242
|
+
menuKeyTarget,
|
|
9243
|
+
menuSections,
|
|
9124
9244
|
mergeChatRecord,
|
|
9125
9245
|
mergeLabels,
|
|
9126
9246
|
newChatId,
|