@base44-preview/sdk 0.8.52-pr.299.9f7108e → 0.8.52-pr.301.106bb9e
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/client.js +0 -2
- package/dist/client.types.d.ts +0 -3
- package/dist/index.d.ts +0 -1
- package/package.json +4 -22
- package/dist/modules/mcp.d.ts +0 -11
- package/dist/modules/mcp.js +0 -20
- package/dist/modules/mcp.types.d.ts +0 -101
- package/dist/modules/mcp.types.js +0 -1
package/dist/client.js
CHANGED
|
@@ -11,7 +11,6 @@ import { createAgentsModule } from "./modules/agents.js";
|
|
|
11
11
|
import { createAiGatewayModule } from "./modules/ai-gateway.js";
|
|
12
12
|
import { createAppLogsModule } from "./modules/app-logs.js";
|
|
13
13
|
import { createAppModule } from "./modules/app.js";
|
|
14
|
-
import { createMcpModule } from "./modules/mcp.js";
|
|
15
14
|
import { createUsersModule } from "./modules/users.js";
|
|
16
15
|
import { RoomsSocket } from "./utils/socket-utils.js";
|
|
17
16
|
import { createAnalyticsModule } from "./modules/analytics.js";
|
|
@@ -202,7 +201,6 @@ export function createClient(config) {
|
|
|
202
201
|
}),
|
|
203
202
|
appLogs: createAppLogsModule(axiosClient, appId),
|
|
204
203
|
app: createAppModule(axiosClient, appId),
|
|
205
|
-
mcp: createMcpModule(axiosClient, appId),
|
|
206
204
|
users: createUsersModule(axiosClient, appId),
|
|
207
205
|
analytics: createAnalyticsModule({
|
|
208
206
|
axiosClient,
|
package/dist/client.types.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import type { AgentsModule } from "./modules/agents.types.js";
|
|
|
8
8
|
import type { AiGatewayModule } from "./modules/ai-gateway.types.js";
|
|
9
9
|
import type { AppLogsModule } from "./modules/app-logs.types.js";
|
|
10
10
|
import type { AppModule } from "./modules/app.types.js";
|
|
11
|
-
import type { McpModule } from "./modules/mcp.types.js";
|
|
12
11
|
import type { AnalyticsModule } from "./modules/analytics.types.js";
|
|
13
12
|
import type { ActorsModule } from "./modules/actors.types.js";
|
|
14
13
|
import type { FetchWithAuthInit } from "./utils/fetch-with-auth.js";
|
|
@@ -139,8 +138,6 @@ export interface Base44Client {
|
|
|
139
138
|
functions: FunctionsModule;
|
|
140
139
|
/** {@link IntegrationsModule | Integrations module} for calling pre-built integration endpoints. */
|
|
141
140
|
integrations: IntegrationsModule;
|
|
142
|
-
/** {@link McpModule | MCP module} for the app's MCP consent page. */
|
|
143
|
-
mcp: McpModule;
|
|
144
141
|
/** Cleanup function to disconnect WebSocket connections. Call when you're done with the client. */
|
|
145
142
|
cleanup: () => void;
|
|
146
143
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export type { AgentsModule, AgentName, AgentNameRegistry, AgentConversation, Age
|
|
|
12
12
|
export type { AiGatewayModule, AiGatewayConnection, AiGatewayConnectionOptions, } from "./modules/ai-gateway.types.js";
|
|
13
13
|
export type { AppLogsModule } from "./modules/app-logs.types.js";
|
|
14
14
|
export type { AppModule, AppPublicSettings, AppPublicSettingsResponse, } from "./modules/app.types.js";
|
|
15
|
-
export type { McpModule, McpConsentInfo, McpConsentTool, McpConsentAction, McpAuthorizeGrantResponse, } from "./modules/mcp.types.js";
|
|
16
15
|
export type { ActorsModule, ActorClient, ActorRef, Connection, ActorSubscription, ActorConnectOptions, ActorNameRegistry, ActorRegistry, } from "./modules/actors.types.js";
|
|
17
16
|
export type { SsoModule, SsoAccessTokenResponse } from "./modules/sso.types.js";
|
|
18
17
|
export { Actor, type Conn } from "./actor.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@base44-preview/sdk",
|
|
3
|
-
"version": "0.8.52-pr.
|
|
3
|
+
"version": "0.8.52-pr.301.106bb9e",
|
|
4
4
|
"description": "JavaScript SDK for Base44 API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc",
|
|
13
|
-
"lint": "eslint src",
|
|
14
13
|
"test": "npm run test:types && vitest run",
|
|
15
14
|
"test:types": "tsc --noEmit -p tsconfig.type-tests.json",
|
|
16
15
|
"test:unit": "vitest run tests/unit",
|
|
@@ -31,24 +30,6 @@
|
|
|
31
30
|
"socket.io-client": "^4.8.3",
|
|
32
31
|
"uuid": "^13.0.2"
|
|
33
32
|
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"@types/hast": "^3.0.4",
|
|
36
|
-
"@types/node": "^25.0.1",
|
|
37
|
-
"@types/unist": "^3.0.3",
|
|
38
|
-
"@typescript-eslint/parser": "^8.51.0",
|
|
39
|
-
"@vitest/coverage-istanbul": "^4.1.9",
|
|
40
|
-
"@vitest/coverage-v8": "^4.1.9",
|
|
41
|
-
"@vitest/ui": "^4.1.9",
|
|
42
|
-
"dotenv": "^16.3.1",
|
|
43
|
-
"eslint": "^9.39.2",
|
|
44
|
-
"eslint-plugin-import": "^2.32.0",
|
|
45
|
-
"nock": "^13.4.0",
|
|
46
|
-
"typedoc": "^0.28.14",
|
|
47
|
-
"typedoc-plugin-markdown": "^4.9.0",
|
|
48
|
-
"typescript": "^5.3.2",
|
|
49
|
-
"typescript-eslint": "^8.51.0",
|
|
50
|
-
"vitest": "^4.1.9"
|
|
51
|
-
},
|
|
52
33
|
"keywords": [
|
|
53
34
|
"base44",
|
|
54
35
|
"api",
|
|
@@ -58,10 +39,11 @@
|
|
|
58
39
|
"license": "MIT",
|
|
59
40
|
"repository": {
|
|
60
41
|
"type": "git",
|
|
61
|
-
"url": "git+https://github.com/base44/javascript-sdk.git"
|
|
42
|
+
"url": "git+https://github.com/base44/javascript-sdk.git",
|
|
43
|
+
"directory": "packages/sdk"
|
|
62
44
|
},
|
|
63
45
|
"bugs": {
|
|
64
46
|
"url": "https://github.com/base44/javascript-sdk/issues"
|
|
65
47
|
},
|
|
66
|
-
"homepage": "https://github.com/base44/javascript-sdk#readme"
|
|
48
|
+
"homepage": "https://github.com/base44/javascript-sdk/tree/main/packages/sdk#readme"
|
|
67
49
|
}
|
package/dist/modules/mcp.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance } from "axios";
|
|
2
|
-
import { McpModule } from "./mcp.types";
|
|
3
|
-
/**
|
|
4
|
-
* Creates the MCP module for the Base44 SDK.
|
|
5
|
-
*
|
|
6
|
-
* @param axios - Axios instance
|
|
7
|
-
* @param appId - Application ID
|
|
8
|
-
* @returns MCP module for the app's MCP consent page
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare function createMcpModule(axios: AxiosInstance, appId: string): McpModule;
|
package/dist/modules/mcp.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates the MCP module for the Base44 SDK.
|
|
3
|
-
*
|
|
4
|
-
* @param axios - Axios instance
|
|
5
|
-
* @param appId - Application ID
|
|
6
|
-
* @returns MCP module for the app's MCP consent page
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export function createMcpModule(axios, appId) {
|
|
10
|
-
return {
|
|
11
|
-
async getConsentInfo(ctx) {
|
|
12
|
-
return axios.get(`/apps/${appId}/mcp/consent-info`, {
|
|
13
|
-
params: { handle: ctx },
|
|
14
|
-
});
|
|
15
|
-
},
|
|
16
|
-
async authorizeGrant(ctx, action) {
|
|
17
|
-
return axios.post(`/apps/${appId}/mcp/authorize-grant`, { ctx, action });
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One tool shown on the MCP consent page.
|
|
3
|
-
*/
|
|
4
|
-
export interface McpConsentTool {
|
|
5
|
-
/** The tool's MCP name. */
|
|
6
|
-
name: string;
|
|
7
|
-
/** Human-readable title, when the tool has one. */
|
|
8
|
-
title?: string | null;
|
|
9
|
-
/** What the tool does. */
|
|
10
|
-
description?: string | null;
|
|
11
|
-
/** Whether the tool only reads data. */
|
|
12
|
-
read_only_hint?: boolean | null;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Display details for a pending MCP authorization request, as returned by
|
|
16
|
-
* {@link McpModule.getConsentInfo}.
|
|
17
|
-
*/
|
|
18
|
-
export interface McpConsentInfo {
|
|
19
|
-
/** The app's display name. */
|
|
20
|
-
app_name: string;
|
|
21
|
-
/** The name of the AI client asking for access. */
|
|
22
|
-
client_name: string;
|
|
23
|
-
/**
|
|
24
|
-
* Whether the request came from a signed-in user of this app. When `false`,
|
|
25
|
-
* send the user to `login_path` before showing approve and deny.
|
|
26
|
-
*/
|
|
27
|
-
authenticated: boolean;
|
|
28
|
-
/** The tools the client will be able to use. Empty unless `authenticated` is `true`. */
|
|
29
|
-
tools: McpConsentTool[];
|
|
30
|
-
/** The app's login route for a signed-out user, such as `/login`. */
|
|
31
|
-
login_path: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* The user's decision on an MCP authorization request.
|
|
35
|
-
*/
|
|
36
|
-
export type McpConsentAction = "approve" | "deny";
|
|
37
|
-
/**
|
|
38
|
-
* Result of {@link McpModule.authorizeGrant}.
|
|
39
|
-
*/
|
|
40
|
-
export interface McpAuthorizeGrantResponse {
|
|
41
|
-
/**
|
|
42
|
-
* Where to send the browser next: the AI client's redirect URI, carrying the
|
|
43
|
-
* authorization code on approve or an `access_denied` error on deny. It may
|
|
44
|
-
* use a custom scheme such as `cursor://`.
|
|
45
|
-
*/
|
|
46
|
-
redirect_url: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* MCP module for the app's MCP consent page.
|
|
50
|
-
*
|
|
51
|
-
* When an AI client connects to the app's MCP server, Base44 sends the user to
|
|
52
|
-
* the app's consent page with an opaque `ctx` query parameter. The page reads
|
|
53
|
-
* the request's details with {@link McpModule.getConsentInfo | getConsentInfo()}
|
|
54
|
-
* and records the user's decision with {@link McpModule.authorizeGrant | authorizeGrant()}.
|
|
55
|
-
*
|
|
56
|
-
* ## Authentication Modes
|
|
57
|
-
*
|
|
58
|
-
* This module is available to use with a client in user authentication mode. The
|
|
59
|
-
* signed-in user's token is sent when the client has one; otherwise the app's
|
|
60
|
-
* session cookie identifies the user.
|
|
61
|
-
*/
|
|
62
|
-
export interface McpModule {
|
|
63
|
-
/**
|
|
64
|
-
* Gets the display details for a pending MCP authorization request.
|
|
65
|
-
*
|
|
66
|
-
* Rejects with a {@linkcode Base44Error} with `status` `404` when the `ctx`
|
|
67
|
-
* handle is unknown or expired.
|
|
68
|
-
*
|
|
69
|
-
* @param ctx - The `ctx` query parameter the consent page was opened with.
|
|
70
|
-
* @returns Promise resolving to the request's display details.
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* ```typescript
|
|
74
|
-
* const ctx = new URLSearchParams(window.location.search).get('ctx');
|
|
75
|
-
* const info = await base44.mcp.getConsentInfo(ctx);
|
|
76
|
-
* if (!info.authenticated) {
|
|
77
|
-
* window.location.href = info.login_path;
|
|
78
|
-
* }
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
getConsentInfo(ctx: string): Promise<McpConsentInfo>;
|
|
82
|
-
/**
|
|
83
|
-
* Records the signed-in user's decision on an MCP authorization request.
|
|
84
|
-
*
|
|
85
|
-
* The `ctx` handle is single-use. Rejects with a {@linkcode Base44Error}:
|
|
86
|
-
* `status` `401` when the user must sign in again (the handle is still valid),
|
|
87
|
-
* and `400`, `403`, `404` or `409` when the request can no longer be
|
|
88
|
-
* completed and the user must reconnect from the AI client.
|
|
89
|
-
*
|
|
90
|
-
* @param ctx - The `ctx` query parameter the consent page was opened with.
|
|
91
|
-
* @param action - `"approve"` to grant access, `"deny"` to refuse it.
|
|
92
|
-
* @returns Promise resolving to the URL to send the browser to.
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```typescript
|
|
96
|
-
* const { redirect_url } = await base44.mcp.authorizeGrant(ctx, 'approve');
|
|
97
|
-
* window.location.href = redirect_url;
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
100
|
-
authorizeGrant(ctx: string, action: McpConsentAction): Promise<McpAuthorizeGrantResponse>;
|
|
101
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|