2026-05-30 03:12:12 +00:00
|
|
|
#!/usr/bin/env bun
|
|
|
|
|
|
|
|
|
|
import * as NodeRuntime from "@effect/platform-node/NodeRuntime"
|
|
|
|
|
import * as NodeServices from "@effect/platform-node/NodeServices"
|
|
|
|
|
import * as Effect from "effect/Effect"
|
2026-06-04 06:57:43 +00:00
|
|
|
import { Commands } from "./commands/commands"
|
|
|
|
|
import { Runtime } from "./framework/runtime"
|
|
|
|
|
import { Daemon } from "./services/daemon"
|
2026-05-30 03:12:12 +00:00
|
|
|
|
2026-06-04 06:57:43 +00:00
|
|
|
const Handlers = Runtime.handlers(Commands, {
|
2026-06-07 03:27:28 +00:00
|
|
|
$: () => import("./commands/handlers/default"),
|
2026-06-24 03:34:47 +00:00
|
|
|
api: () => import("./commands/handlers/api"),
|
2026-06-03 02:42:13 +00:00
|
|
|
debug: {
|
2026-06-04 06:57:43 +00:00
|
|
|
agents: () => import("./commands/handlers/debug/agents"),
|
2026-06-03 02:42:13 +00:00
|
|
|
},
|
2026-06-04 06:57:43 +00:00
|
|
|
migrate: () => import("./commands/handlers/migrate"),
|
|
|
|
|
service: {
|
|
|
|
|
start: () => import("./commands/handlers/service/start"),
|
|
|
|
|
restart: () => import("./commands/handlers/service/restart"),
|
|
|
|
|
status: () => import("./commands/handlers/service/status"),
|
|
|
|
|
stop: () => import("./commands/handlers/service/stop"),
|
|
|
|
|
password: () => import("./commands/handlers/service/password"),
|
|
|
|
|
},
|
|
|
|
|
serve: () => import("./commands/handlers/serve"),
|
2026-06-03 02:42:13 +00:00
|
|
|
})
|
2026-05-30 22:57:42 +00:00
|
|
|
|
2026-06-04 06:57:43 +00:00
|
|
|
Runtime.run(Commands, Handlers, { version: "local" }).pipe(
|
2026-06-30 17:17:34 +00:00
|
|
|
Effect.provide(Daemon.layer),
|
2026-06-03 02:42:13 +00:00
|
|
|
Effect.provide(NodeServices.layer),
|
|
|
|
|
Effect.scoped,
|
|
|
|
|
NodeRuntime.runMain,
|
|
|
|
|
)
|