Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ pub async fn main() {
.plugin(tauri_plugin_store::Builder::default().build())
.plugin(tauri_plugin_store2::init())
.plugin(tauri_plugin_windows::init())
.plugin(tauri_plugin_listener::init(
tauri_plugin_listener::InitOptions {
parent_supervisor: root_supervisor.as_ref().map(|s| s.get_cell()),
},
))
.plugin(tauri_plugin_listener::init())
.plugin(tauri_plugin_listener2::init())
.plugin(tauri_plugin_local_stt::init(
tauri_plugin_local_stt::InitOptions {
Expand Down
8 changes: 4 additions & 4 deletions apps/desktop/src/store/zustand/listener/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import type { StoreApi } from "zustand";

import { commands as hooksCommands } from "@hypr/plugin-hooks";
import {
type ControllerParams,
commands as listenerCommands,
events as listenerEvents,
type SessionEvent,
type SessionParams,
type StreamResponse,
} from "@hypr/plugin-listener";
import {
Expand Down Expand Up @@ -48,7 +48,7 @@ export type GeneralState = {

export type GeneralActions = {
start: (
params: ControllerParams,
params: SessionParams,
options?: { handlePersist?: HandlePersistCallback },
) => void;
stop: () => void;
Expand Down Expand Up @@ -80,7 +80,7 @@ const listenToSessionEvents = (
catch: (error) => error,
});

const startSessionEffect = (params: ControllerParams) =>
const startSessionEffect = (params: SessionParams) =>
fromResult(listenerCommands.startSession(params));
const stopSessionEffect = () => fromResult(listenerCommands.stopSession());

Expand All @@ -95,7 +95,7 @@ export const createGeneralSlice = <
get: StoreApi<T>["getState"],
): GeneralState & GeneralActions => ({
...initialState,
start: (params: ControllerParams, options) => {
start: (params: SessionParams, options) => {
const targetSessionId = params.session_id;

if (!targetSessionId) {
Expand Down
4 changes: 2 additions & 2 deletions plugins/listener/js/bindings.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async setMicMuted(muted: boolean) : Promise<Result<null, string>> {
else return { status: "error", error: e as any };
}
},
async startSession(params: ControllerParams) : Promise<Result<null, string>> {
async startSession(params: SessionParams) : Promise<Result<null, string>> {
try {
return { status: "ok", data: await TAURI_INVOKE("plugin:listener|start_session", { params }) };
} catch (e) {
Expand Down Expand Up @@ -88,8 +88,8 @@ sessionEvent: "plugin:listener:session-event"

/** user-defined types **/

export type ControllerParams = { session_id: string; languages: string[]; onboarding: boolean; record_enabled: boolean; model: string; base_url: string; api_key: string; keywords: string[] }
export type SessionEvent = { type: "inactive"; session_id: string } | { type: "running_active"; session_id: string } | { type: "finalizing"; session_id: string } | { type: "audioAmplitude"; session_id: string; mic: number; speaker: number } | { type: "micMuted"; session_id: string; value: boolean } | { type: "streamResponse"; session_id: string; response: StreamResponse }
export type SessionParams = { session_id: string; languages: string[]; onboarding: boolean; record_enabled: boolean; model: string; base_url: string; api_key: string; keywords: string[] }
export type StreamAlternatives = { transcript: string; words: StreamWord[]; confidence: number; languages?: string[] }
export type StreamChannel = { alternatives: StreamAlternatives[] }
export type StreamExtra = { started_unix_millis: number }
Expand Down
Loading
Loading