Skip to content
Source
Sign inSign up

speechWorker.ts

15 lines554 Bytes

1import * as Effect from "effect/Effect";
2import { Argument, Command } from "effect/cli";
3import { runNativeSpeechWorker } from "../speech/native.ts";
4​
5export const speechWorkerCommand = Command.make("__speech-worker", {
6 mode: Argument.Literals("mode", ["discover", "model"]),
7 moduleUrl: Argument.String("module-url").pipe(Argument.optional),
8}).pipe(
9 Command.unlisted,
10 Command.withHandler(({ mode, moduleUrl }) =>
11 Effect.promise(() =>
12 runNativeSpeechWorker(mode, moduleUrl._tag === "Some" ? moduleUrl.value : undefined),
13 ),
14 ),
15);