Feature/v2/automate (#4248)

* automate feature
* Moved all providers to app level to simplify homepage 
* Circular dependency fixes
* You will see that now toolRegistry gets a tool config and a tool
settings object. These enable automate to run the tools using as much
static code as possible.

---------

Co-authored-by: Connor Yoh <[email protected]>
This commit is contained in:
ConnorYoh
2025-08-22 14:40:27 +01:00
committed by GitHub
co-authored by Connor Yoh
parent 7d9c0b0298
commit 23d86deae7
84 changed files with 4784 additions and 572 deletions
+5 -18
View File
@@ -3,12 +3,7 @@
* Provides clean URL routing for the V2 tool system
*/
import { ModeType } from '../contexts/NavigationContext';
export interface ToolRoute {
mode: ModeType;
toolKey?: string;
}
import { ModeType, isValidMode as isValidModeType, getDefaultMode, ToolRoute } from '../types/navigation';
/**
* Parse the current URL to extract tool routing information
@@ -45,7 +40,7 @@ export function parseToolRoute(): ToolRoute {
// Check for query parameter fallback (e.g., ?tool=split)
const toolParam = searchParams.get('tool');
if (toolParam && isValidMode(toolParam)) {
if (toolParam && isValidModeType(toolParam)) {
return {
mode: toolParam as ModeType,
toolKey: toolParam
@@ -54,7 +49,8 @@ export function parseToolRoute(): ToolRoute {
// Default to page editor for home page
return {
mode: 'pageEditor'
mode: getDefaultMode(),
toolKey: null
};
}
@@ -137,16 +133,7 @@ export function getToolDisplayName(toolKey: string): string {
return displayNames[toolKey] || toolKey;
}
/**
* Check if a mode is valid
*/
function isValidMode(mode: string): mode is ModeType {
const validModes: ModeType[] = [
'viewer', 'pageEditor', 'fileEditor', 'merge', 'split',
'compress', 'ocr', 'convert', 'addPassword', 'changePermissions', 'sanitize'
];
return validModes.includes(mode as ModeType);
}
// Note: isValidMode is now imported from types/navigation.ts
/**
* Generate shareable URL for current tool state