Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": {
"name": "Apache-2.0"
},
"version": "1.0.30"
"version": "1.0.31"
},
"paths": {
"/agent/tools": {
Expand Down
3 changes: 2 additions & 1 deletion ui/desktop/src/components/RecipeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ interface RecipeEditorProps {
// Function to generate a deep link from a recipe
function generateDeepLink(recipe: Recipe): string {
const configBase64 = Buffer.from(JSON.stringify(recipe)).toString('base64');
return `goose://recipe?config=${configBase64}`;
const urlSafe = encodeURIComponent(configBase64);
return `goose://recipe?config=${urlSafe}`;
}

export default function RecipeEditor({ config }: RecipeEditorProps) {
Expand Down
2 changes: 1 addition & 1 deletion ui/desktop/src/components/schedule/CreateScheduleModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function parseDeepLink(deepLink: string): Recipe | null {
return null;
}

const configJson = Buffer.from(configParam, 'base64').toString('utf-8');
const configJson = Buffer.from(decodeURIComponent(configParam), 'base64').toString('utf-8');
return JSON.parse(configJson) as Recipe;
} catch (error) {
console.error('Failed to parse deep link:', error);
Expand Down
3 changes: 2 additions & 1 deletion ui/desktop/src/components/ui/DeepLinkModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ interface DeepLinkModalProps {
// Function to generate a deep link from a bot config
export function generateDeepLink(recipeConfig: RecipeConfig): string {
const configBase64 = Buffer.from(JSON.stringify(recipeConfig)).toString('base64');
return `goose://bot?config=${configBase64}`;
const urlSafe = encodeURIComponent(configBase64);
return `goose://bot?config=${urlSafe}`;
}

export function DeepLinkModal({ recipeConfig: initialRecipeConfig, onClose }: DeepLinkModalProps) {
Expand Down
8 changes: 6 additions & 2 deletions ui/desktop/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ if (process.platform === 'win32') {
const configParam = parsedUrl.searchParams.get('config');
if (configParam) {
try {
recipeConfig = JSON.parse(Buffer.from(configParam, 'base64').toString('utf-8'));
recipeConfig = JSON.parse(
Buffer.from(decodeURIComponent(configParam), 'base64').toString('utf-8')
);

// Check if this is a scheduled job
const scheduledJobId = parsedUrl.searchParams.get('scheduledJob');
Expand Down Expand Up @@ -260,7 +262,9 @@ function processProtocolUrl(parsedUrl: URL, window: BrowserWindow) {
const configParam = parsedUrl.searchParams.get('config');
if (configParam) {
try {
recipeConfig = JSON.parse(Buffer.from(configParam, 'base64').toString('utf-8'));
recipeConfig = JSON.parse(
Buffer.from(decodeURIComponent(configParam), 'base64').toString('utf-8')
);

// Check if this is a scheduled job
const scheduledJobId = parsedUrl.searchParams.get('scheduledJob');
Expand Down
Loading