@voltius/plugin-types 0.24.0 → 0.26.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.
Files changed (2) hide show
  1. package/index.d.ts +160 -6
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -81,6 +81,8 @@ export interface AppTheme {
81
81
  uiFontSize: number;
82
82
  terminalFontFamily: string;
83
83
  terminalFontSize: number;
84
+ /** xterm lineHeight multiplier; optional for themes saved before it existed (defaults to 1). */
85
+ terminalLineHeight?: number;
84
86
  ui: UITheme;
85
87
  terminal: TerminalTheme;
86
88
  }
@@ -111,7 +113,62 @@ export type PluginAuditAction =
111
113
  // what actually reached the host. Must be on the server's CLIENT_WHITELIST
112
114
  // before any client that emits it ships, or the team rows are 400ed and
113
115
  // silently dropped.
114
- | "agent.plugin_tool_run";
116
+ | "agent.plugin_tool_run"
117
+ // Team membership and terminal sharing (P7). Membership is not an object
118
+ // edit, so these do not reuse agent.object_*: the trail has to stay
119
+ // filterable by what happened to a team.
120
+ | "agent.member_invited"
121
+ | "agent.member_removed"
122
+ | "agent.member_role_changed"
123
+ | "agent.session_shared"
124
+ | "agent.session_unshared"
125
+ | "agent.control_granted"
126
+ // A setting an agent changed. Local to the device: a settings verb's scope
127
+ // resolves no connection and no team, so runtime.ts files the row under the
128
+ // "personal" bucket audit.query reads. Nothing to add to the server's
129
+ // CLIENT_WHITELIST.
130
+ | "agent.setting_changed"
131
+ // Plugin lifecycle and import/export (P9). Local to the device: these verbs
132
+ // resolve no connection and no team, so runtime.ts files their rows under the
133
+ // "personal" bucket audit.query reads. Nothing to add to the server's
134
+ // CLIENT_WHITELIST.
135
+ | "agent.plugin_installed"
136
+ | "agent.plugin_removed"
137
+ | "agent.plugin_enabled"
138
+ | "agent.plugin_disabled"
139
+ | "agent.plugin_updated"
140
+ | "agent.plugin_configured"
141
+ | "agent.marketplace_source_changed"
142
+ | "agent.objects_imported"
143
+ | "agent.objects_exported";
144
+
145
+ export type DomainResult<T> = { ok: true; result: T } | { ok: false; error: string };
146
+
147
+ export interface PluginTeam {
148
+ id: string; name: string; ownerTier: string; myRoles: string[]; myRoleIds: string[]; vaultStatus: string;
149
+ }
150
+
151
+ export type PluginTeamMember =
152
+ | { state: "member"; userId: string; displayName: string; roles: string[]; roleIds: string[]; isOnline: boolean }
153
+ | { state: "pending"; invitationId: string; displayName: string; roles: string[]; isOnline: false };
154
+
155
+ export interface PluginMemberKeyState {
156
+ userId: string; displayName: string; hasPublicKey: boolean; hasWrappedKey: boolean;
157
+ }
158
+
159
+ export interface PluginTeamKeyStatus {
160
+ teamId: string; vaultStatus: string; iHoldKey: boolean; members: PluginMemberKeyState[];
161
+ }
162
+
163
+ export interface PluginSharedSession {
164
+ multiplayerSessionId: string;
165
+ localSessionId: string | null;
166
+ connectionName: string;
167
+ isHost: boolean;
168
+ participants: { userId: string; displayName: string }[];
169
+ controlHolder: string;
170
+ controlRequester: string | null;
171
+ }
115
172
 
116
173
 
117
174
 
@@ -817,8 +874,9 @@ export interface PortsAPI {
817
874
  reach(req: ReachPortRequest): Promise<ReachPortResponse>;
818
875
  }
819
876
 
820
- /** A local audit row, projected. Drops the internal id, actor id, team/vault
821
- * ids and IP — none of which a plugin or an external client has any use for. */
877
+ /** A local or team-server audit row, projected. Drops the internal id, actor
878
+ * id, team/vault ids and IP — none of which a plugin or an external client
879
+ * has any use for. */
822
880
  export interface PluginAuditRow {
823
881
  action: string;
824
882
  actor_name: string;
@@ -832,6 +890,10 @@ export interface PluginAuditRow {
832
890
 
833
891
  export interface PluginAuditQuery {
834
892
  actions?: string[];
893
+ /** Reads that team's server-side log instead of the device's local sink. */
894
+ teamId?: string;
895
+ vaultId?: string;
896
+ actorId?: string;
835
897
  /** ISO 8601. */
836
898
  from?: string;
837
899
  to?: string;
@@ -1013,6 +1075,48 @@ export interface PluginAPI {
1013
1075
  focus(sessionId: string, maximize?: boolean): PluginPaneResult;
1014
1076
  };
1015
1077
 
1078
+ /**
1079
+ * Teams, members and vault-key distribution (requires team:read / team:write).
1080
+ *
1081
+ * Writes are bounded by the caller's own server-side role bits: a member
1082
+ * without PERM_MANAGE_MEMBERS is refused by the server, not by this layer.
1083
+ * `keyStatus` reports the window where a member can be keyed but has not
1084
+ * been yet, and never repairs it.
1085
+ */
1086
+ team: {
1087
+ list(): Promise<PluginTeam[]>;
1088
+ members(teamId: string): Promise<PluginTeamMember[]>;
1089
+ /** Every team the caller can see when `teamId` is omitted. */
1090
+ keyStatus(teamId?: string): Promise<PluginTeamKeyStatus[]>;
1091
+ /** Exactly one of `email` or `userId`. */
1092
+ invite(input: { teamId: string; email?: string; userId?: string; role?: string }):
1093
+ Promise<DomainResult<{ status: "pending" | "already_member" | "invited"; key: PluginMemberKeyState | null }>>;
1094
+ removeMember(teamId: string, userId: string): Promise<DomainResult<null>>;
1095
+ /** Replaces every role the member holds with `role`, a role id or role name
1096
+ * as reported by `list` and `members`. An unresolvable role is refused
1097
+ * before any role is removed. */
1098
+ setMemberRole(teamId: string, userId: string, role: string): Promise<DomainResult<null>>;
1099
+ };
1100
+
1101
+ /**
1102
+ * Live terminal sharing (requires sharing:read / sharing:write).
1103
+ *
1104
+ * Team-scoped only: the invite-link path mints a bearer token and is not
1105
+ * exposed. Writes return a DomainResult rather than throwing.
1106
+ */
1107
+ sharing: {
1108
+ list(): Promise<PluginSharedSession[]>;
1109
+ /** Why `share` would refuse this session, or null when it may proceed —
1110
+ * callable before an approval is asked for, so a doomed share raises no
1111
+ * card and records nothing. */
1112
+ shareRefusal(sessionId: string): string | null;
1113
+ share(input: { sessionId: string; vaultIds: string[]; allowedRoles?: string[] }):
1114
+ Promise<DomainResult<{ multiplayerSessionId: string }>>;
1115
+ unshare(sessionId: string): Promise<DomainResult<null>>;
1116
+ /** Only approves a control request the participant already made. */
1117
+ handoffControl(sessionId: string, userId: string): Promise<DomainResult<null>>;
1118
+ };
1119
+
1016
1120
  /**
1017
1121
  * The state of the user's own configuration sync (requires sync:read).
1018
1122
  * Distinct from the plugin-scoped `sync` domain above, which is a plugin's
@@ -1095,11 +1199,34 @@ export interface PluginAPI {
1095
1199
  metadata?: Record<string, unknown>,
1096
1200
  localMetadata?: Record<string, unknown>,
1097
1201
  ): void;
1098
- /** This device's local rows only. Team-vault rows are server-backed and
1099
- * are not returned here. */
1202
+ /** Local rows by default; pass `teamId` to read that team's server-side log instead. */
1100
1203
  query(filters: PluginAuditQuery): Promise<{ logs: PluginAuditRow[]; total: number }>;
1101
1204
  };
1102
1205
 
1206
+ // App settings — read the manifest and current values (requires the gated
1207
+ // "settings:read"); write one (requires the gated "settings:write").
1208
+ settings: {
1209
+ list(filter?: { section?: string; prefix?: string; writableOnly?: boolean }): SettingView[];
1210
+ get(key: string): SettingView | undefined;
1211
+ /** The sentence a guarded write must be refused with, or undefined when
1212
+ * writing `value` does not weaken any safeguard (re-enabling one never
1213
+ * does). Read-only — requires "settings:read". */
1214
+ consequenceOf(key: string, value: unknown): string | undefined;
1215
+ /** Writes, then RE-READS: a store setter may clamp or normalise, so
1216
+ * `effective` is the value that actually landed, not the one asked for,
1217
+ * and `coerced` says whether the two differ. Neither reports whether the
1218
+ * setting's value moved — writing the value it already held is a
1219
+ * successful write with `coerced: false`. */
1220
+ set(key: string, value: unknown): DomainResult<{
1221
+ key: string; requested: unknown; effective: unknown; coerced: boolean;
1222
+ }>;
1223
+ };
1224
+
1225
+ // The user's own plan and billing state (requires the gated "account:read")
1226
+ account: {
1227
+ subscription(): Promise<SubscriptionView>;
1228
+ };
1229
+
1103
1230
  // Themes (requires "themes")
1104
1231
  themes: {
1105
1232
  register(theme: PluginTheme): void;
@@ -1313,12 +1440,39 @@ export interface PluginAPI {
1313
1440
  importStates(encKey: string, blobs: string[]): Promise<void>;
1314
1441
  };
1315
1442
 
1316
- // Inter-plugin communication (always available)
1443
+ // Inter-plugin communication (always available), plus plugin inventory and
1444
+ // lifecycle (requires the gated "plugins:manage"). Configuration is limited
1445
+ // to keys the target plugin declares in `contributes.configuration`; raw
1446
+ // api.storage is deliberately not reachable.
1317
1447
  plugins: {
1318
1448
  /** Publish this plugin's public API surface so other plugins can consume it. */
1319
1449
  expose(publicApi: unknown): void;
1320
1450
  /** Get another plugin's exposed API. Returns null if not loaded or not exposed. */
1321
1451
  getApi(pluginId: string): unknown | null;
1452
+
1453
+ list(): Promise<PluginView[]>;
1454
+ install(id: string): Promise<DomainResult<PluginView>>;
1455
+ uninstall(id: string): Promise<DomainResult<{ id: string }>>;
1456
+ setEnabled(id: string, enabled: boolean): Promise<DomainResult<PluginView>>;
1457
+ update(id: string): Promise<DomainResult<PluginView>>;
1458
+ config(id: string): Promise<DomainResult<Record<string, unknown>>>;
1459
+ configure(id: string, key: string, value: unknown): Promise<DomainResult<{ key: string; effective: unknown }>>;
1460
+ sources(): Promise<SourceView[]>;
1461
+ search(query?: string): Promise<MarketplacePlugin[]>;
1462
+ addSource(url: string): Promise<DomainResult<SourceView>>;
1463
+ removeSource(id: string): Promise<DomainResult<{ id: string }>>;
1464
+ };
1465
+
1466
+ // Bulk export (requires the gated "importexport:read") and import (requires
1467
+ // the gated "importexport:write"). A bundle carrying secrets is only ever
1468
+ // returned encrypted.
1469
+ importExport: {
1470
+ export(opts: {
1471
+ vaultIds: string[]; types: ExportType[]; format: "json" | "csv"; passphrase?: string;
1472
+ }): Promise<DomainResult<ExportResult>>;
1473
+ import(opts: {
1474
+ content: string; vaultId: string; passphrase?: string; dryRun: boolean;
1475
+ }): Promise<DomainResult<ImportResult>>;
1322
1476
  };
1323
1477
 
1324
1478
  // MCP tool contributions — GATED (mcp:contribute). Tools run with THIS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltius/plugin-types",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "description": "TypeScript definitions for the Voltius plugin API",
5
5
  "types": "index.d.ts",
6
6
  "files": [