@solvedsource/livewing-sdk
v0.1.1
Published
Author-facing SDK for LiveWing Rules. Exports rule(), on(), api, emit, sleep, storage, zod re-export.
Maintainers
Readme
@solvedsource/livewing-sdk
Author-facing SDK for LiveWing Rules — typed primitives for wiring LiveWing events into TypeScript automation.
Install
npm install @solvedsource/livewing-sdk @solvedsource/livewing-types zodExample
import { rule, on, api } from "@solvedsource/livewing-sdk";
export default rule({
name: "Cut to Cam 2",
trigger: on.hotkey("F2"),
run: async () => {
await api.switcher.cut({ input: 2 });
},
});Save the file into your LiveWing rules/ folder — the app hot-reloads on save. See the full Rules docs for triggers, predicates, args, and the API surface.
Exports
rule({...})— identity function typed to guide inference.on(topic)/on.hotkey/on.manual/on.midi/on.any— trigger builders.api— typed proxy over every registered LiveWing command.emit,sleep,storage,console_— runtime helpers bridged to the host.z— re-export ofzodforargsschemas.
The runtime bridge expects to execute inside LiveWing's rule sandbox (JavaScriptCore + globalThis.__livewing_*__ bindings). Outside that host the imports type-check but the calls are no-ops.
License
MIT
