@aintela/chat 0.2.59 → 0.3.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/README.md +77 -0
- package/dist/{ClientMessage-EKgfuTp8.js → ClientMessage-DUby3KyC.js} +16 -22
- package/dist/{ClientMessage-EKgfuTp8.js.map → ClientMessage-DUby3KyC.js.map} +1 -1
- package/dist/Memory-CjrYSkzB.js +47 -0
- package/dist/Memory-CjrYSkzB.js.map +1 -0
- package/dist/atMentions-CnHuJKhX.js +959 -0
- package/dist/atMentions-CnHuJKhX.js.map +1 -0
- package/dist/components.js +10161 -11344
- package/dist/components.js.map +1 -1
- package/dist/environmentUtils-VZNTCzEE.js +88 -0
- package/dist/environmentUtils-VZNTCzEE.js.map +1 -0
- package/dist/hooks.js +4 -5
- package/dist/{httpArtifactService-CpbRpTHb.js → httpArtifactService-Ba9xFy1E.js} +537 -646
- package/dist/httpArtifactService-Ba9xFy1E.js.map +1 -0
- package/dist/{httpSessionService-BEQMIKfv.js → httpSessionService-DXlT2vxT.js} +34 -24
- package/dist/httpSessionService-DXlT2vxT.js.map +1 -0
- package/dist/index.js +242 -243
- package/dist/models.js +48 -51
- package/dist/models.js.map +1 -1
- package/dist/serializer-D2W42bdT.js +1730 -0
- package/dist/serializer-D2W42bdT.js.map +1 -0
- package/dist/services.js +2 -2
- package/dist/src/components/AiChat/AiChatContext.d.ts +0 -3
- package/dist/src/components/AiChat/AiChatProvider.agent.test.d.ts +1 -0
- package/dist/src/components/AiChat/AiChatProvider.d.ts +2 -2
- package/dist/src/components/AiChat/AiChatTypes.d.ts +45 -27
- package/dist/src/components/AiChat/ChatPane/ChatPane.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/MessageAgent.d.ts +0 -1
- package/dist/src/components/AiChat/ChatPane/MessagePart.d.ts +5 -3
- package/dist/src/components/AiChat/ChatPane/MessagePart.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/friendlyToolConfig.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/messageAgentThoughts.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/parts/ThoughtRun.d.ts +28 -0
- package/dist/src/components/AiChat/ChatPane/parts/ThoughtRunContext.d.ts +18 -0
- package/dist/src/components/AiChat/ChatPane/parts/index.d.ts +5 -1
- package/dist/src/components/AiChat/ChatPane/parts/thoughtRun.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/parts/uiToolDispatcher.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/parts/uiToolRegistry.test.d.ts +1 -0
- package/dist/src/components/AiChat/aiChatEngine.d.ts +24 -5
- package/dist/src/components/AiChat/index.d.ts +1 -3
- package/dist/src/components/AiChat/sessionStateManagerService.bind.test.d.ts +1 -0
- package/dist/src/components/AiChat/sessionStateManagerService.d.ts +22 -10
- package/dist/src/components/AiChat/useAgentEngine.d.ts +69 -0
- package/dist/src/components/AiChat/useAgentEngine.test.d.ts +1 -0
- package/dist/src/components/index.d.ts +4 -7
- package/dist/src/components/v2/AiChatFloating.d.ts +3 -0
- package/dist/src/components/v2/PromptV2.d.ts +21 -6
- package/dist/src/components/v2/PromptV2.test.d.ts +1 -0
- package/dist/src/components/v2/icons.d.ts +1 -0
- package/dist/src/components/v2/index.d.ts +25 -25
- package/dist/src/hooks/index.d.ts +1 -1
- package/dist/src/hooks/useContainerWidth.d.ts +0 -1
- package/dist/src/models/ArtifactData.d.ts +0 -7
- package/dist/src/models/ChatSession.d.ts +0 -32
- package/dist/src/models/ClientMessage.d.ts +0 -4
- package/dist/src/models/ServerEvent.d.ts +0 -36
- package/dist/src/models/enums.d.ts +0 -1
- package/dist/src/models/index.d.ts +1 -2
- package/dist/src/models/interactionPartUtils.test.d.ts +1 -0
- package/dist/src/models/semanticKernelModel/sanitizeJsonString.test.d.ts +0 -0
- package/dist/src/models/serverEventDecode.test.d.ts +0 -0
- package/dist/src/services/WebSocketConnection/webSocketConnectionV2.reconnect.test.d.ts +0 -0
- package/dist/src/services/interactionService.d.ts +11 -0
- package/dist/src/services/interactionServiceGrouping.test.d.ts +1 -0
- package/dist/src/services/servers/AgentGatewayService.d.ts +25 -18
- package/dist/src/services/servers/AgentGatewayWSAsync.d.ts +0 -1
- package/dist/src/services/servers/agentGatewayAgentContext.test.d.ts +1 -0
- package/dist/src/services/storageService.d.ts +34 -59
- package/dist/src/services/storageService.test.d.ts +1 -0
- package/dist/src/utils/index.d.ts +2 -6
- package/dist/src/utils/urlParser.d.ts +0 -1
- package/dist/src/utils/urlParser.test.d.ts +1 -0
- package/dist/tests/fakes/fakeChatServices.d.ts +42 -0
- package/dist/tests/fakes/fakeRawWebSocket.d.ts +51 -0
- package/dist/tests/fakes/fakeStorage.d.ts +7 -0
- package/dist/tests/fakes/makeGateway.d.ts +24 -1
- package/dist/{useChatSessions-BQP7DhY1.js → useChatSessions-1AAvAdPW.js} +2 -2
- package/dist/{useChatSessions-BQP7DhY1.js.map → useChatSessions-1AAvAdPW.js.map} +1 -1
- package/dist/useContainerWidth-B40_i-NW.js +295 -0
- package/dist/{useContainerWidth-B3t1ZTlo.js.map → useContainerWidth-B40_i-NW.js.map} +1 -1
- package/dist/utils.js +340 -57
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/Memory-DjLZqgbF.js +0 -84
- package/dist/Memory-DjLZqgbF.js.map +0 -1
- package/dist/atMentions-C0dza8DD.js +0 -1000
- package/dist/atMentions-C0dza8DD.js.map +0 -1
- package/dist/auth-lluJZyQO.js +0 -524
- package/dist/auth-lluJZyQO.js.map +0 -1
- package/dist/environmentUtils-CUVZ6Dq1.js +0 -478
- package/dist/environmentUtils-CUVZ6Dq1.js.map +0 -1
- package/dist/httpArtifactService-CpbRpTHb.js.map +0 -1
- package/dist/httpSessionService-BEQMIKfv.js.map +0 -1
- package/dist/serializer-BXSH9aYQ.js +0 -1360
- package/dist/serializer-BXSH9aYQ.js.map +0 -1
- package/dist/src/components/AiChat/AiChatFloating.d.ts +0 -3
- package/dist/src/components/AiChat/ChatPane/LastPrompts.d.ts +0 -9
- package/dist/src/components/AiChat/ChatPane/Prompt.d.ts +0 -9
- package/dist/src/components/AiChat/ChatPane/SubAgentBox.d.ts +0 -9
- package/dist/src/components/AiChat/ChatPane/TaskList.d.ts +0 -6
- package/dist/src/components/AiChat/useLiveSession.d.ts +0 -52
- package/dist/src/components/v2/AiChatFloatingV2.d.ts +0 -3
- package/dist/src/utils/jsonDetector.d.ts +0 -50
- package/dist/src/utils/jsonUtils.d.ts +0 -1
- package/dist/src/utils/materialIconsSvg.d.ts +0 -51
- package/dist/src/utils/objectUtils.d.ts +0 -31
- package/dist/src/utils/parseArtifact.d.ts +0 -3
- package/dist/src/utils/uriUtils.d.ts +0 -39
- package/dist/useContainerWidth-B3t1ZTlo.js +0 -309
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentContext, User } from '../../models/contexts';
|
|
2
|
+
import { Customer } from '../../models/Customer';
|
|
2
3
|
import { SendMessageResponse } from '../../models/SendMessageResponse';
|
|
3
4
|
import { EventBusService } from '../../services/eventBusService';
|
|
4
5
|
import { AgentGatewayService, GatewaySendMessageOptions } from '../../services/servers/AgentGatewayService';
|
|
@@ -30,6 +31,12 @@ export interface AiChatEngineConfig {
|
|
|
30
31
|
* (the JWT rides the handshake and is fixed for the socket's lifetime).
|
|
31
32
|
*/
|
|
32
33
|
getUser?: () => User | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The agent this engine speaks as — and the ONLY public input that takes an
|
|
36
|
+
* `AgentContext` (issue #59). It is fixed for the engine's lifetime: the
|
|
37
|
+
* gateway stamps `AgentId` from it on every send, and the session manager
|
|
38
|
+
* binds against it on every (re)connect. Two agents means two engines.
|
|
39
|
+
*/
|
|
33
40
|
agentContext: AgentContext;
|
|
34
41
|
sessionService?: ISessionService;
|
|
35
42
|
artifactService?: IArtifactService;
|
|
@@ -49,7 +56,7 @@ export interface AiChatEngineConfig {
|
|
|
49
56
|
* used to be built inside {@link AiChatProvider}'s `useMemo([])`. Extracted
|
|
50
57
|
* (issue #236) so a host can open + hold a live session WITHOUT mounting the
|
|
51
58
|
* whole `<AiChat>` UI over the app: the home page can pre-warm a session (open
|
|
52
|
-
* the socket, create a session) via
|
|
59
|
+
* the socket, create a session) via `useAgentEngine`, and the operations
|
|
53
60
|
* page mounts a scoped `<AiChat engine={…}>` that ADOPTS the same live engine —
|
|
54
61
|
* same WebSocket, same session, no reconnect on navigation.
|
|
55
62
|
*
|
|
@@ -69,10 +76,22 @@ export interface AiChatEngine {
|
|
|
69
76
|
sendMessage: (text: string, options?: GatewaySendMessageOptions & {
|
|
70
77
|
ui?: SendMessageUi;
|
|
71
78
|
}) => Promise<SendMessageResponse>;
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Open the live socket + bind a session (existing id, or a fresh one). The
|
|
81
|
+
* one call a warm-up needs. No agent argument — the engine already IS an
|
|
82
|
+
* agent (issue #59).
|
|
83
|
+
*/
|
|
84
|
+
openLiveSession: (sessionId?: string) => Promise<void>;
|
|
85
|
+
/** The agent (+ customer + model) this engine speaks as. The single truth for every send. */
|
|
86
|
+
getAgentContext: () => AgentContext;
|
|
87
|
+
/**
|
|
88
|
+
* Replace the AGENT mid-conversation — an agent picker and nothing else.
|
|
89
|
+
* See {@link AgentGatewayService.forceAgentContext}: the session keeps
|
|
90
|
+
* reporting the agent it started as. Prefer a separate engine per agent.
|
|
91
|
+
*/
|
|
92
|
+
forceAgentContext: (context: AgentContext) => void;
|
|
93
|
+
/** Live-swap the dataset/customer the same agent works over (ordinary, non-identity change). */
|
|
94
|
+
setCustomer: (customer: Customer) => void;
|
|
76
95
|
/** Update the user whose token the socket authenticates with (read live on each (re)dial). */
|
|
77
96
|
setUser: (user: User) => void;
|
|
78
97
|
/** Live-swap the model the next turn ships. */
|
|
@@ -2,12 +2,10 @@ export { default as AiChat } from './AiChat';
|
|
|
2
2
|
export { default as ChatPane } from './ChatPane/ChatPane';
|
|
3
3
|
export { AiChatProvider } from './AiChatProvider';
|
|
4
4
|
export { AiChatDrawer } from './AiChatDrawer';
|
|
5
|
-
export { AiChatFloating } from '
|
|
5
|
+
export { AiChatFloating } from '../v2/AiChatFloating';
|
|
6
6
|
export type { AiChatProps, AiChatHandle, AiChatStyleProps, AiChatDrawerProps, AiChatFloatingProps, SendMessageOptions, SendMessageUi, UserMessageRendererProps } from './AiChatTypes';
|
|
7
7
|
export { useAiChatServices, useAiChatSessionStore } from './AiChatContext';
|
|
8
8
|
export { createAiChatSessionStore } from './AiChatSessionStore';
|
|
9
9
|
export type { SubAgentState } from './stateConfiguration';
|
|
10
|
-
export type { SubAgentBoxProps } from './ChatPane/SubAgentBox';
|
|
11
|
-
export { default as SubAgentBox } from './ChatPane/SubAgentBox';
|
|
12
10
|
export type { FriendlyToolEntry } from './ChatPane/friendlyToolConfig';
|
|
13
11
|
export { configureFriendlyMapping } from './ChatPane/friendlyToolConfig';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AiChatState, AiChatStore } from './stateConfiguration';
|
|
2
2
|
import { ChatSession } from '../../models/ChatSession';
|
|
3
3
|
import { SendMessageResponse } from '../../models/SendMessageResponse';
|
|
4
|
-
import { AgentContext } from '../../models/contexts';
|
|
5
4
|
import { IArtifactService } from '../../services/interfaces/artifactService';
|
|
6
5
|
import { AgentGatewayService } from '../../services/servers/AgentGatewayService';
|
|
7
6
|
import { ISessionService } from '../../services/servers/sessionService/ISessionService';
|
|
@@ -22,30 +21,43 @@ export declare class SessionStateManagerService {
|
|
|
22
21
|
paused: boolean;
|
|
23
22
|
waitTimeForRetry: number;
|
|
24
23
|
sessionService: ISessionService;
|
|
25
|
-
workingContext?: AgentContext;
|
|
26
24
|
artifactService: IArtifactService;
|
|
27
25
|
workingSessionId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Set by the first {@link bindAndOpenLiveSession}. The retry loop used to
|
|
28
|
+
* gate on `workingContext` being present — i.e. "has anyone armed this
|
|
29
|
+
* manager yet?" — so removing that field (issue #59) needs the same latch
|
|
30
|
+
* kept explicitly, or a heartbeat could dial a session no host ever asked for.
|
|
31
|
+
*/
|
|
32
|
+
private armed;
|
|
28
33
|
pendingClosePromise?: Promise<SendMessageResponse | null>;
|
|
29
34
|
private onSessionEstablished?;
|
|
30
35
|
constructor(agentGatewayService: AgentGatewayService, sessionService: ISessionService, artifactService: IArtifactService, sessionStore: AiChatStore, options?: SessionStateManagerOptions);
|
|
31
36
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
37
|
+
* The agent this manager binds — read from the gateway on every bind, never
|
|
38
|
+
* cached. The gateway is the single owner (issue #59): the manager holding
|
|
39
|
+
* its own copy is exactly what let a reconnect re-open a conversation as a
|
|
40
|
+
* different agent than the one the socket had been sending as.
|
|
36
41
|
*/
|
|
37
|
-
|
|
42
|
+
private get agentContext();
|
|
38
43
|
pause(): void;
|
|
39
44
|
start(): void;
|
|
40
45
|
beat(): void;
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
/** Create a server-side session for the gateway's agent. The agent is NOT a parameter — see {@link agentContext}. */
|
|
47
|
+
createSession(sessionId: string): Promise<ChatSession>;
|
|
48
|
+
retrieveSession(sessionId: string): Promise<ChatSession | null>;
|
|
43
49
|
/**
|
|
50
|
+
* Open the socket and bind a session FOR THE GATEWAY'S AGENT. There is
|
|
51
|
+
* deliberately no context parameter (issue #59): a caller that could pass
|
|
52
|
+
* one could open a conversation as an agent the gateway will never send as,
|
|
53
|
+
* which is precisely how a page bound to `expense-agent` ended up talking to
|
|
54
|
+
* `booking-flow-agent`.
|
|
55
|
+
*
|
|
44
56
|
* @param options.resume keep the socket's replay cursor, so the server replays what was
|
|
45
57
|
* emitted while we were away. Use it when redialling a session the client already holds
|
|
46
58
|
* (an app returning to the foreground); leave it off for a fresh user-initiated open.
|
|
47
59
|
*/
|
|
48
|
-
bindAndOpenLiveSession(
|
|
60
|
+
bindAndOpenLiveSession(sessionId?: string, options?: {
|
|
49
61
|
resume?: boolean;
|
|
50
62
|
}): Promise<void>;
|
|
51
63
|
closeLiveConnection(stoneCold?: boolean, closeTurn?: boolean): Promise<void>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { AgentContext } from '../../models/contexts';
|
|
2
|
+
import { HttpPromptAssistService } from '../../services/httpPromptAssistService';
|
|
3
|
+
import { AiChatStore } from './stateConfiguration';
|
|
4
|
+
import { AiChatEngine, AiChatEngineConfig } from './aiChatEngine';
|
|
5
|
+
/**
|
|
6
|
+
* Get (or lazily create) the shared engine for `key`. The factory runs at most
|
|
7
|
+
* once per key. Compute the key with {@link engineKeyFor} — a hand-written key
|
|
8
|
+
* can name an engine after something other than its agent, which is the
|
|
9
|
+
* disagreement issue #59 removed.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getSharedAiChatEngine(key: string, factory: () => AiChatEngine): AiChatEngine;
|
|
12
|
+
/**
|
|
13
|
+
* Dispose + forget the shared engine for `key` (stops the manager, closes the
|
|
14
|
+
* socket). Hosts call this on a hard identity reset (e.g. full sign-out) if
|
|
15
|
+
* they want the next session to start from a clean socket. Normal navigation
|
|
16
|
+
* should NOT dispose — the whole point is that the engine persists.
|
|
17
|
+
*/
|
|
18
|
+
export declare function disposeSharedAiChatEngine(key: string): Promise<void>;
|
|
19
|
+
export interface UseAgentEngineOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Distinguishes two INDEPENDENT conversations with the SAME agent (a
|
|
22
|
+
* side-by-side comparison, a modal that must not resume the page's thread).
|
|
23
|
+
* It is a suffix on the agent-derived key, never a replacement for it —
|
|
24
|
+
* there is deliberately no way to name an engine after something other than
|
|
25
|
+
* its agent (issue #59).
|
|
26
|
+
*/
|
|
27
|
+
scope?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The registry key for an engine: `agent` or `agent:scope`. Derived from the
|
|
31
|
+
* agent so that "same key, different agent" cannot be expressed — the shape of
|
|
32
|
+
* the bug this replaced, where a surface reached for a shared engine under its
|
|
33
|
+
* own key and passed a different agent as a prop.
|
|
34
|
+
*
|
|
35
|
+
* @throws if the context carries neither an agent id nor a name — an engine with
|
|
36
|
+
* no agent has nothing to stamp on its sends.
|
|
37
|
+
*/
|
|
38
|
+
export declare function engineKeyFor(context: AgentContext, scope?: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* What {@link useAgentEngine} hands back: the shared engine plus the couple of
|
|
41
|
+
* per-consumer services a host reads directly (the prompt-assist client — live
|
|
42
|
+
* over `config.getUser` when supplied, otherwise token-bound and rebuilt on
|
|
43
|
+
* token change — and the session store).
|
|
44
|
+
*/
|
|
45
|
+
export interface LiveSession {
|
|
46
|
+
engine: AiChatEngine;
|
|
47
|
+
/** Open the socket + bind a session (fresh, or an existing id). The warm-up entry point. */
|
|
48
|
+
openLiveSession: (sessionId?: string) => Promise<void>;
|
|
49
|
+
sessionStore: AiChatStore;
|
|
50
|
+
/** Prompt-assist REST client (auto-@ locations, date hints) — same base URL + bearer as the socket. */
|
|
51
|
+
promptAssistService: HttpPromptAssistService;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Open + hold a live session for ONE agent, WITHOUT mounting the `<AiChat>` UI
|
|
55
|
+
* (issue #236).
|
|
56
|
+
*
|
|
57
|
+
* The engine is shared under a key DERIVED from the agent (issue #59), so a
|
|
58
|
+
* component can warm a session and a *different* component (mounted after the
|
|
59
|
+
* first unmounts) continues it — the home page pre-warms while the user types,
|
|
60
|
+
* then the operations page mounts a scoped `<AiChat engine={liveSession.engine}>`
|
|
61
|
+
* that adopts the same socket and session. Two surfaces on two agents get two
|
|
62
|
+
* engines by construction; they cannot collide on one key and they cannot
|
|
63
|
+
* quietly overwrite each other's agent. Creating the engine touches no network;
|
|
64
|
+
* call {@link openLiveSession} (typically after the auth boot settles) to dial.
|
|
65
|
+
*
|
|
66
|
+
* The agent is NOT propagated on config change — it is the engine's identity,
|
|
67
|
+
* fixed for its lifetime. Only the live slices (the user's token) are pushed in.
|
|
68
|
+
*/
|
|
69
|
+
export declare function useAgentEngine(config: AiChatEngineConfig, options?: UseAgentEngineOptions): LiveSession;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,22 +3,19 @@ export { default as ChatPane } from './AiChat/ChatPane/ChatPane';
|
|
|
3
3
|
export { default as CurrentMessage } from './AiChat/ChatPane/CurrentMessage';
|
|
4
4
|
export { AiChatProvider } from './AiChat/AiChatProvider';
|
|
5
5
|
export { AiChatDrawer } from './AiChat/AiChatDrawer';
|
|
6
|
-
export { AiChatFloating } from './AiChat/AiChatFloating';
|
|
7
6
|
export { AiChatServiceContext, useAiChatServices, useAiChatSessionStore, } from './AiChat/AiChatContext';
|
|
8
7
|
export { useTurnOpen } from './AiChat/useTurnOpen';
|
|
9
8
|
export type { AiChatContextState as AiChatServices } from './AiChat/AiChatContext';
|
|
10
|
-
export type { AiChatProps, AiChatHandle, AiChatStyleProps, AiChatDrawerProps, AiChatFloatingProps, ConnectionInformation, AuthPromptContext, } from './AiChat/AiChatTypes';
|
|
9
|
+
export type { AiChatProps, AiChatBaseProps, AiChatEngineProps, AiChatHandle, AiChatStyleProps, AiChatDrawerProps, AiChatFloatingProps, ConnectionInformation, AuthPromptContext, } from './AiChat/AiChatTypes';
|
|
11
10
|
export type { AiChatState, AiChatStore, SubAgentState } from './AiChat/stateConfiguration';
|
|
12
11
|
export { createAiChatStore } from './AiChat/stateConfiguration';
|
|
13
12
|
export { createAiChatSessionStore } from './AiChat/AiChatSessionStore';
|
|
14
13
|
export { SessionStateManagerService, IDLE_TIMEOUT, WARNING_THRESHOLD, } from './AiChat/sessionStateManagerService';
|
|
15
14
|
export { createAiChatEngine } from './AiChat/aiChatEngine';
|
|
16
15
|
export type { AiChatEngine, AiChatEngineConfig } from './AiChat/aiChatEngine';
|
|
17
|
-
export {
|
|
18
|
-
export type { LiveSession,
|
|
16
|
+
export { useAgentEngine, engineKeyFor, getSharedAiChatEngine, disposeSharedAiChatEngine, } from './AiChat/useAgentEngine';
|
|
17
|
+
export type { LiveSession, UseAgentEngineOptions } from './AiChat/useAgentEngine';
|
|
19
18
|
export { default as Message } from './AiChat/ChatPane/Message';
|
|
20
|
-
export { default as SubAgentBox } from './AiChat/ChatPane/SubAgentBox';
|
|
21
|
-
export type { SubAgentBoxProps } from './AiChat/ChatPane/SubAgentBox';
|
|
22
19
|
export { default as AskUserSheet } from './AiChat/ChatPane/AskUserSheet';
|
|
23
20
|
export type { AskUserSheetProps } from './AiChat/ChatPane/AskUserSheet';
|
|
24
21
|
export { default as AskUserDialog } from './AiChat/ChatPane/AskUserDialog';
|
|
@@ -31,7 +28,7 @@ export { classifyPart, DEFAULT_PART_RENDERERS, TextPart, ThoughtPart, FunctionPa
|
|
|
31
28
|
export type { PartKind, PartRendererProps, PartRenderer, PartRendererMap, } from './AiChat/ChatPane/parts';
|
|
32
29
|
export { createUiToolRegistry, parseUiArgs, parseClientOutput } from './AiChat/ChatPane/parts';
|
|
33
30
|
export type { UiToolRegistry, UiToolRegistryBuilder, UiToolContext, UiToolActionContext, UiToolArgs, UiToolRenderFn, UiToolActionFn, UiToolRenderOptions, UiToolActionOptions, UiToolEntry, UiToolRenderEntry, UiToolActionEntry, UiToolAskUserRenderers, UiToolAskUserQuestionFn, UiToolAskUserResponseFn, UiToolAskUserEntry, } from './AiChat/ChatPane/parts';
|
|
34
|
-
export {
|
|
31
|
+
export { useContainerRectangle } from '../hooks/useContainerWidth';
|
|
35
32
|
export { default as Stopwatch } from './Stopwatch';
|
|
36
33
|
export { default as LoadingDots } from './Library/LoadingDots';
|
|
37
34
|
export { default as MarkdownExtended } from './Library/MarkdowmExtended';
|
|
@@ -15,6 +15,17 @@ interface PromptV2Props {
|
|
|
15
15
|
/** Show the prompt-history popover trigger inside the pill. Default true. */
|
|
16
16
|
showLastPrompts?: boolean;
|
|
17
17
|
showConfigOptions?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Show the paperclip next to the send button. Default true.
|
|
20
|
+
*
|
|
21
|
+
* This hides the BUTTON, not the feature: drag & drop and paste keep
|
|
22
|
+
* working, and an image that arrives either way still gets its
|
|
23
|
+
* thumbnail and still rides out with the message. Pass `false` where
|
|
24
|
+
* an explicit "attach a file" affordance would be misleading — a host
|
|
25
|
+
* whose agent has nothing to do with images, or a surface too cramped
|
|
26
|
+
* to spend a slot on it.
|
|
27
|
+
*/
|
|
28
|
+
showAttachmentButton?: boolean;
|
|
18
29
|
/**
|
|
19
30
|
* Placeholder text for the textarea. Defaults to the data-explorer
|
|
20
31
|
* phrasing ("Pergunte sobre seus dados…"); hosts in other domains
|
|
@@ -80,12 +91,16 @@ interface PromptV2Props {
|
|
|
80
91
|
*/
|
|
81
92
|
sendButtonProps?: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color'>;
|
|
82
93
|
/**
|
|
83
|
-
* Allow submitting with an empty textarea. Defaults to `
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* the
|
|
87
|
-
*
|
|
88
|
-
*
|
|
94
|
+
* Allow submitting with an empty textarea. Defaults to `true`.
|
|
95
|
+
*
|
|
96
|
+
* The permissive default is what a host with its own content surface
|
|
97
|
+
* needs: the dashboard composer's sketch, or an image attachment, IS the
|
|
98
|
+
* message, and forcing the user to type something alongside it would be
|
|
99
|
+
* busywork. Attachments count as content on their own, so an image with no
|
|
100
|
+
* text is a valid send whatever this is set to.
|
|
101
|
+
*
|
|
102
|
+
* Hosts where the typed text IS the intent — the data explorer — pass
|
|
103
|
+
* `false` so an empty send is refused and the button reads disabled.
|
|
89
104
|
*/
|
|
90
105
|
allowEmptyDraft?: boolean;
|
|
91
106
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -24,6 +24,7 @@ export declare const PauseIcon: (p: IconProps) => React.ReactElement<any, string
|
|
|
24
24
|
export declare const StopIcon: (p: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
25
25
|
export declare const HistoryIcon: (p: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
26
26
|
export declare const MenuIcon: (p: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
27
|
+
export declare const PaperclipIcon: (p: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
27
28
|
export declare const PenIcon: (p: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
28
29
|
export declare const RotateIcon: (p: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
29
30
|
export declare const UndoIcon: (p: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
@@ -4,20 +4,20 @@ export * from './icons';
|
|
|
4
4
|
export * from './styles';
|
|
5
5
|
export { Sparkline } from './Sparkline';
|
|
6
6
|
export type { SparklineProps } from './Sparkline';
|
|
7
|
-
export { AppShellV2 } from './AppShellV2';
|
|
8
|
-
export type { AppShellV2Props } from './AppShellV2';
|
|
9
|
-
export { AppRailV2 } from './AppRailV2';
|
|
10
|
-
export type { AppRailV2Props, AppRailV2View } from './AppRailV2';
|
|
11
|
-
export { AppBarV2, APPBAR_V2_HEIGHT } from './AppBarV2';
|
|
12
|
-
export type { AppBarV2Props } from './AppBarV2';
|
|
13
|
-
export { MobileDrawerV2, MOBILE_NAV_DEFAULT, } from './MobileDrawerV2';
|
|
14
|
-
export type { MobileDrawerV2Props, MobileDrawerV2NavItem } from './MobileDrawerV2';
|
|
7
|
+
export { AppShellV2 as AppShell, AppShellV2 } from './AppShellV2';
|
|
8
|
+
export type { AppShellV2Props as AppShellProps, AppShellV2Props } from './AppShellV2';
|
|
9
|
+
export { AppRailV2 as AppRail, AppRailV2 } from './AppRailV2';
|
|
10
|
+
export type { AppRailV2Props as AppRailProps, AppRailV2Props, AppRailV2View as AppRailView, AppRailV2View } from './AppRailV2';
|
|
11
|
+
export { AppBarV2 as AppBar, AppBarV2, APPBAR_V2_HEIGHT as APPBAR_HEIGHT, APPBAR_V2_HEIGHT } from './AppBarV2';
|
|
12
|
+
export type { AppBarV2Props as AppBarProps, AppBarV2Props } from './AppBarV2';
|
|
13
|
+
export { MobileDrawerV2 as MobileDrawer, MobileDrawerV2, MOBILE_NAV_DEFAULT, } from './MobileDrawerV2';
|
|
14
|
+
export type { MobileDrawerV2Props as MobileDrawerProps, MobileDrawerV2Props, MobileDrawerV2NavItem as MobileDrawerNavItem, MobileDrawerV2NavItem, } from './MobileDrawerV2';
|
|
15
15
|
export { useResponsiveLayout } from './useResponsiveLayout';
|
|
16
16
|
export type { ResponsiveLayout } from './useResponsiveLayout';
|
|
17
|
-
export { AiChatFloatingV2 } from './
|
|
18
|
-
export { AiChatV2Pane } from './AiChatV2Pane';
|
|
19
|
-
export type { AiChatV2PaneProps } from './AiChatV2Pane';
|
|
20
|
-
export { PromptV2 } from './PromptV2';
|
|
17
|
+
export { AiChatFloating, AiChatFloating as AiChatFloatingV2 } from './AiChatFloating';
|
|
18
|
+
export { AiChatV2Pane as AiChatPane, AiChatV2Pane } from './AiChatV2Pane';
|
|
19
|
+
export type { AiChatV2PaneProps as AiChatPaneProps, AiChatV2PaneProps } from './AiChatV2Pane';
|
|
20
|
+
export { PromptV2 as Prompt, PromptV2 } from './PromptV2';
|
|
21
21
|
export type { PromptTriggerItem } from './PromptV2';
|
|
22
22
|
export { TriggerDropdown } from './TriggerDropdown';
|
|
23
23
|
export type { TriggerDropdownProps } from './TriggerDropdown';
|
|
@@ -28,16 +28,16 @@ export type { MentionPickerPanelProps } from './MentionPickerPanel';
|
|
|
28
28
|
export { useCoarsePointer } from './useCoarsePointer';
|
|
29
29
|
export { PromptDateMarkers } from './PromptDateMarkers';
|
|
30
30
|
export type { PromptDateMarker } from './PromptDateMarkers';
|
|
31
|
-
export { LastPromptsV2 } from './LastPromptsV2';
|
|
32
|
-
export type { LastPromptsV2Props } from './LastPromptsV2';
|
|
33
|
-
export { ChatsHistoryV2 } from './ChatsHistoryV2';
|
|
34
|
-
export type { ChatsHistoryV2Props, ChatsHistoryV2Item, } from './ChatsHistoryV2';
|
|
35
|
-
export { TaskListV2 } from './TaskListV2';
|
|
36
|
-
export type { TaskListV2Props } from './TaskListV2';
|
|
37
|
-
export { SubAgentBoxV2 } from './SubAgentBoxV2';
|
|
38
|
-
export type { SubAgentBoxV2Props, SubAgentBoxV2Level } from './SubAgentBoxV2';
|
|
39
|
-
export { AgentActivityV2 } from './AgentActivityV2';
|
|
40
|
-
export type { AgentActivityV2Props } from './AgentActivityV2';
|
|
41
|
-
export { RunProgressPanelV2 } from './RunProgressPanelV2';
|
|
42
|
-
export type { RunProgressPanelV2Props } from './RunProgressPanelV2';
|
|
43
|
-
export { RunProgressStripV2 } from './RunProgressStripV2';
|
|
31
|
+
export { LastPromptsV2 as LastPrompts, LastPromptsV2 } from './LastPromptsV2';
|
|
32
|
+
export type { LastPromptsV2Props as LastPromptsProps, LastPromptsV2Props } from './LastPromptsV2';
|
|
33
|
+
export { ChatsHistoryV2 as ChatsHistory, ChatsHistoryV2 } from './ChatsHistoryV2';
|
|
34
|
+
export type { ChatsHistoryV2Props as ChatsHistoryProps, ChatsHistoryV2Props, ChatsHistoryV2Item as ChatsHistoryItem, ChatsHistoryV2Item, } from './ChatsHistoryV2';
|
|
35
|
+
export { TaskListV2 as TaskList, TaskListV2 } from './TaskListV2';
|
|
36
|
+
export type { TaskListV2Props as TaskListProps, TaskListV2Props } from './TaskListV2';
|
|
37
|
+
export { SubAgentBoxV2 as SubAgentBox, SubAgentBoxV2 } from './SubAgentBoxV2';
|
|
38
|
+
export type { SubAgentBoxV2Props as SubAgentBoxProps, SubAgentBoxV2Props, SubAgentBoxV2Level as SubAgentBoxLevel, SubAgentBoxV2Level } from './SubAgentBoxV2';
|
|
39
|
+
export { AgentActivityV2 as AgentActivity, AgentActivityV2 } from './AgentActivityV2';
|
|
40
|
+
export type { AgentActivityV2Props as AgentActivityProps, AgentActivityV2Props } from './AgentActivityV2';
|
|
41
|
+
export { RunProgressPanelV2 as RunProgressPanel, RunProgressPanelV2 } from './RunProgressPanelV2';
|
|
42
|
+
export type { RunProgressPanelV2Props as RunProgressPanelProps, RunProgressPanelV2Props } from './RunProgressPanelV2';
|
|
43
|
+
export { RunProgressStripV2 as RunProgressStrip, RunProgressStripV2 } from './RunProgressStripV2';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as useInterval } from './useIntervalHook';
|
|
2
|
-
export {
|
|
2
|
+
export { useContainerRectangle } from './useContainerWidth';
|
|
3
3
|
export { useChatSessions } from './useChatSessions';
|
|
4
4
|
export type { UseChatSessionsOptions, UseChatSessionsResult, ChatSessionListItem, ChatSessionGroup, } from './useChatSessions';
|
|
5
5
|
export { usePromptAssist } from './usePromptAssist';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export declare function useContainerWidth(ref: React.RefObject<HTMLElement | null>, renderId: string, initialWidth?: number): number;
|
|
2
1
|
export declare function useContainerRectangle(ref: React.RefObject<HTMLElement | null>, renderId: string, initialWidth?: number, initialHeight?: number): number[];
|
|
@@ -21,10 +21,3 @@ export interface ArtifactData {
|
|
|
21
21
|
interactionQuestion?: string;
|
|
22
22
|
loadingPromise: Promise<Artifact | null> | null;
|
|
23
23
|
}
|
|
24
|
-
export interface Section {
|
|
25
|
-
id: string;
|
|
26
|
-
name: string;
|
|
27
|
-
isDefault: boolean;
|
|
28
|
-
created: string;
|
|
29
|
-
iconType?: 'dashboard' | 'chart' | 'folder';
|
|
30
|
-
}
|
|
@@ -3,10 +3,6 @@ import { AgentType, RunMode, SkillLevel } from './enums';
|
|
|
3
3
|
import { Customer } from './Customer';
|
|
4
4
|
import { User } from '../models/contexts';
|
|
5
5
|
import { IDBStorable } from './IDBStorable';
|
|
6
|
-
export interface SharedUser {
|
|
7
|
-
email: string;
|
|
8
|
-
permission: 'view' | 'interact';
|
|
9
|
-
}
|
|
10
6
|
export interface ChatSession extends IDBStorable {
|
|
11
7
|
toolSessionId?: string;
|
|
12
8
|
fullyLoaded: boolean;
|
|
@@ -27,31 +23,3 @@ export interface ChatSession extends IDBStorable {
|
|
|
27
23
|
skillLevel?: SkillLevel;
|
|
28
24
|
sessionRunMode: RunMode;
|
|
29
25
|
}
|
|
30
|
-
export declare class ChatSessionUtils {
|
|
31
|
-
static truncateText(text: string, maxLength: number): string;
|
|
32
|
-
static truncateSessionForStorage(chatSession: ChatSession): {
|
|
33
|
-
toolSessionId?: string;
|
|
34
|
-
fullyLoaded: boolean;
|
|
35
|
-
loadError?: string;
|
|
36
|
-
artifacts: string[];
|
|
37
|
-
browserScopeId: string;
|
|
38
|
-
interactions: Interaction[];
|
|
39
|
-
userDescription?: string;
|
|
40
|
-
overview: string;
|
|
41
|
-
lastQuestion?: string | null;
|
|
42
|
-
agentType: AgentType;
|
|
43
|
-
customer?: Customer | null;
|
|
44
|
-
activityCount: number;
|
|
45
|
-
interactionsCount?: number;
|
|
46
|
-
allPartsCount?: number;
|
|
47
|
-
user: User;
|
|
48
|
-
lastGeneratedOverview?: Date | null;
|
|
49
|
-
skillLevel?: SkillLevel;
|
|
50
|
-
sessionRunMode: RunMode;
|
|
51
|
-
id?: string;
|
|
52
|
-
created: Date;
|
|
53
|
-
updatedAt?: Date;
|
|
54
|
-
collectionName?: string;
|
|
55
|
-
};
|
|
56
|
-
static truncateInteractionsForStorage(originalInteractions: Interaction[]): Interaction[];
|
|
57
|
-
}
|
|
@@ -30,9 +30,5 @@ export declare class ClientMessage {
|
|
|
30
30
|
name: string;
|
|
31
31
|
args?: string;
|
|
32
32
|
};
|
|
33
|
-
toPythonJson(): {
|
|
34
|
-
mime_type: string;
|
|
35
|
-
data: string;
|
|
36
|
-
};
|
|
37
33
|
constructor(data: string, mimeType: string, fake?: boolean, friendlyMessage?: string, images?: ClientMessageImage[]);
|
|
38
34
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EventType } from './enums';
|
|
2
2
|
import { InteractionPart } from './InteractionPart';
|
|
3
3
|
import { EndMessageData } from './EndMessageData';
|
|
4
|
-
import { ArtifactJson } from '../utils/jsonDetector';
|
|
5
4
|
import { KernelContent, LlmArtifact, LlmEvent, PartType, SessionInformation, StreamingKernelContent } from './semanticKernelModel/models';
|
|
6
5
|
export interface FunctionDetails {
|
|
7
6
|
id: string;
|
|
@@ -94,40 +93,6 @@ export interface CodeExecutionResultDetails {
|
|
|
94
93
|
outcome: string;
|
|
95
94
|
output?: string;
|
|
96
95
|
}
|
|
97
|
-
interface CodeExecutionResult {
|
|
98
|
-
outcome: string | null;
|
|
99
|
-
output: string | null;
|
|
100
|
-
}
|
|
101
|
-
interface ExecutableCode {
|
|
102
|
-
code: string | null;
|
|
103
|
-
language: string | null;
|
|
104
|
-
}
|
|
105
|
-
interface PythonPart {
|
|
106
|
-
thought?: boolean | null;
|
|
107
|
-
code_execution_result?: CodeExecutionResult | null;
|
|
108
|
-
executable_code?: ExecutableCode | null;
|
|
109
|
-
function_call?: Partial<FunctionDetails> | null;
|
|
110
|
-
function_response?: Partial<FunctionDetails> | null;
|
|
111
|
-
text?: string | null;
|
|
112
|
-
}
|
|
113
|
-
export interface PythonEventMessage {
|
|
114
|
-
mime_type: string;
|
|
115
|
-
autor: string;
|
|
116
|
-
turn_complete?: boolean;
|
|
117
|
-
usage_metadata?: any;
|
|
118
|
-
end_message_data?: EndMessageData | null;
|
|
119
|
-
invocation_id?: string;
|
|
120
|
-
serverError?: string | null;
|
|
121
|
-
interrupted?: boolean | string;
|
|
122
|
-
is_final_response?: boolean;
|
|
123
|
-
session_information?: SessionInformation | null;
|
|
124
|
-
part_data?: PythonPart | null;
|
|
125
|
-
all_parts_data?: PythonPart[] | null;
|
|
126
|
-
interaction_id: string | null;
|
|
127
|
-
partial?: boolean | string;
|
|
128
|
-
artifact_generated?: ArtifactJson[];
|
|
129
|
-
async_final_response?: boolean;
|
|
130
|
-
}
|
|
131
96
|
export declare class ServerEvent {
|
|
132
97
|
uniqueId: string;
|
|
133
98
|
mimeType: string;
|
|
@@ -169,4 +134,3 @@ export declare class ServerEvent {
|
|
|
169
134
|
static createFromFunctionName(functionName: string, interactionId: string, callData?: any): ServerEvent;
|
|
170
135
|
static createFromText(message: string, interactionId: string, thinkingData?: string): ServerEvent;
|
|
171
136
|
}
|
|
172
|
-
export {};
|
|
@@ -41,7 +41,6 @@ export declare const EventType: {
|
|
|
41
41
|
readonly Waiting: "waiting";
|
|
42
42
|
readonly Suspended: "suspended";
|
|
43
43
|
};
|
|
44
|
-
export declare const GetEventTypeFromPythonName: (name: string) => EventType;
|
|
45
44
|
export declare const GetEventTypeFromDotNetName: (name: string) => EventType;
|
|
46
45
|
export declare const EventTypeDescriptions: {
|
|
47
46
|
function_call: string;
|
|
@@ -2,7 +2,6 @@ export type { Interaction, MergeResult, TurnOpenCloseDetails } from './Interacti
|
|
|
2
2
|
export type { InteractionPart } from './InteractionPart';
|
|
3
3
|
export { InteractionPartUtils } from './InteractionPart';
|
|
4
4
|
export type { ChatSession } from './ChatSession';
|
|
5
|
-
export { ChatSessionUtils } from './ChatSession';
|
|
6
5
|
export { ClientMessage } from './ClientMessage';
|
|
7
6
|
export { ClientMessage as ClientMessageClass } from './ClientMessage';
|
|
8
7
|
export type { ClientMessageImage } from './ClientMessage';
|
|
@@ -17,7 +16,7 @@ export type { IDBStorable } from './IDBStorable';
|
|
|
17
16
|
export type { IEbiContextData } from './IAbiContext';
|
|
18
17
|
export * from './enums';
|
|
19
18
|
export type { Artifact } from './Artifact';
|
|
20
|
-
export type { ArtifactData
|
|
19
|
+
export type { ArtifactData } from './ArtifactData';
|
|
21
20
|
export type { TodoList, TodoItem, TodoItemStatus } from './todoListModel';
|
|
22
21
|
export type { SubAgentDto, SubAgentMessage, SubAgentStatus } from './subAgentModel';
|
|
23
22
|
export { isSubAgentTerminalStatus, SUB_AGENT_TERMINAL_STATUSES } from './subAgentModel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -13,6 +13,17 @@ export declare class InteractionPartGroup {
|
|
|
13
13
|
isLastGroup: boolean;
|
|
14
14
|
hasThoughts: boolean;
|
|
15
15
|
lastWithThoughts: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* A run of CONSECUTIVE thought parts — one continuous piece of reasoning
|
|
18
|
+
* that `merge` split at {@link MAX_CHAR_PER_TEXT_PART} to keep a very long
|
|
19
|
+
* prose from dragging the browser down.
|
|
20
|
+
*
|
|
21
|
+
* The split is a rendering optimisation and must not be legible as one: the
|
|
22
|
+
* reader gets a single "Pensando…" block whatever the chunk count, drawn by
|
|
23
|
+
* the run's chrome, while each chunk stays its own memoized MessagePart —
|
|
24
|
+
* which is where the CPU saving actually comes from.
|
|
25
|
+
*/
|
|
26
|
+
isThoughtRun: boolean;
|
|
16
27
|
type: InteractionPartGroupType;
|
|
17
28
|
}
|
|
18
29
|
export declare class InteractionService {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|