flyspace-cli 0.1.31 → 0.1.32
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.
- package/dist/cli.js +23 -21
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1858,7 +1858,7 @@ async function runAuthCmd(args) {
|
|
|
1858
1858
|
}
|
|
1859
1859
|
|
|
1860
1860
|
// ../api/src/version.ts
|
|
1861
|
-
var CLI_VERSION = true ? "0.1.
|
|
1861
|
+
var CLI_VERSION = true ? "0.1.32" : null;
|
|
1862
1862
|
function isOlderVersion(a, b) {
|
|
1863
1863
|
const parse = (v) => v.replace(/^v/, "").split("-")[0].split(".").map(Number);
|
|
1864
1864
|
const [pa, pb] = [parse(a), parse(b)];
|
|
@@ -2468,7 +2468,7 @@ function npmEnv(target) {
|
|
|
2468
2468
|
return nodeBin ? { ...process.env, PATH: `${nodeBin}:${process.env.PATH ?? ""}` } : process.env;
|
|
2469
2469
|
}
|
|
2470
2470
|
async function runUpgrade() {
|
|
2471
|
-
const current = "0.1.
|
|
2471
|
+
const current = "0.1.32";
|
|
2472
2472
|
console.log(`Current version: ${current}`);
|
|
2473
2473
|
console.log("Checking for updates...\n");
|
|
2474
2474
|
try {
|
|
@@ -3108,10 +3108,14 @@ async function runRestart() {
|
|
|
3108
3108
|
import { spawn as spawn3 } from "child_process";
|
|
3109
3109
|
import { existsSync as existsSync12 } from "fs";
|
|
3110
3110
|
import { join as join12 } from "path";
|
|
3111
|
+
function serviceLogFile(errors) {
|
|
3112
|
+
const suffix = errors ? "-error.log" : ".log";
|
|
3113
|
+
const candidates = ["host", "custie"].map((name) => join12(paths.LOG_DIR, `${name}${suffix}`));
|
|
3114
|
+
return candidates.find((file) => existsSync12(file)) ?? candidates[0];
|
|
3115
|
+
}
|
|
3111
3116
|
async function runLogs(args) {
|
|
3112
3117
|
const showErrors = args.includes("--error") || args.includes("-e");
|
|
3113
|
-
const
|
|
3114
|
-
const logFile = join12(paths.LOG_DIR, filename);
|
|
3118
|
+
const logFile = serviceLogFile(showErrors);
|
|
3115
3119
|
if (!existsSync12(logFile)) {
|
|
3116
3120
|
console.error(`Log file not found: ${logFile}`);
|
|
3117
3121
|
console.error("Is the service installed? Run `flyspace install` first.");
|
|
@@ -6406,7 +6410,7 @@ async function runMcpCmd(args) {
|
|
|
6406
6410
|
import { spawn as spawn8, spawnSync } from "child_process";
|
|
6407
6411
|
import { existsSync as existsSync33 } from "fs";
|
|
6408
6412
|
import { platform as platform7 } from "os";
|
|
6409
|
-
import { join as
|
|
6413
|
+
import { join as join28 } from "path";
|
|
6410
6414
|
|
|
6411
6415
|
// src/reconcile.ts
|
|
6412
6416
|
import { existsSync as existsSync15, mkdirSync as mkdirSync8, writeFileSync as writeFileSync8 } from "fs";
|
|
@@ -14635,7 +14639,6 @@ function createGatedRouter(agent, register) {
|
|
|
14635
14639
|
|
|
14636
14640
|
// src/dashboard/host-api.ts
|
|
14637
14641
|
import { existsSync as existsSync30, readFileSync as readFileSync24, statSync as statSync8 } from "fs";
|
|
14638
|
-
import { join as join26 } from "path";
|
|
14639
14642
|
import sharp6 from "sharp";
|
|
14640
14643
|
|
|
14641
14644
|
// src/dashboard/channels-routes.ts
|
|
@@ -18631,8 +18634,7 @@ function registerHostRoutes(api) {
|
|
|
18631
18634
|
api.get("/logs", (c) => {
|
|
18632
18635
|
const errors = c.req.query("error") === "true" || c.req.query("error") === "1";
|
|
18633
18636
|
const limit = Math.min(Number(c.req.query("limit")) || 200, 2e3);
|
|
18634
|
-
const
|
|
18635
|
-
const file = join26(paths.LOG_DIR, filename);
|
|
18637
|
+
const file = serviceLogFile(errors);
|
|
18636
18638
|
const exists = existsSync30(file);
|
|
18637
18639
|
return c.json({
|
|
18638
18640
|
file,
|
|
@@ -18928,12 +18930,12 @@ function readDocShareBundle({ cwd, sourcePath }) {
|
|
|
18928
18930
|
// src/dashboard/host-upgrade.ts
|
|
18929
18931
|
import { spawn as spawn7 } from "child_process";
|
|
18930
18932
|
import { mkdirSync as mkdirSync13, openSync as openSync3 } from "fs";
|
|
18931
|
-
import { join as
|
|
18933
|
+
import { join as join26 } from "path";
|
|
18932
18934
|
var running = false;
|
|
18933
18935
|
function startHostUpgrade() {
|
|
18934
18936
|
if (running) return { started: false };
|
|
18935
18937
|
mkdirSync13(paths.LOG_DIR, { recursive: true });
|
|
18936
|
-
const log5 = openSync3(
|
|
18938
|
+
const log5 = openSync3(join26(paths.LOG_DIR, "host-upgrade.log"), "a");
|
|
18937
18939
|
const child = spawn7(process.execPath, [process.argv[1] ?? "", "upgrade"], {
|
|
18938
18940
|
detached: true,
|
|
18939
18941
|
stdio: ["ignore", log5, log5]
|
|
@@ -19247,7 +19249,7 @@ function startPushWatcher() {
|
|
|
19247
19249
|
|
|
19248
19250
|
// src/dashboard/machine-server.ts
|
|
19249
19251
|
import { existsSync as existsSync32 } from "fs";
|
|
19250
|
-
import { join as
|
|
19252
|
+
import { join as join27 } from "path";
|
|
19251
19253
|
import { serveStatic } from "@hono/node-server/serve-static";
|
|
19252
19254
|
|
|
19253
19255
|
// src/dashboard/app-icon-routes.ts
|
|
@@ -19329,7 +19331,7 @@ function pngResponse(c, png) {
|
|
|
19329
19331
|
}
|
|
19330
19332
|
|
|
19331
19333
|
// src/dashboard/machine-server.ts
|
|
19332
|
-
var WEB_DIST =
|
|
19334
|
+
var WEB_DIST = join27(paths.WEB_ROOT, "dist");
|
|
19333
19335
|
async function bootMachine() {
|
|
19334
19336
|
await reconcileAll().catch(
|
|
19335
19337
|
(err) => console.error("[dashboard] reconcileAll failed:", err.message)
|
|
@@ -19349,14 +19351,14 @@ async function bootMachine() {
|
|
|
19349
19351
|
function mountSpa(app) {
|
|
19350
19352
|
app.route("/share", createPublicShareAssetRouter(WEB_DIST));
|
|
19351
19353
|
app.route("/", createAppIconRouter());
|
|
19352
|
-
if (existsSync32(WEB_DIST) || existsSync32(
|
|
19354
|
+
if (existsSync32(WEB_DIST) || existsSync32(join27(paths.WEB_ROOT, "package.json"))) {
|
|
19353
19355
|
app.use("/*", serveStatic({ root: WEB_DIST }));
|
|
19354
19356
|
}
|
|
19355
19357
|
app.get("/assets/*", (c) => c.text("stale asset \u2014 reload for the current build", 404));
|
|
19356
|
-
const spaFallback = serveStatic({ path:
|
|
19358
|
+
const spaFallback = serveStatic({ path: join27(WEB_DIST, "index.html") });
|
|
19357
19359
|
app.get("*", async (c, next) => {
|
|
19358
|
-
if (!existsSync32(
|
|
19359
|
-
const isCheckout = existsSync32(
|
|
19360
|
+
if (!existsSync32(join27(WEB_DIST, "index.html"))) {
|
|
19361
|
+
const isCheckout = existsSync32(join27(paths.WEB_ROOT, "package.json"));
|
|
19360
19362
|
return c.text(
|
|
19361
19363
|
isCheckout ? `Workspace UI build missing (${WEB_DIST}).
|
|
19362
19364
|
Run \`pnpm build:web\` from the repo root.
|
|
@@ -19490,8 +19492,8 @@ function openBrowser2(url) {
|
|
|
19490
19492
|
}
|
|
19491
19493
|
}
|
|
19492
19494
|
function ensureWebBuild() {
|
|
19493
|
-
if (existsSync33(
|
|
19494
|
-
if (!existsSync33(
|
|
19495
|
+
if (existsSync33(join28(paths.WEB_ROOT, "dist", "index.html"))) return;
|
|
19496
|
+
if (!existsSync33(join28(paths.WEB_ROOT, "package.json"))) return;
|
|
19495
19497
|
console.log(" packages/ui/dist missing, building the dashboard UI...");
|
|
19496
19498
|
const result = spawnSync("pnpm", ["build"], {
|
|
19497
19499
|
cwd: paths.WEB_ROOT,
|
|
@@ -19722,10 +19724,10 @@ async function runReconcileCmd(args) {
|
|
|
19722
19724
|
}
|
|
19723
19725
|
|
|
19724
19726
|
// src/cli.ts
|
|
19725
|
-
import { join as
|
|
19727
|
+
import { join as join29 } from "path";
|
|
19726
19728
|
var home = flyspaceHome();
|
|
19727
19729
|
if (home) {
|
|
19728
|
-
const bin =
|
|
19730
|
+
const bin = join29(home, "bin");
|
|
19729
19731
|
const path = process.env.PATH ?? "";
|
|
19730
19732
|
if (!path.split(":").includes(bin)) process.env.PATH = path ? `${bin}:${path}` : bin;
|
|
19731
19733
|
}
|
|
@@ -19863,7 +19865,7 @@ async function main() {
|
|
|
19863
19865
|
break;
|
|
19864
19866
|
case "-v":
|
|
19865
19867
|
case "--version":
|
|
19866
|
-
printRaw("0.1.
|
|
19868
|
+
printRaw("0.1.32");
|
|
19867
19869
|
break;
|
|
19868
19870
|
case "-h":
|
|
19869
19871
|
case "--help":
|