@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.
package/dist/index.d.mts CHANGED
@@ -106,7 +106,7 @@ interface McpStackAgentConfig {
106
106
  oauthClientMetadataUrl?: string;
107
107
  /**
108
108
  * Callback to get the auth token for MCP Stack API requests.
109
- * If provided, called before each agent run request.
109
+ * If provided, called before each chat API request.
110
110
  * Use this when your session token may expire and needs refresh (e.g., dashboard playground).
111
111
  * If not provided, uses the static `apiKey` value.
112
112
  */
@@ -429,9 +429,8 @@ type EventHandler<T> = (data: T) => void;
429
429
  * Framework-agnostic — works in any JavaScript environment.
430
430
  *
431
431
  * Handles:
432
- * - Communication with the MCP Stack AG-UI run endpoint (SSE streaming)
433
- * - AG-UI frontend tool execution via configured clientTools
434
- * - MCP server auth/session helpers for legacy and explicit auth flows
432
+ * - Communication with the MCP Stack chat API (SSE streaming)
433
+ * - Tool execution via MCP server (browser-side, with user's auth token)
435
434
  * - Conversation state management
436
435
  * - Event emission for UI updates
437
436
  */
@@ -498,11 +497,6 @@ declare class McpStackAgent {
498
497
  submitFeedback(input: SubmitConversationFeedbackRequest): Promise<ConversationFeedback>;
499
498
  /** Convert client tools to the API schema format. */
500
499
  private clientToolsToSchemas;
501
- private clientToolsToAgUiTools;
502
- private buildAgUiContext;
503
- private buildAgUiForwardedProps;
504
- private buildAgUiUserRunInput;
505
- private buildAgUiToolResultRunInput;
506
500
  private resolveExternalUserId;
507
501
  private buildExternalUserContext;
508
502
  /** Latest runtime budget snapshot for the current SDK identity. */
@@ -602,28 +596,18 @@ declare class McpStackAgent {
602
596
  private resolveToken;
603
597
  /**
604
598
  * The core orchestration loop:
605
- * 1. Send message to the AG-UI run endpoint
606
- * 2. Stream assistant text, server MCP tool progress, and frontend tool requests
607
- * 3. If an AG-UI frontend tool is requested, execute the matching clientTool locally
608
- * 4. Send the frontend tool result back as an AG-UI tool message and continue
599
+ * 1. Send message to chat API
600
+ * 2. Stream response
601
+ * 3. If tool_call execute tool via MCP send result continue
602
+ * 4. If message_end done
609
603
  */
610
604
  private runChatLoop;
611
- private executeClientTool;
612
- private callAgUiApi;
613
- private processAgUiStream;
614
- private recordToolResult;
615
- private recordToolError;
616
- private serializeToolContent;
617
- private parseToolContent;
618
- private parseToolArguments;
619
- private getRecordField;
620
- private getStringField;
621
- private getNumberField;
605
+ private callChatApi;
622
606
  private fetchConversationMessages;
623
607
  private applyConversationPage;
624
608
  private mapReplayMessage;
625
609
  /**
626
- * Process a legacy chat SSE stream.
610
+ * Process an SSE stream from the chat API.
627
611
  * Returns when the stream ends (either message_end or tool_call).
628
612
  */
629
613
  private processSseStream;
package/dist/index.d.ts CHANGED
@@ -106,7 +106,7 @@ interface McpStackAgentConfig {
106
106
  oauthClientMetadataUrl?: string;
107
107
  /**
108
108
  * Callback to get the auth token for MCP Stack API requests.
109
- * If provided, called before each agent run request.
109
+ * If provided, called before each chat API request.
110
110
  * Use this when your session token may expire and needs refresh (e.g., dashboard playground).
111
111
  * If not provided, uses the static `apiKey` value.
112
112
  */
@@ -429,9 +429,8 @@ type EventHandler<T> = (data: T) => void;
429
429
  * Framework-agnostic — works in any JavaScript environment.
430
430
  *
431
431
  * Handles:
432
- * - Communication with the MCP Stack AG-UI run endpoint (SSE streaming)
433
- * - AG-UI frontend tool execution via configured clientTools
434
- * - MCP server auth/session helpers for legacy and explicit auth flows
432
+ * - Communication with the MCP Stack chat API (SSE streaming)
433
+ * - Tool execution via MCP server (browser-side, with user's auth token)
435
434
  * - Conversation state management
436
435
  * - Event emission for UI updates
437
436
  */
@@ -498,11 +497,6 @@ declare class McpStackAgent {
498
497
  submitFeedback(input: SubmitConversationFeedbackRequest): Promise<ConversationFeedback>;
499
498
  /** Convert client tools to the API schema format. */
500
499
  private clientToolsToSchemas;
501
- private clientToolsToAgUiTools;
502
- private buildAgUiContext;
503
- private buildAgUiForwardedProps;
504
- private buildAgUiUserRunInput;
505
- private buildAgUiToolResultRunInput;
506
500
  private resolveExternalUserId;
507
501
  private buildExternalUserContext;
508
502
  /** Latest runtime budget snapshot for the current SDK identity. */
@@ -602,28 +596,18 @@ declare class McpStackAgent {
602
596
  private resolveToken;
603
597
  /**
604
598
  * The core orchestration loop:
605
- * 1. Send message to the AG-UI run endpoint
606
- * 2. Stream assistant text, server MCP tool progress, and frontend tool requests
607
- * 3. If an AG-UI frontend tool is requested, execute the matching clientTool locally
608
- * 4. Send the frontend tool result back as an AG-UI tool message and continue
599
+ * 1. Send message to chat API
600
+ * 2. Stream response
601
+ * 3. If tool_call execute tool via MCP send result continue
602
+ * 4. If message_end done
609
603
  */
610
604
  private runChatLoop;
611
- private executeClientTool;
612
- private callAgUiApi;
613
- private processAgUiStream;
614
- private recordToolResult;
615
- private recordToolError;
616
- private serializeToolContent;
617
- private parseToolContent;
618
- private parseToolArguments;
619
- private getRecordField;
620
- private getStringField;
621
- private getNumberField;
605
+ private callChatApi;
622
606
  private fetchConversationMessages;
623
607
  private applyConversationPage;
624
608
  private mapReplayMessage;
625
609
  /**
626
- * Process a legacy chat SSE stream.
610
+ * Process an SSE stream from the chat API.
627
611
  * Returns when the stream ends (either message_end or tool_call).
628
612
  */
629
613
  private processSseStream;