@nexface/chat 0.1.20-alpha.0 → 0.1.20
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/assistant-components.js +3 -8
- package/dist/default-chat.d.ts +1 -1
- package/dist/default-chat.js +299 -536
- package/dist/protocol-messages.js +6 -1
- package/dist/react.d.ts +0 -5
- package/dist/react.js +6 -26
- package/dist/styles.css +677 -1482
- package/dist/tool-result.d.ts +0 -5
- package/dist/tool-result.js +0 -31
- package/dist/types.d.ts +1 -3
- package/dist/ui/home-demo/greeting.d.ts +1 -3
- package/dist/ui/home-demo/greeting.js +2 -2
- package/dist/ui/home-demo/suggestions.d.ts +4 -2
- package/dist/ui/home-demo/suggestions.js +4 -4
- package/dist/ui/home-demo/trace.js +3 -2
- package/package.json +3 -3
- package/dist/fonts/Inter-OFL.txt +0 -93
- package/dist/fonts/inter-medium.ttf +0 -0
- package/dist/shared/tool-presentation.d.ts +0 -16
- package/dist/shared/tool-presentation.js +0 -5
- package/dist/tool-presentation.d.ts +0 -6
- package/dist/tool-presentation.js +0 -70
package/dist/default-chat.js
CHANGED
|
@@ -7887,7 +7887,7 @@ var getGroupStatus = (parts) => {
|
|
|
7887
7887
|
return parts.at(-1)?.status ?? COMPLETE_STATUS;
|
|
7888
7888
|
};
|
|
7889
7889
|
var getGroupSummary = (parts, indices) => {
|
|
7890
|
-
const
|
|
7890
|
+
const counts = {
|
|
7891
7891
|
running: 0,
|
|
7892
7892
|
complete: 0,
|
|
7893
7893
|
incomplete: 0,
|
|
@@ -7899,22 +7899,22 @@ var getGroupSummary = (parts, indices) => {
|
|
|
7899
7899
|
status = parts[index5]?.status ?? COMPLETE_STATUS;
|
|
7900
7900
|
switch (status.type) {
|
|
7901
7901
|
case "running":
|
|
7902
|
-
|
|
7902
|
+
counts.running++;
|
|
7903
7903
|
isRunning = true;
|
|
7904
7904
|
break;
|
|
7905
7905
|
case "complete":
|
|
7906
|
-
|
|
7906
|
+
counts.complete++;
|
|
7907
7907
|
break;
|
|
7908
7908
|
case "incomplete":
|
|
7909
|
-
|
|
7909
|
+
counts.incomplete++;
|
|
7910
7910
|
break;
|
|
7911
7911
|
case "requires-action":
|
|
7912
|
-
|
|
7912
|
+
counts.requiresAction++;
|
|
7913
7913
|
}
|
|
7914
7914
|
}
|
|
7915
7915
|
return {
|
|
7916
7916
|
status: isRunning ? RUNNING_STATUS : status,
|
|
7917
|
-
counts
|
|
7917
|
+
counts
|
|
7918
7918
|
};
|
|
7919
7919
|
};
|
|
7920
7920
|
|
|
@@ -12173,11 +12173,11 @@ var ThreadMessageComponent = (t0) => {
|
|
|
12173
12173
|
$[2] = role;
|
|
12174
12174
|
$[3] = t1;
|
|
12175
12175
|
} else t1 = $[3];
|
|
12176
|
-
const
|
|
12176
|
+
const Component = t1;
|
|
12177
12177
|
let t2;
|
|
12178
|
-
if ($[4] !==
|
|
12179
|
-
t2 = /* @__PURE__ */ jsx10(
|
|
12180
|
-
$[4] =
|
|
12178
|
+
if ($[4] !== Component) {
|
|
12179
|
+
t2 = /* @__PURE__ */ jsx10(Component, {});
|
|
12180
|
+
$[4] = Component;
|
|
12181
12181
|
$[5] = t2;
|
|
12182
12182
|
} else t2 = $[5];
|
|
12183
12183
|
return t2;
|
|
@@ -12778,16 +12778,16 @@ var MessagePrimitivePartByIndex = memo((t0) => {
|
|
|
12778
12778
|
MessagePrimitivePartByIndex.displayName = "MessagePrimitive.PartByIndex";
|
|
12779
12779
|
var EmptyPartFallback = (t0) => {
|
|
12780
12780
|
const $ = c(6);
|
|
12781
|
-
const { status, component:
|
|
12781
|
+
const { status, component: Component } = t0;
|
|
12782
12782
|
const t1 = status.type === "running";
|
|
12783
12783
|
let t2;
|
|
12784
|
-
if ($[0] !==
|
|
12785
|
-
t2 = /* @__PURE__ */ jsx12(
|
|
12784
|
+
if ($[0] !== Component || $[1] !== status) {
|
|
12785
|
+
t2 = /* @__PURE__ */ jsx12(Component, {
|
|
12786
12786
|
type: "text",
|
|
12787
12787
|
text: "",
|
|
12788
12788
|
status
|
|
12789
12789
|
});
|
|
12790
|
-
$[0] =
|
|
12790
|
+
$[0] = Component;
|
|
12791
12791
|
$[1] = status;
|
|
12792
12792
|
$[2] = t2;
|
|
12793
12793
|
} else t2 = $[2];
|
|
@@ -13324,11 +13324,11 @@ var renderNode2 = (node2, parts, render) => {
|
|
|
13324
13324
|
children: /* @__PURE__ */ jsx13(PartChildrenSentinel, {})
|
|
13325
13325
|
})
|
|
13326
13326
|
}, node2.idKey ? `part-${node2.idKey}` : `part-${node2.index}`);
|
|
13327
|
-
const { status, counts
|
|
13327
|
+
const { status, counts } = getGroupSummary(parts, node2.indices);
|
|
13328
13328
|
const groupPart = {
|
|
13329
13329
|
type: node2.key,
|
|
13330
13330
|
status,
|
|
13331
|
-
counts
|
|
13331
|
+
counts,
|
|
13332
13332
|
indices: node2.indices
|
|
13333
13333
|
};
|
|
13334
13334
|
return /* @__PURE__ */ jsx13(Fragment, { children: render({
|
|
@@ -13383,12 +13383,12 @@ var AttachmentComponent = (t0) => {
|
|
|
13383
13383
|
$[1] = t1;
|
|
13384
13384
|
$[2] = t2;
|
|
13385
13385
|
} else t2 = $[2];
|
|
13386
|
-
const
|
|
13387
|
-
if (!
|
|
13386
|
+
const Component = t2;
|
|
13387
|
+
if (!Component) return null;
|
|
13388
13388
|
let t3;
|
|
13389
|
-
if ($[3] !==
|
|
13390
|
-
t3 = /* @__PURE__ */ jsx14(
|
|
13391
|
-
$[3] =
|
|
13389
|
+
if ($[3] !== Component) {
|
|
13390
|
+
t3 = /* @__PURE__ */ jsx14(Component, {});
|
|
13391
|
+
$[3] = Component;
|
|
13392
13392
|
$[4] = t3;
|
|
13393
13393
|
} else t3 = $[4];
|
|
13394
13394
|
return t3;
|
|
@@ -13438,9 +13438,9 @@ var MessagePrimitiveAttachments = (t0) => {
|
|
|
13438
13438
|
if ($[0] !== components) {
|
|
13439
13439
|
t12 = /* @__PURE__ */ jsx14(MessagePrimitiveAttachmentsInner, { children: (t2) => {
|
|
13440
13440
|
const { attachment } = t2;
|
|
13441
|
-
const
|
|
13442
|
-
if (!
|
|
13443
|
-
return /* @__PURE__ */ jsx14(
|
|
13441
|
+
const Component = getComponent2(components, attachment);
|
|
13442
|
+
if (!Component) return null;
|
|
13443
|
+
return /* @__PURE__ */ jsx14(Component, {});
|
|
13444
13444
|
} });
|
|
13445
13445
|
$[0] = components;
|
|
13446
13446
|
$[1] = t12;
|
|
@@ -13486,12 +13486,12 @@ var AttachmentComponent2 = (t0) => {
|
|
|
13486
13486
|
$[1] = components;
|
|
13487
13487
|
$[2] = t1;
|
|
13488
13488
|
} else t1 = $[2];
|
|
13489
|
-
const
|
|
13490
|
-
if (!
|
|
13489
|
+
const Component = t1;
|
|
13490
|
+
if (!Component) return null;
|
|
13491
13491
|
let t2;
|
|
13492
|
-
if ($[3] !==
|
|
13493
|
-
t2 = /* @__PURE__ */ jsx15(
|
|
13494
|
-
$[3] =
|
|
13492
|
+
if ($[3] !== Component) {
|
|
13493
|
+
t2 = /* @__PURE__ */ jsx15(Component, {});
|
|
13494
|
+
$[3] = Component;
|
|
13495
13495
|
$[4] = t2;
|
|
13496
13496
|
} else t2 = $[4];
|
|
13497
13497
|
return t2;
|
|
@@ -13538,9 +13538,9 @@ var ComposerPrimitiveAttachments = (t0) => {
|
|
|
13538
13538
|
if ($[0] !== components) {
|
|
13539
13539
|
t12 = /* @__PURE__ */ jsx15(ComposerPrimitiveAttachmentsInner, { children: (t2) => {
|
|
13540
13540
|
const { attachment } = t2;
|
|
13541
|
-
const
|
|
13542
|
-
if (!
|
|
13543
|
-
return /* @__PURE__ */ jsx15(
|
|
13541
|
+
const Component = getComponent3(components, attachment);
|
|
13542
|
+
if (!Component) return null;
|
|
13543
|
+
return /* @__PURE__ */ jsx15(Component, {});
|
|
13544
13544
|
} });
|
|
13545
13545
|
$[0] = components;
|
|
13546
13546
|
$[1] = t12;
|
|
@@ -21962,7 +21962,7 @@ function renderSlot(render, children, props) {
|
|
|
21962
21962
|
children: composeRenderElement(render, children)
|
|
21963
21963
|
});
|
|
21964
21964
|
}
|
|
21965
|
-
function withRenderProp(
|
|
21965
|
+
function withRenderProp(Component) {
|
|
21966
21966
|
const Wrapped = forwardRef((t0, ref) => {
|
|
21967
21967
|
const $ = c(17);
|
|
21968
21968
|
let asChild;
|
|
@@ -21982,7 +21982,7 @@ function withRenderProp(Component2) {
|
|
|
21982
21982
|
render = $[3];
|
|
21983
21983
|
rest = $[4];
|
|
21984
21984
|
}
|
|
21985
|
-
const Comp =
|
|
21985
|
+
const Comp = Component;
|
|
21986
21986
|
if (render && isValidElement(render)) {
|
|
21987
21987
|
const t12 = rest;
|
|
21988
21988
|
let t22;
|
|
@@ -22024,14 +22024,14 @@ function withRenderProp(Component2) {
|
|
|
22024
22024
|
} else t2 = $[16];
|
|
22025
22025
|
return t2;
|
|
22026
22026
|
});
|
|
22027
|
-
Wrapped.displayName = typeof
|
|
22027
|
+
Wrapped.displayName = typeof Component === "string" ? Component : Component.displayName ?? Component.name ?? "Component";
|
|
22028
22028
|
return Wrapped;
|
|
22029
22029
|
}
|
|
22030
22030
|
function createPrimitive(node2) {
|
|
22031
22031
|
const RadixComp = Primitive2[node2];
|
|
22032
|
-
const
|
|
22033
|
-
|
|
22034
|
-
return
|
|
22032
|
+
const Component = withRenderProp(RadixComp);
|
|
22033
|
+
Component.displayName = `Primitive.${node2}`;
|
|
22034
|
+
return Component;
|
|
22035
22035
|
}
|
|
22036
22036
|
var Primitive3 = NODES2.reduce((acc, node2) => {
|
|
22037
22037
|
acc[node2] = createPrimitive(node2);
|
|
@@ -23289,8 +23289,8 @@ var ComposerPrimitiveInput = forwardRef(({ autoFocus = false, asChild, render, d
|
|
|
23289
23289
|
...compactContext ? { onHeightChange: handleHeightChange } : onHeightChange !== void 0 ? { onHeightChange } : {}
|
|
23290
23290
|
};
|
|
23291
23291
|
if (render && isValidElement(render)) return renderSlot(render, rest.children, inputProps);
|
|
23292
|
-
const
|
|
23293
|
-
return /* @__PURE__ */ jsx47(
|
|
23292
|
+
const Component = asChild ? dist_exports.Root : index3;
|
|
23293
|
+
return /* @__PURE__ */ jsx47(Component, { ...inputProps });
|
|
23294
23294
|
});
|
|
23295
23295
|
ComposerPrimitiveInput.displayName = "ComposerPrimitive.Input";
|
|
23296
23296
|
|
|
@@ -23451,13 +23451,13 @@ var SmoothContextProvider = (t0) => {
|
|
|
23451
23451
|
} else t3 = $[5];
|
|
23452
23452
|
return t3;
|
|
23453
23453
|
};
|
|
23454
|
-
var withSmoothContextProvider = (
|
|
23454
|
+
var withSmoothContextProvider = (Component) => {
|
|
23455
23455
|
const Wrapped = forwardRef((props, ref) => {
|
|
23456
23456
|
const $ = c(3);
|
|
23457
23457
|
const t0 = props;
|
|
23458
23458
|
let t1;
|
|
23459
23459
|
if ($[0] !== ref || $[1] !== t0) {
|
|
23460
|
-
t1 = /* @__PURE__ */ jsx49(SmoothContextProvider, { children: /* @__PURE__ */ jsx49(
|
|
23460
|
+
t1 = /* @__PURE__ */ jsx49(SmoothContextProvider, { children: /* @__PURE__ */ jsx49(Component, {
|
|
23461
23461
|
...t0,
|
|
23462
23462
|
ref
|
|
23463
23463
|
}) });
|
|
@@ -23467,7 +23467,7 @@ var withSmoothContextProvider = (Component2) => {
|
|
|
23467
23467
|
} else t1 = $[2];
|
|
23468
23468
|
return t1;
|
|
23469
23469
|
});
|
|
23470
|
-
Wrapped.displayName =
|
|
23470
|
+
Wrapped.displayName = Component.displayName;
|
|
23471
23471
|
return Wrapped;
|
|
23472
23472
|
};
|
|
23473
23473
|
function useSmoothContext(options2) {
|
|
@@ -23657,7 +23657,7 @@ function _temp47(s) {
|
|
|
23657
23657
|
|
|
23658
23658
|
// ../../node_modules/.pnpm/@assistant-ui+react@0.15.21_@opentelemetry+api@1.9.0_@types+react-dom@19.2.3_@types+rea_c35c1873a3528ad63a8637c81c57a418/node_modules/@assistant-ui/react/dist/primitives/messagePart/MessagePartText.js
|
|
23659
23659
|
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
23660
|
-
var MessagePartPrimitiveText = forwardRef(({ smooth = true, component:
|
|
23660
|
+
var MessagePartPrimitiveText = forwardRef(({ smooth = true, component: Component = Primitive3.span, render, ...rest }, forwardedRef) => {
|
|
23661
23661
|
const { text: text7, status } = useSmooth(useMessagePartText(), smooth);
|
|
23662
23662
|
const mergedProps = {
|
|
23663
23663
|
"data-status": status.type,
|
|
@@ -23665,7 +23665,7 @@ var MessagePartPrimitiveText = forwardRef(({ smooth = true, component: Component
|
|
|
23665
23665
|
ref: forwardedRef
|
|
23666
23666
|
};
|
|
23667
23667
|
if (render && isValidElement(render)) return renderSlot(render, text7, mergedProps);
|
|
23668
|
-
return /* @__PURE__ */ jsx50(
|
|
23668
|
+
return /* @__PURE__ */ jsx50(Component, {
|
|
23669
23669
|
...mergedProps,
|
|
23670
23670
|
children: text7
|
|
23671
23671
|
});
|
|
@@ -25137,7 +25137,7 @@ var Icon = (0, react_compat_exports.forwardRef)(
|
|
|
25137
25137
|
|
|
25138
25138
|
// ../../node_modules/.pnpm/lucide-react@0.506.0_react@19.2.7/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
25139
25139
|
var createLucideIcon = (iconName, iconNode) => {
|
|
25140
|
-
const
|
|
25140
|
+
const Component = (0, react_compat_exports.forwardRef)(
|
|
25141
25141
|
({ className, ...props }, ref) => (0, react_compat_exports.createElement)(Icon, {
|
|
25142
25142
|
ref,
|
|
25143
25143
|
iconNode,
|
|
@@ -25149,8 +25149,8 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
|
25149
25149
|
...props
|
|
25150
25150
|
})
|
|
25151
25151
|
);
|
|
25152
|
-
|
|
25153
|
-
return
|
|
25152
|
+
Component.displayName = toPascalCase(iconName);
|
|
25153
|
+
return Component;
|
|
25154
25154
|
};
|
|
25155
25155
|
|
|
25156
25156
|
// ../../node_modules/.pnpm/lucide-react@0.506.0_react@19.2.7/node_modules/lucide-react/dist/esm/icons/arrow-up.js
|
|
@@ -29216,8 +29216,7 @@ var typeDeck = "text-muted-foreground max-w-[40ch] text-[15px] leading-relaxed t
|
|
|
29216
29216
|
import { jsx as jsx70, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
29217
29217
|
function Greeting({
|
|
29218
29218
|
title,
|
|
29219
|
-
description
|
|
29220
|
-
icon
|
|
29219
|
+
description
|
|
29221
29220
|
}) {
|
|
29222
29221
|
return /* @__PURE__ */ jsxs13(
|
|
29223
29222
|
"div",
|
|
@@ -29226,7 +29225,6 @@ function Greeting({
|
|
|
29226
29225
|
"animate-in fade-in slide-in-from-bottom-1 mx-auto mb-8 flex w-full max-w-(--nxf-thread-max-width) flex-col items-center text-center duration-200"
|
|
29227
29226
|
),
|
|
29228
29227
|
children: [
|
|
29229
|
-
icon != null ? /* @__PURE__ */ jsx70("div", { className: cn("mb-4 flex max-w-full justify-center [&_img]:max-w-full"), children: icon }) : null,
|
|
29230
29228
|
/* @__PURE__ */ jsx70("p", { className: cn(typeSection), children: title }),
|
|
29231
29229
|
description ? /* @__PURE__ */ jsx70("p", { className: cn(typeDeck), children: description }) : null
|
|
29232
29230
|
]
|
|
@@ -29235,8 +29233,8 @@ function Greeting({
|
|
|
29235
29233
|
}
|
|
29236
29234
|
|
|
29237
29235
|
// src/ui/home-demo/suggestions.tsx
|
|
29238
|
-
import { jsx as jsx71
|
|
29239
|
-
var suggestionChipClass = "bg-background text-
|
|
29236
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
29237
|
+
var suggestionChipClass = "border-foreground/10 bg-background text-muted-foreground hover:border-foreground/25 hover:text-foreground rounded-control h-8 border px-3 text-[13px] transition-colors";
|
|
29240
29238
|
function Suggestions2({
|
|
29241
29239
|
suggestions,
|
|
29242
29240
|
disabled,
|
|
@@ -29256,7 +29254,7 @@ function Suggestions2({
|
|
|
29256
29254
|
"animate-in fade-in mx-auto flex max-w-[34rem] flex-wrap items-center justify-center gap-2 transition-opacity duration-200 motion-reduce:animate-none",
|
|
29257
29255
|
hidden && "opacity-0"
|
|
29258
29256
|
),
|
|
29259
|
-
children: suggestions.map((suggestion) => /* @__PURE__ */
|
|
29257
|
+
children: suggestions.map((suggestion) => /* @__PURE__ */ jsx71(
|
|
29260
29258
|
ThreadPrimitiveSuggestion,
|
|
29261
29259
|
{
|
|
29262
29260
|
prompt: suggestion.prompt,
|
|
@@ -29267,19 +29265,7 @@ function Suggestions2({
|
|
|
29267
29265
|
onSend(suggestion.prompt);
|
|
29268
29266
|
},
|
|
29269
29267
|
className: cn(suggestionChipClass),
|
|
29270
|
-
children:
|
|
29271
|
-
suggestion.icon != null ? /* @__PURE__ */ jsx71(
|
|
29272
|
-
"span",
|
|
29273
|
-
{
|
|
29274
|
-
"aria-hidden": "true",
|
|
29275
|
-
className: cn(
|
|
29276
|
-
"inline-flex size-4 shrink-0 items-center justify-center [&>svg]:size-4 [&>img]:size-4"
|
|
29277
|
-
),
|
|
29278
|
-
children: suggestion.icon
|
|
29279
|
-
}
|
|
29280
|
-
) : null,
|
|
29281
|
-
/* @__PURE__ */ jsx71("span", { className: cn("min-w-0 wrap-anywhere"), children: suggestion.label })
|
|
29282
|
-
]
|
|
29268
|
+
children: suggestion.label
|
|
29283
29269
|
},
|
|
29284
29270
|
suggestion.prompt
|
|
29285
29271
|
))
|
|
@@ -29339,22 +29325,22 @@ function useNextMessage(chat, suggest, open) {
|
|
|
29339
29325
|
}
|
|
29340
29326
|
|
|
29341
29327
|
// src/ui/home-demo/action-bar.tsx
|
|
29342
|
-
import { jsx as jsx72, jsxs as
|
|
29328
|
+
import { jsx as jsx72, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
29343
29329
|
function AssistantActionBar() {
|
|
29344
|
-
return /* @__PURE__ */ jsx72(ActionBarPrimitiveRoot, { autohide: "never", className: cn("flex items-center gap-1.5"), children: /* @__PURE__ */
|
|
29330
|
+
return /* @__PURE__ */ jsx72(ActionBarPrimitiveRoot, { autohide: "never", className: cn("flex items-center gap-1.5"), children: /* @__PURE__ */ jsxs14(ActionBarPrimitiveCopy, { "aria-label": "\u590D\u5236\u56DE\u590D", className: cn(actionButtonClass), children: [
|
|
29345
29331
|
/* @__PURE__ */ jsx72(AuiIf, { condition: (s) => s.message.isCopied, children: /* @__PURE__ */ jsx72(Check, { className: cn("size-4") }) }),
|
|
29346
29332
|
/* @__PURE__ */ jsx72(AuiIf, { condition: (s) => !s.message.isCopied, children: /* @__PURE__ */ jsx72(Copy, { className: cn("size-4") }) })
|
|
29347
29333
|
] }) });
|
|
29348
29334
|
}
|
|
29349
29335
|
|
|
29350
29336
|
// src/ui/home-demo/messages.tsx
|
|
29351
|
-
import { jsx as jsx73, jsxs as
|
|
29337
|
+
import { jsx as jsx73, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
29352
29338
|
function UserMessage({
|
|
29353
29339
|
children,
|
|
29354
29340
|
attachments,
|
|
29355
29341
|
actions
|
|
29356
29342
|
}) {
|
|
29357
|
-
return /* @__PURE__ */
|
|
29343
|
+
return /* @__PURE__ */ jsxs15(
|
|
29358
29344
|
MessagePrimitiveRoot,
|
|
29359
29345
|
{
|
|
29360
29346
|
"data-role": "user",
|
|
@@ -29364,7 +29350,7 @@ function UserMessage({
|
|
|
29364
29350
|
),
|
|
29365
29351
|
children: [
|
|
29366
29352
|
/* @__PURE__ */ jsx73("div", { className: cn("w-full has-[.aui-attachment-root]:mb-2"), children: attachments }),
|
|
29367
|
-
/* @__PURE__ */
|
|
29353
|
+
/* @__PURE__ */ jsxs15("div", { className: cn("relative max-w-[80%]"), children: [
|
|
29368
29354
|
/* @__PURE__ */ jsx73(
|
|
29369
29355
|
"div",
|
|
29370
29356
|
{
|
|
@@ -29391,7 +29377,7 @@ function UserMessage({
|
|
|
29391
29377
|
);
|
|
29392
29378
|
}
|
|
29393
29379
|
function AssistantMessage({ children }) {
|
|
29394
|
-
return /* @__PURE__ */
|
|
29380
|
+
return /* @__PURE__ */ jsxs15(
|
|
29395
29381
|
MessagePrimitiveRoot,
|
|
29396
29382
|
{
|
|
29397
29383
|
"data-role": "assistant",
|
|
@@ -29400,7 +29386,7 @@ function AssistantMessage({ children }) {
|
|
|
29400
29386
|
"animate-in fade-in slide-in-from-bottom-1 mx-auto w-full max-w-(--nxf-thread-max-width) duration-150"
|
|
29401
29387
|
),
|
|
29402
29388
|
children: [
|
|
29403
|
-
/* @__PURE__ */
|
|
29389
|
+
/* @__PURE__ */ jsxs15(
|
|
29404
29390
|
"div",
|
|
29405
29391
|
{
|
|
29406
29392
|
"data-slot": "aui_assistant-message-content",
|
|
@@ -29433,7 +29419,7 @@ function MessageError() {
|
|
|
29433
29419
|
}
|
|
29434
29420
|
|
|
29435
29421
|
// src/ui/home-demo/composer.tsx
|
|
29436
|
-
import { jsx as jsx74, jsxs as
|
|
29422
|
+
import { jsx as jsx74, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
29437
29423
|
function Composer({
|
|
29438
29424
|
children,
|
|
29439
29425
|
inputProps,
|
|
@@ -29451,7 +29437,7 @@ function Composer({
|
|
|
29451
29437
|
onDragOverCapture: (event) => {
|
|
29452
29438
|
if (inputProps.disabled) event.preventDefault();
|
|
29453
29439
|
},
|
|
29454
|
-
children: /* @__PURE__ */
|
|
29440
|
+
children: /* @__PURE__ */ jsxs16(
|
|
29455
29441
|
"div",
|
|
29456
29442
|
{
|
|
29457
29443
|
"data-slot": "aui_composer-shell",
|
|
@@ -29490,7 +29476,7 @@ function EditComposer({
|
|
|
29490
29476
|
"data-role": "user",
|
|
29491
29477
|
"data-slot": "aui_edit-composer-wrapper",
|
|
29492
29478
|
className: cn("mx-auto flex w-full max-w-(--nxf-thread-max-width) flex-col items-end"),
|
|
29493
|
-
children: /* @__PURE__ */
|
|
29479
|
+
children: /* @__PURE__ */ jsxs16(
|
|
29494
29480
|
ComposerPrimitiveRoot,
|
|
29495
29481
|
{
|
|
29496
29482
|
className: cn(
|
|
@@ -29509,7 +29495,7 @@ function EditComposer({
|
|
|
29509
29495
|
}
|
|
29510
29496
|
) }),
|
|
29511
29497
|
children,
|
|
29512
|
-
/* @__PURE__ */
|
|
29498
|
+
/* @__PURE__ */ jsxs16("div", { className: cn("flex items-center justify-end gap-1.5 px-2.5 pb-2.5"), children: [
|
|
29513
29499
|
/* @__PURE__ */ jsx74(ComposerPrimitiveCancel, { asChild: true, children: /* @__PURE__ */ jsx74(
|
|
29514
29500
|
"button",
|
|
29515
29501
|
{
|
|
@@ -29545,7 +29531,7 @@ import { forwardRef as forwardRef29 } from "react";
|
|
|
29545
29531
|
|
|
29546
29532
|
// src/ui/tooltip.tsx
|
|
29547
29533
|
import * as React6 from "react";
|
|
29548
|
-
import { jsx as jsx75, jsxs as
|
|
29534
|
+
import { jsx as jsx75, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
29549
29535
|
function TooltipProvider2({
|
|
29550
29536
|
delayDuration = 0,
|
|
29551
29537
|
...props
|
|
@@ -29573,7 +29559,7 @@ function TooltipContent3({
|
|
|
29573
29559
|
}) {
|
|
29574
29560
|
const container = usePortalContainer();
|
|
29575
29561
|
if (!container) return null;
|
|
29576
|
-
return /* @__PURE__ */ jsx75(dist_exports12.Portal, { container, children: /* @__PURE__ */
|
|
29562
|
+
return /* @__PURE__ */ jsx75(dist_exports12.Portal, { container, children: /* @__PURE__ */ jsxs17(
|
|
29577
29563
|
dist_exports12.Content,
|
|
29578
29564
|
{
|
|
29579
29565
|
"data-slot": "tooltip-content",
|
|
@@ -29600,11 +29586,11 @@ function TooltipContent3({
|
|
|
29600
29586
|
}
|
|
29601
29587
|
|
|
29602
29588
|
// src/ui/tooltip-icon-button.tsx
|
|
29603
|
-
import { jsx as jsx76, jsxs as
|
|
29589
|
+
import { jsx as jsx76, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
29604
29590
|
var TooltipIconButton = forwardRef29(
|
|
29605
29591
|
({ children, tooltip, side = "bottom", className, ...rest }, ref) => {
|
|
29606
|
-
return /* @__PURE__ */ jsx76(TooltipProvider2, { delayDuration: 0, children: /* @__PURE__ */
|
|
29607
|
-
/* @__PURE__ */ jsx76(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */
|
|
29592
|
+
return /* @__PURE__ */ jsx76(TooltipProvider2, { delayDuration: 0, children: /* @__PURE__ */ jsxs18(Tooltip2, { children: [
|
|
29593
|
+
/* @__PURE__ */ jsx76(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsxs18(
|
|
29608
29594
|
Button,
|
|
29609
29595
|
{
|
|
29610
29596
|
variant: "ghost",
|
|
@@ -29676,7 +29662,7 @@ import {
|
|
|
29676
29662
|
forwardRef as forwardRef33,
|
|
29677
29663
|
useEffect as useEffect34,
|
|
29678
29664
|
useLayoutEffect as useLayoutEffect14,
|
|
29679
|
-
useMemo as
|
|
29665
|
+
useMemo as useMemo13,
|
|
29680
29666
|
useRef as useRef39,
|
|
29681
29667
|
useState as useState39
|
|
29682
29668
|
} from "react";
|
|
@@ -30250,7 +30236,7 @@ var useAttachmentSrc = () => {
|
|
|
30250
30236
|
};
|
|
30251
30237
|
|
|
30252
30238
|
// src/ui/attachment.aui.tsx
|
|
30253
|
-
import { Fragment as Fragment9, jsx as jsx79, jsxs as
|
|
30239
|
+
import { Fragment as Fragment9, jsx as jsx79, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
30254
30240
|
var PreviewContext = createContext6(void 0);
|
|
30255
30241
|
var usePreview = () => {
|
|
30256
30242
|
const fallback = useAttachmentSrc();
|
|
@@ -30274,9 +30260,9 @@ var AttachmentPreview = ({ src }) => {
|
|
|
30274
30260
|
var AttachmentPreviewDialog = ({ children }) => {
|
|
30275
30261
|
const src = usePreview();
|
|
30276
30262
|
if (!src) return /* @__PURE__ */ jsx79(Fragment9, { children });
|
|
30277
|
-
return /* @__PURE__ */
|
|
30263
|
+
return /* @__PURE__ */ jsxs19(Dialog2, { children: [
|
|
30278
30264
|
/* @__PURE__ */ jsx79(DialogTrigger3, { className: cn("aui-attachment-preview-trigger cursor-zoom-in"), asChild: true, children: isValidElement3(children) ? children : /* @__PURE__ */ jsx79("button", { type: "button", children }) }),
|
|
30279
|
-
/* @__PURE__ */
|
|
30265
|
+
/* @__PURE__ */ jsxs19(
|
|
30280
30266
|
DialogContent3,
|
|
30281
30267
|
{
|
|
30282
30268
|
className: cn(
|
|
@@ -30348,8 +30334,8 @@ var AttachmentContent = ({ children }) => {
|
|
|
30348
30334
|
const errorMessage = useAuiState(
|
|
30349
30335
|
(s) => s.attachment.status.type === "incomplete" && s.attachment.status.reason === "error" ? s.attachment.status.message ?? "Attachment processing failed" : void 0
|
|
30350
30336
|
);
|
|
30351
|
-
return /* @__PURE__ */ jsx79(TooltipProvider2, { children: /* @__PURE__ */
|
|
30352
|
-
/* @__PURE__ */
|
|
30337
|
+
return /* @__PURE__ */ jsx79(TooltipProvider2, { children: /* @__PURE__ */ jsxs19(Tooltip2, { children: [
|
|
30338
|
+
/* @__PURE__ */ jsxs19(
|
|
30353
30339
|
AttachmentPrimitiveRoot,
|
|
30354
30340
|
{
|
|
30355
30341
|
className: cn(
|
|
@@ -30358,7 +30344,7 @@ var AttachmentContent = ({ children }) => {
|
|
|
30358
30344
|
isImage2 && !isComposer && "aui-attachment-root-message only:*:first:size-24"
|
|
30359
30345
|
),
|
|
30360
30346
|
children: [
|
|
30361
|
-
/* @__PURE__ */ jsx79(AttachmentPreviewDialog, { children: /* @__PURE__ */ jsx79(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */
|
|
30347
|
+
/* @__PURE__ */ jsx79(AttachmentPreviewDialog, { children: /* @__PURE__ */ jsx79(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsxs19(
|
|
30362
30348
|
"div",
|
|
30363
30349
|
{
|
|
30364
30350
|
className: cn(
|
|
@@ -30409,7 +30395,7 @@ var AttachmentContent = ({ children }) => {
|
|
|
30409
30395
|
]
|
|
30410
30396
|
}
|
|
30411
30397
|
),
|
|
30412
|
-
/* @__PURE__ */
|
|
30398
|
+
/* @__PURE__ */ jsxs19(TooltipContent3, { side: "top", children: [
|
|
30413
30399
|
/* @__PURE__ */ jsx79(AttachmentPrimitiveName, {}),
|
|
30414
30400
|
errorMessage && /* @__PURE__ */ jsx79("p", { className: cn("aui-attachment-error-message"), children: errorMessage })
|
|
30415
30401
|
] })
|
|
@@ -30454,9 +30440,9 @@ var memoCompareNodes = (prev, next) => {
|
|
|
30454
30440
|
var memoizeMarkdownComponents = (components = {}) => {
|
|
30455
30441
|
return Object.fromEntries(Object.entries(components ?? {}).map(([key, value]) => {
|
|
30456
30442
|
if (!value) return [key, value];
|
|
30457
|
-
const
|
|
30443
|
+
const Component = value;
|
|
30458
30444
|
const WithoutNode = ({ node: node2, ...props }) => {
|
|
30459
|
-
return /* @__PURE__ */ jsx80(
|
|
30445
|
+
return /* @__PURE__ */ jsx80(Component, { ...props });
|
|
30460
30446
|
};
|
|
30461
30447
|
return [key, (0, react_compat_exports.memo)(WithoutNode, memoCompareNodes)];
|
|
30462
30448
|
}));
|
|
@@ -30494,13 +30480,13 @@ var DefaultCodeHeader = () => null;
|
|
|
30494
30480
|
var parseLanguageClass = (className) => /language-([^\s]+)/.exec(className ?? "")?.[1] ?? "";
|
|
30495
30481
|
|
|
30496
30482
|
// ../../node_modules/.pnpm/@assistant-ui+react-markdown@0.14.16_@assistant-ui+react@0.15.21_@opentelemetry+api@1.9_51b9d4047c9ca5e4912afe903880d312/node_modules/@assistant-ui/react-markdown/dist/overrides/CodeBlock.js
|
|
30497
|
-
import { Fragment as Fragment10, jsx as jsx83, jsxs as
|
|
30483
|
+
import { Fragment as Fragment10, jsx as jsx83, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
30498
30484
|
var DefaultCodeBlock = ({ node: node2, components: { Pre, Code: Code2, SyntaxHighlighter: SyntaxHighlighter2, CodeHeader }, language, code: code4 }) => {
|
|
30499
30485
|
const components = (0, react_compat_exports.useMemo)(() => ({
|
|
30500
30486
|
Pre,
|
|
30501
30487
|
Code: Code2
|
|
30502
30488
|
}), [Pre, Code2]);
|
|
30503
|
-
return /* @__PURE__ */
|
|
30489
|
+
return /* @__PURE__ */ jsxs20(Fragment10, { children: [/* @__PURE__ */ jsx83(CodeHeader, {
|
|
30504
30490
|
node: node2,
|
|
30505
30491
|
language,
|
|
30506
30492
|
code: code4
|
|
@@ -30523,7 +30509,7 @@ var withDefaultProps = ({ className, ...defaultProps }) => ({ className: classNa
|
|
|
30523
30509
|
};
|
|
30524
30510
|
|
|
30525
30511
|
// ../../node_modules/.pnpm/@assistant-ui+react-markdown@0.14.16_@assistant-ui+react@0.15.21_@opentelemetry+api@1.9_51b9d4047c9ca5e4912afe903880d312/node_modules/@assistant-ui/react-markdown/dist/overrides/CodeOverride.js
|
|
30526
|
-
import { Fragment as Fragment11, jsx as jsx84, jsxs as
|
|
30512
|
+
import { Fragment as Fragment11, jsx as jsx84, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
30527
30513
|
function extractCode(children) {
|
|
30528
30514
|
if (typeof children === "string") return children;
|
|
30529
30515
|
if (Array.isArray(children)) {
|
|
@@ -30543,7 +30529,7 @@ var CodeBlockOverride = ({ node: node2, components: { Pre, Code: Code2, SyntaxHi
|
|
|
30543
30529
|
const language = parseLanguageClass(codeProps.className);
|
|
30544
30530
|
const SyntaxHighlighter2 = componentsByLanguage[language]?.SyntaxHighlighter ?? FallbackSyntaxHighlighter;
|
|
30545
30531
|
const CodeHeader = componentsByLanguage[language]?.CodeHeader ?? FallbackCodeHeader;
|
|
30546
|
-
if (children != null && typeof children !== "string") return /* @__PURE__ */
|
|
30532
|
+
if (children != null && typeof children !== "string") return /* @__PURE__ */ jsxs21(Fragment11, { children: [/* @__PURE__ */ jsx84(CodeHeader, {
|
|
30547
30533
|
node: node2,
|
|
30548
30534
|
language,
|
|
30549
30535
|
code: extractCode(children)
|
|
@@ -32230,11 +32216,11 @@ function addChildren(props, children) {
|
|
|
32230
32216
|
}
|
|
32231
32217
|
}
|
|
32232
32218
|
}
|
|
32233
|
-
function productionCreate(_,
|
|
32219
|
+
function productionCreate(_, jsx99, jsxs30) {
|
|
32234
32220
|
return create3;
|
|
32235
32221
|
function create3(_2, type, props, key) {
|
|
32236
32222
|
const isStaticChildren = Array.isArray(props.children);
|
|
32237
|
-
const fn = isStaticChildren ?
|
|
32223
|
+
const fn = isStaticChildren ? jsxs30 : jsx99;
|
|
32238
32224
|
return key ? fn(type, props, key) : fn(type, props);
|
|
32239
32225
|
}
|
|
32240
32226
|
}
|
|
@@ -32479,7 +32465,7 @@ var urlAttributes = {
|
|
|
32479
32465
|
};
|
|
32480
32466
|
|
|
32481
32467
|
// ../../node_modules/.pnpm/react-markdown@10.1.0_@types+react@19.2.17_react@19.2.7/node_modules/react-markdown/lib/index.js
|
|
32482
|
-
import { Fragment as Fragment12, jsx as jsx85, jsxs as
|
|
32468
|
+
import { Fragment as Fragment12, jsx as jsx85, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
32483
32469
|
|
|
32484
32470
|
// ../../node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js
|
|
32485
32471
|
var emptyOptions2 = {};
|
|
@@ -40249,8 +40235,8 @@ function footer(state) {
|
|
|
40249
40235
|
const safeId = normalizeUri(id.toLowerCase());
|
|
40250
40236
|
let rereferenceIndex = 0;
|
|
40251
40237
|
const backReferences = [];
|
|
40252
|
-
const
|
|
40253
|
-
while (
|
|
40238
|
+
const counts = state.footnoteCounts.get(id);
|
|
40239
|
+
while (counts !== void 0 && ++rereferenceIndex <= counts) {
|
|
40254
40240
|
if (backReferences.length > 0) {
|
|
40255
40241
|
backReferences.push({ type: "text", value: " " });
|
|
40256
40242
|
}
|
|
@@ -42280,7 +42266,7 @@ function post(tree, options2) {
|
|
|
42280
42266
|
components,
|
|
42281
42267
|
ignoreInvalidStyle: true,
|
|
42282
42268
|
jsx: jsx85,
|
|
42283
|
-
jsxs:
|
|
42269
|
+
jsxs: jsxs22,
|
|
42284
42270
|
passKeys: true,
|
|
42285
42271
|
passNode: true
|
|
42286
42272
|
});
|
|
@@ -45501,7 +45487,7 @@ import { memo as memo6, useRef as useRef33 } from "react";
|
|
|
45501
45487
|
|
|
45502
45488
|
// src/ui/code-block.tsx
|
|
45503
45489
|
import { useEffect as useEffect29, useRef as useRef32, useState as useState32 } from "react";
|
|
45504
|
-
import { jsx as jsx87, jsxs as
|
|
45490
|
+
import { jsx as jsx87, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
45505
45491
|
function CopyButton({
|
|
45506
45492
|
getText,
|
|
45507
45493
|
onCopied,
|
|
@@ -45555,7 +45541,7 @@ function CodeBlock({
|
|
|
45555
45541
|
}) {
|
|
45556
45542
|
const viewportRef = useRef32(null);
|
|
45557
45543
|
const getText = () => copyText ?? viewportRef.current?.querySelector("pre")?.textContent ?? "";
|
|
45558
|
-
return /* @__PURE__ */
|
|
45544
|
+
return /* @__PURE__ */ jsxs23(
|
|
45559
45545
|
"figure",
|
|
45560
45546
|
{
|
|
45561
45547
|
className: cn(
|
|
@@ -45564,7 +45550,7 @@ function CodeBlock({
|
|
|
45564
45550
|
),
|
|
45565
45551
|
...props,
|
|
45566
45552
|
children: [
|
|
45567
|
-
title ? /* @__PURE__ */
|
|
45553
|
+
title ? /* @__PURE__ */ jsxs23(
|
|
45568
45554
|
"figcaption",
|
|
45569
45555
|
{
|
|
45570
45556
|
className: cn(
|
|
@@ -45642,7 +45628,7 @@ var useCopyToClipboard = ({ copiedDuration = 3e3 } = {}) => {
|
|
|
45642
45628
|
};
|
|
45643
45629
|
|
|
45644
45630
|
// src/ui/markdown-text.tsx
|
|
45645
|
-
import { jsx as jsx88, jsxs as
|
|
45631
|
+
import { jsx as jsx88, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
45646
45632
|
var MarkdownTextImpl = () => /* @__PURE__ */ jsx88(
|
|
45647
45633
|
MarkdownTextPrimitive,
|
|
45648
45634
|
{
|
|
@@ -45677,8 +45663,8 @@ function MarkdownTable({ className, children, ...props }) {
|
|
|
45677
45663
|
].join("\n")
|
|
45678
45664
|
);
|
|
45679
45665
|
};
|
|
45680
|
-
return /* @__PURE__ */
|
|
45681
|
-
/* @__PURE__ */
|
|
45666
|
+
return /* @__PURE__ */ jsxs24("figure", { className: cn("border-foreground/10 rounded-document my-3 border"), children: [
|
|
45667
|
+
/* @__PURE__ */ jsxs24(
|
|
45682
45668
|
"div",
|
|
45683
45669
|
{
|
|
45684
45670
|
className: cn(
|
|
@@ -46039,7 +46025,7 @@ function ShimmerLabel({
|
|
|
46039
46025
|
|
|
46040
46026
|
// src/ui/home-demo/trace-line.tsx
|
|
46041
46027
|
import { useEffect as useEffect31, useRef as useRef35, useState as useState36 } from "react";
|
|
46042
|
-
import { Fragment as Fragment13, jsx as jsx93, jsxs as
|
|
46028
|
+
import { Fragment as Fragment13, jsx as jsx93, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
46043
46029
|
function TraceMarker({ live, className }) {
|
|
46044
46030
|
return /* @__PURE__ */ jsx93(
|
|
46045
46031
|
"span",
|
|
@@ -46078,7 +46064,7 @@ function TraceLine({
|
|
|
46078
46064
|
detail,
|
|
46079
46065
|
meta
|
|
46080
46066
|
}) {
|
|
46081
|
-
return /* @__PURE__ */
|
|
46067
|
+
return /* @__PURE__ */ jsxs25(
|
|
46082
46068
|
"div",
|
|
46083
46069
|
{
|
|
46084
46070
|
className: cn(
|
|
@@ -46086,10 +46072,10 @@ function TraceLine({
|
|
|
46086
46072
|
),
|
|
46087
46073
|
children: [
|
|
46088
46074
|
/* @__PURE__ */ jsx93(TraceMarker, { live }),
|
|
46089
|
-
/* @__PURE__ */ jsx93("span", { className: cn("text-muted-foreground min-w-0 flex-1 truncate"), children: live ? /* @__PURE__ */
|
|
46075
|
+
/* @__PURE__ */ jsx93("span", { className: cn("text-muted-foreground min-w-0 flex-1 truncate"), children: live ? /* @__PURE__ */ jsxs25(ShimmerLabel, { children: [
|
|
46090
46076
|
label,
|
|
46091
46077
|
detail ? ` ${detail}` : null
|
|
46092
|
-
] }) : /* @__PURE__ */
|
|
46078
|
+
] }) : /* @__PURE__ */ jsxs25(Fragment13, { children: [
|
|
46093
46079
|
label,
|
|
46094
46080
|
detail ? ` ${detail}` : null
|
|
46095
46081
|
] }) }),
|
|
@@ -46099,37 +46085,15 @@ function TraceLine({
|
|
|
46099
46085
|
);
|
|
46100
46086
|
}
|
|
46101
46087
|
|
|
46102
|
-
// src/tool-result.ts
|
|
46103
|
-
function decodeToolResult(content3, toolName) {
|
|
46104
|
-
try {
|
|
46105
|
-
const payload = JSON.parse(content3);
|
|
46106
|
-
if (payload && typeof payload === "object" && !Array.isArray(payload)) {
|
|
46107
|
-
const record = payload;
|
|
46108
|
-
if (record.contentOmitted === true && typeof record.preview === "string" && Object.keys(record).length === 2)
|
|
46109
|
-
return { value: record.preview, omitted: true };
|
|
46110
|
-
if (Object.hasOwn(record, "result") && (Object.keys(record).length === 1 || toolName !== void 0 && record.toolName === toolName && Object.keys(record).length === 2))
|
|
46111
|
-
return { value: record.result, omitted: false };
|
|
46112
|
-
}
|
|
46113
|
-
return { value: payload, omitted: false };
|
|
46114
|
-
} catch {
|
|
46115
|
-
return { value: content3, omitted: false };
|
|
46116
|
-
}
|
|
46117
|
-
}
|
|
46118
|
-
function toolResultPreview(result) {
|
|
46119
|
-
const decoded = typeof result === "string" ? decodeToolResult(result) : void 0;
|
|
46120
|
-
const text7 = decoded?.omitted ? String(decoded.value) : typeof result === "string" ? result : JSON.stringify(result, null, 2) ?? "";
|
|
46121
|
-
return text7.length > 4e3 || decoded?.omitted ? `${text7.slice(0, 4e3)}\u2026` : text7;
|
|
46122
|
-
}
|
|
46123
|
-
|
|
46124
46088
|
// src/ui/home-demo/trace.tsx
|
|
46125
|
-
import { Fragment as Fragment14, jsx as jsx94, jsxs as
|
|
46089
|
+
import { Fragment as Fragment14, jsx as jsx94, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
46126
46090
|
var disclosureContentClass = "border-foreground/10 ms-[5px] border-s ps-4";
|
|
46127
46091
|
function DisclosureTrigger({
|
|
46128
46092
|
live,
|
|
46129
46093
|
label,
|
|
46130
46094
|
detail
|
|
46131
46095
|
}) {
|
|
46132
|
-
return /* @__PURE__ */
|
|
46096
|
+
return /* @__PURE__ */ jsxs26(
|
|
46133
46097
|
CollapsibleTrigger3,
|
|
46134
46098
|
{
|
|
46135
46099
|
"data-slot": "tool-group-trigger",
|
|
@@ -46144,10 +46108,10 @@ function DisclosureTrigger({
|
|
|
46144
46108
|
className: cn(
|
|
46145
46109
|
"text-muted-foreground group-hover/trigger:text-foreground min-w-0 truncate transition-colors"
|
|
46146
46110
|
),
|
|
46147
|
-
children: live ? /* @__PURE__ */
|
|
46111
|
+
children: live ? /* @__PURE__ */ jsxs26(ShimmerLabel, { children: [
|
|
46148
46112
|
label,
|
|
46149
46113
|
detail ? ` ${detail}` : null
|
|
46150
|
-
] }) : /* @__PURE__ */
|
|
46114
|
+
] }) : /* @__PURE__ */ jsxs26(Fragment14, { children: [
|
|
46151
46115
|
label,
|
|
46152
46116
|
detail ? ` ${detail}` : null
|
|
46153
46117
|
] })
|
|
@@ -46190,18 +46154,18 @@ function ToolCall({
|
|
|
46190
46154
|
}
|
|
46191
46155
|
) : null;
|
|
46192
46156
|
if (!showDetails)
|
|
46193
|
-
return /* @__PURE__ */
|
|
46157
|
+
return /* @__PURE__ */ jsxs26(Fragment14, { children: [
|
|
46194
46158
|
line,
|
|
46195
46159
|
reason
|
|
46196
46160
|
] });
|
|
46197
|
-
return /* @__PURE__ */
|
|
46161
|
+
return /* @__PURE__ */ jsxs26(Fragment14, { children: [
|
|
46198
46162
|
line,
|
|
46199
46163
|
reason,
|
|
46200
|
-
/* @__PURE__ */
|
|
46164
|
+
/* @__PURE__ */ jsxs26(Collapsible3, { children: [
|
|
46201
46165
|
/* @__PURE__ */ jsx94(DisclosureTrigger, { live: false, label: "\u64CD\u4F5C\u660E\u7EC6" }),
|
|
46202
|
-
/* @__PURE__ */
|
|
46166
|
+
/* @__PURE__ */ jsxs26(CollapsibleContent3, { className: cn(disclosureContentClass), children: [
|
|
46203
46167
|
/* @__PURE__ */ jsx94("pre", { className: cn("overflow-x-auto text-xs"), "aria-label": "\u64CD\u4F5C\u8F93\u5165", children: argsText || JSON.stringify(args, null, 2) }),
|
|
46204
|
-
result !== void 0 ? /* @__PURE__ */ jsx94("pre", { className: cn("overflow-x-auto text-xs"), "aria-label": "\u64CD\u4F5C\u8F93\u51FA", children: error ? error.userMessage : tool2?.toolState === "cancelled" ? "Stopped" : tool2?.toolState === "rejected" ? "Rejected" : tool2?.toolState === "not_started" ? "Not started" :
|
|
46168
|
+
result !== void 0 ? /* @__PURE__ */ jsx94("pre", { className: cn("overflow-x-auto text-xs"), "aria-label": "\u64CD\u4F5C\u8F93\u51FA", children: error ? error.userMessage : tool2?.toolState === "cancelled" ? "Stopped" : tool2?.toolState === "rejected" ? "Rejected" : tool2?.toolState === "not_started" ? "Not started" : typeof result === "string" ? result : JSON.stringify(result, null, 2) }) : null
|
|
46205
46169
|
] })
|
|
46206
46170
|
] })
|
|
46207
46171
|
] });
|
|
@@ -46221,7 +46185,7 @@ import {
|
|
|
46221
46185
|
useRef as useRef36,
|
|
46222
46186
|
useState as useState37
|
|
46223
46187
|
} from "react";
|
|
46224
|
-
import { jsx as jsx95, jsxs as
|
|
46188
|
+
import { jsx as jsx95, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
46225
46189
|
var ANIMATION_DURATION2 = 200;
|
|
46226
46190
|
var ReasoningPreviewContext = createContext8(false);
|
|
46227
46191
|
var reasoningVariants = cva("aui-reasoning-root mb-4 w-full", {
|
|
@@ -46331,7 +46295,7 @@ function ReasoningContent({
|
|
|
46331
46295
|
...props
|
|
46332
46296
|
}) {
|
|
46333
46297
|
const isPreview = useContext10(ReasoningPreviewContext);
|
|
46334
|
-
return /* @__PURE__ */
|
|
46298
|
+
return /* @__PURE__ */ jsxs27(
|
|
46335
46299
|
CollapsibleContent3,
|
|
46336
46300
|
{
|
|
46337
46301
|
"data-slot": "reasoning-content",
|
|
@@ -46444,204 +46408,18 @@ Reasoning.displayName = "Reasoning";
|
|
|
46444
46408
|
|
|
46445
46409
|
// src/assistant-components.tsx
|
|
46446
46410
|
import { attachmentAccept } from "./attachments.js";
|
|
46447
|
-
import {
|
|
46448
|
-
|
|
46449
|
-
// src/tool-presentation.tsx
|
|
46450
|
-
import { Component, memo as memo8, useMemo as useMemo13 } from "react";
|
|
46451
|
-
|
|
46452
|
-
// src/shared/schema.ts
|
|
46453
|
-
var counts = ["minLength", "maxLength", "minItems", "maxItems"];
|
|
46454
|
-
var bounds = ["minimum", "maximum", "exclusiveMinimum", "exclusiveMaximum"];
|
|
46455
|
-
var keywords = /* @__PURE__ */ new Set([
|
|
46456
|
-
"type",
|
|
46457
|
-
"description",
|
|
46458
|
-
"properties",
|
|
46459
|
-
"required",
|
|
46460
|
-
"items",
|
|
46461
|
-
"enum",
|
|
46462
|
-
"additionalProperties",
|
|
46463
|
-
...counts,
|
|
46464
|
-
...bounds,
|
|
46465
|
-
"pattern",
|
|
46466
|
-
"uniqueItems"
|
|
46467
|
-
]);
|
|
46468
|
-
var patterns = /* @__PURE__ */ new WeakMap();
|
|
46469
|
-
function invalid(path2, message) {
|
|
46470
|
-
throw new TypeError(`${path2} ${message}`);
|
|
46471
|
-
}
|
|
46472
|
-
function isRecord2(value) {
|
|
46473
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
46474
|
-
}
|
|
46475
|
-
function patternFor(schema, path2) {
|
|
46476
|
-
const source = schema.pattern;
|
|
46477
|
-
const cached = patterns.get(schema);
|
|
46478
|
-
if (cached?.source === source) return cached.regex;
|
|
46479
|
-
let regex;
|
|
46480
|
-
try {
|
|
46481
|
-
regex = new RegExp(source, "u");
|
|
46482
|
-
} catch {
|
|
46483
|
-
invalid(`${path2}.pattern`, "must be a valid Unicode regular expression.");
|
|
46484
|
-
}
|
|
46485
|
-
patterns.set(schema, { source, regex });
|
|
46486
|
-
return regex;
|
|
46487
|
-
}
|
|
46488
|
-
function jsonEqual(left, right) {
|
|
46489
|
-
if (left === right) return true;
|
|
46490
|
-
if (Array.isArray(left) && Array.isArray(right))
|
|
46491
|
-
return left.length === right.length && left.every((item, index5) => jsonEqual(item, right[index5]));
|
|
46492
|
-
if (!isRecord2(left) || !isRecord2(right)) return false;
|
|
46493
|
-
const keys2 = Object.keys(left);
|
|
46494
|
-
return keys2.length === Object.keys(right).length && keys2.every((key) => Object.hasOwn(right, key) && jsonEqual(left[key], right[key]));
|
|
46495
|
-
}
|
|
46496
|
-
function typeMatches(schema, value) {
|
|
46497
|
-
switch (schema.type) {
|
|
46498
|
-
case void 0:
|
|
46499
|
-
return true;
|
|
46500
|
-
case "null":
|
|
46501
|
-
return value === null;
|
|
46502
|
-
case "array":
|
|
46503
|
-
return Array.isArray(value);
|
|
46504
|
-
case "object":
|
|
46505
|
-
return isRecord2(value);
|
|
46506
|
-
case "integer":
|
|
46507
|
-
return typeof value === "number" && Number.isInteger(value);
|
|
46508
|
-
case "number":
|
|
46509
|
-
return typeof value === "number" && Number.isFinite(value);
|
|
46510
|
-
default:
|
|
46511
|
-
return typeof value === schema.type;
|
|
46512
|
-
}
|
|
46513
|
-
}
|
|
46514
|
-
function validateAgentToolInput(schema, value, path2 = "input") {
|
|
46515
|
-
if (!typeMatches(schema, value)) return [`${path2} must be ${schema.type}.`];
|
|
46516
|
-
const errors = [];
|
|
46517
|
-
if (schema.enum && !schema.enum.some((item) => jsonEqual(item, value)))
|
|
46518
|
-
errors.push(`${path2} must be one of the declared enum values.`);
|
|
46519
|
-
if (typeof value === "string") {
|
|
46520
|
-
const length = Array.from(value).length;
|
|
46521
|
-
if (schema.minLength !== void 0 && length < schema.minLength)
|
|
46522
|
-
errors.push(`${path2} must have at least ${schema.minLength} characters.`);
|
|
46523
|
-
if (schema.maxLength !== void 0 && length > schema.maxLength)
|
|
46524
|
-
errors.push(`${path2} must have at most ${schema.maxLength} characters.`);
|
|
46525
|
-
if (schema.pattern !== void 0 && !patternFor(schema, path2).test(value))
|
|
46526
|
-
errors.push(`${path2} must match pattern ${schema.pattern}.`);
|
|
46527
|
-
}
|
|
46528
|
-
if (typeof value === "number") {
|
|
46529
|
-
if (schema.minimum !== void 0 && value < schema.minimum)
|
|
46530
|
-
errors.push(`${path2} must be >= ${schema.minimum}.`);
|
|
46531
|
-
if (schema.maximum !== void 0 && value > schema.maximum)
|
|
46532
|
-
errors.push(`${path2} must be <= ${schema.maximum}.`);
|
|
46533
|
-
if (schema.exclusiveMinimum !== void 0 && value <= schema.exclusiveMinimum)
|
|
46534
|
-
errors.push(`${path2} must be > ${schema.exclusiveMinimum}.`);
|
|
46535
|
-
if (schema.exclusiveMaximum !== void 0 && value >= schema.exclusiveMaximum)
|
|
46536
|
-
errors.push(`${path2} must be < ${schema.exclusiveMaximum}.`);
|
|
46537
|
-
}
|
|
46538
|
-
if (Array.isArray(value)) {
|
|
46539
|
-
if (schema.minItems !== void 0 && value.length < schema.minItems)
|
|
46540
|
-
errors.push(`${path2} must have at least ${schema.minItems} items.`);
|
|
46541
|
-
if (schema.maxItems !== void 0 && value.length > schema.maxItems)
|
|
46542
|
-
errors.push(`${path2} must have at most ${schema.maxItems} items.`);
|
|
46543
|
-
if (schema.uniqueItems && value.some((item, index5) => value.slice(0, index5).some((other) => jsonEqual(item, other))))
|
|
46544
|
-
errors.push(`${path2} must contain unique items.`);
|
|
46545
|
-
if (schema.items)
|
|
46546
|
-
value.forEach(
|
|
46547
|
-
(item, index5) => errors.push(...validateAgentToolInput(schema.items, item, `${path2}[${index5}]`))
|
|
46548
|
-
);
|
|
46549
|
-
}
|
|
46550
|
-
if (isRecord2(value)) {
|
|
46551
|
-
for (const key of schema.required ?? []) {
|
|
46552
|
-
if (!Object.hasOwn(value, key)) errors.push(`${path2}.${key} is required.`);
|
|
46553
|
-
}
|
|
46554
|
-
for (const [key, item] of Object.entries(value)) {
|
|
46555
|
-
const property = schema.properties && Object.hasOwn(schema.properties, key) ? schema.properties[key] : void 0;
|
|
46556
|
-
if (property) errors.push(...validateAgentToolInput(property, item, `${path2}.${key}`));
|
|
46557
|
-
else if (schema.additionalProperties === false) errors.push(`${path2}.${key} is not allowed.`);
|
|
46558
|
-
}
|
|
46559
|
-
}
|
|
46560
|
-
return errors;
|
|
46561
|
-
}
|
|
46562
|
-
|
|
46563
|
-
// src/tool-presentation.tsx
|
|
46564
|
-
import { useChat, useToolPresentations } from "./react.js";
|
|
46565
|
-
import { Fragment as Fragment15, jsx as jsx97, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
46566
|
-
var RenderBoundary = class extends Component {
|
|
46567
|
-
state = { failed: false };
|
|
46568
|
-
static getDerivedStateFromError() {
|
|
46569
|
-
return { failed: true };
|
|
46570
|
-
}
|
|
46571
|
-
componentDidCatch(error) {
|
|
46572
|
-
this.props.report(error);
|
|
46573
|
-
}
|
|
46574
|
-
render() {
|
|
46575
|
-
return this.state.failed ? this.props.fallback : this.props.children;
|
|
46576
|
-
}
|
|
46577
|
-
};
|
|
46578
|
-
var ToolContent = memo8(function ToolContent2({
|
|
46579
|
-
presentation,
|
|
46580
|
-
context
|
|
46581
|
-
}) {
|
|
46582
|
-
return /* @__PURE__ */ jsx97(Fragment15, { children: presentation.render(context) });
|
|
46583
|
-
});
|
|
46584
|
-
function ToolPresentationUI({
|
|
46585
|
-
presentation: tool2,
|
|
46586
|
-
...props
|
|
46587
|
-
}) {
|
|
46588
|
-
const registry = useToolPresentations();
|
|
46589
|
-
const chat = useChat();
|
|
46590
|
-
const presentation = registry?.controller?.get(props.toolName);
|
|
46591
|
-
const schema = presentation?.definition.inputSchema;
|
|
46592
|
-
const parsed = useMemo13(() => {
|
|
46593
|
-
if (!schema) return;
|
|
46594
|
-
try {
|
|
46595
|
-
const input = JSON.parse(props.argsText);
|
|
46596
|
-
if (!validateAgentToolInput(schema, input).length) return { input };
|
|
46597
|
-
} catch {
|
|
46598
|
-
}
|
|
46599
|
-
return;
|
|
46600
|
-
}, [schema, props.argsText]);
|
|
46601
|
-
const decoded = useMemo13(
|
|
46602
|
-
() => typeof props.result === "string" ? decodeToolResult(props.result, props.toolName) : void 0,
|
|
46603
|
-
[props.result, props.toolName]
|
|
46604
|
-
);
|
|
46605
|
-
const state = tool2?.type === "tool" ? tool2.toolState : void 0;
|
|
46606
|
-
const status = state === "cancelled" || state === "rejected" || props.result === void 0 && props.status.type === "incomplete" && props.status.reason === "cancelled" ? "cancelled" : state || props.isError || props.result === void 0 && props.status.type === "incomplete" ? "error" : props.result === void 0 ? "running" : "success";
|
|
46607
|
-
const context = useMemo13(
|
|
46608
|
-
() => parsed ? {
|
|
46609
|
-
input: parsed.input,
|
|
46610
|
-
status,
|
|
46611
|
-
...status === "success" ? { result: decoded ? decoded.value : props.result } : {}
|
|
46612
|
-
} : void 0,
|
|
46613
|
-
[parsed, status, decoded, props.result]
|
|
46614
|
-
);
|
|
46615
|
-
const fallback = /* @__PURE__ */ jsx97(ToolCall, { ...props, presentation: tool2 });
|
|
46616
|
-
if (!presentation || !context || decoded?.omitted || chat.interrupt?.toolName === props.toolName && tool2?.type === "tool" && tool2.result === void 0)
|
|
46617
|
-
return fallback;
|
|
46618
|
-
return /* @__PURE__ */ jsxs29(
|
|
46619
|
-
RenderBoundary,
|
|
46620
|
-
{
|
|
46621
|
-
fallback,
|
|
46622
|
-
report: (error) => registry?.report(error, chat.activeSessionId, props.toolCallId),
|
|
46623
|
-
children: [
|
|
46624
|
-
/* @__PURE__ */ jsx97("div", { className: cn("my-2 min-w-0 max-w-full"), "data-slot": "nexface-tool-content", children: /* @__PURE__ */ jsx97(ToolContent, { presentation, context }) }),
|
|
46625
|
-
props.showDetails ? fallback : null
|
|
46626
|
-
]
|
|
46627
|
-
},
|
|
46628
|
-
props.toolCallId
|
|
46629
|
-
);
|
|
46630
|
-
}
|
|
46631
|
-
|
|
46632
|
-
// src/assistant-components.tsx
|
|
46633
|
-
import { Fragment as Fragment16, jsx as jsx98, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
46411
|
+
import { Fragment as Fragment15, jsx as jsx97, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
46634
46412
|
function AttachmentTile({
|
|
46635
46413
|
binding,
|
|
46636
46414
|
savedPreview
|
|
46637
46415
|
}) {
|
|
46638
46416
|
const attachment = useAuiState((s) => s.attachment);
|
|
46639
46417
|
const preview = binding?.attachments.preview(attachment.id) ?? savedPreview ?? attachment.content?.find((part) => part.type === "image")?.image;
|
|
46640
|
-
return /* @__PURE__ */
|
|
46641
|
-
/* @__PURE__ */
|
|
46642
|
-
binding && attachment.status.type === "requires-action" ? /* @__PURE__ */
|
|
46643
|
-
attachment.status.type === "running" ? /* @__PURE__ */
|
|
46644
|
-
attachment.status.type === "incomplete" ? /* @__PURE__ */
|
|
46418
|
+
return /* @__PURE__ */ jsx97(AttachmentUI, { preview, children: /* @__PURE__ */ jsxs28("div", { className: cn("flex max-w-40 flex-col text-xs wrap-anywhere"), children: [
|
|
46419
|
+
/* @__PURE__ */ jsx97(AttachmentPrimitiveName, {}),
|
|
46420
|
+
binding && attachment.status.type === "requires-action" ? /* @__PURE__ */ jsx97("small", { className: cn("text-muted-foreground"), children: "\u5DF2\u5C31\u7EEA" }) : null,
|
|
46421
|
+
attachment.status.type === "running" ? /* @__PURE__ */ jsx97("small", { className: cn("text-muted-foreground"), children: "\u6B63\u5728\u5904\u7406\u2026" }) : null,
|
|
46422
|
+
attachment.status.type === "incomplete" ? /* @__PURE__ */ jsx97("small", { className: cn("text-destructive"), role: "alert", children: attachment.status.message ?? "Attachment processing failed" }) : null
|
|
46645
46423
|
] }) });
|
|
46646
46424
|
}
|
|
46647
46425
|
function AssistantComposer({
|
|
@@ -46669,7 +46447,7 @@ function AssistantComposer({
|
|
|
46669
46447
|
(error) => binding.setNotice(error instanceof Error ? error.message : String(error))
|
|
46670
46448
|
);
|
|
46671
46449
|
};
|
|
46672
|
-
return /* @__PURE__ */
|
|
46450
|
+
return /* @__PURE__ */ jsxs28(
|
|
46673
46451
|
Composer,
|
|
46674
46452
|
{
|
|
46675
46453
|
onSubmit: (event) => {
|
|
@@ -46693,19 +46471,19 @@ function AssistantComposer({
|
|
|
46693
46471
|
}
|
|
46694
46472
|
}
|
|
46695
46473
|
},
|
|
46696
|
-
actions: /* @__PURE__ */
|
|
46697
|
-
voiceBusy ? /* @__PURE__ */
|
|
46698
|
-
voiceBusy ? /* @__PURE__ */
|
|
46474
|
+
actions: /* @__PURE__ */ jsxs28(Fragment15, { children: [
|
|
46475
|
+
voiceBusy ? /* @__PURE__ */ jsx97("span", { role: "status", className: cn("sr-only"), children: binding.voice.status === "starting" ? "\u6B63\u5728\u51C6\u5907\u8BED\u97F3\u8F93\u5165\uFF0C\u8BF7\u786E\u8BA4\u9EA6\u514B\u98CE\u5DF2\u6388\u6743\u2026" : binding.voice.status === "transcribing" ? "\u6B63\u5728\u8BC6\u522B\uFF0C\u8BF7\u7A0D\u5019\u2026" : "\u6B63\u5728\u5F55\u97F3" }) : null,
|
|
46476
|
+
voiceBusy ? /* @__PURE__ */ jsx97(
|
|
46699
46477
|
TooltipIconButton,
|
|
46700
46478
|
{
|
|
46701
46479
|
tooltip: "\u53D6\u6D88\u5F55\u97F3",
|
|
46702
46480
|
"aria-label": "\u53D6\u6D88\u8BED\u97F3\u8F93\u5165",
|
|
46703
46481
|
className: cn("size-7 shrink-0"),
|
|
46704
46482
|
onClick: binding.voice.cancel,
|
|
46705
|
-
children: /* @__PURE__ */
|
|
46483
|
+
children: /* @__PURE__ */ jsx97(X, { className: cn("size-4") })
|
|
46706
46484
|
}
|
|
46707
|
-
) : options2 !== false ? /* @__PURE__ */
|
|
46708
|
-
/* @__PURE__ */
|
|
46485
|
+
) : options2 !== false ? /* @__PURE__ */ jsxs28(Fragment15, { children: [
|
|
46486
|
+
/* @__PURE__ */ jsx97(
|
|
46709
46487
|
"input",
|
|
46710
46488
|
{
|
|
46711
46489
|
ref: input,
|
|
@@ -46720,7 +46498,7 @@ function AssistantComposer({
|
|
|
46720
46498
|
}
|
|
46721
46499
|
}
|
|
46722
46500
|
),
|
|
46723
|
-
/* @__PURE__ */
|
|
46501
|
+
/* @__PURE__ */ jsx97(
|
|
46724
46502
|
"button",
|
|
46725
46503
|
{
|
|
46726
46504
|
type: "button",
|
|
@@ -46730,21 +46508,21 @@ function AssistantComposer({
|
|
|
46730
46508
|
"aria-label": "\u6DFB\u52A0\u9644\u4EF6",
|
|
46731
46509
|
disabled: inputDisabled,
|
|
46732
46510
|
onClick: () => input.current?.click(),
|
|
46733
|
-
children: /* @__PURE__ */
|
|
46511
|
+
children: /* @__PURE__ */ jsx97(Plus, { className: cn("size-4") })
|
|
46734
46512
|
}
|
|
46735
46513
|
)
|
|
46736
|
-
] }) : /* @__PURE__ */
|
|
46737
|
-
voiceBusy ? /* @__PURE__ */
|
|
46738
|
-
/* @__PURE__ */
|
|
46739
|
-
/* @__PURE__ */
|
|
46740
|
-
/* @__PURE__ */
|
|
46741
|
-
/* @__PURE__ */
|
|
46514
|
+
] }) : /* @__PURE__ */ jsx97("span", {}),
|
|
46515
|
+
voiceBusy ? /* @__PURE__ */ jsx97(ComposerVoice, { recording: binding.voice.status === "recording" }) : null,
|
|
46516
|
+
/* @__PURE__ */ jsxs28("div", { className: cn("flex shrink-0 items-center gap-1"), children: [
|
|
46517
|
+
/* @__PURE__ */ jsxs28(AuiIf, { condition: (state) => state.thread.capabilities.dictation, children: [
|
|
46518
|
+
/* @__PURE__ */ jsx97(AuiIf, { condition: (state) => state.composer.dictation == null, children: /* @__PURE__ */ jsx97(TooltipProvider2, { delayDuration: 0, children: /* @__PURE__ */ jsxs28(Tooltip2, { children: [
|
|
46519
|
+
/* @__PURE__ */ jsx97(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsx97(
|
|
46742
46520
|
"span",
|
|
46743
46521
|
{
|
|
46744
46522
|
className: cn("inline-flex"),
|
|
46745
46523
|
tabIndex: voiceDisabledReason ? 0 : void 0,
|
|
46746
46524
|
"aria-label": voiceDisabledReason,
|
|
46747
|
-
children: /* @__PURE__ */
|
|
46525
|
+
children: /* @__PURE__ */ jsx97(ComposerPrimitiveDictate, { asChild: true, disabled: busy || sending, children: /* @__PURE__ */ jsx97(
|
|
46748
46526
|
Button,
|
|
46749
46527
|
{
|
|
46750
46528
|
variant: "ghost",
|
|
@@ -46752,19 +46530,19 @@ function AssistantComposer({
|
|
|
46752
46530
|
"aria-label": "\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",
|
|
46753
46531
|
"aria-description": voiceDisabledReason,
|
|
46754
46532
|
className: cn("size-7 p-1"),
|
|
46755
|
-
children: /* @__PURE__ */
|
|
46533
|
+
children: /* @__PURE__ */ jsx97(Mic, { className: cn("size-4") })
|
|
46756
46534
|
}
|
|
46757
46535
|
) })
|
|
46758
46536
|
}
|
|
46759
46537
|
) }),
|
|
46760
|
-
/* @__PURE__ */
|
|
46538
|
+
/* @__PURE__ */ jsx97(TooltipContent3, { children: voiceDisabledReason ?? "\u8BED\u97F3\u8F93\u5165" })
|
|
46761
46539
|
] }) }) }),
|
|
46762
|
-
/* @__PURE__ */
|
|
46540
|
+
/* @__PURE__ */ jsx97(AuiIf, { condition: (state) => state.composer.dictation != null, children: /* @__PURE__ */ jsx97(
|
|
46763
46541
|
ComposerPrimitiveStopDictation,
|
|
46764
46542
|
{
|
|
46765
46543
|
asChild: true,
|
|
46766
46544
|
disabled: binding.voice.status !== "recording",
|
|
46767
|
-
children: /* @__PURE__ */
|
|
46545
|
+
children: /* @__PURE__ */ jsx97(
|
|
46768
46546
|
"button",
|
|
46769
46547
|
{
|
|
46770
46548
|
type: "button",
|
|
@@ -46773,13 +46551,13 @@ function AssistantComposer({
|
|
|
46773
46551
|
className: cn(
|
|
46774
46552
|
"text-destructive rounded-control grid size-7 place-items-center transition-colors disabled:opacity-50"
|
|
46775
46553
|
),
|
|
46776
|
-
children: /* @__PURE__ */
|
|
46554
|
+
children: /* @__PURE__ */ jsx97(Square, { className: cn("size-3 animate-pulse fill-current") })
|
|
46777
46555
|
}
|
|
46778
46556
|
)
|
|
46779
46557
|
}
|
|
46780
46558
|
) })
|
|
46781
46559
|
] }),
|
|
46782
|
-
showCancel ? /* @__PURE__ */
|
|
46560
|
+
showCancel ? /* @__PURE__ */ jsx97(
|
|
46783
46561
|
"button",
|
|
46784
46562
|
{
|
|
46785
46563
|
type: "button",
|
|
@@ -46789,9 +46567,9 @@ function AssistantComposer({
|
|
|
46789
46567
|
),
|
|
46790
46568
|
disabled: cancelling,
|
|
46791
46569
|
onClick: cancel,
|
|
46792
|
-
children: /* @__PURE__ */
|
|
46570
|
+
children: /* @__PURE__ */ jsx97(Square, { className: cn("size-3 fill-current") })
|
|
46793
46571
|
}
|
|
46794
|
-
) : /* @__PURE__ */
|
|
46572
|
+
) : /* @__PURE__ */ jsx97(ComposerPrimitiveSend, { asChild: true, disabled: inputDisabled, children: /* @__PURE__ */ jsx97(
|
|
46795
46573
|
"button",
|
|
46796
46574
|
{
|
|
46797
46575
|
type: "button",
|
|
@@ -46803,13 +46581,13 @@ function AssistantComposer({
|
|
|
46803
46581
|
className: cn(
|
|
46804
46582
|
"bg-primary text-primary-foreground rounded-control grid size-7 place-items-center transition-opacity disabled:opacity-40"
|
|
46805
46583
|
),
|
|
46806
|
-
children: /* @__PURE__ */
|
|
46584
|
+
children: /* @__PURE__ */ jsx97(ArrowUp, { className: cn("size-4") })
|
|
46807
46585
|
}
|
|
46808
46586
|
) })
|
|
46809
46587
|
] })
|
|
46810
46588
|
] }),
|
|
46811
46589
|
children: [
|
|
46812
|
-
/* @__PURE__ */
|
|
46590
|
+
/* @__PURE__ */ jsx97(
|
|
46813
46591
|
"div",
|
|
46814
46592
|
{
|
|
46815
46593
|
ref: (element2) => {
|
|
@@ -46818,10 +46596,10 @@ function AssistantComposer({
|
|
|
46818
46596
|
className: cn(
|
|
46819
46597
|
"aui-composer-attachments flex w-full flex-row items-center gap-2 overflow-x-auto empty:hidden"
|
|
46820
46598
|
),
|
|
46821
|
-
children: /* @__PURE__ */
|
|
46599
|
+
children: /* @__PURE__ */ jsx97(ComposerPrimitiveAttachments, { children: () => /* @__PURE__ */ jsx97(AttachmentTile, { binding }) })
|
|
46822
46600
|
}
|
|
46823
46601
|
),
|
|
46824
|
-
sending ? /* @__PURE__ */
|
|
46602
|
+
sending ? /* @__PURE__ */ jsx97("small", { role: "status", children: "\u6B63\u5728\u5904\u7406\u9644\u4EF6\u2026" }) : null
|
|
46825
46603
|
]
|
|
46826
46604
|
}
|
|
46827
46605
|
);
|
|
@@ -46840,8 +46618,8 @@ function ToolGroup({
|
|
|
46840
46618
|
if (errorIds !== "[]") setOpen(true);
|
|
46841
46619
|
}, [errorIds]);
|
|
46842
46620
|
const unknown = hasErrors && errors.every((error) => error.scope === "tool" && error.execution === "unknown");
|
|
46843
|
-
return /* @__PURE__ */
|
|
46844
|
-
/* @__PURE__ */
|
|
46621
|
+
return /* @__PURE__ */ jsxs28(ToolGroupRoot, { variant: "ghost", className: cn("my-1"), open, onOpenChange: setOpen, children: [
|
|
46622
|
+
/* @__PURE__ */ jsx97(
|
|
46845
46623
|
DisclosureTrigger,
|
|
46846
46624
|
{
|
|
46847
46625
|
live: running && !hasErrors,
|
|
@@ -46849,7 +46627,7 @@ function ToolGroup({
|
|
|
46849
46627
|
detail: `${count3} tools`
|
|
46850
46628
|
}
|
|
46851
46629
|
),
|
|
46852
|
-
/* @__PURE__ */
|
|
46630
|
+
/* @__PURE__ */ jsx97(ToolGroupContent, { className: cn(disclosureContentClass), children })
|
|
46853
46631
|
] });
|
|
46854
46632
|
}
|
|
46855
46633
|
var GroupedParts = MessagePrimitiveGroupedParts;
|
|
@@ -46863,88 +46641,81 @@ function AssistantParts({
|
|
|
46863
46641
|
showDetails,
|
|
46864
46642
|
tools = []
|
|
46865
46643
|
}) {
|
|
46866
|
-
|
|
46867
|
-
|
|
46868
|
-
|
|
46869
|
-
|
|
46870
|
-
|
|
46871
|
-
|
|
46872
|
-
|
|
46873
|
-
|
|
46874
|
-
|
|
46875
|
-
|
|
46876
|
-
|
|
46877
|
-
|
|
46878
|
-
|
|
46879
|
-
|
|
46880
|
-
|
|
46881
|
-
|
|
46882
|
-
|
|
46883
|
-
|
|
46884
|
-
|
|
46885
|
-
|
|
46886
|
-
|
|
46887
|
-
|
|
46888
|
-
|
|
46889
|
-
|
|
46890
|
-
|
|
46891
|
-
|
|
46892
|
-
|
|
46893
|
-
|
|
46894
|
-
|
|
46895
|
-
|
|
46896
|
-
|
|
46897
|
-
|
|
46898
|
-
|
|
46899
|
-
),
|
|
46900
|
-
/* @__PURE__ */
|
|
46901
|
-
|
|
46902
|
-
|
|
46903
|
-
|
|
46904
|
-
|
|
46905
|
-
|
|
46906
|
-
|
|
46907
|
-
|
|
46908
|
-
|
|
46909
|
-
|
|
46910
|
-
|
|
46911
|
-
|
|
46912
|
-
|
|
46913
|
-
|
|
46914
|
-
|
|
46915
|
-
|
|
46916
|
-
|
|
46917
|
-
|
|
46918
|
-
|
|
46919
|
-
|
|
46920
|
-
|
|
46921
|
-
|
|
46922
|
-
|
|
46923
|
-
|
|
46924
|
-
|
|
46925
|
-
|
|
46926
|
-
|
|
46927
|
-
|
|
46928
|
-
|
|
46929
|
-
|
|
46930
|
-
);
|
|
46931
|
-
case "indicator":
|
|
46932
|
-
return /* @__PURE__ */ jsx98(TraceLine, { live: true, label: "thinking" });
|
|
46933
|
-
default:
|
|
46934
|
-
return null;
|
|
46935
|
-
}
|
|
46936
|
-
}
|
|
46644
|
+
return /* @__PURE__ */ jsx97(Fragment15, { children: /* @__PURE__ */ jsx97(GroupedParts, { groupBy: groupAssistantParts, children: ({ part, children }) => {
|
|
46645
|
+
switch (part.type) {
|
|
46646
|
+
case "group-chainOfThought":
|
|
46647
|
+
return /* @__PURE__ */ jsx97("div", { className: cn("mb-3"), children });
|
|
46648
|
+
case "group-tool":
|
|
46649
|
+
return part.indices.length === 1 ? /* @__PURE__ */ jsx97(Fragment15, { children }) : /* @__PURE__ */ jsx97(
|
|
46650
|
+
ToolGroup,
|
|
46651
|
+
{
|
|
46652
|
+
tools: tools.filter((_, index5) => part.indices.includes(index5)),
|
|
46653
|
+
running: part.status.type === "running",
|
|
46654
|
+
count: part.indices.length,
|
|
46655
|
+
children
|
|
46656
|
+
}
|
|
46657
|
+
);
|
|
46658
|
+
case "group-reasoning":
|
|
46659
|
+
return /* @__PURE__ */ jsxs28(
|
|
46660
|
+
ReasoningRoot3,
|
|
46661
|
+
{
|
|
46662
|
+
variant: "ghost",
|
|
46663
|
+
streaming: part.status.type === "running",
|
|
46664
|
+
className: cn("my-1"),
|
|
46665
|
+
children: [
|
|
46666
|
+
/* @__PURE__ */ jsx97(
|
|
46667
|
+
DisclosureTrigger,
|
|
46668
|
+
{
|
|
46669
|
+
live: part.status.type === "running",
|
|
46670
|
+
label: part.status.type === "running" ? "thinking" : "reasoning"
|
|
46671
|
+
}
|
|
46672
|
+
),
|
|
46673
|
+
/* @__PURE__ */ jsx97(
|
|
46674
|
+
ReasoningContent,
|
|
46675
|
+
{
|
|
46676
|
+
"aria-busy": part.status.type === "running",
|
|
46677
|
+
className: cn(disclosureContentClass),
|
|
46678
|
+
children: /* @__PURE__ */ jsx97(ReasoningText, { className: cn("ps-0"), children })
|
|
46679
|
+
}
|
|
46680
|
+
)
|
|
46681
|
+
]
|
|
46682
|
+
}
|
|
46683
|
+
);
|
|
46684
|
+
case "reasoning":
|
|
46685
|
+
return /* @__PURE__ */ jsx97(Reasoning, { ...part });
|
|
46686
|
+
case "group-source":
|
|
46687
|
+
case "source":
|
|
46688
|
+
return null;
|
|
46689
|
+
case "data":
|
|
46690
|
+
return part.dataRendererUI;
|
|
46691
|
+
case "text":
|
|
46692
|
+
return part.text === "" && part.status?.type === "running" ? /* @__PURE__ */ jsx97(TraceLine, { live: true, label: "thinking" }) : /* @__PURE__ */ jsx97(MarkdownText, {});
|
|
46693
|
+
case "tool-call":
|
|
46694
|
+
return part.toolUI ?? /* @__PURE__ */ jsx97(
|
|
46695
|
+
ToolCall,
|
|
46696
|
+
{
|
|
46697
|
+
...part,
|
|
46698
|
+
showDetails,
|
|
46699
|
+
presentation: tools.find(
|
|
46700
|
+
(tool2) => tool2.type === "tool" && tool2.toolCallId === part.toolCallId
|
|
46701
|
+
)
|
|
46702
|
+
}
|
|
46703
|
+
);
|
|
46704
|
+
case "indicator":
|
|
46705
|
+
return /* @__PURE__ */ jsx97(TraceLine, { live: true, label: "thinking" });
|
|
46706
|
+
default:
|
|
46707
|
+
return null;
|
|
46937
46708
|
}
|
|
46938
|
-
) });
|
|
46709
|
+
} }) });
|
|
46939
46710
|
}
|
|
46940
46711
|
|
|
46941
46712
|
// src/default-chat.tsx
|
|
46942
|
-
import { useChat
|
|
46713
|
+
import { useChat } from "./react.js";
|
|
46943
46714
|
import { sendErrorNotice } from "./errors.js";
|
|
46944
|
-
import { Fragment as
|
|
46715
|
+
import { Fragment as Fragment16, jsx as jsx98, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
46945
46716
|
var textOf = (message) => message.parts.flatMap((part) => part.type === "text" ? [part.text] : []).join("");
|
|
46946
46717
|
var Icon2 = forwardRef33(function Icon3({ label, children, className, ...props }, ref) {
|
|
46947
|
-
return /* @__PURE__ */
|
|
46718
|
+
return /* @__PURE__ */ jsx98(
|
|
46948
46719
|
"button",
|
|
46949
46720
|
{
|
|
46950
46721
|
ref,
|
|
@@ -46989,7 +46760,7 @@ function Resize({
|
|
|
46989
46760
|
return () => observer.disconnect();
|
|
46990
46761
|
}, [min2, max2]);
|
|
46991
46762
|
const clamp2 = (value) => Math.max(min2, Math.min(max2, window.innerWidth - 32, value));
|
|
46992
|
-
return /* @__PURE__ */
|
|
46763
|
+
return /* @__PURE__ */ jsx98(
|
|
46993
46764
|
"div",
|
|
46994
46765
|
{
|
|
46995
46766
|
ref: handle2,
|
|
@@ -47034,7 +46805,6 @@ function Chat({
|
|
|
47034
46805
|
avatar,
|
|
47035
46806
|
welcomeMessage = "\u4ECA\u5929\u60F3\u8BA9\u6211\u5E2E\u4F60\u505A\u4EC0\u4E48\uFF1F",
|
|
47036
46807
|
welcomeDescription,
|
|
47037
|
-
welcomeIcon,
|
|
47038
46808
|
open = true,
|
|
47039
46809
|
onOpenChange,
|
|
47040
46810
|
placeholder = "\u63CF\u8FF0\u4F60\u7684\u4EFB\u52A1...",
|
|
@@ -47051,7 +46821,7 @@ function Chat({
|
|
|
47051
46821
|
onFullscreenChange,
|
|
47052
46822
|
onRunResult
|
|
47053
46823
|
}) {
|
|
47054
|
-
const chat =
|
|
46824
|
+
const chat = useChat();
|
|
47055
46825
|
const nextMessage = useNextMessage(chat, suggestNextMessage, open);
|
|
47056
46826
|
const { activeSessionId: sessionId, messages, status, interrupt } = chat;
|
|
47057
46827
|
const busy = status !== "idle" && status !== "error";
|
|
@@ -47104,7 +46874,7 @@ function Chat({
|
|
|
47104
46874
|
}
|
|
47105
46875
|
updateDialog(next);
|
|
47106
46876
|
};
|
|
47107
|
-
const byId =
|
|
46877
|
+
const byId = useMemo13(
|
|
47108
46878
|
() => new Map(projectMessages(messages).map((message) => [message.id, message])),
|
|
47109
46879
|
[messages]
|
|
47110
46880
|
);
|
|
@@ -47155,7 +46925,7 @@ function Chat({
|
|
|
47155
46925
|
throw error;
|
|
47156
46926
|
}
|
|
47157
46927
|
};
|
|
47158
|
-
return /* @__PURE__ */
|
|
46928
|
+
return /* @__PURE__ */ jsx98(Fragment16, { children: chat.sessions.filter((session) => visited.current.has(session.id)).map((session) => /* @__PURE__ */ jsx98(
|
|
47159
46929
|
SessionRuntime,
|
|
47160
46930
|
{
|
|
47161
46931
|
id: session.id,
|
|
@@ -47167,7 +46937,7 @@ function Chat({
|
|
|
47167
46937
|
open,
|
|
47168
46938
|
onEdit: editThroughRuntime,
|
|
47169
46939
|
children: (binding) => {
|
|
47170
|
-
const history = sidebarOpen ? /* @__PURE__ */
|
|
46940
|
+
const history = sidebarOpen ? /* @__PURE__ */ jsxs29(
|
|
47171
46941
|
"nav",
|
|
47172
46942
|
{
|
|
47173
46943
|
ref: sidebarNav,
|
|
@@ -47193,7 +46963,7 @@ function Chat({
|
|
|
47193
46963
|
style: sidebarLayout === "overlay" && sidebarWidth !== void 0 ? { width: sidebarWidth } : void 0,
|
|
47194
46964
|
"aria-label": "\u4F1A\u8BDD\u5386\u53F2",
|
|
47195
46965
|
children: [
|
|
47196
|
-
sidebarLayout === "overlay" ? /* @__PURE__ */
|
|
46966
|
+
sidebarLayout === "overlay" ? /* @__PURE__ */ jsx98(
|
|
47197
46967
|
Resize,
|
|
47198
46968
|
{
|
|
47199
46969
|
label: "\u8C03\u6574\u4F1A\u8BDD\u5386\u53F2\u680F\u5BBD\u5EA6",
|
|
@@ -47204,33 +46974,33 @@ function Chat({
|
|
|
47204
46974
|
max: 400
|
|
47205
46975
|
}
|
|
47206
46976
|
) : null,
|
|
47207
|
-
/* @__PURE__ */
|
|
46977
|
+
/* @__PURE__ */ jsxs29(
|
|
47208
46978
|
"div",
|
|
47209
46979
|
{
|
|
47210
46980
|
className: cn(
|
|
47211
46981
|
"flex h-12 shrink-0 items-center gap-2 border-b border-foreground/10 px-4 md:px-5"
|
|
47212
46982
|
),
|
|
47213
46983
|
children: [
|
|
47214
|
-
sidebarLayout === "overlay" ? /* @__PURE__ */
|
|
46984
|
+
sidebarLayout === "overlay" ? /* @__PURE__ */ jsx98(
|
|
47215
46985
|
Icon2,
|
|
47216
46986
|
{
|
|
47217
46987
|
label: "\u6536\u8D77\u4F1A\u8BDD\u5386\u53F2",
|
|
47218
46988
|
"aria-expanded": sidebarOpen,
|
|
47219
46989
|
className: cn("size-7 shrink-0"),
|
|
47220
46990
|
onClick: () => setSidebar(false),
|
|
47221
|
-
children: /* @__PURE__ */
|
|
46991
|
+
children: /* @__PURE__ */ jsx98(PanelLeft, { className: cn("size-4") })
|
|
47222
46992
|
}
|
|
47223
46993
|
) : null,
|
|
47224
|
-
/* @__PURE__ */
|
|
47225
|
-
avatar ? /* @__PURE__ */
|
|
47226
|
-
/* @__PURE__ */
|
|
46994
|
+
/* @__PURE__ */ jsxs29(Avatar3, { children: [
|
|
46995
|
+
avatar ? /* @__PURE__ */ jsx98(AvatarImage3, { src: avatar, alt: "" }) : null,
|
|
46996
|
+
/* @__PURE__ */ jsx98(AvatarFallback3, { children: /* @__PURE__ */ jsx98(Bot, { size: 20 }) })
|
|
47227
46997
|
] }),
|
|
47228
|
-
/* @__PURE__ */
|
|
46998
|
+
/* @__PURE__ */ jsx98("strong", { className: cn("min-w-0 flex-1 truncate text-[13px] font-medium"), children: title })
|
|
47229
46999
|
]
|
|
47230
47000
|
}
|
|
47231
47001
|
),
|
|
47232
|
-
/* @__PURE__ */
|
|
47233
|
-
/* @__PURE__ */
|
|
47002
|
+
/* @__PURE__ */ jsxs29("div", { className: cn("flex min-h-0 flex-1 flex-col p-3"), children: [
|
|
47003
|
+
/* @__PURE__ */ jsx98(
|
|
47234
47004
|
ThreadListNew,
|
|
47235
47005
|
{
|
|
47236
47006
|
disabled: sessionBusy || binding.sending,
|
|
@@ -47240,20 +47010,20 @@ function Chat({
|
|
|
47240
47010
|
}
|
|
47241
47011
|
}
|
|
47242
47012
|
),
|
|
47243
|
-
/* @__PURE__ */
|
|
47244
|
-
/* @__PURE__ */
|
|
47013
|
+
/* @__PURE__ */ jsx98(ThreadListSearch, { value: threadSearch, onValueChange: setThreadSearch }),
|
|
47014
|
+
/* @__PURE__ */ jsx98(
|
|
47245
47015
|
"small",
|
|
47246
47016
|
{
|
|
47247
47017
|
className: cn("text-muted-foreground mt-5 mb-1 px-2 text-xs font-medium"),
|
|
47248
47018
|
children: "\u6700\u8FD1\u4F1A\u8BDD"
|
|
47249
47019
|
}
|
|
47250
47020
|
),
|
|
47251
|
-
/* @__PURE__ */
|
|
47021
|
+
/* @__PURE__ */ jsx98(ThreadListRoot, { children: /* @__PURE__ */ jsx98(ThreadListPrimitiveItems, { children: ({ threadListItem: session2 }) => (session2.title ?? "\u65B0\u4F1A\u8BDD").toLocaleLowerCase().includes(threadSearch.trim().toLocaleLowerCase()) ? /* @__PURE__ */ jsx98(
|
|
47252
47022
|
ThreadListItem,
|
|
47253
47023
|
{
|
|
47254
47024
|
disabled: sessionBusy || binding.sending,
|
|
47255
|
-
menu: (beginRename) => /* @__PURE__ */
|
|
47256
|
-
/* @__PURE__ */
|
|
47025
|
+
menu: (beginRename) => /* @__PURE__ */ jsxs29(Fragment16, { children: [
|
|
47026
|
+
/* @__PURE__ */ jsx98(
|
|
47257
47027
|
DropdownMenuItem3,
|
|
47258
47028
|
{
|
|
47259
47029
|
disabled: sessionBusy || binding.sending,
|
|
@@ -47261,7 +47031,7 @@ function Chat({
|
|
|
47261
47031
|
children: "\u91CD\u547D\u540D"
|
|
47262
47032
|
}
|
|
47263
47033
|
),
|
|
47264
|
-
/* @__PURE__ */
|
|
47034
|
+
/* @__PURE__ */ jsx98(
|
|
47265
47035
|
DropdownMenuItem3,
|
|
47266
47036
|
{
|
|
47267
47037
|
variant: "destructive",
|
|
@@ -47275,7 +47045,7 @@ function Chat({
|
|
|
47275
47045
|
children: "\u6E05\u7A7A\u6D88\u606F"
|
|
47276
47046
|
}
|
|
47277
47047
|
),
|
|
47278
|
-
/* @__PURE__ */
|
|
47048
|
+
/* @__PURE__ */ jsx98(
|
|
47279
47049
|
DropdownMenuItem3,
|
|
47280
47050
|
{
|
|
47281
47051
|
variant: "destructive",
|
|
@@ -47294,7 +47064,7 @@ function Chat({
|
|
|
47294
47064
|
) : null }) }),
|
|
47295
47065
|
threadSearch.trim() && !chat.sessions.some(
|
|
47296
47066
|
(session2) => session2.title.toLocaleLowerCase().includes(threadSearch.trim().toLocaleLowerCase())
|
|
47297
|
-
) ? /* @__PURE__ */
|
|
47067
|
+
) ? /* @__PURE__ */ jsx98(
|
|
47298
47068
|
"div",
|
|
47299
47069
|
{
|
|
47300
47070
|
"data-slot": "aui_thread-list-empty",
|
|
@@ -47306,7 +47076,7 @@ function Chat({
|
|
|
47306
47076
|
]
|
|
47307
47077
|
}
|
|
47308
47078
|
) : null;
|
|
47309
|
-
return open ? /* @__PURE__ */
|
|
47079
|
+
return open ? /* @__PURE__ */ jsxs29(
|
|
47310
47080
|
ChatSurface,
|
|
47311
47081
|
{
|
|
47312
47082
|
className: `nexface-chat${className ? ` ${className}` : ""}`,
|
|
@@ -47322,7 +47092,7 @@ function Chat({
|
|
|
47322
47092
|
...fullscreen ? { border: 0, borderRadius: 0 } : {}
|
|
47323
47093
|
},
|
|
47324
47094
|
children: [
|
|
47325
|
-
layout === "docked" && !fullscreen ? /* @__PURE__ */
|
|
47095
|
+
layout === "docked" && !fullscreen ? /* @__PURE__ */ jsx98(
|
|
47326
47096
|
Resize,
|
|
47327
47097
|
{
|
|
47328
47098
|
label: "\u8C03\u6574\u804A\u5929\u5BBD\u5EA6",
|
|
@@ -47335,7 +47105,7 @@ function Chat({
|
|
|
47335
47105
|
}
|
|
47336
47106
|
) : null,
|
|
47337
47107
|
sidebarLayout === "outside" ? history : null,
|
|
47338
|
-
/* @__PURE__ */
|
|
47108
|
+
/* @__PURE__ */ jsxs29(
|
|
47339
47109
|
"section",
|
|
47340
47110
|
{
|
|
47341
47111
|
ref: panel,
|
|
@@ -47344,8 +47114,8 @@ function Chat({
|
|
|
47344
47114
|
),
|
|
47345
47115
|
"aria-label": `${title} chat`,
|
|
47346
47116
|
children: [
|
|
47347
|
-
sidebarOpen && sidebarLayout === "overlay" ? /* @__PURE__ */
|
|
47348
|
-
/* @__PURE__ */
|
|
47117
|
+
sidebarOpen && sidebarLayout === "overlay" ? /* @__PURE__ */ jsxs29(Fragment16, { children: [
|
|
47118
|
+
/* @__PURE__ */ jsx98(
|
|
47349
47119
|
"button",
|
|
47350
47120
|
{
|
|
47351
47121
|
type: "button",
|
|
@@ -47357,7 +47127,7 @@ function Chat({
|
|
|
47357
47127
|
),
|
|
47358
47128
|
history
|
|
47359
47129
|
] }) : null,
|
|
47360
|
-
/* @__PURE__ */
|
|
47130
|
+
/* @__PURE__ */ jsxs29(
|
|
47361
47131
|
"div",
|
|
47362
47132
|
{
|
|
47363
47133
|
ref: (element2) => {
|
|
@@ -47368,7 +47138,7 @@ function Chat({
|
|
|
47368
47138
|
},
|
|
47369
47139
|
className: cn("flex min-h-0 min-w-0 flex-1 flex-col"),
|
|
47370
47140
|
children: [
|
|
47371
|
-
/* @__PURE__ */
|
|
47141
|
+
/* @__PURE__ */ jsxs29(
|
|
47372
47142
|
"header",
|
|
47373
47143
|
{
|
|
47374
47144
|
"data-slot": "nexface_chat_header",
|
|
@@ -47376,12 +47146,12 @@ function Chat({
|
|
|
47376
47146
|
"border-foreground/10 flex h-12 shrink-0 min-w-0 items-center gap-2 border-b px-4 md:px-5"
|
|
47377
47147
|
),
|
|
47378
47148
|
children: [
|
|
47379
|
-
/* @__PURE__ */
|
|
47149
|
+
/* @__PURE__ */ jsxs29(
|
|
47380
47150
|
"div",
|
|
47381
47151
|
{
|
|
47382
47152
|
className: cn("flex min-w-0 flex-1 items-center gap-2 whitespace-nowrap"),
|
|
47383
47153
|
children: [
|
|
47384
|
-
sidebarEnabled && (sidebarLayout === "outside" || !sidebarOpen) ? /* @__PURE__ */
|
|
47154
|
+
sidebarEnabled && (sidebarLayout === "outside" || !sidebarOpen) ? /* @__PURE__ */ jsx98(
|
|
47385
47155
|
Icon2,
|
|
47386
47156
|
{
|
|
47387
47157
|
ref: sidebarTrigger,
|
|
@@ -47389,17 +47159,17 @@ function Chat({
|
|
|
47389
47159
|
"aria-expanded": sidebarOpen,
|
|
47390
47160
|
className: cn("size-7 shrink-0"),
|
|
47391
47161
|
onClick: () => setSidebar((value) => !value),
|
|
47392
|
-
children: /* @__PURE__ */
|
|
47162
|
+
children: /* @__PURE__ */ jsx98(PanelLeft, { className: cn("size-4") })
|
|
47393
47163
|
}
|
|
47394
47164
|
) : null,
|
|
47395
|
-
/* @__PURE__ */
|
|
47165
|
+
/* @__PURE__ */ jsx98("strong", { className: cn("truncate text-[13px] font-medium"), children: activeTitle })
|
|
47396
47166
|
]
|
|
47397
47167
|
}
|
|
47398
47168
|
),
|
|
47399
|
-
/* @__PURE__ */
|
|
47400
|
-
/* @__PURE__ */
|
|
47401
|
-
/* @__PURE__ */
|
|
47402
|
-
/* @__PURE__ */
|
|
47169
|
+
/* @__PURE__ */ jsxs29("div", { className: cn("-me-1.5 ml-auto flex shrink-0 items-center gap-1.5"), children: [
|
|
47170
|
+
/* @__PURE__ */ jsxs29(DropdownMenu2, { modal: false, children: [
|
|
47171
|
+
/* @__PURE__ */ jsx98(DropdownMenuTrigger3, { asChild: true, children: /* @__PURE__ */ jsx98(Icon2, { label: "\u66F4\u591A\u4F1A\u8BDD\u64CD\u4F5C", children: /* @__PURE__ */ jsx98(Ellipsis, {}) }) }),
|
|
47172
|
+
/* @__PURE__ */ jsx98(DropdownMenuContent3, { align: "end", children: /* @__PURE__ */ jsx98(
|
|
47403
47173
|
DropdownMenuItem3,
|
|
47404
47174
|
{
|
|
47405
47175
|
variant: "destructive",
|
|
@@ -47414,47 +47184,40 @@ function Chat({
|
|
|
47414
47184
|
}
|
|
47415
47185
|
) })
|
|
47416
47186
|
] }),
|
|
47417
|
-
/* @__PURE__ */
|
|
47187
|
+
/* @__PURE__ */ jsx98(
|
|
47418
47188
|
Icon2,
|
|
47419
47189
|
{
|
|
47420
47190
|
label: "\u65B0\u5EFA\u804A\u5929\u4F1A\u8BDD",
|
|
47421
47191
|
disabled: sessionBusy || binding.sending,
|
|
47422
47192
|
onClick: () => safe(() => chat.createSession()),
|
|
47423
|
-
children: /* @__PURE__ */
|
|
47193
|
+
children: /* @__PURE__ */ jsx98(Plus, {})
|
|
47424
47194
|
}
|
|
47425
47195
|
),
|
|
47426
|
-
/* @__PURE__ */
|
|
47196
|
+
/* @__PURE__ */ jsx98(
|
|
47427
47197
|
Icon2,
|
|
47428
47198
|
{
|
|
47429
47199
|
ref: headerFocusButton,
|
|
47430
47200
|
label: fullscreen ? "\u9000\u51FA\u5168\u5C4F" : "\u5168\u5C4F",
|
|
47431
47201
|
onClick: () => changeFullscreen(!fullscreen),
|
|
47432
|
-
children: fullscreen ? /* @__PURE__ */
|
|
47202
|
+
children: fullscreen ? /* @__PURE__ */ jsx98(Minimize2, {}) : /* @__PURE__ */ jsx98(Maximize2, {})
|
|
47433
47203
|
}
|
|
47434
47204
|
),
|
|
47435
|
-
onOpenChange ? /* @__PURE__ */
|
|
47205
|
+
onOpenChange ? /* @__PURE__ */ jsx98(Icon2, { label: "\u5173\u95ED Agent \u5BF9\u8BDD", onClick: () => onOpenChange(false), children: /* @__PURE__ */ jsx98(X, {}) }) : null
|
|
47436
47206
|
] })
|
|
47437
47207
|
]
|
|
47438
47208
|
}
|
|
47439
47209
|
),
|
|
47440
|
-
/* @__PURE__ */
|
|
47210
|
+
/* @__PURE__ */ jsx98(
|
|
47441
47211
|
"div",
|
|
47442
47212
|
{
|
|
47443
47213
|
"data-slot": "nexface_chat_body",
|
|
47444
47214
|
className: cn("relative flex min-h-0 flex-1"),
|
|
47445
|
-
children: /* @__PURE__ */
|
|
47215
|
+
children: /* @__PURE__ */ jsx98(
|
|
47446
47216
|
Thread,
|
|
47447
47217
|
{
|
|
47448
47218
|
empty: !messages.length,
|
|
47449
|
-
welcome: /* @__PURE__ */
|
|
47450
|
-
|
|
47451
|
-
{
|
|
47452
|
-
title: welcomeMessage,
|
|
47453
|
-
description: welcomeDescription,
|
|
47454
|
-
icon: welcomeIcon
|
|
47455
|
-
}
|
|
47456
|
-
),
|
|
47457
|
-
suggestions: /* @__PURE__ */ jsx99(
|
|
47219
|
+
welcome: /* @__PURE__ */ jsx98(Greeting, { title: welcomeMessage, description: welcomeDescription }),
|
|
47220
|
+
suggestions: /* @__PURE__ */ jsx98(
|
|
47458
47221
|
Suggestions2,
|
|
47459
47222
|
{
|
|
47460
47223
|
suggestions,
|
|
@@ -47462,21 +47225,21 @@ function Chat({
|
|
|
47462
47225
|
onSend: (prompt) => void execute(prompt)
|
|
47463
47226
|
}
|
|
47464
47227
|
),
|
|
47465
|
-
footer: /* @__PURE__ */
|
|
47466
|
-
chat.storageWarning ? /* @__PURE__ */
|
|
47467
|
-
notice ? /* @__PURE__ */
|
|
47228
|
+
footer: /* @__PURE__ */ jsxs29(Fragment16, { children: [
|
|
47229
|
+
chat.storageWarning ? /* @__PURE__ */ jsx98("div", { role: "alert", className: cn("text-muted-foreground text-xs"), children: chat.storageWarning }) : null,
|
|
47230
|
+
notice ? /* @__PURE__ */ jsxs29("div", { role: "status", className: cn("text-muted-foreground text-xs"), children: [
|
|
47468
47231
|
notice,
|
|
47469
|
-
/* @__PURE__ */
|
|
47232
|
+
/* @__PURE__ */ jsx98("button", { onClick: () => setNotice(""), children: "\xD7" })
|
|
47470
47233
|
] }) : null,
|
|
47471
|
-
binding.notice ? /* @__PURE__ */
|
|
47234
|
+
binding.notice ? /* @__PURE__ */ jsxs29(
|
|
47472
47235
|
ErrorPrimitiveRoot,
|
|
47473
47236
|
{
|
|
47474
47237
|
className: cn(
|
|
47475
47238
|
"border-destructive/60 text-destructive flex items-start gap-3 border-l-2 pl-3 text-[13px] leading-relaxed"
|
|
47476
47239
|
),
|
|
47477
47240
|
children: [
|
|
47478
|
-
/* @__PURE__ */
|
|
47479
|
-
/* @__PURE__ */
|
|
47241
|
+
/* @__PURE__ */ jsx98("span", { className: cn("min-w-0 flex-1 break-words"), children: binding.notice }),
|
|
47242
|
+
/* @__PURE__ */ jsx98(
|
|
47480
47243
|
Icon2,
|
|
47481
47244
|
{
|
|
47482
47245
|
label: "\u5173\u95ED\u63D0\u793A",
|
|
@@ -47484,14 +47247,14 @@ function Chat({
|
|
|
47484
47247
|
"text-destructive hover:text-destructive -mt-1 -mr-1 shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-destructive/30"
|
|
47485
47248
|
),
|
|
47486
47249
|
onClick: () => binding.setNotice(""),
|
|
47487
|
-
children: /* @__PURE__ */
|
|
47250
|
+
children: /* @__PURE__ */ jsx98(X, {})
|
|
47488
47251
|
}
|
|
47489
47252
|
)
|
|
47490
47253
|
]
|
|
47491
47254
|
}
|
|
47492
47255
|
) : null
|
|
47493
47256
|
] }),
|
|
47494
|
-
composer: /* @__PURE__ */
|
|
47257
|
+
composer: /* @__PURE__ */ jsx98(
|
|
47495
47258
|
AssistantComposer,
|
|
47496
47259
|
{
|
|
47497
47260
|
binding,
|
|
@@ -47505,7 +47268,7 @@ function Chat({
|
|
|
47505
47268
|
),
|
|
47506
47269
|
renderMessage: ({ message: rendered }) => {
|
|
47507
47270
|
const message = byId.get(rendered.id);
|
|
47508
|
-
return message ? /* @__PURE__ */
|
|
47271
|
+
return message ? /* @__PURE__ */ jsx98(Fragment16, { children: editing?.id === message.id ? /* @__PURE__ */ jsx98(
|
|
47509
47272
|
EditComposer,
|
|
47510
47273
|
{
|
|
47511
47274
|
onKeyDown: (event) => {
|
|
@@ -47526,16 +47289,16 @@ function Chat({
|
|
|
47526
47289
|
type: "button",
|
|
47527
47290
|
disabled: busy || binding.sending || binding.voice.status !== "idle" || !editing.text.trim() && !editing.files.length
|
|
47528
47291
|
},
|
|
47529
|
-
children: editing.files.map((file) => /* @__PURE__ */
|
|
47292
|
+
children: editing.files.map((file) => /* @__PURE__ */ jsxs29(
|
|
47530
47293
|
"div",
|
|
47531
47294
|
{
|
|
47532
47295
|
className: cn(
|
|
47533
47296
|
"bg-muted flex min-w-0 items-center gap-2 rounded-md px-3 py-2 text-sm"
|
|
47534
47297
|
),
|
|
47535
47298
|
children: [
|
|
47536
|
-
/* @__PURE__ */
|
|
47537
|
-
/* @__PURE__ */
|
|
47538
|
-
/* @__PURE__ */
|
|
47299
|
+
/* @__PURE__ */ jsx98(Paperclip, { className: cn("size-4 shrink-0") }),
|
|
47300
|
+
/* @__PURE__ */ jsx98("span", { className: cn("min-w-0 flex-1 truncate"), children: file.name }),
|
|
47301
|
+
/* @__PURE__ */ jsx98(
|
|
47539
47302
|
TooltipIconButton,
|
|
47540
47303
|
{
|
|
47541
47304
|
tooltip: "\u79FB\u9664\u9644\u4EF6",
|
|
@@ -47548,7 +47311,7 @@ function Chat({
|
|
|
47548
47311
|
(item) => item.id !== file.id
|
|
47549
47312
|
)
|
|
47550
47313
|
}),
|
|
47551
|
-
children: /* @__PURE__ */
|
|
47314
|
+
children: /* @__PURE__ */ jsx98(X, {})
|
|
47552
47315
|
}
|
|
47553
47316
|
)
|
|
47554
47317
|
]
|
|
@@ -47556,16 +47319,16 @@ function Chat({
|
|
|
47556
47319
|
file.id
|
|
47557
47320
|
))
|
|
47558
47321
|
}
|
|
47559
|
-
) : /* @__PURE__ */
|
|
47322
|
+
) : /* @__PURE__ */ jsx98(Fragment16, { children: message.role === "user" ? /* @__PURE__ */ jsx98(
|
|
47560
47323
|
UserMessage,
|
|
47561
47324
|
{
|
|
47562
|
-
attachments: /* @__PURE__ */
|
|
47325
|
+
attachments: /* @__PURE__ */ jsx98(
|
|
47563
47326
|
"div",
|
|
47564
47327
|
{
|
|
47565
47328
|
className: cn(
|
|
47566
47329
|
"aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row flex-wrap justify-end gap-2 empty:hidden"
|
|
47567
47330
|
),
|
|
47568
|
-
children: /* @__PURE__ */
|
|
47331
|
+
children: /* @__PURE__ */ jsx98(MessagePrimitiveAttachments, { children: ({ attachment }) => /* @__PURE__ */ jsx98(
|
|
47569
47332
|
AttachmentTile,
|
|
47570
47333
|
{
|
|
47571
47334
|
savedPreview: message.attachments?.find(
|
|
@@ -47575,7 +47338,7 @@ function Chat({
|
|
|
47575
47338
|
) })
|
|
47576
47339
|
}
|
|
47577
47340
|
),
|
|
47578
|
-
actions: message.id === latestUser?.id ? /* @__PURE__ */
|
|
47341
|
+
actions: message.id === latestUser?.id ? /* @__PURE__ */ jsx98(ActionBarPrimitiveEdit, { asChild: true, children: /* @__PURE__ */ jsx98(
|
|
47579
47342
|
"button",
|
|
47580
47343
|
{
|
|
47581
47344
|
type: "button",
|
|
@@ -47587,32 +47350,32 @@ function Chat({
|
|
|
47587
47350
|
text: textOf(message),
|
|
47588
47351
|
files: message.attachments ?? []
|
|
47589
47352
|
}),
|
|
47590
|
-
children: /* @__PURE__ */
|
|
47353
|
+
children: /* @__PURE__ */ jsx98(Pencil, { className: cn("size-4") })
|
|
47591
47354
|
}
|
|
47592
47355
|
) }) : null,
|
|
47593
|
-
children: /* @__PURE__ */
|
|
47356
|
+
children: /* @__PURE__ */ jsx98(MessagePrimitiveParts2, {})
|
|
47594
47357
|
}
|
|
47595
|
-
) : /* @__PURE__ */
|
|
47358
|
+
) : /* @__PURE__ */ jsx98(AssistantMessage, { children: /* @__PURE__ */ jsx98(
|
|
47596
47359
|
AssistantParts,
|
|
47597
47360
|
{
|
|
47598
47361
|
showDetails: showToolDetails,
|
|
47599
47362
|
tools: message.parts
|
|
47600
47363
|
}
|
|
47601
|
-
) }) }) }) : /* @__PURE__ */
|
|
47364
|
+
) }) }) }) : /* @__PURE__ */ jsx98(AssistantMessage, { children: /* @__PURE__ */ jsx98(AssistantParts, { showDetails: showToolDetails }) });
|
|
47602
47365
|
},
|
|
47603
|
-
children: interrupt ? /* @__PURE__ */
|
|
47366
|
+
children: interrupt ? /* @__PURE__ */ jsxs29(
|
|
47604
47367
|
"section",
|
|
47605
47368
|
{
|
|
47606
47369
|
"aria-label": interrupt.title ?? `\u786E\u8BA4\u6267\u884C ${interrupt.toolName}\uFF1F`,
|
|
47607
47370
|
className: cn("rounded-lg bg-muted p-4"),
|
|
47608
47371
|
"data-mode": interrupt.mode,
|
|
47609
47372
|
children: [
|
|
47610
|
-
/* @__PURE__ */
|
|
47611
|
-
interrupt.description ? /* @__PURE__ */
|
|
47612
|
-
interrupt.mode === "chat" ? /* @__PURE__ */
|
|
47613
|
-
/* @__PURE__ */
|
|
47614
|
-
/* @__PURE__ */
|
|
47615
|
-
] }) : /* @__PURE__ */
|
|
47373
|
+
/* @__PURE__ */ jsx98("strong", { children: interrupt.title ?? `\u786E\u8BA4\u6267\u884C ${interrupt.toolName}\uFF1F` }),
|
|
47374
|
+
interrupt.description ? /* @__PURE__ */ jsx98("p", { className: cn("mt-1 text-muted-foreground"), children: interrupt.description }) : null,
|
|
47375
|
+
interrupt.mode === "chat" ? /* @__PURE__ */ jsxs29("div", { className: cn("mt-3 flex gap-2"), children: [
|
|
47376
|
+
/* @__PURE__ */ jsx98(Button, { onClick: chat.confirmInterrupt, children: interrupt.confirmLabel ?? "\u786E\u8BA4" }),
|
|
47377
|
+
/* @__PURE__ */ jsx98(Button, { variant: "outline", onClick: chat.rejectInterrupt, children: interrupt.rejectLabel ?? "\u62D2\u7EDD" })
|
|
47378
|
+
] }) : /* @__PURE__ */ jsx98("p", { className: cn("mt-1 text-muted-foreground"), children: "\u8BF7\u5728\u4E1A\u52A1\u9875\u9762\u5B8C\u6210\u786E\u8BA4\u3002" })
|
|
47616
47379
|
]
|
|
47617
47380
|
}
|
|
47618
47381
|
) : null
|
|
@@ -47623,7 +47386,7 @@ function Chat({
|
|
|
47623
47386
|
]
|
|
47624
47387
|
}
|
|
47625
47388
|
),
|
|
47626
|
-
/* @__PURE__ */
|
|
47389
|
+
/* @__PURE__ */ jsx98(
|
|
47627
47390
|
Dialog2,
|
|
47628
47391
|
{
|
|
47629
47392
|
open: Boolean(dialog),
|
|
@@ -47632,7 +47395,7 @@ function Chat({
|
|
|
47632
47395
|
setDialog(void 0);
|
|
47633
47396
|
}
|
|
47634
47397
|
},
|
|
47635
|
-
children: /* @__PURE__ */
|
|
47398
|
+
children: /* @__PURE__ */ jsxs29(
|
|
47636
47399
|
DialogContent3,
|
|
47637
47400
|
{
|
|
47638
47401
|
showCloseButton: false,
|
|
@@ -47646,10 +47409,10 @@ function Chat({
|
|
|
47646
47409
|
});
|
|
47647
47410
|
},
|
|
47648
47411
|
children: [
|
|
47649
|
-
/* @__PURE__ */
|
|
47650
|
-
/* @__PURE__ */
|
|
47651
|
-
/* @__PURE__ */
|
|
47652
|
-
/* @__PURE__ */
|
|
47412
|
+
/* @__PURE__ */ jsx98(DialogTitle3, { children: dialog?.title }),
|
|
47413
|
+
/* @__PURE__ */ jsx98(DialogDescription3, { children: dialog?.description }),
|
|
47414
|
+
/* @__PURE__ */ jsxs29(DialogFooter, { children: [
|
|
47415
|
+
/* @__PURE__ */ jsx98(
|
|
47653
47416
|
Button,
|
|
47654
47417
|
{
|
|
47655
47418
|
variant: "outline",
|
|
@@ -47660,7 +47423,7 @@ function Chat({
|
|
|
47660
47423
|
children: "\u53D6\u6D88"
|
|
47661
47424
|
}
|
|
47662
47425
|
),
|
|
47663
|
-
/* @__PURE__ */
|
|
47426
|
+
/* @__PURE__ */ jsx98(
|
|
47664
47427
|
Button,
|
|
47665
47428
|
{
|
|
47666
47429
|
variant: dialog?.dangerous ? "destructive" : "default",
|