@docyrus/ui-pro-ai-assistant 0.5.6 → 0.5.8

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.
@@ -48,6 +48,7 @@ interface AIInputAreaProps {
48
48
  tenantAiProjectId?: string;
49
49
  initialModelId?: string;
50
50
  initialFeatures?: InitialFeatureFlags;
51
+ onManageMemories?: () => void;
51
52
  }
52
53
  export declare const AIInputArea: FC<AIInputAreaProps>;
53
54
  export {};
package/dist/index.js CHANGED
@@ -5522,7 +5522,8 @@ var AIInputArea = ({
5522
5522
  hideFooter = false,
5523
5523
  tenantAiProjectId,
5524
5524
  initialModelId,
5525
- initialFeatures
5525
+ initialFeatures,
5526
+ onManageMemories
5526
5527
  }) => {
5527
5528
  const { t } = useAssistantTranslation();
5528
5529
  const apiClient = useApiClient();
@@ -6237,20 +6238,38 @@ var AIInputArea = ({
6237
6238
  ),
6238
6239
  !hideFooter && /* @__PURE__ */ jsxs("div", { className: "relative mt-2 flex items-center px-1", children: [
6239
6240
  footerText && /* @__PURE__ */ jsx("span", { className: "flex-1 text-center text-xs text-muted-foreground", children: footerText }),
6240
- /* @__PURE__ */ jsxs(Tooltip$2, { children: [
6241
- /* @__PURE__ */ jsx(TooltipTrigger$1, { asChild: true, children: /* @__PURE__ */ jsx(
6242
- Button,
6243
- {
6244
- type: "button",
6245
- variant: "ghost",
6246
- size: "icon",
6247
- className: "absolute right-0 h-6 w-6 text-muted-foreground",
6248
- disabled: !threadId || !hasMessages,
6249
- onClick: handleExtractMemories,
6250
- children: /* @__PURE__ */ jsx(BrainCircuit, { className: "h-3.5 w-3.5" })
6251
- }
6252
- ) }),
6253
- /* @__PURE__ */ jsx(TooltipContent$1, { side: "top", children: t("tools.extract_memories") })
6241
+ /* @__PURE__ */ jsxs(DropdownMenu$1, { children: [
6242
+ /* @__PURE__ */ jsxs(Tooltip$2, { children: [
6243
+ /* @__PURE__ */ jsx(TooltipTrigger$1, { asChild: true, children: /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
6244
+ Button,
6245
+ {
6246
+ type: "button",
6247
+ variant: "ghost",
6248
+ size: "icon",
6249
+ className: "absolute right-0 h-6 w-6 text-muted-foreground",
6250
+ children: /* @__PURE__ */ jsx(BrainCircuit, { className: "h-3.5 w-3.5" })
6251
+ }
6252
+ ) }) }),
6253
+ /* @__PURE__ */ jsx(TooltipContent$1, { side: "top", children: t("tools.extract_memories") })
6254
+ ] }),
6255
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", side: "top", className: "w-60", children: [
6256
+ /* @__PURE__ */ jsx(
6257
+ DropdownMenuItem,
6258
+ {
6259
+ disabled: !threadId || !hasMessages,
6260
+ onClick: handleExtractMemories,
6261
+ children: "Extract Memories from Session"
6262
+ }
6263
+ ),
6264
+ /* @__PURE__ */ jsx(
6265
+ DropdownMenuItem,
6266
+ {
6267
+ disabled: !onManageMemories,
6268
+ onClick: () => onManageMemories?.(),
6269
+ children: "Manage Memories"
6270
+ }
6271
+ )
6272
+ ] })
6254
6273
  ] })
6255
6274
  ] }),
6256
6275
  /* @__PURE__ */ jsx(
@@ -14875,7 +14894,8 @@ function ChatPanel({
14875
14894
  threadId,
14876
14895
  initialModelId,
14877
14896
  initialFeatures,
14878
- subagents
14897
+ subagents,
14898
+ onManageMemories
14879
14899
  }) {
14880
14900
  const renderInputArea = (hideFooter = false) => /* @__PURE__ */ jsx(
14881
14901
  AIInputArea,
@@ -14907,7 +14927,8 @@ function ChatPanel({
14907
14927
  hasMessages: messages.length > 0,
14908
14928
  hideFooter,
14909
14929
  initialModelId,
14910
- initialFeatures
14930
+ initialFeatures,
14931
+ onManageMemories
14911
14932
  }
14912
14933
  );
14913
14934
  const isWelcome = showWelcome && messages.length === 0;
@@ -14927,7 +14948,7 @@ function ChatPanel({
14927
14948
  className: "flex flex-1 flex-col items-center overflow-y-auto p-6 transition-all duration-250 ease-out",
14928
14949
  style: { opacity: fadingOut ? 0 : 1, transform: fadingOut ? "translateY(-8px)" : "translateY(0)" },
14929
14950
  children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col", children: [
14930
- /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3 py-12", children: isLoadingAgent ? /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "p-2 bg-muted rounded-md", children: /* @__PURE__ */ jsx(Spinner, { className: "size-10 text-muted-foreground" }) }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
14951
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3 pb-6", children: isLoadingAgent ? /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "p-2 bg-muted rounded-md", children: /* @__PURE__ */ jsx(Spinner, { className: "size-10 text-muted-foreground" }) }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
14931
14952
  hasAgentAnimations(tenantAiAgentId) ? /* @__PURE__ */ jsx(AssistantAnimations, { animationType: "opening", agentId: tenantAiAgentId, className: "w-10 h-10" }) : logo ? /* @__PURE__ */ jsx(AIMessageAvatar, { src: logo, name: title || "Assistant", className: "w-10 h-10" }) : /* @__PURE__ */ jsx(AssistantAnimations, { animationType: "opening", className: "w-10 h-10" }),
14932
14953
  /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground [&_h4]:text-foreground [&_*]:my-0 [&_*+*]:mt-2", children: welcomeMessage ? /* @__PURE__ */ jsx(MessageResponse, { children: welcomeMessage }) : /* @__PURE__ */ jsx("p", { children: description || "Your AI-powered assistant for all your document needs." }) }),
14933
14954
  /* @__PURE__ */ jsx("div", { className: "mt-2", children: renderInputArea(true) })
@@ -30332,21 +30353,7 @@ var AssistantView = ({ ref, ...props }) => {
30332
30353
  children: /* @__PURE__ */ jsx(PanelLeft, { className: "w-4 h-4" })
30333
30354
  }
30334
30355
  ),
30335
- onTabChange && /* @__PURE__ */ jsx(
30336
- Button,
30337
- {
30338
- variant: "ghost",
30339
- size: "icon",
30340
- onClick: () => onTabChange(activeTab === 4 ? 0 : 4),
30341
- className: cn(
30342
- "h-8 w-8 text-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
30343
- activeTab === 4 && "bg-background text-foreground shadow"
30344
- ),
30345
- title: t("tabs.memories"),
30346
- children: /* @__PURE__ */ jsx(Brain, { className: "w-4 h-4" })
30347
- }
30348
- ),
30349
- isFullscreen && onNewChat && /* @__PURE__ */ jsx(
30356
+ onNewChat && /* @__PURE__ */ jsx(
30350
30357
  Button,
30351
30358
  {
30352
30359
  variant: "ghost",
@@ -30397,32 +30404,16 @@ var AssistantView = ({ ref, ...props }) => {
30397
30404
  isSidebarOpen ? "w-72" : "w-0"
30398
30405
  ),
30399
30406
  children: /* @__PURE__ */ jsxs("div", { className: "w-72 h-full flex flex-col relative", children: [
30400
- isSidebarOpen && /* @__PURE__ */ jsxs("div", { className: "absolute top-2 right-2 z-10 flex flex-col gap-1", children: [
30401
- onToggleSidebar && /* @__PURE__ */ jsx(
30402
- Button,
30403
- {
30404
- variant: "ghost",
30405
- size: "icon",
30406
- onClick: onToggleSidebar,
30407
- className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
30408
- children: /* @__PURE__ */ jsx(PanelLeft, { className: "w-4 h-4" })
30409
- }
30410
- ),
30411
- onTabChange && /* @__PURE__ */ jsx(
30412
- Button,
30413
- {
30414
- variant: "ghost",
30415
- size: "icon",
30416
- onClick: () => onTabChange(activeTab === 4 ? 0 : 4),
30417
- className: cn(
30418
- "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
30419
- activeTab === 4 && "bg-accent text-accent-foreground"
30420
- ),
30421
- title: t("tabs.memories"),
30422
- children: /* @__PURE__ */ jsx(Brain, { className: "w-4 h-4" })
30423
- }
30424
- )
30425
- ] }),
30407
+ isSidebarOpen && /* @__PURE__ */ jsx("div", { className: "absolute top-2 right-2 z-10 flex flex-col gap-1", children: onToggleSidebar && /* @__PURE__ */ jsx(
30408
+ Button,
30409
+ {
30410
+ variant: "ghost",
30411
+ size: "icon",
30412
+ onClick: onToggleSidebar,
30413
+ className: "h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-md",
30414
+ children: /* @__PURE__ */ jsx(PanelLeft, { className: "w-4 h-4" })
30415
+ }
30416
+ ) }),
30426
30417
  /* @__PURE__ */ jsxs("div", { className: "flex-1 p-4 flex flex-col min-h-0 overflow-hidden", children: [
30427
30418
  !showHeader && agentSelectorElement && /* @__PURE__ */ jsx("div", { className: "mb-3 shrink-0", children: agentSelectorElement }),
30428
30419
  renderSidebar(false)
@@ -30539,6 +30530,7 @@ var AssistantView = ({ ref, ...props }) => {
30539
30530
  initialModelId: commonProps.initialModelId,
30540
30531
  initialFeatures: commonProps.initialFeatures,
30541
30532
  subagents: commonProps.subagents,
30533
+ onManageMemories: onTabChange ? () => onTabChange(4) : void 0,
30542
30534
  compactToolbar: !isFullscreen
30543
30535
  }
30544
30536
  )