@amodalai/chat-widget 0.1.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.
- package/LICENSE +21 -0
- package/dist/chat-widget.css +5 -0
- package/dist/chat-widget.js +2311 -0
- package/dist/chat-widget.js.map +1 -0
- package/dist/client/ChatClient.d.ts +76 -0
- package/dist/client/ChatClient.d.ts.map +1 -0
- package/dist/client/ChatStream.d.ts +63 -0
- package/dist/client/ChatStream.d.ts.map +1 -0
- package/dist/client/EventEmitter.d.ts +16 -0
- package/dist/client/EventEmitter.d.ts.map +1 -0
- package/dist/client/index.d.ts +13 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client.d.ts +85 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +9 -0
- package/dist/client.js.map +1 -0
- package/dist/components/AskUserCard.d.ts +8 -0
- package/dist/components/AskUserCard.d.ts.map +1 -0
- package/dist/components/ChatWidget.d.ts +9 -0
- package/dist/components/ChatWidget.d.ts.map +1 -0
- package/dist/components/FormattedText.d.ts +12 -0
- package/dist/components/FormattedText.d.ts.map +1 -0
- package/dist/components/InputBar.d.ts +15 -0
- package/dist/components/InputBar.d.ts.map +1 -0
- package/dist/components/KBProposalCard.d.ts +7 -0
- package/dist/components/KBProposalCard.d.ts.map +1 -0
- package/dist/components/MessageList.d.ts +15 -0
- package/dist/components/MessageList.d.ts.map +1 -0
- package/dist/components/SessionHistory.d.ts +12 -0
- package/dist/components/SessionHistory.d.ts.map +1 -0
- package/dist/components/SkillPill.d.ts +11 -0
- package/dist/components/SkillPill.d.ts.map +1 -0
- package/dist/components/StreamingIndicator.d.ts +7 -0
- package/dist/components/StreamingIndicator.d.ts.map +1 -0
- package/dist/components/TagEditor.d.ts +11 -0
- package/dist/components/TagEditor.d.ts.map +1 -0
- package/dist/components/ToolCallCard.d.ts +7 -0
- package/dist/components/ToolCallCard.d.ts.map +1 -0
- package/dist/components/widgets/AlertCard.d.ts +3 -0
- package/dist/components/widgets/AlertCard.d.ts.map +1 -0
- package/dist/components/widgets/Comparison.d.ts +3 -0
- package/dist/components/widgets/Comparison.d.ts.map +1 -0
- package/dist/components/widgets/CredentialInput.d.ts +3 -0
- package/dist/components/widgets/CredentialInput.d.ts.map +1 -0
- package/dist/components/widgets/DataTable.d.ts +3 -0
- package/dist/components/widgets/DataTable.d.ts.map +1 -0
- package/dist/components/widgets/DocumentPreview.d.ts +3 -0
- package/dist/components/widgets/DocumentPreview.d.ts.map +1 -0
- package/dist/components/widgets/EntityCard.d.ts +3 -0
- package/dist/components/widgets/EntityCard.d.ts.map +1 -0
- package/dist/components/widgets/EntityList.d.ts +3 -0
- package/dist/components/widgets/EntityList.d.ts.map +1 -0
- package/dist/components/widgets/InfoCard.d.ts +3 -0
- package/dist/components/widgets/InfoCard.d.ts.map +1 -0
- package/dist/components/widgets/Metric.d.ts +3 -0
- package/dist/components/widgets/Metric.d.ts.map +1 -0
- package/dist/components/widgets/ScopeMap.d.ts +3 -0
- package/dist/components/widgets/ScopeMap.d.ts.map +1 -0
- package/dist/components/widgets/ScoreBreakdown.d.ts +3 -0
- package/dist/components/widgets/ScoreBreakdown.d.ts.map +1 -0
- package/dist/components/widgets/StatusBoard.d.ts +3 -0
- package/dist/components/widgets/StatusBoard.d.ts.map +1 -0
- package/dist/components/widgets/Timeline.d.ts +3 -0
- package/dist/components/widgets/Timeline.d.ts.map +1 -0
- package/dist/components/widgets/WidgetRenderer.d.ts +28 -0
- package/dist/components/widgets/WidgetRenderer.d.ts.map +1 -0
- package/dist/events/entity-extractor.d.ts +7 -0
- package/dist/events/entity-extractor.d.ts.map +1 -0
- package/dist/events/event-bus.d.ts +27 -0
- package/dist/events/event-bus.d.ts.map +1 -0
- package/dist/events/index.d.ts +9 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/types.d.ts +72 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/hooks/useChat.d.ts +52 -0
- package/dist/hooks/useChat.d.ts.map +1 -0
- package/dist/hooks/useSessionHistory.d.ts +17 -0
- package/dist/hooks/useSessionHistory.d.ts.map +1 -0
- package/dist/hooks/useWidgetEvents.d.ts +17 -0
- package/dist/hooks/useWidgetEvents.d.ts.map +1 -0
- package/dist/index-m6lGOMRo.js +641 -0
- package/dist/index-m6lGOMRo.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/theme.d.ts +11 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/types.d.ts +298 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/umd-entry.d.ts +21 -0
- package/dist/umd-entry.d.ts.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatClient.d.ts","sourceRoot":"","sources":["../../src/client/ChatClient.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAsD,MAAM,UAAU,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElJ;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,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MAAM,GAAG,UAAU;YAiDlB,cAAc;YAmId,iBAAiB;CAqBhC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ToolCallInfo, KBProposalInfo, AskUserQuestion } from '../types';
|
|
2
|
+
import { ChatStreamRequest } from '../client';
|
|
3
|
+
/**
|
|
4
|
+
* Full response from a completed chat stream.
|
|
5
|
+
*/
|
|
6
|
+
export interface ChatResponse {
|
|
7
|
+
text: string;
|
|
8
|
+
toolCalls: ToolCallInfo[];
|
|
9
|
+
skillsUsed: string[];
|
|
10
|
+
kbProposals: KBProposalInfo[];
|
|
11
|
+
}
|
|
12
|
+
type StreamEventHandler<T> = (data: T) => void;
|
|
13
|
+
/**
|
|
14
|
+
* A streaming chat response handle.
|
|
15
|
+
* Register `.on()` handlers then the stream starts automatically.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ChatStream {
|
|
18
|
+
private serverUrl;
|
|
19
|
+
private request;
|
|
20
|
+
private handlers;
|
|
21
|
+
private abortController;
|
|
22
|
+
private started;
|
|
23
|
+
private response;
|
|
24
|
+
private toolCallNames;
|
|
25
|
+
private token?;
|
|
26
|
+
constructor(serverUrl: string, request: ChatStreamRequest, token?: string);
|
|
27
|
+
on(event: 'text', handler: StreamEventHandler<{
|
|
28
|
+
text: string;
|
|
29
|
+
}>): this;
|
|
30
|
+
on(event: 'tool_call', handler: StreamEventHandler<{
|
|
31
|
+
tool: string;
|
|
32
|
+
params: Record<string, unknown>;
|
|
33
|
+
toolId: string;
|
|
34
|
+
}>): this;
|
|
35
|
+
on(event: 'tool_result', handler: StreamEventHandler<{
|
|
36
|
+
tool: string;
|
|
37
|
+
data: unknown;
|
|
38
|
+
duration_ms?: number;
|
|
39
|
+
toolId: string;
|
|
40
|
+
}>): this;
|
|
41
|
+
on(event: 'skill_activated', handler: StreamEventHandler<{
|
|
42
|
+
name: string;
|
|
43
|
+
}>): this;
|
|
44
|
+
on(event: 'kb_proposal', handler: StreamEventHandler<KBProposalInfo>): this;
|
|
45
|
+
on(event: 'widget', handler: StreamEventHandler<{
|
|
46
|
+
widgetType: string;
|
|
47
|
+
data: Record<string, unknown>;
|
|
48
|
+
}>): this;
|
|
49
|
+
on(event: 'ask_user', handler: StreamEventHandler<{
|
|
50
|
+
askId: string;
|
|
51
|
+
questions: AskUserQuestion[];
|
|
52
|
+
}>): this;
|
|
53
|
+
on(event: 'error', handler: StreamEventHandler<{
|
|
54
|
+
message: string;
|
|
55
|
+
}>): this;
|
|
56
|
+
on(event: 'done', handler: StreamEventHandler<ChatResponse>): this;
|
|
57
|
+
/** Cancel the stream. */
|
|
58
|
+
abort(): void;
|
|
59
|
+
private start;
|
|
60
|
+
private processEvent;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=ChatStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatStream.d.ts","sourceRoot":"","sources":["../../src/client/ChatStream.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAEV,YAAY,EACZ,cAAc,EACd,eAAe,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B;AAED,KAAK,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAE/C;;;GAGG;AACH,qBAAa,UAAU;IAoCnB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;IApCjB,OAAO,CAAC,QAAQ,CAoBd;IAEF,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAKd;IACF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E,CAAA;KAAE,CAAC,GAAG,IAAI;IACzG,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI;IAC1E,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAC,YAAY,CAAC,GAAG,IAAI;IAYlE,yBAAyB;IACzB,KAAK,IAAI,IAAI;YAIC,KAAK;IA8BnB,OAAO,CAAC,YAAY;CAgFrB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Minimal typed event emitter with no external dependencies.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TypedEventEmitter<Events extends Record<string, any>> {
|
|
10
|
+
private listeners;
|
|
11
|
+
on<K extends keyof Events>(event: K, listener: (data: Events[K]) => void): this;
|
|
12
|
+
off<K extends keyof Events>(event: K, listener: (data: Events[K]) => void): this;
|
|
13
|
+
protected emit<K extends keyof Events>(event: K, data: Events[K]): void;
|
|
14
|
+
removeAllListeners(): this;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=EventEmitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../src/client/EventEmitter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AAEH,qBAAa,iBAAiB,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAC/D,OAAO,CAAC,SAAS,CAAuD;IAExE,EAAE,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI;IAU/E,GAAG,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI;IAWhF,SAAS,CAAC,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAUvE,kBAAkB,IAAI,IAAI;CAI3B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
export { ChatClient } from './ChatClient';
|
|
7
|
+
export type { ChatClientConfig, ClientEvents } from './ChatClient';
|
|
8
|
+
export { ChatStream } from './ChatStream';
|
|
9
|
+
export type { ChatResponse } from './ChatStream';
|
|
10
|
+
export { TypedEventEmitter } from './EventEmitter';
|
|
11
|
+
export { WidgetEventBus, defaultEntityExtractor } from '../events';
|
|
12
|
+
export type { WidgetEvent, WidgetEventMap, EntityReference, EntityExtractor, ToolExecutedEvent, SkillActivatedEvent, WidgetRenderedEvent, KBProposalEvent, EntityReferencedEvent, EntityHoveredEvent, EntityUnhoveredEvent, EntityClickedEvent, } from '../events';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnE,YAAY,EACV,WAAW,EACX,cAAc,EACd,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,WAAW,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { SSEEvent } from './types';
|
|
2
|
+
export interface ChatStreamRequest {
|
|
3
|
+
message: string;
|
|
4
|
+
session_id?: string;
|
|
5
|
+
role?: string;
|
|
6
|
+
session_type?: string;
|
|
7
|
+
deploy_id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SessionInfo {
|
|
10
|
+
session_id: string;
|
|
11
|
+
role: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parse a single SSE data line into a typed event.
|
|
15
|
+
* Returns null for non-data lines or empty data.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseSSELine(line: string): SSEEvent | null;
|
|
18
|
+
/**
|
|
19
|
+
* Streams chat responses from the API server's SSE endpoint.
|
|
20
|
+
* Uses fetch + ReadableStream (not EventSource, which only supports GET).
|
|
21
|
+
*/
|
|
22
|
+
export declare function streamChat(serverUrl: string, request: ChatStreamRequest, signal?: AbortSignal, token?: string): AsyncGenerator<SSEEvent>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new chat session on the server.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createSession(serverUrl: string, user: {
|
|
27
|
+
id: string;
|
|
28
|
+
role?: string;
|
|
29
|
+
}, token?: string): Promise<SessionInfo>;
|
|
30
|
+
export interface SessionHistoryItem {
|
|
31
|
+
id: string;
|
|
32
|
+
tenant_id: string;
|
|
33
|
+
app_id?: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
tags: string[];
|
|
36
|
+
status: string;
|
|
37
|
+
session_type?: string;
|
|
38
|
+
message_count: number;
|
|
39
|
+
created_at: string;
|
|
40
|
+
updated_at: string;
|
|
41
|
+
}
|
|
42
|
+
export interface SessionDetail extends SessionHistoryItem {
|
|
43
|
+
messages: Array<{
|
|
44
|
+
type: string;
|
|
45
|
+
id: string;
|
|
46
|
+
text: string;
|
|
47
|
+
timestamp: string;
|
|
48
|
+
toolCalls?: Array<Record<string, unknown>>;
|
|
49
|
+
skillActivations?: string[];
|
|
50
|
+
widgets?: Array<Record<string, unknown>>;
|
|
51
|
+
contentBlocks?: Array<Record<string, unknown>>;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* List past sessions for the authenticated tenant.
|
|
56
|
+
*/
|
|
57
|
+
export declare function listSessions(serverUrl: string, token?: string | null, tags?: string[]): Promise<SessionHistoryItem[]>;
|
|
58
|
+
/**
|
|
59
|
+
* Get a single session with full message history.
|
|
60
|
+
*/
|
|
61
|
+
export declare function getSessionHistory(serverUrl: string, sessionId: string, token?: string | null): Promise<SessionDetail>;
|
|
62
|
+
/**
|
|
63
|
+
* Update session title and/or tags.
|
|
64
|
+
*/
|
|
65
|
+
export declare function updateSession(serverUrl: string, sessionId: string, updates: {
|
|
66
|
+
title?: string;
|
|
67
|
+
tags?: string[];
|
|
68
|
+
}, token?: string | null): Promise<SessionDetail>;
|
|
69
|
+
/**
|
|
70
|
+
* Creates a configured chat client instance.
|
|
71
|
+
*/
|
|
72
|
+
export declare function createChatClient(serverUrl: string, token?: string): {
|
|
73
|
+
stream: (request: ChatStreamRequest, signal?: AbortSignal) => AsyncGenerator<SSEEvent, any, any>;
|
|
74
|
+
createSession: (user: {
|
|
75
|
+
id: string;
|
|
76
|
+
role?: string;
|
|
77
|
+
}) => Promise<SessionInfo>;
|
|
78
|
+
listSessions: (tags?: string[]) => Promise<SessionHistoryItem[]>;
|
|
79
|
+
getSessionHistory: (sessionId: string) => Promise<SessionDetail>;
|
|
80
|
+
updateSession: (sessionId: string, updates: {
|
|
81
|
+
title?: string;
|
|
82
|
+
tags?: string[];
|
|
83
|
+
}) => Promise<SessionDetail>;
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAM1D;AAED;;;GAGG;AACH,wBAAuB,UAAU,CAC/B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iBAAiB,EAC1B,MAAM,CAAC,EAAE,WAAW,EACpB,KAAK,CAAC,EAAE,MAAM,GACb,cAAc,CAAC,QAAQ,CAAC,CA6D1B;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EACnC,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,CAyBtB;AAMD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAA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,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,EAC5C,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO,CAAC,aAAa,CAAC,CAgBxB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;sBAE5C,iBAAiB,WAAW,WAAW;0BAEnC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;0BAE7B,MAAM,EAAE;mCACC,MAAM;+BACV,MAAM,WAAW;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;EAGlF"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AskUserBlock } from '../types';
|
|
2
|
+
interface AskUserCardProps {
|
|
3
|
+
block: AskUserBlock;
|
|
4
|
+
onSubmit: (askId: string, answers: Record<string, string>) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function AskUserCard({ block, onSubmit }: AskUserCardProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=AskUserCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AskUserCard.d.ts","sourceRoot":"","sources":["../../src/components/AskUserCard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAmB,YAAY,EAAE,MAAM,UAAU,CAAC;AAE9D,UAAU,gBAAgB;IACxB,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CACpE;AAqID,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CA+ChE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WidgetConfig } from '../types';
|
|
2
|
+
import { WidgetRegistry } from './widgets/WidgetRenderer';
|
|
3
|
+
export type ChatWidgetProps = WidgetConfig & {
|
|
4
|
+
widgets?: WidgetRegistry;
|
|
5
|
+
/** Enable session history drawer. */
|
|
6
|
+
historyEnabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function ChatWidget({ serverUrl, user, getToken, theme, position, defaultOpen, onToolCall, onKBProposal, onEvent, entityExtractors, widgets: customWidgets, historyEnabled, showInput, sessionType, deployId, initialMessage, resumeSessionId, onStreamEnd, onSessionCreated, }: ChatWidgetProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
//# sourceMappingURL=ChatWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatWidget.d.ts","sourceRoot":"","sources":["../../src/components/ChatWidget.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO/D,OAAO,eAAe,CAAC;AAmBvB,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG;IAC3C,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,qCAAqC;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,QAAqB,EACrB,WAAmB,EACnB,UAAU,EACV,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,OAAO,EAAE,aAAa,EACtB,cAAsB,EACtB,SAAgB,EAChB,WAAW,EACX,QAAQ,EACR,cAAc,EACd,eAAe,EACf,WAAW,EACX,gBAAgB,GACjB,EAAE,eAAe,kDAmJjB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
interface FormattedTextProps {
|
|
7
|
+
text: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function FormattedText({ text, className }: FormattedTextProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=FormattedText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormattedText.d.ts","sourceRoot":"","sources":["../../src/components/FormattedText.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AA0GH,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,kBAAkB,2CAQpE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
interface InputBarProps {
|
|
7
|
+
onSend: (text: string) => void;
|
|
8
|
+
onStop?: () => void;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
isStreaming?: boolean;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function InputBar({ onSend, onStop, disabled, isStreaming, placeholder }: InputBarProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=InputBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputBar.d.ts","sourceRoot":"","sources":["../../src/components/InputBar.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,UAAU,aAAa;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAmBD,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,aAAa,2CAkE7F"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KBProposalInfo } from '../types';
|
|
2
|
+
interface KBProposalCardProps {
|
|
3
|
+
proposal: KBProposalInfo;
|
|
4
|
+
}
|
|
5
|
+
export declare function KBProposalCard({ proposal }: KBProposalCardProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=KBProposalCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KBProposalCard.d.ts","sourceRoot":"","sources":["../../src/components/KBProposalCard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CAW/D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChatMessage } from '../types';
|
|
2
|
+
import { InteractionEvent } from '../events/types';
|
|
3
|
+
import { WidgetRegistry } from './widgets/WidgetRenderer';
|
|
4
|
+
interface MessageListProps {
|
|
5
|
+
messages: ChatMessage[];
|
|
6
|
+
isStreaming: boolean;
|
|
7
|
+
sendMessage?: (text: string) => void;
|
|
8
|
+
customWidgets?: WidgetRegistry;
|
|
9
|
+
onInteraction?: (event: InteractionEvent) => void;
|
|
10
|
+
onAskUserSubmit?: (askId: string, answers: Record<string, string>) => void;
|
|
11
|
+
emptyStateText?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function MessageList({ messages, isStreaming, sendMessage, customWidgets, onInteraction, onAskUserSubmit, emptyStateText }: MessageListProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=MessageList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAwB,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAQxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,UAAU,gBAAgB;IACxB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAmGD,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,EAAE,gBAAgB,2CAkElJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SessionHistoryItem } from '../client';
|
|
2
|
+
export interface SessionHistoryProps {
|
|
3
|
+
sessions: SessionHistoryItem[];
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
allTags: string[];
|
|
6
|
+
onSelectSession: (sessionId: string) => void;
|
|
7
|
+
onNewChat: () => void;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onUpdateTags: (sessionId: string, tags: string[]) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function SessionHistory({ sessions, isLoading, allTags, onSelectSession, onNewChat, onClose, onUpdateTags, }: SessionHistoryProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=SessionHistory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionHistory.d.ts","sourceRoot":"","sources":["../../src/components/SessionHistory.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAGpD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC3D;AAeD,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,eAAe,EACf,SAAS,EACT,OAAO,EACP,YAAY,GACb,EAAE,mBAAmB,2CA2HrB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
interface SkillPillProps {
|
|
7
|
+
skill: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function SkillPill({ skill }: SkillPillProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=SkillPill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkillPill.d.ts","sourceRoot":"","sources":["../../src/components/SkillPill.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,cAAc,2CAElD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamingIndicator.d.ts","sourceRoot":"","sources":["../../src/components/StreamingIndicator.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wBAAgB,kBAAkB,4CAQjC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
export interface TagEditorProps {
|
|
7
|
+
tags: string[];
|
|
8
|
+
onSave: (tags: string[]) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function TagEditor({ tags, onSave }: TagEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=TagEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagEditor.d.ts","sourceRoot":"","sources":["../../src/components/TagEditor.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAClC;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,cAAc,2CAuEzD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ToolCallInfo } from '../types';
|
|
2
|
+
interface ToolCallCardProps {
|
|
3
|
+
toolCall: ToolCallInfo;
|
|
4
|
+
}
|
|
5
|
+
export declare function ToolCallCard({ toolCall }: ToolCallCardProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=ToolCallCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolCallCard.d.ts","sourceRoot":"","sources":["../../src/components/ToolCallCard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAqB,MAAM,UAAU,CAAC;AAGhE,UAAU,iBAAiB;IACzB,QAAQ,EAAE,YAAY,CAAC;CACxB;AAqND,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAgC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertCard.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/AlertCard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAoBpD,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,WAAW,2CAsC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Comparison.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/Comparison.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAiBpD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,WAAW,2CA8B5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialInput.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/CredentialInput.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAiBpD,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,WAAW,2CAuGjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/DataTable.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAcpD,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,2CAkE9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentPreview.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/DocumentPreview.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAiBpD,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,WAAW,2CAwGjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityCard.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/EntityCard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAkBpD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,WAAW,2CAiG3E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/EntityList.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAkBpD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,WAAW,2CA4E5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoCard.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/InfoCard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAYpD,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,WAAW,2CAyD1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Metric.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/Metric.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAiBpD,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,2CA4B3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScopeMap.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/ScopeMap.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA0BpD,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,WAAW,2CA0F5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScoreBreakdown.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/ScoreBreakdown.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAcpD,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,2CA+CnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBoard.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/StatusBoard.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAuBpD,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,WAAW,2CAkC7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/Timeline.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAuBpD,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,WAAW,2CAqC1D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { InteractionEvent } from '../../events/types';
|
|
3
|
+
/**
|
|
4
|
+
* Props that every widget component receives.
|
|
5
|
+
*/
|
|
6
|
+
export interface WidgetProps<T = Record<string, unknown>> {
|
|
7
|
+
data: T;
|
|
8
|
+
sendMessage: (text: string) => void;
|
|
9
|
+
onInteraction?: (event: InteractionEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Map of widget type string → component.
|
|
13
|
+
*/
|
|
14
|
+
export type WidgetRegistry = Record<string, ComponentType<WidgetProps>>;
|
|
15
|
+
interface WidgetRendererProps {
|
|
16
|
+
widgetType: string;
|
|
17
|
+
data: Record<string, unknown>;
|
|
18
|
+
sendMessage: (text: string) => void;
|
|
19
|
+
customWidgets?: WidgetRegistry;
|
|
20
|
+
onInteraction?: (event: InteractionEvent) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Renders a widget by looking up the type in custom widgets first,
|
|
24
|
+
* then platform widgets, then falling back to a generic JSON display.
|
|
25
|
+
*/
|
|
26
|
+
export declare function WidgetRenderer({ widgetType, data, sendMessage, customWidgets, onInteraction, }: WidgetRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=WidgetRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/widgets/WidgetRenderer.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAa,KAAK,aAAa,EAAkB,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAe3D;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACtD,IAAI,EAAE,CAAC,CAAC;IACR,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;AAsDxE,UAAU,mBAAmB;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACnD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,IAAI,EACJ,WAAW,EACX,aAAa,EACb,aAAa,GACd,EAAE,mBAAmB,2CAuBrB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EntityReference, WidgetEvent } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Default entity extractor. Inspects agent-driven events and extracts entity
|
|
4
|
+
* references from known widget data shapes and tool parameters.
|
|
5
|
+
*/
|
|
6
|
+
export declare function defaultEntityExtractor(event: WidgetEvent): EntityReference[];
|
|
7
|
+
//# sourceMappingURL=entity-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-extractor.d.ts","sourceRoot":"","sources":["../../src/events/entity-extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE5D;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,eAAe,EAAE,CAY5E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TypedEventEmitter } from '../client/EventEmitter';
|
|
2
|
+
import { WidgetEventMap, WidgetEvent, EntityExtractor } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Event bus for widget events. Emits both agent-driven events (from SSE stream)
|
|
5
|
+
* and user interaction events (hover/click on entities in the chat).
|
|
6
|
+
*
|
|
7
|
+
* Subscribing to `'*'` receives all events.
|
|
8
|
+
*/
|
|
9
|
+
export declare class WidgetEventBus extends TypedEventEmitter<WidgetEventMap> {
|
|
10
|
+
private extractors;
|
|
11
|
+
/**
|
|
12
|
+
* Process an agent-driven event: emit on its typed channel + '*',
|
|
13
|
+
* then run entity extractors and emit entity_referenced for each found entity.
|
|
14
|
+
*/
|
|
15
|
+
processEvent(event: WidgetEvent): void;
|
|
16
|
+
/**
|
|
17
|
+
* Emit an interaction event (entity_hovered, entity_unhovered, entity_clicked).
|
|
18
|
+
* These are emitted on their typed channel + '*' without running extractors,
|
|
19
|
+
* since interaction events already carry their EntityReference.
|
|
20
|
+
*/
|
|
21
|
+
emitInteraction(event: WidgetEvent): void;
|
|
22
|
+
/** Add a custom entity extractor. */
|
|
23
|
+
addExtractor(fn: EntityExtractor): void;
|
|
24
|
+
/** Replace all entity extractors (including the default). */
|
|
25
|
+
setExtractors(fns: EntityExtractor[]): void;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=event-bus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../../src/events/event-bus.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAyB,MAAM,SAAS,CAAC;AAEnG;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,iBAAiB,CAAC,cAAc,CAAC;IACnE,OAAO,CAAC,UAAU,CAA+C;IAEjE;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IA6BtC;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAMzC,qCAAqC;IACrC,YAAY,CAAC,EAAE,EAAE,eAAe,GAAG,IAAI;IAIvC,6DAA6D;IAC7D,aAAa,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,IAAI;CAG5C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
export { WidgetEventBus } from './event-bus';
|
|
7
|
+
export { defaultEntityExtractor } from './entity-extractor';
|
|
8
|
+
export type { EntityReference, WidgetEvent, WidgetEventMap, EntityExtractor, AgentDrivenEvent, InteractionEvent, ToolExecutedEvent, SkillActivatedEvent, WidgetRenderedEvent, KBProposalEvent, EntityReferencedEvent, EntityHoveredEvent, EntityUnhoveredEvent, EntityClickedEvent, } from './types';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|