muse_code_sdk/msp/view/state/permission_profile.rs
1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use serde::Deserialize;
4use serde::Serialize;
5
6/// A profile's selected reviewer authority. **Open**: the reviewer vocabulary
7/// can widen.
8#[derive(Debug, Clone, PartialEq, Eq)]
9#[non_exhaustive]
10pub enum ReviewerAuthority {
11 /// An automated reviewer decides (the `:auto-review` authority).
12 AutoReview,
13 /// A human reviewer decides (`ReviewerAuthorityV1::Human` — wire `"human"`).
14 Human,
15 /// No reviewer authority is configured (`ReviewerAuthorityV1::None`, e.g.
16 /// `:unrestricted`) — the native catalog lists such a profile.
17 None,
18 /// A value from a newer host, kept verbatim so an older client decodes the
19 /// rest of the message. Excluded from the generated schema while the enum
20 /// stays declared open; never construct it with a known word.
21 Unknown(String),
22}
23
24/// A committed profile's effective four axis values: the resolved filesystem,
25/// network, approval, and reviewer the YOLO predicate reads. The reviewer
26/// member reuses `ReviewerAuthority`, so its spelling never drifts from the
27/// served `reviewerAuthority`.
28#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
29#[serde(rename_all = "camelCase")]
30#[non_exhaustive]
31pub struct PermissionAxes {
32 /// The resolved filesystem mode in the picker's wording.
33 pub filesystem: PermissionFilesystemAxis,
34 /// The resolved local-command network mode in the picker's wording.
35 pub network: PermissionNetworkAxis,
36 /// The resolved approval authority.
37 pub approval: PermissionApprovalAxis,
38 /// The resolved reviewer authority.
39 pub reviewer: ReviewerAuthority,
40}
41
42/// A profile's effective filesystem axis. **Open**: the vocabulary can widen.
43#[derive(Debug, Clone, PartialEq, Eq)]
44#[non_exhaustive]
45pub enum PermissionFilesystemAxis {
46 /// Sandboxed execution (`FilesystemModeV1::Managed`).
47 Sandboxed,
48 /// No filesystem sandbox (`FilesystemModeV1::Unrestricted`).
49 Unrestricted,
50 /// A value from a newer host, kept verbatim so an older client decodes the
51 /// rest of the message. Excluded from the generated schema while the enum
52 /// stays declared open; never construct it with a known word.
53 Unknown(String),
54}
55
56/// A profile's effective local-command network axis. **Open**: the vocabulary
57/// can widen.
58#[derive(Debug, Clone, PartialEq, Eq)]
59#[non_exhaustive]
60pub enum PermissionNetworkAxis {
61 /// Fully restricted network (`LocalCommandNetworkModeV1::Restricted`).
62 Restricted,
63 /// Proxy-only network; direct local-command network is off
64 /// (`LocalCommandNetworkModeV1::ProxyOnly` — wire `"off"`).
65 ProxyOnly,
66 /// Direct local-command network access
67 /// (`LocalCommandNetworkModeV1::Enabled`).
68 Enabled,
69 /// A value from a newer host, kept verbatim so an older client decodes the
70 /// rest of the message. Excluded from the generated schema while the enum
71 /// stays declared open; never construct it with a known word.
72 Unknown(String),
73}
74
75/// A profile's effective approval axis. **Open**: the vocabulary can widen.
76#[derive(Debug, Clone, PartialEq, Eq)]
77#[non_exhaustive]
78pub enum PermissionApprovalAxis {
79 /// Tools run sandboxed; prompt only on explicit permission requests
80 /// (`ApprovalAuthorityV1::OnRequest`).
81 OnRequest,
82 /// Prompt for anything no rule matches (`ApprovalAuthorityV1::PromptUnmatched`).
83 PromptUnmatched,
84 /// No prompts; everything runs (`ApprovalAuthorityV1::AllowAll`).
85 AllowAll,
86 /// A value from a newer host, kept verbatim so an older client decodes the
87 /// rest of the message. Excluded from the generated schema while the enum
88 /// stays declared open; never construct it with a known word.
89 Unknown(String),
90}