@chat-lab/ui 0.1.0-beta.44 → 0.1.0-beta.45
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/_virtual/_commonjsHelpers.cjs +26 -0
- package/dist/_virtual/_commonjsHelpers.cjs.map +1 -1
- package/dist/_virtual/_commonjsHelpers.js +26 -1
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/_virtual/index.cjs +2 -2
- package/dist/_virtual/index.js +2 -2
- package/dist/_virtual/index2.cjs +2 -2
- package/dist/_virtual/index2.js +2 -2
- package/dist/_virtual/index3.cjs +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/_virtual/index4.cjs +2 -2
- package/dist/_virtual/index4.js +2 -2
- package/dist/_virtual/index5.cjs +5 -2
- package/dist/_virtual/index5.cjs.map +1 -1
- package/dist/_virtual/index5.js +5 -2
- package/dist/_virtual/index5.js.map +1 -1
- package/dist/adk/components/Debug/Trace/store.cjs +5 -5
- package/dist/adk/components/Debug/Trace/store.cjs.map +1 -1
- package/dist/adk/components/Debug/Trace/store.js +2 -2
- package/dist/adk/hooks/useEvents.cjs +5 -5
- package/dist/adk/hooks/useEvents.cjs.map +1 -1
- package/dist/adk/hooks/useEvents.js +2 -2
- package/dist/components/Chatkit/index.cjs +2 -2
- package/dist/components/Chatkit/index.cjs.map +1 -1
- package/dist/components/Chatkit/index.js +2 -2
- package/dist/components/Chatkit/index.js.map +1 -1
- package/dist/components/Chatkit/types.d.ts +3 -1
- package/dist/components/Chatkit/types.d.ts.map +1 -1
- package/dist/components/assistant-ui/thread.cjs +2 -2
- package/dist/components/assistant-ui/thread.cjs.map +1 -1
- package/dist/components/assistant-ui/thread.js +1 -1
- package/dist/components/assistant-ui/tooltip-icon-button.cjs +2 -2
- package/dist/components/assistant-ui/tooltip-icon-button.cjs.map +1 -1
- package/dist/components/assistant-ui/tooltip-icon-button.js +1 -1
- package/dist/components/thread-list.cjs +6 -6
- package/dist/components/thread-list.cjs.map +1 -1
- package/dist/components/thread-list.js +1 -1
- package/dist/components/ui/button.cjs +2 -2
- package/dist/components/ui/button.cjs.map +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/hooks/useADKChat.cjs +18 -1
- package/dist/hooks/useADKChat.cjs.map +1 -1
- package/dist/hooks/useADKChat.d.ts.map +1 -1
- package/dist/hooks/useADKChat.js +19 -2
- package/dist/hooks/useADKChat.js.map +1 -1
- package/dist/index.cjs +0 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/node_modules/.pnpm/@cloudfun_web-sdk@3.1.7_@volcengine_console-web-sdk@6.2.0/node_modules/@cloudfun/web-sdk/lib/util.cjs +1 -1
- package/dist/node_modules/.pnpm/@cloudfun_web-sdk@3.1.7_@volcengine_console-web-sdk@6.2.0/node_modules/@cloudfun/web-sdk/lib/util.js +1 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.4_@types_react@17.0.2_react@17.0.2/node_modules/@radix-ui/react-slot/dist/index.cjs +12 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.4_@types_react@17.0.2_react@17.0.2/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.4_@types_react@17.0.2_react@17.0.2/node_modules/@radix-ui/react-slot/dist/index.js +12 -2
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.4_@types_react@17.0.2_react@17.0.2/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@3.29.5_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.cjs +18 -0
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@3.29.5_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.cjs.map +1 -1
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@3.29.5_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js +17 -1
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@3.29.5_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs +1 -1
- package/dist/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js +1 -1
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.cjs +1 -1
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.js +1 -1
- package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.cjs +4 -1
- package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.cjs.map +1 -1
- package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js +1 -1
- package/dist/node_modules/.pnpm/secure-json-parse@4.1.0/node_modules/secure-json-parse/index.cjs +1 -1
- package/dist/node_modules/.pnpm/secure-json-parse@4.1.0/node_modules/secure-json-parse/index.js +1 -1
- package/dist/node_modules/.pnpm/style-to-js@1.1.18/node_modules/style-to-js/cjs/index.cjs +1 -1
- package/dist/node_modules/.pnpm/style-to-js@1.1.18/node_modules/style-to-js/cjs/index.js +1 -1
- package/dist/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs +1 -1
- package/dist/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@17.0.2_react@17.0.2/node_modules/use-sidecar/dist/es2015/medium.cjs +5 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@17.0.2_react@17.0.2/node_modules/use-sidecar/dist/es2015/medium.cjs.map +1 -1
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@17.0.2_react@17.0.2/node_modules/use-sidecar/dist/es2015/medium.js +5 -1
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@17.0.2_react@17.0.2/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
- package/dist/node_modules/.pnpm/use-sync-external-store@1.6.0_react@17.0.2/node_modules/use-sync-external-store/shim/index.cjs +1 -1
- package/dist/node_modules/.pnpm/use-sync-external-store@1.6.0_react@17.0.2/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/packages/chatui/node_modules/@cloudfun/top-proxy-sdk/lib/client.cjs +1 -1
- package/dist/packages/chatui/node_modules/@cloudfun/top-proxy-sdk/lib/client.cjs.map +1 -1
- package/dist/packages/chatui/node_modules/@cloudfun/top-proxy-sdk/lib/client.js +1 -1
- package/dist/packages/chatui/node_modules/@cloudfun/top-proxy-sdk/lib/client.js.map +1 -1
- package/dist/packages/core/dist/index.cjs +37 -15
- package/dist/packages/core/dist/index.cjs.map +1 -1
- package/dist/packages/core/dist/index.js +28 -7
- package/dist/packages/core/dist/index.js.map +1 -1
- package/package.json +1 -3
|
@@ -18,6 +18,12 @@ var defaultThreadManagerState = {
|
|
|
18
18
|
currentThreadId: null,
|
|
19
19
|
threadMap: {}
|
|
20
20
|
};
|
|
21
|
+
var createThreadManagerState = () => {
|
|
22
|
+
return proxy({
|
|
23
|
+
currentThreadId: null,
|
|
24
|
+
threadMap: {}
|
|
25
|
+
});
|
|
26
|
+
};
|
|
21
27
|
var createThreadManagerStateWithDefault = () => {
|
|
22
28
|
const id = v4();
|
|
23
29
|
return proxy({
|
|
@@ -214,7 +220,9 @@ function rewriteAgentCardUrl(original, serviceUrl) {
|
|
|
214
220
|
var A2ACompletion = async ({
|
|
215
221
|
onChunk,
|
|
216
222
|
requestOptions,
|
|
217
|
-
abortController
|
|
223
|
+
abortController,
|
|
224
|
+
thread,
|
|
225
|
+
onUpdateThread
|
|
218
226
|
}) => {
|
|
219
227
|
const cardResolver = new DefaultAgentCardResolver({
|
|
220
228
|
fetchImpl: (input, init) => {
|
|
@@ -228,6 +236,14 @@ var A2ACompletion = async ({
|
|
|
228
236
|
}
|
|
229
237
|
});
|
|
230
238
|
const rawCard = await cardResolver.resolve(requestOptions.api);
|
|
239
|
+
if (onUpdateThread && thread) {
|
|
240
|
+
onUpdateThread({
|
|
241
|
+
metadata: {
|
|
242
|
+
...thread.metadata,
|
|
243
|
+
agentCard: rawCard
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
231
247
|
const serviceUrl = requestOptions.api;
|
|
232
248
|
const rewrittenCard = rewriteAgentCardUrl(rawCard, serviceUrl);
|
|
233
249
|
const factory = new ClientFactory(
|
|
@@ -1328,8 +1344,6 @@ var LocalStorage = class {
|
|
|
1328
1344
|
keysToRemove.forEach((key) => localStorage.removeItem(key));
|
|
1329
1345
|
}
|
|
1330
1346
|
};
|
|
1331
|
-
|
|
1332
|
-
// src/plugins/adk-plugin.ts
|
|
1333
1347
|
var pluginName = "ADKPlugin";
|
|
1334
1348
|
var AdkPlugin = class extends ChatkitPlugin {
|
|
1335
1349
|
constructor(options) {
|
|
@@ -1345,7 +1359,8 @@ var AdkPlugin = class extends ChatkitPlugin {
|
|
|
1345
1359
|
name: id,
|
|
1346
1360
|
metadata: {},
|
|
1347
1361
|
sending: false,
|
|
1348
|
-
messages: []
|
|
1362
|
+
messages: [],
|
|
1363
|
+
createdAt: dayjs().unix()
|
|
1349
1364
|
}).then((res) => {
|
|
1350
1365
|
this.runtimeMap.setItem(runtime, res.id);
|
|
1351
1366
|
this.chatController?.setCurrentThread(res.id);
|
|
@@ -1602,7 +1617,8 @@ async function fetchChatCompletion({
|
|
|
1602
1617
|
completions,
|
|
1603
1618
|
protocolAdaptor,
|
|
1604
1619
|
onResponse,
|
|
1605
|
-
storeManager
|
|
1620
|
+
storeManager,
|
|
1621
|
+
thread
|
|
1606
1622
|
}) {
|
|
1607
1623
|
try {
|
|
1608
1624
|
let currentMessage = storeManager.getMessage(
|
|
@@ -1645,7 +1661,11 @@ async function fetchChatCompletion({
|
|
|
1645
1661
|
await completions({
|
|
1646
1662
|
abortController,
|
|
1647
1663
|
requestOptions,
|
|
1648
|
-
onChunk
|
|
1664
|
+
onChunk,
|
|
1665
|
+
thread,
|
|
1666
|
+
onUpdateThread: (updates) => {
|
|
1667
|
+
storeManager.updateThread(message.threadId, updates);
|
|
1668
|
+
}
|
|
1649
1669
|
});
|
|
1650
1670
|
} catch (error) {
|
|
1651
1671
|
throttledOnResponse.cancel();
|
|
@@ -1922,6 +1942,7 @@ var ChatController = class {
|
|
|
1922
1942
|
completions: this.requestOptions.completions || AdkCompletion,
|
|
1923
1943
|
protocolAdaptor,
|
|
1924
1944
|
storeManager,
|
|
1945
|
+
thread,
|
|
1925
1946
|
onResponse: async (updatedMessage) => {
|
|
1926
1947
|
if (updatedMessage.status === "pending" /* PENDING */ && !updatedMessage.createdAt) {
|
|
1927
1948
|
updatedMessage.createdAt = Date.now();
|
|
@@ -1943,5 +1964,5 @@ var ChatController = class {
|
|
|
1943
1964
|
}
|
|
1944
1965
|
};
|
|
1945
1966
|
|
|
1946
|
-
export { A2ACompletion, AdkCompletion, AdkPlugin, AsyncSeriesWaterfallHook, BaseProtocols_exports as BaseProtocol, ChatController, ChatkitPlugin, ChatkitPluginManager, Compiler, MessageStatus, ProtocolEnum, SyncBailHook, SyncHook, SyncWaterfallHook, ThreadMessageManager, completion, createThreadManagerStateWithDefault, getProtocolAdaptor, storeActions, threadManagerState };
|
|
1967
|
+
export { A2ACompletion, AdkCompletion, AdkPlugin, AsyncSeriesWaterfallHook, BaseProtocols_exports as BaseProtocol, ChatController, ChatkitPlugin, ChatkitPluginManager, Compiler, MessageStatus, ProtocolEnum, SyncBailHook, SyncHook, SyncWaterfallHook, ThreadMessageManager, completion, createThreadManagerState, createThreadManagerStateWithDefault, getProtocolAdaptor, storeActions, threadManagerState };
|
|
1947
1968
|
//# sourceMappingURL=index.js.map
|