@windmill-labs/chat-sdk 1.848.3 → 1.850.0

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/README.md CHANGED
@@ -244,6 +244,7 @@ interface ChatState {
244
244
  history: 'server' | 'local' | 'none'
245
245
  loadingMessages: boolean
246
246
  hasMoreMessages: boolean
247
+ runningJobId?: string // the flow job the running turn follows
247
248
  }
248
249
 
249
250
  interface ChatMessage {
@@ -610,6 +610,7 @@ var ChatImpl = class {
610
610
  };
611
611
  async function _followTurn(turn, isNew) {
612
612
  let nextTurn;
613
+ _assertClassBrand(_ChatImpl_brand, this, _set).call(this, { runningJobId: turn.jobId });
613
614
  try {
614
615
  const stopPolling = _classPrivateFieldGet2(_state, this).history === "server" ? _assertClassBrand(_ChatImpl_brand, this, _startPolling).call(this, turn) : () => {};
615
616
  let result;
@@ -629,6 +630,7 @@ async function _followTurn(turn, isNew) {
629
630
  _assertClassBrand(_ChatImpl_brand, this, _failTurn).call(this, turn, e);
630
631
  } finally {
631
632
  if (_classPrivateFieldGet2(_turn, this) === turn) _classPrivateFieldSet2(_turn, this, void 0);
633
+ if (_classPrivateFieldGet2(_state, this).runningJobId === turn.jobId) _assertClassBrand(_ChatImpl_brand, this, _set).call(this, { runningJobId: void 0 });
632
634
  }
633
635
  if (nextTurn) await this.resumeTurn(nextTurn);
634
636
  }
@@ -610,6 +610,7 @@ var ChatImpl = class {
610
610
  };
611
611
  async function _followTurn(turn, isNew) {
612
612
  let nextTurn;
613
+ require_follow._assertClassBrand(_ChatImpl_brand, this, _set).call(this, { runningJobId: turn.jobId });
613
614
  try {
614
615
  const stopPolling = require_follow._classPrivateFieldGet2(_state, this).history === "server" ? require_follow._assertClassBrand(_ChatImpl_brand, this, _startPolling).call(this, turn) : () => {};
615
616
  let result;
@@ -629,6 +630,7 @@ async function _followTurn(turn, isNew) {
629
630
  require_follow._assertClassBrand(_ChatImpl_brand, this, _failTurn).call(this, turn, e);
630
631
  } finally {
631
632
  if (require_follow._classPrivateFieldGet2(_turn, this) === turn) require_follow._classPrivateFieldSet2(_turn, this, void 0);
633
+ if (require_follow._classPrivateFieldGet2(_state, this).runningJobId === turn.jobId) require_follow._assertClassBrand(_ChatImpl_brand, this, _set).call(this, { runningJobId: void 0 });
632
634
  }
633
635
  if (nextTurn) await this.resumeTurn(nextTurn);
634
636
  }
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_follow = require("./follow-Dug-Afeu.cjs");
3
- const require_chat = require("./chat-C0iOSX6H.cjs");
3
+ const require_chat = require("./chat-DjAH5NVm.cjs");
4
4
  exports.CHAT_UPLOADS_PREFIX = require_chat.CHAT_UPLOADS_PREFIX;
5
5
  exports.TurnRunningError = require_follow.TurnRunningError;
6
6
  exports.WindmillApiError = require_follow.WindmillApiError;
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { _ as WindmillApiError, b as turnRunningError, g as TurnRunningError, h as parseStreamEvents, m as createStreamEventParser, o as extractChatAnswer, r as conversationIdFor, t as followJob, v as WindmillChatApi, y as readServerSentEvents } from "./follow-DXfmfPfr.js";
2
- import { a as detectRawApp, i as uploadAttachments, n as CHAT_UPLOADS_PREFIX, r as storedAttachmentName, t as createChat } from "./chat-DjonfE4j.js";
2
+ import { a as detectRawApp, i as uploadAttachments, n as CHAT_UPLOADS_PREFIX, r as storedAttachmentName, t as createChat } from "./chat-C-qFO-jT.js";
3
3
  export { CHAT_UPLOADS_PREFIX, TurnRunningError, WindmillApiError, WindmillChatApi, conversationIdFor, createChat, createStreamEventParser, detectRawApp, extractChatAnswer, followJob, parseStreamEvents, readServerSentEvents, storedAttachmentName, turnRunningError, uploadAttachments };
package/dist/react.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_chat = require("./chat-C0iOSX6H.cjs");
2
+ const require_chat = require("./chat-DjAH5NVm.cjs");
3
3
  let react = require("react");
4
4
  //#region src/react.ts
5
5
  /**
package/dist/react.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createChat } from "./chat-DjonfE4j.js";
1
+ import { t as createChat } from "./chat-C-qFO-jT.js";
2
2
  import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
3
3
  //#region src/react.ts
4
4
  /**
package/dist/types.d.ts CHANGED
@@ -77,6 +77,8 @@ export interface ChatState {
77
77
  history: HistoryMode;
78
78
  loadingMessages: boolean;
79
79
  hasMoreMessages: boolean;
80
+ /** The flow job the running turn follows, once it is known. */
81
+ runningJobId?: string;
80
82
  }
81
83
  export type TokenSource = string | (() => string | Promise<string>);
82
84
  export type StorageLike = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@windmill-labs/chat-sdk",
3
3
  "description": "Build chat interfaces on Windmill flows deployed in chat mode, from any frontend or raw app",
4
- "version": "1.848.3",
4
+ "version": "1.850.0",
5
5
  "author": "Ruben Fiszel",
6
6
  "license": "Apache-2.0",
7
7
  "homepage": "https://github.com/windmill-labs/windmill/tree/main/chat-sdk#readme",