@carbon/ai-chat 0.1.5-rc0 → 0.1.6-alpha0

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 (143) hide show
  1. package/dist/cjs/Carousel.js +2 -2
  2. package/dist/cjs/Chat.js +24 -4
  3. package/dist/cjs/GenesysMessengerServiceDesk.js +2 -2
  4. package/dist/cjs/HumanAgentServiceImpl.js +2 -2
  5. package/dist/cjs/NiceDFOServiceDesk.js +2 -2
  6. package/dist/cjs/PDFViewerContainer.js +2 -2
  7. package/dist/cjs/ReactPlayer.js +2 -2
  8. package/dist/cjs/SFServiceDesk.js +2 -2
  9. package/dist/cjs/ServiceDeskImpl.js +2 -2
  10. package/dist/cjs/Table.js +2 -2
  11. package/dist/cjs/ZendeskServiceDesk.js +2 -2
  12. package/dist/cjs/_node-resolve_empty.js +2 -2
  13. package/dist/cjs/agentActions.js +2 -2
  14. package/dist/cjs/aiChatEntry.js +2 -2
  15. package/dist/cjs/anonymousUserIDStorage.js +2 -2
  16. package/dist/cjs/ar-dz.js +2 -2
  17. package/dist/cjs/ar-kw.js +2 -2
  18. package/dist/cjs/ar-ly.js +2 -2
  19. package/dist/cjs/ar-ma.js +2 -2
  20. package/dist/cjs/ar-sa.js +2 -2
  21. package/dist/cjs/ar-tn.js +2 -2
  22. package/dist/cjs/ar.js +2 -2
  23. package/dist/cjs/ar2.js +4 -4
  24. package/dist/cjs/cds-aichat-container.js +2 -2
  25. package/dist/cjs/cds-aichat-custom-element.js +2 -2
  26. package/dist/cjs/cds-aichat-internal.js +67 -14
  27. package/dist/cjs/cs.js +2 -2
  28. package/dist/cjs/cs2.js +10 -10
  29. package/dist/cjs/de-at.js +2 -2
  30. package/dist/cjs/de-ch.js +2 -2
  31. package/dist/cjs/de.js +2 -2
  32. package/dist/cjs/de2.js +6 -6
  33. package/dist/cjs/en-au.js +2 -2
  34. package/dist/cjs/en-ca.js +2 -2
  35. package/dist/cjs/en-gb.js +2 -2
  36. package/dist/cjs/en-ie.js +2 -2
  37. package/dist/cjs/en-il.js +2 -2
  38. package/dist/cjs/en-nz.js +2 -2
  39. package/dist/cjs/es-do.js +2 -2
  40. package/dist/cjs/es-us.js +2 -2
  41. package/dist/cjs/es.js +2 -2
  42. package/dist/cjs/es2.js +2 -2
  43. package/dist/cjs/export.js +2 -2
  44. package/dist/cjs/export.legacy.js +2 -2
  45. package/dist/cjs/fontUtils.js +2 -2
  46. package/dist/cjs/fr-ca.js +2 -2
  47. package/dist/cjs/fr-ch.js +2 -2
  48. package/dist/cjs/fr.js +2 -2
  49. package/dist/cjs/fr2.js +10 -10
  50. package/dist/cjs/highlight_js.js +2 -2
  51. package/dist/cjs/it-ch.js +2 -2
  52. package/dist/cjs/it.js +2 -2
  53. package/dist/cjs/it2.js +7 -7
  54. package/dist/cjs/ja.js +2 -2
  55. package/dist/cjs/ja2.js +14 -14
  56. package/dist/cjs/jstz.min.js +2 -2
  57. package/dist/cjs/ko.js +2 -2
  58. package/dist/cjs/ko2.js +7 -7
  59. package/dist/cjs/markdown.js +2 -2
  60. package/dist/cjs/markdown_attrs.js +2 -2
  61. package/dist/cjs/mockServiceDesk.js +2 -2
  62. package/dist/cjs/nl.js +2 -2
  63. package/dist/cjs/nl2.js +3 -3
  64. package/dist/cjs/pt-br.js +2 -2
  65. package/dist/cjs/pt-br2.js +10 -10
  66. package/dist/cjs/pt.js +2 -2
  67. package/dist/cjs/render.js +2 -2
  68. package/dist/cjs/zh-cn.js +2 -2
  69. package/dist/cjs/zh-tw.js +2 -2
  70. package/dist/cjs/zh-tw2.js +12 -12
  71. package/dist/cjs/zh.js +11 -11
  72. package/dist/es/Carousel.js +3 -3
  73. package/dist/es/Chat.js +25 -5
  74. package/dist/es/GenesysMessengerServiceDesk.js +3 -3
  75. package/dist/es/HumanAgentServiceImpl.js +3 -3
  76. package/dist/es/NiceDFOServiceDesk.js +3 -3
  77. package/dist/es/PDFViewerContainer.js +3 -3
  78. package/dist/es/ReactPlayer.js +2 -2
  79. package/dist/es/SFServiceDesk.js +3 -3
  80. package/dist/es/ServiceDeskImpl.js +2 -2
  81. package/dist/es/Table.js +3 -3
  82. package/dist/es/ZendeskServiceDesk.js +2 -2
  83. package/dist/es/_node-resolve_empty.js +2 -2
  84. package/dist/es/agentActions.js +2 -2
  85. package/dist/es/aiChatEntry.js +2 -2
  86. package/dist/es/anonymousUserIDStorage.js +3 -3
  87. package/dist/es/ar-dz.js +3 -3
  88. package/dist/es/ar-kw.js +3 -3
  89. package/dist/es/ar-ly.js +3 -3
  90. package/dist/es/ar-ma.js +3 -3
  91. package/dist/es/ar-sa.js +3 -3
  92. package/dist/es/ar-tn.js +3 -3
  93. package/dist/es/ar.js +3 -3
  94. package/dist/es/ar2.js +4 -4
  95. package/dist/es/cds-aichat-container.js +2 -2
  96. package/dist/es/cds-aichat-custom-element.js +2 -2
  97. package/dist/es/cds-aichat-internal.js +66 -15
  98. package/dist/es/cs.js +3 -3
  99. package/dist/es/cs2.js +10 -10
  100. package/dist/es/de-at.js +3 -3
  101. package/dist/es/de-ch.js +3 -3
  102. package/dist/es/de.js +3 -3
  103. package/dist/es/de2.js +6 -6
  104. package/dist/es/en-au.js +3 -3
  105. package/dist/es/en-ca.js +3 -3
  106. package/dist/es/en-gb.js +3 -3
  107. package/dist/es/en-ie.js +3 -3
  108. package/dist/es/en-il.js +3 -3
  109. package/dist/es/en-nz.js +3 -3
  110. package/dist/es/es-do.js +3 -3
  111. package/dist/es/es-us.js +3 -3
  112. package/dist/es/es.js +3 -3
  113. package/dist/es/es2.js +2 -2
  114. package/dist/es/export.js +2 -2
  115. package/dist/es/export.legacy.js +2 -2
  116. package/dist/es/fontUtils.js +2 -2
  117. package/dist/es/fr-ca.js +3 -3
  118. package/dist/es/fr-ch.js +3 -3
  119. package/dist/es/fr.js +3 -3
  120. package/dist/es/fr2.js +10 -10
  121. package/dist/es/highlight_js.js +2 -2
  122. package/dist/es/it-ch.js +3 -3
  123. package/dist/es/it.js +3 -3
  124. package/dist/es/it2.js +7 -7
  125. package/dist/es/ja.js +3 -3
  126. package/dist/es/ja2.js +14 -14
  127. package/dist/es/jstz.min.js +2 -2
  128. package/dist/es/ko.js +3 -3
  129. package/dist/es/ko2.js +7 -7
  130. package/dist/es/markdown.js +2 -2
  131. package/dist/es/markdown_attrs.js +2 -2
  132. package/dist/es/mockServiceDesk.js +2 -2
  133. package/dist/es/nl.js +3 -3
  134. package/dist/es/nl2.js +3 -3
  135. package/dist/es/pt-br.js +3 -3
  136. package/dist/es/pt-br2.js +10 -10
  137. package/dist/es/pt.js +3 -3
  138. package/dist/es/render.js +3 -3
  139. package/dist/es/zh-cn.js +3 -3
  140. package/dist/es/zh-tw.js +3 -3
  141. package/dist/es/zh-tw2.js +12 -12
  142. package/dist/es/zh.js +11 -11
  143. package/package.json +1 -1
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
package/dist/cjs/Chat.js CHANGED
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -1359,6 +1359,12 @@ class ChatActionsImpl {
1359
1359
  }
1360
1360
  const item = chunk.partial_item || chunk.complete_item;
1361
1361
  store.dispatch(cdsAichatInternal.actions.streamingAddChunk(messageID, item, isCompleteItem, options.disableFadeAnimation ?? true));
1362
+ if (chunk.partial_response?.history) {
1363
+ if (Object.keys(chunk.partial_response).length > 1) {
1364
+ throw new Error(`The partial_response object only supports the "history" property.`);
1365
+ }
1366
+ store.dispatch(cdsAichatInternal.actions.streamingMergeHistory(messageID, chunk.partial_response?.history));
1367
+ }
1362
1368
  // Now make sure to handle any user_defined response items in the chunk.
1363
1369
  this.handleUserDefinedResponseItemsChunk(messageID, chunk, item);
1364
1370
  }
@@ -4295,7 +4301,7 @@ class MessageService {
4295
4301
  if (eventType === 'message' || !eventType) {
4296
4302
  clearTimeout(streamStartingTimer);
4297
4303
  const data = JSON.parse(event.data);
4298
- if (!streamMessageID && data.streaming_metadata?.response_id) {
4304
+ if (!streamMessageID && cdsAichatInternal.isStreamPartialOrCompleteItem(data) && data.streaming_metadata?.response_id) {
4299
4305
  // The first chunk should include the ID of the final message response we are building.
4300
4306
  streamMessageID = data.streaming_metadata.response_id;
4301
4307
  store.dispatch(cdsAichatInternal.actions.removeLocalMessageItem(streamLoadingItemID));
@@ -4305,7 +4311,7 @@ class MessageService {
4305
4311
  current.sendMessagePromise.doResolve();
4306
4312
  }
4307
4313
  }
4308
- if (data.partial_item || data.complete_item) {
4314
+ if (cdsAichatInternal.isStreamPartialOrCompleteItem(data)) {
4309
4315
  // We don't want the artificial pause when we're streaming chunks of items.
4310
4316
  current.requestOptions.skipPause = true;
4311
4317
  // Once we get individual items, we don't want to apply the full body message animations anymore. That
@@ -7274,6 +7280,20 @@ const reducers = {
7274
7280
  };
7275
7281
  return applyFullMessage(state, streamIntoResponse);
7276
7282
  },
7283
+ [cdsAichatInternal.STREAMING_MERGE_HISTORY]: (state, { messageID, history }) => {
7284
+ const existingMessage = state.allMessagesByID[messageID];
7285
+ const newMessage = cdsAichatInternal.merge({}, existingMessage, { history });
7286
+ if (existingMessage) {
7287
+ return {
7288
+ ...state,
7289
+ allMessagesByID: {
7290
+ ...state.allMessagesByID,
7291
+ [messageID]: newMessage,
7292
+ },
7293
+ };
7294
+ }
7295
+ return state;
7296
+ },
7277
7297
  [cdsAichatInternal.STREAMING_ADD_CHUNK]: (state, { chunkItem, fullMessageID, isCompleteItem, disableFadeAnimation, }) => {
7278
7298
  const message = state.allMessagesByID[fullMessageID];
7279
7299
  // This might be undefined if we haven't seen this item before.
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
package/dist/cjs/Table.js CHANGED
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
package/dist/cjs/ar-dz.js CHANGED
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
package/dist/cjs/ar-kw.js CHANGED
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
package/dist/cjs/ar-ly.js CHANGED
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
package/dist/cjs/ar-ma.js CHANGED
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
package/dist/cjs/ar-sa.js CHANGED
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
package/dist/cjs/ar-tn.js CHANGED
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
package/dist/cjs/ar.js CHANGED
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
package/dist/cjs/ar2.js CHANGED
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -259,14 +259,14 @@ var table_previousPage = "الصفحة السابقة";
259
259
  var table_nextPage = "الصفحة التالية";
260
260
  var table_itemsPerPage = "البنود بكل صفحة:";
261
261
  var table_paginationSupplementalText = "من {pagesCount, number}{pagesCount, plural, zero {صفحات} other {صفحات} one {صفحة} few {صفحات} many {صفحات} two {صفحات}}";
262
- var table_paginationStatus = "{بداية، رقم}–{نهاية، رقم} من {عدد، رقم}{count, plural, zero {البنود} other {البنود} one {البند} few {البنود} many {البنود} two {البنود}}";
262
+ var table_paginationStatus = "{start, number}–{end, number} من{count, number} {count, plural, zero {البنود} other {البنود} one {البند} few {البنود} many {البنود} two {البنود}}";
263
263
  var feedback_positiveLabel = "استجابة جيدة";
264
264
  var feedback_negativeLabel = "استجابة سيئة";
265
265
  var feedback_defaultTitle = "ملاحظات إضافية";
266
266
  var feedback_defaultPrompt = "لماذا اخترت هذا التقييم؟";
267
267
  var feedback_defaultPlaceholder = "أضف تعليق";
268
268
  var feedback_submitLabel = "إحالة";
269
- var feedback_cancelLabel = "الغاء";
269
+ var feedback_cancelLabel = "إلغاء";
270
270
  var ar = {
271
271
  ai_slug_title: ai_slug_title,
272
272
  ai_slug_description: ai_slug_description,
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21
 
@@ -4269,7 +4269,7 @@ var merge = createAssigner(function(object, source, srcIndex) {
4269
4269
  // Webpack/rollup will replace any "process.env.*" values below that it recognizes at compile time with their corresponding
4270
4270
  // values at that time.
4271
4271
 
4272
- var VERSION = "0.1.4";
4272
+ var VERSION = "0.1.6";
4273
4273
 
4274
4274
  // PRODUCTION ENV VARIABLES
4275
4275
  // These env variables are used in production (as well as development)
@@ -6148,6 +6148,7 @@ const REGION_MAP = {
6148
6148
  'aws-us-east-1': 'integrations.aws-us-east-1.assistant.watson.appdomain.cloud',
6149
6149
  'aws-preprod': 'integrations.aws-us-east-1.assistant.preprod.watson.appdomain.cloud',
6150
6150
  'aws-eu-central-1': 'integrations.aws-eu-central-1.assistant.watson.appdomain.cloud',
6151
+ 'aws-ap-southeast-1': 'integrations.aws-ap-southeast-1.assistant.watson.appdomain.cloud',
6151
6152
  // WXO on IBM Cloud
6152
6153
  'wxo-dev': 'integrations.us-south.assistant-builder.dev.watson.appdomain.cloud',
6153
6154
  'wxo-staging': 'integrations.us-south.assistant-builder.test.watson.appdomain.cloud',
@@ -6158,7 +6159,6 @@ const REGION_MAP = {
6158
6159
  'wxo-eu-de': 'integrations.eu-de.assistant-builder.watson.appdomain.cloud',
6159
6160
  'wxo-jp-tok': 'integrations.jp-tok.assistant-builder.watson.appdomain.cloud',
6160
6161
  'wxo-au-syd': 'integrations.au-syd.assistant-builder.watson.appdomain.cloud',
6161
- 'wxo-ap-southeast-1': 'integrations.ap-southeast-1.assistant-builder.watson.appdomain.cloud',
6162
6162
  };
6163
6163
  /**
6164
6164
  * Gets the region hostname for calls to the integrations server.
@@ -10175,6 +10175,7 @@ const SET_RESPONSE_PANEL_IS_OPEN = 'SET_RESPONSE_PANEL_IS_OPEN';
10175
10175
  const SET_RESPONSE_PANEL_CONTENT = 'SET_PANEL_RESPONSE_CONTENT';
10176
10176
  const STREAMING_ADD_CHUNK = 'STREAMING_ADD_CHUNK';
10177
10177
  const STREAMING_START = 'STREAMING_START';
10178
+ const STREAMING_MERGE_HISTORY = 'STREAMING_MERGE_HISTORY';
10178
10179
  const ADD_NOTIFICATION = 'ADD_NOTIFICATION';
10179
10180
  const REMOVE_ALL_NOTIFICATIONS = 'REMOVE_ALL_NOTIFICATIONS';
10180
10181
  const REMOVE_NOTIFICATIONS = 'REMOVE_NOTIFICATIONS';
@@ -10565,6 +10566,12 @@ const actions = {
10565
10566
  streamingStart(messageID) {
10566
10567
  return { type: STREAMING_START, messageID };
10567
10568
  },
10569
+ /**
10570
+ * Merges the given message history object into an existing message object.
10571
+ */
10572
+ streamingMergeHistory(messageID, history) {
10573
+ return { type: STREAMING_MERGE_HISTORY, messageID, history };
10574
+ },
10568
10575
  /**
10569
10576
  * Adds a new chunk of a streaming response to an existing message.
10570
10577
  */
@@ -16194,11 +16201,12 @@ function isAnythingElse(message) {
16194
16201
  /**
16195
16202
  * Creates a new {@link TextItem}.
16196
16203
  */
16197
- function createTextItem(text) {
16198
- return {
16204
+ function createTextItem(text, streamID) {
16205
+ const item = {
16199
16206
  response_type: exports.MessageResponseTypes.TEXT,
16200
16207
  text,
16201
16208
  };
16209
+ return item;
16202
16210
  }
16203
16211
  /**
16204
16212
  * Determines if the given search result item is empty (has no results in it).
@@ -16286,6 +16294,12 @@ function isStreamPartialItem(chunk) {
16286
16294
  function isStreamCompleteItem(chunk) {
16287
16295
  return Boolean(chunk.complete_item);
16288
16296
  }
16297
+ /**
16298
+ * Indicates if the given stream chunk is a complete item.
16299
+ */
16300
+ function isStreamPartialOrCompleteItem(chunk) {
16301
+ return isStreamPartialItem(chunk) || isStreamCompleteItem(chunk);
16302
+ }
16289
16303
  /**
16290
16304
  * Indicates if the given stream chunk is a partial item.
16291
16305
  */
@@ -33740,10 +33754,15 @@ class MessageComponent extends React$1.PureComponent {
33740
33754
  return this.renderFailedRenderMessage();
33741
33755
  }
33742
33756
  const { serviceManager, config, localMessageItem, message, languagePack, requestInputFocus, toolingType, messagesIndex, disableUserInputs, showAvatarLine, className, doAutoScroll, isMessageForInput, scrollElementIntoView, isFirstMessageItem, hideFeedback, allowNewFeedback, } = this.props;
33743
- const responseType = localMessageItem.item.response_type;
33744
- const agentMessageType = localMessageItem.item.agent_message_type;
33757
+ const { isIntermediateStreaming, isWelcomeResponse, disableFadeAnimation } = localMessageItem.ui_state;
33758
+ const messageItem = localMessageItem.item;
33759
+ const responseType = messageItem.response_type;
33760
+ const agentMessageType = messageItem.agent_message_type;
33745
33761
  const fromHistory = message.history.from_history;
33746
33762
  const readWidgetSaid = isFirstMessageItem;
33763
+ if (isIntermediateStreaming && !canRenderIntermediateStreaming(messageItem.response_type)) {
33764
+ return false;
33765
+ }
33747
33766
  const messageComponent = (React$1.createElement(MessageTypeComponent, { serviceManager: serviceManager, toolingType: toolingType, languagePack: languagePack, requestInputFocus: requestInputFocus, message: localMessageItem, originalMessage: message, disableUserInputs: disableUserInputs, isMessageForInput: isMessageForInput, config: config, doAutoScroll: doAutoScroll, scrollElementIntoView: scrollElementIntoView, hideFeedback: hideFeedback, allowNewFeedback: allowNewFeedback }));
33748
33767
  const isCustomMessage = renderAsUserDefinedMessage(localMessageItem.item);
33749
33768
  const isChatStatusMessage = isChatStatusResponseType(localMessageItem);
@@ -33752,7 +33771,7 @@ class MessageComponent extends React$1.PureComponent {
33752
33771
  styleObject = { zIndex: this.state.zIndex };
33753
33772
  }
33754
33773
  // Don't show animation on the welcome node or for messages that explicitly turn it off.
33755
- const noAnimation = localMessageItem.ui_state.isWelcomeResponse || localMessageItem.ui_state.disableFadeAnimation;
33774
+ const noAnimation = isWelcomeResponse || disableFadeAnimation;
33756
33775
  // If this is a user_defined response type with silent set, we don't want to render all the extra cruft around it.
33757
33776
  const agentClassName = getAgentMessageClassName(agentMessageType, responseType, isCustomMessage);
33758
33777
  const messageIsRequest = isRequest(message);
@@ -33865,6 +33884,26 @@ function isAgentStatusMessage(agentMessageType) {
33865
33884
  return true;
33866
33885
  }
33867
33886
  }
33887
+ /**
33888
+ * Indicates if an item with the given response type is allowed to be rendered in an intermediate stream state.
33889
+ */
33890
+ function canRenderIntermediateStreaming(type) {
33891
+ switch (type) {
33892
+ case exports.MessageResponseTypes.IMAGE:
33893
+ case exports.MessageResponseTypes.VIDEO:
33894
+ case exports.MessageResponseTypes.AUDIO:
33895
+ case exports.MessageResponseTypes.OPTION:
33896
+ case exports.MessageResponseTypes.IFRAME:
33897
+ case exports.MessageResponseTypes.INLINE_ERROR:
33898
+ case exports.MessageResponseTypes.SUGGESTION:
33899
+ case exports.MessageResponseTypes.CONVERSATIONAL_SEARCH:
33900
+ case exports.MessageResponseTypes.USER_DEFINED:
33901
+ case exports.MessageResponseTypes.TEXT:
33902
+ return true;
33903
+ default:
33904
+ return false;
33905
+ }
33906
+ }
33868
33907
  var MessageComponent$1 = withAriaAnnouncer(reactIntl.injectIntl(MessageComponent, { forwardRef: true }));
33869
33908
 
33870
33909
  /**
@@ -38551,8 +38590,14 @@ let ChatContainerInternal = class ChatContainerInternal extends lit.LitElement {
38551
38590
  if (this.isReact && typeof __webpack_require__ !== 'undefined' && 'resolveWeak' in __webpack_require__) {
38552
38591
  // Webpack-friendly runtime check for the existence of the module.
38553
38592
  if (__webpack_require__.resolveWeak('react-dom/client')) {
38554
- const ReactDOMClient = await import('react-dom/client');
38555
- createRoot = ReactDOMClient.createRoot;
38593
+ try {
38594
+ const ReactDOMClient = await import('react-dom/client');
38595
+ createRoot = ReactDOMClient.createRoot;
38596
+ }
38597
+ catch {
38598
+ // This is for webpack 4 builds that will try to run this anyway even if conditions are not met.
38599
+ console.warn('Unable to import react-dom/client.');
38600
+ }
38556
38601
  }
38557
38602
  else {
38558
38603
  throw new Error('Unable to render React client. If you are running an application using React 18, but you have not updated to using createRoot, please include the "forceReact17Mode" prop.');
@@ -38560,14 +38605,20 @@ let ChatContainerInternal = class ChatContainerInternal extends lit.LitElement {
38560
38605
  }
38561
38606
  else {
38562
38607
  // General fallback for environments without resolveWeak.
38563
- const ReactDOMClient = await import('react-dom/client');
38564
- createRoot = ReactDOMClient.createRoot;
38608
+ try {
38609
+ const ReactDOMClient = await import('react-dom/client');
38610
+ createRoot = ReactDOMClient.createRoot;
38611
+ }
38612
+ catch {
38613
+ // This is for webpack 4 builds that will try to run this anyway even if conditions are not met.
38614
+ console.warn('Unable to import react-dom/client.');
38615
+ }
38565
38616
  }
38566
38617
  this._root = createRoot(container);
38567
38618
  this._root.render(React$1.createElement(AppContainer, { config: this.config, renderUserDefinedResponse: this.renderUserDefinedResponse, renderWriteableElements: this.renderWriteableElements, onBeforeRender: this.onBeforeRender, onAfterRender: this.onAfterRender, container: container }));
38568
38619
  }
38569
38620
  catch (error) {
38570
- consoleError('Unable to render React client. If you are running an application using React 18, but you have not updated to using createRoot, please include the "forceReact17Mode" prop.', error);
38621
+ consoleError('Unable to render React client. If you are running an application using React 18+, but you have not updated to using createRoot, please include the "forceReact17Mode" prop.', error);
38571
38622
  }
38572
38623
  }
38573
38624
  else {
@@ -38712,6 +38763,7 @@ exports.SET_UPDATE_HISTORY_USER_DEFINED_COUNT = SET_UPDATE_HISTORY_USER_DEFINED_
38712
38763
  exports.SET_VIEW_CHANGING = SET_VIEW_CHANGING;
38713
38764
  exports.SET_VIEW_STATE = SET_VIEW_STATE;
38714
38765
  exports.STREAMING_ADD_CHUNK = STREAMING_ADD_CHUNK;
38766
+ exports.STREAMING_MERGE_HISTORY = STREAMING_MERGE_HISTORY;
38715
38767
  exports.STREAMING_START = STREAMING_START;
38716
38768
  exports.SUGGESTIONS_SET_SELECTED_INDEX = SUGGESTIONS_SET_SELECTED_INDEX;
38717
38769
  exports.Search = Search;
@@ -38843,6 +38895,7 @@ exports.isSecureHost = isSecureHost;
38843
38895
  exports.isStreamCompleteItem = isStreamCompleteItem;
38844
38896
  exports.isStreamFinalResponse = isStreamFinalResponse;
38845
38897
  exports.isStreamPartialItem = isStreamPartialItem;
38898
+ exports.isStreamPartialOrCompleteItem = isStreamPartialOrCompleteItem;
38846
38899
  exports.isStrike = isStrike;
38847
38900
  exports.isSuggestionListItem = isSuggestionListItem;
38848
38901
  exports.isTyping = isTyping;
package/dist/cjs/cs.js CHANGED
@@ -13,9 +13,9 @@ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
13
13
  or implied. See the License for the specific language governing permissions and limitations under
14
14
  the License.
15
15
 
16
- @carbon/ai-chat 0.1.4
16
+ @carbon/ai-chat 0.1.6-alpha0
17
17
 
18
- Built: Jan 14 2025 9:17 am -05:00
18
+ Built: Jan 22 2025 1:15 pm -05:00
19
19
 
20
20
 
21
21