@smartspace/chat-ui 1.13.1-dev.6790276 → 1.13.1-dev.7dc0bb5

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.
package/dist/index.d.ts CHANGED
@@ -404,6 +404,7 @@ declare const messagesResponseSchema: z.ZodObject<{
404
404
  blockId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
405
405
  code: z.ZodNumber;
406
406
  data: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
407
+ errorCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
407
408
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
408
409
  }, z.core.$strip>>;
409
410
  hasComments: z.ZodBoolean;
@@ -514,6 +515,11 @@ declare function mapThreadsResponseDtoToModel(dto: ThreadsResponseDto): ThreadsR
514
515
  declare function mapSignalRThreadSummaryToModel(summary: SignalR.MessageThreadSummary): MessageThread;
515
516
 
516
517
  declare const workspaceResponseSchema: z.ZodObject<{
518
+ connectors: z.ZodArray<z.ZodObject<{
519
+ id: z.ZodString;
520
+ kind: z.ZodString;
521
+ name: z.ZodString;
522
+ }, z.core.$strip>>;
517
523
  createdAt: z.ZodISODateTime;
518
524
  createdByUserId: z.ZodString;
519
525
  dataSpaces: z.ZodArray<z.ZodObject<{
@@ -560,6 +566,7 @@ declare const workspaceResponseSchema: z.ZodObject<{
560
566
  }, z.core.$strip>;
561
567
  }, z.core.$strip>>>>;
562
568
  constants: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
569
+ secret: z.ZodBoolean;
563
570
  value: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
564
571
  }, z.core.$strip>>>>;
565
572
  inputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -584,6 +591,11 @@ declare const workspaceResponseSchema: z.ZodObject<{
584
591
  triggers: z.ZodArray<z.ZodObject<{
585
592
  dataSourceContainer: z.ZodObject<{
586
593
  dataSourceId: z.ZodString;
594
+ filters: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
595
+ operator: z.ZodString;
596
+ propertyName: z.ZodString;
597
+ value: z.ZodString;
598
+ }, z.core.$strip>>>>;
587
599
  id: z.ZodString;
588
600
  name: z.ZodString;
589
601
  path: z.ZodString;
@@ -744,6 +756,11 @@ declare const workspaceUsersResponseSchema: z.ZodArray<z.ZodObject<{
744
756
  }, z.core.$strip>>;
745
757
  declare const workspacesListResponseSchema: z.ZodObject<{
746
758
  data: z.ZodArray<z.ZodObject<{
759
+ connectors: z.ZodArray<z.ZodObject<{
760
+ id: z.ZodString;
761
+ kind: z.ZodString;
762
+ name: z.ZodString;
763
+ }, z.core.$strip>>;
747
764
  createdAt: z.ZodISODateTime;
748
765
  createdByUserId: z.ZodString;
749
766
  dataSpaces: z.ZodArray<z.ZodObject<{
@@ -790,6 +807,7 @@ declare const workspacesListResponseSchema: z.ZodObject<{
790
807
  }, z.core.$strip>;
791
808
  }, z.core.$strip>>>>;
792
809
  constants: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
810
+ secret: z.ZodBoolean;
793
811
  value: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
794
812
  }, z.core.$strip>>>>;
795
813
  inputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -814,6 +832,11 @@ declare const workspacesListResponseSchema: z.ZodObject<{
814
832
  triggers: z.ZodArray<z.ZodObject<{
815
833
  dataSourceContainer: z.ZodObject<{
816
834
  dataSourceId: z.ZodString;
835
+ filters: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
836
+ operator: z.ZodString;
837
+ propertyName: z.ZodString;
838
+ value: z.ZodString;
839
+ }, z.core.$strip>>>>;
817
840
  id: z.ZodString;
818
841
  name: z.ZodString;
819
842
  path: z.ZodString;
package/dist/index.js CHANGED
@@ -20104,7 +20104,14 @@ function pushContent(items, value) {
20104
20104
  return;
20105
20105
  }
20106
20106
  if (Array.isArray(value)) {
20107
- items.push(...value);
20107
+ const looksLikeContent = value.every(
20108
+ (it) => it != null && typeof it === "object" && ("text" in it || "image" in it)
20109
+ );
20110
+ if (looksLikeContent) {
20111
+ items.push(...value);
20112
+ } else {
20113
+ items.push({ text: "```json\n" + JSON.stringify(value, null, 2) + "\n```" });
20114
+ }
20108
20115
  return;
20109
20116
  }
20110
20117
  if (typeof value === "object") {
@@ -20179,25 +20186,28 @@ var MessageItem = ({
20179
20186
  let groupOpen = false;
20180
20187
  let keyCounter = 0;
20181
20188
  let lastStatusNode = null;
20189
+ const groupHasAnything = () => groupContent.length > 0 || groupFiles.length > 0 || groupSources.length > 0;
20182
20190
  const flush = (nextType) => {
20183
- bubbles.push(
20184
- /* @__PURE__ */ jsx(
20185
- MessageBubble,
20186
- {
20187
- createdBy: lastCreatedBy,
20188
- createdByUserId: lastCreatedByUserId,
20189
- createdAt: lastCreatedAt,
20190
- type: groupType,
20191
- content: groupContent,
20192
- files: groupFiles,
20193
- sources: groupSources,
20194
- chatbotName,
20195
- userOutput: null,
20196
- userInput: null
20197
- },
20198
- `bubble-${message.id ?? "msg"}-${keyCounter++}`
20199
- )
20200
- );
20191
+ if (groupHasAnything()) {
20192
+ bubbles.push(
20193
+ /* @__PURE__ */ jsx(
20194
+ MessageBubble,
20195
+ {
20196
+ createdBy: lastCreatedBy,
20197
+ createdByUserId: lastCreatedByUserId,
20198
+ createdAt: lastCreatedAt,
20199
+ type: groupType,
20200
+ content: groupContent,
20201
+ files: groupFiles,
20202
+ sources: groupSources,
20203
+ chatbotName,
20204
+ userOutput: null,
20205
+ userInput: null
20206
+ },
20207
+ `bubble-${message.id ?? "msg"}-${keyCounter++}`
20208
+ )
20209
+ );
20210
+ }
20201
20211
  groupContent = [];
20202
20212
  groupFiles = [];
20203
20213
  groupSources = [];
@@ -20229,6 +20239,9 @@ var MessageItem = ({
20229
20239
  case "prompt":
20230
20240
  case "response":
20231
20241
  case "content": {
20242
+ if (v.value === "") {
20243
+ continue;
20244
+ }
20232
20245
  lastStatusNode = null;
20233
20246
  if (groupContent.length > 0) flush(v.type);
20234
20247
  if (v.value == null) {
@@ -20283,7 +20296,7 @@ var MessageItem = ({
20283
20296
  }
20284
20297
  case "sources": {
20285
20298
  groupSources = coerceSources(v.value);
20286
- groupOpen = true;
20299
+ if (groupSources.length > 0) groupOpen = true;
20287
20300
  break;
20288
20301
  }
20289
20302
  default: {
@@ -20297,7 +20310,7 @@ var MessageItem = ({
20297
20310
  lastCreatedBy = v.createdBy;
20298
20311
  lastCreatedByUserId = v.createdByUserId;
20299
20312
  }
20300
- if (groupOpen) {
20313
+ if (groupOpen && groupHasAnything()) {
20301
20314
  bubbles.push(
20302
20315
  /* @__PURE__ */ jsx(
20303
20316
  MessageBubble,