feat(core): add command registry (#30624)

This commit is contained in:
Dax 2026-06-04 02:57:43 -04:00 committed by GitHub
commit 1ff19103a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
150 changed files with 4642 additions and 2546 deletions

View file

@ -3,17 +3,27 @@
import * as NodeRuntime from "@effect/platform-node/NodeRuntime"
import * as NodeServices from "@effect/platform-node/NodeServices"
import * as Effect from "effect/Effect"
import { Api } from "./api"
import { CliBuilder } from "./cli-builder"
import { Commands } from "./commands/commands"
import { Runtime } from "./framework/runtime"
import { Daemon } from "./services/daemon"
const Handlers = CliBuilder.handlers(Api, {
const Handlers = Runtime.handlers(Commands, {
debug: {
agents: () => import("./handlers/debug/agents"),
agents: () => import("./commands/handlers/debug/agents"),
},
migrate: () => import("./handlers/migrate"),
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"),
})
CliBuilder.run(Api, Handlers, { version: "local" }).pipe(
Runtime.run(Commands, Handlers, { version: "local" }).pipe(
Effect.provide(Daemon.defaultLayer),
Effect.provide(NodeServices.layer),
Effect.scoped,
NodeRuntime.runMain,