@assistant-ui/react 0.7.11 → 0.7.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. package/dist/primitive-hooks/thread/useThreadViewportAutoScroll.d.ts +1 -1
  2. package/dist/primitive-hooks/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
  3. package/dist/primitive-hooks/thread/useThreadViewportAutoScroll.js.map +1 -1
  4. package/dist/primitive-hooks/thread/useThreadViewportAutoScroll.mjs.map +1 -1
  5. package/dist/primitives/actionBar/ActionBarCopy.d.ts +1 -3
  6. package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
  7. package/dist/primitives/actionBar/ActionBarEdit.d.ts +1 -3
  8. package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
  9. package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts +1 -3
  10. package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts.map +1 -1
  11. package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts +1 -3
  12. package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts.map +1 -1
  13. package/dist/primitives/actionBar/ActionBarReload.d.ts +1 -3
  14. package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
  15. package/dist/primitives/actionBar/ActionBarRoot.d.ts +1 -3
  16. package/dist/primitives/actionBar/ActionBarRoot.d.ts.map +1 -1
  17. package/dist/primitives/actionBar/ActionBarSpeak.d.ts +1 -3
  18. package/dist/primitives/actionBar/ActionBarSpeak.d.ts.map +1 -1
  19. package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts +1 -3
  20. package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts.map +1 -1
  21. package/dist/primitives/assistantModal/scope.d.ts +2 -6
  22. package/dist/primitives/assistantModal/scope.d.ts.map +1 -1
  23. package/dist/primitives/attachment/AttachmentRemove.d.ts +1 -3
  24. package/dist/primitives/attachment/AttachmentRemove.d.ts.map +1 -1
  25. package/dist/primitives/attachment/AttachmentRoot.d.ts +1 -3
  26. package/dist/primitives/attachment/AttachmentRoot.d.ts.map +1 -1
  27. package/dist/primitives/attachment/AttachmentThumb.d.ts +1 -3
  28. package/dist/primitives/attachment/AttachmentThumb.d.ts.map +1 -1
  29. package/dist/primitives/branchPicker/BranchPickerNext.d.ts +1 -3
  30. package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
  31. package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts +1 -3
  32. package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
  33. package/dist/primitives/branchPicker/BranchPickerRoot.d.ts +1 -3
  34. package/dist/primitives/branchPicker/BranchPickerRoot.d.ts.map +1 -1
  35. package/dist/primitives/composer/ComposerAddAttachment.d.ts +1 -3
  36. package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
  37. package/dist/primitives/composer/ComposerCancel.d.ts +1 -3
  38. package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
  39. package/dist/primitives/composer/ComposerInput.js +2 -2
  40. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  41. package/dist/primitives/composer/ComposerInput.mjs +2 -2
  42. package/dist/primitives/composer/ComposerInput.mjs.map +1 -1
  43. package/dist/primitives/composer/ComposerRoot.d.ts +1 -3
  44. package/dist/primitives/composer/ComposerRoot.d.ts.map +1 -1
  45. package/dist/primitives/composer/ComposerSend.d.ts +1 -3
  46. package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
  47. package/dist/primitives/contentPart/ContentPartImage.d.ts +1 -3
  48. package/dist/primitives/contentPart/ContentPartImage.d.ts.map +1 -1
  49. package/dist/primitives/contentPart/ContentPartText.d.ts +1 -3
  50. package/dist/primitives/contentPart/ContentPartText.d.ts.map +1 -1
  51. package/dist/primitives/message/MessageRoot.d.ts +1 -3
  52. package/dist/primitives/message/MessageRoot.d.ts.map +1 -1
  53. package/dist/primitives/thread/ThreadRoot.d.ts +1 -3
  54. package/dist/primitives/thread/ThreadRoot.d.ts.map +1 -1
  55. package/dist/primitives/thread/ThreadScrollToBottom.d.ts +1 -3
  56. package/dist/primitives/thread/ThreadScrollToBottom.d.ts.map +1 -1
  57. package/dist/primitives/thread/ThreadSuggestion.d.ts +1 -3
  58. package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
  59. package/dist/primitives/thread/ThreadViewport.d.ts +1 -3
  60. package/dist/primitives/thread/ThreadViewport.d.ts.map +1 -1
  61. package/dist/primitives/threadList/ThreadListNew.d.ts +1 -3
  62. package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -1
  63. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts +1 -3
  64. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -1
  65. package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts +1 -3
  66. package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts.map +1 -1
  67. package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts +1 -3
  68. package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts.map +1 -1
  69. package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +1 -3
  70. package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -1
  71. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts +1 -3
  72. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts.map +1 -1
  73. package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts +2 -0
  74. package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts.map +1 -1
  75. package/dist/runtimes/core/BaseThreadRuntimeCore.js +8 -0
  76. package/dist/runtimes/core/BaseThreadRuntimeCore.js.map +1 -1
  77. package/dist/runtimes/core/BaseThreadRuntimeCore.mjs +8 -0
  78. package/dist/runtimes/core/BaseThreadRuntimeCore.mjs.map +1 -1
  79. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -1
  80. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.js +3 -1
  81. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.js.map +1 -1
  82. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.mjs +3 -1
  83. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.mjs.map +1 -1
  84. package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts +0 -2
  85. package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts.map +1 -1
  86. package/dist/runtimes/local/LocalThreadRuntimeCore.js +2 -9
  87. package/dist/runtimes/local/LocalThreadRuntimeCore.js.map +1 -1
  88. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs +2 -9
  89. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs.map +1 -1
  90. package/dist/styles/index.css.map +1 -1
  91. package/dist/ui/assistant-action-bar.d.ts +1 -3
  92. package/dist/ui/assistant-action-bar.d.ts.map +1 -1
  93. package/dist/ui/assistant-message.d.ts +1 -3
  94. package/dist/ui/assistant-message.d.ts.map +1 -1
  95. package/dist/ui/attachment-ui.d.ts +1 -3
  96. package/dist/ui/attachment-ui.d.ts.map +1 -1
  97. package/dist/ui/base/button.d.ts +1 -3
  98. package/dist/ui/base/button.d.ts.map +1 -1
  99. package/dist/ui/base/tooltip-icon-button.d.ts +1 -3
  100. package/dist/ui/base/tooltip-icon-button.d.ts.map +1 -1
  101. package/dist/ui/branch-picker.d.ts +1 -3
  102. package/dist/ui/branch-picker.d.ts.map +1 -1
  103. package/dist/ui/composer.d.ts +1 -3
  104. package/dist/ui/composer.d.ts.map +1 -1
  105. package/dist/ui/edit-composer.d.ts +1 -3
  106. package/dist/ui/edit-composer.d.ts.map +1 -1
  107. package/dist/ui/thread-list-item.d.ts +1 -3
  108. package/dist/ui/thread-list-item.d.ts.map +1 -1
  109. package/dist/ui/thread-list.d.ts +1 -3
  110. package/dist/ui/thread-list.d.ts.map +1 -1
  111. package/dist/ui/thread.d.ts +2 -6
  112. package/dist/ui/thread.d.ts.map +1 -1
  113. package/dist/ui/user-action-bar.d.ts +1 -3
  114. package/dist/ui/user-action-bar.d.ts.map +1 -1
  115. package/dist/ui/user-message.d.ts +1 -3
  116. package/dist/ui/user-message.d.ts.map +1 -1
  117. package/dist/utils/createActionButton.d.ts +1 -3
  118. package/dist/utils/createActionButton.d.ts.map +1 -1
  119. package/dist/utils/hooks/useManagedRef.js +1 -1
  120. package/dist/utils/hooks/useManagedRef.js.map +1 -1
  121. package/dist/utils/hooks/useManagedRef.mjs +1 -1
  122. package/dist/utils/hooks/useManagedRef.mjs.map +1 -1
  123. package/package.json +21 -21
  124. package/src/primitive-hooks/thread/useThreadViewportAutoScroll.tsx +1 -1
  125. package/src/primitives/composer/ComposerInput.tsx +2 -2
  126. package/src/runtimes/core/BaseThreadRuntimeCore.tsx +10 -0
  127. package/src/runtimes/external-store/ExternalStoreThreadRuntimeCore.tsx +4 -1
  128. package/src/runtimes/local/LocalThreadRuntimeCore.tsx +2 -11
  129. package/src/utils/hooks/useManagedRef.ts +1 -1
  130. package/edge/package-lock.json +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/ui/composer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAKtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAmB,MAAM,eAAe,CAAC;AAUnE,QAAA,MAAM,QAAQ,EAAE,EAUf,CAAC;AAyKF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;CAQZ,CAAC;wBAEiD,OAAO,QAAQ,GAChE,OAAO,OAAO;AADhB,wBACiB"}
1
+ {"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/ui/composer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAKtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAmB,MAAM,eAAe,CAAC;AAUnE,QAAA,MAAM,QAAQ,EAAE,EAUf,CAAC;AAyKF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;CAQZ,CAAC;wBAEiD,OAAO,QAAQ,GAChE,OAAO,OAAO;AADhB,wBACiB"}
@@ -2,9 +2,7 @@ import { type FC } from "react";
2
2
  import { ButtonProps } from "./base/button";
3
3
  declare const EditComposer: FC;
4
4
  declare const exports: {
5
- Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & {
6
- ref?: ((instance: HTMLFormElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLFormElement> | null | undefined;
7
- } & {
5
+ Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<import("react").ClassAttributes<HTMLFormElement> & import("react").FormHTMLAttributes<HTMLFormElement> & {
8
6
  asChild?: boolean;
9
7
  }, "ref"> & import("react").RefAttributes<HTMLFormElement>, "ref">> & import("react").RefAttributes<HTMLFormElement>>;
10
8
  Input: import("react").ForwardRefExoticComponent<Partial<Omit<import("react-textarea-autosize").TextareaAutosizeProps & {
@@ -1 +1 @@
1
- {"version":3,"file":"edit-composer.d.ts","sourceRoot":"","sources":["../../src/ui/edit-composer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAKpD,QAAA,MAAM,YAAY,EAAE,EAWnB,CAAC;AAoEF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;CAMZ,CAAC;wBAEqD,OAAO,YAAY,GACxE,OAAO,OAAO;AADhB,wBACiB"}
1
+ {"version":3,"file":"edit-composer.d.ts","sourceRoot":"","sources":["../../src/ui/edit-composer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAKpD,QAAA,MAAM,YAAY,EAAE,EAWnB,CAAC;AAoEF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;CAMZ,CAAC;wBAEqD,OAAO,YAAY,GACxE,OAAO,OAAO;AADhB,wBACiB"}
@@ -2,9 +2,7 @@ import { type FC } from "react";
2
2
  import { TooltipIconButton } from "./base/tooltip-icon-button";
3
3
  declare const ThreadListItem: FC;
4
4
  declare const exports: {
5
- Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
- ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
- } & {
5
+ Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
8
6
  asChild?: boolean;
9
7
  }, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
10
8
  Title: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"thread-list-item.d.ts","sourceRoot":"","sources":["../../src/ui/thread-list-item.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAItE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAK/D,QAAA,MAAM,cAAc,EAAE,EASrB,CAAC;AA+DF,QAAA,MAAM,OAAO;;;;;;;;CAIZ,CAAC;wBAEuD,OAAO,cAAc,GAC5E,OAAO,OAAO;AADhB,wBACiB"}
1
+ {"version":3,"file":"thread-list-item.d.ts","sourceRoot":"","sources":["../../src/ui/thread-list-item.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAItE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAK/D,QAAA,MAAM,cAAc,EAAE,EASrB,CAAC;AA+DF,QAAA,MAAM,OAAO;;;;;;CAIZ,CAAC;wBAEuD,OAAO,cAAc,GAC5E,OAAO,OAAO;AADhB,wBACiB"}
@@ -12,9 +12,7 @@ declare namespace ThreadListItems {
12
12
  declare const ThreadListItems: FC<ThreadListItems.Props>;
13
13
  declare const exports: {
14
14
  Root: import("react").ForwardRefExoticComponent<Partial<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
15
- New: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
16
- ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
17
- } & {
15
+ New: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
18
16
  asChild?: boolean;
19
17
  }, "ref"> & import("class-variance-authority").VariantProps<(props?: ({
20
18
  variant?: "default" | "outline" | "ghost" | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"thread-list.d.ts","sourceRoot":"","sources":["../../src/ui/thread-list.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAKpD,QAAA,MAAM,UAAU,EAAE,EAOjB,CAAC;AA8BF,kBAAU,eAAe,CAAC;IACxB,KAAY,KAAK,GAAG;QAClB;;WAEG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;KACrE,CAAC;CACH;AAED,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAS9C,CAAC;AAIF,QAAA,MAAM,OAAO;;;;;;;;;;;CAIZ,CAAC;wBAEmD,OAAO,UAAU,GACpE,OAAO,OAAO;AADhB,wBACiB"}
1
+ {"version":3,"file":"thread-list.d.ts","sourceRoot":"","sources":["../../src/ui/thread-list.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAKpD,QAAA,MAAM,UAAU,EAAE,EAOjB,CAAC;AA8BF,kBAAU,eAAe,CAAC;IACxB,KAAY,KAAK,GAAG;QAClB;;WAEG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;KACrE,CAAC;CACH;AAED,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAS9C,CAAC;AAIF,QAAA,MAAM,OAAO;;;;;;;;;CAIZ,CAAC;wBAEmD,OAAO,UAAU,GACpE,OAAO,OAAO;AADhB,wBACiB"}
@@ -4,18 +4,14 @@ import { ThreadConfig } from "./thread-config";
4
4
  import { ThreadPrimitive } from "../primitives";
5
5
  declare const Thread: FC<ThreadConfig>;
6
6
  declare const exports: {
7
- Root: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
- ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
9
- } & {
7
+ Root: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
10
8
  asChild?: boolean;
11
9
  }, "ref"> & {
12
10
  config?: ThreadConfig | undefined;
13
11
  } & {
14
12
  children?: import("react").ReactNode | undefined;
15
13
  } & import("react").RefAttributes<HTMLDivElement>>;
16
- Viewport: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
17
- ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
18
- } & {
14
+ Viewport: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
19
15
  asChild?: boolean;
20
16
  }, "ref"> & import("../primitive-hooks/thread/useThreadViewportAutoScroll").UseThreadViewportAutoScrollProps & import("react").RefAttributes<HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
21
17
  Messages: FC<{
@@ -1 +1 @@
1
- {"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../src/ui/thread.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAM5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D,OAAO,EACL,YAAY,EAIb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,YAAY,CAqB5B,CAAC;AAiHF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;+BA7EY,OAAO;qBACjB,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;;;;;CAmFnE,CAAC;wBAE+C,OAAO,MAAM,GAAG,OAAO,OAAO;AAA/E,wBAAgF"}
1
+ {"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../src/ui/thread.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAM5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D,OAAO,EACL,YAAY,EAIb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,YAAY,CAqB5B,CAAC;AAiHF,QAAA,MAAM,OAAO;;;;;;;;;;;;+BA7EY,OAAO;qBACjB,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;;;;;CAmFnE,CAAC;wBAE+C,OAAO,MAAM,GAAG,OAAO,OAAO;AAA/E,wBAAgF"}
@@ -2,9 +2,7 @@ import { type FC } from "react";
2
2
  import { TooltipIconButton } from "./base/tooltip-icon-button";
3
3
  declare const UserActionBar: FC;
4
4
  declare const exports: {
5
- Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
- ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
- } & {
5
+ Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
8
6
  asChild?: boolean;
9
7
  }, "ref"> & import("../primitives/actionBar/useActionBarFloatStatus").UseActionBarFloatStatusProps & import("react").RefAttributes<HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
10
8
  Edit: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"user-action-bar.d.ts","sourceRoot":"","sources":["../../src/ui/user-action-bar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAY/D,QAAA,MAAM,aAAa,EAAE,EAQpB,CAAC;AAkCF,QAAA,MAAM,OAAO;;;;;;;CAGZ,CAAC;wBAEsD,OAAO,aAAa,GAC1E,OAAO,OAAO;AADhB,wBACiB"}
1
+ {"version":3,"file":"user-action-bar.d.ts","sourceRoot":"","sources":["../../src/ui/user-action-bar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAY/D,QAAA,MAAM,aAAa,EAAE,EAQpB,CAAC;AAkCF,QAAA,MAAM,OAAO;;;;;CAGZ,CAAC;wBAEsD,OAAO,aAAa,GAC1E,OAAO,OAAO;AADhB,wBACiB"}
@@ -2,9 +2,7 @@ import { type FC } from "react";
2
2
  import { MessagePrimitive } from "../primitives";
3
3
  declare const UserMessage: FC;
4
4
  declare const exports: {
5
- Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
- ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
- } & {
5
+ Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
8
6
  asChild?: boolean;
9
7
  }, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
10
8
  Content: import("react").ForwardRefExoticComponent<MessagePrimitive.Content.Props & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"user-message.d.ts","sourceRoot":"","sources":["../../src/ui/user-message.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAMtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGjD,QAAA,MAAM,WAAW,EAAE,EAYlB,CAAC;AA+DF,QAAA,MAAM,OAAO;;;;;;;;CAIZ,CAAC;wBAEoD,OAAO,WAAW,GACtE,OAAO,OAAO;AADhB,wBACiB"}
1
+ {"version":3,"file":"user-message.d.ts","sourceRoot":"","sources":["../../src/ui/user-message.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAMtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGjD,QAAA,MAAM,WAAW,EAAE,EAYlB,CAAC;AA+DF,QAAA,MAAM,OAAO;;;;;;CAIZ,CAAC;wBAEoD,OAAO,WAAW,GACtE,OAAO,OAAO;AADhB,wBACiB"}
@@ -4,9 +4,7 @@ type ActionButtonCallback<TProps> = (props: TProps) => null | (() => void);
4
4
  type PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;
5
5
  export type ActionButtonProps<THook> = PrimitiveButtonProps & (THook extends (props: infer TProps) => unknown ? TProps : never);
6
6
  export type ActionButtonElement = ElementRef<typeof Primitive.button>;
7
- export declare const createActionButton: <TProps>(displayName: string, useActionButton: ActionButtonCallback<TProps>, forwardProps?: (keyof NonNullable<TProps>)[]) => import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
8
- ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
9
- } & {
7
+ export declare const createActionButton: <TProps>(displayName: string, useActionButton: ActionButtonCallback<TProps>, forwardProps?: (keyof NonNullable<TProps>)[]) => import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
10
8
  asChild?: boolean;
11
9
  }, "ref"> & TProps> & import("react").RefAttributes<HTMLButtonElement>>;
12
10
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"createActionButton.d.ts","sourceRoot":"","sources":["../../src/utils/createActionButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAc,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,KAAK,oBAAoB,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAE3E,KAAK,oBAAoB,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAE9E,MAAM,MAAM,iBAAiB,CAAC,KAAK,IAAI,oBAAoB,GACzD,CAAC,KAAK,SAAS,CAAC,KAAK,EAAE,MAAM,MAAM,KAAK,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAEtE,eAAO,MAAM,kBAAkB,GAAI,MAAM,eAC1B,MAAM,mBACF,oBAAoB,CAAC,MAAM,CAAC,iBAC/B,CAAC,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE;;;;uEAkC5C,CAAC"}
1
+ {"version":3,"file":"createActionButton.d.ts","sourceRoot":"","sources":["../../src/utils/createActionButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAc,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,KAAK,oBAAoB,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAE3E,KAAK,oBAAoB,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAE9E,MAAM,MAAM,iBAAiB,CAAC,KAAK,IAAI,oBAAoB,GACzD,CAAC,KAAK,SAAS,CAAC,KAAK,EAAE,MAAM,MAAM,KAAK,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAEtE,eAAO,MAAM,kBAAkB,GAAI,MAAM,eAC1B,MAAM,mBACF,oBAAoB,CAAC,MAAM,CAAC,iBAC/B,CAAC,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE;;uEAkC5C,CAAC"}
@@ -25,7 +25,7 @@ __export(useManagedRef_exports, {
25
25
  module.exports = __toCommonJS(useManagedRef_exports);
26
26
  var import_react = require("react");
27
27
  var useManagedRef = (callback) => {
28
- const cleanupRef = (0, import_react.useRef)();
28
+ const cleanupRef = (0, import_react.useRef)(void 0);
29
29
  const ref = (0, import_react.useCallback)(
30
30
  (el) => {
31
31
  if (cleanupRef.current) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/hooks/useManagedRef.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\n\nexport const useManagedRef = <TNode>(\n callback: (node: TNode) => (() => void) | void,\n) => {\n const cleanupRef = useRef<(() => void) | void>();\n\n const ref = useCallback(\n (el: TNode | null) => {\n // Call the previous cleanup function\n if (cleanupRef.current) {\n cleanupRef.current();\n }\n\n // Call the new callback and store its cleanup function\n if (el) {\n cleanupRef.current = callback(el);\n }\n },\n [callback],\n );\n\n return ref;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAoC;AAE7B,IAAM,gBAAgB,CAC3B,aACG;AACH,QAAM,iBAAa,qBAA4B;AAE/C,QAAM,UAAM;AAAA,IACV,CAAC,OAAqB;AAEpB,UAAI,WAAW,SAAS;AACtB,mBAAW,QAAQ;AAAA,MACrB;AAGA,UAAI,IAAI;AACN,mBAAW,UAAU,SAAS,EAAE;AAAA,MAClC;AAAA,IACF;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/hooks/useManagedRef.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\n\nexport const useManagedRef = <TNode>(\n callback: (node: TNode) => (() => void) | void,\n) => {\n const cleanupRef = useRef<(() => void) | void>(undefined);\n\n const ref = useCallback(\n (el: TNode | null) => {\n // Call the previous cleanup function\n if (cleanupRef.current) {\n cleanupRef.current();\n }\n\n // Call the new callback and store its cleanup function\n if (el) {\n cleanupRef.current = callback(el);\n }\n },\n [callback],\n );\n\n return ref;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAoC;AAE7B,IAAM,gBAAgB,CAC3B,aACG;AACH,QAAM,iBAAa,qBAA4B,MAAS;AAExD,QAAM,UAAM;AAAA,IACV,CAAC,OAAqB;AAEpB,UAAI,WAAW,SAAS;AACtB,mBAAW,QAAQ;AAAA,MACrB;AAGA,UAAI,IAAI;AACN,mBAAW,UAAU,SAAS,EAAE;AAAA,MAClC;AAAA,IACF;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAO;AACT;","names":[]}
@@ -1,7 +1,7 @@
1
1
  // src/utils/hooks/useManagedRef.ts
2
2
  import { useCallback, useRef } from "react";
3
3
  var useManagedRef = (callback) => {
4
- const cleanupRef = useRef();
4
+ const cleanupRef = useRef(void 0);
5
5
  const ref = useCallback(
6
6
  (el) => {
7
7
  if (cleanupRef.current) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/hooks/useManagedRef.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\n\nexport const useManagedRef = <TNode>(\n callback: (node: TNode) => (() => void) | void,\n) => {\n const cleanupRef = useRef<(() => void) | void>();\n\n const ref = useCallback(\n (el: TNode | null) => {\n // Call the previous cleanup function\n if (cleanupRef.current) {\n cleanupRef.current();\n }\n\n // Call the new callback and store its cleanup function\n if (el) {\n cleanupRef.current = callback(el);\n }\n },\n [callback],\n );\n\n return ref;\n};\n"],"mappings":";AAAA,SAAS,aAAa,cAAc;AAE7B,IAAM,gBAAgB,CAC3B,aACG;AACH,QAAM,aAAa,OAA4B;AAE/C,QAAM,MAAM;AAAA,IACV,CAAC,OAAqB;AAEpB,UAAI,WAAW,SAAS;AACtB,mBAAW,QAAQ;AAAA,MACrB;AAGA,UAAI,IAAI;AACN,mBAAW,UAAU,SAAS,EAAE;AAAA,MAClC;AAAA,IACF;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/hooks/useManagedRef.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\n\nexport const useManagedRef = <TNode>(\n callback: (node: TNode) => (() => void) | void,\n) => {\n const cleanupRef = useRef<(() => void) | void>(undefined);\n\n const ref = useCallback(\n (el: TNode | null) => {\n // Call the previous cleanup function\n if (cleanupRef.current) {\n cleanupRef.current();\n }\n\n // Call the new callback and store its cleanup function\n if (el) {\n cleanupRef.current = callback(el);\n }\n },\n [callback],\n );\n\n return ref;\n};\n"],"mappings":";AAAA,SAAS,aAAa,cAAc;AAE7B,IAAM,gBAAgB,CAC3B,aACG;AACH,QAAM,aAAa,OAA4B,MAAS;AAExD,QAAM,MAAM;AAAA,IACV,CAAC,OAAqB;AAEpB,UAAI,WAAW,SAAS;AACtB,mBAAW,QAAQ;AAAA,MACrB;AAGA,UAAI,IAAI;AACN,mBAAW,UAAU,SAAS,EAAE;AAAA,MAClC;AAAA,IACF;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "conversational-ui",
30
30
  "conversational-ai"
31
31
  ],
32
- "version": "0.7.11",
32
+ "version": "0.7.12",
33
33
  "license": "MIT",
34
34
  "exports": {
35
35
  ".": {
@@ -65,28 +65,28 @@
65
65
  ],
66
66
  "sideEffects": false,
67
67
  "dependencies": {
68
- "@ai-sdk/provider": "^1.0.1",
69
- "@radix-ui/primitive": "^1.1.0",
70
- "@radix-ui/react-avatar": "^1.1.1",
71
- "@radix-ui/react-compose-refs": "^1.1.0",
68
+ "@ai-sdk/provider": "^1.0.2",
69
+ "@radix-ui/primitive": "^1.1.1",
70
+ "@radix-ui/react-avatar": "^1.1.2",
71
+ "@radix-ui/react-compose-refs": "^1.1.1",
72
72
  "@radix-ui/react-context": "^1.1.1",
73
- "@radix-ui/react-dialog": "^1.1.2",
74
- "@radix-ui/react-popover": "^1.1.2",
75
- "@radix-ui/react-primitive": "^2.0.0",
76
- "@radix-ui/react-slot": "^1.1.0",
77
- "@radix-ui/react-tooltip": "^1.1.4",
73
+ "@radix-ui/react-dialog": "^1.1.3",
74
+ "@radix-ui/react-popover": "^1.1.3",
75
+ "@radix-ui/react-primitive": "^2.0.1",
76
+ "@radix-ui/react-slot": "^1.1.1",
77
+ "@radix-ui/react-tooltip": "^1.1.5",
78
78
  "@radix-ui/react-use-callback-ref": "^1.1.0",
79
79
  "@radix-ui/react-use-escape-keydown": "^1.1.0",
80
- "class-variance-authority": "^0.7.0",
80
+ "class-variance-authority": "^0.7.1",
81
81
  "classnames": "^2.5.1",
82
82
  "json-schema": "^0.4.0",
83
- "lucide-react": "^0.460.0",
84
- "nanoid": "^5.0.8",
85
- "react-textarea-autosize": "^8.5.5",
83
+ "lucide-react": "^0.468.0",
84
+ "nanoid": "^5.0.9",
85
+ "react-textarea-autosize": "^8.5.6",
86
86
  "secure-json-parse": "^3.0.1",
87
- "zod": "^3.23.8",
88
- "zod-to-json-schema": "^3.23.5",
89
- "zustand": "^5.0.1"
87
+ "zod": "^3.24.1",
88
+ "zod-to-json-schema": "^3.24.1",
89
+ "zustand": "^5.0.2"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@types/react": "*",
@@ -108,15 +108,15 @@
108
108
  },
109
109
  "devDependencies": {
110
110
  "@types/json-schema": "^7.0.15",
111
- "@types/node": "^22.9.3",
111
+ "@types/node": "^22.10.2",
112
112
  "autoprefixer": "^10.4.20",
113
- "esbuild-plugin-file-path-extensions": "^2.1.3",
113
+ "esbuild-plugin-file-path-extensions": "^2.1.4",
114
114
  "eslint": "^9",
115
- "eslint-config-next": "15.0.3",
115
+ "eslint-config-next": "15.1.0",
116
116
  "postcss": "^8.4.49",
117
117
  "postcss-js": "^4.0.1",
118
118
  "postcss-nested": "^7.0.2",
119
- "tailwindcss": "^3.4.15",
119
+ "tailwindcss": "^3.4.16",
120
120
  "tailwindcss-animate": "^1.0.7",
121
121
  "tsup": "8.3.5",
122
122
  "tsx": "^4.19.2",
@@ -18,7 +18,7 @@ export type UseThreadViewportAutoScrollProps = {
18
18
  export const useThreadViewportAutoScroll = <TElement extends HTMLElement>({
19
19
  autoScroll = true,
20
20
  unstable_scrollToBottomOnRunStart = true,
21
- }: UseThreadViewportAutoScrollProps) => {
21
+ }: UseThreadViewportAutoScrollProps): React.RefCallback<TElement> => {
22
22
  const divRef = useRef<TElement>(null);
23
23
 
24
24
  const threadViewportStore = useThreadViewportStore();
@@ -102,8 +102,8 @@ export const ComposerPrimitiveInput = forwardRef<
102
102
 
103
103
  textarea.focus({ preventScroll: true });
104
104
  textarea.setSelectionRange(
105
- textareaRef.current.value.length,
106
- textareaRef.current.value.length,
105
+ textarea.value.length,
106
+ textarea.value.length,
107
107
  );
108
108
  }, [autoFocusEnabled]);
109
109
 
@@ -32,6 +32,7 @@ type BaseThreadAdapters = {
32
32
 
33
33
  export abstract class BaseThreadRuntimeCore implements ThreadRuntimeCore {
34
34
  private _subscriptions = new Set<() => void>();
35
+ private _isInitialized = false;
35
36
 
36
37
  protected readonly repository = new MessageRepository();
37
38
  public abstract get adapters(): BaseThreadAdapters | undefined;
@@ -161,11 +162,20 @@ export abstract class BaseThreadRuntimeCore implements ThreadRuntimeCore {
161
162
  this._notifySubscribers();
162
163
  }
163
164
 
165
+ protected ensureInitialized() {
166
+ if (!this._isInitialized) {
167
+ this._isInitialized = true;
168
+ this._notifyEventSubscribers("initialize");
169
+ }
170
+ }
171
+
164
172
  public export() {
165
173
  return this.repository.export();
166
174
  }
167
175
 
168
176
  public import(data: ExportedMessageRepository) {
177
+ this.ensureInitialized();
178
+
169
179
  this.repository.import(data);
170
180
  this._notifySubscribers();
171
181
  }
@@ -133,8 +133,9 @@ export class ExternalStoreThreadRuntimeCore
133
133
  )
134
134
  return cache;
135
135
 
136
+ const messageLike = store.convertMessage(m, idx);
136
137
  const newMessage = fromThreadMessageLike(
137
- store.convertMessage(m, idx),
138
+ messageLike,
138
139
  idx.toString(),
139
140
  autoStatus,
140
141
  );
@@ -142,6 +143,8 @@ export class ExternalStoreThreadRuntimeCore
142
143
  return newMessage;
143
144
  });
144
145
 
146
+ if (messages.length > 0) this.ensureInitialized();
147
+
145
148
  for (let i = 0; i < messages.length; i++) {
146
149
  const message = messages[i]!;
147
150
  const parent = messages[i - 1];
@@ -19,8 +19,6 @@ export class LocalThreadRuntimeCore
19
19
  extends BaseThreadRuntimeCore
20
20
  implements ThreadRuntimeCore
21
21
  {
22
- private _isInitialized = false;
23
-
24
22
  public readonly capabilities = {
25
23
  switchToBranch: true,
26
24
  edit: true,
@@ -83,15 +81,8 @@ export class LocalThreadRuntimeCore
83
81
  if (hasUpdates) this._notifySubscribers();
84
82
  }
85
83
 
86
- private _ensureInitialized() {
87
- if (!this._isInitialized) {
88
- this._isInitialized = true;
89
- this._notifyEventSubscribers("initialize");
90
- }
91
- }
92
-
93
84
  public async append(message: AppendMessage): Promise<void> {
94
- this._ensureInitialized();
85
+ this.ensureInitialized();
95
86
 
96
87
  const newMessage = fromCoreMessage(message, {
97
88
  attachments: message.attachments,
@@ -108,7 +99,7 @@ export class LocalThreadRuntimeCore
108
99
  }
109
100
 
110
101
  public async startRun(parentId: string | null): Promise<void> {
111
- this._ensureInitialized();
102
+ this.ensureInitialized();
112
103
 
113
104
  this.repository.resetHead(parentId);
114
105
 
@@ -3,7 +3,7 @@ import { useCallback, useRef } from "react";
3
3
  export const useManagedRef = <TNode>(
4
4
  callback: (node: TNode) => (() => void) | void,
5
5
  ) => {
6
- const cleanupRef = useRef<(() => void) | void>();
6
+ const cleanupRef = useRef<(() => void) | void>(undefined);
7
7
 
8
8
  const ref = useCallback(
9
9
  (el: TNode | null) => {
@@ -1,6 +0,0 @@
1
- {
2
- "name": "edge",
3
- "lockfileVersion": 3,
4
- "requires": true,
5
- "packages": {}
6
- }