@voltius/plugin-types 0.24.0 → 0.25.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/index.d.ts +80 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -111,7 +111,44 @@ export type PluginAuditAction =
|
|
|
111
111
|
// what actually reached the host. Must be on the server's CLIENT_WHITELIST
|
|
112
112
|
// before any client that emits it ships, or the team rows are 400ed and
|
|
113
113
|
// silently dropped.
|
|
114
|
-
| "agent.plugin_tool_run"
|
|
114
|
+
| "agent.plugin_tool_run"
|
|
115
|
+
// Team membership and terminal sharing (P7). Membership is not an object
|
|
116
|
+
// edit, so these do not reuse agent.object_*: the trail has to stay
|
|
117
|
+
// filterable by what happened to a team.
|
|
118
|
+
| "agent.member_invited"
|
|
119
|
+
| "agent.member_removed"
|
|
120
|
+
| "agent.member_role_changed"
|
|
121
|
+
| "agent.session_shared"
|
|
122
|
+
| "agent.session_unshared"
|
|
123
|
+
| "agent.control_granted";
|
|
124
|
+
|
|
125
|
+
export type DomainResult<T> = { ok: true; result: T } | { ok: false; error: string };
|
|
126
|
+
|
|
127
|
+
export interface PluginTeam {
|
|
128
|
+
id: string; name: string; ownerTier: string; myRoles: string[]; myRoleIds: string[]; vaultStatus: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type PluginTeamMember =
|
|
132
|
+
| { state: "member"; userId: string; displayName: string; roles: string[]; roleIds: string[]; isOnline: boolean }
|
|
133
|
+
| { state: "pending"; invitationId: string; displayName: string; roles: string[]; isOnline: false };
|
|
134
|
+
|
|
135
|
+
export interface PluginMemberKeyState {
|
|
136
|
+
userId: string; displayName: string; hasPublicKey: boolean; hasWrappedKey: boolean;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface PluginTeamKeyStatus {
|
|
140
|
+
teamId: string; vaultStatus: string; iHoldKey: boolean; members: PluginMemberKeyState[];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface PluginSharedSession {
|
|
144
|
+
multiplayerSessionId: string;
|
|
145
|
+
localSessionId: string | null;
|
|
146
|
+
connectionName: string;
|
|
147
|
+
isHost: boolean;
|
|
148
|
+
participants: { userId: string; displayName: string }[];
|
|
149
|
+
controlHolder: string;
|
|
150
|
+
controlRequester: string | null;
|
|
151
|
+
}
|
|
115
152
|
|
|
116
153
|
|
|
117
154
|
|
|
@@ -1013,6 +1050,48 @@ export interface PluginAPI {
|
|
|
1013
1050
|
focus(sessionId: string, maximize?: boolean): PluginPaneResult;
|
|
1014
1051
|
};
|
|
1015
1052
|
|
|
1053
|
+
/**
|
|
1054
|
+
* Teams, members and vault-key distribution (requires team:read / team:write).
|
|
1055
|
+
*
|
|
1056
|
+
* Writes are bounded by the caller's own server-side role bits: a member
|
|
1057
|
+
* without PERM_MANAGE_MEMBERS is refused by the server, not by this layer.
|
|
1058
|
+
* `keyStatus` reports the window where a member can be keyed but has not
|
|
1059
|
+
* been yet, and never repairs it.
|
|
1060
|
+
*/
|
|
1061
|
+
team: {
|
|
1062
|
+
list(): Promise<PluginTeam[]>;
|
|
1063
|
+
members(teamId: string): Promise<PluginTeamMember[]>;
|
|
1064
|
+
/** Every team the caller can see when `teamId` is omitted. */
|
|
1065
|
+
keyStatus(teamId?: string): Promise<PluginTeamKeyStatus[]>;
|
|
1066
|
+
/** Exactly one of `email` or `userId`. */
|
|
1067
|
+
invite(input: { teamId: string; email?: string; userId?: string; role?: string }):
|
|
1068
|
+
Promise<DomainResult<{ status: "pending" | "already_member" | "invited"; key: PluginMemberKeyState | null }>>;
|
|
1069
|
+
removeMember(teamId: string, userId: string): Promise<DomainResult<null>>;
|
|
1070
|
+
/** Replaces every role the member holds with `role`, a role id or role name
|
|
1071
|
+
* as reported by `list` and `members`. An unresolvable role is refused
|
|
1072
|
+
* before any role is removed. */
|
|
1073
|
+
setMemberRole(teamId: string, userId: string, role: string): Promise<DomainResult<null>>;
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* Live terminal sharing (requires sharing:read / sharing:write).
|
|
1078
|
+
*
|
|
1079
|
+
* Team-scoped only: the invite-link path mints a bearer token and is not
|
|
1080
|
+
* exposed. Writes return a DomainResult rather than throwing.
|
|
1081
|
+
*/
|
|
1082
|
+
sharing: {
|
|
1083
|
+
list(): Promise<PluginSharedSession[]>;
|
|
1084
|
+
/** Why `share` would refuse this session, or null when it may proceed —
|
|
1085
|
+
* callable before an approval is asked for, so a doomed share raises no
|
|
1086
|
+
* card and records nothing. */
|
|
1087
|
+
shareRefusal(sessionId: string): string | null;
|
|
1088
|
+
share(input: { sessionId: string; vaultIds: string[]; allowedRoles?: string[] }):
|
|
1089
|
+
Promise<DomainResult<{ multiplayerSessionId: string }>>;
|
|
1090
|
+
unshare(sessionId: string): Promise<DomainResult<null>>;
|
|
1091
|
+
/** Only approves a control request the participant already made. */
|
|
1092
|
+
handoffControl(sessionId: string, userId: string): Promise<DomainResult<null>>;
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1016
1095
|
/**
|
|
1017
1096
|
* The state of the user's own configuration sync (requires sync:read).
|
|
1018
1097
|
* Distinct from the plugin-scoped `sync` domain above, which is a plugin's
|