@nexo-labs/chat-agent 1.9.1 → 1.9.3
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/react.d.mts +35 -8
- package/dist/react.d.mts.map +1 -1
- package/dist/react.mjs +45 -31
- package/dist/react.mjs.map +1 -1
- package/package.json +5 -4
- package/src/adapters/ChatAdapter.ts +1 -1
- package/src/adapters/MockAdapter.ts +1 -1
- package/src/adapters/NexoPayloadChatAdapter.ts +1 -2
- package/src/components/ChatInterface.tsx +1 -8
- package/src/components/DocumentSelector.tsx +3 -1
- package/src/components/SourcesList.tsx +30 -23
- package/src/components/buttons/ViewMoreLink.tsx +2 -3
- package/src/components/chat-context.tsx +49 -1
- package/src/components/useDocumentSelector.ts +33 -28
- package/src/hooks/useAssistantRuntime.ts +1 -8
- package/src/hooks/useChunkLoader.ts +6 -11
- package/src/index.ts +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zetesis - Rubén Garcia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/react.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ interface Source {
|
|
|
6
6
|
id: string;
|
|
7
7
|
title: string;
|
|
8
8
|
slug: string;
|
|
9
|
-
type:
|
|
9
|
+
type: string;
|
|
10
10
|
chunkIndex: number;
|
|
11
11
|
relevanceScore: number;
|
|
12
12
|
content: string;
|
|
@@ -2254,8 +2254,26 @@ declare const UserMessage: FC;
|
|
|
2254
2254
|
declare const AssistantMessage: FC;
|
|
2255
2255
|
//#endregion
|
|
2256
2256
|
//#region src/components/chat-context.d.ts
|
|
2257
|
+
/**
|
|
2258
|
+
* Resolves collection type metadata for UI rendering.
|
|
2259
|
+
* All fields are optional — sensible defaults are applied.
|
|
2260
|
+
*/
|
|
2261
|
+
interface CollectionTypeResolver {
|
|
2262
|
+
/** Human-readable label (e.g. 'posts' → 'Artículo') */
|
|
2263
|
+
label?: (type: string) => string;
|
|
2264
|
+
/** Icon component (e.g. 'books' → <BookOpen />) */
|
|
2265
|
+
icon?: (type: string) => React.ReactNode;
|
|
2266
|
+
/** URL route segment for link generation (e.g. 'posts' → 'articulos') */
|
|
2267
|
+
contentType?: (type: string) => string;
|
|
2268
|
+
/** Typesense chunk collection name (e.g. 'posts' → 'posts_chunk') */
|
|
2269
|
+
chunkCollection?: (type: string) => string;
|
|
2270
|
+
}
|
|
2257
2271
|
interface ChatContextType {
|
|
2258
2272
|
adapter: ChatAdapter;
|
|
2273
|
+
/** Typesense collection names available for document search */
|
|
2274
|
+
searchCollections: string[];
|
|
2275
|
+
/** Resolved collection type config (with defaults applied) */
|
|
2276
|
+
collectionResolver: Required<CollectionTypeResolver>;
|
|
2259
2277
|
isPanelOpen: boolean;
|
|
2260
2278
|
isMaximized: boolean;
|
|
2261
2279
|
openPanel: () => void;
|
|
@@ -2283,13 +2301,20 @@ interface ChatContextType {
|
|
|
2283
2301
|
renameSession: (conversationId: string, newTitle: string) => Promise<boolean>;
|
|
2284
2302
|
deleteSession: (conversationId: string) => Promise<boolean>;
|
|
2285
2303
|
}
|
|
2286
|
-
|
|
2287
|
-
children,
|
|
2288
|
-
adapter: customAdapter
|
|
2289
|
-
}: {
|
|
2304
|
+
interface ChatProviderProps {
|
|
2290
2305
|
children: ReactNode;
|
|
2291
2306
|
adapter?: ChatAdapter;
|
|
2292
|
-
|
|
2307
|
+
/** Typesense collection names available for document search */
|
|
2308
|
+
searchCollections?: string[];
|
|
2309
|
+
/** Collection type resolver for UI labels, icons, and URL mapping */
|
|
2310
|
+
collectionResolver?: CollectionTypeResolver;
|
|
2311
|
+
}
|
|
2312
|
+
declare const ChatProvider: ({
|
|
2313
|
+
children,
|
|
2314
|
+
adapter: customAdapter,
|
|
2315
|
+
searchCollections,
|
|
2316
|
+
collectionResolver: customResolver
|
|
2317
|
+
}: ChatProviderProps) => react_jsx_runtime0.JSX.Element;
|
|
2293
2318
|
declare const useChat: () => ChatContextType;
|
|
2294
2319
|
//#endregion
|
|
2295
2320
|
//#region src/components/FloatingChatManager.d.ts
|
|
@@ -2323,14 +2348,16 @@ declare const FloatingChatManager: ({
|
|
|
2323
2348
|
ImageComponent
|
|
2324
2349
|
}: FloatingChatManagerProps) => react_jsx_runtime0.JSX.Element | null;
|
|
2325
2350
|
//#endregion
|
|
2326
|
-
//#region src/
|
|
2351
|
+
//#region src/components/useDocumentSelector.d.ts
|
|
2327
2352
|
interface Document {
|
|
2328
2353
|
id: string;
|
|
2329
2354
|
title: string;
|
|
2330
2355
|
slug: string;
|
|
2331
|
-
type:
|
|
2356
|
+
type: string;
|
|
2332
2357
|
collection: string;
|
|
2333
2358
|
}
|
|
2359
|
+
//#endregion
|
|
2360
|
+
//#region src/hooks/useAssistantRuntime.d.ts
|
|
2334
2361
|
interface UseAssistantRuntimeProps {
|
|
2335
2362
|
messages: Message$1[];
|
|
2336
2363
|
setMessages: React.Dispatch<React.SetStateAction<Message$1[]>>;
|