@vellumai/cli 0.4.26 → 0.4.30
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/README.md +24 -24
- package/package.json +1 -1
- package/src/__tests__/assistant-config.test.ts +17 -5
- package/src/__tests__/retire-archive.test.ts +6 -2
- package/src/adapters/openclaw-http-server.ts +22 -7
- package/src/commands/autonomy.ts +10 -11
- package/src/commands/client.ts +25 -9
- package/src/commands/config.ts +2 -6
- package/src/commands/contacts.ts +5 -6
- package/src/commands/hatch.ts +131 -36
- package/src/commands/login.ts +6 -2
- package/src/commands/pair.ts +26 -9
- package/src/commands/ps.ts +55 -23
- package/src/commands/recover.ts +4 -2
- package/src/commands/retire.ts +59 -18
- package/src/commands/skills.ts +389 -0
- package/src/commands/sleep.ts +15 -3
- package/src/commands/ssh.ts +20 -13
- package/src/commands/tunnel.ts +6 -7
- package/src/commands/wake.ts +53 -9
- package/src/components/DefaultMainScreen.tsx +309 -99
- package/src/index.ts +5 -2
- package/src/lib/assistant-config.ts +9 -3
- package/src/lib/aws.ts +36 -11
- package/src/lib/constants.ts +3 -1
- package/src/lib/doctor-client.ts +23 -7
- package/src/lib/gcp.ts +74 -24
- package/src/lib/health-check.ts +14 -4
- package/src/lib/local.ts +249 -33
- package/src/lib/ngrok.ts +1 -3
- package/src/lib/openclaw-runtime-server.ts +7 -2
- package/src/lib/platform-client.ts +16 -3
- package/src/lib/xdg-log.ts +25 -5
package/src/commands/wake.ts
CHANGED
|
@@ -3,27 +3,41 @@ import { homedir } from "os";
|
|
|
3
3
|
import { join } from "path";
|
|
4
4
|
|
|
5
5
|
import { loadAllAssistants } from "../lib/assistant-config";
|
|
6
|
-
import { isProcessAlive } from "../lib/process";
|
|
7
|
-
import {
|
|
6
|
+
import { isProcessAlive, stopProcessByPidFile } from "../lib/process";
|
|
7
|
+
import {
|
|
8
|
+
startLocalDaemon,
|
|
9
|
+
startGateway,
|
|
10
|
+
startOutboundProxy,
|
|
11
|
+
} from "../lib/local";
|
|
8
12
|
|
|
9
13
|
export async function wake(): Promise<void> {
|
|
10
14
|
const args = process.argv.slice(3);
|
|
11
15
|
if (args.includes("--help") || args.includes("-h")) {
|
|
12
|
-
console.log("Usage: vellum wake");
|
|
16
|
+
console.log("Usage: vellum wake [options]");
|
|
13
17
|
console.log("");
|
|
14
|
-
console.log("Start the
|
|
18
|
+
console.log("Start the assistant and gateway processes.");
|
|
19
|
+
console.log("");
|
|
20
|
+
console.log("Options:");
|
|
21
|
+
console.log(
|
|
22
|
+
" --watch Run assistant and gateway in watch mode (hot reload on source changes)",
|
|
23
|
+
);
|
|
15
24
|
process.exit(0);
|
|
16
25
|
}
|
|
17
26
|
|
|
27
|
+
const watch = args.includes("--watch");
|
|
28
|
+
|
|
18
29
|
const assistants = loadAllAssistants();
|
|
19
30
|
const hasLocal = assistants.some((a) => a.cloud === "local");
|
|
20
31
|
if (!hasLocal) {
|
|
21
|
-
console.error(
|
|
32
|
+
console.error(
|
|
33
|
+
"Error: No local assistant found in lock file. Run 'vellum hatch local' first.",
|
|
34
|
+
);
|
|
22
35
|
process.exit(1);
|
|
23
36
|
}
|
|
24
37
|
|
|
25
38
|
const vellumDir = join(homedir(), ".vellum");
|
|
26
39
|
const pidFile = join(vellumDir, "vellum.pid");
|
|
40
|
+
const socketFile = join(vellumDir, "vellum.sock");
|
|
27
41
|
|
|
28
42
|
// Check if daemon is already running
|
|
29
43
|
let daemonRunning = false;
|
|
@@ -34,7 +48,16 @@ export async function wake(): Promise<void> {
|
|
|
34
48
|
try {
|
|
35
49
|
process.kill(pid, 0);
|
|
36
50
|
daemonRunning = true;
|
|
37
|
-
|
|
51
|
+
if (watch) {
|
|
52
|
+
// Restart in watch mode
|
|
53
|
+
console.log(
|
|
54
|
+
`Assistant running (pid ${pid}) — restarting in watch mode...`,
|
|
55
|
+
);
|
|
56
|
+
await stopProcessByPidFile(pidFile, "assistant", [socketFile]);
|
|
57
|
+
daemonRunning = false;
|
|
58
|
+
} else {
|
|
59
|
+
console.log(`Assistant already running (pid ${pid}).`);
|
|
60
|
+
}
|
|
38
61
|
} catch {
|
|
39
62
|
// Process not alive, will start below
|
|
40
63
|
}
|
|
@@ -42,7 +65,7 @@ export async function wake(): Promise<void> {
|
|
|
42
65
|
}
|
|
43
66
|
|
|
44
67
|
if (!daemonRunning) {
|
|
45
|
-
await startLocalDaemon();
|
|
68
|
+
await startLocalDaemon(watch);
|
|
46
69
|
}
|
|
47
70
|
|
|
48
71
|
// Start gateway (non-desktop only)
|
|
@@ -50,11 +73,32 @@ export async function wake(): Promise<void> {
|
|
|
50
73
|
const gatewayPidFile = join(vellumDir, "gateway.pid");
|
|
51
74
|
const { alive, pid } = isProcessAlive(gatewayPidFile);
|
|
52
75
|
if (alive) {
|
|
53
|
-
|
|
76
|
+
if (watch) {
|
|
77
|
+
// Restart in watch mode
|
|
78
|
+
console.log(
|
|
79
|
+
`Gateway running (pid ${pid}) — restarting in watch mode...`,
|
|
80
|
+
);
|
|
81
|
+
await stopProcessByPidFile(gatewayPidFile, "gateway");
|
|
82
|
+
await startGateway(undefined, watch);
|
|
83
|
+
} else {
|
|
84
|
+
console.log(`Gateway already running (pid ${pid}).`);
|
|
85
|
+
}
|
|
54
86
|
} else {
|
|
55
|
-
await startGateway();
|
|
87
|
+
await startGateway(undefined, watch);
|
|
56
88
|
}
|
|
57
89
|
}
|
|
58
90
|
|
|
91
|
+
// Start outbound proxy
|
|
92
|
+
const outboundProxyPidFile = join(vellumDir, "outbound-proxy.pid");
|
|
93
|
+
const outboundProxyStatus = isProcessAlive(outboundProxyPidFile);
|
|
94
|
+
if (outboundProxyStatus.alive && watch) {
|
|
95
|
+
// Restart in watch mode
|
|
96
|
+
console.log(
|
|
97
|
+
`Outbound proxy running (pid ${outboundProxyStatus.pid}) — restarting in watch mode...`,
|
|
98
|
+
);
|
|
99
|
+
await stopProcessByPidFile(outboundProxyPidFile, "outbound-proxy");
|
|
100
|
+
}
|
|
101
|
+
await startOutboundProxy(watch);
|
|
102
|
+
|
|
59
103
|
console.log("✅ Wake complete.");
|
|
60
104
|
}
|