@vellumai/cli 0.1.3 → 0.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "CLI tools for vellum-assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -583,7 +583,8 @@ async function hatchGcp(
583
583
  (await checkCurlFailure(instanceName, project, zone, account))
584
584
  ) {
585
585
  console.log("");
586
- console.log("🔄 Detected install script curl failure, attempting recovery...");
586
+ const installScriptUrl = `${process.env.VELLUM_ASSISTANT_PLATFORM_URL ?? "https://assistant.vellum.ai"}/install.sh`;
587
+ console.log(`🔄 Detected install script curl failure for ${installScriptUrl}, attempting recovery...`);
587
588
  await recoverFromCurlFailure(instanceName, project, zone, sshUser, account);
588
589
  console.log("✅ Recovery successful!");
589
590
  } else {
@@ -722,9 +723,9 @@ async function hatchLocal(species: Species, name: string | null): Promise<void>
722
723
  console.log("");
723
724
 
724
725
  console.log("🔨 Starting local daemon...");
725
- const daemonBinary = join(dirname(process.execPath), "vellum-daemon");
726
726
 
727
- if (existsSync(daemonBinary)) {
727
+ if (process.env.VELLUM_DESKTOP_APP) {
728
+ const daemonBinary = join(dirname(process.execPath), "vellum-daemon");
728
729
  const child = spawn(daemonBinary, [], {
729
730
  detached: true,
730
731
  stdio: "ignore",
@@ -748,7 +749,17 @@ async function hatchLocal(species: Species, name: string | null): Promise<void>
748
749
  console.warn("⚠️ Daemon socket did not appear within 10s — continuing anyway");
749
750
  }
750
751
  } else {
751
- const child = spawn("bunx", ["vellum", "daemon", "start"], {
752
+ const assistantDir = join(import.meta.dir, "..", "..", "..", "assistant");
753
+ const assistantIndex = join(assistantDir, "src", "index.ts");
754
+
755
+ if (!existsSync(assistantIndex)) {
756
+ throw new Error(
757
+ "vellum-daemon binary not found and assistant source not available.\n" +
758
+ " Ensure the daemon binary is bundled alongside the CLI, or run from the source tree.",
759
+ );
760
+ }
761
+
762
+ const child = spawn("bun", ["run", assistantIndex, "daemon", "start"], {
752
763
  stdio: "inherit",
753
764
  env: { ...process.env },
754
765
  });
@@ -1,20 +1,16 @@
1
- import { readFileSync } from "fs";
2
1
  import { join } from "path";
3
2
 
4
- const COMPONENTS_DIR = join(import.meta.dir, "..", "components");
5
- const CONSTANTS_PATH = join(import.meta.dir, "constants.ts");
3
+ const constantsSource = await Bun.file(join(import.meta.dir, "constants.ts")).text();
4
+ const defaultMainScreenSource = await Bun.file(join(import.meta.dir, "..", "components", "DefaultMainScreen.tsx")).text();
6
5
 
7
6
  function inlineLocalImports(source: string): string {
8
- const constantsSource = readFileSync(CONSTANTS_PATH, "utf-8");
9
-
10
7
  return source
11
8
  .replace(/import\s*\{[^}]*\}\s*from\s*["'][^"']*\/constants["'];?\s*\n/, constantsSource + "\n")
12
9
  .replace(/import\s*\{[^}]*\}\s*from\s*["']path["'];?\s*\n/, "");
13
10
  }
14
11
 
15
12
  export function buildInterfacesSeed(): string {
16
- const rawSource = readFileSync(join(COMPONENTS_DIR, "DefaultMainScreen.tsx"), "utf-8");
17
- const mainWindowSource = inlineLocalImports(rawSource);
13
+ const mainWindowSource = inlineLocalImports(defaultMainScreenSource);
18
14
 
19
15
  return `
20
16
  INTERFACES_SEED_DIR="/tmp/interfaces-seed"
@@ -1,10 +1,8 @@
1
- import { readFileSync } from "fs";
2
1
  import { join } from "path";
3
2
 
4
- const ADAPTER_PATH = join(import.meta.dir, "..", "adapters", "openclaw-http-server.ts");
3
+ const serverSource = await Bun.file(join(import.meta.dir, "..", "adapters", "openclaw-http-server.ts")).text();
5
4
 
6
5
  export function buildOpenclawRuntimeServer(): string {
7
- const serverSource = readFileSync(ADAPTER_PATH, "utf-8");
8
6
 
9
7
  return `
10
8
  cat > /opt/openclaw-runtime-server.ts << 'RUNTIME_SERVER_EOF'