@voltius/plugin-types 0.16.1 → 0.17.1

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 (3) hide show
  1. package/index.d.ts +42 -1
  2. package/package.json +1 -1
  3. package/ui.d.ts +16 -0
package/index.d.ts CHANGED
@@ -87,6 +87,16 @@ export interface AppTheme {
87
87
 
88
88
  export type Locale = "en" | "fr" | "ru" | "zh";
89
89
 
90
+ export type PluginAuditAction =
91
+ | "agent.grant_created"
92
+ | "agent.grant_revoked"
93
+ | "agent.mode_changed"
94
+ | "agent.session_opened"
95
+ | "agent.session_closed"
96
+ | "agent.command_run"
97
+ | "agent.action_denied";
98
+
99
+
90
100
 
91
101
  // ─── Types exposés aux plugins ─────────────────────────────────────────────
92
102
 
@@ -215,6 +225,19 @@ export interface GlobalPanel {
215
225
  component: React.FC<{ open: boolean; onClose: () => void }>;
216
226
  }
217
227
 
228
+ /** Controls the panel it was returned from. Calling it disposes, as before. */
229
+ export interface GlobalPanelHandle {
230
+ (): void;
231
+ /** Host-prefixed id, e.g. "ai-agent:drawer". */
232
+ readonly id: string;
233
+ open(): void;
234
+ close(): void;
235
+ toggle(): void;
236
+ isOpen(): boolean;
237
+ /** Width (px) the app shell reserves while this panel is docked. */
238
+ setDockedWidth(width: number): void;
239
+ }
240
+
218
241
  export interface PluginSession {
219
242
  id: string;
220
243
  connectionId: string;
@@ -497,6 +520,24 @@ export interface PluginAPI {
497
520
  delete(key: string): Promise<void>;
498
521
  };
499
522
 
523
+ // Audit — record what this plugin did (requires "audit")
524
+ audit: {
525
+ /**
526
+ * Record an action against the connection it targets. A team-vault
527
+ * connection additionally posts to that team's server; "local", unknown
528
+ * and deleted ids fail closed to the on-device sink.
529
+ *
530
+ * `localMetadata` never leaves the device. Never pass captured terminal
531
+ * output to either channel.
532
+ */
533
+ record(
534
+ connectionId: string | null,
535
+ action: PluginAuditAction,
536
+ metadata?: Record<string, unknown>,
537
+ localMetadata?: Record<string, unknown>,
538
+ ): void;
539
+ };
540
+
500
541
  // Themes (requires "themes")
501
542
  themes: {
502
543
  register(theme: PluginTheme): void;
@@ -514,7 +555,7 @@ export interface PluginAPI {
514
555
  registerSettingsPage(page: SettingsPage): () => void;
515
556
  registerRightPanelSection(section: RightPanelSection): () => void;
516
557
  /** Mount a global, shell-level panel (not session-scoped). Returns cleanup. */
517
- registerGlobalPanel(panel: GlobalPanel): () => void;
558
+ registerGlobalPanel(panel: GlobalPanel): GlobalPanelHandle;
518
559
  /** Contribute a full-screen mobile view for `screen.kind`. Uninstalling or
519
560
  * disabling the plugin removes it, same as registerRightPanelSection does
520
561
  * on desktop. Returns cleanup. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltius/plugin-types",
3
- "version": "0.16.1",
3
+ "version": "0.17.1",
4
4
  "description": "TypeScript definitions for the Voltius plugin API",
5
5
  "types": "index.d.ts",
6
6
  "files": [
package/ui.d.ts CHANGED
@@ -6,4 +6,20 @@ declare module "@voltius/ui" {
6
6
  export const InfoTooltip: ComponentType<{ text: string; children?: ReactNode }>;
7
7
  export const BottomSheet: ComponentType<{ title?: string; onClose: () => void; children?: ReactNode }>;
8
8
  export function useAutosave<T>(value: T, save: (v: T) => void | Promise<void>, delayMs?: number): void;
9
+ export const ConnectionAvatar: ComponentType<{
10
+ connection: {
11
+ connection_type?: "ssh" | "serial" | "ftp";
12
+ serial_port?: string;
13
+ icon?: string;
14
+ distro?: string;
15
+ };
16
+ size: number;
17
+ }>;
18
+ export const ConfirmModal: ComponentType<{
19
+ title: string;
20
+ message: string;
21
+ confirmLabel?: string;
22
+ onConfirm: () => void;
23
+ onCancel: () => void;
24
+ }>;
9
25
  }