@copilotkit/react-core 1.8.12-next.5 → 1.8.12-next.6

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.js CHANGED
@@ -1711,12 +1711,14 @@ function useChat(options) {
1711
1711
  agentSession: agentSessionRef.current
1712
1712
  } : {}), {
1713
1713
  agentStates: Object.values(coagentStatesRef.current).map((state) => {
1714
- var _a2;
1715
- return {
1714
+ const stateObject = {
1716
1715
  agentName: state.name,
1717
- state: JSON.stringify(state.state),
1718
- config: JSON.stringify((_a2 = state.config) != null ? _a2 : {})
1716
+ state: JSON.stringify(state.state)
1719
1717
  };
1718
+ if (state.config !== void 0) {
1719
+ stateObject.config = JSON.stringify(state.config);
1720
+ }
1721
+ return stateObject;
1720
1722
  }),
1721
1723
  forwardedParameters: options.forwardedParameters || {}
1722
1724
  }),
@@ -1861,7 +1863,7 @@ function useChat(options) {
1861
1863
  const message = finalMessages[i];
1862
1864
  if ((message.isActionExecutionMessage() || message.isResultMessage()) && message.status.code !== import_runtime_client_gql6.MessageStatusCode.Pending) {
1863
1865
  lastMessages.unshift(message);
1864
- } else {
1866
+ } else if (!message.isAgentStateMessage()) {
1865
1867
  break;
1866
1868
  }
1867
1869
  }