@spscommerce/max 0.1.0 → 0.1.1
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/lib/api-service.d.ts +4 -1
- package/lib/components/AgentMessage.d.ts +0 -1
- package/lib/components/UserMessage.d.ts +2 -1
- package/lib/hooks/AgentContext.d.ts +3 -2
- package/lib/hooks/useMaxChat.d.ts +4 -3
- package/lib/index.js +11140 -11046
- package/lib/index.umd.cjs +160 -160
- package/lib/models/Chat.d.ts +1 -0
- package/lib/models/Conversation.d.ts +1 -0
- package/lib/models/UsageStatus.d.ts +2 -1
- package/lib/style.css +1 -1
- package/package.json +3 -2
package/lib/api-service.d.ts
CHANGED
|
@@ -10,7 +10,10 @@ export declare class AgentApiService {
|
|
|
10
10
|
constructor(env: string, token?: string | null);
|
|
11
11
|
setToken(token?: string | null): void;
|
|
12
12
|
getSocket(): WebSocket | null;
|
|
13
|
-
fetchConversationMessages: (conversationId: string
|
|
13
|
+
fetchConversationMessages: (conversationId: string, options?: {
|
|
14
|
+
cursor?: string;
|
|
15
|
+
limit?: number;
|
|
16
|
+
}) => Promise<ConversationMessages>;
|
|
14
17
|
fetchConversationList: () => Promise<ConversationList>;
|
|
15
18
|
renameConversation: (conversationId: string, newTitle: string) => Promise<void>;
|
|
16
19
|
deleteConversation: (conversationId: string) => Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export declare const UserMessage: React.MemoExoticComponent<({ children }: {
|
|
2
|
+
export declare const UserMessage: React.MemoExoticComponent<({ children, isObo }: {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
+
isObo?: boolean;
|
|
4
5
|
}) => React.JSX.Element>;
|
|
@@ -3,6 +3,7 @@ import { AgentApiService } from "../api-service";
|
|
|
3
3
|
import { CurrentUser } from "../models/CurrentUser";
|
|
4
4
|
import { CurrentApp } from "../models/CurrentApp";
|
|
5
5
|
import { FeatureFlagsTitles } from "../models/FeatureFlagsTitles";
|
|
6
|
+
import { UserStatus } from "../models/UsageStatus";
|
|
6
7
|
export type AgentContextValue = {
|
|
7
8
|
agentApiService: AgentApiService | null;
|
|
8
9
|
showAgentPanel: () => void;
|
|
@@ -13,8 +14,8 @@ export type AgentContextValue = {
|
|
|
13
14
|
updateCurrentConversationId: (conversationId: string | null) => void;
|
|
14
15
|
lastSentUserMessage: string;
|
|
15
16
|
updateLastSentUserMessage: (message: string) => void;
|
|
16
|
-
usageStatus:
|
|
17
|
-
updateUsageStatus: (status:
|
|
17
|
+
usageStatus: UserStatus;
|
|
18
|
+
updateUsageStatus: (status: UserStatus) => void;
|
|
18
19
|
userHasAgentPerms: boolean;
|
|
19
20
|
updateUserHasAgentPerms: (value: boolean) => void;
|
|
20
21
|
isInPreprod: boolean;
|
|
@@ -7,8 +7,9 @@ export declare function useMaxChat(agentApi: AgentApiService, context: () => Rec
|
|
|
7
7
|
isAgentThinking: boolean;
|
|
8
8
|
messages: Chat[];
|
|
9
9
|
displayedMessages: Chat[];
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
hasMoreMessages: boolean;
|
|
11
|
+
loadOlderMessages: () => Promise<void>;
|
|
12
|
+
isLoadingOlderMessages: boolean;
|
|
12
13
|
streamingResponse: string | undefined;
|
|
13
14
|
sendMessage: (message: string, isAppInitiated: boolean, currentAppName?: string) => Promise<void>;
|
|
14
15
|
startNewConversation: () => void;
|
|
@@ -20,6 +21,6 @@ export declare function useMaxChat(agentApi: AgentApiService, context: () => Rec
|
|
|
20
21
|
fetchMessagePair: (messageId: string) => Promise<Message | undefined>;
|
|
21
22
|
retrySendMessage: () => Promise<void>;
|
|
22
23
|
messageHasBeenSent: boolean;
|
|
23
|
-
fetchUsageStatus: () => Promise<
|
|
24
|
+
fetchUsageStatus: () => Promise<import("../models/UsageStatus").UserStatus | undefined>;
|
|
24
25
|
doesUserHaveAgentPerms: () => boolean;
|
|
25
26
|
};
|