Files
Meeting_Assistant/client/src/preload.js
egg 7d4fc69071 feat: Add build scripts and runtime config support
Backend:
- Add setup-backend.sh/bat for one-click backend setup
- Fix test_auth.py mock settings (JWT_EXPIRE_HOURS)
- Fix test_excel_export.py TEMPLATE_DIR reference

Frontend:
- Add config.json for runtime API URL configuration
- Add init.js and settings.js for config loading
- Update main.js to load config from external file
- Update api.js to use dynamic API_BASE_URL
- Update all pages to initialize config before API calls
- Update package.json with extraResources for config

Build:
- Add build-client.sh/bat for packaging Electron + Sidecar
- Add build-all.ps1 PowerShell script with -ApiUrl parameter
- Add GitHub Actions workflow for Windows builds
- Add scripts/README.md documentation

This allows IT to configure backend URL without rebuilding.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 20:03:16 +08:00

36 lines
1.3 KiB
JavaScript

const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("electronAPI", {
// App configuration (loaded from config.json)
getConfig: () => ipcRenderer.invoke("get-config"),
// Navigation
navigate: (page) => ipcRenderer.invoke("navigate", page),
// Sidecar status
getSidecarStatus: () => ipcRenderer.invoke("get-sidecar-status"),
// === Streaming Mode APIs ===
startRecordingStream: () => ipcRenderer.invoke("start-recording-stream"),
streamAudioChunk: (base64Audio) => ipcRenderer.invoke("stream-audio-chunk", base64Audio),
stopRecordingStream: () => ipcRenderer.invoke("stop-recording-stream"),
// Streaming events
onTranscriptionSegment: (callback) => {
ipcRenderer.on("transcription-segment", (event, segment) => callback(segment));
},
onStreamStarted: (callback) => {
ipcRenderer.on("stream-started", (event, data) => callback(data));
},
onStreamStopped: (callback) => {
ipcRenderer.on("stream-stopped", (event, data) => callback(data));
},
// === Legacy File-based APIs (fallback) ===
saveAudioFile: (arrayBuffer) => ipcRenderer.invoke("save-audio-file", arrayBuffer),
transcribeAudio: (filePath) => ipcRenderer.invoke("transcribe-audio", filePath),
onTranscriptionResult: (callback) => {
ipcRenderer.on("transcription-result", (event, text) => callback(text));
},
});