@mcpstack/agent-sdk 1.0.0-pr.18.bbb0c016bc21.17.1 → 1.0.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.
@@ -109,7 +109,7 @@ interface McpStackAgentConfig {
109
109
  oauthClientMetadataUrl?: string;
110
110
  /**
111
111
  * Callback to get the auth token for MCP Stack API requests.
112
- * If provided, called before each agent run request.
112
+ * If provided, called before each chat API request.
113
113
  * Use this when your session token may expire and needs refresh (e.g., dashboard playground).
114
114
  * If not provided, uses the static `apiKey` value.
115
115
  */
@@ -574,9 +574,8 @@ type EventHandler<T> = (data: T) => void;
574
574
  * Framework-agnostic — works in any JavaScript environment.
575
575
  *
576
576
  * Handles:
577
- * - Communication with the MCP Stack AG-UI run endpoint (SSE streaming)
578
- * - AG-UI frontend tool execution via configured clientTools
579
- * - MCP server auth/session helpers for legacy and explicit auth flows
577
+ * - Communication with the MCP Stack chat API (SSE streaming)
578
+ * - Tool execution via MCP server (browser-side, with user's auth token)
580
579
  * - Conversation state management
581
580
  * - Event emission for UI updates
582
581
  */
@@ -643,11 +642,6 @@ declare class McpStackAgent {
643
642
  submitFeedback(input: SubmitConversationFeedbackRequest): Promise<ConversationFeedback>;
644
643
  /** Convert client tools to the API schema format. */
645
644
  private clientToolsToSchemas;
646
- private clientToolsToAgUiTools;
647
- private buildAgUiContext;
648
- private buildAgUiForwardedProps;
649
- private buildAgUiUserRunInput;
650
- private buildAgUiToolResultRunInput;
651
645
  private resolveExternalUserId;
652
646
  private buildExternalUserContext;
653
647
  /** Latest runtime budget snapshot for the current SDK identity. */
@@ -747,28 +741,18 @@ declare class McpStackAgent {
747
741
  private resolveToken;
748
742
  /**
749
743
  * The core orchestration loop:
750
- * 1. Send message to the AG-UI run endpoint
751
- * 2. Stream assistant text, server MCP tool progress, and frontend tool requests
752
- * 3. If an AG-UI frontend tool is requested, execute the matching clientTool locally
753
- * 4. Send the frontend tool result back as an AG-UI tool message and continue
744
+ * 1. Send message to chat API
745
+ * 2. Stream response
746
+ * 3. If tool_call execute tool via MCP send result continue
747
+ * 4. If message_end done
754
748
  */
755
749
  private runChatLoop;
756
- private executeClientTool;
757
- private callAgUiApi;
758
- private processAgUiStream;
759
- private recordToolResult;
760
- private recordToolError;
761
- private serializeToolContent;
762
- private parseToolContent;
763
- private parseToolArguments;
764
- private getRecordField;
765
- private getStringField;
766
- private getNumberField;
750
+ private callChatApi;
767
751
  private fetchConversationMessages;
768
752
  private applyConversationPage;
769
753
  private mapReplayMessage;
770
754
  /**
771
- * Process a legacy chat SSE stream.
755
+ * Process an SSE stream from the chat API.
772
756
  * Returns when the stream ends (either message_end or tool_call).
773
757
  */
774
758
  private processSseStream;
@@ -109,7 +109,7 @@ interface McpStackAgentConfig {
109
109
  oauthClientMetadataUrl?: string;
110
110
  /**
111
111
  * Callback to get the auth token for MCP Stack API requests.
112
- * If provided, called before each agent run request.
112
+ * If provided, called before each chat API request.
113
113
  * Use this when your session token may expire and needs refresh (e.g., dashboard playground).
114
114
  * If not provided, uses the static `apiKey` value.
115
115
  */
@@ -574,9 +574,8 @@ type EventHandler<T> = (data: T) => void;
574
574
  * Framework-agnostic — works in any JavaScript environment.
575
575
  *
576
576
  * Handles:
577
- * - Communication with the MCP Stack AG-UI run endpoint (SSE streaming)
578
- * - AG-UI frontend tool execution via configured clientTools
579
- * - MCP server auth/session helpers for legacy and explicit auth flows
577
+ * - Communication with the MCP Stack chat API (SSE streaming)
578
+ * - Tool execution via MCP server (browser-side, with user's auth token)
580
579
  * - Conversation state management
581
580
  * - Event emission for UI updates
582
581
  */
@@ -643,11 +642,6 @@ declare class McpStackAgent {
643
642
  submitFeedback(input: SubmitConversationFeedbackRequest): Promise<ConversationFeedback>;
644
643
  /** Convert client tools to the API schema format. */
645
644
  private clientToolsToSchemas;
646
- private clientToolsToAgUiTools;
647
- private buildAgUiContext;
648
- private buildAgUiForwardedProps;
649
- private buildAgUiUserRunInput;
650
- private buildAgUiToolResultRunInput;
651
645
  private resolveExternalUserId;
652
646
  private buildExternalUserContext;
653
647
  /** Latest runtime budget snapshot for the current SDK identity. */
@@ -747,28 +741,18 @@ declare class McpStackAgent {
747
741
  private resolveToken;
748
742
  /**
749
743
  * The core orchestration loop:
750
- * 1. Send message to the AG-UI run endpoint
751
- * 2. Stream assistant text, server MCP tool progress, and frontend tool requests
752
- * 3. If an AG-UI frontend tool is requested, execute the matching clientTool locally
753
- * 4. Send the frontend tool result back as an AG-UI tool message and continue
744
+ * 1. Send message to chat API
745
+ * 2. Stream response
746
+ * 3. If tool_call execute tool via MCP send result continue
747
+ * 4. If message_end done
754
748
  */
755
749
  private runChatLoop;
756
- private executeClientTool;
757
- private callAgUiApi;
758
- private processAgUiStream;
759
- private recordToolResult;
760
- private recordToolError;
761
- private serializeToolContent;
762
- private parseToolContent;
763
- private parseToolArguments;
764
- private getRecordField;
765
- private getStringField;
766
- private getNumberField;
750
+ private callChatApi;
767
751
  private fetchConversationMessages;
768
752
  private applyConversationPage;
769
753
  private mapReplayMessage;
770
754
  /**
771
- * Process a legacy chat SSE stream.
755
+ * Process an SSE stream from the chat API.
772
756
  * Returns when the stream ends (either message_end or tool_call).
773
757
  */
774
758
  private processSseStream;