@vellumai/cli 0.4.56 → 0.4.57
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/AGENTS.md +5 -10
- package/package.json +1 -1
- package/src/commands/client.ts +2 -1
- package/src/commands/hatch.ts +2 -2
- package/src/commands/pair.ts +17 -1
- package/src/commands/ps.ts +88 -2
- package/src/commands/upgrade.ts +366 -0
- package/src/index.ts +6 -1
- package/src/lib/assistant-config.ts +2 -0
- package/src/lib/aws.ts +1 -3
- package/src/lib/docker.ts +271 -261
- package/src/lib/gcp.ts +1 -3
- package/src/lib/guardian-token.ts +17 -0
- package/src/lib/process.ts +1 -1
package/src/lib/gcp.ts
CHANGED
|
@@ -646,9 +646,7 @@ export async function hatchGcp(
|
|
|
646
646
|
}
|
|
647
647
|
|
|
648
648
|
try {
|
|
649
|
-
|
|
650
|
-
gcpEntry.bearerToken = tokenData.accessToken;
|
|
651
|
-
saveAssistantEntry(gcpEntry);
|
|
649
|
+
await leaseGuardianToken(runtimeUrl, instanceName);
|
|
652
650
|
} catch (err) {
|
|
653
651
|
console.warn(
|
|
654
652
|
`\u26a0\ufe0f Could not lease guardian token: ${err instanceof Error ? err.message : err}`,
|
|
@@ -120,6 +120,23 @@ export function computeDeviceId(): string {
|
|
|
120
120
|
return getOrCreatePersistedDeviceId();
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Read a previously persisted guardian token for the given assistant.
|
|
125
|
+
* Returns the parsed token data, or null if the file does not exist or is
|
|
126
|
+
* unreadable.
|
|
127
|
+
*/
|
|
128
|
+
export function loadGuardianToken(
|
|
129
|
+
assistantId: string,
|
|
130
|
+
): GuardianTokenData | null {
|
|
131
|
+
const tokenPath = getGuardianTokenPath(assistantId);
|
|
132
|
+
try {
|
|
133
|
+
const raw = readFileSync(tokenPath, "utf-8");
|
|
134
|
+
return JSON.parse(raw) as GuardianTokenData;
|
|
135
|
+
} catch {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
123
140
|
export function saveGuardianToken(
|
|
124
141
|
assistantId: string,
|
|
125
142
|
data: GuardianTokenData,
|
package/src/lib/process.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { existsSync, readFileSync, unlinkSync } from "fs";
|
|
|
6
6
|
* command line via `ps`. Prevents killing unrelated processes when a PID file
|
|
7
7
|
* is stale and the OS has reused the PID.
|
|
8
8
|
*/
|
|
9
|
-
function isVellumProcess(pid: number): boolean {
|
|
9
|
+
export function isVellumProcess(pid: number): boolean {
|
|
10
10
|
try {
|
|
11
11
|
const output = execFileSync("ps", ["-p", String(pid), "-o", "command="], {
|
|
12
12
|
encoding: "utf-8",
|