@principal-ade/panel-layouts 0.2.9 → 0.3.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/dist/index.d.ts CHANGED
@@ -5,9 +5,7 @@ import { EditableConfigurablePanelLayoutProps } from '@principal-ade/panels';
5
5
  import { JsonSchema } from '@principal-ade/panel-framework-core';
6
6
  import { mapThemeToPanelVars } from '@principal-ade/panels';
7
7
  import { mapThemeToTabVars } from '@principal-ade/panels';
8
- import { PanelActions } from '@principal-ade/panel-framework-core';
9
8
  import { PanelBlurEventPayload } from '@principal-ade/panel-framework-core';
10
- import { PanelContextValue } from '@principal-ade/panel-framework-core';
11
9
  import { PanelDefinition } from '@principal-ade/panels';
12
10
  import { PanelDefinitionWithContent } from '@principal-ade/panels';
13
11
  import { PanelEventEmitter } from '@principal-ade/panel-framework-core';
@@ -16,8 +14,6 @@ import { PanelGroup } from '@principal-ade/panels';
16
14
  import { PanelLayout } from '@principal-ade/panels';
17
15
  import { PanelSlot } from '@principal-ade/panels';
18
16
  import { PanelTool } from '@principal-ade/panel-framework-core';
19
- import { PanelToolRegistry } from '@principal-ade/panel-framework-core';
20
- import { RegisteredTool } from '@principal-ade/panel-framework-core';
21
17
  import { ResponsiveConfigurablePanelLayout } from '@principal-ade/panels';
22
18
  import { ResponsiveConfigurablePanelLayoutProps } from '@principal-ade/panels';
23
19
  import { TabsConfig } from '@principal-ade/panels';
@@ -184,66 +180,6 @@ export declare type BuiltInWorkspaceId = 'project-management' | 'code-review' |
184
180
  */
185
181
  export declare const collapseAllPanelsTool: PanelTool;
186
182
 
187
- /**
188
- * Command definition for the command palette
189
- */
190
- export declare interface Command {
191
- /** Unique identifier for the command */
192
- id: string;
193
- /** Display label shown in the command list */
194
- label: string;
195
- /** Optional description shown below the label */
196
- description?: string;
197
- /** Optional icon (string or React element) */
198
- icon?: string | React.ReactNode;
199
- /** Keywords for fuzzy search matching */
200
- keywords?: string[];
201
- /** Category for grouping commands */
202
- category?: string;
203
- /** Optional keyboard shortcut hint (e.g., "Alt+1") */
204
- shortcut?: string;
205
- /** Command execution function */
206
- execute: (context: CommandContext) => void | Promise<void>;
207
- /** Optional function to determine if command is available */
208
- isAvailable?: (context: CommandContext) => boolean;
209
- /** Priority for ordering (higher = appears first) */
210
- priority?: number;
211
- }
212
-
213
- /**
214
- * Command category definition
215
- */
216
- export declare interface CommandCategory {
217
- /** Category identifier */
218
- id: string;
219
- /** Display label */
220
- label: string;
221
- /** Display priority (higher = shown first) */
222
- priority?: number;
223
- /** Optional icon */
224
- icon?: string | React.ReactNode;
225
- }
226
-
227
- /**
228
- * Context provided to command execution functions
229
- */
230
- export declare interface CommandContext {
231
- /** Panel framework context */
232
- panelContext: PanelContextValue;
233
- /** Panel actions for navigation, file operations, etc. */
234
- actions: PanelActions;
235
- /** Event bus for inter-panel communication */
236
- events: PanelEventEmitter;
237
- /** Currently focused panel */
238
- focusedPanel: PanelSlotId | null;
239
- /** Function to set panel focus */
240
- setFocus: (panel: PanelSlotId) => void;
241
- /** Workspace management service */
242
- workspaceService?: WorkspaceLayoutService;
243
- /** Close the command palette */
244
- closeCommandPalette: () => void;
245
- }
246
-
247
183
  /**
248
184
  * Entry in the command history
249
185
  */
@@ -258,187 +194,6 @@ export declare interface CommandHistoryEntry {
258
194
  success: boolean;
259
195
  }
260
196
 
261
- /**
262
- * CommandInput - Input field for the command palette
263
- * Auto-focuses on mount and handles input changes
264
- */
265
- export declare const CommandInput: default_2.FC<CommandInputProps>;
266
-
267
- declare interface CommandInputProps {
268
- value: string;
269
- onChange: (value: string) => void;
270
- placeholder?: string;
271
- onClose: () => void;
272
- onEnter?: () => void;
273
- }
274
-
275
- /**
276
- * CommandItem - Individual command item in the list
277
- * Displays command label, description, icon, and keyboard shortcut
278
- */
279
- export declare const CommandItem: default_2.ForwardRefExoticComponent<CommandItemProps & default_2.RefAttributes<HTMLDivElement>>;
280
-
281
- declare interface CommandItemProps {
282
- command: Command;
283
- isSelected: boolean;
284
- onClick: () => void;
285
- onMouseEnter: () => void;
286
- }
287
-
288
- /**
289
- * CommandList - List of filtered commands
290
- * Displays commands grouped by category with keyboard navigation support
291
- */
292
- export declare const CommandList: default_2.FC<CommandListProps>;
293
-
294
- declare interface CommandListProps {
295
- commands: Command[];
296
- selectedIndex: number;
297
- onSelect: (command: Command) => void;
298
- onHover: (index: number) => void;
299
- maxResults?: number;
300
- }
301
-
302
- /**
303
- * CommandPalette - Vim-style command palette component
304
- * Displays at the bottom of the screen with an input field and command list
305
- */
306
- export declare const CommandPalette: default_2.FC<CommandPaletteProps>;
307
-
308
- /**
309
- * Configuration options for the command palette
310
- */
311
- export declare interface CommandPaletteConfig {
312
- /** Custom keyboard shortcut configuration */
313
- keyboard?: CommandPaletteKeyboardConfig;
314
- /** Maximum number of results to show */
315
- maxResults?: number;
316
- /** Placeholder text for the input field */
317
- placeholder?: string;
318
- /** Custom CSS class for the container */
319
- className?: string;
320
- /** Custom styles for the container */
321
- style?: React.CSSProperties;
322
- /** Maximum height of the results list */
323
- maxHeight?: string;
324
- /** Enable fuzzy search (default: true) */
325
- fuzzySearch?: boolean;
326
- /** Threshold for fuzzy search matching (0-1, default: 0.3) */
327
- fuzzyThreshold?: number;
328
- }
329
-
330
- /**
331
- * Keyboard shortcut configuration for triggering the command palette
332
- */
333
- export declare interface CommandPaletteKeyboardConfig {
334
- /** Key to trigger the command palette (default: ' ' for Space) */
335
- key?: string;
336
- /** Require Alt key (default: true) */
337
- altKey?: boolean;
338
- /** Require Ctrl key (default: false) */
339
- ctrlKey?: boolean;
340
- /** Require Meta/Cmd key (default: false) */
341
- metaKey?: boolean;
342
- /** Require Shift key (default: false) */
343
- shiftKey?: boolean;
344
- }
345
-
346
- /**
347
- * Props for the CommandPalette component
348
- */
349
- export declare interface CommandPaletteProps {
350
- /** Command palette hook return value */
351
- commandPalette: UseCommandPaletteReturn;
352
- /** Configuration options */
353
- config?: CommandPaletteConfig;
354
- /** Panel context for command execution */
355
- context: CommandContext;
356
- }
357
-
358
- /**
359
- * Service for managing command registration and execution
360
- * Provides a centralized registry for commands that can be accessed via the command palette
361
- */
362
- export declare class CommandRegistryService {
363
- private commands;
364
- private listeners;
365
- /**
366
- * Register one or more commands
367
- * @param commands - Array of commands to register
368
- */
369
- registerCommands(commands: Command[]): void;
370
- /**
371
- * Register a single command
372
- * @param command - Command to register
373
- */
374
- registerCommand(command: Command): void;
375
- /**
376
- * Unregister commands by ID
377
- * @param commandIds - Array of command IDs to unregister
378
- */
379
- unregisterCommands(commandIds: string[]): void;
380
- /**
381
- * Unregister a single command
382
- * @param commandId - Command ID to unregister
383
- */
384
- unregisterCommand(commandId: string): void;
385
- /**
386
- * Get all registered commands
387
- * @param context - Command context for availability checks
388
- * @returns Array of available commands
389
- */
390
- getCommands(context?: CommandContext): Command[];
391
- /**
392
- * Get a command by ID
393
- * @param commandId - Command ID
394
- * @returns Command if found, undefined otherwise
395
- */
396
- getCommand(commandId: string): Command | undefined;
397
- /**
398
- * Execute a command by ID
399
- * @param commandId - Command ID to execute
400
- * @param context - Command context
401
- */
402
- executeCommand(commandId: string, context: CommandContext): Promise<void>;
403
- /**
404
- * Search commands by query
405
- * @param query - Search query
406
- * @param context - Command context for availability checks
407
- * @returns Filtered and sorted commands
408
- */
409
- searchCommands(query: string, context?: CommandContext): Command[];
410
- /**
411
- * Sort commands by priority and label
412
- * @param commands - Commands to sort
413
- * @returns Sorted commands
414
- */
415
- private sortCommands;
416
- /**
417
- * Subscribe to registry changes
418
- * @param listener - Callback function called when registry changes
419
- * @returns Unsubscribe function
420
- */
421
- subscribe(listener: () => void): () => void;
422
- /**
423
- * Clear all commands
424
- */
425
- clear(): void;
426
- /**
427
- * Get count of registered commands
428
- */
429
- get size(): number;
430
- /**
431
- * Notify all listeners of registry changes
432
- */
433
- private notifyListeners;
434
- }
435
-
436
- /**
437
- * Creates a hook-like function that returns commands from a registry.
438
- * Useful for dynamic command registration.
439
- */
440
- export declare function createToolCommandsProvider(registry: PanelToolRegistry, config?: ToolCommandBridgeConfig): () => Command[];
441
-
442
197
  /**
443
198
  * Options for creating a new workspace
444
199
  */
@@ -531,18 +286,6 @@ export declare function generateToolsSystemPrompt(tools: PanelTool[], options?:
531
286
  includeParameters?: boolean;
532
287
  }): string;
533
288
 
534
- /**
535
- * Get the global command registry instance
536
- * @returns Global CommandRegistryService instance
537
- */
538
- export declare function getGlobalCommandRegistry(): CommandRegistryService;
539
-
540
- /**
541
- * Get panel commands
542
- * @returns Array of panel-related commands
543
- */
544
- export declare function getPanelCommands(): Command[];
545
-
546
289
  /**
547
290
  * Tool: Get Panel State
548
291
  *
@@ -551,11 +294,6 @@ export declare function getPanelCommands(): Command[];
551
294
  */
552
295
  export declare const getPanelStateTool: PanelTool;
553
296
 
554
- /**
555
- * Utility to extract parameter information for UI rendering.
556
- */
557
- export declare function getToolParameterInfo(tool: RegisteredTool): ToolParameterInfo[];
558
-
559
297
  /**
560
298
  * Tool: Get Visible Panels
561
299
  *
@@ -706,11 +444,6 @@ export declare interface PanelCollapsed {
706
444
  right?: boolean;
707
445
  }
708
446
 
709
- /**
710
- * Built-in commands for panel navigation and control
711
- */
712
- export declare const panelCommands: Command[];
713
-
714
447
  /**
715
448
  * A button component for opening panel configuration/layout settings.
716
449
  */
@@ -939,11 +672,6 @@ export declare interface RepositoryWorkspaceState {
939
672
  };
940
673
  }
941
674
 
942
- /**
943
- * Reset the global command registry (useful for testing)
944
- */
945
- export declare function resetGlobalCommandRegistry(): void;
946
-
947
675
  /**
948
676
  * Tool: Reset Layout
949
677
  *
@@ -995,18 +723,6 @@ export { TilesConfig }
995
723
  */
996
724
  export declare const togglePanelTool: PanelTool;
997
725
 
998
- /**
999
- * Configuration for the tool-to-command bridge
1000
- */
1001
- export declare interface ToolCommandBridgeConfig {
1002
- /** Category prefix for tool commands (default: 'Panel Tools') */
1003
- categoryPrefix?: string;
1004
- /** Priority offset for tool commands (default: 50) */
1005
- basePriority?: number;
1006
- /** Whether to include panel ID in category (default: true) */
1007
- includePanelInCategory?: boolean;
1008
- }
1009
-
1010
726
  /**
1011
727
  * Represents a single tool execution
1012
728
  */
@@ -1045,18 +761,6 @@ export declare interface ToolExecutionListProps {
1045
761
  */
1046
762
  export declare type ToolExecutionStatus = 'pending' | 'running' | 'success' | 'error';
1047
763
 
1048
- /**
1049
- * Parameter information for UI rendering
1050
- */
1051
- export declare interface ToolParameterInfo {
1052
- name: string;
1053
- type: string;
1054
- description: string;
1055
- required: boolean;
1056
- default?: unknown;
1057
- enum?: string[];
1058
- }
1059
-
1060
764
  /**
1061
765
  * Convert an array of PanelTools to AIFunctionDefinition format.
1062
766
  */
@@ -1067,11 +771,6 @@ export declare function toolsToAIFunctions(tools: PanelTool[]): AIFunctionDefini
1067
771
  */
1068
772
  export declare function toolsToAnthropicFormat(tools: PanelTool[]): AnthropicTool[];
1069
773
 
1070
- /**
1071
- * Converts all tools from a registry into commands.
1072
- */
1073
- export declare function toolsToCommands(registry: PanelToolRegistry, config?: ToolCommandBridgeConfig): Command[];
1074
-
1075
774
  /**
1076
775
  * Convert an array of PanelTools to Gemini tools format.
1077
776
  */
@@ -1093,15 +792,6 @@ export declare function toolToAIFunction(tool: PanelTool): AIFunctionDefinition;
1093
792
  */
1094
793
  export declare function toolToAnthropicFormat(tool: PanelTool): AnthropicTool;
1095
794
 
1096
- /**
1097
- * Converts a registered tool into a command palette command.
1098
- *
1099
- * For tools with no required parameters, the command executes immediately.
1100
- * For tools with required parameters, this is a placeholder - full
1101
- * implementation would need a parameter input UI.
1102
- */
1103
- export declare function toolToCommand(tool: RegisteredTool, registry: PanelToolRegistry, config?: ToolCommandBridgeConfig): Command;
1104
-
1105
795
  /**
1106
796
  * Convert a PanelTool to Gemini function declaration format.
1107
797
  */
@@ -1228,63 +918,6 @@ export declare interface UseAgentCommandPaletteReturn {
1228
918
  clear: () => void;
1229
919
  }
1230
920
 
1231
- /**
1232
- * Hook for managing command palette state and behavior
1233
- * Handles command registration, filtering, keyboard navigation, and execution
1234
- */
1235
- export declare function useCommandPalette({ context, commands: initialCommands, keyboard, config, registry: providedRegistry, }: UseCommandPaletteProps): UseCommandPaletteReturn;
1236
-
1237
- declare interface UseCommandPaletteProps {
1238
- /** Command context */
1239
- context: CommandContext;
1240
- /** Initial commands to register */
1241
- commands?: Command[];
1242
- /** Keyboard configuration */
1243
- keyboard?: CommandPaletteKeyboardConfig;
1244
- /** Command palette configuration */
1245
- config?: CommandPaletteConfig;
1246
- /** Command registry service (optional, uses global if not provided) */
1247
- registry?: CommandRegistryService;
1248
- }
1249
-
1250
- /**
1251
- * Command palette state and actions hook return type
1252
- */
1253
- export declare interface UseCommandPaletteReturn {
1254
- /** Whether the command palette is open */
1255
- isOpen: boolean;
1256
- /** Open the command palette */
1257
- open: () => void;
1258
- /** Close the command palette */
1259
- close: () => void;
1260
- /** Toggle the command palette */
1261
- toggle: () => void;
1262
- /** Search query */
1263
- query: string;
1264
- /** Set search query */
1265
- setQuery: (query: string) => void;
1266
- /** Filtered and sorted commands */
1267
- filteredCommands: Command[];
1268
- /** Execute a command by ID */
1269
- executeCommand: (commandId: string) => Promise<void>;
1270
- /** Selected command index (for keyboard navigation) */
1271
- selectedIndex: number;
1272
- /** Set selected index */
1273
- setSelectedIndex: (index: number) => void;
1274
- /** Navigate to next command */
1275
- selectNext: () => void;
1276
- /** Navigate to previous command */
1277
- selectPrevious: () => void;
1278
- /** Execute the currently selected command */
1279
- executeSelected: () => Promise<void>;
1280
- /** All registered commands */
1281
- commands: Command[];
1282
- /** Register new commands */
1283
- registerCommands: (commands: Command[]) => void;
1284
- /** Unregister commands by ID */
1285
- unregisterCommands: (commandIds: string[]) => void;
1286
- }
1287
-
1288
921
  /**
1289
922
  * Hook for managing panel focus state with keyboard shortcuts
1290
923
  */
@@ -1421,12 +1054,6 @@ export declare interface UsePanelPersistenceOptions {
1421
1054
  adapter?: PersistenceAdapter;
1422
1055
  }
1423
1056
 
1424
- /**
1425
- * Hook to use tool commands in React components.
1426
- * Subscribes to registry changes and updates commands accordingly.
1427
- */
1428
- export declare function useToolCommands(registry: PanelToolRegistry, config?: ToolCommandBridgeConfig): Command[];
1429
-
1430
1057
  export declare function useWorkspace(options?: UseWorkspaceOptions): UseWorkspaceReturn;
1431
1058
 
1432
1059
  export declare interface UseWorkspaceOptions {