diff --git a/ui/desktop/src/built-in-extensions.json b/ui/desktop/src/built-in-extensions.json new file mode 100644 index 00000000..ee620bf2 --- /dev/null +++ b/ui/desktop/src/built-in-extensions.json @@ -0,0 +1,46 @@ +[ + { + "id": "developer", + "name": "Developer", + "description": "General development tools useful for software engineering.", + "enabled": true, + "type": "builtin", + "env_keys": [], + "timeout": 300 + }, + { + "id": "computercontroller", + "name": "Computer Controller", + "description": "General computer control tools that don't require you to be a developer or engineer.", + "enabled": false, + "type": "builtin", + "env_keys": [], + "timeout": 300 + }, + { + "id": "memory", + "name": "Memory", + "description": "Teach goose your preferences as you go.", + "enabled": false, + "type": "builtin", + "env_keys": [], + "timeout": 300 + }, + { + "id": "jetbrains", + "name": "Jetbrains", + "description": "Integration with any Jetbrains IDE", + "enabled": false, + "type": "builtin", + "env_keys": [], + "timeout": 300 + }, + { + "id": "tutorial", + "name": "Tutorial", + "description": "Access interactive tutorials and guides", + "enabled": false, + "type": "builtin", + "env_keys": [] + } +] diff --git a/ui/desktop/src/extensions.ts b/ui/desktop/src/extensions.ts index eb5e04d0..5a564f72 100644 --- a/ui/desktop/src/extensions.ts +++ b/ui/desktop/src/extensions.ts @@ -3,7 +3,10 @@ import { type View } from './App'; import { type SettingsViewOptions } from './components/settings/SettingsView'; import { toast } from 'react-toastify'; -export const DEFAULT_EXTENSION_TIMEOUT: number = 300; +import builtInExtensionsData from './built-in-extensions.json'; + +// Hardcoded default extension timeout in seconds +export const DEFAULT_EXTENSION_TIMEOUT = 300; // ExtensionConfig type matching the Rust version // TODO: refactor this @@ -47,66 +50,7 @@ export interface ExtensionPayload { timeout?: number; } -export const BUILT_IN_EXTENSIONS = [ - { - id: 'developer', - name: 'Developer', - description: 'General development tools useful for software engineering.', - enabled: true, - type: 'builtin', - env_keys: [], - timeout: DEFAULT_EXTENSION_TIMEOUT, - }, - { - id: 'computercontroller', - name: 'Computer Controller', - description: - "General computer control tools that don't require you to be a developer or engineer.", - enabled: false, - type: 'builtin', - env_keys: [], - timeout: DEFAULT_EXTENSION_TIMEOUT, - }, - { - id: 'memory', - name: 'Memory', - description: 'Teach goose your preferences as you go.', - enabled: false, - type: 'builtin', - env_keys: [], - timeout: DEFAULT_EXTENSION_TIMEOUT, - }, - { - id: 'jetbrains', - name: 'Jetbrains', - description: 'Integration with any Jetbrains IDE', - enabled: false, - type: 'builtin', - env_keys: [], - timeout: DEFAULT_EXTENSION_TIMEOUT, - }, - { - id: 'tutorial', - name: 'Tutorial', - description: 'Access interactive tutorials and guides', - enabled: false, - type: 'builtin', - env_keys: [], - }, - /* TODO re-enable when we have a smoother auth flow { - id: 'google_drive', - name: 'Google Drive', - description: 'Built-in Google Drive integration for file management and access', - enabled: false, - type: 'builtin', - env_keys: [ - 'GOOGLE_DRIVE_OAUTH_PATH', - 'GOOGLE_DRIVE_CREDENTIALS_PATH', - 'GOOGLE_DRIVE_OAUTH_CONFIG', - ], - timeout: DEFAULT_EXTENSION_TIMEOUT, - },*/ -]; +export const BUILT_IN_EXTENSIONS = builtInExtensionsData as FullExtensionConfig[]; function sanitizeName(name: string) { return name.toLowerCase().replace(/-/g, '').replace(/_/g, '').replace(/\s/g, ''); diff --git a/ui/desktop/src/json.d.ts b/ui/desktop/src/json.d.ts new file mode 100644 index 00000000..bbab69d2 --- /dev/null +++ b/ui/desktop/src/json.d.ts @@ -0,0 +1,4 @@ +declare module '*.json' { + const value: any; + export default value; +}