From bf89263c6a09e5a1f287eb5aa277a0e6b2c2e2d8 Mon Sep 17 00:00:00 2001 From: bclarkngc <154301465+bclarkngc@users.noreply.github.com> Date: Fri, 11 Jul 2025 20:59:11 +0000 Subject: [PATCH 1/2] [Removes] - placeholder for vibes button Run in AI IDE that copies prompt [Add] - Button to open project Goose. ( https://block.github.io/goose/ ) - event listener for modalGooseButton --- vibe/script.js | 62 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/vibe/script.js b/vibe/script.js index 17934c69e..7358b55e4 100644 --- a/vibe/script.js +++ b/vibe/script.js @@ -280,6 +280,39 @@ async function copyPrompt(button, encodedPrompt) { } } +// Open prompt in codename Goose +async function openInGoose(title, prompt, instructions, activities = undefined) { + // Only generate if we have the required fields + if (!title.trim() || !instructions.trim() || !instructions.trim()) { + return ''; + } + + try { + const recipeConfig = { + version: "1.0.0", + title, + description: "[prompt.ng] Vibe", + instructions, + prompt: prompt.trim() || undefined, + activities: activities.length > 0 ? activities : undefined + }; + + // Filter out undefined values + Object.keys(recipeConfig).forEach(key => { + if (recipeConfig[key] === undefined) { + delete recipeConfig[key]; + } + }); + + // Use window.btoa for browser compatibility + link = `goose://recipe?config=${window.btoa(JSON.stringify(recipeConfig))}`; + + window.open(link, "_blank"); + } catch (error) { + console.error('Error generating recipe output:', error); + } +} + // Open prompt in AI chat function openInChat(button, encodedPrompt) { const promptText = decodeURIComponent(encodedPrompt); @@ -356,13 +389,23 @@ function showModal(app, prompt, contributor) {
@@ -391,6 +434,15 @@ function showModal(app, prompt, contributor) { } }); }); + + // Add project Goose functionality + const modalGooseButton = modalOverlay.querySelectorAll('.modal-goose-button'); + modalGooseButton.forEach(button => { + button.addEventListener('click', () => { + instructions = "You are a vibe coding agent for " + contributor + "and are ready for their request"; + openInGoose(app, prompt, instructions, ["prompts.ng"]); + }); + }); } const modalTitle = modalOverlay.querySelector('.modal-title'); From dddd382b60daf2b5ab75d4e65100a35380cef454 Mon Sep 17 00:00:00 2001 From: bclarkngc <154301465+bclarkngc@users.noreply.github.com> Date: Fri, 11 Jul 2025 21:02:32 +0000 Subject: [PATCH 2/2] [Add] - modal-goose-chat css --- style.css | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/style.css b/style.css index db34d7fec..a1d4361b5 100644 --- a/style.css +++ b/style.css @@ -1269,6 +1269,29 @@ body.dark-mode { white-space: nowrap; } +.modal-goose-button { + display: flex; + align-items: center; + gap: 6px; + padding: 6px 12px; + border-radius: 6px; + font-size: 0.9rem; + background: var(--accent-color); + color: white; + border: none; + cursor: pointer; + transition: all 0.2s ease; +} + +.modal-goose-button:hover { + background: var(--accent-color-hover); +} + +.modal-goose-button svg { + width: 16px; + height: 16px; +} + .modal-chat-button { display: flex; align-items: center;