@rainfall-devkit/sdk 0.2.1 → 0.2.3
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/chunk-6FXRLPLR.mjs +436 -0
- package/dist/chunk-CC4O7GSQ.mjs +978 -0
- package/dist/chunk-CQ5TV7CQ.mjs +989 -0
- package/dist/chunk-GPKQUVAV.mjs +987 -0
- package/dist/chunk-KOCCGNEQ.mjs +269 -0
- package/dist/chunk-LJQEO3CY.mjs +150 -0
- package/dist/chunk-NCQVOLS4.mjs +269 -0
- package/dist/chunk-S7MOQCV4.mjs +137 -0
- package/dist/chunk-XHPFY5MH.mjs +132 -0
- package/dist/cli/index.js +1009 -54
- package/dist/cli/index.mjs +244 -24
- package/dist/daemon/index.d.mts +3 -3
- package/dist/daemon/index.d.ts +3 -3
- package/dist/daemon/index.js +411 -129
- package/dist/daemon/index.mjs +2 -1
- package/dist/display-KKJPO6UA.mjs +14 -0
- package/dist/errors-CY6HW2I5.mjs +24 -0
- package/dist/index.d.mts +66 -4
- package/dist/index.d.ts +66 -4
- package/dist/index.js +903 -124
- package/dist/index.mjs +18 -6
- package/dist/listeners-BBNBsJCk.d.ts +372 -0
- package/dist/listeners-CMUKjEkb.d.mts +372 -0
- package/dist/listeners-CadPNUHd.d.ts +372 -0
- package/dist/listeners-Ckdj6D8T.d.mts +372 -0
- package/dist/mcp.d.mts +2 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +405 -101
- package/dist/mcp.mjs +4 -2
- package/dist/param-parser-JVKB5FQK.mjs +12 -0
- package/dist/param-parser-PAKCNDBX.mjs +136 -0
- package/dist/sdk-Cl5Qzt4I.d.mts +1165 -0
- package/dist/sdk-Cl5Qzt4I.d.ts +1165 -0
- package/dist/sdk-DQKNbBce.d.mts +1162 -0
- package/dist/sdk-DQKNbBce.d.ts +1162 -0
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { l as RainfallClient } from './sdk-
|
|
2
|
-
export { A as AI, b as ApiError, c as ApiResponse, d as Articles, D as Data, I as Integrations, M as Memory,
|
|
1
|
+
import { l as RainfallClient, a as Rainfall } from './sdk-Cl5Qzt4I.mjs';
|
|
2
|
+
export { A as AI, b as ApiError, c as ApiResponse, d as Articles, D as Data, I as Integrations, M as Memory, P as ParamSchema, R as RainfallConfig, e as RateLimitInfo, f as RequestOptions, m as ToolParamsSchema, T as ToolSchema, U as Utils, V as ValidationIssue, n as ValidationResult, W as Web, o as clearSchemaCache, p as fetchToolSchema, q as formatValidationErrors, v as validateParams } from './sdk-Cl5Qzt4I.mjs';
|
|
3
3
|
export { A as AuthenticationError, N as NetworkError, a as NotFoundError, R as RainfallError, b as RateLimitError, S as ServerError, T as TimeoutError, c as ToolNotFoundError, V as ValidationError } from './errors-BMPseAnM.mjs';
|
|
4
|
-
export { C as ContextOptions, c as CronTriggerConfig, E as EdgeNodeRegistration, F as FileWatcherConfig, L as ListenerEvent, d as ListenerRegistry, M as MemoryEntry, N as NetworkedExecutorOptions, e as NodeCapabilities, Q as QueuedJob, a as RainfallDaemonContext, b as RainfallListenerRegistry, R as RainfallNetworkedExecutor, S as SessionContext, T as ToolExecutionRecord, f as createCronWorkflow, g as createFileWatcherWorkflow } from './listeners-
|
|
4
|
+
export { C as ContextOptions, c as CronTriggerConfig, E as EdgeNodeRegistration, F as FileWatcherConfig, L as ListenerEvent, d as ListenerRegistry, M as MemoryEntry, N as NetworkedExecutorOptions, e as NodeCapabilities, Q as QueuedJob, a as RainfallDaemonContext, b as RainfallListenerRegistry, R as RainfallNetworkedExecutor, S as SessionContext, T as ToolExecutionRecord, f as createCronWorkflow, g as createFileWatcherWorkflow } from './listeners-Ckdj6D8T.mjs';
|
|
5
5
|
import 'ws';
|
|
6
6
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
7
7
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
@@ -247,6 +247,68 @@ declare function createSecureEdgeClient(client: RainfallClient, options: {
|
|
|
247
247
|
backendSecret?: string;
|
|
248
248
|
}): Promise<SecureEdgeClient>;
|
|
249
249
|
|
|
250
|
+
/**
|
|
251
|
+
* CLI handler types for tool-specific preflight/postflight/display overrides
|
|
252
|
+
*/
|
|
253
|
+
|
|
254
|
+
interface ToolContext {
|
|
255
|
+
rainfall: Rainfall;
|
|
256
|
+
toolId: string;
|
|
257
|
+
params: Record<string, unknown>;
|
|
258
|
+
args: string[];
|
|
259
|
+
flags: {
|
|
260
|
+
raw?: boolean;
|
|
261
|
+
quiet?: boolean;
|
|
262
|
+
[key: string]: unknown;
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
interface PreflightResult {
|
|
266
|
+
/** Modified params to use for execution */
|
|
267
|
+
params?: Record<string, unknown>;
|
|
268
|
+
/** Skip normal execution and return this result directly */
|
|
269
|
+
skipExecution?: unknown;
|
|
270
|
+
/** Additional context to pass to postflight */
|
|
271
|
+
context?: Record<string, unknown>;
|
|
272
|
+
}
|
|
273
|
+
interface PostflightContext extends ToolContext {
|
|
274
|
+
/** The result from tool execution (or skipExecution) */
|
|
275
|
+
result: unknown;
|
|
276
|
+
/** Context passed from preflight */
|
|
277
|
+
preflightContext?: Record<string, unknown>;
|
|
278
|
+
}
|
|
279
|
+
interface DisplayContext extends PostflightContext {
|
|
280
|
+
/** Output stream (for testing/custom output) */
|
|
281
|
+
output?: NodeJS.WriteStream;
|
|
282
|
+
}
|
|
283
|
+
/** Tool handler interface for custom CLI behavior */
|
|
284
|
+
interface ToolHandler {
|
|
285
|
+
/** Tool ID this handler applies to (or pattern) */
|
|
286
|
+
toolId: string | RegExp;
|
|
287
|
+
/**
|
|
288
|
+
* Preflight: Modify params, validate, or skip execution entirely
|
|
289
|
+
* Called before tool execution
|
|
290
|
+
*/
|
|
291
|
+
preflight?(context: ToolContext): Promise<PreflightResult | void> | PreflightResult | void;
|
|
292
|
+
/**
|
|
293
|
+
* Postflight: Process result, trigger side effects
|
|
294
|
+
* Called after successful tool execution
|
|
295
|
+
*/
|
|
296
|
+
postflight?(context: PostflightContext): Promise<void> | void;
|
|
297
|
+
/**
|
|
298
|
+
* Display: Custom output formatting
|
|
299
|
+
* Return true if handled, false to use default display
|
|
300
|
+
*/
|
|
301
|
+
display?(context: DisplayContext): Promise<boolean> | boolean;
|
|
302
|
+
}
|
|
303
|
+
/** Registry of tool handlers */
|
|
304
|
+
declare class ToolHandlerRegistry {
|
|
305
|
+
private handlers;
|
|
306
|
+
register(handler: ToolHandler): void;
|
|
307
|
+
findHandler(toolId: string): ToolHandler | undefined;
|
|
308
|
+
getAllHandlers(): ToolHandler[];
|
|
309
|
+
}
|
|
310
|
+
declare const globalHandlerRegistry: ToolHandlerRegistry;
|
|
311
|
+
|
|
250
312
|
/**
|
|
251
313
|
* Rainfall SDK - Official SDK for Rainfall API
|
|
252
314
|
*
|
|
@@ -273,4 +335,4 @@ declare function createSecureEdgeClient(client: RainfallClient, options: {
|
|
|
273
335
|
|
|
274
336
|
declare const VERSION = "0.1.0";
|
|
275
337
|
|
|
276
|
-
export { type ACLCheck, type ACLResult, type EdgeNodeJWT, EdgeNodeSecurity, type EncryptedPayload, type JWTPayload, type JobResult, type KeyPair, RainfallClient, SecureEdgeClient, type SecureEdgeConfig, type SecureJob, VERSION, createEdgeNodeSecurity, createSecureEdgeClient };
|
|
338
|
+
export { type ACLCheck, type ACLResult, type DisplayContext, type EdgeNodeJWT, EdgeNodeSecurity, type EncryptedPayload, type JWTPayload, type JobResult, type KeyPair, type PostflightContext, type PreflightResult, Rainfall, RainfallClient, SecureEdgeClient, type SecureEdgeConfig, type SecureJob, type ToolContext, type ToolHandler, ToolHandlerRegistry, VERSION, createEdgeNodeSecurity, createSecureEdgeClient, globalHandlerRegistry };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { l as RainfallClient } from './sdk-
|
|
2
|
-
export { A as AI, b as ApiError, c as ApiResponse, d as Articles, D as Data, I as Integrations, M as Memory,
|
|
1
|
+
import { l as RainfallClient, a as Rainfall } from './sdk-Cl5Qzt4I.js';
|
|
2
|
+
export { A as AI, b as ApiError, c as ApiResponse, d as Articles, D as Data, I as Integrations, M as Memory, P as ParamSchema, R as RainfallConfig, e as RateLimitInfo, f as RequestOptions, m as ToolParamsSchema, T as ToolSchema, U as Utils, V as ValidationIssue, n as ValidationResult, W as Web, o as clearSchemaCache, p as fetchToolSchema, q as formatValidationErrors, v as validateParams } from './sdk-Cl5Qzt4I.js';
|
|
3
3
|
export { A as AuthenticationError, N as NetworkError, a as NotFoundError, R as RainfallError, b as RateLimitError, S as ServerError, T as TimeoutError, c as ToolNotFoundError, V as ValidationError } from './errors-BMPseAnM.js';
|
|
4
|
-
export { C as ContextOptions, c as CronTriggerConfig, E as EdgeNodeRegistration, F as FileWatcherConfig, L as ListenerEvent, d as ListenerRegistry, M as MemoryEntry, N as NetworkedExecutorOptions, e as NodeCapabilities, Q as QueuedJob, a as RainfallDaemonContext, b as RainfallListenerRegistry, R as RainfallNetworkedExecutor, S as SessionContext, T as ToolExecutionRecord, f as createCronWorkflow, g as createFileWatcherWorkflow } from './listeners-
|
|
4
|
+
export { C as ContextOptions, c as CronTriggerConfig, E as EdgeNodeRegistration, F as FileWatcherConfig, L as ListenerEvent, d as ListenerRegistry, M as MemoryEntry, N as NetworkedExecutorOptions, e as NodeCapabilities, Q as QueuedJob, a as RainfallDaemonContext, b as RainfallListenerRegistry, R as RainfallNetworkedExecutor, S as SessionContext, T as ToolExecutionRecord, f as createCronWorkflow, g as createFileWatcherWorkflow } from './listeners-BBNBsJCk.js';
|
|
5
5
|
import 'ws';
|
|
6
6
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
7
7
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
@@ -247,6 +247,68 @@ declare function createSecureEdgeClient(client: RainfallClient, options: {
|
|
|
247
247
|
backendSecret?: string;
|
|
248
248
|
}): Promise<SecureEdgeClient>;
|
|
249
249
|
|
|
250
|
+
/**
|
|
251
|
+
* CLI handler types for tool-specific preflight/postflight/display overrides
|
|
252
|
+
*/
|
|
253
|
+
|
|
254
|
+
interface ToolContext {
|
|
255
|
+
rainfall: Rainfall;
|
|
256
|
+
toolId: string;
|
|
257
|
+
params: Record<string, unknown>;
|
|
258
|
+
args: string[];
|
|
259
|
+
flags: {
|
|
260
|
+
raw?: boolean;
|
|
261
|
+
quiet?: boolean;
|
|
262
|
+
[key: string]: unknown;
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
interface PreflightResult {
|
|
266
|
+
/** Modified params to use for execution */
|
|
267
|
+
params?: Record<string, unknown>;
|
|
268
|
+
/** Skip normal execution and return this result directly */
|
|
269
|
+
skipExecution?: unknown;
|
|
270
|
+
/** Additional context to pass to postflight */
|
|
271
|
+
context?: Record<string, unknown>;
|
|
272
|
+
}
|
|
273
|
+
interface PostflightContext extends ToolContext {
|
|
274
|
+
/** The result from tool execution (or skipExecution) */
|
|
275
|
+
result: unknown;
|
|
276
|
+
/** Context passed from preflight */
|
|
277
|
+
preflightContext?: Record<string, unknown>;
|
|
278
|
+
}
|
|
279
|
+
interface DisplayContext extends PostflightContext {
|
|
280
|
+
/** Output stream (for testing/custom output) */
|
|
281
|
+
output?: NodeJS.WriteStream;
|
|
282
|
+
}
|
|
283
|
+
/** Tool handler interface for custom CLI behavior */
|
|
284
|
+
interface ToolHandler {
|
|
285
|
+
/** Tool ID this handler applies to (or pattern) */
|
|
286
|
+
toolId: string | RegExp;
|
|
287
|
+
/**
|
|
288
|
+
* Preflight: Modify params, validate, or skip execution entirely
|
|
289
|
+
* Called before tool execution
|
|
290
|
+
*/
|
|
291
|
+
preflight?(context: ToolContext): Promise<PreflightResult | void> | PreflightResult | void;
|
|
292
|
+
/**
|
|
293
|
+
* Postflight: Process result, trigger side effects
|
|
294
|
+
* Called after successful tool execution
|
|
295
|
+
*/
|
|
296
|
+
postflight?(context: PostflightContext): Promise<void> | void;
|
|
297
|
+
/**
|
|
298
|
+
* Display: Custom output formatting
|
|
299
|
+
* Return true if handled, false to use default display
|
|
300
|
+
*/
|
|
301
|
+
display?(context: DisplayContext): Promise<boolean> | boolean;
|
|
302
|
+
}
|
|
303
|
+
/** Registry of tool handlers */
|
|
304
|
+
declare class ToolHandlerRegistry {
|
|
305
|
+
private handlers;
|
|
306
|
+
register(handler: ToolHandler): void;
|
|
307
|
+
findHandler(toolId: string): ToolHandler | undefined;
|
|
308
|
+
getAllHandlers(): ToolHandler[];
|
|
309
|
+
}
|
|
310
|
+
declare const globalHandlerRegistry: ToolHandlerRegistry;
|
|
311
|
+
|
|
250
312
|
/**
|
|
251
313
|
* Rainfall SDK - Official SDK for Rainfall API
|
|
252
314
|
*
|
|
@@ -273,4 +335,4 @@ declare function createSecureEdgeClient(client: RainfallClient, options: {
|
|
|
273
335
|
|
|
274
336
|
declare const VERSION = "0.1.0";
|
|
275
337
|
|
|
276
|
-
export { type ACLCheck, type ACLResult, type EdgeNodeJWT, EdgeNodeSecurity, type EncryptedPayload, type JWTPayload, type JobResult, type KeyPair, RainfallClient, SecureEdgeClient, type SecureEdgeConfig, type SecureJob, VERSION, createEdgeNodeSecurity, createSecureEdgeClient };
|
|
338
|
+
export { type ACLCheck, type ACLResult, type DisplayContext, type EdgeNodeJWT, EdgeNodeSecurity, type EncryptedPayload, type JWTPayload, type JobResult, type KeyPair, type PostflightContext, type PreflightResult, Rainfall, RainfallClient, SecureEdgeClient, type SecureEdgeConfig, type SecureJob, type ToolContext, type ToolHandler, ToolHandlerRegistry, VERSION, createEdgeNodeSecurity, createSecureEdgeClient, globalHandlerRegistry };
|