mirror of
https://github.com/block/goose.git
synced 2026-06-02 06:19:33 +02:00
Inline worklet source (#7128)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user