@hachej/boring-ui-cli 0.1.24 → 0.1.25

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/server/cli.js +20 -6
  2. package/package.json +3 -3
@@ -138,7 +138,7 @@ const HELP_TEXT = [
138
138
  "Options:",
139
139
  " -p, --port <port> HTTP port (default: 5200)",
140
140
  " --host <host> Listen host (default: 0.0.0.0)",
141
- " -m, --mode <mode> local-sandbox or local (default: local-sandbox)",
141
+ " -m, --mode <mode> local-sandbox or local (default: local)",
142
142
  " -h, --help Show this help"
143
143
  ].join("\n");
144
144
  const AUTH_GUIDE = [
@@ -468,12 +468,26 @@ async function runCli(options) {
468
468
  }
469
469
  const port = Number(args.port ?? process.env.PORT) || 5200;
470
470
  const host = args.host ?? process.env.HOST ?? "0.0.0.0";
471
- const rawMode = args.mode ?? process.env.BORING_MODE ?? "local-sandbox";
472
- if (!(rawMode in MODE_MAP)) {
473
- throw new Error(`invalid --mode "${rawMode}". Valid options: ${Object.keys(MODE_MAP).join(", ")}`);
471
+ const rawMode = args.mode ?? process.env.BORING_MODE;
472
+ let cliMode;
473
+ let mode;
474
+ if (rawMode) {
475
+ if (!(rawMode in MODE_MAP)) {
476
+ throw new Error(`invalid --mode "${rawMode}". Valid options: ${Object.keys(MODE_MAP).join(", ")}`);
477
+ }
478
+ cliMode = rawMode;
479
+ mode = MODE_MAP[cliMode];
480
+ } else {
481
+ const agent = await import("@hachej/boring-agent/server");
482
+ const detected = agent.autoDetectMode();
483
+ if (detected === "local") {
484
+ cliMode = "local-sandbox";
485
+ mode = "local";
486
+ } else {
487
+ cliMode = "local";
488
+ mode = "direct";
489
+ }
474
490
  }
475
- const cliMode = rawMode;
476
- const mode = MODE_MAP[cliMode];
477
491
  const base = {
478
492
  publicDir: options.publicDir,
479
493
  port,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hachej/boring-ui-cli",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "Turn an agent into an app",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -16,9 +16,9 @@
16
16
  "@fastify/static": "^9.1.1",
17
17
  "fastify": "^5.4.0",
18
18
  "lucide-react": "^1.8.0",
19
- "@hachej/boring-workspace": "0.1.24",
19
+ "@hachej/boring-ui-kit": "0.1.24",
20
20
  "@hachej/boring-agent": "0.1.24",
21
- "@hachej/boring-ui-kit": "0.1.24"
21
+ "@hachej/boring-workspace": "0.1.24"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@tailwindcss/vite": "^4.0.0",