mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-19 09:04:48 +00:00
feat: add private mcp tunnel tool
This commit is contained in:
parent
cc5a9e0d73
commit
e3aee90cf4
13 changed files with 1923 additions and 614 deletions
|
|
@ -9,6 +9,7 @@ import type {
|
|||
EventsResponse,
|
||||
HealthResponse,
|
||||
MessageRequest,
|
||||
McpTunnelToolResponseRequest,
|
||||
PermissionReplyRequest,
|
||||
ProblemDetails,
|
||||
QuestionReplyRequest,
|
||||
|
|
@ -207,6 +208,18 @@ export class SandboxAgent {
|
|||
);
|
||||
}
|
||||
|
||||
async replyMcpTunnelCall(
|
||||
sessionId: string,
|
||||
callId: string,
|
||||
request: McpTunnelToolResponseRequest,
|
||||
): Promise<void> {
|
||||
await this.requestJson(
|
||||
"POST",
|
||||
`${API_PREFIX}/sessions/${encodeURIComponent(sessionId)}/mcp-tunnel/calls/${encodeURIComponent(callId)}/response`,
|
||||
{ body: request },
|
||||
);
|
||||
}
|
||||
|
||||
async terminateSession(sessionId: string): Promise<void> {
|
||||
await this.requestJson("POST", `${API_PREFIX}/sessions/${encodeURIComponent(sessionId)}/terminate`);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -28,6 +28,9 @@ export type {
|
|||
ItemRole,
|
||||
ItemStatus,
|
||||
MessageRequest,
|
||||
McpTunnelConfig,
|
||||
McpTunnelTool,
|
||||
McpTunnelToolResponseRequest,
|
||||
PermissionEventData,
|
||||
PermissionReply,
|
||||
PermissionReplyRequest,
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ export type ItemKind = S["ItemKind"];
|
|||
export type ItemRole = S["ItemRole"];
|
||||
export type ItemStatus = S["ItemStatus"];
|
||||
export type MessageRequest = S["MessageRequest"];
|
||||
export type McpTunnelConfig = S["McpTunnelConfig"];
|
||||
export type McpTunnelTool = S["McpTunnelTool"];
|
||||
export type McpTunnelToolResponseRequest = S["McpTunnelToolResponseRequest"];
|
||||
export type PermissionEventData = S["PermissionEventData"];
|
||||
export type PermissionReply = S["PermissionReply"];
|
||||
export type PermissionReplyRequest = S["PermissionReplyRequest"];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue