@spscommerce/max 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,9 +8,11 @@ export declare class AgentApiService {
8
8
  private readonly axios;
9
9
  private token;
10
10
  private socket;
11
+ private socketAwaitingApproval;
11
12
  constructor(env: string, token?: string | null);
12
13
  setToken(token?: string | null): void;
13
14
  getSocket(): WebSocket | null;
15
+ private detachSocket;
14
16
  fetchConversationMessages: (conversationId: string, options?: {
15
17
  cursor?: string;
16
18
  limit?: number;
@@ -20,5 +22,10 @@ export declare class AgentApiService {
20
22
  deleteConversation: (conversationId: string) => Promise<void>;
21
23
  postFeedback: (messageId: string, score: string, comment: string) => Promise<void>;
22
24
  fetchUsageStatus: (userId: string) => Promise<UsageStatus>;
23
- postChat(message: string, currentAppName: string, currentConversationId: string | null, agentContext: AdditionalContext, currentUrl: string, appInitiated: boolean, userTimezone: string | null): Promise<unknown>;
25
+ postChat(message: string, currentAppName: string, currentConversationId: string | null, agentContext: AdditionalContext, currentUrl: string, appInitiated: boolean, userTimezone: string | null): Promise<number>;
26
+ respondToApproval(decisions: Array<{
27
+ tool_call_id: string;
28
+ type: "approve" | "reject";
29
+ }>, conversationId: string | null): void;
30
+ private openSocket;
24
31
  }
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
- import { Chat } from "../models/Chat";
2
+ import { ChatMessage } from "../models/Chat";
3
3
  import { Message } from "../models/Conversation";
4
4
  interface AgentMessageProps {
5
5
  children: React.ReactNode;
6
- message?: Chat;
6
+ message?: ChatMessage;
7
7
  sendFeedback?: (messageId: string, score: string, comment: string) => void;
8
8
  fetchMessagePair?: (messageId: string) => Promise<Message | undefined>;
9
9
  handleSendMessage?: (message: string | undefined) => Promise<void>;
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
- export declare const SuggestedPrompt: ({ onClick, children, }: {
2
+ export declare const SuggestedPrompt: ({ onClick, children, highlighted, }: {
3
3
  onClick: () => void;
4
4
  children: React.ReactNode;
5
+ highlighted?: boolean;
5
6
  }) => React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ export declare function SupportFyiNotice({ message, tipMessage, imageAlt, }: {
3
+ message: string;
4
+ tipMessage: string;
5
+ imageAlt: string;
6
+ }): React.ReactNode;
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import { ToolApprovalStatus } from "../models/Chat";
3
+ interface ToolApprovalPromptProps {
4
+ toolName: string;
5
+ toolInput?: Record<string, unknown>;
6
+ status: ToolApprovalStatus;
7
+ source: "live" | "history";
8
+ onApprove: () => void;
9
+ onReject: () => void;
10
+ onRetry?: () => void;
11
+ }
12
+ export declare function ToolApprovalPrompt({ toolName, toolInput, status, onApprove, onReject, onRetry, }: ToolApprovalPromptProps): React.JSX.Element;
13
+ export {};
@@ -1,2 +1,3 @@
1
1
  export { ConversationSwitchLoadingStatus, OlderMessagesLoadingStatus } from "./ChatLoadingStatus";
2
2
  export { MaxPanelHeaderActions } from "./MaxPanelHeaderActions";
3
+ export { ToolApprovalPrompt } from "./ToolApprovalPrompt";
@@ -23,7 +23,8 @@ export declare function useMaxChat(agentApi: AgentApiService, context: Additiona
23
23
  fetchConversationList: () => Promise<void>;
24
24
  sendFeedback: (messageId: string, score: string, comment: string) => Promise<void>;
25
25
  fetchMessagePair: (messageId: string) => Promise<Message | undefined>;
26
- retrySendMessage: () => Promise<void>;
26
+ retrySendMessage: (messageOverride?: string) => Promise<void>;
27
+ respondToToolApproval: (toolCallId: string, approved: boolean, conversationId?: string) => void;
27
28
  messageHasBeenSent: boolean;
28
29
  fetchUsageStatus: () => Promise<import("../models/UsageStatus").UserStatus | undefined>;
29
30
  doesUserHaveAgentPerms: () => boolean;
@@ -0,0 +1,4 @@
1
+ export interface UseSupportFyiResult {
2
+ shouldShow: boolean;
3
+ }
4
+ export declare function useSupportFyi(key: string, maxViews: number, active: boolean): UseSupportFyiResult;
@@ -1,4 +1,5 @@
1
1
  import ANIMATED_LOGO from "./AI-logo-animated.gif";
2
2
  import COLOR_LOGO from "./AI-logo-color.svg";
3
3
  import BETA_LOGO from "./AI-logo-color-beta.svg";
4
- export { ANIMATED_LOGO, COLOR_LOGO, BETA_LOGO };
4
+ import SUPPORT_FYI_IMAGE from "./max-location-nav-bar.png";
5
+ export { ANIMATED_LOGO, COLOR_LOGO, BETA_LOGO, SUPPORT_FYI_IMAGE };