@rainfall-devkit/sdk 0.1.1

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.mjs ADDED
@@ -0,0 +1,30 @@
1
+ import {
2
+ AuthenticationError,
3
+ NetworkError,
4
+ NotFoundError,
5
+ Rainfall,
6
+ RainfallClient,
7
+ RainfallError,
8
+ RateLimitError,
9
+ ServerError,
10
+ TimeoutError,
11
+ ToolNotFoundError,
12
+ ValidationError
13
+ } from "./chunk-UP45HOXN.mjs";
14
+
15
+ // src/index.ts
16
+ var VERSION = "0.1.0";
17
+ export {
18
+ AuthenticationError,
19
+ NetworkError,
20
+ NotFoundError,
21
+ Rainfall,
22
+ RainfallClient,
23
+ RainfallError,
24
+ RateLimitError,
25
+ ServerError,
26
+ TimeoutError,
27
+ ToolNotFoundError,
28
+ VERSION,
29
+ ValidationError
30
+ };
package/dist/mcp.d.mts ADDED
@@ -0,0 +1,68 @@
1
+ import { g as RainfallConfig, R as Rainfall } from './errors-DdRTwxpT.mjs';
2
+ export { A as AI, a as ApiError, b as ApiResponse, c as Articles, d as AuthenticationError, D as Data, I as Integrations, M as Memory, N as NetworkError, e as NotFoundError, h as RainfallError, i as RateLimitError, j as RateLimitInfo, k as RequestOptions, S as ServerError, T as TimeoutError, l as ToolNotFoundError, m as ToolSchema, U as Utils, V as ValidationError, W as Web, p as parseErrorResponse } from './errors-DdRTwxpT.mjs';
3
+
4
+ /**
5
+ * MCP (Model Context Protocol) server export for Rainfall SDK
6
+ *
7
+ * This module provides an MCP server that exposes Rainfall tools
8
+ * to AI agents and assistants like Claude, Cursor, etc.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { createRainfallMCPServer } from '@rainfall/sdk/mcp';
13
+ *
14
+ * const server = createRainfallMCPServer({
15
+ * apiKey: process.env.RAINFALL_API_KEY!
16
+ * });
17
+ *
18
+ * // Start the server
19
+ * await server.start();
20
+ * ```
21
+ */
22
+
23
+ interface MCPServerConfig extends RainfallConfig {
24
+ /** Server name */
25
+ name?: string;
26
+ /** Server version */
27
+ version?: string;
28
+ /** Tools to expose (defaults to all) */
29
+ tools?: string[];
30
+ /** Tools to exclude */
31
+ excludeTools?: string[];
32
+ }
33
+ interface MCPRequest {
34
+ jsonrpc: '2.0';
35
+ id: string | number;
36
+ method: string;
37
+ params?: Record<string, unknown>;
38
+ }
39
+ interface MCPResponse {
40
+ jsonrpc: '2.0';
41
+ id: string | number | null;
42
+ result?: unknown;
43
+ error?: {
44
+ code: number;
45
+ message: string;
46
+ data?: unknown;
47
+ };
48
+ }
49
+ interface MCPTool {
50
+ name: string;
51
+ description: string;
52
+ inputSchema: {
53
+ type: 'object';
54
+ properties: Record<string, unknown>;
55
+ required?: string[];
56
+ };
57
+ }
58
+ /**
59
+ * Create an MCP server for Rainfall
60
+ */
61
+ declare function createRainfallMCPServer(config: MCPServerConfig): {
62
+ handleRequest: (request: MCPRequest) => Promise<MCPResponse>;
63
+ start: () => Promise<void>;
64
+ getTools: () => Promise<MCPTool[]>;
65
+ rainfall: Rainfall;
66
+ };
67
+
68
+ export { type MCPRequest, type MCPResponse, type MCPServerConfig, type MCPTool, Rainfall, RainfallConfig, createRainfallMCPServer };
package/dist/mcp.d.ts ADDED
@@ -0,0 +1,68 @@
1
+ import { g as RainfallConfig, R as Rainfall } from './errors-DdRTwxpT.js';
2
+ export { A as AI, a as ApiError, b as ApiResponse, c as Articles, d as AuthenticationError, D as Data, I as Integrations, M as Memory, N as NetworkError, e as NotFoundError, h as RainfallError, i as RateLimitError, j as RateLimitInfo, k as RequestOptions, S as ServerError, T as TimeoutError, l as ToolNotFoundError, m as ToolSchema, U as Utils, V as ValidationError, W as Web, p as parseErrorResponse } from './errors-DdRTwxpT.js';
3
+
4
+ /**
5
+ * MCP (Model Context Protocol) server export for Rainfall SDK
6
+ *
7
+ * This module provides an MCP server that exposes Rainfall tools
8
+ * to AI agents and assistants like Claude, Cursor, etc.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { createRainfallMCPServer } from '@rainfall/sdk/mcp';
13
+ *
14
+ * const server = createRainfallMCPServer({
15
+ * apiKey: process.env.RAINFALL_API_KEY!
16
+ * });
17
+ *
18
+ * // Start the server
19
+ * await server.start();
20
+ * ```
21
+ */
22
+
23
+ interface MCPServerConfig extends RainfallConfig {
24
+ /** Server name */
25
+ name?: string;
26
+ /** Server version */
27
+ version?: string;
28
+ /** Tools to expose (defaults to all) */
29
+ tools?: string[];
30
+ /** Tools to exclude */
31
+ excludeTools?: string[];
32
+ }
33
+ interface MCPRequest {
34
+ jsonrpc: '2.0';
35
+ id: string | number;
36
+ method: string;
37
+ params?: Record<string, unknown>;
38
+ }
39
+ interface MCPResponse {
40
+ jsonrpc: '2.0';
41
+ id: string | number | null;
42
+ result?: unknown;
43
+ error?: {
44
+ code: number;
45
+ message: string;
46
+ data?: unknown;
47
+ };
48
+ }
49
+ interface MCPTool {
50
+ name: string;
51
+ description: string;
52
+ inputSchema: {
53
+ type: 'object';
54
+ properties: Record<string, unknown>;
55
+ required?: string[];
56
+ };
57
+ }
58
+ /**
59
+ * Create an MCP server for Rainfall
60
+ */
61
+ declare function createRainfallMCPServer(config: MCPServerConfig): {
62
+ handleRequest: (request: MCPRequest) => Promise<MCPResponse>;
63
+ start: () => Promise<void>;
64
+ getTools: () => Promise<MCPTool[]>;
65
+ rainfall: Rainfall;
66
+ };
67
+
68
+ export { type MCPRequest, type MCPResponse, type MCPServerConfig, type MCPTool, Rainfall, RainfallConfig, createRainfallMCPServer };