@asgard-js/core 0.2.40 → 0.2.41-canary.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.
package/dist/index.mjs CHANGED
@@ -1760,6 +1760,11 @@ class z {
1760
1760
  statesObserver;
1761
1761
  statesSubscription;
1762
1762
  currentUserMessageId;
1763
+ // The most-recently-sent user message id. Unlike currentUserMessageId (which
1764
+ // is cleared once a traceId is attached), this is kept across the SSE
1765
+ // lifecycle so RESPONSE_TOOL_CALL_CONSENT — fired after run.done — can echo
1766
+ // back the message id the bot is waiting on.
1767
+ lastSentMessageId;
1763
1768
  constructor(e) {
1764
1769
  if (!e.client)
1765
1770
  throw new Error("client must be required");
@@ -1838,7 +1843,7 @@ class z {
1838
1843
  }
1839
1844
  sendMessage(e, t) {
1840
1845
  const r = e.text.trim(), o = e.customMessageId ?? ke();
1841
- return this.currentUserMessageId = o, this.conversation$.next(
1846
+ return this.currentUserMessageId = o, this.lastSentMessageId = o, this.conversation$.next(
1842
1847
  this.conversation$.value.pushMessage({
1843
1848
  type: "user",
1844
1849
  messageId: o,
@@ -1865,7 +1870,7 @@ class z {
1865
1870
  {
1866
1871
  action: $.RESPONSE_TOOL_CALL_CONSENT,
1867
1872
  customChannelId: this.customChannelId,
1868
- customMessageId: this.customMessageId,
1873
+ customMessageId: this.lastSentMessageId ?? this.customMessageId,
1869
1874
  text: "",
1870
1875
  toolCallConsents: e
1871
1876
  },