-
Notifications
You must be signed in to change notification settings - Fork 2
feat: one-click Ollama installer, OS-aware download buttons, and AI parsing fixes #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cf6adef
f16d45c
ed30d41
a1af98f
20cc5a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -422,7 +422,7 @@ async function checkOllamaConnection(): Promise<void> { | |
| } | ||
| } | ||
| } else { | ||
| console.warn('[Ollama Setup] Connection failed:', result.error); | ||
| console.log('[Ollama Setup] Connection failed:', result.error); | ||
| showOllamaUIState('not-installed'); | ||
| // Determine whether the native helper is already installed and update sub-state | ||
| checkNativeHelper().then(installed => updateHelperSubstate(installed)); | ||
|
|
@@ -432,9 +432,11 @@ async function checkOllamaConnection(): Promise<void> { | |
| // ── Native Messaging helpers ────────────────────────────────────────────── | ||
|
|
||
| const HELPER_INSTALL_BASE = | ||
| 'https://raw.githubusercontent.com/joelnishanth/offlyn-apply/main/scripts/native-host'; | ||
| 'https://raw.githubusercontent.com/rahulraonatarajan/offlyn-apply/Windows-ollama-setup/scripts/native-host'; | ||
| const HELPER_PKG_URL = | ||
| 'https://github.com/joelnishanth/offlyn-apply/releases/download/v0.5.0/offlyn-helper.pkg'; | ||
| 'https://raw.githubusercontent.com/rahulraonatarajan/offlyn-apply/Windows-ollama-setup/scripts/native-host/install-mac-linux.sh'; | ||
| const HELPER_WIN_BAT_URL = | ||
| 'https://raw.githubusercontent.com/rahulraonatarajan/offlyn-apply/Windows-ollama-setup/scripts/native-host/install-win.bat'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All download URLs point to fork feature branchHigh Severity All hardcoded download URLs ( Additional Locations (2)There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bugbot Autofix determined this is a false positive. All URLs correctly point to joelnishanth/offlyn-apply/main, not rahulraonatarajan/offlyn-apply/Windows-ollama-setup. This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard. |
||
|
|
||
| function detectOS(): 'mac' | 'windows' | 'linux' { | ||
| const ua = navigator.userAgent.toLowerCase(); | ||
|
|
@@ -474,7 +476,18 @@ function populateHelperInstructions(): void { | |
| class="btn btn-primary" | ||
| style="display:inline-flex;align-items:center;gap:8px;font-size:14px;padding:10px 20px;text-decoration:none;margin-bottom:14px;"> | ||
| ${DOWNLOAD_SVG} | ||
| Download Installer | ||
| Download for Mac | ||
| </a> | ||
| `; | ||
| } else if (os === 'windows') { | ||
| container.innerHTML = ` | ||
| <p style="font-size:13px;color:#475569;margin-bottom:16px;">Download and double-click the installer — it takes about 10 seconds. No terminal required.</p> | ||
| <a href="${HELPER_WIN_BAT_URL}" | ||
| target="_blank" | ||
| class="btn btn-primary" | ||
| style="display:inline-flex;align-items:center;gap:8px;font-size:14px;padding:10px 20px;text-decoration:none;margin-bottom:14px;"> | ||
| ${DOWNLOAD_SVG} | ||
| Download for Windows (.bat) | ||
| </a> | ||
| `; | ||
| } else { | ||
|
|
@@ -493,8 +506,17 @@ function populateHelperInstructions(): void { | |
| async function checkNativeHelper(): Promise<boolean> { | ||
| try { | ||
| const res = await browser.runtime.sendMessage({ kind: 'CHECK_NATIVE_HELPER' }); | ||
| return (res as any)?.installed === true; | ||
| } catch { | ||
| const installed = (res as any)?.installed === true; | ||
| if (!installed) { | ||
| const errMsg = (res as any)?.error ?? 'no error detail'; | ||
| console.warn('[NativeHelper] not detected, reason:', errMsg); | ||
| // Show error in the helper status area so it is visible without DevTools | ||
| const hint = document.getElementById('helperErrorHint'); | ||
| if (hint) hint.textContent = `Error: ${errMsg}`; | ||
| } | ||
| return installed; | ||
| } catch (err) { | ||
| console.error('[NativeHelper] sendMessage threw:', err); | ||
| return false; | ||
| } | ||
| } | ||
|
|
@@ -606,7 +628,21 @@ function setupOllamaStepListeners(): void { | |
| class="btn btn-primary" | ||
| style="display:inline-flex;align-items:center;gap:8px;font-size:13px;padding:9px 16px;text-decoration:none;margin-bottom:10px;"> | ||
| ${DOWNLOAD_SVG} | ||
| Download Installer | ||
| Download for Mac | ||
| </a> | ||
| <p style="font-size:12px;color:#78350f;">After the installer finishes, click <strong>Re-test Connection</strong> below.</p> | ||
| `; | ||
| } else if (os === 'windows') { | ||
| corsWrap.innerHTML = ` | ||
| <p style="font-size:13px;color:#92400e;margin-bottom:10px;"> | ||
| <strong>To fix CORS automatically</strong>, install the Offlyn Helper first — it configures Ollama permissions in one step. | ||
| </p> | ||
| <a href="${HELPER_WIN_BAT_URL}" | ||
| target="_blank" | ||
| class="btn btn-primary" | ||
| style="display:inline-flex;align-items:center;gap:8px;font-size:13px;padding:9px 16px;text-decoration:none;margin-bottom:10px;"> | ||
| ${DOWNLOAD_SVG} | ||
| Download for Windows (.bat) | ||
| </a> | ||
| <p style="font-size:12px;color:#78350f;">After the installer finishes, click <strong>Re-test Connection</strong> below.</p> | ||
| `; | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mac download link changed from .pkg to shell script
High Severity
HELPER_PKG_URLwas changed from a.pkgmacOS installer to a raw.shshell script URL. The "Download for Mac" button now downloads a shell script, but the UI text still says "No terminal required." macOS users cannot double-click a.shfile to run it — they need to open Terminal andbashit. This completely breaks the Mac onboarding flow.Additional Locations (1)
apps/extension-firefox/src/onboarding/onboarding.ts#L433-L435There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bugbot Autofix determined this is a false positive.
HELPER_PKG_URL correctly points to offlyn-helper.pkg, not a shell script, and has not been changed to a fork branch.
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.