Download src/cli/daemon-cli/lifecycle.ts from shimen/shinclaw: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/cli/daemon-cli/lifecycle.ts
- Command line
-
hf download hf://spaces/shimen/shinclaw/src/cli/daemon-cli/lifecycle.ts
-
curl -L -o lifecycle.ts https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/cli/daemon-cli/lifecycle.ts
1.46 kB
| import type { DaemonLifecycleOptions } from "./types.js"; | |
| import { resolveGatewayService } from "../../daemon/service.js"; | |
| import { | |
| runServiceRestart, | |
| runServiceStart, | |
| runServiceStop, | |
| runServiceUninstall, | |
| } from "./lifecycle-core.js"; | |
| import { renderGatewayServiceStartHints } from "./shared.js"; | |
| export async function runDaemonUninstall(opts: DaemonLifecycleOptions = {}) { | |
| return await runServiceUninstall({ | |
| serviceNoun: "Gateway", | |
| service: resolveGatewayService(), | |
| opts, | |
| stopBeforeUninstall: true, | |
| assertNotLoadedAfterUninstall: true, | |
| }); | |
| } | |
| export async function runDaemonStart(opts: DaemonLifecycleOptions = {}) { | |
| return await runServiceStart({ | |
| serviceNoun: "Gateway", | |
| service: resolveGatewayService(), | |
| renderStartHints: renderGatewayServiceStartHints, | |
| opts, | |
| }); | |
| } | |
| export async function runDaemonStop(opts: DaemonLifecycleOptions = {}) { | |
| return await runServiceStop({ | |
| serviceNoun: "Gateway", | |
| service: resolveGatewayService(), | |
| opts, | |
| }); | |
| } | |
| /** | |
| * Restart the gateway service service. | |
| * @returns `true` if restart succeeded, `false` if the service was not loaded. | |
| * Throws/exits on check or restart failures. | |
| */ | |
| export async function runDaemonRestart(opts: DaemonLifecycleOptions = {}): Promise<boolean> { | |
| return await runServiceRestart({ | |
| serviceNoun: "Gateway", | |
| service: resolveGatewayService(), | |
| renderStartHints: renderGatewayServiceStartHints, | |
| opts, | |
| }); | |
| } | |