@vellumai/cli 0.4.52 → 0.4.53
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/bun.lock +1 -0
- package/knip.json +2 -4
- package/package.json +2 -1
- package/src/commands/recover.ts +1 -3
- package/src/commands/wake.ts +32 -13
- package/src/lib/local.ts +14 -0
package/bun.lock
CHANGED
package/knip.json
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"entry": ["src/**/*.test.ts", "src/**/__tests__/**/*.ts"],
|
|
3
|
-
"project": ["src/**/*.ts", "src/**/*.tsx"]
|
|
4
|
-
"ignore": ["src/adapters/openclaw-http-server.ts"],
|
|
5
|
-
"ignoreDependencies": ["chalk"]
|
|
2
|
+
"entry": ["src/**/*.test.ts", "src/**/__tests__/**/*.ts", "src/adapters/openclaw-http-server.ts"],
|
|
3
|
+
"project": ["src/**/*.ts", "src/**/*.tsx"]
|
|
6
4
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vellumai/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.53",
|
|
4
4
|
"description": "CLI tools for vellum-assistant",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"author": "Vellum AI",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"chalk": "^5.6.0",
|
|
27
28
|
"ink": "^6.7.0",
|
|
28
29
|
"jsqr": "^1.4.0",
|
|
29
30
|
"pngjs": "^7.0.0",
|
package/src/commands/recover.ts
CHANGED
|
@@ -68,9 +68,7 @@ export async function recover(): Promise<void> {
|
|
|
68
68
|
|
|
69
69
|
// 7. Start daemon + gateway (same as wake)
|
|
70
70
|
await startLocalDaemon(false, entry.resources);
|
|
71
|
-
|
|
72
|
-
await startGateway(false, entry.resources);
|
|
73
|
-
}
|
|
71
|
+
await startGateway(false, entry.resources);
|
|
74
72
|
|
|
75
73
|
console.log(`✅ Recovered assistant '${name}'.`);
|
|
76
74
|
}
|
package/src/commands/wake.ts
CHANGED
|
@@ -3,7 +3,11 @@ import { join } from "path";
|
|
|
3
3
|
|
|
4
4
|
import { resolveTargetAssistant } from "../lib/assistant-config.js";
|
|
5
5
|
import { isProcessAlive, stopProcessByPidFile } from "../lib/process";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
isWatchModeAvailable,
|
|
8
|
+
startLocalDaemon,
|
|
9
|
+
startGateway,
|
|
10
|
+
} from "../lib/local";
|
|
7
11
|
import { maybeStartNgrokTunnel } from "../lib/ngrok";
|
|
8
12
|
|
|
9
13
|
export async function wake(): Promise<void> {
|
|
@@ -56,12 +60,21 @@ export async function wake(): Promise<void> {
|
|
|
56
60
|
process.kill(pid, 0);
|
|
57
61
|
daemonRunning = true;
|
|
58
62
|
if (watch) {
|
|
59
|
-
// Restart in watch mode
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
// Restart in watch mode — but only if source files are available.
|
|
64
|
+
// Watch mode requires bun --watch with .ts sources; packaged desktop
|
|
65
|
+
// builds only have a compiled binary. Stopping the daemon without a
|
|
66
|
+
// viable watch-mode path would leave the user with no running assistant.
|
|
67
|
+
if (!isWatchModeAvailable()) {
|
|
68
|
+
console.log(
|
|
69
|
+
`Assistant running (pid ${pid}) — watch mode not available (no source files). Keeping existing process.`,
|
|
70
|
+
);
|
|
71
|
+
} else {
|
|
72
|
+
console.log(
|
|
73
|
+
`Assistant running (pid ${pid}) — restarting in watch mode...`,
|
|
74
|
+
);
|
|
75
|
+
await stopProcessByPidFile(pidFile, "assistant");
|
|
76
|
+
daemonRunning = false;
|
|
77
|
+
}
|
|
65
78
|
} else {
|
|
66
79
|
console.log(`Assistant already running (pid ${pid}).`);
|
|
67
80
|
}
|
|
@@ -82,12 +95,18 @@ export async function wake(): Promise<void> {
|
|
|
82
95
|
const { alive, pid } = isProcessAlive(gatewayPidFile);
|
|
83
96
|
if (alive) {
|
|
84
97
|
if (watch) {
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
// Same guard as the daemon: only restart if watch mode is viable.
|
|
99
|
+
if (!isWatchModeAvailable()) {
|
|
100
|
+
console.log(
|
|
101
|
+
`Gateway running (pid ${pid}) — watch mode not available (no source files). Keeping existing process.`,
|
|
102
|
+
);
|
|
103
|
+
} else {
|
|
104
|
+
console.log(
|
|
105
|
+
`Gateway running (pid ${pid}) — restarting in watch mode...`,
|
|
106
|
+
);
|
|
107
|
+
await stopProcessByPidFile(gatewayPidFile, "gateway");
|
|
108
|
+
await startGateway(watch, resources);
|
|
109
|
+
}
|
|
91
110
|
} else {
|
|
92
111
|
console.log(`Gateway already running (pid ${pid}).`);
|
|
93
112
|
}
|
package/src/lib/local.ts
CHANGED
|
@@ -715,6 +715,20 @@ export function getLocalLanIPv4(): string | undefined {
|
|
|
715
715
|
return undefined;
|
|
716
716
|
}
|
|
717
717
|
|
|
718
|
+
/**
|
|
719
|
+
* Check whether watch-mode startup is possible. Watch mode requires source
|
|
720
|
+
* files (bun --watch only works with .ts sources, not compiled binaries).
|
|
721
|
+
* Returns true when assistant source can be resolved, false otherwise.
|
|
722
|
+
*
|
|
723
|
+
* Use this before stopping a running assistant for a watch-mode restart — if
|
|
724
|
+
* watch mode isn't available (e.g. packaged desktop app without source), the
|
|
725
|
+
* caller should keep the existing process alive rather than killing it and
|
|
726
|
+
* failing.
|
|
727
|
+
*/
|
|
728
|
+
export function isWatchModeAvailable(): boolean {
|
|
729
|
+
return resolveAssistantIndexPath() !== undefined;
|
|
730
|
+
}
|
|
731
|
+
|
|
718
732
|
// NOTE: startLocalDaemon() is the CLI-side daemon lifecycle manager.
|
|
719
733
|
// It should eventually converge with
|
|
720
734
|
// assistant/src/daemon/daemon-control.ts::startDaemon which is the
|