返回 Skill 列表
extension
分类: 开发与工程无需 API Key

librc

librc - 使用svscan监督的服务生命周期管理器。ServiceManager通过Unix套接字与监督守护进程通信。startServices和stopServices控制多个服务。用于启动/停止平台服务、进程监督和服务编排。

person作者: jakexiaohubgithub

librc Skill

When to Use

  • Starting and stopping Copilot-LD services
  • Managing service lifecycle programmatically
  • Communicating with the supervision daemon
  • Orchestrating service startup order

Key Concepts

ServiceManager: Connects to svscan daemon via Unix socket to control service processes.

Supervision: Services run under svscan for automatic restart and logging.

Usage Patterns

Pattern 1: Manage single service

import { ServiceManager } from "@copilot-ld/librc";

const manager = new ServiceManager("/var/run/svscan.sock");
await manager.start("agent");
await manager.status("agent"); // Returns running/stopped
await manager.stop("agent");

Pattern 2: Manage multiple services

import { startServices, stopServices } from "@copilot-ld/librc";

await startServices(["agent", "llm", "memory"]);
await stopServices(["agent", "llm", "memory"]);

Integration

Used by make rc-start and make rc-stop. Works with libsupervision daemon.