@sideboard-ai/cli 0.1.303 → 0.1.305

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +38 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ import {
15
15
  listLinearIssues,
16
16
  resolveRepoRoot,
17
17
  startMcpServer,
18
+ startHeadlessHost,
18
19
  startOrchestration,
19
20
  hasRepoHook,
20
21
  settingsSourceLabel,
@@ -514,8 +515,34 @@ ${preview.diffStat}`);
514
515
  program.command("mcp").description("Run the Sideboard MCP stdio server").action(async () => {
515
516
  await startMcpServer();
516
517
  });
518
+ program.command("serve").description("Keep schedules and the phone relay running after the desktop window quits").option("--lan", "Also listen on this Mac so the phone can use ws://<lan-ip>:<port>/remote").action(async (opts) => {
519
+ const ac = new AbortController();
520
+ const stop = () => ac.abort();
521
+ process.on("SIGINT", stop);
522
+ process.on("SIGTERM", stop);
523
+ let code = 0;
524
+ try {
525
+ const host = await startHeadlessHost({ lan: Boolean(opts.lan), signal: ac.signal });
526
+ if (!host.ok) {
527
+ console.error(chalk.yellow(host.reason));
528
+ code = 1;
529
+ } else {
530
+ console.log(chalk.green("Sideboard host is running. Quit the desktop window; this process keeps the fleet."));
531
+ if (host.lanUrls.length) {
532
+ console.log("Phone relay (same network):");
533
+ for (const url of host.lanUrls) console.log(` ${url}`);
534
+ }
535
+ await untilAborted(ac.signal);
536
+ await host.stop();
537
+ }
538
+ } finally {
539
+ process.off("SIGINT", stop);
540
+ process.off("SIGTERM", stop);
541
+ }
542
+ process.exit(code);
543
+ });
517
544
  const scheduleCmd = program.command("schedule").description(
518
- "Local jobs that trigger a chat (Sideboard.app must be running to fire)"
545
+ "Local jobs that trigger a chat (Sideboard.app or `sideboard serve` must be running to fire)"
519
546
  );
520
547
  scheduleCmd.command("ls").description("List schedules").action(() => {
521
548
  const rows = listSchedules();
@@ -760,6 +787,16 @@ ${preview.diffStat}`);
760
787
  });
761
788
  await program.parseAsync(process.argv);
762
789
  }
790
+ function untilAborted(signal) {
791
+ return new Promise((resolve) => {
792
+ if (signal.aborted) {
793
+ resolve();
794
+ return;
795
+ }
796
+ signal.addEventListener("abort", () => resolve(), { once: true });
797
+ if (signal.aborted) resolve();
798
+ });
799
+ }
763
800
  function statusColor(status) {
764
801
  switch (status) {
765
802
  case "running":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/cli",
3
- "version": "0.1.303",
3
+ "version": "0.1.305",
4
4
  "description": "Sideboard CLI — agent-agnostic worktree orchestration (includes `sideboard mcp`)",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",