@leaflow/sdk 0.201.0 → 0.203.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fleet/v1/generated/functions.d.ts +14 -48
- package/dist/fleet/v1/generated/functions.js +13 -51
- package/dist/fleet/v1/generated/models.d.ts +32 -93
- package/dist/fleet/v1/generated/models.js +1 -1
- package/dist/fleet/v1/generated/schemas.zod.d.ts +14 -52
- package/dist/fleet/v1/generated/schemas.zod.js +34 -65
- package/dist/fleet/v1/generated/validators/callToolRequest.zod.d.ts +2 -8
- package/dist/fleet/v1/generated/validators/callToolRequest.zod.js +6 -2
- package/dist/fleet/v1/generated/validators/toolDescriptor.zod.d.ts +5 -8
- package/dist/fleet/v1/generated/validators/toolDescriptor.zod.js +9 -3
- package/dist/fleet/v1/generated/validators/toolList.zod.d.ts +4 -8
- package/dist/routes.d.ts +1 -9
- package/dist/routes.js +1 -10
- package/package.json +1 -1
- package/dist/fleet/v1/generated/validators/listMcpToolsParams.zod.d.ts +0 -258
- package/dist/fleet/v1/generated/validators/listMcpToolsParams.zod.js +0 -260
- package/dist/fleet/v1/generated/validators/mcpToolList.zod.d.ts +0 -271
- package/dist/fleet/v1/generated/validators/mcpToolList.zod.js +0 -254
- package/dist/fleet/v1/generated/validators/mcpToolResource.zod.d.ts +0 -256
- package/dist/fleet/v1/generated/validators/mcpToolResource.zod.js +0 -262
- package/dist/fleet/v1/generated/validators/mcpUnavailableServer.zod.d.ts +0 -259
- package/dist/fleet/v1/generated/validators/mcpUnavailableServer.zod.js +0 -250
- package/dist/fleet/v1/generated/validators/toolRef.zod.d.ts +0 -257
- package/dist/fleet/v1/generated/validators/toolRef.zod.js +0 -257
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
* revoked. A participant whose creation failed is not announced.
|
|
243
243
|
* OpenAPI spec version: 1.0.0
|
|
244
244
|
*/
|
|
245
|
-
import type { AccountList, AccountResource, ApproveEnrollmentRequest, CallMcpToolRequest, CallMcpToolResponse, CallToolRequest, CallToolResponse, CreateGroupMemberRequest, CreateGroupRequest, CreateMachineRegistrationRequest, CreateMachineRegistrationResponse, CreateParticipantRequest, CreateParticipantResponse, CreatePeerConnectionCandidatesRequest, CreatePeerConnectionRequest, CreateSessionRequest, DeleteMcpServerParams, DenyPrivilegeRequestRequest, EnrollmentResource, Error, FindEnrollmentByPairingCodeParams, FindEnrollmentResponse, GetPeerConnectionParams, GroupList, GroupResource, ListAccountsParams, ListGroupMembersParams, ListGroupsParams, ListMachineEventsParams, ListMachineRegistrationsParams, ListMachinesParams,
|
|
245
|
+
import type { AccountList, AccountResource, ApproveEnrollmentRequest, CallMcpToolRequest, CallMcpToolResponse, CallToolRequest, CallToolResponse, CreateGroupMemberRequest, CreateGroupRequest, CreateMachineRegistrationRequest, CreateMachineRegistrationResponse, CreateParticipantRequest, CreateParticipantResponse, CreatePeerConnectionCandidatesRequest, CreatePeerConnectionRequest, CreateSessionRequest, DeleteMcpServerParams, DenyPrivilegeRequestRequest, EnrollmentResource, Error, FindEnrollmentByPairingCodeParams, FindEnrollmentResponse, GetPeerConnectionParams, GroupList, GroupResource, ListAccountsParams, ListGroupMembersParams, ListGroupsParams, ListMachineEventsParams, ListMachineRegistrationsParams, ListMachinesParams, ListPrivilegeAutoApprovalsParams, ListPrivilegeRequestsParams, ListSessionsParams, ListToolsParams, MachineEventList, MachineList, MachineRegistrationList, MachineRegistrationResource, MachineResource, McpConfigurationFile, McpConfigurationResource, MigrationStep, ParticipantList, ParticipantResource, PeerConnection, PrivilegeAutoApprovalList, PrivilegeAutoApprovalResource, PrivilegeRequestList, PrivilegeRequestResource, RenewParticipantRequest, RenewParticipantResponse, ReplaceMcpConfigurationRequest, RtcConfiguration, RunCommandRequest, RunCommandResponse, SendMcpRequestRequest, SendMcpRequestResponse, SessionList, SessionResource, ToolActivityList, ToolList, UpdateAccountRequest, UpdateGroupRequest, UpdateMachineRequest, UpdateMcpServerRequest, UpdateMcpServerResponse, UpdatePrivilegeAutoApprovalRequest } from "./models.js";
|
|
246
246
|
export type HTTPStatusCode1xx = 100 | 101 | 102 | 103;
|
|
247
247
|
export type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;
|
|
248
248
|
export type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
|
|
@@ -554,7 +554,9 @@ export type listToolsResponse = listToolsResponseSuccess | listToolsResponseErro
|
|
|
554
554
|
export declare const getListToolsUrl: (machineId: string, params: ListToolsParams) => string;
|
|
555
555
|
/**
|
|
556
556
|
* Queries Agent's builtin tools and the caller's configured MCP servers live. No directory,
|
|
557
|
-
* result or image is cached.
|
|
557
|
+
* result or image is cached. Each tool has one callable name: builtin tools are named
|
|
558
|
+
* computer.*, MCP tools are named `<server>__<tool>`; source only filters the list and is not
|
|
559
|
+
* part of a tool's identity. Requires fleet:machines.login; builtin capabilities retain
|
|
558
560
|
* their native policies and read-only restrictions. Ensures or reuses the caller's single
|
|
559
561
|
* open graphical session, without launching a desktop environment. The client instance is
|
|
560
562
|
* a UUID generated once per running client, not an authorization credential. Each request
|
|
@@ -582,19 +584,20 @@ export type callToolResponseError = callToolResponseDefault & {
|
|
|
582
584
|
export type callToolResponse = callToolResponseSuccess | callToolResponseError;
|
|
583
585
|
export declare const getCallToolUrl: (machineId: string) => string;
|
|
584
586
|
/**
|
|
585
|
-
* Uses the same current permissions, directory account and graphical session as
|
|
586
|
-
* Listing is not a precondition: callers may use a previously discovered
|
|
587
|
+
* Uses the same current permissions, directory account and graphical session as list-tools.
|
|
588
|
+
* Listing is not a precondition: callers may use a previously discovered tool name, and this
|
|
587
589
|
* operation never sends a discovery request or refreshes schemas before executing it.
|
|
588
590
|
* A removed tool or MCP server returns TOOL_NOT_FOUND, as does a direct builtin computer.*
|
|
589
591
|
* call while virtual desktop capability is unavailable. Actual permission errors remain
|
|
590
|
-
* permission errors; a missing target window is not a missing tool. Use
|
|
592
|
+
* permission errors; a missing target window is not a missing tool. Use list-tools only when
|
|
591
593
|
* discovery or refresh is needed, and do not cache or reuse execution results.
|
|
592
|
-
*
|
|
593
|
-
* object is at most 256 KiB. The complete result is at most
|
|
594
|
-
* with each encoded image at most 4 MiB; images are converted
|
|
595
|
-
* boundary, without recompression or persistence. Cancellation is
|
|
596
|
-
* disconnect or failed response does not prove that side effects did
|
|
597
|
-
* automatically replay. operation_id only correlates live activity, not
|
|
594
|
+
* The name selects exactly one tool: builtin tools are computer.*, MCP tools are
|
|
595
|
+
* `<server>__<tool>`. The arguments object is at most 256 KiB. The complete result is at most
|
|
596
|
+
* 8 MiB in the protobuf transport, with each encoded image at most 4 MiB; images are converted
|
|
597
|
+
* to base64 once at this JSON boundary, without recompression or persistence. Cancellation is
|
|
598
|
+
* propagated. A timeout, disconnect or failed response does not prove that side effects did
|
|
599
|
+
* not happen; do not automatically replay. operation_id only correlates live activity, not
|
|
600
|
+
* idempotency.
|
|
598
601
|
* @summary Call a live builtin or external MCP tool
|
|
599
602
|
*/
|
|
600
603
|
export declare const callTool: (machineId: string, callToolRequest: CallToolRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<callToolResponse>;
|
|
@@ -699,43 +702,6 @@ export declare const getCallMcpToolUrl: (machineId: string, serverName: string,
|
|
|
699
702
|
* @summary Call an MCP tool
|
|
700
703
|
*/
|
|
701
704
|
export declare const callMcpTool: (machineId: string, serverName: string, toolName: string, callMcpToolRequest: CallMcpToolRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<callMcpToolResponse>;
|
|
702
|
-
export type listMcpToolsResponse200 = {
|
|
703
|
-
data: McpToolList;
|
|
704
|
-
status: 200;
|
|
705
|
-
};
|
|
706
|
-
export type listMcpToolsResponseDefault = {
|
|
707
|
-
data: Error;
|
|
708
|
-
status: Exclude<HTTPStatusCodes, 200>;
|
|
709
|
-
};
|
|
710
|
-
export type listMcpToolsResponseSuccess = listMcpToolsResponse200 & {
|
|
711
|
-
headers: Headers;
|
|
712
|
-
};
|
|
713
|
-
export type listMcpToolsResponseError = listMcpToolsResponseDefault & {
|
|
714
|
-
headers: Headers;
|
|
715
|
-
};
|
|
716
|
-
export type listMcpToolsResponse = listMcpToolsResponseSuccess | listMcpToolsResponseError;
|
|
717
|
-
export declare const getListMcpToolsUrl: (machineId: string, params?: ListMcpToolsParams) => string;
|
|
718
|
-
/**
|
|
719
|
-
* Lists the tools of the caller's servers on the machine, or of one of them, that match
|
|
720
|
-
* `query`: every word of it, ignoring case, in the tool's name, title or description. They
|
|
721
|
-
* are ordered by server, then by tool name. Servers that are not running are started to
|
|
722
|
-
* learn their tools; one that cannot be is named in `unavailable_servers`, and the others are
|
|
723
|
-
* listed anyway. Slow servers do not hold the request up: those still starting are named
|
|
724
|
-
* with `timeout` and go on starting, so that a later request lists their tools. Requires
|
|
725
|
-
* `fleet:machines.login` on the machine.
|
|
726
|
-
*
|
|
727
|
-
* Fails with:
|
|
728
|
-
* - `MCP_SERVER_NOT_FOUND` when `server` is not configured;
|
|
729
|
-
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
730
|
-
* - `FEATURE_UNAVAILABLE` when the machine does not offer `leaflow.fleet.mcp.v1`;
|
|
731
|
-
* - `USER_NOT_FOUND`, `USER_NOT_ALLOWED`, `ACCOUNT_EXPIRED` or `PAM_PERMISSION_DENIED` when
|
|
732
|
-
* the machine refuses the account, as for opening a session;
|
|
733
|
-
* - `MCP_START_FAILED` when the machine could not start MCP for the caller's account;
|
|
734
|
-
* - `MACHINE_TIMEOUT` when the machine did not answer in time.
|
|
735
|
-
* @deprecated
|
|
736
|
-
* @summary List the caller's MCP tools on a machine
|
|
737
|
-
*/
|
|
738
|
-
export declare const listMcpTools: (machineId: string, params?: ListMcpToolsParams, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<listMcpToolsResponse>;
|
|
739
705
|
export type getPrivilegeAutoApprovalResponse200 = {
|
|
740
706
|
data: PrivilegeAutoApprovalResource;
|
|
741
707
|
status: 200;
|
|
@@ -344,7 +344,9 @@ export const getListToolsUrl = (machineId, params) => {
|
|
|
344
344
|
};
|
|
345
345
|
/**
|
|
346
346
|
* Queries Agent's builtin tools and the caller's configured MCP servers live. No directory,
|
|
347
|
-
* result or image is cached.
|
|
347
|
+
* result or image is cached. Each tool has one callable name: builtin tools are named
|
|
348
|
+
* computer.*, MCP tools are named `<server>__<tool>`; source only filters the list and is not
|
|
349
|
+
* part of a tool's identity. Requires fleet:machines.login; builtin capabilities retain
|
|
348
350
|
* their native policies and read-only restrictions. Ensures or reuses the caller's single
|
|
349
351
|
* open graphical session, without launching a desktop environment. The client instance is
|
|
350
352
|
* a UUID generated once per running client, not an authorization credential. Each request
|
|
@@ -367,19 +369,20 @@ export const getCallToolUrl = (machineId) => {
|
|
|
367
369
|
return `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/tools:call`;
|
|
368
370
|
};
|
|
369
371
|
/**
|
|
370
|
-
* Uses the same current permissions, directory account and graphical session as
|
|
371
|
-
* Listing is not a precondition: callers may use a previously discovered
|
|
372
|
+
* Uses the same current permissions, directory account and graphical session as list-tools.
|
|
373
|
+
* Listing is not a precondition: callers may use a previously discovered tool name, and this
|
|
372
374
|
* operation never sends a discovery request or refreshes schemas before executing it.
|
|
373
375
|
* A removed tool or MCP server returns TOOL_NOT_FOUND, as does a direct builtin computer.*
|
|
374
376
|
* call while virtual desktop capability is unavailable. Actual permission errors remain
|
|
375
|
-
* permission errors; a missing target window is not a missing tool. Use
|
|
377
|
+
* permission errors; a missing target window is not a missing tool. Use list-tools only when
|
|
376
378
|
* discovery or refresh is needed, and do not cache or reuse execution results.
|
|
377
|
-
*
|
|
378
|
-
* object is at most 256 KiB. The complete result is at most
|
|
379
|
-
* with each encoded image at most 4 MiB; images are converted
|
|
380
|
-
* boundary, without recompression or persistence. Cancellation is
|
|
381
|
-
* disconnect or failed response does not prove that side effects did
|
|
382
|
-
* automatically replay. operation_id only correlates live activity, not
|
|
379
|
+
* The name selects exactly one tool: builtin tools are computer.*, MCP tools are
|
|
380
|
+
* `<server>__<tool>`. The arguments object is at most 256 KiB. The complete result is at most
|
|
381
|
+
* 8 MiB in the protobuf transport, with each encoded image at most 4 MiB; images are converted
|
|
382
|
+
* to base64 once at this JSON boundary, without recompression or persistence. Cancellation is
|
|
383
|
+
* propagated. A timeout, disconnect or failed response does not prove that side effects did
|
|
384
|
+
* not happen; do not automatically replay. operation_id only correlates live activity, not
|
|
385
|
+
* idempotency.
|
|
383
386
|
* @summary Call a live builtin or external MCP tool
|
|
384
387
|
*/
|
|
385
388
|
export const callTool = async (machineId, callToolRequest, options, fetchFn) => {
|
|
@@ -528,47 +531,6 @@ export const callMcpTool = async (machineId, serverName, toolName, callMcpToolRe
|
|
|
528
531
|
const data = body ? JSON.parse(body) : {};
|
|
529
532
|
return { data, status: res.status, headers: res.headers };
|
|
530
533
|
};
|
|
531
|
-
export const getListMcpToolsUrl = (machineId, params) => {
|
|
532
|
-
const normalizedParams = new URLSearchParams();
|
|
533
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
534
|
-
if (value !== undefined) {
|
|
535
|
-
normalizedParams.append(key, value === null ? "null" : String(value));
|
|
536
|
-
}
|
|
537
|
-
});
|
|
538
|
-
const stringifiedParams = normalizedParams.toString();
|
|
539
|
-
return stringifiedParams.length > 0
|
|
540
|
-
? `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/mcp-tools?${stringifiedParams}`
|
|
541
|
-
: `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/mcp-tools`;
|
|
542
|
-
};
|
|
543
|
-
/**
|
|
544
|
-
* Lists the tools of the caller's servers on the machine, or of one of them, that match
|
|
545
|
-
* `query`: every word of it, ignoring case, in the tool's name, title or description. They
|
|
546
|
-
* are ordered by server, then by tool name. Servers that are not running are started to
|
|
547
|
-
* learn their tools; one that cannot be is named in `unavailable_servers`, and the others are
|
|
548
|
-
* listed anyway. Slow servers do not hold the request up: those still starting are named
|
|
549
|
-
* with `timeout` and go on starting, so that a later request lists their tools. Requires
|
|
550
|
-
* `fleet:machines.login` on the machine.
|
|
551
|
-
*
|
|
552
|
-
* Fails with:
|
|
553
|
-
* - `MCP_SERVER_NOT_FOUND` when `server` is not configured;
|
|
554
|
-
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
555
|
-
* - `FEATURE_UNAVAILABLE` when the machine does not offer `leaflow.fleet.mcp.v1`;
|
|
556
|
-
* - `USER_NOT_FOUND`, `USER_NOT_ALLOWED`, `ACCOUNT_EXPIRED` or `PAM_PERMISSION_DENIED` when
|
|
557
|
-
* the machine refuses the account, as for opening a session;
|
|
558
|
-
* - `MCP_START_FAILED` when the machine could not start MCP for the caller's account;
|
|
559
|
-
* - `MACHINE_TIMEOUT` when the machine did not answer in time.
|
|
560
|
-
* @deprecated
|
|
561
|
-
* @summary List the caller's MCP tools on a machine
|
|
562
|
-
*/
|
|
563
|
-
export const listMcpTools = async (machineId, params, options, fetchFn) => {
|
|
564
|
-
const res = await (fetchFn ?? fetch)(getListMcpToolsUrl(machineId, params), {
|
|
565
|
-
...options,
|
|
566
|
-
method: "GET",
|
|
567
|
-
});
|
|
568
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
569
|
-
const data = body ? JSON.parse(body) : {};
|
|
570
|
-
return { data, status: res.status, headers: res.headers };
|
|
571
|
-
};
|
|
572
534
|
export const getGetPrivilegeAutoApprovalUrl = (machineId) => {
|
|
573
535
|
return `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/privilege-auto-approval`;
|
|
574
536
|
};
|
|
@@ -979,25 +979,14 @@ export interface SendMcpRequestResponse {
|
|
|
979
979
|
/** The server's JSON-RPC 2.0 response, with the id of the request */
|
|
980
980
|
response: SendMcpRequestResponseResponse;
|
|
981
981
|
}
|
|
982
|
-
|
|
983
|
-
|
|
982
|
+
/**
|
|
983
|
+
* Whether the tool is builtin or comes from an MCP server. For filtering only.
|
|
984
|
+
*/
|
|
985
|
+
export type ToolDescriptorSource = (typeof ToolDescriptorSource)[keyof typeof ToolDescriptorSource];
|
|
986
|
+
export declare const ToolDescriptorSource: {
|
|
984
987
|
readonly builtin: "builtin";
|
|
985
988
|
readonly mcp: "mcp";
|
|
986
989
|
};
|
|
987
|
-
export interface ToolRef {
|
|
988
|
-
source: ToolRefSource;
|
|
989
|
-
/**
|
|
990
|
-
* @minLength 1
|
|
991
|
-
* @maxLength 128
|
|
992
|
-
*/
|
|
993
|
-
name: string;
|
|
994
|
-
/**
|
|
995
|
-
* Required only for mcp; forbidden for builtin
|
|
996
|
-
* @minLength 1
|
|
997
|
-
* @maxLength 64
|
|
998
|
-
*/
|
|
999
|
-
server?: string;
|
|
1000
|
-
}
|
|
1001
990
|
export type ToolDescriptorInputSchema = {
|
|
1002
991
|
[key: string]: unknown;
|
|
1003
992
|
};
|
|
@@ -1011,8 +1000,15 @@ export type ToolDescriptorMetadata = {
|
|
|
1011
1000
|
[key: string]: unknown;
|
|
1012
1001
|
};
|
|
1013
1002
|
export interface ToolDescriptor {
|
|
1014
|
-
|
|
1003
|
+
/**
|
|
1004
|
+
* The name to call it by. Builtin tools are named computer.*; MCP tools are named
|
|
1005
|
+
* `<server>__<tool>`, so a name selects exactly one tool.
|
|
1006
|
+
* @minLength 1
|
|
1007
|
+
* @maxLength 194
|
|
1008
|
+
*/
|
|
1015
1009
|
name: string;
|
|
1010
|
+
/** Whether the tool is builtin or comes from an MCP server. For filtering only. */
|
|
1011
|
+
source: ToolDescriptorSource;
|
|
1016
1012
|
title: string;
|
|
1017
1013
|
description: string;
|
|
1018
1014
|
input_schema: ToolDescriptorInputSchema;
|
|
@@ -1045,7 +1041,13 @@ export type CallToolRequestArguments = {
|
|
|
1045
1041
|
};
|
|
1046
1042
|
export interface CallToolRequest {
|
|
1047
1043
|
client_instance_id: string;
|
|
1048
|
-
|
|
1044
|
+
/**
|
|
1045
|
+
* The name from list-tools. Builtin tools are computer.*; MCP tools are
|
|
1046
|
+
* `<server>__<tool>`. The name selects the tool; source is not part of the call.
|
|
1047
|
+
* @minLength 1
|
|
1048
|
+
* @maxLength 194
|
|
1049
|
+
*/
|
|
1050
|
+
tool: string;
|
|
1049
1051
|
/** A JSON object, at most 256 KiB when encoded */
|
|
1050
1052
|
arguments: CallToolRequestArguments;
|
|
1051
1053
|
read_only?: boolean;
|
|
@@ -1166,59 +1168,6 @@ export interface CallMcpToolResponse {
|
|
|
1166
1168
|
/** The tool's MCP `CallToolResult`, with `content`, `structuredContent` and `isError` */
|
|
1167
1169
|
result: CallMcpToolResponseResult;
|
|
1168
1170
|
}
|
|
1169
|
-
/**
|
|
1170
|
-
* The JSON Schema of its arguments
|
|
1171
|
-
*/
|
|
1172
|
-
export type McpToolResourceInputSchema = {
|
|
1173
|
-
[key: string]: unknown;
|
|
1174
|
-
};
|
|
1175
|
-
/**
|
|
1176
|
-
* The JSON Schema of its structured result; null when it has none
|
|
1177
|
-
* @nullable
|
|
1178
|
-
*/
|
|
1179
|
-
export type McpToolResourceOutputSchema = {
|
|
1180
|
-
[key: string]: unknown;
|
|
1181
|
-
} | null;
|
|
1182
|
-
/**
|
|
1183
|
-
* Its MCP `ToolAnnotations`, such as `readOnlyHint`; hints of the server, not guarantees
|
|
1184
|
-
* @nullable
|
|
1185
|
-
*/
|
|
1186
|
-
export type McpToolResourceAnnotations = {
|
|
1187
|
-
[key: string]: unknown;
|
|
1188
|
-
} | null;
|
|
1189
|
-
export interface McpToolResource {
|
|
1190
|
-
/** The server that offers it */
|
|
1191
|
-
server: string;
|
|
1192
|
-
name: string;
|
|
1193
|
-
title: string;
|
|
1194
|
-
description: string;
|
|
1195
|
-
/** The JSON Schema of its arguments */
|
|
1196
|
-
input_schema: McpToolResourceInputSchema;
|
|
1197
|
-
/**
|
|
1198
|
-
* The JSON Schema of its structured result; null when it has none
|
|
1199
|
-
* @nullable
|
|
1200
|
-
*/
|
|
1201
|
-
output_schema: McpToolResourceOutputSchema;
|
|
1202
|
-
/**
|
|
1203
|
-
* Its MCP `ToolAnnotations`, such as `readOnlyHint`; hints of the server, not guarantees
|
|
1204
|
-
* @nullable
|
|
1205
|
-
*/
|
|
1206
|
-
annotations: McpToolResourceAnnotations;
|
|
1207
|
-
}
|
|
1208
|
-
export interface McpUnavailableServer {
|
|
1209
|
-
name: string;
|
|
1210
|
-
failure: McpServerFailure;
|
|
1211
|
-
}
|
|
1212
|
-
export interface McpToolList {
|
|
1213
|
-
items: McpToolResource[];
|
|
1214
|
-
/**
|
|
1215
|
-
* Null on the last page
|
|
1216
|
-
* @nullable
|
|
1217
|
-
*/
|
|
1218
|
-
next_page_token: string | null;
|
|
1219
|
-
/** Servers whose tools are missing because they could not be started or reached */
|
|
1220
|
-
unavailable_servers: McpUnavailableServer[];
|
|
1221
|
-
}
|
|
1222
1171
|
/**
|
|
1223
1172
|
* How the caller's privilege requests on the machine are decided without asking them:
|
|
1224
1173
|
* - `automatic_review`, recommended: a large language model reviews each request from what
|
|
@@ -1592,16 +1541,28 @@ export type DeleteMcpServerParams = {
|
|
|
1592
1541
|
expected_revision?: string;
|
|
1593
1542
|
};
|
|
1594
1543
|
export type ListToolsParams = {
|
|
1544
|
+
/**
|
|
1545
|
+
* A UUID generated once per running client and reused for its lifetime. It separates
|
|
1546
|
+
* concurrent callers of the same user and is not an authorization credential.
|
|
1547
|
+
*/
|
|
1595
1548
|
client_instance_id: string;
|
|
1549
|
+
/**
|
|
1550
|
+
* Return only tools of this source. A filter, not part of a tool's identity.
|
|
1551
|
+
*/
|
|
1596
1552
|
source?: ListToolsSource;
|
|
1597
1553
|
/**
|
|
1554
|
+
* Return only this MCP server's tools.
|
|
1598
1555
|
* @maxLength 64
|
|
1599
1556
|
*/
|
|
1600
1557
|
mcp_server?: string;
|
|
1601
1558
|
/**
|
|
1559
|
+
* Words that each must occur in a tool's name, title or description, ignoring case.
|
|
1602
1560
|
* @maxLength 256
|
|
1603
1561
|
*/
|
|
1604
1562
|
query?: string;
|
|
1563
|
+
/**
|
|
1564
|
+
* Sign the control authorization as read-only, so mutating tools are refused.
|
|
1565
|
+
*/
|
|
1605
1566
|
read_only?: boolean;
|
|
1606
1567
|
/**
|
|
1607
1568
|
* @minimum 1
|
|
@@ -1619,28 +1580,6 @@ export declare const ListToolsSource: {
|
|
|
1619
1580
|
readonly builtin: "builtin";
|
|
1620
1581
|
readonly mcp: "mcp";
|
|
1621
1582
|
};
|
|
1622
|
-
export type ListMcpToolsParams = {
|
|
1623
|
-
/**
|
|
1624
|
-
* Only this server's tools
|
|
1625
|
-
* @maxLength 64
|
|
1626
|
-
*/
|
|
1627
|
-
server?: string;
|
|
1628
|
-
/**
|
|
1629
|
-
* Words that each must occur in a tool's name, title or description
|
|
1630
|
-
* @maxLength 256
|
|
1631
|
-
*/
|
|
1632
|
-
query?: string;
|
|
1633
|
-
/**
|
|
1634
|
-
* @minimum 1
|
|
1635
|
-
* @maximum 500
|
|
1636
|
-
*/
|
|
1637
|
-
page_size?: number;
|
|
1638
|
-
/**
|
|
1639
|
-
* `next_page_token` of the previous page
|
|
1640
|
-
* @maxLength 1024
|
|
1641
|
-
*/
|
|
1642
|
-
page_token?: string;
|
|
1643
|
-
};
|
|
1644
1583
|
export type ListPrivilegeAutoApprovalsParams = {
|
|
1645
1584
|
/**
|
|
1646
1585
|
* 1-based page number. Defaults to 1.
|
|
@@ -445,7 +445,9 @@ export declare const DeleteMcpServerQueryParams: zod.ZodObject<{
|
|
|
445
445
|
}, zod.z.core.$strict>;
|
|
446
446
|
/**
|
|
447
447
|
* Queries Agent's builtin tools and the caller's configured MCP servers live. No directory,
|
|
448
|
-
* result or image is cached.
|
|
448
|
+
* result or image is cached. Each tool has one callable name: builtin tools are named
|
|
449
|
+
* computer.*, MCP tools are named `<server>__<tool>`; source only filters the list and is not
|
|
450
|
+
* part of a tool's identity. Requires fleet:machines.login; builtin capabilities retain
|
|
449
451
|
* their native policies and read-only restrictions. Ensures or reuses the caller's single
|
|
450
452
|
* open graphical session, without launching a desktop environment. The client instance is
|
|
451
453
|
* a UUID generated once per running client, not an authorization credential. Each request
|
|
@@ -479,19 +481,20 @@ export declare const ListToolsQueryParams: zod.ZodObject<{
|
|
|
479
481
|
page_token: zod.ZodOptional<zod.ZodString>;
|
|
480
482
|
}, zod.z.core.$strict>;
|
|
481
483
|
/**
|
|
482
|
-
* Uses the same current permissions, directory account and graphical session as
|
|
483
|
-
* Listing is not a precondition: callers may use a previously discovered
|
|
484
|
+
* Uses the same current permissions, directory account and graphical session as list-tools.
|
|
485
|
+
* Listing is not a precondition: callers may use a previously discovered tool name, and this
|
|
484
486
|
* operation never sends a discovery request or refreshes schemas before executing it.
|
|
485
487
|
* A removed tool or MCP server returns TOOL_NOT_FOUND, as does a direct builtin computer.*
|
|
486
488
|
* call while virtual desktop capability is unavailable. Actual permission errors remain
|
|
487
|
-
* permission errors; a missing target window is not a missing tool. Use
|
|
489
|
+
* permission errors; a missing target window is not a missing tool. Use list-tools only when
|
|
488
490
|
* discovery or refresh is needed, and do not cache or reuse execution results.
|
|
489
|
-
*
|
|
490
|
-
* object is at most 256 KiB. The complete result is at most
|
|
491
|
-
* with each encoded image at most 4 MiB; images are converted
|
|
492
|
-
* boundary, without recompression or persistence. Cancellation is
|
|
493
|
-
* disconnect or failed response does not prove that side effects did
|
|
494
|
-
* automatically replay. operation_id only correlates live activity, not
|
|
491
|
+
* The name selects exactly one tool: builtin tools are computer.*, MCP tools are
|
|
492
|
+
* `<server>__<tool>`. The arguments object is at most 256 KiB. The complete result is at most
|
|
493
|
+
* 8 MiB in the protobuf transport, with each encoded image at most 4 MiB; images are converted
|
|
494
|
+
* to base64 once at this JSON boundary, without recompression or persistence. Cancellation is
|
|
495
|
+
* propagated. A timeout, disconnect or failed response does not prove that side effects did
|
|
496
|
+
* not happen; do not automatically replay. operation_id only correlates live activity, not
|
|
497
|
+
* idempotency.
|
|
495
498
|
* @summary Call a live builtin or external MCP tool
|
|
496
499
|
*/
|
|
497
500
|
export declare const CallToolParams: zod.ZodObject<{
|
|
@@ -499,14 +502,7 @@ export declare const CallToolParams: zod.ZodObject<{
|
|
|
499
502
|
}, zod.z.core.$strict>;
|
|
500
503
|
export declare const CallToolBody: zod.ZodObject<{
|
|
501
504
|
client_instance_id: zod.ZodUUID;
|
|
502
|
-
tool: zod.
|
|
503
|
-
source: zod.ZodEnum<{
|
|
504
|
-
builtin: "builtin";
|
|
505
|
-
mcp: "mcp";
|
|
506
|
-
}>;
|
|
507
|
-
name: zod.ZodString;
|
|
508
|
-
server: zod.ZodOptional<zod.ZodString>;
|
|
509
|
-
}, zod.z.core.$strict>;
|
|
505
|
+
tool: zod.ZodString;
|
|
510
506
|
arguments: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
|
|
511
507
|
read_only: zod.ZodDefault<zod.ZodBoolean>;
|
|
512
508
|
timeout_seconds: zod.ZodDefault<zod.ZodInt>;
|
|
@@ -586,40 +582,6 @@ export declare const CallMcpToolBody: zod.ZodObject<{
|
|
|
586
582
|
arguments: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
|
|
587
583
|
timeout_seconds: zod.ZodDefault<zod.ZodInt>;
|
|
588
584
|
}, zod.z.core.$strict>;
|
|
589
|
-
/**
|
|
590
|
-
* Lists the tools of the caller's servers on the machine, or of one of them, that match
|
|
591
|
-
* `query`: every word of it, ignoring case, in the tool's name, title or description. They
|
|
592
|
-
* are ordered by server, then by tool name. Servers that are not running are started to
|
|
593
|
-
* learn their tools; one that cannot be is named in `unavailable_servers`, and the others are
|
|
594
|
-
* listed anyway. Slow servers do not hold the request up: those still starting are named
|
|
595
|
-
* with `timeout` and go on starting, so that a later request lists their tools. Requires
|
|
596
|
-
* `fleet:machines.login` on the machine.
|
|
597
|
-
*
|
|
598
|
-
* Fails with:
|
|
599
|
-
* - `MCP_SERVER_NOT_FOUND` when `server` is not configured;
|
|
600
|
-
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
601
|
-
* - `FEATURE_UNAVAILABLE` when the machine does not offer `leaflow.fleet.mcp.v1`;
|
|
602
|
-
* - `USER_NOT_FOUND`, `USER_NOT_ALLOWED`, `ACCOUNT_EXPIRED` or `PAM_PERMISSION_DENIED` when
|
|
603
|
-
* the machine refuses the account, as for opening a session;
|
|
604
|
-
* - `MCP_START_FAILED` when the machine could not start MCP for the caller's account;
|
|
605
|
-
* - `MACHINE_TIMEOUT` when the machine did not answer in time.
|
|
606
|
-
* @deprecated
|
|
607
|
-
* @summary List the caller's MCP tools on a machine
|
|
608
|
-
*/
|
|
609
|
-
export declare const ListMcpToolsParams: zod.ZodObject<{
|
|
610
|
-
machineId: zod.ZodUUID;
|
|
611
|
-
}, zod.z.core.$strict>;
|
|
612
|
-
export declare const listMcpToolsQueryServerMax = 64;
|
|
613
|
-
export declare const listMcpToolsQueryQueryMax = 256;
|
|
614
|
-
export declare const listMcpToolsQueryPageSizeDefault = 100;
|
|
615
|
-
export declare const listMcpToolsQueryPageSizeMax = 500;
|
|
616
|
-
export declare const listMcpToolsQueryPageTokenMax = 1024;
|
|
617
|
-
export declare const ListMcpToolsQueryParams: zod.ZodObject<{
|
|
618
|
-
server: zod.ZodOptional<zod.ZodString>;
|
|
619
|
-
query: zod.ZodOptional<zod.ZodString>;
|
|
620
|
-
page_size: zod.ZodDefault<zod.ZodInt>;
|
|
621
|
-
page_token: zod.ZodOptional<zod.ZodString>;
|
|
622
|
-
}, zod.z.core.$strict>;
|
|
623
585
|
/**
|
|
624
586
|
* Returns the caller's automatic approval of their privilege requests on the machine. Fails
|
|
625
587
|
* with `PRIVILEGE_AUTO_APPROVAL_NOT_FOUND` while the caller is asked every time, including
|
|
@@ -478,7 +478,9 @@ export const DeleteMcpServerQueryParams = zod.strictObject({
|
|
|
478
478
|
});
|
|
479
479
|
/**
|
|
480
480
|
* Queries Agent's builtin tools and the caller's configured MCP servers live. No directory,
|
|
481
|
-
* result or image is cached.
|
|
481
|
+
* result or image is cached. Each tool has one callable name: builtin tools are named
|
|
482
|
+
* computer.*, MCP tools are named `<server>__<tool>`; source only filters the list and is not
|
|
483
|
+
* part of a tool's identity. Requires fleet:machines.login; builtin capabilities retain
|
|
482
484
|
* their native policies and read-only restrictions. Ensures or reuses the caller's single
|
|
483
485
|
* open graphical session, without launching a desktop environment. The client instance is
|
|
484
486
|
* a UUID generated once per running client, not an authorization credential. Each request
|
|
@@ -499,28 +501,45 @@ export const listToolsQueryPageSizeDefault = 100;
|
|
|
499
501
|
export const listToolsQueryPageSizeMax = 100;
|
|
500
502
|
export const listToolsQueryPageTokenMax = 4096;
|
|
501
503
|
export const ListToolsQueryParams = zod.strictObject({
|
|
502
|
-
client_instance_id: zod
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
504
|
+
client_instance_id: zod
|
|
505
|
+
.uuid()
|
|
506
|
+
.describe("A UUID generated once per running client and reused for its lifetime. It separates\nconcurrent callers of the same user and is not an authorization credential."),
|
|
507
|
+
source: zod
|
|
508
|
+
.enum(["all", "builtin", "mcp"])
|
|
509
|
+
.default(listToolsQuerySourceDefault)
|
|
510
|
+
.describe("Return only tools of this source. A filter, not part of a tool's identity."),
|
|
511
|
+
mcp_server: zod
|
|
512
|
+
.string()
|
|
513
|
+
.max(listToolsQueryMcpServerMax)
|
|
514
|
+
.optional()
|
|
515
|
+
.describe("Return only this MCP server's tools."),
|
|
516
|
+
query: zod
|
|
517
|
+
.string()
|
|
518
|
+
.max(listToolsQueryQueryMax)
|
|
519
|
+
.optional()
|
|
520
|
+
.describe("Words that each must occur in a tool's name, title or description, ignoring case."),
|
|
521
|
+
read_only: zod
|
|
522
|
+
.boolean()
|
|
523
|
+
.default(listToolsQueryReadOnlyDefault)
|
|
524
|
+
.describe("Sign the control authorization as read-only, so mutating tools are refused."),
|
|
507
525
|
page_size: zod.int().min(1).max(listToolsQueryPageSizeMax).default(listToolsQueryPageSizeDefault),
|
|
508
526
|
page_token: zod.string().max(listToolsQueryPageTokenMax).optional(),
|
|
509
527
|
});
|
|
510
528
|
/**
|
|
511
|
-
* Uses the same current permissions, directory account and graphical session as
|
|
512
|
-
* Listing is not a precondition: callers may use a previously discovered
|
|
529
|
+
* Uses the same current permissions, directory account and graphical session as list-tools.
|
|
530
|
+
* Listing is not a precondition: callers may use a previously discovered tool name, and this
|
|
513
531
|
* operation never sends a discovery request or refreshes schemas before executing it.
|
|
514
532
|
* A removed tool or MCP server returns TOOL_NOT_FOUND, as does a direct builtin computer.*
|
|
515
533
|
* call while virtual desktop capability is unavailable. Actual permission errors remain
|
|
516
|
-
* permission errors; a missing target window is not a missing tool. Use
|
|
534
|
+
* permission errors; a missing target window is not a missing tool. Use list-tools only when
|
|
517
535
|
* discovery or refresh is needed, and do not cache or reuse execution results.
|
|
518
|
-
*
|
|
519
|
-
* object is at most 256 KiB. The complete result is at most
|
|
520
|
-
* with each encoded image at most 4 MiB; images are converted
|
|
521
|
-
* boundary, without recompression or persistence. Cancellation is
|
|
522
|
-
* disconnect or failed response does not prove that side effects did
|
|
523
|
-
* automatically replay. operation_id only correlates live activity, not
|
|
536
|
+
* The name selects exactly one tool: builtin tools are computer.*, MCP tools are
|
|
537
|
+
* `<server>__<tool>`. The arguments object is at most 256 KiB. The complete result is at most
|
|
538
|
+
* 8 MiB in the protobuf transport, with each encoded image at most 4 MiB; images are converted
|
|
539
|
+
* to base64 once at this JSON boundary, without recompression or persistence. Cancellation is
|
|
540
|
+
* propagated. A timeout, disconnect or failed response does not prove that side effects did
|
|
541
|
+
* not happen; do not automatically replay. operation_id only correlates live activity, not
|
|
542
|
+
* idempotency.
|
|
524
543
|
* @summary Call a live builtin or external MCP tool
|
|
525
544
|
*/
|
|
526
545
|
export const CallToolParams = zod.strictObject({
|
|
@@ -606,56 +625,6 @@ export const CallMcpToolParams = zod.strictObject({
|
|
|
606
625
|
toolName: zod.string().min(1).max(callMcpToolPathToolNameMax),
|
|
607
626
|
});
|
|
608
627
|
export const CallMcpToolBody = CallMcpToolRequest;
|
|
609
|
-
/**
|
|
610
|
-
* Lists the tools of the caller's servers on the machine, or of one of them, that match
|
|
611
|
-
* `query`: every word of it, ignoring case, in the tool's name, title or description. They
|
|
612
|
-
* are ordered by server, then by tool name. Servers that are not running are started to
|
|
613
|
-
* learn their tools; one that cannot be is named in `unavailable_servers`, and the others are
|
|
614
|
-
* listed anyway. Slow servers do not hold the request up: those still starting are named
|
|
615
|
-
* with `timeout` and go on starting, so that a later request lists their tools. Requires
|
|
616
|
-
* `fleet:machines.login` on the machine.
|
|
617
|
-
*
|
|
618
|
-
* Fails with:
|
|
619
|
-
* - `MCP_SERVER_NOT_FOUND` when `server` is not configured;
|
|
620
|
-
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
621
|
-
* - `FEATURE_UNAVAILABLE` when the machine does not offer `leaflow.fleet.mcp.v1`;
|
|
622
|
-
* - `USER_NOT_FOUND`, `USER_NOT_ALLOWED`, `ACCOUNT_EXPIRED` or `PAM_PERMISSION_DENIED` when
|
|
623
|
-
* the machine refuses the account, as for opening a session;
|
|
624
|
-
* - `MCP_START_FAILED` when the machine could not start MCP for the caller's account;
|
|
625
|
-
* - `MACHINE_TIMEOUT` when the machine did not answer in time.
|
|
626
|
-
* @deprecated
|
|
627
|
-
* @summary List the caller's MCP tools on a machine
|
|
628
|
-
*/
|
|
629
|
-
export const ListMcpToolsParams = zod.strictObject({
|
|
630
|
-
machineId: zod.uuid(),
|
|
631
|
-
});
|
|
632
|
-
export const listMcpToolsQueryServerMax = 64;
|
|
633
|
-
export const listMcpToolsQueryQueryMax = 256;
|
|
634
|
-
export const listMcpToolsQueryPageSizeDefault = 100;
|
|
635
|
-
export const listMcpToolsQueryPageSizeMax = 500;
|
|
636
|
-
export const listMcpToolsQueryPageTokenMax = 1024;
|
|
637
|
-
export const ListMcpToolsQueryParams = zod.strictObject({
|
|
638
|
-
server: zod
|
|
639
|
-
.string()
|
|
640
|
-
.max(listMcpToolsQueryServerMax)
|
|
641
|
-
.optional()
|
|
642
|
-
.describe("Only this server's tools"),
|
|
643
|
-
query: zod
|
|
644
|
-
.string()
|
|
645
|
-
.max(listMcpToolsQueryQueryMax)
|
|
646
|
-
.optional()
|
|
647
|
-
.describe("Words that each must occur in a tool's name, title or description"),
|
|
648
|
-
page_size: zod
|
|
649
|
-
.int()
|
|
650
|
-
.min(1)
|
|
651
|
-
.max(listMcpToolsQueryPageSizeMax)
|
|
652
|
-
.default(listMcpToolsQueryPageSizeDefault),
|
|
653
|
-
page_token: zod
|
|
654
|
-
.string()
|
|
655
|
-
.max(listMcpToolsQueryPageTokenMax)
|
|
656
|
-
.optional()
|
|
657
|
-
.describe("`next_page_token` of the previous page"),
|
|
658
|
-
});
|
|
659
628
|
/**
|
|
660
629
|
* Returns the caller's automatic approval of their privilege requests on the machine. Fails
|
|
661
630
|
* with `PRIVILEGE_AUTO_APPROVAL_NOT_FOUND` while the caller is asked every time, including
|
|
@@ -243,19 +243,13 @@
|
|
|
243
243
|
* OpenAPI spec version: 1.0.0
|
|
244
244
|
*/
|
|
245
245
|
import * as zod from "zod";
|
|
246
|
+
export declare const callToolRequestToolMax = 194;
|
|
246
247
|
export declare const callToolRequestReadOnlyDefault = false;
|
|
247
248
|
export declare const callToolRequestTimeoutSecondsDefault = 60;
|
|
248
249
|
export declare const callToolRequestTimeoutSecondsMax = 240;
|
|
249
250
|
export declare const CallToolRequest: zod.ZodObject<{
|
|
250
251
|
client_instance_id: zod.ZodUUID;
|
|
251
|
-
tool: zod.
|
|
252
|
-
source: zod.ZodEnum<{
|
|
253
|
-
builtin: "builtin";
|
|
254
|
-
mcp: "mcp";
|
|
255
|
-
}>;
|
|
256
|
-
name: zod.ZodString;
|
|
257
|
-
server: zod.ZodOptional<zod.ZodString>;
|
|
258
|
-
}, zod.z.core.$strict>;
|
|
252
|
+
tool: zod.ZodString;
|
|
259
253
|
arguments: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
|
|
260
254
|
read_only: zod.ZodDefault<zod.ZodBoolean>;
|
|
261
255
|
timeout_seconds: zod.ZodDefault<zod.ZodInt>;
|
|
@@ -243,13 +243,17 @@
|
|
|
243
243
|
* OpenAPI spec version: 1.0.0
|
|
244
244
|
*/
|
|
245
245
|
import * as zod from "zod";
|
|
246
|
-
|
|
246
|
+
export const callToolRequestToolMax = 194;
|
|
247
247
|
export const callToolRequestReadOnlyDefault = false;
|
|
248
248
|
export const callToolRequestTimeoutSecondsDefault = 60;
|
|
249
249
|
export const callToolRequestTimeoutSecondsMax = 240;
|
|
250
250
|
export const CallToolRequest = zod.strictObject({
|
|
251
251
|
client_instance_id: zod.uuid(),
|
|
252
|
-
tool:
|
|
252
|
+
tool: zod
|
|
253
|
+
.string()
|
|
254
|
+
.min(1)
|
|
255
|
+
.max(callToolRequestToolMax)
|
|
256
|
+
.describe("The name from list-tools. Builtin tools are computer.*; MCP tools are\n`<server>__<tool>`. The name selects the tool; source is not part of the call."),
|
|
253
257
|
arguments: zod
|
|
254
258
|
.record(zod.string(), zod.unknown())
|
|
255
259
|
.describe("A JSON object, at most 256 KiB when encoded"),
|