@juspay/neurolink
Version:
Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and
517 lines (516 loc) • 15.1 kB
TypeScript
/**
* Direct Tool Definitions for NeuroLink CLI Agent
* Simple, reliable tools that work immediately with Vercel AI SDK
*/
import { z } from "zod";
/**
* Direct tool definitions that work immediately with Gemini/AI SDK
* These bypass MCP complexity and provide reliable agent functionality
*/
export declare const directAgentTools: {
getCurrentTime: import("ai").Tool<z.ZodObject<{
timezone: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
timezone?: string | undefined;
}, {
timezone?: string | undefined;
}>, {
success: boolean;
time: string;
timezone: string;
iso: string;
timestamp?: undefined;
error?: undefined;
} | {
success: boolean;
time: string;
iso: string;
timestamp: number;
timezone?: undefined;
error?: undefined;
} | {
success: boolean;
error: string;
time?: undefined;
timezone?: undefined;
iso?: undefined;
timestamp?: undefined;
}> & {
execute: (args: {
timezone?: string | undefined;
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
success: boolean;
time: string;
timezone: string;
iso: string;
timestamp?: undefined;
error?: undefined;
} | {
success: boolean;
time: string;
iso: string;
timestamp: number;
timezone?: undefined;
error?: undefined;
} | {
success: boolean;
error: string;
time?: undefined;
timezone?: undefined;
iso?: undefined;
timestamp?: undefined;
}>;
};
readFile: import("ai").Tool<z.ZodObject<{
path: z.ZodString;
}, "strip", z.ZodTypeAny, {
path: string;
}, {
path: string;
}>, {
success: boolean;
error: string;
content?: undefined;
size?: undefined;
path?: undefined;
lastModified?: undefined;
} | {
success: boolean;
content: string;
size: number;
path: string;
lastModified: string;
error?: undefined;
} | {
success: boolean;
error: string;
path: string;
content?: undefined;
size?: undefined;
lastModified?: undefined;
}> & {
execute: (args: {
path: string;
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
success: boolean;
error: string;
content?: undefined;
size?: undefined;
path?: undefined;
lastModified?: undefined;
} | {
success: boolean;
content: string;
size: number;
path: string;
lastModified: string;
error?: undefined;
} | {
success: boolean;
error: string;
path: string;
content?: undefined;
size?: undefined;
lastModified?: undefined;
}>;
};
listDirectory: import("ai").Tool<z.ZodObject<{
path: z.ZodString;
includeHidden: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, "strip", z.ZodTypeAny, {
path: string;
includeHidden: boolean;
}, {
path: string;
includeHidden?: boolean | undefined;
}>, {
success: boolean;
path: string;
items: {
name: string;
type: string;
size: number | undefined;
lastModified: string;
}[];
count: number;
error?: undefined;
} | {
success: boolean;
error: string;
path: string;
items?: undefined;
count?: undefined;
}> & {
execute: (args: {
path: string;
includeHidden: boolean;
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
success: boolean;
path: string;
items: {
name: string;
type: string;
size: number | undefined;
lastModified: string;
}[];
count: number;
error?: undefined;
} | {
success: boolean;
error: string;
path: string;
items?: undefined;
count?: undefined;
}>;
};
calculateMath: import("ai").Tool<z.ZodObject<{
expression: z.ZodString;
precision: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
}, "strip", z.ZodTypeAny, {
expression: string;
precision: number;
}, {
expression: string;
precision?: number | undefined;
}>, {
success: boolean;
error: string;
expression?: undefined;
result?: undefined;
type?: undefined;
} | {
success: boolean;
expression: string;
result: any;
type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
error?: undefined;
} | {
success: boolean;
error: string;
expression: string;
result?: undefined;
type?: undefined;
}> & {
execute: (args: {
expression: string;
precision: number;
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
success: boolean;
error: string;
expression?: undefined;
result?: undefined;
type?: undefined;
} | {
success: boolean;
expression: string;
result: any;
type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
error?: undefined;
} | {
success: boolean;
error: string;
expression: string;
result?: undefined;
type?: undefined;
}>;
};
writeFile: import("ai").Tool<z.ZodObject<{
path: z.ZodString;
content: z.ZodString;
mode: z.ZodDefault<z.ZodEnum<["create", "overwrite", "append"]>>;
}, "strip", z.ZodTypeAny, {
path: string;
content: string;
mode: "create" | "overwrite" | "append";
}, {
path: string;
content: string;
mode?: "create" | "overwrite" | "append" | undefined;
}>, {
success: boolean;
error: string;
path?: undefined;
mode?: undefined;
size?: undefined;
written?: undefined;
} | {
success: boolean;
path: string;
mode: "create" | "overwrite" | "append";
size: number;
written: number;
error?: undefined;
} | {
success: boolean;
error: string;
path: string;
mode?: undefined;
size?: undefined;
written?: undefined;
}> & {
execute: (args: {
path: string;
content: string;
mode: "create" | "overwrite" | "append";
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
success: boolean;
error: string;
path?: undefined;
mode?: undefined;
size?: undefined;
written?: undefined;
} | {
success: boolean;
path: string;
mode: "create" | "overwrite" | "append";
size: number;
written: number;
error?: undefined;
} | {
success: boolean;
error: string;
path: string;
mode?: undefined;
size?: undefined;
written?: undefined;
}>;
};
searchFiles: import("ai").Tool<z.ZodObject<{
directory: z.ZodString;
pattern: z.ZodString;
recursive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, "strip", z.ZodTypeAny, {
directory: string;
pattern: string;
recursive: boolean;
}, {
directory: string;
pattern: string;
recursive?: boolean | undefined;
}>, {
success: boolean;
error: string;
directory?: undefined;
pattern?: undefined;
matches?: undefined;
count?: undefined;
} | {
success: boolean;
directory: string;
pattern: string;
matches: {
name: string;
path: string;
size: number;
lastModified: string;
}[];
count: number;
error?: undefined;
} | {
success: boolean;
error: string;
directory: string;
pattern: string;
matches?: undefined;
count?: undefined;
}> & {
execute: (args: {
directory: string;
pattern: string;
recursive: boolean;
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
success: boolean;
error: string;
directory?: undefined;
pattern?: undefined;
matches?: undefined;
count?: undefined;
} | {
success: boolean;
directory: string;
pattern: string;
matches: {
name: string;
path: string;
size: number;
lastModified: string;
}[];
count: number;
error?: undefined;
} | {
success: boolean;
error: string;
directory: string;
pattern: string;
matches?: undefined;
count?: undefined;
}>;
};
websearchGrounding: import("ai").Tool<z.ZodObject<{
query: z.ZodString;
maxResults: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
maxWords: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
}, "strip", z.ZodTypeAny, {
query: string;
maxResults: number;
maxWords: number;
}, {
query: string;
maxResults?: number | undefined;
maxWords?: number | undefined;
}>, {
success: boolean;
error: string;
requiredEnvVars: string[];
query?: undefined;
searchResults?: undefined;
rawContent?: undefined;
totalResults?: undefined;
provider?: undefined;
model?: undefined;
responseTime?: undefined;
timestamp?: undefined;
grounded?: undefined;
} | {
success: boolean;
error: string;
query: string;
requiredEnvVars?: undefined;
searchResults?: undefined;
rawContent?: undefined;
totalResults?: undefined;
provider?: undefined;
model?: undefined;
responseTime?: undefined;
timestamp?: undefined;
grounded?: undefined;
} | {
success: boolean;
query: string;
searchResults: {
title: string;
url: string;
snippet: string;
domain: string;
}[];
rawContent: string;
totalResults: number;
provider: string;
model: string;
responseTime: number;
timestamp: number;
grounded: boolean;
error?: undefined;
requiredEnvVars?: undefined;
} | {
success: boolean;
error: string;
query: string;
provider: string;
requiredEnvVars?: undefined;
searchResults?: undefined;
rawContent?: undefined;
totalResults?: undefined;
model?: undefined;
responseTime?: undefined;
timestamp?: undefined;
grounded?: undefined;
}> & {
execute: (args: {
query: string;
maxResults: number;
maxWords: number;
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
success: boolean;
error: string;
requiredEnvVars: string[];
query?: undefined;
searchResults?: undefined;
rawContent?: undefined;
totalResults?: undefined;
provider?: undefined;
model?: undefined;
responseTime?: undefined;
timestamp?: undefined;
grounded?: undefined;
} | {
success: boolean;
error: string;
query: string;
requiredEnvVars?: undefined;
searchResults?: undefined;
rawContent?: undefined;
totalResults?: undefined;
provider?: undefined;
model?: undefined;
responseTime?: undefined;
timestamp?: undefined;
grounded?: undefined;
} | {
success: boolean;
query: string;
searchResults: {
title: string;
url: string;
snippet: string;
domain: string;
}[];
rawContent: string;
totalResults: number;
provider: string;
model: string;
responseTime: number;
timestamp: number;
grounded: boolean;
error?: undefined;
requiredEnvVars?: undefined;
} | {
success: boolean;
error: string;
query: string;
provider: string;
requiredEnvVars?: undefined;
searchResults?: undefined;
rawContent?: undefined;
totalResults?: undefined;
model?: undefined;
responseTime?: undefined;
timestamp?: undefined;
grounded?: undefined;
}>;
};
};
/**
* Type aliases for specific tool categories
*/
export type BasicToolsMap = {
getCurrentTime: typeof directAgentTools.getCurrentTime;
calculateMath: typeof directAgentTools.calculateMath;
};
export type FilesystemToolsMap = {
readFile: typeof directAgentTools.readFile;
listDirectory: typeof directAgentTools.listDirectory;
writeFile: typeof directAgentTools.writeFile;
searchFiles: typeof directAgentTools.searchFiles;
};
export type UtilityToolsMap = {
getCurrentTime: typeof directAgentTools.getCurrentTime;
calculateMath: typeof directAgentTools.calculateMath;
listDirectory: typeof directAgentTools.listDirectory;
};
export type AllToolsMap = typeof directAgentTools;
/**
* Get a subset of tools for specific use cases with improved type safety
*/
export declare function getToolsForCategory(category: "basic"): BasicToolsMap;
export declare function getToolsForCategory(category: "filesystem"): FilesystemToolsMap;
export declare function getToolsForCategory(category: "utility"): UtilityToolsMap;
export declare function getToolsForCategory(category: "all"): AllToolsMap;
/**
* Get tool names for validation
*/
export declare function getAvailableToolNames(): string[];
/**
* Validate that all tools have proper structure
*/
export declare function validateToolStructure(): boolean;