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