Inline worklet source (#7128)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2026-02-10 23:32:20 +01:00
committed by GitHub
parent cc6af199c7
commit 426f8e0a07
4 changed files with 15 additions and 2 deletions
+10
View File
@@ -162,6 +162,16 @@ debug-ui-main-process:
npm install && \
npm run start-gui-debug
# Package the desktop app locally for testing (macOS)
# Applies ad-hoc code signing with entitlements (needed for mic access, etc.)
package-ui:
@just release-binary
@echo "Packaging desktop app..."
cd ui/desktop && npm install && npm run package
@echo "Signing with entitlements..."
codesign --force --deep --sign - --entitlements ui/desktop/entitlements.plist ui/desktop/out/Goose-darwin-arm64/Goose.app
@echo "Done! Launch with: open ui/desktop/out/Goose-darwin-arm64/Goose.app"
# Run UI with alpha changes
run-ui-alpha:
@just release-binary
+2
View File
@@ -222,6 +222,8 @@ pub async fn transcribe_with_provider(
anyhow::bail!("Invalid API key");
} else if status == 429 || error_text.contains("quota") {
anyhow::bail!("Rate limit exceeded");
} else if error_text.contains("too short") {
return Ok(String::new());
} else {
anyhow::bail!("API error: {}", error_text);
}
+3 -2
View File
@@ -16,8 +16,9 @@ const MIN_SPEECH_MS = 200;
// without clipping early speech onsets. Determined empirically for 16kHz mono input.
const RMS_THRESHOLD = 0.015;
// Import the worklet module - Vite will handle this correctly
const WORKLET_URL = new URL('../audio-capture-worklet.js', import.meta.url).href;
// Resolve worklet URL at runtime from window.location so it works under both
// the dev server (http://localhost) and packaged builds (file://).
const WORKLET_URL = new URL('audio-capture-worklet.js', window.location.href.split('#')[0]).href;
function encodeWav(samples: Float32Array, sampleRate: number): ArrayBuffer {
const buf = new ArrayBuffer(44 + samples.length * 2);