chore: load default built-in extensions from a json file instead of ts (#1470)

This commit is contained in:
Alex Hancock
2025-03-03 12:57:46 -05:00
committed by GitHub
parent 9ae9045584
commit 4f4c8c9f70
3 changed files with 55 additions and 61 deletions

View File

@@ -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": []
}
]

View File

@@ -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, '');

4
ui/desktop/src/json.d.ts vendored Normal file
View File

@@ -0,0 +1,4 @@
declare module '*.json' {
const value: any;
export default value;
}