@harnessio/ai-chat-core 0.0.13 → 0.0.14
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CapabilityExecutionManager } from '../../core';
|
|
2
|
-
import { StreamAdapter, ThreadListAdapter } from '../../types/adapters';
|
|
2
|
+
import { StreamAdapter, ThreadListAdapter, ThreadListLoadOptions } from '../../types/adapters';
|
|
3
3
|
import { ThreadListItemState } from '../../types/thread';
|
|
4
4
|
import { BaseSubscribable } from '../../utils/Subscribable';
|
|
5
5
|
import { ThreadRuntime } from '../ThreadRuntime/ThreadRuntime';
|
|
@@ -7,14 +7,7 @@ export interface ThreadListState {
|
|
|
7
7
|
mainThreadId: string;
|
|
8
8
|
threads: readonly string[];
|
|
9
9
|
isLoading: boolean;
|
|
10
|
-
isLoadingMore: boolean;
|
|
11
10
|
threadItems: Record<string, ThreadListItemState>;
|
|
12
|
-
pagination?: {
|
|
13
|
-
currentPage: number;
|
|
14
|
-
totalPages: number;
|
|
15
|
-
totalCount: number;
|
|
16
|
-
hasMore: boolean;
|
|
17
|
-
};
|
|
18
11
|
searchQuery?: string;
|
|
19
12
|
}
|
|
20
13
|
export interface ThreadListRuntimeConfig {
|
|
@@ -29,17 +22,11 @@ export declare class ThreadListRuntime extends BaseSubscribable {
|
|
|
29
22
|
private _threadItems;
|
|
30
23
|
private _threadStates;
|
|
31
24
|
private _isLoading;
|
|
32
|
-
private _isLoadingMore;
|
|
33
|
-
private _currentPage;
|
|
34
|
-
private _totalPages;
|
|
35
|
-
private _totalCount;
|
|
36
|
-
private _hasMore;
|
|
37
25
|
private _searchQuery;
|
|
38
26
|
private _abortController;
|
|
39
27
|
readonly main: ThreadRuntime;
|
|
40
28
|
constructor(config: ThreadListRuntimeConfig);
|
|
41
29
|
get isLoading(): boolean;
|
|
42
|
-
get isLoadingMore(): boolean;
|
|
43
30
|
/**
|
|
44
31
|
* Get the currently active main thread
|
|
45
32
|
*/
|
|
@@ -47,9 +34,7 @@ export declare class ThreadListRuntime extends BaseSubscribable {
|
|
|
47
34
|
getState(): ThreadListState;
|
|
48
35
|
switchToThread(threadId: string): Promise<void>;
|
|
49
36
|
switchToNewThread(): Promise<void>;
|
|
50
|
-
loadThreads(
|
|
51
|
-
loadMoreThreads(): Promise<void>;
|
|
52
|
-
searchThreads(query: string): Promise<void>;
|
|
37
|
+
loadThreads(options?: ThreadListLoadOptions): Promise<ThreadListItemState[]>;
|
|
53
38
|
/**
|
|
54
39
|
* Syncs conversationId and title from thread runtime to thread state
|
|
55
40
|
*/
|
package/dist/types/adapters.d.ts
CHANGED
|
@@ -48,21 +48,13 @@ export interface StreamChunk {
|
|
|
48
48
|
}
|
|
49
49
|
export interface ThreadListLoadOptions {
|
|
50
50
|
query?: string;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export interface ThreadListPaginatedResponse {
|
|
55
|
-
threads: ThreadListItemState[];
|
|
56
|
-
pagination?: {
|
|
57
|
-
total?: number;
|
|
58
|
-
pageSize?: number;
|
|
59
|
-
pageCount?: number;
|
|
60
|
-
pageNumber?: number;
|
|
61
|
-
};
|
|
51
|
+
offset?: number;
|
|
52
|
+
limit?: number;
|
|
53
|
+
[key: string]: any;
|
|
62
54
|
}
|
|
63
55
|
export interface ThreadListAdapter {
|
|
64
56
|
listThreads(): Promise<ThreadListItemState[]>;
|
|
65
|
-
loadThreads(options?: ThreadListLoadOptions): Promise<ThreadListItemState[]
|
|
57
|
+
loadThreads(options?: ThreadListLoadOptions): Promise<ThreadListItemState[]>;
|
|
66
58
|
loadThread(threadId: string): Promise<Message[]>;
|
|
67
59
|
createThread(initialMessage?: string): Promise<ThreadListItemState>;
|
|
68
60
|
deleteThread(threadId: string): Promise<void>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { Message, MessageContent, MessageRole, MessageStatus, AppendMessage, TextContent, ErrorContent, MetadataContent, AssistantThoughtContent, CustomContent } from './message';
|
|
2
2
|
export type { ThreadListItemState, ThreadState, RuntimeCapabilities } from './thread';
|
|
3
3
|
export type { ChatPlugin, MessageRenderer, MessageRendererProps, GroupRenderer, GroupRendererProps, PluginConfig } from './plugin';
|
|
4
|
-
export type { StreamAdapter, ThreadListAdapter, StreamEvent, StreamRequest, StreamChunk, ThreadListLoadOptions
|
|
4
|
+
export type { StreamAdapter, ThreadListAdapter, StreamEvent, StreamRequest, StreamChunk, ThreadListLoadOptions } from './adapters';
|
|
5
5
|
export type { SSEEvent } from '../utils/BaseSSEStreamAdapter';
|
|
6
6
|
export type { CapabilityStatus, CapabilityExecutionContext, CapabilityExecution, CapabilityHandler, CapabilityRendererProps, CapabilityRenderer, CapabilityConfig, CapabilityContent } from './capability';
|
|
7
7
|
export type { ChatContextItem, ChatContextMap, ChatContextData, ChatContextValue } from './context';
|