mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-20 00:23:58 +01:00
MCP Server Plugin (#335)
This commit is contained in:
@@ -4,7 +4,8 @@ use tauri::{Runtime, WebviewWindow};
|
||||
use ts_rs::TS;
|
||||
use yaak_common::window::WorkspaceWindowTrait;
|
||||
use yaak_models::models::{
|
||||
Environment, Folder, GrpcRequest, HttpRequest, HttpResponse, WebsocketRequest, Workspace,
|
||||
AnyModel, Environment, Folder, GrpcRequest, HttpRequest, HttpResponse, WebsocketRequest,
|
||||
Workspace,
|
||||
};
|
||||
use yaak_models::util::generate_prefixed_id;
|
||||
|
||||
@@ -161,6 +162,9 @@ pub enum InternalEventPayload {
|
||||
WindowInfoRequest(WindowInfoRequest),
|
||||
WindowInfoResponse(WindowInfoResponse),
|
||||
|
||||
ListWorkspacesRequest(ListWorkspacesRequest),
|
||||
ListWorkspacesResponse(ListWorkspacesResponse),
|
||||
|
||||
GetHttpRequestByIdRequest(GetHttpRequestByIdRequest),
|
||||
GetHttpRequestByIdResponse(GetHttpRequestByIdResponse),
|
||||
|
||||
@@ -171,6 +175,12 @@ pub enum InternalEventPayload {
|
||||
ListFoldersRequest(ListFoldersRequest),
|
||||
ListFoldersResponse(ListFoldersResponse),
|
||||
|
||||
UpsertModelRequest(UpsertModelRequest),
|
||||
UpsertModelResponse(UpsertModelResponse),
|
||||
|
||||
DeleteModelRequest(DeleteModelRequest),
|
||||
DeleteModelResponse(DeleteModelResponse),
|
||||
|
||||
GetThemesRequest(GetThemesRequest),
|
||||
GetThemesResponse(GetThemesResponse),
|
||||
|
||||
@@ -573,6 +583,28 @@ pub struct WindowInfoResponse {
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize, TS)]
|
||||
#[serde(default, rename_all = "camelCase")]
|
||||
#[ts(export, export_to = "gen_events.ts")]
|
||||
pub struct ListWorkspacesRequest {}
|
||||
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize, TS)]
|
||||
#[serde(default, rename_all = "camelCase")]
|
||||
#[ts(export, export_to = "gen_events.ts")]
|
||||
pub struct ListWorkspacesResponse {
|
||||
pub workspaces: Vec<WorkspaceInfo>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export, export_to = "gen_events.ts")]
|
||||
pub struct WorkspaceInfo {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
#[ts(skip)]
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[ts(export, export_to = "gen_events.ts")]
|
||||
@@ -1330,6 +1362,35 @@ pub struct ListFoldersResponse {
|
||||
pub folders: Vec<Folder>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export, export_to = "gen_events.ts")]
|
||||
pub struct UpsertModelRequest {
|
||||
pub model: AnyModel,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export, export_to = "gen_events.ts")]
|
||||
pub struct UpsertModelResponse {
|
||||
pub model: AnyModel,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export, export_to = "gen_events.ts")]
|
||||
pub struct DeleteModelRequest {
|
||||
pub model: String,
|
||||
pub id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export, export_to = "gen_events.ts")]
|
||||
pub struct DeleteModelResponse {
|
||||
pub model: AnyModel,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize, TS)]
|
||||
#[serde(default, rename_all = "camelCase")]
|
||||
#[ts(export, export_to = "gen_events.ts")]
|
||||
|
||||
Reference in New Issue
Block a user