@mcp-b/react-components 0.69.0 → 0.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AgentComputer-CpS9R2KG.d.ts +305 -0
- package/dist/{AgentComputer-CFJxjMFE.js → AgentComputer-DZCyQkcE.js} +1850 -478
- package/dist/CommandPalette-DDctKdpC.d.ts +53 -0
- package/dist/ComputerCalendar-Ci7tLASe.js +1360 -0
- package/dist/ComputerCustomWallpaper-CnGQYHp0.js +518 -0
- package/dist/ComputerCustomWallpaper-D4lgwj2k.d.ts +18 -0
- package/dist/ComputerNotifications-q7eeELZ8.d.ts +41 -0
- package/dist/ComputerPresentation-BEQKYAjc.js +888 -0
- package/dist/Context-CYUxZrwW.js +918 -0
- package/dist/{ExecutionResult-C7SzVquo.js → ExecutionResult-CXnGcmM4.js} +1 -1
- package/dist/{WorkspaceBrowser-ojoZy0uO.js → WorkspaceBrowser-mRScUczT.js} +5 -5
- package/dist/WorkspaceFileTransfer-D2cOoVyO.js +1625 -0
- package/dist/{WorkspaceMessageResponse-BoeeltJM.js → WorkspaceMessageResponse-CXGOQgpo.js} +1 -1
- package/dist/components/agents-sdk/AgentComputer.d.ts +2 -276
- package/dist/components/agents-sdk/AgentComputer.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/ComputerAutomations.d.ts +5 -15
- package/dist/components/agents-sdk/ComputerAutomations.js +164 -145
- package/dist/components/agents-sdk/ComputerCalendar.d.ts +1 -1
- package/dist/components/agents-sdk/ComputerCalendar.js +1 -1344
- package/dist/components/agents-sdk/ComputerCustomWallpaper.d.ts +2 -39
- package/dist/components/agents-sdk/ComputerCustomWallpaper.js +2 -522
- package/dist/components/agents-sdk/ComputerFiles.d.ts +18 -81
- package/dist/components/agents-sdk/ComputerFiles.js +365 -89
- package/dist/components/agents-sdk/ComputerHome.d.ts +6 -11
- package/dist/components/agents-sdk/ComputerHome.js +1 -89
- package/dist/components/agents-sdk/ComputerHost.d.ts +43 -0
- package/dist/components/agents-sdk/ComputerHost.js +97 -0
- package/dist/components/agents-sdk/ComputerLayout.d.ts +1 -1
- package/dist/components/agents-sdk/ComputerNotifications.d.ts +2 -54
- package/dist/components/agents-sdk/ComputerNotifications.js +1 -668
- package/dist/components/agents-sdk/ComputerPresentation.d.ts +2 -0
- package/dist/components/agents-sdk/ComputerPresentation.js +2 -0
- package/dist/components/agents-sdk/ComputerScreen.d.ts +14 -14
- package/dist/components/agents-sdk/ComputerScreen.js +109 -50
- package/dist/components/agents-sdk/ComputerSettings.d.ts +12 -40
- package/dist/components/agents-sdk/ComputerSettings.js +249 -1038
- package/dist/components/agents-sdk/ComputerSpotlight.d.ts +13 -15
- package/dist/components/agents-sdk/ComputerSpotlight.js +1 -231
- package/dist/components/agents-sdk/ComputerViewer.d.ts +13 -17
- package/dist/components/agents-sdk/ComputerViewer.js +176 -187
- package/dist/components/agents-sdk/ComputerWallpapers.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeChat.js +2 -2
- package/dist/components/agents-sdk/EmployeeChrome.js +3 -3
- package/dist/components/agents-sdk/EmployeeSchedules.js +2 -2
- package/dist/components/agents-sdk/ExecutionBoard.js +1 -1
- package/dist/components/agents-sdk/ManagerOffice.js +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.js +2 -2
- package/dist/components/agents-sdk/McpPluginCatalog.js +1 -1
- package/dist/components/agents-sdk/ThinkChat.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +3 -3
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +2 -2
- package/dist/components/agents-sdk/ThinkScheduleActions.js +1 -1
- package/dist/components/agents-sdk/ThinkScheduleBrowser.js +1 -1
- package/dist/components/agents-sdk/ThinkScheduleDetail.js +4 -4
- package/dist/components/agents-sdk/ThinkScheduleForm.js +3 -3
- package/dist/components/agents-sdk/WorkspaceAutomation.js +3 -3
- package/dist/components/agents-sdk/WorkspaceAutomationTable.js +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceDesktop.d.ts +1 -5
- package/dist/components/agents-sdk/WorkspaceDesktop.js +53 -41
- package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -3
- package/dist/components/agents-sdk/WorkspaceFileCommands.js +1 -924
- package/dist/components/agents-sdk/WorkspaceFileDetails.js +1 -1
- package/dist/components/agents-sdk/WorkspaceFileTransfer.js +1 -504
- package/dist/components/agents-sdk/WorkspaceFileView.js +6 -6
- package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +9 -0
- package/dist/components/agents-sdk/WorkspaceLive.js +2 -177
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
- package/dist/components/ai-sdk/Context.js +1 -842
- package/dist/components/ai-sdk/Plan.d.ts +33 -9
- package/dist/components/ai-sdk/Plan.js +336 -107
- package/dist/components/ai-sdk/PromptInput.js +1 -1
- package/dist/components/extension/FirstRunSetup.js +2 -2
- package/dist/components/foundations/ThemeProvider.d.ts +2 -0
- package/dist/components/foundations/ThemeProvider.js +2 -1
- package/dist/components/general-purpose/CommandPalette.d.ts +2 -52
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
- package/dist/components/general-purpose/WallpaperPicker.d.ts +33 -2
- package/dist/components/nanites/AgentConnection.js +1 -1
- package/dist/components/nanites/AgentToolDetail.js +1 -1
- package/dist/context-BWJpR084.js +94 -0
- package/dist/{parts-CPVz9l31.js → parts-DuT5-rDz.js} +1 -1
- package/dist/styles/agent-computer.css +16 -0
- package/dist/styles/computer-files.css +5 -0
- package/dist/styles/computer-notifications.css +1 -0
- package/dist/styles/plan.css +160 -23
- package/dist/{workspace-drag-B6hMXUNt.js → workspace-drag-BNhZIN8F.js} +1 -1
- package/dist/{workspace-quick-look-DODjsfhH.js → workspace-quick-look-8cbGu1Xf.js} +2 -2
- package/package.json +2 -2
- package/dist/WallpaperPicker-C-FItmDS.d.ts +0 -34
- package/dist/automations-host-DPORjdc7.js +0 -17
- package/dist/context-Ddsp8HgD.js +0 -43
- package/dist/minute-clock-CXpRGCMF.js +0 -35
- package/dist/progress-ring-BO649JA9.js +0 -79
- package/dist/{ManagerOffice-kSK7vTBl.js → ManagerOffice-BJ2vs-Lr.js} +2 -2
- package/dist/{WorkspaceLink-DK9kdMUH.js → WorkspaceLink-DDkj-Tq5.js} +1 -1
|
@@ -0,0 +1,918 @@
|
|
|
1
|
+
import { n as mergeBaseClassName, t as cx } from "./class-names-BiMDVpUo.js";
|
|
2
|
+
import { n as clamp } from "./format-DL7f2rqp.js";
|
|
3
|
+
import { Popover } from "./components/foundations/Popover.js";
|
|
4
|
+
import { Separator } from "./components/foundations/Separator.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/_internal/progress-ring.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Bare single-fraction progress ring shared by the Context usage trigger and
|
|
11
|
+
* the plan summary pill. Decorative: callers own the accessible label.
|
|
12
|
+
*/
|
|
13
|
+
function ProgressRing(t0) {
|
|
14
|
+
const $ = c(18);
|
|
15
|
+
const { percent, size, stroke } = t0;
|
|
16
|
+
const radius = (size - stroke) / 2;
|
|
17
|
+
const circumference = 2 * Math.PI * radius;
|
|
18
|
+
const offset = circumference - clamp(percent, 0, 100) / 100 * circumference;
|
|
19
|
+
const t1 = `0 0 ${size} ${size}`;
|
|
20
|
+
const t2 = size / 2;
|
|
21
|
+
const t3 = size / 2;
|
|
22
|
+
let t4;
|
|
23
|
+
if ($[0] !== radius || $[1] !== stroke || $[2] !== t2 || $[3] !== t3) {
|
|
24
|
+
t4 = /* @__PURE__ */ jsx("circle", {
|
|
25
|
+
cx: t2,
|
|
26
|
+
cy: t3,
|
|
27
|
+
r: radius,
|
|
28
|
+
fill: "none",
|
|
29
|
+
stroke: "var(--sigvelo-color-neutral-border-subtle)",
|
|
30
|
+
strokeWidth: stroke
|
|
31
|
+
});
|
|
32
|
+
$[0] = radius;
|
|
33
|
+
$[1] = stroke;
|
|
34
|
+
$[2] = t2;
|
|
35
|
+
$[3] = t3;
|
|
36
|
+
$[4] = t4;
|
|
37
|
+
} else t4 = $[4];
|
|
38
|
+
const t5 = size / 2;
|
|
39
|
+
const t6 = size / 2;
|
|
40
|
+
const t7 = `rotate(-90 ${size / 2} ${size / 2})`;
|
|
41
|
+
let t8;
|
|
42
|
+
if ($[5] !== circumference || $[6] !== offset || $[7] !== radius || $[8] !== stroke || $[9] !== t5 || $[10] !== t6 || $[11] !== t7) {
|
|
43
|
+
t8 = /* @__PURE__ */ jsx("circle", {
|
|
44
|
+
cx: t5,
|
|
45
|
+
cy: t6,
|
|
46
|
+
r: radius,
|
|
47
|
+
fill: "none",
|
|
48
|
+
stroke: "var(--sigvelo-color-primary-bg)",
|
|
49
|
+
strokeWidth: stroke,
|
|
50
|
+
strokeDasharray: circumference,
|
|
51
|
+
strokeDashoffset: offset,
|
|
52
|
+
strokeLinecap: "round",
|
|
53
|
+
transform: t7
|
|
54
|
+
});
|
|
55
|
+
$[5] = circumference;
|
|
56
|
+
$[6] = offset;
|
|
57
|
+
$[7] = radius;
|
|
58
|
+
$[8] = stroke;
|
|
59
|
+
$[9] = t5;
|
|
60
|
+
$[10] = t6;
|
|
61
|
+
$[11] = t7;
|
|
62
|
+
$[12] = t8;
|
|
63
|
+
} else t8 = $[12];
|
|
64
|
+
let t9;
|
|
65
|
+
if ($[13] !== size || $[14] !== t1 || $[15] !== t4 || $[16] !== t8) {
|
|
66
|
+
t9 = /* @__PURE__ */ jsxs("svg", {
|
|
67
|
+
width: size,
|
|
68
|
+
height: size,
|
|
69
|
+
viewBox: t1,
|
|
70
|
+
focusable: "false",
|
|
71
|
+
"aria-hidden": "true",
|
|
72
|
+
children: [t4, t8]
|
|
73
|
+
});
|
|
74
|
+
$[13] = size;
|
|
75
|
+
$[14] = t1;
|
|
76
|
+
$[15] = t4;
|
|
77
|
+
$[16] = t8;
|
|
78
|
+
$[17] = t9;
|
|
79
|
+
} else t9 = $[17];
|
|
80
|
+
return t9;
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/components/ai-sdk/Context.tsx
|
|
84
|
+
const ContextContext = React.createContext(null);
|
|
85
|
+
function useContextContext() {
|
|
86
|
+
const ctx = React.useContext(ContextContext);
|
|
87
|
+
if (!ctx) throw new Error("Context subcomponents must be used inside <Context>.");
|
|
88
|
+
return ctx;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Displays token / context usage with a hover card breakdown. The trigger is
|
|
92
|
+
* a bare progress ring; clicking it opens a popover (upward by default) with
|
|
93
|
+
* category rows and total cost.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* const usage = getContextUsage(messages);
|
|
98
|
+
*
|
|
99
|
+
* <Context
|
|
100
|
+
* usedTokens={getContextUsedTokens(usage)}
|
|
101
|
+
* maxTokens={200_000}
|
|
102
|
+
* modelId="claude-opus-4-6"
|
|
103
|
+
* usage={usage}
|
|
104
|
+
* totalCostUsd={0.42}
|
|
105
|
+
* >
|
|
106
|
+
* <ContextTrigger />
|
|
107
|
+
* <ContextContent>
|
|
108
|
+
* <ContextContentHeader />
|
|
109
|
+
* <ContextContentBody />
|
|
110
|
+
* <ContextContentFooter />
|
|
111
|
+
* </ContextContent>
|
|
112
|
+
* </Context>
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
function Context(t0) {
|
|
116
|
+
const $ = c(34);
|
|
117
|
+
let children;
|
|
118
|
+
let className;
|
|
119
|
+
let defaultOpen;
|
|
120
|
+
let maxTokens;
|
|
121
|
+
let modelId;
|
|
122
|
+
let onOpenChange;
|
|
123
|
+
let open;
|
|
124
|
+
let props;
|
|
125
|
+
let ref;
|
|
126
|
+
let totalCostUsd;
|
|
127
|
+
let usage;
|
|
128
|
+
let usedTokens;
|
|
129
|
+
if ($[0] !== t0) {
|
|
130
|
+
({className, usedTokens, maxTokens, usage, modelId, totalCostUsd, open, defaultOpen, onOpenChange, children, ref, ...props} = t0);
|
|
131
|
+
$[0] = t0;
|
|
132
|
+
$[1] = children;
|
|
133
|
+
$[2] = className;
|
|
134
|
+
$[3] = defaultOpen;
|
|
135
|
+
$[4] = maxTokens;
|
|
136
|
+
$[5] = modelId;
|
|
137
|
+
$[6] = onOpenChange;
|
|
138
|
+
$[7] = open;
|
|
139
|
+
$[8] = props;
|
|
140
|
+
$[9] = ref;
|
|
141
|
+
$[10] = totalCostUsd;
|
|
142
|
+
$[11] = usage;
|
|
143
|
+
$[12] = usedTokens;
|
|
144
|
+
} else {
|
|
145
|
+
children = $[1];
|
|
146
|
+
className = $[2];
|
|
147
|
+
defaultOpen = $[3];
|
|
148
|
+
maxTokens = $[4];
|
|
149
|
+
modelId = $[5];
|
|
150
|
+
onOpenChange = $[6];
|
|
151
|
+
open = $[7];
|
|
152
|
+
props = $[8];
|
|
153
|
+
ref = $[9];
|
|
154
|
+
totalCostUsd = $[10];
|
|
155
|
+
usage = $[11];
|
|
156
|
+
usedTokens = $[12];
|
|
157
|
+
}
|
|
158
|
+
let t1;
|
|
159
|
+
if ($[13] !== maxTokens || $[14] !== modelId || $[15] !== totalCostUsd || $[16] !== usage || $[17] !== usedTokens) {
|
|
160
|
+
t1 = {
|
|
161
|
+
usedTokens,
|
|
162
|
+
maxTokens,
|
|
163
|
+
usage,
|
|
164
|
+
modelId,
|
|
165
|
+
totalCostUsd
|
|
166
|
+
};
|
|
167
|
+
$[13] = maxTokens;
|
|
168
|
+
$[14] = modelId;
|
|
169
|
+
$[15] = totalCostUsd;
|
|
170
|
+
$[16] = usage;
|
|
171
|
+
$[17] = usedTokens;
|
|
172
|
+
$[18] = t1;
|
|
173
|
+
} else t1 = $[18];
|
|
174
|
+
const ctxValue = t1;
|
|
175
|
+
let t2;
|
|
176
|
+
if ($[19] !== className) {
|
|
177
|
+
t2 = cx("context", className);
|
|
178
|
+
$[19] = className;
|
|
179
|
+
$[20] = t2;
|
|
180
|
+
} else t2 = $[20];
|
|
181
|
+
let t3;
|
|
182
|
+
if ($[21] !== children || $[22] !== defaultOpen || $[23] !== onOpenChange || $[24] !== open) {
|
|
183
|
+
t3 = /* @__PURE__ */ jsx(Popover.Root, {
|
|
184
|
+
open,
|
|
185
|
+
defaultOpen,
|
|
186
|
+
onOpenChange,
|
|
187
|
+
children
|
|
188
|
+
});
|
|
189
|
+
$[21] = children;
|
|
190
|
+
$[22] = defaultOpen;
|
|
191
|
+
$[23] = onOpenChange;
|
|
192
|
+
$[24] = open;
|
|
193
|
+
$[25] = t3;
|
|
194
|
+
} else t3 = $[25];
|
|
195
|
+
let t4;
|
|
196
|
+
if ($[26] !== props || $[27] !== ref || $[28] !== t2 || $[29] !== t3) {
|
|
197
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
198
|
+
ref,
|
|
199
|
+
className: t2,
|
|
200
|
+
...props,
|
|
201
|
+
children: t3
|
|
202
|
+
});
|
|
203
|
+
$[26] = props;
|
|
204
|
+
$[27] = ref;
|
|
205
|
+
$[28] = t2;
|
|
206
|
+
$[29] = t3;
|
|
207
|
+
$[30] = t4;
|
|
208
|
+
} else t4 = $[30];
|
|
209
|
+
let t5;
|
|
210
|
+
if ($[31] !== ctxValue || $[32] !== t4) {
|
|
211
|
+
t5 = /* @__PURE__ */ jsx(ContextContext.Provider, {
|
|
212
|
+
value: ctxValue,
|
|
213
|
+
children: t4
|
|
214
|
+
});
|
|
215
|
+
$[31] = ctxValue;
|
|
216
|
+
$[32] = t4;
|
|
217
|
+
$[33] = t5;
|
|
218
|
+
} else t5 = $[33];
|
|
219
|
+
return t5;
|
|
220
|
+
}
|
|
221
|
+
/** Context ring trigger; use `render` to compose a custom control and `children` for its content. */
|
|
222
|
+
function ContextTrigger(t0) {
|
|
223
|
+
const $ = c(18);
|
|
224
|
+
let children;
|
|
225
|
+
let className;
|
|
226
|
+
let props;
|
|
227
|
+
if ($[0] !== t0) {
|
|
228
|
+
({className, children, ...props} = t0);
|
|
229
|
+
$[0] = t0;
|
|
230
|
+
$[1] = children;
|
|
231
|
+
$[2] = className;
|
|
232
|
+
$[3] = props;
|
|
233
|
+
} else {
|
|
234
|
+
children = $[1];
|
|
235
|
+
className = $[2];
|
|
236
|
+
props = $[3];
|
|
237
|
+
}
|
|
238
|
+
const { usedTokens, maxTokens } = useContextContext();
|
|
239
|
+
const percent = maxTokens > 0 ? usedTokens / maxTokens * 100 : 0;
|
|
240
|
+
const hasContent = children != null && typeof children !== "boolean" && children !== "";
|
|
241
|
+
let t1;
|
|
242
|
+
if ($[4] !== className) {
|
|
243
|
+
t1 = mergeBaseClassName("context__trigger", className);
|
|
244
|
+
$[4] = className;
|
|
245
|
+
$[5] = t1;
|
|
246
|
+
} else t1 = $[5];
|
|
247
|
+
let t2;
|
|
248
|
+
if ($[6] !== hasContent || $[7] !== percent) {
|
|
249
|
+
t2 = hasContent ? void 0 : `Context usage: ${percent.toFixed(0)}%`;
|
|
250
|
+
$[6] = hasContent;
|
|
251
|
+
$[7] = percent;
|
|
252
|
+
$[8] = t2;
|
|
253
|
+
} else t2 = $[8];
|
|
254
|
+
let t3;
|
|
255
|
+
if ($[9] !== children || $[10] !== hasContent || $[11] !== percent) {
|
|
256
|
+
t3 = hasContent ? children : /* @__PURE__ */ jsx(ProgressRing, {
|
|
257
|
+
percent,
|
|
258
|
+
size: 16,
|
|
259
|
+
stroke: 2.5
|
|
260
|
+
});
|
|
261
|
+
$[9] = children;
|
|
262
|
+
$[10] = hasContent;
|
|
263
|
+
$[11] = percent;
|
|
264
|
+
$[12] = t3;
|
|
265
|
+
} else t3 = $[12];
|
|
266
|
+
let t4;
|
|
267
|
+
if ($[13] !== props || $[14] !== t1 || $[15] !== t2 || $[16] !== t3) {
|
|
268
|
+
t4 = /* @__PURE__ */ jsx(Popover.Trigger, {
|
|
269
|
+
unstyled: true,
|
|
270
|
+
className: t1,
|
|
271
|
+
"aria-label": t2,
|
|
272
|
+
...props,
|
|
273
|
+
children: t3
|
|
274
|
+
});
|
|
275
|
+
$[13] = props;
|
|
276
|
+
$[14] = t1;
|
|
277
|
+
$[15] = t2;
|
|
278
|
+
$[16] = t3;
|
|
279
|
+
$[17] = t4;
|
|
280
|
+
} else t4 = $[17];
|
|
281
|
+
return t4;
|
|
282
|
+
}
|
|
283
|
+
function ContextContent(t0) {
|
|
284
|
+
const $ = c(14);
|
|
285
|
+
let children;
|
|
286
|
+
let className;
|
|
287
|
+
let props;
|
|
288
|
+
let t1;
|
|
289
|
+
if ($[0] !== t0) {
|
|
290
|
+
({className, side: t1, children, ...props} = t0);
|
|
291
|
+
$[0] = t0;
|
|
292
|
+
$[1] = children;
|
|
293
|
+
$[2] = className;
|
|
294
|
+
$[3] = props;
|
|
295
|
+
$[4] = t1;
|
|
296
|
+
} else {
|
|
297
|
+
children = $[1];
|
|
298
|
+
className = $[2];
|
|
299
|
+
props = $[3];
|
|
300
|
+
t1 = $[4];
|
|
301
|
+
}
|
|
302
|
+
const side = t1 === void 0 ? "top" : t1;
|
|
303
|
+
let t2;
|
|
304
|
+
if ($[5] !== className) {
|
|
305
|
+
t2 = cx("context__content", className);
|
|
306
|
+
$[5] = className;
|
|
307
|
+
$[6] = t2;
|
|
308
|
+
} else t2 = $[6];
|
|
309
|
+
let t3;
|
|
310
|
+
if ($[7] !== children || $[8] !== props || $[9] !== t2) {
|
|
311
|
+
t3 = /* @__PURE__ */ jsx(Popover.Popup, {
|
|
312
|
+
"aria-label": "Context usage",
|
|
313
|
+
className: t2,
|
|
314
|
+
...props,
|
|
315
|
+
children
|
|
316
|
+
});
|
|
317
|
+
$[7] = children;
|
|
318
|
+
$[8] = props;
|
|
319
|
+
$[9] = t2;
|
|
320
|
+
$[10] = t3;
|
|
321
|
+
} else t3 = $[10];
|
|
322
|
+
let t4;
|
|
323
|
+
if ($[11] !== side || $[12] !== t3) {
|
|
324
|
+
t4 = /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
325
|
+
side,
|
|
326
|
+
children: t3
|
|
327
|
+
}) });
|
|
328
|
+
$[11] = side;
|
|
329
|
+
$[12] = t3;
|
|
330
|
+
$[13] = t4;
|
|
331
|
+
} else t4 = $[13];
|
|
332
|
+
return t4;
|
|
333
|
+
}
|
|
334
|
+
function ContextContentHeader(t0) {
|
|
335
|
+
const $ = c(42);
|
|
336
|
+
let children;
|
|
337
|
+
let className;
|
|
338
|
+
let props;
|
|
339
|
+
let ref;
|
|
340
|
+
if ($[0] !== t0) {
|
|
341
|
+
({className, children, ref, ...props} = t0);
|
|
342
|
+
$[0] = t0;
|
|
343
|
+
$[1] = children;
|
|
344
|
+
$[2] = className;
|
|
345
|
+
$[3] = props;
|
|
346
|
+
$[4] = ref;
|
|
347
|
+
} else {
|
|
348
|
+
children = $[1];
|
|
349
|
+
className = $[2];
|
|
350
|
+
props = $[3];
|
|
351
|
+
ref = $[4];
|
|
352
|
+
}
|
|
353
|
+
const { usedTokens, maxTokens, modelId } = useContextContext();
|
|
354
|
+
const percent = maxTokens > 0 ? usedTokens / maxTokens * 100 : 0;
|
|
355
|
+
if (children) {
|
|
356
|
+
let t1;
|
|
357
|
+
if ($[5] !== className) {
|
|
358
|
+
t1 = cx("context__header", className);
|
|
359
|
+
$[5] = className;
|
|
360
|
+
$[6] = t1;
|
|
361
|
+
} else t1 = $[6];
|
|
362
|
+
let t2;
|
|
363
|
+
if ($[7] !== children || $[8] !== props || $[9] !== ref || $[10] !== t1) {
|
|
364
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
365
|
+
ref,
|
|
366
|
+
className: t1,
|
|
367
|
+
...props,
|
|
368
|
+
children
|
|
369
|
+
});
|
|
370
|
+
$[7] = children;
|
|
371
|
+
$[8] = props;
|
|
372
|
+
$[9] = ref;
|
|
373
|
+
$[10] = t1;
|
|
374
|
+
$[11] = t2;
|
|
375
|
+
} else t2 = $[11];
|
|
376
|
+
return t2;
|
|
377
|
+
}
|
|
378
|
+
let t1;
|
|
379
|
+
if ($[12] !== className) {
|
|
380
|
+
t1 = cx("context__header", className);
|
|
381
|
+
$[12] = className;
|
|
382
|
+
$[13] = t1;
|
|
383
|
+
} else t1 = $[13];
|
|
384
|
+
let t2;
|
|
385
|
+
if ($[14] !== percent) {
|
|
386
|
+
t2 = /* @__PURE__ */ jsx(ProgressRing, {
|
|
387
|
+
percent,
|
|
388
|
+
size: 48,
|
|
389
|
+
stroke: 6
|
|
390
|
+
});
|
|
391
|
+
$[14] = percent;
|
|
392
|
+
$[15] = t2;
|
|
393
|
+
} else t2 = $[15];
|
|
394
|
+
let t3;
|
|
395
|
+
if ($[16] !== percent) {
|
|
396
|
+
t3 = percent.toFixed(0);
|
|
397
|
+
$[16] = percent;
|
|
398
|
+
$[17] = t3;
|
|
399
|
+
} else t3 = $[17];
|
|
400
|
+
let t4;
|
|
401
|
+
if ($[18] !== t3) {
|
|
402
|
+
t4 = /* @__PURE__ */ jsxs("div", {
|
|
403
|
+
className: "context__ring-label",
|
|
404
|
+
children: [t3, "%"]
|
|
405
|
+
});
|
|
406
|
+
$[18] = t3;
|
|
407
|
+
$[19] = t4;
|
|
408
|
+
} else t4 = $[19];
|
|
409
|
+
let t5;
|
|
410
|
+
if ($[20] !== t2 || $[21] !== t4) {
|
|
411
|
+
t5 = /* @__PURE__ */ jsxs("div", {
|
|
412
|
+
className: "context__ring",
|
|
413
|
+
"aria-hidden": "true",
|
|
414
|
+
children: [t2, t4]
|
|
415
|
+
});
|
|
416
|
+
$[20] = t2;
|
|
417
|
+
$[21] = t4;
|
|
418
|
+
$[22] = t5;
|
|
419
|
+
} else t5 = $[22];
|
|
420
|
+
let t6;
|
|
421
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
422
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
423
|
+
className: "context__header-title",
|
|
424
|
+
children: "Context usage"
|
|
425
|
+
});
|
|
426
|
+
$[23] = t6;
|
|
427
|
+
} else t6 = $[23];
|
|
428
|
+
let t7;
|
|
429
|
+
if ($[24] !== usedTokens) {
|
|
430
|
+
t7 = usedTokens.toLocaleString();
|
|
431
|
+
$[24] = usedTokens;
|
|
432
|
+
$[25] = t7;
|
|
433
|
+
} else t7 = $[25];
|
|
434
|
+
let t8;
|
|
435
|
+
if ($[26] !== maxTokens) {
|
|
436
|
+
t8 = maxTokens.toLocaleString();
|
|
437
|
+
$[26] = maxTokens;
|
|
438
|
+
$[27] = t8;
|
|
439
|
+
} else t8 = $[27];
|
|
440
|
+
let t9;
|
|
441
|
+
if ($[28] !== t7 || $[29] !== t8) {
|
|
442
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
443
|
+
className: "context__header-meta",
|
|
444
|
+
children: [
|
|
445
|
+
t7,
|
|
446
|
+
" / ",
|
|
447
|
+
t8,
|
|
448
|
+
" tokens"
|
|
449
|
+
]
|
|
450
|
+
});
|
|
451
|
+
$[28] = t7;
|
|
452
|
+
$[29] = t8;
|
|
453
|
+
$[30] = t9;
|
|
454
|
+
} else t9 = $[30];
|
|
455
|
+
let t10;
|
|
456
|
+
if ($[31] !== modelId) {
|
|
457
|
+
t10 = modelId ? /* @__PURE__ */ jsx("div", {
|
|
458
|
+
className: "context__header-model",
|
|
459
|
+
children: modelId
|
|
460
|
+
}) : null;
|
|
461
|
+
$[31] = modelId;
|
|
462
|
+
$[32] = t10;
|
|
463
|
+
} else t10 = $[32];
|
|
464
|
+
let t11;
|
|
465
|
+
if ($[33] !== t10 || $[34] !== t9) {
|
|
466
|
+
t11 = /* @__PURE__ */ jsxs("div", {
|
|
467
|
+
className: "context__header-text",
|
|
468
|
+
children: [
|
|
469
|
+
t6,
|
|
470
|
+
t9,
|
|
471
|
+
t10
|
|
472
|
+
]
|
|
473
|
+
});
|
|
474
|
+
$[33] = t10;
|
|
475
|
+
$[34] = t9;
|
|
476
|
+
$[35] = t11;
|
|
477
|
+
} else t11 = $[35];
|
|
478
|
+
let t12;
|
|
479
|
+
if ($[36] !== props || $[37] !== ref || $[38] !== t1 || $[39] !== t11 || $[40] !== t5) {
|
|
480
|
+
t12 = /* @__PURE__ */ jsxs("div", {
|
|
481
|
+
ref,
|
|
482
|
+
className: t1,
|
|
483
|
+
...props,
|
|
484
|
+
children: [t5, t11]
|
|
485
|
+
});
|
|
486
|
+
$[36] = props;
|
|
487
|
+
$[37] = ref;
|
|
488
|
+
$[38] = t1;
|
|
489
|
+
$[39] = t11;
|
|
490
|
+
$[40] = t5;
|
|
491
|
+
$[41] = t12;
|
|
492
|
+
} else t12 = $[41];
|
|
493
|
+
return t12;
|
|
494
|
+
}
|
|
495
|
+
function ContextContentBody(t0) {
|
|
496
|
+
const $ = c(34);
|
|
497
|
+
let children;
|
|
498
|
+
let className;
|
|
499
|
+
let props;
|
|
500
|
+
let ref;
|
|
501
|
+
if ($[0] !== t0) {
|
|
502
|
+
({className, children, ref, ...props} = t0);
|
|
503
|
+
$[0] = t0;
|
|
504
|
+
$[1] = children;
|
|
505
|
+
$[2] = className;
|
|
506
|
+
$[3] = props;
|
|
507
|
+
$[4] = ref;
|
|
508
|
+
} else {
|
|
509
|
+
children = $[1];
|
|
510
|
+
className = $[2];
|
|
511
|
+
props = $[3];
|
|
512
|
+
ref = $[4];
|
|
513
|
+
}
|
|
514
|
+
const { usage } = useContextContext();
|
|
515
|
+
if (children) {
|
|
516
|
+
let t1;
|
|
517
|
+
if ($[5] !== className) {
|
|
518
|
+
t1 = cx("context__body", className);
|
|
519
|
+
$[5] = className;
|
|
520
|
+
$[6] = t1;
|
|
521
|
+
} else t1 = $[6];
|
|
522
|
+
let t2;
|
|
523
|
+
if ($[7] !== children || $[8] !== props || $[9] !== ref || $[10] !== t1) {
|
|
524
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
525
|
+
ref,
|
|
526
|
+
className: t1,
|
|
527
|
+
...props,
|
|
528
|
+
children
|
|
529
|
+
});
|
|
530
|
+
$[7] = children;
|
|
531
|
+
$[8] = props;
|
|
532
|
+
$[9] = ref;
|
|
533
|
+
$[10] = t1;
|
|
534
|
+
$[11] = t2;
|
|
535
|
+
} else t2 = $[11];
|
|
536
|
+
return t2;
|
|
537
|
+
}
|
|
538
|
+
let t1;
|
|
539
|
+
let t2;
|
|
540
|
+
let t3;
|
|
541
|
+
let t4;
|
|
542
|
+
let t5;
|
|
543
|
+
let t6;
|
|
544
|
+
if ($[12] !== className || $[13] !== props || $[14] !== ref || $[15] !== usage) {
|
|
545
|
+
const rows = [];
|
|
546
|
+
const inputTokens = getUsageTokens(usage, "input");
|
|
547
|
+
const outputTokens = getUsageTokens(usage, "output");
|
|
548
|
+
const reasoningTokens = getUsageTokens(usage, "reasoning");
|
|
549
|
+
const cacheTokens = getUsageTokens(usage, "cache");
|
|
550
|
+
if (inputTokens !== void 0) rows.push({
|
|
551
|
+
label: "Input",
|
|
552
|
+
tokens: inputTokens
|
|
553
|
+
});
|
|
554
|
+
if (outputTokens !== void 0) rows.push({
|
|
555
|
+
label: "Output",
|
|
556
|
+
tokens: outputTokens
|
|
557
|
+
});
|
|
558
|
+
if (reasoningTokens !== void 0) rows.push({
|
|
559
|
+
label: "Reasoning",
|
|
560
|
+
tokens: reasoningTokens
|
|
561
|
+
});
|
|
562
|
+
if (cacheTokens !== void 0) rows.push({
|
|
563
|
+
label: "Cached input",
|
|
564
|
+
tokens: cacheTokens
|
|
565
|
+
});
|
|
566
|
+
t3 = ref;
|
|
567
|
+
if ($[22] !== className) {
|
|
568
|
+
t4 = cx("context__body", className);
|
|
569
|
+
$[22] = className;
|
|
570
|
+
$[23] = t4;
|
|
571
|
+
} else t4 = $[23];
|
|
572
|
+
t5 = props;
|
|
573
|
+
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
574
|
+
t6 = /* @__PURE__ */ jsx(Separator, {});
|
|
575
|
+
$[24] = t6;
|
|
576
|
+
} else t6 = $[24];
|
|
577
|
+
t1 = "context__rows";
|
|
578
|
+
t2 = rows.map(_temp);
|
|
579
|
+
$[12] = className;
|
|
580
|
+
$[13] = props;
|
|
581
|
+
$[14] = ref;
|
|
582
|
+
$[15] = usage;
|
|
583
|
+
$[16] = t1;
|
|
584
|
+
$[17] = t2;
|
|
585
|
+
$[18] = t3;
|
|
586
|
+
$[19] = t4;
|
|
587
|
+
$[20] = t5;
|
|
588
|
+
$[21] = t6;
|
|
589
|
+
} else {
|
|
590
|
+
t1 = $[16];
|
|
591
|
+
t2 = $[17];
|
|
592
|
+
t3 = $[18];
|
|
593
|
+
t4 = $[19];
|
|
594
|
+
t5 = $[20];
|
|
595
|
+
t6 = $[21];
|
|
596
|
+
}
|
|
597
|
+
let t7;
|
|
598
|
+
if ($[25] !== t1 || $[26] !== t2) {
|
|
599
|
+
t7 = /* @__PURE__ */ jsx("ul", {
|
|
600
|
+
className: t1,
|
|
601
|
+
children: t2
|
|
602
|
+
});
|
|
603
|
+
$[25] = t1;
|
|
604
|
+
$[26] = t2;
|
|
605
|
+
$[27] = t7;
|
|
606
|
+
} else t7 = $[27];
|
|
607
|
+
let t8;
|
|
608
|
+
if ($[28] !== t3 || $[29] !== t4 || $[30] !== t5 || $[31] !== t6 || $[32] !== t7) {
|
|
609
|
+
t8 = /* @__PURE__ */ jsxs("div", {
|
|
610
|
+
ref: t3,
|
|
611
|
+
className: t4,
|
|
612
|
+
...t5,
|
|
613
|
+
children: [t6, t7]
|
|
614
|
+
});
|
|
615
|
+
$[28] = t3;
|
|
616
|
+
$[29] = t4;
|
|
617
|
+
$[30] = t5;
|
|
618
|
+
$[31] = t6;
|
|
619
|
+
$[32] = t7;
|
|
620
|
+
$[33] = t8;
|
|
621
|
+
} else t8 = $[33];
|
|
622
|
+
return t8;
|
|
623
|
+
}
|
|
624
|
+
function _temp(row) {
|
|
625
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
626
|
+
className: "context__row",
|
|
627
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
628
|
+
className: "context__row-label",
|
|
629
|
+
children: row.label
|
|
630
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
631
|
+
className: "context__row-value",
|
|
632
|
+
children: row.tokens.toLocaleString()
|
|
633
|
+
})]
|
|
634
|
+
}, row.label);
|
|
635
|
+
}
|
|
636
|
+
function ContextContentFooter(t0) {
|
|
637
|
+
const $ = c(22);
|
|
638
|
+
let children;
|
|
639
|
+
let className;
|
|
640
|
+
let props;
|
|
641
|
+
let ref;
|
|
642
|
+
if ($[0] !== t0) {
|
|
643
|
+
({className, children, ref, ...props} = t0);
|
|
644
|
+
$[0] = t0;
|
|
645
|
+
$[1] = children;
|
|
646
|
+
$[2] = className;
|
|
647
|
+
$[3] = props;
|
|
648
|
+
$[4] = ref;
|
|
649
|
+
} else {
|
|
650
|
+
children = $[1];
|
|
651
|
+
className = $[2];
|
|
652
|
+
props = $[3];
|
|
653
|
+
ref = $[4];
|
|
654
|
+
}
|
|
655
|
+
const { totalCostUsd } = useContextContext();
|
|
656
|
+
if (children) {
|
|
657
|
+
let t1;
|
|
658
|
+
if ($[5] !== className) {
|
|
659
|
+
t1 = cx("context__footer", className);
|
|
660
|
+
$[5] = className;
|
|
661
|
+
$[6] = t1;
|
|
662
|
+
} else t1 = $[6];
|
|
663
|
+
let t2;
|
|
664
|
+
if ($[7] !== children || $[8] !== props || $[9] !== ref || $[10] !== t1) {
|
|
665
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
666
|
+
ref,
|
|
667
|
+
className: t1,
|
|
668
|
+
...props,
|
|
669
|
+
children
|
|
670
|
+
});
|
|
671
|
+
$[7] = children;
|
|
672
|
+
$[8] = props;
|
|
673
|
+
$[9] = ref;
|
|
674
|
+
$[10] = t1;
|
|
675
|
+
$[11] = t2;
|
|
676
|
+
} else t2 = $[11];
|
|
677
|
+
return t2;
|
|
678
|
+
}
|
|
679
|
+
let t1;
|
|
680
|
+
if ($[12] !== className) {
|
|
681
|
+
t1 = cx("context__footer", className);
|
|
682
|
+
$[12] = className;
|
|
683
|
+
$[13] = t1;
|
|
684
|
+
} else t1 = $[13];
|
|
685
|
+
let t2;
|
|
686
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
687
|
+
t2 = /* @__PURE__ */ jsx(Separator, {});
|
|
688
|
+
$[14] = t2;
|
|
689
|
+
} else t2 = $[14];
|
|
690
|
+
let t3;
|
|
691
|
+
if ($[15] !== totalCostUsd) {
|
|
692
|
+
t3 = totalCostUsd !== void 0 ? /* @__PURE__ */ jsxs("div", {
|
|
693
|
+
className: "context__footer-row",
|
|
694
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Total" }), /* @__PURE__ */ jsxs("span", {
|
|
695
|
+
className: "context__footer-cost",
|
|
696
|
+
children: ["$", totalCostUsd.toFixed(4)]
|
|
697
|
+
})]
|
|
698
|
+
}) : null;
|
|
699
|
+
$[15] = totalCostUsd;
|
|
700
|
+
$[16] = t3;
|
|
701
|
+
} else t3 = $[16];
|
|
702
|
+
let t4;
|
|
703
|
+
if ($[17] !== props || $[18] !== ref || $[19] !== t1 || $[20] !== t3) {
|
|
704
|
+
t4 = /* @__PURE__ */ jsxs("div", {
|
|
705
|
+
ref,
|
|
706
|
+
className: t1,
|
|
707
|
+
...props,
|
|
708
|
+
children: [t2, t3]
|
|
709
|
+
});
|
|
710
|
+
$[17] = props;
|
|
711
|
+
$[18] = ref;
|
|
712
|
+
$[19] = t1;
|
|
713
|
+
$[20] = t3;
|
|
714
|
+
$[21] = t4;
|
|
715
|
+
} else t4 = $[21];
|
|
716
|
+
return t4;
|
|
717
|
+
}
|
|
718
|
+
function ContextInputUsage(props) {
|
|
719
|
+
const $ = c(2);
|
|
720
|
+
let t0;
|
|
721
|
+
if ($[0] !== props) {
|
|
722
|
+
t0 = /* @__PURE__ */ jsx(ContextUsageRow, {
|
|
723
|
+
usageKey: "input",
|
|
724
|
+
defaultLabel: "Input",
|
|
725
|
+
...props
|
|
726
|
+
});
|
|
727
|
+
$[0] = props;
|
|
728
|
+
$[1] = t0;
|
|
729
|
+
} else t0 = $[1];
|
|
730
|
+
return t0;
|
|
731
|
+
}
|
|
732
|
+
function ContextOutputUsage(props) {
|
|
733
|
+
const $ = c(2);
|
|
734
|
+
let t0;
|
|
735
|
+
if ($[0] !== props) {
|
|
736
|
+
t0 = /* @__PURE__ */ jsx(ContextUsageRow, {
|
|
737
|
+
usageKey: "output",
|
|
738
|
+
defaultLabel: "Output",
|
|
739
|
+
...props
|
|
740
|
+
});
|
|
741
|
+
$[0] = props;
|
|
742
|
+
$[1] = t0;
|
|
743
|
+
} else t0 = $[1];
|
|
744
|
+
return t0;
|
|
745
|
+
}
|
|
746
|
+
function ContextReasoningUsage(props) {
|
|
747
|
+
const $ = c(2);
|
|
748
|
+
let t0;
|
|
749
|
+
if ($[0] !== props) {
|
|
750
|
+
t0 = /* @__PURE__ */ jsx(ContextUsageRow, {
|
|
751
|
+
usageKey: "reasoning",
|
|
752
|
+
defaultLabel: "Reasoning",
|
|
753
|
+
...props
|
|
754
|
+
});
|
|
755
|
+
$[0] = props;
|
|
756
|
+
$[1] = t0;
|
|
757
|
+
} else t0 = $[1];
|
|
758
|
+
return t0;
|
|
759
|
+
}
|
|
760
|
+
function ContextCacheUsage(props) {
|
|
761
|
+
const $ = c(2);
|
|
762
|
+
let t0;
|
|
763
|
+
if ($[0] !== props) {
|
|
764
|
+
t0 = /* @__PURE__ */ jsx(ContextUsageRow, {
|
|
765
|
+
usageKey: "cache",
|
|
766
|
+
defaultLabel: "Cached input",
|
|
767
|
+
...props
|
|
768
|
+
});
|
|
769
|
+
$[0] = props;
|
|
770
|
+
$[1] = t0;
|
|
771
|
+
} else t0 = $[1];
|
|
772
|
+
return t0;
|
|
773
|
+
}
|
|
774
|
+
function ContextUsageRow(t0) {
|
|
775
|
+
const $ = c(36);
|
|
776
|
+
let children;
|
|
777
|
+
let className;
|
|
778
|
+
let defaultLabel;
|
|
779
|
+
let label;
|
|
780
|
+
let props;
|
|
781
|
+
let ref;
|
|
782
|
+
let usageKey;
|
|
783
|
+
if ($[0] !== t0) {
|
|
784
|
+
({className, children, label, usageKey, defaultLabel, ref, ...props} = t0);
|
|
785
|
+
$[0] = t0;
|
|
786
|
+
$[1] = children;
|
|
787
|
+
$[2] = className;
|
|
788
|
+
$[3] = defaultLabel;
|
|
789
|
+
$[4] = label;
|
|
790
|
+
$[5] = props;
|
|
791
|
+
$[6] = ref;
|
|
792
|
+
$[7] = usageKey;
|
|
793
|
+
} else {
|
|
794
|
+
children = $[1];
|
|
795
|
+
className = $[2];
|
|
796
|
+
defaultLabel = $[3];
|
|
797
|
+
label = $[4];
|
|
798
|
+
props = $[5];
|
|
799
|
+
ref = $[6];
|
|
800
|
+
usageKey = $[7];
|
|
801
|
+
}
|
|
802
|
+
const { usage } = useContextContext();
|
|
803
|
+
let t1;
|
|
804
|
+
let t2;
|
|
805
|
+
let t3;
|
|
806
|
+
let t4;
|
|
807
|
+
let t5;
|
|
808
|
+
let t6;
|
|
809
|
+
let t7;
|
|
810
|
+
if ($[8] !== children || $[9] !== className || $[10] !== defaultLabel || $[11] !== label || $[12] !== props || $[13] !== ref || $[14] !== usage || $[15] !== usageKey) {
|
|
811
|
+
t7 = Symbol.for("react.early_return_sentinel");
|
|
812
|
+
bb0: {
|
|
813
|
+
const tokens = getUsageTokens(usage, usageKey) ?? 0;
|
|
814
|
+
if (children) {
|
|
815
|
+
t7 = children;
|
|
816
|
+
break bb0;
|
|
817
|
+
}
|
|
818
|
+
if (!tokens) {
|
|
819
|
+
t7 = null;
|
|
820
|
+
break bb0;
|
|
821
|
+
}
|
|
822
|
+
t3 = ref;
|
|
823
|
+
if ($[23] !== className) {
|
|
824
|
+
t4 = cx("context__row", className);
|
|
825
|
+
$[23] = className;
|
|
826
|
+
$[24] = t4;
|
|
827
|
+
} else t4 = $[24];
|
|
828
|
+
t5 = props;
|
|
829
|
+
const t8 = label ?? defaultLabel;
|
|
830
|
+
if ($[25] !== t8) {
|
|
831
|
+
t6 = /* @__PURE__ */ jsx("span", {
|
|
832
|
+
className: "context__row-label",
|
|
833
|
+
children: t8
|
|
834
|
+
});
|
|
835
|
+
$[25] = t8;
|
|
836
|
+
$[26] = t6;
|
|
837
|
+
} else t6 = $[26];
|
|
838
|
+
t1 = "context__row-value";
|
|
839
|
+
t2 = tokens.toLocaleString();
|
|
840
|
+
}
|
|
841
|
+
$[8] = children;
|
|
842
|
+
$[9] = className;
|
|
843
|
+
$[10] = defaultLabel;
|
|
844
|
+
$[11] = label;
|
|
845
|
+
$[12] = props;
|
|
846
|
+
$[13] = ref;
|
|
847
|
+
$[14] = usage;
|
|
848
|
+
$[15] = usageKey;
|
|
849
|
+
$[16] = t1;
|
|
850
|
+
$[17] = t2;
|
|
851
|
+
$[18] = t3;
|
|
852
|
+
$[19] = t4;
|
|
853
|
+
$[20] = t5;
|
|
854
|
+
$[21] = t6;
|
|
855
|
+
$[22] = t7;
|
|
856
|
+
} else {
|
|
857
|
+
t1 = $[16];
|
|
858
|
+
t2 = $[17];
|
|
859
|
+
t3 = $[18];
|
|
860
|
+
t4 = $[19];
|
|
861
|
+
t5 = $[20];
|
|
862
|
+
t6 = $[21];
|
|
863
|
+
t7 = $[22];
|
|
864
|
+
}
|
|
865
|
+
if (t7 !== Symbol.for("react.early_return_sentinel")) return t7;
|
|
866
|
+
let t8;
|
|
867
|
+
if ($[27] !== t1 || $[28] !== t2) {
|
|
868
|
+
t8 = /* @__PURE__ */ jsx("span", {
|
|
869
|
+
className: t1,
|
|
870
|
+
children: t2
|
|
871
|
+
});
|
|
872
|
+
$[27] = t1;
|
|
873
|
+
$[28] = t2;
|
|
874
|
+
$[29] = t8;
|
|
875
|
+
} else t8 = $[29];
|
|
876
|
+
let t9;
|
|
877
|
+
if ($[30] !== t3 || $[31] !== t4 || $[32] !== t5 || $[33] !== t6 || $[34] !== t8) {
|
|
878
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
879
|
+
ref: t3,
|
|
880
|
+
className: t4,
|
|
881
|
+
...t5,
|
|
882
|
+
children: [t6, t8]
|
|
883
|
+
});
|
|
884
|
+
$[30] = t3;
|
|
885
|
+
$[31] = t4;
|
|
886
|
+
$[32] = t5;
|
|
887
|
+
$[33] = t6;
|
|
888
|
+
$[34] = t8;
|
|
889
|
+
$[35] = t9;
|
|
890
|
+
} else t9 = $[35];
|
|
891
|
+
return t9;
|
|
892
|
+
}
|
|
893
|
+
function getUsageTokens(usage, key) {
|
|
894
|
+
if (!usage) return void 0;
|
|
895
|
+
if (key === "input") return usage.inputTokens;
|
|
896
|
+
if (key === "output") return usage.outputTokens;
|
|
897
|
+
if (key === "reasoning") return usage.outputTokenDetails?.reasoningTokens;
|
|
898
|
+
return usage.inputTokenDetails?.cacheReadTokens;
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* Latest `metadata.usage` in a transcript — the AI SDK convention for token
|
|
902
|
+
* accounting (`toUIMessageStreamResponse({ messageMetadata })`), which Think
|
|
903
|
+
* merges into `message.metadata` as turns finish. Structural: any message
|
|
904
|
+
* whose metadata carries a `usage` object qualifies.
|
|
905
|
+
*/
|
|
906
|
+
function getContextUsage(messages) {
|
|
907
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
908
|
+
const usage = messages[i].metadata?.usage;
|
|
909
|
+
if (usage && typeof usage === "object") return usage;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
/** Tokens occupying the context window: `totalTokens`, or input + output. */
|
|
913
|
+
function getContextUsedTokens(usage) {
|
|
914
|
+
if (!usage) return 0;
|
|
915
|
+
return usage.totalTokens ?? (usage.inputTokens ?? 0) + (usage.outputTokens ?? 0);
|
|
916
|
+
}
|
|
917
|
+
//#endregion
|
|
918
|
+
export { ContextContentFooter as a, ContextOutputUsage as c, getContextUsage as d, getContextUsedTokens as f, ContextContentBody as i, ContextReasoningUsage as l, ContextCacheUsage as n, ContextContentHeader as o, ContextContent as r, ContextInputUsage as s, Context as t, ContextTrigger as u };
|