@assistant-ui/react 0.12.15 → 0.12.16

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.
Files changed (72) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/internal.d.ts +1 -1
  6. package/dist/internal.d.ts.map +1 -1
  7. package/dist/internal.js +1 -1
  8. package/dist/internal.js.map +1 -1
  9. package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts +1 -4
  10. package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
  11. package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js +2 -527
  12. package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
  13. package/dist/legacy-runtime/hooks/AttachmentContext.d.ts +96 -96
  14. package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts +1 -16
  15. package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts.map +1 -1
  16. package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.js +1 -14
  17. package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.js.map +1 -1
  18. package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts +1 -13
  19. package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts.map +1 -1
  20. package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.js +2 -82
  21. package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.js.map +1 -1
  22. package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.d.ts +1 -23
  23. package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.d.ts.map +1 -1
  24. package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js +1 -410
  25. package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js.map +1 -1
  26. package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts +1 -16
  27. package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts.map +1 -1
  28. package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js +1 -48
  29. package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.js.map +1 -1
  30. package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts +1 -33
  31. package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts.map +1 -1
  32. package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js +1 -307
  33. package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.js.map +1 -1
  34. package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts +1 -3
  35. package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts.map +1 -1
  36. package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.js +1 -17
  37. package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.js.map +1 -1
  38. package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts +1 -1
  39. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts +1 -96
  40. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
  41. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js +1 -110
  42. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.js.map +1 -1
  43. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts +1 -112
  44. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
  45. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js +1 -439
  46. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
  47. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts +1 -12
  48. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts.map +1 -1
  49. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.js +1 -102
  50. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.js.map +1 -1
  51. package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts +1 -3
  52. package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts.map +1 -1
  53. package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js +1 -46
  54. package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.js.map +1 -1
  55. package/dist/utils/createActionButton.js +1 -1
  56. package/dist/utils/createActionButton.js.map +1 -1
  57. package/package.json +3 -3
  58. package/src/index.ts +1 -1
  59. package/src/internal.ts +1 -1
  60. package/src/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.ts +2 -784
  61. package/src/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.tsx +5 -43
  62. package/src/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.ts +2 -100
  63. package/src/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.ts +4 -580
  64. package/src/legacy-runtime/runtime-cores/external-store/createMessageConverter.ts +1 -76
  65. package/src/legacy-runtime/runtime-cores/external-store/external-message-converter.ts +4 -483
  66. package/src/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.ts +1 -27
  67. package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.tsx +1 -178
  68. package/src/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.tsx +1 -529
  69. package/src/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.tsx +1 -152
  70. package/src/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.ts +1 -80
  71. package/src/tests/BaseComposerRuntimeCore.test.ts +2 -3
  72. package/src/utils/createActionButton.tsx +1 -1
@@ -1,104 +1,3 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useCallback, useEffect, useMemo, useRef, } from "react";
4
- import { AssistantCloud } from "assistant-cloud";
5
- import { InMemoryThreadListAdapter } from "@assistant-ui/core";
6
- import { useAssistantCloudThreadHistoryAdapter } from "../../../cloud/AssistantCloudThreadHistoryAdapter.js";
7
- import { RuntimeAdapterProvider } from "../../adapters/RuntimeAdapterProvider.js";
8
- import { CloudFileAttachmentAdapter } from "../../adapters/index.js";
9
- const baseUrl = typeof process !== "undefined" &&
10
- process?.env?.["NEXT_PUBLIC_ASSISTANT_BASE_URL"];
11
- const autoCloud = baseUrl
12
- ? new AssistantCloud({ baseUrl, anonymous: true })
13
- : undefined;
14
- export const useCloudThreadListAdapter = (adapter) => {
15
- const adapterRef = useRef(adapter);
16
- useEffect(() => {
17
- adapterRef.current = adapter;
18
- }, [adapter]);
19
- const unstable_Provider = useCallback(function Provider({ children }) {
20
- const history = useAssistantCloudThreadHistoryAdapter({
21
- get current() {
22
- return adapterRef.current.cloud ?? autoCloud;
23
- },
24
- });
25
- const cloudInstance = adapterRef.current.cloud ?? autoCloud;
26
- const attachments = useMemo(() => new CloudFileAttachmentAdapter(cloudInstance), [cloudInstance]);
27
- const adapters = useMemo(() => ({
28
- history,
29
- attachments,
30
- }), [history, attachments]);
31
- return (_jsx(RuntimeAdapterProvider, { adapters: adapters, children: children }));
32
- }, []);
33
- const cloud = adapter.cloud ?? autoCloud;
34
- if (!cloud) {
35
- const ref = adapterRef;
36
- const inMemory = new InMemoryThreadListAdapter();
37
- inMemory.initialize = async (threadId) => {
38
- const result = await ref.current.create?.();
39
- return { remoteId: threadId, externalId: result?.externalId };
40
- };
41
- return inMemory;
42
- }
43
- return {
44
- list: async () => {
45
- const { threads } = await cloud.threads.list();
46
- return {
47
- threads: threads.map((t) => ({
48
- status: t.is_archived ? "archived" : "regular",
49
- remoteId: t.id,
50
- title: t.title,
51
- externalId: t.external_id ?? undefined,
52
- })),
53
- };
54
- },
55
- initialize: async () => {
56
- const createTask = adapter.create?.() ?? Promise.resolve();
57
- const t = await createTask;
58
- const external_id = t ? t.externalId : undefined;
59
- const { thread_id: remoteId } = await cloud.threads.create({
60
- last_message_at: new Date(),
61
- external_id,
62
- });
63
- return { externalId: external_id, remoteId: remoteId };
64
- },
65
- rename: async (threadId, newTitle) => {
66
- return cloud.threads.update(threadId, { title: newTitle });
67
- },
68
- archive: async (threadId) => {
69
- return cloud.threads.update(threadId, { is_archived: true });
70
- },
71
- unarchive: async (threadId) => {
72
- return cloud.threads.update(threadId, { is_archived: false });
73
- },
74
- delete: async (threadId) => {
75
- await adapter.delete?.(threadId);
76
- return cloud.threads.delete(threadId);
77
- },
78
- generateTitle: async (threadId, messages) => {
79
- // Filter messages to only include content types the title generator understands
80
- // (reasoning, source, etc. are not needed for title generation)
81
- // TODO serialize these to a more efficient format
82
- const filteredMessages = messages.map((msg) => ({
83
- ...msg,
84
- content: msg.content.filter((part) => part.type === "text" || part.type === "tool-call"),
85
- }));
86
- return cloud.runs.stream({
87
- thread_id: threadId,
88
- assistant_id: "system/thread_title",
89
- messages: filteredMessages,
90
- });
91
- },
92
- fetch: async (threadId) => {
93
- const thread = await cloud.threads.get(threadId);
94
- return {
95
- status: thread.is_archived ? "archived" : "regular",
96
- remoteId: thread.id,
97
- title: thread.title,
98
- externalId: thread.external_id ?? undefined,
99
- };
100
- },
101
- unstable_Provider,
102
- };
103
- };
2
+ export { useCloudThreadListAdapter } from "@assistant-ui/core/react";
104
3
  //# sourceMappingURL=cloud.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cloud.js","sourceRoot":"","sources":["../../../../../src/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAGL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,qCAAqC,EAAE,6DAA0D;AAC1G,OAAO,EAAE,sBAAsB,EAAE,iDAA8C;AAC/E,OAAO,EAAE,0BAA0B,EAAE,gCAAuB;AAa5D,MAAM,OAAO,GACX,OAAO,OAAO,KAAK,WAAW;IAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,gCAAgC,CAAC,CAAC;AACnD,MAAM,SAAS,GAAG,OAAO;IACvB,CAAC,CAAC,IAAI,cAAc,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAClD,CAAC,CAAC,SAAS,CAAC;AAEd,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,OAAsC,EACb,EAAE;IAC3B,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACnC,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;IAC/B,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,MAAM,iBAAiB,GAAG,WAAW,CACnC,SAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE;QAC5B,MAAM,OAAO,GAAG,qCAAqC,CAAC;YACpD,IAAI,OAAO;gBACT,OAAO,UAAU,CAAC,OAAO,CAAC,KAAK,IAAI,SAAU,CAAC;YAChD,CAAC;SACF,CAAC,CAAC;QACH,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,IAAI,SAAU,CAAC;QAC7D,MAA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-1,4 +1,2 @@
1
- import { type RemoteThreadListOptions } from "@assistant-ui/core/internal";
2
- import type { AssistantRuntime } from "@assistant-ui/core";
3
- export declare const useRemoteThreadListRuntime: (options: RemoteThreadListOptions) => AssistantRuntime;
1
+ export { useRemoteThreadListRuntime } from "@assistant-ui/core/react";
4
2
  //# sourceMappingURL=useRemoteThreadListRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRemoteThreadListRuntime.d.ts","sourceRoot":"","sources":["../../../../src/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAkC5B,eAAO,MAAM,0BAA0B,GACrC,SAAS,uBAAuB,KAC/B,gBAkCF,CAAC"}
1
+ {"version":3,"file":"useRemoteThreadListRuntime.d.ts","sourceRoot":"","sources":["../../../../src/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,48 +1,3 @@
1
1
  "use client";
2
- import { useState, useEffect, useMemo, useRef, useCallback } from "react";
3
- import { BaseAssistantRuntimeCore, AssistantRuntimeImpl, } from "@assistant-ui/core/internal";
4
- import { RemoteThreadListThreadListRuntimeCore } from "./RemoteThreadListThreadListRuntimeCore.js";
5
- import { useAui } from "@assistant-ui/store";
6
- class RemoteThreadListRuntimeCore extends BaseAssistantRuntimeCore {
7
- threads;
8
- constructor(options) {
9
- super();
10
- this.threads = new RemoteThreadListThreadListRuntimeCore(options, this._contextProvider);
11
- }
12
- get RenderComponent() {
13
- return this.threads.__internal_RenderComponent;
14
- }
15
- }
16
- const useRemoteThreadListRuntimeImpl = (options) => {
17
- const [runtime] = useState(() => new RemoteThreadListRuntimeCore(options));
18
- useEffect(() => {
19
- runtime.threads.__internal_setOptions(options);
20
- runtime.threads.__internal_load();
21
- }, [runtime, options]);
22
- return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);
23
- };
24
- export const useRemoteThreadListRuntime = (options) => {
25
- const runtimeHookRef = useRef(options.runtimeHook);
26
- runtimeHookRef.current = options.runtimeHook;
27
- const stableRuntimeHook = useCallback(() => {
28
- return runtimeHookRef.current();
29
- }, []);
30
- const stableOptions = useMemo(() => ({
31
- adapter: options.adapter,
32
- allowNesting: options.allowNesting,
33
- runtimeHook: stableRuntimeHook,
34
- }), [options.adapter, options.allowNesting, stableRuntimeHook]);
35
- const aui = useAui();
36
- const isNested = aui.threadListItem.source !== null;
37
- if (isNested) {
38
- if (!stableOptions.allowNesting) {
39
- throw new Error("useRemoteThreadListRuntime cannot be nested inside another RemoteThreadListRuntime. " +
40
- "Set allowNesting: true to allow nesting (the inner runtime will become a no-op).");
41
- }
42
- // If allowNesting is true and already inside a thread list context,
43
- // just call the runtimeHook directly (no-op behavior)
44
- return stableRuntimeHook();
45
- }
46
- return useRemoteThreadListRuntimeImpl(stableOptions);
47
- };
2
+ export { useRemoteThreadListRuntime } from "@assistant-ui/core/react";
48
3
  //# sourceMappingURL=useRemoteThreadListRuntime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRemoteThreadListRuntime.js","sourceRoot":"","sources":["../../../../src/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EACL,wBAAwB,EACxB,oBAAoB,GAErB,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAAE,qCAAqC,EAAE,mDAAgD;AAChG,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,MAAM,2BACJ,SAAQ,wBAAwB;IAGhB,O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OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAC3D,CAAC;IAEF,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,QAAQ,GAAG,GAAG,CAAC,cAAc,CAAC,MAAM,KAAK,IAAI,CAAC;IAEpD,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CACb,sFAAsF;gBACpF,kFAAkF,CACrF,CAAC;QACJ,CAAC;QAED,oEAAoE;QACpE,sDAAsD;QACtD,OAAO,iBAAiB,EAAE,CAAC;IAC7B,CAAC;IAED,OAAO,8BAA8B,CAAC,aAAa,CAAC,CAAC;AACvD,CAAC,CAAC"}
1
+ {"version":3,"file":"useRemoteThreadListRuntime.js","sourceRoot":"","sources":["../../../../src/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC"}
@@ -15,7 +15,7 @@ export const createActionButton = (displayName, useActionButton, forwardProps =
15
15
  }
16
16
  });
17
17
  const callback = useActionButton(forwardedProps) ?? undefined;
18
- return (_jsx(Primitive.button, { type: "button", ...primitiveProps, ref: forwardedRef, disabled: primitiveProps.disabled || !callback, onClick: composeEventHandlers(primitiveProps.onClick, callback) }));
18
+ return (_jsx(Primitive.button, { ...primitiveProps, type: "button", ref: forwardedRef, disabled: primitiveProps.disabled || !callback, onClick: composeEventHandlers(primitiveProps.onClick, callback) }));
19
19
  });
20
20
  ActionButton.displayName = displayName;
21
21
  return ActionButton;
@@ -1 +1 @@
1
- {"version":3,"file":"createActionButton.js","sourceRoot":"","sources":["../../src/utils/createActionButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,GAGX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B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E,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAa3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,WAAmB,EACnB,eAA6C,EAC7C,eAA8C,EAAE,EAChD,EAAE;IACF,MAAM,YAAY,GAAG,UAAU,CAG7B,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE;QACxB,MAAM,cAAc,GAAG,EAAY,CAAC;QACpC,MAAM,cAAc,GAAG,EAA0B,CAAC;QAEjD,MAAM,CAAC,IAAI,CAAC,KAAK,CAA+B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAChE,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAmB,CAAC,EAAE,CAAC;gBAC9C,cAAsB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,CAAC;iBAAM,CAAC;gBACL,cAAsB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,eAAe,CAAC,cAAwB,CAAC,IAAI,SAAS,CAAC;QACxE,OAAO,CACL,KAAC,SAAS,CAAC,MAAM,OACX,cAAc,EAClB,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,cAAc,CAAC,QAAQ,IAAI,CAAC,QAAQ,EAC9C,OAAO,EAAE,oBAAoB,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,GAC/D,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,WAAW,GAAG,WAAW,CAAC;IAEvC,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistant-ui/react",
3
- "version": "0.12.15",
3
+ "version": "0.12.16",
4
4
  "description": "TypeScript/React library for AI Chat",
5
5
  "keywords": [
6
6
  "radix-ui",
@@ -49,7 +49,7 @@
49
49
  ],
50
50
  "sideEffects": false,
51
51
  "dependencies": {
52
- "@assistant-ui/core": "^0.1.2",
52
+ "@assistant-ui/core": "^0.1.3",
53
53
  "@assistant-ui/store": "^0.2.2",
54
54
  "@assistant-ui/tap": "^0.5.2",
55
55
  "@radix-ui/primitive": "^1.1.3",
@@ -90,7 +90,7 @@
90
90
  "react": "^19.2.4",
91
91
  "react-dom": "^19.2.4",
92
92
  "vitest": "^4.0.18",
93
- "@assistant-ui/x-buildutils": "0.0.1"
93
+ "@assistant-ui/x-buildutils": "0.0.2"
94
94
  },
95
95
  "publishConfig": {
96
96
  "access": "public",
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import "@assistant-ui/core/react"; // store-augmentation side-effect (tools, dataRenderers scopes)
1
+ /// <reference types="@assistant-ui/core/react" />
2
2
 
3
3
  // Re-export from @assistant-ui/store
4
4
  export {
package/src/internal.ts CHANGED
@@ -26,6 +26,6 @@ export { splitLocalRuntimeOptions } from "./legacy-runtime/runtime-cores/local/L
26
26
  export {
27
27
  useToolInvocations,
28
28
  type ToolExecutionStatus,
29
- } from "./legacy-runtime/runtime-cores/assistant-transport/useToolInvocations";
29
+ } from "@assistant-ui/core/react";
30
30
 
31
31
  export * from "./utils/smooth";