hex/sdk/commands/workspace-template/hex.config.ts
Dax 3434eb5f35
Rename voice-control to hex everywhere, without migrations (#293)
* Rename voice-control to hex everywhere, without migrations

The Cargo package and binary are now hex, every OS keeps its data in a
hex folder, and VOICE_CONTROL_* variables are HEX_*. Hex is a fresh
app: the macOS voice-control rename, its symlink, and the Windows and
Linux beta settings imports are gone. The Windows installer gets a new
AppId so it never takes over an old voice-control install's entry.

* Format

* Drop the Windows paste-last default only the beta import used
2026-10-28 13:08:44 -04:00

45 lines
1.7 KiB
TypeScript

import { choice, defineHexConfig, digit, letter, union } from "@hex/commands"
export default defineHexConfig({
// Transformations appear as optional final steps in every dictation mode.
// transformations: {
// "trim-whitespace": {
// name: "Trim whitespace",
// description: "Remove leading and trailing whitespace",
// transform: (text) => text.trim(),
// },
// },
// Uncomment this block to replace Hex's native voice-dictation protocol.
// dictation: {
// start: ["begin note"],
// stop: ["finish note"],
// send: ["send note"],
// cancel: ["discard note"],
// },
commands: {
"open-example": {
phrases: ["open example"],
group: "Websites",
description: "Open the example site",
run: ({ hex }) => hex.openUrl("https://example.com"),
},
// A trailing {capture} placeholder collects the rest of the spoken
// phrase: "search amazon for wool socks" -> captures.query === "wool socks".
"search-amazon": {
phrases: ["search amazon for {query}"],
group: "Websites",
description: "Search Amazon for the spoken words",
run: ({ hex, captures }) =>
hex.openUrl(`https://www.amazon.com/s?k=${encodeURIComponent(captures.query ?? "")}`),
},
// Explicit descriptors compose multiple captures and infer exact handler types.
"control-key": {
phrases: ["control {key}"],
captures: { key: union(letter(), digit(), choice(["home", "end"] as const)) },
group: "Keyboard",
description: "Press Control plus a letter, digit, Home, or End",
run: ({ hex, captures }) =>
hex.press({ key: String(captures.key), modifiers: ["control"] }),
},
},
})