Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/desktop/src/components/GooseResponseForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default function GooseResponseForm({
return null;
}

function isForm(f: DynamicForm) {
function isForm(f: DynamicForm | null): f is DynamicForm {
return (
f && f.title && f.description && f.fields && Array.isArray(f.fields) && f.fields.length > 0
);
Expand Down
6 changes: 3 additions & 3 deletions ui/desktop/src/components/GoosehintsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ type GoosehintsModalProps = {

export const GoosehintsModal = ({ directory, setIsGoosehintsModalOpen }: GoosehintsModalProps) => {
const goosehintsFilePath = `${directory}/.goosehints`;
const [goosehintsFile, setGoosehintsFile] = useState<string>(null);
const [goosehintsFile, setGoosehintsFile] = useState<string>('');
const [goosehintsFileFound, setGoosehintsFileFound] = useState<boolean>(false);
const [goosehintsFileReadError, setGoosehintsFileReadError] = useState<string>(null);
const [goosehintsFileReadError, setGoosehintsFileReadError] = useState<string>('');

useEffect(() => {
const fetchGoosehintsFile = async () => {
try {
const { file, error, found } = await getGoosehintsFile(goosehintsFilePath);
setGoosehintsFile(file);
setGoosehintsFileFound(found);
setGoosehintsFileReadError(error);
setGoosehintsFileReadError(error || '');
} catch (error) {
console.error('Error fetching .goosehints file:', error);
}
Expand Down
2 changes: 1 addition & 1 deletion ui/desktop/src/components/ProviderGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function ProviderGrid({ onSubmit }: ProviderGridProps) {
const handleConfigure = async (provider: { id: string; name: string; isConfigured: boolean; description: string }) => {
const providerId = provider.id.toLowerCase();

const modelName = getDefaultModel(providerId);
const modelName = getDefaultModel(providerId) || 'default-model';
const model = createSelectedModel(providerId, modelName);

await initializeSystem(providerId, model.name);
Expand Down
12 changes: 10 additions & 2 deletions ui/desktop/src/components/more_menu/MoreMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import { FolderOpen, Moon, Sliders, Sun } from 'lucide-react';
import { useConfig } from '../ConfigContext';
import { ViewOptions, View } from '../../App';

interface RecipeConfig {
id: string;
title: string;
description: string;
instructions: string;
activities: string[];
}

interface MenuButtonProps {
onClick: () => void;
children: React.ReactNode;
Expand Down Expand Up @@ -187,7 +195,7 @@ export default function MoreMenu({
setOpen(false);
window.electron.createChatWindow(
undefined,
window.appConfig.get('GOOSE_WORKING_DIR')
window.appConfig.get('GOOSE_WORKING_DIR') as string | undefined
);
}}
subtitle="Start a new session in the current directory"
Expand Down Expand Up @@ -244,7 +252,7 @@ export default function MoreMenu({
undefined, // dir
undefined, // version
undefined, // resumeSessionId
recipeConfig, // recipe config
recipeConfig as RecipeConfig | undefined, // recipe config
'recipeEditor' // view type
);
}}
Expand Down
7 changes: 6 additions & 1 deletion ui/desktop/src/components/settings/models/AddModelInline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export function AddModelInline() {
model.provider.toLowerCase() === selectedProvider &&
model.name.toLowerCase().includes(modelName.toLowerCase())
)
.slice(0, 5); // Limit suggestions to top 5
.slice(0, 5) // Limit suggestions to top 5
.map(model => ({
id: String(model.id || ''),
name: model.name,
provider: model.provider
}));
setFilteredModels(filtered);
setShowSuggestions(filtered.length > 0);
}, [modelName, selectedProvider]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Input } from '../../ui/input';
import { Check, Lock } from 'lucide-react';

export default function SessionSharingSection() {
const envBaseUrlShare = window.appConfig.get('GOOSE_BASE_URL_SHARE');
const envBaseUrlShare = window.appConfig.get('GOOSE_BASE_URL_SHARE') as string | undefined;
console.log('envBaseUrlShare', envBaseUrlShare);

// If env is set, force sharing enabled and set the baseUrl accordingly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function handleErrorResponse(
response: Response,
extensionName: string,
action: { type: string; verb: string },
toastId: string
toastId: string | number | undefined
): never {
const errorMsg = `Server returned ${response.status}: ${response.statusText}`;
console.error(errorMsg);
Expand Down
4 changes: 2 additions & 2 deletions ui/desktop/src/components/settings_v2/extensions/deeplink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ export async function addExtensionFromDeepLink(
const remoteUrl = parsedUrl.searchParams.get('url');

const config = remoteUrl
? getSseConfig(remoteUrl, name, description, timeout)
: getStdioConfig(cmd!, parsedUrl, name, description, timeout);
? getSseConfig(remoteUrl, name, description || '', timeout)
: getStdioConfig(cmd!, parsedUrl, name, description || '', timeout);

// Check if extension requires env vars and go to settings if so
if (config.envs && Object.keys(config.envs).length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion ui/desktop/src/components/settings_v2/extensions/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function createExtensionConfig(formData: ExtensionFormData): ExtensionCon

if (formData.type === 'stdio') {
// we put the cmd + args all in the form cmd field but need to split out into cmd + args
const { cmd, args } = splitCmdAndArgs(formData.cmd);
const { cmd, args } = splitCmdAndArgs(formData.cmd || '');

return {
type: 'stdio',
Expand Down