MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / register

Function register

src/runtime/registry.ts:278–298  ·  view source on GitHub ↗
(opts: RegisterOptions)

Source from the content-addressed store, hash-verified

276 * Called from `server.ts` once the HTTP server is listening.
277 */
278export function register(opts: RegisterOptions): void {
279 try {
280 const now = new Date().toISOString();
281 const entry: RegistryEntry = {
282 dir: canonicalizeDir(opts.dir),
283 name: opts.name,
284 version: opts.version,
285 port: opts.port,
286 pid: process.pid,
287 status: "running",
288 startedAt: now,
289 updatedAt: now,
290 };
291
292 writeEntryFile(entry);
293 console.log(` [Registry] Registered "${opts.name}" (pid ${process.pid})`);
294 } catch (err) {
295 // Registry is a best-effort feature — never crash the main process
296 console.warn(" [Registry] Failed to register:", err);
297 }
298}
299
300/**
301 * Deregister a Pack from the local registry directory.

Callers

nothing calls this directly

Calls 2

canonicalizeDirFunction · 0.85
writeEntryFileFunction · 0.85

Tested by

no test coverage detected