@principal-ade/panel-layouts 0.2.2 → 0.2.3
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 +243 -0
- package/dist/index.esm.js +889 -558
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { AIFunctionDefinition } from '@principal-ade/panel-framework-core';
|
|
1
2
|
import { default as default_2 } from 'react';
|
|
2
3
|
import { EditableConfigurablePanelLayout } from '@principal-ade/panels';
|
|
3
4
|
import { EditableConfigurablePanelLayoutProps } from '@principal-ade/panels';
|
|
5
|
+
import { JsonSchema } from '@principal-ade/panel-framework-core';
|
|
4
6
|
import { mapThemeToPanelVars } from '@principal-ade/panels';
|
|
5
7
|
import { mapThemeToTabVars } from '@principal-ade/panels';
|
|
6
8
|
import { PanelActions } from '@principal-ade/panel-framework-core';
|
|
@@ -13,17 +15,36 @@ import { PanelFocusEventPayload } from '@principal-ade/panel-framework-core';
|
|
|
13
15
|
import { PanelGroup } from '@principal-ade/panels';
|
|
14
16
|
import { PanelLayout } from '@principal-ade/panels';
|
|
15
17
|
import { PanelSlot } from '@principal-ade/panels';
|
|
18
|
+
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';
|
|
16
21
|
import { ResponsiveConfigurablePanelLayout } from '@principal-ade/panels';
|
|
17
22
|
import { ResponsiveConfigurablePanelLayoutProps } from '@principal-ade/panels';
|
|
18
23
|
import { TabsConfig } from '@principal-ade/panels';
|
|
19
24
|
import { Theme } from '@principal-ade/panels';
|
|
20
25
|
import { TilesConfig } from '@principal-ade/panels';
|
|
21
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Anthropic tool definition format
|
|
29
|
+
*/
|
|
30
|
+
export declare interface AnthropicTool {
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
input_schema: JsonSchema;
|
|
34
|
+
}
|
|
35
|
+
|
|
22
36
|
/**
|
|
23
37
|
* Built-in workspace IDs
|
|
24
38
|
*/
|
|
25
39
|
export declare type BuiltInWorkspaceId = 'project-management' | 'code-review' | 'documentation' | 'agent-work' | 'quality-check' | 'drawing' | 'old-school' | 'principal-office';
|
|
26
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Tool: Collapse All Panels
|
|
43
|
+
*
|
|
44
|
+
* Collapse both left and right panels to maximize the main content area.
|
|
45
|
+
*/
|
|
46
|
+
export declare const collapseAllPanelsTool: PanelTool;
|
|
47
|
+
|
|
27
48
|
/**
|
|
28
49
|
* Command definition for the command palette
|
|
29
50
|
*/
|
|
@@ -259,6 +280,12 @@ export declare class CommandRegistryService {
|
|
|
259
280
|
private notifyListeners;
|
|
260
281
|
}
|
|
261
282
|
|
|
283
|
+
/**
|
|
284
|
+
* Creates a hook-like function that returns commands from a registry.
|
|
285
|
+
* Useful for dynamic command registration.
|
|
286
|
+
*/
|
|
287
|
+
export declare function createToolCommandsProvider(registry: PanelToolRegistry, config?: ToolCommandBridgeConfig): () => Command[];
|
|
288
|
+
|
|
262
289
|
/**
|
|
263
290
|
* Options for creating a new workspace
|
|
264
291
|
*/
|
|
@@ -281,6 +308,13 @@ export { EditableConfigurablePanelLayout }
|
|
|
281
308
|
|
|
282
309
|
export { EditableConfigurablePanelLayoutProps }
|
|
283
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Tool: Expand All Panels
|
|
313
|
+
*
|
|
314
|
+
* Expand both left and right panels to show all content.
|
|
315
|
+
*/
|
|
316
|
+
export declare const expandAllPanelsTool: PanelTool;
|
|
317
|
+
|
|
284
318
|
/**
|
|
285
319
|
* Visual indicator that highlights the focused panel
|
|
286
320
|
*
|
|
@@ -297,6 +331,53 @@ export declare interface FocusIndicatorProps {
|
|
|
297
331
|
style?: default_2.CSSProperties;
|
|
298
332
|
}
|
|
299
333
|
|
|
334
|
+
/**
|
|
335
|
+
* Tool: Focus Panel
|
|
336
|
+
*
|
|
337
|
+
* Set keyboard/logical focus to a specific panel slot.
|
|
338
|
+
*/
|
|
339
|
+
export declare const focusPanelTool: PanelTool;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Gemini function declaration format
|
|
343
|
+
*/
|
|
344
|
+
export declare interface GeminiFunctionDeclaration {
|
|
345
|
+
name: string;
|
|
346
|
+
description: string;
|
|
347
|
+
parameters: {
|
|
348
|
+
type: string;
|
|
349
|
+
properties: Record<string, GeminiPropertySchema>;
|
|
350
|
+
required: string[];
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Gemini property schema (simplified)
|
|
356
|
+
*/
|
|
357
|
+
export declare interface GeminiPropertySchema {
|
|
358
|
+
type: string;
|
|
359
|
+
description?: string;
|
|
360
|
+
enum?: string[];
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Gemini tools wrapper
|
|
365
|
+
*/
|
|
366
|
+
export declare interface GeminiTools {
|
|
367
|
+
functionDeclarations: GeminiFunctionDeclaration[];
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Generate a system prompt section describing available tools.
|
|
372
|
+
*
|
|
373
|
+
* @param tools - Array of tools to describe
|
|
374
|
+
* @param options - Formatting options
|
|
375
|
+
*/
|
|
376
|
+
export declare function generateToolsSystemPrompt(tools: PanelTool[], options?: {
|
|
377
|
+
header?: string;
|
|
378
|
+
includeParameters?: boolean;
|
|
379
|
+
}): string;
|
|
380
|
+
|
|
300
381
|
/**
|
|
301
382
|
* Get the global command registry instance
|
|
302
383
|
* @returns Global CommandRegistryService instance
|
|
@@ -309,6 +390,44 @@ export declare function getGlobalCommandRegistry(): CommandRegistryService;
|
|
|
309
390
|
*/
|
|
310
391
|
export declare function getPanelCommands(): Command[];
|
|
311
392
|
|
|
393
|
+
/**
|
|
394
|
+
* Utility to extract parameter information for UI rendering.
|
|
395
|
+
*/
|
|
396
|
+
export declare function getToolParameterInfo(tool: RegisteredTool): ToolParameterInfo[];
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* All layout tools exported as an array.
|
|
400
|
+
*
|
|
401
|
+
* Register these with PanelToolRegistry:
|
|
402
|
+
* ```typescript
|
|
403
|
+
* import { layoutTools } from '@principal-ade/panel-layouts';
|
|
404
|
+
* import { getGlobalToolRegistry } from '@principal-ade/panel-framework-core';
|
|
405
|
+
*
|
|
406
|
+
* const registry = getGlobalToolRegistry();
|
|
407
|
+
* registry.registerPanelTools({
|
|
408
|
+
* id: 'panel-layouts',
|
|
409
|
+
* name: 'Panel Layouts',
|
|
410
|
+
* tools: layoutTools,
|
|
411
|
+
* });
|
|
412
|
+
* ```
|
|
413
|
+
*/
|
|
414
|
+
export declare const layoutTools: PanelTool[];
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Layout tools metadata for registration.
|
|
418
|
+
*
|
|
419
|
+
* Use this with PanelToolRegistry.registerPanelTools():
|
|
420
|
+
* ```typescript
|
|
421
|
+
* registry.registerPanelTools(layoutToolsMetadata);
|
|
422
|
+
* ```
|
|
423
|
+
*/
|
|
424
|
+
export declare const layoutToolsMetadata: {
|
|
425
|
+
id: string;
|
|
426
|
+
name: string;
|
|
427
|
+
description: string;
|
|
428
|
+
tools: PanelTool[];
|
|
429
|
+
};
|
|
430
|
+
|
|
312
431
|
/**
|
|
313
432
|
* Default localStorage-based persistence adapter for web applications
|
|
314
433
|
*/
|
|
@@ -349,6 +468,23 @@ export { mapThemeToPanelVars }
|
|
|
349
468
|
|
|
350
469
|
export { mapThemeToTabVars }
|
|
351
470
|
|
|
471
|
+
/**
|
|
472
|
+
* OpenAI function definition format
|
|
473
|
+
*/
|
|
474
|
+
export declare interface OpenAIFunction {
|
|
475
|
+
name: string;
|
|
476
|
+
description: string;
|
|
477
|
+
parameters: JsonSchema;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* OpenAI tool wrapper
|
|
482
|
+
*/
|
|
483
|
+
export declare interface OpenAITool {
|
|
484
|
+
type: 'function';
|
|
485
|
+
function: OpenAIFunction;
|
|
486
|
+
}
|
|
487
|
+
|
|
352
488
|
export { PanelBlurEventPayload }
|
|
353
489
|
|
|
354
490
|
/**
|
|
@@ -478,10 +614,25 @@ export declare interface RepositoryWorkspaceState {
|
|
|
478
614
|
*/
|
|
479
615
|
export declare function resetGlobalCommandRegistry(): void;
|
|
480
616
|
|
|
617
|
+
/**
|
|
618
|
+
* Tool: Reset Layout
|
|
619
|
+
*
|
|
620
|
+
* Reset panel sizes to the default layout.
|
|
621
|
+
*/
|
|
622
|
+
export declare const resetLayoutTool: PanelTool;
|
|
623
|
+
|
|
481
624
|
export { ResponsiveConfigurablePanelLayout }
|
|
482
625
|
|
|
483
626
|
export { ResponsiveConfigurablePanelLayoutProps }
|
|
484
627
|
|
|
628
|
+
/**
|
|
629
|
+
* Tool: Switch Panel
|
|
630
|
+
*
|
|
631
|
+
* Change which content is displayed in a panel slot.
|
|
632
|
+
* The available panels depend on the application.
|
|
633
|
+
*/
|
|
634
|
+
export declare const switchPanelTool: PanelTool;
|
|
635
|
+
|
|
485
636
|
export { TabsConfig }
|
|
486
637
|
|
|
487
638
|
export { Theme }
|
|
@@ -502,6 +653,92 @@ export declare interface ThreePanelPersistence {
|
|
|
502
653
|
|
|
503
654
|
export { TilesConfig }
|
|
504
655
|
|
|
656
|
+
/**
|
|
657
|
+
* Tool: Toggle Panel
|
|
658
|
+
*
|
|
659
|
+
* Collapse or expand a side panel (left or right).
|
|
660
|
+
*/
|
|
661
|
+
export declare const togglePanelTool: PanelTool;
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* Configuration for the tool-to-command bridge
|
|
665
|
+
*/
|
|
666
|
+
export declare interface ToolCommandBridgeConfig {
|
|
667
|
+
/** Category prefix for tool commands (default: 'Panel Tools') */
|
|
668
|
+
categoryPrefix?: string;
|
|
669
|
+
/** Priority offset for tool commands (default: 50) */
|
|
670
|
+
basePriority?: number;
|
|
671
|
+
/** Whether to include panel ID in category (default: true) */
|
|
672
|
+
includePanelInCategory?: boolean;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* Parameter information for UI rendering
|
|
677
|
+
*/
|
|
678
|
+
export declare interface ToolParameterInfo {
|
|
679
|
+
name: string;
|
|
680
|
+
type: string;
|
|
681
|
+
description: string;
|
|
682
|
+
required: boolean;
|
|
683
|
+
default?: unknown;
|
|
684
|
+
enum?: string[];
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Convert an array of PanelTools to AIFunctionDefinition format.
|
|
689
|
+
*/
|
|
690
|
+
export declare function toolsToAIFunctions(tools: PanelTool[]): AIFunctionDefinition[];
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Convert an array of PanelTools to Anthropic tools format.
|
|
694
|
+
*/
|
|
695
|
+
export declare function toolsToAnthropicFormat(tools: PanelTool[]): AnthropicTool[];
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Converts all tools from a registry into commands.
|
|
699
|
+
*/
|
|
700
|
+
export declare function toolsToCommands(registry: PanelToolRegistry, config?: ToolCommandBridgeConfig): Command[];
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Convert an array of PanelTools to Gemini tools format.
|
|
704
|
+
*/
|
|
705
|
+
export declare function toolsToGeminiFormat(tools: PanelTool[]): GeminiTools;
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Convert an array of PanelTools to OpenAI tools format.
|
|
709
|
+
*/
|
|
710
|
+
export declare function toolsToOpenAIFormat(tools: PanelTool[]): OpenAITool[];
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* Convert a PanelTool to the generic AIFunctionDefinition format.
|
|
714
|
+
* This is the format used by PanelToolRegistry.getToolsAsAIFunctions()
|
|
715
|
+
*/
|
|
716
|
+
export declare function toolToAIFunction(tool: PanelTool): AIFunctionDefinition;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Convert a PanelTool to Anthropic tool format.
|
|
720
|
+
*/
|
|
721
|
+
export declare function toolToAnthropicFormat(tool: PanelTool): AnthropicTool;
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Converts a registered tool into a command palette command.
|
|
725
|
+
*
|
|
726
|
+
* For tools with no required parameters, the command executes immediately.
|
|
727
|
+
* For tools with required parameters, this is a placeholder - full
|
|
728
|
+
* implementation would need a parameter input UI.
|
|
729
|
+
*/
|
|
730
|
+
export declare function toolToCommand(tool: RegisteredTool, registry: PanelToolRegistry, config?: ToolCommandBridgeConfig): Command;
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Convert a PanelTool to Gemini function declaration format.
|
|
734
|
+
*/
|
|
735
|
+
export declare function toolToGeminiFunction(tool: PanelTool): GeminiFunctionDeclaration;
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Convert a PanelTool to OpenAI function format.
|
|
739
|
+
*/
|
|
740
|
+
export declare function toolToOpenAIFunction(tool: PanelTool): OpenAITool;
|
|
741
|
+
|
|
505
742
|
/**
|
|
506
743
|
* Return type for the usePanelPersistence hook (two-panel variant)
|
|
507
744
|
*/
|
|
@@ -735,6 +972,12 @@ export declare interface UsePanelPersistenceOptions {
|
|
|
735
972
|
adapter?: PersistenceAdapter;
|
|
736
973
|
}
|
|
737
974
|
|
|
975
|
+
/**
|
|
976
|
+
* Hook to use tool commands in React components.
|
|
977
|
+
* Subscribes to registry changes and updates commands accordingly.
|
|
978
|
+
*/
|
|
979
|
+
export declare function useToolCommands(registry: PanelToolRegistry, config?: ToolCommandBridgeConfig): Command[];
|
|
980
|
+
|
|
738
981
|
export declare function useWorkspace(options?: UseWorkspaceOptions): UseWorkspaceReturn;
|
|
739
982
|
|
|
740
983
|
export declare interface UseWorkspaceOptions {
|