UNPKG

@toolplex/client

Version:

The official ToolPlex client for AI agent tool discovery and execution

409 lines (408 loc) 14.7 kB
import { z } from "zod"; export type ClientMode = "standard" | "restricted"; export type LogLevel = "error" | "warn" | "info" | "debug"; export interface ToolplexServerConfig { dev: boolean; apiKey: string; clientMode: ClientMode; clientName: string; logLevel: LogLevel; } export declare const TransportTypeSchema: z.ZodEnum<["stdio", "sse"]>; export type TransportType = z.infer<typeof TransportTypeSchema>; export declare const RuntimeSchema: z.ZodEnum<["node", "python", "go", "docker"]>; export type Runtime = z.infer<typeof RuntimeSchema>; export declare const LLMContextSchema: z.ZodObject<{ model_family: z.ZodString; model_name: z.ZodString; model_version: z.ZodString; chat_client: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { model_family: string; model_name: string; model_version: string; chat_client?: string | undefined; }, { model_family: string; model_name: string; model_version: string; chat_client?: string | undefined; }>; export type LLMContext = z.infer<typeof LLMContextSchema>; export declare const ServerConfigSchema: z.ZodObject<{ server_name: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; command: z.ZodOptional<z.ZodString>; args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; runtime: z.ZodOptional<z.ZodEnum<["node", "python", "go", "docker"]>>; env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; url: z.ZodOptional<z.ZodString>; transport: z.ZodEnum<["stdio", "sse"]>; }, "strip", z.ZodTypeAny, { transport: "stdio" | "sse"; server_name?: string | undefined; description?: string | undefined; command?: string | undefined; args?: string[] | undefined; runtime?: "node" | "python" | "go" | "docker" | undefined; env?: Record<string, string> | undefined; url?: string | undefined; }, { transport: "stdio" | "sse"; server_name?: string | undefined; description?: string | undefined; command?: string | undefined; args?: string[] | undefined; runtime?: "node" | "python" | "go" | "docker" | undefined; env?: Record<string, string> | undefined; url?: string | undefined; }>; export type ServerConfig = z.infer<typeof ServerConfigSchema>; export declare const InitializeToolplexParamsSchema: z.ZodObject<{ llm_context: z.ZodObject<{ model_family: z.ZodString; model_name: z.ZodString; model_version: z.ZodString; chat_client: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { model_family: string; model_name: string; model_version: string; chat_client?: string | undefined; }, { model_family: string; model_name: string; model_version: string; chat_client?: string | undefined; }>; }, "strip", z.ZodTypeAny, { llm_context: { model_family: string; model_name: string; model_version: string; chat_client?: string | undefined; }; }, { llm_context: { model_family: string; model_name: string; model_version: string; chat_client?: string | undefined; }; }>; export type InitializeToolplexParams = z.infer<typeof InitializeToolplexParamsSchema>; export declare const SearchParamsSchema: z.ZodObject<{ query: z.ZodString; expanded_keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; filter: z.ZodOptional<z.ZodEnum<["all", "servers_only", "playbooks_only"]>>; size: z.ZodOptional<z.ZodNumber>; scope: z.ZodOptional<z.ZodEnum<["all", "public_only", "private_only"]>>; }, "strip", z.ZodTypeAny, { query: string; filter?: "all" | "servers_only" | "playbooks_only" | undefined; expanded_keywords?: string[] | undefined; size?: number | undefined; scope?: "all" | "public_only" | "private_only" | undefined; }, { query: string; filter?: "all" | "servers_only" | "playbooks_only" | undefined; expanded_keywords?: string[] | undefined; size?: number | undefined; scope?: "all" | "public_only" | "private_only" | undefined; }>; export type SearchParams = z.infer<typeof SearchParamsSchema>; export declare const LookupEntityParamsSchema: z.ZodObject<{ entity_type: z.ZodEnum<["server", "playbook", "feedback"]>; entity_id: z.ZodString; }, "strip", z.ZodTypeAny, { entity_type: "server" | "playbook" | "feedback"; entity_id: string; }, { entity_type: "server" | "playbook" | "feedback"; entity_id: string; }>; export type LookupEntityParams = z.infer<typeof LookupEntityParamsSchema>; export declare const InstallParamsSchema: z.ZodObject<{ server_id: z.ZodString; server_name: z.ZodString; description: z.ZodString; config: z.ZodObject<{ server_name: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; command: z.ZodOptional<z.ZodString>; args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; runtime: z.ZodOptional<z.ZodEnum<["node", "python", "go", "docker"]>>; env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; url: z.ZodOptional<z.ZodString>; transport: z.ZodEnum<["stdio", "sse"]>; }, "strip", z.ZodTypeAny, { transport: "stdio" | "sse"; server_name?: string | undefined; description?: string | undefined; command?: string | undefined; args?: string[] | undefined; runtime?: "node" | "python" | "go" | "docker" | undefined; env?: Record<string, string> | undefined; url?: string | undefined; }, { transport: "stdio" | "sse"; server_name?: string | undefined; description?: string | undefined; command?: string | undefined; args?: string[] | undefined; runtime?: "node" | "python" | "go" | "docker" | undefined; env?: Record<string, string> | undefined; url?: string | undefined; }>; }, "strip", z.ZodTypeAny, { server_name: string; description: string; server_id: string; config: { transport: "stdio" | "sse"; server_name?: string | undefined; description?: string | undefined; command?: string | undefined; args?: string[] | undefined; runtime?: "node" | "python" | "go" | "docker" | undefined; env?: Record<string, string> | undefined; url?: string | undefined; }; }, { server_name: string; description: string; server_id: string; config: { transport: "stdio" | "sse"; server_name?: string | undefined; description?: string | undefined; command?: string | undefined; args?: string[] | undefined; runtime?: "node" | "python" | "go" | "docker" | undefined; env?: Record<string, string> | undefined; url?: string | undefined; }; }>; export type InstallParams = z.infer<typeof InstallParamsSchema>; export declare const ListToolsParamsSchema: z.ZodObject<{ server_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { server_id?: string | undefined; }, { server_id?: string | undefined; }>; export type ListToolplexToolsParams = z.infer<typeof ListToolsParamsSchema>; export declare const GetServerConfigParamsSchema: z.ZodObject<{ server_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { server_id?: string | undefined; }, { server_id?: string | undefined; }>; export type GetServerConfigParams = z.infer<typeof GetServerConfigParamsSchema>; export declare const CallToolParamsSchema: z.ZodObject<{ server_id: z.ZodString; tool_name: z.ZodString; arguments: z.ZodRecord<z.ZodString, z.ZodAny>; }, "strip", z.ZodTypeAny, { server_id: string; tool_name: string; arguments: Record<string, any>; }, { server_id: string; tool_name: string; arguments: Record<string, any>; }>; export type CallToolParams = z.infer<typeof CallToolParamsSchema>; export declare const UninstallParamsSchema: z.ZodObject<{ server_id: z.ZodString; }, "strip", z.ZodTypeAny, { server_id: string; }, { server_id: string; }>; export type UninstallParams = z.infer<typeof UninstallParamsSchema>; export declare const PlaybookActionSchema: z.ZodObject<{ do: z.ZodString; call: z.ZodOptional<z.ZodString>; args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{ type: z.ZodEnum<["string", "number", "boolean", "array", "object", "placeholder"]>; example: z.ZodAny; }, "strip", z.ZodTypeAny, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }>>>; }, "strip", z.ZodTypeAny, { do: string; args?: Record<string, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }> | undefined; call?: string | undefined; }, { do: string; args?: Record<string, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }> | undefined; call?: string | undefined; }>; export type PlaybookAction = z.infer<typeof PlaybookActionSchema>; export declare const SavePlaybookParamsSchema: z.ZodObject<{ playbook_name: z.ZodString; description: z.ZodString; actions: z.ZodEffects<z.ZodArray<z.ZodObject<{ do: z.ZodString; call: z.ZodOptional<z.ZodString>; args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{ type: z.ZodEnum<["string", "number", "boolean", "array", "object", "placeholder"]>; example: z.ZodAny; }, "strip", z.ZodTypeAny, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }>>>; }, "strip", z.ZodTypeAny, { do: string; args?: Record<string, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }> | undefined; call?: string | undefined; }, { do: string; args?: Record<string, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }> | undefined; call?: string | undefined; }>, "many">, { do: string; args?: Record<string, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }> | undefined; call?: string | undefined; }[], { do: string; args?: Record<string, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }> | undefined; call?: string | undefined; }[]>; domain: z.ZodOptional<z.ZodString>; keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; requirements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; privacy: z.ZodOptional<z.ZodEnum<["public", "private"]>>; source_playbook_id: z.ZodOptional<z.ZodString>; fork_reason: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { description: string; playbook_name: string; actions: { do: string; args?: Record<string, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }> | undefined; call?: string | undefined; }[]; domain?: string | undefined; keywords?: string[] | undefined; requirements?: string[] | undefined; privacy?: "public" | "private" | undefined; source_playbook_id?: string | undefined; fork_reason?: string | undefined; }, { description: string; playbook_name: string; actions: { do: string; args?: Record<string, { type: "string" | "number" | "boolean" | "object" | "array" | "placeholder"; example?: any; }> | undefined; call?: string | undefined; }[]; domain?: string | undefined; keywords?: string[] | undefined; requirements?: string[] | undefined; privacy?: "public" | "private" | undefined; source_playbook_id?: string | undefined; fork_reason?: string | undefined; }>; export type SavePlaybookParams = z.infer<typeof SavePlaybookParamsSchema>; export declare const LogPlaybookUsageParamsSchema: z.ZodObject<{ playbook_id: z.ZodString; success: z.ZodBoolean; error_message: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { playbook_id: string; success: boolean; error_message?: string | undefined; }, { playbook_id: string; success: boolean; error_message?: string | undefined; }>; export type LogPlaybookUsageParams = z.infer<typeof LogPlaybookUsageParamsSchema>; export declare const SubmitFeedbackParamsSchema: z.ZodObject<{ target_type: z.ZodEnum<["server", "playbook"]>; target_id: z.ZodString; vote: z.ZodEnum<["up", "down"]>; message: z.ZodOptional<z.ZodString>; security_assessment: z.ZodOptional<z.ZodObject<{ security_flags: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{ custom_flag: z.ZodString; }, "strip", z.ZodTypeAny, { custom_flag: string; }, { custom_flag: string; }>]>, "many">; risk_assessment: z.ZodString; context_note: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { security_flags: (string | { custom_flag: string; })[]; risk_assessment: string; context_note?: string | undefined; }, { security_flags: (string | { custom_flag: string; })[]; risk_assessment: string; context_note?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { target_type: "server" | "playbook"; target_id: string; vote: "up" | "down"; message?: string | undefined; security_assessment?: { security_flags: (string | { custom_flag: string; })[]; risk_assessment: string; context_note?: string | undefined; } | undefined; }, { target_type: "server" | "playbook"; target_id: string; vote: "up" | "down"; message?: string | undefined; security_assessment?: { security_flags: (string | { custom_flag: string; })[]; risk_assessment: string; context_note?: string | undefined; } | undefined; }>; export type SubmitFeedbackParams = z.infer<typeof SubmitFeedbackParamsSchema>;