@leaflow/sdk 0.200.2 → 0.202.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 +120 -49
- package/dist/fleet/v1/generated/functions.js +122 -48
- package/dist/fleet/v1/generated/models.d.ts +180 -62
- package/dist/fleet/v1/generated/models.js +18 -0
- package/dist/fleet/v1/generated/schemas.zod.d.ts +113 -45
- package/dist/fleet/v1/generated/schemas.zod.js +101 -61
- package/dist/fleet/v1/generated/validators/accountList.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/accountList.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/accountResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/accountResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/approveEnrollmentRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/approveEnrollmentRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/callMcpToolRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/callMcpToolRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/callMcpToolResponse.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/callMcpToolResponse.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/callToolRequest.zod.d.ts +264 -0
- package/dist/fleet/v1/generated/validators/callToolRequest.zod.js +262 -0
- package/dist/fleet/v1/generated/validators/callToolResponse.zod.d.ts +270 -0
- package/dist/fleet/v1/generated/validators/{mcpToolList.zod.js → callToolResponse.zod.js} +19 -12
- package/dist/fleet/v1/generated/validators/createGroupMemberRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/createGroupMemberRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/createGroupRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/createGroupRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/createMachineRegistrationRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/createMachineRegistrationRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/createMachineRegistrationResponse.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/createMachineRegistrationResponse.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/createParticipantRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/createParticipantRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/createParticipantResponse.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/createParticipantResponse.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/createPeerConnectionCandidatesRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/createPeerConnectionCandidatesRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/createPeerConnectionRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/createPeerConnectionRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/createSessionRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/createSessionRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/cursorPagination.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/cursorPagination.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/deleteMcpServerParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/deleteMcpServerParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/denyPrivilegeRequestRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/denyPrivilegeRequestRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/desktopOptions.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/desktopOptions.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/desktopState.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/desktopState.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/directoryName.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/directoryName.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/enrollmentResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/enrollmentResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/enrollmentState.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/enrollmentState.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/error.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/error.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/errorStatus.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/errorStatus.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/featureState.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/featureState.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/fieldViolation.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/fieldViolation.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/findEnrollmentByPairingCodeParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/findEnrollmentByPairingCodeParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/findEnrollmentResponse.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/findEnrollmentResponse.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/getPeerConnectionParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/getPeerConnectionParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/groupList.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/groupList.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/groupResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/groupResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/iceCandidate.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/iceCandidate.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/iceServer.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/iceServer.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/listAccountsParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/listAccountsParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/listGroupMembersParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/listGroupMembersParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/listGroupsParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/listGroupsParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/listMachineEventsParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/listMachineEventsParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/listMachineRegistrationsParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/listMachineRegistrationsParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/listMachinesParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/listMachinesParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/listPrivilegeAutoApprovalsParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/listPrivilegeAutoApprovalsParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/listPrivilegeRequestsParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/listPrivilegeRequestsParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/listSessionsParams.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/listSessionsParams.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/listToolsParams.zod.d.ts +267 -0
- package/dist/fleet/v1/generated/validators/listToolsParams.zod.js +265 -0
- package/dist/fleet/v1/generated/validators/machineEventList.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/machineEventList.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/machineEventResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/machineEventResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/machineEventType.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/machineEventType.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/machineFeature.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/machineFeature.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/machineList.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/machineList.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationList.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationList.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationState.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationState.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/machineResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/machineResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/mcpConfigurationFile.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/mcpConfigurationFile.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/mcpConfigurationResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/mcpConfigurationResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/mcpImplementation.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/mcpImplementation.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/mcpServerFailure.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/mcpServerFailure.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/mcpServerResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/mcpServerResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/mcpTransport.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/mcpTransport.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/migrationStep.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/migrationStep.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/namedIdentity.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/namedIdentity.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/offsetPagination.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/offsetPagination.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/operatingSystem.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/operatingSystem.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/participantList.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/participantList.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/participantResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/participantResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/peerConnection.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/peerConnection.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalList.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalList.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalMode.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalMode.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/privilegeDecider.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/privilegeDecider.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/privilegeRequestList.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/privilegeRequestList.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/privilegeRequestResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/privilegeRequestResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/privilegeRequestState.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/privilegeRequestState.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/publicKey.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/publicKey.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/renewParticipantRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/renewParticipantRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/renewParticipantResponse.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/renewParticipantResponse.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/replaceMcpConfigurationRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/replaceMcpConfigurationRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/rtcConfiguration.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/rtcConfiguration.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/runCommandRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/runCommandRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/runCommandResponse.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/runCommandResponse.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/sendMcpRequestRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/sendMcpRequestRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/sendMcpRequestResponse.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/sendMcpRequestResponse.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/sessionCloseReason.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/sessionCloseReason.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/sessionList.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/sessionList.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/sessionMode.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/sessionMode.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/sessionResource.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/sessionResource.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/sessionState.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/sessionState.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/signedMessage.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/signedMessage.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/signingKey.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/signingKey.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/{listMcpToolsParams.zod.d.ts → toolActivityList.zod.d.ts} +13 -16
- package/dist/fleet/v1/generated/validators/toolActivityList.zod.js +253 -0
- package/dist/fleet/v1/generated/validators/toolContent.zod.d.ts +263 -0
- package/dist/fleet/v1/generated/validators/toolContent.zod.js +260 -0
- package/dist/fleet/v1/generated/validators/{mcpToolList.zod.d.ts → toolDescriptor.zod.d.ts} +24 -28
- package/dist/fleet/v1/generated/validators/{mcpToolResource.zod.js → toolDescriptor.zod.js} +16 -16
- package/dist/fleet/v1/generated/validators/{mcpToolResource.zod.d.ts → toolImage.zod.d.ts} +20 -14
- package/dist/fleet/v1/generated/validators/toolImage.zod.js +255 -0
- package/dist/fleet/v1/generated/validators/toolList.zod.d.ts +276 -0
- package/dist/fleet/v1/generated/validators/{mcpUnavailableServer.zod.js → toolList.zod.js} +19 -8
- package/dist/fleet/v1/generated/validators/{mcpUnavailableServer.zod.d.ts → toolRef.zod.d.ts} +18 -16
- package/dist/fleet/v1/generated/validators/{listMcpToolsParams.zod.js → toolRef.zod.js} +18 -17
- package/dist/fleet/v1/generated/validators/updateAccountRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/updateAccountRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/updateGroupRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/updateGroupRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/updateMachineRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/updateMachineRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/updateMcpServerRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/updateMcpServerRequest.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/updateMcpServerResponse.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/updateMcpServerResponse.zod.js +9 -5
- package/dist/fleet/v1/generated/validators/updatePrivilegeAutoApprovalRequest.zod.d.ts +9 -5
- package/dist/fleet/v1/generated/validators/updatePrivilegeAutoApprovalRequest.zod.js +9 -5
- package/dist/proto/leaflow/fleet/control/v1/control_pb.d.ts +24 -2
- package/dist/proto/leaflow/fleet/control/v1/control_pb.js +1 -1
- package/dist/proto/leaflow/fleet/session/v1/session_pb.d.ts +8 -0
- package/dist/proto/leaflow/fleet/session/v1/session_pb.js +1 -1
- package/dist/proto/leaflow/fleet/tool/v1/tool_pb.d.ts +683 -0
- package/dist/proto/leaflow/fleet/tool/v1/tool_pb.js +205 -0
- package/dist/proto/leaflow/fleet/virtualdesktop/capture/v1/capture_pb.d.ts +21 -1
- package/dist/proto/leaflow/fleet/virtualdesktop/capture/v1/capture_pb.js +1 -1
- package/dist/proto/leaflow/fleet/virtualdesktop/datatransfer/v1/datatransfer_pb.d.ts +11 -2
- package/dist/proto/leaflow/fleet/virtualdesktop/datatransfer/v1/datatransfer_pb.js +1 -1
- package/dist/proto/leaflow/fleet/virtualdesktop/display/v1/display_pb.d.ts +18 -0
- package/dist/proto/leaflow/fleet/virtualdesktop/display/v1/display_pb.js +10 -5
- package/dist/proto/leaflow/fleet/virtualdesktop/input/v1/input_pb.d.ts +8 -0
- package/dist/proto/leaflow/fleet/virtualdesktop/input/v1/input_pb.js +1 -1
- package/dist/proto/leaflow/fleet/virtualdesktop/window/v1/window_pb.d.ts +24 -1
- package/dist/proto/leaflow/fleet/virtualdesktop/window/v1/window_pb.js +1 -1
- package/dist/routes.d.ts +23 -7
- package/dist/routes.js +25 -7
- package/package.json +1 -1
|
@@ -83,11 +83,15 @@
|
|
|
83
83
|
* and remote ones it connects to;
|
|
84
84
|
* - `leaflow.fleet.host.v1`: terminal sessions, with programs, files, ports, sound, devices,
|
|
85
85
|
* printers and privilege approvals;
|
|
86
|
-
* - `leaflow.fleet.virtualdesktop.host.v1`: sessions with a
|
|
86
|
+
* - `leaflow.fleet.virtualdesktop.host.v1`: sessions with a graphical backend;
|
|
87
|
+
* - `leaflow.fleet.tool.v1`: live session tools. Builtin `computer.*` tools are exposed only while
|
|
88
|
+
* the virtual desktop capability is actually available; MCP is a separate source.
|
|
87
89
|
*
|
|
88
|
-
* A
|
|
89
|
-
*
|
|
90
|
-
*
|
|
90
|
+
* A graphical backend does not require a full desktop environment. Terminal logins, commands
|
|
91
|
+
* and MCP server initialization prepare or reuse the account's lightweight graphical context,
|
|
92
|
+
* in addition to their own session or job. Configuration reads and writes do not initialize a
|
|
93
|
+
* server and do not require this preparation. A request that needs a feature the machine does
|
|
94
|
+
* not report available fails with `FEATURE_UNAVAILABLE`, whose `metadata.feature` names it.
|
|
91
95
|
*
|
|
92
96
|
* ## Directory
|
|
93
97
|
*
|
|
@@ -238,7 +242,7 @@
|
|
|
238
242
|
* revoked. A participant whose creation failed is not announced.
|
|
239
243
|
* OpenAPI spec version: 1.0.0
|
|
240
244
|
*/
|
|
241
|
-
import type { AccountList, AccountResource, ApproveEnrollmentRequest, CallMcpToolRequest, CallMcpToolResponse, 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";
|
|
242
246
|
export type HTTPStatusCode1xx = 100 | 101 | 102 | 103;
|
|
243
247
|
export type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;
|
|
244
248
|
export type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
|
|
@@ -377,19 +381,23 @@ export declare const getRunMachineCommandUrl: (machineId: string) => string;
|
|
|
377
381
|
* redirection and `&&` work; there is no terminal and no standard input. The machine admits
|
|
378
382
|
* the account through PAM as for a login. The account is created if the caller has none yet.
|
|
379
383
|
* A command that fails is still a successful request: its exit status is its result.
|
|
384
|
+
* Before starting it, Fleet prepares or reuses the account's ready lightweight graphical
|
|
385
|
+
* session, without starting a full desktop environment. The command has its own job scope;
|
|
386
|
+
* its timeout or exit must not close the account's graphical context.
|
|
380
387
|
*
|
|
381
388
|
* Inside the command, `sudo` works without a prompt while the caller has
|
|
382
389
|
* `fleet:machines.admin` on the machine, and refuses otherwise.
|
|
383
390
|
*
|
|
384
|
-
*
|
|
385
|
-
* more. Neither the command nor its output is hidden from the platform: do not put secrets
|
|
391
|
+
* After graphical context preparation, the request is held until the command ends, at most
|
|
392
|
+
* `timeout_seconds` and a few seconds more. Neither the command nor its output is hidden from the platform: do not put secrets
|
|
386
393
|
* into either.
|
|
387
394
|
*
|
|
388
395
|
* Requires `fleet:machines.login` on the machine.
|
|
389
396
|
*
|
|
390
397
|
* Fails with:
|
|
391
398
|
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
392
|
-
* - `FEATURE_UNAVAILABLE` when the
|
|
399
|
+
* - `FEATURE_UNAVAILABLE` when the command, session or graphical backend is unavailable;
|
|
400
|
+
* - `SESSION_UNAVAILABLE` or `SESSION_CLOSED` when the account context is not ready or closing;
|
|
393
401
|
* - `USER_NOT_FOUND`, `USER_NOT_ALLOWED`, `ACCOUNT_EXPIRED` or `PAM_PERMISSION_DENIED` when
|
|
394
402
|
* the machine refuses the account, as for opening a session;
|
|
395
403
|
* - `COMMAND_START_FAILED` when the shell could not start; nothing ran;
|
|
@@ -528,6 +536,94 @@ export declare const getDeleteMcpServerUrl: (machineId: string, serverName: stri
|
|
|
528
536
|
* @summary Remove an MCP server
|
|
529
537
|
*/
|
|
530
538
|
export declare const deleteMcpServer: (machineId: string, serverName: string, params?: DeleteMcpServerParams, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<deleteMcpServerResponse>;
|
|
539
|
+
export type listToolsResponse200 = {
|
|
540
|
+
data: ToolList;
|
|
541
|
+
status: 200;
|
|
542
|
+
};
|
|
543
|
+
export type listToolsResponseDefault = {
|
|
544
|
+
data: Error;
|
|
545
|
+
status: Exclude<HTTPStatusCodes, 200>;
|
|
546
|
+
};
|
|
547
|
+
export type listToolsResponseSuccess = listToolsResponse200 & {
|
|
548
|
+
headers: Headers;
|
|
549
|
+
};
|
|
550
|
+
export type listToolsResponseError = listToolsResponseDefault & {
|
|
551
|
+
headers: Headers;
|
|
552
|
+
};
|
|
553
|
+
export type listToolsResponse = listToolsResponseSuccess | listToolsResponseError;
|
|
554
|
+
export declare const getListToolsUrl: (machineId: string, params: ListToolsParams) => string;
|
|
555
|
+
/**
|
|
556
|
+
* Queries Agent's builtin tools and the caller's configured MCP servers live. No directory,
|
|
557
|
+
* result or image is cached. Requires fleet:machines.login; builtin capabilities retain
|
|
558
|
+
* their native policies and read-only restrictions. Ensures or reuses the caller's single
|
|
559
|
+
* open graphical session, without launching a desktop environment. The client instance is
|
|
560
|
+
* a UUID generated once per running client, not an authorization credential. Each request
|
|
561
|
+
* checks current IAM permissions and signs a short-lived control-only authorization.
|
|
562
|
+
* Tool arguments, results and images traverse Fleet with hop-by-hop TLS and are visible to
|
|
563
|
+
* Fleet. Existing desktop streaming remains end-to-end encrypted. TOOL_LIST_CHANGED means
|
|
564
|
+
* restart listing from the first page, never replay a CallTool. At most 100 tools per page.
|
|
565
|
+
* @summary List live tools available to the caller on a machine
|
|
566
|
+
*/
|
|
567
|
+
export declare const listTools: (machineId: string, params: ListToolsParams, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<listToolsResponse>;
|
|
568
|
+
export type callToolResponse200 = {
|
|
569
|
+
data: CallToolResponse;
|
|
570
|
+
status: 200;
|
|
571
|
+
};
|
|
572
|
+
export type callToolResponseDefault = {
|
|
573
|
+
data: Error;
|
|
574
|
+
status: Exclude<HTTPStatusCodes, 200>;
|
|
575
|
+
};
|
|
576
|
+
export type callToolResponseSuccess = callToolResponse200 & {
|
|
577
|
+
headers: Headers;
|
|
578
|
+
};
|
|
579
|
+
export type callToolResponseError = callToolResponseDefault & {
|
|
580
|
+
headers: Headers;
|
|
581
|
+
};
|
|
582
|
+
export type callToolResponse = callToolResponseSuccess | callToolResponseError;
|
|
583
|
+
export declare const getCallToolUrl: (machineId: string) => string;
|
|
584
|
+
/**
|
|
585
|
+
* Uses the same current permissions, directory account and graphical session as list-tools.
|
|
586
|
+
* Listing is not a precondition: callers may use a previously discovered ToolRef, and this
|
|
587
|
+
* operation never sends a discovery request or refreshes schemas before executing it.
|
|
588
|
+
* A removed tool or MCP server returns TOOL_NOT_FOUND, as does a direct builtin computer.*
|
|
589
|
+
* call while virtual desktop capability is unavailable. Actual permission errors remain
|
|
590
|
+
* permission errors; a missing target window is not a missing tool. Use list-tools only when
|
|
591
|
+
* discovery or refresh is needed, and do not cache or reuse execution results.
|
|
592
|
+
* Source is explicit: MCP names never select or impersonate builtin tools. The arguments
|
|
593
|
+
* object is at most 256 KiB. The complete result is at most 8 MiB in the protobuf transport,
|
|
594
|
+
* with each encoded image at most 4 MiB; images are converted to base64 once at this JSON
|
|
595
|
+
* boundary, without recompression or persistence. Cancellation is propagated. A timeout,
|
|
596
|
+
* disconnect or failed response does not prove that side effects did not happen; do not
|
|
597
|
+
* automatically replay. operation_id only correlates live activity, not idempotency.
|
|
598
|
+
* @summary Call a live builtin or external MCP tool
|
|
599
|
+
*/
|
|
600
|
+
export declare const callTool: (machineId: string, callToolRequest: CallToolRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<callToolResponse>;
|
|
601
|
+
export type pollToolActivitiesResponse200 = {
|
|
602
|
+
data: ToolActivityList;
|
|
603
|
+
status: 200;
|
|
604
|
+
};
|
|
605
|
+
export type pollToolActivitiesResponseDefault = {
|
|
606
|
+
data: Error;
|
|
607
|
+
status: Exclude<HTTPStatusCodes, 200>;
|
|
608
|
+
};
|
|
609
|
+
export type pollToolActivitiesResponseSuccess = pollToolActivitiesResponse200 & {
|
|
610
|
+
headers: Headers;
|
|
611
|
+
};
|
|
612
|
+
export type pollToolActivitiesResponseError = pollToolActivitiesResponseDefault & {
|
|
613
|
+
headers: Headers;
|
|
614
|
+
};
|
|
615
|
+
export type pollToolActivitiesResponse = pollToolActivitiesResponseSuccess | pollToolActivitiesResponseError;
|
|
616
|
+
export declare const getPollToolActivitiesUrl: (sessionId: string) => string;
|
|
617
|
+
/**
|
|
618
|
+
* Checks current session viewing permission for each request and again before returning
|
|
619
|
+
* events. Subscribes only while this request is pending, returning on the first batch or
|
|
620
|
+
* after at most 20 idle seconds. At most 64 events, no offline queue, event database, cursor
|
|
621
|
+
* history or replay guarantee. Missing events never mean repeat an action. Coordinates
|
|
622
|
+
* are window-client-local (window_id=0 means canvas), not CSS or image pixels. The frontend
|
|
623
|
+
* applies its own zoom and DPI. Compare sequence only within the same instance_id.
|
|
624
|
+
* @summary Receive live tool activity for an authorized session
|
|
625
|
+
*/
|
|
626
|
+
export declare const pollToolActivities: (sessionId: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<pollToolActivitiesResponse>;
|
|
531
627
|
export type sendMcpRequestResponse200 = {
|
|
532
628
|
data: SendMcpRequestResponse;
|
|
533
629
|
status: 200;
|
|
@@ -548,7 +644,9 @@ export declare const getSendMcpRequestUrl: (machineId: string, serverName: strin
|
|
|
548
644
|
* Sends one JSON-RPC request of MCP to one of the caller's servers on the machine, such as
|
|
549
645
|
* `tools/call`, `resources/read` or `prompts/get`, and returns the server's response. The
|
|
550
646
|
* machine starts or connects to the server if it is not running, and handles its
|
|
551
|
-
* initialization itself
|
|
647
|
+
* initialization itself. Before any such request, Fleet prepares or reuses the caller's
|
|
648
|
+
* ready lightweight account graphical session, including for resources and prompts; no full
|
|
649
|
+
* desktop environment is needed. A request still running when `timeout_seconds` passes is cancelled
|
|
552
650
|
* at the server. Requests the server makes of the client are answered as by a client that
|
|
553
651
|
* offers no sampling, elicitation or roots, and its notifications, such as of progress, are
|
|
554
652
|
* dropped. A response with a JSON-RPC error is a successful request. Neither the request nor
|
|
@@ -562,7 +660,8 @@ export declare const getSendMcpRequestUrl: (machineId: string, serverName: strin
|
|
|
562
660
|
* is one of initialization;
|
|
563
661
|
* - `RESULT_TOO_LARGE` when the response is larger than 8 MiB;
|
|
564
662
|
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
565
|
-
* - `FEATURE_UNAVAILABLE` when the
|
|
663
|
+
* - `FEATURE_UNAVAILABLE` when the MCP, session or graphical backend is unavailable;
|
|
664
|
+
* - `SESSION_UNAVAILABLE` or `SESSION_CLOSED` when the account context is not ready or closing;
|
|
566
665
|
* - `USER_NOT_FOUND`, `USER_NOT_ALLOWED`, `ACCOUNT_EXPIRED` or `PAM_PERMISSION_DENIED` when
|
|
567
666
|
* the machine refuses the account, as for opening a session;
|
|
568
667
|
* - `MCP_START_FAILED` when the machine could not start MCP for the caller's account;
|
|
@@ -596,45 +695,10 @@ export declare const getCallMcpToolUrl: (machineId: string, serverName: string,
|
|
|
596
695
|
* Fails as sending a request does, and with `MCP_REQUEST_FAILED` when the server answers
|
|
597
696
|
* with a JSON-RPC error, such as for a tool it does not offer or arguments it does not
|
|
598
697
|
* accept, with the error's `metadata.code` and `metadata.message`.
|
|
698
|
+
* @deprecated
|
|
599
699
|
* @summary Call an MCP tool
|
|
600
700
|
*/
|
|
601
701
|
export declare const callMcpTool: (machineId: string, serverName: string, toolName: string, callMcpToolRequest: CallMcpToolRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<callMcpToolResponse>;
|
|
602
|
-
export type listMcpToolsResponse200 = {
|
|
603
|
-
data: McpToolList;
|
|
604
|
-
status: 200;
|
|
605
|
-
};
|
|
606
|
-
export type listMcpToolsResponseDefault = {
|
|
607
|
-
data: Error;
|
|
608
|
-
status: Exclude<HTTPStatusCodes, 200>;
|
|
609
|
-
};
|
|
610
|
-
export type listMcpToolsResponseSuccess = listMcpToolsResponse200 & {
|
|
611
|
-
headers: Headers;
|
|
612
|
-
};
|
|
613
|
-
export type listMcpToolsResponseError = listMcpToolsResponseDefault & {
|
|
614
|
-
headers: Headers;
|
|
615
|
-
};
|
|
616
|
-
export type listMcpToolsResponse = listMcpToolsResponseSuccess | listMcpToolsResponseError;
|
|
617
|
-
export declare const getListMcpToolsUrl: (machineId: string, params?: ListMcpToolsParams) => string;
|
|
618
|
-
/**
|
|
619
|
-
* Lists the tools of the caller's servers on the machine, or of one of them, that match
|
|
620
|
-
* `query`: every word of it, ignoring case, in the tool's name, title or description. They
|
|
621
|
-
* are ordered by server, then by tool name. Servers that are not running are started to
|
|
622
|
-
* learn their tools; one that cannot be is named in `unavailable_servers`, and the others are
|
|
623
|
-
* listed anyway. Slow servers do not hold the request up: those still starting are named
|
|
624
|
-
* with `timeout` and go on starting, so that a later request lists their tools. Requires
|
|
625
|
-
* `fleet:machines.login` on the machine.
|
|
626
|
-
*
|
|
627
|
-
* Fails with:
|
|
628
|
-
* - `MCP_SERVER_NOT_FOUND` when `server` is not configured;
|
|
629
|
-
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
630
|
-
* - `FEATURE_UNAVAILABLE` when the machine does not offer `leaflow.fleet.mcp.v1`;
|
|
631
|
-
* - `USER_NOT_FOUND`, `USER_NOT_ALLOWED`, `ACCOUNT_EXPIRED` or `PAM_PERMISSION_DENIED` when
|
|
632
|
-
* the machine refuses the account, as for opening a session;
|
|
633
|
-
* - `MCP_START_FAILED` when the machine could not start MCP for the caller's account;
|
|
634
|
-
* - `MACHINE_TIMEOUT` when the machine did not answer in time.
|
|
635
|
-
* @summary List the caller's MCP tools on a machine
|
|
636
|
-
*/
|
|
637
|
-
export declare const listMcpTools: (machineId: string, params?: ListMcpToolsParams, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<listMcpToolsResponse>;
|
|
638
702
|
export type getPrivilegeAutoApprovalResponse200 = {
|
|
639
703
|
data: PrivilegeAutoApprovalResource;
|
|
640
704
|
status: 200;
|
|
@@ -1288,12 +1352,19 @@ export type createSessionResponse = createSessionResponseSuccess | createSession
|
|
|
1288
1352
|
export declare const getCreateSessionUrl: () => string;
|
|
1289
1353
|
/**
|
|
1290
1354
|
* Opens a session for the caller on a machine, as the caller's account, and returns once it
|
|
1291
|
-
* is ready. With `desktop` the session has a desktop. Without,
|
|
1355
|
+
* is ready. With `desktop` the session has a desktop. Without, Fleet first prepares or reuses
|
|
1356
|
+
* the account's separate ready lightweight graphical session, then creates a terminal session
|
|
1357
|
+
* with its own SID and lifetime; closing that terminal does not close the account context. Its
|
|
1292
1358
|
* one terminal runs the caller's login shell from the start, every participant attaches to
|
|
1293
1359
|
* that terminal, and the session ends when the shell exits; a caller who wants another
|
|
1294
1360
|
* terminal opens another session. Either kind also offers programs, files, ports, sound,
|
|
1295
1361
|
* devices, printers and privilege approvals. The account is created if the caller has none
|
|
1296
1362
|
* yet. Requires `fleet:machines.login` on the machine.
|
|
1363
|
+
* All newly created graphical account sessions, including desktop-first FullDesktop and
|
|
1364
|
+
* Seamless sessions, keep running when no viewer has joined or the last viewer disconnects.
|
|
1365
|
+
* Configured maximum lifetime, resource limits and explicit close/terminate still apply.
|
|
1366
|
+
* This create API has no client-selected idle policy; existing running policies are not
|
|
1367
|
+
* silently rewritten when tools, commands or terminals reuse the account context.
|
|
1297
1368
|
*
|
|
1298
1369
|
* On a machine an account has at most one session with a desktop and at most 8 sessions in
|
|
1299
1370
|
* all. Sessions without a desktop run side by side, such as one for a program and one for a
|
|
@@ -1301,8 +1372,8 @@ export declare const getCreateSessionUrl: () => string;
|
|
|
1301
1372
|
*
|
|
1302
1373
|
* Fails with:
|
|
1303
1374
|
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
1304
|
-
* - `FEATURE_UNAVAILABLE` when the machine does not offer sessions
|
|
1305
|
-
*
|
|
1375
|
+
* - `FEATURE_UNAVAILABLE` when the machine does not offer sessions or the graphical backend;
|
|
1376
|
+
* - `SESSION_UNAVAILABLE` or `SESSION_CLOSED` when its shared account context is not ready or closing;
|
|
1306
1377
|
* - `USER_HAS_DESKTOP_SESSION` with `desktop` when the account already has a session with a
|
|
1307
1378
|
* desktop on the machine, which `metadata.sessionId` names; connect to it instead;
|
|
1308
1379
|
* - `SESSION_LIMIT_REACHED` when the account already has 8 open sessions on the machine;
|
|
@@ -127,19 +127,23 @@ export const getRunMachineCommandUrl = (machineId) => {
|
|
|
127
127
|
* redirection and `&&` work; there is no terminal and no standard input. The machine admits
|
|
128
128
|
* the account through PAM as for a login. The account is created if the caller has none yet.
|
|
129
129
|
* A command that fails is still a successful request: its exit status is its result.
|
|
130
|
+
* Before starting it, Fleet prepares or reuses the account's ready lightweight graphical
|
|
131
|
+
* session, without starting a full desktop environment. The command has its own job scope;
|
|
132
|
+
* its timeout or exit must not close the account's graphical context.
|
|
130
133
|
*
|
|
131
134
|
* Inside the command, `sudo` works without a prompt while the caller has
|
|
132
135
|
* `fleet:machines.admin` on the machine, and refuses otherwise.
|
|
133
136
|
*
|
|
134
|
-
*
|
|
135
|
-
* more. Neither the command nor its output is hidden from the platform: do not put secrets
|
|
137
|
+
* After graphical context preparation, the request is held until the command ends, at most
|
|
138
|
+
* `timeout_seconds` and a few seconds more. Neither the command nor its output is hidden from the platform: do not put secrets
|
|
136
139
|
* into either.
|
|
137
140
|
*
|
|
138
141
|
* Requires `fleet:machines.login` on the machine.
|
|
139
142
|
*
|
|
140
143
|
* Fails with:
|
|
141
144
|
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
142
|
-
* - `FEATURE_UNAVAILABLE` when the
|
|
145
|
+
* - `FEATURE_UNAVAILABLE` when the command, session or graphical backend is unavailable;
|
|
146
|
+
* - `SESSION_UNAVAILABLE` or `SESSION_CLOSED` when the account context is not ready or closing;
|
|
143
147
|
* - `USER_NOT_FOUND`, `USER_NOT_ALLOWED`, `ACCOUNT_EXPIRED` or `PAM_PERMISSION_DENIED` when
|
|
144
148
|
* the machine refuses the account, as for opening a session;
|
|
145
149
|
* - `COMMAND_START_FAILED` when the shell could not start; nothing ran;
|
|
@@ -326,6 +330,105 @@ export const deleteMcpServer = async (machineId, serverName, params, options, fe
|
|
|
326
330
|
const data = body ? JSON.parse(body) : {};
|
|
327
331
|
return { data, status: res.status, headers: res.headers };
|
|
328
332
|
};
|
|
333
|
+
export const getListToolsUrl = (machineId, params) => {
|
|
334
|
+
const normalizedParams = new URLSearchParams();
|
|
335
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
336
|
+
if (value !== undefined) {
|
|
337
|
+
normalizedParams.append(key, value === null ? "null" : String(value));
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
const stringifiedParams = normalizedParams.toString();
|
|
341
|
+
return stringifiedParams.length > 0
|
|
342
|
+
? `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/tools?${stringifiedParams}`
|
|
343
|
+
: `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/tools`;
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* Queries Agent's builtin tools and the caller's configured MCP servers live. No directory,
|
|
347
|
+
* result or image is cached. Requires fleet:machines.login; builtin capabilities retain
|
|
348
|
+
* their native policies and read-only restrictions. Ensures or reuses the caller's single
|
|
349
|
+
* open graphical session, without launching a desktop environment. The client instance is
|
|
350
|
+
* a UUID generated once per running client, not an authorization credential. Each request
|
|
351
|
+
* checks current IAM permissions and signs a short-lived control-only authorization.
|
|
352
|
+
* Tool arguments, results and images traverse Fleet with hop-by-hop TLS and are visible to
|
|
353
|
+
* Fleet. Existing desktop streaming remains end-to-end encrypted. TOOL_LIST_CHANGED means
|
|
354
|
+
* restart listing from the first page, never replay a CallTool. At most 100 tools per page.
|
|
355
|
+
* @summary List live tools available to the caller on a machine
|
|
356
|
+
*/
|
|
357
|
+
export const listTools = async (machineId, params, options, fetchFn) => {
|
|
358
|
+
const res = await (fetchFn ?? fetch)(getListToolsUrl(machineId, params), {
|
|
359
|
+
...options,
|
|
360
|
+
method: "GET",
|
|
361
|
+
});
|
|
362
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
363
|
+
const data = body ? JSON.parse(body) : {};
|
|
364
|
+
return { data, status: res.status, headers: res.headers };
|
|
365
|
+
};
|
|
366
|
+
export const getCallToolUrl = (machineId) => {
|
|
367
|
+
return `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/tools:call`;
|
|
368
|
+
};
|
|
369
|
+
/**
|
|
370
|
+
* Uses the same current permissions, directory account and graphical session as list-tools.
|
|
371
|
+
* Listing is not a precondition: callers may use a previously discovered ToolRef, and this
|
|
372
|
+
* operation never sends a discovery request or refreshes schemas before executing it.
|
|
373
|
+
* A removed tool or MCP server returns TOOL_NOT_FOUND, as does a direct builtin computer.*
|
|
374
|
+
* call while virtual desktop capability is unavailable. Actual permission errors remain
|
|
375
|
+
* permission errors; a missing target window is not a missing tool. Use list-tools only when
|
|
376
|
+
* discovery or refresh is needed, and do not cache or reuse execution results.
|
|
377
|
+
* Source is explicit: MCP names never select or impersonate builtin tools. The arguments
|
|
378
|
+
* object is at most 256 KiB. The complete result is at most 8 MiB in the protobuf transport,
|
|
379
|
+
* with each encoded image at most 4 MiB; images are converted to base64 once at this JSON
|
|
380
|
+
* boundary, without recompression or persistence. Cancellation is propagated. A timeout,
|
|
381
|
+
* disconnect or failed response does not prove that side effects did not happen; do not
|
|
382
|
+
* automatically replay. operation_id only correlates live activity, not idempotency.
|
|
383
|
+
* @summary Call a live builtin or external MCP tool
|
|
384
|
+
*/
|
|
385
|
+
export const callTool = async (machineId, callToolRequest, options, fetchFn) => {
|
|
386
|
+
const getHeaders = (h) => {
|
|
387
|
+
if (!h)
|
|
388
|
+
return {};
|
|
389
|
+
if (h instanceof Headers)
|
|
390
|
+
return Object.fromEntries(h.entries());
|
|
391
|
+
if (Symbol.iterator in h) {
|
|
392
|
+
return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
393
|
+
}
|
|
394
|
+
const headers = {};
|
|
395
|
+
for (const [name, value] of Object.entries(h)) {
|
|
396
|
+
if (value !== undefined)
|
|
397
|
+
headers[name] = value;
|
|
398
|
+
}
|
|
399
|
+
return headers;
|
|
400
|
+
};
|
|
401
|
+
const res = await (fetchFn ?? fetch)(getCallToolUrl(machineId), {
|
|
402
|
+
...options,
|
|
403
|
+
method: "POST",
|
|
404
|
+
headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
|
|
405
|
+
body: JSON.stringify(callToolRequest),
|
|
406
|
+
});
|
|
407
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
408
|
+
const data = body ? JSON.parse(body) : {};
|
|
409
|
+
return { data, status: res.status, headers: res.headers };
|
|
410
|
+
};
|
|
411
|
+
export const getPollToolActivitiesUrl = (sessionId) => {
|
|
412
|
+
return `https://fleet.leaflow.cloud/api/v1/sessions/${encodeURIComponent(String(sessionId))}/tool-activities`;
|
|
413
|
+
};
|
|
414
|
+
/**
|
|
415
|
+
* Checks current session viewing permission for each request and again before returning
|
|
416
|
+
* events. Subscribes only while this request is pending, returning on the first batch or
|
|
417
|
+
* after at most 20 idle seconds. At most 64 events, no offline queue, event database, cursor
|
|
418
|
+
* history or replay guarantee. Missing events never mean repeat an action. Coordinates
|
|
419
|
+
* are window-client-local (window_id=0 means canvas), not CSS or image pixels. The frontend
|
|
420
|
+
* applies its own zoom and DPI. Compare sequence only within the same instance_id.
|
|
421
|
+
* @summary Receive live tool activity for an authorized session
|
|
422
|
+
*/
|
|
423
|
+
export const pollToolActivities = async (sessionId, options, fetchFn) => {
|
|
424
|
+
const res = await (fetchFn ?? fetch)(getPollToolActivitiesUrl(sessionId), {
|
|
425
|
+
...options,
|
|
426
|
+
method: "GET",
|
|
427
|
+
});
|
|
428
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
429
|
+
const data = body ? JSON.parse(body) : {};
|
|
430
|
+
return { data, status: res.status, headers: res.headers };
|
|
431
|
+
};
|
|
329
432
|
export const getSendMcpRequestUrl = (machineId, serverName) => {
|
|
330
433
|
return `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/mcp-servers/${encodeURIComponent(String(serverName))}:send`;
|
|
331
434
|
};
|
|
@@ -333,7 +436,9 @@ export const getSendMcpRequestUrl = (machineId, serverName) => {
|
|
|
333
436
|
* Sends one JSON-RPC request of MCP to one of the caller's servers on the machine, such as
|
|
334
437
|
* `tools/call`, `resources/read` or `prompts/get`, and returns the server's response. The
|
|
335
438
|
* machine starts or connects to the server if it is not running, and handles its
|
|
336
|
-
* initialization itself
|
|
439
|
+
* initialization itself. Before any such request, Fleet prepares or reuses the caller's
|
|
440
|
+
* ready lightweight account graphical session, including for resources and prompts; no full
|
|
441
|
+
* desktop environment is needed. A request still running when `timeout_seconds` passes is cancelled
|
|
337
442
|
* at the server. Requests the server makes of the client are answered as by a client that
|
|
338
443
|
* offers no sampling, elicitation or roots, and its notifications, such as of progress, are
|
|
339
444
|
* dropped. A response with a JSON-RPC error is a successful request. Neither the request nor
|
|
@@ -347,7 +452,8 @@ export const getSendMcpRequestUrl = (machineId, serverName) => {
|
|
|
347
452
|
* is one of initialization;
|
|
348
453
|
* - `RESULT_TOO_LARGE` when the response is larger than 8 MiB;
|
|
349
454
|
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
350
|
-
* - `FEATURE_UNAVAILABLE` when the
|
|
455
|
+
* - `FEATURE_UNAVAILABLE` when the MCP, session or graphical backend is unavailable;
|
|
456
|
+
* - `SESSION_UNAVAILABLE` or `SESSION_CLOSED` when the account context is not ready or closing;
|
|
351
457
|
* - `USER_NOT_FOUND`, `USER_NOT_ALLOWED`, `ACCOUNT_EXPIRED` or `PAM_PERMISSION_DENIED` when
|
|
352
458
|
* the machine refuses the account, as for opening a session;
|
|
353
459
|
* - `MCP_START_FAILED` when the machine could not start MCP for the caller's account;
|
|
@@ -393,6 +499,7 @@ export const getCallMcpToolUrl = (machineId, serverName, toolName) => {
|
|
|
393
499
|
* Fails as sending a request does, and with `MCP_REQUEST_FAILED` when the server answers
|
|
394
500
|
* with a JSON-RPC error, such as for a tool it does not offer or arguments it does not
|
|
395
501
|
* accept, with the error's `metadata.code` and `metadata.message`.
|
|
502
|
+
* @deprecated
|
|
396
503
|
* @summary Call an MCP tool
|
|
397
504
|
*/
|
|
398
505
|
export const callMcpTool = async (machineId, serverName, toolName, callMcpToolRequest, options, fetchFn) => {
|
|
@@ -421,46 +528,6 @@ export const callMcpTool = async (machineId, serverName, toolName, callMcpToolRe
|
|
|
421
528
|
const data = body ? JSON.parse(body) : {};
|
|
422
529
|
return { data, status: res.status, headers: res.headers };
|
|
423
530
|
};
|
|
424
|
-
export const getListMcpToolsUrl = (machineId, params) => {
|
|
425
|
-
const normalizedParams = new URLSearchParams();
|
|
426
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
427
|
-
if (value !== undefined) {
|
|
428
|
-
normalizedParams.append(key, value === null ? "null" : String(value));
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
const stringifiedParams = normalizedParams.toString();
|
|
432
|
-
return stringifiedParams.length > 0
|
|
433
|
-
? `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/mcp-tools?${stringifiedParams}`
|
|
434
|
-
: `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/mcp-tools`;
|
|
435
|
-
};
|
|
436
|
-
/**
|
|
437
|
-
* Lists the tools of the caller's servers on the machine, or of one of them, that match
|
|
438
|
-
* `query`: every word of it, ignoring case, in the tool's name, title or description. They
|
|
439
|
-
* are ordered by server, then by tool name. Servers that are not running are started to
|
|
440
|
-
* learn their tools; one that cannot be is named in `unavailable_servers`, and the others are
|
|
441
|
-
* listed anyway. Slow servers do not hold the request up: those still starting are named
|
|
442
|
-
* with `timeout` and go on starting, so that a later request lists their tools. Requires
|
|
443
|
-
* `fleet:machines.login` on the machine.
|
|
444
|
-
*
|
|
445
|
-
* Fails with:
|
|
446
|
-
* - `MCP_SERVER_NOT_FOUND` when `server` is not configured;
|
|
447
|
-
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
448
|
-
* - `FEATURE_UNAVAILABLE` when the machine does not offer `leaflow.fleet.mcp.v1`;
|
|
449
|
-
* - `USER_NOT_FOUND`, `USER_NOT_ALLOWED`, `ACCOUNT_EXPIRED` or `PAM_PERMISSION_DENIED` when
|
|
450
|
-
* the machine refuses the account, as for opening a session;
|
|
451
|
-
* - `MCP_START_FAILED` when the machine could not start MCP for the caller's account;
|
|
452
|
-
* - `MACHINE_TIMEOUT` when the machine did not answer in time.
|
|
453
|
-
* @summary List the caller's MCP tools on a machine
|
|
454
|
-
*/
|
|
455
|
-
export const listMcpTools = async (machineId, params, options, fetchFn) => {
|
|
456
|
-
const res = await (fetchFn ?? fetch)(getListMcpToolsUrl(machineId, params), {
|
|
457
|
-
...options,
|
|
458
|
-
method: "GET",
|
|
459
|
-
});
|
|
460
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
461
|
-
const data = body ? JSON.parse(body) : {};
|
|
462
|
-
return { data, status: res.status, headers: res.headers };
|
|
463
|
-
};
|
|
464
531
|
export const getGetPrivilegeAutoApprovalUrl = (machineId) => {
|
|
465
532
|
return `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/privilege-auto-approval`;
|
|
466
533
|
};
|
|
@@ -1174,12 +1241,19 @@ export const getCreateSessionUrl = () => {
|
|
|
1174
1241
|
};
|
|
1175
1242
|
/**
|
|
1176
1243
|
* Opens a session for the caller on a machine, as the caller's account, and returns once it
|
|
1177
|
-
* is ready. With `desktop` the session has a desktop. Without,
|
|
1244
|
+
* is ready. With `desktop` the session has a desktop. Without, Fleet first prepares or reuses
|
|
1245
|
+
* the account's separate ready lightweight graphical session, then creates a terminal session
|
|
1246
|
+
* with its own SID and lifetime; closing that terminal does not close the account context. Its
|
|
1178
1247
|
* one terminal runs the caller's login shell from the start, every participant attaches to
|
|
1179
1248
|
* that terminal, and the session ends when the shell exits; a caller who wants another
|
|
1180
1249
|
* terminal opens another session. Either kind also offers programs, files, ports, sound,
|
|
1181
1250
|
* devices, printers and privilege approvals. The account is created if the caller has none
|
|
1182
1251
|
* yet. Requires `fleet:machines.login` on the machine.
|
|
1252
|
+
* All newly created graphical account sessions, including desktop-first FullDesktop and
|
|
1253
|
+
* Seamless sessions, keep running when no viewer has joined or the last viewer disconnects.
|
|
1254
|
+
* Configured maximum lifetime, resource limits and explicit close/terminate still apply.
|
|
1255
|
+
* This create API has no client-selected idle policy; existing running policies are not
|
|
1256
|
+
* silently rewritten when tools, commands or terminals reuse the account context.
|
|
1183
1257
|
*
|
|
1184
1258
|
* On a machine an account has at most one session with a desktop and at most 8 sessions in
|
|
1185
1259
|
* all. Sessions without a desktop run side by side, such as one for a program and one for a
|
|
@@ -1187,8 +1261,8 @@ export const getCreateSessionUrl = () => {
|
|
|
1187
1261
|
*
|
|
1188
1262
|
* Fails with:
|
|
1189
1263
|
* - `MACHINE_OFFLINE` when the machine is not connected and does not connect again in time;
|
|
1190
|
-
* - `FEATURE_UNAVAILABLE` when the machine does not offer sessions
|
|
1191
|
-
*
|
|
1264
|
+
* - `FEATURE_UNAVAILABLE` when the machine does not offer sessions or the graphical backend;
|
|
1265
|
+
* - `SESSION_UNAVAILABLE` or `SESSION_CLOSED` when its shared account context is not ready or closing;
|
|
1192
1266
|
* - `USER_HAS_DESKTOP_SESSION` with `desktop` when the account already has a session with a
|
|
1193
1267
|
* desktop on the machine, which `metadata.sessionId` names; connect to it instead;
|
|
1194
1268
|
* - `SESSION_LIMIT_REACHED` when the account already has 8 open sessions on the machine;
|