@assistant-ui/react 0.12.15 → 0.12.17
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts +1 -4
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js +2 -527
- package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/legacy-runtime/hooks/AttachmentContext.d.ts +96 -96
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts +1 -16
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.js +1 -14
- package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts +1 -13
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.js +2 -82
- package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.d.ts +1 -23
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js +1 -410
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts +1 -16
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js +1 -48
- package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts +1 -33
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js +1 -307
- package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts +1 -3
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.js +1 -17
- package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts +2 -26
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.js +1 -13
- package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts +1 -3
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js +1 -51
- package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts +1 -96
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js +1 -110
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts +1 -112
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js +1 -439
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts +1 -12
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.js +1 -102
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts +1 -3
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js +1 -46
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.js +7 -20
- package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.js +3 -8
- package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +4 -7
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +5 -7
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.js +3 -10
- package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js +5 -4
- package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
- package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerCancel.js +3 -8
- package/dist/primitives/composer/ComposerCancel.js.map +1 -1
- package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerSend.js +3 -8
- package/dist/primitives/composer/ComposerSend.js.map +1 -1
- package/dist/utils/createActionButton.js +1 -1
- package/dist/utils/createActionButton.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -1
- package/src/internal.ts +1 -1
- package/src/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.ts +2 -784
- package/src/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.tsx +5 -43
- package/src/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.ts +2 -100
- package/src/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.ts +4 -580
- package/src/legacy-runtime/runtime-cores/external-store/createMessageConverter.ts +1 -76
- package/src/legacy-runtime/runtime-cores/external-store/external-message-converter.ts +4 -483
- package/src/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.ts +1 -27
- package/src/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.ts +2 -35
- package/src/legacy-runtime/runtime-cores/local/useLocalRuntime.ts +1 -67
- package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.tsx +1 -178
- package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.tsx +1 -529
- package/src/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.tsx +1 -152
- package/src/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.ts +1 -80
- package/src/primitives/actionBar/ActionBarCopy.tsx +7 -26
- package/src/primitives/actionBar/ActionBarEdit.ts +3 -10
- package/src/primitives/actionBar/ActionBarFeedbackNegative.tsx +4 -9
- package/src/primitives/actionBar/ActionBarFeedbackPositive.tsx +5 -9
- package/src/primitives/actionBar/ActionBarReload.ts +3 -16
- package/src/primitives/composer/ComposerAddAttachment.ts +5 -4
- package/src/primitives/composer/ComposerCancel.ts +3 -10
- package/src/primitives/composer/ComposerSend.ts +3 -13
- package/src/tests/BaseComposerRuntimeCore.test.ts +2 -3
- package/src/utils/createActionButton.tsx +1 -1
|
@@ -1,97 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { ThreadListRuntimeCore } from "../../../internal.js";
|
|
3
|
-
import { BaseSubscribable } from "@assistant-ui/core/internal";
|
|
4
|
-
import { AssistantRuntime } from "../../runtime/index.js";
|
|
5
|
-
type RemoteThreadListHook = () => AssistantRuntime;
|
|
6
|
-
export declare class RemoteThreadListHookInstanceManager extends BaseSubscribable {
|
|
7
|
-
private useRuntimeHook;
|
|
8
|
-
private instances;
|
|
9
|
-
private useAliveThreadsKeysChanged;
|
|
10
|
-
private parent;
|
|
11
|
-
constructor(runtimeHook: RemoteThreadListHook, parent: ThreadListRuntimeCore);
|
|
12
|
-
startThreadRuntime(threadId: string): Promise<Readonly<{
|
|
13
|
-
getMessageById: (messageId: string) => {
|
|
14
|
-
parentId: string | null;
|
|
15
|
-
message: import("@assistant-ui/core").ThreadMessage;
|
|
16
|
-
index: number;
|
|
17
|
-
} | undefined;
|
|
18
|
-
getBranches: (messageId: string) => readonly string[];
|
|
19
|
-
switchToBranch: (branchId: string) => void;
|
|
20
|
-
append: (message: import("@assistant-ui/core").AppendMessage) => void;
|
|
21
|
-
startRun: (config: import("@assistant-ui/core").StartRunConfig) => void;
|
|
22
|
-
resumeRun: (config: import("@assistant-ui/core").ResumeRunConfig) => void;
|
|
23
|
-
cancelRun: () => void;
|
|
24
|
-
addToolResult: (options: import("@assistant-ui/core").AddToolResultOptions) => void;
|
|
25
|
-
resumeToolCall: (options: import("@assistant-ui/core").ResumeToolCallOptions) => void;
|
|
26
|
-
speak: (messageId: string) => void;
|
|
27
|
-
stopSpeaking: () => void;
|
|
28
|
-
submitFeedback: (feedback: import("@assistant-ui/core").SubmitFeedbackOptions) => void;
|
|
29
|
-
getModelContext: () => import("@assistant-ui/core").ModelContext;
|
|
30
|
-
composer: import("@assistant-ui/core").ThreadComposerRuntimeCore;
|
|
31
|
-
getEditComposer: (messageId: string) => import("@assistant-ui/core").ComposerRuntimeCore | undefined;
|
|
32
|
-
beginEdit: (messageId: string) => void;
|
|
33
|
-
speech: import("@assistant-ui/core").SpeechState | undefined;
|
|
34
|
-
capabilities: Readonly<import("@assistant-ui/core").RuntimeCapabilities>;
|
|
35
|
-
isDisabled: boolean;
|
|
36
|
-
isLoading: boolean;
|
|
37
|
-
messages: readonly import("@assistant-ui/core").ThreadMessage[];
|
|
38
|
-
state: import("assistant-stream/utils").ReadonlyJSONValue;
|
|
39
|
-
suggestions: readonly import("@assistant-ui/core").ThreadSuggestion[];
|
|
40
|
-
extras: unknown;
|
|
41
|
-
subscribe: (callback: () => void) => import("@assistant-ui/core").Unsubscribe;
|
|
42
|
-
import(repository: import("@assistant-ui/core").ExportedMessageRepository): void;
|
|
43
|
-
export(): import("@assistant-ui/core").ExportedMessageRepository;
|
|
44
|
-
exportExternalState(): any;
|
|
45
|
-
importExternalState(state: any): void;
|
|
46
|
-
reset(initialMessages?: readonly import("@assistant-ui/core").ThreadMessageLike[]): void;
|
|
47
|
-
unstable_on(event: import("@assistant-ui/core").ThreadRuntimeEventType, callback: () => void): import("@assistant-ui/core").Unsubscribe;
|
|
48
|
-
unstable_loadExternalState: (state: any) => void;
|
|
49
|
-
}>>;
|
|
50
|
-
getThreadRuntimeCore(threadId: string): Readonly<{
|
|
51
|
-
getMessageById: (messageId: string) => {
|
|
52
|
-
parentId: string | null;
|
|
53
|
-
message: import("@assistant-ui/core").ThreadMessage;
|
|
54
|
-
index: number;
|
|
55
|
-
} | undefined;
|
|
56
|
-
getBranches: (messageId: string) => readonly string[];
|
|
57
|
-
switchToBranch: (branchId: string) => void;
|
|
58
|
-
append: (message: import("@assistant-ui/core").AppendMessage) => void;
|
|
59
|
-
startRun: (config: import("@assistant-ui/core").StartRunConfig) => void;
|
|
60
|
-
resumeRun: (config: import("@assistant-ui/core").ResumeRunConfig) => void;
|
|
61
|
-
cancelRun: () => void;
|
|
62
|
-
addToolResult: (options: import("@assistant-ui/core").AddToolResultOptions) => void;
|
|
63
|
-
resumeToolCall: (options: import("@assistant-ui/core").ResumeToolCallOptions) => void;
|
|
64
|
-
speak: (messageId: string) => void;
|
|
65
|
-
stopSpeaking: () => void;
|
|
66
|
-
submitFeedback: (feedback: import("@assistant-ui/core").SubmitFeedbackOptions) => void;
|
|
67
|
-
getModelContext: () => import("@assistant-ui/core").ModelContext;
|
|
68
|
-
composer: import("@assistant-ui/core").ThreadComposerRuntimeCore;
|
|
69
|
-
getEditComposer: (messageId: string) => import("@assistant-ui/core").ComposerRuntimeCore | undefined;
|
|
70
|
-
beginEdit: (messageId: string) => void;
|
|
71
|
-
speech: import("@assistant-ui/core").SpeechState | undefined;
|
|
72
|
-
capabilities: Readonly<import("@assistant-ui/core").RuntimeCapabilities>;
|
|
73
|
-
isDisabled: boolean;
|
|
74
|
-
isLoading: boolean;
|
|
75
|
-
messages: readonly import("@assistant-ui/core").ThreadMessage[];
|
|
76
|
-
state: import("assistant-stream/utils").ReadonlyJSONValue;
|
|
77
|
-
suggestions: readonly import("@assistant-ui/core").ThreadSuggestion[];
|
|
78
|
-
extras: unknown;
|
|
79
|
-
subscribe: (callback: () => void) => import("@assistant-ui/core").Unsubscribe;
|
|
80
|
-
import(repository: import("@assistant-ui/core").ExportedMessageRepository): void;
|
|
81
|
-
export(): import("@assistant-ui/core").ExportedMessageRepository;
|
|
82
|
-
exportExternalState(): any;
|
|
83
|
-
importExternalState(state: any): void;
|
|
84
|
-
reset(initialMessages?: readonly import("@assistant-ui/core").ThreadMessageLike[]): void;
|
|
85
|
-
unstable_on(event: import("@assistant-ui/core").ThreadRuntimeEventType, callback: () => void): import("@assistant-ui/core").Unsubscribe;
|
|
86
|
-
unstable_loadExternalState: (state: any) => void;
|
|
87
|
-
}> | undefined;
|
|
88
|
-
stopThreadRuntime(threadId: string): void;
|
|
89
|
-
setRuntimeHook(newRuntimeHook: RemoteThreadListHook): void;
|
|
90
|
-
private _InnerActiveThreadProvider;
|
|
91
|
-
private _OuterActiveThreadProvider;
|
|
92
|
-
__internal_RenderThreadRuntimes: FC<{
|
|
93
|
-
provider: ComponentType<PropsWithChildren>;
|
|
94
|
-
}>;
|
|
95
|
-
}
|
|
96
|
-
export {};
|
|
1
|
+
export { RemoteThreadListHookInstanceManager } from "@assistant-ui/core/react";
|
|
97
2
|
//# sourceMappingURL=RemoteThreadListHookInstanceManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteThreadListHookInstanceManager.d.ts","sourceRoot":"","sources":["../../../../src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"RemoteThreadListHookInstanceManager.d.ts","sourceRoot":"","sources":["../../../../src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mCAAmC,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js
CHANGED
|
@@ -1,112 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { useCallback, useRef, useEffect, memo, useMemo, } from "react";
|
|
4
|
-
import { create } from "zustand";
|
|
5
|
-
import { useAui } from "@assistant-ui/store";
|
|
6
|
-
import { ThreadListItemRuntimeProvider } from "../../../context/providers/index.js";
|
|
7
|
-
import { BaseSubscribable } from "@assistant-ui/core/internal";
|
|
8
|
-
import { ThreadListRuntimeImpl } from "../../runtime/ThreadListRuntime.js";
|
|
9
|
-
export class RemoteThreadListHookInstanceManager extends BaseSubscribable {
|
|
10
|
-
useRuntimeHook;
|
|
11
|
-
instances = new Map();
|
|
12
|
-
useAliveThreadsKeysChanged = create(() => ({}));
|
|
13
|
-
parent;
|
|
14
|
-
constructor(runtimeHook, parent) {
|
|
15
|
-
super();
|
|
16
|
-
this.parent = parent;
|
|
17
|
-
this.useRuntimeHook = create(() => ({ useRuntime: runtimeHook }));
|
|
18
|
-
}
|
|
19
|
-
startThreadRuntime(threadId) {
|
|
20
|
-
if (!this.instances.has(threadId)) {
|
|
21
|
-
this.instances.set(threadId, {});
|
|
22
|
-
this.useAliveThreadsKeysChanged.setState({}, true);
|
|
23
|
-
}
|
|
24
|
-
return new Promise((resolve, reject) => {
|
|
25
|
-
const callback = () => {
|
|
26
|
-
const instance = this.instances.get(threadId);
|
|
27
|
-
if (!instance) {
|
|
28
|
-
dispose();
|
|
29
|
-
reject(new Error("Thread was deleted before runtime was started"));
|
|
30
|
-
}
|
|
31
|
-
else if (!instance.runtime) {
|
|
32
|
-
return; // misc update
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
dispose();
|
|
36
|
-
resolve(instance.runtime);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const dispose = this.subscribe(callback);
|
|
40
|
-
callback();
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
getThreadRuntimeCore(threadId) {
|
|
44
|
-
const instance = this.instances.get(threadId);
|
|
45
|
-
if (!instance)
|
|
46
|
-
return undefined;
|
|
47
|
-
return instance.runtime;
|
|
48
|
-
}
|
|
49
|
-
stopThreadRuntime(threadId) {
|
|
50
|
-
this.instances.delete(threadId);
|
|
51
|
-
this.useAliveThreadsKeysChanged.setState({}, true);
|
|
52
|
-
}
|
|
53
|
-
setRuntimeHook(newRuntimeHook) {
|
|
54
|
-
const prevRuntimeHook = this.useRuntimeHook.getState().useRuntime;
|
|
55
|
-
if (prevRuntimeHook !== newRuntimeHook) {
|
|
56
|
-
this.useRuntimeHook.setState({ useRuntime: newRuntimeHook }, true);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
_InnerActiveThreadProvider = ({ threadId }) => {
|
|
60
|
-
const { useRuntime } = this.useRuntimeHook();
|
|
61
|
-
const runtime = useRuntime();
|
|
62
|
-
const threadBinding = runtime.thread
|
|
63
|
-
.__internal_threadBinding;
|
|
64
|
-
const updateRuntime = useCallback(() => {
|
|
65
|
-
const aliveThread = this.instances.get(threadId);
|
|
66
|
-
if (!aliveThread)
|
|
67
|
-
throw new Error("Thread not found. This is a bug in assistant-ui.");
|
|
68
|
-
aliveThread.runtime = threadBinding.getState();
|
|
69
|
-
this._notifySubscribers();
|
|
70
|
-
}, [threadId, threadBinding]);
|
|
71
|
-
const isMounted = useRef(false);
|
|
72
|
-
if (!isMounted.current) {
|
|
73
|
-
updateRuntime();
|
|
74
|
-
}
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
isMounted.current = true;
|
|
77
|
-
updateRuntime();
|
|
78
|
-
return threadBinding.outerSubscribe(updateRuntime);
|
|
79
|
-
}, [threadBinding, updateRuntime]);
|
|
80
|
-
const aui = useAui();
|
|
81
|
-
const initPromiseRef = useRef(undefined);
|
|
82
|
-
useEffect(() => {
|
|
83
|
-
const runtimeCore = threadBinding.getState();
|
|
84
|
-
const setGetInitializePromise = runtimeCore["__internal_setGetInitializePromise"];
|
|
85
|
-
if (typeof setGetInitializePromise === "function") {
|
|
86
|
-
setGetInitializePromise.call(runtimeCore, () => initPromiseRef.current);
|
|
87
|
-
}
|
|
88
|
-
}, [threadBinding]);
|
|
89
|
-
useEffect(() => {
|
|
90
|
-
return runtime.threads.main.unstable_on("initialize", () => {
|
|
91
|
-
const state = aui.threadListItem().getState();
|
|
92
|
-
if (state.status === "new") {
|
|
93
|
-
initPromiseRef.current = aui.threadListItem().initialize();
|
|
94
|
-
const dispose = runtime.thread.unstable_on("runEnd", () => {
|
|
95
|
-
dispose();
|
|
96
|
-
aui.threadListItem().generateTitle();
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}, [runtime, aui]);
|
|
101
|
-
return null;
|
|
102
|
-
};
|
|
103
|
-
_OuterActiveThreadProvider = memo(({ threadId, provider: Provider }) => {
|
|
104
|
-
const runtime = useMemo(() => new ThreadListRuntimeImpl(this.parent).getItemById(threadId), [threadId]);
|
|
105
|
-
return (_jsx(ThreadListItemRuntimeProvider, { runtime: runtime, children: _jsx(Provider, { children: _jsx(this._InnerActiveThreadProvider, { threadId: threadId }) }) }));
|
|
106
|
-
});
|
|
107
|
-
__internal_RenderThreadRuntimes = ({ provider }) => {
|
|
108
|
-
this.useAliveThreadsKeysChanged(); // trigger re-render on alive threads change
|
|
109
|
-
return Array.from(this.instances.keys()).map((threadId) => (_jsx(this._OuterActiveThreadProvider, { threadId: threadId, provider: provider }, threadId)));
|
|
110
|
-
};
|
|
111
|
-
}
|
|
2
|
+
export { RemoteThreadListHookInstanceManager } from "@assistant-ui/core/react";
|
|
112
3
|
//# sourceMappingURL=RemoteThreadListHookInstanceManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteThreadListHookInstanceManager.js","sourceRoot":"","sources":["../../../../src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"RemoteThreadListHookInstanceManager.js","sourceRoot":"","sources":["../../../../src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,mCAAmC,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,113 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { BaseSubscribable, type RemoteThreadData, type THREAD_MAPPING_ID, type RemoteThreadListOptions } from "@assistant-ui/core/internal";
|
|
3
|
-
import { FC } from "react";
|
|
4
|
-
import { ModelContextProvider } from "../../../model-context/index.js";
|
|
5
|
-
export declare class RemoteThreadListThreadListRuntimeCore extends BaseSubscribable implements ThreadListRuntimeCore {
|
|
6
|
-
private readonly contextProvider;
|
|
7
|
-
private _options;
|
|
8
|
-
private readonly _hookManager;
|
|
9
|
-
private _loadThreadsPromise;
|
|
10
|
-
private _mainThreadId;
|
|
11
|
-
private readonly _state;
|
|
12
|
-
get threadItems(): Readonly<Record<THREAD_MAPPING_ID, RemoteThreadData>>;
|
|
13
|
-
getLoadThreadsPromise(): Promise<void>;
|
|
14
|
-
constructor(options: RemoteThreadListOptions, contextProvider: ModelContextProvider);
|
|
15
|
-
private useProvider;
|
|
16
|
-
__internal_setOptions(options: RemoteThreadListOptions): void;
|
|
17
|
-
__internal_load(): void;
|
|
18
|
-
get isLoading(): boolean;
|
|
19
|
-
get threadIds(): readonly string[];
|
|
20
|
-
get archivedThreadIds(): readonly string[];
|
|
21
|
-
get newThreadId(): string | undefined;
|
|
22
|
-
get mainThreadId(): string;
|
|
23
|
-
getMainThreadRuntimeCore(): Readonly<{
|
|
24
|
-
getMessageById: (messageId: string) => {
|
|
25
|
-
parentId: string | null;
|
|
26
|
-
message: import("@assistant-ui/core").ThreadMessage;
|
|
27
|
-
index: number;
|
|
28
|
-
} | undefined;
|
|
29
|
-
getBranches: (messageId: string) => readonly string[];
|
|
30
|
-
switchToBranch: (branchId: string) => void;
|
|
31
|
-
append: (message: import("@assistant-ui/core").AppendMessage) => void;
|
|
32
|
-
startRun: (config: import("@assistant-ui/core").StartRunConfig) => void;
|
|
33
|
-
resumeRun: (config: import("@assistant-ui/core").ResumeRunConfig) => void;
|
|
34
|
-
cancelRun: () => void;
|
|
35
|
-
addToolResult: (options: import("@assistant-ui/core").AddToolResultOptions) => void;
|
|
36
|
-
resumeToolCall: (options: import("@assistant-ui/core").ResumeToolCallOptions) => void;
|
|
37
|
-
speak: (messageId: string) => void;
|
|
38
|
-
stopSpeaking: () => void;
|
|
39
|
-
submitFeedback: (feedback: import("@assistant-ui/core").SubmitFeedbackOptions) => void;
|
|
40
|
-
getModelContext: () => import("@assistant-ui/core").ModelContext;
|
|
41
|
-
composer: import("@assistant-ui/core").ThreadComposerRuntimeCore;
|
|
42
|
-
getEditComposer: (messageId: string) => import("@assistant-ui/core").ComposerRuntimeCore | undefined;
|
|
43
|
-
beginEdit: (messageId: string) => void;
|
|
44
|
-
speech: import("@assistant-ui/core").SpeechState | undefined;
|
|
45
|
-
capabilities: Readonly<import("@assistant-ui/core").RuntimeCapabilities>;
|
|
46
|
-
isDisabled: boolean;
|
|
47
|
-
isLoading: boolean;
|
|
48
|
-
messages: readonly import("@assistant-ui/core").ThreadMessage[];
|
|
49
|
-
state: import("assistant-stream/utils").ReadonlyJSONValue;
|
|
50
|
-
suggestions: readonly import("@assistant-ui/core").ThreadSuggestion[];
|
|
51
|
-
extras: unknown;
|
|
52
|
-
subscribe: (callback: () => void) => import("@assistant-ui/core").Unsubscribe;
|
|
53
|
-
import(repository: import("@assistant-ui/core").ExportedMessageRepository): void;
|
|
54
|
-
export(): import("@assistant-ui/core").ExportedMessageRepository;
|
|
55
|
-
exportExternalState(): any;
|
|
56
|
-
importExternalState(state: any): void;
|
|
57
|
-
reset(initialMessages?: readonly import("@assistant-ui/core").ThreadMessageLike[]): void;
|
|
58
|
-
unstable_on(event: import("@assistant-ui/core").ThreadRuntimeEventType, callback: () => void): import("@assistant-ui/core").Unsubscribe;
|
|
59
|
-
unstable_loadExternalState: (state: any) => void;
|
|
60
|
-
}>;
|
|
61
|
-
getThreadRuntimeCore(threadIdOrRemoteId: string): Readonly<{
|
|
62
|
-
getMessageById: (messageId: string) => {
|
|
63
|
-
parentId: string | null;
|
|
64
|
-
message: import("@assistant-ui/core").ThreadMessage;
|
|
65
|
-
index: number;
|
|
66
|
-
} | undefined;
|
|
67
|
-
getBranches: (messageId: string) => readonly string[];
|
|
68
|
-
switchToBranch: (branchId: string) => void;
|
|
69
|
-
append: (message: import("@assistant-ui/core").AppendMessage) => void;
|
|
70
|
-
startRun: (config: import("@assistant-ui/core").StartRunConfig) => void;
|
|
71
|
-
resumeRun: (config: import("@assistant-ui/core").ResumeRunConfig) => void;
|
|
72
|
-
cancelRun: () => void;
|
|
73
|
-
addToolResult: (options: import("@assistant-ui/core").AddToolResultOptions) => void;
|
|
74
|
-
resumeToolCall: (options: import("@assistant-ui/core").ResumeToolCallOptions) => void;
|
|
75
|
-
speak: (messageId: string) => void;
|
|
76
|
-
stopSpeaking: () => void;
|
|
77
|
-
submitFeedback: (feedback: import("@assistant-ui/core").SubmitFeedbackOptions) => void;
|
|
78
|
-
getModelContext: () => import("@assistant-ui/core").ModelContext;
|
|
79
|
-
composer: import("@assistant-ui/core").ThreadComposerRuntimeCore;
|
|
80
|
-
getEditComposer: (messageId: string) => import("@assistant-ui/core").ComposerRuntimeCore | undefined;
|
|
81
|
-
beginEdit: (messageId: string) => void;
|
|
82
|
-
speech: import("@assistant-ui/core").SpeechState | undefined;
|
|
83
|
-
capabilities: Readonly<import("@assistant-ui/core").RuntimeCapabilities>;
|
|
84
|
-
isDisabled: boolean;
|
|
85
|
-
isLoading: boolean;
|
|
86
|
-
messages: readonly import("@assistant-ui/core").ThreadMessage[];
|
|
87
|
-
state: import("assistant-stream/utils").ReadonlyJSONValue;
|
|
88
|
-
suggestions: readonly import("@assistant-ui/core").ThreadSuggestion[];
|
|
89
|
-
extras: unknown;
|
|
90
|
-
subscribe: (callback: () => void) => import("@assistant-ui/core").Unsubscribe;
|
|
91
|
-
import(repository: import("@assistant-ui/core").ExportedMessageRepository): void;
|
|
92
|
-
export(): import("@assistant-ui/core").ExportedMessageRepository;
|
|
93
|
-
exportExternalState(): any;
|
|
94
|
-
importExternalState(state: any): void;
|
|
95
|
-
reset(initialMessages?: readonly import("@assistant-ui/core").ThreadMessageLike[]): void;
|
|
96
|
-
unstable_on(event: import("@assistant-ui/core").ThreadRuntimeEventType, callback: () => void): import("@assistant-ui/core").Unsubscribe;
|
|
97
|
-
unstable_loadExternalState: (state: any) => void;
|
|
98
|
-
}>;
|
|
99
|
-
getItemById(threadIdOrRemoteId: string): RemoteThreadData | undefined;
|
|
100
|
-
switchToThread(threadIdOrRemoteId: string): Promise<void>;
|
|
101
|
-
switchToNewThread(): Promise<void>;
|
|
102
|
-
initialize: (threadId: string) => Promise<import("@assistant-ui/core").RemoteThreadInitializeResponse>;
|
|
103
|
-
generateTitle: (threadId: string) => Promise<void>;
|
|
104
|
-
rename(threadIdOrRemoteId: string, newTitle: string): Promise<void>;
|
|
105
|
-
private _ensureThreadIsNotMain;
|
|
106
|
-
archive(threadIdOrRemoteId: string): Promise<void>;
|
|
107
|
-
unarchive(threadIdOrRemoteId: string): Promise<void>;
|
|
108
|
-
delete(threadIdOrRemoteId: string): Promise<void>;
|
|
109
|
-
detach(threadIdOrRemoteId: string): Promise<void>;
|
|
110
|
-
private useBoundIds;
|
|
111
|
-
__internal_RenderComponent: FC;
|
|
112
|
-
}
|
|
1
|
+
export { RemoteThreadListThreadListRuntimeCore } from "@assistant-ui/core/react";
|
|
113
2
|
//# sourceMappingURL=RemoteThreadListThreadListRuntimeCore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteThreadListThreadListRuntimeCore.d.ts","sourceRoot":"","sources":["../../../../src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"RemoteThreadListThreadListRuntimeCore.d.ts","sourceRoot":"","sources":["../../../../src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,qCAAqC,EAAE,MAAM,0BAA0B,CAAC"}
|