@docyrus/ui-pro-ai-assistant 0.8.4 → 0.8.6

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.
@@ -9,6 +9,7 @@ interface SubmitOptions {
9
9
  supportDocumentSearch?: boolean;
10
10
  supportThinking?: boolean;
11
11
  supportWorkCanvas?: boolean;
12
+ reasoningEffort?: string;
12
13
  files?: {
13
14
  url: string;
14
15
  mediaType: string;
package/dist/index.js CHANGED
@@ -2796,12 +2796,14 @@ function AgentConsentDialog({
2796
2796
  onDeclined();
2797
2797
  };
2798
2798
  const scoped = !!container;
2799
- return /* @__PURE__ */ jsx(Dialog.Root, { open: !!pending, children: /* @__PURE__ */ jsxs(Dialog.Portal, { container: container ?? void 0, children: [
2799
+ return /* @__PURE__ */ jsx(Dialog.Root, { open: !!pending, modal: false, children: /* @__PURE__ */ jsxs(Dialog.Portal, { container: container ?? void 0, children: [
2800
2800
  /* @__PURE__ */ jsx(
2801
- Dialog.Overlay,
2801
+ "div",
2802
2802
  {
2803
+ "aria-hidden": true,
2804
+ onPointerDown: (e) => e.preventDefault(),
2803
2805
  className: cn(
2804
- "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs isolate z-[200] inset-0",
2806
+ "bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs z-[200] inset-0",
2805
2807
  scoped ? "absolute" : "fixed"
2806
2808
  )
2807
2809
  }
@@ -6000,6 +6002,11 @@ var AIInputArea = ({
6000
6002
  const [thinkingActive, setThinkingActive] = useState(initialFeatures?.thinking ?? false);
6001
6003
  const [deepResearchActive, setDeepResearchActive] = useState(initialFeatures?.deepResearch ?? false);
6002
6004
  const [workCanvasActive, setWorkCanvasActive] = useState(initialFeatures?.workCanvas ?? false);
6005
+ const [reasoningOverride, setReasoningOverride] = useState(null);
6006
+ const reasoningLevels = effectiveSupportThinking || selectedModel?.supportThinking ? selectedModel?.reasoningLevels ?? [] : [];
6007
+ const activeOverrideId = reasoningOverride && reasoningOverride.modelId === selectedModel?.id ? reasoningOverride.id : null;
6008
+ const overrideLevel = activeOverrideId ? reasoningLevels.find((level) => level.id === activeOverrideId) : void 0;
6009
+ const selectedReasoningLevel = reasoningLevels.length === 0 ? null : overrideLevel ?? reasoningLevels.find((level) => level.default) ?? reasoningLevels[0];
6003
6010
  const initialModelAppliedRef = useRef(false);
6004
6011
  useEffect(() => {
6005
6012
  if (initialModelId && models.length > 0 && !initialModelAppliedRef.current) {
@@ -6171,6 +6178,7 @@ var AIInputArea = ({
6171
6178
  supportDocumentSearch: effectiveSupportDocumentSearch && documentSearchActive,
6172
6179
  supportThinking: effectiveSupportThinking && thinkingActive,
6173
6180
  supportWorkCanvas: effectiveSupportWorkCanvas && workCanvasActive,
6181
+ reasoningEffort: selectedReasoningLevel?.id,
6174
6182
  files: message.files?.length > 0 ? message.files : void 0,
6175
6183
  mcpServerIds: activeMcpServerIds.length > 0 ? activeMcpServerIds : void 0
6176
6184
  };
@@ -6191,6 +6199,7 @@ var AIInputArea = ({
6191
6199
  thinkingActive,
6192
6200
  effectiveSupportWorkCanvas,
6193
6201
  workCanvasActive,
6202
+ selectedReasoningLevel?.id,
6194
6203
  activeMcpServers
6195
6204
  ]);
6196
6205
  const status = isLoading ? "streaming" : "ready";
@@ -6488,6 +6497,28 @@ var AIInputArea = ({
6488
6497
  thinkingActive ? ` (${t("common.active")})` : ""
6489
6498
  ] })
6490
6499
  ] }),
6500
+ reasoningLevels.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu$1, { children: [
6501
+ /* @__PURE__ */ jsxs(Tooltip$2, { children: [
6502
+ /* @__PURE__ */ jsx(TooltipTrigger$1, { asChild: true, children: /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(PromptInputButton, { variant: "ghost", className: "gap-1", children: [
6503
+ /* @__PURE__ */ jsx(Brain, { className: "w-4 h-4" }),
6504
+ selectedReasoningLevel && /* @__PURE__ */ jsx("span", { className: "max-w-20 truncate text-xs font-medium", children: selectedReasoningLevel.name }),
6505
+ /* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3 opacity-60" })
6506
+ ] }) }) }),
6507
+ /* @__PURE__ */ jsx(TooltipContent$1, { side: "top", children: t("common.reasoning") })
6508
+ ] }),
6509
+ /* @__PURE__ */ jsx(DropdownMenuContent, { align: "start", className: "min-w-[12rem] z-[10000]", children: reasoningLevels.map((level) => /* @__PURE__ */ jsxs(
6510
+ DropdownMenuItem,
6511
+ {
6512
+ onClick: () => setReasoningOverride({ modelId: selectedModel?.id ?? "", id: level.id }),
6513
+ className: cn(selectedReasoningLevel?.id === level.id && "bg-accent"),
6514
+ children: [
6515
+ /* @__PURE__ */ jsx(Brain, { className: "w-4 h-4" }),
6516
+ level.name
6517
+ ]
6518
+ },
6519
+ level.id
6520
+ )) })
6521
+ ] }),
6491
6522
  effectiveSupportDeepResearch && /* @__PURE__ */ jsxs(Tooltip$2, { children: [
6492
6523
  /* @__PURE__ */ jsx(TooltipTrigger$1, { asChild: true, children: /* @__PURE__ */ jsx(
6493
6524
  PromptInputButton,
@@ -36521,6 +36552,7 @@ var DocyAssistant = ({
36521
36552
  supportDocumentSearch: options3?.supportDocumentSearch,
36522
36553
  supportThinking: options3?.supportThinking,
36523
36554
  supportWorkCanvas: options3?.supportWorkCanvas,
36555
+ ...options3?.reasoningEffort ? { reasoningEffort: options3.reasoningEffort } : {},
36524
36556
  ...hostEnvironment ? { hostEnvironment } : {},
36525
36557
  ...appContext?.id ? { appId: appContext.id } : {},
36526
36558
  ...clientToolDefsRef.current.length ? { clientTools: clientToolDefsRef.current } : {},
@@ -37013,7 +37045,8 @@ var DocyAssistant = ({
37013
37045
  supportDeepResearch: options3?.supportDeepResearch,
37014
37046
  supportDocumentSearch: options3?.supportDocumentSearch,
37015
37047
  supportThinking: options3?.supportThinking,
37016
- supportWorkCanvas: options3?.supportWorkCanvas
37048
+ supportWorkCanvas: options3?.supportWorkCanvas,
37049
+ reasoningEffort: options3?.reasoningEffort
37017
37050
  }
37018
37051
  });
37019
37052
  } finally {
@@ -37673,7 +37706,7 @@ var DocyAssistant = ({
37673
37706
  );
37674
37707
  if (isInlineMode) {
37675
37708
  return /* @__PURE__ */ jsxs(ClientToolsProvider, { tools: clientToolMap, children: [
37676
- /* @__PURE__ */ jsxs("div", { ref: setConsentScope, className: "relative flex h-full min-h-0 w-full flex-col", children: [
37709
+ /* @__PURE__ */ jsxs("div", { ref: setConsentScope, className: "relative isolate flex h-full min-h-0 w-full flex-col", children: [
37677
37710
  renderInlineViewContent({
37678
37711
  isFullscreen: isInlineFullscreen,
37679
37712
  enableSidebar: isInlineFullscreen ? true : enableSidebar,
@@ -37732,7 +37765,7 @@ var DocyAssistant = ({
37732
37765
  },
37733
37766
  ...props,
37734
37767
  ref,
37735
- children: /* @__PURE__ */ jsxs("div", { ref: setConsentScope, className: "relative flex h-full min-h-0 w-full flex-col", children: [
37768
+ children: /* @__PURE__ */ jsxs("div", { ref: setConsentScope, className: "relative isolate flex h-full min-h-0 w-full flex-col", children: [
37736
37769
  renderInlineViewContent({
37737
37770
  isFullscreen: false,
37738
37771
  enableSidebar,