volute 0.8.2 → 0.9.0
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/{agent-YORVRB6I.js → agent-MB3OTRRK.js} +8 -8
- package/dist/api-client-YPKOZP2O.js +10 -0
- package/dist/{channel-RDGHBFSI.js → channel-G5D4VBXY.js} +67 -82
- package/dist/chunk-4RQBJWQX.js +17 -0
- package/dist/{chunk-XSJ27WEM.js → chunk-AWHQZDB4.js} +16 -1
- package/dist/{chunk-23L3MKEV.js → chunk-STOEJOJO.js} +18 -4
- package/dist/{chunk-HZ5LTOEJ.js → chunk-YNNK4QN2.js} +16 -1
- package/dist/cli.js +15 -15
- package/dist/{connector-ZP6MEFF4.js → connector-PK7D5GTN.js} +38 -21
- package/dist/{daemon-client-54J3EIZD.js → daemon-client-P44NU3KU.js} +1 -1
- package/dist/{daemon-restart-CPBLMMRI.js → daemon-restart-EKDXXHKH.js} +7 -2
- package/dist/daemon.js +252 -56
- package/dist/{delete-45TGQC4N.js → delete-WKQKE3FT.js} +7 -4
- package/dist/{down-O4EWZTVA.js → down-4DGRZRJU.js} +1 -1
- package/dist/{env-KMNYGVZ2.js → env-HZMZSWWD.js} +85 -36
- package/dist/{history-PXJVYLVY.js → history-SH25BAA5.js} +13 -10
- package/dist/logs-V54B6QSG.js +77 -0
- package/dist/{package-TWWKVRRL.js → package-WPX6LCYE.js} +1 -1
- package/dist/{restart-KVH3TK5N.js → restart-CCYM3MEC.js} +10 -4
- package/dist/{schedule-HCUCBNQI.js → schedule-XGBUF7NU.js} +26 -10
- package/dist/{send-BNC2S5BY.js → send-TFZ62XPZ.js} +37 -29
- package/dist/{service-XCADRKIS.js → service-56CY4S6Z.js} +24 -0
- package/dist/{setup-2JDBGU7Y.js → setup-7SPMWF2O.js} +5 -3
- package/dist/{start-QU73YTJW.js → start-6YRS6FF6.js} +7 -2
- package/dist/{status-Q6ZQJXNI.js → status-SIMKH3ZE.js} +8 -3
- package/dist/{stop-N7U5N6A7.js → stop-UQSNF4CG.js} +7 -2
- package/dist/{up-V6EAA7OZ.js → up-J7AHQHIM.js} +1 -1
- package/dist/{update-EUCZ7XGG.js → update-3TGXUTO2.js} +10 -0
- package/dist/{upgrade-CZF6PN7Y.js → upgrade-BRNMSQBX.js} +13 -4
- package/dist/{variant-RKXPN5DH.js → variant-AQRAN6FR.js} +32 -15
- package/package.json +1 -1
- package/dist/logs-TZB3MTLZ.js +0 -37
|
@@ -12,9 +12,19 @@ import {
|
|
|
12
12
|
import "./chunk-K3NQKI34.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/update.ts
|
|
15
|
+
import { execFileSync } from "child_process";
|
|
15
16
|
import { existsSync, readFileSync, unlinkSync } from "fs";
|
|
16
17
|
import { resolve } from "path";
|
|
17
18
|
async function run(_args) {
|
|
19
|
+
try {
|
|
20
|
+
execFileSync("systemctl", ["is-enabled", "--quiet", "volute"]);
|
|
21
|
+
console.error("Volute is managed by a systemd service.");
|
|
22
|
+
console.error("To update, run:");
|
|
23
|
+
console.error(" sudo npm install -g volute@latest");
|
|
24
|
+
console.error(" sudo systemctl restart volute");
|
|
25
|
+
process.exit(1);
|
|
26
|
+
} catch {
|
|
27
|
+
}
|
|
18
28
|
const result = await checkForUpdate();
|
|
19
29
|
if (result.checkFailed) {
|
|
20
30
|
console.error("Could not reach npm registry. Check your network connection and try again.");
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveAgentName
|
|
4
4
|
} from "./chunk-AZEL2IEK.js";
|
|
5
|
+
import {
|
|
6
|
+
daemonFetch
|
|
7
|
+
} from "./chunk-STOEJOJO.js";
|
|
5
8
|
import {
|
|
6
9
|
composeTemplate,
|
|
7
10
|
copyTemplateToDir,
|
|
@@ -14,14 +17,15 @@ import {
|
|
|
14
17
|
exec,
|
|
15
18
|
execInherit
|
|
16
19
|
} from "./chunk-5C5JWR2L.js";
|
|
17
|
-
import {
|
|
18
|
-
daemonFetch
|
|
19
|
-
} from "./chunk-23L3MKEV.js";
|
|
20
20
|
import {
|
|
21
21
|
addVariant,
|
|
22
22
|
nextPort,
|
|
23
23
|
resolveAgent
|
|
24
24
|
} from "./chunk-DP2DX4WV.js";
|
|
25
|
+
import {
|
|
26
|
+
getClient,
|
|
27
|
+
urlOf
|
|
28
|
+
} from "./chunk-4RQBJWQX.js";
|
|
25
29
|
import "./chunk-K3NQKI34.js";
|
|
26
30
|
|
|
27
31
|
// src/commands/upgrade.ts
|
|
@@ -194,8 +198,13 @@ async function installAndVerify(agentName, worktreeDir) {
|
|
|
194
198
|
});
|
|
195
199
|
console.log("Starting upgrade variant...");
|
|
196
200
|
try {
|
|
201
|
+
const client = getClient();
|
|
197
202
|
const res = await daemonFetch(
|
|
198
|
-
|
|
203
|
+
urlOf(
|
|
204
|
+
client.api.agents[":name"].start.$url({
|
|
205
|
+
param: { name: `${agentName}@${VARIANT_NAME}` }
|
|
206
|
+
})
|
|
207
|
+
),
|
|
199
208
|
{ method: "POST" }
|
|
200
209
|
);
|
|
201
210
|
if (!res.ok) {
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveAgentName
|
|
4
4
|
} from "./chunk-AZEL2IEK.js";
|
|
5
|
+
import {
|
|
6
|
+
daemonFetch
|
|
7
|
+
} from "./chunk-STOEJOJO.js";
|
|
5
8
|
import {
|
|
6
9
|
parseArgs
|
|
7
10
|
} from "./chunk-D424ZQGI.js";
|
|
@@ -9,9 +12,6 @@ import {
|
|
|
9
12
|
exec,
|
|
10
13
|
execInherit
|
|
11
14
|
} from "./chunk-5C5JWR2L.js";
|
|
12
|
-
import {
|
|
13
|
-
daemonFetch
|
|
14
|
-
} from "./chunk-23L3MKEV.js";
|
|
15
15
|
import {
|
|
16
16
|
addVariant,
|
|
17
17
|
checkHealth,
|
|
@@ -23,6 +23,10 @@ import {
|
|
|
23
23
|
validateBranchName,
|
|
24
24
|
writeVariants
|
|
25
25
|
} from "./chunk-DP2DX4WV.js";
|
|
26
|
+
import {
|
|
27
|
+
getClient,
|
|
28
|
+
urlOf
|
|
29
|
+
} from "./chunk-4RQBJWQX.js";
|
|
26
30
|
import "./chunk-K3NQKI34.js";
|
|
27
31
|
|
|
28
32
|
// src/commands/variant.ts
|
|
@@ -239,11 +243,14 @@ async function createVariant(args) {
|
|
|
239
243
|
if (!noStart) {
|
|
240
244
|
if (!json) console.log("Starting variant via daemon...");
|
|
241
245
|
try {
|
|
246
|
+
const client = getClient();
|
|
242
247
|
const res = await daemonFetch(
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
248
|
+
urlOf(
|
|
249
|
+
client.api.agents[":name"].start.$url({
|
|
250
|
+
param: { name: `${agentName}@${variantName}` }
|
|
251
|
+
})
|
|
252
|
+
),
|
|
253
|
+
{ method: "POST" }
|
|
247
254
|
);
|
|
248
255
|
if (!res.ok) {
|
|
249
256
|
const data = await res.json();
|
|
@@ -421,11 +428,15 @@ async function mergeVariant(args) {
|
|
|
421
428
|
};
|
|
422
429
|
try {
|
|
423
430
|
console.log("Restarting agent via daemon...");
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
431
|
+
const client = getClient();
|
|
432
|
+
const res = await daemonFetch(
|
|
433
|
+
urlOf(client.api.agents[":name"].restart.$url({ param: { name: agentName } })),
|
|
434
|
+
{
|
|
435
|
+
method: "POST",
|
|
436
|
+
headers: { "Content-Type": "application/json" },
|
|
437
|
+
body: JSON.stringify({ context })
|
|
438
|
+
}
|
|
439
|
+
);
|
|
429
440
|
if (res.ok) {
|
|
430
441
|
console.log(`${agentName} restarted.`);
|
|
431
442
|
} else {
|
|
@@ -453,9 +464,15 @@ async function deleteVariant(args) {
|
|
|
453
464
|
process.exit(1);
|
|
454
465
|
}
|
|
455
466
|
try {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
467
|
+
const client = getClient();
|
|
468
|
+
await daemonFetch(
|
|
469
|
+
urlOf(
|
|
470
|
+
client.api.agents[":name"].stop.$url({
|
|
471
|
+
param: { name: `${agentName}@${variantName}` }
|
|
472
|
+
})
|
|
473
|
+
),
|
|
474
|
+
{ method: "POST" }
|
|
475
|
+
);
|
|
459
476
|
} catch {
|
|
460
477
|
}
|
|
461
478
|
if (existsSync(variant.path)) {
|
package/package.json
CHANGED
package/dist/logs-TZB3MTLZ.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
resolveAgentName
|
|
4
|
-
} from "./chunk-AZEL2IEK.js";
|
|
5
|
-
import {
|
|
6
|
-
parseArgs
|
|
7
|
-
} from "./chunk-D424ZQGI.js";
|
|
8
|
-
import {
|
|
9
|
-
resolveAgent,
|
|
10
|
-
stateDir
|
|
11
|
-
} from "./chunk-DP2DX4WV.js";
|
|
12
|
-
import "./chunk-K3NQKI34.js";
|
|
13
|
-
|
|
14
|
-
// src/commands/logs.ts
|
|
15
|
-
import { spawn } from "child_process";
|
|
16
|
-
import { existsSync } from "fs";
|
|
17
|
-
import { resolve } from "path";
|
|
18
|
-
async function run(args) {
|
|
19
|
-
const { flags } = parseArgs(args, {
|
|
20
|
-
agent: { type: "string" },
|
|
21
|
-
follow: { type: "boolean" },
|
|
22
|
-
n: { type: "number" }
|
|
23
|
-
});
|
|
24
|
-
const name = resolveAgentName(flags);
|
|
25
|
-
resolveAgent(name);
|
|
26
|
-
const logFile = resolve(stateDir(name), "logs", "agent.log");
|
|
27
|
-
if (!existsSync(logFile)) {
|
|
28
|
-
console.error(`No log file found. Has ${name} been started?`);
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
const tailArgs = [`-n`, String(flags.n ?? 50), ...flags.follow ? ["-f"] : [], logFile];
|
|
32
|
-
const child = spawn("tail", tailArgs, { stdio: "inherit" });
|
|
33
|
-
child.on("exit", (code) => process.exit(code ?? 0));
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
run
|
|
37
|
-
};
|