@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 27 lines 1.07 KB
Raw
1 import * as Effect from "effect/Effect";
2 import * as Option from "effect/Option";
3 import * as Schema from "effect/Schema";
4
5 import * as DesktopConnectionCatalogStore from "../../app/DesktopConnectionCatalogStore.ts";
6 import * as IpcChannels from "../channels.ts";
7 import * as DesktopIpc from "../DesktopIpc.ts";
8
9 export const getConnectionCatalog = DesktopIpc.makeIpcMethod({
10 channel: IpcChannels.GET_CONNECTION_CATALOG_CHANNEL,
11 payload: Schema.Void,
12 result: Schema.NullOr(Schema.String),
13 handler: Effect.fn("desktop.ipc.connectionCatalog.get")(function* () {
14 const store = yield* DesktopConnectionCatalogStore.DesktopConnectionCatalogStore;
15 return Option.getOrNull(yield* store.get);
16 }),
17 });
18
19 export const setConnectionCatalog = DesktopIpc.makeIpcMethod({
20 channel: IpcChannels.SET_CONNECTION_CATALOG_CHANNEL,
21 payload: Schema.String,
22 result: Schema.Boolean,
23 handler: Effect.fn("desktop.ipc.connectionCatalog.set")(function* (catalog) {
24 const store = yield* DesktopConnectionCatalogStore.DesktopConnectionCatalogStore;
25 return yield* store.set(catalog);
26 }),
27 });