@principal-ade/panel-layouts 0.2.4 → 0.2.6
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 +286 -0
- package/dist/index.esm.js +1811 -903
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,143 @@ import { TabsConfig } from '@principal-ade/panels';
|
|
|
24
24
|
import { Theme } from '@principal-ade/panels';
|
|
25
25
|
import { TilesConfig } from '@principal-ade/panels';
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* AgentCommandInput - Input field for the Agent Command Palette
|
|
29
|
+
* Supports natural language mode and quick command mode (/ prefix)
|
|
30
|
+
*/
|
|
31
|
+
export declare const AgentCommandInput: default_2.FC<AgentCommandInputProps>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Props for AgentCommandInput component
|
|
35
|
+
*/
|
|
36
|
+
export declare interface AgentCommandInputProps {
|
|
37
|
+
/** Current input value */
|
|
38
|
+
value: string;
|
|
39
|
+
/** Change handler */
|
|
40
|
+
onChange: (value: string) => void;
|
|
41
|
+
/** Submit handler (Enter key) */
|
|
42
|
+
onSubmit: () => void;
|
|
43
|
+
/** Close handler (Escape key) */
|
|
44
|
+
onClose: () => void;
|
|
45
|
+
/** History previous handler (Up arrow) */
|
|
46
|
+
onHistoryPrevious: () => void;
|
|
47
|
+
/** History next handler (Down arrow) */
|
|
48
|
+
onHistoryNext: () => void;
|
|
49
|
+
/** Current mode */
|
|
50
|
+
mode: AgentCommandPaletteMode;
|
|
51
|
+
/** Current status */
|
|
52
|
+
status: AgentCommandPaletteStatus;
|
|
53
|
+
/** Placeholder text */
|
|
54
|
+
placeholder?: string;
|
|
55
|
+
/** Whether the input is disabled */
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
/** Auto-focus on mount */
|
|
58
|
+
autoFocus?: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* AgentCommandPalette - AI-driven command palette component
|
|
63
|
+
*
|
|
64
|
+
* Displays at the bottom of the screen with an input field.
|
|
65
|
+
* Users can type natural language requests or quick commands (prefixed with /).
|
|
66
|
+
*/
|
|
67
|
+
export declare const AgentCommandPalette: default_2.FC<AgentCommandPaletteProps>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Configuration for the Agent Command Palette
|
|
71
|
+
*/
|
|
72
|
+
export declare interface AgentCommandPaletteConfig {
|
|
73
|
+
/** Keyboard shortcut configuration */
|
|
74
|
+
keyboard?: AgentCommandPaletteKeyboardConfig;
|
|
75
|
+
/** Placeholder text for the input */
|
|
76
|
+
placeholder?: string;
|
|
77
|
+
/** Auto-close delay after completion (ms, 0 to disable) */
|
|
78
|
+
autoCloseDelay?: number;
|
|
79
|
+
/** Maximum history entries to keep */
|
|
80
|
+
maxHistoryEntries?: number;
|
|
81
|
+
/** Custom CSS class */
|
|
82
|
+
className?: string;
|
|
83
|
+
/** Custom inline styles */
|
|
84
|
+
style?: React.CSSProperties;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Keyboard configuration for opening the palette
|
|
89
|
+
*/
|
|
90
|
+
export declare interface AgentCommandPaletteKeyboardConfig {
|
|
91
|
+
/** Key to trigger the command palette (default: 'p') */
|
|
92
|
+
key?: string;
|
|
93
|
+
/** Require Alt key (default: true) */
|
|
94
|
+
altKey?: boolean;
|
|
95
|
+
/** Require Ctrl key (default: false) */
|
|
96
|
+
ctrlKey?: boolean;
|
|
97
|
+
/** Require Meta/Cmd key (default: false) */
|
|
98
|
+
metaKey?: boolean;
|
|
99
|
+
/** Require Shift key (default: false) */
|
|
100
|
+
shiftKey?: boolean;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Input mode for the command palette
|
|
105
|
+
*/
|
|
106
|
+
export declare type AgentCommandPaletteMode = 'natural' | 'quick-command';
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Props for AgentCommandPalette component
|
|
110
|
+
*/
|
|
111
|
+
export declare interface AgentCommandPaletteProps {
|
|
112
|
+
/** Hook return value */
|
|
113
|
+
palette: UseAgentCommandPaletteReturn;
|
|
114
|
+
/** Configuration options */
|
|
115
|
+
config?: AgentCommandPaletteConfig;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* State for the Agent Command Palette
|
|
120
|
+
*/
|
|
121
|
+
export declare interface AgentCommandPaletteState {
|
|
122
|
+
/** Whether the palette is open */
|
|
123
|
+
isOpen: boolean;
|
|
124
|
+
/** Current input value */
|
|
125
|
+
query: string;
|
|
126
|
+
/** Input mode (natural language or quick command) */
|
|
127
|
+
mode: AgentCommandPaletteMode;
|
|
128
|
+
/** Current execution status */
|
|
129
|
+
status: AgentCommandPaletteStatus;
|
|
130
|
+
/** Tools currently being executed */
|
|
131
|
+
pendingTools: ToolExecution[];
|
|
132
|
+
/** Tools that have completed execution */
|
|
133
|
+
completedTools: ToolExecution[];
|
|
134
|
+
/** Text response from the agent */
|
|
135
|
+
agentResponse: string;
|
|
136
|
+
/** Command history */
|
|
137
|
+
history: CommandHistoryEntry[];
|
|
138
|
+
/** Current index in history navigation */
|
|
139
|
+
historyIndex: number;
|
|
140
|
+
/** Suggested commands */
|
|
141
|
+
suggestions: string[];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Agent command palette execution status
|
|
146
|
+
*/
|
|
147
|
+
export declare type AgentCommandPaletteStatus = 'idle' | 'thinking' | 'executing' | 'complete' | 'error';
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* AgentResponseDisplay - Shows the agent's text response
|
|
151
|
+
*/
|
|
152
|
+
export declare const AgentResponseDisplay: default_2.FC<AgentResponseDisplayProps>;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Props for AgentResponseDisplay component
|
|
156
|
+
*/
|
|
157
|
+
export declare interface AgentResponseDisplayProps {
|
|
158
|
+
/** Response text to display */
|
|
159
|
+
response: string;
|
|
160
|
+
/** Whether the response is still streaming */
|
|
161
|
+
streaming?: boolean;
|
|
162
|
+
}
|
|
163
|
+
|
|
27
164
|
/**
|
|
28
165
|
* Anthropic tool definition format
|
|
29
166
|
*/
|
|
@@ -105,6 +242,20 @@ export declare interface CommandContext {
|
|
|
105
242
|
closeCommandPalette: () => void;
|
|
106
243
|
}
|
|
107
244
|
|
|
245
|
+
/**
|
|
246
|
+
* Entry in the command history
|
|
247
|
+
*/
|
|
248
|
+
export declare interface CommandHistoryEntry {
|
|
249
|
+
/** The query that was submitted */
|
|
250
|
+
query: string;
|
|
251
|
+
/** When the command was executed */
|
|
252
|
+
timestamp: number;
|
|
253
|
+
/** Tools that were executed */
|
|
254
|
+
toolsExecuted: string[];
|
|
255
|
+
/** Whether the command succeeded */
|
|
256
|
+
success: boolean;
|
|
257
|
+
}
|
|
258
|
+
|
|
108
259
|
/**
|
|
109
260
|
* CommandInput - Input field for the command palette
|
|
110
261
|
* Auto-focuses on mount and handles input changes
|
|
@@ -390,11 +541,32 @@ export declare function getGlobalCommandRegistry(): CommandRegistryService;
|
|
|
390
541
|
*/
|
|
391
542
|
export declare function getPanelCommands(): Command[];
|
|
392
543
|
|
|
544
|
+
/**
|
|
545
|
+
* Tool: Get Panel State
|
|
546
|
+
*
|
|
547
|
+
* Query the current state of a specific panel.
|
|
548
|
+
* Panels must implement a getState function to support this.
|
|
549
|
+
*/
|
|
550
|
+
export declare const getPanelStateTool: PanelTool;
|
|
551
|
+
|
|
393
552
|
/**
|
|
394
553
|
* Utility to extract parameter information for UI rendering.
|
|
395
554
|
*/
|
|
396
555
|
export declare function getToolParameterInfo(tool: RegisteredTool): ToolParameterInfo[];
|
|
397
556
|
|
|
557
|
+
/**
|
|
558
|
+
* Tool: Get Visible Panels
|
|
559
|
+
*
|
|
560
|
+
* Query which panels are currently visible and their state.
|
|
561
|
+
* Returns layout slot info including collapsed state and active panel IDs.
|
|
562
|
+
*/
|
|
563
|
+
export declare const getVisiblePanelsTool: PanelTool;
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Layout action tools only (for selective registration).
|
|
567
|
+
*/
|
|
568
|
+
export declare const layoutActionTools: PanelTool[];
|
|
569
|
+
|
|
398
570
|
/**
|
|
399
571
|
* All layout tools exported as an array.
|
|
400
572
|
*
|
|
@@ -428,6 +600,13 @@ export declare const layoutToolsMetadata: {
|
|
|
428
600
|
tools: PanelTool[];
|
|
429
601
|
};
|
|
430
602
|
|
|
603
|
+
/**
|
|
604
|
+
* Tool: List Panels With State
|
|
605
|
+
*
|
|
606
|
+
* Get a list of all panels that support state queries.
|
|
607
|
+
*/
|
|
608
|
+
export declare const listPanelsWithStateTool: PanelTool;
|
|
609
|
+
|
|
431
610
|
/**
|
|
432
611
|
* Default localStorage-based persistence adapter for web applications
|
|
433
612
|
*/
|
|
@@ -774,6 +953,11 @@ export { ResponsiveConfigurablePanelLayout }
|
|
|
774
953
|
|
|
775
954
|
export { ResponsiveConfigurablePanelLayoutProps }
|
|
776
955
|
|
|
956
|
+
/**
|
|
957
|
+
* State query tools only (for selective registration).
|
|
958
|
+
*/
|
|
959
|
+
export declare const stateQueryTools: PanelTool[];
|
|
960
|
+
|
|
777
961
|
/**
|
|
778
962
|
* Tool: Switch Panel
|
|
779
963
|
*
|
|
@@ -821,6 +1005,44 @@ export declare interface ToolCommandBridgeConfig {
|
|
|
821
1005
|
includePanelInCategory?: boolean;
|
|
822
1006
|
}
|
|
823
1007
|
|
|
1008
|
+
/**
|
|
1009
|
+
* Represents a single tool execution
|
|
1010
|
+
*/
|
|
1011
|
+
export declare interface ToolExecution {
|
|
1012
|
+
/** Unique identifier for this execution */
|
|
1013
|
+
id: string;
|
|
1014
|
+
/** Tool name being executed */
|
|
1015
|
+
name: string;
|
|
1016
|
+
/** Arguments passed to the tool */
|
|
1017
|
+
args: Record<string, unknown>;
|
|
1018
|
+
/** Current execution status */
|
|
1019
|
+
status: ToolExecutionStatus;
|
|
1020
|
+
/** Result from successful execution */
|
|
1021
|
+
result?: string;
|
|
1022
|
+
/** Error message if execution failed */
|
|
1023
|
+
error?: string;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* ToolExecutionList - Displays the list of tools being executed
|
|
1028
|
+
*/
|
|
1029
|
+
export declare const ToolExecutionList: default_2.FC<ToolExecutionListProps>;
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* Props for ToolExecutionList component
|
|
1033
|
+
*/
|
|
1034
|
+
export declare interface ToolExecutionListProps {
|
|
1035
|
+
/** Tools to display */
|
|
1036
|
+
tools: ToolExecution[];
|
|
1037
|
+
/** Compact single-line mode */
|
|
1038
|
+
compact?: boolean;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* Tool execution status
|
|
1043
|
+
*/
|
|
1044
|
+
export declare type ToolExecutionStatus = 'pending' | 'running' | 'success' | 'error';
|
|
1045
|
+
|
|
824
1046
|
/**
|
|
825
1047
|
* Parameter information for UI rendering
|
|
826
1048
|
*/
|
|
@@ -928,6 +1150,70 @@ export declare interface UpdateWorkspaceOptions {
|
|
|
928
1150
|
};
|
|
929
1151
|
}
|
|
930
1152
|
|
|
1153
|
+
/**
|
|
1154
|
+
* Hook for managing Agent Command Palette state and behavior
|
|
1155
|
+
* Handles input, history navigation, tool execution tracking, and keyboard shortcuts
|
|
1156
|
+
*/
|
|
1157
|
+
export declare function useAgentCommandPalette({ events, keyboard, config, onExecuteTool, initialSuggestions, }?: UseAgentCommandPaletteOptions): UseAgentCommandPaletteReturn;
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* Options for the useAgentCommandPalette hook
|
|
1161
|
+
*/
|
|
1162
|
+
export declare interface UseAgentCommandPaletteOptions {
|
|
1163
|
+
/** Event emitter for panel events */
|
|
1164
|
+
events?: PanelEventEmitter;
|
|
1165
|
+
/** Keyboard configuration */
|
|
1166
|
+
keyboard?: AgentCommandPaletteKeyboardConfig;
|
|
1167
|
+
/** Configuration options */
|
|
1168
|
+
config?: AgentCommandPaletteConfig;
|
|
1169
|
+
/** Callback when a tool should be executed */
|
|
1170
|
+
onExecuteTool?: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
1171
|
+
/** Initial suggestions to show */
|
|
1172
|
+
initialSuggestions?: string[];
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* Return type for useAgentCommandPalette hook
|
|
1177
|
+
*/
|
|
1178
|
+
export declare interface UseAgentCommandPaletteReturn {
|
|
1179
|
+
/** Whether the palette is open */
|
|
1180
|
+
isOpen: boolean;
|
|
1181
|
+
/** Open the palette */
|
|
1182
|
+
open: () => void;
|
|
1183
|
+
/** Close the palette */
|
|
1184
|
+
close: () => void;
|
|
1185
|
+
/** Toggle the palette */
|
|
1186
|
+
toggle: () => void;
|
|
1187
|
+
/** Current query value */
|
|
1188
|
+
query: string;
|
|
1189
|
+
/** Set the query value */
|
|
1190
|
+
setQuery: (query: string) => void;
|
|
1191
|
+
/** Current input mode */
|
|
1192
|
+
mode: AgentCommandPaletteMode;
|
|
1193
|
+
/** Current execution status */
|
|
1194
|
+
status: AgentCommandPaletteStatus;
|
|
1195
|
+
/** Tools being executed */
|
|
1196
|
+
pendingTools: ToolExecution[];
|
|
1197
|
+
/** Completed tools */
|
|
1198
|
+
completedTools: ToolExecution[];
|
|
1199
|
+
/** Agent's text response */
|
|
1200
|
+
agentResponse: string;
|
|
1201
|
+
/** Submit the current query for execution */
|
|
1202
|
+
submit: () => void;
|
|
1203
|
+
/** Execute a quick command directly */
|
|
1204
|
+
executeQuickCommand: (command: string) => void;
|
|
1205
|
+
/** Command history */
|
|
1206
|
+
history: CommandHistoryEntry[];
|
|
1207
|
+
/** Navigate to previous history entry */
|
|
1208
|
+
historyPrevious: () => void;
|
|
1209
|
+
/** Navigate to next history entry */
|
|
1210
|
+
historyNext: () => void;
|
|
1211
|
+
/** Suggested commands */
|
|
1212
|
+
suggestions: string[];
|
|
1213
|
+
/** Clear the current state (query, tools, response) */
|
|
1214
|
+
clear: () => void;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
931
1217
|
/**
|
|
932
1218
|
* Hook for managing command palette state and behavior
|
|
933
1219
|
* Handles command registration, filtering, keyboard navigation, and execution
|