@assistant-ui/react 0.14.9 → 0.14.11

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 (37) hide show
  1. package/dist/internal.d.ts +3 -4
  2. package/dist/internal.js +1 -3
  3. package/dist/internal.js.map +1 -1
  4. package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts +3 -2
  5. package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts.map +1 -1
  6. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
  7. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js +4 -10
  8. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
  9. package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.d.ts +1 -1
  10. package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.js.map +1 -1
  11. package/dist/mcp-apps/McpAppRenderer.js.map +1 -1
  12. package/dist/mcp-apps/app-frame.js.map +1 -1
  13. package/dist/primitives/assistantModal/AssistantModalRoot.js +5 -1
  14. package/dist/primitives/assistantModal/AssistantModalRoot.js.map +1 -1
  15. package/dist/utils/useToolArgsFieldStatus.d.ts +2 -2
  16. package/dist/utils/useToolArgsFieldStatus.d.ts.map +1 -1
  17. package/package.json +3 -3
  18. package/src/internal.ts +1 -4
  19. package/src/legacy-runtime/runtime/ThreadListRuntime.ts +1 -4
  20. package/src/legacy-runtime/runtime-cores/assistant-transport/types.ts +3 -1
  21. package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.ts +7 -15
  22. package/src/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.ts +1 -1
  23. package/src/mcp-apps/McpAppRenderer.tsx +1 -1
  24. package/src/mcp-apps/app-frame.tsx +2 -2
  25. package/src/primitives/assistantModal/AssistantModalRoot.tsx +1 -1
  26. package/src/primitives/composer/ComposerAttachmentDropzone.test.tsx +1 -1
  27. package/src/primitives/composer/ComposerInput.test.tsx +1 -1
  28. package/src/primitives/composer/trigger/TriggerPopoverRootContext.test.tsx +1 -1
  29. package/src/primitives/threadListItem/ThreadListItemTitle.test.tsx +1 -1
  30. package/src/tests/BaseComposerRuntimeCore.test.ts +2 -2
  31. package/src/tests/MessageParts.loading.test.tsx +1 -1
  32. package/src/tests/RemoteThreadListRuntime.adapterProvider.test.tsx +2 -4
  33. package/src/tests/auiV0Encode.test.ts +1 -1
  34. package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.d.ts +0 -2
  35. package/dist/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.js +0 -2
  36. package/src/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.test.ts +0 -892
  37. package/src/legacy-runtime/runtime-cores/assistant-transport/useToolInvocations.ts +0 -4
@@ -21,7 +21,6 @@ function useBridgeNotify<T>(
21
21
  lastSentRef: MutableRefObject<T | undefined>,
22
22
  notify: (bridge: McpAppBridge, v: T) => void,
23
23
  ) {
24
- // biome-ignore lint/correctness/useExhaustiveDependencies: refs and notify are stable; we re-run only when value changes.
25
24
  useEffect(() => {
26
25
  if (!bridgeRef.current) return;
27
26
  if (value === undefined) return;
@@ -32,6 +31,7 @@ function useBridgeNotify<T>(
32
31
  }
33
32
  notify(bridgeRef.current, value);
34
33
  lastSentRef.current = value;
34
+ // oxlint-disable-next-line tap-hooks/exhaustive-deps -- refs are stable; notify is assumed stable; re-run only when value changes
35
35
  }, [value]);
36
36
  }
37
37
 
@@ -131,7 +131,6 @@ export function McpAppFrame({
131
131
 
132
132
  const resourceUri = resource.uri;
133
133
 
134
- // biome-ignore lint/correctness/useExhaustiveDependencies: re-mounts only on resource URI; live values flow through liveRef
135
134
  useEffect(() => {
136
135
  const container = containerRef.current;
137
136
  if (!container) return;
@@ -255,6 +254,7 @@ export function McpAppFrame({
255
254
  pendingHostContextRef.current = undefined;
256
255
  setContentHeight(undefined);
257
256
  };
257
+ // oxlint-disable-next-line tap-hooks/exhaustive-deps -- re-mount only on resource URI change; live values flow through liveRef
258
258
  }, [resourceUri]);
259
259
 
260
260
  useBridgeNotify(
@@ -28,7 +28,7 @@ const useAssistantModalOpenState = ({
28
28
  return aui.on("thread.runStart", () => {
29
29
  setOpen(true);
30
30
  });
31
- }, [unstable_openOnRunStart, aui]);
31
+ }, [unstable_openOnRunStart, aui, setOpen]);
32
32
 
33
33
  return state;
34
34
  };
@@ -8,7 +8,7 @@ import { ComposerPrimitiveAttachmentDropzone } from "./ComposerAttachmentDropzon
8
8
 
9
9
  const addAttachment = vi.fn<(file: File) => Promise<void>>();
10
10
 
11
- globalThis.IS_REACT_ACT_ENVIRONMENT = true;
11
+ (globalThis as Record<string, unknown>).IS_REACT_ACT_ENVIRONMENT = true;
12
12
 
13
13
  vi.mock("@assistant-ui/store", async (importOriginal) => {
14
14
  const actual = await importOriginal<typeof import("@assistant-ui/store")>();
@@ -33,7 +33,7 @@ const plugin = {
33
33
 
34
34
  let pluginRegistry: { getPlugins: () => (typeof plugin)[] } | null = null;
35
35
 
36
- globalThis.IS_REACT_ACT_ENVIRONMENT = true;
36
+ (globalThis as Record<string, unknown>).IS_REACT_ACT_ENVIRONMENT = true;
37
37
 
38
38
  vi.mock("@assistant-ui/store", () => {
39
39
  const aui = {
@@ -11,7 +11,7 @@ import {
11
11
  useTriggerPopoverAriaPublish,
12
12
  } from "./TriggerPopoverRootContext";
13
13
 
14
- globalThis.IS_REACT_ACT_ENVIRONMENT = true;
14
+ (globalThis as Record<string, unknown>).IS_REACT_ACT_ENVIRONMENT = true;
15
15
 
16
16
  type PublishHandle = ReturnType<typeof useTriggerPopoverAriaPublish>;
17
17
 
@@ -5,7 +5,7 @@ import { ThreadListItemPrimitiveTitle } from "./ThreadListItemTitle";
5
5
 
6
6
  const mockUseAuiState = vi.fn();
7
7
  type UseAuiStateSelector = Parameters<
8
- typeof import("@assistant-ui/store")["useAuiState"]
8
+ (typeof import("@assistant-ui/store"))["useAuiState"]
9
9
  >[0];
10
10
 
11
11
  vi.mock("@assistant-ui/store", async (importOriginal) => {
@@ -1,10 +1,10 @@
1
1
  import { describe, it, expect, vi, beforeEach } from "vitest";
2
2
  import { BaseComposerRuntimeCore } from "../legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore";
3
- import type { AttachmentAdapter } from "../legacy-runtime/runtime-cores/adapters/attachment";
4
- import type { DictationAdapter } from "../legacy-runtime/runtime-cores/adapters/speech/SpeechAdapterTypes";
5
3
  import type {
6
4
  AppendMessage,
5
+ AttachmentAdapter,
7
6
  CreateAttachment,
7
+ DictationAdapter,
8
8
  PendingAttachment,
9
9
  SendOptions,
10
10
  } from "@assistant-ui/core";
@@ -71,7 +71,7 @@ const RuntimeProvider: FC<
71
71
 
72
72
  const renderThread = (MessageComponent: FC, messages?: ThreadMessageLike[]) => {
73
73
  render(
74
- <RuntimeProvider messages={messages}>
74
+ <RuntimeProvider messages={messages!}>
75
75
  <ThreadPrimitive.Messages components={{ Message: MessageComponent }} />
76
76
  </RuntimeProvider>,
77
77
  );
@@ -7,15 +7,13 @@ import {
7
7
  RuntimeAdapterProvider,
8
8
  useRemoteThreadListRuntime,
9
9
  useRuntimeAdapters,
10
+ type RuntimeAdapters as RuntimeAdaptersShape,
10
11
  } from "@assistant-ui/core/react";
11
12
  import { makeAdapter } from "./remote-thread-list-test-helpers";
12
13
  import { useLocalRuntime } from "../legacy-runtime/runtime-cores/local/useLocalRuntime";
13
14
  import { AssistantRuntimeProvider } from "../context";
14
15
  import type { ChatModelAdapter, RemoteThreadListAdapter } from "../index";
15
- import type {
16
- RuntimeAdapters as RuntimeAdaptersShape,
17
- ThreadHistoryAdapter,
18
- } from "@assistant-ui/core";
16
+ import type { ThreadHistoryAdapter } from "@assistant-ui/core";
19
17
 
20
18
  type CapturedAdapters = RuntimeAdaptersShape | null;
21
19
 
@@ -9,7 +9,7 @@ describe("auiV0Encode", () => {
9
9
  role: "assistant",
10
10
  status: { type: "complete", reason: "stop" },
11
11
  metadata: {
12
- unstable_state: undefined,
12
+ unstable_state: null,
13
13
  unstable_annotations: [],
14
14
  unstable_data: [],
15
15
  steps: [],
@@ -1,2 +0,0 @@
1
- import { ToolExecutionStatus, useToolInvocations } from "@assistant-ui/core/react";
2
- export { type ToolExecutionStatus, useToolInvocations };
@@ -1,2 +0,0 @@
1
- import { useToolInvocations } from "@assistant-ui/core/react";
2
- export { useToolInvocations };