@assistant-ui/react 0.7.0 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. package/dist/api/AssistantRuntime.d.ts +4 -34
  2. package/dist/api/AssistantRuntime.d.ts.map +1 -1
  3. package/dist/api/AssistantRuntime.js.map +1 -1
  4. package/dist/api/AssistantRuntime.mjs.map +1 -1
  5. package/dist/api/AttachmentRuntime.d.ts +4 -4
  6. package/dist/api/AttachmentRuntime.d.ts.map +1 -1
  7. package/dist/api/AttachmentRuntime.js.map +1 -1
  8. package/dist/api/AttachmentRuntime.mjs.map +1 -1
  9. package/dist/api/ComposerRuntime.d.ts +10 -10
  10. package/dist/api/ComposerRuntime.d.ts.map +1 -1
  11. package/dist/api/ComposerRuntime.js.map +1 -1
  12. package/dist/api/ComposerRuntime.mjs.map +1 -1
  13. package/dist/api/ContentPartRuntime.d.ts +2 -2
  14. package/dist/api/ContentPartRuntime.d.ts.map +1 -1
  15. package/dist/api/ContentPartRuntime.js.map +1 -1
  16. package/dist/api/ContentPartRuntime.mjs.map +1 -1
  17. package/dist/api/MessageRuntime.d.ts +7 -7
  18. package/dist/api/MessageRuntime.d.ts.map +1 -1
  19. package/dist/api/MessageRuntime.js +2 -2
  20. package/dist/api/MessageRuntime.js.map +1 -1
  21. package/dist/api/MessageRuntime.mjs +2 -2
  22. package/dist/api/MessageRuntime.mjs.map +1 -1
  23. package/dist/api/RuntimePathTypes.d.ts +33 -33
  24. package/dist/api/RuntimePathTypes.d.ts.map +1 -1
  25. package/dist/api/RuntimePathTypes.js.map +1 -1
  26. package/dist/api/ThreadListItemRuntime.d.ts +4 -4
  27. package/dist/api/ThreadListItemRuntime.d.ts.map +1 -1
  28. package/dist/api/ThreadListItemRuntime.js.map +1 -1
  29. package/dist/api/ThreadListItemRuntime.mjs.map +1 -1
  30. package/dist/api/ThreadListRuntime.d.ts +9 -9
  31. package/dist/api/ThreadListRuntime.d.ts.map +1 -1
  32. package/dist/api/ThreadListRuntime.js.map +1 -1
  33. package/dist/api/ThreadListRuntime.mjs.map +1 -1
  34. package/dist/api/ThreadRuntime.d.ts +45 -56
  35. package/dist/api/ThreadRuntime.d.ts.map +1 -1
  36. package/dist/api/ThreadRuntime.js.map +1 -1
  37. package/dist/api/ThreadRuntime.mjs.map +1 -1
  38. package/dist/api/index.d.ts +1 -0
  39. package/dist/api/index.d.ts.map +1 -1
  40. package/dist/api/index.js.map +1 -1
  41. package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts +1 -1
  42. package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
  43. package/dist/context/react/AssistantContext.d.ts +10 -48
  44. package/dist/context/react/AssistantContext.d.ts.map +1 -1
  45. package/dist/context/react/AttachmentContext.d.ts +16 -16
  46. package/dist/context/react/MessageContext.d.ts +6 -36
  47. package/dist/context/react/MessageContext.d.ts.map +1 -1
  48. package/dist/context/react/ThreadContext.d.ts +10 -138
  49. package/dist/context/react/ThreadContext.d.ts.map +1 -1
  50. package/dist/context/stores/AssistantToolUIs.d.ts +9 -6
  51. package/dist/context/stores/AssistantToolUIs.d.ts.map +1 -1
  52. package/dist/context/stores/AssistantToolUIs.js.map +1 -1
  53. package/dist/context/stores/AssistantToolUIs.mjs.map +1 -1
  54. package/dist/context/stores/MessageUtils.d.ts +7 -12
  55. package/dist/context/stores/MessageUtils.d.ts.map +1 -1
  56. package/dist/context/stores/MessageUtils.js.map +1 -1
  57. package/dist/context/stores/MessageUtils.mjs.map +1 -1
  58. package/dist/context/stores/ThreadViewport.d.ts +6 -10
  59. package/dist/context/stores/ThreadViewport.d.ts.map +1 -1
  60. package/dist/context/stores/ThreadViewport.js +0 -1
  61. package/dist/context/stores/ThreadViewport.js.map +1 -1
  62. package/dist/context/stores/ThreadViewport.mjs +0 -2
  63. package/dist/context/stores/ThreadViewport.mjs.map +1 -1
  64. package/dist/primitive-hooks/contentPart/useContentPartDisplay.d.ts +1 -1
  65. package/dist/primitive-hooks/contentPart/useContentPartImage.d.ts +1 -1
  66. package/dist/primitive-hooks/contentPart/useContentPartText.d.ts +1 -1
  67. package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts +2 -4
  68. package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts.map +1 -1
  69. package/dist/runtimes/core/ThreadRuntimeCore.d.ts +22 -22
  70. package/dist/runtimes/core/ThreadRuntimeCore.d.ts.map +1 -1
  71. package/dist/runtimes/core/ThreadRuntimeCore.js.map +1 -1
  72. package/dist/runtimes/edge/converters/fromCoreMessage.d.ts.map +1 -1
  73. package/dist/runtimes/edge/converters/fromCoreMessage.js +6 -3
  74. package/dist/runtimes/edge/converters/fromCoreMessage.js.map +1 -1
  75. package/dist/runtimes/edge/converters/fromCoreMessage.mjs +6 -3
  76. package/dist/runtimes/edge/converters/fromCoreMessage.mjs.map +1 -1
  77. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts +3 -3
  78. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts +2 -11
  79. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -1
  80. package/dist/runtimes/external-store/ThreadMessageLike.d.ts +5 -1
  81. package/dist/runtimes/external-store/ThreadMessageLike.d.ts.map +1 -1
  82. package/dist/runtimes/external-store/ThreadMessageLike.js +18 -6
  83. package/dist/runtimes/external-store/ThreadMessageLike.js.map +1 -1
  84. package/dist/runtimes/external-store/ThreadMessageLike.mjs +18 -6
  85. package/dist/runtimes/external-store/ThreadMessageLike.mjs.map +1 -1
  86. package/dist/runtimes/local/ChatModelAdapter.d.ts +4 -4
  87. package/dist/runtimes/local/ChatModelAdapter.d.ts.map +1 -1
  88. package/dist/runtimes/local/ChatModelAdapter.js.map +1 -1
  89. package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts.map +1 -1
  90. package/dist/runtimes/local/LocalThreadRuntimeCore.js +1 -0
  91. package/dist/runtimes/local/LocalThreadRuntimeCore.js.map +1 -1
  92. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs +1 -0
  93. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs.map +1 -1
  94. package/dist/types/AssistantTypes.d.ts +13 -4
  95. package/dist/types/AssistantTypes.d.ts.map +1 -1
  96. package/dist/types/AssistantTypes.js.map +1 -1
  97. package/package.json +3 -3
  98. package/src/api/AssistantRuntime.ts +2 -2
  99. package/src/api/AttachmentRuntime.ts +4 -4
  100. package/src/api/ComposerRuntime.ts +10 -10
  101. package/src/api/ContentPartRuntime.ts +2 -2
  102. package/src/api/MessageRuntime.ts +9 -9
  103. package/src/api/RuntimePathTypes.ts +26 -26
  104. package/src/api/ThreadListItemRuntime.ts +4 -4
  105. package/src/api/ThreadListRuntime.ts +10 -10
  106. package/src/api/ThreadRuntime.ts +45 -14
  107. package/src/api/index.ts +4 -0
  108. package/src/context/stores/AssistantToolUIs.ts +9 -2
  109. package/src/context/stores/MessageUtils.ts +6 -6
  110. package/src/context/stores/ThreadViewport.tsx +5 -6
  111. package/src/runtimes/core/ThreadRuntimeCore.tsx +28 -29
  112. package/src/runtimes/edge/converters/fromCoreMessage.ts +4 -0
  113. package/src/runtimes/external-store/ThreadMessageLike.tsx +21 -4
  114. package/src/runtimes/local/ChatModelAdapter.tsx +4 -4
  115. package/src/runtimes/local/LocalThreadRuntimeCore.tsx +1 -0
  116. package/src/types/AssistantTypes.ts +13 -5
@@ -117,22 +117,27 @@ export type MessageStatus =
117
117
  export type ThreadSystemMessage = MessageCommonProps & {
118
118
  role: "system";
119
119
  content: [TextContentPart];
120
+ metadata: {
121
+ custom: Record<string, unknown>;
122
+ };
120
123
  };
121
124
 
122
125
  export type ThreadUserMessage = MessageCommonProps & {
123
126
  role: "user";
124
127
  content: ThreadUserContentPart[];
125
128
  attachments: readonly CompleteAttachment[];
126
- // TODO metadata
129
+ metadata: {
130
+ custom: Record<string, unknown>;
131
+ };
127
132
  };
128
133
 
129
134
  export type ThreadAssistantMessage = MessageCommonProps & {
130
135
  role: "assistant";
131
136
  content: ThreadAssistantContentPart[];
132
137
  status: MessageStatus;
133
- metadata?: {
134
- steps?: ThreadStep[] | undefined;
135
- custom?: Record<string, unknown> | undefined;
138
+ metadata: {
139
+ steps: ThreadStep[];
140
+ custom: Record<string, unknown>;
136
141
  };
137
142
  };
138
143
 
@@ -144,7 +149,10 @@ export type AppendMessage = CoreMessage & {
144
149
 
145
150
  type BaseThreadMessage = {
146
151
  status?: ThreadAssistantMessage["status"];
147
- metadata?: ThreadAssistantMessage["metadata"];
152
+ metadata: {
153
+ steps?: ThreadStep[];
154
+ custom: Record<string, unknown>;
155
+ };
148
156
  attachments?: ThreadUserMessage["attachments"];
149
157
  };
150
158