@dudko.dev/agent-web-react 0.0.25 → 0.0.27
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 +123 -28
- package/dist/chunk-LCJZEGB5.js +147 -0
- package/dist/chunk-LCJZEGB5.js.map +1 -0
- package/dist/index.js +324 -413
- package/dist/index.js.map +1 -1
- package/dist/mcp.cjs +65 -35
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.d.cts +43 -13
- package/dist/mcp.d.ts +43 -13
- package/dist/mcp.js +64 -35
- package/dist/mcp.js.map +1 -1
- package/dist/pipeline.cjs +3485 -0
- package/dist/pipeline.cjs.map +1 -0
- package/dist/pipeline.css +1407 -0
- package/dist/pipeline.d.cts +830 -0
- package/dist/pipeline.d.ts +830 -0
- package/dist/pipeline.js +3390 -0
- package/dist/pipeline.js.map +1 -0
- package/package.json +33 -20
package/dist/index.js
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AlertIcon,
|
|
3
|
+
BoltIcon,
|
|
4
|
+
BookIcon,
|
|
5
|
+
BotIcon,
|
|
6
|
+
BrainIcon,
|
|
7
|
+
CheckIcon,
|
|
8
|
+
ClockIcon,
|
|
9
|
+
DownloadIcon,
|
|
10
|
+
EyeIcon,
|
|
11
|
+
FileIcon,
|
|
12
|
+
GlobeIcon,
|
|
13
|
+
HistoryIcon,
|
|
14
|
+
MicIcon,
|
|
15
|
+
PlusIcon,
|
|
16
|
+
SendIcon,
|
|
17
|
+
ShieldIcon,
|
|
18
|
+
SlashIcon,
|
|
19
|
+
SpinnerIcon,
|
|
20
|
+
StopIcon,
|
|
21
|
+
ToolIcon,
|
|
22
|
+
XIcon,
|
|
23
|
+
errMessage,
|
|
24
|
+
formatDuration,
|
|
25
|
+
formatTokens,
|
|
26
|
+
imagesInOutput,
|
|
27
|
+
previewValue
|
|
28
|
+
} from "./chunk-LCJZEGB5.js";
|
|
29
|
+
|
|
1
30
|
// src/hooks/use-agent.ts
|
|
2
31
|
import { useCallback, useEffect, useReducer, useRef, useState } from "react";
|
|
3
32
|
import {
|
|
@@ -129,16 +158,16 @@ var streamAssistant = (messages, content) => {
|
|
|
129
158
|
var applyEvent = (state, event, ctx) => {
|
|
130
159
|
switch (event.type) {
|
|
131
160
|
case "run.start": {
|
|
132
|
-
const
|
|
133
|
-
const userId = `msg-${
|
|
134
|
-
const assistantId = `msg-${
|
|
161
|
+
const base = resetRun(state);
|
|
162
|
+
const userId = `msg-${base.seq}`;
|
|
163
|
+
const assistantId = `msg-${base.seq + 1}`;
|
|
135
164
|
return {
|
|
136
|
-
...
|
|
165
|
+
...base,
|
|
137
166
|
goal: event.goal,
|
|
138
167
|
runStartedAt: ctx.at,
|
|
139
168
|
runMessageId: assistantId,
|
|
140
169
|
messages: [
|
|
141
|
-
...
|
|
170
|
+
...base.messages,
|
|
142
171
|
{
|
|
143
172
|
id: userId,
|
|
144
173
|
role: "user",
|
|
@@ -148,7 +177,7 @@ var applyEvent = (state, event, ctx) => {
|
|
|
148
177
|
},
|
|
149
178
|
{ id: assistantId, role: "assistant", content: "", pending: true }
|
|
150
179
|
],
|
|
151
|
-
seq:
|
|
180
|
+
seq: base.seq + 2
|
|
152
181
|
};
|
|
153
182
|
}
|
|
154
183
|
case "model.load":
|
|
@@ -551,9 +580,6 @@ var agentStateReducer = (state, action) => {
|
|
|
551
580
|
}
|
|
552
581
|
};
|
|
553
582
|
|
|
554
|
-
// src/util.ts
|
|
555
|
-
var errMessage = (err) => err instanceof Error ? err.message : String(err);
|
|
556
|
-
|
|
557
583
|
// src/hooks/use-agent.ts
|
|
558
584
|
var useAgent = (config, options = {}) => {
|
|
559
585
|
const [state, dispatch] = useReducer(agentStateReducer, void 0, createInitialAgentState);
|
|
@@ -1485,11 +1511,11 @@ var NESTED = [
|
|
|
1485
1511
|
"thinkingLevels",
|
|
1486
1512
|
"noteAt"
|
|
1487
1513
|
];
|
|
1488
|
-
var mergeLabels = (
|
|
1489
|
-
if (!over) return
|
|
1490
|
-
const out = { ...
|
|
1514
|
+
var mergeLabels = (base, over) => {
|
|
1515
|
+
if (!over) return base;
|
|
1516
|
+
const out = { ...base, ...over };
|
|
1491
1517
|
for (const key of NESTED) {
|
|
1492
|
-
if (over[key]) out[key] = { ...
|
|
1518
|
+
if (over[key]) out[key] = { ...base[key], ...over[key] };
|
|
1493
1519
|
}
|
|
1494
1520
|
return out;
|
|
1495
1521
|
};
|
|
@@ -1573,82 +1599,7 @@ import { useEffect as useEffect7, useRef as useRef7, useState as useState9 } fro
|
|
|
1573
1599
|
|
|
1574
1600
|
// src/components/AgentComposer.tsx
|
|
1575
1601
|
import { useEffect as useEffect5, useLayoutEffect, useMemo as useMemo4, useRef as useRef5, useState as useState7 } from "react";
|
|
1576
|
-
|
|
1577
|
-
// src/components/icons.tsx
|
|
1578
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
1579
|
-
var base = (size = 16) => ({
|
|
1580
|
-
width: size,
|
|
1581
|
-
height: size,
|
|
1582
|
-
viewBox: "0 0 24 24",
|
|
1583
|
-
fill: "none",
|
|
1584
|
-
stroke: "currentColor",
|
|
1585
|
-
strokeWidth: 2,
|
|
1586
|
-
strokeLinecap: "round",
|
|
1587
|
-
strokeLinejoin: "round",
|
|
1588
|
-
"aria-hidden": true
|
|
1589
|
-
});
|
|
1590
|
-
var SendIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1591
|
-
/* @__PURE__ */ jsx3("path", { d: "M22 2 11 13" }),
|
|
1592
|
-
/* @__PURE__ */ jsx3("path", { d: "M22 2 15 22l-4-9-9-4Z" })
|
|
1593
|
-
] });
|
|
1594
|
-
var StopIcon = ({ size, className }) => /* @__PURE__ */ jsx3("svg", { ...base(size), className, children: /* @__PURE__ */ jsx3("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }) });
|
|
1595
|
-
var SpinnerIcon = ({ size, className }) => /* @__PURE__ */ jsx3("svg", { ...base(size), className: ["awr-spin", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx3("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
|
|
1596
|
-
var CheckIcon = ({ size, className }) => /* @__PURE__ */ jsx3("svg", { ...base(size), className, children: /* @__PURE__ */ jsx3("path", { d: "M20 6 9 17l-5-5" }) });
|
|
1597
|
-
var AlertIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1598
|
-
/* @__PURE__ */ jsx3("path", { d: "M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z" }),
|
|
1599
|
-
/* @__PURE__ */ jsx3("path", { d: "M12 9v4" }),
|
|
1600
|
-
/* @__PURE__ */ jsx3("path", { d: "M12 17h.01" })
|
|
1601
|
-
] });
|
|
1602
|
-
var ToolIcon = ({ size, className }) => /* @__PURE__ */ jsx3("svg", { ...base(size), className, children: /* @__PURE__ */ jsx3("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76Z" }) });
|
|
1603
|
-
var ShieldIcon = ({ size, className }) => /* @__PURE__ */ jsx3("svg", { ...base(size), className, children: /* @__PURE__ */ jsx3("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z" }) });
|
|
1604
|
-
var BrainIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1605
|
-
/* @__PURE__ */ jsx3("path", { d: "M9 3a3 3 0 0 0-3 3 3 3 0 0 0-2 5 3 3 0 0 0 2 5 3 3 0 0 0 6 1V4a3 3 0 0 0-3-1Z" }),
|
|
1606
|
-
/* @__PURE__ */ jsx3("path", { d: "M15 3a3 3 0 0 1 3 3 3 3 0 0 1 2 5 3 3 0 0 1-2 5 3 3 0 0 1-6 1" })
|
|
1607
|
-
] });
|
|
1608
|
-
var BotIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1609
|
-
/* @__PURE__ */ jsx3("rect", { x: "4", y: "8", width: "16", height: "12", rx: "3" }),
|
|
1610
|
-
/* @__PURE__ */ jsx3("path", { d: "M12 8V4" }),
|
|
1611
|
-
/* @__PURE__ */ jsx3("path", { d: "M9 14h.01M15 14h.01" })
|
|
1612
|
-
] });
|
|
1613
|
-
var PlusIcon = ({ size, className }) => /* @__PURE__ */ jsx3("svg", { ...base(size), className, children: /* @__PURE__ */ jsx3("path", { d: "M12 5v14M5 12h14" }) });
|
|
1614
|
-
var SlashIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1615
|
-
/* @__PURE__ */ jsx3("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3" }),
|
|
1616
|
-
/* @__PURE__ */ jsx3("path", { d: "m15 7-6 10" })
|
|
1617
|
-
] });
|
|
1618
|
-
var ClockIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1619
|
-
/* @__PURE__ */ jsx3("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1620
|
-
/* @__PURE__ */ jsx3("path", { d: "M12 7v5l3 2" })
|
|
1621
|
-
] });
|
|
1622
|
-
var MicIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1623
|
-
/* @__PURE__ */ jsx3("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
|
|
1624
|
-
/* @__PURE__ */ jsx3("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
|
|
1625
|
-
] });
|
|
1626
|
-
var BoltIcon = ({ size, className }) => /* @__PURE__ */ jsx3("svg", { ...base(size), className, children: /* @__PURE__ */ jsx3("path", { d: "M13 2 4 14h7l-1 8 9-12h-7Z" }) });
|
|
1627
|
-
var EyeIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1628
|
-
/* @__PURE__ */ jsx3("path", { d: "M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z" }),
|
|
1629
|
-
/* @__PURE__ */ jsx3("circle", { cx: "12", cy: "12", r: "3" })
|
|
1630
|
-
] });
|
|
1631
|
-
var XIcon = ({ size, className }) => /* @__PURE__ */ jsx3("svg", { ...base(size), className, children: /* @__PURE__ */ jsx3("path", { d: "M18 6 6 18M6 6l12 12" }) });
|
|
1632
|
-
var FileIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1633
|
-
/* @__PURE__ */ jsx3("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
|
|
1634
|
-
/* @__PURE__ */ jsx3("path", { d: "M14 3v6h6" })
|
|
1635
|
-
] });
|
|
1636
|
-
var HistoryIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1637
|
-
/* @__PURE__ */ jsx3("path", { d: "M3 12a9 9 0 1 0 3-6.7L3 8" }),
|
|
1638
|
-
/* @__PURE__ */ jsx3("path", { d: "M3 3v5h5M12 7v5l3 2" })
|
|
1639
|
-
] });
|
|
1640
|
-
var BookIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1641
|
-
/* @__PURE__ */ jsx3("path", { d: "M4 5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2Z" }),
|
|
1642
|
-
/* @__PURE__ */ jsx3("path", { d: "M4 19V5M9 7h6" })
|
|
1643
|
-
] });
|
|
1644
|
-
var GlobeIcon = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1645
|
-
/* @__PURE__ */ jsx3("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1646
|
-
/* @__PURE__ */ jsx3("path", { d: "M3 12h18M12 3c3 3.2 3 14.8 0 18M12 3c-3 3.2-3 14.8 0 18" })
|
|
1647
|
-
] });
|
|
1648
|
-
var DownloadIcon = ({ size, className }) => /* @__PURE__ */ jsx3("svg", { ...base(size), className, children: /* @__PURE__ */ jsx3("path", { d: "M12 3v12m-5-5 5 5 5-5M5 21h14" }) });
|
|
1649
|
-
|
|
1650
|
-
// src/components/AgentComposer.tsx
|
|
1651
|
-
import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1602
|
+
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
1652
1603
|
var thinkingDefaults = (l) => [
|
|
1653
1604
|
{ id: "off", label: l.thinkingLevels.off },
|
|
1654
1605
|
{ id: "none", label: l.thinkingLevels.none },
|
|
@@ -1657,7 +1608,7 @@ var thinkingDefaults = (l) => [
|
|
|
1657
1608
|
{ id: "high", label: l.thinkingLevels.high }
|
|
1658
1609
|
];
|
|
1659
1610
|
var MODES = ["autopilot", "ask-writes", "ask-all", "read-only"];
|
|
1660
|
-
var ModeIcon = ({ mode }) => mode === "autopilot" ? /* @__PURE__ */
|
|
1611
|
+
var ModeIcon = ({ mode }) => mode === "autopilot" ? /* @__PURE__ */ jsx3(BoltIcon, { size: 14 }) : mode === "read-only" ? /* @__PURE__ */ jsx3(EyeIcon, { size: 14 }) : /* @__PURE__ */ jsx3(ShieldIcon, { size: 14 });
|
|
1661
1612
|
var attachSeq = 0;
|
|
1662
1613
|
var useIsoLayoutEffect = typeof window === "undefined" ? useEffect5 : useLayoutEffect;
|
|
1663
1614
|
var useMenuPlacement = (open, anchor, align) => {
|
|
@@ -2114,24 +2065,24 @@ var AgentComposer = ({
|
|
|
2114
2065
|
const thinkingLabel = thinking ? thinkingOptions.find((o) => o.id === thinking.value)?.label ?? thinking.value : void 0;
|
|
2115
2066
|
const canSend = ready && (text.trim().length > 0 || pending.length > 0);
|
|
2116
2067
|
const canSteer = busy && steering && text.trim().length > 0;
|
|
2117
|
-
const queuedStrip = showQueued && (agent.queued.length > 0 || agent.undelivered.length > 0) ? /* @__PURE__ */
|
|
2118
|
-
agent.queued.map((q) => /* @__PURE__ */
|
|
2119
|
-
/* @__PURE__ */
|
|
2120
|
-
/* @__PURE__ */
|
|
2121
|
-
/* @__PURE__ */
|
|
2068
|
+
const queuedStrip = showQueued && (agent.queued.length > 0 || agent.undelivered.length > 0) ? /* @__PURE__ */ jsxs("div", { className: "awr-queued", children: [
|
|
2069
|
+
agent.queued.map((q) => /* @__PURE__ */ jsxs("div", { className: "awr-queued__item", role: "status", children: [
|
|
2070
|
+
/* @__PURE__ */ jsx3(ClockIcon, { size: 13, className: "awr-queued__icon" }),
|
|
2071
|
+
/* @__PURE__ */ jsx3("span", { className: "awr-queued__text", title: q.text, children: q.text }),
|
|
2072
|
+
/* @__PURE__ */ jsx3("span", { className: "awr-queued__state", children: L.queuedWaiting })
|
|
2122
2073
|
] }, q.id)),
|
|
2123
|
-
agent.undelivered.length > 0 && /* @__PURE__ */
|
|
2124
|
-
/* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
2074
|
+
agent.undelivered.length > 0 && /* @__PURE__ */ jsxs("div", { className: "awr-queued__item awr-queued__item--undelivered", role: "status", children: [
|
|
2075
|
+
/* @__PURE__ */ jsx3(AlertIcon, { size: 13, className: "awr-queued__icon" }),
|
|
2076
|
+
/* @__PURE__ */ jsxs("span", { className: "awr-queued__text", title: agent.undelivered.join("\n\n"), children: [
|
|
2126
2077
|
L.undelivered(agent.undelivered.length),
|
|
2127
2078
|
": ",
|
|
2128
2079
|
agent.undelivered.join(" \xB7 ")
|
|
2129
2080
|
] }),
|
|
2130
|
-
/* @__PURE__ */
|
|
2131
|
-
/* @__PURE__ */
|
|
2081
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "awr-linkbtn", onClick: agent.sendUndelivered, children: L.sendUndelivered }),
|
|
2082
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "awr-linkbtn", onClick: agent.discardUndelivered, children: L.discardUndelivered })
|
|
2132
2083
|
] })
|
|
2133
2084
|
] }) : null;
|
|
2134
|
-
return /* @__PURE__ */
|
|
2085
|
+
return /* @__PURE__ */ jsxs(
|
|
2135
2086
|
"div",
|
|
2136
2087
|
{
|
|
2137
2088
|
className: [
|
|
@@ -2142,11 +2093,11 @@ var AgentComposer = ({
|
|
|
2142
2093
|
].filter(Boolean).join(" "),
|
|
2143
2094
|
ref: rootRef,
|
|
2144
2095
|
children: [
|
|
2145
|
-
dragging && /* @__PURE__ */
|
|
2096
|
+
dragging && /* @__PURE__ */ jsx3("div", { className: "awr-dropnote", style: dropRect, "aria-hidden": "true", children: L.dropHint }),
|
|
2146
2097
|
queuedStrip,
|
|
2147
|
-
notices.length > 0 && /* @__PURE__ */
|
|
2148
|
-
/* @__PURE__ */
|
|
2149
|
-
/* @__PURE__ */
|
|
2098
|
+
notices.length > 0 && /* @__PURE__ */ jsx3("div", { className: "awr-notices", children: notices.map((n) => /* @__PURE__ */ jsxs("div", { className: `awr-notice awr-notice--${n.tone}`, role: "status", children: [
|
|
2099
|
+
/* @__PURE__ */ jsx3("span", { children: n.text }),
|
|
2100
|
+
/* @__PURE__ */ jsx3(
|
|
2150
2101
|
"button",
|
|
2151
2102
|
{
|
|
2152
2103
|
type: "button",
|
|
@@ -2156,18 +2107,18 @@ var AgentComposer = ({
|
|
|
2156
2107
|
setDismissed((d) => new Set(d).add(n.id));
|
|
2157
2108
|
if (n.id.startsWith("attach:")) setAttachError(void 0);
|
|
2158
2109
|
},
|
|
2159
|
-
children: /* @__PURE__ */
|
|
2110
|
+
children: /* @__PURE__ */ jsx3(XIcon, { size: 14 })
|
|
2160
2111
|
}
|
|
2161
2112
|
)
|
|
2162
2113
|
] }, n.id)) }),
|
|
2163
|
-
paletteOpen && /* @__PURE__ */
|
|
2114
|
+
paletteOpen && /* @__PURE__ */ jsx3(
|
|
2164
2115
|
"ul",
|
|
2165
2116
|
{
|
|
2166
2117
|
className: "awr-menu awr-menu--commands",
|
|
2167
2118
|
style: commandsStyle,
|
|
2168
2119
|
role: "listbox",
|
|
2169
2120
|
"aria-label": L.commands,
|
|
2170
|
-
children: palette.map((c, i) => /* @__PURE__ */
|
|
2121
|
+
children: palette.map((c, i) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsxs(
|
|
2171
2122
|
"button",
|
|
2172
2123
|
{
|
|
2173
2124
|
type: "button",
|
|
@@ -2177,37 +2128,37 @@ var AgentComposer = ({
|
|
|
2177
2128
|
onMouseDown: (e) => e.preventDefault(),
|
|
2178
2129
|
onClick: () => pick(c),
|
|
2179
2130
|
children: [
|
|
2180
|
-
/* @__PURE__ */
|
|
2131
|
+
/* @__PURE__ */ jsxs("code", { children: [
|
|
2181
2132
|
"/",
|
|
2182
2133
|
c.name
|
|
2183
2134
|
] }),
|
|
2184
|
-
/* @__PURE__ */
|
|
2185
|
-
c.group && /* @__PURE__ */
|
|
2135
|
+
/* @__PURE__ */ jsx3("span", { className: "awr-menu__desc", children: c.description }),
|
|
2136
|
+
c.group && /* @__PURE__ */ jsx3("span", { className: "awr-menu__group", children: c.group })
|
|
2186
2137
|
]
|
|
2187
2138
|
}
|
|
2188
2139
|
) }, `${c.group}:${c.name}`))
|
|
2189
2140
|
}
|
|
2190
2141
|
),
|
|
2191
|
-
pending.length > 0 && /* @__PURE__ */
|
|
2142
|
+
pending.length > 0 && /* @__PURE__ */ jsx3("div", { className: "awr-files", children: pending.map((a) => {
|
|
2192
2143
|
const remove = () => setPending((cur) => cur.filter((x) => x.id !== a.id));
|
|
2193
|
-
if (renderAttachment) return /* @__PURE__ */
|
|
2194
|
-
return /* @__PURE__ */
|
|
2195
|
-
a.kind === "image" && a.dataUrl ? /* @__PURE__ */
|
|
2196
|
-
/* @__PURE__ */
|
|
2197
|
-
/* @__PURE__ */
|
|
2144
|
+
if (renderAttachment) return /* @__PURE__ */ jsx3("span", { children: renderAttachment(a, remove) }, a.id);
|
|
2145
|
+
return /* @__PURE__ */ jsxs("span", { className: "awr-chip awr-file", title: a.note ?? a.mediaType, children: [
|
|
2146
|
+
a.kind === "image" && a.dataUrl ? /* @__PURE__ */ jsx3("img", { className: "awr-file__thumb", src: a.dataUrl, alt: a.name }) : /* @__PURE__ */ jsx3(FileIcon, { size: 14 }),
|
|
2147
|
+
/* @__PURE__ */ jsx3("span", { className: "awr-file__name", children: a.name }),
|
|
2148
|
+
/* @__PURE__ */ jsx3(
|
|
2198
2149
|
"button",
|
|
2199
2150
|
{
|
|
2200
2151
|
type: "button",
|
|
2201
2152
|
className: "awr-iconbtn",
|
|
2202
2153
|
"aria-label": L.remove(a.name),
|
|
2203
2154
|
onClick: remove,
|
|
2204
|
-
children: /* @__PURE__ */
|
|
2155
|
+
children: /* @__PURE__ */ jsx3(XIcon, { size: 12 })
|
|
2205
2156
|
}
|
|
2206
2157
|
)
|
|
2207
2158
|
] }, a.id);
|
|
2208
2159
|
}) }),
|
|
2209
|
-
/* @__PURE__ */
|
|
2210
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ jsxs("div", { className: "awr-composer2__inputrow", children: [
|
|
2161
|
+
/* @__PURE__ */ jsx3(
|
|
2211
2162
|
"textarea",
|
|
2212
2163
|
{
|
|
2213
2164
|
ref: inputRef,
|
|
@@ -2222,7 +2173,7 @@ var AgentComposer = ({
|
|
|
2222
2173
|
"aria-label": L.message
|
|
2223
2174
|
}
|
|
2224
2175
|
),
|
|
2225
|
-
showMic && /* @__PURE__ */
|
|
2176
|
+
showMic && /* @__PURE__ */ jsx3(
|
|
2226
2177
|
"button",
|
|
2227
2178
|
{
|
|
2228
2179
|
type: "button",
|
|
@@ -2231,14 +2182,14 @@ var AgentComposer = ({
|
|
|
2231
2182
|
title: stt.listening ? L.stopDictation : L.dictateTitle,
|
|
2232
2183
|
onClick: stt.toggle,
|
|
2233
2184
|
disabled,
|
|
2234
|
-
children: /* @__PURE__ */
|
|
2185
|
+
children: /* @__PURE__ */ jsx3(MicIcon, { size: 18 })
|
|
2235
2186
|
}
|
|
2236
2187
|
)
|
|
2237
2188
|
] }),
|
|
2238
|
-
stt.listening && stt.interim && /* @__PURE__ */
|
|
2239
|
-
/* @__PURE__ */
|
|
2240
|
-
attachments !== false && /* @__PURE__ */
|
|
2241
|
-
/* @__PURE__ */
|
|
2189
|
+
stt.listening && stt.interim && /* @__PURE__ */ jsx3("div", { className: "awr-composer2__interim", children: stt.interim }),
|
|
2190
|
+
/* @__PURE__ */ jsxs("div", { className: "awr-toolbar", children: [
|
|
2191
|
+
attachments !== false && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2192
|
+
/* @__PURE__ */ jsx3(
|
|
2242
2193
|
"button",
|
|
2243
2194
|
{
|
|
2244
2195
|
type: "button",
|
|
@@ -2247,10 +2198,10 @@ var AgentComposer = ({
|
|
|
2247
2198
|
title: L.attachTitle,
|
|
2248
2199
|
onClick: () => fileRef.current?.click(),
|
|
2249
2200
|
disabled,
|
|
2250
|
-
children: /* @__PURE__ */
|
|
2201
|
+
children: /* @__PURE__ */ jsx3(PlusIcon, { size: 18 })
|
|
2251
2202
|
}
|
|
2252
2203
|
),
|
|
2253
|
-
/* @__PURE__ */
|
|
2204
|
+
/* @__PURE__ */ jsx3(
|
|
2254
2205
|
"input",
|
|
2255
2206
|
{
|
|
2256
2207
|
ref: fileRef,
|
|
@@ -2262,7 +2213,7 @@ var AgentComposer = ({
|
|
|
2262
2213
|
}
|
|
2263
2214
|
)
|
|
2264
2215
|
] }),
|
|
2265
|
-
/* @__PURE__ */
|
|
2216
|
+
/* @__PURE__ */ jsx3(
|
|
2266
2217
|
"button",
|
|
2267
2218
|
{
|
|
2268
2219
|
type: "button",
|
|
@@ -2270,30 +2221,30 @@ var AgentComposer = ({
|
|
|
2270
2221
|
"aria-label": L.commands,
|
|
2271
2222
|
title: L.commandsTitle,
|
|
2272
2223
|
onClick: () => setMenu(menu === "commands" ? void 0 : "commands"),
|
|
2273
|
-
children: /* @__PURE__ */
|
|
2224
|
+
children: /* @__PURE__ */ jsx3(SlashIcon, { size: 18 })
|
|
2274
2225
|
}
|
|
2275
2226
|
),
|
|
2276
2227
|
toolbarExtra,
|
|
2277
|
-
showTimer && elapsed !== void 0 && /* @__PURE__ */
|
|
2278
|
-
/* @__PURE__ */
|
|
2228
|
+
showTimer && elapsed !== void 0 && /* @__PURE__ */ jsxs("span", { className: "awr-tchip", title: busy ? L.timerRunning : L.timerLast, children: [
|
|
2229
|
+
/* @__PURE__ */ jsx3(ClockIcon, { size: 14 }),
|
|
2279
2230
|
" ",
|
|
2280
2231
|
formatElapsed(elapsed)
|
|
2281
2232
|
] }),
|
|
2282
|
-
showAgents && /* @__PURE__ */
|
|
2233
|
+
showAgents && /* @__PURE__ */ jsxs(
|
|
2283
2234
|
"span",
|
|
2284
2235
|
{
|
|
2285
2236
|
className: `awr-tchip awr-agents${runningAgents.length ? " is-busy" : ""}`,
|
|
2286
2237
|
title: agent.subagents.length ? agent.subagents.map((s) => `${s.name} (${s.status}): ${s.task}`).join("\n") : L.agentsTitle,
|
|
2287
2238
|
children: [
|
|
2288
|
-
/* @__PURE__ */
|
|
2289
|
-
/* @__PURE__ */
|
|
2239
|
+
/* @__PURE__ */ jsx3("span", { className: "awr-agents__dot", "aria-hidden": "true" }),
|
|
2240
|
+
/* @__PURE__ */ jsx3(BotIcon, { size: 14 }),
|
|
2290
2241
|
" ",
|
|
2291
2242
|
compactBar ? runningAgents.length : L.agents(runningAgents.length)
|
|
2292
2243
|
]
|
|
2293
2244
|
}
|
|
2294
2245
|
),
|
|
2295
|
-
(model || thinking) && /* @__PURE__ */
|
|
2296
|
-
/* @__PURE__ */
|
|
2246
|
+
(model || thinking) && /* @__PURE__ */ jsxs("span", { className: "awr-popwrap awr-popwrap--model", ref: modelRef, children: [
|
|
2247
|
+
/* @__PURE__ */ jsxs(
|
|
2297
2248
|
"button",
|
|
2298
2249
|
{
|
|
2299
2250
|
type: "button",
|
|
@@ -2303,15 +2254,15 @@ var AgentComposer = ({
|
|
|
2303
2254
|
"aria-expanded": menu === "model",
|
|
2304
2255
|
title: [model?.label, thinkingLabel].filter(Boolean).join(" \xB7 "),
|
|
2305
2256
|
children: [
|
|
2306
|
-
/* @__PURE__ */
|
|
2307
|
-
thinkingLabel && !compactBar && /* @__PURE__ */
|
|
2257
|
+
/* @__PURE__ */ jsx3("span", { className: "awr-tchip__label", children: model?.label ?? L.model }),
|
|
2258
|
+
thinkingLabel && !compactBar && /* @__PURE__ */ jsx3("span", { className: "awr-tchip__sub", children: thinkingLabel })
|
|
2308
2259
|
]
|
|
2309
2260
|
}
|
|
2310
2261
|
),
|
|
2311
|
-
menu === "model" && /* @__PURE__ */
|
|
2312
|
-
thinking && /* @__PURE__ */
|
|
2313
|
-
/* @__PURE__ */
|
|
2314
|
-
thinkingOptions.map((o) => /* @__PURE__ */
|
|
2262
|
+
menu === "model" && /* @__PURE__ */ jsxs("div", { className: "awr-menu awr-menu--pop", style: modelStyle, role: "menu", children: [
|
|
2263
|
+
thinking && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2264
|
+
/* @__PURE__ */ jsx3("div", { className: "awr-menu__head", children: L.thinking }),
|
|
2265
|
+
thinkingOptions.map((o) => /* @__PURE__ */ jsx3(
|
|
2315
2266
|
"button",
|
|
2316
2267
|
{
|
|
2317
2268
|
type: "button",
|
|
@@ -2327,9 +2278,9 @@ var AgentComposer = ({
|
|
|
2327
2278
|
o.id
|
|
2328
2279
|
))
|
|
2329
2280
|
] }),
|
|
2330
|
-
model?.options?.length ? /* @__PURE__ */
|
|
2331
|
-
/* @__PURE__ */
|
|
2332
|
-
model.options.map((o) => /* @__PURE__ */
|
|
2281
|
+
model?.options?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2282
|
+
/* @__PURE__ */ jsx3("div", { className: "awr-menu__head", children: L.model }),
|
|
2283
|
+
model.options.map((o) => /* @__PURE__ */ jsxs(
|
|
2333
2284
|
"button",
|
|
2334
2285
|
{
|
|
2335
2286
|
type: "button",
|
|
@@ -2342,7 +2293,7 @@ var AgentComposer = ({
|
|
|
2342
2293
|
},
|
|
2343
2294
|
children: [
|
|
2344
2295
|
o.label,
|
|
2345
|
-
o.group && /* @__PURE__ */
|
|
2296
|
+
o.group && /* @__PURE__ */ jsx3("span", { className: "awr-menu__group", children: o.group })
|
|
2346
2297
|
]
|
|
2347
2298
|
},
|
|
2348
2299
|
o.id
|
|
@@ -2350,10 +2301,10 @@ var AgentComposer = ({
|
|
|
2350
2301
|
] }) : null
|
|
2351
2302
|
] })
|
|
2352
2303
|
] }),
|
|
2353
|
-
/* @__PURE__ */
|
|
2304
|
+
/* @__PURE__ */ jsx3("span", { className: "awr-toolbar__spacer" }),
|
|
2354
2305
|
toolbarEnd,
|
|
2355
|
-
showApprovalMode && /* @__PURE__ */
|
|
2356
|
-
/* @__PURE__ */
|
|
2306
|
+
showApprovalMode && /* @__PURE__ */ jsxs("span", { className: "awr-popwrap", ref: modeRef, children: [
|
|
2307
|
+
/* @__PURE__ */ jsxs(
|
|
2357
2308
|
"button",
|
|
2358
2309
|
{
|
|
2359
2310
|
type: "button",
|
|
@@ -2364,14 +2315,14 @@ var AgentComposer = ({
|
|
|
2364
2315
|
"aria-expanded": menu === "mode",
|
|
2365
2316
|
"aria-label": `${L.toolConsent}: ${MODE_CHIP[agent.approvalMode].label}`,
|
|
2366
2317
|
children: [
|
|
2367
|
-
/* @__PURE__ */
|
|
2318
|
+
/* @__PURE__ */ jsx3(ModeIcon, { mode: agent.approvalMode }),
|
|
2368
2319
|
!compactBar && ` ${MODE_CHIP[agent.approvalMode].label}`
|
|
2369
2320
|
]
|
|
2370
2321
|
}
|
|
2371
2322
|
),
|
|
2372
|
-
menu === "mode" && /* @__PURE__ */
|
|
2373
|
-
/* @__PURE__ */
|
|
2374
|
-
MODES.map((m) => /* @__PURE__ */
|
|
2323
|
+
menu === "mode" && /* @__PURE__ */ jsxs("div", { className: "awr-menu awr-menu--pop", style: modeStyle, role: "menu", children: [
|
|
2324
|
+
/* @__PURE__ */ jsx3("div", { className: "awr-menu__head", children: L.toolConsent }),
|
|
2325
|
+
MODES.map((m) => /* @__PURE__ */ jsxs(
|
|
2375
2326
|
"button",
|
|
2376
2327
|
{
|
|
2377
2328
|
type: "button",
|
|
@@ -2383,27 +2334,27 @@ var AgentComposer = ({
|
|
|
2383
2334
|
setMenu(void 0);
|
|
2384
2335
|
},
|
|
2385
2336
|
children: [
|
|
2386
|
-
/* @__PURE__ */
|
|
2337
|
+
/* @__PURE__ */ jsx3(ModeIcon, { mode: m }),
|
|
2387
2338
|
" ",
|
|
2388
2339
|
MODE_CHIP[m].label,
|
|
2389
|
-
/* @__PURE__ */
|
|
2340
|
+
/* @__PURE__ */ jsx3("span", { className: "awr-menu__desc", children: MODE_CHIP[m].hint })
|
|
2390
2341
|
]
|
|
2391
2342
|
},
|
|
2392
2343
|
m
|
|
2393
2344
|
))
|
|
2394
2345
|
] })
|
|
2395
2346
|
] }),
|
|
2396
|
-
canSteer && /* @__PURE__ */
|
|
2397
|
-
busy ? /* @__PURE__ */
|
|
2347
|
+
canSteer && /* @__PURE__ */ jsx3("button", { type: "button", className: "awr-sendbtn", onClick: submit, "aria-label": L.steer, children: /* @__PURE__ */ jsx3(SendIcon, { size: 16 }) }),
|
|
2348
|
+
busy ? /* @__PURE__ */ jsx3(
|
|
2398
2349
|
"button",
|
|
2399
2350
|
{
|
|
2400
2351
|
type: "button",
|
|
2401
2352
|
className: "awr-sendbtn awr-sendbtn--stop",
|
|
2402
2353
|
onClick: agent.stop,
|
|
2403
2354
|
"aria-label": L.stop,
|
|
2404
|
-
children: /* @__PURE__ */
|
|
2355
|
+
children: /* @__PURE__ */ jsx3(StopIcon, { size: 16 })
|
|
2405
2356
|
}
|
|
2406
|
-
) : /* @__PURE__ */
|
|
2357
|
+
) : /* @__PURE__ */ jsx3(
|
|
2407
2358
|
"button",
|
|
2408
2359
|
{
|
|
2409
2360
|
type: "button",
|
|
@@ -2411,7 +2362,7 @@ var AgentComposer = ({
|
|
|
2411
2362
|
onClick: submit,
|
|
2412
2363
|
disabled: !canSend,
|
|
2413
2364
|
"aria-label": L.send,
|
|
2414
|
-
children: agent.status === "initializing" ? /* @__PURE__ */
|
|
2365
|
+
children: agent.status === "initializing" ? /* @__PURE__ */ jsx3(SpinnerIcon, { size: 16 }) : /* @__PURE__ */ jsx3(SendIcon, { size: 16 })
|
|
2415
2366
|
}
|
|
2416
2367
|
)
|
|
2417
2368
|
] })
|
|
@@ -2422,7 +2373,7 @@ var AgentComposer = ({
|
|
|
2422
2373
|
|
|
2423
2374
|
// src/components/ChatHistoryList.tsx
|
|
2424
2375
|
import { Fragment as Fragment2 } from "react";
|
|
2425
|
-
import { jsx as
|
|
2376
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2426
2377
|
var defaultTime = (ms) => {
|
|
2427
2378
|
const d = new Date(ms);
|
|
2428
2379
|
const today = (/* @__PURE__ */ new Date()).toDateString() === d.toDateString();
|
|
@@ -2438,10 +2389,10 @@ var ChatHistoryList = ({
|
|
|
2438
2389
|
className
|
|
2439
2390
|
}) => {
|
|
2440
2391
|
const L = useLabels(labels);
|
|
2441
|
-
return /* @__PURE__ */
|
|
2442
|
-
/* @__PURE__ */
|
|
2443
|
-
/* @__PURE__ */
|
|
2444
|
-
/* @__PURE__ */
|
|
2392
|
+
return /* @__PURE__ */ jsxs2("div", { className: ["awr-history", className].filter(Boolean).join(" "), children: [
|
|
2393
|
+
/* @__PURE__ */ jsxs2("div", { className: "awr-panel__head", children: [
|
|
2394
|
+
/* @__PURE__ */ jsx4("span", { className: "awr-panel__title", children: title ?? L.history }),
|
|
2395
|
+
/* @__PURE__ */ jsxs2(
|
|
2445
2396
|
"button",
|
|
2446
2397
|
{
|
|
2447
2398
|
type: "button",
|
|
@@ -2449,18 +2400,18 @@ var ChatHistoryList = ({
|
|
|
2449
2400
|
onClick: history.newChat,
|
|
2450
2401
|
disabled,
|
|
2451
2402
|
children: [
|
|
2452
|
-
/* @__PURE__ */
|
|
2403
|
+
/* @__PURE__ */ jsx4(PlusIcon, { size: 14 }),
|
|
2453
2404
|
" ",
|
|
2454
2405
|
L.newChat
|
|
2455
2406
|
]
|
|
2456
2407
|
}
|
|
2457
2408
|
)
|
|
2458
2409
|
] }),
|
|
2459
|
-
!history.loading && history.chats.length === 0 && /* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2410
|
+
!history.loading && history.chats.length === 0 && /* @__PURE__ */ jsx4("div", { className: "awr-panel__empty", children: L.historyEmpty }),
|
|
2411
|
+
/* @__PURE__ */ jsx4("ul", { className: "awr-history__list", children: history.chats.map((c) => {
|
|
2461
2412
|
const active = c.id === history.currentId;
|
|
2462
|
-
const row = /* @__PURE__ */
|
|
2463
|
-
/* @__PURE__ */
|
|
2413
|
+
const row = /* @__PURE__ */ jsxs2("li", { className: `awr-history__item${active ? " is-active" : ""}`, children: [
|
|
2414
|
+
/* @__PURE__ */ jsxs2(
|
|
2464
2415
|
"button",
|
|
2465
2416
|
{
|
|
2466
2417
|
type: "button",
|
|
@@ -2469,8 +2420,8 @@ var ChatHistoryList = ({
|
|
|
2469
2420
|
disabled: disabled || active,
|
|
2470
2421
|
"aria-current": active ? "true" : void 0,
|
|
2471
2422
|
children: [
|
|
2472
|
-
/* @__PURE__ */
|
|
2473
|
-
/* @__PURE__ */
|
|
2423
|
+
/* @__PURE__ */ jsx4("span", { className: "awr-history__title", children: c.title }),
|
|
2424
|
+
/* @__PURE__ */ jsxs2("span", { className: "awr-history__meta", children: [
|
|
2474
2425
|
formatTime(c.updatedAt),
|
|
2475
2426
|
" \xB7 ",
|
|
2476
2427
|
L.messagesCount(c.messageCount)
|
|
@@ -2478,7 +2429,7 @@ var ChatHistoryList = ({
|
|
|
2478
2429
|
]
|
|
2479
2430
|
}
|
|
2480
2431
|
),
|
|
2481
|
-
/* @__PURE__ */
|
|
2432
|
+
/* @__PURE__ */ jsx4(
|
|
2482
2433
|
"button",
|
|
2483
2434
|
{
|
|
2484
2435
|
type: "button",
|
|
@@ -2487,57 +2438,17 @@ var ChatHistoryList = ({
|
|
|
2487
2438
|
title: L.deleteChat,
|
|
2488
2439
|
onClick: () => void history.remove(c.id),
|
|
2489
2440
|
disabled,
|
|
2490
|
-
children: /* @__PURE__ */
|
|
2441
|
+
children: /* @__PURE__ */ jsx4(XIcon, { size: 14 })
|
|
2491
2442
|
}
|
|
2492
2443
|
)
|
|
2493
2444
|
] }, c.id);
|
|
2494
|
-
return renderChat ? /* @__PURE__ */
|
|
2445
|
+
return renderChat ? /* @__PURE__ */ jsx4(Fragment2, { children: renderChat(c, active, row) }, c.id) : row;
|
|
2495
2446
|
}) })
|
|
2496
2447
|
] });
|
|
2497
2448
|
};
|
|
2498
2449
|
|
|
2499
|
-
// src/components/format.ts
|
|
2500
|
-
var previewValue = (value, max = 140) => {
|
|
2501
|
-
if (value === void 0) return "";
|
|
2502
|
-
let text;
|
|
2503
|
-
if (typeof value === "string") text = value;
|
|
2504
|
-
else {
|
|
2505
|
-
try {
|
|
2506
|
-
text = JSON.stringify(value);
|
|
2507
|
-
} catch {
|
|
2508
|
-
text = String(value);
|
|
2509
|
-
}
|
|
2510
|
-
}
|
|
2511
|
-
text = text.replace(/\s+/g, " ").trim();
|
|
2512
|
-
return text.length > max ? `${text.slice(0, max - 1)}\u2026` : text;
|
|
2513
|
-
};
|
|
2514
|
-
var formatTokens = (n) => n >= 1e3 ? `${(n / 1e3).toFixed(n >= 1e4 ? 0 : 1)}k` : String(n);
|
|
2515
|
-
var formatDuration = (ms) => {
|
|
2516
|
-
if (ms < 1e3) return `${Math.round(ms)} ms`;
|
|
2517
|
-
if (ms < 6e4) return `${(ms / 1e3).toFixed(ms < 1e4 ? 1 : 0)} s`;
|
|
2518
|
-
const s = Math.round(ms / 1e3);
|
|
2519
|
-
return `${Math.floor(s / 60)}m ${s % 60}s`;
|
|
2520
|
-
};
|
|
2521
|
-
var isDataImage = (v) => typeof v === "string" && /^data:image\/[\w.+-]+;base64,/.test(v);
|
|
2522
|
-
var imagesInOutput = (output, depth = 0) => {
|
|
2523
|
-
if (depth > 2 || output == null) return [];
|
|
2524
|
-
if (isDataImage(output)) return [output];
|
|
2525
|
-
if (Array.isArray(output)) return output.flatMap((v) => imagesInOutput(v, depth + 1));
|
|
2526
|
-
if (typeof output === "object") {
|
|
2527
|
-
const o = output;
|
|
2528
|
-
if (o.type === "image" && typeof o.data === "string") {
|
|
2529
|
-
const mime = typeof o.mimeType === "string" ? o.mimeType : "image/png";
|
|
2530
|
-
return [o.data.startsWith("data:") ? o.data : `data:${mime};base64,${o.data}`];
|
|
2531
|
-
}
|
|
2532
|
-
for (const key of ["dataUrl", "url", "image"])
|
|
2533
|
-
if (isDataImage(o[key])) return [o[key]];
|
|
2534
|
-
if (depth < 2) return Object.values(o).flatMap((v) => imagesInOutput(v, depth + 1));
|
|
2535
|
-
}
|
|
2536
|
-
return [];
|
|
2537
|
-
};
|
|
2538
|
-
|
|
2539
2450
|
// src/components/ContextMeter.tsx
|
|
2540
|
-
import { jsx as
|
|
2451
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2541
2452
|
var ContextMeter = ({
|
|
2542
2453
|
usage,
|
|
2543
2454
|
budgetTokens,
|
|
@@ -2555,26 +2466,26 @@ var ContextMeter = ({
|
|
|
2555
2466
|
const hitRate = usage.inputTokens > 0 ? Math.round(cached / usage.inputTokens * 100) : 0;
|
|
2556
2467
|
const fill = budgetTokens ? Math.min(1, usage.totalTokens / budgetTokens) : void 0;
|
|
2557
2468
|
const last = compactions.at(-1);
|
|
2558
|
-
return /* @__PURE__ */
|
|
2559
|
-
/* @__PURE__ */
|
|
2560
|
-
/* @__PURE__ */
|
|
2469
|
+
return /* @__PURE__ */ jsxs3("div", { className: ["awr-context", className].filter(Boolean).join(" "), children: [
|
|
2470
|
+
/* @__PURE__ */ jsxs3("div", { className: "awr-context__row", children: [
|
|
2471
|
+
/* @__PURE__ */ jsxs3("span", { title: "input tokens", children: [
|
|
2561
2472
|
"in ",
|
|
2562
2473
|
formatTokens(usage.inputTokens)
|
|
2563
2474
|
] }),
|
|
2564
|
-
/* @__PURE__ */
|
|
2475
|
+
/* @__PURE__ */ jsxs3("span", { title: "output tokens", children: [
|
|
2565
2476
|
"out ",
|
|
2566
2477
|
formatTokens(usage.outputTokens)
|
|
2567
2478
|
] }),
|
|
2568
|
-
reasoning > 0 && /* @__PURE__ */
|
|
2479
|
+
reasoning > 0 && /* @__PURE__ */ jsxs3("span", { title: "thinking tokens", children: [
|
|
2569
2480
|
"think ",
|
|
2570
2481
|
formatTokens(reasoning)
|
|
2571
2482
|
] }),
|
|
2572
|
-
/* @__PURE__ */
|
|
2483
|
+
/* @__PURE__ */ jsxs3("span", { title: "input tokens served from the provider's prompt cache", children: [
|
|
2573
2484
|
"cached ",
|
|
2574
2485
|
formatTokens(cached),
|
|
2575
2486
|
hitRate > 0 ? ` (${hitRate}%)` : ""
|
|
2576
2487
|
] }),
|
|
2577
|
-
onCompact && /* @__PURE__ */
|
|
2488
|
+
onCompact && /* @__PURE__ */ jsx5(
|
|
2578
2489
|
"button",
|
|
2579
2490
|
{
|
|
2580
2491
|
type: "button",
|
|
@@ -2585,15 +2496,15 @@ var ContextMeter = ({
|
|
|
2585
2496
|
}
|
|
2586
2497
|
)
|
|
2587
2498
|
] }),
|
|
2588
|
-
fill !== void 0 && /* @__PURE__ */
|
|
2499
|
+
fill !== void 0 && /* @__PURE__ */ jsx5(
|
|
2589
2500
|
"div",
|
|
2590
2501
|
{
|
|
2591
2502
|
className: `awr-context__track${fill >= 1 ? " is-full" : ""}`,
|
|
2592
2503
|
title: `${usage.totalTokens} / ${budgetTokens} tokens`,
|
|
2593
|
-
children: /* @__PURE__ */
|
|
2504
|
+
children: /* @__PURE__ */ jsx5("div", { className: "awr-context__fill", style: { width: `${fill * 100}%` } })
|
|
2594
2505
|
}
|
|
2595
2506
|
),
|
|
2596
|
-
budget && /* @__PURE__ */
|
|
2507
|
+
budget && /* @__PURE__ */ jsxs3("div", { className: "awr-context__note awr-context__note--warn", children: [
|
|
2597
2508
|
budget.kind === "tool-calls" ? "Tool-call" : `${budget.kind} token`,
|
|
2598
2509
|
" limit reached (",
|
|
2599
2510
|
budget.tokens,
|
|
@@ -2601,7 +2512,7 @@ var ContextMeter = ({
|
|
|
2601
2512
|
budget.cap,
|
|
2602
2513
|
") \u2014 the agent stopped early."
|
|
2603
2514
|
] }),
|
|
2604
|
-
last && /* @__PURE__ */
|
|
2515
|
+
last && /* @__PURE__ */ jsxs3("div", { className: "awr-context__note", children: [
|
|
2605
2516
|
"Compacted ",
|
|
2606
2517
|
last.scope,
|
|
2607
2518
|
": ",
|
|
@@ -2616,7 +2527,7 @@ var ContextMeter = ({
|
|
|
2616
2527
|
|
|
2617
2528
|
// src/components/FilesPanel.tsx
|
|
2618
2529
|
import { Fragment as Fragment3, useEffect as useEffect6, useRef as useRef6, useState as useState8 } from "react";
|
|
2619
|
-
import { Fragment as Fragment4, jsx as
|
|
2530
|
+
import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2620
2531
|
var PREVIEW_CHARS = 2e4;
|
|
2621
2532
|
var FilesPanel = ({
|
|
2622
2533
|
files: vfs,
|
|
@@ -2657,11 +2568,11 @@ var FilesPanel = ({
|
|
|
2657
2568
|
a.download = f.path.split("/").pop() || "file";
|
|
2658
2569
|
a.click();
|
|
2659
2570
|
};
|
|
2660
|
-
return /* @__PURE__ */
|
|
2661
|
-
/* @__PURE__ */
|
|
2662
|
-
/* @__PURE__ */
|
|
2663
|
-
allowUpload && /* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsxs4("div", { className: ["awr-filespanel", className].filter(Boolean).join(" "), children: [
|
|
2572
|
+
/* @__PURE__ */ jsxs4("div", { className: "awr-panel__head", children: [
|
|
2573
|
+
/* @__PURE__ */ jsx6("span", { className: "awr-panel__title", children: title ?? L.files }),
|
|
2574
|
+
allowUpload && /* @__PURE__ */ jsxs4(Fragment4, { children: [
|
|
2575
|
+
/* @__PURE__ */ jsx6(
|
|
2665
2576
|
"button",
|
|
2666
2577
|
{
|
|
2667
2578
|
type: "button",
|
|
@@ -2669,10 +2580,10 @@ var FilesPanel = ({
|
|
|
2669
2580
|
"aria-label": L.upload,
|
|
2670
2581
|
title: L.upload,
|
|
2671
2582
|
onClick: () => inputRef.current?.click(),
|
|
2672
|
-
children: /* @__PURE__ */
|
|
2583
|
+
children: /* @__PURE__ */ jsx6(PlusIcon, { size: 16 })
|
|
2673
2584
|
}
|
|
2674
2585
|
),
|
|
2675
|
-
/* @__PURE__ */
|
|
2586
|
+
/* @__PURE__ */ jsx6(
|
|
2676
2587
|
"input",
|
|
2677
2588
|
{
|
|
2678
2589
|
ref: inputRef,
|
|
@@ -2687,15 +2598,15 @@ var FilesPanel = ({
|
|
|
2687
2598
|
)
|
|
2688
2599
|
] })
|
|
2689
2600
|
] }),
|
|
2690
|
-
fs.error && /* @__PURE__ */
|
|
2691
|
-
!fs.loading && fs.files.length === 0 && /* @__PURE__ */
|
|
2692
|
-
/* @__PURE__ */
|
|
2693
|
-
const row = /* @__PURE__ */
|
|
2601
|
+
fs.error && /* @__PURE__ */ jsx6("div", { className: "awr-notice awr-notice--warn", children: fs.error }),
|
|
2602
|
+
!fs.loading && fs.files.length === 0 && /* @__PURE__ */ jsx6("div", { className: "awr-panel__empty", children: L.filesEmpty }),
|
|
2603
|
+
/* @__PURE__ */ jsx6("ul", { className: "awr-filelist", children: fs.files.map((f) => {
|
|
2604
|
+
const row = /* @__PURE__ */ jsxs4(
|
|
2694
2605
|
"li",
|
|
2695
2606
|
{
|
|
2696
2607
|
className: `awr-filelist__item${preview?.path === f.path ? " is-active" : ""}`,
|
|
2697
2608
|
children: [
|
|
2698
|
-
/* @__PURE__ */
|
|
2609
|
+
/* @__PURE__ */ jsxs4(
|
|
2699
2610
|
"button",
|
|
2700
2611
|
{
|
|
2701
2612
|
type: "button",
|
|
@@ -2703,13 +2614,13 @@ var FilesPanel = ({
|
|
|
2703
2614
|
onClick: () => void open(f),
|
|
2704
2615
|
title: `${L.preview}: ${f.path}`,
|
|
2705
2616
|
children: [
|
|
2706
|
-
/* @__PURE__ */
|
|
2707
|
-
/* @__PURE__ */
|
|
2708
|
-
/* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ jsx6(FileIcon, { size: 14 }),
|
|
2618
|
+
/* @__PURE__ */ jsx6("span", { className: "awr-filelist__path", children: f.path }),
|
|
2619
|
+
/* @__PURE__ */ jsx6("span", { className: "awr-filelist__size", children: L.bytes(f.size) })
|
|
2709
2620
|
]
|
|
2710
2621
|
}
|
|
2711
2622
|
),
|
|
2712
|
-
/* @__PURE__ */
|
|
2623
|
+
/* @__PURE__ */ jsx6(
|
|
2713
2624
|
"button",
|
|
2714
2625
|
{
|
|
2715
2626
|
type: "button",
|
|
@@ -2717,10 +2628,10 @@ var FilesPanel = ({
|
|
|
2717
2628
|
"aria-label": `${L.download} ${f.path}`,
|
|
2718
2629
|
title: L.download,
|
|
2719
2630
|
onClick: () => void download(f),
|
|
2720
|
-
children: /* @__PURE__ */
|
|
2631
|
+
children: /* @__PURE__ */ jsx6(DownloadIcon, { size: 14 })
|
|
2721
2632
|
}
|
|
2722
2633
|
),
|
|
2723
|
-
allowDelete && /* @__PURE__ */
|
|
2634
|
+
allowDelete && /* @__PURE__ */ jsx6(
|
|
2724
2635
|
"button",
|
|
2725
2636
|
{
|
|
2726
2637
|
type: "button",
|
|
@@ -2728,23 +2639,23 @@ var FilesPanel = ({
|
|
|
2728
2639
|
"aria-label": `${L.delete} ${f.path}`,
|
|
2729
2640
|
title: L.delete,
|
|
2730
2641
|
onClick: () => void fs.remove(f.path),
|
|
2731
|
-
children: /* @__PURE__ */
|
|
2642
|
+
children: /* @__PURE__ */ jsx6(XIcon, { size: 14 })
|
|
2732
2643
|
}
|
|
2733
2644
|
)
|
|
2734
2645
|
]
|
|
2735
2646
|
},
|
|
2736
2647
|
f.path
|
|
2737
2648
|
);
|
|
2738
|
-
return renderFile ? /* @__PURE__ */
|
|
2649
|
+
return renderFile ? /* @__PURE__ */ jsx6(Fragment3, { children: renderFile(f, row) }, f.path) : row;
|
|
2739
2650
|
}) }),
|
|
2740
|
-
preview && /* @__PURE__ */
|
|
2651
|
+
preview && /* @__PURE__ */ jsx6("div", { className: "awr-filepreview", children: preview.kind === "image" ? /* @__PURE__ */ jsx6("img", { src: preview.src, alt: preview.path }) : /* @__PURE__ */ jsx6("pre", { children: preview.text.length > PREVIEW_CHARS ? `${preview.text.slice(0, PREVIEW_CHARS)}
|
|
2741
2652
|
\u2026` : preview.text }) })
|
|
2742
2653
|
] });
|
|
2743
2654
|
};
|
|
2744
2655
|
|
|
2745
2656
|
// src/components/StepList.tsx
|
|
2746
2657
|
import { Fragment as Fragment5 } from "react";
|
|
2747
|
-
import { jsx as
|
|
2658
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2748
2659
|
var ToolCallRow = ({ call, showUsage = true, labels }) => {
|
|
2749
2660
|
const L = useLabels(labels);
|
|
2750
2661
|
const state = call.status === "calling" ? "calling" : call.ok === false ? "failed" : "ok";
|
|
@@ -2754,16 +2665,16 @@ var ToolCallRow = ({ call, showUsage = true, labels }) => {
|
|
|
2754
2665
|
call.outputTokens ? `\u2248${formatTokens(call.outputTokens)} out` : "",
|
|
2755
2666
|
call.durationMs !== void 0 ? formatDuration(call.durationMs) : ""
|
|
2756
2667
|
].filter(Boolean).join(" \xB7 ");
|
|
2757
|
-
return /* @__PURE__ */
|
|
2758
|
-
/* @__PURE__ */
|
|
2759
|
-
/* @__PURE__ */
|
|
2760
|
-
/* @__PURE__ */
|
|
2761
|
-
previewValue(call.input) && /* @__PURE__ */
|
|
2762
|
-
call.status === "calling" && /* @__PURE__ */
|
|
2763
|
-
call.status === "done" && call.ok === false && /* @__PURE__ */
|
|
2764
|
-
showUsage && cost && /* @__PURE__ */
|
|
2668
|
+
return /* @__PURE__ */ jsxs5("li", { className: `awr-tool awr-tool--${state}`, children: [
|
|
2669
|
+
/* @__PURE__ */ jsxs5("div", { className: "awr-tool__row", children: [
|
|
2670
|
+
/* @__PURE__ */ jsx7(ToolIcon, { size: 13, className: "awr-tool__icon" }),
|
|
2671
|
+
/* @__PURE__ */ jsx7("code", { className: "awr-tool__name", children: call.name }),
|
|
2672
|
+
previewValue(call.input) && /* @__PURE__ */ jsx7("span", { className: "awr-tool__args", children: previewValue(call.input) }),
|
|
2673
|
+
call.status === "calling" && /* @__PURE__ */ jsx7(SpinnerIcon, { size: 12, className: "awr-tool__spin" }),
|
|
2674
|
+
call.status === "done" && call.ok === false && /* @__PURE__ */ jsx7("span", { className: "awr-tool__badge", children: L.failed }),
|
|
2675
|
+
showUsage && cost && /* @__PURE__ */ jsx7("span", { className: "awr-tool__cost", title: L.toolCostTitle, children: cost })
|
|
2765
2676
|
] }),
|
|
2766
|
-
images.length > 0 && /* @__PURE__ */
|
|
2677
|
+
images.length > 0 && /* @__PURE__ */ jsx7("div", { className: "awr-tool__images", children: images.map((src, i) => /* @__PURE__ */ jsx7("a", { href: src, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ jsx7("img", { className: "awr-thumb", src, alt: `${call.name} result ${i + 1}` }) }, i)) })
|
|
2767
2678
|
] });
|
|
2768
2679
|
};
|
|
2769
2680
|
var SubagentRow = ({
|
|
@@ -2772,14 +2683,14 @@ var SubagentRow = ({
|
|
|
2772
2683
|
labels
|
|
2773
2684
|
}) => {
|
|
2774
2685
|
const L = useLabels(labels);
|
|
2775
|
-
return /* @__PURE__ */
|
|
2776
|
-
/* @__PURE__ */
|
|
2777
|
-
/* @__PURE__ */
|
|
2778
|
-
/* @__PURE__ */
|
|
2779
|
-
sub.profile && /* @__PURE__ */
|
|
2780
|
-
/* @__PURE__ */
|
|
2781
|
-
sub.status === "running" && /* @__PURE__ */
|
|
2782
|
-
sub.status === "running" && onStop && /* @__PURE__ */
|
|
2686
|
+
return /* @__PURE__ */ jsxs5("li", { className: `awr-subagent awr-subagent--${sub.status}`, children: [
|
|
2687
|
+
/* @__PURE__ */ jsxs5("div", { className: "awr-subagent__head", children: [
|
|
2688
|
+
/* @__PURE__ */ jsx7(BotIcon, { size: 13, className: "awr-subagent__icon" }),
|
|
2689
|
+
/* @__PURE__ */ jsx7("span", { className: "awr-subagent__name", children: sub.name }),
|
|
2690
|
+
sub.profile && /* @__PURE__ */ jsx7("span", { className: "awr-subagent__profile", children: sub.profile }),
|
|
2691
|
+
/* @__PURE__ */ jsx7("span", { className: "awr-subagent__task", title: sub.task, children: previewValue(sub.task, 90) }),
|
|
2692
|
+
sub.status === "running" && /* @__PURE__ */ jsx7(SpinnerIcon, { size: 12, className: "awr-tool__spin" }),
|
|
2693
|
+
sub.status === "running" && onStop && /* @__PURE__ */ jsx7(
|
|
2783
2694
|
"button",
|
|
2784
2695
|
{
|
|
2785
2696
|
type: "button",
|
|
@@ -2787,11 +2698,11 @@ var SubagentRow = ({
|
|
|
2787
2698
|
"aria-label": L.stopSubagent,
|
|
2788
2699
|
title: L.stopSubagent,
|
|
2789
2700
|
onClick: () => onStop(sub.id),
|
|
2790
|
-
children: /* @__PURE__ */
|
|
2701
|
+
children: /* @__PURE__ */ jsx7(StopIcon, { size: 12 })
|
|
2791
2702
|
}
|
|
2792
2703
|
)
|
|
2793
2704
|
] }),
|
|
2794
|
-
/* @__PURE__ */
|
|
2705
|
+
/* @__PURE__ */ jsx7("div", { className: "awr-subagent__activity", children: sub.status === "error" ? sub.error : sub.status === "stopped" ? L.subagentStopped : sub.status === "done" ? previewValue(sub.text, 160) : `${sub.activity}${sub.toolCalls ? ` \xB7 ${L.toolCalls(sub.toolCalls)}` : ""}` })
|
|
2795
2706
|
] });
|
|
2796
2707
|
};
|
|
2797
2708
|
var UserNoteRow = ({
|
|
@@ -2799,10 +2710,10 @@ var UserNoteRow = ({
|
|
|
2799
2710
|
labels
|
|
2800
2711
|
}) => {
|
|
2801
2712
|
const L = useLabels(labels);
|
|
2802
|
-
return /* @__PURE__ */
|
|
2803
|
-
/* @__PURE__ */
|
|
2804
|
-
/* @__PURE__ */
|
|
2805
|
-
/* @__PURE__ */
|
|
2713
|
+
return /* @__PURE__ */ jsxs5("li", { className: `awr-note awr-note--${note.at}`, children: [
|
|
2714
|
+
/* @__PURE__ */ jsx7(SendIcon, { size: 12, className: "awr-note__icon" }),
|
|
2715
|
+
/* @__PURE__ */ jsx7("span", { className: "awr-note__where", children: L.noteAt[note.at] }),
|
|
2716
|
+
/* @__PURE__ */ jsx7("q", { className: "awr-note__text", children: note.text })
|
|
2806
2717
|
] });
|
|
2807
2718
|
};
|
|
2808
2719
|
var decisionLabel = (a, L) => a.status === "pending" ? L.consentWaiting : a.status === "approved" ? L.consentAllowed : L.consentDenied(a.reason);
|
|
@@ -2817,37 +2728,37 @@ var StepItem = ({
|
|
|
2817
2728
|
showThoughts,
|
|
2818
2729
|
renderToolCall,
|
|
2819
2730
|
L
|
|
2820
|
-
}) => /* @__PURE__ */
|
|
2821
|
-
/* @__PURE__ */
|
|
2822
|
-
/* @__PURE__ */
|
|
2823
|
-
/* @__PURE__ */
|
|
2731
|
+
}) => /* @__PURE__ */ jsxs5("li", { className: `awr-step awr-step--${step.blocked ? "blocked" : step.status}`, children: [
|
|
2732
|
+
/* @__PURE__ */ jsxs5("div", { className: "awr-step__head", children: [
|
|
2733
|
+
/* @__PURE__ */ jsx7("span", { className: "awr-step__marker", children: step.status === "running" ? /* @__PURE__ */ jsx7(SpinnerIcon, { size: 14 }) : step.blocked ? /* @__PURE__ */ jsx7(AlertIcon, { size: 14 }) : /* @__PURE__ */ jsx7(CheckIcon, { size: 14 }) }),
|
|
2734
|
+
/* @__PURE__ */ jsxs5("span", { className: "awr-step__index", children: [
|
|
2824
2735
|
step.index,
|
|
2825
2736
|
"/",
|
|
2826
2737
|
step.total
|
|
2827
2738
|
] }),
|
|
2828
|
-
/* @__PURE__ */
|
|
2739
|
+
/* @__PURE__ */ jsx7("span", { className: "awr-step__desc", children: step.step.description })
|
|
2829
2740
|
] }),
|
|
2830
|
-
showThoughts && step.reasoning.trim() && /* @__PURE__ */
|
|
2831
|
-
/* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2741
|
+
showThoughts && step.reasoning.trim() && /* @__PURE__ */ jsxs5("details", { className: "awr-thought", open: step.status === "running" && !step.text, children: [
|
|
2742
|
+
/* @__PURE__ */ jsxs5("summary", { children: [
|
|
2743
|
+
/* @__PURE__ */ jsx7(BrainIcon, { size: 13 }),
|
|
2833
2744
|
" ",
|
|
2834
2745
|
L.stepThoughts
|
|
2835
2746
|
] }),
|
|
2836
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ jsx7("p", { className: "awr-thought__text", children: step.reasoning.trim() })
|
|
2837
2748
|
] }),
|
|
2838
|
-
step.text.trim() && /* @__PURE__ */
|
|
2839
|
-
showToolCalls && step.toolCalls.length > 0 && /* @__PURE__ */
|
|
2840
|
-
const row = /* @__PURE__ */
|
|
2841
|
-
return renderToolCall ? /* @__PURE__ */
|
|
2749
|
+
step.text.trim() && /* @__PURE__ */ jsx7("p", { className: "awr-step__text", children: step.text.trim() }),
|
|
2750
|
+
showToolCalls && step.toolCalls.length > 0 && /* @__PURE__ */ jsx7("ul", { className: "awr-step__tools", children: step.toolCalls.map((call, i) => {
|
|
2751
|
+
const row = /* @__PURE__ */ jsx7(ToolCallRow, { call, showUsage }, i);
|
|
2752
|
+
return renderToolCall ? /* @__PURE__ */ jsx7(Fragment5, { children: renderToolCall(call, row) }, i) : row;
|
|
2842
2753
|
}) }),
|
|
2843
|
-
approvals.length > 0 && /* @__PURE__ */
|
|
2844
|
-
/* @__PURE__ */
|
|
2845
|
-
/* @__PURE__ */
|
|
2846
|
-
/* @__PURE__ */
|
|
2754
|
+
approvals.length > 0 && /* @__PURE__ */ jsx7("ul", { className: "awr-step__tools", children: approvals.map((a) => /* @__PURE__ */ jsxs5("li", { className: `awr-tool awr-tool__row awr-tool--approval-${a.status}`, children: [
|
|
2755
|
+
/* @__PURE__ */ jsx7(ShieldIcon, { size: 13, className: "awr-tool__icon" }),
|
|
2756
|
+
/* @__PURE__ */ jsx7("code", { className: "awr-tool__name", children: a.name }),
|
|
2757
|
+
/* @__PURE__ */ jsx7("span", { className: "awr-tool__args", children: decisionLabel(a, L) })
|
|
2847
2758
|
] }, a.id)) }),
|
|
2848
|
-
subagents.length > 0 && /* @__PURE__ */
|
|
2849
|
-
notes.length > 0 && /* @__PURE__ */
|
|
2850
|
-
step.blocked && step.summary && /* @__PURE__ */
|
|
2759
|
+
subagents.length > 0 && /* @__PURE__ */ jsx7("ul", { className: "awr-subagents", children: subagents.map((sub) => /* @__PURE__ */ jsx7(SubagentRow, { sub, onStop: onStopSubagent }, sub.id)) }),
|
|
2760
|
+
notes.length > 0 && /* @__PURE__ */ jsx7("ul", { className: "awr-notes", children: notes.map((n) => /* @__PURE__ */ jsx7(UserNoteRow, { note: n }, n.id)) }),
|
|
2761
|
+
step.blocked && step.summary && /* @__PURE__ */ jsx7("p", { className: "awr-step__blocked", children: step.summary })
|
|
2851
2762
|
] });
|
|
2852
2763
|
var StepList = ({
|
|
2853
2764
|
steps,
|
|
@@ -2867,8 +2778,8 @@ var StepList = ({
|
|
|
2867
2778
|
if (steps.length === 0) return null;
|
|
2868
2779
|
const known = new Set(steps.map((s) => s.id));
|
|
2869
2780
|
const atEnd = showNotes ? notes.filter((n) => !n.stepId || !known.has(n.stepId)) : [];
|
|
2870
|
-
return /* @__PURE__ */
|
|
2871
|
-
steps.map((step) => /* @__PURE__ */
|
|
2781
|
+
return /* @__PURE__ */ jsxs5("ol", { className: ["awr-steps", className].filter(Boolean).join(" "), children: [
|
|
2782
|
+
steps.map((step) => /* @__PURE__ */ jsx7(
|
|
2872
2783
|
StepItem,
|
|
2873
2784
|
{
|
|
2874
2785
|
step,
|
|
@@ -2884,12 +2795,12 @@ var StepList = ({
|
|
|
2884
2795
|
},
|
|
2885
2796
|
step.id
|
|
2886
2797
|
)),
|
|
2887
|
-
atEnd.length > 0 && /* @__PURE__ */
|
|
2798
|
+
atEnd.length > 0 && /* @__PURE__ */ jsx7("li", { className: "awr-step awr-step--notes", children: /* @__PURE__ */ jsx7("ul", { className: "awr-notes", children: atEnd.map((n) => /* @__PURE__ */ jsx7(UserNoteRow, { note: n }, n.id)) }) })
|
|
2888
2799
|
] });
|
|
2889
2800
|
};
|
|
2890
2801
|
|
|
2891
2802
|
// src/components/MessageList.tsx
|
|
2892
|
-
import { jsx as
|
|
2803
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2893
2804
|
var usageLine = (usage, durationMs) => {
|
|
2894
2805
|
const parts = [];
|
|
2895
2806
|
if (usage && usage.totalTokens > 0) {
|
|
@@ -2900,8 +2811,8 @@ var usageLine = (usage, durationMs) => {
|
|
|
2900
2811
|
if (durationMs !== void 0) parts.push(formatDuration(durationMs));
|
|
2901
2812
|
return parts.join(" \xB7 ");
|
|
2902
2813
|
};
|
|
2903
|
-
var AttachmentView = ({ attachment: a }) => a.dataUrl && a.mediaType.startsWith("image/") ? /* @__PURE__ */
|
|
2904
|
-
/* @__PURE__ */
|
|
2814
|
+
var AttachmentView = ({ attachment: a }) => a.dataUrl && a.mediaType.startsWith("image/") ? /* @__PURE__ */ jsx8("a", { href: a.dataUrl, target: "_blank", rel: "noreferrer", title: a.path ?? a.name, children: /* @__PURE__ */ jsx8("img", { className: "awr-thumb awr-thumb--msg", src: a.dataUrl, alt: a.name }) }) : /* @__PURE__ */ jsxs6("span", { className: "awr-chip awr-file", title: a.path ?? a.mediaType, children: [
|
|
2815
|
+
/* @__PURE__ */ jsx8(FileIcon, { size: 13 }),
|
|
2905
2816
|
" ",
|
|
2906
2817
|
a.name
|
|
2907
2818
|
] });
|
|
@@ -2937,21 +2848,21 @@ var MessageList = ({
|
|
|
2937
2848
|
}) => {
|
|
2938
2849
|
const L = useLabels(labels);
|
|
2939
2850
|
if (messages.length === 0) {
|
|
2940
|
-
return empty ? /* @__PURE__ */
|
|
2851
|
+
return empty ? /* @__PURE__ */ jsx8("div", { className: "awr-messages__empty", children: empty }) : null;
|
|
2941
2852
|
}
|
|
2942
|
-
return /* @__PURE__ */
|
|
2853
|
+
return /* @__PURE__ */ jsx8("div", { className: ["awr-messages", className].filter(Boolean).join(" "), children: messages.map((m) => {
|
|
2943
2854
|
const steps = m.steps ?? [];
|
|
2944
2855
|
const hasActivity = showActivity && (steps.length > 0 || (m.subagents?.length ?? 0) > 0 || m.pending && !!liveExtra);
|
|
2945
2856
|
const usage = showUsage ? usageLine(m.usage, m.durationMs) : "";
|
|
2946
|
-
const node = /* @__PURE__ */
|
|
2857
|
+
const node = /* @__PURE__ */ jsx8(
|
|
2947
2858
|
"div",
|
|
2948
2859
|
{
|
|
2949
2860
|
className: `awr-msg awr-msg--${m.role}${m.error ? " awr-msg--error" : ""}${m.pending ? " is-pending" : ""}`,
|
|
2950
|
-
children: /* @__PURE__ */
|
|
2951
|
-
m.role === "assistant" && hasActivity && /* @__PURE__ */
|
|
2952
|
-
/* @__PURE__ */
|
|
2861
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "awr-msg__col", children: [
|
|
2862
|
+
m.role === "assistant" && hasActivity && /* @__PURE__ */ jsxs6("details", { className: "awr-activity", open: m.pending || activityOpen, children: [
|
|
2863
|
+
/* @__PURE__ */ jsx8("summary", { className: "awr-activity__summary", children: activitySummary(m, showToolCalls, showLearned, L) }),
|
|
2953
2864
|
m.pending && liveExtra,
|
|
2954
|
-
/* @__PURE__ */
|
|
2865
|
+
/* @__PURE__ */ jsx8(
|
|
2955
2866
|
StepList,
|
|
2956
2867
|
{
|
|
2957
2868
|
steps,
|
|
@@ -2967,66 +2878,66 @@ var MessageList = ({
|
|
|
2967
2878
|
labels
|
|
2968
2879
|
}
|
|
2969
2880
|
),
|
|
2970
|
-
showLearned && m.fetches?.length ? /* @__PURE__ */
|
|
2881
|
+
showLearned && m.fetches?.length ? /* @__PURE__ */ jsx8("ul", { className: "awr-fetches", children: m.fetches.map((f, i) => /* @__PURE__ */ jsxs6(
|
|
2971
2882
|
"li",
|
|
2972
2883
|
{
|
|
2973
2884
|
className: `awr-fetch${f.allowed ? "" : " awr-fetch--refused"}`,
|
|
2974
2885
|
children: [
|
|
2975
|
-
/* @__PURE__ */
|
|
2886
|
+
/* @__PURE__ */ jsx8(GlobeIcon, { size: 12 }),
|
|
2976
2887
|
" ",
|
|
2977
|
-
/* @__PURE__ */
|
|
2888
|
+
/* @__PURE__ */ jsx8("code", { children: f.url }),
|
|
2978
2889
|
" ",
|
|
2979
|
-
/* @__PURE__ */
|
|
2890
|
+
/* @__PURE__ */ jsx8("span", { className: "awr-fetch__result", children: f.allowed ? f.status ?? "ok" : L.fetchRefused(f.reason ?? "") })
|
|
2980
2891
|
]
|
|
2981
2892
|
},
|
|
2982
2893
|
i
|
|
2983
2894
|
)) }) : null,
|
|
2984
|
-
showLearned && m.learned?.length ? /* @__PURE__ */
|
|
2985
|
-
/* @__PURE__ */
|
|
2895
|
+
showLearned && m.learned?.length ? /* @__PURE__ */ jsxs6("p", { className: "awr-learned", children: [
|
|
2896
|
+
/* @__PURE__ */ jsx8(BookIcon, { size: 12 }),
|
|
2986
2897
|
" ",
|
|
2987
2898
|
L.learnedNow(m.learned.join(", "))
|
|
2988
2899
|
] }) : null,
|
|
2989
|
-
showThoughts && m.reasoning?.trim() && /* @__PURE__ */
|
|
2990
|
-
/* @__PURE__ */
|
|
2991
|
-
/* @__PURE__ */
|
|
2900
|
+
showThoughts && m.reasoning?.trim() && /* @__PURE__ */ jsxs6("details", { className: "awr-thought", children: [
|
|
2901
|
+
/* @__PURE__ */ jsxs6("summary", { children: [
|
|
2902
|
+
/* @__PURE__ */ jsx8(BrainIcon, { size: 13 }),
|
|
2992
2903
|
" ",
|
|
2993
2904
|
L.answerThoughts
|
|
2994
2905
|
] }),
|
|
2995
|
-
/* @__PURE__ */
|
|
2906
|
+
/* @__PURE__ */ jsx8("p", { className: "awr-thought__text", children: m.reasoning.trim() })
|
|
2996
2907
|
] })
|
|
2997
2908
|
] }),
|
|
2998
|
-
(m.content || m.pending || !m.attachments?.length) && /* @__PURE__ */
|
|
2909
|
+
(m.content || m.pending || !m.attachments?.length) && /* @__PURE__ */ jsxs6("div", { className: "awr-msg__bubble", children: [
|
|
2999
2910
|
m.content ? renderContent ? renderContent(m) : m.content : null,
|
|
3000
|
-
m.pending && !m.content && /* @__PURE__ */
|
|
2911
|
+
m.pending && !m.content && /* @__PURE__ */ jsx8(SpinnerIcon, { size: 14, className: "awr-msg__pending" })
|
|
3001
2912
|
] }),
|
|
3002
|
-
m.attachments?.length ? /* @__PURE__ */
|
|
3003
|
-
m.role === "assistant" && usage && !m.pending && /* @__PURE__ */
|
|
2913
|
+
m.attachments?.length ? /* @__PURE__ */ jsx8("div", { className: "awr-msg__attachments", "aria-label": L.attachments, children: m.attachments.map((a, i) => /* @__PURE__ */ jsx8("span", { className: "awr-msg__attachment", children: renderAttachment ? renderAttachment(a, m) : /* @__PURE__ */ jsx8(AttachmentView, { attachment: a }) }, i)) }) : null,
|
|
2914
|
+
m.role === "assistant" && usage && !m.pending && /* @__PURE__ */ jsx8("div", { className: "awr-msg__usage", title: L.usageTitle, children: usage })
|
|
3004
2915
|
] })
|
|
3005
2916
|
},
|
|
3006
2917
|
m.id
|
|
3007
2918
|
);
|
|
3008
|
-
return renderMessage ? /* @__PURE__ */
|
|
2919
|
+
return renderMessage ? /* @__PURE__ */ jsx8("div", { children: renderMessage(m, node) }, m.id) : node;
|
|
3009
2920
|
}) });
|
|
3010
2921
|
};
|
|
3011
2922
|
|
|
3012
2923
|
// src/components/ModelLoadBar.tsx
|
|
3013
|
-
import { jsx as
|
|
2924
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3014
2925
|
var ModelLoadBar = ({ load, className }) => {
|
|
3015
2926
|
const pct = Math.round(Math.max(0, Math.min(1, load.progress)) * 100);
|
|
3016
|
-
return /* @__PURE__ */
|
|
3017
|
-
/* @__PURE__ */
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
/* @__PURE__ */
|
|
2927
|
+
return /* @__PURE__ */ jsxs7("div", { className: ["awr-modelload", className].filter(Boolean).join(" "), children: [
|
|
2928
|
+
/* @__PURE__ */ jsxs7("div", { className: "awr-modelload__head", children: [
|
|
2929
|
+
/* @__PURE__ */ jsx9("span", { className: "awr-modelload__text", children: load.text || "Loading model\u2026" }),
|
|
2930
|
+
/* @__PURE__ */ jsxs7("span", { className: "awr-modelload__pct", children: [
|
|
3020
2931
|
pct,
|
|
3021
2932
|
"%"
|
|
3022
2933
|
] })
|
|
3023
2934
|
] }),
|
|
3024
|
-
/* @__PURE__ */
|
|
2935
|
+
/* @__PURE__ */ jsx9("div", { className: "awr-modelload__track", role: "progressbar", "aria-valuenow": pct, children: /* @__PURE__ */ jsx9("div", { className: "awr-modelload__fill", style: { width: `${pct}%` } }) })
|
|
3025
2936
|
] });
|
|
3026
2937
|
};
|
|
3027
2938
|
|
|
3028
2939
|
// src/components/ToolApprovalPrompt.tsx
|
|
3029
|
-
import { jsx as
|
|
2940
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3030
2941
|
var ToolApprovalPrompt = ({
|
|
3031
2942
|
approvals,
|
|
3032
2943
|
onApprove,
|
|
@@ -3038,20 +2949,20 @@ var ToolApprovalPrompt = ({
|
|
|
3038
2949
|
}) => {
|
|
3039
2950
|
const L = useLabels(labels);
|
|
3040
2951
|
if (approvals.length === 0) return null;
|
|
3041
|
-
return /* @__PURE__ */
|
|
3042
|
-
const card = /* @__PURE__ */
|
|
3043
|
-
/* @__PURE__ */
|
|
3044
|
-
/* @__PURE__ */
|
|
3045
|
-
/* @__PURE__ */
|
|
2952
|
+
return /* @__PURE__ */ jsx10("div", { className: ["awr-approvals", className].filter(Boolean).join(" "), role: "alert", children: approvals.map((a) => {
|
|
2953
|
+
const card = /* @__PURE__ */ jsxs8("div", { className: "awr-approval", children: [
|
|
2954
|
+
/* @__PURE__ */ jsxs8("div", { className: "awr-approval__head", children: [
|
|
2955
|
+
/* @__PURE__ */ jsx10(ShieldIcon, { size: 14, className: "awr-approval__icon" }),
|
|
2956
|
+
/* @__PURE__ */ jsxs8("span", { children: [
|
|
3046
2957
|
L.approvalLead,
|
|
3047
2958
|
" ",
|
|
3048
|
-
/* @__PURE__ */
|
|
2959
|
+
/* @__PURE__ */ jsx10("code", { className: "awr-tool__name", children: a.name }),
|
|
3049
2960
|
a.readOnly ? ` (${L.readOnlyTool})` : ""
|
|
3050
2961
|
] })
|
|
3051
2962
|
] }),
|
|
3052
|
-
previewValue(a.input, 300) && /* @__PURE__ */
|
|
3053
|
-
/* @__PURE__ */
|
|
3054
|
-
/* @__PURE__ */
|
|
2963
|
+
previewValue(a.input, 300) && /* @__PURE__ */ jsx10("pre", { className: "awr-approval__input", children: previewValue(a.input, 300) }),
|
|
2964
|
+
/* @__PURE__ */ jsxs8("div", { className: "awr-approval__actions", children: [
|
|
2965
|
+
/* @__PURE__ */ jsx10(
|
|
3055
2966
|
"button",
|
|
3056
2967
|
{
|
|
3057
2968
|
type: "button",
|
|
@@ -3060,7 +2971,7 @@ var ToolApprovalPrompt = ({
|
|
|
3060
2971
|
children: L.approve
|
|
3061
2972
|
}
|
|
3062
2973
|
),
|
|
3063
|
-
allowRemember && /* @__PURE__ */
|
|
2974
|
+
allowRemember && /* @__PURE__ */ jsx10(
|
|
3064
2975
|
"button",
|
|
3065
2976
|
{
|
|
3066
2977
|
type: "button",
|
|
@@ -3069,7 +2980,7 @@ var ToolApprovalPrompt = ({
|
|
|
3069
2980
|
children: L.alwaysAllow
|
|
3070
2981
|
}
|
|
3071
2982
|
),
|
|
3072
|
-
/* @__PURE__ */
|
|
2983
|
+
/* @__PURE__ */ jsx10(
|
|
3073
2984
|
"button",
|
|
3074
2985
|
{
|
|
3075
2986
|
type: "button",
|
|
@@ -3080,12 +2991,12 @@ var ToolApprovalPrompt = ({
|
|
|
3080
2991
|
)
|
|
3081
2992
|
] })
|
|
3082
2993
|
] }, a.id);
|
|
3083
|
-
return renderApproval ? /* @__PURE__ */
|
|
2994
|
+
return renderApproval ? /* @__PURE__ */ jsx10("div", { children: renderApproval(a, card) }, a.id) : card;
|
|
3084
2995
|
}) });
|
|
3085
2996
|
};
|
|
3086
2997
|
|
|
3087
2998
|
// src/components/UsageBadge.tsx
|
|
3088
|
-
import { jsxs as
|
|
2999
|
+
import { jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3089
3000
|
var UsageBadge = ({ usage, compact = false, className }) => {
|
|
3090
3001
|
if (usage.totalTokens === 0) return null;
|
|
3091
3002
|
const reasoning = usage.reasoningTokens ?? 0;
|
|
@@ -3095,7 +3006,7 @@ var UsageBadge = ({ usage, compact = false, className }) => {
|
|
|
3095
3006
|
reasoning ? `${reasoning} thinking` : "",
|
|
3096
3007
|
cached ? `${cached} input tokens from the prompt cache` : ""
|
|
3097
3008
|
].filter(Boolean).join(" \xB7 ");
|
|
3098
|
-
return /* @__PURE__ */
|
|
3009
|
+
return /* @__PURE__ */ jsxs9("span", { className: ["awr-usage", className].filter(Boolean).join(" "), title, children: [
|
|
3099
3010
|
formatTokens(usage.inputTokens),
|
|
3100
3011
|
"\u2191 ",
|
|
3101
3012
|
formatTokens(usage.outputTokens),
|
|
@@ -3106,10 +3017,10 @@ var UsageBadge = ({ usage, compact = false, className }) => {
|
|
|
3106
3017
|
};
|
|
3107
3018
|
|
|
3108
3019
|
// src/components/AgentChat.tsx
|
|
3109
|
-
import { Fragment as Fragment6, jsx as
|
|
3020
|
+
import { Fragment as Fragment6, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3110
3021
|
var isHistoryHook = (h) => typeof h === "object" && h !== null && "select" in h && "chats" in h;
|
|
3111
3022
|
var cx = (...names) => names.filter(Boolean).join(" ");
|
|
3112
|
-
var AgentChat = (props) => /* @__PURE__ */
|
|
3023
|
+
var AgentChat = (props) => /* @__PURE__ */ jsx11(AgentLabelsProvider, { labels: props.labels ?? NO_LABELS, children: /* @__PURE__ */ jsx11(AgentChatInner, { ...props }) });
|
|
3113
3024
|
var NO_LABELS = {};
|
|
3114
3025
|
var AgentChatInner = ({
|
|
3115
3026
|
controller,
|
|
@@ -3203,15 +3114,15 @@ var AgentChatInner = ({
|
|
|
3203
3114
|
const Approvals = components.ApprovalPrompt ?? ToolApprovalPrompt;
|
|
3204
3115
|
const loading = agent.modelLoad && agent.modelLoad.progress < 1;
|
|
3205
3116
|
const showReplan = agent.replan && agent.replan.mode !== "continue";
|
|
3206
|
-
const liveExtra = agent.planThought.trim() || showReplan ? /* @__PURE__ */
|
|
3207
|
-
agent.planThought.trim() && /* @__PURE__ */
|
|
3208
|
-
/* @__PURE__ */
|
|
3209
|
-
/* @__PURE__ */
|
|
3117
|
+
const liveExtra = agent.planThought.trim() || showReplan ? /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
|
3118
|
+
agent.planThought.trim() && /* @__PURE__ */ jsxs10("details", { className: "awr-activity__plan", children: [
|
|
3119
|
+
/* @__PURE__ */ jsx11("summary", { children: L.planned }),
|
|
3120
|
+
/* @__PURE__ */ jsx11("p", { className: "awr-activity__thought", children: agent.planThought })
|
|
3210
3121
|
] }),
|
|
3211
|
-
showReplan && /* @__PURE__ */
|
|
3122
|
+
showReplan && /* @__PURE__ */ jsx11("div", { className: "awr-activity__replan", children: L.replanned(agent.replan.mode, agent.replan.reason) })
|
|
3212
3123
|
] }) : void 0;
|
|
3213
|
-
const header = slots.header === false ? null : slots.header !== void 0 ? slots.header : /* @__PURE__ */
|
|
3214
|
-
chats && /* @__PURE__ */
|
|
3124
|
+
const header = slots.header === false ? null : slots.header !== void 0 ? slots.header : /* @__PURE__ */ jsxs10("div", { className: cx("awr-chat__header", classNames.header), children: [
|
|
3125
|
+
chats && /* @__PURE__ */ jsx11(
|
|
3215
3126
|
"button",
|
|
3216
3127
|
{
|
|
3217
3128
|
type: "button",
|
|
@@ -3220,17 +3131,17 @@ var AgentChatInner = ({
|
|
|
3220
3131
|
title: L.showHistory,
|
|
3221
3132
|
"aria-pressed": historyOpen,
|
|
3222
3133
|
onClick: toggleHistory,
|
|
3223
|
-
children: /* @__PURE__ */
|
|
3134
|
+
children: /* @__PURE__ */ jsx11(HistoryIcon, { size: 16 })
|
|
3224
3135
|
}
|
|
3225
3136
|
),
|
|
3226
3137
|
slots.headerStart,
|
|
3227
|
-
/* @__PURE__ */
|
|
3228
|
-
showStatus && /* @__PURE__ */
|
|
3229
|
-
/* @__PURE__ */
|
|
3230
|
-
/* @__PURE__ */
|
|
3138
|
+
/* @__PURE__ */ jsx11("div", { className: "awr-chat__title", children: title }),
|
|
3139
|
+
showStatus && /* @__PURE__ */ jsxs10("span", { className: `awr-status awr-status--${agent.status}`, title: L.status[agent.status], children: [
|
|
3140
|
+
/* @__PURE__ */ jsx11("span", { className: "awr-status__dot" }),
|
|
3141
|
+
/* @__PURE__ */ jsx11("span", { className: "awr-status__text", children: L.status[agent.status] })
|
|
3231
3142
|
] }),
|
|
3232
|
-
showTotalUsage && /* @__PURE__ */
|
|
3233
|
-
files && /* @__PURE__ */
|
|
3143
|
+
showTotalUsage && /* @__PURE__ */ jsx11("span", { title: L.totalUsage, children: /* @__PURE__ */ jsx11(UsageBadge, { usage: agent.totalUsage, compact: narrow !== false }) }),
|
|
3144
|
+
files && /* @__PURE__ */ jsx11(
|
|
3234
3145
|
"button",
|
|
3235
3146
|
{
|
|
3236
3147
|
type: "button",
|
|
@@ -3239,12 +3150,12 @@ var AgentChatInner = ({
|
|
|
3239
3150
|
title: L.showFiles,
|
|
3240
3151
|
"aria-pressed": filesOpen,
|
|
3241
3152
|
onClick: toggleFiles,
|
|
3242
|
-
children: /* @__PURE__ */
|
|
3153
|
+
children: /* @__PURE__ */ jsx11(FileIcon, { size: 16 })
|
|
3243
3154
|
}
|
|
3244
3155
|
),
|
|
3245
3156
|
slots.headerEnd
|
|
3246
3157
|
] });
|
|
3247
|
-
return /* @__PURE__ */
|
|
3158
|
+
return /* @__PURE__ */ jsxs10(
|
|
3248
3159
|
"div",
|
|
3249
3160
|
{
|
|
3250
3161
|
ref: rootRef,
|
|
@@ -3252,8 +3163,8 @@ var AgentChatInner = ({
|
|
|
3252
3163
|
style,
|
|
3253
3164
|
"data-awr-theme": theme === "auto" ? void 0 : theme,
|
|
3254
3165
|
children: [
|
|
3255
|
-
chats && historyOpen && /* @__PURE__ */
|
|
3256
|
-
/* @__PURE__ */
|
|
3166
|
+
chats && historyOpen && /* @__PURE__ */ jsxs10("aside", { className: cx("awr-chat__sidebar", classNames.sidebar), children: [
|
|
3167
|
+
/* @__PURE__ */ jsx11(
|
|
3257
3168
|
HistoryList,
|
|
3258
3169
|
{
|
|
3259
3170
|
history: {
|
|
@@ -3272,7 +3183,7 @@ var AgentChatInner = ({
|
|
|
3272
3183
|
}
|
|
3273
3184
|
),
|
|
3274
3185
|
slots.sidebar,
|
|
3275
|
-
/* @__PURE__ */
|
|
3186
|
+
/* @__PURE__ */ jsx11(
|
|
3276
3187
|
"button",
|
|
3277
3188
|
{
|
|
3278
3189
|
type: "button",
|
|
@@ -3283,9 +3194,9 @@ var AgentChatInner = ({
|
|
|
3283
3194
|
}
|
|
3284
3195
|
)
|
|
3285
3196
|
] }),
|
|
3286
|
-
/* @__PURE__ */
|
|
3197
|
+
/* @__PURE__ */ jsxs10("div", { className: cx("awr-chat__main", classNames.main), children: [
|
|
3287
3198
|
header,
|
|
3288
|
-
/* @__PURE__ */
|
|
3199
|
+
/* @__PURE__ */ jsxs10(
|
|
3289
3200
|
"div",
|
|
3290
3201
|
{
|
|
3291
3202
|
className: cx("awr-chat__body", classNames.body),
|
|
@@ -3296,7 +3207,7 @@ var AgentChatInner = ({
|
|
|
3296
3207
|
},
|
|
3297
3208
|
children: [
|
|
3298
3209
|
slots.beforeMessages,
|
|
3299
|
-
/* @__PURE__ */
|
|
3210
|
+
/* @__PURE__ */ jsx11(
|
|
3300
3211
|
Messages,
|
|
3301
3212
|
{
|
|
3302
3213
|
messages: agent.messages,
|
|
@@ -3316,7 +3227,7 @@ var AgentChatInner = ({
|
|
|
3316
3227
|
renderToolCall
|
|
3317
3228
|
}
|
|
3318
3229
|
),
|
|
3319
|
-
/* @__PURE__ */
|
|
3230
|
+
/* @__PURE__ */ jsx11(
|
|
3320
3231
|
Approvals,
|
|
3321
3232
|
{
|
|
3322
3233
|
approvals: agent.pendingApprovals,
|
|
@@ -3325,14 +3236,14 @@ var AgentChatInner = ({
|
|
|
3325
3236
|
renderApproval
|
|
3326
3237
|
}
|
|
3327
3238
|
),
|
|
3328
|
-
agent.modelLoad && loading && /* @__PURE__ */
|
|
3239
|
+
agent.modelLoad && loading && /* @__PURE__ */ jsx11(ModelLoadBar, { load: agent.modelLoad }),
|
|
3329
3240
|
slots.afterMessages
|
|
3330
3241
|
]
|
|
3331
3242
|
}
|
|
3332
3243
|
),
|
|
3333
|
-
/* @__PURE__ */
|
|
3244
|
+
/* @__PURE__ */ jsxs10("div", { className: cx("awr-chat__footer", classNames.footer), children: [
|
|
3334
3245
|
slots.footerStart,
|
|
3335
|
-
showContext !== false && /* @__PURE__ */
|
|
3246
|
+
showContext !== false && /* @__PURE__ */ jsx11(
|
|
3336
3247
|
ContextMeter,
|
|
3337
3248
|
{
|
|
3338
3249
|
usage: agent.usage,
|
|
@@ -3343,11 +3254,11 @@ var AgentChatInner = ({
|
|
|
3343
3254
|
compacting
|
|
3344
3255
|
}
|
|
3345
3256
|
),
|
|
3346
|
-
composer === false ? agent.error && agent.status === "error" && /* @__PURE__ */
|
|
3347
|
-
/* @__PURE__ */
|
|
3257
|
+
composer === false ? agent.error && agent.status === "error" && /* @__PURE__ */ jsxs10("div", { className: "awr-chat__error", children: [
|
|
3258
|
+
/* @__PURE__ */ jsx11(AlertIcon, { size: 14 }),
|
|
3348
3259
|
" ",
|
|
3349
3260
|
agent.error
|
|
3350
|
-
] }) : /* @__PURE__ */
|
|
3261
|
+
] }) : /* @__PURE__ */ jsx11(
|
|
3351
3262
|
Composer2,
|
|
3352
3263
|
{
|
|
3353
3264
|
controller: agent,
|
|
@@ -3360,9 +3271,9 @@ var AgentChatInner = ({
|
|
|
3360
3271
|
)
|
|
3361
3272
|
] })
|
|
3362
3273
|
] }),
|
|
3363
|
-
files && filesOpen && /* @__PURE__ */
|
|
3364
|
-
/* @__PURE__ */
|
|
3365
|
-
/* @__PURE__ */
|
|
3274
|
+
files && filesOpen && /* @__PURE__ */ jsxs10("aside", { className: cx("awr-chat__files", classNames.files), children: [
|
|
3275
|
+
/* @__PURE__ */ jsx11(Files, { files }),
|
|
3276
|
+
/* @__PURE__ */ jsx11(
|
|
3366
3277
|
"button",
|
|
3367
3278
|
{
|
|
3368
3279
|
type: "button",
|
|
@@ -3379,7 +3290,7 @@ var AgentChatInner = ({
|
|
|
3379
3290
|
};
|
|
3380
3291
|
|
|
3381
3292
|
// src/components/LearnedSkills.tsx
|
|
3382
|
-
import { jsx as
|
|
3293
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3383
3294
|
var LearnedSkills = ({
|
|
3384
3295
|
controller,
|
|
3385
3296
|
lessons,
|
|
@@ -3395,18 +3306,18 @@ var LearnedSkills = ({
|
|
|
3395
3306
|
const c = controller ?? ctx;
|
|
3396
3307
|
const list = lessons ?? c?.learned ?? [];
|
|
3397
3308
|
const forget = onForget === false ? void 0 : onForget ?? c?.forgetSkill;
|
|
3398
|
-
return /* @__PURE__ */
|
|
3399
|
-
!hideTitle && /* @__PURE__ */
|
|
3400
|
-
/* @__PURE__ */
|
|
3309
|
+
return /* @__PURE__ */ jsxs11("section", { className: ["awr-notebook", className].filter(Boolean).join(" "), children: [
|
|
3310
|
+
!hideTitle && /* @__PURE__ */ jsxs11("h3", { className: "awr-notebook__title", children: [
|
|
3311
|
+
/* @__PURE__ */ jsx12(BookIcon, { size: 14 }),
|
|
3401
3312
|
" ",
|
|
3402
3313
|
L.notebookTitle,
|
|
3403
|
-
list.length > 0 && /* @__PURE__ */
|
|
3314
|
+
list.length > 0 && /* @__PURE__ */ jsx12("span", { className: "awr-notebook__count", children: list.length })
|
|
3404
3315
|
] }),
|
|
3405
|
-
list.length === 0 ? /* @__PURE__ */
|
|
3406
|
-
/* @__PURE__ */
|
|
3407
|
-
/* @__PURE__ */
|
|
3408
|
-
l.revision > 1 && /* @__PURE__ */
|
|
3409
|
-
forget && /* @__PURE__ */
|
|
3316
|
+
list.length === 0 ? /* @__PURE__ */ jsx12("p", { className: "awr-notebook__empty", children: empty ?? L.notebookEmpty }) : /* @__PURE__ */ jsx12("ul", { className: "awr-notebook__list", children: list.map((l) => /* @__PURE__ */ jsxs11("li", { className: "awr-lesson", children: [
|
|
3317
|
+
/* @__PURE__ */ jsxs11("div", { className: "awr-lesson__head", children: [
|
|
3318
|
+
/* @__PURE__ */ jsx12("code", { className: "awr-lesson__name", children: l.name }),
|
|
3319
|
+
l.revision > 1 && /* @__PURE__ */ jsx12("span", { className: "awr-lesson__rev", children: L.notebookRevision(l.revision) }),
|
|
3320
|
+
forget && /* @__PURE__ */ jsx12(
|
|
3410
3321
|
"button",
|
|
3411
3322
|
{
|
|
3412
3323
|
type: "button",
|
|
@@ -3414,12 +3325,12 @@ var LearnedSkills = ({
|
|
|
3414
3325
|
title: `${L.notebookForget}: ${l.name}`,
|
|
3415
3326
|
"aria-label": `${L.notebookForget}: ${l.name}`,
|
|
3416
3327
|
onClick: () => void forget(l.name),
|
|
3417
|
-
children: /* @__PURE__ */
|
|
3328
|
+
children: /* @__PURE__ */ jsx12(XIcon, { size: 12 })
|
|
3418
3329
|
}
|
|
3419
3330
|
)
|
|
3420
3331
|
] }),
|
|
3421
|
-
/* @__PURE__ */
|
|
3422
|
-
showSources && l.sources.length > 0 && /* @__PURE__ */
|
|
3332
|
+
/* @__PURE__ */ jsx12("p", { className: "awr-lesson__when", children: l.description }),
|
|
3333
|
+
showSources && l.sources.length > 0 && /* @__PURE__ */ jsxs11("p", { className: "awr-lesson__from", children: [
|
|
3423
3334
|
L.notebookFrom,
|
|
3424
3335
|
" ",
|
|
3425
3336
|
l.sources.join(", ")
|
|
@@ -3430,7 +3341,7 @@ var LearnedSkills = ({
|
|
|
3430
3341
|
|
|
3431
3342
|
// src/components/Composer.tsx
|
|
3432
3343
|
import { useState as useState10 } from "react";
|
|
3433
|
-
import { jsx as
|
|
3344
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3434
3345
|
var Composer = ({
|
|
3435
3346
|
onSubmit,
|
|
3436
3347
|
busy = false,
|
|
@@ -3452,7 +3363,7 @@ var Composer = ({
|
|
|
3452
3363
|
submit();
|
|
3453
3364
|
}
|
|
3454
3365
|
};
|
|
3455
|
-
return /* @__PURE__ */
|
|
3366
|
+
return /* @__PURE__ */ jsxs12(
|
|
3456
3367
|
"form",
|
|
3457
3368
|
{
|
|
3458
3369
|
className: ["awr-composer", className].filter(Boolean).join(" "),
|
|
@@ -3461,7 +3372,7 @@ var Composer = ({
|
|
|
3461
3372
|
submit();
|
|
3462
3373
|
},
|
|
3463
3374
|
children: [
|
|
3464
|
-
/* @__PURE__ */
|
|
3375
|
+
/* @__PURE__ */ jsx13(
|
|
3465
3376
|
"textarea",
|
|
3466
3377
|
{
|
|
3467
3378
|
className: "awr-composer__input",
|
|
@@ -3473,23 +3384,23 @@ var Composer = ({
|
|
|
3473
3384
|
rows: 1
|
|
3474
3385
|
}
|
|
3475
3386
|
),
|
|
3476
|
-
busy ? /* @__PURE__ */
|
|
3387
|
+
busy ? /* @__PURE__ */ jsx13(
|
|
3477
3388
|
"button",
|
|
3478
3389
|
{
|
|
3479
3390
|
type: "button",
|
|
3480
3391
|
className: "awr-composer__btn awr-composer__btn--stop",
|
|
3481
3392
|
onClick: onStop,
|
|
3482
3393
|
"aria-label": "Stop",
|
|
3483
|
-
children: /* @__PURE__ */
|
|
3394
|
+
children: /* @__PURE__ */ jsx13(StopIcon, { size: 18 })
|
|
3484
3395
|
}
|
|
3485
|
-
) : /* @__PURE__ */
|
|
3396
|
+
) : /* @__PURE__ */ jsx13(
|
|
3486
3397
|
"button",
|
|
3487
3398
|
{
|
|
3488
3399
|
type: "submit",
|
|
3489
3400
|
className: "awr-composer__btn",
|
|
3490
3401
|
disabled: disabled || !text.trim(),
|
|
3491
3402
|
"aria-label": "Send",
|
|
3492
|
-
children: disabled ? /* @__PURE__ */
|
|
3403
|
+
children: disabled ? /* @__PURE__ */ jsx13(SpinnerIcon, { size: 18 }) : /* @__PURE__ */ jsx13(SendIcon, { size: 18 })
|
|
3493
3404
|
}
|
|
3494
3405
|
)
|
|
3495
3406
|
]
|
|
@@ -3498,17 +3409,17 @@ var Composer = ({
|
|
|
3498
3409
|
};
|
|
3499
3410
|
|
|
3500
3411
|
// src/components/PlanView.tsx
|
|
3501
|
-
import { jsx as
|
|
3412
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3502
3413
|
var PlanView = ({ plan, showThought = true, className }) => {
|
|
3503
3414
|
if (!plan.steps.length && !plan.thought) return null;
|
|
3504
|
-
return /* @__PURE__ */
|
|
3505
|
-
showThought && plan.thought.trim() && /* @__PURE__ */
|
|
3506
|
-
plan.steps.length > 0 && /* @__PURE__ */
|
|
3415
|
+
return /* @__PURE__ */ jsxs13("div", { className: ["awr-plan", className].filter(Boolean).join(" "), children: [
|
|
3416
|
+
showThought && plan.thought.trim() && /* @__PURE__ */ jsx14("p", { className: "awr-plan__thought", children: plan.thought }),
|
|
3417
|
+
plan.steps.length > 0 && /* @__PURE__ */ jsx14("ol", { className: "awr-plan__steps", children: plan.steps.map((step) => /* @__PURE__ */ jsx14("li", { className: "awr-plan__step", children: step.description }, step.id)) })
|
|
3507
3418
|
] });
|
|
3508
3419
|
};
|
|
3509
3420
|
|
|
3510
3421
|
// src/components/ApprovalModeSwitch.tsx
|
|
3511
|
-
import { jsx as
|
|
3422
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
3512
3423
|
var DEFAULT_LABELS = {
|
|
3513
3424
|
autopilot: "Autopilot",
|
|
3514
3425
|
"ask-writes": "Ask before changes",
|
|
@@ -3528,13 +3439,13 @@ var ApprovalModeSwitch = ({
|
|
|
3528
3439
|
labels,
|
|
3529
3440
|
disabled,
|
|
3530
3441
|
className
|
|
3531
|
-
}) => /* @__PURE__ */
|
|
3442
|
+
}) => /* @__PURE__ */ jsx15(
|
|
3532
3443
|
"div",
|
|
3533
3444
|
{
|
|
3534
3445
|
className: ["awr-modeswitch", className].filter(Boolean).join(" "),
|
|
3535
3446
|
role: "radiogroup",
|
|
3536
3447
|
"aria-label": "Tool consent",
|
|
3537
|
-
children: modes.map((m) => /* @__PURE__ */
|
|
3448
|
+
children: modes.map((m) => /* @__PURE__ */ jsx15(
|
|
3538
3449
|
"button",
|
|
3539
3450
|
{
|
|
3540
3451
|
type: "button",
|
|
@@ -3553,7 +3464,7 @@ var ApprovalModeSwitch = ({
|
|
|
3553
3464
|
|
|
3554
3465
|
// src/components/ApiKeyForm.tsx
|
|
3555
3466
|
import { useEffect as useEffect8, useState as useState11 } from "react";
|
|
3556
|
-
import { jsx as
|
|
3467
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3557
3468
|
var ApiKeyForm = ({
|
|
3558
3469
|
credentials,
|
|
3559
3470
|
credentialRef,
|
|
@@ -3597,16 +3508,16 @@ var ApiKeyForm = ({
|
|
|
3597
3508
|
setBusy(false);
|
|
3598
3509
|
}
|
|
3599
3510
|
};
|
|
3600
|
-
return /* @__PURE__ */
|
|
3601
|
-
/* @__PURE__ */
|
|
3511
|
+
return /* @__PURE__ */ jsxs14("div", { className: ["awr-keyform", className].filter(Boolean).join(" "), children: [
|
|
3512
|
+
/* @__PURE__ */ jsxs14("label", { className: "awr-keyform__label", children: [
|
|
3602
3513
|
label,
|
|
3603
|
-
present && /* @__PURE__ */
|
|
3604
|
-
/* @__PURE__ */
|
|
3514
|
+
present && /* @__PURE__ */ jsxs14("span", { className: "awr-keyform__saved", children: [
|
|
3515
|
+
/* @__PURE__ */ jsx16(CheckIcon, { size: 12 }),
|
|
3605
3516
|
" stored, encrypted"
|
|
3606
3517
|
] })
|
|
3607
3518
|
] }),
|
|
3608
|
-
/* @__PURE__ */
|
|
3609
|
-
/* @__PURE__ */
|
|
3519
|
+
/* @__PURE__ */ jsxs14("div", { className: "awr-keyform__row", children: [
|
|
3520
|
+
/* @__PURE__ */ jsx16(
|
|
3610
3521
|
"input",
|
|
3611
3522
|
{
|
|
3612
3523
|
className: "awr-keyform__input",
|
|
@@ -3624,7 +3535,7 @@ var ApiKeyForm = ({
|
|
|
3624
3535
|
disabled: busy
|
|
3625
3536
|
}
|
|
3626
3537
|
),
|
|
3627
|
-
/* @__PURE__ */
|
|
3538
|
+
/* @__PURE__ */ jsx16(
|
|
3628
3539
|
"button",
|
|
3629
3540
|
{
|
|
3630
3541
|
type: "button",
|
|
@@ -3634,7 +3545,7 @@ var ApiKeyForm = ({
|
|
|
3634
3545
|
children: "Save"
|
|
3635
3546
|
}
|
|
3636
3547
|
),
|
|
3637
|
-
present && /* @__PURE__ */
|
|
3548
|
+
present && /* @__PURE__ */ jsx16(
|
|
3638
3549
|
"button",
|
|
3639
3550
|
{
|
|
3640
3551
|
type: "button",
|