@aintela/chat 0.12.1 → 0.13.1

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.
@@ -8,8 +8,8 @@ import qt from "@mui/icons-material/RocketLaunch";
8
8
  import re from "@mui/icons-material/GeneratingTokensOutlined";
9
9
  import zt from "@mui/icons-material/SortByAlphaOutlined";
10
10
  import Zt from "@mui/icons-material/AllInclusive";
11
- import { d as Ht, A as se } from "./environmentUtils-VZNTCzEE.js";
12
- import { jsonMember as o, jsonObject as g, AnyT as H, jsonArrayMember as L, TypedJSON as jt } from "typedjson";
11
+ import { d as Wt, A as se } from "./environmentUtils-VZNTCzEE.js";
12
+ import { jsonMember as o, jsonObject as g, AnyT as W, jsonArrayMember as L, TypedJSON as jt } from "typedjson";
13
13
  const ce = ["user", "whatsapp", "platform", "api"];
14
14
  function Ie(s) {
15
15
  const t = s == null ? void 0 : s.trim().toLowerCase();
@@ -36,7 +36,9 @@ const we = {
36
36
  * A user message sent while a turn is open (AIA Issue 1651). The server queues it on the running turn and injects it
37
37
  * after the next tool round, or when the model would end the turn; an `InteractionStarted` naming it is its delivery.
38
38
  */
39
- QueueMessage: "QueueMessage"
39
+ QueueMessage: "QueueMessage",
40
+ /** Ask the server for the announcement turn of something the host ran in the background (a batch job, an import). */
41
+ AnnounceHostEvent: "AnnounceHostEvent"
40
42
  }, c = {
41
43
  FunctionCall: "function_call",
42
44
  PartialFunctionCall: "partial_function_call",
@@ -112,10 +114,10 @@ const we = {
112
114
  [c.Other]: "Other",
113
115
  [c.Text]: "Text",
114
116
  [c.NotDefined]: "NotDefined"
115
- }, Re = {
117
+ }, Ae = {
116
118
  Regular: "Regular",
117
119
  Artifact: "Artifact"
118
- }, Ae = {
120
+ }, Re = {
119
121
  User: "User",
120
122
  Agent: "Agent",
121
123
  System: "System"
@@ -123,7 +125,7 @@ const we = {
123
125
  Dashboard: "Dashboard",
124
126
  Chart: "Chart",
125
127
  Code: "Code"
126
- }, Wt = {
128
+ }, Ht = {
127
129
  BI_Envision_Agent: "BI_Envision_Agent",
128
130
  BI_Master_Customer_Agent: "BI_Master_Customer_Agent",
129
131
  BI_Dedicated_Customer_Agent: "BI_Dedicated_Customer_Agent",
@@ -132,25 +134,25 @@ const we = {
132
134
  Interactive: "Interactive",
133
135
  Newsletter: "Newsletter"
134
136
  }, Ne = {
135
- [Wt.BI_Envision_Agent]: {
137
+ [Ht.BI_Envision_Agent]: {
136
138
  name: "Envision",
137
139
  description: `Analisa dados de vendas globais
138
140
  com insights consolidados de todos os clientes
139
141
  e métricas agregadas do mercado`
140
142
  },
141
- [Wt.BI_Master_Customer_Agent]: {
143
+ [Ht.BI_Master_Customer_Agent]: {
142
144
  name: "Clientes Master",
143
145
  description: `Visão consolidada de todos os clientes
144
146
  com análises comparativas e benchmarks
145
147
  entre diferentes organizações`
146
148
  },
147
- [Wt.BI_Dedicated_Customer_Agent]: {
149
+ [Ht.BI_Dedicated_Customer_Agent]: {
148
150
  name: "Cliente Único",
149
151
  description: `Foco em um cliente específico
150
152
  com análises detalhadas e personalizadas
151
153
  para sua organização`
152
154
  },
153
- [Wt.Unknown]: {
155
+ [Ht.Unknown]: {
154
156
  name: "Não definido",
155
157
  description: "Não definido"
156
158
  }
@@ -459,7 +461,7 @@ const Me = /* @__PURE__ */ p((s, t) => {
459
461
  return {
460
462
  text: t,
461
463
  eventType: c.Text,
462
- id: a ?? Ht(),
464
+ id: a ?? Wt(),
463
465
  created: /* @__PURE__ */ new Date(),
464
466
  author: i ?? "main",
465
467
  partial: !1,
@@ -475,7 +477,7 @@ const Me = /* @__PURE__ */ p((s, t) => {
475
477
  */
476
478
  static fromUserUi(t, i, a) {
477
479
  return {
478
- id: a ?? Ht(),
480
+ id: a ?? Wt(),
479
481
  eventType: c.UserAnswer,
480
482
  author: "user",
481
483
  created: /* @__PURE__ */ new Date(),
@@ -575,17 +577,17 @@ const C = {
575
577
  StreamingClientOutputContent: "StreamingClientOutputContent"
576
578
  };
577
579
  var Q;
578
- let At = (Q = class {
580
+ let Rt = (Q = class {
579
581
  constructor() {
580
582
  e(this, "label");
581
583
  }
582
584
  }, p(Q, "AuthorRole"), Q);
583
585
  n([
584
586
  o(String)
585
- ], At.prototype, "label", 2);
586
- At = n([
587
+ ], Rt.prototype, "label", 2);
588
+ Rt = n([
587
589
  g({ name: "AuthorRole" })
588
- ], At);
590
+ ], Rt);
589
591
  var J;
590
592
  let wt = (J = class {
591
593
  constructor() {
@@ -654,7 +656,7 @@ n([
654
656
  o(String)
655
657
  ], x.prototype, "modelId", 2);
656
658
  n([
657
- o(H)
659
+ o(W)
658
660
  ], x.prototype, "metadata", 2);
659
661
  x = n([
660
662
  g({ name: "KernelContent" })
@@ -783,7 +785,7 @@ n([
783
785
  o(String)
784
786
  ], v.prototype, "functionName", 2);
785
787
  n([
786
- o(H)
788
+ o(W)
787
789
  ], v.prototype, "arguments", 2);
788
790
  v = n([
789
791
  g({ name: "FunctionCallContent" })
@@ -862,13 +864,13 @@ n([
862
864
  o(String)
863
865
  ], N.prototype, "functionName", 2);
864
866
  n([
865
- o(H)
867
+ o(W)
866
868
  ], N.prototype, "result", 2);
867
869
  N = n([
868
870
  g({ name: "FunctionResultContent" })
869
871
  ], N);
870
872
  var at;
871
- let R = (at = class extends _ {
873
+ let A = (at = class extends _ {
872
874
  constructor() {
873
875
  super(...arguments);
874
876
  e(this, "id");
@@ -881,25 +883,25 @@ let R = (at = class extends _ {
881
883
  }, p(at, "StreamingFinalFunctionResultContent"), at);
882
884
  n([
883
885
  o(String, { name: "callId" })
884
- ], R.prototype, "id", 2);
886
+ ], A.prototype, "id", 2);
885
887
  n([
886
888
  o(String)
887
- ], R.prototype, "pluginName", 2);
889
+ ], A.prototype, "pluginName", 2);
888
890
  n([
889
891
  o(String)
890
- ], R.prototype, "functionName", 2);
892
+ ], A.prototype, "functionName", 2);
891
893
  n([
892
- o(H)
893
- ], R.prototype, "result", 2);
894
+ o(W)
895
+ ], A.prototype, "result", 2);
894
896
  n([
895
897
  o(k)
896
- ], R.prototype, "presentation", 2);
898
+ ], A.prototype, "presentation", 2);
897
899
  n([
898
- o(H)
899
- ], R.prototype, "clientOutput", 2);
900
- R = n([
900
+ o(W)
901
+ ], A.prototype, "clientOutput", 2);
902
+ A = n([
901
903
  g({ name: "StreamingFinalFunctionResultContent" })
902
- ], R);
904
+ ], A);
903
905
  var rt;
904
906
  let Ft = (rt = class extends x {
905
907
  constructor() {
@@ -912,7 +914,7 @@ n([
912
914
  o(String, { name: "callId" })
913
915
  ], Ft.prototype, "id", 2);
914
916
  n([
915
- o(H)
917
+ o(W)
916
918
  ], Ft.prototype, "data", 2);
917
919
  Ft = n([
918
920
  g({ name: "FunctionClientOutputContent" })
@@ -930,7 +932,7 @@ n([
930
932
  o(String, { name: "callId" })
931
933
  ], q.prototype, "id", 2);
932
934
  n([
933
- o(H)
935
+ o(W)
934
936
  ], q.prototype, "clientOutput", 2);
935
937
  n([
936
938
  o(k)
@@ -1035,7 +1037,7 @@ let kt = (dt = class extends x {
1035
1037
  }
1036
1038
  }, p(dt, "ChatMessageContent"), dt);
1037
1039
  n([
1038
- o(At)
1040
+ o(Rt)
1039
1041
  ], kt.prototype, "role", 2);
1040
1042
  n([
1041
1043
  L(() => x)
@@ -1114,7 +1116,7 @@ Mt = n([
1114
1116
  g({ name: "StreamingThoughtHighlightContent" })
1115
1117
  ], Mt);
1116
1118
  var ht;
1117
- let W = (ht = class {
1119
+ let H = (ht = class {
1118
1120
  constructor() {
1119
1121
  e(this, "instructionCategory", "");
1120
1122
  e(this, "description", "");
@@ -1123,16 +1125,16 @@ let W = (ht = class {
1123
1125
  }, p(ht, "InstructionSummary"), ht);
1124
1126
  n([
1125
1127
  o(String)
1126
- ], W.prototype, "instructionCategory", 2);
1128
+ ], H.prototype, "instructionCategory", 2);
1127
1129
  n([
1128
1130
  o(String)
1129
- ], W.prototype, "description", 2);
1131
+ ], H.prototype, "description", 2);
1130
1132
  n([
1131
1133
  o(String)
1132
- ], W.prototype, "interactionId", 2);
1133
- W = n([
1134
+ ], H.prototype, "interactionId", 2);
1135
+ H = n([
1134
1136
  g({ name: "InstructionSummary" })
1135
- ], W);
1137
+ ], H);
1136
1138
  var Ct;
1137
1139
  let Gt = (Ct = class {
1138
1140
  constructor() {
@@ -1188,7 +1190,7 @@ n([
1188
1190
  o(String)
1189
1191
  ], D.prototype, "id", 2);
1190
1192
  n([
1191
- L(W)
1193
+ L(H)
1192
1194
  ], D.prototype, "instructionSummaries", 2);
1193
1195
  n([
1194
1196
  o(Number)
@@ -1266,7 +1268,7 @@ n([
1266
1268
  o(String)
1267
1269
  ], S.prototype, "author", 2);
1268
1270
  n([
1269
- o(At)
1271
+ o(Rt)
1270
1272
  ], S.prototype, "role", 2);
1271
1273
  n([
1272
1274
  o(String)
@@ -1329,7 +1331,7 @@ I = n([
1329
1331
  g({ name: "PartialLlmEvent" })
1330
1332
  ], I);
1331
1333
  var _t;
1332
- let A = (_t = class {
1334
+ let R = (_t = class {
1333
1335
  constructor() {
1334
1336
  e(this, "interactionId");
1335
1337
  e(this, "content");
@@ -1341,25 +1343,25 @@ let A = (_t = class {
1341
1343
  }, p(_t, "InteractionStart"), _t);
1342
1344
  n([
1343
1345
  o(String)
1344
- ], A.prototype, "interactionId", 2);
1346
+ ], R.prototype, "interactionId", 2);
1345
1347
  n([
1346
1348
  o(String)
1347
- ], A.prototype, "content", 2);
1349
+ ], R.prototype, "content", 2);
1348
1350
  n([
1349
1351
  o(String)
1350
- ], A.prototype, "origin", 2);
1352
+ ], R.prototype, "origin", 2);
1351
1353
  n([
1352
1354
  o(String)
1353
- ], A.prototype, "agentId", 2);
1355
+ ], R.prototype, "agentId", 2);
1354
1356
  n([
1355
1357
  o(String)
1356
- ], A.prototype, "detachedRunId", 2);
1358
+ ], R.prototype, "detachedRunId", 2);
1357
1359
  n([
1358
1360
  L(String)
1359
- ], A.prototype, "queuedInteractionIds", 2);
1360
- A = n([
1361
+ ], R.prototype, "queuedInteractionIds", 2);
1362
+ R = n([
1361
1363
  g({ name: "InteractionStart" })
1362
- ], A);
1364
+ ], R);
1363
1365
  var Dt;
1364
1366
  let E = (Dt = class {
1365
1367
  constructor() {
@@ -1390,7 +1392,7 @@ n([
1390
1392
  o(I, { name: "pe" })
1391
1393
  ], E.prototype, "partialEvent", 2);
1392
1394
  n([
1393
- o(A)
1395
+ o(R)
1394
1396
  ], E.prototype, "interaction", 2);
1395
1397
  n([
1396
1398
  o(String)
@@ -1507,7 +1509,7 @@ const w = class w {
1507
1509
  return i.mimeType = t.mimeType, i.created = new Date(t.timestamp), i.eventType = c.NotDefined, i.partial = ((l = (r = t.partial) == null ? void 0 : r.toString()) == null ? void 0 : l.toLowerCase()) === "true", i.turn_complete = t.turnComplete, i.visible = t.visible, i.isFinalResponse = t.turnComplete ?? !1, i.artifactsDelta = [], t.artifactsGenerated && t.artifactsGenerated.length > 0 && (i.created = new Date(t.timestamp), i.llmArtifacts = t.artifactsGenerated), i.detachedRunId = t.detachedRunId, i.detachedRunName = t.detachedRunName, (u = t.agent) != null && u.personaId && ((f = t.agent) != null && f.role) && (i.agent = { personaId: t.agent.personaId, role: t.agent.role }), i;
1508
1510
  }
1509
1511
  static getPartType(t) {
1510
- return t instanceof vt ? "TextContent" : t instanceof v ? "FunctionCallContent" : t instanceof N ? "FunctionResultContent" : t instanceof b ? "StreamingFunctionCallUpdateContent" : t instanceof O ? "StreamingFinalFunctionCallContent" : t instanceof R ? "StreamingFinalFunctionResultContent" : t instanceof Ft ? "FunctionClientOutputContent" : t instanceof q ? "StreamingClientOutputContent" : t instanceof Et ? "UserUiContent" : t instanceof Nt ? "InteractionOriginContent" : t instanceof bt ? "QueuedMessageContent" : t instanceof Ut ? "StreamingTextContent" : t instanceof Pt ? "StreamingReasoningContent" : t instanceof Mt ? "StreamingThoughtHighlightContent" : t instanceof G ? "ToolEventContent" : t instanceof M ? "StreamingToolEventContent" : "Unknown";
1512
+ return t instanceof vt ? "TextContent" : t instanceof v ? "FunctionCallContent" : t instanceof N ? "FunctionResultContent" : t instanceof b ? "StreamingFunctionCallUpdateContent" : t instanceof O ? "StreamingFinalFunctionCallContent" : t instanceof A ? "StreamingFinalFunctionResultContent" : t instanceof Ft ? "FunctionClientOutputContent" : t instanceof q ? "StreamingClientOutputContent" : t instanceof Et ? "UserUiContent" : t instanceof Nt ? "InteractionOriginContent" : t instanceof bt ? "QueuedMessageContent" : t instanceof Ut ? "StreamingTextContent" : t instanceof Pt ? "StreamingReasoningContent" : t instanceof Mt ? "StreamingThoughtHighlightContent" : t instanceof G ? "ToolEventContent" : t instanceof M ? "StreamingToolEventContent" : "Unknown";
1511
1513
  }
1512
1514
  /** True when the event holds the SDK's "Server Error" sentinel call (`Event.GetErrorEvent`). */
1513
1515
  static carriesServerError(t) {
@@ -1552,12 +1554,12 @@ const w = class w {
1552
1554
  if (typeof r.result == "object")
1553
1555
  m = r.result;
1554
1556
  else if (typeof r.result == "string") {
1555
- const Rt = JSON.parse(r.result);
1556
- m = typeof Rt == "object" && Rt !== null ? Rt : r.result;
1557
+ const At = JSON.parse(r.result);
1558
+ m = typeof At == "object" && At !== null ? At : r.result;
1557
1559
  } else
1558
1560
  m = r.result;
1559
- } catch (Rt) {
1560
- console.warn("Parse function error", Rt), m = r == null ? void 0 : r.result;
1561
+ } catch (At) {
1562
+ console.warn("Parse function error", At), m = r == null ? void 0 : r.result;
1561
1563
  }
1562
1564
  d.thoughtDetails = {
1563
1565
  text: ""
@@ -1689,7 +1691,7 @@ const w = class w {
1689
1691
  // a part the UI cannot show. Only the demo's fake gateway builds
1690
1692
  // thoughts this way, which is why it went unnoticed.
1691
1693
  text: i,
1692
- id: Ht(),
1694
+ id: Wt(),
1693
1695
  created: /* @__PURE__ */ new Date(),
1694
1696
  eventType: c.Thought,
1695
1697
  author: "main",
@@ -1736,7 +1738,7 @@ const w = class w {
1736
1738
  thoughtDetails: a ? {
1737
1739
  text: a
1738
1740
  } : void 0,
1739
- id: Ht(),
1741
+ id: Wt(),
1740
1742
  created: /* @__PURE__ */ new Date(),
1741
1743
  // Part eventType MUST match the outer event's eventType.
1742
1744
  // Was previously `Thought` here, which made the merger
@@ -1778,9 +1780,9 @@ const te = [
1778
1780
  Mt,
1779
1781
  M,
1780
1782
  O,
1781
- R,
1783
+ A,
1782
1784
  q,
1783
- W
1785
+ H
1784
1786
  ];
1785
1787
  function me(s) {
1786
1788
  return s.name;
@@ -1880,10 +1882,10 @@ function qe(s) {
1880
1882
  return oe().parse(t);
1881
1883
  }
1882
1884
  p(qe, "deserializeEvent");
1883
- function We(s) {
1885
+ function He(s) {
1884
1886
  return oe().stringify(s);
1885
1887
  }
1886
- p(We, "serializeEvent");
1888
+ p(He, "serializeEvent");
1887
1889
  export {
1888
1890
  Ne as A,
1889
1891
  F as B,
@@ -1896,19 +1898,19 @@ export {
1896
1898
  Ue as M,
1897
1899
  C as P,
1898
1900
  bt as Q,
1899
- Re as R,
1901
+ Ae as R,
1900
1902
  Xt as S,
1901
1903
  vt as T,
1902
1904
  Oe as a,
1903
- Wt as b,
1905
+ Ht as b,
1904
1906
  ve as c,
1905
- Ae as d,
1907
+ Re as d,
1906
1908
  we as e,
1907
1909
  kt as f,
1908
1910
  ke as g,
1909
1911
  N as h,
1910
1912
  Bt as i,
1911
- A as j,
1913
+ R as j,
1912
1914
  T as k,
1913
1915
  Fe as l,
1914
1916
  be as m,
@@ -1923,7 +1925,7 @@ export {
1923
1925
  Me as v,
1924
1926
  Pe as w,
1925
1927
  ie as x,
1926
- We as y,
1928
+ He as y,
1927
1929
  Ie as z
1928
1930
  };
1929
- //# sourceMappingURL=serializer-DvfyE4_t.js.map
1931
+ //# sourceMappingURL=serializer-CdIQS0hy.js.map