@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/README.md +23 -46
- package/dist/app/index.d.mts +9 -25
- package/dist/app/index.d.ts +9 -25
- package/dist/app/index.js +95 -403
- package/dist/app/index.js.map +1 -1
- package/dist/app/index.mjs +95 -403
- package/dist/app/index.mjs.map +1 -1
- package/dist/index.d.mts +9 -25
- package/dist/index.d.ts +9 -25
- package/dist/index.js +95 -403
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +95 -403
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +9 -25
- package/dist/react/index.d.ts +9 -25
- package/dist/react/index.js +95 -403
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +95 -403
- package/dist/react/index.mjs.map +1 -1
- package/dist/react-embed/index.js +95 -403
- package/dist/react-embed/index.js.map +1 -1
- package/dist/react-embed/index.mjs +95 -403
- package/dist/react-embed/index.mjs.map +1 -1
- package/dist/react-native/index.d.mts +9 -25
- package/dist/react-native/index.d.ts +9 -25
- package/dist/react-native/index.js +95 -403
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/index.mjs +95 -403
- package/dist/react-native/index.mjs.map +1 -1
- package/package.json +3 -6
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
|
|
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
|
|
433
|
-
* -
|
|
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
|
|
606
|
-
* 2. Stream
|
|
607
|
-
* 3. If
|
|
608
|
-
* 4.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
433
|
-
* -
|
|
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
|
|
606
|
-
* 2. Stream
|
|
607
|
-
* 3. If
|
|
608
|
-
* 4.
|
|
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
|
|
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
|
|
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;
|