@leaflow/sdk 0.187.2 → 0.189.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/README.md +9 -18
- package/dist/fleet/v1/generated/functions.d.ts +32 -18
- package/dist/fleet/v1/generated/functions.js +31 -12
- package/dist/fleet/v1/generated/models.d.ts +60 -15
- package/dist/fleet/v1/generated/models.js +6 -2
- package/dist/fleet/v1/generated/schemas.zod.d.ts +37 -17
- package/dist/fleet/v1/generated/schemas.zod.js +32 -16
- package/dist/fleet/v1/generated/validators/accountList.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/accountList.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/accountResource.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/accountResource.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/approveEnrollmentRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/approveEnrollmentRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/callMcpToolRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/callMcpToolRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/callMcpToolResponse.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/callMcpToolResponse.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/createGroupMemberRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/createGroupMemberRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/createGroupRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/createGroupRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/createMachineRegistrationRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/createMachineRegistrationRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/createMachineRegistrationResponse.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/createMachineRegistrationResponse.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/createParticipantRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/createParticipantRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/createParticipantResponse.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/createParticipantResponse.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/createPeerConnectionCandidatesRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/createPeerConnectionCandidatesRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/createPeerConnectionRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/createPeerConnectionRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/createSessionRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/createSessionRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/cursorPagination.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/cursorPagination.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/deleteMcpServerParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/deleteMcpServerParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/denyPrivilegeRequestRequest.zod.d.ts +244 -0
- package/dist/fleet/v1/generated/validators/denyPrivilegeRequestRequest.zod.js +246 -0
- package/dist/fleet/v1/generated/validators/desktopOptions.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/desktopOptions.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/desktopState.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/desktopState.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/directoryName.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/directoryName.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/enrollmentResource.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/enrollmentResource.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/enrollmentState.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/enrollmentState.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/error.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/error.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/errorStatus.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/errorStatus.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/featureState.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/featureState.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/fieldViolation.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/fieldViolation.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/findEnrollmentByPairingCodeParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/findEnrollmentByPairingCodeParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/findEnrollmentResponse.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/findEnrollmentResponse.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/groupList.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/groupList.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/groupResource.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/groupResource.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/iceCandidate.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/iceCandidate.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/iceServer.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/iceServer.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/listAccountsParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/listAccountsParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/listGroupMembersParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/listGroupMembersParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/listGroupsParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/listGroupsParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/listMachineEventsParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/listMachineEventsParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/listMachineRegistrationsParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/listMachineRegistrationsParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/listMachinesParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/listMachinesParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/listMcpToolsParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/listMcpToolsParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/listPrivilegeAutoApprovalsParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/listPrivilegeAutoApprovalsParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/listPrivilegeRequestsParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/listPrivilegeRequestsParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/listSessionsParams.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/listSessionsParams.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/machineEventList.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/machineEventList.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/machineEventResource.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/machineEventResource.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/machineEventType.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/machineEventType.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/machineFeature.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/machineFeature.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/machineList.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/machineList.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationList.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationList.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationResource.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationResource.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationState.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/machineRegistrationState.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/machineResource.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/machineResource.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/mcpConfigurationFile.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/mcpConfigurationFile.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/mcpConfigurationResource.zod.d.ts +17 -6
- package/dist/fleet/v1/generated/validators/mcpConfigurationResource.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/mcpImplementation.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/mcpImplementation.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/mcpServerFailure.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/mcpServerFailure.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/mcpServerResource.zod.d.ts +17 -6
- package/dist/fleet/v1/generated/validators/mcpServerResource.zod.js +18 -6
- package/dist/fleet/v1/generated/validators/mcpToolList.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/mcpToolList.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/mcpToolResource.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/mcpToolResource.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/mcpTransport.zod.d.ts +17 -6
- package/dist/fleet/v1/generated/validators/mcpTransport.zod.js +19 -7
- package/dist/fleet/v1/generated/validators/mcpUnavailableServer.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/mcpUnavailableServer.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/migrationStep.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/migrationStep.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/namedIdentity.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/namedIdentity.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/offsetPagination.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/offsetPagination.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/operatingSystem.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/operatingSystem.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/participantList.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/participantList.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/participantResource.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/participantResource.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/peerConnection.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/peerConnection.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalList.zod.d.ts +21 -5
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalList.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalMode.zod.d.ts +244 -0
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalMode.zod.js +241 -0
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalResource.zod.d.ts +21 -5
- package/dist/fleet/v1/generated/validators/privilegeAutoApprovalResource.zod.js +19 -5
- package/dist/fleet/v1/generated/validators/privilegeDecider.zod.d.ts +19 -6
- package/dist/fleet/v1/generated/validators/privilegeDecider.zod.js +19 -7
- package/dist/fleet/v1/generated/validators/privilegeRequestList.zod.d.ts +20 -6
- package/dist/fleet/v1/generated/validators/privilegeRequestList.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/privilegeRequestResource.zod.d.ts +21 -6
- package/dist/fleet/v1/generated/validators/privilegeRequestResource.zod.js +23 -5
- package/dist/fleet/v1/generated/validators/privilegeRequestState.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/privilegeRequestState.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/publicKey.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/publicKey.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/renewParticipantRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/renewParticipantRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/renewParticipantResponse.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/renewParticipantResponse.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/replaceMcpConfigurationRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/replaceMcpConfigurationRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/rtcConfiguration.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/rtcConfiguration.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/runCommandRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/runCommandRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/runCommandResponse.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/runCommandResponse.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/sendMcpRequestRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/sendMcpRequestRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/sendMcpRequestResponse.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/sendMcpRequestResponse.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/sessionCloseReason.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/sessionCloseReason.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/sessionList.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/sessionList.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/sessionMode.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/sessionMode.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/sessionResource.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/sessionResource.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/sessionState.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/sessionState.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/signedMessage.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/signedMessage.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/signingKey.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/signingKey.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/updateAccountRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/updateAccountRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/updateGroupRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/updateGroupRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/updateMachineRequest.zod.d.ts +17 -5
- package/dist/fleet/v1/generated/validators/updateMachineRequest.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/updateMcpServerRequest.zod.d.ts +17 -6
- package/dist/fleet/v1/generated/validators/updateMcpServerRequest.zod.js +19 -7
- package/dist/fleet/v1/generated/validators/updateMcpServerResponse.zod.d.ts +17 -6
- package/dist/fleet/v1/generated/validators/updateMcpServerResponse.zod.js +17 -5
- package/dist/fleet/v1/generated/validators/updatePrivilegeAutoApprovalRequest.zod.d.ts +21 -5
- package/dist/fleet/v1/generated/validators/updatePrivilegeAutoApprovalRequest.zod.js +19 -5
- package/dist/proto/leaflow/fleet/mcp/v1/mcp_pb.d.ts +5 -12
- package/dist/proto/leaflow/fleet/mcp/v1/mcp_pb.js +1 -7
- package/dist/proto/leaflow/fleet/privilege/v1/privilege_pb.d.ts +20 -5
- package/dist/proto/leaflow/fleet/privilege/v1/privilege_pb.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Leaflow TypeScript SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`src/<service>/v1/generated`. Module entry points stay outside that generated directory.
|
|
5
|
-
Root namespaces, versioned subpath imports and each module's `schemas`
|
|
6
|
-
export are preserved. `src/routes.ts` retains the static routing and authentication facts.
|
|
3
|
+
TypeScript SDK for the Leaflow platform, generated from the [leaflowapis](https://github.com/leaflowapis/leaflowapis) contracts.
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
```sh
|
|
6
|
+
npm install @leaflow/sdk
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Clients, models, and request validation schemas live under `src/<service>/<version>/generated`. Validate requests with the generated schemas before calling an operation.
|
|
10
10
|
|
|
11
11
|
## Generate and build
|
|
12
12
|
|
|
@@ -18,15 +18,12 @@ npm run generate
|
|
|
18
18
|
npm run build
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
so JSON and SSE retain their respective response formats. No compatibility forwarding layer is used. For local generation, CONTRACTS_DIR
|
|
23
|
-
may point to an existing clean checkout of the exact CONTRACTS_REF commit. CI checks out that commit.
|
|
21
|
+
The contract version is recorded in `CONTRACTS_REF`. `CONTRACTS_DIR` may point to a clean checkout at that ref.
|
|
24
22
|
|
|
25
23
|
## Protocol messages
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
path and encode or decode with `@bufbuild/protobuf`; no gRPC or Connect transport is involved:
|
|
25
|
+
Protobuf messages from the contract are generated with protoc-gen-es under `src/proto`, preserving their
|
|
26
|
+
proto paths. Import them by path and encode or decode with `@bufbuild/protobuf`:
|
|
30
27
|
|
|
31
28
|
```ts
|
|
32
29
|
import { create, toBinary } from "@bufbuild/protobuf";
|
|
@@ -36,9 +33,3 @@ const bytes = toBinary(ClientMessageSchema, create(ClientMessageSchema, {}));
|
|
|
36
33
|
```
|
|
37
34
|
|
|
38
35
|
`npm run generate` runs Orval and then `buf generate` on the same contract checkout.
|
|
39
|
-
|
|
40
|
-
## Canopy migration
|
|
41
|
-
|
|
42
|
-
Project inference and management are exported from `canopy` and `@leaflow/sdk/canopy/v1`.
|
|
43
|
-
Replace `canopyInference` and `@leaflow/sdk/canopy/inference/v1` imports with the shared Canopy module.
|
|
44
|
-
The OpenAI-compatible `/v1` paths, management `/api/v1` paths and scoped-token authentication are unchanged.
|
|
@@ -139,16 +139,28 @@
|
|
|
139
139
|
* applies:
|
|
140
140
|
*
|
|
141
141
|
* - inside a command run through this API, by the request itself;
|
|
142
|
-
* -
|
|
143
|
-
*
|
|
142
|
+
* - by the user's automatic approval for the machine, for a while or until removed
|
|
143
|
+
* (`PUT /api/v1/machines/{machineId}/privilege-auto-approval`), in one of two modes:
|
|
144
|
+
* - `automatic_review`, the recommended one: a large language model reviews each request and
|
|
145
|
+
* approves or denies it with a reason. It stops most dangerous requests, but not all of
|
|
146
|
+
* them. Each review is a request to Canopy, the model platform, through the project's
|
|
147
|
+
* Canopy service, and may incur Canopy charges; the project needs Canopy enabled. A
|
|
148
|
+
* request that cannot be reviewed, such as when the project has not enabled Canopy or the
|
|
149
|
+
* review does not complete in time, is denied with a reason saying so;
|
|
150
|
+
* - `always_approve`: every request is approved at once. This is dangerous: any program that
|
|
151
|
+
* runs as the account, such as a script or an AI agent, becomes root without anyone being
|
|
152
|
+
* asked;
|
|
144
153
|
* - by the user, on any of their devices, for a request listed by `GET /api/v1/privilege-requests`
|
|
145
154
|
* (`POST …:approve` or `…:deny`), or on a participant of the session the asking process belongs
|
|
146
155
|
* to. A request nobody decides expires, and sudo fails.
|
|
147
156
|
*
|
|
157
|
+
* A denied sudo shows whoever ran it the reason, when the denial gave one.
|
|
158
|
+
*
|
|
148
159
|
* Requests reach the user's devices as they happen through EventBus: the event
|
|
149
|
-
* `leaflow.fleet.privilege.requested` when one
|
|
150
|
-
* when it ends, each addressed to the user in the current
|
|
151
|
-
*
|
|
160
|
+
* `leaflow.fleet.privilege.requested` when one waits for the user and
|
|
161
|
+
* `leaflow.fleet.privilege.decided` when it ends, each addressed to the user in the current
|
|
162
|
+
* project and carrying the request's `id`. Requests decided without asking the user raise
|
|
163
|
+
* neither. A client that subscribes to them needs no polling; one that does not can list the
|
|
152
164
|
* pending requests.
|
|
153
165
|
*
|
|
154
166
|
* ## Connections that drop
|
|
@@ -223,7 +235,7 @@
|
|
|
223
235
|
* revoked. A participant whose creation failed is not announced.
|
|
224
236
|
* OpenAPI spec version: 1.0.0
|
|
225
237
|
*/
|
|
226
|
-
import type { AccountList, AccountResource, ApproveEnrollmentRequest, CallMcpToolRequest, CallMcpToolResponse, CreateGroupMemberRequest, CreateGroupRequest, CreateMachineRegistrationRequest, CreateMachineRegistrationResponse, CreateParticipantRequest, CreateParticipantResponse, CreatePeerConnectionCandidatesRequest, CreatePeerConnectionRequest, CreateSessionRequest, DeleteMcpServerParams, EnrollmentResource, Error, FindEnrollmentByPairingCodeParams, FindEnrollmentResponse, GroupList, GroupResource, ListAccountsParams, ListGroupMembersParams, ListGroupsParams, ListMachineEventsParams, ListMachineRegistrationsParams, ListMachinesParams, ListMcpToolsParams, ListPrivilegeAutoApprovalsParams, ListPrivilegeRequestsParams, ListSessionsParams, MachineEventList, MachineList, MachineRegistrationList, MachineRegistrationResource, MachineResource, McpConfigurationFile, McpConfigurationResource, McpToolList, MigrationStep, ParticipantList, ParticipantResource, PeerConnection, PrivilegeAutoApprovalList, PrivilegeAutoApprovalResource, PrivilegeRequestList, PrivilegeRequestResource, RenewParticipantRequest, RenewParticipantResponse, ReplaceMcpConfigurationRequest, RtcConfiguration, RunCommandRequest, RunCommandResponse, SendMcpRequestRequest, SendMcpRequestResponse, SessionList, SessionResource, UpdateAccountRequest, UpdateGroupRequest, UpdateMachineRequest, UpdateMcpServerRequest, UpdateMcpServerResponse, UpdatePrivilegeAutoApprovalRequest } from "./models.js";
|
|
238
|
+
import type { AccountList, AccountResource, ApproveEnrollmentRequest, CallMcpToolRequest, CallMcpToolResponse, CreateGroupMemberRequest, CreateGroupRequest, CreateMachineRegistrationRequest, CreateMachineRegistrationResponse, CreateParticipantRequest, CreateParticipantResponse, CreatePeerConnectionCandidatesRequest, CreatePeerConnectionRequest, CreateSessionRequest, DeleteMcpServerParams, DenyPrivilegeRequestRequest, EnrollmentResource, Error, FindEnrollmentByPairingCodeParams, FindEnrollmentResponse, GroupList, GroupResource, ListAccountsParams, ListGroupMembersParams, ListGroupsParams, ListMachineEventsParams, ListMachineRegistrationsParams, ListMachinesParams, ListMcpToolsParams, ListPrivilegeAutoApprovalsParams, ListPrivilegeRequestsParams, ListSessionsParams, MachineEventList, MachineList, MachineRegistrationList, MachineRegistrationResource, MachineResource, McpConfigurationFile, McpConfigurationResource, McpToolList, MigrationStep, ParticipantList, ParticipantResource, PeerConnection, PrivilegeAutoApprovalList, PrivilegeAutoApprovalResource, PrivilegeRequestList, PrivilegeRequestResource, RenewParticipantRequest, RenewParticipantResponse, ReplaceMcpConfigurationRequest, RtcConfiguration, RunCommandRequest, RunCommandResponse, SendMcpRequestRequest, SendMcpRequestResponse, SessionList, SessionResource, UpdateAccountRequest, UpdateGroupRequest, UpdateMachineRequest, UpdateMcpServerRequest, UpdateMcpServerResponse, UpdatePrivilegeAutoApprovalRequest } from "./models.js";
|
|
227
239
|
export type HTTPStatusCode1xx = 100 | 101 | 102 | 103;
|
|
228
240
|
export type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;
|
|
229
241
|
export type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
|
|
@@ -534,10 +546,10 @@ export declare const getSendMcpRequestUrl: (machineId: string, serverName: strin
|
|
|
534
546
|
* `tools/call`, `resources/read` or `prompts/get`, and returns the server's response. The
|
|
535
547
|
* machine starts or connects to the server if it is not running, and handles its
|
|
536
548
|
* initialization itself; a request still running when `timeout_seconds` passes is cancelled
|
|
537
|
-
* at the server. Requests the server makes of the client
|
|
538
|
-
* and its notifications, such as of progress, are
|
|
539
|
-
* is a successful request. Neither the request nor
|
|
540
|
-
* platform. Requires `fleet:machines.login` on the machine.
|
|
549
|
+
* at the server. Requests the server makes of the client are answered as by a client that
|
|
550
|
+
* offers no sampling, elicitation or roots, and its notifications, such as of progress, are
|
|
551
|
+
* dropped. A response with a JSON-RPC error is a successful request. Neither the request nor
|
|
552
|
+
* the response is hidden from the platform. Requires `fleet:machines.login` on the machine.
|
|
541
553
|
*
|
|
542
554
|
* Fails with:
|
|
543
555
|
* - `MCP_SERVER_NOT_FOUND` when the server is not configured;
|
|
@@ -660,12 +672,14 @@ export type updatePrivilegeAutoApprovalResponseError = updatePrivilegeAutoApprov
|
|
|
660
672
|
export type updatePrivilegeAutoApprovalResponse = updatePrivilegeAutoApprovalResponseSuccess | updatePrivilegeAutoApprovalResponseError;
|
|
661
673
|
export declare const getUpdatePrivilegeAutoApprovalUrl: (machineId: string) => string;
|
|
662
674
|
/**
|
|
663
|
-
*
|
|
664
|
-
* until removed when `expires_at` is null, replacing any
|
|
665
|
-
*
|
|
666
|
-
*
|
|
675
|
+
* Has the caller's privilege requests on the machine decided without asking them, in
|
|
676
|
+
* `mode`, until `expires_at`, or until removed when `expires_at` is null, replacing any
|
|
677
|
+
* earlier automatic approval. `automatic_review` is recommended; with `always_approve` any
|
|
678
|
+
* program that runs as the account becomes root without anyone being asked. It applies to
|
|
679
|
+
* the caller's own account only, which is created if the caller has none yet, and only
|
|
680
|
+
* while they may become root on the machine. Fails with `INVALID_ARGUMENT` when
|
|
667
681
|
* `expires_at` has passed.
|
|
668
|
-
* @summary
|
|
682
|
+
* @summary Decide the caller's privilege requests on a machine without asking
|
|
669
683
|
*/
|
|
670
684
|
export declare const updatePrivilegeAutoApproval: (machineId: string, updatePrivilegeAutoApprovalRequest: UpdatePrivilegeAutoApprovalRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<updatePrivilegeAutoApprovalResponse>;
|
|
671
685
|
export type deletePrivilegeAutoApprovalResponse204 = {
|
|
@@ -795,11 +809,11 @@ export type denyPrivilegeRequestResponseError = denyPrivilegeRequestResponseDefa
|
|
|
795
809
|
export type denyPrivilegeRequestResponse = denyPrivilegeRequestResponseSuccess | denyPrivilegeRequestResponseError;
|
|
796
810
|
export declare const getDenyPrivilegeRequestUrl: (requestId: string) => string;
|
|
797
811
|
/**
|
|
798
|
-
* Denies one of the caller's pending requests; the waiting sudo fails
|
|
799
|
-
* `PRIVILEGE_REQUEST_CLOSED` as for approving.
|
|
812
|
+
* Denies one of the caller's pending requests; the waiting sudo fails and shows `reason`,
|
|
813
|
+
* when given, to whoever ran it. Fails with `PRIVILEGE_REQUEST_CLOSED` as for approving.
|
|
800
814
|
* @summary Deny a privilege request
|
|
801
815
|
*/
|
|
802
|
-
export declare const denyPrivilegeRequest: (requestId: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<denyPrivilegeRequestResponse>;
|
|
816
|
+
export declare const denyPrivilegeRequest: (requestId: string, denyPrivilegeRequestRequest?: DenyPrivilegeRequestRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<denyPrivilegeRequestResponse>;
|
|
803
817
|
export type findEnrollmentByPairingCodeResponse200 = {
|
|
804
818
|
data: FindEnrollmentResponse;
|
|
805
819
|
status: 200;
|
|
@@ -334,10 +334,10 @@ export const getSendMcpRequestUrl = (machineId, serverName) => {
|
|
|
334
334
|
* `tools/call`, `resources/read` or `prompts/get`, and returns the server's response. The
|
|
335
335
|
* machine starts or connects to the server if it is not running, and handles its
|
|
336
336
|
* initialization itself; a request still running when `timeout_seconds` passes is cancelled
|
|
337
|
-
* at the server. Requests the server makes of the client
|
|
338
|
-
* and its notifications, such as of progress, are
|
|
339
|
-
* is a successful request. Neither the request nor
|
|
340
|
-
* platform. Requires `fleet:machines.login` on the machine.
|
|
337
|
+
* at the server. Requests the server makes of the client are answered as by a client that
|
|
338
|
+
* offers no sampling, elicitation or roots, and its notifications, such as of progress, are
|
|
339
|
+
* dropped. A response with a JSON-RPC error is a successful request. Neither the request nor
|
|
340
|
+
* the response is hidden from the platform. Requires `fleet:machines.login` on the machine.
|
|
341
341
|
*
|
|
342
342
|
* Fails with:
|
|
343
343
|
* - `MCP_SERVER_NOT_FOUND` when the server is not configured;
|
|
@@ -483,12 +483,14 @@ export const getUpdatePrivilegeAutoApprovalUrl = (machineId) => {
|
|
|
483
483
|
return `https://fleet.leaflow.cloud/api/v1/machines/${encodeURIComponent(String(machineId))}/privilege-auto-approval`;
|
|
484
484
|
};
|
|
485
485
|
/**
|
|
486
|
-
*
|
|
487
|
-
* until removed when `expires_at` is null, replacing any
|
|
488
|
-
*
|
|
489
|
-
*
|
|
486
|
+
* Has the caller's privilege requests on the machine decided without asking them, in
|
|
487
|
+
* `mode`, until `expires_at`, or until removed when `expires_at` is null, replacing any
|
|
488
|
+
* earlier automatic approval. `automatic_review` is recommended; with `always_approve` any
|
|
489
|
+
* program that runs as the account becomes root without anyone being asked. It applies to
|
|
490
|
+
* the caller's own account only, which is created if the caller has none yet, and only
|
|
491
|
+
* while they may become root on the machine. Fails with `INVALID_ARGUMENT` when
|
|
490
492
|
* `expires_at` has passed.
|
|
491
|
-
* @summary
|
|
493
|
+
* @summary Decide the caller's privilege requests on a machine without asking
|
|
492
494
|
*/
|
|
493
495
|
export const updatePrivilegeAutoApproval = async (machineId, updatePrivilegeAutoApprovalRequest, options, fetchFn) => {
|
|
494
496
|
const getHeaders = (h) => {
|
|
@@ -623,14 +625,31 @@ export const getDenyPrivilegeRequestUrl = (requestId) => {
|
|
|
623
625
|
return `https://fleet.leaflow.cloud/api/v1/privilege-requests/${encodeURIComponent(String(requestId))}:deny`;
|
|
624
626
|
};
|
|
625
627
|
/**
|
|
626
|
-
* Denies one of the caller's pending requests; the waiting sudo fails
|
|
627
|
-
* `PRIVILEGE_REQUEST_CLOSED` as for approving.
|
|
628
|
+
* Denies one of the caller's pending requests; the waiting sudo fails and shows `reason`,
|
|
629
|
+
* when given, to whoever ran it. Fails with `PRIVILEGE_REQUEST_CLOSED` as for approving.
|
|
628
630
|
* @summary Deny a privilege request
|
|
629
631
|
*/
|
|
630
|
-
export const denyPrivilegeRequest = async (requestId, options, fetchFn) => {
|
|
632
|
+
export const denyPrivilegeRequest = async (requestId, denyPrivilegeRequestRequest, options, fetchFn) => {
|
|
633
|
+
const getHeaders = (h) => {
|
|
634
|
+
if (!h)
|
|
635
|
+
return {};
|
|
636
|
+
if (h instanceof Headers)
|
|
637
|
+
return Object.fromEntries(h.entries());
|
|
638
|
+
if (Symbol.iterator in h) {
|
|
639
|
+
return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
640
|
+
}
|
|
641
|
+
const headers = {};
|
|
642
|
+
for (const [name, value] of Object.entries(h)) {
|
|
643
|
+
if (value !== undefined)
|
|
644
|
+
headers[name] = value;
|
|
645
|
+
}
|
|
646
|
+
return headers;
|
|
647
|
+
};
|
|
631
648
|
const res = await (fetchFn ?? fetch)(getDenyPrivilegeRequestUrl(requestId), {
|
|
632
649
|
...options,
|
|
633
650
|
method: "POST",
|
|
651
|
+
headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
|
|
652
|
+
body: JSON.stringify(denyPrivilegeRequestRequest),
|
|
634
653
|
});
|
|
635
654
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
636
655
|
const data = body ? JSON.parse(body) : {};
|
|
@@ -139,16 +139,28 @@
|
|
|
139
139
|
* applies:
|
|
140
140
|
*
|
|
141
141
|
* - inside a command run through this API, by the request itself;
|
|
142
|
-
* -
|
|
143
|
-
*
|
|
142
|
+
* - by the user's automatic approval for the machine, for a while or until removed
|
|
143
|
+
* (`PUT /api/v1/machines/{machineId}/privilege-auto-approval`), in one of two modes:
|
|
144
|
+
* - `automatic_review`, the recommended one: a large language model reviews each request and
|
|
145
|
+
* approves or denies it with a reason. It stops most dangerous requests, but not all of
|
|
146
|
+
* them. Each review is a request to Canopy, the model platform, through the project's
|
|
147
|
+
* Canopy service, and may incur Canopy charges; the project needs Canopy enabled. A
|
|
148
|
+
* request that cannot be reviewed, such as when the project has not enabled Canopy or the
|
|
149
|
+
* review does not complete in time, is denied with a reason saying so;
|
|
150
|
+
* - `always_approve`: every request is approved at once. This is dangerous: any program that
|
|
151
|
+
* runs as the account, such as a script or an AI agent, becomes root without anyone being
|
|
152
|
+
* asked;
|
|
144
153
|
* - by the user, on any of their devices, for a request listed by `GET /api/v1/privilege-requests`
|
|
145
154
|
* (`POST …:approve` or `…:deny`), or on a participant of the session the asking process belongs
|
|
146
155
|
* to. A request nobody decides expires, and sudo fails.
|
|
147
156
|
*
|
|
157
|
+
* A denied sudo shows whoever ran it the reason, when the denial gave one.
|
|
158
|
+
*
|
|
148
159
|
* Requests reach the user's devices as they happen through EventBus: the event
|
|
149
|
-
* `leaflow.fleet.privilege.requested` when one
|
|
150
|
-
* when it ends, each addressed to the user in the current
|
|
151
|
-
*
|
|
160
|
+
* `leaflow.fleet.privilege.requested` when one waits for the user and
|
|
161
|
+
* `leaflow.fleet.privilege.decided` when it ends, each addressed to the user in the current
|
|
162
|
+
* project and carrying the request's `id`. Requests decided without asking the user raise
|
|
163
|
+
* neither. A client that subscribes to them needs no polling; one that does not can list the
|
|
152
164
|
* pending requests.
|
|
153
165
|
*
|
|
154
166
|
* ## Connections that drop
|
|
@@ -787,14 +799,12 @@ export interface McpConfigurationFile {
|
|
|
787
799
|
set_aside: string | null;
|
|
788
800
|
}
|
|
789
801
|
/**
|
|
790
|
-
* `stdio` for a program the machine starts as the account, `http` for Streamable HTTP
|
|
791
|
-
* `sse` for HTTP with Server-Sent Events, the transport of earlier revisions of MCP
|
|
802
|
+
* `stdio` for a program the machine starts as the account, `http` for Streamable HTTP
|
|
792
803
|
*/
|
|
793
804
|
export type McpTransport = (typeof McpTransport)[keyof typeof McpTransport];
|
|
794
805
|
export declare const McpTransport: {
|
|
795
806
|
readonly stdio: "stdio";
|
|
796
807
|
readonly http: "http";
|
|
797
|
-
readonly sse: "sse";
|
|
798
808
|
};
|
|
799
809
|
/**
|
|
800
810
|
* `stopped` before its first use or after it was idle, `starting`, `running`, `failed`
|
|
@@ -838,7 +848,7 @@ export interface McpServerResource {
|
|
|
838
848
|
args: string[];
|
|
839
849
|
/** The variables `env` sets; their values are never returned */
|
|
840
850
|
env_keys: string[];
|
|
841
|
-
/** With `http
|
|
851
|
+
/** With `http`, the endpoint */
|
|
842
852
|
url: string;
|
|
843
853
|
/** The headers `headers` sends; their values are never returned */
|
|
844
854
|
header_keys: string[];
|
|
@@ -870,7 +880,7 @@ export type UpdateMcpServerRequestEnv = {
|
|
|
870
880
|
[key: string]: string;
|
|
871
881
|
};
|
|
872
882
|
/**
|
|
873
|
-
* With `http
|
|
883
|
+
* With `http`, headers sent with every request
|
|
874
884
|
*/
|
|
875
885
|
export type UpdateMcpServerRequestHeaders = {
|
|
876
886
|
[key: string]: string;
|
|
@@ -892,11 +902,11 @@ export interface UpdateMcpServerRequest {
|
|
|
892
902
|
/** With `stdio`, variables added to the account's environment */
|
|
893
903
|
env?: UpdateMcpServerRequestEnv;
|
|
894
904
|
/**
|
|
895
|
-
* With `http
|
|
905
|
+
* With `http`, the endpoint; shown to anyone who reads the configuration
|
|
896
906
|
* @maxLength 4096
|
|
897
907
|
*/
|
|
898
908
|
url?: string;
|
|
899
|
-
/** With `http
|
|
909
|
+
/** With `http`, headers sent with every request */
|
|
900
910
|
headers?: UpdateMcpServerRequestHeaders;
|
|
901
911
|
/** Configured but kept stopped */
|
|
902
912
|
disabled?: boolean;
|
|
@@ -1041,7 +1051,25 @@ export interface McpToolList {
|
|
|
1041
1051
|
/** Servers whose tools are missing because they could not be started or reached */
|
|
1042
1052
|
unavailable_servers: McpUnavailableServer[];
|
|
1043
1053
|
}
|
|
1054
|
+
/**
|
|
1055
|
+
* How the caller's privilege requests on the machine are decided without asking them:
|
|
1056
|
+
* - `automatic_review`, recommended: a large language model reviews each request from what
|
|
1057
|
+
* the machine reports about it, chiefly the command line, and approves or denies it with
|
|
1058
|
+
* a reason. It stops most dangerous requests, but not all of them. Each review is a
|
|
1059
|
+
* request to Canopy through the project's Canopy service and may incur Canopy charges. A
|
|
1060
|
+
* request that cannot be reviewed, such as when the project has not enabled Canopy, is
|
|
1061
|
+
* denied.
|
|
1062
|
+
* - `always_approve`: every request is approved at once. Dangerous: any program that runs
|
|
1063
|
+
* as the account, such as a script or an AI agent, becomes root without anyone being
|
|
1064
|
+
* asked.
|
|
1065
|
+
*/
|
|
1066
|
+
export type PrivilegeAutoApprovalMode = (typeof PrivilegeAutoApprovalMode)[keyof typeof PrivilegeAutoApprovalMode];
|
|
1067
|
+
export declare const PrivilegeAutoApprovalMode: {
|
|
1068
|
+
readonly automatic_review: "automatic_review";
|
|
1069
|
+
readonly always_approve: "always_approve";
|
|
1070
|
+
};
|
|
1044
1071
|
export interface UpdatePrivilegeAutoApprovalRequest {
|
|
1072
|
+
mode: PrivilegeAutoApprovalMode;
|
|
1045
1073
|
/**
|
|
1046
1074
|
* When the automatic approval ends; null for one that lasts until removed
|
|
1047
1075
|
* @nullable
|
|
@@ -1051,6 +1079,7 @@ export interface UpdatePrivilegeAutoApprovalRequest {
|
|
|
1051
1079
|
export interface PrivilegeAutoApprovalResource {
|
|
1052
1080
|
id: string;
|
|
1053
1081
|
machine_id: string;
|
|
1082
|
+
mode: PrivilegeAutoApprovalMode;
|
|
1054
1083
|
/**
|
|
1055
1084
|
* When the automatic approval ends; null for one that lasts until removed
|
|
1056
1085
|
* @nullable
|
|
@@ -1069,14 +1098,23 @@ export interface PrivilegeAutoApprovalList {
|
|
|
1069
1098
|
page_size: number;
|
|
1070
1099
|
}
|
|
1071
1100
|
/**
|
|
1072
|
-
* Who decided a request on the platform: `user` the user,
|
|
1073
|
-
* automatic approval
|
|
1101
|
+
* Who decided a request on the platform: `user` the user, `always_approve` the user's
|
|
1102
|
+
* automatic approval that approves every request, or `automatic_review` the large language
|
|
1103
|
+
* model that reviewed it.
|
|
1074
1104
|
*/
|
|
1075
1105
|
export type PrivilegeDecider = (typeof PrivilegeDecider)[keyof typeof PrivilegeDecider];
|
|
1076
1106
|
export declare const PrivilegeDecider: {
|
|
1077
1107
|
readonly user: "user";
|
|
1078
|
-
readonly
|
|
1108
|
+
readonly always_approve: "always_approve";
|
|
1109
|
+
readonly automatic_review: "automatic_review";
|
|
1079
1110
|
};
|
|
1111
|
+
export interface DenyPrivilegeRequestRequest {
|
|
1112
|
+
/**
|
|
1113
|
+
* Why, shown to whoever ran sudo: plain text without control characters
|
|
1114
|
+
* @maxLength 200
|
|
1115
|
+
*/
|
|
1116
|
+
reason?: string;
|
|
1117
|
+
}
|
|
1080
1118
|
/**
|
|
1081
1119
|
* `pending` waits for a decision; `approved` and `denied` were decided on the platform, as
|
|
1082
1120
|
* `decided_by` tells; `expired` was not decided in time; `cancelled` means the machine
|
|
@@ -1117,6 +1155,13 @@ export interface PrivilegeRequestResource {
|
|
|
1117
1155
|
state: PrivilegeRequestState;
|
|
1118
1156
|
/** Who decided an `approved` or `denied` request; null in any other state */
|
|
1119
1157
|
decided_by: PrivilegeDecider | null;
|
|
1158
|
+
/**
|
|
1159
|
+
* Why the request was decided so: as the user gave it when denying, or as the automatic
|
|
1160
|
+
* review gave it, including why a review could not be made; null when none was given
|
|
1161
|
+
* @maxLength 200
|
|
1162
|
+
* @nullable
|
|
1163
|
+
*/
|
|
1164
|
+
reason: string | null;
|
|
1120
1165
|
created_at: string;
|
|
1121
1166
|
expires_at: string;
|
|
1122
1167
|
/**
|
|
@@ -50,7 +50,6 @@ export const McpConfigurationFileState = {
|
|
|
50
50
|
export const McpTransport = {
|
|
51
51
|
stdio: "stdio",
|
|
52
52
|
http: "http",
|
|
53
|
-
sse: "sse",
|
|
54
53
|
};
|
|
55
54
|
export const McpServerResourceState = {
|
|
56
55
|
stopped: "stopped",
|
|
@@ -69,9 +68,14 @@ export const McpServerFailure = {
|
|
|
69
68
|
protocol_error: "protocol_error",
|
|
70
69
|
timeout: "timeout",
|
|
71
70
|
};
|
|
71
|
+
export const PrivilegeAutoApprovalMode = {
|
|
72
|
+
automatic_review: "automatic_review",
|
|
73
|
+
always_approve: "always_approve",
|
|
74
|
+
};
|
|
72
75
|
export const PrivilegeDecider = {
|
|
73
76
|
user: "user",
|
|
74
|
-
|
|
77
|
+
always_approve: "always_approve",
|
|
78
|
+
automatic_review: "automatic_review",
|
|
75
79
|
};
|
|
76
80
|
export const PrivilegeRequestState = {
|
|
77
81
|
pending: "pending",
|
|
@@ -139,16 +139,28 @@
|
|
|
139
139
|
* applies:
|
|
140
140
|
*
|
|
141
141
|
* - inside a command run through this API, by the request itself;
|
|
142
|
-
* -
|
|
143
|
-
*
|
|
142
|
+
* - by the user's automatic approval for the machine, for a while or until removed
|
|
143
|
+
* (`PUT /api/v1/machines/{machineId}/privilege-auto-approval`), in one of two modes:
|
|
144
|
+
* - `automatic_review`, the recommended one: a large language model reviews each request and
|
|
145
|
+
* approves or denies it with a reason. It stops most dangerous requests, but not all of
|
|
146
|
+
* them. Each review is a request to Canopy, the model platform, through the project's
|
|
147
|
+
* Canopy service, and may incur Canopy charges; the project needs Canopy enabled. A
|
|
148
|
+
* request that cannot be reviewed, such as when the project has not enabled Canopy or the
|
|
149
|
+
* review does not complete in time, is denied with a reason saying so;
|
|
150
|
+
* - `always_approve`: every request is approved at once. This is dangerous: any program that
|
|
151
|
+
* runs as the account, such as a script or an AI agent, becomes root without anyone being
|
|
152
|
+
* asked;
|
|
144
153
|
* - by the user, on any of their devices, for a request listed by `GET /api/v1/privilege-requests`
|
|
145
154
|
* (`POST …:approve` or `…:deny`), or on a participant of the session the asking process belongs
|
|
146
155
|
* to. A request nobody decides expires, and sudo fails.
|
|
147
156
|
*
|
|
157
|
+
* A denied sudo shows whoever ran it the reason, when the denial gave one.
|
|
158
|
+
*
|
|
148
159
|
* Requests reach the user's devices as they happen through EventBus: the event
|
|
149
|
-
* `leaflow.fleet.privilege.requested` when one
|
|
150
|
-
* when it ends, each addressed to the user in the current
|
|
151
|
-
*
|
|
160
|
+
* `leaflow.fleet.privilege.requested` when one waits for the user and
|
|
161
|
+
* `leaflow.fleet.privilege.decided` when it ends, each addressed to the user in the current
|
|
162
|
+
* project and carrying the request's `id`. Requests decided without asking the user raise
|
|
163
|
+
* neither. A client that subscribes to them needs no polling; one that does not can list the
|
|
152
164
|
* pending requests.
|
|
153
165
|
*
|
|
154
166
|
* ## Connections that drop
|
|
@@ -391,7 +403,6 @@ export declare const UpdateMcpServerParams: zod.ZodObject<{
|
|
|
391
403
|
}, zod.z.core.$strict>;
|
|
392
404
|
export declare const UpdateMcpServerBody: zod.ZodObject<{
|
|
393
405
|
transport: zod.ZodOptional<zod.ZodEnum<{
|
|
394
|
-
sse: "sse";
|
|
395
406
|
stdio: "stdio";
|
|
396
407
|
http: "http";
|
|
397
408
|
}>>;
|
|
@@ -426,10 +437,10 @@ export declare const DeleteMcpServerQueryParams: zod.ZodObject<{
|
|
|
426
437
|
* `tools/call`, `resources/read` or `prompts/get`, and returns the server's response. The
|
|
427
438
|
* machine starts or connects to the server if it is not running, and handles its
|
|
428
439
|
* initialization itself; a request still running when `timeout_seconds` passes is cancelled
|
|
429
|
-
* at the server. Requests the server makes of the client
|
|
430
|
-
* and its notifications, such as of progress, are
|
|
431
|
-
* is a successful request. Neither the request nor
|
|
432
|
-
* platform. Requires `fleet:machines.login` on the machine.
|
|
440
|
+
* at the server. Requests the server makes of the client are answered as by a client that
|
|
441
|
+
* offers no sampling, elicitation or roots, and its notifications, such as of progress, are
|
|
442
|
+
* dropped. A response with a JSON-RPC error is a successful request. Neither the request nor
|
|
443
|
+
* the response is hidden from the platform. Requires `fleet:machines.login` on the machine.
|
|
433
444
|
*
|
|
434
445
|
* Fails with:
|
|
435
446
|
* - `MCP_SERVER_NOT_FOUND` when the server is not configured;
|
|
@@ -521,17 +532,23 @@ export declare const GetPrivilegeAutoApprovalParams: zod.ZodObject<{
|
|
|
521
532
|
machineId: zod.ZodUUID;
|
|
522
533
|
}, zod.z.core.$strict>;
|
|
523
534
|
/**
|
|
524
|
-
*
|
|
525
|
-
* until removed when `expires_at` is null, replacing any
|
|
526
|
-
*
|
|
527
|
-
*
|
|
535
|
+
* Has the caller's privilege requests on the machine decided without asking them, in
|
|
536
|
+
* `mode`, until `expires_at`, or until removed when `expires_at` is null, replacing any
|
|
537
|
+
* earlier automatic approval. `automatic_review` is recommended; with `always_approve` any
|
|
538
|
+
* program that runs as the account becomes root without anyone being asked. It applies to
|
|
539
|
+
* the caller's own account only, which is created if the caller has none yet, and only
|
|
540
|
+
* while they may become root on the machine. Fails with `INVALID_ARGUMENT` when
|
|
528
541
|
* `expires_at` has passed.
|
|
529
|
-
* @summary
|
|
542
|
+
* @summary Decide the caller's privilege requests on a machine without asking
|
|
530
543
|
*/
|
|
531
544
|
export declare const UpdatePrivilegeAutoApprovalParams: zod.ZodObject<{
|
|
532
545
|
machineId: zod.ZodUUID;
|
|
533
546
|
}, zod.z.core.$strict>;
|
|
534
547
|
export declare const UpdatePrivilegeAutoApprovalBody: zod.ZodObject<{
|
|
548
|
+
mode: zod.ZodEnum<{
|
|
549
|
+
automatic_review: "automatic_review";
|
|
550
|
+
always_approve: "always_approve";
|
|
551
|
+
}>;
|
|
535
552
|
expires_at: zod.ZodNullable<zod.z.ZodISODateTime>;
|
|
536
553
|
}, zod.z.core.$strict>;
|
|
537
554
|
/**
|
|
@@ -593,13 +610,16 @@ export declare const ApprovePrivilegeRequestParams: zod.ZodObject<{
|
|
|
593
610
|
requestId: zod.ZodUUID;
|
|
594
611
|
}, zod.z.core.$strict>;
|
|
595
612
|
/**
|
|
596
|
-
* Denies one of the caller's pending requests; the waiting sudo fails
|
|
597
|
-
* `PRIVILEGE_REQUEST_CLOSED` as for approving.
|
|
613
|
+
* Denies one of the caller's pending requests; the waiting sudo fails and shows `reason`,
|
|
614
|
+
* when given, to whoever ran it. Fails with `PRIVILEGE_REQUEST_CLOSED` as for approving.
|
|
598
615
|
* @summary Deny a privilege request
|
|
599
616
|
*/
|
|
600
617
|
export declare const DenyPrivilegeRequestParams: zod.ZodObject<{
|
|
601
618
|
requestId: zod.ZodUUID;
|
|
602
619
|
}, zod.z.core.$strict>;
|
|
620
|
+
export declare const DenyPrivilegeRequestBody: zod.ZodObject<{
|
|
621
|
+
reason: zod.ZodOptional<zod.ZodString>;
|
|
622
|
+
}, zod.z.core.$strict>;
|
|
603
623
|
/**
|
|
604
624
|
* Returns the pending enrollment request whose pairing code matches, or no enrollment when
|
|
605
625
|
* none does. Mistyped codes are expected and are not an error. Letters are matched
|
|
@@ -139,16 +139,28 @@
|
|
|
139
139
|
* applies:
|
|
140
140
|
*
|
|
141
141
|
* - inside a command run through this API, by the request itself;
|
|
142
|
-
* -
|
|
143
|
-
*
|
|
142
|
+
* - by the user's automatic approval for the machine, for a while or until removed
|
|
143
|
+
* (`PUT /api/v1/machines/{machineId}/privilege-auto-approval`), in one of two modes:
|
|
144
|
+
* - `automatic_review`, the recommended one: a large language model reviews each request and
|
|
145
|
+
* approves or denies it with a reason. It stops most dangerous requests, but not all of
|
|
146
|
+
* them. Each review is a request to Canopy, the model platform, through the project's
|
|
147
|
+
* Canopy service, and may incur Canopy charges; the project needs Canopy enabled. A
|
|
148
|
+
* request that cannot be reviewed, such as when the project has not enabled Canopy or the
|
|
149
|
+
* review does not complete in time, is denied with a reason saying so;
|
|
150
|
+
* - `always_approve`: every request is approved at once. This is dangerous: any program that
|
|
151
|
+
* runs as the account, such as a script or an AI agent, becomes root without anyone being
|
|
152
|
+
* asked;
|
|
144
153
|
* - by the user, on any of their devices, for a request listed by `GET /api/v1/privilege-requests`
|
|
145
154
|
* (`POST …:approve` or `…:deny`), or on a participant of the session the asking process belongs
|
|
146
155
|
* to. A request nobody decides expires, and sudo fails.
|
|
147
156
|
*
|
|
157
|
+
* A denied sudo shows whoever ran it the reason, when the denial gave one.
|
|
158
|
+
*
|
|
148
159
|
* Requests reach the user's devices as they happen through EventBus: the event
|
|
149
|
-
* `leaflow.fleet.privilege.requested` when one
|
|
150
|
-
* when it ends, each addressed to the user in the current
|
|
151
|
-
*
|
|
160
|
+
* `leaflow.fleet.privilege.requested` when one waits for the user and
|
|
161
|
+
* `leaflow.fleet.privilege.decided` when it ends, each addressed to the user in the current
|
|
162
|
+
* project and carrying the request's `id`. Requests decided without asking the user raise
|
|
163
|
+
* neither. A client that subscribes to them needs no polling; one that does not can list the
|
|
152
164
|
* pending requests.
|
|
153
165
|
*
|
|
154
166
|
* ## Connections that drop
|
|
@@ -233,6 +245,7 @@ import { CreateParticipantRequest } from "./validators/createParticipantRequest.
|
|
|
233
245
|
import { CreatePeerConnectionCandidatesRequest } from "./validators/createPeerConnectionCandidatesRequest.zod.js";
|
|
234
246
|
import { CreatePeerConnectionRequest } from "./validators/createPeerConnectionRequest.zod.js";
|
|
235
247
|
import { CreateSessionRequest } from "./validators/createSessionRequest.zod.js";
|
|
248
|
+
import { DenyPrivilegeRequestRequest } from "./validators/denyPrivilegeRequestRequest.zod.js";
|
|
236
249
|
import { MigrationStep } from "./validators/migrationStep.zod.js";
|
|
237
250
|
import { RenewParticipantRequest } from "./validators/renewParticipantRequest.zod.js";
|
|
238
251
|
import { ReplaceMcpConfigurationRequest } from "./validators/replaceMcpConfigurationRequest.zod.js";
|
|
@@ -456,10 +469,10 @@ export const DeleteMcpServerQueryParams = zod.strictObject({
|
|
|
456
469
|
* `tools/call`, `resources/read` or `prompts/get`, and returns the server's response. The
|
|
457
470
|
* machine starts or connects to the server if it is not running, and handles its
|
|
458
471
|
* initialization itself; a request still running when `timeout_seconds` passes is cancelled
|
|
459
|
-
* at the server. Requests the server makes of the client
|
|
460
|
-
* and its notifications, such as of progress, are
|
|
461
|
-
* is a successful request. Neither the request nor
|
|
462
|
-
* platform. Requires `fleet:machines.login` on the machine.
|
|
472
|
+
* at the server. Requests the server makes of the client are answered as by a client that
|
|
473
|
+
* offers no sampling, elicitation or roots, and its notifications, such as of progress, are
|
|
474
|
+
* dropped. A response with a JSON-RPC error is a successful request. Neither the request nor
|
|
475
|
+
* the response is hidden from the platform. Requires `fleet:machines.login` on the machine.
|
|
463
476
|
*
|
|
464
477
|
* Fails with:
|
|
465
478
|
* - `MCP_SERVER_NOT_FOUND` when the server is not configured;
|
|
@@ -567,12 +580,14 @@ export const GetPrivilegeAutoApprovalParams = zod.strictObject({
|
|
|
567
580
|
machineId: zod.uuid(),
|
|
568
581
|
});
|
|
569
582
|
/**
|
|
570
|
-
*
|
|
571
|
-
* until removed when `expires_at` is null, replacing any
|
|
572
|
-
*
|
|
573
|
-
*
|
|
583
|
+
* Has the caller's privilege requests on the machine decided without asking them, in
|
|
584
|
+
* `mode`, until `expires_at`, or until removed when `expires_at` is null, replacing any
|
|
585
|
+
* earlier automatic approval. `automatic_review` is recommended; with `always_approve` any
|
|
586
|
+
* program that runs as the account becomes root without anyone being asked. It applies to
|
|
587
|
+
* the caller's own account only, which is created if the caller has none yet, and only
|
|
588
|
+
* while they may become root on the machine. Fails with `INVALID_ARGUMENT` when
|
|
574
589
|
* `expires_at` has passed.
|
|
575
|
-
* @summary
|
|
590
|
+
* @summary Decide the caller's privilege requests on a machine without asking
|
|
576
591
|
*/
|
|
577
592
|
export const UpdatePrivilegeAutoApprovalParams = zod.strictObject({
|
|
578
593
|
machineId: zod.uuid(),
|
|
@@ -654,13 +669,14 @@ export const ApprovePrivilegeRequestParams = zod.strictObject({
|
|
|
654
669
|
requestId: zod.uuid(),
|
|
655
670
|
});
|
|
656
671
|
/**
|
|
657
|
-
* Denies one of the caller's pending requests; the waiting sudo fails
|
|
658
|
-
* `PRIVILEGE_REQUEST_CLOSED` as for approving.
|
|
672
|
+
* Denies one of the caller's pending requests; the waiting sudo fails and shows `reason`,
|
|
673
|
+
* when given, to whoever ran it. Fails with `PRIVILEGE_REQUEST_CLOSED` as for approving.
|
|
659
674
|
* @summary Deny a privilege request
|
|
660
675
|
*/
|
|
661
676
|
export const DenyPrivilegeRequestParams = zod.strictObject({
|
|
662
677
|
requestId: zod.uuid(),
|
|
663
678
|
});
|
|
679
|
+
export const DenyPrivilegeRequestBody = DenyPrivilegeRequestRequest;
|
|
664
680
|
/**
|
|
665
681
|
* Returns the pending enrollment request whose pairing code matches, or no enrollment when
|
|
666
682
|
* none does. Mistyped codes are expected and are not an error. Letters are matched
|