@toolplex/client
Version:
The official ToolPlex client for AI agent tool discovery and execution
128 lines (127 loc) • 3.12 kB
TypeScript
export interface InitRequest {
llm_context: LlmContext;
}
export interface ClientPermissions {
use_desktop_commander: boolean;
enable_read_only_mode: boolean;
allowed_mcp_servers?: string[];
}
export interface ClientFlags {
desktop_commander_server_id: string;
blocked_mcp_servers: string[];
}
export interface InitResponse {
session_id: string;
playbooks: {
playbooks: Array<{
id: string;
description: string;
times_used: number;
days_since_last_used: number | null;
}>;
};
is_org_user: boolean;
prompts: Record<string, string>;
permissions: ClientPermissions;
announcement?: string;
flags: ClientFlags;
}
export type SecurityFlag = string;
export type RiskLevel = string;
export interface CustomSecurityFlag {
custom_flag: string;
}
export interface SecurityAssessment {
security_flags: Array<SecurityFlag | CustomSecurityFlag>;
risk_assessment: RiskLevel;
context_note?: string;
}
export interface LlmContext {
model_family: string;
model_name: string;
model_version: string;
chat_client?: string;
}
export interface CreatePlaybookRequest {
playbook_name: string;
description: string;
actions: Array<{
do: string;
call?: string;
}>;
llm_context: LlmContext;
domain?: string;
keywords?: string[];
requirements?: string[];
privacy?: "public" | "private";
source_playbook_id?: string;
fork_reason?: string;
}
export interface CreatePlaybookResponse {
id: string;
success: boolean;
}
export interface LogPlaybookUsageRequest {
playbook_id: string;
success: boolean;
llm_context: LlmContext;
error_message?: string;
}
export interface LogPlaybookUsageResponse {
success: boolean;
}
export interface SubmitFeedbackRequest {
target_type: "server" | "playbook";
target_id: string;
vote: "up" | "down";
message?: string;
llm_context: LlmContext;
machine_context: {
os: string;
arch: string;
memory_gb: number;
cpu_cores: string;
};
security_assessment?: SecurityAssessment;
}
export interface SubmitFeedbackResponse {
id: string;
success: boolean;
}
export interface FeedbackSummaryResponse {
servers: Array<{
server_id: string;
upvotes: number;
downvotes: number;
feedback_ids: string[];
}>;
playbooks: Array<{
playbook_id: string;
upvotes: number;
downvotes: number;
}>;
}
export interface LogTelemetryRequest {
client_version: string;
event_type: string;
session_id?: string;
agent_id?: string;
agent_type?: "user" | "system" | "external";
success?: boolean;
pii_sanitized_error_message?: string;
log_context?: {
[key: string]: any;
};
latency_ms: number;
llm_context: {
model: string;
provider: string;
};
}
export interface LogTelemetryBatchResponse {
success: boolean;
}
export interface SearchResponse {
mcp_servers?: any[];
playbooks?: any[];
}