@syntrologie/adapt-chatbot 2.8.0-canary.369 → 2.8.0-canary.370

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.
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  AdaptiveChatBar
3
3
  } from "./chunk-LY2A6P2P.js";
4
- import "./chunk-ZJEGTXAF.js";
5
- import "./chunk-ONGGPQER.js";
4
+ import "./chunk-Y7QBXHQE.js";
5
+ import "./chunk-5PW6T3QF.js";
6
6
  import "./chunk-UVKRO5ER.js";
7
7
  export {
8
8
  AdaptiveChatBar
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  AdaptiveChatTrail,
3
3
  looksLikeSerializedModelResponse
4
- } from "./chunk-ZJEGTXAF.js";
5
- import "./chunk-ONGGPQER.js";
4
+ } from "./chunk-Y7QBXHQE.js";
5
+ import "./chunk-5PW6T3QF.js";
6
6
  import "./chunk-UVKRO5ER.js";
7
7
  export {
8
8
  AdaptiveChatTrail,
@@ -1 +1 @@
1
- {"version":3,"file":"ChatAssistantLit.d.ts","sourceRoot":"","sources":["../src/ChatAssistantLit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,OAAO,mBAAmB,CAAC;AAa3B,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8CD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,GAAG,MAAM,CAiEhF;AAED,eAAO,MAAM,yBAAyB;qBACnB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CA+bpE,CAAC"}
1
+ {"version":3,"file":"ChatAssistantLit.d.ts","sourceRoot":"","sources":["../src/ChatAssistantLit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,OAAO,mBAAmB,CAAC;AAa3B,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8CD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,GAAG,MAAM,CAiEhF;AAED,eAAO,MAAM,yBAAyB;qBACnB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAydpE,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  ChatAssistantLitMountable,
3
3
  renderFallbackHtml
4
- } from "./chunk-JMP4WEJR.js";
5
- import "./chunk-ONGGPQER.js";
4
+ } from "./chunk-355KO54Z.js";
5
+ import "./chunk-5PW6T3QF.js";
6
6
  import "./chunk-VLJ3WOEX.js";
7
7
  import "./chunk-UVKRO5ER.js";
8
8
  export {
@@ -7717,7 +7717,8 @@ var AgUiTransport = class {
7717
7717
  },
7718
7718
  onRunErrorEvent: (params) => {
7719
7719
  const { event } = params;
7720
- this._emit({ type: "error", message: event.message });
7720
+ const code = typeof event.code === "string" ? event.code : void 0;
7721
+ this._emit({ type: "error", message: event.message, ...code ? { code } : {} });
7721
7722
  this._emit({ type: "typing", isTyping: false });
7722
7723
  },
7723
7724
  onCustomEvent: (params) => {
@@ -8706,6 +8707,19 @@ var ChatAssistantLitMountable = {
8706
8707
  debug("transport event", { type: event.type, hasSucceeded, fallbackRendered });
8707
8708
  if (event.type === "error") {
8708
8709
  const errEvent = event;
8710
+ if (errEvent.code === "USAGE_LIMIT") {
8711
+ runtime.events.publish("chatbot.usage_limit_exhausted", {
8712
+ tileId: resolvedTileId,
8713
+ mountId,
8714
+ mountAgeMs: mountAgeMs(),
8715
+ messagesSentBeforeExhaust: messagesSent
8716
+ });
8717
+ if (!hasSucceeded) {
8718
+ hasSucceeded = true;
8719
+ debug("hasSucceeded transitioned to true via USAGE_LIMIT");
8720
+ }
8721
+ return;
8722
+ }
8709
8723
  lastErrorPayload = {
8710
8724
  message: errEvent.message,
8711
8725
  status: errEvent.status ?? null,
@@ -8838,4 +8852,4 @@ fast-json-patch/module/duplex.mjs:
8838
8852
  * MIT license
8839
8853
  *)
8840
8854
  */
8841
- //# sourceMappingURL=chunk-JMP4WEJR.js.map
8855
+ //# sourceMappingURL=chunk-355KO54Z.js.map